diff --git a/.eslintignore b/.eslintignore index c9ec50de9..fae3d88e4 100644 --- a/.eslintignore +++ b/.eslintignore @@ -8,8 +8,10 @@ src/geom/polygon/Earcut.js src/utils/array/StableSort.js src/utils/object/Extend.js src/structs/RTree.js +src/layer3d/ plugins/spine/dist/ plugins/spine/src/runtimes/ +scripts/ webpack.* webpack.config.js webpack.dist.config.js diff --git a/.gitattributes b/.gitattributes index 871b5b8db..2261d739a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,7 +7,11 @@ *.ts text *.md text *.json text +*.vert text +*.frag text # Denote all files that are truly binary and should not be modified. *.png binary *.jpg binary +*.ico binary +*.gif binary diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 73b1e5203..ccd8cafd8 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,7 +9,7 @@ Thank you for taking the time to contribute towards Phaser. Before submitting yo 1. This repo is for Phaser 3 only. Phaser 2.x issues should be raised in the [Phaser CE](https://github.com/photonstorm/phaser-ce) repo. -2. This repo should not be used for technical support. If you're struggling to use Phaser then post your question to the [forum](https://phaser.discourse.group/), [Slack](https://phaser.io/community/slack) or [Discord](https://phaser.io/community/discord) channels. GitHub Issues are for bugs and feature requests only. +2. This repo should not be used for technical support. If you're struggling to use Phaser then post your question to the [forum](https://phaser.discourse.group/) or [Discord](https://phaser.io/community/discord) channels. GitHub Issues are for bugs and feature requests only. 3. Make sure your issue isn't a duplicate, or has already been fixed. diff --git a/CHANGELOG-v3.50.md b/CHANGELOG-v3.50.md index d7130a774..b3ff19ca0 100644 --- a/CHANGELOG-v3.50.md +++ b/CHANGELOG-v3.50.md @@ -10,6 +10,8 @@ Due to the huge amount of work that has taken place in this area, all of the pip * `TextureTintStripPipeline` is now called the `RopePipeline`. * `ForwardDiffuseLightPipeline` is now called the `LightPipeline`. +There is also the new `GraphicsPipeline`. Previously, the `TextureTintPipeline` was responsible for rendering all Sprites, Graphics and Shape objects. Now, it only renders Sprites. All Graphics and Shapes are handled by the new `GraphicsPipeline` which uses its own shaders. See below for details about this change. + To match the new pipeline names, the shader source code has also been renamed. * `ForwardDiffuse.frag` is now called `Light.frag`. @@ -18,6 +20,7 @@ To match the new pipeline names, the shader source code has also been renamed. Other pipeline changes are as follows: +* None of the shaders or pipelines use the `uViewMatrix` and `uModelMatrix` uniforms any longer. These were always just plain identity matrices, so there is no point spending CPU and GPU time to set them as uniforms, or use them in the shaders. Should you need these uniforms, you can add them to your own custom pipelines. * `Types.Renderer.WebGL.WebGLPipelineConfig` is a new TypeDef that helps you easily configure your own Custom Pipeline when using TypeScript and also provides better JSDocs. * `Types.Renderer.WebGL.WebGLPipelineAttributesConfig` is a new TypeDef that helps you easily configure the attributes for your own Custom Pipelines when using TypeScript and also provides better JSDocs. * All pipelines will now work out the `renderer` property automatically, so it's no longer required in the config. @@ -29,6 +32,71 @@ Other pipeline changes are as follows: * All pipelines will now extract the `attributes` property from the config, allowing you to set it externally. * All pipelines will now extract the `topology` property from the config, allowing you to set it externally. * The `WebGLPipeline.shouldFlush` method now accepts an optional parameter `amount`. If given, it will return `true` if when the amount is added to the vertex count it will exceed the vertex capacity. The Multi Pipeline has been updated to now use this method instead of performing the comparison multiple times itself. +* The `RopePipeline` now extends `MultiPipeline` and just changes the topology, vastly reducing the filesize. +* The `WebGLPipeline.flushLocked` property has been removed. A pipeline can never flush in the middle of a flush anyway, so it was just wasting CPU cycles being set. +* You can now pass a pipeline instance to the `GameObject.setPipeline` method, as well as a string. +* `WebGLPipeline.manager` is a new property that is a reference to the WebGL Pipeline Manager. +* `WebGLPipeline.currentUnit` is a new property that holds the most recently assigned texture unit. Treat as read-only. +* `WebGLPipeline.forceZero` is a new boolean property that sets if the pipeline should force the use of texture zero. +* `WebGLPipeline.hasBooted` is a new boolean property that is set once the pipeline has finished setting itself up and has booted. +* `WebGLPipeline.isPostFX` is a new boolean property that is only set by Post FX Pipelines to help identify them. +* `WebGLPipeline.renderTargets` is a new property that holds an array of WebGL Render Targets belonging to the pipeline. +* `WebGLPipeline.currentRenderTarget` is a new property that holds a reference to the currently bound Render Target. +* `WebGLPipeline.shaders` is a new property that holds an array of all WebGLShader instances that belong to the pipeline. +* `WebGLPipeline.currentShader` is a new property that holds a reference to the currently active shader within the pipeline. +* `WebGLPipeline.config` is a new property that holds the pipeline configuration object used to create it. +* `WebGLPipeline.projectionMatrix` is a new property that holds a Matrix4 used as the projection matrix for the pipeline. +* `WebGLPipeline.setProjectionMatrix` is a new method that allows you to set the ortho projection matrix of the pipeline. +* `WebGLPipeline.boot` will now check all of the attributes and store the pointer location within the attribute entry. +* `WebGLPipeline.bind` no longer looks-up and enables every attribute, every frame. Instead, it uses the cached pointer location stored in the attribute entry, cutting down on redundant WebGL operations. +* `WebGLPipeline.setAttribPointers` is a new method that will set the vertex attribute pointers for the pipeline. +* `WebGLPipeline.setShader` is a new method that allows you to set the currently active shader within the pipeline. +* `WebGLPipeline.getShaderByName` is a new method that allows you to get a shader from the pipeline based on its name. +* `WebGLPipeline.setShadersFromConfig` is a new method that destroys all current shaders and creates brand new ones parsed from the given config object. This is part of the pipeline boot process, but also exposed should you need to call it directly. +* `WebGLPipeline.setGameObject` is a new method that custom pipelines can use in order to perform pre-batch tasks for the given Game Object. +* `WebGLPipeline.setVertexBuffer` is a new method that checks if the pipelines vertex buffer is active, or not, and if not, binds it as the active buffer. This used to be performed by the WebGL Renderer, but pipelines now manage this directly. +* `WebGLPipeline.preBatch` is a new method that is called when a new quad is about to be added to the batch. This is used by Post FX Pipelines to set frame buffers. +* `WebGLPipeline.postBatch` is a new method that is called after a quad has been added to the batch. This is used by Post FX Pipelines to apply post processing. +* `WebGLPipeline.unbind` is a new method that unbinds the current Render Target, if one is set. +* `WebGLPipeline.batchVert` is a new method that adds a single vertex to the vertex buffer and increments the count by 1. +* `WebGLPipeline.batchQuad` is a new method that adds a single quad (6 vertices) to the vertex buffer and increments the count, flushing first if adding the quad would exceed the batch limit. +* `WebGLPipeline.batchTri` is a new method that adds a single tri (3 vertices) to the vertex buffer and increments the count, flushing first if adding the tri would exceed the batch limit. +* `WebGLPipeline.drawFillRect` is a new method that pushes a filled rectangle into the vertex batch. +* `WebGLPipeline.setTexture2D` is a new method that sets the texture to be bound to the next available texture unit. +* `WebGLPipeline.bindTexture` is a new method that immediately activates the given WebGL Texture and binds it to the requested slot. +* `WebGLPipeline.bindRenderTarget` is a new method that binds the given Render Target to a given texture slot. +* `WebGLPipeline.setTime` is a new method that gets the current game loop duration to the given shader uniform. + +### Pipeline Hooks + +WebGL Pipeline has lots of new hooks you can use. These are all empty by default so you can safely override them in your own classes and take advantage of them: + +* `WebGLPipeline.onBoot` is a new hook you can override in your own pipelines that is called when the pipeline has booted. +* `WebGLPipeline.onResize` is a new hook you can override in your own pipelines that is called when the pipeline is resized. +* `WebGLPipeline.onDraw` is a new hook you can override in your own pipelines that is called by Post FX Pipelines every time `postBatch` is invoked. +* `WebGLPipeline.onActive` is a new hook you can override in your own pipelines that is called every time the Pipeline Manager makes the pipeline the active pipeline. +* `WebGLPipeline.onBind` is a new hook you can override in your own pipelines that is called every time a Game Object asks the Pipeline Manager to use this pipeline, even if it's already active. +* `WebGLPipeline.onRebind` is a new hook you can override in your own pipelines that is called every time the Pipeline Manager needs to reset and rebind the current pipeline. +* `WebGLPipeline.onBatch` is a new hook you can override in your own pipelines that is called _after_ a new quad (or tri) has been added to the batch. +* `WebGLPipeline.onPreBatch` is a new hook you can override in your own pipelines that is called _before_ a new Game Object is about to process itself through the batch. +* `WebGLPipeline.onPostBatch` is a new hook you can override in your own pipelines that is called _after_ a new Game Object has added itself to the batch. +* `WebGLPipeline.onPreRender` is a new hook you can override in your own pipelines that is called once, per frame, right before anything has been rendered. +* `WebGLPipeline.onRender` is a new hook you can override in your own pipelines that is called once, per frame, by every Camera in the Scene that wants to render, at the start of the render process. +* `WebGLPipeline.onPostRender` is a new hook you can override in your own pipelines that is called once, per frame, after all rendering has happened and snapshots have been taken. +* `WebGLPipeline.onBeforeFlush` is a new hook you can override in your own pipelines that is called immediately before the `gl.bufferData` and `gl.drawArrays` calls are made, so you can perform any final pre-render modifications. +* `WebGLPipeline.onAfterFlush` is a new hook you can override in your own pipelines that is called after `gl.drawArrays`, so you can perform additional post-render effects. + +### Pipeline Events + +The WebGL Pipeline class now extends Event Emitter and emits the following events: + +* The `WebGL.Pipelines.Events.AFTER_FLUSH` event is dispatched by a WebGL Pipeline right after it has issued a `drawArrays` command. +* The `WebGL.Pipelines.Events.BEFORE_FLUSH` event is dispatched by a WebGL Pipeline right before it is about to flush. +* The `WebGL.Pipelines.Events.BIND` event is dispatched by a WebGL Pipeline when it is bound by the Pipeline Manager. +* The `WebGL.Pipelines.Events.BOOT` event is dispatched by a WebGL Pipeline when it has finished booting. +* The `WebGL.Pipelines.Events.DESTROY` event is dispatched by a WebGL Pipeline when it begins its destruction process. +* The `WebGL.Pipelines.Events.REBIND` event is dispatched by a WebGL Pipeline when the Pipeline Manager resets and rebinds it. +* The `WebGL.Pipelines.Events.RESIZE` event is dispatched by a WebGL Pipeline when it is resized, usually as a result of the Renderer. ### Pipeline Uniform Changes @@ -76,6 +144,11 @@ If your code uses any of the old method names, please update them using the list * `WebGLPipeline.setMatrix2` has been removed. Please use `setMatrix3fv` instead. * `WebGLPipeline.setMatrix3` has been removed. Please use `setMatrix4fv` instead. + +### Post FX Pipelines + +TODO - Explain them here + pipeline component updates. + ### Pipeline Manager The `WebGL.PipelineManager` is a new class that is responsbile for managing all of the WebGL Pipelines in Phaser. An instance of the Pipeline Manager is created by the WebGL Renderer and is available under the `pipelines` property. This means that the WebGL Renderer no longer handles pipelines directly, causing the following API changes: @@ -147,7 +220,6 @@ All of the internal functions, such as `batchQuad` and `batchSprite` have been u * The `TextureTintPipeline.batches` property has been removed, as it's no longer required. * `TextureTintPipeline.flush` has been rewritten to support multi-textures. * `TextureTintPipeline.flush` no longer creates a sub-array if the batch is full, but instead uses `bufferData` for speed. -* `WebGLPipeline.currentUnit` is a new property that holds the most recently assigned texture unit. Treat as read-only. * `WebGLRenderer.setTextureSource` is a new method, used by pipelines and Game Objects, that will assign a texture unit to the given Texture Source. * The `WebGLRenderer.setTexture2D` method has been updated to use the new texture unit assignment. It no longer takes the `textureUnit` or `flush` parameters and these have been removed from its method signature. * `WebGLRenderer.setTextureZero` is a new method that activates texture zero and binds the given texture to it. Useful for fbo backed game objects. @@ -157,13 +229,138 @@ All of the internal functions, such as `batchQuad` and `batchSprite` have been u * `WebGLRenderer.setNormalMap` is a new method that sets the current normal map texture. * `WebGLRenderer.clearNormalMap` is a new method that clears the current normal map texture. * `WebGLRenderer.resetTextures` is a new method that flushes the pipeline, resets all textures back to the temporary ones, and resets the active texture counter. -* `WebGLPipeline.boot` will now check all of the attributes and store the pointer location within the attribute entry. -* `WebGLPipeline.bind` no longer looks-up and enables every attribute, every frame. Instead, it uses the cached pointer location stored in the attribute entry, cutting down on redundant WebGL operations. * `WebGLRenderer.isNewNormalMap` is a new method that returns a boolean if the given parameters are not currently used. -* `WebGLPipeline.forceZero` is a new property that informs Game Objects if the pipeline requires a zero bound texture unit. -* `WebGLPipeline.setAttribPointers` is a new method that will set the vertex attribute pointers for the pipeline. * `WebGLRenderer.unbindTextures` is a new method that will activate and then null bind all WebGL textures. * `Renderer.WebGL.Utils.parseFragmentShaderMaxTextures` is a new function that will take fragment shader source and search it for `%count%` and `%forloop%` declarations, replacing them with the required GLSL for multi-texture support, returning the modified source. +* The `WebGL.Utils.getComponentCount` function has been removed as this is no longer required internally. + +### WebGLRenderer New Features, Updates and API Changes + +* `WebGLRenderer.instancedArraysExtension` is a new property that holds the WebGL Extension for instanced array drawing, if supported by the browser. +* `WebGLRenderer.vaoExtension` is a new property that holds a reference to the Vertex Array Object WebGL Extension, if supported by the browser. +* `WebGLRenderer.resetProgram` is a new method that will rebind the current program, without flushing or changing any properties. +* `WebGLRenderer.textureFlush` is a new property that keeps track of the total texture flushes per frame. +* `WebGLRenderer.finalType` is a new boolean property that signifies if the current Game Object being rendered is the final one in the list. +* The `WebGLRenderer.updateCanvasTexture` method will now set `gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL` to true, which should stop issues where you update a Text Game Object, having added a Render Texture or Spine Game Object to the Scene after it, which switches the PMA setting. Fix #5064 #5155 (thanks @hugoruscitti @immangrove-supertree) +* `WebGLRenderer.previousPipeline` is a new property that is set during a call to `clearPipeline` and used during calls to `rebindPipeline`, allowing the renderer to rebind any previous pipeline, not just the Multi Pipeline. +* The `WebGLRenderer.rebindPipeline` method has been changed slightly. Previously, you had to specify the `pipelineInstance`, but this is now optional. If you don't, it will use the new `previousPipeline` property instead. If not set, or none given, it will now return without throwing gl errors as well. +* `WebGLRenderer.defaultScissor` is a new property that holds the default scissor dimensions for the renderer. This is modified during `resize` and avoids continuous array generation in the `preRender` loop. +* The `WebGLRenderer.nativeTextures` array has been removed and any WebGLTextures created by the renderer are no longer stored within it. All WebGLTexture instances are stored in the `TextureSource` objects anyway, or by local classes such as RenderTexture, so there was no need to have another array taking up memroy. +* The `WebGLRenderer.deleteTexture` method has a new optional boolean parameter `reset` which allows you to control if the `WebGLRenderer.resetTextures` method is called, or not, after the texture is deleted. +* The `WebGLRenderer.getMaxTextures` method has been removed. This is no longer needed as you can use the `WebGLRenderer.maxTextures` property instead. +* The `WebGLRenderer.setProgram` method now returns a boolean. `true` if the program was set, otherwise `false`. +* `WebGLRenderer.setFloat1` has been removed. Use `WebGLPipeline.set1f` or `WebGLShader.set1f` instead. +* `WebGLRenderer.setFloat2` has been removed. Use `WebGLPipeline.set2f` or `WebGLShader.set2f` instead. +* `WebGLRenderer.setFloat3` has been removed. Use `WebGLPipeline.set3f` or `WebGLShader.set3f` instead. +* `WebGLRenderer.setFloat4` has been removed. Use `WebGLPipeline.set4f` or `WebGLShader.set4f` instead. +* `WebGLRenderer.setFloat1v` has been removed. Use `WebGLPipeline.set1fv` or `WebGLShader.set1fv` instead. +* `WebGLRenderer.setFloat2v` has been removed. Use `WebGLPipeline.set1fv` or `WebGLShader.set2fv` instead. +* `WebGLRenderer.setFloat3v` has been removed. Use `WebGLPipeline.set1fv` or `WebGLShader.set3fv` instead. +* `WebGLRenderer.setFloat4v` has been removed. Use `WebGLPipeline.set1fv` or `WebGLShader.set4fv` instead. +* `WebGLRenderer.setInt1` has been removed. Use `WebGLPipeline.set1fi` or `WebGLShader.set1i` instead. +* `WebGLRenderer.setInt2` has been removed. Use `WebGLPipeline.set1fi` or `WebGLShader.set2i` instead. +* `WebGLRenderer.setInt3` has been removed. Use `WebGLPipeline.set1fi` or `WebGLShader.set3i` instead. +* `WebGLRenderer.setInt4` has been removed. Use `WebGLPipeline.set1fi` or `WebGLShader.set4i` instead. +* `WebGLRenderer.setMatrix2` has been removed. Use `WebGLPipeline.setMatrix2fv` or `WebGLShader.setMatrix2fv` instead. +* `WebGLRenderer.setMatrix3` has been removed. Use `WebGLPipeline.setMatrix3fv` or `WebGLShader.setMatrix3fv` instead. +* `WebGLRenderer.setMatrix4` has been removed. Use `WebGLPipeline.setMatrix4fv` or `WebGLShader.setMatrix4fv` instead. +* The `WebGLRenderer._tempMatrix1`, `_tempMatrtix2`, `_tempMatrix3` and `_tempMatrix4` properties have been removed. They were all flagged as private, yet used in lots of places. Instead, Game Objects now manager their own matrices, or use the global `GetCalcMatrix` function instead. +* `WebGLRenderer.fboStack` is a new property that maintains a stack of framebuffer objects, used for pipelines supporting multiple render targets. +* `WebGLRenderer.pushFramebuffer` is a new method that is used to push a framebuffer onto the fbo stack before setting it as the current framebuffer. This should now be called in place of `setFramebuffer`. Remember to call `popFramebuffer` after using it. +* `WebGLRenderer.popFramebuffer` is a new method that will pop the current framebuffer off the fbo stack and set the previous one as being active. +* `WebGLRenderer.setFramebuffer` has a new optional boolean parameter `resetTextures` which will reset the WebGL Textures, if set to `true` (which is the default). +* `WebGLRenderer.isBooted` is a new boolean property that lets you know if the rendere has fully finished booting. +* The `WebGLRenderer` now extends the Event Emitter, allowing you to listen to renderer specific events. +* `WebGLRenderer.defaultCamera` has been removed as it's not used anywhere internally any longer. +* The `WebGLRenderer.setVertexBuffer` method has been removed along with the `WebGLRenderer.currentVertexBuffer` property. This is now set directly by the WebGL Pipeline, as needed. +* The `WebGLRenderer.setIndexBuffer` method has been removed along with the `WebGLRenderer.currentIndexBuffer` property. This is now set directly by the WebGL Pipeline, as needed. +* `WebGLRenderer.resetScissor` is a new method that will reset the gl scissor state to be the current scissor, if there is one, without modifying the stack. +* `WebGLRenderer.resetViewport` is a new method that will reset the gl viewport to the current renderer dimensions. +* `WebGLRenderer.renderTarget` is a new property that contains a Render Target that is bound to the renderer and kept resized to match it. +* `WebGLRenderer.beginCapture` is a new method that will bind the renderers Render Target, so everything drawn is redirected to it. +* `WebGLRenderer.endCapture` is a new method that will unbind the renderers Render Target and return it, preventing anything else from being drawn to it. + +### WebGL and Canvas Renderer Events + +* `Phaser.Renderer.Events` is a new namespace for events emited by the Canvas and WebGL Renderers. +* `Renderer.Events.PRE_RENDER` is a new event dispatched by the Phaser Renderer. This happens right at the start of the render process. +* `Renderer.Events.RENDER` is a new event dispatched by the Phaser Renderer. This happens once for every camera, in every Scene at the start of its render process. +* `Renderer.Events.POST_RENDER` is a new event dispatched by the Phaser Renderer. This happens right at the end of the render process. +* `Renderer.Events.RESIZE` is a new event dispatched by the Phaser Renderer whenever it is resized. + +### Canvas Renderer Updates + +* `CanvasRenderer.isBooted` is a new boolean property that lets you know if the rendere has fully finished booting. +* The `CanvasRenderer` now extends the Event Emitter, allowing you to listen to renderer specific events. + +### Camera - New Features, Updates and API Changes + +The Camera API has changed in line with the new pipeline updates. To this end, the following changes have taken place: + +The Camera class now inherits the `Pipeline` Component. This gives it new features, in line with the other pipelines changes in 3.50, such as `Camera.setPipeline`, `Camera.setPostPipeline`, `Camera.setPipelineData` and so on. This is a much more powerful and flexible way of setting camera effects, rather than it managing its own framebuffer and texture directly. + +To that end, the following properties and methods have been removed to tidy things up: + +* The `Camera.renderToTexture` property has been removed. Effects are now handled via pipelines. +* The `Camera.renderToGame` property has been removed. Effects are now handled via pipelines. +* The `Camera.canvas` property has been removed. Textures are handled by pipelines. +* The `Camera.context` property has been removed. Textures are handled by pipelines. +* The `Camera.glTexture` property has been removed. GL Textures are handled by pipelines. +* The `Camera.framebuffer` property has been removed. GL Framebuffers are handled by pipelines. +* The `Camera.setRenderToTexture` method has been removed. Effects are now handled via pipelines. +* The `Camera.clearRenderToTexture` method has been removed. Effects are now handled via pipelines. + +These changes mean that you can no longer render a Camera to a canvas in Canvas games. + +Other changes and fixes: + +* `Camera.zoomX` is a new property that allows you to specifically set the horizontal zoom factor of a Camera. +* `Camera.zoomY` is a new property that allows you to specifically set the vertical zoom factor of a Camera. +* The `Camera.setZoom` method now allows you to pass two parameters: `x` and `y`, to control the `zoomX` and `zoomY` values accordingly. +* The `Camera.zoom` property now returns an _average_ of the `zoomX` and `zoomY` properties. +* `Cameras.Scene2D.Events.FOLLOW_UPDATE` is a new Event that is dispatched by a Camera when it is following a Game Object. It is dispatched every frame, right after the final Camera position and internal matrices have been updated. Use it if you need to react to a camera, using its most current position and the camera is following something. Fix #5253 (thanks @rexrainbow) +* If the Camera has `roundPixels` set it will now round the internal scroll factors and `worldView` during the `preRender` step. Fix #4464 (thanks @Antriel) + +### Graphics Pipeline and Graphics Game Object Changes + +The Graphics Pipeline is a new pipeline added in 3.50 that is responsible for rendering Graphics Game Objects and all of the Shape Game Objects, such as Arc, Rectangle, Star, etc. Due to the new pipeline some changes have been made: + +* The Graphics Pipeline now uses much simpler vertex and fragment shaders, with just two attributes (`inPosition` and `inColor`), making the vertex size and memory-use 57% smaller. +* The private `_tempMatrix1`, 2, 3 and 4 properties have all been removed from the pipeline. +* A new public `calcMatrix` property has been added, which Shape Game Objects use to maintain transform state during rendering. +* The Graphics Pipeline no longer makes use of `tintEffect` or any textures. +* Because Graphics and Shapes now render with their own pipeline, you are able to exclude the pipeline and those Game Objects entirely from custom builds, further reducing the final bundle size. + +As a result of these changes the following features are no longer available: + +* `Graphics.setTexture` has been removed. You can no longer use a texture as a 'fill' for a Graphic. It never worked with any shape other than a Rectangle, anyway, due to UV mapping issues, so is much better handled via the new Mesh Game Object. +* `Graphics._tempMatrix1`, 2 and 3 have been removed. They're not required internally any longer. +* `Graphics.renderWebGL` now uses the standard `GetCalcMatrix` function, cutting down on duplicate code significantly. + +### Render Texture Game Object - New Features, API Changes and Bug Fixes + +The Render Texture Game Object has been rewritten to use the new `RenderTarget` class internally, rather than managing its own framebuffer and gl textures directly. The core draw methods are now a lot simpler and no longer require manipulating render pipelines. + +As a result of these changes the following updates have happened: + +* `RenderTexture.renderTarget` is a new property that contains a `RenderTarget` instance, which is used for all drawing. +* The `RenderTexture.framebuffer` property has been removed. You can now access this via `RenderTexture.renderTarget.framebuffer`. +* The `RenderTexture.glTexture` property has been removed. You can now access this via `RenderTexture.renderTarget.texture`. +* The `RenderTexture.gl` property has been removed. + +Render Textures have the following new features: + +* `RenderTexture.beginDraw` is a new method that allows you to create a batched draw to the Render Texture. Use this method to begin the batch. +* `RenderTexture.batchDraw` is a new method that allows you to batch the drawing of an object to the Render Texture. You should never call this method unless you have previously started a batch with `beginDraw`. You can call this method as many times as you like, to draw as many objects as you like, without causing a framebuffer bind. +* `RenderTexture.batchDrawFrame` is a new method that allows you to batch the drawing of a texture frame to the Render Texture. You should never call this method unless you have previously started a batch with `beginDraw`. You can call this method as many times as you like, to draw as many frames as you like, without causing a framebuffer bind. +* `RenderTexture.endDraw` is a new method that ends a previously created batched draw on the Render Texture. Use it to write all of your batch changes to the Render Texture. +* You can now draw a `Group` to a `RenderTexture`. Previously, it failed to pass the camera across, resulting in none of the Group children being drawn. Fix #5330 (thanks @somnolik) + +Render Textures have the following bug fixes: + +* `RenderTexture.resize` (which is called from `setSize`) wouldn't correctly set the `TextureSource.glTexture` property, leading to `bindTexture: attempt to use a deleted object` errors under WebGL. +* `RenderTexture.fill` would fail to fill the correct area under WebGL if the RenderTexture wasn't the same size as the Canvas. It now fills the given region properly. +* `RenderTexture.erase` has never worked when using the Canvas Renderer and a texture frame, only with Game Objects. It now works with both. Fix #5422 (thanks @vforsh) ### Light Pipeline Changes @@ -173,12 +370,10 @@ The Light Pipeline (previously called the Forward Diffuse Light Pipeline), which * Fixed a bug in the way lights were handled that caused Tilemaps to render one tile at a time, causing massive slow down. They're now batched properly, making a combination of lights and tilemaps possible again. * The Bitmap Text (Static and Dynamic) Game Objects now support rendering with normal maps. * The TileSprite Game Objects now support rendering with normal maps. -* Mesh and Quad Game Objects now support rendering with normal maps. -* The Graphics Game Objects now support rendering in Light2d. You can even use normal map textures for the texture fills. +* Mesh Game Objects now support rendering with normal maps. * Particle Emitter Game Object now supports rendering in Light2d. -* All Shape Game Objects (Rectangle, IsoBox, Star, Polygon, etc) now support rendering in Light2d. * The Text Game Object now supports rendering in Light2d, no matter which font, stroke or style it is using. -* Both Static and Dynamic Tilemap Layer Game Objects now support the Light2d pipeline, with or without normal maps. +* Tilemap Layer Game Objects now support the Light2d pipeline, with or without normal maps. * The pipeline will no longer look-up and set all of the light uniforms unless the `Light` is dirty. * The pipeline will no longer reset all of the lights unless the quantity of lights has changed. * The `ForwardDiffuseLightPipeline.defaultNormalMap` property has changed, it's now an object with a `glTexture` property that maps to the pipelines default normal map. @@ -198,39 +393,34 @@ The Light Pipeline (previously called the Forward Diffuse Light Pipeline), which * `LightsManager.destroy` will now clear the `lightPool` array when destroyed, where-as previously it didn't. * `LightsManager.cull` now takes the viewport height from the renderer instead of the game config (thanks zenwaichi) -### WebGL ModelViewProjection API Changes +### WebGL ModelViewProjection Removed -The `ModelViewProjection` object contained a lot of functions that Phaser never used internally. These have now been -moved to external functions, which can be easily excluded from Custom builds to save space. +The `ModelViewProjection` object contained a lot of functions that Phaser never used internally. Instead, the functions available in them were already available in the `Math.Matrix4` class. So the pipelines have been updated to use a Matrix4 instead and all of the MVP functions have been removed. The full list of removed functions is below: -If you used any of them in your code, please update to the new function names below: - -* `Phaser.Renderer.WebGL.MVP` is a new namespace under which the Model View Projection functions now live. -* `projIdentity` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ProjectIdentity` -* `projPersp` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ProjectPerspective` -* `modelRotateX` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.RotateX` -* `modelRotateY` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.RotateY` -* `modelRotateZ` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.RotateZ` -* `viewLoad` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewLoad` -* `viewRotateX` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewRotateX` -* `viewRotateY` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewRotateY` -* `viewRotateZ` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewRotateZ` -* `viewScale` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewScale` -* `viewTranslate` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewTranslate` -* `modelIdentity` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.Identity` -* `modelScale` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.Scale` -* `modelTranslate` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.Translate` -* `viewIdentity` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewIdentity` -* `viewLoad2D` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ViewLoad2D` -* `projOrtho` is now available as a stand-alone function `Phaser.Renderer.WebGL.MVP.ProjectOrtho` -* `Phaser.Renderer.WebGL.MVP.SetIdentity` is a new function the others use, to save on space. +* `projIdentity` has been removed. +* `projPersp` has been removed. +* `modelRotateX` has been removed. +* `modelRotateY` has been removed. +* `modelRotateZ` has been removed. +* `viewLoad` has been removed. +* `viewRotateX` has been removed. +* `viewRotateY` has been removed. +* `viewRotateZ` has been removed. +* `viewScale` has been removed. +* `viewTranslate` has been removed. +* `modelIdentity` has been removed. +* `modelScale` has been removed. +* `modelTranslate` has been removed. +* `viewIdentity` has been removed. +* `viewLoad2D` has been removed. +* `projOrtho` has been removed. ### BitmapText - New Features, Updates and API Changes * `BitmapText.setCharacterTint` is a new method that allows you to set a tint color (either additive or fill) on a specific range of characters within a static Bitmap Text. You can specify the start and length offsets and per-corner tint colors. * `BitmapText.setWordTint` is a new method that allows you to set a tint color (either additive or fill) on all matching words within a static Bitmap Text. You can specify the word by string, or numeric offset, and the number of replacements to tint. * `BitmapText.setDropShadow` is a new method that allows you to apply a drop shadow effect to a Bitmap Text object. You can set the horizontal and vertical offset of the shadow, as well as the color and alpha levels. Call this method with no parameters to clear a shadow. -* `BitmapTextWebGLRenderer` has been rewritten from scratch to make use of the new pre-cached WebGL uv texture and character location data generated by `GetBitmapTextSize`. This has reduced the number of calculations made in the function dramatically, as it no longer has work out glyph advancing or offsets during render, but only when the text content updates. +* `BitmapTextWebGLRenderer` has been rewritten from scratch to make use of the new pre-cached WebGL uv texture and character location data generated by `GetBitmapTextSize`. This has reduced the number of calculations made in the function dramatically, as it no longer has to work out glyph advancing or offsets during render, but only when the text content updates. * `BitmapText.getCharacterAt` is a new method that will return the character data from the BitmapText at the given `x` and `y` coordinates. The character data includes the code, position, dimensions, and glyph information. * The `BitmapTextSize` object returned by `BitmapText.getTextBounds` has a new property called `characters` which is an array that contains the scaled position coordinates of each character in the BitmapText, which you could use for tasks such as determining which character in the BitmapText was clicked. * `ParseXMLBitmapFont` will now calculate the WebGL uv data for the glyphs during parsing. This avoids it having to be done during rendering, saving CPU cycles on an operation that never changes. @@ -254,7 +444,7 @@ If you used any of them in your code, please update to the new function names be ### Update List Changes -The way in which Game Objects add themselves to the Scene Update List has changed. Instead of being added by the Factory methods, they will now add and remove themselves based on the new `ADDED_TO_SCENE` and `REMOVED_FROM_SCENE` events. This means, you can now add Sprites directly to a Container, or Group, and they'll animate properly without first having to be part of the Display List. The full set of changes and new features relating to this follow: +The way in which Game Objects add themselves to the Scene Update List has changed. Instead of being added by the Factory methods, they will now add and remove themselves based on the new `ADDED_TO_SCENE` and `REMOVED_FROM_SCENE` events. This means, you can now add Sprites directly to a Container, or Group, and they'll animate properly without first having to be part of the Update List. The full set of changes and new features relating to this follow: * `GameObjects.Events.ADDED_TO_SCENE` is a new event, emitted by a Game Object, when it is added to a Scene, or a Container that is part of the Scene. * `GameObjects.Events.REMOVED_FROM_SCENE` is a new event, emitted by a Game Object, when it is removed from a Scene, or a Container that is part of the Scene. @@ -276,22 +466,26 @@ The way in which Game Objects add themselves to the Scene Update List has change ### Spine Plugin Updates -* The Spine Runtimes have been updated to 3.8.95, which are the most recent non-beta versions. Please note, you will _need_ to re-export your animations if you're working in a version of Spine lower than 3.8.20. -* `SpineContainer` is a new Game Object available via `this.add.spineContainer` to which you can add Spine Game Objects only. It uses a special rendering function to retain batching, even across multiple container or Spine Game Object instances, resulting in dramatically improved performance over using regular Containers. +* The Spine Runtimes have been updated to 3.8.99, which are the most recent non-beta versions. Please note, you will _need_ to re-export your animations if you're working in a version of Spine lower than 3.8.20. +* `SpineContainer` is a new Game Object available via `this.add.spineContainer` to which you can add Spine Game Objects only. It uses a special rendering function to retain batching, even across multiple container or Spine Game Object instances, resulting in dramatically improved performance compared to using regular Containers. You _can_ still use regular Containers if you need, but they do not benefit from the new batching. * A Spine Game Object with `setVisible(false)` will no longer still cause internal gl commands and is now properly skipped, retaining any current batch in the process. Fix #5174 (thanks @Kitsee) * The Spine Game Object WebGL Renderer will no longer clear the type if invisible and will only end the batch if the next type doesn't match. * The Spine Game Object WebGL Renderer will no longer rebind the pipeline if it was the final object on the display list, saving lots of gl commands. * The Webpack build scripts have all been updated for Webpack 4.44.x. Fix #5243 (thanks @RollinSafary) -* There is a new npm script `npm run plugin.spine.runtimes` which will build all of the Spine runtimes, for ingestion by the plugin. Note: You will need to check-out the Esoteric Spine Runtimes repo into `plugins/spine/` in order for this to work. +* There is a new npm script `npm run plugin.spine.runtimes` which will build all of the Spine runtimes, for ingestion by the plugin. Note: You will need to check-out the Esoteric Spine Runtimes repo into `plugins/spine/` in order for this to work and then run `npm i`. * Spine Game Objects can now be rendered to Render Textures. Fix #5184 (thanks @Kitsee) * Using > 128 Spine objects in a Container would cause a `WebGL: INVALID_OPERATION: vertexAttribPointer: no ARRAY_BUFFER is bound and offset is non-zero` error if you added any subsequent Spine objects to the Scene. There is now no limit. Fix #5246 (thanks @d7561985) * The Spine Plugin will now work in HEADLESS mode without crashing. Fix #4988 (thanks @raimon-segura) -* Spine Game Objects now use -1 as their default blend mode, which means 'skip setting it'. +* Spine Game Objects now use -1 as their default blend mode, which means 'skip setting it', as blend modes should be handled by the Spine skeletons directly. * The Spine TypeScript defs have been updated for the latest version of the plugin and to add SpineContainers. * The `SpineGameObject.setAnimation` method will now use the `trackIndex` parameter if `ignoreIfPlaying` is set and run the check against this track index. Fix #4842 (thanks @vinerz) * The `SpineFile` will no longer throw a warning if adding a texture into the Texture Manager that already exists. This allows you to have multiple Spine JSON use the same texture file, however, it also means you now get no warning if you accidentally load a texture that exists, so be careful with your keys! Fix #4947 (thanks @Nomy1) -* The Spine Plugin `destroy` method will now no longer remove the Game Objects from the Game Object Factory, or dispose of the Scene Renderer. This means when a Scene is destroyed, it will keep the Game Objects in the factory for other Scene's to use. Fix #5279 (thanks @Racoonacoon) +* The Spine Plugin `destroy` method will now no longer remove the Game Objects from the Game Object Factory, or dispose of the Scene Renderer. This means when a Scene is destroyed, it will keep the Game Objects in the factory for other Scenes to use. Fix #5279 (thanks @Racoonacoon) * `SpinePlugin.gameDestroy` is a new method that is called if the Game instance emits a `destroy` event. It removes the Spine Game Objects from the factory and disposes of the Spine scene renderer. +* `SpineFile` will now check to see if another identical atlas in the load queue is already loading the texture it needs and will no longer get locked waiting for a file that will never complete. This allows multiple skeleton JSONs to use the same atlas data. Fix #5331 (thanks @Racoonacoon) +* `SpineFile` now uses a `!` character to split the keys, instead of an underscore, preventing the plugin from incorrectly working out the keys for filenames with underscores in them. Fix #5336 (thanks @Racoonacoon) +* `SpineGameObject.willRender` is no longer hard-coded to return `true`. It instead now takes a Camera parameter and performs all of the checks needed before returning. Previously, this happened during the render functions. +* The Spine Plugin now uses a single instance of the Scene Renderer when running under WebGL. All instances of the plugin (installed per Scene) share the same base Scene Renderer, avoiding duplicate allocations and resizing events under multi-Scene games. Fix #5286 (thanks @spayton BunBunBun) ### Animation API - New Features and Updates @@ -306,6 +500,8 @@ The Animation API has had a significant overhaul to improve playback handling. I * The Game Object `Component.Animation` component has been renamed to `AnimationState` and has moved namespace. It's now in `Phaser.Animations` instead of `GameObjects.Components` to help differentiate it from the `Animation` class when browsing the documentation. * The `play`, `playReverse`, `playAfterDelay`, `playAfterRepeat` and `chain` Sprite and Animation Component methods can now all take a `Phaser.Types.Animations.PlayAnimationConfig` configuration object, as well as a string, as the `key` parameter. This allows you to override any default animation setting with those defined in the config, giving you far greater control over animations on a Game Object level, without needing to globally duplicate them. * `AnimationState.create` is a new method that allows you to create animations directly on a Sprite. These are not global and never enter the Animation Manager, instead risiding within the Sprite itself. This allows you to use the same keys across both local and global animations and set-up Sprite specific local animations. +* `AnimationState.generateFrameNumbers` is a new method that is a proxy for the same method available under the Animation Manager. It's exposed in the Animation State so you're able to access it from within a Sprite (thanks @juanitogan) +* `AnimationState.generateFrameNames` is a new method that is a proxy for the same method available under the Animation Manager. It's exposed in the Animation State so you're able to access it from within a Sprite (thanks @juanitogan) * All playback methods: `play`, `playReverse`, `playAfterDelay` and `playAfterRepeat` will now check to see if the given animation key exists locally on the Sprite first. If it does, it's used, otherwise it then checks the global Animation Manager for the key instead. * `AnimationState.skipMissedFrames` is now used when playing an animation, allowing you to create animations that run at frame rates far exceeding the refresh rate, or that will update to the correct frame should the game lag. Feature #4232 (thanks @colorcube) * `AnimationManager.addMix` is a new method that allows you to create mixes between two animations. Mixing allows you to specify a unique delay between a pairing of animations. When playing Animation A on a Game Object, if you then play Animation B, and a mix exists, it will wait for the specified delay to be over before playing Animation B. This allows you to customise smoothing between different types of animation, such as blending between an idle and a walk state, or a running and a firing state. @@ -396,36 +592,102 @@ The Animation API has had a significant overhaul to improve playback handling. I * `GenerateFrameNumbers` can now accept the `start` and `end` parameters in reverse order, meaning you can now do `{ start: 10, end: 1 }` to create the animation in reverse. * `GenerateFrameNames` can now accept the `start` and `end` parameters in reverse order, meaning you can now do `{ start: 10, end: 1 }` to create the animation in reverse. +### Tilemap - New Features, Updates and API Changes + +There are three large changes to Tilemaps in 3.50. If you use tilemaps, you must read this section: + +1) The first change is that there are no longer `DynamicTilemapLayer` and `StaticTilemapLayer` classes. They have both been removed and replaced with the new `TilemapLayer` class. This new class consolidates features from both and provides a lot cleaner API experience, as well as speeding up internal logic. + +In your game where you use `map.createDynamicLayer` or `map.createStaticLayer` replace it with `map.createLayer` instead. + +2) The second change is that the Tilemap system now supports isometric, hexagonal and staggered isometric map types, along with the previous orthogonal format, thanks to a PR from @svipal. You can now export maps using any of these orientations from the Tiled Map Editor and load them into Phaser using the existing tilemap loading API. No further changes need to take place in the way your maps are loaded. + +3) The `Tilemap.createFromObjects` method has been overhauled to make it much more useful. The method signature has changed and it now takes a new `CreateFromObjectLayerConfig` configuration object, or an array of them, which allows much more fine-grained control over which objects in the Tiled Object Layers are converted and what they are converted to. Previously it could only convert to Sprites, but you can now pass in a custom class, filter based on id, gid or name, even provide a Container to add the created Game Objects to. Please see the new documentation for this method and the config object for more details. Fix #3817 #4613 (thanks @georgzoeller @Secretmapper) + +* The `Tilemap.createDynamicLayer` method has been renamed to `createLayer`. +* The `Tilemap.createStaticLayer` method has been removed. Use `createLayer` instead. +* The `Tilemap.createBlankDynamicLayer` method has been renamed to `createBlankLayer`. +* The `Tilemap.convertLayerToStatic` method has been removed as it is no longer required. +* The `TilemapLayerWebGLRenderer` function will no longer iterate through the layer tilesets, drawing tiles from only that set. Instead all it does now is iterate directly through only the tiles. This allows it to take advantage of the new Multi Texturing pipeline and also draw multi-tileset isometric layers correctly. +* `Phaser.Types.Tilemaps.TilemapOrientationType` is a new type def that holds the 4 types of map orientation now supported. +* The `Tile.updatePixelXY` method now updates the tile XY position based on map type. +* `ParseTilesets` will now correctly handle non-consecutive tile IDs. It also now correctly sets the `maxId` property, fixing a bug where tiles wouldn't render if from IDs outside the expected range. Fix #4367 (thanks @jackfreak) +* `Tilemap.hexSideLength` is a new property that holds the length of the hexagon sides, if using Hexagonal Tilemaps. +* `LayerData.orientation` is a new property that holds the tilemap layers orientation constant. +* `LayerData.hexSideLength` is a new property that holds the length of the hexagon sides, if using Hexagonal Tilemaps. +* `MapData.orientation` is a new property that holds the tilemap layers orientation constant. +* `MapData.hexSideLength` is a new property that holds the length of the hexagon sides, if using Hexagonal Tilemaps. +* `Tilemaps.Components.HexagonalWorldToTileY` is a new function that converts a world Y coordinate to hexagonal tile Y coordinate. +* `Tilemaps.Components.StaggeredWorldToTileY` is a new function that converts a world Y coordinate to staggered tile Y coordinate. +* `Tilemaps.Components.HexagonalWorldToTileXY` is a new function that converts world coordinates to hexagonal tile coordinates. +* `Tilemaps.Components.IsometricWorldToTileXY` is a new function that converts world coordinates to isometric tile coordinates. +* `Tilemaps.Components.StaggeredWorldToTileXY` is a new function that converts world coordinates to staggered tile coordinates. +* `Tilemaps.Components.HexagonalTileToWorldY` is a new function that converts a hexagonal Y coordinate to a world coordinate. +* `Tilemaps.Components.StaggeredTileToWorldY` is a new function that converts a staggered Y coordinate to a world coordinate. +* `Tilemaps.Components.HexagonalTileToWorldXY` is a new function that converts hexagonal tile coordinates to world coordinates. +* `Tilemaps.Components.IsometricTileToWorldXY` is a new function that converts isometric tile coordinates to world coordinates. +* `Tilemaps.Components.StaggeredTileToWorldXY` is a new function that converts staggered tile coordinates to world coordinates. +* `Tilemaps.Components.GetTileToWorldXFunction` is a new function that returns the correct conversion function to use. +* `Tilemaps.Components.GetTileToWorldYFunction` is a new function that returns the correct conversion function to use. +* `Tilemaps.Components.GetTileToWorldXXFunction` is a new function that returns the correct conversion function to use. +* `Tilemaps.Components.GetWorldToTileXFunction` is a new function that returns the correct conversion function to use. +* `Tilemaps.Components.GetWorldToTileYFunction` is a new function that returns the correct conversion function to use. +* `Tilemaps.Components.GetWorldToTileXYFunction` is a new function that returns the correct conversion function to use. +* `Tilemaps.Components.GetCullTilesFunction` is a new function that returns the correct culling function to use. +* `Tilemaps.Components.HexagonalCullTiles` is a new function that culls tiles in a hexagonal map. +* `Tilemaps.Components.StaggeredCullTiles` is a new function that culls tiles in a staggered map. +* `Tilemaps.Components.IsometricCullTiles` is a new function that culls tiles in a isometric map. +* `Tilemaps.Components.CullBounds` is a new function that calculates the cull bounds for an orthogonal map. +* `Tilemaps.Components.HexagonalCullBounds` is a new function that calculates the cull bounds for a hexagonal map. +* `Tilemaps.Components.StaggeredCullBounds` is a new function that calculates the cull bounds for a staggered map. +* `Tilemaps.Components.RunCull` is a new function that runs the culling process from the combined bounds and tilemap. +* `Tilemap._convert` is a new internal private hash of tilemap conversion functions used by the public API. +* The `Tilemap._isStaticCall` method has been removed and no Tilemap methods now check this, leading to faster execution. +* The Arcade Physics Sprites vs. Tilemap Layers flow has changed. Previously, it would iterate through a whole bunch of linked functions, taking lots of jumps in the process. It now just calls the `GetTilesWithinWorldXY` component directly, saving lots of overhead. +* The method `Tilemap.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. +* 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. + ### Mesh Game Object - New Features, Updates and API Changes -The Mesh Game Object has been rewritten in v3.50 with a lot of changes to make it more useful and able to handle 3D objects: +The Mesh Game Object has been rewritten from scratch in v3.50 with a lot of changes to make it much more useful. It is accompanied by the new `Geom.Mesh` set of functions. -* `GameObject.Vertex` is a new micro class that encapsulates all of the data required for a single vertex, such as position, uv, color and alpha. This class is now created internally by the Mesh Game Object. -* `GameObject.Face` is a new micro class that consists of references to the three `Vertex` instances that construct the single Face. -* The Mesh constructor and `MeshFactory` signatures have changed to `scene, x, y, texture, frame, vertices, uvs, indicies, colors, alphas`. Note the way the Texture and Frame parameters now comes first. `indicies` is a new parameter added to the list. It allows you to provide indexed vertex data to create the Mesh from, where the `indicies` array holds the vertex index information. The final list of vertices is built from this index along with the provided vertices and uvs arrays. The `indicies` array is optional. If your data is not indexed, then simply pass `null` or an empty array for this parameter. -* The `Mesh` Game Object now extends the `SingleAlpha` component and the alpha value is factored into the final alpha value per vertex during rendering. This means you can now set the whole alpha across the Mesh using the standard `setAlpha` methods. But, if you wish to, you can still control the alpha on a per-vertex basis as well. +* `Geom.Mesh` is a new namespace that contains the Mesh related geometry functions. These are stand-alone functions that you may, or may not require, depending on your game. +* `Geom.Mesh.Vertex` is a new class that encapsulates all of the data required for a single vertex, including position, uv, normals, color and alpha. +* `Geom.Mesh.Face` is a new class that consists of references to the three `Vertex` instances that construct a single Face in a Mesh and provides methods for manipulating them. +* `Geom.Mesh.GenerateVerts` is a new function that will return an array of `Vertex` and `Face` objects generated from the given data. You can provide index, or non-index vertex lists, along with UV data, normals, colors and alpha which it will parse and return the results from. +* `Geom.Mesh.GenerateGridVerts` is a new function that will generate a series of `Vertex` objects in a grid format, based on the given `GenerateGridConfig` config file. You can set the size of the grid, the number of segments to split it into, translate it, color it and tile the texture across it. The resulting data can be easily used by a Mesh Game Object. +* `Geom.Mesh.GenerateObjVerts` is a new function that will generate a series of `Vertex` objects based on the given parsed Wavefront Obj Model data. You can optionally scale and translate the generated vertices and add them to a Mesh. +* `Geom.Mesh.ParseObj` is a new function that will parse a triangulated Wavefront OBJ file into model data into a format that the `GenerateObjVerts` function can consume. +* `Geom.Mesh.ParseObjMaterial` is a new function that will parse a Wavefront material file and extract the diffuse color data from it, combining it with the parsed object data. +* `Geom.Mesh.RotateFace` is a new function that will rotate a Face by a given amount, based on an optional center of rotation. +* `Loader.OBJFile` is a new File Loader type that can load triangulated Wavefront OBJ files, and optionally material files, which are then parsed and stored in the OBJ Cache. +* The Mesh constructor and `MeshFactory` signatures have changed to `scene, x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas`. Note the way the Texture and Frame parameters now comes first. `indicies` is a new parameter that allows you to provide indexed vertex data to create the Mesh from, where the `indicies` array holds the vertex index information. The final list of vertices is built from this index along with the provided vertices and uvs arrays. The `indicies` array is optional. If your data is not indexed, then simply pass `null` or an empty array for this parameter. * The `Mesh` Game Object now has the Animation State Component. This allows you to create and play animations across the texture of a Mesh, something that previously wasn't possible. As a result, the Mesh now adds itself to the Update List when added to a Scene. -* `Geom.ParseObj` is a new function that will parse a triangulated Wavefront OBJ file into model data that can be consumed by the Mesh Game Object. -* `Loader.OBJFile` is a new File Loader type that can load triangulated Wavefront OBJ files, which are then parsed and stored in the OBJ Cache. +* `Mesh.addVertices` is a new method that allows you to add vertices to a Mesh Game Object based on the given parameters. This allows you to modify a mesh post-creation, or populate it with data at a later stage. +* `Mesh.addVerticesFromObj` is a new method that will add the model data from a loaded Wavefront OBJ file to a Mesh. You load it via the new `OBJFile` with a `this.load.obj` call, then you can use the key with this method. This method also takes an optional scale and position parameters to control placement of the created model within the Mesh. * `Mesh.hideCCW` is a new boolean property that, when enabled, tells a Face to not render if it isn't counter-clockwise. You can use this to hide backward facing Faces. -* `Mesh.addOBJ` is a new method that will add the model data from a loaded Wavefront OBJ file to a Mesh. You load it via the new `OBJFile` with a `this.load.obj` call, then you can use the key with the `addOBJ` method. This method also takes an optional scale and position parameters to control placement of the created model within the Mesh. -* `Mesh.addModel` is a new method that will add the model data to a Mesh. You can prepare the model data yourself, pull it in from a server, or get it by calling `Geom.ParseObj`, or a similar custom function. This method also takes an optional scale and position parameters to control placement of the created model within the Mesh. -* `Mesh.rotateX` is a new method that will rotate all vertices of the Mesh around the x axis, by the amount given. It then depth sorts the faces. -* `Mesh.rotateY` is a new method that will rotate all vertices of the Mesh around the y axis, by the amount given. It then depth sorts the faces. -* `Mesh.rotateZ` is a new method that will rotate all vertices of the Mesh around the z axis, by the amount given. It then depth sorts the faces. -* `Mesh.depthSort` is a new method that will run a depth sort across all Faces in the Mesh by sorting them on their average depth. +* `Mesh.modelPosition` is a new Vector3 property that allows you to translate the position of all vertices in the Mesh. +* `Mesh.modelRotation` is a new Vector3 property that allows you to rotate all vertices in the Mesh. +* `Mesh.modelScale` is a new Vector3 property that allows you to scale all vertices in the Mesh. +* `Mesh.panX` is a new function that will translate the view position of the Mesh on the x axis. +* `Mesh.panY` is a new function that will translate the view position of the Mesh on the y axis. +* `Mesh.panZ` is a new function that will translate the view position of the Mesh on the z axis. +* `Mesh.setPerspective` is a new method that allows you to set a perspective projection matrix based on the given dimensions, fov, near and far values. +* `Mesh.setOrtho` is a new method that allows you to set an orthographic projection matrix based on the given scale, near and far values. +* `Mesh.clear` is a new method that will destroy all Faces and Vertices and clear the Mesh. +* `Mesh.depthSort` is a new method that will run a depth sort across all Faces in the Mesh by sorting them based on their average depth. * `Mesh.addVertex` is a new method that allows you to add a new single Vertex into the Mesh. * `Mesh.addFace` is a new method that allows you to add a new Face into the Mesh. A Face must consist of 3 Vertex instances. -* `Mesh.addVertices` is a new method that allows you to add vertices to a Mesh Game Object based on the given parameters. This allows you to modify a mesh post-creation, or populate it with data at a later stage. * `Mesh.getFaceCount` new is a new method that will return the total number of Faces in the Mesh. * `Mesh.getVertexCount` new is a new method that will return the total number of Vertices in the Mesh. * `Mesh.getFace` new is a new method that will return a Face instance from the Mesh based on the given index. * `Mesh.getFaceAt` new is a new method that will return an array of Face instances from the Mesh based on the given position. The position is checked against each Face, translated through the optional Camera and Mesh matrix. If more than one Face intersects, they will all be returned but the array will be depth sorted first, so the first element will be that closest to the camera. * `Mesh.vertices` is now an array of `GameObject.Vertex` instances, not a Float32Array. * `Mesh.faces` is a new array of `GameObject.Face` instances, which is populated during a call to methods like `addVertices` or `addModel`. -* `Mesh.clearVertices` is a new method that will destroy all Faces and Vertices and clear the Mesh. +* `Mesh.totalRendered` is a new property that holds the total number of Faces that were rendered in the previous frame. * `Mesh.setDebug` is a new method that allows you to render a debug visualisation of the Mesh vertices to a Graphics Game Object. You can provide your own Graphics instance and optionally callback that is invoked during rendering. This allows you to easily visualise the vertices of your Mesh to help debug UV mapping. * The Mesh now renders by iterating through the Faces array, not the vertices. This allows you to use Array methods such as `BringToTop` to reposition a Face, thus changing the drawing order without having to repopulate all of the vertices. Or, for a 3D model, you can now depth sort the Faces. +* The `Mesh` Game Object now extends the `SingleAlpha` component and the alpha value is factored into the final alpha value per vertex during rendering. This means you can now set the whole alpha across the Mesh using the standard `setAlpha` methods. But, if you wish to, you can still control the alpha on a per-vertex basis as well. * The Mesh renderer will now check to see if the pipeline capacity has been exceeded for every Face added, allowing you to use Meshes with vertex counts that exceed the pipeline capacity without causing runtime errors. * You can now supply just a single numerical value as the `colors` parameter in the constructor, factory method and `addVertices` method. If a number, instead of an array, it will be used as the color for all vertices created. * You can now supply just a single numerical value as the `alphas` parameter in the constructor, factory method and `addVertices` method. If a number, instead of an array, it will be used as the alpha for all vertices created. @@ -433,11 +695,46 @@ The Mesh Game Object has been rewritten in v3.50 with a lot of changes to make i * `Mesh.debugCallback` is a new property that holds the debug render callback. * `Mesh.renderDebugVerts` is a new method that acts as the default render callback for `setDebug` if none is provided. * `Mesh.preDestroy` is a new method that will clean-up the Mesh arrays and debug references on destruction. +* `Mesh.isDirty` is a new method that will check if any of the data is dirty, requiring the vertices to be transformed. This is called automatically in `preUpdate` to avoid generating lots of math when nothing has changed. * The `Mesh.uv` array has been removed. All UV data is now bound in the Vertex instances. * The `Mesh.colors` array has been removed. All color data is now bound in the Vertex instances. * The `Mesh.alphas` array has been removed. All color data is now bound in the Vertex instances. * The `Mesh.tintFill` property is now a `boolean` and defaults to `false`. +### Quad Game Object Removed + +The `Quad` Game Object has been removed from v3.50.0. + +You can now create your own Quads easily using the new `Geom.Mesh.GenerateGridVerts` function, which is far more flexible than the old quads were. + +### Layer Game Object + +A Layer is a special type of Game Object that acts as a Display List. You can add any type of Game Object to a Layer, just as you would to a Scene. Layers can be used to visually group together 'layers' of Game Objects: + +```javascript +const spaceman = this.add.sprite(150, 300, 'spaceman'); +const bunny = this.add.sprite(400, 300, 'bunny'); +const elephant = this.add.sprite(650, 300, 'elephant'); + +const layer = this.add.layer(); + +layer.add([ spaceman, bunny, elephant ]); +``` + +The 3 sprites in the example above will now be managed by the Layer they were added to. Therefore, if you then set `layer.setVisible(false)` they would all vanish from the display. + +You can also control the depth of the Game Objects within the Layer. For example, calling the `setDepth` method of a child of a Layer will allow you to adjust the depth of that child _within the Layer itself_, rather than the whole Scene. The Layer, too, can have its depth set as well. + +The Layer class also offers many different methods for manipulating the list, such as the methods `moveUp`, `moveDown`, `sendToBack`, `bringToTop` and so on. These allow you to change the display list position of the Layers children, causing it to adjust the order in which they are rendered. Using `setDepth` on a child allows you to override this. + +Layers can have Post FX Pipelines set, which allows you to easily enable a post pipeline across a whole range of children, which, depending on the effect, can often be far more efficient that doing so on a per-child basis. + +Layers have no position or size within the Scene. This means you cannot enable a Layer for physics or input, or change the position, rotation or scale of a Layer. They also have no scroll factor, texture, tint, origin, crop or bounds. + +If you need those kind of features then you should use a Container instead. Containers can be added to Layers, but Layers cannot be added to Containers. + +However, you can set the Alpha, Blend Mode, Depth, Mask and Visible state of a Layer. These settings will impact all children being rendered by the Layer. + ### Input / Mouse Updates and API Changes * `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 #4862 (thanks @dranitski) @@ -445,17 +742,20 @@ The Mesh Game Object has been rewritten in v3.50 with a lot of changes to make i * `inputMousePreventDefaultDown` is a new config option that allows you to control `preventDefault` calls specifically on mouse down events. Set it via `input.mouse.preventDefaultDown` in the Game Config. It defaults to `true`, the same as the previous `capture` property did. * `inputMousePreventDefaultUp` is a new config option that allows you to control `preventDefault` calls specifically on mouse up events. Set it via `input.mouse.preventDefaultUp` in the Game Config. It defaults to `true`, the same as the previous `capture` property did. * `inputMousePreventDefaultMove` is a new config option that allows you to control `preventDefault` calls specifically on mouse move events. Set it via `input.mouse.preventDefaultMove` in the Game Config. It defaults to `true`, the same as the previous `capture` property did. +* `inputMousePreventDefaultWheel` is a new config option that allows you to control `preventDefault` calls specifically on mouse wheel events. Set it via `input.mouse.preventDefaultWheel` in the Game Config. It defaults to `true`, the same as the previous `capture` property did. * The `MouseManager.capture` property has been removed, as this is now split into 3 new config options (see below) * `MouseManager.preventDefaultDown` is a new boolean property, set via the `inputMousePreventDefaultDown` config option that allows you to toggle capture of mouse down events at runtime. * `MouseManager.preventDefaultUp` is a new boolean property, set via the `inputMousePreventDefaultUp` config option that allows you to toggle capture of mouse up events at runtime. * `MouseManager.preventDefaultMove` is a new boolean property, set via the `inputMousePreventDefaultMove` config option that allows you to toggle capture of mouse move events at runtime. -* In the `MouseManager` the up, down and move events are no longer set as being passive if captured. Over, Out, Wheel and the Window level Down and Up events are always flagged as being passive. +* `MouseManager.preventDefaultWheel` is a new boolean property, set via the `inputMousePreventDefaultWheel` config option that allows you to toggle capture of mouse wheel at runtime. +* In the `MouseManager` the up, down and move events are no longer set as being passive if captured. Over, Out, Wheel and the Window level Down and Up events are always flagged as being passive. Wheel events are non-passive if capturing is enabled. * The `GamepadPlugin` will now call `refreshPads` as part of its start process. This allows you to use Gamepads across multiple Scenes, without having to wait for a connected event from each one of them. If you've already had a connected event in a previous Scene, you can now just read the pads directly via `this.input.gamepad.pad1` and similar. Fix #4890 (thanks @Sytten) * Shutting down the Gamepad plugin (such as when sleeping a Scene) no longer calls `GamepadPlugin.disconnectAll`, but destroying it does. * `Gamepad._created` is a new private internal property that keeps track of when the instance was created. This is compared to the navigator timestamp in the update loop to avoid event spamming. Fix #4890. * `Pointer.down` will now check if the browser is running under macOS and if the ctrl key was also pressed, if so, it will flag the down event as being a right-click instead of a left-click, as per macOS conventions. Fix #4245 (thanks @BigZaphod) * When destroying an interactive Game Object that had `useHandCursor` enabled, it would reset the CSS cursor to default, even if the cursor wasn't over that Game Object. It will now only reset the cursor if it's over the Game Object being destroyed. Fix #5321 (thanks @JstnPwll) * The `InputPlugin.shutdown` method will now reset the CSS cursor, in case it was set by any Game Objects in the Scene that have since been destroyed. +* The `InputPlugin.processOverEvents` has had a duplicate internal loop removed from it (thanks KingCosmic) ### Tint Updates and Shader Changes @@ -475,10 +775,69 @@ This has all changed in 3.50, as outlined below. Tint values are now used direct * The `Rope.tintFill` property is now a boolean, not an integer, and can no longer take `2` as a value for a complete fill. Instead, you should provide a solid color texture with no alpha. * As a result of the change to the shader, all uses of the WebGL Util function `getTintAppendFloatAlphaAndSwap` have been replaced with `getTintAppendFloatAlpha` instead. * As a result of the change to the shader, the Multi Pipeline now uses the `WebGLRenderer.whiteTexture` and `tintEffect` mode of 1 by default, instead of mode 2 (which has been removed) and a transparent texture. This ensures Graphics and Shapes objects still render correctly under the new smaller shader code. -* `WebGLRenderer.whiteTexture` is a new property that is a reference to a pure white 4x4 texture that is created during Boot by the Texture Manager. The Multi Pipeline uses this internally for all Graphic, Shape and fill rendering. +* `WebGLRenderer.whiteTexture` is a new property that is a reference to a pure white 4x4 texture that is created during Boot by the Texture Manager. The Graphics Pipeline uses this internally for all geometry fill rendering. * The `TextureManager` now generates a new texture with the key `__WHITE` durings its boot process. This is a pure white 4x4 texture used by the Graphics pipelines. * `Config.images.white` is a new Game Config property that specifies the 4x4 white PNG texture used by Graphics rendering. You can override this via the config, but only do so if needed. +### Arcade Physics Updates + +Prior to v3.50 an Arcade Physics Body could be one of two states: immovable, or moveable. An immovable body could not receive _any_ impact from another Body. If something collided with it, it wouldn't even separate to break free from the collision (the other body had to take the full separation value). It was intended for objects such as platforms, ground or walls, there they absolutely shouldn't move under any circumstances. As a result, two immovable bodies could never be collided together. While this worked for scenery-like items, it didn't work if you required maybe 2 players who could collide with each other, but should never be able to push one another. As of 3.50 all physics bodies now have a new property `pushable` that allows this. A pushable body can share separation with its collider, as well as take on mass-based velocity from the impact. A non-pushable body will behave differently depending on what it collides with. For example, a pushable body hitting a non-pushable (or immoveable) body will rebound off it. + +* The Arcade Physics `Body` class has a new boolean property `pushable` (true, by default). This allows you to set if a Body can be physically pushed by another Body, or not. Fix #4175 #4415 (thanks @inmylo @CipSoft-Components) +* `Body.setPushable` is a new chainable method that allows you to set the `pushable` state of a Body. +* `Arcade.Components.Pushable` is a new component, inherited by the standard Arcade Physics Image and Sprite classes. +* Bodies will now check to see if they are blocked in the direction they're being pushed, before resolving the collision. This helps stop some bodies from being pushed into other objects. +* Bodies will now check which direction they were moving and separate accordingly. This helps stop some bodies from being pushed into other objects. +* `ArcadePhysics.disableUpdate` is a new method that will prevent the Arcade Physics World `update` method from being called when the Scene updates. By disabling it, you're free to call the update method yourself, passing in your own delta and time values. +* `ArcadePhysics.enableUpdate` is a new method that will make the Arcade Physics World update in time with the Scene update. This is the default, so only call this if you have specifically disabled it previously. +* `ArcadeWorldConfig.customUpdate` is a new boolean property you can set in the Arcade Physics config object, either in the Scene or in the Game Config. If `true` the World update will never be called, allowing you to call it yourself from your own component. Close #5190 (thanks @cfortuner) +* `Physics.Arcade.Body.setCollideWorldBounds` now has a new optional parameter `onWorldBounds` which allows you to enable the Body's `onWorldBounds` property in the same call (thanks @samme) +* `ArcadePhysics.Body.setMaxVelocityX` is a new method that allows you to set the maximum horizontal velocity of a Body (thanks @samme) +* `ArcadePhysics.Body.setMaxVelocityY` is a new method that allows you to set the maximum vertical velocity of a Body (thanks @samme) +* The `PhysicsGroup` config now has two new optional properties `maxVelocityX` and `maxVelocityY` which allows you to set the maximum velocity on bodies added to the Group (thanks @samme) +* The `Arcade.Body.resetFlags` method has a new optional boolean parameter `clear`. If set, it clears the `wasTouching` flags on the Body. This happens automatically when `Body.reset` is called. Previous to this, the flags were not reset until the next physics step (thanks @samme) +* `Physics.Arcade.ProcessX` is a new set of functions, called by the `SeparateX` function, that handles all of the different collision tests, checks and resolutions. These functions are not exposed in the public API. +* `Physics.Arcade.ProcessY` is a new set of functions, called by the `SeparateY` function, that handles all of the different collision tests, checks and resolutions. These functions are not exposed in the public API. +* `Arcade.Body.center` values were incorrect after collisions with the world bounds or (for rectangular bodies) after collisions with another body. The body center is now updated after those separations (thanks @samme) +* The Arcade Physics `WORLD_STEP` event now has a new parameter: the delta argument (thanks @samme) +* The Arcade Body `drag` property has been redefined when damping is used and scales the damping multiplier by the physics step delta. Drag is now the velocity retained after 1 second instead of after 1 step, when damping is used. This makes damping consistent for different physics step rates and more accurate when fixedStep is off. If you use `drag` you will need to change any existing drag values to get the same effects as before. Convert `drag` to `drag ^ 60` or `drag ^ fps` if you use a different step rate (thanks @samme) + +### Loader Cache Changes + +When loading any of the file types listed below it will no longer store the data file in the cache. For example, when loading a Texture Atlas using a JSON File, it used to store the parsed image data in the Texture Manager and also store the JSON in the JSON Cache under the same key. This has changed in 3.50. The data files are no longer cached, as they are not required by the textures once parsing is completed, which happens during load. This helps free-up memory. How much depends on the size of your data files. And also allows you to easily remove textures based on just their key, without also having to clear out the corresponding data cache. + +* `AtlasJSONFile` no longer stores the JSON in the JSON Cache once the texture has been created. +* `AtlasXMLFile` no longer stores the XML in the XML Cache once the texture has been created. +* `UnityAtlasFile` no longer stores the Text in the Text Cache once the texture has been created. +* `BitmapFontFile` no longer stores the XML in the XML Cache once the texture has been created. +* You can now use `TextureManager.remove` to remove a texture and not have to worry about clearing the corresponding JSON or XML cache entry as well in order to reload a new texture using the same key. Fix #5323 (thanks @TedGriggs) + +### ColorMatrix + +* `Phaser.Display.ColorMatrix` is a new class that allows you to create and manipulate a 5x4 color matrix, which can be used by shaders or graphics operations. +* The `ColorMatrix.set` method allows you to set the values of a ColorMatrix. +* The `ColorMatrix.reset` method will reset the ColorMatrix to its default values. +* The `ColorMatrix.getData` method will return the data in the ColorMatrix as a Float32Array, useful for setting in a shader uniform. +* The `ColorMatrix.brightness` method lets you set the brightness of the ColorMatrix. +* The `ColorMatrix.saturate` method lets you set the saturation of the ColorMatrix. +* The `ColorMatrix.desaturate` method lets you desaturate the colors in the ColorMatrix. +* The `ColorMatrix.hue` method lets you rotate the hues of the ColorMatrix by the given amount. +* The `ColorMatrix.grayscale` method converts the ColorMatrix to grayscale. +* The `ColorMatrix.blackWhite` method converts the ColorMatrix to black and whites. +* The `ColorMatrix.contrast` method lets you set the contrast of the ColorMatrix. +* The `ColorMatrix.negative` method converts the ColorMatrix to negative values. +* The `ColorMatrix.desaturateLuminance` method applies a desaturated luminance to the ColorMatrix. +* The `ColorMatrix.sepia` method applies a sepia tone to the ColorMatrix. +* The `ColorMatrix.night` method applies a night time effect to the ColorMatrix. +* The `ColorMatrix.lsd` method applies a trippy color effect to the ColorMatrix. +* The `ColorMatrix.brown` method applies a brown tone to the ColorMatrix. +* The `ColorMatrix.vintagePinhole` method applies a vintage pinhole color effect to the ColorMatrix. +* The `ColorMatrix.kodachrome` method applies a kodachrome color effect to the ColorMatrix. +* The `ColorMatrix.technicolor` method applies a technicolor color effect to the ColorMatrix. +* The `ColorMatrix.polaroid` method applies a polaroid color effect to the ColorMatrix. +* The `ColorMatrix.shiftToBGR` method shifts the values of the ColorMatrix into BGR order. +* The `ColorMatrix.multiply` method multiplies two ColorMatrix data sets together. + ### Removal of 'resolution' property from across the API For legacy reasons, Phaser 3 has never properly supported HighDPI devices. It will render happily to them of course, but wouldn't let you set a 'resolution' for the Canvas beyond 1. Earlier versions of 3.x had a resolution property in the Game Config, but it was never fully implemented (for example, it would break zooming cameras). When the Scale Manager was introduced in v3.16 we forced the resolution to be 1 to avoid it breaking anything else internally. @@ -487,7 +846,7 @@ For a long time, the 'resolution' property has been present - taunting developer * The `Phaser.Scale.Events#RESIZE` event no longer sends the `resolution` as a parameter. * The `BaseCamera.resolution` property has been removed. -* The internal private `BaseCamera._cx`, `_cy`, `_cw` and `_ch` properties has been removed. +* The internal private `BaseCamera._cx`, `_cy`, `_cw` and `_ch` properties has been removed, use `x`, `y`, `width` and `height` instead. * The `BaseCamera.preRender` method no longer receives or uses the `resolution` parameter. * The `Camera.preRender` method no longer receives or uses the `resolution` parameter. * The `CameraManager.onResize` method no longer receives or uses the `resolution` parameter. @@ -500,7 +859,7 @@ For a long time, the 'resolution' property has been present - taunting developer ### Removed 'interpolationPercentage' parameter from all render functions -Since v3.0.0 the Game Object `render` functions have received a parameter called `interpolationPercentage` that was never used. The renderers do not calculate this value and no Game Objects apply it, so for the sake of clairty, reducing code and removing complexity from the API it has been removed from every single function that either sent or expected the parameter. This touches every single Game Object and changes the parameter order as a result, so please be aware of this if you have your own _custom_ Game Objects that implement their own `render` methods. In terms of surface API changes, you shouldn't notice anything at all from this removal. +Since v3.0.0 the Game Object `render` functions have received a parameter called `interpolationPercentage` that was never used. The renderers do not calculate this value and no Game Objects apply it, so for the sake of clairty, reducing code and removing complexity from the API it has been removed from every single function that either sent or expected the parameter. This touches every single Game Object and changes the parameter order as a result, so please be aware of this if you have your own _custom_ Game Objects, or plugins, that implement their own `render` methods. In terms of surface API changes, you shouldn't notice anything at all from this removal. ### New Features @@ -510,7 +869,6 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called * `Geom.Intersects.GetRaysFromPointToPolygon` is a new function that emits rays out from the given point and detects for intersection against all given polygons, returning the points of intersection in the results array. * `Geom.Polygon.Translate` is a new function that allows you to translate all the points of a polygon by the given values. * `Geom.Polygon.Simplify` is a new function that takes a polygon and simplifies the points by running them through a combination of Douglas-Peucker and Radial Distance algorithms, potentially dramatically reducing the number of points while retaining its shape. -* `WebGLRenderer.setInt1iv` will allow you to look-up and set a 1iv uniform on the given shader. * `Phaser.Types.Math.Vector3Like` is a new data type representing as Vector 3 like object. * `Phaser.Types.Math.Vector4Like` is a new data type representing as Vector 4 like object. * `Transform.getLocalPoint` is a new method, available on all Game Objects, that takes an `x` / `y` pair and translates them into the local space of the Game Object, factoring in parent transforms and display origins. @@ -525,9 +883,6 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called * `Clock.addEvent` can now take an existing `TimerEvent` object, as well as a config object. If a `TimerEvent` is given it will be removed from the Clock, reset and then added. This allows you to pool TimerEvents rather than constantly create and delete them. Fix #4115 (thanks @jcyuan) * `Clock.removeEvent` is a new method that allows you to remove a `TimerEvent`, or an array of them, from all internal lists of the current Clock. * `Group.getMatching` is a new method that will return any members of the Group that match the given criteria, such as `getMatching('visible', true)` (thanks @atursams) -* `ArcadePhysics.disableUpdate` is a new method that will prevent the Arcade Physics World `update` method from being called when the Scene updates. By disabling it, you're free to call the update method yourself, passing in your own delta and time values. -* `ArcadePhysics.enableUpdate` is a new method that will make the Arcade Physics World update in time with the Scene update. This is the default, so only call this if you have specifically disabled it previously. -* `ArcadeWorldConfig.customUpdate` is a new boolean property you can set in the Arcade Physics config object, either in the Scene or in the Game Config. If `true` the World update will never be called, allowing you to call it yourself from your own component. Close #5190 (thanks @cfortuner) * `Utils.Array.SortByDigits` is a new function that takes the given array of strings and runs a numeric sort on it, ignoring any non-digits. * `GroupCreateConfig`, which is used when calling `Group.createMultiple` or `Group.createFromConfig`, can now accept the following new properties: `setOrigin: { x, y, stepX, stepY }` which are applied to the items created by the Group. * `Transform.copyPosition` is a new method that will copy the position from the given object to the Game Object (thanks @samme) @@ -535,13 +890,47 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called * `GameObjects.GetCalcMatrix` is a new function that is used to calculate the transformed Game Object matrix, based on the given Game Object, Camera and Parent. This function is now used by the following Game Objects: `BitmapText` (Static and Dynamic), `Graphics`, `Extern`, `Mesh`, `Rope`, `Shader`, `Arc`, `Curve`, `Ellipse`, `Grid`, `IsoBox`, `IsoTriangle`, `Line`, `Polygon`, `Rectangle`, `Star` and `Triangle`. This dramatically reduces the amount of duplicate code across the API. * `Utils.Array.Matrix.Translate` is a new function that will translate an Array Matrix by horizontally and vertically by the given amounts. * `Vertor3.addScale` is a new method that will add the given vector and multiply it in the process. -* `Physics.Arcade.Body.setCollideWorldBounds` now has a new optional parameter `onWorldBounds` which allows you to enable the World Bounce property in the same call (thanks @samme) * When defining the ease used with a Particle Emitter you can now set `easeParams` in the config object, allowing you to pass custom ease parameters through to an ease function (thanks @vforsh) -* `ArcadePhysics.Body.setMaxVelocityX` is a new method that allows you to set the maximum horizontal velocity of a Body (thanks @samme) -* `ArcadePhysics.Body.setMaxVelocityY` is a new method that allows you to set the maximum vertical velocity of a Body (thanks @samme) -* The `PhysicsGroup` config now has two new optional properties `maxVelocityX` and `maxVelocityY` which allows you to set the maximum velocity on bodies added to the Group (thanks @samme) * `BitmapMask.createMask` is a new method that will internally create the WebGL textures and framebuffers required for the mask. This is now used by the constructor and if the context is lost. It now also clears any previous textures/fbos that may have been created first, helping prevent memory leaks. * `BitmapMask.clearMask` will delete any WebGL textures or framebuffers the mask is using. This is now called when the mask is destroyed, or a new mask is created upon it. +* `Quaternion` now has a new property `onChangeCallback` which, if set, will be invoked each time the quaternion is updated. This allows you to link change events to other objects. +* The `Quaternion.set` method has a new optional boolean parameter `update` (defaults to `true`), which will call the `onChangeCallback` if set. +* `Quaternion.setFromEuler` is a new method that will set the quaternion from the given `Euler` object, optionally calling the `onChangeCallback` in the process. +* `Quaternion.setFromRotationMatrix` is a new method that will set the rotation of the quaternion from the given Matrix4. +* `Vector3.setFromMatrixPosition` is a new method that will set the components of the Vector3 based on the position of the given Matrix4. +* `Vector3.setFromMatrixColumn` is a new method that will set the components of the Vector3 based on the specified Matrix4 column. +* `Vector3.fromArray` is a new method that will set the components of the Vector3 based on the values in the given array, at the given offset. +* `Vector3.min` is a new method that will set the components of the Vector3 based on the `Main.min` between it and the given Vector3. +* `Vector3.max` is a new method that will set the components of the Vector3 based on the `Main.max` between it and the given Vector3. +* `Vector3.addVectors` is a new method that will set the components of the Vector3 based on the addition of the two Vector3s given. +* `Vector3.addScalar` is a new method that will multiply the components of the Vector3 by the scale value given. +* `Vector3.applyMatrix3` is a new method that will take a Matrix3 and apply it to the Vector3. +* `Vector3.applyMatrix4` is a new method that will take a Matrix4 and apply it to the Vector3. +* `Vector3.projectViewMatrix` is a new method that multiplies the Vector3 by the given view and projection matrices. +* `Vector3.unprojectViewMatrix` is a new method that multiplies the Vector3 by the given inversed projection matrix and world matrix. +* `Matrix4.setValues` is a new method that allows you to set all of the matrix components individually. Most internal methods now use this. +* `Matrix.multiplyToMat4` is a new method that multiplies a Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. +* `Matrix4.fromRotationXYTranslation` is a new method that takes the rotation and position vectors and builds this Matrix4 from them. +* `Matrix4.getMaxScaleOnAxis` is a new method that will return the maximum axis scale from the Matrix4. +* `Matrix4.lookAtRH` is a new method that will generate a right-handed look-at matrix from the given eye, target and up positions. +* `Matrix4.transform` is a new method that will generate a transform matrix from the given position and scale vectors and a rotation quaternion. +* `Matrix4.multiplyMatrices` is a new method that multiplies two given Matrix4 objects and stores the results in the Matrix4. +* `Matrix4.premultiply` is a new method that takes a Matrix4 and multiplies it by the current Matrix4. +* `Matrix4.getInverse` is a new method that takes a Matrix4, copies it to the current matrix, then returns the inverse of it. +* `CameraManager.getVisibleChildren` is a new method that is called internally by the `CameraManager.render` method. It filters the DisplayList, so that Game Objects that pass the `willRender` test for the given Camera are added to a sub-list, which is then passed to the renderer. This avoids the renderer having to do any checks on the children, it just renders each one in turn. +* `Physics.Arcade.Body.setDamping` is a new method that allows you to set the `useDamping` property of a Body in a chainable way. Fix #5352 (thanks @juanitogan) +* The `GameObjects.Graphics.fillGradientStyle` method can now accept a different alpha value for each of the fill colors. The default is still 1. If you only provide a single alpha, it'll be used for all colors. Fix #5044 (thanks @zhangciwu) +* `Types.Core.PipelineConfig` is a new configuration object that you can set in the Game Config under the `pipeline` property. It allows you to define custom WebGL pipelines as part of the Game Config, so they're automatically installed and ready for use by all Scenes in your game. You can either set the `pipeline` object, or set it under the `render` sub-config. +* `Utils.Object.DeepCopy` is a new function that will recursively deep copy an array of object. +* `Time.TimerEvent.getRemaining` is a new method that returns the time interval until the next iteration of the Timer Event (thanks @samme) +* `Time.TimerEvent.getRemainingSeconds` is a new method that returns the time interval until the next iteration of the Timer Event in seconds (thanks @samme) +* `Time.TimerEvent.getOverallRemaining` is a new method that returns the time interval until the last iteration of the Timer Event (thanks @samme) +* `Time.TimerEvent.getOverallRemainingSeconds` is a new method that returns the time interval until the last iteration of the Timer Event in seconds (thanks @samme) +* `GameObjects.Video.loadMediaStream` is a new method that allows you to hook a Video Game Object up to a Media Stream, rather than a URL, allowing you to stream video from a source such as a webcam (thanks @pirateksh) +* `Display.Color.ColorSpectrum` is a new function that will return an array of 1024 Color Object elements aligned in a Color Spectrum layout, where the darkest colors have been omitted. +* `AsepriteFile` is a new File Type for the Loader that allows you to load Aseprite images and animation data for use with the new Aseprite animation features. You can call this via `this.load.asesprite(png, json)`. +* `GameObject.displayList` is a new property that contains a reference to the Display List to which the Game Object has been added. This will typically either by the Display List owned by a Scene, or a Layer Game Object. You should treat this property as read-only. +* The `Shader` Game Object now supports being able to use a Render Texture as a `sampler2D` texture on the shader #5423 (thanks @ccaleb) ### Updates and API Changes @@ -551,8 +940,6 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called * Removed the Deferred Diffuse fragment and vertex shaders from the project, as they're not used. * `StaticTilemapLayer.upload` will now set the vertex attributes and buffer the data, and handles internal checks more efficiently. * `StaticTilemapLayer` now includes the `ModelViewProjection` mixin, so it doesn't need to modify the pipeline during rendering. -* `WebGLRenderer.textureFlush` is a new property that keeps track of the total texture flushes per frame. -* The `TextureTintStripPipeline` now extends `TextureTintPipeline` and just changes the topolgy, vastly reducing the filesize. * `TransformMatrix.getXRound` is a new method that will return the X component, optionally passed via `Math.round`. * `TransformMatrix.getYRound` is a new method that will return the Y component, optionally passed via `Math.round`. * The `KeyboardPlugin` no longer emits `keydown_` events. These were replaced with `keydown-` events in v3.15. The previous event string was deprecated in v3.20. @@ -563,22 +950,17 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called * The constant `Phaser.Renderer.WebGL.UNSIGNED_BYTE` value has been removed as it wasn't used internally. * The constant `Phaser.Renderer.WebGL.UNSIGNED_SHORT` value has been removed as it wasn't used internally. * The constant `Phaser.Renderer.WebGL.FLOAT` value has been removed as it wasn't used internally. -* `global.Phaser = Phaser` has been removed, as it's no longer required by the UMD loader, which should make importing in Angular 10 easier. Fix #5212 (thanks @blackyale) * `Pointer.downTime` now stores the event timestamp of when the first button on the input device was pressed down, not just when button 1 was pressed down. * `Pointer.upTime` now stores the event timestamp of when the final depressed button on the input device was released, not just when button 1 was released. * The `Pointer.getDuration` method now uses the new Pointer `downTime` and `upTime` values, meaning it will accurately report the duration of when any button is being held down, not just the primary one. Fix #5112 (thanks @veleek) * The `BaseShader` default vertex shader now includes the `outTexCoord` vec2 varying, mapped to be the same as that found in the pipeline shaders. Fix #5120 (@pavel-shirobok) * When using the `GameObjectCreator` for `Containers` you can now specify the `children` property in the configuration object. -* `WebGLRenderer.finalType` is a new boolean property that signifies if the current Game Object being rendered is the final one in the list. -* The `WebGLRenderer.updateCanvasTexture` method will now set `gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL` to true, which should stop issues where you update a Text Game Object, having added a Render Texture or Spine Game Object to the Scene after it, which switches the PMA setting. Fix #5064 #5155 (thanks @hugoruscitti @immangrove-supertree) * `Textures.Parsers.JSONHash` will now perform a `hasOwnProperty` check when iterating the frames, skipping anything that isn't a direct property. This should allow you to use generated atlas data that comes from `JSON.parse`. Fix #4768 (thanks @RollinSafary) * The `Camera3D` Plugin has been rebuilt for Phaser 3.50 and the webpack config updated. This plugin is now considered deprecated and will not be updated beyond this release. * `Tween.seek` will no longer issue a console warning for `'Tween.seek duration too long'`, it's now up to you to check on the performance of tween seeking. -* `WebGLRenderer.previousPipeline` is a new property that is set during a call to `clearPipeline` and used during calls to `rebindPipeline`, allowing the renderer to rebind any previous pipeline, not just the Multi Pipeline. -* The `WebGLRenderer.rebindPipeline` method has been changed slightly. Previously, you had to specify the `pipelineInstance`, but this is now optional. If you don't, it will use the new `previousPipeline` property instead. If not set, or none given, it will now return without throwing gl errors as well. -* If `inputWindowEvents` is set in the Game Config, then the `MouseManager` will now listen for the events on `window.top` instead of just `window`, which should help in situations where the pointer is released outside of an embedded iframe. Fix #4824 (thanks @rexrainbow) +* If `inputWindowEvents` is set in the Game Config, then the `MouseManager` will now listen for the events on `window.top` instead of just `window`, which should help in situations where the pointer is released outside of an embedded iframe. This check is wrapped in a `try/catch` block, as not all sites allow access to `window.top` (specifically in cross-origin iframe situations) Fix #4824 (thanks @rexrainbow) +* `MouseManager.isTop` is a new boolean read-only property that flags if the mouse event listeners were attached to `window.top` (true), or just `window` (false). By default Phaser will attempt `window.top`, but this isn't possible in all environments, such as cross-origin iframes, so it will fall back to `window` in those cases and set this property to false (thanks BunBunBun) * `Types.GameObjects.Text.GetTextSizeObject` is a new type def for the GetTextSize function results. -* The `Arcade.Body.resetFlags` method has a new optional boolean parameter `clear`. If set, it clears the `wasTouching` flags on the Body. This happens automatically when `Body.reset` is called. Previous to this, the flags were not reset until the next physics step (thanks @samme) * `Utils.Array.StableSort` has been recoded. It's now based on Two-Screens stable sort 0.1.8 and has been updated to fit into Phaser better and no longer create any window bound objects. The `inplace` function has been removed, just call `StableSort(array)` directly now. All classes that used `StableSort.inplace` have been updated to call it directly. * If a Scene is paused, or sent to sleep, it will automatically call `Keyboard.resetKeys`. This means that if you hold a key down, then sleep or pause a Scene, then release the key and resume or wake the Scene, it will no longer think it is still being held down (thanks @samme) * `Actions.setOrigin` will now call `updateDisplayOrigin` on the items array, otherwise the effects can't be seen when rendering. @@ -590,13 +972,24 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called * Setting the `pixelArt` config option will now set `antialiasGL` to `false`, as well as `antialias`. Fix #5309 (thanks @Vegita2) * The `Shape` class now includes the `ComputedSize` component properties and methods directly in the class, rather than applying as a mixin. `setSize` is now flagged as being `private`, because it shouldn't be used on Shape classes, which was leading to confusion as it appeared in the public-facing API. Fix #4811 (thanks @aolsx) * The `Loader.maxParallelDownloads` value is now set to 6 if running on Android, or 32 on any other OS. This avoids `net::ERR_FAILED` issues specifically on Android. You can still override this in the Game Config if you wish. Fix #4957 (thanks @RollinSafary) -* `WebGLRenderer.defaultScissor` is a new property that holds the default scissor dimensions for the renderer. This is modified during `resize` and avoids continuous array generation in the `preRender` loop. * When running an Arcade Physics `overlap` test against a `StaticBody`, it will no longer set the `blocked` states of the dynamic body. If you are doing a collision test, they will still be set, but they're skipped for overlap-only tests. Fix #4435 (thanks @samme) +* The `Line` Game Object will now default its width and height to 1, rather than zero. This allows you to give Line objects a physics body (although you will still need to re-adjust the center of the body manually). Fix #4596 (thanks @andrewaustin) +* Internally, the `Quaternion` class now has 4 new private properties: `_x`, `_y`, `_z` and `_w` and 4 new getters and setters for the public versions. It also now passes most methods via `set` to allow for the onChange callback to be invoked. This does not change the public-facing API. +* `Group` now extends `EventEmitter`, allowing you to emit custom events from within a Group. +* `Device.Audio.wav` now uses `audio/wav` as the `canPlayType` check string, instead of `audio/wav; codecs="1"`, which should allow iOS13 to play wav files again. +* In the `Loader.FileTypes.TextFile` config you can now override the type and cache destination for the file. +* `Loader.MultiFile` will now parse the given files array and only add valid entries into the file list, allowing multifiles to now have optional file entries. +* The `ParticleEmitter.tint` value is now `0xffffff` (previously, it was `0xffffffff`) to allow particle tints to work in the correct RGB order including alpha (thanks @vforsh) +* `SceneManager.start` will now reset the `SceneSystems.sceneUpdate` reference to `NOOP`. This gets set back to the Scene update method again during `bootScene` (if it has one) and stops errors with external plugins and multi-part files that may trigger `update` before `create` has been called. Fix #4629 (thanks @Osmose) +* `Phaser.Scene.renderer` is a new property available in every Phaser.Scene that gives you a reference to the renderer, either Canvas or WebGL. +* The `CanvasRenderer._tempMatrix1`, `_tempMatrtix2`, `_tempMatrix3` and `_tempMatrix4` properties have been removed. They were all flagged as private, yet used in lots of places. Instead, Game Objects now manager their own matrices, or use the global `GetCalcMatrix` function instead. +* Since iOS 13, iPads now identify as MacOS devices. A new maxTouchPoint check is now part of the `Device.OS` tests, stopping iPads from being flagged as desktop devices. Fix #5389 (thanks @SBCGames) +* The `BitmapMask.prevFramebuffer` property has been removed as it's no longer required, due to the fbo stack in the renderer. +* The `TextureManager.addGLTexture` method has been updated so that the `width` and `height` parameters are now optional. If not provided, and if available, they will be read from the given WebGLTexture instead (thanks @hexus) +* `GameObjects.Components.Depth.depthList` is a new property that all Game Objects that have the Depth Component now have. It contains a reference to the List responsible for managing the depth sorting of the Game Object. This is typically the Scene Display List, but can also be a Layer. It allows the Depth component to queue a depth sort directly on the list it belongs to now, rather than just the Scene. ### Bug Fixes -* `RenderTexture.resize` (which is called from `setSize`) wouldn't correctly set the `TextureSource.glTexture` property, leading to `bindTexture: attempt to use a deleted object` errors under WebGL. -* `RenderTexture.fill` would fail to fill the correct area under WebGL if the RenderTexture wasn't the same size as the Canvas. It now fills the given region properly. * The `MatterAttractors` plugin, which enables attractors between bodies, has been fixed. The original plugin only worked if the body with the attractor was _first_ in the world bodies list. It can now attract any body, no matter where in the world list it is. Fix #5160 (thanks @strahius) * The `KeyboardManager` and `KeyboardPlugin` were both still checking for the `InputManager.useQueue` property, which was removed several versions ago. * In Arcade Physics, Dynamic bodies would no longer hit walls when riding on horizontally moving platforms. The horizontal (and vertical) friction is now re-applied correctly in these edge-cases. Fix #5210 (thanks @Dercetech @samme) @@ -620,6 +1013,15 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called * Creating a Bitmap Mask from a texture atlas that was then used to mask another Game Object also using that same texture atlas would throw the error `GL_INVALID_OPERATION : glDrawArrays: Source and destination textures of the draw are the same.`. It now renders as expected. Fix #4675 (thanks @JacobCaron) * When using the same asset for a Game Object to be used as a mask, it would make other Game Objects using the same asset, that appeared above the mask in the display list, to not render. Fix #4767 (thanks @smjnab) * When taking a `snapshot` in WebGL it would often have an extra line of empty pixels at the top of the resulting image, due to a rounding error in the `WebGLSnapshot` function. Fix #4956 (thanks @gammafp @telinc1) +* `Particles.EmitterOp.setMethods` will now reset both `onEmit` and `onUpdate` to their default values. This allows you to reconfigure an emitter op with a new type of value and not have it stuck on the previous one. Fix #3663 (thanks @samme) +* `Particles.EmitterOp` now cleanly separates between the different types of property configuration options. `start | end` will now ease between the two values, `min | max` will pick a random value between them and `random: []` will pick a random element. They no longer get mixed together. Fix #3608 (thanks @samme) +* When setting both `transparent: true` and `backgroundColor` in the Game Config, it would ignore the transparency and use the color anyway. If transparent, the game is now fully transparent. Fix #5362 (thanks @Hoshinokoe) +* The `Ellipse` Game Object now will update the width, height, and geometric position in the `setSize` method (thanks @PhaserEditor2D) +* When measuring the last word in a line in a `Text` Game Object, it no longer adds extra white space to the end (thanks @rexrainbow) +* `Utils.Array.Remove` would return an incorrect array of removed elements if one of the items to be removed was skipped in the array. Fix #5398 (thanks @year221) +* `Geom.Intersects.TriangleToLine` wouldn't return `true` if the start or end of the Line fell inside the Triangle, only if the entire Line did. It now checks the start and end points correctly. (thanks @wiserim) +* Using a Bitmap Mask and a Blend Mode in WebGL would reset the blend mode when the mask was rendered, causing the Game Object to have no blend mode. Fix #5409 (thanks @jcyuan) +* `BitmapMask` would become corrupted when resizing the Phaser Game, either via the Scale Manager or directly, because the framebuffer and texture it used for rendering was still at the old dimensions. The BitmapMask now listens for the Renderer RESIZE event and re-creates itself accordingly. Fix #5399 (thanks @Patapits) ### Namespace Updates @@ -650,4 +1052,4 @@ Since v3.0.0 the Game Object `render` functions have received a parameter called My thanks to the following for helping with the Phaser 3 Examples, Docs, and TypeScript definitions, either by reporting errors, fixing them, or helping author the docs: -@samme @16patsle @scott20145 @khasanovbi @mk360 @volkans80 @jaabberwocky @maikthomas @atursams @LearningCode2023 @DylanC @BenjaminDRichards @rexrainbow @Riderrr @spwilson2 @EmilSV @PhaserEditor2D @Gangryong @vinerz +@samme @16patsle @scott20145 @khasanovbi @mk360 @volkans80 @jaabberwocky @maikthomas @atursams @LearningCode2023 @DylanC @BenjaminDRichards @rexrainbow @Riderrr @spwilson2 @EmilSV @PhaserEditor2D @Gangryong @vinerz @trynx @usufruct99 @pirateksh @justin-calleja @monteiz diff --git a/README.md b/README.md index 42109e957..b9f85af89 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ I'm pleased to announce the immediate availability of Phaser 3.24. This release So, please do spend some time digging through the [Change Log](#changelog). I assure you, it's worth while :) -I'd like to send a massive thank-you to everyone who supports [Phaser on Patreon](https://www.patreon.com/photonstorm) (and now even GitHub Sponsors, too!) Your continued backing keeps allowing me to work on Phaser full-time and this great new releases is the very real result of that. If you've ever considered becoming a backer, now is the perfect time! +I'd like to send a massive thank-you to everyone who supports [Phaser on Patreon](https://www.patreon.com/photonstorm) (and now even GitHub Sponsors, too!) Your continued backing keeps allowing me to work on Phaser full-time and this great new release is the very real result of that. If you've ever considered becoming a backer, now is the perfect time! As well as all of these updates, development has been progressing rapidly on Phaser 4. If you'd like to stay abreast of developments then I'm now publishing them to the [Phaser Patreon](https://www.patreon.com/photonstorm). Here you can find details about the latest developments and concepts behind Phaser 4. @@ -63,7 +63,7 @@ There are other benefits to [backing Phaser](https://www.patreon.com/join/photon We use [Patreon](https://www.patreon.com/photonstorm) to manage the backing and you can [support Phaser](https://www.patreon.com/join/photonstorm?) from $1 per month. The amount you pledge is entirely up to you and can be changed as often as you like. Patreon renews monthly, just like Netflix. You can, of course, cancel at any point. Tears will be shed on this end, but that's not your concern. -Extra special thanks to the following companies who's support makes Phaser possible: +Extra special thanks to the following companies whose support makes Phaser possible: * [Cerebral Fix](https://cerebralfix.com) * [CrossInstall](https://crossinstall.com) diff --git a/config/webpack.3d.dist.config.js b/config/webpack.3d.dist.config.js new file mode 100644 index 000000000..bc874f236 --- /dev/null +++ b/config/webpack.3d.dist.config.js @@ -0,0 +1,58 @@ +'use strict'; + +const webpack = require('webpack'); +const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); +const { CleanWebpackPlugin } = require('clean-webpack-plugin'); + +module.exports = { + mode: 'production', + + context: `${__dirname}/../src/`, + + entry: { + phaser: './phaser.js', + 'phaser.min': './phaser.js' + }, + + output: { + path: `${__dirname}/../dist/`, + filename: '[name]3d.js', + library: 'Phaser', + libraryTarget: 'umd', + umdNamedDefine: true + }, + + performance: { hints: false }, + + optimization: { + minimizer: [ + new UglifyJSPlugin({ + include: /\.min\.js$/, + parallel: true, + sourceMap: false, + uglifyOptions: { + compress: true, + ie8: false, + ecma: 5, + output: {comments: false}, + warnings: false + }, + warningsFilter: () => false + }) + ] + }, + + plugins: [ + new webpack.DefinePlugin({ + "typeof CANVAS_RENDERER": JSON.stringify(true), + "typeof WEBGL_RENDERER": JSON.stringify(true), + "typeof EXPERIMENTAL": JSON.stringify(false), + "typeof PLUGIN_3D": JSON.stringify(true), + "typeof PLUGIN_CAMERA3D": JSON.stringify(false), + "typeof PLUGIN_FBINSTANT": JSON.stringify(false), + "typeof FEATURE_SOUND": JSON.stringify(true) + }), + + new CleanWebpackPlugin() + ] +}; diff --git a/config/webpack.config.js b/config/webpack.config.js index 57da29f9a..0c232a58a 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -30,6 +30,7 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(true), "typeof EXPERIMENTAL": JSON.stringify(true), + "typeof PLUGIN_3D": JSON.stringify(false), "typeof PLUGIN_CAMERA3D": JSON.stringify(false), "typeof PLUGIN_FBINSTANT": JSON.stringify(false), "typeof FEATURE_SOUND": JSON.stringify(true) diff --git a/config/webpack.dist.config.js b/config/webpack.dist.config.js index 3e72d2250..d2dd2e4a4 100644 --- a/config/webpack.dist.config.js +++ b/config/webpack.dist.config.js @@ -49,6 +49,7 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(true), "typeof EXPERIMENTAL": JSON.stringify(false), + "typeof PLUGIN_3D": JSON.stringify(false), "typeof PLUGIN_CAMERA3D": JSON.stringify(false), "typeof PLUGIN_FBINSTANT": JSON.stringify(false), "typeof FEATURE_SOUND": JSON.stringify(true) diff --git a/config/webpack.fb.config.js b/config/webpack.fb.config.js index ac094c3ea..43dbf6e0e 100644 --- a/config/webpack.fb.config.js +++ b/config/webpack.fb.config.js @@ -30,6 +30,7 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(true), "typeof EXPERIMENTAL": JSON.stringify(false), + "typeof PLUGIN_3D": JSON.stringify(false), "typeof PLUGIN_CAMERA3D": JSON.stringify(false), "typeof PLUGIN_FBINSTANT": JSON.stringify(true), "typeof FEATURE_SOUND": JSON.stringify(true) diff --git a/config/webpack.fb.dist.config.js b/config/webpack.fb.dist.config.js index 3f7816c37..3942b3671 100644 --- a/config/webpack.fb.dist.config.js +++ b/config/webpack.fb.dist.config.js @@ -46,6 +46,7 @@ module.exports = { "typeof CANVAS_RENDERER": JSON.stringify(true), "typeof WEBGL_RENDERER": JSON.stringify(true), "typeof EXPERIMENTAL": JSON.stringify(false), + "typeof PLUGIN_3D": JSON.stringify(false), "typeof PLUGIN_CAMERA3D": JSON.stringify(false), "typeof PLUGIN_FBINSTANT": JSON.stringify(true), "typeof FEATURE_SOUND": JSON.stringify(true) diff --git a/dist/phaser-arcade-physics.js b/dist/phaser-arcade-physics.js index f72aa89e8..a9e495a23 100644 --- a/dist/phaser-arcade-physics.js +++ b/dist/phaser-arcade-physics.js @@ -91,7 +91,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 1455); +/******/ return __webpack_require__(__webpack_require__.s = 1519); /******/ }) /************************************************************************/ /******/ ([ @@ -432,7 +432,7 @@ module.exports = GetFastValue; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); -var FuzzyEqual = __webpack_require__(109); +var FuzzyEqual = __webpack_require__(121); /** * @classdesc @@ -1205,7 +1205,7 @@ module.exports = Vector2; */ var Class = __webpack_require__(0); -var GEOM_CONST = __webpack_require__(49); +var GEOM_CONST = __webpack_require__(55); /** * @classdesc @@ -1233,7 +1233,7 @@ var Point = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Point#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -1298,7 +1298,7 @@ module.exports = Point; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -1428,6 +1428,8 @@ var GameObjectFactory = new Class({ this.displayList.add(child); } + // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: + // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. if (child.preUpdate) { this.updateList.add(child); @@ -1725,12 +1727,12 @@ module.exports = FileTypesManager; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(50); -var GetPoint = __webpack_require__(161); -var GetPoints = __webpack_require__(283); -var GEOM_CONST = __webpack_require__(49); -var Line = __webpack_require__(40); -var Random = __webpack_require__(164); +var Contains = __webpack_require__(56); +var GetPoint = __webpack_require__(162); +var GetPoints = __webpack_require__(298); +var GEOM_CONST = __webpack_require__(55); +var Line = __webpack_require__(45); +var Random = __webpack_require__(165); /** * @classdesc @@ -1762,7 +1764,7 @@ var Rectangle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Rectangle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -1855,7 +1857,7 @@ var Rectangle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. * @@ -2227,298 +2229,6 @@ module.exports = Rectangle; /***/ }), /* 10 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @author Matthew Groves <@doormat> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate shader source to test maximum ifs. - * - * @private - * @param {number} maxIfs - The number of if statements to generate - */ -function GenerateSrc (maxIfs) -{ - var src = ''; - - for (var i = 0; i < maxIfs; ++i) - { - if (i > 0) - { - src += '\nelse '; - } - - if (i < maxIfs - 1) - { - src += 'if(test == ' + i + '.0){}'; - } - } - - return src; -} - -/** - * @namespace Phaser.Renderer.WebGL.Utils - * @since 3.0.0 - */ -module.exports = { - - /** - * Packs four floats on a range from 0.0 to 1.0 into a single Uint32 - * - * @function Phaser.Renderer.WebGL.Utils.getTintFromFloats - * @since 3.0.0 - * - * @param {number} r - Red component in a range from 0.0 to 1.0 - * @param {number} g - Green component in a range from 0.0 to 1.0 - * @param {number} b - Blue component in a range from 0.0 to 1.0 - * @param {number} a - Alpha component in a range from 0.0 to 1.0 - * - * @return {number} The packed RGBA values as a Uint32. - */ - getTintFromFloats: function (r, g, b, a) - { - var ur = ((r * 255.0)|0) & 0xFF; - var ug = ((g * 255.0)|0) & 0xFF; - var ub = ((b * 255.0)|0) & 0xFF; - var ua = ((a * 255.0)|0) & 0xFF; - - return ((ua << 24) | (ur << 16) | (ug << 8) | ub) >>> 0; - }, - - /** - * Packs a Uint24, representing RGB components, with a Float32, representing - * the alpha component, with a range between 0.0 and 1.0 and return a Uint32 - * - * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha - * @since 3.0.0 - * - * @param {number} rgb - Uint24 representing RGB components - * @param {number} a - Float32 representing Alpha component - * - * @return {number} Packed RGBA as Uint32 - */ - getTintAppendFloatAlpha: function (rgb, a) - { - var ua = ((a * 255.0)|0) & 0xFF; - return ((ua << 24) | rgb) >>> 0; - }, - - /** - * Packs a Uint24, representing RGB components, with a Float32, representing - * the alpha component, with a range between 0.0 and 1.0 and return a - * swizzled Uint32 - * - * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlphaAndSwap - * @since 3.0.0 - * - * @param {number} rgb - Uint24 representing RGB components - * @param {number} a - Float32 representing Alpha component - * - * @return {number} Packed RGBA as Uint32 - */ - getTintAppendFloatAlphaAndSwap: function (rgb, a) - { - var ur = ((rgb >> 16)|0) & 0xff; - var ug = ((rgb >> 8)|0) & 0xff; - var ub = (rgb|0) & 0xff; - var ua = ((a * 255.0)|0) & 0xFF; - - return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; - }, - - /** - * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0 - * - * @function Phaser.Renderer.WebGL.Utils.getFloatsFromUintRGB - * @since 3.0.0 - * - * @param {number} rgb - RGB packed as a Uint24 - * - * @return {array} Array of floats representing each component as a float - */ - getFloatsFromUintRGB: function (rgb) - { - var ur = ((rgb >> 16)|0) & 0xff; - var ug = ((rgb >> 8)|0) & 0xff; - var ub = (rgb|0) & 0xff; - - return [ ur / 255.0, ug / 255.0, ub / 255.0 ]; - }, - - /** - * Counts how many attributes of 32 bits a vertex has - * - * @function Phaser.Renderer.WebGL.Utils.getComponentCount - * @since 3.0.0 - * - * @param {array} attributes - Array of attributes - * @param {WebGLRenderingContext} glContext - WebGLContext used for check types - * - * @return {number} Count of 32 bit attributes in vertex - */ - getComponentCount: function (attributes, glContext) - { - var count = 0; - - for (var index = 0; index < attributes.length; ++index) - { - var element = attributes[index]; - - if (element.type === glContext.FLOAT) - { - count += element.size; - } - else - { - count += 1; // We'll force any other type to be 32 bit. for now - } - } - - return count; - }, - - /** - * Check to see how many texture units the GPU supports, based on the given config value. - * Then tests this against the maximum number of iterations GLSL can support. - * - * @function Phaser.Renderer.WebGL.Utils.checkShaderMax - * @since 3.50.0 - * - * @param {WebGLRenderingContext} gl - The WebGLContext used to create the shaders. - * @param {number} maxTextures - The Game Config maxTextures value. - * - * @return {number} The number of texture units that is supported by this browser and GPU. - */ - checkShaderMax: function (gl, maxTextures) - { - if (!maxTextures || maxTextures === -1) - { - maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); - } - - var shader = gl.createShader(gl.FRAGMENT_SHADER); - - var fragTemplate = [ - 'precision mediump float;', - 'void main(void){', - 'float test = 0.1;', - '%forloop%', - 'gl_FragColor = vec4(0.0);', - '}' - ].join('\n'); - - // eslint-disable-next-line no-constant-condition - while (true) - { - var fragmentSrc = fragTemplate.replace(/%forloop%/gi, GenerateSrc(maxTextures)); - - gl.shaderSource(shader, fragmentSrc); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - maxTextures = (maxTextures / 2) | 0; - } - else - { - // valid! - break; - } - } - - return maxTextures; - }, - - /** - * Checks the given Fragment Shader Source for `%count%` and `%forloop%` declarations and - * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. - * - * @function Phaser.Renderer.WebGL.Utils.parseFragmentShaderMaxTextures - * @since 3.50.0 - * - * @param {string} fragmentShaderSource - The Fragment Shader source code to operate on. - * @param {number} maxTextures - The number of maxTextures value. - * - * @return {string} The modified Fragment Shader source. - */ - parseFragmentShaderMaxTextures: function (fragmentShaderSource, maxTextures) - { - var src = ''; - - for (var i = 0; i < maxTextures; i++) - { - if (i > 0) - { - src += '\n\telse '; - } - - if (i < maxTextures - 1) - { - src += 'if (outTexId < ' + i + '.5)'; - } - - src += '\n\t{'; - src += '\n\t\ttexture = texture2D(uMainSampler[' + i + '], outTexCoord);'; - src += '\n\t}'; - } - - fragmentShaderSource = fragmentShaderSource.replace(/%count%/gi, maxTextures.toString()); - - return fragmentShaderSource.replace(/%forloop%/gi, src); - } -}; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Components - */ - -module.exports = { - - Alpha: __webpack_require__(562), - AlphaSingle: __webpack_require__(280), - BlendMode: __webpack_require__(281), - ComputedSize: __webpack_require__(563), - Crop: __webpack_require__(564), - Depth: __webpack_require__(282), - Flip: __webpack_require__(565), - GetBounds: __webpack_require__(566), - Mask: __webpack_require__(286), - Origin: __webpack_require__(583), - PathFollower: __webpack_require__(584), - Pipeline: __webpack_require__(165), - ScrollFactor: __webpack_require__(289), - Size: __webpack_require__(585), - Texture: __webpack_require__(586), - TextureCrop: __webpack_require__(587), - Tint: __webpack_require__(588), - ToJSON: __webpack_require__(290), - Transform: __webpack_require__(291), - TransformMatrix: __webpack_require__(31), - Visible: __webpack_require__(292) - -}; - - -/***/ }), -/* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2860,6 +2570,273 @@ if (true) { } +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Components + */ + +module.exports = { + + Alpha: __webpack_require__(601), + AlphaSingle: __webpack_require__(295), + BlendMode: __webpack_require__(296), + ComputedSize: __webpack_require__(602), + Crop: __webpack_require__(603), + Depth: __webpack_require__(297), + Flip: __webpack_require__(604), + GetBounds: __webpack_require__(605), + Mask: __webpack_require__(301), + Origin: __webpack_require__(622), + PathFollower: __webpack_require__(623), + Pipeline: __webpack_require__(166), + ScrollFactor: __webpack_require__(304), + Size: __webpack_require__(624), + Texture: __webpack_require__(625), + TextureCrop: __webpack_require__(626), + Tint: __webpack_require__(627), + ToJSON: __webpack_require__(168), + Transform: __webpack_require__(305), + TransformMatrix: __webpack_require__(24), + Visible: __webpack_require__(306) + +}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @author Matthew Groves <@doormat> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate shader source to test maximum ifs. + * + * @private + * @ignore + * @param {number} maxIfs - The number of if statements to generate + */ +function GenerateSrc (maxIfs) +{ + var src = ''; + + for (var i = 0; i < maxIfs; ++i) + { + if (i > 0) + { + src += '\nelse '; + } + + if (i < maxIfs - 1) + { + src += 'if(test == ' + i + '.0){}'; + } + } + + return src; +} + +/** + * @namespace Phaser.Renderer.WebGL.Utils + * @since 3.0.0 + */ +module.exports = { + + /** + * Packs four floats on a range from 0.0 to 1.0 into a single Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintFromFloats + * @since 3.0.0 + * + * @param {number} r - Red component in a range from 0.0 to 1.0 + * @param {number} g - Green component in a range from 0.0 to 1.0 + * @param {number} b - Blue component in a range from 0.0 to 1.0 + * @param {number} a - Alpha component in a range from 0.0 to 1.0 + * + * @return {number} The packed RGBA values as a Uint32. + */ + getTintFromFloats: function (r, g, b, a) + { + var ur = ((r * 255) | 0) & 0xff; + var ug = ((g * 255) | 0) & 0xff; + var ub = ((b * 255) | 0) & 0xff; + var ua = ((a * 255) | 0) & 0xff; + + return ((ua << 24) | (ur << 16) | (ug << 8) | ub) >>> 0; + }, + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha + * @since 3.0.0 + * + * @param {number} rgb - Uint24 representing RGB components + * @param {number} a - Float32 representing Alpha component + * + * @return {number} Packed RGBA as Uint32 + */ + getTintAppendFloatAlpha: function (rgb, a) + { + var ua = ((a * 255) | 0) & 0xff; + + return ((ua << 24) | rgb) >>> 0; + }, + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a + * swizzled Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlphaAndSwap + * @since 3.0.0 + * + * @param {number} rgb - Uint24 representing RGB components + * @param {number} a - Float32 representing Alpha component + * + * @return {number} Packed RGBA as Uint32 + */ + getTintAppendFloatAlphaAndSwap: function (rgb, a) + { + var ur = ((rgb >> 16) | 0) & 0xff; + var ug = ((rgb >> 8) | 0) & 0xff; + var ub = (rgb | 0) & 0xff; + var ua = ((a * 255) | 0) & 0xff; + + return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; + }, + + /** + * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0 + * + * @function Phaser.Renderer.WebGL.Utils.getFloatsFromUintRGB + * @since 3.0.0 + * + * @param {number} rgb - RGB packed as a Uint24 + * + * @return {array} Array of floats representing each component as a float + */ + getFloatsFromUintRGB: function (rgb) + { + var ur = ((rgb >> 16) | 0) & 0xff; + var ug = ((rgb >> 8) | 0) & 0xff; + var ub = (rgb | 0) & 0xff; + + return [ ur / 255, ug / 255, ub / 255 ]; + }, + + /** + * Check to see how many texture units the GPU supports, based on the given config value. + * Then tests this against the maximum number of iterations GLSL can support. + * + * @function Phaser.Renderer.WebGL.Utils.checkShaderMax + * @since 3.50.0 + * + * @param {WebGLRenderingContext} gl - The WebGLContext used to create the shaders. + * @param {number} maxTextures - The Game Config maxTextures value. + * + * @return {number} The number of texture units that is supported by this browser and GPU. + */ + checkShaderMax: function (gl, maxTextures) + { + if (!maxTextures || maxTextures === -1) + { + maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); + } + + var shader = gl.createShader(gl.FRAGMENT_SHADER); + + var fragTemplate = [ + 'precision mediump float;', + 'void main(void){', + 'float test = 0.1;', + '%forloop%', + 'gl_FragColor = vec4(0.0);', + '}' + ].join('\n'); + + // eslint-disable-next-line no-constant-condition + while (true) + { + var fragmentSrc = fragTemplate.replace(/%forloop%/gi, GenerateSrc(maxTextures)); + + gl.shaderSource(shader, fragmentSrc); + gl.compileShader(shader); + + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) + { + maxTextures = (maxTextures / 2) | 0; + } + else + { + // valid! + break; + } + } + + return maxTextures; + }, + + /** + * Checks the given Fragment Shader Source for `%count%` and `%forloop%` declarations and + * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. + * + * @function Phaser.Renderer.WebGL.Utils.parseFragmentShaderMaxTextures + * @since 3.50.0 + * + * @param {string} fragmentShaderSource - The Fragment Shader source code to operate on. + * @param {number} maxTextures - The number of maxTextures value. + * + * @return {string} The modified Fragment Shader source. + */ + parseFragmentShaderMaxTextures: function (fragmentShaderSource, maxTextures) + { + if (!fragmentShaderSource) + { + return ''; + } + + var src = ''; + + for (var i = 0; i < maxTextures; i++) + { + if (i > 0) + { + src += '\n\telse '; + } + + if (i < maxTextures - 1) + { + src += 'if (outTexId < ' + i + '.5)'; + } + + src += '\n\t{'; + src += '\n\t\ttexture = texture2D(uMainSampler[' + i + '], outTexCoord);'; + src += '\n\t}'; + } + + fragmentShaderSource = fragmentShaderSource.replace(/%count%/gi, maxTextures.toString()); + + return fragmentShaderSource.replace(/%forloop%/gi, src); + } +}; + + /***/ }), /* 13 */ /***/ (function(module, exports) { @@ -2963,10 +2940,10 @@ module.exports = MATH_CONST; */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(290); -var DataManager = __webpack_require__(120); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(29); +var ComponentsToJSON = __webpack_require__(168); +var DataManager = __webpack_require__(97); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(32); /** * @classdesc @@ -2994,16 +2971,33 @@ var GameObject = new Class({ EventEmitter.call(this); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * * @name Phaser.GameObjects.GameObject#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.GameObject#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + /** * A textual representation of this Game Object, i.e. `sprite`. * Used internally by Phaser but is available for your own custom classes to populate. @@ -3025,7 +3019,7 @@ var GameObject = new Class({ * If you need to store complex data about your Game Object, look at using the Data Component instead. * * @name Phaser.GameObjects.GameObject#state - * @type {(integer|string)} + * @type {(number|string)} * @since 3.16.0 */ this.state = 0; @@ -3067,7 +3061,7 @@ var GameObject = new Class({ * Reserved for future use by plugins and the Input Manager. * * @name Phaser.GameObjects.GameObject#tabIndex - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -3091,7 +3085,7 @@ var GameObject = new Class({ * If those components are not used by your custom class then you can use this bitmask as you wish. * * @name Phaser.GameObjects.GameObject#renderFlags - * @type {integer} + * @type {number} * @default 15 * @since 3.0.0 */ @@ -3199,7 +3193,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#setState * @since 3.16.0 * - * @param {(integer|string)} value - The state of the Game Object. + * @param {(number|string)} value - The state of the Game Object. * * @return {this} This GameObject. */ @@ -3565,7 +3559,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#getIndexList * @since 3.4.0 * - * @return {integer[]} An array of display list position indexes. + * @return {number[]} An array of display list position indexes. */ getIndexList: function () { @@ -3634,16 +3628,15 @@ var GameObject = new Class({ this.emit(Events.DESTROY, this); - var sys = this.scene.sys; - if (!fromScene) { - sys.displayList.remove(this); + this.displayList.remove(this); } if (this.input) { - sys.input.clear(this); + this.scene.sys.input.clear(this); + this.input = undefined; } @@ -3657,20 +3650,23 @@ var GameObject = new Class({ if (this.body) { this.body.destroy(); + this.body = undefined; } + this.resetPostPipeline(true); + // Tell the Scene to re-sort the children if (!fromScene) { - sys.queueDepthSort(); + this.displayList.queueDepthSort(); } this.active = false; this.visible = false; this.scene = undefined; - + this.displayList = undefined; this.parentContainer = undefined; this.removeAllListeners(); @@ -3681,7 +3677,7 @@ var GameObject = new Class({ /** * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. * - * @constant {integer} RENDER_MASK + * @constant {number} RENDER_MASK * @memberof Phaser.GameObjects.GameObject * @default */ @@ -3700,7 +3696,7 @@ module.exports = GameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(180); +var MATH = __webpack_require__(185); var GetValue = __webpack_require__(6); /** @@ -3779,6 +3775,36 @@ module.exports = GetAdvancedValue; /***/ }), /* 16 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * + * @function Phaser.Math.Clamp + * @since 3.0.0 + * + * @param {number} value - The value to be clamped. + * @param {number} min - The minimum bounds. + * @param {number} max - The maximum bounds. + * + * @return {number} The clamped value. + */ +var Clamp = function (value, min, max) +{ + return Math.max(min, Math.min(max, value)); +}; + +module.exports = Clamp; + + +/***/ }), +/* 17 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3788,7 +3814,7 @@ module.exports = GetAdvancedValue; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -3957,190 +3983,8 @@ PluginCache.register('GameObjectCreator', GameObjectCreator, 'make'); module.exports = GameObjectCreator; -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; - -module.exports = Clamp; - - /***/ }), /* 18 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FILE_CONST = { - - /** - * The Loader is idle. - * - * @name Phaser.Loader.LOADER_IDLE - * @type {integer} - * @since 3.0.0 - */ - LOADER_IDLE: 0, - - /** - * The Loader is actively loading. - * - * @name Phaser.Loader.LOADER_LOADING - * @type {integer} - * @since 3.0.0 - */ - LOADER_LOADING: 1, - - /** - * The Loader is processing files is has loaded. - * - * @name Phaser.Loader.LOADER_PROCESSING - * @type {integer} - * @since 3.0.0 - */ - LOADER_PROCESSING: 2, - - /** - * The Loader has completed loading and processing. - * - * @name Phaser.Loader.LOADER_COMPLETE - * @type {integer} - * @since 3.0.0 - */ - LOADER_COMPLETE: 3, - - /** - * The Loader is shutting down. - * - * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {integer} - * @since 3.0.0 - */ - LOADER_SHUTDOWN: 4, - - /** - * The Loader has been destroyed. - * - * @name Phaser.Loader.LOADER_DESTROYED - * @type {integer} - * @since 3.0.0 - */ - LOADER_DESTROYED: 5, - - /** - * File is in the load queue but not yet started - * - * @name Phaser.Loader.FILE_PENDING - * @type {integer} - * @since 3.0.0 - */ - FILE_PENDING: 10, - - /** - * File has been started to load by the loader (onLoad called) - * - * @name Phaser.Loader.FILE_LOADING - * @type {integer} - * @since 3.0.0 - */ - FILE_LOADING: 11, - - /** - * File has loaded successfully, awaiting processing - * - * @name Phaser.Loader.FILE_LOADED - * @type {integer} - * @since 3.0.0 - */ - FILE_LOADED: 12, - - /** - * File failed to load - * - * @name Phaser.Loader.FILE_FAILED - * @type {integer} - * @since 3.0.0 - */ - FILE_FAILED: 13, - - /** - * File is being processed (onProcess callback) - * - * @name Phaser.Loader.FILE_PROCESSING - * @type {integer} - * @since 3.0.0 - */ - FILE_PROCESSING: 14, - - /** - * The File has errored somehow during processing. - * - * @name Phaser.Loader.FILE_ERRORED - * @type {integer} - * @since 3.0.0 - */ - FILE_ERRORED: 16, - - /** - * File has finished processing. - * - * @name Phaser.Loader.FILE_COMPLETE - * @type {integer} - * @since 3.0.0 - */ - FILE_COMPLETE: 17, - - /** - * File has been destroyed - * - * @name Phaser.Loader.FILE_DESTROYED - * @type {integer} - * @since 3.0.0 - */ - FILE_DESTROYED: 18, - - /** - * File was populated from local data and doesn't need an HTTP request - * - * @name Phaser.Loader.FILE_POPULATED - * @type {integer} - * @since 3.0.0 - */ - FILE_POPULATED: 19 - -}; - -module.exports = FILE_CONST; - - -/***/ }), -/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4240,6 +4084,158 @@ var Extend = function () module.exports = Extend; +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FILE_CONST = { + + /** + * The Loader is idle. + * + * @name Phaser.Loader.LOADER_IDLE + * @type {number} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {number} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {number} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {number} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {number} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {number} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {number} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {number} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {number} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {number} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {number} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {number} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {number} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {number} + * @since 3.0.0 + */ + FILE_DESTROYED: 18, + + /** + * File was populated from local data and doesn't need an HTTP request + * + * @name Phaser.Loader.FILE_POPULATED + * @type {number} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { @@ -4256,27 +4252,27 @@ module.exports = Extend; module.exports = { - ADDED_TO_SCENE: __webpack_require__(733), - BOOT: __webpack_require__(734), - CREATE: __webpack_require__(735), - DESTROY: __webpack_require__(736), - PAUSE: __webpack_require__(737), - POST_UPDATE: __webpack_require__(738), - PRE_UPDATE: __webpack_require__(739), - READY: __webpack_require__(740), - REMOVED_FROM_SCENE: __webpack_require__(741), - RENDER: __webpack_require__(742), - RESUME: __webpack_require__(743), - SHUTDOWN: __webpack_require__(744), - SLEEP: __webpack_require__(745), - START: __webpack_require__(746), - TRANSITION_COMPLETE: __webpack_require__(747), - TRANSITION_INIT: __webpack_require__(748), - TRANSITION_OUT: __webpack_require__(749), - TRANSITION_START: __webpack_require__(750), - TRANSITION_WAKE: __webpack_require__(751), - UPDATE: __webpack_require__(752), - WAKE: __webpack_require__(753) + ADDED_TO_SCENE: __webpack_require__(774), + BOOT: __webpack_require__(775), + CREATE: __webpack_require__(776), + DESTROY: __webpack_require__(777), + PAUSE: __webpack_require__(778), + POST_UPDATE: __webpack_require__(779), + PRE_UPDATE: __webpack_require__(780), + READY: __webpack_require__(781), + REMOVED_FROM_SCENE: __webpack_require__(782), + RENDER: __webpack_require__(783), + RESUME: __webpack_require__(784), + SHUTDOWN: __webpack_require__(785), + SLEEP: __webpack_require__(786), + START: __webpack_require__(787), + TRANSITION_COMPLETE: __webpack_require__(788), + TRANSITION_INIT: __webpack_require__(789), + TRANSITION_OUT: __webpack_require__(790), + TRANSITION_START: __webpack_require__(791), + TRANSITION_WAKE: __webpack_require__(792), + UPDATE: __webpack_require__(793), + WAKE: __webpack_require__(794) }; @@ -4291,31 +4287,66 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + +var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; + /** - * @namespace Phaser.Core.Events + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * + * @function Phaser.GameObjects.GetCalcMatrix + * @memberof Phaser.GameObjects + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. + * + * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. */ +var GetCalcMatrix = function (src, camera, parentMatrix) +{ + var camMatrix = tempMatrix1; + var spriteMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; -module.exports = { + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - BLUR: __webpack_require__(567), - BOOT: __webpack_require__(568), - CONTEXT_LOST: __webpack_require__(569), - CONTEXT_RESTORED: __webpack_require__(570), - DESTROY: __webpack_require__(571), - FOCUS: __webpack_require__(572), - HIDDEN: __webpack_require__(573), - PAUSE: __webpack_require__(574), - POST_RENDER: __webpack_require__(575), - POST_STEP: __webpack_require__(576), - PRE_RENDER: __webpack_require__(577), - PRE_STEP: __webpack_require__(578), - READY: __webpack_require__(579), - RESUME: __webpack_require__(580), - STEP: __webpack_require__(581), - VISIBLE: __webpack_require__(582) + camMatrix.copyFrom(camera.matrix); + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + return result; }; +module.exports = GetCalcMatrix; + /***/ }), /* 22 */ @@ -4328,13 +4359,13 @@ module.exports = { */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var Events = __webpack_require__(84); +var CONST = __webpack_require__(19); +var Events = __webpack_require__(89); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(146); -var MergeXHRSettings = __webpack_require__(226); -var XHRLoader = __webpack_require__(477); -var XHRSettings = __webpack_require__(147); +var GetURL = __webpack_require__(148); +var MergeXHRSettings = __webpack_require__(232); +var XHRLoader = __webpack_require__(494); +var XHRSettings = __webpack_require__(149); /** * @classdesc @@ -4400,7 +4431,18 @@ var File = new Class({ if (!this.type || !this.key) { - throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + throw new Error('Invalid Loader.' + this.type + ' key'); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; } /** @@ -4414,16 +4456,7 @@ var File = new Class({ * @type {object|string} * @since 3.0.0 */ - this.url = GetFastValue(fileConfig, 'url'); - - if (this.url === undefined) - { - this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof this.url === 'string' && this.url.indexOf('blob:') !== 0 && this.url.indexOf('data:') !== 0) - { - this.url = loader.path + this.url; - } + this.url = url; /** * The final URL this file will load from, including baseURL and path. @@ -4462,7 +4495,7 @@ var File = new Class({ * The current state of the file. One of the FILE_CONST values. * * @name Phaser.Loader.File#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; @@ -4867,857 +4900,6 @@ module.exports = File; /***/ }), /* 23 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Contains the plugins that Phaser uses globally and locally. -// These are the source objects, not instantiated. -var corePlugins = {}; - -// Contains the plugins that the dev has loaded into their game -// These are the source objects, not instantiated. -var customPlugins = {}; - -var PluginCache = {}; - -/** - * @namespace Phaser.Plugins.PluginCache - */ - -/** - * Static method called directly by the Core internal Plugins. - * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) - * Plugin is the object to instantiate to create the plugin - * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) - * - * @method Phaser.Plugins.PluginCache.register - * @since 3.8.0 - * - * @param {string} key - A reference used to get this plugin from the plugin cache. - * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. - * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. - * @param {boolean} [custom=false] - Core Scene plugin or a Custom Scene plugin? - */ -PluginCache.register = function (key, plugin, mapping, custom) -{ - if (custom === undefined) { custom = false; } - - corePlugins[key] = { plugin: plugin, mapping: mapping, custom: custom }; -}; - -/** - * Stores a custom plugin in the global plugin cache. - * The key must be unique, within the scope of the cache. - * - * @method Phaser.Plugins.PluginCache.registerCustom - * @since 3.8.0 - * - * @param {string} key - A reference used to get this plugin from the plugin cache. - * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. - * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. - * @param {?any} data - A value to be passed to the plugin's `init` method. - */ -PluginCache.registerCustom = function (key, plugin, mapping, data) -{ - customPlugins[key] = { plugin: plugin, mapping: mapping, data: data }; -}; - -/** - * Checks if the given key is already being used in the core plugin cache. - * - * @method Phaser.Plugins.PluginCache.hasCore - * @since 3.8.0 - * - * @param {string} key - The key to check for. - * - * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. - */ -PluginCache.hasCore = function (key) -{ - return corePlugins.hasOwnProperty(key); -}; - -/** - * Checks if the given key is already being used in the custom plugin cache. - * - * @method Phaser.Plugins.PluginCache.hasCustom - * @since 3.8.0 - * - * @param {string} key - The key to check for. - * - * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. - */ -PluginCache.hasCustom = function (key) -{ - return customPlugins.hasOwnProperty(key); -}; - -/** - * Returns the core plugin object from the cache based on the given key. - * - * @method Phaser.Plugins.PluginCache.getCore - * @since 3.8.0 - * - * @param {string} key - The key of the core plugin to get. - * - * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. - */ -PluginCache.getCore = function (key) -{ - return corePlugins[key]; -}; - -/** - * Returns the custom plugin object from the cache based on the given key. - * - * @method Phaser.Plugins.PluginCache.getCustom - * @since 3.8.0 - * - * @param {string} key - The key of the custom plugin to get. - * - * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. - */ -PluginCache.getCustom = function (key) -{ - return customPlugins[key]; -}; - -/** - * Returns an object from the custom cache based on the given key that can be instantiated. - * - * @method Phaser.Plugins.PluginCache.getCustomClass - * @since 3.8.0 - * - * @param {string} key - The key of the custom plugin to get. - * - * @return {function} The custom plugin object. - */ -PluginCache.getCustomClass = function (key) -{ - return (customPlugins.hasOwnProperty(key)) ? customPlugins[key].plugin : null; -}; - -/** - * Removes a core plugin based on the given key. - * - * @method Phaser.Plugins.PluginCache.remove - * @since 3.8.0 - * - * @param {string} key - The key of the core plugin to remove. - */ -PluginCache.remove = function (key) -{ - if (corePlugins.hasOwnProperty(key)) - { - delete corePlugins[key]; - } -}; - -/** - * Removes a custom plugin based on the given key. - * - * @method Phaser.Plugins.PluginCache.removeCustom - * @since 3.8.0 - * - * @param {string} key - The key of the custom plugin to remove. - */ -PluginCache.removeCustom = function (key) -{ - if (customPlugins.hasOwnProperty(key)) - { - delete customPlugins[key]; - } -}; - -/** - * Removes all Core Plugins. - * - * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. - * So be sure you only call this if you do not wish to run Phaser again. - * - * @method Phaser.Plugins.PluginCache.destroyCorePlugins - * @since 3.12.0 - */ -PluginCache.destroyCorePlugins = function () -{ - for (var key in corePlugins) - { - if (corePlugins.hasOwnProperty(key)) - { - delete corePlugins[key]; - } - } -}; - -/** - * Removes all Custom Plugins. - * - * @method Phaser.Plugins.PluginCache.destroyCustomPlugins - * @since 3.12.0 - */ -PluginCache.destroyCustomPlugins = function () -{ - for (var key in customPlugins) - { - if (customPlugins.hasOwnProperty(key)) - { - delete customPlugins[key]; - } - } -}; - -module.exports = PluginCache; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetFastValue = __webpack_require__(2); - -/** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * - * @function Phaser.Tilemaps.Components.GetTilesWithin - * @since 3.0.0 - * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.GetTilesWithinFilteringOptions} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. - */ -var GetTilesWithin = function (tileX, tileY, width, height, filteringOptions, layer) -{ - if (tileX === undefined) { tileX = 0; } - if (tileY === undefined) { tileY = 0; } - if (width === undefined) { width = layer.width; } - if (height === undefined) { height = layer.height; } - - var isNotEmpty = GetFastValue(filteringOptions, 'isNotEmpty', false); - var isColliding = GetFastValue(filteringOptions, 'isColliding', false); - var hasInterestingFace = GetFastValue(filteringOptions, 'hasInterestingFace', false); - - // Clip x, y to top left of map, while shrinking width/height to match. - if (tileX < 0) - { - width += tileX; - tileX = 0; - } - - if (tileY < 0) - { - height += tileY; - tileY = 0; - } - - // Clip width and height to bottom right of map. - if (tileX + width > layer.width) - { - width = Math.max(layer.width - tileX, 0); - } - - if (tileY + height > layer.height) - { - height = Math.max(layer.height - tileY, 0); - } - - var results = []; - - for (var ty = tileY; ty < tileY + height; ty++) - { - for (var tx = tileX; tx < tileX + width; tx++) - { - var tile = layer.data[ty][tx]; - - if (tile !== null) - { - if (isNotEmpty && tile.index === -1) - { - continue; - } - - if (isColliding && !tile.collides) - { - continue; - } - - if (hasInterestingFace && !tile.hasInterestingFace) - { - continue; - } - - results.push(tile); - } - } - } - - return results; -}; - -module.exports = GetTilesWithin; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, - * and then sets it to the given value. - * - * The optional `step` property is applied incrementally, multiplied by each item in the array. - * - * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` - * - * @function Phaser.Actions.PropertyValueSet - * @since 3.3.0 - * - * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] - * - * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. - * @param {string} key - The property to be updated. - * @param {number} value - The amount to set the property to. - * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. - * - * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. - */ -var PropertyValueSet = function (items, key, value, step, index, direction) -{ - if (step === undefined) { step = 0; } - if (index === undefined) { index = 0; } - if (direction === undefined) { direction = 1; } - - var i; - var t = 0; - var end = items.length; - - if (direction === 1) - { - // Start to End - for (i = index; i < end; i++) - { - items[i][key] = value + (t * step); - t++; - } - } - else - { - // End to Start - for (i = index; i >= 0; i--) - { - items[i][key] = value + (t * step); - t++; - } - } - - return items; -}; - -module.exports = PropertyValueSet; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(34); -var Smoothing = __webpack_require__(177); - -// The pool into which the canvas elements are placed. -var pool = []; - -// Automatically apply smoothing(false) to created Canvas elements -var _disableContextSmoothing = false; - -/** - * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, - * which is useless for some of the Phaser pipelines / renderer. - * - * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. - * Which means all instances of Phaser Games on the same page can share the one single pool. - * - * @namespace Phaser.Display.Canvas.CanvasPool - * @since 3.0.0 - */ -var CanvasPool = function () -{ - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. - * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? - * - * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool - */ - var create = function (parent, width, height, canvasType, selfParent) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = 1; } - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - if (selfParent === undefined) { selfParent = false; } - - var canvas; - var container = first(canvasType); - - if (container === null) - { - container = { - parent: parent, - canvas: document.createElement('canvas'), - type: canvasType - }; - - if (canvasType === CONST.CANVAS) - { - pool.push(container); - } - - canvas = container.canvas; - } - else - { - container.parent = parent; - - canvas = container.canvas; - } - - if (selfParent) - { - container.parent = canvas; - } - - canvas.width = width; - canvas.height = height; - - if (_disableContextSmoothing && canvasType === CONST.CANVAS) - { - Smoothing.disable(canvas.getContext('2d')); - } - - return canvas; - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create2D - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created canvas. - */ - var create2D = function (parent, width, height) - { - return create(parent, width, height, CONST.CANVAS); - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.createWebGL - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created WebGL canvas. - */ - var createWebGL = function (parent, width, height) - { - return create(parent, width, height, CONST.WEBGL); - }; - - /** - * Gets the first free canvas index from the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.first - * @since 3.0.0 - * - * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * - * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. - */ - var first = function (canvasType) - { - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - - if (canvasType === CONST.WEBGL) - { - return null; - } - - for (var i = 0; i < pool.length; i++) - { - var container = pool[i]; - - if (!container.parent && container.type === canvasType) - { - return container; - } - } - - return null; - }; - - /** - * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. - * The canvas has its width and height set to 1, and its parent attribute nulled. - * - * @function Phaser.Display.Canvas.CanvasPool.remove - * @since 3.0.0 - * - * @param {*} parent - The canvas or the parent of the canvas to free. - */ - var remove = function (parent) - { - // Check to see if the parent is a canvas object - var isCanvas = parent instanceof HTMLCanvasElement; - - pool.forEach(function (container) - { - if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) - { - container.parent = null; - container.canvas.width = 1; - container.canvas.height = 1; - } - }); - }; - - /** - * Gets the total number of used canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.total - * @since 3.0.0 - * - * @return {integer} The number of used canvases. - */ - var total = function () - { - var c = 0; - - pool.forEach(function (container) - { - if (container.parent) - { - c++; - } - }); - - return c; - }; - - /** - * Gets the total number of free canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.free - * @since 3.0.0 - * - * @return {integer} The number of free canvases. - */ - var free = function () - { - return pool.length - total(); - }; - - /** - * Disable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing - * @since 3.0.0 - */ - var disableSmoothing = function () - { - _disableContextSmoothing = true; - }; - - /** - * Enable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing - * @since 3.0.0 - */ - var enableSmoothing = function () - { - _disableContextSmoothing = false; - }; - - return { - create2D: create2D, - create: create, - createWebGL: createWebGL, - disableSmoothing: disableSmoothing, - enableSmoothing: enableSmoothing, - first: first, - free: free, - pool: pool, - remove: remove, - total: total - }; -}; - -// If we export the called function here, it'll only be invoked once (not every time it's required). -module.exports = CanvasPool(); - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(54); -var GetAdvancedValue = __webpack_require__(15); - -/** - * Builds a Game Object using the provided configuration object. - * - * @function Phaser.GameObjects.BuildGameObject - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene. - * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. - * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. - * - * @return {Phaser.GameObjects.GameObject} The built Game Object. - */ -var BuildGameObject = function (scene, gameObject, config) -{ - // Position - - gameObject.x = GetAdvancedValue(config, 'x', 0); - gameObject.y = GetAdvancedValue(config, 'y', 0); - gameObject.depth = GetAdvancedValue(config, 'depth', 0); - - // Flip - - gameObject.flipX = GetAdvancedValue(config, 'flipX', false); - gameObject.flipY = GetAdvancedValue(config, 'flipY', false); - - // Scale - // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} - - var scale = GetAdvancedValue(config, 'scale', null); - - if (typeof scale === 'number') - { - gameObject.setScale(scale); - } - else if (scale !== null) - { - gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); - gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); - } - - // ScrollFactor - // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} - - var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); - - if (typeof scrollFactor === 'number') - { - gameObject.setScrollFactor(scrollFactor); - } - else if (scrollFactor !== null) - { - gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); - gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); - } - - // Rotation - - gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); - - var angle = GetAdvancedValue(config, 'angle', null); - - if (angle !== null) - { - gameObject.angle = angle; - } - - // Alpha - - gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); - - // Origin - // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} - - var origin = GetAdvancedValue(config, 'origin', null); - - if (typeof origin === 'number') - { - gameObject.setOrigin(origin); - } - else if (origin !== null) - { - var ox = GetAdvancedValue(origin, 'x', 0.5); - var oy = GetAdvancedValue(origin, 'y', 0.5); - - gameObject.setOrigin(ox, oy); - } - - // BlendMode - - gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); - - // Visible - - gameObject.visible = GetAdvancedValue(config, 'visible', true); - - // Add to Scene - - var add = GetAdvancedValue(config, 'add', true); - - if (add) - { - scene.sys.displayList.add(gameObject); - } - - if (gameObject.preUpdate) - { - scene.sys.updateList.add(gameObject); - } - - return gameObject; -}; - -module.exports = BuildGameObject; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix - * and then performs the following steps: - * - * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. - * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. - * 3. Sets the blend mode of the context to be that used by the Game Object. - * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. - * 5. Saves the context state. - * 6. Sets the final matrix values into the context via setTransform. - * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. - * - * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. - * - * @function Phaser.Renderer.Canvas.SetTransform - * @since 3.12.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on. - * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering. - * - * @return {boolean} `true` if the Game Object context was set, otherwise `false`. - */ -var SetTransform = function (renderer, ctx, src, camera, parentMatrix) -{ - var alpha = camera.alpha * src.alpha; - - if (alpha <= 0) - { - // Nothing to see, so don't waste time calculating stuff - return false; - } - - var camMatrix = renderer._tempMatrix1.copyFromArray(camera.matrix.matrix); - var gameObjectMatrix = renderer._tempMatrix2.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - var calcMatrix = renderer._tempMatrix3; - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - gameObjectMatrix.e = src.x; - gameObjectMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } - else - { - gameObjectMatrix.e -= camera.scrollX * src.scrollFactorX; - gameObjectMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } - - // Blend Mode - ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; - - // Alpha - ctx.globalAlpha = alpha; - - ctx.save(); - - calcMatrix.setToContext(ctx); - - ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode)); - - return true; -}; - -module.exports = SetTransform; - - -/***/ }), -/* 29 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5727,330 +4909,33 @@ module.exports = SetTransform; */ /** - * @namespace Phaser.GameObjects.Events + * @namespace Phaser.Core.Events */ module.exports = { - ADDED_TO_SCENE: __webpack_require__(593), - DESTROY: __webpack_require__(594), - REMOVED_FROM_SCENE: __webpack_require__(595), - VIDEO_COMPLETE: __webpack_require__(596), - VIDEO_CREATED: __webpack_require__(597), - VIDEO_ERROR: __webpack_require__(598), - VIDEO_LOOP: __webpack_require__(599), - VIDEO_PLAY: __webpack_require__(600), - VIDEO_SEEKED: __webpack_require__(601), - VIDEO_SEEKING: __webpack_require__(602), - VIDEO_STOP: __webpack_require__(603), - VIDEO_TIMEOUT: __webpack_require__(604), - VIDEO_UNLOCKED: __webpack_require__(605) + BLUR: __webpack_require__(606), + BOOT: __webpack_require__(607), + CONTEXT_LOST: __webpack_require__(608), + CONTEXT_RESTORED: __webpack_require__(609), + DESTROY: __webpack_require__(610), + FOCUS: __webpack_require__(611), + HIDDEN: __webpack_require__(612), + PAUSE: __webpack_require__(613), + POST_RENDER: __webpack_require__(614), + POST_STEP: __webpack_require__(615), + PRE_RENDER: __webpack_require__(616), + PRE_STEP: __webpack_require__(617), + READY: __webpack_require__(618), + RESUME: __webpack_require__(619), + STEP: __webpack_require__(620), + VISIBLE: __webpack_require__(621) }; /***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameObject = __webpack_require__(14); -var Line = __webpack_require__(40); - -/** - * @classdesc - * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. - * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. - * - * @class Shape - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @since 3.13.0 - * - * @extends Phaser.GameObjects.Components.AlphaSingle - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.ComputedSize - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {string} [type] - The internal type of the Shape. - * @param {any} [data] - The data of the source shape geometry, if any. - */ -var Shape = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.AlphaSingle, - Components.BlendMode, - Components.ComputedSize, - Components.Depth, - Components.GetBounds, - Components.Mask, - Components.Origin, - Components.Pipeline, - Components.ScrollFactor, - Components.Transform, - Components.Visible - ], - - initialize: - - function Shape (scene, type, data) - { - if (type === undefined) { type = 'Shape'; } - - GameObject.call(this, scene, type); - - /** - * The source Shape data. Typically a geometry object. - * You should not manipulate this directly. - * - * @name Phaser.GameObjects.Shape#geom - * @type {any} - * @readonly - * @since 3.13.0 - */ - this.geom = data; - - /** - * Holds the polygon path data for filled rendering. - * - * @name Phaser.GameObjects.Shape#pathData - * @type {number[]} - * @readonly - * @since 3.13.0 - */ - this.pathData = []; - - /** - * Holds the earcut polygon path index data for filled rendering. - * - * @name Phaser.GameObjects.Shape#pathIndexes - * @type {integer[]} - * @readonly - * @since 3.13.0 - */ - this.pathIndexes = []; - - /** - * The fill color used by this Shape. - * - * @name Phaser.GameObjects.Shape#fillColor - * @type {number} - * @since 3.13.0 - */ - this.fillColor = 0xffffff; - - /** - * The fill alpha value used by this Shape. - * - * @name Phaser.GameObjects.Shape#fillAlpha - * @type {number} - * @since 3.13.0 - */ - this.fillAlpha = 1; - - /** - * The stroke color used by this Shape. - * - * @name Phaser.GameObjects.Shape#strokeColor - * @type {number} - * @since 3.13.0 - */ - this.strokeColor = 0xffffff; - - /** - * The stroke alpha value used by this Shape. - * - * @name Phaser.GameObjects.Shape#strokeAlpha - * @type {number} - * @since 3.13.0 - */ - this.strokeAlpha = 1; - - /** - * The stroke line width used by this Shape. - * - * @name Phaser.GameObjects.Shape#lineWidth - * @type {number} - * @since 3.13.0 - */ - this.lineWidth = 1; - - /** - * Controls if this Shape is filled or not. - * Note that some Shapes do not support being filled (such as Line shapes) - * - * @name Phaser.GameObjects.Shape#isFilled - * @type {boolean} - * @since 3.13.0 - */ - this.isFilled = false; - - /** - * Controls if this Shape is stroked or not. - * Note that some Shapes do not support being stroked (such as Iso Box shapes) - * - * @name Phaser.GameObjects.Shape#isStroked - * @type {boolean} - * @since 3.13.0 - */ - this.isStroked = false; - - /** - * Controls if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * @name Phaser.GameObjects.Shape#closePath - * @type {boolean} - * @since 3.13.0 - */ - this.closePath = true; - - /** - * Private internal value. - * A Line used when parsing internal path data to avoid constant object re-creation. - * - * @name Phaser.GameObjects.Curve#_tempLine - * @type {Phaser.Geom.Line} - * @private - * @since 3.13.0 - */ - this._tempLine = new Line(); - - this.initPipeline(); - }, - - /** - * Sets the fill color and alpha for this Shape. - * - * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. - * - * Note that some Shapes do not support fill colors, such as the Line shape. - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setFillStyle - * @since 3.13.0 - * - * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled. - * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given. - * - * @return {this} This Game Object instance. - */ - setFillStyle: function (color, alpha) - { - if (alpha === undefined) { alpha = 1; } - - if (color === undefined) - { - this.isFilled = false; - } - else - { - this.fillColor = color; - this.fillAlpha = alpha; - this.isFilled = true; - } - - return this; - }, - - /** - * Sets the stroke color and alpha for this Shape. - * - * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. - * - * Note that some Shapes do not support being stroked, such as the Iso Box shape. - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setStrokeStyle - * @since 3.13.0 - * - * @param {number} [lineWidth] - The width of line to stroke with. If not provided or undefined the Shape will not be stroked. - * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked. - * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given. - * - * @return {this} This Game Object instance. - */ - setStrokeStyle: function (lineWidth, color, alpha) - { - if (alpha === undefined) { alpha = 1; } - - if (lineWidth === undefined) - { - this.isStroked = false; - } - else - { - this.lineWidth = lineWidth; - this.strokeColor = color; - this.strokeAlpha = alpha; - this.isStroked = true; - } - - return this; - }, - - /** - * Sets if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setClosePath - * @since 3.13.0 - * - * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`. - * - * @return {this} This Game Object instance. - */ - setClosePath: function (value) - { - this.closePath = value; - - return this; - }, - - /** - * Internal destroy handler, called as part of the destroy process. - * - * @method Phaser.GameObjects.Shape#preDestroy - * @protected - * @since 3.13.0 - */ - preDestroy: function () - { - this.geom = null; - this._tempLine = null; - this.pathData = []; - this.pathIndexes = []; - } - -}); - -module.exports = Shape; - - -/***/ }), -/* 31 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7069,10 +5954,947 @@ var TransformMatrix = new Class({ module.exports = TransformMatrix; +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Contains the plugins that Phaser uses globally and locally. +// These are the source objects, not instantiated. +var corePlugins = {}; + +// Contains the plugins that the dev has loaded into their game +// These are the source objects, not instantiated. +var customPlugins = {}; + +var PluginCache = {}; + +/** + * @namespace Phaser.Plugins.PluginCache + */ + +/** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + * + * @method Phaser.Plugins.PluginCache.register + * @since 3.8.0 + * + * @param {string} key - A reference used to get this plugin from the plugin cache. + * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. + * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param {boolean} [custom=false] - Core Scene plugin or a Custom Scene plugin? + */ +PluginCache.register = function (key, plugin, mapping, custom) +{ + if (custom === undefined) { custom = false; } + + corePlugins[key] = { plugin: plugin, mapping: mapping, custom: custom }; +}; + +/** + * Stores a custom plugin in the global plugin cache. + * The key must be unique, within the scope of the cache. + * + * @method Phaser.Plugins.PluginCache.registerCustom + * @since 3.8.0 + * + * @param {string} key - A reference used to get this plugin from the plugin cache. + * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. + * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param {?any} data - A value to be passed to the plugin's `init` method. + */ +PluginCache.registerCustom = function (key, plugin, mapping, data) +{ + customPlugins[key] = { plugin: plugin, mapping: mapping, data: data }; +}; + +/** + * Checks if the given key is already being used in the core plugin cache. + * + * @method Phaser.Plugins.PluginCache.hasCore + * @since 3.8.0 + * + * @param {string} key - The key to check for. + * + * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. + */ +PluginCache.hasCore = function (key) +{ + return corePlugins.hasOwnProperty(key); +}; + +/** + * Checks if the given key is already being used in the custom plugin cache. + * + * @method Phaser.Plugins.PluginCache.hasCustom + * @since 3.8.0 + * + * @param {string} key - The key to check for. + * + * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. + */ +PluginCache.hasCustom = function (key) +{ + return customPlugins.hasOwnProperty(key); +}; + +/** + * Returns the core plugin object from the cache based on the given key. + * + * @method Phaser.Plugins.PluginCache.getCore + * @since 3.8.0 + * + * @param {string} key - The key of the core plugin to get. + * + * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. + */ +PluginCache.getCore = function (key) +{ + return corePlugins[key]; +}; + +/** + * Returns the custom plugin object from the cache based on the given key. + * + * @method Phaser.Plugins.PluginCache.getCustom + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to get. + * + * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. + */ +PluginCache.getCustom = function (key) +{ + return customPlugins[key]; +}; + +/** + * Returns an object from the custom cache based on the given key that can be instantiated. + * + * @method Phaser.Plugins.PluginCache.getCustomClass + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to get. + * + * @return {function} The custom plugin object. + */ +PluginCache.getCustomClass = function (key) +{ + return (customPlugins.hasOwnProperty(key)) ? customPlugins[key].plugin : null; +}; + +/** + * Removes a core plugin based on the given key. + * + * @method Phaser.Plugins.PluginCache.remove + * @since 3.8.0 + * + * @param {string} key - The key of the core plugin to remove. + */ +PluginCache.remove = function (key) +{ + if (corePlugins.hasOwnProperty(key)) + { + delete corePlugins[key]; + } +}; + +/** + * Removes a custom plugin based on the given key. + * + * @method Phaser.Plugins.PluginCache.removeCustom + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to remove. + */ +PluginCache.removeCustom = function (key) +{ + if (customPlugins.hasOwnProperty(key)) + { + delete customPlugins[key]; + } +}; + +/** + * Removes all Core Plugins. + * + * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. + * So be sure you only call this if you do not wish to run Phaser again. + * + * @method Phaser.Plugins.PluginCache.destroyCorePlugins + * @since 3.12.0 + */ +PluginCache.destroyCorePlugins = function () +{ + for (var key in corePlugins) + { + if (corePlugins.hasOwnProperty(key)) + { + delete corePlugins[key]; + } + } +}; + +/** + * Removes all Custom Plugins. + * + * @method Phaser.Plugins.PluginCache.destroyCustomPlugins + * @since 3.12.0 + */ +PluginCache.destroyCustomPlugins = function () +{ + for (var key in customPlugins) + { + if (customPlugins.hasOwnProperty(key)) + { + delete customPlugins[key]; + } + } +}; + +module.exports = PluginCache; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); + +/** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * + * @function Phaser.Tilemaps.Components.GetTilesWithin + * @since 3.0.0 + * + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + */ +var GetTilesWithin = function (tileX, tileY, width, height, filteringOptions, layer) +{ + if (tileX === undefined) { tileX = 0; } + if (tileY === undefined) { tileY = 0; } + if (width === undefined) { width = layer.width; } + if (height === undefined) { height = layer.height; } + if (!filteringOptions) { filteringOptions = {}; } + + var isNotEmpty = GetFastValue(filteringOptions, 'isNotEmpty', false); + var isColliding = GetFastValue(filteringOptions, 'isColliding', false); + var hasInterestingFace = GetFastValue(filteringOptions, 'hasInterestingFace', false); + + // Clip x, y to top left of map, while shrinking width/height to match. + if (tileX < 0) + { + width += tileX; + tileX = 0; + } + + if (tileY < 0) + { + height += tileY; + tileY = 0; + } + + // Clip width and height to bottom right of map. + if (tileX + width > layer.width) + { + width = Math.max(layer.width - tileX, 0); + } + + if (tileY + height > layer.height) + { + height = Math.max(layer.height - tileY, 0); + } + + var results = []; + + for (var ty = tileY; ty < tileY + height; ty++) + { + for (var tx = tileX; tx < tileX + width; tx++) + { + var tile = layer.data[ty][tx]; + + if (tile !== null) + { + if (isNotEmpty && tile.index === -1) + { + continue; + } + + if (isColliding && !tile.collides) + { + continue; + } + + if (hasInterestingFace && !tile.hasInterestingFace) + { + continue; + } + + results.push(tile); + } + } + } + + return results; +}; + +module.exports = GetTilesWithin; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` + * + * @function Phaser.Actions.PropertyValueSet + * @since 3.3.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {string} key - The property to be updated. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var PropertyValueSet = function (items, key, value, step, index, direction) +{ + if (step === undefined) { step = 0; } + if (index === undefined) { index = 0; } + if (direction === undefined) { direction = 1; } + + var i; + var t = 0; + var end = items.length; + + if (direction === 1) + { + // Start to End + for (i = index; i < end; i++) + { + items[i][key] = value + (t * step); + t++; + } + } + else + { + // End to Start + for (i = index; i >= 0; i--) + { + items[i][key] = value + (t * step); + t++; + } + } + + return items; +}; + +module.exports = PropertyValueSet; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(48); +var GetAdvancedValue = __webpack_require__(15); + +/** + * Builds a Game Object using the provided configuration object. + * + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene. + * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. + * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. + * + * @return {Phaser.GameObjects.GameObject} The built Game Object. + */ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position + + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); + + // Flip + + gameObject.flipX = GetAdvancedValue(config, 'flipX', false); + gameObject.flipY = GetAdvancedValue(config, 'flipY', false); + + // Scale + // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} + + var scale = GetAdvancedValue(config, 'scale', null); + + if (typeof scale === 'number') + { + gameObject.setScale(scale); + } + else if (scale !== null) + { + gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); + gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); + } + + // ScrollFactor + // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} + + var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); + + if (typeof scrollFactor === 'number') + { + gameObject.setScrollFactor(scrollFactor); + } + else if (scrollFactor !== null) + { + gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); + gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); + } + + // Rotation + + gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); + + var angle = GetAdvancedValue(config, 'angle', null); + + if (angle !== null) + { + gameObject.angle = angle; + } + + // Alpha + + gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); + + // Origin + // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} + + var origin = GetAdvancedValue(config, 'origin', null); + + if (typeof origin === 'number') + { + gameObject.setOrigin(origin); + } + else if (origin !== null) + { + var ox = GetAdvancedValue(origin, 'x', 0.5); + var oy = GetAdvancedValue(origin, 'y', 0.5); + + gameObject.setOrigin(ox, oy); + } + + // BlendMode + + gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); + + // Visible + + gameObject.visible = GetAdvancedValue(config, 'visible', true); + + // Add to Scene + + var add = GetAdvancedValue(config, 'add', true); + + if (add) + { + scene.sys.displayList.add(gameObject); + } + + if (gameObject.preUpdate) + { + scene.sys.updateList.add(gameObject); + } + + return gameObject; +}; + +module.exports = BuildGameObject; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Tilemap constants for orientation. + * + * @namespace Phaser.Tilemaps.Orientation + * @memberof Phaser.Tilemaps + * @since 3.50.0 + */ + +/** + * Phaser Tilemap constants for orientation. + * + * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. + * + * @typedef {Phaser.Tilemaps.Orientation} Phaser.Tilemaps.OrientationType + * @memberof Phaser.Tilemaps + * @since 3.50.0 + */ + +module.exports = { + + /** + * Orthogonal Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.ORTHOGONAL + * @type {number} + * @const + * @since 3.50.0 + */ + ORTHOGONAL: 0, + + /** + * Isometric Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.ISOMETRIC + * @type {number} + * @const + * @since 3.50.0 + */ + ISOMETRIC: 1, + + /** + * Staggered Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.STAGGERED + * @type {number} + * @const + * @since 3.50.0 + */ + STAGGERED: 2, + + /** + * Hexagonal Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.HEXAGONAL + * @type {number} + * @const + * @since 3.50.0 + */ + HEXAGONAL: 3 + +}; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCalcMatrix = __webpack_require__(21); + +/** + * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix + * and then performs the following steps: + * + * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. + * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. + * 3. Sets the blend mode of the context to be that used by the Game Object. + * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. + * 5. Saves the context state. + * 6. Sets the final matrix values into the context via setTransform. + * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. + * + * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. + * + * @function Phaser.Renderer.Canvas.SetTransform + * @since 3.12.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on. + * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering. + * + * @return {boolean} `true` if the Game Object context was set, otherwise `false`. + */ +var SetTransform = function (renderer, ctx, src, camera, parentMatrix) +{ + var alpha = camera.alpha * src.alpha; + + if (alpha <= 0) + { + // Nothing to see, so don't waste time calculating stuff + return false; + } + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + // Blend Mode + ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; + + // Alpha + ctx.globalAlpha = alpha; + + ctx.save(); + + calcMatrix.setToContext(ctx); + + ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode)); + + return true; +}; + +module.exports = SetTransform; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(39); +var Smoothing = __webpack_require__(184); + +// The pool into which the canvas elements are placed. +var pool = []; + +// Automatically apply smoothing(false) to created Canvas elements +var _disableContextSmoothing = false; + +/** + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. + * + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. + * + * @namespace Phaser.Display.Canvas.CanvasPool + * @since 3.0.0 + */ +var CanvasPool = function () +{ + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? + * + * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool + */ + var create = function (parent, width, height, canvasType, selfParent) + { + if (width === undefined) { width = 1; } + if (height === undefined) { height = 1; } + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + if (selfParent === undefined) { selfParent = false; } + + var canvas; + var container = first(canvasType); + + if (container === null) + { + container = { + parent: parent, + canvas: document.createElement('canvas'), + type: canvasType + }; + + if (canvasType === CONST.CANVAS) + { + pool.push(container); + } + + canvas = container.canvas; + } + else + { + container.parent = parent; + + canvas = container.canvas; + } + + if (selfParent) + { + container.parent = canvas; + } + + canvas.width = width; + canvas.height = height; + + if (_disableContextSmoothing && canvasType === CONST.CANVAS) + { + Smoothing.disable(canvas.getContext('2d')); + } + + return canvas; + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create2D + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created canvas. + */ + var create2D = function (parent, width, height) + { + return create(parent, width, height, CONST.CANVAS); + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.createWebGL + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created WebGL canvas. + */ + var createWebGL = function (parent, width, height) + { + return create(parent, width, height, CONST.WEBGL); + }; + + /** + * Gets the first free canvas index from the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.first + * @since 3.0.0 + * + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * + * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. + */ + var first = function (canvasType) + { + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + + if (canvasType === CONST.WEBGL) + { + return null; + } + + for (var i = 0; i < pool.length; i++) + { + var container = pool[i]; + + if (!container.parent && container.type === canvasType) + { + return container; + } + } + + return null; + }; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * + * @function Phaser.Display.Canvas.CanvasPool.remove + * @since 3.0.0 + * + * @param {*} parent - The canvas or the parent of the canvas to free. + */ + var remove = function (parent) + { + // Check to see if the parent is a canvas object + var isCanvas = parent instanceof HTMLCanvasElement; + + pool.forEach(function (container) + { + if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) + { + container.parent = null; + container.canvas.width = 1; + container.canvas.height = 1; + } + }); + }; + + /** + * Gets the total number of used canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.total + * @since 3.0.0 + * + * @return {number} The number of used canvases. + */ + var total = function () + { + var c = 0; + + pool.forEach(function (container) + { + if (container.parent) + { + c++; + } + }); + + return c; + }; + + /** + * Gets the total number of free canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.free + * @since 3.0.0 + * + * @return {number} The number of free canvases. + */ + var free = function () + { + return pool.length - total(); + }; + + /** + * Disable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing + * @since 3.0.0 + */ + var disableSmoothing = function () + { + _disableContextSmoothing = true; + }; + + /** + * Enable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing + * @since 3.0.0 + */ + var enableSmoothing = function () + { + _disableContextSmoothing = false; + }; + + return { + create2D: create2D, + create: create, + createWebGL: createWebGL, + disableSmoothing: disableSmoothing, + enableSmoothing: enableSmoothing, + first: first, + free: free, + pool: pool, + remove: remove, + total: total + }; +}; + +// If we export the called function here, it'll only be invoked once (not every time it's required). +module.exports = CanvasPool(); + + /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(633), + DESTROY: __webpack_require__(634), + REMOVED_FROM_SCENE: __webpack_require__(635), + VIDEO_COMPLETE: __webpack_require__(636), + VIDEO_CREATED: __webpack_require__(637), + VIDEO_ERROR: __webpack_require__(638), + VIDEO_LOOP: __webpack_require__(639), + VIDEO_PLAY: __webpack_require__(640), + VIDEO_SEEKED: __webpack_require__(641), + VIDEO_SEEKING: __webpack_require__(642), + VIDEO_STOP: __webpack_require__(643), + VIDEO_TIMEOUT: __webpack_require__(644), + VIDEO_UNLOCKED: __webpack_require__(645) + +}; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -7080,10 +6902,481 @@ module.exports = TransformMatrix; */ var Class = __webpack_require__(0); -var GetColor = __webpack_require__(175); -var GetColor32 = __webpack_require__(308); -var HSVToRGB = __webpack_require__(176); -var RGBToHSV = __webpack_require__(309); +var Components = __webpack_require__(11); +var GameObject = __webpack_require__(14); +var Line = __webpack_require__(45); +var PIPELINES_CONST = __webpack_require__(82); + +/** + * @classdesc + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + * + * @class Shape + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {string} [type] - The internal type of the Shape. + * @param {any} [data] - The data of the source shape geometry, if any. + */ +var Shape = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Transform, + Components.Visible + ], + + initialize: + + function Shape (scene, type, data) + { + if (type === undefined) { type = 'Shape'; } + + GameObject.call(this, scene, type); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + * + * @name Phaser.GameObjects.Shape#geom + * @type {any} + * @readonly + * @since 3.13.0 + */ + this.geom = data; + + /** + * Holds the polygon path data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathData + * @type {number[]} + * @readonly + * @since 3.13.0 + */ + this.pathData = []; + + /** + * Holds the earcut polygon path index data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathIndexes + * @type {number[]} + * @readonly + * @since 3.13.0 + */ + this.pathIndexes = []; + + /** + * The fill color used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillColor + * @type {number} + * @since 3.13.0 + */ + this.fillColor = 0xffffff; + + /** + * The fill alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillAlpha + * @type {number} + * @since 3.13.0 + */ + this.fillAlpha = 1; + + /** + * The stroke color used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeColor + * @type {number} + * @since 3.13.0 + */ + this.strokeColor = 0xffffff; + + /** + * The stroke alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeAlpha + * @type {number} + * @since 3.13.0 + */ + this.strokeAlpha = 1; + + /** + * The stroke line width used by this Shape. + * + * @name Phaser.GameObjects.Shape#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + * + * @name Phaser.GameObjects.Shape#isFilled + * @type {boolean} + * @since 3.13.0 + */ + this.isFilled = false; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + * + * @name Phaser.GameObjects.Shape#isStroked + * @type {boolean} + * @since 3.13.0 + */ + this.isStroked = false; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * @name Phaser.GameObjects.Shape#closePath + * @type {boolean} + * @since 3.13.0 + */ + this.closePath = true; + + /** + * Private internal value. + * A Line used when parsing internal path data to avoid constant object re-creation. + * + * @name Phaser.GameObjects.Shape#_tempLine + * @type {Phaser.Geom.Line} + * @private + * @since 3.13.0 + */ + this._tempLine = new Line(); + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Shape#width + * @type {number} + * @since 3.13.0 + */ + this.width = 0; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Shape#height + * @type {number} + * @since 3.0.0 + */ + this.height = 0; + + this.initPipeline(PIPELINES_CONST.GRAPHICS_PIPELINE); + }, + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setFillStyle + * @since 3.13.0 + * + * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled. + * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given. + * + * @return {this} This Game Object instance. + */ + setFillStyle: function (color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (color === undefined) + { + this.isFilled = false; + } + else + { + this.fillColor = color; + this.fillAlpha = alpha; + this.isFilled = true; + } + + return this; + }, + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setStrokeStyle + * @since 3.13.0 + * + * @param {number} [lineWidth] - The width of line to stroke with. If not provided or undefined the Shape will not be stroked. + * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given. + * + * @return {this} This Game Object instance. + */ + setStrokeStyle: function (lineWidth, color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (lineWidth === undefined) + { + this.isStroked = false; + } + else + { + this.lineWidth = lineWidth; + this.strokeColor = color; + this.strokeAlpha = alpha; + this.isStroked = true; + } + + return this; + }, + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setClosePath + * @since 3.13.0 + * + * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`. + * + * @return {this} This Game Object instance. + */ + setClosePath: function (value) + { + this.closePath = value; + + return this; + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Shape#setSize + * @private + * @since 3.13.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Shape#preDestroy + * @protected + * @since 3.13.0 + */ + preDestroy: function () + { + this.geom = null; + this._tempLine = null; + this.pathData = []; + this.pathIndexes = []; + }, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Shape#displayWidth + * @type {number} + * @since 3.13.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Shape#displayHeight + * @type {number} + * @since 3.13.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + } + +}); + +module.exports = Shape; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(13); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {number} degrees - The angle (in degrees) to convert to radians. + * + * @return {number} The given angle converted to radians. + */ +var DegToRad = function (degrees) +{ + return degrees * CONST.DEG_TO_RAD; +}; + +module.exports = DegToRad; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cameras.Scene2D.Events + */ + +module.exports = { + + DESTROY: __webpack_require__(711), + FADE_IN_COMPLETE: __webpack_require__(712), + FADE_IN_START: __webpack_require__(713), + FADE_OUT_COMPLETE: __webpack_require__(714), + FADE_OUT_START: __webpack_require__(715), + FLASH_COMPLETE: __webpack_require__(716), + FLASH_START: __webpack_require__(717), + FOLLOW_UPDATE: __webpack_require__(718), + PAN_COMPLETE: __webpack_require__(719), + PAN_START: __webpack_require__(720), + POST_RENDER: __webpack_require__(721), + PRE_RENDER: __webpack_require__(722), + ROTATE_COMPLETE: __webpack_require__(723), + ROTATE_START: __webpack_require__(724), + SHAKE_COMPLETE: __webpack_require__(725), + SHAKE_START: __webpack_require__(726), + ZOOM_COMPLETE: __webpack_require__(727), + ZOOM_START: __webpack_require__(728) + +}; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetColor = __webpack_require__(100); +var GetColor32 = __webpack_require__(320); +var HSVToRGB = __webpack_require__(180); +var RGBToHSV = __webpack_require__(321); /** * @namespace Phaser.Display.Color @@ -7098,10 +7391,10 @@ var RGBToHSV = __webpack_require__(309); * @constructor * @since 3.0.0 * - * @param {integer} [red=0] - The red color value. A number between 0 and 255. - * @param {integer} [green=0] - The green color value. A number between 0 and 255. - * @param {integer} [blue=0] - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * @param {number} [red=0] - The red color value. A number between 0 and 255. + * @param {number} [green=0] - The green color value. A number between 0 and 255. + * @param {number} [blue=0] - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. */ var Color = new Class({ @@ -7277,10 +7570,10 @@ var Color = new Class({ * @method Phaser.Display.Color#setTo * @since 3.0.0 * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. * @param {boolean} [updateHSV=true] - Update the HSV values after setting the RGB values? * * @return {Phaser.Display.Color} This Color object. @@ -7450,7 +7743,7 @@ var Color = new Class({ * @method Phaser.Display.Color#gray * @since 3.13.0 * - * @param {integer} shade - A value between 0 and 255. + * @param {number} shade - A value between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -7465,8 +7758,8 @@ var Color = new Class({ * @method Phaser.Display.Color#random * @since 3.13.0 * - * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. - * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * @param {number} [min=0] - The minimum random color value. Between 0 and 255. + * @param {number} [max=255] - The maximum random color value. Between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -7488,8 +7781,8 @@ var Color = new Class({ * @method Phaser.Display.Color#randomGray * @since 3.13.0 * - * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. - * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * @param {number} [min=0] - The minimum random color value. Between 0 and 255. + * @param {number} [max=255] - The maximum random color value. Between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -7510,7 +7803,7 @@ var Color = new Class({ * @method Phaser.Display.Color#saturate * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7528,7 +7821,7 @@ var Color = new Class({ * @method Phaser.Display.Color#desaturate * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7545,7 +7838,7 @@ var Color = new Class({ * @method Phaser.Display.Color#lighten * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7562,7 +7855,7 @@ var Color = new Class({ * @method Phaser.Display.Color#darken * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7579,7 +7872,7 @@ var Color = new Class({ * @method Phaser.Display.Color#brighten * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7933,7 +8226,1053 @@ module.exports = Color; /***/ }), -/* 33 */ +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + +/***/ }), +/* 38 */ /***/ (function(module, exports) { /** @@ -7988,7 +9327,7 @@ module.exports = { /***/ }), -/* 34 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8013,48 +9352,54 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.50.0-beta.5', + VERSION: '3.50.0-beta.11', - BlendModes: __webpack_require__(54), + BlendModes: __webpack_require__(48), - ScaleModes: __webpack_require__(247), + ScaleModes: __webpack_require__(260), /** - * AUTO Detect Renderer. + * This setting will auto-detect if the browser is capable of suppporting WebGL. + * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. * * @name Phaser.AUTO * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ AUTO: 0, /** - * Canvas Renderer. + * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports + * WebGL or not. * * @name Phaser.CANVAS * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ CANVAS: 1, /** - * WebGL Renderer. + * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is + * no fallback to Canvas with this setting, so you should trap it and display a suitable + * message to the user. * * @name Phaser.WEBGL * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ WEBGL: 2, /** - * Headless Renderer. + * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still + * absolutely relies on the DOM being present and available. This mode is meant for unit testing, + * not for running Phaser on the server, which is something you really shouldn't do. * * @name Phaser.HEADLESS * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ HEADLESS: 3, @@ -8065,7 +9410,7 @@ var CONST = { * * @name Phaser.FOREVER * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ FOREVER: -1, @@ -8075,7 +9420,7 @@ var CONST = { * * @name Phaser.NONE * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ NONE: 4, @@ -8085,7 +9430,7 @@ var CONST = { * * @name Phaser.UP * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ UP: 5, @@ -8095,7 +9440,7 @@ var CONST = { * * @name Phaser.DOWN * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ DOWN: 6, @@ -8105,7 +9450,7 @@ var CONST = { * * @name Phaser.LEFT * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ LEFT: 7, @@ -8115,7 +9460,7 @@ var CONST = { * * @name Phaser.RIGHT * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ RIGHT: 8 @@ -8126,7 +9471,7 @@ module.exports = CONST; /***/ }), -/* 35 */ +/* 40 */ /***/ (function(module, exports) { /** @@ -8154,7 +9499,7 @@ module.exports = GetBottom; /***/ }), -/* 36 */ +/* 41 */ /***/ (function(module, exports) { /** @@ -8182,7 +9527,7 @@ module.exports = GetLeft; /***/ }), -/* 37 */ +/* 42 */ /***/ (function(module, exports) { /** @@ -8210,7 +9555,7 @@ module.exports = GetRight; /***/ }), -/* 38 */ +/* 43 */ /***/ (function(module, exports) { /** @@ -8238,7 +9583,7 @@ module.exports = GetTop; /***/ }), -/* 39 */ +/* 44 */ /***/ (function(module, exports) { /** @@ -8264,8 +9609,8 @@ module.exports = GetTop; * @param {string} key - The property to be updated. * @param {number} value - The amount to be added to the property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -8305,7 +9650,7 @@ module.exports = PropertyValueInc; /***/ }), -/* 40 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8315,10 +9660,10 @@ module.exports = PropertyValueInc; */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(284); -var GetPoints = __webpack_require__(162); -var GEOM_CONST = __webpack_require__(49); -var Random = __webpack_require__(163); +var GetPoint = __webpack_require__(299); +var GetPoints = __webpack_require__(163); +var GEOM_CONST = __webpack_require__(55); +var Random = __webpack_require__(164); var Vector2 = __webpack_require__(3); /** @@ -8351,7 +9696,7 @@ var Line = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Line#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -8425,8 +9770,8 @@ var Line = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. - * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. @@ -8642,74 +9987,7 @@ module.exports = Line; /***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(13); - -/** - * Convert the given angle from degrees, to the equivalent angle in radians. - * - * @function Phaser.Math.DegToRad - * @since 3.0.0 - * - * @param {integer} degrees - The angle (in degrees) to convert to radians. - * - * @return {number} The given angle converted to radians. - */ -var DegToRad = function (degrees) -{ - return degrees * CONST.DEG_TO_RAD; -}; - -module.exports = DegToRad; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Cameras.Scene2D.Events - */ - -module.exports = { - - DESTROY: __webpack_require__(671), - FADE_IN_COMPLETE: __webpack_require__(672), - FADE_IN_START: __webpack_require__(673), - FADE_OUT_COMPLETE: __webpack_require__(674), - FADE_OUT_START: __webpack_require__(675), - FLASH_COMPLETE: __webpack_require__(676), - FLASH_START: __webpack_require__(677), - PAN_COMPLETE: __webpack_require__(678), - PAN_START: __webpack_require__(679), - POST_RENDER: __webpack_require__(680), - PRE_RENDER: __webpack_require__(681), - ROTATE_COMPLETE: __webpack_require__(682), - ROTATE_START: __webpack_require__(683), - SHAKE_COMPLETE: __webpack_require__(684), - SHAKE_START: __webpack_require__(685), - ZOOM_COMPLETE: __webpack_require__(686), - ZOOM_START: __webpack_require__(687) - -}; - - -/***/ }), -/* 43 */ +/* 46 */ /***/ (function(module, exports) { /** @@ -8746,8 +10024,658 @@ module.exports = FillStyleCanvas; /***/ }), -/* 44 */, -/* 45 */ +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class MultiFile + * @memberof Phaser.Loader + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {string} type - The file type string for sorting within the Loader. + * @param {string} key - The key of the file within the loader. + * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. + */ +var MultiFile = new Class({ + + initialize: + + function MultiFile (loader, type, key, files) + { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.MultiFile#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.7.0 + */ + this.loader = loader; + + /** + * The file type string for sorting within the Loader. + * + * @name Phaser.Loader.MultiFile#type + * @type {string} + * @since 3.7.0 + */ + this.type = type; + + /** + * Unique cache key (unique within its file type) + * + * @name Phaser.Loader.MultiFile#key + * @type {string} + * @since 3.7.0 + */ + this.key = key; + + /** + * The current index being used by multi-file loaders to avoid key clashes. + * + * @name Phaser.Loader.MultiFile#multiKeyIndex + * @type {number} + * @private + * @since 3.20.0 + */ + this.multiKeyIndex = loader.multiKeyIndex++; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = finalFiles; + + /** + * The completion status of this MultiFile. + * + * @name Phaser.Loader.MultiFile#complete + * @type {boolean} + * @default false + * @since 3.7.0 + */ + this.complete = false; + + /** + * The number of files to load. + * + * @name Phaser.Loader.MultiFile#pending + * @type {number} + * @since 3.7.0 + */ + + this.pending = finalFiles.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {number} + * @default 0 + * @since 3.7.0 + */ + this.failed = 0; + + /** + * A storage container for transient data that the loading files need. + * + * @name Phaser.Loader.MultiFile#config + * @type {any} + * @since 3.7.0 + */ + this.config = {}; + + /** + * A reference to the Loaders baseURL at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#baseURL + * @type {string} + * @since 3.20.0 + */ + this.baseURL = loader.baseURL; + + /** + * A reference to the Loaders path at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#path + * @type {string} + * @since 3.20.0 + */ + this.path = loader.path; + + /** + * A reference to the Loaders prefix at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#prefix + * @type {string} + * @since 3.20.0 + */ + this.prefix = loader.prefix; + + // Link the files + for (var i = 0; i < finalFiles.length; i++) + { + finalFiles[i].multiFile = this; + } + }, + + /** + * Checks if this MultiFile is ready to process its children or not. + * + * @method Phaser.Loader.MultiFile#isReadyToProcess + * @since 3.7.0 + * + * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. + */ + isReadyToProcess: function () + { + return (this.pending === 0 && this.failed === 0 && !this.complete); + }, + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * + * @method Phaser.Loader.MultiFile#addToMultiFile + * @since 3.7.0 + * + * @param {Phaser.Loader.File} files - The File to add to this MultiFile. + * + * @return {Phaser.Loader.MultiFile} This MultiFile instance. + */ + addToMultiFile: function (file) + { + this.files.push(file); + + file.multiFile = this; + + this.pending++; + + this.complete = false; + + return this; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.MultiFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + } + }, + + /** + * Called by each File that fails to load. + * + * @method Phaser.Loader.MultiFile#onFileFailed + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has failed to load. + */ + onFileFailed: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.failed++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Blend Modes. + * + * @namespace Phaser.BlendModes + * @since 3.0.0 + */ + +module.exports = { + + /** + * Skips the Blend Mode check in the renderer. + * + * @name Phaser.BlendModes.SKIP_CHECK + * @type {number} + * @const + * @since 3.0.0 + */ + SKIP_CHECK: -1, + + /** + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. + * + * @name Phaser.BlendModes.NORMAL + * @type {number} + * @const + * @since 3.0.0 + */ + NORMAL: 0, + + /** + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.ADD + * @type {number} + * @const + * @since 3.0.0 + */ + ADD: 1, + + /** + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. + * + * @name Phaser.BlendModes.MULTIPLY + * @type {number} + * @const + * @since 3.0.0 + */ + MULTIPLY: 2, + + /** + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) + * + * @name Phaser.BlendModes.SCREEN + * @type {number} + * @const + * @since 3.0.0 + */ + SCREEN: 3, + + /** + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. + * + * @name Phaser.BlendModes.OVERLAY + * @type {number} + * @const + * @since 3.0.0 + */ + OVERLAY: 4, + + /** + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. + * + * @name Phaser.BlendModes.DARKEN + * @type {number} + * @const + * @since 3.0.0 + */ + DARKEN: 5, + + /** + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. + * + * @name Phaser.BlendModes.LIGHTEN + * @type {number} + * @const + * @since 3.0.0 + */ + LIGHTEN: 6, + + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + * + * @name Phaser.BlendModes.COLOR_DODGE + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_DODGE: 7, + + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + * + * @name Phaser.BlendModes.COLOR_BURN + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_BURN: 8, + + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + * + * @name Phaser.BlendModes.HARD_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + HARD_LIGHT: 9, + + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + * + * @name Phaser.BlendModes.SOFT_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + SOFT_LIGHT: 10, + + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + * + * @name Phaser.BlendModes.DIFFERENCE + * @type {number} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {number} + * @const + * @since 3.0.0 + */ + EXCLUSION: 12, + + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + * + * @name Phaser.BlendModes.HUE + * @type {number} + * @const + * @since 3.0.0 + */ + HUE: 13, + + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + * + * @name Phaser.BlendModes.SATURATION + * @type {number} + * @const + * @since 3.0.0 + */ + SATURATION: 14, + + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + * + * @name Phaser.BlendModes.COLOR + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR: 15, + + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + * + * @name Phaser.BlendModes.LUMINOSITY + * @type {number} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {number} + * @const + * @since 3.0.0 + */ + ERASE: 17, + + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.SOURCE_IN + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_IN: 18, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_OUT: 19, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_ATOP: 20, + + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + * + * @name Phaser.BlendModes.DESTINATION_OVER + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OVER: 21, + + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.DESTINATION_IN + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_IN: 22, + + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + * + * @name Phaser.BlendModes.DESTINATION_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OUT: 23, + + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + * + * @name Phaser.BlendModes.DESTINATION_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_ATOP: 24, + + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.LIGHTER + * @type {number} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {number} + * @const + * @since 3.0.0 + */ + COPY: 26, + + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + * + * @name Phaser.BlendModes.XOR + * @type {number} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Events + */ + +module.exports = { + + BOOT: __webpack_require__(908), + DESTROY: __webpack_require__(909), + DRAG_END: __webpack_require__(910), + DRAG_ENTER: __webpack_require__(911), + DRAG: __webpack_require__(912), + DRAG_LEAVE: __webpack_require__(913), + DRAG_OVER: __webpack_require__(914), + DRAG_START: __webpack_require__(915), + DROP: __webpack_require__(916), + GAME_OUT: __webpack_require__(917), + GAME_OVER: __webpack_require__(918), + GAMEOBJECT_DOWN: __webpack_require__(919), + GAMEOBJECT_DRAG_END: __webpack_require__(920), + GAMEOBJECT_DRAG_ENTER: __webpack_require__(921), + GAMEOBJECT_DRAG: __webpack_require__(922), + GAMEOBJECT_DRAG_LEAVE: __webpack_require__(923), + GAMEOBJECT_DRAG_OVER: __webpack_require__(924), + GAMEOBJECT_DRAG_START: __webpack_require__(925), + GAMEOBJECT_DROP: __webpack_require__(926), + GAMEOBJECT_MOVE: __webpack_require__(927), + GAMEOBJECT_OUT: __webpack_require__(928), + GAMEOBJECT_OVER: __webpack_require__(929), + GAMEOBJECT_POINTER_DOWN: __webpack_require__(930), + GAMEOBJECT_POINTER_MOVE: __webpack_require__(931), + GAMEOBJECT_POINTER_OUT: __webpack_require__(932), + GAMEOBJECT_POINTER_OVER: __webpack_require__(933), + GAMEOBJECT_POINTER_UP: __webpack_require__(934), + GAMEOBJECT_POINTER_WHEEL: __webpack_require__(935), + GAMEOBJECT_UP: __webpack_require__(936), + GAMEOBJECT_WHEEL: __webpack_require__(937), + MANAGER_BOOT: __webpack_require__(938), + MANAGER_PROCESS: __webpack_require__(939), + MANAGER_UPDATE: __webpack_require__(940), + POINTER_DOWN: __webpack_require__(941), + POINTER_DOWN_OUTSIDE: __webpack_require__(942), + POINTER_MOVE: __webpack_require__(943), + POINTER_OUT: __webpack_require__(944), + POINTER_OVER: __webpack_require__(945), + POINTER_UP: __webpack_require__(946), + POINTER_UP_OUTSIDE: __webpack_require__(947), + POINTER_WHEEL: __webpack_require__(948), + POINTERLOCK_CHANGE: __webpack_require__(949), + PRE_UPDATE: __webpack_require__(950), + SHUTDOWN: __webpack_require__(951), + START: __webpack_require__(952), + UPDATE: __webpack_require__(953) + +}; + + +/***/ }), +/* 50 */, +/* 51 */ /***/ (function(module, exports) { /** @@ -8780,7 +10708,7 @@ module.exports = SetTop; /***/ }), -/* 46 */ +/* 52 */ /***/ (function(module, exports) { /** @@ -8813,7 +10741,7 @@ module.exports = SetLeft; /***/ }), -/* 47 */ +/* 53 */ /***/ (function(module, exports) { /** @@ -8846,7 +10774,7 @@ module.exports = SetRight; /***/ }), -/* 48 */ +/* 54 */ /***/ (function(module, exports) { /** @@ -8879,7 +10807,7 @@ module.exports = SetBottom; /***/ }), -/* 49 */ +/* 55 */ /***/ (function(module, exports) { /** @@ -8894,7 +10822,7 @@ var GEOM_CONST = { * A Circle Geometry object type. * * @name Phaser.Geom.CIRCLE - * @type {integer} + * @type {number} * @since 3.19.0 */ CIRCLE: 0, @@ -8903,7 +10831,7 @@ var GEOM_CONST = { * An Ellipse Geometry object type. * * @name Phaser.Geom.ELLIPSE - * @type {integer} + * @type {number} * @since 3.19.0 */ ELLIPSE: 1, @@ -8912,7 +10840,7 @@ var GEOM_CONST = { * A Line Geometry object type. * * @name Phaser.Geom.LINE - * @type {integer} + * @type {number} * @since 3.19.0 */ LINE: 2, @@ -8921,7 +10849,7 @@ var GEOM_CONST = { * A Point Geometry object type. * * @name Phaser.Geom.POINT - * @type {integer} + * @type {number} * @since 3.19.0 */ POINT: 3, @@ -8930,7 +10858,7 @@ var GEOM_CONST = { * A Polygon Geometry object type. * * @name Phaser.Geom.POLYGON - * @type {integer} + * @type {number} * @since 3.19.0 */ POLYGON: 4, @@ -8939,7 +10867,7 @@ var GEOM_CONST = { * A Rectangle Geometry object type. * * @name Phaser.Geom.RECTANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ RECTANGLE: 5, @@ -8948,7 +10876,7 @@ var GEOM_CONST = { * A Triangle Geometry object type. * * @name Phaser.Geom.TRIANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ TRIANGLE: 6 @@ -8959,7 +10887,7 @@ module.exports = GEOM_CONST; /***/ }), -/* 50 */ +/* 56 */ /***/ (function(module, exports) { /** @@ -8994,7 +10922,7 @@ module.exports = Contains; /***/ }), -/* 51 */ +/* 57 */ /***/ (function(module, exports) { /** @@ -9032,7 +10960,237 @@ module.exports = LineStyleCanvas; /***/ }), -/* 52 */ +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(19); +var File = __webpack_require__(22); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + var json = JSON.parse(this.xhrLoader.responseText); + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), +/* 59 */ /***/ (function(module, exports) { /** @@ -9161,7 +11319,7 @@ module.exports = CONST; /***/ }), -/* 53 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9170,8 +11328,8 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(150); -var GetTilesWithin = __webpack_require__(24); +var GetTileAt = __webpack_require__(151); +var GetTilesWithin = __webpack_require__(26); /** * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the @@ -9181,10 +11339,10 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.CalculateFacesWithin * @since 3.0.0 * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesWithin = function (tileX, tileY, width, height, layer) @@ -9226,346 +11384,7 @@ module.exports = CalculateFacesWithin; /***/ }), -/* 54 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Blend Modes. - * - * @namespace Phaser.BlendModes - * @since 3.0.0 - */ - -module.exports = { - - /** - * Skips the Blend Mode check in the renderer. - * - * @name Phaser.BlendModes.SKIP_CHECK - * @type {integer} - * @const - * @since 3.0.0 - */ - SKIP_CHECK: -1, - - /** - * Normal blend mode. For Canvas and WebGL. - * This is the default setting and draws new shapes on top of the existing canvas content. - * - * @name Phaser.BlendModes.NORMAL - * @type {integer} - * @const - * @since 3.0.0 - */ - NORMAL: 0, - - /** - * Add blend mode. For Canvas and WebGL. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.ADD - * @type {integer} - * @const - * @since 3.0.0 - */ - ADD: 1, - - /** - * Multiply blend mode. For Canvas and WebGL. - * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * - * @name Phaser.BlendModes.MULTIPLY - * @type {integer} - * @const - * @since 3.0.0 - */ - MULTIPLY: 2, - - /** - * Screen blend mode. For Canvas and WebGL. - * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * - * @name Phaser.BlendModes.SCREEN - * @type {integer} - * @const - * @since 3.0.0 - */ - SCREEN: 3, - - /** - * Overlay blend mode. For Canvas only. - * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * - * @name Phaser.BlendModes.OVERLAY - * @type {integer} - * @const - * @since 3.0.0 - */ - OVERLAY: 4, - - /** - * Darken blend mode. For Canvas only. - * Retains the darkest pixels of both layers. - * - * @name Phaser.BlendModes.DARKEN - * @type {integer} - * @const - * @since 3.0.0 - */ - DARKEN: 5, - - /** - * Lighten blend mode. For Canvas only. - * Retains the lightest pixels of both layers. - * - * @name Phaser.BlendModes.LIGHTEN - * @type {integer} - * @const - * @since 3.0.0 - */ - LIGHTEN: 6, - - /** - * Color Dodge blend mode. For Canvas only. - * Divides the bottom layer by the inverted top layer. - * - * @name Phaser.BlendModes.COLOR_DODGE - * @type {integer} - * @const - * @since 3.0.0 - */ - COLOR_DODGE: 7, - - /** - * Color Burn blend mode. For Canvas only. - * Divides the inverted bottom layer by the top layer, and then inverts the result. - * - * @name Phaser.BlendModes.COLOR_BURN - * @type {integer} - * @const - * @since 3.0.0 - */ - COLOR_BURN: 8, - - /** - * Hard Light blend mode. For Canvas only. - * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * - * @name Phaser.BlendModes.HARD_LIGHT - * @type {integer} - * @const - * @since 3.0.0 - */ - HARD_LIGHT: 9, - - /** - * Soft Light blend mode. For Canvas only. - * A softer version of hard-light. Pure black or white does not result in pure black or white. - * - * @name Phaser.BlendModes.SOFT_LIGHT - * @type {integer} - * @const - * @since 3.0.0 - */ - SOFT_LIGHT: 10, - - /** - * Difference blend mode. For Canvas only. - * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * - * @name Phaser.BlendModes.DIFFERENCE - * @type {integer} - * @const - * @since 3.0.0 - */ - DIFFERENCE: 11, - - /** - * Exclusion blend mode. For Canvas only. - * Like difference, but with lower contrast. - * - * @name Phaser.BlendModes.EXCLUSION - * @type {integer} - * @const - * @since 3.0.0 - */ - EXCLUSION: 12, - - /** - * Hue blend mode. For Canvas only. - * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * - * @name Phaser.BlendModes.HUE - * @type {integer} - * @const - * @since 3.0.0 - */ - HUE: 13, - - /** - * Saturation blend mode. For Canvas only. - * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * - * @name Phaser.BlendModes.SATURATION - * @type {integer} - * @const - * @since 3.0.0 - */ - SATURATION: 14, - - /** - * Color blend mode. For Canvas only. - * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * - * @name Phaser.BlendModes.COLOR - * @type {integer} - * @const - * @since 3.0.0 - */ - COLOR: 15, - - /** - * Luminosity blend mode. For Canvas only. - * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * - * @name Phaser.BlendModes.LUMINOSITY - * @type {integer} - * @const - * @since 3.0.0 - */ - LUMINOSITY: 16, - - /** - * Alpha erase blend mode. For Canvas and WebGL. - * - * @name Phaser.BlendModes.ERASE - * @type {integer} - * @const - * @since 3.0.0 - */ - ERASE: 17, - - /** - * Source-in blend mode. For Canvas only. - * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.SOURCE_IN - * @type {integer} - * @const - * @since 3.0.0 - */ - SOURCE_IN: 18, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is drawn where it doesn't overlap the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_OUT - * @type {integer} - * @const - * @since 3.0.0 - */ - SOURCE_OUT: 19, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is only drawn where it overlaps the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_ATOP - * @type {integer} - * @const - * @since 3.0.0 - */ - SOURCE_ATOP: 20, - - /** - * Destination-over blend mode. For Canvas only. - * New shapes are drawn behind the existing canvas content. - * - * @name Phaser.BlendModes.DESTINATION_OVER - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_OVER: 21, - - /** - * Destination-in blend mode. For Canvas only. - * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.DESTINATION_IN - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_IN: 22, - - /** - * Destination-out blend mode. For Canvas only. - * The existing content is kept where it doesn't overlap the new shape. - * - * @name Phaser.BlendModes.DESTINATION_OUT - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_OUT: 23, - - /** - * Destination-out blend mode. For Canvas only. - * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * - * @name Phaser.BlendModes.DESTINATION_ATOP - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_ATOP: 24, - - /** - * Lighten blend mode. For Canvas only. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.LIGHTER - * @type {integer} - * @const - * @since 3.0.0 - */ - LIGHTER: 25, - - /** - * Copy blend mode. For Canvas only. - * Only the new shape is shown. - * - * @name Phaser.BlendModes.COPY - * @type {integer} - * @const - * @since 3.0.0 - */ - COPY: 26, - - /** - * Xor blend mode. For Canvas only. - * Shapes are made transparent where both overlap and drawn normal everywhere else. - * - * @name Phaser.BlendModes.XOR - * @type {integer} - * @const - * @since 3.0.0 - */ - XOR: 27 - -}; - - -/***/ }), -/* 55 */ +/* 61 */ /***/ (function(module, exports) { /** @@ -9599,73 +11418,7 @@ module.exports = DistanceBetween; /***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Input.Events - */ - -module.exports = { - - BOOT: __webpack_require__(852), - DESTROY: __webpack_require__(853), - DRAG_END: __webpack_require__(854), - DRAG_ENTER: __webpack_require__(855), - DRAG: __webpack_require__(856), - DRAG_LEAVE: __webpack_require__(857), - DRAG_OVER: __webpack_require__(858), - DRAG_START: __webpack_require__(859), - DROP: __webpack_require__(860), - GAME_OUT: __webpack_require__(861), - GAME_OVER: __webpack_require__(862), - GAMEOBJECT_DOWN: __webpack_require__(863), - GAMEOBJECT_DRAG_END: __webpack_require__(864), - GAMEOBJECT_DRAG_ENTER: __webpack_require__(865), - GAMEOBJECT_DRAG: __webpack_require__(866), - GAMEOBJECT_DRAG_LEAVE: __webpack_require__(867), - GAMEOBJECT_DRAG_OVER: __webpack_require__(868), - GAMEOBJECT_DRAG_START: __webpack_require__(869), - GAMEOBJECT_DROP: __webpack_require__(870), - GAMEOBJECT_MOVE: __webpack_require__(871), - GAMEOBJECT_OUT: __webpack_require__(872), - GAMEOBJECT_OVER: __webpack_require__(873), - GAMEOBJECT_POINTER_DOWN: __webpack_require__(874), - GAMEOBJECT_POINTER_MOVE: __webpack_require__(875), - GAMEOBJECT_POINTER_OUT: __webpack_require__(876), - GAMEOBJECT_POINTER_OVER: __webpack_require__(877), - GAMEOBJECT_POINTER_UP: __webpack_require__(878), - GAMEOBJECT_POINTER_WHEEL: __webpack_require__(879), - GAMEOBJECT_UP: __webpack_require__(880), - GAMEOBJECT_WHEEL: __webpack_require__(881), - MANAGER_BOOT: __webpack_require__(882), - MANAGER_PROCESS: __webpack_require__(883), - MANAGER_UPDATE: __webpack_require__(884), - POINTER_DOWN: __webpack_require__(885), - POINTER_DOWN_OUTSIDE: __webpack_require__(886), - POINTER_MOVE: __webpack_require__(887), - POINTER_OUT: __webpack_require__(888), - POINTER_OVER: __webpack_require__(889), - POINTER_UP: __webpack_require__(890), - POINTER_UP_OUTSIDE: __webpack_require__(891), - POINTER_WHEEL: __webpack_require__(892), - POINTERLOCK_CHANGE: __webpack_require__(893), - PRE_UPDATE: __webpack_require__(894), - SHUTDOWN: __webpack_require__(895), - START: __webpack_require__(896), - UPDATE: __webpack_require__(897) - -}; - - -/***/ }), -/* 57 */ +/* 62 */ /***/ (function(module, exports) { /** @@ -9706,7 +11459,7 @@ module.exports = Contains; /***/ }), -/* 58 */ +/* 63 */ /***/ (function(module, exports) { /** @@ -9734,7 +11487,7 @@ module.exports = Length; /***/ }), -/* 59 */ +/* 64 */ /***/ (function(module, exports) { /** @@ -9766,7 +11519,7 @@ module.exports = Wrap; /***/ }), -/* 60 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10530,7 +12283,7 @@ module.exports = earcut; /***/ }), -/* 61 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10545,35 +12298,35 @@ module.exports = earcut; module.exports = { - COMPLETE: __webpack_require__(917), - DECODED: __webpack_require__(918), - DECODED_ALL: __webpack_require__(919), - DESTROY: __webpack_require__(920), - DETUNE: __webpack_require__(921), - GLOBAL_DETUNE: __webpack_require__(922), - GLOBAL_MUTE: __webpack_require__(923), - GLOBAL_RATE: __webpack_require__(924), - GLOBAL_VOLUME: __webpack_require__(925), - LOOP: __webpack_require__(926), - LOOPED: __webpack_require__(927), - MUTE: __webpack_require__(928), - PAUSE_ALL: __webpack_require__(929), - PAUSE: __webpack_require__(930), - PLAY: __webpack_require__(931), - RATE: __webpack_require__(932), - RESUME_ALL: __webpack_require__(933), - RESUME: __webpack_require__(934), - SEEK: __webpack_require__(935), - STOP_ALL: __webpack_require__(936), - STOP: __webpack_require__(937), - UNLOCKED: __webpack_require__(938), - VOLUME: __webpack_require__(939) + COMPLETE: __webpack_require__(973), + DECODED: __webpack_require__(974), + DECODED_ALL: __webpack_require__(975), + DESTROY: __webpack_require__(976), + DETUNE: __webpack_require__(977), + GLOBAL_DETUNE: __webpack_require__(978), + GLOBAL_MUTE: __webpack_require__(979), + GLOBAL_RATE: __webpack_require__(980), + GLOBAL_VOLUME: __webpack_require__(981), + LOOP: __webpack_require__(982), + LOOPED: __webpack_require__(983), + MUTE: __webpack_require__(984), + PAUSE_ALL: __webpack_require__(985), + PAUSE: __webpack_require__(986), + PLAY: __webpack_require__(987), + RATE: __webpack_require__(988), + RESUME_ALL: __webpack_require__(989), + RESUME: __webpack_require__(990), + SEEK: __webpack_require__(991), + STOP_ALL: __webpack_require__(992), + STOP: __webpack_require__(993), + UNLOCKED: __webpack_require__(994), + VOLUME: __webpack_require__(995) }; /***/ }), -/* 62 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10583,45 +12336,42 @@ module.exports = { */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); var IsPlainObject = __webpack_require__(7); /** * @classdesc - * A single JSON File suitable for loading by the Loader. + * A single Image File suitable for loading by the Loader. * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. * - * @class JSONFile + * @class ImageFile * @extends Phaser.Loader.File * @memberof Phaser.Loader.FileTypes * @constructor * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. */ -var JSONFile = new Class({ +var ImageFile = new Class({ Extends: File, initialize: - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) + function ImageFile (loader, key, url, xhrSettings, frameConfig) { - var extension = 'json'; + var extension = 'png'; + var normalMapURL; if (IsPlainObject(key)) { @@ -10629,37 +12379,41 @@ var JSONFile = new Class({ key = GetFastValue(config, 'key'); url = GetFastValue(config, 'url'); + normalMapURL = GetFastValue(config, 'normalMap'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); + frameConfig = GetFastValue(config, 'frameConfig'); + } + + if (Array.isArray(url)) + { + normalMapURL = url[1]; + url = url[0]; } var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, + type: 'image', + cache: loader.textureManager, extension: extension, - responseType: 'text', + responseType: 'blob', key: key, url: url, xhrSettings: xhrSettings, - config: dataKey + config: frameConfig }; File.call(this, loader, fileConfig); - if (IsPlainObject(url)) + // Do we have a normal map to load as well? + if (normalMapURL) { - // Object provided instead of a URL, so no need to actually load it (populate data with value) - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } + var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); - this.state = CONST.FILE_POPULATED; + normalMap.type = 'normalMap'; + + this.setLink(normalMap); + + loader.addFile(normalMap); } }, @@ -10667,43 +12421,81 @@ var JSONFile = new Class({ * Called automatically by Loader.nextFile. * This method controls what extra work this File does with its loaded data. * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @method Phaser.Loader.FileTypes.ImageFile#onProcess * @since 3.7.0 */ onProcess: function () { - if (this.state !== CONST.FILE_POPULATED) + this.state = CONST.FILE_PROCESSING; + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () { - this.state = CONST.FILE_PROCESSING; + File.revokeObjectURL(_this.data); - var json = JSON.parse(this.xhrLoader.responseText); + _this.onProcessComplete(); + }; - var key = this.config; + this.data.onerror = function () + { + File.revokeObjectURL(_this.data); - if (typeof key === 'string') + _this.onProcessError(); + }; + + File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') { - this.data = GetValue(json, key, json); + texture = this.cache.addImage(this.key, this.data, linkFile.data); } else { - this.data = json; + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); } - } - this.onProcessComplete(); + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } } }); /** - * Adds a JSON file, or array of JSON files, to the current load queue. + * Adds an Image, or array of Images, to the current load queue. * * You can call this method from within your Scene's `preload`, along with any other files you wish to load: * * ```javascript * function preload () * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); + * this.load.image('logo', 'images/phaserLogo.png'); * } * ``` * @@ -10715,330 +12507,101 @@ var JSONFile = new Class({ * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been * loaded. * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. + * then remove it from the Texture Manager first, before loading a new one. * * Instead of passing arguments you can pass a configuration object, such as: * * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' * }); * ``` * - * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. * - * Once the file has finished loading you can access it from its Cache using its key: + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: * * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); + * this.load.image('logo', 'images/AtariLogo.png'); * // and later in your game ... - * var data = this.cache.json.get('wavedata'); + * this.add.image(x, y, 'logo'); * ``` * * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. * * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); * ``` * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * Or, if you are using a config object use the `normalMap` property: * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. * It is available in the default build but can be excluded from custom builds. * - * @method Phaser.Loader.LoaderPlugin#json + * @method Phaser.Loader.LoaderPlugin#image * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.0.0 * - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +FileTypesManager.register('image', function (key, url, xhrSettings) { if (Array.isArray(key)) { for (var i = 0; i < key.length; i++) { // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); + this.addFile(new ImageFile(this, key[i])); } } else { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + this.addFile(new ImageFile(this, key, url, xhrSettings)); } return this; }); -module.exports = JSONFile; +module.exports = ImageFile; /***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after - * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * - * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class MultiFile - * @memberof Phaser.Loader - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {string} type - The file type string for sorting within the Loader. - * @param {string} key - The key of the file within the loader. - * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. - */ -var MultiFile = new Class({ - - initialize: - - function MultiFile (loader, type, key, files) - { - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.MultiFile#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.7.0 - */ - this.loader = loader; - - /** - * The file type string for sorting within the Loader. - * - * @name Phaser.Loader.MultiFile#type - * @type {string} - * @since 3.7.0 - */ - this.type = type; - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.MultiFile#key - * @type {string} - * @since 3.7.0 - */ - this.key = key; - - /** - * The current index being used by multi-file loaders to avoid key clashes. - * - * @name Phaser.Loader.MultiFile#multiKeyIndex - * @type {integer} - * @private - * @since 3.20.0 - */ - this.multiKeyIndex = loader.multiKeyIndex++; - - /** - * Array of files that make up this MultiFile. - * - * @name Phaser.Loader.MultiFile#files - * @type {Phaser.Loader.File[]} - * @since 3.7.0 - */ - this.files = files; - - /** - * The completion status of this MultiFile. - * - * @name Phaser.Loader.MultiFile#complete - * @type {boolean} - * @default false - * @since 3.7.0 - */ - this.complete = false; - - /** - * The number of files to load. - * - * @name Phaser.Loader.MultiFile#pending - * @type {integer} - * @since 3.7.0 - */ - - this.pending = files.length; - - /** - * The number of files that failed to load. - * - * @name Phaser.Loader.MultiFile#failed - * @type {integer} - * @default 0 - * @since 3.7.0 - */ - this.failed = 0; - - /** - * A storage container for transient data that the loading files need. - * - * @name Phaser.Loader.MultiFile#config - * @type {any} - * @since 3.7.0 - */ - this.config = {}; - - /** - * A reference to the Loaders baseURL at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#baseURL - * @type {string} - * @since 3.20.0 - */ - this.baseURL = loader.baseURL; - - /** - * A reference to the Loaders path at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#path - * @type {string} - * @since 3.20.0 - */ - this.path = loader.path; - - /** - * A reference to the Loaders prefix at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#prefix - * @type {string} - * @since 3.20.0 - */ - this.prefix = loader.prefix; - - // Link the files - for (var i = 0; i < files.length; i++) - { - files[i].multiFile = this; - } - }, - - /** - * Checks if this MultiFile is ready to process its children or not. - * - * @method Phaser.Loader.MultiFile#isReadyToProcess - * @since 3.7.0 - * - * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. - */ - isReadyToProcess: function () - { - return (this.pending === 0 && this.failed === 0 && !this.complete); - }, - - /** - * Adds another child to this MultiFile, increases the pending count and resets the completion status. - * - * @method Phaser.Loader.MultiFile#addToMultiFile - * @since 3.7.0 - * - * @param {Phaser.Loader.File} files - The File to add to this MultiFile. - * - * @return {Phaser.Loader.MultiFile} This MultiFile instance. - */ - addToMultiFile: function (file) - { - this.files.push(file); - - file.multiFile = this; - - this.pending++; - - this.complete = false; - - return this; - }, - - /** - * Called by each File when it finishes loading. - * - * @method Phaser.Loader.MultiFile#onFileComplete - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has completed processing. - */ - onFileComplete: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.pending--; - } - }, - - /** - * Called by each File that fails to load. - * - * @method Phaser.Loader.MultiFile#onFileFailed - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has failed to load. - */ - onFileFailed: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.failed++; - } - } - -}); - -module.exports = MultiFile; - - -/***/ }), -/* 64 */, -/* 65 */ +/* 68 */, +/* 69 */ /***/ (function(module, exports) { /** @@ -11073,8 +12636,8 @@ module.exports = SetTileCollision; /***/ }), -/* 66 */ -/***/ (function(module, exports) { +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -11082,98 +12645,481 @@ module.exports = SetTileCollision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var AnimationState = __webpack_require__(157); +var Class = __webpack_require__(0); +var Components = __webpack_require__(11); +var GameObject = __webpack_require__(14); +var GameObjectEvents = __webpack_require__(32); +var SpriteRender = __webpack_require__(1048); + /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layer's position, scale and scroll. + * @classdesc + * A Sprite Game Object. * - * @function Phaser.Tilemaps.Components.WorldToTileX + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + * + * @class Sprite + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor * @since 3.0.0 * - * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.TextureCrop + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible * - * @return {number} The X location in tile units. + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ -var WorldToTileX = function (worldX, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } +var Sprite = new Class({ - var tileWidth = layer.baseTileWidth; - var tilemapLayer = layer.tilemapLayer; + Extends: GameObject, - if (tilemapLayer) + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Size, + Components.TextureCrop, + Components.Tint, + Components.Transform, + Components.Visible, + SpriteRender + ], + + initialize: + + function Sprite (scene, x, y, texture, frame) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + GameObject.call(this, scene, 'Sprite'); - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's horizontal scroll - worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.Sprite#_crop + * @type {object} + * @private + * @since 3.11.0 + */ + this._crop = this.resetCropObject(); - tileWidth *= tilemapLayer.scaleX; + /** + * The Animation State component of this Sprite. + * + * This component provides features to apply animations to this Sprite. + * It is responsible for playing, loading, queuing animations for later playback, + * mixing between animations and setting the current animation frame to this Sprite. + * + * @name Phaser.GameObjects.Sprite#anims + * @type {Phaser.Animations.AnimationState} + * @since 3.0.0 + */ + this.anims = new AnimationState(this); + + this.setTexture(texture, frame); + this.setPosition(x, y); + this.setSizeToFrame(); + this.setOriginFromFrame(); + this.initPipeline(); + + this.on(GameObjectEvents.ADDED_TO_SCENE, this.addedToScene, this); + this.on(GameObjectEvents.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); + }, + + /** + * Update this Sprite's animations. + * + * @method Phaser.GameObjects.Sprite#preUpdate + * @protected + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + this.anims.update(time, delta); + }, + + /** + * Start playing the given animation on this Sprite. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).play('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * + * @method Phaser.GameObjects.Sprite#play + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.0.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * + * @return {this} This Game Object. + */ + play: function (key, ignoreIfPlaying) + { + return this.anims.play(key, ignoreIfPlaying); + }, + + /** + * Start playing the given animation on this Sprite, in reverse. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).playReverse('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * + * @method Phaser.GameObjects.Sprite#playReverse + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * + * @return {this} This Game Object. + */ + playReverse: function (key, ignoreIfPlaying) + { + return this.anims.playReverse(key, ignoreIfPlaying); + }, + + /** + * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * + * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. + * + * If an animation is already running and a new animation is given to this method, it will wait for + * the given delay before starting the new animation. + * + * If no animation is currently running, the given one begins after the delay. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * Prior to Phaser 3.50 this method was called 'delayedPlay'. + * + * @method Phaser.GameObjects.Sprite#playAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {number} delay - The delay, in milliseconds, to wait before starting the animation playing. + * + * @return {this} This Game Object. + */ + playAfterDelay: function (key, delay) + { + return this.anims.playAfterDelay(key, delay); + }, + + /** + * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback + * of the given animation. + * + * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an + * idle animation to a walking animation, by making them blend smoothly into each other. + * + * If no animation is currently running, the given one will start immediately. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * @method Phaser.GameObjects.Sprite#playAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {number} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * + * @return {this} This Game Object. + */ + playAfterRepeat: function (key, repeatCount) + { + return this.anims.playAfterRepeat(key, repeatCount); + }, + + /** + * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, + * or have the `stop` method called directly on it. + * + * An animation set to repeat forever will never enter a completed state. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, + * or when it ends (via its `animationcomplete` event). + * + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained + * animations without impacting the animation they're playing. + * + * Call this method with no arguments to reset all currently chained animations. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * @method Phaser.GameObjects.Sprite#chain + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * + * @return {this} This Game Object. + */ + chain: function (key) + { + return this.anims.chain(key); + }, + + /** + * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. + * + * If no animation is playing, no event will be dispatched. + * + * If there is another animation queued (via the `chain` method) then it will start playing immediately. + * + * @method Phaser.GameObjects.Sprite#stop + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @return {this} This Game Object. + */ + stop: function () + { + return this.anims.stop(); + }, + + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {number} delay - The number of milliseconds to wait before stopping this animation. + * + * @return {this} This Game Object. + */ + stopAfterDelay: function (delay) + { + return this.anims.stopAfterDelay(delay); + }, + + /** + * Stops the current animation from playing after the given number of repeats. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {number} [repeatCount=1] - How many times should the animation repeat before stopping? + * + * @return {this} This Game Object. + */ + stopAfterRepeat: function (repeatCount) + { + return this.anims.stopAfterRepeat(repeatCount); + }, + + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopOnFrame + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. + * + * @return {this} This Game Object. + */ + stopOnFrame: function (frame) + { + return this.anims.stopOnFrame(frame); + }, + + /** + * Build a JSON representation of this Sprite. + * + * @method Phaser.GameObjects.Sprite#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return Components.ToJSON(this); + }, + + /** + * Handles the pre-destroy step for the Sprite, which removes the Animation component. + * + * @method Phaser.GameObjects.Sprite#preDestroy + * @private + * @since 3.14.0 + */ + preDestroy: function () + { + this.anims.destroy(); + + this.anims = undefined; } - return snapToFloor - ? Math.floor(worldX / tileWidth) - : worldX / tileWidth; -}; +}); -module.exports = WorldToTileX; +module.exports = Sprite; /***/ }), -/* 67 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileY - * @since 3.0.0 - * - * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The Y location in tile units. - */ -var WorldToTileY = function (worldY, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileHeight = layer.baseTileHeight; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's vertical scroll - worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); - - tileHeight *= tilemapLayer.scaleY; - } - - return snapToFloor - ? Math.floor(worldY / tileHeight) - : worldY / tileHeight; -}; - -module.exports = WorldToTileY; - - -/***/ }), -/* 68 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11183,11 +13129,11 @@ module.exports = WorldToTileY; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(57); -var GetPoint = __webpack_require__(277); -var GetPoints = __webpack_require__(278); -var GEOM_CONST = __webpack_require__(49); -var Random = __webpack_require__(160); +var Contains = __webpack_require__(62); +var GetPoint = __webpack_require__(292); +var GetPoints = __webpack_require__(293); +var GEOM_CONST = __webpack_require__(55); +var Random = __webpack_require__(161); /** * @classdesc @@ -11221,7 +13167,7 @@ var Circle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Circle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -11313,7 +13259,7 @@ var Circle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -11548,7 +13494,3876 @@ module.exports = Circle; /***/ }), -/* 69 */ +/* 72 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * + * @function Phaser.Math.Snap.Floor + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapFloor = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.floor(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapFloor; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Vector3 = __webpack_require__(37); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var WEBGL_CONST = { + + /** + * 8-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.BYTE + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + BYTE: { enum: 0x1400, size: 1 }, + + /** + * 8-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_BYTE + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_BYTE: { enum: 0x1401, size: 1 }, + + /** + * 16-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.SHORT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + SHORT: { enum: 0x1402, size: 2 }, + + /** + * 16-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_SHORT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_SHORT: { enum: 0x1403, size: 2 }, + + /** + * 32-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.INT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + INT: { enum: 0x1404, size: 4 }, + + /** + * 32-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_INT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_INT: { enum: 0x1405, size: 4 }, + + /** + * 32-bit IEEE floating point number. + * + * @name Phaser.Renderer.WebGL.FLOAT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + FLOAT: { enum: 0x1406, size: 4 } + +}; + +module.exports = WEBGL_CONST; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var DeepCopy = __webpack_require__(167); +var Events = __webpack_require__(190); +var GetFastValue = __webpack_require__(2); +var Matrix4 = __webpack_require__(73); +var RenderTarget = __webpack_require__(263); +var Utils = __webpack_require__(12); +var WebGLShader = __webpack_require__(574); + +/** + * @classdesc + * The `WebGLPipeline` is a base class used by all of the core Phaser pipelines. + * + * It describes the way elements will be rendered in WebGL. Internally, it handles + * compiling the shaders, creating vertex buffers, assigning primitive topology and + * binding vertex attributes, all based on the given configuration data. + * + * The pipeline is configured by passing in a `WebGLPipelineConfig` object. Please + * see the documentation for this type to fully understand the configuration options + * available to you. + * + * Usually, you would not extend from this class directly, but would instead extend + * from one of the core pipelines, such as the Multi Pipeline. + * + * The pipeline flow per render-step is as follows: + * + * 1) onPreRender - called once at the start of the render step + * 2) onRender - call for each Scene Camera that needs to render (so can be multiple times per render step) + * 3) Internal flow: + * 3a) bind (only called if a Game Object is using this pipeline and it's not currently active) + * 3b) onBind (called for every Game Object that uses this pipeline) + * 3c) flush (can be called by a Game Object, internal method or from outside by changing pipeline) + * 4) onPostRender - called once at the end of the render step + * + * @class WebGLPipeline + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration object for this WebGL Pipeline. + */ +var WebGLPipeline = new Class({ + + initialize: + + function WebGLPipeline (config) + { + var game = config.game; + var renderer = game.renderer; + var gl = renderer.gl; + + /** + * Name of the pipeline. Used for identification and setting from Game Objects. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#name + * @type {string} + * @since 3.0.0 + */ + this.name = GetFastValue(config, 'name', 'WebGLPipeline'); + + /** + * The Phaser Game instance to which this pipeline is bound. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = game; + + /** + * The WebGL Renderer instance to which this pipeline is bound. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.0.0 + */ + this.renderer = renderer; + + /** + * A reference to the WebGL Pipeline Manager. + * + * This is initially undefined and only set when this pipeline is added + * to the manager. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#manager + * @type {?Phaser.Renderer.WebGL.PipelineManager} + * @since 3.50.0 + */ + this.manager; + + /** + * The WebGL context this WebGL Pipeline uses. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#gl + * @type {WebGLRenderingContext} + * @since 3.0.0 + */ + this.gl = gl; + + /** + * The canvas which this WebGL Pipeline renders to. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#view + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.view = game.canvas; + + /** + * Width of the current viewport. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#width + * @type {number} + * @since 3.0.0 + */ + this.width = 0; + + /** + * Height of the current viewport. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#height + * @type {number} + * @since 3.0.0 + */ + this.height = 0; + + /** + * The current number of vertices that have been added to the pipeline batch. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCount + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.vertexCount = 0; + + /** + * The total number of vertices that this pipeline batch can hold before it will flush. + * + * This defaults to `renderer batchSize * 7`, where `batchSize` is defined in the Renderer Config. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCapacity + * @type {number} + * @since 3.0.0 + */ + this.vertexCapacity = 0; + + /** + * Raw byte buffer of vertices. + * + * Either set via the config object, or generates a new Array Buffer of size `vertexCapacity * vertexSize`. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexData + * @type {ArrayBuffer} + * @readonly + * @since 3.0.0 + */ + this.vertexData; + + /** + * The WebGLBuffer that holds the vertex data. + * + * Created from the `vertices` config ArrayBuffer that was passed in, or set by default, by the pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexBuffer + * @type {WebGLBuffer} + * @readonly + * @since 3.0.0 + */ + this.vertexBuffer; + + /** + * The primitive topology which the pipeline will use to submit draw calls. + * + * Defaults to GL_TRIANGLES if not otherwise set in the config. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#topology + * @type {GLenum} + * @since 3.0.0 + */ + this.topology = GetFastValue(config, 'topology', gl.TRIANGLES); + + /** + * Uint8 view to the `vertexData` ArrayBuffer. Used for uploading vertex buffer resources to the GPU. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#bytes + * @type {Uint8Array} + * @since 3.0.0 + */ + this.bytes; + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexViewF32 + * @type {Float32Array} + * @since 3.0.0 + */ + this.vertexViewF32; + + /** + * Uint32 view of the array buffer containing the pipeline's vertices. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexViewU32 + * @type {Uint32Array} + * @since 3.0.0 + */ + this.vertexViewU32; + + /** + * Indicates if the current pipeline is active, or not, for this frame only. + * + * Reset to `true` in the `onRender` method. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#active + * @type {boolean} + * @since 3.10.0 + */ + this.active = false; + + /** + * Holds the most recently assigned texture unit. + + * Treat this value as read-only. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentUnit + * @type {number} + * @since 3.50.0 + */ + this.currentUnit = 0; + + /** + * Some pipelines require the forced use of texture zero (like the light pipeline). + * + * This property should be set when that is the case. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#forceZero + * @type {boolean} + * @since 3.50.0 + */ + this.forceZero = GetFastValue(config, 'forceZero', false); + + /** + * Indicates if this pipeline has booted or not. + * + * A pipeline boots only when the Game instance itself, and all associated systems, is + * fully ready. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#hasBooted + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.hasBooted = false; + + /** + * Indicates if this is a Post FX Pipeline, or not. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#isPostFX + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.isPostFX = false; + + /** + * An array of RenderTarget instances that belong to this pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#renderTargets + * @type {Phaser.Renderer.WebGL.RenderTarget[]} + * @since 3.50.0 + */ + this.renderTargets = []; + + /** + * A reference to the currently bound Render Target instance from the `WebGLPipeline.renderTargets` array. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentRenderTarget + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.currentRenderTarget; + + /** + * An array of all the WebGLShader instances that belong to this pipeline. + * + * Shaders manage their own attributes and uniforms, but share the same vertex data buffer, + * which belongs to this pipeline. + * + * Shaders are set in a call to the `setShadersFromConfig` method, which happens automatically, + * but can also be called at any point in your game. See the method documentation for details. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#shaders + * @type {Phaser.Renderer.WebGL.WebGLShader[]} + * @since 3.50.0 + */ + this.shaders = []; + + /** + * A reference to the currently bound WebGLShader instance from the `WebGLPipeline.shaders` array. + * + * For lots of pipelines, this is the only shader, so it is a quick way to reference it without + * an array look-up. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.currentShader; + + /** + * The Projection matrix, used by shaders as 'uProjectionMatrix' uniform. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#projectionMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.projectionMatrix; + + /** + * The configuration object that was used to create this pipeline. + * + * Treat this object as 'read only', because changing it post-creation will not + * impact this pipeline in any way. However, it is used internally for cloning + * and post-boot set-up. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#config + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} + * @since 3.50.0 + */ + this.config = config; + }, + + /** + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place. You can perform any final tasks that the + * pipeline may need, that relies on game systems such as the Texture Manager being ready. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#boot + * @since 3.11.0 + */ + boot: function () + { + var i; + var gl = this.gl; + var config = this.config; + var renderer = this.renderer; + + if (!this.isPostFX) + { + this.projectionMatrix = new Matrix4().identity(); + } + + // Create the Render Targets + + var renderTargets = this.renderTargets; + + var targets = GetFastValue(config, 'renderTarget', false); + + // If boolean, set to number = 1 + if (typeof(targets) === 'boolean' && targets) + { + targets = 1; + } + + var width = renderer.width; + var height = renderer.height; + + if (typeof(targets) === 'number') + { + // Create this many default RTs + for (i = 0; i < targets; i++) + { + renderTargets.push(new RenderTarget(renderer, width, height, 1, 0, true)); + } + } + else if (Array.isArray(targets)) + { + for (i = 0; i < targets.length; i++) + { + var scale = GetFastValue(targets[i], 'scale', 1); + var minFilter = GetFastValue(targets[i], 'minFilter', 0); + var autoClear = GetFastValue(targets[i], 'autoClear', 1); + + renderTargets.push(new RenderTarget(renderer, width, height, scale, minFilter, autoClear)); + } + } + + if (renderTargets.length) + { + // Default to the first one in the array + this.currentRenderTarget = renderTargets[0]; + } + + // Create the Shaders + + this.setShadersFromConfig(config); + + // Which shader has the largest vertex size? + var shaders = this.shaders; + var vertexSize = 0; + + for (i = 0; i < shaders.length; i++) + { + if (shaders[i].vertexSize > vertexSize) + { + vertexSize = shaders[i].vertexSize; + } + } + + var batchSize = GetFastValue(config, 'batchSize', renderer.config.batchSize); + + // * 6 because there are 6 vertices in a quad and 'batchSize' represents the quantity of quads in the batch + + this.vertexCapacity = batchSize * 6; + + var data = GetFastValue(config, 'vertices', new ArrayBuffer(this.vertexCapacity * vertexSize)); + + this.vertexData = data; + + if (GetFastValue(config, 'vertices', null)) + { + this.vertexBuffer = renderer.createVertexBuffer(data, gl.STATIC_DRAW); + } + else + { + this.vertexBuffer = renderer.createVertexBuffer(data.byteLength, gl.DYNAMIC_DRAW); + } + + this.bytes = new Uint8Array(data); + + this.vertexViewF32 = new Float32Array(data); + + this.vertexViewU32 = new Uint32Array(data); + + // Set-up shaders + + this.renderer.setVertexBuffer(this.vertexBuffer); + + for (i = 0; i < shaders.length; i++) + { + shaders[i].rebind(); + } + + this.currentShader.bind(); + + this.hasBooted = true; + + renderer.on(Events.RESIZE, this.resize, this); + renderer.on(Events.PRE_RENDER, this.onPreRender, this); + renderer.on(Events.RENDER, this.onRender, this); + renderer.on(Events.POST_RENDER, this.onPostRender, this); + + this.onBoot(); + }, + + /** + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBoot + * @since 3.50.0 + */ + onBoot: function () + { + }, + + /** + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. It's also called if the renderer + * changes size. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onResize + * @since 3.50.0 + * + * @param {number} width - The new width of this WebGL Pipeline. + * @param {number} height - The new height of this WebGL Pipeline. + */ + onResize: function () + { + }, + + /** + * Sets the currently active shader within this pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setShader + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} shader - The shader to set as being current. + * @param {boolean} [setAttributes=false] - Should the vertex attribute pointers be set? + * + * @return {this} This WebGLPipeline instance. + */ + setShader: function (shader, setAttributes) + { + var renderer = this.renderer; + + if (shader !== this.currentShader || renderer.currentProgram !== this.currentShader.program) + { + this.flush(); + + renderer.resetTextures(); + + renderer.setVertexBuffer(this.vertexBuffer); + + shader.bind(setAttributes, false); + + this.currentShader = shader; + } + + return this; + }, + + /** + * Searches all shaders in this pipeline for one matching the given name, then returns it. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#getShaderByName + * @since 3.50.0 + * + * @param {string} name - The index of the shader to set. + * + * @return {Phaser.Renderer.WebGL.WebGLShader} The WebGLShader instance, if found. + */ + getShaderByName: function (name) + { + var shaders = this.shaders; + + for (var i = 0; i < shaders.length; i++) + { + if (shaders[i].name === name) + { + return shaders[i]; + } + } + }, + + /** + * Destroys all shaders currently set in the `WebGLPipeline.shaders` array and then parses the given + * `config` object, extracting the shaders from it, creating `WebGLShader` instances and finally + * setting them into the `shaders` array of this pipeline. + * + * This is a destructive process. Be very careful when you call it, should you need to. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setShadersFromConfig + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration object for this WebGL Pipeline. + * + * @return {this} This WebGLPipeline instance. + */ + setShadersFromConfig: function (config) + { + var i; + var shaders = this.shaders; + var renderer = this.renderer; + + for (i = 0; i < shaders.length; i++) + { + shaders[i].destroy(); + } + + var vName = 'vertShader'; + var fName = 'fragShader'; + var uName = 'uniforms'; + var aName = 'attributes'; + + var defaultVertShader = GetFastValue(config, vName, null); + var defaultFragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(config, fName, null), renderer.maxTextures); + var defaultUniforms = GetFastValue(config, uName, null); + var defaultAttribs = GetFastValue(config, aName, null); + + var configShaders = GetFastValue(config, 'shaders', []); + + var len = configShaders.length; + + if (len === 0) + { + if (defaultVertShader && defaultFragShader) + { + this.shaders = [ new WebGLShader(this, 'default', defaultVertShader, defaultFragShader, DeepCopy(defaultAttribs), DeepCopy(defaultUniforms)) ]; + } + } + else + { + var newShaders = []; + + for (i = 0; i < len; i++) + { + var shaderEntry = configShaders[i]; + + var name = GetFastValue(shaderEntry, 'name', 'default'); + + var vertShader = GetFastValue(shaderEntry, vName, defaultVertShader); + var fragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(shaderEntry, fName, defaultFragShader), renderer.maxTextures); + var attributes = GetFastValue(shaderEntry, aName, defaultAttribs); + var uniforms = GetFastValue(shaderEntry, uName, defaultUniforms); + + if (vertShader && fragShader) + { + newShaders.push(new WebGLShader(this, name, vertShader, fragShader, DeepCopy(attributes), DeepCopy(uniforms))); + } + } + + this.shaders = newShaders; + } + + if (this.shaders.length === 0) + { + console.warn('Pipeline: ' + this.name + ' - Invalid shader config'); + } + else + { + this.currentShader = this.shaders[0]; + } + + return this; + }, + + /** + * Custom pipelines can use this method in order to perform any required pre-batch tasks + * for the given Game Object. It must return the texture unit the Game Object was assigned. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setGameObject + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. + * @param {Phaser.Textures.Frame} [frame] - Optional frame to use. Can override that of the Game Object. + * + * @return {number} The texture unit the Game Object has been assigned. + */ + setGameObject: function (gameObject, frame) + { + if (frame === undefined) { frame = gameObject.frame; } + + this.currentUnit = this.renderer.setTextureSource(frame.source); + + return this.currentUnit; + }, + + /** + * Check if the current batch of vertices is full. + * + * You can optionally provide an `amount` parameter. If given, it will check if the batch + * needs to flush _if_ the `amount` is added to it. This allows you to test if you should + * flush before populating the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#shouldFlush + * @since 3.0.0 + * + * @param {number} [amount=0] - Will the batch need to flush if this many vertices are added to it? + * + * @return {boolean} `true` if the current batch should be flushed, otherwise `false`. + */ + shouldFlush: function (amount) + { + if (amount === undefined) { amount = 0; } + + return (this.vertexCount + amount > this.vertexCapacity); + }, + + /** + * Resizes the properties used to describe the viewport. + * + * This method is called automatically by the renderer during its resize handler. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#resize + * @since 3.0.0 + * + * @param {number} width - The new width of this WebGL Pipeline. + * @param {number} height - The new height of this WebGL Pipeline. + * + * @return {this} This WebGLPipeline instance. + */ + resize: function (width, height) + { + if (width !== this.width || height !== this.height) + { + this.flush(); + } + + this.width = width; + this.height = height; + + var projectionMatrix = this.projectionMatrix; + + // Because Post FX Pipelines don't have them + if (projectionMatrix) + { + projectionMatrix.ortho(0, width, height, 0, -1000, 1000); + } + + var i; + + var targets = this.renderTargets; + + for (i = 0; i < targets.length; i++) + { + targets[i].resize(width, height); + } + + var shaders = this.shaders; + + for (i = 0; i < shaders.length; i++) + { + var shader = shaders[i]; + + if (shader.hasUniform('uProjectionMatrix')) + { + this.setMatrix4fv('uProjectionMatrix', false, projectionMatrix.val, shader); + } + } + + this.onResize(width, height); + + return this; + }, + + /** + * This method is called every time the Pipeline Manager makes this pipeline the currently active one. + * + * It binds the resources and shader needed for this pipeline, including setting the vertex buffer + * and attribute pointers. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bind + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {this} This WebGLPipeline instance. + */ + bind: function (currentShader) + { + if (currentShader === undefined) { currentShader = this.currentShader; } + + var wasBound = this.renderer.setVertexBuffer(this.vertexBuffer); + + currentShader.bind(wasBound); + + this.currentShader = currentShader; + + return this; + }, + + /** + * This method is called every time the Pipeline Manager rebinds this pipeline. + * + * It resets all shaders this pipeline uses, setting their attributes again. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#rebind + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + rebind: function () + { + this.renderer.setVertexBuffer(this.vertexBuffer); + + var shaders = this.shaders; + + for (var i = 0; i < shaders.length; i++) + { + shaders[i].rebind(); + } + + this.currentShader = shaders[0]; + + this.onRebind(); + + return this; + }, + + /** + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. When this is called, the + * renderer has just performed a flush. It will bind the current render target, if any are set + * and finally call the `onPreBatch` hook. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#preBatch + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Cameras.Scene2D.Camera)} [gameObject] - The Game Object or Camera that invoked this pipeline, if any. + * + * @return {this} This WebGLPipeline instance. + */ + preBatch: function (gameObject) + { + if (this.currentRenderTarget) + { + this.currentRenderTarget.bind(); + } + + this.onPreBatch(gameObject); + + return this; + }, + + /** + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. When this is called, the + * renderer has just performed a flush. + * + * It calls the `onDraw` hook followed by the `onPostBatch` hook, which can be used to perform + * additional Post FX Pipeline processing. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#postBatch + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Cameras.Scene2D.Camera)} [gameObject] - The Game Object or Camera that invoked this pipeline, if any. + * + * @return {this} This WebGLPipeline instance. + */ + postBatch: function (gameObject) + { + this.onDraw(this.currentRenderTarget); + + this.onPostBatch(gameObject); + + return this; + }, + + /** + * This method is only used by Post FX Pipelines and those that extend from them. + * + * This method is called every time the `postBatch` method is called and is passed a + * reference to the current render target. + * + * At the very least a Post FX Pipeline should call `this.bindAndDraw(renderTarget)`, + * however, you can do as much additional processing as you like in this method if + * you override it from within your own pipelines. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onDraw + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} renderTarget - The Render Target. + */ + onDraw: function () + { + }, + + /** + * This method is called every time the Pipeline Manager deactivates this pipeline, swapping from + * it to another one. This happens after a call to `flush` and before the new pipeline is bound. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#unbind + * @since 3.50.0 + */ + unbind: function () + { + if (this.currentRenderTarget) + { + this.currentRenderTarget.unbind(); + } + }, + + /** + * Uploads the vertex data and emits a draw call for the current batch of vertices. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#flush + * @since 3.0.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + * + * @return {this} This WebGLPipeline instance. + */ + flush: function (isPostFlush) + { + if (isPostFlush === undefined) { isPostFlush = false; } + + var vertexCount = this.vertexCount; + + if (vertexCount > 0) + { + this.onBeforeFlush(isPostFlush); + + var gl = this.gl; + var vertexSize = this.currentShader.vertexSize; + + if (vertexCount === this.vertexCapacity) + { + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW); + } + else + { + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); + } + + gl.drawArrays(this.topology, 0, vertexCount); + + this.vertexCount = 0; + + this.onAfterFlush(isPostFlush); + } + + return this; + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time a **Game Object** asks the Pipeline Manager to use this pipeline. + * + * Unlike the `bind` method, which is only called once per frame, this is called for every object + * that requests use of this pipeline, allowing you to perform per-object set-up, such as loading + * shader uniform data. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBind + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onBind: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called when the Pipeline Manager needs to rebind this pipeline. This happens after a + * pipeline has been cleared, usually when passing control over to a 3rd party WebGL library, like Spine, + * and then returing to Phaser again. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onRebind + * @since 3.50.0 + */ + onRebind: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time the `batchQuad` or `batchTri` methods are called. If this was + * as a result of a Game Object, then the Game Object refernce is passed to this hook too. + * + * This hook is called _after_ the quad (or tri) has been added to the batch, so you can safely + * call 'flush' from within this. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately before a **Game Object** is about to add itself to the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onPreBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after a **Game Object** has been added to the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onPostBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, right before anything has been rendered, but after the canvas + * has been cleared. If this pipeline has a targetTexture, it will be cleared. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreRender + * @since 3.50.0 + */ + onPreRender: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, for every Camera in a Scene that wants to render. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onRender + * @since 3.50.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. + */ + onRender: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, after all rendering has happened and snapshots have been taken. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostRender + * @since 3.50.0 + */ + onPostRender: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time this pipeline is asked to flush its batch. + * + * It is called immediately before the gl.bufferData and gl.drawArray calls are made, so you can + * perform any final pre-render modifications. To apply changes post-render, see `onPostBatch`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBeforeFlush + * @since 3.50.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + */ + onBeforeFlush: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after this pipeline has finished flushing its batch. + * + * It is called after the `gl.drawArrays` call. + * + * You can perform additional post-render effects, but be careful not to call `flush` + * on this pipeline from within this method, or you'll cause an infinite loop. + * + * To apply changes pre-render, see `onBeforeFlush`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onAfterFlush + * @since 3.50.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + */ + onAfterFlush: function () + { + }, + + /** + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchVert + * @since 3.50.0 + * + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} u - UV u value. + * @param {number} v - UV v value. + * @param {number} unit - Texture unit to which the texture needs to be bound. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, u, v, unit, tintEffect, tint) + { + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewF32[++vertexOffset] = u; + vertexViewF32[++vertexOffset] = v; + vertexViewF32[++vertexOffset] = unit; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tint; + + this.vertexCount++; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchQuad + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|null)} gameObject - The Game Object, if any, drawing this quad. + * @param {number} x0 - The top-left x position. + * @param {number} y0 - The top-left y position. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {number} tintBR - The bottom-right tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {number} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchQuad: function (gameObject, x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) + { + if (unit === undefined) { unit = this.currentUnit; } + + var hasFlushed = false; + + if (this.shouldFlush(6)) + { + this.flush(); + + hasFlushed = true; + + unit = this.setTexture2D(texture); + } + + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x1, y1, u0, v1, unit, tintEffect, tintBL); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBR); + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBR); + this.batchVert(x3, y3, u1, v0, unit, tintEffect, tintTR); + + this.onBatch(gameObject); + + return hasFlushed; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchTri + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|null)} gameObject - The Game Object, if any, drawing this quad. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {number} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchTri: function (gameObject, x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) + { + if (unit === undefined) { unit = this.currentUnit; } + + var hasFlushed = false; + + if (this.shouldFlush(3)) + { + this.flush(); + + hasFlushed = true; + + unit = this.setTexture2D(texture); + } + + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x1, y1, u0, v1, unit, tintEffect, tintTR); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBL); + + this.onBatch(gameObject); + + return hasFlushed; + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * + * The dimensions are run through `Math.floor` before the quad is generated. + * + * Rectangle has no transform values and isn't transformed into the local space. + * + * Used for directly batching untransformed rectangles, such as Camera background colors. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#drawFillRect + * @since 3.50.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {number} color - Color of the rectangle to draw. + * @param {number} alpha - Alpha value of the rectangle to draw. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {boolean} [flipUV=true] - Flip the vertical UV coordinates of the texture before rendering? + */ + drawFillRect: function (x, y, width, height, color, alpha, texture, flipUV) + { + if (texture === undefined) { texture = this.renderer.whiteTexture.glTexture; } + if (flipUV === undefined) { flipUV = true; } + + x = Math.floor(x); + y = Math.floor(y); + + var xw = Math.floor(x + width); + var yh = Math.floor(y + height); + + var unit = this.setTexture2D(texture); + + var tint = Utils.getTintAppendFloatAlphaAndSwap(color, alpha); + + var u0 = 0; + var v0 = 0; + var u1 = 1; + var v1 = 1; + + if (flipUV) + { + v0 = 1; + v1 = 0; + } + + this.batchQuad(null, x, y, x, yh, xw, yh, xw, y, u0, v0, u1, v1, tint, tint, tint, tint, 0, texture, unit); + }, + + /** + * Sets the texture to be bound to the next available texture unit and returns + * the unit id. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setTexture2D + * @since 3.50.0 + * + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses `whiteTexture`. + * + * @return {number} The assigned texture unit. + */ + setTexture2D: function (texture) + { + if (texture === undefined) { texture = this.renderer.whiteTexture.glTexture; } + + this.currentUnit = this.renderer.setTexture2D(texture); + + return this.currentUnit; + }, + + /** + * Activates the given WebGL Texture and binds it to the requested texture slot. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bindTexture + * @since 3.50.0 + * + * @param {WebGLTexture} [target] - The WebGLTexture to activate and bind. + * @param {number} [unit=0] - The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. + * + * @return {this} This WebGL Pipeline instance. + */ + bindTexture: function (texture, unit) + { + if (unit === undefined) { unit = 0; } + + var gl = this.gl; + + gl.activeTexture(gl.TEXTURE0 + unit); + + gl.bindTexture(gl.TEXTURE_2D, texture); + + return this; + }, + + /** + * Activates the given Render Target texture and binds it to the + * requested WebGL texture slot. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bindRenderTarget + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The Render Target to activate and bind. + * @param {number} [unit=0] - The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. + * + * @return {this} This WebGL Pipeline instance. + */ + bindRenderTarget: function (target, unit) + { + return this.bindTexture(target.texture, unit); + }, + + /** + * Sets the current duration into a 1f uniform value based on the given name. + * + * This can be used for mapping time uniform values, such as `iTime`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setTime + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * + * @return {this} This WebGLPipeline instance. + */ + setTime: function (uniform) + { + this.set1f(uniform, this.game.loop.getDuration()); + + return this; + }, + + /** + * Sets a 1f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `float` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1f: function (name, x, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1f(name, x); + + return this; + }, + + /** + * Sets a 2f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec2` uniform. + * @param {number} y - The new Y component of the `vec2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2f: function (name, x, y, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2f(name, x, y); + + return this; + }, + + /** + * Sets a 3f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec3` uniform. + * @param {number} y - The new Y component of the `vec3` uniform. + * @param {number} z - The new Z component of the `vec3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3f: function (name, x, y, z, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3f(name, x, y, z); + + return this; + }, + + /** + * Sets a 4f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4f: function (name, x, y, z, w, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4f(name, x, y, z, w); + + return this; + }, + + /** + * Sets a 1fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1fv(name, arr); + + return this; + }, + + /** + * Sets a 2fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2fv(name, arr); + + return this; + }, + + /** + * Sets a 3fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3fv(name, arr); + + return this; + }, + + /** + * Sets a 4fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4fv(name, arr); + + return this; + }, + + /** + * Sets a 1iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1iv(name, arr); + + return this; + }, + + /** + * Sets a 2iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2iv(name, arr); + + return this; + }, + + /** + * Sets a 3iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3iv(name, arr); + + return this; + }, + + /** + * Sets a 4iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4iv(name, arr); + + return this; + }, + + /** + * Sets a 1i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `int` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1i: function (name, x, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1i(name, x); + + return this; + }, + + /** + * Sets a 2i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec2` uniform. + * @param {number} y - The new Y component of the `ivec2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2i: function (name, x, y, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2i(name, x, y); + + return this; + }, + + /** + * Sets a 3i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec3` uniform. + * @param {number} y - The new Y component of the `ivec3` uniform. + * @param {number} z - The new Z component of the `ivec3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3i: function (name, x, y, z, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3i(name, x, y, z); + + return this; + }, + + /** + * Sets a 4i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform. + * @param {number} y - Y component of the uniform. + * @param {number} z - Z component of the uniform. + * @param {number} w - W component of the uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4i: function (name, x, y, z, w, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4i(name, x, y, z, w); + + return this; + }, + + /** + * Sets a matrix 2fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {number[]|Float32Array} matrix - The new values for the `mat2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix2fv: function (name, transpose, matrix, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix2fv(name, transpose, matrix); + + return this; + }, + + /** + * Sets a matrix 3fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {Float32Array} matrix - The new values for the `mat3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix3fv: function (name, transpose, matrix, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix3fv(name, transpose, matrix); + + return this; + }, + + /** + * Sets a matrix 4fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Should the matrix be transpose + * @param {Float32Array} matrix - Matrix data + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix4fv: function (name, transpose, matrix, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix4fv(name, transpose, matrix); + + return this; + }, + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + destroy: function () + { + var i; + + var shaders = this.shaders; + + for (i = 0; i < shaders.length; i++) + { + shaders[i].destroy(); + } + + var targets = this.renderTargets; + + for (i = 0; i < targets.length; i++) + { + targets[i].destroy(); + } + + this.gl.deleteBuffer(this.vertexBuffer); + + var renderer = this.renderer; + + renderer.off(Events.RESIZE, this.resize, this); + renderer.off(Events.PRE_RENDER, this.onPreRender, this); + renderer.off(Events.RENDER, this.onRender, this); + renderer.off(Events.POST_RENDER, this.onPostRender, this); + + this.game = null; + this.renderer = null; + this.manager = null; + this.gl = null; + this.view = null; + this.shaders = null; + this.renderTargets = null; + this.bytes = null; + this.vertexViewF32 = null; + this.vertexViewU32 = null; + this.vertexData = null; + this.vertexBuffer = null; + this.currentShader = null; + this.currentRenderTarget = null; + + return this; + } + +}); + +module.exports = WebGLPipeline; + + +/***/ }), +/* 76 */ /***/ (function(module, exports) { /** @@ -11563,9 +17378,9 @@ module.exports = Circle; * @function Phaser.Utils.Objects.Clone * @since 3.0.0 * - * @param {object} obj - the object from which to clone + * @param {object} obj - The object to clone. * - * @return {object} a new object with the same properties as the input obj + * @return {object} A new object with the same properties as the input object. */ var Clone = function (obj) { @@ -11590,7 +17405,7 @@ module.exports = Clone; /***/ }), -/* 70 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -11606,8 +17421,8 @@ module.exports = Clone; * @since 3.4.0 * * @param {array} array - The array to check. - * @param {integer} startIndex - The start index. - * @param {integer} endIndex - The end index. + * @param {number} startIndex - The start index. + * @param {number} endIndex - The end index. * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. * * @return {boolean} True if the range is safe, otherwise false. @@ -11639,7 +17454,7 @@ module.exports = SafeRange; /***/ }), -/* 71 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11648,8 +17463,8 @@ module.exports = SafeRange; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var EaseMap = __webpack_require__(123); -var UppercaseFirst = __webpack_require__(191); +var EaseMap = __webpack_require__(129); +var UppercaseFirst = __webpack_require__(196); /** * This internal function is used to return the correct ease function for a Tween. @@ -11748,7 +17563,7 @@ module.exports = GetEaseFunction; /***/ }), -/* 72 */ +/* 79 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11757,7 +17572,7 @@ module.exports = GetEaseFunction; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders a stroke outline around the given Shape. @@ -11775,7 +17590,7 @@ var Utils = __webpack_require__(10); var StrokePathWebGL = function (pipeline, src, alpha, dx, dy) { var strokeTint = pipeline.strokeTint; - var strokeTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha); + var strokeTintColor = Utils.getTintAppendFloatAlpha(src.strokeColor, src.strokeAlpha * alpha); strokeTint.TL = strokeTintColor; strokeTint.TR = strokeTintColor; @@ -11800,8 +17615,6 @@ var StrokePathWebGL = function (pipeline, src, alpha, dx, dy) var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - pipeline.setTexture2D(); - pipeline.batchLine( px1, py1, @@ -11823,7 +17636,7 @@ module.exports = StrokePathWebGL; /***/ }), -/* 73 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11833,12 +17646,12 @@ module.exports = StrokePathWebGL; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(85); -var GetPoint = __webpack_require__(443); -var GetPoints = __webpack_require__(444); -var GEOM_CONST = __webpack_require__(49); -var Line = __webpack_require__(40); -var Random = __webpack_require__(168); +var Contains = __webpack_require__(110); +var GetPoint = __webpack_require__(453); +var GetPoints = __webpack_require__(454); +var GEOM_CONST = __webpack_require__(55); +var Line = __webpack_require__(45); +var Random = __webpack_require__(173); /** * @classdesc @@ -11876,7 +17689,7 @@ var Triangle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Triangle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -11985,7 +17798,7 @@ var Triangle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param {number} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey. * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created. * @@ -12270,281 +18083,7 @@ module.exports = Triangle; /***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var File = __webpack_require__(22); -var FileTypesManager = __webpack_require__(8); -var GetFastValue = __webpack_require__(2); -var IsPlainObject = __webpack_require__(7); - -/** - * @classdesc - * A single Image File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. - * - * @class ImageFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. - */ -var ImageFile = new Class({ - - Extends: File, - - initialize: - - function ImageFile (loader, key, url, xhrSettings, frameConfig) - { - var extension = 'png'; - var normalMapURL; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - normalMapURL = GetFastValue(config, 'normalMap'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - frameConfig = GetFastValue(config, 'frameConfig'); - } - - if (Array.isArray(url)) - { - normalMapURL = url[1]; - url = url[0]; - } - - var fileConfig = { - type: 'image', - cache: loader.textureManager, - extension: extension, - responseType: 'blob', - key: key, - url: url, - xhrSettings: xhrSettings, - config: frameConfig - }; - - File.call(this, loader, fileConfig); - - // Do we have a normal map to load as well? - if (normalMapURL) - { - var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); - - normalMap.type = 'normalMap'; - - this.setLink(normalMap); - - loader.addFile(normalMap); - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessComplete(); - }; - - this.data.onerror = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessError(); - }; - - File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - var texture; - var linkFile = this.linkFile; - - if (linkFile && linkFile.state === CONST.FILE_COMPLETE) - { - if (this.type === 'image') - { - texture = this.cache.addImage(this.key, this.data, linkFile.data); - } - else - { - texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); - } - - this.pendingDestroy(texture); - - linkFile.pendingDestroy(texture); - } - else if (!linkFile) - { - texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); - } - } - -}); - -/** - * Adds an Image, or array of Images, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.image('logo', 'images/phaserLogo.png'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. - * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback - * of animated gifs to Canvas elements. - * - * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Texture Manager first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. - * - * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * - * ```javascript - * this.load.image('logo', 'images/AtariLogo.png'); - * // and later in your game ... - * this.add.image(x, y, 'logo'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and - * this is what you would use to retrieve the image from the Texture Manager. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, - * then you can specify it by providing an array as the `url` where the second element is the normal map: - * - * ```javascript - * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); - * ``` - * - * Or, if you are using a config object use the `normalMap` property: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png', - * normalMap: 'images/AtariLogo-n.png' - * }); - * ``` - * - * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. - * Normal maps are a WebGL only feature. - * - * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#image - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('image', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new ImageFile(this, key[i])); - } - } - else - { - this.addFile(new ImageFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = ImageFile; - - -/***/ }), -/* 75 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12553,9 +18092,10 @@ module.exports = ImageFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = __webpack_require__(29); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Rectangle = __webpack_require__(465); +var Rectangle = __webpack_require__(479); /** * @classdesc @@ -12573,15 +18113,15 @@ var Rectangle = __webpack_require__(465); * @extends Phaser.GameObjects.Components.Visible * * @param {Phaser.Tilemaps.LayerData} layer - The LayerData object in the Tilemap that this tile belongs to. - * @param {integer} index - The unique index of this tile within the map. - * @param {integer} x - The x coordinate of this tile in tile coordinates. - * @param {integer} y - The y coordinate of this tile in tile coordinates. - * @param {integer} width - Width of the tile in pixels. - * @param {integer} height - Height of the tile in pixels. - * @param {integer} baseWidth - The base width a tile in the map (in pixels). Tiled maps support + * @param {number} index - The unique index of this tile within the map. + * @param {number} x - The x coordinate of this tile in tile coordinates. + * @param {number} y - The y coordinate of this tile in tile coordinates. + * @param {number} width - Width of the tile in pixels. + * @param {number} height - Height of the tile in pixels. + * @param {number} baseWidth - The base width a tile in the map (in pixels). Tiled maps support * multiple tileset sizes within one map, but they are still placed at intervals of the base * tile width. - * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps + * @param {number} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps * support multiple tileset sizes within one map, but they are still placed at intervals of the * base tile height. */ @@ -12611,7 +18151,7 @@ var Tile = new Class({ * represents a blank tile. * * @name Phaser.Tilemaps.Tile#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -12620,7 +18160,7 @@ var Tile = new Class({ * The x map coordinate of this tile in tile units. * * @name Phaser.Tilemaps.Tile#x - * @type {integer} + * @type {number} * @since 3.0.0 */ this.x = x; @@ -12629,7 +18169,7 @@ var Tile = new Class({ * The y map coordinate of this tile in tile units. * * @name Phaser.Tilemaps.Tile#y - * @type {integer} + * @type {number} * @since 3.0.0 */ this.y = y; @@ -12638,7 +18178,7 @@ var Tile = new Class({ * The width of the tile in pixels. * * @name Phaser.Tilemaps.Tile#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = width; @@ -12647,27 +18187,49 @@ var Tile = new Class({ * The height of the tile in pixels. * * @name Phaser.Tilemaps.Tile#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = height; /** - * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes + * The right of the tile in pixels. + * + * Set in the `updatePixelXY` method. + * + * @name Phaser.Tilemaps.Tile#right + * @type {number} + * @since 3.50.0 + */ + this.right; + + /** + * The bottom of the tile in pixels. + * + * Set in the `updatePixelXY` method. + * + * @name Phaser.Tilemaps.Tile#bottom + * @type {number} + * @since 3.50.0 + */ + this.bottom; + + /** + * The maps base width of a tile in pixels. Tiled maps support multiple tileset sizes * within one map, but they are still placed at intervals of the base tile size. * * @name Phaser.Tilemaps.Tile#baseWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.baseWidth = (baseWidth !== undefined) ? baseWidth : width; /** - * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes + * The maps base height of a tile in pixels. Tiled maps support multiple tileset sizes * within one map, but they are still placed at intervals of the base tile size. * * @name Phaser.Tilemaps.Tile#baseHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.baseHeight = (baseHeight !== undefined) ? baseHeight : height; @@ -12751,7 +18313,7 @@ var Tile = new Class({ this.collideDown = false; /** - * Whether the tile's left edge is interesting for collisions. + * Whether the tiles left edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceLeft * @type {boolean} @@ -12760,7 +18322,7 @@ var Tile = new Class({ this.faceLeft = false; /** - * Whether the tile's right edge is interesting for collisions. + * Whether the tiles right edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceRight * @type {boolean} @@ -12769,7 +18331,7 @@ var Tile = new Class({ this.faceRight = false; /** - * Whether the tile's top edge is interesting for collisions. + * Whether the tiles top edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceTop * @type {boolean} @@ -12778,7 +18340,7 @@ var Tile = new Class({ this.faceTop = false; /** - * Whether the tile's bottom edge is interesting for collisions. + * Whether the tiles bottom edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceBottom * @type {boolean} @@ -12793,7 +18355,7 @@ var Tile = new Class({ * @type {function} * @since 3.0.0 */ - this.collisionCallback = null; + this.collisionCallback = undefined; /** * The context in which the collision callback will be called. @@ -12851,7 +18413,7 @@ var Tile = new Class({ * * @param {Phaser.Tilemaps.Tile} tile - The tile to copy from. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ copy: function (tile) { @@ -12880,7 +18442,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#getCollisionGroup * @since 3.0.0 * - * @return {?object} tileset + * @return {?object} The collision group for this Tile, as defined in the Tileset, or `null` if no group was defined. */ getCollisionGroup: function () { @@ -12896,7 +18458,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#getTileData * @since 3.0.0 * - * @return {?object} tileset + * @return {?object} The tile data for this Tile, as defined in the Tileset, or `null` if no data was defined. */ getTileData: function () { @@ -12912,7 +18474,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The left (x) value of this tile. */ getLeft: function (camera) { @@ -12930,7 +18492,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The right (x) value of this tile. */ getRight: function (camera) { @@ -12948,7 +18510,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The top (y) value of this tile. */ getTop: function (camera) { @@ -12971,11 +18533,12 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The bottom (y) value of this tile. */ getBottom: function (camera) { var tilemapLayer = this.tilemapLayer; + return tilemapLayer ? this.getTop(camera) + this.height * tilemapLayer.scaleY : this.getTop(camera) + this.height; @@ -12992,7 +18555,7 @@ var Tile = new Class({ * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * @param {Phaser.Geom.Rectangle} [output] - Optional Rectangle object to store the results in. * - * @return {(Phaser.Geom.Rectangle|object)} + * @return {(Phaser.Geom.Rectangle|object)} The bounds of this Tile. */ getBounds: function (camera, output) { @@ -13015,7 +18578,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The center x position of this Tile. */ getCenterX: function (camera) { @@ -13031,26 +18594,13 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The center y position of this Tile. */ getCenterY: function (camera) { return (this.getTop(camera) + this.getBottom(camera)) / 2; }, - /** - * Clean up memory. - * - * @method Phaser.Tilemaps.Tile#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.collisionCallback = undefined; - this.collisionCallbackContext = undefined; - this.properties = undefined; - }, - /** * Check for intersection with this tile. This does not factor in camera scroll, layer scale or * layer position. @@ -13063,7 +18613,7 @@ var Tile = new Class({ * @param {number} right - The right point. * @param {number} bottom - The bottom point. * - * @return {boolean} + * @return {boolean} `true` if the Tile intersects with the given dimensions, otherwise `false`. */ intersects: function (x, y, right, bottom) { @@ -13086,9 +18636,19 @@ var Tile = new Class({ */ isInteresting: function (collides, faces) { - if (collides && faces) { return (this.canCollide || this.hasInterestingFace); } - else if (collides) { return this.collides; } - else if (faces) { return this.hasInterestingFace; } + if (collides && faces) + { + return (this.canCollide || this.hasInterestingFace); + } + else if (collides) + { + return this.collides; + } + else if (faces) + { + return this.hasInterestingFace; + } + return false; }, @@ -13100,7 +18660,7 @@ var Tile = new Class({ * * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ resetCollision: function (recalculateFaces) { @@ -13135,7 +18695,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#resetFaces * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ resetFaces: function () { @@ -13157,10 +18717,9 @@ var Tile = new Class({ * @param {boolean} [right] - Indicating collide with any object on the right. * @param {boolean} [up] - Indicating collide with any object on the top. * @param {boolean} [down] - Indicating collide with any object on the bottom. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces - * for this tile and its neighbors. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setCollision: function (left, right, up, down, recalculateFaces) { @@ -13202,7 +18761,7 @@ var Tile = new Class({ * @param {function} callback - Callback function. * @param {object} context - Callback will be called within this context. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setCollisionCallback: function (callback, context) { @@ -13226,12 +18785,12 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#setSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tile in pixels. - * @param {integer} tileHeight - The height of the tile in pixels. - * @param {integer} baseWidth - The base width a tile in the map (in pixels). - * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). + * @param {number} tileWidth - The width of the tile in pixels. + * @param {number} tileHeight - The height of the tile in pixels. + * @param {number} baseWidth - The base width a tile in the map (in pixels). + * @param {number} baseHeight - The base height of the tile in pixels (in pixels). * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setSize: function (tileWidth, tileHeight, baseWidth, baseHeight) { @@ -13246,26 +18805,67 @@ var Tile = new Class({ }, /** - * Used internally. Updates the tile's world XY position based on the current tile size. + * Used internally. Updates the tiles world XY position based on the current tile size. * * @method Phaser.Tilemaps.Tile#updatePixelXY * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ updatePixelXY: function () { - // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the - // bottom left, while the Phaser renderer assumes the origin is the top left. The y - // coordinate needs to be adjusted by the difference. - this.pixelX = this.x * this.baseWidth; - this.pixelY = this.y * this.baseHeight; + var orientation = this.layer.orientation; - // this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight); + if (orientation === CONST.ORTHOGONAL) + { + // In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the + // bottom left, while the Phaser renderer assumes the origin is the top left. The y + // coordinate needs to be adjusted by the difference. + + this.pixelX = this.x * this.baseWidth; + this.pixelY = this.y * this.baseHeight; + } + else if (orientation === CONST.ISOMETRIC) + { + // Reminder: For the tilemap to be centered we have to move the image to the right with the camera! + // This is crucial for wordtotile, tiletoworld to work. + + this.pixelX = (this.x - this.y) * this.baseWidth * 0.5; + this.pixelY = (this.x + this.y) * this.baseHeight * 0.5; + } + else if (orientation === CONST.STAGGERED) + { + this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2); + this.pixelY = this.y * (this.baseHeight / 2); + } + else if (orientation === CONST.HEXAGONAL) + { + var len = this.layer.hexSideLength; + var rowHeight = ((this.baseHeight - len) / 2 + len); + + this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2); + this.pixelY = this.y * rowHeight; + } + + this.right = this.pixelX + this.baseWidth; + this.bottom = this.pixelY + this.baseHeight; return this; }, + /** + * Clean up memory. + * + * @method Phaser.Tilemaps.Tile#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.collisionCallback = undefined; + this.collisionCallbackContext = undefined; + this.properties = undefined; + }, + /** * True if this tile can collide on any of its faces or has a collision callback set. * @@ -13275,10 +18875,12 @@ var Tile = new Class({ * @since 3.0.0 */ canCollide: { + get: function () { - return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); + return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || (this.collisionCallback !== undefined)); } + }, /** @@ -13290,10 +18892,12 @@ var Tile = new Class({ * @since 3.0.0 */ collides: { + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); } + }, /** @@ -13305,16 +18909,18 @@ var Tile = new Class({ * @since 3.0.0 */ hasInterestingFace: { + get: function () { return (this.faceTop || this.faceBottom || this.faceLeft || this.faceRight); } + }, /** * The tileset that contains this Tile. This is null if accessed from a LayerData instance - * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has - * an index that doesn't correspond to any of the map's tilesets. + * before the tile is placed in a TilemapLayer, or if the tile has an index that doesn't correspond + * to any of the maps tilesets. * * @name Phaser.Tilemaps.Tile#tileset * @type {?Phaser.Tilemaps.Tileset} @@ -13344,24 +18950,25 @@ var Tile = new Class({ /** * The tilemap layer that contains this Tile. This will only return null if accessed from a - * LayerData instance before the tile is placed within a StaticTilemapLayer or - * DynamicTilemapLayer. + * LayerData instance before the tile is placed within a TilemapLayer. * * @name Phaser.Tilemaps.Tile#tilemapLayer - * @type {?Phaser.Tilemaps.StaticTilemapLayer|Phaser.Tilemaps.DynamicTilemapLayer} + * @type {?Phaser.Tilemaps.TilemapLayer} * @readonly * @since 3.0.0 */ tilemapLayer: { + get: function () { return this.layer.tilemapLayer; } + }, /** * The tilemap that contains this Tile. This will only return null if accessed from a LayerData - * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer. + * instance before the tile is placed within a TilemapLayer. * * @name Phaser.Tilemaps.Tile#tilemap * @type {?Phaser.Tilemaps.Tilemap} @@ -13369,11 +18976,14 @@ var Tile = new Class({ * @since 3.0.0 */ tilemap: { + get: function () { var tilemapLayer = this.tilemapLayer; + return tilemapLayer ? tilemapLayer.tilemap : null; } + } }); @@ -13382,8 +18992,8 @@ module.exports = Tile; /***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { +/* 82 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -13391,481 +19001,94 @@ module.exports = Tile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AnimationState = __webpack_require__(157); -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var SpriteRender = __webpack_require__(991); - -/** - * @classdesc - * A Sprite Game Object. - * - * A Sprite Game Object is used for the display of both static and animated images in your game. - * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled - * and animated. - * - * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. - * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation - * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. - * - * @class Sprite - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Alpha - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Flip - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Size - * @extends Phaser.GameObjects.Components.TextureCrop - * @extends Phaser.GameObjects.Components.Tint - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Sprite = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Alpha, - Components.BlendMode, - Components.Depth, - Components.Flip, - Components.GetBounds, - Components.Mask, - Components.Origin, - Components.Pipeline, - Components.ScrollFactor, - Components.Size, - Components.TextureCrop, - Components.Tint, - Components.Transform, - Components.Visible, - SpriteRender - ], - - initialize: - - function Sprite (scene, x, y, texture, frame) - { - GameObject.call(this, scene, 'Sprite'); - - /** - * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. - * - * @name Phaser.GameObjects.Sprite#_crop - * @type {object} - * @private - * @since 3.11.0 - */ - this._crop = this.resetCropObject(); - - /** - * The Animation State component of this Sprite. - * - * This component provides features to apply animations to this Sprite. - * It is responsible for playing, loading, queuing animations for later playback, - * mixing between animations and setting the current animation frame to this Sprite. - * - * @name Phaser.GameObjects.Sprite#anims - * @type {Phaser.Animations.AnimationState} - * @since 3.0.0 - */ - this.anims = new AnimationState(this); - - this.setTexture(texture, frame); - this.setPosition(x, y); - this.setSizeToFrame(); - this.setOriginFromFrame(); - this.initPipeline(); - - this.on(GameObjectEvents.ADDED_TO_SCENE, this.addedToScene, this); - this.on(GameObjectEvents.REMOVED_FROM_SCENE, this.removedFromScene, this); - }, - - // Overrides Game Object method - addedToScene: function () - { - this.scene.sys.updateList.add(this); - }, - - // Overrides Game Object method - removedFromScene: function () - { - this.scene.sys.updateList.remove(this); - }, +var PIPELINE_CONST = { /** - * Update this Sprite's animations. + * The Bitmap Mask Pipeline. * - * @method Phaser.GameObjects.Sprite#preUpdate - * @protected - * @since 3.0.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - preUpdate: function (time, delta) - { - this.anims.update(time, delta); - }, - - /** - * Start playing the given animation on this Sprite. - * - * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * - * The benefit of a global animation is that multiple Sprites can all play the same animation, without - * having to duplicate the data. You can just create it once and then play it on any Sprite. - * - * The following code shows how to create a global repeating animation. The animation will be created - * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * - * ```javascript - * var config = { - * key: 'run', - * frames: 'muybridge', - * frameRate: 15, - * repeat: -1 - * }; - * - * // This code should be run from within a Scene: - * this.anims.create(config); - * ``` - * - * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, - * you can call the `Animation.create` method instead. It accepts the exact same parameters as when - * creating a global animation, however the resulting data is kept locally in this Sprite. - * - * With the animation created, either globally or locally, you can now play it on this Sprite: - * - * ```javascript - * this.add.sprite(x, y).play('run'); - * ``` - * - * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config - * object instead: - * - * ```javascript - * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); - * ``` - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * If you need a Sprite to be able to play both local and global animations, make sure they don't - * have conflicting keys. - * - * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * - * Also, see the documentation in the Animation Manager for further details on creating animations. - * - * @method Phaser.GameObjects.Sprite#play - * @fires Phaser.Animations.Events#ANIMATION_START - * @since 3.0.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * - * @return {this} This Game Object. - */ - play: function (key, ignoreIfPlaying) - { - return this.anims.play(key, ignoreIfPlaying); - }, - - /** - * Start playing the given animation on this Sprite, in reverse. - * - * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * - * The benefit of a global animation is that multiple Sprites can all play the same animation, without - * having to duplicate the data. You can just create it once and then play it on any Sprite. - * - * The following code shows how to create a global repeating animation. The animation will be created - * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * - * ```javascript - * var config = { - * key: 'run', - * frames: 'muybridge', - * frameRate: 15, - * repeat: -1 - * }; - * - * // This code should be run from within a Scene: - * this.anims.create(config); - * ``` - * - * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, - * you can call the `Animation.create` method instead. It accepts the exact same parameters as when - * creating a global animation, however the resulting data is kept locally in this Sprite. - * - * With the animation created, either globally or locally, you can now play it on this Sprite: - * - * ```javascript - * this.add.sprite(x, y).playReverse('run'); - * ``` - * - * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config - * object instead: - * - * ```javascript - * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); - * ``` - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * If you need a Sprite to be able to play both local and global animations, make sure they don't - * have conflicting keys. - * - * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * - * Also, see the documentation in the Animation Manager for further details on creating animations. - * - * @method Phaser.GameObjects.Sprite#playReverse - * @fires Phaser.Animations.Events#ANIMATION_START + * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * - * @return {this} This Game Object. */ - playReverse: function (key, ignoreIfPlaying) - { - return this.anims.playReverse(key, ignoreIfPlaying); - }, + BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', /** - * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * The Light 2D Pipeline. * - * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. - * - * If an animation is already running and a new animation is given to this method, it will wait for - * the given delay before starting the new animation. - * - * If no animation is currently running, the given one begins after the delay. - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * Prior to Phaser 3.50 this method was called 'delayedPlay'. - * - * @method Phaser.GameObjects.Components.Animation#playAfterDelay - * @fires Phaser.Animations.Events#ANIMATION_START + * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. - * - * @return {this} This Game Object. */ - playAfterDelay: function (key, delay) - { - return this.anims.playAfterDelay(key, delay); - }, + LIGHT_PIPELINE: 'Light2D', /** - * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback - * of the given animation. + * The Single Texture Pipeline. * - * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an - * idle animation to a walking animation, by making them blend smoothly into each other. - * - * If no animation is currently running, the given one will start immediately. - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * @method Phaser.GameObjects.Components.Animation#playAfterRepeat - * @fires Phaser.Animations.Events#ANIMATION_START + * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? - * - * @return {this} This Game Object. */ - playAfterRepeat: function (key, repeatCount) - { - return this.anims.playAfterRepeat(key, repeatCount); - }, + SINGLE_PIPELINE: 'SinglePipeline', /** - * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. + * The Multi Texture Pipeline. * - * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, - * or have the `stop` method called directly on it. - * - * An animation set to repeat forever will never enter a completed state. - * - * You can chain a new animation at any point, including before the current one starts playing, during it, - * or when it ends (via its `animationcomplete` event). - * - * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained - * animations without impacting the animation they're playing. - * - * Call this method with no arguments to reset all currently chained animations. - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * @method Phaser.GameObjects.Sprite#chain + * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. - * - * @return {this} This Game Object. */ - chain: function (key) - { - return this.anims.chain(key); - }, + MULTI_PIPELINE: 'MultiPipeline', /** - * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. + * The Rope Pipeline. * - * If no animation is playing, no event will be dispatched. - * - * If there is another animation queued (via the `chain` method) then it will start playing immediately. - * - * @method Phaser.GameObjects.Sprite#stop - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @return {this} This Game Object. */ - stop: function () - { - return this.anims.stop(); - }, + ROPE_PIPELINE: 'RopePipeline', /** - * Stops the current animation from playing after the specified time delay, given in milliseconds. + * The Graphics and Shapes Pipeline. * - * It then dispatches the `ANIMATION_STOP` event. - * - * If no animation is running, no events will be dispatched. - * - * If there is another animation in the queue (set via the `chain` method) then it will start playing, - * when the current one stops. - * - * @method Phaser.GameObjects.Sprite#stopAfterDelay - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.GRAPHICS_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. - * - * @return {this} This Game Object. */ - stopAfterDelay: function (delay) - { - return this.anims.stopAfterDelay(delay); - }, + GRAPHICS_PIPELINE: 'GraphicsPipeline', /** - * Stops the current animation from playing after the given number of repeats. + * The Post FX Pipeline. * - * It then dispatches the `ANIMATION_STOP` event. - * - * If no animation is running, no events will be dispatched. - * - * If there is another animation in the queue (set via the `chain` method) then it will start playing, - * when the current one stops. - * - * @method Phaser.GameObjects.Sprite#stopAfterRepeat - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.POSTFX_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? - * - * @return {this} This Game Object. */ - stopAfterRepeat: function (repeatCount) - { - return this.anims.stopAfterRepeat(repeatCount); - }, + POSTFX_PIPELINE: 'PostFXPipeline', /** - * Stops the current animation from playing when it next sets the given frame. - * If this frame doesn't exist within the animation it will not stop it from playing. + * The Utility Pipeline. * - * It then dispatches the `ANIMATION_STOP` event. - * - * If no animation is running, no events will be dispatched. - * - * If there is another animation in the queue (set via the `chain` method) then it will start playing, - * when the current one stops. - * - * @method Phaser.GameObjects.Sprite#stopOnFrame - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.UTILITY_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. - * - * @return {this} This Game Object. */ - stopOnFrame: function (frame) - { - return this.anims.stopOnFrame(frame); - }, + UTILITY_PIPELINE: 'UtilityPipeline' +}; - /** - * Build a JSON representation of this Sprite. - * - * @method Phaser.GameObjects.Sprite#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ - toJSON: function () - { - return Components.ToJSON(this); - }, - - /** - * Handles the pre-destroy step for the Sprite, which removes the Animation component. - * - * @method Phaser.GameObjects.Sprite#preDestroy - * @private - * @since 3.14.0 - */ - preDestroy: function () - { - this.anims.destroy(); - - this.anims = undefined; - } - -}); - -module.exports = Sprite; +module.exports = PIPELINE_CONST; /***/ }), -/* 77 */ +/* 83 */ /***/ (function(module, exports) { /** @@ -13893,7 +19116,7 @@ module.exports = GetCenterX; /***/ }), -/* 78 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -13928,7 +19151,7 @@ module.exports = SetCenterX; /***/ }), -/* 79 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -13956,7 +19179,7 @@ module.exports = GetCenterY; /***/ }), -/* 80 */ +/* 86 */ /***/ (function(module, exports) { /** @@ -13991,7 +19214,7 @@ module.exports = SetCenterY; /***/ }), -/* 81 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14000,854 +19223,87 @@ module.exports = SetCenterY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); +var SpliceOne = __webpack_require__(103); /** - * @classdesc - * A representation of a vector in 3D space. + * Removes the given item, or array of items, from the array. * - * A three-component vector. + * The array is modified in-place. * - * @class Vector3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 + * You can optionally specify a callback to be invoked for each item successfully removed from the array. * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. + * @function Phaser.Utils.Array.Remove + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. + * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. */ -var Vector3 = new Class({ - - initialize: - - function Vector3 (x, y, z) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - }, - - /** - * Set this Vector to point up. - * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. - */ - clone: function () - { - return new Vector3(this.x, this.y, this.z); - }, - - /** - * Calculate the cross (vector) product of two given Vectors. - * - * @method Phaser.Math.Vector3#crossVectors - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - crossVectors: function (a, b) - { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. - * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - - return this; - }, - - /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. - * - * @method Phaser.Math.Vector3#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - set: function (x, y, z) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - } - else - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - - return this; - }, - - /** - * Negate the `x`, `y` and `z` components of this Vector. - * - * @method Phaser.Math.Vector3#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. - * - * @return {number} The dot product of this Vector and `v`. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z; - }, - - /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. - * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - cross: function (v) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; - } - -}); - -/** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ZERO = new Vector3(); - -/** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.RIGHT = new Vector3(1, 0, 0); - -/** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.LEFT = new Vector3(-1, 0, 0); - -/** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.UP = new Vector3(0, -1, 0); - -/** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.DOWN = new Vector3(0, 1, 0); - -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Removes a single item from an array and returns it without creating gc, like the native splice does. - * Based on code by Mike Reinstein. - * - * @function Phaser.Utils.Array.SpliceOne - * @since 3.0.0 - * - * @param {array} array - The array to splice from. - * @param {integer} index - The index of the item which should be spliced. - * - * @return {*} The item which was spliced (removed). - */ -var SpliceOne = function (array, index) +var Remove = function (array, item, callback, context) { - if (index >= array.length) + if (context === undefined) { context = array; } + + var index; + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) { - return; + index = array.indexOf(item); + + if (index !== -1) + { + SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } } - var len = array.length - 1; + // If we got this far, we have an array of items to remove - var item = array[index]; + var itemLength = item.length - 1; + var removed = []; - for (var i = index; i < len; i++) + while (itemLength >= 0) { - array[i] = array[i + 1]; + var entry = item[itemLength]; + + index = array.indexOf(entry); + + if (index !== -1) + { + SpliceOne(array, index); + + removed.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + itemLength--; } - array.length = len; - - return item; + return removed; }; -module.exports = SpliceOne; +module.exports = Remove; /***/ }), -/* 83 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14857,7 +19313,7 @@ module.exports = SpliceOne; */ var Class = __webpack_require__(0); -var FromPoints = __webpack_require__(186); +var FromPoints = __webpack_require__(191); var Rectangle = __webpack_require__(9); var Vector2 = __webpack_require__(3); @@ -14893,7 +19349,7 @@ var Curve = new Class({ * The default number of divisions within the curve. * * @name Phaser.Curves.Curve#defaultDivisions - * @type {integer} + * @type {number} * @default 5 * @since 3.0.0 */ @@ -14903,7 +19359,7 @@ var Curve = new Class({ * The quantity of arc length divisions within the curve. * * @name Phaser.Curves.Curve#arcLengthDivisions - * @type {integer} + * @type {number} * @default 100 * @since 3.0.0 */ @@ -14972,7 +19428,7 @@ var Curve = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn. - * @param {integer} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. + * @param {number} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. * * @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn. */ @@ -14994,7 +19450,7 @@ var Curve = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. If falsey a new object will be created. - * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. + * @param {number} [accuracy=16] - The accuracy of the bounds calculations. * * @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object. */ @@ -15025,7 +19481,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getDistancePoints * @since 3.0.0 * - * @param {integer} distance - The distance, in pixels, between each point along the curve. + * @param {number} distance - The distance, in pixels, between each point along the curve. * * @return {Phaser.Geom.Point[]} An Array of Point objects. */ @@ -15085,7 +19541,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getLengths * @since 3.0.0 * - * @param {integer} [divisions] - The number of divisions or segments. + * @param {number} [divisions] - The number of divisions or segments. * * @return {number[]} An array of cumulative lengths. */ @@ -15167,7 +19623,7 @@ var Curve = new Class({ * * @generic {Phaser.Math.Vector2[]} O - [out,$return] * - * @param {integer} [divisions] - The number of divisions to make. + * @param {number} [divisions] - The number of divisions to make. * @param {number} [stepRate] - The curve distance between points, implying `divisions`. * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in. * @@ -15227,7 +19683,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getSpacedPoints * @since 3.0.0 * - * @param {integer} [divisions=this.defaultDivisions] - The number of divisions to make. + * @param {number} [divisions=this.defaultDivisions] - The number of divisions to make. * @param {number} [stepRate] - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in. * @@ -15347,8 +19803,8 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getTFromDistance * @since 3.0.0 * - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The distance. */ @@ -15369,8 +19825,8 @@ var Curve = new Class({ * @since 3.0.0 * * @param {number} u - A float between 0 and 1. - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The equidistant value. */ @@ -15464,7 +19920,7 @@ module.exports = Curve; /***/ }), -/* 84 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15479,75 +19935,198 @@ module.exports = Curve; module.exports = { - ADD: __webpack_require__(898), - COMPLETE: __webpack_require__(899), - FILE_COMPLETE: __webpack_require__(900), - FILE_KEY_COMPLETE: __webpack_require__(901), - FILE_LOAD_ERROR: __webpack_require__(902), - FILE_LOAD: __webpack_require__(903), - FILE_PROGRESS: __webpack_require__(904), - POST_PROCESS: __webpack_require__(905), - PROGRESS: __webpack_require__(906), - START: __webpack_require__(907) + ADD: __webpack_require__(954), + COMPLETE: __webpack_require__(955), + FILE_COMPLETE: __webpack_require__(956), + FILE_KEY_COMPLETE: __webpack_require__(957), + FILE_LOAD_ERROR: __webpack_require__(958), + FILE_LOAD: __webpack_require__(959), + FILE_PROGRESS: __webpack_require__(960), + POST_PROCESS: __webpack_require__(961), + PROGRESS: __webpack_require__(962), + START: __webpack_require__(963) }; /***/ }), -/* 85 */ +/* 90 */ /***/ (function(module, exports) { /** * @author Richard Davey + * @author Angry Bytes (and contributors) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// http://www.blackpawn.com/texts/pointinpoly/ +/** + * The comparator function. + * + * @ignore + * + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. + * + * @return {boolean} True if they localCompare, otherwise false. + */ +function Compare (a, b) +{ + return String(a).localeCompare(b); +} /** - * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * Process the array contents. * - * @function Phaser.Geom.Triangle.Contains + * @ignore + * + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. + * + * @return {array} - The processed array. + */ +function Process (array, compare) +{ + // Short-circuit when there's nothing to sort. + var len = array.length; + + if (len <= 1) + { + return array; + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + + buffer = tmp; + } + + return array; +} + +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ + var len = arr.length; + var i = 0; + + // Step size / double chunk size. + var dbl = chk * 2; + + // Bounds of the left and right chunks. + var l, r, e; + + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) + { + r = l + chk; + e = r + chk; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } + + // Iterate both chunks in parallel. + li = l; + ri = r; + + while (true) + { + // Compare the chunks. + if (li < r && ri < e) + { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) + { + result[i++] = arr[li++]; + } + else + { + result[i++] = arr[ri++]; + } + } + else if (li < r) + { + // Nothing to compare, just flush what's left. + result[i++] = arr[li++]; + } + else if (ri < e) + { + result[i++] = arr[ri++]; + } + else + { + // Both iterators are at the chunk ends. + break; + } + } + } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - The Triangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. * - * @return {boolean} `true` if the point is inside the Triangle, otherwise `false`. + * @return {array} The sorted result. */ -var Contains = function (triangle, x, y) +var StableSort = function (array, compare) { - var v0x = triangle.x3 - triangle.x1; - var v0y = triangle.y3 - triangle.y1; + if (compare === undefined) { compare = Compare; } - var v1x = triangle.x2 - triangle.x1; - var v1y = triangle.y2 - triangle.y1; + var result = Process(array, compare); - var v2x = x - triangle.x1; - var v2y = y - triangle.y1; + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } - var dot00 = (v0x * v0x) + (v0y * v0y); - var dot01 = (v0x * v1x) + (v0y * v1y); - var dot02 = (v0x * v2x) + (v0y * v2y); - var dot11 = (v1x * v1x) + (v1y * v1y); - var dot12 = (v1x * v2x) + (v1y * v2y); - - // Compute barycentric coordinates - var b = ((dot00 * dot11) - (dot01 * dot01)); - var inv = (b === 0) ? 0 : (1 / b); - var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; - var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; - - return (u >= 0 && v >= 0 && (u + v < 1)); + return array; }; -module.exports = Contains; +module.exports = StableSort; /***/ }), -/* 86 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15623,7 +20202,7 @@ module.exports = LineToLine; /***/ }), -/* 87 */ +/* 92 */ /***/ (function(module, exports) { /** @@ -15651,8 +20230,8 @@ module.exports = Angle; /***/ }), -/* 88 */, -/* 89 */ +/* 93 */, +/* 94 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15661,7 +20240,7 @@ module.exports = Angle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -15686,7 +20265,7 @@ module.exports = FromPercent; /***/ }), -/* 90 */ +/* 95 */ /***/ (function(module, exports) { /** @@ -15727,7 +20306,7 @@ module.exports = GetBoolean; /***/ }), -/* 91 */ +/* 96 */ /***/ (function(module, exports) { /** @@ -15742,7 +20321,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.CREATED - * @type {integer} + * @type {number} * @since 3.0.0 */ CREATED: 0, @@ -15751,7 +20330,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.INIT - * @type {integer} + * @type {number} * @since 3.0.0 */ INIT: 1, @@ -15760,7 +20339,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ DELAY: 2, @@ -15769,7 +20348,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.OFFSET_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ OFFSET_DELAY: 3, @@ -15778,7 +20357,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PENDING_RENDER - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_RENDER: 4, @@ -15787,7 +20366,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_FORWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_FORWARD: 5, @@ -15796,7 +20375,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_BACKWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_BACKWARD: 6, @@ -15805,7 +20384,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.HOLD_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ HOLD_DELAY: 7, @@ -15814,7 +20393,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.REPEAT_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ REPEAT_DELAY: 8, @@ -15823,7 +20402,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE: 9, @@ -15834,7 +20413,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_ADD - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_ADD: 20, @@ -15843,7 +20422,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PAUSED - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSED: 21, @@ -15852,7 +20431,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.LOOP_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ LOOP_DELAY: 22, @@ -15861,7 +20440,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.ACTIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ ACTIVE: 23, @@ -15870,7 +20449,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.COMPLETE_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE_DELAY: 24, @@ -15879,7 +20458,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_REMOVE - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_REMOVE: 25, @@ -15888,7 +20467,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.REMOVED - * @type {integer} + * @type {number} * @since 3.0.0 */ REMOVED: 26 @@ -15899,7 +20478,714 @@ module.exports = TWEEN_CONST; /***/ }), -/* 92 */ +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(307); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} [eventEmitter] - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once(Events.DESTROY, this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @since 3.0.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * When the value is first set, a `setdata` event is emitted. + * + * @method Phaser.Data.DataManager#inc + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.23.0 + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + inc: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (data === undefined) + { + data = 1; + } + + var value = this.get(key); + if (value === undefined) + { + value = 0; + } + + this.set(key, (value + data)); + + return this; + }, + + /** + * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * When the value is first set, a `setdata` event is emitted. + * + * @method Phaser.Data.DataManager#toggle + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.23.0 + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + toggle: function (key) + { + if (this._frozen) + { + return this; + } + + this.set(key, !this.get(key)); + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {this} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @param {*} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + * + * @return {this} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {this} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {this} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {this} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {this} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {this} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {number} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), +/* 98 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15922,7 +21208,7 @@ var Class = __webpack_require__(0); /** * @classdesc * The keys of a Map can be arbitrary values. - * + * * ```javascript * var map = new Map([ * [ 1, 'one' ], @@ -16176,7 +21462,9 @@ var Map = new Class({ }, /** - * Passes all entries in this Map to the given callback. + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. * * @method Phaser.Structs.Map#each * @since 3.0.0 @@ -16272,7 +21560,7 @@ module.exports = Map; /***/ }), -/* 93 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16283,12 +21571,12 @@ module.exports = Map; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DegToRad = __webpack_require__(41); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(42); +var DegToRad = __webpack_require__(34); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(35); var Rectangle = __webpack_require__(9); -var TransformMatrix = __webpack_require__(31); -var ValueToColor = __webpack_require__(174); +var TransformMatrix = __webpack_require__(24); +var ValueToColor = __webpack_require__(179); var Vector2 = __webpack_require__(3); /** @@ -16311,10 +21599,10 @@ var Vector2 = __webpack_require__(3); * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. - * + * * The Base Camera is extended by the Camera class, which adds in special effects including Fade, * Flash and Camera Shake, as well as the ability to follow Game Objects. - * + * * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate * to when they were added to the Camera class. @@ -16323,7 +21611,7 @@ var Vector2 = __webpack_require__(3); * @memberof Phaser.Cameras.Scene2D * @constructor * @since 3.12.0 - * + * * @extends Phaser.Events.EventEmitter * @extends Phaser.GameObjects.Components.Alpha * @extends Phaser.GameObjects.Components.Visible @@ -16394,7 +21682,7 @@ var BaseCamera = new Class({ * This value is a bitmask. * * @name Phaser.Cameras.Scene2D.BaseCamera#id - * @type {integer} + * @type {number} * @readonly * @since 3.11.0 */ @@ -16410,19 +21698,6 @@ var BaseCamera = new Class({ */ this.name = ''; - /** - * This property is un-used in v3.16. - * - * The resolution of the Game, used in most Camera calculations. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#resolution - * @type {number} - * @readonly - * @deprecated - * @since 3.12.0 - */ - this.resolution = 1; - /** * Should this camera round its pixel values to integers? * @@ -16472,9 +21747,9 @@ var BaseCamera = new Class({ /** * Is this Camera dirty? - * + * * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame. - * + * * This flag is cleared during the `postRenderCamera` method of the renderer. * * @name Phaser.Cameras.Scene2D.BaseCamera#dirty @@ -16508,46 +21783,6 @@ var BaseCamera = new Class({ */ this._y = y; - /** - * Internal Camera X value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_cx - * @type {number} - * @private - * @since 3.12.0 - */ - this._cx = 0; - - /** - * Internal Camera Y value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_cy - * @type {number} - * @private - * @since 3.12.0 - */ - this._cy = 0; - - /** - * Internal Camera Width value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_cw - * @type {number} - * @private - * @since 3.12.0 - */ - this._cw = 0; - - /** - * Internal Camera Height value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_ch - * @type {number} - * @private - * @since 3.12.0 - */ - this._ch = 0; - /** * The width of the Camera viewport, in pixels. * @@ -16621,7 +21856,7 @@ var BaseCamera = new Class({ this._scrollY = 0; /** - * The Camera zoom value. Change this value to zoom in, or out of, a Scene. + * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel @@ -16631,13 +21866,32 @@ var BaseCamera = new Class({ * * Be careful to never set this value to zero. * - * @name Phaser.Cameras.Scene2D.BaseCamera#_zoom + * @name Phaser.Cameras.Scene2D.BaseCamera#_zoomX * @type {number} * @private * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ - this._zoom = 1; + this._zoomX = 1; + + /** + * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_zoomY + * @type {number} + * @private + * @default 1 + * @since 3.50.0 + */ + this._zoomY = 1; /** * The rotation of the Camera in radians. @@ -16790,7 +22044,7 @@ var BaseCamera = new Class({ /** * The Camera that this Camera uses for translation during masking. - * + * * If the mask is fixed in position this will be a reference to * the CameraManager.default instance. Otherwise, it'll be a reference * to itself. @@ -17123,19 +22377,18 @@ var BaseCamera = new Class({ var c = Math.cos(this.rotation); var s = Math.sin(this.rotation); - var zoom = this.zoom; - var res = this.resolution; + var zoomX = this.zoomX; + var zoomY = this.zoomY; var scrollX = this.scrollX; var scrollY = this.scrollY; - // Works for zoom of 1 with any resolution, but resolution > 1 and zoom !== 1 breaks - var sx = x + ((scrollX * c - scrollY * s) * zoom); - var sy = y + ((scrollX * s + scrollY * c) * zoom); + var sx = x + ((scrollX * c - scrollY * s) * zoomX); + var sy = y + ((scrollX * s + scrollY * c) * zoomY); // Apply transform to point - output.x = (sx * ima + sy * imc) * res + ime; - output.y = (sx * imb + sy * imd) * res + imf; + output.x = (sx * ima + sy * imc) + ime; + output.y = (sx * imb + sy * imd) + imf; return output; }, @@ -17187,10 +22440,8 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#preRender * @protected * @since 3.0.0 - * - * @param {number} resolution - The game resolution, as set in the Scale Manager. */ - preRender: function (resolution) + preRender: function () { var width = this.width; var height = this.height; @@ -17198,7 +22449,8 @@ var BaseCamera = new Class({ var halfWidth = width * 0.5; var halfHeight = height * 0.5; - var zoom = this.zoom * resolution; + var zoomX = this.zoomX; + var zoomY = this.zoomY; var matrix = this.matrix; var originX = width * this.originX; @@ -17230,8 +22482,8 @@ var BaseCamera = new Class({ // Basically the pixel value of what it's looking at in the middle of the cam this.midPoint.set(midX, midY); - var displayWidth = width / zoom; - var displayHeight = height / zoom; + var displayWidth = width / zoomX; + var displayHeight = height / zoomY; this.worldView.setTo( midX - (displayWidth / 2), @@ -17240,7 +22492,7 @@ var BaseCamera = new Class({ displayHeight ); - matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); + matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoomX, zoomY); matrix.translate(-originX, -originY); }, @@ -17381,15 +22633,15 @@ var BaseCamera = new Class({ /** * Set the bounds of the Camera. The bounds are an axis-aligned rectangle. - * + * * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the * edges and into blank space. It does not limit the placement of Game Objects, or where * the Camera viewport can be positioned. - * + * * Temporarily disable the bounds by changing the boolean `Camera.useBounds`. - * + * * Clear the bounds entirely by calling `Camera.removeBounds`. - * + * * If you set bounds that are smaller than the viewport it will stop the Camera from being * able to scroll. The bounds can be positioned where-ever you wish. By default they are from * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of @@ -17401,10 +22653,10 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#setBounds * @since 3.0.0 * - * @param {integer} x - The top-left x coordinate of the bounds. - * @param {integer} y - The top-left y coordinate of the bounds. - * @param {integer} width - The width of the bounds, in pixels. - * @param {integer} height - The height of the bounds, in pixels. + * @param {number} x - The top-left x coordinate of the bounds. + * @param {number} y - The top-left y coordinate of the bounds. + * @param {number} width - The width of the bounds, in pixels. + * @param {number} height - The height of the bounds, in pixels. * @param {boolean} [centerOn=false] - If `true` the Camera will automatically be centered on the new bounds. * * @return {this} This Camera instance. @@ -17433,9 +22685,9 @@ var BaseCamera = new Class({ /** * Returns a rectangle containing the bounds of the Camera. - * + * * If the Camera does not have any bounds the rectangle will be empty. - * + * * The rectangle is a copy of the bounds, so is safe to modify. * * @method Phaser.Cameras.Scene2D.BaseCamera#getBounds @@ -17522,7 +22774,7 @@ var BaseCamera = new Class({ /** * Should the Camera round pixel values to whole integers when rendering Game Objects? - * + * * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing. * * @method Phaser.Cameras.Scene2D.BaseCamera#setRoundPixels @@ -17541,8 +22793,6 @@ var BaseCamera = new Class({ /** * Sets the Scene the Camera is bound to. - * - * Also populates the `resolution` property and updates the internal size values. * * @method Phaser.Cameras.Scene2D.BaseCamera#setScene * @since 3.0.0 @@ -17566,15 +22816,6 @@ var BaseCamera = new Class({ this.scaleManager = sys.scale; this.cameraManager = sys.cameras; - var res = this.scaleManager.resolution; - - this.resolution = res; - - this._cx = this._x * res; - this._cy = this._y * res; - this._cw = this._width * res; - this._ch = this._height * res; - this.updateSystem(); return this; @@ -17615,8 +22856,8 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#setSize * @since 3.0.0 * - * @param {integer} width - The width of the Camera viewport. - * @param {integer} [height=width] - The height of the Camera viewport. + * @param {number} width - The width of the Camera viewport. + * @param {number} [height=width] - The height of the Camera viewport. * * @return {this} This Camera instance. */ @@ -17646,8 +22887,8 @@ var BaseCamera = new Class({ * * @param {number} x - The top-left x coordinate of the Camera viewport. * @param {number} y - The top-left y coordinate of the Camera viewport. - * @param {integer} width - The width of the Camera viewport. - * @param {integer} [height=width] - The height of the Camera viewport. + * @param {number} width - The width of the Camera viewport. + * @param {number} [height=width] - The height of the Camera viewport. * * @return {this} This Camera instance. */ @@ -17671,23 +22912,33 @@ var BaseCamera = new Class({ * * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. * + * As of Phaser 3.50 you can now set the horizontal and vertical zoom values independently. + * * @method Phaser.Cameras.Scene2D.BaseCamera#setZoom * @since 3.0.0 * - * @param {number} [value=1] - The zoom value of the Camera. The minimum it can be is 0.001. + * @param {number} [x=1] - The horizontal zoom value of the Camera. The minimum it can be is 0.001. + * @param {number} [y=x] - The vertical zoom value of the Camera. The minimum it can be is 0.001. * * @return {this} This Camera instance. */ - setZoom: function (value) + setZoom: function (x, y) { - if (value === undefined) { value = 1; } + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } - if (value === 0) + if (x === 0) { - value = 0.001; + x = 0.001; } - this.zoom = value; + if (y === 0) + { + y = 0.001; + } + + this.zoomX = x; + this.zoomY = y; return this; }, @@ -17696,14 +22947,14 @@ var BaseCamera = new Class({ * Sets the mask to be applied to this Camera during rendering. * * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. - * + * * Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Camera it will be immediately replaced. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. - * + * * Note: You cannot mask a Camera that has `renderToTexture` set. * * @method Phaser.Cameras.Scene2D.BaseCamera#setMask @@ -17806,7 +23057,7 @@ var BaseCamera = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function () @@ -17850,9 +23101,9 @@ var BaseCamera = new Class({ /** * Destroys this Camera instance and its internal properties and references. * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager. - * + * * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default. - * + * * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction, * rather than calling this method directly. * @@ -17903,7 +23154,6 @@ var BaseCamera = new Class({ set: function (value) { this._x = value; - this._cx = value * this.resolution; this.updateSystem(); } @@ -17928,7 +23178,6 @@ var BaseCamera = new Class({ set: function (value) { this._y = value; - this._cy = value * this.resolution; this.updateSystem(); } @@ -17954,7 +23203,6 @@ var BaseCamera = new Class({ set: function (value) { this._width = value; - this._cw = value * this.resolution; this.updateSystem(); } @@ -17980,7 +23228,6 @@ var BaseCamera = new Class({ set: function (value) { this._height = value; - this._ch = value * this.resolution; this.updateSystem(); } @@ -18066,12 +23313,76 @@ var BaseCamera = new Class({ get: function () { - return this._zoom; + return (this._zoomX + this._zoomY) / 2; }, set: function (value) { - this._zoom = value; + this._zoomX = value; + this._zoomY = value; + + this.dirty = true; + } + + }, + + /** + * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#zoomX + * @type {number} + * @default 1 + * @since 3.50.0 + */ + zoomX: { + + get: function () + { + return this._zoomX; + }, + + set: function (value) + { + this._zoomX = value; + this.dirty = true; + } + + }, + + /** + * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#zoomY + * @type {number} + * @default 1 + * @since 3.50.0 + */ + zoomY: { + + get: function () + { + return this._zoomY; + }, + + set: function (value) + { + this._zoomY = value; this.dirty = true; } @@ -18159,7 +23470,7 @@ var BaseCamera = new Class({ get: function () { - return this.width / this.zoom; + return this.width / this.zoomX; } }, @@ -18182,7 +23493,7 @@ var BaseCamera = new Class({ get: function () { - return this.height / this.zoom; + return this.height / this.zoomY; } } @@ -18193,7 +23504,37 @@ module.exports = BaseCamera; /***/ }), -/* 94 */ +/* 100 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given 3 separate color values this will return an integer representation of it. + * + * @function Phaser.Display.Color.GetColor + * @since 3.0.0 + * + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * + * @return {number} The combined color value. + */ +var GetColor = function (red, green, blue) +{ + return red << 16 | green << 8 | blue; +}; + +module.exports = GetColor; + + +/***/ }), +/* 101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18208,18 +23549,203 @@ module.exports = BaseCamera; module.exports = { - ENTER_FULLSCREEN: __webpack_require__(727), - FULLSCREEN_FAILED: __webpack_require__(728), - FULLSCREEN_UNSUPPORTED: __webpack_require__(729), - LEAVE_FULLSCREEN: __webpack_require__(730), - ORIENTATION_CHANGE: __webpack_require__(731), - RESIZE: __webpack_require__(732) + ENTER_FULLSCREEN: __webpack_require__(768), + FULLSCREEN_FAILED: __webpack_require__(769), + FULLSCREEN_UNSUPPORTED: __webpack_require__(770), + LEAVE_FULLSCREEN: __webpack_require__(771), + ORIENTATION_CHANGE: __webpack_require__(772), + RESIZE: __webpack_require__(773) }; /***/ }), -/* 95 */ +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. + * + * @typedef {object} Phaser.Device.OS + * @since 3.0.0 + * + * @property {boolean} android - Is running on android? + * @property {boolean} chromeOS - Is running on chromeOS? + * @property {boolean} cordova - Is the game running under Apache Cordova? + * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? + * @property {boolean} desktop - Is running on a desktop? + * @property {boolean} ejecta - Is the game running under Ejecta? + * @property {boolean} electron - Is the game running under GitHub Electron? + * @property {boolean} iOS - Is running on iOS? + * @property {boolean} iPad - Is running on iPad? + * @property {boolean} iPhone - Is running on iPhone? + * @property {boolean} kindle - Is running on an Amazon Kindle? + * @property {boolean} linux - Is running on linux? + * @property {boolean} macOS - Is running on macOS? + * @property {boolean} node - Is the game running under Node.js? + * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? + * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView + * @property {boolean} windows - Is running on windows? + * @property {boolean} windowsPhone - Is running on a Windows Phone? + * @property {number} iOSVersion - If running in iOS this will contain the major version number. + * @property {number} pixelRatio - PixelRatio of the host device? + */ +var OS = { + + android: false, + chromeOS: false, + cordova: false, + crosswalk: false, + desktop: false, + ejecta: false, + electron: false, + iOS: false, + iOSVersion: 0, + iPad: false, + iPhone: false, + kindle: false, + linux: false, + macOS: false, + node: false, + nodeWebkit: false, + pixelRatio: 1, + webApp: false, + windows: false, + windowsPhone: false + +}; + +function init () +{ + var ua = navigator.userAgent; + + if ((/Windows/).test(ua)) + { + OS.windows = true; + } + else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) + { + // Because iOS 13 identifies as Mac OS: + if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) + { + OS.iOS = true; + OS.iPad = true; + + (navigator.appVersion).match(/Version\/(\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + } + else + { + OS.macOS = true; + } + } + else if ((/Android/).test(ua)) + { + OS.android = true; + } + else if ((/Linux/).test(ua)) + { + OS.linux = true; + } + else if ((/iP[ao]d|iPhone/i).test(ua)) + { + OS.iOS = true; + + (navigator.appVersion).match(/OS (\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + + OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; + OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; + } + else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) + { + OS.kindle = true; + + // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... + // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" + } + else if ((/CrOS/).test(ua)) + { + OS.chromeOS = true; + } + + if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) + { + OS.android = false; + OS.iOS = false; + OS.macOS = false; + OS.windows = true; + OS.windowsPhone = true; + } + + var silk = (/Silk/).test(ua); + + if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) + { + OS.desktop = true; + } + + // Windows Phone / Table reset + if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) + { + OS.desktop = false; + } + + // WebApp mode in iOS + if (navigator.standalone) + { + OS.webApp = true; + } + + if (window.cordova !== undefined) + { + OS.cordova = true; + } + + if (typeof process !== 'undefined' && process.versions && process.versions.node) + { + OS.node = true; + } + + if (OS.node && typeof process.versions === 'object') + { + OS.nodeWebkit = !!process.versions['node-webkit']; + + OS.electron = !!process.versions.electron; + } + + if (window.ejecta !== undefined) + { + OS.ejecta = true; + } + + if ((/Crosswalk/).test(ua)) + { + OS.crosswalk = true; + } + + OS.pixelRatio = window['devicePixelRatio'] || 1; + + return OS; +} + +module.exports = init(); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(796))) + +/***/ }), +/* 103 */ /***/ (function(module, exports) { /** @@ -18229,132 +23755,43 @@ module.exports = { */ /** - * Snap a value to nearest grid slice, using floor. + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. - * As will `14` snap to `10`... but `16` will snap to `15`. - * - * @function Phaser.Math.Snap.Floor + * @function Phaser.Utils.Array.SpliceOne * @since 3.0.0 * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * @param {array} array - The array to splice from. + * @param {number} index - The index of the item which should be spliced. * - * @return {number} The snapped value. + * @return {*} The item which was spliced (removed). */ -var SnapFloor = function (value, gap, start, divide) +var SpliceOne = function (array, index) { - if (start === undefined) { start = 0; } - - if (gap === 0) + if (index >= array.length) { - return value; + return; } - value -= start; - value = gap * Math.floor(value / gap); + var len = array.length - 1; - return (divide) ? (start + value) / gap : start + value; -}; + var item = array[index]; -module.exports = SnapFloor; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(82); - -/** - * Removes the given item, or array of items, from the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for each item successfully removed from the array. - * - * @function Phaser.Utils.Array.Remove - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. - * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. - */ -var Remove = function (array, item, callback, context) -{ - if (context === undefined) { context = array; } - - var index; - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) + for (var i = index; i < len; i++) { - index = array.indexOf(item); - - if (index !== -1) - { - SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } + array[i] = array[i + 1]; } - // If we got this far, we have an array of items to remove - - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - var entry = item[itemLength]; - - index = array.indexOf(entry); - - if (index !== -1) - { - SpliceOne(array, index); - - if (callback) - { - callback.call(context, entry); - } - } - else - { - // Item wasn't found in the array, so remove it from our return results - item.pop(); - } - - itemLength--; - } + array.length = len; return item; }; -module.exports = Remove; +module.exports = SpliceOne; /***/ }), -/* 97 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18364,8 +23801,8 @@ module.exports = Remove; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); -var Extend = __webpack_require__(19); +var Clamp = __webpack_require__(16); +var Extend = __webpack_require__(18); /** * @classdesc @@ -18377,8 +23814,8 @@ var Extend = __webpack_require__(19); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. * @param {number} width - The width of this Frame. @@ -18422,7 +23859,7 @@ var Frame = new Class({ * The index of the TextureSource in the Texture sources array. * * @name Phaser.Textures.Frame#sourceIndex - * @type {integer} + * @type {number} * @since 3.0.0 */ this.sourceIndex = sourceIndex; @@ -18441,7 +23878,7 @@ var Frame = new Class({ * X position within the source image to cut from. * * @name Phaser.Textures.Frame#cutX - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutX; @@ -18450,7 +23887,7 @@ var Frame = new Class({ * Y position within the source image to cut from. * * @name Phaser.Textures.Frame#cutY - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutY; @@ -18459,7 +23896,7 @@ var Frame = new Class({ * The width of the area in the source image to cut. * * @name Phaser.Textures.Frame#cutWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutWidth; @@ -18468,7 +23905,7 @@ var Frame = new Class({ * The height of the area in the source image to cut. * * @name Phaser.Textures.Frame#cutHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutHeight; @@ -18477,7 +23914,7 @@ var Frame = new Class({ * The X rendering offset of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#x - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -18487,7 +23924,7 @@ var Frame = new Class({ * The Y rendering offset of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#y - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -18497,7 +23934,7 @@ var Frame = new Class({ * The rendering width of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width; @@ -18506,7 +23943,7 @@ var Frame = new Class({ * The rendering height of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height; @@ -18516,7 +23953,7 @@ var Frame = new Class({ * Precalculated for the renderer. * * @name Phaser.Textures.Frame#halfWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.halfWidth; @@ -18526,7 +23963,7 @@ var Frame = new Class({ * Precalculated for the renderer. * * @name Phaser.Textures.Frame#halfHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.halfHeight; @@ -18535,7 +23972,7 @@ var Frame = new Class({ * The x center of this frame, floored. * * @name Phaser.Textures.Frame#centerX - * @type {integer} + * @type {number} * @since 3.0.0 */ this.centerX; @@ -18544,7 +23981,7 @@ var Frame = new Class({ * The y center of this frame, floored. * * @name Phaser.Textures.Frame#centerY - * @type {integer} + * @type {number} * @since 3.0.0 */ this.centerY; @@ -18600,7 +24037,7 @@ var Frame = new Class({ * 1 = Round * * @name Phaser.Textures.Frame#autoRound - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -18706,10 +24143,10 @@ var Frame = new Class({ * @method Phaser.Textures.Frame#setSize * @since 3.7.0 * - * @param {integer} width - The width of the frame before being trimmed. - * @param {integer} height - The height of the frame before being trimmed. - * @param {integer} [x=0] - The x coordinate of the top-left of this Frame. - * @param {integer} [y=0] - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of the frame before being trimmed. + * @param {number} height - The height of the frame before being trimmed. + * @param {number} [x=0] - The x coordinate of the top-left of this Frame. + * @param {number} [y=0] - The y coordinate of the top-left of this Frame. * * @return {Phaser.Textures.Frame} This Frame object. */ @@ -19211,7 +24648,823 @@ module.exports = Frame; /***/ }), -/* 98 */ +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArrayUtils = __webpack_require__(199); +var Class = __webpack_require__(0); +var NOOP = __webpack_require__(1); +var StableSort = __webpack_require__(90); + +/** + * @callback EachListCallback + * + * @param {I} item - The item which is currently being processed. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + +/** + * @classdesc + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. + * + * @class List + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + * + * @generic T + * + * @param {*} parent - The parent of this list. + */ +var List = new Class({ + + initialize: + + function List (parent) + { + /** + * The parent of this list. + * + * @name Phaser.Structs.List#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The objects that belong to this collection. + * + * @genericUse {T[]} - [$type] + * + * @name Phaser.Structs.List#list + * @type {Array.<*>} + * @default [] + * @since 3.0.0 + */ + this.list = []; + + /** + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. + * + * @name Phaser.Structs.List#position + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.position = 0; + + /** + * A callback that is invoked every time a child is added to this list. + * + * @name Phaser.Structs.List#addCallback + * @type {function} + * @since 3.4.0 + */ + this.addCallback = NOOP; + + /** + * A callback that is invoked every time a child is removed from this list. + * + * @name Phaser.Structs.List#removeCallback + * @type {function} + * @since 3.4.0 + */ + this.removeCallback = NOOP; + + /** + * The property key to sort by. + * + * @name Phaser.Structs.List#_sortKey + * @type {string} + * @since 3.4.0 + */ + this._sortKey = ''; + }, + + /** + * Adds the given item to the end of the list. Each item must be unique. + * + * @method Phaser.Structs.List#add + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*|Array.<*>} child - The item, or array of items, to add to the list. + * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. + * + * @return {*} The list's underlying array. + */ + add: function (child, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.Add(this.list, child); + } + else + { + return ArrayUtils.Add(this.list, child, 0, this.addCallback, this); + } + }, + + /** + * Adds an item to list, starting at a specified index. Each item must be unique within the list. + * + * @method Phaser.Structs.List#addAt + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item, or array of items, to add to the list. + * @param {number} [index=0] - The index in the list at which the element(s) will be inserted. + * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. + * + * @return {*} The List's underlying array. + */ + addAt: function (child, index, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.AddAt(this.list, child, index); + } + else + { + return ArrayUtils.AddAt(this.list, child, index, 0, this.addCallback, this); + } + }, + + /** + * Retrieves the item at a given position inside the List. + * + * @method Phaser.Structs.List#getAt + * @since 3.0.0 + * + * @genericUse {T} - [$return] + * + * @param {number} index - The index of the item. + * + * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. + */ + getAt: function (index) + { + return this.list[index]; + }, + + /** + * Locates an item within the List and returns its index. + * + * @method Phaser.Structs.List#getIndex + * @since 3.0.0 + * + * @genericUse {T} - [child] + * + * @param {*} child - The item to locate. + * + * @return {number} The index of the item within the List, or -1 if it's not in the List. + */ + getIndex: function (child) + { + // Return -1 if given child isn't a child of this display list + return this.list.indexOf(child); + }, + + /** + * Sort the contents of this List so the items are in order based on the given property. + * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property. + * + * @method Phaser.Structs.List#sort + * @since 3.0.0 + * + * @genericUse {T[]} - [children,$return] + * + * @param {string} property - The property to lexically sort by. + * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + * + * @return {Phaser.Structs.List} This List object. + */ + sort: function (property, handler) + { + if (!property) + { + return this; + } + + if (handler === undefined) + { + handler = function (childA, childB) + { + return childA[property] - childB[property]; + }; + } + + StableSort(this.list, handler); + + return this; + }, + + /** + * Searches for the first instance of a child with its `name` + * property matching the given argument. Should more than one child have + * the same name only the first is returned. + * + * @method Phaser.Structs.List#getByName + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {string} name - The name to search for. + * + * @return {?*} The first child with a matching name, or null if none were found. + */ + getByName: function (name) + { + return ArrayUtils.GetFirst(this.list, 'name', name); + }, + + /** + * Returns a random child from the group. + * + * @method Phaser.Structs.List#getRandom + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {number} [startIndex=0] - Offset from the front of the group (lowest child). + * @param {number} [length=(to top)] - Restriction on the number of values you want to randomly select from. + * + * @return {?*} A random child of this Group. + */ + getRandom: function (startIndex, length) + { + return ArrayUtils.GetRandom(this.list, startIndex, length); + }, + + /** + * Returns the first element in a given part of the List which matches a specific criterion. + * + * @method Phaser.Structs.List#getFirst + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {string} property - The name of the property to test or a falsey value to have no criterion. + * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param {number} [startIndex=0] - The position in the List to start the search at. + * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. + * + * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. + */ + getFirst: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns all children in this List. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('parent')` would return only children that have a property called `parent`. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only children that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this List had 100 children, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 children in the List. + * + * @method Phaser.Structs.List#getAll + * @since 3.0.0 + * + * @genericUse {T} - [value] + * @genericUse {T[]} - [$return] + * + * @param {string} [property] - An optional property to test against the value argument. + * @param {*} [value] - If property is set then Child.property must strictly equal this value to be included in the results. + * @param {number} [startIndex] - The first child index to start the search from. + * @param {number} [endIndex] - The last child index to search up until. + * + * @return {Array.<*>} All items of the List which match the given criterion, if any. + */ + getAll: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns the total number of items in the List which have a property matching the given value. + * + * @method Phaser.Structs.List#count + * @since 3.0.0 + * + * @genericUse {T} - [value] + * + * @param {string} property - The property to test on each item. + * @param {*} value - The value to test the property against. + * + * @return {number} The total number of matching elements. + */ + count: function (property, value) + { + return ArrayUtils.CountAllMatching(this.list, property, value); + }, + + /** + * Swaps the positions of two items in the list. + * + * @method Phaser.Structs.List#swap + * @since 3.0.0 + * + * @genericUse {T} - [child1,child2] + * + * @param {*} child1 - The first item to swap. + * @param {*} child2 - The second item to swap. + */ + swap: function (child1, child2) + { + ArrayUtils.Swap(this.list, child1, child2); + }, + + /** + * Moves an item in the List to a new position. + * + * @method Phaser.Structs.List#moveTo + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move. + * @param {number} index - Moves an item in the List to a new position. + * + * @return {*} The item that was moved. + */ + moveTo: function (child, index) + { + return ArrayUtils.MoveTo(this.list, child, index); + }, + + /** + * Removes one or many items from the List. + * + * @method Phaser.Structs.List#remove + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item, or array of items, to remove. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {*} The item, or array of items, which were successfully removed from the List. + */ + remove: function (child, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.Remove(this.list, child); + } + else + { + return ArrayUtils.Remove(this.list, child, this.removeCallback, this); + } + }, + + /** + * Removes the item at the given position in the List. + * + * @method Phaser.Structs.List#removeAt + * @since 3.0.0 + * + * @genericUse {T} - [$return] + * + * @param {number} index - The position to remove the item from. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {*} The item that was removed. + */ + removeAt: function (index, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.RemoveAt(this.list, index); + } + else + { + return ArrayUtils.RemoveAt(this.list, index, this.removeCallback, this); + } + }, + + /** + * Removes the items within the given range in the List. + * + * @method Phaser.Structs.List#removeBetween + * @since 3.0.0 + * + * @genericUse {T[]} - [$return] + * + * @param {number} [startIndex=0] - The index to start removing from. + * @param {number} [endIndex] - The position to stop removing at. The item at this position won't be removed. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {Array.<*>} An array of the items which were removed. + */ + removeBetween: function (startIndex, endIndex, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex); + } + else + { + return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeCallback, this); + } + }, + + /** + * Removes all the items. + * + * @method Phaser.Structs.List#removeAll + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {Phaser.Structs.List} This List object. + */ + removeAll: function (skipCallback) + { + var i = this.list.length; + + while (i--) + { + this.remove(this.list[i], skipCallback); + } + + return this; + }, + + /** + * Brings the given child to the top of this List. + * + * @method Phaser.Structs.List#bringToTop + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to bring to the top of the List. + * + * @return {*} The item which was moved. + */ + bringToTop: function (child) + { + return ArrayUtils.BringToTop(this.list, child); + }, + + /** + * Sends the given child to the bottom of this List. + * + * @method Phaser.Structs.List#sendToBack + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to send to the back of the list. + * + * @return {*} The item which was moved. + */ + sendToBack: function (child) + { + return ArrayUtils.SendToBack(this.list, child); + }, + + /** + * Moves the given child up one place in this group unless it's already at the top. + * + * @method Phaser.Structs.List#moveUp + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move up. + * + * @return {*} The item which was moved. + */ + moveUp: function (child) + { + ArrayUtils.MoveUp(this.list, child); + + return child; + }, + + /** + * Moves the given child down one place in this group unless it's already at the bottom. + * + * @method Phaser.Structs.List#moveDown + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move down. + * + * @return {*} The item which was moved. + */ + moveDown: function (child) + { + ArrayUtils.MoveDown(this.list, child); + + return child; + }, + + /** + * Reverses the order of all children in this List. + * + * @method Phaser.Structs.List#reverse + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @return {Phaser.Structs.List} This List object. + */ + reverse: function () + { + this.list.reverse(); + + return this; + }, + + /** + * Shuffles the items in the list. + * + * @method Phaser.Structs.List#shuffle + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @return {Phaser.Structs.List} This List object. + */ + shuffle: function () + { + ArrayUtils.Shuffle(this.list); + + return this; + }, + + /** + * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List. + * + * @method Phaser.Structs.List#replace + * @since 3.0.0 + * + * @genericUse {T} - [oldChild,newChild,$return] + * + * @param {*} oldChild - The child in this List that will be replaced. + * @param {*} newChild - The child to be inserted into this List. + * + * @return {*} Returns the oldChild that was replaced within this group. + */ + replace: function (oldChild, newChild) + { + return ArrayUtils.Replace(this.list, oldChild, newChild); + }, + + /** + * Checks if an item exists within the List. + * + * @method Phaser.Structs.List#exists + * @since 3.0.0 + * + * @genericUse {T} - [child] + * + * @param {*} child - The item to check for the existence of. + * + * @return {boolean} `true` if the item is found in the list, otherwise `false`. + */ + exists: function (child) + { + return (this.list.indexOf(child) > -1); + }, + + /** + * Sets the property `key` to the given value on all members of this List. + * + * @method Phaser.Structs.List#setAll + * @since 3.0.0 + * + * @genericUse {T} - [value] + * + * @param {string} property - The name of the property to set. + * @param {*} value - The value to set the property to. + * @param {number} [startIndex] - The first child index to start the search from. + * @param {number} [endIndex] - The last child index to search up until. + */ + setAll: function (property, value, startIndex, endIndex) + { + ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex); + + return this; + }, + + /** + * Passes all children to the given callback. + * + * @method Phaser.Structs.List#each + * @since 3.0.0 + * + * @genericUse {EachListCallback.} - [callback] + * + * @param {EachListCallback} callback - The function to call. + * @param {*} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + each: function (callback, context) + { + var args = [ null ]; + + for (var i = 2; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < this.list.length; i++) + { + args[0] = this.list[i]; + + callback.apply(context, args); + } + }, + + /** + * Clears the List and recreates its internal array. + * + * @method Phaser.Structs.List#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + this.removeAll(); + + this.list = []; + }, + + /** + * Destroys this List. + * + * @method Phaser.Structs.List#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAll(); + + this.parent = null; + this.addCallback = null; + this.removeCallback = null; + }, + + /** + * The number of items inside the List. + * + * @name Phaser.Structs.List#length + * @type {number} + * @readonly + * @since 3.0.0 + */ + length: { + + get: function () + { + return this.list.length; + } + + }, + + /** + * The first item in the List or `null` for an empty List. + * + * @name Phaser.Structs.List#first + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + first: { + + get: function () + { + this.position = 0; + + if (this.list.length > 0) + { + return this.list[0]; + } + else + { + return null; + } + } + + }, + + /** + * The last item in the List, or `null` for an empty List. + * + * @name Phaser.Structs.List#last + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + last: { + + get: function () + { + if (this.list.length > 0) + { + this.position = this.list.length - 1; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. + * + * @name Phaser.Structs.List#next + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + next: { + + get: function () + { + if (this.position < this.list.length) + { + this.position++; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. + * + * @name Phaser.Structs.List#previous + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + previous: { + + get: function () + { + if (this.position > 0) + { + this.position--; + + return this.list[this.position]; + } + else + { + return null; + } + } + + } + +}); + +module.exports = List; + + +/***/ }), +/* 106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -19221,11 +25474,11 @@ module.exports = Frame; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(99); -var GetPoint = __webpack_require__(412); -var GetPoints = __webpack_require__(413); -var GEOM_CONST = __webpack_require__(49); -var Random = __webpack_require__(167); +var Contains = __webpack_require__(107); +var GetPoint = __webpack_require__(422); +var GetPoints = __webpack_require__(423); +var GEOM_CONST = __webpack_require__(55); +var Random = __webpack_require__(172); /** * @classdesc @@ -19261,7 +25514,7 @@ var Ellipse = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Ellipse#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -19353,7 +25606,7 @@ var Ellipse = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -19593,7 +25846,7 @@ module.exports = Ellipse; /***/ }), -/* 99 */ +/* 107 */ /***/ (function(module, exports) { /** @@ -19635,7 +25888,7 @@ module.exports = Contains; /***/ }), -/* 100 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -19644,16 +25897,17 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Actions = __webpack_require__(252); +var Actions = __webpack_require__(267); var Class = __webpack_require__(0); -var Events = __webpack_require__(29); -var GetAll = __webpack_require__(193); +var Events = __webpack_require__(32); +var EventEmitter = __webpack_require__(10); +var GetAll = __webpack_require__(198); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); var IsPlainObject = __webpack_require__(7); -var Range = __webpack_require__(404); -var Set = __webpack_require__(141); -var Sprite = __webpack_require__(76); +var Range = __webpack_require__(414); +var Set = __webpack_require__(145); +var Sprite = __webpack_require__(70); /** * @classdesc @@ -19665,6 +25919,7 @@ var Sprite = __webpack_require__(76); * * @class Group * @memberof Phaser.GameObjects + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @param {Phaser.Scene} scene - The scene this group belongs to. @@ -19676,10 +25931,14 @@ var Sprite = __webpack_require__(76); */ var Group = new Class({ + Extends: EventEmitter, + initialize: function Group (scene, children, config) { + EventEmitter.call(this); + // They can pass in any of the following as the first argument: // 1) A single child @@ -19789,7 +26048,7 @@ var Group = new Class({ * The maximum size of this group, if used as a pool. -1 is no limit. * * @name Phaser.GameObjects.Group#maxSize - * @type {integer} + * @type {number} * @since 3.0.0 * @default -1 */ @@ -19811,7 +26070,7 @@ var Group = new Class({ * A default texture frame to use when creating new group members. * * @name Phaser.GameObjects.Group#defaultFrame - * @type {(string|integer)} + * @type {(string|number)} * @since 3.0.0 */ this.defaultFrame = GetFastValue(config, 'defaultFrame', null); @@ -19885,6 +26144,21 @@ var Group = new Class({ { this.createMultiple(config); } + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); }, /** @@ -19898,7 +26172,7 @@ var Group = new Class({ * @param {number} [x=0] - The horizontal position of the new Game Object in the world. * @param {number} [y=0] - The vertical position of the new Game Object in the world. * @param {string} [key=defaultKey] - The texture key of the new Game Object. - * @param {(string|integer)} [frame=defaultFrame] - The texture frame of the new Game Object. + * @param {(string|number)} [frame=defaultFrame] - The texture frame of the new Game Object. * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object. * @param {boolean} [active=true] - The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object. * @@ -20374,7 +26648,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getLength * @since 3.0.0 * - * @return {integer} + * @return {number} */ getLength: function () { @@ -20395,14 +26669,14 @@ var Group = new Class({ * * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {any[]} An array of matching Group members. The array will be empty if nothing matched. */ getMatching: function (property, value, startIndex, endIndex) { - return GetAll(this.children, property, value, startIndex, endIndex); + return GetAll(this.children.entries, property, value, startIndex, endIndex); }, /** @@ -20420,7 +26694,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -20440,13 +26714,13 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getFirstNth * @since 3.6.0 * - * @param {integer} nth - The nth matching Group member to search for. + * @param {number} nth - The nth matching Group member to search for. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -20471,7 +26745,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -20491,13 +26765,13 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getLastNth * @since 3.6.0 * - * @param {integer} nth - The nth matching Group member to search for. + * @param {number} nth - The nth matching Group member to search for. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -20519,13 +26793,13 @@ var Group = new Class({ * @since 3.6.0 * * @param {boolean} forwards - Search front to back or back to front? - * @param {integer} nth - Stop matching after nth successful matches. + * @param {number} nth - Stop matching after nth successful matches. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -20624,7 +26898,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first inactive group member, or a newly created member, or null. @@ -20648,7 +26922,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {any} The first active group member, or a newly created member, or null. @@ -20673,7 +26947,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {any} The first inactive group member, or a newly created member, or null. @@ -20729,7 +27003,7 @@ var Group = new Class({ * * @param {boolean} [value=true] - Count active (true) or inactive (false) group members. * - * @return {integer} The number of group members with an active state matching the `active` argument. + * @return {number} The number of group members with an active state matching the `active` argument. */ countActive: function (value) { @@ -20754,7 +27028,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getTotalUsed * @since 3.0.0 * - * @return {integer} The number of group members with an active state of true. + * @return {number} The number of group members with an active state of true. */ getTotalUsed: function () { @@ -20769,7 +27043,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getTotalFree * @since 3.0.0 * - * @return {integer} maxSize minus the number of active group numbers; or a large number (if maxSize is -1). + * @return {number} maxSize minus the number of active group numbers; or a large number (if maxSize is -1). */ getTotalFree: function () { @@ -20824,8 +27098,8 @@ var Group = new Class({ * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -20845,8 +27119,8 @@ var Group = new Class({ * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -20980,7 +27254,7 @@ var Group = new Class({ * * @param {number} x - The x coordinate to place the first item in the array at. * @param {number} y - The y coordinate to place the first item in the array at. - * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {number} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. * * @return {this} This Group object. */ @@ -21286,8 +27560,8 @@ var Group = new Class({ * @since 3.21.0 * * @param {boolean} value - The value to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -21345,7 +27619,7 @@ module.exports = Group; /***/ }), -/* 101 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21354,7 +27628,7 @@ module.exports = Group; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders a filled path for the given Shape. @@ -21372,7 +27646,7 @@ var Utils = __webpack_require__(10); */ var FillPathWebGL = function (pipeline, calcMatrix, src, alpha, dx, dy) { - var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + var fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); var path = src.pathData; var pathIndexes = src.pathIndexes; @@ -21399,9 +27673,7 @@ var FillPathWebGL = function (pipeline, calcMatrix, src, alpha, dx, dy) var tx2 = calcMatrix.getX(x2, y2); var ty2 = calcMatrix.getY(x2, y2); - pipeline.setTexture2D(); - - pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, 0, 0, 1, 1, fillTintColor, fillTintColor, fillTintColor, pipeline.tintEffect); + pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, fillTintColor, fillTintColor, fillTintColor); } }; @@ -21409,9 +27681,959 @@ module.exports = FillPathWebGL; /***/ }), -/* 102 */, -/* 103 */, -/* 104 */ +/* 110 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// http://www.blackpawn.com/texts/pointinpoly/ + +/** + * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * + * @function Phaser.Geom.Triangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is inside the Triangle, otherwise `false`. + */ +var Contains = function (triangle, x, y) +{ + var v0x = triangle.x3 - triangle.x1; + var v0y = triangle.y3 - triangle.y1; + + var v1x = triangle.x2 - triangle.x1; + var v1y = triangle.y2 - triangle.y1; + + var v2x = x - triangle.x1; + var v2y = y - triangle.y1; + + var dot00 = (v0x * v0x) + (v0y * v0y); + var dot01 = (v0x * v1x) + (v0y * v1y); + var dot02 = (v0x * v2x) + (v0y * v2y); + var dot11 = (v1x * v1x) + (v1y * v1y); + var dot12 = (v1x * v2x) + (v1y * v2y); + + // Compute barycentric coordinates + var b = ((dot00 * dot11) - (dot01 * dot01)); + var inv = (b === 0) ? 0 : (1 / b); + var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; + var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; + + return (u >= 0 && v >= 0 && (u + v < 1)); +}; + +module.exports = Contains; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Rectangle = __webpack_require__(9); +var RectangleToRectangle = __webpack_require__(112); +var Vector2 = __webpack_require__(3); + +/** + * Returns the length of the line. + * + * @ignore + * @private + * + * @param {number} x1 - The x1 coordinate. + * @param {number} y1 - The y1 coordinate. + * @param {number} x2 - The x2 coordinate. + * @param {number} y2 - The y2 coordinate. + * + * @return {number} The length of the line. + */ +function GetLength (x1, y1, x2, y2) +{ + var x = x1 - x2; + var y = y1 - y2; + var magnitude = (x * x) + (y * y); + + return Math.sqrt(magnitude); +} + +/** + * @classdesc + * A Face Geometry Object. + * + * A Face is used by the Mesh Game Object. A Mesh consists of one, or more, faces that are + * used to render the Mesh Game Objects in WebGL. + * + * A Face consists of 3 Vertex instances, for the 3 corners of the face and methods to help + * you modify and test them. + * + * @class Face + * @memberof Phaser.Geom.Mesh + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Vertex} vertex1 - The first vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex2 - The second vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex3 - The third vertex of the Face. + */ +var Face = new Class({ + + initialize: + + function Face (vertex1, vertex2, vertex3) + { + /** + * The first vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex1 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex1 = vertex1; + + /** + * The second vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex2 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex2 = vertex2; + + /** + * The third vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex3 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex3 = vertex3; + + /** + * The bounds of this Face. + * + * Be sure to call the `Face.updateBounds` method _before_ using this property. + * + * @name Phaser.Geom.Mesh.Face#bounds + * @type {Phaser.Geom.Rectangle} + * @since 3.50.0 + */ + this.bounds = new Rectangle(); + + /** + * The face inCenter. Do not access directly, instead use the `getInCenter` method. + * + * @name Phaser.Geom.Mesh.Face#_inCenter + * @type {Phaser.Math.Vector2} + * @private + * @since 3.50.0 + */ + this._inCenter = new Vector2(); + }, + + /** + * Calculates and returns the in-center position of this Face. + * + * @method Phaser.Geom.Mesh.Face#getInCenter + * @since 3.50.0 + * + * @param {boolean} [local=true] Return the in center from the un-transformed vertex positions (`true`), or transformed? (`false`) + * + * @return {Phaser.Math.Vector2} A Vector2 containing the in center position of this Face. + */ + getInCenter: function (local) + { + if (local === undefined) { local = true; } + + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var v1x; + var v1y; + + var v2x; + var v2y; + + var v3x; + var v3y; + + if (local) + { + v1x = v1.x; + v1y = v1.y; + + v2x = v2.x; + v2y = v2.y; + + v3x = v3.x; + v3y = v3.y; + } + else + { + v1x = v1.vx; + v1y = v1.vy; + + v2x = v2.vx; + v2y = v2.vy; + + v3x = v3.vx; + v3y = v3.vy; + } + + var d1 = GetLength(v3x, v3y, v2x, v2y); + var d2 = GetLength(v1x, v1y, v3x, v3y); + var d3 = GetLength(v2x, v2y, v1x, v1y); + + var p = d1 + d2 + d3; + + return this._inCenter.set( + (v1x * d1 + v2x * d2 + v3x * d3) / p, + (v1y * d1 + v2y * d2 + v3y * d3) / p + ); + }, + + /** + * Checks if the given coordinates are within this Face. + * + * You can optionally provide a transform matrix. If given, the Face vertices + * will be transformed first, before being checked against the coordinates. + * + * @method Phaser.Geom.Mesh.Face#contains + * @since 3.50.0 + * + * @param {number} x - The horizontal position to check. + * @param {number} y - The vertical position to check. + * @param {Phaser.GameObjects.Components.TransformMatrix} [calcMatrix] - Optional transform matrix to apply to the vertices before comparison. + * + * @return {boolean} `true` if the coordinates lay within this Face, otherwise `false`. + */ + contains: function (x, y, calcMatrix) + { + var vertex1 = this.vertex1; + var vertex2 = this.vertex2; + var vertex3 = this.vertex3; + + var v1x = vertex1.vx; + var v1y = vertex1.vy; + + var v2x = vertex2.vx; + var v2y = vertex2.vy; + + var v3x = vertex3.vx; + var v3y = vertex3.vy; + + if (calcMatrix) + { + var a = calcMatrix.a; + var b = calcMatrix.b; + var c = calcMatrix.c; + var d = calcMatrix.d; + var e = calcMatrix.e; + var f = calcMatrix.f; + + v1x = vertex1.vx * a + vertex1.vy * c + e; + v1y = vertex1.vx * b + vertex1.vy * d + f; + + v2x = vertex2.vx * a + vertex2.vy * c + e; + v2y = vertex2.vx * b + vertex2.vy * d + f; + + v3x = vertex3.vx * a + vertex3.vy * c + e; + v3y = vertex3.vx * b + vertex3.vy * d + f; + } + + var t0x = v3x - v1x; + var t0y = v3y - v1y; + + var t1x = v2x - v1x; + var t1y = v2y - v1y; + + var t2x = x - v1x; + var t2y = y - v1y; + + var dot00 = (t0x * t0x) + (t0y * t0y); + var dot01 = (t0x * t1x) + (t0y * t1y); + var dot02 = (t0x * t2x) + (t0y * t2y); + var dot11 = (t1x * t1x) + (t1y * t1y); + var dot12 = (t1x * t2x) + (t1y * t2y); + + // Compute barycentric coordinates + var bc = ((dot00 * dot11) - (dot01 * dot01)); + var inv = (bc === 0) ? 0 : (1 / bc); + var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; + var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; + + return (u >= 0 && v >= 0 && (u + v < 1)); + }, + + /** + * Checks if the vertices in this Face are orientated counter-clockwise, or not. + * + * It checks the transformed position of the vertices, not the local one. + * + * @method Phaser.Geom.Mesh.Face#isCounterClockwise + * @since 3.50.0 + * + * @param {number} z - The z-axis value to test against. Typically the `Mesh.modelPosition.z`. + * + * @return {boolean} `true` if the vertices in this Face run counter-clockwise, otherwise `false`. + */ + isCounterClockwise: function (z) + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var d = (v2.vx - v1.vx) * (v3.vy - v1.vy) - (v2.vy - v1.vy) * (v3.vx - v1.vx); + + return (z <= 0) ? d >= 0 : d < 0; + }, + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * + * @method Phaser.Geom.Mesh.Face#load + * @since 3.50.0 + * + * @param {Float32Array} F32 - A Float32 Array to insert the position, UV and unit data in to. + * @param {Uint32Array} U32 - A Uint32 Array to insert the color and alpha data in to. + * @param {number} offset - The index of the array to insert this Vertex to. + * @param {number} textureUnit - The texture unit currently in use. + * @param {number} alpha - The alpha of the parent object. + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * + * @return {number} The new vertex index array offset. + */ + load: function (F32, U32, offset, textureUnit, tintEffect) + { + offset = this.vertex1.load(F32, U32, offset, textureUnit, tintEffect); + offset = this.vertex2.load(F32, U32, offset, textureUnit, tintEffect); + offset = this.vertex3.load(F32, U32, offset, textureUnit, tintEffect); + + return offset; + }, + + /** + * Transforms all Face vertices by the given matrix, storing the results in their `vx`, `vy` and `vz` properties. + * + * @method Phaser.Geom.Mesh.Face#transformCoordinatesLocal + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} transformMatrix - The transform matrix to apply to this vertex. + * @param {number} width - The width of the parent Mesh. + * @param {number} height - The height of the parent Mesh. + * @param {number} cameraZ - The z position of the MeshCamera. + * + * @return {this} This Face instance. + */ + transformCoordinatesLocal: function (transformMatrix, width, height, cameraZ) + { + this.vertex1.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + this.vertex2.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + this.vertex3.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + + return this; + }, + + /** + * Updates the bounds of this Face, based on the translated values of the vertices. + * + * Call this method prior to accessing the `Face.bounds` property. + * + * @method Phaser.Geom.Mesh.Face#updateBounds + * @since 3.50.0 + * + * @return {this} This Face instance. + */ + updateBounds: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var bounds = this.bounds; + + bounds.x = Math.min(v1.vx, v2.vx, v3.vx); + bounds.y = Math.min(v1.vy, v2.vy, v3.vy); + bounds.width = Math.max(v1.vx, v2.vx, v3.vx) - bounds.x; + bounds.height = Math.max(v1.vy, v2.vy, v3.vy) - bounds.y; + + return this; + }, + + /** + * Checks if this Face is within the view of the given Camera. + * + * This method is called in the `MeshWebGLRenderer` function. It performs the following tasks: + * + * First, the `Vertex.update` method is called on each of the vertices. This populates them + * with the new translated values, updating their `tx`, `ty` and `ta` properties. + * + * Then it tests to see if this face is visible due to the alpha values, if not, it returns. + * + * After this, if `hideCCW` is set, it calls `isCounterClockwise` and returns if not. + * + * Finally, it will update the `Face.bounds` based on the newly translated vertex values + * and return the results of an intersection test between the bounds and the camera world view + * rectangle. + * + * @method Phaser.Geom.Mesh.Face#isInView + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against. + * @param {boolean} hideCCW - Test the counter-clockwise orientation of the verts? + * @param {number} z - The Cameras z position, used in the CCW test. + * @param {number} alpha - The alpha of the parent object. + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * + * @return {boolean} `true` if this Face can be seen by the Camera. + */ + isInView: function (camera, hideCCW, z, alpha, a, b, c, d, e, f, roundPixels) + { + var v1 = this.vertex1.update(a, b, c, d, e, f, roundPixels, alpha); + var v2 = this.vertex2.update(a, b, c, d, e, f, roundPixels, alpha); + var v3 = this.vertex3.update(a, b, c, d, e, f, roundPixels, alpha); + + // Alpha check first + if (v1.ta <= 0 && v2.ta <= 0 && v3.ta <= 0) + { + return false; + } + + // CCW check + if (hideCCW && !this.isCounterClockwise(z)) + { + return false; + } + + // Bounds check + var bounds = this.bounds; + + bounds.x = Math.min(v1.tx, v2.tx, v3.tx); + bounds.y = Math.min(v1.ty, v2.ty, v3.ty); + bounds.width = Math.max(v1.tx, v2.tx, v3.tx) - bounds.x; + bounds.height = Math.max(v1.ty, v2.ty, v3.ty) - bounds.y; + + return RectangleToRectangle(bounds, camera.worldView); + }, + + /** + * Translates the vertices of this Face by the given amounts. + * + * The actual vertex positions are adjusted, not their transformed position. + * + * Therefore, this updates the vertex data directly. + * + * @method Phaser.Geom.Mesh.Face#translate + * @since 3.50.0 + * + * @param {number} x - The amount to horizontally translate by. + * @param {number} [y=0] - The amount to vertically translate by. + * + * @return {this} This Face instance. + */ + translate: function (x, y) + { + if (y === undefined) { y = 0; } + + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + v1.x += x; + v1.y += y; + + v2.x += x; + v2.y += y; + + v3.x += x; + v3.y += y; + + return this; + }, + + /** + * The x coordinate of this Face, based on the in center position of the Face. + * + * @name Phaser.Geom.Mesh.Face#x + * @type {number} + * @since 3.50.0 + */ + x: { + + get: function () + { + return this.getInCenter().x; + }, + + set: function (value) + { + var current = this.getInCenter(); + + this.translate(value - current.x, 0); + } + + }, + + /** + * The y coordinate of this Face, based on the in center position of the Face. + * + * @name Phaser.Geom.Mesh.Face#y + * @type {number} + * @since 3.50.0 + */ + y: { + + get: function () + { + return this.getInCenter().y; + }, + + set: function (value) + { + var current = this.getInCenter(); + + this.translate(0, value - current.y); + } + + }, + + /** + * Set the alpha value of this Face. + * + * Each vertex is given the same value. If you need to adjust the alpha on a per-vertex basis + * then use the `Vertex.alpha` property instead. + * + * When getting the alpha of this Face, it will return an average of the alpha + * component of all three vertices. + * + * @name Phaser.Geom.Mesh.Face#alpha + * @type {number} + * @since 3.50.0 + */ + alpha: { + + get: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + return (v1.alpha + v2.alpha + v3.alpha) / 3; + }, + + set: function (value) + { + this.vertex1.alpha = value; + this.vertex2.alpha = value; + this.vertex3.alpha = value; + } + + }, + + /** + * The depth of this Face, which is an average of the z component of all three vertices. + * + * The depth is calculated based on the transformed z value, not the local one. + * + * @name Phaser.Geom.Mesh.Face#depth + * @type {number} + * @readonly + * @since 3.50.0 + */ + depth: { + + get: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + return (v1.vz + v2.vz + v3.vz) / 3; + } + + }, + + /** + * Destroys this Face and nulls the references to the vertices. + * + * @method Phaser.Geom.Mesh.Face#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.vertex1 = null; + this.vertex2 = null; + this.vertex3 = null; + } + +}); + +module.exports = Face; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if two Rectangles intersect. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. + * As such, the two Rectangles are considered "solid". + * A Rectangle with no width or no height will never intersect another Rectangle. + * + * @function Phaser.Geom.Intersects.RectangleToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection. + * + * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`. + */ +var RectangleToRectangle = function (rectA, rectB) +{ + if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0) + { + return false; + } + + return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom); +}; + +module.exports = RectangleToRectangle; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Utils = __webpack_require__(12); +var Vector3 = __webpack_require__(37); + +/** + * @classdesc + * A Vertex Geometry Object. + * + * This class consists of all the information required for a single vertex within a Face Geometry Object. + * + * Faces, and thus Vertex objects, are used by the Mesh Game Object in order to render objects in WebGL. + * + * @class Vertex + * @memberof Phaser.Geom.Mesh + * @constructor + * @extends Phaser.Math.Vector3 + * @since 3.50.0 + * + * @param {number} x - The x position of the vertex. + * @param {number} y - The y position of the vertex. + * @param {number} z - The z position of the vertex. + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * @param {number} [color=0xffffff] - The color value of the vertex. + * @param {number} [alpha=1] - The alpha value of the vertex. + * @param {number} [nx=0] - The x normal value of the vertex. + * @param {number} [ny=0] - The y normal value of the vertex. + * @param {number} [nz=0] - The z normal value of the vertex. + */ +var Vertex = new Class({ + + Extends: Vector3, + + initialize: + + function Vertex (x, y, z, u, v, color, alpha, nx, ny, nz) + { + if (color === undefined) { color = 0xffffff; } + if (alpha === undefined) { alpha = 1; } + if (nx === undefined) { nx = 0; } + if (ny === undefined) { ny = 0; } + if (nz === undefined) { nz = 0; } + + Vector3.call(this, x, y, z); + + /** + * The projected x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vx + * @type {number} + * @since 3.50.0 + */ + this.vx = 0; + + /** + * The projected y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vy + * @type {number} + * @since 3.50.0 + */ + this.vy = 0; + + /** + * The projected z coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vz + * @type {number} + * @since 3.50.0 + */ + this.vz = 0; + + /** + * The projected x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#nx + * @type {number} + * @since 3.50.0 + */ + this.nx = nx; + + /** + * The projected y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ny + * @type {number} + * @since 3.50.0 + */ + this.ny = ny; + + /** + * The projected z coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#nz + * @type {number} + * @since 3.50.0 + */ + this.nz = nz; + + /** + * UV u coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#u + * @type {number} + * @since 3.50.0 + */ + this.u = u; + + /** + * UV v coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#v + * @type {number} + * @since 3.50.0 + */ + this.v = v; + + /** + * The color value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#color + * @type {number} + * @since 3.50.0 + */ + this.color = color; + + /** + * The alpha value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = alpha; + + /** + * The translated x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#tx + * @type {number} + * @since 3.50.0 + */ + this.tx = 0; + + /** + * The translated y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ty + * @type {number} + * @since 3.50.0 + */ + this.ty = 0; + + /** + * The translated alpha value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ta + * @type {number} + * @since 3.50.0 + */ + this.ta = 0; + }, + + /** + * Sets the U and V properties. + * + * @method Phaser.Geom.Mesh.Vertex#setUVs + * @since 3.50.0 + * + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * + * @return {this} This Vertex. + */ + setUVs: function (u, v) + { + this.u = u; + this.v = v; + + return this; + }, + + /** + * Transforms this vertex by the given matrix, storing the results in `vx`, `vy` and `vz`. + * + * @method Phaser.Geom.Mesh.Vertex#transformCoordinatesLocal + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} transformMatrix - The transform matrix to apply to this vertex. + * @param {number} width - The width of the parent Mesh. + * @param {number} height - The height of the parent Mesh. + * @param {number} cameraZ - The z position of the MeshCamera. + */ + transformCoordinatesLocal: function (transformMatrix, width, height, cameraZ) + { + var x = this.x; + var y = this.y; + var z = this.z; + + var m = transformMatrix.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.vx = (tx / tw) * width; + this.vy = -(ty / tw) * height; + + if (cameraZ <= 0) + { + this.vz = (tz / tw); + } + else + { + this.vz = -(tz / tw); + } + }, + + /** + * Updates this Vertex based on the given transform. + * + * @method Phaser.Geom.Mesh.Vertex#update + * @since 3.50.0 + * + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * @param {number} alpha - The alpha of the parent object. + * + * @return {this} This Vertex. + */ + update: function (a, b, c, d, e, f, roundPixels, alpha) + { + var tx = this.vx * a + this.vy * c + e; + var ty = this.vx * b + this.vy * d + f; + + if (roundPixels) + { + tx = Math.round(tx); + ty = Math.round(ty); + } + + this.tx = tx; + this.ty = ty; + this.ta = this.alpha * alpha; + + return this; + }, + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * + * @method Phaser.Geom.Mesh.Vertex#load + * @since 3.50.0 + * + * @param {Float32Array} F32 - A Float32 Array to insert the position, UV and unit data in to. + * @param {Uint32Array} U32 - A Uint32 Array to insert the color and alpha data in to. + * @param {number} offset - The index of the array to insert this Vertex to. + * @param {number} textureUnit - The texture unit currently in use. + * + * @return {number} The new array offset. + */ + load: function (F32, U32, offset, textureUnit, tintEffect) + { + F32[++offset] = this.tx; + F32[++offset] = this.ty; + F32[++offset] = this.u; + F32[++offset] = this.v; + F32[++offset] = textureUnit; + F32[++offset] = tintEffect; + U32[++offset] = Utils.getTintAppendFloatAlpha(this.color, this.ta); + + return offset; + } + +}); + +module.exports = Vertex; + + +/***/ }), +/* 114 */, +/* 115 */, +/* 116 */ /***/ (function(module, exports) { /** @@ -21426,8 +28648,8 @@ module.exports = FillPathWebGL; * @function Phaser.Tilemaps.Components.IsInLayerBounds * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`. @@ -21441,7 +28663,7 @@ module.exports = IsInLayerBounds; /***/ }), -/* 105 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21451,12 +28673,13 @@ module.exports = IsInLayerBounds; */ var Class = __webpack_require__(0); +var CONST = __webpack_require__(29); var GetFastValue = __webpack_require__(2); /** * @classdesc * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, - * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference + * etc. into this format. Tilemap and TilemapLayer objects have a reference * to this data and use it to look up and perform operations on tiles. * * @class LayerData @@ -21555,6 +28778,15 @@ var LayerData = new Class({ */ this.baseTileHeight = GetFastValue(config, 'baseTileHeight', this.tileHeight); + /** + * The layers orientation, necessary to be able to determine a tiles pixelX and pixelY as well as the layers width and height. + * + * @name Phaser.Tilemaps.LayerData#orientation + * @type {Phaser.Tilemaps.OrientationType} + * @since 3.50.0 + */ + this.orientation = GetFastValue(config, 'orientation', CONST.ORTHOGONAL); + /** * The width in pixels of the entire layer. * @@ -21649,10 +28881,20 @@ var LayerData = new Class({ * A reference to the Tilemap layer that owns this data. * * @name Phaser.Tilemaps.LayerData#tilemapLayer - * @type {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} + * @type {Phaser.Tilemaps.TilemapLayer} * @since 3.0.0 */ this.tilemapLayer = GetFastValue(config, 'tilemapLayer', null); + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.LayerData#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = GetFastValue(config, 'hexSideLength', 0); } }); @@ -21661,7 +28903,7 @@ module.exports = LayerData; /***/ }), -/* 106 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21671,6 +28913,7 @@ module.exports = LayerData; */ var Class = __webpack_require__(0); +var CONST = __webpack_require__(29); var GetFastValue = __webpack_require__(2); /** @@ -21696,7 +28939,7 @@ var MapData = new Class({ /** * The key in the Phaser cache that corresponds to the loaded tilemap data. - * + * * @name Phaser.Tilemaps.MapData#name * @type {string} * @since 3.0.0 @@ -21705,7 +28948,7 @@ var MapData = new Class({ /** * The width of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#width * @type {number} * @since 3.0.0 @@ -21714,7 +28957,7 @@ var MapData = new Class({ /** * The height of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#height * @type {number} * @since 3.0.0 @@ -21732,7 +28975,7 @@ var MapData = new Class({ /** * The width of the tiles. - * + * * @name Phaser.Tilemaps.MapData#tileWidth * @type {number} * @since 3.0.0 @@ -21741,7 +28984,7 @@ var MapData = new Class({ /** * The height of the tiles. - * + * * @name Phaser.Tilemaps.MapData#tileHeight * @type {number} * @since 3.0.0 @@ -21750,7 +28993,7 @@ var MapData = new Class({ /** * The width in pixels of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#widthInPixels * @type {number} * @since 3.0.0 @@ -21759,7 +29002,7 @@ var MapData = new Class({ /** * The height in pixels of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#heightInPixels * @type {number} * @since 3.0.0 @@ -21768,30 +29011,30 @@ var MapData = new Class({ /** * The format of the map data. - * + * * @name Phaser.Tilemaps.MapData#format - * @type {integer} + * @type {number} * @since 3.0.0 */ this.format = GetFastValue(config, 'format', null); /** * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. - * + * * @name Phaser.Tilemaps.MapData#orientation - * @type {string} - * @since 3.0.0 + * @type {Phaser.Tilemaps.OrientationType} + * @since 3.50.0 */ - this.orientation = GetFastValue(config, 'orientation', 'orthogonal'); + this.orientation = GetFastValue(config, 'orientation', CONST.ORTHOGONAL); /** * Determines the draw order of tilemap. Default is right-down - * + * * 0, or 'right-down' * 1, or 'left-down' * 2, or 'right-up' * 3, or 'left-up' - * + * * @name Phaser.Tilemaps.MapData#renderOrder * @type {string} * @since 3.12.0 @@ -21800,7 +29043,7 @@ var MapData = new Class({ /** * The version of the map data (as specified in Tiled). - * + * * @name Phaser.Tilemaps.MapData#version * @type {string} * @since 3.0.0 @@ -21809,7 +29052,7 @@ var MapData = new Class({ /** * Map specific properties (can be specified in Tiled) - * + * * @name Phaser.Tilemaps.MapData#properties * @type {object} * @since 3.0.0 @@ -21818,7 +29061,7 @@ var MapData = new Class({ /** * An array with all the layers configured to the MapData. - * + * * @name Phaser.Tilemaps.MapData#layers * @type {(Phaser.Tilemaps.LayerData[]|Phaser.Tilemaps.ObjectLayer)} * @since 3.0.0 @@ -21827,7 +29070,7 @@ var MapData = new Class({ /** * An array of Tiled Image Layers. - * + * * @name Phaser.Tilemaps.MapData#images * @type {array} * @since 3.0.0 @@ -21836,7 +29079,7 @@ var MapData = new Class({ /** * An object of Tiled Object Layers. - * + * * @name Phaser.Tilemaps.MapData#objects * @type {object} * @since 3.0.0 @@ -21845,7 +29088,7 @@ var MapData = new Class({ /** * An object of collision data. Must be created as physics object or will return undefined. - * + * * @name Phaser.Tilemaps.MapData#collision * @type {object} * @since 3.0.0 @@ -21854,7 +29097,7 @@ var MapData = new Class({ /** * An array of Tilesets. - * + * * @name Phaser.Tilemaps.MapData#tilesets * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 @@ -21863,7 +29106,7 @@ var MapData = new Class({ /** * The collection of images the map uses(specified in Tiled) - * + * * @name Phaser.Tilemaps.MapData#imageCollections * @type {array} * @since 3.0.0 @@ -21872,12 +29115,22 @@ var MapData = new Class({ /** * An array of tile instances. - * + * * @name Phaser.Tilemaps.MapData#tiles * @type {array} * @since 3.0.0 */ this.tiles = GetFastValue(config, 'tiles', []); + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.MapData#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = GetFastValue(config, 'hexSideLength', 0); } }); @@ -21886,7 +29139,7 @@ module.exports = MapData; /***/ }), -/* 107 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21908,11 +29161,11 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {string} name - The name of the tileset in the map data. - * @param {integer} firstgid - The first tile index this tileset contains. - * @param {integer} [tileWidth=32] - Width of each tile (in pixels). - * @param {integer} [tileHeight=32] - Height of each tile (in pixels). - * @param {integer} [tileMargin=0] - The margin around all tiles in the sheet (in pixels). - * @param {integer} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels). + * @param {number} firstgid - The first tile index this tileset contains. + * @param {number} [tileWidth=32] - Width of each tile (in pixels). + * @param {number} [tileHeight=32] - Height of each tile (in pixels). + * @param {number} [tileMargin=0] - The margin around all tiles in the sheet (in pixels). + * @param {number} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels). * @param {object} [tileProperties={}] - Custom properties defined per tile in the Tileset. * These typically are custom properties created in Tiled when editing a tileset. * @param {object} [tileData={}] - Data stored per tile. These typically are created in Tiled @@ -21944,7 +29197,7 @@ var Tileset = new Class({ * The starting index of the first tile index this Tileset contains. * * @name Phaser.Tilemaps.Tileset#firstgid - * @type {integer} + * @type {number} * @since 3.0.0 */ this.firstgid = firstgid; @@ -21953,7 +29206,7 @@ var Tileset = new Class({ * The width of each tile (in pixels). Use setTileSize to change. * * @name Phaser.Tilemaps.Tileset#tileWidth - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -21963,7 +29216,7 @@ var Tileset = new Class({ * The height of each tile (in pixels). Use setTileSize to change. * * @name Phaser.Tilemaps.Tileset#tileHeight - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -21973,7 +29226,7 @@ var Tileset = new Class({ * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change. * * @name Phaser.Tilemaps.Tileset#tileMargin - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -21983,7 +29236,7 @@ var Tileset = new Class({ * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change. * * @name Phaser.Tilemaps.Tileset#tileSpacing - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -22033,7 +29286,7 @@ var Tileset = new Class({ * The number of tile rows in the the tileset. * * @name Phaser.Tilemaps.Tileset#rows - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -22043,7 +29296,7 @@ var Tileset = new Class({ * The number of tile columns in the tileset. * * @name Phaser.Tilemaps.Tileset#columns - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -22053,7 +29306,7 @@ var Tileset = new Class({ * The total number of tiles in the tileset. * * @name Phaser.Tilemaps.Tileset#total - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -22078,7 +29331,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileProperties * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?(object|undefined)} */ @@ -22097,7 +29350,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileData * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object|undefined} */ @@ -22115,7 +29368,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileCollisionGroup * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object} */ @@ -22132,7 +29385,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#containsTileIndex * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {boolean} */ @@ -22151,7 +29404,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileTextureCoordinates * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object} Object in the form { x, y } representing the top-left UV coordinate * within the Tileset image. @@ -22190,8 +29443,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#setTileSize * @since 3.0.0 * - * @param {integer} [tileWidth] - The width of a tile in pixels. - * @param {integer} [tileHeight] - The height of a tile in pixels. + * @param {number} [tileWidth] - The width of a tile in pixels. + * @param {number} [tileHeight] - The height of a tile in pixels. * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -22214,8 +29467,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#setSpacing * @since 3.0.0 * - * @param {integer} [margin] - The margin around the tiles in the sheet (in pixels). - * @param {integer} [spacing] - The spacing between the tiles in the sheet (in pixels). + * @param {number} [margin] - The margin around the tiles in the sheet (in pixels). + * @param {number} [spacing] - The spacing between the tiles in the sheet (in pixels). * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -22238,8 +29491,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#updateTileData * @since 3.0.0 * - * @param {integer} imageWidth - The (expected) width of the image to slice. - * @param {integer} imageHeight - The (expected) height of the image to slice. + * @param {number} imageWidth - The (expected) width of the image to slice. + * @param {number} imageHeight - The (expected) height of the image to slice. * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -22290,7 +29543,7 @@ module.exports = Tileset; /***/ }), -/* 108 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -22306,7 +29559,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_LEFT * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_LEFT: 0, @@ -22315,7 +29568,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_CENTER: 1, @@ -22324,7 +29577,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_RIGHT * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_RIGHT: 2, @@ -22333,7 +29586,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_TOP * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_TOP: 3, @@ -22342,7 +29595,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_CENTER: 4, @@ -22351,7 +29604,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_BOTTOM * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_BOTTOM: 5, @@ -22360,7 +29613,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ CENTER: 6, @@ -22369,7 +29622,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_TOP * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_TOP: 7, @@ -22378,7 +29631,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_CENTER: 8, @@ -22387,7 +29640,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_BOTTOM * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_BOTTOM: 9, @@ -22396,7 +29649,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_LEFT * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_LEFT: 10, @@ -22405,7 +29658,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_CENTER: 11, @@ -22414,7 +29667,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_RIGHT * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_RIGHT: 12 @@ -22424,7 +29677,7 @@ module.exports = ALIGN_CONST; /***/ }), -/* 109 */ +/* 121 */ /***/ (function(module, exports) { /** @@ -22458,2541 +29711,7 @@ module.exports = Equal; /***/ }), -/* 110 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var PIPELINE_CONST = { - - /** - * The Bitmap Mask Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', - - /** - * The Light 2D Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - LIGHT_PIPELINE: 'Light2D', - - /** - * The Single Texture Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - SINGLE_PIPELINE: 'SinglePipeline', - - /** - * The Multi Texture Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - MULTI_PIPELINE: 'MultiPipeline', - - /** - * The Rope Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - ROPE_PIPELINE: 'RopePipeline' - -}; - -module.exports = PIPELINE_CONST; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GetFastValue = __webpack_require__(2); -var Utils = __webpack_require__(10); - -/** - * @classdesc - * - * The `WebGLPipeline` is a base class used by all of the core Phaser pipelines. - * - * It describes the way elements will be rendered in WebGL. Internally, it handles - * compiling the shaders, creating vertex buffers, assigning primitive topolgy and - * binding vertex attributes, all based on the given configuration data. - * - * The pipeline is configured by passing in a `WebGLPipelineConfig` object. Please - * see the documentation for this type to fully understand the configuration options - * available to you. - * - * Usually, you would not extend from this class directly, but would instead extend - * from one of the core pipelines, such as the Multi Pipeline or Rope Pipeline. - * - * @class WebGLPipeline - * @memberof Phaser.Renderer.WebGL - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration object for this WebGL Pipeline. - */ -var WebGLPipeline = new Class({ - - initialize: - - function WebGLPipeline (config) - { - var game = config.game; - var renderer = game.renderer; - var gl = renderer.gl; - - /** - * Name of the pipeline. Used for identification. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#name - * @type {string} - * @since 3.0.0 - */ - this.name = GetFastValue(config, 'name', 'WebGLPipeline'); - - /** - * The Phaser Game instance to which this pipeline is bound. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#game - * @type {Phaser.Game} - * @since 3.0.0 - */ - this.game = game; - - /** - * The WebGL Renderer instance to which this pipeline is bound. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#renderer - * @type {Phaser.Renderer.WebGL.WebGLRenderer} - * @since 3.0.0 - */ - this.renderer = renderer; - - /** - * The WebGL context this WebGL Pipeline uses. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#gl - * @type {WebGLRenderingContext} - * @since 3.0.0 - */ - this.gl = gl; - - /** - * The canvas which this WebGL Pipeline renders to. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#view - * @type {HTMLCanvasElement} - * @since 3.0.0 - */ - this.view = game.canvas; - - /** - * The current game resolution. - * This is hard-coded to 1. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#resolution - * @type {number} - * @since 3.0.0 - */ - this.resolution = 1; - - /** - * Width of the current viewport. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#width - * @type {number} - * @since 3.0.0 - */ - this.width = 0; - - /** - * Height of the current viewport. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#height - * @type {number} - * @since 3.0.0 - */ - this.height = 0; - - /** - * The current number of vertices that have been added to the pipeline batch. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCount - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.vertexCount = 0; - - /** - * The total number of vertices that the pipeline batch can hold before it will flush. - * This defaults to `batchSize * 6`, where `batchSize` is defined in the Renderer Config. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCapacity - * @type {integer} - * @since 3.0.0 - */ - this.vertexCapacity = GetFastValue(config, 'vertexCapacity', renderer.config.batchSize * 6); - - /** - * The size in bytes of a vertex. - * - * Derived by adding together all of the vertex attributes. - * - * For example, the Texture Tint Pipeline has 2 + 2 + 1 + 1 + 4 for the attributes - * `inPosition` (size 2), `inTexCoord` (size 2), `inTexId` (size 1), `inTintEffect` (size 1) - * and `inTint` (size 4), for a total of 28, which is the default for this property. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexSize - * @type {integer} - * @since 3.0.0 - */ - this.vertexSize = GetFastValue(config, 'vertexSize', 28); - - /** - * Raw byte buffer of vertices. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexData - * @type {ArrayBuffer} - * @since 3.0.0 - */ - this.vertexData = GetFastValue(config, 'vertices', new ArrayBuffer(this.vertexCapacity * this.vertexSize)); - - /** - * The WebGLBuffer that holds the vertex data. - * Created from the `vertices` config ArrayBuffer that was passed in, or set by default, by the pipeline. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexBuffer - * @type {WebGLBuffer} - * @since 3.0.0 - */ - if (GetFastValue(config, 'vertices', null)) - { - this.vertexBuffer = this.renderer.createVertexBuffer(this.vertexData, this.gl.STREAM_DRAW); - } - else - { - this.vertexBuffer = this.renderer.createVertexBuffer(this.vertexData.byteLength, this.gl.STREAM_DRAW); - } - - /** - * The handle to a WebGL program. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#program - * @type {WebGLProgram} - * @since 3.0.0 - */ - this.program = this.renderer.createProgram(config.vertShader, config.fragShader); - - /** - * Array of objects that describe the vertex attributes. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#attributes - * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig} - * @since 3.0.0 - */ - this.attributes = config.attributes; - - /** - * The primitive topology which the pipeline will use to submit draw calls. - * Defaults to GL_TRIANGLES if not otherwise set. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#topology - * @type {GLenum} - * @since 3.0.0 - */ - this.topology = GetFastValue(config, 'topology', gl.TRIANGLES); - - /** - * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#bytes - * @type {Uint8Array} - * @since 3.0.0 - */ - this.bytes = new Uint8Array(this.vertexData); - - /** - * This will store the amount of components of 32 bit length. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexComponentCount - * @type {integer} - * @since 3.0.0 - */ - this.vertexComponentCount = Utils.getComponentCount(this.attributes, gl); - - /** - * Indicates if the current pipeline is flushing the contents to the GPU. - * When the variable is set the flush function will be locked. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#flushLocked - * @type {boolean} - * @since 3.1.0 - */ - this.flushLocked = false; - - /** - * Indicates if the current pipeline is active or not for this frame only. - * Reset in the onRender method. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#active - * @type {boolean} - * @since 3.10.0 - */ - this.active = false; - - /** - * Holds the most recently assigned texture unit. - * Treat this value as read-only. - * - * @name Phaser.Renderer.WebGL.Pipelines.WebGLPipeline#currentUnit - * @type {number} - * @since 3.50.0 - */ - this.currentUnit = 0; - - /** - * Some pipelines require the forced use of texture zero (like the light pipeline). - * This boolean should be set when that is the case. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#forceZero - * @type {boolean} - * @since 3.50.0 - */ - this.forceZero = false; - - /** - * Indicates if the current pipeline has booted or not. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#hasBooted - * @type {boolean} - * @readonly - * @since 3.50.0 - */ - this.hasBooted = false; - }, - - /** - * Called when the Game has fully booted and the Renderer has finished setting up. - * - * By this stage all Game level systems are now in place and you can perform any final - * tasks that the pipeline may need that relied on game systems such as the Texture Manager. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#boot - * @since 3.11.0 - */ - boot: function () - { - var renderer = this.renderer; - - renderer.setProgram(this.program); - renderer.setVertexBuffer(this.vertexBuffer); - - this.setAttribPointers(true); - - this.hasBooted = true; - - return this; - }, - - /** - * Custom pipelines can use this method in order to perform any required pre-batch tasks - * for the given Game Object. It must return the texture unit the Game Object was assigned. - * - * @method Phaser.Renderer.WebGL.Pipelines.WebGLPipeline#setGameObject - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. - * @param {Phaser.Textures.Frame} [frame] - Optional frame to use. Can override that of the Game Object. - * - * @return {number} The texture unit the Game Object has been assigned. - */ - setGameObject: function (gameObject, frame) - { - if (frame === undefined) { frame = gameObject.frame; } - - this.currentUnit = this.renderer.setTextureSource(frame.source); - - return this.currentUnit; - }, - - /** - * Adds a description of vertex attribute to the pipeline - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#addAttribute - * @since 3.2.0 - * - * @param {string} name - Name of the vertex attribute - * @param {integer} size - Vertex component size - * @param {integer} type - Type of the attribute - * @param {boolean} normalized - Is the value normalized to a range - * @param {integer} offset - Byte offset to the beginning of the first element in the vertex - * - * @return {this} This WebGLPipeline instance. - */ - addAttribute: function (name, size, type, normalized, offset) - { - this.attributes.push({ - name: name, - size: size, - type: this.renderer.glFormats[type], - normalized: normalized, - offset: offset, - enabled: false, - location: -1 - }); - - this.vertexComponentCount = Utils.getComponentCount( - this.attributes, - this.gl - ); - return this; - }, - - /** - * Check if the current batch of vertices is full. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#shouldFlush - * @since 3.0.0 - * - * @return {boolean} `true` if the current batch should be flushed, otherwise `false`. - */ - shouldFlush: function () - { - return (this.vertexCount >= this.vertexCapacity); - }, - - /** - * Resizes the properties used to describe the viewport - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#resize - * @since 3.0.0 - * - * @param {number} width - The new width of this WebGL Pipeline. - * @param {number} height - The new height of this WebGL Pipeline. - * @param {number} resolution - The resolution this WebGL Pipeline should be resized to. - * - * @return {this} This WebGLPipeline instance. - */ - resize: function (width, height, resolution) - { - this.width = width * resolution; - this.height = height * resolution; - this.resolution = resolution; - - return this; - }, - - /** - * Binds the pipeline resources, including the program, vertex buffer and attribute pointers. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#bind - * @since 3.0.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - var vertexBuffer = this.vertexBuffer; - var program = this.program; - var renderer = this.renderer; - - renderer.setProgram(program); - renderer.setVertexBuffer(vertexBuffer); - - this.setAttribPointers(reset); - - return this; - }, - - /** - * Sets the vertex attribute pointers. - * This should only be called after the vertex buffer has been bound. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setAttribPointers - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Reset the vertex attribute locations? - * - * @return {this} This WebGLPipeline instance. - */ - setAttribPointers: function (reset) - { - if (reset === undefined) { reset = false; } - - var gl = this.gl; - var attributes = this.attributes; - var vertexSize = this.vertexSize; - var program = this.program; - - for (var i = 0; i < attributes.length; i++) - { - var element = attributes[i]; - - if (reset) - { - var location = gl.getAttribLocation(program, element.name); - - if (location >= 0) - { - gl.enableVertexAttribArray(location); - gl.vertexAttribPointer(location, element.size, element.type, element.normalized, vertexSize, element.offset); - element.enabled = true; - element.location = location; - } - else if (location !== -1) - { - gl.disableVertexAttribArray(location); - } - } - else if (element.enabled) - { - gl.vertexAttribPointer(element.location, element.size, element.type, element.normalized, vertexSize, element.offset); - } - else if (!element.enabled && element.location > -1) - { - gl.disableVertexAttribArray(element.location); - element.location = -1; - } - } - }, - - /** - * Set whenever this WebGL Pipeline is bound to a WebGL Renderer. - * - * This method is called every time the WebGL Pipeline is attempted to be bound, even if it already is the current pipeline. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onBind - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - onBind: function () - { - // This is for updating uniform data it's called on each bind attempt. - return this; - }, - - /** - * Called before each frame is rendered, but after the canvas has been cleared. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreRender - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - onPreRender: function () - { - // called once every frame - return this; - }, - - /** - * Called before a Scene's Camera is rendered. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onRender - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. - * - * @return {this} This WebGLPipeline instance. - */ - onRender: function () - { - // called for each camera - return this; - }, - - /** - * Called after each frame has been completely rendered and snapshots have been taken. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostRender - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - onPostRender: function () - { - // called once every frame - return this; - }, - - /** - * Uploads the vertex data and emits a draw call - * for the current batch of vertices. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#flush - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - flush: function () - { - if (this.flushLocked) { return this; } - - this.flushLocked = true; - - var gl = this.gl; - var vertexCount = this.vertexCount; - var topology = this.topology; - var vertexSize = this.vertexSize; - - if (vertexCount === 0) - { - this.flushLocked = false; - return; - } - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); - gl.drawArrays(topology, 0, vertexCount); - - this.vertexCount = 0; - this.flushLocked = false; - - return this; - }, - - /** - * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - destroy: function () - { - var gl = this.gl; - - gl.deleteProgram(this.program); - gl.deleteBuffer(this.vertexBuffer); - - delete this.program; - delete this.vertexBuffer; - delete this.gl; - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The new value of the `float` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat1: function (name, x) - { - this.renderer.setFloat1(this.program, name, x); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The new X component of the `vec2` uniform. - * @param {number} y - The new Y component of the `vec2` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat2: function (name, x, y) - { - this.renderer.setFloat2(this.program, name, x, y); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The new X component of the `vec3` uniform. - * @param {number} y - The new Y component of the `vec3` uniform. - * @param {number} z - The new Z component of the `vec3` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat3: function (name, x, y, z) - { - this.renderer.setFloat3(this.program, name, x, y, z); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - X component of the uniform - * @param {number} y - Y component of the uniform - * @param {number} z - Z component of the uniform - * @param {number} w - W component of the uniform - * - * @return {this} This WebGLPipeline instance. - */ - setFloat4: function (name, x, y, z, w) - { - this.renderer.setFloat4(this.program, name, x, y, z, w); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat1v: function (name, arr) - { - this.renderer.setFloat1v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat2v: function (name, arr) - { - this.renderer.setFloat2v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat3v: function (name, arr) - { - this.renderer.setFloat3v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat4v: function (name, arr) - { - this.renderer.setFloat4v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt1 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The new value of the `int` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setInt1: function (name, x) - { - this.renderer.setInt1(this.program, name, x); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt2 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The new X component of the `ivec2` uniform. - * @param {integer} y - The new Y component of the `ivec2` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setInt2: function (name, x, y) - { - this.renderer.setInt2(this.program, name, x, y); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt3 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The new X component of the `ivec3` uniform. - * @param {integer} y - The new Y component of the `ivec3` uniform. - * @param {integer} z - The new Z component of the `ivec3` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setInt3: function (name, x, y, z) - { - this.renderer.setInt3(this.program, name, x, y, z); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt4 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - X component of the uniform - * @param {integer} y - Y component of the uniform - * @param {integer} z - Z component of the uniform - * @param {integer} w - W component of the uniform - * - * @return {this} This WebGLPipeline instance. - */ - setInt4: function (name, x, y, z, w) - { - this.renderer.setInt4(this.program, name, x, y, z, w); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix2 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. - * @param {Float32Array} matrix - The new values for the `mat2` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setMatrix2: function (name, transpose, matrix) - { - this.renderer.setMatrix2(this.program, name, transpose, matrix); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix3 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. - * @param {Float32Array} matrix - The new values for the `mat3` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setMatrix3: function (name, transpose, matrix) - { - this.renderer.setMatrix3(this.program, name, transpose, matrix); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix4 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - Should the matrix be transpose - * @param {Float32Array} matrix - Matrix data - * - * @return {this} This WebGLPipeline instance. - */ - setMatrix4: function (name, transpose, matrix) - { - this.renderer.setMatrix4(this.program, name, transpose, matrix); - - return this; - } - -}); - -module.exports = WebGLPipeline; - - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var GetFastValue = __webpack_require__(2); -var ModelViewProjection = __webpack_require__(113); -var ProjectOrtho = __webpack_require__(185); -var ShaderSourceFS = __webpack_require__(810); -var ShaderSourceVS = __webpack_require__(811); -var TransformMatrix = __webpack_require__(31); -var Utils = __webpack_require__(10); -var WebGLPipeline = __webpack_require__(111); - -/** - * @classdesc - * - * The Multi Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL. - * Virtually all Game Objects use this pipeline by default, including Sprites, Graphics - * and Tilemaps. It handles the batching of quads and tris, as well as methods for - * drawing and batching geometry data. - * - * Prior to Phaser v3.50 this pipeline was called the `TextureTintPipeline`. - * - * In previous versions of Phaser only one single texture unit was supported at any one time. - * The Multi Pipeline is an evolution of the old Texture Tint Pipeline, updated to support - * multi-textures for increased performance. - * - * The fragment shader it uses can be found in `shaders/src/Multi.frag`. - * The vertex shader it uses can be found in `shaders/src/Multi.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * `inTexId` (float, offset 16) - * `inTintEffect` (float, offset 20) - * `inTint` (vec4, offset 24, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * `uViewMatrix` (mat4) - * `uModelMatrix` (mat4) - * `uMainSampler` (sampler2D array) - * - * If you wish to create a custom pipeline extending from this one, you can use two string - * declarations in your fragment shader source: `%count%` and `%forloop%`, where `count` is - * used to set the number of `sampler2Ds` available, and `forloop` is a block of GLSL code - * that will get the currently bound texture unit. - * - * This pipeline will automatically inject that code for you, should those values exist - * in your shader source. If you wish to handle this yourself, you can also use the - * function `Utils.parseFragmentShaderMaxTextures`. - * - * If you wish to create a pipeline that works from a single texture, or that doesn't have - * internal texture iteration, please see the `SinglePipeline` instead. - * - * @class MultiPipeline - * @extends Phaser.Renderer.WebGL.WebGLPipeline - * @memberof Phaser.Renderer.WebGL.Pipelines - * @constructor - * @since 3.50.0 - * - * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. - */ -var MultiPipeline = new Class({ - - Extends: WebGLPipeline, - - Mixins: [ - ModelViewProjection - ], - - initialize: - - function MultiPipeline (config) - { - var renderer = config.game.renderer; - var gl = renderer.gl; - - var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); - - // Vertex Size = attribute size added together (2 + 2 + 1 + 1 + 4) inc maxTextures - - config.fragShader = Utils.parseFragmentShaderMaxTextures(fragmentShaderSource, renderer.maxTextures); - config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 - }, - { - name: 'inTexCoord', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 8, - enabled: false, - location: -1 - }, - { - name: 'inTexId', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 16, - enabled: false, - location: -1 - }, - { - name: 'inTintEffect', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 20, - enabled: false, - location: -1 - }, - { - name: 'inTint', - size: 4, - type: gl.UNSIGNED_BYTE, - normalized: true, - offset: 24, - enabled: false, - location: -1 - } - ]); - - WebGLPipeline.call(this, config); - - /** - * Float32 view of the array buffer containing the pipeline's vertices. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#vertexViewF32 - * @type {Float32Array} - * @since 3.0.0 - */ - this.vertexViewF32 = new Float32Array(this.vertexData); - - /** - * Uint32 view of the array buffer containing the pipeline's vertices. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#vertexViewU32 - * @type {Uint32Array} - * @since 3.0.0 - */ - this.vertexViewU32 = new Uint32Array(this.vertexData); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix3 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix4 = new TransformMatrix(); - - /** - * Used internally to draw stroked triangles. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempTriangle - * @type {array} - * @private - * @since 3.12.0 - */ - this.tempTriangle = [ - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 } - ]; - - /** - * The tint effect to be applied by the shader in the next geometry draw: - * - * 0 = texture multiplied by color - * 1 = solid color + texture alpha - * 2 = solid color, no texture - * 3 = solid texture, no color - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tintEffect - * @type {number} - * @private - * @since 3.12.0 - */ - this.tintEffect = 2; - - /** - * Cached stroke tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#strokeTint - * @type {object} - * @private - * @since 3.12.0 - */ - this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Cached fill tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#fillTint - * @type {object} - * @private - * @since 3.12.0 - */ - this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Internal texture frame reference. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#currentFrame - * @type {Phaser.Textures.Frame} - * @private - * @since 3.12.0 - */ - this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#firstQuad - * @type {array} - * @private - * @since 3.12.0 - */ - this.firstQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#prevQuad - * @type {array} - * @private - * @since 3.12.0 - */ - this.prevQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Used internally for triangulating a polygon. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#polygonCache - * @type {array} - * @private - * @since 3.12.0 - */ - this.polygonCache = []; - - this.mvpInit(); - }, - - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - this.renderer.setInt1iv(this.program, 'uMainSampler', this.renderer.textureIndexes); - - return this; - }, - - /** - * Called every time a Game Object needs to use this pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#onBind - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. - * - * @return {this} This WebGLPipeline instance. - */ - onBind: function () - { - this.mvpUpdate(); - - return this; - }, - - /** - * Resizes this pipeline and updates the projection. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#resize - * @since 3.0.0 - * - * @param {number} width - The new width. - * @param {number} height - The new height. - * @param {number} resolution - The resolution. - * - * @return {this} This WebGLPipeline instance. - */ - resize: function (width, height, resolution) - { - WebGLPipeline.prototype.resize.call(this, width, height, resolution); - - ProjectOrtho(this, 0, this.width, this.height, 0, -1000, 1000); - - return this; - }, - - /** - * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#setTexture2D - * @since 3.1.0 - * - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. - * - * @return {number} The assigned texture unit. - */ - setTexture2D: function (texture) - { - if (texture === undefined) { texture = this.renderer.blankTexture.glTexture; } - - this.currentUnit = this.renderer.setTexture2D(texture); - - return this.currentUnit; - }, - - /** - * Uploads the vertex data and emits a draw call for the current batch of vertices. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#flush - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - flush: function () - { - var gl = this.gl; - var vertexCount = this.vertexCount; - var vertexSize = this.vertexSize; - - if (vertexCount > 0) - { - if (vertexCount === this.vertexCapacity) - { - gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW); - } - else - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); - } - - gl.drawArrays(this.topology, 0, vertexCount); - - this.vertexCount = 0; - } - - return this; - }, - - /** - * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchSprite - * @since 3.0.0 - * - * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} sprite - The texture based Game Object to add to the batch. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set. - */ - batchSprite: function (sprite, camera, parentTransformMatrix) - { - // Will cause a flush if this isn't the current pipeline, vertexbuffer or program - this.renderer.pipelines.set(this); - - var camMatrix = this._tempMatrix1; - var spriteMatrix = this._tempMatrix2; - var calcMatrix = this._tempMatrix3; - - var frame = sprite.frame; - var texture = frame.glTexture; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - var frameX = frame.x; - var frameY = frame.y; - var frameWidth = frame.cutWidth; - var frameHeight = frame.cutHeight; - var customPivot = frame.customPivot; - - var displayOriginX = sprite.displayOriginX; - var displayOriginY = sprite.displayOriginY; - - var x = -displayOriginX + frameX; - var y = -displayOriginY + frameY; - - if (sprite.isCropped) - { - var crop = sprite._crop; - - if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) - { - frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); - } - - u0 = crop.u0; - v0 = crop.v0; - u1 = crop.u1; - v1 = crop.v1; - - frameWidth = crop.width; - frameHeight = crop.height; - - frameX = crop.x; - frameY = crop.y; - - x = -displayOriginX + frameX; - y = -displayOriginY + frameY; - } - - var flipX = 1; - var flipY = 1; - - if (sprite.flipX) - { - if (!customPivot) - { - x += (-frame.realWidth + (displayOriginX * 2)); - } - - flipX = -1; - } - - // Auto-invert the flipY if this is coming from a GLTexture - if (sprite.flipY || (frame.source.isGLTexture && !texture.flipY)) - { - if (!customPivot) - { - y += (-frame.realHeight + (displayOriginY * 2)); - } - - flipY = -1; - } - - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); - - camMatrix.copyFrom(camera.matrix); - - if (parentTransformMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = sprite.x; - spriteMatrix.f = sprite.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; - spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - var xw = x + frameWidth; - var yh = y + frameHeight; - - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - var tintTL = Utils.getTintAppendFloatAlpha(sprite._tintTL, camera.alpha * sprite._alphaTL); - var tintTR = Utils.getTintAppendFloatAlpha(sprite._tintTR, camera.alpha * sprite._alphaTR); - var tintBL = Utils.getTintAppendFloatAlpha(sprite._tintBL, camera.alpha * sprite._alphaBL); - var tintBR = Utils.getTintAppendFloatAlpha(sprite._tintBR, camera.alpha * sprite._alphaBR); - - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - // So batchQuad never assigns a unit to the glTexture, but to the textureSource instead - if (this.vertexCount + 6 > this.vertexCapacity) - { - this.flush(); - } - - var unit = this.setGameObject(sprite); - - var tintEffect = (sprite._isTinted && sprite.tintFill); - - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit); - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchQuad - * @since 3.12.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.vertexCount + 6 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - this.vertexCount += 6; - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTri - * @since 3.12.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.vertexCount + 3 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - this.vertexCount += 3; - - return hasFlushed; - }, - - /** - * Generic function for batching a textured quad using argument values instead of a Game Object. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTexture - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject. - * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad. - * @param {integer} textureWidth - Real texture width. - * @param {integer} textureHeight - Real texture height. - * @param {number} srcX - X coordinate of the quad. - * @param {number} srcY - Y coordinate of the quad. - * @param {number} srcWidth - Width of the quad. - * @param {number} srcHeight - Height of the quad. - * @param {number} scaleX - X component of scale. - * @param {number} scaleY - Y component of scale. - * @param {number} rotation - Rotation of the quad. - * @param {boolean} flipX - Indicates if the quad is horizontally flipped. - * @param {boolean} flipY - Indicates if the quad is vertically flipped. - * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll. - * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll. - * @param {number} displayOriginX - Horizontal origin in pixels. - * @param {number} displayOriginY - Vertical origin in pixels. - * @param {number} frameX - X coordinate of the texture frame. - * @param {number} frameY - Y coordinate of the texture frame. - * @param {number} frameWidth - Width of the texture frame. - * @param {number} frameHeight - Height of the texture frame. - * @param {integer} tintTL - Tint for top left. - * @param {integer} tintTR - Tint for top right. - * @param {integer} tintBL - Tint for bottom left. - * @param {integer} tintBR - Tint for bottom right. - * @param {number} tintEffect - The tint effect. - * @param {number} uOffset - Horizontal offset on texture coordinate. - * @param {number} vOffset - Vertical offset on texture coordinate. - * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. - * @param {boolean} [skipFlip=false] - Skip the renderTexture check. - * @param {number} [textureUnit] - Use the currently bound texture unit? - */ - batchTexture: function ( - gameObject, - texture, - textureWidth, textureHeight, - srcX, srcY, - srcWidth, srcHeight, - scaleX, scaleY, - rotation, - flipX, flipY, - scrollFactorX, scrollFactorY, - displayOriginX, displayOriginY, - frameX, frameY, frameWidth, frameHeight, - tintTL, tintTR, tintBL, tintBR, tintEffect, - uOffset, vOffset, - camera, - parentTransformMatrix, - skipFlip, - textureUnit) - { - var renderer = this.renderer; - - renderer.pipelines.set(this, gameObject); - - var camMatrix = this._tempMatrix1; - var spriteMatrix = this._tempMatrix2; - var calcMatrix = this._tempMatrix3; - - var u0 = (frameX / textureWidth) + uOffset; - var v0 = (frameY / textureHeight) + vOffset; - var u1 = (frameX + frameWidth) / textureWidth + uOffset; - var v1 = (frameY + frameHeight) / textureHeight + vOffset; - - var width = srcWidth; - var height = srcHeight; - - var x = -displayOriginX; - var y = -displayOriginY; - - if (gameObject.isCropped) - { - var crop = gameObject._crop; - - width = crop.width; - height = crop.height; - - srcWidth = crop.width; - srcHeight = crop.height; - - frameX = crop.x; - frameY = crop.y; - - var ox = frameX; - var oy = frameY; - - if (flipX) - { - ox = (frameWidth - crop.x - crop.width); - } - - if (flipY && !texture.isRenderTexture) - { - oy = (frameHeight - crop.y - crop.height); - } - - u0 = (ox / textureWidth) + uOffset; - v0 = (oy / textureHeight) + vOffset; - u1 = (ox + crop.width) / textureWidth + uOffset; - v1 = (oy + crop.height) / textureHeight + vOffset; - - x = -displayOriginX + frameX; - y = -displayOriginY + frameY; - } - - // Invert the flipY if this is a RenderTexture - flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); - - if (flipX) - { - width *= -1; - x += srcWidth; - } - - if (flipY) - { - height *= -1; - y += srcHeight; - } - - var xw = x + width; - var yh = y + height; - - spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentTransformMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = srcX; - spriteMatrix.f = srcY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * scrollFactorX; - spriteMatrix.f -= camera.scrollY * scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - if (textureUnit === undefined) - { - textureUnit = this.renderer.setTexture2D(texture); - } - - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); - }, - - /** - * Adds a Texture Frame into the batch for rendering. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTextureFrame - * @since 3.12.0 - * - * @param {Phaser.Textures.Frame} frame - The Texture Frame to be rendered. - * @param {number} x - The horizontal position to render the texture at. - * @param {number} y - The vertical position to render the texture at. - * @param {number} tint - The tint color. - * @param {number} alpha - The alpha value. - * @param {Phaser.GameObjects.Components.TransformMatrix} transformMatrix - The Transform Matrix to use for the texture. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - A parent Transform Matrix. - */ - batchTextureFrame: function ( - frame, - x, y, - tint, alpha, - transformMatrix, - parentTransformMatrix - ) - { - this.renderer.pipelines.set(this); - - var spriteMatrix = this._tempMatrix1.copyFrom(transformMatrix); - var calcMatrix = this._tempMatrix2; - - var xw = x + frame.width; - var yh = y + frame.height; - - if (parentTransformMatrix) - { - spriteMatrix.multiply(parentTransformMatrix, calcMatrix); - } - else - { - calcMatrix = spriteMatrix; - } - - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - // this.setTexture2D(frame.glTexture, 0); - var unit = this.renderer.setTextureSource(frame.source); - - tint = Utils.getTintAppendFloatAlpha(tint, alpha); - - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, unit); - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * - * The dimensions are run through `Math.floor` before the quad is generated. - * - * Rectangle has no transform values and isn't transformed into the local space. - * - * Used for directly batching untransformed rectangles, such as Camera background colors. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#drawFillRect - * @since 3.12.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {number} color - Color of the rectangle to draw. - * @param {number} alpha - Alpha value of the rectangle to draw. - */ - drawFillRect: function (x, y, width, height, color, alpha) - { - x = Math.floor(x); - y = Math.floor(y); - - var xw = Math.floor(x + width); - var yh = Math.floor(y + height); - - var blank = this.renderer.blankTexture.glTexture; - - var unit = this.renderer.setTexture2D(blank); - - var tint = Utils.getTintAppendFloatAlphaAndSwap(color, alpha); - - this.batchQuad(x, y, x, yh, xw, yh, xw, y, 0, 0, 1, 1, tint, tint, tint, tint, 2, blank, unit); - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * Rectangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillRect - * @since 3.12.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var xw = x + width; - var yh = y + height; - - var x0 = calcMatrix.getX(x, y); - var y0 = calcMatrix.getY(x, y); - - var x1 = calcMatrix.getX(x, yh); - var y1 = calcMatrix.getY(x, yh); - - var x2 = calcMatrix.getX(xw, yh); - var y2 = calcMatrix.getY(xw, yh); - - var x3 = calcMatrix.getX(xw, y); - var y3 = calcMatrix.getY(xw, y); - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - var tint = this.fillTint; - - this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tint.TL, tint.TR, tint.BL, tint.BR, this.tintEffect); - }, - - /** - * Pushes a filled triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillTriangle - * @since 3.12.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.tintEffect); - }, - - /** - * Pushes a stroked triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchStrokeTriangle - * @since 3.12.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {number} lineWidth - The width of the line in pixels. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) - { - var tempTriangle = this.tempTriangle; - - tempTriangle[0].x = x0; - tempTriangle[0].y = y0; - tempTriangle[0].width = lineWidth; - - tempTriangle[1].x = x1; - tempTriangle[1].y = y1; - tempTriangle[1].width = lineWidth; - - tempTriangle[2].x = x2; - tempTriangle[2].y = y2; - tempTriangle[2].width = lineWidth; - - tempTriangle[3].x = x0; - tempTriangle[3].y = y0; - tempTriangle[3].width = lineWidth; - - this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillPath - * @since 3.12.0 - * - * @param {array} path - Collection of points that represent the path. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillPath: function (path, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var length = path.length; - var polygonCache = this.polygonCache; - var polygonIndexArray; - var point; - - var tintTL = this.fillTint.TL; - var tintTR = this.fillTint.TR; - var tintBL = this.fillTint.BL; - var tintEffect = this.tintEffect; - - for (var pathIndex = 0; pathIndex < length; ++pathIndex) - { - point = path[pathIndex]; - polygonCache.push(point.x, point.y); - } - - polygonIndexArray = Earcut(polygonCache); - length = polygonIndexArray.length; - - var frame = this.currentFrame; - - for (var index = 0; index < length; index += 3) - { - var p0 = polygonIndexArray[index + 0] * 2; - var p1 = polygonIndexArray[index + 1] * 2; - var p2 = polygonIndexArray[index + 2] * 2; - - var x0 = polygonCache[p0 + 0]; - var y0 = polygonCache[p0 + 1]; - var x1 = polygonCache[p1 + 0]; - var y1 = polygonCache[p1 + 1]; - var x2 = polygonCache[p2 + 0]; - var y2 = polygonCache[p2 + 1]; - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect); - } - - polygonCache.length = 0; - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchStrokePath - * @since 3.12.0 - * - * @param {array} path - Collection of points that represent the path. - * @param {number} lineWidth - The width of the line segments in pixels. - * @param {boolean} pathOpen - Indicates if the path should be closed or left open. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - // Reset the closePath booleans - this.prevQuad[4] = 0; - this.firstQuad[4] = 0; - - var pathLength = path.length - 1; - - for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) - { - var point0 = path[pathIndex]; - var point1 = path[pathIndex + 1]; - - this.batchLine( - point0.x, - point0.y, - point1.x, - point1.y, - point0.width / 2, - point1.width / 2, - lineWidth, - pathIndex, - !pathOpen && (pathIndex === pathLength - 1), - currentMatrix, - parentMatrix - ); - } - }, - - /** - * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. - * Assumes a texture has already been set, prior to calling this function. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchLine - * @since 3.12.0 - * - * @param {number} ax - X coordinate to the start of the line - * @param {number} ay - Y coordinate to the start of the line - * @param {number} bx - X coordinate to the end of the line - * @param {number} by - Y coordinate to the end of the line - * @param {number} aLineWidth - Width of the start of the line - * @param {number} bLineWidth - Width of the end of the line - * @param {Float32Array} currentMatrix - Parent matrix, generally used by containers - */ - batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var dx = bx - ax; - var dy = by - ay; - - var len = Math.sqrt(dx * dx + dy * dy); - var al0 = aLineWidth * (by - ay) / len; - var al1 = aLineWidth * (ax - bx) / len; - var bl0 = bLineWidth * (by - ay) / len; - var bl1 = bLineWidth * (ax - bx) / len; - - var lx0 = bx - bl0; - var ly0 = by - bl1; - var lx1 = ax - al0; - var ly1 = ay - al1; - var lx2 = bx + bl0; - var ly2 = by + bl1; - var lx3 = ax + al0; - var ly3 = ay + al1; - - // tx0 = bottom right - var brX = calcMatrix.getX(lx0, ly0); - var brY = calcMatrix.getY(lx0, ly0); - - // tx1 = bottom left - var blX = calcMatrix.getX(lx1, ly1); - var blY = calcMatrix.getY(lx1, ly1); - - // tx2 = top right - var trX = calcMatrix.getX(lx2, ly2); - var trY = calcMatrix.getY(lx2, ly2); - - // tx3 = top left - var tlX = calcMatrix.getX(lx3, ly3); - var tlY = calcMatrix.getY(lx3, ly3); - - var tint = this.strokeTint; - var tintEffect = this.tintEffect; - - var tintTL = tint.TL; - var tintTR = tint.TR; - var tintBL = tint.BL; - var tintBR = tint.BR; - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - // TL, BL, BR, TR - this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - - if (lineWidth <= 2) - { - // No point doing a linejoin if the line isn't thick enough - return; - } - - var prev = this.prevQuad; - var first = this.firstQuad; - - if (index > 0 && prev[4]) - { - this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - } - else - { - first[0] = tlX; - first[1] = tlY; - first[2] = blX; - first[3] = blY; - first[4] = 1; - } - - if (closePath && first[4]) - { - // Add a join for the final path segment - this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - } - else - { - // Store it - - prev[0] = brX; - prev[1] = brY; - prev[2] = trX; - prev[3] = trY; - prev[4] = 1; - } - } - -}); - -module.exports = MultiPipeline; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Implements a model view projection matrices. - * Pipelines can implement this for doing 2D and 3D rendering. - * - * @namespace Phaser.Renderer.WebGL.Pipelines.ModelViewProjection - * @since 3.0.0 - */ -var ModelViewProjection = { - - /** - * Dirty flag for checking if model matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - modelMatrixDirty: false, - - /** - * Dirty flag for checking if view matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - viewMatrixDirty: false, - - /** - * Dirty flag for checking if projection matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - projectionMatrixDirty: false, - - /** - * Model matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - modelMatrix: null, - - /** - * View matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - viewMatrix: null, - - /** - * Projection matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - projectionMatrix: null, - - /** - * Initializes MVP matrices with an identity matrix - * - * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpInit - * @since 3.0.0 - */ - mvpInit: function () - { - this.modelMatrixDirty = true; - this.viewMatrixDirty = true; - this.projectionMatrixDirty = true; - - this.modelMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - this.viewMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - this.projectionMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * If dirty flags are set then the matrices are uploaded to the GPU. - * - * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpUpdate - * @since 3.0.0 - */ - mvpUpdate: function () - { - var program = this.program; - - if (this.modelMatrixDirty) - { - this.renderer.setMatrix4(program, 'uModelMatrix', false, this.modelMatrix); - this.modelMatrixDirty = false; - } - - if (this.viewMatrixDirty) - { - this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - this.viewMatrixDirty = false; - } - - if (this.projectionMatrixDirty) - { - this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); - this.projectionMatrixDirty = false; - } - - return this; - } -}; - -module.exports = ModelViewProjection; - - -/***/ }), -/* 114 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25004,7 +29723,7 @@ module.exports = ModelViewProjection; var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var ImageRender = __webpack_require__(994); +var ImageRender = __webpack_require__(1051); /** * @classdesc @@ -25040,7 +29759,7 @@ var ImageRender = __webpack_require__(994); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Image = new Class({ @@ -25093,7 +29812,7 @@ module.exports = Image; /***/ }), -/* 115 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -25122,8 +29841,8 @@ module.exports = HasValue; /***/ }), -/* 116 */, -/* 117 */ +/* 124 */, +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -25132,14 +29851,14 @@ module.exports = HasValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); -var Circle = __webpack_require__(68); -var CircleContains = __webpack_require__(57); +var BlendModes = __webpack_require__(48); +var Circle = __webpack_require__(71); +var CircleContains = __webpack_require__(62); var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(50); +var RectangleContains = __webpack_require__(56); /** * @classdesc @@ -25222,7 +29941,7 @@ var Zone = new Class({ * display lists without causing a batch flush. * * @name Phaser.GameObjects.Zone#blendMode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.blendMode = BlendModes.NORMAL; @@ -25436,7 +30155,7 @@ module.exports = Zone; /***/ }), -/* 118 */ +/* 126 */ /***/ (function(module, exports) { /** @@ -25464,743 +30183,7 @@ module.exports = Perimeter; /***/ }), -/* 119 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a hex color value, such as 0xff00ff (for purple), it will return a - * numeric representation of it (i.e. 16711935) for use in WebGL tinting. - * - * @function Phaser.Display.Color.GetColorFromValue - * @since 3.50.0 - * - * @param {number} red - The hex color value, such as 0xff0000. - * - * @return {number} The combined color value. - */ -var GetColorFromValue = function (value) -{ - return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); -}; - -module.exports = GetColorFromValue; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Events = __webpack_require__(293); - -/** - * @callback DataEachCallback - * - * @param {*} parent - The parent object of the DataManager. - * @param {string} key - The key of the value. - * @param {*} value - The value. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. - */ - -/** - * @classdesc - * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. - * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, - * or have a property called `events` that is an instance of it. - * - * @class DataManager - * @memberof Phaser.Data - * @constructor - * @since 3.0.0 - * - * @param {object} parent - The object that this DataManager belongs to. - * @param {Phaser.Events.EventEmitter} [eventEmitter] - The DataManager's event emitter. - */ -var DataManager = new Class({ - - initialize: - - function DataManager (parent, eventEmitter) - { - /** - * The object that this DataManager belongs to. - * - * @name Phaser.Data.DataManager#parent - * @type {*} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * The DataManager's event emitter. - * - * @name Phaser.Data.DataManager#events - * @type {Phaser.Events.EventEmitter} - * @since 3.0.0 - */ - this.events = eventEmitter; - - if (!eventEmitter) - { - this.events = (parent.events) ? parent.events : parent; - } - - /** - * The data list. - * - * @name Phaser.Data.DataManager#list - * @type {Object.} - * @default {} - * @since 3.0.0 - */ - this.list = {}; - - /** - * The public values list. You can use this to access anything you have stored - * in this Data Manager. For example, if you set a value called `gold` you can - * access it via: - * - * ```javascript - * this.data.values.gold; - * ``` - * - * You can also modify it directly: - * - * ```javascript - * this.data.values.gold += 1000; - * ``` - * - * Doing so will emit a `setdata` event from the parent of this Data Manager. - * - * Do not modify this object directly. Adding properties directly to this object will not - * emit any events. Always use `DataManager.set` to create new items the first time around. - * - * @name Phaser.Data.DataManager#values - * @type {Object.} - * @default {} - * @since 3.10.0 - */ - this.values = {}; - - /** - * Whether setting data is frozen for this DataManager. - * - * @name Phaser.Data.DataManager#_frozen - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._frozen = false; - - if (!parent.hasOwnProperty('sys') && this.events) - { - this.events.once('destroy', this.destroy, this); - } - }, - - /** - * Retrieves the value for the given key, or undefined if it doesn't exist. - * - * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * - * ```javascript - * this.data.get('gold'); - * ``` - * - * Or access the value directly: - * - * ```javascript - * this.data.values.gold; - * ``` - * - * You can also pass in an array of keys, in which case an array of values will be returned: - * - * ```javascript - * this.data.get([ 'gold', 'armor', 'health' ]); - * ``` - * - * This approach is useful for destructuring arrays in ES6. - * - * @method Phaser.Data.DataManager#get - * @since 3.0.0 - * - * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. - * - * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. - */ - get: function (key) - { - var list = this.list; - - if (Array.isArray(key)) - { - var output = []; - - for (var i = 0; i < key.length; i++) - { - output.push(list[key[i]]); - } - - return output; - } - else - { - return list[key]; - } - }, - - /** - * Retrieves all data values in a new object. - * - * @method Phaser.Data.DataManager#getAll - * @since 3.0.0 - * - * @return {Object.} All data values. - */ - getAll: function () - { - var results = {}; - - for (var key in this.list) - { - if (this.list.hasOwnProperty(key)) - { - results[key] = this.list[key]; - } - } - - return results; - }, - - /** - * Queries the DataManager for the values of keys matching the given regular expression. - * - * @method Phaser.Data.DataManager#query - * @since 3.0.0 - * - * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). - * - * @return {Object.} The values of the keys matching the search string. - */ - query: function (search) - { - var results = {}; - - for (var key in this.list) - { - if (this.list.hasOwnProperty(key) && key.match(search)) - { - results[key] = this.list[key]; - } - } - - return results; - }, - - /** - * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * - * ```javascript - * data.set('name', 'Red Gem Stone'); - * ``` - * - * You can also pass in an object of key value pairs as the first argument: - * - * ```javascript - * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); - * ``` - * - * To get a value back again you can call `get`: - * - * ```javascript - * data.get('gold'); - * ``` - * - * Or you can access the value directly via the `values` property, where it works like any other variable: - * - * ```javascript - * data.values.gold += 50; - * ``` - * - * When the value is first set, a `setdata` event is emitted. - * - * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. - * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. - * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * - * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * - * @method Phaser.Data.DataManager#set - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.0.0 - * - * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. - * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. - * - * @return {this} This DataManager object. - */ - set: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (typeof key === 'string') - { - return this.setValue(key, data); - } - else - { - for (var entry in key) - { - this.setValue(entry, key[entry]); - } - } - - return this; - }, - - /** - * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. - * - * When the value is first set, a `setdata` event is emitted. - * - * @method Phaser.Data.DataManager#inc - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.23.0 - * - * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - inc: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (data === undefined) - { - data = 1; - } - - var value = this.get(key); - if (value === undefined) - { - value = 0; - } - - this.set(key, (value + data)); - - return this; - }, - - /** - * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. - * - * When the value is first set, a `setdata` event is emitted. - * - * @method Phaser.Data.DataManager#toggle - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.23.0 - * - * @param {(string|object)} key - The key to toggle the value for. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - toggle: function (key) - { - if (this._frozen) - { - return this; - } - - this.set(key, !this.get(key)); - - return this; - }, - - /** - * Internal value setter, called automatically by the `set` method. - * - * @method Phaser.Data.DataManager#setValue - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @private - * @since 3.10.0 - * - * @param {string} key - The key to set the value for. - * @param {*} data - The value to set. - * - * @return {this} This DataManager object. - */ - setValue: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (this.has(key)) - { - // Hit the key getter, which will in turn emit the events. - this.values[key] = data; - } - else - { - var _this = this; - var list = this.list; - var events = this.events; - var parent = this.parent; - - Object.defineProperty(this.values, key, { - - enumerable: true, - - configurable: true, - - get: function () - { - return list[key]; - }, - - set: function (value) - { - if (!_this._frozen) - { - var previousValue = list[key]; - list[key] = value; - - events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); - events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); - } - } - - }); - - list[key] = data; - - events.emit(Events.SET_DATA, parent, key, data); - } - - return this; - }, - - /** - * Passes all data entries to the given callback. - * - * @method Phaser.Data.DataManager#each - * @since 3.0.0 - * - * @param {DataEachCallback} callback - The function to call. - * @param {*} [context] - Value to use as `this` when executing callback. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. - * - * @return {this} This DataManager object. - */ - each: function (callback, context) - { - var args = [ this.parent, null, undefined ]; - - for (var i = 1; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (var key in this.list) - { - args[1] = key; - args[2] = this.list[key]; - - callback.apply(context, args); - } - - return this; - }, - - /** - * Merge the given object of key value pairs into this DataManager. - * - * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) - * will emit a `changedata` event. - * - * @method Phaser.Data.DataManager#merge - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.0.0 - * - * @param {Object.} data - The data to merge. - * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. - * - * @return {this} This DataManager object. - */ - merge: function (data, overwrite) - { - if (overwrite === undefined) { overwrite = true; } - - // Merge data from another component into this one - for (var key in data) - { - if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) - { - this.setValue(key, data[key]); - } - } - - return this; - }, - - /** - * Remove the value for the given key. - * - * If the key is found in this Data Manager it is removed from the internal lists and a - * `removedata` event is emitted. - * - * You can also pass in an array of keys, in which case all keys in the array will be removed: - * - * ```javascript - * this.data.remove([ 'gold', 'armor', 'health' ]); - * ``` - * - * @method Phaser.Data.DataManager#remove - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.0.0 - * - * @param {(string|string[])} key - The key to remove, or an array of keys to remove. - * - * @return {this} This DataManager object. - */ - remove: function (key) - { - if (this._frozen) - { - return this; - } - - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - this.removeValue(key[i]); - } - } - else - { - return this.removeValue(key); - } - - return this; - }, - - /** - * Internal value remover, called automatically by the `remove` method. - * - * @method Phaser.Data.DataManager#removeValue - * @private - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.10.0 - * - * @param {string} key - The key to set the value for. - * - * @return {this} This DataManager object. - */ - removeValue: function (key) - { - if (this.has(key)) - { - var data = this.list[key]; - - delete this.list[key]; - delete this.values[key]; - - this.events.emit(Events.REMOVE_DATA, this.parent, key, data); - } - - return this; - }, - - /** - * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. - * - * @method Phaser.Data.DataManager#pop - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.0.0 - * - * @param {string} key - The key of the value to retrieve and delete. - * - * @return {*} The value of the given key. - */ - pop: function (key) - { - var data = undefined; - - if (!this._frozen && this.has(key)) - { - data = this.list[key]; - - delete this.list[key]; - delete this.values[key]; - - this.events.emit(Events.REMOVE_DATA, this.parent, key, data); - } - - return data; - }, - - /** - * Determines whether the given key is set in this Data Manager. - * - * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * - * @method Phaser.Data.DataManager#has - * @since 3.0.0 - * - * @param {string} key - The key to check. - * - * @return {boolean} Returns `true` if the key exists, otherwise `false`. - */ - has: function (key) - { - return this.list.hasOwnProperty(key); - }, - - /** - * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts - * to create new values or update existing ones. - * - * @method Phaser.Data.DataManager#setFreeze - * @since 3.0.0 - * - * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. - * - * @return {this} This DataManager object. - */ - setFreeze: function (value) - { - this._frozen = value; - - return this; - }, - - /** - * Delete all data in this Data Manager and unfreeze it. - * - * @method Phaser.Data.DataManager#reset - * @since 3.0.0 - * - * @return {this} This DataManager object. - */ - reset: function () - { - for (var key in this.list) - { - delete this.list[key]; - delete this.values[key]; - } - - this._frozen = false; - - return this; - }, - - /** - * Destroy this data manager. - * - * @method Phaser.Data.DataManager#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.reset(); - - this.events.off(Events.CHANGE_DATA); - this.events.off(Events.SET_DATA); - this.events.off(Events.REMOVE_DATA); - - this.parent = null; - }, - - /** - * Gets or sets the frozen state of this Data Manager. - * A frozen Data Manager will block all attempts to create new values or update existing ones. - * - * @name Phaser.Data.DataManager#freeze - * @type {boolean} - * @since 3.0.0 - */ - freeze: { - - get: function () - { - return this._frozen; - }, - - set: function (value) - { - this._frozen = (value) ? true : false; - } - - }, - - /** - * Return the total number of entries in this Data Manager. - * - * @name Phaser.Data.DataManager#count - * @type {integer} - * @since 3.0.0 - */ - count: { - - get: function () - { - var i = 0; - - for (var key in this.list) - { - if (this.list[key] !== undefined) - { - i++; - } - } - - return i; - } - - } - -}); - -module.exports = DataManager; - - -/***/ }), -/* 121 */ +/* 127 */ /***/ (function(module, exports) { /** @@ -26241,7 +30224,7 @@ module.exports = Shuffle; /***/ }), -/* 122 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26256,23 +30239,23 @@ module.exports = Shuffle; module.exports = { - ADD_ANIMATION: __webpack_require__(652), - ANIMATION_COMPLETE: __webpack_require__(653), - ANIMATION_COMPLETE_KEY: __webpack_require__(654), - ANIMATION_REPEAT: __webpack_require__(655), - ANIMATION_RESTART: __webpack_require__(656), - ANIMATION_START: __webpack_require__(657), - ANIMATION_STOP: __webpack_require__(658), - ANIMATION_UPDATE: __webpack_require__(659), - PAUSE_ALL: __webpack_require__(660), - REMOVE_ANIMATION: __webpack_require__(661), - RESUME_ALL: __webpack_require__(662) + ADD_ANIMATION: __webpack_require__(692), + ANIMATION_COMPLETE: __webpack_require__(693), + ANIMATION_COMPLETE_KEY: __webpack_require__(694), + ANIMATION_REPEAT: __webpack_require__(695), + ANIMATION_RESTART: __webpack_require__(696), + ANIMATION_START: __webpack_require__(697), + ANIMATION_STOP: __webpack_require__(698), + ANIMATION_UPDATE: __webpack_require__(699), + PAUSE_ALL: __webpack_require__(700), + REMOVE_ANIMATION: __webpack_require__(701), + RESUME_ALL: __webpack_require__(702) }; /***/ }), -/* 123 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26281,18 +30264,18 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Back = __webpack_require__(315); -var Bounce = __webpack_require__(316); -var Circular = __webpack_require__(317); -var Cubic = __webpack_require__(318); -var Elastic = __webpack_require__(319); -var Expo = __webpack_require__(320); -var Linear = __webpack_require__(321); -var Quadratic = __webpack_require__(322); -var Quartic = __webpack_require__(323); -var Quintic = __webpack_require__(324); -var Sine = __webpack_require__(325); -var Stepped = __webpack_require__(326); +var Back = __webpack_require__(326); +var Bounce = __webpack_require__(327); +var Circular = __webpack_require__(328); +var Cubic = __webpack_require__(329); +var Elastic = __webpack_require__(330); +var Expo = __webpack_require__(331); +var Linear = __webpack_require__(332); +var Quadratic = __webpack_require__(333); +var Quartic = __webpack_require__(334); +var Quintic = __webpack_require__(335); +var Sine = __webpack_require__(336); +var Stepped = __webpack_require__(337); // EaseMap module.exports = { @@ -26353,7 +30336,7 @@ module.exports = { /***/ }), -/* 124 */ +/* 130 */ /***/ (function(module, exports) { /** @@ -26383,179 +30366,7 @@ module.exports = Linear; /***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the operating system of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.os` from within any Scene. - * - * @typedef {object} Phaser.Device.OS - * @since 3.0.0 - * - * @property {boolean} android - Is running on android? - * @property {boolean} chromeOS - Is running on chromeOS? - * @property {boolean} cordova - Is the game running under Apache Cordova? - * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? - * @property {boolean} desktop - Is running on a desktop? - * @property {boolean} ejecta - Is the game running under Ejecta? - * @property {boolean} electron - Is the game running under GitHub Electron? - * @property {boolean} iOS - Is running on iOS? - * @property {boolean} iPad - Is running on iPad? - * @property {boolean} iPhone - Is running on iPhone? - * @property {boolean} kindle - Is running on an Amazon Kindle? - * @property {boolean} linux - Is running on linux? - * @property {boolean} macOS - Is running on macOS? - * @property {boolean} node - Is the game running under Node.js? - * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? - * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView - * @property {boolean} windows - Is running on windows? - * @property {boolean} windowsPhone - Is running on a Windows Phone? - * @property {number} iOSVersion - If running in iOS this will contain the major version number. - * @property {number} pixelRatio - PixelRatio of the host device? - */ -var OS = { - - android: false, - chromeOS: false, - cordova: false, - crosswalk: false, - desktop: false, - ejecta: false, - electron: false, - iOS: false, - iOSVersion: 0, - iPad: false, - iPhone: false, - kindle: false, - linux: false, - macOS: false, - node: false, - nodeWebkit: false, - pixelRatio: 1, - webApp: false, - windows: false, - windowsPhone: false - -}; - -function init () -{ - var ua = navigator.userAgent; - - if ((/Windows/).test(ua)) - { - OS.windows = true; - } - else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) - { - OS.macOS = true; - } - else if ((/Android/).test(ua)) - { - OS.android = true; - } - else if ((/Linux/).test(ua)) - { - OS.linux = true; - } - else if ((/iP[ao]d|iPhone/i).test(ua)) - { - OS.iOS = true; - - (navigator.appVersion).match(/OS (\d+)/); - - OS.iOSVersion = parseInt(RegExp.$1, 10); - - OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; - OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; - } - else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) - { - OS.kindle = true; - - // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... - // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" - } - else if ((/CrOS/).test(ua)) - { - OS.chromeOS = true; - } - - if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) - { - OS.android = false; - OS.iOS = false; - OS.macOS = false; - OS.windows = true; - OS.windowsPhone = true; - } - - var silk = (/Silk/).test(ua); - - if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) - { - OS.desktop = true; - } - - // Windows Phone / Table reset - if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) - { - OS.desktop = false; - } - - // WebApp mode in iOS - if (navigator.standalone) - { - OS.webApp = true; - } - - if (window.cordova !== undefined) - { - OS.cordova = true; - } - - if (typeof process !== 'undefined' && process.versions && process.versions.node) - { - OS.node = true; - } - - if (OS.node && typeof process.versions === 'object') - { - OS.nodeWebkit = !!process.versions['node-webkit']; - - OS.electron = !!process.versions.electron; - } - - if (window.ejecta !== undefined) - { - OS.ejecta = true; - } - - if ((/Crosswalk/).test(ua)) - { - OS.crosswalk = true; - } - - OS.pixelRatio = window['devicePixelRatio'] || 1; - - return OS; -} - -module.exports = init(); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(755))) - -/***/ }), -/* 126 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26564,7 +30375,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(125); +var OS = __webpack_require__(102); /** * Determines the browser type and version running this Phaser Game instance. @@ -26665,7 +30476,7 @@ module.exports = init(); /***/ }), -/* 127 */ +/* 132 */ /***/ (function(module, exports) { /** @@ -26694,7 +30505,7 @@ module.exports = FloatBetween; /***/ }), -/* 128 */ +/* 133 */ /***/ (function(module, exports) { /** @@ -26724,7 +30535,51 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 129 */ +/* 134 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * + * @function Phaser.Math.Snap.Ceil + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapCeil = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.ceil(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapCeil; + + +/***/ }), +/* 135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27269,7 +31124,7 @@ module.exports = Vector4; /***/ }), -/* 130 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27284,17 +31139,17 @@ module.exports = Vector4; module.exports = { - ADD: __webpack_require__(814), - ERROR: __webpack_require__(815), - LOAD: __webpack_require__(816), - READY: __webpack_require__(817), - REMOVE: __webpack_require__(818) + ADD: __webpack_require__(869), + ERROR: __webpack_require__(870), + LOAD: __webpack_require__(871), + READY: __webpack_require__(872), + REMOVE: __webpack_require__(873) }; /***/ }), -/* 131 */ +/* 137 */ /***/ (function(module, exports) { /** @@ -27352,7 +31207,7 @@ module.exports = AddToDOM; /***/ }), -/* 132 */ +/* 138 */ /***/ (function(module, exports) { /** @@ -27375,7 +31230,7 @@ var KeyCodes = { * The BACKSPACE key. * * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE - * @type {integer} + * @type {number} * @since 3.0.0 */ BACKSPACE: 8, @@ -27384,7 +31239,7 @@ var KeyCodes = { * The TAB key. * * @name Phaser.Input.Keyboard.KeyCodes.TAB - * @type {integer} + * @type {number} * @since 3.0.0 */ TAB: 9, @@ -27393,7 +31248,7 @@ var KeyCodes = { * The ENTER key. * * @name Phaser.Input.Keyboard.KeyCodes.ENTER - * @type {integer} + * @type {number} * @since 3.0.0 */ ENTER: 13, @@ -27402,7 +31257,7 @@ var KeyCodes = { * The SHIFT key. * * @name Phaser.Input.Keyboard.KeyCodes.SHIFT - * @type {integer} + * @type {number} * @since 3.0.0 */ SHIFT: 16, @@ -27411,7 +31266,7 @@ var KeyCodes = { * The CTRL key. * * @name Phaser.Input.Keyboard.KeyCodes.CTRL - * @type {integer} + * @type {number} * @since 3.0.0 */ CTRL: 17, @@ -27420,7 +31275,7 @@ var KeyCodes = { * The ALT key. * * @name Phaser.Input.Keyboard.KeyCodes.ALT - * @type {integer} + * @type {number} * @since 3.0.0 */ ALT: 18, @@ -27429,7 +31284,7 @@ var KeyCodes = { * The PAUSE key. * * @name Phaser.Input.Keyboard.KeyCodes.PAUSE - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSE: 19, @@ -27438,7 +31293,7 @@ var KeyCodes = { * The CAPS_LOCK key. * * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK - * @type {integer} + * @type {number} * @since 3.0.0 */ CAPS_LOCK: 20, @@ -27447,7 +31302,7 @@ var KeyCodes = { * The ESC key. * * @name Phaser.Input.Keyboard.KeyCodes.ESC - * @type {integer} + * @type {number} * @since 3.0.0 */ ESC: 27, @@ -27456,7 +31311,7 @@ var KeyCodes = { * The SPACE key. * * @name Phaser.Input.Keyboard.KeyCodes.SPACE - * @type {integer} + * @type {number} * @since 3.0.0 */ SPACE: 32, @@ -27465,7 +31320,7 @@ var KeyCodes = { * The PAGE_UP key. * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP - * @type {integer} + * @type {number} * @since 3.0.0 */ PAGE_UP: 33, @@ -27474,7 +31329,7 @@ var KeyCodes = { * The PAGE_DOWN key. * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ PAGE_DOWN: 34, @@ -27483,7 +31338,7 @@ var KeyCodes = { * The END key. * * @name Phaser.Input.Keyboard.KeyCodes.END - * @type {integer} + * @type {number} * @since 3.0.0 */ END: 35, @@ -27492,7 +31347,7 @@ var KeyCodes = { * The HOME key. * * @name Phaser.Input.Keyboard.KeyCodes.HOME - * @type {integer} + * @type {number} * @since 3.0.0 */ HOME: 36, @@ -27501,7 +31356,7 @@ var KeyCodes = { * The LEFT key. * * @name Phaser.Input.Keyboard.KeyCodes.LEFT - * @type {integer} + * @type {number} * @since 3.0.0 */ LEFT: 37, @@ -27510,7 +31365,7 @@ var KeyCodes = { * The UP key. * * @name Phaser.Input.Keyboard.KeyCodes.UP - * @type {integer} + * @type {number} * @since 3.0.0 */ UP: 38, @@ -27519,7 +31374,7 @@ var KeyCodes = { * The RIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.RIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ RIGHT: 39, @@ -27528,7 +31383,7 @@ var KeyCodes = { * The DOWN key. * * @name Phaser.Input.Keyboard.KeyCodes.DOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ DOWN: 40, @@ -27537,7 +31392,7 @@ var KeyCodes = { * The PRINT_SCREEN key. * * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN - * @type {integer} + * @type {number} * @since 3.0.0 */ PRINT_SCREEN: 42, @@ -27546,7 +31401,7 @@ var KeyCodes = { * The INSERT key. * * @name Phaser.Input.Keyboard.KeyCodes.INSERT - * @type {integer} + * @type {number} * @since 3.0.0 */ INSERT: 45, @@ -27555,7 +31410,7 @@ var KeyCodes = { * The DELETE key. * * @name Phaser.Input.Keyboard.KeyCodes.DELETE - * @type {integer} + * @type {number} * @since 3.0.0 */ DELETE: 46, @@ -27564,7 +31419,7 @@ var KeyCodes = { * The ZERO key. * * @name Phaser.Input.Keyboard.KeyCodes.ZERO - * @type {integer} + * @type {number} * @since 3.0.0 */ ZERO: 48, @@ -27573,7 +31428,7 @@ var KeyCodes = { * The ONE key. * * @name Phaser.Input.Keyboard.KeyCodes.ONE - * @type {integer} + * @type {number} * @since 3.0.0 */ ONE: 49, @@ -27582,7 +31437,7 @@ var KeyCodes = { * The TWO key. * * @name Phaser.Input.Keyboard.KeyCodes.TWO - * @type {integer} + * @type {number} * @since 3.0.0 */ TWO: 50, @@ -27591,7 +31446,7 @@ var KeyCodes = { * The THREE key. * * @name Phaser.Input.Keyboard.KeyCodes.THREE - * @type {integer} + * @type {number} * @since 3.0.0 */ THREE: 51, @@ -27600,7 +31455,7 @@ var KeyCodes = { * The FOUR key. * * @name Phaser.Input.Keyboard.KeyCodes.FOUR - * @type {integer} + * @type {number} * @since 3.0.0 */ FOUR: 52, @@ -27609,7 +31464,7 @@ var KeyCodes = { * The FIVE key. * * @name Phaser.Input.Keyboard.KeyCodes.FIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ FIVE: 53, @@ -27618,7 +31473,7 @@ var KeyCodes = { * The SIX key. * * @name Phaser.Input.Keyboard.KeyCodes.SIX - * @type {integer} + * @type {number} * @since 3.0.0 */ SIX: 54, @@ -27627,7 +31482,7 @@ var KeyCodes = { * The SEVEN key. * * @name Phaser.Input.Keyboard.KeyCodes.SEVEN - * @type {integer} + * @type {number} * @since 3.0.0 */ SEVEN: 55, @@ -27636,7 +31491,7 @@ var KeyCodes = { * The EIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.EIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ EIGHT: 56, @@ -27645,7 +31500,7 @@ var KeyCodes = { * The NINE key. * * @name Phaser.Input.Keyboard.KeyCodes.NINE - * @type {integer} + * @type {number} * @since 3.0.0 */ NINE: 57, @@ -27654,7 +31509,7 @@ var KeyCodes = { * The NUMPAD_ZERO key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_ZERO: 96, @@ -27663,7 +31518,7 @@ var KeyCodes = { * The NUMPAD_ONE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_ONE: 97, @@ -27672,7 +31527,7 @@ var KeyCodes = { * The NUMPAD_TWO key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_TWO: 98, @@ -27681,7 +31536,7 @@ var KeyCodes = { * The NUMPAD_THREE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_THREE: 99, @@ -27690,7 +31545,7 @@ var KeyCodes = { * The NUMPAD_FOUR key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_FOUR: 100, @@ -27699,7 +31554,7 @@ var KeyCodes = { * The NUMPAD_FIVE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_FIVE: 101, @@ -27708,7 +31563,7 @@ var KeyCodes = { * The NUMPAD_SIX key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_SIX: 102, @@ -27717,7 +31572,7 @@ var KeyCodes = { * The NUMPAD_SEVEN key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_SEVEN: 103, @@ -27726,7 +31581,7 @@ var KeyCodes = { * The NUMPAD_EIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_EIGHT: 104, @@ -27735,7 +31590,7 @@ var KeyCodes = { * The NUMPAD_NINE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_NINE: 105, @@ -27744,7 +31599,7 @@ var KeyCodes = { * The Numpad Addition (+) key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD - * @type {integer} + * @type {number} * @since 3.21.0 */ NUMPAD_ADD: 107, @@ -27753,7 +31608,7 @@ var KeyCodes = { * The Numpad Subtraction (-) key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT - * @type {integer} + * @type {number} * @since 3.21.0 */ NUMPAD_SUBTRACT: 109, @@ -27762,7 +31617,7 @@ var KeyCodes = { * The A key. * * @name Phaser.Input.Keyboard.KeyCodes.A - * @type {integer} + * @type {number} * @since 3.0.0 */ A: 65, @@ -27771,7 +31626,7 @@ var KeyCodes = { * The B key. * * @name Phaser.Input.Keyboard.KeyCodes.B - * @type {integer} + * @type {number} * @since 3.0.0 */ B: 66, @@ -27780,7 +31635,7 @@ var KeyCodes = { * The C key. * * @name Phaser.Input.Keyboard.KeyCodes.C - * @type {integer} + * @type {number} * @since 3.0.0 */ C: 67, @@ -27789,7 +31644,7 @@ var KeyCodes = { * The D key. * * @name Phaser.Input.Keyboard.KeyCodes.D - * @type {integer} + * @type {number} * @since 3.0.0 */ D: 68, @@ -27798,7 +31653,7 @@ var KeyCodes = { * The E key. * * @name Phaser.Input.Keyboard.KeyCodes.E - * @type {integer} + * @type {number} * @since 3.0.0 */ E: 69, @@ -27807,7 +31662,7 @@ var KeyCodes = { * The F key. * * @name Phaser.Input.Keyboard.KeyCodes.F - * @type {integer} + * @type {number} * @since 3.0.0 */ F: 70, @@ -27816,7 +31671,7 @@ var KeyCodes = { * The G key. * * @name Phaser.Input.Keyboard.KeyCodes.G - * @type {integer} + * @type {number} * @since 3.0.0 */ G: 71, @@ -27825,7 +31680,7 @@ var KeyCodes = { * The H key. * * @name Phaser.Input.Keyboard.KeyCodes.H - * @type {integer} + * @type {number} * @since 3.0.0 */ H: 72, @@ -27834,7 +31689,7 @@ var KeyCodes = { * The I key. * * @name Phaser.Input.Keyboard.KeyCodes.I - * @type {integer} + * @type {number} * @since 3.0.0 */ I: 73, @@ -27843,7 +31698,7 @@ var KeyCodes = { * The J key. * * @name Phaser.Input.Keyboard.KeyCodes.J - * @type {integer} + * @type {number} * @since 3.0.0 */ J: 74, @@ -27852,7 +31707,7 @@ var KeyCodes = { * The K key. * * @name Phaser.Input.Keyboard.KeyCodes.K - * @type {integer} + * @type {number} * @since 3.0.0 */ K: 75, @@ -27861,7 +31716,7 @@ var KeyCodes = { * The L key. * * @name Phaser.Input.Keyboard.KeyCodes.L - * @type {integer} + * @type {number} * @since 3.0.0 */ L: 76, @@ -27870,7 +31725,7 @@ var KeyCodes = { * The M key. * * @name Phaser.Input.Keyboard.KeyCodes.M - * @type {integer} + * @type {number} * @since 3.0.0 */ M: 77, @@ -27879,7 +31734,7 @@ var KeyCodes = { * The N key. * * @name Phaser.Input.Keyboard.KeyCodes.N - * @type {integer} + * @type {number} * @since 3.0.0 */ N: 78, @@ -27888,7 +31743,7 @@ var KeyCodes = { * The O key. * * @name Phaser.Input.Keyboard.KeyCodes.O - * @type {integer} + * @type {number} * @since 3.0.0 */ O: 79, @@ -27897,7 +31752,7 @@ var KeyCodes = { * The P key. * * @name Phaser.Input.Keyboard.KeyCodes.P - * @type {integer} + * @type {number} * @since 3.0.0 */ P: 80, @@ -27906,7 +31761,7 @@ var KeyCodes = { * The Q key. * * @name Phaser.Input.Keyboard.KeyCodes.Q - * @type {integer} + * @type {number} * @since 3.0.0 */ Q: 81, @@ -27915,7 +31770,7 @@ var KeyCodes = { * The R key. * * @name Phaser.Input.Keyboard.KeyCodes.R - * @type {integer} + * @type {number} * @since 3.0.0 */ R: 82, @@ -27924,7 +31779,7 @@ var KeyCodes = { * The S key. * * @name Phaser.Input.Keyboard.KeyCodes.S - * @type {integer} + * @type {number} * @since 3.0.0 */ S: 83, @@ -27933,7 +31788,7 @@ var KeyCodes = { * The T key. * * @name Phaser.Input.Keyboard.KeyCodes.T - * @type {integer} + * @type {number} * @since 3.0.0 */ T: 84, @@ -27942,7 +31797,7 @@ var KeyCodes = { * The U key. * * @name Phaser.Input.Keyboard.KeyCodes.U - * @type {integer} + * @type {number} * @since 3.0.0 */ U: 85, @@ -27951,7 +31806,7 @@ var KeyCodes = { * The V key. * * @name Phaser.Input.Keyboard.KeyCodes.V - * @type {integer} + * @type {number} * @since 3.0.0 */ V: 86, @@ -27960,7 +31815,7 @@ var KeyCodes = { * The W key. * * @name Phaser.Input.Keyboard.KeyCodes.W - * @type {integer} + * @type {number} * @since 3.0.0 */ W: 87, @@ -27969,7 +31824,7 @@ var KeyCodes = { * The X key. * * @name Phaser.Input.Keyboard.KeyCodes.X - * @type {integer} + * @type {number} * @since 3.0.0 */ X: 88, @@ -27978,7 +31833,7 @@ var KeyCodes = { * The Y key. * * @name Phaser.Input.Keyboard.KeyCodes.Y - * @type {integer} + * @type {number} * @since 3.0.0 */ Y: 89, @@ -27987,7 +31842,7 @@ var KeyCodes = { * The Z key. * * @name Phaser.Input.Keyboard.KeyCodes.Z - * @type {integer} + * @type {number} * @since 3.0.0 */ Z: 90, @@ -27996,7 +31851,7 @@ var KeyCodes = { * The F1 key. * * @name Phaser.Input.Keyboard.KeyCodes.F1 - * @type {integer} + * @type {number} * @since 3.0.0 */ F1: 112, @@ -28005,7 +31860,7 @@ var KeyCodes = { * The F2 key. * * @name Phaser.Input.Keyboard.KeyCodes.F2 - * @type {integer} + * @type {number} * @since 3.0.0 */ F2: 113, @@ -28014,7 +31869,7 @@ var KeyCodes = { * The F3 key. * * @name Phaser.Input.Keyboard.KeyCodes.F3 - * @type {integer} + * @type {number} * @since 3.0.0 */ F3: 114, @@ -28023,7 +31878,7 @@ var KeyCodes = { * The F4 key. * * @name Phaser.Input.Keyboard.KeyCodes.F4 - * @type {integer} + * @type {number} * @since 3.0.0 */ F4: 115, @@ -28032,7 +31887,7 @@ var KeyCodes = { * The F5 key. * * @name Phaser.Input.Keyboard.KeyCodes.F5 - * @type {integer} + * @type {number} * @since 3.0.0 */ F5: 116, @@ -28041,7 +31896,7 @@ var KeyCodes = { * The F6 key. * * @name Phaser.Input.Keyboard.KeyCodes.F6 - * @type {integer} + * @type {number} * @since 3.0.0 */ F6: 117, @@ -28050,7 +31905,7 @@ var KeyCodes = { * The F7 key. * * @name Phaser.Input.Keyboard.KeyCodes.F7 - * @type {integer} + * @type {number} * @since 3.0.0 */ F7: 118, @@ -28059,7 +31914,7 @@ var KeyCodes = { * The F8 key. * * @name Phaser.Input.Keyboard.KeyCodes.F8 - * @type {integer} + * @type {number} * @since 3.0.0 */ F8: 119, @@ -28068,7 +31923,7 @@ var KeyCodes = { * The F9 key. * * @name Phaser.Input.Keyboard.KeyCodes.F9 - * @type {integer} + * @type {number} * @since 3.0.0 */ F9: 120, @@ -28077,7 +31932,7 @@ var KeyCodes = { * The F10 key. * * @name Phaser.Input.Keyboard.KeyCodes.F10 - * @type {integer} + * @type {number} * @since 3.0.0 */ F10: 121, @@ -28086,7 +31941,7 @@ var KeyCodes = { * The F11 key. * * @name Phaser.Input.Keyboard.KeyCodes.F11 - * @type {integer} + * @type {number} * @since 3.0.0 */ F11: 122, @@ -28095,7 +31950,7 @@ var KeyCodes = { * The F12 key. * * @name Phaser.Input.Keyboard.KeyCodes.F12 - * @type {integer} + * @type {number} * @since 3.0.0 */ F12: 123, @@ -28104,7 +31959,7 @@ var KeyCodes = { * The SEMICOLON key. * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON - * @type {integer} + * @type {number} * @since 3.0.0 */ SEMICOLON: 186, @@ -28113,7 +31968,7 @@ var KeyCodes = { * The PLUS key. * * @name Phaser.Input.Keyboard.KeyCodes.PLUS - * @type {integer} + * @type {number} * @since 3.0.0 */ PLUS: 187, @@ -28122,7 +31977,7 @@ var KeyCodes = { * The COMMA key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA: 188, @@ -28131,7 +31986,7 @@ var KeyCodes = { * The MINUS key. * * @name Phaser.Input.Keyboard.KeyCodes.MINUS - * @type {integer} + * @type {number} * @since 3.0.0 */ MINUS: 189, @@ -28140,7 +31995,7 @@ var KeyCodes = { * The PERIOD key. * * @name Phaser.Input.Keyboard.KeyCodes.PERIOD - * @type {integer} + * @type {number} * @since 3.0.0 */ PERIOD: 190, @@ -28149,7 +32004,7 @@ var KeyCodes = { * The FORWARD_SLASH key. * * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH - * @type {integer} + * @type {number} * @since 3.0.0 */ FORWARD_SLASH: 191, @@ -28158,7 +32013,7 @@ var KeyCodes = { * The BACK_SLASH key. * * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH - * @type {integer} + * @type {number} * @since 3.0.0 */ BACK_SLASH: 220, @@ -28167,7 +32022,7 @@ var KeyCodes = { * The QUOTES key. * * @name Phaser.Input.Keyboard.KeyCodes.QUOTES - * @type {integer} + * @type {number} * @since 3.0.0 */ QUOTES: 222, @@ -28176,7 +32031,7 @@ var KeyCodes = { * The BACKTICK key. * * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK - * @type {integer} + * @type {number} * @since 3.0.0 */ BACKTICK: 192, @@ -28185,7 +32040,7 @@ var KeyCodes = { * The OPEN_BRACKET key. * * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET - * @type {integer} + * @type {number} * @since 3.0.0 */ OPEN_BRACKET: 219, @@ -28194,7 +32049,7 @@ var KeyCodes = { * The CLOSED_BRACKET key. * * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET - * @type {integer} + * @type {number} * @since 3.0.0 */ CLOSED_BRACKET: 221, @@ -28203,7 +32058,7 @@ var KeyCodes = { * The SEMICOLON_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ SEMICOLON_FIREFOX: 59, @@ -28212,7 +32067,7 @@ var KeyCodes = { * The COLON key. * * @name Phaser.Input.Keyboard.KeyCodes.COLON - * @type {integer} + * @type {number} * @since 3.0.0 */ COLON: 58, @@ -28221,7 +32076,7 @@ var KeyCodes = { * The COMMA_FIREFOX_WINDOWS key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA_FIREFOX_WINDOWS: 60, @@ -28230,7 +32085,7 @@ var KeyCodes = { * The COMMA_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA_FIREFOX: 62, @@ -28239,7 +32094,7 @@ var KeyCodes = { * The BRACKET_RIGHT_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ BRACKET_RIGHT_FIREFOX: 174, @@ -28248,7 +32103,7 @@ var KeyCodes = { * The BRACKET_LEFT_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ BRACKET_LEFT_FIREFOX: 175 @@ -28258,7 +32113,7 @@ module.exports = KeyCodes; /***/ }), -/* 133 */ +/* 139 */ /***/ (function(module, exports) { /** @@ -28280,7 +32135,7 @@ var CONST = { * * @name Phaser.Scenes.PENDING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING: 0, @@ -28290,7 +32145,7 @@ var CONST = { * * @name Phaser.Scenes.INIT * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ INIT: 1, @@ -28300,7 +32155,7 @@ var CONST = { * * @name Phaser.Scenes.START * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ START: 2, @@ -28310,7 +32165,7 @@ var CONST = { * * @name Phaser.Scenes.LOADING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADING: 3, @@ -28320,7 +32175,7 @@ var CONST = { * * @name Phaser.Scenes.CREATING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ CREATING: 4, @@ -28330,7 +32185,7 @@ var CONST = { * * @name Phaser.Scenes.RUNNING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ RUNNING: 5, @@ -28340,7 +32195,7 @@ var CONST = { * * @name Phaser.Scenes.PAUSED * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSED: 6, @@ -28350,7 +32205,7 @@ var CONST = { * * @name Phaser.Scenes.SLEEPING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ SLEEPING: 7, @@ -28360,7 +32215,7 @@ var CONST = { * * @name Phaser.Scenes.SHUTDOWN * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ SHUTDOWN: 8, @@ -28370,7 +32225,7 @@ var CONST = { * * @name Phaser.Scenes.DESTROYED * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ DESTROYED: 9 @@ -28381,7 +32236,7 @@ module.exports = CONST; /***/ }), -/* 134 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28390,7 +32245,7 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Creates a new Object using all values from obj1 and obj2. @@ -28426,7 +32281,7 @@ module.exports = Merge; /***/ }), -/* 135 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28437,13 +32292,13 @@ module.exports = Merge; */ var Class = __webpack_require__(0); -var Clone = __webpack_require__(69); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(61); -var GameEvents = __webpack_require__(21); +var Clone = __webpack_require__(76); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var GameEvents = __webpack_require__(23); var NOOP = __webpack_require__(1); -var GetAll = __webpack_require__(193); -var GetFirst = __webpack_require__(395); +var GetAll = __webpack_require__(198); +var GetFirst = __webpack_require__(405); /** * @classdesc @@ -29140,7 +32995,7 @@ module.exports = BaseSoundManager; /***/ }), -/* 136 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29151,9 +33006,9 @@ module.exports = BaseSoundManager; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(61); -var Extend = __webpack_require__(19); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var Extend = __webpack_require__(18); var NOOP = __webpack_require__(1); /** @@ -29640,7 +33495,7 @@ module.exports = BaseSound; /***/ }), -/* 137 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29649,824 +33504,8 @@ module.exports = BaseSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(194); -var Class = __webpack_require__(0); -var NOOP = __webpack_require__(1); -var StableSort = __webpack_require__(139); - -/** - * @callback EachListCallback - * - * @param {I} item - The item which is currently being processed. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. - */ - -/** - * @classdesc - * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. - * - * @class List - * @memberof Phaser.Structs - * @constructor - * @since 3.0.0 - * - * @generic T - * - * @param {*} parent - The parent of this list. - */ -var List = new Class({ - - initialize: - - function List (parent) - { - /** - * The parent of this list. - * - * @name Phaser.Structs.List#parent - * @type {*} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * The objects that belong to this collection. - * - * @genericUse {T[]} - [$type] - * - * @name Phaser.Structs.List#list - * @type {Array.<*>} - * @default [] - * @since 3.0.0 - */ - this.list = []; - - /** - * The index of the current element. - * - * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. - * - * @name Phaser.Structs.List#position - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.position = 0; - - /** - * A callback that is invoked every time a child is added to this list. - * - * @name Phaser.Structs.List#addCallback - * @type {function} - * @since 3.4.0 - */ - this.addCallback = NOOP; - - /** - * A callback that is invoked every time a child is removed from this list. - * - * @name Phaser.Structs.List#removeCallback - * @type {function} - * @since 3.4.0 - */ - this.removeCallback = NOOP; - - /** - * The property key to sort by. - * - * @name Phaser.Structs.List#_sortKey - * @type {string} - * @since 3.4.0 - */ - this._sortKey = ''; - }, - - /** - * Adds the given item to the end of the list. Each item must be unique. - * - * @method Phaser.Structs.List#add - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*|Array.<*>} child - The item, or array of items, to add to the list. - * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. - * - * @return {*} The list's underlying array. - */ - add: function (child, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.Add(this.list, child); - } - else - { - return ArrayUtils.Add(this.list, child, 0, this.addCallback, this); - } - }, - - /** - * Adds an item to list, starting at a specified index. Each item must be unique within the list. - * - * @method Phaser.Structs.List#addAt - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item, or array of items, to add to the list. - * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted. - * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. - * - * @return {*} The List's underlying array. - */ - addAt: function (child, index, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.AddAt(this.list, child, index); - } - else - { - return ArrayUtils.AddAt(this.list, child, index, 0, this.addCallback, this); - } - }, - - /** - * Retrieves the item at a given position inside the List. - * - * @method Phaser.Structs.List#getAt - * @since 3.0.0 - * - * @genericUse {T} - [$return] - * - * @param {integer} index - The index of the item. - * - * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. - */ - getAt: function (index) - { - return this.list[index]; - }, - - /** - * Locates an item within the List and returns its index. - * - * @method Phaser.Structs.List#getIndex - * @since 3.0.0 - * - * @genericUse {T} - [child] - * - * @param {*} child - The item to locate. - * - * @return {integer} The index of the item within the List, or -1 if it's not in the List. - */ - getIndex: function (child) - { - // Return -1 if given child isn't a child of this display list - return this.list.indexOf(child); - }, - - /** - * Sort the contents of this List so the items are in order based on the given property. - * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property. - * - * @method Phaser.Structs.List#sort - * @since 3.0.0 - * - * @genericUse {T[]} - [children,$return] - * - * @param {string} property - The property to lexically sort by. - * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. - * - * @return {Phaser.Structs.List} This List object. - */ - sort: function (property, handler) - { - if (!property) - { - return this; - } - - if (handler === undefined) - { - handler = function (childA, childB) - { - return childA[property] - childB[property]; - }; - } - - StableSort(this.list, handler); - - return this; - }, - - /** - * Searches for the first instance of a child with its `name` - * property matching the given argument. Should more than one child have - * the same name only the first is returned. - * - * @method Phaser.Structs.List#getByName - * @since 3.0.0 - * - * @genericUse {T | null} - [$return] - * - * @param {string} name - The name to search for. - * - * @return {?*} The first child with a matching name, or null if none were found. - */ - getByName: function (name) - { - return ArrayUtils.GetFirst(this.list, 'name', name); - }, - - /** - * Returns a random child from the group. - * - * @method Phaser.Structs.List#getRandom - * @since 3.0.0 - * - * @genericUse {T | null} - [$return] - * - * @param {integer} [startIndex=0] - Offset from the front of the group (lowest child). - * @param {integer} [length=(to top)] - Restriction on the number of values you want to randomly select from. - * - * @return {?*} A random child of this Group. - */ - getRandom: function (startIndex, length) - { - return ArrayUtils.GetRandom(this.list, startIndex, length); - }, - - /** - * Returns the first element in a given part of the List which matches a specific criterion. - * - * @method Phaser.Structs.List#getFirst - * @since 3.0.0 - * - * @genericUse {T | null} - [$return] - * - * @param {string} property - The name of the property to test or a falsey value to have no criterion. - * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. - * @param {number} [startIndex=0] - The position in the List to start the search at. - * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. - * - * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. - */ - getFirst: function (property, value, startIndex, endIndex) - { - return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex); - }, - - /** - * Returns all children in this List. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('parent')` would return only children that have a property called `parent`. - * - * You can also specify a value to compare the property to: - * - * `getAll('visible', true)` would return only children that have their visible property set to `true`. - * - * Optionally you can specify a start and end index. For example if this List had 100 children, - * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only - * the first 50 children in the List. - * - * @method Phaser.Structs.List#getAll - * @since 3.0.0 - * - * @genericUse {T} - [value] - * @genericUse {T[]} - [$return] - * - * @param {string} [property] - An optional property to test against the value argument. - * @param {*} [value] - If property is set then Child.property must strictly equal this value to be included in the results. - * @param {integer} [startIndex] - The first child index to start the search from. - * @param {integer} [endIndex] - The last child index to search up until. - * - * @return {Array.<*>} All items of the List which match the given criterion, if any. - */ - getAll: function (property, value, startIndex, endIndex) - { - return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex); - }, - - /** - * Returns the total number of items in the List which have a property matching the given value. - * - * @method Phaser.Structs.List#count - * @since 3.0.0 - * - * @genericUse {T} - [value] - * - * @param {string} property - The property to test on each item. - * @param {*} value - The value to test the property against. - * - * @return {integer} The total number of matching elements. - */ - count: function (property, value) - { - return ArrayUtils.CountAllMatching(this.list, property, value); - }, - - /** - * Swaps the positions of two items in the list. - * - * @method Phaser.Structs.List#swap - * @since 3.0.0 - * - * @genericUse {T} - [child1,child2] - * - * @param {*} child1 - The first item to swap. - * @param {*} child2 - The second item to swap. - */ - swap: function (child1, child2) - { - ArrayUtils.Swap(this.list, child1, child2); - }, - - /** - * Moves an item in the List to a new position. - * - * @method Phaser.Structs.List#moveTo - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to move. - * @param {integer} index - Moves an item in the List to a new position. - * - * @return {*} The item that was moved. - */ - moveTo: function (child, index) - { - return ArrayUtils.MoveTo(this.list, child, index); - }, - - /** - * Removes one or many items from the List. - * - * @method Phaser.Structs.List#remove - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item, or array of items, to remove. - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {*} The item, or array of items, which were successfully removed from the List. - */ - remove: function (child, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.Remove(this.list, child); - } - else - { - return ArrayUtils.Remove(this.list, child, this.removeCallback, this); - } - }, - - /** - * Removes the item at the given position in the List. - * - * @method Phaser.Structs.List#removeAt - * @since 3.0.0 - * - * @genericUse {T} - [$return] - * - * @param {integer} index - The position to remove the item from. - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {*} The item that was removed. - */ - removeAt: function (index, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.RemoveAt(this.list, index); - } - else - { - return ArrayUtils.RemoveAt(this.list, index, this.removeCallback, this); - } - }, - - /** - * Removes the items within the given range in the List. - * - * @method Phaser.Structs.List#removeBetween - * @since 3.0.0 - * - * @genericUse {T[]} - [$return] - * - * @param {integer} [startIndex=0] - The index to start removing from. - * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed. - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {Array.<*>} An array of the items which were removed. - */ - removeBetween: function (startIndex, endIndex, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex); - } - else - { - return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeCallback, this); - } - }, - - /** - * Removes all the items. - * - * @method Phaser.Structs.List#removeAll - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.List.} - [$return] - * - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {Phaser.Structs.List} This List object. - */ - removeAll: function (skipCallback) - { - var i = this.list.length; - - while (i--) - { - this.remove(this.list[i], skipCallback); - } - - return this; - }, - - /** - * Brings the given child to the top of this List. - * - * @method Phaser.Structs.List#bringToTop - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to bring to the top of the List. - * - * @return {*} The item which was moved. - */ - bringToTop: function (child) - { - return ArrayUtils.BringToTop(this.list, child); - }, - - /** - * Sends the given child to the bottom of this List. - * - * @method Phaser.Structs.List#sendToBack - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to send to the back of the list. - * - * @return {*} The item which was moved. - */ - sendToBack: function (child) - { - return ArrayUtils.SendToBack(this.list, child); - }, - - /** - * Moves the given child up one place in this group unless it's already at the top. - * - * @method Phaser.Structs.List#moveUp - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to move up. - * - * @return {*} The item which was moved. - */ - moveUp: function (child) - { - ArrayUtils.MoveUp(this.list, child); - - return child; - }, - - /** - * Moves the given child down one place in this group unless it's already at the bottom. - * - * @method Phaser.Structs.List#moveDown - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to move down. - * - * @return {*} The item which was moved. - */ - moveDown: function (child) - { - ArrayUtils.MoveDown(this.list, child); - - return child; - }, - - /** - * Reverses the order of all children in this List. - * - * @method Phaser.Structs.List#reverse - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.List.} - [$return] - * - * @return {Phaser.Structs.List} This List object. - */ - reverse: function () - { - this.list.reverse(); - - return this; - }, - - /** - * Shuffles the items in the list. - * - * @method Phaser.Structs.List#shuffle - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.List.} - [$return] - * - * @return {Phaser.Structs.List} This List object. - */ - shuffle: function () - { - ArrayUtils.Shuffle(this.list); - - return this; - }, - - /** - * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List. - * - * @method Phaser.Structs.List#replace - * @since 3.0.0 - * - * @genericUse {T} - [oldChild,newChild,$return] - * - * @param {*} oldChild - The child in this List that will be replaced. - * @param {*} newChild - The child to be inserted into this List. - * - * @return {*} Returns the oldChild that was replaced within this group. - */ - replace: function (oldChild, newChild) - { - return ArrayUtils.Replace(this.list, oldChild, newChild); - }, - - /** - * Checks if an item exists within the List. - * - * @method Phaser.Structs.List#exists - * @since 3.0.0 - * - * @genericUse {T} - [child] - * - * @param {*} child - The item to check for the existence of. - * - * @return {boolean} `true` if the item is found in the list, otherwise `false`. - */ - exists: function (child) - { - return (this.list.indexOf(child) > -1); - }, - - /** - * Sets the property `key` to the given value on all members of this List. - * - * @method Phaser.Structs.List#setAll - * @since 3.0.0 - * - * @genericUse {T} - [value] - * - * @param {string} property - The name of the property to set. - * @param {*} value - The value to set the property to. - * @param {integer} [startIndex] - The first child index to start the search from. - * @param {integer} [endIndex] - The last child index to search up until. - */ - setAll: function (property, value, startIndex, endIndex) - { - ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex); - - return this; - }, - - /** - * Passes all children to the given callback. - * - * @method Phaser.Structs.List#each - * @since 3.0.0 - * - * @genericUse {EachListCallback.} - [callback] - * - * @param {EachListCallback} callback - The function to call. - * @param {*} [context] - Value to use as `this` when executing callback. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. - */ - each: function (callback, context) - { - var args = [ null ]; - - for (var i = 2; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = 0; i < this.list.length; i++) - { - args[0] = this.list[i]; - - callback.apply(context, args); - } - }, - - /** - * Clears the List and recreates its internal array. - * - * @method Phaser.Structs.List#shutdown - * @since 3.0.0 - */ - shutdown: function () - { - this.removeAll(); - - this.list = []; - }, - - /** - * Destroys this List. - * - * @method Phaser.Structs.List#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAll(); - - this.parent = null; - this.addCallback = null; - this.removeCallback = null; - }, - - /** - * The number of items inside the List. - * - * @name Phaser.Structs.List#length - * @type {integer} - * @readonly - * @since 3.0.0 - */ - length: { - - get: function () - { - return this.list.length; - } - - }, - - /** - * The first item in the List or `null` for an empty List. - * - * @name Phaser.Structs.List#first - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - first: { - - get: function () - { - this.position = 0; - - if (this.list.length > 0) - { - return this.list[0]; - } - else - { - return null; - } - } - - }, - - /** - * The last item in the List, or `null` for an empty List. - * - * @name Phaser.Structs.List#last - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - last: { - - get: function () - { - if (this.list.length > 0) - { - this.position = this.list.length - 1; - - return this.list[this.position]; - } - else - { - return null; - } - } - - }, - - /** - * The next item in the List, or `null` if the entire List has been traversed. - * - * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. - * - * @name Phaser.Structs.List#next - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - next: { - - get: function () - { - if (this.position < this.list.length) - { - this.position++; - - return this.list[this.position]; - } - else - { - return null; - } - } - - }, - - /** - * The previous item in the List, or `null` if the entire List has been traversed. - * - * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. - * - * @name Phaser.Structs.List#previous - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - previous: { - - get: function () - { - if (this.position > 0) - { - this.position--; - - return this.list[this.position]; - } - else - { - return null; - } - } - - } - -}); - -module.exports = List; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CheckMatrix = __webpack_require__(195); -var TransposeMatrix = __webpack_require__(402); +var CheckMatrix = __webpack_require__(200); +var TransposeMatrix = __webpack_require__(412); /** * Rotates the array matrix based on the given rotation value. @@ -30476,6 +33515,20 @@ var TransposeMatrix = __webpack_require__(402); * * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateMatrix * @since 3.0.0 * @@ -30528,183 +33581,7 @@ module.exports = RotateMatrix; /***/ }), -/* 139 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @author Angry Bytes (and contributors) - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The comparator function. - * - * @ignore - * - * @param {*} a - The first item to test. - * @param {*} b - The second itemt to test. - * - * @return {boolean} True if they localCompare, otherwise false. - */ -function Compare (a, b) -{ - return String(a).localeCompare(b); -} - -/** - * Process the array contents. - * - * @ignore - * - * @param {array} array - The array to process. - * @param {function} compare - The comparison function. - * - * @return {array} - The processed array. - */ -function Process (array, compare) -{ - // Short-circuit when there's nothing to sort. - var len = array.length; - - if (len <= 1) - { - return array; - } - - // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. - // Chunks are the size of the left or right hand in merge sort. - // Stop when the left-hand covers all of the array. - var buffer = new Array(len); - - for (var chk = 1; chk < len; chk *= 2) - { - RunPass(array, compare, chk, buffer); - - var tmp = array; - - array = buffer; - - buffer = tmp; - } - - return array; -} - -/** - * Run a single pass with the given chunk size. - * - * @ignore - * - * @param {array} arr - The array to run the pass on. - * @param {function} comp - The comparison function. - * @param {number} chk - The number of iterations. - * @param {array} result - The array to store the result in. - */ -function RunPass (arr, comp, chk, result) -{ - var len = arr.length; - var i = 0; - - // Step size / double chunk size. - var dbl = chk * 2; - - // Bounds of the left and right chunks. - var l, r, e; - - // Iterators over the left and right chunk. - var li, ri; - - // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) - { - r = l + chk; - e = r + chk; - - if (r > len) - { - r = len; - } - - if (e > len) - { - e = len; - } - - // Iterate both chunks in parallel. - li = l; - ri = r; - - while (true) - { - // Compare the chunks. - if (li < r && ri < e) - { - // This works for a regular `sort()` compatible comparator, - // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) - { - result[i++] = arr[li++]; - } - else - { - result[i++] = arr[ri++]; - } - } - else if (li < r) - { - // Nothing to compare, just flush what's left. - result[i++] = arr[li++]; - } - else if (ri < e) - { - result[i++] = arr[ri++]; - } - else - { - // Both iterators are at the chunk ends. - break; - } - } - } -} - -/** - * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. - * - * This is an implementation of merge sort, without recursion. - * - * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable - * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 - * - * @param {array} array - The input array to be sorted. - * @param {function} [compare] - The comparison function. - * - * @return {array} The sorted result. - */ -var StableSort = function (array, compare) -{ - if (compare === undefined) { compare = Compare; } - - var result = Process(array, compare); - - // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. - if (result !== array) - { - RunPass(result, null, array.length, array); - } - - return array; -}; - -module.exports = StableSort; - - -/***/ }), -/* 140 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30714,15 +33591,14 @@ module.exports = StableSort; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GetColorFromValue = __webpack_require__(119); -var GetBitmapTextSize = __webpack_require__(969); -var ParseFromAtlas = __webpack_require__(970); -var ParseXMLBitmapFont = __webpack_require__(198); +var GetBitmapTextSize = __webpack_require__(1026); +var ParseFromAtlas = __webpack_require__(1027); +var ParseXMLBitmapFont = __webpack_require__(203); var Rectangle = __webpack_require__(9); -var Render = __webpack_require__(971); +var Render = __webpack_require__(1028); /** * @classdesc @@ -30770,7 +33646,7 @@ var Render = __webpack_require__(971); * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size of this Bitmap Text. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. */ var BitmapText = new Class({ @@ -30874,7 +33750,7 @@ var BitmapText = new Class({ * The alignment position is based on the longest line of text. * * @name Phaser.GameObjects.BitmapText#_align - * @type {integer} + * @type {number} * @private * @since 3.11.0 */ @@ -30955,22 +33831,13 @@ var BitmapText = new Class({ /** * The color of the drop shadow. * - * @name Phaser.GameObjects.BitmapText#_dropShadowColor - * @type {number} - * @private - * @since 3.50.0 - */ - this._dropShadowColor = 0x000000; - - /** - * The GL encoded color of the drop shadow. + * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. * - * @name Phaser.GameObjects.BitmapText#_dropShadowColorGL + * @name Phaser.GameObjects.BitmapText#dropShadowColor * @type {number} - * @private * @since 3.50.0 */ - this._dropShadowColorGL = 0x000000; + this.dropShadowColor = 0x000000; /** * The alpha value of the drop shadow. @@ -31195,10 +34062,10 @@ var BitmapText = new Class({ * @param {number} [start=0] - The starting character to begin the tint at. If negative, it counts back from the end of the text. * @param {number} [length=1] - The number of characters to tint. Remember that spaces count as a character too. Pass -1 to tint all characters from `start` onwards. * @param {boolean} [tintFill=false] - Use a fill-based tint (true), or an additive tint (false) - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the character. If not other values are given this value is applied evenly, tinting the whole character. - * @param {integer} [topRight] - The tint being applied to the top-right of the character. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the character. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the character. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the character. If not other values are given this value is applied evenly, tinting the whole character. + * @param {number} [topRight] - The tint being applied to the top-right of the character. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the character. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the character. * * @return {this} This BitmapText Object. */ @@ -31245,27 +34112,23 @@ var BitmapText = new Class({ else { var tintEffect = (tintFill) ? 1 : 0; - var tintTL = GetColorFromValue(topLeft); - var tintTR = GetColorFromValue(topRight); - var tintBL = GetColorFromValue(bottomLeft); - var tintBR = GetColorFromValue(bottomRight); if (color) { color.tintEffect = tintEffect; - color.tintTL = tintTL; - color.tintTR = tintTR; - color.tintBL = tintBL; - color.tintBR = tintBR; + color.tintTL = topLeft; + color.tintTR = topRight; + color.tintBL = bottomLeft; + color.tintBR = bottomRight; } else { charColors[i] = { tintEffect: tintEffect, - tintTL: tintTL, - tintTR: tintTR, - tintBL: tintBL, - tintBR: tintBR + tintTL: topLeft, + tintTR: topRight, + tintBL: bottomLeft, + tintBR: bottomRight }; } } @@ -31308,10 +34171,10 @@ var BitmapText = new Class({ * @param {(string|number)} word - The word to search for. Either a string, or an index of the word in the words array. * @param {number} [count=1] - The number of matching words to tint. Pass -1 to tint all matching words. * @param {boolean} [tintFill=false] - Use a fill-based tint (true), or an additive tint (false) - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the word. If not other values are given this value is applied evenly, tinting the whole word. - * @param {integer} [topRight] - The tint being applied to the top-right of the word. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the word. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the word. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the word. If not other values are given this value is applied evenly, tinting the whole word. + * @param {number} [topRight] - The tint being applied to the top-right of the word. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the word. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the word. * * @return {this} This BitmapText Object. */ @@ -31462,7 +34325,7 @@ var BitmapText = new Class({ * * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {number} [size] - The font size of this Bitmap Text. If not specified the current size will be used. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. * * @return {this} This BitmapText Object. */ @@ -31540,7 +34403,7 @@ var BitmapText = new Class({ * The alignment position is based on the longest line of text. * * @name Phaser.GameObjects.BitmapText#align - * @type {integer} + * @type {number} * @since 3.11.0 */ align: { @@ -31698,31 +34561,6 @@ var BitmapText = new Class({ }, - /** - * The color of the drop shadow. - * - * You can also set this via `Phaser.GameObjects.BitmapText#setDropShadow`. - * - * @name Phaser.GameObjects.BitmapText#dropShadowColor - * @type {number} - * @since 3.50.0 - */ - dropShadowColor: { - - get: function () - { - return this._dropShadowColor; - }, - - set: function (value) - { - this._dropShadowColor = value; - - this._dropShadowColorGL = GetColorFromValue(value); - } - - }, - /** * Build a JSON representation of this Bitmap Text. * @@ -31770,7 +34608,7 @@ var BitmapText = new Class({ * Left align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_LEFT - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_LEFT = 0; @@ -31779,7 +34617,7 @@ BitmapText.ALIGN_LEFT = 0; * Center align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_CENTER - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_CENTER = 1; @@ -31788,7 +34626,7 @@ BitmapText.ALIGN_CENTER = 1; * Right align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_RIGHT - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_RIGHT = 2; @@ -31806,8 +34644,8 @@ BitmapText.ALIGN_RIGHT = 2; * @param {string} textureKey - The key of the BitmapFont's texture. * @param {string} frameKey - The key of the BitmapFont texture's frame. * @param {string} xmlKey - The key of the XML data of the font to parse. - * @param {integer} [xSpacing] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing] - The y-axis spacing to add to the line height. * * @return {boolean} Whether the parsing was successful or not. */ @@ -31821,8 +34659,8 @@ BitmapText.ParseFromAtlas = ParseFromAtlas; * * @param {XMLDocument} xml - The XML Document to parse the font from. * @param {Phaser.Textures.Frame} frame - The texture frame to take into account when creating the uv data. - * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing=0] - The y-axis spacing to add to the line height. * * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. */ @@ -31832,7 +34670,7 @@ module.exports = BitmapText; /***/ }), -/* 141 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32251,7 +35089,7 @@ var Set = new Class({ * Increasing the size larger than the current size has no effect. * * @name Phaser.Structs.Set#size - * @type {integer} + * @type {number} * @since 3.0.0 */ size: { @@ -32281,216 +35119,7 @@ module.exports = Set; /***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameObject = __webpack_require__(14); -var MeshRender = __webpack_require__(1097); -var NOOP = __webpack_require__(1); - -/** - * @classdesc - * A Mesh Game Object. - * - * @class Mesh - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @webglOnly - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.Size - * @extends Phaser.GameObjects.Components.Texture - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * @extends Phaser.GameObjects.Components.ScrollFactor - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number[]} vertices - An array containing the vertices data for this Mesh. - * @param {number[]} uv - An array containing the uv data for this Mesh. - * @param {number[]} colors - An array containing the color data for this Mesh. - * @param {number[]} alphas - An array containing the alpha data for this Mesh. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Mesh = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.BlendMode, - Components.Depth, - Components.Mask, - Components.Pipeline, - Components.Size, - Components.Texture, - Components.Transform, - Components.Visible, - Components.ScrollFactor, - MeshRender - ], - - initialize: - - function Mesh (scene, x, y, vertices, uv, colors, alphas, texture, frame) - { - GameObject.call(this, scene, 'Mesh'); - - if (vertices.length !== uv.length) - { - throw new Error('Mesh Vertex count must match UV count'); - } - - var verticesUB = (vertices.length / 2) | 0; - - if (colors.length > 0 && colors.length < verticesUB) - { - throw new Error('Mesh Color count must match Vertex count'); - } - - if (alphas.length > 0 && alphas.length < verticesUB) - { - throw new Error('Mesh Alpha count must match Vertex count'); - } - - var i; - - if (colors.length === 0) - { - for (i = 0; i < verticesUB; ++i) - { - colors[i] = 0xFFFFFF; - } - } - - if (alphas.length === 0) - { - for (i = 0; i < verticesUB; ++i) - { - alphas[i] = 1.0; - } - } - - /** - * An array containing the vertices data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#vertices - * @type {Float32Array} - * @since 3.0.0 - */ - this.vertices = new Float32Array(vertices); - - /** - * An array containing the uv data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#uv - * @type {Float32Array} - * @since 3.0.0 - */ - this.uv = new Float32Array(uv); - - /** - * An array containing the color data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#colors - * @type {Uint32Array} - * @since 3.0.0 - */ - this.colors = new Uint32Array(colors); - - /** - * An array containing the alpha data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#alphas - * @type {Float32Array} - * @since 3.0.0 - */ - this.alphas = new Float32Array(alphas); - - /** - * Fill or additive mode used when blending the color values? - * - * @name Phaser.GameObjects.Mesh#tintFill - * @type {boolean} - * @default false - * @since 3.11.0 - */ - this.tintFill = false; - - this.setTexture(texture, frame); - this.setPosition(x, y); - this.setSizeToFrame(); - this.initPipeline(); - }, - - /** - * This method is left intentionally empty and does not do anything. - * It is retained to allow a Mesh or Quad to be added to a Container. - * - * @method Phaser.GameObjects.Mesh#setAlpha - * @since 3.17.0 - */ - setAlpha: NOOP - -}); - -module.exports = Mesh; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if two Rectangles intersect. - * - * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. - * As such, the two Rectangles are considered "solid". - * A Rectangle with no width or no height will never intersect another Rectangle. - * - * @function Phaser.Geom.Intersects.RectangleToRectangle - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection. - * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection. - * - * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`. - */ -var RectangleToRectangle = function (rectA, rectB) -{ - if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0) - { - return false; - } - - return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom); -}; - -module.exports = RectangleToRectangle; - - -/***/ }), -/* 144 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32598,7 +35227,7 @@ module.exports = InputPluginCache; /***/ }), -/* 145 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32613,19 +35242,19 @@ module.exports = InputPluginCache; module.exports = { - ANY_KEY_DOWN: __webpack_require__(1239), - ANY_KEY_UP: __webpack_require__(1240), - COMBO_MATCH: __webpack_require__(1241), - DOWN: __webpack_require__(1242), - KEY_DOWN: __webpack_require__(1243), - KEY_UP: __webpack_require__(1244), - UP: __webpack_require__(1245) + ANY_KEY_DOWN: __webpack_require__(1303), + ANY_KEY_UP: __webpack_require__(1304), + COMBO_MATCH: __webpack_require__(1305), + DOWN: __webpack_require__(1306), + KEY_DOWN: __webpack_require__(1307), + KEY_UP: __webpack_require__(1308), + UP: __webpack_require__(1309) }; /***/ }), -/* 146 */ +/* 148 */ /***/ (function(module, exports) { /** @@ -32666,7 +35295,7 @@ module.exports = GetURL; /***/ }), -/* 147 */ +/* 149 */ /***/ (function(module, exports) { /** @@ -32685,7 +35314,7 @@ module.exports = GetURL; * @param {boolean} [async=true] - Should the XHR request use async or not? * @param {string} [user=''] - Optional username for the XHR request. * @param {string} [password=''] - Optional password for the XHR request. - * @param {integer} [timeout=0] - Optional XHR timeout value. + * @param {number} [timeout=0] - Optional XHR timeout value. * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. * * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. @@ -32736,7 +35365,7 @@ module.exports = XHRSettings; /***/ }), -/* 148 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32746,8 +35375,8 @@ module.exports = XHRSettings; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(228); -var Sprite = __webpack_require__(76); +var Components = __webpack_require__(235); +var Sprite = __webpack_require__(70); /** * @classdesc @@ -32773,6 +35402,7 @@ var Sprite = __webpack_require__(76); * @extends Phaser.Physics.Arcade.Components.Gravity * @extends Phaser.Physics.Arcade.Components.Immovable * @extends Phaser.Physics.Arcade.Components.Mass + * @extends Phaser.Physics.Arcade.Components.Pushable * @extends Phaser.Physics.Arcade.Components.Size * @extends Phaser.Physics.Arcade.Components.Velocity * @extends Phaser.GameObjects.Components.Alpha @@ -32793,7 +35423,7 @@ var Sprite = __webpack_require__(76); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeSprite = new Class({ @@ -32810,6 +35440,7 @@ var ArcadeSprite = new Class({ Components.Gravity, Components.Immovable, Components.Mass, + Components.Pushable, Components.Size, Components.Velocity ], @@ -32837,7 +35468,7 @@ module.exports = ArcadeSprite; /***/ }), -/* 149 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32846,71 +35477,7 @@ module.exports = ArcadeSprite; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Tilemaps.Components - */ - -module.exports = { - - CalculateFacesAt: __webpack_require__(235), - CalculateFacesWithin: __webpack_require__(53), - Copy: __webpack_require__(1326), - CreateFromTiles: __webpack_require__(1327), - CullTiles: __webpack_require__(1328), - Fill: __webpack_require__(1329), - FilterTiles: __webpack_require__(1330), - FindByIndex: __webpack_require__(1331), - FindTile: __webpack_require__(1332), - ForEachTile: __webpack_require__(1333), - GetTileAt: __webpack_require__(150), - GetTileAtWorldXY: __webpack_require__(1334), - GetTilesWithin: __webpack_require__(24), - GetTilesWithinShape: __webpack_require__(1335), - GetTilesWithinWorldXY: __webpack_require__(1336), - HasTileAt: __webpack_require__(504), - HasTileAtWorldXY: __webpack_require__(1337), - IsInLayerBounds: __webpack_require__(104), - PutTileAt: __webpack_require__(236), - PutTileAtWorldXY: __webpack_require__(1338), - PutTilesAt: __webpack_require__(1339), - Randomize: __webpack_require__(1340), - RemoveTileAt: __webpack_require__(505), - RemoveTileAtWorldXY: __webpack_require__(1341), - RenderDebug: __webpack_require__(1342), - ReplaceByIndex: __webpack_require__(503), - SetCollision: __webpack_require__(1343), - SetCollisionBetween: __webpack_require__(1344), - SetCollisionByExclusion: __webpack_require__(1345), - SetCollisionByProperty: __webpack_require__(1346), - SetCollisionFromCollisionGroup: __webpack_require__(1347), - SetLayerCollisionIndex: __webpack_require__(153), - SetTileCollision: __webpack_require__(65), - SetTileIndexCallback: __webpack_require__(1348), - SetTileLocationCallback: __webpack_require__(1349), - Shuffle: __webpack_require__(1350), - SwapByIndex: __webpack_require__(1351), - TileToWorldX: __webpack_require__(151), - TileToWorldXY: __webpack_require__(1352), - TileToWorldY: __webpack_require__(152), - WeightedRandomize: __webpack_require__(1353), - WorldToTileX: __webpack_require__(66), - WorldToTileXY: __webpack_require__(1354), - WorldToTileY: __webpack_require__(67) - -}; - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsInLayerBounds = __webpack_require__(104); +var IsInLayerBounds = __webpack_require__(116); /** * Gets a tile at the given tile coordinates from the given layer. @@ -32918,13 +35485,12 @@ var IsInLayerBounds = __webpack_require__(104); * @function Phaser.Tilemaps.Components.GetTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} nonNull - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ var GetTileAt = function (tileX, tileY, nonNull, layer) { @@ -32933,7 +35499,8 @@ var GetTileAt = function (tileX, tileY, nonNull, layer) if (IsInLayerBounds(tileX, tileY, layer)) { var tile = layer.data[tileY][tileX] || null; - if (tile === null) + + if (!tile) { return null; } @@ -32955,50 +35522,6 @@ var GetTileAt = function (tileX, tileY, nonNull, layer) module.exports = GetTileAt; -/***/ }), -/* 151 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.TileToWorldX - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} - */ -var TileToWorldX = function (tileX, camera, layer) -{ - var tileWidth = layer.baseTileWidth; - var tilemapLayer = layer.tilemapLayer; - var layerWorldX = 0; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); - - tileWidth *= tilemapLayer.scaleX; - } - - return layerWorldX + tileX * tileWidth; -}; - -module.exports = TileToWorldX; - - /***/ }), /* 152 */ /***/ (function(module, exports) { @@ -33010,37 +35533,119 @@ module.exports = TileToWorldX; */ /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layer's position, scale and scroll. + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. * - * @function Phaser.Tilemaps.Components.TileToWorldY - * @since 3.0.0 + * @function Phaser.Tilemaps.Components.RunCull + * @since 3.50.0 * - * @param {integer} tileY - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {object} bounds - An object containing the `left`, `right`, `top` and `bottom` bounds. + * @param {number} renderOrder - The rendering order constant. + * @param {array} outputArray - The array to store the Tile objects within. * - * @return {number} + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ -var TileToWorldY = function (tileY, camera, layer) +var RunCull = function (layer, bounds, renderOrder, outputArray) { - var tileHeight = layer.baseTileHeight; + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + var tilemapLayer = layer.tilemapLayer; - var layerWorldY = 0; - if (tilemapLayer) + var drawLeft = Math.max(0, bounds.left); + var drawRight = Math.min(mapWidth, bounds.right); + var drawTop = Math.max(0, bounds.top); + var drawBottom = Math.min(mapHeight, bounds.bottom); + + var x; + var y; + var tile; + + if (renderOrder === 0) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + // right-down - layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; - tileHeight *= tilemapLayer.scaleY; + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } } - return layerWorldY + tileY * tileHeight; + tilemapLayer.tilesDrawn = outputArray.length; + tilemapLayer.tilesTotal = mapWidth * mapHeight; + + return outputArray; }; -module.exports = TileToWorldY; +module.exports = RunCull; /***/ }), @@ -33060,8 +35665,8 @@ module.exports = TileToWorldY; * @function Phaser.Tilemaps.Components.SetLayerCollisionIndex * @since 3.0.0 * - * @param {integer} tileIndex - The tile index to set the collision boolean for. - * @param {boolean} [collides=true] - Should the tile index collide or not? + * @param {number} tileIndex - The tile index to set the collision boolean for. + * @param {boolean} collides - Should the tile index collide or not? * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetLayerCollisionIndex = function (tileIndex, collides, layer) @@ -33216,17 +35821,17 @@ module.exports = GetNewValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(243); +var Defaults = __webpack_require__(256); var GetAdvancedValue = __webpack_require__(15); -var GetBoolean = __webpack_require__(90); -var GetEaseFunction = __webpack_require__(71); +var GetBoolean = __webpack_require__(95); +var GetEaseFunction = __webpack_require__(78); var GetNewValue = __webpack_require__(155); -var GetProps = __webpack_require__(526); -var GetTargets = __webpack_require__(241); +var GetProps = __webpack_require__(562); +var GetTargets = __webpack_require__(254); var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(242); -var Tween = __webpack_require__(244); -var TweenData = __webpack_require__(246); +var GetValueOp = __webpack_require__(255); +var Tween = __webpack_require__(257); +var TweenData = __webpack_require__(259); /** * Creates a new Tween. @@ -33350,10 +35955,10 @@ module.exports = TweenBuilder; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); +var CustomMap = __webpack_require__(98); var GetFastValue = __webpack_require__(2); -var Events = __webpack_require__(122); -var Animation = __webpack_require__(172); +var Events = __webpack_require__(128); +var Animation = __webpack_require__(177); /** * @classdesc @@ -33783,7 +36388,7 @@ var AnimationState = new Class({ * 3 = Waiting for specific frame * * @name Phaser.Animations.AnimationState#_pendingStop - * @type {integer} + * @type {number} * @private * @since 3.4.0 */ @@ -34025,7 +36630,7 @@ var AnimationState = new Class({ * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. + * @param {number} delay - The delay, in milliseconds, to wait before starting the animation playing. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -34071,7 +36676,7 @@ var AnimationState = new Class({ * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * @param {number} [repeatCount=1] - How many times should the animation repeat before the next one starts? * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -34520,7 +37125,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#setRepeat * @since 3.4.0 * - * @param {integer} value - The number of times that the animation should repeat. + * @param {number} value - The number of times that the animation should repeat. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -34696,7 +37301,7 @@ var AnimationState = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.4.0 * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. + * @param {number} delay - The number of milliseconds to wait before stopping this animation. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -34724,7 +37329,7 @@ var AnimationState = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.50.0 * - * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? + * @param {number} [repeatCount=1] - How many times should the animation repeat before stopping? * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -34777,7 +37382,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#getTotalFrames * @since 3.4.0 * - * @return {integer} The total number of frames in the current animation, or zero if no animation has been loaded. + * @return {number} The total number of frames in the current animation, or zero if no animation has been loaded. */ getTotalFrames: function () { @@ -34974,11 +37579,11 @@ var AnimationState = new Class({ * * @param {string} key - The key of the Animation to retrieve. * - * @return {Phaser.Animations.Animation} The Animation, or `undefined` if the key is invalid. + * @return {Phaser.Animations.Animation} The Animation, or `null` if the key is invalid. */ get: function (key) { - return (this.anims && this.anims.get(key)); + return (this.anims) ? this.anims.get(key) : null; }, /** @@ -34989,11 +37594,11 @@ var AnimationState = new Class({ * * @param {string} key - The key of the Animation to check. * - * @return {boolean} `true` if the Animation exists locally, or `false` if the key is available. + * @return {boolean} `true` if the Animation exists locally, or `false` if the key is available, or there are no local animations. */ exists: function (key) { - return (this.anims && this.anims.has(key)); + return (this.anims) ? this.anims.has(key) : false; }, /** @@ -35046,6 +37651,99 @@ var AnimationState = new Class({ return anim; }, + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. + * + * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. + * + * Example: + * + * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * + * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'ruby', + * repeat: -1, + * frames: this.anims.generateFrameNames('gems', { + * prefix: 'ruby_', + * end: 6, + * zeroPad: 4 + * }) + * }); + * ``` + * + * Please see the animation examples for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNames + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNames} [config] - The configuration object for the animation frame names. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNames: function (key, config) + { + return this.animationManager.generateFrameNames(key, config); + }, + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNumbers + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNumbers} config - The configuration object for the animation frames. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNumbers: function (key, config) + { + return this.animationManager.generateFrameNumbers(key, config); + }, + /** * Removes a locally created Animation from this Sprite, based on the given key. * @@ -35124,8 +37822,570 @@ module.exports = AnimationState; /***/ }), -/* 158 */, -/* 159 */ +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); +var ShaderSourceFS = __webpack_require__(860); +var ShaderSourceVS = __webpack_require__(861); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); + +/** + * @classdesc + * + * The Multi Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL. + * Virtually all Game Objects use this pipeline by default, including Sprites, Graphics + * and Tilemaps. It handles the batching of quads and tris, as well as methods for + * drawing and batching geometry data. + * + * Prior to Phaser v3.50 this pipeline was called the `TextureTintPipeline`. + * + * In previous versions of Phaser only one single texture unit was supported at any one time. + * The Multi Pipeline is an evolution of the old Texture Tint Pipeline, updated to support + * multi-textures for increased performance. + * + * The fragment shader it uses can be found in `shaders/src/Multi.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uMainSampler` (sampler2D array) + * + * If you wish to create a custom pipeline extending from this one, you can use two string + * declarations in your fragment shader source: `%count%` and `%forloop%`, where `count` is + * used to set the number of `sampler2Ds` available, and `forloop` is a block of GLSL code + * that will get the currently bound texture unit. + * + * This pipeline will automatically inject that code for you, should those values exist + * in your shader source. If you wish to handle this yourself, you can also use the + * function `Utils.parseFragmentShaderMaxTextures`. + * + * If you wish to create a pipeline that works from a single texture, or that doesn't have + * internal texture iteration, please see the `SinglePipeline` instead. + * + * @class MultiPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var MultiPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function MultiPipeline (config) + { + var renderer = config.game.renderer; + + var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); + + config.fragShader = Utils.parseFragmentShaderMaxTextures(fragmentShaderSource, renderer.maxTextures); + config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTexCoord', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTexId', + size: 1, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTintEffect', + size: 1, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTint', + size: 4, + type: WEBGL_CONST.UNSIGNED_BYTE, + normalized: true + } + ]); + config.uniforms = GetFastValue(config, 'uniforms', [ + 'uProjectionMatrix', + 'uMainSampler' + ]); + + WebGLPipeline.call(this, config); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix1 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix2 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix3 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix3 = new TransformMatrix(); + }, + + /** + * Called every time the pipeline is bound by the renderer. + * Sets the shader program, vertex buffer and other resources. + * Should only be called when changing pipeline. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#bind + * @since 3.50.0 + * + * @return {this} This WebGLPipeline instance. + */ + boot: function () + { + WebGLPipeline.prototype.boot.call(this); + + this.currentShader.set1iv('uMainSampler', this.renderer.textureIndexes); + }, + + /** + * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchSprite + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} gameObject - The texture based Game Object to add to the batch. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set. + */ + batchSprite: function (gameObject, camera, parentTransformMatrix) + { + this.manager.set(this, gameObject); + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var frame = gameObject.frame; + var texture = frame.glTexture; + + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + var frameX = frame.x; + var frameY = frame.y; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; + + var displayOriginX = gameObject.displayOriginX; + var displayOriginY = gameObject.displayOriginY; + + var x = -displayOriginX + frameX; + var y = -displayOriginY + frameY; + + if (gameObject.isCropped) + { + var crop = gameObject._crop; + + if (crop.flipX !== gameObject.flipX || crop.flipY !== gameObject.flipY) + { + frame.updateCropUVs(crop, gameObject.flipX, gameObject.flipY); + } + + u0 = crop.u0; + v0 = crop.v0; + u1 = crop.u1; + v1 = crop.v1; + + frameWidth = crop.width; + frameHeight = crop.height; + + frameX = crop.x; + frameY = crop.y; + + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; + } + + var flipX = 1; + var flipY = 1; + + if (gameObject.flipX) + { + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; + } + + // Auto-invert the flipY if this is coming from a GLTexture + + if (gameObject.flipY || (frame.source.isGLTexture && !texture.flipY)) + { + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; + } + + spriteMatrix.applyITRS(gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX * flipX, gameObject.scaleY * flipY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * gameObject.scrollFactorX, -camera.scrollY * gameObject.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = gameObject.x; + spriteMatrix.f = gameObject.y; + } + else + { + spriteMatrix.e -= camera.scrollX * gameObject.scrollFactorX; + spriteMatrix.f -= camera.scrollY * gameObject.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + var xw = x + frameWidth; + var yh = y + frameHeight; + + var roundPixels = camera.roundPixels; + + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); + + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); + + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); + + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); + + var getTint = Utils.getTintAppendFloatAlpha; + var cameraAlpha = camera.alpha; + + var tintTL = getTint(gameObject.tintTopLeft, cameraAlpha * gameObject._alphaTL); + var tintTR = getTint(gameObject.tintTopRight, cameraAlpha * gameObject._alphaTR); + var tintBL = getTint(gameObject.tintBottomLeft, cameraAlpha * gameObject._alphaBL); + var tintBR = getTint(gameObject.tintBottomRight, cameraAlpha * gameObject._alphaBR); + + if (this.shouldFlush(6)) + { + this.flush(); + } + + var unit = this.setGameObject(gameObject, frame); + + this.manager.preBatch(gameObject); + + this.batchQuad(gameObject, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, gameObject.tintEffect, texture, unit); + + this.manager.postBatch(gameObject); + }, + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTexture + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject. + * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad. + * @param {number} textureWidth - Real texture width. + * @param {number} textureHeight - Real texture height. + * @param {number} srcX - X coordinate of the quad. + * @param {number} srcY - Y coordinate of the quad. + * @param {number} srcWidth - Width of the quad. + * @param {number} srcHeight - Height of the quad. + * @param {number} scaleX - X component of scale. + * @param {number} scaleY - Y component of scale. + * @param {number} rotation - Rotation of the quad. + * @param {boolean} flipX - Indicates if the quad is horizontally flipped. + * @param {boolean} flipY - Indicates if the quad is vertically flipped. + * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll. + * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll. + * @param {number} displayOriginX - Horizontal origin in pixels. + * @param {number} displayOriginY - Vertical origin in pixels. + * @param {number} frameX - X coordinate of the texture frame. + * @param {number} frameY - Y coordinate of the texture frame. + * @param {number} frameWidth - Width of the texture frame. + * @param {number} frameHeight - Height of the texture frame. + * @param {number} tintTL - Tint for top left. + * @param {number} tintTR - Tint for top right. + * @param {number} tintBL - Tint for bottom left. + * @param {number} tintBR - Tint for bottom right. + * @param {number} tintEffect - The tint effect. + * @param {number} uOffset - Horizontal offset on texture coordinate. + * @param {number} vOffset - Vertical offset on texture coordinate. + * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. + * @param {boolean} [skipFlip=false] - Skip the renderTexture check. + * @param {number} [textureUnit] - Use the currently bound texture unit? + */ + batchTexture: function ( + gameObject, + texture, + textureWidth, textureHeight, + srcX, srcY, + srcWidth, srcHeight, + scaleX, scaleY, + rotation, + flipX, flipY, + scrollFactorX, scrollFactorY, + displayOriginX, displayOriginY, + frameX, frameY, frameWidth, frameHeight, + tintTL, tintTR, tintBL, tintBR, tintEffect, + uOffset, vOffset, + camera, + parentTransformMatrix, + skipFlip, + textureUnit) + { + this.manager.set(this, gameObject); + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var u0 = (frameX / textureWidth) + uOffset; + var v0 = (frameY / textureHeight) + vOffset; + var u1 = (frameX + frameWidth) / textureWidth + uOffset; + var v1 = (frameY + frameHeight) / textureHeight + vOffset; + + var width = srcWidth; + var height = srcHeight; + + var x = -displayOriginX; + var y = -displayOriginY; + + if (gameObject.isCropped) + { + var crop = gameObject._crop; + + var cropWidth = crop.width; + var cropHeight = crop.height; + + width = cropWidth; + height = cropHeight; + + srcWidth = cropWidth; + srcHeight = cropHeight; + + frameX = crop.x; + frameY = crop.y; + + var ox = frameX; + var oy = frameY; + + if (flipX) + { + ox = (frameWidth - crop.x - cropWidth); + } + + if (flipY) + { + oy = (frameHeight - crop.y - cropHeight); + } + + u0 = (ox / textureWidth) + uOffset; + v0 = (oy / textureHeight) + vOffset; + u1 = (ox + cropWidth) / textureWidth + uOffset; + v1 = (oy + cropHeight) / textureHeight + vOffset; + + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; + } + + // Invert the flipY if this is a RenderTexture + flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); + + if (flipX) + { + width *= -1; + x += srcWidth; + } + + if (flipY) + { + height *= -1; + y += srcHeight; + } + + var xw = x + width; + var yh = y + height; + + spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = srcX; + spriteMatrix.f = srcY; + } + else + { + spriteMatrix.e -= camera.scrollX * scrollFactorX; + spriteMatrix.f -= camera.scrollY * scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + var roundPixels = camera.roundPixels; + + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); + + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); + + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); + + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); + + if (textureUnit === undefined) + { + textureUnit = this.renderer.setTexture2D(texture); + } + + if (gameObject) + { + this.manager.preBatch(gameObject); + } + + this.batchQuad(gameObject, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + + if (gameObject) + { + this.manager.postBatch(gameObject); + } + }, + + /** + * Adds a Texture Frame into the batch for rendering. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTextureFrame + * @since 3.12.0 + * + * @param {Phaser.Textures.Frame} frame - The Texture Frame to be rendered. + * @param {number} x - The horizontal position to render the texture at. + * @param {number} y - The vertical position to render the texture at. + * @param {number} tint - The tint color. + * @param {number} alpha - The alpha value. + * @param {Phaser.GameObjects.Components.TransformMatrix} transformMatrix - The Transform Matrix to use for the texture. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - A parent Transform Matrix. + */ + batchTextureFrame: function ( + frame, + x, y, + tint, alpha, + transformMatrix, + parentTransformMatrix + ) + { + this.manager.set(this); + + var spriteMatrix = this._tempMatrix1.copyFrom(transformMatrix); + var calcMatrix = this._tempMatrix2; + + var xw = x + frame.width; + var yh = y + frame.height; + + if (parentTransformMatrix) + { + spriteMatrix.multiply(parentTransformMatrix, calcMatrix); + } + else + { + calcMatrix = spriteMatrix; + } + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + var unit = this.renderer.setTextureSource(frame.source); + + tint = Utils.getTintAppendFloatAlpha(tint, alpha); + + this.batchQuad(null, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, unit); + } + +}); + +module.exports = MultiPipeline; + + +/***/ }), +/* 159 */, +/* 160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35164,7 +38424,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35208,7 +38468,7 @@ module.exports = Random; /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35217,7 +38477,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(118); +var Perimeter = __webpack_require__(126); var Point = __webpack_require__(4); /** @@ -35289,7 +38549,7 @@ module.exports = GetPoint; /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35298,7 +38558,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); var Point = __webpack_require__(4); /** @@ -35315,7 +38575,7 @@ var Point = __webpack_require__(4); * @generic {Phaser.Geom.Point[]} O - [out,$return] * * @param {Phaser.Geom.Line} line - The line. - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * @@ -35354,7 +38614,7 @@ module.exports = GetPoints; /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35394,7 +38654,7 @@ module.exports = Random; /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35432,7 +38692,7 @@ module.exports = Random; /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35441,7 +38701,8 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PIPELINE_CONST = __webpack_require__(110); +var DeepCopy = __webpack_require__(167); +var PIPELINE_CONST = __webpack_require__(82); /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. @@ -35456,6 +38717,8 @@ var Pipeline = { /** * The initial WebGL pipeline of this Game Object. * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + * * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline * @type {Phaser.Renderer.WebGL.WebGLPipeline} * @default null @@ -35475,61 +38738,251 @@ var Pipeline = { */ pipeline: null, + /** + * Does this Game Object have any Post Pipelines set? + * + * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.50.0 + */ + hasPostPipeline: false, + + /** + * Does this Game Object manage its Post Pipeline directly? + * + * @name Phaser.GameObjects.Components.Pipeline#manualPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.50.0 + */ + manualPostPipeline: false, + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + * + * @name Phaser.GameObjects.Components.Pipeline#postPipeline + * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} + * @webglOnly + * @since 3.50.0 + */ + postPipelines: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.Pipeline#pipelineData + * @type {object} + * @webglOnly + * @since 3.50.0 + */ + pipelineData: null, + /** * Sets the initial WebGL Pipeline of this Game Object. * - * This should only be called during the instantiation of the Game Object. + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. * * @method Phaser.GameObjects.Components.Pipeline#initPipeline * @webglOnly * @since 3.0.0 * - * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (name) + initPipeline: function (pipeline) { - if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } + if (pipeline === undefined) { pipeline = PIPELINE_CONST.MULTI_PIPELINE; } - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) - { - this.defaultPipeline = pipelines.get(name); - this.pipeline = this.defaultPipeline; + this.postPipelines = []; + this.pipelineData = {}; - return true; + if (pipelines) + { + var instance = pipelines.get(pipeline); + + if (instance) + { + this.defaultPipeline = instance; + this.pipeline = instance; + + return true; + } } return false; }, /** - * Sets the active WebGL Pipeline of this Game Object. + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. * * @method Phaser.GameObjects.Components.Pipeline#setPipeline * @webglOnly * @since 3.0.0 * - * @param {string} name - The name of the pipeline to set on this Game Object. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. * * @return {this} This Game Object instance. */ - setPipeline: function (name) + setPipeline: function (pipeline, pipelineData, copyData) { - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) + if (pipelines) { - this.pipeline = pipelines.get(name); + var instance = pipelines.get(pipeline); + + if (instance) + { + this.pipeline = instance; + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } } return this; }, + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPostPipeline: function (pipelines, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + var pipelineManager = renderer.pipelines; + + if (pipelineManager) + { + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelineManager.getPostPipeline(pipelines[i], this); + + if (instance) + { + this.postPipelines.push(instance); + } + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipelineData + * @webglOnly + * @since 3.50.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPipelineData: function (key, value) + { + var data = this.pipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * + * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {string} name - The name of the Post Pipeline to get. + * + * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The first Post Pipeline matching the name, or undefined if no match. + */ + getPostPipeline: function (pipeline) + { + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((typeof pipeline === 'string' && instance.name === name) || instance instanceof pipeline) + { + return instance; + } + } + }, + /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. * @@ -35537,15 +38990,62 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines? + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + * + * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. */ - resetPipeline: function () + resetPipeline: function (resetPostPipelines, resetData) { + if (resetPostPipelines === undefined) { resetPostPipelines = false; } + if (resetData === undefined) { resetData = false; } + this.pipeline = this.defaultPipeline; + if (resetPostPipelines) + { + this.postPipelines = []; + this.hasPostPipeline = false; + } + + if (resetData) + { + this.pipelineData = {}; + } + return (this.pipeline !== null); }, + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + */ + resetPostPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].destroy(); + } + + this.postPipelines = []; + this.hasPostPipeline = false; + + if (resetData) + { + this.pipelineData = {}; + } + }, + /** * Gets the name of the WebGL Pipeline this Game Object is currently using. * @@ -35566,7 +39066,117 @@ module.exports = Pipeline; /***/ }), -/* 166 */ +/* 167 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Deep Copy the given object or array. + * + * @function Phaser.Utils.Objects.DeepCopy + * @since 3.50.0 + * + * @param {object} obj - The object to deep copy. + * + * @return {object} A deep copy of the original object. + */ +var DeepCopy = function (inObject) +{ + var outObject; + var value; + var key; + + if (typeof inObject !== 'object' || inObject === null) + { + // inObject is not an object + return inObject; + } + + // Create an array or object to hold the values + outObject = Array.isArray(inObject) ? [] : {}; + + for (key in inObject) + { + value = inObject[key]; + + // Recursively (deep) copy for nested objects, including arrays + outObject[key] = DeepCopy(value); + } + + return outObject; +}; + +module.exports = DeepCopy; + + +/***/ }), +/* 168 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + * + * @method Phaser.GameObjects.Components.ToJSON + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ +var ToJSON = function (gameObject) +{ + var out = { + name: gameObject.name, + type: gameObject.type, + x: gameObject.x, + y: gameObject.y, + depth: gameObject.depth, + scale: { + x: gameObject.scaleX, + y: gameObject.scaleY + }, + origin: { + x: gameObject.originX, + y: gameObject.originY + }, + flipX: gameObject.flipX, + flipY: gameObject.flipY, + rotation: gameObject.rotation, + alpha: gameObject.alpha, + visible: gameObject.visible, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), +/* 169 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35621,7 +39231,87 @@ module.exports = TransformXY; /***/ }), -/* 167 */ +/* 170 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * + * @function Phaser.Utils.Array.RotateRight + * @since 3.0.0 + * + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateRight = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.pop(); + array.unshift(element); + } + + return element; +}; + +module.exports = RotateRight; + + +/***/ }), +/* 172 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35662,7 +39352,7 @@ module.exports = Random; /***/ }), -/* 168 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35718,7 +39408,7 @@ module.exports = Random; /***/ }), -/* 169 */ +/* 174 */ /***/ (function(module, exports) { /** @@ -35759,7 +39449,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 170 */ +/* 175 */ /***/ (function(module, exports) { /** @@ -35798,7 +39488,7 @@ module.exports = SmootherStep; /***/ }), -/* 171 */ +/* 176 */ /***/ (function(module, exports) { /** @@ -35845,7 +39535,7 @@ module.exports = SmoothStep; /***/ }), -/* 172 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35854,13 +39544,13 @@ module.exports = SmoothStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(122); -var FindClosestInSorted = __webpack_require__(298); -var Frame = __webpack_require__(299); +var Events = __webpack_require__(128); +var FindClosestInSorted = __webpack_require__(310); +var Frame = __webpack_require__(311); var GetValue = __webpack_require__(6); -var SortByDigits = __webpack_require__(300); +var SortByDigits = __webpack_require__(312); /** * @classdesc @@ -35938,7 +39628,7 @@ var Animation = new Class({ * The frame rate of playback in frames per second (default 24 if duration is null) * * @name Phaser.Animations.Animation#frameRate - * @type {integer} + * @type {number} * @default 24 * @since 3.0.0 */ @@ -35950,7 +39640,7 @@ var Animation = new Class({ * otherwise the `frameRate` is derived from `duration`. * * @name Phaser.Animations.Animation#duration - * @type {integer} + * @type {number} * @since 3.0.0 */ this.duration = GetValue(config, 'duration', null); @@ -35959,7 +39649,7 @@ var Animation = new Class({ * How many ms per frame, not including frame specific modifiers. * * @name Phaser.Animations.Animation#msPerFrame - * @type {integer} + * @type {number} * @since 3.0.0 */ this.msPerFrame; @@ -35978,7 +39668,7 @@ var Animation = new Class({ * The delay in ms before the playback will begin. * * @name Phaser.Animations.Animation#delay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -35988,7 +39678,7 @@ var Animation = new Class({ * Number of times to repeat the animation. Set to -1 to repeat forever. * * @name Phaser.Animations.Animation#repeat - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -35998,7 +39688,7 @@ var Animation = new Class({ * The delay in ms before the a repeat play starts. * * @name Phaser.Animations.Animation#repeatDelay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -36072,7 +39762,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#calculateDuration * @since 3.50.0 * - * @param {(Phaser.Animations.Animation|Phaser.GameObjects.Components.Animation)} target - The target to set the values on. + * @param {Phaser.Animations.Animation} target - The target to set the values on. * @param {number} totalFrames - The total number of frames in the animation. * @param {number} duration - The duration to calculate the frame rate from. * @param {number} frameRate - The frame ate to calculate the duration from. @@ -36126,7 +39816,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#addFrameAt * @since 3.0.0 * - * @param {integer} index - The index to insert the frame at within the animation. + * @param {number} index - The index to insert the frame at within the animation. * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. * * @return {this} This Animation object. @@ -36165,7 +39855,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#checkFrame * @since 3.0.0 * - * @param {integer} index - The index to be checked. + * @param {number} index - The index to be checked. * * @return {boolean} `true` if the index is valid, otherwise `false`. */ @@ -36182,14 +39872,14 @@ var Animation = new Class({ * @protected * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - getFirstTick: function (component) + getFirstTick: function (state) { // When is the first update due? - component.accumulator = 0; + state.accumulator = 0; - component.nextTick = component.msPerFrame + component.currentFrame.duration; + state.nextTick = state.msPerFrame + state.currentFrame.duration; }, /** @@ -36199,7 +39889,7 @@ var Animation = new Class({ * @protected * @since 3.0.0 * - * @param {integer} index - The index in the AnimationFrame array + * @param {number} index - The index in the AnimationFrame array * * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence */ @@ -36323,13 +40013,13 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#getNextTick * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - getNextTick: function (component) + getNextTick: function (state) { - component.accumulator -= component.nextTick; + state.accumulator -= state.nextTick; - component.nextTick = component.msPerFrame + component.currentFrame.duration; + state.nextTick = state.msPerFrame + state.currentFrame.duration; }, /** @@ -36355,42 +40045,42 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#nextFrame * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {Phaser.Animations.AnimationState} state - The Animation State to advance. */ - nextFrame: function (component) + nextFrame: function (state) { - var frame = component.currentFrame; + var frame = state.currentFrame; if (frame.isLast) { // We're at the end of the animation // Yoyo? (happens before repeat) - if (component.yoyo) + if (state.yoyo) { - this.handleYoyoFrame(component, false); + this.handleYoyoFrame(state, false); } - else if (component.repeatCounter > 0) + else if (state.repeatCounter > 0) { // Repeat (happens before complete) - if (component.inReverse && component.forward) + if (state.inReverse && state.forward) { - component.forward = false; + state.forward = false; } else { - this.repeatAnimation(component); + this.repeatAnimation(state); } } else { - component.complete(); + state.complete(); } } else { - this.updateAndGetNextTick(component, frame.nextFrame); + this.updateAndGetNextTick(state, frame.nextFrame); } }, @@ -36401,37 +40091,37 @@ var Animation = new Class({ * @private * @since 3.12.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {Phaser.Animations.AnimationState} state - The Animation State to advance. * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) */ - handleYoyoFrame: function (component, isReverse) + handleYoyoFrame: function (state, isReverse) { if (!isReverse) { isReverse = false; } - if (component.inReverse === !isReverse && component.repeatCounter > 0) + if (state.inReverse === !isReverse && state.repeatCounter > 0) { - if (component.repeatDelay === 0 || component.pendingRepeat) + if (state.repeatDelay === 0 || state.pendingRepeat) { - component.forward = isReverse; + state.forward = isReverse; } - this.repeatAnimation(component); + this.repeatAnimation(state); return; } - if (component.inReverse !== isReverse && component.repeatCounter === 0) + if (state.inReverse !== isReverse && state.repeatCounter === 0) { - component.complete(); + state.complete(); return; } - component.forward = isReverse; + state.forward = isReverse; - var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; + var frame = (isReverse) ? state.currentFrame.nextFrame : state.currentFrame.prevFrame; - this.updateAndGetNextTick(component, frame); + this.updateAndGetNextTick(state, frame); }, /** @@ -36440,7 +40130,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#getLastFrame * @since 3.12.0 * - * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. + * @return {Phaser.Animations.AnimationFrame} The last Animation Frame. */ getLastFrame: function () { @@ -36454,41 +40144,41 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#previousFrame * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - previousFrame: function (component) + previousFrame: function (state) { - var frame = component.currentFrame; + var frame = state.currentFrame; if (frame.isFirst) { // We're at the start of the animation - if (component.yoyo) + if (state.yoyo) { - this.handleYoyoFrame(component, true); + this.handleYoyoFrame(state, true); } - else if (component.repeatCounter > 0) + else if (state.repeatCounter > 0) { - if (component.inReverse && !component.forward) + if (state.inReverse && !state.forward) { - this.repeatAnimation(component); + this.repeatAnimation(state); } else { // Repeat (happens before complete) - component.forward = true; + state.forward = true; - this.repeatAnimation(component); + this.repeatAnimation(state); } } else { - component.complete(); + state.complete(); } } else { - this.updateAndGetNextTick(component, frame.prevFrame); + this.updateAndGetNextTick(state, frame.prevFrame); } }, @@ -36499,13 +40189,14 @@ var Animation = new Class({ * @private * @since 3.12.0 * + * @param {Phaser.Animations.AnimationState} state - The Animation State. * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. */ - updateAndGetNextTick: function (component, frame) + updateAndGetNextTick: function (state, frame) { - component.setCurrentFrame(frame); + state.setCurrentFrame(frame); - this.getNextTick(component); + this.getNextTick(state); }, /** @@ -36538,7 +40229,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#removeFrameAt * @since 3.0.0 * - * @param {integer} index - The index in the AnimationFrame array + * @param {number} index - The index in the AnimationFrame array * * @return {this} This Animation object. */ @@ -36561,46 +40252,46 @@ var Animation = new Class({ * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - repeatAnimation: function (component) + repeatAnimation: function (state) { - if (component._pendingStop === 2) + if (state._pendingStop === 2) { - if (component._pendingStopValue === 0) + if (state._pendingStopValue === 0) { - return component.stop(); + return state.stop(); } else { - component._pendingStopValue--; + state._pendingStopValue--; } } - if (component.repeatDelay > 0 && !component.pendingRepeat) + if (state.repeatDelay > 0 && !state.pendingRepeat) { - component.pendingRepeat = true; - component.accumulator -= component.nextTick; - component.nextTick += component.repeatDelay; + state.pendingRepeat = true; + state.accumulator -= state.nextTick; + state.nextTick += state.repeatDelay; } else { - component.repeatCounter--; + state.repeatCounter--; - if (component.forward) + if (state.forward) { - component.setCurrentFrame(component.currentFrame.nextFrame); + state.setCurrentFrame(state.currentFrame.nextFrame); } else { - component.setCurrentFrame(component.currentFrame.prevFrame); + state.setCurrentFrame(state.currentFrame.prevFrame); } - if (component.isPlaying) + if (state.isPlaying) { - this.getNextTick(component); + this.getNextTick(state); - component.handleRepeat(); + state.handleRepeat(); } } }, @@ -36759,7 +40450,7 @@ module.exports = Animation; /***/ }), -/* 173 */ +/* 178 */ /***/ (function(module, exports) { /** @@ -36792,9 +40483,9 @@ module.exports = Animation; * @since 3.0.0 * * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. - * @param {integer} [len=0] - The number of characters to be added. + * @param {number} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). - * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). * * @return {string} The padded string. */ @@ -36835,7 +40526,7 @@ module.exports = Pad; /***/ }), -/* 174 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36844,10 +40535,10 @@ module.exports = Pad; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HexStringToColor = __webpack_require__(307); -var IntegerToColor = __webpack_require__(310); -var ObjectToColor = __webpack_require__(312); -var RGBStringToColor = __webpack_require__(313); +var HexStringToColor = __webpack_require__(319); +var IntegerToColor = __webpack_require__(322); +var ObjectToColor = __webpack_require__(323); +var RGBStringToColor = __webpack_require__(324); /** * Converts the given source color value into an instance of a Color class. @@ -36891,37 +40582,7 @@ module.exports = ValueToColor; /***/ }), -/* 175 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given 3 separate color values this will return an integer representation of it. - * - * @function Phaser.Display.Color.GetColor - * @since 3.0.0 - * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * - * @return {number} The combined color value. - */ -var GetColor = function (red, green, blue) -{ - return red << 16 | green << 8 | blue; -}; - -module.exports = GetColor; - - -/***/ }), -/* 176 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36930,7 +40591,7 @@ module.exports = GetColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColor = __webpack_require__(175); +var GetColor = __webpack_require__(100); /** * RGB space conversion. @@ -37002,7 +40663,7 @@ module.exports = HSVToRGB; /***/ }), -/* 177 */ +/* 181 */ /***/ (function(module, exports) { /** @@ -37011,130 +40672,46 @@ module.exports = HSVToRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Browser specific prefix, so not going to change between contexts, only between browsers -var prefix = ''; - /** - * @namespace Phaser.Display.Canvas.Smoothing + * Return the component parts of a color as an Object with the properties alpha, red, green, blue. + * + * Alpha will only be set if it exists in the given color (0xAARRGGBB) + * + * @function Phaser.Display.Color.IntegerToRGB * @since 3.0.0 + * + * @param {number} input - The color value to convert into a Color object. + * + * @return {Phaser.Types.Display.ColorObject} An object with the red, green and blue values set in the r, g and b properties. */ -var Smoothing = function () +var IntegerToRGB = function (color) { - /** - * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. - * - * @function Phaser.Display.Canvas.Smoothing.getPrefix - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. - * - * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. - */ - var getPrefix = function (context) + if (color > 16777215) { - var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; - - for (var i = 0; i < vendors.length; i++) - { - var s = vendors[i] + 'mageSmoothingEnabled'; - - if (s in context) - { - return s; - } - } - - return null; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.enable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var enable = function (context) + // The color value has an alpha component + return { + a: color >>> 24, + r: color >> 16 & 0xFF, + g: color >> 8 & 0xFF, + b: color & 0xFF + }; + } + else { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = true; - } - - return context; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.disable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var disable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = false; - } - - return context; - }; - - /** - * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. - * Returns null if no smoothing prefix is available. - * - * @function Phaser.Display.Canvas.Smoothing.isEnabled - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. - * - * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. - */ - var isEnabled = function (context) - { - return (prefix !== null) ? context[prefix] : null; - }; - - return { - disable: disable, - enable: enable, - getPrefix: getPrefix, - isEnabled: isEnabled - }; - + return { + a: 255, + r: color >> 16 & 0xFF, + g: color >> 8 & 0xFF, + b: color & 0xFF + }; + } }; -module.exports = Smoothing(); +module.exports = IntegerToRGB; /***/ }), -/* 178 */ +/* 182 */ /***/ (function(module, exports) { /** @@ -37171,7 +40748,7 @@ module.exports = CenterOn; /***/ }), -/* 179 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37180,9 +40757,9 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(125); -var Browser = __webpack_require__(126); -var CanvasPool = __webpack_require__(26); +var OS = __webpack_require__(102); +var Browser = __webpack_require__(131); +var CanvasPool = __webpack_require__(31); /** * Determines the features of the browser running this Phaser Game instance. @@ -37363,7 +40940,139 @@ module.exports = init(); /***/ }), -/* 180 */ +/* 184 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Browser specific prefix, so not going to change between contexts, only between browsers +var prefix = ''; + +/** + * @namespace Phaser.Display.Canvas.Smoothing + * @since 3.0.0 + */ +var Smoothing = function () +{ + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * + * @function Phaser.Display.Canvas.Smoothing.getPrefix + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. + * + * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. + */ + var getPrefix = function (context) + { + var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; + + for (var i = 0; i < vendors.length; i++) + { + var s = vendors[i] + 'mageSmoothingEnabled'; + + if (s in context) + { + return s; + } + } + + return null; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.enable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var enable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = true; + } + + return context; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.disable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var disable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = false; + } + + return context; + }; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * + * @function Phaser.Display.Canvas.Smoothing.isEnabled + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. + * + * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. + */ + var isEnabled = function (context) + { + return (prefix !== null) ? context[prefix] : null; + }; + + return { + disable: disable, + enable: enable, + getPrefix: getPrefix, + isEnabled: isEnabled + }; + +}; + +module.exports = Smoothing(); + + +/***/ }), +/* 185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37373,7 +41082,7 @@ module.exports = init(); */ var CONST = __webpack_require__(13); -var Extend = __webpack_require__(19); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Math @@ -37382,63 +41091,64 @@ var Extend = __webpack_require__(19); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(760), - Distance: __webpack_require__(769), - Easing: __webpack_require__(774), - Fuzzy: __webpack_require__(775), - Interpolation: __webpack_require__(778), - Pow2: __webpack_require__(783), - Snap: __webpack_require__(785), + Angle: __webpack_require__(801), + Distance: __webpack_require__(810), + Easing: __webpack_require__(815), + Fuzzy: __webpack_require__(816), + Interpolation: __webpack_require__(819), + Pow2: __webpack_require__(824), + Snap: __webpack_require__(826), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(787), + RandomDataGenerator: __webpack_require__(828), // Single functions - Average: __webpack_require__(788), - Bernstein: __webpack_require__(337), - Between: __webpack_require__(182), - CatmullRom: __webpack_require__(181), - CeilTo: __webpack_require__(789), - Clamp: __webpack_require__(17), - DegToRad: __webpack_require__(41), - Difference: __webpack_require__(790), - Factorial: __webpack_require__(338), - FloatBetween: __webpack_require__(127), - FloorTo: __webpack_require__(791), - FromPercent: __webpack_require__(89), - GetSpeed: __webpack_require__(792), - IsEven: __webpack_require__(793), - IsEvenStrict: __webpack_require__(794), - Linear: __webpack_require__(124), - MaxAdd: __webpack_require__(795), - MinSub: __webpack_require__(796), - Percent: __webpack_require__(797), - RadToDeg: __webpack_require__(183), - RandomXY: __webpack_require__(798), - RandomXYZ: __webpack_require__(799), - RandomXYZW: __webpack_require__(800), - Rotate: __webpack_require__(344), - RotateAround: __webpack_require__(285), - RotateAroundDistance: __webpack_require__(169), - RotateTo: __webpack_require__(801), - RoundAwayFromZero: __webpack_require__(345), - RoundTo: __webpack_require__(802), - SinCosTableGenerator: __webpack_require__(803), - SmootherStep: __webpack_require__(170), - SmoothStep: __webpack_require__(171), - ToXY: __webpack_require__(804), - TransformXY: __webpack_require__(166), - Within: __webpack_require__(805), - Wrap: __webpack_require__(59), + Average: __webpack_require__(829), + Bernstein: __webpack_require__(348), + Between: __webpack_require__(187), + CatmullRom: __webpack_require__(186), + CeilTo: __webpack_require__(830), + Clamp: __webpack_require__(16), + DegToRad: __webpack_require__(34), + Difference: __webpack_require__(831), + Euler: __webpack_require__(832), + Factorial: __webpack_require__(349), + FloatBetween: __webpack_require__(132), + FloorTo: __webpack_require__(833), + FromPercent: __webpack_require__(94), + GetSpeed: __webpack_require__(834), + IsEven: __webpack_require__(835), + IsEvenStrict: __webpack_require__(836), + Linear: __webpack_require__(130), + MaxAdd: __webpack_require__(837), + MinSub: __webpack_require__(838), + Percent: __webpack_require__(839), + RadToDeg: __webpack_require__(188), + RandomXY: __webpack_require__(840), + RandomXYZ: __webpack_require__(841), + RandomXYZW: __webpack_require__(842), + Rotate: __webpack_require__(354), + RotateAround: __webpack_require__(300), + RotateAroundDistance: __webpack_require__(174), + RotateTo: __webpack_require__(843), + RoundAwayFromZero: __webpack_require__(355), + RoundTo: __webpack_require__(844), + SinCosTableGenerator: __webpack_require__(845), + SmootherStep: __webpack_require__(175), + SmoothStep: __webpack_require__(176), + ToXY: __webpack_require__(846), + TransformXY: __webpack_require__(169), + Within: __webpack_require__(847), + Wrap: __webpack_require__(64), // Vector classes Vector2: __webpack_require__(3), - Vector3: __webpack_require__(81), - Vector4: __webpack_require__(129), - Matrix3: __webpack_require__(346), - Matrix4: __webpack_require__(347), - Quaternion: __webpack_require__(348), - RotateVec3: __webpack_require__(806) + Vector3: __webpack_require__(37), + Vector4: __webpack_require__(135), + Matrix3: __webpack_require__(356), + Matrix4: __webpack_require__(73), + Quaternion: __webpack_require__(357), + RotateVec3: __webpack_require__(848) }; @@ -37452,7 +41162,7 @@ module.exports = PhaserMath; /***/ }), -/* 181 */ +/* 186 */ /***/ (function(module, exports) { /** @@ -37489,7 +41199,7 @@ module.exports = CatmullRom; /***/ }), -/* 182 */ +/* 187 */ /***/ (function(module, exports) { /** @@ -37504,10 +41214,10 @@ module.exports = CatmullRom; * @function Phaser.Math.Between * @since 3.0.0 * - * @param {integer} min - The minimum value. - * @param {integer} max - The maximum value. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. * - * @return {integer} The random integer. + * @return {number} The random integer. */ var Between = function (min, max) { @@ -37518,7 +41228,7 @@ module.exports = Between; /***/ }), -/* 183 */ +/* 188 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37537,7 +41247,7 @@ var CONST = __webpack_require__(13); * * @param {number} radians - The angle in radians to convert ot degrees. * - * @return {integer} The given angle converted to degrees. + * @return {number} The given angle converted to degrees. */ var RadToDeg = function (radians) { @@ -37548,7 +41258,7 @@ module.exports = RadToDeg; /***/ }), -/* 184 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37558,11 +41268,11 @@ module.exports = RadToDeg; */ /** - * @typedef {object} Phaser.Plugins.DefaultPlugins - * - * @property {array} Global - These are the Global Managers that are created by the Phaser.Game instance. - * @property {array} CoreScene - These are the core plugins that are installed into every Scene.Systems instance, no matter what. - * @property {array} DefaultScene - These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + * The Default Plugins. + * + * @namespace Phaser.Plugins.DefaultPlugins + * @memberof Phaser.Plugins + * @since 3.0.0 */ var DefaultPlugins = { @@ -37584,7 +41294,8 @@ var DefaultPlugins = { 'registry', 'scale', 'sound', - 'textures' + 'textures', + 'renderer' ], @@ -37649,8 +41360,8 @@ module.exports = DefaultPlugins; /***/ }), -/* 185 */ -/***/ (function(module, exports) { +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -37659,55 +41370,21 @@ module.exports = DefaultPlugins; */ /** - * Translates the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.ProjectOrtho - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} left - The left value. - * @param {number} right - The right value. - * @param {number} bottom - The bottom value. - * @param {number} top - The top value. - * @param {number} near - The near value. - * @param {number} far - The far value. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. + * @namespace Phaser.Renderer.WebGL.Events */ -var ProjectOrtho = function (model, left, right, bottom, top, near, far) -{ - var projectionMatrix = model.projectionMatrix; - var leftRight = 1 / (left - right); - var bottomTop = 1 / (bottom - top); - var nearFar = 1 / (near - far); - projectionMatrix[0] = -2 * leftRight; - projectionMatrix[1] = 0; - projectionMatrix[2] = 0; - projectionMatrix[3] = 0; - projectionMatrix[4] = 0; - projectionMatrix[5] = -2 * bottomTop; - projectionMatrix[6] = 0; - projectionMatrix[7] = 0; - projectionMatrix[8] = 0; - projectionMatrix[9] = 0; - projectionMatrix[10] = 2 * nearFar; - projectionMatrix[11] = 0; - projectionMatrix[12] = (left + right) * leftRight; - projectionMatrix[13] = (top + bottom) * bottomTop; - projectionMatrix[14] = (far + near) * nearFar; - projectionMatrix[15] = 1; +module.exports = { - model.projectionMatrixDirty = true; + POST_RENDER: __webpack_require__(849), + PRE_RENDER: __webpack_require__(850), + RENDER: __webpack_require__(851), + RESIZE: __webpack_require__(852) - return model; }; -module.exports = ProjectOrtho; - /***/ }), -/* 186 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37793,7 +41470,7 @@ module.exports = FromPoints; /***/ }), -/* 187 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37804,10 +41481,10 @@ module.exports = FromPoints; var CONST = { - CENTER: __webpack_require__(370), - ORIENTATION: __webpack_require__(371), - SCALE_MODE: __webpack_require__(372), - ZOOM: __webpack_require__(373) + CENTER: __webpack_require__(380), + ORIENTATION: __webpack_require__(381), + SCALE_MODE: __webpack_require__(382), + ZOOM: __webpack_require__(383) }; @@ -37815,7 +41492,7 @@ module.exports = CONST; /***/ }), -/* 188 */ +/* 193 */ /***/ (function(module, exports) { /** @@ -37844,7 +41521,7 @@ module.exports = RemoveFromDOM; /***/ }), -/* 189 */ +/* 194 */ /***/ (function(module, exports) { /** @@ -37859,7 +41536,7 @@ var INPUT_CONST = { * The mouse pointer is being held down. * * @name Phaser.Input.MOUSE_DOWN - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_DOWN: 0, @@ -37868,7 +41545,7 @@ var INPUT_CONST = { * The mouse pointer is being moved. * * @name Phaser.Input.MOUSE_MOVE - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_MOVE: 1, @@ -37877,7 +41554,7 @@ var INPUT_CONST = { * The mouse pointer is released. * * @name Phaser.Input.MOUSE_UP - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_UP: 2, @@ -37886,7 +41563,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_START - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_START: 3, @@ -37895,7 +41572,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_MOVE - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_MOVE: 4, @@ -37904,7 +41581,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_END - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_END: 5, @@ -37913,7 +41590,7 @@ var INPUT_CONST = { * The pointer lock has changed. * * @name Phaser.Input.POINTER_LOCK_CHANGE - * @type {integer} + * @type {number} * @since 3.10.0 */ POINTER_LOCK_CHANGE: 6, @@ -37922,7 +41599,7 @@ var INPUT_CONST = { * A touch pointer has been been cancelled by the browser. * * @name Phaser.Input.TOUCH_CANCEL - * @type {integer} + * @type {number} * @since 3.15.0 */ TOUCH_CANCEL: 7, @@ -37931,7 +41608,7 @@ var INPUT_CONST = { * The mouse wheel changes. * * @name Phaser.Input.MOUSE_WHEEL - * @type {integer} + * @type {number} * @since 3.18.0 */ MOUSE_WHEEL: 8 @@ -37942,7 +41619,7 @@ module.exports = INPUT_CONST; /***/ }), -/* 190 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37952,13 +41629,13 @@ module.exports = INPUT_CONST; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(133); -var DefaultPlugins = __webpack_require__(184); +var CONST = __webpack_require__(139); +var DefaultPlugins = __webpack_require__(189); var Events = __webpack_require__(20); -var GetPhysicsPlugins = __webpack_require__(386); -var GetScenePlugins = __webpack_require__(387); +var GetPhysicsPlugins = __webpack_require__(396); +var GetScenePlugins = __webpack_require__(397); var NOOP = __webpack_require__(1); -var Settings = __webpack_require__(388); +var Settings = __webpack_require__(398); /** * @classdesc @@ -38312,13 +41989,15 @@ var Systems = new Class({ */ step: function (time, delta) { - this.events.emit(Events.PRE_UPDATE, time, delta); + var events = this.events; - this.events.emit(Events.UPDATE, time, delta); + events.emit(Events.PRE_UPDATE, time, delta); + + events.emit(Events.UPDATE, time, delta); this.sceneUpdate.call(this.scene, time, delta); - this.events.emit(Events.POST_UPDATE, time, delta); + events.emit(Events.POST_UPDATE, time, delta); }, /** @@ -38378,13 +42057,16 @@ var Systems = new Class({ */ pause: function (data) { + var events = this.events; + var settings = this.settings; + if (this.settings.active) { - this.settings.status = CONST.PAUSED; + settings.status = CONST.PAUSED; - this.settings.active = false; + settings.active = false; - this.events.emit(Events.PAUSE, this, data); + events.emit(Events.PAUSE, this, data); } return this; @@ -38403,13 +42085,16 @@ var Systems = new Class({ */ resume: function (data) { + var events = this.events; + var settings = this.settings; + if (!this.settings.active) { - this.settings.status = CONST.RUNNING; + settings.status = CONST.RUNNING; - this.settings.active = true; + settings.active = true; - this.events.emit(Events.RESUME, this, data); + events.emit(Events.RESUME, this, data); } return this; @@ -38433,12 +42118,15 @@ var Systems = new Class({ */ sleep: function (data) { - this.settings.status = CONST.SLEEPING; + var events = this.events; + var settings = this.settings; - this.settings.active = false; - this.settings.visible = false; + settings.status = CONST.SLEEPING; - this.events.emit(Events.SLEEP, this, data); + settings.active = false; + settings.visible = false; + + events.emit(Events.SLEEP, this, data); return this; }, @@ -38456,6 +42144,7 @@ var Systems = new Class({ */ wake: function (data) { + var events = this.events; var settings = this.settings; settings.status = CONST.RUNNING; @@ -38463,11 +42152,11 @@ var Systems = new Class({ settings.active = true; settings.visible = true; - this.events.emit(Events.WAKE, this, data); + events.emit(Events.WAKE, this, data); if (settings.isTransition) { - this.events.emit(Events.TRANSITION_WAKE, settings.transitionFrom, settings.transitionDuration); + events.emit(Events.TRANSITION_WAKE, settings.transitionFrom, settings.transitionDuration); } return this; @@ -38636,21 +42325,24 @@ var Systems = new Class({ */ start: function (data) { + var events = this.events; + var settings = this.settings; + if (data) { - this.settings.data = data; + settings.data = data; } - this.settings.status = CONST.START; + settings.status = CONST.START; - this.settings.active = true; - this.settings.visible = true; + settings.active = true; + settings.visible = true; // For plugins to listen out for - this.events.emit(Events.START, this); + events.emit(Events.START, this); // For user-land code to listen out for - this.events.emit(Events.READY, this, data); + events.emit(Events.READY, this, data); }, /** @@ -38668,17 +42360,20 @@ var Systems = new Class({ */ shutdown: function (data) { - this.events.off(Events.TRANSITION_INIT); - this.events.off(Events.TRANSITION_START); - this.events.off(Events.TRANSITION_COMPLETE); - this.events.off(Events.TRANSITION_OUT); + var events = this.events; + var settings = this.settings; - this.settings.status = CONST.SHUTDOWN; + events.off(Events.TRANSITION_INIT); + events.off(Events.TRANSITION_START); + events.off(Events.TRANSITION_COMPLETE); + events.off(Events.TRANSITION_OUT); - this.settings.active = false; - this.settings.visible = false; + settings.status = CONST.SHUTDOWN; - this.events.emit(Events.SHUTDOWN, this, data); + settings.active = false; + settings.visible = false; + + events.emit(Events.SHUTDOWN, this, data); }, /** @@ -38693,14 +42388,17 @@ var Systems = new Class({ */ destroy: function () { - this.settings.status = CONST.DESTROYED; + var events = this.events; + var settings = this.settings; - this.settings.active = false; - this.settings.visible = false; + settings.status = CONST.DESTROYED; - this.events.emit(Events.DESTROY, this); + settings.active = false; + settings.visible = false; - this.events.removeAllListeners(); + events.emit(Events.DESTROY, this); + + events.removeAllListeners(); var props = [ 'scene', 'game', 'anims', 'cache', 'plugins', 'registry', 'sound', 'textures', 'add', 'camera', 'displayList', 'events', 'make', 'scenePlugin', 'updateList' ]; @@ -38716,7 +42414,7 @@ module.exports = Systems; /***/ }), -/* 191 */ +/* 196 */ /***/ (function(module, exports) { /** @@ -38753,7 +42451,7 @@ module.exports = UppercaseFirst; /***/ }), -/* 192 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38763,8 +42461,8 @@ module.exports = UppercaseFirst; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(97); -var TextureSource = __webpack_require__(391); +var Frame = __webpack_require__(104); +var TextureSource = __webpack_require__(401); var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; @@ -38774,7 +42472,7 @@ var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; * The Frames represent the different areas of the Texture. For example a texture atlas * may have many Frames, one for each element within the atlas. Where-as a single image would have * just one frame, that encompasses the whole image. - * + * * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. * This frame represents the entirety of the source image. * @@ -38873,12 +42571,12 @@ var Texture = new Class({ /** * The total number of Frames in this Texture, including the `__BASE` frame. - * + * * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. * * @name Phaser.Textures.Texture#frameTotal - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -38895,14 +42593,14 @@ var Texture = new Class({ * Adds a new Frame to this Texture. * * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. - * + * * The name given must be unique within this Texture. If it already exists, this method will return `null`. * * @method Phaser.Textures.Texture#add * @since 3.0.0 * - * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. * @param {number} width - The width of this Frame. @@ -38937,7 +42635,7 @@ var Texture = new Class({ /** * Removes the given Frame from this Texture. The Frame is destroyed immediately. - * + * * Any Game Objects using this Frame should stop using it _before_ you remove it, * as it does not happen automatically. * @@ -38989,7 +42687,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#get * @since 3.0.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {Phaser.Textures.Frame} The Texture Frame. */ @@ -39024,7 +42722,7 @@ var Texture = new Class({ * * @param {Phaser.Textures.TextureSource} source - The TextureSource to check. * - * @return {integer} The index of the TextureSource within this Texture, or -1 if not in this Texture. + * @return {number} The index of the TextureSource within this Texture, or -1 if not in this Texture. */ getTextureSourceIndex: function (source) { @@ -39045,7 +42743,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getFramesFromTextureSource * @since 3.0.0 * - * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from. + * @param {number} sourceIndex - The index of the TextureSource to get the Frames from. * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? * * @return {Phaser.Textures.Frame[]} An array of Texture Frames. @@ -39114,7 +42812,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getSourceImage * @since 3.0.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} The DOM Image, Canvas Element or Render Texture. */ @@ -39148,7 +42846,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getDataSourceImage * @since 3.7.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element. */ @@ -39193,7 +42891,7 @@ var Texture = new Class({ { data = [ data ]; } - + for (var i = 0; i < data.length; i++) { var source = this.source[i]; @@ -39273,7 +42971,7 @@ module.exports = Texture; /***/ }), -/* 193 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39282,7 +42980,7 @@ module.exports = Texture; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Returns all elements in the array. @@ -39301,8 +42999,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} All matching elements from the array. */ @@ -39335,7 +43033,7 @@ module.exports = GetAll; /***/ }), -/* 194 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39350,46 +43048,46 @@ module.exports = GetAll; module.exports = { - Matrix: __webpack_require__(942), + Matrix: __webpack_require__(998), - Add: __webpack_require__(949), - AddAt: __webpack_require__(950), - BringToTop: __webpack_require__(951), - CountAllMatching: __webpack_require__(952), - Each: __webpack_require__(953), - EachInRange: __webpack_require__(954), - FindClosestInSorted: __webpack_require__(298), - GetAll: __webpack_require__(193), - GetFirst: __webpack_require__(395), - GetRandom: __webpack_require__(196), - MoveDown: __webpack_require__(955), - MoveTo: __webpack_require__(956), - MoveUp: __webpack_require__(957), - NumberArray: __webpack_require__(302), - NumberArrayStep: __webpack_require__(958), - QuickSelect: __webpack_require__(403), - Range: __webpack_require__(404), - Remove: __webpack_require__(96), - RemoveAt: __webpack_require__(959), - RemoveBetween: __webpack_require__(960), - RemoveRandomElement: __webpack_require__(961), - Replace: __webpack_require__(962), - RotateLeft: __webpack_require__(295), - RotateRight: __webpack_require__(296), - SafeRange: __webpack_require__(70), - SendToBack: __webpack_require__(963), - SetAll: __webpack_require__(964), - Shuffle: __webpack_require__(121), - SortByDigits: __webpack_require__(300), - SpliceOne: __webpack_require__(82), - StableSort: __webpack_require__(139), - Swap: __webpack_require__(965) + Add: __webpack_require__(1006), + AddAt: __webpack_require__(1007), + BringToTop: __webpack_require__(1008), + CountAllMatching: __webpack_require__(1009), + Each: __webpack_require__(1010), + EachInRange: __webpack_require__(1011), + FindClosestInSorted: __webpack_require__(310), + GetAll: __webpack_require__(198), + GetFirst: __webpack_require__(405), + GetRandom: __webpack_require__(201), + MoveDown: __webpack_require__(1012), + MoveTo: __webpack_require__(1013), + MoveUp: __webpack_require__(1014), + NumberArray: __webpack_require__(314), + NumberArrayStep: __webpack_require__(1015), + QuickSelect: __webpack_require__(413), + Range: __webpack_require__(414), + Remove: __webpack_require__(87), + RemoveAt: __webpack_require__(1016), + RemoveBetween: __webpack_require__(1017), + RemoveRandomElement: __webpack_require__(1018), + Replace: __webpack_require__(1019), + RotateLeft: __webpack_require__(170), + RotateRight: __webpack_require__(171), + SafeRange: __webpack_require__(77), + SendToBack: __webpack_require__(1020), + SetAll: __webpack_require__(1021), + Shuffle: __webpack_require__(127), + SortByDigits: __webpack_require__(312), + SpliceOne: __webpack_require__(103), + StableSort: __webpack_require__(90), + Swap: __webpack_require__(1022) }; /***/ }), -/* 195 */ +/* 200 */ /***/ (function(module, exports) { /** @@ -39401,22 +43099,23 @@ module.exports = { /** * Checks if an array can be used as a matrix. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: * * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] * ``` * * @function Phaser.Utils.Array.Matrix.CheckMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [matrix] * @@ -39450,7 +43149,7 @@ module.exports = CheckMatrix; /***/ }), -/* 196 */ +/* 201 */ /***/ (function(module, exports) { /** @@ -39466,8 +43165,8 @@ module.exports = CheckMatrix; * @since 3.0.0 * * @param {array} array - The array to select the random entry from. - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {*} A random element from the array, or `null` if no element could be found in the range given. */ @@ -39485,7 +43184,7 @@ module.exports = GetRandom; /***/ }), -/* 197 */ +/* 202 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39495,8 +43194,8 @@ module.exports = GetRandom; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(405); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(415); /** * @classdesc @@ -39572,7 +43271,7 @@ var ProcessQueue = new Class({ * The total number of items awaiting processing. * * @name Phaser.Structs.ProcessQueue#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -39754,7 +43453,7 @@ var ProcessQueue = new Class({ * The number of entries in the active list. * * @name Phaser.Structs.ProcessQueue#length - * @type {integer} + * @type {number} * @readonly * @since 3.20.0 */ @@ -39788,7 +43487,7 @@ module.exports = ProcessQueue; /***/ }), -/* 198 */ +/* 203 */ /***/ (function(module, exports) { /** @@ -39807,7 +43506,7 @@ module.exports = ProcessQueue; * @param {Node} node - The XML Node. * @param {string} attribute - The attribute to read. * - * @return {integer} The parsed value. + * @return {number} The parsed value. */ function getValue (node, attribute) { @@ -39823,8 +43522,8 @@ function getValue (node, attribute) * * @param {XMLDocument} xml - The XML Document to parse the font from. * @param {Phaser.Textures.Frame} frame - The texture frame to take into account when creating the uv data. - * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing=0] - The y-axis spacing to add to the line height. * @param {Phaser.Textures.Texture} [texture] - If provided, each glyph in the Bitmap Font will be added to this texture as a frame. * * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. @@ -39949,7 +43648,7 @@ module.exports = ParseXMLBitmapFont; /***/ }), -/* 199 */ +/* 204 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39958,19 +43657,19 @@ module.exports = ParseXMLBitmapFont; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlitterRender = __webpack_require__(975); -var Bob = __webpack_require__(407); +var BlitterRender = __webpack_require__(1032); +var Bob = __webpack_require__(417); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Frame = __webpack_require__(97); +var Frame = __webpack_require__(104); var GameObject = __webpack_require__(14); -var List = __webpack_require__(137); +var List = __webpack_require__(105); /** * @callback CreateCallback * * @param {Phaser.GameObjects.Bob} bob - The Bob that was created by the Blitter. - * @param {integer} index - The position of the Bob within the Blitter display list. + * @param {number} index - The position of the Bob within the Blitter display list. */ /** @@ -40010,7 +43709,7 @@ var List = __webpack_require__(137); * @param {number} [x=0] - The x coordinate of this Game Object in world space. * @param {number} [y=0] - The y coordinate of this Game Object in world space. * @param {string} [texture='__DEFAULT'] - The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. - * @param {(string|integer)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. + * @param {(string|number)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. */ var Blitter = new Class({ @@ -40084,9 +43783,9 @@ var Blitter = new Class({ * * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. * @param {boolean} [visible=true] - Should the created Bob render or not? - * @param {integer} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. + * @param {number} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. * * @return {Phaser.GameObjects.Bob} The newly created Bob object. */ @@ -40120,8 +43819,8 @@ var Blitter = new Class({ * @since 3.0.0 * * @param {CreateCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob. - * @param {integer} quantity - The quantity of Bob objects to create. - * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {number} quantity - The quantity of Bob objects to create. + * @param {(string|number|Phaser.Textures.Frame|string[]|number[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. * @param {boolean} [visible=true] - Should the created Bob render or not? * * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. @@ -40151,8 +43850,8 @@ var Blitter = new Class({ * @method Phaser.GameObjects.Blitter#createMultiple * @since 3.0.0 * - * @param {integer} quantity - The quantity of Bob objects to create. - * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {number} quantity - The quantity of Bob objects to create. + * @param {(string|number|Phaser.Textures.Frame|string[]|number[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. * @param {boolean} [visible=true] - Should the created Bob render or not? * * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. @@ -40248,7 +43947,7 @@ module.exports = Blitter; /***/ }), -/* 200 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40258,16 +43957,15 @@ module.exports = Blitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(194); -var BlendModes = __webpack_require__(54); +var ArrayUtils = __webpack_require__(199); +var BlendModes = __webpack_require__(48); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Events = __webpack_require__(29); +var Events = __webpack_require__(32); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); var Rectangle = __webpack_require__(9); -var Render = __webpack_require__(978); -var Union = __webpack_require__(408); +var Render = __webpack_require__(1035); +var Union = __webpack_require__(418); var Vector2 = __webpack_require__(3); /** @@ -40298,6 +43996,9 @@ var Vector2 = __webpack_require__(3); * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. * + * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, + * or the input area will become misaligned. + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children @@ -40321,6 +44022,7 @@ var Vector2 = __webpack_require__(3); * @extends Phaser.GameObjects.Components.ComputedSize * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @@ -40339,6 +44041,7 @@ var Container = new Class({ Components.ComputedSize, Components.Depth, Components.Mask, + Components.Pipeline, Components.Transform, Components.Visible, Render @@ -40385,7 +44088,7 @@ var Container = new Class({ * the maximum limit the Container can grow in size to. * * @name Phaser.GameObjects.Container#maxSize - * @type {integer} + * @type {number} * @default -1 * @since 3.4.0 */ @@ -40395,7 +44098,7 @@ var Container = new Class({ * The cursor position. * * @name Phaser.GameObjects.Container#position - * @type {integer} + * @type {number} * @since 3.4.0 */ this.position = 0; @@ -40472,7 +44175,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorX * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorX = 1; @@ -40499,10 +44202,12 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorY * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorY = 1; + this.initPipeline(); + this.setPosition(x, y); this.clearAlpha(); @@ -40710,7 +44415,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene); } }, @@ -40735,7 +44440,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene); } }, @@ -40821,7 +44526,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container. - * @param {integer} [index=0] - The position to insert the Game Object/s at. + * @param {number} [index=0] - The position to insert the Game Object/s at. * * @return {this} This Container instance. */ @@ -40838,7 +44543,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getAt * @since 3.4.0 * - * @param {integer} index - The position to get the Game Object from. + * @param {number} index - The position to get the Game Object from. * * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found. */ @@ -40855,7 +44560,7 @@ var Container = new Class({ * * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container. * - * @return {integer} The index of the Game Object in this Container, or -1 if not found. + * @return {number} The index of the Game Object in this Container, or -1 if not found. */ getIndex: function (child) { @@ -40916,8 +44621,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getRandom * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty. */ @@ -40941,8 +44646,8 @@ var Container = new Class({ * * @param {string} property - The property to test on each Game Object in the Container. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found. */ @@ -40971,8 +44676,8 @@ var Container = new Class({ * * @param {string} [property] - The property to test on each Game Object in the Container. * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container. */ @@ -40994,10 +44699,10 @@ var Container = new Class({ * * @param {string} property - The property to check. * @param {any} value - The value to check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * - * @return {integer} The total number of Game Objects in this Container with a property matching the given value. + * @return {number} The total number of Game Objects in this Container with a property matching the given value. */ count: function (property, value, startIndex, endIndex) { @@ -41035,7 +44740,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject} child - The Game Object to move. - * @param {integer} index - The new position of the Game Object in this Container. + * @param {number} index - The new position of the Game Object in this Container. * * @return {this} This Container instance. */ @@ -41089,7 +44794,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeAt * @since 3.4.0 * - * @param {integer} index - The index of the Game Object to be removed. + * @param {number} index - The index of the Game Object to be removed. * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container. * * @return {this} This Container instance. @@ -41114,8 +44819,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeBetween * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container. * * @return {this} This Container instance. @@ -41322,8 +45027,8 @@ var Container = new Class({ * * @param {string} property - The property that must exist on the Game Object. * @param {any} value - The value to get the property to. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {this} This Container instance. */ @@ -41435,7 +45140,7 @@ var Container = new Class({ * them from physics bodies if not accounted for in your code. * * @method Phaser.GameObjects.Container#setScrollFactor - * @since 3.0.0 + * @since 3.4.0 * * @param {number} x - The horizontal scroll factor of this Game Object. * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. @@ -41464,7 +45169,7 @@ var Container = new Class({ * The number of Game Objects inside this Container. * * @name Phaser.GameObjects.Container#length - * @type {integer} + * @type {number} * @readonly * @since 3.4.0 */ @@ -41613,7 +45318,7 @@ module.exports = Container; /***/ }), -/* 201 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41622,9 +45327,9 @@ module.exports = Container; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(140); +var BitmapText = __webpack_require__(144); var Class = __webpack_require__(0); -var Render = __webpack_require__(983); +var Render = __webpack_require__(1040); /** * @classdesc @@ -41666,7 +45371,7 @@ var Render = __webpack_require__(983); * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size of this Bitmap Text. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. */ var DynamicBitmapText = new Class({ @@ -41846,7 +45551,7 @@ module.exports = DynamicBitmapText; /***/ }), -/* 202 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41855,26 +45560,24 @@ module.exports = DynamicBitmapText; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(93); +var BaseCamera = __webpack_require__(99); var Class = __webpack_require__(0); -var Commands = __webpack_require__(203); -var ComponentsAlpha = __webpack_require__(280); -var ComponentsBlendMode = __webpack_require__(281); -var ComponentsDepth = __webpack_require__(282); -var ComponentsMask = __webpack_require__(286); -var ComponentsPipeline = __webpack_require__(165); -var ComponentsTransform = __webpack_require__(291); -var ComponentsVisible = __webpack_require__(292); -var ComponentsScrollFactor = __webpack_require__(289); - -var TransformMatrix = __webpack_require__(31); - -var Ellipse = __webpack_require__(98); +var Commands = __webpack_require__(208); +var ComponentsAlpha = __webpack_require__(295); +var ComponentsBlendMode = __webpack_require__(296); +var ComponentsDepth = __webpack_require__(297); +var ComponentsMask = __webpack_require__(301); +var ComponentsPipeline = __webpack_require__(166); +var ComponentsScrollFactor = __webpack_require__(304); +var ComponentsTransform = __webpack_require__(305); +var ComponentsVisible = __webpack_require__(306); +var Ellipse = __webpack_require__(106); var GameObject = __webpack_require__(14); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); var MATH_CONST = __webpack_require__(13); -var Render = __webpack_require__(989); +var PIPELINES_CONST = __webpack_require__(82); +var Render = __webpack_require__(1046); /** * @classdesc @@ -41961,7 +45664,7 @@ var Graphics = new Class({ GameObject.call(this, scene, 'Graphics'); this.setPosition(x, y); - this.initPipeline(); + this.initPipeline(PIPELINES_CONST.GRAPHICS_PIPELINE); /** * The horizontal display origin of the Graphics. @@ -42053,36 +45756,6 @@ var Graphics = new Class({ */ this._lineWidth = 1.0; - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix3 = new TransformMatrix(); - this.setDefaultStyles(options); }, @@ -42186,21 +45859,28 @@ var Graphics = new Class({ * @webglOnly * @since 3.12.0 * - * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. - * @param {integer} topRight - The tint being applied to the top-right of the Game Object. - * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. - * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. - * @param {number} [alpha=1] - The fill alpha. + * @param {number} topLeft - The top left fill color. + * @param {number} topRight - The top right fill color. + * @param {number} bottomLeft - The bottom left fill color. + * @param {number} bottomRight - The bottom right fill color. Not used when filling triangles. + * @param {number} [alphaTopLeft=1] - The top left alpha value. If you give only this value, it's used for all corners. + * @param {number} [alphaTopRight=1] - The top right alpha value. + * @param {number} [alphaBottomLeft=1] - The bottom left alpha value. + * @param {number} [alphaBottomRight=1] - The bottom right alpha value. * * @return {this} This Game Object. */ - fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alpha) + fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alphaTopLeft, alphaTopRight, alphaBottomLeft, alphaBottomRight) { - if (alpha === undefined) { alpha = 1; } + if (alphaTopLeft === undefined) { alphaTopLeft = 1; } + if (alphaTopRight === undefined) { alphaTopRight = alphaTopLeft; } + if (alphaBottomLeft === undefined) { alphaBottomLeft = alphaTopLeft; } + if (alphaBottomRight === undefined) { alphaBottomRight = alphaTopLeft; } this.commandBuffer.push( Commands.GRADIENT_FILL_STYLE, - alpha, topLeft, topRight, bottomLeft, bottomRight + alphaTopLeft, alphaTopRight, alphaBottomLeft, alphaBottomRight, + topLeft, topRight, bottomLeft, bottomRight ); return this; @@ -42224,10 +45904,10 @@ var Graphics = new Class({ * @since 3.12.0 * * @param {number} lineWidth - The stroke width. - * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. - * @param {integer} topRight - The tint being applied to the top-right of the Game Object. - * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. - * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. + * @param {number} topLeft - The tint being applied to the top-left of the Game Object. + * @param {number} topRight - The tint being applied to the top-right of the Game Object. + * @param {number} bottomLeft - The tint being applied to the bottom-left of the Game Object. + * @param {number} bottomRight - The tint being applied to the bottom-right of the Game Object. * @param {number} [alpha=1] - The fill alpha. * * @return {this} This Game Object. @@ -42244,62 +45924,6 @@ var Graphics = new Class({ return this; }, - /** - * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * Once set, all shapes will use this texture. Call this method with no arguments to clear it. - * - * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason, - * it works best with seamless / tileable textures. - * - * The mode argument controls how the textures are combined with the fill colors. The default value (0) will - * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture, - * and a value of 2 will use just the texture and no fill color at all. - * - * @method Phaser.GameObjects.Graphics#setTexture - * @since 3.12.0 - * @webglOnly - * - * @param {string} [key] - The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. - * @param {number} [mode=0] - The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only. - * - * @return {this} This Game Object. - */ - setTexture: function (key, frame, mode) - { - if (mode === undefined) { mode = 0; } - - if (key === undefined) - { - this.commandBuffer.push( - Commands.CLEAR_TEXTURE - ); - } - else - { - var textureFrame = this.scene.sys.textures.getFrame(key, frame); - - if (textureFrame) - { - if (mode === 2) - { - mode = 3; - } - - this.commandBuffer.push( - Commands.SET_TEXTURE, - textureFrame, - mode - ); - } - } - - return this; - }, - /** * Start a new shape path. * @@ -42655,12 +46279,16 @@ var Graphics = new Class({ this.beginPath(); this.moveTo(x + tl, y); this.lineTo(x + width - tr, y); + this.moveTo(x + width - tr, y); this.arc(x + width - tr, y + tr, tr, -MATH_CONST.TAU, 0); this.lineTo(x + width, y + height - br); + this.moveTo(x + width, y + height - br); this.arc(x + width - br, y + height - br, br, 0, MATH_CONST.TAU); this.lineTo(x + bl, y + height); + this.moveTo(x + bl, y + height); this.arc(x + bl, y + height - bl, bl, MATH_CONST.TAU, Math.PI); this.lineTo(x, y + tl); + this.moveTo(x, y + tl); this.arc(x + tl, y + tl, tl, -Math.PI, -MATH_CONST.TAU); this.strokePath(); @@ -42894,7 +46522,7 @@ var Graphics = new Class({ * @param {(array|Phaser.Geom.Point[])} points - The points to stroke. * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. - * @param {integer} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`. + * @param {number} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`. * * @return {this} This Game Object. */ @@ -42941,7 +46569,7 @@ var Graphics = new Class({ * @param {(array|Phaser.Geom.Point[])} points - The points to fill. * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. - * @param {integer} [endIndex] - The index of `points` to stop at. Defaults to `points.length`. + * @param {number} [endIndex] - The index of `points` to stop at. Defaults to `points.length`. * * @return {this} This Game Object. */ @@ -42982,7 +46610,7 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to stroke. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -43005,7 +46633,7 @@ var Graphics = new Class({ * @param {number} y - The y coordinate of the center of the ellipse. * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -43027,7 +46655,7 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to fill. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -43050,7 +46678,7 @@ var Graphics = new Class({ * @param {number} y - The y coordinate of the center of the ellipse. * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -43307,8 +46935,8 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {(string|HTMLCanvasElement)} key - The key to store the texture with in the Texture Manager, or a Canvas to draw to. - * @param {integer} [width] - The width of the graphics to generate. - * @param {integer} [height] - The height of the graphics to generate. + * @param {number} [width] - The width of the graphics to generate. + * @param {number} [height] - The height of the graphics to generate. * * @return {this} This Game Object. */ @@ -43361,8 +46989,8 @@ var Graphics = new Class({ if (ctx) { - // var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) - this.renderCanvas(renderer, this, 0, Graphics.TargetCamera, null, ctx, false); + // var GraphicsCanvasRenderer = function (renderer, src, camera, parentMatrix, renderTargetCtx, allowClip) + this.renderCanvas(renderer, this, Graphics.TargetCamera, null, ctx, false); if (texture) { @@ -43400,7 +47028,7 @@ module.exports = Graphics; /***/ }), -/* 203 */ +/* 208 */ /***/ (function(module, exports) { /** @@ -43428,8 +47056,6 @@ module.exports = { TRANSLATE: 16, SCALE: 17, ROTATE: 18, - SET_TEXTURE: 19, - CLEAR_TEXTURE: 20, GRADIENT_FILL_STYLE: 21, GRADIENT_LINE_STYLE: 22 @@ -43437,7 +47063,7 @@ module.exports = { /***/ }), -/* 204 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43479,7 +47105,763 @@ module.exports = CircumferencePoint; /***/ }), -/* 205 */ +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(48); +var Class = __webpack_require__(0); +var Components = __webpack_require__(11); +var ComponentsToJSON = __webpack_require__(168); +var DataManager = __webpack_require__(97); +var EventEmitter = __webpack_require__(10); +var GameObjectEvents = __webpack_require__(32); +var List = __webpack_require__(105); +var Render = __webpack_require__(1054); +var SceneEvents = __webpack_require__(20); +var StableSort = __webpack_require__(90); + +/** + * @classdesc + * A Layer Game Object. + * + * A Layer is a special type of Game Object that acts as a Display List. You can add any type of Game Object + * to a Layer, just as you would to a Scene. Layers can be used to visually group together 'layers' of Game + * Objects: + * + * ```javascript + * const spaceman = this.add.sprite(150, 300, 'spaceman'); + * const bunny = this.add.sprite(400, 300, 'bunny'); + * const elephant = this.add.sprite(650, 300, 'elephant'); + * + * const layer = this.add.layer(); + * + * layer.add([ spaceman, bunny, elephant ]); + * ``` + * + * The 3 sprites in the example above will now be managed by the Layer they were added to. Therefore, + * if you then set `layer.setVisible(false)` they would all vanish from the display. + * + * You can also control the depth of the Game Objects within the Layer. For example, calling the + * `setDepth` method of a child of a Layer will allow you to adjust the depth of that child _within the + * Layer itself_, rather than the whole Scene. The Layer, too, can have its depth set as well. + * + * The Layer class also offers many different methods for manipulating the list, such as the + * methods `moveUp`, `moveDown`, `sendToBack`, `bringToTop` and so on. These allow you to change the + * display list position of the Layers children, causing it to adjust the order in which they are + * rendered. Using `setDepth` on a child allows you to override this. + * + * Layers can have Post FX Pipelines set, which allows you to easily enable a post pipeline across + * a whole range of children, which, depending on the effect, can often be far more efficient that doing so + * on a per-child basis. + * + * Layers have no position or size within the Scene. This means you cannot enable a Layer for + * physics or input, or change the position, rotation or scale of a Layer. They also have no scroll + * factor, texture, tint, origin, crop or bounds. + * + * If you need those kind of features then you should use a Container instead. Containers can be added + * to Layers, but Layers cannot be added to Containers. + * + * However, you can set the Alpha, Blend Mode, Depth, Mask and Visible state of a Layer. These settings + * will impact all children being rendered by the Layer. + * + * @class Layer + * @extends Phaser.Structs.List. + * @memberof Phaser.GameObjects + * @constructor + * @since 3.50.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Layer. + */ +var Layer = new Class({ + + Extends: List, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.Visible, + EventEmitter, + Render + ], + + initialize: + + function Layer (scene, children) + { + List.call(this, scene); + EventEmitter.call(this); + + /** + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * + * @name Phaser.GameObjects.Layer#scene + * @type {Phaser.Scene} + * @since 3.50.0 + */ + this.scene = scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.Layer#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + * + * @name Phaser.GameObjects.Layer#type + * @type {string} + * @since 3.50.0 + */ + this.type = 'Layer'; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @name Phaser.GameObjects.Layer#state + * @type {(number|string)} + * @since 3.50.0 + */ + this.state = 0; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.Layer#name + * @type {string} + * @default '' + * @since 3.50.0 + */ + this.name = ''; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + * + * @name Phaser.GameObjects.Layer#active + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.active = true; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * + * @name Phaser.GameObjects.Layer#data + * @type {Phaser.Data.DataManager} + * @default null + * @since 3.50.0 + */ + this.data = null; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.Layer#renderFlags + * @type {number} + * @default 15 + * @since 3.50.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.Layer#cameraFilter + * @type {number} + * @default 0 + * @since 3.50.0 + */ + this.cameraFilter = 0; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + * + * @name Phaser.GameObjects.Layer#ignoreDestroy + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.ignoreDestroy = false; + + /** + * A reference to the Scene Systems. + * + * @name Phaser.GameObjects.Layer#systems + * @type {Phaser.Scenes.Systems} + * @since 3.50.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Event Emitter. + * + * @name Phaser.GameObjects.Layer#events + * @type {Phaser.Events.EventEmitter} + * @since 3.50.0 + */ + this.events = scene.sys.events; + + /** + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + * + * @name Phaser.GameObjects.Layer#sortChildrenFlag + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.sortChildrenFlag = false; + + // Set the List callbacks + this.addCallback = this.addChildCallback; + this.removeCallback = this.removeChildCallback; + + this.initPipeline(); + + this.clearAlpha(); + + this.setBlendMode(BlendModes.SKIP_CHECK); + + if (children) + { + this.add(children); + } + + // Tell the Scene to re-sort the children + scene.sys.queueDepthSort(); + }, + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * + * @method Phaser.GameObjects.Layer#setActive + * @since 3.50.0 + * + * @param {boolean} value - True if this Game Object should be set as active, false if not. + * + * @return {this} This GameObject. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * + * @method Phaser.GameObjects.Layer#setName + * @since 3.50.0 + * + * @param {string} value - The name to be given to this Game Object. + * + * @return {this} This GameObject. + */ + setName: function (value) + { + this.name = value; + + return this; + }, + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @method Phaser.GameObjects.Layer#setState + * @since 3.50.0 + * + * @param {(number|string)} value - The state of the Game Object. + * + * @return {this} This GameObject. + */ + setState: function (value) + { + this.state = value; + + return this; + }, + + /** + * Adds a Data Manager component to this Game Object. + * + * @method Phaser.GameObjects.Layer#setDataEnabled + * @since 3.50.0 + * @see Phaser.Data.DataManager + * + * @return {this} This GameObject. + */ + setDataEnabled: function () + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this; + }, + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.GameObjects.Layer#setData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This GameObject. + */ + setData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.set(key, value); + + return this; + }, + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.Layer#incData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {this} This GameObject. + */ + incData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.inc(key, value); + + return this; + }, + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.Layer#toggleData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {this} This GameObject. + */ + toggleData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.toggle(key); + + return this; + }, + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.GameObjects.Layer#getData + * @since 3.50.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + getData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this.data.get(key); + }, + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.Layer#addedToScene + * @since 3.50.0 + */ + addedToScene: function () + { + }, + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.Layer#removedFromScene + * @since 3.50.0 + */ + removedFromScene: function () + { + }, + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * + * @method Phaser.GameObjects.Layer#update + * @since 3.50.0 + * + * @param {...*} [args] - args + */ + update: function () + { + }, + + /** + * Returns a JSON representation of the Game Object. + * + * @method Phaser.GameObjects.Layer#toJSON + * @since 3.50.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return ComponentsToJSON(this); + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * + * @method Phaser.GameObjects.Layer#willRender + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. + * + * @return {boolean} True if the Game Object should be rendered, otherwise false. + */ + willRender: function (camera) + { + return !(this.renderFlags !== 15 || this.list.length === 0 || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + }, + + /** + * Internal method called from `List.addCallback`. + * + * @method Phaser.GameObjects.Layer#addChildCallback + * @private + * @fires Phaser.Scenes.Events#ADDED_TO_SCENE + * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the list. + */ + addChildCallback: function (gameObject) + { + gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + + if (gameObject.displayList) + { + gameObject.displayList.remove(gameObject); + } + + gameObject.displayList = this; + + this.queueDepthSort(); + + this.events.emit(SceneEvents.ADDED_TO_SCENE, gameObject, this.scene); + }, + + /** + * Internal method called from `List.removeCallback`. + * + * @method Phaser.GameObjects.Layer#removeChildCallback + * @private + * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the list. + */ + removeChildCallback: function (gameObject) + { + gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + + gameObject.displayList = null; + + this.queueDepthSort(); + + this.events.emit(SceneEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + }, + + /** + * Force a sort of the display list on the next call to depthSort. + * + * @method Phaser.GameObjects.Layer#queueDepthSort + * @since 3.50.0 + */ + queueDepthSort: function () + { + this.sortChildrenFlag = true; + }, + + /** + * Immediately sorts the display list if the flag is set. + * + * @method Phaser.GameObjects.Layer#depthSort + * @since 3.50.0 + */ + depthSort: function () + { + if (this.sortChildrenFlag) + { + StableSort(this.list, this.sortByDepth); + + this.sortChildrenFlag = false; + } + }, + + /** + * Compare the depth of two Game Objects. + * + * @method Phaser.GameObjects.Layer#sortByDepth + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} childA - The first Game Object. + * @param {Phaser.GameObjects.GameObject} childB - The second Game Object. + * + * @return {number} The difference between the depths of each Game Object. + */ + sortByDepth: function (childA, childB) + { + return childA._depth - childB._depth; + }, + + /** + * Returns an array which contains all Game Objects within this Layer. + * + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + * + * @method Phaser.GameObjects.Layer#getChildren + * @since 3.50.0 + * + * @return {Phaser.GameObjects.GameObject[]} The group members. + */ + getChildren: function () + { + return this.list; + }, + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * + * @method Phaser.GameObjects.Layer#destroy + * @fires Phaser.GameObjects.Events#DESTROY + * @since 3.50.0 + * + * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + this.removeAll(); + this.removeAllListeners(); + this.resetPostPipeline(true); + + this.emit(GameObjectEvents.DESTROY, this); + + if (!fromScene && this.displayList) + { + this.displayList.remove(this); + this.displayList.queueDepthSort(); + } + + if (this.data) + { + this.data.destroy(); + + this.data = undefined; + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + this.displayList = undefined; + this.systems = undefined; + this.events = undefined; + } + +}); + +module.exports = Layer; + + +/***/ }), +/* 211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43491,11 +47873,11 @@ module.exports = CircumferencePoint; var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var GravityWell = __webpack_require__(417); -var List = __webpack_require__(137); -var ParticleEmitter = __webpack_require__(419); -var Render = __webpack_require__(998); +var GameObjectEvents = __webpack_require__(32); +var GravityWell = __webpack_require__(427); +var List = __webpack_require__(105); +var ParticleEmitter = __webpack_require__(429); +var Render = __webpack_require__(1058); /** * @classdesc @@ -43515,7 +47897,7 @@ var Render = __webpack_require__(998); * * @param {Phaser.Scene} scene - The Scene to which this Emitter Manager belongs. * @param {string} texture - The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. + * @param {(string|number)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. */ var ParticleEmitterManager = new Class({ @@ -43542,7 +47924,7 @@ var ParticleEmitterManager = new Class({ * The blend mode applied to all emitters and particles. * * @name Phaser.GameObjects.Particles.ParticleEmitterManager#blendMode - * @type {integer} + * @type {number} * @default -1 * @private * @since 3.0.0 @@ -43658,7 +48040,7 @@ var ParticleEmitterManager = new Class({ * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Emitter Manager. */ @@ -43679,7 +48061,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setFrame * @since 3.0.0 * - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Emitter Manager. */ @@ -43828,7 +48210,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticle * @since 3.0.0 * - * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param {number} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. * @@ -43859,7 +48241,7 @@ var ParticleEmitterManager = new Class({ * * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. - * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param {number} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. * * @return {this} This Emitter Manager. */ @@ -43921,7 +48303,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#preUpdate * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) @@ -43984,7 +48366,7 @@ module.exports = ParticleEmitterManager; /***/ }), -/* 206 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43993,19 +48375,20 @@ module.exports = ParticleEmitterManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); -var Camera = __webpack_require__(93); -var CanvasPool = __webpack_require__(26); +var BlendModes = __webpack_require__(48); +var Camera = __webpack_require__(99); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var CONST = __webpack_require__(34); -var Frame = __webpack_require__(97); +var CONST = __webpack_require__(39); +var Frame = __webpack_require__(104); var GameObject = __webpack_require__(14); var NOOP = __webpack_require__(1); -var ProjectOrtho = __webpack_require__(185); -var Render = __webpack_require__(1002); -var Utils = __webpack_require__(10); -var UUID = __webpack_require__(207); +var PIPELINE_CONST = __webpack_require__(82); +var Render = __webpack_require__(1062); +var RenderTarget = __webpack_require__(263); +var Utils = __webpack_require__(12); +var UUID = __webpack_require__(213); /** * @classdesc @@ -44044,8 +48427,8 @@ var UUID = __webpack_require__(207); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. - * @param {integer} [width=32] - The width of the Render Texture. - * @param {integer} [height=32] - The height of the Render Texture. + * @param {number} [width=32] - The width of the Render Texture. + * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. */ @@ -44089,7 +48472,7 @@ var RenderTexture = new Class({ * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.2.0 */ - this.renderer = scene.sys.game.renderer; + this.renderer = scene.sys.renderer; /** * A reference to the Texture Manager. @@ -44129,16 +48512,6 @@ var RenderTexture = new Class({ */ this.canvas = null; - /** - * A reference to the GL Frame Buffer this Render Texture is drawing to. - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.GameObjects.RenderTexture#framebuffer - * @type {?WebGLFramebuffer} - * @since 3.2.0 - */ - this.framebuffer = null; - /** * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself. * @@ -44243,25 +48616,17 @@ var RenderTexture = new Class({ this.camera = new Camera(0, 0, width, height); /** - * A reference to the WebGL Rendering Context. + * The Render Target that belongs to this Render Texture. * - * @name Phaser.GameObjects.RenderTexture#gl - * @type {WebGLRenderingContext} - * @default null - * @since 3.0.0 - */ - this.gl = null; - - /** - * A reference to the WebGLTexture that is being rendered to in a WebGL Context. + * A Render Target encapsulates a framebuffer and texture for the WebGL Renderer. * - * @name Phaser.GameObjects.RenderTexture#glTexture - * @type {WebGLTexture} - * @default null - * @readonly - * @since 3.19.0 + * This property remains `null` under Canvas. + * + * @name Phaser.GameObjects.RenderTexture#renderTarget + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 */ - this.glTexture = null; + this.renderTarget = null; var renderer = this.renderer; @@ -44271,12 +48636,9 @@ var RenderTexture = new Class({ } else if (renderer.type === CONST.WEBGL) { - var gl = renderer.gl; - - this.gl = gl; - this.glTexture = this.frame.source.glTexture; this.drawGameObject = this.batchGameObjectWebGL; - this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); + + this.renderTarget = new RenderTarget(renderer, width, height, 1, 0, false); } else if (renderer.type === CONST.CANVAS) { @@ -44293,7 +48655,8 @@ var RenderTexture = new Class({ } this.setOrigin(0, 0); - this.initPipeline(); + + this.initPipeline(PIPELINE_CONST.SINGLE_PIPELINE); }, /** @@ -44319,8 +48682,10 @@ var RenderTexture = new Class({ * texture will not change. * * If Render Texture was not created from specific frame, the following will happen: + * * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. * In Canvas it will resize the underlying canvas element. + * * Both approaches will erase everything currently drawn to the Render Texture. * * If the dimensions given are the same as those already being used, calling this method will do nothing. @@ -44338,7 +48703,6 @@ var RenderTexture = new Class({ if (height === undefined) { height = width; } var frame = this.frame; - var renderer = this.renderer; if (width !== this.width || height !== this.height) { @@ -44352,30 +48716,48 @@ var RenderTexture = new Class({ this.texture.width = width; this.texture.height = height; - if (this.gl) + var renderTarget = this.renderTarget; + + if (renderTarget) { - var gl = this.gl; + renderTarget.resize(width, height); - renderer.deleteTexture(frame.source.glTexture); - renderer.deleteFramebuffer(this.framebuffer); - - var glTexture = renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - - this.framebuffer = renderer.createFramebuffer(width, height, glTexture, false); + frame.glTexture = renderTarget.texture; frame.source.isRenderTexture = true; - - frame.source.glTexture = glTexture; - - frame.glTexture = glTexture; - - this.glTexture = glTexture; + frame.source.isGLTexture = true; + frame.source.glTexture = renderTarget.texture; } + var camera = this.camera; + frame.source.width = width; frame.source.height = height; - this.camera.setSize(width, height); + var renderer = this.renderer; + var rendererWidth = renderer.width; + var rendererHeight = renderer.height; + + var zoomX = rendererWidth / width; + var zoomY = rendererHeight / height; + + camera.setSize(width, height); + camera.setZoom(zoomX, zoomY); + + var ox = 0.5; + var oy = 0.5; + + if (width !== rendererWidth) + { + ox = 0; + } + + if (height !== rendererHeight) + { + oy = 0; + } + + camera.setOrigin(ox, oy); frame.setSize(width, height); @@ -44421,7 +48803,7 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#setGlobalTint * @since 3.2.0 * - * @param {integer} tint - The tint value. + * @param {number} tint - The tint value. * * @return {this} This Render Texture. */ @@ -44506,9 +48888,7 @@ var RenderTexture = new Class({ */ fill: function (rgb, alpha, x, y, width, height) { - var gl = this.gl; var frame = this.frame; - var texture = this.texture; var camera = this.camera; var renderer = this.renderer; @@ -44518,47 +48898,38 @@ var RenderTexture = new Class({ if (width === undefined) { width = frame.cutWidth; } if (height === undefined) { height = frame.cutHeight; } - var r = ((rgb >> 16) | 0) & 0xff; - var g = ((rgb >> 8) | 0) & 0xff; - var b = (rgb | 0) & 0xff; + var r = (rgb >> 16 & 0xFF) / 255; + var g = (rgb >> 8 & 0xFF) / 255; + var b = (rgb & 0xFF) / 255; - camera.preRender(1, 1); + var renderTarget = this.renderTarget; - if (gl) + camera.preRender(); + + if (renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; - - renderer.resetTextures(true); - - renderer.pushScissor(cx, cy, cw, -ch); - - renderer.setFramebuffer(this.framebuffer, false); + renderTarget.bind(true); var pipeline = this.pipeline; - var tw = texture.width; - var th = texture.height; + pipeline.manager.set(pipeline); - var rw = pipeline.width; - var rh = pipeline.height; + var tw = renderTarget.width; + var th = renderTarget.height; + + var rw = renderer.width; + var rh = renderer.height; var sx = rw / tw; var sy = rh / th; pipeline.drawFillRect( - x * sx, (th - height - y) * sy, width * sx, height * sy, - Utils.getTintFromFloats(r / 255, g / 255, b / 255, 1), + x * sx, y * sy, width * sx, height * sy, + Utils.getTintFromFloats(b, g, r, 1), alpha ); - pipeline.flush(); - - renderer.setFramebuffer(null, false); - - renderer.popScissor(); + renderTarget.unbind(true); } else { @@ -44589,23 +48960,11 @@ var RenderTexture = new Class({ { if (this.dirty) { - var gl = this.gl; + var renderTarget = this.renderTarget; - if (gl) + if (renderTarget) { - var renderer = this.renderer; - - renderer.setFramebuffer(this.framebuffer, true); - - if (this.frame.cutWidth !== this.canvas.width || this.frame.cutHeight !== this.canvas.height) - { - gl.scissor(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight); - } - - gl.clearColor(0, 0, 0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - renderer.setFramebuffer(null, true); + renderTarget.clear(); } else { @@ -44757,37 +49116,21 @@ var RenderTexture = new Class({ entries = [ entries ]; } - var gl = this.gl; var camera = this.camera; var renderer = this.renderer; + var renderTarget = this.renderTarget; - camera.preRender(1, 1); + camera.preRender(); - if (gl) + if (renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + renderTarget.bind(true); renderer.resetTextures(true); - renderer.setFramebuffer(this.framebuffer, false); - - renderer.pushScissor(cx, cy, cw, ch, ch); - - var pipeline = this.pipeline; - - ProjectOrtho(pipeline, 0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); - this.batchList(entries, x, y, alpha, tint); - // Causes a flush + popScissor - renderer.setFramebuffer(null, true); - - renderer.resetTextures(true); - - ProjectOrtho(pipeline, 0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); + renderTarget.unbind(true); } else { @@ -44825,7 +49168,7 @@ var RenderTexture = new Class({ * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * @param {number} [x=0] - The x position to draw the frame at. * @param {number} [y=0] - The y position to draw the frame at. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -44848,41 +49191,21 @@ var RenderTexture = new Class({ tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16); } - var gl = this.gl; var camera = this.camera; - var renderer = this.renderer; + var renderTarget = this.renderTarget; var textureFrame = this.textureManager.getFrame(key, frame); if (textureFrame) { - camera.preRender(1, 1); + camera.preRender(); - if (gl) + if (renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + renderTarget.bind(true); - renderer.resetTextures(true); + this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, camera.matrix, null); - renderer.setFramebuffer(this.framebuffer, false); - - renderer.pushScissor(cx, cy, cw, ch, ch); - - var pipeline = this.pipeline; - - ProjectOrtho(pipeline, 0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); - - pipeline.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, tint, alpha, camera.matrix, null); - - pipeline.flush(); - - renderer.setFramebuffer(null, false); - - renderer.popScissor(); - - ProjectOrtho(pipeline, 0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); + renderTarget.unbind(true); } else { @@ -44948,7 +49271,7 @@ var RenderTexture = new Class({ }, /** - * Internal method that handles the drawing a Phaser Group contents. + * Internal method that handles drawing a Phaser Group contents. * * @method Phaser.GameObjects.RenderTexture#batchGroup * @private @@ -44970,7 +49293,7 @@ var RenderTexture = new Class({ { var entry = children[i]; - if (entry.willRender()) + if (entry.willRender(this.camera)) { var tx = entry.x + x; var ty = entry.y + y; @@ -45006,7 +49329,7 @@ var RenderTexture = new Class({ gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY); - gameObject.renderWebGL(this.renderer, gameObject, 0, this.camera, null); + gameObject.renderWebGL(this.renderer, gameObject, this.camera); gameObject.setPosition(prevX, prevY); }, @@ -45039,7 +49362,7 @@ var RenderTexture = new Class({ gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY); - gameObject.renderCanvas(this.renderer, gameObject, 0, this.camera, null); + gameObject.renderCanvas(this.renderer, gameObject, this.camera, null); gameObject.setPosition(prevX, prevY); @@ -45057,7 +49380,7 @@ var RenderTexture = new Class({ * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * @param {number} [x=0] - The x position to offset the Game Object by. * @param {number} [y=0] - The y position to offset the Game Object by. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -45093,7 +49416,9 @@ var RenderTexture = new Class({ x += this.frame.cutX; y += this.frame.cutY; - if (this.gl) + var renderTarget = this.renderTarget; + + if (renderTarget) { this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null); } @@ -45128,10 +49453,10 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#snapshotArea * @since 3.19.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -45140,9 +49465,9 @@ var RenderTexture = new Class({ */ snapshotArea: function (x, y, width, height, callback, type, encoderOptions) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); } else { @@ -45175,9 +49500,9 @@ var RenderTexture = new Class({ */ snapshot: function (callback, type, encoderOptions) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); } else { @@ -45201,17 +49526,17 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#snapshotPixel * @since 3.19.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This Render Texture instance. */ snapshotPixel: function (x, y, callback) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, true, x, y); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, true, x, y); } else { @@ -45234,9 +49559,9 @@ var RenderTexture = new Class({ { CanvasPool.remove(this.canvas); - if (this.gl) + if (this.renderTarget) { - this.renderer.deleteFramebuffer(this.framebuffer); + this.renderTarget.destroy(); } this.texture.destroy(); @@ -45244,9 +49569,7 @@ var RenderTexture = new Class({ this.canvas = null; this.context = null; - this.framebuffer = null; this.texture = null; - this.glTexture = null; } } @@ -45256,7 +49579,7 @@ module.exports = RenderTexture; /***/ }), -/* 207 */ +/* 213 */ /***/ (function(module, exports) { /** @@ -45291,7 +49614,7 @@ module.exports = UUID; /***/ }), -/* 208 */ +/* 214 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45304,9 +49627,9 @@ var AnimationState = __webpack_require__(157); var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var PIPELINE_CONST = __webpack_require__(110); -var RopeRender = __webpack_require__(1008); +var GameObjectEvents = __webpack_require__(32); +var PIPELINE_CONST = __webpack_require__(82); +var RopeRender = __webpack_require__(1068); var Vector2 = __webpack_require__(3); /** @@ -45345,8 +49668,8 @@ var Vector2 = __webpack_require__(3); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {string} [texture] - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. If not given, `__DEFAULT` is used. - * @param {(string|integer|null)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. See `setPoints` to set this post-creation. + * @param {(string|number|null)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. See `setPoints` to set this post-creation. * @param {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? * @param {number[]} [colors] - An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. * @param {number[]} [alphas] - An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. @@ -45384,7 +49707,7 @@ var Rope = new Class({ * The Animation State of this Rope. * * @name Phaser.GameObjects.Rope#anims - * @type {Phaser.Animation.AnimationState} + * @type {Phaser.Animations.AnimationState} * @since 3.23.0 */ this.anims = new AnimationState(this); @@ -45463,15 +49786,14 @@ var Rope = new Class({ /** * The tint fill mode. * - * 0 = An additive tint (the default), where vertices colors are blended with the texture. - * 1 = A fill tint, where the vertices colors replace the texture, but respects texture alpha. - * 2 = A complete tint, where the vertices colors replace the texture, including alpha, entirely. + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Rope#tintFill - * @type {integer} + * @type {boolean} * @since 3.23.0 */ - this.tintFill = (texture === '__DEFAULT') ? 2 : 0; + this.tintFill = (texture === '__DEFAULT') ? true : false; /** * If the Rope is marked as `dirty` it will automatically recalculate its vertices @@ -45630,7 +49952,7 @@ var Rope = new Class({ * * @param {string} key - The string-based key of the animation to play. * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * @param {number} [startFrame=0] - Optionally start the animation playing from this frame index. * * @return {this} This Game Object. */ @@ -45667,7 +49989,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setHorizontal * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -45696,7 +50018,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setVertical * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -45719,28 +50041,26 @@ var Rope = new Class({ /** * Sets the tint fill mode. * - * Mode 0 is an additive tint, the default, which blends the vertices colors with the texture. + * Mode 0 (`false`) is an additive tint, the default, which blends the vertices colors with the texture. * This mode respects the texture alpha. * - * Mode 1 is a fill tint. Unlike an additive tint, a fill-tint literally replaces the pixel colors + * Mode 1 (`true`) is a fill tint. Unlike an additive tint, a fill-tint literally replaces the pixel colors * from the texture with those in the tint. You can use this for effects such as making a player flash 'white' * if hit by something. This mode respects the texture alpha. * - * Mode 2 is a complete tint. The texture colors and alpha are replaced entirely by the vertices colors. - * * See the `setColors` method for details of how to color each of the vertices. * * @method Phaser.GameObjects.Rope#setTintFill * @webglOnly * @since 3.23.0 * - * @param {integer} [value=0] - Set to 0 for an Additive tint, 1 for a fill tint with alpha, or 2 for a fill tint without alpha. + * @param {boolean} [value=false] - Set to `false` for an Additive tint or `true` fill tint with alpha. * * @return {this} This Game Object instance. */ setTintFill: function (value) { - if (value === undefined) { value = 0; } + if (value === undefined) { value = false; } this.tintFill = value; @@ -45966,7 +50286,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setPoints * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -46146,7 +50466,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#resizeArrays * @since 3.23.0 * - * @param {integer} newSize - The amount of segments to split the Rope in to. + * @param {number} newSize - The amount of segments to split the Rope in to. * * @return {this} This Game Object instance. */ @@ -46247,9 +50567,10 @@ var Rope = new Class({ /** * This method enables rendering of the Rope vertices to the given Graphics instance. * - * If you enable this feature, you must call `Graphics.clear()` in your Scene `update`, - * otherwise the Graphics instance will fill-in with draw calls. This is not done automatically - * to allow for you to debug render multiple Rope objects to a single Graphics instance. + * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, + * otherwise the Graphics instance you provide to debug will fill-up with draw calls, + * eventually crashing the browser. This is not done automatically to allow you to debug + * draw multiple Rope objects to a single Graphics instance. * * The Rope class has a built-in debug rendering callback `Rope.renderDebugVerts`, however * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. @@ -46304,7 +50625,7 @@ var Rope = new Class({ * @since 3.23.0 * * @param {Phaser.GameObjects.Rope} src - The Rope object being rendered. - * @param {integer} meshLength - The number of vertices in the mesh. + * @param {number} meshLength - The number of vertices in the mesh. * @param {number[]} verts - An array of translated vertex coordinates. */ renderDebugVerts: function (src, meshLength, verts) @@ -46422,7 +50743,7 @@ module.exports = Rope; /***/ }), -/* 209 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46431,26 +50752,26 @@ module.exports = Rope; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(131); -var CanvasPool = __webpack_require__(26); +var AddToDOM = __webpack_require__(137); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); var GameObject = __webpack_require__(14); -var GetTextSize = __webpack_require__(425); +var GetTextSize = __webpack_require__(435); var GetValue = __webpack_require__(6); -var RemoveFromDOM = __webpack_require__(188); -var TextRender = __webpack_require__(1011); -var TextStyle = __webpack_require__(426); +var RemoveFromDOM = __webpack_require__(193); +var TextRender = __webpack_require__(1071); +var TextStyle = __webpack_require__(436); /** * @classdesc * A Text Game Object. - * + * * Text objects work by creating their own internal hidden Canvas and then renders text to it using * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered * to your game during the render pass. - * + * * Because it uses the Canvas API you can take advantage of all the features this offers, such as * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts * loaded externally, such as Google or TypeKit Web fonts. @@ -46473,7 +50794,7 @@ var TextStyle = __webpack_require__(426); * * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts * across mobile browsers. - * + * * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of @@ -46547,7 +50868,7 @@ var Text = new Class({ * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.12.0 */ - this.renderer = scene.sys.game.renderer; + this.renderer = scene.sys.renderer; this.setPosition(x, y); this.setOrigin(0, 0); @@ -46647,7 +50968,7 @@ var Text = new Class({ * The line spacing value. * This value is added to the font height to calculate the overall line height. * Only has an effect if this Text object contains multiple lines of text. - * + * * If you update this property directly, instead of using the `setLineSpacing` method, then * be sure to call `updateText` after, or you won't see the change reflected in the Text object. * @@ -46667,10 +50988,10 @@ var Text = new Class({ */ this.dirty = false; - // If resolution wasn't set, then we get it from the game config + // If resolution wasn't set, force it to 1 if (this.style.resolution === 0) { - this.style.resolution = scene.sys.game.config.resolution; + this.style.resolution = 1; } /** @@ -46947,7 +51268,12 @@ var Text = new Class({ { var word = words[j]; var wordWidth = context.measureText(word).width; - var wordWidthWithSpace = wordWidth + whiteSpaceWidth; + var wordWidthWithSpace = wordWidth; + + if (j < lastWordIndex) + { + wordWidthWithSpace += whiteSpaceWidth; + } if (wordWidthWithSpace > spaceLeft) { @@ -47107,10 +51433,10 @@ var Text = new Class({ * ```javascript * Text.setFont('"Press Start 2P"'); * ``` - * + * * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all * quoted properly, too: - * + * * ```javascript * Text.setFont('Georgia, "Goudy Bookletter 1911", Times, serif'); * ``` @@ -47378,9 +51704,9 @@ var Text = new Class({ /** * Set the alignment of the text in this Text object. - * + * * The argument can be one of: `left`, `right`, `center` or `justify`. - * + * * Alignment only works if the Text object has more than one line of text. * * @method Phaser.GameObjects.Text#setAlign @@ -47400,10 +51726,10 @@ var Text = new Class({ * * By default it will be set to match the resolution set in the Game Config, * but you can override it via this method, or by specifying it in the Text style configuration object. - * + * * It allows for much clearer text on High DPI devices, at the cost of memory because it uses larger * internal Canvas textures for the Text. - * + * * Therefore, please use with caution, as the more high res Text you have, the more memory it uses. * * @method Phaser.GameObjects.Text#setResolution @@ -47510,7 +51836,7 @@ var Text = new Class({ * @method Phaser.GameObjects.Text#setMaxLines * @since 3.0.0 * - * @param {integer} [max=0] - The maximum number of lines to draw. + * @param {number} [max=0] - The maximum number of lines to draw. * * @return {this} This Text object. */ @@ -47660,9 +51986,9 @@ var Text = new Class({ var spaceSize = context.measureText(' ').width; var trimmedLine = lines[i].trim(); var array = trimmedLine.split(' '); - + extraSpace += (lines[i].length - trimmedLine.length) * spaceSize; - + var extraSpaceCharacters = Math.floor(extraSpace / spaceSize); var idx = 0; @@ -47672,7 +51998,7 @@ var Text = new Class({ idx = (idx + 1) % (array.length - 1 || 1); --extraSpaceCharacters; } - + lines[i] = array.join(' '); } } @@ -47834,7 +52160,7 @@ module.exports = Text; /***/ }), -/* 210 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47843,14 +52169,14 @@ module.exports = Text; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); var GameObject = __webpack_require__(14); -var GetPowerOfTwo = __webpack_require__(342); -var Smoothing = __webpack_require__(177); -var TileSpriteRender = __webpack_require__(1014); +var GetPowerOfTwo = __webpack_require__(353); +var Smoothing = __webpack_require__(184); +var TileSpriteRender = __webpack_require__(1074); var Vector2 = __webpack_require__(3); // bitmask flag for GameObject.renderMask @@ -47865,10 +52191,10 @@ var _FLAG = 8; // 1000 * * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` - * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will + * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs. - * + * * An important note about Tile Sprites and NPOT textures: Internally, TileSprite textures use GL_REPEAT to provide * seamless repeating of the textures. This, combined with the way in which the textures are handled in WebGL, means * they need to be POT (power-of-two) sizes in order to wrap. If you provide a NPOT (non power-of-two) texture to a @@ -47903,10 +52229,10 @@ var _FLAG = 8; // 1000 * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. - * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {number} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {number} height - The height of the Game Object. If zero it will use the size of the texture frame. * @param {string} textureKey - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frameKey] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frameKey] - An optional frame from the Texture this Game Object is rendering with. */ var TileSprite = new Class({ @@ -47934,7 +52260,7 @@ var TileSprite = new Class({ function TileSprite (scene, x, y, width, height, textureKey, frameKey) { - var renderer = scene.sys.game.renderer; + var renderer = scene.sys.renderer; GameObject.call(this, scene, 'TileSprite'); @@ -48065,7 +52391,7 @@ var TileSprite = new Class({ * The next power of two value from the width of the Fill Pattern frame. * * @name Phaser.GameObjects.TileSprite#potWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.potWidth = GetPowerOfTwo(displayFrame.width); @@ -48074,7 +52400,7 @@ var TileSprite = new Class({ * The next power of two value from the height of the Fill Pattern frame. * * @name Phaser.GameObjects.TileSprite#potHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.potHeight = GetPowerOfTwo(displayFrame.height); @@ -48134,7 +52460,7 @@ var TileSprite = new Class({ * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -48155,7 +52481,7 @@ var TileSprite = new Class({ * @method Phaser.GameObjects.TileSprite#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -48486,7 +52812,7 @@ module.exports = TileSprite; /***/ }), -/* 211 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -48496,64 +52822,65 @@ module.exports = TileSprite; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Components = __webpack_require__(11); -var Events = __webpack_require__(29); -var GameEvents = __webpack_require__(21); +var Events = __webpack_require__(32); +var GameEvents = __webpack_require__(23); +var InputEvents = __webpack_require__(49); var GameObject = __webpack_require__(14); -var SoundEvents = __webpack_require__(61); -var UUID = __webpack_require__(207); -var VideoRender = __webpack_require__(1017); +var SoundEvents = __webpack_require__(66); +var UUID = __webpack_require__(213); +var VideoRender = __webpack_require__(1077); var MATH_CONST = __webpack_require__(13); /** * @classdesc * A Video Game Object. - * + * * This Game Object is capable of handling playback of a previously loaded video from the Phaser Video Cache, * or playing a video based on a given URL. Videos can be either local, or streamed. - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4'); * } - * + * * create () { * this.add.video(400, 300, 'pixar'); * } * ``` - * + * * To all intents and purposes, a video is a standard Game Object, just like a Sprite. And as such, you can do * all the usual things to it, such as scaling, rotating, cropping, tinting, making interactive, giving a * physics body, etc. - * + * * Transparent videos are also possible via the WebM file format. Providing the video file has was encoded with * an alpha channel, and providing the browser supports WebM playback (not all of them do), then it will render * in-game with full transparency. - * + * * ### Autoplaying Videos - * + * * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. * The policies that control autoplaying are vast and vary between browser. - * You can, ahd should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * You can, and should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', 'loadeddata', false, true); * } * ``` - * + * * The 5th parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for further details. - * + * * Note that due to a bug in IE11 you cannot play a video texture to a Sprite in WebGL. For IE11 force Canvas mode. - * + * * More details about video playback and the supported media formats can be found on MDN: - * + * * https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement * https://developer.mozilla.org/en-US/docs/Web/Media/Formats * @@ -48698,7 +53025,7 @@ var Video = new Class({ * state in this manner until the `retryLimit` is reached and then abort. * * @name Phaser.GameObjects.Video#retryLimit - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retryLimit = 20; @@ -48707,7 +53034,7 @@ var Video = new Class({ * The current retry attempt. * * @name Phaser.GameObjects.Video#retry - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retry = 0; @@ -48716,7 +53043,7 @@ var Video = new Class({ * The number of ms between each retry while monitoring the ready state of a downloading video. * * @name Phaser.GameObjects.Video#retryInterval - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retryInterval = 500; @@ -48725,7 +53052,7 @@ var Video = new Class({ * The setTimeout callback ID. * * @name Phaser.GameObjects.Video#_retryID - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -48811,7 +53138,7 @@ var Video = new Class({ * The in marker. * * @name Phaser.GameObjects.Video#_markerIn - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -48821,7 +53148,7 @@ var Video = new Class({ * The out marker. * * @name Phaser.GameObjects.Video#_markerOut - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -48831,7 +53158,7 @@ var Video = new Class({ * The last time the TextureSource was updated. * * @name Phaser.GameObjects.Video#_lastUpdate - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -48886,40 +53213,55 @@ var Video = new Class({ { sound.on(SoundEvents.GLOBAL_MUTE, this.globalMute, this); } + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); }, /** * Starts this video playing. * * If the video is already playing, or has been queued to play with `changeSource` then this method just returns. - * + * * Videos can only autoplay if the browser has been unlocked. This happens if you have interacted with the browser, i.e. * by clicking on it or pressing a key, or due to server settings. The policies that control autoplaying are vast and * vary between browser. You can read more here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is loaded, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', 'loadeddata', false, true); * } * ``` - * + * * The 5th parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for details. - * + * * If you need audio in your videos, then you'll have to consider the fact that the video cannot start playing until the * user has interacted with the browser, into your game flow. * * @method Phaser.GameObjects.Video#play * @since 3.20.0 - * + * * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. - * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. - * + * @param {number} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. + * * @return {this} This Video Game Object for method chaining. */ play: function (loop, markerIn, markerOut) @@ -48941,7 +53283,7 @@ var Video = new Class({ if (loop === undefined) { loop = video.loop; } var sound = this.scene.sys.sound; - + if (sound && sound.mute) { // Mute will be set based on the global mute state of the Sound Manager (if there is one) @@ -48995,20 +53337,20 @@ var Video = new Class({ * This method allows you to change the source of the current video element. It works by first stopping the * current video, if playing. Then deleting the video texture, if one has been created. Finally, it makes a * new video texture and starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. * * @method Phaser.GameObjects.Video#changeSource * @since 3.20.0 - * + * * @param {string} key - The key of the Video this Game Object will swap to playing, as stored in the Video Cache. * @param {boolean} [autoplay=true] - Should the video start playing immediately, once the swap is complete? * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. - * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. - * + * @param {number} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. + * * @return {this} This Video Game Object for method chaining. */ changeSource: function (key, autoplay, loop, markerIn, markerOut) @@ -49040,7 +53382,7 @@ var Video = new Class({ this.videoTexture = this.scene.sys.textures.create(this._key, newVideo, newVideo.videoWidth, newVideo.videoHeight); this.videoTextureSource = this.videoTexture.source[0]; this.videoTexture.add('__BASE', 0, 0, 0, newVideo.videoWidth, newVideo.videoHeight); - + this.setTexture(this.videoTexture); this.setSizeToFrame(); this.updateDisplayOrigin(); @@ -49071,23 +53413,23 @@ var Video = new Class({ /** * Adds a sequence marker to this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds. - * + * * You can then play back specific markers via the `playMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * * @method Phaser.GameObjects.Video#addMarker * @since 3.20.0 - * + * * @param {string} key - A unique name to give this marker. - * @param {integer} markerIn - The time, in seconds, representing the start of this marker. - * @param {integer} markerOut - The time, in seconds, representing the end of this marker. - * + * @param {number} markerIn - The time, in seconds, representing the start of this marker. + * @param {number} markerOut - The time, in seconds, representing the end of this marker. + * * @return {this} This Video Game Object for method chaining. */ addMarker: function (key, markerIn, markerOut) @@ -49102,21 +53444,21 @@ var Video = new Class({ /** * Plays a pre-defined sequence in this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds and * specified via the `addMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * * @method Phaser.GameObjects.Video#playMarker * @since 3.20.0 - * + * * @param {string} key - The name of the marker sequence to play. * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * + * * @return {this} This Video Game Object for method chaining. */ playMarker: function (key, loop) @@ -49133,14 +53475,14 @@ var Video = new Class({ /** * Removes a previously set marker from this video. - * + * * If the marker is currently playing it will _not_ stop playback. * * @method Phaser.GameObjects.Video#removeMarker * @since 3.20.0 - * + * * @param {string} key - The name of the marker to remove. - * + * * @return {this} This Video Game Object for method chaining. */ removeMarker: function (key) @@ -49153,17 +53495,17 @@ var Video = new Class({ /** * Takes a snapshot of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a width and height. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * * @method Phaser.GameObjects.Video#snapshot * @since 3.20.0 - * - * @param {integer} [width] - The width of the resulting CanvasTexture. - * @param {integer} [height] - The height of the resulting CanvasTexture. - * - * @return {Phaser.Textures.CanvasTexture} + * + * @param {number} [width] - The width of the resulting CanvasTexture. + * @param {number} [height] - The height of the resulting CanvasTexture. + * + * @return {Phaser.Textures.CanvasTexture} */ snapshot: function (width, height) { @@ -49176,21 +53518,21 @@ var Video = new Class({ /** * Takes a snapshot of the specified area of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a different `destWidth` and `destHeight`. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * * @method Phaser.GameObjects.Video#snapshotArea * @since 3.20.0 - * - * @param {integer} [x=0] - The horizontal location of the top-left of the area to grab from. - * @param {integer} [y=0] - The vertical location of the top-left of the area to grab from. - * @param {integer} [srcWidth] - The width of area to grab from the video. If not given it will grab the full video dimensions. - * @param {integer} [srcHeight] - The height of area to grab from the video. If not given it will grab the full video dimensions. - * @param {integer} [destWidth] - The destination width of the grab, allowing you to resize it. - * @param {integer} [destHeight] - The destination height of the grab, allowing you to resize it. - * - * @return {Phaser.Textures.CanvasTexture} + * + * @param {number} [x=0] - The horizontal location of the top-left of the area to grab from. + * @param {number} [y=0] - The vertical location of the top-left of the area to grab from. + * @param {number} [srcWidth] - The width of area to grab from the video. If not given it will grab the full video dimensions. + * @param {number} [srcHeight] - The height of area to grab from the video. If not given it will grab the full video dimensions. + * @param {number} [destWidth] - The destination width of the grab, allowing you to resize it. + * @param {number} [destHeight] - The destination height of the grab, allowing you to resize it. + * + * @return {Phaser.Textures.CanvasTexture} */ snapshotArea: function (x, y, srcWidth, srcHeight, destWidth, destHeight) { @@ -49230,27 +53572,27 @@ var Video = new Class({ /** * Stores a copy of this Videos `snapshotTexture` in the Texture Manager using the given key. - * + * * This texture is created when the `snapshot` or `snapshotArea` methods are called. - * + * * After doing this, any texture based Game Object, such as a Sprite, can use the contents of the * snapshot by using the texture key: - * + * * ```javascript * var vid = this.add.video(0, 0, 'intro'); - * + * * vid.snapshot(); - * + * * vid.saveSnapshotTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Updating the contents of the `snapshotTexture`, for example by calling `snapshot` again, * will automatically update _any_ Game Object that is using it as a texture. * Calling `saveSnapshotTexture` again will not save another copy of the same texture, * it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. @@ -49278,18 +53620,18 @@ var Video = new Class({ /** * Loads a Video from the given URL, ready for playback with the `Video.play` method. - * + * * You can control at what point the browser determines the video as being ready for playback via * the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement * for more details. * * @method Phaser.GameObjects.Video#loadURL * @since 3.20.0 - * + * * @param {string} url - The URL of the video to load or be streamed. * @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`. * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. - * + * * @return {this} This Video Game Object for method chaining. */ loadURL: function (url, loadEvent, noAudio) @@ -49308,7 +53650,7 @@ var Video = new Class({ } var video = document.createElement('video'); - + video.controls = false; if (noAudio) @@ -49333,6 +53675,70 @@ var Video = new Class({ return this; }, + /** + * Loads a Video from the given MediaStream object, ready for playback with the `Video.play` method. + * + * You can control at what point the browser determines the video as being ready for playback via + * the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement + * for more details. + * + * @method Phaser.GameObjects.Video#loadMediaStream + * @since 3.50.0 + * + * @param {string} stream - The MediaStream object. + * @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`. + * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. + * + * @return {this} This Video Game Object for method chaining. + */ + loadMediaStream: function (stream, loadEvent, noAudio) + { + if (loadEvent === undefined) { loadEvent = 'loadeddata'; } + if (noAudio === undefined) { noAudio = false; } + + if (this.video) + { + this.stop(); + } + + if (this.videoTexture) + { + this.scene.sys.textures.remove(this._key); + } + + var video = document.createElement('video'); + + video.controls = false; + + if (noAudio) + { + video.muted = true; + video.defaultMuted = true; + + video.setAttribute('autoplay', 'autoplay'); + } + + video.setAttribute('playsinline', 'playsinline'); + video.setAttribute('preload', 'auto'); + + video.addEventListener('error', this._callbacks.error, true); + + try + { + video.srcObject = stream; + } + catch (error) + { + video.src = window.URL.createObjectURL(stream); + } + + video.load(); + + this.video = video; + + return this; + }, + /** * This internal method is called automatically if the playback Promise resolves successfully. * @@ -49360,12 +53766,12 @@ var Video = new Class({ * @fires Phaser.GameObjects.Events#VIDEO_ERROR * @private * @since 3.20.0 - * + * * @param {any} error - The Promise resolution error. */ playPromiseErrorHandler: function (error) { - this.scene.sys.input.once('pointerdown', this.unlockHandler, this); + this.scene.sys.input.once(InputEvents.POINTER_DOWN, this.unlockHandler, this); this.touchLocked = true; this.playWhenUnlocked = true; @@ -49375,7 +53781,7 @@ var Video = new Class({ /** * Called when the video emits a `playing` event during load. - * + * * This is only listened for if the browser doesn't support Promises. * * @method Phaser.GameObjects.Video#playHandler @@ -49387,7 +53793,7 @@ var Video = new Class({ this.touchLocked = false; this.emit(Events.VIDEO_PLAY, this); - + this.video.removeEventListener('playing', this._callbacks.play, true); }, @@ -49398,7 +53804,7 @@ var Video = new Class({ * @fires Phaser.GameObjects.Events#VIDEO_ERROR * @private * @since 3.20.0 - * + * * @param {Event} event - The error Event. */ loadErrorHandler: function (event) @@ -49417,7 +53823,7 @@ var Video = new Class({ * @fires Phaser.GameObjects.Events#VIDEO_PLAY * @private * @since 3.20.0 - * + * * @param {any} error - The Promise resolution error. */ unlockHandler: function () @@ -49439,7 +53845,7 @@ var Video = new Class({ /** * Called when the video completes playback, i.e. reaches an `ended` state. - * + * * This will never happen if the video is coming from a live stream, where the duration is `Infinity`. * * @method Phaser.GameObjects.Video#completeHandler @@ -49453,7 +53859,7 @@ var Video = new Class({ /** * Called when the video emits a `timeUpdate` event during playback. - * + * * This event is too slow and irregular to be used for actual video timing or texture updating, * but we can use it to determine if a video has looped. * @@ -49566,11 +53972,11 @@ var Video = new Class({ this.videoTexture = this.scene.sys.textures.create(this._key, video, width, height); this.videoTextureSource = this.videoTexture.source[0]; this.videoTexture.add('__BASE', 0, 0, 0, width, height); - + this.setTexture(this.videoTexture); this.setSizeToFrame(); this.updateDisplayOrigin(); - + this.emit(Events.VIDEO_CREATED, this, width, height); } else @@ -49583,7 +53989,7 @@ var Video = new Class({ textureSource.width = width; textureSource.height = height; } - + textureSource.update(); } }, @@ -49594,7 +54000,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#getVideoKey * @since 3.20.0 - * + * * @return {string} The key of the video being played from the Video Cache, if any. */ getVideoKey: function () @@ -49605,19 +54011,19 @@ var Video = new Class({ /** * Seeks to a given point in the video. The value is given as a float between 0 and 1, * where 0 represents the start of the video and 1 represents the end. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * If you wish to seek based on time instead, use the `Video.setCurrentTime` method. * * @method Phaser.GameObjects.Video#seekTo * @since 3.20.0 - * + * * @param {number} value - The point in the video to seek to. A value between 0 and 1. - * + * * @return {this} This Video Game Object for method chaining. */ seekTo: function (value) @@ -49645,7 +54051,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#getCurrentTime * @since 3.20.0 - * + * * @return {number} A double-precision floating-point value indicating the current playback time in seconds. */ getCurrentTime: function () @@ -49655,22 +54061,22 @@ var Video = new Class({ /** * Seeks to a given playback time in the video. The value is given in _seconds_ or as a string. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * You can provide a string prefixed with either a `+` or a `-`, such as `+2.5` or `-2.5`. * In this case it will seek to +/- the value given, relative to the _current time_. - * + * * If you wish to seek based on a duration percentage instead, use the `Video.seekTo` method. * * @method Phaser.GameObjects.Video#setCurrentTime * @since 3.20.0 - * + * * @param {(string|number)} value - The playback time to seek to in seconds. Can be expressed as a string, such as `+2` to seek 2 seconds ahead from the current time. - * + * * @return {this} This Video Game Object for method chaining. */ setCurrentTime: function (value) @@ -49707,7 +54113,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#isSeeking * @since 3.20.0 - * + * * @return {boolean} A boolean indicating if this Video is currently seeking, or not. */ isSeeking: function () @@ -49755,12 +54161,12 @@ var Video = new Class({ /** * Returns the current progress of the video. Progress is defined as a value between 0 (the start) * and 1 (the end). - * + * * Progress can only be returned if the video has a duration, otherwise it will always return zero. * * @method Phaser.GameObjects.Video#getProgress * @since 3.20.0 - * + * * @return {number} The current progress of playback. If the video has no duration, will always return zero. */ getProgress: function () @@ -49777,20 +54183,20 @@ var Video = new Class({ return now / duration; } } - + return 0; }, /** * A double-precision floating-point value which indicates the duration (total length) of the media in seconds, * on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN. - * + * * If the media has no known end (such as for live streams of unknown duration, web radio, media incoming from WebRTC, * and so forth), this value is +Infinity. - * + * * @method Phaser.GameObjects.Video#getDuration * @since 3.20.0 - * + * * @return {number} A double-precision floating-point value indicating the duration of the media in seconds. */ getDuration: function () @@ -49803,9 +54209,9 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#setMute * @since 3.20.0 - * + * * @param {boolean} [value=true] - The mute value. `true` if the video should be muted, otherwise `false`. - * + * * @return {this} This Video Game Object for method chaining. */ setMute: function (value) @@ -49829,7 +54235,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#isMuted * @since 3.20.0 - * + * * @return {boolean} A boolean indicating if this Video is currently muted, or not. */ isMuted: function () @@ -49843,7 +54249,7 @@ var Video = new Class({ * @method Phaser.GameObjects.Video#globalMute * @private * @since 3.20.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`. */ @@ -49895,17 +54301,17 @@ var Video = new Class({ /** * Sets the paused state of the currently loaded video. - * + * * If the video is playing, calling this method with `true` will pause playback. * If the video is paused, calling this method with `false` will resume playback. - * + * * If no video is loaded, this method does nothing. * * @method Phaser.GameObjects.Video#setPaused * @since 3.20.0 - * + * * @param {boolean} [value=true] - The paused value. `true` if the video should be paused, `false` to resume it. - * + * * @return {this} This Video Game Object for method chaining. */ setPaused: function (value) @@ -49939,27 +54345,27 @@ var Video = new Class({ /** * Returns a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). - * + * * @method Phaser.GameObjects.Video#getVolume * @since 3.20.0 - * + * * @return {number} A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). */ getVolume: function () { return (this.video) ? this.video.volume : 1; }, - + /** * Sets the volume of the currently playing video. - * + * * The value given is a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). - * + * * @method Phaser.GameObjects.Video#setVolume * @since 3.20.0 - * + * * @param {number} [value=1] - A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). - * + * * @return {this} This Video Game Object for method chaining. */ setVolume: function (value) @@ -49976,10 +54382,10 @@ var Video = new Class({ /** * Returns a double that indicates the rate at which the media is being played back. - * + * * @method Phaser.GameObjects.Video#getPlaybackRate * @since 3.20.0 - * + * * @return {number} A double that indicates the rate at which the media is being played back. */ getPlaybackRate: function () @@ -49989,14 +54395,14 @@ var Video = new Class({ /** * Sets the playback rate of the current video. - * + * * The value given is a double that indicates the rate at which the media is being played back. - * + * * @method Phaser.GameObjects.Video#setPlaybackRate * @since 3.20.0 - * + * * @param {number} [rate] - A double that indicates the rate at which the media is being played back. - * + * * @return {this} This Video Game Object for method chaining. */ setPlaybackRate: function (rate) @@ -50011,10 +54417,10 @@ var Video = new Class({ /** * Returns a boolean which indicates whether the media element should start over when it reaches the end. - * + * * @method Phaser.GameObjects.Video#getLoop * @since 3.20.0 - * + * * @return {boolean} A boolean which indicates whether the media element will start over when it reaches the end. */ getLoop: function () @@ -50024,18 +54430,18 @@ var Video = new Class({ /** * Sets the loop state of the current video. - * + * * The value given is a boolean which indicates whether the media element will start over when it reaches the end. - * + * * Not all videos can loop, for example live streams. - * + * * Please note that not all browsers support _seamless_ video looping for all encoding formats. - * + * * @method Phaser.GameObjects.Video#setLoop * @since 3.20.0 - * + * * @param {boolean} [value=true] - A boolean which indicates whether the media element will start over when it reaches the end. - * + * * @return {this} This Video Game Object for method chaining. */ setLoop: function (value) @@ -50052,23 +54458,23 @@ var Video = new Class({ /** * Returns a boolean which indicates whether the video is currently playing. - * + * * @method Phaser.GameObjects.Video#isPlaying * @since 3.20.0 - * + * * @return {boolean} A boolean which indicates whether the video is playing, or not. */ isPlaying: function () { return (this.video) ? !(this.video.paused || this.video.ended) : false; }, - + /** * Returns a boolean which indicates whether the video is currently paused. - * + * * @method Phaser.GameObjects.Video#isPaused * @since 3.20.0 - * + * * @return {boolean} A boolean which indicates whether the video is paused, or not. */ isPaused: function () @@ -50079,26 +54485,26 @@ var Video = new Class({ /** * Stores this Video in the Texture Manager using the given key as a dynamic texture, * which any texture-based Game Object, such as a Sprite, can use as its texture: - * + * * ```javascript * var vid = this.add.video(0, 0, 'intro'); - * + * * vid.play(); - * + * * vid.saveTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * The saved texture is automatically updated as the video plays. If you pause this video, * or change its source, then the saved texture updates instantly. - * + * * Calling `saveTexture` again will not save another copy of the same texture, it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. - * + * * If you intend to save the texture so you can use it as the input for a Shader, you may need to set the * `flipY` parameter to `true` if you find the video renders upside down in your shader. * @@ -50135,14 +54541,14 @@ var Video = new Class({ * Stops the video playing and clears all internal event listeners. * * If you only wish to pause playback of the video, and resume it a later time, use the `Video.pause` method instead. - * + * * If the video hasn't finished downloading, calling this method will not abort the download. To do that you need to * call `destroy` instead. * * @method Phaser.GameObjects.Video#stop * @fires Phaser.GameObjects.Events#VIDEO_STOP * @since 3.20.0 - * + * * @return {this} This Video Game Object for method chaining. */ stop: function () @@ -50173,13 +54579,13 @@ var Video = new Class({ /** * Removes the Video element from the DOM by calling parentNode.removeChild on itself. - * + * * Also removes the autoplay and src attributes and nulls the Video reference. - * + * * You should not call this method if you were playing a video from the Video Cache that * you wish to play again in your game, or if another Video object is also using the same * video. - * + * * If you loaded an external video via `Video.loadURL` then you should call this function * to clear up once you are done with the instance. * @@ -50213,9 +54619,9 @@ var Video = new Class({ /** * Handles the pre-destroy step for the Video object. - * + * * This calls `Video.stop` and optionally `Video.removeVideoElement`. - * + * * If any Sprites are using this Video as their texture it is up to you to manage those. * * @method Phaser.GameObjects.Video#preDestroy @@ -50255,7 +54661,7 @@ module.exports = Video; /***/ }), -/* 212 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50265,16 +54671,16 @@ module.exports = Video; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(213); -var GetPoints = __webpack_require__(437); -var GEOM_CONST = __webpack_require__(49); +var Contains = __webpack_require__(219); +var GetPoints = __webpack_require__(447); +var GEOM_CONST = __webpack_require__(55); /** * @classdesc * A Polygon object * * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points. - * Several formats are supported to define the list of points, check the setTo method for details. + * Several formats are supported to define the list of points, check the setTo method for details. * This is a geometry object allowing you to define and inspect the shape. * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. * To render a Polygon you should look at the capabilities of the Graphics class. @@ -50284,7 +54690,7 @@ var GEOM_CONST = __webpack_require__(49); * @constructor * @since 3.0.0 * - * @param {Phaser.Geom.Point[]} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x y properties: `[obj1, obj2, ...]` @@ -50302,7 +54708,7 @@ var Polygon = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Polygon#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -50365,7 +54771,7 @@ var Polygon = new Class({ * @method Phaser.Geom.Polygon#setTo * @since 3.0.0 * - * @param {array} points - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. * * @return {this} This Polygon object. */ @@ -50472,7 +54878,7 @@ var Polygon = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -50489,7 +54895,7 @@ module.exports = Polygon; /***/ }), -/* 213 */ +/* 219 */ /***/ (function(module, exports) { /** @@ -50538,668 +54944,7 @@ module.exports = Contains; /***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Mesh = __webpack_require__(142); - -/** - * @classdesc - * A Quad Game Object. - * - * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single - * texture spread across them. - * - * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also - * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. - * - * @class Quad - * @extends Phaser.GameObjects.Mesh - * @memberof Phaser.GameObjects - * @constructor - * @webglOnly - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Quad belongs. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Quad = new Class({ - - Extends: Mesh, - - initialize: - - function Quad (scene, x, y, texture, frame) - { - // 0----3 - // |\ B| - // | \ | - // | \ | - // | A \| - // | \ - // 1----2 - - var vertices = [ - 0, 0, // tl - 0, 0, // bl - 0, 0, // br - 0, 0, // tl - 0, 0, // br - 0, 0 // tr - ]; - - var uv = [ - 0, 0, // tl - 0, 1, // bl - 1, 1, // br - 0, 0, // tl - 1, 1, // br - 1, 0 // tr - ]; - - var colors = [ - 0xffffff, // tl - 0xffffff, // bl - 0xffffff, // br - 0xffffff, // tl - 0xffffff, // br - 0xffffff // tr - ]; - - var alphas = [ - 1, // tl - 1, // bl - 1, // br - 1, // tl - 1, // br - 1 // tr - ]; - - Mesh.call(this, scene, x, y, vertices, uv, colors, alphas, texture, frame); - - this.resetPosition(); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * The Frame has to belong to the current Texture being used. - * - * It can be either a string or an index. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Quad#setFrame - * @since 3.11.0 - * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame) - { - this.frame = this.texture.get(frame); - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~8; - } - else - { - this.renderFlags |= 8; - } - - frame = this.frame; - - // TL - this.uv[0] = frame.u0; - this.uv[1] = frame.v0; - - // BL - this.uv[2] = frame.u0; - this.uv[3] = frame.v1; - - // BR - this.uv[4] = frame.u1; - this.uv[5] = frame.v1; - - // TL - this.uv[6] = frame.u0; - this.uv[7] = frame.v0; - - // BR - this.uv[8] = frame.u1; - this.uv[9] = frame.v1; - - // TR - this.uv[10] = frame.u1; - this.uv[11] = frame.v0; - - return this; - }, - - /** - * The top-left x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftX - * @type {number} - * @since 3.0.0 - */ - topLeftX: { - - get: function () - { - return this.x + this.vertices[0]; - }, - - set: function (value) - { - this.vertices[0] = value - this.x; - this.vertices[6] = value - this.x; - } - - }, - - /** - * The top-left y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftY - * @type {number} - * @since 3.0.0 - */ - topLeftY: { - - get: function () - { - return this.y + this.vertices[1]; - }, - - set: function (value) - { - this.vertices[1] = value - this.y; - this.vertices[7] = value - this.y; - } - - }, - - /** - * The top-right x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightX - * @type {number} - * @since 3.0.0 - */ - topRightX: { - - get: function () - { - return this.x + this.vertices[10]; - }, - - set: function (value) - { - this.vertices[10] = value - this.x; - } - - }, - - /** - * The top-right y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightY - * @type {number} - * @since 3.0.0 - */ - topRightY: { - - get: function () - { - return this.y + this.vertices[11]; - }, - - set: function (value) - { - this.vertices[11] = value - this.y; - } - - }, - - /** - * The bottom-left x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftX - * @type {number} - * @since 3.0.0 - */ - bottomLeftX: { - - get: function () - { - return this.x + this.vertices[2]; - }, - - set: function (value) - { - this.vertices[2] = value - this.x; - } - - }, - - /** - * The bottom-left y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftY - * @type {number} - * @since 3.0.0 - */ - bottomLeftY: { - - get: function () - { - return this.y + this.vertices[3]; - }, - - set: function (value) - { - this.vertices[3] = value - this.y; - } - - }, - - /** - * The bottom-right x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightX - * @type {number} - * @since 3.0.0 - */ - bottomRightX: { - - get: function () - { - return this.x + this.vertices[4]; - }, - - set: function (value) - { - this.vertices[4] = value - this.x; - this.vertices[8] = value - this.x; - } - - }, - - /** - * The bottom-right y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightY - * @type {number} - * @since 3.0.0 - */ - bottomRightY: { - - get: function () - { - return this.y + this.vertices[5]; - }, - - set: function (value) - { - this.vertices[5] = value - this.y; - this.vertices[9] = value - this.y; - } - - }, - - /** - * The top-left alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftAlpha - * @type {number} - * @since 3.0.0 - */ - topLeftAlpha: { - - get: function () - { - return this.alphas[0]; - }, - - set: function (value) - { - this.alphas[0] = value; - this.alphas[3] = value; - } - - }, - - /** - * The top-right alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightAlpha - * @type {number} - * @since 3.0.0 - */ - topRightAlpha: { - - get: function () - { - return this.alphas[5]; - }, - - set: function (value) - { - this.alphas[5] = value; - } - - }, - - /** - * The bottom-left alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftAlpha - * @type {number} - * @since 3.0.0 - */ - bottomLeftAlpha: { - - get: function () - { - return this.alphas[1]; - }, - - set: function (value) - { - this.alphas[1] = value; - } - - }, - - /** - * The bottom-right alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightAlpha - * @type {number} - * @since 3.0.0 - */ - bottomRightAlpha: { - - get: function () - { - return this.alphas[2]; - }, - - set: function (value) - { - this.alphas[2] = value; - this.alphas[4] = value; - } - - }, - - /** - * The top-left color value of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftColor - * @type {number} - * @since 3.0.0 - */ - topLeftColor: { - - get: function () - { - return this.colors[0]; - }, - - set: function (value) - { - this.colors[0] = value; - this.colors[3] = value; - } - - }, - - /** - * The top-right color value of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightColor - * @type {number} - * @since 3.0.0 - */ - topRightColor: { - - get: function () - { - return this.colors[5]; - }, - - set: function (value) - { - this.colors[5] = value; - } - - }, - - /** - * The bottom-left color value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftColor - * @type {number} - * @since 3.0.0 - */ - bottomLeftColor: { - - get: function () - { - return this.colors[1]; - }, - - set: function (value) - { - this.colors[1] = value; - } - - }, - - /** - * The bottom-right color value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightColor - * @type {number} - * @since 3.0.0 - */ - bottomRightColor: { - - get: function () - { - return this.colors[2]; - }, - - set: function (value) - { - this.colors[2] = value; - this.colors[4] = value; - } - - }, - - /** - * Sets the top-left vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setTopLeft - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setTopLeft: function (x, y) - { - this.topLeftX = x; - this.topLeftY = y; - - return this; - }, - - /** - * Sets the top-right vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setTopRight - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setTopRight: function (x, y) - { - this.topRightX = x; - this.topRightY = y; - - return this; - }, - - /** - * Sets the bottom-left vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setBottomLeft - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setBottomLeft: function (x, y) - { - this.bottomLeftX = x; - this.bottomLeftY = y; - - return this; - }, - - /** - * Sets the bottom-right vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setBottomRight - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setBottomRight: function (x, y) - { - this.bottomRightX = x; - this.bottomRightY = y; - - return this; - }, - - /** - * Resets the positions of the four corner vertices of this Quad. - * - * @method Phaser.GameObjects.Quad#resetPosition - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetPosition: function () - { - var x = this.x; - var y = this.y; - var halfWidth = Math.floor(this.width / 2); - var halfHeight = Math.floor(this.height / 2); - - this.setTopLeft(x - halfWidth, y - halfHeight); - this.setTopRight(x + halfWidth, y - halfHeight); - this.setBottomLeft(x - halfWidth, y + halfHeight); - this.setBottomRight(x + halfWidth, y + halfHeight); - - return this; - }, - - /** - * Resets the alpha values used by this Quad back to 1. - * - * @method Phaser.GameObjects.Quad#resetAlpha - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetAlpha: function () - { - var alphas = this.alphas; - - alphas[0] = 1; - alphas[1] = 1; - alphas[2] = 1; - alphas[3] = 1; - alphas[4] = 1; - alphas[5] = 1; - - return this; - }, - - /** - * Resets the color values used by this Quad back to 0xffffff. - * - * @method Phaser.GameObjects.Quad#resetColors - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetColors: function () - { - var colors = this.colors; - - colors[0] = 0xffffff; - colors[1] = 0xffffff; - colors[2] = 0xffffff; - colors[3] = 0xffffff; - colors[4] = 0xffffff; - colors[5] = 0xffffff; - - return this; - }, - - /** - * Resets the position, alpha and color values used by this Quad. - * - * @method Phaser.GameObjects.Quad#reset - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - reset: function () - { - this.resetPosition(); - - this.resetAlpha(); - - return this.resetColors(); - } - -}); - -module.exports = Quad; - - -/***/ }), -/* 215 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51212,10 +54957,10 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); var GetFastValue = __webpack_require__(2); -var Extend = __webpack_require__(19); -var SetValue = __webpack_require__(445); -var ShaderRender = __webpack_require__(1100); -var TransformMatrix = __webpack_require__(31); +var Extend = __webpack_require__(18); +var SetValue = __webpack_require__(455); +var ShaderRender = __webpack_require__(1159); +var TransformMatrix = __webpack_require__(24); /** * @classdesc @@ -51314,7 +55059,7 @@ var Shader = new Class({ * This Game Object cannot have a blend mode, so skip all checks. * * @name Phaser.GameObjects.Shader#blendMode - * @type {integer} + * @type {number} * @private * @since 3.17.0 */ @@ -51708,9 +55453,9 @@ var Shader = new Class({ var program = renderer.createProgram(this.shader.vertexSrc, this.shader.fragmentSrc); // The default uniforms available within the vertex shader - renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); - renderer.setFloat2(program, 'uResolution', this.width, this.height); + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uViewMatrix'), false, this.viewMatrix); + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uProjectionMatrix'), false, this.projectionMatrix); + gl.uniform2f(gl.getUniformLocation(program, 'uResolution'), this.width, this.height); this.program = program; @@ -51806,7 +55551,12 @@ var Shader = new Class({ var program = this.program; - this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); + var gl = this.gl; + var renderer = this.renderer; + + renderer.setProgram(program); + + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uProjectionMatrix'), false, this.projectionMatrix); this._rendererWidth = right; this._rendererHeight = bottom; @@ -51872,9 +55622,9 @@ var Shader = new Class({ * * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. * @param {WebGLTexture} texture - A WebGLTexture reference. - * @param {integer} width - The width of the texture. - * @param {integer} height - The height of the texture. - * @param {integer} [textureIndex=0] - The texture index. + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} [textureIndex=0] - The texture index. * @param {any} [textureData] - Additional texture data. * * @return {this} This Shader instance. @@ -51913,7 +55663,7 @@ var Shader = new Class({ * * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. - * @param {integer} [textureIndex=0] - The texture index. + * @param {number} [textureIndex=0] - The texture index. * @param {any} [textureData] - Additional texture data. * * @return {this} This Shader instance. @@ -52420,7 +56170,7 @@ module.exports = Shader; /***/ }), -/* 216 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52429,7 +56179,1063 @@ module.exports = Shader; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DistanceBetween = __webpack_require__(55); +var Class = __webpack_require__(0); +var Components = __webpack_require__(11); +var DegToRad = __webpack_require__(34); +var Face = __webpack_require__(111); +var GameObject = __webpack_require__(14); +var GameObjectEvents = __webpack_require__(32); +var GenerateVerts = __webpack_require__(456); +var GenerateObjVerts = __webpack_require__(457); +var GetCalcMatrix = __webpack_require__(21); +var Matrix4 = __webpack_require__(73); +var MeshRender = __webpack_require__(1162); +var StableSort = __webpack_require__(90); +var Vector3 = __webpack_require__(37); +var Vertex = __webpack_require__(113); + +/** + * @classdesc + * A Mesh Game Object. + * + * The Mesh Game Object allows you to render a group of textured vertices and manipulate + * the view of those vertices, such as rotation, translation or scaling. + * + * Support for generating mesh data from grids, model data or Wavefront OBJ Files is included. + * + * Although you can use this to render 3D objects, its primary use is for displaying more complex + * Sprites, or Sprites where you need fine-grained control over the vertice positions in order to + * achieve special effects in your games. Note that rendering still takes place using Phasers + * orthographic camera. As a result, all depth and face tests are done in orthographic space. + * + * The rendering process will iterate through the faces of this Mesh and render out each face + * that is considered as being in view of the camera. No depth buffer is used, and because of this, + * you should be careful not to use model data with too many vertices, or overlapping geometry, + * or you'll probably encounter z-depth fighting. The Mesh was designed to allow for more advanced + * 2D layouts, rather than displaying 3D objects, even though it can do this to a degree. + * + * In short, if you want to remake Crysis, use a 3D engine, not a Mesh. However, if you want + * to easily add some small fun 3D elements into your game, or create some special effects involving + * vertex warping, this is the right object for you. Mesh data becomes part of the WebGL batch, + * just like standard Sprites, so doesn't introduce any additional shader overhead. Because + * the Mesh just generates vertices into the WebGL batch, like any other Sprite, you can use all of + * the common Game Object components on a Mesh too, such as a custom pipeline, mask, blend mode + * or texture. + * + * Note that the Mesh object is WebGL only and does not have a Canvas counterpart. + * + * The Mesh origin is always 0.5 x 0.5 and cannot be changed. + * + * @class Mesh + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @webglOnly + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * @extends Phaser.GameObjects.Components.ScrollFactor + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x] - The horizontal position of this Game Object in the world. + * @param {number} [y] - The vertical position of this Game Object in the world. + * @param {string|Phaser.Textures.Texture} [texture] - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {string|number} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {number[]} [vertices] - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} [uvs] - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + */ +var Mesh = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.Size, + Components.Texture, + Components.Transform, + Components.Visible, + Components.ScrollFactor, + MeshRender + ], + + initialize: + + function Mesh (scene, x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (texture === undefined) { texture = '__WHITE'; } + + GameObject.call(this, scene, 'Mesh'); + + /** + * An array containing the Face instances belonging to this Mesh. + * + * A Face consists of 3 Vertex objects. + * + * This array is populated during calls such as `addVertices` or `addOBJ`. + * + * @name Phaser.GameObjects.Mesh#faces + * @type {Phaser.Geom.Mesh.Face[]} + * @since 3.50.0 + */ + this.faces = []; + + /** + * An array containing Vertex instances. One instance per vertex in this Mesh. + * + * This array is populated during calls such as `addVertex` or `addOBJ`. + * + * @name Phaser.GameObjects.Mesh#vertices + * @type {Phaser.Geom.Mesh.Vertex[]} + * @since 3.50.0 + */ + this.vertices = []; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertex colors replace the texture, but respects texture alpha. + * + * @name Phaser.GameObjects.Mesh#tintFill + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.tintFill = false; + + /** + * You can optionally choose to render the vertices of this Mesh to a Graphics instance. + * + * Achieve this by setting the `debugCallback` and the `debugGraphic` properties. + * + * You can do this in a single call via the `Mesh.setDebug` method, which will use the + * built-in debug function. You can also set it to your own callback. The callback + * will be invoked _once per render_ and sent the following parameters: + * + * `debugCallback(src, meshLength, verts)` + * + * `src` is the Mesh instance being debugged. + * `meshLength` is the number of mesh vertices in total. + * `verts` is an array of the translated vertex coordinates. + * + * To disable rendering, set this property back to `null`. + * + * Please note that high vertex count Meshes will struggle to debug properly. + * + * @name Phaser.GameObjects.Mesh#debugCallback + * @type {function} + * @since 3.50.0 + */ + this.debugCallback = null; + + /** + * The Graphics instance that the debug vertices will be drawn to, if `setDebug` has + * been called. + * + * @name Phaser.GameObjects.Mesh#debugGraphic + * @type {Phaser.GameObjects.Graphics} + * @since 3.50.0 + */ + this.debugGraphic = null; + + /** + * When rendering, skip any Face that isn't counter clockwise? + * + * Enable this to hide backward-facing Faces during rendering. + * + * Disable it to render all Faces. + * + * @name Phaser.GameObjects.Mesh#hideCCW + * @type {boolean} + * @since 3.50.0 + */ + this.hideCCW = true; + + /** + * A Vector3 containing the 3D position of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to reposition where + * the vertices are rendered within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * You can also adjust the 'view' by using the `pan` methods. + * + * @name Phaser.GameObjects.Mesh#modelPosition + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelPosition = new Vector3(); + + /** + * A Vector3 containing the 3D scale of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to scale + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * @name Phaser.GameObjects.Mesh#modelScale + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelScale = new Vector3(1, 1, 1); + + /** + * A Vector3 containing the 3D rotation of the vertices in this Mesh. + * + * The values should be given in radians, i.e. to rotate the vertices by 90 + * degrees you can use `modelRotation.x = Phaser.Math.DegToRad(90)`. + * + * Modifying the components of this property will allow you to rotate + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * @name Phaser.GameObjects.Mesh#modelRotation + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelRotation = new Vector3(); + + /** + * An internal cache, used to compare position, rotation, scale and face data + * each frame, to avoid math calculations in `preUpdate`. + * + * Cache structure = position xyz | rotation xyz | scale xyz | face count | view | ortho + * + * @name Phaser.GameObjects.Mesh#dirtyCache + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.dirtyCache = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; + + /** + * The transformation matrix for this Mesh. + * + * @name Phaser.GameObjects.Mesh#transformMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.transformMatrix = new Matrix4(); + + /** + * The view position for this Mesh. + * + * Use the methods`panX`, `panY` and `panZ` to adjust the view. + * + * @name Phaser.GameObjects.Mesh#viewPosition + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.viewPosition = new Vector3(); + + /** + * The view matrix for this Mesh. + * + * @name Phaser.GameObjects.Mesh#viewMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.viewMatrix = new Matrix4(); + + /** + * The projection matrix for this Mesh. + * + * Update it with the `setPerspective` or `setOrtho` methods. + * + * @name Phaser.GameObjects.Mesh#projectionMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.projectionMatrix = new Matrix4(); + + /** + * How many faces were rendered by this Mesh Game Object in the last + * draw? This is reset in the `preUpdate` method and then incremented + * each time a face is drawn. Note that in multi-camera Scenes this + * value may exceed that found in `Mesh.getFaceCount` due to + * cameras drawing the same faces more than once. + * + * @name Phaser.GameObjects.Mesh#totalRendered + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.totalRendered = 0; + + /** + * Internal cache var for the total number of faces rendered this frame. + * + * See `totalRendered` instead for the actual value. + * + * @name Phaser.GameObjects.Mesh#totalFrame + * @type {number} + * @private + * @since 3.50.0 + */ + this.totalFrame = 0; + + /** + * By default, the Mesh will check to see if its model or view transform has + * changed each frame and only recalculate the vertex positions if they have. + * + * This avoids lots of additional math in the `preUpdate` step when not required. + * + * However, if you are performing per-Face or per-Vertex manipulation on this Mesh, + * such as tweening a Face, or moving it without moving the rest of the Mesh, + * then you may need to disable the dirty cache in order for the Mesh to re-render + * correctly. You can toggle this property to do that. Please note that leaving + * this set to `true` will cause the Mesh to recalculate the position of every single + * vertex in it, every single frame. So only really do this if you know you + * need it. + * + * @name Phaser.GameObjects.Mesh#ignoreDirtyCache + * @type {boolean} + * @since 3.50.0 + */ + this.ignoreDirtyCache = false; + + var renderer = scene.sys.renderer; + + this.setPosition(x, y); + this.setTexture(texture, frame); + this.setSize(renderer.width, renderer.height); + this.initPipeline(); + + this.setPerspective(renderer.width, renderer.height, 45, 0.01, 1000); + + if (vertices) + { + this.addVertices(vertices, uvs, indicies, containsZ, normals, colors, alphas); + } + + this.on(GameObjectEvents.ADDED_TO_SCENE, this.addedToScene, this); + this.on(GameObjectEvents.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); + }, + + /** + * Translates the view position of this Mesh on the x axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panX + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panX: function (v) + { + this.viewPosition.addScale(Vector3.LEFT, v); + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Translates the view position of this Mesh on the y axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panY + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panY: function (v) + { + this.viewPosition.y += Vector3.DOWN.y * v; + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Translates the view position of this Mesh on the z axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panZ + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panZ: function (amount) + { + this.viewPosition.z += amount; + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Builds a new perspective projection matrix from the given values. + * + * See also `setOrtho`. + * + * @method Phaser.GameObjects.Mesh#setPerspective + * @since 3.50.0 + * + * @param {number} width - The width of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param {number} height - The height of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param {number} [fov=45] - The field of view, in degrees. + * @param {number} [near=0.01] - The near value of the view. + * @param {number} [far=1000] - The far value of the view. + */ + setPerspective: function (width, height, fov, near, far) + { + if (fov === undefined) { fov = 45; } + if (near === undefined) { near = 0.01; } + if (far === undefined) { far = 1000; } + + this.projectionMatrix.perspective(DegToRad(fov), width / height, near, far); + + this.dirtyCache[10] = 1; + this.dirtyCache[11] = 0; + + return this; + }, + + /** + * Builds a new orthographic projection matrix from the given values. + * + * If using this mode you will often need to set `Mesh.hideCCW` to `false` as well. + * + * See also `setPerspective`. + * + * @method Phaser.GameObjects.Mesh#setOrtho + * @since 3.50.0 + * + * @param {number} [scaleX=1] - The default horizontal scale in relation to the Mesh / Renderer dimensions. + * @param {number} [scaleY=1] - The default vertical scale in relation to the Mesh / Renderer dimensions. + * @param {number} [near=-1000] - The near value of the view. + * @param {number} [far=1000] - The far value of the view. + */ + setOrtho: function (scaleX, scaleY, near, far) + { + if (scaleX === undefined) { scaleX = 1; } + if (scaleY === undefined) { scaleY = 1; } + if (near === undefined) { near = -1000; } + if (far === undefined) { far = 1000; } + + this.projectionMatrix.ortho(-scaleX, scaleX, -scaleY, scaleY, near, far); + + this.dirtyCache[10] = 1; + this.dirtyCache[11] = 1; + + return this; + }, + + /** + * Iterates and destroys all current Faces in this Mesh, then resets the + * `faces` and `vertices` arrays. + * + * @method Phaser.GameObjects.Mesh#clear + * @since 3.50.0 + * + * @return {this} This Mesh Game Object. + */ + clear: function () + { + this.faces.forEach(function (face) + { + face.destroy(); + }); + + this.faces = []; + this.vertices = []; + + return this; + }, + + /** + * This method will add the data from a triangulated Wavefront OBJ model file to this Mesh. + * + * The data should have been loaded via the OBJFile: + * + * ```javascript + * this.load.obj(key, url); + * ``` + * + * Then use the same `key` as the first parameter to this method. + * + * Multiple Mesh Game Objects can use the same model data without impacting on each other. + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small, or too large, to see. + * You can also offset the vertices of the model via the `x`, `y` and `z` parameters. + * + * @method Phaser.GameObjects.Mesh#addVerticesFromObj + * @since 3.50.0 + * + * @param {string} key - The key of the model data in the OBJ Cache to add to this Mesh. + * @param {number} [scale=1] - An amount to scale the model data by. Use this if the model has exported too small, or large, to see. + * @param {number} [x=0] - Translate the model x position by this amount. + * @param {number} [y=0] - Translate the model y position by this amount. + * @param {number} [z=0] - Translate the model z position by this amount. + * @param {number} [rotateX=0] - Rotate the model on the x axis by this amount, in radians. + * @param {number} [rotateY=0] - Rotate the model on the y axis by this amount, in radians. + * @param {number} [rotateZ=0] - Rotate the model on the z axis by this amount, in radians. + * @param {boolean} [zIsUp=true] - Is the z axis up (true), or is y axis up (false)? + * + * @return {this} This Mesh Game Object. + */ + addVerticesFromObj: function (key, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) + { + var data = this.scene.sys.cache.obj.get(key); + + if (data) + { + GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + } + + return this; + }, + + /** + * Compare the depth of two Faces. + * + * @method Phaser.GameObjects.Mesh#sortByDepth + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Face} faceA - The first Face. + * @param {Phaser.Geom.Mesh.Face} faceB - The second Face. + * + * @return {number} The difference between the depths of each Face. + */ + sortByDepth: function (faceA, faceB) + { + return faceA.depth - faceB.depth; + }, + + /** + * Runs a depth sort across all Faces in this Mesh, comparing their averaged depth. + * + * This is called automatically if you use any of the `rotate` methods, but you can + * also invoke it to sort the Faces should you manually position them. + * + * @method Phaser.GameObjects.Mesh#depthSort + * @since 3.50.0 + * + * @return {this} This Mesh Game Object. + */ + depthSort: function () + { + StableSort(this.faces, this.sortByDepth); + + return this; + }, + + /** + * Adds a new Vertex into the vertices array of this Mesh. + * + * Just adding a vertex isn't enough to render it. You need to also + * make it part of a Face, with 3 Vertex instances per Face. + * + * @method Phaser.GameObjects.Mesh#addVertex + * @since 3.50.0 + * + * @param {number} x - The x position of the vertex. + * @param {number} y - The y position of the vertex. + * @param {number} z - The z position of the vertex. + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * @param {number} [color=0xffffff] - The color value of the vertex. + * @param {number} [alpha=1] - The alpha value of the vertex. + * + * @return {this} This Mesh Game Object. + */ + addVertex: function (x, y, z, u, v, color, alpha) + { + var vert = new Vertex(x, y, z, u, v, color, alpha); + + this.vertices.push(vert); + + return vert; + }, + + /** + * Adds a new Face into the faces array of this Mesh. + * + * A Face consists of references to 3 Vertex instances, which must be provided. + * + * @method Phaser.GameObjects.Mesh#addFace + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Vertex} vertex1 - The first vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex2 - The second vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex3 - The third vertex of the Face. + * + * @return {this} This Mesh Game Object. + */ + addFace: function (vertex1, vertex2, vertex3) + { + var face = new Face(vertex1, vertex2, vertex3); + + this.faces.push(face); + + this.dirtyCache[9] = -1; + + return face; + }, + + /** + * Adds new vertices to this Mesh by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * mesh.addVertices(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * + * @method Phaser.GameObjects.Mesh#addVertices + * @since 3.50.0 + * + * @param {number[]} vertices - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} uvs - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * + * @return {this} This Mesh Game Object. + */ + addVertices: function (vertices, uvs, indicies, containsZ, normals, colors, alphas) + { + var result = GenerateVerts(vertices, uvs, indicies, containsZ, normals, colors, alphas); + + if (result) + { + this.faces = this.faces.concat(result.faces); + this.vertices = this.vertices.concat(result.vertices); + } + + this.dirtyCache[9] = -1; + + return this; + }, + + /** + * Returns the total number of Faces in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getFaceCount + * @since 3.50.0 + * + * @return {number} The number of Faces in this Mesh Game Object. + */ + getFaceCount: function () + { + return this.faces.length; + }, + + /** + * Returns the total number of Vertices in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getVertexCount + * @since 3.50.0 + * + * @return {number} The number of Vertices in this Mesh Game Object. + */ + getVertexCount: function () + { + return this.vertices.length; + }, + + /** + * Returns the Face at the given index in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getFace + * @since 3.50.0 + * + * @param {number} index - The index of the Face to get. + * + * @return {Phaser.Geom.Mesh.Face} The Face at the given index, or `undefined` if index out of range. + */ + getFace: function (index) + { + return this.faces[index]; + }, + + /** + * Return an array of Face objects from this Mesh that intersect with the given coordinates. + * + * The given position is translated through the matrix of this Mesh and the given Camera, + * before being compared against the vertices. + * + * If more than one Face intersects, they will all be returned in the array, but the array will + * be depth sorted first, so the first element will always be that closest to the camera. + * + * @method Phaser.GameObjects.Mesh#getFaceAt + * @since 3.50.0 + * + * @param {number} x - The x position to check against. + * @param {number} y - The y position to check against. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The camera to pass the coordinates through. If not give, the default Scene Camera is used. + * + * @return {Phaser.Geom.Mesh.Face[]} An array of Face objects that intersect with the given point, ordered by depth. + */ + getFaceAt: function (x, y, camera) + { + if (camera === undefined) { camera = this.scene.sys.cameras.main; } + + var calcMatrix = GetCalcMatrix(this, camera).calc; + + var faces = this.faces; + var results = []; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + if (face.contains(x, y, calcMatrix)) + { + results.push(face); + } + } + + return StableSort(results, this.sortByDepth); + }, + + /** + * This method enables rendering of the Mesh vertices to the given Graphics instance. + * + * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, + * otherwise the Graphics instance you provide to debug will fill-up with draw calls, + * eventually crashing the browser. This is not done automatically to allow you to debug + * draw multiple Mesh objects to a single Graphics instance. + * + * The Mesh class has a built-in debug rendering callback `Mesh.renderDebug`, however + * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. + * + * The callback is invoked _once per render_ and sent the following parameters: + * + * `callback(src, faces)` + * + * `src` is the Mesh instance being debugged. + * `faces` is an array of the Faces that were rendered. + * + * You can get the final drawn vertex position from a Face object like this: + * + * ```javascript + * let face = faces[i]; + * + * let x0 = face.vertex1.tx; + * let y0 = face.vertex1.ty; + * let x1 = face.vertex2.tx; + * let y1 = face.vertex2.ty; + * let x2 = face.vertex3.tx; + * let y2 = face.vertex3.ty; + * + * graphic.strokeTriangle(x0, y0, x1, y1, x2, y2); + * ``` + * + * If using your own callback you do not have to provide a Graphics instance to this method. + * + * To disable debug rendering, to either your own callback or the built-in one, call this method + * with no arguments. + * + * @method Phaser.GameObjects.Mesh#setDebug + * @since 3.50.0 + * + * @param {Phaser.GameObjects.Graphics} [graphic] - The Graphic instance to render to if using the built-in callback. + * @param {function} [callback] - The callback to invoke during debug render. Leave as undefined to use the built-in callback. + * + * @return {this} This Game Object instance. + */ + setDebug: function (graphic, callback) + { + this.debugGraphic = graphic; + + if (!graphic && !callback) + { + this.debugCallback = null; + } + else if (!callback) + { + this.debugCallback = this.renderDebug; + } + else + { + this.debugCallback = callback; + } + + return this; + }, + + /** + * Checks if the transformation data in this mesh is dirty. + * + * This is used internally by the `preUpdate` step to determine if the vertices should + * be recalculated or not. + * + * @method Phaser.GameObjects.Mesh#isDirty + * @since 3.50.0 + * + * @return {boolean} Returns `true` if the data of this mesh is dirty, otherwise `false`. + */ + isDirty: function () + { + var position = this.modelPosition; + var rotation = this.modelRotation; + var scale = this.modelScale; + var dirtyCache = this.dirtyCache; + + var px = position.x; + var py = position.y; + var pz = position.z; + + var rx = rotation.x; + var ry = rotation.y; + var rz = rotation.z; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + var faces = this.getFaceCount(); + + var pxCached = dirtyCache[0]; + var pyCached = dirtyCache[1]; + var pzCached = dirtyCache[2]; + + var rxCached = dirtyCache[3]; + var ryCached = dirtyCache[4]; + var rzCached = dirtyCache[5]; + + var sxCached = dirtyCache[6]; + var syCached = dirtyCache[7]; + var szCached = dirtyCache[8]; + + var fCached = dirtyCache[9]; + + dirtyCache[0] = px; + dirtyCache[1] = py; + dirtyCache[2] = pz; + + dirtyCache[3] = rx; + dirtyCache[4] = ry; + dirtyCache[5] = rz; + + dirtyCache[6] = sx; + dirtyCache[7] = sy; + dirtyCache[8] = sz; + + dirtyCache[9] = faces; + + return ( + pxCached !== px || pyCached !== py || pzCached !== pz || + rxCached !== rx || ryCached !== ry || rzCached !== rz || + sxCached !== sx || syCached !== sy || szCached !== sz || + fCached !== faces + ); + }, + + /** + * The Mesh update loop. The following takes place in this method: + * + * First, the `totalRendered` and `totalFrame` properties are set. + * + * If the view matrix of this Mesh isn't dirty, and the model position, rotate or scale properties are + * all clean, then the method returns at this point. + * + * Otherwise, if the viewPosition is dirty (i.e. from calling a method like `panZ`), then it will + * refresh the viewMatrix. + * + * After this, a new transformMatrix is built and it then iterates through all Faces in this + * Mesh, calling `transformCoordinatesLocal` on all of them. Internally, this updates every + * vertex, calculating its new transformed position, based on the new transform matrix. + * + * Finally, the faces are depth sorted. + * + * @method Phaser.GameObjects.Mesh#preUpdate + * @protected + * @since 3.50.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function () + { + this.totalRendered = this.totalFrame; + this.totalFrame = 0; + + var dirty = this.dirtyCache; + + if (!this.ignoreDirtyCache && !dirty[10] && !this.isDirty()) + { + // If neither the view or the mesh is dirty we can bail out and save lots of math + return; + } + + var width = this.width; + var height = this.height; + + var viewMatrix = this.viewMatrix; + var viewPosition = this.viewPosition; + + if (dirty[10]) + { + viewMatrix.identity(); + viewMatrix.translate(viewPosition); + viewMatrix.invert(); + + dirty[10] = 0; + } + + var transformMatrix = this.transformMatrix; + + transformMatrix.setWorldMatrix( + this.modelRotation, + this.modelPosition, + this.modelScale, + this.viewMatrix, + this.projectionMatrix + ); + + var z = viewPosition.z; + + var faces = this.faces; + + for (var i = 0; i < faces.length; i++) + { + faces[i].transformCoordinatesLocal(transformMatrix, width, height, z); + } + + this.depthSort(); + }, + + /** + * The built-in Mesh debug rendering method. + * + * See `Mesh.setDebug` for more details. + * + * @method Phaser.GameObjects.Mesh#renderDebug + * @since 3.50.0 + * + * @param {Phaser.GameObjects.Mesh} src - The Mesh object being rendered. + * @param {Phaser.Geom.Mesh.Face[]} faces - An array of Faces. + */ + renderDebug: function (src, faces) + { + var graphic = src.debugGraphic; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + var x0 = face.vertex1.tx; + var y0 = face.vertex1.ty; + var x1 = face.vertex2.tx; + var y1 = face.vertex2.ty; + var x2 = face.vertex3.tx; + var y2 = face.vertex3.ty; + + graphic.strokeTriangle(x0, y0, x1, y1, x2, y2); + } + }, + + /** + * Handles the pre-destroy step for the Mesh, which removes the Animation component and typed arrays. + * + * @method Phaser.GameObjects.Mesh#preDestroy + * @private + * @since 3.50.0 + */ + preDestroy: function () + { + this.clear(); + + this.debugCallback = null; + this.debugGraphic = null; + } + +}); + +module.exports = Mesh; + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DistanceBetween = __webpack_require__(61); /** * Checks if two Circles intersect. @@ -52451,7 +57257,7 @@ module.exports = CircleToCircle; /***/ }), -/* 217 */ +/* 223 */ /***/ (function(module, exports) { /** @@ -52505,7 +57311,7 @@ module.exports = CircleToRectangle; /***/ }), -/* 218 */ +/* 224 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52516,7 +57322,7 @@ module.exports = CircleToRectangle; */ var Point = __webpack_require__(4); -var LineToCircle = __webpack_require__(219); +var LineToCircle = __webpack_require__(225); /** * Checks for intersection between the line segment and circle, @@ -52597,7 +57403,7 @@ module.exports = GetLineToCircle; /***/ }), -/* 219 */ +/* 225 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52606,7 +57412,7 @@ module.exports = GetLineToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(57); +var Contains = __webpack_require__(62); var Point = __webpack_require__(4); var tmp = new Point(); @@ -52681,7 +57487,7 @@ module.exports = LineToCircle; /***/ }), -/* 220 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52692,8 +57498,8 @@ module.exports = LineToCircle; */ var Point = __webpack_require__(4); -var LineToLine = __webpack_require__(86); -var LineToRectangle = __webpack_require__(453); +var LineToLine = __webpack_require__(91); +var LineToRectangle = __webpack_require__(465); /** * Checks for intersection between the Line and a Rectangle shape, @@ -52741,7 +57547,7 @@ module.exports = GetLineToRectangle; /***/ }), -/* 221 */ +/* 227 */ /***/ (function(module, exports) { /** @@ -52828,7 +57634,7 @@ module.exports = ContainsArray; /***/ }), -/* 222 */ +/* 228 */ /***/ (function(module, exports) { /** @@ -52876,7 +57682,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 223 */ +/* 229 */ /***/ (function(module, exports) { /** @@ -52904,7 +57710,7 @@ module.exports = GetAspectRatio; /***/ }), -/* 224 */ +/* 230 */ /***/ (function(module, exports) { /** @@ -52958,7 +57764,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 225 */ +/* 231 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52973,18 +57779,18 @@ module.exports = RotateAroundXY; module.exports = { - BUTTON_DOWN: __webpack_require__(1226), - BUTTON_UP: __webpack_require__(1227), - CONNECTED: __webpack_require__(1228), - DISCONNECTED: __webpack_require__(1229), - GAMEPAD_BUTTON_DOWN: __webpack_require__(1230), - GAMEPAD_BUTTON_UP: __webpack_require__(1231) + BUTTON_DOWN: __webpack_require__(1290), + BUTTON_UP: __webpack_require__(1291), + CONNECTED: __webpack_require__(1292), + DISCONNECTED: __webpack_require__(1293), + GAMEPAD_BUTTON_DOWN: __webpack_require__(1294), + GAMEPAD_BUTTON_UP: __webpack_require__(1295) }; /***/ }), -/* 226 */ +/* 232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52993,8 +57799,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); -var XHRSettings = __webpack_require__(147); +var Extend = __webpack_require__(18); +var XHRSettings = __webpack_require__(149); /** * Takes two XHRSettings Objects and creates a new XHRSettings object from them. @@ -53032,7 +57838,7 @@ module.exports = MergeXHRSettings; /***/ }), -/* 227 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53042,12 +57848,12 @@ module.exports = MergeXHRSettings; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var ParseXML = __webpack_require__(375); +var ParseXML = __webpack_require__(385); /** * @classdesc @@ -53217,7 +58023,186 @@ module.exports = XMLFile; /***/ }), -/* 228 */ +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(19); +var File = __webpack_require__(22); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + * + * @class TextFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TextFile = new Class({ + + Extends: File, + + initialize: + + function TextFile (loader, key, url, xhrSettings) + { + var type = 'text'; + var extension = 'txt'; + var cache = loader.cacheManager.text; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); + } + + var fileConfig = { + type: type, + cache: cache, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.TextFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#text + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('text', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TextFile(this, key[i])); + } + } + else + { + this.addFile(new TextFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TextFile; + + +/***/ }), +/* 235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53232,26 +58217,27 @@ module.exports = XMLFile; module.exports = { - Acceleration: __webpack_require__(1285), - Angular: __webpack_require__(1286), - Bounce: __webpack_require__(1287), - Debug: __webpack_require__(1288), - Drag: __webpack_require__(1289), - Enable: __webpack_require__(1290), - Friction: __webpack_require__(1291), - Gravity: __webpack_require__(1292), - Immovable: __webpack_require__(1293), - Mass: __webpack_require__(1294), - OverlapCirc: __webpack_require__(484), - OverlapRect: __webpack_require__(229), - Size: __webpack_require__(1295), - Velocity: __webpack_require__(1296) + Acceleration: __webpack_require__(1348), + Angular: __webpack_require__(1349), + Bounce: __webpack_require__(1350), + Debug: __webpack_require__(1351), + Drag: __webpack_require__(1352), + Enable: __webpack_require__(1353), + Friction: __webpack_require__(1354), + Gravity: __webpack_require__(1355), + Immovable: __webpack_require__(1356), + Mass: __webpack_require__(1357), + OverlapCirc: __webpack_require__(500), + OverlapRect: __webpack_require__(236), + Pushable: __webpack_require__(1358), + Size: __webpack_require__(1359), + Velocity: __webpack_require__(1360) }; /***/ }), -/* 229 */ +/* 236 */ /***/ (function(module, exports) { /** @@ -53336,7 +58322,7 @@ module.exports = OverlapRect; /***/ }), -/* 230 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53351,20 +58337,20 @@ module.exports = OverlapRect; module.exports = { - COLLIDE: __webpack_require__(1297), - OVERLAP: __webpack_require__(1298), - PAUSE: __webpack_require__(1299), - RESUME: __webpack_require__(1300), - TILE_COLLIDE: __webpack_require__(1301), - TILE_OVERLAP: __webpack_require__(1302), - WORLD_BOUNDS: __webpack_require__(1303), - WORLD_STEP: __webpack_require__(1304) + COLLIDE: __webpack_require__(1361), + OVERLAP: __webpack_require__(1362), + PAUSE: __webpack_require__(1363), + RESUME: __webpack_require__(1364), + TILE_COLLIDE: __webpack_require__(1365), + TILE_OVERLAP: __webpack_require__(1366), + WORLD_BOUNDS: __webpack_require__(1367), + WORLD_STEP: __webpack_require__(1368) }; /***/ }), -/* 231 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53373,7 +58359,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); /** * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties @@ -53417,13 +58403,13 @@ var GetOverlapX = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.left = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.right = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.left = true; @@ -53447,13 +58433,13 @@ var GetOverlapX = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.right = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.left = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.right = true; @@ -53472,7 +58458,7 @@ module.exports = GetOverlapX; /***/ }), -/* 232 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53481,7 +58467,7 @@ module.exports = GetOverlapX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); /** * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties @@ -53525,13 +58511,13 @@ var GetOverlapY = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.up = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.down = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.up = true; @@ -53555,13 +58541,13 @@ var GetOverlapY = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.down = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.up = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.down = true; @@ -53580,7 +58566,7 @@ module.exports = GetOverlapY; /***/ }), -/* 233 */ +/* 240 */ /***/ (function(module, exports) { /** @@ -53616,8 +58602,8 @@ module.exports = TileIntersectsBody; /***/ }), -/* 234 */, -/* 235 */ +/* 241 */, +/* 242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53626,7 +58612,143 @@ module.exports = TileIntersectsBody; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(150); +var CONST = __webpack_require__(29); + +/** + * Get the Tilemap orientation from the given string. + * + * @function Phaser.Tilemaps.Orientation.FromOrientationString + * @since 3.50.0 + * + * @param {string} [orientation] - The orientation type as a string. + * + * @return {Phaser.Tilemaps.OrientationType} The Tilemap Orientation type. + */ +var FromOrientationString = function (orientation) +{ + orientation = orientation.toLowerCase(); + + if (orientation === 'isometric') + { + return CONST.ISOMETRIC; + } + else if (orientation === 'staggered') + { + return CONST.STAGGERED; + } + else if (orientation === 'hexagonal') + { + return CONST.HEXAGONAL; + } + else + { + return CONST.ORTHOGONAL; + } +}; + +module.exports = FromOrientationString; + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Components + */ + +module.exports = { + + CalculateFacesAt: __webpack_require__(244), + CalculateFacesWithin: __webpack_require__(60), + CheckIsoBounds: __webpack_require__(520), + Copy: __webpack_require__(1393), + CreateFromTiles: __webpack_require__(1394), + CullBounds: __webpack_require__(522), + CullTiles: __webpack_require__(523), + Fill: __webpack_require__(1395), + FilterTiles: __webpack_require__(1396), + FindByIndex: __webpack_require__(1397), + FindTile: __webpack_require__(1398), + ForEachTile: __webpack_require__(1399), + GetCullTilesFunction: __webpack_require__(1400), + GetTileAt: __webpack_require__(151), + GetTileAtWorldXY: __webpack_require__(1401), + GetTilesWithin: __webpack_require__(26), + GetTilesWithinShape: __webpack_require__(1402), + GetTilesWithinWorldXY: __webpack_require__(506), + GetTileToWorldXFunction: __webpack_require__(1403), + GetTileToWorldXYFunction: __webpack_require__(1404), + GetTileToWorldYFunction: __webpack_require__(1405), + GetWorldToTileXFunction: __webpack_require__(1406), + GetWorldToTileXYFunction: __webpack_require__(1407), + GetWorldToTileYFunction: __webpack_require__(1408), + HasTileAt: __webpack_require__(541), + HasTileAtWorldXY: __webpack_require__(1409), + HexagonalCullBounds: __webpack_require__(525), + HexagonalCullTiles: __webpack_require__(524), + HexagonalTileToWorldXY: __webpack_require__(529), + HexagonalTileToWorldY: __webpack_require__(533), + HexagonalWorldToTileXY: __webpack_require__(535), + HexagonalWorldToTileY: __webpack_require__(539), + IsInLayerBounds: __webpack_require__(116), + IsometricCullTiles: __webpack_require__(526), + IsometricTileToWorldXY: __webpack_require__(530), + IsometricWorldToTileXY: __webpack_require__(536), + PutTileAt: __webpack_require__(249), + PutTileAtWorldXY: __webpack_require__(1410), + PutTilesAt: __webpack_require__(1411), + Randomize: __webpack_require__(1412), + RemoveTileAt: __webpack_require__(542), + RemoveTileAtWorldXY: __webpack_require__(1413), + RenderDebug: __webpack_require__(1414), + ReplaceByIndex: __webpack_require__(521), + RunCull: __webpack_require__(152), + SetCollision: __webpack_require__(1415), + SetCollisionBetween: __webpack_require__(1416), + SetCollisionByExclusion: __webpack_require__(1417), + SetCollisionByProperty: __webpack_require__(1418), + SetCollisionFromCollisionGroup: __webpack_require__(1419), + SetLayerCollisionIndex: __webpack_require__(153), + SetTileCollision: __webpack_require__(69), + SetTileIndexCallback: __webpack_require__(1420), + SetTileLocationCallback: __webpack_require__(1421), + Shuffle: __webpack_require__(1422), + StaggeredCullBounds: __webpack_require__(528), + StaggeredCullTiles: __webpack_require__(527), + StaggeredTileToWorldXY: __webpack_require__(531), + StaggeredTileToWorldY: __webpack_require__(534), + StaggeredWorldToTileXY: __webpack_require__(537), + StaggeredWorldToTileY: __webpack_require__(540), + SwapByIndex: __webpack_require__(1423), + TileToWorldX: __webpack_require__(245), + TileToWorldXY: __webpack_require__(532), + TileToWorldY: __webpack_require__(246), + WeightedRandomize: __webpack_require__(1424), + WorldToTileX: __webpack_require__(247), + WorldToTileXY: __webpack_require__(538), + WorldToTileY: __webpack_require__(248) + +}; + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTileAt = __webpack_require__(151); /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting @@ -53636,8 +58758,8 @@ var GetTileAt = __webpack_require__(150); * @function Phaser.Tilemaps.Components.CalculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesAt = function (tileX, tileY, layer) @@ -53711,7 +58833,191 @@ module.exports = CalculateFacesAt; /***/ }), -/* 236 */ +/* 245 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.TileToWorldX + * @since 3.0.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} + */ +var TileToWorldX = function (tileX, camera, layer) +{ + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + var layerWorldX = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + } + + return layerWorldX + tileX * tileWidth; +}; + +module.exports = TileToWorldX; + + +/***/ }), +/* 246 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.TileToWorldY + * @since 3.0.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var TileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return layerWorldY + tileY * tileHeight; +}; + +module.exports = TileToWorldY; + + +/***/ }), +/* 247 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileX + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {?Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The X location in tile units. + */ +var WorldToTileX = function (worldX, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + return (snapToFloor) ? Math.floor(worldX / tileWidth) : worldX / tileWidth; +}; + +module.exports = WorldToTileX; + + +/***/ }), +/* 248 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileY + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {?Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var WorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return (snapToFloor) ? Math.floor(worldY / tileHeight) : worldY / tileHeight; +}; + +module.exports = WorldToTileY; + + +/***/ }), +/* 249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53720,10 +59026,10 @@ module.exports = CalculateFacesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(75); -var IsInLayerBounds = __webpack_require__(104); -var CalculateFacesAt = __webpack_require__(235); -var SetTileCollision = __webpack_require__(65); +var Tile = __webpack_require__(81); +var IsInLayerBounds = __webpack_require__(116); +var CalculateFacesAt = __webpack_require__(244); +var SetTileCollision = __webpack_require__(69); /** * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index @@ -53734,19 +59040,23 @@ var SetTileCollision = __webpack_require__(65); * @function Phaser.Tilemaps.Components.PutTileAt * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) { - if (!IsInLayerBounds(tileX, tileY, layer)) { return null; } if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!IsInLayerBounds(tileX, tileY, layer)) + { + return null; + } + var oldTile = layer.data[tileY][tileX]; var oldTileCollides = oldTile && oldTile.collides; @@ -53754,7 +59064,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) { if (layer.data[tileY][tileX] === null) { - layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, tile.width, tile.height); + layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, layer.tileWidth, layer.tileHeight); } layer.data[tileY][tileX].copy(tile); @@ -53792,7 +59102,7 @@ module.exports = PutTileAt; /***/ }), -/* 237 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53801,10 +59111,10 @@ module.exports = PutTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var LayerData = __webpack_require__(105); -var MapData = __webpack_require__(106); -var Tile = __webpack_require__(75); +var Formats = __webpack_require__(38); +var LayerData = __webpack_require__(117); +var MapData = __webpack_require__(118); +var Tile = __webpack_require__(81); /** * Parses a 2D array of tile indexes into a new MapData object with a single layer. @@ -53813,9 +59123,9 @@ var Tile = __webpack_require__(75); * @since 3.0.0 * * @param {string} name - The name of the tilemap, used to set the name on the MapData. - * @param {integer[][]} data - 2D array, CSV string or Tiled JSON object. - * @param {integer} tileWidth - The width of a tile in pixels. - * @param {integer} tileHeight - The height of a tile in pixels. + * @param {number[][]} data - 2D array, CSV string or Tiled JSON object. + * @param {number} tileWidth - The width of a tile in pixels. + * @param {number} tileHeight - The height of a tile in pixels. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty * location will get a Tile object with an index of -1. If you've a large sparsely populated map and @@ -53831,7 +59141,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull) tileWidth: tileWidth, tileHeight: tileHeight }); - + var mapData = new MapData({ name: name, tileWidth: tileWidth, @@ -53884,7 +59194,87 @@ module.exports = Parse2DArray; /***/ }), -/* 238 */ +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Pick = __webpack_require__(550); +var ParseGID = __webpack_require__(252); + +var copyPoints = function (p) { return { x: p.x, y: p.y }; }; + +var commonObjectProps = [ 'id', 'name', 'type', 'rotation', 'properties', 'visible', 'x', 'y', 'width', 'height' ]; + +/** + * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseObject + * @since 3.0.0 + * + * @param {object} tiledObject - Tiled object to convert to an internal parsed object normalising and copying properties over. + * @param {number} [offsetX=0] - Optional additional offset to apply to the object's x property. Defaults to 0. + * @param {number} [offsetY=0] - Optional additional offset to apply to the object's y property. Defaults to 0. + * + * @return {object} The parsed object containing properties read from the Tiled object according to it's type with x and y values updated according to the given offsets. + */ +var ParseObject = function (tiledObject, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + var parsedObject = Pick(tiledObject, commonObjectProps); + + parsedObject.x += offsetX; + parsedObject.y += offsetY; + + if (tiledObject.gid) + { + // Object tiles + var gidInfo = ParseGID(tiledObject.gid); + parsedObject.gid = gidInfo.gid; + parsedObject.flippedHorizontal = gidInfo.flippedHorizontal; + parsedObject.flippedVertical = gidInfo.flippedVertical; + parsedObject.flippedAntiDiagonal = gidInfo.flippedAntiDiagonal; + } + else if (tiledObject.polyline) + { + parsedObject.polyline = tiledObject.polyline.map(copyPoints); + } + else if (tiledObject.polygon) + { + parsedObject.polygon = tiledObject.polygon.map(copyPoints); + } + else if (tiledObject.ellipse) + { + parsedObject.ellipse = tiledObject.ellipse; + } + else if (tiledObject.text) + { + parsedObject.text = tiledObject.text; + } + else if (tiledObject.point) + { + parsedObject.point = true; + } + else + { + // Otherwise, assume it is a rectangle + parsedObject.rectangle = true; + } + + return parsedObject; +}; + +module.exports = ParseObject; + + +/***/ }), +/* 252 */ /***/ (function(module, exports) { /** @@ -53974,7 +59364,7 @@ module.exports = ParseGID; /***/ }), -/* 239 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53983,90 +59373,10 @@ module.exports = ParseGID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pick = __webpack_require__(514); -var ParseGID = __webpack_require__(238); - -var copyPoints = function (p) { return { x: p.x, y: p.y }; }; - -var commonObjectProps = [ 'id', 'name', 'type', 'rotation', 'properties', 'visible', 'x', 'y', 'width', 'height' ]; - -/** - * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) - * - * @function Phaser.Tilemaps.Parsers.Tiled.ParseObject - * @since 3.0.0 - * - * @param {object} tiledObject - Tiled object to convert to an internal parsed object normalising and copying properties over. - * @param {number} [offsetX=0] - Optional additional offset to apply to the object's x property. Defaults to 0. - * @param {number} [offsetY=0] - Optional additional offset to apply to the object's y property. Defaults to 0. - * - * @return {object} The parsed object containing properties read from the Tiled object according to it's type with x and y values updated according to the given offsets. - */ -var ParseObject = function (tiledObject, offsetX, offsetY) -{ - if (offsetX === undefined) { offsetX = 0; } - if (offsetY === undefined) { offsetY = 0; } - - var parsedObject = Pick(tiledObject, commonObjectProps); - - parsedObject.x += offsetX; - parsedObject.y += offsetY; - - if (tiledObject.gid) - { - // Object tiles - var gidInfo = ParseGID(tiledObject.gid); - parsedObject.gid = gidInfo.gid; - parsedObject.flippedHorizontal = gidInfo.flippedHorizontal; - parsedObject.flippedVertical = gidInfo.flippedVertical; - parsedObject.flippedAntiDiagonal = gidInfo.flippedAntiDiagonal; - } - else if (tiledObject.polyline) - { - parsedObject.polyline = tiledObject.polyline.map(copyPoints); - } - else if (tiledObject.polygon) - { - parsedObject.polygon = tiledObject.polygon.map(copyPoints); - } - else if (tiledObject.ellipse) - { - parsedObject.ellipse = tiledObject.ellipse; - } - else if (tiledObject.text) - { - parsedObject.text = tiledObject.text; - } - else if (tiledObject.point) - { - parsedObject.point = true; - } - else - { - // Otherwise, assume it is a rectangle - parsedObject.rectangle = true; - } - - return parsedObject; -}; - -module.exports = ParseObject; - - -/***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Formats = __webpack_require__(33); -var MapData = __webpack_require__(106); -var Parse = __webpack_require__(506); -var Tilemap = __webpack_require__(522); +var Formats = __webpack_require__(38); +var MapData = __webpack_require__(118); +var Parse = __webpack_require__(543); +var Tilemap = __webpack_require__(559); /** * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When @@ -54076,14 +59386,14 @@ var Tilemap = __webpack_require__(522); * * @function Phaser.Tilemaps.ParseToTilemap * @since 3.0.0 - * + * * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs. * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param {integer} [tileWidth=32] - The width of a tile in pixels. - * @param {integer} [tileHeight=32] - The height of a tile in pixels. - * @param {integer} [width=10] - The width of the map in tiles. - * @param {integer} [height=10] - The height of the map in tiles. - * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * @param {number} [tileWidth=32] - The width of a tile in pixels. + * @param {number} [tileHeight=32] - The height of a tile in pixels. + * @param {number} [width=10] - The width of the map in tiles. + * @param {number} [height=10] - The height of the map in tiles. + * @param {number[][]} [data] - Instead of loading from the cache, you can also load directly from * a 2D array of tile indexes. * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty @@ -54091,7 +59401,7 @@ var Tilemap = __webpack_require__(522); * the tile data doesn't need to change then setting this value to `true` will help with memory * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. - * + * * @return {Phaser.Tilemaps.Tilemap} */ var ParseToTilemap = function (scene, key, tileWidth, tileHeight, width, height, data, insertNull) @@ -54140,7 +59450,7 @@ module.exports = ParseToTilemap; /***/ }), -/* 241 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54189,7 +59499,7 @@ module.exports = GetTargets; /***/ }), -/* 242 */ +/* 255 */ /***/ (function(module, exports) { /** @@ -54457,7 +59767,7 @@ module.exports = GetValueOp; /***/ }), -/* 243 */ +/* 256 */ /***/ (function(module, exports) { /** @@ -54501,7 +59811,7 @@ module.exports = TWEEN_DEFAULTS; /***/ }), -/* 244 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54511,11 +59821,11 @@ module.exports = TWEEN_DEFAULTS; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(245); -var GameObjectCreator = __webpack_require__(16); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(258); +var GameObjectCreator = __webpack_require__(17); var GameObjectFactory = __webpack_require__(5); -var TWEEN_CONST = __webpack_require__(91); +var TWEEN_CONST = __webpack_require__(96); var MATH_CONST = __webpack_require__(13); /** @@ -54576,7 +59886,7 @@ var Tween = new Class({ * The cached length of the data array. * * @name Phaser.Tweens.Tween#totalData - * @type {integer} + * @type {number} * @since 3.0.0 */ this.totalData = data.length; @@ -54594,7 +59904,7 @@ var Tween = new Class({ * Cached target total (not necessarily the same as the data total) * * @name Phaser.Tweens.Tween#totalTargets - * @type {integer} + * @type {number} * @since 3.0.0 */ this.totalTargets = targets.length; @@ -54729,7 +60039,7 @@ var Tween = new Class({ * The current state of the tween * * @name Phaser.Tweens.Tween#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = TWEEN_CONST.PENDING_ADD; @@ -54738,7 +60048,7 @@ var Tween = new Class({ * The state of the tween when it was paused (used by Resume) * * @name Phaser.Tweens.Tween#_pausedState - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -54858,7 +60168,7 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#getValue * @since 3.0.0 * - * @param {integer} [index=0] - The Tween Data to return the value from. + * @param {number} [index=0] - The Tween Data to return the value from. * * @return {number} The value of the requested Tween Data. */ @@ -55790,7 +61100,7 @@ var Tween = new Class({ * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. * - * @return {integer} The state of this Tween. + * @return {number} The state of this Tween. */ setStateFromEnd: function (tween, tweenData, diff) { @@ -55876,7 +61186,7 @@ var Tween = new Class({ * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. * - * @return {integer} The state of this Tween. + * @return {number} The state of this Tween. */ setStateFromStart: function (tween, tweenData, diff) { @@ -56144,7 +61454,7 @@ module.exports = Tween; /***/ }), -/* 245 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56159,26 +61469,26 @@ module.exports = Tween; module.exports = { - TIMELINE_COMPLETE: __webpack_require__(1376), - TIMELINE_LOOP: __webpack_require__(1377), - TIMELINE_PAUSE: __webpack_require__(1378), - TIMELINE_RESUME: __webpack_require__(1379), - TIMELINE_START: __webpack_require__(1380), - TIMELINE_UPDATE: __webpack_require__(1381), - TWEEN_ACTIVE: __webpack_require__(1382), - TWEEN_COMPLETE: __webpack_require__(1383), - TWEEN_LOOP: __webpack_require__(1384), - TWEEN_REPEAT: __webpack_require__(1385), - TWEEN_START: __webpack_require__(1386), - TWEEN_STOP: __webpack_require__(1387), - TWEEN_UPDATE: __webpack_require__(1388), - TWEEN_YOYO: __webpack_require__(1389) + TIMELINE_COMPLETE: __webpack_require__(1438), + TIMELINE_LOOP: __webpack_require__(1439), + TIMELINE_PAUSE: __webpack_require__(1440), + TIMELINE_RESUME: __webpack_require__(1441), + TIMELINE_START: __webpack_require__(1442), + TIMELINE_UPDATE: __webpack_require__(1443), + TWEEN_ACTIVE: __webpack_require__(1444), + TWEEN_COMPLETE: __webpack_require__(1445), + TWEEN_LOOP: __webpack_require__(1446), + TWEEN_REPEAT: __webpack_require__(1447), + TWEEN_START: __webpack_require__(1448), + TWEEN_STOP: __webpack_require__(1449), + TWEEN_UPDATE: __webpack_require__(1450), + TWEEN_YOYO: __webpack_require__(1451) }; /***/ }), -/* 246 */ +/* 259 */ /***/ (function(module, exports) { /** @@ -56198,7 +61508,7 @@ module.exports = { * @since 3.0.0 * * @param {any} target - The target to tween. - * @param {integer} index - The target index within the Tween targets array. + * @param {number} index - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. * @param {function} getEnd - What the property will be at the END of the Tween. * @param {function} getStart - What the property will be at the START of the Tween. @@ -56305,7 +61615,7 @@ module.exports = TweenData; /***/ }), -/* 247 */ +/* 260 */ /***/ (function(module, exports) { /** @@ -56327,7 +61637,7 @@ var ScaleModes = { * Default Scale Mode (Linear). * * @name Phaser.ScaleModes.DEFAULT - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -56337,7 +61647,7 @@ var ScaleModes = { * Linear Scale Mode. * * @name Phaser.ScaleModes.LINEAR - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -56347,7 +61657,7 @@ var ScaleModes = { * Nearest Scale Mode. * * @name Phaser.ScaleModes.NEAREST - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -56359,7 +61669,7 @@ module.exports = ScaleModes; /***/ }), -/* 248 */ +/* 261 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56368,7 +61678,7 @@ module.exports = ScaleModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathWrap = __webpack_require__(59); +var MathWrap = __webpack_require__(64); /** * Wrap an angle. @@ -56391,7 +61701,7 @@ module.exports = Wrap; /***/ }), -/* 249 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56400,7 +61710,7 @@ module.exports = Wrap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * Wrap an angle in degrees. @@ -56423,9 +61733,1013 @@ module.exports = WrapDegrees; /***/ }), -/* 250 */, -/* 251 */, -/* 252 */ +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(190); + +/** + * @classdesc + * A Render Target encapsulates a WebGL framebuffer and the WebGL Texture that displays it. + * + * Instances of this class are typically created by, and belong to WebGL Pipelines, however + * other Game Objects and classes can take advantage of Render Targets as well. + * + * @class RenderTarget + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the WebGLRenderer. + * @param {number} width - The width of this Render Target. + * @param {number} height - The height of this Render Target. + * @param {number} [scale=1] - A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. + * @param {number} [minFilter=0] - The minFilter mode of the texture when created. 0 is `LINEAR`, 1 is `NEAREST`. + * @param {boolean} [autoClear=true] - Automatically clear this framebuffer when bound? + * @param {boolean} [autoResize=false] - Automatically resize this Render Target if the WebGL Renderer resizes? + */ +var RenderTarget = new Class({ + + initialize: + + function RenderTarget (renderer, width, height, scale, minFilter, autoClear, autoResize) + { + if (scale === undefined) { scale = 1; } + if (minFilter === undefined) { minFilter = 0; } + if (autoClear === undefined) { autoClear = true; } + if (autoResize === undefined) { autoResize = false; } + + /** + * A reference to the WebGLRenderer instance. + * + * @name Phaser.Renderer.WebGL.RenderTarget#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.50.0 + */ + this.renderer = renderer; + + /** + * The WebGLFramebuffer of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#framebuffer + * @type {WebGLFramebuffer} + * @since 3.50.0 + */ + this.framebuffer = null; + + /** + * The WebGLTexture of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#texture + * @type {WebGLTexture} + * @since 3.50.0 + */ + this.texture = null; + + /** + * The width of the texture. + * + * @name Phaser.Renderer.WebGL.RenderTarget#width + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.width = 0; + + /** + * The height of the texture. + * + * @name Phaser.Renderer.WebGL.RenderTarget#height + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.height = 0; + + /** + * A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. + * + * A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc. + * + * @name Phaser.Renderer.WebGL.RenderTarget#scale + * @type {number} + * @since 3.50.0 + */ + this.scale = scale; + + /** + * The minFilter mode of the texture. 0 is `LINEAR`, 1 is `NEAREST`. + * + * @name Phaser.Renderer.WebGL.RenderTarget#minFilter + * @type {number} + * @since 3.50.0 + */ + this.minFilter = minFilter; + + /** + * Controls if this Render Target is automatically cleared (via `gl.COLOR_BUFFER_BIT`) + * during the `RenderTarget.bind` method. + * + * If you need more control over how, or if, the target is cleared, you can disable + * this via the config on creation, or even toggle it directly at runtime. + * + * @name Phaser.Renderer.WebGL.RenderTarget#autoClear + * @type {boolean} + * @since 3.50.0 + */ + this.autoClear = autoClear; + + /** + * Does this Render Target automatically resize when the WebGL Renderer does? + * + * Modify this property via the `setAutoResize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#autoResize + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.autoResize = false; + + this.resize(width, height); + + if (autoResize) + { + this.setAutoResize(true); + } + }, + + /** + * Sets if this Render Target should automatically resize when the WebGL Renderer + * emits a resize event. + * + * @method Phaser.Renderer.WebGL.RenderTarget#setAutoResize + * @since 3.50.0 + * + * @param {boolean} autoResize - Automatically resize this Render Target when the WebGL Renderer resizes? + * + * @return {this} This RenderTarget instance. + */ + setAutoResize: function (autoResize) + { + if (autoResize && !this.autoResize) + { + this.renderer.on(Events.RESIZE, this.resize, this); + + this.autoResize = true; + } + else if (!autoResize && this.autoResize) + { + this.renderer.off(Events.RESIZE, this.resize, this); + + this.autoResize = false; + } + + return this; + }, + + /** + * Resizes this Render Target. + * + * Deletes both the frame buffer and texture, if they exist and then re-creates + * them using the new sizes. + * + * This method is called automatically by the pipeline during its resize handler. + * + * @method Phaser.Renderer.WebGL.RenderTarget#resize + * @since 3.50.0 + * + * @param {number} width - The new width of this Render Target. + * @param {number} height - The new height of this Render Target. + * + * @return {this} This RenderTarget instance. + */ + resize: function (width, height) + { + var renderer = this.renderer; + + renderer.deleteFramebuffer(this.framebuffer); + + renderer.deleteTexture(this.texture); + + width *= this.scale; + height *= this.scale; + + this.texture = renderer.createTextureFromSource(null, width, height, this.minFilter); + this.framebuffer = renderer.createFramebuffer(width, height, this.texture, false); + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Pushes this Render Target as the current frame buffer of the renderer. + * + * If `autoClear` is set, then clears the texture. + * + * If `adjustViewport` is `true` then it will flush the renderer and then adjust the GL viewport. + * + * @method Phaser.Renderer.WebGL.RenderTarget#bind + * @since 3.50.0 + * + * @param {boolean} [adjustViewport=false] - Adjust the GL viewport by calling `RenderTarget.adjustViewport` ? + */ + bind: function (adjustViewport) + { + if (adjustViewport === undefined) { adjustViewport = false; } + + if (adjustViewport) + { + this.renderer.flush(); + } + + this.renderer.pushFramebuffer(this.framebuffer, false, false, false); + + if (this.autoClear) + { + var gl = this.renderer.gl; + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + if (adjustViewport) + { + this.adjustViewport(); + } + }, + + /** + * Adjusts the GL viewport to match the WebGL Renderer width and height, + * with a y offset of `RenderTarget.height` - `WebGLRenderer.height`. + * + * @method Phaser.Renderer.WebGL.RenderTarget#adjustViewport + * @since 3.50.0 + */ + adjustViewport: function () + { + var renderer = this.renderer; + + var textureWidth = this.width; + var textureHeight = this.height; + + renderer.gl.viewport(0, 0, textureWidth, textureHeight); + renderer.gl.disable(renderer.gl.SCISSOR_TEST); + }, + + /** + * Clears this Render Target. + * + * @method Phaser.Renderer.WebGL.RenderTarget#clear + * @since 3.50.0 + */ + clear: function () + { + this.renderer.pushFramebuffer(this.framebuffer); + + var gl = this.renderer.gl; + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + + this.renderer.popFramebuffer(); + }, + + /** + * Unbinds this Render Target and optionally flushes the WebGL Renderer first. + * + * @name Phaser.Renderer.WebGL.RenderTarget#unbind + * @since 3.50.0 + * + * @param {boolean} [flush=false] - Flush the WebGL Renderer before unbinding? + * + * @return {WebGLFramebuffer} The Framebuffer that was set, or `null` if there aren't any more in the stack. + */ + unbind: function (flush) + { + if (flush === undefined) { flush = false; } + + var renderer = this.renderer; + + if (flush) + { + renderer.flush(); + + renderer.gl.enable(renderer.gl.SCISSOR_TEST); + + var scissor = renderer.currentScissor; + + if (scissor) + { + var x = scissor[0]; + var y = scissor[1]; + var width = scissor[2]; + var height = scissor[3]; + + renderer.gl.scissor(x, (renderer.drawingBufferHeight - y - height), width, height); + } + } + + return renderer.popFramebuffer(); + }, + + /** + * Removes all external references from this class and deletes the + * WebGL framebuffer and texture instances. + * + * Does not remove this Render Target from the parent pipeline. + * + * @name Phaser.Renderer.WebGL.RenderTarget#destroy + * @since 3.50.0 + */ + destroy: function () + { + var renderer = this.renderer; + + renderer.deleteFramebuffer(this.framebuffer); + renderer.deleteTexture(this.texture); + + renderer.off(Events.RESIZE, this.resize, this); + + this.renderer = null; + this.framebuffer = null; + this.texture = null; + } + +}); + +module.exports = RenderTarget; + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. + * + * Use the method `getData` to return a Float32Array containing the current color values. + * + * @class ColorMatrix + * @memberof Phaser.Display + * @constructor + * @since 3.50.0 + */ +var ColorMatrix = new Class({ + + initialize: + + function ColorMatrix () + { + /** + * Internal ColorMatrix array. + * + * @name Phaser.Display.ColorMatrix#_matrix + * @type {number[]} + * @private + * @since 3.50.0 + */ + this._matrix = [ + 1, 0, 0, 0, 0, + 0, 1, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0 + ]; + + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + * + * @name Phaser.Display.ColorMatrix#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = 1; + + /** + * Is the ColorMatrix array dirty? + * + * @name Phaser.Display.ColorMatrix#_dirty + * @type {boolean} + * @private + * @since 3.50.0 + */ + this._dirty = true; + + /** + * The matrix data as a Float32Array. + * + * Returned by the `getData` method. + * + * @name Phaser.Display.ColorMatrix#data + * @type {Float32Array} + * @private + * @since 3.50.0 + */ + this._data; + }, + + /** + * Sets this ColorMatrix from the given array of color values. + * + * @method Phaser.Display.ColorMatrix#set + * @since 3.50.0 + * + * @param {number[]} value - The ColorMatrix values to set. + * + * @return {this} This ColorMatrix instance. + */ + set: function (value) + { + this._matrix = value; + + this._dirty = true; + + return this; + }, + + /** + * Resets the ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#reset + * @since 3.50.0 + * + * @return {this} This ColorMatrix instance. + */ + reset: function () + { + // Long-winded, but saves on gc, which happens a lot in Post FX Shaders + // that reset the ColorMatrix every frame. + + var m = this._matrix; + + m[0] = 1; + m[1] = 0; + m[2] = 0; + m[3] = 0; + m[4] = 0; + + m[5] = 0; + m[6] = 1; + m[7] = 0; + m[8] = 0; + m[9] = 0; + + m[10] = 0; + m[11] = 0; + m[12] = 1; + m[13] = 0; + m[14] = 0; + + m[15] = 0; + m[16] = 0; + m[17] = 0; + m[18] = 1; + m[19] = 0; + + this._dirty = true; + + return this; + }, + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + * + * @method Phaser.Display.ColorMatrix#getData + * @since 3.50.0 + * + * @return {Float32Array} The ColorMatrix as a Float32Array. + */ + getData: function () + { + if (this._dirty) + { + var f32 = new Float32Array(this._matrix); + + f32[4] /= 255; + f32[9] /= 255; + f32[14] /= 255; + f32[19] /= 255; + + this._data = f32; + + this._dirty = false; + } + + return this._data; + }, + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#brightness + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brightness: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var b = value; + + return this.multiply([ + b, 0, 0, 0, 0, + 0, b, 0, 0, 0, + 0, 0, b, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#saturate + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of saturation to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + saturate: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var x = (value * 2 / 3) + 1; + var y = ((x - 1) * -0.5); + + return this.multiply([ + x, y, y, 0, 0, + y, x, y, 0, 0, + y, y, x, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Desaturates this ColorMatrix (removes color from it). + * + * @method Phaser.Display.ColorMatrix#saturation + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturate: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.saturate(-1, multiply); + }, + + /** + * Rotates the hues of this ColorMatrix by the value given. + * + * @method Phaser.Display.ColorMatrix#hue + * @since 3.50.0 + * + * @param {number} [rotation=0] - The amount of hue rotation to apply to this ColorMatrix, in degrees. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + hue: function (rotation, multiply) + { + if (rotation === undefined) { rotation = 0; } + if (multiply === undefined) { multiply = false; } + + rotation = rotation / 180 * Math.PI; + + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + var lumR = 0.213; + var lumG = 0.715; + var lumB = 0.072; + + return this.multiply([ + lumR + cos * (1 - lumR) + sin * (-lumR),lumG + cos * (-lumG) + sin * (-lumG),lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0, + lumR + cos * (-lumR) + sin * (0.143),lumG + cos * (1 - lumG) + sin * (0.140),lumB + cos * (-lumB) + sin * (-0.283), 0, 0, + lumR + cos * (-lumR) + sin * (-(1 - lumR)),lumG + cos * (-lumG) + sin * (lumG),lumB + cos * (1 - lumB) + sin * (lumB), 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Sets this ColorMatrix to be grayscale. + * + * @method Phaser.Display.ColorMatrix#grayscale + * @since 3.50.0 + * + * @param {number} [value=1] - The grayscale scale (0 is black). + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + grayscale: function (value, multiply) + { + if (value === undefined) { value = 1; } + if (multiply === undefined) { multiply = false; } + + return this.saturate(-value, multiply); + }, + + /** + * Sets this ColorMatrix to be black and white. + * + * @method Phaser.Display.ColorMatrix#blackWhite + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + blackWhite: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.3, 0.6, 0.1, 0, 0, + 0.3, 0.6, 0.1, 0, 0, + 0.3, 0.6, 0.1, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Change the contrast of this ColorMatrix by the amount given. + * + * @method Phaser.Display.ColorMatrix#contrast + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of contrast to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + contrast: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var v = value + 1; + var o = -0.5 * (v - 1); + + return this.multiply([ + v, 0, 0, 0, o, + 0, v, 0, 0, o, + 0, 0, v, 0, o, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Converts this ColorMatrix to have negative values. + * + * @method Phaser.Display.ColorMatrix#negative + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + negative: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + -1, 0, 0, 1, 0, + 0, -1, 0, 1, 0, + 0, 0, -1, 1, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Apply a desaturated luminance to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#desaturateLuminance + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturateLuminance: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a sepia tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#sepia + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + sepia: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.393, 0.7689999, 0.18899999, 0, 0, + 0.349, 0.6859999, 0.16799999, 0, 0, + 0.272, 0.5339999, 0.13099999, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a night vision tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#night + * @since 3.50.0 + * + * @param {number} [intensity=0.1] - The intensity of this effect. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + night: function (intensity, multiply) + { + if (intensity === undefined) { intensity = 0.1; } + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + intensity * (-2.0), -intensity, 0, 0, 0, + -intensity, 0, intensity, 0, 0, + 0, intensity, intensity * 2.0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a trippy color tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#lsd + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + lsd: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 2, -0.4, 0.5, 0, 0, + -0.5, 2, -0.4, 0, 0, + -0.4, -0.5, 3, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a brown tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#brown + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brown: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, + -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, + 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#vintagePinhole + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + vintagePinhole: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, + 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, + 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#kodachrome + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + kodachrome: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, + -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, + -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a technicolor color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#technicolor + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + technicolor: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, + -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, + -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a polaroid color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#polaroid + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + polaroid: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.438, -0.062, -0.062, 0, 0, + -0.122, 1.378, -0.122, 0, 0, + -0.016, -0.016, 1.483, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Shifts the values of this ColorMatrix into BGR order. + * + * @method Phaser.Display.ColorMatrix#shiftToBGR + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + shiftToBGR: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, + 1, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Multiplies the two given matrices. + * + * @method Phaser.Display.ColorMatrix#multiply + * @since 3.50.0 + * + * @param {number[]} a - The 5x4 array to multiply with ColorMatrix._matrix. + * + * @return {this} This ColorMatrix instance. + */ + multiply: function (a, multiply) + { + // Duplicate _matrix into c + + if (!multiply) + { + this.reset(); + } + + var m = this._matrix; + var c = []; + + for (var i = 0; i < 20; i++) + { + c[i] = m[i]; + } + + // R + m[0] = (c[0] * a[0]) + (c[1] * a[5]) + (c[2] * a[10]) + (c[3] * a[15]); + m[1] = (c[0] * a[1]) + (c[1] * a[6]) + (c[2] * a[11]) + (c[3] * a[16]); + m[2] = (c[0] * a[2]) + (c[1] * a[7]) + (c[2] * a[12]) + (c[3] * a[17]); + m[3] = (c[0] * a[3]) + (c[1] * a[8]) + (c[2] * a[13]) + (c[3] * a[18]); + m[4] = (c[0] * a[4]) + (c[1] * a[9]) + (c[2] * a[14]) + (c[3] * a[19]) + c[4]; + + // G + m[5] = (c[5] * a[0]) + (c[6] * a[5]) + (c[7] * a[10]) + (c[8] * a[15]); + m[6] = (c[5] * a[1]) + (c[6] * a[6]) + (c[7] * a[11]) + (c[8] * a[16]); + m[7] = (c[5] * a[2]) + (c[6] * a[7]) + (c[7] * a[12]) + (c[8] * a[17]); + m[8] = (c[5] * a[3]) + (c[6] * a[8]) + (c[7] * a[13]) + (c[8] * a[18]); + m[9] = (c[5] * a[4]) + (c[6] * a[9]) + (c[7] * a[14]) + (c[8] * a[19]) + c[9]; + + // B + m[10] = (c[10] * a[0]) + (c[11] * a[5]) + (c[12] * a[10]) + (c[13] * a[15]); + m[11] = (c[10] * a[1]) + (c[11] * a[6]) + (c[12] * a[11]) + (c[13] * a[16]); + m[12] = (c[10] * a[2]) + (c[11] * a[7]) + (c[12] * a[12]) + (c[13] * a[17]); + m[13] = (c[10] * a[3]) + (c[11] * a[8]) + (c[12] * a[13]) + (c[13] * a[18]); + m[14] = (c[10] * a[4]) + (c[11] * a[9]) + (c[12] * a[14]) + (c[13] * a[19]) + c[14]; + + // A + m[15] = (c[15] * a[0]) + (c[16] * a[5]) + (c[17] * a[10]) + (c[18] * a[15]); + m[16] = (c[15] * a[1]) + (c[16] * a[6]) + (c[17] * a[11]) + (c[18] * a[16]); + m[17] = (c[15] * a[2]) + (c[16] * a[7]) + (c[17] * a[12]) + (c[18] * a[17]); + m[18] = (c[15] * a[3]) + (c[16] * a[8]) + (c[17] * a[13]) + (c[18] * a[18]); + m[19] = (c[15] * a[4]) + (c[16] * a[9]) + (c[17] * a[14]) + (c[18] * a[19]) + c[19]; + + this._dirty = true; + + return this; + } + +}); + +module.exports = ColorMatrix; + + +/***/ }), +/* 265 */, +/* 266 */, +/* 267 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56440,65 +62754,65 @@ module.exports = WrapDegrees; module.exports = { - AlignTo: __webpack_require__(556), - Angle: __webpack_require__(557), - Call: __webpack_require__(558), - GetFirst: __webpack_require__(559), - GetLast: __webpack_require__(560), - GridAlign: __webpack_require__(561), - IncAlpha: __webpack_require__(606), - IncX: __webpack_require__(607), - IncXY: __webpack_require__(608), - IncY: __webpack_require__(609), - PlaceOnCircle: __webpack_require__(610), - PlaceOnEllipse: __webpack_require__(611), - PlaceOnLine: __webpack_require__(612), - PlaceOnRectangle: __webpack_require__(613), - PlaceOnTriangle: __webpack_require__(614), - PlayAnimation: __webpack_require__(615), - PropertyValueInc: __webpack_require__(39), - PropertyValueSet: __webpack_require__(25), - RandomCircle: __webpack_require__(616), - RandomEllipse: __webpack_require__(617), - RandomLine: __webpack_require__(618), - RandomRectangle: __webpack_require__(619), - RandomTriangle: __webpack_require__(620), - Rotate: __webpack_require__(621), - RotateAround: __webpack_require__(622), - RotateAroundDistance: __webpack_require__(623), - ScaleX: __webpack_require__(624), - ScaleXY: __webpack_require__(625), - ScaleY: __webpack_require__(626), - SetAlpha: __webpack_require__(627), - SetBlendMode: __webpack_require__(628), - SetDepth: __webpack_require__(629), - SetHitArea: __webpack_require__(630), - SetOrigin: __webpack_require__(631), - SetRotation: __webpack_require__(632), - SetScale: __webpack_require__(633), - SetScaleX: __webpack_require__(634), - SetScaleY: __webpack_require__(635), - SetScrollFactor: __webpack_require__(636), - SetScrollFactorX: __webpack_require__(637), - SetScrollFactorY: __webpack_require__(638), - SetTint: __webpack_require__(639), - SetVisible: __webpack_require__(640), - SetX: __webpack_require__(641), - SetXY: __webpack_require__(642), - SetY: __webpack_require__(643), - ShiftPosition: __webpack_require__(644), - Shuffle: __webpack_require__(645), - SmootherStep: __webpack_require__(646), - SmoothStep: __webpack_require__(647), - Spread: __webpack_require__(648), - ToggleVisible: __webpack_require__(649), - WrapInRectangle: __webpack_require__(650) + AlignTo: __webpack_require__(595), + Angle: __webpack_require__(596), + Call: __webpack_require__(597), + GetFirst: __webpack_require__(598), + GetLast: __webpack_require__(599), + GridAlign: __webpack_require__(600), + IncAlpha: __webpack_require__(646), + IncX: __webpack_require__(647), + IncXY: __webpack_require__(648), + IncY: __webpack_require__(649), + PlaceOnCircle: __webpack_require__(650), + PlaceOnEllipse: __webpack_require__(651), + PlaceOnLine: __webpack_require__(652), + PlaceOnRectangle: __webpack_require__(653), + PlaceOnTriangle: __webpack_require__(654), + PlayAnimation: __webpack_require__(655), + PropertyValueInc: __webpack_require__(44), + PropertyValueSet: __webpack_require__(27), + RandomCircle: __webpack_require__(656), + RandomEllipse: __webpack_require__(657), + RandomLine: __webpack_require__(658), + RandomRectangle: __webpack_require__(659), + RandomTriangle: __webpack_require__(660), + Rotate: __webpack_require__(661), + RotateAround: __webpack_require__(662), + RotateAroundDistance: __webpack_require__(663), + ScaleX: __webpack_require__(664), + ScaleXY: __webpack_require__(665), + ScaleY: __webpack_require__(666), + SetAlpha: __webpack_require__(667), + SetBlendMode: __webpack_require__(668), + SetDepth: __webpack_require__(669), + SetHitArea: __webpack_require__(670), + SetOrigin: __webpack_require__(671), + SetRotation: __webpack_require__(672), + SetScale: __webpack_require__(673), + SetScaleX: __webpack_require__(674), + SetScaleY: __webpack_require__(675), + SetScrollFactor: __webpack_require__(676), + SetScrollFactorX: __webpack_require__(677), + SetScrollFactorY: __webpack_require__(678), + SetTint: __webpack_require__(679), + SetVisible: __webpack_require__(680), + SetX: __webpack_require__(681), + SetXY: __webpack_require__(682), + SetY: __webpack_require__(683), + ShiftPosition: __webpack_require__(684), + Shuffle: __webpack_require__(685), + SmootherStep: __webpack_require__(686), + SmoothStep: __webpack_require__(687), + Spread: __webpack_require__(688), + ToggleVisible: __webpack_require__(689), + WrapInRectangle: __webpack_require__(690) }; /***/ }), -/* 253 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56507,22 +62821,22 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(108); +var ALIGN_CONST = __webpack_require__(120); var AlignToMap = []; -AlignToMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(254); -AlignToMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(255); -AlignToMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(256); -AlignToMap[ALIGN_CONST.LEFT_BOTTOM] = __webpack_require__(257); -AlignToMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(258); -AlignToMap[ALIGN_CONST.LEFT_TOP] = __webpack_require__(259); -AlignToMap[ALIGN_CONST.RIGHT_BOTTOM] = __webpack_require__(260); -AlignToMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(261); -AlignToMap[ALIGN_CONST.RIGHT_TOP] = __webpack_require__(262); -AlignToMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(263); -AlignToMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(264); -AlignToMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(265); +AlignToMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(269); +AlignToMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(270); +AlignToMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(271); +AlignToMap[ALIGN_CONST.LEFT_BOTTOM] = __webpack_require__(272); +AlignToMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(273); +AlignToMap[ALIGN_CONST.LEFT_TOP] = __webpack_require__(274); +AlignToMap[ALIGN_CONST.RIGHT_BOTTOM] = __webpack_require__(275); +AlignToMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(276); +AlignToMap[ALIGN_CONST.RIGHT_TOP] = __webpack_require__(277); +AlignToMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(278); +AlignToMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(279); +AlignToMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(280); /** * Takes a Game Object and aligns it next to another, at the given position. @@ -56535,7 +62849,7 @@ AlignToMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(265); * * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned. * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. - * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. + * @param {number} position - The position to align the Game Object with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * @@ -56550,7 +62864,7 @@ module.exports = QuickSet; /***/ }), -/* 254 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56559,10 +62873,10 @@ module.exports = QuickSet; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetCenterX = __webpack_require__(77); -var SetCenterX = __webpack_require__(78); -var SetTop = __webpack_require__(45); +var GetBottom = __webpack_require__(40); +var GetCenterX = __webpack_require__(83); +var SetCenterX = __webpack_require__(84); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. @@ -56594,7 +62908,7 @@ module.exports = BottomCenter; /***/ }), -/* 255 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56603,10 +62917,10 @@ module.exports = BottomCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var SetLeft = __webpack_require__(46); -var SetTop = __webpack_require__(45); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var SetLeft = __webpack_require__(52); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. @@ -56638,7 +62952,7 @@ module.exports = BottomLeft; /***/ }), -/* 256 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56647,10 +62961,10 @@ module.exports = BottomLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetRight = __webpack_require__(37); -var SetRight = __webpack_require__(47); -var SetTop = __webpack_require__(45); +var GetBottom = __webpack_require__(40); +var GetRight = __webpack_require__(42); +var SetRight = __webpack_require__(53); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. @@ -56682,7 +62996,7 @@ module.exports = BottomRight; /***/ }), -/* 257 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56691,10 +63005,10 @@ module.exports = BottomRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var SetBottom = __webpack_require__(48); -var SetRight = __webpack_require__(47); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var SetBottom = __webpack_require__(54); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. @@ -56726,7 +63040,7 @@ module.exports = LeftBottom; /***/ }), -/* 258 */ +/* 273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56735,10 +63049,10 @@ module.exports = LeftBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetLeft = __webpack_require__(36); -var SetCenterY = __webpack_require__(80); -var SetRight = __webpack_require__(47); +var GetCenterY = __webpack_require__(85); +var GetLeft = __webpack_require__(41); +var SetCenterY = __webpack_require__(86); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. @@ -56770,7 +63084,7 @@ module.exports = LeftCenter; /***/ }), -/* 259 */ +/* 274 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56779,10 +63093,10 @@ module.exports = LeftCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLeft = __webpack_require__(36); -var GetTop = __webpack_require__(38); -var SetRight = __webpack_require__(47); -var SetTop = __webpack_require__(45); +var GetLeft = __webpack_require__(41); +var GetTop = __webpack_require__(43); +var SetRight = __webpack_require__(53); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. @@ -56814,7 +63128,7 @@ module.exports = LeftTop; /***/ }), -/* 260 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56823,10 +63137,10 @@ module.exports = LeftTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetRight = __webpack_require__(37); -var SetBottom = __webpack_require__(48); -var SetLeft = __webpack_require__(46); +var GetBottom = __webpack_require__(40); +var GetRight = __webpack_require__(42); +var SetBottom = __webpack_require__(54); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. @@ -56858,7 +63172,7 @@ module.exports = RightBottom; /***/ }), -/* 261 */ +/* 276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56867,10 +63181,10 @@ module.exports = RightBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetRight = __webpack_require__(37); -var SetCenterY = __webpack_require__(80); -var SetLeft = __webpack_require__(46); +var GetCenterY = __webpack_require__(85); +var GetRight = __webpack_require__(42); +var SetCenterY = __webpack_require__(86); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. @@ -56902,7 +63216,7 @@ module.exports = RightCenter; /***/ }), -/* 262 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56911,10 +63225,10 @@ module.exports = RightCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); -var SetLeft = __webpack_require__(46); -var SetTop = __webpack_require__(45); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); +var SetLeft = __webpack_require__(52); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. @@ -56946,7 +63260,7 @@ module.exports = RightTop; /***/ }), -/* 263 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56955,10 +63269,10 @@ module.exports = RightTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(77); -var GetTop = __webpack_require__(38); -var SetBottom = __webpack_require__(48); -var SetCenterX = __webpack_require__(78); +var GetCenterX = __webpack_require__(83); +var GetTop = __webpack_require__(43); +var SetBottom = __webpack_require__(54); +var SetCenterX = __webpack_require__(84); /** * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other. @@ -56990,7 +63304,7 @@ module.exports = TopCenter; /***/ }), -/* 264 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56999,10 +63313,10 @@ module.exports = TopCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLeft = __webpack_require__(36); -var GetTop = __webpack_require__(38); -var SetBottom = __webpack_require__(48); -var SetLeft = __webpack_require__(46); +var GetLeft = __webpack_require__(41); +var GetTop = __webpack_require__(43); +var SetBottom = __webpack_require__(54); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. @@ -57034,7 +63348,7 @@ module.exports = TopLeft; /***/ }), -/* 265 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57043,10 +63357,10 @@ module.exports = TopLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); -var SetBottom = __webpack_require__(48); -var SetRight = __webpack_require__(47); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); +var SetBottom = __webpack_require__(54); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. @@ -57078,7 +63392,7 @@ module.exports = TopRight; /***/ }), -/* 266 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57087,19 +63401,19 @@ module.exports = TopRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(108); +var ALIGN_CONST = __webpack_require__(120); var AlignInMap = []; -AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(267); -AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(268); -AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(269); -AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(270); -AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(272); -AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(273); -AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(274); -AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(275); -AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(276); +AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(282); +AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(283); +AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(284); +AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(285); +AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(287); +AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(288); +AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(289); +AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(290); +AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(291); AlignInMap[ALIGN_CONST.LEFT_BOTTOM] = AlignInMap[ALIGN_CONST.BOTTOM_LEFT]; AlignInMap[ALIGN_CONST.LEFT_TOP] = AlignInMap[ALIGN_CONST.TOP_LEFT]; AlignInMap[ALIGN_CONST.RIGHT_BOTTOM] = AlignInMap[ALIGN_CONST.BOTTOM_RIGHT]; @@ -57116,7 +63430,7 @@ AlignInMap[ALIGN_CONST.RIGHT_TOP] = AlignInMap[ALIGN_CONST.TOP_RIGHT]; * * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned. * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. - * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. + * @param {number} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * @@ -57131,7 +63445,7 @@ module.exports = QuickSet; /***/ }), -/* 267 */ +/* 282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57140,10 +63454,10 @@ module.exports = QuickSet; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetCenterX = __webpack_require__(77); -var SetBottom = __webpack_require__(48); -var SetCenterX = __webpack_require__(78); +var GetBottom = __webpack_require__(40); +var GetCenterX = __webpack_require__(83); +var SetBottom = __webpack_require__(54); +var SetCenterX = __webpack_require__(84); /** * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other. @@ -57175,7 +63489,7 @@ module.exports = BottomCenter; /***/ }), -/* 268 */ +/* 283 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57184,10 +63498,10 @@ module.exports = BottomCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var SetBottom = __webpack_require__(48); -var SetLeft = __webpack_require__(46); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var SetBottom = __webpack_require__(54); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. @@ -57219,7 +63533,7 @@ module.exports = BottomLeft; /***/ }), -/* 269 */ +/* 284 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57228,10 +63542,10 @@ module.exports = BottomLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetRight = __webpack_require__(37); -var SetBottom = __webpack_require__(48); -var SetRight = __webpack_require__(47); +var GetBottom = __webpack_require__(40); +var GetRight = __webpack_require__(42); +var SetBottom = __webpack_require__(54); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. @@ -57263,7 +63577,7 @@ module.exports = BottomRight; /***/ }), -/* 270 */ +/* 285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57272,9 +63586,9 @@ module.exports = BottomRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(271); -var GetCenterX = __webpack_require__(77); -var GetCenterY = __webpack_require__(79); +var CenterOn = __webpack_require__(286); +var GetCenterX = __webpack_require__(83); +var GetCenterY = __webpack_require__(85); /** * Takes given Game Object and aligns it so that it is positioned in the center of the other. @@ -57305,7 +63619,7 @@ module.exports = Center; /***/ }), -/* 271 */ +/* 286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57314,8 +63628,8 @@ module.exports = Center; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetCenterX = __webpack_require__(78); -var SetCenterY = __webpack_require__(80); +var SetCenterX = __webpack_require__(84); +var SetCenterY = __webpack_require__(86); /** * Positions the Game Object so that it is centered on the given coordinates. @@ -57342,7 +63656,7 @@ module.exports = CenterOn; /***/ }), -/* 272 */ +/* 287 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57351,10 +63665,10 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetLeft = __webpack_require__(36); -var SetCenterY = __webpack_require__(80); -var SetLeft = __webpack_require__(46); +var GetCenterY = __webpack_require__(85); +var GetLeft = __webpack_require__(41); +var SetCenterY = __webpack_require__(86); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned in the left center of the other. @@ -57386,7 +63700,7 @@ module.exports = LeftCenter; /***/ }), -/* 273 */ +/* 288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57395,10 +63709,10 @@ module.exports = LeftCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetRight = __webpack_require__(37); -var SetCenterY = __webpack_require__(80); -var SetRight = __webpack_require__(47); +var GetCenterY = __webpack_require__(85); +var GetRight = __webpack_require__(42); +var SetCenterY = __webpack_require__(86); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned in the right center of the other. @@ -57430,7 +63744,7 @@ module.exports = RightCenter; /***/ }), -/* 274 */ +/* 289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57439,10 +63753,10 @@ module.exports = RightCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(77); -var GetTop = __webpack_require__(38); -var SetCenterX = __webpack_require__(78); -var SetTop = __webpack_require__(45); +var GetCenterX = __webpack_require__(83); +var GetTop = __webpack_require__(43); +var SetCenterX = __webpack_require__(84); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned in the top center of the other. @@ -57474,7 +63788,7 @@ module.exports = TopCenter; /***/ }), -/* 275 */ +/* 290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57483,10 +63797,10 @@ module.exports = TopCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLeft = __webpack_require__(36); -var GetTop = __webpack_require__(38); -var SetLeft = __webpack_require__(46); -var SetTop = __webpack_require__(45); +var GetLeft = __webpack_require__(41); +var GetTop = __webpack_require__(43); +var SetLeft = __webpack_require__(52); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned in the top left of the other. @@ -57518,7 +63832,7 @@ module.exports = TopLeft; /***/ }), -/* 276 */ +/* 291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57527,10 +63841,10 @@ module.exports = TopLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); -var SetRight = __webpack_require__(47); -var SetTop = __webpack_require__(45); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); +var SetRight = __webpack_require__(53); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned in the top right of the other. @@ -57562,7 +63876,7 @@ module.exports = TopRight; /***/ }), -/* 277 */ +/* 292 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57571,8 +63885,8 @@ module.exports = TopRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(159); -var FromPercent = __webpack_require__(89); +var CircumferencePoint = __webpack_require__(160); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); var Point = __webpack_require__(4); @@ -57605,7 +63919,7 @@ module.exports = GetPoint; /***/ }), -/* 278 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57614,9 +63928,9 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(279); -var CircumferencePoint = __webpack_require__(159); -var FromPercent = __webpack_require__(89); +var Circumference = __webpack_require__(294); +var CircumferencePoint = __webpack_require__(160); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); /** @@ -57627,7 +63941,7 @@ var MATH_CONST = __webpack_require__(13); * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -57657,7 +63971,7 @@ module.exports = GetPoints; /***/ }), -/* 279 */ +/* 294 */ /***/ (function(module, exports) { /** @@ -57685,7 +63999,7 @@ module.exports = Circumference; /***/ }), -/* 280 */ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57694,7 +64008,7 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -57795,7 +64109,7 @@ module.exports = AlphaSingle; /***/ }), -/* 281 */ +/* 296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57804,7 +64118,7 @@ module.exports = AlphaSingle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); +var BlendModes = __webpack_require__(48); /** * Provides methods used for setting the blend mode of a Game Object. @@ -57820,7 +64134,7 @@ var BlendMode = { * Private internal value. Holds the current blend mode. * * @name Phaser.GameObjects.Components.BlendMode#_blendMode - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -57917,7 +64231,7 @@ module.exports = BlendMode; /***/ }), -/* 282 */ +/* 297 */ /***/ (function(module, exports) { /** @@ -57929,7 +64243,7 @@ module.exports = BlendMode; /** * Provides methods used for setting the depth of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Depth * @since 3.0.0 */ @@ -57938,9 +64252,9 @@ var Depth = { /** * Private internal value. Holds the depth of the Game Object. - * + * * @name Phaser.GameObjects.Components.Depth#_depth - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -57949,7 +64263,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -57957,7 +64271,7 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @name Phaser.GameObjects.Components.Depth#depth * @type {number} * @since 3.0.0 @@ -57971,7 +64285,11 @@ var Depth = { set: function (value) { - this.scene.sys.queueDepthSort(); + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + this._depth = value; } @@ -57979,7 +64297,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -57987,12 +64305,12 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {integer} value - The depth of this Game Object. - * + * @param {number} value - The depth of this Game Object. + * * @return {this} This Game Object instance. */ setDepth: function (value) @@ -58010,7 +64328,7 @@ module.exports = Depth; /***/ }), -/* 283 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58019,8 +64337,8 @@ module.exports = Depth; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(161); -var Perimeter = __webpack_require__(118); +var GetPoint = __webpack_require__(162); +var Perimeter = __webpack_require__(126); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -58035,7 +64353,7 @@ var Perimeter = __webpack_require__(118); * * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. - * @param {integer} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. + * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. * * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. @@ -58064,7 +64382,7 @@ module.exports = GetPoints; /***/ }), -/* 284 */ +/* 299 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58103,7 +64421,7 @@ module.exports = GetPoint; /***/ }), -/* 285 */ +/* 300 */ /***/ (function(module, exports) { /** @@ -58147,7 +64465,7 @@ module.exports = RotateAround; /***/ }), -/* 286 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58156,8 +64474,8 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(287); -var GeometryMask = __webpack_require__(288); +var BitmapMask = __webpack_require__(302); +var GeometryMask = __webpack_require__(303); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -58184,10 +64502,10 @@ var Mask = { * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @@ -58233,6 +64551,8 @@ var Mask = { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -58243,7 +64563,7 @@ var Mask = { * * @method Phaser.GameObjects.Components.Mask#createBitmapMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. * * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. @@ -58267,12 +64587,12 @@ var Mask = { * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. @@ -58294,7 +64614,7 @@ module.exports = Mask; /***/ }), -/* 287 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58304,7 +64624,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); /** * @classdesc @@ -58323,6 +64643,9 @@ var GameEvents = __webpack_require__(21); * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -58347,7 +64670,7 @@ var BitmapMask = new Class({ function BitmapMask (scene, renderable) { - var renderer = scene.sys.game.renderer; + var renderer = scene.sys.renderer; /** * A reference to either the Canvas or WebGL Renderer that this Mask is using. @@ -58415,19 +64738,11 @@ var BitmapMask = new Class({ */ this.maskFramebuffer = null; - /** - * The previous framebuffer set in the renderer before this one was enabled. - * - * @name Phaser.Display.Masks.BitmapMask#prevFramebuffer - * @type {WebGLFramebuffer} - * @since 3.17.0 - */ - this.prevFramebuffer = null; - /** * Whether to invert the masks alpha. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. * * @name Phaser.Display.Masks.BitmapMask#invertAlpha * @type {boolean} @@ -58445,36 +64760,73 @@ var BitmapMask = new Class({ */ this.isStencil = false; - if (renderer && renderer.gl) + this.createMask(); + + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + }, + + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + * + * @method Phaser.Display.Masks.BitmapMask#createMask + * @since 3.50.0 + */ + createMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl) { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) - { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - }, this); + return; } + + if (this.mainTexture) + { + this.clearMask(); + } + + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + }, + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + * + * @method Phaser.Display.Masks.BitmapMask#clearMask + * @since 3.50.0 + */ + clearMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl || !this.mainTexture) + { + return; + } + + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; }, /** @@ -58561,22 +64913,9 @@ var BitmapMask = new Class({ */ destroy: function () { + this.clearMask(); + this.bitmapMask = null; - - var renderer = this.renderer; - - if (renderer && renderer.gl) - { - renderer.deleteTexture(this.mainTexture); - renderer.deleteTexture(this.maskTexture); - renderer.deleteFramebuffer(this.mainFramebuffer); - renderer.deleteFramebuffer(this.maskFramebuffer); - } - - this.mainTexture = null; - this.maskTexture = null; - this.mainFramebuffer = null; - this.maskFramebuffer = null; this.prevFramebuffer = null; this.renderer = null; } @@ -58587,7 +64926,7 @@ module.exports = BitmapMask; /***/ }), -/* 288 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58643,6 +64982,8 @@ var GeometryMask = new Class({ * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels * drawn to the Geometry Mask. * + * This is a WebGL only feature. + * * @name Phaser.Display.Masks.GeometryMask#invertAlpha * @type {boolean} * @since 3.16.0 @@ -58677,7 +65018,7 @@ var GeometryMask = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. - * + * * @return {this} This Geometry Mask */ setShape: function (graphicsGeometry) @@ -58689,13 +65030,16 @@ var GeometryMask = new Class({ /** * Sets the `invertAlpha` property of this Geometry Mask. + * * Inverting the alpha essentially flips the way the mask works. * + * This is a WebGL only feature. + * * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha * @since 3.17.0 * * @param {boolean} [value=true] - Invert the alpha of this mask? - * + * * @return {this} This Geometry Mask */ setInvertAlpha: function (value) @@ -58774,7 +65118,7 @@ var GeometryMask = new Class({ } // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + geometryMask.renderWebGL(renderer, geometryMask, camera); renderer.flush(); @@ -58818,32 +65162,32 @@ var GeometryMask = new Class({ renderer.maskCount--; + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + if (renderer.maskStack.length === 0) { // If this is the only mask in the stack, flush and disable - renderer.flush(); - - renderer.currentMask.mask = null; + current.mask = null; gl.disable(gl.STENCIL_TEST); } else { - // Force flush before disabling stencil test - renderer.flush(); - var prev = renderer.maskStack[renderer.maskStack.length - 1]; prev.mask.applyStencil(renderer, prev.camera, false); if (renderer.currentCameraMask.mask !== prev.mask) { - renderer.currentMask.mask = prev.mask; - renderer.currentMask.camera = prev.camera; + current.mask = prev.mask; + current.camera = prev.camera; } else { - renderer.currentMask.mask = null; + current.mask = null; } } }, @@ -58864,7 +65208,7 @@ var GeometryMask = new Class({ renderer.currentContext.save(); - geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); renderer.currentContext.clip(); }, @@ -58902,7 +65246,7 @@ module.exports = GeometryMask; /***/ }), -/* 289 */ +/* 304 */ /***/ (function(module, exports) { /** @@ -59009,68 +65353,7 @@ module.exports = ScrollFactor; /***/ }), -/* 290 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Build a JSON representation of the given Game Object. - * - * This is typically extended further by Game Object specific implementations. - * - * @method Phaser.GameObjects.Components.ToJSON - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ -var ToJSON = function (gameObject) -{ - var out = { - name: gameObject.name, - type: gameObject.type, - x: gameObject.x, - y: gameObject.y, - depth: gameObject.depth, - scale: { - x: gameObject.scaleX, - y: gameObject.scaleY - }, - origin: { - x: gameObject.originX, - y: gameObject.originY - }, - flipX: gameObject.flipX, - flipY: gameObject.flipY, - rotation: gameObject.rotation, - alpha: gameObject.alpha, - visible: gameObject.visible, - blendMode: gameObject.blendMode, - textureKey: '', - frameKey: '', - data: {} - }; - - if (gameObject.texture) - { - out.textureKey = gameObject.texture.key; - out.frameKey = gameObject.frame.name; - } - - return out; -}; - -module.exports = ToJSON; - - -/***/ }), -/* 291 */ +/* 305 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59080,10 +65363,10 @@ module.exports = ToJSON; */ var MATH_CONST = __webpack_require__(13); -var TransformMatrix = __webpack_require__(31); -var TransformXY = __webpack_require__(166); -var WrapAngle = __webpack_require__(248); -var WrapAngleDegrees = __webpack_require__(249); +var TransformMatrix = __webpack_require__(24); +var TransformXY = __webpack_require__(169); +var WrapAngle = __webpack_require__(261); +var WrapAngleDegrees = __webpack_require__(262); var Vector2 = __webpack_require__(3); // global bitmask flag for GameObject.renderMask (used by Scale) @@ -59281,7 +65564,7 @@ var Transform = { * If you prefer to work in radians, see the `rotation` property instead. * * @name Phaser.GameObjects.Components.Transform#angle - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -59354,6 +65637,26 @@ var Transform = { return this; }, + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -59661,7 +65964,7 @@ module.exports = Transform; /***/ }), -/* 292 */ +/* 306 */ /***/ (function(module, exports) { /** @@ -59750,7 +66053,7 @@ module.exports = Visible; /***/ }), -/* 293 */ +/* 307 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59765,16 +66068,17 @@ module.exports = Visible; module.exports = { - CHANGE_DATA: __webpack_require__(589), - CHANGE_DATA_KEY: __webpack_require__(590), - REMOVE_DATA: __webpack_require__(591), - SET_DATA: __webpack_require__(592) + CHANGE_DATA: __webpack_require__(628), + CHANGE_DATA_KEY: __webpack_require__(629), + DESTROY: __webpack_require__(630), + REMOVE_DATA: __webpack_require__(631), + SET_DATA: __webpack_require__(632) }; /***/ }), -/* 294 */ +/* 308 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -59783,7 +66087,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(118); +var Perimeter = __webpack_require__(126); var Point = __webpack_require__(4); @@ -59798,7 +66102,7 @@ var Point = __webpack_require__(4); * * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the perimeter points from. * @param {number} [step] - The distance between each point of the perimeter. Set to `null` if you wish to use the `quantity` parameter instead. - * @param {integer} [quantity] - The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value. + * @param {number} [quantity] - The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value. * @param {(array|Phaser.Geom.Point[])} [out] - An array in which the perimeter points will be stored. If not given, a new array instance is created. * * @return {(array|Phaser.Geom.Point[])} An array containing the perimeter points from the Rectangle. @@ -59893,87 +66197,7 @@ module.exports = MarchingAnts; /***/ }), -/* 295 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 297 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -59991,7 +66215,7 @@ module.exports = RotateRight; * @since 3.0.0 * * @param {Phaser.Geom.Line} line - The line. - * @param {integer} [stepRate=1] - The optional step rate for the points on the line. + * @param {number} [stepRate=1] - The optional step rate for the points on the line. * @param {Phaser.Types.Math.Vector2Like[]} [results] - An optional array to push the resulting coordinates into. * * @return {Phaser.Types.Math.Vector2Like[]} The array of coordinates on the line. @@ -60047,7 +66271,7 @@ module.exports = BresenhamPoints; /***/ }), -/* 298 */ +/* 310 */ /***/ (function(module, exports) { /** @@ -60131,7 +66355,7 @@ module.exports = FindClosestInSorted; /***/ }), -/* 299 */ +/* 311 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60157,16 +66381,19 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. - * @param {integer} index - The index of this AnimationFrame within the Animation sequence. + * @param {(string|number)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. + * @param {number} index - The index of this AnimationFrame within the Animation sequence. * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. + * @param {boolean} [isKeyFrame=false] - Is this Frame a Keyframe within the Animation? */ var AnimationFrame = new Class({ initialize: - function AnimationFrame (textureKey, textureFrame, index, frame) + function AnimationFrame (textureKey, textureFrame, index, frame, isKeyFrame) { + if (isKeyFrame === undefined) { isKeyFrame = false; } + /** * The key of the Texture this AnimationFrame uses. * @@ -60180,7 +66407,7 @@ var AnimationFrame = new Class({ * The key of the Frame within the Texture that this AnimationFrame uses. * * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {(string|integer)} + * @type {(string|number)} * @since 3.0.0 */ this.textureFrame = textureFrame; @@ -60189,7 +66416,7 @@ var AnimationFrame = new Class({ * The index of this AnimationFrame within the Animation sequence. * * @name Phaser.Animations.AnimationFrame#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -60269,6 +66496,15 @@ var AnimationFrame = new Class({ * @since 3.0.0 */ this.progress = 0; + + /** + * Is this Frame a KeyFrame within the Animation? + * + * @name Phaser.Animations.AnimationFrame#isKeyFrame + * @type {boolean} + * @since 3.50.0 + */ + this.isKeyFrame = isKeyFrame; }, /** @@ -60284,7 +66520,8 @@ var AnimationFrame = new Class({ return { key: this.textureKey, frame: this.textureFrame, - duration: this.duration + duration: this.duration, + keyframe: this.isKeyFrame }; }, @@ -60305,7 +66542,7 @@ module.exports = AnimationFrame; /***/ }), -/* 300 */ +/* 312 */ /***/ (function(module, exports) { /** @@ -60343,7 +66580,7 @@ module.exports = SortByDigits; /***/ }), -/* 301 */ +/* 313 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60352,16 +66589,16 @@ module.exports = SortByDigits; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Animation = __webpack_require__(172); +var Animation = __webpack_require__(177); var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(122); -var GameEvents = __webpack_require__(21); +var CustomMap = __webpack_require__(98); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(128); +var GameEvents = __webpack_require__(23); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); -var Pad = __webpack_require__(173); -var NumberArray = __webpack_require__(302); +var Pad = __webpack_require__(178); +var NumberArray = __webpack_require__(314); /** * @classdesc @@ -60441,7 +66678,7 @@ var AnimationManager = new Class({ * See the {@link #setMix} method for more details. * * @name Phaser.Animations.AnimationManager#mixes - * @type {Phaser.Structs.Map.} + * @type {Phaser.Structs.Map.} * @since 3.50.0 */ this.mixes = new CustomMap(); @@ -60702,17 +66939,17 @@ var AnimationManager = new Class({ * * This was tested with Aseprite 1.2.25. * - * This will export a png and json file which you can load using the Atlas Loader, i.e.: + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: * * ```javascript * function preload () * { * this.load.path = 'assets/animations/aseprite/'; - * this.load.atlas('paladin', 'paladin.png', 'paladin.json'); + * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); * } * ``` * - * Once exported, you can call this method from within a Scene with the 'atlas' key: + * Once loaded, you can call this method from within a Scene with the 'atlas' key: * * ```javascript * this.anims.createFromAseprite('paladin'); @@ -61031,6 +67268,36 @@ var AnimationManager = new Class({ * * If you're working with a texture atlas, see the `generateFrameNames` method instead. * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * * @method Phaser.Animations.AnimationManager#generateFrameNumbers * @since 3.0.0 * @@ -61322,7 +67589,7 @@ module.exports = AnimationManager; /***/ }), -/* 302 */ +/* 314 */ /***/ (function(module, exports) { /** @@ -61415,7 +67682,7 @@ module.exports = NumberArray; /***/ }), -/* 303 */ +/* 315 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61425,9 +67692,9 @@ module.exports = NumberArray; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(304); +var CustomMap = __webpack_require__(98); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(316); /** * @classdesc @@ -61601,7 +67868,7 @@ module.exports = BaseCache; /***/ }), -/* 304 */ +/* 316 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61616,14 +67883,14 @@ module.exports = BaseCache; module.exports = { - ADD: __webpack_require__(664), - REMOVE: __webpack_require__(665) + ADD: __webpack_require__(704), + REMOVE: __webpack_require__(705) }; /***/ }), -/* 305 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61632,9 +67899,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCache = __webpack_require__(303); +var BaseCache = __webpack_require__(315); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); /** * @classdesc @@ -61857,7 +68124,7 @@ module.exports = CacheManager; /***/ }), -/* 306 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61866,14 +68133,14 @@ module.exports = CacheManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(93); -var CanvasPool = __webpack_require__(26); -var CenterOn = __webpack_require__(178); -var Clamp = __webpack_require__(17); +var BaseCamera = __webpack_require__(99); +var CenterOn = __webpack_require__(182); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Effects = __webpack_require__(314); -var Linear = __webpack_require__(124); +var Effects = __webpack_require__(325); +var Events = __webpack_require__(35); +var Linear = __webpack_require__(130); var Rectangle = __webpack_require__(9); var Vector2 = __webpack_require__(3); @@ -61908,6 +68175,7 @@ var Vector2 = __webpack_require__(3); * @extends Phaser.Cameras.Scene2D.BaseCamera * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Pipeline * * @param {number} x - The x position of the Camera, relative to the top-left of the game canvas. * @param {number} y - The y position of the Camera, relative to the top-left of the game canvas. @@ -61920,7 +68188,8 @@ var Camera = new Class({ Mixins: [ Components.Flip, - Components.Tint + Components.Tint, + Components.Pipeline ], initialize: @@ -61929,6 +68198,9 @@ var Camera = new Class({ { BaseCamera.call(this, x, y, width, height); + this.postPipelines = []; + this.pipelineData = {}; + /** * Does this Camera allow the Game Objects it renders to receive input events? * @@ -62063,268 +68335,6 @@ var Camera = new Class({ * @since 3.0.0 */ this._follow = null; - - /** - * Is this Camera rendering directly to the canvas or to a texture? - * - * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) - * - * Once enabled you can toggle it by switching this property. - * - * To properly remove a render texture you should call the `clearRenderToTexture()` method. - * - * @name Phaser.Cameras.Scene2D.Camera#renderToTexture - * @type {boolean} - * @default false - * @since 3.13.0 - */ - this.renderToTexture = false; - - /** - * If this Camera is rendering to a texture (via `setRenderToTexture`) then you - * have the option to control if it should also render to the Game canvas as well. - * - * By default, a Camera will render both to its texture and to the Game canvas. - * - * However, if you set ths property to `false` it will only render to the texture - * and skip rendering to the Game canvas. - * - * Setting this property if the Camera isn't rendering to a texture has no effect. - * - * @name Phaser.Cameras.Scene2D.Camera#renderToGame - * @type {boolean} - * @default true - * @since 3.23.0 - */ - this.renderToGame = true; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the HTML Canvas Element that the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#canvas - * @type {HTMLCanvasElement} - * @since 3.13.0 - */ - this.canvas = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the Rendering Context belonging to the Canvas element the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#context - * @type {CanvasRenderingContext2D} - * @since 3.13.0 - */ - this.context = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Texture belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#glTexture - * @type {?WebGLTexture} - * @since 3.13.0 - */ - this.glTexture = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Frame Buffer belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#framebuffer - * @type {?WebGLFramebuffer} - * @since 3.13.0 - */ - this.framebuffer = null; - - /** - * If this Camera has been set to render to a texture and to use a custom pipeline, - * then this holds a reference to the pipeline the Camera is drawing with. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#pipeline - * @type {?Phaser.Renderer.WebGL.WebGLPipeline} - * @since 3.13.0 - */ - this.pipeline = null; - }, - - /** - * Sets the Camera to render to a texture instead of to the main canvas. - * - * The Camera will redirect all Game Objects it's asked to render to this texture. - * - * During the render sequence, the texture itself will then be rendered to the main canvas. - * - * Doing this gives you the ability to modify the texture before this happens, - * allowing for special effects such as Camera specific shaders, or post-processing - * on the texture. - * - * If running under Canvas the Camera will render to its `canvas` property. - * - * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. - * - * If you set a camera to render to a texture then it will emit 2 events during the render loop: - * - * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. - * - * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the - * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before - * it appears in-game. - * - * You should not enable this unless you plan on actually using the texture it creates - * somehow, otherwise you're just doubling the work required to render your game. - * - * If you only require the Camera to render to a texture, and not also to the Game, - * them set the `renderToGame` parameter to `false`. - * - * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. - * - * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, - * which will delete the respective textures and free-up resources. - * - * @method Phaser.Cameras.Scene2D.Camera#setRenderToTexture - * @since 3.13.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. - * @param {boolean} [renderToGame=true] - If you do not need the Camera to still render to the Game, set this parameter to `false`. - * - * @return {this} This Camera instance. - */ - setRenderToTexture: function (pipeline, renderToGame) - { - if (renderToGame === undefined) { renderToGame = true; } - - var renderer = this.scene.sys.game.renderer; - - if (renderer.gl) - { - this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, 0); - this.framebuffer = renderer.createFramebuffer(this.width, this.height, this.glTexture, false); - } - else - { - this.canvas = CanvasPool.create2D(this, this.width, this.height); - this.context = this.canvas.getContext('2d'); - } - - this.renderToTexture = true; - this.renderToGame = renderToGame; - - if (pipeline) - { - this.setPipeline(pipeline); - } - - return this; - }, - - /** - * Sets the WebGL pipeline this Camera is using when rendering to a texture. - * - * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. - * - * Call this method with no arguments to clear any previously set pipeline. - * - * @method Phaser.Cameras.Scene2D.Camera#setPipeline - * @since 3.13.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline. - * - * @return {this} This Camera instance. - */ - setPipeline: function (pipeline) - { - if (typeof pipeline === 'string') - { - var renderer = this.scene.sys.game.renderer; - - if (renderer.gl && renderer.pipelines.has(pipeline)) - { - this.pipeline = renderer.pipelines.get(pipeline); - } - } - else - { - this.pipeline = pipeline; - } - - return this; - }, - - /** - * If this Camera was set to render to a texture, this will clear the resources it was using and - * redirect it to render back to the primary Canvas again. - * - * If you only wish to temporarily disable rendering to a texture then you can toggle the - * property `renderToTexture` instead. - * - * @method Phaser.Cameras.Scene2D.Camera#clearRenderToTexture - * @since 3.13.0 - * - * @return {this} This Camera instance. - */ - clearRenderToTexture: function () - { - if (!this.scene) - { - return; - } - - var renderer = this.scene.sys.game.renderer; - - if (!renderer) - { - return; - } - - if (renderer.gl) - { - if (this.framebuffer) - { - renderer.deleteFramebuffer(this.framebuffer); - } - - if (this.glTexture) - { - renderer.deleteTexture(this.glTexture); - } - - this.framebuffer = null; - this.glTexture = null; - this.pipeline = null; - } - else - { - CanvasPool.remove(this); - - this.canvas = null; - this.context = null; - } - - this.renderToTexture = false; - - return this; }, /** @@ -62397,10 +68407,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE * @since 3.3.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. @@ -62421,10 +68431,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE * @since 3.3.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. @@ -62444,10 +68454,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -62468,10 +68478,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -62492,10 +68502,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=250] - The duration of the effect in milliseconds. - * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=250] - The duration of the effect in milliseconds. + * @param {number} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -62516,7 +68526,7 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [duration=100] - The duration of the effect in milliseconds. * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -62541,7 +68551,7 @@ var Camera = new Class({ * * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -62565,7 +68575,7 @@ var Camera = new Class({ * * @param {number} radians - The destination angle in radians to rotate the Camera viewport to. If the angle is positive then the rotation is clockwise else anticlockwise * @param {boolean} [shortestPath=false] - If shortest path is set to true the camera will rotate in the quickest direction clockwise or anti-clockwise. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the rotation. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the rotation effect to start immediately, even if already running. * @param {CameraRotateCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -62589,7 +68599,7 @@ var Camera = new Class({ * @since 3.11.0 * * @param {number} zoom - The target Camera zoom value. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -62610,10 +68620,8 @@ var Camera = new Class({ * @method Phaser.Cameras.Scene2D.Camera#preRender * @protected * @since 3.0.0 - * - * @param {number} resolution - The game resolution, as set in the Scale Manager. */ - preRender: function (resolution) + preRender: function () { var width = this.width; var height = this.height; @@ -62621,7 +68629,7 @@ var Camera = new Class({ var halfWidth = width * 0.5; var halfHeight = height * 0.5; - var zoom = this.zoom * resolution; + var zoom = this.zoom; var matrix = this.matrix; var originX = width * this.originX; @@ -62638,6 +68646,8 @@ var Camera = new Class({ CenterOn(deadzone, this.midPoint.x, this.midPoint.y); } + var emitFollowEvent = false; + if (follow && !this.panEffect.isRunning) { var fx = (follow.x - this.followOffset.x); @@ -62668,6 +68678,8 @@ var Camera = new Class({ sx = Linear(sx, fx - originX, this.lerp.x); sy = Linear(sy, fy - originY, this.lerp.y); } + + emitFollowEvent = true; } if (this.useBounds) @@ -62680,6 +68692,9 @@ var Camera = new Class({ { originX = Math.round(originX); originY = Math.round(originY); + + sx = Math.round(sx); + sy = Math.round(sy); } // Values are in pixels and not impacted by zooming the Camera @@ -62696,17 +68711,26 @@ var Camera = new Class({ var displayWidth = width / zoom; var displayHeight = height / zoom; - this.worldView.setTo( - midX - (displayWidth / 2), - midY - (displayHeight / 2), - displayWidth, - displayHeight - ); + var vwx = midX - (displayWidth / 2); + var vwy = midY - (displayHeight / 2); + + if (this.roundPixels) + { + vwx = Math.round(vwx); + vwy = Math.round(vwy); + } + + this.worldView.setTo(vwx, vwy, displayWidth, displayHeight); matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); matrix.translate(-originX, -originY); this.shakeEffect.preRender(); + + if (emitFollowEvent) + { + this.emit(Events.FOLLOW_UPDATE, this, follow); + } }, /** @@ -62866,7 +68890,7 @@ var Camera = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -62894,8 +68918,6 @@ var Camera = new Class({ */ destroy: function () { - this.clearRenderToTexture(); - this.resetFX(); BaseCamera.prototype.destroy.call(this); @@ -62911,7 +68933,7 @@ module.exports = Camera; /***/ }), -/* 307 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62920,7 +68942,7 @@ module.exports = Camera; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); /** * Converts a hex string into a Phaser Color object. @@ -62964,7 +68986,7 @@ module.exports = HexStringToColor; /***/ }), -/* 308 */ +/* 320 */ /***/ (function(module, exports) { /** @@ -62979,10 +69001,10 @@ module.exports = HexStringToColor; * @function Phaser.Display.Color.GetColor32 * @since 3.0.0 * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} alpha - The alpha color value. A number between 0 and 255. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} alpha - The alpha color value. A number between 0 and 255. * * @return {number} The combined color value. */ @@ -62995,7 +69017,7 @@ module.exports = GetColor32; /***/ }), -/* 309 */ +/* 321 */ /***/ (function(module, exports) { /** @@ -63013,9 +69035,9 @@ module.exports = GetColor32; * @function Phaser.Display.Color.RGBToHSV * @since 3.0.0 * - * @param {integer} r - The red color value. A number between 0 and 255. - * @param {integer} g - The green color value. A number between 0 and 255. - * @param {integer} b - The blue color value. A number between 0 and 255. + * @param {number} r - The red color value. A number between 0 and 255. + * @param {number} g - The green color value. A number between 0 and 255. + * @param {number} b - The blue color value. A number between 0 and 255. * @param {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} [out] - An object to store the color values in. If not given an HSV Color Object will be created. * * @return {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} An object with the properties `h`, `s` and `v` set. @@ -63075,7 +69097,7 @@ module.exports = RGBToHSV; /***/ }), -/* 310 */ +/* 322 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63084,8 +69106,8 @@ module.exports = RGBToHSV; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); -var IntegerToRGB = __webpack_require__(311); +var Color = __webpack_require__(36); +var IntegerToRGB = __webpack_require__(181); /** * Converts the given color value into an instance of a Color object. @@ -63093,7 +69115,7 @@ var IntegerToRGB = __webpack_require__(311); * @function Phaser.Display.Color.IntegerToColor * @since 3.0.0 * - * @param {integer} input - The color value to convert into a Color object. + * @param {number} input - The color value to convert into a Color object. * * @return {Phaser.Display.Color} A Color object. */ @@ -63108,55 +69130,7 @@ module.exports = IntegerToColor; /***/ }), -/* 311 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Return the component parts of a color as an Object with the properties alpha, red, green, blue. - * - * Alpha will only be set if it exists in the given color (0xAARRGGBB) - * - * @function Phaser.Display.Color.IntegerToRGB - * @since 3.0.0 - * - * @param {integer} input - The color value to convert into a Color object. - * - * @return {Phaser.Types.Display.ColorObject} An object with the red, green and blue values set in the r, g and b properties. - */ -var IntegerToRGB = function (color) -{ - if (color > 16777215) - { - // The color value has an alpha component - return { - a: color >>> 24, - r: color >> 16 & 0xFF, - g: color >> 8 & 0xFF, - b: color & 0xFF - }; - } - else - { - return { - a: 255, - r: color >> 16 & 0xFF, - g: color >> 8 & 0xFF, - b: color & 0xFF - }; - } -}; - -module.exports = IntegerToRGB; - - -/***/ }), -/* 312 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63165,7 +69139,7 @@ module.exports = IntegerToRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); /** * Converts an object containing `r`, `g`, `b` and `a` properties into a Color class instance. @@ -63186,7 +69160,7 @@ module.exports = ObjectToColor; /***/ }), -/* 313 */ +/* 324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63195,7 +69169,7 @@ module.exports = ObjectToColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); /** * Converts a CSS 'web' string into a Phaser Color object. @@ -63232,7 +69206,7 @@ module.exports = RGBStringToColor; /***/ }), -/* 314 */ +/* 325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63247,255 +69221,12 @@ module.exports = RGBStringToColor; module.exports = { - Fade: __webpack_require__(688), - Flash: __webpack_require__(689), - Pan: __webpack_require__(690), - Shake: __webpack_require__(723), - RotateTo: __webpack_require__(724), - Zoom: __webpack_require__(725) - -}; - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(691), - Out: __webpack_require__(692), - InOut: __webpack_require__(693) - -}; - - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(694), - Out: __webpack_require__(695), - InOut: __webpack_require__(696) - -}; - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(697), - Out: __webpack_require__(698), - InOut: __webpack_require__(699) - -}; - - -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Cubic - */ - -module.exports = { - - In: __webpack_require__(700), - Out: __webpack_require__(701), - InOut: __webpack_require__(702) - -}; - - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Elastic - */ - -module.exports = { - - In: __webpack_require__(703), - Out: __webpack_require__(704), - InOut: __webpack_require__(705) - -}; - - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Expo - */ - -module.exports = { - - In: __webpack_require__(706), - Out: __webpack_require__(707), - InOut: __webpack_require__(708) - -}; - - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -module.exports = __webpack_require__(709); - - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quadratic - */ - -module.exports = { - - In: __webpack_require__(710), - Out: __webpack_require__(711), - InOut: __webpack_require__(712) - -}; - - -/***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quartic - */ - -module.exports = { - - In: __webpack_require__(713), - Out: __webpack_require__(714), - InOut: __webpack_require__(715) - -}; - - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quintic - */ - -module.exports = { - - In: __webpack_require__(716), - Out: __webpack_require__(717), - InOut: __webpack_require__(718) - -}; - - -/***/ }), -/* 325 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Sine - */ - -module.exports = { - - In: __webpack_require__(719), - Out: __webpack_require__(720), - InOut: __webpack_require__(721) + Fade: __webpack_require__(729), + Flash: __webpack_require__(730), + Pan: __webpack_require__(731), + Shake: __webpack_require__(764), + RotateTo: __webpack_require__(765), + Zoom: __webpack_require__(766) }; @@ -63511,16 +69242,259 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Stepped + * @namespace Phaser.Math.Easing.Back */ -module.exports = __webpack_require__(722); +module.exports = { + + In: __webpack_require__(732), + Out: __webpack_require__(733), + InOut: __webpack_require__(734) + +}; /***/ }), /* 327 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(735), + Out: __webpack_require__(736), + InOut: __webpack_require__(737) + +}; + + +/***/ }), +/* 328 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(738), + Out: __webpack_require__(739), + InOut: __webpack_require__(740) + +}; + + +/***/ }), +/* 329 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(741), + Out: __webpack_require__(742), + InOut: __webpack_require__(743) + +}; + + +/***/ }), +/* 330 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(744), + Out: __webpack_require__(745), + InOut: __webpack_require__(746) + +}; + + +/***/ }), +/* 331 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(747), + Out: __webpack_require__(748), + InOut: __webpack_require__(749) + +}; + + +/***/ }), +/* 332 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +module.exports = __webpack_require__(750); + + +/***/ }), +/* 333 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(751), + Out: __webpack_require__(752), + InOut: __webpack_require__(753) + +}; + + +/***/ }), +/* 334 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(754), + Out: __webpack_require__(755), + InOut: __webpack_require__(756) + +}; + + +/***/ }), +/* 335 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(757), + Out: __webpack_require__(758), + InOut: __webpack_require__(759) + +}; + + +/***/ }), +/* 336 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(760), + Out: __webpack_require__(761), + InOut: __webpack_require__(762) + +}; + + +/***/ }), +/* 337 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(763); + + +/***/ }), +/* 338 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -63528,15 +69502,15 @@ module.exports = __webpack_require__(722); */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(34); -var Device = __webpack_require__(328); +var CONST = __webpack_require__(39); +var Device = __webpack_require__(339); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); var IsPlainObject = __webpack_require__(7); -var PhaserMath = __webpack_require__(180); +var PhaserMath = __webpack_require__(185); var NOOP = __webpack_require__(1); -var DefaultPlugins = __webpack_require__(184); -var ValueToColor = __webpack_require__(174); +var DefaultPlugins = __webpack_require__(189); +var ValueToColor = __webpack_require__(179); /** * @classdesc @@ -63570,25 +69544,20 @@ var Config = new Class({ var defaultBannerTextColor = '#ffffff'; /** - * @const {(integer|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. + * @const {(number|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. */ this.width = GetValue(config, 'width', 1024); /** - * @const {(integer|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. + * @const {(number|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. */ this.height = GetValue(config, 'height', 768); /** - * @const {(Phaser.Scale.ZoomType|integer)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. + * @const {(Phaser.Scale.ZoomType|number)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. */ this.zoom = GetValue(config, 'zoom', 1); - /** - * @const {number} Phaser.Core.Config#resolution - The canvas device pixel resolution. Currently un-used. - */ - this.resolution = GetValue(config, 'resolution', 1); - /** * @const {?*} Phaser.Core.Config#parent - A parent DOM element into which the canvas created by the renderer will be injected. */ @@ -63605,7 +69574,7 @@ var Config = new Class({ this.expandParent = GetValue(config, 'expandParent', true); /** - * @const {integer} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + * @const {number} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. */ this.autoRound = GetValue(config, 'autoRound', false); @@ -63615,7 +69584,7 @@ var Config = new Class({ this.autoCenter = GetValue(config, 'autoCenter', 0); /** - * @const {integer} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? + * @const {number} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? */ this.resizeInterval = GetValue(config, 'resizeInterval', 500); @@ -63625,22 +69594,22 @@ var Config = new Class({ this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null); /** - * @const {integer} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. + * @const {number} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. */ this.minWidth = GetValue(config, 'minWidth', 0); /** - * @const {integer} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. + * @const {number} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. */ this.maxWidth = GetValue(config, 'maxWidth', 0); /** - * @const {integer} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. + * @const {number} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. */ this.minHeight = GetValue(config, 'minHeight', 0); /** - * @const {integer} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. + * @const {number} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. */ this.maxHeight = GetValue(config, 'maxHeight', 0); @@ -63653,7 +69622,6 @@ var Config = new Class({ this.width = GetValue(scaleConfig, 'width', this.width); this.height = GetValue(scaleConfig, 'height', this.height); this.zoom = GetValue(scaleConfig, 'zoom', this.zoom); - this.resolution = GetValue(scaleConfig, 'resolution', this.resolution); this.parent = GetValue(scaleConfig, 'parent', this.parent); this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode); this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent); @@ -63749,7 +69717,7 @@ var Config = new Class({ this.inputKeyboardEventTarget = GetValue(config, 'input.keyboard.target', window); /** - * @const {?integer[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. + * @const {?number[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. */ this.inputKeyboardCapture = GetValue(config, 'input.keyboard.capture', []); @@ -63764,9 +69732,24 @@ var Config = new Class({ this.inputMouseEventTarget = GetValue(config, 'input.mouse.target', null); /** - * @const {boolean} Phaser.Core.Config#inputMouseCapture - Should mouse events be captured? I.e. have prevent default called on them. + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultDown - Should `mousedown` DOM events have `preventDefault` called on them? */ - this.inputMouseCapture = GetValue(config, 'input.mouse.capture', true); + this.inputMousePreventDefaultDown = GetValue(config, 'input.mouse.preventDefaultDown', true); + + /** + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultUp - Should `mouseup` DOM events have `preventDefault` called on them? + */ + this.inputMousePreventDefaultUp = GetValue(config, 'input.mouse.preventDefaultUp', true); + + /** + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultMove - Should `mousemove` DOM events have `preventDefault` called on them? + */ + this.inputMousePreventDefaultMove = GetValue(config, 'input.mouse.preventDefaultMove', true); + + /** + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultWheel - Should `wheel` DOM events have `preventDefault` called on them? + */ + this.inputMousePreventDefaultWheel = GetValue(config, 'input.mouse.preventDefaultWheel', true); /** * @const {boolean} Phaser.Core.Config#inputTouch - Enable the Touch Plugin. This can be disabled in games that don't need touch input. @@ -63784,12 +69767,12 @@ var Config = new Class({ this.inputTouchCapture = GetValue(config, 'input.touch.capture', true); /** - * @const {integer} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. + * @const {number} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. */ this.inputActivePointers = GetValue(config, 'input.activePointers', 1); /** - * @const {integer} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + * @const {number} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. */ this.inputSmoothFactor = GetValue(config, 'input.smoothFactor', 0); @@ -63816,7 +69799,7 @@ var Config = new Class({ /** * @const {Phaser.Types.Core.AudioConfig} Phaser.Core.Config#audio - The Audio Configuration object. */ - this.audio = GetValue(config, 'audio'); + this.audio = GetValue(config, 'audio', {}); // If you do: { banner: false } it won't display any banner at all @@ -63846,7 +69829,7 @@ var Config = new Class({ } /** - * @const {?Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class. + * @const {Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class. */ this.fps = GetValue(config, 'fps', null); @@ -63855,6 +69838,11 @@ var Config = new Class({ var renderConfig = GetValue(config, 'render', config); + /** + * @const {Phaser.Types.Core.PipelineConfig} Phaser.Core.Config#pipeline - An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances. + */ + this.pipeline = GetValue(renderConfig, 'pipeline', null); + /** * @const {boolean} Phaser.Core.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. */ @@ -63888,6 +69876,7 @@ var Config = new Class({ if (this.pixelArt) { this.antialias = false; + this.antialiasGL = false; this.roundPixels = true; } @@ -63917,17 +69906,17 @@ var Config = new Class({ this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default'); /** - * @const {integer} Phaser.Core.Config#batchSize - The default WebGL Batch size. + * @const {number} Phaser.Core.Config#batchSize - The default WebGL Batch size. Represents the number of _quads_ that can be added to a single batch. */ this.batchSize = GetValue(renderConfig, 'batchSize', 4096); /** - * @const {integer} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. + * @const {number} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. */ this.maxTextures = GetValue(renderConfig, 'maxTextures', -1); /** - * @const {integer} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + * @const {number} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ this.maxLights = GetValue(renderConfig, 'maxLights', 10); @@ -63938,8 +69927,9 @@ var Config = new Class({ */ this.backgroundColor = ValueToColor(bgc); - if (bgc === 0 && this.transparent) + if (this.transparent) { + this.backgroundColor = ValueToColor(0x000000); this.backgroundColor.alpha = 0; } @@ -63974,9 +69964,11 @@ var Config = new Class({ this.loaderPath = GetValue(config, 'loader.path', ''); /** - * @const {integer} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). + * @const {number} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ - this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', 32); + var defaultParallel = (Device.os.android) ? 6 : 32; + + this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', defaultParallel); /** * @const {(string|undefined)} Phaser.Core.Config#loaderCrossOrigin - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. @@ -64004,7 +69996,7 @@ var Config = new Class({ this.loaderPassword = GetValue(config, 'loader.password', ''); /** - * @const {integer} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms. + * @const {number} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms. */ this.loaderTimeout = GetValue(config, 'loader.timeout', 0); @@ -64085,6 +70077,11 @@ var Config = new Class({ */ this.missingImage = GetValue(config, 'images.missing', pngPrefix + 'CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=='); + /** + * @const {string} Phaser.Core.Config#whiteImage - A base64 encoded PNG that will be used as the default texture when a texture is assigned that is white or not loaded. + */ + this.whiteImage = GetValue(config, 'images.white', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC'); + if (window) { if (window.FORCE_WEBGL) @@ -64104,7 +70101,7 @@ module.exports = Config; /***/ }), -/* 328 */ +/* 339 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64138,20 +70135,20 @@ module.exports = Config; module.exports = { - os: __webpack_require__(125), - browser: __webpack_require__(126), - features: __webpack_require__(179), - input: __webpack_require__(756), - audio: __webpack_require__(757), - video: __webpack_require__(758), - fullscreen: __webpack_require__(759), - canvasFeatures: __webpack_require__(329) + os: __webpack_require__(102), + browser: __webpack_require__(131), + features: __webpack_require__(183), + input: __webpack_require__(797), + audio: __webpack_require__(798), + video: __webpack_require__(799), + fullscreen: __webpack_require__(800), + canvasFeatures: __webpack_require__(340) }; /***/ }), -/* 329 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64160,7 +70157,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); /** * Determines the canvas features of the browser running this Phaser Game instance. @@ -64265,7 +70262,7 @@ module.exports = init(); /***/ }), -/* 330 */ +/* 341 */ /***/ (function(module, exports) { /** @@ -64296,7 +70293,7 @@ module.exports = Between; /***/ }), -/* 331 */ +/* 342 */ /***/ (function(module, exports) { /** @@ -64327,7 +70324,7 @@ module.exports = BetweenPoints; /***/ }), -/* 332 */ +/* 343 */ /***/ (function(module, exports) { /** @@ -64364,7 +70361,7 @@ module.exports = Normalize; /***/ }), -/* 333 */ +/* 344 */ /***/ (function(module, exports) { /** @@ -64396,7 +70393,7 @@ module.exports = DistanceBetweenPoints; /***/ }), -/* 334 */ +/* 345 */ /***/ (function(module, exports) { /** @@ -64430,7 +70427,7 @@ module.exports = DistanceSquared; /***/ }), -/* 335 */ +/* 346 */ /***/ (function(module, exports) { /** @@ -64464,7 +70461,7 @@ module.exports = GreaterThan; /***/ }), -/* 336 */ +/* 347 */ /***/ (function(module, exports) { /** @@ -64498,7 +70495,7 @@ module.exports = LessThan; /***/ }), -/* 337 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64507,7 +70504,7 @@ module.exports = LessThan; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Factorial = __webpack_require__(338); +var Factorial = __webpack_require__(349); /** * Calculates the Bernstein basis from the three factorial coefficients. @@ -64529,7 +70526,7 @@ module.exports = Bernstein; /***/ }), -/* 338 */ +/* 349 */ /***/ (function(module, exports) { /** @@ -64569,7 +70566,7 @@ module.exports = Factorial; /***/ }), -/* 339 */ +/* 350 */ /***/ (function(module, exports) { /** @@ -64639,7 +70636,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 340 */ +/* 351 */ /***/ (function(module, exports) { /** @@ -64698,7 +70695,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 341 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64707,7 +70704,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(171); +var SmoothStep = __webpack_require__(176); /** * A Smooth Step interpolation method. @@ -64731,7 +70728,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 342 */ +/* 353 */ /***/ (function(module, exports) { /** @@ -64748,7 +70745,7 @@ module.exports = SmoothStepInterpolation; * * @param {number} value - The value. * - * @return {integer} The nearest power of 2 to `value`. + * @return {number} The nearest power of 2 to `value`. */ var GetPowerOfTwo = function (value) { @@ -64761,51 +70758,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 343 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using ceil. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. - * As will `14` snap to `15`... but `16` will snap to `20`. - * - * @function Phaser.Math.Snap.Ceil - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapCeil = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.ceil(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapCeil; - - -/***/ }), -/* 344 */ +/* 354 */ /***/ (function(module, exports) { /** @@ -64840,7 +70793,7 @@ module.exports = Rotate; /***/ }), -/* 345 */ +/* 355 */ /***/ (function(module, exports) { /** @@ -64869,7 +70822,7 @@ module.exports = RoundAwayFromZero; /***/ }), -/* 346 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65462,7 +71415,7 @@ module.exports = Matrix3; /***/ }), -/* 347 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65475,1470 +71428,9 @@ module.exports = Matrix3; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); - -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - // TODO - Should work with basic values - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - var out = this.val; - - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; - - return this; - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = []; - var m1 = this.val; - var m2 = src.val; - - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; - - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; - - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; - - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; - - return this.fromArray(a); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translate: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scale: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - this.fromArray([ - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromQuat: function (q) - { - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var out = this.val; - - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; - - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var out = this.val; - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - var out = this.val; - - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var out = this.val; - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var out = this.val; - - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix !== undefined) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix !== undefined) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - } - -}); - -var _tempMat1 = new Matrix4(); -var _tempMat2 = new Matrix4(); - -module.exports = Matrix4; - - -/***/ }), -/* 348 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(81); -var Matrix3 = __webpack_require__(346); +var Matrix3 = __webpack_require__(356); +var NOOP = __webpack_require__(1); +var Vector3 = __webpack_require__(37); var EPSILON = 0.000001; @@ -66961,10 +71453,10 @@ var tmpMat3 = new Matrix3(); * @constructor * @since 3.0.0 * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. */ var Quaternion = new Class({ @@ -66975,52 +71467,141 @@ var Quaternion = new Class({ /** * The x component of this Quaternion. * - * @name Phaser.Math.Quaternion#x + * @name Phaser.Math.Quaternion#_x * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The y component of this Quaternion. * - * @name Phaser.Math.Quaternion#y + * @name Phaser.Math.Quaternion#_y * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The z component of this Quaternion. * - * @name Phaser.Math.Quaternion#z + * @name Phaser.Math.Quaternion#_z * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The w component of this Quaternion. * - * @name Phaser.Math.Quaternion#w + * @name Phaser.Math.Quaternion#_w * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ - if (typeof x === 'object') + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); } - else + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); } }, @@ -67036,16 +71617,11 @@ var Quaternion = new Class({ */ copy: function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; + return this.set(src); }, /** - * Set the components of this Quaternion. + * Set the components of this Quaternion and optionally call the `onChangeCallback`. * * @method Phaser.Math.Quaternion#set * @since 3.0.0 @@ -67054,24 +71630,32 @@ var Quaternion = new Class({ * @param {number} [y=0] - The y component. * @param {number} [z=0] - The z component. * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? * * @return {Phaser.Math.Quaternion} This Quaternion. */ - set: function (x, y, z, w) + set: function (x, y, z, w, update) { + if (update === undefined) { update = true; } + if (typeof x === 'object') { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); } return this; @@ -67089,10 +71673,12 @@ var Quaternion = new Class({ */ add: function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); return this; }, @@ -67109,10 +71695,12 @@ var Quaternion = new Class({ */ subtract: function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); return this; }, @@ -67129,10 +71717,12 @@ var Quaternion = new Class({ */ scale: function (scale) { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); return this; }, @@ -67193,12 +71783,14 @@ var Quaternion = new Class({ { len = 1 / Math.sqrt(len); - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; } + this.onChangeCallback(this); + return this; }, @@ -67237,12 +71829,12 @@ var Quaternion = new Class({ var az = this.z; var aw = this.w; - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); }, /** @@ -67274,21 +71866,16 @@ var Quaternion = new Class({ } else if (dot > 0.999999) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); } else { tmpvec.copy(a).cross(b); - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; return this.normalize(); } @@ -67335,12 +71922,7 @@ var Quaternion = new Class({ */ identity: function () { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); }, /** @@ -67360,12 +71942,12 @@ var Quaternion = new Class({ var s = Math.sin(rad); - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); }, /** @@ -67390,12 +71972,12 @@ var Quaternion = new Class({ var bz = b.z; var bw = b.w; - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); }, /** @@ -67453,12 +72035,12 @@ var Quaternion = new Class({ } // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); }, /** @@ -67479,14 +72061,12 @@ var Quaternion = new Class({ var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = (dot) ? 1 / dot : 0; - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); }, /** @@ -67501,9 +72081,11 @@ var Quaternion = new Class({ */ conjugate: function () { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); return this; }, @@ -67530,12 +72112,12 @@ var Quaternion = new Class({ var bx = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); }, /** @@ -67560,12 +72142,12 @@ var Quaternion = new Class({ var by = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); }, /** @@ -67590,12 +72172,12 @@ var Quaternion = new Class({ var bz = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); }, /** @@ -67619,6 +72201,190 @@ var Quaternion = new Class({ return this; }, + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + /** * Convert the given Matrix into this Quaternion. * @@ -67650,9 +72416,9 @@ var Quaternion = new Class({ fRoot = 0.5 / fRoot; // 1/(4w) - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; } else { @@ -67681,12 +72447,14 @@ var Quaternion = new Class({ tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; } + this.onChangeCallback(this); + return this; } @@ -67696,7 +72464,7 @@ module.exports = Quaternion; /***/ }), -/* 349 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67705,10 +72473,10 @@ module.exports = Quaternion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasInterpolation = __webpack_require__(350); -var CanvasPool = __webpack_require__(26); -var CONST = __webpack_require__(34); -var Features = __webpack_require__(179); +var CanvasInterpolation = __webpack_require__(359); +var CanvasPool = __webpack_require__(31); +var CONST = __webpack_require__(39); +var Features = __webpack_require__(183); /** * Called automatically by Phaser.Game and responsible for creating the renderer it will use. @@ -67798,8 +72566,8 @@ var CreateRenderer = function (game) if (true) { - CanvasRenderer = __webpack_require__(532); - WebGLRenderer = __webpack_require__(535); + CanvasRenderer = __webpack_require__(568); + WebGLRenderer = __webpack_require__(571); // Let the config pick the renderer type, as both are included if (config.renderType === CONST.WEBGL) @@ -67824,7 +72592,7 @@ module.exports = CreateRenderer; /***/ }), -/* 350 */ +/* 359 */ /***/ (function(module, exports) { /** @@ -67887,7 +72655,7 @@ module.exports = CanvasInterpolation; /***/ }), -/* 351 */ +/* 360 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67896,7 +72664,7 @@ module.exports = CanvasInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(34); +var CONST = __webpack_require__(39); /** * Called automatically by Phaser.Game and responsible for creating the console.log debug header. @@ -67933,11 +72701,11 @@ var DebugHeader = function (game) var audioType; - if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + if (deviceAudio.webAudio && !audioConfig.disableWebAudio) { audioType = 'Web Audio'; } - else if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + else if (audioConfig.noAudio || (!deviceAudio.webAudio && !deviceAudio.audioData)) { audioType = 'No Audio'; } @@ -68017,7 +72785,7 @@ module.exports = DebugHeader; /***/ }), -/* 352 */ +/* 361 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68029,7 +72797,7 @@ module.exports = DebugHeader; var Class = __webpack_require__(0); var GetValue = __webpack_require__(6); var NOOP = __webpack_require__(1); -var RequestAnimationFrame = __webpack_require__(353); +var RequestAnimationFrame = __webpack_require__(362); // http://www.testufo.com/#test=animation-time-graph @@ -68111,7 +72879,7 @@ var TimeStep = new Class({ * The minimum fps rate you want the Time Step to run at. * * @name Phaser.Core.TimeStep#minFps - * @type {integer} + * @type {number} * @default 5 * @since 3.0.0 */ @@ -68125,7 +72893,7 @@ var TimeStep = new Class({ * is spiraling out of control. * * @name Phaser.Core.TimeStep#targetFps - * @type {integer} + * @type {number} * @default 60 * @since 3.0.0 */ @@ -68157,7 +72925,7 @@ var TimeStep = new Class({ * An exponential moving average of the frames per second. * * @name Phaser.Core.TimeStep#actualFps - * @type {integer} + * @type {number} * @readonly * @default 60 * @since 3.0.0 @@ -68169,7 +72937,7 @@ var TimeStep = new Class({ * When an fps update happens, the `framesThisSecond` value is reset. * * @name Phaser.Core.TimeStep#nextFpsUpdate - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -68180,7 +72948,7 @@ var TimeStep = new Class({ * The number of frames processed this second. * * @name Phaser.Core.TimeStep#framesThisSecond - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -68245,7 +73013,7 @@ var TimeStep = new Class({ * time has passed and is unaffected by delta smoothing. * * @name Phaser.Core.TimeStep#frame - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -68279,7 +73047,7 @@ var TimeStep = new Class({ * An internal counter to allow for the browser 'cooling down' after coming back into focus. * * @name Phaser.Core.TimeStep#_coolDown - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -68290,7 +73058,7 @@ var TimeStep = new Class({ * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. * * @name Phaser.Core.TimeStep#delta - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -68300,7 +73068,7 @@ var TimeStep = new Class({ * Internal index of the delta history position. * * @name Phaser.Core.TimeStep#deltaIndex - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -68310,7 +73078,7 @@ var TimeStep = new Class({ * Internal array holding the previous delta values, used for delta smoothing. * * @name Phaser.Core.TimeStep#deltaHistory - * @type {integer[]} + * @type {number[]} * @since 3.0.0 */ this.deltaHistory = []; @@ -68321,7 +73089,7 @@ var TimeStep = new Class({ * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. * * @name Phaser.Core.TimeStep#deltaSmoothingMax - * @type {integer} + * @type {number} * @default 10 * @since 3.0.0 */ @@ -68334,7 +73102,7 @@ var TimeStep = new Class({ * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. * * @name Phaser.Core.TimeStep#panicMax - * @type {integer} + * @type {number} * @default 120 * @since 3.0.0 */ @@ -68747,7 +73515,7 @@ module.exports = TimeStep; /***/ }), -/* 353 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68961,7 +73729,7 @@ module.exports = RequestAnimationFrame; /***/ }), -/* 354 */ +/* 363 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68970,7 +73738,7 @@ module.exports = RequestAnimationFrame; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(21); +var Events = __webpack_require__(23); /** * The Visibility Handler is responsible for listening out for document level visibility change events. @@ -69052,7 +73820,7 @@ module.exports = VisibilityHandler; /***/ }), -/* 355 */ +/* 364 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69061,8 +73829,8 @@ module.exports = VisibilityHandler; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arne16 = __webpack_require__(356); -var CanvasPool = __webpack_require__(26); +var Arne16 = __webpack_require__(365); +var CanvasPool = __webpack_require__(31); var GetValue = __webpack_require__(6); /** @@ -69174,7 +73942,7 @@ module.exports = GenerateTexture; /***/ }), -/* 356 */ +/* 365 */ /***/ (function(module, exports) { /** @@ -69212,7 +73980,7 @@ module.exports = { /***/ }), -/* 357 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69224,8 +73992,8 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezier = __webpack_require__(339); -var Curve = __webpack_require__(83); +var CubicBezier = __webpack_require__(350); +var Curve = __webpack_require__(88); var Vector2 = __webpack_require__(3); /** @@ -69366,7 +74134,7 @@ var CubicBezierCurve = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to. - * @param {integer} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. + * @param {number} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. * * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining. */ @@ -69439,7 +74207,7 @@ module.exports = CubicBezierCurve; /***/ }), -/* 358 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69451,10 +74219,10 @@ module.exports = CubicBezierCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); -var DegToRad = __webpack_require__(41); +var Curve = __webpack_require__(88); +var DegToRad = __webpack_require__(34); var GetValue = __webpack_require__(6); -var RadToDeg = __webpack_require__(183); +var RadToDeg = __webpack_require__(188); var Vector2 = __webpack_require__(3); /** @@ -69473,10 +74241,10 @@ var Vector2 = __webpack_require__(3); * @param {number} [y=0] - The y coordinate of the ellipse. * @param {number} [xRadius=0] - The horizontal radius of ellipse. * @param {number} [yRadius=0] - The vertical radius of ellipse. - * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. - * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {number} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {number} [endAngle=360] - The end angle of the ellipse, in degrees. * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). - * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. + * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -70063,7 +74831,7 @@ module.exports = EllipseCurve; /***/ }), -/* 359 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70075,8 +74843,8 @@ module.exports = EllipseCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); -var FromPoints = __webpack_require__(186); +var Curve = __webpack_require__(88); +var FromPoints = __webpack_require__(191); var Rectangle = __webpack_require__(9); var Vector2 = __webpack_require__(3); @@ -70136,7 +74904,7 @@ var LineCurve = new Class({ * The quantity of arc length divisions within the curve. * * @name Phaser.Curves.Line#arcLengthDivisions - * @type {integer} + * @type {number} * @default 1 * @since 3.0.0 */ @@ -70269,8 +75037,8 @@ var LineCurve = new Class({ * @since 3.0.0 * * @param {number} u - A float between 0 and 1. - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The equidistant value. */ @@ -70366,7 +75134,7 @@ module.exports = LineCurve; /***/ }), -/* 360 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70505,7 +75273,7 @@ module.exports = MoveTo; /***/ }), -/* 361 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70515,8 +75283,8 @@ module.exports = MoveTo; */ var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); -var QuadraticBezierInterpolation = __webpack_require__(340); +var Curve = __webpack_require__(88); +var QuadraticBezierInterpolation = __webpack_require__(351); var Vector2 = __webpack_require__(3); /** @@ -70651,7 +75419,7 @@ var QuadraticBezier = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto. - * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. + * @param {number} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. * * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to. */ @@ -70722,7 +75490,7 @@ module.exports = QuadraticBezier; /***/ }), -/* 362 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70733,9 +75501,9 @@ module.exports = QuadraticBezier; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) -var CatmullRom = __webpack_require__(181); +var CatmullRom = __webpack_require__(186); var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); +var Curve = __webpack_require__(88); var Vector2 = __webpack_require__(3); /** @@ -70947,7 +75715,7 @@ module.exports = SplineCurve; /***/ }), -/* 363 */ +/* 372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71073,7 +75841,7 @@ module.exports = BaseShader; /***/ }), -/* 364 */ +/* 373 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71082,33 +75850,33 @@ module.exports = BaseShader; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); -Color.ColorToRGBA = __webpack_require__(840); -Color.ComponentToHex = __webpack_require__(365); -Color.GetColor = __webpack_require__(175); -Color.GetColor32 = __webpack_require__(308); -Color.GetColorFromValue = __webpack_require__(119); -Color.HexStringToColor = __webpack_require__(307); -Color.HSLToColor = __webpack_require__(841); -Color.HSVColorWheel = __webpack_require__(842); -Color.HSVToRGB = __webpack_require__(176); -Color.HueToComponent = __webpack_require__(366); -Color.IntegerToColor = __webpack_require__(310); -Color.IntegerToRGB = __webpack_require__(311); -Color.Interpolate = __webpack_require__(843); -Color.ObjectToColor = __webpack_require__(312); -Color.RandomRGB = __webpack_require__(844); -Color.RGBStringToColor = __webpack_require__(313); -Color.RGBToHSV = __webpack_require__(309); -Color.RGBToString = __webpack_require__(845); -Color.ValueToColor = __webpack_require__(174); +Color.ColorSpectrum = __webpack_require__(895); +Color.ColorToRGBA = __webpack_require__(896); +Color.ComponentToHex = __webpack_require__(374); +Color.GetColor = __webpack_require__(100); +Color.GetColor32 = __webpack_require__(320); +Color.HexStringToColor = __webpack_require__(319); +Color.HSLToColor = __webpack_require__(897); +Color.HSVColorWheel = __webpack_require__(898); +Color.HSVToRGB = __webpack_require__(180); +Color.HueToComponent = __webpack_require__(375); +Color.IntegerToColor = __webpack_require__(322); +Color.IntegerToRGB = __webpack_require__(181); +Color.Interpolate = __webpack_require__(899); +Color.ObjectToColor = __webpack_require__(323); +Color.RandomRGB = __webpack_require__(900); +Color.RGBStringToColor = __webpack_require__(324); +Color.RGBToHSV = __webpack_require__(321); +Color.RGBToString = __webpack_require__(901); +Color.ValueToColor = __webpack_require__(179); module.exports = Color; /***/ }), -/* 365 */ +/* 374 */ /***/ (function(module, exports) { /** @@ -71123,7 +75891,7 @@ module.exports = Color; * @function Phaser.Display.Color.ComponentToHex * @since 3.0.0 * - * @param {integer} color - The color channel to get the hex value for, must be a value between 0 and 255. + * @param {number} color - The color channel to get the hex value for, must be a value between 0 and 255. * * @return {string} A string of length 2 characters, i.e. 255 = ff, 100 = 64. */ @@ -71138,7 +75906,7 @@ module.exports = ComponentToHex; /***/ }), -/* 366 */ +/* 375 */ /***/ (function(module, exports) { /** @@ -71194,7 +75962,7 @@ module.exports = HueToComponent; /***/ }), -/* 367 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71203,7 +75971,227 @@ module.exports = HueToComponent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(125); +var Class = __webpack_require__(0); +var NOOP = __webpack_require__(1); + +/** + * @classdesc + * The RGB class holds a single color value and allows for easy modification and reading of it, + * with optional on-change callback notification and a dirty flag. + * + * @class RGB + * @memberof Phaser.Display + * @constructor + * @since 3.50.0 + * + * @param {number} [red=0] - The red color value. A number between 0 and 1. + * @param {number} [green=0] - The green color value. A number between 0 and 1. + * @param {number} [blue=0] - The blue color value. A number between 0 and 1. + */ +var RGB = new Class({ + + initialize: + + function RGB (red, green, blue) + { + /** + * Cached RGB values. + * + * @name Phaser.Display.RGB#_rgb + * @type {number[]} + * @private + * @since 3.50.0 + */ + this._rgb = [ 0, 0, 0 ]; + + /** + * This callback will be invoked each time one of the RGB color values change. + * + * The callback is sent the new color values as the parameters. + * + * @name Phaser.Display.RGB#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + /** + * Is this color dirty? + * + * @name Phaser.Display.RGB#dirty + * @type {boolean} + * @since 3.50.0 + */ + this.dirty = false; + + this.set(red, green, blue); + }, + + /** + * Sets the red, green and blue values of this RGB object, flags it as being + * dirty and then invokes the `onChangeCallback`, if set. + * + * @method Phaser.Display.RGB#set + * @since 3.50.0 + * + * @param {number} [red=0] - The red color value. A number between 0 and 1. + * @param {number} [green=0] - The green color value. A number between 0 and 1. + * @param {number} [blue=0] - The blue color value. A number between 0 and 1. + * + * @return {this} This RGB instance. + */ + set: function (red, green, blue) + { + if (red === undefined) { red = 0; } + if (green === undefined) { green = 0; } + if (blue === undefined) { blue = 0; } + + this._rgb = [ red, green, blue ]; + + this.onChange(); + + return this; + }, + + /** + * Compares the given rgb parameters with those in this object and returns + * a boolean `true` value if they are equal, otherwise it returns `false`. + * + * @method Phaser.Display.RGB#equals + * @since 3.50.0 + * + * @param {number} red - The red value to compare with this object. + * @param {number} green - The green value to compare with this object. + * @param {number} blue - The blue value to compare with this object. + * + * @return {boolean} `true` if the given values match those in this object, otherwise `false`. + */ + equals: function (red, green, blue) + { + var rgb = this._rgb; + + return (rgb.r === red && rgb.g === green && rgb.b === blue); + }, + + /** + * Internal on change handler. Sets this object as being dirty and + * then invokes the `onChangeCallback`, if set, passing in the + * new RGB values. + * + * @method Phaser.Display.RGB#onChange + * @since 3.50.0 + */ + onChange: function () + { + this.dirty = true; + + var rgb = this._rgb; + + this.onChangeCallback.call(this, rgb[0], rgb[1], rgb[2]); + }, + + /** + * The red color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + * + * @name Phaser.Display.RGB#r + * @type {number} + * @since 3.50.0 + */ + r: { + + get: function () + { + return this._rgb[0]; + }, + + set: function (value) + { + this._rgb[0] = value; + this.onChange(); + } + + }, + + /** + * The green color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + * + * @name Phaser.Display.RGB#g + * @type {number} + * @since 3.50.0 + */ + g: { + + get: function () + { + return this._rgb[1]; + }, + + set: function (value) + { + this._rgb[1] = value; + this.onChange(); + } + + }, + + /** + * The blue color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + * + * @name Phaser.Display.RGB#b + * @type {number} + * @since 3.50.0 + */ + b: { + + get: function () + { + return this._rgb[2]; + }, + + set: function (value) + { + this._rgb[2] = value; + this.onChange(); + } + + }, + + /** + * Nulls any external references this object contains. + * + * @method Phaser.Display.RGB#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.onChangeCallback = null; + } + +}); + +module.exports = RGB; + + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(102); /** * @callback ContentLoadedCallback @@ -71257,7 +76245,7 @@ module.exports = DOMContentLoaded; /***/ }), -/* 368 */ +/* 378 */ /***/ (function(module, exports) { /** @@ -71316,7 +76304,7 @@ module.exports = GetInnerHeight; /***/ }), -/* 369 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71325,7 +76313,7 @@ module.exports = GetInnerHeight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(187); +var CONST = __webpack_require__(192); /** * Attempts to determine the screen orientation using the Orientation API. @@ -71354,12 +76342,9 @@ var GetScreenOrientation = function (width, height) return orientation; } - if (screen) - { - return (screen.height > screen.width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; - } - else if (typeof window.orientation === 'number') + if (typeof window.orientation === 'number') { + // Do this check first, as iOS supports this, but also has an incomplete window.screen implementation // This may change by device based on "natural" orientation. return (window.orientation === 0 || window.orientation === 180) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; } @@ -71374,15 +76359,17 @@ var GetScreenOrientation = function (width, height) return CONST.ORIENTATION.LANDSCAPE; } } - - return (height > width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; + else + { + return (height > width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; + } }; module.exports = GetScreenOrientation; /***/ }), -/* 370 */ +/* 380 */ /***/ (function(module, exports) { /** @@ -71416,7 +76403,7 @@ module.exports = { * You can still center it yourself via CSS. * * @name Phaser.Scale.Center.NO_CENTER - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71430,7 +76417,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_BOTH - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71444,7 +76431,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_HORIZONTALLY - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71458,7 +76445,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_VERTICALLY - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71468,7 +76455,7 @@ module.exports = { /***/ }), -/* 371 */ +/* 381 */ /***/ (function(module, exports) { /** @@ -71521,7 +76508,7 @@ module.exports = { /***/ }), -/* 372 */ +/* 382 */ /***/ (function(module, exports) { /** @@ -71556,7 +76543,7 @@ module.exports = { * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. * * @name Phaser.Scale.ScaleModes.NONE - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71566,7 +76553,7 @@ module.exports = { * The height is automatically adjusted based on the width. * * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71576,7 +76563,7 @@ module.exports = { * The width is automatically adjusted based on the height. * * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71588,7 +76575,7 @@ module.exports = { * inside the area which is not covered. * * @name Phaser.Scale.ScaleModes.FIT - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71599,7 +76586,7 @@ module.exports = { * area while keeping the aspect ratio. This may extend further out than the target size. * * @name Phaser.Scale.ScaleModes.ENVELOP - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71609,7 +76596,7 @@ module.exports = { * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. * * @name Phaser.Scale.ScaleModes.RESIZE - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71619,7 +76606,7 @@ module.exports = { /***/ }), -/* 373 */ +/* 383 */ /***/ (function(module, exports) { /** @@ -71652,7 +76639,7 @@ module.exports = { * The game canvas will not be zoomed by Phaser. * * @name Phaser.Scale.Zoom.NO_ZOOM - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71662,7 +76649,7 @@ module.exports = { * The game canvas will be 2x zoomed by Phaser. * * @name Phaser.Scale.Zoom.ZOOM_2X - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71672,7 +76659,7 @@ module.exports = { * The game canvas will be 4x zoomed by Phaser. * * @name Phaser.Scale.Zoom.ZOOM_4X - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71683,7 +76670,7 @@ module.exports = { * fit into the parent, or browser window if no parent is set. * * @name Phaser.Scale.Zoom.MAX_ZOOM - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71693,7 +76680,7 @@ module.exports = { /***/ }), -/* 374 */ +/* 384 */ /***/ (function(module, exports) { /** @@ -71744,7 +76731,7 @@ module.exports = GetTarget; /***/ }), -/* 375 */ +/* 385 */ /***/ (function(module, exports) { /** @@ -71801,7 +76788,7 @@ module.exports = ParseXML; /***/ }), -/* 376 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -71811,16 +76798,16 @@ module.exports = ParseXML; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(189); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(56); -var GameEvents = __webpack_require__(21); -var Keyboard = __webpack_require__(377); -var Mouse = __webpack_require__(378); -var Pointer = __webpack_require__(379); -var Touch = __webpack_require__(380); -var TransformMatrix = __webpack_require__(31); -var TransformXY = __webpack_require__(166); +var CONST = __webpack_require__(194); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(49); +var GameEvents = __webpack_require__(23); +var Keyboard = __webpack_require__(387); +var Mouse = __webpack_require__(388); +var Pointer = __webpack_require__(389); +var Touch = __webpack_require__(390); +var TransformMatrix = __webpack_require__(24); +var TransformXY = __webpack_require__(169); /** * @classdesc @@ -71977,7 +76964,7 @@ var InputManager = new Class({ * setting the `input.activePointers` property in the Game Config. * * @name Phaser.Input.InputManager#pointersTotal - * @type {integer} + * @type {number} * @readonly * @since 3.10.0 */ @@ -72197,7 +77184,7 @@ var InputManager = new Class({ /** * Tells the Input system to set a custom cursor. - * + * * This cursor will be the default cursor used when interacting with the game canvas. * * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. @@ -72207,7 +77194,7 @@ var InputManager = new Class({ * ```javascript * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); * ``` - * + * * Please read about the differences between browsers when it comes to the file formats and sizes they support: * * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor @@ -72217,7 +77204,7 @@ var InputManager = new Class({ * * @method Phaser.Input.InputManager#setDefaultCursor * @since 3.10.0 - * + * * @param {string} cursor - The CSS to be used when setting the default cursor. */ setDefaultCursor: function (cursor) @@ -72232,7 +77219,7 @@ var InputManager = new Class({ /** * Called by the InputPlugin when processing over and out events. - * + * * Tells the Input Manager to set a custom cursor during its postUpdate step. * * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor @@ -72240,7 +77227,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#setCursor * @private * @since 3.10.0 - * + * * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method. */ setCursor: function (interactiveObject) @@ -72253,13 +77240,13 @@ var InputManager = new Class({ /** * Called by the InputPlugin when processing over and out events. - * + * * Tells the Input Manager to clear the hand cursor, if set, during its postUpdate step. * * @method Phaser.Input.InputManager#resetCursor * @private * @since 3.10.0 - * + * * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method. */ resetCursor: function (interactiveObject) @@ -72284,7 +77271,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#addPointer * @since 3.10.0 * - * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * @param {number} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. * * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. */ @@ -72325,7 +77312,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#updateInputPlugins * @since 3.16.0 * - * @param {integer} type - The type of event to process. + * @param {number} type - The type of event to process. * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. */ updateInputPlugins: function (type, pointers) @@ -72518,9 +77505,13 @@ var InputManager = new Class({ */ onMouseDown: function (event) { - this.mousePointer.down(event); + var mousePointer = this.mousePointer; - this.mousePointer.updateMotion(); + mousePointer.down(event); + + mousePointer.updateMotion(); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_DOWN, this.mousePointerContainer); }, @@ -72536,9 +77527,13 @@ var InputManager = new Class({ */ onMouseMove: function (event) { - this.mousePointer.move(event); + var mousePointer = this.mousePointer; - this.mousePointer.updateMotion(); + mousePointer.move(event); + + mousePointer.updateMotion(); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_MOVE, this.mousePointerContainer); }, @@ -72554,9 +77549,13 @@ var InputManager = new Class({ */ onMouseUp: function (event) { - this.mousePointer.up(event); + var mousePointer = this.mousePointer; - this.mousePointer.updateMotion(); + mousePointer.up(event); + + mousePointer.updateMotion(); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_UP, this.mousePointerContainer); }, @@ -72572,7 +77571,11 @@ var InputManager = new Class({ */ onMouseWheel: function (event) { - this.mousePointer.wheel(event); + var mousePointer = this.mousePointer; + + mousePointer.wheel(event); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_WHEEL, this.mousePointerContainer); }, @@ -72675,12 +77678,6 @@ var InputManager = new Class({ var x = pointer.x; var y = pointer.y; - if (camera.resolution !== 1) - { - x += camera._x; - y += camera._y; - } - // Stores the world point inside of tempPoint camera.getWorldPoint(x, y, tempPoint); @@ -72716,7 +77713,7 @@ var InputManager = new Class({ { TransformXY(px, py, gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX, gameObject.scaleY, point); } - + if (this.pointWithinHitArea(gameObject, point.x, point.y)) { output.push(gameObject); @@ -72883,7 +77880,7 @@ module.exports = InputManager; /***/ }), -/* 377 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72892,11 +77889,11 @@ module.exports = InputManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(96); +var ArrayRemove = __webpack_require__(87); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); -var InputEvents = __webpack_require__(56); -var KeyCodes = __webpack_require__(132); +var GameEvents = __webpack_require__(23); +var InputEvents = __webpack_require__(49); +var KeyCodes = __webpack_require__(138); var NOOP = __webpack_require__(1); /** @@ -72980,7 +77977,7 @@ var KeyboardManager = new Class({ * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. * * @name Phaser.Input.Keyboard.KeyboardManager#captures - * @type {integer[]} + * @type {number[]} * @since 3.16.0 */ this.captures = []; @@ -73189,7 +78186,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#addCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser. */ addCapture: function (keycode) { @@ -73256,7 +78253,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#removeCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again. */ removeCapture: function (keycode) { @@ -73327,7 +78324,7 @@ module.exports = KeyboardManager; /***/ }), -/* 378 */ +/* 388 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73337,8 +78334,8 @@ module.exports = KeyboardManager; */ var Class = __webpack_require__(0); -var Features = __webpack_require__(179); -var InputEvents = __webpack_require__(56); +var Features = __webpack_require__(183); +var InputEvents = __webpack_require__(49); var NOOP = __webpack_require__(1); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent @@ -73375,14 +78372,44 @@ var MouseManager = new Class({ this.manager = inputManager; /** - * If true the DOM mouse events will have event.preventDefault applied to them, if false they will propagate fully. + * If `true` the DOM `mousedown` event will have `preventDefault` set. * - * @name Phaser.Input.Mouse.MouseManager#capture + * @name Phaser.Input.Mouse.MouseManager#preventDefaultDown * @type {boolean} * @default true - * @since 3.0.0 + * @since 3.50.0 */ - this.capture = true; + this.preventDefaultDown = true; + + /** + * If `true` the DOM `mouseup` event will have `preventDefault` set. + * + * @name Phaser.Input.Mouse.MouseManager#preventDefaultUp + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.preventDefaultUp = true; + + /** + * If `true` the DOM `mousemove` event will have `preventDefault` set. + * + * @name Phaser.Input.Mouse.MouseManager#preventDefaultMove + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.preventDefaultMove = true; + + /** + * If `true` the DOM `wheel` event will have `preventDefault` set. + * + * @name Phaser.Input.Mouse.MouseManager#preventDefaultWheel + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.preventDefaultWheel = false; /** * A boolean that controls if the Mouse Manager is enabled or not. @@ -73514,6 +78541,20 @@ var MouseManager = new Class({ */ this.pointerLockChange = NOOP; + /** + * Are the event listeners hooked into `window.top` or `window`? + * + * This is set during the `boot` sequence. If the browser does not have access to `window.top`, + * such as in cross-origin iframe environments, this property gets set to `false` and the events + * are hooked into `window` instead. + * + * @name Phaser.Input.Mouse.MouseManager#isTop + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.isTop = true; + inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); }, @@ -73530,7 +78571,12 @@ var MouseManager = new Class({ this.enabled = config.inputMouse; this.target = config.inputMouseEventTarget; - this.capture = config.inputMouseCapture; + this.passive = config.inputMousePassive; + + this.preventDefaultDown = config.inputMousePreventDefaultDown; + this.preventDefaultUp = config.inputMousePreventDefaultUp; + this.preventDefaultMove = config.inputMousePreventDefaultMove; + this.preventDefaultWheel = config.inputMousePreventDefaultWheel; if (!this.target) { @@ -73588,6 +78634,12 @@ var MouseManager = new Class({ * It is important to note that pointer lock can only be enabled after an 'engagement gesture', * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. * + * Note for Firefox: There is a bug in certain Firefox releases that cause native DOM events like + * `mousemove` to fire continuously when in pointer lock mode. You can get around this by setting + * `this.preventDefaultMove` to `false` in this class. You may also need to do the same for + * `preventDefaultDown` and/or `preventDefaultUp`. Please test combinations of these if you encounter + * the error. + * * @method Phaser.Input.Mouse.MouseManager#requestPointerLock * @since 3.0.0 */ @@ -73629,17 +78681,25 @@ var MouseManager = new Class({ */ startListeners: function () { + var target = this.target; + + if (!target) + { + return; + } + var _this = this; - var canvas = this.manager.canvas; - var autoFocus = (window && window.focus && this.manager.game.config.autoFocus); + var manager = this.manager; + var canvas = manager.canvas; + var autoFocus = (window && window.focus && manager.game.config.autoFocus); this.onMouseMove = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseMove(event); + manager.onMouseMove(event); - if (_this.capture) + if (_this.preventDefaultMove) { event.preventDefault(); } @@ -73653,11 +78713,11 @@ var MouseManager = new Class({ window.focus(); } - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseDown(event); + manager.onMouseDown(event); - if (_this.capture && event.target === canvas) + if (_this.preventDefaultDown && event.target === canvas) { event.preventDefault(); } @@ -73666,20 +78726,20 @@ var MouseManager = new Class({ this.onMouseDownWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onMouseDown(event); + manager.onMouseDown(event); } }; this.onMouseUp = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseUp(event); + manager.onMouseUp(event); - if (_this.capture && event.target === canvas) + if (_this.preventDefaultUp && event.target === canvas) { event.preventDefault(); } @@ -73688,58 +78748,73 @@ var MouseManager = new Class({ this.onMouseUpWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onMouseUp(event); + manager.onMouseUp(event); } }; this.onMouseOver = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.setCanvasOver(event); + manager.setCanvasOver(event); } }; this.onMouseOut = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.setCanvasOut(event); + manager.setCanvasOut(event); } }; this.onMouseWheel = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseWheel(event); + manager.onMouseWheel(event); + } + + if (_this.preventDefaultWheel && event.target === canvas) + { + event.preventDefault(); } }; - var target = this.target; + var passive = { passive: true }; - if (!target) + target.addEventListener('mousemove', this.onMouseMove); + target.addEventListener('mousedown', this.onMouseDown); + target.addEventListener('mouseup', this.onMouseUp); + target.addEventListener('mouseover', this.onMouseOver, passive); + target.addEventListener('mouseout', this.onMouseOut, passive); + + if (this.preventDefaultWheel) { - return; + target.addEventListener('wheel', this.onMouseWheel, { passive: false }); + } + else + { + target.addEventListener('wheel', this.onMouseWheel, passive); } - var passive = { passive: true }; - var nonPassive = { passive: false }; - - target.addEventListener('mousemove', this.onMouseMove, (this.capture) ? nonPassive : passive); - target.addEventListener('mousedown', this.onMouseDown, (this.capture) ? nonPassive : passive); - target.addEventListener('mouseup', this.onMouseUp, (this.capture) ? nonPassive : passive); - target.addEventListener('mouseover', this.onMouseOver, (this.capture) ? nonPassive : passive); - target.addEventListener('mouseout', this.onMouseOut, (this.capture) ? nonPassive : passive); - target.addEventListener('wheel', this.onMouseWheel, (this.capture) ? nonPassive : passive); - - if (window && this.manager.game.config.inputWindowEvents) + if (window && manager.game.config.inputWindowEvents) { - window.top.addEventListener('mousedown', this.onMouseDownWindow, nonPassive); - window.top.addEventListener('mouseup', this.onMouseUpWindow, nonPassive); + try + { + window.top.addEventListener('mousedown', this.onMouseDownWindow, passive); + window.top.addEventListener('mouseup', this.onMouseUpWindow, passive); + } + catch (exception) + { + window.addEventListener('mousedown', this.onMouseDownWindow, passive); + window.addEventListener('mouseup', this.onMouseUpWindow, passive); + + this.isTop = false; + } } if (Features.pointerLock) @@ -73750,7 +78825,7 @@ var MouseManager = new Class({ _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; - _this.manager.onPointerLockChange(event); + manager.onPointerLockChange(event); }; document.addEventListener('pointerlockchange', this.pointerLockChange, true); @@ -73780,8 +78855,10 @@ var MouseManager = new Class({ if (window) { - window.top.removeEventListener('mousedown', this.onMouseDownWindow); - window.top.removeEventListener('mouseup', this.onMouseUpWindow); + target = (this.isTop) ? window.top : window; + + target.removeEventListener('mousedown', this.onMouseDownWindow); + target.removeEventListener('mouseup', this.onMouseUpWindow); } if (Features.pointerLock) @@ -73813,7 +78890,7 @@ module.exports = MouseManager; /***/ }), -/* 379 */ +/* 389 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73822,12 +78899,13 @@ module.exports = MouseManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(330); +var Angle = __webpack_require__(341); var Class = __webpack_require__(0); -var Distance = __webpack_require__(55); -var FuzzyEqual = __webpack_require__(109); -var SmoothStepInterpolation = __webpack_require__(341); +var Distance = __webpack_require__(61); +var FuzzyEqual = __webpack_require__(121); +var SmoothStepInterpolation = __webpack_require__(352); var Vector2 = __webpack_require__(3); +var OS = __webpack_require__(102); /** * @classdesc @@ -73850,7 +78928,7 @@ var Vector2 = __webpack_require__(3); * @since 3.0.0 * * @param {Phaser.Input.InputManager} manager - A reference to the Input Manager. - * @param {integer} id - The internal ID of this Pointer. + * @param {number} id - The internal ID of this Pointer. */ var Pointer = new Class({ @@ -73871,7 +78949,7 @@ var Pointer = new Class({ * The internal ID of this Pointer. * * @name Phaser.Input.Pointer#id - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -73932,7 +79010,7 @@ var Pointer = new Class({ * however, it should behave as if the left button was clicked in the standard button layout. * * @name Phaser.Input.Pointer#button - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.18.0 @@ -73951,7 +79029,7 @@ var Pointer = new Class({ * In this case, the values are read from right to left. * * @name Phaser.Input.Pointer#buttons - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -74326,17 +79404,8 @@ var Pointer = new Class({ */ updateWorldPoint: function (camera) { - var x = this.x; - var y = this.y; - - if (camera.resolution !== 1) - { - x += camera._x; - y += camera._y; - } - // Stores the world point inside of tempPoint - var temp = camera.getWorldPoint(x, y); + var temp = camera.getWorldPoint(this.x, this.y); this.worldX = temp.x; this.worldY = temp.y; @@ -74486,6 +79555,13 @@ var Pointer = new Class({ this.downY = this.y; } + if (OS.macOS && event.ctrlKey) + { + // Override button settings on macOS + this.buttons = 2; + this.primaryDown = false; + } + if (!this.isDown) { this.isDown = true; @@ -74990,7 +80066,7 @@ var Pointer = new Class({ * @method Phaser.Input.Pointer#getInterpolatedPosition * @since 3.11.0 * - * @param {integer} [steps=10] - The number of interpolation steps to use. + * @param {number} [steps=10] - The number of interpolation steps to use. * @param {array} [out] - An array to store the results in. If not provided a new one will be created. * * @return {array} An array of interpolated values. @@ -75100,7 +80176,7 @@ module.exports = Pointer; /***/ }), -/* 380 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75110,7 +80186,7 @@ module.exports = Pointer; */ var Class = __webpack_require__(0); -var InputEvents = __webpack_require__(56); +var InputEvents = __webpack_require__(49); var NOOP = __webpack_require__(1); // https://developer.mozilla.org/en-US/docs/Web/API/Touch_events @@ -75513,7 +80589,7 @@ module.exports = TouchManager; /***/ }), -/* 381 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75523,14 +80599,14 @@ module.exports = TouchManager; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); -var EventEmitter = __webpack_require__(12); +var GameEvents = __webpack_require__(23); +var EventEmitter = __webpack_require__(10); var FileTypesManager = __webpack_require__(8); -var GameObjectCreator = __webpack_require__(16); +var GameObjectCreator = __webpack_require__(17); var GameObjectFactory = __webpack_require__(5); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); -var Remove = __webpack_require__(96); +var PluginCache = __webpack_require__(25); +var Remove = __webpack_require__(87); /** * @classdesc @@ -75991,7 +81067,7 @@ var PluginManager = new Class({ * * @param {string} key - The unique plugin key. * - * @return {integer} The index of the plugin within the plugins array. + * @return {number} The index of the plugin within the plugins array. */ getIndex: function (key) { @@ -76415,7 +81491,7 @@ module.exports = PluginManager; /***/ }), -/* 382 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76424,18 +81500,18 @@ module.exports = PluginManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(187); +var CONST = __webpack_require__(192); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(94); -var GameEvents = __webpack_require__(21); -var GetInnerHeight = __webpack_require__(368); -var GetTarget = __webpack_require__(374); -var GetScreenOrientation = __webpack_require__(369); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(101); +var GameEvents = __webpack_require__(23); +var GetInnerHeight = __webpack_require__(378); +var GetTarget = __webpack_require__(384); +var GetScreenOrientation = __webpack_require__(379); var NOOP = __webpack_require__(1); var Rectangle = __webpack_require__(9); -var Size = __webpack_require__(383); -var SnapFloor = __webpack_require__(95); +var Size = __webpack_require__(393); +var SnapFloor = __webpack_require__(72); var Vector2 = __webpack_require__(3); /** @@ -76624,7 +81700,7 @@ var ScaleManager = new Class({ /** * The Base Size component. * - * The modified game size, which is the gameSize * resolution, used to set the canvas width and height + * The modified game size, which is the auto-rounded gameSize, used to set the canvas width and height * (but not the CSS style) * * @name Phaser.Scale.ScaleManager#baseSize @@ -76653,17 +81729,6 @@ var ScaleManager = new Class({ */ this.scaleMode = CONST.SCALE_MODE.NONE; - /** - * The canvas resolution. - * - * This is hard-coded to a value of 1 in the 3.16 release of Phaser and will be enabled at a later date. - * - * @name Phaser.Scale.ScaleManager#resolution - * @type {number} - * @since 3.16.0 - */ - this.resolution = 1; - /** * The game zoom factor. * @@ -76785,7 +81850,7 @@ var ScaleManager = new Class({ * checked here. * * @name Phaser.Scale.ScaleManager#resizeInterval - * @type {integer} + * @type {number} * @since 3.16.0 */ this.resizeInterval = 500; @@ -76794,7 +81859,7 @@ var ScaleManager = new Class({ * Internal size interval tracker. * * @name Phaser.Scale.ScaleManager#_lastCheck - * @type {integer} + * @type {number} * @private * @since 3.16.0 */ @@ -76841,7 +81906,7 @@ var ScaleManager = new Class({ // Parse the config to get the scaling values we need this.parseConfig(this.game.config); - this.game.events.once('boot', this.boot, this); + this.game.events.once(GameEvents.BOOT, this.boot, this); }, /** @@ -76884,6 +81949,7 @@ var ScaleManager = new Class({ } game.events.on(GameEvents.PRE_STEP, this.step, this); + game.events.once(GameEvents.READY, this.refresh, this); game.events.once(GameEvents.DESTROY, this.destroy, this); this.startListeners(); @@ -76910,7 +81976,6 @@ var ScaleManager = new Class({ var width = config.width; var height = config.height; var scaleMode = config.scaleMode; - var resolution = config.resolution; var zoom = config.zoom; var autoRound = config.autoRound; @@ -76946,11 +82011,6 @@ var ScaleManager = new Class({ height = Math.floor(parentHeight * parentScaleY); } - // This is fixed at 1 on purpose. - // Changing it will break all user input. - // Wait for another release to solve this issue. - this.resolution = 1; - this.scaleMode = scaleMode; this.autoRound = autoRound; @@ -76980,8 +82040,8 @@ var ScaleManager = new Class({ this._resetZoom = true; } - // The modified game size, which is the w/h * resolution - this.baseSize.setSize(width * resolution, height * resolution); + // The modified game size + this.baseSize.setSize(width, height); if (autoRound) { @@ -77082,9 +82142,8 @@ var ScaleManager = new Class({ DOMRect.height = GetInnerHeight(true); } - var resolution = this.resolution; - var newWidth = DOMRect.width * resolution; - var newHeight = DOMRect.height * resolution; + var newWidth = DOMRect.width; + var newHeight = DOMRect.height; if (parentSize.width !== newWidth || parentSize.height !== newHeight) { @@ -77164,7 +82223,6 @@ var ScaleManager = new Class({ setGameSize: function (width, height) { var autoRound = this.autoRound; - var resolution = this.resolution; if (autoRound) { @@ -77178,8 +82236,8 @@ var ScaleManager = new Class({ // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc this.gameSize.resize(width, height); - // The modified game size, which is the w/h * resolution - this.baseSize.resize(width * resolution, height * resolution); + // The modified game size + this.baseSize.resize(width, height); if (autoRound) { @@ -77229,7 +82287,6 @@ var ScaleManager = new Class({ resize: function (width, height) { var zoom = this.zoom; - var resolution = this.resolution; var autoRound = this.autoRound; if (autoRound) @@ -77244,8 +82301,8 @@ var ScaleManager = new Class({ // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc this.gameSize.resize(width, height); - // The modified game size, which is the w/h * resolution - this.baseSize.resize(width * resolution, height * resolution); + // The modified game size + this.baseSize.resize(width, height); if (autoRound) { @@ -77255,7 +82312,7 @@ var ScaleManager = new Class({ // The size used for the canvas style, factoring in the scale mode and parent and zoom value // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change) - this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution); + this.displaySize.setSize((width * zoom), (height * zoom)); this.canvas.width = this.baseSize.width; this.canvas.height = this.baseSize.height; @@ -77287,7 +82344,7 @@ var ScaleManager = new Class({ * @fires Phaser.Scale.Events#RESIZE * @since 3.16.0 * - * @param {integer} value - The new zoom value of the game. + * @param {number} value - The new zoom value of the game. * * @return {this} The Scale Manager instance. */ @@ -77359,7 +82416,7 @@ var ScaleManager = new Class({ domStyle.marginTop = canvasStyle.marginTop; } - this.emit(Events.RESIZE, this.gameSize, this.baseSize, this.displaySize, this.resolution, previousWidth, previousHeight); + this.emit(Events.RESIZE, this.gameSize, this.baseSize, this.displaySize, previousWidth, previousHeight); return this; }, @@ -77408,15 +82465,14 @@ var ScaleManager = new Class({ var zoom = this.zoom; var autoRound = this.autoRound; - var resolution = 1; if (this.scaleMode === CONST.SCALE_MODE.NONE) { // No scale - this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution); + this.displaySize.setSize((width * zoom), (height * zoom)); - styleWidth = this.displaySize.width / resolution; - styleHeight = this.displaySize.height / resolution; + styleWidth = this.displaySize.width; + styleHeight = this.displaySize.height; if (autoRound) { @@ -77441,10 +82497,10 @@ var ScaleManager = new Class({ this.gameSize.setSize(this.displaySize.width, this.displaySize.height); - this.baseSize.setSize(this.displaySize.width * resolution, this.displaySize.height * resolution); + this.baseSize.setSize(this.displaySize.width, this.displaySize.height); - styleWidth = this.displaySize.width / resolution; - styleHeight = this.displaySize.height / resolution; + styleWidth = this.displaySize.width; + styleHeight = this.displaySize.height; if (autoRound) { @@ -77460,8 +82516,8 @@ var ScaleManager = new Class({ // All other scale modes this.displaySize.setSize(this.parentSize.width, this.parentSize.height); - styleWidth = this.displaySize.width / resolution; - styleHeight = this.displaySize.height / resolution; + styleWidth = this.displaySize.width; + styleHeight = this.displaySize.height; if (autoRound) { @@ -77488,7 +82544,7 @@ var ScaleManager = new Class({ * @method Phaser.Scale.ScaleManager#getMaxZoom * @since 3.16.0 * - * @return {integer} The maximum possible zoom factor. At a minimum this value is always at least 1. + * @return {number} The maximum possible zoom factor. At a minimum this value is always at least 1. */ getMaxZoom: function () { @@ -78126,7 +83182,7 @@ module.exports = ScaleManager; /***/ }), -/* 383 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -78135,9 +83191,9 @@ module.exports = ScaleManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var SnapFloor = __webpack_require__(95); +var SnapFloor = __webpack_require__(72); var Vector2 = __webpack_require__(3); /** @@ -78155,7 +83211,7 @@ var Vector2 = __webpack_require__(3); * * @param {number} [width=0] - The width of the Size component. * @param {number} [height=width] - The height of the Size component. If not given, it will use the `width`. - * @param {integer} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode. + * @param {number} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode. * @param {any} [parent=null] - The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible. */ var Size = new Class({ @@ -78204,7 +83260,7 @@ var Size = new Class({ * This property is read-only. To change it use the `setAspectMode` method. * * @name Phaser.Structs.Size#aspectMode - * @type {integer} + * @type {number} * @readonly * @since 3.16.0 */ @@ -78302,7 +83358,7 @@ var Size = new Class({ * @method Phaser.Structs.Size#setAspectMode * @since 3.16.0 * - * @param {integer} [value=0] - The aspect mode value. + * @param {number} [value=0] - The aspect mode value. * * @return {this} This Size component instance. */ @@ -78855,7 +83911,7 @@ var Size = new Class({ * * @name Phaser.Structs.Size.NONE * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.NONE = 0; @@ -78865,7 +83921,7 @@ Size.NONE = 0; * * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.WIDTH_CONTROLS_HEIGHT = 1; @@ -78875,7 +83931,7 @@ Size.WIDTH_CONTROLS_HEIGHT = 1; * * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.HEIGHT_CONTROLS_WIDTH = 2; @@ -78885,7 +83941,7 @@ Size.HEIGHT_CONTROLS_WIDTH = 2; * * @name Phaser.Structs.Size.FIT * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.FIT = 3; @@ -78895,7 +83951,7 @@ Size.FIT = 3; * * @name Phaser.Structs.Size.ENVELOP * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.ENVELOP = 4; @@ -78904,7 +83960,7 @@ module.exports = Size; /***/ }), -/* 384 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -78914,14 +83970,14 @@ module.exports = Size; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(133); +var CONST = __webpack_require__(139); var Events = __webpack_require__(20); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); var GetValue = __webpack_require__(6); -var LoaderEvents = __webpack_require__(84); +var LoaderEvents = __webpack_require__(89); var NOOP = __webpack_require__(1); -var Scene = __webpack_require__(385); -var Systems = __webpack_require__(190); +var Scene = __webpack_require__(395); +var Systems = __webpack_require__(195); /** * @classdesc @@ -78929,7 +83985,7 @@ var Systems = __webpack_require__(190); * * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the * Scenes in a Game instance. - * +ó * * * @class SceneManager * @memberof Phaser.Scenes @@ -80065,33 +85121,39 @@ var SceneManager = new Class({ if (scene) { + var sys = scene.sys; + // If the Scene is already running (perhaps they called start from a launched sub-Scene?) // then we close it down before starting it again. - if (scene.sys.isActive() || scene.sys.isPaused()) + if (sys.isActive() || sys.isPaused()) { - scene.sys.shutdown(); + sys.shutdown(); - scene.sys.start(data); + sys.sceneUpdate = NOOP; + + sys.start(data); } else { - scene.sys.start(data); + sys.sceneUpdate = NOOP; + + sys.start(data); var loader; - if (scene.sys.load) + if (sys.load) { - loader = scene.sys.load; + loader = sys.load; } // Files payload? - if (loader && scene.sys.settings.hasOwnProperty('pack')) + if (loader && sys.settings.hasOwnProperty('pack')) { loader.reset(); - if (loader.addPack({ payload: scene.sys.settings.pack })) + if (loader.addPack({ payload: sys.settings.pack })) { - scene.sys.settings.status = CONST.LOADING; + sys.settings.status = CONST.LOADING; loader.once(LoaderEvents.COMPLETE, this.payloadComplete, this); @@ -80170,7 +85232,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#getAt * @since 3.0.0 * - * @param {integer} index - The index of the Scene to retrieve. + * @param {number} index - The index of the Scene to retrieve. * * @return {(Phaser.Scene|undefined)} The Scene. */ @@ -80187,7 +85249,7 @@ var SceneManager = new Class({ * * @param {(string|Phaser.Scene)} key - The key of the Scene. * - * @return {integer} The index of the Scene. + * @return {number} The index of the Scene. */ getIndex: function (key) { @@ -80542,7 +85604,7 @@ module.exports = SceneManager; /***/ }), -/* 385 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80552,7 +85614,7 @@ module.exports = SceneManager; */ var Class = __webpack_require__(0); -var Systems = __webpack_require__(190); +var Systems = __webpack_require__(195); /** * @classdesc @@ -80806,6 +85868,15 @@ var Scene = new Class({ * @since 3.0.0 */ this.plugins; + + /** + * A reference to the renderer instance Phaser is using, either Canvas or WebGL. + * + * @name Phaser.Scene#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.50.0 + */ + this.renderer; }, /** @@ -80828,7 +85899,7 @@ module.exports = Scene; /***/ }), -/* 386 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80838,7 +85909,7 @@ module.exports = Scene; */ var GetFastValue = __webpack_require__(2); -var UppercaseFirst = __webpack_require__(191); +var UppercaseFirst = __webpack_require__(196); /** * Builds an array of which physics plugins should be activated for the given Scene. @@ -80890,7 +85961,7 @@ module.exports = GetPhysicsPlugins; /***/ }), -/* 387 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80937,7 +86008,7 @@ module.exports = GetScenePlugins; /***/ }), -/* 388 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80946,10 +86017,10 @@ module.exports = GetScenePlugins; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(133); +var CONST = __webpack_require__(139); var GetValue = __webpack_require__(6); -var Merge = __webpack_require__(134); -var InjectionMap = __webpack_require__(908); +var Merge = __webpack_require__(140); +var InjectionMap = __webpack_require__(964); /** * @namespace Phaser.Scenes.Settings @@ -81033,7 +86104,7 @@ module.exports = Settings; /***/ }), -/* 389 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -81042,18 +86113,18 @@ module.exports = Settings; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); -var CanvasTexture = __webpack_require__(390); +var CanvasPool = __webpack_require__(31); +var CanvasTexture = __webpack_require__(400); var Class = __webpack_require__(0); -var Color = __webpack_require__(32); -var CONST = __webpack_require__(34); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(130); -var GameEvents = __webpack_require__(21); -var GenerateTexture = __webpack_require__(355); +var Color = __webpack_require__(36); +var CONST = __webpack_require__(39); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(136); +var GameEvents = __webpack_require__(23); +var GenerateTexture = __webpack_require__(364); var GetValue = __webpack_require__(6); -var Parser = __webpack_require__(392); -var Texture = __webpack_require__(192); +var Parser = __webpack_require__(402); +var Texture = __webpack_require__(197); /** * @callback EachTextureCallback @@ -81142,7 +86213,7 @@ var TextureManager = new Class({ * An counting value used for emitting 'ready' event after all of managers in game is loaded. * * @name Phaser.Textures.TextureManager#_pending - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -81161,13 +86232,16 @@ var TextureManager = new Class({ */ boot: function () { - this._pending = 2; - this.on(Events.LOAD, this.updatePending, this); this.on(Events.ERROR, this.updatePending, this); - this.addBase64('__DEFAULT', this.game.config.defaultImage); - this.addBase64('__MISSING', this.game.config.missingImage); + var config = this.game.config; + + this.addBase64('__DEFAULT', config.defaultImage); + this.addBase64('__MISSING', config.missingImage); + this.addBase64('__WHITE', config.whiteImage); + + this._pending = 3; this.game.events.once(GameEvents.DESTROY, this.destroy, this); }, @@ -81282,6 +86356,10 @@ var TextureManager = new Class({ /** * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. * + * It works by creating an `Image` DOM object, then setting the `src` attribute to + * the given base64 encoded data. As a result, the process is asynchronous by its nature, + * so be sure to listen for the events this method dispatches before using the texture. + * * @method Phaser.Textures.TextureManager#addBase64 * @fires Phaser.Textures.Events#ADD * @fires Phaser.Textures.Events#ERROR @@ -81290,7 +86368,7 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {*} data - The Base64 encoded data. - * + * * @return {this} This Texture Manager instance. */ addBase64: function (key, data) @@ -81325,9 +86403,9 @@ var TextureManager = new Class({ /** * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. - * + * * You can also provide the image type and encoder options. - * + * * This will only work with bitmap based texture frames, such as those created from Texture Atlases. * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please * see the WebGL Snapshot function instead. @@ -81336,10 +86414,10 @@ var TextureManager = new Class({ * @since 3.12.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. * @param {string} [type='image/png'] - A DOMString indicating the image format. The default format type is image/png. * @param {number} [encoderOptions=0.92] - A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp. If this argument is anything else, the default value for image quality is used. The default value is 0.92. Other arguments are ignored. - * + * * @return {string} The base64 encoded data, or an empty string if the texture frame could not be found. */ getBase64: function (key, frame, type, encoderOptions) @@ -81412,15 +86490,18 @@ var TextureManager = new Class({ this.emit(Events.ADD, key, texture); } - + return texture; }, /** * Takes a WebGL Texture and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. - * + * * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. - * + * + * If the `width` and `height` arguments are omitted, but the WebGL Texture was created by Phaser's WebGL Renderer + * and has `glTexture.width` and `glTexture.height` properties, these values will be used instead. + * * This is a WebGL only feature. * * @method Phaser.Textures.TextureManager#addGLTexture @@ -81429,8 +86510,8 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {WebGLTexture} glTexture - The source Render Texture. - * @param {number} width - The new width of the Texture. - * @param {number} height - The new height of the Texture. + * @param {number} [width] - The new width of the Texture. Read from `glTexture.width` if omitted. + * @param {number} [height] - The new height of the Texture. Read from `glTexture.height` if omitted. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -81440,13 +86521,16 @@ var TextureManager = new Class({ if (this.checkKey(key)) { + if (width === undefined) { width = glTexture.width; } + if (height === undefined) { height = glTexture.height; } + texture = this.create(key, glTexture, width, height); texture.add('__BASE', 0, 0, 0, width, height); this.emit(Events.ADD, key, texture); } - + return texture; }, @@ -81475,17 +86559,17 @@ var TextureManager = new Class({ this.emit(Events.ADD, key, texture); } - + return texture; }, /** * Creates a new Texture using the given config values. - * + * * Generated textures consist of a Canvas element to which the texture data is drawn. - * + * * Generates a texture based on the given Create configuration object. - * + * * The texture is drawn using a fixed-size indexed palette of 16 colors, where the hex value in the * data cells map to a single color. For example, if the texture config looked like this: * @@ -81504,14 +86588,14 @@ var TextureManager = new Class({ * '.27887.78872.', * '.787.....787.' * ]; - * + * * this.textures.generate('star', { data: star, pixelWidth: 4 }); * ``` - * + * * Then it would generate a texture that is 52 x 48 pixels in size, because each cell of the data array * represents 1 pixel multiplied by the `pixelWidth` value. The cell values, such as `8`, maps to color * number 8 in the palette. If a cell contains a period character `.` then it is transparent. - * + * * The default palette is Arne16, but you can specify your own using the `palette` property. * * @method Phaser.Textures.TextureManager#generate @@ -81550,8 +86634,8 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {integer} [width=256] - The width of the Canvas element. - * @param {integer} [height=256] - The height of the Canvas element. + * @param {number} [width=256] - The width of the Canvas element. + * @param {number} [height=256] - The height of the Canvas element. * * @return {?Phaser.Textures.CanvasTexture} The Canvas Texture that was created, or `null` if the key is already in use. */ @@ -81755,7 +86839,7 @@ var TextureManager = new Class({ if (this.checkKey(key)) { texture = this.create(key, source); - + Parser.AtlasXML(texture, 0, data); if (dataSource) @@ -81901,8 +86985,8 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. - * @param {integer} width - The width of the Texture. - * @param {integer} height - The height of the Texture. + * @param {number} width - The width of the Texture. + * @param {number} height - The height of the Texture. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -81937,11 +87021,11 @@ var TextureManager = new Class({ /** * Returns a Texture from the Texture Manager that matches the given key. - * + * * If the key is `undefined` it will return the `__DEFAULT` Texture. - * + * * If the key is an instance of a Texture, it will return the key directly. - * + * * Finally. if the key is given, but not found and not a Texture instance, it will return the `__MISSING` Texture. * * @method Phaser.Textures.TextureManager#get @@ -81976,7 +87060,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} frame - The string or index of the Frame to be cloned. + * @param {(string|number)} frame - The string or index of the Frame to be cloned. * * @return {Phaser.Textures.Frame} A Clone of the given Frame. */ @@ -81995,7 +87079,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. * * @return {Phaser.Textures.Frame} A Texture Frame object. */ @@ -82039,10 +87123,10 @@ var TextureManager = new Class({ * @method Phaser.Textures.TextureManager#getPixel * @since 3.0.0 * - * @param {integer} x - The x coordinate of the pixel within the Texture. - * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {number} x - The x coordinate of the pixel within the Texture. + * @param {number} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel, * or `null` if the coordinates were out of bounds. @@ -82086,12 +87170,12 @@ var TextureManager = new Class({ * @method Phaser.Textures.TextureManager#getPixelAlpha * @since 3.10.0 * - * @param {integer} x - The x coordinate of the pixel within the Texture. - * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {number} x - The x coordinate of the pixel within the Texture. + * @param {number} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * - * @return {integer} A value between 0 and 255, or `null` if the coordinates were out of bounds. + * @return {number} A value between 0 and 255, or `null` if the coordinates were out of bounds. */ getPixelAlpha: function (x, y, key, frame) { @@ -82114,9 +87198,9 @@ var TextureManager = new Class({ ctx.clearRect(0, 0, 1, 1); ctx.drawImage(textureFrame.source.image, x, y, 1, 1, 0, 0, 1, 1); - + var rgb = ctx.getImageData(0, 0, 1, 1); - + return rgb.data[3]; } } @@ -82133,7 +87217,7 @@ var TextureManager = new Class({ * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the texture would be set on. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * * @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on. */ @@ -82150,9 +87234,9 @@ var TextureManager = new Class({ /** * Changes the key being used by a Texture to the new key provided. - * + * * The old key is removed, allowing it to be re-used. - * + * * Game Objects are linked to Textures by a reference to the Texture object, so * all existing references will be retained. * @@ -82235,7 +87319,7 @@ module.exports = TextureManager; /***/ }), -/* 390 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82245,11 +87329,11 @@ module.exports = TextureManager; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); -var Color = __webpack_require__(32); -var CONST = __webpack_require__(34); -var IsSizePowerOfTwo = __webpack_require__(128); -var Texture = __webpack_require__(192); +var Clamp = __webpack_require__(16); +var Color = __webpack_require__(36); +var CONST = __webpack_require__(39); +var IsSizePowerOfTwo = __webpack_require__(133); +var Texture = __webpack_require__(197); /** * @classdesc @@ -82263,10 +87347,10 @@ var Texture = __webpack_require__(192); * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading * texture data to it. This restriction does not apply if using the Canvas Renderer. - * + * * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify * sections of the canvas using the `add` method. - * + * * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause * graphical errors. @@ -82280,8 +87364,8 @@ var Texture = __webpack_require__(192); * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. * @param {string} key - The unique string-based key of this Texture. * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. - * @param {integer} width - The width of the canvas. - * @param {integer} height - The height of the canvas. + * @param {number} width - The width of the canvas. + * @param {number} height - The height of the canvas. */ var CanvasTexture = new Class({ @@ -82331,7 +87415,7 @@ var CanvasTexture = new Class({ * * @name Phaser.Textures.CanvasTexture#width * @readonly - * @type {integer} + * @type {number} * @since 3.7.0 */ this.width = width; @@ -82342,7 +87426,7 @@ var CanvasTexture = new Class({ * * @name Phaser.Textures.CanvasTexture#height * @readonly - * @type {integer} + * @type {number} * @since 3.7.0 */ this.height = height; @@ -82456,11 +87540,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#draw * @since 3.13.0 - * - * @param {integer} x - The x coordinate to draw the source at. - * @param {integer} y - The y coordinate to draw the source at. + * + * @param {number} x - The x coordinate to draw the source at. + * @param {number} y - The y coordinate to draw the source at. * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. - * + * * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. */ draw: function (x, y, source) @@ -82476,12 +87560,12 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#drawFrame * @since 3.16.0 - * + * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. - * @param {integer} [x=0] - The x coordinate to draw the source at. - * @param {integer} [y=0] - The y coordinate to draw the source at. - * + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {number} [x=0] - The x coordinate to draw the source at. + * @param {number} [y=0] - The y coordinate to draw the source at. + * * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. */ drawFrame: function (key, frame, x, y) @@ -82524,14 +87608,14 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#setPixel * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. - * + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. + * * @return {this} This CanvasTexture. */ setPixel: function (x, y, red, green, blue, alpha) @@ -82563,15 +87647,15 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#putData * @since 3.16.0 - * + * * @param {ImageData} imageData - The ImageData to put at the given location. - * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. - * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. - * + * @param {number} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {number} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {number} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. + * @param {number} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. + * * @return {this} This CanvasTexture. */ putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) @@ -82592,12 +87676,12 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#getData * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. - * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. - * + * + * @param {number} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param {number} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + * * @return {ImageData} The ImageData extracted from this CanvasTexture. */ getData: function (x, y, width, height) @@ -82614,17 +87698,17 @@ var CanvasTexture = new Class({ /** * Get the color of a specific pixel from this texture and store it in a Color object. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * * @method Phaser.Textures.CanvasTexture#getPixel * @since 3.13.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. - * + * * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. */ getPixel: function (x, y, out) @@ -82656,18 +87740,18 @@ var CanvasTexture = new Class({ * * If the requested region extends outside the bounds of this CanvasTexture, * the region is truncated to fit. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * * @method Phaser.Textures.CanvasTexture#getPixels * @since 3.16.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. - * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. - * + * + * @param {number} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. + * @param {number} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. + * * @return {Phaser.Types.Textures.PixelConfig[][]} A 2d array of Pixel objects. */ getPixels: function (x, y, width, height) @@ -82716,11 +87800,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#getIndex * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * - * @return {integer} + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @return {number} */ getIndex: function (x, y) { @@ -82786,11 +87870,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#clear * @since 3.7.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. - * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. - * @param {integer} [width] - The width of the region. - * @param {integer} [height] - The height of the region. + * + * @param {number} [x=0] - The x coordinate of the top-left of the region to clear. + * @param {number} [y=0] - The y coordinate of the top-left of the region to clear. + * @param {number} [width] - The width of the region. + * @param {number} [height] - The height of the region. * * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. */ @@ -82812,8 +87896,8 @@ var CanvasTexture = new Class({ * @method Phaser.Textures.CanvasTexture#setSize * @since 3.7.0 * - * @param {integer} width - The new width of the Canvas. - * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. + * @param {number} width - The new width of the Canvas. + * @param {number} [height] - The new height of the Canvas. If not given it will use the width as the height. * * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. */ @@ -82870,7 +87954,7 @@ module.exports = CanvasTexture; /***/ }), -/* 391 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82879,10 +87963,10 @@ module.exports = CanvasTexture; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); -var IsSizePowerOfTwo = __webpack_require__(128); -var ScaleModes = __webpack_require__(247); +var IsSizePowerOfTwo = __webpack_require__(133); +var ScaleModes = __webpack_require__(260); /** * @classdesc @@ -82899,8 +87983,8 @@ var ScaleModes = __webpack_require__(247); * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. * @param {(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} source - The source image data. - * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. - * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. + * @param {number} [width] - Optional width of the source image. If not given it's derived from the source itself. + * @param {number} [height] - Optional height of the source image. If not given it's derived from the source itself. * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. */ var TextureSource = new Class({ @@ -82957,7 +88041,7 @@ var TextureSource = new Class({ * Currently un-used. * * @name Phaser.Textures.TextureSource#compressionAlgorithm - * @type {integer} + * @type {number} * @default null * @since 3.0.0 */ @@ -82978,7 +88062,7 @@ var TextureSource = new Class({ * the `naturalWidth` and then `width` properties of the source image. * * @name Phaser.Textures.TextureSource#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = width || source.naturalWidth || source.videoWidth || source.width || 0; @@ -82988,7 +88072,7 @@ var TextureSource = new Class({ * the `naturalHeight` and then `height` properties of the source image. * * @name Phaser.Textures.TextureSource#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = height || source.naturalHeight || source.videoHeight || source.height || 0; @@ -83214,7 +88298,7 @@ var TextureSource = new Class({ { if (this.glTexture) { - this.renderer.deleteTexture(this.glTexture); + this.renderer.deleteTexture(this.glTexture, false); } if (this.isCanvas) @@ -83235,7 +88319,7 @@ module.exports = TextureSource; /***/ }), -/* 392 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83250,20 +88334,20 @@ module.exports = TextureSource; module.exports = { - AtlasXML: __webpack_require__(909), - Canvas: __webpack_require__(910), - Image: __webpack_require__(911), - JSONArray: __webpack_require__(912), - JSONHash: __webpack_require__(913), - SpriteSheet: __webpack_require__(914), - SpriteSheetFromAtlas: __webpack_require__(915), - UnityYAML: __webpack_require__(916) + AtlasXML: __webpack_require__(965), + Canvas: __webpack_require__(966), + Image: __webpack_require__(967), + JSONArray: __webpack_require__(968), + JSONHash: __webpack_require__(969), + SpriteSheet: __webpack_require__(970), + SpriteSheetFromAtlas: __webpack_require__(971), + UnityYAML: __webpack_require__(972) }; /***/ }), -/* 393 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83273,9 +88357,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HTML5AudioSoundManager = __webpack_require__(394); -var NoAudioSoundManager = __webpack_require__(397); -var WebAudioSoundManager = __webpack_require__(399); +var HTML5AudioSoundManager = __webpack_require__(404); +var NoAudioSoundManager = __webpack_require__(407); +var WebAudioSoundManager = __webpack_require__(409); /** * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. @@ -83286,7 +88370,7 @@ var WebAudioSoundManager = __webpack_require__(399); * @since 3.0.0 * * @param {Phaser.Game} game - Reference to the current game instance. - * + * * @return {(Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager|Phaser.Sound.NoAudioSoundManager)} The Sound Manager instance that was created. */ var SoundManagerCreator = { @@ -83296,12 +88380,12 @@ var SoundManagerCreator = { var audioConfig = game.config.audio; var deviceAudio = game.device.audio; - if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + if (audioConfig.noAudio || (!deviceAudio.webAudio && !deviceAudio.audioData)) { return new NoAudioSoundManager(game); } - if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + if (deviceAudio.webAudio && !audioConfig.disableWebAudio) { return new WebAudioSoundManager(game); } @@ -83315,7 +88399,7 @@ module.exports = SoundManagerCreator; /***/ }), -/* 394 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83325,10 +88409,10 @@ module.exports = SoundManagerCreator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(135); +var BaseSoundManager = __webpack_require__(141); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); -var HTML5AudioSound = __webpack_require__(396); +var Events = __webpack_require__(66); +var HTML5AudioSound = __webpack_require__(406); /** * HTML5 Audio implementation of the Sound Manager. @@ -83784,7 +88868,7 @@ module.exports = HTML5AudioSoundManager; /***/ }), -/* 395 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83793,7 +88877,7 @@ module.exports = HTML5AudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Returns the first element in the array. @@ -83811,8 +88895,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=array.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) * * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. */ @@ -83843,7 +88927,7 @@ module.exports = GetFirst; /***/ }), -/* 396 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83853,10 +88937,10 @@ module.exports = GetFirst; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(136); +var BaseSound = __webpack_require__(142); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); -var Clamp = __webpack_require__(17); +var Events = __webpack_require__(66); +var Clamp = __webpack_require__(16); /** * @classdesc @@ -84773,7 +89857,7 @@ module.exports = HTML5AudioSound; /***/ }), -/* 397 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84783,10 +89867,10 @@ module.exports = HTML5AudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(135); +var BaseSoundManager = __webpack_require__(141); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var NoAudioSound = __webpack_require__(398); +var EventEmitter = __webpack_require__(10); +var NoAudioSound = __webpack_require__(408); var NOOP = __webpack_require__(1); /** @@ -84891,7 +89975,7 @@ module.exports = NoAudioSoundManager; /***/ }), -/* 398 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -84901,10 +89985,10 @@ module.exports = NoAudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(136); +var BaseSound = __webpack_require__(142); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Extend = __webpack_require__(19); +var EventEmitter = __webpack_require__(10); +var Extend = __webpack_require__(18); var returnFalse = function () { @@ -85082,7 +90166,7 @@ module.exports = NoAudioSound; /***/ }), -/* 399 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85092,11 +90176,11 @@ module.exports = NoAudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64ToArrayBuffer = __webpack_require__(400); -var BaseSoundManager = __webpack_require__(135); +var Base64ToArrayBuffer = __webpack_require__(410); +var BaseSoundManager = __webpack_require__(141); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); -var WebAudioSound = __webpack_require__(401); +var Events = __webpack_require__(66); +var WebAudioSound = __webpack_require__(411); /** * @classdesc @@ -85195,7 +90279,7 @@ var WebAudioSoundManager = new Class({ { var audioConfig = game.config.audio; - if (audioConfig && audioConfig.context) + if (audioConfig.context) { audioConfig.context.resume(); @@ -85442,7 +90526,7 @@ var WebAudioSoundManager = new Class({ this.masterMuteNode.disconnect(); this.masterMuteNode = null; - if (this.game.config.audio && this.game.config.audio.context) + if (this.game.config.audio.context) { this.context.suspend(); } @@ -85545,7 +90629,7 @@ module.exports = WebAudioSoundManager; /***/ }), -/* 400 */ +/* 410 */ /***/ (function(module, exports) { /** @@ -85620,7 +90704,7 @@ module.exports = Base64ToArrayBuffer; /***/ }), -/* 401 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85630,9 +90714,9 @@ module.exports = Base64ToArrayBuffer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(136); +var BaseSound = __webpack_require__(142); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); +var Events = __webpack_require__(66); /** * @classdesc @@ -86526,7 +91610,7 @@ module.exports = WebAudioSound; /***/ }), -/* 402 */ +/* 412 */ /***/ (function(module, exports) { /** @@ -86540,12 +91624,26 @@ module.exports = WebAudioSound; * * The transpose of a matrix is a new matrix whose rows are the columns of the original. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.TransposeMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [array,$return] - * + * * @param {T[][]} [array] - The array matrix to transpose. * * @return {T[][]} A new array matrix which is a transposed version of the given array. @@ -86574,7 +91672,7 @@ module.exports = TransposeMatrix; /***/ }), -/* 403 */ +/* 413 */ /***/ (function(module, exports) { /** @@ -86615,9 +91713,9 @@ function defaultCompare (a, b) * @since 3.0.0 * * @param {array} arr - The array to sort. - * @param {integer} k - The k-th element index. - * @param {integer} [left=0] - The index of the left part of the range. - * @param {integer} [right] - The index of the right part of the range. + * @param {number} k - The k-th element index. + * @param {number} [left=0] - The index of the left part of the range. + * @param {number} [right] - The index of the right part of the range. * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. */ var QuickSelect = function (arr, k, left, right, compare) @@ -86696,7 +91794,7 @@ module.exports = QuickSelect; /***/ }), -/* 404 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86706,7 +91804,7 @@ module.exports = QuickSelect; */ var GetValue = __webpack_require__(6); -var Shuffle = __webpack_require__(121); +var Shuffle = __webpack_require__(127); var BuildChunk = function (a, b, qty) { @@ -86834,7 +91932,7 @@ module.exports = Range; /***/ }), -/* 405 */ +/* 415 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86849,14 +91947,14 @@ module.exports = Range; module.exports = { - PROCESS_QUEUE_ADD: __webpack_require__(967), - PROCESS_QUEUE_REMOVE: __webpack_require__(968) + PROCESS_QUEUE_ADD: __webpack_require__(1024), + PROCESS_QUEUE_REMOVE: __webpack_require__(1025) }; /***/ }), -/* 406 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86896,7 +91994,7 @@ var BuildGameObjectAnimation = function (sprite, config) { // { anims: { // key: string - // startFrame: [string|integer] + // startFrame: [string|number] // delay: [float] // repeat: [integer] // repeatDelay: [float] @@ -86953,7 +92051,7 @@ module.exports = BuildGameObjectAnimation; /***/ }), -/* 407 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86963,7 +92061,7 @@ module.exports = BuildGameObjectAnimation; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(97); +var Frame = __webpack_require__(104); /** * @classdesc @@ -86989,7 +92087,7 @@ var Frame = __webpack_require__(97); * @param {Phaser.GameObjects.Blitter} blitter - The parent Blitter object is responsible for updating this Bob. * @param {number} x - The horizontal position of this Game Object in the world, relative to the parent Blitter position. * @param {number} y - The vertical position of this Game Object in the world, relative to the parent Blitter position. - * @param {(string|integer)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. + * @param {(string|number)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. * @param {boolean} visible - Should the Bob render visible or not to start with? */ var Bob = new Class({ @@ -87108,7 +92206,7 @@ var Bob = new Class({ * @method Phaser.GameObjects.Bob#setFrame * @since 3.0.0 * - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering. * * @return {this} This Bob Game Object. */ @@ -87158,7 +92256,7 @@ var Bob = new Class({ * * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. * * @return {this} This Bob Game Object. */ @@ -87257,7 +92355,7 @@ var Bob = new Class({ /** * Sets the visibility of this Bob. - * + * * An invisible Bob will skip rendering. * * @method Phaser.GameObjects.Bob#setVisible @@ -87277,7 +92375,7 @@ var Bob = new Class({ /** * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * A Bob with alpha 0 will skip rendering. * * @method Phaser.GameObjects.Bob#setAlpha @@ -87331,7 +92429,7 @@ var Bob = new Class({ /** * The visible state of the Bob. - * + * * An invisible Bob will skip rendering. * * @name Phaser.GameObjects.Bob#visible @@ -87355,7 +92453,7 @@ var Bob = new Class({ /** * The alpha value of the Bob, between 0 and 1. - * + * * A Bob with alpha 0 will skip rendering. * * @name Phaser.GameObjects.Bob#alpha @@ -87383,7 +92481,7 @@ module.exports = Bob; /***/ }), -/* 408 */ +/* 418 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87425,7 +92523,7 @@ module.exports = Union; /***/ }), -/* 409 */ +/* 419 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87436,13 +92534,13 @@ module.exports = Union; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DOMElementRender = __webpack_require__(981); +var DOMElementRender = __webpack_require__(1038); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); +var GameObjectEvents = __webpack_require__(32); var IsPlainObject = __webpack_require__(7); -var RemoveFromDOM = __webpack_require__(188); +var RemoveFromDOM = __webpack_require__(193); var SCENE_EVENTS = __webpack_require__(20); -var Vector4 = __webpack_require__(129); +var Vector4 = __webpack_require__(135); /** * @classdesc @@ -88421,7 +93519,7 @@ module.exports = DOMElement; /***/ }), -/* 410 */ +/* 420 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88430,8 +93528,13 @@ module.exports = DOMElement; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CSSBlendModes = __webpack_require__(982); +var CSSBlendModes = __webpack_require__(1039); var GameObject = __webpack_require__(14); +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -88444,11 +93547,10 @@ var GameObject = __webpack_require__(14); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active renderer. * @param {Phaser.GameObjects.DOMElement} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var DOMElementCSSRenderer = function (renderer, src, camera, parentMatrix) { var node = src.node; var style = node.style; @@ -88460,7 +93562,7 @@ var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, ca { style.display = 'none'; } - + return; } @@ -88472,9 +93574,9 @@ var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, ca alpha *= parent.alpha; } - var camMatrix = renderer._tempMatrix1; - var srcMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var camMatrix = tempMatrix1; + var srcMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; var dx = 0; var dy = 0; @@ -88505,9 +93607,9 @@ var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, ca { dx = (src.width) * src.originX; dy = (src.height) * src.originY; - + srcMatrix.applyITRS(src.x - dx, src.y - dy, src.rotation, src.scaleX, src.scaleY); - + camMatrix.copyFrom(camera.matrix); tx = (100 * src.originX) + '%'; @@ -88543,7 +93645,7 @@ module.exports = DOMElementCSSRenderer; /***/ }), -/* 411 */ +/* 421 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88555,8 +93657,8 @@ module.exports = DOMElementCSSRenderer; var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var ExternRender = __webpack_require__(986); +var GameObjectEvents = __webpack_require__(32); +var ExternRender = __webpack_require__(1043); /** * @classdesc @@ -88655,7 +93757,7 @@ module.exports = Extern; /***/ }), -/* 412 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88664,8 +93766,8 @@ module.exports = Extern; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(204); -var FromPercent = __webpack_require__(89); +var CircumferencePoint = __webpack_require__(209); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); var Point = __webpack_require__(4); @@ -88698,7 +93800,7 @@ module.exports = GetPoint; /***/ }), -/* 413 */ +/* 423 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88707,9 +93809,9 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(414); -var CircumferencePoint = __webpack_require__(204); -var FromPercent = __webpack_require__(89); +var Circumference = __webpack_require__(424); +var CircumferencePoint = __webpack_require__(209); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); /** @@ -88722,7 +93824,7 @@ var MATH_CONST = __webpack_require__(13); * @generic {Phaser.Geom.Point[]} O - [out,$return] * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [out] - An array to insert the points in to. If not provided a new array will be created. * @@ -88752,7 +93854,7 @@ module.exports = GetPoints; /***/ }), -/* 414 */ +/* 424 */ /***/ (function(module, exports) { /** @@ -88784,7 +93886,7 @@ module.exports = Circumference; /***/ }), -/* 415 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88793,8 +93895,8 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(203); -var SetTransform = __webpack_require__(28); +var Commands = __webpack_require__(208); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -88807,13 +93909,12 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested * @param {CanvasRenderingContext2D} [renderTargetCtx] - The target rendering context. * @param {boolean} allowClip - If `true` then path operations will be used instead of fill operations. */ -var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) +var GraphicsCanvasRenderer = function (renderer, src, camera, parentMatrix, renderTargetCtx, allowClip) { var commandBuffer = src.commandBuffer; var commandBufferLength = commandBuffer.length; @@ -89019,10 +94120,6 @@ var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, c case Commands.GRADIENT_LINE_STYLE: index += 6; break; - - case Commands.SET_TEXTURE: - index += 2; - break; } } @@ -89034,7 +94131,7 @@ module.exports = GraphicsCanvasRenderer; /***/ }), -/* 416 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89044,10 +94141,10 @@ module.exports = GraphicsCanvasRenderer; */ var Class = __webpack_require__(0); -var FloatBetween = __webpack_require__(127); -var GetEaseFunction = __webpack_require__(71); +var FloatBetween = __webpack_require__(132); +var GetEaseFunction = __webpack_require__(78); var GetFastValue = __webpack_require__(2); -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * @classdesc @@ -89273,6 +94370,10 @@ var EmitterOp = new Class({ var t = typeof value; + // Reset them in case they're not changed below + this.onEmit = this.defaultEmit; + this.onUpdate = this.defaultUpdate; + if (t === 'number') { // Explicit static value: @@ -89309,28 +94410,17 @@ var EmitterOp = new Class({ this.onUpdate = value; } } - else if (t === 'object' && (this.has(value, 'random') || this.hasBoth(value, 'start', 'end') || this.hasBoth(value, 'min', 'max'))) + else if (t === 'object' && this.hasBoth(value, 'start', 'end')) { - this.start = this.has(value, 'start') ? value.start : value.min; - this.end = this.has(value, 'end') ? value.end : value.max; + this.start = value.start; + this.end = value.end; - var isRandom = (this.hasBoth(value, 'min', 'max') || !!value.random); + // x: { start: 100, end: 400, random: true } (random optional) = eases between start and end - // A random starting value (using 'min | max' instead of 'start | end' automatically implies a random value) - - // x: { start: 100, end: 400, random: true } OR { min: 100, max: 400 } OR { random: [ 100, 400 ] } + var isRandom = this.has(value, 'random'); if (isRandom) { - var rnd = value.random; - - // x: { random: [ 100, 400 ] } = the same as doing: x: { start: 100, end: 400, random: true } - if (Array.isArray(rnd)) - { - this.start = rnd[0]; - this.end = rnd[1]; - } - this.onEmit = this.randomRangedValueEmit; } @@ -89355,19 +94445,38 @@ var EmitterOp = new Class({ var easeType = this.has(value, 'ease') ? value.ease : 'Linear'; - this.ease = GetEaseFunction(easeType); + this.ease = GetEaseFunction(easeType, value.easeParams); if (!isRandom) { this.onEmit = this.easedValueEmit; } - // BUG: alpha, rotate, scaleX, scaleY, or tint are eased here if {min, max} is given. - // Probably this branch should exclude isRandom entirely. - this.onUpdate = this.easeValueUpdate; } } + else if (t === 'object' && this.hasBoth(value, 'min', 'max')) + { + // { min: 100, max: 400 } = pick a random number between min and max + + this.start = value.min; + this.end = value.max; + this.onEmit = this.randomRangedValueEmit; + } + else if (t === 'object' && this.has(value, 'random')) + { + // { random: [ 100, 400 ] } = pick a random number between the two elements of the array + + var rnd = value.random; + + if (Array.isArray(rnd)) + { + this.start = rnd[0]; + this.end = rnd[1]; + } + + this.onEmit = this.randomRangedValueEmit; + } else if (t === 'object' && this.hasEither(value, 'onEmit', 'onUpdate')) { // Custom onEmit and onUpdate callbacks @@ -89625,7 +94734,7 @@ module.exports = EmitterOp; /***/ }), -/* 417 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89844,7 +94953,7 @@ module.exports = GravityWell; /***/ }), -/* 418 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89854,8 +94963,8 @@ module.exports = GravityWell; */ var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var DistanceBetween = __webpack_require__(55); +var DegToRad = __webpack_require__(34); +var DistanceBetween = __webpack_require__(61); /** * @classdesc @@ -90040,7 +95149,7 @@ var Particle = new Class({ * The tint applied to this Particle. * * @name Phaser.GameObjects.Particles.Particle#tint - * @type {integer} + * @type {number} * @webglOnly * @since 3.0.0 */ @@ -90150,11 +95259,6 @@ var Particle = new Class({ if (x === undefined) { - if (emitter.follow) - { - this.x += emitter.follow.x + emitter.followOffset.x; - } - this.x += emitter.x.onEmit(this, 'x'); } else @@ -90164,11 +95268,6 @@ var Particle = new Class({ if (y === undefined) { - if (emitter.follow) - { - this.y += emitter.follow.y + emitter.followOffset.y; - } - this.y += emitter.y.onEmit(this, 'y'); } else @@ -90413,7 +95512,7 @@ module.exports = Particle; /***/ }), -/* 419 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90422,22 +95521,22 @@ module.exports = Particle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); +var BlendModes = __webpack_require__(48); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DeathZone = __webpack_require__(420); -var EdgeZone = __webpack_require__(421); -var EmitterOp = __webpack_require__(416); +var DeathZone = __webpack_require__(430); +var EdgeZone = __webpack_require__(431); +var EmitterOp = __webpack_require__(426); var GetFastValue = __webpack_require__(2); -var GetRandom = __webpack_require__(196); -var HasAny = __webpack_require__(422); -var HasValue = __webpack_require__(115); -var Particle = __webpack_require__(418); -var RandomZone = __webpack_require__(423); +var GetRandom = __webpack_require__(201); +var HasAny = __webpack_require__(432); +var HasValue = __webpack_require__(123); +var Particle = __webpack_require__(428); +var RandomZone = __webpack_require__(433); var Rectangle = __webpack_require__(9); -var StableSort = __webpack_require__(139); +var StableSort = __webpack_require__(90); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * @classdesc @@ -90785,14 +95884,14 @@ var ParticleEmitter = new Class({ this.scaleY = new EmitterOp(config, 'scaleY', 1); /** - * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored. + * Color tint applied to emitted particles. Value must not include the alpha channel. * * @name Phaser.GameObjects.Particles.ParticleEmitter#tint * @type {Phaser.GameObjects.Particles.EmitterOp} - * @default 0xffffffff + * @default 0xffffff * @since 3.0.0 */ - this.tint = new EmitterOp(config, 'tint', 0xffffffff); + this.tint = new EmitterOp(config, 'tint', 0xffffff); /** * The alpha (transparency) of emitted particles. @@ -90882,7 +95981,7 @@ var ParticleEmitter = new Class({ * 0 means unlimited. * * @name Phaser.GameObjects.Particles.ParticleEmitter#maxParticles - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -91059,7 +96158,7 @@ var ParticleEmitter = new Class({ * The blend mode of this emitter's particles. * * @name Phaser.GameObjects.Particles.ParticleEmitter#blendMode - * @type {integer} + * @type {number} * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setBlendMode */ @@ -91103,7 +96202,7 @@ var ParticleEmitter = new Class({ * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. * * @name Phaser.GameObjects.Particles.ParticleEmitter#currentFrame - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame @@ -91125,7 +96224,7 @@ var ParticleEmitter = new Class({ * The number of consecutive particles that receive a single texture frame (per frame cycle). * * @name Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity - * @type {integer} + * @type {number} * @default 1 * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame @@ -91167,7 +96266,7 @@ var ParticleEmitter = new Class({ * Counts up to {@link Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity}. * * @name Phaser.GameObjects.Particles.ParticleEmitter#_frameCounter - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -91281,6 +96380,11 @@ var ParticleEmitter = new Class({ this.setFrame(config.frame); } + if (HasValue(config, 'reserve')) + { + this.reserve(config.reserve); + } + return this; }, @@ -91423,9 +96527,9 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrame * @since 3.0.0 * - * @param {(array|string|integer|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object. + * @param {(array|string|number|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object. * @param {boolean} [pickRandom=true] - Whether frames should be assigned at random from `frames`. - * @param {integer} [quantity=1] - The number of consecutive particles that will receive each frame. + * @param {number} [quantity=1] - The number of consecutive particles that will receive each frame. * * @return {this} This Particle Emitter. */ @@ -91947,7 +97051,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#reserve * @since 3.0.0 * - * @param {integer} particleCount - The number of particles to create. + * @param {number} particleCount - The number of particles to create. * * @return {this} This Particle Emitter. */ @@ -91969,7 +97073,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getAliveParticleCount * @since 3.0.0 * - * @return {integer} The number of particles with `active=true`. + * @return {number} The number of particles with `active=true`. */ getAliveParticleCount: function () { @@ -91982,7 +97086,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getDeadParticleCount * @since 3.0.0 * - * @return {integer} The number of particles with `active=false`. + * @return {number} The number of particles with `active=false`. */ getDeadParticleCount: function () { @@ -91995,7 +97099,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getParticleCount * @since 3.0.0 * - * @return {integer} The number of particles, including both alive and dead. + * @return {number} The number of particles, including both alive and dead. */ getParticleCount: function () { @@ -92277,7 +97381,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#explode * @since 3.0.0 * - * @param {integer} count - The amount of Particles to emit. + * @param {number} count - The amount of Particles to emit. * @param {number} x - The x coordinate to emit the Particles from. * @param {number} y - The y coordinate to emit the Particles from. * @@ -92298,7 +97402,7 @@ var ParticleEmitter = new Class({ * * @param {number} [x=this.x] - The x coordinate to emit the Particles from. * @param {number} [y=this.x] - The y coordinate to emit the Particles from. - * @param {integer} [count=this.quantity] - The number of Particles to emit. + * @param {number} [count=this.quantity] - The number of Particles to emit. * * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. */ @@ -92313,7 +97417,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#emitParticle * @since 3.0.0 * - * @param {integer} [count=this.quantity] - The number of Particles to emit. + * @param {number} [count=this.quantity] - The number of Particles to emit. * @param {number} [x=this.x] - The x coordinate to emit the Particles from. * @param {number} [y=this.x] - The y coordinate to emit the Particles from. * @@ -92375,7 +97479,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#preUpdate * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) @@ -92471,7 +97575,7 @@ var ParticleEmitter = new Class({ * @param {object} a - The first particle. * @param {object} b - The second particle. * - * @return {integer} The difference of a and b's y coordinates. + * @return {number} The difference of a and b's y coordinates. */ depthSortCallback: function (a, b) { @@ -92484,7 +97588,7 @@ module.exports = ParticleEmitter; /***/ }), -/* 420 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92562,7 +97666,7 @@ module.exports = DeathZone; /***/ }), -/* 421 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92583,7 +97687,7 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. - * @param {integer} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * @param {number} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * @param {number} stepRate - The distance between each particle. When set, `quantity` is implied and should be set to 0. * @param {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start. * @param {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other. @@ -92620,7 +97724,7 @@ var EdgeZone = new Class({ * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * * @name Phaser.GameObjects.Particles.Zones.EdgeZone#quantity - * @type {integer} + * @type {number} * @since 3.0.0 */ this.quantity = quantity; @@ -92806,7 +97910,7 @@ module.exports = EdgeZone; /***/ }), -/* 422 */ +/* 432 */ /***/ (function(module, exports) { /** @@ -92843,7 +97947,7 @@ module.exports = HasAny; /***/ }), -/* 423 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92857,7 +97961,7 @@ var Vector2 = __webpack_require__(3); /** * @classdesc - * A zone that places particles randomly within a shape's area. + * A zone that places particles randomly within a shapes area. * * @class RandomZone * @memberof Phaser.GameObjects.Particles.Zones @@ -92916,7 +98020,7 @@ module.exports = RandomZone; /***/ }), -/* 424 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92927,7 +98031,7 @@ module.exports = RandomZone; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Sprite = __webpack_require__(76); +var Sprite = __webpack_require__(70); /** * @classdesc @@ -92955,7 +98059,7 @@ var Sprite = __webpack_require__(76); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var PathFollower = new Class({ @@ -92983,7 +98087,7 @@ var PathFollower = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) @@ -92998,7 +98102,7 @@ module.exports = PathFollower; /***/ }), -/* 425 */ +/* 435 */ /***/ (function(module, exports) { /** @@ -93080,7 +98184,7 @@ module.exports = GetTextSize; /***/ }), -/* 426 */ +/* 436 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93092,7 +98196,7 @@ module.exports = GetTextSize; var Class = __webpack_require__(0); var GetAdvancedValue = __webpack_require__(15); var GetValue = __webpack_require__(6); -var MeasureText = __webpack_require__(427); +var MeasureText = __webpack_require__(437); // Key: [ Object Key, Default Value ] @@ -93298,7 +98402,7 @@ var TextStyle = new Class({ * The maximum number of lines to draw. * * @name Phaser.GameObjects.TextStyle#maxLines - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -94115,7 +99219,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.TextStyle#setMaxLines * @since 3.0.0 * - * @param {integer} [max=0] - The maximum number of lines to draw. + * @param {number} [max=0] - The maximum number of lines to draw. * * @return {Phaser.GameObjects.Text} The parent Text object. */ @@ -94186,7 +99290,7 @@ module.exports = TextStyle; /***/ }), -/* 427 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94195,7 +99299,7 @@ module.exports = TextStyle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); /** * Calculates the ascent, descent and fontSize of a given font style. @@ -94209,15 +99313,28 @@ var CanvasPool = __webpack_require__(26); */ var MeasureText = function (textStyle) { - // @property {HTMLCanvasElement} canvas - The canvas element that the text is rendered. var canvas = CanvasPool.create(this); - - // @property {HTMLCanvasElement} context - The context of the canvas element that the text is rendered to. var context = canvas.getContext('2d'); textStyle.syncFont(canvas, context); - var width = Math.ceil(context.measureText(textStyle.testString).width * textStyle.baselineX); + var metrics = context.measureText(textStyle.testString); + + if (metrics.hasOwnProperty('actualBoundingBoxAscent')) + { + var ascent = metrics.actualBoundingBoxAscent; + var descent = metrics.actualBoundingBoxDescent; + + CanvasPool.remove(canvas); + + return { + ascent: ascent, + descent: descent, + fontSize: ascent + descent + }; + } + + var width = Math.ceil(metrics.width * textStyle.baselineX); var baseline = width; var height = 2 * baseline; @@ -94321,7 +99438,7 @@ module.exports = MeasureText; /***/ }), -/* 428 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94330,13 +99447,13 @@ module.exports = MeasureText; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcRender = __webpack_require__(1020); +var ArcRender = __webpack_require__(1080); var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var Earcut = __webpack_require__(60); -var GeomCircle = __webpack_require__(68); +var DegToRad = __webpack_require__(34); +var Earcut = __webpack_require__(65); +var GeomCircle = __webpack_require__(71); var MATH_CONST = __webpack_require__(13); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(33); /** * @classdesc @@ -94366,8 +99483,8 @@ var Shape = __webpack_require__(30); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {number} [radius=128] - The radius of the arc. - * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. - * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {number} [startAngle=0] - The start angle of the arc, in degrees. + * @param {number} [endAngle=360] - The end angle of the arc, in degrees. * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. @@ -94397,7 +99514,7 @@ var Arc = new Class({ * Private internal value. Holds the start angle in degrees. * * @name Phaser.GameObjects.Arc#_startAngle - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -94407,7 +99524,7 @@ var Arc = new Class({ * Private internal value. Holds the end angle in degrees. * * @name Phaser.GameObjects.Arc#_endAngle - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -94504,7 +99621,7 @@ var Arc = new Class({ * The start angle of the arc, in degrees. * * @name Phaser.GameObjects.Arc#startAngle - * @type {integer} + * @type {number} * @since 3.13.0 */ startAngle: { @@ -94527,7 +99644,7 @@ var Arc = new Class({ * The end angle of the arc, in degrees. * * @name Phaser.GameObjects.Arc#endAngle - * @type {integer} + * @type {number} * @since 3.13.0 */ endAngle: { @@ -94616,7 +99733,7 @@ var Arc = new Class({ * @method Phaser.GameObjects.Arc#setStartAngle * @since 3.13.0 * - * @param {integer} value - The value to set the starting angle to. + * @param {number} value - The value to set the starting angle to. * * @return {this} This Game Object instance. */ @@ -94639,7 +99756,7 @@ var Arc = new Class({ * @method Phaser.GameObjects.Arc#setEndAngle * @since 3.13.0 * - * @param {integer} value - The value to set the ending angle to. + * @param {number} value - The value to set the ending angle to. * * @return {this} This Game Object instance. */ @@ -94730,7 +99847,7 @@ module.exports = Arc; /***/ }), -/* 429 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94740,10 +99857,10 @@ module.exports = Arc; */ var Class = __webpack_require__(0); -var CurveRender = __webpack_require__(1023); -var Earcut = __webpack_require__(60); +var CurveRender = __webpack_require__(1083); +var Earcut = __webpack_require__(65); var Rectangle = __webpack_require__(9); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(33); /** * @classdesc @@ -94797,7 +99914,7 @@ var Curve = new Class({ * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. * * @name Phaser.GameObjects.Curve#_smoothness - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -94831,7 +99948,7 @@ var Curve = new Class({ * Increase this value for smoother curves, at the cost of more polygons being rendered. * * @name Phaser.GameObjects.Curve#smoothness - * @type {integer} + * @type {number} * @default 32 * @since 3.13.0 */ @@ -94859,7 +99976,7 @@ var Curve = new Class({ * @method Phaser.GameObjects.Curve#setSmoothness * @since 3.13.0 * - * @param {integer} value - The value to set the smoothness to. + * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. */ @@ -94912,7 +100029,7 @@ module.exports = Curve; /***/ }), -/* 430 */ +/* 440 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94922,10 +100039,10 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var EllipseRender = __webpack_require__(1026); -var GeomEllipse = __webpack_require__(98); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(65); +var EllipseRender = __webpack_require__(1086); +var GeomEllipse = __webpack_require__(106); +var Shape = __webpack_require__(33); /** * @classdesc @@ -94983,7 +100100,7 @@ var Ellipse = new Class({ * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. * * @name Phaser.GameObjects.Ellipse#_smoothness - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -95008,7 +100125,7 @@ var Ellipse = new Class({ * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. * * @name Phaser.GameObjects.Ellipse#smoothness - * @type {integer} + * @type {number} * @default 64 * @since 3.13.0 */ @@ -95042,6 +100159,9 @@ var Ellipse = new Class({ */ setSize: function (width, height) { + this.width = width; + this.height = height; + this.geom.setPosition(width / 2, height / 2); this.geom.setSize(width, height); return this.updateData(); @@ -95055,7 +100175,7 @@ var Ellipse = new Class({ * @method Phaser.GameObjects.Ellipse#setSmoothness * @since 3.13.0 * - * @param {integer} value - The value to set the smoothness to. + * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. */ @@ -95099,7 +100219,7 @@ module.exports = Ellipse; /***/ }), -/* 431 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95109,8 +100229,8 @@ module.exports = Ellipse; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GridRender = __webpack_require__(1029); +var Shape = __webpack_require__(33); +var GridRender = __webpack_require__(1089); /** * @classdesc @@ -95256,7 +100376,11 @@ var Grid = new Class({ this.setSize(width, height); this.setFillStyle(fillColor, fillAlpha); - this.setOutlineStyle(outlineFillColor, outlineFillAlpha); + + if (outlineFillColor !== undefined) + { + this.setOutlineStyle(outlineFillColor, outlineFillAlpha); + } this.updateDisplayOrigin(); }, @@ -95374,7 +100498,7 @@ module.exports = Grid; /***/ }), -/* 432 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95383,9 +100507,9 @@ module.exports = Grid; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsoBoxRender = __webpack_require__(1032); +var IsoBoxRender = __webpack_require__(1092); var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(33); /** * @classdesc @@ -95444,7 +100568,7 @@ var IsoBox = new Class({ * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. * * @name Phaser.GameObjects.IsoBox#projection - * @type {integer} + * @type {number} * @default 4 * @since 3.13.0 */ @@ -95522,7 +100646,7 @@ var IsoBox = new Class({ * @method Phaser.GameObjects.IsoBox#setProjection * @since 3.13.0 * - * @param {integer} value - The value to set the projection to. + * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. */ @@ -95589,7 +100713,7 @@ module.exports = IsoBox; /***/ }), -/* 433 */ +/* 443 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95599,8 +100723,8 @@ module.exports = IsoBox; */ var Class = __webpack_require__(0); -var IsoTriangleRender = __webpack_require__(1035); -var Shape = __webpack_require__(30); +var IsoTriangleRender = __webpack_require__(1095); +var Shape = __webpack_require__(33); /** * @classdesc @@ -95662,7 +100786,7 @@ var IsoTriangle = new Class({ * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. * * @name Phaser.GameObjects.IsoTriangle#projection - * @type {integer} + * @type {number} * @default 4 * @since 3.13.0 */ @@ -95750,7 +100874,7 @@ var IsoTriangle = new Class({ * @method Phaser.GameObjects.IsoTriangle#setProjection * @since 3.13.0 * - * @param {integer} value - The value to set the projection to. + * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. */ @@ -95835,7 +100959,7 @@ module.exports = IsoTriangle; /***/ }), -/* 434 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -95845,9 +100969,9 @@ module.exports = IsoTriangle; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomLine = __webpack_require__(40); -var LineRender = __webpack_require__(1038); +var Shape = __webpack_require__(33); +var GeomLine = __webpack_require__(45); +var LineRender = __webpack_require__(1098); /** * @classdesc @@ -95855,13 +100979,13 @@ var LineRender = __webpack_require__(1038); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only stroke colors and cannot be filled. - * + * * A Line Shape allows you to draw a line between two points in your game. You can control the * stroke color and thickness of the line. In WebGL only you can also specify a different * thickness for the start and end of the line, allowing you to render lines that taper-off. - * + * * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. * * Be aware that as with all Game Objects the default origin is 0.5. If you need to draw a Line @@ -95904,8 +101028,8 @@ var Line = new Class({ Shape.call(this, scene, 'Line', new GeomLine(x1, y1, x2, y2)); - var width = this.geom.right - this.geom.left; - var height = this.geom.bottom - this.geom.top; + var width = Math.max(1, this.geom.right - this.geom.left); + var height = Math.max(1, this.geom.bottom - this.geom.top); /** * The width (or thickness) of the line. @@ -95950,15 +101074,15 @@ var Line = new Class({ /** * Sets the width of the line. - * + * * When using the WebGL renderer you can have different start and end widths. * When using the Canvas renderer only the `startWidth` value is used. The `endWidth` is ignored. - * + * * This call can be chained. * * @method Phaser.GameObjects.Line#setLineWidth * @since 3.13.0 - * + * * @param {number} startWidth - The start width of the line. * @param {number} [endWidth] - The end width of the line. Only used in WebGL. * @@ -96002,7 +101126,7 @@ module.exports = Line; /***/ }), -/* 435 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96011,13 +101135,13 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PolygonRender = __webpack_require__(1041); +var PolygonRender = __webpack_require__(1101); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var GetAABB = __webpack_require__(436); -var GeomPolygon = __webpack_require__(212); -var Shape = __webpack_require__(30); -var Smooth = __webpack_require__(439); +var Earcut = __webpack_require__(65); +var GetAABB = __webpack_require__(446); +var GeomPolygon = __webpack_require__(218); +var Shape = __webpack_require__(33); +var Smooth = __webpack_require__(449); /** * @classdesc @@ -96092,7 +101216,7 @@ var Polygon = new Class({ * @method Phaser.GameObjects.Polygon#smooth * @since 3.13.0 * - * @param {integer} [iterations=1] - The number of times to apply the polygon smoothing. + * @param {number} [iterations=1] - The number of times to apply the polygon smoothing. * * @return {this} This Game Object instance. */ @@ -96141,7 +101265,7 @@ module.exports = Polygon; /***/ }), -/* 436 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96197,7 +101321,7 @@ module.exports = GetAABB; /***/ }), -/* 437 */ +/* 447 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96206,9 +101330,9 @@ module.exports = GetAABB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); -var Line = __webpack_require__(40); -var Perimeter = __webpack_require__(438); +var Length = __webpack_require__(63); +var Line = __webpack_require__(45); +var Perimeter = __webpack_require__(448); /** * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, @@ -96218,7 +101342,7 @@ var Perimeter = __webpack_require__(438); * @since 3.12.0 * * @param {Phaser.Geom.Polygon} polygon - The Polygon to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -96274,7 +101398,7 @@ module.exports = GetPoints; /***/ }), -/* 438 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96283,8 +101407,8 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); -var Line = __webpack_require__(40); +var Length = __webpack_require__(63); +var Line = __webpack_require__(45); /** * Returns the perimeter of the given Polygon. @@ -96322,7 +101446,7 @@ module.exports = Perimeter; /***/ }), -/* 439 */ +/* 449 */ /***/ (function(module, exports) { /** @@ -96398,7 +101522,7 @@ module.exports = Smooth; /***/ }), -/* 440 */ +/* 450 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96409,8 +101533,8 @@ module.exports = Smooth; var Class = __webpack_require__(0); var GeomRectangle = __webpack_require__(9); -var Shape = __webpack_require__(30); -var RectangleRender = __webpack_require__(1044); +var Shape = __webpack_require__(33); +var RectangleRender = __webpack_require__(1104); /** * @classdesc @@ -96541,7 +101665,7 @@ module.exports = Rectangle; /***/ }), -/* 441 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96550,10 +101674,10 @@ module.exports = Rectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StarRender = __webpack_require__(1047); +var StarRender = __webpack_require__(1107); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(65); +var Shape = __webpack_require__(33); /** * @classdesc @@ -96612,7 +101736,7 @@ var Star = new Class({ * The number of points in the star. * * @name Phaser.GameObjects.Star#_points - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -96659,7 +101783,7 @@ var Star = new Class({ * @method Phaser.GameObjects.Star#setPoints * @since 3.13.0 * - * @param {integer} value - The amount of points the Star will have. + * @param {number} value - The amount of points the Star will have. * * @return {this} This Game Object instance. */ @@ -96710,7 +101834,7 @@ var Star = new Class({ * The number of points that make up the Star shape. * * @name Phaser.GameObjects.Star#points - * @type {integer} + * @type {number} * @default 5 * @since 3.13.0 */ @@ -96829,7 +101953,7 @@ module.exports = Star; /***/ }), -/* 442 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96839,9 +101963,9 @@ module.exports = Star; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomTriangle = __webpack_require__(73); -var TriangleRender = __webpack_require__(1050); +var Shape = __webpack_require__(33); +var GeomTriangle = __webpack_require__(80); +var TriangleRender = __webpack_require__(1110); /** * @classdesc @@ -96972,7 +102096,7 @@ module.exports = Triangle; /***/ }), -/* 443 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -96982,7 +102106,7 @@ module.exports = Triangle; */ var Point = __webpack_require__(4); -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); /** * Returns a Point from around the perimeter of a Triangle. @@ -97059,7 +102183,7 @@ module.exports = GetPoint; /***/ }), -/* 444 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97068,7 +102192,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); var Point = __webpack_require__(4); /** @@ -97080,7 +102204,7 @@ var Point = __webpack_require__(4); * @generic {Phaser.Geom.Point} O - [out,$return] * * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from. - * @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param {number} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. * @param {number} stepRate - If `quantity` is 0, the distance between each returned point. * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended. * @@ -97152,7 +102276,7 @@ module.exports = GetPoints; /***/ }), -/* 445 */ +/* 455 */ /***/ (function(module, exports) { /** @@ -97235,7 +102359,342 @@ module.exports = SetValue; /***/ }), -/* 446 */ +/* 456 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = __webpack_require__(111); +var Vertex = __webpack_require__(113); + +/** + * Generates a set of Face and Vertex objects by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * GenerateVerts(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * + * @function Phaser.Geom.Mesh.GenerateVerts + * @since 3.50.0 + * + * @param {number[]} vertices - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} uvs - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * + * @return {Phaser.Types.Geom.Mesh.GenerateVertsResult} The parsed Face and Vertex objects. + */ +var GenerateVerts = function (vertices, uvs, indicies, containsZ, normals, colors, alphas) +{ + if (containsZ === undefined) { containsZ = false; } + if (colors === undefined) { colors = 0xffffff; } + if (alphas === undefined) { alphas = 1; } + + if (vertices.length !== uvs.length) + { + console.warn('GenerateVerts: vertices and uvs count not equal'); + return; + } + + var result = { + faces: [], + verts: [] + }; + + var i; + + var x; + var y; + var z; + + var u; + var v; + + var color; + var alpha; + + var normalX; + var normalY; + var normalZ; + + var iInc = (containsZ) ? 3 : 2; + + var isColorArray = Array.isArray(colors); + var isAlphaArray = Array.isArray(alphas); + + if (Array.isArray(indicies) && indicies.length > 0) + { + for (i = 0; i < indicies.length; i++) + { + var index1 = indicies[i]; + var index2 = indicies[i] * 2; + var index3 = indicies[i] * iInc; + + x = vertices[index3]; + y = vertices[index3 + 1]; + z = (containsZ) ? vertices[index3 + 2] : 0; + + u = uvs[index2]; + v = uvs[index2 + 1]; + + color = (isColorArray) ? colors[index1] : colors; + alpha = (isAlphaArray) ? alphas[index1] : alphas; + + normalX = 0; + normalY = 0; + normalZ = 0; + + if (normals) + { + normalX = normals[index3]; + normalY = normals[index3 + 1]; + normalZ = (containsZ) ? normals[index3 + 2] : 0; + } + + result.verts.push(new Vertex(x, y, z, u, v, color, alpha, normalX, normalY, normalZ)); + } + } + else + { + var uvIndex = 0; + var colorIndex = 0; + + for (i = 0; i < vertices.length; i += iInc) + { + x = vertices[i]; + y = vertices[i + 1]; + z = (containsZ) ? vertices[i + 2] : 0; + + u = uvs[uvIndex]; + v = uvs[uvIndex + 1]; + + color = (isColorArray) ? colors[colorIndex] : colors; + alpha = (isAlphaArray) ? alphas[colorIndex] : alphas; + + normalX = 0; + normalY = 0; + normalZ = 0; + + if (normals) + { + normalX = normals[i]; + normalY = normals[i + 1]; + normalZ = (containsZ) ? normals[i + 2] : 0; + } + + result.verts.push(new Vertex(x, y, z, u, v, color, alpha, normalX, normalY, normalZ)); + + uvIndex += 2; + colorIndex++; + } + } + + for (i = 0; i < result.verts.length; i += 3) + { + var vert1 = result.verts[i]; + var vert2 = result.verts[i + 1]; + var vert3 = result.verts[i + 2]; + + result.faces.push(new Face(vert1, vert2, vert3)); + } + + return result; +}; + +module.exports = GenerateVerts; + + +/***/ }), +/* 457 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = __webpack_require__(111); +var Matrix4 = __webpack_require__(73); +var Vector3 = __webpack_require__(37); +var Vertex = __webpack_require__(113); + +var tempPosition = new Vector3(); +var tempRotation = new Vector3(); +var tempMatrix = new Matrix4(); + +/** + * This method will return an object containing Face and Vertex instances, generated + * from the parsed triangulated OBJ Model data given to this function. + * + * The obj data should have been parsed in advance via the ParseObj function: + * + * ```javascript + * var data = Phaser.Geom.Mesh.ParseObj(rawData, flipUV); + * + * var results = GenerateObjVerts(data); + * ``` + * + * Alternatively, you can parse obj files loaded via the OBJFile loader: + * + * ```javascript + * preload () + * { + * this.load.obj('alien', 'assets/3d/alien.obj); + * } + * + * var results = GenerateObjVerts(this.cache.obj.get('alien)); + * ``` + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can use the data returned by this function to populate the vertices of a Mesh Game Object. + * + * You may add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small (or large) to visualize. + * You can also offset the model via the `x`, `y` and `z` parameters. + * + * @function Phaser.Geom.Mesh.GenerateObjVerts + * @since 3.50.0 + * + * @param {Phaser.Types.Geom.Mesh.OBJData} data - The parsed OBJ model data. + * @param {Phaser.GameObjects.Mesh} [mesh] - An optional Mesh Game Object. If given, the generated Faces will be automatically added to this Mesh. Set to `null` to skip. + * @param {number} [scale=1] - An amount to scale the model data by. Use this if the model has exported too small, or large, to see. + * @param {number} [x=0] - Translate the model x position by this amount. + * @param {number} [y=0] - Translate the model y position by this amount. + * @param {number} [z=0] - Translate the model z position by this amount. + * @param {number} [rotateX=0] - Rotate the model on the x axis by this amount, in radians. + * @param {number} [rotateY=0] - Rotate the model on the y axis by this amount, in radians. + * @param {number} [rotateZ=0] - Rotate the model on the z axis by this amount, in radians. + * @param {boolean} [zIsUp=true] - Is the z axis up (true), or is y axis up (false)? + * + * @return {Phaser.Types.Geom.Mesh.GenerateVertsResult} The parsed Face and Vertex objects. + */ +var GenerateObjVerts = function (data, mesh, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) +{ + if (scale === undefined) { scale = 1; } + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (rotateX === undefined) { rotateX = 0; } + if (rotateY === undefined) { rotateY = 0; } + if (rotateZ === undefined) { rotateZ = 0; } + if (zIsUp === undefined) { zIsUp = true; } + + var result = { + faces: [], + verts: [] + }; + + var materials = data.materials; + + tempPosition.set(x, y, z); + tempRotation.set(rotateX, rotateY, rotateZ); + tempMatrix.fromRotationXYTranslation(tempRotation, tempPosition, zIsUp); + + for (var m = 0; m < data.models.length; m++) + { + var model = data.models[m]; + + var vertices = model.vertices; + var textureCoords = model.textureCoords; + var faces = model.faces; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + var v1 = face.vertices[0]; + var v2 = face.vertices[1]; + var v3 = face.vertices[2]; + + var m1 = vertices[v1.vertexIndex]; + var m2 = vertices[v2.vertexIndex]; + var m3 = vertices[v3.vertexIndex]; + + var t1 = v1.textureCoordsIndex; + var t2 = v2.textureCoordsIndex; + var t3 = v3.textureCoordsIndex; + + var uv1 = (t1 === -1) ? { u: 0, v: 1 } : textureCoords[t1]; + var uv2 = (t2 === -1) ? { u: 0, v: 0 } : textureCoords[t2]; + var uv3 = (t3 === -1) ? { u: 1, v: 1 } : textureCoords[t3]; + + var color = 0xffffff; + + if (face.material !== '' && materials[face.material]) + { + color = materials[face.material]; + } + + var vert1 = new Vertex(m1.x * scale, m1.y * scale, m1.z * scale, uv1.u, uv1.v, color).transformMat4(tempMatrix); + var vert2 = new Vertex(m2.x * scale, m2.y * scale, m2.z * scale, uv2.u, uv2.v, color).transformMat4(tempMatrix); + var vert3 = new Vertex(m3.x * scale, m3.y * scale, m3.z * scale, uv3.u, uv3.v, color).transformMat4(tempMatrix); + + result.verts.push(vert1, vert2, vert3); + result.faces.push(new Face(vert1, vert2, vert3)); + } + } + + if (mesh) + { + mesh.faces = mesh.faces.concat(result.faces); + mesh.vertices = mesh.vertices.concat(result.verts); + } + + return result; +}; + +module.exports = GenerateObjVerts; + + +/***/ }), +/* 458 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97245,7 +102704,7 @@ module.exports = SetValue; */ var Class = __webpack_require__(0); -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * @classdesc @@ -97726,7 +103185,7 @@ module.exports = Light; /***/ }), -/* 447 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97736,8 +103195,9 @@ module.exports = Light; */ var Class = __webpack_require__(0); -var Light = __webpack_require__(446); -var Utils = __webpack_require__(10); +var Light = __webpack_require__(458); +var Utils = __webpack_require__(12); +var PointLight = __webpack_require__(1169); /** * @callback LightForEach @@ -97820,13 +103280,18 @@ var LightsManager = new Class({ * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. * * @name Phaser.GameObjects.LightsManager#maxLights - * @type {integer} + * @type {number} * @readonly * @since 3.15.0 */ this.maxLights = -1; }, + addPointLight: function (x, y, color, radius, intensity) + { + return this.systems.displayList.add(new PointLight(this.scene, x, y, color, radius, intensity)); + }, + /** * Enable the Lights Manager. * @@ -97839,7 +103304,7 @@ var LightsManager = new Class({ { if (this.maxLights === -1) { - this.maxLights = this.scene.sys.game.renderer.config.maxLights; + this.maxLights = this.scene.sys.renderer.config.maxLights; } this.active = true; @@ -97963,7 +103428,7 @@ var LightsManager = new Class({ * @method Phaser.GameObjects.LightsManager#getMaxVisibleLights * @since 3.0.0 * - * @return {integer} The maximum number of Lights allowed to appear at once. + * @return {number} The maximum number of Lights allowed to appear at once. */ getMaxVisibleLights: function () { @@ -97976,7 +103441,7 @@ var LightsManager = new Class({ * @method Phaser.GameObjects.LightsManager#getLightCount * @since 3.0.0 * - * @return {integer} The number of Lights managed by this Lights Manager. + * @return {number} The number of Lights managed by this Lights Manager. */ getLightCount: function () { @@ -98095,7 +103560,7 @@ module.exports = LightsManager; /***/ }), -/* 448 */ +/* 460 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98104,23 +103569,24 @@ module.exports = LightsManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(49); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(55); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Geom */ var Geom = { - - Circle: __webpack_require__(1110), - Ellipse: __webpack_require__(1120), - Intersects: __webpack_require__(449), - Line: __webpack_require__(1140), - Point: __webpack_require__(1162), - Polygon: __webpack_require__(1176), - Rectangle: __webpack_require__(465), - Triangle: __webpack_require__(1209) + + Circle: __webpack_require__(1171), + Ellipse: __webpack_require__(1181), + Intersects: __webpack_require__(461), + Line: __webpack_require__(1201), + Mesh: __webpack_require__(1223), + Point: __webpack_require__(1226), + Polygon: __webpack_require__(1240), + Rectangle: __webpack_require__(479), + Triangle: __webpack_require__(1273) }; @@ -98131,7 +103597,7 @@ module.exports = Geom; /***/ }), -/* 449 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98146,39 +103612,39 @@ module.exports = Geom; module.exports = { - CircleToCircle: __webpack_require__(216), - CircleToRectangle: __webpack_require__(217), - GetCircleToCircle: __webpack_require__(1130), - GetCircleToRectangle: __webpack_require__(1131), - GetLineToCircle: __webpack_require__(218), - GetLineToLine: __webpack_require__(450), - GetLineToPoints: __webpack_require__(451), - GetLineToPolygon: __webpack_require__(452), - GetLineToRectangle: __webpack_require__(220), - GetRaysFromPointToPolygon: __webpack_require__(1132), - GetRectangleIntersection: __webpack_require__(1133), - GetRectangleToRectangle: __webpack_require__(1134), - GetRectangleToTriangle: __webpack_require__(1135), - GetTriangleToCircle: __webpack_require__(1136), - GetTriangleToLine: __webpack_require__(457), - GetTriangleToTriangle: __webpack_require__(1137), - LineToCircle: __webpack_require__(219), - LineToLine: __webpack_require__(86), - LineToRectangle: __webpack_require__(453), - PointToLine: __webpack_require__(461), - PointToLineSegment: __webpack_require__(1138), - RectangleToRectangle: __webpack_require__(143), - RectangleToTriangle: __webpack_require__(454), - RectangleToValues: __webpack_require__(1139), - TriangleToCircle: __webpack_require__(456), - TriangleToLine: __webpack_require__(458), - TriangleToTriangle: __webpack_require__(459) + CircleToCircle: __webpack_require__(222), + CircleToRectangle: __webpack_require__(223), + GetCircleToCircle: __webpack_require__(1191), + GetCircleToRectangle: __webpack_require__(1192), + GetLineToCircle: __webpack_require__(224), + GetLineToLine: __webpack_require__(462), + GetLineToPoints: __webpack_require__(463), + GetLineToPolygon: __webpack_require__(464), + GetLineToRectangle: __webpack_require__(226), + GetRaysFromPointToPolygon: __webpack_require__(1193), + GetRectangleIntersection: __webpack_require__(1194), + GetRectangleToRectangle: __webpack_require__(1195), + GetRectangleToTriangle: __webpack_require__(1196), + GetTriangleToCircle: __webpack_require__(1197), + GetTriangleToLine: __webpack_require__(469), + GetTriangleToTriangle: __webpack_require__(1198), + LineToCircle: __webpack_require__(225), + LineToLine: __webpack_require__(91), + LineToRectangle: __webpack_require__(465), + PointToLine: __webpack_require__(473), + PointToLineSegment: __webpack_require__(1199), + RectangleToRectangle: __webpack_require__(112), + RectangleToTriangle: __webpack_require__(466), + RectangleToValues: __webpack_require__(1200), + TriangleToCircle: __webpack_require__(468), + TriangleToLine: __webpack_require__(470), + TriangleToTriangle: __webpack_require__(471) }; /***/ }), -/* 450 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98187,7 +103653,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); +var Vector3 = __webpack_require__(37); /** * Checks for intersection between the two line segments and returns the intersection point as a Vector3, @@ -98207,23 +103673,35 @@ var Vector3 = __webpack_require__(81); */ var GetLineToLine = function (line1, line2, out) { - var dx1 = line1.x2 - line1.x1; - var dy1 = line1.y2 - line1.y1; + var x1 = line1.x1; + var y1 = line1.y1; + var x2 = line1.x2; + var y2 = line1.y2; - var dx2 = line2.x2 - line2.x1; - var dy2 = line2.y2 - line2.y1; + var x3 = line2.x1; + var y3 = line2.y1; + var x4 = line2.x2; + var y4 = line2.y2; - var mag1 = Math.sqrt(dx1 * dx1 + dy1 * dy1); - var mag2 = Math.sqrt(dx2 * dx2 + dy2 * dy2); + var dx1 = x2 - x1; + var dy1 = y2 - y1; - // Parallel? - if (dx1 / mag1 === dx2 / mag2 && dy1 / mag1 === dy2 / mag2) + var dx2 = x4 - x3; + var dy2 = y4 - y3; + + var denom = dy2 * dx1 - dx2 * dy1; + + // Make sure there is not a division by zero - this also indicates that the lines are parallel. + // If numA and numB were both equal to zero the lines would be on top of each other (coincidental). + // This check is not done because it is not necessary for this implementation (the parallel check accounts for this). + + if (dx1 === 0 || denom === 0) { - return null; + return false; } - var T2 = (dx1 * (line2.y1 - line1.y1) + dy1 * (line1.x1 - line2.x1)) / (dx2 * dy1 - dy2 * dx1); - var T1 = (line2.x1 + dx2 * T2 - line1.x1) / dx1; + var T2 = (dx1 * (y3 - y1) + dy1 * (x1 - x3)) / (dx2 * dy1 - dy2 * dx1); + var T1 = (x3 + dx2 * T2 - x1) / dx1; // Intersects? if (T1 < 0 || T2 < 0 || T2 > 1) @@ -98237,8 +103715,8 @@ var GetLineToLine = function (line1, line2, out) } return out.set( - line1.x1 + dx1 * T1, - line1.y1 + dy1 * T1, + x1 + dx1 * T1, + y1 + dy1 * T1, T1 ); }; @@ -98247,7 +103725,7 @@ module.exports = GetLineToLine; /***/ }), -/* 451 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98256,9 +103734,9 @@ module.exports = GetLineToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); -var GetLineToLine = __webpack_require__(450); -var Line = __webpack_require__(40); +var Vector3 = __webpack_require__(37); +var GetLineToLine = __webpack_require__(462); +var Line = __webpack_require__(45); // Temp calculation segment var segment = new Line(); @@ -98324,7 +103802,7 @@ module.exports = GetLineToPoints; /***/ }), -/* 452 */ +/* 464 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98333,9 +103811,9 @@ module.exports = GetLineToPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); -var Vector4 = __webpack_require__(129); -var GetLineToPoints = __webpack_require__(451); +var Vector3 = __webpack_require__(37); +var Vector4 = __webpack_require__(135); +var GetLineToPoints = __webpack_require__(463); // Temp vec3 var tempIntersect = new Vector3(); @@ -98395,7 +103873,7 @@ module.exports = GetLineToPolygon; /***/ }), -/* 453 */ +/* 465 */ /***/ (function(module, exports) { /** @@ -98496,7 +103974,7 @@ module.exports = LineToRectangle; /***/ }), -/* 454 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98505,10 +103983,10 @@ module.exports = LineToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToLine = __webpack_require__(86); -var Contains = __webpack_require__(50); -var ContainsArray = __webpack_require__(221); -var Decompose = __webpack_require__(455); +var LineToLine = __webpack_require__(91); +var Contains = __webpack_require__(56); +var ContainsArray = __webpack_require__(227); +var Decompose = __webpack_require__(467); /** * Checks for intersection between Rectangle shape and Triangle shape. @@ -98589,7 +104067,7 @@ module.exports = RectangleToTriangle; /***/ }), -/* 455 */ +/* 467 */ /***/ (function(module, exports) { /** @@ -98626,7 +104104,7 @@ module.exports = Decompose; /***/ }), -/* 456 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98635,8 +104113,8 @@ module.exports = Decompose; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToCircle = __webpack_require__(219); -var Contains = __webpack_require__(85); +var LineToCircle = __webpack_require__(225); +var Contains = __webpack_require__(110); /** * Checks if a Triangle and a Circle intersect. @@ -98691,7 +104169,7 @@ module.exports = TriangleToCircle; /***/ }), -/* 457 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98702,8 +104180,8 @@ module.exports = TriangleToCircle; */ var Point = __webpack_require__(4); -var TriangleToLine = __webpack_require__(458); -var LineToLine = __webpack_require__(86); +var TriangleToLine = __webpack_require__(470); +var LineToLine = __webpack_require__(91); /** * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. @@ -98750,7 +104228,7 @@ module.exports = GetTriangleToLine; /***/ }), -/* 458 */ +/* 470 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98759,12 +104237,11 @@ module.exports = GetTriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(85); -var LineToLine = __webpack_require__(86); +var LineToLine = __webpack_require__(91); /** * Checks if a Triangle and a Line intersect. - * + * * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * * @function Phaser.Geom.Intersects.TriangleToLine @@ -98778,7 +104255,7 @@ var LineToLine = __webpack_require__(86); var TriangleToLine = function (triangle, line) { // If the Triangle contains either the start or end point of the line, it intersects - if (Contains(triangle, line.getPointA()) || Contains(triangle, line.getPointB())) + if (triangle.contains(line.x1, line.y1) || triangle.contains(line.x2, line.y2)) { return true; } @@ -98806,7 +104283,7 @@ module.exports = TriangleToLine; /***/ }), -/* 459 */ +/* 471 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98815,9 +104292,9 @@ module.exports = TriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ContainsArray = __webpack_require__(221); -var Decompose = __webpack_require__(460); -var LineToLine = __webpack_require__(86); +var ContainsArray = __webpack_require__(227); +var Decompose = __webpack_require__(472); +var LineToLine = __webpack_require__(91); /** * Checks if two Triangles intersect. @@ -98896,7 +104373,7 @@ module.exports = TriangleToTriangle; /***/ }), -/* 460 */ +/* 472 */ /***/ (function(module, exports) { /** @@ -98931,7 +104408,7 @@ module.exports = Decompose; /***/ }), -/* 461 */ +/* 473 */ /***/ (function(module, exports) { /** @@ -99001,7 +104478,7 @@ module.exports = PointToLine; /***/ }), -/* 462 */ +/* 474 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99011,8 +104488,8 @@ module.exports = PointToLine; */ var MATH_CONST = __webpack_require__(13); -var Wrap = __webpack_require__(59); -var Angle = __webpack_require__(87); +var Wrap = __webpack_require__(64); +var Angle = __webpack_require__(92); /** * Get the angle of the normal of the given line in radians. @@ -99035,7 +104512,401 @@ module.exports = NormalAngle; /***/ }), -/* 463 */ +/* 475 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var flip = true; + +var defaultModelName = 'untitled'; +var currentGroup = ''; +var currentMaterial = ''; + +/** + * @ignore + */ +function stripComments (line) +{ + var idx = line.indexOf('#'); + + return (idx > -1) ? line.substring(0, idx) : line; +} + +/** + * @ignore + */ +function currentModel (result) +{ + if (result.models.length === 0) + { + result.models.push({ + faces: [], + name: defaultModelName, + textureCoords: [], + vertexNormals: [], + vertices: [] + }); + } + + currentGroup = ''; + + return result.models[result.models.length - 1]; +} + +/** + * @ignore + */ +function parseObject (lineItems, result) +{ + var modelName = lineItems.length >= 2 ? lineItems[1] : defaultModelName; + + result.models.push({ + faces: [], + name: modelName, + textureCoords: [], + vertexNormals: [], + vertices: [] + }); + + currentGroup = ''; +} + +/** + * @ignore + */ +function parseGroup (lineItems) +{ + if (lineItems.length === 2) + { + currentGroup = lineItems[1]; + } +} + +/** + * @ignore + */ +function parseVertexCoords (lineItems, result) +{ + var len = lineItems.length; + + var x = (len >= 2) ? parseFloat(lineItems[1]) : 0; + var y = (len >= 3) ? parseFloat(lineItems[2]) : 0; + var z = (len >= 4) ? parseFloat(lineItems[3]) : 0; + + currentModel(result).vertices.push({ x: x, y: y, z: z }); +} + +/** + * @ignore + */ +function parseTextureCoords (lineItems, result) +{ + var len = lineItems.length; + + var u = (len >= 2) ? parseFloat(lineItems[1]) : 0; + var v = (len >= 3) ? parseFloat(lineItems[2]) : 0; + var w = (len >= 4) ? parseFloat(lineItems[3]) : 0; + + if (isNaN(u)) + { + u = 0; + } + + if (isNaN(v)) + { + v = 0; + } + + if (isNaN(w)) + { + w = 0; + } + + if (flip) + { + v = 1 - v; + } + + currentModel(result).textureCoords.push({ u: u, v: v, w: w }); +} + +/** + * @ignore + */ +function parseVertexNormal (lineItems, result) +{ + var len = lineItems.length; + + var x = (len >= 2) ? parseFloat(lineItems[1]) : 0; + var y = (len >= 3) ? parseFloat(lineItems[2]) : 0; + var z = (len >= 4) ? parseFloat(lineItems[3]) : 0; + + currentModel(result).vertexNormals.push({ x: x, y: y, z: z }); +} + +/** + * @ignore + */ +function parsePolygon (lineItems, result) +{ + var totalVertices = lineItems.length - 1; + + if (totalVertices < 3) + { + return; + } + + var face = { + group: currentGroup, + material: currentMaterial, + vertices: [] + }; + + for (var i = 0; i < totalVertices; i++) + { + var vertexString = lineItems[i + 1]; + var vertexValues = vertexString.split('/'); + var vvLen = vertexValues.length; + + if (vvLen < 1 || vvLen > 3) + { + continue; + } + + var vertexIndex = 0; + var textureCoordsIndex = 0; + var vertexNormalIndex = 0; + + vertexIndex = parseInt(vertexValues[0], 10); + + if (vvLen > 1 && vertexValues[1] !== '') + { + textureCoordsIndex = parseInt(vertexValues[1], 10); + } + + if (vvLen > 2) + { + vertexNormalIndex = parseInt(vertexValues[2], 10); + } + + if (vertexIndex !== 0) + { + // Negative vertex indices refer to the nth last defined vertex + // convert these to postive indices for simplicity + if (vertexIndex < 0) + { + vertexIndex = currentModel(result).vertices.length + 1 + vertexIndex; + } + + textureCoordsIndex -= 1; + vertexIndex -= 1; + vertexNormalIndex -= 1; + + face.vertices.push({ + textureCoordsIndex: textureCoordsIndex, + vertexIndex: vertexIndex, + vertexNormalIndex: vertexNormalIndex + }); + } + } + + currentModel(result).faces.push(face); +} + +/** + * @ignore + */ +function parseMtlLib (lineItems, result) +{ + if (lineItems.length >= 2) + { + result.materialLibraries.push(lineItems[1]); + } +} + +/** + * @ignore + */ +function parseUseMtl (lineItems) +{ + if (lineItems.length >= 2) + { + currentMaterial = lineItems[1]; + } +} + +/** + * Parses a Wavefront OBJ File, extracting the models from it and returning them in an array. + * + * The model data *must* be triangulated for a Mesh Game Object to be able to render it. + * + * @function Phaser.Geom.Mesh.ParseObj + * @since 3.50.0 + * + * @param {string} data - The OBJ File data as a raw string. + * @param {boolean} [flipUV=true] - Flip the UV coordinates? + * + * @return {Phaser.Types.Geom.Mesh.OBJData} The parsed model and material data. + */ +var ParseObj = function (data, flipUV) +{ + if (flipUV === undefined) { flipUV = true; } + + flip = flipUV; + + // Store results in here + var result = { + materials: {}, + materialLibraries: [], + models: [] + }; + + currentGroup = ''; + currentMaterial = ''; + + var lines = data.split('\n'); + + for (var i = 0; i < lines.length; i++) + { + var line = stripComments(lines[i]); + + var lineItems = line.replace(/\s\s+/g, ' ').trim().split(' '); + + switch (lineItems[0].toLowerCase()) + { + case 'o': + // Start A New Model + parseObject(lineItems, result); + break; + + case 'g': + // Start a new polygon group + parseGroup(lineItems); + break; + + case 'v': + // Define a vertex for the current model + parseVertexCoords(lineItems, result); + break; + + case 'vt': + // Texture Coords + parseTextureCoords(lineItems, result); + break; + + case 'vn': + // Define a vertex normal for the current model + parseVertexNormal(lineItems, result); + break; + + case 'f': + // Define a Face/Polygon + parsePolygon(lineItems, result); + break; + + case 'mtllib': + // Reference to a material library file (.mtl) + parseMtlLib(lineItems, result); + break; + + case 'usemtl': + // Sets the current material to be applied to polygons defined from this point forward + parseUseMtl(lineItems); + break; + } + } + + return result; +}; + +module.exports = ParseObj; + + +/***/ }), +/* 476 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetColor = __webpack_require__(100); + +/** + * Takes a Wavefront Material file and extracts the diffuse reflectivity of the named + * materials, converts them to integer color values and returns them. + * + * This is used internally by the `addOBJ` and `addModel` methods, but is exposed for + * public consumption as well. + * + * Note this only works with diffuse values, specified in the `Kd r g b` format, where + * `g` and `b` are optional, but `r` is required. It does not support spectral rfl files, + * or any other material statement (such as `Ka` or `Ks`) + * + * @method Phaser.Geom.Mesh.ParseObjMaterial + * @since 3.50.0 + * + * @param {string} mtl - The OBJ MTL file as a raw string, i.e. loaded via `this.load.text`. + * + * @return {object} The parsed material colors, where each property of the object matches the material name. + */ +var ParseObjMaterial = function (mtl) +{ + var output = {}; + + var lines = mtl.split('\n'); + + var currentMaterial = ''; + + for (var i = 0; i < lines.length; i++) + { + var line = lines[i].trim(); + + if (line.indexOf('#') === 0 || line === '') + { + continue; + } + + var lineItems = line.replace(/\s\s+/g, ' ').trim().split(' '); + + switch (lineItems[0].toLowerCase()) + { + case 'newmtl': + { + currentMaterial = lineItems[1]; + break; + } + + // The diffuse reflectivity of the current material + // Support r, [g], [b] format, where g and b are optional + case 'kd': + { + var r = Math.floor(lineItems[1] * 255); + var g = (lineItems.length >= 2) ? Math.floor(lineItems[2] * 255) : r; + var b = (lineItems.length >= 3) ? Math.floor(lineItems[3] * 255) : r; + + output[currentMaterial] = GetColor(r, g, b); + + break; + } + } + } + + return output; +}; + +module.exports = ParseObjMaterial; + + +/***/ }), +/* 477 */ /***/ (function(module, exports) { /** @@ -99063,7 +104934,7 @@ module.exports = GetMagnitude; /***/ }), -/* 464 */ +/* 478 */ /***/ (function(module, exports) { /** @@ -99091,7 +104962,7 @@ module.exports = GetMagnitudeSq; /***/ }), -/* 465 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99102,50 +104973,50 @@ module.exports = GetMagnitudeSq; var Rectangle = __webpack_require__(9); -Rectangle.Area = __webpack_require__(1183); -Rectangle.Ceil = __webpack_require__(1184); -Rectangle.CeilAll = __webpack_require__(1185); -Rectangle.CenterOn = __webpack_require__(178); -Rectangle.Clone = __webpack_require__(1186); -Rectangle.Contains = __webpack_require__(50); -Rectangle.ContainsPoint = __webpack_require__(1187); -Rectangle.ContainsRect = __webpack_require__(466); -Rectangle.CopyFrom = __webpack_require__(1188); -Rectangle.Decompose = __webpack_require__(455); -Rectangle.Equals = __webpack_require__(1189); -Rectangle.FitInside = __webpack_require__(1190); -Rectangle.FitOutside = __webpack_require__(1191); -Rectangle.Floor = __webpack_require__(1192); -Rectangle.FloorAll = __webpack_require__(1193); -Rectangle.FromPoints = __webpack_require__(186); -Rectangle.FromXY = __webpack_require__(1194); -Rectangle.GetAspectRatio = __webpack_require__(223); -Rectangle.GetCenter = __webpack_require__(1195); -Rectangle.GetPoint = __webpack_require__(161); -Rectangle.GetPoints = __webpack_require__(283); -Rectangle.GetSize = __webpack_require__(1196); -Rectangle.Inflate = __webpack_require__(1197); -Rectangle.Intersection = __webpack_require__(1198); -Rectangle.MarchingAnts = __webpack_require__(294); -Rectangle.MergePoints = __webpack_require__(1199); -Rectangle.MergeRect = __webpack_require__(1200); -Rectangle.MergeXY = __webpack_require__(1201); -Rectangle.Offset = __webpack_require__(1202); -Rectangle.OffsetPoint = __webpack_require__(1203); -Rectangle.Overlaps = __webpack_require__(1204); -Rectangle.Perimeter = __webpack_require__(118); -Rectangle.PerimeterPoint = __webpack_require__(1205); -Rectangle.Random = __webpack_require__(164); -Rectangle.RandomOutside = __webpack_require__(1206); -Rectangle.SameDimensions = __webpack_require__(1207); -Rectangle.Scale = __webpack_require__(1208); -Rectangle.Union = __webpack_require__(408); +Rectangle.Area = __webpack_require__(1247); +Rectangle.Ceil = __webpack_require__(1248); +Rectangle.CeilAll = __webpack_require__(1249); +Rectangle.CenterOn = __webpack_require__(182); +Rectangle.Clone = __webpack_require__(1250); +Rectangle.Contains = __webpack_require__(56); +Rectangle.ContainsPoint = __webpack_require__(1251); +Rectangle.ContainsRect = __webpack_require__(480); +Rectangle.CopyFrom = __webpack_require__(1252); +Rectangle.Decompose = __webpack_require__(467); +Rectangle.Equals = __webpack_require__(1253); +Rectangle.FitInside = __webpack_require__(1254); +Rectangle.FitOutside = __webpack_require__(1255); +Rectangle.Floor = __webpack_require__(1256); +Rectangle.FloorAll = __webpack_require__(1257); +Rectangle.FromPoints = __webpack_require__(191); +Rectangle.FromXY = __webpack_require__(1258); +Rectangle.GetAspectRatio = __webpack_require__(229); +Rectangle.GetCenter = __webpack_require__(1259); +Rectangle.GetPoint = __webpack_require__(162); +Rectangle.GetPoints = __webpack_require__(298); +Rectangle.GetSize = __webpack_require__(1260); +Rectangle.Inflate = __webpack_require__(1261); +Rectangle.Intersection = __webpack_require__(1262); +Rectangle.MarchingAnts = __webpack_require__(308); +Rectangle.MergePoints = __webpack_require__(1263); +Rectangle.MergeRect = __webpack_require__(1264); +Rectangle.MergeXY = __webpack_require__(1265); +Rectangle.Offset = __webpack_require__(1266); +Rectangle.OffsetPoint = __webpack_require__(1267); +Rectangle.Overlaps = __webpack_require__(1268); +Rectangle.Perimeter = __webpack_require__(126); +Rectangle.PerimeterPoint = __webpack_require__(1269); +Rectangle.Random = __webpack_require__(165); +Rectangle.RandomOutside = __webpack_require__(1270); +Rectangle.SameDimensions = __webpack_require__(1271); +Rectangle.Scale = __webpack_require__(1272); +Rectangle.Union = __webpack_require__(418); module.exports = Rectangle; /***/ }), -/* 466 */ +/* 480 */ /***/ (function(module, exports) { /** @@ -99185,7 +105056,7 @@ module.exports = ContainsRect; /***/ }), -/* 467 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99229,7 +105100,7 @@ module.exports = Centroid; /***/ }), -/* 468 */ +/* 482 */ /***/ (function(module, exports) { /** @@ -99270,7 +105141,7 @@ module.exports = Offset; /***/ }), -/* 469 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99335,7 +105206,7 @@ module.exports = InCenter; /***/ }), -/* 470 */ +/* 484 */ /***/ (function(module, exports) { /** @@ -99353,7 +105224,7 @@ module.exports = InCenter; * @since 3.10.0 * * @param {Phaser.Textures.TextureManager} textureManager - A reference to the Texture Manager. - * @param {integer} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction. + * @param {number} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction. * * @return {function} The new Pixel Perfect Handler function. */ @@ -99371,7 +105242,7 @@ module.exports = CreatePixelPerfectHandler; /***/ }), -/* 471 */ +/* 485 */ /***/ (function(module, exports) { /** @@ -99442,7 +105313,7 @@ module.exports = CreateInteractiveObject; /***/ }), -/* 472 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99464,7 +105335,7 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Axis belongs to. - * @param {integer} index - The index of this Axis. + * @param {number} index - The index of this Axis. */ var Axis = new Class({ @@ -99494,7 +105365,7 @@ var Axis = new Class({ * The index of this Axis. * * @name Phaser.Input.Gamepad.Axis#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -99567,7 +105438,7 @@ module.exports = Axis; /***/ }), -/* 473 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99577,7 +105448,7 @@ module.exports = Axis; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(225); +var Events = __webpack_require__(231); /** * @classdesc @@ -99590,7 +105461,7 @@ var Events = __webpack_require__(225); * @since 3.0.0 * * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Button belongs to. - * @param {integer} index - The index of this Button. + * @param {number} index - The index of this Button. */ var Button = new Class({ @@ -99620,7 +105491,7 @@ var Button = new Class({ * The index of this Button. * * @name Phaser.Input.Gamepad.Button#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -99713,7 +105584,7 @@ module.exports = Button; /***/ }), -/* 474 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99722,10 +105593,10 @@ module.exports = Button; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Axis = __webpack_require__(472); -var Button = __webpack_require__(473); +var Axis = __webpack_require__(486); +var Button = __webpack_require__(487); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); +var EventEmitter = __webpack_require__(10); var Vector2 = __webpack_require__(3); /** @@ -100031,6 +105902,16 @@ var Gamepad = new Class({ * @since 3.10.0 */ this.rightStick = new Vector2(); + + /** + * When was this Gamepad created? Used to avoid duplicate event spamming in the update loop. + * + * @name Phaser.Input.Gamepad.Gamepad#_created + * @type {number} + * @private + * @since 3.50.0 + */ + this._created = performance.now(); }, /** @@ -100039,7 +105920,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getAxisTotal * @since 3.10.0 * - * @return {integer} The total number of axes this Gamepad claims to support. + * @return {number} The total number of axes this Gamepad claims to support. */ getAxisTotal: function () { @@ -100054,7 +105935,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getAxisValue * @since 3.10.0 * - * @param {integer} index - The index of the axes to get the value for. + * @param {number} index - The index of the axes to get the value for. * * @return {number} The value of the axis, between 0 and 1. */ @@ -100086,7 +105967,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getButtonTotal * @since 3.10.0 * - * @return {integer} The total number of buttons this Gamepad claims to have. + * @return {number} The total number of buttons this Gamepad claims to have. */ getButtonTotal: function () { @@ -100103,7 +105984,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getButtonValue * @since 3.10.0 * - * @param {integer} index - The index of the button to get the value for. + * @param {number} index - The index of the button to get the value for. * * @return {number} The value of the button, between 0 and 1. */ @@ -100119,7 +106000,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#isButtonDown * @since 3.10.0 * - * @param {integer} index - The index of the button to get the value for. + * @param {number} index - The index of the button to get the value for. * * @return {boolean} `true` if the button is considered as being pressed down, otherwise `false`. */ @@ -100138,6 +106019,11 @@ var Gamepad = new Class({ */ update: function (pad) { + if (pad.timestamp < this._created) + { + return; + } + var i; // Sync the button values @@ -100471,7 +106357,7 @@ module.exports = Gamepad; /***/ }), -/* 475 */ +/* 489 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100481,8 +106367,8 @@ module.exports = Gamepad; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(145); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(147); /** * @classdesc @@ -100496,7 +106382,7 @@ var Events = __webpack_require__(145); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardPlugin} plugin - The Keyboard Plugin instance that owns this Key object. - * @param {integer} keyCode - The keycode of this key. + * @param {number} keyCode - The keycode of this key. */ var Key = new Class({ @@ -100521,7 +106407,7 @@ var Key = new Class({ * The keycode of this key. * * @name Phaser.Input.Keyboard.Key#keyCode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.keyCode = keyCode; @@ -100873,7 +106759,7 @@ module.exports = Key; /***/ }), -/* 476 */ +/* 490 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100883,10 +106769,10 @@ module.exports = Key; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(145); +var Events = __webpack_require__(147); var GetFastValue = __webpack_require__(2); -var ProcessKeyCombo = __webpack_require__(1247); -var ResetKeyCombo = __webpack_require__(1249); +var ProcessKeyCombo = __webpack_require__(491); +var ResetKeyCombo = __webpack_require__(493); /** * @classdesc @@ -100923,7 +106809,7 @@ var ResetKeyCombo = __webpack_require__(1249); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardPlugin} keyboardPlugin - A reference to the Keyboard Plugin. - * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {(string|number[]|object[])} keys - The keys that comprise this combo. * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. */ var KeyCombo = new Class({ @@ -100993,7 +106879,7 @@ var KeyCombo = new Class({ * The current keyCode the combo is waiting for. * * @name Phaser.Input.Keyboard.KeyCombo#current - * @type {integer} + * @type {number} * @since 3.0.0 */ this.current = this.keyCodes[0]; @@ -101002,7 +106888,7 @@ var KeyCombo = new Class({ * The current index of the key being waited for in the 'keys' string. * * @name Phaser.Input.Keyboard.KeyCombo#index - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -101061,7 +106947,7 @@ var KeyCombo = new Class({ * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. * * @name Phaser.Input.Keyboard.KeyCombo#maxKeyDelay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -101166,7 +107052,7 @@ module.exports = KeyCombo; /***/ }), -/* 477 */ +/* 491 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101175,7 +107061,165 @@ module.exports = KeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(226); +var AdvanceKeyCombo = __webpack_require__(492); + +/** + * Used internally by the KeyCombo class. + * + * @function Phaser.Input.Keyboard.ProcessKeyCombo + * @private + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native Keyboard Event. + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to be processed. + * + * @return {boolean} `true` if the combo was matched, otherwise `false`. + */ +var ProcessKeyCombo = function (event, combo) +{ + if (combo.matched) + { + return true; + } + + var comboMatched = false; + var keyMatched = false; + + if (event.keyCode === combo.current) + { + // Key was correct + + if (combo.index > 0 && combo.maxKeyDelay > 0) + { + // We have to check to see if the delay between + // the new key and the old one was too long (if enabled) + + var timeLimit = combo.timeLastMatched + combo.maxKeyDelay; + + // Check if they pressed it in time or not + if (event.timeStamp <= timeLimit) + { + keyMatched = true; + comboMatched = AdvanceKeyCombo(event, combo); + } + } + else + { + keyMatched = true; + + // We don't check the time for the first key pressed, so just advance it + comboMatched = AdvanceKeyCombo(event, combo); + } + } + + if (!keyMatched && combo.resetOnWrongKey) + { + // Wrong key was pressed + combo.index = 0; + combo.current = combo.keyCodes[0]; + } + + if (comboMatched) + { + combo.timeLastMatched = event.timeStamp; + combo.matched = true; + combo.timeMatched = event.timeStamp; + } + + return comboMatched; +}; + +module.exports = ProcessKeyCombo; + + +/***/ }), +/* 492 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Used internally by the KeyCombo class. + * Return `true` if it reached the end of the combo, `false` if not. + * + * @function Phaser.Input.Keyboard.AdvanceKeyCombo + * @private + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native Keyboard Event. + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to advance. + * + * @return {boolean} `true` if it reached the end of the combo, `false` if not. + */ +var AdvanceKeyCombo = function (event, combo) +{ + combo.timeLastMatched = event.timeStamp; + combo.index++; + + if (combo.index === combo.size) + { + return true; + } + else + { + combo.current = combo.keyCodes[combo.index]; + return false; + } +}; + +module.exports = AdvanceKeyCombo; + + +/***/ }), +/* 493 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Used internally by the KeyCombo class. + * + * @function Phaser.Input.Keyboard.ResetKeyCombo + * @private + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo to reset. + * + * @return {Phaser.Input.Keyboard.KeyCombo} The KeyCombo. + */ +var ResetKeyCombo = function (combo) +{ + combo.current = combo.keyCodes[0]; + combo.index = 0; + combo.timeLastMatched = 0; + combo.matched = false; + combo.timeMatched = 0; + + return combo; +}; + +module.exports = ResetKeyCombo; + + +/***/ }), +/* 494 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(232); /** * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings @@ -101247,7 +107291,7 @@ module.exports = XHRLoader; /***/ }), -/* 478 */ +/* 495 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101257,11 +107301,11 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var HTML5AudioFile = __webpack_require__(479); +var HTML5AudioFile = __webpack_require__(496); var IsPlainObject = __webpack_require__(7); /** @@ -101374,7 +107418,7 @@ AudioFile.create = function (loader, key, urls, config, xhrSettings) // https://developers.google.com/web/updates/2012/02/HTML5-audio-and-the-Web-Audio-API-are-BFFs // var stream = GetFastValue(config, 'stream', false); - if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + if (deviceAudio.webAudio && !audioConfig.disableWebAudio) { return new AudioFile(loader, key, urlConfig, xhrSettings, game.sound.context); } @@ -101483,7 +107527,7 @@ FileTypesManager.register('audio', function (key, urls, config, xhrSettings) var audioConfig = game.config.audio; var deviceAudio = game.device.audio; - if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + if (audioConfig.noAudio || (!deviceAudio.webAudio && !deviceAudio.audioData)) { // Sounds are disabled, so skip loading audio return this; @@ -101521,7 +107565,7 @@ module.exports = AudioFile; /***/ }), -/* 479 */ +/* 496 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101531,10 +107575,10 @@ module.exports = AudioFile; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(84); +var Events = __webpack_require__(89); var File = __webpack_require__(22); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(146); +var GetURL = __webpack_require__(148); var IsPlainObject = __webpack_require__(7); /** @@ -101724,7 +107768,7 @@ module.exports = HTML5AudioFile; /***/ }), -/* 480 */ +/* 497 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101734,7 +107778,7 @@ module.exports = HTML5AudioFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -101895,7 +107939,7 @@ module.exports = ScriptFile; /***/ }), -/* 481 */ +/* 498 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101904,187 +107948,12 @@ module.exports = ScriptFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var ArcadeImage = __webpack_require__(499); +var ArcadeSprite = __webpack_require__(150); var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var File = __webpack_require__(22); -var FileTypesManager = __webpack_require__(8); -var GetFastValue = __webpack_require__(2); -var IsPlainObject = __webpack_require__(7); - -/** - * @classdesc - * A single Text File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. - * - * @class TextFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ -var TextFile = new Class({ - - Extends: File, - - initialize: - - function TextFile (loader, key, url, xhrSettings) - { - var extension = 'txt'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - } - - var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings - }; - - File.call(this, loader, fileConfig); - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.TextFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = this.xhrLoader.responseText; - - this.onProcessComplete(); - } - -}); - -/** - * Adds a Text file, or array of Text files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.text('story', 'files/IntroStory.txt'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Text Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Text Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.text({ - * key: 'story', - * url: 'files/IntroStory.txt' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.text('story', 'files/IntroStory.txt'); - * // and later in your game ... - * var data = this.cache.text.get('story'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and - * this is what you would use to retrieve the text from the Text Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" - * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#text - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('text', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new TextFile(this, key[i])); - } - } - else - { - this.addFile(new TextFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = TextFile; - - -/***/ }), -/* 482 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var ArcadeImage = __webpack_require__(483); -var ArcadeSprite = __webpack_require__(148); -var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); -var PhysicsGroup = __webpack_require__(485); -var StaticPhysicsGroup = __webpack_require__(486); +var CONST = __webpack_require__(59); +var PhysicsGroup = __webpack_require__(501); +var StaticPhysicsGroup = __webpack_require__(502); /** * @classdesc @@ -102201,7 +108070,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithStaticBody} The Image object that was created. */ @@ -102225,7 +108094,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithDynamicBody} The Image object that was created. */ @@ -102249,7 +108118,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.SpriteWithStaticBody} The Sprite object that was created. */ @@ -102274,7 +108143,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.SpriteWithDynamicBody} The Sprite object that was created. */ @@ -102343,7 +108212,7 @@ module.exports = Factory; /***/ }), -/* 483 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102353,8 +108222,8 @@ module.exports = Factory; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(228); -var Image = __webpack_require__(114); +var Components = __webpack_require__(235); +var Image = __webpack_require__(122); /** * @classdesc @@ -102379,6 +108248,7 @@ var Image = __webpack_require__(114); * @extends Phaser.Physics.Arcade.Components.Gravity * @extends Phaser.Physics.Arcade.Components.Immovable * @extends Phaser.Physics.Arcade.Components.Mass + * @extends Phaser.Physics.Arcade.Components.Pushable * @extends Phaser.Physics.Arcade.Components.Size * @extends Phaser.Physics.Arcade.Components.Velocity * @extends Phaser.GameObjects.Components.Alpha @@ -102399,7 +108269,7 @@ var Image = __webpack_require__(114); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeImage = new Class({ @@ -102416,6 +108286,7 @@ var ArcadeImage = new Class({ Components.Gravity, Components.Immovable, Components.Mass, + Components.Pushable, Components.Size, Components.Velocity ], @@ -102443,13 +108314,13 @@ module.exports = ArcadeImage; /***/ }), -/* 484 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { -var OverlapRect = __webpack_require__(229); -var Circle = __webpack_require__(68); -var CircleToCircle = __webpack_require__(216); -var CircleToRectangle = __webpack_require__(217); +var OverlapRect = __webpack_require__(236); +var Circle = __webpack_require__(71); +var CircleToCircle = __webpack_require__(222); +var CircleToRectangle = __webpack_require__(223); /** * This method will search the given circular area and return an array of all physics bodies that @@ -102511,7 +108382,7 @@ module.exports = OverlapCirc; /***/ }), -/* 485 */ +/* 501 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102520,11 +108391,11 @@ module.exports = OverlapCirc; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(148); +var ArcadeSprite = __webpack_require__(150); var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(100); +var Group = __webpack_require__(108); var IsPlainObject = __webpack_require__(7); /** @@ -102629,7 +108500,7 @@ var PhysicsGroup = new Class({ * The physics type of the Group's members. * * @name Phaser.Physics.Arcade.Group#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.DYNAMIC_BODY * @since 3.0.0 */ @@ -102661,6 +108532,8 @@ var PhysicsGroup = new Class({ setGravityY: GetFastValue(config, 'gravityY', 0), setFrictionX: GetFastValue(config, 'frictionX', 0), setFrictionY: GetFastValue(config, 'frictionY', 0), + setMaxVelocityX: GetFastValue(config, 'maxVelocityX', 10000), + setMaxVelocityY: GetFastValue(config, 'maxVelocityY', 10000), setVelocityX: GetFastValue(config, 'velocityX', 0), setVelocityY: GetFastValue(config, 'velocityY', 0), setAngularVelocity: GetFastValue(config, 'angularVelocity', 0), @@ -102805,7 +108678,7 @@ module.exports = PhysicsGroup; /***/ }), -/* 486 */ +/* 502 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102814,11 +108687,11 @@ module.exports = PhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(148); +var ArcadeSprite = __webpack_require__(150); var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(100); +var Group = __webpack_require__(108); var IsPlainObject = __webpack_require__(7); /** @@ -102904,7 +108777,7 @@ var StaticPhysicsGroup = new Class({ * The scene this group belongs to. * * @name Phaser.Physics.Arcade.StaticGroup#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.STATIC_BODY * @since 3.0.0 */ @@ -103004,7 +108877,7 @@ module.exports = StaticPhysicsGroup; /***/ }), -/* 487 */ +/* 503 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103013,35 +108886,36 @@ module.exports = StaticPhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AngleBetweenPoints = __webpack_require__(331); -var Body = __webpack_require__(488); -var Clamp = __webpack_require__(17); +var AngleBetweenPoints = __webpack_require__(342); +var Body = __webpack_require__(504); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Collider = __webpack_require__(489); -var CONST = __webpack_require__(52); -var DistanceBetween = __webpack_require__(55); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(230); -var FuzzyEqual = __webpack_require__(109); -var FuzzyGreaterThan = __webpack_require__(335); -var FuzzyLessThan = __webpack_require__(336); -var GetOverlapX = __webpack_require__(231); -var GetOverlapY = __webpack_require__(232); +var Collider = __webpack_require__(505); +var CONST = __webpack_require__(59); +var DistanceBetween = __webpack_require__(61); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(237); +var FuzzyEqual = __webpack_require__(121); +var FuzzyGreaterThan = __webpack_require__(346); +var FuzzyLessThan = __webpack_require__(347); +var GetOverlapX = __webpack_require__(238); +var GetOverlapY = __webpack_require__(239); +var GetTilesWithinWorldXY = __webpack_require__(506); var GetValue = __webpack_require__(6); var MATH_CONST = __webpack_require__(13); -var ProcessQueue = __webpack_require__(197); -var ProcessTileCallbacks = __webpack_require__(490); +var ProcessQueue = __webpack_require__(202); +var ProcessTileCallbacks = __webpack_require__(507); var Rectangle = __webpack_require__(9); -var RTree = __webpack_require__(491); -var SeparateTile = __webpack_require__(492); -var SeparateX = __webpack_require__(497); -var SeparateY = __webpack_require__(498); -var Set = __webpack_require__(141); -var StaticBody = __webpack_require__(499); -var TileIntersectsBody = __webpack_require__(233); -var TransformMatrix = __webpack_require__(31); +var RTree = __webpack_require__(508); +var SeparateTile = __webpack_require__(509); +var SeparateX = __webpack_require__(514); +var SeparateY = __webpack_require__(515); +var Set = __webpack_require__(145); +var StaticBody = __webpack_require__(516); +var TileIntersectsBody = __webpack_require__(240); +var TransformMatrix = __webpack_require__(24); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * @classdesc @@ -103330,7 +109204,7 @@ var World = new Class({ * to allow more items per node and less node division. * * @name Phaser.Physics.Arcade.World#maxEntries - * @type {integer} + * @type {number} * @default 16 * @since 3.0.0 */ @@ -103440,7 +109314,7 @@ var World = new Class({ * @since 3.0.0 * * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object - The object, or objects, on which to create the bodies. - * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + * @param {number} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. */ enable: function (object, bodyType) { @@ -103507,7 +109381,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} object - The Game Object on which to create the body. - * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + * @param {number} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. * * @return {Phaser.GameObjects.GameObject} The Game Object on which the body was created. */ @@ -103903,7 +109777,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#setFPS * @since 3.10.0 * - * @param {integer} framerate - The frame rate to advance the simulation at. + * @param {number} framerate - The frame rate to advance the simulation at. * * @return {this} This World object. */ @@ -103991,7 +109865,7 @@ var World = new Class({ } } - this.emit(Events.WORLD_STEP); + this.emit(Events.WORLD_STEP, fixedDelta); } // Process any additional steps this frame @@ -104050,7 +109924,7 @@ var World = new Class({ } } - this.emit(Events.WORLD_STEP); + this.emit(Events.WORLD_STEP, delta); this.stepsLastFrame++; }, @@ -104256,6 +110130,7 @@ var World = new Class({ if (useDamping) { // Damping based deceleration + dragX = Math.pow(dragX, delta); velocityX *= dragX; @@ -104295,6 +110170,8 @@ var World = new Class({ if (useDamping) { // Damping based deceleration + dragY = Math.pow(dragY, delta); + velocityY *= dragY; speed = Math.sqrt(velocityX * velocityX + velocityY * velocityY); @@ -104475,9 +110352,6 @@ var World = new Class({ */ separateCircle: function (body1, body2, overlapOnly, bias) { - body1.updateCenter(); - body2.updateCenter(); - // Set the bounding box overlap values into the bodies themselves (hence we don't use the return values here) GetOverlapX(body1, body2, false, bias); GetOverlapY(body1, body2, false, bias); @@ -104529,6 +110403,9 @@ var World = new Class({ overlap = (body1.halfWidth + body2.halfWidth) - DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y); } + body1.overlapR = overlap; + body2.overlapR = overlap; + // Can't separate two immovable bodies, or a body with its own custom separation logic if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX) { @@ -105056,10 +110933,10 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Group} group - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. - * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. + * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -105174,7 +111051,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. @@ -105196,9 +111073,6 @@ var World = new Class({ var w = body.width; var h = body.height; - // TODO: this logic should be encapsulated within the Tilemap API at some point. - // If the maps base tile size differs from the layer's tile size, we need to adjust the - // selection area by the difference between the two. var layerData = tilemapLayer.layer; if (layerData.tileWidth > layerData.baseTileWidth) @@ -105216,7 +111090,7 @@ var World = new Class({ h += yDiff; } - var mapData = tilemapLayer.getTilesWithinWorldXY(x, y, w, h); + var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer); if (mapData.length === 0) { @@ -105239,7 +111113,7 @@ var World = new Class({ * @since 3.17.0 * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. @@ -105263,11 +111137,13 @@ var World = new Class({ tilemapLayer = tile.tilemapLayer; - tileWorldRect.left = tilemapLayer.tileToWorldX(tile.x); - tileWorldRect.top = tilemapLayer.tileToWorldY(tile.y); + var point = tilemapLayer.tileToWorldXY(tile.x, tile.y); - // If the map's base tile size differs from the layer's tile size, only the top of the rect - // needs to be adjusted since its origin is (0, 1). + tileWorldRect.left = point.x; + tileWorldRect.top = point.y; + + // If the maps base tile size differs from the layer tile size, only the top of the rect + // needs to be adjusted since its origin is (0, 1). if (tile.baseHeight !== tile.height) { tileWorldRect.top -= (tile.height - tile.baseHeight) * tilemapLayer.scaleY; @@ -105344,7 +111220,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#wrap * @since 3.3.0 * - * @param {*} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. + * @param {any} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. * @param {number} [padding=0] - An amount added to each boundary edge during the operation. */ wrap: function (object, padding) @@ -105437,7 +111313,7 @@ module.exports = World; /***/ }), -/* 488 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105448,11 +111324,11 @@ module.exports = World; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); -var Events = __webpack_require__(230); -var RadToDeg = __webpack_require__(183); +var CONST = __webpack_require__(59); +var Events = __webpack_require__(237); +var RadToDeg = __webpack_require__(188); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(50); +var RectangleContains = __webpack_require__(56); var Vector2 = __webpack_require__(3); /** @@ -105535,7 +111411,7 @@ var Body = new Class({ * The color of this Body on the debug display. * * @name Phaser.Physics.Arcade.Body#debugBodyColor - * @type {integer} + * @type {number} * @since 3.0.0 */ this.debugBodyColor = world.defaults.bodyDebugColor; @@ -105777,10 +111653,11 @@ var Body = new Class({ /** * When `useDamping` is false (the default), this is absolute loss of velocity due to movement, in pixels per second squared. * - * When `useDamping` is true, this is 1 minus the damping factor. + * When `useDamping` is true, this is a damping multiplier between 0 and 1. + * A value of 0 means the Body stops instantly. + * A value of 0.01 mean the Body loses 99% of its velocity per second. + * A value of 0.1 means the Body loses 90% of its velocity per second. * A value of 1 means the Body loses no velocity. - * A value of 0.95 means the Body loses 5% of its velocity per step. - * A value of 0.5 means the Body loses 50% of its velocity per step. * * The x and y components are applied separately. * @@ -105928,8 +111805,8 @@ var Body = new Class({ * by using damping, avoiding the axis-drift that is prone with linear deceleration. * * If you enable this property then you should use far smaller `drag` values than with linear, as - * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow - * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * they are used as a multiplier on the velocity. Values such as 0.05 will give a nice slow + * deceleration. * * @name Phaser.Physics.Arcade.Body#useDamping * @type {boolean} @@ -106017,7 +111894,7 @@ var Body = new Class({ * If the Body is moving on both axes, this describes motion on the vertical axis only. * * @name Phaser.Physics.Arcade.Body#facing - * @type {integer} + * @type {number} * @since 3.0.0 * * @see Phaser.Physics.Arcade.FACING_UP @@ -106037,6 +111914,25 @@ var Body = new Class({ */ this.immovable = false; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * By default, Dynamic Bodies are always pushable. + * + * @name Phaser.Physics.Arcade.Body#pushable + * @type {boolean} + * @default true + * @since 3.50.0 + * @see Phaser.GameObjects.Components.Pushable#setPushable + */ + this.pushable = true; + /** * Whether the Body's position and rotation are affected by its velocity, acceleration, drag, and gravity. * @@ -106181,7 +112077,7 @@ var Body = new Class({ * The Body's physics type (dynamic or static). * * @name Phaser.Physics.Arcade.Body#physicsType - * @type {integer} + * @type {number} * @readonly * @default Phaser.Physics.Arcade.DYNAMIC_BODY * @since 3.0.0 @@ -106654,6 +112550,7 @@ var Body = new Class({ if (wasSet) { this.blocked.none = false; + this.updateCenter(); } return wasSet; @@ -106661,6 +112558,7 @@ var Body = new Class({ /** * Sets the offset of the Body's position from its Game Object's position. + * The Body's `position` isn't changed until the next `preUpdate`. * * @method Phaser.Physics.Arcade.Body#setOffset * @since 3.0.0 @@ -106675,7 +112573,6 @@ var Body = new Class({ if (y === undefined) { y = x; } this.offset.set(x, y); - this.updateCenter(); return this; }, @@ -106688,8 +112585,8 @@ var Body = new Class({ * @method Phaser.Physics.Arcade.Body#setSize * @since 3.0.0 * - * @param {integer} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. - * @param {integer} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {number} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {number} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param {boolean} [center=true] - Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. * * @return {Phaser.Physics.Arcade.Body} This Body object. @@ -106779,14 +112676,14 @@ var Body = new Class({ }, /** - * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * Sets this Body's parent Game Object to the given coordinates and resets this Body at the new coordinates. * If the Body had any velocity or acceleration it is lost as a result of calling this. * * @method Phaser.Physics.Arcade.Body#reset * @since 3.0.0 * - * @param {number} x - The horizontal position to place the Game Object and Body. - * @param {number} y - The vertical position to place the Game Object and Body. + * @param {number} x - The horizontal position to place the Game Object. + * @param {number} y - The vertical position to place the Game Object. */ reset: function (x, y) { @@ -107129,18 +113026,19 @@ var Body = new Class({ /** * Sets whether this Body collides with the world boundary. * - * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. + * Optionally also sets the World Bounce and `onWorldBounds` values. * * @method Phaser.Physics.Arcade.Body#setCollideWorldBounds * @since 3.0.0 * - * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`. - * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value. - * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value. + * @param {boolean} [value=true] - `true` if the Body should collide with the world bounds, otherwise `false`. + * @param {number} [bounceX] - If given this replaces the Body's `worldBounce.x` value. + * @param {number} [bounceY] - If given this replaces the Body's `worldBounce.y` value. + * @param {boolean} [onWorldBounds] - If given this replaces the Body's `onWorldBounds` value. * * @return {Phaser.Physics.Arcade.Body} This Body object. */ - setCollideWorldBounds: function (value, bounceX, bounceY) + setCollideWorldBounds: function (value, bounceX, bounceY, onWorldBounds) { if (value === undefined) { value = true; } @@ -107167,6 +113065,11 @@ var Body = new Class({ } } + if (onWorldBounds !== undefined) + { + this.onWorldBounds = onWorldBounds; + } + return this; }, @@ -107255,6 +113158,40 @@ var Body = new Class({ return this; }, + /** + * Sets the Body's maximum horizontal velocity. + * + * @method Phaser.Physics.Arcade.Body#setMaxVelocityX + * @since 3.50.0 + * + * @param {number} value - The maximum horizontal velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setMaxVelocityX: function (value) + { + this.maxVelocity.x = value; + + return this; + }, + + /** + * Sets the Body's maximum vertical velocity. + * + * @method Phaser.Physics.Arcade.Body#setMaxVelocityY + * @since 3.50.0 + * + * @param {number} value - The maximum vertical velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setMaxVelocityY: function (value) + { + this.maxVelocity.y = value; + + return this; + }, + /** * Sets the maximum speed the Body can move. * @@ -107454,6 +113391,31 @@ var Body = new Class({ return this; }, + /** + * If this Body is using `drag` for deceleration this property controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * + * @method Phaser.Physics.Arcade.Body#setDamping + * @since 3.50.0 + * + * @param {boolean} value - `true` to use damping, or `false` to use drag. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setDamping: function (value) + { + this.useDamping = value; + + return this; + }, + /** * Sets the Body's horizontal drag. * @@ -107699,7 +113661,79 @@ var Body = new Class({ }, /** - * The Body's horizontal position (left edge). + * This is an internal handler, called by the `ProcessX` function as part + * of the collision step. You should almost never call this directly. + * + * @method Phaser.Physics.Arcade.Body#processX + * @since 3.50.0 + * + * @param {number} x - The amount to add to the Body position. + * @param {number} [vx] - The amount to add to the Body velocity. + * @param {boolean} [left] - Set the blocked.left value? + * @param {boolean} [right] - Set the blocked.right value? + */ + processX: function (x, vx, left, right) + { + this.x += x; + + this.updateCenter(); + + if (vx !== null) + { + this.velocity.x = vx; + } + + var blocked = this.blocked; + + if (left) + { + blocked.left = true; + } + + if (right) + { + blocked.right = true; + } + }, + + /** + * This is an internal handler, called by the `ProcessY` function as part + * of the collision step. You should almost never call this directly. + * + * @method Phaser.Physics.Arcade.Body#processY + * @since 3.50.0 + * + * @param {number} y - The amount to add to the Body position. + * @param {number} [vy] - The amount to add to the Body velocity. + * @param {boolean} [up] - Set the blocked.up value? + * @param {boolean} [down] - Set the blocked.down value? + */ + processY: function (y, vy, up, down) + { + this.y += y; + + this.updateCenter(); + + if (vy !== null) + { + this.velocity.y = vy; + } + + var blocked = this.blocked; + + if (up) + { + blocked.up = true; + } + + if (down) + { + blocked.down = true; + } + }, + + /** + * The Bodys horizontal position (left edge). * * @name Phaser.Physics.Arcade.Body#x * @type {number} @@ -107720,7 +113754,7 @@ var Body = new Class({ }, /** - * The Body's vertical position (top edge). + * The Bodys vertical position (top edge). * * @name Phaser.Physics.Arcade.Body#y * @type {number} @@ -107814,7 +113848,7 @@ module.exports = Body; /***/ }), -/* 489 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107934,7 +113968,7 @@ var Collider = new Class({ /** * A name for the Collider. - * + * * Phaser does not use this value, it's for your own reference. * * @method Phaser.Physics.Arcade.Collider#setName @@ -107997,7 +114031,61 @@ module.exports = Collider; /***/ }), -/* 490 */ +/* 506 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(26); +var Vector2 = __webpack_require__(3); + +var pointStart = new Vector2(); +var pointEnd = new Vector2(); + +/** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * + * @function Phaser.Tilemaps.Components.GetTilesWithinWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + */ +var GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer) +{ + var worldToTileXY = layer.tilemapLayer.tilemap._convert.WorldToTileXY; + + // Top left corner of the rect, rounded down to include partial tiles + worldToTileXY(worldX, worldY, true, pointStart, camera, layer); + + var xStart = pointStart.x; + var yStart = pointStart.y; + + // Bottom right corner of the rect, rounded up to include partial tiles + worldToTileXY(worldX + width, worldY + height, false, pointEnd, camera, layer); + + var xEnd = Math.ceil(pointEnd.x); + var yEnd = Math.ceil(pointEnd.y); + + return GetTilesWithin(xStart, yStart, xEnd - xStart, yEnd - yStart, filteringOptions, layer); +}; + +module.exports = GetTilesWithinWorldXY; + + +/***/ }), +/* 507 */ /***/ (function(module, exports) { /** @@ -108038,7 +114126,7 @@ module.exports = ProcessTileCallbacks; /***/ }), -/* 491 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108048,7 +114136,7 @@ module.exports = ProcessTileCallbacks; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var quickselect = __webpack_require__(403); +var quickselect = __webpack_require__(413); /** * @classdesc @@ -108649,7 +114737,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; /***/ }), -/* 492 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108658,9 +114746,9 @@ module.exports = rbush; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileCheckX = __webpack_require__(493); -var TileCheckY = __webpack_require__(495); -var TileIntersectsBody = __webpack_require__(233); +var TileCheckX = __webpack_require__(510); +var TileCheckY = __webpack_require__(512); +var TileIntersectsBody = __webpack_require__(240); /** * The core separation function to separate a physics body and a tile. @@ -108672,7 +114760,7 @@ var TileIntersectsBody = __webpack_require__(233); * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tilemaps.Tile} tile - The tile to collide against. * @param {Phaser.Geom.Rectangle} tileWorldRect - A rectangle-like object defining the dimensions of the tile. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The tilemapLayer to collide against. * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant. * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles? * @@ -108769,7 +114857,7 @@ module.exports = SeparateTile; /***/ }), -/* 493 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108778,7 +114866,7 @@ module.exports = SeparateTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationX = __webpack_require__(494); +var ProcessTileSeparationX = __webpack_require__(511); /** * Check the body against the given tile on the X axis. @@ -108859,7 +114947,7 @@ module.exports = TileCheckX; /***/ }), -/* 494 */ +/* 511 */ /***/ (function(module, exports) { /** @@ -108906,7 +114994,7 @@ module.exports = ProcessTileSeparationX; /***/ }), -/* 495 */ +/* 512 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -108915,7 +115003,7 @@ module.exports = ProcessTileSeparationX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationY = __webpack_require__(496); +var ProcessTileSeparationY = __webpack_require__(513); /** * Check the body against the given tile on the Y axis. @@ -108996,7 +115084,7 @@ module.exports = TileCheckY; /***/ }), -/* 496 */ +/* 513 */ /***/ (function(module, exports) { /** @@ -109043,7 +115131,7 @@ module.exports = ProcessTileSeparationY; /***/ }), -/* 497 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -109052,7 +115140,8 @@ module.exports = ProcessTileSeparationY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapX = __webpack_require__(231); +var GetOverlapX = __webpack_require__(238); +var ProcessX = __webpack_require__(1369); /** * Separates two overlapping bodies on the X-axis (horizontally). @@ -109069,63 +115158,40 @@ var GetOverlapX = __webpack_require__(231); * @param {boolean} overlapOnly - If `true`, the bodies will only have their overlap data set and no separation will take place. * @param {number} bias - A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. * - * @return {boolean} `true` if the two bodies overlap horizontally, otherwise `false`. + * @return {boolean} `true` if the two bodies overlap vertically, otherwise `false`. */ var SeparateX = function (body1, body2, overlapOnly, bias) { var overlap = GetOverlapX(body1, body2, overlapOnly, bias); + var body1Immovable = body1.immovable; + var body2Immovable = body2.immovable; + // Can't separate two immovable bodies, or a body with its own custom separation logic - if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX) + if (overlapOnly || overlap === 0 || (body1Immovable && body2Immovable) || body1.customSeparateX || body2.customSeparateX) { // return true if there was some overlap, otherwise false return (overlap !== 0) || (body1.embedded && body2.embedded); } - // Adjust their positions and velocities accordingly (if there was any overlap) - var v1 = body1.velocity.x; - var v2 = body2.velocity.x; + var blockedState = ProcessX.Set(body1, body2, overlap); - if (!body1.immovable && !body2.immovable) + if (!body1Immovable && !body2Immovable) { - overlap *= 0.5; - - body1.x -= overlap; - body2.x += overlap; - - var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); - var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); - var avg = (nv1 + nv2) * 0.5; - - nv1 -= avg; - nv2 -= avg; - - body1.velocity.x = avg + nv1 * body1.bounce.x; - body2.velocity.x = avg + nv2 * body2.bounce.x; - } - else if (!body1.immovable) - { - body1.x -= overlap; - body1.velocity.x = v2 - v1 * body1.bounce.x; - - // This is special case code that handles things like vertically moving platforms you can ride - if (body2.moves) + if (blockedState > 0) { - body1.y += (body2.y - body2.prev.y) * body2.friction.y; - body1._dy = body1.y - body1.prev.y; + return true; } - } - else - { - body2.x += overlap; - body2.velocity.x = v1 - v2 * body2.bounce.x; - // This is special case code that handles things like vertically moving platforms you can ride - if (body1.moves) - { - body2.y += (body1.y - body1.prev.y) * body1.friction.y; - body2._dy = body2.y - body2.prev.y; - } + return ProcessX.Check(); + } + else if (body1Immovable) + { + ProcessX.RunImmovableBody1(blockedState); + } + else if (body2Immovable) + { + ProcessX.RunImmovableBody2(blockedState); } // If we got this far then there WAS overlap, and separation is complete, so return true @@ -109136,7 +115202,7 @@ module.exports = SeparateX; /***/ }), -/* 498 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -109145,7 +115211,8 @@ module.exports = SeparateX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapY = __webpack_require__(232); +var GetOverlapY = __webpack_require__(239); +var ProcessY = __webpack_require__(1370); /** * Separates two overlapping bodies on the Y-axis (vertically). @@ -109168,57 +115235,34 @@ var SeparateY = function (body1, body2, overlapOnly, bias) { var overlap = GetOverlapY(body1, body2, overlapOnly, bias); + var body1Immovable = body1.immovable; + var body2Immovable = body2.immovable; + // Can't separate two immovable bodies, or a body with its own custom separation logic - if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateY || body2.customSeparateY) + if (overlapOnly || overlap === 0 || (body1Immovable && body2Immovable) || body1.customSeparateY || body2.customSeparateY) { // return true if there was some overlap, otherwise false return (overlap !== 0) || (body1.embedded && body2.embedded); } - // Adjust their positions and velocities accordingly (if there was any overlap) - var v1 = body1.velocity.y; - var v2 = body2.velocity.y; + var blockedState = ProcessY.Set(body1, body2, overlap); - if (!body1.immovable && !body2.immovable) + if (!body1Immovable && !body2Immovable) { - overlap *= 0.5; - - body1.y -= overlap; - body2.y += overlap; - - var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); - var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); - var avg = (nv1 + nv2) * 0.5; - - nv1 -= avg; - nv2 -= avg; - - body1.velocity.y = avg + nv1 * body1.bounce.y; - body2.velocity.y = avg + nv2 * body2.bounce.y; - } - else if (!body1.immovable) - { - body1.y -= overlap; - body1.velocity.y = v2 - v1 * body1.bounce.y; - - // This is special case code that handles things like horizontal moving platforms you can ride - if (body2.moves) + if (blockedState > 0) { - body1.x += (body2.x - body2.prev.x) * body2.friction.x; - body1._dx = body1.x - body1.prev.x; + return true; } - } - else - { - body2.y += overlap; - body2.velocity.y = v1 - v2 * body2.bounce.y; - // This is special case code that handles things like horizontal moving platforms you can ride - if (body1.moves) - { - body2.x += (body1.x - body1.prev.x) * body1.friction.x; - body2._dx = body2.x - body2.prev.x; - } + return ProcessY.Check(); + } + else if (body1Immovable) + { + ProcessY.RunImmovableBody1(blockedState); + } + else if (body2Immovable) + { + ProcessY.RunImmovableBody2(blockedState); } // If we got this far then there WAS overlap, and separation is complete, so return true @@ -109229,7 +115273,7 @@ module.exports = SeparateY; /***/ }), -/* 499 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -109238,10 +115282,10 @@ module.exports = SeparateY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircleContains = __webpack_require__(57); +var CircleContains = __webpack_require__(62); var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); -var RectangleContains = __webpack_require__(50); +var CONST = __webpack_require__(59); +var RectangleContains = __webpack_require__(56); var Vector2 = __webpack_require__(3); /** @@ -109303,7 +115347,7 @@ var StaticBody = new Class({ * The color of this Static Body on the debug display. * * @name Phaser.Physics.Arcade.StaticBody#debugBodyColor - * @type {integer} + * @type {number} * @since 3.0.0 */ this.debugBodyColor = world.defaults.staticBodyDebugColor; @@ -109505,6 +115549,25 @@ var StaticBody = new Class({ */ this.immovable = true; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * By default, Static Bodies are not pushable. + * + * @name Phaser.Physics.Arcade.StaticBody#pushable + * @type {boolean} + * @default false + * @since 3.50.0 + * @see Phaser.GameObjects.Components.Pushable#setPushable + */ + this.pushable = false; + /** * A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider. * @@ -109587,7 +115650,8 @@ var StaticBody = new Class({ this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; /** - * Whether this StaticBody has ever collided with another body and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. * * @name Phaser.Physics.Arcade.StaticBody#touching * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -109596,7 +115660,9 @@ var StaticBody = new Class({ this.touching = { none: true, up: false, down: false, left: false, right: false }; /** - * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. + * The values are always false for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#wasTouching * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -109605,7 +115671,8 @@ var StaticBody = new Class({ this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; /** - * Whether this StaticBody has ever collided with a tile or the world boundary. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. * * @name Phaser.Physics.Arcade.StaticBody#blocked * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -109617,7 +115684,7 @@ var StaticBody = new Class({ * The StaticBody's physics type (static by default). * * @name Phaser.Physics.Arcade.StaticBody#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.STATIC_BODY * @since 3.0.0 */ @@ -109753,8 +115820,8 @@ var StaticBody = new Class({ * @method Phaser.Physics.Arcade.StaticBody#setSize * @since 3.0.0 * - * @param {integer} [width] - The width of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. - * @param {integer} [height] - The height of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {number} [width] - The width of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {number} [height] - The height of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param {boolean} [center=true] - Place the Static Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. @@ -110218,9 +116285,9 @@ module.exports = StaticBody; /***/ }), -/* 500 */, -/* 501 */, -/* 502 */ +/* 517 */, +/* 518 */, +/* 519 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110350,7 +116417,7 @@ module.exports = BasePlugin; /***/ }), -/* 503 */ +/* 520 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110359,7 +116426,53 @@ module.exports = BasePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); + +/** + * Checks if the given tile coordinate is within the isometric layer bounds, or not. + * + * @function Phaser.Tilemaps.Components.CheckIsoBounds + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to check against. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. + * + * @return {boolean} Returns `true` if the coordinates are within the iso bounds. + */ +var CheckIsoBounds = function (tileX, tileY, layer, camera) +{ + var tilemapLayer = layer.tilemapLayer; + + var cullPaddingX = tilemapLayer.cullPaddingX; + var cullPaddingY = tilemapLayer.cullPaddingY; + + var pos = tilemapLayer.tilemap.tileToWorldXY(tileX, tileY, point, camera, tilemapLayer); + + // we always subtract 1/2 of the tile's height/width to make the culling distance start from the center of the tiles. + return pos.x > camera.worldView.x + tilemapLayer.scaleX * layer.tileWidth * (-cullPaddingX - 0.5) + && pos.x < camera.worldView.right + tilemapLayer.scaleX * layer.tileWidth * (cullPaddingX - 0.5) + && pos.y > camera.worldView.y + tilemapLayer.scaleY * layer.tileHeight * (-cullPaddingY - 1.0) + && pos.y < camera.worldView.bottom + tilemapLayer.scaleY * layer.tileHeight * (cullPaddingY - 0.5); +}; + +module.exports = CheckIsoBounds; + + +/***/ }), +/* 521 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(26); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -110369,12 +116482,12 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.ReplaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer) @@ -110394,7 +116507,7 @@ module.exports = ReplaceByIndex; /***/ }), -/* 504 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110403,7 +116516,1143 @@ module.exports = ReplaceByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsInLayerBounds = __webpack_require__(104); +var Rectangle = __webpack_require__(9); +var SnapCeil = __webpack_require__(134); +var SnapFloor = __webpack_require__(72); + +var bounds = new Rectangle(); + +/** + * Returns the bounds in the given orthogonal layer that are within the cameras viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.CullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {Phaser.Geom.Rectangle} A rectangle containing the culled bounds. If you wish to retain this object, clone it, as it's recycled internally. + */ +var CullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY; + + return bounds.setTo( + boundsLeft, + boundsTop, + (boundsRight - boundsLeft), + (boundsBottom - boundsTop) + ); +}; + +module.exports = CullBounds; + + +/***/ }), +/* 523 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = __webpack_require__(522); +var RunCull = __webpack_require__(152); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.CullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var CullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + var bounds = CullBounds(layer, camera); + + if (tilemapLayer.skipCull || tilemapLayer.scrollFactorX !== 1 || tilemapLayer.scrollFactorY !== 1) + { + bounds.left = 0; + bounds.right = layer.width; + bounds.top = 0; + bounds.bottom = layer.height; + } + + RunCull(layer, bounds, renderOrder, outputArray); + + return outputArray; +}; + +module.exports = CullTiles; + + +/***/ }), +/* 524 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = __webpack_require__(525); +var RunCull = __webpack_require__(152); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.HexagonalCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var HexagonalCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + { + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + + var bounds = CullBounds(layer, camera); + + RunCull(layer, bounds, renderOrder, outputArray); + } + + return outputArray; +}; + +module.exports = HexagonalCullTiles; + + +/***/ }), +/* 525 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SnapCeil = __webpack_require__(134); +var SnapFloor = __webpack_require__(72); + +/** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.HexagonalCullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {object} An object containing the `left`, `right`, `top` and `bottom` bounds. + */ +var HexagonalCullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var len = layer.hexSideLength; + var rowH = ((tileH - len) / 2 + len); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, rowH, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, rowH, 0, true) + tilemapLayer.cullPaddingY; + + return { + left: boundsLeft, + right: boundsRight, + top: boundsTop, + bottom: boundsBottom + }; +}; + +module.exports = HexagonalCullBounds; + + +/***/ }), +/* 526 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CheckIsoBounds = __webpack_require__(520); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.IsometricCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var IsometricCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + + var drawLeft = 0; + var drawRight = mapWidth; + var drawTop = 0; + var drawBottom = mapHeight; + + if (!tilemapLayer.skipCull) + { + var x; + var y; + var tile; + + if (renderOrder === 0) + { + // right-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + } + + tilemapLayer.tilesDrawn = outputArray.length; + tilemapLayer.tilesTotal = mapWidth * mapHeight; + + return outputArray; +}; + +module.exports = IsometricCullTiles; + + +/***/ }), +/* 527 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = __webpack_require__(528); +var RunCull = __webpack_require__(152); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.StaggeredCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var StaggeredCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + { + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + + var bounds = CullBounds(layer, camera); + + RunCull(layer, bounds, renderOrder, outputArray); + } + + return outputArray; +}; + +module.exports = StaggeredCullTiles; + + +/***/ }), +/* 528 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SnapCeil = __webpack_require__(134); +var SnapFloor = __webpack_require__(72); + +/** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.StaggeredCullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {object} An object containing the `left`, `right`, `top` and `bottom` bounds. + */ +var StaggeredCullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH / 2, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH / 2, 0, true) + tilemapLayer.cullPaddingY; + + return { + left: boundsLeft, + right: boundsRight, + top: boundsTop, + bottom: boundsBottom + }; +}; + +module.exports = StaggeredCullBounds; + + +/***/ }), +/* 529 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from hexagonal tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.HexagonalTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var HexagonalTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = layer.hexSideLength; + var rowHeight = ((tileHeight - len) / 2 + len); + + // similar to staggered, because Tiled uses the oddr representation. + var x = layerWorldX + tileX * tileWidth + tileY % 2 * (tileWidth / 2); + var y = layerWorldY + tileY * rowHeight; + + return point.set(x, y); +}; + +module.exports = HexagonalTileToWorldXY; + + +/***/ }), +/* 530 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from isometric tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.IsometricTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var IsometricTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var x = layerWorldX + (tileX - tileY) * (tileWidth / 2); + var y = layerWorldY + (tileX + tileY) * (tileHeight / 2); + + return point.set(x, y); +}; + +module.exports = IsometricTileToWorldXY; + + +/***/ }), +/* 531 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from staggered tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.StaggeredTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var StaggeredTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var x = layerWorldX + tileX * tileWidth + tileY % 2 * (tileWidth / 2); + var y = layerWorldY + tileY * (tileHeight / 2); + + return point.set(x, y); +}; + +module.exports = StaggeredTileToWorldXY; + + +/***/ }), +/* 532 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TileToWorldX = __webpack_require__(245); +var TileToWorldY = __webpack_require__(246); +var Vector2 = __webpack_require__(3); + +/** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.TileToWorldXY + * @since 3.0.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var TileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(0, 0); } + + point.x = TileToWorldX(tileX, camera, layer); + point.y = TileToWorldY(tileY, camera, layer); + + return point; +}; + +module.exports = TileToWorldXY; + + +/***/ }), +/* 533 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from hexagonal tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.HexagonalTileToWorldY + * @since 3.50.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var HexagonalTileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = tilemapLayer.tilemap.hexSideLength; + + var rowHeight = ((tileHeight - len) / 2 + len); + + return layerWorldY + tileY * rowHeight; +}; + +module.exports = HexagonalTileToWorldY; + + +/***/ }), +/* 534 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from staggered tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.StaggeredTileToWorldY + * @since 3.50.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var StaggeredTileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return layerWorldY + tileY * (tileHeight / 2); +}; + +module.exports = StaggeredTileToWorldY; + + +/***/ }), +/* 535 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to hexagonal tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.HexagonalWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinates down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var HexagonalWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + var len = layer.hexSideLength; + var rowHeight = ((tileHeight - len) / 2 + len); + + // similar to staggered, because Tiled uses the oddr representation. + var y = (snapToFloor) ? Math.floor((worldY / rowHeight)) : (worldY / rowHeight); + var x = (snapToFloor) ? Math.floor((worldX - (y % 2) * 0.5 * tileWidth) / tileWidth) : (worldX - (y % 2) * 0.5 * tileWidth) / tileWidth; + + return point.set(x, y); +}; + +module.exports = HexagonalWorldToTileXY; + + +/***/ }), +/* 536 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to isometric tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.IsometricWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var IsometricWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + worldX -= tileWidth / 2; + + var x = (snapToFloor) ? Math.floor((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2) : ((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2); + var y = (snapToFloor) ? Math.floor((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2) : ((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2); + + return point.set(x, y); +}; + +module.exports = IsometricWorldToTileXY; + + +/***/ }), +/* 537 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to staggered tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.StaggeredWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var StaggeredWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + var y = (snapToFloor) ? Math.floor((worldY / (tileHeight / 2))) : (worldY / (tileHeight / 2)); + var x = (snapToFloor) ? Math.floor((worldX + (y % 2) * 0.5 * tileWidth) / tileWidth) : (worldX + (y % 2) * 0.5 * tileWidth) / tileWidth; + + return point.set(x, y); +}; + +module.exports = StaggeredWorldToTileXY; + + +/***/ }), +/* 538 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var WorldToTileX = __webpack_require__(247); +var WorldToTileY = __webpack_require__(248); +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.WorldToTileXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + if (!point) { point = new Vector2(0, 0); } + + point.x = WorldToTileX(worldX, snapToFloor, camera, layer); + point.y = WorldToTileY(worldY, snapToFloor, camera, layer); + + return point; +}; + +module.exports = WorldToTileXY; + + +/***/ }), +/* 539 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to hexagonal tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.HexagonalWorldToTileY + * @since 3.50.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var HexagonalWorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = layer.hexSideLength; + + var rowHeight = ((tileHeight - len) / 2 + len); + + return (snapToFloor) ? Math.floor(worldY / rowHeight) : worldY / rowHeight; +}; + +module.exports = HexagonalWorldToTileY; + + +/***/ }), +/* 540 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to staggered tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.StaggeredWorldToTileY + * @since 3.50.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var StaggeredWorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return (snapToFloor) ? Math.floor(worldY / (tileHeight / 2)) : worldY / (tileHeight / 2); +}; + +module.exports = StaggeredWorldToTileY; + + +/***/ }), +/* 541 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsInLayerBounds = __webpack_require__(116); /** * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns @@ -110412,8 +117661,8 @@ var IsInLayerBounds = __webpack_require__(104); * @function Phaser.Tilemaps.Components.HasTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. @@ -110436,7 +117685,7 @@ module.exports = HasTileAt; /***/ }), -/* 505 */ +/* 542 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110445,9 +117694,9 @@ module.exports = HasTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(75); -var IsInLayerBounds = __webpack_require__(104); -var CalculateFacesAt = __webpack_require__(235); +var Tile = __webpack_require__(81); +var IsInLayerBounds = __webpack_require__(116); +var CalculateFacesAt = __webpack_require__(244); /** * Removes the tile at the given tile coordinates in the specified layer and updates the layer's @@ -110456,17 +117705,17 @@ var CalculateFacesAt = __webpack_require__(235); * @function Phaser.Tilemaps.Components.RemoveTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. + * @param {boolean} replaceWithNull - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, layer) { - if (replaceWithNull === undefined) { replaceWithNull = false; } + if (replaceWithNull === undefined) { replaceWithNull = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } if (!IsInLayerBounds(tileX, tileY, layer)) @@ -110482,7 +117731,7 @@ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, la } else { - layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height); + layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, layer.tileWidth, layer.tileHeight); } // Recalculate faces only if the removed tile was a colliding tile @@ -110498,7 +117747,7 @@ module.exports = RemoveTileAt; /***/ }), -/* 506 */ +/* 543 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110507,11 +117756,11 @@ module.exports = RemoveTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var Parse2DArray = __webpack_require__(237); -var ParseCSV = __webpack_require__(507); -var ParseJSONTiled = __webpack_require__(508); -var ParseWeltmeister = __webpack_require__(519); +var Formats = __webpack_require__(38); +var Parse2DArray = __webpack_require__(250); +var ParseCSV = __webpack_require__(544); +var ParseJSONTiled = __webpack_require__(545); +var ParseWeltmeister = __webpack_require__(556); /** * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format @@ -110523,11 +117772,11 @@ var ParseWeltmeister = __webpack_require__(519); * @since 3.0.0 * * @param {string} name - The name of the tilemap, used to set the name on the MapData. - * @param {integer} mapFormat - See ../Formats.js. - * @param {(integer[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. - * @param {integer} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but + * @param {number} mapFormat - See ../Formats.js. + * @param {(number[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. + * @param {number} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but * ignored for Tiled JSON. - * @param {integer} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but + * @param {number} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but * ignored for Tiled JSON. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty @@ -110568,7 +117817,7 @@ module.exports = Parse; /***/ }), -/* 507 */ +/* 544 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110577,8 +117826,8 @@ module.exports = Parse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var Parse2DArray = __webpack_require__(237); +var Formats = __webpack_require__(38); +var Parse2DArray = __webpack_require__(250); /** * Parses a CSV string of tile indexes into a new MapData object with a single layer. @@ -110588,8 +117837,8 @@ var Parse2DArray = __webpack_require__(237); * * @param {string} name - The name of the tilemap, used to set the name on the MapData. * @param {string} data - CSV string of tile indexes. - * @param {integer} tileWidth - The width of a tile in pixels. - * @param {integer} tileHeight - The height of a tile in pixels. + * @param {number} tileWidth - The width of a tile in pixels. + * @param {number} tileHeight - The height of a tile in pixels. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty * location will get a Tile object with an index of -1. If you've a large sparsely populated map and @@ -110616,7 +117865,7 @@ module.exports = ParseCSV; /***/ }), -/* 508 */ +/* 545 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110625,14 +117874,16 @@ module.exports = ParseCSV; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var MapData = __webpack_require__(106); -var ParseTileLayers = __webpack_require__(509); -var ParseImageLayers = __webpack_require__(511); -var ParseTilesets = __webpack_require__(512); -var ParseObjectLayers = __webpack_require__(515); -var BuildTilesetIndex = __webpack_require__(517); -var AssignTileProperties = __webpack_require__(518); +var AssignTileProperties = __webpack_require__(546); +var BuildTilesetIndex = __webpack_require__(547); +var CONST = __webpack_require__(29); +var Formats = __webpack_require__(38); +var FromOrientationString = __webpack_require__(242); +var MapData = __webpack_require__(118); +var ParseImageLayers = __webpack_require__(548); +var ParseObjectLayers = __webpack_require__(549); +var ParseTileLayers = __webpack_require__(552); +var ParseTilesets = __webpack_require__(554); /** * Parses a Tiled JSON object into a new MapData object. @@ -110653,12 +117904,6 @@ var AssignTileProperties = __webpack_require__(518); */ var ParseJSONTiled = function (name, json, insertNull) { - if (json.orientation !== 'orthogonal') - { - console.warn('Only orthogonal map types are supported in this version of Phaser'); - return null; - } - // Map data will consist of: layers, objects, images, tilesets, sizes var mapData = new MapData({ width: json.width, @@ -110666,7 +117911,7 @@ var ParseJSONTiled = function (name, json, insertNull) name: name, tileWidth: json.tilewidth, tileHeight: json.tileheight, - orientation: json.orientation, + orientation: FromOrientationString(json.orientation), format: Formats.TILED_JSON, version: json.version, properties: json.properties, @@ -110674,10 +117919,16 @@ var ParseJSONTiled = function (name, json, insertNull) infinite: json.infinite }); + if (mapData.orientation === CONST.HEXAGONAL) + { + mapData.hexSideLength = json.hexsidelength; + } + mapData.layers = ParseTileLayers(json, insertNull); mapData.images = ParseImageLayers(json); var sets = ParseTilesets(json); + mapData.tilesets = sets.tilesets; mapData.imageCollections = sets.imageCollections; @@ -110694,7 +117945,7 @@ module.exports = ParseJSONTiled; /***/ }), -/* 509 */ +/* 546 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -110703,257 +117954,72 @@ module.exports = ParseJSONTiled; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64Decode = __webpack_require__(510); -var GetFastValue = __webpack_require__(2); -var LayerData = __webpack_require__(105); -var ParseGID = __webpack_require__(238); -var Tile = __webpack_require__(75); -var CreateGroupLayer = __webpack_require__(154); +var Extend = __webpack_require__(18); /** - * Parses all tilemap layers in a Tiled JSON object into new LayerData objects. + * Copy properties from tileset to tiles. * - * @function Phaser.Tilemaps.Parsers.Tiled.ParseTileLayers + * @function Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties * @since 3.0.0 * - * @param {object} json - The Tiled JSON object. - * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map - * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). - * - * @return {Phaser.Tilemaps.LayerData[]} - An array of LayerData objects, one for each entry in - * json.layers with the type 'tilelayer'. + * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. */ -var ParseTileLayers = function (json, insertNull) +var AssignTileProperties = function (mapData) { - var infiniteMap = GetFastValue(json, 'infinite', false); - var tileLayers = []; + var layerData; + var tile; + var sid; + var set; + var row; - // State inherited from a parent group - var groupStack = []; - var curGroupState = CreateGroupLayer(json); - - while (curGroupState.i < curGroupState.layers.length || groupStack.length > 0) + // go through each of the map data layers + for (var i = 0; i < mapData.layers.length; i++) { - if (curGroupState.i >= curGroupState.layers.length) + layerData = mapData.layers[i]; + + set = null; + + // rows of tiles + for (var j = 0; j < layerData.data.length; j++) { - // Ensure recursion stack is not empty first - if (groupStack.length < 1) + row = layerData.data[j]; + + // individual tiles + for (var k = 0; k < row.length; k++) { - console.warn( - 'TilemapParser.parseTiledJSON - Invalid layer group hierarchy' - ); - break; - } + tile = row[k]; - // Return to previous recursive state - curGroupState = groupStack.pop(); - continue; - } - - var curl = curGroupState.layers[curGroupState.i]; - curGroupState.i++; - - if (curl.type !== 'tilelayer') - { - if (curl.type === 'group') - { - // Compute next state inherited from group - var nextGroupState = CreateGroupLayer(json, curl, curGroupState); - - // Preserve current state before recursing - groupStack.push(curGroupState); - curGroupState = nextGroupState; - } - - // Skip this layer OR 'recurse' (iterative style) into the group - continue; - } - - // Base64 decode data if necessary. NOTE: uncompressed base64 only. - if (curl.compression) - { - console.warn( - 'TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer \'' - + curl.name + '\'' - ); - continue; - } - else if (curl.encoding && curl.encoding === 'base64') - { - // Chunks for an infinite map - if (curl.chunks) - { - for (var i = 0; i < curl.chunks.length; i++) + if (tile === null || tile.index < 0) { - curl.chunks[i].data = Base64Decode(curl.chunks[i].data); + continue; } - } - // Non-infinite map data - if (curl.data) - { - curl.data = Base64Decode(curl.data); - } + // find the relevant tileset + sid = mapData.tiles[tile.index][2]; + set = mapData.tilesets[sid]; - delete curl.encoding; // Allow the same map to be parsed multiple times - } + // Ensure that a tile's size matches its tileset + tile.width = set.tileWidth; + tile.height = set.tileHeight; - // This is an array containing the tile indexes, one after the other. -1 = no tile, - // everything else = the tile index (starting at 1 for Tiled, 0 for CSV) If the map - // contains multiple tilesets then the indexes are relative to that which the set starts - // from. Need to set which tileset in the cache = which tileset in the JSON, if you do this - // manually it means you can use the same map data but a new tileset. - - var layerData; - var gidInfo; - var tile; - var blankTile; - - var output = []; - var x = 0; - - if (infiniteMap) - { - var layerOffsetX = (GetFastValue(curl, 'startx', 0) + curl.x); - var layerOffsetY = (GetFastValue(curl, 'starty', 0) + curl.y); - layerData = new LayerData({ - name: (curGroupState.name + curl.name), - x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + layerOffsetX * json.tilewidth), - y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + layerOffsetY * json.tileheight), - width: curl.width, - height: curl.height, - tileWidth: json.tilewidth, - tileHeight: json.tileheight, - alpha: (curGroupState.opacity * curl.opacity), - visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', []) - }); - - for (var c = 0; c < curl.height; c++) - { - output.push([ null ]); - - for (var j = 0; j < curl.width; j++) + // if that tile type has any properties, add them to the tile object + if (set.tileProperties && set.tileProperties[tile.index - set.firstgid]) { - output[c][j] = null; - } - } - - for (c = 0, len = curl.chunks.length; c < len; c++) - { - var chunk = curl.chunks[c]; - - var offsetX = (chunk.x - layerOffsetX); - var offsetY = (chunk.y - layerOffsetY); - - var y = 0; - - for (var t = 0, len2 = chunk.data.length; t < len2; t++) - { - var newOffsetX = x + offsetX; - var newOffsetY = y + offsetY; - - gidInfo = ParseGID(chunk.data[t]); - - // index, x, y, width, height - if (gidInfo.gid > 0) - { - tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth, - json.tileheight); - - // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal - // propeties into flipX, flipY and rotation - tile.rotation = gidInfo.rotation; - tile.flipX = gidInfo.flipped; - - output[newOffsetY][newOffsetX] = tile; - } - else - { - blankTile = insertNull - ? null - : new Tile(layerData, -1, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); - - output[newOffsetY][newOffsetX] = blankTile; - } - - x++; - - if (x === chunk.width) - { - y++; - x = 0; - } + tile.properties = Extend( + tile.properties, set.tileProperties[tile.index - set.firstgid] + ); } } } - else - { - layerData = new LayerData({ - name: (curGroupState.name + curl.name), - x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + curl.x), - y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + curl.y), - width: curl.width, - height: curl.height, - tileWidth: json.tilewidth, - tileHeight: json.tileheight, - alpha: (curGroupState.opacity * curl.opacity), - visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', []) - }); - - var row = []; - - // Loop through the data field in the JSON. - for (var k = 0, len = curl.data.length; k < len; k++) - { - gidInfo = ParseGID(curl.data[k]); - - // index, x, y, width, height - if (gidInfo.gid > 0) - { - tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth, - json.tileheight); - - // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal - // propeties into flipX, flipY and rotation - tile.rotation = gidInfo.rotation; - tile.flipX = gidInfo.flipped; - - row.push(tile); - } - else - { - blankTile = insertNull - ? null - : new Tile(layerData, -1, x, output.length, json.tilewidth, json.tileheight); - row.push(blankTile); - } - - x++; - - if (x === curl.width) - { - output.push(row); - x = 0; - row = []; - } - } - } - - layerData.data = output; - tileLayers.push(layerData); } - - return tileLayers; }; -module.exports = ParseTileLayers; +module.exports = AssignTileProperties; /***/ }), -/* 510 */ -/***/ (function(module, exports) { +/* 547 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -110961,41 +118027,92 @@ module.exports = ParseTileLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Tileset = __webpack_require__(119); + /** - * Decode base-64 encoded data, for example as exported by Tiled. + * Master list of tiles -> x, y, index in tileset. * - * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode + * @function Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex * @since 3.0.0 * - * @param {object} data - Base-64 encoded data to decode. + * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. * - * @return {array} Array containing the decoded bytes. + * @return {array} An array of Tileset objects. */ -var Base64Decode = function (data) +var BuildTilesetIndex = function (mapData) { - var binaryString = window.atob(data); - var len = binaryString.length; - var bytes = new Array(len / 4); + var i; + var set; + var tiles = []; - // Interpret binaryString as an array of bytes representing little-endian encoded uint32 values. - for (var i = 0; i < len; i += 4) + for (i = 0; i < mapData.imageCollections.length; i++) { - bytes[i / 4] = ( - binaryString.charCodeAt(i) | - binaryString.charCodeAt(i + 1) << 8 | - binaryString.charCodeAt(i + 2) << 16 | - binaryString.charCodeAt(i + 3) << 24 - ) >>> 0; + var collection = mapData.imageCollections[i]; + var images = collection.images; + + for (var j = 0; j < images.length; j++) + { + var image = images[j]; + + set = new Tileset(image.image, image.gid, collection.imageWidth, collection.imageHeight, 0, 0); + + set.updateTileData(collection.imageWidth, collection.imageHeight); + + mapData.tilesets.push(set); + } } - return bytes; + for (i = 0; i < mapData.tilesets.length; i++) + { + set = mapData.tilesets[i]; + + var x = set.tileMargin; + var y = set.tileMargin; + + var count = 0; + var countX = 0; + var countY = 0; + + for (var t = set.firstgid; t < set.firstgid + set.total; t++) + { + // Can add extra properties here as needed + tiles[t] = [ x, y, i ]; + + x += set.tileWidth + set.tileSpacing; + + count++; + + if (count === set.total) + { + break; + } + + countX++; + + if (countX === set.columns) + { + x = set.tileMargin; + y += set.tileHeight + set.tileSpacing; + + countX = 0; + countY++; + + if (countY === set.rows) + { + break; + } + } + } + } + + return tiles; }; -module.exports = Base64Decode; +module.exports = BuildTilesetIndex; /***/ }), -/* 511 */ +/* 548 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111083,392 +118200,7 @@ module.exports = ParseImageLayers; /***/ }), -/* 512 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Tileset = __webpack_require__(107); -var ImageCollection = __webpack_require__(513); -var ParseObject = __webpack_require__(239); - -/** - * Tilesets and Image Collections - * - * @function Phaser.Tilemaps.Parsers.Tiled.ParseTilesets - * @since 3.0.0 - * - * @param {object} json - The Tiled JSON data. - * - * @return {object} An object containing the tileset and image collection data. - */ -var ParseTilesets = function (json) -{ - var tilesets = []; - var imageCollections = []; - var lastSet = null; - var stringID; - - for (var i = 0; i < json.tilesets.length; i++) - { - // name, firstgid, width, height, margin, spacing, properties - var set = json.tilesets[i]; - - if (set.source) - { - console.warn('Phaser can\'t load external tilesets. Use the Embed Tileset button and then export the map again.'); - } - else if (set.image) - { - var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); - - if (json.version > 1) - { - // Tiled 1.2+ - - if (Array.isArray(set.tiles)) - { - var tiles = {}; - var props = {}; - - for (var t = 0; t < set.tiles.length; t++) - { - var tile = set.tiles[t]; - - // Convert tileproperties - if (tile.properties) - { - var newPropData = {}; - - tile.properties.forEach(function (propData) - { - newPropData[propData['name']] = propData['value']; - }); - - props[tile.id] = newPropData; - } - - // Convert objectgroup - if (tile.objectgroup) - { - tiles[tile.id] = { objectgroup: tile.objectgroup }; - - if (tile.objectgroup.objects) - { - var parsedObjects2 = tile.objectgroup.objects.map( - function (obj) { return ParseObject(obj); } - ); - - tiles[tile.id].objectgroup.objects = parsedObjects2; - } - } - - // Copy animation data - if (tile.animation) - { - if (tiles.hasOwnProperty(tile.id)) - { - tiles[tile.id].animation = tile.animation; - } - else - { - tiles[tile.id] = { animation: tile.animation }; - } - } - } - - newSet.tileData = tiles; - newSet.tileProperties = props; - } - } - else - { - // Tiled 1 - - // Properties stored per-tile in object with string indexes starting at "0" - if (set.tileproperties) - { - newSet.tileProperties = set.tileproperties; - } - - // Object & terrain shapes stored per-tile in object with string indexes starting at "0" - if (set.tiles) - { - newSet.tileData = set.tiles; - - // Parse the objects into Phaser format to match handling of other Tiled objects - for (stringID in newSet.tileData) - { - var objectGroup = newSet.tileData[stringID].objectgroup; - if (objectGroup && objectGroup.objects) - { - var parsedObjects1 = objectGroup.objects.map( - function (obj) { return ParseObject(obj); } - ); - newSet.tileData[stringID].objectgroup.objects = parsedObjects1; - } - } - } - } - - // For a normal sliced tileset the row/count/size information is computed when updated. - // This is done (again) after the image is set. - newSet.updateTileData(set.imagewidth, set.imageheight); - - tilesets.push(newSet); - } - else - { - var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth, - set.tileheight, set.margin, set.spacing, set.properties); - - for (stringID in set.tiles) - { - var image = set.tiles[stringID].image; - var gid = set.firstgid + parseInt(stringID, 10); - newCollection.addImage(gid, image); - } - - imageCollections.push(newCollection); - } - - // We've got a new Tileset, so set the lastgid into the previous one - if (lastSet) - { - lastSet.lastgid = set.firstgid - 1; - } - - lastSet = set; - } - - return { tilesets: tilesets, imageCollections: imageCollections }; -}; - -module.exports = ParseTilesets; - - -/***/ }), -/* 513 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image. - * - * Image Collections are normally created automatically when Tiled data is loaded. - * - * @class ImageCollection - * @memberof Phaser.Tilemaps - * @constructor - * @since 3.0.0 - * - * @param {string} name - The name of the image collection in the map data. - * @param {integer} firstgid - The first image index this image collection contains. - * @param {integer} [width=32] - Width of widest image (in pixels). - * @param {integer} [height=32] - Height of tallest image (in pixels). - * @param {integer} [margin=0] - The margin around all images in the collection (in pixels). - * @param {integer} [spacing=0] - The spacing between each image in the collection (in pixels). - * @param {object} [properties={}] - Custom Image Collection properties. - */ -var ImageCollection = new Class({ - - initialize: - - function ImageCollection (name, firstgid, width, height, margin, spacing, properties) - { - if (width === undefined || width <= 0) { width = 32; } - if (height === undefined || height <= 0) { height = 32; } - if (margin === undefined) { margin = 0; } - if (spacing === undefined) { spacing = 0; } - - /** - * The name of the Image Collection. - * - * @name Phaser.Tilemaps.ImageCollection#name - * @type {string} - * @since 3.0.0 - */ - this.name = name; - - /** - * The Tiled firstgid value. - * This is the starting index of the first image index this Image Collection contains. - * - * @name Phaser.Tilemaps.ImageCollection#firstgid - * @type {integer} - * @since 3.0.0 - */ - this.firstgid = firstgid | 0; - - /** - * The width of the widest image (in pixels). - * - * @name Phaser.Tilemaps.ImageCollection#imageWidth - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageWidth = width | 0; - - /** - * The height of the tallest image (in pixels). - * - * @name Phaser.Tilemaps.ImageCollection#imageHeight - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageHeight = height | 0; - - /** - * The margin around the images in the collection (in pixels). - * Use `setSpacing` to change. - * - * @name Phaser.Tilemaps.ImageCollection#imageMarge - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageMargin = margin | 0; - - /** - * The spacing between each image in the collection (in pixels). - * Use `setSpacing` to change. - * - * @name Phaser.Tilemaps.ImageCollection#imageSpacing - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageSpacing = spacing | 0; - - /** - * Image Collection-specific properties that are typically defined in the Tiled editor. - * - * @name Phaser.Tilemaps.ImageCollection#properties - * @type {object} - * @since 3.0.0 - */ - this.properties = properties || {}; - - /** - * The cached images that are a part of this collection. - * - * @name Phaser.Tilemaps.ImageCollection#images - * @type {array} - * @readonly - * @since 3.0.0 - */ - this.images = []; - - /** - * The total number of images in the image collection. - * - * @name Phaser.Tilemaps.ImageCollection#total - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.total = 0; - }, - - /** - * Returns true if and only if this image collection contains the given image index. - * - * @method Phaser.Tilemaps.ImageCollection#containsImageIndex - * @since 3.0.0 - * - * @param {integer} imageIndex - The image index to search for. - * - * @return {boolean} True if this Image Collection contains the given index. - */ - containsImageIndex: function (imageIndex) - { - return (imageIndex >= this.firstgid && imageIndex < (this.firstgid + this.total)); - }, - - /** - * Add an image to this Image Collection. - * - * @method Phaser.Tilemaps.ImageCollection#addImage - * @since 3.0.0 - * - * @param {integer} gid - The gid of the image in the Image Collection. - * @param {string} image - The the key of the image in the Image Collection and in the cache. - * - * @return {Phaser.Tilemaps.ImageCollection} This ImageCollection object. - */ - addImage: function (gid, image) - { - this.images.push({ gid: gid, image: image }); - this.total++; - - return this; - } - -}); - -module.exports = ImageCollection; - - -/***/ }), -/* 514 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var HasValue = __webpack_require__(115); - -/** - * Returns a new object that only contains the `keys` that were found on the object provided. - * If no `keys` are found, an empty object is returned. - * - * @function Phaser.Utils.Objects.Pick - * @since 3.18.0 - * - * @param {object} object - The object to pick the provided keys from. - * @param {array} keys - An array of properties to retrieve from the provided object. - * - * @return {object} A new object that only contains the `keys` that were found on the provided object. If no `keys` were found, an empty object will be returned. - */ -var Pick = function (object, keys) -{ - var obj = {}; - - for (var i = 0; i < keys.length; i++) - { - var key = keys[i]; - - if (HasValue(object, key)) - { - obj[key] = object[key]; - } - } - - return obj; -}; - -module.exports = Pick; - - -/***/ }), -/* 515 */ +/* 549 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111478,8 +118210,8 @@ module.exports = Pick; */ var GetFastValue = __webpack_require__(2); -var ParseObject = __webpack_require__(239); -var ObjectLayer = __webpack_require__(516); +var ParseObject = __webpack_require__(251); +var ObjectLayer = __webpack_require__(551); var CreateGroupLayer = __webpack_require__(154); /** @@ -111567,7 +118299,51 @@ module.exports = ParseObjectLayers; /***/ }), -/* 516 */ +/* 550 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HasValue = __webpack_require__(123); + +/** + * Returns a new object that only contains the `keys` that were found on the object provided. + * If no `keys` are found, an empty object is returned. + * + * @function Phaser.Utils.Objects.Pick + * @since 3.18.0 + * + * @param {object} object - The object to pick the provided keys from. + * @param {array} keys - An array of properties to retrieve from the provided object. + * + * @return {object} A new object that only contains the `keys` that were found on the provided object. If no `keys` were found, an empty object will be returned. + */ +var Pick = function (object, keys) +{ + var obj = {}; + + for (var i = 0; i < keys.length; i++) + { + var key = keys[i]; + + if (HasValue(object, key)) + { + obj[key] = object[key]; + } + } + + return obj; +}; + +module.exports = Pick; + + +/***/ }), +/* 551 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111689,7 +118465,7 @@ module.exports = ObjectLayer; /***/ }), -/* 517 */ +/* 552 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111698,93 +118474,269 @@ module.exports = ObjectLayer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(107); +var Base64Decode = __webpack_require__(553); +var CONST = __webpack_require__(29); +var CreateGroupLayer = __webpack_require__(154); +var FromOrientationString = __webpack_require__(242); +var GetFastValue = __webpack_require__(2); +var LayerData = __webpack_require__(117); +var ParseGID = __webpack_require__(252); +var Tile = __webpack_require__(81); /** - * Master list of tiles -> x, y, index in tileset. + * Parses all tilemap layers in a Tiled JSON object into new LayerData objects. * - * @function Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex + * @function Phaser.Tilemaps.Parsers.Tiled.ParseTileLayers * @since 3.0.0 * - * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. + * @param {object} json - The Tiled JSON object. + * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map + * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). * - * @return {array} An array of Tileset objects. + * @return {Phaser.Tilemaps.LayerData[]} - An array of LayerData objects, one for each entry in + * json.layers with the type 'tilelayer'. */ -var BuildTilesetIndex = function (mapData) +var ParseTileLayers = function (json, insertNull) { - var i; - var set; - var tiles = []; + var infiniteMap = GetFastValue(json, 'infinite', false); + var tileLayers = []; - for (i = 0; i < mapData.imageCollections.length; i++) + // State inherited from a parent group + var groupStack = []; + var curGroupState = CreateGroupLayer(json); + + while (curGroupState.i < curGroupState.layers.length || groupStack.length > 0) { - var collection = mapData.imageCollections[i]; - var images = collection.images; - - for (var j = 0; j < images.length; j++) + if (curGroupState.i >= curGroupState.layers.length) { - var image = images[j]; - - set = new Tileset(image.image, image.gid, collection.imageWidth, collection.imageHeight, 0, 0); - - set.updateTileData(collection.imageWidth, collection.imageHeight); - - mapData.tilesets.push(set); - } - } - - for (i = 0; i < mapData.tilesets.length; i++) - { - set = mapData.tilesets[i]; - - var x = set.tileMargin; - var y = set.tileMargin; - - var count = 0; - var countX = 0; - var countY = 0; - - for (var t = set.firstgid; t < set.firstgid + set.total; t++) - { - // Can add extra properties here as needed - tiles[t] = [ x, y, i ]; - - x += set.tileWidth + set.tileSpacing; - - count++; - - if (count === set.total) + // Ensure recursion stack is not empty first + if (groupStack.length < 1) { + console.warn( + 'TilemapParser.parseTiledJSON - Invalid layer group hierarchy' + ); break; } - countX++; + // Return to previous recursive state + curGroupState = groupStack.pop(); + continue; + } - if (countX === set.columns) + var curl = curGroupState.layers[curGroupState.i]; + curGroupState.i++; + + if (curl.type !== 'tilelayer') + { + if (curl.type === 'group') { - x = set.tileMargin; - y += set.tileHeight + set.tileSpacing; + // Compute next state inherited from group + var nextGroupState = CreateGroupLayer(json, curl, curGroupState); - countX = 0; - countY++; + // Preserve current state before recursing + groupStack.push(curGroupState); + curGroupState = nextGroupState; + } - if (countY === set.rows) + // Skip this layer OR 'recurse' (iterative style) into the group + continue; + } + + // Base64 decode data if necessary. NOTE: uncompressed base64 only. + if (curl.compression) + { + console.warn( + 'TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer \'' + + curl.name + '\'' + ); + continue; + } + else if (curl.encoding && curl.encoding === 'base64') + { + // Chunks for an infinite map + if (curl.chunks) + { + for (var i = 0; i < curl.chunks.length; i++) { - break; + curl.chunks[i].data = Base64Decode(curl.chunks[i].data); + } + } + + // Non-infinite map data + if (curl.data) + { + curl.data = Base64Decode(curl.data); + } + + delete curl.encoding; // Allow the same map to be parsed multiple times + } + + // This is an array containing the tile indexes, one after the other. -1 = no tile, + // everything else = the tile index (starting at 1 for Tiled, 0 for CSV) If the map + // contains multiple tilesets then the indexes are relative to that which the set starts + // from. Need to set which tileset in the cache = which tileset in the JSON, if you do this + // manually it means you can use the same map data but a new tileset. + + var layerData; + var gidInfo; + var tile; + var blankTile; + + var output = []; + var x = 0; + + if (infiniteMap) + { + var layerOffsetX = (GetFastValue(curl, 'startx', 0) + curl.x); + var layerOffsetY = (GetFastValue(curl, 'starty', 0) + curl.y); + + layerData = new LayerData({ + name: (curGroupState.name + curl.name), + x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + layerOffsetX * json.tilewidth), + y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + layerOffsetY * json.tileheight), + width: curl.width, + height: curl.height, + tileWidth: json.tilewidth, + tileHeight: json.tileheight, + alpha: (curGroupState.opacity * curl.opacity), + visible: (curGroupState.visible && curl.visible), + properties: GetFastValue(curl, 'properties', []), + orientation: FromOrientationString(json.orientation) + }); + + if (layerData.orientation === CONST.HEXAGONAL) + { + layerData.hexSideLength = json.hexsidelength; + } + + for (var c = 0; c < curl.height; c++) + { + output.push([ null ]); + + for (var j = 0; j < curl.width; j++) + { + output[c][j] = null; + } + } + + for (c = 0, len = curl.chunks.length; c < len; c++) + { + var chunk = curl.chunks[c]; + + var offsetX = (chunk.x - layerOffsetX); + var offsetY = (chunk.y - layerOffsetY); + + var y = 0; + + for (var t = 0, len2 = chunk.data.length; t < len2; t++) + { + var newOffsetX = x + offsetX; + var newOffsetY = y + offsetY; + + gidInfo = ParseGID(chunk.data[t]); + + // index, x, y, width, height + if (gidInfo.gid > 0) + { + tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); + + // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal + // propeties into flipX, flipY and rotation + tile.rotation = gidInfo.rotation; + tile.flipX = gidInfo.flipped; + + output[newOffsetY][newOffsetX] = tile; + } + else + { + blankTile = insertNull + ? null + : new Tile(layerData, -1, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); + + output[newOffsetY][newOffsetX] = blankTile; + } + + x++; + + if (x === chunk.width) + { + y++; + x = 0; + } } } } + else + { + layerData = new LayerData({ + name: (curGroupState.name + curl.name), + x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + curl.x), + y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + curl.y), + width: curl.width, + height: curl.height, + tileWidth: json.tilewidth, + tileHeight: json.tileheight, + alpha: (curGroupState.opacity * curl.opacity), + visible: (curGroupState.visible && curl.visible), + properties: GetFastValue(curl, 'properties', []), + orientation: FromOrientationString(json.orientation) + }); + + if (layerData.orientation === CONST.HEXAGONAL) + { + layerData.hexSideLength = json.hexsidelength; + } + var row = []; + + // Loop through the data field in the JSON. + for (var k = 0, len = curl.data.length; k < len; k++) + { + gidInfo = ParseGID(curl.data[k]); + + // index, x, y, width, height + if (gidInfo.gid > 0) + { + tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth, json.tileheight); + + // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal + // propeties into flipX, flipY and rotation + tile.rotation = gidInfo.rotation; + tile.flipX = gidInfo.flipped; + + row.push(tile); + } + else + { + blankTile = insertNull + ? null + : new Tile(layerData, -1, x, output.length, json.tilewidth, json.tileheight); + row.push(blankTile); + } + + x++; + + if (x === curl.width) + { + output.push(row); + x = 0; + row = []; + } + } + } + + layerData.data = output; + tileLayers.push(layerData); } - return tiles; + return tileLayers; }; -module.exports = BuildTilesetIndex; +module.exports = ParseTileLayers; /***/ }), -/* 518 */ -/***/ (function(module, exports, __webpack_require__) { +/* 553 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -111792,71 +118744,41 @@ module.exports = BuildTilesetIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); - /** - * Copy properties from tileset to tiles. + * Decode base-64 encoded data, for example as exported by Tiled. * - * @function Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties + * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode * @since 3.0.0 * - * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. + * @param {object} data - Base-64 encoded data to decode. + * + * @return {array} Array containing the decoded bytes. */ -var AssignTileProperties = function (mapData) +var Base64Decode = function (data) { - var layerData; - var tile; - var sid; - var set; - var row; + var binaryString = window.atob(data); + var len = binaryString.length; + var bytes = new Array(len / 4); - // go through each of the map data layers - for (var i = 0; i < mapData.layers.length; i++) + // Interpret binaryString as an array of bytes representing little-endian encoded uint32 values. + for (var i = 0; i < len; i += 4) { - layerData = mapData.layers[i]; - - set = null; - - // rows of tiles - for (var j = 0; j < layerData.data.length; j++) - { - row = layerData.data[j]; - - // individual tiles - for (var k = 0; k < row.length; k++) - { - tile = row[k]; - - if (tile === null || tile.index < 0) - { - continue; - } - - // find the relevant tileset - sid = mapData.tiles[tile.index][2]; - set = mapData.tilesets[sid]; - - // Ensure that a tile's size matches its tileset - tile.width = set.tileWidth; - tile.height = set.tileHeight; - - // if that tile type has any properties, add them to the tile object - if (set.tileProperties && set.tileProperties[tile.index - set.firstgid]) - { - tile.properties = Extend( - tile.properties, set.tileProperties[tile.index - set.firstgid] - ); - } - } - } + bytes[i / 4] = ( + binaryString.charCodeAt(i) | + binaryString.charCodeAt(i + 1) << 8 | + binaryString.charCodeAt(i + 2) << 16 | + binaryString.charCodeAt(i + 3) << 24 + ) >>> 0; } + + return bytes; }; -module.exports = AssignTileProperties; +module.exports = Base64Decode; /***/ }), -/* 519 */ +/* 554 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111865,10 +118787,363 @@ module.exports = AssignTileProperties; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var MapData = __webpack_require__(106); -var ParseTileLayers = __webpack_require__(520); -var ParseTilesets = __webpack_require__(521); +var Tileset = __webpack_require__(119); +var ImageCollection = __webpack_require__(555); +var ParseObject = __webpack_require__(251); + +/** + * Tilesets and Image Collections + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseTilesets + * @since 3.0.0 + * + * @param {object} json - The Tiled JSON data. + * + * @return {object} An object containing the tileset and image collection data. + */ +var ParseTilesets = function (json) +{ + var tilesets = []; + var imageCollections = []; + var lastSet = null; + var stringID; + + for (var i = 0; i < json.tilesets.length; i++) + { + // name, firstgid, width, height, margin, spacing, properties + var set = json.tilesets[i]; + + if (set.source) + { + console.warn('External tilesets unsupported. Use Embed Tileset and re-export'); + } + else if (set.image) + { + var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); + + if (json.version > 1) + { + // Tiled 1.2+ + + if (Array.isArray(set.tiles)) + { + var tiles = {}; + var props = {}; + + for (var t = 0; t < set.tiles.length; t++) + { + var tile = set.tiles[t]; + + // Convert tileproperties + if (tile.properties) + { + var newPropData = {}; + + tile.properties.forEach(function (propData) + { + newPropData[propData['name']] = propData['value']; + }); + + props[tile.id] = newPropData; + } + + // Convert objectgroup + if (tile.objectgroup) + { + tiles[tile.id] = { objectgroup: tile.objectgroup }; + + if (tile.objectgroup.objects) + { + var parsedObjects2 = tile.objectgroup.objects.map(function (obj) + { + return ParseObject(obj); + }); + + tiles[tile.id].objectgroup.objects = parsedObjects2; + } + } + + // Copy animation data + if (tile.animation) + { + if (tiles.hasOwnProperty(tile.id)) + { + tiles[tile.id].animation = tile.animation; + } + else + { + tiles[tile.id] = { animation: tile.animation }; + } + } + } + + newSet.tileData = tiles; + newSet.tileProperties = props; + } + } + else + { + // Tiled 1 + + // Properties stored per-tile in object with string indexes starting at "0" + if (set.tileproperties) + { + newSet.tileProperties = set.tileproperties; + } + + // Object & terrain shapes stored per-tile in object with string indexes starting at "0" + if (set.tiles) + { + newSet.tileData = set.tiles; + + // Parse the objects into Phaser format to match handling of other Tiled objects + for (stringID in newSet.tileData) + { + var objectGroup = newSet.tileData[stringID].objectgroup; + + if (objectGroup && objectGroup.objects) + { + var parsedObjects1 = objectGroup.objects.map(function (obj) + { + return ParseObject(obj); + }); + + newSet.tileData[stringID].objectgroup.objects = parsedObjects1; + } + } + } + } + + // For a normal sliced tileset the row/count/size information is computed when updated. + // This is done (again) after the image is set. + newSet.updateTileData(set.imagewidth, set.imageheight); + + tilesets.push(newSet); + } + else + { + var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing, set.properties); + + var maxId = 0; + + for (t = 0; t < set.tiles.length; t++) + { + tile = set.tiles[t]; + + var image = tile.image; + var tileId = parseInt(tile.id, 10); + var gid = set.firstgid + tileId; + newCollection.addImage(gid, image); + + maxId = Math.max(tileId, maxId); + } + + newCollection.maxId = maxId; + + imageCollections.push(newCollection); + } + + // We've got a new Tileset, so set the lastgid into the previous one + if (lastSet) + { + lastSet.lastgid = set.firstgid - 1; + } + + lastSet = set; + } + + return { tilesets: tilesets, imageCollections: imageCollections }; +}; + +module.exports = ParseTilesets; + + +/***/ }), +/* 555 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image. + * + * Image Collections are normally created automatically when Tiled data is loaded. + * + * @class ImageCollection + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {string} name - The name of the image collection in the map data. + * @param {number} firstgid - The first image index this image collection contains. + * @param {number} [width=32] - Width of widest image (in pixels). + * @param {number} [height=32] - Height of tallest image (in pixels). + * @param {number} [margin=0] - The margin around all images in the collection (in pixels). + * @param {number} [spacing=0] - The spacing between each image in the collection (in pixels). + * @param {object} [properties={}] - Custom Image Collection properties. + */ +var ImageCollection = new Class({ + + initialize: + + function ImageCollection (name, firstgid, width, height, margin, spacing, properties) + { + if (width === undefined || width <= 0) { width = 32; } + if (height === undefined || height <= 0) { height = 32; } + if (margin === undefined) { margin = 0; } + if (spacing === undefined) { spacing = 0; } + + /** + * The name of the Image Collection. + * + * @name Phaser.Tilemaps.ImageCollection#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The Tiled firstgid value. + * This is the starting index of the first image index this Image Collection contains. + * + * @name Phaser.Tilemaps.ImageCollection#firstgid + * @type {number} + * @since 3.0.0 + */ + this.firstgid = firstgid | 0; + + /** + * The width of the widest image (in pixels). + * + * @name Phaser.Tilemaps.ImageCollection#imageWidth + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageWidth = width | 0; + + /** + * The height of the tallest image (in pixels). + * + * @name Phaser.Tilemaps.ImageCollection#imageHeight + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageHeight = height | 0; + + /** + * The margin around the images in the collection (in pixels). + * Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.ImageCollection#imageMarge + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageMargin = margin | 0; + + /** + * The spacing between each image in the collection (in pixels). + * Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.ImageCollection#imageSpacing + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageSpacing = spacing | 0; + + /** + * Image Collection-specific properties that are typically defined in the Tiled editor. + * + * @name Phaser.Tilemaps.ImageCollection#properties + * @type {object} + * @since 3.0.0 + */ + this.properties = properties || {}; + + /** + * The cached images that are a part of this collection. + * + * @name Phaser.Tilemaps.ImageCollection#images + * @type {array} + * @readonly + * @since 3.0.0 + */ + this.images = []; + + /** + * The total number of images in the image collection. + * + * @name Phaser.Tilemaps.ImageCollection#total + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.total = 0; + }, + + /** + * Returns true if and only if this image collection contains the given image index. + * + * @method Phaser.Tilemaps.ImageCollection#containsImageIndex + * @since 3.0.0 + * + * @param {number} imageIndex - The image index to search for. + * + * @return {boolean} True if this Image Collection contains the given index. + */ + containsImageIndex: function (imageIndex) + { + return (imageIndex >= this.firstgid && imageIndex < (this.firstgid + this.total)); + }, + + /** + * Add an image to this Image Collection. + * + * @method Phaser.Tilemaps.ImageCollection#addImage + * @since 3.0.0 + * + * @param {number} gid - The gid of the image in the Image Collection. + * @param {string} image - The the key of the image in the Image Collection and in the cache. + * + * @return {Phaser.Tilemaps.ImageCollection} This ImageCollection object. + */ + addImage: function (gid, image) + { + this.images.push({ gid: gid, image: image }); + this.total++; + + return this; + } + +}); + +module.exports = ImageCollection; + + +/***/ }), +/* 556 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(38); +var MapData = __webpack_require__(118); +var ParseTileLayers = __webpack_require__(557); +var ParseTilesets = __webpack_require__(558); /** * Parses a Weltmeister JSON object into a new MapData object. @@ -111923,7 +119198,7 @@ module.exports = ParseWeltmeister; /***/ }), -/* 520 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -111932,8 +119207,8 @@ module.exports = ParseWeltmeister; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LayerData = __webpack_require__(105); -var Tile = __webpack_require__(75); +var LayerData = __webpack_require__(117); +var Tile = __webpack_require__(81); /** * Parses all tilemap layers in an Impact JSON object into new LayerData objects. @@ -112009,7 +119284,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 521 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112018,7 +119293,7 @@ module.exports = ParseTileLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(107); +var Tileset = __webpack_require__(119); /** * Tilesets and Image Collections @@ -112060,7 +119335,7 @@ module.exports = ParseTilesets; /***/ }), -/* 522 */ +/* 559 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112070,17 +119345,17 @@ module.exports = ParseTilesets; */ var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var DynamicTilemapLayer = __webpack_require__(523); -var Extend = __webpack_require__(19); -var Formats = __webpack_require__(33); -var LayerData = __webpack_require__(105); -var Rotate = __webpack_require__(344); -var SpliceOne = __webpack_require__(82); -var StaticTilemapLayer = __webpack_require__(524); -var Tile = __webpack_require__(75); -var TilemapComponents = __webpack_require__(149); -var Tileset = __webpack_require__(107); +var DegToRad = __webpack_require__(34); +var Formats = __webpack_require__(38); +var GetFastValue = __webpack_require__(2); +var LayerData = __webpack_require__(117); +var Rotate = __webpack_require__(354); +var SpliceOne = __webpack_require__(103); +var Sprite = __webpack_require__(70); +var Tile = __webpack_require__(81); +var TilemapComponents = __webpack_require__(243); +var TilemapLayer = __webpack_require__(560); +var Tileset = __webpack_require__(119); /** * @callback TilemapFilterCallback @@ -112106,25 +119381,39 @@ var Tileset = __webpack_require__(107); * @classdesc * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or - * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display - * objects that actually render tiles. + * more tilemap layers, which are the display objects that actually render the tiles. * - * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free + * The Tilemap data can be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free * software package specifically for creating tile maps, and is available from: * http://www.mapeditor.org * - * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only - * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer. + * As of Phaser 3.50.0 the Tilemap API now supports the following types of map: + * + * 1) Orthogonal + * 2) Isometric + * 3) Hexagonal + * 4) Staggered + * + * Prior to this release, only orthogonal maps were supported. + * + * Another large change in 3.50 was the consolidation of Tilemap Layers. Previously, you created + * either a Static or Dynamic Tilemap Layer. However, as of 3.50 the features of both have been + * merged and the API simplified, so now there is just the single `TilemapLayer` class. + * + * A Tilemap has handy methods for getting and manipulating the tiles within a layer, allowing + * you to build or modify the tilemap data at runtime. * * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a - * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides - * it. + * TilemapLayer may have its own unique tile size that overrides this. * * As of Phaser 3.21.0, if your tilemap includes layer groups (a feature of Tiled 1.2.0+) these - * will be traversed and the following properties will affect children: - * - opacity (blended with parent) and visibility (parent overrides child) + * will be traversed and the following properties will impact children: + * + * - Opacity (blended with parent) and visibility (parent overrides child) * - Vertical and horizontal offset + * * The grouping hierarchy is not preserved and all layers will be flattened into a single array. + * * Group layers are parsed during Tilemap construction but are discarded after parsing so dynamic * layers will NOT continue to be affected by a parent. * @@ -112159,7 +119448,7 @@ var Tilemap = new Class({ * width. * * @name Phaser.Tilemaps.Tilemap#tileWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.tileWidth = mapData.tileWidth; @@ -112169,7 +119458,7 @@ var Tilemap = new Class({ * tile height. * * @name Phaser.Tilemaps.Tilemap#tileHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.tileHeight = mapData.tileHeight; @@ -112265,6 +119554,7 @@ var Tilemap = new Class({ this.heightInPixels = mapData.heightInPixels; /** + * A collection of Images, as parsed from Tiled map data. * * @name Phaser.Tilemaps.Tilemap#imageCollections * @type {Phaser.Tilemaps.ImageCollection[]} @@ -112312,10 +119602,70 @@ var Tilemap = new Class({ * The index of the currently selected LayerData object. * * @name Phaser.Tilemaps.Tilemap#currentLayerIndex - * @type {integer} + * @type {number} * @since 3.0.0 */ this.currentLayerIndex = 0; + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.Tilemap#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = mapData.hexSideLength; + + var orientation = this.orientation; + + /** + * Functions used to handle world to tile, and tile to world, conversion. + * Cached here for internal use by public methods such as `worldToTileXY`, etc. + * + * @name Phaser.Tilemaps.Tilemap#_convert + * @private + * @type {object} + * @since 3.50.0 + */ + this._convert = { + WorldToTileXY: TilemapComponents.GetWorldToTileXYFunction(orientation), + WorldToTileX: TilemapComponents.GetWorldToTileXFunction(orientation), + WorldToTileY: TilemapComponents.GetWorldToTileYFunction(orientation), + TileToWorldXY: TilemapComponents.GetTileToWorldXYFunction(orientation), + TileToWorldX: TilemapComponents.GetTileToWorldXFunction(orientation), + TileToWorldY: TilemapComponents.GetTileToWorldYFunction(orientation) + }; + }, + + /** + * @ignore + */ + createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) + { + console.warn('createBlankDynamicLayer is deprecated. Use createBlankLayer'); + + return this.createBlankLayer(name, tileset, x, y, width, height, tileWidth, tileHeight); + }, + + /** + * @ignore + */ + createDynamicLayer: function (layerID, tileset, x, y) + { + console.warn('createDynamicLayer is deprecated. Use createLayer'); + + return this.createLayer(layerID, tileset, x, y); + }, + + /** + * @ignore + */ + createStaticLayer: function (layerID, tileset, x, y) + { + console.warn('createStaticLayer is deprecated. Use createLayer'); + + return this.createLayer(layerID, tileset, x, y); }, /** @@ -112336,14 +119686,14 @@ var Tilemap = new Class({ * * You can provide either an integer (0 to 3), or the string version of the order. * - * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically + * Calling this method _after_ creating Tilemap Layers will **not** automatically * update them to use the new render order. If you call this method after creating layers, use their * own `setRenderOrder` methods to change them as needed. * * @method Phaser.Tilemaps.Tilemap#setRenderOrder * @since 3.12.0 * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @param {(number|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. * * @return {this} This Tilemap object. */ @@ -112375,17 +119725,17 @@ var Tilemap = new Class({ * @param {string} tilesetName - The name of the tileset as specified in the map data. * @param {string} [key] - The key of the Phaser.Cache image used for this tileset. If * `undefined` or `null` it will look for an image with a key matching the tilesetName parameter. - * @param {integer} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not + * @param {number} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not * given it will default to the map's tileWidth value, or the tileWidth specified in the Tiled * JSON file. - * @param {integer} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If + * @param {number} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If * not given it will default to the map's tileHeight value, or the tileHeight specified in the * Tiled JSON file. - * @param {integer} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not + * @param {number} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not * specified, it will default to 0 or the value specified in the Tiled JSON file. - * @param {integer} [tileSpacing] - The spacing between each the tile in the sheet (in pixels). + * @param {number} [tileSpacing] - The spacing between each the tile in the sheet (in pixels). * If not specified, it will default to 0 or the value specified in the Tiled JSON file. - * @param {integer} [gid=0] - If adding multiple tilesets to a blank map, specify the starting + * @param {number} [gid=0] - If adding multiple tilesets to a blank map, specify the starting * GID this set will use here. * * @return {?Phaser.Tilemaps.Tileset} Returns the Tileset object that was created or updated, or null if it @@ -112438,51 +119788,6 @@ var Tilemap = new Class({ return tileset; }, - /** - * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If - * no layer specified, the map's current layer is used. This is useful if you want to manipulate - * a map at the start of a scene, but then make it non-manipulable and optimize it for speed. - * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value - * returned from this method if you want to manipulate the new StaticTilemapLayer. - * - * @method Phaser.Tilemaps.Tilemap#convertLayerToStatic - * @since 3.0.0 - * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer)} [layer] - The name of the layer from Tiled, the - * index of the layer in the map, or a DynamicTilemapLayer. - * - * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer that was created, or null if it - * failed. - */ - convertLayerToStatic: function (layer) - { - layer = this.getLayer(layer); - - if (layer === null) { return null; } - - var dynamicLayer = layer.tilemapLayer; - - if (!dynamicLayer || !(dynamicLayer instanceof DynamicTilemapLayer)) - { - return null; - } - - var staticLayer = new StaticTilemapLayer( - dynamicLayer.scene, - dynamicLayer.tilemap, - dynamicLayer.layerIndex, - dynamicLayer.tileset, - dynamicLayer.x, - dynamicLayer.y - ); - - this.scene.sys.displayList.add(staticLayer); - - dynamicLayer.destroy(); - - return staticLayer; - }, - /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile * coordinates) within the layer. This copies all tile properties & recalculates collision @@ -112493,14 +119798,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#copy * @since 3.0.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -112508,8 +119813,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'copy')) { return this; } - if (layer !== null) { TilemapComponents.Copy( @@ -112528,23 +119831,25 @@ var Tilemap = new Class({ }, /** - * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. + * Creates a new and empty Tilemap Layer. The currently selected layer in the map is set to this new layer. * - * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer + * Prior to v3.50.0 this method was called `createBlankDynamicLayer`. + * + * @method Phaser.Tilemaps.Tilemap#createBlankLayer * @since 3.0.0 * * @param {string} name - The name of this layer. Must be unique within the map. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. - * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. - * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. - * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + * @param {number} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. + * @param {number} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. + * @param {number} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param {number} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. * - * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer that was created, or `null` if it failed. + * @return {?Phaser.Tilemaps.TilemapLayer} Returns the new layer that was created, or `null` if it failed. */ - createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) + createBlankLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) { if (x === undefined) { x = 0; } if (y === undefined) { y = 0; } @@ -112566,7 +119871,8 @@ var Tilemap = new Class({ tileWidth: tileWidth, tileHeight: tileHeight, width: width, - height: height + height: height, + orientation: this.orientation }); var row; @@ -112587,37 +119893,36 @@ var Tilemap = new Class({ this.currentLayerIndex = this.layers.length - 1; - var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); + var layer = new TilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); - dynamicLayer.setRenderOrder(this.renderOrder); + layer.setRenderOrder(this.renderOrder); - this.scene.sys.displayList.add(dynamicLayer); + this.scene.sys.displayList.add(layer); - return dynamicLayer; + return layer; }, /** - * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given + * Creates a new Tilemap Layer that renders the LayerData associated with the given * `layerID`. The currently selected layer in the map is set to this new layer. * * The `layerID` is important. If you've created your map in Tiled then you can get this by * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and * look at the layers[].name value. Either way it must match. * - * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more - * information. + * Prior to v3.50.0 this method was called `createDynamicLayer`. * - * @method Phaser.Tilemaps.Tilemap#createDynamicLayer + * @method Phaser.Tilemaps.Tilemap#createLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(number|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * - * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. + * @return {?Phaser.Tilemaps.TilemapLayer} Returns the new layer was created, or null if it failed. */ - createDynamicLayer: function (layerID, tileset, x, y) + createLayer: function (layerID, tileset, x, y) { var index = this.getLayerIndex(layerID); @@ -112656,7 +119961,7 @@ var Tilemap = new Class({ y = layerData.y; } - var layer = new DynamicTilemapLayer(this.scene, this, index, tileset, x, y); + var layer = new TilemapLayer(this.scene, this, index, tileset, x, y); layer.setRenderOrder(this.renderOrder); @@ -112666,87 +119971,188 @@ var Tilemap = new Class({ }, /** - * Creates a Sprite for every object matching the given gid in the map data. All properties from - * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy - * way to configure Sprite properties from within the map editor. For example giving an object a - * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created. + * This method will iterate through all of the objects defined in a Tiled Object Layer and then + * convert the matching results into Phaser Game Objects (by default, Sprites) * - * Custom object properties not sharing names with the Sprite's own properties are copied to the - * Sprite's {@link Phaser.GameObjects.Sprite#data data store}. + * Objects are matched on one of 3 criteria: The Object ID, the Object GID or the Object Name. + * + * Within Tiled, Object IDs are unique per Object. Object GIDs, however, are shared by all objects + * using the same image. Finally, Object Names are strings and the same name can be used on multiple + * Objects in Tiled, they do not have to be unique. + * + * You set the configuration parameter accordingly, based on which type of criteria you wish + * to match against. For example, to convert all items on an Object Layer with a `gid` of 26: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26 + * }); + * ``` + * + * Or, to convert objects with the name 'bonus': + * + * ```javascript + * createFromObjects(layerName, { + * name: 'bonus' + * }); + * ``` + * + * Or, to convert an object with a specific id: + * + * ```javascript + * createFromObjects(layerName, { + * id: 9 + * }); + * ``` + * + * You should only specify either `id`, `gid`, `name`, or none of them. Do not add more than + * one criteria to your config. If you do not specify any criteria, then _all_ objects in the + * Object Layer will be converted. + * + * By default this method will convert objects into `Sprite` instances, but you can override + * this by providing your own class type: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26, + * classType: Coin + * }); + * ``` + * + * This will convert all Objects with a gid of 26 into your custom `Coin` class. You can pass + * any class type here, but it _must_ extend `Phaser.GameObjects.GameObject` as its base class. + * Your class will always be passed 1 parameter: `scene`, which is a reference to either the Scene + * specified in the config object or, if not given, the Scene to which this Tilemap belongs. + * + * All properties from object are copied into the Game Object, so you can use this as an easy + * way to configure properties from within the map editor. For example giving an object a + * property of `alpha: 0.5` in Tiled will be reflected in the Game Object that is created. + * + * Custom object properties that do not exist as a Game Object property are set in the + * Game Objects {@link Phaser.GameObjects.GameObject#data data store}. + * + * You can use set a `container` property in the config. If given, the class will be added to + * the Container instance instead of the Scene. + * + * Finally, you can provide an array of config objects, to convert multiple types of object in + * a single call: + * + * ```javascript + * createFromObjects(layerName, [ + * { + * gid: 26, + * classType: Coin + * }, + * { + * id: 9, + * classType: BossMonster + * }, + * { + * name: 'lava', + * classType: LavaTile + * } + * ]); + * ``` + * + * The signature of this method changed significantly in v3.50.0. Prior to this, it did not take config objects. * * @method Phaser.Tilemaps.Tilemap#createFromObjects * @since 3.0.0 * - * @param {string} name - The name of the object layer (from Tiled) to create Sprites from. - * @param {(integer|string)} id - Either the id (object), gid (tile object) or name (object or - * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects - * with the same graphic. The same name can be used on multiple objects. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param {Phaser.Scene} [scene=the scene the map is within] - The Scene to create the Sprites within. + * @param {string} objectLayerName - The name of the Tiled object layer to create the Game Objects from. + * @param {Phaser.Types.Tilemaps.CreateFromObjectLayerConfig|Phaser.Types.Tilemaps.CreateFromObjectLayerConfig[]} config - A CreateFromObjects configuration object, or an array of them. * - * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. + * @return {Phaser.GameObjects.GameObject[]} An array containing the Game Objects that were created. Empty if invalid object layer, or no matching id/gid/name was found. */ - createFromObjects: function (name, id, spriteConfig, scene) + createFromObjects: function (objectLayerName, config) { - if (spriteConfig === undefined) { spriteConfig = {}; } - if (scene === undefined) { scene = this.scene; } + var results = []; - var objectLayer = this.getObjectLayer(name); + var objectLayer = this.getObjectLayer(objectLayerName); if (!objectLayer) { - console.warn('Cannot create from object. Invalid objectgroup name given: ' + name); + console.warn('createFromObjects: Invalid objectLayerName given: ' + objectLayerName); - if (typeof layerID === 'string') - { - console.warn('Valid objectgroup names:\n\t' + this.getObjectLayerNames().join(',\n\t')); - } + return results; + } - return null; + if (!Array.isArray(config)) + { + config = [ config ]; } var objects = objectLayer.objects; - var sprites = []; - for (var i = 0; i < objects.length; i++) + for (var c = 0; c < config.length; c++) { - var found = false; - var obj = objects[i]; + var singleConfig = config[c]; - if (obj.gid !== undefined && typeof id === 'number' && obj.gid === id || - obj.id !== undefined && typeof id === 'number' && obj.id === id || - obj.name !== undefined && typeof id === 'string' && obj.name === id) + var id = GetFastValue(singleConfig, 'id', null); + var gid = GetFastValue(singleConfig, 'gid', null); + var name = GetFastValue(singleConfig, 'name', null); + + var obj; + var toConvert = []; + + // Sweep to get all the objects we want to convert in this pass + for (var s = 0; s < objects.length; s++) { - found = true; + obj = objects[s]; + + if ( + (id === null && gid === null && name === null) || + (id !== null && obj.id === id) || + (gid !== null && obj.gid === gid) || + (name !== null && obj.name === name) + ) + { + toConvert.push(obj); + } } - if (found) + // Now let's convert them ... + + var classType = GetFastValue(singleConfig, 'classType', Sprite); + var scene = GetFastValue(singleConfig, 'scene', this.scene); + var container = GetFastValue(singleConfig, 'container', null); + var texture = GetFastValue(singleConfig, 'key', null); + var frame = GetFastValue(singleConfig, 'frame', null); + + for (var i = 0; i < toConvert.length; i++) { - var config = Extend({}, spriteConfig, obj.properties); + obj = toConvert[i]; - config.x = obj.x; - config.y = obj.y; + var sprite = new classType(scene); - var sprite = scene.make.sprite(config); + sprite.setName(obj.name); + sprite.setPosition(obj.x, obj.y); + sprite.setTexture(texture, frame); - sprite.name = obj.name; + if (obj.width) + { + sprite.displayWidth = obj.width; + } - if (obj.width) { sprite.displayWidth = obj.width; } - if (obj.height) { sprite.displayHeight = obj.height; } + if (obj.height) + { + sprite.displayHeight = obj.height; + } - // Origin is (0, 1) in Tiled, so find the offset that matches the Sprite's origin. - // Do not offset objects with zero dimensions (e.g. points). + // Origin is (0, 1) in Tiled, so find the offset that matches the Sprites origin. + // Do not offset objects with zero dimensions (e.g. points). var offset = { x: sprite.originX * obj.width, y: (sprite.originY - 1) * obj.height }; - // If the object is rotated, then the origin offset also needs to be rotated. + // If the object is rotated, then the origin offset also needs to be rotated. if (obj.rotation) { var angle = DegToRad(obj.rotation); + Rotate(offset, angle); + sprite.rotation = angle; } @@ -112758,23 +120164,38 @@ var Tilemap = new Class({ sprite.setFlip(obj.flippedHorizontal, obj.flippedVertical); } - if (!obj.visible) { sprite.visible = false; } - - for (var key in obj.properties) + if (!obj.visible) { - if (sprite.hasOwnProperty(key)) - { - continue; - } - - sprite.setData(key, obj.properties[key]); + sprite.visible = false; } - sprites.push(sprite); + // Set properties the class may have, or setData those it doesn't + for (var key in obj.properties) + { + if (sprite[key] !== undefined) + { + sprite[key] = obj.properties[key]; + } + else + { + sprite.setData(key, obj.properties[key]); + } + } + + if (container) + { + container.add(sprite); + } + else + { + scene.add.existing(sprite); + } + + results.push(sprite); } } - return sprites; + return results; }, /** @@ -112786,14 +120207,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createFromTiles * @since 3.0.0 * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * @param {(number|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(number|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Scene} [scene] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -112806,80 +120227,6 @@ var Tilemap = new Class({ return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, layer); }, - /** - * Creates a new StaticTilemapLayer that renders the LayerData associated with the given - * `layerID`. The currently selected layer in the map is set to this new layer. - * - * The `layerID` is important. If you've created your map in Tiled then you can get this by - * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and - * look at the layers[].name value. Either way it must match. - * - * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for - * more information. - * - * @method Phaser.Tilemaps.Tilemap#createStaticLayer - * @since 3.0.0 - * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. - * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. - * - * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed. - */ - createStaticLayer: function (layerID, tileset, x, y) - { - var index = this.getLayerIndex(layerID); - - if (index === null) - { - console.warn('Invalid Tilemap Layer ID: ' + layerID); - if (typeof layerID === 'string') - { - console.warn('Valid tilelayer names:\n\t' + this.getTileLayerNames().join(',\n\t')); - } - return null; - } - - var layerData = this.layers[index]; - - // Check for an associated static or dynamic tilemap layer - if (layerData.tilemapLayer) - { - console.warn('Tilemap Layer ID already exists:' + layerID); - return null; - } - - this.currentLayerIndex = index; - - // Default the x/y position to match Tiled layer offset, if it exists. - if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } - if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } - - var layer = new StaticTilemapLayer(this.scene, this, index, tileset, x, y); - - layer.setRenderOrder(this.renderOrder); - - this.scene.sys.displayList.add(layer); - - return layer; - }, - - /** - * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any - * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData. - * - * @method Phaser.Tilemaps.Tilemap#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAllLayers(); - this.tilesets.length = 0; - this.objects.length = 0; - this.scene = undefined; - }, - /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the * specified index. Tiles will be set to collide if the given index is a colliding index. @@ -112891,24 +120238,24 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#fill * @since 3.0.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ fill: function (index, tileX, tileY, width, height, recalculateFaces, layer) { + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } - if (this._isStaticCall(layer, 'fill')) { return this; } - TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, layer); return this; @@ -112926,7 +120273,7 @@ var Tilemap = new Class({ * @param {TilemapFilterCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. * - * @return {?Phaser.GameObjects.GameObject[]} An array of object that match the search, or null if the objectLayer given was invalid. + * @return {?Phaser.Types.Tilemaps.TiledObject[]} An array of object that match the search, or null if the objectLayer given was invalid. */ filterObjects: function (objectLayer, callback, context) { @@ -112959,12 +120306,12 @@ var Tilemap = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -112988,10 +120335,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#findByIndex * @since 3.0.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. + * @param {number} index - The tile index value to search for. + * @param {number} [skip=0] - The number of times to skip a matching tile before returning. * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -113016,7 +120363,7 @@ var Tilemap = new Class({ * @param {TilemapFindCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. * - * @return {?Phaser.GameObjects.GameObject} An object that matches the search, or null if no object found. + * @return {?Phaser.Types.Tilemaps.TiledObject} An object that matches the search, or null if no object found. */ findObject: function (objectLayer, callback, context) { @@ -113047,12 +120394,12 @@ var Tilemap = new Class({ * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -113076,12 +120423,12 @@ var Tilemap = new Class({ * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -113104,7 +120451,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the image to get. * - * @return {integer} The index of the image in this tilemap, or null if not found. + * @return {number} The index of the image in this tilemap, or null if not found. */ getImageIndex: function (name) { @@ -113158,15 +120505,12 @@ var Tilemap = new Class({ }, /** - * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid - * `layer` is given. + * Gets the LayerData from `this.layers` that is associated with the given `layer`, or null if the layer is invalid. * * @method Phaser.Tilemaps.Tilemap#getLayer * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the maps current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or Tilemap Layer. If not given will default to the maps current layer index. * * @return {Phaser.Tilemaps.LayerData} The corresponding LayerData within this.layers. */ @@ -113178,15 +120522,14 @@ var Tilemap = new Class({ }, /** - * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer - * is found with that name. + * Gets the ObjectLayer from `this.objects` that has the given `name`, or null if no ObjectLayer is found with that name. * * @method Phaser.Tilemaps.Tilemap#getObjectLayer * @since 3.0.0 * * @param {string} [name] - The name of the object layer from Tiled. * - * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding ObjectLayer within this.objects or null. + * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding `ObjectLayer` within `this.objects`, or null. */ getObjectLayer: function (name) { @@ -113223,11 +120566,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getLayerIndex * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a Tilemap Layer. If not given will default to the map's current layer index. * - * @return {integer} The LayerData index within this.layers. + * @return {number} The LayerData index within this.layers. */ getLayerIndex: function (layer) { @@ -113243,7 +120584,7 @@ var Tilemap = new Class({ { return layer; } - else if (layer instanceof StaticTilemapLayer || layer instanceof DynamicTilemapLayer) + else if (layer instanceof TilemapLayer) { return layer.layerIndex; } @@ -113262,7 +120603,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the layer to get. * - * @return {integer} The LayerData index within this.layers. + * @return {number} The LayerData index within this.layers. */ getLayerIndexByName: function (name) { @@ -113271,15 +120612,16 @@ var Tilemap = new Class({ /** * Gets a tile at the given tile coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -113294,16 +120636,17 @@ var Tilemap = new Class({ /** * Gets a tile at the given world coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [nonNull] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -113339,17 +120682,18 @@ var Tilemap = new Class({ /** * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -113365,15 +120709,16 @@ var Tilemap = new Class({ /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, * Line, Rectangle or Triangle. The shape should be in world coordinates. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithinShape * @since 3.0.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -113388,7 +120733,8 @@ var Tilemap = new Class({ /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY * @since 3.0.0 @@ -113398,8 +120744,8 @@ var Tilemap = new Class({ * @param {number} width - The width of the area. * @param {number} height - The height of the area. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -113438,7 +120784,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the Tileset to get. * - * @return {integer} The Tileset index within this.tilesets. + * @return {number} The Tileset index within this.tilesets. */ getTilesetIndex: function (name) { @@ -113449,14 +120795,14 @@ var Tilemap = new Class({ * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -113473,15 +120819,15 @@ var Tilemap = new Class({ * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -113520,26 +120866,24 @@ var Tilemap = new Class({ * location. If you pass in an index, only the index at the specified location will be changed. * Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. - * - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTileAt * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds. */ putTileAt: function (tile, tileX, tileY, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTileAt')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -113552,26 +120896,25 @@ var Tilemap = new Class({ * specified location. If you pass in an index, only the index at the specified location will be * changed. Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. This - * cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTileAtWorldXY * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTileAtWorldXY')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -113585,25 +120928,24 @@ var Tilemap = new Class({ * index at the specified location will be changed. Collision information will be recalculated * within the region tiles were changed. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTilesAt')) { return this; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -113619,18 +120961,17 @@ var Tilemap = new Class({ * indexes found within the region (excluding -1) will be used for randomly assigning new tile * indexes. This method only modifies tile indexes and does not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -113638,8 +120979,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'randomize')) { return this; } - if (layer === null) { return null; } TilemapComponents.Randomize(tileX, tileY, width, height, indexes, layer); @@ -113652,14 +120991,14 @@ var Tilemap = new Class({ * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#calculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -113679,16 +121018,16 @@ var Tilemap = new Class({ * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -113706,12 +121045,12 @@ var Tilemap = new Class({ /** * Removes the given TilemapLayer from this Tilemap without destroying it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeLayer * @since 3.17.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be removed. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to be removed. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -113722,6 +121061,7 @@ var Tilemap = new Class({ if (index !== null) { SpliceOne(this.layers, index); + for (var i = index; i < this.layers.length; i++) { if (this.layers[i].tilemapLayer) @@ -113746,12 +121086,12 @@ var Tilemap = new Class({ /** * Destroys the given TilemapLayer and removes it from this Tilemap. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#destroyLayer * @since 3.17.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be destroyed. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to be destroyed. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -113781,19 +121121,17 @@ var Tilemap = new Class({ }, /** - * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or - * DynamicTilemapLayers. + * Removes all Tilemap Layers from this Tilemap and calls `destroy` on each of them. * * @method Phaser.Tilemaps.Tilemap#removeAllLayers * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ removeAllLayers: function () { var layers = this.layers; - // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData for (var i = 0; i < layers.length; i++) { if (layers[i].tilemapLayer) @@ -113813,13 +121151,11 @@ var Tilemap = new Class({ * Removes the given Tile, or an array of Tiles, from the layer to which they belong, * and optionally recalculates the collision information. * - * This cannot be applied to Tiles that belong to Static Tilemap Layers. - * * @method Phaser.Tilemaps.Tilemap#removeTile * @since 3.17.0 * * @param {(Phaser.Tilemaps.Tile|Phaser.Tilemaps.Tile[])} tiles - The Tile to remove, or an array of Tiles. - * @param {integer} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. + * @param {number} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile[]} Returns an array of Tiles that were removed. @@ -113852,28 +121188,27 @@ var Tilemap = new Class({ }, /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given tile coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull] - If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces] - If `true` (the default), the faces data will be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns the Tile that was removed, or null if the layer given was invalid. */ removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (replaceWithNull === undefined) { replaceWithNull = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'removeTileAt')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -113881,29 +121216,28 @@ var Tilemap = new Class({ }, /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given world coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [replaceWithNull] - If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces] - If `true` (the default), the faces data will be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) { - layer = this.getLayer(layer); + if (replaceWithNull === undefined) { replaceWithNull = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'removeTileAtWorldXY')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -113911,19 +121245,19 @@ var Tilemap = new Class({ }, /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * Draws a debug representation of the layer to the given Graphics object. This is helpful when you want to * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation * wherever you want on the screen. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#renderDebug * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -113949,15 +121283,14 @@ var Tilemap = new Class({ * @since 3.17.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. * - * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + * @return {this} This Tilemap instance. */ renderDebugFull: function (graphics, styleConfig) { var layers = this.layers; - // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData for (var i = 0; i < layers.length; i++) { TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]); @@ -113971,19 +121304,18 @@ var Tilemap = new Class({ * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does * not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -113991,8 +121323,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'replaceByIndex')) { return this; } - if (layer === null) { return null; } TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, layer); @@ -114005,21 +121335,25 @@ var Tilemap = new Class({ * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if * collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollision * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollision: function (indexes, collides, recalculateFaces, layer, updateLayer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (updateLayer === undefined) { updateLayer = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -114035,21 +121369,24 @@ var Tilemap = new Class({ * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be * enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionBetween * @since 3.0.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionBetween: function (start, stop, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -114068,20 +121405,23 @@ var Tilemap = new Class({ * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a * "types" property that matches any of those values, its collision flag will be updated. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty * @since 3.0.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionByProperty: function (properties, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -114096,20 +121436,23 @@ var Tilemap = new Class({ * the given array. The `collides` parameter controls if collision will be enabled (true) or * disabled (false). Tile indexes not currently in the layer are not affected. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionByExclusion * @since 3.0.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionByExclusion: function (indexes, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -114120,24 +121463,27 @@ var Tilemap = new Class({ }, /** - * Sets collision on the tiles within a layer by checking each tile's collision group data + * Sets collision on the tiles within a layer by checking each tiles collision group data * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * a tiles collision group, the tiles colliding information will be set. The `collides` parameter * controls if collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionFromCollisionGroup: function (collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -114151,17 +121497,17 @@ var Tilemap = new Class({ * Sets a global collision callback for the given tile index within the layer. This will affect all * tiles on this layer that have the same index. If a callback is already set for the tile index it * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. + * at a specific location on the map then see `setTileLocationCallback`. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|number[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. All values should be integers. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -114181,18 +121527,18 @@ var Tilemap = new Class({ * If a callback is already set for the tile index it will be replaced. Set the callback to null to * remove it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -114213,11 +121559,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setLayer * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setLayer: function (layer) { @@ -114238,10 +121582,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setBaseTileSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tiles the map uses for calculations. - * @param {integer} tileHeight - The height of the tiles the map uses for calculations. + * @param {number} tileWidth - The width of the tiles the map uses for calculations. + * @param {number} tileHeight - The height of the tiles the map uses for calculations. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setBaseTileSize: function (tileWidth, tileHeight) { @@ -114250,7 +121594,7 @@ var Tilemap = new Class({ this.widthInPixels = this.width * tileWidth; this.heightInPixels = this.height * tileHeight; - // Update the base tile size on all layers & tiles + // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { this.layers[i].baseTileWidth = tileWidth; @@ -114278,20 +121622,18 @@ var Tilemap = new Class({ }, /** - * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's + * Sets the tile size for a specific `layer`. Note: this does not necessarily match the maps * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any * tiles the layer has. * * @method Phaser.Tilemaps.Tilemap#setLayerTileSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tiles (in pixels) in the layer. - * @param {integer} tileHeight - The height of the tiles (in pixels) in the layer. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {number} tileWidth - The width of the tiles (in pixels) in the layer. + * @param {number} tileHeight - The height of the tiles (in pixels) in the layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setLayerTileSize: function (tileWidth, tileHeight, layer) { @@ -114328,17 +121670,16 @@ var Tilemap = new Class({ * appear to have changed! This method only modifies tile indexes and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -114346,8 +121687,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'shuffle')) { return this; } - if (layer === null) { return null; } TilemapComponents.Shuffle(tileX, tileY, width, height, layer); @@ -114360,19 +121699,18 @@ var Tilemap = new Class({ * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#swapByIndex * @since 3.0.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -114380,8 +121718,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'swapByIndex')) { return this; } - if (layer === null) { return null; } TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, layer); @@ -114393,14 +121729,14 @@ var Tilemap = new Class({ * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -114410,22 +121746,21 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.TileToWorldX(tileX, camera, layer); + return this._convert.TileToWorldX(tileX, camera, layer); }, /** * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer - * to use. If not given the current layer is used. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -114435,7 +121770,7 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.TileToWorldY(tileX, camera, layer); + return this._convert.TileToWorldY(tileX, camera, layer); }, /** @@ -114443,26 +121778,26 @@ var Tilemap = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + * @return {?Phaser.Math.Vector2} Returns a Vector2, or null if the layer given was invalid. */ - tileToWorldXY: function (tileX, tileY, point, camera, layer) + tileToWorldXY: function (tileX, tileY, vec2, camera, layer) { layer = this.getLayer(layer); if (layer === null) { return null; } - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, layer); + return this._convert.TileToWorldXY(tileX, tileY, vec2, camera, layer); }, /** @@ -114477,32 +121812,27 @@ var Tilemap = new Class({ * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 * ] * - * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * The probability of any index being picked is (the indexs weight) / (sum of all weights). This * method only modifies tile indexes and does not change collision information. * - * If no layer specified, the map's current layer is used. This - * cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ - weightedRandomize: function (tileX, tileY, width, height, weightedIndexes, layer) + weightedRandomize: function (weightedIndexes, tileX, tileY, width, height, layer) { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'weightedRandomize')) { return this; } - if (layer === null) { return null; } TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, layer); @@ -114514,16 +121844,15 @@ var Tilemap = new Class({ * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileX * @since 3.0.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer - * to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -114533,22 +121862,22 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, layer); + return this._convert.WorldToTileX(worldX, snapToFloor, camera, layer); }, /** * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileY * @since 3.0.0 * * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -114558,7 +121887,7 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, layer); + return this._convert.WorldToTileY(worldY, snapToFloor, camera, layer); }, /** @@ -114566,49 +121895,44 @@ var Tilemap = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileXY * @since 3.0.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + * @return {?Phaser.Math.Vector2} Returns a vec2, or null if the layer given was invalid. */ - worldToTileXY: function (worldX, worldY, snapToFloor, point, camera, layer) + worldToTileXY: function (worldX, worldY, snapToFloor, vec2, camera, layer) { layer = this.getLayer(layer); if (layer === null) { return null; } - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, layer); + return this._convert.WorldToTileXY(worldX, worldY, snapToFloor, vec2, camera, layer); }, /** - * Used internally to check if a layer is static and prints out a warning. + * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any + * TilemapLayers that have been created. * - * @method Phaser.Tilemaps.Tilemap#_isStaticCall - * @private + * @method Phaser.Tilemaps.Tilemap#destroy * @since 3.0.0 - * - * @return {boolean} */ - _isStaticCall: function (layer, functionName) + destroy: function () { - if (layer.tilemapLayer instanceof StaticTilemapLayer) - { - console.warn(functionName + ': You cannot change the tiles in a static tilemap layer'); - return true; - } - else - { - return false; - } + this.removeAllLayers(); + + this.tilesets.length = 0; + this.objects.length = 0; + + this.scene = null; } }); @@ -114617,7 +121941,7 @@ module.exports = Tilemap; /***/ }), -/* 523 */ +/* 560 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114628,26 +121952,20 @@ module.exports = Tilemap; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DynamicTilemapLayerRender = __webpack_require__(1358); var GameObject = __webpack_require__(14); -var TilemapComponents = __webpack_require__(149); +var TilemapComponents = __webpack_require__(243); +var TilemapLayerRender = __webpack_require__(1428); /** * @classdesc - * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * A Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination * with one, or more, Tilesets. * - * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a - * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the - * tiles in a DynamicTilemapLayer. - * - * Use this over a Static Tilemap Layer when you need those features. - * - * @class DynamicTilemapLayer + * @class TilemapLayer * @extends Phaser.GameObjects.GameObject * @memberof Phaser.Tilemaps * @constructor - * @since 3.0.0 + * @since 3.50.0 * * @extends Phaser.GameObjects.Components.Alpha * @extends Phaser.GameObjects.Components.BlendMode @@ -114663,12 +121981,12 @@ var TilemapComponents = __webpack_require__(149); * * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. - * @param {integer} layerIndex - The index of the LayerData associated with this layer. + * @param {number} layerIndex - The index of the LayerData associated with this layer. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ -var DynamicTilemapLayer = new Class({ +var TilemapLayer = new Class({ Extends: GameObject, @@ -114684,40 +122002,40 @@ var DynamicTilemapLayer = new Class({ Components.Transform, Components.Visible, Components.ScrollFactor, - DynamicTilemapLayerRender + TilemapLayerRender ], initialize: - function DynamicTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) + function TilemapLayer (scene, tilemap, layerIndex, tileset, x, y) { - GameObject.call(this, scene, 'DynamicTilemapLayer'); + GameObject.call(this, scene, 'TilemapLayer'); /** * Used internally by physics system to perform fast type checks. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#isTilemap + * @name Phaser.Tilemaps.TilemapLayer#isTilemap * @type {boolean} * @readonly - * @since 3.0.0 + * @since 3.50.0 */ this.isTilemap = true; /** * The Tilemap that this layer is a part of. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilemap + * @name Phaser.Tilemaps.TilemapLayer#tilemap * @type {Phaser.Tilemaps.Tilemap} - * @since 3.0.0 + * @since 3.50.0 */ this.tilemap = tilemap; /** * The index of the LayerData associated with this layer. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#layerIndex - * @type {integer} - * @since 3.0.0 + * @name Phaser.Tilemaps.TilemapLayer#layerIndex + * @type {number} + * @since 3.50.0 */ this.layerIndex = layerIndex; @@ -114725,9 +122043,9 @@ var DynamicTilemapLayer = new Class({ * The LayerData associated with this layer. LayerData can only be associated with one * tilemap layer. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#layer + * @name Phaser.Tilemaps.TilemapLayer#layer * @type {Phaser.Tilemaps.LayerData} - * @since 3.0.0 + * @since 3.50.0 */ this.layer = tilemap.layers[layerIndex]; @@ -114735,68 +122053,66 @@ var DynamicTilemapLayer = new Class({ this.layer.tilemapLayer = this; /** - * The Tileset/s associated with this layer. + * An array of `Tileset` objects associated with this layer. * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset + * @name Phaser.Tilemaps.TilemapLayer#tileset * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.0.0 + * @since 3.50.0 */ this.tileset = []; - /** - * Used internally with the canvas render. This holds the tiles that are visible within the - * camera. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#culledTiles - * @type {array} - * @since 3.0.0 - */ - this.culledTiles = []; - - /** - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#skipCull - * @type {boolean} - * @since 3.11.0 - */ - this.skipCull = false; - /** * The total number of tiles drawn by the renderer in the last frame. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesDrawn - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#tilesDrawn + * @type {number} * @readonly - * @since 3.11.0 + * @since 3.50.0 */ this.tilesDrawn = 0; /** * The total number of tiles in this layer. Updated every frame. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesTotal - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#tilesTotal + * @type {number} * @readonly - * @since 3.11.0 + * @since 3.50.0 */ this.tilesTotal = this.layer.width * this.layer.height; + /** + * Used internally during rendering. This holds the tiles that are visible within the Camera. + * + * @name Phaser.Tilemaps.TilemapLayer#culledTiles + * @type {Phaser.Tilemaps.Tile[]} + * @since 3.50.0 + */ + this.culledTiles = []; + + /** + * You can control if the camera should cull tiles on this layer before rendering them or not. + * + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + * + * @name Phaser.Tilemaps.TilemapLayer#skipCull + * @type {boolean} + * @since 3.50.0 + */ + this.skipCull = false; + /** * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. * * See the method `setCullPadding` for more details. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingX - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#cullPaddingX + * @type {number} * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ this.cullPaddingX = 1; @@ -114805,31 +122121,39 @@ var DynamicTilemapLayer = new Class({ * * See the method `setCullPadding` for more details. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingY - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#cullPaddingY + * @type {number} * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ this.cullPaddingY = 1; /** * The callback that is invoked when the tiles are culled. * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * It will call a different function based on the map orientation: * - * It will be sent 3 arguments: + * Orthogonal (the default) is `TilemapComponents.CullTiles` + * Isometric is `TilemapComponents.IsometricCullTiles` + * Hexagonal is `TilemapComponents.HexagonalCullTiles` + * Staggered is `TilemapComponents.StaggeredCullTiles` + * + * However, you can override this to call any function you like. + * + * It will be sent 4 arguments: * * 1. The Phaser.Tilemaps.LayerData object for this Layer * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * 4. The Render Order constant. * * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullCallback + * @name Phaser.Tilemaps.TilemapLayer#cullCallback * @type {function} - * @since 3.11.0 + * @since 3.50.0 */ - this.cullCallback = TilemapComponents.CullTiles; + this.cullCallback = TilemapComponents.GetCullTilesFunction(this.layer.orientation); /** * The rendering (draw) order of the tiles in this layer. @@ -114846,20 +122170,20 @@ var DynamicTilemapLayer = new Class({ * * This can be changed via the `setRenderOrder` method. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#_renderOrder - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#_renderOrder + * @type {number} * @default 0 * @private - * @since 3.12.0 + * @since 3.50.0 */ this._renderOrder = 0; /** * An array holding the mapping between the tile indexes and the tileset they belong to. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap + * @name Phaser.Tilemaps.TilemapLayer#gidMap * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.14.0 + * @since 3.50.0 */ this.gidMap = []; @@ -114875,9 +122199,9 @@ var DynamicTilemapLayer = new Class({ /** * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets + * @method Phaser.Tilemaps.TilemapLayer#setTilesets * @private - * @since 3.14.0 + * @since 3.50.0 * * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. */ @@ -114936,10 +122260,10 @@ var DynamicTilemapLayer = new Class({ * * You can provide either an integer (0 to 3), or the string version of the order. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setRenderOrder - * @since 3.12.0 + * @method Phaser.Tilemaps.TilemapLayer#setRenderOrder + * @since 3.50.0 * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @param {(number|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. * * @return {this} This Tilemap Layer object. */ @@ -114965,13 +122289,13 @@ var DynamicTilemapLayer = new Class({ * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#calculateFacesAt + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ calculateFacesAt: function (tileX, tileY) { @@ -114985,15 +122309,15 @@ var DynamicTilemapLayer = new Class({ * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#calculateFacesWithin + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ calculateFacesWithin: function (tileX, tileY, width, height) { @@ -115008,17 +122332,17 @@ var DynamicTilemapLayer = new Class({ * created. This is useful if you want to lay down special tiles in a level that are converted to * Sprites, but want to replace the tile itself with a floor tile or similar once converted. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#createFromTiles - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#createFromTiles + * @since 3.50.0 * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * @param {(number|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(number|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} [spriteConfig] - The config object to pass into the Sprite creator (i.e. * scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * @param {Phaser.Scene} [scene] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when determining the world XY * * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. */ @@ -115029,14 +122353,14 @@ var DynamicTilemapLayer = new Class({ /** * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. + * This is used internally during rendering. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#cull - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#cull + * @since 3.50.0 * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects to render. */ cull: function (camera) { @@ -115048,18 +122372,18 @@ var DynamicTilemapLayer = new Class({ * coordinates) within the layer. This copies all tile properties & recalculates collision * information in the destination region. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#copy - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#copy + * @since 3.50.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ copy: function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces) { @@ -115068,62 +122392,22 @@ var DynamicTilemapLayer = new Class({ return this; }, - /** - * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#destroy - * @since 3.0.0 - * - * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? - */ - destroy: function (removeFromTilemap) - { - if (removeFromTilemap === undefined) { removeFromTilemap = true; } - - if (!this.tilemap) - { - // Abort, we've already been destroyed - return; - } - - // Uninstall this layer only if it is still installed on the LayerData object - if (this.layer.tilemapLayer === this) - { - this.layer.tilemapLayer = undefined; - } - - if (removeFromTilemap) - { - this.tilemap.removeLayer(this); - } - - this.tilemap = undefined; - this.layer = undefined; - this.culledTiles.length = 0; - this.cullCallback = null; - - this.gidMap = []; - this.tileset = []; - - GameObject.prototype.destroy.call(this); - }, - /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the * specified index. Tiles will be set to collide if the given index is a colliding index. * Collision information in the region will be recalculated. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#fill - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#fill + * @since 3.50.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ fill: function (index, tileX, tileY, width, height, recalculateFaces) { @@ -115137,17 +122421,17 @@ var DynamicTilemapLayer = new Class({ * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#filterTiles - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#filterTiles + * @since 3.50.0 * * @param {function} callback - The callback. Each tile in the given area will be passed to this * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. @@ -115164,15 +122448,14 @@ var DynamicTilemapLayer = new Class({ * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to * the top-left. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#findByIndex - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#findByIndex + * @since 3.50.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. + * @param {number} index - The tile index value to search for. + * @param {number} [skip=0] - The number of times to skip a matching tile before returning. + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The first matching Tile object. */ findByIndex: function (findIndex, skip, reverse) { @@ -115184,18 +122467,18 @@ var DynamicTilemapLayer = new Class({ * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns * true. Similar to Array.prototype.find in vanilla JS. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#findTile + * @since 3.50.0 * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * - * @return {?Phaser.Tilemaps.Tile} + * @return {?Phaser.Tilemaps.Tile} The first Tile found at the given location. */ findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) { @@ -115206,18 +122489,18 @@ var DynamicTilemapLayer = new Class({ * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given * callback. Similar to Array.prototype.forEach in vanilla JS. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#forEachTile + * @since 3.50.0 * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object} [context] - The context, or scope, under which the callback should be run. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) { @@ -115229,14 +122512,14 @@ var DynamicTilemapLayer = new Class({ /** * Gets a tile at the given tile coordinates from the given layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTileAt + * @since 3.50.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. + * @return {Phaser.Tilemaps.Tile} The Tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ getTileAt: function (tileX, tileY, nonNull) { @@ -115246,16 +122529,15 @@ var DynamicTilemapLayer = new Class({ /** * Gets a tile at the given world coordinates from the given layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTileAtWorldXY + * @since 3.50.0 * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ getTileAtWorldXY: function (worldX, worldY, nonNull, camera) { @@ -115265,16 +122547,16 @@ var DynamicTilemapLayer = new Class({ /** * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithin + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the area. */ getTilesWithin: function (tileX, tileY, width, height, filteringOptions) { @@ -115285,14 +122567,14 @@ var DynamicTilemapLayer = new Class({ * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, * Line, Rectangle or Triangle. The shape should be in world coordinates. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinShape - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithinShape + * @since 3.50.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the shape. */ getTilesWithinShape: function (shape, filteringOptions, camera) { @@ -115302,17 +122584,17 @@ var DynamicTilemapLayer = new Class({ /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithinWorldXY + * @since 3.50.0 * * @param {number} worldX - The world x coordinate for the top-left of the area. * @param {number} worldY - The world y coordinate for the top-left of the area. * @param {number} width - The width of the area. * @param {number} height - The height of the area. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the area. */ getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) { @@ -115323,11 +122605,11 @@ var DynamicTilemapLayer = new Class({ * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#hasTileAt + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ @@ -115340,12 +122622,12 @@ var DynamicTilemapLayer = new Class({ * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#hasTileAtWorldXY + * @since 3.50.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. * * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ @@ -115360,15 +122642,15 @@ var DynamicTilemapLayer = new Class({ * location. If you pass in an index, only the index at the specified location will be changed. * Collision information will be recalculated at the specified location. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#putTileAt + * @since 3.50.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The Tile object that was inserted at the given coordinates. */ putTileAt: function (tile, tileX, tileY, recalculateFaces) { @@ -115381,16 +122663,16 @@ var DynamicTilemapLayer = new Class({ * specified location. If you pass in an index, only the index at the specified location will be * changed. Collision information will be recalculated at the specified location. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#putTileAtWorldXY + * @since 3.50.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The Tile object that was inserted at the given coordinates. */ putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera) { @@ -115404,15 +122686,15 @@ var DynamicTilemapLayer = new Class({ * index at the specified location will be changed. Collision information will be recalculated * within the region tiles were changed. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#putTilesAt + * @since 3.50.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces) { @@ -115428,16 +122710,16 @@ var DynamicTilemapLayer = new Class({ * indexes found within the region (excluding -1) will be used for randomly assigning new tile * indexes. This method only modifies tile indexes and does not change collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#randomize + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} [indexes] - An array of indexes to randomly draw from during randomization. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ randomize: function (tileX, tileY, width, height, indexes) { @@ -115447,14 +122729,14 @@ var DynamicTilemapLayer = new Class({ }, /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * Removes the tile at the given tile coordinates in the specified layer and updates the layers * collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#removeTileAt + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @@ -115466,19 +122748,19 @@ var DynamicTilemapLayer = new Class({ }, /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * Removes the tile at the given world coordinates in the specified layer and updates the layers * collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#removeTileAtWorldXY + * @since 3.50.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The Tile object that was removed from the given location. */ removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera) { @@ -115491,13 +122773,13 @@ var DynamicTilemapLayer = new Class({ * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation * wherever you want on the screen. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderDebug - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#renderDebug + * @since 3.50.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ renderDebug: function (graphics, styleConfig) { @@ -115511,17 +122793,17 @@ var DynamicTilemapLayer = new Class({ * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does * not change collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#replaceByIndex + * @since 3.50.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height) { @@ -115532,12 +122814,13 @@ var DynamicTilemapLayer = new Class({ /** * You can control if the Cameras should cull tiles before rendering them or not. + * * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. * * However, there are some instances when you may wish to disable this. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setSkipCull - * @since 3.11.0 + * @method Phaser.Tilemaps.TilemapLayer#setSkipCull + * @since 3.50.0 * * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. * @@ -115559,11 +122842,11 @@ var DynamicTilemapLayer = new Class({ * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCullPadding - * @since 3.11.0 + * @method Phaser.Tilemaps.TilemapLayer#setCullPadding + * @since 3.50.0 * - * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. - * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. + * @param {number} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. + * @param {number} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. * * @return {this} This Tilemap Layer object. */ @@ -115583,18 +122866,15 @@ var DynamicTilemapLayer = new Class({ * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if * collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * @method Phaser.Tilemaps.TilemapLayer#setCollision + * @since 3.50.0 * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollision - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. * - * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + * @return {this} This Tilemap Layer object. */ setCollision: function (indexes, collides, recalculateFaces, updateLayer) { @@ -115609,15 +122889,15 @@ var DynamicTilemapLayer = new Class({ * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be * enabled (true) or disabled (false). * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionBetween - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionBetween + * @since 3.50.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionBetween: function (start, stop, collides, recalculateFaces) { @@ -115635,14 +122915,14 @@ var DynamicTilemapLayer = new Class({ * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a * "types" property that matches any of those values, its collision flag will be updated. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByProperty - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionByProperty + * @since 3.50.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionByProperty: function (properties, collides, recalculateFaces) { @@ -115656,14 +122936,14 @@ var DynamicTilemapLayer = new Class({ * the given array. The `collides` parameter controls if collision will be enabled (true) or * disabled (false). Tile indexes not currently in the layer are not affected. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByExclusion - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionByExclusion + * @since 3.50.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionByExclusion: function (indexes, collides, recalculateFaces) { @@ -115678,13 +122958,13 @@ var DynamicTilemapLayer = new Class({ * a tiles collision group, the tile's colliding information will be set. The `collides` parameter * controls if collision will be enabled (true) or disabled (false). * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionFromCollisionGroup - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionFromCollisionGroup + * @since 3.50.0 * * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionFromCollisionGroup: function (collides, recalculateFaces) { @@ -115699,14 +122979,14 @@ var DynamicTilemapLayer = new Class({ * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile * at a specific location on the map then see setTileLocationCallback. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileIndexCallback - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setTileIndexCallback + * @since 3.50.0 * - * @param {(integer|integer[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|number[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setTileIndexCallback: function (indexes, callback, callbackContext) { @@ -115720,17 +123000,17 @@ var DynamicTilemapLayer = new Class({ * If a callback is already set for the tile index it will be replaced. Set the callback to null to * remove it. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setTileLocationCallback + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {function} [callback] - The callback that will be invoked when the tile is collided with. - * @param {object} [callbackContext] - The context under which the callback is called. + * @param {object} [callbackContext] - The context, or scope, under which the callback is invoked. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) { @@ -115745,15 +123025,15 @@ var DynamicTilemapLayer = new Class({ * appear to have changed! This method only modifies tile indexes and does not change collision * information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#shuffle + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ shuffle: function (tileX, tileY, width, height) { @@ -115767,17 +123047,17 @@ var DynamicTilemapLayer = new Class({ * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision * information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#swapByIndex - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#swapByIndex + * @since 3.50.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ swapByIndex: function (indexA, indexB, tileX, tileY, width, height) { @@ -115790,34 +123070,34 @@ var DynamicTilemapLayer = new Class({ * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldX + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The Tile X coordinate converted to pixels. */ tileToWorldX: function (tileX, camera) { - return TilemapComponents.TileToWorldX(tileX, camera, this.layer); + return this.tilemap.tileToWorldX(tileX, camera, this); }, /** * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldY + * @since 3.50.0 * - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The Tile Y coordinate converted to pixels. */ tileToWorldY: function (tileY, camera) { - return TilemapComponents.TileToWorldY(tileY, camera, this.layer); + return this.tilemap.tileToWorldY(tileY, camera, this); }, /** @@ -115825,19 +123105,19 @@ var DynamicTilemapLayer = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldXY + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Math.Vector2} + * @return {Phaser.Math.Vector2} A Vector2 containing the world coordinates of the Tile. */ tileToWorldXY: function (tileX, tileY, point, camera) { - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); + return this.tilemap.tileToWorldXY(tileX, tileY, point, camera, this); }, /** @@ -115855,18 +123135,16 @@ var DynamicTilemapLayer = new Class({ * The probability of any index being choose is (the index's weight) / (sum of all weights). This * method only modifies tile indexes and does not change collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#weightedRandomize + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ weightedRandomize: function (tileX, tileY, width, height, weightedIndexes) { @@ -115879,36 +123157,36 @@ var DynamicTilemapLayer = new Class({ * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#worldToTileX + * @since 3.50.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The tile X coordinate based on the world value. */ worldToTileX: function (worldX, snapToFloor, camera) { - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); + return this.tilemap.worldToTileX(worldX, snapToFloor, camera, this); }, /** * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#worldToTileY + * @since 3.50.0 * * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The tile Y coordinate based on the world value. */ worldToTileY: function (worldY, snapToFloor, camera) { - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); + return this.tilemap.worldToTileY(worldY, snapToFloor, camera, this); }, /** @@ -115916,1497 +123194,27 @@ var DynamicTilemapLayer = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#worldToTileXY + * @since 3.50.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Math.Vector2} + * @return {Phaser.Math.Vector2} A Vector2 containing the tile coordinates of the world values. */ worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) { - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); - } - -}); - -module.exports = DynamicTilemapLayer; - - -/***/ }), -/* 524 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameEvents = __webpack_require__(21); -var GameObject = __webpack_require__(14); -var ModelViewProjection = __webpack_require__(113); -var StaticTilemapLayerRender = __webpack_require__(1361); -var TilemapComponents = __webpack_require__(149); -var TransformMatrix = __webpack_require__(31); -var Utils = __webpack_require__(10); - -/** - * @classdesc - * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination - * with one, or more, Tilesets. - * - * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile - * effects like tint or alpha, or change the tiles or tilesets the layer uses. - * - * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. - * - * @class StaticTilemapLayer - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.Tilemaps - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Alpha - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.ComputedSize - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Flip - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.Renderer.WebGL.Pipelines.ModelViewProjection - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. - * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param {number} [x=0] - The world x position where the top left of this layer will be placed. - * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - */ -var StaticTilemapLayer = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Alpha, - Components.BlendMode, - Components.ComputedSize, - Components.Depth, - Components.Flip, - Components.GetBounds, - Components.Origin, - Components.Pipeline, - Components.Transform, - Components.Visible, - Components.ScrollFactor, - StaticTilemapLayerRender, - ModelViewProjection - ], - - initialize: - - function StaticTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) - { - GameObject.call(this, scene, 'StaticTilemapLayer'); - - /** - * Used internally by physics system to perform fast type checks. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#isTilemap - * @type {boolean} - * @readonly - * @since 3.0.0 - */ - this.isTilemap = true; - - /** - * The Tilemap that this layer is a part of. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilemap - * @type {Phaser.Tilemaps.Tilemap} - * @since 3.0.0 - */ - this.tilemap = tilemap; - - /** - * The index of the LayerData associated with this layer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#layerIndex - * @type {integer} - * @since 3.0.0 - */ - this.layerIndex = layerIndex; - - /** - * The LayerData associated with this layer. LayerData can only be associated with one - * tilemap layer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#layer - * @type {Phaser.Tilemaps.LayerData} - * @since 3.0.0 - */ - this.layer = tilemap.layers[layerIndex]; - - // Link the LayerData with this static tilemap layer - this.layer.tilemapLayer = this; - - /** - * The Tileset/s associated with this layer. - * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.0.0 - */ - this.tileset = []; - - /** - * Used internally by the Canvas renderer. - * This holds the tiles that are visible within the camera in the last frame. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#culledTiles - * @type {array} - * @since 3.0.0 - */ - this.culledTiles = []; - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#skipCull - * @type {boolean} - * @since 3.12.0 - */ - this.skipCull = false; - - /** - * Canvas only. - * - * The total number of tiles drawn by the renderer in the last frame. - * - * This only works when rending with Canvas. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilesDrawn - * @type {integer} - * @readonly - * @since 3.12.0 - */ - this.tilesDrawn = 0; - - /** - * Canvas only. - * - * The total number of tiles in this layer. Updated every frame. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilesTotal - * @type {integer} - * @readonly - * @since 3.12.0 - */ - this.tilesTotal = this.layer.width * this.layer.height; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. - * - * See the method `setCullPadding` for more details. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingX - * @type {integer} - * @default 1 - * @since 3.12.0 - */ - this.cullPaddingX = 1; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. - * - * See the method `setCullPadding` for more details. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingY - * @type {integer} - * @default 1 - * @since 3.12.0 - */ - this.cullPaddingY = 1; - - /** - * Canvas only. - * - * The callback that is invoked when the tiles are culled. - * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. - * - * It will be sent 3 arguments: - * - * 1. The Phaser.Tilemaps.LayerData object for this Layer - * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. - * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. - * - * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullCallback - * @type {function} - * @since 3.12.0 - */ - this.cullCallback = TilemapComponents.CullTiles; - - /** - * A reference to the renderer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#renderer - * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} - * @private - * @since 3.0.0 - */ - this.renderer = scene.sys.game.renderer; - - /** - * An array of vertex buffer objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer - * @type {WebGLBuffer[]} - * @private - * @since 3.0.0 - */ - this.vertexBuffer = []; - - /** - * An array of ArrayBuffer objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData - * @type {ArrayBuffer[]} - * @private - * @since 3.0.0 - */ - this.bufferData = []; - - /** - * An array of Float32 Array objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32 - * @type {Float32Array[]} - * @private - * @since 3.0.0 - */ - this.vertexViewF32 = []; - - /** - * An array of Uint32 Array objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32 - * @type {Uint32Array[]} - * @private - * @since 3.0.0 - */ - this.vertexViewU32 = []; - - /** - * An array of booleans, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single boolean. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#dirty - * @type {boolean[]} - * @private - * @since 3.0.0 - */ - this.dirty = []; - - /** - * An array of integers, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single integer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount - * @type {integer[]} - * @private - * @since 3.0.0 - */ - this.vertexCount = []; - - /** - * The rendering (draw) order of the tiles in this layer. - * - * The default is 0 which is 'right-down', meaning it will draw the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * This can be changed via the `setRenderOrder` method. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#_renderOrder - * @type {integer} - * @default 0 - * @private - * @since 3.12.0 - */ - this._renderOrder = 0; - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.14.0 - */ - this._tempMatrix = new TransformMatrix(); - - /** - * An array holding the mapping between the tile indexes and the tileset they belong to. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap - * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.14.0 - */ - this.gidMap = []; - - this.setTilesets(tileset); - this.setAlpha(this.layer.alpha); - this.setPosition(x, y); - this.setOrigin(); - this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); - - this.updateVBOData(); - - this.initPipeline(); - - this.mvpInit(); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () - { - this.updateVBOData(); - }, this); + return this.tilemap.worldToTileXY(worldX, worldY, snapToFloor, point, camera, this); }, /** - * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. + * Destroys this TilemapLayer and removes its link to the associated LayerData. * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets - * @private - * @since 3.14.0 - * - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - */ - setTilesets: function (tilesets) - { - var gidMap = []; - var setList = []; - var map = this.tilemap; - - if (!Array.isArray(tilesets)) - { - tilesets = [ tilesets ]; - } - - for (var i = 0; i < tilesets.length; i++) - { - var tileset = tilesets[i]; - - if (typeof tileset === 'string') - { - tileset = map.getTileset(tileset); - } - - if (tileset) - { - setList.push(tileset); - - var s = tileset.firstgid; - - for (var t = 0; t < tileset.total; t++) - { - gidMap[s + t] = tileset; - } - } - } - - this.gidMap = gidMap; - this.tileset = setList; - }, - - /** - * Prepares the VBO data arrays for population by the `upload` method. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData - * @private - * @since 3.14.0 - * - * @return {this} This Tilemap Layer object. - */ - updateVBOData: function () - { - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - this.vertexCount[i] = 0; - this.vertexBuffer[i] = null; - this.bufferData[i] = null; - this.vertexViewF32[i] = null; - this.vertexViewU32[i] = null; - } - - return this; - }, - - /** - * If the given tileset is dirty, or hasn't been rendered before, this will create a new - * ArrayBuffer object and iterate through all of the tiles, generating batch data for - * each one, storing the final results into a STATIC vertex buffer. - * - * If the tileset isn't dirty, this method simply returns after setting the vertex buffer - * and buffering the data. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#upload - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to. - * @param {integer} tilesetIndex - The tileset index. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - upload: function (camera, tilesetIndex) - { - var pipeline = this.pipeline; - - var renderer = this.renderer; - - var gl = renderer.gl; - - var vertexBuffer = this.vertexBuffer[tilesetIndex]; - var bufferData = this.bufferData[tilesetIndex]; - - if (!this.dirty[tilesetIndex] && vertexBuffer) - { - renderer.setVertexBuffer(vertexBuffer); - - pipeline.setAttribPointers(); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData); - - return this; - } - - var layer = this.layer; - var tileset = this.tileset[tilesetIndex]; - var mapWidth = layer.width; - var mapHeight = layer.height; - var width = tileset.image.source[0].width; - var height = tileset.image.source[0].height; - var mapData = layer.data; - var tile; - var row; - var col; - var renderOrder = this._renderOrder; - var minTileIndex = tileset.firstgid; - var maxTileIndex = tileset.firstgid + tileset.total; - var vOffset = -1; - var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6; - - this.vertexCount[tilesetIndex] = 0; - - if (bufferData === null) - { - bufferData = new ArrayBuffer(bufferSize); - - this.bufferData[tilesetIndex] = bufferData; - - this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData); - this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData); - } - - if (renderOrder === 0) - { - // right-down - - for (row = 0; row < mapHeight; row++) - { - for (col = 0; col < mapWidth; col++) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 1) - { - // left-down - - for (row = 0; row < mapHeight; row++) - { - for (col = mapWidth - 1; col >= 0; col--) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 2) - { - // right-up - - for (row = mapHeight - 1; row >= 0; row--) - { - for (col = 0; col < mapWidth; col++) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 3) - { - // left-up - - for (row = mapHeight - 1; row >= 0; row--) - { - for (col = mapWidth - 1; col >= 0; col--) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - - this.dirty[tilesetIndex] = false; - - if (vertexBuffer === null) - { - vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW); - - this.vertexBuffer[tilesetIndex] = vertexBuffer; - } - - renderer.setVertexBuffer(vertexBuffer); - - pipeline.setAttribPointers(); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData); - - return this; - }, - - /** - * Add a single tile into the batch. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#batchTile - * @private - * @since 3.12.0 - * - * @param {integer} vOffset - The vertex offset. - * @param {any} tile - The tile being rendered. - * @param {any} tileset - The tileset being used for rendering. - * @param {integer} width - The width of the tileset image in pixels. - * @param {integer} height - The height of the tileset image in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with. - * @param {integer} tilesetIndex - The tileset index. - * - * @return {integer} The new vOffset value. - */ - batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex) - { - var texCoords = tileset.getTileTextureCoordinates(tile.index); - - if (!texCoords) - { - return vOffset; - } - - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - - var halfTileWidth = tileWidth / 2; - var halfTileHeight = tileHeight / 2; - - var u0 = texCoords.x / width; - var v0 = texCoords.y / height; - var u1 = (texCoords.x + tileWidth) / width; - var v1 = (texCoords.y + tileHeight) / height; - - var matrix = this._tempMatrix; - - var x = -halfTileWidth; - var y = -halfTileHeight; - - if (tile.flipX) - { - tileWidth *= -1; - x += tileset.tileWidth; - } - - if (tile.flipY) - { - tileHeight *= -1; - y += tileset.tileHeight; - } - - var xw = x + tileWidth; - var yh = y + tileHeight; - - matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1); - - var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha); - - var tx0 = matrix.getX(x, y); - var ty0 = matrix.getY(x, y); - - var tx1 = matrix.getX(x, yh); - var ty1 = matrix.getY(x, yh); - - var tx2 = matrix.getX(xw, yh); - var ty2 = matrix.getY(xw, yh); - - var tx3 = matrix.getX(xw, y); - var ty3 = matrix.getY(xw, y); - - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - var vertexViewF32 = this.vertexViewF32[tilesetIndex]; - var vertexViewU32 = this.vertexViewU32[tilesetIndex]; - - vertexViewF32[++vOffset] = tx0; - vertexViewF32[++vOffset] = ty0; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx1; - vertexViewF32[++vOffset] = ty1; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx2; - vertexViewF32[++vOffset] = ty2; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx0; - vertexViewF32[++vOffset] = ty0; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx2; - vertexViewF32[++vOffset] = ty2; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx3; - vertexViewF32[++vOffset] = ty3; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - this.vertexCount[tilesetIndex] += 6; - - return vOffset; - }, - - /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder - * @since 3.12.0 - * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. - * - * @return {this} This Tilemap Layer object. - */ - setRenderOrder: function (renderOrder) - { - var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; - - if (typeof renderOrder === 'string') - { - renderOrder = orders.indexOf(renderOrder); - } - - if (renderOrder >= 0 && renderOrder < 4) - { - this._renderOrder = renderOrder; - - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - } - } - - return this; - }, - - /** - * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting - * faces are used internally for optimizing collisions against tiles. This method is mostly used - * internally to optimize recalculating faces when only one tile has been changed. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesAt - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - calculateFacesAt: function (tileX, tileY) - { - TilemapComponents.CalculateFacesAt(tileX, tileY, this.layer); - - return this; - }, - - /** - * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the - * layer. Interesting faces are used internally for optimizing collisions against tiles. This method - * is mostly used internally. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesWithin - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - calculateFacesWithin: function (tileX, tileY, width, height) - { - TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, this.layer); - - return this; - }, - - /** - * Creates a Sprite for every object matching the given tile indexes in the layer. You can - * optionally specify if each tile will be replaced with a new tile after the Sprite has been - * created. This is useful if you want to lay down special tiles in a level that are converted to - * Sprites, but want to replace the tile itself with a floor tile or similar once converted. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#createFromTiles - * @since 3.0.0 - * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY - * - * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. - */ - createFromTiles: function (indexes, replacements, spriteConfig, scene, camera) - { - return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, this.layer); - }, - - /** - * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#cull - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - cull: function (camera) - { - return this.cullCallback(this.layer, camera, this.culledTiles); - }, - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setSkipCull - * @since 3.12.0 - * - * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. - * - * @return {this} This Tilemap Layer object. - */ - setSkipCull: function (value) - { - if (value === undefined) { value = true; } - - this.skipCull = value; - - return this; - }, - - /** - * Canvas only. - * - * When a Camera culls the tiles in this layer it does so using its view into the world, building up a - * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size - * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so - * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px - * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCullPadding - * @since 3.12.0 - * - * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. - * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. - * - * @return {this} This Tilemap Layer object. - */ - setCullPadding: function (paddingX, paddingY) - { - if (paddingX === undefined) { paddingX = 1; } - if (paddingY === undefined) { paddingY = 1; } - - this.cullPaddingX = paddingX; - this.cullPaddingY = paddingY; - - return this; - }, - - /** - * Searches the entire map layer for the first tile matching the given index, then returns that Tile - * object. If no match is found, it returns null. The search starts from the top-left tile and - * continues horizontally until it hits the end of the row, then it drops down to the next column. - * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to - * the top-left. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#findByIndex - * @since 3.0.0 - * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - findByIndex: function (findIndex, skip, reverse) - { - return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer); - }, - - /** - * Find the first tile in the given rectangular area (in tile coordinates) of the layer that - * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns - * true. Similar to Array.prototype.find in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#findTile - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {?Phaser.Tilemaps.Tile} - */ - findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns - * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#filterTiles - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. The callback should return true for tiles that pass the - * filter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * callback. Similar to Array.prototype.forEach in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#forEachTile - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - - return this; - }, - - /** - * Gets a tile at the given tile coordinates from the given layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAt - * @since 3.0.0 - * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. - */ - getTileAt: function (tileX, tileY, nonNull) - { - return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer); - }, - - /** - * Gets a tile at the given world coordinates from the given layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - X position to get the tile from (given in pixels) - * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. - */ - getTileAtWorldXY: function (worldX, worldY, nonNull, camera) - { - return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithin - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithin: function (tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {number} worldY - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {number} width - How many tiles wide from the `tileX` index the area will be. - * @param {number} height - How many tiles high from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer); - }, - - /** - * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, - * Line, Rectangle or Triangle. The shape should be in world coordinates. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinShape - * @since 3.0.0 - * - * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinShape: function (shape, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAt - * @since 3.0.0 - * - * @param {integer} tileX - X position to get the tile from in tile coordinates. - * @param {integer} tileY - Y position to get the tile from in tile coordinates. - * - * @return {boolean} - */ - hasTileAt: function (tileX, tileY) - { - return TilemapComponents.HasTileAt(tileX, tileY, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate of the world position. - * @param {number} worldY - The Y coordinate of the world position. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {boolean} - */ - hasTileAtWorldXY: function (worldX, worldY, camera) - { - return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer); - }, - - /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to - * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles - * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation - * wherever you want on the screen. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderDebug - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - renderDebug: function (graphics, styleConfig) - { - TilemapComponents.RenderDebug(graphics, styleConfig, this.layer); - - return this; - }, - - /** - * Sets collision on the given tile or tiles within a layer by index. You can pass in either a - * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if - * collision will be enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollision - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollision: function (indexes, collides, recalculateFaces, updateLayer) - { - TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer, updateLayer); - - return this; - }, - - /** - * Sets collision on a range of tiles in a layer whose index is between the specified `start` and - * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set - * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be - * enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionBetween - * @since 3.0.0 - * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionBetween: function (start, stop, collides, recalculateFaces) - { - TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property - * that matches the given properties object, its collision flag will be set. The `collides` - * parameter controls if collision will be enabled (true) or disabled (false). Passing in - * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that - * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can - * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a - * "types" property that matches any of those values, its collision flag will be updated. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByProperty - * @since 3.0.0 - * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionByProperty: function (properties, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on all tiles in the given layer, except for tiles that have an index specified in - * the given array. The `collides` parameter controls if collision will be enabled (true) or - * disabled (false). Tile indexes not currently in the layer are not affected. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByExclusion - * @since 3.0.0 - * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionByExclusion: function (indexes, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets a global collision callback for the given tile index within the layer. This will affect all - * tiles on this layer that have the same index. If a callback is already set for the tile index it - * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTileIndexCallback - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. - * @param {function} callback - The callback that will be invoked when the tile is collided with. - * @param {object} callbackContext - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setTileIndexCallback: function (indexes, callback, callbackContext) - { - TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking each tiles collision group data - * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tiles collision group, the tile's colliding information will be set. The `collides` parameter - * controls if collision will be enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionFromCollisionGroup - * @since 3.0.0 - * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionFromCollisionGroup: function (collides, recalculateFaces) - { - TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. - * If a callback is already set for the tile index it will be replaced. Set the callback to null to - * remove it. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTileLocationCallback - * @since 3.0.0 - * - * @param {integer} tileX - The leftmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The topmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. - * @param {function} callback - The callback that will be invoked when the tile is collided with. - * @param {object} [callbackContext] - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) - { - TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldX - * @since 3.0.0 - * - * @param {integer} tileX - The X coordinate, in tile coordinates. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {number} - */ - tileToWorldX: function (tileX, camera) - { - return TilemapComponents.TileToWorldX(tileX, camera, this.layer); - }, - - /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldY - * @since 3.0.0 - * - * @param {integer} tileY - The Y coordinate, in tile coordinates. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {number} - */ - tileToWorldY: function (tileY, camera) - { - return TilemapComponents.TileToWorldY(tileY, camera, this.layer); - }, - - /** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldXY - * @since 3.0.0 - * - * @param {integer} tileX - The X coordinate, in tile coordinates. - * @param {integer} tileY - The Y coordinate, in tile coordinates. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {Phaser.Math.Vector2} - */ - tileToWorldXY: function (tileX, tileY, point, camera) - { - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); - }, - - /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileX - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.] - * - * @return {number} - */ - worldToTileX: function (worldX, snapToFloor, camera) - { - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileY - * @since 3.0.0 - * - * @param {number} worldY - The Y coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {number} - */ - worldToTileY: function (worldY, snapToFloor, camera) - { - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileXY - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate, in world pixels. - * @param {number} worldY - The Y coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Math.Vector2} - */ - worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) - { - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); - }, - - /** - * Destroys this StaticTilemapLayer and removes its link to the associated LayerData. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#destroy - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#destroy + * @since 3.50.0 * * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? */ @@ -117436,16 +123244,6 @@ var StaticTilemapLayer = new Class({ this.culledTiles.length = 0; this.cullCallback = null; - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - this.vertexCount[i] = 0; - this.vertexBuffer[i] = null; - this.bufferData[i] = null; - this.vertexViewF32[i] = null; - this.vertexViewU32[i] = null; - } - this.gidMap = []; this.tileset = []; @@ -117454,11 +123252,11 @@ var StaticTilemapLayer = new Class({ }); -module.exports = StaticTilemapLayer; +module.exports = TilemapLayer; /***/ }), -/* 525 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117731,6 +123529,58 @@ var TimerEvent = new Class({ return this.elapsed * 0.001; }, + /** + * Returns the time interval until the next iteration of the Timer Event. + * + * @method Phaser.Time.TimerEvent#getRemaining + * @since 3.50.0 + * + * @return {number} The time interval in milliseconds. + */ + getRemaining: function () + { + return this.delay - this.elapsed; + }, + + /** + * Returns the time interval until the next iteration of the Timer Event in seconds. + * + * @method Phaser.Time.TimerEvent#getRemainingSeconds + * @since 3.50.0 + * + * @return {number} The time interval in seconds. + */ + getRemainingSeconds: function () + { + return this.getRemaining() * 0.001; + }, + + /** + * Returns the time interval until the last iteration of the Timer Event. + * + * @method Phaser.Time.TimerEvent#getOverallRemaining + * @since 3.50.0 + * + * @return {number} The time interval in milliseconds. + */ + getOverallRemaining: function () + { + return this.delay * (1 + this.repeatCount) - this.elapsed; + }, + + /** + * Returns the time interval until the last iteration of the Timer Event in seconds. + * + * @method Phaser.Time.TimerEvent#getOverallRemainingSeconds + * @since 3.50.0 + * + * @return {number} The time interval in seconds. + */ + getOverallRemainingSeconds: function () + { + return this.getOverallRemaining() * 0.001; + }, + /** * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. * @@ -117771,7 +123621,7 @@ module.exports = TimerEvent; /***/ }), -/* 526 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117780,7 +123630,7 @@ module.exports = TimerEvent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RESERVED = __webpack_require__(1375); +var RESERVED = __webpack_require__(1437); /** * Internal function used by the Tween Builder to return an array of properties @@ -117832,7 +123682,7 @@ module.exports = GetProps; /***/ }), -/* 527 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117880,7 +123730,7 @@ module.exports = GetTweens; /***/ }), -/* 528 */ +/* 564 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -117889,15 +123739,15 @@ module.exports = GetTweens; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(243); +var Defaults = __webpack_require__(256); var GetAdvancedValue = __webpack_require__(15); -var GetBoolean = __webpack_require__(90); -var GetEaseFunction = __webpack_require__(71); +var GetBoolean = __webpack_require__(95); +var GetEaseFunction = __webpack_require__(78); var GetNewValue = __webpack_require__(155); var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(242); -var Tween = __webpack_require__(244); -var TweenData = __webpack_require__(246); +var GetValueOp = __webpack_require__(255); +var Tween = __webpack_require__(257); +var TweenData = __webpack_require__(259); /** * Creates a new Number Tween. @@ -118010,7 +123860,7 @@ module.exports = NumberTweenBuilder; /***/ }), -/* 529 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118019,7 +123869,7 @@ module.exports = NumberTweenBuilder; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetEaseFunction = __webpack_require__(71); +var GetEaseFunction = __webpack_require__(78); var GetValue = __webpack_require__(6); var MATH_CONST = __webpack_require__(13); @@ -118256,7 +124106,7 @@ module.exports = StaggerBuilder; /***/ }), -/* 530 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118265,16 +124115,16 @@ module.exports = StaggerBuilder; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); -var Defaults = __webpack_require__(243); +var Clone = __webpack_require__(76); +var Defaults = __webpack_require__(256); var GetAdvancedValue = __webpack_require__(15); -var GetBoolean = __webpack_require__(90); -var GetEaseFunction = __webpack_require__(71); +var GetBoolean = __webpack_require__(95); +var GetEaseFunction = __webpack_require__(78); var GetNewValue = __webpack_require__(155); -var GetTargets = __webpack_require__(241); -var GetTweens = __webpack_require__(527); +var GetTargets = __webpack_require__(254); +var GetTweens = __webpack_require__(563); var GetValue = __webpack_require__(6); -var Timeline = __webpack_require__(531); +var Timeline = __webpack_require__(567); var TweenBuilder = __webpack_require__(156); /** @@ -118410,7 +124260,7 @@ module.exports = TimelineBuilder; /***/ }), -/* 531 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -118420,10 +124270,10 @@ module.exports = TimelineBuilder; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(245); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(258); var TweenBuilder = __webpack_require__(156); -var TWEEN_CONST = __webpack_require__(91); +var TWEEN_CONST = __webpack_require__(96); /** * @classdesc @@ -118565,7 +124415,7 @@ var Timeline = new Class({ * The current state of the Timeline. * * @name Phaser.Tweens.Timeline#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = TWEEN_CONST.PENDING_ADD; @@ -118574,7 +124424,7 @@ var Timeline = new Class({ * The state of the Timeline when it was paused (used by Resume) * * @name Phaser.Tweens.Timeline#_pausedState - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -119315,7 +125165,7 @@ module.exports = Timeline; /***/ }), -/* 532 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119325,13 +125175,13 @@ module.exports = Timeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasSnapshot = __webpack_require__(533); -var CameraEvents = __webpack_require__(42); +var CameraEvents = __webpack_require__(35); +var CanvasSnapshot = __webpack_require__(569); var Class = __webpack_require__(0); -var CONST = __webpack_require__(34); -var GetBlendModes = __webpack_require__(534); -var ScaleEvents = __webpack_require__(94); -var TransformMatrix = __webpack_require__(31); +var CONST = __webpack_require__(39); +var GetBlendModes = __webpack_require__(570); +var ScaleEvents = __webpack_require__(101); +var TransformMatrix = __webpack_require__(24); /** * @classdesc @@ -119363,7 +125213,7 @@ var CanvasRenderer = new Class({ * A constant which allows the renderer to be easily identified as a Canvas Renderer. * * @name Phaser.Renderer.Canvas.CanvasRenderer#type - * @type {integer} + * @type {number} * @since 3.0.0 */ this.type = CONST.CANVAS; @@ -119382,7 +125232,7 @@ var CanvasRenderer = new Class({ * The width of the canvas being rendered to. * * @name Phaser.Renderer.Canvas.CanvasRenderer#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = 0; @@ -119391,7 +125241,7 @@ var CanvasRenderer = new Class({ * The height of the canvas being rendered to. * * @name Phaser.Renderer.Canvas.CanvasRenderer#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = 0; @@ -119406,7 +125256,6 @@ var CanvasRenderer = new Class({ this.config = { clearBeforeRender: game.config.clearBeforeRender, backgroundColor: game.config.backgroundColor, - resolution: game.config.resolution, antialias: game.config.antialias, roundPixels: game.config.roundPixels }; @@ -119489,7 +125338,7 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix1 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix1 = new TransformMatrix(); @@ -119499,7 +125348,7 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix2 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix2 = new TransformMatrix(); @@ -119509,20 +125358,10 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix3 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix3 = new TransformMatrix(); - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix4 = new TransformMatrix(); - this.init(); }, @@ -119549,8 +125388,6 @@ var CanvasRenderer = new Class({ * * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. - * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes. - * @param {number} [resolution] - The Scale Manager resolution setting. */ onResize: function (gameSize, baseSize) { @@ -119673,25 +125510,30 @@ var CanvasRenderer = new Class({ }, /** - * Renders the Scene to the given Camera. + * The core render step for a Scene Camera. + * + * Iterates through the given array of Game Objects and renders them with the given Camera. + * + * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked + * by the Scene Systems.render method. + * + * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * * @method Phaser.Renderer.Canvas.CanvasRenderer#render * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.GameObjects.DisplayList} children - The Game Objects within the Scene to be rendered. - * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently unused. + * @param {Phaser.GameObjects.GameObject[]} children - An array of filtered Game Objects that can be rendered by the given Camera. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ - render: function (scene, children, interpolationPercentage, camera) + render: function (scene, children, camera) { - var list = children.list; - var childCount = list.length; + var childCount = children.length; - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + var cx = camera.x; + var cy = camera.y; + var cw = camera.width; + var ch = camera.height; var ctx = (camera.renderToTexture) ? camera.context : scene.sys.context; @@ -119724,7 +125566,7 @@ var CanvasRenderer = new Class({ ctx.globalCompositeOperation = 'source-over'; - this.drawCount += list.length; + this.drawCount += childCount; if (camera.renderToTexture) { @@ -119735,19 +125577,14 @@ var CanvasRenderer = new Class({ for (var i = 0; i < childCount; i++) { - var child = list[i]; - - if (!child.willRender(camera)) - { - continue; - } + var child = children[i]; if (child.mask) { child.mask.preRenderCanvas(this, child, camera); } - child.renderCanvas(this, child, interpolationPercentage, camera); + child.renderCanvas(this, child, camera); if (child.mask) { @@ -119821,10 +125658,10 @@ var CanvasRenderer = new Class({ * @param {HTMLCanvasElement} canvas - The canvas to grab from. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? - * @param {integer} [x=0] - The x coordinate to grab from. - * @param {integer} [y=0] - The y coordinate to grab from. - * @param {integer} [width=canvas.width] - The width of the area to grab. - * @param {integer} [height=canvas.height] - The height of the area to grab. + * @param {number} [x=0] - The x coordinate to grab from. + * @param {number} [y=0] - The y coordinate to grab from. + * @param {number} [width=canvas.width] - The width of the area to grab. + * @param {number} [height=canvas.height] - The height of the area to grab. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. * @@ -119886,10 +125723,10 @@ var CanvasRenderer = new Class({ * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotArea * @since 3.16.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -119927,8 +125764,8 @@ var CanvasRenderer = new Class({ * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotPixel * @since 3.16.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This WebGL Renderer. @@ -120122,7 +125959,7 @@ module.exports = CanvasRenderer; /***/ }), -/* 533 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120131,8 +125968,8 @@ module.exports = CanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); -var Color = __webpack_require__(32); +var CanvasPool = __webpack_require__(31); +var Color = __webpack_require__(36); var GetFastValue = __webpack_require__(2); /** @@ -120215,7 +126052,7 @@ module.exports = CanvasSnapshot; /***/ }), -/* 534 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120224,8 +126061,8 @@ module.exports = CanvasSnapshot; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var modes = __webpack_require__(54); -var CanvasFeatures = __webpack_require__(329); +var modes = __webpack_require__(48); +var CanvasFeatures = __webpack_require__(340); /** * Returns an array which maps the default blend modes to supported Canvas blend modes. @@ -120279,7 +126116,7 @@ module.exports = GetBlendModes; /***/ }), -/* 535 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -120289,22 +126126,21 @@ module.exports = GetBlendModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(93); -var CameraEvents = __webpack_require__(42); +var ArrayRemove = __webpack_require__(87); +var BaseCamera = __webpack_require__(99); +var CameraEvents = __webpack_require__(35); var Class = __webpack_require__(0); -var CONST = __webpack_require__(34); -var GameEvents = __webpack_require__(21); -var IsSizePowerOfTwo = __webpack_require__(128); +var CONST = __webpack_require__(39); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(190); +var GameEvents = __webpack_require__(23); +var IsSizePowerOfTwo = __webpack_require__(133); var NOOP = __webpack_require__(1); -var PIPELINE_CONST = __webpack_require__(110); -var PipelineManager = __webpack_require__(536); -var ProjectOrtho = __webpack_require__(185); -var ScaleEvents = __webpack_require__(94); -var SpliceOne = __webpack_require__(82); -var TextureEvents = __webpack_require__(130); -var TransformMatrix = __webpack_require__(31); -var Utils = __webpack_require__(10); -var WebGLSnapshot = __webpack_require__(541); +var PipelineManager = __webpack_require__(572); +var ScaleEvents = __webpack_require__(101); +var TextureEvents = __webpack_require__(136); +var Utils = __webpack_require__(12); +var WebGLSnapshot = __webpack_require__(580); /** * @callback WebGLContextCallback @@ -120324,6 +126160,7 @@ var WebGLSnapshot = __webpack_require__(541); * * @class WebGLRenderer * @memberof Phaser.Renderer.WebGL + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @@ -120331,10 +126168,14 @@ var WebGLSnapshot = __webpack_require__(541); */ var WebGLRenderer = new Class({ + Extends: EventEmitter, + initialize: function WebGLRenderer (game) { + EventEmitter.call(this); + var gameConfig = game.config; var contextCreationConfig = { @@ -120360,7 +126201,6 @@ var WebGLRenderer = new Class({ antialias: gameConfig.antialias, backgroundColor: gameConfig.backgroundColor, contextCreation: contextCreationConfig, - resolution: gameConfig.resolution, roundPixels: gameConfig.roundPixels, maxTextures: gameConfig.maxTextures, maxTextureSize: gameConfig.maxTextureSize, @@ -120382,7 +126222,7 @@ var WebGLRenderer = new Class({ * A constant which allows the renderer to be easily identified as a WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#type - * @type {integer} + * @type {number} * @since 3.0.0 */ this.type = CONST.WEBGL; @@ -120409,7 +126249,7 @@ var WebGLRenderer = new Class({ * This is populated in the onResize event handler. * * @name Phaser.Renderer.WebGL.WebGLRenderer#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = 0; @@ -120419,7 +126259,7 @@ var WebGLRenderer = new Class({ * This is populated in the onResize event handler. * * @name Phaser.Renderer.WebGL.WebGLRenderer#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = 0; @@ -120445,16 +126285,6 @@ var WebGLRenderer = new Class({ */ this.blendModes = []; - /** - * Keeps track of any WebGLTexture created with the current WebGLRenderingContext. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#nativeTextures - * @type {array} - * @default [] - * @since 3.0.0 - */ - this.nativeTextures = []; - /** * This property is set to `true` if the WebGL context of the renderer is lost. * @@ -120488,13 +126318,11 @@ var WebGLRenderer = new Class({ bufferHeight: 0 }; - // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc) - /** * Cached value for the last texture unit that was used. * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentActiveTexture - * @type {integer} + * @type {number} * @since 3.1.0 */ this.currentActiveTexture = 0; @@ -120504,7 +126332,7 @@ var WebGLRenderer = new Class({ * This value is constantly updated and should be treated as read-only by your code. * * @name Phaser.Renderer.WebGL.WebGLRenderer#startActiveTexture - * @type {integer} + * @type {number} * @since 3.50.0 */ this.startActiveTexture = 0; @@ -120514,7 +126342,7 @@ var WebGLRenderer = new Class({ * This is set via the Game Config `maxTextures` property and should never be changed after boot. * * @name Phaser.Renderer.WebGL.WebGLRenderer#maxTextures - * @type {integer} + * @type {number} * @since 3.50.0 */ this.maxTextures = 0; @@ -120560,7 +126388,7 @@ var WebGLRenderer = new Class({ this.normalTexture; /** - * Current framebuffer in use. + * The currently bound framebuffer in use. * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentFramebuffer * @type {WebGLFramebuffer} @@ -120569,6 +126397,15 @@ var WebGLRenderer = new Class({ */ this.currentFramebuffer = null; + /** + * A stack into which the frame buffer objects are pushed and popped. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#fboStack + * @type {WebGLFramebuffer[]} + * @since 3.50.0 + */ + this.fboStack = []; + /** * Current WebGLProgram in use. * @@ -120603,7 +126440,7 @@ var WebGLRenderer = new Class({ * Current blend mode in use * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentBlendMode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.currentBlendMode = Infinity; @@ -120667,17 +126504,40 @@ var WebGLRenderer = new Class({ this.gl = null; /** - * Array of strings that indicate which WebGL extensions are supported by the browser + * Array of strings that indicate which WebGL extensions are supported by the browser. + * This is populated in the `boot` method. * * @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions - * @type {object} + * @type {string[]} * @default null * @since 3.0.0 */ this.supportedExtensions = null; /** - * Extensions loaded into the current context + * If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold + * a reference to the glExtension for it. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#instancedArraysExtension + * @type {ANGLE_instanced_arrays} + * @default null + * @since 3.50.0 + */ + this.instancedArraysExtension = null; + + /** + * If the browser supports the `OES_vertex_array_object` extension, this property will hold + * a reference to the glExtension for it. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#vaoExtension + * @type {OES_vertex_array_object} + * @default null + * @since 3.50.0 + */ + this.vaoExtension = null; + + /** + * The WebGL Extensions loaded into the current context. * * @name Phaser.Renderer.WebGL.WebGLRenderer#extensions * @type {object} @@ -120687,7 +126547,7 @@ var WebGLRenderer = new Class({ this.extensions = {}; /** - * Stores the current WebGL component formats for further use + * Stores the current WebGL component formats for further use. * * @name Phaser.Renderer.WebGL.WebGLRenderer#glFormats * @type {array} @@ -120700,7 +126560,7 @@ var WebGLRenderer = new Class({ * Stores the supported WebGL texture compression formats. * * @name Phaser.Renderer.WebGL.WebGLRenderer#compression - * @type {array} + * @type {object} * @since 3.8.0 */ this.compression = { @@ -120730,6 +126590,17 @@ var WebGLRenderer = new Class({ */ this.blankTexture = null; + /** + * A pure white 4x4 texture, as used by the Graphics system where needed. + * This is set in the `boot` method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#whiteTexture + * @type {WebGLTexture} + * @readonly + * @since 3.50.0 + */ + this.whiteTexture = null; + /** * A default Camera used in calls when no other camera has been provided. * @@ -120739,51 +126610,11 @@ var WebGLRenderer = new Class({ */ this.defaultCamera = new BaseCamera(0, 0, 0, 0); - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix3 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix4 = new TransformMatrix(); - /** * The total number of masks currently stacked. * * @name Phaser.Renderer.WebGL.WebGLRenderer#maskCount - * @type {integer} + * @type {number} * @since 3.17.0 */ this.maskCount = 0; @@ -120899,6 +126730,25 @@ var WebGLRenderer = new Class({ */ this.textureFlush = 0; + /** + * The default scissor, set during `preRender` and modified during `resize`. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#defaultScissor + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.defaultScissor = [ 0, 0, 0, 0 ]; + + /** + * Has this renderer fully booted yet? + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#isBooted + * @type {boolean} + * @since 3.50.0 + */ + this.isBooted = false; + this.init(this.config); }, @@ -121016,7 +126866,7 @@ var WebGLRenderer = new Class({ }; - // Load supported extensions + // Load supported extensions var exts = gl.getSupportedExtensions(); if (!config.maxTextures || config.maxTextures === -1) @@ -121024,6 +126874,11 @@ var WebGLRenderer = new Class({ config.maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); } + if (!config.maxTextureSize) + { + config.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); + } + var extString = 'WEBGL_compressed_texture_'; var wkExtString = 'WEBKIT_' + extString; @@ -121033,6 +126888,14 @@ var WebGLRenderer = new Class({ this.supportedExtensions = exts; + var angleString = 'ANGLE_instanced_arrays'; + + this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null; + + var vaoString = 'OES_vertex_array_object'; + + this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null; + // Setup initial WebGL state gl.disable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); @@ -121073,7 +126936,7 @@ var WebGLRenderer = new Class({ gl.bindTexture(gl.TEXTURE_2D, tempTexture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 255, 255, 255, 255 ])); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 0, 0, 255, 255 ])); tempTextures[index] = tempTexture; @@ -121106,16 +126969,23 @@ var WebGLRenderer = new Class({ boot: function () { var game = this.game; + var pipelineManager = this.pipelines; - this.pipelines.boot(); + var baseSize = game.scale.baseSize; - var multi = this.pipelines.get(PIPELINE_CONST.MULTI_PIPELINE); + this.width = baseSize.width; + this.height = baseSize.height; - var blank = game.textures.getFrame('__DEFAULT'); + this.isBooted = true; - multi.currentFrame = blank; + // Set-up pipelines - this.blankTexture = blank; + pipelineManager.boot(game.config.pipeline); + + // Set-up default textures, fbo and scissor + + this.blankTexture = game.textures.getFrame('__DEFAULT'); + this.whiteTexture = game.textures.getFrame('__WHITE'); var gl = this.gl; @@ -121125,9 +126995,7 @@ var WebGLRenderer = new Class({ game.scale.on(ScaleEvents.RESIZE, this.onResize, this); - var baseSize = game.scale.baseSize; - - this.resize(baseSize.width, baseSize.height, game.scale.resolution); + this.resize(baseSize.width, baseSize.height); }, /** @@ -121137,16 +127005,14 @@ var WebGLRenderer = new Class({ * @since 3.16.0 * * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. - * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. - * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes. - * @param {number} [resolution] - The Scale Manager resolution setting. + * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions. The canvas width / height values match this. */ - onResize: function (gameSize, baseSize, displaySize, resolution) + onResize: function (gameSize, baseSize) { // Has the underlying canvas size changed? - if (baseSize.width !== this.width || baseSize.height !== this.height || resolution !== this.resolution) + if (baseSize.width !== this.width || baseSize.height !== this.height) { - this.resize(baseSize.width, baseSize.height, resolution); + this.resize(baseSize.width, baseSize.height); } }, @@ -121154,32 +127020,34 @@ var WebGLRenderer = new Class({ * Resizes the drawing buffer to match that required by the Scale Manager. * * @method Phaser.Renderer.WebGL.WebGLRenderer#resize + * @fires Phaser.Renderer.WebGL.Events#RESIZE * @since 3.0.0 * * @param {number} [width] - The new width of the renderer. * @param {number} [height] - The new height of the renderer. - * @param {number} [resolution] - The new resolution of the renderer. * * @return {this} This WebGLRenderer instance. */ - resize: function (width, height, resolution) + resize: function (width, height) { var gl = this.gl; this.width = width; this.height = height; - this.resolution = resolution; gl.viewport(0, 0, width, height); - this.pipelines.resize(width, height, resolution); - this.drawingBufferHeight = gl.drawingBufferHeight; gl.scissor(0, (gl.drawingBufferHeight - height), width, height); this.defaultCamera.setSize(width, height); + this.defaultScissor[2] = width; + this.defaultScissor[3] = height; + + this.emit(Events.RESIZE, width, height); + return this; }, @@ -121237,13 +127105,13 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor * @since 3.0.0 * - * @param {integer} x - The x position of the scissor. - * @param {integer} y - The y position of the scissor. - * @param {integer} width - The width of the scissor. - * @param {integer} height - The height of the scissor. - * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + * @param {number} x - The x position of the scissor. + * @param {number} y - The y position of the scissor. + * @param {number} width - The width of the scissor. + * @param {number} height - The height of the scissor. + * @param {number} [drawingBufferHeight] - Optional drawingBufferHeight override value. * - * @return {integer[]} An array containing the scissor values. + * @return {number[]} An array containing the scissor values. */ pushScissor: function (x, y, width, height, drawingBufferHeight) { @@ -121268,11 +127136,11 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor * @since 3.0.0 * - * @param {integer} x - The x position of the scissor. - * @param {integer} y - The y position of the scissor. - * @param {integer} width - The width of the scissor. - * @param {integer} height - The height of the scissor. - * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + * @param {number} x - The x position of the scissor. + * @param {number} y - The y position of the scissor. + * @param {number} width - The width of the scissor. + * @param {number} height - The height of the scissor. + * @param {number} [drawingBufferHeight] - Optional drawingBufferHeight override value. */ setScissor: function (x, y, width, height, drawingBufferHeight) { @@ -121352,7 +127220,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setBlendMode * @since 3.0.0 * - * @param {integer} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value. + * @param {number} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value. * @param {boolean} [force=false] - Force the blend mode to be set, regardless of the currently set blend mode. * * @return {boolean} `true` if the blend mode was changed as a result of this call, forcing a flush, otherwise `false`. @@ -121399,7 +127267,7 @@ var WebGLRenderer = new Class({ * @param {GLenum[]} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. * @param {GLenum} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * - * @return {integer} The index of the new blend mode, used for referencing it in the future. + * @return {number} The index of the new blend mode, used for referencing it in the future. */ addBlendMode: function (func, equation) { @@ -121414,7 +127282,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode * @since 3.0.0 * - * @param {integer} index - The index of the custom blend mode. + * @param {number} index - The index of the custom blend mode. * @param {function} func - The function to use for the blend mode. * @param {function} equation - The equation to use for the blend mode. * @@ -121442,7 +127310,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode * @since 3.0.0 * - * @param {integer} index - The index of the custom blend mode to be removed. + * @param {number} index - The index of the custom blend mode to be removed. * * @return {this} This WebGLRenderer instance. */ @@ -121482,7 +127350,7 @@ var WebGLRenderer = new Class({ */ setTextureSource: function (textureSource) { - if (this.pipelines.current.forceZero) + if (this.pipelines.forceZero()) { this.setTextureZero(textureSource.glTexture, true); @@ -121675,16 +127543,22 @@ var WebGLRenderer = new Class({ var gl = this.gl; var temp = this.tempTextures; - var total = (all) ? temp.length : 2; - - for (var i = 0; i < total; i++) - { - gl.activeTexture(gl.TEXTURE0 + i); - gl.bindTexture(gl.TEXTURE_2D, temp[i]); - } - if (all) { + for (var i = 0; i < temp.length; i++) + { + gl.activeTexture(gl.TEXTURE0 + i); + gl.bindTexture(gl.TEXTURE_2D, temp[i]); + } + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(gl.TEXTURE_2D, temp[1]); + } + else + { + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, temp[0]); + gl.activeTexture(gl.TEXTURE1); gl.bindTexture(gl.TEXTURE_2D, temp[1]); } @@ -121712,7 +127586,7 @@ var WebGLRenderer = new Class({ */ setTexture2D: function (texture) { - if (this.pipelines.current.forceZero) + if (this.pipelines.forceZero()) { this.setTextureZero(texture, true); @@ -121759,117 +127633,228 @@ var WebGLRenderer = new Class({ }, /** - * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. + * Pushes a new framebuffer onto the FBO stack and makes it the currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Call `popFramebuffer` to remove it again. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#pushFramebuffer + * @since 3.50.0 + * + * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. + * @param {boolean} [updateScissor=false] - Set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? + * + * @return {this} This WebGLRenderer instance. + */ + pushFramebuffer: function (framebuffer, updateScissor, resetTextures, setViewport) + { + if (framebuffer === this.currentFramebuffer) + { + return this; + } + + this.fboStack.push(framebuffer); + + return this.setFramebuffer(framebuffer, updateScissor, resetTextures, setViewport); + }, + + /** + * Sets the given framebuffer as the active and currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Typically, you should call `pushFramebuffer` instead of this method. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer * @since 3.0.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? * * @return {this} This WebGLRenderer instance. */ - setFramebuffer: function (framebuffer, updateScissor) + setFramebuffer: function (framebuffer, updateScissor, resetTextures, setViewport) { if (updateScissor === undefined) { updateScissor = false; } + if (resetTextures === undefined) { resetTextures = false; } + if (setViewport === undefined) { setViewport = true; } + + if (framebuffer === this.currentFramebuffer) + { + return this; + } var gl = this.gl; var width = this.width; var height = this.height; - if (framebuffer !== this.currentFramebuffer) + if (framebuffer && framebuffer.renderTexture && setViewport) { - if (framebuffer && framebuffer.renderTexture) + width = framebuffer.renderTexture.width; + height = framebuffer.renderTexture.height; + } + else + { + this.flush(); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + + if (setViewport) + { + gl.viewport(0, 0, width, height); + } + + if (updateScissor) + { + if (framebuffer) { - width = framebuffer.renderTexture.width; - height = framebuffer.renderTexture.height; + this.drawingBufferHeight = height; + + this.pushScissor(0, 0, width, height); } else { - this.flush(); + this.drawingBufferHeight = this.height; + + this.popScissor(); } + } - gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + this.currentFramebuffer = framebuffer; - gl.viewport(0, 0, width, height); - - if (updateScissor) - { - if (framebuffer) - { - this.drawingBufferHeight = height; - - this.pushScissor(0, 0, width, height); - } - else - { - this.drawingBufferHeight = this.height; - - this.popScissor(); - } - } - - this.currentFramebuffer = framebuffer; + if (resetTextures) + { + this.resetTextures(); } return this; }, /** - * Binds a program. If there was another program already bound it will force a pipeline flush. + * Pops the previous framebuffer from the fbo stack and sets it. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#popFramebuffer + * @since 3.50.0 + * + * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? + * + * @return {WebGLFramebuffer} The Framebuffer that was set, or `null` if there aren't any more in the stack. + */ + popFramebuffer: function (updateScissor, resetTextures, setViewport) + { + if (updateScissor === undefined) { updateScissor = false; } + if (resetTextures === undefined) { resetTextures = false; } + if (setViewport === undefined) { setViewport = true; } + + var fboStack = this.fboStack; + + // Remove the current fbo + fboStack.pop(); + + // Reset the previous framebuffer + var framebuffer = fboStack[fboStack.length - 1]; + + if (!framebuffer) + { + framebuffer = null; + } + + this.setFramebuffer(framebuffer, updateScissor, resetTextures, setViewport); + + return framebuffer; + }, + + /** + * Binds a shader program. + * + * If there was a different program already bound it will force a pipeline flush first. + * + * If the same program given to this method is already set as the current program, no change + * will take place and this method will return `false`. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram * @since 3.0.0 * * @param {WebGLProgram} program - The program that needs to be bound. * - * @return {this} This WebGLRenderer instance. + * @return {boolean} `true` if the given program was bound, otherwise `false`. */ setProgram: function (program) { - var gl = this.gl; - if (program !== this.currentProgram) { this.flush(); - gl.useProgram(program); + this.gl.useProgram(program); this.currentProgram = program; + + return true; } + return false; + }, + + /** + * Rebinds whatever program `WebGLRenderer.currentProgram` is set as, without + * changing anything, or flushing. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#resetProgram + * @since 3.50.0 + * + * @return {this} This WebGLRenderer instance. + */ + resetProgram: function () + { + this.gl.useProgram(this.currentProgram); + return this; }, /** - * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. + * Binds a vertex buffer. + * + * If there was a different vertex buffer already bound it will force a pipeline flush first. + * + * If the same buffer given to this method is already set as the current buffer, no change + * will take place and this method will return `false`. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer * @since 3.0.0 * * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound. * - * @return {this} This WebGLRenderer instance. + * @return {boolean} `true` if the given buffer was bound, otherwise `false`. */ setVertexBuffer: function (vertexBuffer) { - var gl = this.gl; - - if (vertexBuffer !== this.currentVertexBuffer) + if (vertexBuffer && vertexBuffer !== this.currentVertexBuffer) { + var gl = this.gl; + this.flush(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); this.currentVertexBuffer = vertexBuffer; + + return true; } - return this; + return false; }, /** - * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. + * Binds an index buffer. If there is an index buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer * @since 3.0.0 @@ -121882,7 +127867,7 @@ var WebGLRenderer = new Class({ { var gl = this.gl; - if (indexBuffer !== this.currentIndexBuffer) + if (indexBuffer && indexBuffer !== this.currentIndexBuffer) { this.flush(); @@ -121901,9 +127886,9 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {object} source - The source of the texture. - * @param {integer} width - The width of the texture. - * @param {integer} height - The height of the texture. - * @param {integer} scaleMode - The scale mode to be used by the texture. + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} scaleMode - The scale mode to be used by the texture. * * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created. */ @@ -121949,15 +127934,15 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D * @since 3.0.0 * - * @param {integer} mipLevel - Mip level of the texture. - * @param {integer} minFilter - Filtering of the texture. - * @param {integer} magFilter - Filtering of the texture. - * @param {integer} wrapT - Wrapping mode of the texture. - * @param {integer} wrapS - Wrapping mode of the texture. - * @param {integer} format - Which format does the texture use. + * @param {number} mipLevel - Mip level of the texture. + * @param {number} minFilter - Filtering of the texture. + * @param {number} magFilter - Filtering of the texture. + * @param {number} wrapT - Wrapping mode of the texture. + * @param {number} wrapS - Wrapping mode of the texture. + * @param {number} format - Which format does the texture use. * @param {?object} pixels - pixel data. - * @param {integer} width - Width of the texture in pixels. - * @param {integer} height - Height of the texture in pixels. + * @param {number} width - Width of the texture in pixels. + * @param {number} height - Height of the texture in pixels. * @param {boolean} [pma=true] - Does the texture have premultiplied alpha? * @param {boolean} [forceSize=false] - If `true` it will use the width and height passed to this method, regardless of the pixels dimension. * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. @@ -122019,21 +128004,19 @@ var WebGLRenderer = new Class({ texture.glIndex = 0; texture.glIndexCounter = -1; - this.nativeTextures.push(texture); - return texture; }, /** - * Wrapper for creating WebGLFramebuffer. + * Creates a WebGL Framebuffer object and optionally binds a depth stencil render buffer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createFramebuffer * @since 3.0.0 * - * @param {integer} width - Width in pixels of the framebuffer - * @param {integer} height - Height in pixels of the framebuffer - * @param {WebGLTexture} renderTexture - The color texture to where the color pixels are written - * @param {boolean} addDepthStencilBuffer - Indicates if the current framebuffer support depth and stencil buffers + * @param {number} width - If `addDepthStencilBuffer` is true, this controls the width of the depth stencil. + * @param {number} height - If `addDepthStencilBuffer` is true, this controls the height of the depth stencil. + * @param {WebGLTexture} renderTexture - The color texture where the color pixels are written. + * @param {boolean} [addDepthStencilBuffer=false] - Create a Renderbuffer for the depth stencil? * * @return {WebGLFramebuffer} Raw WebGLFramebuffer */ @@ -122048,6 +128031,7 @@ var WebGLRenderer = new Class({ if (addDepthStencilBuffer) { var depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); @@ -122069,28 +128053,30 @@ var WebGLRenderer = new Class({ 36061: 'Framebuffer Unsupported' }; - throw new Error('Framebuffer incomplete. Framebuffer status: ' + errors[complete]); + throw new Error('Framebuffer status: ' + errors[complete]); } framebuffer.renderTexture = renderTexture; this.setFramebuffer(null); - this.resetTextures(true); + this.resetTextures(); return framebuffer; }, /** - * Wrapper for creating a WebGLProgram + * Creates a WebGLProgram instance based on the given vertex and fragment shader source. + * + * Then compiles, attaches and links the program before returning it. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createProgram * @since 3.0.0 * - * @param {string} vertexShader - Source to the vertex shader - * @param {string} fragmentShader - Source to the fragment shader + * @param {string} vertexShader - The vertex shader source code as a single string. + * @param {string} fragmentShader - The fragment shader source code as a single string. * - * @return {WebGLProgram} Raw WebGLProgram + * @return {WebGLProgram} The linked WebGLProgram created from the given shader source. */ createProgram: function (vertexShader, fragmentShader) { @@ -122106,11 +128092,12 @@ var WebGLRenderer = new Class({ if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) { - throw new Error('Failed to compile Vertex Shader:\n' + gl.getShaderInfoLog(vs)); + throw new Error('Vertex Shader failed:\n' + gl.getShaderInfoLog(vs)); } + if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) { - throw new Error('Failed to compile Fragment Shader:\n' + gl.getShaderInfoLog(fs)); + throw new Error('Fragment Shader failed:\n' + gl.getShaderInfoLog(fs)); } gl.attachShader(program, vs); @@ -122119,9 +128106,11 @@ var WebGLRenderer = new Class({ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { - throw new Error('Failed to link program:\n' + gl.getProgramInfoLog(program)); + throw new Error('Link Program failed:\n' + gl.getProgramInfoLog(program)); } + gl.useProgram(program); + return program; }, @@ -122132,7 +128121,7 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + * @param {number} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW * * @return {WebGLBuffer} Raw vertex buffer */ @@ -122141,11 +128130,9 @@ var WebGLRenderer = new Class({ var gl = this.gl; var vertexBuffer = gl.createBuffer(); - this.setVertexBuffer(vertexBuffer); - + gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); gl.bufferData(gl.ARRAY_BUFFER, initialDataOrSize, bufferUsage); - - this.setVertexBuffer(null); + gl.bindBuffer(gl.ARRAY_BUFFER, null); return vertexBuffer; }, @@ -122157,7 +128144,7 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo. - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. + * @param {number} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. * * @return {WebGLBuffer} Raw index buffer */ @@ -122166,37 +128153,36 @@ var WebGLRenderer = new Class({ var gl = this.gl; var indexBuffer = gl.createBuffer(); - this.setIndexBuffer(indexBuffer); - + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, initialDataOrSize, bufferUsage); - - this.setIndexBuffer(null); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); return indexBuffer; }, /** - * Removes the given texture from the nativeTextures array and then deletes it from the GPU. + * Calls `GL.deleteTexture` on the given WebGLTexture and also optionally + * resets the currently defined textures. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture * @since 3.0.0 * * @param {WebGLTexture} texture - The WebGL Texture to be deleted. + * @param {boolean} [reset=false] - Call the `resetTextures` method after deleting this texture? * * @return {this} This WebGLRenderer instance. */ - deleteTexture: function (texture) + deleteTexture: function (texture, reset) { - var index = this.nativeTextures.indexOf(texture); - - if (index !== -1) + if (texture) { - SpliceOne(this.nativeTextures, index); + this.gl.deleteTexture(texture); } - this.gl.deleteTexture(texture); - - this.resetTextures(); + if (reset) + { + this.resetTextures(); + } return this; }, @@ -122213,7 +128199,17 @@ var WebGLRenderer = new Class({ */ deleteFramebuffer: function (framebuffer) { - this.gl.deleteFramebuffer(framebuffer); + if (framebuffer) + { + this.gl.deleteFramebuffer(framebuffer); + + ArrayRemove(this.fboStack, framebuffer); + + if (this.currentFramebuffer === framebuffer) + { + this.currentFramebuffer = null; + } + } return this; }, @@ -122230,7 +128226,10 @@ var WebGLRenderer = new Class({ */ deleteProgram: function (program) { - this.gl.deleteProgram(program); + if (program) + { + this.gl.deleteProgram(program); + } return this; }, @@ -122263,70 +128262,36 @@ var WebGLRenderer = new Class({ */ preRenderCamera: function (camera) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + var cx = camera.x; + var cy = camera.y; + var cw = camera.width; + var ch = camera.height; var color = camera.backgroundColor; - var MultiPipeline = this.pipelines.MULTI_PIPELINE; + camera.emit(CameraEvents.PRE_RENDER, camera); - if (camera.renderToTexture) + this.pipelines.preBatchCamera(camera); + + this.pushScissor(cx, cy, cw, ch); + + if (camera.mask) { - this.flush(); + this.currentCameraMask.mask = camera.mask; + this.currentCameraMask.camera = camera._maskCamera; - this.pushScissor(cx, cy, cw, -ch); - - this.setFramebuffer(camera.framebuffer); - - var gl = this.gl; - - gl.clearColor(0, 0, 0, 0); - - gl.clear(gl.COLOR_BUFFER_BIT); - - ProjectOrtho(MultiPipeline, cx, cw + cx, cy, ch + cy, -1000, 1000); - - if (camera.mask) - { - this.currentCameraMask.mask = camera.mask; - this.currentCameraMask.camera = camera._maskCamera; - - camera.mask.preRenderWebGL(this, camera, camera._maskCamera); - } - - if (color.alphaGL > 0) - { - MultiPipeline.drawFillRect( - cx, cy, cw + cx, ch + cy, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } - - camera.emit(CameraEvents.PRE_RENDER, camera); + camera.mask.preRenderWebGL(this, camera, camera._maskCamera); } - else + + if (color.alphaGL > 0) { - this.pushScissor(cx, cy, cw, ch); + var pipeline = this.pipelines.setMulti(); - if (camera.mask) - { - this.currentCameraMask.mask = camera.mask; - this.currentCameraMask.camera = camera._maskCamera; - - camera.mask.preRenderWebGL(this, camera, camera._maskCamera); - } - - if (color.alphaGL > 0) - { - MultiPipeline.drawFillRect( - cx, cy, cw , ch, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } + pipeline.drawFillRect( + cx, cy, cw, ch, + Utils.getTintFromFloats(color.blueGL, color.greenGL, color.redGL, 1), + color.alphaGL + ); } }, @@ -122357,7 +128322,8 @@ var WebGLRenderer = new Class({ /** * Controls the post-render operations for the given camera. - * Renders the foreground camera effects like flash and fading. It resets the current scissor state. + * + * Renders the foreground camera effects like flash and fading, then resets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera * @since 3.0.0 @@ -122366,70 +128332,35 @@ var WebGLRenderer = new Class({ */ postRenderCamera: function (camera) { - var multiPipeline = this.pipelines.setMulti(); + if (camera.flashEffect.isRunning || camera.fadeEffect.isRunning) + { + var pipeline = this.pipelines.setMulti(); - camera.flashEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats); - camera.fadeEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats); + camera.flashEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats); + camera.fadeEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats); + } camera.dirty = false; this.popScissor(); - if (camera.renderToTexture) - { - multiPipeline.flush(); - - this.setFramebuffer(null); - - camera.emit(CameraEvents.POST_RENDER, camera); - - if (camera.renderToGame) - { - ProjectOrtho(multiPipeline, 0, multiPipeline.width, multiPipeline.height, 0, -1000.0, 1000.0); - - var getTint = Utils.getTintAppendFloatAlpha; - - var pipeline = (camera.pipeline) ? camera.pipeline : multiPipeline; - - pipeline.batchTexture( - camera, - camera.glTexture, - camera.width, camera.height, - camera.x, camera.y, - camera.width, camera.height, - 1, 1, - 0, - camera.flipX, !camera.flipY, - 1, 1, - 0, 0, - 0, 0, camera.width, camera.height, - getTint(camera._tintTL, camera._alphaTL), - getTint(camera._tintTR, camera._alphaTR), - getTint(camera._tintBL, camera._alphaBL), - getTint(camera._tintBR, camera._alphaBR), - (camera._isTinted && camera.tintFill), - 0, 0, - this.defaultCamera, - null - ); - } - - // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it - this.setBlankTexture(true); - } - if (camera.mask) { this.currentCameraMask.mask = null; camera.mask.postRenderWebGL(this, camera._maskCamera); } + + this.pipelines.postBatchCamera(camera); + + camera.emit(CameraEvents.POST_RENDER, camera); }, /** * Clears the current vertex buffer and updates pipelines. * * @method Phaser.Renderer.WebGL.WebGLRenderer#preRender + * @fires Phaser.Renderer.WebGL.Events#PRE_RENDER * @since 3.0.0 */ preRender: function () @@ -122452,13 +128383,10 @@ var WebGLRenderer = new Class({ gl.enable(gl.SCISSOR_TEST); - this.pipelines.preRender(); + this.currentScissor = this.defaultScissor; - // TODO - Find a way to stop needing to create these arrays every frame - // and equally not need a huge array buffer created to hold them - - this.currentScissor = [ 0, 0, this.width, this.height ]; - this.scissorStack = [ this.currentScissor ]; + this.scissorStack.length = 0; + this.scissorStack.push(this.currentScissor); if (this.game.scene.customViewports) { @@ -122471,13 +128399,13 @@ var WebGLRenderer = new Class({ this.textureFlush = 0; - this.pipelines.setMulti(); + this.emit(Events.PRE_RENDER); }, /** * The core render step for a Scene Camera. * - * Iterates through the given Game Object's array and renders them with the given Camera. + * Iterates through the given array of Game Objects and renders them with the given Camera. * * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked * by the Scene Systems.render method. @@ -122485,21 +128413,20 @@ var WebGLRenderer = new Class({ * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * * @method Phaser.Renderer.WebGL.WebGLRenderer#render + * @fires Phaser.Renderer.WebGL.Events#RENDER * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered. - * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used. + * @param {Phaser.GameObjects.GameObject[]} children - An array of filtered Game Objects that can be rendered by the given Camera. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ - render: function (scene, children, interpolationPercentage, camera) + render: function (scene, children, camera) { if (this.contextLost) { return; } - var list = children.list; - var childCount = list.length; + var childCount = children.length; - this.pipelines.render(scene, camera); + this.emit(Events.RENDER, scene, camera); // Apply scissor for cam region + render background color, if not transparent this.preRenderCamera(camera); @@ -122524,17 +128451,7 @@ var WebGLRenderer = new Class({ { this.finalType = (i === childCount - 1); - var child = list[i]; - - if (!child.willRender(camera)) - { - continue; - } - - if (child.blendMode !== this.currentBlendMode) - { - this.setBlendMode(child.blendMode); - } + var child = children[i]; var mask = child.mask; @@ -122551,6 +128468,11 @@ var WebGLRenderer = new Class({ mask.preRenderWebGL(this, child, camera); } + if (child.blendMode !== this.currentBlendMode) + { + this.setBlendMode(child.blendMode); + } + var type = child.type; if (type !== this.currentType) @@ -122559,9 +128481,16 @@ var WebGLRenderer = new Class({ this.currentType = type; } - this.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === this.currentType) : false; + if (!this.finalType) + { + this.nextTypeMatch = (children[i + 1].type === this.currentType); + } + else + { + this.nextTypeMatch = false; + } - child.renderWebGL(this, child, interpolationPercentage, camera); + child.renderWebGL(this, child, camera); this.newType = false; } @@ -122584,6 +128513,7 @@ var WebGLRenderer = new Class({ * The post-render step happens after all Cameras in all Scenes have been rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender + * @fires Phaser.Renderer.WebGL.Events#POST_RENDER * @since 3.0.0 */ postRender: function () @@ -122592,7 +128522,7 @@ var WebGLRenderer = new Class({ this.flush(); - // Unbind custom framebuffer here + this.emit(Events.POST_RENDER); var state = this.snapshotState; @@ -122603,8 +128533,6 @@ var WebGLRenderer = new Class({ state.callback = null; } - this.pipelines.postRender(); - if (this.textureFlush > 0) { this.startActiveTexture++; @@ -122655,10 +128583,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotArea * @since 3.16.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -122696,8 +128624,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotPixel * @since 3.16.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This WebGL Renderer. @@ -122725,14 +128653,14 @@ var WebGLRenderer = new Class({ * @since 3.19.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer to grab from. - * @param {integer} bufferWidth - The width of the framebuffer. - * @param {integer} bufferHeight - The height of the framebuffer. + * @param {number} bufferWidth - The width of the framebuffer. + * @param {number} bufferHeight - The height of the framebuffer. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? - * @param {integer} [x=0] - The x coordinate to grab from. - * @param {integer} [y=0] - The y coordinate to grab from. - * @param {integer} [width=bufferWidth] - The width of the area to grab. - * @param {integer} [height=bufferHeight] - The height of the area to grab. + * @param {number} [x=0] - The x coordinate to grab from. + * @param {number} [y=0] - The y coordinate to grab from. + * @param {number} [width=bufferWidth] - The width of the area to grab. + * @param {number} [height=bufferHeight] - The height of the area to grab. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. * @@ -122977,8 +128905,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter * @since 3.0.0 * - * @param {integer} texture - The texture to set the filter for. - * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. + * @param {number} texture - The texture to set the filter for. + * @param {number} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. * * @return {this} This WebGL Renderer instance. */ @@ -123004,403 +128932,6 @@ var WebGLRenderer = new Class({ return this; }, - /** - * Sets a 1f uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 1f value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat1: function (program, name, x) - { - this.setProgram(program); - - this.gl.uniform1f(this.gl.getUniformLocation(program, name), x); - - return this; - }, - - /** - * Sets the 2f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 2f x value to set on the named uniform. - * @param {number} y - The 2f y value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat2: function (program, name, x, y) - { - this.setProgram(program); - - this.gl.uniform2f(this.gl.getUniformLocation(program, name), x, y); - - return this; - }, - - /** - * Sets the 3f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 3f x value to set on the named uniform. - * @param {number} y - The 3f y value to set on the named uniform. - * @param {number} z - The 3f z value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat3: function (program, name, x, y, z) - { - this.setProgram(program); - - this.gl.uniform3f(this.gl.getUniformLocation(program, name), x, y, z); - - return this; - }, - - /** - * Sets the 4f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 4f x value to set on the named uniform. - * @param {number} y - The 4f y value to set on the named uniform. - * @param {number} z - The 4f z value to set on the named uniform. - * @param {number} w - The 4f w value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat4: function (program, name, x, y, z, w) - { - this.setProgram(program); - - this.gl.uniform4f(this.gl.getUniformLocation(program, name), x, y, z, w); - - return this; - }, - - /** - * Sets the value of a 1fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat1v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform1fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat2v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform2fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat3v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform3fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - - setFloat4v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform4fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets a 1iv uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1iv - * @since 3.50.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Int32List} arr - The 1iv value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt1iv: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform1iv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets a 1i uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 1i value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt1: function (program, name, x) - { - this.setProgram(program); - - this.gl.uniform1i(this.gl.getUniformLocation(program, name), x); - - return this; - }, - - /** - * Sets the 2i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 2i x value to set on the named uniform. - * @param {integer} y - The 2i y value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt2: function (program, name, x, y) - { - this.setProgram(program); - - this.gl.uniform2i(this.gl.getUniformLocation(program, name), x, y); - - return this; - }, - - /** - * Sets the 3i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 3i x value to set on the named uniform. - * @param {integer} y - The 3i y value to set on the named uniform. - * @param {integer} z - The 3i z value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt3: function (program, name, x, y, z) - { - this.setProgram(program); - - this.gl.uniform3i(this.gl.getUniformLocation(program, name), x, y, z); - - return this; - }, - - /** - * Sets the 4i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 4i x value to set on the named uniform. - * @param {integer} y - The 4i y value to set on the named uniform. - * @param {integer} z - The 4i z value to set on the named uniform. - * @param {integer} w - The 4i w value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt4: function (program, name, x, y, z, w) - { - this.setProgram(program); - - this.gl.uniform4i(this.gl.getUniformLocation(program, name), x, y, z, w); - - return this; - }, - - /** - * Sets the value of a matrix 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 4 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix2: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix2fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Sets the value of a matrix 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 9 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix3: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix3fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Sets the value of a matrix 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 16 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix4: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix4fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Returns the maximum number of texture units that can be used in a fragment shader. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextures - * @since 3.8.0 - * - * @return {integer} The maximum number of textures WebGL supports. - */ - getMaxTextures: function () - { - return this.config.maxTextures; - }, - /** * Returns the largest texture size (either width or height) that can be created. * Note that VRAM may not allow a texture of any given size, it just expresses @@ -123409,7 +128940,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextureSize * @since 3.8.0 * - * @return {integer} The maximum supported texture size. + * @return {number} The maximum supported texture size. */ getMaxTextureSize: function () { @@ -123424,46 +128955,34 @@ var WebGLRenderer = new Class({ */ destroy: function () { - // Clear-up anything that should be cleared :) + this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); + this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - var i; var gl = this.gl; var temp = this.tempTextures; - var native = this.nativeTextures; - for (i = 0; i < temp.length; i++) + for (var i = 0; i < temp.length; i++) { gl.deleteTexture(temp[i]); } - for (i = 0; i < native.length; i++) - { - gl.deleteTexture(native[i]); - } - - this.textureIndexes = []; - this.nativeTextures = []; - this.pipelines.destroy(); - this.defaultCamera.destroy(); + this.removeAllListeners(); + + this.fboStack = []; + this.maskStack = []; + this.extensions = {}; + this.textureIndexes = []; + + this.gl = null; + this.game = null; + this.canvas = null; + this.contextLost = true; this.currentMask = null; this.currentCameraMask = null; - - this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); - this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - - this.game = null; - this.gl = null; - this.canvas = null; - - this.maskStack = []; - - this.contextLost = true; - - this.extensions = {}; } }); @@ -123472,7 +128991,7 @@ module.exports = WebGLRenderer; /***/ }), -/* 536 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -123482,19 +129001,36 @@ module.exports = WebGLRenderer; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); -var CONST = __webpack_require__(110); +var CONST = __webpack_require__(82); +var CustomMap = __webpack_require__(98); // Default Phaser 3 Pipelines -var BitmapMaskPipeline = __webpack_require__(537); -var LightPipeline = __webpack_require__(538); -var MultiPipeline = __webpack_require__(112); -var RopePipeline = __webpack_require__(539); -var SinglePipeline = __webpack_require__(540); +var BitmapMaskPipeline = __webpack_require__(573); +var GraphicsPipeline = __webpack_require__(575); +var LightPipeline = __webpack_require__(576); +var MultiPipeline = __webpack_require__(158); +var RopePipeline = __webpack_require__(577); +var SinglePipeline = __webpack_require__(578); +var UtilityPipeline = __webpack_require__(864); /** * @classdesc + * The Pipeline Manager is responsible for the creation, activation, running and destruction + * of WebGL Pipelines in Phaser 3. * + * The `WebGLRenderer` owns a single instance of the Pipeline Manager, which you can access + * via the `WebGLRenderer.pipelines` property. + * + * By default, there are 5 pipelines installed into the Pipeline Manager when Phaser boots: + * + * 1. The Multi Pipeline. Responsible for all multi-texture rendering, i.e. Sprites, Shapes. + * 2. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. + * 3. The Rope Pipeline. Responsible for rendering the Rope Game Object. + * 4. The Light Pipeline. Responsible for rendering the Light Game Object. + * 5. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. + * + * You can add your own custom pipeline via the `PipelineManager.add` method. Pipelines are + * identified by unique string-based keys. * * @class PipelineManager * @memberof Phaser.Renderer.WebGL @@ -123527,12 +129063,31 @@ var PipelineManager = new Class({ */ this.renderer = renderer; + /** + * This map stores all pipeline classes available in this manager. + * + * The Utility Class must always come first. + * + * @name Phaser.Renderer.WebGL.PipelineManager#classes + * @type {Phaser.Structs.Map.} + * @since 3.50.0 + */ + this.classes = new CustomMap([ + [ CONST.UTILITY_PIPELINE, UtilityPipeline ], + [ CONST.MULTI_PIPELINE, MultiPipeline ], + [ CONST.BITMAPMASK_PIPELINE, BitmapMaskPipeline ], + [ CONST.SINGLE_PIPELINE, SinglePipeline ], + [ CONST.ROPE_PIPELINE, RopePipeline ], + [ CONST.LIGHT_PIPELINE, LightPipeline ], + [ CONST.GRAPHICS_PIPELINE, GraphicsPipeline ] + ]); + /** * This map stores all pipeline instances in this manager. * * This is populated with the default pipelines in the `boot` method. * - * @name Phaser.Renderer.WebGL.WebGLRenderer#pipelines + * @name Phaser.Renderer.WebGL.PipelineManager#pipelines * @type {Phaser.Structs.Map.} * @since 3.50.0 */ @@ -123585,6 +129140,80 @@ var PipelineManager = new Class({ * @since 3.50.0 */ this.BITMAPMASK_PIPELINE = null; + + /** + * A constant-style reference to the Utility Pipeline Instance. + * + * @name Phaser.Renderer.WebGL.PipelineManager#UTILITY_PIPELINE + * @type {Phaser.Renderer.WebGL.Pipelines.UtilityPipeline} + * @default null + * @since 3.50.0 + */ + this.UTILITY_PIPELINE = null; + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame2; }, /** @@ -123597,19 +129226,57 @@ var PipelineManager = new Class({ * * @method Phaser.Renderer.WebGL.PipelineManager#boot * @since 3.50.0 + * + * @param {Phaser.Types.Core.PipelineConfig} [pipelineConfig] - The pipeline configuration object as set in the Game Config. */ - boot: function () + boot: function (pipelineConfig) { + // Install each of the default pipelines + + var instance; + var _this = this; var game = this.game; - this.MULTI_PIPELINE = this.add(CONST.MULTI_PIPELINE, new MultiPipeline({ game: game })); - this.BITMAPMASK_PIPELINE = this.add(CONST.BITMAPMASK_PIPELINE, new BitmapMaskPipeline({ game: game })); + this.classes.each(function (name, pipeline) + { + instance = _this.add(name, new pipeline({ game: game })); - this.add(CONST.SINGLE_PIPELINE, new SinglePipeline({ game: game })); - this.add(CONST.ROPE_PIPELINE, new RopePipeline({ game: game })); - this.add(CONST.LIGHT_PIPELINE, new LightPipeline({ game: game })); + if (name === CONST.UTILITY_PIPELINE) + { + _this.UTILITY_PIPELINE = instance; - this.set(this.MULTI_PIPELINE); + // FBO references + _this.fullFrame1 = instance.fullFrame1; + _this.fullFrame2 = instance.fullFrame2; + _this.halfFrame1 = instance.halfFrame1; + _this.halfFrame2 = instance.halfFrame2; + } + }); + + // Our const-like references + this.MULTI_PIPELINE = this.get(CONST.MULTI_PIPELINE); + this.BITMAPMASK_PIPELINE = this.get(CONST.BITMAPMASK_PIPELINE); + + // And now the ones in the config, if any + if (pipelineConfig) + { + for (var pipelineName in pipelineConfig) + { + var pipelineClass = pipelineConfig[pipelineName]; + + if (!this.has(pipelineName)) + { + this.classes.set(pipelineName, pipelineClass); + + instance = new pipelineClass(game); + + if (!instance.isPostFX) + { + this.add(pipelineName, instance); + } + } + } + } }, /** @@ -123617,13 +129284,23 @@ var PipelineManager = new Class({ * * The name of the instance must be unique within this manager. * - * Make sure to pass an instance to this method, not a base class. For example: + * Make sure to pass an instance to this method, not a base class. + * + * For example, you should pass it like this: * * ```javascript - * this.add('yourName', new MultiPipeline());` + * this.add('yourName', new CustomPipeline());` * ``` * - * @method Phaser.Renderer.WebGL.PipelineManager#addPipeline + * and **not** like this: + * + * ```javascript + * this.add('yourName', CustomPipeline);` + * ``` + * + * To add a **Post Pipeline**, see `addPostPipeline` instead. + * + * @method Phaser.Renderer.WebGL.PipelineManager#add * @since 3.50.0 * * @param {string} name - A unique string-based key for the pipeline within the manager. @@ -123633,11 +129310,21 @@ var PipelineManager = new Class({ */ add: function (name, pipeline) { + if (pipeline.isPostFX) + { + console.warn(name + ' is a Post Pipeline. Use `addPostPipeline` instead'); + + return; + } + var pipelines = this.pipelines; var renderer = this.renderer; if (!pipelines.has(name)) { + pipeline.name = name; + pipeline.manager = this; + pipelines.set(name, pipeline); } else @@ -123645,95 +129332,52 @@ var PipelineManager = new Class({ console.warn('Pipeline exists: ' + name); } - pipeline.name = name; - if (!pipeline.hasBooted) { pipeline.boot(); } - pipeline.resize(renderer.width, renderer.height, renderer.config.resolution); + if (renderer.width !== 0 && renderer.height !== 0) + { + pipeline.resize(renderer.width, renderer.height); + } return pipeline; }, /** - * Resizes handler. + * Adds a Post Pipeline to this Pipeline Manager. * - * This is called automatically by the `WebGLRenderer` when the game resizes. + * Make sure to pass a base class to this method, not an instance. * - * @method Phaser.Renderer.WebGL.PipelineManager#resize + * For example, you should pass it like this: + * + * ```javascript + * this.addPostPipeline('yourName', CustomPipeline);` + * ``` + * + * and **not** like this: + * + * ```javascript + * this.addPostPipeline('yourName', new CustomPipeline());` + * ``` + * + * To add a regular pipeline, see the `add` method instead. + * + * @method Phaser.Renderer.WebGL.PipelineManager#addPostPipeline * @since 3.50.0 * - * @param {number} [width] - The new width of the renderer. - * @param {number} [height] - The new height of the renderer. - * @param {number} [resolution] - The new resolution of the renderer. + * @param {string} name - A unique string-based key for the pipeline within the manager. + * @param {function} pipeline - A pipeline class which must extend `PostFXPipeline`. + * + * @return {this} This Pipeline Manager. */ - resize: function (width, height, resolution) + addPostPipeline: function (name, pipeline) { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) + if (!this.classes.has(name)) { - pipelineInstance.resize(width, height, resolution); - }); - }, - - /** - * Calls the `onPreRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.preRender` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#preRender - * @since 3.50.0 - */ - preRender: function () - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onPreRender(); - }); - }, - - /** - * Calls the `onRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.render` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#render - * @since 3.50.0 - * - * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. - */ - render: function (scene, camera) - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onRender(scene, camera); - }); - }, - - /** - * Calls the `onPostRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.postRender` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#postRender - * @since 3.50.0 - */ - postRender: function () - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onPostRender(); - }); + this.classes.set(name, pipeline); + } }, /** @@ -123751,39 +129395,109 @@ var PipelineManager = new Class({ }, /** - * Checks if a pipeline is present in the Pipeline Manager. + * Checks if a pipeline is present in this Pipeline Manager. * * @method Phaser.Renderer.WebGL.PipelineManager#has * @since 3.50.0 * - * @param {string} name - The name of the pipeline to check for. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance to look-up. * * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`. */ - has: function (name) + has: function (pipeline) { - return this.pipelines.has(name); + var pipelines = this.pipelines; + + if (typeof pipeline === 'string') + { + return pipelines.has(pipeline); + } + else if (pipelines.contains(pipeline)) + { + return true; + } + + return false; }, /** - * Returns the pipeline instance based on the given name. + * Returns the pipeline instance based on the given name, or instance. * - * If no instance exists in this manager, it returns `undefined` instead. + * If no instance, or matching name, exists in this manager, it returns `undefined`. * * @method Phaser.Renderer.WebGL.PipelineManager#get * @since 3.50.0 * - * @param {string} name - The name of the pipeline to get. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance to look-up. * * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `undefined` if not found. */ - get: function (name) + get: function (pipeline) { - return this.pipelines.get(name); + var pipelines = this.pipelines; + + if (typeof pipeline === 'string') + { + return pipelines.get(pipeline); + } + else if (pipelines.contains(pipeline)) + { + return pipeline; + } }, /** - * Removes a pipeline based on the given name. + * Returns a _new instance_ of the post pipeline based on the given name, or class. + * + * If no instance, or matching name, exists in this manager, it returns `undefined`. + * + * @method Phaser.Renderer.WebGL.PipelineManager#getPostPipeline + * @since 3.50.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance, or class to look-up. + * @param {Phaser.GameObjects.GameObject} [gameObject] - If this post pipeline is being installed into a Game Object or Camera, this is a reference to it. + * + * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The pipeline instance, or `undefined` if not found. + */ + getPostPipeline: function (pipeline, gameObject) + { + var pipelineClasses = this.classes; + + var instance; + + if (typeof pipeline === 'string') + { + instance = pipelineClasses.get(pipeline); + } + else if (typeof pipeline === 'function') + { + // A class + if (pipelineClasses.contains(pipeline)) + { + instance = pipeline; + } + } + else if (typeof pipeline === 'object') + { + // Instance + instance = pipelineClasses.get(pipeline.name); + } + + if (instance) + { + var newPipeline = new instance(this.game); + + if (gameObject) + { + newPipeline.gameObject = gameObject; + } + + return newPipeline; + } + }, + + /** + * Removes a pipeline instance based on the given name. * * If no pipeline matches the name, this method does nothing. * @@ -123794,10 +129508,18 @@ var PipelineManager = new Class({ * @since 3.50.0 * * @param {string} name - The name of the pipeline to be removed. + * @param {boolean} [removeClass=true] - Remove the class as well as the instance? */ - remove: function (name) + remove: function (name, removeClass) { + if (removeClass === undefined) { removeClass = true; } + this.pipelines.delete(name); + + if (removeClass) + { + this.classes.delete(name); + } }, /** @@ -123805,33 +129527,39 @@ var PipelineManager = new Class({ * * This method accepts a pipeline instance as its parameter, not the name. * - * If the pipeline isn't already the current one, it will also call `resetTextures` on - * the `WebGLRenderer`. After this, `WebGLPipeline.bind` and then `onBind` are called. + * If the pipeline isn't already the current one it will call `WebGLPipeline.bind` and then `onBind`. + * + * You cannot set Post FX Pipelines using this method. To use a Post FX Pipeline, you should + * apply it to either a Camera, Container or other supporting Game Object. * * @method Phaser.Renderer.WebGL.PipelineManager#set * @since 3.50.0 * * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline instance to be set as current. * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was set. + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was set, or undefined if it couldn't be set. */ - set: function (pipeline, gameObject) + set: function (pipeline, gameObject, currentShader) { - var renderer = this.renderer; - var current = this.current; - - if ( - current !== pipeline || - current.vertexBuffer !== renderer.currentVertexBuffer || - current.program !== renderer.currentProgram - ) + if (pipeline.isPostFX) { - renderer.resetTextures(); + return; + } + + if (!this.isCurrent(pipeline, currentShader)) + { + this.flush(); + + if (this.current) + { + this.current.unbind(); + } this.current = pipeline; - pipeline.bind(); + pipeline.bind(currentShader); } pipeline.onBind(gameObject); @@ -123839,6 +129567,307 @@ var PipelineManager = new Class({ return pipeline; }, + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. It causes a batch + * flush, then calls the `preBatch` method on the post-fx pipelines belonging to the + * Game Object. + * + * @method Phaser.Renderer.WebGL.PipelineManager#preBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object about to be batched. + */ + preBatch: function (gameObject) + { + if (gameObject.hasPostPipeline) + { + this.flush(); + + var pipelines = gameObject.postPipelines; + + // Iterate in reverse because we need them stacked in the order they're in the array + for (var i = pipelines.length - 1; i >= 0; i--) + { + pipelines[i].preBatch(gameObject); + } + } + }, + + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. It causes a batch + * flush, then calls the `postBatch` method on the post-fx pipelines belonging to the + * Game Object. + * + * @method Phaser.Renderer.WebGL.PipelineManager#postBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to the batch. + */ + postBatch: function (gameObject) + { + if (gameObject.hasPostPipeline) + { + this.flush(); + + var pipelines = gameObject.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].postBatch(gameObject); + } + } + }, + + /** + * Called at the start of the `WebGLRenderer.preRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `preBatch` method on the post-fx pipelines belonging to the Camera. + * + * @method Phaser.Renderer.WebGL.PipelineManager#preBatchCamera + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera about to be rendered. + */ + preBatchCamera: function (camera) + { + if (camera.hasPostPipeline) + { + this.flush(); + + var pipelines = camera.postPipelines; + + // Iterate in reverse because we need them stacked in the order they're in the array + for (var i = pipelines.length - 1; i >= 0; i--) + { + pipelines[i].preBatch(camera); + } + } + }, + + /** + * Called at the end of the `WebGLRenderer.postRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `postBatch` method on the post-fx pipelines belonging to the Camera. + * + * @method Phaser.Renderer.WebGL.PipelineManager#postBatchCamera + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that was just rendered. + */ + postBatchCamera: function (camera) + { + if (camera.hasPostPipeline) + { + this.flush(); + + var pipelines = camera.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].postBatch(camera); + } + } + }, + + /** + * Checks to see if the given pipeline is already the active pipeline, both within this + * Pipeline Manager, and also has the same vertex buffer and shader set within the Renderer. + * + * @method Phaser.Renderer.WebGL.PipelineManager#isCurrent + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline instance to be checked. + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {boolean} `true` if the given pipeline is already the current pipeline, otherwise `false`. + */ + isCurrent: function (pipeline, currentShader) + { + var renderer = this.renderer; + var current = this.current; + + if (current && !currentShader) + { + currentShader = current.currentShader; + } + + return !( + current !== pipeline || + current.vertexBuffer !== renderer.currentVertexBuffer || + currentShader.program !== renderer.currentProgram + ); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * The copy itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.copyShader); + + pipeline.copyFrame(source, target, brightness, clear, clearAlpha); + + return this; + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.PipelineManager#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.copyShader); + + pipeline.copyToGame(source); + + return this; + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * The copy itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Display.ColorMatrix} [colorMatrix] - The Color Matrix to use when performing the draw. + * + * @return {this} This Pipeline Manager instance. + */ + drawFrame: function (source, target, clearAlpha, colorMatrix) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader); + + pipeline.drawFrame(source, target, clearAlpha, colorMatrix); + + return this; + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + blendFrames: function (source1, source2, target, strength, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.linearShader); + + pipeline.blendFrames(source1, source2, target, strength, clearAlpha); + + return this; + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.addShader); + + pipeline.blendFrames(source1, source2, target, strength, clearAlpha); + + return this; + }, + + /** + * Clears the given Render Target. + * + * @method Phaser.Renderer.WebGL.PipelineManager#clearFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to clear. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + clearFrame: function (target, clearAlpha) + { + this.UTILITY_PIPELINE.clearFrame(target, clearAlpha); + + return this; + }, + + /** + * Returns `true` if the current pipeline is forced to use texture unit zero. + * + * @method Phaser.Renderer.WebGL.PipelineManager#forceZero + * @since 3.50.0 + * + * @return {boolean} `true` if the current pipeline is forced to use texture unit zero. + */ + forceZero: function () + { + return (this.current && this.current.forceZero); + }, + /** * Sets the Multi Pipeline to be the currently bound pipeline. * @@ -123854,6 +129883,21 @@ var PipelineManager = new Class({ return this.set(this.MULTI_PIPELINE); }, + /** + * Sets the Utility Pipeline to be the currently bound pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#setUtility + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {Phaser.Renderer.WebGL.Pipelines.UtilityPipeline} The Utility Pipeline instance. + */ + setUtility: function (currentShader) + { + return this.UTILITY_PIPELINE.bind(currentShader); + }, + /** * Use this to reset the gl context to the state that Phaser requires to continue rendering. * @@ -123911,12 +129955,9 @@ var PipelineManager = new Class({ renderer.setBlendMode(0, true); - renderer.resetTextures(); - this.current = pipeline; - pipeline.bind(true); - pipeline.onBind(); + pipeline.rebind(); }, /** @@ -123957,10 +129998,12 @@ var PipelineManager = new Class({ { this.flush(); + this.classes.clear(); this.pipelines.clear(); this.renderer = null; this.game = null; + this.classes = null; this.pipelines = null; this.current = null; this.previous = null; @@ -123972,7 +130015,7 @@ module.exports = PipelineManager; /***/ }), -/* 537 */ +/* 573 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -123984,9 +130027,10 @@ module.exports = PipelineManager; var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var ShaderSourceFS = __webpack_require__(807); -var ShaderSourceVS = __webpack_require__(808); -var WebGLPipeline = __webpack_require__(111); +var ShaderSourceFS = __webpack_require__(853); +var ShaderSourceVS = __webpack_require__(854); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); /** * @classdesc @@ -124027,50 +130071,38 @@ var BitmapMaskPipeline = new Class({ { config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS), config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS), - config.vertexSize = GetFastValue(config, 'vertexSize', 8), - config.vertexCapacity = GetFastValue(config, 'vertexCapacity', 3), + config.batchSize = GetFastValue(config, 'batchSize', 1), config.vertices = GetFastValue(config, 'vertices', new Float32Array([ -1, 1, -1, -7, 7, 1 ]).buffer), config.attributes = GetFastValue(config, 'attributes', [ { name: 'inPosition', size: 2, - type: config.game.renderer.gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 + type: WEBGL_CONST.FLOAT } ]); + config.uniforms = GetFastValue(config, 'uniforms', [ + 'uResolution', + 'uMainSampler', + 'uMaskSampler', + 'uInvertMaskAlpha' + ]); WebGLPipeline.call(this, config); }, - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) + boot: function () { - if (reset === undefined) { reset = false; } + WebGLPipeline.prototype.boot.call(this); - WebGLPipeline.prototype.bind.call(this, reset); + this.set1i('uMainSampler', 0); + this.set1i('uMaskSampler', 1); + }, - var renderer = this.renderer; - var program = this.program; + resize: function (width, height) + { + WebGLPipeline.prototype.resize.call(this, width, height); - renderer.setFloat2(program, 'uResolution', this.width, this.height); - renderer.setInt1(program, 'uMainSampler', 0); - renderer.setInt1(program, 'uMaskSampler', 1); - - return this; + this.set2f('uResolution', width, height); }, /** @@ -124086,24 +130118,19 @@ var BitmapMaskPipeline = new Class({ */ beginMask: function (mask, maskedObject, camera) { - var renderer = this.renderer; var gl = this.gl; // The renderable Game Object that is being used for the bitmap mask - var bitmapMask = mask.bitmapMask; - - if (bitmapMask && gl) + if (mask.bitmapMask && gl) { + var renderer = this.renderer; + renderer.flush(); - mask.prevFramebuffer = renderer.currentFramebuffer; - - renderer.setFramebuffer(mask.mainFramebuffer); + renderer.pushFramebuffer(mask.mainFramebuffer); gl.disable(gl.STENCIL_TEST); - gl.clearColor(0, 0, 0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); if (renderer.currentCameraMask.mask !== mask) @@ -124135,21 +130162,25 @@ var BitmapMaskPipeline = new Class({ if (bitmapMask && gl) { + // mask.mainFramebuffer should now contain all the Game Objects we want masked renderer.flush(); - // First we draw the mask to the mask fb - renderer.setFramebuffer(mask.maskFramebuffer); + // Swap to the mask framebuffer (push, in case the bitmapMask GO has a post-pipeline) + renderer.pushFramebuffer(mask.maskFramebuffer); + // Clear it and draw the Game Object that is acting as a mask to it gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT); renderer.setBlendMode(0, true); - bitmapMask.renderWebGL(renderer, bitmapMask, 0, camera); + bitmapMask.renderWebGL(renderer, bitmapMask, camera); renderer.flush(); - renderer.setFramebuffer(mask.prevFramebuffer); + // Clear the mask framebuffer + main framebuffer + renderer.popFramebuffer(); + renderer.popFramebuffer(); // Is there a stencil further up the stack? var prev = renderer.getCurrentStencilMask(); @@ -124165,7 +130196,7 @@ var BitmapMaskPipeline = new Class({ renderer.currentMask.mask = null; } - // Bind bitmap mask pipeline and draw + // Bind this pipeline and draw renderer.pipelines.set(this); gl.activeTexture(gl.TEXTURE1); @@ -124174,10 +130205,12 @@ var BitmapMaskPipeline = new Class({ gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, mask.mainTexture); - gl.uniform1i(gl.getUniformLocation(this.program, 'uInvertMaskAlpha'), mask.invertAlpha); + this.set1i('uInvertMaskAlpha', mask.invertAlpha); // Finally, draw a triangle filling the whole screen gl.drawArrays(this.topology, 0, 3); + + renderer.resetTextures(); } } @@ -124187,7 +130220,1720 @@ module.exports = BitmapMaskPipeline; /***/ }), -/* 538 */ +/* 574 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); +var WEBGL_CONST = __webpack_require__(74); + +/** + * @classdesc + * TODO + * + * @class WebGLShader + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The WebGLPipeline to which this Shader belongs. + * @param {string} name - The name of this Shader. + * @param {string} vertexShader - The vertex shader source code as a single string. + * @param {string} fragmentShader - The fragment shader source code as a single string. + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]} attributes - An array of attributes. + * @param {string[]} [uniforms] - An array of shader uniform names that will be looked-up to get the locations for. + */ +var WebGLShader = new Class({ + + initialize: + + function WebGLShader (pipeline, name, vertexShader, fragmentShader, attributes, uniforms) + { + /** + * A reference to the WebGLPipeline that owns this Shader. + * + * A Shader class can only belong to a single pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLShader#pipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @since 3.50.0 + */ + this.pipeline = pipeline; + + /** + * The name of this shader. + * + * @name Phaser.Renderer.WebGL.WebGLShader#name + * @type {string} + * @since 3.50.0 + */ + this.name = name; + + /** + * A reference to the WebGLRenderer instance. + * + * @name Phaser.Renderer.WebGL.WebGLShader#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.50.0 + */ + this.renderer = pipeline.renderer; + + /** + * A reference to the WebGL Rendering Context the WebGL Renderer is using. + * + * @name Phaser.Renderer.WebGL.WebGLShader#gl + * @type {WebGLRenderingContext} + * @since 3.50.0 + */ + this.gl = this.renderer.gl; + + /** + * The WebGLProgram created from the vertex and fragment shaders. + * + * @name Phaser.Renderer.WebGL.WebGLShader#program + * @type {WebGLProgram} + * @since 3.50.0 + */ + this.program = this.renderer.createProgram(vertexShader, fragmentShader); + + /** + * Array of objects that describe the vertex attributes. + * + * @name Phaser.Renderer.WebGL.WebGLShader#attributes + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineAttribute[]} + * @since 3.50.0 + */ + this.attributes; + + /** + * The amount of vertex attribute components of 32 bit length. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertexComponentCount + * @type {number} + * @since 3.50.0 + */ + this.vertexComponentCount = 0; + + /** + * The size, in bytes, of a single vertex. + * + * This is derived by adding together all of the vertex attributes. + * + * For example, the Multi Pipeline has the following attributes: + * + * inPosition - (size 2 x gl.FLOAT) = 8 + * inTexCoord - (size 2 x gl.FLOAT) = 8 + * inTexId - (size 1 x gl.FLOAT) = 4 + * inTintEffect - (size 1 x gl.FLOAT) = 4 + * inTint - (size 4 x gl.UNSIGNED_BYTE) = 4 + * + * The total, in this case, is 8 + 8 + 4 + 4 + 4 = 28. + * + * This is calculated automatically during the `createAttributes` method. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertexSize + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.vertexSize = 0; + + /** + * The uniforms that this shader requires, as set via the configuration object. + * + * This is an object that maps the uniform names to their WebGL location. + * + * It is populated with their locations via the `setUniformLocations` method. + * + * @name Phaser.Renderer.WebGL.WebGLShader#uniforms + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineUniformsConfig} + * @since 3.50.0 + */ + this.uniforms = {}; + + this.createAttributes(attributes); + + if (uniforms) + { + this.setUniformLocations(uniforms); + } + }, + + /** + * Takes the vertex attributes config and parses it, creating the resulting array that is stored + * in this shaders `attributes` property, calculating the offset, normalization and location + * in the process. + * + * Calling this method resets `WebGLShader.attributes`, `WebGLShader.vertexSize` and + * `WebGLShader.vertexComponentCount`. + * + * It is called automatically when this class is created, but can be called manually if required. + * + * @method Phaser.Renderer.WebGL.WebGLShader#createAttributes + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]} attributes - An array of attributes configs. + */ + createAttributes: function (attributes) + { + var count = 0; + var offset = 0; + var result = []; + + this.vertexComponentCount = 0; + + for (var i = 0; i < attributes.length; i++) + { + var element = attributes[i]; + + var name = element.name; + var size = element.size; // i.e. 1 for a float, 2 for a vec2, 4 for a vec4, etc + var glType = GetFastValue(element, 'type', WEBGL_CONST.FLOAT); + var type = glType.enum; // The GLenum + var typeSize = glType.size; // The size in bytes of the type + + var normalized = (element.normalized) ? true : false; + + result.push({ + name: name, + size: size, + type: type, + normalized: normalized, + offset: offset, + enabled: false, + location: -1 + }); + + if (typeSize === 4) + { + count += size; + } + else + { + count++; + } + + offset += size * typeSize; + } + + this.vertexSize = offset; + this.vertexComponentCount = count; + this.attributes = result; + }, + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * This method is called every time the parent pipeline is made the current active pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLShader#bind + * @since 3.50.0 + * + * @param {boolean} [setAttributes=false] - Should the vertex attribute pointers be set? + * @param {boolean} [flush=false] - Flush the pipeline before binding this shader? + * + * @return {this} This WebGLShader instance. + */ + bind: function (setAttributes, flush) + { + if (setAttributes === undefined) { setAttributes = false; } + if (flush === undefined) { flush = false; } + + if (flush) + { + this.pipeline.flush(); + } + + this.renderer.setProgram(this.program); + + if (setAttributes) + { + this.setAttribPointers(); + } + + return this; + }, + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * Then resets all of the attribute pointers. + * + * @method Phaser.Renderer.WebGL.WebGLShader#rebind + * @since 3.50.0 + * + * @return {this} This WebGLShader instance. + */ + rebind: function () + { + this.renderer.setProgram(this.program); + + this.setAttribPointers(true); + + return this; + }, + + /** + * Sets the vertex attribute pointers. + * + * This should only be called after the vertex buffer has been bound. + * + * It is called automatically during the `bind` method. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setAttribPointers + * @since 3.50.0 + * + * @param {boolean} [reset=false] - Reset the vertex attribute locations? + * + * @return {this} This WebGLShader instance. + */ + setAttribPointers: function (reset) + { + if (reset === undefined) { reset = false; } + + var gl = this.gl; + var vertexSize = this.vertexSize; + var attributes = this.attributes; + var program = this.program; + + for (var i = 0; i < attributes.length; i++) + { + var element = attributes[i]; + + var size = element.size; + var type = element.type; + var offset = element.offset; + var enabled = element.enabled; + var location = element.location; + var normalized = (element.normalized) ? true : false; + + if (reset) + { + var attribLocation = gl.getAttribLocation(program, element.name); + + if (attribLocation >= 0) + { + gl.enableVertexAttribArray(attribLocation); + + gl.vertexAttribPointer(attribLocation, size, type, normalized, vertexSize, offset); + + element.enabled = true; + element.location = attribLocation; + } + else if (attribLocation !== -1) + { + gl.disableVertexAttribArray(attribLocation); + } + } + else if (enabled) + { + gl.vertexAttribPointer(location, size, type, normalized, vertexSize, offset); + } + else if (!enabled && location > -1) + { + gl.disableVertexAttribArray(location); + + element.location = -1; + } + } + + return this; + }, + + /** + * Sets up the `WebGLShader.uniforms` object, populating it with the names + * and locations of the shader uniforms this shader requires. + * + * This method is called automatically when this class is created. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniformLocations + * @since 3.50.0 + * + * @param {string[]} uniformNames - An array of the uniform names to get the locations for. + * + * @return {this} This WebGLShader instance. + */ + setUniformLocations: function (uniformNames) + { + var gl = this.gl; + var program = this.program; + var uniforms = this.uniforms; + + for (var i = 0; i < uniformNames.length; i++) + { + var name = uniformNames[i]; + + var location = gl.getUniformLocation(program, name); + + if (location !== null) + { + uniforms[name] = + { + name: name, + location: location, + value1: null, + value2: null, + value3: null, + value4: null + }; + } + } + + return this; + }, + + /** + * Checks to see if the given uniform name exists and is active in this shader. + * + * @method Phaser.Renderer.WebGL.WebGLShader#hasUniform + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to check for. + * + * @return {boolean} `true` if the uniform exists, otherwise `false`. + */ + hasUniform: function (name) + { + return this.uniforms.hasOwnProperty(name); + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform1 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform1: function (setter, name, value1) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1) + { + uniform.value1 = value1; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform2 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform2: function (setter, name, value1, value2) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2) + { + uniform.value1 = value1; + uniform.value2 = value2; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform3 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value3 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform3: function (setter, name, value1, value2, value3) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2 || uniform.value3 !== value3) + { + uniform.value1 = value1; + uniform.value2 = value2; + uniform.value3 = value3; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2, value3); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform4 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value3 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value4 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform4: function (setter, name, value1, value2, value3, value4) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2 || uniform.value3 !== value3 || uniform.value4 !== value4) + { + uniform.value1 = value1; + uniform.value2 = value2; + uniform.value3 = value3; + uniform.value4 = value4; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2, value3, value4); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets a 1f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `float` uniform. + * + * @return {this} This WebGLShader instance. + */ + set1f: function (name, x) + { + return this.setUniform1(this.gl.uniform1f, name, x); + }, + + /** + * Sets a 2f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec2` uniform. + * @param {number} y - The new Y component of the `vec2` uniform. + * + * @return {this} This WebGLShader instance. + */ + set2f: function (name, x, y) + { + return this.setUniform2(this.gl.uniform2f, name, x, y); + }, + + /** + * Sets a 3f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec3` uniform. + * @param {number} y - The new Y component of the `vec3` uniform. + * @param {number} z - The new Z component of the `vec3` uniform. + * + * @return {this} This WebGLShader instance. + */ + set3f: function (name, x, y, z) + { + return this.setUniform3(this.gl.uniform3f, name, x, y, z); + }, + + /** + * Sets a 4f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * + * @return {this} This WebGLShader instance. + */ + set4f: function (name, x, y, z, w) + { + return this.setUniform4(this.gl.uniform4f, name, x, y, z, w); + }, + + /** + * Sets a 1fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set1fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform1fv, name, arr); + }, + + /** + * Sets a 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set2fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform2fv, name, arr); + }, + + /** + * Sets a 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set3fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform3fv, name, arr); + }, + + /** + * Sets a 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set4fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform4fv, name, arr); + }, + + /** + * Sets a 1iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set1iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform1iv, name, arr); + }, + + /** + * Sets a 2iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set2iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform2iv, name, arr); + }, + + /** + * Sets a 3iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set3iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform3iv, name, arr); + }, + + /** + * Sets a 4iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set4iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform4iv, name, arr); + }, + + /** + * Sets a 1i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `int` uniform. + * + * @return {this} This WebGLShader instance. + */ + set1i: function (name, x) + { + return this.setUniform1(this.gl.uniform1i, name, x); + }, + + /** + * Sets a 2i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec2` uniform. + * @param {number} y - The new Y component of the `ivec2` uniform. + * + * @return {this} This WebGLShader instance. + */ + set2i: function (name, x, y) + { + return this.setUniform2(this.gl.uniform2i, name, x, y); + }, + + /** + * Sets a 3i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec3` uniform. + * @param {number} y - The new Y component of the `ivec3` uniform. + * @param {number} z - The new Z component of the `ivec3` uniform. + * + * @return {this} This WebGLShader instance. + */ + set3i: function (name, x, y, z) + { + return this.setUniform3(this.gl.uniform3i, name, x, y, z); + }, + + /** + * Sets a 4i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * + * @return {this} This WebGLShader instance. + */ + set4i: function (name, x, y, z, w) + { + return this.setUniform4(this.gl.uniform4i, name, x, y, z, w); + }, + + /** + * Sets a matrix 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {number[]|Float32Array} matrix - The new values for the `mat2` uniform. + * + * @return {this} This WebGLShader instance. + */ + setMatrix2fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix2fv, name, transpose, matrix); + }, + + /** + * Sets a matrix 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {Float32Array} matrix - The new values for the `mat3` uniform. + * + * @return {this} This WebGLShader instance. + */ + setMatrix3fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix3fv, name, transpose, matrix); + }, + + /** + * Sets a matrix 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Should the matrix be transpose + * @param {Float32Array} matrix - Matrix data + * + * @return {this} This WebGLShader instance. + */ + setMatrix4fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix4fv, name, transpose, matrix); + }, + + /** + * Removes all external references from this class and deletes the WebGL program from the WebGL context. + * + * Does not remove this shader from the parent pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLShader#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.gl.deleteProgram(this.program); + + this.pipeline = null; + this.renderer = null; + this.gl = null; + this.program = null; + this.attributes = null; + this.uniforms = null; + } + +}); + +module.exports = WebGLShader; + + +/***/ }), +/* 575 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Earcut = __webpack_require__(65); +var GetFastValue = __webpack_require__(2); +var ShaderSourceFS = __webpack_require__(855); +var ShaderSourceVS = __webpack_require__(856); +var TransformMatrix = __webpack_require__(24); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); + +/** + * @classdesc + * The Graphics Pipeline is the rendering pipeline used by Phaser in WebGL when drawing + * primitive geometry objects, such as the Graphics Game Object, or the Shape Game Objects + * such as Arc, Line, Rectangle and Star. It handles the preperation and batching of related vertices. + * + * Prior to Phaser v3.50 the functions of this pipeline were merged with the `TextureTintPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Graphics.frag`. + * The vertex shader it uses can be found in `shaders/src/Graphics.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2) + * `inColor` (vec4, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * + * @class GraphicsPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var GraphicsPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function GraphicsPipeline (config) + { + config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); + config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inColor', + size: 4, + type: WEBGL_CONST.UNSIGNED_BYTE, + normalized: true + } + ]); + config.uniforms = GetFastValue(config, 'uniforms', [ + 'uProjectionMatrix' + ]); + + WebGLPipeline.call(this, config); + + /** + * A temporary Transform Matrix, re-used internally during batching by the + * Shape Game Objects. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#calcMatrix + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.50.0 + */ + this.calcMatrix = new TransformMatrix(); + + /** + * Used internally to draw stroked triangles. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#tempTriangle + * @type {array} + * @private + * @since 3.50.0 + */ + this.tempTriangle = [ + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 } + ]; + + /** + * Cached stroke tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#strokeTint + * @type {object} + * @private + * @since 3.50.0 + */ + this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Cached fill tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#fillTint + * @type {object} + * @private + * @since 3.50.0 + */ + this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Internal texture frame reference. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#currentFrame + * @type {Phaser.Textures.Frame} + * @private + * @since 3.50.0 + */ + this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#firstQuad + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.firstQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#prevQuad + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.prevQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Used internally for triangulating a polygon. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#polygonCache + * @type {array} + * @private + * @since 3.50.0 + */ + this.polygonCache = []; + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * + * Rectangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillRect + * @since 3.50.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var xw = x + width; + var yh = y + height; + + var x0 = calcMatrix.getX(x, y); + var y0 = calcMatrix.getY(x, y); + + var x1 = calcMatrix.getX(x, yh); + var y1 = calcMatrix.getY(x, yh); + + var x2 = calcMatrix.getX(xw, yh); + var y2 = calcMatrix.getY(xw, yh); + + var x3 = calcMatrix.getX(xw, y); + var y3 = calcMatrix.getY(xw, y); + + var tint = this.fillTint; + + this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint.TL, tint.TR, tint.BL, tint.BR); + }, + + /** + * Pushes a filled triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillTriangle + * @since 3.50.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + var tint = this.fillTint; + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tint.TL, tint.TR, tint.BL); + }, + + /** + * Pushes a stroked triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokeTriangle + * @since 3.50.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {number} lineWidth - The width of the line in pixels. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) + { + var tempTriangle = this.tempTriangle; + + tempTriangle[0].x = x0; + tempTriangle[0].y = y0; + tempTriangle[0].width = lineWidth; + + tempTriangle[1].x = x1; + tempTriangle[1].y = y1; + tempTriangle[1].width = lineWidth; + + tempTriangle[2].x = x2; + tempTriangle[2].y = y2; + tempTriangle[2].width = lineWidth; + + tempTriangle[3].x = x0; + tempTriangle[3].y = y0; + tempTriangle[3].width = lineWidth; + + this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillPath + * @since 3.50.0 + * + * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillPath: function (path, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var length = path.length; + var polygonCache = this.polygonCache; + var polygonIndexArray; + var point; + + var tintTL = this.fillTint.TL; + var tintTR = this.fillTint.TR; + var tintBL = this.fillTint.BL; + + for (var pathIndex = 0; pathIndex < length; ++pathIndex) + { + point = path[pathIndex]; + polygonCache.push(point.x, point.y); + } + + polygonIndexArray = Earcut(polygonCache); + length = polygonIndexArray.length; + + for (var index = 0; index < length; index += 3) + { + var p0 = polygonIndexArray[index + 0] * 2; + var p1 = polygonIndexArray[index + 1] * 2; + var p2 = polygonIndexArray[index + 2] * 2; + + var x0 = polygonCache[p0 + 0]; + var y0 = polygonCache[p0 + 1]; + var x1 = polygonCache[p1 + 0]; + var y1 = polygonCache[p1 + 1]; + var x2 = polygonCache[p2 + 0]; + var y2 = polygonCache[p2 + 1]; + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tintTL, tintTR, tintBL); + } + + polygonCache.length = 0; + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokePath + * @since 3.50.0 + * + * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. + * @param {number} lineWidth - The width of the line segments in pixels. + * @param {boolean} pathOpen - Indicates if the path should be closed or left open. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + // Reset the closePath booleans + this.prevQuad[4] = 0; + this.firstQuad[4] = 0; + + var pathLength = path.length - 1; + + for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) + { + var point0 = path[pathIndex]; + var point1 = path[pathIndex + 1]; + + this.batchLine( + point0.x, + point0.y, + point1.x, + point1.y, + point0.width / 2, + point1.width / 2, + lineWidth, + pathIndex, + !pathOpen && (pathIndex === pathLength - 1), + currentMatrix, + parentMatrix + ); + } + }, + + /** + * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchLine + * @since 3.50.0 + * + * @param {number} ax - x coordinate of the start of the line. + * @param {number} ay - y coordinate of the start of the line. + * @param {number} bx - x coordinate of the end of the line. + * @param {number} by - y coordinate of the end of the line. + * @param {number} aLineWidth - Width of the start of the line. + * @param {number} bLineWidth - Width of the end of the line. + * @param {number} index - If this line is part of a multi-line draw, the index of the line in the draw. + * @param {boolean} closePath - Does this line close a multi-line path? + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var dx = bx - ax; + var dy = by - ay; + + var len = Math.sqrt(dx * dx + dy * dy); + var al0 = aLineWidth * (by - ay) / len; + var al1 = aLineWidth * (ax - bx) / len; + var bl0 = bLineWidth * (by - ay) / len; + var bl1 = bLineWidth * (ax - bx) / len; + + var lx0 = bx - bl0; + var ly0 = by - bl1; + var lx1 = ax - al0; + var ly1 = ay - al1; + var lx2 = bx + bl0; + var ly2 = by + bl1; + var lx3 = ax + al0; + var ly3 = ay + al1; + + // tx0 = bottom right + var brX = calcMatrix.getX(lx0, ly0); + var brY = calcMatrix.getY(lx0, ly0); + + // tx1 = bottom left + var blX = calcMatrix.getX(lx1, ly1); + var blY = calcMatrix.getY(lx1, ly1); + + // tx2 = top right + var trX = calcMatrix.getX(lx2, ly2); + var trY = calcMatrix.getY(lx2, ly2); + + // tx3 = top left + var tlX = calcMatrix.getX(lx3, ly3); + var tlY = calcMatrix.getY(lx3, ly3); + + var tint = this.strokeTint; + + var tintTL = tint.TL; + var tintTR = tint.TR; + var tintBL = tint.BL; + var tintBR = tint.BR; + + // TL, BL, BR, TR + this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, tintTL, tintTR, tintBL, tintBR); + + if (lineWidth <= 2) + { + // No point doing a linejoin if the line isn't thick enough + return; + } + + var prev = this.prevQuad; + var first = this.firstQuad; + + if (index > 0 && prev[4]) + { + this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], tintTL, tintTR, tintBL, tintBR); + } + else + { + first[0] = tlX; + first[1] = tlY; + first[2] = blX; + first[3] = blY; + first[4] = 1; + } + + if (closePath && first[4]) + { + // Add a join for the final path segment + this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], tintTL, tintTR, tintBL, tintBR); + } + else + { + // Store it + + prev[0] = brX; + prev[1] = brY; + prev[2] = trX; + prev[3] = trY; + prev[4] = 1; + } + }, + + /** + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchVert + * @since 3.50.0 + * + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, tint) + { + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewU32[++vertexOffset] = tint; + + this.vertexCount++; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchQuad + * @override + * @since 3.50.0 + * + * @param {number} x0 - The top-left x position. + * @param {number} y0 - The top-left y position. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {number} tintBR - The bottom-right tint color value. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, tintTL, tintTR, tintBL, tintBR) + { + var hasFlushed = false; + + if (this.shouldFlush(6)) + { + this.flush(); + + hasFlushed = true; + } + + this.batchVert(x0, y0, tintTL); + this.batchVert(x1, y1, tintBL); + this.batchVert(x2, y2, tintBR); + this.batchVert(x0, y0, tintTL); + this.batchVert(x2, y2, tintBR); + this.batchVert(x3, y3, tintTR); + + return hasFlushed; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchTri + * @override + * @since 3.50.0 + * + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchTri: function (x0, y0, x1, y1, x2, y2, tintTL, tintTR, tintBL) + { + var hasFlushed = false; + + if (this.shouldFlush(3)) + { + this.flush(); + + hasFlushed = true; + } + + this.batchVert(x0, y0, tintTL); + this.batchVert(x1, y1, tintTR); + this.batchVert(x2, y2, tintBL); + + return hasFlushed; + }, + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#destroy + * @since 3.50.0 + * + * @return {this} This WebGLPipeline instance. + */ + destroy: function () + { + WebGLPipeline.prototype.destroy.call(this); + + this.polygonCache = null; + + return this; + } + +}); + +module.exports = GraphicsPipeline; + + +/***/ }), +/* 576 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124199,9 +131945,12 @@ module.exports = BitmapMaskPipeline; var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var ShaderSourceFS = __webpack_require__(809); -var MultiPipeline = __webpack_require__(112); -var WebGLPipeline = __webpack_require__(111); +var LightShaderSourceFS = __webpack_require__(857); +var PointLightShaderSourceFS = __webpack_require__(858); +var PointLightShaderSourceVS = __webpack_require__(859); +var TransformMatrix = __webpack_require__(24); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); var LIGHT_COUNT = 10; @@ -124255,7 +132004,7 @@ var LIGHT_COUNT = 10; */ var LightPipeline = new Class({ - Extends: MultiPipeline, + Extends: WebGLPipeline, initialize: @@ -124263,11 +132012,73 @@ var LightPipeline = new Class({ { LIGHT_COUNT = config.game.renderer.config.maxLights; - var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); + config.shaders = GetFastValue(config, 'shaders', [ + { + name: 'PointLight', + fragShader: PointLightShaderSourceFS, + vertShader: PointLightShaderSourceVS, + uniforms: [ + 'uProjectionMatrix', + 'uResolution' + ] + }, + { + name: 'Light', + fragShader: LightShaderSourceFS.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString()) + } + ]); - config.fragShader = fragmentShaderSource.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString()); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inLightPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inLightRadius', + size: 1, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inLightColor', + size: 4, + type: WEBGL_CONST.FLOAT + } + ]); - MultiPipeline.call(this, config); + WebGLPipeline.call(this, config); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempMatrix1 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this.tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempMatrix2 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this.tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempMatrix3 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this.tempMatrix3 = new TransformMatrix(); /** * Inverse rotation matrix for normal map rotations. @@ -124303,6 +132114,9 @@ var LightPipeline = new Class({ this.lightCount = 0; this.forceZero = true; + + this.pointLightShader; + this.lightShader; }, /** @@ -124311,7 +132125,7 @@ var LightPipeline = new Class({ * By this stage all Game level systems are now in place and you can perform any final * tasks that the pipeline may need that relied on game systems such as the Texture Manager. * - * @method Phaser.Renderer.WebGL.LightPipeline#boot + * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#boot * @since 3.11.0 */ boot: function () @@ -124330,48 +132144,101 @@ var LightPipeline = new Class({ this.defaultNormalMap = { glTexture: tempTexture }; - return this; + this.pointLightShader = this.shaders[0]; + this.lightShader = this.shaders[1]; }, /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. * - * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#bind + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#batchVert * @since 3.50.0 * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} u - UV u value. + * @param {number} v - UV v value. + * @param {number} unit - Texture unit to which the texture needs to be bound. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, lightX, lightY, radius, r, g, b, a) + { + var vertexViewF32 = this.vertexViewF32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewF32[++vertexOffset] = lightX; + vertexViewF32[++vertexOffset] = lightY; + vertexViewF32[++vertexOffset] = radius; + vertexViewF32[++vertexOffset] = r; + vertexViewF32[++vertexOffset] = g; + vertexViewF32[++vertexOffset] = b; + vertexViewF32[++vertexOffset] = a; + + this.vertexCount++; + }, + + batchLight: function (light, camera, x0, y0, x1, y1, x2, y2, x3, y3, lightX, lightY) + { + var color = light.color; + var intensity = light.intensity; + var radius = light.radius; + + var r = color.r * intensity; + var g = color.g * intensity; + var b = color.b * intensity; + var a = camera.alpha * light.alpha; + + if (this.shouldFlush(6)) + { + this.flush(); + } + + this.batchVert(x0, y0, lightX, lightY, radius, r, g, b, a); + this.batchVert(x1, y1, lightX, lightY, radius, r, g, b, a); + this.batchVert(x2, y2, lightX, lightY, radius, r, g, b, a); + this.batchVert(x0, y0, lightX, lightY, radius, r, g, b, a); + this.batchVert(x2, y2, lightX, lightY, radius, r, g, b, a); + this.batchVert(x3, y3, lightX, lightY, radius, r, g, b, a); + }, + + /** + * Called every time a Game Object needs to use this pipeline. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#onBind + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. * * @return {this} This WebGLPipeline instance. */ - bind: function (reset) + onBind: function () { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - var renderer = this.renderer; - var program = this.program; - - renderer.setInt1(program, 'uMainSampler', 0); - renderer.setInt1(program, 'uNormSampler', 1); - renderer.setFloat2(program, 'uResolution', this.width, this.height); - - return this; + this.set1i('uMainSampler', 0); + this.set1i('uNormSampler', 1); + this.set2f('uResolution', this.width / 2, this.height / 2); }, /** * This function sets all the needed resources for each camera pass. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#onRender + * @ignore * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene being rendered. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. * * @return {this} This WebGLPipeline instance. - */ onRender: function (scene, camera) { this.active = false; @@ -124443,6 +132310,7 @@ var LightPipeline = new Class({ return this; }, + */ /** * Rotates the normal map vectors inversely by the given angle. @@ -124490,11 +132358,11 @@ var LightPipeline = new Class({ * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#setTexture2D + * @ignore * @since 3.50.0 * * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object being rendered or added to the batch. - */ setTexture2D: function (texture, gameObject) { var renderer = this.renderer; @@ -124519,19 +132387,20 @@ var LightPipeline = new Class({ return 0; }, + */ /** * Custom pipelines can use this method in order to perform any required pre-batch tasks * for the given Game Object. It must return the texture unit the Game Object was assigned. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#setGameObject + * @ignore * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. * @param {Phaser.Textures.Frame} [frame] - Optional frame to use. Can override that of the Game Object. * * @return {number} The texture unit the Game Object has been assigned. - */ setGameObject: function (gameObject, frame) { if (frame === undefined) { frame = gameObject.frame; } @@ -124554,6 +132423,7 @@ var LightPipeline = new Class({ return 0; }, + */ /** * Returns the normal map WebGLTexture from the given Game Object. @@ -124610,7 +132480,7 @@ module.exports = LightPipeline; /***/ }), -/* 539 */ +/* 577 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124620,8 +132490,8 @@ module.exports = LightPipeline; */ var Class = __webpack_require__(0); -var ModelViewProjection = __webpack_require__(113); -var MultiPipeline = __webpack_require__(112); +var GetFastValue = __webpack_require__(2); +var MultiPipeline = __webpack_require__(158); /** * @classdesc @@ -124664,15 +132534,13 @@ var RopePipeline = new Class({ Extends: MultiPipeline, - Mixins: [ - ModelViewProjection - ], - initialize: function RopePipeline (config) { - config.topology = config.game.renderer.gl.TRIANGLE_STRIP; + // GLenum 5 = TRIANGLE_STRIP + config.topology = 5; + config.batchSize = GetFastValue(config, 'batchSize', 256); MultiPipeline.call(this, config); } @@ -124682,7 +132550,7 @@ module.exports = RopePipeline; /***/ }), -/* 540 */ +/* 578 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124693,17 +132561,15 @@ module.exports = RopePipeline; var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var ModelViewProjection = __webpack_require__(113); -var MultiPipeline = __webpack_require__(112); -var ShaderSourceFS = __webpack_require__(812); -var ShaderSourceVS = __webpack_require__(813); -var WebGLPipeline = __webpack_require__(111); +var MultiPipeline = __webpack_require__(158); +var ShaderSourceFS = __webpack_require__(862); +var ShaderSourceVS = __webpack_require__(863); +var WebGLPipeline = __webpack_require__(75); /** * @classdesc - * * The Single Pipeline is a special version of the Multi Pipeline that only ever - * uses one single texture, bound to texture unit zero. Although not as efficient as the + * uses one texture, bound to texture unit zero. Although not as efficient as the * Multi Pipeline, it provides an easier way to create custom pipelines that only require * a single bound texture. * @@ -124716,14 +132582,13 @@ var WebGLPipeline = __webpack_require__(111); * * `inPosition` (vec2, offset 0) * `inTexCoord` (vec2, offset 8) - * `inTintEffect` (float, offset 16) - * `inTint` (vec4, offset 20, normalized) + * `inTexId` (float, offset 16) - this value is always zero in the Single Pipeline + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) * * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uViewMatrix` (mat4) - * `uModelMatrix` (mat4) * `uMainSampler` (sampler2D) * * @class SinglePipeline @@ -124738,274 +132603,22 @@ var SinglePipeline = new Class({ Extends: MultiPipeline, - Mixins: [ - ModelViewProjection - ], - initialize: function SinglePipeline (config) { - var gl = config.game.renderer.gl; - config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS), config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS), - config.vertexSize = GetFastValue(config, 'vertexSize', 24), - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 - }, - { - name: 'inTexCoord', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 8, - enabled: false, - location: -1 - }, - { - name: 'inTintEffect', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 16, - enabled: false, - location: -1 - }, - { - name: 'inTint', - size: 4, - type: gl.UNSIGNED_BYTE, - normalized: true, - offset: 20, - enabled: false, - location: -1 - } - ]); + config.forceZero = true; MultiPipeline.call(this, config); - - this.forceZero = true; }, - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#batchQuad - * @since 3.50.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - This parameter isn't used by this pipeline, but is retained for TTP support. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) + boot: function () { - if (unit === undefined) { unit = this.currentUnit; } + WebGLPipeline.prototype.boot.call(this); - var hasFlushed = false; - - if (this.vertexCount + 6 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - this.vertexCount += 6; - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#batchTri - * @since 3.50.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - This parameter isn't used by this pipeline, but is retained for TTP support. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.vertexCount + 3 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - this.vertexCount += 3; - - return hasFlushed; - }, - - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - return this; + this.set1i('uMainSampler', 0); } }); @@ -125014,7 +132627,33 @@ module.exports = SinglePipeline; /***/ }), -/* 541 */ +/* 579 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_QUAD_VS', + '', + 'precision mediump float;', + '', + 'attribute vec2 inPosition;', + 'attribute vec2 inTexCoord;', + '', + 'varying vec2 outFragCoord;', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' outFragCoord = inPosition.xy * 0.5 + 0.5;', + ' outTexCoord = inTexCoord;', + '', + ' gl_Position = vec4(inPosition, 0, 1);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 580 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125023,13 +132662,13 @@ module.exports = SinglePipeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); -var Color = __webpack_require__(32); +var CanvasPool = __webpack_require__(31); +var Color = __webpack_require__(36); var GetFastValue = __webpack_require__(2); /** * Takes a snapshot of an area from the current frame displayed by a WebGL canvas. - * + * * This is then copied to an Image object. When this loads, the results are sent * to the callback provided in the Snapshot Configuration object. * @@ -125076,19 +132715,19 @@ var WebGLSnapshot = function (sourceCanvas, config) var pixels = new Uint8Array(total); gl.readPixels(x, bufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); - + var canvas = CanvasPool.createWebGL(this, width, height); var ctx = canvas.getContext('2d'); var imageData = ctx.getImageData(0, 0, width, height); - + var data = imageData.data; for (var py = 0; py < height; py++) { for (var px = 0; px < width; px++) { - var sourceIndex = ((height - py) * width + px) * 4; + var sourceIndex = ((height - py - 1) * width + px) * 4; var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4; data[destIndex + 0] = pixels[sourceIndex + 0]; @@ -125099,7 +132738,7 @@ var WebGLSnapshot = function (sourceCanvas, config) } ctx.putImageData(imageData, 0, 0); - + var image = new Image(); image.onerror = function () @@ -125124,11 +132763,11 @@ module.exports = WebGLSnapshot; /***/ }), -/* 542 */, -/* 543 */, -/* 544 */, -/* 545 */, -/* 546 */ +/* 581 */, +/* 582 */, +/* 583 */, +/* 584 */, +/* 585 */ /***/ (function(module, exports) { var g; @@ -125154,21 +132793,21 @@ module.exports = g; /***/ }), -/* 547 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(548); -__webpack_require__(549); -__webpack_require__(550); -__webpack_require__(551); -__webpack_require__(552); -__webpack_require__(553); -__webpack_require__(554); -__webpack_require__(555); +__webpack_require__(587); +__webpack_require__(588); +__webpack_require__(589); +__webpack_require__(590); +__webpack_require__(591); +__webpack_require__(592); +__webpack_require__(593); +__webpack_require__(594); /***/ }), -/* 548 */ +/* 587 */ /***/ (function(module, exports) { /** @@ -125208,7 +132847,7 @@ if (!Array.prototype.forEach) /***/ }), -/* 549 */ +/* 588 */ /***/ (function(module, exports) { /** @@ -125224,7 +132863,7 @@ if (!Array.isArray) /***/ }), -/* 550 */ +/* 589 */ /***/ (function(module, exports) { /* Copyright 2013 Chris Wilson @@ -125411,7 +133050,7 @@ BiquadFilterNode.type and OscillatorNode.type. /***/ }), -/* 551 */ +/* 590 */ /***/ (function(module, exports) { /** @@ -125426,7 +133065,7 @@ if (!window.console) /***/ }), -/* 552 */ +/* 591 */ /***/ (function(module, exports) { // ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc @@ -125438,7 +133077,7 @@ if (!Math.trunc) { /***/ }), -/* 553 */ +/* 592 */ /***/ (function(module, exports) { /** @@ -125475,7 +133114,7 @@ if (!Math.trunc) { /***/ }), -/* 554 */ +/* 593 */ /***/ (function(module, exports) { // References: @@ -125532,7 +133171,7 @@ if (!window.cancelAnimationFrame) /***/ }), -/* 555 */ +/* 594 */ /***/ (function(module, exports) { /** @@ -125585,7 +133224,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o /***/ }), -/* 556 */ +/* 595 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125594,7 +133233,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var QuickSet = __webpack_require__(253); +var QuickSet = __webpack_require__(268); /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, and aligns them next to each other. @@ -125607,7 +133246,7 @@ var QuickSet = __webpack_require__(253); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. - * @param {integer} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. + * @param {number} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * @@ -125633,7 +133272,7 @@ module.exports = AlignTo; /***/ }), -/* 557 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125642,7 +133281,7 @@ module.exports = AlignTo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `angle` property, @@ -125660,8 +133299,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `angle` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -125674,7 +133313,7 @@ module.exports = Angle; /***/ }), -/* 558 */ +/* 597 */ /***/ (function(module, exports) { /** @@ -125713,7 +133352,7 @@ module.exports = Call; /***/ }), -/* 559 */ +/* 598 */ /***/ (function(module, exports) { /** @@ -125736,7 +133375,7 @@ module.exports = Call; * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [index=0] - An optional offset to start searching from within the items array. * * @return {?(object|Phaser.GameObjects.GameObject)} The first object in the array that matches the comparison object, or `null` if no match was found. */ @@ -125771,7 +133410,7 @@ module.exports = GetFirst; /***/ }), -/* 560 */ +/* 599 */ /***/ (function(module, exports) { /** @@ -125794,7 +133433,7 @@ module.exports = GetFirst; * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [index=0] - An optional offset to start searching from within the items array. * * @return {?(object|Phaser.GameObjects.GameObject)} The last object in the array that matches the comparison object, or `null` if no match was found. */ @@ -125829,7 +133468,7 @@ module.exports = GetLast; /***/ }), -/* 561 */ +/* 600 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125838,11 +133477,11 @@ module.exports = GetLast; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AlignIn = __webpack_require__(266); -var CONST = __webpack_require__(108); +var AlignIn = __webpack_require__(281); +var CONST = __webpack_require__(120); var GetFastValue = __webpack_require__(2); var NOOP = __webpack_require__(1); -var Zone = __webpack_require__(117); +var Zone = __webpack_require__(125); var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1); @@ -125948,7 +133587,7 @@ module.exports = GridAlign; /***/ }), -/* 562 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -125957,7 +133596,7 @@ module.exports = GridAlign; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -126243,7 +133882,7 @@ module.exports = Alpha; /***/ }), -/* 563 */ +/* 602 */ /***/ (function(module, exports) { /** @@ -126392,7 +134031,7 @@ module.exports = ComputedSize; /***/ }), -/* 564 */ +/* 603 */ /***/ (function(module, exports) { /** @@ -126517,7 +134156,7 @@ module.exports = Crop; /***/ }), -/* 565 */ +/* 604 */ /***/ (function(module, exports) { /** @@ -126681,7 +134320,7 @@ module.exports = Flip; /***/ }), -/* 566 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -126691,7 +134330,7 @@ module.exports = Flip; */ var Rectangle = __webpack_require__(9); -var RotateAround = __webpack_require__(285); +var RotateAround = __webpack_require__(300); var Vector2 = __webpack_require__(3); /** @@ -127040,7 +134679,7 @@ module.exports = GetBounds; /***/ }), -/* 567 */ +/* 606 */ /***/ (function(module, exports) { /** @@ -127063,7 +134702,7 @@ module.exports = 'blur'; /***/ }), -/* 568 */ +/* 607 */ /***/ (function(module, exports) { /** @@ -127085,7 +134724,7 @@ module.exports = 'boot'; /***/ }), -/* 569 */ +/* 608 */ /***/ (function(module, exports) { /** @@ -127108,7 +134747,7 @@ module.exports = 'contextlost'; /***/ }), -/* 570 */ +/* 609 */ /***/ (function(module, exports) { /** @@ -127131,7 +134770,7 @@ module.exports = 'contextrestored'; /***/ }), -/* 571 */ +/* 610 */ /***/ (function(module, exports) { /** @@ -127154,7 +134793,7 @@ module.exports = 'destroy'; /***/ }), -/* 572 */ +/* 611 */ /***/ (function(module, exports) { /** @@ -127176,7 +134815,7 @@ module.exports = 'focus'; /***/ }), -/* 573 */ +/* 612 */ /***/ (function(module, exports) { /** @@ -127202,7 +134841,7 @@ module.exports = 'hidden'; /***/ }), -/* 574 */ +/* 613 */ /***/ (function(module, exports) { /** @@ -127223,7 +134862,7 @@ module.exports = 'pause'; /***/ }), -/* 575 */ +/* 614 */ /***/ (function(module, exports) { /** @@ -127249,7 +134888,7 @@ module.exports = 'postrender'; /***/ }), -/* 576 */ +/* 615 */ /***/ (function(module, exports) { /** @@ -127274,7 +134913,7 @@ module.exports = 'poststep'; /***/ }), -/* 577 */ +/* 616 */ /***/ (function(module, exports) { /** @@ -127299,7 +134938,7 @@ module.exports = 'prerender'; /***/ }), -/* 578 */ +/* 617 */ /***/ (function(module, exports) { /** @@ -127324,7 +134963,7 @@ module.exports = 'prestep'; /***/ }), -/* 579 */ +/* 618 */ /***/ (function(module, exports) { /** @@ -127346,7 +134985,7 @@ module.exports = 'ready'; /***/ }), -/* 580 */ +/* 619 */ /***/ (function(module, exports) { /** @@ -127367,7 +135006,7 @@ module.exports = 'resume'; /***/ }), -/* 581 */ +/* 620 */ /***/ (function(module, exports) { /** @@ -127392,7 +135031,7 @@ module.exports = 'step'; /***/ }), -/* 582 */ +/* 621 */ /***/ (function(module, exports) { /** @@ -127416,7 +135055,7 @@ module.exports = 'visible'; /***/ }), -/* 583 */ +/* 622 */ /***/ (function(module, exports) { /** @@ -127619,7 +135258,7 @@ module.exports = Origin; /***/ }), -/* 584 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -127628,10 +135267,10 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(41); -var GetBoolean = __webpack_require__(90); +var DegToRad = __webpack_require__(34); +var GetBoolean = __webpack_require__(95); var GetValue = __webpack_require__(6); -var TWEEN_CONST = __webpack_require__(91); +var TWEEN_CONST = __webpack_require__(96); var Vector2 = __webpack_require__(3); /** @@ -127726,7 +135365,7 @@ var PathFollower = { * Records the direction of the follower so it can change direction. * * @name Phaser.GameObjects.PathFollower#_prevDirection - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -128046,7 +135685,7 @@ module.exports = PathFollower; /***/ }), -/* 585 */ +/* 624 */ /***/ (function(module, exports) { /** @@ -128233,7 +135872,7 @@ module.exports = Size; /***/ }), -/* 586 */ +/* 625 */ /***/ (function(module, exports) { /** @@ -128291,7 +135930,7 @@ var Texture = { * @since 3.0.0 * * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -128315,7 +135954,7 @@ var Texture = { * @method Phaser.GameObjects.Components.Texture#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * @@ -128363,7 +136002,7 @@ module.exports = Texture; /***/ }), -/* 587 */ +/* 626 */ /***/ (function(module, exports) { /** @@ -128415,24 +136054,24 @@ var TextureCrop = { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. - * + * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @@ -128480,7 +136119,7 @@ var TextureCrop = { * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -128504,7 +136143,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * @@ -128557,7 +136196,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject * @private * @since 3.12.0 - * + * * @return {object} The crop object. */ resetCropObject: function () @@ -128571,8 +136210,8 @@ module.exports = TextureCrop; /***/ }), -/* 588 */ -/***/ (function(module, exports, __webpack_require__) { +/* 627 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -128580,8 +136219,6 @@ module.exports = TextureCrop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColorFromValue = __webpack_require__(119); - /** * Provides methods used for setting the tint of a Game Object. * Should be applied as a mixin and not used directly. @@ -128594,62 +136231,58 @@ var GetColorFromValue = __webpack_require__(119); var Tint = { /** - * Private internal value. Holds the top-left tint value. + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTL + * @name Phaser.GameObjects.Components.Tint#tintTopLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTL: 16777215, + tintTopLeft: 0xffffff, /** - * Private internal value. Holds the top-right tint value. + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTR + * @name Phaser.GameObjects.Components.Tint#tintTopRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTR: 16777215, + tintTopRight: 0xffffff, /** - * Private internal value. Holds the bottom-left tint value. + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBL + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBL: 16777215, + tintBottomLeft: 0xffffff, /** - * Private internal value. Holds the bottom-right tint value. + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBR + * @name Phaser.GameObjects.Components.Tint#tintBottomRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBR: 16777215, + tintBottomRight: 0xffffff, /** - * Private internal value. Holds if the Game Object is tinted or not. + * The tint fill mode. * - * @name Phaser.GameObjects.Components.Tint#_isTinted - * @type {boolean} - * @private - * @default false - * @since 3.11.0 - */ - _isTinted: false, - - /** - * Fill or additive? + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Components.Tint#tintFill * @type {boolean} @@ -128674,8 +136307,6 @@ var Tint = { { this.setTint(0xffffff); - this._isTinted = false; - return this; }, @@ -128699,10 +136330,10 @@ var Tint = { * @webglOnly * @since 3.0.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -128717,12 +136348,10 @@ var Tint = { bottomRight = topLeft; } - this._tintTL = GetColorFromValue(topLeft); - this._tintTR = GetColorFromValue(topRight); - this._tintBL = GetColorFromValue(bottomLeft); - this._tintBR = GetColorFromValue(bottomRight); - - this._isTinted = true; + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; this.tintFill = false; @@ -128750,10 +136379,10 @@ var Tint = { * @webglOnly * @since 3.11.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -128766,108 +136395,12 @@ var Tint = { return this; }, - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopLeft: { - - get: function () - { - return this._tintTL; - }, - - set: function (value) - { - this._tintTL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopRight: { - - get: function () - { - return this._tintTR; - }, - - set: function (value) - { - this._tintTR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomLeft: { - - get: function () - { - return this._tintBL; - }, - - set: function (value) - { - this._tintBL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomRight: { - - get: function () - { - return this._tintBR; - }, - - set: function (value) - { - this._tintBR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. * * @name Phaser.GameObjects.Components.Tint#tint - * @type {integer} + * @type {number} * @webglOnly * @since 3.0.0 */ @@ -128880,7 +136413,10 @@ var Tint = { }, /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. * * @name Phaser.GameObjects.Components.Tint#isTinted * @type {boolean} @@ -128892,7 +136428,15 @@ var Tint = { get: function () { - return this._isTinted; + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); } } @@ -128903,7 +136447,7 @@ module.exports = Tint; /***/ }), -/* 589 */ +/* 628 */ /***/ (function(module, exports) { /** @@ -128935,7 +136479,7 @@ module.exports = 'changedata'; /***/ }), -/* 590 */ +/* 629 */ /***/ (function(module, exports) { /** @@ -128965,7 +136509,28 @@ module.exports = 'changedata-'; /***/ }), -/* 591 */ +/* 630 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Data Manager Destroy Event. + * + * The Data Manager will listen for the destroy event from its parent, and then close itself down. + * + * @event Phaser.Data.Events#DESTROY + * @since 3.50.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 631 */ /***/ (function(module, exports) { /** @@ -128993,7 +136558,7 @@ module.exports = 'removedata'; /***/ }), -/* 592 */ +/* 632 */ /***/ (function(module, exports) { /** @@ -129021,7 +136586,7 @@ module.exports = 'setdata'; /***/ }), -/* 593 */ +/* 633 */ /***/ (function(module, exports) { /** @@ -129047,7 +136612,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 594 */ +/* 634 */ /***/ (function(module, exports) { /** @@ -129072,7 +136637,7 @@ module.exports = 'destroy'; /***/ }), -/* 595 */ +/* 635 */ /***/ (function(module, exports) { /** @@ -129098,7 +136663,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 596 */ +/* 636 */ /***/ (function(module, exports) { /** @@ -129130,7 +136695,7 @@ module.exports = 'complete'; /***/ }), -/* 597 */ +/* 637 */ /***/ (function(module, exports) { /** @@ -129152,14 +136717,14 @@ module.exports = 'complete'; * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - * @param {integer} width - The width of the video. - * @param {integer} height - The height of the video. + * @param {number} width - The width of the video. + * @param {number} height - The height of the video. */ module.exports = 'created'; /***/ }), -/* 598 */ +/* 638 */ /***/ (function(module, exports) { /** @@ -129185,7 +136750,7 @@ module.exports = 'error'; /***/ }), -/* 599 */ +/* 639 */ /***/ (function(module, exports) { /** @@ -129217,7 +136782,7 @@ module.exports = 'loop'; /***/ }), -/* 600 */ +/* 640 */ /***/ (function(module, exports) { /** @@ -129245,7 +136810,7 @@ module.exports = 'play'; /***/ }), -/* 601 */ +/* 641 */ /***/ (function(module, exports) { /** @@ -129270,7 +136835,7 @@ module.exports = 'seeked'; /***/ }), -/* 602 */ +/* 642 */ /***/ (function(module, exports) { /** @@ -129296,7 +136861,7 @@ module.exports = 'seeking'; /***/ }), -/* 603 */ +/* 643 */ /***/ (function(module, exports) { /** @@ -129322,7 +136887,7 @@ module.exports = 'stop'; /***/ }), -/* 604 */ +/* 644 */ /***/ (function(module, exports) { /** @@ -129348,7 +136913,7 @@ module.exports = 'timeout'; /***/ }), -/* 605 */ +/* 645 */ /***/ (function(module, exports) { /** @@ -129374,7 +136939,7 @@ module.exports = 'unlocked'; /***/ }), -/* 606 */ +/* 646 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129383,7 +136948,7 @@ module.exports = 'unlocked'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `alpha` property, @@ -129401,8 +136966,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `alpha` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -129415,7 +136980,7 @@ module.exports = IncAlpha; /***/ }), -/* 607 */ +/* 647 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129424,7 +136989,7 @@ module.exports = IncAlpha; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `x` property, @@ -129442,8 +137007,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `x` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -129456,7 +137021,7 @@ module.exports = IncX; /***/ }), -/* 608 */ +/* 648 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129465,7 +137030,7 @@ module.exports = IncX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, @@ -129485,8 +137050,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {number} [y=x] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -129503,7 +137068,7 @@ module.exports = IncXY; /***/ }), -/* 609 */ +/* 649 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129512,7 +137077,7 @@ module.exports = IncXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `y` property, @@ -129530,8 +137095,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `y` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -129544,7 +137109,7 @@ module.exports = IncY; /***/ }), -/* 610 */ +/* 650 */ /***/ (function(module, exports) { /** @@ -129593,7 +137158,7 @@ module.exports = PlaceOnCircle; /***/ }), -/* 611 */ +/* 651 */ /***/ (function(module, exports) { /** @@ -129645,7 +137210,7 @@ module.exports = PlaceOnEllipse; /***/ }), -/* 612 */ +/* 652 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129654,7 +137219,7 @@ module.exports = PlaceOnEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoints = __webpack_require__(162); +var GetPoints = __webpack_require__(163); /** * Positions an array of Game Objects on evenly spaced points of a Line. @@ -129689,7 +137254,7 @@ module.exports = PlaceOnLine; /***/ }), -/* 613 */ +/* 653 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129698,9 +137263,9 @@ module.exports = PlaceOnLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MarchingAnts = __webpack_require__(294); -var RotateLeft = __webpack_require__(295); -var RotateRight = __webpack_require__(296); +var MarchingAnts = __webpack_require__(308); +var RotateLeft = __webpack_require__(170); +var RotateRight = __webpack_require__(171); /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. @@ -129715,7 +137280,7 @@ var RotateRight = __webpack_require__(296); * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on. - * @param {integer} [shift=1] - An optional positional offset. + * @param {number} [shift=1] - An optional positional offset. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -129747,7 +137312,7 @@ module.exports = PlaceOnRectangle; /***/ }), -/* 614 */ +/* 654 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129756,7 +137321,7 @@ module.exports = PlaceOnRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BresenhamPoints = __webpack_require__(297); +var BresenhamPoints = __webpack_require__(309); /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. @@ -129808,7 +137373,7 @@ module.exports = PlaceOnTriangle; /***/ }), -/* 615 */ +/* 655 */ /***/ (function(module, exports) { /** @@ -129827,7 +137392,7 @@ module.exports = PlaceOnTriangle; * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {string} key - The name of the animation to play. - * @param {(string|integer)} [startFrame] - The starting frame of the animation with the given key. + * @param {(string|number)} [startFrame] - The starting frame of the animation with the given key. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -129845,7 +137410,7 @@ module.exports = PlayAnimation; /***/ }), -/* 616 */ +/* 656 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129854,7 +137419,7 @@ module.exports = PlayAnimation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(160); +var Random = __webpack_require__(161); /** * Takes an array of Game Objects and positions them at random locations within the Circle. @@ -129885,7 +137450,7 @@ module.exports = RandomCircle; /***/ }), -/* 617 */ +/* 657 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129894,7 +137459,7 @@ module.exports = RandomCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(167); +var Random = __webpack_require__(172); /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. @@ -129925,7 +137490,7 @@ module.exports = RandomEllipse; /***/ }), -/* 618 */ +/* 658 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129934,7 +137499,7 @@ module.exports = RandomEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(163); +var Random = __webpack_require__(164); /** * Takes an array of Game Objects and positions them at random locations on the Line. @@ -129965,7 +137530,7 @@ module.exports = RandomLine; /***/ }), -/* 619 */ +/* 659 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129974,7 +137539,7 @@ module.exports = RandomLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(164); +var Random = __webpack_require__(165); /** * Takes an array of Game Objects and positions them at random locations within the Rectangle. @@ -130003,7 +137568,7 @@ module.exports = RandomRectangle; /***/ }), -/* 620 */ +/* 660 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130012,7 +137577,7 @@ module.exports = RandomRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(168); +var Random = __webpack_require__(173); /** * Takes an array of Game Objects and positions them at random locations within the Triangle. @@ -130043,7 +137608,7 @@ module.exports = RandomTriangle; /***/ }), -/* 621 */ +/* 661 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130052,7 +137617,7 @@ module.exports = RandomTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `rotation` property, @@ -130070,8 +137635,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `rotation` property (in radians). * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130084,7 +137649,7 @@ module.exports = Rotate; /***/ }), -/* 622 */ +/* 662 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130093,8 +137658,8 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundDistance = __webpack_require__(169); -var DistanceBetween = __webpack_require__(55); +var RotateAroundDistance = __webpack_require__(174); +var DistanceBetween = __webpack_require__(61); /** * Rotates each item around the given point by the given angle. @@ -130130,7 +137695,7 @@ module.exports = RotateAround; /***/ }), -/* 623 */ +/* 663 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130139,7 +137704,7 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathRotateAroundDistance = __webpack_require__(169); +var MathRotateAroundDistance = __webpack_require__(174); /** * Rotates an array of Game Objects around a point by the given angle and distance. @@ -130179,7 +137744,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 624 */ +/* 664 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130188,7 +137753,7 @@ module.exports = RotateAroundDistance; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `scaleX` property, @@ -130206,8 +137771,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleX` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130220,7 +137785,7 @@ module.exports = ScaleX; /***/ }), -/* 625 */ +/* 665 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130229,7 +137794,7 @@ module.exports = ScaleX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, @@ -130249,8 +137814,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {number} [scaleY] - The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130267,7 +137832,7 @@ module.exports = ScaleXY; /***/ }), -/* 626 */ +/* 666 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130276,7 +137841,7 @@ module.exports = ScaleXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `scaleY` property, @@ -130294,8 +137859,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleY` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130308,7 +137873,7 @@ module.exports = ScaleY; /***/ }), -/* 627 */ +/* 667 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130317,7 +137882,7 @@ module.exports = ScaleY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `alpha` @@ -130335,8 +137900,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130349,7 +137914,7 @@ module.exports = SetAlpha; /***/ }), -/* 628 */ +/* 668 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130358,7 +137923,7 @@ module.exports = SetAlpha; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `blendMode` @@ -130375,8 +137940,8 @@ var PropertyValueSet = __webpack_require__(25); * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130389,7 +137954,7 @@ module.exports = SetBlendMode; /***/ }), -/* 629 */ +/* 669 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130398,7 +137963,7 @@ module.exports = SetBlendMode; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `depth` @@ -130416,8 +137981,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130430,7 +137995,7 @@ module.exports = SetDepth; /***/ }), -/* 630 */ +/* 670 */ /***/ (function(module, exports) { /** @@ -130469,7 +138034,7 @@ module.exports = SetHitArea; /***/ }), -/* 631 */ +/* 671 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130478,7 +138043,7 @@ module.exports = SetHitArea; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` @@ -130498,8 +138063,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [originY] - The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. * @param {number} [stepX=0] - This is added to the `originX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `originY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130522,7 +138087,7 @@ module.exports = SetOrigin; /***/ }), -/* 632 */ +/* 672 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130531,7 +138096,7 @@ module.exports = SetOrigin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `rotation` @@ -130549,8 +138114,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130563,7 +138128,7 @@ module.exports = SetRotation; /***/ }), -/* 633 */ +/* 673 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130572,7 +138137,7 @@ module.exports = SetRotation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` @@ -130592,8 +138157,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [scaleY] - The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130610,7 +138175,7 @@ module.exports = SetScale; /***/ }), -/* 634 */ +/* 674 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130619,7 +138184,7 @@ module.exports = SetScale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scaleX` @@ -130637,8 +138202,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130651,7 +138216,7 @@ module.exports = SetScaleX; /***/ }), -/* 635 */ +/* 675 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130660,7 +138225,7 @@ module.exports = SetScaleX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scaleY` @@ -130678,8 +138243,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130692,7 +138257,7 @@ module.exports = SetScaleY; /***/ }), -/* 636 */ +/* 676 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130701,7 +138266,7 @@ module.exports = SetScaleY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `scrollFactorX` and `scrollFactorY` @@ -130721,8 +138286,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [scrollFactorY] - The amount to set the `scrollFactorY` property to. If `undefined` or `null` it uses the `scrollFactorX` value. * @param {number} [stepX=0] - This is added to the `scrollFactorX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scrollFactorY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130739,7 +138304,7 @@ module.exports = SetScrollFactor; /***/ }), -/* 637 */ +/* 677 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130748,7 +138313,7 @@ module.exports = SetScrollFactor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorX` @@ -130766,8 +138331,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130780,7 +138345,7 @@ module.exports = SetScrollFactorX; /***/ }), -/* 638 */ +/* 678 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130789,7 +138354,7 @@ module.exports = SetScrollFactorX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorY` @@ -130807,8 +138372,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130821,7 +138386,7 @@ module.exports = SetScrollFactorY; /***/ }), -/* 639 */ +/* 679 */ /***/ (function(module, exports) { /** @@ -130860,7 +138425,7 @@ module.exports = SetTint; /***/ }), -/* 640 */ +/* 680 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130869,7 +138434,7 @@ module.exports = SetTint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `visible` @@ -130884,8 +138449,8 @@ var PropertyValueSet = __webpack_require__(25); * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {boolean} value - The value to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130898,7 +138463,7 @@ module.exports = SetVisible; /***/ }), -/* 641 */ +/* 681 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130907,7 +138472,7 @@ module.exports = SetVisible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `x` @@ -130925,8 +138490,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130939,7 +138504,7 @@ module.exports = SetX; /***/ }), -/* 642 */ +/* 682 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130948,7 +138513,7 @@ module.exports = SetX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` @@ -130968,8 +138533,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [y=x] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130986,7 +138551,7 @@ module.exports = SetXY; /***/ }), -/* 643 */ +/* 683 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130995,7 +138560,7 @@ module.exports = SetXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `y` @@ -131013,8 +138578,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -131027,7 +138592,7 @@ module.exports = SetY; /***/ }), -/* 644 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131055,7 +138620,7 @@ var Vector2 = __webpack_require__(3); * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {number} x - The x coordinate to place the first item in the array at. * @param {number} y - The y coordinate to place the first item in the array at. - * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {number} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in. * * @return {Phaser.Math.Vector2} The output vector. @@ -131157,7 +138722,7 @@ module.exports = ShiftPosition; /***/ }), -/* 645 */ +/* 685 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131166,7 +138731,7 @@ module.exports = ShiftPosition; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayShuffle = __webpack_require__(121); +var ArrayShuffle = __webpack_require__(127); /** * Shuffles the array in place. The shuffled array is both modified and returned. @@ -131190,7 +138755,7 @@ module.exports = Shuffle; /***/ }), -/* 646 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131199,7 +138764,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmootherStep = __webpack_require__(170); +var MathSmootherStep = __webpack_require__(175); /** * Smootherstep is a sigmoid-like interpolation and clamping function. @@ -131248,7 +138813,7 @@ module.exports = SmootherStep; /***/ }), -/* 647 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131257,7 +138822,7 @@ module.exports = SmootherStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmoothStep = __webpack_require__(171); +var MathSmoothStep = __webpack_require__(176); /** * Smoothstep is a sigmoid-like interpolation and clamping function. @@ -131306,7 +138871,7 @@ module.exports = SmoothStep; /***/ }), -/* 648 */ +/* 688 */ /***/ (function(module, exports) { /** @@ -131369,7 +138934,7 @@ module.exports = Spread; /***/ }), -/* 649 */ +/* 689 */ /***/ (function(module, exports) { /** @@ -131405,7 +138970,7 @@ module.exports = ToggleVisible; /***/ }), -/* 650 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131415,7 +138980,7 @@ module.exports = ToggleVisible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * Wrap each item's coordinates within a rectangle's area. @@ -131454,7 +139019,7 @@ module.exports = WrapInRectangle; /***/ }), -/* 651 */ +/* 691 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131469,17 +139034,17 @@ module.exports = WrapInRectangle; module.exports = { - Animation: __webpack_require__(172), - AnimationFrame: __webpack_require__(299), - AnimationManager: __webpack_require__(301), + Animation: __webpack_require__(177), + AnimationFrame: __webpack_require__(311), + AnimationManager: __webpack_require__(313), AnimationState: __webpack_require__(157), - Events: __webpack_require__(122) + Events: __webpack_require__(128) }; /***/ }), -/* 652 */ +/* 692 */ /***/ (function(module, exports) { /** @@ -131506,7 +139071,7 @@ module.exports = 'add'; /***/ }), -/* 653 */ +/* 693 */ /***/ (function(module, exports) { /** @@ -131552,7 +139117,7 @@ module.exports = 'animationcomplete'; /***/ }), -/* 654 */ +/* 694 */ /***/ (function(module, exports) { /** @@ -131602,7 +139167,7 @@ module.exports = 'animationcomplete-'; /***/ }), -/* 655 */ +/* 695 */ /***/ (function(module, exports) { /** @@ -131645,7 +139210,7 @@ module.exports = 'animationrepeat'; /***/ }), -/* 656 */ +/* 696 */ /***/ (function(module, exports) { /** @@ -131686,7 +139251,7 @@ module.exports = 'animationrestart'; /***/ }), -/* 657 */ +/* 697 */ /***/ (function(module, exports) { /** @@ -131728,7 +139293,7 @@ module.exports = 'animationstart'; /***/ }), -/* 658 */ +/* 698 */ /***/ (function(module, exports) { /** @@ -131770,7 +139335,7 @@ module.exports = 'animationstop'; /***/ }), -/* 659 */ +/* 699 */ /***/ (function(module, exports) { /** @@ -131816,7 +139381,7 @@ module.exports = 'animationupdate'; /***/ }), -/* 660 */ +/* 700 */ /***/ (function(module, exports) { /** @@ -131840,7 +139405,7 @@ module.exports = 'pauseall'; /***/ }), -/* 661 */ +/* 701 */ /***/ (function(module, exports) { /** @@ -131864,7 +139429,7 @@ module.exports = 'remove'; /***/ }), -/* 662 */ +/* 702 */ /***/ (function(module, exports) { /** @@ -131887,7 +139452,7 @@ module.exports = 'resumeall'; /***/ }), -/* 663 */ +/* 703 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131902,15 +139467,15 @@ module.exports = 'resumeall'; module.exports = { - BaseCache: __webpack_require__(303), - CacheManager: __webpack_require__(305), - Events: __webpack_require__(304) + BaseCache: __webpack_require__(315), + CacheManager: __webpack_require__(317), + Events: __webpack_require__(316) }; /***/ }), -/* 664 */ +/* 704 */ /***/ (function(module, exports) { /** @@ -131935,7 +139500,7 @@ module.exports = 'add'; /***/ }), -/* 665 */ +/* 705 */ /***/ (function(module, exports) { /** @@ -131960,7 +139525,7 @@ module.exports = 'remove'; /***/ }), -/* 666 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131979,14 +139544,14 @@ module.exports = 'remove'; module.exports = { - Controls: __webpack_require__(667), - Scene2D: __webpack_require__(670) + Controls: __webpack_require__(707), + Scene2D: __webpack_require__(710) }; /***/ }), -/* 667 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132001,14 +139566,14 @@ module.exports = { module.exports = { - FixedKeyControl: __webpack_require__(668), - SmoothedKeyControl: __webpack_require__(669) + FixedKeyControl: __webpack_require__(708), + SmoothedKeyControl: __webpack_require__(709) }; /***/ }), -/* 668 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132314,7 +139879,7 @@ module.exports = FixedKeyControl; /***/ }), -/* 669 */ +/* 709 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132797,7 +140362,7 @@ module.exports = SmoothedKeyControl; /***/ }), -/* 670 */ +/* 710 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132812,17 +140377,17 @@ module.exports = SmoothedKeyControl; module.exports = { - Camera: __webpack_require__(306), - BaseCamera: __webpack_require__(93), - CameraManager: __webpack_require__(726), - Effects: __webpack_require__(314), - Events: __webpack_require__(42) + Camera: __webpack_require__(318), + BaseCamera: __webpack_require__(99), + CameraManager: __webpack_require__(767), + Effects: __webpack_require__(325), + Events: __webpack_require__(35) }; /***/ }), -/* 671 */ +/* 711 */ /***/ (function(module, exports) { /** @@ -132845,7 +140410,7 @@ module.exports = 'cameradestroy'; /***/ }), -/* 672 */ +/* 712 */ /***/ (function(module, exports) { /** @@ -132871,7 +140436,7 @@ module.exports = 'camerafadeincomplete'; /***/ }), -/* 673 */ +/* 713 */ /***/ (function(module, exports) { /** @@ -132892,16 +140457,16 @@ module.exports = 'camerafadeincomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'camerafadeinstart'; /***/ }), -/* 674 */ +/* 714 */ /***/ (function(module, exports) { /** @@ -132927,7 +140492,7 @@ module.exports = 'camerafadeoutcomplete'; /***/ }), -/* 675 */ +/* 715 */ /***/ (function(module, exports) { /** @@ -132948,16 +140513,16 @@ module.exports = 'camerafadeoutcomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'camerafadeoutstart'; /***/ }), -/* 676 */ +/* 716 */ /***/ (function(module, exports) { /** @@ -132981,7 +140546,7 @@ module.exports = 'cameraflashcomplete'; /***/ }), -/* 677 */ +/* 717 */ /***/ (function(module, exports) { /** @@ -133000,16 +140565,44 @@ module.exports = 'cameraflashcomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Flash} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'cameraflashstart'; /***/ }), -/* 678 */ +/* 718 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Follower Update Event. + * + * This event is dispatched by a Camera instance when it is following a + * Game Object and the Camera position has been updated as a result of + * that following. + * + * Listen to it from a Camera instance using: `camera.on('followupdate', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#FOLLOW_UPDATE + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that emitted the event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the camera is following. + */ +module.exports = 'followupdate'; + + +/***/ }), +/* 719 */ /***/ (function(module, exports) { /** @@ -133033,7 +140626,7 @@ module.exports = 'camerapancomplete'; /***/ }), -/* 679 */ +/* 720 */ /***/ (function(module, exports) { /** @@ -133052,7 +140645,7 @@ module.exports = 'camerapancomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Pan} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} x - The destination scroll x coordinate. * @param {number} y - The destination scroll y coordinate. */ @@ -133060,7 +140653,7 @@ module.exports = 'camerapanstart'; /***/ }), -/* 680 */ +/* 721 */ /***/ (function(module, exports) { /** @@ -133086,7 +140679,7 @@ module.exports = 'postrender'; /***/ }), -/* 681 */ +/* 722 */ /***/ (function(module, exports) { /** @@ -133112,7 +140705,7 @@ module.exports = 'prerender'; /***/ }), -/* 682 */ +/* 723 */ /***/ (function(module, exports) { /** @@ -133136,7 +140729,7 @@ module.exports = 'camerarotatecomplete'; /***/ }), -/* 683 */ +/* 724 */ /***/ (function(module, exports) { /** @@ -133155,14 +140748,14 @@ module.exports = 'camerarotatecomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.RotateTo} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} destination - The destination value. */ module.exports = 'camerarotatestart'; /***/ }), -/* 684 */ +/* 725 */ /***/ (function(module, exports) { /** @@ -133186,7 +140779,7 @@ module.exports = 'camerashakecomplete'; /***/ }), -/* 685 */ +/* 726 */ /***/ (function(module, exports) { /** @@ -133205,14 +140798,14 @@ module.exports = 'camerashakecomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Shake} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} intensity - The intensity of the effect. */ module.exports = 'camerashakestart'; /***/ }), -/* 686 */ +/* 727 */ /***/ (function(module, exports) { /** @@ -133236,7 +140829,7 @@ module.exports = 'camerazoomcomplete'; /***/ }), -/* 687 */ +/* 728 */ /***/ (function(module, exports) { /** @@ -133255,14 +140848,14 @@ module.exports = 'camerazoomcomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Zoom} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} zoom - The destination zoom value. */ module.exports = 'camerazoomstart'; /***/ }), -/* 688 */ +/* 729 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133271,9 +140864,9 @@ module.exports = 'camerazoomstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); +var Events = __webpack_require__(35); /** * @classdesc @@ -133350,7 +140943,7 @@ var Fade = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Fade#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -133362,7 +140955,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#red - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -133373,7 +140966,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#green - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -133384,7 +140977,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#blue - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -133451,10 +141044,10 @@ var Fade = new Class({ * @since 3.5.0 * * @param {boolean} [direction=true] - The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent) - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraFadeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -133507,7 +141100,7 @@ var Fade = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Fade#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -133557,7 +141150,7 @@ var Fade = new Class({ var camera = this.camera; ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; - ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + ctx.fillRect(camera.x, camera.y, camera.width, camera.height); return true; }, @@ -133582,12 +141175,12 @@ var Fade = new Class({ var camera = this.camera; var red = this.red / 255; - var blue = this.blue / 255; var green = this.green / 255; + var blue = this.blue / 255; pipeline.drawFillRect( - camera._cx, camera._cy, camera._cw, camera._ch, - getTintFunction(red, green, blue, 1), + camera.x, camera.y, camera.width, camera.height, + getTintFunction(blue, green, red, 1), this.alpha ); @@ -133650,7 +141243,7 @@ module.exports = Fade; /***/ }), -/* 689 */ +/* 730 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -133659,9 +141252,9 @@ module.exports = Fade; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); +var Events = __webpack_require__(35); /** * @classdesc @@ -133713,7 +141306,7 @@ var Flash = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Flash#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -133721,40 +141314,40 @@ var Flash = new Class({ this.duration = 0; /** - * The value of the red color channel the camera will use for the fade effect. + * The value of the red color channel the camera will use for the flash effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#red - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ this.red = 0; /** - * The value of the green color channel the camera will use for the fade effect. + * The value of the green color channel the camera will use for the flash effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#green - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ this.green = 0; /** - * The value of the blue color channel the camera will use for the fade effect. + * The value of the blue color channel the camera will use for the flash effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#blue - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ this.blue = 0; /** - * The value of the alpha channel used during the fade effect. + * The value of the alpha channel used during the flash effect. * A value between 0 and 1. * * @name Phaser.Cameras.Scene2D.Effects.Flash#alpha @@ -133813,10 +141406,10 @@ var Flash = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=250] - The duration of the effect in milliseconds. - * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=250] - The duration of the effect in milliseconds. + * @param {number} [red=255] - The amount to flash the red channel towards. A value between 0 and 255. + * @param {number} [green=255] - The amount to flash the green channel towards. A value between 0 and 255. + * @param {number} [blue=255] - The amount to flash the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraFlashCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -133864,7 +141457,7 @@ var Flash = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Flash#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -133913,7 +141506,7 @@ var Flash = new Class({ var camera = this.camera; ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; - ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + ctx.fillRect(camera.x, camera.y, camera.width, camera.height); return true; }, @@ -133938,12 +141531,12 @@ var Flash = new Class({ var camera = this.camera; var red = this.red / 255; - var blue = this.blue / 255; var green = this.green / 255; + var blue = this.blue / 255; pipeline.drawFillRect( - camera._cx, camera._cy, camera._cw, camera._ch, - getTintFunction(red, green, blue, 1), + camera.x, camera.y, camera.width, camera.height, + getTintFunction(blue, green, red, 1), this.alpha ); @@ -134001,7 +141594,7 @@ module.exports = Flash; /***/ }), -/* 690 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134010,10 +141603,10 @@ module.exports = Flash; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(123); -var Events = __webpack_require__(42); +var EaseMap = __webpack_require__(129); +var Events = __webpack_require__(35); var Vector2 = __webpack_require__(3); /** @@ -134067,7 +141660,7 @@ var Pan = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Pan#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.11.0 @@ -134162,7 +141755,7 @@ var Pan = new Class({ * * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -134226,7 +141819,7 @@ var Pan = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Pan#update * @since 3.11.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -134326,7 +141919,7 @@ module.exports = Pan; /***/ }), -/* 691 */ +/* 732 */ /***/ (function(module, exports) { /** @@ -134357,7 +141950,7 @@ module.exports = In; /***/ }), -/* 692 */ +/* 733 */ /***/ (function(module, exports) { /** @@ -134388,7 +141981,7 @@ module.exports = Out; /***/ }), -/* 693 */ +/* 734 */ /***/ (function(module, exports) { /** @@ -134428,7 +142021,7 @@ module.exports = InOut; /***/ }), -/* 694 */ +/* 735 */ /***/ (function(module, exports) { /** @@ -134473,7 +142066,7 @@ module.exports = In; /***/ }), -/* 695 */ +/* 736 */ /***/ (function(module, exports) { /** @@ -134516,7 +142109,7 @@ module.exports = Out; /***/ }), -/* 696 */ +/* 737 */ /***/ (function(module, exports) { /** @@ -134580,7 +142173,7 @@ module.exports = InOut; /***/ }), -/* 697 */ +/* 738 */ /***/ (function(module, exports) { /** @@ -134608,7 +142201,7 @@ module.exports = In; /***/ }), -/* 698 */ +/* 739 */ /***/ (function(module, exports) { /** @@ -134636,7 +142229,7 @@ module.exports = Out; /***/ }), -/* 699 */ +/* 740 */ /***/ (function(module, exports) { /** @@ -134671,7 +142264,7 @@ module.exports = InOut; /***/ }), -/* 700 */ +/* 741 */ /***/ (function(module, exports) { /** @@ -134699,7 +142292,7 @@ module.exports = In; /***/ }), -/* 701 */ +/* 742 */ /***/ (function(module, exports) { /** @@ -134727,7 +142320,7 @@ module.exports = Out; /***/ }), -/* 702 */ +/* 743 */ /***/ (function(module, exports) { /** @@ -134762,7 +142355,7 @@ module.exports = InOut; /***/ }), -/* 703 */ +/* 744 */ /***/ (function(module, exports) { /** @@ -134817,7 +142410,7 @@ module.exports = In; /***/ }), -/* 704 */ +/* 745 */ /***/ (function(module, exports) { /** @@ -134872,7 +142465,7 @@ module.exports = Out; /***/ }), -/* 705 */ +/* 746 */ /***/ (function(module, exports) { /** @@ -134934,7 +142527,7 @@ module.exports = InOut; /***/ }), -/* 706 */ +/* 747 */ /***/ (function(module, exports) { /** @@ -134962,7 +142555,7 @@ module.exports = In; /***/ }), -/* 707 */ +/* 748 */ /***/ (function(module, exports) { /** @@ -134990,7 +142583,7 @@ module.exports = Out; /***/ }), -/* 708 */ +/* 749 */ /***/ (function(module, exports) { /** @@ -135025,7 +142618,7 @@ module.exports = InOut; /***/ }), -/* 709 */ +/* 750 */ /***/ (function(module, exports) { /** @@ -135053,7 +142646,7 @@ module.exports = Linear; /***/ }), -/* 710 */ +/* 751 */ /***/ (function(module, exports) { /** @@ -135081,7 +142674,7 @@ module.exports = In; /***/ }), -/* 711 */ +/* 752 */ /***/ (function(module, exports) { /** @@ -135109,7 +142702,7 @@ module.exports = Out; /***/ }), -/* 712 */ +/* 753 */ /***/ (function(module, exports) { /** @@ -135144,7 +142737,7 @@ module.exports = InOut; /***/ }), -/* 713 */ +/* 754 */ /***/ (function(module, exports) { /** @@ -135172,7 +142765,7 @@ module.exports = In; /***/ }), -/* 714 */ +/* 755 */ /***/ (function(module, exports) { /** @@ -135200,7 +142793,7 @@ module.exports = Out; /***/ }), -/* 715 */ +/* 756 */ /***/ (function(module, exports) { /** @@ -135235,7 +142828,7 @@ module.exports = InOut; /***/ }), -/* 716 */ +/* 757 */ /***/ (function(module, exports) { /** @@ -135263,7 +142856,7 @@ module.exports = In; /***/ }), -/* 717 */ +/* 758 */ /***/ (function(module, exports) { /** @@ -135291,7 +142884,7 @@ module.exports = Out; /***/ }), -/* 718 */ +/* 759 */ /***/ (function(module, exports) { /** @@ -135326,7 +142919,7 @@ module.exports = InOut; /***/ }), -/* 719 */ +/* 760 */ /***/ (function(module, exports) { /** @@ -135365,7 +142958,7 @@ module.exports = In; /***/ }), -/* 720 */ +/* 761 */ /***/ (function(module, exports) { /** @@ -135404,7 +142997,7 @@ module.exports = Out; /***/ }), -/* 721 */ +/* 762 */ /***/ (function(module, exports) { /** @@ -135443,7 +143036,7 @@ module.exports = InOut; /***/ }), -/* 722 */ +/* 763 */ /***/ (function(module, exports) { /** @@ -135485,7 +143078,7 @@ module.exports = Stepped; /***/ }), -/* 723 */ +/* 764 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135494,9 +143087,9 @@ module.exports = Stepped; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); +var Events = __webpack_require__(35); var Vector2 = __webpack_require__(3); /** @@ -135549,7 +143142,7 @@ var Shake = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Shake#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -135638,7 +143231,7 @@ var Shake = new Class({ * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [duration=100] - The duration of the effect in milliseconds. * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -135705,7 +143298,7 @@ var Shake = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Shake#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -135727,8 +143320,8 @@ var Shake = new Class({ if (this._elapsed < this.duration) { var intensity = this.intensity; - var width = this.camera._cw; - var height = this.camera._ch; + var width = this.camera.width; + var height = this.camera.height; var zoom = this.camera.zoom; this._offsetX = (Math.random() * intensity.x * width * 2 - intensity.x * width) * zoom; @@ -135804,7 +143397,7 @@ module.exports = Shake; /***/ }), -/* 724 */ +/* 765 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135813,10 +143406,10 @@ module.exports = Shake; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); -var EaseMap = __webpack_require__(123); +var Events = __webpack_require__(35); +var EaseMap = __webpack_require__(129); /** * @classdesc @@ -135875,7 +143468,7 @@ var RotateTo = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.RotateTo#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.23.0 @@ -135996,7 +143589,7 @@ var RotateTo = new Class({ * * @param {number} radians - The destination angle in radians to rotate the Camera viewport to. If the angle is positive then the rotation is clockwise else anticlockwise * @param {boolean} [shortestPath=false] - If shortest path is set to true the camera will rotate in the quickest direction clockwise or anti-clockwise. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the Rotate. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the rotation effect to start immediately, even if already running. * @param {CameraRotateCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -136111,7 +143704,7 @@ var RotateTo = new Class({ * @method Phaser.Cameras.Scene2D.Effects.RotateTo#update * @since 3.23.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -136237,7 +143830,7 @@ module.exports = RotateTo; /***/ }), -/* 725 */ +/* 766 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136246,10 +143839,10 @@ module.exports = RotateTo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(123); -var Events = __webpack_require__(42); +var EaseMap = __webpack_require__(129); +var Events = __webpack_require__(35); /** * @classdesc @@ -136298,7 +143891,7 @@ var Zoom = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Zoom#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.11.0 @@ -136382,7 +143975,7 @@ var Zoom = new Class({ * @since 3.11.0 * * @param {number} zoom - The target Camera zoom value. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the Zoom. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the zoom effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraZoomCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -136443,7 +144036,7 @@ var Zoom = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Zoom#update * @since 3.11.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -136530,7 +144123,7 @@ module.exports = Zoom; /***/ }), -/* 726 */ +/* 767 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136539,24 +144132,24 @@ module.exports = Zoom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Camera = __webpack_require__(306); +var Camera = __webpack_require__(318); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); -var RectangleContains = __webpack_require__(50); -var ScaleEvents = __webpack_require__(94); +var PluginCache = __webpack_require__(25); +var RectangleContains = __webpack_require__(56); +var ScaleEvents = __webpack_require__(101); var SceneEvents = __webpack_require__(20); /** * @classdesc * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras. - * + * * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed * in your game config. - * + * * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add * the new Camera in using the `addExisting` method. - * + * * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly. * * A Camera consists of two elements: The viewport and the scroll values. @@ -136571,7 +144164,7 @@ var SceneEvents = __webpack_require__(20); * viewport, and changing the viewport has no impact on the scrolling. * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, - * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique + * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore * Game Objects, make sure it's one of the first 31 created. @@ -136637,11 +144230,11 @@ var CameraManager = new Class({ * A handy reference to the 'main' camera. By default this is the first Camera the * Camera Manager creates. You can also set it directly, or use the `makeMain` argument * in the `add` and `addExisting` methods. It allows you to access it from your game: - * + * * ```javascript * var cam = this.cameras.main; * ``` - * + * * Also see the properties `camera1`, `camera2` and so on. * * @name Phaser.Cameras.Scene2D.CameraManager#main @@ -136727,7 +144320,7 @@ var CameraManager = new Class({ // Make one this.add(); } - + this.main = this.cameras[0]; } @@ -136739,28 +144332,28 @@ var CameraManager = new Class({ /** * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras. - * + * * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas. - * + * * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake, * pan and zoom. - * + * * By default Cameras are transparent and will render anything that they can see based on their `scrollX` * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after creation if required. - * + * * See the Camera class documentation for more details. * * @method Phaser.Cameras.Scene2D.CameraManager#add * @since 3.0.0 * - * @param {integer} [x=0] - The horizontal position of the Camera viewport. - * @param {integer} [y=0] - The vertical position of the Camera viewport. - * @param {integer} [width] - The width of the Camera viewport. If not given it'll be the game config size. - * @param {integer} [height] - The height of the Camera viewport. If not given it'll be the game config size. + * @param {number} [x=0] - The horizontal position of the Camera viewport. + * @param {number} [y=0] - The vertical position of the Camera viewport. + * @param {number} [width] - The width of the Camera viewport. If not given it'll be the game config size. + * @param {number} [height] - The height of the Camera viewport. If not given it'll be the game config size. * @param {boolean} [makeMain=false] - Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. * @param {string} [name=''] - The name of the Camera. * @@ -136795,15 +144388,15 @@ var CameraManager = new Class({ /** * Adds an existing Camera into the Camera Manager. - * + * * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after addition if required. - * + * * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the * manager. As long as it doesn't already exist in the manager it will be added then returned. - * + * * If this method returns `null` then the Camera already exists in this Camera Manager. * * @method Phaser.Cameras.Scene2D.CameraManager#addExisting @@ -136832,7 +144425,7 @@ var CameraManager = new Class({ { this.main = camera; } - + return camera; } @@ -136841,7 +144434,7 @@ var CameraManager = new Class({ /** * Gets the next available Camera ID number. - * + * * The Camera Manager supports up to 31 unique cameras, after which the ID returned will always be zero. * You can create additional cameras beyond 31, but they cannot be used for Game Object exclusion. * @@ -136889,15 +144482,15 @@ var CameraManager = new Class({ /** * Gets the total number of Cameras in this Camera Manager. - * + * * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. * * @method Phaser.Cameras.Scene2D.CameraManager#getTotal * @since 3.11.0 - * + * * @param {boolean} [isVisible=false] - Set the `true` to only include visible Cameras in the total. * - * @return {integer} The total number of Cameras in this Camera Manager. + * @return {number} The total number of Cameras in this Camera Manager. */ getTotal: function (isVisible) { @@ -136922,7 +144515,7 @@ var CameraManager = new Class({ /** * Populates this Camera Manager based on the given configuration object, or an array of config objects. - * + * * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure. * * @method Phaser.Cameras.Scene2D.CameraManager#fromJSON @@ -136991,7 +144584,7 @@ var CameraManager = new Class({ /** * Gets a Camera based on its name. - * + * * Camera names are optional and don't have to be set, so this method is only of any use if you * have given your Cameras unique names. * @@ -137019,7 +144612,7 @@ var CameraManager = new Class({ /** * Returns an array of all cameras below the given Pointer. - * + * * The first camera in the array is the top-most camera in the camera list. * * @method Phaser.Cameras.Scene2D.CameraManager#getCamerasBelowPointer @@ -137054,10 +144647,10 @@ var CameraManager = new Class({ /** * Removes the given Camera, or an array of Cameras, from this Camera Manager. - * + * * If found in the Camera Manager it will be immediately removed from the local cameras array. * If also currently the 'main' camera, 'main' will be reset to be camera 0. - * + * * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default. * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references * and internal data until destroyed or re-added to a Camera Manager. @@ -137067,8 +144660,8 @@ var CameraManager = new Class({ * * @param {(Phaser.Cameras.Scene2D.Camera|Phaser.Cameras.Scene2D.Camera[])} camera - The Camera, or an array of Cameras, to be removed from this Camera Manager. * @param {boolean} [runDestroy=true] - Automatically call `Camera.destroy` on each Camera removed from this Camera Manager. - * - * @return {integer} The total number of Cameras removed. + * + * @return {number} The total number of Cameras removed. */ remove: function (camera, runDestroy) { @@ -137109,7 +144702,7 @@ var CameraManager = new Class({ /** * The internal render method. This is called automatically by the Scene and should not be invoked directly. - * + * * It will iterate through all local cameras and render them in turn, as long as they're visible and have * an alpha level > 0. * @@ -137118,10 +144711,9 @@ var CameraManager = new Class({ * @since 3.0.0 * * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Renderer that will render the children to this camera. - * @param {Phaser.GameObjects.GameObject[]} children - An array of renderable Game Objects. - * @param {number} interpolation - Interpolation value. Reserved for future use. + * @param {Phaser.GameObjects.DisplayList} children - The Display List for the Scene. */ - render: function (renderer, children, interpolation) + render: function (renderer, children) { var scene = this.scene; var cameras = this.cameras; @@ -137132,17 +144724,48 @@ var CameraManager = new Class({ if (camera.visible && camera.alpha > 0) { - // Hard-coded to 1 for now - camera.preRender(1); + camera.preRender(); - renderer.render(scene, children, interpolation, camera); + var visibleChildren = this.getVisibleChildren(children.getChildren(), camera); + + renderer.render(scene, visibleChildren, camera); } } }, + /** + * Takes an array of Game Objects and a Camera and returns a new array + * containing only those Game Objects that pass the `willRender` test + * against the given Camera. + * + * @method Phaser.Cameras.Scene2D.CameraManager#getVisibleChildren + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to be checked against the camera. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filte the Game Objects against. + * + * @return {Phaser.GameObjects.GameObject[]} A filtered list of only Game Objects within the Scene that will render against the given Camera. + */ + getVisibleChildren: function (children, camera) + { + var visible = []; + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (child.willRender(camera)) + { + visible.push(child); + } + } + + return visible; + }, + /** * Resets this Camera Manager. - * + * * This will iterate through all current Cameras, destroying them all, then it will reset the * cameras array, reset the ID counter and create 1 new single camera using the default values. * @@ -137172,7 +144795,7 @@ var CameraManager = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -137190,9 +144813,9 @@ var CameraManager = new Class({ * @since 3.18.0 * * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. - * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions. The canvas width / height values match this. */ - onResize: function (gameSize, baseSize, displaySize, resolution, previousWidth, previousHeight) + onResize: function (gameSize, baseSize, displaySize, previousWidth, previousHeight) { for (var i = 0; i < this.cameras.length; i++) { @@ -137278,7 +144901,7 @@ module.exports = CameraManager; /***/ }), -/* 727 */ +/* 768 */ /***/ (function(module, exports) { /** @@ -137297,7 +144920,7 @@ module.exports = 'enterfullscreen'; /***/ }), -/* 728 */ +/* 769 */ /***/ (function(module, exports) { /** @@ -137316,7 +144939,7 @@ module.exports = 'fullscreenfailed'; /***/ }), -/* 729 */ +/* 770 */ /***/ (function(module, exports) { /** @@ -137335,7 +144958,7 @@ module.exports = 'fullscreenunsupported'; /***/ }), -/* 730 */ +/* 771 */ /***/ (function(module, exports) { /** @@ -137355,7 +144978,7 @@ module.exports = 'leavefullscreen'; /***/ }), -/* 731 */ +/* 772 */ /***/ (function(module, exports) { /** @@ -137367,16 +144990,18 @@ module.exports = 'leavefullscreen'; /** * The Scale Manager Orientation Change Event. * + * This event is dispatched whenever the Scale Manager detects an orientation change event from the browser. + * * @event Phaser.Scale.Events#ORIENTATION_CHANGE * @since 3.16.1 - * - * @param {string} orientation - + * + * @param {string} orientation - The new orientation value. Either `Phaser.Scale.Orientation.LANDSCAPE` or `Phaser.Scale.Orientation.PORTRAIT`. */ module.exports = 'orientationchange'; /***/ }), -/* 732 */ +/* 773 */ /***/ (function(module, exports) { /** @@ -137387,7 +145012,7 @@ module.exports = 'orientationchange'; /** * The Scale Manager Resize Event. - * + * * This event is dispatched whenever the Scale Manager detects a resize event from the browser. * It sends three parameters to the callback, each of them being Size components. You can read * the `width`, `height`, `aspectRatio` and other properties of these components to help with @@ -137395,11 +145020,10 @@ module.exports = 'orientationchange'; * * @event Phaser.Scale.Events#RESIZE * @since 3.16.1 - * + * * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} resolution - The current resolution. Defaults to 1 at the moment. * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. */ @@ -137407,7 +145031,7 @@ module.exports = 'resize'; /***/ }), -/* 733 */ +/* 774 */ /***/ (function(module, exports) { /** @@ -137433,7 +145057,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 734 */ +/* 775 */ /***/ (function(module, exports) { /** @@ -137458,7 +145082,7 @@ module.exports = 'boot'; /***/ }), -/* 735 */ +/* 776 */ /***/ (function(module, exports) { /** @@ -137487,7 +145111,7 @@ module.exports = 'create'; /***/ }), -/* 736 */ +/* 777 */ /***/ (function(module, exports) { /** @@ -137514,7 +145138,7 @@ module.exports = 'destroy'; /***/ }), -/* 737 */ +/* 778 */ /***/ (function(module, exports) { /** @@ -137541,7 +145165,7 @@ module.exports = 'pause'; /***/ }), -/* 738 */ +/* 779 */ /***/ (function(module, exports) { /** @@ -137578,7 +145202,7 @@ module.exports = 'postupdate'; /***/ }), -/* 739 */ +/* 780 */ /***/ (function(module, exports) { /** @@ -137615,7 +145239,7 @@ module.exports = 'preupdate'; /***/ }), -/* 740 */ +/* 781 */ /***/ (function(module, exports) { /** @@ -137643,7 +145267,7 @@ module.exports = 'ready'; /***/ }), -/* 741 */ +/* 782 */ /***/ (function(module, exports) { /** @@ -137669,7 +145293,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 742 */ +/* 783 */ /***/ (function(module, exports) { /** @@ -137705,7 +145329,7 @@ module.exports = 'render'; /***/ }), -/* 743 */ +/* 784 */ /***/ (function(module, exports) { /** @@ -137732,7 +145356,7 @@ module.exports = 'resume'; /***/ }), -/* 744 */ +/* 785 */ /***/ (function(module, exports) { /** @@ -137762,7 +145386,7 @@ module.exports = 'shutdown'; /***/ }), -/* 745 */ +/* 786 */ /***/ (function(module, exports) { /** @@ -137789,7 +145413,7 @@ module.exports = 'sleep'; /***/ }), -/* 746 */ +/* 787 */ /***/ (function(module, exports) { /** @@ -137814,7 +145438,7 @@ module.exports = 'start'; /***/ }), -/* 747 */ +/* 788 */ /***/ (function(module, exports) { /** @@ -137850,7 +145474,7 @@ module.exports = 'transitioncomplete'; /***/ }), -/* 748 */ +/* 789 */ /***/ (function(module, exports) { /** @@ -137887,7 +145511,7 @@ module.exports = 'transitioninit'; /***/ }), -/* 749 */ +/* 790 */ /***/ (function(module, exports) { /** @@ -137921,7 +145545,7 @@ module.exports = 'transitionout'; /***/ }), -/* 750 */ +/* 791 */ /***/ (function(module, exports) { /** @@ -137961,7 +145585,7 @@ module.exports = 'transitionstart'; /***/ }), -/* 751 */ +/* 792 */ /***/ (function(module, exports) { /** @@ -137996,7 +145620,7 @@ module.exports = 'transitionwake'; /***/ }), -/* 752 */ +/* 793 */ /***/ (function(module, exports) { /** @@ -138033,7 +145657,7 @@ module.exports = 'update'; /***/ }), -/* 753 */ +/* 794 */ /***/ (function(module, exports) { /** @@ -138060,7 +145684,7 @@ module.exports = 'wake'; /***/ }), -/* 754 */ +/* 795 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138075,18 +145699,18 @@ module.exports = 'wake'; module.exports = { - Config: __webpack_require__(327), - CreateRenderer: __webpack_require__(349), - DebugHeader: __webpack_require__(351), - Events: __webpack_require__(21), - TimeStep: __webpack_require__(352), - VisibilityHandler: __webpack_require__(354) + Config: __webpack_require__(338), + CreateRenderer: __webpack_require__(358), + DebugHeader: __webpack_require__(360), + Events: __webpack_require__(23), + TimeStep: __webpack_require__(361), + VisibilityHandler: __webpack_require__(363) }; /***/ }), -/* 755 */ +/* 796 */ /***/ (function(module, exports) { // shim for using process in browser @@ -138276,7 +145900,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 756 */ +/* 797 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138285,7 +145909,7 @@ process.umask = function() { return 0; }; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(126); +var Browser = __webpack_require__(131); /** * Determines the input support of the browser running this Phaser Game instance. @@ -138351,7 +145975,7 @@ module.exports = init(); /***/ }), -/* 757 */ +/* 798 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138360,17 +145984,17 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(126); +var Browser = __webpack_require__(131); /** * Determines the audio playback capabilities of the device running this Phaser Game instance. * These values are read-only and populated during the boot sequence of the game. * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.audio` from within any Scene. - * + * * @typedef {object} Phaser.Device.Audio * @since 3.0.0 - * + * * @property {boolean} audioData - Can this device play HTML Audio tags? * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? * @property {boolean} m4a - Can this device can play m4a files. @@ -138426,8 +146050,7 @@ function init () // Mimetypes accepted: // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - // bit.ly/iphoneoscodecs - if (audioElement.canPlayType('audio/wav; codecs="1"').replace(/^no$/, '')) + if (audioElement.canPlayType('audio/wav').replace(/^no$/, '')) { Audio.wav = true; } @@ -138476,7 +146099,7 @@ module.exports = init(); /***/ }), -/* 758 */ +/* 799 */ /***/ (function(module, exports) { /** @@ -138563,7 +146186,7 @@ module.exports = init(); /***/ }), -/* 759 */ +/* 800 */ /***/ (function(module, exports) { /** @@ -138667,7 +146290,7 @@ module.exports = init(); /***/ }), -/* 760 */ +/* 801 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138682,25 +146305,25 @@ module.exports = init(); module.exports = { - Between: __webpack_require__(330), - BetweenPoints: __webpack_require__(331), - BetweenPointsY: __webpack_require__(761), - BetweenY: __webpack_require__(762), - CounterClockwise: __webpack_require__(763), - Normalize: __webpack_require__(332), - Random: __webpack_require__(764), - RandomDegrees: __webpack_require__(765), - Reverse: __webpack_require__(766), - RotateTo: __webpack_require__(767), - ShortestBetween: __webpack_require__(768), - Wrap: __webpack_require__(248), - WrapDegrees: __webpack_require__(249) + Between: __webpack_require__(341), + BetweenPoints: __webpack_require__(342), + BetweenPointsY: __webpack_require__(802), + BetweenY: __webpack_require__(803), + CounterClockwise: __webpack_require__(804), + Normalize: __webpack_require__(343), + Random: __webpack_require__(805), + RandomDegrees: __webpack_require__(806), + Reverse: __webpack_require__(807), + RotateTo: __webpack_require__(808), + ShortestBetween: __webpack_require__(809), + Wrap: __webpack_require__(261), + WrapDegrees: __webpack_require__(262) }; /***/ }), -/* 761 */ +/* 802 */ /***/ (function(module, exports) { /** @@ -138732,7 +146355,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 762 */ +/* 803 */ /***/ (function(module, exports) { /** @@ -138766,7 +146389,7 @@ module.exports = BetweenY; /***/ }), -/* 763 */ +/* 804 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138811,7 +146434,7 @@ module.exports = CounterClockwise; /***/ }), -/* 764 */ +/* 805 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138821,7 +146444,7 @@ module.exports = CounterClockwise; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(127); +var FloatBetween = __webpack_require__(132); /** * Returns a random angle in the range [-pi, pi]. @@ -138840,7 +146463,7 @@ module.exports = Random; /***/ }), -/* 765 */ +/* 806 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138850,7 +146473,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(127); +var FloatBetween = __webpack_require__(132); /** * Returns a random angle in the range [-180, 180]. @@ -138869,7 +146492,7 @@ module.exports = RandomDegrees; /***/ }), -/* 766 */ +/* 807 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138878,7 +146501,7 @@ module.exports = RandomDegrees; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(332); +var Normalize = __webpack_require__(343); /** * Reverse the given angle. @@ -138899,7 +146522,7 @@ module.exports = Reverse; /***/ }), -/* 767 */ +/* 808 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138966,7 +146589,7 @@ module.exports = RotateTo; /***/ }), -/* 768 */ +/* 809 */ /***/ (function(module, exports) { /** @@ -139015,7 +146638,7 @@ module.exports = ShortestBetween; /***/ }), -/* 769 */ +/* 810 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139030,19 +146653,19 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(55), - BetweenPoints: __webpack_require__(333), - BetweenPointsSquared: __webpack_require__(770), - Chebyshev: __webpack_require__(771), - Power: __webpack_require__(772), - Snake: __webpack_require__(773), - Squared: __webpack_require__(334) + Between: __webpack_require__(61), + BetweenPoints: __webpack_require__(344), + BetweenPointsSquared: __webpack_require__(811), + Chebyshev: __webpack_require__(812), + Power: __webpack_require__(813), + Snake: __webpack_require__(814), + Squared: __webpack_require__(345) }; /***/ }), -/* 770 */ +/* 811 */ /***/ (function(module, exports) { /** @@ -139074,7 +146697,7 @@ module.exports = DistanceBetweenPointsSquared; /***/ }), -/* 771 */ +/* 812 */ /***/ (function(module, exports) { /** @@ -139108,7 +146731,7 @@ module.exports = ChebyshevDistance; /***/ }), -/* 772 */ +/* 813 */ /***/ (function(module, exports) { /** @@ -139142,7 +146765,7 @@ module.exports = DistancePower; /***/ }), -/* 773 */ +/* 814 */ /***/ (function(module, exports) { /** @@ -139176,7 +146799,7 @@ module.exports = SnakeDistance; /***/ }), -/* 774 */ +/* 815 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139191,24 +146814,24 @@ module.exports = SnakeDistance; module.exports = { - Back: __webpack_require__(315), - Bounce: __webpack_require__(316), - Circular: __webpack_require__(317), - Cubic: __webpack_require__(318), - Elastic: __webpack_require__(319), - Expo: __webpack_require__(320), - Linear: __webpack_require__(321), - Quadratic: __webpack_require__(322), - Quartic: __webpack_require__(323), - Quintic: __webpack_require__(324), - Sine: __webpack_require__(325), - Stepped: __webpack_require__(326) + Back: __webpack_require__(326), + Bounce: __webpack_require__(327), + Circular: __webpack_require__(328), + Cubic: __webpack_require__(329), + Elastic: __webpack_require__(330), + Expo: __webpack_require__(331), + Linear: __webpack_require__(332), + Quadratic: __webpack_require__(333), + Quartic: __webpack_require__(334), + Quintic: __webpack_require__(335), + Sine: __webpack_require__(336), + Stepped: __webpack_require__(337) }; /***/ }), -/* 775 */ +/* 816 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139223,17 +146846,17 @@ module.exports = { module.exports = { - Ceil: __webpack_require__(776), - Equal: __webpack_require__(109), - Floor: __webpack_require__(777), - GreaterThan: __webpack_require__(335), - LessThan: __webpack_require__(336) + Ceil: __webpack_require__(817), + Equal: __webpack_require__(121), + Floor: __webpack_require__(818), + GreaterThan: __webpack_require__(346), + LessThan: __webpack_require__(347) }; /***/ }), -/* 776 */ +/* 817 */ /***/ (function(module, exports) { /** @@ -139264,7 +146887,7 @@ module.exports = Ceil; /***/ }), -/* 777 */ +/* 818 */ /***/ (function(module, exports) { /** @@ -139295,7 +146918,7 @@ module.exports = Floor; /***/ }), -/* 778 */ +/* 819 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139310,19 +146933,19 @@ module.exports = Floor; module.exports = { - Bezier: __webpack_require__(779), - CatmullRom: __webpack_require__(780), - CubicBezier: __webpack_require__(339), - Linear: __webpack_require__(781), - QuadraticBezier: __webpack_require__(340), - SmoothStep: __webpack_require__(341), - SmootherStep: __webpack_require__(782) + Bezier: __webpack_require__(820), + CatmullRom: __webpack_require__(821), + CubicBezier: __webpack_require__(350), + Linear: __webpack_require__(822), + QuadraticBezier: __webpack_require__(351), + SmoothStep: __webpack_require__(352), + SmootherStep: __webpack_require__(823) }; /***/ }), -/* 779 */ +/* 820 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139331,7 +146954,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(337); +var Bernstein = __webpack_require__(348); /** * A bezier interpolation method. @@ -139361,7 +146984,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 780 */ +/* 821 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139370,7 +146993,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(181); +var CatmullRom = __webpack_require__(186); /** * A Catmull-Rom interpolation method. @@ -139418,7 +147041,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 781 */ +/* 822 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139427,7 +147050,7 @@ module.exports = CatmullRomInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(124); +var Linear = __webpack_require__(130); /** * A linear interpolation method. @@ -139465,7 +147088,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 782 */ +/* 823 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139474,7 +147097,7 @@ module.exports = LinearInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(170); +var SmootherStep = __webpack_require__(175); /** * A Smoother Step interpolation method. @@ -139498,7 +147121,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 783 */ +/* 824 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139513,15 +147136,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(342), - IsSize: __webpack_require__(128), - IsValue: __webpack_require__(784) + GetNext: __webpack_require__(353), + IsSize: __webpack_require__(133), + IsValue: __webpack_require__(825) }; /***/ }), -/* 784 */ +/* 825 */ /***/ (function(module, exports) { /** @@ -139549,7 +147172,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 785 */ +/* 826 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139564,15 +147187,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(343), - Floor: __webpack_require__(95), - To: __webpack_require__(786) + Ceil: __webpack_require__(134), + Floor: __webpack_require__(72), + To: __webpack_require__(827) }; /***/ }), -/* 786 */ +/* 827 */ /***/ (function(module, exports) { /** @@ -139615,7 +147238,7 @@ module.exports = SnapTo; /***/ }), -/* 787 */ +/* 828 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140125,7 +147748,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 788 */ +/* 829 */ /***/ (function(module, exports) { /** @@ -140160,7 +147783,7 @@ module.exports = Average; /***/ }), -/* 789 */ +/* 830 */ /***/ (function(module, exports) { /** @@ -140179,7 +147802,7 @@ module.exports = Average; * * @param {number} value - The value to round. * @param {number} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -140197,7 +147820,7 @@ module.exports = CeilTo; /***/ }), -/* 790 */ +/* 831 */ /***/ (function(module, exports) { /** @@ -140226,7 +147849,290 @@ module.exports = Difference; /***/ }), -/* 791 */ +/* 832 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(16); +var Class = __webpack_require__(0); +var Matrix4 = __webpack_require__(73); +var NOOP = __webpack_require__(1); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + +/***/ }), +/* 833 */ /***/ (function(module, exports) { /** @@ -140244,8 +148150,8 @@ module.exports = Difference; * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -140263,7 +148169,7 @@ module.exports = FloorTo; /***/ }), -/* 792 */ +/* 834 */ /***/ (function(module, exports) { /** @@ -140279,7 +148185,7 @@ module.exports = FloorTo; * @since 3.0.0 * * @param {number} distance - The distance. - * @param {integer} time - The time, in seconds. + * @param {number} time - The time, in seconds. * * @return {number} The speed, in distance per ms. * @@ -140296,7 +148202,7 @@ module.exports = GetSpeed; /***/ }), -/* 793 */ +/* 835 */ /***/ (function(module, exports) { /** @@ -140327,7 +148233,7 @@ module.exports = IsEven; /***/ }), -/* 794 */ +/* 836 */ /***/ (function(module, exports) { /** @@ -140356,7 +148262,7 @@ module.exports = IsEvenStrict; /***/ }), -/* 795 */ +/* 837 */ /***/ (function(module, exports) { /** @@ -140386,7 +148292,7 @@ module.exports = MaxAdd; /***/ }), -/* 796 */ +/* 838 */ /***/ (function(module, exports) { /** @@ -140416,7 +148322,7 @@ module.exports = MinSub; /***/ }), -/* 797 */ +/* 839 */ /***/ (function(module, exports) { /** @@ -140475,7 +148381,7 @@ module.exports = Percent; /***/ }), -/* 798 */ +/* 840 */ /***/ (function(module, exports) { /** @@ -140515,7 +148421,7 @@ module.exports = RandomXY; /***/ }), -/* 799 */ +/* 841 */ /***/ (function(module, exports) { /** @@ -140554,7 +148460,7 @@ module.exports = RandomXYZ; /***/ }), -/* 800 */ +/* 842 */ /***/ (function(module, exports) { /** @@ -140591,7 +148497,7 @@ module.exports = RandomXYZW; /***/ }), -/* 801 */ +/* 843 */ /***/ (function(module, exports) { /** @@ -140628,7 +148534,7 @@ module.exports = RotateTo; /***/ }), -/* 802 */ +/* 844 */ /***/ (function(module, exports) { /** @@ -140661,8 +148567,8 @@ module.exports = RotateTo; * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -140680,7 +148586,7 @@ module.exports = RoundTo; /***/ }), -/* 803 */ +/* 845 */ /***/ (function(module, exports) { /** @@ -140733,7 +148639,7 @@ module.exports = SinCosTableGenerator; /***/ }), -/* 804 */ +/* 846 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140754,9 +148660,9 @@ var Vector2 = __webpack_require__(3); * @function Phaser.Math.ToXY * @since 3.19.0 * - * @param {integer} index - The position within the grid to get the x/y value for. - * @param {integer} width - The width of the grid. - * @param {integer} height - The height of the grid. + * @param {number} index - The position within the grid to get the x/y value for. + * @param {number} width - The width of the grid. + * @param {number} height - The height of the grid. * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. * * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. @@ -140791,7 +148697,7 @@ module.exports = ToXY; /***/ }), -/* 805 */ +/* 847 */ /***/ (function(module, exports) { /** @@ -140821,7 +148727,7 @@ module.exports = Within; /***/ }), -/* 806 */ +/* 848 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140830,9 +148736,9 @@ module.exports = Within; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); -var Matrix4 = __webpack_require__(347); -var Quaternion = __webpack_require__(348); +var Vector3 = __webpack_require__(37); +var Matrix4 = __webpack_require__(73); +var Quaternion = __webpack_require__(357); var tmpMat4 = new Matrix4(); var tmpQuat = new Quaternion(); @@ -140869,7 +148775,103 @@ module.exports = RotateVec3; /***/ }), -/* 807 */ +/* 849 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Post-Render Event. + * + * This event is dispatched by the WebGL Renderer when all rendering, for all cameras in all Scenes, + * has completed. + * + * @event Phaser.Renderer.WebGL.Events#POST_RENDER + * @since 3.50.0 + */ +module.exports = 'postrender'; + + +/***/ }), +/* 850 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pre-Render Event. + * + * This event is dispatched by the WebGL Renderer. This happens right at the start of the render + * process, after the context has been cleared, the scissors enabled and everything has been + * reset ready for the render. + * + * @event Phaser.Renderer.WebGL.Events#PRE_RENDER + * @since 3.50.0 + */ +module.exports = 'prerender'; + + +/***/ }), +/* 851 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Render Event. + * + * This event is dispatched by the WebGL Renderer for every camera in every Scene. + * + * It is dispatched before any of the children in the Scene have been rendered. + * + * @event Phaser.Renderer.WebGL.Events#RENDER + * @since 3.50.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered. + */ +module.exports = 'render'; + + +/***/ }), +/* 852 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Renderer Resize Event. + * + * This event is dispatched by the WebGL Renderer when it is resized, usually as a result + * of the Scale Manager resizing. + * + * @event Phaser.Renderer.WebGL.Events#RESIZE + * @since 3.50.0 + * + * @param {number} width - The new width of the renderer. + * @param {number} height - The new height of the renderer. + */ +module.exports = 'resize'; + + +/***/ }), +/* 853 */ /***/ (function(module, exports) { module.exports = [ @@ -140882,7 +148884,7 @@ module.exports = [ 'uniform sampler2D uMaskSampler;', 'uniform bool uInvertMaskAlpha;', '', - 'void main()', + 'void main ()', '{', ' vec2 uv = gl_FragCoord.xy / uResolution;', ' vec4 mainColor = texture2D(uMainSampler, uv);', @@ -140905,7 +148907,7 @@ module.exports = [ /***/ }), -/* 808 */ +/* 854 */ /***/ (function(module, exports) { module.exports = [ @@ -140915,7 +148917,7 @@ module.exports = [ '', 'attribute vec2 inPosition;', '', - 'void main()', + 'void main ()', '{', ' gl_Position = vec4(inPosition, 0.0, 1.0);', '}', @@ -140924,7 +148926,52 @@ module.exports = [ /***/ }), -/* 809 */ +/* 855 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_GRAPHICS_FS', + '', + 'precision mediump float;', + '', + 'varying vec4 outColor;', + '', + 'void main ()', + '{', + ' gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 856 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_GRAPHICS_VS', + '', + 'precision mediump float;', + '', + 'uniform mat4 uProjectionMatrix;', + '', + 'attribute vec2 inPosition;', + 'attribute vec4 inColor;', + '', + 'varying vec4 outColor;', + '', + 'void main ()', + '{', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', + '', + ' outColor = inColor;', + '}', + '' +].join('\n'); + + +/***/ }), +/* 857 */ /***/ (function(module, exports) { module.exports = [ @@ -140956,7 +149003,7 @@ module.exports = [ 'void main()', '{', ' vec3 finalColor = vec3(0.0, 0.0, 0.0);', - ' vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);', + ' vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);', ' vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;', ' vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));', ' vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;', @@ -140983,7 +149030,73 @@ module.exports = [ /***/ }), -/* 810 */ +/* 858 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_POINTLIGHT_FS', + '', + 'precision mediump float;', + '', + 'uniform vec2 uResolution;', + '', + 'varying vec4 lightPosition;', + 'varying vec4 lightColor;', + 'varying float lightRadius;', + '', + 'void main ()', + '{', + ' vec2 center = vec2((lightPosition.x + 1.0) * uResolution.x, (lightPosition.y + 1.0) * uResolution.y);', + '', + ' float distance = length(center - gl_FragCoord.xy);', + '', + ' float attenuation = 1.0 / (0.01 * distance * distance);', + ' float radius = 1.0 - min(distance, lightRadius) / lightRadius;', + ' float intensity = smoothstep(0.0, 1.0, min(attenuation, radius));', + '', + ' vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;', + '', + ' gl_FragColor = vec4(color.rgb * lightColor.a, color.a);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 859 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_POINTLIGHT_VS', + '', + 'precision mediump float;', + '', + 'uniform mat4 uProjectionMatrix;', + '', + 'attribute vec2 inPosition;', + 'attribute vec2 inLightPosition;', + 'attribute vec4 inLightColor;', + 'attribute float inLightRadius;', + 'attribute float inLightIntensity;', + '', + 'varying vec4 lightPosition;', + 'varying vec4 lightColor;', + 'varying float lightRadius;', + '', + 'void main ()', + '{', + ' lightColor = inLightColor;', + ' lightRadius = inLightRadius;', + ' lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);', + '', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 860 */ /***/ (function(module, exports) { module.exports = [ @@ -140998,25 +149111,21 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'void main()', + 'void main ()', '{', ' vec4 texture;', '', ' %forloop%', '', - ' vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);', - ' vec4 color = texture;', + ' vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);', '', - ' if (outTintEffect == 0.0)', - ' {', - ' // Multiply texture tint', - ' color = texture * texel;', - ' }', - ' else if (outTintEffect == 1.0)', + ' // Multiply texture tint', + ' vec4 color = texture * texel;', + '', + ' if (outTintEffect == 1.0)', ' {', ' // Solid color + texture alpha', - ' color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);', - ' color.a = texture.a * texel.a;', + ' color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);', ' }', ' else if (outTintEffect == 2.0)', ' {', @@ -141031,7 +149140,7 @@ module.exports = [ /***/ }), -/* 811 */ +/* 861 */ /***/ (function(module, exports) { module.exports = [ @@ -141040,8 +149149,6 @@ module.exports = [ 'precision mediump float;', '', 'uniform mat4 uProjectionMatrix;', - 'uniform mat4 uViewMatrix;', - 'uniform mat4 uModelMatrix;', '', 'attribute vec2 inPosition;', 'attribute vec2 inTexCoord;', @@ -141056,20 +149163,19 @@ module.exports = [ '', 'void main ()', '{', - ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', '', ' outTexCoord = inTexCoord;', ' outTexId = inTexId;', ' outTint = inTint;', ' outTintEffect = inTintEffect;', '}', - '', '' ].join('\n'); /***/ }), -/* 812 */ +/* 862 */ /***/ (function(module, exports) { module.exports = [ @@ -141083,22 +149189,18 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'void main()', + 'void main ()', '{', ' vec4 texture = texture2D(uMainSampler, outTexCoord);', - ' vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);', - ' vec4 color = texture;', + ' vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);', '', - ' if (outTintEffect == 0.0)', - ' {', - ' // Multiply texture tint', - ' color = texture * texel;', - ' }', - ' else if (outTintEffect == 1.0)', + ' // Multiply texture tint', + ' vec4 color = texture * texel;', + '', + ' if (outTintEffect == 1.0)', ' {', ' // Solid color + texture alpha', - ' color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);', - ' color.a = texture.a * texel.a;', + ' color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);', ' }', ' else if (outTintEffect == 2.0)', ' {', @@ -141113,7 +149215,7 @@ module.exports = [ /***/ }), -/* 813 */ +/* 863 */ /***/ (function(module, exports) { module.exports = [ @@ -141122,11 +149224,10 @@ module.exports = [ 'precision mediump float;', '', 'uniform mat4 uProjectionMatrix;', - 'uniform mat4 uViewMatrix;', - 'uniform mat4 uModelMatrix;', '', 'attribute vec2 inPosition;', 'attribute vec2 inTexCoord;', + 'attribute float inTexId;', 'attribute float inTintEffect;', 'attribute vec4 inTint;', '', @@ -141136,7 +149237,7 @@ module.exports = [ '', 'void main ()', '{', - ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', '', ' outTexCoord = inTexCoord;', ' outTint = inTint;', @@ -141147,7 +149248,688 @@ module.exports = [ /***/ }), -/* 814 */ +/* 864 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AddBlendFS = __webpack_require__(865); +var Class = __webpack_require__(0); +var ColorMatrix = __webpack_require__(264); +var ColorMatrixFS = __webpack_require__(866); +var CopyFS = __webpack_require__(867); +var GetFastValue = __webpack_require__(2); +var LinearBlendFS = __webpack_require__(868); +var QuadVS = __webpack_require__(579); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); + +/** + * @classdesc + * The Utility Pipeline is a special-use pipeline that belongs to the Pipeline Manager. + * + * It provides 4 shaders and handy associated methods: + * + * 1) Copy Shader. A fast texture to texture copy shader with optional brightness setting. + * 2) Additive Blend Mode Shader. Blends two textures using an additive blend mode. + * 3) Linear Blend Mode Shader. Blends two textures using a linear blend mode. + * 4) Color Matrix Copy Shader. Draws a texture to a target using a Color Matrix. + * + * You typically do not extend or access this pipeline directly, but instead go + * via the following methods in the Pipeline Manager: + * + * `copyFrame` + * `drawFrame` + * `blendFrames` + * `blendFramesAdditive` + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * This pipeline has a hard-coded batch size of 1 and a hard coded set of vertices. + * + * @class UtilityPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var UtilityPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function UtilityPipeline (config) + { + config.renderTarget = GetFastValue(config, 'renderTarget', [ + { + scale: 1 + }, + { + scale: 1 + }, + { + scale: 0.5 + }, + { + scale: 0.5 + } + ]); + + config.vertShader = GetFastValue(config, 'vertShader', QuadVS); + + config.shaders = GetFastValue(config, 'shaders', [ + { + name: 'Copy', + fragShader: CopyFS, + uniforms: [ + 'uMainSampler', + 'uBrightness' + ] + }, + { + name: 'AddBlend', + fragShader: AddBlendFS, + uniforms: [ + 'uMainSampler1', + 'uMainSampler2', + 'uStrength' + ] + }, + { + name: 'LinearBlend', + fragShader: LinearBlendFS, + uniforms: [ + 'uMainSampler1', + 'uMainSampler2', + 'uStrength' + ] + }, + { + name: 'ColorMatrix', + fragShader: ColorMatrixFS, + uniforms: [ + 'uMainSampler', + 'uColorMatrix', + 'uAlpha' + ] + } + ]); + + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTexCoord', + size: 2, + type: WEBGL_CONST.FLOAT + } + ]); + + // x, y, u, v (x/y in NDC) + config.vertices = new Float32Array([ + -1, -1, 0, 0, + -1, 1, 0, 1, + 1, 1, 1, 1, + -1, -1, 0, 0, + 1, 1, 1, 1, + 1, -1, 1, 0 + ]); + + config.batchSize = 1; + + WebGLPipeline.call(this, config); + + /** + * A default Color Matrix, used by the Color Matrix Shader when one + * isn't provided. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#colorMatrix + * @type {Phaser.Display.ColorMatrix} + * @since 3.50.0 + */ + this.colorMatrix = new ColorMatrix(); + + /** + * A reference to the Copy Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @default null + * @since 3.50.0 + */ + this.copyShader; + + /** + * A reference to the Additive Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#addShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.addShader; + + /** + * A reference to the Linear Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#linearShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.linearShader; + + /** + * A reference to the Color Matrix Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#colorMatrixShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.colorMatrixShader; + + /** + * A reference to the Full Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.halfFrame2; + }, + + boot: function () + { + WebGLPipeline.prototype.boot.call(this); + + var shaders = this.shaders; + var targets = this.renderTargets; + + this.copyShader = shaders[0]; + this.addShader = shaders[1]; + this.linearShader = shaders[2]; + this.colorMatrixShader = shaders[3]; + + this.fullFrame1 = targets[0]; + this.fullFrame2 = targets[1]; + this.halfFrame1 = targets[2]; + this.halfFrame2 = targets[3]; + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + if (brightness === undefined) { brightness = 1; } + if (clear === undefined) { clear = true; } + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.copyShader); + this.set1f('uBrightness', brightness, this.copyShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + } + else + { + gl.viewport(0, 0, source.width, source.height); + } + + if (clear) + { + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.copyShader); + this.set1f('uBrightness', 1, this.copyShader); + + this.renderer.popFramebuffer(); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + this.renderer.resetTextures(); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Display.ColorMatrix} [colorMatrix] - The Color Matrix to use when performing the draw. + */ + drawFrame: function (source, target, clearAlpha, colorMatrix) + { + if (clearAlpha === undefined) { clearAlpha = true; } + if (colorMatrix === undefined) { colorMatrix = this.colorMatrix; } + + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.colorMatrixShader); + this.set1fv('uColorMatrix', colorMatrix.getData(), this.colorMatrixShader); + this.set1f('uAlpha', colorMatrix.alpha, this.colorMatrixShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + } + else + { + gl.viewport(0, 0, source.width, source.height); + } + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Renderer.WebGL.WebGLShader} [blendShader] - The shader to use during the blend copy. + */ + blendFrames: function (source1, source2, target, strength, clearAlpha, blendShader) + { + if (strength === undefined) { strength = 1; } + if (clearAlpha === undefined) { clearAlpha = true; } + if (blendShader === undefined) { blendShader = this.linearShader; } + + var gl = this.gl; + + this.set1i('uMainSampler1', 0, blendShader); + this.set1i('uMainSampler2', 1, blendShader); + this.set1f('uStrength', strength, blendShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source1.texture); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(gl.TEXTURE_2D, source2.texture); + + if (target) + { + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + gl.viewport(0, 0, target.width, target.height); + } + else + { + gl.viewport(0, 0, source1.width, source1.height); + } + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + this.blendFrames(source1, source2, target, strength, clearAlpha, this.addShader); + }, + + /** + * Clears the given Render Target. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#clearFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to clear. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + clearFrame: function (target, clearAlpha) + { + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + + gl.viewport(0, 0, target.width, target.height); + + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + var fbo = this.renderer.currentFramebuffer; + + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + } + +}); + +module.exports = UtilityPipeline; + + +/***/ }), +/* 865 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_ADD_BLEND_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler1;', + 'uniform sampler2D uMainSampler2;', + 'uniform float uStrength;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 frame1 = texture2D(uMainSampler1, outTexCoord);', + ' vec4 frame2 = texture2D(uMainSampler2, outTexCoord);', + '', + ' gl_FragColor = frame1 + frame2 * uStrength;', + '}', + '' +].join('\n'); + + +/***/ }), +/* 866 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_COLORMATRIX_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + 'uniform float uColorMatrix[20];', + 'uniform float uAlpha;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 c = texture2D(uMainSampler, outTexCoord);', + '', + ' if (uAlpha == 0.0)', + ' {', + ' gl_FragColor = c;', + '', + ' return;', + ' }', + '', + ' if (c.a > 0.0)', + ' {', + ' c.rgb /= c.a;', + ' }', + '', + ' vec4 result;', + '', + ' result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];', + ' result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];', + ' result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];', + ' result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];', + '', + ' vec3 rgb = mix(c.rgb, result.rgb, uAlpha);', + '', + ' rgb *= result.a;', + '', + ' gl_FragColor = vec4(rgb, result.a);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 867 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_COPY_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + 'uniform float uBrightness;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;', + '}', + '' +].join('\n'); + + +/***/ }), +/* 868 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_LINEAR_BLEND_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler1;', + 'uniform sampler2D uMainSampler2;', + 'uniform float uStrength;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 frame1 = texture2D(uMainSampler1, outTexCoord);', + ' vec4 frame2 = texture2D(uMainSampler2, outTexCoord);', + '', + ' gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 869 */ /***/ (function(module, exports) { /** @@ -141173,7 +149955,7 @@ module.exports = 'addtexture'; /***/ }), -/* 815 */ +/* 870 */ /***/ (function(module, exports) { /** @@ -141199,7 +149981,7 @@ module.exports = 'onerror'; /***/ }), -/* 816 */ +/* 871 */ /***/ (function(module, exports) { /** @@ -141228,7 +150010,7 @@ module.exports = 'onload'; /***/ }), -/* 817 */ +/* 872 */ /***/ (function(module, exports) { /** @@ -141251,7 +150033,7 @@ module.exports = 'ready'; /***/ }), -/* 818 */ +/* 873 */ /***/ (function(module, exports) { /** @@ -141279,7 +150061,7 @@ module.exports = 'removetexture'; /***/ }), -/* 819 */ +/* 874 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141294,14 +150076,14 @@ module.exports = 'removetexture'; module.exports = { - GenerateTexture: __webpack_require__(355), - Palettes: __webpack_require__(820) + GenerateTexture: __webpack_require__(364), + Palettes: __webpack_require__(875) }; /***/ }), -/* 820 */ +/* 875 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141316,17 +150098,17 @@ module.exports = { module.exports = { - ARNE16: __webpack_require__(356), - C64: __webpack_require__(821), - CGA: __webpack_require__(822), - JMP: __webpack_require__(823), - MSX: __webpack_require__(824) + ARNE16: __webpack_require__(365), + C64: __webpack_require__(876), + CGA: __webpack_require__(877), + JMP: __webpack_require__(878), + MSX: __webpack_require__(879) }; /***/ }), -/* 821 */ +/* 876 */ /***/ (function(module, exports) { /** @@ -141364,7 +150146,7 @@ module.exports = { /***/ }), -/* 822 */ +/* 877 */ /***/ (function(module, exports) { /** @@ -141402,7 +150184,7 @@ module.exports = { /***/ }), -/* 823 */ +/* 878 */ /***/ (function(module, exports) { /** @@ -141440,7 +150222,7 @@ module.exports = { /***/ }), -/* 824 */ +/* 879 */ /***/ (function(module, exports) { /** @@ -141478,7 +150260,7 @@ module.exports = { /***/ }), -/* 825 */ +/* 880 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141492,20 +150274,20 @@ module.exports = { */ module.exports = { - Path: __webpack_require__(826), - MoveTo: __webpack_require__(360), + Path: __webpack_require__(881), + MoveTo: __webpack_require__(369), - CubicBezier: __webpack_require__(357), - Curve: __webpack_require__(83), - Ellipse: __webpack_require__(358), - Line: __webpack_require__(359), - QuadraticBezier: __webpack_require__(361), - Spline: __webpack_require__(362) + CubicBezier: __webpack_require__(366), + Curve: __webpack_require__(88), + Ellipse: __webpack_require__(367), + Line: __webpack_require__(368), + QuadraticBezier: __webpack_require__(370), + Spline: __webpack_require__(371) }; /***/ }), -/* 826 */ +/* 881 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141517,14 +150299,14 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezierCurve = __webpack_require__(357); -var EllipseCurve = __webpack_require__(358); +var CubicBezierCurve = __webpack_require__(366); +var EllipseCurve = __webpack_require__(367); var GameObjectFactory = __webpack_require__(5); -var LineCurve = __webpack_require__(359); -var MovePathTo = __webpack_require__(360); -var QuadraticBezierCurve = __webpack_require__(361); +var LineCurve = __webpack_require__(368); +var MovePathTo = __webpack_require__(369); +var QuadraticBezierCurve = __webpack_require__(370); var Rectangle = __webpack_require__(9); -var SplineCurve = __webpack_require__(362); +var SplineCurve = __webpack_require__(371); var Vector2 = __webpack_require__(3); var MATH_CONST = __webpack_require__(13); @@ -141786,7 +150568,7 @@ var Path = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [out,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The Graphics Game Object to draw to. - * @param {integer} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. + * @param {number} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. * * @return {Phaser.GameObjects.Graphics} The Graphics object which was drawn to. */ @@ -141815,8 +150597,8 @@ var Path = new Class({ * * @param {number} [xRadius=0] - The horizontal radius of ellipse. * @param {number} [yRadius=0] - The vertical radius of ellipse. - * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. - * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {number} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {number} [endAngle=360] - The end angle of the ellipse, in degrees. * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. * @@ -141902,7 +150684,7 @@ var Path = new Class({ * @generic {Phaser.Math.Vector2} O - [out,$return] * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. - * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. + * @param {number} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. * * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. */ @@ -142084,7 +150866,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#getPoints * @since 3.0.0 * - * @param {integer} [divisions=12] - The number of divisions per resolution per curve. + * @param {number} [divisions=12] - The number of divisions per resolution per curve. * * @return {Phaser.Math.Vector2[]} An array of Vector2 objects that containing the points along the Path. */ @@ -142161,7 +150943,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#getSpacedPoints * @since 3.0.0 * - * @param {integer} [divisions=40] - The amount of points to divide this Path into. + * @param {number} [divisions=40] - The amount of points to divide this Path into. * * @return {Phaser.Math.Vector2[]} A list of the points this path was subdivided into. */ @@ -142394,7 +151176,7 @@ module.exports = Path; /***/ }), -/* 827 */ +/* 882 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142409,15 +151191,15 @@ module.exports = Path; module.exports = { - DataManager: __webpack_require__(120), - DataManagerPlugin: __webpack_require__(828), - Events: __webpack_require__(293) + DataManager: __webpack_require__(97), + DataManagerPlugin: __webpack_require__(883), + Events: __webpack_require__(307) }; /***/ }), -/* 828 */ +/* 883 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142427,8 +151209,8 @@ module.exports = { */ var Class = __webpack_require__(0); -var DataManager = __webpack_require__(120); -var PluginCache = __webpack_require__(23); +var DataManager = __webpack_require__(97); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -142544,7 +151326,7 @@ module.exports = DataManagerPlugin; /***/ }), -/* 829 */ +/* 884 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142559,18 +151341,20 @@ module.exports = DataManagerPlugin; module.exports = { - Align: __webpack_require__(830), - BaseShader: __webpack_require__(363), - Bounds: __webpack_require__(833), - Canvas: __webpack_require__(837), - Color: __webpack_require__(364), - Masks: __webpack_require__(846) + Align: __webpack_require__(885), + BaseShader: __webpack_require__(372), + Bounds: __webpack_require__(888), + Canvas: __webpack_require__(892), + Color: __webpack_require__(373), + ColorMatrix: __webpack_require__(264), + Masks: __webpack_require__(902), + RGB: __webpack_require__(376) }; /***/ }), -/* 830 */ +/* 885 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142579,8 +151363,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(108); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(120); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Display.Align @@ -142588,8 +151372,8 @@ var Extend = __webpack_require__(19); var Align = { - In: __webpack_require__(831), - To: __webpack_require__(832) + In: __webpack_require__(886), + To: __webpack_require__(887) }; @@ -142600,7 +151384,7 @@ module.exports = Align; /***/ }), -/* 831 */ +/* 886 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142615,22 +151399,22 @@ module.exports = Align; module.exports = { - BottomCenter: __webpack_require__(267), - BottomLeft: __webpack_require__(268), - BottomRight: __webpack_require__(269), - Center: __webpack_require__(270), - LeftCenter: __webpack_require__(272), - QuickSet: __webpack_require__(266), - RightCenter: __webpack_require__(273), - TopCenter: __webpack_require__(274), - TopLeft: __webpack_require__(275), - TopRight: __webpack_require__(276) + BottomCenter: __webpack_require__(282), + BottomLeft: __webpack_require__(283), + BottomRight: __webpack_require__(284), + Center: __webpack_require__(285), + LeftCenter: __webpack_require__(287), + QuickSet: __webpack_require__(281), + RightCenter: __webpack_require__(288), + TopCenter: __webpack_require__(289), + TopLeft: __webpack_require__(290), + TopRight: __webpack_require__(291) }; /***/ }), -/* 832 */ +/* 887 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142645,25 +151429,25 @@ module.exports = { module.exports = { - BottomCenter: __webpack_require__(254), - BottomLeft: __webpack_require__(255), - BottomRight: __webpack_require__(256), - LeftBottom: __webpack_require__(257), - LeftCenter: __webpack_require__(258), - LeftTop: __webpack_require__(259), - QuickSet: __webpack_require__(253), - RightBottom: __webpack_require__(260), - RightCenter: __webpack_require__(261), - RightTop: __webpack_require__(262), - TopCenter: __webpack_require__(263), - TopLeft: __webpack_require__(264), - TopRight: __webpack_require__(265) + BottomCenter: __webpack_require__(269), + BottomLeft: __webpack_require__(270), + BottomRight: __webpack_require__(271), + LeftBottom: __webpack_require__(272), + LeftCenter: __webpack_require__(273), + LeftTop: __webpack_require__(274), + QuickSet: __webpack_require__(268), + RightBottom: __webpack_require__(275), + RightCenter: __webpack_require__(276), + RightTop: __webpack_require__(277), + TopCenter: __webpack_require__(278), + TopLeft: __webpack_require__(279), + TopRight: __webpack_require__(280) }; /***/ }), -/* 833 */ +/* 888 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142678,28 +151462,28 @@ module.exports = { module.exports = { - CenterOn: __webpack_require__(271), - GetBottom: __webpack_require__(35), - GetBounds: __webpack_require__(834), - GetCenterX: __webpack_require__(77), - GetCenterY: __webpack_require__(79), - GetLeft: __webpack_require__(36), - GetOffsetX: __webpack_require__(835), - GetOffsetY: __webpack_require__(836), - GetRight: __webpack_require__(37), - GetTop: __webpack_require__(38), - SetBottom: __webpack_require__(48), - SetCenterX: __webpack_require__(78), - SetCenterY: __webpack_require__(80), - SetLeft: __webpack_require__(46), - SetRight: __webpack_require__(47), - SetTop: __webpack_require__(45) + CenterOn: __webpack_require__(286), + GetBottom: __webpack_require__(40), + GetBounds: __webpack_require__(889), + GetCenterX: __webpack_require__(83), + GetCenterY: __webpack_require__(85), + GetLeft: __webpack_require__(41), + GetOffsetX: __webpack_require__(890), + GetOffsetY: __webpack_require__(891), + GetRight: __webpack_require__(42), + GetTop: __webpack_require__(43), + SetBottom: __webpack_require__(54), + SetCenterX: __webpack_require__(84), + SetCenterY: __webpack_require__(86), + SetLeft: __webpack_require__(52), + SetRight: __webpack_require__(53), + SetTop: __webpack_require__(51) }; /***/ }), -/* 834 */ +/* 889 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142708,10 +151492,10 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); /** * Returns the unrotated bounds of the Game Object as a rectangle. @@ -142743,7 +151527,7 @@ module.exports = GetBounds; /***/ }), -/* 835 */ +/* 890 */ /***/ (function(module, exports) { /** @@ -142773,7 +151557,7 @@ module.exports = GetOffsetX; /***/ }), -/* 836 */ +/* 891 */ /***/ (function(module, exports) { /** @@ -142803,7 +151587,7 @@ module.exports = GetOffsetY; /***/ }), -/* 837 */ +/* 892 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142818,17 +151602,17 @@ module.exports = GetOffsetY; module.exports = { - CanvasInterpolation: __webpack_require__(350), - CanvasPool: __webpack_require__(26), - Smoothing: __webpack_require__(177), - TouchAction: __webpack_require__(838), - UserSelect: __webpack_require__(839) + CanvasInterpolation: __webpack_require__(359), + CanvasPool: __webpack_require__(31), + Smoothing: __webpack_require__(184), + TouchAction: __webpack_require__(893), + UserSelect: __webpack_require__(894) }; /***/ }), -/* 838 */ +/* 893 */ /***/ (function(module, exports) { /** @@ -142863,7 +151647,7 @@ module.exports = TouchAction; /***/ }), -/* 839 */ +/* 894 */ /***/ (function(module, exports) { /** @@ -142910,7 +151694,75 @@ module.exports = UserSelect; /***/ }), -/* 840 */ +/* 895 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetColor = __webpack_require__(100); + +/** + * Return an array of Colors in a Color Spectrum. + * + * @function Phaser.Display.Color.ColorSpectrum + * @since 3.50.0 + * + * @return {Phaser.Types.Display.ColorObject[]} An array containing 1024 elements, where each contains a Color Object. + */ +var ColorSpectrum = function () +{ + var colors = []; + + var range = 255; + + var i; + var r = 255; + var g = 0; + var b = 0; + + // Red to Yellow + for (i = 0; i <= range; i++) + { + colors.push({ r: r, g: i, b: b, color: GetColor(r, i, b) }); + } + + g = 255; + + // Yellow to Green + for (i = range; i >= 0; i--) + { + colors.push({ r: i, g: g, b: b, color: GetColor(i, g, b) }); + } + + r = 0; + + // Green to Blue + for (i = 0; i <= range; i++, g--) + { + colors.push({ r: r, g: g, b: i, color: GetColor(r, g, i) }); + } + + g = 0; + b = 255; + + // Blue to Red + for (i = 0; i <= range; i++, b--, r++) + { + colors.push({ r: r, g: g, b: b, color: GetColor(r, g, b) }); + } + + return colors; +}; + +module.exports = ColorSpectrum; + + +/***/ }), +/* 896 */ /***/ (function(module, exports) { /** @@ -142950,7 +151802,7 @@ module.exports = ColorToRGBA; /***/ }), -/* 841 */ +/* 897 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -142959,8 +151811,8 @@ module.exports = ColorToRGBA; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); -var HueToComponent = __webpack_require__(366); +var Color = __webpack_require__(36); +var HueToComponent = __webpack_require__(375); /** * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. @@ -143000,7 +151852,7 @@ module.exports = HSLToColor; /***/ }), -/* 842 */ +/* 898 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143009,7 +151861,7 @@ module.exports = HSLToColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HSVToRGB = __webpack_require__(176); +var HSVToRGB = __webpack_require__(180); /** * Get HSV color wheel values in an array which will be 360 elements in size. @@ -143041,7 +151893,7 @@ module.exports = HSVColorWheel; /***/ }), -/* 843 */ +/* 899 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143050,7 +151902,7 @@ module.exports = HSVColorWheel; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(124); +var Linear = __webpack_require__(130); /** * @namespace Phaser.Display.Color.Interpolate @@ -143149,7 +152001,7 @@ module.exports = { /***/ }), -/* 844 */ +/* 900 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143158,8 +152010,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(182); -var Color = __webpack_require__(32); +var Between = __webpack_require__(187); +var Color = __webpack_require__(36); /** * Creates a new Color object where the r, g, and b values have been set to random values @@ -143168,8 +152020,8 @@ var Color = __webpack_require__(32); * @function Phaser.Display.Color.RandomRGB * @since 3.0.0 * - * @param {integer} [min=0] - The minimum value to set the random range from (between 0 and 255) - * @param {integer} [max=255] - The maximum value to set the random range from (between 0 and 255) + * @param {number} [min=0] - The minimum value to set the random range from (between 0 and 255) + * @param {number} [max=255] - The maximum value to set the random range from (between 0 and 255) * * @return {Phaser.Display.Color} A Color object. */ @@ -143185,7 +152037,7 @@ module.exports = RandomRGB; /***/ }), -/* 845 */ +/* 901 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143194,7 +152046,7 @@ module.exports = RandomRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ComponentToHex = __webpack_require__(365); +var ComponentToHex = __webpack_require__(374); /** * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. @@ -143202,10 +152054,10 @@ var ComponentToHex = __webpack_require__(365); * @function Phaser.Display.Color.RGBToString * @since 3.0.0 * - * @param {integer} r - The red color value. A number between 0 and 255. - * @param {integer} g - The green color value. A number between 0 and 255. - * @param {integer} b - The blue color value. A number between 0 and 255. - * @param {integer} [a=255] - The alpha value. A number between 0 and 255. + * @param {number} r - The red color value. A number between 0 and 255. + * @param {number} g - The green color value. A number between 0 and 255. + * @param {number} b - The blue color value. A number between 0 and 255. + * @param {number} [a=255] - The alpha value. A number between 0 and 255. * @param {string} [prefix=#] - The prefix of the string. Either `#` or `0x`. * * @return {string} A string-based representation of the color values. @@ -143229,7 +152081,7 @@ module.exports = RGBToString; /***/ }), -/* 846 */ +/* 902 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143244,14 +152096,14 @@ module.exports = RGBToString; module.exports = { - BitmapMask: __webpack_require__(287), - GeometryMask: __webpack_require__(288) + BitmapMask: __webpack_require__(302), + GeometryMask: __webpack_require__(303) }; /***/ }), -/* 847 */ +/* 903 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143266,14 +152118,14 @@ module.exports = { var Dom = { - AddToDOM: __webpack_require__(131), - DOMContentLoaded: __webpack_require__(367), - GetInnerHeight: __webpack_require__(368), - GetScreenOrientation: __webpack_require__(369), - GetTarget: __webpack_require__(374), - ParseXML: __webpack_require__(375), - RemoveFromDOM: __webpack_require__(188), - RequestAnimationFrame: __webpack_require__(353) + AddToDOM: __webpack_require__(137), + DOMContentLoaded: __webpack_require__(377), + GetInnerHeight: __webpack_require__(378), + GetScreenOrientation: __webpack_require__(379), + GetTarget: __webpack_require__(384), + ParseXML: __webpack_require__(385), + RemoveFromDOM: __webpack_require__(193), + RequestAnimationFrame: __webpack_require__(362) }; @@ -143281,7 +152133,7 @@ module.exports = Dom; /***/ }), -/* 848 */ +/* 904 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143294,11 +152146,11 @@ module.exports = Dom; * @namespace Phaser.Events */ -module.exports = { EventEmitter: __webpack_require__(849) }; +module.exports = { EventEmitter: __webpack_require__(905) }; /***/ }), -/* 849 */ +/* 905 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143308,8 +152160,8 @@ module.exports = { EventEmitter: __webpack_require__(849) }; */ var Class = __webpack_require__(0); -var EE = __webpack_require__(12); -var PluginCache = __webpack_require__(23); +var EE = __webpack_require__(10); +var PluginCache = __webpack_require__(25); /** * @classdesc @@ -143482,7 +152334,7 @@ module.exports = EventEmitter; /***/ }), -/* 850 */ +/* 906 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143491,33 +152343,33 @@ module.exports = EventEmitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(131); -var AnimationManager = __webpack_require__(301); -var CacheManager = __webpack_require__(305); -var CanvasPool = __webpack_require__(26); +var AddToDOM = __webpack_require__(137); +var AnimationManager = __webpack_require__(313); +var CacheManager = __webpack_require__(317); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); -var Config = __webpack_require__(327); -var CreateDOMContainer = __webpack_require__(851); -var CreateRenderer = __webpack_require__(349); -var DataManager = __webpack_require__(120); -var DebugHeader = __webpack_require__(351); -var Device = __webpack_require__(328); -var DOMContentLoaded = __webpack_require__(367); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(21); -var InputManager = __webpack_require__(376); -var PluginCache = __webpack_require__(23); -var PluginManager = __webpack_require__(381); -var ScaleManager = __webpack_require__(382); -var SceneManager = __webpack_require__(384); -var TextureEvents = __webpack_require__(130); -var TextureManager = __webpack_require__(389); -var TimeStep = __webpack_require__(352); -var VisibilityHandler = __webpack_require__(354); +var Config = __webpack_require__(338); +var CreateDOMContainer = __webpack_require__(907); +var CreateRenderer = __webpack_require__(358); +var DataManager = __webpack_require__(97); +var DebugHeader = __webpack_require__(360); +var Device = __webpack_require__(339); +var DOMContentLoaded = __webpack_require__(377); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(23); +var InputManager = __webpack_require__(386); +var PluginCache = __webpack_require__(25); +var PluginManager = __webpack_require__(391); +var ScaleManager = __webpack_require__(392); +var SceneManager = __webpack_require__(394); +var TextureEvents = __webpack_require__(136); +var TextureManager = __webpack_require__(399); +var TimeStep = __webpack_require__(361); +var VisibilityHandler = __webpack_require__(363); if (true) { - var SoundManagerCreator = __webpack_require__(393); + var SoundManagerCreator = __webpack_require__(403); } if (false) @@ -144185,7 +153037,7 @@ module.exports = Game; /***/ }), -/* 851 */ +/* 907 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144194,7 +153046,7 @@ module.exports = Game; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(131); +var AddToDOM = __webpack_require__(137); var CreateDOMContainer = function (game) { @@ -144229,7 +153081,7 @@ module.exports = CreateDOMContainer; /***/ }), -/* 852 */ +/* 908 */ /***/ (function(module, exports) { /** @@ -144250,7 +153102,7 @@ module.exports = 'boot'; /***/ }), -/* 853 */ +/* 909 */ /***/ (function(module, exports) { /** @@ -144271,7 +153123,7 @@ module.exports = 'destroy'; /***/ }), -/* 854 */ +/* 910 */ /***/ (function(module, exports) { /** @@ -144299,7 +153151,7 @@ module.exports = 'dragend'; /***/ }), -/* 855 */ +/* 911 */ /***/ (function(module, exports) { /** @@ -144330,7 +153182,7 @@ module.exports = 'dragenter'; /***/ }), -/* 856 */ +/* 912 */ /***/ (function(module, exports) { /** @@ -144362,7 +153214,7 @@ module.exports = 'drag'; /***/ }), -/* 857 */ +/* 913 */ /***/ (function(module, exports) { /** @@ -144393,7 +153245,7 @@ module.exports = 'dragleave'; /***/ }), -/* 858 */ +/* 914 */ /***/ (function(module, exports) { /** @@ -144427,7 +153279,7 @@ module.exports = 'dragover'; /***/ }), -/* 859 */ +/* 915 */ /***/ (function(module, exports) { /** @@ -144457,7 +153309,7 @@ module.exports = 'dragstart'; /***/ }), -/* 860 */ +/* 916 */ /***/ (function(module, exports) { /** @@ -144486,7 +153338,7 @@ module.exports = 'drop'; /***/ }), -/* 861 */ +/* 917 */ /***/ (function(module, exports) { /** @@ -144513,7 +153365,7 @@ module.exports = 'gameout'; /***/ }), -/* 862 */ +/* 918 */ /***/ (function(module, exports) { /** @@ -144540,7 +153392,7 @@ module.exports = 'gameover'; /***/ }), -/* 863 */ +/* 919 */ /***/ (function(module, exports) { /** @@ -144581,7 +153433,7 @@ module.exports = 'gameobjectdown'; /***/ }), -/* 864 */ +/* 920 */ /***/ (function(module, exports) { /** @@ -144612,7 +153464,7 @@ module.exports = 'dragend'; /***/ }), -/* 865 */ +/* 921 */ /***/ (function(module, exports) { /** @@ -144642,7 +153494,7 @@ module.exports = 'dragenter'; /***/ }), -/* 866 */ +/* 922 */ /***/ (function(module, exports) { /** @@ -144673,7 +153525,7 @@ module.exports = 'drag'; /***/ }), -/* 867 */ +/* 923 */ /***/ (function(module, exports) { /** @@ -144703,7 +153555,7 @@ module.exports = 'dragleave'; /***/ }), -/* 868 */ +/* 924 */ /***/ (function(module, exports) { /** @@ -144736,7 +153588,7 @@ module.exports = 'dragover'; /***/ }), -/* 869 */ +/* 925 */ /***/ (function(module, exports) { /** @@ -144770,7 +153622,7 @@ module.exports = 'dragstart'; /***/ }), -/* 870 */ +/* 926 */ /***/ (function(module, exports) { /** @@ -144800,7 +153652,7 @@ module.exports = 'drop'; /***/ }), -/* 871 */ +/* 927 */ /***/ (function(module, exports) { /** @@ -144841,7 +153693,7 @@ module.exports = 'gameobjectmove'; /***/ }), -/* 872 */ +/* 928 */ /***/ (function(module, exports) { /** @@ -144882,7 +153734,7 @@ module.exports = 'gameobjectout'; /***/ }), -/* 873 */ +/* 929 */ /***/ (function(module, exports) { /** @@ -144923,7 +153775,7 @@ module.exports = 'gameobjectover'; /***/ }), -/* 874 */ +/* 930 */ /***/ (function(module, exports) { /** @@ -144964,7 +153816,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 875 */ +/* 931 */ /***/ (function(module, exports) { /** @@ -145005,7 +153857,7 @@ module.exports = 'pointermove'; /***/ }), -/* 876 */ +/* 932 */ /***/ (function(module, exports) { /** @@ -145044,7 +153896,7 @@ module.exports = 'pointerout'; /***/ }), -/* 877 */ +/* 933 */ /***/ (function(module, exports) { /** @@ -145085,7 +153937,7 @@ module.exports = 'pointerover'; /***/ }), -/* 878 */ +/* 934 */ /***/ (function(module, exports) { /** @@ -145126,7 +153978,7 @@ module.exports = 'pointerup'; /***/ }), -/* 879 */ +/* 935 */ /***/ (function(module, exports) { /** @@ -145168,7 +154020,7 @@ module.exports = 'wheel'; /***/ }), -/* 880 */ +/* 936 */ /***/ (function(module, exports) { /** @@ -145209,7 +154061,7 @@ module.exports = 'gameobjectup'; /***/ }), -/* 881 */ +/* 937 */ /***/ (function(module, exports) { /** @@ -145253,7 +154105,7 @@ module.exports = 'gameobjectwheel'; /***/ }), -/* 882 */ +/* 938 */ /***/ (function(module, exports) { /** @@ -145274,7 +154126,7 @@ module.exports = 'boot'; /***/ }), -/* 883 */ +/* 939 */ /***/ (function(module, exports) { /** @@ -145299,7 +154151,7 @@ module.exports = 'process'; /***/ }), -/* 884 */ +/* 940 */ /***/ (function(module, exports) { /** @@ -145320,7 +154172,7 @@ module.exports = 'update'; /***/ }), -/* 885 */ +/* 941 */ /***/ (function(module, exports) { /** @@ -145355,7 +154207,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 886 */ +/* 942 */ /***/ (function(module, exports) { /** @@ -145389,7 +154241,7 @@ module.exports = 'pointerdownoutside'; /***/ }), -/* 887 */ +/* 943 */ /***/ (function(module, exports) { /** @@ -145424,7 +154276,7 @@ module.exports = 'pointermove'; /***/ }), -/* 888 */ +/* 944 */ /***/ (function(module, exports) { /** @@ -145459,7 +154311,7 @@ module.exports = 'pointerout'; /***/ }), -/* 889 */ +/* 945 */ /***/ (function(module, exports) { /** @@ -145494,7 +154346,7 @@ module.exports = 'pointerover'; /***/ }), -/* 890 */ +/* 946 */ /***/ (function(module, exports) { /** @@ -145529,7 +154381,7 @@ module.exports = 'pointerup'; /***/ }), -/* 891 */ +/* 947 */ /***/ (function(module, exports) { /** @@ -145563,7 +154415,7 @@ module.exports = 'pointerupoutside'; /***/ }), -/* 892 */ +/* 948 */ /***/ (function(module, exports) { /** @@ -145601,7 +154453,7 @@ module.exports = 'wheel'; /***/ }), -/* 893 */ +/* 949 */ /***/ (function(module, exports) { /** @@ -145625,7 +154477,7 @@ module.exports = 'pointerlockchange'; /***/ }), -/* 894 */ +/* 950 */ /***/ (function(module, exports) { /** @@ -145647,7 +154499,7 @@ module.exports = 'preupdate'; /***/ }), -/* 895 */ +/* 951 */ /***/ (function(module, exports) { /** @@ -145668,7 +154520,7 @@ module.exports = 'shutdown'; /***/ }), -/* 896 */ +/* 952 */ /***/ (function(module, exports) { /** @@ -145690,7 +154542,7 @@ module.exports = 'start'; /***/ }), -/* 897 */ +/* 953 */ /***/ (function(module, exports) { /** @@ -145715,7 +154567,7 @@ module.exports = 'update'; /***/ }), -/* 898 */ +/* 954 */ /***/ (function(module, exports) { /** @@ -145745,7 +154597,7 @@ module.exports = 'addfile'; /***/ }), -/* 899 */ +/* 955 */ /***/ (function(module, exports) { /** @@ -145766,14 +154618,14 @@ module.exports = 'addfile'; * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {integer} totalComplete - The total number of files that successfully loaded. - * @param {integer} totalFailed - The total number of files that failed to load. + * @param {number} totalComplete - The total number of files that successfully loaded. + * @param {number} totalFailed - The total number of files that failed to load. */ module.exports = 'complete'; /***/ }), -/* 900 */ +/* 956 */ /***/ (function(module, exports) { /** @@ -145802,7 +154654,7 @@ module.exports = 'filecomplete'; /***/ }), -/* 901 */ +/* 957 */ /***/ (function(module, exports) { /** @@ -145856,7 +154708,7 @@ module.exports = 'filecomplete-'; /***/ }), -/* 902 */ +/* 958 */ /***/ (function(module, exports) { /** @@ -145881,7 +154733,7 @@ module.exports = 'loaderror'; /***/ }), -/* 903 */ +/* 959 */ /***/ (function(module, exports) { /** @@ -145907,7 +154759,7 @@ module.exports = 'load'; /***/ }), -/* 904 */ +/* 960 */ /***/ (function(module, exports) { /** @@ -145934,7 +154786,7 @@ module.exports = 'fileprogress'; /***/ }), -/* 905 */ +/* 961 */ /***/ (function(module, exports) { /** @@ -145963,7 +154815,7 @@ module.exports = 'postprocess'; /***/ }), -/* 906 */ +/* 962 */ /***/ (function(module, exports) { /** @@ -145988,7 +154840,7 @@ module.exports = 'progress'; /***/ }), -/* 907 */ +/* 963 */ /***/ (function(module, exports) { /** @@ -146015,7 +154867,7 @@ module.exports = 'start'; /***/ }), -/* 908 */ +/* 964 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146077,7 +154929,7 @@ module.exports = InjectionMap; /***/ }), -/* 909 */ +/* 965 */ /***/ (function(module, exports) { /** @@ -146095,7 +154947,7 @@ module.exports = InjectionMap; * @since 3.7.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {*} xml - The XML data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -146158,7 +155010,7 @@ module.exports = AtlasXML; /***/ }), -/* 910 */ +/* 966 */ /***/ (function(module, exports) { /** @@ -146176,7 +155028,7 @@ module.exports = AtlasXML; * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. */ @@ -146193,7 +155045,7 @@ module.exports = Canvas; /***/ }), -/* 911 */ +/* 967 */ /***/ (function(module, exports) { /** @@ -146211,7 +155063,7 @@ module.exports = Canvas; * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. */ @@ -146228,7 +155080,7 @@ module.exports = Image; /***/ }), -/* 912 */ +/* 968 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146237,7 +155089,7 @@ module.exports = Image; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Parses a Texture Atlas JSON Array and adds the Frames to the Texture. @@ -146249,7 +155101,7 @@ var Clone = __webpack_require__(69); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} json - The JSON data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -146337,7 +155189,7 @@ module.exports = JSONArray; /***/ }), -/* 913 */ +/* 969 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146346,7 +155198,7 @@ module.exports = JSONArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Parses a Texture Atlas JSON Hash and adds the Frames to the Texture. @@ -146358,7 +155210,7 @@ var Clone = __webpack_require__(69); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} json - The JSON data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -146450,7 +155302,7 @@ module.exports = JSONHash; /***/ }), -/* 914 */ +/* 970 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146473,11 +155325,11 @@ var GetFastValue = __webpack_require__(2); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. - * @param {integer} x - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. - * @param {integer} y - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. - * @param {integer} width - The width of the source image. - * @param {integer} height - The height of the source image. + * @param {number} sourceIndex - The index of the TextureSource. + * @param {number} x - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. + * @param {number} y - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. + * @param {number} width - The width of the source image. + * @param {number} height - The height of the source image. * @param {object} config - An object describing how to parse the Sprite Sheet. * @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet. * @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided. @@ -146575,7 +155427,7 @@ module.exports = SpriteSheet; /***/ }), -/* 915 */ +/* 971 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146766,7 +155618,7 @@ module.exports = SpriteSheetFromAtlas; /***/ }), -/* 916 */ +/* 972 */ /***/ (function(module, exports) { /** @@ -146816,7 +155668,7 @@ var addFrame = function (texture, sourceIndex, name, frame) * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} yaml - The YAML data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -146936,7 +155788,7 @@ TextureImporter: /***/ }), -/* 917 */ +/* 973 */ /***/ (function(module, exports) { /** @@ -146967,7 +155819,7 @@ module.exports = 'complete'; /***/ }), -/* 918 */ +/* 974 */ /***/ (function(module, exports) { /** @@ -146997,7 +155849,7 @@ module.exports = 'decoded'; /***/ }), -/* 919 */ +/* 975 */ /***/ (function(module, exports) { /** @@ -147029,7 +155881,7 @@ module.exports = 'decodedall'; /***/ }), -/* 920 */ +/* 976 */ /***/ (function(module, exports) { /** @@ -147061,7 +155913,7 @@ module.exports = 'destroy'; /***/ }), -/* 921 */ +/* 977 */ /***/ (function(module, exports) { /** @@ -147094,7 +155946,7 @@ module.exports = 'detune'; /***/ }), -/* 922 */ +/* 978 */ /***/ (function(module, exports) { /** @@ -147122,7 +155974,7 @@ module.exports = 'detune'; /***/ }), -/* 923 */ +/* 979 */ /***/ (function(module, exports) { /** @@ -147149,7 +156001,7 @@ module.exports = 'mute'; /***/ }), -/* 924 */ +/* 980 */ /***/ (function(module, exports) { /** @@ -147177,7 +156029,7 @@ module.exports = 'rate'; /***/ }), -/* 925 */ +/* 981 */ /***/ (function(module, exports) { /** @@ -147204,7 +156056,7 @@ module.exports = 'volume'; /***/ }), -/* 926 */ +/* 982 */ /***/ (function(module, exports) { /** @@ -147238,7 +156090,7 @@ module.exports = 'loop'; /***/ }), -/* 927 */ +/* 983 */ /***/ (function(module, exports) { /** @@ -147272,7 +156124,7 @@ module.exports = 'looped'; /***/ }), -/* 928 */ +/* 984 */ /***/ (function(module, exports) { /** @@ -147305,7 +156157,7 @@ module.exports = 'mute'; /***/ }), -/* 929 */ +/* 985 */ /***/ (function(module, exports) { /** @@ -147332,7 +156184,7 @@ module.exports = 'pauseall'; /***/ }), -/* 930 */ +/* 986 */ /***/ (function(module, exports) { /** @@ -147364,7 +156216,7 @@ module.exports = 'pause'; /***/ }), -/* 931 */ +/* 987 */ /***/ (function(module, exports) { /** @@ -147395,7 +156247,7 @@ module.exports = 'play'; /***/ }), -/* 932 */ +/* 988 */ /***/ (function(module, exports) { /** @@ -147428,7 +156280,7 @@ module.exports = 'rate'; /***/ }), -/* 933 */ +/* 989 */ /***/ (function(module, exports) { /** @@ -147455,7 +156307,7 @@ module.exports = 'resumeall'; /***/ }), -/* 934 */ +/* 990 */ /***/ (function(module, exports) { /** @@ -147488,7 +156340,7 @@ module.exports = 'resume'; /***/ }), -/* 935 */ +/* 991 */ /***/ (function(module, exports) { /** @@ -147521,7 +156373,7 @@ module.exports = 'seek'; /***/ }), -/* 936 */ +/* 992 */ /***/ (function(module, exports) { /** @@ -147548,7 +156400,7 @@ module.exports = 'stopall'; /***/ }), -/* 937 */ +/* 993 */ /***/ (function(module, exports) { /** @@ -147580,7 +156432,7 @@ module.exports = 'stop'; /***/ }), -/* 938 */ +/* 994 */ /***/ (function(module, exports) { /** @@ -147607,7 +156459,7 @@ module.exports = 'unlocked'; /***/ }), -/* 939 */ +/* 995 */ /***/ (function(module, exports) { /** @@ -147640,7 +156492,7 @@ module.exports = 'volume'; /***/ }), -/* 940 */ +/* 996 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147655,111 +156507,114 @@ module.exports = 'volume'; var GameObjects = { - Events: __webpack_require__(29), + Events: __webpack_require__(32), - DisplayList: __webpack_require__(941), - GameObjectCreator: __webpack_require__(16), + DisplayList: __webpack_require__(997), + GameObjectCreator: __webpack_require__(17), GameObjectFactory: __webpack_require__(5), - UpdateList: __webpack_require__(966), + UpdateList: __webpack_require__(1023), Components: __webpack_require__(11), - BuildGameObject: __webpack_require__(27), - BuildGameObjectAnimation: __webpack_require__(406), + BuildGameObject: __webpack_require__(28), + BuildGameObjectAnimation: __webpack_require__(416), GameObject: __webpack_require__(14), - BitmapText: __webpack_require__(140), - Blitter: __webpack_require__(199), - Bob: __webpack_require__(407), - Container: __webpack_require__(200), - DOMElement: __webpack_require__(409), - DynamicBitmapText: __webpack_require__(201), - Extern: __webpack_require__(411), - Graphics: __webpack_require__(202), - Group: __webpack_require__(100), - Image: __webpack_require__(114), - Particles: __webpack_require__(997), - PathFollower: __webpack_require__(424), - RenderTexture: __webpack_require__(206), - RetroFont: __webpack_require__(1005), - Rope: __webpack_require__(208), - Sprite: __webpack_require__(76), + BitmapText: __webpack_require__(144), + Blitter: __webpack_require__(204), + Bob: __webpack_require__(417), + Container: __webpack_require__(205), + DOMElement: __webpack_require__(419), + DynamicBitmapText: __webpack_require__(206), + Extern: __webpack_require__(421), + Graphics: __webpack_require__(207), + Group: __webpack_require__(108), + Image: __webpack_require__(122), + Layer: __webpack_require__(210), + Particles: __webpack_require__(1057), + PathFollower: __webpack_require__(434), + RenderTexture: __webpack_require__(212), + RetroFont: __webpack_require__(1065), + Rope: __webpack_require__(214), + Sprite: __webpack_require__(70), - Text: __webpack_require__(209), - GetTextSize: __webpack_require__(425), - MeasureText: __webpack_require__(427), - TextStyle: __webpack_require__(426), + Text: __webpack_require__(215), + GetTextSize: __webpack_require__(435), + MeasureText: __webpack_require__(437), + TextStyle: __webpack_require__(436), - TileSprite: __webpack_require__(210), - Zone: __webpack_require__(117), - Video: __webpack_require__(211), + TileSprite: __webpack_require__(216), + Zone: __webpack_require__(125), + Video: __webpack_require__(217), // Shapes - Shape: __webpack_require__(30), - Arc: __webpack_require__(428), - Curve: __webpack_require__(429), - Ellipse: __webpack_require__(430), - Grid: __webpack_require__(431), - IsoBox: __webpack_require__(432), - IsoTriangle: __webpack_require__(433), - Line: __webpack_require__(434), - Polygon: __webpack_require__(435), - Rectangle: __webpack_require__(440), - Star: __webpack_require__(441), - Triangle: __webpack_require__(442), + Shape: __webpack_require__(33), + Arc: __webpack_require__(438), + Curve: __webpack_require__(439), + Ellipse: __webpack_require__(440), + Grid: __webpack_require__(441), + IsoBox: __webpack_require__(442), + IsoTriangle: __webpack_require__(443), + Line: __webpack_require__(444), + Polygon: __webpack_require__(445), + Rectangle: __webpack_require__(450), + Star: __webpack_require__(451), + Triangle: __webpack_require__(452), // Game Object Factories Factories: { - Blitter: __webpack_require__(1053), - Container: __webpack_require__(1054), - DOMElement: __webpack_require__(1055), - DynamicBitmapText: __webpack_require__(1056), - Extern: __webpack_require__(1057), - Graphics: __webpack_require__(1058), - Group: __webpack_require__(1059), - Image: __webpack_require__(1060), - Particles: __webpack_require__(1061), - PathFollower: __webpack_require__(1062), - RenderTexture: __webpack_require__(1063), - Rope: __webpack_require__(1064), - Sprite: __webpack_require__(1065), - StaticBitmapText: __webpack_require__(1066), - Text: __webpack_require__(1067), - TileSprite: __webpack_require__(1068), - Zone: __webpack_require__(1069), - Video: __webpack_require__(1070), + Blitter: __webpack_require__(1113), + Container: __webpack_require__(1114), + DOMElement: __webpack_require__(1115), + DynamicBitmapText: __webpack_require__(1116), + Extern: __webpack_require__(1117), + Graphics: __webpack_require__(1118), + Group: __webpack_require__(1119), + Image: __webpack_require__(1120), + Layer: __webpack_require__(1121), + Particles: __webpack_require__(1122), + PathFollower: __webpack_require__(1123), + RenderTexture: __webpack_require__(1124), + Rope: __webpack_require__(1125), + Sprite: __webpack_require__(1126), + StaticBitmapText: __webpack_require__(1127), + Text: __webpack_require__(1128), + TileSprite: __webpack_require__(1129), + Zone: __webpack_require__(1130), + Video: __webpack_require__(1131), // Shapes - Arc: __webpack_require__(1071), - Curve: __webpack_require__(1072), - Ellipse: __webpack_require__(1073), - Grid: __webpack_require__(1074), - IsoBox: __webpack_require__(1075), - IsoTriangle: __webpack_require__(1076), - Line: __webpack_require__(1077), - Polygon: __webpack_require__(1078), - Rectangle: __webpack_require__(1079), - Star: __webpack_require__(1080), - Triangle: __webpack_require__(1081) + Arc: __webpack_require__(1132), + Curve: __webpack_require__(1133), + Ellipse: __webpack_require__(1134), + Grid: __webpack_require__(1135), + IsoBox: __webpack_require__(1136), + IsoTriangle: __webpack_require__(1137), + Line: __webpack_require__(1138), + Polygon: __webpack_require__(1139), + Rectangle: __webpack_require__(1140), + Star: __webpack_require__(1141), + Triangle: __webpack_require__(1142) }, Creators: { - Blitter: __webpack_require__(1082), - Container: __webpack_require__(1083), - DynamicBitmapText: __webpack_require__(1084), - Graphics: __webpack_require__(1085), - Group: __webpack_require__(1086), - Image: __webpack_require__(1087), - Particles: __webpack_require__(1088), - RenderTexture: __webpack_require__(1089), - Rope: __webpack_require__(1090), - Sprite: __webpack_require__(1091), - StaticBitmapText: __webpack_require__(1092), - Text: __webpack_require__(1093), - TileSprite: __webpack_require__(1094), - Zone: __webpack_require__(1095), - Video: __webpack_require__(1096) + Blitter: __webpack_require__(1143), + Container: __webpack_require__(1144), + DynamicBitmapText: __webpack_require__(1145), + Graphics: __webpack_require__(1146), + Group: __webpack_require__(1147), + Image: __webpack_require__(1148), + Layer: __webpack_require__(1149), + Particles: __webpack_require__(1150), + RenderTexture: __webpack_require__(1151), + Rope: __webpack_require__(1152), + Sprite: __webpack_require__(1153), + StaticBitmapText: __webpack_require__(1154), + Text: __webpack_require__(1155), + TileSprite: __webpack_require__(1156), + Zone: __webpack_require__(1157), + Video: __webpack_require__(1158) } }; @@ -147767,28 +156622,25 @@ var GameObjects = { if (true) { // WebGL only Game Objects - GameObjects.Mesh = __webpack_require__(142); - GameObjects.Quad = __webpack_require__(214); - GameObjects.Shader = __webpack_require__(215); + GameObjects.Shader = __webpack_require__(220); + GameObjects.Mesh = __webpack_require__(221); - GameObjects.Factories.Mesh = __webpack_require__(1103); - GameObjects.Factories.Quad = __webpack_require__(1104); - GameObjects.Factories.Shader = __webpack_require__(1105); + GameObjects.Factories.Shader = __webpack_require__(1165); + GameObjects.Factories.Mesh = __webpack_require__(1166); - GameObjects.Creators.Mesh = __webpack_require__(1106); - GameObjects.Creators.Quad = __webpack_require__(1107); - GameObjects.Creators.Shader = __webpack_require__(1108); + GameObjects.Creators.Shader = __webpack_require__(1167); + GameObjects.Creators.Mesh = __webpack_require__(1168); - GameObjects.Light = __webpack_require__(446); - GameObjects.LightsManager = __webpack_require__(447); - GameObjects.LightsPlugin = __webpack_require__(1109); + GameObjects.Light = __webpack_require__(458); + GameObjects.LightsManager = __webpack_require__(459); + GameObjects.LightsPlugin = __webpack_require__(1170); } module.exports = GameObjects; /***/ }), -/* 941 */ +/* 997 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147798,11 +156650,11 @@ module.exports = GameObjects; */ var Class = __webpack_require__(0); -var List = __webpack_require__(137); -var PluginCache = __webpack_require__(23); -var GameObjectEvents = __webpack_require__(29); +var List = __webpack_require__(105); +var PluginCache = __webpack_require__(25); +var GameObjectEvents = __webpack_require__(32); var SceneEvents = __webpack_require__(20); -var StableSort = __webpack_require__(139); +var StableSort = __webpack_require__(90); /** * @classdesc @@ -147903,6 +156755,15 @@ var DisplayList = new Class({ { gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + if (gameObject.displayList) + { + gameObject.displayList.remove(gameObject); + } + + gameObject.displayList = this; + + this.queueDepthSort(); + this.events.emit(SceneEvents.ADDED_TO_SCENE, gameObject, this.scene); }, @@ -147921,6 +156782,10 @@ var DisplayList = new Class({ { gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.displayList = null; + + this.queueDepthSort(); + this.events.emit(SceneEvents.REMOVED_FROM_SCENE, gameObject, this.scene); }, @@ -147974,7 +156839,7 @@ var DisplayList = new Class({ * @param {Phaser.GameObjects.GameObject} childA - The first Game Object. * @param {Phaser.GameObjects.GameObject} childB - The second Game Object. * - * @return {integer} The difference between the depths of each Game Object. + * @return {number} The difference between the depths of each Game Object. */ sortByDepth: function (childA, childB) { @@ -148046,7 +156911,7 @@ module.exports = DisplayList; /***/ }), -/* 942 */ +/* 998 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148061,21 +156926,22 @@ module.exports = DisplayList; module.exports = { - CheckMatrix: __webpack_require__(195), - MatrixToString: __webpack_require__(943), - ReverseColumns: __webpack_require__(944), - ReverseRows: __webpack_require__(945), - Rotate180: __webpack_require__(946), - RotateLeft: __webpack_require__(947), - RotateMatrix: __webpack_require__(138), - RotateRight: __webpack_require__(948), - TransposeMatrix: __webpack_require__(402) + CheckMatrix: __webpack_require__(200), + MatrixToString: __webpack_require__(999), + ReverseColumns: __webpack_require__(1000), + ReverseRows: __webpack_require__(1001), + Rotate180: __webpack_require__(1002), + RotateLeft: __webpack_require__(1003), + RotateMatrix: __webpack_require__(143), + RotateRight: __webpack_require__(1004), + Translate: __webpack_require__(1005), + TransposeMatrix: __webpack_require__(412) }; /***/ }), -/* 943 */ +/* 999 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148084,12 +156950,26 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(173); -var CheckMatrix = __webpack_require__(195); +var Pad = __webpack_require__(178); +var CheckMatrix = __webpack_require__(200); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * @@ -148156,7 +157036,7 @@ module.exports = MatrixToString; /***/ }), -/* 944 */ +/* 1000 */ /***/ (function(module, exports) { /** @@ -148168,6 +157048,20 @@ module.exports = MatrixToString; /** * Reverses the columns in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * @@ -148187,7 +157081,7 @@ module.exports = ReverseColumns; /***/ }), -/* 945 */ +/* 1001 */ /***/ (function(module, exports) { /** @@ -148199,6 +157093,20 @@ module.exports = ReverseColumns; /** * Reverses the rows in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseRows * @since 3.0.0 * @@ -148223,7 +157131,7 @@ module.exports = ReverseRows; /***/ }), -/* 946 */ +/* 1002 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148232,11 +157140,25 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(138); +var RotateMatrix = __webpack_require__(143); /** * Rotates the array matrix 180 degrees. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.Rotate180 * @since 3.0.0 * @@ -148256,7 +157178,7 @@ module.exports = Rotate180; /***/ }), -/* 947 */ +/* 1003 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148265,11 +157187,25 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(138); +var RotateMatrix = __webpack_require__(143); /** * Rotates the array matrix to the left (or 90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateLeft * @since 3.0.0 * @@ -148289,7 +157225,7 @@ module.exports = RotateLeft; /***/ }), -/* 948 */ +/* 1004 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148298,11 +157234,25 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(138); +var RotateMatrix = __webpack_require__(143); /** * Rotates the array matrix to the left (or -90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateRight * @since 3.0.0 * @@ -148322,7 +157272,96 @@ module.exports = RotateRight; /***/ }), -/* 949 */ +/* 1005 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(170); +var RotateRight = __webpack_require__(171); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), +/* 1006 */ /***/ (function(module, exports) { /** @@ -148348,7 +157387,7 @@ module.exports = RotateRight; * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -148439,7 +157478,7 @@ module.exports = Add; /***/ }), -/* 950 */ +/* 1007 */ /***/ (function(module, exports) { /** @@ -148467,8 +157506,8 @@ module.exports = Add; * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. - * @param {integer} [index=0] - The index in the array where the item will be inserted. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [index=0] - The index in the array where the item will be inserted. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -148561,7 +157600,7 @@ module.exports = AddAt; /***/ }), -/* 951 */ +/* 1008 */ /***/ (function(module, exports) { /** @@ -148599,7 +157638,7 @@ module.exports = BringToTop; /***/ }), -/* 952 */ +/* 1009 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148608,7 +157647,7 @@ module.exports = BringToTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Returns the total number of elements in the array which have a property matching the given value. @@ -148619,10 +157658,10 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} property - The property to test on each array element. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * - * @return {integer} The total number of elements with properties matching the given value. + * @return {number} The total number of elements with properties matching the given value. */ var CountAllMatching = function (array, property, value, startIndex, endIndex) { @@ -148651,7 +157690,7 @@ module.exports = CountAllMatching; /***/ }), -/* 953 */ +/* 1010 */ /***/ (function(module, exports) { /** @@ -148697,7 +157736,7 @@ module.exports = Each; /***/ }), -/* 954 */ +/* 1011 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148706,7 +157745,7 @@ module.exports = Each; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Passes each element in the array, between the start and end indexes, to the given callback. @@ -148717,8 +157756,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {function} callback - A callback to be invoked for each item in the array. * @param {object} context - The context in which the callback is invoked. - * @param {integer} startIndex - The start index to search from. - * @param {integer} endIndex - The end index to search to. + * @param {number} startIndex - The start index to search from. + * @param {number} endIndex - The end index to search to. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. * * @return {array} The input array. @@ -148753,7 +157792,7 @@ module.exports = EachInRange; /***/ }), -/* 955 */ +/* 1012 */ /***/ (function(module, exports) { /** @@ -148795,7 +157834,7 @@ module.exports = MoveDown; /***/ }), -/* 956 */ +/* 1013 */ /***/ (function(module, exports) { /** @@ -148813,7 +157852,7 @@ module.exports = MoveDown; * * @param {array} array - The array. * @param {*} item - The element to move. - * @param {integer} index - The new index that the element will be moved to. + * @param {number} index - The new index that the element will be moved to. * * @return {*} The element that was moved. */ @@ -148842,7 +157881,7 @@ module.exports = MoveTo; /***/ }), -/* 957 */ +/* 1014 */ /***/ (function(module, exports) { /** @@ -148884,7 +157923,7 @@ module.exports = MoveUp; /***/ }), -/* 958 */ +/* 1015 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148893,7 +157932,7 @@ module.exports = MoveUp; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RoundAwayFromZero = __webpack_require__(345); +var RoundAwayFromZero = __webpack_require__(355); /** * Create an array of numbers (positive and/or negative) progressing from `start` @@ -148961,7 +158000,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 959 */ +/* 1016 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148970,7 +158009,7 @@ module.exports = NumberArrayStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(82); +var SpliceOne = __webpack_require__(103); /** * Removes the item from the given position in the array. @@ -148983,7 +158022,7 @@ var SpliceOne = __webpack_require__(82); * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -149012,7 +158051,7 @@ module.exports = RemoveAt; /***/ }), -/* 960 */ +/* 1017 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149021,7 +158060,7 @@ module.exports = RemoveAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Removes the item within the given range in the array. @@ -149034,8 +158073,8 @@ var SafeRange = __webpack_require__(70); * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} startIndex - The start index to remove from. - * @param {integer} endIndex - The end index to remove to. + * @param {number} startIndex - The start index to remove from. + * @param {number} endIndex - The end index to remove to. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -149075,7 +158114,7 @@ module.exports = RemoveBetween; /***/ }), -/* 961 */ +/* 1018 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149084,7 +158123,7 @@ module.exports = RemoveBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(82); +var SpliceOne = __webpack_require__(103); /** * Removes a random object from the given array and returns it. @@ -149094,8 +158133,8 @@ var SpliceOne = __webpack_require__(82); * @since 3.0.0 * * @param {array} array - The array to removed a random element from. - * @param {integer} [start=0] - The array index to start the search from. - * @param {integer} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * @param {number} [start=0] - The array index to start the search from. + * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. * * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. */ @@ -149113,7 +158152,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 962 */ +/* 1019 */ /***/ (function(module, exports) { /** @@ -149157,7 +158196,7 @@ module.exports = Replace; /***/ }), -/* 963 */ +/* 1020 */ /***/ (function(module, exports) { /** @@ -149195,7 +158234,7 @@ module.exports = SendToBack; /***/ }), -/* 964 */ +/* 1021 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149204,7 +158243,7 @@ module.exports = SendToBack; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Scans the array for elements with the given property. If found, the property is set to the `value`. @@ -149220,8 +158259,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} property - The property to test for on each array element. * @param {*} value - The value to set the property to. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} The input array. */ @@ -149250,7 +158289,7 @@ module.exports = SetAll; /***/ }), -/* 965 */ +/* 1022 */ /***/ (function(module, exports) { /** @@ -149298,7 +158337,7 @@ module.exports = Swap; /***/ }), -/* 966 */ +/* 1023 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149308,8 +158347,8 @@ module.exports = Swap; */ var Class = __webpack_require__(0); -var ProcessQueue = __webpack_require__(197); -var PluginCache = __webpack_require__(23); +var ProcessQueue = __webpack_require__(202); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -149393,7 +158432,7 @@ var UpdateList = new Class({ * The total number of items awaiting processing. * * @name Phaser.GameObjects.UpdateList#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -149590,7 +158629,7 @@ var UpdateList = new Class({ * The number of entries in the active list. * * @name Phaser.GameObjects.UpdateList#length - * @type {integer} + * @type {number} * @readonly * @since 3.20.0 */ @@ -149602,7 +158641,7 @@ module.exports = UpdateList; /***/ }), -/* 967 */ +/* 1024 */ /***/ (function(module, exports) { /** @@ -149629,7 +158668,7 @@ module.exports = 'add'; /***/ }), -/* 968 */ +/* 1025 */ /***/ (function(module, exports) { /** @@ -149656,7 +158695,7 @@ module.exports = 'remove'; /***/ }), -/* 969 */ +/* 1026 */ /***/ (function(module, exports) { /** @@ -150178,7 +159217,7 @@ module.exports = GetBitmapTextSize; /***/ }), -/* 970 */ +/* 1027 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150187,7 +159226,7 @@ module.exports = GetBitmapTextSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ParseXMLBitmapFont = __webpack_require__(198); +var ParseXMLBitmapFont = __webpack_require__(203); /** * Parse an XML Bitmap Font from an Atlas. @@ -150203,8 +159242,8 @@ var ParseXMLBitmapFont = __webpack_require__(198); * @param {string} textureKey - The key of the BitmapFont's texture. * @param {string} frameKey - The key of the BitmapFont texture's frame. * @param {string} xmlKey - The key of the XML data of the font to parse. - * @param {integer} [xSpacing] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing] - The y-axis spacing to add to the line height. * * @return {boolean} Whether the parsing was successful or not. */ @@ -150232,7 +159271,7 @@ module.exports = ParseFromAtlas; /***/ }), -/* 971 */ +/* 1028 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150246,12 +159285,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(972); + renderWebGL = __webpack_require__(1029); } if (true) { - renderCanvas = __webpack_require__(974); + renderCanvas = __webpack_require__(1031); } module.exports = { @@ -150263,7 +159302,7 @@ module.exports = { /***/ }), -/* 972 */ +/* 1029 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150272,8 +159311,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BatchChar = __webpack_require__(973); -var Utils = __webpack_require__(10); +var BatchChar = __webpack_require__(1030); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -150286,11 +159326,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BitmapTextWebGLRenderer = function (renderer, src, camera, parentMatrix) { var text = src._text; var textLength = text.length; @@ -150300,36 +159339,9 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; var roundPixels = camera.roundPixels; @@ -150337,12 +159349,12 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, var charColors = src.charColors; - var tintEffect = (src._isTinted && src.tintFill); + var tintEffect = src.tintFill; - var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, cameraAlpha * src._alphaTL); - var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, cameraAlpha * src._alphaTR); - var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, cameraAlpha * src._alphaBL); - var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, cameraAlpha * src._alphaBR); + var tintTL = Utils.getTintAppendFloatAlpha(src.tintTopLeft, cameraAlpha * src._alphaTL); + var tintTR = Utils.getTintAppendFloatAlpha(src.tintTopRight, cameraAlpha * src._alphaTR); + var tintBL = Utils.getTintAppendFloatAlpha(src.tintBottomLeft, cameraAlpha * src._alphaBL); + var tintBR = Utils.getTintAppendFloatAlpha(src.tintBottomRight, cameraAlpha * src._alphaBR); var texture = src.frame.glTexture; var textureUnit = pipeline.setGameObject(src); @@ -150361,6 +159373,8 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, var dropShadow = (dropShadowX !== 0 || dropShadowY !== 0); + renderer.pipelines.preBatch(src); + if (dropShadow) { var srcShadowColor = src._dropShadowColorGL; @@ -150415,13 +159429,15 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, // Debug test if the characters are in the correct place when rendered: // pipeline.drawFillRect(tx0, ty0, tx2 - tx0, ty2 - ty0, 0x00ff00, 0.5); } + + renderer.pipelines.postBatch(src); }; module.exports = BitmapTextWebGLRenderer; /***/ }), -/* 973 */ +/* 1030 */ /***/ (function(module, exports) { /** @@ -150473,14 +159489,14 @@ var BatchChar = function (pipeline, src, char, glyph, offsetX, offsetY, calcMatr var tx3 = calcMatrix.getXRound(xw, y, roundPixels); var ty3 = calcMatrix.getYRound(xw, y, roundPixels); - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, glyph.u0, glyph.v0, glyph.u1, glyph.v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + pipeline.batchQuad(src, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, glyph.u0, glyph.v0, glyph.u1, glyph.v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); }; module.exports = BatchChar; /***/ }), -/* 974 */ +/* 1031 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150489,7 +159505,7 @@ module.exports = BatchChar; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(28); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -150502,11 +159518,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BitmapTextCanvasRenderer = function (renderer, src, camera, parentMatrix) { var text = src._text; var textLength = text.length; @@ -150517,7 +159532,7 @@ var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, { return; } - + var textureFrame = src.frame; var chars = src.fontData.chars; @@ -150662,7 +159677,7 @@ module.exports = BitmapTextCanvasRenderer; /***/ }), -/* 975 */ +/* 1032 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150676,12 +159691,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(976); + renderWebGL = __webpack_require__(1033); } if (true) { - renderCanvas = __webpack_require__(977); + renderCanvas = __webpack_require__(1034); } module.exports = { @@ -150693,7 +159708,7 @@ module.exports = { /***/ }), -/* 976 */ +/* 1033 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150702,7 +159717,10 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); + +var tempMatrix = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -150715,11 +159733,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix) { var list = src.getRenderList(); @@ -150733,9 +159750,7 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam var cameraScrollX = camera.scrollX * src.scrollFactorX; var cameraScrollY = camera.scrollY * src.scrollFactorY; - var calcMatrix = pipeline._tempMatrix1; - - calcMatrix.copyFrom(camera.matrix); + var calcMatrix = tempMatrix.copyFrom(camera.matrix); if (parentMatrix) { @@ -150752,6 +159767,8 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam var alpha = camera.alpha * src.alpha; var roundPixels = camera.roundPixels; + renderer.pipelines.preBatch(src); + for (var index = 0; index < list.length; index++) { var bob = list[index]; @@ -150810,18 +159827,20 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam } // TL x/y, BL x/y, BR x/y, TR x/y - if (pipeline.batchQuad(tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit)) + if (pipeline.batchQuad(src, tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit)) { prevTextureSourceIndex = -1; } } + + renderer.pipelines.postBatch(src); }; module.exports = BlitterWebGLRenderer; /***/ }), -/* 977 */ +/* 1034 */ /***/ (function(module, exports) { /** @@ -150841,11 +159860,10 @@ module.exports = BlitterWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) { var list = src.getRenderList(); @@ -150901,7 +159919,7 @@ var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, ca } ctx.globalAlpha = bobAlpha; - + if (!flip) { if (roundPixels) @@ -150943,7 +159961,7 @@ var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, ca ctx.restore(); } } - + ctx.restore(); }; @@ -150951,7 +159969,7 @@ module.exports = BlitterCanvasRenderer; /***/ }), -/* 978 */ +/* 1035 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -150966,12 +159984,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(979); + renderWebGL = __webpack_require__(1036); } if (true) { - renderCanvas = __webpack_require__(980); + renderCanvas = __webpack_require__(1037); } module.exports = { @@ -150983,7 +160001,7 @@ module.exports = { /***/ }), -/* 979 */ +/* 1036 */ /***/ (function(module, exports) { /** @@ -151004,21 +160022,21 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; + var childCount = children.length; - if (children.length === 0) + if (childCount === 0) { return; } var transformMatrix = container.localTransform; - + if (parentMatrix) { transformMatrix.loadIdentity(); @@ -151032,6 +160050,8 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } + renderer.pipelines.preBatch(container); + var containerHasBlendMode = (container.blendMode !== -1); if (!containerHasBlendMode) @@ -151045,9 +160065,6 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent var scrollFactorX = container.scrollFactorX; var scrollFactorY = container.scrollFactorY; - var list = children; - var childCount = children.length; - for (var i = 0; i < childCount; i++) { var child = children[i]; @@ -151103,7 +160120,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent renderer.currentType = type; } - renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false; + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; // Set parent values child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); @@ -151111,7 +160128,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix); // Restore original values @@ -151126,13 +160143,15 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent renderer.newType = false; } + + renderer.pipelines.postBatch(container); }; module.exports = ContainerWebGLRenderer; /***/ }), -/* 980 */ +/* 1037 */ /***/ (function(module, exports) { /** @@ -151153,11 +160172,10 @@ module.exports = ContainerWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -151222,7 +160240,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); @@ -151239,7 +160257,7 @@ module.exports = ContainerCanvasRenderer; /***/ }), -/* 981 */ +/* 1038 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151253,12 +160271,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(410); + renderWebGL = __webpack_require__(420); } if (true) { - renderCanvas = __webpack_require__(410); + renderCanvas = __webpack_require__(420); } module.exports = { @@ -151270,7 +160288,7 @@ module.exports = { /***/ }), -/* 982 */ +/* 1039 */ /***/ (function(module, exports) { /** @@ -151312,7 +160330,7 @@ module.exports = [ /***/ }), -/* 983 */ +/* 1040 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151326,12 +160344,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(984); + renderWebGL = __webpack_require__(1041); } if (true) { - renderCanvas = __webpack_require__(985); + renderCanvas = __webpack_require__(1042); } module.exports = { @@ -151343,7 +160361,7 @@ module.exports = { /***/ }), -/* 984 */ +/* 1041 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151352,8 +160370,11 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); -var GetColorFromValue = __webpack_require__(119); +var GetCalcMatrix = __webpack_require__(21); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); + +var tempMatrix = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -151366,11 +160387,10 @@ var GetColorFromValue = __webpack_require__(119); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatrix) { var text = src.text; var textLength = text.length; @@ -151380,37 +160400,14 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - var fontMatrix = pipeline._tempMatrix4; + var result = GetCalcMatrix(src, camera, parentMatrix); - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + var spriteMatrix = result.sprite; + var calcMatrix = result.calc; - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var fontMatrix = tempMatrix; var crop = (src.cropWidth > 0 || src.cropHeight > 0); @@ -151428,16 +160425,12 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var frame = src.frame; var texture = frame.glTexture; - var textureX = frame.cutX; - var textureY = frame.cutY; - var textureWidth = texture.width; - var textureHeight = texture.height; - var tintEffect = (src._isTinted && src.tintFill); - var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, camera.alpha * src._alphaTL); - var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, camera.alpha * src._alphaTR); - var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL); - var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR); + var tintEffect = src.tintFill; + var tintTL = Utils.getTintAppendFloatAlpha(src.tintTopLeft, camera.alpha * src._alphaTL); + var tintTR = Utils.getTintAppendFloatAlpha(src.tintTopRight, camera.alpha * src._alphaTR); + var tintBL = Utils.getTintAppendFloatAlpha(src.tintBottomLeft, camera.alpha * src._alphaBL); + var tintBR = Utils.getTintAppendFloatAlpha(src.tintBottomRight, camera.alpha * src._alphaBR); var textureUnit = pipeline.setGameObject(src); @@ -151447,8 +160440,6 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var lastCharCode = 0; var letterSpacing = src.letterSpacing; var glyph; - var glyphX = 0; - var glyphY = 0; var glyphW = 0; var glyphH = 0; var lastGlyph; @@ -151466,7 +160457,14 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var lineOffsetX = 0; // Update the bounds - skipped internally if not dirty - src.getTextBounds(false); + var bounds = src.getTextBounds(false); + + // In case the method above changed it (word wrapping) + if (src.maxWidth > 0) + { + text = bounds.wrappedText; + textLength = text.length; + } var lineData = src._bounds.lines; @@ -151483,6 +160481,8 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var displayCallback = src.displayCallback; var callbackData = src.callbackData; + renderer.pipelines.preBatch(src); + for (var i = 0; i < textLength; i++) { charCode = text.charCodeAt(i); @@ -151515,9 +160515,6 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce continue; } - glyphX = textureX + glyph.x; - glyphY = textureY + glyph.y; - glyphW = glyph.width; glyphH = glyph.height; @@ -151580,10 +160577,10 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce tintBR = output.tint.bottomRight; } - tintTL = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintTL), camera.alpha * src._alphaTL); - tintTR = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintTR), camera.alpha * src._alphaTR); - tintBL = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintBL), camera.alpha * src._alphaBL); - tintBR = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintBR), camera.alpha * src._alphaBR); + tintTL = Utils.getTintAppendFloatAlpha(tintTL, camera.alpha * src._alphaTL); + tintTR = Utils.getTintAppendFloatAlpha(tintTR, camera.alpha * src._alphaTR); + tintBL = Utils.getTintAppendFloatAlpha(tintBL, camera.alpha * src._alphaBL); + tintBR = Utils.getTintAppendFloatAlpha(tintBR, camera.alpha * src._alphaBR); } x *= scale; @@ -151598,10 +160595,10 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce calcMatrix.multiply(fontMatrix, spriteMatrix); - var u0 = glyphX / textureWidth; - var v0 = glyphY / textureHeight; - var u1 = (glyphX + glyphW) / textureWidth; - var v1 = (glyphY + glyphH) / textureHeight; + var u0 = glyph.u0; + var v0 = glyph.v0; + var u1 = glyph.u1; + var v1 = glyph.v1; var xw = glyphW; var yh = glyphH; @@ -151633,7 +160630,7 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce ty3 = Math.round(ty3); } - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + pipeline.batchQuad(src, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); } if (crop) @@ -151642,13 +160639,15 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce renderer.popScissor(); } + + renderer.pipelines.postBatch(src); }; module.exports = DynamicBitmapTextWebGLRenderer; /***/ }), -/* 985 */ +/* 1042 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151657,7 +160656,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(28); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -151670,11 +160669,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var DynamicBitmapTextCanvasRenderer = function (renderer, src, camera, parentMatrix) { var text = src._text; var textLength = text.length; @@ -151685,7 +160683,7 @@ var DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPerc { return; } - + var textureFrame = src.frame; var displayCallback = src.displayCallback; @@ -151859,7 +160857,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /***/ }), -/* 986 */ +/* 1043 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151873,12 +160871,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(987); + renderWebGL = __webpack_require__(1044); } if (true) { - renderCanvas = __webpack_require__(988); + renderCanvas = __webpack_require__(1045); } module.exports = { @@ -151890,8 +160888,8 @@ module.exports = { /***/ }), -/* 987 */ -/***/ (function(module, exports) { +/* 1044 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -151899,6 +160897,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var GetCalcMatrix = __webpack_require__(21); + /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -151910,44 +160910,15 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Extern} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ExternWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ExternWebGLRenderer = function (renderer, src, camera, parentMatrix) { renderer.pipelines.clear(); - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - // Callback src.render.call(src, renderer, camera, calcMatrix); renderer.pipelines.rebind(); @@ -151957,13 +160928,13 @@ module.exports = ExternWebGLRenderer; /***/ }), -/* 988 */ +/* 1045 */ /***/ (function(module, exports) { /***/ }), -/* 989 */ +/* 1046 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151977,15 +160948,15 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(990); + renderWebGL = __webpack_require__(1047); // Needed for Graphics.generateTexture - renderCanvas = __webpack_require__(415); + renderCanvas = __webpack_require__(425); } if (true) { - renderCanvas = __webpack_require__(415); + renderCanvas = __webpack_require__(425); } module.exports = { @@ -151997,7 +160968,7 @@ module.exports = { /***/ }), -/* 990 */ +/* 1047 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152006,10 +160977,11 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(203); -var Utils = __webpack_require__(10); +var Commands = __webpack_require__(208); +var GetCalcMatrix = __webpack_require__(21); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); -// TODO: Remove the use of this var Point = function (x, y, width) { this.x = x; @@ -152017,7 +160989,6 @@ var Point = function (x, y, width) this.width = width; }; -// TODO: Remove the use of this var Path = function (x, y, width) { this.points = []; @@ -152026,6 +160997,7 @@ var Path = function (x, y, width) }; var matrixStack = []; +var tempMatrix = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -152038,49 +161010,23 @@ var matrixStack = []; * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (src.commandBuffer.length === 0) { return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = src._tempMatrix1; - var graphicsMatrix = src._tempMatrix2; - var currentMatrix = src._tempMatrix3; + renderer.pipelines.preBatch(src); - currentMatrix.loadIdentity(); + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - graphicsMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - graphicsMatrix.e = src.x; - graphicsMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(graphicsMatrix); - } - else - { - graphicsMatrix.e -= camera.scrollX * src.scrollFactorX; - graphicsMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(graphicsMatrix); - } + var currentMatrix = tempMatrix.loadIdentity(); var commands = src.commandBuffer; var alpha = camera.alpha * src.alpha; @@ -152099,13 +161045,10 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca var path = []; var pathIndex = 0; - var pathOpen = false; + var pathOpen = true; var lastPath = null; - var getTint = Utils.getTintAppendFloatAlphaAndSwap; - - // Set to a white texture, not a blank one, so Lights2D works too! - var currentTexture = renderer.tempTextures[0]; + var getTint = Utils.getTintAppendFloatAlpha; for (var cmdIndex = 0; cmdIndex < commands.length; cmdIndex++) { @@ -152114,14 +161057,15 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca switch (cmd) { case Commands.BEGIN_PATH: - + { path.length = 0; lastPath = null; pathOpen = true; break; + } case Commands.CLOSE_PATH: - + { pathOpen = false; if (lastPath && lastPath.points.length) @@ -152129,36 +161073,38 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca lastPath.points.push(lastPath.points[0]); } break; + } case Commands.FILL_PATH: + { for (pathIndex = 0; pathIndex < path.length; pathIndex++) { - pipeline.setTexture2D(currentTexture, src); - pipeline.batchFillPath( path[pathIndex].points, currentMatrix, - camMatrix + calcMatrix ); } break; + } case Commands.STROKE_PATH: + { for (pathIndex = 0; pathIndex < path.length; pathIndex++) { - pipeline.setTexture2D(currentTexture, src); - pipeline.batchStrokePath( path[pathIndex].points, lineWidth, pathOpen, currentMatrix, - camMatrix + calcMatrix ); } break; + } case Commands.LINE_STYLE: + { lineWidth = commands[++cmdIndex]; var strokeColor = commands[++cmdIndex]; var strokeAlpha = commands[++cmdIndex] * alpha; @@ -152168,8 +161114,10 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca strokeTint.BL = strokeTintColor; strokeTint.BR = strokeTintColor; break; + } case Commands.FILL_STYLE: + { var fillColor = commands[++cmdIndex]; var fillAlpha = commands[++cmdIndex] * alpha; var fillTintColor = getTint(fillColor, fillAlpha); @@ -152178,16 +161126,24 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca fillTint.BL = fillTintColor; fillTint.BR = fillTintColor; break; + } case Commands.GRADIENT_FILL_STYLE: - var gradientFillAlpha = commands[++cmdIndex] * alpha; - fillTint.TL = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.TR = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.BL = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.BR = getTint(commands[++cmdIndex], gradientFillAlpha); + { + var alphaTL = commands[++cmdIndex] * alpha; + var alphaTR = commands[++cmdIndex] * alpha; + var alphaBL = commands[++cmdIndex] * alpha; + var alphaBR = commands[++cmdIndex] * alpha; + + fillTint.TL = getTint(commands[++cmdIndex], alphaTL); + fillTint.TR = getTint(commands[++cmdIndex], alphaTR); + fillTint.BL = getTint(commands[++cmdIndex], alphaBL); + fillTint.BR = getTint(commands[++cmdIndex], alphaBR); break; + } case Commands.GRADIENT_LINE_STYLE: + { lineWidth = commands[++cmdIndex]; var gradientLineAlpha = commands[++cmdIndex] * alpha; strokeTint.TL = getTint(commands[++cmdIndex], gradientLineAlpha); @@ -152195,8 +161151,10 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca strokeTint.BL = getTint(commands[++cmdIndex], gradientLineAlpha); strokeTint.BR = getTint(commands[++cmdIndex], gradientLineAlpha); break; + } case Commands.ARC: + { var iteration = 0; var x = commands[++cmdIndex]; var y = commands[++cmdIndex]; @@ -152253,21 +161211,23 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca lastPath.points.push(new Point(tx, ty, lineWidth)); break; + } case Commands.FILL_RECT: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchFillRect( commands[++cmdIndex], commands[++cmdIndex], commands[++cmdIndex], commands[++cmdIndex], currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.FILL_TRIANGLE: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchFillTriangle( commands[++cmdIndex], commands[++cmdIndex], @@ -152276,12 +161236,13 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca commands[++cmdIndex], commands[++cmdIndex], currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.STROKE_TRIANGLE: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchStrokeTriangle( commands[++cmdIndex], commands[++cmdIndex], @@ -152291,11 +161252,13 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca commands[++cmdIndex], lineWidth, currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.LINE_TO: + { if (lastPath !== null) { lastPath.points.push(new Point(commands[++cmdIndex], commands[++cmdIndex], lineWidth)); @@ -152306,62 +161269,59 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca path.push(lastPath); } break; + } case Commands.MOVE_TO: + { lastPath = new Path(commands[++cmdIndex], commands[++cmdIndex], lineWidth); path.push(lastPath); break; + } case Commands.SAVE: + { matrixStack.push(currentMatrix.copyToArray()); break; + } case Commands.RESTORE: + { currentMatrix.copyFromArray(matrixStack.pop()); break; + } case Commands.TRANSLATE: + { x = commands[++cmdIndex]; y = commands[++cmdIndex]; currentMatrix.translate(x, y); break; + } case Commands.SCALE: + { x = commands[++cmdIndex]; y = commands[++cmdIndex]; currentMatrix.scale(x, y); break; + } case Commands.ROTATE: + { currentMatrix.rotate(commands[++cmdIndex]); break; - - case Commands.SET_TEXTURE: - var frame = commands[++cmdIndex]; - var mode = commands[++cmdIndex]; - - pipeline.currentFrame = frame; - pipeline.setTexture2D(frame.glTexture, src); - pipeline.tintEffect = mode; - - currentTexture = frame.glTexture; - - break; - - case Commands.CLEAR_TEXTURE: - pipeline.currentFrame = renderer.blankTexture; - pipeline.tintEffect = 2; - currentTexture = renderer.tempTextures[0]; - break; + } } } + + renderer.pipelines.postBatch(src); }; module.exports = GraphicsWebGLRenderer; /***/ }), -/* 991 */ +/* 1048 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152375,12 +161335,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(992); + renderWebGL = __webpack_require__(1049); } if (true) { - renderCanvas = __webpack_require__(993); + renderCanvas = __webpack_require__(1050); } module.exports = { @@ -152392,7 +161352,7 @@ module.exports = { /***/ }), -/* 992 */ +/* 1049 */ /***/ (function(module, exports) { /** @@ -152412,11 +161372,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) { this.pipeline.batchSprite(src, camera, parentMatrix); }; @@ -152425,7 +161384,7 @@ module.exports = SpriteWebGLRenderer; /***/ }), -/* 993 */ +/* 1050 */ /***/ (function(module, exports) { /** @@ -152445,11 +161404,10 @@ module.exports = SpriteWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpriteCanvasRenderer = function (renderer, src, camera, parentMatrix) { renderer.batchSprite(src, src.frame, camera, parentMatrix); }; @@ -152458,7 +161416,7 @@ module.exports = SpriteCanvasRenderer; /***/ }), -/* 994 */ +/* 1051 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152472,12 +161430,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(995); + renderWebGL = __webpack_require__(1052); } if (true) { - renderCanvas = __webpack_require__(996); + renderCanvas = __webpack_require__(1053); } module.exports = { @@ -152489,7 +161447,7 @@ module.exports = { /***/ }), -/* 995 */ +/* 1052 */ /***/ (function(module, exports) { /** @@ -152509,11 +161467,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ImageWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ImageWebGLRenderer = function (renderer, src, camera, parentMatrix) { this.pipeline.batchSprite(src, camera, parentMatrix); }; @@ -152522,7 +161479,7 @@ module.exports = ImageWebGLRenderer; /***/ }), -/* 996 */ +/* 1053 */ /***/ (function(module, exports) { /** @@ -152542,11 +161499,10 @@ module.exports = ImageWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ImageCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ImageCanvasRenderer = function (renderer, src, camera, parentMatrix) { renderer.batchSprite(src, src.frame, camera, parentMatrix); }; @@ -152555,7 +161511,247 @@ module.exports = ImageCanvasRenderer; /***/ }), -/* 997 */ +/* 1054 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(1055); +} + +if (true) +{ + renderCanvas = __webpack_require__(1056); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 1055 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Layer#renderWebGL + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var LayerWebGLRenderer = function (renderer, layer, camera) +{ + var children = layer.list; + var childCount = children.length; + + if (childCount === 0) + { + return; + } + + layer.depthSort(); + + renderer.pipelines.preBatch(layer); + + var layerHasBlendMode = (layer.blendMode !== -1); + + if (!layerHasBlendMode) + { + // If Layer is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = layer.alpha; + + for (var i = 0; i < childCount; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlphaTopLeft; + var childAlphaTopRight; + var childAlphaBottomLeft; + var childAlphaBottomRight; + + if (child.alphaTopLeft !== undefined) + { + childAlphaTopLeft = child.alphaTopLeft; + childAlphaTopRight = child.alphaTopRight; + childAlphaBottomLeft = child.alphaBottomLeft; + childAlphaBottomRight = child.alphaBottomRight; + } + else + { + var childAlpha = child.alpha; + + childAlphaTopLeft = childAlpha; + childAlphaTopRight = childAlpha; + childAlphaBottomLeft = childAlpha; + childAlphaBottomRight = childAlpha; + } + + if (!layerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Layer doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + var mask = child.mask; + + if (mask) + { + mask.preRenderWebGL(renderer, child, camera); + } + + var type = child.type; + + if (type !== renderer.currentType) + { + renderer.newType = true; + renderer.currentType = type; + } + + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; + + child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); + + // Render + child.renderWebGL(renderer, child, camera); + + // Restore original values + child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight); + + if (mask) + { + mask.postRenderWebGL(renderer, camera); + } + + renderer.newType = false; + } + + renderer.pipelines.postBatch(layer); +}; + +module.exports = LayerWebGLRenderer; + + +/***/ }), +/* 1056 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Layer#renderCanvas + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var LayerCanvasRenderer = function (renderer, layer, camera) +{ + var children = layer.list; + + if (children.length === 0) + { + return; + } + + layer.depthSort(); + + var layerHasBlendMode = (layer.blendMode !== -1); + + if (!layerHasBlendMode) + { + // If Layer is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = layer._alpha; + + if (layer.mask) + { + layer.mask.preRenderCanvas(renderer, null, camera); + } + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child.alpha; + + if (!layerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Layer doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + // Set parent values + child.setAlpha(childAlpha * alpha); + + // Render + child.renderCanvas(renderer, child, camera); + + // Restore original values + child.setAlpha(childAlpha); + } + + if (layer.mask) + { + layer.mask.postRenderCanvas(renderer); + } +}; + +module.exports = LayerCanvasRenderer; + + +/***/ }), +/* 1057 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152570,18 +161766,18 @@ module.exports = ImageCanvasRenderer; module.exports = { - EmitterOp: __webpack_require__(416), - GravityWell: __webpack_require__(417), - Particle: __webpack_require__(418), - ParticleEmitter: __webpack_require__(419), - ParticleEmitterManager: __webpack_require__(205), - Zones: __webpack_require__(1001) + EmitterOp: __webpack_require__(426), + GravityWell: __webpack_require__(427), + Particle: __webpack_require__(428), + ParticleEmitter: __webpack_require__(429), + ParticleEmitterManager: __webpack_require__(211), + Zones: __webpack_require__(1061) }; /***/ }), -/* 998 */ +/* 1058 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152595,12 +161791,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(999); + renderWebGL = __webpack_require__(1059); } if (true) { - renderCanvas = __webpack_require__(1000); + renderCanvas = __webpack_require__(1060); } module.exports = { @@ -152612,7 +161808,7 @@ module.exports = { /***/ }), -/* 999 */ +/* 1059 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152621,7 +161817,13 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); +var tempMatrix4 = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -152634,11 +161836,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix) +var ParticleManagerWebGLRenderer = function (renderer, emitterManager, camera, parentMatrix) { var emitters = emitterManager.emitters.list; var emittersLength = emitters.length; @@ -152648,21 +161849,34 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola return; } - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(emitterManager.pipeline); - var camMatrix = pipeline._tempMatrix1.copyFrom(camera.matrix); - var calcMatrix = pipeline._tempMatrix2; - var particleMatrix = pipeline._tempMatrix3; - var managerMatrix = pipeline._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + var camMatrix = tempMatrix1; + var calcMatrix = tempMatrix2; + var particleMatrix = tempMatrix3; + var managerMatrix = tempMatrix4; - camMatrix.multiply(managerMatrix); + if (parentMatrix) + { + managerMatrix.loadIdentity(); + managerMatrix.multiply(parentMatrix); + managerMatrix.translate(emitterManager.x, emitterManager.y); + managerMatrix.rotate(emitterManager.rotation); + managerMatrix.scale(emitterManager.scaleX, emitterManager.scaleY); + } + else + { + managerMatrix.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + } var roundPixels = camera.roundPixels; var texture = emitterManager.defaultFrame.glTexture; - var getTint = Utils.getTintAppendFloatAlphaAndSwap; + var getTint = Utils.getTintAppendFloatAlpha; var textureUnit = pipeline.setGameObject(emitterManager, emitterManager.defaultFrame); + renderer.pipelines.preBatch(emitterManager); + for (var e = 0; e < emittersLength; e++) { var emitter = emitters[e]; @@ -152674,29 +161888,19 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola continue; } - var scrollX = camera.scrollX * emitter.scrollFactorX; - var scrollY = camera.scrollY * emitter.scrollFactorY; + var followX = (emitter.follow) ? emitter.follow.x + emitter.followOffset.x : 0; + var followY = (emitter.follow) ? emitter.follow.y + emitter.followOffset.y : 0; - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY); + var scrollFactorX = emitter.scrollFactorX; + var scrollFactorY = emitter.scrollFactorY; - scrollX = 0; - scrollY = 0; - } - - if (renderer.setBlendMode(emitter.blendMode)) - { - // Rebind the texture if we've flushed - // pipeline.setTexture2D(texture, 0); - } + renderer.setBlendMode(emitter.blendMode); if (emitter.mask) { emitter.mask.preRenderWebGL(renderer, emitter, camera); - // pipeline.setTexture2D(texture, 0); + renderer.pipelines.set(emitterManager.pipeline); } var tintEffect = 0; @@ -152712,67 +161916,58 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola continue; } + particleMatrix.applyITRS(particle.x, particle.y, particle.rotation, particle.scaleX, particle.scaleY); + + camMatrix.copyFrom(camera.matrix); + + camMatrix.multiplyWithOffset(managerMatrix, followX + -camera.scrollX * scrollFactorX, followY + -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + particleMatrix.e = particle.x; + particleMatrix.f = particle.y; + + // Multiply by the particle matrix, store result in calcMatrix + camMatrix.multiply(particleMatrix, calcMatrix); + var frame = particle.frame; - var x = -(frame.halfWidth); - var y = -(frame.halfHeight); + var x = -frame.halfWidth; + var y = -frame.halfHeight; var xw = x + frame.width; var yh = y + frame.height; - particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY); + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); - particleMatrix.e = particle.x - scrollX; - particleMatrix.f = particle.y - scrollY; + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); - camMatrix.multiply(particleMatrix, calcMatrix); + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - if (roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); var tint = getTint(particle.tint, alpha); - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, textureUnit); + pipeline.batchQuad(emitter, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, textureUnit); } if (emitter.mask) { emitter.mask.postRenderWebGL(renderer, camera); - - // pipeline.setTexture2D(texture, 0); } } + + renderer.pipelines.postBatch(emitterManager); }; module.exports = ParticleManagerWebGLRenderer; /***/ }), -/* 1000 */ -/***/ (function(module, exports) { +/* 1060 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -152780,6 +161975,13 @@ module.exports = ParticleManagerWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); +var tempMatrix4 = new TransformMatrix(); + /** * Renders this Game Object with the Canvas Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -152791,11 +161993,10 @@ module.exports = ParticleManagerWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix) +var ParticleManagerCanvasRenderer = function (renderer, emitterManager, camera, parentMatrix) { var emitters = emitterManager.emitters.list; var emittersLength = emitters.length; @@ -152805,18 +162006,26 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol return; } - var camMatrix = renderer._tempMatrix1.copyFrom(camera.matrix); - var calcMatrix = renderer._tempMatrix2; - var particleMatrix = renderer._tempMatrix3; - var managerMatrix = renderer._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + var camMatrix = tempMatrix1.copyFrom(camera.matrix); + var calcMatrix = tempMatrix2; + var particleMatrix = tempMatrix3; + var managerMatrix = tempMatrix4; - camMatrix.multiply(managerMatrix); - - var roundPixels = camera.roundPixels; + if (parentMatrix) + { + managerMatrix.loadIdentity(); + managerMatrix.multiply(parentMatrix); + managerMatrix.translate(emitterManager.x, emitterManager.y); + managerMatrix.rotate(emitterManager.rotation); + managerMatrix.scale(emitterManager.scaleX, emitterManager.scaleY); + } + else + { + managerMatrix.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + } var ctx = renderer.currentContext; - - ctx.save(); + var roundPixels = camera.roundPixels; for (var e = 0; e < emittersLength; e++) { @@ -152829,17 +162038,13 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol continue; } - var scrollX = camera.scrollX * emitter.scrollFactorX; - var scrollY = camera.scrollY * emitter.scrollFactorY; + var followX = (emitter.follow) ? emitter.follow.x + emitter.followOffset.x : 0; + var followY = (emitter.follow) ? emitter.follow.y + emitter.followOffset.y : 0; - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY); + var scrollFactorX = emitter.scrollFactorX; + var scrollFactorY = emitter.scrollFactorY; - scrollX = 0; - scrollY = 0; - } + ctx.save(); ctx.globalCompositeOperation = renderer.blendModes[emitter.blendMode]; @@ -152854,24 +162059,30 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol continue; } + particleMatrix.applyITRS(particle.x, particle.y, particle.rotation, particle.scaleX, particle.scaleY); + + camMatrix.copyFrom(camera.matrix); + + camMatrix.multiplyWithOffset(managerMatrix, followX + -camera.scrollX * scrollFactorX, followY + -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + particleMatrix.e = particle.x; + particleMatrix.f = particle.y; + + // Multiply by the particle matrix, store result in calcMatrix + camMatrix.multiply(particleMatrix, calcMatrix); + var frame = particle.frame; var cd = frame.canvasData; var x = -(frame.halfWidth); var y = -(frame.halfHeight); - particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY); - - particleMatrix.e = particle.x - scrollX; - particleMatrix.f = particle.y - scrollY; - - camMatrix.multiply(particleMatrix, calcMatrix); - ctx.globalAlpha = alpha; - + ctx.save(); - calcMatrix.copyToContext(ctx); + calcMatrix.setToContext(ctx); if (roundPixels) { @@ -152885,16 +162096,16 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol ctx.restore(); } - } - ctx.restore(); + ctx.restore(); + } }; module.exports = ParticleManagerCanvasRenderer; /***/ }), -/* 1001 */ +/* 1061 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152909,15 +162120,15 @@ module.exports = ParticleManagerCanvasRenderer; module.exports = { - DeathZone: __webpack_require__(420), - EdgeZone: __webpack_require__(421), - RandomZone: __webpack_require__(423) + DeathZone: __webpack_require__(430), + EdgeZone: __webpack_require__(431), + RandomZone: __webpack_require__(433) }; /***/ }), -/* 1002 */ +/* 1062 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152931,12 +162142,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1003); + renderWebGL = __webpack_require__(1063); } if (true) { - renderCanvas = __webpack_require__(1004); + renderCanvas = __webpack_require__(1064); } module.exports = { @@ -152948,7 +162159,7 @@ module.exports = { /***/ }), -/* 1003 */ +/* 1063 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152957,7 +162168,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -152970,23 +162181,28 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RenderTextureWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var frame = src.frame; - var width = frame.width; - var height = frame.height; - var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(src.pipeline, src); + var cameraAlpha = camera.alpha; - var textureUnit = pipeline.setTexture2D(frame.glTexture, src); + var renderTarget = src.renderTarget; + var width = renderTarget.width; + var height = renderTarget.height; + + var getTint = Utils.getTintAppendFloatAlpha; + + var pipeline = renderer.pipelines.set(src.pipeline); + + var textureUnit = pipeline.setTexture2D(renderTarget.texture); + + renderer.pipelines.preBatch(src); pipeline.batchTexture( src, - frame.glTexture, + renderTarget.texture, width, height, src.x, src.y, width, height, @@ -152996,24 +162212,28 @@ var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentag src.scrollFactorX, src.scrollFactorY, src.displayOriginX, src.displayOriginY, 0, 0, width, height, - getTint(src._tintTL, camera.alpha * src._alphaTL), - getTint(src._tintTR, camera.alpha * src._alphaTR), - getTint(src._tintBL, camera.alpha * src._alphaBL), - getTint(src._tintBR, camera.alpha * src._alphaBR), - (src._isTinted && src.tintFill), + getTint(src.tintTopLeft, cameraAlpha * src._alphaTL), + getTint(src.tintTopRight, cameraAlpha * src._alphaTR), + getTint(src.tintBottomLeft, cameraAlpha * src._alphaBL), + getTint(src.tintBottomRight, cameraAlpha * src._alphaBR), + src.tintFill, 0, 0, camera, parentMatrix, - false, + true, textureUnit ); + + renderer.resetTextures(); + + renderer.pipelines.postBatch(src); }; module.exports = RenderTextureWebGLRenderer; /***/ }), -/* 1004 */ +/* 1064 */ /***/ (function(module, exports) { /** @@ -153033,11 +162253,10 @@ module.exports = RenderTextureWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RenderTextureCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RenderTextureCanvasRenderer = function (renderer, src, camera, parentMatrix) { renderer.batchSprite(src, src.frame, camera, parentMatrix); }; @@ -153046,7 +162265,7 @@ module.exports = RenderTextureCanvasRenderer; /***/ }), -/* 1005 */ +/* 1065 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153055,15 +162274,15 @@ module.exports = RenderTextureCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RETRO_FONT_CONST = __webpack_require__(1006); -var Extend = __webpack_require__(19); +var RETRO_FONT_CONST = __webpack_require__(1066); +var Extend = __webpack_require__(18); /** * @namespace Phaser.GameObjects.RetroFont * @since 3.6.0 */ -var RetroFont = { Parse: __webpack_require__(1007) }; +var RetroFont = { Parse: __webpack_require__(1067) }; // Merge in the consts RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST); @@ -153072,7 +162291,7 @@ module.exports = RetroFont; /***/ }), -/* 1006 */ +/* 1066 */ /***/ (function(module, exports) { /** @@ -153188,7 +162407,7 @@ module.exports = RETRO_FONT_CONST; /***/ }), -/* 1007 */ +/* 1067 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153215,8 +162434,10 @@ var ParseRetroFont = function (scene, config) { var w = config.width; var h = config.height; + var cx = Math.floor(w / 2); var cy = Math.floor(h / 2); + var letters = GetValue(config, 'chars', ''); if (letters === '') @@ -153225,6 +162446,13 @@ var ParseRetroFont = function (scene, config) } var key = GetValue(config, 'image', ''); + + var frame = scene.sys.textures.getFrame(key); + var textureX = frame.cutX; + var textureY = frame.cutY; + var textureWidth = frame.source.width; + var textureHeight = frame.source.height; + var offsetX = GetValue(config, 'offset.x', 0); var offsetY = GetValue(config, 'offset.y', 0); var spacingX = GetValue(config, 'spacing.x', 0); @@ -153235,7 +162463,7 @@ var ParseRetroFont = function (scene, config) if (charsPerRow === null) { - charsPerRow = scene.sys.textures.getFrame(key).width / w; + charsPerRow = textureWidth / w; if (charsPerRow > letters.length) { @@ -153258,10 +162486,13 @@ var ParseRetroFont = function (scene, config) for (var i = 0; i < letters.length; i++) { - // var node = letters[i]; - var charCode = letters.charCodeAt(i); + var u0 = (textureX + x) / textureWidth; + var v0 = (textureY + y) / textureHeight; + var u1 = (textureX + x + w) / textureWidth; + var v1 = (textureY + y + h) / textureHeight; + data.chars[charCode] = { x: x, @@ -153274,7 +162505,11 @@ var ParseRetroFont = function (scene, config) yOffset: 0, xAdvance: w, data: {}, - kerning: {} + kerning: {}, + u0: u0, + v0: v0, + u1: u1, + v1: v1 }; r++; @@ -153304,7 +162539,7 @@ module.exports = ParseRetroFont; /***/ }), -/* 1008 */ +/* 1068 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153318,12 +162553,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1009); + renderWebGL = __webpack_require__(1069); } if (true) { - renderCanvas = __webpack_require__(1010); + renderCanvas = __webpack_require__(1070); } module.exports = { @@ -153335,7 +162570,7 @@ module.exports = { /***/ }), -/* 1009 */ +/* 1069 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153344,7 +162579,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -153357,49 +162593,21 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Rope} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RopeWebGLRenderer = function (renderer, src, camera, parentMatrix) { var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; var vertices = src.vertices; var uvs = src.uv; var colors = src.colors; var alphas = src.alphas; var alpha = src.alpha; - var getTint = Utils.getTintAppendFloatAlphaAndSwap; + var getTint = Utils.getTintAppendFloatAlpha; var roundPixels = camera.roundPixels; var meshVerticesLength = vertices.length; @@ -153408,12 +162616,14 @@ var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera // Because it's a triangle strip and we don't want lots of degenerate triangles joining things up pipeline.flush(); + renderer.pipelines.preBatch(src); + var textureUnit = pipeline.setGameObject(src); var vertexViewF32 = pipeline.vertexViewF32; var vertexViewU32 = pipeline.vertexViewU32; - var vertexOffset = (pipeline.vertexCount * pipeline.vertexComponentCount) - 1; + var vertexOffset = (pipeline.vertexCount * pipeline.currentShader.vertexComponentCount) - 1; var colorIndex = 0; @@ -153464,13 +162674,15 @@ var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera } pipeline.vertexCount += vertexCount; + + renderer.pipelines.postBatch(src); }; module.exports = RopeWebGLRenderer; /***/ }), -/* 1010 */ +/* 1070 */ /***/ (function(module, exports) { /** @@ -153488,7 +162700,6 @@ module.exports = RopeWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Rope} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. */ var RopeCanvasRenderer = function () @@ -153499,7 +162710,7 @@ module.exports = RopeCanvasRenderer; /***/ }), -/* 1011 */ +/* 1071 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153513,12 +162724,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1012); + renderWebGL = __webpack_require__(1072); } if (true) { - renderCanvas = __webpack_require__(1013); + renderCanvas = __webpack_require__(1073); } module.exports = { @@ -153530,7 +162741,7 @@ module.exports = { /***/ }), -/* 1012 */ +/* 1072 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153539,7 +162750,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -153552,11 +162763,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TextWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (src.width === 0 || src.height === 0) { @@ -153567,10 +162777,12 @@ var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera var width = frame.width; var height = frame.height; var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var textureUnit = pipeline.setTexture2D(frame.glTexture, src); + renderer.pipelines.preBatch(src); + pipeline.batchTexture( src, frame.glTexture, @@ -153583,24 +162795,26 @@ var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera src.scrollFactorX, src.scrollFactorY, src.displayOriginX, src.displayOriginY, 0, 0, width, height, - getTint(src._tintTL, camera.alpha * src._alphaTL), - getTint(src._tintTR, camera.alpha * src._alphaTR), - getTint(src._tintBL, camera.alpha * src._alphaBL), - getTint(src._tintBR, camera.alpha * src._alphaBR), - (src._isTinted && src.tintFill), + getTint(src.tintTopLeft, camera.alpha * src._alphaTL), + getTint(src.tintTopRight, camera.alpha * src._alphaTR), + getTint(src.tintBottomLeft, camera.alpha * src._alphaBL), + getTint(src.tintBottomRight, camera.alpha * src._alphaBR), + src.tintFill, 0, 0, camera, parentMatrix, false, textureUnit ); + + renderer.pipelines.postBatch(src); }; module.exports = TextWebGLRenderer; /***/ }), -/* 1013 */ +/* 1073 */ /***/ (function(module, exports) { /** @@ -153620,13 +162834,12 @@ module.exports = TextWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TextCanvasRenderer = function (renderer, src, camera, parentMatrix) { - if ((src.width === 0) || (src.height === 0)) + if (src.width === 0 || src.height === 0) { return; } @@ -153638,7 +162851,7 @@ module.exports = TextCanvasRenderer; /***/ }), -/* 1014 */ +/* 1074 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153652,12 +162865,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1015); + renderWebGL = __webpack_require__(1075); } if (true) { - renderCanvas = __webpack_require__(1016); + renderCanvas = __webpack_require__(1076); } module.exports = { @@ -153669,7 +162882,7 @@ module.exports = { /***/ }), -/* 1015 */ +/* 1075 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153678,7 +162891,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -153691,11 +162904,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TileSpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) { src.updateCanvas(); @@ -153706,9 +162918,11 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, return; } + renderer.pipelines.preBatch(src); + var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var textureUnit = pipeline.setTexture2D(src.fillPattern, src); @@ -153724,11 +162938,11 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, src.scrollFactorX, src.scrollFactorY, src.originX * width, src.originY * height, 0, 0, width, height, - getTint(src._tintTL, camera.alpha * src._alphaTL), - getTint(src._tintTR, camera.alpha * src._alphaTR), - getTint(src._tintBL, camera.alpha * src._alphaBL), - getTint(src._tintBR, camera.alpha * src._alphaBR), - (src._isTinted && src.tintFill), + getTint(src.tintTopLeft, camera.alpha * src._alphaTL), + getTint(src.tintTopRight, camera.alpha * src._alphaTR), + getTint(src.tintBottomLeft, camera.alpha * src._alphaBL), + getTint(src.tintBottomRight, camera.alpha * src._alphaBR), + src.tintFill, (src.tilePositionX % src.displayFrame.width) / src.displayFrame.width, (src.tilePositionY % src.displayFrame.height) / src.displayFrame.height, camera, @@ -153736,13 +162950,15 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, false, textureUnit ); + + renderer.pipelines.postBatch(src); }; module.exports = TileSpriteWebGLRenderer; /***/ }), -/* 1016 */ +/* 1076 */ /***/ (function(module, exports) { /** @@ -153762,11 +162978,10 @@ module.exports = TileSpriteWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TileSpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TileSpriteCanvasRenderer = function (renderer, src, camera, parentMatrix) { src.updateCanvas(); @@ -153777,7 +162992,7 @@ module.exports = TileSpriteCanvasRenderer; /***/ }), -/* 1017 */ +/* 1077 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153791,12 +163006,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1018); + renderWebGL = __webpack_require__(1078); } if (true) { - renderCanvas = __webpack_require__(1019); + renderCanvas = __webpack_require__(1079); } module.exports = { @@ -153808,7 +163023,7 @@ module.exports = { /***/ }), -/* 1018 */ +/* 1078 */ /***/ (function(module, exports) { /** @@ -153828,15 +163043,14 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Video} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var VideoWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var VideoWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (src.videoTexture) { - this.pipeline.batchSprite(src, camera, parentMatrix); + src.pipeline.batchSprite(src, camera, parentMatrix); } }; @@ -153844,7 +163058,7 @@ module.exports = VideoWebGLRenderer; /***/ }), -/* 1019 */ +/* 1079 */ /***/ (function(module, exports) { /** @@ -153864,11 +163078,10 @@ module.exports = VideoWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Video} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var VideoCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var VideoCanvasRenderer = function (renderer, src, camera, parentMatrix) { if (src.videoTexture) { @@ -153880,7 +163093,7 @@ module.exports = VideoCanvasRenderer; /***/ }), -/* 1020 */ +/* 1080 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153894,12 +163107,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1021); + renderWebGL = __webpack_require__(1081); } if (true) { - renderCanvas = __webpack_require__(1022); + renderCanvas = __webpack_require__(1082); } module.exports = { @@ -153911,7 +163124,7 @@ module.exports = { /***/ }), -/* 1021 */ +/* 1081 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153920,8 +163133,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var GetCalcMatrix = __webpack_require__(21); +var FillPathWebGL = __webpack_require__(109); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -153934,44 +163148,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ArcWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ArcWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -153981,13 +163175,15 @@ var ArcWebGLRenderer = function (renderer, src, interpolationPercentage, camera, { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = ArcWebGLRenderer; /***/ }), -/* 1022 */ +/* 1082 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153996,10 +163192,10 @@ module.exports = ArcWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(41); -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var DegToRad = __webpack_require__(34); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -154012,11 +163208,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ArcCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ArcCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -154063,7 +163258,7 @@ module.exports = ArcCanvasRenderer; /***/ }), -/* 1023 */ +/* 1083 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154077,12 +163272,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1024); + renderWebGL = __webpack_require__(1084); } if (true) { - renderCanvas = __webpack_require__(1025); + renderCanvas = __webpack_require__(1085); } module.exports = { @@ -154094,7 +163289,7 @@ module.exports = { /***/ }), -/* 1024 */ +/* 1084 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154103,8 +163298,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -154117,44 +163313,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var CurveWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var CurveWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX + src._curveBounds.x; var dy = src._displayOriginY + src._curveBounds.y; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -154164,13 +163340,15 @@ var CurveWebGLRenderer = function (renderer, src, interpolationPercentage, camer { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = CurveWebGLRenderer; /***/ }), -/* 1025 */ +/* 1085 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154179,9 +163357,9 @@ module.exports = CurveWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -154194,11 +163372,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var CurveCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var CurveCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -154206,27 +163383,27 @@ var CurveCanvasRenderer = function (renderer, src, interpolationPercentage, came { var dx = src._displayOriginX + src._curveBounds.x; var dy = src._displayOriginY + src._curveBounds.y; - + var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -154258,7 +163435,7 @@ module.exports = CurveCanvasRenderer; /***/ }), -/* 1026 */ +/* 1086 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154272,12 +163449,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1027); + renderWebGL = __webpack_require__(1087); } if (true) { - renderCanvas = __webpack_require__(1028); + renderCanvas = __webpack_require__(1088); } module.exports = { @@ -154289,7 +163466,7 @@ module.exports = { /***/ }), -/* 1027 */ +/* 1087 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154298,8 +163475,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -154312,44 +163490,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var EllipseWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var EllipseWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -154359,13 +163517,15 @@ var EllipseWebGLRenderer = function (renderer, src, interpolationPercentage, cam { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = EllipseWebGLRenderer; /***/ }), -/* 1028 */ +/* 1088 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154374,9 +163534,9 @@ module.exports = EllipseWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -154389,11 +163549,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var EllipseCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var EllipseCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -154404,24 +163563,24 @@ var EllipseCanvasRenderer = function (renderer, src, interpolationPercentage, ca var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -154450,7 +163609,7 @@ module.exports = EllipseCanvasRenderer; /***/ }), -/* 1029 */ +/* 1089 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154464,12 +163623,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1030); + renderWebGL = __webpack_require__(1090); } if (true) { - renderCanvas = __webpack_require__(1031); + renderCanvas = __webpack_require__(1091); } module.exports = { @@ -154481,7 +163640,7 @@ module.exports = { /***/ }), -/* 1030 */ +/* 1090 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154490,7 +163649,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -154503,38 +163663,16 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var GridWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); calcMatrix.translate(-src._displayOriginX, -src._displayOriginY); @@ -154570,8 +163708,6 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera var cw = 0; var ch = 0; - pipeline.setTexture2D(); - if (showOutline) { // To make room for the grid lines (in case alpha < 1) @@ -154589,10 +163725,12 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera } } + renderer.pipelines.preBatch(src); + if (showCells && src.fillAlpha > 0) { fillTint = pipeline.fillTint; - fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; @@ -154632,7 +163770,7 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera if (showAltCells && src.altFillAlpha > 0) { fillTint = pipeline.fillTint; - fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.altFillColor, src.altFillAlpha * alpha); + fillTintColor = Utils.getTintAppendFloatAlpha(src.altFillColor, src.altFillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; @@ -154672,7 +163810,7 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera if (showOutline && src.outlineFillAlpha > 0) { var strokeTint = pipeline.strokeTint; - var color = Utils.getTintAppendFloatAlphaAndSwap(src.outlineFillColor, src.outlineFillAlpha * alpha); + var color = Utils.getTintAppendFloatAlpha(src.outlineFillColor, src.outlineFillAlpha * alpha); strokeTint.TL = color; strokeTint.TR = color; @@ -154693,13 +163831,15 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera pipeline.batchLine(0, y1, width, y1, 1, 1, 1, 0, false); } } + + renderer.pipelines.postBatch(src); }; module.exports = GridWebGLRenderer; /***/ }), -/* 1031 */ +/* 1091 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154708,9 +163848,9 @@ module.exports = GridWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -154723,11 +163863,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var GridCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var GridCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -154888,7 +164027,7 @@ module.exports = GridCanvasRenderer; /***/ }), -/* 1032 */ +/* 1092 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154902,12 +164041,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1033); + renderWebGL = __webpack_require__(1093); } if (true) { - renderCanvas = __webpack_require__(1034); + renderCanvas = __webpack_require__(1094); } module.exports = { @@ -154919,7 +164058,7 @@ module.exports = { /***/ }), -/* 1033 */ +/* 1093 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154928,7 +164067,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -154941,38 +164081,16 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var size = src.width; var height = src.height; @@ -155001,13 +164119,14 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came var x3; var y3; - pipeline.setTexture2D(); + + renderer.pipelines.preBatch(src); // Top Face if (src.showTop) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillTop, alpha); x0 = calcMatrix.getX(-sizeA, -height); y0 = calcMatrix.getY(-sizeA, -height); @@ -155021,14 +164140,14 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came x3 = calcMatrix.getX(0, sizeB - height); y3 = calcMatrix.getY(0, sizeB - height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Left Face if (src.showLeft) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillLeft, alpha); x0 = calcMatrix.getX(-sizeA, 0); y0 = calcMatrix.getY(-sizeA, 0); @@ -155042,14 +164161,14 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came x3 = calcMatrix.getX(-sizeA, -height); y3 = calcMatrix.getY(-sizeA, -height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Right Face if (src.showRight) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillRight, alpha); x0 = calcMatrix.getX(sizeA, 0); y0 = calcMatrix.getY(sizeA, 0); @@ -155063,15 +164182,17 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came x3 = calcMatrix.getX(sizeA, -height); y3 = calcMatrix.getY(sizeA, -height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } + + renderer.pipelines.postBatch(src); }; module.exports = IsoBoxWebGLRenderer; /***/ }), -/* 1034 */ +/* 1094 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155080,8 +164201,8 @@ module.exports = IsoBoxWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -155094,11 +164215,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoBoxCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -155106,7 +164226,7 @@ var IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, cam { var size = src.width; var height = src.height; - + var sizeA = size / 2; var sizeB = size / src.projection; @@ -155136,7 +164256,7 @@ var IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, cam FillStyleCanvas(ctx, src, src.fillLeft); ctx.beginPath(); - + ctx.moveTo(-sizeA, 0); ctx.lineTo(0, sizeB); ctx.lineTo(0, sizeB - height); @@ -155172,7 +164292,7 @@ module.exports = IsoBoxCanvasRenderer; /***/ }), -/* 1035 */ +/* 1095 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155186,12 +164306,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1036); + renderWebGL = __webpack_require__(1096); } if (true) { - renderCanvas = __webpack_require__(1037); + renderCanvas = __webpack_require__(1097); } module.exports = { @@ -155203,7 +164323,7 @@ module.exports = { /***/ }), -/* 1036 */ +/* 1096 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155212,7 +164332,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -155225,38 +164346,16 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var size = src.width; var height = src.height; @@ -155273,6 +164372,8 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, return; } + renderer.pipelines.preBatch(src); + var tint; var x0; @@ -155284,13 +164385,11 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, var x2; var y2; - pipeline.setTexture2D(); - // Top Face if (src.showTop && reversed) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillTop, alpha); x0 = calcMatrix.getX(-sizeA, -height); y0 = calcMatrix.getY(-sizeA, -height); @@ -155304,14 +164403,14 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, var x3 = calcMatrix.getX(0, sizeB - height); var y3 = calcMatrix.getY(0, sizeB - height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Left Face if (src.showLeft) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillLeft, alpha); if (reversed) { @@ -155336,14 +164435,14 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, y2 = calcMatrix.getY(0, sizeB - height); } - pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2); + pipeline.batchTri(x0, y0, x1, y1, x2, y2, tint, tint, tint); } // Right Face if (src.showRight) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillRight, alpha); if (reversed) { @@ -155368,15 +164467,17 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, y2 = calcMatrix.getY(0, sizeB - height); } - pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2); + pipeline.batchTri(x0, y0, x1, y1, x2, y2, tint, tint, tint); } + + renderer.pipelines.postBatch(src); }; module.exports = IsoTriangleWebGLRenderer; /***/ }), -/* 1037 */ +/* 1097 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155385,8 +164486,8 @@ module.exports = IsoTriangleWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -155399,11 +164500,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoTriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoTriangleCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -155411,7 +164511,7 @@ var IsoTriangleCanvasRenderer = function (renderer, src, interpolationPercentage { var size = src.width; var height = src.height; - + var sizeA = size / 2; var sizeB = size / src.projection; @@ -155490,7 +164590,7 @@ module.exports = IsoTriangleCanvasRenderer; /***/ }), -/* 1038 */ +/* 1098 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155504,12 +164604,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1039); + renderWebGL = __webpack_require__(1099); } if (true) { - renderCanvas = __webpack_require__(1040); + renderCanvas = __webpack_require__(1100); } module.exports = { @@ -155521,7 +164621,7 @@ module.exports = { /***/ }), -/* 1039 */ +/* 1099 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155530,7 +164630,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -155543,44 +164644,27 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var LineWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isStroked) { var strokeTint = pipeline.strokeTint; - var color = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha); + var color = Utils.getTintAppendFloatAlpha(src.strokeColor, src.strokeAlpha * alpha); strokeTint.TL = color; strokeTint.TR = color; @@ -155590,8 +164674,6 @@ var LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera var startWidth = src._startWidth; var endWidth = src._endWidth; - pipeline.setTexture2D(); - pipeline.batchLine( src.geom.x1 - dx, src.geom.y1 - dy, @@ -155602,17 +164684,19 @@ var LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera 1, 0, false, - shapeMatrix, - camMatrix + result.sprite, + result.camera ); } + + renderer.pipelines.postBatch(src); }; module.exports = LineWebGLRenderer; /***/ }), -/* 1040 */ +/* 1100 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155621,8 +164705,8 @@ module.exports = LineWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -155635,11 +164719,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var LineCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var LineCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -155656,7 +164739,7 @@ var LineCanvasRenderer = function (renderer, src, interpolationPercentage, camer ctx.moveTo(src.geom.x1 - dx, src.geom.y1 - dy); ctx.lineTo(src.geom.x2 - dx, src.geom.y2 - dy); - + ctx.stroke(); } @@ -155669,7 +164752,7 @@ module.exports = LineCanvasRenderer; /***/ }), -/* 1041 */ +/* 1101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155683,12 +164766,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1042); + renderWebGL = __webpack_require__(1102); } if (true) { - renderCanvas = __webpack_require__(1043); + renderCanvas = __webpack_require__(1103); } module.exports = { @@ -155700,7 +164783,7 @@ module.exports = { /***/ }), -/* 1042 */ +/* 1102 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155709,8 +164792,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -155723,44 +164807,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var PolygonWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var PolygonWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -155770,13 +164834,15 @@ var PolygonWebGLRenderer = function (renderer, src, interpolationPercentage, cam { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = PolygonWebGLRenderer; /***/ }), -/* 1043 */ +/* 1103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155785,9 +164851,9 @@ module.exports = PolygonWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -155800,11 +164866,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var PolygonCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var PolygonCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -155815,24 +164880,24 @@ var PolygonCanvasRenderer = function (renderer, src, interpolationPercentage, ca var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -155861,7 +164926,7 @@ module.exports = PolygonCanvasRenderer; /***/ }), -/* 1044 */ +/* 1104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155875,12 +164940,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1045); + renderWebGL = __webpack_require__(1105); } if (true) { - renderCanvas = __webpack_require__(1046); + renderCanvas = __webpack_require__(1106); } module.exports = { @@ -155892,7 +164957,7 @@ module.exports = { /***/ }), -/* 1045 */ +/* 1105 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155901,8 +164966,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(72); -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -155915,55 +164981,33 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RectangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RectangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { var fillTint = pipeline.fillTint; - var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + var fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; fillTint.BL = fillTintColor; fillTint.BR = fillTintColor; - pipeline.setTexture2D(); - pipeline.batchFillRect( -dx, -dy, @@ -155976,13 +165020,15 @@ var RectangleWebGLRenderer = function (renderer, src, interpolationPercentage, c { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = RectangleWebGLRenderer; /***/ }), -/* 1046 */ +/* 1106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155991,9 +165037,9 @@ module.exports = RectangleWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -156006,11 +165052,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RectangleCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -156022,7 +165067,7 @@ var RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, if (src.isFilled) { FillStyleCanvas(ctx, src); - + ctx.fillRect( -dx, -dy, @@ -156056,7 +165101,7 @@ module.exports = RectangleCanvasRenderer; /***/ }), -/* 1047 */ +/* 1107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156070,12 +165115,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1048); + renderWebGL = __webpack_require__(1108); } if (true) { - renderCanvas = __webpack_require__(1049); + renderCanvas = __webpack_require__(1109); } module.exports = { @@ -156087,7 +165132,7 @@ module.exports = { /***/ }), -/* 1048 */ +/* 1108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156096,8 +165141,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -156110,44 +165156,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var StarWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var StarWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -156157,13 +165183,15 @@ var StarWebGLRenderer = function (renderer, src, interpolationPercentage, camera { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = StarWebGLRenderer; /***/ }), -/* 1049 */ +/* 1109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156172,9 +165200,9 @@ module.exports = StarWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -156187,11 +165215,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var StarCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var StarCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -156202,24 +165229,24 @@ var StarCanvasRenderer = function (renderer, src, interpolationPercentage, camer var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -156248,7 +165275,7 @@ module.exports = StarCanvasRenderer; /***/ }), -/* 1050 */ +/* 1110 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156262,12 +165289,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1051); + renderWebGL = __webpack_require__(1111); } if (true) { - renderCanvas = __webpack_require__(1052); + renderCanvas = __webpack_require__(1112); } module.exports = { @@ -156279,7 +165306,7 @@ module.exports = { /***/ }), -/* 1051 */ +/* 1111 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156288,8 +165315,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(72); -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -156302,47 +165330,27 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { var fillTint = pipeline.fillTint; - var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + var fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; @@ -156356,8 +165364,6 @@ var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, ca var x3 = src.geom.x3 - dx; var y3 = src.geom.y3 - dy; - pipeline.setTexture2D(); - pipeline.batchFillTriangle( x1, y1, @@ -156365,8 +165371,8 @@ var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, ca y2, x3, y3, - shapeMatrix, - camMatrix + result.sprite, + result.camera ); } @@ -156374,13 +165380,15 @@ var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, ca { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = TriangleWebGLRenderer; /***/ }), -/* 1052 */ +/* 1112 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156389,9 +165397,9 @@ module.exports = TriangleWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -156404,11 +165412,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TriangleCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -156455,7 +165462,7 @@ module.exports = TriangleCanvasRenderer; /***/ }), -/* 1053 */ +/* 1113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156464,7 +165471,7 @@ module.exports = TriangleCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(199); +var Blitter = __webpack_require__(204); var GameObjectFactory = __webpack_require__(5); /** @@ -156478,8 +165485,8 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} x - The x position of the Game Object. * @param {number} y - The y position of the Game Object. * @param {string} key - The key of the Texture the Blitter object will use. - * @param {(string|integer)} [frame] - The default Frame children of the Blitter will use. - * + * @param {(string|number)} [frame] - The default Frame children of the Blitter will use. + * * @return {Phaser.GameObjects.Blitter} The Game Object that was created. */ GameObjectFactory.register('blitter', function (x, y, key, frame) @@ -156488,16 +165495,16 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns /***/ }), -/* 1054 */ +/* 1114 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156507,7 +165514,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Container = __webpack_require__(200); +var Container = __webpack_require__(205); var GameObjectFactory = __webpack_require__(5); /** @@ -156531,7 +165538,7 @@ GameObjectFactory.register('container', function (x, y, children) /***/ }), -/* 1055 */ +/* 1115 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156540,7 +165547,7 @@ GameObjectFactory.register('container', function (x, y, children) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DOMElement = __webpack_require__(409); +var DOMElement = __webpack_require__(419); var GameObjectFactory = __webpack_require__(5); /** @@ -156620,7 +165627,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /***/ }), -/* 1056 */ +/* 1116 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156629,7 +165636,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DynamicBitmapText = __webpack_require__(201); +var DynamicBitmapText = __webpack_require__(206); var GameObjectFactory = __webpack_require__(5); /** @@ -156689,7 +165696,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /***/ }), -/* 1057 */ +/* 1117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156698,7 +165705,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extern = __webpack_require__(411); +var Extern = __webpack_require__(421); var GameObjectFactory = __webpack_require__(5); /** @@ -156730,7 +165737,7 @@ GameObjectFactory.register('extern', function () /***/ }), -/* 1058 */ +/* 1118 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156739,7 +165746,7 @@ GameObjectFactory.register('extern', function () * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Graphics = __webpack_require__(202); +var Graphics = __webpack_require__(207); var GameObjectFactory = __webpack_require__(5); /** @@ -156769,7 +165776,7 @@ GameObjectFactory.register('graphics', function (config) /***/ }), -/* 1059 */ +/* 1119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156778,7 +165785,7 @@ GameObjectFactory.register('graphics', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Group = __webpack_require__(100); +var Group = __webpack_require__(108); var GameObjectFactory = __webpack_require__(5); /** @@ -156801,7 +165808,7 @@ GameObjectFactory.register('group', function (children, config) /***/ }), -/* 1060 */ +/* 1120 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156810,7 +165817,7 @@ GameObjectFactory.register('group', function (children, config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Image = __webpack_require__(114); +var Image = __webpack_require__(122); var GameObjectFactory = __webpack_require__(5); /** @@ -156824,7 +165831,7 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Image} The Game Object that was created. */ @@ -156843,7 +165850,38 @@ GameObjectFactory.register('image', function (x, y, key, frame) /***/ }), -/* 1061 */ +/* 1121 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Layer = __webpack_require__(210); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Layer Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#layer + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Layer. + * + * @return {Phaser.GameObjects.Layer} The Game Object that was created. + */ +GameObjectFactory.register('layer', function (children) +{ + return this.displayList.add(new Layer(this.scene, children)); +}); + + +/***/ }), +/* 1122 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156853,7 +165891,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) */ var GameObjectFactory = __webpack_require__(5); -var ParticleEmitterManager = __webpack_require__(205); +var ParticleEmitterManager = __webpack_require__(211); /** * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. @@ -156864,7 +165902,7 @@ var ParticleEmitterManager = __webpack_require__(205); * @since 3.0.0 * * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created. @@ -156874,17 +165912,9 @@ GameObjectFactory.register('particles', function (key, frame, emitters) return this.displayList.add(new ParticleEmitterManager(this.scene, key, frame, emitters)); }); -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /***/ }), -/* 1062 */ +/* 1123 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156894,7 +165924,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) */ var GameObjectFactory = __webpack_require__(5); -var PathFollower = __webpack_require__(424); +var PathFollower = __webpack_require__(434); /** * Creates a new PathFollower Game Object and adds it to the Scene. @@ -156908,7 +165938,7 @@ var PathFollower = __webpack_require__(424); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.PathFollower} The Game Object that was created. */ @@ -156932,7 +165962,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /***/ }), -/* 1063 */ +/* 1124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156942,7 +165972,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) */ var GameObjectFactory = __webpack_require__(5); -var RenderTexture = __webpack_require__(206); +var RenderTexture = __webpack_require__(212); /** * Creates a new Render Texture Game Object and adds it to the Scene. @@ -156958,8 +165988,8 @@ var RenderTexture = __webpack_require__(206); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} [width=32] - The width of the Render Texture. - * @param {integer} [height=32] - The height of the Render Texture. + * @param {number} [width=32] - The width of the Render Texture. + * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. * @@ -156972,7 +166002,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /***/ }), -/* 1064 */ +/* 1125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156981,7 +166011,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rope = __webpack_require__(208); +var Rope = __webpack_require__(214); var GameObjectFactory = __webpack_require__(5); /** @@ -156996,7 +166026,7 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Math.Vector2Like[]} [points] - An array containing the vertices data for this Rope. If none is provided a simple quad is created. See `setPoints` to set this post-creation. * @param {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? * @param {number[]} [colors] - An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. @@ -157012,17 +166042,9 @@ if (true) }); } -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /***/ }), -/* 1065 */ +/* 1126 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157032,7 +166054,7 @@ if (true) */ var GameObjectFactory = __webpack_require__(5); -var Sprite = __webpack_require__(76); +var Sprite = __webpack_require__(70); /** * Creates a new Sprite Game Object and adds it to the Scene. @@ -157045,7 +166067,7 @@ var Sprite = __webpack_require__(76); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Sprite} The Game Object that was created. */ @@ -157068,7 +166090,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /***/ }), -/* 1066 */ +/* 1127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157077,7 +166099,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(140); +var BitmapText = __webpack_require__(144); var GameObjectFactory = __webpack_require__(5); /** @@ -157113,7 +166135,7 @@ var GameObjectFactory = __webpack_require__(5); * @param {string} font - The key of the font to use from the BitmapFont cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size to set. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. * * @return {Phaser.GameObjects.BitmapText} The Game Object that was created. */ @@ -157132,7 +166154,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /***/ }), -/* 1067 */ +/* 1128 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157141,18 +166163,18 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Text = __webpack_require__(209); +var Text = __webpack_require__(215); var GameObjectFactory = __webpack_require__(5); /** * Creates a new Text Game Object and adds it to the Scene. - * + * * A Text Game Object. - * + * * Text objects work by creating their own internal hidden Canvas and then renders text to it using * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered * to your game during the render pass. - * + * * Because it uses the Canvas API you can take advantage of all the features this offers, such as * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts * loaded externally, such as Google or TypeKit Web fonts. @@ -157163,7 +166185,7 @@ var GameObjectFactory = __webpack_require__(5); * * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts * across mobile browsers. - * + * * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of @@ -157197,7 +166219,7 @@ GameObjectFactory.register('text', function (x, y, text, style) /***/ }), -/* 1068 */ +/* 1129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157206,7 +166228,7 @@ GameObjectFactory.register('text', function (x, y, text, style) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileSprite = __webpack_require__(210); +var TileSprite = __webpack_require__(216); var GameObjectFactory = __webpack_require__(5); /** @@ -157219,10 +166241,10 @@ var GameObjectFactory = __webpack_require__(5); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. - * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {number} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {number} height - The height of the Game Object. If zero it will use the size of the texture frame. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.TileSprite} The Game Object that was created. */ @@ -157241,7 +166263,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /***/ }), -/* 1069 */ +/* 1130 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157250,7 +166272,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Zone = __webpack_require__(117); +var Zone = __webpack_require__(125); var GameObjectFactory = __webpack_require__(5); /** @@ -157283,7 +166305,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /***/ }), -/* 1070 */ +/* 1131 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157292,7 +166314,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Video = __webpack_require__(211); +var Video = __webpack_require__(217); var GameObjectFactory = __webpack_require__(5); /** @@ -157311,25 +166333,12 @@ var GameObjectFactory = __webpack_require__(5); */ GameObjectFactory.register('video', function (x, y, key) { - var video = new Video(this.scene, x, y, key); - - this.displayList.add(video); - this.updateList.add(video); - - return video; + return this.displayList.add(new Video(this.scene, x, y, key)); }); -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /***/ }), -/* 1071 */ +/* 1132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157338,7 +166347,7 @@ GameObjectFactory.register('video', function (x, y, key) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arc = __webpack_require__(428); +var Arc = __webpack_require__(438); var GameObjectFactory = __webpack_require__(5); /** @@ -157364,8 +166373,8 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {number} [radius=128] - The radius of the arc. - * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. - * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {number} [startAngle=0] - The start angle of the arc, in degrees. + * @param {number} [endAngle=360] - The end angle of the arc, in degrees. * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. @@ -157402,7 +166411,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /***/ }), -/* 1072 */ +/* 1133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157412,7 +166421,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph */ var GameObjectFactory = __webpack_require__(5); -var Curve = __webpack_require__(429); +var Curve = __webpack_require__(439); /** * Creates a new Curve Shape Game Object and adds it to the Scene. @@ -157452,7 +166461,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /***/ }), -/* 1073 */ +/* 1134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157461,7 +166470,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(430); +var Ellipse = __webpack_require__(440); var GameObjectFactory = __webpack_require__(5); /** @@ -157504,7 +166513,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /***/ }), -/* 1074 */ +/* 1135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157514,7 +166523,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, */ var GameObjectFactory = __webpack_require__(5); -var Grid = __webpack_require__(431); +var Grid = __webpack_require__(441); /** * Creates a new Grid Shape Game Object and adds it to the Scene. @@ -157559,7 +166568,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /***/ }), -/* 1075 */ +/* 1136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157569,7 +166578,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel */ var GameObjectFactory = __webpack_require__(5); -var IsoBox = __webpack_require__(432); +var IsoBox = __webpack_require__(442); /** * Creates a new IsoBox Shape Game Object and adds it to the Scene. @@ -157610,7 +166619,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /***/ }), -/* 1076 */ +/* 1137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157620,7 +166629,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill */ var GameObjectFactory = __webpack_require__(5); -var IsoTriangle = __webpack_require__(433); +var IsoTriangle = __webpack_require__(443); /** * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. @@ -157663,7 +166672,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /***/ }), -/* 1077 */ +/* 1138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157673,7 +166682,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed */ var GameObjectFactory = __webpack_require__(5); -var Line = __webpack_require__(434); +var Line = __webpack_require__(444); /** * Creates a new Line Shape Game Object and adds it to the Scene. @@ -157714,7 +166723,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /***/ }), -/* 1078 */ +/* 1139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157724,7 +166733,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, */ var GameObjectFactory = __webpack_require__(5); -var Polygon = __webpack_require__(435); +var Polygon = __webpack_require__(445); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. @@ -157767,7 +166776,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /***/ }), -/* 1079 */ +/* 1140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157777,7 +166786,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp */ var GameObjectFactory = __webpack_require__(5); -var Rectangle = __webpack_require__(440); +var Rectangle = __webpack_require__(450); /** * Creates a new Rectangle Shape Game Object and adds it to the Scene. @@ -157812,7 +166821,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /***/ }), -/* 1080 */ +/* 1141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157821,7 +166830,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Star = __webpack_require__(441); +var Star = __webpack_require__(451); var GameObjectFactory = __webpack_require__(5); /** @@ -157864,7 +166873,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /***/ }), -/* 1081 */ +/* 1142 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157874,7 +166883,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad */ var GameObjectFactory = __webpack_require__(5); -var Triangle = __webpack_require__(442); +var Triangle = __webpack_require__(452); /** * Creates a new Triangle Shape Game Object and adds it to the Scene. @@ -157915,7 +166924,7 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /***/ }), -/* 1082 */ +/* 1143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157924,9 +166933,9 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(199); -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var Blitter = __webpack_require__(204); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); /** @@ -157965,7 +166974,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /***/ }), -/* 1083 */ +/* 1144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157975,9 +166984,9 @@ GameObjectCreator.register('blitter', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var Container = __webpack_require__(200); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var Container = __webpack_require__(205); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); /** @@ -158015,7 +167024,7 @@ GameObjectCreator.register('container', function (config, addToScene) /***/ }), -/* 1084 */ +/* 1145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158024,9 +167033,9 @@ GameObjectCreator.register('container', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(201); -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BitmapText = __webpack_require__(206); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); /** @@ -158066,7 +167075,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /***/ }), -/* 1085 */ +/* 1146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158075,8 +167084,8 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); -var Graphics = __webpack_require__(202); +var GameObjectCreator = __webpack_require__(17); +var Graphics = __webpack_require__(207); /** * Creates a new Graphics Game Object and returns it. @@ -158114,7 +167123,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /***/ }), -/* 1086 */ +/* 1147 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158123,8 +167132,8 @@ GameObjectCreator.register('graphics', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); -var Group = __webpack_require__(100); +var GameObjectCreator = __webpack_require__(17); +var Group = __webpack_require__(108); /** * Creates a new Group Game Object and returns it. @@ -158147,7 +167156,7 @@ GameObjectCreator.register('group', function (config) /***/ }), -/* 1087 */ +/* 1148 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158156,10 +167165,10 @@ GameObjectCreator.register('group', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Image = __webpack_require__(114); +var Image = __webpack_require__(122); /** * Creates a new Image Game Object and returns it. @@ -158197,7 +167206,55 @@ GameObjectCreator.register('image', function (config, addToScene) /***/ }), -/* 1088 */ +/* 1149 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(28); +var Layer = __webpack_require__(210); +var GameObjectCreator = __webpack_require__(17); +var GetAdvancedValue = __webpack_require__(15); + +/** + * Creates a new Layer Game Object and returns it. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#layer + * @since 3.50.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Layer} The Game Object that was created. + */ +GameObjectCreator.register('layer', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var children = GetAdvancedValue(config, 'children', null); + + var layer = new Layer(this.scene, children); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, layer, config); + + return layer; +}); + + +/***/ }), +/* 1150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158206,10 +167263,10 @@ GameObjectCreator.register('image', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); var GetFastValue = __webpack_require__(2); -var ParticleEmitterManager = __webpack_require__(205); +var ParticleEmitterManager = __webpack_require__(211); /** * Creates a new Particle Emitter Manager Game Object and returns it. @@ -158246,13 +167303,17 @@ GameObjectCreator.register('particles', function (config, addToScene) { this.displayList.add(manager); } + else + { + this.updateList.add(manager); + } return manager; }); /***/ }), -/* 1089 */ +/* 1151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158261,10 +167322,10 @@ GameObjectCreator.register('particles', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var RenderTexture = __webpack_require__(206); +var RenderTexture = __webpack_require__(212); /** * Creates a new Render Texture Game Object and returns it. @@ -158304,7 +167365,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /***/ }), -/* 1090 */ +/* 1152 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158313,11 +167374,11 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); var GetValue = __webpack_require__(6); -var Rope = __webpack_require__(208); +var Rope = __webpack_require__(214); /** * Creates a new Rope Game Object and returns it. @@ -158352,6 +167413,11 @@ GameObjectCreator.register('rope', function (config, addToScene) BuildGameObject(this.scene, rope, config); + if (!config.add) + { + this.updateList.add(rope); + } + return rope; }); @@ -158359,7 +167425,7 @@ GameObjectCreator.register('rope', function (config, addToScene) /***/ }), -/* 1091 */ +/* 1153 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158368,11 +167434,11 @@ GameObjectCreator.register('rope', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var BuildGameObjectAnimation = __webpack_require__(406); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var BuildGameObjectAnimation = __webpack_require__(416); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Sprite = __webpack_require__(76); +var Sprite = __webpack_require__(70); /** * Creates a new Sprite Game Object and returns it. @@ -158412,7 +167478,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /***/ }), -/* 1092 */ +/* 1154 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158421,9 +167487,9 @@ GameObjectCreator.register('sprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(140); -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BitmapText = __webpack_require__(144); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); var GetValue = __webpack_require__(6); @@ -158465,7 +167531,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /***/ }), -/* 1093 */ +/* 1155 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158474,10 +167540,10 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Text = __webpack_require__(209); +var Text = __webpack_require__(215); /** * Creates a new Text Game Object and returns it. @@ -158552,7 +167618,7 @@ GameObjectCreator.register('text', function (config, addToScene) /***/ }), -/* 1094 */ +/* 1156 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158561,10 +167627,10 @@ GameObjectCreator.register('text', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var TileSprite = __webpack_require__(210); +var TileSprite = __webpack_require__(216); /** * Creates a new TileSprite Game Object and returns it. @@ -158604,7 +167670,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /***/ }), -/* 1095 */ +/* 1157 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158613,9 +167679,9 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Zone = __webpack_require__(117); +var Zone = __webpack_require__(125); /** * Creates a new Zone Game Object and returns it. @@ -158643,7 +167709,7 @@ GameObjectCreator.register('zone', function (config) /***/ }), -/* 1096 */ +/* 1158 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158652,10 +167718,10 @@ GameObjectCreator.register('zone', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Video = __webpack_require__(211); +var Video = __webpack_require__(217); /** * Creates a new Video Game Object and returns it. @@ -158685,6 +167751,11 @@ GameObjectCreator.register('video', function (config, addToScene) BuildGameObject(this.scene, video, config); + if (!config.add) + { + this.updateList.add(video); + } + return video; }); @@ -158692,7 +167763,7 @@ GameObjectCreator.register('video', function (config, addToScene) /***/ }), -/* 1097 */ +/* 1159 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158706,12 +167777,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1098); + renderWebGL = __webpack_require__(1160); } if (true) { - renderCanvas = __webpack_require__(1099); + renderCanvas = __webpack_require__(1161); } module.exports = { @@ -158723,7 +167794,7 @@ module.exports = { /***/ }), -/* 1098 */ +/* 1160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158732,179 +167803,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.GameObjects.Mesh#renderWebGL - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) -{ - var pipeline = renderer.pipelines.set(this.pipeline, src); - - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - var vertices = src.vertices; - var uvs = src.uv; - var colors = src.colors; - var alphas = src.alphas; - - var meshVerticesLength = vertices.length; - var vertexCount = Math.floor(meshVerticesLength * 0.5); - - if (pipeline.vertexCount + vertexCount > pipeline.vertexCapacity) - { - pipeline.flush(); - } - - var textureUnit = pipeline.setGameObject(src); - - var vertexViewF32 = pipeline.vertexViewF32; - var vertexViewU32 = pipeline.vertexViewU32; - - var vertexOffset = (pipeline.vertexCount * pipeline.vertexComponentCount) - 1; - - var colorIndex = 0; - var tintEffect = src.tintFill; - - for (var i = 0; i < meshVerticesLength; i += 2) - { - var x = vertices[i + 0]; - var y = vertices[i + 1]; - - var tx = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e; - var ty = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f; - - if (camera.roundPixels) - { - tx = Math.round(tx); - ty = Math.round(ty); - } - - vertexViewF32[++vertexOffset] = tx; - vertexViewF32[++vertexOffset] = ty; - vertexViewF32[++vertexOffset] = uvs[i + 0]; - vertexViewF32[++vertexOffset] = uvs[i + 1]; - vertexViewF32[++vertexOffset] = textureUnit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = Utils.getTintAppendFloatAlpha(colors[colorIndex], camera.alpha * alphas[colorIndex]); - - colorIndex++; - } - - pipeline.vertexCount += vertexCount; -}; - -module.exports = MeshWebGLRenderer; - - -/***/ }), -/* 1099 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a stub function for Mesh.Render. There is no Canvas renderer for Mesh objects. - * - * @method Phaser.GameObjects.Mesh#renderCanvas - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - */ -var MeshCanvasRenderer = function () -{ -}; - -module.exports = MeshCanvasRenderer; - - -/***/ }), -/* 1100 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var renderWebGL = __webpack_require__(1); -var renderCanvas = __webpack_require__(1); - -if (true) -{ - renderWebGL = __webpack_require__(1101); -} - -if (true) -{ - renderCanvas = __webpack_require__(1102); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 1101 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +var GetCalcMatrix = __webpack_require__(21); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -158917,11 +167816,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ShaderWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (!src.shader) { @@ -158937,30 +167835,7 @@ var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, came } else { - var camMatrix = src._tempMatrix1; - var shapeMatrix = src._tempMatrix2; - var calcMatrix = src._tempMatrix3; - - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; // Renderer size changed? if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) @@ -158979,7 +167854,7 @@ module.exports = ShaderWebGLRenderer; /***/ }), -/* 1102 */ +/* 1161 */ /***/ (function(module, exports) { /** @@ -158997,7 +167872,6 @@ module.exports = ShaderWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. */ var ShaderCanvasRenderer = function () @@ -159008,7 +167882,7 @@ module.exports = ShaderCanvasRenderer; /***/ }), -/* 1103 */ +/* 1162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159017,48 +167891,29 @@ module.exports = ShaderCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Mesh = __webpack_require__(142); -var GameObjectFactory = __webpack_require__(5); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); -/** - * Creates a new Mesh Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. - * - * @method Phaser.GameObjects.GameObjectFactory#mesh - * @webglOnly - * @since 3.0.0 - * - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number[]} vertices - An array containing the vertices data for this Mesh. - * @param {number[]} uv - An array containing the uv data for this Mesh. - * @param {number[]} colors - An array containing the color data for this Mesh. - * @param {number[]} alphas - An array containing the alpha data for this Mesh. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.GameObjects.Mesh} The Game Object that was created. - */ if (true) { - GameObjectFactory.register('mesh', function (x, y, vertices, uv, colors, alphas, texture, frame) - { - return this.displayList.add(new Mesh(this.scene, x, y, vertices, uv, colors, alphas, texture, frame)); - }); + renderWebGL = __webpack_require__(1163); } -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns +if (true) +{ + renderCanvas = __webpack_require__(1164); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; /***/ }), -/* 1104 */ +/* 1163 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159067,44 +167922,136 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Quad = __webpack_require__(214); -var GameObjectFactory = __webpack_require__(5); +var GetCalcMatrix = __webpack_require__(21); /** - * Creates a new Quad Game Object and adds it to the Scene. + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. - * - * @method Phaser.GameObjects.GameObjectFactory#quad - * @webglOnly + * @method Phaser.GameObjects.Mesh#renderWebGL * @since 3.0.0 + * @private * - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.GameObjects.Quad} The Game Object that was created. + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -if (true) +var MeshWebGLRenderer = function (renderer, src, camera, parentMatrix) { - GameObjectFactory.register('quad', function (x, y, key, frame) - { - return this.displayList.add(new Quad(this.scene, x, y, key, frame)); - }); -} + var faces = src.faces; + var totalFaces = faces.length; -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns + if (totalFaces === 0) + { + return; + } + + var pipeline = renderer.pipelines.set(src.pipeline, src); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var textureUnit = pipeline.setGameObject(src); + + var F32 = pipeline.vertexViewF32; + var U32 = pipeline.vertexViewU32; + + var vertexOffset = (pipeline.vertexCount * pipeline.currentShader.vertexComponentCount) - 1; + + var tintEffect = src.tintFill; + + var debugFaces = []; + var debugCallback = src.debugCallback; + + var a = calcMatrix.a; + var b = calcMatrix.b; + var c = calcMatrix.c; + var d = calcMatrix.d; + var e = calcMatrix.e; + var f = calcMatrix.f; + + var z = src.viewPosition.z; + + var hideCCW = src.hideCCW; + var roundPixels = camera.roundPixels; + var alpha = camera.alpha * src.alpha; + + var totalFacesRendered = 0; + + renderer.pipelines.preBatch(src); + + for (var i = 0; i < totalFaces; i++) + { + var face = faces[i]; + + // If face has alpha <= 0, or hideCCW + clockwise, or isn't in camera view, then don't draw it + if (!face.isInView(camera, hideCCW, z, alpha, a, b, c, d, e, f, roundPixels)) + { + continue; + } + + if (pipeline.shouldFlush(3)) + { + pipeline.flush(); + + vertexOffset = 0; + } + + vertexOffset = face.load(F32, U32, vertexOffset, textureUnit, tintEffect); + + totalFacesRendered++; + pipeline.vertexCount += 3; + + if (debugCallback) + { + debugFaces.push(face); + } + } + + src.totalFrame += totalFacesRendered; + + if (debugCallback) + { + debugCallback.call(src, src, debugFaces); + } + + renderer.pipelines.postBatch(src); +}; + +module.exports = MeshWebGLRenderer; /***/ }), -/* 1105 */ +/* 1164 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a stub function for Mesh.Render. There is no Canvas renderer for Mesh objects. + * + * @method Phaser.GameObjects.Mesh#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var MeshCanvasRenderer = function () +{ +}; + +module.exports = MeshCanvasRenderer; + + +/***/ }), +/* 1165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159113,7 +168060,7 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Shader = __webpack_require__(215); +var Shader = __webpack_require__(220); var GameObjectFactory = __webpack_require__(5); /** @@ -159145,7 +168092,7 @@ if (true) /***/ }), -/* 1106 */ +/* 1166 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159154,53 +168101,43 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); -var GetAdvancedValue = __webpack_require__(15); -var GetValue = __webpack_require__(6); -var Mesh = __webpack_require__(142); +var Mesh = __webpack_require__(221); +var GameObjectFactory = __webpack_require__(5); /** - * Creates a new Mesh Game Object and returns it. + * Creates a new Mesh Game Object and adds it to the Scene. * * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. * - * @method Phaser.GameObjects.GameObjectCreator#mesh + * @method Phaser.GameObjects.GameObjectFactory#mesh + * @webglOnly * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. - * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * @param {number} [x] - The horizontal position of this Game Object in the world. + * @param {number} [y] - The vertical position of this Game Object in the world. + * @param {string|Phaser.Textures.Texture} [texture] - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {string|number} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {number[]} [vertices] - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} [uvs] - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. * * @return {Phaser.GameObjects.Mesh} The Game Object that was created. */ -GameObjectCreator.register('mesh', function (config, addToScene) +if (true) { - if (config === undefined) { config = {}; } - - var key = GetAdvancedValue(config, 'key', null); - var frame = GetAdvancedValue(config, 'frame', null); - var vertices = GetValue(config, 'vertices', []); - var colors = GetValue(config, 'colors', []); - var alphas = GetValue(config, 'alphas', []); - var uv = GetValue(config, 'uv', []); - - var mesh = new Mesh(this.scene, 0, 0, vertices, uv, colors, alphas, key, frame); - - if (addToScene !== undefined) + GameObjectFactory.register('mesh', function (x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas) { - config.add = addToScene; - } - - BuildGameObject(this.scene, mesh, config); - - return mesh; -}); - -// When registering a factory function 'this' refers to the GameObjectCreator context. + return this.displayList.add(new Mesh(this.scene, x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas)); + }); +} /***/ }), -/* 1107 */ +/* 1167 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159209,60 +168146,10 @@ GameObjectCreator.register('mesh', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Quad = __webpack_require__(214); - -/** - * Creates a new Quad Game Object and returns it. - * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. - * - * @method Phaser.GameObjects.GameObjectCreator#quad - * @since 3.0.0 - * - * @param {object} config - The configuration object this Game Object will use to create itself. - * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - * - * @return {Phaser.GameObjects.Quad} The Game Object that was created. - */ -GameObjectCreator.register('quad', function (config, addToScene) -{ - if (config === undefined) { config = {}; } - - var x = GetAdvancedValue(config, 'x', 0); - var y = GetAdvancedValue(config, 'y', 0); - var key = GetAdvancedValue(config, 'key', null); - var frame = GetAdvancedValue(config, 'frame', null); - - var quad = new Quad(this.scene, x, y, key, frame); - - if (addToScene !== undefined) - { - config.add = addToScene; - } - - BuildGameObject(this.scene, quad, config); - - return quad; -}); - - -/***/ }), -/* 1108 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); -var GetAdvancedValue = __webpack_require__(15); -var Shader = __webpack_require__(215); +var Shader = __webpack_require__(220); /** * Creates a new Shader Game Object and returns it. @@ -159303,7 +168190,63 @@ GameObjectCreator.register('shader', function (config, addToScene) /***/ }), -/* 1109 */ +/* 1168 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); +var GetAdvancedValue = __webpack_require__(15); +var GetValue = __webpack_require__(6); +var Mesh = __webpack_require__(221); + +/** + * Creates a new Mesh Game Object and returns it. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#mesh + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Mesh} The Game Object that was created. + */ +GameObjectCreator.register('mesh', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + var vertices = GetValue(config, 'vertices', []); + var uvs = GetValue(config, 'uvs', []); + var indicies = GetValue(config, 'indicies', []); + var containsZ = GetValue(config, 'containsZ', false); + var normals = GetValue(config, 'normals', []); + var colors = GetValue(config, 'colors', 0xffffff); + var alphas = GetValue(config, 'alphas', 1); + + var mesh = new Mesh(this.scene, 0, 0, key, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, mesh, config); + + return mesh; +}); + + +/***/ }), +/* 1169 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159313,8 +168256,251 @@ GameObjectCreator.register('shader', function (config, addToScene) */ var Class = __webpack_require__(0); -var LightsManager = __webpack_require__(447); -var PluginCache = __webpack_require__(23); +var Components = __webpack_require__(11); +var GameObject = __webpack_require__(14); +var IntegerToRGB = __webpack_require__(181); +var RGB = __webpack_require__(376); + +/** + * @classdesc + * An Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + * + * @class PointLight + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.50.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + */ +var PointLight = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Pipeline, + Components.ScrollFactor, + Components.Transform, + Components.Visible + ], + + initialize: + + function PointLight (scene, x, y, color, radius, intensity) + { + if (color === undefined) { color = 0xffffff; } + if (radius === undefined) { radius = 128; } + if (intensity === undefined) { intensity = 10; } + + GameObject.call(this, scene, 'PointLight'); + + this.initPipeline('Light2D'); + + this.setPosition(x, y); + + var rgb = IntegerToRGB(color); + + this.color = new RGB( + rgb.r / 255, + rgb.g / 255, + rgb.b / 255 + ); + + this.intensity = intensity; + + // read only: + this.width = radius * 2; + this.height = radius * 2; + + // private + this._radius = radius; + }, + + radius: { + + get: function () + { + return this._radius; + }, + + set: function (value) + { + this._radius = value; + this.width = value * 2; + this.height = value * 2; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#originX + * @type {number} + * @readonly + * @since 3.4.0 + */ + originX: { + + get: function () + { + return 0.5; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#originY + * @type {number} + * @readonly + * @since 3.4.0 + */ + originY: { + + get: function () + { + return 0.5; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#displayOriginX + * @type {number} + * @readonly + * @since 3.4.0 + */ + displayOriginX: { + + get: function () + { + return this._radius; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#displayOriginY + * @type {number} + * @readonly + * @since 3.4.0 + */ + displayOriginY: { + + get: function () + { + return this._radius; + } + + }, + + renderWebGL: function (renderer, src, camera, parentTransformMatrix) + { + var pipeline = renderer.pipelines.set(src.pipeline); + + var camMatrix = pipeline.tempMatrix1; + var lightMatrix = pipeline.tempMatrix2; + var calcMatrix = pipeline.tempMatrix3; + + var width = src.width; + var height = src.height; + + var x = -src.radius; + var y = -src.radius; + + var xw = x + width; + var yh = y + height; + + lightMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + lightMatrix.e = src.x; + lightMatrix.f = src.y; + } + else + { + lightMatrix.e -= camera.scrollX * src.scrollFactorX; + lightMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(lightMatrix, calcMatrix); + + var lightX = calcMatrix.getX(0, 0); + var lightY = calcMatrix.getY(0, 0); + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + pipeline.batchLight(src, camera, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, lightX, lightY); + } + +}); + +module.exports = PointLight; + + +/***/ }), +/* 1170 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var LightsManager = __webpack_require__(459); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -159419,7 +168605,7 @@ module.exports = LightsPlugin; /***/ }), -/* 1110 */ +/* 1171 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159428,29 +168614,29 @@ module.exports = LightsPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); +var Circle = __webpack_require__(71); -Circle.Area = __webpack_require__(1111); -Circle.Circumference = __webpack_require__(279); -Circle.CircumferencePoint = __webpack_require__(159); -Circle.Clone = __webpack_require__(1112); -Circle.Contains = __webpack_require__(57); -Circle.ContainsPoint = __webpack_require__(1113); -Circle.ContainsRect = __webpack_require__(1114); -Circle.CopyFrom = __webpack_require__(1115); -Circle.Equals = __webpack_require__(1116); -Circle.GetBounds = __webpack_require__(1117); -Circle.GetPoint = __webpack_require__(277); -Circle.GetPoints = __webpack_require__(278); -Circle.Offset = __webpack_require__(1118); -Circle.OffsetPoint = __webpack_require__(1119); -Circle.Random = __webpack_require__(160); +Circle.Area = __webpack_require__(1172); +Circle.Circumference = __webpack_require__(294); +Circle.CircumferencePoint = __webpack_require__(160); +Circle.Clone = __webpack_require__(1173); +Circle.Contains = __webpack_require__(62); +Circle.ContainsPoint = __webpack_require__(1174); +Circle.ContainsRect = __webpack_require__(1175); +Circle.CopyFrom = __webpack_require__(1176); +Circle.Equals = __webpack_require__(1177); +Circle.GetBounds = __webpack_require__(1178); +Circle.GetPoint = __webpack_require__(292); +Circle.GetPoints = __webpack_require__(293); +Circle.Offset = __webpack_require__(1179); +Circle.OffsetPoint = __webpack_require__(1180); +Circle.Random = __webpack_require__(161); module.exports = Circle; /***/ }), -/* 1111 */ +/* 1172 */ /***/ (function(module, exports) { /** @@ -159478,7 +168664,7 @@ module.exports = Area; /***/ }), -/* 1112 */ +/* 1173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159487,7 +168673,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); +var Circle = __webpack_require__(71); /** * Creates a new Circle instance based on the values contained in the given source. @@ -159508,7 +168694,7 @@ module.exports = Clone; /***/ }), -/* 1113 */ +/* 1174 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159517,7 +168703,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(57); +var Contains = __webpack_require__(62); /** * Check to see if the Circle contains the given Point object. @@ -159539,7 +168725,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1114 */ +/* 1175 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159548,7 +168734,7 @@ module.exports = ContainsPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(57); +var Contains = __webpack_require__(62); /** * Check to see if the Circle contains all four points of the given Rectangle object. @@ -159575,7 +168761,7 @@ module.exports = ContainsRect; /***/ }), -/* 1115 */ +/* 1176 */ /***/ (function(module, exports) { /** @@ -159607,7 +168793,7 @@ module.exports = CopyFrom; /***/ }), -/* 1116 */ +/* 1177 */ /***/ (function(module, exports) { /** @@ -159641,7 +168827,7 @@ module.exports = Equals; /***/ }), -/* 1117 */ +/* 1178 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159681,7 +168867,7 @@ module.exports = GetBounds; /***/ }), -/* 1118 */ +/* 1179 */ /***/ (function(module, exports) { /** @@ -159716,7 +168902,7 @@ module.exports = Offset; /***/ }), -/* 1119 */ +/* 1180 */ /***/ (function(module, exports) { /** @@ -159750,7 +168936,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1120 */ +/* 1181 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159759,29 +168945,29 @@ module.exports = OffsetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(98); +var Ellipse = __webpack_require__(106); -Ellipse.Area = __webpack_require__(1121); -Ellipse.Circumference = __webpack_require__(414); -Ellipse.CircumferencePoint = __webpack_require__(204); -Ellipse.Clone = __webpack_require__(1122); -Ellipse.Contains = __webpack_require__(99); -Ellipse.ContainsPoint = __webpack_require__(1123); -Ellipse.ContainsRect = __webpack_require__(1124); -Ellipse.CopyFrom = __webpack_require__(1125); -Ellipse.Equals = __webpack_require__(1126); -Ellipse.GetBounds = __webpack_require__(1127); -Ellipse.GetPoint = __webpack_require__(412); -Ellipse.GetPoints = __webpack_require__(413); -Ellipse.Offset = __webpack_require__(1128); -Ellipse.OffsetPoint = __webpack_require__(1129); -Ellipse.Random = __webpack_require__(167); +Ellipse.Area = __webpack_require__(1182); +Ellipse.Circumference = __webpack_require__(424); +Ellipse.CircumferencePoint = __webpack_require__(209); +Ellipse.Clone = __webpack_require__(1183); +Ellipse.Contains = __webpack_require__(107); +Ellipse.ContainsPoint = __webpack_require__(1184); +Ellipse.ContainsRect = __webpack_require__(1185); +Ellipse.CopyFrom = __webpack_require__(1186); +Ellipse.Equals = __webpack_require__(1187); +Ellipse.GetBounds = __webpack_require__(1188); +Ellipse.GetPoint = __webpack_require__(422); +Ellipse.GetPoints = __webpack_require__(423); +Ellipse.Offset = __webpack_require__(1189); +Ellipse.OffsetPoint = __webpack_require__(1190); +Ellipse.Random = __webpack_require__(172); module.exports = Ellipse; /***/ }), -/* 1121 */ +/* 1182 */ /***/ (function(module, exports) { /** @@ -159815,7 +169001,7 @@ module.exports = Area; /***/ }), -/* 1122 */ +/* 1183 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159824,7 +169010,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(98); +var Ellipse = __webpack_require__(106); /** * Creates a new Ellipse instance based on the values contained in the given source. @@ -159845,7 +169031,7 @@ module.exports = Clone; /***/ }), -/* 1123 */ +/* 1184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159854,7 +169040,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(99); +var Contains = __webpack_require__(107); /** * Check to see if the Ellipse contains the given Point object. @@ -159876,7 +169062,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1124 */ +/* 1185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159885,7 +169071,7 @@ module.exports = ContainsPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(99); +var Contains = __webpack_require__(107); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. @@ -159912,7 +169098,7 @@ module.exports = ContainsRect; /***/ }), -/* 1125 */ +/* 1186 */ /***/ (function(module, exports) { /** @@ -159944,7 +169130,7 @@ module.exports = CopyFrom; /***/ }), -/* 1126 */ +/* 1187 */ /***/ (function(module, exports) { /** @@ -159979,7 +169165,7 @@ module.exports = Equals; /***/ }), -/* 1127 */ +/* 1188 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160019,7 +169205,7 @@ module.exports = GetBounds; /***/ }), -/* 1128 */ +/* 1189 */ /***/ (function(module, exports) { /** @@ -160054,7 +169240,7 @@ module.exports = Offset; /***/ }), -/* 1129 */ +/* 1190 */ /***/ (function(module, exports) { /** @@ -160088,7 +169274,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1130 */ +/* 1191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160099,7 +169285,7 @@ module.exports = OffsetPoint; */ var Point = __webpack_require__(4); -var CircleToCircle = __webpack_require__(216); +var CircleToCircle = __webpack_require__(222); /** * Checks if two Circles intersect and returns the intersection points as a Point object array. @@ -160182,7 +169368,7 @@ module.exports = GetCircleToCircle; /***/ }), -/* 1131 */ +/* 1192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160192,8 +169378,8 @@ module.exports = GetCircleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(218); -var CircleToRectangle = __webpack_require__(217); +var GetLineToCircle = __webpack_require__(224); +var CircleToRectangle = __webpack_require__(223); /** * Checks for intersection between a circle and a rectangle, @@ -160232,7 +169418,7 @@ module.exports = GetCircleToRectangle; /***/ }), -/* 1132 */ +/* 1193 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160241,9 +169427,9 @@ module.exports = GetCircleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector4 = __webpack_require__(129); -var GetLineToPolygon = __webpack_require__(452); -var Line = __webpack_require__(40); +var Vector4 = __webpack_require__(135); +var GetLineToPolygon = __webpack_require__(464); +var Line = __webpack_require__(45); // Temp calculation segment var segment = new Line(); @@ -160334,7 +169520,7 @@ module.exports = GetRaysFromPointToPolygon; /***/ }), -/* 1133 */ +/* 1194 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160344,7 +169530,7 @@ module.exports = GetRaysFromPointToPolygon; */ var Rectangle = __webpack_require__(9); -var RectangleToRectangle = __webpack_require__(143); +var RectangleToRectangle = __webpack_require__(112); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. @@ -160383,7 +169569,7 @@ module.exports = GetRectangleIntersection; /***/ }), -/* 1134 */ +/* 1195 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160393,8 +169579,8 @@ module.exports = GetRectangleIntersection; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToRectangle = __webpack_require__(220); -var RectangleToRectangle = __webpack_require__(143); +var GetLineToRectangle = __webpack_require__(226); +var RectangleToRectangle = __webpack_require__(112); /** * Checks if two Rectangles intersect and returns the intersection points as a Point object array. @@ -160434,7 +169620,7 @@ module.exports = GetRectangleToRectangle; /***/ }), -/* 1135 */ +/* 1196 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160444,8 +169630,8 @@ module.exports = GetRectangleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RectangleToTriangle = __webpack_require__(454); -var GetLineToRectangle = __webpack_require__(220); +var RectangleToTriangle = __webpack_require__(466); +var GetLineToRectangle = __webpack_require__(226); /** * Checks for intersection between Rectangle shape and Triangle shape, @@ -160482,7 +169668,7 @@ module.exports = GetRectangleToTriangle; /***/ }), -/* 1136 */ +/* 1197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160492,8 +169678,8 @@ module.exports = GetRectangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(218); -var TriangleToCircle = __webpack_require__(456); +var GetLineToCircle = __webpack_require__(224); +var TriangleToCircle = __webpack_require__(468); /** * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. @@ -160531,7 +169717,7 @@ module.exports = GetTriangleToCircle; /***/ }), -/* 1137 */ +/* 1198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160541,8 +169727,8 @@ module.exports = GetTriangleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TriangleToTriangle = __webpack_require__(459); -var GetTriangleToLine = __webpack_require__(457); +var TriangleToTriangle = __webpack_require__(471); +var GetTriangleToLine = __webpack_require__(469); /** * Checks if two Triangles intersect, and returns the intersection points as a Point object array. @@ -160580,7 +169766,7 @@ module.exports = GetTriangleToTriangle; /***/ }), -/* 1138 */ +/* 1199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160589,7 +169775,7 @@ module.exports = GetTriangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PointToLine = __webpack_require__(461); +var PointToLine = __webpack_require__(473); /** * Checks if a Point is located on the given line segment. @@ -160621,7 +169807,7 @@ module.exports = PointToLineSegment; /***/ }), -/* 1139 */ +/* 1200 */ /***/ (function(module, exports) { /** @@ -160661,7 +169847,7 @@ module.exports = RectangleToValues; /***/ }), -/* 1140 */ +/* 1201 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160670,43 +169856,43 @@ module.exports = RectangleToValues; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(40); +var Line = __webpack_require__(45); -Line.Angle = __webpack_require__(87); -Line.BresenhamPoints = __webpack_require__(297); -Line.CenterOn = __webpack_require__(1141); -Line.Clone = __webpack_require__(1142); -Line.CopyFrom = __webpack_require__(1143); -Line.Equals = __webpack_require__(1144); -Line.Extend = __webpack_require__(1145); -Line.GetEasedPoints = __webpack_require__(1146); -Line.GetMidPoint = __webpack_require__(1147); -Line.GetNearestPoint = __webpack_require__(1148); -Line.GetNormal = __webpack_require__(1149); -Line.GetPoint = __webpack_require__(284); -Line.GetPoints = __webpack_require__(162); -Line.GetShortestDistance = __webpack_require__(1150); -Line.Height = __webpack_require__(1151); -Line.Length = __webpack_require__(58); -Line.NormalAngle = __webpack_require__(462); -Line.NormalX = __webpack_require__(1152); -Line.NormalY = __webpack_require__(1153); -Line.Offset = __webpack_require__(1154); -Line.PerpSlope = __webpack_require__(1155); -Line.Random = __webpack_require__(163); -Line.ReflectAngle = __webpack_require__(1156); -Line.Rotate = __webpack_require__(1157); -Line.RotateAroundPoint = __webpack_require__(1158); -Line.RotateAroundXY = __webpack_require__(222); -Line.SetToAngle = __webpack_require__(1159); -Line.Slope = __webpack_require__(1160); -Line.Width = __webpack_require__(1161); +Line.Angle = __webpack_require__(92); +Line.BresenhamPoints = __webpack_require__(309); +Line.CenterOn = __webpack_require__(1202); +Line.Clone = __webpack_require__(1203); +Line.CopyFrom = __webpack_require__(1204); +Line.Equals = __webpack_require__(1205); +Line.Extend = __webpack_require__(1206); +Line.GetEasedPoints = __webpack_require__(1207); +Line.GetMidPoint = __webpack_require__(1208); +Line.GetNearestPoint = __webpack_require__(1209); +Line.GetNormal = __webpack_require__(1210); +Line.GetPoint = __webpack_require__(299); +Line.GetPoints = __webpack_require__(163); +Line.GetShortestDistance = __webpack_require__(1211); +Line.Height = __webpack_require__(1212); +Line.Length = __webpack_require__(63); +Line.NormalAngle = __webpack_require__(474); +Line.NormalX = __webpack_require__(1213); +Line.NormalY = __webpack_require__(1214); +Line.Offset = __webpack_require__(1215); +Line.PerpSlope = __webpack_require__(1216); +Line.Random = __webpack_require__(164); +Line.ReflectAngle = __webpack_require__(1217); +Line.Rotate = __webpack_require__(1218); +Line.RotateAroundPoint = __webpack_require__(1219); +Line.RotateAroundXY = __webpack_require__(228); +Line.SetToAngle = __webpack_require__(1220); +Line.Slope = __webpack_require__(1221); +Line.Width = __webpack_require__(1222); module.exports = Line; /***/ }), -/* 1141 */ +/* 1202 */ /***/ (function(module, exports) { /** @@ -160746,7 +169932,7 @@ module.exports = CenterOn; /***/ }), -/* 1142 */ +/* 1203 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160755,7 +169941,7 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(40); +var Line = __webpack_require__(45); /** * Clone the given line. @@ -160776,7 +169962,7 @@ module.exports = Clone; /***/ }), -/* 1143 */ +/* 1204 */ /***/ (function(module, exports) { /** @@ -160807,7 +169993,7 @@ module.exports = CopyFrom; /***/ }), -/* 1144 */ +/* 1205 */ /***/ (function(module, exports) { /** @@ -160841,7 +170027,7 @@ module.exports = Equals; /***/ }), -/* 1145 */ +/* 1206 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160850,7 +170036,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); /** * Extends the start and end points of a Line by the given amounts. @@ -160899,7 +170085,7 @@ module.exports = Extend; /***/ }), -/* 1146 */ +/* 1207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160908,8 +170094,8 @@ module.exports = Extend; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DistanceBetweenPoints = __webpack_require__(333); -var GetEaseFunction = __webpack_require__(71); +var DistanceBetweenPoints = __webpack_require__(344); +var GetEaseFunction = __webpack_require__(78); var Point = __webpack_require__(4); /** @@ -160941,7 +170127,7 @@ var Point = __webpack_require__(4); * * @param {Phaser.Geom.Line} line - The Line object. * @param {(string|function)} ease - The ease to use. This can be either a string from the EaseMap, or a custom function. - * @param {integer} quantity - The number of points to return. Note that if you provide a `collinearThreshold`, the resulting array may not always contain this number of points. + * @param {number} quantity - The number of points to return. Note that if you provide a `collinearThreshold`, the resulting array may not always contain this number of points. * @param {number} [collinearThreshold=0] - An optional threshold. The final array is reduced so that each point is spaced out at least this distance apart. This helps reduce clustering in noisey eases. * @param {number[]} [easeParams] - An optional array of ease parameters to go with the ease. * @@ -161019,7 +170205,7 @@ module.exports = GetEasedPoints; /***/ }), -/* 1147 */ +/* 1208 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161057,7 +170243,7 @@ module.exports = GetMidPoint; /***/ }), -/* 1148 */ +/* 1209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161112,7 +170298,7 @@ module.exports = GetNearestPoint; /***/ }), -/* 1149 */ +/* 1210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161122,7 +170308,7 @@ module.exports = GetNearestPoint; */ var MATH_CONST = __webpack_require__(13); -var Angle = __webpack_require__(87); +var Angle = __webpack_require__(92); var Point = __webpack_require__(4); /** @@ -161156,7 +170342,7 @@ module.exports = GetNormal; /***/ }), -/* 1150 */ +/* 1211 */ /***/ (function(module, exports) { /** @@ -161203,7 +170389,7 @@ module.exports = GetShortestDistance; /***/ }), -/* 1151 */ +/* 1212 */ /***/ (function(module, exports) { /** @@ -161231,7 +170417,7 @@ module.exports = Height; /***/ }), -/* 1152 */ +/* 1213 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161241,7 +170427,7 @@ module.exports = Height; */ var MATH_CONST = __webpack_require__(13); -var Angle = __webpack_require__(87); +var Angle = __webpack_require__(92); /** * Returns the x component of the normal vector of the given line. @@ -161262,7 +170448,7 @@ module.exports = NormalX; /***/ }), -/* 1153 */ +/* 1214 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161272,7 +170458,7 @@ module.exports = NormalX; */ var MATH_CONST = __webpack_require__(13); -var Angle = __webpack_require__(87); +var Angle = __webpack_require__(92); /** * The Y value of the normal of the given line. @@ -161294,7 +170480,7 @@ module.exports = NormalY; /***/ }), -/* 1154 */ +/* 1215 */ /***/ (function(module, exports) { /** @@ -161332,7 +170518,7 @@ module.exports = Offset; /***/ }), -/* 1155 */ +/* 1216 */ /***/ (function(module, exports) { /** @@ -161360,7 +170546,7 @@ module.exports = PerpSlope; /***/ }), -/* 1156 */ +/* 1217 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161369,8 +170555,8 @@ module.exports = PerpSlope; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(87); -var NormalAngle = __webpack_require__(462); +var Angle = __webpack_require__(92); +var NormalAngle = __webpack_require__(474); /** * Calculate the reflected angle between two lines. @@ -161394,7 +170580,7 @@ module.exports = ReflectAngle; /***/ }), -/* 1157 */ +/* 1218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161403,7 +170589,7 @@ module.exports = ReflectAngle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(222); +var RotateAroundXY = __webpack_require__(228); /** * Rotate a line around its midpoint by the given angle in radians. @@ -161430,7 +170616,7 @@ module.exports = Rotate; /***/ }), -/* 1158 */ +/* 1219 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161439,7 +170625,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(222); +var RotateAroundXY = __webpack_require__(228); /** * Rotate a line around a point by the given angle in radians. @@ -161464,7 +170650,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1159 */ +/* 1220 */ /***/ (function(module, exports) { /** @@ -161504,7 +170690,7 @@ module.exports = SetToAngle; /***/ }), -/* 1160 */ +/* 1221 */ /***/ (function(module, exports) { /** @@ -161532,7 +170718,7 @@ module.exports = Slope; /***/ }), -/* 1161 */ +/* 1222 */ /***/ (function(module, exports) { /** @@ -161560,7 +170746,334 @@ module.exports = Width; /***/ }), -/* 1162 */ +/* 1223 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Geom.Mesh + */ + +var Mesh = { + + Face: __webpack_require__(111), + GenerateGridVerts: __webpack_require__(1224), + GenerateObjVerts: __webpack_require__(457), + GenerateVerts: __webpack_require__(456), + ParseObj: __webpack_require__(475), + ParseObjMaterial: __webpack_require__(476), + RotateFace: __webpack_require__(1225), + Vertex: __webpack_require__(113) + +}; + +module.exports = Mesh; + + +/***/ }), +/* 1224 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = __webpack_require__(111); +var GetFastValue = __webpack_require__(2); +var Matrix4 = __webpack_require__(73); +var Vector3 = __webpack_require__(37); +var Vertex = __webpack_require__(113); + +var tempPosition = new Vector3(); +var tempRotation = new Vector3(); +var tempMatrix = new Matrix4(); + +/** + * Creates a grid of vertices based on the given configuration object and optionally adds it to a Mesh. + * + * The size of the grid is given in pixels. An example configuration may be: + * + * `{ width: 256, height: 256, widthSegments: 2, heightSegments: 2, tile: true }` + * + * This will create a grid 256 x 256 pixels in size, split into 2 x 2 segments, with + * the texture tiling across the cells. + * + * You can split the grid into segments both vertically and horizontally. This will + * generate two faces per grid segment as a result. + * + * The `tile` parameter allows you to control if the tile will repeat across the grid + * segments, or be displayed in full. + * + * If adding this grid to a Mesh you can offset the grid via the `x` and `y` properties. + * + * UV coordinates are generated based on the given texture and frame in the config. For + * example, no frame is given, the UVs will be in the range 0 to 1. If a frame is given, + * such as from a texture atlas, the UVs will be generated within the range of that frame. + * + * @function Phaser.Geom.Mesh.GeneraterGridVerts + * @since 3.50.0 + * + * @param {Phaser.Types.Geom.Mesh.GenerateGridConfig} config - A Grid configuration object. + * + * @return {Phaser.Types.Geom.Mesh.GenerateGridVertsResult} A Grid Result object, containing the generated vertices and indicies. + */ +var GenerateGridVerts = function (config) +{ + var mesh = GetFastValue(config, 'mesh'); + var texture = GetFastValue(config, 'texture', null); + var frame = GetFastValue(config, 'frame'); + var width = GetFastValue(config, 'width', 1); + var height = GetFastValue(config, 'height', width); + var widthSegments = GetFastValue(config, 'widthSegments', 1); + var heightSegments = GetFastValue(config, 'heightSegments', widthSegments); + var posX = GetFastValue(config, 'x', 0); + var posY = GetFastValue(config, 'y', 0); + var posZ = GetFastValue(config, 'z', 0); + var rotateX = GetFastValue(config, 'rotateX', 0); + var rotateY = GetFastValue(config, 'rotateY', 0); + var rotateZ = GetFastValue(config, 'rotateZ', 0); + var zIsUp = GetFastValue(config, 'zIsUp', true); + var isOrtho = GetFastValue(config, 'isOrtho', (mesh) ? mesh.dirtyCache[11] : false); + var colors = GetFastValue(config, 'colors', [ 0xffffff ]); + var alphas = GetFastValue(config, 'alphas', [ 1 ]); + var tile = GetFastValue(config, 'tile', false); + + var widthSet = GetFastValue(config, 'width', null); + + var result = { + faces: [], + verts: [] + }; + + tempPosition.set(posX, posY, posZ); + tempRotation.set(rotateX, rotateY, rotateZ); + tempMatrix.fromRotationXYTranslation(tempRotation, tempPosition, zIsUp); + + if (!texture && mesh) + { + texture = mesh.texture; + } + else if (mesh && typeof(texture) === 'string') + { + texture = mesh.scene.sys.textures.get(texture); + } + else + { + // There's nothing more we can do without a texture + return result; + } + + var textureFrame = texture.get(frame); + + // If the Mesh is ortho and no width / height is given, we'll default to texture sizes (if set!) + if (!widthSet && isOrtho && texture && mesh) + { + width = textureFrame.width / mesh.height; + height = textureFrame.height / mesh.height; + } + + var halfWidth = width / 2; + var halfHeight = height / 2; + + var gridX = Math.floor(widthSegments); + var gridY = Math.floor(heightSegments); + + var gridX1 = gridX + 1; + var gridY1 = gridY + 1; + + var segmentWidth = width / gridX; + var segmentHeight = height / gridY; + + var uvs = []; + var vertices = []; + + var ix; + var iy; + + var frameU0 = 0; + var frameU1 = 1; + var frameV0 = 0; + var frameV1 = 1; + + if (textureFrame) + { + frameU0 = textureFrame.u0; + frameU1 = textureFrame.u1; + frameV0 = textureFrame.v0; + frameV1 = textureFrame.v1; + } + + var frameU = frameU1 - frameU0; + var frameV = frameV1 - frameV0; + + for (iy = 0; iy < gridY1; iy++) + { + var y = iy * segmentHeight - halfHeight; + + for (ix = 0; ix < gridX1; ix++) + { + var x = ix * segmentWidth - halfWidth; + + vertices.push(x, -y); + + var tu = frameU0 + frameU * (ix / gridX); + var tv = frameV0 + frameV * (iy / gridY); + + uvs.push(tu, tv); + } + } + + if (!Array.isArray(colors)) + { + colors = [ colors ]; + } + + if (!Array.isArray(alphas)) + { + alphas = [ alphas ]; + } + + var alphaIndex = 0; + var colorIndex = 0; + + for (iy = 0; iy < gridY; iy++) + { + for (ix = 0; ix < gridX; ix++) + { + var a = (ix + gridX1 * iy) * 2; + var b = (ix + gridX1 * (iy + 1)) * 2; + var c = ((ix + 1) + gridX1 * (iy + 1)) * 2; + var d = ((ix + 1) + gridX1 * iy) * 2; + + var color = colors[colorIndex]; + var alpha = alphas[alphaIndex]; + + var vert1 = new Vertex(vertices[a], vertices[a + 1], 0, uvs[a], uvs[a + 1], color, alpha).transformMat4(tempMatrix); + var vert2 = new Vertex(vertices[b], vertices[b + 1], 0, uvs[b], uvs[b + 1], color, alpha).transformMat4(tempMatrix); + var vert3 = new Vertex(vertices[d], vertices[d + 1], 0, uvs[d], uvs[d + 1], color, alpha).transformMat4(tempMatrix); + var vert4 = new Vertex(vertices[b], vertices[b + 1], 0, uvs[b], uvs[b + 1], color, alpha).transformMat4(tempMatrix); + var vert5 = new Vertex(vertices[c], vertices[c + 1], 0, uvs[c], uvs[c + 1], color, alpha).transformMat4(tempMatrix); + var vert6 = new Vertex(vertices[d], vertices[d + 1], 0, uvs[d], uvs[d + 1], color, alpha).transformMat4(tempMatrix); + + if (tile) + { + vert1.setUVs(frameU0, frameV1); + vert2.setUVs(frameU0, frameV0); + vert3.setUVs(frameU1, frameV1); + vert4.setUVs(frameU0, frameV0); + vert5.setUVs(frameU1, frameV0); + vert6.setUVs(frameU1, frameV1); + } + + colorIndex++; + + if (colorIndex === colors.length) + { + colorIndex = 0; + } + + alphaIndex++; + + if (alphaIndex === alphas.length) + { + alphaIndex = 0; + } + + result.verts.push(vert1, vert2, vert3, vert4, vert5, vert6); + + result.faces.push( + new Face(vert1, vert2, vert3), + new Face(vert4, vert5, vert6) + ); + } + } + + if (mesh) + { + mesh.faces = mesh.faces.concat(result.faces); + mesh.vertices = mesh.vertices.concat(result.verts); + } + + return result; +}; + +module.exports = GenerateGridVerts; + + +/***/ }), +/* 1225 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotates the vertices of a Face to the given angle. + * + * The actual vertex positions are adjusted, not their transformed positions. + * + * Therefore, this updates the vertex data directly. + * + * @function Phaser.Geom.Mesh.RotateFace + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Face} face - The Face to rotate. + * @param {number} angle - The angle to rotate to, in radians. + * @param {number} [cx] - An optional center of rotation. If not given, the Face in-center is used. + * @param {number} [cy] - An optional center of rotation. If not given, the Face in-center is used. + */ +var RotateFace = function (face, angle, cx, cy) +{ + var x; + var y; + + // No point of rotation? Use the inCenter instead, then. + if (cx === undefined && cy === undefined) + { + var inCenter = face.getInCenter(); + + x = inCenter.x; + y = inCenter.y; + } + + var c = Math.cos(angle); + var s = Math.sin(angle); + + var v1 = face.vertex1; + var v2 = face.vertex2; + var v3 = face.vertex3; + + var tx = v1.x - x; + var ty = v1.y - y; + + v1.set(tx * c - ty * s + x, tx * s + ty * c + y); + + tx = v2.x - x; + ty = v2.y - y; + + v2.set(tx * c - ty * s + x, tx * s + ty * c + y); + + tx = v3.x - x; + ty = v3.y - y; + + v3.set(tx * c - ty * s + x, tx * s + ty * c + y); +}; + +module.exports = RotateFace; + + +/***/ }), +/* 1226 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161571,27 +171084,27 @@ module.exports = Width; var Point = __webpack_require__(4); -Point.Ceil = __webpack_require__(1163); -Point.Clone = __webpack_require__(1164); -Point.CopyFrom = __webpack_require__(1165); -Point.Equals = __webpack_require__(1166); -Point.Floor = __webpack_require__(1167); -Point.GetCentroid = __webpack_require__(1168); -Point.GetMagnitude = __webpack_require__(463); -Point.GetMagnitudeSq = __webpack_require__(464); -Point.GetRectangleFromPoints = __webpack_require__(1169); -Point.Interpolate = __webpack_require__(1170); -Point.Invert = __webpack_require__(1171); -Point.Negative = __webpack_require__(1172); -Point.Project = __webpack_require__(1173); -Point.ProjectUnit = __webpack_require__(1174); -Point.SetMagnitude = __webpack_require__(1175); +Point.Ceil = __webpack_require__(1227); +Point.Clone = __webpack_require__(1228); +Point.CopyFrom = __webpack_require__(1229); +Point.Equals = __webpack_require__(1230); +Point.Floor = __webpack_require__(1231); +Point.GetCentroid = __webpack_require__(1232); +Point.GetMagnitude = __webpack_require__(477); +Point.GetMagnitudeSq = __webpack_require__(478); +Point.GetRectangleFromPoints = __webpack_require__(1233); +Point.Interpolate = __webpack_require__(1234); +Point.Invert = __webpack_require__(1235); +Point.Negative = __webpack_require__(1236); +Point.Project = __webpack_require__(1237); +Point.ProjectUnit = __webpack_require__(1238); +Point.SetMagnitude = __webpack_require__(1239); module.exports = Point; /***/ }), -/* 1163 */ +/* 1227 */ /***/ (function(module, exports) { /** @@ -161621,7 +171134,7 @@ module.exports = Ceil; /***/ }), -/* 1164 */ +/* 1228 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161651,7 +171164,7 @@ module.exports = Clone; /***/ }), -/* 1165 */ +/* 1229 */ /***/ (function(module, exports) { /** @@ -161682,7 +171195,7 @@ module.exports = CopyFrom; /***/ }), -/* 1166 */ +/* 1230 */ /***/ (function(module, exports) { /** @@ -161711,7 +171224,7 @@ module.exports = Equals; /***/ }), -/* 1167 */ +/* 1231 */ /***/ (function(module, exports) { /** @@ -161741,7 +171254,7 @@ module.exports = Floor; /***/ }), -/* 1168 */ +/* 1232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161805,7 +171318,7 @@ module.exports = GetCentroid; /***/ }), -/* 1169 */ +/* 1233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161875,7 +171388,7 @@ module.exports = GetRectangleFromPoints; /***/ }), -/* 1170 */ +/* 1234 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161916,7 +171429,7 @@ module.exports = Interpolate; /***/ }), -/* 1171 */ +/* 1235 */ /***/ (function(module, exports) { /** @@ -161946,7 +171459,7 @@ module.exports = Invert; /***/ }), -/* 1172 */ +/* 1236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161981,7 +171494,7 @@ module.exports = Negative; /***/ }), -/* 1173 */ +/* 1237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161991,7 +171504,7 @@ module.exports = Negative; */ var Point = __webpack_require__(4); -var GetMagnitudeSq = __webpack_require__(464); +var GetMagnitudeSq = __webpack_require__(478); /** * Calculates the vector projection of `pointA` onto the nonzero `pointB`. This is the @@ -162028,7 +171541,7 @@ module.exports = Project; /***/ }), -/* 1174 */ +/* 1238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162073,7 +171586,7 @@ module.exports = ProjectUnit; /***/ }), -/* 1175 */ +/* 1239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162082,7 +171595,7 @@ module.exports = ProjectUnit; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetMagnitude = __webpack_require__(463); +var GetMagnitude = __webpack_require__(477); /** * Changes the magnitude (length) of a two-dimensional vector without changing its direction. @@ -162117,7 +171630,7 @@ module.exports = SetMagnitude; /***/ }), -/* 1176 */ +/* 1240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162126,26 +171639,26 @@ module.exports = SetMagnitude; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(212); +var Polygon = __webpack_require__(218); -Polygon.Clone = __webpack_require__(1177); -Polygon.Contains = __webpack_require__(213); -Polygon.ContainsPoint = __webpack_require__(1178); -Polygon.Earcut = __webpack_require__(60); -Polygon.GetAABB = __webpack_require__(436); -Polygon.GetNumberArray = __webpack_require__(1179); -Polygon.GetPoints = __webpack_require__(437); -Polygon.Perimeter = __webpack_require__(438); -Polygon.Reverse = __webpack_require__(1180); -Polygon.Simplify = __webpack_require__(1181); -Polygon.Smooth = __webpack_require__(439); -Polygon.Translate = __webpack_require__(1182); +Polygon.Clone = __webpack_require__(1241); +Polygon.Contains = __webpack_require__(219); +Polygon.ContainsPoint = __webpack_require__(1242); +Polygon.Earcut = __webpack_require__(65); +Polygon.GetAABB = __webpack_require__(446); +Polygon.GetNumberArray = __webpack_require__(1243); +Polygon.GetPoints = __webpack_require__(447); +Polygon.Perimeter = __webpack_require__(448); +Polygon.Reverse = __webpack_require__(1244); +Polygon.Simplify = __webpack_require__(1245); +Polygon.Smooth = __webpack_require__(449); +Polygon.Translate = __webpack_require__(1246); module.exports = Polygon; /***/ }), -/* 1177 */ +/* 1241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162154,7 +171667,7 @@ module.exports = Polygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(212); +var Polygon = __webpack_require__(218); /** * Create a new polygon which is a copy of the specified polygon @@ -162175,7 +171688,7 @@ module.exports = Clone; /***/ }), -/* 1178 */ +/* 1242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162184,7 +171697,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(213); +var Contains = __webpack_require__(219); /** * Checks the given Point again the Polygon to see if the Point lays within its vertices. @@ -162206,7 +171719,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1179 */ +/* 1243 */ /***/ (function(module, exports) { /** @@ -162249,7 +171762,7 @@ module.exports = GetNumberArray; /***/ }), -/* 1180 */ +/* 1244 */ /***/ (function(module, exports) { /** @@ -162281,10 +171794,9 @@ module.exports = Reverse; /***/ }), -/* 1181 */ -/***/ (function(module, exports, __webpack_require__) { +/* 1245 */ +/***/ (function(module, exports) { -"use strict"; /** * @author Richard Davey * @author Vladimir Agafonkin @@ -162316,8 +171828,6 @@ module.exports = Reverse; * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - - /** * @ignore */ @@ -162491,7 +172001,7 @@ module.exports = Simplify; /***/ }), -/* 1182 */ +/* 1246 */ /***/ (function(module, exports) { /** @@ -162531,7 +172041,7 @@ module.exports = Translate; /***/ }), -/* 1183 */ +/* 1247 */ /***/ (function(module, exports) { /** @@ -162559,7 +172069,7 @@ module.exports = Area; /***/ }), -/* 1184 */ +/* 1248 */ /***/ (function(module, exports) { /** @@ -162592,7 +172102,7 @@ module.exports = Ceil; /***/ }), -/* 1185 */ +/* 1249 */ /***/ (function(module, exports) { /** @@ -162627,7 +172137,7 @@ module.exports = CeilAll; /***/ }), -/* 1186 */ +/* 1250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162657,7 +172167,7 @@ module.exports = Clone; /***/ }), -/* 1187 */ +/* 1251 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162666,7 +172176,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(50); +var Contains = __webpack_require__(56); /** * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. @@ -162688,7 +172198,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1188 */ +/* 1252 */ /***/ (function(module, exports) { /** @@ -162719,7 +172229,7 @@ module.exports = CopyFrom; /***/ }), -/* 1189 */ +/* 1253 */ /***/ (function(module, exports) { /** @@ -162753,7 +172263,7 @@ module.exports = Equals; /***/ }), -/* 1190 */ +/* 1254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162762,7 +172272,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(223); +var GetAspectRatio = __webpack_require__(229); /** * Adjusts the target rectangle, changing its width, height and position, @@ -162806,7 +172316,7 @@ module.exports = FitInside; /***/ }), -/* 1191 */ +/* 1255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162815,7 +172325,7 @@ module.exports = FitInside; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(223); +var GetAspectRatio = __webpack_require__(229); /** * Adjusts the target rectangle, changing its width, height and position, @@ -162859,7 +172369,7 @@ module.exports = FitOutside; /***/ }), -/* 1192 */ +/* 1256 */ /***/ (function(module, exports) { /** @@ -162892,7 +172402,7 @@ module.exports = Floor; /***/ }), -/* 1193 */ +/* 1257 */ /***/ (function(module, exports) { /** @@ -162927,7 +172437,7 @@ module.exports = FloorAll; /***/ }), -/* 1194 */ +/* 1258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162970,7 +172480,7 @@ module.exports = FromXY; /***/ }), -/* 1195 */ +/* 1259 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163008,7 +172518,7 @@ module.exports = GetCenter; /***/ }), -/* 1196 */ +/* 1260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163048,7 +172558,7 @@ module.exports = GetSize; /***/ }), -/* 1197 */ +/* 1261 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163057,7 +172567,7 @@ module.exports = GetSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(178); +var CenterOn = __webpack_require__(182); /** @@ -163090,7 +172600,7 @@ module.exports = Inflate; /***/ }), -/* 1198 */ +/* 1262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163100,7 +172610,7 @@ module.exports = Inflate; */ var Rectangle = __webpack_require__(9); -var Intersects = __webpack_require__(143); +var Intersects = __webpack_require__(112); /** * Takes two Rectangles and first checks to see if they intersect. @@ -163141,7 +172651,7 @@ module.exports = Intersection; /***/ }), -/* 1199 */ +/* 1263 */ /***/ (function(module, exports) { /** @@ -163190,7 +172700,7 @@ module.exports = MergePoints; /***/ }), -/* 1200 */ +/* 1264 */ /***/ (function(module, exports) { /** @@ -163237,7 +172747,7 @@ module.exports = MergeRect; /***/ }), -/* 1201 */ +/* 1265 */ /***/ (function(module, exports) { /** @@ -163281,7 +172791,7 @@ module.exports = MergeXY; /***/ }), -/* 1202 */ +/* 1266 */ /***/ (function(module, exports) { /** @@ -163316,7 +172826,7 @@ module.exports = Offset; /***/ }), -/* 1203 */ +/* 1267 */ /***/ (function(module, exports) { /** @@ -163350,7 +172860,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1204 */ +/* 1268 */ /***/ (function(module, exports) { /** @@ -163384,7 +172894,7 @@ module.exports = Overlaps; /***/ }), -/* 1205 */ +/* 1269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163394,7 +172904,7 @@ module.exports = Overlaps; */ var Point = __webpack_require__(4); -var DegToRad = __webpack_require__(41); +var DegToRad = __webpack_require__(34); /** * Returns a Point from the perimeter of a Rectangle based on the given angle. @@ -163405,7 +172915,7 @@ var DegToRad = __webpack_require__(41); * @generic {Phaser.Geom.Point} O - [out,$return] * * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. - * @param {integer} angle - The angle of the point, in degrees. + * @param {number} angle - The angle of the point, in degrees. * @param {Phaser.Geom.Point} [out] - The Point object to store the position in. If not given, a new Point instance is created. * * @return {Phaser.Geom.Point} A Point object holding the coordinates of the Rectangle perimeter. @@ -163441,7 +172951,7 @@ module.exports = PerimeterPoint; /***/ }), -/* 1206 */ +/* 1270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163450,8 +172960,8 @@ module.exports = PerimeterPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(182); -var ContainsRect = __webpack_require__(466); +var Between = __webpack_require__(187); +var ContainsRect = __webpack_require__(480); var Point = __webpack_require__(4); /** @@ -163512,7 +173022,7 @@ module.exports = RandomOutside; /***/ }), -/* 1207 */ +/* 1271 */ /***/ (function(module, exports) { /** @@ -163541,7 +173051,7 @@ module.exports = SameDimensions; /***/ }), -/* 1208 */ +/* 1272 */ /***/ (function(module, exports) { /** @@ -163580,7 +173090,7 @@ module.exports = Scale; /***/ }), -/* 1209 */ +/* 1273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163589,38 +173099,38 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); -Triangle.Area = __webpack_require__(1210); -Triangle.BuildEquilateral = __webpack_require__(1211); -Triangle.BuildFromPolygon = __webpack_require__(1212); -Triangle.BuildRight = __webpack_require__(1213); -Triangle.CenterOn = __webpack_require__(1214); -Triangle.Centroid = __webpack_require__(467); -Triangle.CircumCenter = __webpack_require__(1215); -Triangle.CircumCircle = __webpack_require__(1216); -Triangle.Clone = __webpack_require__(1217); -Triangle.Contains = __webpack_require__(85); -Triangle.ContainsArray = __webpack_require__(221); -Triangle.ContainsPoint = __webpack_require__(1218); -Triangle.CopyFrom = __webpack_require__(1219); -Triangle.Decompose = __webpack_require__(460); -Triangle.Equals = __webpack_require__(1220); -Triangle.GetPoint = __webpack_require__(443); -Triangle.GetPoints = __webpack_require__(444); -Triangle.InCenter = __webpack_require__(469); -Triangle.Perimeter = __webpack_require__(1221); -Triangle.Offset = __webpack_require__(468); -Triangle.Random = __webpack_require__(168); -Triangle.Rotate = __webpack_require__(1222); -Triangle.RotateAroundPoint = __webpack_require__(1223); -Triangle.RotateAroundXY = __webpack_require__(224); +Triangle.Area = __webpack_require__(1274); +Triangle.BuildEquilateral = __webpack_require__(1275); +Triangle.BuildFromPolygon = __webpack_require__(1276); +Triangle.BuildRight = __webpack_require__(1277); +Triangle.CenterOn = __webpack_require__(1278); +Triangle.Centroid = __webpack_require__(481); +Triangle.CircumCenter = __webpack_require__(1279); +Triangle.CircumCircle = __webpack_require__(1280); +Triangle.Clone = __webpack_require__(1281); +Triangle.Contains = __webpack_require__(110); +Triangle.ContainsArray = __webpack_require__(227); +Triangle.ContainsPoint = __webpack_require__(1282); +Triangle.CopyFrom = __webpack_require__(1283); +Triangle.Decompose = __webpack_require__(472); +Triangle.Equals = __webpack_require__(1284); +Triangle.GetPoint = __webpack_require__(453); +Triangle.GetPoints = __webpack_require__(454); +Triangle.InCenter = __webpack_require__(483); +Triangle.Perimeter = __webpack_require__(1285); +Triangle.Offset = __webpack_require__(482); +Triangle.Random = __webpack_require__(173); +Triangle.Rotate = __webpack_require__(1286); +Triangle.RotateAroundPoint = __webpack_require__(1287); +Triangle.RotateAroundXY = __webpack_require__(230); module.exports = Triangle; /***/ }), -/* 1210 */ +/* 1274 */ /***/ (function(module, exports) { /** @@ -163659,7 +173169,7 @@ module.exports = Area; /***/ }), -/* 1211 */ +/* 1275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163668,7 +173178,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); /** * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). @@ -163703,7 +173213,7 @@ module.exports = BuildEquilateral; /***/ }), -/* 1212 */ +/* 1276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163712,8 +173222,8 @@ module.exports = BuildEquilateral; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var EarCut = __webpack_require__(60); -var Triangle = __webpack_require__(73); +var EarCut = __webpack_require__(65); +var Triangle = __webpack_require__(80); /** * Takes an array of vertex coordinates, and optionally an array of hole indices, then returns an array @@ -163779,7 +173289,7 @@ module.exports = BuildFromPolygon; /***/ }), -/* 1213 */ +/* 1277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163788,7 +173298,7 @@ module.exports = BuildFromPolygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); // Builds a right triangle, with one 90 degree angle and two acute angles // The x/y is the coordinate of the 90 degree angle (and will map to x1/y1 in the resulting Triangle) @@ -163828,7 +173338,7 @@ module.exports = BuildRight; /***/ }), -/* 1214 */ +/* 1278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163837,8 +173347,8 @@ module.exports = BuildRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Centroid = __webpack_require__(467); -var Offset = __webpack_require__(468); +var Centroid = __webpack_require__(481); +var Offset = __webpack_require__(482); /** * @callback CenterFunction @@ -163881,7 +173391,7 @@ module.exports = CenterOn; /***/ }), -/* 1215 */ +/* 1279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163957,7 +173467,7 @@ module.exports = CircumCenter; /***/ }), -/* 1216 */ +/* 1280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163966,7 +173476,7 @@ module.exports = CircumCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); +var Circle = __webpack_require__(71); // Adapted from https://gist.github.com/mutoo/5617691 @@ -164040,7 +173550,7 @@ module.exports = CircumCircle; /***/ }), -/* 1217 */ +/* 1281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164049,7 +173559,7 @@ module.exports = CircumCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); /** * Clones a Triangle object. @@ -164070,7 +173580,7 @@ module.exports = Clone; /***/ }), -/* 1218 */ +/* 1282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164079,7 +173589,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(85); +var Contains = __webpack_require__(110); /** * Tests if a triangle contains a point. @@ -164101,7 +173611,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1219 */ +/* 1283 */ /***/ (function(module, exports) { /** @@ -164132,7 +173642,7 @@ module.exports = CopyFrom; /***/ }), -/* 1220 */ +/* 1284 */ /***/ (function(module, exports) { /** @@ -164168,7 +173678,7 @@ module.exports = Equals; /***/ }), -/* 1221 */ +/* 1285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164177,7 +173687,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); /** * Gets the length of the perimeter of the given triangle. @@ -164203,7 +173713,7 @@ module.exports = Perimeter; /***/ }), -/* 1222 */ +/* 1286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164212,8 +173722,8 @@ module.exports = Perimeter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(224); -var InCenter = __webpack_require__(469); +var RotateAroundXY = __webpack_require__(230); +var InCenter = __webpack_require__(483); /** * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. @@ -164239,7 +173749,7 @@ module.exports = Rotate; /***/ }), -/* 1223 */ +/* 1287 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164248,7 +173758,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(224); +var RotateAroundXY = __webpack_require__(230); /** * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. @@ -164273,7 +173783,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1224 */ +/* 1288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164282,8 +173792,8 @@ module.exports = RotateAroundPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(189); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(194); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Input @@ -164291,17 +173801,17 @@ var Extend = __webpack_require__(19); var Input = { - CreatePixelPerfectHandler: __webpack_require__(470), - CreateInteractiveObject: __webpack_require__(471), - Events: __webpack_require__(56), - Gamepad: __webpack_require__(1225), - InputManager: __webpack_require__(376), - InputPlugin: __webpack_require__(1237), - InputPluginCache: __webpack_require__(144), - Keyboard: __webpack_require__(1238), - Mouse: __webpack_require__(1255), - Pointer: __webpack_require__(379), - Touch: __webpack_require__(1256) + CreatePixelPerfectHandler: __webpack_require__(484), + CreateInteractiveObject: __webpack_require__(485), + Events: __webpack_require__(49), + Gamepad: __webpack_require__(1289), + InputManager: __webpack_require__(386), + InputPlugin: __webpack_require__(1301), + InputPluginCache: __webpack_require__(146), + Keyboard: __webpack_require__(1302), + Mouse: __webpack_require__(1316), + Pointer: __webpack_require__(389), + Touch: __webpack_require__(1317) }; @@ -164312,7 +173822,7 @@ module.exports = Input; /***/ }), -/* 1225 */ +/* 1289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164327,18 +173837,18 @@ module.exports = Input; module.exports = { - Axis: __webpack_require__(472), - Button: __webpack_require__(473), - Events: __webpack_require__(225), - Gamepad: __webpack_require__(474), - GamepadPlugin: __webpack_require__(1232), + Axis: __webpack_require__(486), + Button: __webpack_require__(487), + Events: __webpack_require__(231), + Gamepad: __webpack_require__(488), + GamepadPlugin: __webpack_require__(1296), - Configs: __webpack_require__(1233) + Configs: __webpack_require__(1297) }; /***/ }), -/* 1226 */ +/* 1290 */ /***/ (function(module, exports) { /** @@ -164367,7 +173877,7 @@ module.exports = 'down'; /***/ }), -/* 1227 */ +/* 1291 */ /***/ (function(module, exports) { /** @@ -164396,7 +173906,7 @@ module.exports = 'up'; /***/ }), -/* 1228 */ +/* 1292 */ /***/ (function(module, exports) { /** @@ -164427,7 +173937,7 @@ module.exports = 'connected'; /***/ }), -/* 1229 */ +/* 1293 */ /***/ (function(module, exports) { /** @@ -164453,7 +173963,7 @@ module.exports = 'disconnected'; /***/ }), -/* 1230 */ +/* 1294 */ /***/ (function(module, exports) { /** @@ -164477,7 +173987,7 @@ module.exports = 'disconnected'; * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN * @since 3.10.0 * - * @param {integer} index - The index of the button that was pressed. + * @param {number} index - The index of the button that was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. */ @@ -164485,7 +173995,7 @@ module.exports = 'down'; /***/ }), -/* 1231 */ +/* 1295 */ /***/ (function(module, exports) { /** @@ -164509,7 +174019,7 @@ module.exports = 'down'; * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP * @since 3.10.0 * - * @param {integer} index - The index of the button that was released. + * @param {number} index - The index of the button that was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. */ @@ -164517,7 +174027,7 @@ module.exports = 'up'; /***/ }), -/* 1232 */ +/* 1296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164527,12 +174037,12 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(225); -var Gamepad = __webpack_require__(474); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(231); +var Gamepad = __webpack_require__(488); var GetValue = __webpack_require__(6); -var InputPluginCache = __webpack_require__(144); -var InputEvents = __webpack_require__(56); +var InputPluginCache = __webpack_require__(146); +var InputEvents = __webpack_require__(49); /** * @classdesc @@ -164562,6 +174072,9 @@ var InputEvents = __webpack_require__(56); * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on * the `Gamepad` class for more details. * + * As of September 2020 Chrome, and likely other browsers, will soon start to require that games requesting + * access to the Gamepad API are running under SSL. They will actively block API access if they are not. + * * For more information about Gamepad support in browsers see the following resources: * * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API @@ -164743,6 +174256,8 @@ var GamepadPlugin = new Class({ if (this.enabled) { this.startListeners(); + + this.refreshPads(); } this.sceneInputPlugin.pluginEvents.once(InputEvents.SHUTDOWN, this.shutdown, this); @@ -164814,6 +174329,11 @@ var GamepadPlugin = new Class({ this.target.removeEventListener('gamepaddisconnected', this.onGamepadHandler); this.sceneInputPlugin.pluginEvents.off(InputEvents.UPDATE, this.update); + + for (var i = 0; i < this.gamepads.length; i++) + { + this.gamepads[i].removeAllListeners(); + } }, /** @@ -164826,7 +174346,7 @@ var GamepadPlugin = new Class({ { for (var i = 0; i < this.gamepads.length; i++) { - this.gamepads.connected = false; + this.gamepads[i].pad.connected = false; } }, @@ -165011,8 +174531,6 @@ var GamepadPlugin = new Class({ { this.stopListeners(); - this.disconnectAll(); - this.removeAllListeners(); }, @@ -165047,7 +174565,7 @@ var GamepadPlugin = new Class({ * The total number of connected game pads. * * @name Phaser.Input.Gamepad.GamepadPlugin#total - * @type {integer} + * @type {number} * @since 3.10.0 */ total: { @@ -165155,7 +174673,7 @@ module.exports = GamepadPlugin; /***/ }), -/* 1233 */ +/* 1297 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165170,15 +174688,15 @@ module.exports = GamepadPlugin; module.exports = { - DUALSHOCK_4: __webpack_require__(1234), - SNES_USB: __webpack_require__(1235), - XBOX_360: __webpack_require__(1236) + DUALSHOCK_4: __webpack_require__(1298), + SNES_USB: __webpack_require__(1299), + XBOX_360: __webpack_require__(1300) }; /***/ }), -/* 1234 */ +/* 1298 */ /***/ (function(module, exports) { /** @@ -165228,7 +174746,7 @@ module.exports = { /***/ }), -/* 1235 */ +/* 1299 */ /***/ (function(module, exports) { /** @@ -165267,7 +174785,7 @@ module.exports = { /***/ }), -/* 1236 */ +/* 1300 */ /***/ (function(module, exports) { /** @@ -165318,7 +174836,7 @@ module.exports = { /***/ }), -/* 1237 */ +/* 1301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165327,27 +174845,27 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); -var CircleContains = __webpack_require__(57); +var Circle = __webpack_require__(71); +var CircleContains = __webpack_require__(62); var Class = __webpack_require__(0); -var CONST = __webpack_require__(189); -var CreateInteractiveObject = __webpack_require__(471); -var CreatePixelPerfectHandler = __webpack_require__(470); -var DistanceBetween = __webpack_require__(55); -var Ellipse = __webpack_require__(98); -var EllipseContains = __webpack_require__(99); -var Events = __webpack_require__(56); -var EventEmitter = __webpack_require__(12); +var CONST = __webpack_require__(194); +var CreateInteractiveObject = __webpack_require__(485); +var CreatePixelPerfectHandler = __webpack_require__(484); +var DistanceBetween = __webpack_require__(61); +var Ellipse = __webpack_require__(106); +var EllipseContains = __webpack_require__(107); +var Events = __webpack_require__(49); +var EventEmitter = __webpack_require__(10); var GetFastValue = __webpack_require__(2); -var GEOM_CONST = __webpack_require__(49); -var InputPluginCache = __webpack_require__(144); +var GEOM_CONST = __webpack_require__(55); +var InputPluginCache = __webpack_require__(146); var IsPlainObject = __webpack_require__(7); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(50); +var RectangleContains = __webpack_require__(56); var SceneEvents = __webpack_require__(20); -var Triangle = __webpack_require__(73); -var TriangleContains = __webpack_require__(85); +var Triangle = __webpack_require__(80); +var TriangleContains = __webpack_require__(110); /** * @classdesc @@ -165523,7 +175041,7 @@ var InputPlugin = new Class({ * Set to 0 to poll constantly. Set to -1 to only poll on user movement. * * @name Phaser.Input.InputPlugin#pollRate - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -165673,7 +175191,7 @@ var InputPlugin = new Class({ * A array containing the dragStates, for this Scene, index by the Pointer ID. * * @name Phaser.Input.InputPlugin#_dragState - * @type {integer[]} + * @type {number[]} * @private * @since 3.16.0 */ @@ -165990,7 +175508,7 @@ var InputPlugin = new Class({ * @fires Phaser.Input.Events#UPDATE * @since 3.0.0 * - * @param {integer} type - The type of event to process. + * @param {number} type - The type of event to process. * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. * * @return {boolean} `true` if this Scene has captured the input events from all other Scenes, otherwise `false`. @@ -166119,8 +175637,6 @@ var InputPlugin = new Class({ input.hitAreaCallback = undefined; input.callbackContext = undefined; - this.manager.resetCursor(input); - gameObject.input = null; // Clear from _draggable, _drag and _over @@ -166143,6 +175659,8 @@ var InputPlugin = new Class({ if (index > -1) { this._over[0].splice(index, 1); + + this.manager.resetCursor(input); } return gameObject; @@ -166280,7 +175798,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer being tested. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processDownEvents: function (pointer) { @@ -166356,7 +175874,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to get the drag state for. * - * @return {integer} The drag state of the given Pointer. + * @return {number} The drag state of the given Pointer. */ getDragState: function (pointer) { @@ -166379,7 +175897,7 @@ var InputPlugin = new Class({ * @since 3.16.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer to set the drag state for. - * @param {integer} state - The drag state value. An integer between 0 and 5. + * @param {number} state - The drag state value. An integer between 0 and 5. */ setDragState: function (pointer, state) { @@ -166433,7 +175951,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that DRAG_START was called on. + * @return {number} The number of items that DRAG_START was called on. */ processDragStartList: function (pointer) { @@ -166482,7 +176000,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were collected on the drag list. + * @return {number} The number of items that were collected on the drag list. */ processDragDownEvent: function (pointer) { @@ -166562,7 +176080,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were updated by this drag event. + * @return {number} The number of items that were updated by this drag event. */ processDragMoveEvent: function (pointer) { @@ -166702,7 +176220,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were updated by this drag event. + * @return {number} The number of items that were updated by this drag event. */ processDragUpEvent: function (pointer) { @@ -166767,7 +176285,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processMoveEvents: function (pointer) { @@ -166835,7 +176353,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processWheelEvent: function (pointer) { @@ -166903,7 +176421,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOverEvents: function (pointer) { @@ -166983,7 +176501,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOutEvents: function (pointer) { @@ -167011,34 +176529,31 @@ var InputPlugin = new Class({ var gameObject = previouslyOver[i]; // Call onOut for everything in the previouslyOver array - for (i = 0; i < total; i++) + gameObject = previouslyOver[i]; + + if (!gameObject.input) { - gameObject = previouslyOver[i]; + continue; + } - if (!gameObject.input) - { - continue; - } + manager.resetCursor(gameObject.input); - manager.resetCursor(gameObject.input); + gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); - gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); + totalInteracted++; - totalInteracted++; + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } - if (_eventData.cancelled || !gameObject.input) - { - aborted = true; - break; - } + this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); - this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); - - if (_eventData.cancelled || !gameObject.input) - { - aborted = true; - break; - } + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; } if (!aborted) @@ -167068,7 +176583,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOverOutEvents: function (pointer) { @@ -167244,7 +176759,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processUpEvents: function (pointer) { @@ -167413,7 +176928,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#makePixelPerfect * @since 3.10.0 * - * @param {integer} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction. + * @param {number} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction. * * @return {function} A Pixel Perfect Handler for use as a hitArea shape callback. */ @@ -167983,7 +177498,7 @@ var InputPlugin = new Class({ * @param {Phaser.GameObjects.GameObject} childA - The first Game Object to compare. * @param {Phaser.GameObjects.GameObject} childB - The second Game Object to compare. * - * @return {integer} Returns either a negative or positive integer, or zero if they match. + * @return {number} Returns either a negative or positive integer, or zero if they match. */ sortHandlerGO: function (childA, childB) { @@ -168071,7 +177586,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#addPointer * @since 3.10.0 * - * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * @param {number} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. * * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. */ @@ -168182,6 +177697,10 @@ var InputPlugin = new Class({ this.removeAllListeners(); + var manager = this.manager; + + manager.canvas.style.cursor = manager.defaultCursor; + var eventEmitter = this.systems.events; eventEmitter.off(SceneEvents.TRANSITION_START, this.transitionIn, this); @@ -168189,8 +177708,8 @@ var InputPlugin = new Class({ eventEmitter.off(SceneEvents.TRANSITION_COMPLETE, this.transitionComplete, this); eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); - this.manager.events.off(Events.GAME_OUT, this.onGameOut, this); - this.manager.events.off(Events.GAME_OVER, this.onGameOver, this); + manager.events.off(Events.GAME_OUT, this.onGameOut, this); + manager.events.off(Events.GAME_OVER, this.onGameOver, this); eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -168499,7 +178018,7 @@ module.exports = InputPlugin; /***/ }), -/* 1238 */ +/* 1302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168514,26 +178033,30 @@ module.exports = InputPlugin; module.exports = { - Events: __webpack_require__(145), + Events: __webpack_require__(147), - KeyboardManager: __webpack_require__(377), - KeyboardPlugin: __webpack_require__(1246), + KeyboardManager: __webpack_require__(387), + KeyboardPlugin: __webpack_require__(1310), - Key: __webpack_require__(475), - KeyCodes: __webpack_require__(132), + Key: __webpack_require__(489), + KeyCodes: __webpack_require__(138), - KeyCombo: __webpack_require__(476), + KeyCombo: __webpack_require__(490), + + AdvanceKeyCombo: __webpack_require__(492), + ProcessKeyCombo: __webpack_require__(491), + ResetKeyCombo: __webpack_require__(493), + + JustDown: __webpack_require__(1312), + JustUp: __webpack_require__(1313), + DownDuration: __webpack_require__(1314), + UpDuration: __webpack_require__(1315) - JustDown: __webpack_require__(1251), - JustUp: __webpack_require__(1252), - DownDuration: __webpack_require__(1253), - UpDuration: __webpack_require__(1254) - }; /***/ }), -/* 1239 */ +/* 1303 */ /***/ (function(module, exports) { /** @@ -168569,7 +178092,7 @@ module.exports = 'keydown'; /***/ }), -/* 1240 */ +/* 1304 */ /***/ (function(module, exports) { /** @@ -168598,7 +178121,7 @@ module.exports = 'keyup'; /***/ }), -/* 1241 */ +/* 1305 */ /***/ (function(module, exports) { /** @@ -168632,7 +178155,7 @@ module.exports = 'keycombomatch'; /***/ }), -/* 1242 */ +/* 1306 */ /***/ (function(module, exports) { /** @@ -168666,7 +178189,7 @@ module.exports = 'down'; /***/ }), -/* 1243 */ +/* 1307 */ /***/ (function(module, exports) { /** @@ -168705,7 +178228,7 @@ module.exports = 'keydown-'; /***/ }), -/* 1244 */ +/* 1308 */ /***/ (function(module, exports) { /** @@ -168737,7 +178260,7 @@ module.exports = 'keyup-'; /***/ }), -/* 1245 */ +/* 1309 */ /***/ (function(module, exports) { /** @@ -168771,7 +178294,7 @@ module.exports = 'up'; /***/ }), -/* 1246 */ +/* 1310 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168781,18 +178304,18 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(145); -var GameEvents = __webpack_require__(21); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(147); +var GameEvents = __webpack_require__(23); var GetValue = __webpack_require__(6); -var InputEvents = __webpack_require__(56); -var InputPluginCache = __webpack_require__(144); -var Key = __webpack_require__(475); -var KeyCodes = __webpack_require__(132); -var KeyCombo = __webpack_require__(476); -var KeyMap = __webpack_require__(1250); +var InputEvents = __webpack_require__(49); +var InputPluginCache = __webpack_require__(146); +var Key = __webpack_require__(489); +var KeyCodes = __webpack_require__(138); +var KeyCombo = __webpack_require__(490); +var KeyMap = __webpack_require__(1311); var SceneEvents = __webpack_require__(20); -var SnapFloor = __webpack_require__(95); +var SnapFloor = __webpack_require__(72); /** * @classdesc @@ -169040,7 +178563,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#addCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable event capture for. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to enable event capture for. * * @return {this} This KeyboardPlugin object. */ @@ -169082,7 +178605,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable event capture for. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to disable event capture for. * * @return {this} This KeyboardPlugin object. */ @@ -169099,7 +178622,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#getCaptures * @since 3.16.0 * - * @return {integer[]} An array of all the currently capturing key codes. + * @return {number[]} An array of all the currently capturing key codes. */ getCaptures: function () { @@ -169247,7 +178770,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#addKey * @since 3.10.0 * - * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [enableCapture=true] - Automatically call `preventDefault` on the native DOM browser event for the key codes being added. * @param {boolean} [emitOnRepeat=false] - Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). * @@ -169311,7 +178834,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeKey * @since 3.10.0 * - * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object? * * @return {this} This KeyboardPlugin object. @@ -169423,7 +178946,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#createCombo * @since 3.10.0 * - * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {(string|number[]|object[])} keys - The keys that comprise this combo. * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. * * @return {Phaser.Input.Keyboard.KeyCombo} The new KeyCombo object. @@ -169706,7 +179229,7 @@ module.exports = KeyboardPlugin; /***/ }), -/* 1247 */ +/* 1311 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169715,165 +179238,7 @@ module.exports = KeyboardPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AdvanceKeyCombo = __webpack_require__(1248); - -/** - * Used internally by the KeyCombo class. - * - * @function Phaser.Input.Keyboard.KeyCombo.ProcessKeyCombo - * @private - * @since 3.0.0 - * - * @param {KeyboardEvent} event - The native Keyboard Event. - * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to be processed. - * - * @return {boolean} `true` if the combo was matched, otherwise `false`. - */ -var ProcessKeyCombo = function (event, combo) -{ - if (combo.matched) - { - return true; - } - - var comboMatched = false; - var keyMatched = false; - - if (event.keyCode === combo.current) - { - // Key was correct - - if (combo.index > 0 && combo.maxKeyDelay > 0) - { - // We have to check to see if the delay between - // the new key and the old one was too long (if enabled) - - var timeLimit = combo.timeLastMatched + combo.maxKeyDelay; - - // Check if they pressed it in time or not - if (event.timeStamp <= timeLimit) - { - keyMatched = true; - comboMatched = AdvanceKeyCombo(event, combo); - } - } - else - { - keyMatched = true; - - // We don't check the time for the first key pressed, so just advance it - comboMatched = AdvanceKeyCombo(event, combo); - } - } - - if (!keyMatched && combo.resetOnWrongKey) - { - // Wrong key was pressed - combo.index = 0; - combo.current = combo.keyCodes[0]; - } - - if (comboMatched) - { - combo.timeLastMatched = event.timeStamp; - combo.matched = true; - combo.timeMatched = event.timeStamp; - } - - return comboMatched; -}; - -module.exports = ProcessKeyCombo; - - -/***/ }), -/* 1248 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Used internally by the KeyCombo class. - * Return `true` if it reached the end of the combo, `false` if not. - * - * @function Phaser.Input.Keyboard.KeyCombo.AdvanceKeyCombo - * @private - * @since 3.0.0 - * - * @param {KeyboardEvent} event - The native Keyboard Event. - * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to advance. - * - * @return {boolean} `true` if it reached the end of the combo, `false` if not. - */ -var AdvanceKeyCombo = function (event, combo) -{ - combo.timeLastMatched = event.timeStamp; - combo.index++; - - if (combo.index === combo.size) - { - return true; - } - else - { - combo.current = combo.keyCodes[combo.index]; - return false; - } -}; - -module.exports = AdvanceKeyCombo; - - -/***/ }), -/* 1249 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Used internally by the KeyCombo class. - * - * @function Phaser.Input.Keyboard.KeyCombo.ResetKeyCombo - * @private - * @since 3.0.0 - * - * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo to reset. - * - * @return {Phaser.Input.Keyboard.KeyCombo} The KeyCombo. - */ -var ResetKeyCombo = function (combo) -{ - combo.current = combo.keyCodes[0]; - combo.index = 0; - combo.timeLastMatched = 0; - combo.matched = false; - combo.timeMatched = 0; - - return combo; -}; - -module.exports = ResetKeyCombo; - - -/***/ }), -/* 1250 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var KeyCodes = __webpack_require__(132); +var KeyCodes = __webpack_require__(138); var KeyMap = {}; @@ -169886,7 +179251,7 @@ module.exports = KeyMap; /***/ }), -/* 1251 */ +/* 1312 */ /***/ (function(module, exports) { /** @@ -169928,7 +179293,7 @@ module.exports = JustDown; /***/ }), -/* 1252 */ +/* 1313 */ /***/ (function(module, exports) { /** @@ -169970,7 +179335,7 @@ module.exports = JustUp; /***/ }), -/* 1253 */ +/* 1314 */ /***/ (function(module, exports) { /** @@ -169987,7 +179352,7 @@ module.exports = JustUp; * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. - * @param {integer} [duration=50] - The duration, in ms, within which the key must have been pressed down. + * @param {number} [duration=50] - The duration, in ms, within which the key must have been pressed down. * * @return {boolean} `true` if the Key was pressed down within `duration` ms ago, otherwise `false`. */ @@ -170004,7 +179369,7 @@ module.exports = DownDuration; /***/ }), -/* 1254 */ +/* 1315 */ /***/ (function(module, exports) { /** @@ -170021,7 +179386,7 @@ module.exports = DownDuration; * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. - * @param {integer} [duration=50] - The duration, in ms, within which the key must have been released. + * @param {number} [duration=50] - The duration, in ms, within which the key must have been released. * * @return {boolean} `true` if the Key was released within `duration` ms ago, otherwise `false`. */ @@ -170038,7 +179403,7 @@ module.exports = UpDuration; /***/ }), -/* 1255 */ +/* 1316 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170054,14 +179419,14 @@ module.exports = UpDuration; /* eslint-disable */ module.exports = { - MouseManager: __webpack_require__(378) + MouseManager: __webpack_require__(388) }; /* eslint-enable */ /***/ }), -/* 1256 */ +/* 1317 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170077,14 +179442,14 @@ module.exports = { /* eslint-disable */ module.exports = { - TouchManager: __webpack_require__(380) + TouchManager: __webpack_require__(390) }; /* eslint-enable */ /***/ }), -/* 1257 */ +/* 1318 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170093,8 +179458,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(18); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(19); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Loader @@ -170102,18 +179467,18 @@ var Extend = __webpack_require__(19); var Loader = { - Events: __webpack_require__(84), + Events: __webpack_require__(89), - FileTypes: __webpack_require__(1258), + FileTypes: __webpack_require__(1319), File: __webpack_require__(22), FileTypesManager: __webpack_require__(8), - GetURL: __webpack_require__(146), - LoaderPlugin: __webpack_require__(1282), - MergeXHRSettings: __webpack_require__(226), - MultiFile: __webpack_require__(63), - XHRLoader: __webpack_require__(477), - XHRSettings: __webpack_require__(147) + GetURL: __webpack_require__(148), + LoaderPlugin: __webpack_require__(1345), + MergeXHRSettings: __webpack_require__(232), + MultiFile: __webpack_require__(47), + XHRLoader: __webpack_require__(494), + XHRSettings: __webpack_require__(149) }; @@ -170124,7 +179489,7 @@ module.exports = Loader; /***/ }), -/* 1258 */ +/* 1319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170139,42 +179504,44 @@ module.exports = Loader; module.exports = { - AnimationJSONFile: __webpack_require__(1259), - AtlasJSONFile: __webpack_require__(1260), - AtlasXMLFile: __webpack_require__(1261), - AudioFile: __webpack_require__(478), - AudioSpriteFile: __webpack_require__(1262), - BinaryFile: __webpack_require__(1263), - BitmapFontFile: __webpack_require__(1264), - CSSFile: __webpack_require__(1265), - GLSLFile: __webpack_require__(1266), - HTML5AudioFile: __webpack_require__(479), - HTMLFile: __webpack_require__(1267), - HTMLTextureFile: __webpack_require__(1268), - ImageFile: __webpack_require__(74), - JSONFile: __webpack_require__(62), - MultiAtlasFile: __webpack_require__(1269), - MultiScriptFile: __webpack_require__(1270), - PackFile: __webpack_require__(1271), - PluginFile: __webpack_require__(1272), - SceneFile: __webpack_require__(1273), - ScenePluginFile: __webpack_require__(1274), - ScriptFile: __webpack_require__(480), - SpriteSheetFile: __webpack_require__(1275), - SVGFile: __webpack_require__(1276), - TextFile: __webpack_require__(481), - TilemapCSVFile: __webpack_require__(1277), - TilemapImpactFile: __webpack_require__(1278), - TilemapJSONFile: __webpack_require__(1279), - UnityAtlasFile: __webpack_require__(1280), - VideoFile: __webpack_require__(1281), - XMLFile: __webpack_require__(227) + AnimationJSONFile: __webpack_require__(1320), + AsepriteFile: __webpack_require__(1321), + AtlasJSONFile: __webpack_require__(1322), + AtlasXMLFile: __webpack_require__(1323), + AudioFile: __webpack_require__(495), + AudioSpriteFile: __webpack_require__(1324), + BinaryFile: __webpack_require__(1325), + BitmapFontFile: __webpack_require__(1326), + CSSFile: __webpack_require__(1327), + GLSLFile: __webpack_require__(1328), + HTML5AudioFile: __webpack_require__(496), + HTMLFile: __webpack_require__(1329), + HTMLTextureFile: __webpack_require__(1330), + ImageFile: __webpack_require__(67), + JSONFile: __webpack_require__(58), + MultiAtlasFile: __webpack_require__(1331), + MultiScriptFile: __webpack_require__(1332), + OBJFile: __webpack_require__(1333), + PackFile: __webpack_require__(1334), + PluginFile: __webpack_require__(1335), + SceneFile: __webpack_require__(1336), + ScenePluginFile: __webpack_require__(1337), + ScriptFile: __webpack_require__(497), + SpriteSheetFile: __webpack_require__(1338), + SVGFile: __webpack_require__(1339), + TextFile: __webpack_require__(234), + TilemapCSVFile: __webpack_require__(1340), + TilemapImpactFile: __webpack_require__(1341), + TilemapJSONFile: __webpack_require__(1342), + UnityAtlasFile: __webpack_require__(1343), + VideoFile: __webpack_require__(1344), + XMLFile: __webpack_require__(233) }; /***/ }), -/* 1259 */ +/* 1320 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170185,8 +179552,8 @@ module.exports = { var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); -var LoaderEvents = __webpack_require__(84); +var JSONFile = __webpack_require__(58); +var LoaderEvents = __webpack_require__(89); /** * @classdesc @@ -170375,7 +179742,7 @@ module.exports = AnimationJSONFile; /***/ }), -/* 1260 */ +/* 1321 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170387,10 +179754,280 @@ module.exports = AnimationJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(62); -var MultiFile = __webpack_require__(63); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); + +/** + * @classdesc + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + * + * @class AsepriteFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AsepriteFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {object|string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ +var AsepriteFile = new Class({ + + Extends: MultiFile, + + initialize: + + function AsepriteFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) + { + var image; + var data; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + image = new ImageFile(loader, { + key: key, + url: GetFastValue(config, 'textureURL'), + extension: GetFastValue(config, 'textureExtension', 'png'), + normalMap: GetFastValue(config, 'normalMap'), + xhrSettings: GetFastValue(config, 'textureXhrSettings') + }); + + data = new JSONFile(loader, { + key: key, + url: GetFastValue(config, 'atlasURL'), + extension: GetFastValue(config, 'atlasExtension', 'json'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + } + else + { + image = new ImageFile(loader, key, textureURL, textureXhrSettings); + data = new JSONFile(loader, key, atlasURL, atlasXhrSettings); + } + + if (image.linkFile) + { + // Image has a normal map + MultiFile.call(this, loader, 'atlasjson', key, [ image, data, image.linkFile ]); + } + else + { + MultiFile.call(this, loader, 'atlasjson', key, [ image, data ]); + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.AsepriteFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var image = this.files[0]; + var json = this.files[1]; + var normalMap = (this.files[2]) ? this.files[2].data : null; + + this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); + + json.addToCache(); + + this.complete = true; + } + } + +}); + +/** + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * Adds a JSON based Aseprite Animation, or array of animations, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.aseprite('gladiator', 'images/Gladiator.png', 'images/Gladiator.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.aseprite({ + * key: 'gladiator', + * textureURL: 'images/Gladiator.png', + * atlasURL: 'images/Gladiator.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AsepriteFileConfig` for more details. + * + * Instead of passing a URL for the JSON data you can also pass in a well formed JSON object instead. + * + * Once loaded, you can call this method from within a Scene with the 'atlas' key: + * + * ```javascript + * this.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use in Phaser and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it in Phaser using that Tag name: + * + * ```javascript + * this.add.sprite(400, 300).play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * this.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Aseprite File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#aseprite + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.50.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.AsepriteFileConfig|Phaser.Types.Loader.FileTypes.AsepriteFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {object|string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('aseprite', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new AsepriteFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new AsepriteFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = AsepriteFile; + + +/***/ }), +/* 1322 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var ImageFile = __webpack_require__(67); +var IsPlainObject = __webpack_require__(7); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); /** * @classdesc @@ -170480,8 +180117,6 @@ var AtlasJSONFile = new Class({ this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); - json.addToCache(); - this.complete = true; } } @@ -170624,7 +180259,7 @@ module.exports = AtlasJSONFile; /***/ }), -/* 1261 */ +/* 1323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170636,10 +180271,10 @@ module.exports = AtlasJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var XMLFile = __webpack_require__(227); +var MultiFile = __webpack_require__(47); +var XMLFile = __webpack_require__(233); /** * @classdesc @@ -170727,8 +180362,6 @@ var AtlasXMLFile = new Class({ this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap); - xml.addToCache(); - this.complete = true; } } @@ -170867,7 +180500,7 @@ module.exports = AtlasXMLFile; /***/ }), -/* 1262 */ +/* 1324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170876,13 +180509,13 @@ module.exports = AtlasXMLFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AudioFile = __webpack_require__(478); +var AudioFile = __webpack_require__(495); var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(62); -var MultiFile = __webpack_require__(63); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); /** * @classdesc @@ -171157,7 +180790,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /***/ }), -/* 1263 */ +/* 1325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171167,7 +180800,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -171339,7 +180972,7 @@ module.exports = BinaryFile; /***/ }), -/* 1264 */ +/* 1326 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171351,11 +180984,11 @@ module.exports = BinaryFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var ParseXMLBitmapFont = __webpack_require__(198); -var XMLFile = __webpack_require__(227); +var MultiFile = __webpack_require__(47); +var ParseXMLBitmapFont = __webpack_require__(203); +var XMLFile = __webpack_require__(233); /** * @classdesc @@ -171441,7 +181074,6 @@ var BitmapFontFile = new Class({ var xml = this.files[1]; image.addToCache(); - xml.addToCache(); var texture = image.cache.get(image.key); @@ -171586,7 +181218,7 @@ module.exports = BitmapFontFile; /***/ }), -/* 1265 */ +/* 1327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171596,7 +181228,7 @@ module.exports = BitmapFontFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -171754,7 +181386,7 @@ module.exports = CSSFile; /***/ }), -/* 1266 */ +/* 1328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -171764,12 +181396,12 @@ module.exports = CSSFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var Shader = __webpack_require__(363); +var Shader = __webpack_require__(372); /** * @classdesc @@ -172012,7 +181644,7 @@ var GLSLFile = new Class({ * @since 3.17.0 * * @param {string[]} data - The array of shader data to process. - * @param {integer} offset - The offset to start processing from. + * @param {number} offset - The offset to start processing from. * * @return {any} The processed shader block, or null. */ @@ -172165,7 +181797,7 @@ module.exports = GLSLFile; /***/ }), -/* 1267 */ +/* 1329 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172175,7 +181807,7 @@ module.exports = GLSLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -172197,7 +181829,7 @@ var IsPlainObject = __webpack_require__(7); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var HTMLFile = new Class({ @@ -172340,7 +181972,7 @@ module.exports = HTMLFile; /***/ }), -/* 1268 */ +/* 1330 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172350,7 +181982,7 @@ module.exports = HTMLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -172373,8 +182005,8 @@ var IsPlainObject = __webpack_require__(7); * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig)} key - The key to use for this file, or a file configuration object. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {integer} [width] - The width of the texture the HTML will be rendered to. - * @param {integer} [height] - The height of the texture the HTML will be rendered to. + * @param {number} [width] - The width of the texture the HTML will be rendered to. + * @param {number} [height] - The height of the texture the HTML will be rendered to. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var HTMLTextureFile = new Class({ @@ -172570,8 +182202,8 @@ var HTMLTextureFile = new Class({ * * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". - * @param {integer} [width=512] - The width of the texture the HTML will be rendered to. - * @param {integer} [height=512] - The height of the texture the HTML will be rendered to. + * @param {number} [width=512] - The width of the texture the HTML will be rendered to. + * @param {number} [height=512] - The height of the texture the HTML will be rendered to. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. @@ -172598,7 +182230,7 @@ module.exports = HTMLTextureFile; /***/ }), -/* 1269 */ +/* 1331 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172610,10 +182242,10 @@ module.exports = HTMLTextureFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(62); -var MultiFile = __webpack_require__(63); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); /** * @classdesc @@ -172931,7 +182563,7 @@ module.exports = MultiAtlasFile; /***/ }), -/* 1270 */ +/* 1332 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -172944,8 +182576,8 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var ScriptFile = __webpack_require__(480); +var MultiFile = __webpack_require__(47); +var ScriptFile = __webpack_require__(497); /** * @classdesc @@ -173148,7 +182780,7 @@ module.exports = MultiScriptFile; /***/ }), -/* 1271 */ +/* 1333 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173158,9 +182790,263 @@ module.exports = MultiScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); +var MultiFile = __webpack_require__(47); +var ParseObj = __webpack_require__(475); +var ParseObjMaterial = __webpack_require__(476); +var TextFile = __webpack_require__(234); + +/** + * @classdesc + * A single Wavefront OBJ File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#obj method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj. + * + * @class OBJFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param {string} [matURL] - The absolute or relative URL to load the material file from. If undefined or `null` it will be set to `.mat`, i.e. if `key` was "alien" then the URL will be "alien.mat". + * @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data? + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for these files. + */ +var OBJFile = new Class({ + + Extends: MultiFile, + + initialize: + + function OBJFile (loader, key, objURL, matURL, flipUV, xhrSettings) + { + var obj; + var mat; + + var cache = loader.cacheManager.obj; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + obj = new TextFile(loader, { + key: key, + type: 'obj', + cache: cache, + url: GetFastValue(config, 'url'), + extension: GetFastValue(config, 'extension', 'obj'), + xhrSettings: GetFastValue(config, 'xhrSettings'), + config: { + flipUV: GetFastValue(config, 'flipUV', flipUV) + } + }); + + matURL = GetFastValue(config, 'matURL'); + + if (matURL) + { + mat = new TextFile(loader, { + key: key, + type: 'mat', + cache: cache, + url: matURL, + extension: GetFastValue(config, 'matExtension', 'mat'), + xhrSettings: GetFastValue(config, 'xhrSettings') + }); + } + } + else + { + obj = new TextFile(loader, { + key: key, + url: objURL, + type: 'obj', + cache: cache, + extension: 'obj', + xhrSettings: xhrSettings, + config: { + flipUV: flipUV + } + }); + + if (matURL) + { + mat = new TextFile(loader, { + key: key, + url: matURL, + type: 'mat', + cache: cache, + extension: 'mat', + xhrSettings: xhrSettings + }); + } + } + + MultiFile.call(this, loader, 'obj', key, [ obj, mat ]); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.OBJFile#addToCache + * @since 3.50.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var obj = this.files[0]; + var mat = this.files[1]; + + var objData = ParseObj(obj.data, obj.config.flipUV); + + if (mat) + { + objData.materials = ParseObjMaterial(mat.data); + } + + obj.cache.add(obj.key, objData); + + this.complete = true; + } + } + +}); + +/** + * Adds a Wavefront OBJ file, or array of OBJ files, to the current load queue. + * + * Note: You should ensure your 3D package has triangulated the OBJ file prior to export. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.obj('ufo', 'files/spaceship.obj'); + * } + * ``` + * + * You can optionally also load a Wavefront Material file as well, by providing the 3rd parameter: + * + * ```javascript + * function preload () + * { + * this.load.obj('ufo', 'files/spaceship.obj', 'files/spaceship.mtl'); + * } + * ``` + * + * If given, the material will be parsed and stored along with the obj data in the cache. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global OBJ Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the OBJ Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the OBJ Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.obj({ + * key: 'ufo', + * url: 'files/spaceship.obj', + * matURL: 'files/spaceship.mtl', + * flipUV: true + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.OBJFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.obj('ufo', 'files/spaceship.obj'); + * // and later in your game ... + * var data = this.cache.obj.get('ufo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the obj from the OBJ Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.obj". It will always add `.obj` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the OBJ File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#obj + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.50.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig|Phaser.Types.Loader.FileTypes.OBJFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param {string} [matURL] - Optional absolute or relative URL to load the obj material file from. + * @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data? + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('obj', function (key, objURL, matURL, flipUVs, xhrSettings) +{ + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new OBJFile(this, key[i]); + + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(multifile.files); + } + } + else + { + multifile = new OBJFile(this, key, objURL, matURL, flipUVs, xhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = OBJFile; + + +/***/ }), +/* 1334 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(19); +var FileTypesManager = __webpack_require__(8); +var JSONFile = __webpack_require__(58); /** * @classdesc @@ -173366,7 +183252,7 @@ module.exports = PackFile; /***/ }), -/* 1272 */ +/* 1335 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173376,7 +183262,7 @@ module.exports = PackFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -173578,7 +183464,7 @@ module.exports = PluginFile; /***/ }), -/* 1273 */ +/* 1336 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173588,7 +183474,7 @@ module.exports = PluginFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -173635,7 +183521,6 @@ var SceneFile = new Class({ var fileConfig = { type: 'text', - cache: loader.cacheManager.text, extension: extension, responseType: 'text', key: key, @@ -173799,7 +183684,7 @@ module.exports = SceneFile; /***/ }), -/* 1274 */ +/* 1337 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173809,7 +183694,7 @@ module.exports = SceneFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -174005,7 +183890,7 @@ module.exports = ScenePluginFile; /***/ }), -/* 1275 */ +/* 1338 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174016,7 +183901,7 @@ module.exports = ScenePluginFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); /** * @classdesc @@ -174196,7 +184081,7 @@ module.exports = SpriteSheetFile; /***/ }), -/* 1276 */ +/* 1339 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174206,7 +184091,7 @@ module.exports = SpriteSheetFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -174535,7 +184420,7 @@ module.exports = SVGFile; /***/ }), -/* 1277 */ +/* 1340 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174545,12 +184430,12 @@ module.exports = SVGFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var TILEMAP_FORMATS = __webpack_require__(33); +var TILEMAP_FORMATS = __webpack_require__(38); /** * @classdesc @@ -174730,7 +184615,7 @@ module.exports = TilemapCSVFile; /***/ }), -/* 1278 */ +/* 1341 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174741,8 +184626,8 @@ module.exports = TilemapCSVFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); -var TILEMAP_FORMATS = __webpack_require__(33); +var JSONFile = __webpack_require__(58); +var TILEMAP_FORMATS = __webpack_require__(38); /** * @classdesc @@ -174886,7 +184771,7 @@ module.exports = TilemapImpactFile; /***/ }), -/* 1279 */ +/* 1342 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174897,8 +184782,8 @@ module.exports = TilemapImpactFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); -var TILEMAP_FORMATS = __webpack_require__(33); +var JSONFile = __webpack_require__(58); +var TILEMAP_FORMATS = __webpack_require__(38); /** * @classdesc @@ -175042,7 +184927,7 @@ module.exports = TilemapJSONFile; /***/ }), -/* 1280 */ +/* 1343 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175054,10 +184939,10 @@ module.exports = TilemapJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var TextFile = __webpack_require__(481); +var MultiFile = __webpack_require__(47); +var TextFile = __webpack_require__(234); /** * @classdesc @@ -175145,8 +185030,6 @@ var UnityAtlasFile = new Class({ this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap); - text.addToCache(); - this.complete = true; } } @@ -175284,7 +185167,7 @@ module.exports = UnityAtlasFile; /***/ }), -/* 1281 */ +/* 1344 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175294,10 +185177,10 @@ module.exports = UnityAtlasFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); -var GetURL = __webpack_require__(146); +var GetURL = __webpack_require__(148); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -175678,7 +185561,7 @@ module.exports = VideoFile; /***/ }), -/* 1282 */ +/* 1345 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175688,15 +185571,15 @@ module.exports = VideoFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var CustomSet = __webpack_require__(141); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(84); +var CONST = __webpack_require__(19); +var CustomSet = __webpack_require__(145); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(89); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); -var XHRSettings = __webpack_require__(147); +var XHRSettings = __webpack_require__(149); /** * @classdesc @@ -175860,7 +185743,7 @@ var LoaderPlugin = new Class({ * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. * * @name Phaser.Loader.LoaderPlugin#maxParallelDownloads - * @type {integer} + * @type {number} * @since 3.0.0 */ this.maxParallelDownloads = GetFastValue(sceneConfig, 'maxParallelDownloads', gameConfig.loaderMaxParallelDownloads); @@ -175895,7 +185778,7 @@ var LoaderPlugin = new Class({ * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. * * @name Phaser.Loader.LoaderPlugin#totalToLoad - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -175970,7 +185853,7 @@ var LoaderPlugin = new Class({ * This value is reset when you call `Loader.start`. * * @name Phaser.Loader.LoaderPlugin#totalFailed - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -175981,7 +185864,7 @@ var LoaderPlugin = new Class({ * This value is reset when you call `Loader.start`. * * @name Phaser.Loader.LoaderPlugin#totalComplete - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -175991,7 +185874,7 @@ var LoaderPlugin = new Class({ * The current state of the Loader. * * @name Phaser.Loader.LoaderPlugin#state - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -176001,7 +185884,7 @@ var LoaderPlugin = new Class({ * The current index being used by multi-file loaders to avoid key clashes. * * @name Phaser.Loader.LoaderPlugin#multiKeyIndex - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -176761,7 +186644,7 @@ module.exports = LoaderPlugin; /***/ }), -/* 1283 */ +/* 1346 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176770,8 +186653,8 @@ module.exports = LoaderPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(52); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(59); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Physics.Arcade @@ -176779,23 +186662,23 @@ var Extend = __webpack_require__(19); var Arcade = { - ArcadePhysics: __webpack_require__(1284), - Body: __webpack_require__(488), - Collider: __webpack_require__(489), - Components: __webpack_require__(228), - Events: __webpack_require__(230), - Factory: __webpack_require__(482), - GetOverlapX: __webpack_require__(231), - GetOverlapY: __webpack_require__(232), - SeparateX: __webpack_require__(497), - SeparateY: __webpack_require__(498), - Group: __webpack_require__(485), - Image: __webpack_require__(483), - Sprite: __webpack_require__(148), - StaticBody: __webpack_require__(499), - StaticGroup: __webpack_require__(486), - Tilemap: __webpack_require__(1305), - World: __webpack_require__(487) + ArcadePhysics: __webpack_require__(1347), + Body: __webpack_require__(504), + Collider: __webpack_require__(505), + Components: __webpack_require__(235), + Events: __webpack_require__(237), + Factory: __webpack_require__(498), + GetOverlapX: __webpack_require__(238), + GetOverlapY: __webpack_require__(239), + SeparateX: __webpack_require__(514), + SeparateY: __webpack_require__(515), + Group: __webpack_require__(501), + Image: __webpack_require__(499), + Sprite: __webpack_require__(150), + StaticBody: __webpack_require__(516), + StaticGroup: __webpack_require__(502), + Tilemap: __webpack_require__(1371), + World: __webpack_require__(503) }; @@ -176806,7 +186689,7 @@ module.exports = Arcade; /***/ }), -/* 1284 */ +/* 1347 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176816,18 +186699,18 @@ module.exports = Arcade; */ var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var DistanceBetween = __webpack_require__(55); -var DistanceSquared = __webpack_require__(334); -var Factory = __webpack_require__(482); +var DegToRad = __webpack_require__(34); +var DistanceBetween = __webpack_require__(61); +var DistanceSquared = __webpack_require__(345); +var Factory = __webpack_require__(498); var GetFastValue = __webpack_require__(2); -var Merge = __webpack_require__(134); -var OverlapCirc = __webpack_require__(484); -var OverlapRect = __webpack_require__(229); -var PluginCache = __webpack_require__(23); +var Merge = __webpack_require__(140); +var OverlapCirc = __webpack_require__(500); +var OverlapRect = __webpack_require__(236); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); var Vector2 = __webpack_require__(3); -var World = __webpack_require__(487); +var World = __webpack_require__(503); /** * @classdesc @@ -177531,7 +187414,7 @@ module.exports = ArcadePhysics; /***/ }), -/* 1285 */ +/* 1348 */ /***/ (function(module, exports) { /** @@ -177606,7 +187489,7 @@ module.exports = Acceleration; /***/ }), -/* 1286 */ +/* 1349 */ /***/ (function(module, exports) { /** @@ -177688,7 +187571,7 @@ module.exports = Angular; /***/ }), -/* 1287 */ +/* 1350 */ /***/ (function(module, exports) { /** @@ -177787,7 +187670,7 @@ module.exports = Bounce; /***/ }), -/* 1288 */ +/* 1351 */ /***/ (function(module, exports) { /** @@ -177914,7 +187797,7 @@ module.exports = Debug; /***/ }), -/* 1289 */ +/* 1352 */ /***/ (function(module, exports) { /** @@ -178047,7 +187930,7 @@ module.exports = Drag; /***/ }), -/* 1290 */ +/* 1353 */ /***/ (function(module, exports) { /** @@ -178171,7 +188054,7 @@ module.exports = Enable; /***/ }), -/* 1291 */ +/* 1354 */ /***/ (function(module, exports) { /** @@ -178259,7 +188142,7 @@ module.exports = Friction; /***/ }), -/* 1292 */ +/* 1355 */ /***/ (function(module, exports) { /** @@ -178337,7 +188220,7 @@ module.exports = Gravity; /***/ }), -/* 1293 */ +/* 1356 */ /***/ (function(module, exports) { /** @@ -178355,12 +188238,16 @@ module.exports = Gravity; var Immovable = { /** - * Sets Whether this Body can be moved by collisions with another Body. + * Sets if this Body can be separated during collisions with other bodies. + * + * When a body is immovable it means it won't move at all, not even to separate it from collision + * overlap. If you just wish to prevent a body from being knocked around by other bodies, see + * the `setPushable` method instead. * * @method Phaser.Physics.Arcade.Components.Immovable#setImmovable * @since 3.0.0 * - * @param {boolean} [value=true] - Sets if this body can be moved by collisions with another Body. + * @param {boolean} [value=true] - Sets if this body will be separated during collisions with other bodies. * * @return {this} This Game Object. */ @@ -178379,7 +188266,7 @@ module.exports = Immovable; /***/ }), -/* 1294 */ +/* 1357 */ /***/ (function(module, exports) { /** @@ -178419,7 +188306,55 @@ module.exports = Mass; /***/ }), -/* 1295 */ +/* 1358 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the pushable property of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Pushable + * @since 3.50.0 + */ +var Pushable = { + + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * @method Phaser.Physics.Arcade.Components.Pushable#setPushable + * @since 3.50.0 + * + * @param {boolean} [value=true] - Sets if this body can be pushed by collisions with another Body. + * + * @return {this} This Game Object. + */ + setPushable: function (value) + { + if (value === undefined) { value = true; } + + this.body.pushable = value; + + return this; + } + +}; + +module.exports = Pushable; + + +/***/ }), +/* 1359 */ /***/ (function(module, exports) { /** @@ -178522,7 +188457,7 @@ module.exports = Size; /***/ }), -/* 1296 */ +/* 1360 */ /***/ (function(module, exports) { /** @@ -178621,7 +188556,7 @@ module.exports = Velocity; /***/ }), -/* 1297 */ +/* 1361 */ /***/ (function(module, exports) { /** @@ -178654,7 +188589,7 @@ module.exports = 'collide'; /***/ }), -/* 1298 */ +/* 1362 */ /***/ (function(module, exports) { /** @@ -178687,7 +188622,7 @@ module.exports = 'overlap'; /***/ }), -/* 1299 */ +/* 1363 */ /***/ (function(module, exports) { /** @@ -178710,7 +188645,7 @@ module.exports = 'pause'; /***/ }), -/* 1300 */ +/* 1364 */ /***/ (function(module, exports) { /** @@ -178733,7 +188668,7 @@ module.exports = 'resume'; /***/ }), -/* 1301 */ +/* 1365 */ /***/ (function(module, exports) { /** @@ -178765,7 +188700,7 @@ module.exports = 'tilecollide'; /***/ }), -/* 1302 */ +/* 1366 */ /***/ (function(module, exports) { /** @@ -178797,7 +188732,7 @@ module.exports = 'tileoverlap'; /***/ }), -/* 1303 */ +/* 1367 */ /***/ (function(module, exports) { /** @@ -178829,7 +188764,7 @@ module.exports = 'worldbounds'; /***/ }), -/* 1304 */ +/* 1368 */ /***/ (function(module, exports) { /** @@ -178840,22 +188775,858 @@ module.exports = 'worldbounds'; /** * The Arcade Physics World Step Event. - * + * * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. * It is emitted _after_ the bodies and colliders have been updated. - * + * * In high framerate settings this can be multiple times per game frame. - * + * * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_STEP * @since 3.18.0 + * + * @param {number} delta - The delta time amount of this step, in seconds. */ module.exports = 'worldstep'; /***/ }), -/* 1305 */ +/* 1369 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var body1; +var body2; +var body1Pushable; +var body2Pushable; +var body1MassImpact; +var body2MassImpact; +var body1FullImpact; +var body2FullImpact; +var body1MovingLeft; +var body1MovingRight; +var body1Stationary; +var body2MovingLeft; +var body2MovingRight; +var body2Stationary; +var body1OnLeft; +var body2OnLeft; +var overlap; + +/** + * Sets all of the local processing values and calculates the velocity exchanges. + * + * Then runs `BlockCheck` and returns the value from it. + * + * This method is called by `Phaser.Physics.Arcade.SeparateX` and should not be + * called directly. + * + * @function Phaser.Physics.Arcade.ProcessX.Set + * @ignore + * @since 3.50.0 + * + * @param {Phaser.Physics.Arcade.Body} b1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} b2 - The second Body to separate. + * @param {number} ov - The overlap value. + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var Set = function (b1, b2, ov) +{ + body1 = b1; + body2 = b2; + + var v1 = body1.velocity.x; + var v2 = body2.velocity.x; + + body1Pushable = body1.pushable; + body1MovingLeft = body1._dx < 0; + body1MovingRight = body1._dx > 0; + body1Stationary = body1._dx === 0; + body1OnLeft = Math.abs(body1.right - body2.x) <= Math.abs(body2.right - body1.x); + body1FullImpact = v2 - v1 * body1.bounce.x; + + body2Pushable = body2.pushable; + body2MovingLeft = body2._dx < 0; + body2MovingRight = body2._dx > 0; + body2Stationary = body2._dx === 0; + body2OnLeft = !body1OnLeft; + body2FullImpact = v1 - v2 * body2.bounce.x; + + // negative delta = up, positive delta = down (inc. gravity) + overlap = Math.abs(ov); + + return BlockCheck(); +}; + +/** + * Blocked Direction checks, because it doesn't matter if an object can be pushed + * or not, blocked is blocked. + * + * @function Phaser.Physics.Arcade.ProcessX.BlockCheck + * @ignore + * @since 3.50.0 + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var BlockCheck = function () +{ + // Body1 is moving right and Body2 is blocked from going right any further + if (body1MovingRight && body1OnLeft && body2.blocked.right) + { + body1.processX(-overlap, body1FullImpact, false, true); + + return 1; + } + + // Body1 is moving up and Body2 is blocked from going up any further + if (body1MovingLeft && body2OnLeft && body2.blocked.left) + { + body1.processX(overlap, body1FullImpact, true); + + return 1; + } + + // Body2 is moving right and Body1 is blocked from going right any further + if (body2MovingRight && body2OnLeft && body1.blocked.right) + { + body2.processX(-overlap, body2FullImpact, false, true); + + return 2; + } + + // Body2 is moving up and Body1 is blocked from going up any further + if (body2MovingLeft && body1OnLeft && body1.blocked.left) + { + body2.processX(overlap, body2FullImpact, true); + + return 2; + } + + return 0; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessX.Check + * @ignore + * @since 3.50.0 + * + * @return {boolean} `true` if a check passed, otherwise `false`. + */ +var Check = function () +{ + var v1 = body1.velocity.x; + var v2 = body2.velocity.x; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1MassImpact = avg + nv1 * body1.bounce.x; + body2MassImpact = avg + nv2 * body2.bounce.x; + + // Body1 hits Body2 on the right hand side + if (body1MovingLeft && body2OnLeft) + { + return Run(0); + } + + // Body2 hits Body1 on the right hand side + if (body2MovingLeft && body1OnLeft) + { + return Run(1); + } + + // Body1 hits Body2 on the left hand side + if (body1MovingRight && body1OnLeft) + { + return Run(2); + } + + // Body2 hits Body1 on the left hand side + if (body2MovingRight && body2OnLeft) + { + return Run(3); + } + + return false; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessX.Run + * @ignore + * @since 3.50.0 + * + * @param {number} side - The side to test. As passed in by the `Check` function. + * + * @return {boolean} Always returns `true`. + */ +var Run = function (side) +{ + if (body1Pushable && body2Pushable) + { + // Both pushable, or both moving at the same time, so equal rebound + overlap *= 0.5; + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body1.processX(overlap, body1MassImpact); + body2.processX(-overlap, body2MassImpact); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body1.processX(-overlap, body1MassImpact); + body2.processX(overlap, body2MassImpact); + } + } + else if (body1Pushable && !body2Pushable) + { + // Body1 pushable, Body2 not + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body1.processX(overlap, body1FullImpact, true); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body1.processX(-overlap, body1FullImpact, false, true); + } + } + else if (!body1Pushable && body2Pushable) + { + // Body2 pushable, Body1 not + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body2.processX(-overlap, body2FullImpact, false, true); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body2.processX(overlap, body2FullImpact, true); + } + } + else + { + // Neither body is pushable, so base it on movement + + var halfOverlap = overlap * 0.5; + + if (side === 0) + { + // body1MovingLeft && body2OnLeft + + if (body2Stationary) + { + body1.processX(overlap, 0, true); + body2.processX(0, null, false, true); + } + else if (body2MovingRight) + { + body1.processX(halfOverlap, 0, true); + body2.processX(-halfOverlap, 0, false, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processX(halfOverlap, body2.velocity.x, true); + body2.processX(-halfOverlap, null, false, true); + } + } + else if (side === 1) + { + // body2MovingLeft && body1OnLeft + + if (body1Stationary) + { + body1.processX(0, null, false, true); + body2.processX(overlap, 0, true); + } + else if (body1MovingRight) + { + body1.processX(-halfOverlap, 0, false, true); + body2.processX(halfOverlap, 0, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processX(-halfOverlap, null, false, true); + body2.processX(halfOverlap, body1.velocity.x, true); + } + } + else if (side === 2) + { + // body1MovingRight && body1OnLeft + + if (body2Stationary) + { + body1.processX(-overlap, 0, false, true); + body2.processX(0, null, true); + } + else if (body2MovingLeft) + { + body1.processX(-halfOverlap, 0, false, true); + body2.processX(halfOverlap, 0, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processX(-halfOverlap, body2.velocity.x, false, true); + body2.processX(halfOverlap, null, true); + } + } + else if (side === 3) + { + // body2MovingRight && body2OnLeft + + if (body1Stationary) + { + body1.processX(0, null, true); + body2.processX(-overlap, 0, false, true); + } + else if (body1MovingLeft) + { + body1.processX(halfOverlap, 0, true); + body2.processX(-halfOverlap, 0, false, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processX(halfOverlap, body2.velocity.y, true); + body2.processX(-halfOverlap, null, false, true); + } + } + } + + return true; +}; + +/** + * This function is run when Body1 is Immovable and Body2 is not. + * + * @function Phaser.Physics.Arcade.ProcessX.RunImmovableBody1 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody1 = function (blockedState) +{ + if (blockedState === 1) + { + // But Body2 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body2.velocity.x = 0; + } + else if (body1OnLeft) + { + body2.processX(overlap, body2FullImpact, true); + } + else + { + body2.processX(-overlap, body2FullImpact, false, true); + } + + // This is special case code that handles things like vertically moving platforms you can ride + if (body1.moves) + { + body2.y += (body1.y - body1.prev.y) * body1.friction.y; + body2._dy = body2.y - body2.prev.y; + } +}; + +/** + * This function is run when Body2 is Immovable and Body1 is not. + * + * @function Phaser.Physics.Arcade.ProcessX.RunImmovableBody2 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody2 = function (blockedState) +{ + if (blockedState === 2) + { + // But Body1 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body1.velocity.x = 0; + } + if (body2OnLeft) + { + body1.processX(overlap, body1FullImpact, true); + } + else + { + body1.processX(-overlap, body1FullImpact, false, true); + } + + // This is special case code that handles things like vertically moving platforms you can ride + if (body2.moves) + { + body1.y += (body2.y - body2.prev.y) * body2.friction.y; + body1._dy = body1.y - body1.prev.y; + } +}; + +/** + * @namespace Phaser.Physics.Arcade.ProcessX + * @ignore + */ + +module.exports = { + BlockCheck: BlockCheck, + Check: Check, + Set: Set, + Run: Run, + RunImmovableBody1: RunImmovableBody1, + RunImmovableBody2: RunImmovableBody2 +}; + + +/***/ }), +/* 1370 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var body1; +var body2; +var body1Pushable; +var body2Pushable; +var body1MassImpact; +var body2MassImpact; +var body1FullImpact; +var body2FullImpact; +var body1MovingUp; +var body1MovingDown; +var body1Stationary; +var body2MovingUp; +var body2MovingDown; +var body2Stationary; +var body1OnTop; +var body2OnTop; +var overlap; + +/** + * Sets all of the local processing values and calculates the velocity exchanges. + * + * Then runs `BlockCheck` and returns the value from it. + * + * This method is called by `Phaser.Physics.Arcade.SeparateY` and should not be + * called directly. + * + * @function Phaser.Physics.Arcade.ProcessY.Set + * @ignore + * @since 3.50.0 + * + * @param {Phaser.Physics.Arcade.Body} b1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} b2 - The second Body to separate. + * @param {number} ov - The overlap value. + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var Set = function (b1, b2, ov) +{ + body1 = b1; + body2 = b2; + + var v1 = body1.velocity.y; + var v2 = body2.velocity.y; + + body1Pushable = body1.pushable; + body1MovingUp = body1._dy < 0; + body1MovingDown = body1._dy > 0; + body1Stationary = body1._dy === 0; + body1OnTop = Math.abs(body1.bottom - body2.y) <= Math.abs(body2.bottom - body1.y); + body1FullImpact = v2 - v1 * body1.bounce.y; + + body2Pushable = body2.pushable; + body2MovingUp = body2._dy < 0; + body2MovingDown = body2._dy > 0; + body2Stationary = body2._dy === 0; + body2OnTop = !body1OnTop; + body2FullImpact = v1 - v2 * body2.bounce.y; + + // negative delta = up, positive delta = down (inc. gravity) + overlap = Math.abs(ov); + + return BlockCheck(); +}; + +/** + * Blocked Direction checks, because it doesn't matter if an object can be pushed + * or not, blocked is blocked. + * + * @function Phaser.Physics.Arcade.ProcessY.BlockCheck + * @ignore + * @since 3.50.0 + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var BlockCheck = function () +{ + // Body1 is moving down and Body2 is blocked from going down any further + if (body1MovingDown && body1OnTop && body2.blocked.down) + { + body1.processY(-overlap, body1FullImpact, false, true); + + return 1; + } + + // Body1 is moving up and Body2 is blocked from going up any further + if (body1MovingUp && body2OnTop && body2.blocked.up) + { + body1.processY(overlap, body1FullImpact, true); + + return 1; + } + + // Body2 is moving down and Body1 is blocked from going down any further + if (body2MovingDown && body2OnTop && body1.blocked.down) + { + body2.processY(-overlap, body2FullImpact, false, true); + + return 2; + } + + // Body2 is moving up and Body1 is blocked from going up any further + if (body2MovingUp && body1OnTop && body1.blocked.up) + { + body2.processY(overlap, body2FullImpact, true); + + return 2; + } + + return 0; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessY.Check + * @ignore + * @since 3.50.0 + * + * @return {boolean} `true` if a check passed, otherwise `false`. + */ +var Check = function () +{ + var v1 = body1.velocity.y; + var v2 = body2.velocity.y; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1MassImpact = avg + nv1 * body1.bounce.y; + body2MassImpact = avg + nv2 * body2.bounce.y; + + // Body1 hits Body2 on the bottom side + if (body1MovingUp && body2OnTop) + { + return Run(0); + } + + // Body2 hits Body1 on the bottom side + if (body2MovingUp && body1OnTop) + { + return Run(1); + } + + // Body1 hits Body2 on the top side + if (body1MovingDown && body1OnTop) + { + return Run(2); + } + + // Body2 hits Body1 on the top side + if (body2MovingDown && body2OnTop) + { + return Run(3); + } + + return false; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessY.Run + * @ignore + * @since 3.50.0 + * + * @param {number} side - The side to test. As passed in by the `Check` function. + * + * @return {boolean} Always returns `true`. + */ +var Run = function (side) +{ + if (body1Pushable && body2Pushable) + { + // Both pushable, or both moving at the same time, so equal rebound + overlap *= 0.5; + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body1.processY(overlap, body1MassImpact); + body2.processY(-overlap, body2MassImpact); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body1.processY(-overlap, body1MassImpact); + body2.processY(overlap, body2MassImpact); + } + } + else if (body1Pushable && !body2Pushable) + { + // Body1 pushable, Body2 not + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body1.processY(overlap, body1FullImpact, true); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body1.processY(-overlap, body1FullImpact, false, true); + } + } + else if (!body1Pushable && body2Pushable) + { + // Body2 pushable, Body1 not + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body2.processY(-overlap, body2FullImpact, false, true); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body2.processY(overlap, body2FullImpact, true); + } + } + else + { + // Neither body is pushable, so base it on movement + + var halfOverlap = overlap * 0.5; + + if (side === 0) + { + // body1MovingUp && body2OnTop + + if (body2Stationary) + { + body1.processY(overlap, 0, true); + body2.processY(0, null, false, true); + } + else if (body2MovingDown) + { + body1.processY(halfOverlap, 0, true); + body2.processY(-halfOverlap, 0, false, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processY(halfOverlap, body2.velocity.y, true); + body2.processY(-halfOverlap, null, false, true); + } + } + else if (side === 1) + { + // body2MovingUp && body1OnTop + + if (body1Stationary) + { + body1.processY(0, null, false, true); + body2.processY(overlap, 0, true); + } + else if (body1MovingDown) + { + body1.processY(-halfOverlap, 0, false, true); + body2.processY(halfOverlap, 0, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processY(-halfOverlap, null, false, true); + body2.processY(halfOverlap, body1.velocity.y, true); + } + } + else if (side === 2) + { + // body1MovingDown && body1OnTop + + if (body2Stationary) + { + body1.processY(-overlap, 0, false, true); + body2.processY(0, null, true); + } + else if (body2MovingUp) + { + body1.processY(-halfOverlap, 0, false, true); + body2.processY(halfOverlap, 0, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processY(-halfOverlap, body2.velocity.y, false, true); + body2.processY(halfOverlap, null, true); + } + } + else if (side === 3) + { + // body2MovingDown && body2OnTop + + if (body1Stationary) + { + body1.processY(0, null, true); + body2.processY(-overlap, 0, false, true); + } + else if (body1MovingUp) + { + body1.processY(halfOverlap, 0, true); + body2.processY(-halfOverlap, 0, false, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processY(halfOverlap, body2.velocity.y, true); + body2.processY(-halfOverlap, null, false, true); + } + } + } + + return true; +}; + +/** + * This function is run when Body1 is Immovable and Body2 is not. + * + * @function Phaser.Physics.Arcade.ProcessY.RunImmovableBody1 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody1 = function (blockedState) +{ + if (blockedState === 1) + { + // But Body2 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body2.velocity.y = 0; + } + else if (body1OnTop) + { + body2.processY(overlap, body2FullImpact, true); + } + else + { + body2.processY(-overlap, body2FullImpact, false, true); + } + + // This is special case code that handles things like horizontally moving platforms you can ride + if (body1.moves) + { + body2.x += (body1.x - body1.prev.x) * body1.friction.x; + body2._dx = body2.x - body2.prev.x; + } +}; + +/** + * This function is run when Body2 is Immovable and Body1 is not. + * + * @function Phaser.Physics.Arcade.ProcessY.RunImmovableBody2 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody2 = function (blockedState) +{ + if (blockedState === 2) + { + // But Body1 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body1.velocity.y = 0; + } + else if (body2OnTop) + { + body1.processY(overlap, body1FullImpact, true); + } + else + { + body1.processY(-overlap, body1FullImpact, false, true); + } + + // This is special case code that handles things like horizontally moving platforms you can ride + if (body2.moves) + { + body1.x += (body2.x - body2.prev.x) * body2.friction.x; + body1._dx = body1.x - body1.prev.x; + } +}; + +/** + * @namespace Phaser.Physics.Arcade.ProcessY + * @ignore + */ + +module.exports = { + BlockCheck: BlockCheck, + Check: Check, + Set: Set, + Run: Run, + RunImmovableBody1: RunImmovableBody1, + RunImmovableBody2: RunImmovableBody2 +}; + + +/***/ }), +/* 1371 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178870,13 +189641,13 @@ module.exports = 'worldstep'; var Tilemap = { - ProcessTileCallbacks: __webpack_require__(490), - ProcessTileSeparationX: __webpack_require__(494), - ProcessTileSeparationY: __webpack_require__(496), - SeparateTile: __webpack_require__(492), - TileCheckX: __webpack_require__(493), - TileCheckY: __webpack_require__(495), - TileIntersectsBody: __webpack_require__(233) + ProcessTileCallbacks: __webpack_require__(507), + ProcessTileSeparationX: __webpack_require__(511), + ProcessTileSeparationY: __webpack_require__(513), + SeparateTile: __webpack_require__(509), + TileCheckX: __webpack_require__(510), + TileCheckY: __webpack_require__(512), + TileIntersectsBody: __webpack_require__(240) }; @@ -178884,18 +189655,18 @@ module.exports = Tilemap; /***/ }), -/* 1306 */, -/* 1307 */, -/* 1308 */, -/* 1309 */, -/* 1310 */, -/* 1311 */, -/* 1312 */, -/* 1313 */, -/* 1314 */, -/* 1315 */, -/* 1316 */, -/* 1317 */ +/* 1372 */, +/* 1373 */, +/* 1374 */, +/* 1375 */, +/* 1376 */, +/* 1377 */, +/* 1378 */, +/* 1379 */, +/* 1380 */, +/* 1381 */, +/* 1382 */, +/* 1383 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178910,17 +189681,17 @@ module.exports = Tilemap; module.exports = { - BasePlugin: __webpack_require__(502), - DefaultPlugins: __webpack_require__(184), - PluginCache: __webpack_require__(23), - PluginManager: __webpack_require__(381), - ScenePlugin: __webpack_require__(1318) + BasePlugin: __webpack_require__(519), + DefaultPlugins: __webpack_require__(189), + PluginCache: __webpack_require__(25), + PluginManager: __webpack_require__(391), + ScenePlugin: __webpack_require__(1384) }; /***/ }), -/* 1318 */ +/* 1384 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178929,7 +189700,7 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ -var BasePlugin = __webpack_require__(502); +var BasePlugin = __webpack_require__(519); var Class = __webpack_require__(0); var SceneEvents = __webpack_require__(20); @@ -179048,7 +189819,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1319 */ +/* 1385 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179057,8 +189828,8 @@ module.exports = ScenePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); -var CONST = __webpack_require__(187); +var Extend = __webpack_require__(18); +var CONST = __webpack_require__(192); /** * @namespace Phaser.Scale @@ -179086,12 +189857,12 @@ var CONST = __webpack_require__(187); var Scale = { - Center: __webpack_require__(370), - Events: __webpack_require__(94), - Orientation: __webpack_require__(371), - ScaleManager: __webpack_require__(382), - ScaleModes: __webpack_require__(372), - Zoom: __webpack_require__(373) + Center: __webpack_require__(380), + Events: __webpack_require__(101), + Orientation: __webpack_require__(381), + ScaleManager: __webpack_require__(392), + ScaleModes: __webpack_require__(382), + Zoom: __webpack_require__(383) }; @@ -179104,7 +189875,7 @@ module.exports = Scale; /***/ }), -/* 1320 */ +/* 1386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179113,8 +189884,8 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(133); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(139); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Scenes @@ -179123,12 +189894,12 @@ var Extend = __webpack_require__(19); var Scene = { Events: __webpack_require__(20), - GetPhysicsPlugins: __webpack_require__(386), - GetScenePlugins: __webpack_require__(387), - SceneManager: __webpack_require__(384), - ScenePlugin: __webpack_require__(1321), - Settings: __webpack_require__(388), - Systems: __webpack_require__(190) + GetPhysicsPlugins: __webpack_require__(396), + GetScenePlugins: __webpack_require__(397), + SceneManager: __webpack_require__(394), + ScenePlugin: __webpack_require__(1387), + Settings: __webpack_require__(398), + Systems: __webpack_require__(195) }; @@ -179139,7 +189910,7 @@ module.exports = Scene; /***/ }), -/* 1321 */ +/* 1387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179148,11 +189919,11 @@ module.exports = Scene; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); var Events = __webpack_require__(20); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); /** * @classdesc @@ -179230,7 +190001,7 @@ var ScenePlugin = new Class({ * Transition elapsed timer. * * @name Phaser.Scenes.ScenePlugin#_elapsed - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -179250,7 +190021,7 @@ var ScenePlugin = new Class({ * Transition duration. * * @name Phaser.Scenes.ScenePlugin#_duration - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -180095,7 +190866,7 @@ var ScenePlugin = new Class({ * * @param {(string|Phaser.Scene)} [key] - The Scene to get the index of. * - * @return {integer} The index of the Scene. + * @return {number} The index of the Scene. */ getIndex: function (key) { @@ -180149,7 +190920,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1322 */ +/* 1388 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180164,19 +190935,19 @@ module.exports = ScenePlugin; module.exports = { - Events: __webpack_require__(405), - List: __webpack_require__(137), - Map: __webpack_require__(92), - ProcessQueue: __webpack_require__(197), - RTree: __webpack_require__(491), - Set: __webpack_require__(141), - Size: __webpack_require__(383) + Events: __webpack_require__(415), + List: __webpack_require__(105), + Map: __webpack_require__(98), + ProcessQueue: __webpack_require__(202), + RTree: __webpack_require__(508), + Set: __webpack_require__(145), + Size: __webpack_require__(393) }; /***/ }), -/* 1323 */ +/* 1389 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180185,8 +190956,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); -var FilterMode = __webpack_require__(1324); +var Extend = __webpack_require__(18); +var FilterMode = __webpack_require__(1390); /** * @namespace Phaser.Textures @@ -180196,7 +190967,7 @@ var FilterMode = __webpack_require__(1324); * Linear filter type. * * @name Phaser.Textures.LINEAR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -180205,21 +190976,21 @@ var FilterMode = __webpack_require__(1324); * Nearest Neighbor filter type. * * @name Phaser.Textures.NEAREST - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ var Textures = { - CanvasTexture: __webpack_require__(390), - Events: __webpack_require__(130), + CanvasTexture: __webpack_require__(400), + Events: __webpack_require__(136), FilterMode: FilterMode, - Frame: __webpack_require__(97), - Parsers: __webpack_require__(392), - Texture: __webpack_require__(192), - TextureManager: __webpack_require__(389), - TextureSource: __webpack_require__(391) + Frame: __webpack_require__(104), + Parsers: __webpack_require__(402), + Texture: __webpack_require__(197), + TextureManager: __webpack_require__(399), + TextureSource: __webpack_require__(401) }; @@ -180229,7 +191000,7 @@ module.exports = Textures; /***/ }), -/* 1324 */ +/* 1390 */ /***/ (function(module, exports) { /** @@ -180251,7 +191022,7 @@ var CONST = { * Linear filter type. * * @name Phaser.Textures.FilterMode.LINEAR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -180261,7 +191032,7 @@ var CONST = { * Nearest neighbor filter type. * * @name Phaser.Textures.FilterMode.NEAREST - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -180273,7 +191044,7 @@ module.exports = CONST; /***/ }), -/* 1325 */ +/* 1391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180282,36 +191053,47 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Extend = __webpack_require__(18); +var CONST = __webpack_require__(1392); + /** * @namespace Phaser.Tilemaps + * + * @borrows Phaser.Tilemaps.Orientation.ORTHOGONAL as ORTHOGONAL + * @borrows Phaser.Tilemaps.Orientation.ISOMETRIC as ISOMETRIC + * @borrows Phaser.Tilemaps.Orientation.STAGGERED as STAGGERED + * @borrows Phaser.Tilemaps.Orientation.HEXAGONAL as HEXAGONAL */ -module.exports = { +var Tilemaps = { - Components: __webpack_require__(149), - Parsers: __webpack_require__(1355), + Components: __webpack_require__(243), + Parsers: __webpack_require__(1425), - Formats: __webpack_require__(33), - ImageCollection: __webpack_require__(513), - ParseToTilemap: __webpack_require__(240), - Tile: __webpack_require__(75), - Tilemap: __webpack_require__(522), - TilemapCreator: __webpack_require__(1369), - TilemapFactory: __webpack_require__(1370), - Tileset: __webpack_require__(107), + Formats: __webpack_require__(38), + ImageCollection: __webpack_require__(555), + ParseToTilemap: __webpack_require__(253), + Tile: __webpack_require__(81), + Tilemap: __webpack_require__(559), + TilemapCreator: __webpack_require__(1431), + TilemapFactory: __webpack_require__(1432), + Tileset: __webpack_require__(119), + TilemapLayer: __webpack_require__(560), + Orientation: __webpack_require__(29), - LayerData: __webpack_require__(105), - MapData: __webpack_require__(106), - ObjectLayer: __webpack_require__(516), - - DynamicTilemapLayer: __webpack_require__(523), - StaticTilemapLayer: __webpack_require__(524) + LayerData: __webpack_require__(117), + MapData: __webpack_require__(118), + ObjectLayer: __webpack_require__(551) }; +Tilemaps = Extend(false, Tilemaps, CONST.ORIENTATION); + +module.exports = Tilemaps; + /***/ }), -/* 1326 */ +/* 1392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180320,8 +191102,28 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var CalculateFacesWithin = __webpack_require__(53); +var CONST = { + + FromOrientationString: __webpack_require__(242), + ORIENTATION: __webpack_require__(29) + +}; + +module.exports = CONST; + + +/***/ }), +/* 1393 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(26); +var CalculateFacesWithin = __webpack_require__(60); /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile @@ -180331,20 +191133,21 @@ var CalculateFacesWithin = __webpack_require__(53); * @function Phaser.Tilemaps.Components.Copy * @since 3.0.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) { + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (srcTileX < 0) { srcTileX = 0; } if (srcTileY < 0) { srcTileY = 0; } - if (recalculateFaces === undefined) { recalculateFaces = true; } var srcTiles = GetTilesWithin(srcTileX, srcTileY, width, height, null, layer); @@ -180376,7 +191179,7 @@ module.exports = Copy; /***/ }), -/* 1327 */ +/* 1394 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180385,10 +191188,8 @@ module.exports = Copy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(151); -var TileToWorldY = __webpack_require__(152); -var GetTilesWithin = __webpack_require__(24); -var ReplaceByIndex = __webpack_require__(503); +var GetTilesWithin = __webpack_require__(26); +var ReplaceByIndex = __webpack_require__(521); /** * Creates a Sprite for every object matching the given tile indexes in the layer. You can @@ -180402,15 +191203,15 @@ var ReplaceByIndex = __webpack_require__(503); * @param {(number|number[])} indexes - The tile index, or array of indexes, to create Sprites from. * @param {(number|number[])} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * @param {Phaser.Scene} scene - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when determining the world XY * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. */ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, camera, layer) { - if (spriteConfig === undefined) { spriteConfig = {}; } + if (!spriteConfig) { spriteConfig = {}; } if (!Array.isArray(indexes)) { @@ -180419,8 +191220,8 @@ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, came var tilemapLayer = layer.tilemapLayer; - if (scene === undefined) { scene = tilemapLayer.scene; } - if (camera === undefined) { camera = scene.cameras.main; } + if (!scene) { scene = tilemapLayer.scene; } + if (!camera) { camera = scene.cameras.main; } var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); var sprites = []; @@ -180432,8 +191233,10 @@ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, came if (indexes.indexOf(tile.index) !== -1) { - spriteConfig.x = TileToWorldX(tile.x, camera, layer); - spriteConfig.y = TileToWorldY(tile.y, camera, layer); + var point = tilemapLayer.tileToWorldXY(tile.x, tile.y, undefined, camera,layer); + + spriteConfig.x = point.x; + spriteConfig.y = point.y; sprites.push(scene.make.sprite(spriteConfig)); } @@ -180463,7 +191266,7 @@ module.exports = CreateFromTiles; /***/ }), -/* 1328 */ +/* 1395 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180472,165 +191275,9 @@ module.exports = CreateFromTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SnapFloor = __webpack_require__(95); -var SnapCeil = __webpack_require__(343); - -/** - * Returns the tiles in the given layer that are within the camera's viewport. This is used internally. - * - * @function Phaser.Tilemaps.Components.CullTiles - * @since 3.0.0 - * - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * @param {array} [outputArray] - An optional array to store the Tile objects within. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ -var CullTiles = function (layer, camera, outputArray, renderOrder) -{ - if (outputArray === undefined) { outputArray = []; } - if (renderOrder === undefined) { renderOrder = 0; } - - outputArray.length = 0; - - var tilemap = layer.tilemapLayer.tilemap; - var tilemapLayer = layer.tilemapLayer; - - var mapData = layer.data; - var mapWidth = layer.width; - var mapHeight = layer.height; - - // We need to use the tile sizes defined for the map as a whole, not the layer, - // in order to calculate the bounds correctly. As different sized tiles may be - // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. - var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); - var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); - - var drawLeft = 0; - var drawRight = mapWidth; - var drawTop = 0; - var drawBottom = mapHeight; - - if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) - { - // Camera world view bounds, snapped for scaled tile size - // Cull Padding values are given in tiles, not pixels - - var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; - var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; - var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY; - var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY; - - drawLeft = Math.max(0, boundsLeft); - drawRight = Math.min(mapWidth, boundsRight); - drawTop = Math.max(0, boundsTop); - drawBottom = Math.min(mapHeight, boundsBottom); - } - - var x; - var y; - var tile; - - if (renderOrder === 0) - { - // right-down - - for (y = drawTop; y < drawBottom; y++) - { - for (x = drawLeft; mapData[y] && x < drawRight; x++) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 1) - { - // left-down - - for (y = drawTop; y < drawBottom; y++) - { - for (x = drawRight; mapData[y] && x >= drawLeft; x--) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 2) - { - // right-up - - for (y = drawBottom; y >= drawTop; y--) - { - for (x = drawLeft; mapData[y] && x < drawRight; x++) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 3) - { - // left-up - - for (y = drawBottom; y >= drawTop; y--) - { - for (x = drawRight; mapData[y] && x >= drawLeft; x--) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - - tilemapLayer.tilesDrawn = outputArray.length; - tilemapLayer.tilesTotal = mapWidth * mapHeight; - - return outputArray; -}; - -module.exports = CullTiles; - - -/***/ }), -/* 1329 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetTilesWithin = __webpack_require__(24); -var CalculateFacesWithin = __webpack_require__(53); -var SetTileCollision = __webpack_require__(65); +var GetTilesWithin = __webpack_require__(26); +var CalculateFacesWithin = __webpack_require__(60); +var SetTileCollision = __webpack_require__(69); /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the @@ -180640,11 +191287,11 @@ var SetTileCollision = __webpack_require__(65); * @function Phaser.Tilemaps.Components.Fill * @since 3.0.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used. */ @@ -180672,7 +191319,7 @@ module.exports = Fill; /***/ }), -/* 1330 */ +/* 1396 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180681,7 +191328,7 @@ module.exports = Fill; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -180694,15 +191341,12 @@ var GetTilesWithin = __webpack_require__(24); * @param {function} callback - The callback. Each tile in the given area will be passed to this * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles. @@ -180718,7 +191362,7 @@ module.exports = FilterTiles; /***/ }), -/* 1331 */ +/* 1397 */ /***/ (function(module, exports) { /** @@ -180737,10 +191381,9 @@ module.exports = FilterTiles; * @function Phaser.Tilemaps.Components.FindByIndex * @since 3.0.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. + * @param {number} index - The tile index value to search for. + * @param {number} skip - The number of times to skip a matching tile before returning. + * @param {boolean} reverse - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} The first (or n skipped) tile with the matching index. @@ -180805,7 +191448,7 @@ module.exports = FindByIndex; /***/ }), -/* 1332 */ +/* 1398 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180814,13 +191457,13 @@ module.exports = FindByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * @callback FindTileCallback * * @param {Phaser.Tilemaps.Tile} value - The Tile. - * @param {integer} index - The index of the tile. + * @param {number} index - The index of the tile. * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. * * @return {boolean} Return `true` if the callback should run, otherwise `false`. @@ -180835,15 +191478,12 @@ var GetTilesWithin = __webpack_require__(24); * @since 3.0.0 * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found @@ -180851,6 +191491,7 @@ var GetTilesWithin = __webpack_require__(24); var FindTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + return tiles.find(callback, context) || null; }; @@ -180858,7 +191499,7 @@ module.exports = FindTile; /***/ }), -/* 1333 */ +/* 1399 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180867,13 +191508,13 @@ module.exports = FindTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * @callback EachTileCallback * * @param {Phaser.Tilemaps.Tile} value - The Tile. - * @param {integer} index - The index of the tile. + * @param {number} index - The index of the tile. * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. */ @@ -180885,15 +191526,12 @@ var GetTilesWithin = __webpack_require__(24); * @since 3.0.0 * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) @@ -180907,7 +191545,7 @@ module.exports = ForEachTile; /***/ }), -/* 1334 */ +/* 1400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180916,9 +191554,64 @@ module.exports = ForEachTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(150); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var CONST = __webpack_require__(29); +var CullTiles = __webpack_require__(523); +var HexagonalCullTiles = __webpack_require__(524); +var IsometricCullTiles = __webpack_require__(526); +var NOOP = __webpack_require__(1); +var StaggeredCullTiles = __webpack_require__(527); + +/** + * Gets the correct function to use to cull tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetCullTilesFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to cull tiles for the given map type. + */ +var GetCullTilesFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return CullTiles; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalCullTiles; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredCullTiles; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricCullTiles; + } + else + { + return NOOP; + } +}; + +module.exports = GetCullTilesFunction; + + +/***/ }), +/* 1401 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTileAt = __webpack_require__(151); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Gets a tile at the given world coordinates from the given layer. @@ -180928,26 +191621,24 @@ var WorldToTileY = __webpack_require__(67); * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} nonNull - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ var GetTileAtWorldXY = function (worldX, worldY, nonNull, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera); - return GetTileAt(tileX, tileY, nonNull, layer); + return GetTileAt(point.x, point.y, nonNull, layer); }; module.exports = GetTileAtWorldXY; /***/ }), -/* 1335 */ +/* 1402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180956,22 +191647,20 @@ module.exports = GetTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Geom = __webpack_require__(448); -var GetTilesWithin = __webpack_require__(24); -var Intersects = __webpack_require__(449); +var Geom = __webpack_require__(460); +var GetTilesWithin = __webpack_require__(26); +var Intersects = __webpack_require__(461); var NOOP = __webpack_require__(1); -var TileToWorldX = __webpack_require__(151); -var TileToWorldY = __webpack_require__(152); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var Vector2 = __webpack_require__(3); var TriangleToRectangle = function (triangle, rect) { return Intersects.RectangleToTriangle(rect, triangle); }; -// Note: Could possibly be optimized by copying the shape and shifting it into tilemapLayer -// coordinates instead of shifting the tiles. +var point = new Vector2(); +var pointStart = new Vector2(); +var pointEnd = new Vector2(); /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, @@ -180981,11 +191670,8 @@ var TriangleToRectangle = function (triangle, rect) * @since 3.0.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -180997,45 +191683,40 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) // intersectTest is a function with parameters: shape, rect var intersectTest = NOOP; - switch (typeof(shape)) + if (shape instanceof Geom.Circle) { - case Geom.Circle: - { - intersectTest = Intersects.CircleToRectangle; - break; - } - - case Geom.Rectangle: - { - intersectTest = Intersects.RectangleToRectangle; - break; - } - - case Geom.Triangle: - { - intersectTest = TriangleToRectangle; - break; - } - - case Geom.Line: - { - intersectTest = Intersects.LineToRectangle; - break; - } + intersectTest = Intersects.CircleToRectangle; + } + else if (shape instanceof Geom.Rectangle) + { + intersectTest = Intersects.RectangleToRectangle; + } + else if (shape instanceof Geom.Triangle) + { + intersectTest = TriangleToRectangle; + } + else if (shape instanceof Geom.Line) + { + intersectTest = Intersects.LineToRectangle; } // Top left corner of the shapes's bounding box, rounded down to include partial tiles - var xStart = WorldToTileX(shape.left, true, camera, layer); - var yStart = WorldToTileY(shape.top, true, camera, layer); + layer.tilemapLayer.worldToTileXY(shape.left, shape.top, true, pointStart, camera); + + var xStart = pointStart.x; + var yStart = pointStart.y; // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles - var xEnd = Math.ceil(WorldToTileX(shape.right, false, camera, layer)); - var yEnd = Math.ceil(WorldToTileY(shape.bottom, false, camera, layer)); + layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, true, pointEnd, camera); + + var xEnd = Math.ceil(pointEnd.x); + var yEnd = Math.ceil(pointEnd.y); // Tiles within bounding rectangle of shape. Bounds are forced to be at least 1 x 1 tile in size // to grab tiles for shapes that don't have a height or width (e.g. a horizontal line). var width = Math.max(xEnd - xStart, 1); var height = Math.max(yEnd - yStart, 1); + var tiles = GetTilesWithin(xStart, yStart, width, height, filteringOptions, layer); var tileWidth = layer.tileWidth; @@ -181054,8 +191735,10 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) { var tile = tiles[i]; - tileRect.x = TileToWorldX(tile.x, camera, layer); - tileRect.y = TileToWorldY(tile.y, camera, layer); + layer.tilemapLayer.tileToWorldXY(tile.x, tile.y, point, camera); + + tileRect.x = point.x; + tileRect.y = point.y; if (intersectTest(shape, tileRect)) { @@ -181070,7 +191753,7 @@ module.exports = GetTilesWithinShape; /***/ }), -/* 1336 */ +/* 1403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181079,47 +191762,37 @@ module.exports = GetTilesWithinShape; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var CONST = __webpack_require__(29); +var NOOP = __webpack_require__(1); +var TileToWorldX = __webpack_require__(245); /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * Gets the correct function to use to translate tiles, based on the map orientation. * - * @function Phaser.Tilemaps.Components.GetTilesWithinWorldXY - * @since 3.0.0 + * @function Phaser.Tilemaps.Components.GetTileToWorldXFunction + * @since 3.50.0 * - * @param {number} worldX - The world x coordinate for the top-left of the area. - * @param {number} worldY - The world y coordinate for the top-left of the area. - * @param {number} width - The width of the area. - * @param {number} height - The height of the area. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {number} orientation - The Tilemap orientation constant. * - * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + * @return {function} The function to use to translate tiles for the given map type. */ -var GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer) +var GetTileToWorldXFunction = function (orientation) { - // Top left corner of the rect, rounded down to include partial tiles - var xStart = WorldToTileX(worldX, true, camera, layer); - var yStart = WorldToTileY(worldY, true, camera, layer); - - // Bottom right corner of the rect, rounded up to include partial tiles - var xEnd = Math.ceil(WorldToTileX(worldX + width, false, camera, layer)); - var yEnd = Math.ceil(WorldToTileY(worldY + height, false, camera, layer)); - - return GetTilesWithin(xStart, yStart, xEnd - xStart, yEnd - yStart, filteringOptions, layer); + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldX; + } + else + { + return NOOP; + } }; -module.exports = GetTilesWithinWorldXY; +module.exports = GetTileToWorldXFunction; /***/ }), -/* 1337 */ +/* 1404 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181128,9 +191801,255 @@ module.exports = GetTilesWithinWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HasTileAt = __webpack_require__(504); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var CONST = __webpack_require__(29); +var HexagonalTileToWorldXY = __webpack_require__(529); +var IsometricTileToWorldXY = __webpack_require__(530); +var NOOP = __webpack_require__(1); +var StaggeredTileToWorldXY = __webpack_require__(531); +var TileToWorldXY = __webpack_require__(532); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetTileToWorldXYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetTileToWorldXYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldXY; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricTileToWorldXY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalTileToWorldXY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredTileToWorldXY; + } + else + { + return NOOP; + } +}; + +module.exports = GetTileToWorldXYFunction; + + +/***/ }), +/* 1405 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var HexagonalTileToWorldY = __webpack_require__(533); +var NOOP = __webpack_require__(1); +var StaggeredTileToWorldY = __webpack_require__(534); +var TileToWorldY = __webpack_require__(246); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetTileToWorldYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetTileToWorldYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalTileToWorldY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredTileToWorldY; + } + else + { + return NOOP; + } +}; + +module.exports = GetTileToWorldYFunction; + + +/***/ }), +/* 1406 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var NOOP = __webpack_require__(1); +var WorldToTileX = __webpack_require__(247); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileXFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileXFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileX; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileXFunction; + + +/***/ }), +/* 1407 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var HexagonalWorldToTileXY = __webpack_require__(535); +var IsometricWorldToTileXY = __webpack_require__(536); +var NOOP = __webpack_require__(1); +var StaggeredWorldToTileXY = __webpack_require__(537); +var WorldToTileXY = __webpack_require__(538); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileXYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileXYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileXY; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricWorldToTileXY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalWorldToTileXY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredWorldToTileXY; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileXYFunction; + + +/***/ }), +/* 1408 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var HexagonalWorldToTileY = __webpack_require__(539); +var NOOP = __webpack_require__(1); +var StaggeredWorldToTileY = __webpack_require__(540); +var WorldToTileY = __webpack_require__(248); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalWorldToTileY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredWorldToTileY; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileYFunction; + + +/***/ }), +/* 1409 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HasTileAt = __webpack_require__(541); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -181141,15 +192060,17 @@ var WorldToTileY = __webpack_require__(67); * * @param {number} worldX - The X coordinate of the world position. * @param {number} worldY - The Y coordinate of the world position. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAtWorldXY = function (worldX, worldY, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera); + + var tileX = point.x; + var tileY = point.y; return HasTileAt(tileX, tileY, layer); }; @@ -181158,7 +192079,7 @@ module.exports = HasTileAtWorldXY; /***/ }), -/* 1338 */ +/* 1410 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181167,9 +192088,10 @@ module.exports = HasTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PutTileAt = __webpack_require__(236); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var PutTileAt = __webpack_require__(249); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -181180,28 +192102,27 @@ var WorldToTileY = __webpack_require__(67); * @function Phaser.Tilemaps.Components.PutTileAtWorldXY * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAtWorldXY = function (tile, worldX, worldY, recalculateFaces, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera, layer); - return PutTileAt(tile, tileX, tileY, recalculateFaces, layer); + return PutTileAt(tile, point.x, point.y, recalculateFaces, layer); }; module.exports = PutTileAtWorldXY; /***/ }), -/* 1339 */ +/* 1411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181210,8 +192131,8 @@ module.exports = PutTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CalculateFacesWithin = __webpack_require__(53); -var PutTileAt = __webpack_require__(236); +var CalculateFacesWithin = __webpack_require__(60); +var PutTileAt = __webpack_require__(249); /** * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified @@ -181223,17 +192144,21 @@ var PutTileAt = __webpack_require__(236); * @function Phaser.Tilemaps.Components.PutTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer) { - if (!Array.isArray(tilesArray)) { return null; } if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!Array.isArray(tilesArray)) + { + return null; + } + // Force the input array to be a 2D array if (!Array.isArray(tilesArray[0])) { @@ -181264,7 +192189,7 @@ module.exports = PutTilesAt; /***/ }), -/* 1340 */ +/* 1412 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181273,8 +192198,8 @@ module.exports = PutTilesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var GetRandom = __webpack_require__(196); +var GetTilesWithin = __webpack_require__(26); +var GetRandom = __webpack_require__(201); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -181286,20 +192211,20 @@ var GetRandom = __webpack_require__(196); * @function Phaser.Tilemaps.Components.Randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} indexes - An array of indexes to randomly draw from during randomization. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Randomize = function (tileX, tileY, width, height, indexes, layer) { var i; - var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + var tiles = GetTilesWithin(tileX, tileY, width, height, {}, layer); // If no indices are given, then find all the unique indexes within the specified region - if (indexes === undefined) + if (!indexes) { indexes = []; @@ -181322,7 +192247,7 @@ module.exports = Randomize; /***/ }), -/* 1341 */ +/* 1413 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181331,9 +192256,10 @@ module.exports = Randomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RemoveTileAt = __webpack_require__(505); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var RemoveTileAt = __webpack_require__(542); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -181344,26 +192270,25 @@ var WorldToTileY = __webpack_require__(67); * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} replaceWithNull - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAtWorldXY = function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera, layer); - return RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, layer); + return RemoveTileAt(point.x, point.y, replaceWithNull, recalculateFaces, layer); }; module.exports = RemoveTileAtWorldXY; /***/ }), -/* 1342 */ +/* 1414 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181372,8 +192297,8 @@ module.exports = RemoveTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var Color = __webpack_require__(364); +var GetTilesWithin = __webpack_require__(26); +var Color = __webpack_require__(373); var defaultTileColor = new Color(105, 210, 231, 150); var defaultCollidingTileColor = new Color(243, 134, 48, 200); @@ -181389,13 +192314,7 @@ var defaultFaceColor = new Color(40, 39, 37, 150); * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {object} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {?Phaser.Display.Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at - * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. - * @param {?Phaser.Display.Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled - * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. - * @param {?Phaser.Display.Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting - * tile faces. If set to null, interesting tile faces will not be drawn. + * @param {Phaser.Types.Tilemaps.DebugStyleOptions} styleConfig - An object specifying the colors to use for the debug drawing. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var RenderDebug = function (graphics, styleConfig, layer) @@ -181451,7 +192370,7 @@ module.exports = RenderDebug; /***/ }), -/* 1343 */ +/* 1415 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181460,8 +192379,8 @@ module.exports = RenderDebug; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); var SetLayerCollisionIndex = __webpack_require__(153); /** @@ -181472,20 +192391,23 @@ var SetLayerCollisionIndex = __webpack_require__(153); * @function Phaser.Tilemaps.Components.SetCollision * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {boolean} updateLayer - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. */ var SetCollision = function (indexes, collides, recalculateFaces, layer, updateLayer) { if (collides === undefined) { collides = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } - if (!Array.isArray(indexes)) { indexes = [ indexes ]; } if (updateLayer === undefined) { updateLayer = true; } + if (!Array.isArray(indexes)) + { + indexes = [ indexes ]; + } + // Update the array of colliding indexes for (var i = 0; i < indexes.length; i++) { @@ -181519,7 +192441,7 @@ module.exports = SetCollision; /***/ }), -/* 1344 */ +/* 1416 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181528,8 +192450,8 @@ module.exports = SetCollision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); var SetLayerCollisionIndex = __webpack_require__(153); /** @@ -181541,13 +192463,12 @@ var SetLayerCollisionIndex = __webpack_require__(153); * @function Phaser.Tilemaps.Components.SetCollisionBetween * @since 3.0.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. */ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer, updateLayer) { @@ -181555,15 +192476,18 @@ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, lay if (recalculateFaces === undefined) { recalculateFaces = true; } if (updateLayer === undefined) { updateLayer = true; } - if (start > stop) { return; } + if (start > stop) + { + return; + } - // Update the array of colliding indexes + // Update the array of colliding indexes for (var index = start; index <= stop; index++) { SetLayerCollisionIndex(index, collides, layer); } - // Update the tiles + // Update the tiles if (updateLayer) { for (var ty = 0; ty < layer.height; ty++) @@ -181593,7 +192517,7 @@ module.exports = SetCollisionBetween; /***/ }), -/* 1345 */ +/* 1417 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181602,8 +192526,8 @@ module.exports = SetCollisionBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); var SetLayerCollisionIndex = __webpack_require__(153); /** @@ -181614,16 +192538,20 @@ var SetLayerCollisionIndex = __webpack_require__(153); * @function Phaser.Tilemaps.Components.SetCollisionByExclusion * @since 3.0.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer) { if (collides === undefined) { collides = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } - if (!Array.isArray(indexes)) { indexes = [ indexes ]; } + + if (!Array.isArray(indexes)) + { + indexes = [ indexes ]; + } // Note: this only updates layer.collideIndexes for tile indexes found currently in the layer for (var ty = 0; ty < layer.height; ty++) @@ -181631,6 +192559,7 @@ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, lay for (var tx = 0; tx < layer.width; tx++) { var tile = layer.data[ty][tx]; + if (tile && indexes.indexOf(tile.index) === -1) { SetTileCollision(tile, collides); @@ -181649,7 +192578,7 @@ module.exports = SetCollisionByExclusion; /***/ }), -/* 1346 */ +/* 1418 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181658,9 +192587,9 @@ module.exports = SetCollisionByExclusion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); -var HasValue = __webpack_require__(115); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); +var HasValue = __webpack_require__(123); /** * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property @@ -181675,8 +192604,8 @@ var HasValue = __webpack_require__(115); * @since 3.0.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByProperty = function (properties, collides, recalculateFaces, layer) @@ -181697,6 +192626,7 @@ var SetCollisionByProperty = function (properties, collides, recalculateFaces, l if (!HasValue(tile.properties, property)) { continue; } var values = properties[property]; + if (!Array.isArray(values)) { values = [ values ]; @@ -181723,7 +192653,7 @@ module.exports = SetCollisionByProperty; /***/ }), -/* 1347 */ +/* 1419 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181732,8 +192662,8 @@ module.exports = SetCollisionByProperty; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); /** * Sets collision on the tiles within a layer by checking each tile's collision group data @@ -181744,8 +192674,8 @@ var CalculateFacesWithin = __webpack_require__(53); * @function Phaser.Tilemaps.Components.SetCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer) @@ -181782,7 +192712,7 @@ module.exports = SetCollisionFromCollisionGroup; /***/ }), -/* 1348 */ +/* 1420 */ /***/ (function(module, exports) { /** @@ -181800,7 +192730,7 @@ module.exports = SetCollisionFromCollisionGroup; * @function Phaser.Tilemaps.Components.SetTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -181828,7 +192758,7 @@ module.exports = SetTileIndexCallback; /***/ }), -/* 1349 */ +/* 1421 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181837,7 +192767,7 @@ module.exports = SetTileIndexCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. @@ -181847,10 +192777,10 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.SetTileLocationCallback * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -181869,7 +192799,7 @@ module.exports = SetTileLocationCallback; /***/ }), -/* 1350 */ +/* 1422 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181878,8 +192808,8 @@ module.exports = SetTileLocationCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var ShuffleArray = __webpack_require__(121); +var GetTilesWithin = __webpack_require__(26); +var ShuffleArray = __webpack_require__(127); /** * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given @@ -181890,10 +192820,10 @@ var ShuffleArray = __webpack_require__(121); * @function Phaser.Tilemaps.Components.Shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Shuffle = function (tileX, tileY, width, height, layer) @@ -181914,7 +192844,7 @@ module.exports = Shuffle; /***/ }), -/* 1351 */ +/* 1423 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181923,7 +192853,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -181933,12 +192863,12 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.SwapByIndex * @since 3.0.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer) @@ -181965,7 +192895,7 @@ module.exports = SwapByIndex; /***/ }), -/* 1352 */ +/* 1424 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181974,50 +192904,7 @@ module.exports = SwapByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(151); -var TileToWorldY = __webpack_require__(152); -var Vector2 = __webpack_require__(3); - -/** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @function Phaser.Tilemaps.Components.TileToWorldXY - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {Phaser.Math.Vector2} The XY location in world coordinates. - */ -var TileToWorldXY = function (tileX, tileY, point, camera, layer) -{ - if (point === undefined) { point = new Vector2(0, 0); } - - point.x = TileToWorldX(tileX, camera, layer); - point.y = TileToWorldY(tileY, camera, layer); - - return point; -}; - -module.exports = TileToWorldXY; - - -/***/ }), -/* 1353 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -182037,23 +192924,24 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.WeightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var WeightedRandomize = function (tileX, tileY, width, height, weightedIndexes, layer) { - if (weightedIndexes === undefined) { return; } + if (!weightedIndexes) { return; } var i; var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); var weightTotal = 0; + for (i = 0; i < weightedIndexes.length; i++) { weightTotal += weightedIndexes[i].weight; @@ -182090,51 +192978,7 @@ module.exports = WeightedRandomize; /***/ }), -/* 1354 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); -var Vector2 = __webpack_require__(3); - -/** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @function Phaser.Tilemaps.Components.WorldToTileXY - * @since 3.0.0 - * - * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {Phaser.Math.Vector2} The XY location in tile units. - */ -var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) -{ - if (point === undefined) { point = new Vector2(0, 0); } - - point.x = WorldToTileX(worldX, snapToFloor, camera, layer); - point.y = WorldToTileY(worldY, snapToFloor, camera, layer); - - return point; -}; - -module.exports = WorldToTileXY; - - -/***/ }), -/* 1355 */ +/* 1425 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182149,18 +192993,18 @@ module.exports = WorldToTileXY; module.exports = { - Parse: __webpack_require__(506), - Parse2DArray: __webpack_require__(237), - ParseCSV: __webpack_require__(507), + Parse: __webpack_require__(543), + Parse2DArray: __webpack_require__(250), + ParseCSV: __webpack_require__(544), - Impact: __webpack_require__(1356), - Tiled: __webpack_require__(1357) + Impact: __webpack_require__(1426), + Tiled: __webpack_require__(1427) }; /***/ }), -/* 1356 */ +/* 1426 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182175,15 +193019,15 @@ module.exports = { module.exports = { - ParseTileLayers: __webpack_require__(520), - ParseTilesets: __webpack_require__(521), - ParseWeltmeister: __webpack_require__(519) + ParseTileLayers: __webpack_require__(557), + ParseTilesets: __webpack_require__(558), + ParseWeltmeister: __webpack_require__(556) }; /***/ }), -/* 1357 */ +/* 1427 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182198,23 +193042,23 @@ module.exports = { module.exports = { - AssignTileProperties: __webpack_require__(518), - Base64Decode: __webpack_require__(510), - BuildTilesetIndex: __webpack_require__(517), + AssignTileProperties: __webpack_require__(546), + Base64Decode: __webpack_require__(553), + BuildTilesetIndex: __webpack_require__(547), CreateGroupLayer: __webpack_require__(154), - ParseGID: __webpack_require__(238), - ParseImageLayers: __webpack_require__(511), - ParseJSONTiled: __webpack_require__(508), - ParseObject: __webpack_require__(239), - ParseObjectLayers: __webpack_require__(515), - ParseTileLayers: __webpack_require__(509), - ParseTilesets: __webpack_require__(512) + ParseGID: __webpack_require__(252), + ParseImageLayers: __webpack_require__(548), + ParseJSONTiled: __webpack_require__(545), + ParseObject: __webpack_require__(251), + ParseObjectLayers: __webpack_require__(549), + ParseTileLayers: __webpack_require__(552), + ParseTilesets: __webpack_require__(554) }; /***/ }), -/* 1358 */ +/* 1428 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182228,12 +193072,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1359); + renderWebGL = __webpack_require__(1429); } if (true) { - renderCanvas = __webpack_require__(1360); + renderCanvas = __webpack_require__(1430); } module.exports = { @@ -182245,7 +193089,7 @@ module.exports = { /***/ }), -/* 1359 */ +/* 1429 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182254,27 +193098,25 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. * This method should not be called directly. It is a utility function of the Render module. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderWebGL + * @method Phaser.Tilemaps.TilemapLayer#renderWebGL * @since 3.0.0 * @private * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Tilemaps.TilemapLayer} src - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. */ -var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) +var TilemapLayerWebGLRenderer = function (renderer, src, camera) { - src.cull(camera); + var renderTiles = src.cull(camera); - var renderTiles = src.culledTiles; var tileCount = renderTiles.length; var alpha = camera.alpha * src.alpha; @@ -182284,9 +193126,9 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer } var gidMap = src.gidMap; - var pipeline = renderer.pipelines.set(src.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var getTint = Utils.getTintAppendFloatAlphaAndSwap; + var getTint = Utils.getTintAppendFloatAlpha; var scrollFactorX = src.scrollFactorX; var scrollFactorY = src.scrollFactorY; @@ -182297,75 +193139,66 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer var sx = src.scaleX; var sy = src.scaleY; - var tilesets = src.tileset; + renderer.pipelines.preBatch(src); - // Loop through each tileset in this layer, drawing just the tiles that are in that set each time - // Doing it this way around allows us to batch tiles using the same tileset - for (var c = 0; c < tilesets.length; c++) + for (var i = 0; i < tileCount; i++) { - var currentSet = tilesets[c]; - var texture = currentSet.glTexture; + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords === null) + { + continue; + } + + var texture = tileset.glTexture; + var textureUnit = pipeline.setTexture2D(texture, src); - for (var i = 0; i < tileCount; i++) - { - var tile = renderTiles[i]; + var frameWidth = tileset.tileWidth; + var frameHeight = tileset.tileHeight; - var tileset = gidMap[tile.index]; + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; - if (tileset !== currentSet) - { - // Skip tiles that aren't in this set - continue; - } + var tw = tileset.tileWidth * 0.5; + var th = tileset.tileHeight * 0.5; - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + var tint = getTint(tile.tint, alpha * tile.alpha); - if (tileTexCoords === null) - { - continue; - } - - var frameWidth = tile.width; - var frameHeight = tile.height; - - var frameX = tileTexCoords.x; - var frameY = tileTexCoords.y; - - var tw = tile.width * 0.5; - var th = tile.height * 0.5; - - var tint = getTint(tile.tint, alpha * tile.alpha); - - pipeline.batchTexture( - src, - texture, - texture.width, texture.height, - x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy), - tile.width, tile.height, - sx, sy, - tile.rotation, - tile.flipX, tile.flipY, - scrollFactorX, scrollFactorY, - tw, th, - frameX, frameY, frameWidth, frameHeight, - tint, tint, tint, tint, false, - 0, 0, - camera, - null, - true, - textureUnit - ); - } + pipeline.batchTexture( + src, + texture, + texture.width, texture.height, + x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy), + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, + scrollFactorX, scrollFactorY, + tw, th, + frameX, frameY, frameWidth, frameHeight, + tint, tint, tint, tint, false, + 0, 0, + camera, + null, + true, + textureUnit + ); } + + renderer.pipelines.postBatch(src); }; -module.exports = DynamicTilemapLayerWebGLRenderer; +module.exports = TilemapLayerWebGLRenderer; /***/ }), -/* 1360 */ -/***/ (function(module, exports) { +/* 1430 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -182373,36 +193206,41 @@ module.exports = DynamicTilemapLayerWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + /** * Renders this Game Object with the Canvas Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. * This method should not be called directly. It is a utility function of the Render module. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderCanvas - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#renderCanvas + * @since 3.50.0 * @private * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Tilemaps.TilemapLayer} src - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) { - src.cull(camera); + var renderTiles = src.cull(camera); - var renderTiles = src.culledTiles; var tileCount = renderTiles.length; + var alpha = camera.alpha * src.alpha; - if (tileCount === 0) + if (tileCount === 0 || alpha <= 0) { return; } - var camMatrix = renderer._tempMatrix1; - var layerMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var camMatrix = tempMatrix1; + var layerMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); @@ -182435,8 +193273,6 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe layerMatrix.copyToContext(ctx); } - var alpha = camera.alpha * src.alpha; - if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1) { ctx.imageSmoothingEnabled = false; @@ -182458,482 +193294,9 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe if (tileTexCoords) { - var halfWidth = tile.width / 2; - var halfHeight = tile.height / 2; - - ctx.save(); + var halfWidth = tileset.tileWidth / 2; + var halfHeight = tileset.tileHeight / 2; - ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); - - if (tile.rotation !== 0) - { - ctx.rotate(tile.rotation); - } - - if (tile.flipX || tile.flipY) - { - ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); - } - - ctx.globalAlpha = alpha * tile.alpha; - - ctx.drawImage( - image, - tileTexCoords.x, tileTexCoords.y, - tile.width, tile.height, - -halfWidth, -halfHeight, - tile.width, tile.height - ); - - ctx.restore(); - } - } - - ctx.restore(); -}; - -module.exports = DynamicTilemapLayerCanvasRenderer; - - -/***/ }), -/* 1361 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var renderWebGL = __webpack_require__(1); -var renderCanvas = __webpack_require__(1); - -if (true) -{ - renderWebGL = __webpack_require__(1362); -} - -if (true) -{ - renderCanvas = __webpack_require__(1368); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 1362 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Identity = __webpack_require__(1363); -var Scale = __webpack_require__(1365); -var Translate = __webpack_require__(1366); -var ViewLoad2D = __webpack_require__(1367); - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * A Static Tilemap Layer renders immediately and does not use any batching. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderWebGL - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - */ -var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) -{ - var gl = renderer.gl; - var pipeline = src.pipeline; - - renderer.flush(); - - // Restore when we're done - var pipelineVertexBuffer = pipeline.vertexBuffer; - - Identity(src); - Translate(src, src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0); - Scale(src, src.scaleX, src.scaleY, 1); - ViewLoad2D(src, camera.matrix.matrix); - - renderer.pipelines.set(pipeline); - - // The above alters the uniforms, so make sure we call it _after_ setting the MVP stuff above - renderer.setMatrix4(pipeline.program, 'uModelMatrix', false, src.modelMatrix); - renderer.setMatrix4(pipeline.program, 'uViewMatrix', false, src.viewMatrix); - renderer.setMatrix4(pipeline.program, 'uProjectionMatrix', false, pipeline.projectionMatrix); - - for (var i = 0; i < src.tileset.length; i++) - { - var tileset = src.tileset[i]; - var vertexCount = src.vertexCount[i]; - - src.upload(camera, i); - - if (vertexCount > 0) - { - if (pipeline.forceZero) - { - // Light Pipeline, or similar - pipeline.setGameObject(src, tileset); - } - else - { - renderer.setTextureZero(tileset.glTexture); - } - - gl.drawArrays(gl.TRIANGLES, 0, vertexCount); - } - } - - renderer.resetTextures(); - - // Restore the pipeline buffer - pipeline.vertexBuffer = pipelineVertexBuffer; - - renderer.currentVertexBuffer = pipelineVertexBuffer; - - pipeline.setAttribPointers(); - - // Reset the uniforms - renderer.setMatrix4(pipeline.program, 'uModelMatrix', false, pipeline.modelMatrix); - renderer.setMatrix4(pipeline.program, 'uViewMatrix', false, pipeline.viewMatrix); - renderer.setMatrix4(pipeline.program, 'uProjectionMatrix', false, pipeline.projectionMatrix); -}; - -module.exports = StaticTilemapLayerWebGLRenderer; - - -/***/ }), -/* 1363 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SetIdentity = __webpack_require__(1364); - -/** - * Loads an identity matrix into the model matrix. - * - * @method Phaser.Renderer.WebGL.MVP.Identity - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Identity = function (model) -{ - SetIdentity(model.modelMatrix); - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Identity; - - -/***/ }), -/* 1364 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Loads an identity matrix into the model matrix. - * - * @method Phaser.Renderer.WebGL.MVP.SetIdentity - * @since 3.50.0 - * - * @param {Float32Array} array - The array to set to be an identity matrix. - */ -var SetIdentity = function (array) -{ - array[0] = 1; - array[1] = 0; - array[2] = 0; - array[3] = 0; - array[4] = 0; - array[5] = 1; - array[6] = 0; - array[7] = 0; - array[8] = 0; - array[9] = 0; - array[10] = 1; - array[11] = 0; - array[12] = 0; - array[13] = 0; - array[14] = 0; - array[15] = 1; -}; - -module.exports = SetIdentity; - - -/***/ }), -/* 1365 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Scales the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.Scale - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Scale = function (model, x, y, z) -{ - var modelMatrix = model.modelMatrix; - - modelMatrix[0] = modelMatrix[0] * x; - modelMatrix[1] = modelMatrix[1] * x; - modelMatrix[2] = modelMatrix[2] * x; - modelMatrix[3] = modelMatrix[3] * x; - modelMatrix[4] = modelMatrix[4] * y; - modelMatrix[5] = modelMatrix[5] * y; - modelMatrix[6] = modelMatrix[6] * y; - modelMatrix[7] = modelMatrix[7] * y; - modelMatrix[8] = modelMatrix[8] * z; - modelMatrix[9] = modelMatrix[9] * z; - modelMatrix[10] = modelMatrix[10] * z; - modelMatrix[11] = modelMatrix[11] * z; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Scale; - - -/***/ }), -/* 1366 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Translates the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.Translate - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Translate = function (model, x, y, z) -{ - var modelMatrix = model.modelMatrix; - - modelMatrix[12] = modelMatrix[0] * x + modelMatrix[4] * y + modelMatrix[8] * z + modelMatrix[12]; - modelMatrix[13] = modelMatrix[1] * x + modelMatrix[5] * y + modelMatrix[9] * z + modelMatrix[13]; - modelMatrix[14] = modelMatrix[2] * x + modelMatrix[6] * y + modelMatrix[10] * z + modelMatrix[14]; - modelMatrix[15] = modelMatrix[3] * x + modelMatrix[7] * y + modelMatrix[11] * z + modelMatrix[15]; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Translate; - - -/***/ }), -/* 1367 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ViewLoad2D - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {Float32Array} matrix2D - The Matrix2D. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewLoad2D = function (model, matrix2D) -{ - var vm = model.viewMatrix; - - vm[0] = matrix2D[0]; - vm[1] = matrix2D[1]; - vm[2] = 0; - vm[3] = 0; - vm[4] = matrix2D[2]; - vm[5] = matrix2D[3]; - vm[6] = 0; - vm[7] = 0; - vm[8] = matrix2D[4]; - vm[9] = matrix2D[5]; - vm[10] = 1; - vm[11] = 0; - vm[12] = 0; - vm[13] = 0; - vm[14] = 0; - vm[15] = 1; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewLoad2D; - - -/***/ }), -/* 1368 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderCanvas - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) -{ - src.cull(camera); - - var renderTiles = src.culledTiles; - var tileCount = renderTiles.length; - - if (tileCount === 0) - { - return; - } - - var camMatrix = renderer._tempMatrix1; - var layerMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; - - layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - var ctx = renderer.currentContext; - var gidMap = src.gidMap; - - ctx.save(); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - layerMatrix.e = src.x; - layerMatrix.f = src.y; - - camMatrix.multiply(layerMatrix, calcMatrix); - - calcMatrix.copyToContext(ctx); - } - else - { - // Undo the camera scroll - layerMatrix.e -= camera.scrollX * src.scrollFactorX; - layerMatrix.f -= camera.scrollY * src.scrollFactorY; - - layerMatrix.copyToContext(ctx); - } - - var alpha = camera.alpha * src.alpha; - - if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1) - { - ctx.imageSmoothingEnabled = false; - } - - for (var i = 0; i < tileCount; i++) - { - var tile = renderTiles[i]; - - var tileset = gidMap[tile.index]; - - if (!tileset) - { - continue; - } - - var image = tileset.image.getSourceImage(); - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - - if (tileTexCoords) - { - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - var halfWidth = tileWidth / 2; - var halfHeight = tileHeight / 2; - ctx.save(); ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); @@ -182942,22 +193305,22 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPer { ctx.rotate(tile.rotation); } - + if (tile.flipX || tile.flipY) { ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); } ctx.globalAlpha = alpha * tile.alpha; - + ctx.drawImage( image, tileTexCoords.x, tileTexCoords.y, - tileWidth, tileHeight, + tileset.tileWidth , tileset.Height, -halfWidth, -halfHeight, - tileWidth, tileHeight + tileset.tileWidth , tileset.tileHeight ); - + ctx.restore(); } } @@ -182965,11 +193328,11 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPer ctx.restore(); }; -module.exports = StaticTilemapLayerCanvasRenderer; +module.exports = TilemapLayerCanvasRenderer; /***/ }), -/* 1369 */ +/* 1431 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182978,8 +193341,8 @@ module.exports = StaticTilemapLayerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); -var ParseToTilemap = __webpack_require__(240); +var GameObjectCreator = __webpack_require__(17); +var ParseToTilemap = __webpack_require__(253); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -183013,7 +193376,7 @@ GameObjectCreator.register('tilemap', function (config) /***/ }), -/* 1370 */ +/* 1432 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183023,7 +193386,7 @@ GameObjectCreator.register('tilemap', function (config) */ var GameObjectFactory = __webpack_require__(5); -var ParseToTilemap = __webpack_require__(240); +var ParseToTilemap = __webpack_require__(253); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -183035,15 +193398,15 @@ var ParseToTilemap = __webpack_require__(240); * @since 3.0.0 * * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param {integer} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the + * @param {number} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the * default. - * @param {integer} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the + * @param {number} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the * default. - * @param {integer} [width=10] - The width of the map in tiles. Pass in `null` to leave as the + * @param {number} [width=10] - The width of the map in tiles. Pass in `null` to leave as the * default. - * @param {integer} [height=10] - The height of the map in tiles. Pass in `null` to leave as the + * @param {number} [height=10] - The height of the map in tiles. Pass in `null` to leave as the * default. - * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * @param {number[][]} [data] - Instead of loading from the cache, you can also load directly from * a 2D array of tile indexes. Pass in `null` for no data. * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty @@ -183079,7 +193442,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /***/ }), -/* 1371 */ +/* 1433 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183094,14 +193457,14 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt module.exports = { - Clock: __webpack_require__(1372), - TimerEvent: __webpack_require__(525) + Clock: __webpack_require__(1434), + TimerEvent: __webpack_require__(561) }; /***/ }), -/* 1372 */ +/* 1434 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183111,10 +193474,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); -var TimerEvent = __webpack_require__(525); -var Remove = __webpack_require__(96); +var TimerEvent = __webpack_require__(561); +var Remove = __webpack_require__(87); /** * @classdesc @@ -183276,7 +193639,7 @@ var Clock = new Class({ { var event; - if (config instanceof Phaser.Time.TimerEvent) + if (config instanceof TimerEvent) { event = config; @@ -183557,7 +193920,7 @@ module.exports = Clock; /***/ }), -/* 1373 */ +/* 1435 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183566,8 +193929,8 @@ module.exports = Clock; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(91); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(96); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Tweens @@ -183575,13 +193938,13 @@ var Extend = __webpack_require__(19); var Tweens = { - Builders: __webpack_require__(1374), - Events: __webpack_require__(245), + Builders: __webpack_require__(1436), + Events: __webpack_require__(258), - TweenManager: __webpack_require__(1390), - Tween: __webpack_require__(244), - TweenData: __webpack_require__(246), - Timeline: __webpack_require__(531) + TweenManager: __webpack_require__(1452), + Tween: __webpack_require__(257), + TweenData: __webpack_require__(259), + Timeline: __webpack_require__(567) }; @@ -183592,7 +193955,7 @@ module.exports = Tweens; /***/ }), -/* 1374 */ +/* 1436 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -183607,23 +193970,23 @@ module.exports = Tweens; module.exports = { - GetBoolean: __webpack_require__(90), - GetEaseFunction: __webpack_require__(71), + GetBoolean: __webpack_require__(95), + GetEaseFunction: __webpack_require__(78), GetNewValue: __webpack_require__(155), - GetProps: __webpack_require__(526), - GetTargets: __webpack_require__(241), - GetTweens: __webpack_require__(527), - GetValueOp: __webpack_require__(242), - NumberTweenBuilder: __webpack_require__(528), - StaggerBuilder: __webpack_require__(529), - TimelineBuilder: __webpack_require__(530), + GetProps: __webpack_require__(562), + GetTargets: __webpack_require__(254), + GetTweens: __webpack_require__(563), + GetValueOp: __webpack_require__(255), + NumberTweenBuilder: __webpack_require__(564), + StaggerBuilder: __webpack_require__(565), + TimelineBuilder: __webpack_require__(566), TweenBuilder: __webpack_require__(156) }; /***/ }), -/* 1375 */ +/* 1437 */ /***/ (function(module, exports) { /** @@ -183701,7 +194064,7 @@ module.exports = [ /***/ }), -/* 1376 */ +/* 1438 */ /***/ (function(module, exports) { /** @@ -183737,7 +194100,7 @@ module.exports = 'complete'; /***/ }), -/* 1377 */ +/* 1439 */ /***/ (function(module, exports) { /** @@ -183774,7 +194137,7 @@ module.exports = 'loop'; /***/ }), -/* 1378 */ +/* 1440 */ /***/ (function(module, exports) { /** @@ -183811,7 +194174,7 @@ module.exports = 'pause'; /***/ }), -/* 1379 */ +/* 1441 */ /***/ (function(module, exports) { /** @@ -183848,7 +194211,7 @@ module.exports = 'resume'; /***/ }), -/* 1380 */ +/* 1442 */ /***/ (function(module, exports) { /** @@ -183884,7 +194247,7 @@ module.exports = 'start'; /***/ }), -/* 1381 */ +/* 1443 */ /***/ (function(module, exports) { /** @@ -183921,7 +194284,7 @@ module.exports = 'update'; /***/ }), -/* 1382 */ +/* 1444 */ /***/ (function(module, exports) { /** @@ -183961,7 +194324,7 @@ module.exports = 'active'; /***/ }), -/* 1383 */ +/* 1445 */ /***/ (function(module, exports) { /** @@ -184002,7 +194365,7 @@ module.exports = 'complete'; /***/ }), -/* 1384 */ +/* 1446 */ /***/ (function(module, exports) { /** @@ -184046,7 +194409,7 @@ module.exports = 'loop'; /***/ }), -/* 1385 */ +/* 1447 */ /***/ (function(module, exports) { /** @@ -184091,7 +194454,7 @@ module.exports = 'repeat'; /***/ }), -/* 1386 */ +/* 1448 */ /***/ (function(module, exports) { /** @@ -184131,7 +194494,7 @@ module.exports = 'start'; /***/ }), -/* 1387 */ +/* 1449 */ /***/ (function(module, exports) { /** @@ -184167,7 +194530,7 @@ module.exports = 'stop'; /***/ }), -/* 1388 */ +/* 1450 */ /***/ (function(module, exports) { /** @@ -184210,7 +194573,7 @@ module.exports = 'update'; /***/ }), -/* 1389 */ +/* 1451 */ /***/ (function(module, exports) { /** @@ -184256,7 +194619,7 @@ module.exports = 'yoyo'; /***/ }), -/* 1390 */ +/* 1452 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184265,14 +194628,14 @@ module.exports = 'yoyo'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(96); +var ArrayRemove = __webpack_require__(87); var Class = __webpack_require__(0); -var NumberTweenBuilder = __webpack_require__(528); -var PluginCache = __webpack_require__(23); +var NumberTweenBuilder = __webpack_require__(564); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); -var StaggerBuilder = __webpack_require__(529); -var TimelineBuilder = __webpack_require__(530); -var TWEEN_CONST = __webpack_require__(91); +var StaggerBuilder = __webpack_require__(565); +var TimelineBuilder = __webpack_require__(566); +var TWEEN_CONST = __webpack_require__(96); var TweenBuilder = __webpack_require__(156); /** @@ -184366,7 +194729,7 @@ var TweenManager = new Class({ * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame. * * @name Phaser.Tweens.TweenManager#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -185045,7 +195408,7 @@ module.exports = TweenManager; /***/ }), -/* 1391 */ +/* 1453 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185060,17 +195423,17 @@ module.exports = TweenManager; module.exports = { - Array: __webpack_require__(194), - Base64: __webpack_require__(1392), - Objects: __webpack_require__(1394), - String: __webpack_require__(1398), + Array: __webpack_require__(199), + Base64: __webpack_require__(1454), + Objects: __webpack_require__(1456), + String: __webpack_require__(1460), NOOP: __webpack_require__(1) }; /***/ }), -/* 1392 */ +/* 1454 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185085,14 +195448,14 @@ module.exports = { module.exports = { - ArrayBufferToBase64: __webpack_require__(1393), - Base64ToArrayBuffer: __webpack_require__(400) + ArrayBufferToBase64: __webpack_require__(1455), + Base64ToArrayBuffer: __webpack_require__(410) }; /***/ }), -/* 1393 */ +/* 1455 */ /***/ (function(module, exports) { /** @@ -185150,7 +195513,7 @@ module.exports = ArrayBufferToBase64; /***/ }), -/* 1394 */ +/* 1456 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185165,26 +195528,27 @@ module.exports = ArrayBufferToBase64; module.exports = { - Clone: __webpack_require__(69), - Extend: __webpack_require__(19), + Clone: __webpack_require__(76), + DeepCopy: __webpack_require__(167), + Extend: __webpack_require__(18), GetAdvancedValue: __webpack_require__(15), GetFastValue: __webpack_require__(2), - GetMinMaxValue: __webpack_require__(1395), + GetMinMaxValue: __webpack_require__(1457), GetValue: __webpack_require__(6), - HasAll: __webpack_require__(1396), - HasAny: __webpack_require__(422), - HasValue: __webpack_require__(115), + HasAll: __webpack_require__(1458), + HasAny: __webpack_require__(432), + HasValue: __webpack_require__(123), IsPlainObject: __webpack_require__(7), - Merge: __webpack_require__(134), - MergeRight: __webpack_require__(1397), - Pick: __webpack_require__(514), - SetValue: __webpack_require__(445) + Merge: __webpack_require__(140), + MergeRight: __webpack_require__(1459), + Pick: __webpack_require__(550), + SetValue: __webpack_require__(455) }; /***/ }), -/* 1395 */ +/* 1457 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185194,7 +195558,7 @@ module.exports = { */ var GetValue = __webpack_require__(6); -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); /** * Retrieves and clamps a numerical value from an object. @@ -185223,7 +195587,7 @@ module.exports = GetMinMaxValue; /***/ }), -/* 1396 */ +/* 1458 */ /***/ (function(module, exports) { /** @@ -185260,7 +195624,7 @@ module.exports = HasAll; /***/ }), -/* 1397 */ +/* 1459 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185269,7 +195633,7 @@ module.exports = HasAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Creates a new Object using all values from obj1. @@ -185303,7 +195667,7 @@ module.exports = MergeRight; /***/ }), -/* 1398 */ +/* 1460 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185318,18 +195682,18 @@ module.exports = MergeRight; module.exports = { - Format: __webpack_require__(1399), - Pad: __webpack_require__(173), - RemoveAt: __webpack_require__(1400), - Reverse: __webpack_require__(1401), - UppercaseFirst: __webpack_require__(191), - UUID: __webpack_require__(207) + Format: __webpack_require__(1461), + Pad: __webpack_require__(178), + RemoveAt: __webpack_require__(1462), + Reverse: __webpack_require__(1463), + UppercaseFirst: __webpack_require__(196), + UUID: __webpack_require__(213) }; /***/ }), -/* 1399 */ +/* 1461 */ /***/ (function(module, exports) { /** @@ -185364,7 +195728,7 @@ module.exports = Format; /***/ }), -/* 1400 */ +/* 1462 */ /***/ (function(module, exports) { /** @@ -185400,7 +195764,7 @@ module.exports = RemoveAt; /***/ }), -/* 1401 */ +/* 1463 */ /***/ (function(module, exports) { /** @@ -185429,7 +195793,7 @@ module.exports = Reverse; /***/ }), -/* 1402 */ +/* 1464 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185445,79 +195809,81 @@ module.exports = Reverse; module.exports = { - SoundManagerCreator: __webpack_require__(393), + SoundManagerCreator: __webpack_require__(403), - Events: __webpack_require__(61), + Events: __webpack_require__(66), - BaseSound: __webpack_require__(136), - BaseSoundManager: __webpack_require__(135), + BaseSound: __webpack_require__(142), + BaseSoundManager: __webpack_require__(141), - WebAudioSound: __webpack_require__(401), - WebAudioSoundManager: __webpack_require__(399), + WebAudioSound: __webpack_require__(411), + WebAudioSoundManager: __webpack_require__(409), - HTML5AudioSound: __webpack_require__(396), - HTML5AudioSoundManager: __webpack_require__(394), + HTML5AudioSound: __webpack_require__(406), + HTML5AudioSoundManager: __webpack_require__(404), - NoAudioSound: __webpack_require__(398), - NoAudioSoundManager: __webpack_require__(397) + NoAudioSound: __webpack_require__(408), + NoAudioSoundManager: __webpack_require__(407) }; /***/ }), -/* 1403 */, -/* 1404 */, -/* 1405 */, -/* 1406 */, -/* 1407 */, -/* 1408 */, -/* 1409 */, -/* 1410 */, -/* 1411 */, -/* 1412 */, -/* 1413 */, -/* 1414 */, -/* 1415 */, -/* 1416 */, -/* 1417 */, -/* 1418 */, -/* 1419 */, -/* 1420 */, -/* 1421 */, -/* 1422 */, -/* 1423 */, -/* 1424 */, -/* 1425 */, -/* 1426 */, -/* 1427 */, -/* 1428 */, -/* 1429 */, -/* 1430 */, -/* 1431 */, -/* 1432 */, -/* 1433 */, -/* 1434 */, -/* 1435 */, -/* 1436 */, -/* 1437 */, -/* 1438 */, -/* 1439 */, -/* 1440 */, -/* 1441 */, -/* 1442 */, -/* 1443 */, -/* 1444 */, -/* 1445 */, -/* 1446 */, -/* 1447 */, -/* 1448 */, -/* 1449 */, -/* 1450 */, -/* 1451 */, -/* 1452 */, -/* 1453 */, -/* 1454 */, -/* 1455 */ +/* 1465 */, +/* 1466 */, +/* 1467 */, +/* 1468 */, +/* 1469 */, +/* 1470 */, +/* 1471 */, +/* 1472 */, +/* 1473 */, +/* 1474 */, +/* 1475 */, +/* 1476 */, +/* 1477 */, +/* 1478 */, +/* 1479 */, +/* 1480 */, +/* 1481 */, +/* 1482 */, +/* 1483 */, +/* 1484 */, +/* 1485 */, +/* 1486 */, +/* 1487 */, +/* 1488 */, +/* 1489 */, +/* 1490 */, +/* 1491 */, +/* 1492 */, +/* 1493 */, +/* 1494 */, +/* 1495 */, +/* 1496 */, +/* 1497 */, +/* 1498 */, +/* 1499 */, +/* 1500 */, +/* 1501 */, +/* 1502 */, +/* 1503 */, +/* 1504 */, +/* 1505 */, +/* 1506 */, +/* 1507 */, +/* 1508 */, +/* 1509 */, +/* 1510 */, +/* 1511 */, +/* 1512 */, +/* 1513 */, +/* 1514 */, +/* 1515 */, +/* 1516 */, +/* 1517 */, +/* 1518 */, +/* 1519 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -185526,10 +195892,10 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -__webpack_require__(547); +__webpack_require__(586); -var CONST = __webpack_require__(34); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(39); +var Extend = __webpack_require__(18); /** * @namespace Phaser @@ -185544,37 +195910,37 @@ var Extend = __webpack_require__(19); var Phaser = { - Actions: __webpack_require__(252), - Animations: __webpack_require__(651), - Cache: __webpack_require__(663), - Cameras: __webpack_require__(666), - Core: __webpack_require__(754), + Actions: __webpack_require__(267), + Animations: __webpack_require__(691), + Cache: __webpack_require__(703), + Cameras: __webpack_require__(706), + Core: __webpack_require__(795), Class: __webpack_require__(0), - Create: __webpack_require__(819), - Curves: __webpack_require__(825), - Data: __webpack_require__(827), - Display: __webpack_require__(829), - DOM: __webpack_require__(847), - Events: __webpack_require__(848), - Game: __webpack_require__(850), - GameObjects: __webpack_require__(940), - Geom: __webpack_require__(448), - Input: __webpack_require__(1224), - Loader: __webpack_require__(1257), - Math: __webpack_require__(180), + Create: __webpack_require__(874), + Curves: __webpack_require__(880), + Data: __webpack_require__(882), + Display: __webpack_require__(884), + DOM: __webpack_require__(903), + Events: __webpack_require__(904), + Game: __webpack_require__(906), + GameObjects: __webpack_require__(996), + Geom: __webpack_require__(460), + Input: __webpack_require__(1288), + Loader: __webpack_require__(1318), + Math: __webpack_require__(185), Physics: { - Arcade: __webpack_require__(1283) + Arcade: __webpack_require__(1346) }, - Plugins: __webpack_require__(1317), - Scale: __webpack_require__(1319), - Scene: __webpack_require__(385), - Scenes: __webpack_require__(1320), - Structs: __webpack_require__(1322), - Textures: __webpack_require__(1323), - Tilemaps: __webpack_require__(1325), - Time: __webpack_require__(1371), - Tweens: __webpack_require__(1373), - Utils: __webpack_require__(1391) + Plugins: __webpack_require__(1383), + Scale: __webpack_require__(1385), + Scene: __webpack_require__(395), + Scenes: __webpack_require__(1386), + Structs: __webpack_require__(1388), + Textures: __webpack_require__(1389), + Tilemaps: __webpack_require__(1391), + Time: __webpack_require__(1433), + Tweens: __webpack_require__(1435), + Utils: __webpack_require__(1453) }; @@ -185584,7 +195950,7 @@ Phaser = Extend(false, Phaser, CONST); if (true) { - Phaser.Sound = __webpack_require__(1402); + Phaser.Sound = __webpack_require__(1464); } // Export it @@ -185599,7 +195965,7 @@ global.Phaser = Phaser; * -- Dick Brandon */ -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(546))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(585))) /***/ }) /******/ ]); diff --git a/dist/phaser-arcade-physics.min.js b/dist/phaser-arcade-physics.min.js index d24227804..60e304209 100644 --- a/dist/phaser-arcade-physics.min.js +++ b/dist/phaser-arcade-physics.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return n={},s.m=i=[function(t,e){function r(t,e,i,n){for(var s in e)if(e.hasOwnProperty(s)){var r=(u=e,l=s,f=d=void 0,f=(c=i)?u[l]:Object.getOwnPropertyDescriptor(u,l),!c&&f.value&&"object"==typeof f.value&&(f=f.value),!(!f||!((d=f).get&&"function"==typeof d.get||d.set&&"function"==typeof d.set))&&(void 0===f.enumerable&&(f.enumerable=!0),void 0===f.configurable&&(f.configurable=!0),f));if(!1!==r){if(o=(n||t).prototype,a=s,h=void 0,(h=Object.getOwnPropertyDescriptor(o,a))&&(h.value&&"object"==typeof h.value&&(h=h.value),!1===h.configurable)){if(p.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,s,r)}else t.prototype[s]=e[s]}var o,a,h,u,l,c,d,f}function o(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;nr.width&&(i=Math.max(r.width-t,0)),e+n>r.height&&(n=Math.max(r.height-e,0));for(var u=[],l=e;lthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=u},function(t,e,i){var n=i(13);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){t.exports={DESTROY:i(671),FADE_IN_COMPLETE:i(672),FADE_IN_START:i(673),FADE_OUT_COMPLETE:i(674),FADE_OUT_START:i(675),FLASH_COMPLETE:i(676),FLASH_START:i(677),PAN_COMPLETE:i(678),PAN_START:i(679),POST_RENDER:i(680),PRE_RENDER:i(681),ROTATE_COMPLETE:i(682),ROTATE_START:i(683),SHAKE_COMPLETE:i(684),SHAKE_START:i(685),ZOOM_COMPLETE:i(686),ZOOM_START:i(687)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},,function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&(t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var d=i(150),f=i(24);t.exports=function(t,e,i,n,s){for(var r,o,a,h,u=f(t,e,i,n,null,s),l=0;l=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,s,r,o,a,h,u,l=e&&e.length,c=l?e[0]*i:t.length,d=g(t,0,c,i,!0),f=[];if(!d||d.next===d.prev)return f;if(l&&(d=function(t,e,i,n){var s,r,o,a,h,u=[];for(s=0,r=e.length;s=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&o=n.x&&n.x>=l&&s!==n.x&&T(ri.x||n.x===i.x&&function(t,e){return w(t.prev,t,e.prev)<0&&w(e.next,t,t.next)<0}(i,n)))&&(i=n,d=h)),n=n.next,n!==u;);return i}(t,e))&&(i=_(e,t),v(e,e.next),v(i,i.next))}}(u[s],i),i=v(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=r=t[0],s=o=t[1];for(var p=i;pr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,l=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=x(a,h,e,i,n),d=x(u,l,e,i,n),f=t.prevZ,p=t.nextZ;for(;f&&f.z>=c&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}return!0}(t,n,s,r):function(t){var e=t.prev,i=t,n=t.next;if(0<=w(e,i,n))return!1;var s=t.next.next;for(;s!==t.prev;){if(T(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;s=s.next}return!0}(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),d(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?m(t=function(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!l(s,r)&&c(s,n,n.next,r)&&E(s,r)&&E(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),d(n),d(n.next),n=t=r),n=n.next}while(n!==t);return v(n)}(v(t),e,i),e,i,n,s,r,2):2===o&&function(t,e,i,n,s,r){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&c(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;for(;i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next,i!==t;);return n}(t,e)&&(w(t.prev,t,e.prev)||w(t,e.prev,e))||l(t,e)&&0=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function u(t){return 0=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t;this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(0),s=i(18),c=i(22),r=i(8),d=i(2),f=i(7),o=new n({Extends:c,initialize:function t(e,i,n,s,r){var o,a,h="png";f(i)&&(i=d(a=i,"key"),n=d(a,"url"),o=d(a,"normalMap"),s=d(a,"xhrSettings"),h=d(a,"extension",h),r=d(a,"frameConfig")),Array.isArray(n)&&(o=n[1],n=n[0]);var u,l={type:"image",cache:e.textureManager,extension:h,responseType:"blob",key:i,url:n,xhrSettings:s,config:r};c.call(this,e,l),o&&((u=new t(e,this.key,o,s,r)).type="normalMap",this.setLink(u),e.addFile(u))},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){c.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){c.revokeObjectURL(t.data),t.onProcessError()},c.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});r.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e,i){var r=i(157),n=i(0),s=i(11),o=i(14),a=i(29),h=i(991),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,h],initialize:function(t,e,i,n,s){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=u},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new n(this.x,this.y,this.z)},crossVectors:function(t,e){var i=t.x,n=t.y,s=t.z,r=e.x,o=e.y,a=e.z;return this.x=n*a-s*o,this.y=s*r-i*a,this.z=i*o-n*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return 0=t.length)){for(var i=t.length-1,n=t[e],s=e;sh||a.y>u)?(l=Math.max(a.x,e),c=Math.max(a.y,i),E=d=Math.min(a.r,h)-l,_=f=Math.min(a.b,u)-c,T=r?p+(v-(l-a.x)-d):p+(l-a.x),w=o?g+(m-(c-a.y)-f):g+(c-a.y),e=l,i=c,n=d,s=f):_=E=w=T=0):(r&&(T=p+(v-e-n)),o&&(w=g+(m-i-s)));var S=this.source.width,A=this.source.height;return t.u0=Math.max(0,T/S),t.v0=Math.max(0,w/A),t.u1=Math.min(1,(T+E)/S),t.v1=Math.min(1,(w+_)/A),t.x=e,t.y=i,t.cx=T,t.cy=w,t.cw=E,t.ch=_,t.width=n,t.height=s,t.flipX=r,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,s,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=n,this.u1=s,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new r(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=r},function(t,e,i){var n=i(0),s=i(99),r=i(412),o=i(413),a=i(49),h=i(167),u=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var U=i(252),n=i(0),r=i(29),s=i(193),z=i(2),G=i(6),o=i(7),W=i(404),a=i(141),h=i(76),u=new n({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?o(e[0])&&(i=e,e=null):o(e)&&(i=e,e=null),this.scene=t,this.children=new a,this.isParent=!0,this.type="Group",this.classType=z(i,"classType",h),this.name=z(i,"name",""),this.active=z(i,"active",!0),this.maxSize=z(i,"maxSize",-1),this.defaultKey=z(i,"defaultKey",null),this.defaultFrame=z(i,"defaultFrame",null),this.runChildUpdate=z(i,"runChildUpdate",!1),this.createCallback=z(i,"createCallback",null),this.removeCallback=z(i,"removeCallback",null),this.createMultipleCallback=z(i,"createMultipleCallback",null),this.internalCreateCallback=z(i,"internalCreateCallback",null),this.internalRemoveCallback=z(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i=this.firstgid&&t=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(t){void 0===t&&(t=!1);var e=this.vertexBuffer,i=this.program,n=this.renderer;return n.setProgram(i),n.setVertexBuffer(e),this.setAttribPointers(t),this},setAttribPointers:function(t){void 0===t&&(t=!1);for(var e=this.gl,i=this.attributes,n=this.vertexSize,s=this.program,r=0;rthis.vertexCapacity&&this.flush();var N=this.setGameObject(t),Y=t._isTinted&&t.tintFill;this.batchQuad(A,C,M,O,R,P,L,D,u,l,c,d,F,k,I,B,Y,h,N)},batchQuad:function(t,e,i,n,s,r,o,a,h,u,l,c,d,f,p,g,v,m,y){void 0===y&&(y=this.currentUnit);var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,y=this.setTexture2D(m));var T=this.vertexViewF32,w=this.vertexViewU32,E=this.vertexCount*this.vertexComponentCount-1;return T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=u,T[++E]=y,T[++E]=v,w[++E]=d,T[++E]=i,T[++E]=n,T[++E]=h,T[++E]=c,T[++E]=y,T[++E]=v,w[++E]=p,T[++E]=s,T[++E]=r,T[++E]=l,T[++E]=c,T[++E]=y,T[++E]=v,w[++E]=g,T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=u,T[++E]=y,T[++E]=v,w[++E]=d,T[++E]=s,T[++E]=r,T[++E]=l,T[++E]=c,T[++E]=y,T[++E]=v,w[++E]=g,T[++E]=o,T[++E]=a,T[++E]=l,T[++E]=u,T[++E]=y,T[++E]=v,w[++E]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,u,l,c,d,f,p,g){void 0===g&&(g=this.currentUnit);var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),v=!0,g=this.setTexture2D(p));var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=g,m[++x]=f,y[++x]=l,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=u,m[++x]=g,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=u,m[++x]=g,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,u,l,c,d,f,p,g,v,m,y,x,T,w,E,_,b,S,A,C,M,O,R,P){this.renderer.pipelines.set(this,t);var L,D,F,k=this._tempMatrix1,I=this._tempMatrix2,B=this._tempMatrix3,N=m/i+A,Y=y/n+C,X=(m+x)/i+A,U=(y+T)/n+C,z=o,G=a,W=-g,V=-v;t.isCropped&&(z=(L=t._crop).width,G=L.height,o=L.width,a=L.height,D=m=L.x,F=y=L.y,c&&(D=x-L.x-L.width),d&&!e.isRenderTexture&&(F=T-L.y-L.height),N=D/i+A,Y=F/n+C,X=(D+L.width)/i+A,U=(F+L.height)/n+C,W=-g+m,V=-v+y),c&&(z*=-1,W+=o),(d^=!R&&e.isRenderTexture?1:0)&&(G*=-1,V+=a);var H=W+z,j=V+G;I.applyITRS(s,r,l,h,u),k.copyFrom(M.matrix),O?(k.multiplyWithOffset(O,-M.scrollX*f,-M.scrollY*p),I.e=s,I.f=r):(I.e-=M.scrollX*f,I.f-=M.scrollY*p),k.multiply(I,B);var K=B.getX(W,V),q=B.getY(W,V),Z=B.getX(W,j),J=B.getY(W,j),Q=B.getX(H,j),$=B.getY(H,j),tt=B.getX(H,V),et=B.getY(H,V);M.roundPixels&&(K=Math.round(K),q=Math.round(q),Z=Math.round(Z),J=Math.round(J),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt),et=Math.round(et)),void 0===P&&(P=this.renderer.setTexture2D(e)),this.batchQuad(K,q,Z,J,Q,$,tt,et,N,Y,X,U,w,E,_,b,S,e,P)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.pipelines.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,l=i+t.height;o?a.multiply(o,h):h=a;var c=h.getX(e,i),d=h.getY(e,i),f=h.getX(e,l),p=h.getY(e,l),g=h.getX(u,l),v=h.getY(u,l),m=h.getX(u,i),y=h.getY(u,i),x=this.renderer.setTextureSource(t.source);n=X.getTintAppendFloatAlpha(n,s),this.batchQuad(c,d,f,p,g,v,m,y,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,x)},drawFillRect:function(t,e,i,n,s,r){t=Math.floor(t),e=Math.floor(e);var o=Math.floor(t+i),a=Math.floor(e+n),h=this.renderer.blankTexture.glTexture,u=this.renderer.setTexture2D(h),l=X.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,l,l,l,l,2,h,u)},batchFillRect:function(t,e,i,n,s,r){this.renderer.pipelines.set(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,u=o.getX(t,e),l=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1,E=this.fillTint;this.batchQuad(u,l,c,d,f,p,g,v,y,x,T,w,E.TL,E.TR,E.BL,E.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.pipelines.set(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var u=h.getX(t,e),l=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(u,l,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var u=this.tempTriangle;u[0].x=t,u[0].y=e,u[0].width=o,u[1].x=i,u[1].y=n,u[1].width=o,u[2].x=s,u[2].y=r,u[2].width=o,u[3].x=t,u[3].y=e,u[3].width=o,this.batchStrokePath(u,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var s,r,o=t.length,a=this.polygonCache,h=this.fillTint.TL,u=this.fillTint.TR,l=this.fillTint.BL,c=this.tintEffect,d=0;d>16)+(65280&t)+((255&t)<<16)}},function(t,e,i){var n=i(0),a=i(293),s=new n({initialize:function(t,e){this.parent=t,(this.events=e)||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;ne.right||t.y>e.bottom)}},function(t,e,i){var u=i(6),l={},n={register:function(t,e,i,n,s){l[t]={plugin:e,mapping:i,settingsKey:n,configKey:s}},getPlugin:function(t){return l[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,n=e.game.config;for(var s in l){var r=l[s].plugin,o=l[s].mapping,a=l[s].settingsKey,h=l[s].configKey;u(i,a,n[h])&&(t[o]=new r(t))}},remove:function(t){l.hasOwnProperty(t)&&delete l[t]}};t.exports=n},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1239),ANY_KEY_UP:i(1240),COMBO_MATCH:i(1241),DOWN:i(1242),KEY_DOWN:i(1243),KEY_UP:i(1244),UP:i(1245)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:n,timeout:s,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},function(t,e,i){var n=i(0),s=i(228),r=i(76),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){t.exports={CalculateFacesAt:i(235),CalculateFacesWithin:i(53),Copy:i(1326),CreateFromTiles:i(1327),CullTiles:i(1328),Fill:i(1329),FilterTiles:i(1330),FindByIndex:i(1331),FindTile:i(1332),ForEachTile:i(1333),GetTileAt:i(150),GetTileAtWorldXY:i(1334),GetTilesWithin:i(24),GetTilesWithinShape:i(1335),GetTilesWithinWorldXY:i(1336),HasTileAt:i(504),HasTileAtWorldXY:i(1337),IsInLayerBounds:i(104),PutTileAt:i(236),PutTileAtWorldXY:i(1338),PutTilesAt:i(1339),Randomize:i(1340),RemoveTileAt:i(505),RemoveTileAtWorldXY:i(1341),RenderDebug:i(1342),ReplaceByIndex:i(503),SetCollision:i(1343),SetCollisionBetween:i(1344),SetCollisionByExclusion:i(1345),SetCollisionByProperty:i(1346),SetCollisionFromCollisionGroup:i(1347),SetLayerCollisionIndex:i(153),SetTileCollision:i(65),SetTileIndexCallback:i(1348),SetTileLocationCallback:i(1349),Shuffle:i(1350),SwapByIndex:i(1351),TileToWorldX:i(151),TileToWorldXY:i(1352),TileToWorldY:i(152),WeightedRandomize:i(1353),WorldToTileX:i(66),WorldToTileXY:i(1354),WorldToTileY:i(67)}},function(t,e,i){var r=i(104);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),r(t,e,n)){var s=n.data[e][t]||null;return null!==s&&(-1!==s.index||i)?s:null}return null}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){var r=i(2);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+r(e,"startx",0)*t.tilewidth+r(e,"offsetx",0),s=e.y+r(e,"starty",0)*t.tileheight+r(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+s}}},function(t,e){t.exports=function(o,a,t){return o.hasOwnProperty(a)?"function"==typeof o[a]?function(t,e,i,n,s,r){return o[a](t,e,i,n,s,r)}:function(){return o[a]}:"function"==typeof t?t:function(){return t}}},function(t,e,i){var P=i(243),L=i(15),D=i(90),F=i(71),k=i(155),I=i(526),B=i(241),N=i(6),Y=i(242),X=i(244),U=i(246);t.exports=function(t,e,i){void 0===i&&(i=P);for(var n=i.targets?i.targets:B(e),s=I(e),r=k(e,"delay",i.delay),o=k(e,"duration",i.duration),a=N(e,"easeParams",i.easeParams),h=F(N(e,"ease",i.ease),a),u=k(e,"hold",i.hold),l=k(e,"repeat",i.repeat),c=k(e,"repeatDelay",i.repeatDelay),d=D(e,"yoyo",i.yoyo),f=D(e,"flipX",i.flipX),p=D(e,"flipY",i.flipY),g=[],v=0;vh.getTotalFrames()&&(s=0),r=h.frames[s],0!==s||this.forward||(r=h.getLastFrame()),this.currentFrame=r):console.warn("Missing animation: "+a),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){var i,n;return this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e):(this.delayCounter=e,this.play(t,!0)),this.parent},playAfterRepeat:function(t,e){var i,n;return void 0===e&&(e=1),this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e):this.play(t),this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return n;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(0this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick))for(var n=0;this.forward?i.nextFrame(this):i.previousFrame(this),n++,this.accumulator>this.nextTick&&n<60;);}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(r.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims&&this.anims.get(t)},exists:function(t){return this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new o(this,e,t),this.anims||(this.anims=new s),this.anims.set(e,i))),i},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=a},,function(t,e,i){var n=i(4);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e,i){var a=i(4);t.exports=function(t,e){void 0===e&&(e=new a);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),s=1=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(1+(s-r)).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=i(307),s=i(310),r=i(312),o=i(313);t.exports=function(t){switch(typeof t){case"string":return("rgb"===t.substr(0,3).toLowerCase()?o:n)(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var a=i(175);function h(t,e,i,n){var s=(t+6*e)%6,r=Math.min(s,4-s,1);return Math.round(255*(n-n*i*Math.max(0,r)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var s=h(5,t,e,i),r=h(3,t,e,i),o=h(1,t,e,i);return n?n.setTo?n.setTo(s,r,o,n.alpha,!1):(n.r=s,n.g=r,n.b=o,n.color=a(s,r,o),n):{r:s,g:r,b:o,color:a(s,r,o)}}},function(t,e){var i="";function n(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;is.width&&(t=s.width-r.cutX),r.cutY+e>s.height&&(e=s.height-r.cutY),r.setSize(t,e,r.cutX,r.cutY)),this.updateDisplayOrigin();var a=this.input;return a&&!a.customHitArea&&(a.hitArea.width=t,a.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){var o=this.gl,a=this.frame,h=this.texture,u=this.camera,l=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=a.cutWidth),void 0===r&&(r=a.cutHeight);var c,d,f,p,g,v,m,y,x,T,w=255&(t>>16|0),E=255&(t>>8|0),_=255&(0|t);return u.preRender(1,1),o?(c=u._cx,d=u._cy,f=u._cw,p=u._ch,l.resetTextures(!0),l.pushScissor(c,d,f,-p),l.setFramebuffer(this.framebuffer,!1),g=this.pipeline,v=h.width,m=h.height,y=g.width/v,x=g.height/m,g.drawFillRect(i*y,(m-r-n)*x,s*y,r*x,b.getTintFromFloats(w/255,E/255,_/255,1),e),g.flush(),l.setFramebuffer(null,!1),l.popScissor()):(T=this.context,l.setContext(T),T.fillStyle="rgba("+w+","+E+","+_+","+e+")",T.fillRect(i+a.cutX,n+a.cutY,s,r),l.setContext()),this.dirty=!0,this},clear:function(){var t,e,i;return this.dirty&&((t=this.gl)?((e=this.renderer).setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)):((i=this.context).save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()),this.dirty=!1),this},erase:function(t,e,i){this._eraseMode=!0;var n=this.renderer.currentBlendMode;return this.renderer.setBlendMode(o.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(n),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r,o,a,h,u,l=this.gl,c=this.camera,d=this.renderer;return c.preRender(1,1),l?(r=c._cx,o=c._cy,a=c._cw,h=c._ch,d.resetTextures(!0),d.setFramebuffer(this.framebuffer,!1),d.pushScissor(r,o,a,h,h),u=this.pipeline,g(u,0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),d.setFramebuffer(null,!0),d.resetTextures(!0),g(u,0,u.width,u.height,0,-1e3,1e3)):(d.setContext(this.context),this.batchList(t,e,i,n,s),d.setContext()),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o,a,h,u,l,c=this.gl,d=this.camera,f=this.renderer,p=this.textureManager.getFrame(t,e);return p&&(d.preRender(1,1),c?(o=d._cx,a=d._cy,h=d._cw,u=d._ch,f.resetTextures(!0),f.setFramebuffer(this.framebuffer,!1),f.pushScissor(o,a,h,u,u),l=this.pipeline,g(l,0,this.texture.width,0,this.texture.height,-1e3,1e3),l.batchTextureFrame(p,i+this.frame.cutX,n+this.frame.cutY,r,s,d.matrix,null),l.flush(),f.setFramebuffer(null,!1),f.popScissor(),g(l,0,l.width,l.height,0,-1e3,1e3)):this.batchTextureFrame(p,i+this.frame.cutX,n+this.frame.cutY,s,r),this.dirty=!0),this},batchList:function(t,e,i,n,s){for(var r=0;rs&&(r=t[s]),n[s]=r,t.length>s+1&&(r=t[s+1]),n[s+1]=r;return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(r=0;rn&&(s=t[n]),i[n]=s,t.length>n+1&&(s=t[n+1]),i[n+1]=s;return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var n,s,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,s=this.frame.width/(o-1),n=0;n=this._markerOut&&(e.loop?(e.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=t,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))},checkVideoProgress:function(){2<=this.video.readyState?this.updateTexture():(this.retry--,0e._dx?r<(s=t.right-e.x)&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxe._dy?r<(s=t.bottom-e.y)&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dy=t.right||e.position.y>=t.bottom)}},,function(t,e,i){var u=i(150);t.exports=function(t,e,i){var n=u(t,e,!0,i),s=u(t,e-1,!0,i),r=u(t,e+1,!0,i),o=u(t-1,e,!0,i),a=u(t+1,e,!0,i),h=n&&n.collides;return h&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),s&&s.collides&&(h&&(n.faceTop=!1),s.faceBottom=!h),r&&r.collides&&(h&&(n.faceBottom=!1),r.faceTop=!h),o&&o.collides&&(h&&(n.faceLeft=!1),o.faceRight=!h),a&&a.collides&&(h&&(n.faceRight=!1),a.faceLeft=!h),n&&!n.collides&&n.resetFaces(),n}},function(t,e,i){var l=i(75),c=i(104),d=i(235),f=i(65);t.exports=function(t,e,i,n,s){if(!c(e,i,s))return null;void 0===n&&(n=!0);var r,o=s.data[i][e],a=o&&o.collides;t instanceof l?(null===s.data[i][e]&&(s.data[i][e]=new l(s,t.index,e,i,t.width,t.height)),s.data[i][e].copy(t)):(r=t,null===s.data[i][e]?s.data[i][e]=new l(s,r,e,i,s.tileWidth,s.tileHeight):s.data[i][e].index=r);var h=s.data[i][e],u=-1!==s.collideIndexes.indexOf(h.index);return f(h,u),n&&a!==h.collides&&d(e,i,s),h}},function(t,e,i){var p=i(33),g=i(105),v=i(106),m=i(75);t.exports=function(t,e,i,n,s){for(var r=new g({tileWidth:i,tileHeight:n}),o=new v({name:t,tileWidth:i,tileHeight:n,format:p.ARRAY_2D,layers:[r]}),a=[],h=e.length,u=0,l=0;lt&&(t=s.totalDuration),s.delay=t.right&&(o=1,r+=s-t.right,s=t.right);break;case 1:(r+=e)>=t.bottom&&(o=2,s-=r-t.bottom,r=t.bottom);break;case 2:(s-=e)<=t.left&&(o=3,r-=t.left-s,s=t.left);break;case 3:(r-=e)<=t.top&&(o=0,r=t.top)}return n}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;ne.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t){var i=/\D/g;return t.sort(function(t,e){return parseInt(t.replace(i,""),10)-parseInt(e.replace(i,""),10)}),t}},function(t,e,i){var n=i(172),s=i(0),r=i(92),o=i(12),a=i(122),h=i(21),T=i(2),d=i(6),f=i(173),p=i(302),u=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var n,s=this.anims,r=this.mixes,o="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;return s.has(o)&&s.has(a)&&((n=(n=r.get(o))||{})[a]=i,r.set(o,n)),this},removeMix:function(t,e){var i,n=this.mixes,s="string"==typeof t?t:t.key,r=n.get(s);return r&&(e?(i="string"==typeof e?e:e.key,r.hasOwnProperty(i)&&delete r[i]):e||n.delete(s)),this},getMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,s="string"==typeof e?e:e.key,r=i.get(n);return r&&r.hasOwnProperty(s)?r[s]:0},add:function(t,e){return this.anims.has(t)?console.warn("Animation key exists: "+t):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e)),this},exists:function(t){return this.anims.has(t)},createFromAseprite:function(g,v){var m=[],t=this.game.cache.json.get(g);if(!t)return m;var y=this,e=d(t,"meta",null),x=d(t,"frames",null);return e&&x&&d(e,"frameTags",[]).forEach(function(t){var e=[],i=T(t,"name",null),n=T(t,"from",0),s=T(t,"to",0),r=T(t,"direction","forward");if(i&&(!v||v&&-1d.right&&(f=T(f,f+(e-d.right),this.lerp.x)),id.bottom&&(p=T(p,p+(i-d.bottom),this.lerp.y))):(f=T(f,e-u,this.lerp.x),p=T(p,i-l,this.lerp.y))),this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(u=Math.round(u),l=Math.round(l));var g=(this.scrollX=f)+r,v=(this.scrollY=p)+o;this.midPoint.set(g,v);var m=n/a,y=s/a;this.worldView.setTo(g-m/2,v-y/2,m,y),h.applyITRS(this.x+u,this.y+l,this.rotation,a,a),h.translate(-u,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=l(i,0,1),n=l(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var o=this.width/2,a=this.height/2,h=t.x-s,u=t.y-r;return this.midPoint.set(h,u),this.scrollX=h-o,this.scrollY=u-a,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=c},function(t,e,i){var o=i(32);t.exports=function(t){var e=new o;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i,n,s,r=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r&&(i=parseInt(r[1],16),n=parseInt(r[2],16),s=parseInt(r[3],16),e.setTo(i,n,s)),e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,u=r;return r!==s&&(r===t?a=(e-i)/o+(e>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(32);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var a=i(32);t.exports=function(t){var e,i,n,s,r=new a,o=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());return o&&(e=parseInt(o[1],10),i=parseInt(o[2],10),n=parseInt(o[3],10),s=void 0!==o[4]?parseFloat(o[4]):1,r.setTo(e,i,n,255*s)),r}},function(t,e,i){t.exports={Fade:i(688),Flash:i(689),Pan:i(690),Shake:i(723),RotateTo:i(724),Zoom:i(725)}},function(t,e,i){t.exports={In:i(691),Out:i(692),InOut:i(693)}},function(t,e,i){t.exports={In:i(694),Out:i(695),InOut:i(696)}},function(t,e,i){t.exports={In:i(697),Out:i(698),InOut:i(699)}},function(t,e,i){t.exports={In:i(700),Out:i(701),InOut:i(702)}},function(t,e,i){t.exports={In:i(703),Out:i(704),InOut:i(705)}},function(t,e,i){t.exports={In:i(706),Out:i(707),InOut:i(708)}},function(t,e,i){t.exports=i(709)},function(t,e,i){t.exports={In:i(710),Out:i(711),InOut:i(712)}},function(t,e,i){t.exports={In:i(713),Out:i(714),InOut:i(715)}},function(t,e,i){t.exports={In:i(716),Out:i(717),InOut:i(718)}},function(t,e,i){t.exports={In:i(719),Out:i(720),InOut:i(721)}},function(t,e,i){t.exports=i(722)},function(t,e,i){var n=i(0),a=i(34),h=i(328),u=i(2),l=i(6),c=i(7),d=i(180),f=i(1),p=i(184),g=i(174),s=new n({initialize:function(t){void 0===t&&(t={});this.width=l(t,"width",1024),this.height=l(t,"height",768),this.zoom=l(t,"zoom",1),this.resolution=l(t,"resolution",1),this.parent=l(t,"parent",void 0),this.scaleMode=l(t,"scaleMode",0),this.expandParent=l(t,"expandParent",!0),this.autoRound=l(t,"autoRound",!1),this.autoCenter=l(t,"autoCenter",0),this.resizeInterval=l(t,"resizeInterval",500),this.fullscreenTarget=l(t,"fullscreenTarget",null),this.minWidth=l(t,"minWidth",0),this.maxWidth=l(t,"maxWidth",0),this.minHeight=l(t,"minHeight",0),this.maxHeight=l(t,"maxHeight",0);var e=l(t,"scale",null);e&&(this.width=l(e,"width",this.width),this.height=l(e,"height",this.height),this.zoom=l(e,"zoom",this.zoom),this.resolution=l(e,"resolution",this.resolution),this.parent=l(e,"parent",this.parent),this.scaleMode=l(e,"mode",this.scaleMode),this.expandParent=l(e,"expandParent",this.expandParent),this.autoRound=l(e,"autoRound",this.autoRound),this.autoCenter=l(e,"autoCenter",this.autoCenter),this.resizeInterval=l(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=l(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=l(e,"min.width",this.minWidth),this.maxWidth=l(e,"max.width",this.maxWidth),this.minHeight=l(e,"min.height",this.minHeight),this.maxHeight=l(e,"max.height",this.maxHeight)),this.renderType=l(t,"type",a.AUTO),this.canvas=l(t,"canvas",null),this.context=l(t,"context",null),this.canvasStyle=l(t,"canvasStyle",null),this.customEnvironment=l(t,"customEnvironment",!1),this.sceneConfig=l(t,"scene",null),this.seed=l(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=l(t,"title",""),this.gameURL=l(t,"url","https://phaser.io"),this.gameVersion=l(t,"version",""),this.autoFocus=l(t,"autoFocus",!0),this.domCreateContainer=l(t,"dom.createContainer",!1),this.domBehindCanvas=l(t,"dom.behindCanvas",!1),this.inputKeyboard=l(t,"input.keyboard",!0),this.inputKeyboardEventTarget=l(t,"input.keyboard.target",window),this.inputKeyboardCapture=l(t,"input.keyboard.capture",[]),this.inputMouse=l(t,"input.mouse",!0),this.inputMouseEventTarget=l(t,"input.mouse.target",null),this.inputMouseCapture=l(t,"input.mouse.capture",!0),this.inputTouch=l(t,"input.touch",h.input.touch),this.inputTouchEventTarget=l(t,"input.touch.target",null),this.inputTouchCapture=l(t,"input.touch.capture",!0),this.inputActivePointers=l(t,"input.activePointers",1),this.inputSmoothFactor=l(t,"input.smoothFactor",0),this.inputWindowEvents=l(t,"input.windowEvents",!0),this.inputGamepad=l(t,"input.gamepad",!1),this.inputGamepadEventTarget=l(t,"input.gamepad.target",window),this.disableContextMenu=l(t,"disableContextMenu",!1),this.audio=l(t,"audio"),this.hideBanner=!1===l(t,"banner",null),this.hidePhaser=l(t,"banner.hidePhaser",!1),this.bannerTextColor=l(t,"banner.text","#ffffff"),this.bannerBackgroundColor=l(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=l(t,"fps",null);var i=l(t,"render",t);this.antialias=l(i,"antialias",!0),this.antialiasGL=l(i,"antialiasGL",!0),this.mipmapFilter=l(i,"mipmapFilter","LINEAR"),this.desynchronized=l(i,"desynchronized",!1),this.roundPixels=l(i,"roundPixels",!1),this.pixelArt=l(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=l(i,"transparent",!1),this.clearBeforeRender=l(i,"clearBeforeRender",!0),this.premultipliedAlpha=l(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=l(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=l(i,"powerPreference","default"),this.batchSize=l(i,"batchSize",4096),this.maxTextures=l(i,"maxTextures",-1),this.maxLights=l(i,"maxLights",10);var n=l(t,"backgroundColor",0);this.backgroundColor=g(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=l(t,"callbacks.preBoot",f),this.postBoot=l(t,"callbacks.postBoot",f),this.physics=l(t,"physics",{}),this.defaultPhysicsSystem=l(this.physics,"default",!1),this.loaderBaseURL=l(t,"loader.baseURL",""),this.loaderPath=l(t,"loader.path",""),this.loaderMaxParallelDownloads=l(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=l(t,"loader.crossOrigin",void 0),this.loaderResponseType=l(t,"loader.responseType",""),this.loaderAsync=l(t,"loader.async",!0),this.loaderUser=l(t,"loader.user",""),this.loaderPassword=l(t,"loader.password",""),this.loaderTimeout=l(t,"loader.timeout",0),this.loaderWithCredentials=l(t,"loader.withCredentials",!1),this.installGlobalPlugins=[],this.installScenePlugins=[];var s=l(t,"plugins",null),r=p.DefaultScene;s&&(Array.isArray(s)?this.defaultPlugins=s:c(s)&&(this.installGlobalPlugins=u(s,"global",[]),this.installScenePlugins=u(s,"scene",[]),Array.isArray(s.default)?r=s.default:Array.isArray(s.defaultMerge)&&(r=r.concat(s.defaultMerge)))),this.defaultPlugins=r;var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=l(t,"images.default",o+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=l(t,"images.missing",o+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=a.WEBGL:window.FORCE_CANVAS&&(this.renderType=a.CANVAS))}});t.exports=s},function(t,e,i){t.exports={os:i(125),browser:i(126),features:i(179),input:i(756),audio:i(757),video:i(758),fullscreen:i(759),canvasFeatures:i(329)}},function(t,e,i){var n,s,r,o=i(26),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var i=new Image;i.onload=function(){var t=o.create(i,6,1).getContext("2d");if(t.globalCompositeOperation="multiply",t.drawImage(r,0,0),t.drawImage(i,2,0),!t.getImageData(2,0,1,1))return!1;var e=t.getImageData(2,0,1,1).data;o.remove(i),a.supportNewBlendModes=255===e[0]&&0===e[1]&&0===e[2]},i.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t){return 0<=(t%=2*Math.PI)?t:t+2*Math.PI}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),e-ir[0]&&(e=1),r[8]>r[3*e+e]&&(e=2),i=a[e],n=a[i],s=Math.sqrt(r[3*e+e]-r[3*i+i]-r[3*n+n]+1),h[e]=.5*s,s=.5/s,h[i]=(r[3*i+e]+r[3*e+i])*s,h[n]=(r[3*n+e]+r[3*e+n])*s,this.x=h[0],this.y=h[1],this.z=h[2],this.w=(r[3*n+i]-r[3*i+n])*s),this}});t.exports=d},function(t,e,a){var h=a(350),u=a(26),l=a(34),c=a(179);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===l.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==l.HEADLESS)if(e.renderType===l.CANVAS||e.renderType!==l.CANVAS&&!c.webGL){if(!c.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=l.CANVAS}else e.renderType=l.WEBGL;e.antialias||u.disableSmoothing();var i,n,s=t.scale.baseSize,r=s.width,o=s.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=r,t.canvas.height=o):t.canvas=u.create(t,r,o,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||h.setCrisp(t.canvas),e.renderType!==l.HEADLESS&&(i=a(532),n=a(535),e.renderType===l.WEBGL?t.renderer=new n(t):(t.renderer=new i(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(e){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(t){e.style["image-rendering"]=t}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var u=i(34);t.exports=function(t){var e,i,n,s,r,o,a,h=t.config;h.hideBanner||(e="WebGL",h.renderType===u.CANVAS?e="Canvas":h.renderType===u.HEADLESS&&(e="Headless"),i=h.audio,a=!(n=t.device.audio).webAudio||i&&i.disableWebAudio?i&&i.noAudio||!n.webAudio&&!n.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie?window.console&&console.log("Phaser v"+u.VERSION+" / https://phaser.io"):(r=[s=""],Array.isArray(h.bannerBackgroundColor)?(h.bannerBackgroundColor.forEach(function(t){s=s.concat("%c "),r.push("background: "+t),o=t}),r[r.length-1]="color: "+h.bannerTextColor+"; background: "+o):(s=s.concat("%c "),r.push("color: "+h.bannerTextColor+"; background: "+h.bannerBackgroundColor)),r.push("background: #fff"),h.gameTitle&&(s=s.concat(h.gameTitle),h.gameVersion&&(s=s.concat(" v"+h.gameVersion)),h.hidePhaser||(s=s.concat(" / "))),h.hidePhaser||(s=s.concat("Phaser v"+u.VERSION+" ("+e+" | "+a+")")),s=s.concat(" %c "+h.gameURL),r[0]=s,console.log.apply(console,r)))}},function(t,e,i){var n=i(0),s=i(6),r=i(1),o=i(353),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3;for(var e=this.framesThisSecond=0;ethis._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var a=o=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var n=this;this.step=function t(){var e=window.performance.now();n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.requestAnimationFrame(t)},this.stepTimeout=function t(){var e=Date.now(),i=Math.min(Math.max(2*n.target+n.tick-e,0),n.target);n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.setTimeout(t,i)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(21);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var m=i(356),y=i(26),x=i(6);t.exports=function(t){var e=x(t,"data",[]),i=x(t,"canvas",null),n=x(t,"palette",m),s=x(t,"pixelWidth",1),r=x(t,"pixelHeight",s),o=x(t,"resizeCanvas",!0),a=x(t,"clearCanvas",!0),h=x(t,"preRender",null),u=x(t,"postRender",null),l=Math.floor(Math.abs(e[0].length*s)),c=Math.floor(Math.abs(e.length*r));i||(i=y.create2D(this,l,c),a=o=!1),o&&(i.width=l,i.height=c);var d=i.getContext("2d");a&&d.clearRect(0,0,l,c),h&&h(i,d);for(var f=0;fi.length-2?i.length-1:s+1],u=i[s>i.length-3?i.length-1:s+2];return e.set(l(r,o.x,a.x,h.x,u.x),l(r,o.y,a.y,h.y,u.y))},toJSON:function(){for(var t=[],e=0;ei.width?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return s.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return s.ORIENTATION.LANDSCAPE}return tthis.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var e=this.listeners;window.removeEventListener("orientationchange",e.orientationChange,!1),window.removeEventListener("resize",e.windowResize,!1);["webkit","moz",""].forEach(function(t){document.removeEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.removeEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",e.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===c.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===c.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(17),s=i(0),r=i(95),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,0r.START&&n.settings.status<=r.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status=r.x&&t=r.y&&e=r.x&&t=r.y&&e=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s>4,u[a++]=(15&i)<<4|n>>2,u[a++]=(3&n)<<6|63&s;return h}},function(t,e,i){var n=i(136),s=i(0),r=i(61),o=new s({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime>>16,v=(65280&d)>>>8,m=255&d,u.strokeStyle="rgba("+g+","+v+","+m+","+l+")",u.lineWidth=p,y+=3;break;case x.FILL_STYLE:f=a[y+1],c=a[y+2],g=(16711680&f)>>>16,v=(65280&f)>>>8,m=255&f,u.fillStyle="rgba("+g+","+v+","+m+","+c+")",y+=2;break;case x.BEGIN_PATH:u.beginPath();break;case x.CLOSE_PATH:u.closePath();break;case x.FILL_PATH:o||u.fill();break;case x.STROKE_PATH:o||u.stroke();break;case x.FILL_RECT:o?u.rect(a[y+1],a[y+2],a[y+3],a[y+4]):u.fillRect(a[y+1],a[y+2],a[y+3],a[y+4]),y+=4;break;case x.FILL_TRIANGLE:u.beginPath(),u.moveTo(a[y+1],a[y+2]),u.lineTo(a[y+3],a[y+4]),u.lineTo(a[y+5],a[y+6]),u.closePath(),o||u.fill(),y+=6;break;case x.STROKE_TRIANGLE:u.beginPath(),u.moveTo(a[y+1],a[y+2]),u.lineTo(a[y+3],a[y+4]),u.lineTo(a[y+5],a[y+6]),u.closePath(),o||u.stroke(),y+=6;break;case x.LINE_TO:u.lineTo(a[y+1],a[y+2]),y+=2;break;case x.MOVE_TO:u.moveTo(a[y+1],a[y+2]),y+=2;break;case x.LINE_FX_TO:u.lineTo(a[y+1],a[y+2]),y+=5;break;case x.MOVE_FX_TO:u.moveTo(a[y+1],a[y+2]),y+=5;break;case x.SAVE:u.save();break;case x.RESTORE:u.restore();break;case x.TRANSLATE:u.translate(a[y+1],a[y+2]),y+=2;break;case x.SCALE:u.scale(a[y+1],a[y+2]),y+=2;break;case x.ROTATE:u.rotate(a[y+1]),y+=1;break;case x.GRADIENT_FILL_STYLE:y+=5;break;case x.GRADIENT_LINE_STYLE:y+=6;break;case x.SET_TEXTURE:y+=2}}u.restore()}}},function(t,e,i){var n=i(0),s=i(127),r=i(71),o=i(2),a=i(59),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t,e,i,n=this.propertyValue,s=typeof n;return"number"==s?(this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate):Array.isArray(n)?this.onEmit=this.randomStaticValueEmit:"function"==s?this.emitOnly?this.onEmit=n:this.onUpdate=n:"object"==s&&(this.has(n,"random")||this.hasBoth(n,"start","end")||this.hasBoth(n,"min","max"))?(this.start=this.has(n,"start")?n.start:n.min,this.end=this.has(n,"end")?n.end:n.max,(t=this.hasBoth(n,"min","max")||!!n.random)&&(e=n.random,Array.isArray(e)&&(this.start=e[0],this.end=e[1]),this.onEmit=this.randomRangedValueEmit),this.has(n,"steps")?(this.steps=n.steps,this.counter=this.start,this.onEmit=this.steppedEmit):(i=this.has(n,"ease")?n.ease:"Linear",this.ease=r(i),t||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate)):"object"==s&&this.hasEither(n,"onEmit","onUpdate")&&(this.has(n,"onEmit")&&(this.onEmit=n.onEmit),this.has(n,"onUpdate")&&(this.onUpdate=n.onUpdate)),this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){var i;return t&&t.data[e]&&((i=t.data[e]).min=this.start,i.max=this.end),this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(0),o=i(2),s=new n({initialize:function(t,e,i,n,s){var r;"object"==typeof t?(t=o(r=t,"x",0),e=o(r,"y",0),i=o(r,"power",0),n=o(r,"epsilon",100),s=o(r,"gravity",50)):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50)),this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i,n,s=this.x-t.x,r=this.y-t.y,o=s*s+r*r;0!==o&&(i=Math.sqrt(o),oe.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(0this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;id.PI2?s=d.PI2:s<0&&(s=d.PI2+s%d.PI2);for(var a,h=[r+Math.cos(n)*i,o+Math.sin(n)*i];e<1;)a=s*e+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),e+=t;return a=s+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),h.push(r+Math.cos(n)*i,o+Math.sin(n)*i),this.pathIndexes=l(h),this.pathData=h,this}});t.exports=r},function(t,e,i){var n=i(0),s=i(1023),r=i(60),o=i(9),a=i(30),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;st.right||e.rightt.bottom||e.bottome.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottomt.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var a=i(472),h=i(473),n=i(0),u=i(12),l=i(3),s=new n({Extends:u,initialize:function(t,e){u.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=s;for(this.fixedStep||(n=.001*e,o=!0,this._elapsed=0),h=0;h=s;)this._elapsed-=s,this.step(n)}},step:function(t){for(var e,i=this.bodies.entries,n=i.length,s=0;sc)&&(d.xl))return this.separateCircle(t,e,s)}var f=!1,p=!1;s?(f=A(t,e,s,this.OVERLAP_BIAS),p=C(t,e,s,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=p(t.center.x,e.left,e.right),n=p(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;od.baseTileWidth&&(h-=a=(d.tileWidth-d.baseTileWidth)*e.scaleX,l+=a),d.tileHeight>d.baseTileHeight&&(c+=(d.tileHeight-d.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(h,u,l,c);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,u=t.body,l={left:0,right:0,top:0,bottom:0},c=!1,d=0;de.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,r=this.blocked.right=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,r=this.blocked.down=!0),r&&(this.blocked.none=!1),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this.updateCenter(),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n,s,r=this.gameObject;return!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r.getCenter&&(n=(r.width-t)/2,s=(r.height-e)/2,this.offset.set(n,s)),this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return 0=t.minX&&e.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,s){for(var r,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(r=e+Math.ceil((i-e)/n/2)*n,a(t,r,e,i,s),o.push(e,r,r,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!u(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;sthis._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),o=p(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,f(i,this.toBBox),f(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=p([t,e]),this.data.height=t.height+1,this.data.leaf=!1,f(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){for(var n,s,r,o,a,h,u,l,c,d,f,p,g=a=1/0,v=e;v<=i-e;v++)n=m(t,0,v,this.toBBox),s=m(t,v,i,this.toBBox),u=n,l=s,p=f=d=c=void 0,c=Math.max(u.minX,l.minX),d=Math.max(u.minY,l.minY),f=Math.min(u.maxX,l.maxX),p=Math.min(u.maxY,l.maxY),r=Math.max(0,f-c)*Math.max(0,p-d),o=y(n)+y(s),re.deltaAbsY()?g=-1:e.deltaAbsX()i&&s<(o=t.right-i)&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):0i&&s<(o=t.bottom-i)&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):0=r.layers.length){if(s.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=s.pop()}else{var o,a=r.layers[r.i];if(r.i++,"tilelayer"===a.type)if(a.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+a.name+"'");else{if(a.encoding&&"base64"===a.encoding){if(a.chunks)for(var h=0;h>>0;return n}},function(t,e,i){var h=i(2),u=i(154);t.exports=function(t){for(var e=[],i=[],n=u(t);n.i=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r,o,a=n.layers[n.i];n.i++,"imagelayer"===a.type?(s=h(a,"offsetx",0)+h(a,"startx",0),r=h(a,"offsety",0)+h(a,"starty",0),e.push({name:n.name+a.name,image:a.image,x:n.x+s+a.x,y:n.y+r+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:h(a,"properties",{})})):"group"===a.type&&(o=u(t,a,n),i.push(n),n=o)}return e}},function(t,e,i){var x=i(107),T=i(513),w=i(239);t.exports=function(t){for(var e,i=[],n=[],s=null,r=0;r=this.firstgid&&t=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r=n.layers[n.i];if(n.i++,r.opacity*=n.opacity,r.visible=n.visible&&r.visible,"objectgroup"===r.type){r.name=n.name+r.name;for(var o=n.x+d(r,"startx",0)+d(r,"offsetx",0),a=n.y+d(r,"starty",0)+d(r,"offsety",0),h=[],u=0;un&&(n=e.layer[r].width),e.layer[r].height>s&&(s=e.layer[r].height);var o=new h({width:n,height:s,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:a.WELTMEISTER});return o.layers=u(e,i),o.tilesets=l(e),o}},function(t,e,i){var d=i(105),f=i(75);t.exports=function(t,e){for(var i=[],n=0;nx||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));else if(1===m)for(h=0;hx||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));else if(2===m)for(h=f-1;0<=h;h--)for(u=0;ux||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));else if(3===m)for(h=f-1;0<=h;h--)for(u=d-1;0<=u;u--)!(a=v[h][u])||a.indexx||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));return this.dirty[e]=!1,null===r&&(r=n.createVertexBuffer(o,s.STATIC_DRAW),this.vertexBuffer[e]=r),n.setVertexBuffer(r),i.setAttribPointers(),s.bufferSubData(s.ARRAY_BUFFER,0,o),this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,u=i.tileHeight,l=h/2,c=u/2,d=a.x/n,f=a.y/s,p=(a.x+h)/n,g=(a.y+u)/s,v=this._tempMatrix,m=-l,y=-c;e.flipX&&(h*=-1,m+=i.tileWidth),e.flipY&&(u*=-1,y+=i.tileHeight);var x=m+h,T=y+u;v.applyITRS(l+e.pixelX,c+e.pixelY,e.rotation,1,1);var w=L.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),E=v.getX(m,y),_=v.getY(m,y),b=v.getX(m,T),S=v.getY(m,T),A=v.getX(x,T),C=v.getY(x,T),M=v.getX(x,y),O=v.getY(x,y);r.roundPixels&&(E=Math.round(E),_=Math.round(_),b=Math.round(b),S=Math.round(S),A=Math.round(A),C=Math.round(C),M=Math.round(M),O=Math.round(O));var R=this.vertexViewF32[o],P=this.vertexViewU32[o];return R[++t]=E,R[++t]=_,R[++t]=d,R[++t]=f,R[++t]=0,R[++t]=0,P[++t]=w,R[++t]=b,R[++t]=S,R[++t]=d,R[++t]=g,R[++t]=0,R[++t]=0,P[++t]=w,R[++t]=A,R[++t]=C,R[++t]=p,R[++t]=g,R[++t]=0,R[++t]=0,P[++t]=w,R[++t]=E,R[++t]=_,R[++t]=d,R[++t]=f,R[++t]=0,R[++t]=0,P[++t]=w,R[++t]=A,R[++t]=C,R[++t]=p,R[++t]=g,R[++t]=0,R[++t]=0,P[++t]=w,R[++t]=M,R[++t]=O,R[++t]=p,R[++t]=f,R[++t]=0,R[++t]=0,P[++t]=w,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),0<=t&&t<4){this._renderOrder=t;for(var e=0;ethis.vertexCapacity&&(this.flush(),x=!0,y=this.setTexture2D(m));var T=this.vertexViewF32,w=this.vertexViewU32,E=this.vertexCount*this.vertexComponentCount-1;return T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=u,T[++E]=v,w[++E]=d,T[++E]=i,T[++E]=n,T[++E]=h,T[++E]=c,T[++E]=v,w[++E]=p,T[++E]=s,T[++E]=r,T[++E]=l,T[++E]=c,T[++E]=v,w[++E]=g,T[++E]=t,T[++E]=e,T[++E]=h,T[++E]=u,T[++E]=v,w[++E]=d,T[++E]=s,T[++E]=r,T[++E]=l,T[++E]=c,T[++E]=v,w[++E]=g,T[++E]=o,T[++E]=a,T[++E]=l,T[++E]=u,T[++E]=v,w[++E]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,u,l,c,d,f,p,g){void 0===g&&(g=this.currentUnit);var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),v=!0,g=this.setTexture2D(p));var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=l,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=u,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=u,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},bind:function(t){return void 0===t&&(t=!1),u.prototype.bind.call(this,t),this}});t.exports=l},function(t,e,i){var C=i(26),M=i(32),O=i(2);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),n=O(e,"callback"),s=O(e,"type","image/png"),r=O(e,"encoder",.92),o=O(e,"x",0),a=O(e,"y",0),h=O(e,"getPixel",!1),u=O(e,"isFramebuffer",!1),l=u?O(e,"bufferWidth",1):i.drawingBufferWidth,c=u?O(e,"bufferHeight",1):i.drawingBufferHeight;if(h){var d=new Uint8Array(4),f=u?a:c-a;i.readPixels(o,f,1,1,i.RGBA,i.UNSIGNED_BYTE,d),n.call(null,new M(d[0],d[1],d[2],d[3]/255))}else{var p=O(e,"width",l),g=O(e,"height",c),v=p*g*4,m=new Uint8Array(v);i.readPixels(o,c-a-g,p,g,i.RGBA,i.UNSIGNED_BYTE,m);for(var y=C.createWebGL(this,p,g),x=y.getContext("2d"),T=x.getImageData(0,0,p,g),w=T.data,E=0;E>>0;if("function"!=typeof t)throw new TypeError;for(var n=2<=arguments.length?arguments[1]:void 0,s=0;sthis.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001)))},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(306),BaseCamera:i(93),CameraManager:i(726),Effects:i(314),Events:i(42)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerarotatecomplete"},function(t,e){t.exports="camerarotatestart"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(17),s=i(0),u=i(42),r=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o,a){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a;var h=t?u.FADE_OUT_START:u.FADE_IN_START;return this.camera.emit(h,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsedthis.source?Math.abs(this.destination-this.source):Math.abs(this.destination+h)-this.source)<(l=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+h)-this.destination)?this.clockwise=!0:lMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(127);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){var n=i(127);t.exports=function(){return n(-180,180)}},function(t,e,i){var n=i(332);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(13);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new r([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new o(t.x,t.y)):this.add(new o(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return 16777215>>24),e}},function(t,e,i){var h=i(32),u=i(366);t.exports=function(t,e,i){var n,s,r=i,o=i,a=i;return 0!==e&&(r=u(s=2*i-(n=i<.5?i*(1+e):i+e-i*e),n,t+1/3),o=u(s,n,t),a=u(s,n,t-1/3)),(new h).setGLTo(r,o,a,1)}},function(t,e,i){var s=i(176);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},function(t,e,i){function o(t,e,i,n,s,r,o,a){void 0===o&&(o=100),void 0===a&&(a=0);var h=a/o;return{r:u(t,n,h),g:u(e,s,h),b:u(i,r,h)}}var u=i(124);t.exports={RGBWithRGB:o,ColorWithRGB:function(t,e,i,n,s,r){return void 0===s&&(s=100),void 0===r&&(r=0),o(t.r,t.g,t.b,e,i,n,s,r)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),o(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(182),s=i(32);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var r=i(365);t.exports=function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+r(n)+r(t)+r(e)+r(i)}},function(t,e,i){t.exports={BitmapMask:i(287),GeometryMask:i(288)}},function(t,e,i){var n={AddToDOM:i(131),DOMContentLoaded:i(367),GetInnerHeight:i(368),GetScreenOrientation:i(369),GetTarget:i(374),ParseXML:i(375),RemoveFromDOM:i(188),RequestAnimationFrame:i(353)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(849)}},function(t,e,i){var n=i(0),s=i(12),r=i(23),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(131),s=i(301),r=i(305),o=i(26),a=i(0),h=i(327),u=i(851),l=i(349),c=i(120),d=i(351),f=i(328),p=i(367),g=i(12),v=i(21),m=i(376),y=i(23),x=i(381),T=i(382),w=i(384),E=i(130),_=i(389),b=i(352),S=i(354),A=i(393),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new _(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new b(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),l(this),u(this),d(this),n(this.canvas,this.config.parent),this.textures.once(E.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),S(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(131);t.exports=function(t){var e,i=t.config;i.parent&&i.domCreateContainer&&((e=document.createElement("div")).style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=e,n(e,i.parent))}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s=i.getElementsByTagName("SubTexture"),r=0;r=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,s=t.indexOf(e);return-1!==s&&st.length-1)throw new Error("Index out of bounds");var s=r(t,e);return i&&i.call(n,s),s}},function(t,e,i){var u=i(70);t.exports=function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),u(t,e,i)){var r=i-e,o=t.splice(e,r);if(n)for(var a=0;a?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var T=i(6);t.exports=function(t,e){var i=e.width,n=e.height,s=Math.floor(i/2),r=Math.floor(n/2),o=T(e,"chars","");if(""!==o){var a=T(e,"image",""),h=T(e,"offset.x",0),u=T(e,"offset.y",0),l=T(e,"spacing.x",0),c=T(e,"spacing.y",0),d=T(e,"lineSpacing",0),f=T(e,"charsPerRow",null);null===f&&(f=t.sys.textures.getFrame(a).width/i)>o.length&&(f=o.length);for(var p=h,g=u,v={retroFont:!0,font:a,size:i,lineHeight:n+d,chars:{}},m=0,y=0;yr.vertexCapacity&&r.flush();for(var g=r.setGameObject(e),v=r.vertexViewF32,m=r.vertexViewU32,y=r.vertexCount*r.vertexComponentCount-1,x=0,T=e.tintFill,w=0;w=i&&t.x<=n&&t.y>=s&&t.y<=r}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||s=n&&(p.push(v),f=v)}var m=o[o.length-1];return y(f,m)i&&(i=a.x),a.xs&&(s=a.y),a.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var r=i(9);t.exports=function(t,e,i,n,s){return void 0===s&&(s=new r),s.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var r=i(178);t.exports=function(t,e,i){var n=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),r(t,n,s)}},function(t,e,i){var n=i(9),s=i(143);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var a=i(4),h=i(41);t.exports=function(t,e,i){void 0===i&&(i=new a),e=h(e);var n=Math.sin(e),s=Math.cos(e),r=0=s||0=t.downTime+n)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],s=this;try{var r=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return s.state=o.FILE_ERRORED,void s.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){u.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){u.revokeObjectURL(s.data),s.onProcessError()},u.createObjectURL(this.data,r,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});s.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(a.UPDATE,this.step,this),t.events.emit(a.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(a.SHUTDOWN,this.shutdown,this),t.off(a.POST_UPDATE,this.step,this),t.off(a.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});r.register("ScenePlugin",o,"scenePlugin"),t.exports=o},function(t,e,i){t.exports={Events:i(405),List:i(137),Map:i(92),ProcessQueue:i(197),RTree:i(491),Set:i(141),Size:i(383)}},function(t,e,i){var n=i(19),s=i(1324),r=n(!1,r={CanvasTexture:i(390),Events:i(130),FilterMode:s,Frame:i(97),Parsers:i(392),Texture:i(192),TextureManager:i(389),TextureSource:i(391)},s);t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(149),Parsers:i(1355),Formats:i(33),ImageCollection:i(513),ParseToTilemap:i(240),Tile:i(75),Tilemap:i(522),TilemapCreator:i(1369),TilemapFactory:i(1370),Tileset:i(107),LayerData:i(105),MapData:i(106),ObjectLayer:i(516),DynamicTilemapLayer:i(523),StaticTilemapLayer:i(524)}},function(t,e,i){var p=i(24),g=i(53);t.exports=function(t,e,i,n,s,r,o,a){t<0&&(t=0),e<0&&(e=0),void 0===o&&(o=!0);for(var h=p(t,e,i,n,null,a),u=s-t,l=r-e,c=0;c=t&&u.index<=e&&l(u,i)}n&&c(0,0,s.width,s.height,s)}}},function(t,e,i){var a=i(65),h=i(53),u=i(153);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s=s.delay&&(n=s.elapsed-s.delay,s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),0>2],s+=o[(3&i[r])<<4|i[r+1]>>4],s+=o[(15&i[r+1])<<2|i[r+2]>>6],s+=o[63&i[r+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}},function(t,e,i){t.exports={Clone:i(69),Extend:i(19),GetAdvancedValue:i(15),GetFastValue:i(2),GetMinMaxValue:i(1395),GetValue:i(6),HasAll:i(1396),HasAny:i(422),HasValue:i(115),IsPlainObject:i(7),Merge:i(134),MergeRight:i(1397),Pick:i(514),SetValue:i(445)}},function(t,e,i){var o=i(6),a=i(17);t.exports=function(t,e,i,n,s){void 0===s&&(s=i);var r=o(t,e,s);return a(r,i,n)}},function(t,e){t.exports=function(t,e){for(var i=0;i=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,f="~";function s(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new a(i,n||t,s),o=f?f+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],r]:t._events[o].push(r):(t._events[o]=r,t._eventsCount++),t}function u(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(f=!1)),o.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(f?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t){var e=f?f+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,r=new Array(s);n>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){e&&-1!==e||(e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));for(var i=t.createShader(t.FRAGMENT_SHADER),n=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");;){var s=n.replace(/%forloop%/gi,function(t){for(var e="",i=0;ir.width&&(i=Math.max(r.width-t,0)),e+n>r.height&&(n=Math.max(r.height-e,0));for(var u=[],l=e;lthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=u},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){var s=[];n.forEach(function(t){t&&s.push(t)}),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var r=0;r=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),h=i(19),u=i(22),s=i(8),l=i(2),c=i(6),d=i(7),r=new n({Extends:u,initialize:function(t,e,i,n,s){var r,o="json";d(e)&&(e=l(r=e,"key"),i=l(r,"url"),n=l(r,"xhrSettings"),o=l(r,"extension",o),s=l(r,"dataKey",s));var a={type:"json",cache:t.cacheManager.json,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:s};u.call(this,t,a),d(i)&&(this.data=s?c(i,s):i,this.state=h.FILE_POPULATED)},onProcess:function(){var t,e;this.state!==h.FILE_POPULATED&&(this.state=h.FILE_PROCESSING,t=JSON.parse(this.xhrLoader.responseText),e=this.config,this.data="string"==typeof e?c(t,e,t):t),this.onProcessComplete()}});s.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,s,r,o,a,h,u,l=e&&e.length,c=l?e[0]*i:t.length,d=g(t,0,c,i,!0),f=[];if(!d||d.next===d.prev)return f;if(l&&(d=function(t,e,i,n){var s,r,o,a,h,u=[];for(s=0,r=e.length;s=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&o=n.x&&n.x>=l&&s!==n.x&&T(ri.x||n.x===i.x&&function(t,e){return w(t.prev,t,e.prev)<0&&w(e.next,t,t.next)<0}(i,n)))&&(i=n,d=h)),n=n.next,n!==u;);return i}(t,e))&&(i=b(e,t),v(e,e.next),v(i,i.next))}}(u[s],i),i=v(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=r=t[0],s=o=t[1];for(var p=i;pr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,l=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=x(a,h,e,i,n),d=x(u,l,e,i,n),f=t.prevZ,p=t.nextZ;for(;f&&f.z>=c&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}return!0}(t,n,s,r):function(t){var e=t.prev,i=t,n=t.next;if(0<=w(e,i,n))return!1;var s=t.next.next;for(;s!==t.prev;){if(T(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;s=s.next}return!0}(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),d(t),t=h.next,u=h.next;else if((t=h)===u){o?1===o?m(t=function(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!l(s,r)&&c(s,n,n.next,r)&&E(s,r)&&E(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),d(n),d(n.next),n=t=r),n=n.next}while(n!==t);return v(n)}(v(t),e,i),e,i,n,s,r,2):2===o&&function(t,e,i,n,s,r){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&c(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;for(;i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next,i!==t;);return n}(t,e)&&(w(t.prev,t,e.prev)||w(t,e.prev,e))||l(t,e)&&0=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function u(t){return 0c&&(c=l[d].vertexSize);var f=E(e,"batchSize",i.config.batchSize);this.vertexCapacity=6*f;var p=E(e,"vertices",new ArrayBuffer(this.vertexCapacity*c));for(this.vertexData=p,E(e,"vertices",null)?this.vertexBuffer=i.createVertexBuffer(p,t.STATIC_DRAW):this.vertexBuffer=i.createVertexBuffer(p.byteLength,t.DYNAMIC_DRAW),this.bytes=new Uint8Array(p),this.vertexViewF32=new Float32Array(p),this.vertexViewU32=new Uint32Array(p),this.renderer.setVertexBuffer(this.vertexBuffer),d=0;dthis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;var i=this.projectionMatrix;i&&i.ortho(0,t,e,0,-1e3,1e3);for(var n=this.renderTargets,s=0;s=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t;this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=l},function(t,e,i){var n=i(29),s=i(0),r=i(11),o=i(479),a=new s({Mixins:[r.Alpha,r.Flip,r.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,(this.collisionCallbackContext=this).tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){var t,e,i=this.layer.orientation;return i===n.ORTHOGONAL?(this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight):i===n.ISOMETRIC?(this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5):i===n.STAGGERED?(this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2)):i===n.HEXAGONAL&&(t=this.layer.hexSideLength,e=(this.baseHeight-t)/2+t,this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*e),this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},function(t,e){t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e,i){var h=i(103);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(o=t.indexOf(e))?(h(t,o),i&&i.call(n,e),e):null;for(var s=e.length-1,r=[];0<=s;){var o,a=e[s];-1!==(o=t.indexOf(a))&&(h(t,o),r.push(a),i&&i.call(n,a)),s--}return r}},function(t,e,i){var n=i(0),s=i(191),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t=t||new r,void 0===e&&(e=16);var i=this.getLength();i=t.length)){for(var i=t.length-1,n=t[e],s=e;sh||a.y>u)?(l=Math.max(a.x,e),c=Math.max(a.y,i),E=d=Math.min(a.r,h)-l,b=f=Math.min(a.b,u)-c,T=r?p+(v-(l-a.x)-d):p+(l-a.x),w=o?g+(m-(c-a.y)-f):g+(c-a.y),e=l,i=c,n=d,s=f):b=E=w=T=0):(r&&(T=p+(v-e-n)),o&&(w=g+(m-i-s)));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,T/A),t.v0=Math.max(0,w/_),t.u1=Math.min(1,(T+E)/A),t.v1=Math.min(1,(w+b)/_),t.x=e,t.y=i,t.cx=T,t.cy=w,t.cw=E,t.ch=b,t.width=n,t.height=s,t.flipX=r,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,s,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=n,this.u1=s,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new r(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=r},function(t,e,i){var s=i(199),n=i(0),r=i(1),o=i(90),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(i,t){return i&&(void 0===t&&(t=function(t,e){return t[i]-e[i]}),o(this.list,t)),this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return-1=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;ie.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),r=i(12),l=i(37),s=new n({Extends:l,initialize:function(t,e,i,n,s,r,o,a,h,u){void 0===r&&(r=16777215),void 0===o&&(o=1),void 0===a&&(a=0),void 0===h&&(h=0),void 0===u&&(u=0),l.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=a,this.ny=h,this.nz=u,this.u=n,this.v=s,this.color=r,this.alpha=o,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,n){var s=this.x,r=this.y,o=this.z,a=t.val,h=s*a[0]+r*a[4]+o*a[8]+a[12],u=s*a[1]+r*a[5]+o*a[9]+a[13],l=s*a[2]+r*a[6]+o*a[10]+a[14],c=s*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-u/c*i,this.vz=n<=0?l/c:-l/c},update:function(t,e,i,n,s,r,o,a){var h=this.vx*t+this.vy*i+s,u=this.vx*e+this.vy*n+r;return o&&(h=Math.round(h),u=Math.round(u)),this.tx=h,this.ty=u,this.ta=this.alpha*a,this},load:function(t,e,i,n,s){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=n,t[++i]=s,e[++i]=r.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=s},,,function(t,e){t.exports=function(t,e,i){return 0<=t&&t=this.firstgid&&th.getTotalFrames()&&(s=0),r=h.frames[s],0!==s||this.forward||(r=h.getLastFrame()),this.currentFrame=r):console.warn("Missing animation: "+a),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){var i,n;return this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e):(this.delayCounter=e,this.play(t,!0)),this.parent},playAfterRepeat:function(t,e){var i,n;return void 0===e&&(e=1),this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e):this.play(t),this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return n;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(0this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick))for(var n=0;this.forward?i.nextFrame(this):i.previousFrame(this),n++,this.accumulator>this.nextTick&&n<60;);}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(r.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new o(this,e,t),this.anims||(this.anims=new s),this.anims.set(e,i))),i},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=a},function(t,e,i){var n=i(0),s=i(2),r=i(860),o=i(861),a=i(24),z=i(12),h=i(74),u=i(75),l=new n({Extends:u,initialize:function(t){var e=t.game.renderer,i=s(t,"fragShader",r);t.fragShader=z.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=s(t,"vertShader",o),t.attributes=s(t,"attributes",[{name:"inPosition",size:2,type:h.FLOAT},{name:"inTexCoord",size:2,type:h.FLOAT},{name:"inTexId",size:1,type:h.FLOAT},{name:"inTintEffect",size:1,type:h.FLOAT},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),t.uniforms=s(t,"uniforms",["uProjectionMatrix","uMainSampler"]),u.call(this,t),this._tempMatrix1=new a,this._tempMatrix2=new a,this._tempMatrix3=new a},boot:function(){u.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var n,s=this._tempMatrix1,r=this._tempMatrix2,o=this._tempMatrix3,a=t.frame,h=a.glTexture,u=a.u0,l=a.v0,c=a.u1,d=a.v1,f=a.x,p=a.y,g=a.cutWidth,v=a.cutHeight,m=a.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;t.isCropped&&((n=t._crop).flipX===t.flipX&&n.flipY===t.flipY||a.updateCropUVs(n,t.flipX,t.flipY),u=n.u0,l=n.v0,c=n.u1,d=n.v1,g=n.width,v=n.height,T=-y+n.x,w=-x+n.y);var E=1,b=1;t.flipX&&(m||(T+=-a.realWidth+2*y),E=-1),(t.flipY||a.source.isGLTexture&&!h.flipY)&&(m||(w+=-a.realHeight+2*x),b=-1),r.applyITRS(t.x,t.y,t.rotation,t.scaleX*E,t.scaleY*b),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),r.e=t.x,r.f=t.y):(r.e-=e.scrollX*t.scrollFactorX,r.f-=e.scrollY*t.scrollFactorY),s.multiply(r,o);var S=T+g,A=w+v,_=e.roundPixels,C=o.getXRound(T,w,_),M=o.getYRound(T,w,_),R=o.getXRound(T,A,_),O=o.getYRound(T,A,_),P=o.getXRound(S,A,_),L=o.getYRound(S,A,_),D=o.getXRound(S,w,_),F=o.getYRound(S,w,_),k=z.getTintAppendFloatAlpha,I=e.alpha,B=k(t.tintTopLeft,I*t._alphaTL),N=k(t.tintTopRight,I*t._alphaTR),Y=k(t.tintBottomLeft,I*t._alphaBL),X=k(t.tintBottomRight,I*t._alphaBR);this.shouldFlush(6)&&this.flush();var U=this.setGameObject(t,a);this.manager.preBatch(t),this.batchQuad(t,C,M,R,O,P,L,D,F,u,l,c,d,B,N,Y,X,t.tintEffect,h,U),this.manager.postBatch(t)},batchTexture:function(t,e,i,n,s,r,o,a,h,u,l,c,d,f,p,g,v,m,y,x,T,w,E,b,S,A,_,C,M,R,O,P){this.manager.set(this,t);var L,D,F,k,I,B=this._tempMatrix1,N=this._tempMatrix2,Y=this._tempMatrix3,X=m/i+_,U=y/n+C,z=(m+x)/i+_,G=(y+T)/n+C,W=o,V=a,H=-g,j=-v;t.isCropped&&(o=W=D=(L=t._crop).width,a=V=F=L.height,k=m=L.x,I=y=L.y,c&&(k=x-L.x-D),d&&(I=T-L.y-F),X=k/i+_,U=I/n+C,z=(k+D)/i+_,G=(I+F)/n+C,H=-g+m,j=-v+y),c&&(W*=-1,H+=o),(d^=!O&&e.isRenderTexture?1:0)&&(V*=-1,j+=a);var K=H+W,q=j+V;N.applyITRS(s,r,l,h,u),B.copyFrom(M.matrix),R?(B.multiplyWithOffset(R,-M.scrollX*f,-M.scrollY*p),N.e=s,N.f=r):(N.e-=M.scrollX*f,N.f-=M.scrollY*p),B.multiply(N,Y);var Z=M.roundPixels,J=Y.getXRound(H,j,Z),Q=Y.getYRound(H,j,Z),$=Y.getXRound(H,q,Z),tt=Y.getYRound(H,q,Z),et=Y.getXRound(K,q,Z),it=Y.getYRound(K,q,Z),nt=Y.getXRound(K,j,Z),st=Y.getYRound(K,j,Z);void 0===P&&(P=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,nt,st,X,U,z,G,w,E,b,S,A,e,P),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,n,s,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,u=e+t.width,l=i+t.height;o?a.multiply(o,h):h=a;var c=h.getX(e,i),d=h.getY(e,i),f=h.getX(e,l),p=h.getY(e,l),g=h.getX(u,l),v=h.getY(u,l),m=h.getX(u,i),y=h.getY(u,i),x=this.renderer.setTextureSource(t.source);n=z.getTintAppendFloatAlpha(n,s),this.batchQuad(null,c,d,f,p,g,v,m,y,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,x)}});t.exports=l},,function(t,e,i){var n=i(4);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e,i){var a=i(4);t.exports=function(t,e){void 0===e&&(e=new a);var i=2*Math.PI*Math.random(),n=Math.random()+Math.random(),s=1=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(1+(s-r)).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=i(319),s=i(322),r=i(323),o=i(324);t.exports=function(t){switch(typeof t){case"string":return("rgb"===t.substr(0,3).toLowerCase()?o:n)(t);case"number":return s(t);case"object":return r(t)}}},function(t,e,i){var a=i(100);function h(t,e,i,n){var s=(t+6*e)%6,r=Math.min(s,4-s,1);return Math.round(255*(n-n*i*Math.max(0,r)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var s=h(5,t,e,i),r=h(3,t,e,i),o=h(1,t,e,i);return n?n.setTo?n.setTo(s,r,o,n.alpha,!1):(n.r=s,n.g=r,n.b=o,n.color=a(s,r,o),n):{r:s,g:r,b:o,color:a(s,r,o)}}},function(t,e){t.exports=function(t){return 16777215>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(102),r=i(131),o=i(31),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,s=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=o.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=o.create2D(this),n=i.getContext("2d").createImageData(1,1);return s=n.data instanceof Uint8ClampedArray,o.remove(t),o.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&s,a}()},function(t,e){var i="";function n(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;ic.width&&(t=c.width-d.cutX),d.cutY+e>c.height&&(e=c.height-d.cutY),d.setSize(t,e,d.cutX,d.cutY)),this.updateDisplayOrigin();var f=this.input;return f&&!f.customHitArea&&(f.hitArea.width=t,f.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=o.cutWidth),void 0===r&&(r=o.cutHeight);var u,l,c,d,f,p,g=(t>>16&255)/255,v=(t>>8&255)/255,m=(255&t)/255,y=this.renderTarget;return a.preRender(),y?(y.bind(!0),(u=this.pipeline).manager.set(u),l=y.width,c=y.height,d=h.width/l,f=h.height/c,u.drawFillRect(i*d,n*f,s*d,r*f,x.getTintFromFloats(m,v,g,1),e),y.unbind(!0)):(p=this.context,h.setContext(p),p.fillStyle="rgba("+g+","+v+","+m+","+e+")",p.fillRect(i+o.cutX,n+o.cutY,s,r),h.setContext()),this.dirty=!0,this},clear:function(){var t,e;return this.dirty&&((t=this.renderTarget)?t.clear():((e=this.context).save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()),this.dirty=!1),this},erase:function(t,e,i){this._eraseMode=!0;var n=this.renderer.currentBlendMode;return this.renderer.setBlendMode(o.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(n),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.camera,o=this.renderer,a=this.renderTarget;return r.preRender(),a?(a.bind(!0),o.resetTextures(!0),this.batchList(t,e,i,n,s),a.unbind(!0)):(o.setContext(this.context),this.batchList(t,e,i,n,s),o.setContext()),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.camera,a=this.renderTarget,h=this.textureManager.getFrame(t,e);return h&&(o.preRender(),a?(a.bind(!0),this.pipeline.batchTextureFrame(h,i,n,r,s,o.matrix,null),a.unbind(!0)):this.batchTextureFrame(h,i+this.frame.cutX,n+this.frame.cutY,s,r),this.dirty=!0),this},batchList:function(t,e,i,n,s){for(var r=0;rs&&(r=t[s]),n[s]=r,t.length>s+1&&(r=t[s+1]),n[s+1]=r;return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(r=0;rn&&(s=t[n]),i[n]=s,t.length>n+1&&(s=t[n+1]),i[n+1]=s;return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var n,s,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,s=this.frame.width/(o-1),n=0;n=this._markerOut&&(e.loop?(e.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=t,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))},checkVideoProgress:function(){2<=this.video.readyState?this.updateTexture():(this.retry--,0e._dx?r<(s=t.right-e.x)&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==o.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==o.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxe._dy?r<(s=t.bottom-e.y)&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==o.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==o.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dy=t.right||e.position.y>=t.bottom)}},,function(t,e,i){var n=i(29);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?n.ISOMETRIC:"staggered"===t?n.STAGGERED:"hexagonal"===t?n.HEXAGONAL:n.ORTHOGONAL}},function(t,e,i){t.exports={CalculateFacesAt:i(244),CalculateFacesWithin:i(60),CheckIsoBounds:i(520),Copy:i(1393),CreateFromTiles:i(1394),CullBounds:i(522),CullTiles:i(523),Fill:i(1395),FilterTiles:i(1396),FindByIndex:i(1397),FindTile:i(1398),ForEachTile:i(1399),GetCullTilesFunction:i(1400),GetTileAt:i(151),GetTileAtWorldXY:i(1401),GetTilesWithin:i(26),GetTilesWithinShape:i(1402),GetTilesWithinWorldXY:i(506),GetTileToWorldXFunction:i(1403),GetTileToWorldXYFunction:i(1404),GetTileToWorldYFunction:i(1405),GetWorldToTileXFunction:i(1406),GetWorldToTileXYFunction:i(1407),GetWorldToTileYFunction:i(1408),HasTileAt:i(541),HasTileAtWorldXY:i(1409),HexagonalCullBounds:i(525),HexagonalCullTiles:i(524),HexagonalTileToWorldXY:i(529),HexagonalTileToWorldY:i(533),HexagonalWorldToTileXY:i(535),HexagonalWorldToTileY:i(539),IsInLayerBounds:i(116),IsometricCullTiles:i(526),IsometricTileToWorldXY:i(530),IsometricWorldToTileXY:i(536),PutTileAt:i(249),PutTileAtWorldXY:i(1410),PutTilesAt:i(1411),Randomize:i(1412),RemoveTileAt:i(542),RemoveTileAtWorldXY:i(1413),RenderDebug:i(1414),ReplaceByIndex:i(521),RunCull:i(152),SetCollision:i(1415),SetCollisionBetween:i(1416),SetCollisionByExclusion:i(1417),SetCollisionByProperty:i(1418),SetCollisionFromCollisionGroup:i(1419),SetLayerCollisionIndex:i(153),SetTileCollision:i(69),SetTileIndexCallback:i(1420),SetTileLocationCallback:i(1421),Shuffle:i(1422),StaggeredCullBounds:i(528),StaggeredCullTiles:i(527),StaggeredTileToWorldXY:i(531),StaggeredTileToWorldY:i(534),StaggeredWorldToTileXY:i(537),StaggeredWorldToTileY:i(540),SwapByIndex:i(1423),TileToWorldX:i(245),TileToWorldXY:i(532),TileToWorldY:i(246),WeightedRandomize:i(1424),WorldToTileX:i(247),WorldToTileXY:i(538),WorldToTileY:i(248)}},function(t,e,i){var u=i(151);t.exports=function(t,e,i){var n=u(t,e,!0,i),s=u(t,e-1,!0,i),r=u(t,e+1,!0,i),o=u(t-1,e,!0,i),a=u(t+1,e,!0,i),h=n&&n.collides;return h&&(n.faceTop=!0,n.faceBottom=!0,n.faceLeft=!0,n.faceRight=!0),s&&s.collides&&(h&&(n.faceTop=!1),s.faceBottom=!h),r&&r.collides&&(h&&(n.faceBottom=!1),r.faceTop=!h),o&&o.collides&&(h&&(n.faceLeft=!1),o.faceRight=!h),a&&a.collides&&(h&&(n.faceRight=!1),a.faceLeft=!h),n&&!n.collides&&n.resetFaces(),n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(e=e||s.scene.cameras.main,r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(e=e||s.scene.cameras.main,r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileWidth,r=n.tilemapLayer;return r&&(i=i||r.scene.cameras.main,t-=r.x+i.scrollX*(1-r.scrollFactorX),s*=r.scaleX),e?Math.floor(t/s):t/s}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var s=n.baseTileHeight,r=n.tilemapLayer;return r&&(i=i||r.scene.cameras.main,t-=r.y+i.scrollY*(1-r.scrollFactorY),s*=r.scaleY),e?Math.floor(t/s):t/s}},function(t,e,i){var l=i(81),c=i(116),d=i(244),f=i(69);t.exports=function(t,e,i,n,s){if(void 0===n&&(n=!0),!c(e,i,s))return null;var r,o=s.data[i][e],a=o&&o.collides;t instanceof l?(null===s.data[i][e]&&(s.data[i][e]=new l(s,t.index,e,i,s.tileWidth,s.tileHeight)),s.data[i][e].copy(t)):(r=t,null===s.data[i][e]?s.data[i][e]=new l(s,r,e,i,s.tileWidth,s.tileHeight):s.data[i][e].index=r);var h=s.data[i][e],u=-1!==s.collideIndexes.indexOf(h.index);return f(h,u),n&&a!==h.collides&&d(e,i,s),h}},function(t,e,i){var p=i(38),g=i(117),v=i(118),m=i(81);t.exports=function(t,e,i,n,s){for(var r=new g({tileWidth:i,tileHeight:n}),o=new v({name:t,tileWidth:i,tileHeight:n,format:p.ARRAY_2D,layers:[r]}),a=[],h=e.length,u=0,l=0;lt&&(t=s.totalDuration),s.delay=t.right&&(o=1,r+=s-t.right,s=t.right);break;case 1:(r+=e)>=t.bottom&&(o=2,s-=r-t.bottom,r=t.bottom);break;case 2:(s-=e)<=t.left&&(o=3,r-=t.left-s,s=t.left);break;case 3:(r-=e)<=t.top&&(o=0,r=t.top)}return n}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var n=Math.round(t.x1),s=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-n),h=Math.abs(o-s),u=ne.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===s&&(s=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=s},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t){var i=/\D/g;return t.sort(function(t,e){return parseInt(t.replace(i,""),10)-parseInt(e.replace(i,""),10)}),t}},function(t,e,i){var n=i(177),s=i(0),r=i(98),o=i(10),a=i(128),h=i(23),T=i(2),d=i(6),f=i(178),p=i(314),u=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var n,s=this.anims,r=this.mixes,o="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;return s.has(o)&&s.has(a)&&((n=(n=r.get(o))||{})[a]=i,r.set(o,n)),this},removeMix:function(t,e){var i,n=this.mixes,s="string"==typeof t?t:t.key,r=n.get(s);return r&&(e?(i="string"==typeof e?e:e.key,r.hasOwnProperty(i)&&delete r[i]):e||n.delete(s)),this},getMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,s="string"==typeof e?e:e.key,r=i.get(n);return r&&r.hasOwnProperty(s)?r[s]:0},add:function(t,e){return this.anims.has(t)?console.warn("Animation key exists: "+t):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e)),this},exists:function(t){return this.anims.has(t)},createFromAseprite:function(g,v){var m=[],t=this.game.cache.json.get(g);if(!t)return m;var y=this,e=d(t,"meta",null),x=d(t,"frames",null);return e&&x&&d(e,"frameTags",[]).forEach(function(t){var e=[],i=T(t,"name",null),n=T(t,"from",0),s=T(t,"to",0),r=T(t,"direction","forward");if(i&&(!v||v&&-1u.right&&(l=b(l,l+(d-u.right),this.lerp.x)),fu.bottom&&(c=b(c,c+(f-u.bottom),this.lerp.y))):(l=b(l,d-o,this.lerp.x),c=b(c,f-a,this.lerp.y)),p=!0),this.useBounds&&(l=this.clampX(l),c=this.clampY(c)),this.roundPixels&&(o=Math.round(o),a=Math.round(a),l=Math.round(l),c=Math.round(c));var g=(this.scrollX=l)+i,v=(this.scrollY=c)+n;this.midPoint.set(g,v);var m=t/s,y=e/s,x=g-m/2,T=v-y/2;this.roundPixels&&(x=Math.round(x),T=Math.round(T)),this.worldView.setTo(x,T,m,y),r.applyITRS(this.x+o,this.y+a,this.rotation,s,s),r.translate(-o,-a),this.shakeEffect.preRender(),p&&this.emit(E.FOLLOW_UPDATE,this,h)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=l(i,0,1),n=l(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var o=this.width/2,a=this.height/2,h=t.x-s,u=t.y-r;return this.midPoint.set(h,u),this.scrollX=h-o,this.scrollY=u-a,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=u},function(t,e,i){var o=i(36);t.exports=function(t){var e=new o;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i,n,s,r=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r&&(i=parseInt(r[1],16),n=parseInt(r[2],16),s=parseInt(r[3],16),e.setTo(i,n,s)),e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,u=r;return r!==s&&(r===t?a=(e-i)/o+(er[0]&&(e=1),r[8]>r[3*e+e]&&(e=2),i=a[e],n=a[i],s=Math.sqrt(r[3*e+e]-r[3*i+i]-r[3*n+n]+1),h[e]=.5*s,s=.5/s,h[i]=(r[3*i+e]+r[3*e+i])*s,h[n]=(r[3*n+e]+r[3*e+n])*s,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(r[3*n+i]-r[3*i+n])*s),this.onChangeCallback(this),this}});t.exports=f},function(t,e,a){var h=a(359),u=a(31),l=a(39),c=a(183);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===l.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==l.HEADLESS)if(e.renderType===l.CANVAS||e.renderType!==l.CANVAS&&!c.webGL){if(!c.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=l.CANVAS}else e.renderType=l.WEBGL;e.antialias||u.disableSmoothing();var i,n,s=t.scale.baseSize,r=s.width,o=s.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=r,t.canvas.height=o):t.canvas=u.create(t,r,o,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||h.setCrisp(t.canvas),e.renderType!==l.HEADLESS&&(i=a(568),n=a(571),e.renderType===l.WEBGL?t.renderer=new n(t):(t.renderer=new i(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(e){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(t){e.style["image-rendering"]=t}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var u=i(39);t.exports=function(t){var e,i,n,s,r,o,a,h=t.config;h.hideBanner||(e="WebGL",h.renderType===u.CANVAS?e="Canvas":h.renderType===u.HEADLESS&&(e="Headless"),i=h.audio,a=(n=t.device.audio).webAudio&&!i.disableWebAudio?"Web Audio":i.noAudio||!n.webAudio&&!n.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie?window.console&&console.log("Phaser v"+u.VERSION+" / https://phaser.io"):(r=[s=""],Array.isArray(h.bannerBackgroundColor)?(h.bannerBackgroundColor.forEach(function(t){s=s.concat("%c "),r.push("background: "+t),o=t}),r[r.length-1]="color: "+h.bannerTextColor+"; background: "+o):(s=s.concat("%c "),r.push("color: "+h.bannerTextColor+"; background: "+h.bannerBackgroundColor)),r.push("background: #fff"),h.gameTitle&&(s=s.concat(h.gameTitle),h.gameVersion&&(s=s.concat(" v"+h.gameVersion)),h.hidePhaser||(s=s.concat(" / "))),h.hidePhaser||(s=s.concat("Phaser v"+u.VERSION+" ("+e+" | "+a+")")),s=s.concat(" %c "+h.gameURL),r[0]=s,console.log.apply(console,r)))}},function(t,e,i){var n=i(0),s=i(6),r=i(1),o=i(362),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3;for(var e=this.framesThisSecond=0;ethis._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var a=o=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var n=this;this.step=function t(){var e=window.performance.now();n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.requestAnimationFrame(t)},this.stepTimeout=function t(){var e=Date.now(),i=Math.min(Math.max(2*n.target+n.tick-e,0),n.target);n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.setTimeout(t,i)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(23);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var m=i(365),y=i(31),x=i(6);t.exports=function(t){var e=x(t,"data",[]),i=x(t,"canvas",null),n=x(t,"palette",m),s=x(t,"pixelWidth",1),r=x(t,"pixelHeight",s),o=x(t,"resizeCanvas",!0),a=x(t,"clearCanvas",!0),h=x(t,"preRender",null),u=x(t,"postRender",null),l=Math.floor(Math.abs(e[0].length*s)),c=Math.floor(Math.abs(e.length*r));i||(i=y.create2D(this,l,c),a=o=!1),o&&(i.width=l,i.height=c);var d=i.getContext("2d");a&&d.clearRect(0,0,l,c),h&&h(i,d);for(var f=0;fi.length-2?i.length-1:s+1],u=i[s>i.length-3?i.length-1:s+2];return e.set(l(r,o.x,a.x,h.x,u.x),l(r,o.y,a.y,h.y,u.y))},toJSON:function(){for(var t=[],e=0;ethis.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var e=this.listeners;window.removeEventListener("orientationchange",e.orientationChange,!1),window.removeEventListener("resize",e.windowResize,!1);["webkit","moz",""].forEach(function(t){document.removeEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.removeEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",e.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===l.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===l.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(16),s=i(0),r=i(72),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,0r.START&&n.settings.status<=r.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status=r.x&&t=r.y&&e=r.x&&t=r.y&&e=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s>4,u[a++]=(15&i)<<4|n>>2,u[a++]=(3&n)<<6|63&s;return h}},function(t,e,i){var n=i(142),s=i(0),r=i(66),o=new s({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime>>16,g=(65280&c)>>>8,v=255&c,h.strokeStyle="rgba("+p+","+g+","+v+","+u+")",h.lineWidth=f,m+=3;break;case y.FILL_STYLE:d=o[m+1],l=o[m+2],p=(16711680&d)>>>16,g=(65280&d)>>>8,v=255&d,h.fillStyle="rgba("+p+","+g+","+v+","+l+")",m+=2;break;case y.BEGIN_PATH:h.beginPath();break;case y.CLOSE_PATH:h.closePath();break;case y.FILL_PATH:r||h.fill();break;case y.STROKE_PATH:r||h.stroke();break;case y.FILL_RECT:r?h.rect(o[m+1],o[m+2],o[m+3],o[m+4]):h.fillRect(o[m+1],o[m+2],o[m+3],o[m+4]),m+=4;break;case y.FILL_TRIANGLE:h.beginPath(),h.moveTo(o[m+1],o[m+2]),h.lineTo(o[m+3],o[m+4]),h.lineTo(o[m+5],o[m+6]),h.closePath(),r||h.fill(),m+=6;break;case y.STROKE_TRIANGLE:h.beginPath(),h.moveTo(o[m+1],o[m+2]),h.lineTo(o[m+3],o[m+4]),h.lineTo(o[m+5],o[m+6]),h.closePath(),r||h.stroke(),m+=6;break;case y.LINE_TO:h.lineTo(o[m+1],o[m+2]),m+=2;break;case y.MOVE_TO:h.moveTo(o[m+1],o[m+2]),m+=2;break;case y.LINE_FX_TO:h.lineTo(o[m+1],o[m+2]),m+=5;break;case y.MOVE_FX_TO:h.moveTo(o[m+1],o[m+2]),m+=5;break;case y.SAVE:h.save();break;case y.RESTORE:h.restore();break;case y.TRANSLATE:h.translate(o[m+1],o[m+2]),m+=2;break;case y.SCALE:h.scale(o[m+1],o[m+2]),m+=2;break;case y.ROTATE:h.rotate(o[m+1]),m+=1;break;case y.GRADIENT_FILL_STYLE:m+=5;break;case y.GRADIENT_LINE_STYLE:m+=6}}h.restore()}}},function(t,e,i){var n=i(0),s=i(132),r=i(78),o=i(2),a=i(64),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t,e,i,n=this.propertyValue,s=typeof n;return this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"==s?(this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate):Array.isArray(n)?this.onEmit=this.randomStaticValueEmit:"function"==s?this.emitOnly?this.onEmit=n:this.onUpdate=n:"object"==s&&this.hasBoth(n,"start","end")?(this.start=n.start,this.end=n.end,(t=this.has(n,"random"))&&(this.onEmit=this.randomRangedValueEmit),this.has(n,"steps")?(this.steps=n.steps,this.counter=this.start,this.onEmit=this.steppedEmit):(e=this.has(n,"ease")?n.ease:"Linear",this.ease=r(e,n.easeParams),t||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate)):"object"==s&&this.hasBoth(n,"min","max")?(this.start=n.min,this.end=n.max,this.onEmit=this.randomRangedValueEmit):"object"==s&&this.has(n,"random")?(i=n.random,Array.isArray(i)&&(this.start=i[0],this.end=i[1]),this.onEmit=this.randomRangedValueEmit):"object"==s&&this.hasEither(n,"onEmit","onUpdate")&&(this.has(n,"onEmit")&&(this.onEmit=n.onEmit),this.has(n,"onUpdate")&&(this.onUpdate=n.onUpdate)),this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){var i;return t&&t.data[e]&&((i=t.data[e]).min=this.start,i.max=this.end),this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(0),o=i(2),s=new n({initialize:function(t,e,i,n,s){var r;"object"==typeof t?(t=o(r=t,"x",0),e=o(r,"y",0),i=o(r,"power",0),n=o(r,"epsilon",100),s=o(r,"gravity",50)):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50)),this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i,n,s=this.x-t.x,r=this.y-t.y,o=s*s+r*r;0!==o&&(i=Math.sqrt(o),oe.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(0this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;id.PI2?s=d.PI2:s<0&&(s=d.PI2+s%d.PI2);for(var a,h=[r+Math.cos(n)*i,o+Math.sin(n)*i];e<1;)a=s*e+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),e+=t;return a=s+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),h.push(r+Math.cos(n)*i,o+Math.sin(n)*i),this.pathIndexes=l(h),this.pathData=h,this}});t.exports=r},function(t,e,i){var n=i(0),s=i(1083),r=i(65),o=i(9),a=i(33),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;st.right||e.rightt.bottom||e.bottome.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottomt.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var a=i(486),h=i(487),n=i(0),u=i(10),l=i(3),s=new n({Extends:u,initialize:function(t,e){u.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=s;for(this.fixedStep||(n=.001*e,o=!0,this._elapsed=0),h=0;h=s;)this._elapsed-=s,this.step(n)}},step:function(t){for(var e,i=this.bodies.entries,n=i.length,s=0;sc)&&(d.xl))return this.separateCircle(t,e,s)}var f=!1,p=!1;s?(f=M(t,e,s,this.OVERLAP_BIAS),p=R(t,e,s,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=p(t.center.x,e.left,e.right),n=p(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;od.baseTileWidth&&(h-=a=(d.tileWidth-d.baseTileWidth)*e.scaleX,l+=a),d.tileHeight>d.baseTileHeight&&(c+=(d.tileHeight-d.baseTileHeight)*e.scaleY);var f=S(h,u,l,c,null,e.scene.cameras.main,e.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,u=t.body,l={left:0,right:0,top:0,bottom:0},c=!1,d=0;de.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,r=this.blocked.right=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,r=this.blocked.down=!0),r&&(this.blocked.none=!1,this.updateCenter()),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n,s,r=this.gameObject;return!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r.getCenter&&(n=(r.width-t)/2,s=(r.height-e)/2,this.offset.set(n,s)),this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return 0=t.minX&&e.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,s){for(var r,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(r=e+Math.ceil((i-e)/n/2)*n,a(t,r,e,i,s),o.push(e,r,r,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!u(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;sthis._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),o=p(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,f(i,this.toBBox),f(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=p([t,e]),this.data.height=t.height+1,this.data.leaf=!1,f(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){for(var n,s,r,o,a,h,u,l,c,d,f,p,g=a=1/0,v=e;v<=i-e;v++)n=m(t,0,v,this.toBBox),s=m(t,v,i,this.toBBox),u=n,l=s,p=f=d=c=void 0,c=Math.max(u.minX,l.minX),d=Math.max(u.minY,l.minY),f=Math.min(u.maxX,l.maxX),p=Math.min(u.maxY,l.maxY),r=Math.max(0,f-c)*Math.max(0,p-d),o=y(n)+y(s),re.deltaAbsY()?g=-1:e.deltaAbsX()i&&s<(o=t.right-i)&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):0i&&s<(o=t.bottom-i)&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):0n.worldView.x+s.scaleX*i.tileWidth*(-r-.5)&&a.xn.worldView.y+s.scaleY*i.tileHeight*(-o-1)&&a.y=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r,o,a=n.layers[n.i];n.i++,"imagelayer"===a.type?(s=h(a,"offsetx",0)+h(a,"startx",0),r=h(a,"offsety",0)+h(a,"starty",0),e.push({name:n.name+a.name,image:a.image,x:n.x+s+a.x,y:n.y+r+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:h(a,"properties",{})})):"group"===a.type&&(o=u(t,a,n),i.push(n),n=o)}return e}},function(t,e,i){var d=i(2),f=i(251),p=i(551),g=i(154);t.exports=function(t){for(var e=[],i=[],n=g(t);n.i=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r=n.layers[n.i];if(n.i++,r.opacity*=n.opacity,r.visible=n.visible&&r.visible,"objectgroup"===r.type){r.name=n.name+r.name;for(var o=n.x+d(r,"startx",0)+d(r,"offsetx",0),a=n.y+d(r,"starty",0)+d(r,"offsety",0),h=[],u=0;u=r.layers.length){if(s.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=s.pop()}else{var o,a=r.layers[r.i];if(r.i++,"tilelayer"===a.type)if(a.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+a.name+"'");else{if(a.encoding&&"base64"===a.encoding){if(a.chunks)for(var h=0;h>>0;return n}},function(t,e,i){var w=i(119),E=i(555),b=i(251);t.exports=function(t){for(var e,i=[],n=[],s=null,r=0;r=this.firstgid&&tn&&(n=e.layer[r].width),e.layer[r].height>s&&(s=e.layer[r].height);var o=new h({width:n,height:s,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:a.WELTMEISTER});return o.layers=u(e,i),o.tilesets=l(e),o}},function(t,e,i){var d=i(117),f=i(81);t.exports=function(t,e){for(var i=[],n=0;n>>0;if("function"!=typeof t)throw new TypeError;for(var n=2<=arguments.length?arguments[1]:void 0,s=0;sthis.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001)))},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(318),BaseCamera:i(99),CameraManager:i(767),Effects:i(325),Events:i(35)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="followupdate"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerarotatecomplete"},function(t,e){t.exports="camerarotatestart"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(16),s=i(0),u=i(35),r=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o,a){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a;var h=t?u.FADE_OUT_START:u.FADE_IN_START;return this.camera.emit(h,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsedthis.source?Math.abs(this.destination-this.source):Math.abs(this.destination+h)-this.source)<(l=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+h)-this.destination)?this.clockwise=!0:lMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(132);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){var n=i(132);t.exports=function(){return n(-180,180)}},function(t,e,i){var n=i(343);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(13);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},function(t,e){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){t.exports="removetexture"},function(t,e,i){t.exports={GenerateTexture:i(364),Palettes:i(875)}},function(t,e,i){t.exports={ARNE16:i(365),C64:i(876),CGA:i(877),JMP:i(878),MSX:i(879)}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){t.exports={Path:i(881),MoveTo:i(369),CubicBezier:i(366),Curve:i(88),Ellipse:i(367),Line:i(368),QuadraticBezier:i(370),Spline:i(371)}},function(t,e,i){var n=i(0),l=i(366),u=i(367),s=i(5),r=i(368),o=i(369),a=i(370),h=i(9),c=i(371),d=i(3),f=i(13),p=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new r(e,t)),this},cubicBezierTo:function(t,e,i,n,s,r){var o,a,h=this.getEndPoint(),u=t instanceof d?(o=t,a=e,i):(o=new d(i,n),a=new d(s,r),new d(t,e));return this.add(new l(h,o,a,u))},quadraticBezierTo:function(t,e,i,n){var s,r=this.getEndPoint(),o=t instanceof d?(s=t,e):(s=new d(i,n),new d(t,e));return this.add(new a(r,s,o))},draw:function(t,e){for(var i=0;i=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new r([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new o(t.x,t.y)):this.add(new o(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return 16777215>>24),e}},function(t,e,i){var h=i(36),u=i(375);t.exports=function(t,e,i){var n,s,r=i,o=i,a=i;return 0!==e&&(r=u(s=2*i-(n=i<.5?i*(1+e):i+e-i*e),n,t+1/3),o=u(s,n,t),a=u(s,n,t-1/3)),(new h).setGLTo(r,o,a,1)}},function(t,e,i){var s=i(180);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},function(t,e,i){function o(t,e,i,n,s,r,o,a){void 0===o&&(o=100),void 0===a&&(a=0);var h=a/o;return{r:u(t,n,h),g:u(e,s,h),b:u(i,r,h)}}var u=i(130);t.exports={RGBWithRGB:o,ColorWithRGB:function(t,e,i,n,s,r){return void 0===s&&(s=100),void 0===r&&(r=0),o(t.r,t.g,t.b,e,i,n,s,r)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),o(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(187),s=i(36);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var r=i(374);t.exports=function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+r(n)+r(t)+r(e)+r(i)}},function(t,e,i){t.exports={BitmapMask:i(302),GeometryMask:i(303)}},function(t,e,i){var n={AddToDOM:i(137),DOMContentLoaded:i(377),GetInnerHeight:i(378),GetScreenOrientation:i(379),GetTarget:i(384),ParseXML:i(385),RemoveFromDOM:i(193),RequestAnimationFrame:i(362)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(905)}},function(t,e,i){var n=i(0),s=i(10),r=i(25),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(137),s=i(313),r=i(317),o=i(31),a=i(0),h=i(338),u=i(907),l=i(358),c=i(97),d=i(360),f=i(339),p=i(377),g=i(10),v=i(23),m=i(386),y=i(25),x=i(391),T=i(392),w=i(394),E=i(136),b=i(399),S=i(361),A=i(363),_=i(403),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new b(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),l(this),u(this),d(this),n(this.canvas,this.config.parent),this.textures.once(E.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(137);t.exports=function(t){var e,i=t.config;i.parent&&i.domCreateContainer&&((e=document.createElement("div")).style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=e,n(e,i.parent))}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s=i.getElementsByTagName("SubTexture"),r=0;r=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,s=t.indexOf(e);return-1!==s&&st.length-1)throw new Error("Index out of bounds");var s=r(t,e);return i&&i.call(n,s),s}},function(t,e,i){var u=i(77);t.exports=function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),u(t,e,i)){var r=i-e,o=t.splice(e,r);if(n)for(var a=0;a?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var R=i(6);t.exports=function(t,e){var i=e.width,n=e.height,s=Math.floor(i/2),r=Math.floor(n/2),o=R(e,"chars","");if(""!==o){var a=R(e,"image",""),h=t.sys.textures.getFrame(a),u=h.cutX,l=h.cutY,c=h.source.width,d=h.source.height,f=R(e,"offset.x",0),p=R(e,"offset.y",0),g=R(e,"spacing.x",0),v=R(e,"spacing.y",0),m=R(e,"lineSpacing",0),y=R(e,"charsPerRow",null);null===y&&(y=c/i)>o.length&&(y=o.length);for(var x=f,T=p,w={retroFont:!0,font:a,size:i,lineHeight:n+m,chars:{}},E=0,b=0;b=i&&t.x<=n&&t.y>=s&&t.y<=r}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||s=n&&(p.push(v),f=v)}var m=o[o.length-1];return y(f,m)i&&(i=a.x),a.xs&&(s=a.y),a.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var r=i(9);t.exports=function(t,e,i,n,s){return void 0===s&&(s=new r),s.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var r=i(182);t.exports=function(t,e,i){var n=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),r(t,n,s)}},function(t,e,i){var n=i(9),s=i(112);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var a=i(4),h=i(34);t.exports=function(t,e,i){void 0===i&&(i=new a),e=h(e);var n=Math.sin(e),s=Math.cos(e),r=0=s||0=t.downTime+n)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],s=this;try{var r=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return s.state=o.FILE_ERRORED,void s.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){u.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){u.revokeObjectURL(s.data),s.onProcessError()},u.createObjectURL(this.data,r,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});s.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(a.UPDATE,this.step,this),t.events.emit(a.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(a.SHUTDOWN,this.shutdown,this),t.off(a.POST_UPDATE,this.step,this),t.off(a.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});r.register("ScenePlugin",o,"scenePlugin"),t.exports=o},function(t,e,i){t.exports={Events:i(415),List:i(105),Map:i(98),ProcessQueue:i(202),RTree:i(508),Set:i(145),Size:i(393)}},function(t,e,i){var n=i(18),s=i(1390),r=n(!1,r={CanvasTexture:i(400),Events:i(136),FilterMode:s,Frame:i(104),Parsers:i(402),Texture:i(197),TextureManager:i(399),TextureSource:i(401)},s);t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(18),s=i(1392),r=n(!1,r={Components:i(243),Parsers:i(1425),Formats:i(38),ImageCollection:i(555),ParseToTilemap:i(253),Tile:i(81),Tilemap:i(559),TilemapCreator:i(1431),TilemapFactory:i(1432),Tileset:i(119),TilemapLayer:i(560),Orientation:i(29),LayerData:i(117),MapData:i(118),ObjectLayer:i(551)},s.ORIENTATION);t.exports=r},function(t,e,i){var n={FromOrientationString:i(242),ORIENTATION:i(29)};t.exports=n},function(t,e,i){var p=i(26),g=i(60);t.exports=function(t,e,i,n,s,r,o,a){void 0===o&&(o=!0),t<0&&(t=0),e<0&&(e=0);for(var h=p(t,e,i,n,null,a),u=s-t,l=r-e,c=0;c=t&&u.index<=e&&l(u,i)}n&&c(0,0,s.width,s.height,s)}}},function(t,e,i){var a=i(69),h=i(60),u=i(153);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s=s.delay&&(n=s.elapsed-s.delay,s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),0>2],s+=o[(3&i[r])<<4|i[r+1]>>4],s+=o[(15&i[r+1])<<2|i[r+2]>>6],s+=o[63&i[r+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}},function(t,e,i){t.exports={Clone:i(76),DeepCopy:i(167),Extend:i(18),GetAdvancedValue:i(15),GetFastValue:i(2),GetMinMaxValue:i(1457),GetValue:i(6),HasAll:i(1458),HasAny:i(432),HasValue:i(123),IsPlainObject:i(7),Merge:i(140),MergeRight:i(1459),Pick:i(550),SetValue:i(455)}},function(t,e,i){var o=i(6),a=i(16);t.exports=function(t,e,i,n,s){void 0===s&&(s=i);var r=o(t,e,s);return a(r,i,n)}},function(t,e){t.exports=function(t,e){for(var i=0;i - * @author Felipe Alfonso <@bitnenfer> - * @author Matthew Groves <@doormat> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Generate shader source to test maximum ifs. - * - * @private - * @param {number} maxIfs - The number of if statements to generate - */ -function GenerateSrc (maxIfs) -{ - var src = ''; - - for (var i = 0; i < maxIfs; ++i) - { - if (i > 0) - { - src += '\nelse '; - } - - if (i < maxIfs - 1) - { - src += 'if(test == ' + i + '.0){}'; - } - } - - return src; -} - -/** - * @namespace Phaser.Renderer.WebGL.Utils - * @since 3.0.0 - */ -module.exports = { - - /** - * Packs four floats on a range from 0.0 to 1.0 into a single Uint32 - * - * @function Phaser.Renderer.WebGL.Utils.getTintFromFloats - * @since 3.0.0 - * - * @param {number} r - Red component in a range from 0.0 to 1.0 - * @param {number} g - Green component in a range from 0.0 to 1.0 - * @param {number} b - Blue component in a range from 0.0 to 1.0 - * @param {number} a - Alpha component in a range from 0.0 to 1.0 - * - * @return {number} The packed RGBA values as a Uint32. - */ - getTintFromFloats: function (r, g, b, a) - { - var ur = ((r * 255.0)|0) & 0xFF; - var ug = ((g * 255.0)|0) & 0xFF; - var ub = ((b * 255.0)|0) & 0xFF; - var ua = ((a * 255.0)|0) & 0xFF; - - return ((ua << 24) | (ur << 16) | (ug << 8) | ub) >>> 0; - }, - - /** - * Packs a Uint24, representing RGB components, with a Float32, representing - * the alpha component, with a range between 0.0 and 1.0 and return a Uint32 - * - * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha - * @since 3.0.0 - * - * @param {number} rgb - Uint24 representing RGB components - * @param {number} a - Float32 representing Alpha component - * - * @return {number} Packed RGBA as Uint32 - */ - getTintAppendFloatAlpha: function (rgb, a) - { - var ua = ((a * 255.0)|0) & 0xFF; - return ((ua << 24) | rgb) >>> 0; - }, - - /** - * Packs a Uint24, representing RGB components, with a Float32, representing - * the alpha component, with a range between 0.0 and 1.0 and return a - * swizzled Uint32 - * - * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlphaAndSwap - * @since 3.0.0 - * - * @param {number} rgb - Uint24 representing RGB components - * @param {number} a - Float32 representing Alpha component - * - * @return {number} Packed RGBA as Uint32 - */ - getTintAppendFloatAlphaAndSwap: function (rgb, a) - { - var ur = ((rgb >> 16)|0) & 0xff; - var ug = ((rgb >> 8)|0) & 0xff; - var ub = (rgb|0) & 0xff; - var ua = ((a * 255.0)|0) & 0xFF; - - return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; - }, - - /** - * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0 - * - * @function Phaser.Renderer.WebGL.Utils.getFloatsFromUintRGB - * @since 3.0.0 - * - * @param {number} rgb - RGB packed as a Uint24 - * - * @return {array} Array of floats representing each component as a float - */ - getFloatsFromUintRGB: function (rgb) - { - var ur = ((rgb >> 16)|0) & 0xff; - var ug = ((rgb >> 8)|0) & 0xff; - var ub = (rgb|0) & 0xff; - - return [ ur / 255.0, ug / 255.0, ub / 255.0 ]; - }, - - /** - * Counts how many attributes of 32 bits a vertex has - * - * @function Phaser.Renderer.WebGL.Utils.getComponentCount - * @since 3.0.0 - * - * @param {array} attributes - Array of attributes - * @param {WebGLRenderingContext} glContext - WebGLContext used for check types - * - * @return {number} Count of 32 bit attributes in vertex - */ - getComponentCount: function (attributes, glContext) - { - var count = 0; - - for (var index = 0; index < attributes.length; ++index) - { - var element = attributes[index]; - - if (element.type === glContext.FLOAT) - { - count += element.size; - } - else - { - count += 1; // We'll force any other type to be 32 bit. for now - } - } - - return count; - }, - - /** - * Check to see how many texture units the GPU supports, based on the given config value. - * Then tests this against the maximum number of iterations GLSL can support. - * - * @function Phaser.Renderer.WebGL.Utils.checkShaderMax - * @since 3.50.0 - * - * @param {WebGLRenderingContext} gl - The WebGLContext used to create the shaders. - * @param {number} maxTextures - The Game Config maxTextures value. - * - * @return {number} The number of texture units that is supported by this browser and GPU. - */ - checkShaderMax: function (gl, maxTextures) - { - if (!maxTextures || maxTextures === -1) - { - maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); - } - - var shader = gl.createShader(gl.FRAGMENT_SHADER); - - var fragTemplate = [ - 'precision mediump float;', - 'void main(void){', - 'float test = 0.1;', - '%forloop%', - 'gl_FragColor = vec4(0.0);', - '}' - ].join('\n'); - - // eslint-disable-next-line no-constant-condition - while (true) - { - var fragmentSrc = fragTemplate.replace(/%forloop%/gi, GenerateSrc(maxTextures)); - - gl.shaderSource(shader, fragmentSrc); - gl.compileShader(shader); - - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) - { - maxTextures = (maxTextures / 2) | 0; - } - else - { - // valid! - break; - } - } - - return maxTextures; - }, - - /** - * Checks the given Fragment Shader Source for `%count%` and `%forloop%` declarations and - * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. - * - * @function Phaser.Renderer.WebGL.Utils.parseFragmentShaderMaxTextures - * @since 3.50.0 - * - * @param {string} fragmentShaderSource - The Fragment Shader source code to operate on. - * @param {number} maxTextures - The number of maxTextures value. - * - * @return {string} The modified Fragment Shader source. - */ - parseFragmentShaderMaxTextures: function (fragmentShaderSource, maxTextures) - { - var src = ''; - - for (var i = 0; i < maxTextures; i++) - { - if (i > 0) - { - src += '\n\telse '; - } - - if (i < maxTextures - 1) - { - src += 'if (outTexId < ' + i + '.5)'; - } - - src += '\n\t{'; - src += '\n\t\ttexture = texture2D(uMainSampler[' + i + '], outTexCoord);'; - src += '\n\t}'; - } - - fragmentShaderSource = fragmentShaderSource.replace(/%count%/gi, maxTextures.toString()); - - return fragmentShaderSource.replace(/%forloop%/gi, src); - } -}; - - -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Components - */ - -module.exports = { - - Alpha: __webpack_require__(562), - AlphaSingle: __webpack_require__(280), - BlendMode: __webpack_require__(281), - ComputedSize: __webpack_require__(563), - Crop: __webpack_require__(564), - Depth: __webpack_require__(282), - Flip: __webpack_require__(565), - GetBounds: __webpack_require__(566), - Mask: __webpack_require__(286), - Origin: __webpack_require__(583), - PathFollower: __webpack_require__(584), - Pipeline: __webpack_require__(165), - ScrollFactor: __webpack_require__(289), - Size: __webpack_require__(585), - Texture: __webpack_require__(586), - TextureCrop: __webpack_require__(587), - Tint: __webpack_require__(588), - ToJSON: __webpack_require__(290), - Transform: __webpack_require__(291), - TransformMatrix: __webpack_require__(31), - Visible: __webpack_require__(292) - -}; - - -/***/ }), -/* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -2860,6 +2570,273 @@ if (true) { } +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Components + */ + +module.exports = { + + Alpha: __webpack_require__(601), + AlphaSingle: __webpack_require__(295), + BlendMode: __webpack_require__(296), + ComputedSize: __webpack_require__(602), + Crop: __webpack_require__(603), + Depth: __webpack_require__(297), + Flip: __webpack_require__(604), + GetBounds: __webpack_require__(605), + Mask: __webpack_require__(301), + Origin: __webpack_require__(622), + PathFollower: __webpack_require__(623), + Pipeline: __webpack_require__(166), + ScrollFactor: __webpack_require__(304), + Size: __webpack_require__(624), + Texture: __webpack_require__(625), + TextureCrop: __webpack_require__(626), + Tint: __webpack_require__(627), + ToJSON: __webpack_require__(168), + Transform: __webpack_require__(305), + TransformMatrix: __webpack_require__(24), + Visible: __webpack_require__(306) + +}; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @author Matthew Groves <@doormat> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Generate shader source to test maximum ifs. + * + * @private + * @ignore + * @param {number} maxIfs - The number of if statements to generate + */ +function GenerateSrc (maxIfs) +{ + var src = ''; + + for (var i = 0; i < maxIfs; ++i) + { + if (i > 0) + { + src += '\nelse '; + } + + if (i < maxIfs - 1) + { + src += 'if(test == ' + i + '.0){}'; + } + } + + return src; +} + +/** + * @namespace Phaser.Renderer.WebGL.Utils + * @since 3.0.0 + */ +module.exports = { + + /** + * Packs four floats on a range from 0.0 to 1.0 into a single Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintFromFloats + * @since 3.0.0 + * + * @param {number} r - Red component in a range from 0.0 to 1.0 + * @param {number} g - Green component in a range from 0.0 to 1.0 + * @param {number} b - Blue component in a range from 0.0 to 1.0 + * @param {number} a - Alpha component in a range from 0.0 to 1.0 + * + * @return {number} The packed RGBA values as a Uint32. + */ + getTintFromFloats: function (r, g, b, a) + { + var ur = ((r * 255) | 0) & 0xff; + var ug = ((g * 255) | 0) & 0xff; + var ub = ((b * 255) | 0) & 0xff; + var ua = ((a * 255) | 0) & 0xff; + + return ((ua << 24) | (ur << 16) | (ug << 8) | ub) >>> 0; + }, + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlpha + * @since 3.0.0 + * + * @param {number} rgb - Uint24 representing RGB components + * @param {number} a - Float32 representing Alpha component + * + * @return {number} Packed RGBA as Uint32 + */ + getTintAppendFloatAlpha: function (rgb, a) + { + var ua = ((a * 255) | 0) & 0xff; + + return ((ua << 24) | rgb) >>> 0; + }, + + /** + * Packs a Uint24, representing RGB components, with a Float32, representing + * the alpha component, with a range between 0.0 and 1.0 and return a + * swizzled Uint32 + * + * @function Phaser.Renderer.WebGL.Utils.getTintAppendFloatAlphaAndSwap + * @since 3.0.0 + * + * @param {number} rgb - Uint24 representing RGB components + * @param {number} a - Float32 representing Alpha component + * + * @return {number} Packed RGBA as Uint32 + */ + getTintAppendFloatAlphaAndSwap: function (rgb, a) + { + var ur = ((rgb >> 16) | 0) & 0xff; + var ug = ((rgb >> 8) | 0) & 0xff; + var ub = (rgb | 0) & 0xff; + var ua = ((a * 255) | 0) & 0xff; + + return ((ua << 24) | (ub << 16) | (ug << 8) | ur) >>> 0; + }, + + /** + * Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0 + * + * @function Phaser.Renderer.WebGL.Utils.getFloatsFromUintRGB + * @since 3.0.0 + * + * @param {number} rgb - RGB packed as a Uint24 + * + * @return {array} Array of floats representing each component as a float + */ + getFloatsFromUintRGB: function (rgb) + { + var ur = ((rgb >> 16) | 0) & 0xff; + var ug = ((rgb >> 8) | 0) & 0xff; + var ub = (rgb | 0) & 0xff; + + return [ ur / 255, ug / 255, ub / 255 ]; + }, + + /** + * Check to see how many texture units the GPU supports, based on the given config value. + * Then tests this against the maximum number of iterations GLSL can support. + * + * @function Phaser.Renderer.WebGL.Utils.checkShaderMax + * @since 3.50.0 + * + * @param {WebGLRenderingContext} gl - The WebGLContext used to create the shaders. + * @param {number} maxTextures - The Game Config maxTextures value. + * + * @return {number} The number of texture units that is supported by this browser and GPU. + */ + checkShaderMax: function (gl, maxTextures) + { + if (!maxTextures || maxTextures === -1) + { + maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); + } + + var shader = gl.createShader(gl.FRAGMENT_SHADER); + + var fragTemplate = [ + 'precision mediump float;', + 'void main(void){', + 'float test = 0.1;', + '%forloop%', + 'gl_FragColor = vec4(0.0);', + '}' + ].join('\n'); + + // eslint-disable-next-line no-constant-condition + while (true) + { + var fragmentSrc = fragTemplate.replace(/%forloop%/gi, GenerateSrc(maxTextures)); + + gl.shaderSource(shader, fragmentSrc); + gl.compileShader(shader); + + if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) + { + maxTextures = (maxTextures / 2) | 0; + } + else + { + // valid! + break; + } + } + + return maxTextures; + }, + + /** + * Checks the given Fragment Shader Source for `%count%` and `%forloop%` declarations and + * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. + * + * @function Phaser.Renderer.WebGL.Utils.parseFragmentShaderMaxTextures + * @since 3.50.0 + * + * @param {string} fragmentShaderSource - The Fragment Shader source code to operate on. + * @param {number} maxTextures - The number of maxTextures value. + * + * @return {string} The modified Fragment Shader source. + */ + parseFragmentShaderMaxTextures: function (fragmentShaderSource, maxTextures) + { + if (!fragmentShaderSource) + { + return ''; + } + + var src = ''; + + for (var i = 0; i < maxTextures; i++) + { + if (i > 0) + { + src += '\n\telse '; + } + + if (i < maxTextures - 1) + { + src += 'if (outTexId < ' + i + '.5)'; + } + + src += '\n\t{'; + src += '\n\t\ttexture = texture2D(uMainSampler[' + i + '], outTexCoord);'; + src += '\n\t}'; + } + + fragmentShaderSource = fragmentShaderSource.replace(/%count%/gi, maxTextures.toString()); + + return fragmentShaderSource.replace(/%forloop%/gi, src); + } +}; + + /***/ }), /* 13 */ /***/ (function(module, exports) { @@ -2963,10 +2940,10 @@ module.exports = MATH_CONST; */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(290); -var DataManager = __webpack_require__(120); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(29); +var ComponentsToJSON = __webpack_require__(168); +var DataManager = __webpack_require__(97); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(32); /** * @classdesc @@ -2994,16 +2971,33 @@ var GameObject = new Class({ EventEmitter.call(this); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * * @name Phaser.GameObjects.GameObject#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.GameObject#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + /** * A textual representation of this Game Object, i.e. `sprite`. * Used internally by Phaser but is available for your own custom classes to populate. @@ -3025,7 +3019,7 @@ var GameObject = new Class({ * If you need to store complex data about your Game Object, look at using the Data Component instead. * * @name Phaser.GameObjects.GameObject#state - * @type {(integer|string)} + * @type {(number|string)} * @since 3.16.0 */ this.state = 0; @@ -3067,7 +3061,7 @@ var GameObject = new Class({ * Reserved for future use by plugins and the Input Manager. * * @name Phaser.GameObjects.GameObject#tabIndex - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -3091,7 +3085,7 @@ var GameObject = new Class({ * If those components are not used by your custom class then you can use this bitmask as you wish. * * @name Phaser.GameObjects.GameObject#renderFlags - * @type {integer} + * @type {number} * @default 15 * @since 3.0.0 */ @@ -3199,7 +3193,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#setState * @since 3.16.0 * - * @param {(integer|string)} value - The state of the Game Object. + * @param {(number|string)} value - The state of the Game Object. * * @return {this} This GameObject. */ @@ -3565,7 +3559,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#getIndexList * @since 3.4.0 * - * @return {integer[]} An array of display list position indexes. + * @return {number[]} An array of display list position indexes. */ getIndexList: function () { @@ -3634,16 +3628,15 @@ var GameObject = new Class({ this.emit(Events.DESTROY, this); - var sys = this.scene.sys; - if (!fromScene) { - sys.displayList.remove(this); + this.displayList.remove(this); } if (this.input) { - sys.input.clear(this); + this.scene.sys.input.clear(this); + this.input = undefined; } @@ -3657,20 +3650,23 @@ var GameObject = new Class({ if (this.body) { this.body.destroy(); + this.body = undefined; } + this.resetPostPipeline(true); + // Tell the Scene to re-sort the children if (!fromScene) { - sys.queueDepthSort(); + this.displayList.queueDepthSort(); } this.active = false; this.visible = false; this.scene = undefined; - + this.displayList = undefined; this.parentContainer = undefined; this.removeAllListeners(); @@ -3681,7 +3677,7 @@ var GameObject = new Class({ /** * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. * - * @constant {integer} RENDER_MASK + * @constant {number} RENDER_MASK * @memberof Phaser.GameObjects.GameObject * @default */ @@ -3700,7 +3696,7 @@ module.exports = GameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(180); +var MATH = __webpack_require__(185); var GetValue = __webpack_require__(6); /** @@ -3779,6 +3775,36 @@ module.exports = GetAdvancedValue; /***/ }), /* 16 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Force a value within the boundaries by clamping it to the range `min`, `max`. + * + * @function Phaser.Math.Clamp + * @since 3.0.0 + * + * @param {number} value - The value to be clamped. + * @param {number} min - The minimum bounds. + * @param {number} max - The maximum bounds. + * + * @return {number} The clamped value. + */ +var Clamp = function (value, min, max) +{ + return Math.max(min, Math.min(max, value)); +}; + +module.exports = Clamp; + + +/***/ }), +/* 17 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3788,7 +3814,7 @@ module.exports = GetAdvancedValue; */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -3957,190 +3983,8 @@ PluginCache.register('GameObjectCreator', GameObjectCreator, 'make'); module.exports = GameObjectCreator; -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Force a value within the boundaries by clamping it to the range `min`, `max`. - * - * @function Phaser.Math.Clamp - * @since 3.0.0 - * - * @param {number} value - The value to be clamped. - * @param {number} min - The minimum bounds. - * @param {number} max - The maximum bounds. - * - * @return {number} The clamped value. - */ -var Clamp = function (value, min, max) -{ - return Math.max(min, Math.min(max, value)); -}; - -module.exports = Clamp; - - /***/ }), /* 18 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var FILE_CONST = { - - /** - * The Loader is idle. - * - * @name Phaser.Loader.LOADER_IDLE - * @type {integer} - * @since 3.0.0 - */ - LOADER_IDLE: 0, - - /** - * The Loader is actively loading. - * - * @name Phaser.Loader.LOADER_LOADING - * @type {integer} - * @since 3.0.0 - */ - LOADER_LOADING: 1, - - /** - * The Loader is processing files is has loaded. - * - * @name Phaser.Loader.LOADER_PROCESSING - * @type {integer} - * @since 3.0.0 - */ - LOADER_PROCESSING: 2, - - /** - * The Loader has completed loading and processing. - * - * @name Phaser.Loader.LOADER_COMPLETE - * @type {integer} - * @since 3.0.0 - */ - LOADER_COMPLETE: 3, - - /** - * The Loader is shutting down. - * - * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {integer} - * @since 3.0.0 - */ - LOADER_SHUTDOWN: 4, - - /** - * The Loader has been destroyed. - * - * @name Phaser.Loader.LOADER_DESTROYED - * @type {integer} - * @since 3.0.0 - */ - LOADER_DESTROYED: 5, - - /** - * File is in the load queue but not yet started - * - * @name Phaser.Loader.FILE_PENDING - * @type {integer} - * @since 3.0.0 - */ - FILE_PENDING: 10, - - /** - * File has been started to load by the loader (onLoad called) - * - * @name Phaser.Loader.FILE_LOADING - * @type {integer} - * @since 3.0.0 - */ - FILE_LOADING: 11, - - /** - * File has loaded successfully, awaiting processing - * - * @name Phaser.Loader.FILE_LOADED - * @type {integer} - * @since 3.0.0 - */ - FILE_LOADED: 12, - - /** - * File failed to load - * - * @name Phaser.Loader.FILE_FAILED - * @type {integer} - * @since 3.0.0 - */ - FILE_FAILED: 13, - - /** - * File is being processed (onProcess callback) - * - * @name Phaser.Loader.FILE_PROCESSING - * @type {integer} - * @since 3.0.0 - */ - FILE_PROCESSING: 14, - - /** - * The File has errored somehow during processing. - * - * @name Phaser.Loader.FILE_ERRORED - * @type {integer} - * @since 3.0.0 - */ - FILE_ERRORED: 16, - - /** - * File has finished processing. - * - * @name Phaser.Loader.FILE_COMPLETE - * @type {integer} - * @since 3.0.0 - */ - FILE_COMPLETE: 17, - - /** - * File has been destroyed - * - * @name Phaser.Loader.FILE_DESTROYED - * @type {integer} - * @since 3.0.0 - */ - FILE_DESTROYED: 18, - - /** - * File was populated from local data and doesn't need an HTTP request - * - * @name Phaser.Loader.FILE_POPULATED - * @type {integer} - * @since 3.0.0 - */ - FILE_POPULATED: 19 - -}; - -module.exports = FILE_CONST; - - -/***/ }), -/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4240,6 +4084,158 @@ var Extend = function () module.exports = Extend; +/***/ }), +/* 19 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var FILE_CONST = { + + /** + * The Loader is idle. + * + * @name Phaser.Loader.LOADER_IDLE + * @type {number} + * @since 3.0.0 + */ + LOADER_IDLE: 0, + + /** + * The Loader is actively loading. + * + * @name Phaser.Loader.LOADER_LOADING + * @type {number} + * @since 3.0.0 + */ + LOADER_LOADING: 1, + + /** + * The Loader is processing files is has loaded. + * + * @name Phaser.Loader.LOADER_PROCESSING + * @type {number} + * @since 3.0.0 + */ + LOADER_PROCESSING: 2, + + /** + * The Loader has completed loading and processing. + * + * @name Phaser.Loader.LOADER_COMPLETE + * @type {number} + * @since 3.0.0 + */ + LOADER_COMPLETE: 3, + + /** + * The Loader is shutting down. + * + * @name Phaser.Loader.LOADER_SHUTDOWN + * @type {number} + * @since 3.0.0 + */ + LOADER_SHUTDOWN: 4, + + /** + * The Loader has been destroyed. + * + * @name Phaser.Loader.LOADER_DESTROYED + * @type {number} + * @since 3.0.0 + */ + LOADER_DESTROYED: 5, + + /** + * File is in the load queue but not yet started + * + * @name Phaser.Loader.FILE_PENDING + * @type {number} + * @since 3.0.0 + */ + FILE_PENDING: 10, + + /** + * File has been started to load by the loader (onLoad called) + * + * @name Phaser.Loader.FILE_LOADING + * @type {number} + * @since 3.0.0 + */ + FILE_LOADING: 11, + + /** + * File has loaded successfully, awaiting processing + * + * @name Phaser.Loader.FILE_LOADED + * @type {number} + * @since 3.0.0 + */ + FILE_LOADED: 12, + + /** + * File failed to load + * + * @name Phaser.Loader.FILE_FAILED + * @type {number} + * @since 3.0.0 + */ + FILE_FAILED: 13, + + /** + * File is being processed (onProcess callback) + * + * @name Phaser.Loader.FILE_PROCESSING + * @type {number} + * @since 3.0.0 + */ + FILE_PROCESSING: 14, + + /** + * The File has errored somehow during processing. + * + * @name Phaser.Loader.FILE_ERRORED + * @type {number} + * @since 3.0.0 + */ + FILE_ERRORED: 16, + + /** + * File has finished processing. + * + * @name Phaser.Loader.FILE_COMPLETE + * @type {number} + * @since 3.0.0 + */ + FILE_COMPLETE: 17, + + /** + * File has been destroyed + * + * @name Phaser.Loader.FILE_DESTROYED + * @type {number} + * @since 3.0.0 + */ + FILE_DESTROYED: 18, + + /** + * File was populated from local data and doesn't need an HTTP request + * + * @name Phaser.Loader.FILE_POPULATED + * @type {number} + * @since 3.0.0 + */ + FILE_POPULATED: 19 + +}; + +module.exports = FILE_CONST; + + /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { @@ -4256,27 +4252,27 @@ module.exports = Extend; module.exports = { - ADDED_TO_SCENE: __webpack_require__(733), - BOOT: __webpack_require__(734), - CREATE: __webpack_require__(735), - DESTROY: __webpack_require__(736), - PAUSE: __webpack_require__(737), - POST_UPDATE: __webpack_require__(738), - PRE_UPDATE: __webpack_require__(739), - READY: __webpack_require__(740), - REMOVED_FROM_SCENE: __webpack_require__(741), - RENDER: __webpack_require__(742), - RESUME: __webpack_require__(743), - SHUTDOWN: __webpack_require__(744), - SLEEP: __webpack_require__(745), - START: __webpack_require__(746), - TRANSITION_COMPLETE: __webpack_require__(747), - TRANSITION_INIT: __webpack_require__(748), - TRANSITION_OUT: __webpack_require__(749), - TRANSITION_START: __webpack_require__(750), - TRANSITION_WAKE: __webpack_require__(751), - UPDATE: __webpack_require__(752), - WAKE: __webpack_require__(753) + ADDED_TO_SCENE: __webpack_require__(774), + BOOT: __webpack_require__(775), + CREATE: __webpack_require__(776), + DESTROY: __webpack_require__(777), + PAUSE: __webpack_require__(778), + POST_UPDATE: __webpack_require__(779), + PRE_UPDATE: __webpack_require__(780), + READY: __webpack_require__(781), + REMOVED_FROM_SCENE: __webpack_require__(782), + RENDER: __webpack_require__(783), + RESUME: __webpack_require__(784), + SHUTDOWN: __webpack_require__(785), + SLEEP: __webpack_require__(786), + START: __webpack_require__(787), + TRANSITION_COMPLETE: __webpack_require__(788), + TRANSITION_INIT: __webpack_require__(789), + TRANSITION_OUT: __webpack_require__(790), + TRANSITION_START: __webpack_require__(791), + TRANSITION_WAKE: __webpack_require__(792), + UPDATE: __webpack_require__(793), + WAKE: __webpack_require__(794) }; @@ -4291,31 +4287,66 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + +var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; + /** - * @namespace Phaser.Core.Events + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * + * @function Phaser.GameObjects.GetCalcMatrix + * @memberof Phaser.GameObjects + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. + * + * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. */ +var GetCalcMatrix = function (src, camera, parentMatrix) +{ + var camMatrix = tempMatrix1; + var spriteMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; -module.exports = { + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - BLUR: __webpack_require__(567), - BOOT: __webpack_require__(568), - CONTEXT_LOST: __webpack_require__(569), - CONTEXT_RESTORED: __webpack_require__(570), - DESTROY: __webpack_require__(571), - FOCUS: __webpack_require__(572), - HIDDEN: __webpack_require__(573), - PAUSE: __webpack_require__(574), - POST_RENDER: __webpack_require__(575), - POST_STEP: __webpack_require__(576), - PRE_RENDER: __webpack_require__(577), - PRE_STEP: __webpack_require__(578), - READY: __webpack_require__(579), - RESUME: __webpack_require__(580), - STEP: __webpack_require__(581), - VISIBLE: __webpack_require__(582) + camMatrix.copyFrom(camera.matrix); + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + return result; }; +module.exports = GetCalcMatrix; + /***/ }), /* 22 */ @@ -4328,13 +4359,13 @@ module.exports = { */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var Events = __webpack_require__(84); +var CONST = __webpack_require__(19); +var Events = __webpack_require__(89); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(146); -var MergeXHRSettings = __webpack_require__(226); -var XHRLoader = __webpack_require__(477); -var XHRSettings = __webpack_require__(147); +var GetURL = __webpack_require__(148); +var MergeXHRSettings = __webpack_require__(232); +var XHRLoader = __webpack_require__(494); +var XHRSettings = __webpack_require__(149); /** * @classdesc @@ -4400,7 +4431,18 @@ var File = new Class({ if (!this.type || !this.key) { - throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + throw new Error('Invalid Loader.' + this.type + ' key'); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; } /** @@ -4414,16 +4456,7 @@ var File = new Class({ * @type {object|string} * @since 3.0.0 */ - this.url = GetFastValue(fileConfig, 'url'); - - if (this.url === undefined) - { - this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof this.url === 'string' && this.url.indexOf('blob:') !== 0 && this.url.indexOf('data:') !== 0) - { - this.url = loader.path + this.url; - } + this.url = url; /** * The final URL this file will load from, including baseURL and path. @@ -4462,7 +4495,7 @@ var File = new Class({ * The current state of the file. One of the FILE_CONST values. * * @name Phaser.Loader.File#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; @@ -4867,857 +4900,6 @@ module.exports = File; /***/ }), /* 23 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Contains the plugins that Phaser uses globally and locally. -// These are the source objects, not instantiated. -var corePlugins = {}; - -// Contains the plugins that the dev has loaded into their game -// These are the source objects, not instantiated. -var customPlugins = {}; - -var PluginCache = {}; - -/** - * @namespace Phaser.Plugins.PluginCache - */ - -/** - * Static method called directly by the Core internal Plugins. - * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) - * Plugin is the object to instantiate to create the plugin - * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) - * - * @method Phaser.Plugins.PluginCache.register - * @since 3.8.0 - * - * @param {string} key - A reference used to get this plugin from the plugin cache. - * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. - * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. - * @param {boolean} [custom=false] - Core Scene plugin or a Custom Scene plugin? - */ -PluginCache.register = function (key, plugin, mapping, custom) -{ - if (custom === undefined) { custom = false; } - - corePlugins[key] = { plugin: plugin, mapping: mapping, custom: custom }; -}; - -/** - * Stores a custom plugin in the global plugin cache. - * The key must be unique, within the scope of the cache. - * - * @method Phaser.Plugins.PluginCache.registerCustom - * @since 3.8.0 - * - * @param {string} key - A reference used to get this plugin from the plugin cache. - * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. - * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. - * @param {?any} data - A value to be passed to the plugin's `init` method. - */ -PluginCache.registerCustom = function (key, plugin, mapping, data) -{ - customPlugins[key] = { plugin: plugin, mapping: mapping, data: data }; -}; - -/** - * Checks if the given key is already being used in the core plugin cache. - * - * @method Phaser.Plugins.PluginCache.hasCore - * @since 3.8.0 - * - * @param {string} key - The key to check for. - * - * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. - */ -PluginCache.hasCore = function (key) -{ - return corePlugins.hasOwnProperty(key); -}; - -/** - * Checks if the given key is already being used in the custom plugin cache. - * - * @method Phaser.Plugins.PluginCache.hasCustom - * @since 3.8.0 - * - * @param {string} key - The key to check for. - * - * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. - */ -PluginCache.hasCustom = function (key) -{ - return customPlugins.hasOwnProperty(key); -}; - -/** - * Returns the core plugin object from the cache based on the given key. - * - * @method Phaser.Plugins.PluginCache.getCore - * @since 3.8.0 - * - * @param {string} key - The key of the core plugin to get. - * - * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. - */ -PluginCache.getCore = function (key) -{ - return corePlugins[key]; -}; - -/** - * Returns the custom plugin object from the cache based on the given key. - * - * @method Phaser.Plugins.PluginCache.getCustom - * @since 3.8.0 - * - * @param {string} key - The key of the custom plugin to get. - * - * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. - */ -PluginCache.getCustom = function (key) -{ - return customPlugins[key]; -}; - -/** - * Returns an object from the custom cache based on the given key that can be instantiated. - * - * @method Phaser.Plugins.PluginCache.getCustomClass - * @since 3.8.0 - * - * @param {string} key - The key of the custom plugin to get. - * - * @return {function} The custom plugin object. - */ -PluginCache.getCustomClass = function (key) -{ - return (customPlugins.hasOwnProperty(key)) ? customPlugins[key].plugin : null; -}; - -/** - * Removes a core plugin based on the given key. - * - * @method Phaser.Plugins.PluginCache.remove - * @since 3.8.0 - * - * @param {string} key - The key of the core plugin to remove. - */ -PluginCache.remove = function (key) -{ - if (corePlugins.hasOwnProperty(key)) - { - delete corePlugins[key]; - } -}; - -/** - * Removes a custom plugin based on the given key. - * - * @method Phaser.Plugins.PluginCache.removeCustom - * @since 3.8.0 - * - * @param {string} key - The key of the custom plugin to remove. - */ -PluginCache.removeCustom = function (key) -{ - if (customPlugins.hasOwnProperty(key)) - { - delete customPlugins[key]; - } -}; - -/** - * Removes all Core Plugins. - * - * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. - * So be sure you only call this if you do not wish to run Phaser again. - * - * @method Phaser.Plugins.PluginCache.destroyCorePlugins - * @since 3.12.0 - */ -PluginCache.destroyCorePlugins = function () -{ - for (var key in corePlugins) - { - if (corePlugins.hasOwnProperty(key)) - { - delete corePlugins[key]; - } - } -}; - -/** - * Removes all Custom Plugins. - * - * @method Phaser.Plugins.PluginCache.destroyCustomPlugins - * @since 3.12.0 - */ -PluginCache.destroyCustomPlugins = function () -{ - for (var key in customPlugins) - { - if (customPlugins.hasOwnProperty(key)) - { - delete customPlugins[key]; - } - } -}; - -module.exports = PluginCache; - - -/***/ }), -/* 24 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetFastValue = __webpack_require__(2); - -/** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * - * @function Phaser.Tilemaps.Components.GetTilesWithin - * @since 3.0.0 - * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.GetTilesWithinFilteringOptions} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. - */ -var GetTilesWithin = function (tileX, tileY, width, height, filteringOptions, layer) -{ - if (tileX === undefined) { tileX = 0; } - if (tileY === undefined) { tileY = 0; } - if (width === undefined) { width = layer.width; } - if (height === undefined) { height = layer.height; } - - var isNotEmpty = GetFastValue(filteringOptions, 'isNotEmpty', false); - var isColliding = GetFastValue(filteringOptions, 'isColliding', false); - var hasInterestingFace = GetFastValue(filteringOptions, 'hasInterestingFace', false); - - // Clip x, y to top left of map, while shrinking width/height to match. - if (tileX < 0) - { - width += tileX; - tileX = 0; - } - - if (tileY < 0) - { - height += tileY; - tileY = 0; - } - - // Clip width and height to bottom right of map. - if (tileX + width > layer.width) - { - width = Math.max(layer.width - tileX, 0); - } - - if (tileY + height > layer.height) - { - height = Math.max(layer.height - tileY, 0); - } - - var results = []; - - for (var ty = tileY; ty < tileY + height; ty++) - { - for (var tx = tileX; tx < tileX + width; tx++) - { - var tile = layer.data[ty][tx]; - - if (tile !== null) - { - if (isNotEmpty && tile.index === -1) - { - continue; - } - - if (isColliding && !tile.collides) - { - continue; - } - - if (hasInterestingFace && !tile.hasInterestingFace) - { - continue; - } - - results.push(tile); - } - } - } - - return results; -}; - -module.exports = GetTilesWithin; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, - * and then sets it to the given value. - * - * The optional `step` property is applied incrementally, multiplied by each item in the array. - * - * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` - * - * @function Phaser.Actions.PropertyValueSet - * @since 3.3.0 - * - * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] - * - * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. - * @param {string} key - The property to be updated. - * @param {number} value - The amount to set the property to. - * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. - * - * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. - */ -var PropertyValueSet = function (items, key, value, step, index, direction) -{ - if (step === undefined) { step = 0; } - if (index === undefined) { index = 0; } - if (direction === undefined) { direction = 1; } - - var i; - var t = 0; - var end = items.length; - - if (direction === 1) - { - // Start to End - for (i = index; i < end; i++) - { - items[i][key] = value + (t * step); - t++; - } - } - else - { - // End to Start - for (i = index; i >= 0; i--) - { - items[i][key] = value + (t * step); - t++; - } - } - - return items; -}; - -module.exports = PropertyValueSet; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(34); -var Smoothing = __webpack_require__(177); - -// The pool into which the canvas elements are placed. -var pool = []; - -// Automatically apply smoothing(false) to created Canvas elements -var _disableContextSmoothing = false; - -/** - * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. - * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, - * which is useless for some of the Phaser pipelines / renderer. - * - * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. - * Which means all instances of Phaser Games on the same page can share the one single pool. - * - * @namespace Phaser.Display.Canvas.CanvasPool - * @since 3.0.0 - */ -var CanvasPool = function () -{ - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. - * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? - * - * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool - */ - var create = function (parent, width, height, canvasType, selfParent) - { - if (width === undefined) { width = 1; } - if (height === undefined) { height = 1; } - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - if (selfParent === undefined) { selfParent = false; } - - var canvas; - var container = first(canvasType); - - if (container === null) - { - container = { - parent: parent, - canvas: document.createElement('canvas'), - type: canvasType - }; - - if (canvasType === CONST.CANVAS) - { - pool.push(container); - } - - canvas = container.canvas; - } - else - { - container.parent = parent; - - canvas = container.canvas; - } - - if (selfParent) - { - container.parent = canvas; - } - - canvas.width = width; - canvas.height = height; - - if (_disableContextSmoothing && canvasType === CONST.CANVAS) - { - Smoothing.disable(canvas.getContext('2d')); - } - - return canvas; - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.create2D - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created canvas. - */ - var create2D = function (parent, width, height) - { - return create(parent, width, height, CONST.CANVAS); - }; - - /** - * Creates a new Canvas DOM element, or pulls one from the pool if free. - * - * @function Phaser.Display.Canvas.CanvasPool.createWebGL - * @since 3.0.0 - * - * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. - * - * @return {HTMLCanvasElement} The created WebGL canvas. - */ - var createWebGL = function (parent, width, height) - { - return create(parent, width, height, CONST.WEBGL); - }; - - /** - * Gets the first free canvas index from the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.first - * @since 3.0.0 - * - * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. - * - * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. - */ - var first = function (canvasType) - { - if (canvasType === undefined) { canvasType = CONST.CANVAS; } - - if (canvasType === CONST.WEBGL) - { - return null; - } - - for (var i = 0; i < pool.length; i++) - { - var container = pool[i]; - - if (!container.parent && container.type === canvasType) - { - return container; - } - } - - return null; - }; - - /** - * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. - * The canvas has its width and height set to 1, and its parent attribute nulled. - * - * @function Phaser.Display.Canvas.CanvasPool.remove - * @since 3.0.0 - * - * @param {*} parent - The canvas or the parent of the canvas to free. - */ - var remove = function (parent) - { - // Check to see if the parent is a canvas object - var isCanvas = parent instanceof HTMLCanvasElement; - - pool.forEach(function (container) - { - if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) - { - container.parent = null; - container.canvas.width = 1; - container.canvas.height = 1; - } - }); - }; - - /** - * Gets the total number of used canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.total - * @since 3.0.0 - * - * @return {integer} The number of used canvases. - */ - var total = function () - { - var c = 0; - - pool.forEach(function (container) - { - if (container.parent) - { - c++; - } - }); - - return c; - }; - - /** - * Gets the total number of free canvas elements in the pool. - * - * @function Phaser.Display.Canvas.CanvasPool.free - * @since 3.0.0 - * - * @return {integer} The number of free canvases. - */ - var free = function () - { - return pool.length - total(); - }; - - /** - * Disable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing - * @since 3.0.0 - */ - var disableSmoothing = function () - { - _disableContextSmoothing = true; - }; - - /** - * Enable context smoothing on any new Canvas element created. - * - * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing - * @since 3.0.0 - */ - var enableSmoothing = function () - { - _disableContextSmoothing = false; - }; - - return { - create2D: create2D, - create: create, - createWebGL: createWebGL, - disableSmoothing: disableSmoothing, - enableSmoothing: enableSmoothing, - first: first, - free: free, - pool: pool, - remove: remove, - total: total - }; -}; - -// If we export the called function here, it'll only be invoked once (not every time it's required). -module.exports = CanvasPool(); - - -/***/ }), -/* 27 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(54); -var GetAdvancedValue = __webpack_require__(15); - -/** - * Builds a Game Object using the provided configuration object. - * - * @function Phaser.GameObjects.BuildGameObject - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - A reference to the Scene. - * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. - * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. - * - * @return {Phaser.GameObjects.GameObject} The built Game Object. - */ -var BuildGameObject = function (scene, gameObject, config) -{ - // Position - - gameObject.x = GetAdvancedValue(config, 'x', 0); - gameObject.y = GetAdvancedValue(config, 'y', 0); - gameObject.depth = GetAdvancedValue(config, 'depth', 0); - - // Flip - - gameObject.flipX = GetAdvancedValue(config, 'flipX', false); - gameObject.flipY = GetAdvancedValue(config, 'flipY', false); - - // Scale - // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} - - var scale = GetAdvancedValue(config, 'scale', null); - - if (typeof scale === 'number') - { - gameObject.setScale(scale); - } - else if (scale !== null) - { - gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); - gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); - } - - // ScrollFactor - // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} - - var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); - - if (typeof scrollFactor === 'number') - { - gameObject.setScrollFactor(scrollFactor); - } - else if (scrollFactor !== null) - { - gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); - gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); - } - - // Rotation - - gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); - - var angle = GetAdvancedValue(config, 'angle', null); - - if (angle !== null) - { - gameObject.angle = angle; - } - - // Alpha - - gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); - - // Origin - // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} - - var origin = GetAdvancedValue(config, 'origin', null); - - if (typeof origin === 'number') - { - gameObject.setOrigin(origin); - } - else if (origin !== null) - { - var ox = GetAdvancedValue(origin, 'x', 0.5); - var oy = GetAdvancedValue(origin, 'y', 0.5); - - gameObject.setOrigin(ox, oy); - } - - // BlendMode - - gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); - - // Visible - - gameObject.visible = GetAdvancedValue(config, 'visible', true); - - // Add to Scene - - var add = GetAdvancedValue(config, 'add', true); - - if (add) - { - scene.sys.displayList.add(gameObject); - } - - if (gameObject.preUpdate) - { - scene.sys.updateList.add(gameObject); - } - - return gameObject; -}; - -module.exports = BuildGameObject; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix - * and then performs the following steps: - * - * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. - * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. - * 3. Sets the blend mode of the context to be that used by the Game Object. - * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. - * 5. Saves the context state. - * 6. Sets the final matrix values into the context via setTransform. - * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. - * - * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. - * - * @function Phaser.Renderer.Canvas.SetTransform - * @since 3.12.0 - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on. - * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering. - * - * @return {boolean} `true` if the Game Object context was set, otherwise `false`. - */ -var SetTransform = function (renderer, ctx, src, camera, parentMatrix) -{ - var alpha = camera.alpha * src.alpha; - - if (alpha <= 0) - { - // Nothing to see, so don't waste time calculating stuff - return false; - } - - var camMatrix = renderer._tempMatrix1.copyFromArray(camera.matrix.matrix); - var gameObjectMatrix = renderer._tempMatrix2.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - var calcMatrix = renderer._tempMatrix3; - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - gameObjectMatrix.e = src.x; - gameObjectMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } - else - { - gameObjectMatrix.e -= camera.scrollX * src.scrollFactorX; - gameObjectMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } - - // Blend Mode - ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; - - // Alpha - ctx.globalAlpha = alpha; - - ctx.save(); - - calcMatrix.setToContext(ctx); - - ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode)); - - return true; -}; - -module.exports = SetTransform; - - -/***/ }), -/* 29 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5727,330 +4909,33 @@ module.exports = SetTransform; */ /** - * @namespace Phaser.GameObjects.Events + * @namespace Phaser.Core.Events */ module.exports = { - ADDED_TO_SCENE: __webpack_require__(593), - DESTROY: __webpack_require__(594), - REMOVED_FROM_SCENE: __webpack_require__(595), - VIDEO_COMPLETE: __webpack_require__(596), - VIDEO_CREATED: __webpack_require__(597), - VIDEO_ERROR: __webpack_require__(598), - VIDEO_LOOP: __webpack_require__(599), - VIDEO_PLAY: __webpack_require__(600), - VIDEO_SEEKED: __webpack_require__(601), - VIDEO_SEEKING: __webpack_require__(602), - VIDEO_STOP: __webpack_require__(603), - VIDEO_TIMEOUT: __webpack_require__(604), - VIDEO_UNLOCKED: __webpack_require__(605) + BLUR: __webpack_require__(606), + BOOT: __webpack_require__(607), + CONTEXT_LOST: __webpack_require__(608), + CONTEXT_RESTORED: __webpack_require__(609), + DESTROY: __webpack_require__(610), + FOCUS: __webpack_require__(611), + HIDDEN: __webpack_require__(612), + PAUSE: __webpack_require__(613), + POST_RENDER: __webpack_require__(614), + POST_STEP: __webpack_require__(615), + PRE_RENDER: __webpack_require__(616), + PRE_STEP: __webpack_require__(617), + READY: __webpack_require__(618), + RESUME: __webpack_require__(619), + STEP: __webpack_require__(620), + VISIBLE: __webpack_require__(621) }; /***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameObject = __webpack_require__(14); -var Line = __webpack_require__(40); - -/** - * @classdesc - * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. - * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. - * - * @class Shape - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @since 3.13.0 - * - * @extends Phaser.GameObjects.Components.AlphaSingle - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.ComputedSize - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {string} [type] - The internal type of the Shape. - * @param {any} [data] - The data of the source shape geometry, if any. - */ -var Shape = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.AlphaSingle, - Components.BlendMode, - Components.ComputedSize, - Components.Depth, - Components.GetBounds, - Components.Mask, - Components.Origin, - Components.Pipeline, - Components.ScrollFactor, - Components.Transform, - Components.Visible - ], - - initialize: - - function Shape (scene, type, data) - { - if (type === undefined) { type = 'Shape'; } - - GameObject.call(this, scene, type); - - /** - * The source Shape data. Typically a geometry object. - * You should not manipulate this directly. - * - * @name Phaser.GameObjects.Shape#geom - * @type {any} - * @readonly - * @since 3.13.0 - */ - this.geom = data; - - /** - * Holds the polygon path data for filled rendering. - * - * @name Phaser.GameObjects.Shape#pathData - * @type {number[]} - * @readonly - * @since 3.13.0 - */ - this.pathData = []; - - /** - * Holds the earcut polygon path index data for filled rendering. - * - * @name Phaser.GameObjects.Shape#pathIndexes - * @type {integer[]} - * @readonly - * @since 3.13.0 - */ - this.pathIndexes = []; - - /** - * The fill color used by this Shape. - * - * @name Phaser.GameObjects.Shape#fillColor - * @type {number} - * @since 3.13.0 - */ - this.fillColor = 0xffffff; - - /** - * The fill alpha value used by this Shape. - * - * @name Phaser.GameObjects.Shape#fillAlpha - * @type {number} - * @since 3.13.0 - */ - this.fillAlpha = 1; - - /** - * The stroke color used by this Shape. - * - * @name Phaser.GameObjects.Shape#strokeColor - * @type {number} - * @since 3.13.0 - */ - this.strokeColor = 0xffffff; - - /** - * The stroke alpha value used by this Shape. - * - * @name Phaser.GameObjects.Shape#strokeAlpha - * @type {number} - * @since 3.13.0 - */ - this.strokeAlpha = 1; - - /** - * The stroke line width used by this Shape. - * - * @name Phaser.GameObjects.Shape#lineWidth - * @type {number} - * @since 3.13.0 - */ - this.lineWidth = 1; - - /** - * Controls if this Shape is filled or not. - * Note that some Shapes do not support being filled (such as Line shapes) - * - * @name Phaser.GameObjects.Shape#isFilled - * @type {boolean} - * @since 3.13.0 - */ - this.isFilled = false; - - /** - * Controls if this Shape is stroked or not. - * Note that some Shapes do not support being stroked (such as Iso Box shapes) - * - * @name Phaser.GameObjects.Shape#isStroked - * @type {boolean} - * @since 3.13.0 - */ - this.isStroked = false; - - /** - * Controls if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * @name Phaser.GameObjects.Shape#closePath - * @type {boolean} - * @since 3.13.0 - */ - this.closePath = true; - - /** - * Private internal value. - * A Line used when parsing internal path data to avoid constant object re-creation. - * - * @name Phaser.GameObjects.Curve#_tempLine - * @type {Phaser.Geom.Line} - * @private - * @since 3.13.0 - */ - this._tempLine = new Line(); - - this.initPipeline(); - }, - - /** - * Sets the fill color and alpha for this Shape. - * - * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. - * - * Note that some Shapes do not support fill colors, such as the Line shape. - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setFillStyle - * @since 3.13.0 - * - * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled. - * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given. - * - * @return {this} This Game Object instance. - */ - setFillStyle: function (color, alpha) - { - if (alpha === undefined) { alpha = 1; } - - if (color === undefined) - { - this.isFilled = false; - } - else - { - this.fillColor = color; - this.fillAlpha = alpha; - this.isFilled = true; - } - - return this; - }, - - /** - * Sets the stroke color and alpha for this Shape. - * - * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. - * - * Note that some Shapes do not support being stroked, such as the Iso Box shape. - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setStrokeStyle - * @since 3.13.0 - * - * @param {number} [lineWidth] - The width of line to stroke with. If not provided or undefined the Shape will not be stroked. - * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked. - * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given. - * - * @return {this} This Game Object instance. - */ - setStrokeStyle: function (lineWidth, color, alpha) - { - if (alpha === undefined) { alpha = 1; } - - if (lineWidth === undefined) - { - this.isStroked = false; - } - else - { - this.lineWidth = lineWidth; - this.strokeColor = color; - this.strokeAlpha = alpha; - this.isStroked = true; - } - - return this; - }, - - /** - * Sets if this Shape path is closed during rendering when stroked. - * Note that some Shapes are always closed when stroked (such as Ellipse shapes) - * - * This call can be chained. - * - * @method Phaser.GameObjects.Shape#setClosePath - * @since 3.13.0 - * - * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`. - * - * @return {this} This Game Object instance. - */ - setClosePath: function (value) - { - this.closePath = value; - - return this; - }, - - /** - * Internal destroy handler, called as part of the destroy process. - * - * @method Phaser.GameObjects.Shape#preDestroy - * @protected - * @since 3.13.0 - */ - preDestroy: function () - { - this.geom = null; - this._tempLine = null; - this.pathData = []; - this.pathIndexes = []; - } - -}); - -module.exports = Shape; - - -/***/ }), -/* 31 */ +/* 24 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7069,10 +5954,947 @@ var TransformMatrix = new Class({ module.exports = TransformMatrix; +/***/ }), +/* 25 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Contains the plugins that Phaser uses globally and locally. +// These are the source objects, not instantiated. +var corePlugins = {}; + +// Contains the plugins that the dev has loaded into their game +// These are the source objects, not instantiated. +var customPlugins = {}; + +var PluginCache = {}; + +/** + * @namespace Phaser.Plugins.PluginCache + */ + +/** + * Static method called directly by the Core internal Plugins. + * Key is a reference used to get the plugin from the plugins object (i.e. InputPlugin) + * Plugin is the object to instantiate to create the plugin + * Mapping is what the plugin is injected into the Scene.Systems as (i.e. input) + * + * @method Phaser.Plugins.PluginCache.register + * @since 3.8.0 + * + * @param {string} key - A reference used to get this plugin from the plugin cache. + * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. + * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param {boolean} [custom=false] - Core Scene plugin or a Custom Scene plugin? + */ +PluginCache.register = function (key, plugin, mapping, custom) +{ + if (custom === undefined) { custom = false; } + + corePlugins[key] = { plugin: plugin, mapping: mapping, custom: custom }; +}; + +/** + * Stores a custom plugin in the global plugin cache. + * The key must be unique, within the scope of the cache. + * + * @method Phaser.Plugins.PluginCache.registerCustom + * @since 3.8.0 + * + * @param {string} key - A reference used to get this plugin from the plugin cache. + * @param {function} plugin - The plugin to be stored. Should be the core object, not instantiated. + * @param {string} mapping - If this plugin is to be injected into the Scene Systems, this is the property key map used. + * @param {?any} data - A value to be passed to the plugin's `init` method. + */ +PluginCache.registerCustom = function (key, plugin, mapping, data) +{ + customPlugins[key] = { plugin: plugin, mapping: mapping, data: data }; +}; + +/** + * Checks if the given key is already being used in the core plugin cache. + * + * @method Phaser.Plugins.PluginCache.hasCore + * @since 3.8.0 + * + * @param {string} key - The key to check for. + * + * @return {boolean} `true` if the key is already in use in the core cache, otherwise `false`. + */ +PluginCache.hasCore = function (key) +{ + return corePlugins.hasOwnProperty(key); +}; + +/** + * Checks if the given key is already being used in the custom plugin cache. + * + * @method Phaser.Plugins.PluginCache.hasCustom + * @since 3.8.0 + * + * @param {string} key - The key to check for. + * + * @return {boolean} `true` if the key is already in use in the custom cache, otherwise `false`. + */ +PluginCache.hasCustom = function (key) +{ + return customPlugins.hasOwnProperty(key); +}; + +/** + * Returns the core plugin object from the cache based on the given key. + * + * @method Phaser.Plugins.PluginCache.getCore + * @since 3.8.0 + * + * @param {string} key - The key of the core plugin to get. + * + * @return {Phaser.Types.Plugins.CorePluginContainer} The core plugin object. + */ +PluginCache.getCore = function (key) +{ + return corePlugins[key]; +}; + +/** + * Returns the custom plugin object from the cache based on the given key. + * + * @method Phaser.Plugins.PluginCache.getCustom + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to get. + * + * @return {Phaser.Types.Plugins.CustomPluginContainer} The custom plugin object. + */ +PluginCache.getCustom = function (key) +{ + return customPlugins[key]; +}; + +/** + * Returns an object from the custom cache based on the given key that can be instantiated. + * + * @method Phaser.Plugins.PluginCache.getCustomClass + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to get. + * + * @return {function} The custom plugin object. + */ +PluginCache.getCustomClass = function (key) +{ + return (customPlugins.hasOwnProperty(key)) ? customPlugins[key].plugin : null; +}; + +/** + * Removes a core plugin based on the given key. + * + * @method Phaser.Plugins.PluginCache.remove + * @since 3.8.0 + * + * @param {string} key - The key of the core plugin to remove. + */ +PluginCache.remove = function (key) +{ + if (corePlugins.hasOwnProperty(key)) + { + delete corePlugins[key]; + } +}; + +/** + * Removes a custom plugin based on the given key. + * + * @method Phaser.Plugins.PluginCache.removeCustom + * @since 3.8.0 + * + * @param {string} key - The key of the custom plugin to remove. + */ +PluginCache.removeCustom = function (key) +{ + if (customPlugins.hasOwnProperty(key)) + { + delete customPlugins[key]; + } +}; + +/** + * Removes all Core Plugins. + * + * This includes all of the internal system plugins that Phaser needs, like the Input Plugin and Loader Plugin. + * So be sure you only call this if you do not wish to run Phaser again. + * + * @method Phaser.Plugins.PluginCache.destroyCorePlugins + * @since 3.12.0 + */ +PluginCache.destroyCorePlugins = function () +{ + for (var key in corePlugins) + { + if (corePlugins.hasOwnProperty(key)) + { + delete corePlugins[key]; + } + } +}; + +/** + * Removes all Custom Plugins. + * + * @method Phaser.Plugins.PluginCache.destroyCustomPlugins + * @since 3.12.0 + */ +PluginCache.destroyCustomPlugins = function () +{ + for (var key in customPlugins) + { + if (customPlugins.hasOwnProperty(key)) + { + delete customPlugins[key]; + } + } +}; + +module.exports = PluginCache; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetFastValue = __webpack_require__(2); + +/** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * + * @function Phaser.Tilemaps.Components.GetTilesWithin + * @since 3.0.0 + * + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + */ +var GetTilesWithin = function (tileX, tileY, width, height, filteringOptions, layer) +{ + if (tileX === undefined) { tileX = 0; } + if (tileY === undefined) { tileY = 0; } + if (width === undefined) { width = layer.width; } + if (height === undefined) { height = layer.height; } + if (!filteringOptions) { filteringOptions = {}; } + + var isNotEmpty = GetFastValue(filteringOptions, 'isNotEmpty', false); + var isColliding = GetFastValue(filteringOptions, 'isColliding', false); + var hasInterestingFace = GetFastValue(filteringOptions, 'hasInterestingFace', false); + + // Clip x, y to top left of map, while shrinking width/height to match. + if (tileX < 0) + { + width += tileX; + tileX = 0; + } + + if (tileY < 0) + { + height += tileY; + tileY = 0; + } + + // Clip width and height to bottom right of map. + if (tileX + width > layer.width) + { + width = Math.max(layer.width - tileX, 0); + } + + if (tileY + height > layer.height) + { + height = Math.max(layer.height - tileY, 0); + } + + var results = []; + + for (var ty = tileY; ty < tileY + height; ty++) + { + for (var tx = tileX; tx < tileX + width; tx++) + { + var tile = layer.data[ty][tx]; + + if (tile !== null) + { + if (isNotEmpty && tile.index === -1) + { + continue; + } + + if (isColliding && !tile.collides) + { + continue; + } + + if (hasInterestingFace && !tile.hasInterestingFace) + { + continue; + } + + results.push(tile); + } + } + } + + return results; +}; + +module.exports = GetTilesWithin; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, + * and then sets it to the given value. + * + * The optional `step` property is applied incrementally, multiplied by each item in the array. + * + * To use this with a Group: `PropertyValueSet(group.getChildren(), key, value, step)` + * + * @function Phaser.Actions.PropertyValueSet + * @since 3.3.0 + * + * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] + * + * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. + * @param {string} key - The property to be updated. + * @param {number} value - The amount to set the property to. + * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * + * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. + */ +var PropertyValueSet = function (items, key, value, step, index, direction) +{ + if (step === undefined) { step = 0; } + if (index === undefined) { index = 0; } + if (direction === undefined) { direction = 1; } + + var i; + var t = 0; + var end = items.length; + + if (direction === 1) + { + // Start to End + for (i = index; i < end; i++) + { + items[i][key] = value + (t * step); + t++; + } + } + else + { + // End to Start + for (i = index; i >= 0; i--) + { + items[i][key] = value + (t * step); + t++; + } + } + + return items; +}; + +module.exports = PropertyValueSet; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(48); +var GetAdvancedValue = __webpack_require__(15); + +/** + * Builds a Game Object using the provided configuration object. + * + * @function Phaser.GameObjects.BuildGameObject + * @since 3.0.0 + * + * @param {Phaser.Scene} scene - A reference to the Scene. + * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject. + * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with. + * + * @return {Phaser.GameObjects.GameObject} The built Game Object. + */ +var BuildGameObject = function (scene, gameObject, config) +{ + // Position + + gameObject.x = GetAdvancedValue(config, 'x', 0); + gameObject.y = GetAdvancedValue(config, 'y', 0); + gameObject.depth = GetAdvancedValue(config, 'depth', 0); + + // Flip + + gameObject.flipX = GetAdvancedValue(config, 'flipX', false); + gameObject.flipY = GetAdvancedValue(config, 'flipY', false); + + // Scale + // Either: { scale: 2 } or { scale: { x: 2, y: 2 }} + + var scale = GetAdvancedValue(config, 'scale', null); + + if (typeof scale === 'number') + { + gameObject.setScale(scale); + } + else if (scale !== null) + { + gameObject.scaleX = GetAdvancedValue(scale, 'x', 1); + gameObject.scaleY = GetAdvancedValue(scale, 'y', 1); + } + + // ScrollFactor + // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }} + + var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null); + + if (typeof scrollFactor === 'number') + { + gameObject.setScrollFactor(scrollFactor); + } + else if (scrollFactor !== null) + { + gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1); + gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1); + } + + // Rotation + + gameObject.rotation = GetAdvancedValue(config, 'rotation', 0); + + var angle = GetAdvancedValue(config, 'angle', null); + + if (angle !== null) + { + gameObject.angle = angle; + } + + // Alpha + + gameObject.alpha = GetAdvancedValue(config, 'alpha', 1); + + // Origin + // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }} + + var origin = GetAdvancedValue(config, 'origin', null); + + if (typeof origin === 'number') + { + gameObject.setOrigin(origin); + } + else if (origin !== null) + { + var ox = GetAdvancedValue(origin, 'x', 0.5); + var oy = GetAdvancedValue(origin, 'y', 0.5); + + gameObject.setOrigin(ox, oy); + } + + // BlendMode + + gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL); + + // Visible + + gameObject.visible = GetAdvancedValue(config, 'visible', true); + + // Add to Scene + + var add = GetAdvancedValue(config, 'add', true); + + if (add) + { + scene.sys.displayList.add(gameObject); + } + + if (gameObject.preUpdate) + { + scene.sys.updateList.add(gameObject); + } + + return gameObject; +}; + +module.exports = BuildGameObject; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Tilemap constants for orientation. + * + * @namespace Phaser.Tilemaps.Orientation + * @memberof Phaser.Tilemaps + * @since 3.50.0 + */ + +/** + * Phaser Tilemap constants for orientation. + * + * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. + * + * @typedef {Phaser.Tilemaps.Orientation} Phaser.Tilemaps.OrientationType + * @memberof Phaser.Tilemaps + * @since 3.50.0 + */ + +module.exports = { + + /** + * Orthogonal Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.ORTHOGONAL + * @type {number} + * @const + * @since 3.50.0 + */ + ORTHOGONAL: 0, + + /** + * Isometric Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.ISOMETRIC + * @type {number} + * @const + * @since 3.50.0 + */ + ISOMETRIC: 1, + + /** + * Staggered Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.STAGGERED + * @type {number} + * @const + * @since 3.50.0 + */ + STAGGERED: 2, + + /** + * Hexagonal Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.HEXAGONAL + * @type {number} + * @const + * @since 3.50.0 + */ + HEXAGONAL: 3 + +}; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCalcMatrix = __webpack_require__(21); + +/** + * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix + * and then performs the following steps: + * + * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. + * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. + * 3. Sets the blend mode of the context to be that used by the Game Object. + * 4. Sets the alpha value of the context to be that used by the Game Object combined with the Camera. + * 5. Saves the context state. + * 6. Sets the final matrix values into the context via setTransform. + * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. + * + * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. + * + * @function Phaser.Renderer.Canvas.SetTransform + * @since 3.12.0 + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {CanvasRenderingContext2D} ctx - The canvas context to set the transform on. + * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering. + * + * @return {boolean} `true` if the Game Object context was set, otherwise `false`. + */ +var SetTransform = function (renderer, ctx, src, camera, parentMatrix) +{ + var alpha = camera.alpha * src.alpha; + + if (alpha <= 0) + { + // Nothing to see, so don't waste time calculating stuff + return false; + } + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + // Blend Mode + ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; + + // Alpha + ctx.globalAlpha = alpha; + + ctx.save(); + + calcMatrix.setToContext(ctx); + + ctx.imageSmoothingEnabled = !(!renderer.antialias || (src.frame && src.frame.source.scaleMode)); + + return true; +}; + +module.exports = SetTransform; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(39); +var Smoothing = __webpack_require__(184); + +// The pool into which the canvas elements are placed. +var pool = []; + +// Automatically apply smoothing(false) to created Canvas elements +var _disableContextSmoothing = false; + +/** + * The CanvasPool is a global static object, that allows Phaser to recycle and pool 2D Context Canvas DOM elements. + * It does not pool WebGL Contexts, because once the context options are set they cannot be modified again, + * which is useless for some of the Phaser pipelines / renderer. + * + * This singleton is instantiated as soon as Phaser loads, before a Phaser.Game instance has even been created. + * Which means all instances of Phaser Games on the same page can share the one single pool. + * + * @namespace Phaser.Display.Canvas.CanvasPool + * @since 3.0.0 + */ +var CanvasPool = function () +{ + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? + * + * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool + */ + var create = function (parent, width, height, canvasType, selfParent) + { + if (width === undefined) { width = 1; } + if (height === undefined) { height = 1; } + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + if (selfParent === undefined) { selfParent = false; } + + var canvas; + var container = first(canvasType); + + if (container === null) + { + container = { + parent: parent, + canvas: document.createElement('canvas'), + type: canvasType + }; + + if (canvasType === CONST.CANVAS) + { + pool.push(container); + } + + canvas = container.canvas; + } + else + { + container.parent = parent; + + canvas = container.canvas; + } + + if (selfParent) + { + container.parent = canvas; + } + + canvas.width = width; + canvas.height = height; + + if (_disableContextSmoothing && canvasType === CONST.CANVAS) + { + Smoothing.disable(canvas.getContext('2d')); + } + + return canvas; + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.create2D + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created canvas. + */ + var create2D = function (parent, width, height) + { + return create(parent, width, height, CONST.CANVAS); + }; + + /** + * Creates a new Canvas DOM element, or pulls one from the pool if free. + * + * @function Phaser.Display.Canvas.CanvasPool.createWebGL + * @since 3.0.0 + * + * @param {*} parent - The parent of the Canvas object. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * + * @return {HTMLCanvasElement} The created WebGL canvas. + */ + var createWebGL = function (parent, width, height) + { + return create(parent, width, height, CONST.WEBGL); + }; + + /** + * Gets the first free canvas index from the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.first + * @since 3.0.0 + * + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * + * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. + */ + var first = function (canvasType) + { + if (canvasType === undefined) { canvasType = CONST.CANVAS; } + + if (canvasType === CONST.WEBGL) + { + return null; + } + + for (var i = 0; i < pool.length; i++) + { + var container = pool[i]; + + if (!container.parent && container.type === canvasType) + { + return container; + } + } + + return null; + }; + + /** + * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. + * The canvas has its width and height set to 1, and its parent attribute nulled. + * + * @function Phaser.Display.Canvas.CanvasPool.remove + * @since 3.0.0 + * + * @param {*} parent - The canvas or the parent of the canvas to free. + */ + var remove = function (parent) + { + // Check to see if the parent is a canvas object + var isCanvas = parent instanceof HTMLCanvasElement; + + pool.forEach(function (container) + { + if ((isCanvas && container.canvas === parent) || (!isCanvas && container.parent === parent)) + { + container.parent = null; + container.canvas.width = 1; + container.canvas.height = 1; + } + }); + }; + + /** + * Gets the total number of used canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.total + * @since 3.0.0 + * + * @return {number} The number of used canvases. + */ + var total = function () + { + var c = 0; + + pool.forEach(function (container) + { + if (container.parent) + { + c++; + } + }); + + return c; + }; + + /** + * Gets the total number of free canvas elements in the pool. + * + * @function Phaser.Display.Canvas.CanvasPool.free + * @since 3.0.0 + * + * @return {number} The number of free canvases. + */ + var free = function () + { + return pool.length - total(); + }; + + /** + * Disable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.disableSmoothing + * @since 3.0.0 + */ + var disableSmoothing = function () + { + _disableContextSmoothing = true; + }; + + /** + * Enable context smoothing on any new Canvas element created. + * + * @function Phaser.Display.Canvas.CanvasPool.enableSmoothing + * @since 3.0.0 + */ + var enableSmoothing = function () + { + _disableContextSmoothing = false; + }; + + return { + create2D: create2D, + create: create, + createWebGL: createWebGL, + disableSmoothing: disableSmoothing, + enableSmoothing: enableSmoothing, + first: first, + free: free, + pool: pool, + remove: remove, + total: total + }; +}; + +// If we export the called function here, it'll only be invoked once (not every time it's required). +module.exports = CanvasPool(); + + /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.GameObjects.Events + */ + +module.exports = { + + ADDED_TO_SCENE: __webpack_require__(633), + DESTROY: __webpack_require__(634), + REMOVED_FROM_SCENE: __webpack_require__(635), + VIDEO_COMPLETE: __webpack_require__(636), + VIDEO_CREATED: __webpack_require__(637), + VIDEO_ERROR: __webpack_require__(638), + VIDEO_LOOP: __webpack_require__(639), + VIDEO_PLAY: __webpack_require__(640), + VIDEO_SEEKED: __webpack_require__(641), + VIDEO_SEEKING: __webpack_require__(642), + VIDEO_STOP: __webpack_require__(643), + VIDEO_TIMEOUT: __webpack_require__(644), + VIDEO_UNLOCKED: __webpack_require__(645) + +}; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -7080,10 +6902,481 @@ module.exports = TransformMatrix; */ var Class = __webpack_require__(0); -var GetColor = __webpack_require__(175); -var GetColor32 = __webpack_require__(308); -var HSVToRGB = __webpack_require__(176); -var RGBToHSV = __webpack_require__(309); +var Components = __webpack_require__(11); +var GameObject = __webpack_require__(14); +var Line = __webpack_require__(45); +var PIPELINES_CONST = __webpack_require__(82); + +/** + * @classdesc + * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. + * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. + * + * @class Shape + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.13.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {string} [type] - The internal type of the Shape. + * @param {any} [data] - The data of the source shape geometry, if any. + */ +var Shape = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Transform, + Components.Visible + ], + + initialize: + + function Shape (scene, type, data) + { + if (type === undefined) { type = 'Shape'; } + + GameObject.call(this, scene, type); + + /** + * The source Shape data. Typically a geometry object. + * You should not manipulate this directly. + * + * @name Phaser.GameObjects.Shape#geom + * @type {any} + * @readonly + * @since 3.13.0 + */ + this.geom = data; + + /** + * Holds the polygon path data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathData + * @type {number[]} + * @readonly + * @since 3.13.0 + */ + this.pathData = []; + + /** + * Holds the earcut polygon path index data for filled rendering. + * + * @name Phaser.GameObjects.Shape#pathIndexes + * @type {number[]} + * @readonly + * @since 3.13.0 + */ + this.pathIndexes = []; + + /** + * The fill color used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillColor + * @type {number} + * @since 3.13.0 + */ + this.fillColor = 0xffffff; + + /** + * The fill alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#fillAlpha + * @type {number} + * @since 3.13.0 + */ + this.fillAlpha = 1; + + /** + * The stroke color used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeColor + * @type {number} + * @since 3.13.0 + */ + this.strokeColor = 0xffffff; + + /** + * The stroke alpha value used by this Shape. + * + * @name Phaser.GameObjects.Shape#strokeAlpha + * @type {number} + * @since 3.13.0 + */ + this.strokeAlpha = 1; + + /** + * The stroke line width used by this Shape. + * + * @name Phaser.GameObjects.Shape#lineWidth + * @type {number} + * @since 3.13.0 + */ + this.lineWidth = 1; + + /** + * Controls if this Shape is filled or not. + * Note that some Shapes do not support being filled (such as Line shapes) + * + * @name Phaser.GameObjects.Shape#isFilled + * @type {boolean} + * @since 3.13.0 + */ + this.isFilled = false; + + /** + * Controls if this Shape is stroked or not. + * Note that some Shapes do not support being stroked (such as Iso Box shapes) + * + * @name Phaser.GameObjects.Shape#isStroked + * @type {boolean} + * @since 3.13.0 + */ + this.isStroked = false; + + /** + * Controls if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * @name Phaser.GameObjects.Shape#closePath + * @type {boolean} + * @since 3.13.0 + */ + this.closePath = true; + + /** + * Private internal value. + * A Line used when parsing internal path data to avoid constant object re-creation. + * + * @name Phaser.GameObjects.Shape#_tempLine + * @type {Phaser.Geom.Line} + * @private + * @since 3.13.0 + */ + this._tempLine = new Line(); + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Shape#width + * @type {number} + * @since 3.13.0 + */ + this.width = 0; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Shape#height + * @type {number} + * @since 3.0.0 + */ + this.height = 0; + + this.initPipeline(PIPELINES_CONST.GRAPHICS_PIPELINE); + }, + + /** + * Sets the fill color and alpha for this Shape. + * + * If you wish for the Shape to not be filled then call this method with no arguments, or just set `isFilled` to `false`. + * + * Note that some Shapes do not support fill colors, such as the Line shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setFillStyle + * @since 3.13.0 + * + * @param {number} [color] - The color used to fill this shape. If not provided the Shape will not be filled. + * @param {number} [alpha=1] - The alpha value used when filling this shape, if a fill color is given. + * + * @return {this} This Game Object instance. + */ + setFillStyle: function (color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (color === undefined) + { + this.isFilled = false; + } + else + { + this.fillColor = color; + this.fillAlpha = alpha; + this.isFilled = true; + } + + return this; + }, + + /** + * Sets the stroke color and alpha for this Shape. + * + * If you wish for the Shape to not be stroked then call this method with no arguments, or just set `isStroked` to `false`. + * + * Note that some Shapes do not support being stroked, such as the Iso Box shape. + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setStrokeStyle + * @since 3.13.0 + * + * @param {number} [lineWidth] - The width of line to stroke with. If not provided or undefined the Shape will not be stroked. + * @param {number} [color] - The color used to stroke this shape. If not provided the Shape will not be stroked. + * @param {number} [alpha=1] - The alpha value used when stroking this shape, if a stroke color is given. + * + * @return {this} This Game Object instance. + */ + setStrokeStyle: function (lineWidth, color, alpha) + { + if (alpha === undefined) { alpha = 1; } + + if (lineWidth === undefined) + { + this.isStroked = false; + } + else + { + this.lineWidth = lineWidth; + this.strokeColor = color; + this.strokeAlpha = alpha; + this.isStroked = true; + } + + return this; + }, + + /** + * Sets if this Shape path is closed during rendering when stroked. + * Note that some Shapes are always closed when stroked (such as Ellipse shapes) + * + * This call can be chained. + * + * @method Phaser.GameObjects.Shape#setClosePath + * @since 3.13.0 + * + * @param {boolean} value - Set to `true` if the Shape should be closed when stroked, otherwise `false`. + * + * @return {this} This Game Object instance. + */ + setClosePath: function (value) + { + this.closePath = value; + + return this; + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Shape#setSize + * @private + * @since 3.13.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method Phaser.GameObjects.Shape#preDestroy + * @protected + * @since 3.13.0 + */ + preDestroy: function () + { + this.geom = null; + this._tempLine = null; + this.pathData = []; + this.pathIndexes = []; + }, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Shape#displayWidth + * @type {number} + * @since 3.13.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Shape#displayHeight + * @type {number} + * @since 3.13.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + } + +}); + +module.exports = Shape; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(13); + +/** + * Convert the given angle from degrees, to the equivalent angle in radians. + * + * @function Phaser.Math.DegToRad + * @since 3.0.0 + * + * @param {number} degrees - The angle (in degrees) to convert to radians. + * + * @return {number} The given angle converted to radians. + */ +var DegToRad = function (degrees) +{ + return degrees * CONST.DEG_TO_RAD; +}; + +module.exports = DegToRad; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Cameras.Scene2D.Events + */ + +module.exports = { + + DESTROY: __webpack_require__(711), + FADE_IN_COMPLETE: __webpack_require__(712), + FADE_IN_START: __webpack_require__(713), + FADE_OUT_COMPLETE: __webpack_require__(714), + FADE_OUT_START: __webpack_require__(715), + FLASH_COMPLETE: __webpack_require__(716), + FLASH_START: __webpack_require__(717), + FOLLOW_UPDATE: __webpack_require__(718), + PAN_COMPLETE: __webpack_require__(719), + PAN_START: __webpack_require__(720), + POST_RENDER: __webpack_require__(721), + PRE_RENDER: __webpack_require__(722), + ROTATE_COMPLETE: __webpack_require__(723), + ROTATE_START: __webpack_require__(724), + SHAKE_COMPLETE: __webpack_require__(725), + SHAKE_START: __webpack_require__(726), + ZOOM_COMPLETE: __webpack_require__(727), + ZOOM_START: __webpack_require__(728) + +}; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetColor = __webpack_require__(100); +var GetColor32 = __webpack_require__(320); +var HSVToRGB = __webpack_require__(180); +var RGBToHSV = __webpack_require__(321); /** * @namespace Phaser.Display.Color @@ -7098,10 +7391,10 @@ var RGBToHSV = __webpack_require__(309); * @constructor * @since 3.0.0 * - * @param {integer} [red=0] - The red color value. A number between 0 and 255. - * @param {integer} [green=0] - The green color value. A number between 0 and 255. - * @param {integer} [blue=0] - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * @param {number} [red=0] - The red color value. A number between 0 and 255. + * @param {number} [green=0] - The green color value. A number between 0 and 255. + * @param {number} [blue=0] - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. */ var Color = new Class({ @@ -7277,10 +7570,10 @@ var Color = new Class({ * @method Phaser.Display.Color#setTo * @since 3.0.0 * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. * @param {boolean} [updateHSV=true] - Update the HSV values after setting the RGB values? * * @return {Phaser.Display.Color} This Color object. @@ -7450,7 +7743,7 @@ var Color = new Class({ * @method Phaser.Display.Color#gray * @since 3.13.0 * - * @param {integer} shade - A value between 0 and 255. + * @param {number} shade - A value between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -7465,8 +7758,8 @@ var Color = new Class({ * @method Phaser.Display.Color#random * @since 3.13.0 * - * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. - * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * @param {number} [min=0] - The minimum random color value. Between 0 and 255. + * @param {number} [max=255] - The maximum random color value. Between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -7488,8 +7781,8 @@ var Color = new Class({ * @method Phaser.Display.Color#randomGray * @since 3.13.0 * - * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. - * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * @param {number} [min=0] - The minimum random color value. Between 0 and 255. + * @param {number} [max=255] - The maximum random color value. Between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -7510,7 +7803,7 @@ var Color = new Class({ * @method Phaser.Display.Color#saturate * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7528,7 +7821,7 @@ var Color = new Class({ * @method Phaser.Display.Color#desaturate * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7545,7 +7838,7 @@ var Color = new Class({ * @method Phaser.Display.Color#lighten * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7562,7 +7855,7 @@ var Color = new Class({ * @method Phaser.Display.Color#darken * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7579,7 +7872,7 @@ var Color = new Class({ * @method Phaser.Display.Color#brighten * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -7933,7 +8226,1053 @@ module.exports = Color; /***/ }), -/* 33 */ +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + +/***/ }), +/* 38 */ /***/ (function(module, exports) { /** @@ -7988,7 +9327,7 @@ module.exports = { /***/ }), -/* 34 */ +/* 39 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8013,48 +9352,54 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.50.0-beta.5', + VERSION: '3.50.0-beta.11', - BlendModes: __webpack_require__(54), + BlendModes: __webpack_require__(48), - ScaleModes: __webpack_require__(247), + ScaleModes: __webpack_require__(260), /** - * AUTO Detect Renderer. + * This setting will auto-detect if the browser is capable of suppporting WebGL. + * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. * * @name Phaser.AUTO * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ AUTO: 0, /** - * Canvas Renderer. + * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports + * WebGL or not. * * @name Phaser.CANVAS * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ CANVAS: 1, /** - * WebGL Renderer. + * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is + * no fallback to Canvas with this setting, so you should trap it and display a suitable + * message to the user. * * @name Phaser.WEBGL * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ WEBGL: 2, /** - * Headless Renderer. + * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still + * absolutely relies on the DOM being present and available. This mode is meant for unit testing, + * not for running Phaser on the server, which is something you really shouldn't do. * * @name Phaser.HEADLESS * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ HEADLESS: 3, @@ -8065,7 +9410,7 @@ var CONST = { * * @name Phaser.FOREVER * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ FOREVER: -1, @@ -8075,7 +9420,7 @@ var CONST = { * * @name Phaser.NONE * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ NONE: 4, @@ -8085,7 +9430,7 @@ var CONST = { * * @name Phaser.UP * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ UP: 5, @@ -8095,7 +9440,7 @@ var CONST = { * * @name Phaser.DOWN * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ DOWN: 6, @@ -8105,7 +9450,7 @@ var CONST = { * * @name Phaser.LEFT * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ LEFT: 7, @@ -8115,7 +9460,7 @@ var CONST = { * * @name Phaser.RIGHT * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ RIGHT: 8 @@ -8126,7 +9471,7 @@ module.exports = CONST; /***/ }), -/* 35 */ +/* 40 */ /***/ (function(module, exports) { /** @@ -8154,7 +9499,7 @@ module.exports = GetBottom; /***/ }), -/* 36 */ +/* 41 */ /***/ (function(module, exports) { /** @@ -8182,7 +9527,7 @@ module.exports = GetLeft; /***/ }), -/* 37 */ +/* 42 */ /***/ (function(module, exports) { /** @@ -8210,7 +9555,7 @@ module.exports = GetRight; /***/ }), -/* 38 */ +/* 43 */ /***/ (function(module, exports) { /** @@ -8238,7 +9583,7 @@ module.exports = GetTop; /***/ }), -/* 39 */ +/* 44 */ /***/ (function(module, exports) { /** @@ -8264,8 +9609,8 @@ module.exports = GetTop; * @param {string} key - The property to be updated. * @param {number} value - The amount to be added to the property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -8305,7 +9650,7 @@ module.exports = PropertyValueInc; /***/ }), -/* 40 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8315,10 +9660,10 @@ module.exports = PropertyValueInc; */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(284); -var GetPoints = __webpack_require__(162); -var GEOM_CONST = __webpack_require__(49); -var Random = __webpack_require__(163); +var GetPoint = __webpack_require__(299); +var GetPoints = __webpack_require__(163); +var GEOM_CONST = __webpack_require__(55); +var Random = __webpack_require__(164); var Vector2 = __webpack_require__(3); /** @@ -8351,7 +9696,7 @@ var Line = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Line#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -8425,8 +9770,8 @@ var Line = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. - * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. @@ -8642,74 +9987,7 @@ module.exports = Line; /***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(13); - -/** - * Convert the given angle from degrees, to the equivalent angle in radians. - * - * @function Phaser.Math.DegToRad - * @since 3.0.0 - * - * @param {integer} degrees - The angle (in degrees) to convert to radians. - * - * @return {number} The given angle converted to radians. - */ -var DegToRad = function (degrees) -{ - return degrees * CONST.DEG_TO_RAD; -}; - -module.exports = DegToRad; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Cameras.Scene2D.Events - */ - -module.exports = { - - DESTROY: __webpack_require__(671), - FADE_IN_COMPLETE: __webpack_require__(672), - FADE_IN_START: __webpack_require__(673), - FADE_OUT_COMPLETE: __webpack_require__(674), - FADE_OUT_START: __webpack_require__(675), - FLASH_COMPLETE: __webpack_require__(676), - FLASH_START: __webpack_require__(677), - PAN_COMPLETE: __webpack_require__(678), - PAN_START: __webpack_require__(679), - POST_RENDER: __webpack_require__(680), - PRE_RENDER: __webpack_require__(681), - ROTATE_COMPLETE: __webpack_require__(682), - ROTATE_START: __webpack_require__(683), - SHAKE_COMPLETE: __webpack_require__(684), - SHAKE_START: __webpack_require__(685), - ZOOM_COMPLETE: __webpack_require__(686), - ZOOM_START: __webpack_require__(687) - -}; - - -/***/ }), -/* 43 */ +/* 46 */ /***/ (function(module, exports) { /** @@ -8746,7 +10024,657 @@ module.exports = FillStyleCanvas; /***/ }), -/* 44 */ +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after + * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. + * + * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. + * + * @class MultiFile + * @memberof Phaser.Loader + * @constructor + * @since 3.7.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. + * @param {string} type - The file type string for sorting within the Loader. + * @param {string} key - The key of the file within the loader. + * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. + */ +var MultiFile = new Class({ + + initialize: + + function MultiFile (loader, type, key, files) + { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + + /** + * A reference to the Loader that is going to load this file. + * + * @name Phaser.Loader.MultiFile#loader + * @type {Phaser.Loader.LoaderPlugin} + * @since 3.7.0 + */ + this.loader = loader; + + /** + * The file type string for sorting within the Loader. + * + * @name Phaser.Loader.MultiFile#type + * @type {string} + * @since 3.7.0 + */ + this.type = type; + + /** + * Unique cache key (unique within its file type) + * + * @name Phaser.Loader.MultiFile#key + * @type {string} + * @since 3.7.0 + */ + this.key = key; + + /** + * The current index being used by multi-file loaders to avoid key clashes. + * + * @name Phaser.Loader.MultiFile#multiKeyIndex + * @type {number} + * @private + * @since 3.20.0 + */ + this.multiKeyIndex = loader.multiKeyIndex++; + + /** + * Array of files that make up this MultiFile. + * + * @name Phaser.Loader.MultiFile#files + * @type {Phaser.Loader.File[]} + * @since 3.7.0 + */ + this.files = finalFiles; + + /** + * The completion status of this MultiFile. + * + * @name Phaser.Loader.MultiFile#complete + * @type {boolean} + * @default false + * @since 3.7.0 + */ + this.complete = false; + + /** + * The number of files to load. + * + * @name Phaser.Loader.MultiFile#pending + * @type {number} + * @since 3.7.0 + */ + + this.pending = finalFiles.length; + + /** + * The number of files that failed to load. + * + * @name Phaser.Loader.MultiFile#failed + * @type {number} + * @default 0 + * @since 3.7.0 + */ + this.failed = 0; + + /** + * A storage container for transient data that the loading files need. + * + * @name Phaser.Loader.MultiFile#config + * @type {any} + * @since 3.7.0 + */ + this.config = {}; + + /** + * A reference to the Loaders baseURL at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#baseURL + * @type {string} + * @since 3.20.0 + */ + this.baseURL = loader.baseURL; + + /** + * A reference to the Loaders path at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#path + * @type {string} + * @since 3.20.0 + */ + this.path = loader.path; + + /** + * A reference to the Loaders prefix at the time this MultiFile was created. + * Used to populate child-files. + * + * @name Phaser.Loader.MultiFile#prefix + * @type {string} + * @since 3.20.0 + */ + this.prefix = loader.prefix; + + // Link the files + for (var i = 0; i < finalFiles.length; i++) + { + finalFiles[i].multiFile = this; + } + }, + + /** + * Checks if this MultiFile is ready to process its children or not. + * + * @method Phaser.Loader.MultiFile#isReadyToProcess + * @since 3.7.0 + * + * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. + */ + isReadyToProcess: function () + { + return (this.pending === 0 && this.failed === 0 && !this.complete); + }, + + /** + * Adds another child to this MultiFile, increases the pending count and resets the completion status. + * + * @method Phaser.Loader.MultiFile#addToMultiFile + * @since 3.7.0 + * + * @param {Phaser.Loader.File} files - The File to add to this MultiFile. + * + * @return {Phaser.Loader.MultiFile} This MultiFile instance. + */ + addToMultiFile: function (file) + { + this.files.push(file); + + file.multiFile = this; + + this.pending++; + + this.complete = false; + + return this; + }, + + /** + * Called by each File when it finishes loading. + * + * @method Phaser.Loader.MultiFile#onFileComplete + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has completed processing. + */ + onFileComplete: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.pending--; + } + }, + + /** + * Called by each File that fails to load. + * + * @method Phaser.Loader.MultiFile#onFileFailed + * @since 3.7.0 + * + * @param {Phaser.Loader.File} file - The File that has failed to load. + */ + onFileFailed: function (file) + { + var index = this.files.indexOf(file); + + if (index !== -1) + { + this.failed++; + } + } + +}); + +module.exports = MultiFile; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Blend Modes. + * + * @namespace Phaser.BlendModes + * @since 3.0.0 + */ + +module.exports = { + + /** + * Skips the Blend Mode check in the renderer. + * + * @name Phaser.BlendModes.SKIP_CHECK + * @type {number} + * @const + * @since 3.0.0 + */ + SKIP_CHECK: -1, + + /** + * Normal blend mode. For Canvas and WebGL. + * This is the default setting and draws new shapes on top of the existing canvas content. + * + * @name Phaser.BlendModes.NORMAL + * @type {number} + * @const + * @since 3.0.0 + */ + NORMAL: 0, + + /** + * Add blend mode. For Canvas and WebGL. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.ADD + * @type {number} + * @const + * @since 3.0.0 + */ + ADD: 1, + + /** + * Multiply blend mode. For Canvas and WebGL. + * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. + * + * @name Phaser.BlendModes.MULTIPLY + * @type {number} + * @const + * @since 3.0.0 + */ + MULTIPLY: 2, + + /** + * Screen blend mode. For Canvas and WebGL. + * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) + * + * @name Phaser.BlendModes.SCREEN + * @type {number} + * @const + * @since 3.0.0 + */ + SCREEN: 3, + + /** + * Overlay blend mode. For Canvas only. + * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. + * + * @name Phaser.BlendModes.OVERLAY + * @type {number} + * @const + * @since 3.0.0 + */ + OVERLAY: 4, + + /** + * Darken blend mode. For Canvas only. + * Retains the darkest pixels of both layers. + * + * @name Phaser.BlendModes.DARKEN + * @type {number} + * @const + * @since 3.0.0 + */ + DARKEN: 5, + + /** + * Lighten blend mode. For Canvas only. + * Retains the lightest pixels of both layers. + * + * @name Phaser.BlendModes.LIGHTEN + * @type {number} + * @const + * @since 3.0.0 + */ + LIGHTEN: 6, + + /** + * Color Dodge blend mode. For Canvas only. + * Divides the bottom layer by the inverted top layer. + * + * @name Phaser.BlendModes.COLOR_DODGE + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_DODGE: 7, + + /** + * Color Burn blend mode. For Canvas only. + * Divides the inverted bottom layer by the top layer, and then inverts the result. + * + * @name Phaser.BlendModes.COLOR_BURN + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR_BURN: 8, + + /** + * Hard Light blend mode. For Canvas only. + * A combination of multiply and screen like overlay, but with top and bottom layer swapped. + * + * @name Phaser.BlendModes.HARD_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + HARD_LIGHT: 9, + + /** + * Soft Light blend mode. For Canvas only. + * A softer version of hard-light. Pure black or white does not result in pure black or white. + * + * @name Phaser.BlendModes.SOFT_LIGHT + * @type {number} + * @const + * @since 3.0.0 + */ + SOFT_LIGHT: 10, + + /** + * Difference blend mode. For Canvas only. + * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. + * + * @name Phaser.BlendModes.DIFFERENCE + * @type {number} + * @const + * @since 3.0.0 + */ + DIFFERENCE: 11, + + /** + * Exclusion blend mode. For Canvas only. + * Like difference, but with lower contrast. + * + * @name Phaser.BlendModes.EXCLUSION + * @type {number} + * @const + * @since 3.0.0 + */ + EXCLUSION: 12, + + /** + * Hue blend mode. For Canvas only. + * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. + * + * @name Phaser.BlendModes.HUE + * @type {number} + * @const + * @since 3.0.0 + */ + HUE: 13, + + /** + * Saturation blend mode. For Canvas only. + * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. + * + * @name Phaser.BlendModes.SATURATION + * @type {number} + * @const + * @since 3.0.0 + */ + SATURATION: 14, + + /** + * Color blend mode. For Canvas only. + * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. + * + * @name Phaser.BlendModes.COLOR + * @type {number} + * @const + * @since 3.0.0 + */ + COLOR: 15, + + /** + * Luminosity blend mode. For Canvas only. + * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. + * + * @name Phaser.BlendModes.LUMINOSITY + * @type {number} + * @const + * @since 3.0.0 + */ + LUMINOSITY: 16, + + /** + * Alpha erase blend mode. For Canvas and WebGL. + * + * @name Phaser.BlendModes.ERASE + * @type {number} + * @const + * @since 3.0.0 + */ + ERASE: 17, + + /** + * Source-in blend mode. For Canvas only. + * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.SOURCE_IN + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_IN: 18, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is drawn where it doesn't overlap the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_OUT: 19, + + /** + * Source-out blend mode. For Canvas only. + * The new shape is only drawn where it overlaps the existing canvas content. + * + * @name Phaser.BlendModes.SOURCE_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + SOURCE_ATOP: 20, + + /** + * Destination-over blend mode. For Canvas only. + * New shapes are drawn behind the existing canvas content. + * + * @name Phaser.BlendModes.DESTINATION_OVER + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OVER: 21, + + /** + * Destination-in blend mode. For Canvas only. + * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. + * + * @name Phaser.BlendModes.DESTINATION_IN + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_IN: 22, + + /** + * Destination-out blend mode. For Canvas only. + * The existing content is kept where it doesn't overlap the new shape. + * + * @name Phaser.BlendModes.DESTINATION_OUT + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_OUT: 23, + + /** + * Destination-out blend mode. For Canvas only. + * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. + * + * @name Phaser.BlendModes.DESTINATION_ATOP + * @type {number} + * @const + * @since 3.0.0 + */ + DESTINATION_ATOP: 24, + + /** + * Lighten blend mode. For Canvas only. + * Where both shapes overlap the color is determined by adding color values. + * + * @name Phaser.BlendModes.LIGHTER + * @type {number} + * @const + * @since 3.0.0 + */ + LIGHTER: 25, + + /** + * Copy blend mode. For Canvas only. + * Only the new shape is shown. + * + * @name Phaser.BlendModes.COPY + * @type {number} + * @const + * @since 3.0.0 + */ + COPY: 26, + + /** + * Xor blend mode. For Canvas only. + * Shapes are made transparent where both overlap and drawn normal everywhere else. + * + * @name Phaser.BlendModes.XOR + * @type {number} + * @const + * @since 3.0.0 + */ + XOR: 27 + +}; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Input.Events + */ + +module.exports = { + + BOOT: __webpack_require__(908), + DESTROY: __webpack_require__(909), + DRAG_END: __webpack_require__(910), + DRAG_ENTER: __webpack_require__(911), + DRAG: __webpack_require__(912), + DRAG_LEAVE: __webpack_require__(913), + DRAG_OVER: __webpack_require__(914), + DRAG_START: __webpack_require__(915), + DROP: __webpack_require__(916), + GAME_OUT: __webpack_require__(917), + GAME_OVER: __webpack_require__(918), + GAMEOBJECT_DOWN: __webpack_require__(919), + GAMEOBJECT_DRAG_END: __webpack_require__(920), + GAMEOBJECT_DRAG_ENTER: __webpack_require__(921), + GAMEOBJECT_DRAG: __webpack_require__(922), + GAMEOBJECT_DRAG_LEAVE: __webpack_require__(923), + GAMEOBJECT_DRAG_OVER: __webpack_require__(924), + GAMEOBJECT_DRAG_START: __webpack_require__(925), + GAMEOBJECT_DROP: __webpack_require__(926), + GAMEOBJECT_MOVE: __webpack_require__(927), + GAMEOBJECT_OUT: __webpack_require__(928), + GAMEOBJECT_OVER: __webpack_require__(929), + GAMEOBJECT_POINTER_DOWN: __webpack_require__(930), + GAMEOBJECT_POINTER_MOVE: __webpack_require__(931), + GAMEOBJECT_POINTER_OUT: __webpack_require__(932), + GAMEOBJECT_POINTER_OVER: __webpack_require__(933), + GAMEOBJECT_POINTER_UP: __webpack_require__(934), + GAMEOBJECT_POINTER_WHEEL: __webpack_require__(935), + GAMEOBJECT_UP: __webpack_require__(936), + GAMEOBJECT_WHEEL: __webpack_require__(937), + MANAGER_BOOT: __webpack_require__(938), + MANAGER_PROCESS: __webpack_require__(939), + MANAGER_UPDATE: __webpack_require__(940), + POINTER_DOWN: __webpack_require__(941), + POINTER_DOWN_OUTSIDE: __webpack_require__(942), + POINTER_MOVE: __webpack_require__(943), + POINTER_OUT: __webpack_require__(944), + POINTER_OVER: __webpack_require__(945), + POINTER_UP: __webpack_require__(946), + POINTER_UP_OUTSIDE: __webpack_require__(947), + POINTER_WHEEL: __webpack_require__(948), + POINTERLOCK_CHANGE: __webpack_require__(949), + PRE_UPDATE: __webpack_require__(950), + SHUTDOWN: __webpack_require__(951), + START: __webpack_require__(952), + UPDATE: __webpack_require__(953) + +}; + + +/***/ }), +/* 50 */ /***/ (function(module, exports) { /** @@ -9290,7 +11218,7 @@ module.exports = Common; /***/ }), -/* 45 */ +/* 51 */ /***/ (function(module, exports) { /** @@ -9323,7 +11251,7 @@ module.exports = SetTop; /***/ }), -/* 46 */ +/* 52 */ /***/ (function(module, exports) { /** @@ -9356,7 +11284,7 @@ module.exports = SetLeft; /***/ }), -/* 47 */ +/* 53 */ /***/ (function(module, exports) { /** @@ -9389,7 +11317,7 @@ module.exports = SetRight; /***/ }), -/* 48 */ +/* 54 */ /***/ (function(module, exports) { /** @@ -9422,7 +11350,7 @@ module.exports = SetBottom; /***/ }), -/* 49 */ +/* 55 */ /***/ (function(module, exports) { /** @@ -9437,7 +11365,7 @@ var GEOM_CONST = { * A Circle Geometry object type. * * @name Phaser.Geom.CIRCLE - * @type {integer} + * @type {number} * @since 3.19.0 */ CIRCLE: 0, @@ -9446,7 +11374,7 @@ var GEOM_CONST = { * An Ellipse Geometry object type. * * @name Phaser.Geom.ELLIPSE - * @type {integer} + * @type {number} * @since 3.19.0 */ ELLIPSE: 1, @@ -9455,7 +11383,7 @@ var GEOM_CONST = { * A Line Geometry object type. * * @name Phaser.Geom.LINE - * @type {integer} + * @type {number} * @since 3.19.0 */ LINE: 2, @@ -9464,7 +11392,7 @@ var GEOM_CONST = { * A Point Geometry object type. * * @name Phaser.Geom.POINT - * @type {integer} + * @type {number} * @since 3.19.0 */ POINT: 3, @@ -9473,7 +11401,7 @@ var GEOM_CONST = { * A Polygon Geometry object type. * * @name Phaser.Geom.POLYGON - * @type {integer} + * @type {number} * @since 3.19.0 */ POLYGON: 4, @@ -9482,7 +11410,7 @@ var GEOM_CONST = { * A Rectangle Geometry object type. * * @name Phaser.Geom.RECTANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ RECTANGLE: 5, @@ -9491,7 +11419,7 @@ var GEOM_CONST = { * A Triangle Geometry object type. * * @name Phaser.Geom.TRIANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ TRIANGLE: 6 @@ -9502,7 +11430,7 @@ module.exports = GEOM_CONST; /***/ }), -/* 50 */ +/* 56 */ /***/ (function(module, exports) { /** @@ -9537,7 +11465,7 @@ module.exports = Contains; /***/ }), -/* 51 */ +/* 57 */ /***/ (function(module, exports) { /** @@ -9575,7 +11503,237 @@ module.exports = LineStyleCanvas; /***/ }), -/* 52 */ +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(19); +var File = __webpack_require__(22); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var GetValue = __webpack_require__(6); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single JSON File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * + * @class JSONFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + */ +var JSONFile = new Class({ + + Extends: File, + + initialize: + + // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object + // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing + + function JSONFile (loader, key, url, xhrSettings, dataKey) + { + var extension = 'json'; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + dataKey = GetFastValue(config, 'dataKey', dataKey); + } + + var fileConfig = { + type: 'json', + cache: loader.cacheManager.json, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings, + config: dataKey + }; + + File.call(this, loader, fileConfig); + + if (IsPlainObject(url)) + { + // Object provided instead of a URL, so no need to actually load it (populate data with value) + if (dataKey) + { + this.data = GetValue(url, dataKey); + } + else + { + this.data = url; + } + + this.state = CONST.FILE_POPULATED; + } + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + if (this.state !== CONST.FILE_POPULATED) + { + this.state = CONST.FILE_PROCESSING; + + var json = JSON.parse(this.xhrLoader.responseText); + + var key = this.config; + + if (typeof key === 'string') + { + this.data = GetValue(json, key, json); + } + else + { + this.data = json; + } + } + + this.onProcessComplete(); + } + +}); + +/** + * Adds a JSON file, or array of JSON files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the JSON Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.json({ + * key: 'wavedata', + * url: 'files/AlienWaveData.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.json('wavedata', 'files/AlienWaveData.json'); + * // and later in your game ... + * var data = this.cache.json.get('wavedata'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and + * this is what you would use to retrieve the text from the JSON Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" + * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, + * rather than the whole file. For example, if your JSON data had a structure like this: + * + * ```json + * { + * "level1": { + * "baddies": { + * "aliens": {}, + * "boss": {} + * } + * }, + * "level2": {}, + * "level3": {} + * } + * ``` + * + * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * + * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#json + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new JSONFile(this, key[i])); + } + } + else + { + this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + } + + return this; +}); + +module.exports = JSONFile; + + +/***/ }), +/* 59 */ /***/ (function(module, exports) { /** @@ -9704,7 +11862,7 @@ module.exports = CONST; /***/ }), -/* 53 */ +/* 60 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9713,8 +11871,8 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(150); -var GetTilesWithin = __webpack_require__(24); +var GetTileAt = __webpack_require__(151); +var GetTilesWithin = __webpack_require__(26); /** * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the @@ -9724,10 +11882,10 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.CalculateFacesWithin * @since 3.0.0 * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesWithin = function (tileX, tileY, width, height, layer) @@ -9769,346 +11927,7 @@ module.exports = CalculateFacesWithin; /***/ }), -/* 54 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Phaser Blend Modes. - * - * @namespace Phaser.BlendModes - * @since 3.0.0 - */ - -module.exports = { - - /** - * Skips the Blend Mode check in the renderer. - * - * @name Phaser.BlendModes.SKIP_CHECK - * @type {integer} - * @const - * @since 3.0.0 - */ - SKIP_CHECK: -1, - - /** - * Normal blend mode. For Canvas and WebGL. - * This is the default setting and draws new shapes on top of the existing canvas content. - * - * @name Phaser.BlendModes.NORMAL - * @type {integer} - * @const - * @since 3.0.0 - */ - NORMAL: 0, - - /** - * Add blend mode. For Canvas and WebGL. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.ADD - * @type {integer} - * @const - * @since 3.0.0 - */ - ADD: 1, - - /** - * Multiply blend mode. For Canvas and WebGL. - * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. - * - * @name Phaser.BlendModes.MULTIPLY - * @type {integer} - * @const - * @since 3.0.0 - */ - MULTIPLY: 2, - - /** - * Screen blend mode. For Canvas and WebGL. - * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) - * - * @name Phaser.BlendModes.SCREEN - * @type {integer} - * @const - * @since 3.0.0 - */ - SCREEN: 3, - - /** - * Overlay blend mode. For Canvas only. - * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. - * - * @name Phaser.BlendModes.OVERLAY - * @type {integer} - * @const - * @since 3.0.0 - */ - OVERLAY: 4, - - /** - * Darken blend mode. For Canvas only. - * Retains the darkest pixels of both layers. - * - * @name Phaser.BlendModes.DARKEN - * @type {integer} - * @const - * @since 3.0.0 - */ - DARKEN: 5, - - /** - * Lighten blend mode. For Canvas only. - * Retains the lightest pixels of both layers. - * - * @name Phaser.BlendModes.LIGHTEN - * @type {integer} - * @const - * @since 3.0.0 - */ - LIGHTEN: 6, - - /** - * Color Dodge blend mode. For Canvas only. - * Divides the bottom layer by the inverted top layer. - * - * @name Phaser.BlendModes.COLOR_DODGE - * @type {integer} - * @const - * @since 3.0.0 - */ - COLOR_DODGE: 7, - - /** - * Color Burn blend mode. For Canvas only. - * Divides the inverted bottom layer by the top layer, and then inverts the result. - * - * @name Phaser.BlendModes.COLOR_BURN - * @type {integer} - * @const - * @since 3.0.0 - */ - COLOR_BURN: 8, - - /** - * Hard Light blend mode. For Canvas only. - * A combination of multiply and screen like overlay, but with top and bottom layer swapped. - * - * @name Phaser.BlendModes.HARD_LIGHT - * @type {integer} - * @const - * @since 3.0.0 - */ - HARD_LIGHT: 9, - - /** - * Soft Light blend mode. For Canvas only. - * A softer version of hard-light. Pure black or white does not result in pure black or white. - * - * @name Phaser.BlendModes.SOFT_LIGHT - * @type {integer} - * @const - * @since 3.0.0 - */ - SOFT_LIGHT: 10, - - /** - * Difference blend mode. For Canvas only. - * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. - * - * @name Phaser.BlendModes.DIFFERENCE - * @type {integer} - * @const - * @since 3.0.0 - */ - DIFFERENCE: 11, - - /** - * Exclusion blend mode. For Canvas only. - * Like difference, but with lower contrast. - * - * @name Phaser.BlendModes.EXCLUSION - * @type {integer} - * @const - * @since 3.0.0 - */ - EXCLUSION: 12, - - /** - * Hue blend mode. For Canvas only. - * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. - * - * @name Phaser.BlendModes.HUE - * @type {integer} - * @const - * @since 3.0.0 - */ - HUE: 13, - - /** - * Saturation blend mode. For Canvas only. - * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. - * - * @name Phaser.BlendModes.SATURATION - * @type {integer} - * @const - * @since 3.0.0 - */ - SATURATION: 14, - - /** - * Color blend mode. For Canvas only. - * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. - * - * @name Phaser.BlendModes.COLOR - * @type {integer} - * @const - * @since 3.0.0 - */ - COLOR: 15, - - /** - * Luminosity blend mode. For Canvas only. - * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. - * - * @name Phaser.BlendModes.LUMINOSITY - * @type {integer} - * @const - * @since 3.0.0 - */ - LUMINOSITY: 16, - - /** - * Alpha erase blend mode. For Canvas and WebGL. - * - * @name Phaser.BlendModes.ERASE - * @type {integer} - * @const - * @since 3.0.0 - */ - ERASE: 17, - - /** - * Source-in blend mode. For Canvas only. - * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.SOURCE_IN - * @type {integer} - * @const - * @since 3.0.0 - */ - SOURCE_IN: 18, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is drawn where it doesn't overlap the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_OUT - * @type {integer} - * @const - * @since 3.0.0 - */ - SOURCE_OUT: 19, - - /** - * Source-out blend mode. For Canvas only. - * The new shape is only drawn where it overlaps the existing canvas content. - * - * @name Phaser.BlendModes.SOURCE_ATOP - * @type {integer} - * @const - * @since 3.0.0 - */ - SOURCE_ATOP: 20, - - /** - * Destination-over blend mode. For Canvas only. - * New shapes are drawn behind the existing canvas content. - * - * @name Phaser.BlendModes.DESTINATION_OVER - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_OVER: 21, - - /** - * Destination-in blend mode. For Canvas only. - * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. - * - * @name Phaser.BlendModes.DESTINATION_IN - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_IN: 22, - - /** - * Destination-out blend mode. For Canvas only. - * The existing content is kept where it doesn't overlap the new shape. - * - * @name Phaser.BlendModes.DESTINATION_OUT - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_OUT: 23, - - /** - * Destination-out blend mode. For Canvas only. - * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. - * - * @name Phaser.BlendModes.DESTINATION_ATOP - * @type {integer} - * @const - * @since 3.0.0 - */ - DESTINATION_ATOP: 24, - - /** - * Lighten blend mode. For Canvas only. - * Where both shapes overlap the color is determined by adding color values. - * - * @name Phaser.BlendModes.LIGHTER - * @type {integer} - * @const - * @since 3.0.0 - */ - LIGHTER: 25, - - /** - * Copy blend mode. For Canvas only. - * Only the new shape is shown. - * - * @name Phaser.BlendModes.COPY - * @type {integer} - * @const - * @since 3.0.0 - */ - COPY: 26, - - /** - * Xor blend mode. For Canvas only. - * Shapes are made transparent where both overlap and drawn normal everywhere else. - * - * @name Phaser.BlendModes.XOR - * @type {integer} - * @const - * @since 3.0.0 - */ - XOR: 27 - -}; - - -/***/ }), -/* 55 */ +/* 61 */ /***/ (function(module, exports) { /** @@ -10142,73 +11961,7 @@ module.exports = DistanceBetween; /***/ }), -/* 56 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Input.Events - */ - -module.exports = { - - BOOT: __webpack_require__(852), - DESTROY: __webpack_require__(853), - DRAG_END: __webpack_require__(854), - DRAG_ENTER: __webpack_require__(855), - DRAG: __webpack_require__(856), - DRAG_LEAVE: __webpack_require__(857), - DRAG_OVER: __webpack_require__(858), - DRAG_START: __webpack_require__(859), - DROP: __webpack_require__(860), - GAME_OUT: __webpack_require__(861), - GAME_OVER: __webpack_require__(862), - GAMEOBJECT_DOWN: __webpack_require__(863), - GAMEOBJECT_DRAG_END: __webpack_require__(864), - GAMEOBJECT_DRAG_ENTER: __webpack_require__(865), - GAMEOBJECT_DRAG: __webpack_require__(866), - GAMEOBJECT_DRAG_LEAVE: __webpack_require__(867), - GAMEOBJECT_DRAG_OVER: __webpack_require__(868), - GAMEOBJECT_DRAG_START: __webpack_require__(869), - GAMEOBJECT_DROP: __webpack_require__(870), - GAMEOBJECT_MOVE: __webpack_require__(871), - GAMEOBJECT_OUT: __webpack_require__(872), - GAMEOBJECT_OVER: __webpack_require__(873), - GAMEOBJECT_POINTER_DOWN: __webpack_require__(874), - GAMEOBJECT_POINTER_MOVE: __webpack_require__(875), - GAMEOBJECT_POINTER_OUT: __webpack_require__(876), - GAMEOBJECT_POINTER_OVER: __webpack_require__(877), - GAMEOBJECT_POINTER_UP: __webpack_require__(878), - GAMEOBJECT_POINTER_WHEEL: __webpack_require__(879), - GAMEOBJECT_UP: __webpack_require__(880), - GAMEOBJECT_WHEEL: __webpack_require__(881), - MANAGER_BOOT: __webpack_require__(882), - MANAGER_PROCESS: __webpack_require__(883), - MANAGER_UPDATE: __webpack_require__(884), - POINTER_DOWN: __webpack_require__(885), - POINTER_DOWN_OUTSIDE: __webpack_require__(886), - POINTER_MOVE: __webpack_require__(887), - POINTER_OUT: __webpack_require__(888), - POINTER_OVER: __webpack_require__(889), - POINTER_UP: __webpack_require__(890), - POINTER_UP_OUTSIDE: __webpack_require__(891), - POINTER_WHEEL: __webpack_require__(892), - POINTERLOCK_CHANGE: __webpack_require__(893), - PRE_UPDATE: __webpack_require__(894), - SHUTDOWN: __webpack_require__(895), - START: __webpack_require__(896), - UPDATE: __webpack_require__(897) - -}; - - -/***/ }), -/* 57 */ +/* 62 */ /***/ (function(module, exports) { /** @@ -10249,7 +12002,7 @@ module.exports = Contains; /***/ }), -/* 58 */ +/* 63 */ /***/ (function(module, exports) { /** @@ -10277,7 +12030,7 @@ module.exports = Length; /***/ }), -/* 59 */ +/* 64 */ /***/ (function(module, exports) { /** @@ -10309,7 +12062,7 @@ module.exports = Wrap; /***/ }), -/* 60 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -11073,7 +12826,7 @@ module.exports = earcut; /***/ }), -/* 61 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11088,35 +12841,35 @@ module.exports = earcut; module.exports = { - COMPLETE: __webpack_require__(917), - DECODED: __webpack_require__(918), - DECODED_ALL: __webpack_require__(919), - DESTROY: __webpack_require__(920), - DETUNE: __webpack_require__(921), - GLOBAL_DETUNE: __webpack_require__(922), - GLOBAL_MUTE: __webpack_require__(923), - GLOBAL_RATE: __webpack_require__(924), - GLOBAL_VOLUME: __webpack_require__(925), - LOOP: __webpack_require__(926), - LOOPED: __webpack_require__(927), - MUTE: __webpack_require__(928), - PAUSE_ALL: __webpack_require__(929), - PAUSE: __webpack_require__(930), - PLAY: __webpack_require__(931), - RATE: __webpack_require__(932), - RESUME_ALL: __webpack_require__(933), - RESUME: __webpack_require__(934), - SEEK: __webpack_require__(935), - STOP_ALL: __webpack_require__(936), - STOP: __webpack_require__(937), - UNLOCKED: __webpack_require__(938), - VOLUME: __webpack_require__(939) + COMPLETE: __webpack_require__(973), + DECODED: __webpack_require__(974), + DECODED_ALL: __webpack_require__(975), + DESTROY: __webpack_require__(976), + DETUNE: __webpack_require__(977), + GLOBAL_DETUNE: __webpack_require__(978), + GLOBAL_MUTE: __webpack_require__(979), + GLOBAL_RATE: __webpack_require__(980), + GLOBAL_VOLUME: __webpack_require__(981), + LOOP: __webpack_require__(982), + LOOPED: __webpack_require__(983), + MUTE: __webpack_require__(984), + PAUSE_ALL: __webpack_require__(985), + PAUSE: __webpack_require__(986), + PLAY: __webpack_require__(987), + RATE: __webpack_require__(988), + RESUME_ALL: __webpack_require__(989), + RESUME: __webpack_require__(990), + SEEK: __webpack_require__(991), + STOP_ALL: __webpack_require__(992), + STOP: __webpack_require__(993), + UNLOCKED: __webpack_require__(994), + VOLUME: __webpack_require__(995) }; /***/ }), -/* 62 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11126,45 +12879,42 @@ module.exports = { */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var GetValue = __webpack_require__(6); var IsPlainObject = __webpack_require__(7); /** * @classdesc - * A single JSON File suitable for loading by the Loader. + * A single Image File suitable for loading by the Loader. * - * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly. + * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json. + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. * - * @class JSONFile + * @class ImageFile * @extends Phaser.Loader.File * @memberof Phaser.Loader.FileTypes * @constructor * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. */ -var JSONFile = new Class({ +var ImageFile = new Class({ Extends: File, initialize: - // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object - // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing - - function JSONFile (loader, key, url, xhrSettings, dataKey) + function ImageFile (loader, key, url, xhrSettings, frameConfig) { - var extension = 'json'; + var extension = 'png'; + var normalMapURL; if (IsPlainObject(key)) { @@ -11172,37 +12922,41 @@ var JSONFile = new Class({ key = GetFastValue(config, 'key'); url = GetFastValue(config, 'url'); + normalMapURL = GetFastValue(config, 'normalMap'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); - dataKey = GetFastValue(config, 'dataKey', dataKey); + frameConfig = GetFastValue(config, 'frameConfig'); + } + + if (Array.isArray(url)) + { + normalMapURL = url[1]; + url = url[0]; } var fileConfig = { - type: 'json', - cache: loader.cacheManager.json, + type: 'image', + cache: loader.textureManager, extension: extension, - responseType: 'text', + responseType: 'blob', key: key, url: url, xhrSettings: xhrSettings, - config: dataKey + config: frameConfig }; File.call(this, loader, fileConfig); - if (IsPlainObject(url)) + // Do we have a normal map to load as well? + if (normalMapURL) { - // Object provided instead of a URL, so no need to actually load it (populate data with value) - if (dataKey) - { - this.data = GetValue(url, dataKey); - } - else - { - this.data = url; - } + var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); - this.state = CONST.FILE_POPULATED; + normalMap.type = 'normalMap'; + + this.setLink(normalMap); + + loader.addFile(normalMap); } }, @@ -11210,43 +12964,81 @@ var JSONFile = new Class({ * Called automatically by Loader.nextFile. * This method controls what extra work this File does with its loaded data. * - * @method Phaser.Loader.FileTypes.JSONFile#onProcess + * @method Phaser.Loader.FileTypes.ImageFile#onProcess * @since 3.7.0 */ onProcess: function () { - if (this.state !== CONST.FILE_POPULATED) + this.state = CONST.FILE_PROCESSING; + + this.data = new Image(); + + this.data.crossOrigin = this.crossOrigin; + + var _this = this; + + this.data.onload = function () { - this.state = CONST.FILE_PROCESSING; + File.revokeObjectURL(_this.data); - var json = JSON.parse(this.xhrLoader.responseText); + _this.onProcessComplete(); + }; - var key = this.config; + this.data.onerror = function () + { + File.revokeObjectURL(_this.data); - if (typeof key === 'string') + _this.onProcessError(); + }; + + File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.ImageFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + var texture; + var linkFile = this.linkFile; + + if (linkFile && linkFile.state === CONST.FILE_COMPLETE) + { + if (this.type === 'image') { - this.data = GetValue(json, key, json); + texture = this.cache.addImage(this.key, this.data, linkFile.data); } else { - this.data = json; + texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); } - } - this.onProcessComplete(); + this.pendingDestroy(texture); + + linkFile.pendingDestroy(texture); + } + else if (!linkFile) + { + texture = this.cache.addImage(this.key, this.data); + + this.pendingDestroy(texture); + } } }); /** - * Adds a JSON file, or array of JSON files, to the current load queue. + * Adds an Image, or array of Images, to the current load queue. * * You can call this method from within your Scene's `preload`, along with any other files you wish to load: * * ```javascript * function preload () * { - * this.load.json('wavedata', 'files/AlienWaveData.json'); + * this.load.image('logo', 'images/phaserLogo.png'); * } * ``` * @@ -11258,329 +13050,100 @@ var JSONFile = new Class({ * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been * loaded. * - * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the JSON Cache. + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback + * of animated gifs to Canvas elements. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the JSON Cache first, before loading a new one. + * then remove it from the Texture Manager first, before loading a new one. * * Instead of passing arguments you can pass a configuration object, such as: * * ```javascript - * this.load.json({ - * key: 'wavedata', - * url: 'files/AlienWaveData.json' + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png' * }); * ``` * - * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details. + * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. * - * Once the file has finished loading you can access it from its Cache using its key: + * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: * * ```javascript - * this.load.json('wavedata', 'files/AlienWaveData.json'); + * this.load.image('logo', 'images/AtariLogo.png'); * // and later in your game ... - * var data = this.cache.json.get('wavedata'); + * this.add.image(x, y, 'logo'); * ``` * * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and - * this is what you would use to retrieve the text from the JSON Cache. + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. * * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "data" - * and no URL is given then the Loader will set the URL to be "data.json". It will always add `.json` as the extension, although + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. * - * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache, - * rather than the whole file. For example, if your JSON data had a structure like this: + * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, + * then you can specify it by providing an array as the `url` where the second element is the normal map: * - * ```json - * { - * "level1": { - * "baddies": { - * "aliens": {}, - * "boss": {} - * } - * }, - * "level2": {}, - * "level3": {} - * } + * ```javascript + * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); * ``` * - * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`. + * Or, if you are using a config object use the `normalMap` property: * - * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser. + * ```javascript + * this.load.image({ + * key: 'logo', + * url: 'images/AtariLogo.png', + * normalMap: 'images/AtariLogo-n.png' + * }); + * ``` + * + * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. + * Normal maps are a WebGL only feature. + * + * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. * It is available in the default build but can be excluded from custom builds. * - * @method Phaser.Loader.LoaderPlugin#json + * @method Phaser.Loader.LoaderPlugin#image * @fires Phaser.Loader.LoaderPlugin#ADD * @since 3.0.0 * - * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, can be a fully formed JSON Object. - * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache. + * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('json', function (key, url, dataKey, xhrSettings) +FileTypesManager.register('image', function (key, url, xhrSettings) { if (Array.isArray(key)) { for (var i = 0; i < key.length; i++) { // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new JSONFile(this, key[i])); + this.addFile(new ImageFile(this, key[i])); } } else { - this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey)); + this.addFile(new ImageFile(this, key, url, xhrSettings)); } return this; }); -module.exports = JSONFile; +module.exports = ImageFile; /***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after - * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * - * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. - * - * @class MultiFile - * @memberof Phaser.Loader - * @constructor - * @since 3.7.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File. - * @param {string} type - The file type string for sorting within the Loader. - * @param {string} key - The key of the file within the loader. - * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile. - */ -var MultiFile = new Class({ - - initialize: - - function MultiFile (loader, type, key, files) - { - /** - * A reference to the Loader that is going to load this file. - * - * @name Phaser.Loader.MultiFile#loader - * @type {Phaser.Loader.LoaderPlugin} - * @since 3.7.0 - */ - this.loader = loader; - - /** - * The file type string for sorting within the Loader. - * - * @name Phaser.Loader.MultiFile#type - * @type {string} - * @since 3.7.0 - */ - this.type = type; - - /** - * Unique cache key (unique within its file type) - * - * @name Phaser.Loader.MultiFile#key - * @type {string} - * @since 3.7.0 - */ - this.key = key; - - /** - * The current index being used by multi-file loaders to avoid key clashes. - * - * @name Phaser.Loader.MultiFile#multiKeyIndex - * @type {integer} - * @private - * @since 3.20.0 - */ - this.multiKeyIndex = loader.multiKeyIndex++; - - /** - * Array of files that make up this MultiFile. - * - * @name Phaser.Loader.MultiFile#files - * @type {Phaser.Loader.File[]} - * @since 3.7.0 - */ - this.files = files; - - /** - * The completion status of this MultiFile. - * - * @name Phaser.Loader.MultiFile#complete - * @type {boolean} - * @default false - * @since 3.7.0 - */ - this.complete = false; - - /** - * The number of files to load. - * - * @name Phaser.Loader.MultiFile#pending - * @type {integer} - * @since 3.7.0 - */ - - this.pending = files.length; - - /** - * The number of files that failed to load. - * - * @name Phaser.Loader.MultiFile#failed - * @type {integer} - * @default 0 - * @since 3.7.0 - */ - this.failed = 0; - - /** - * A storage container for transient data that the loading files need. - * - * @name Phaser.Loader.MultiFile#config - * @type {any} - * @since 3.7.0 - */ - this.config = {}; - - /** - * A reference to the Loaders baseURL at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#baseURL - * @type {string} - * @since 3.20.0 - */ - this.baseURL = loader.baseURL; - - /** - * A reference to the Loaders path at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#path - * @type {string} - * @since 3.20.0 - */ - this.path = loader.path; - - /** - * A reference to the Loaders prefix at the time this MultiFile was created. - * Used to populate child-files. - * - * @name Phaser.Loader.MultiFile#prefix - * @type {string} - * @since 3.20.0 - */ - this.prefix = loader.prefix; - - // Link the files - for (var i = 0; i < files.length; i++) - { - files[i].multiFile = this; - } - }, - - /** - * Checks if this MultiFile is ready to process its children or not. - * - * @method Phaser.Loader.MultiFile#isReadyToProcess - * @since 3.7.0 - * - * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`. - */ - isReadyToProcess: function () - { - return (this.pending === 0 && this.failed === 0 && !this.complete); - }, - - /** - * Adds another child to this MultiFile, increases the pending count and resets the completion status. - * - * @method Phaser.Loader.MultiFile#addToMultiFile - * @since 3.7.0 - * - * @param {Phaser.Loader.File} files - The File to add to this MultiFile. - * - * @return {Phaser.Loader.MultiFile} This MultiFile instance. - */ - addToMultiFile: function (file) - { - this.files.push(file); - - file.multiFile = this; - - this.pending++; - - this.complete = false; - - return this; - }, - - /** - * Called by each File when it finishes loading. - * - * @method Phaser.Loader.MultiFile#onFileComplete - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has completed processing. - */ - onFileComplete: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.pending--; - } - }, - - /** - * Called by each File that fails to load. - * - * @method Phaser.Loader.MultiFile#onFileFailed - * @since 3.7.0 - * - * @param {Phaser.Loader.File} file - The File that has failed to load. - */ - onFileFailed: function (file) - { - var index = this.files.indexOf(file); - - if (index !== -1) - { - this.failed++; - } - } - -}); - -module.exports = MultiFile; - - -/***/ }), -/* 64 */ +/* 68 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11596,12 +13159,12 @@ var Body = {}; module.exports = Body; -var Vertices = __webpack_require__(88); -var Vector = __webpack_require__(102); -var Sleeping = __webpack_require__(250); -var Common = __webpack_require__(44); -var Bounds = __webpack_require__(103); -var Axes = __webpack_require__(542); +var Vertices = __webpack_require__(93); +var Vector = __webpack_require__(114); +var Sleeping = __webpack_require__(265); +var Common = __webpack_require__(50); +var Bounds = __webpack_require__(115); +var Axes = __webpack_require__(581); (function() { @@ -12962,7 +14525,7 @@ var Axes = __webpack_require__(542); /***/ }), -/* 65 */ +/* 69 */ /***/ (function(module, exports) { /** @@ -12997,8 +14560,8 @@ module.exports = SetTileCollision; /***/ }), -/* 66 */ -/***/ (function(module, exports) { +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -13006,98 +14569,481 @@ module.exports = SetTileCollision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var AnimationState = __webpack_require__(157); +var Class = __webpack_require__(0); +var Components = __webpack_require__(11); +var GameObject = __webpack_require__(14); +var GameObjectEvents = __webpack_require__(32); +var SpriteRender = __webpack_require__(1048); + /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layer's position, scale and scroll. + * @classdesc + * A Sprite Game Object. * - * @function Phaser.Tilemaps.Components.WorldToTileX + * A Sprite Game Object is used for the display of both static and animated images in your game. + * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled + * and animated. + * + * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. + * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation + * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. + * + * @class Sprite + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor * @since 3.0.0 * - * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @extends Phaser.GameObjects.Components.Alpha + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Flip + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Origin + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.TextureCrop + * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible * - * @return {number} The X location in tile units. + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ -var WorldToTileX = function (worldX, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } +var Sprite = new Class({ - var tileWidth = layer.baseTileWidth; - var tilemapLayer = layer.tilemapLayer; + Extends: GameObject, - if (tilemapLayer) + Mixins: [ + Components.Alpha, + Components.BlendMode, + Components.Depth, + Components.Flip, + Components.GetBounds, + Components.Mask, + Components.Origin, + Components.Pipeline, + Components.ScrollFactor, + Components.Size, + Components.TextureCrop, + Components.Tint, + Components.Transform, + Components.Visible, + SpriteRender + ], + + initialize: + + function Sprite (scene, x, y, texture, frame) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + GameObject.call(this, scene, 'Sprite'); - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's horizontal scroll - worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.GameObjects.Sprite#_crop + * @type {object} + * @private + * @since 3.11.0 + */ + this._crop = this.resetCropObject(); - tileWidth *= tilemapLayer.scaleX; + /** + * The Animation State component of this Sprite. + * + * This component provides features to apply animations to this Sprite. + * It is responsible for playing, loading, queuing animations for later playback, + * mixing between animations and setting the current animation frame to this Sprite. + * + * @name Phaser.GameObjects.Sprite#anims + * @type {Phaser.Animations.AnimationState} + * @since 3.0.0 + */ + this.anims = new AnimationState(this); + + this.setTexture(texture, frame); + this.setPosition(x, y); + this.setSizeToFrame(); + this.setOriginFromFrame(); + this.initPipeline(); + + this.on(GameObjectEvents.ADDED_TO_SCENE, this.addedToScene, this); + this.on(GameObjectEvents.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); + }, + + /** + * Update this Sprite's animations. + * + * @method Phaser.GameObjects.Sprite#preUpdate + * @protected + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function (time, delta) + { + this.anims.update(time, delta); + }, + + /** + * Start playing the given animation on this Sprite. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).play('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * + * @method Phaser.GameObjects.Sprite#play + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.0.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * + * @return {this} This Game Object. + */ + play: function (key, ignoreIfPlaying) + { + return this.anims.play(key, ignoreIfPlaying); + }, + + /** + * Start playing the given animation on this Sprite, in reverse. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).playReverse('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * + * @method Phaser.GameObjects.Sprite#playReverse + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * + * @return {this} This Game Object. + */ + playReverse: function (key, ignoreIfPlaying) + { + return this.anims.playReverse(key, ignoreIfPlaying); + }, + + /** + * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * + * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. + * + * If an animation is already running and a new animation is given to this method, it will wait for + * the given delay before starting the new animation. + * + * If no animation is currently running, the given one begins after the delay. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * Prior to Phaser 3.50 this method was called 'delayedPlay'. + * + * @method Phaser.GameObjects.Sprite#playAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {number} delay - The delay, in milliseconds, to wait before starting the animation playing. + * + * @return {this} This Game Object. + */ + playAfterDelay: function (key, delay) + { + return this.anims.playAfterDelay(key, delay); + }, + + /** + * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback + * of the given animation. + * + * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an + * idle animation to a walking animation, by making them blend smoothly into each other. + * + * If no animation is currently running, the given one will start immediately. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * @method Phaser.GameObjects.Sprite#playAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {number} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * + * @return {this} This Game Object. + */ + playAfterRepeat: function (key, repeatCount) + { + return this.anims.playAfterRepeat(key, repeatCount); + }, + + /** + * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, + * or have the `stop` method called directly on it. + * + * An animation set to repeat forever will never enter a completed state. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, + * or when it ends (via its `animationcomplete` event). + * + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained + * animations without impacting the animation they're playing. + * + * Call this method with no arguments to reset all currently chained animations. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * @method Phaser.GameObjects.Sprite#chain + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * + * @return {this} This Game Object. + */ + chain: function (key) + { + return this.anims.chain(key); + }, + + /** + * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. + * + * If no animation is playing, no event will be dispatched. + * + * If there is another animation queued (via the `chain` method) then it will start playing immediately. + * + * @method Phaser.GameObjects.Sprite#stop + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @return {this} This Game Object. + */ + stop: function () + { + return this.anims.stop(); + }, + + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {number} delay - The number of milliseconds to wait before stopping this animation. + * + * @return {this} This Game Object. + */ + stopAfterDelay: function (delay) + { + return this.anims.stopAfterDelay(delay); + }, + + /** + * Stops the current animation from playing after the given number of repeats. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {number} [repeatCount=1] - How many times should the animation repeat before stopping? + * + * @return {this} This Game Object. + */ + stopAfterRepeat: function (repeatCount) + { + return this.anims.stopAfterRepeat(repeatCount); + }, + + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopOnFrame + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. + * + * @return {this} This Game Object. + */ + stopOnFrame: function (frame) + { + return this.anims.stopOnFrame(frame); + }, + + /** + * Build a JSON representation of this Sprite. + * + * @method Phaser.GameObjects.Sprite#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return Components.ToJSON(this); + }, + + /** + * Handles the pre-destroy step for the Sprite, which removes the Animation component. + * + * @method Phaser.GameObjects.Sprite#preDestroy + * @private + * @since 3.14.0 + */ + preDestroy: function () + { + this.anims.destroy(); + + this.anims = undefined; } - return snapToFloor - ? Math.floor(worldX / tileWidth) - : worldX / tileWidth; -}; +}); -module.exports = WorldToTileX; +module.exports = Sprite; /***/ }), -/* 67 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.WorldToTileY - * @since 3.0.0 - * - * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} The Y location in tile units. - */ -var WorldToTileY = function (worldY, snapToFloor, camera, layer) -{ - if (snapToFloor === undefined) { snapToFloor = true; } - - var tileHeight = layer.baseTileHeight; - var tilemapLayer = layer.tilemapLayer; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - // Find the world position relative to the static or dynamic layer's top left origin, - // factoring in the camera's vertical scroll - worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); - - tileHeight *= tilemapLayer.scaleY; - } - - return snapToFloor - ? Math.floor(worldY / tileHeight) - : worldY / tileHeight; -}; - -module.exports = WorldToTileY; - - -/***/ }), -/* 68 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13107,11 +15053,11 @@ module.exports = WorldToTileY; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(57); -var GetPoint = __webpack_require__(277); -var GetPoints = __webpack_require__(278); -var GEOM_CONST = __webpack_require__(49); -var Random = __webpack_require__(160); +var Contains = __webpack_require__(62); +var GetPoint = __webpack_require__(292); +var GetPoints = __webpack_require__(293); +var GEOM_CONST = __webpack_require__(55); +var Random = __webpack_require__(161); /** * @classdesc @@ -13145,7 +15091,7 @@ var Circle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Circle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -13237,7 +15183,7 @@ var Circle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -13472,7 +15418,3876 @@ module.exports = Circle; /***/ }), -/* 69 */ +/* 72 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using floor. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. + * As will `14` snap to `10`... but `16` will snap to `15`. + * + * @function Phaser.Math.Snap.Floor + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapFloor = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.floor(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapFloor; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Vector3 = __webpack_require__(37); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var WEBGL_CONST = { + + /** + * 8-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.BYTE + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + BYTE: { enum: 0x1400, size: 1 }, + + /** + * 8-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_BYTE + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_BYTE: { enum: 0x1401, size: 1 }, + + /** + * 16-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.SHORT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + SHORT: { enum: 0x1402, size: 2 }, + + /** + * 16-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_SHORT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_SHORT: { enum: 0x1403, size: 2 }, + + /** + * 32-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.INT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + INT: { enum: 0x1404, size: 4 }, + + /** + * 32-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_INT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_INT: { enum: 0x1405, size: 4 }, + + /** + * 32-bit IEEE floating point number. + * + * @name Phaser.Renderer.WebGL.FLOAT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + FLOAT: { enum: 0x1406, size: 4 } + +}; + +module.exports = WEBGL_CONST; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var DeepCopy = __webpack_require__(167); +var Events = __webpack_require__(190); +var GetFastValue = __webpack_require__(2); +var Matrix4 = __webpack_require__(73); +var RenderTarget = __webpack_require__(263); +var Utils = __webpack_require__(12); +var WebGLShader = __webpack_require__(574); + +/** + * @classdesc + * The `WebGLPipeline` is a base class used by all of the core Phaser pipelines. + * + * It describes the way elements will be rendered in WebGL. Internally, it handles + * compiling the shaders, creating vertex buffers, assigning primitive topology and + * binding vertex attributes, all based on the given configuration data. + * + * The pipeline is configured by passing in a `WebGLPipelineConfig` object. Please + * see the documentation for this type to fully understand the configuration options + * available to you. + * + * Usually, you would not extend from this class directly, but would instead extend + * from one of the core pipelines, such as the Multi Pipeline. + * + * The pipeline flow per render-step is as follows: + * + * 1) onPreRender - called once at the start of the render step + * 2) onRender - call for each Scene Camera that needs to render (so can be multiple times per render step) + * 3) Internal flow: + * 3a) bind (only called if a Game Object is using this pipeline and it's not currently active) + * 3b) onBind (called for every Game Object that uses this pipeline) + * 3c) flush (can be called by a Game Object, internal method or from outside by changing pipeline) + * 4) onPostRender - called once at the end of the render step + * + * @class WebGLPipeline + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration object for this WebGL Pipeline. + */ +var WebGLPipeline = new Class({ + + initialize: + + function WebGLPipeline (config) + { + var game = config.game; + var renderer = game.renderer; + var gl = renderer.gl; + + /** + * Name of the pipeline. Used for identification and setting from Game Objects. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#name + * @type {string} + * @since 3.0.0 + */ + this.name = GetFastValue(config, 'name', 'WebGLPipeline'); + + /** + * The Phaser Game instance to which this pipeline is bound. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#game + * @type {Phaser.Game} + * @since 3.0.0 + */ + this.game = game; + + /** + * The WebGL Renderer instance to which this pipeline is bound. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.0.0 + */ + this.renderer = renderer; + + /** + * A reference to the WebGL Pipeline Manager. + * + * This is initially undefined and only set when this pipeline is added + * to the manager. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#manager + * @type {?Phaser.Renderer.WebGL.PipelineManager} + * @since 3.50.0 + */ + this.manager; + + /** + * The WebGL context this WebGL Pipeline uses. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#gl + * @type {WebGLRenderingContext} + * @since 3.0.0 + */ + this.gl = gl; + + /** + * The canvas which this WebGL Pipeline renders to. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#view + * @type {HTMLCanvasElement} + * @since 3.0.0 + */ + this.view = game.canvas; + + /** + * Width of the current viewport. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#width + * @type {number} + * @since 3.0.0 + */ + this.width = 0; + + /** + * Height of the current viewport. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#height + * @type {number} + * @since 3.0.0 + */ + this.height = 0; + + /** + * The current number of vertices that have been added to the pipeline batch. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCount + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.vertexCount = 0; + + /** + * The total number of vertices that this pipeline batch can hold before it will flush. + * + * This defaults to `renderer batchSize * 7`, where `batchSize` is defined in the Renderer Config. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCapacity + * @type {number} + * @since 3.0.0 + */ + this.vertexCapacity = 0; + + /** + * Raw byte buffer of vertices. + * + * Either set via the config object, or generates a new Array Buffer of size `vertexCapacity * vertexSize`. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexData + * @type {ArrayBuffer} + * @readonly + * @since 3.0.0 + */ + this.vertexData; + + /** + * The WebGLBuffer that holds the vertex data. + * + * Created from the `vertices` config ArrayBuffer that was passed in, or set by default, by the pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexBuffer + * @type {WebGLBuffer} + * @readonly + * @since 3.0.0 + */ + this.vertexBuffer; + + /** + * The primitive topology which the pipeline will use to submit draw calls. + * + * Defaults to GL_TRIANGLES if not otherwise set in the config. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#topology + * @type {GLenum} + * @since 3.0.0 + */ + this.topology = GetFastValue(config, 'topology', gl.TRIANGLES); + + /** + * Uint8 view to the `vertexData` ArrayBuffer. Used for uploading vertex buffer resources to the GPU. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#bytes + * @type {Uint8Array} + * @since 3.0.0 + */ + this.bytes; + + /** + * Float32 view of the array buffer containing the pipeline's vertices. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexViewF32 + * @type {Float32Array} + * @since 3.0.0 + */ + this.vertexViewF32; + + /** + * Uint32 view of the array buffer containing the pipeline's vertices. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexViewU32 + * @type {Uint32Array} + * @since 3.0.0 + */ + this.vertexViewU32; + + /** + * Indicates if the current pipeline is active, or not, for this frame only. + * + * Reset to `true` in the `onRender` method. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#active + * @type {boolean} + * @since 3.10.0 + */ + this.active = false; + + /** + * Holds the most recently assigned texture unit. + + * Treat this value as read-only. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentUnit + * @type {number} + * @since 3.50.0 + */ + this.currentUnit = 0; + + /** + * Some pipelines require the forced use of texture zero (like the light pipeline). + * + * This property should be set when that is the case. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#forceZero + * @type {boolean} + * @since 3.50.0 + */ + this.forceZero = GetFastValue(config, 'forceZero', false); + + /** + * Indicates if this pipeline has booted or not. + * + * A pipeline boots only when the Game instance itself, and all associated systems, is + * fully ready. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#hasBooted + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.hasBooted = false; + + /** + * Indicates if this is a Post FX Pipeline, or not. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#isPostFX + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.isPostFX = false; + + /** + * An array of RenderTarget instances that belong to this pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#renderTargets + * @type {Phaser.Renderer.WebGL.RenderTarget[]} + * @since 3.50.0 + */ + this.renderTargets = []; + + /** + * A reference to the currently bound Render Target instance from the `WebGLPipeline.renderTargets` array. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentRenderTarget + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.currentRenderTarget; + + /** + * An array of all the WebGLShader instances that belong to this pipeline. + * + * Shaders manage their own attributes and uniforms, but share the same vertex data buffer, + * which belongs to this pipeline. + * + * Shaders are set in a call to the `setShadersFromConfig` method, which happens automatically, + * but can also be called at any point in your game. See the method documentation for details. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#shaders + * @type {Phaser.Renderer.WebGL.WebGLShader[]} + * @since 3.50.0 + */ + this.shaders = []; + + /** + * A reference to the currently bound WebGLShader instance from the `WebGLPipeline.shaders` array. + * + * For lots of pipelines, this is the only shader, so it is a quick way to reference it without + * an array look-up. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.currentShader; + + /** + * The Projection matrix, used by shaders as 'uProjectionMatrix' uniform. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#projectionMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.projectionMatrix; + + /** + * The configuration object that was used to create this pipeline. + * + * Treat this object as 'read only', because changing it post-creation will not + * impact this pipeline in any way. However, it is used internally for cloning + * and post-boot set-up. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#config + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} + * @since 3.50.0 + */ + this.config = config; + }, + + /** + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place. You can perform any final tasks that the + * pipeline may need, that relies on game systems such as the Texture Manager being ready. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#boot + * @since 3.11.0 + */ + boot: function () + { + var i; + var gl = this.gl; + var config = this.config; + var renderer = this.renderer; + + if (!this.isPostFX) + { + this.projectionMatrix = new Matrix4().identity(); + } + + // Create the Render Targets + + var renderTargets = this.renderTargets; + + var targets = GetFastValue(config, 'renderTarget', false); + + // If boolean, set to number = 1 + if (typeof(targets) === 'boolean' && targets) + { + targets = 1; + } + + var width = renderer.width; + var height = renderer.height; + + if (typeof(targets) === 'number') + { + // Create this many default RTs + for (i = 0; i < targets; i++) + { + renderTargets.push(new RenderTarget(renderer, width, height, 1, 0, true)); + } + } + else if (Array.isArray(targets)) + { + for (i = 0; i < targets.length; i++) + { + var scale = GetFastValue(targets[i], 'scale', 1); + var minFilter = GetFastValue(targets[i], 'minFilter', 0); + var autoClear = GetFastValue(targets[i], 'autoClear', 1); + + renderTargets.push(new RenderTarget(renderer, width, height, scale, minFilter, autoClear)); + } + } + + if (renderTargets.length) + { + // Default to the first one in the array + this.currentRenderTarget = renderTargets[0]; + } + + // Create the Shaders + + this.setShadersFromConfig(config); + + // Which shader has the largest vertex size? + var shaders = this.shaders; + var vertexSize = 0; + + for (i = 0; i < shaders.length; i++) + { + if (shaders[i].vertexSize > vertexSize) + { + vertexSize = shaders[i].vertexSize; + } + } + + var batchSize = GetFastValue(config, 'batchSize', renderer.config.batchSize); + + // * 6 because there are 6 vertices in a quad and 'batchSize' represents the quantity of quads in the batch + + this.vertexCapacity = batchSize * 6; + + var data = GetFastValue(config, 'vertices', new ArrayBuffer(this.vertexCapacity * vertexSize)); + + this.vertexData = data; + + if (GetFastValue(config, 'vertices', null)) + { + this.vertexBuffer = renderer.createVertexBuffer(data, gl.STATIC_DRAW); + } + else + { + this.vertexBuffer = renderer.createVertexBuffer(data.byteLength, gl.DYNAMIC_DRAW); + } + + this.bytes = new Uint8Array(data); + + this.vertexViewF32 = new Float32Array(data); + + this.vertexViewU32 = new Uint32Array(data); + + // Set-up shaders + + this.renderer.setVertexBuffer(this.vertexBuffer); + + for (i = 0; i < shaders.length; i++) + { + shaders[i].rebind(); + } + + this.currentShader.bind(); + + this.hasBooted = true; + + renderer.on(Events.RESIZE, this.resize, this); + renderer.on(Events.PRE_RENDER, this.onPreRender, this); + renderer.on(Events.RENDER, this.onRender, this); + renderer.on(Events.POST_RENDER, this.onPostRender, this); + + this.onBoot(); + }, + + /** + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBoot + * @since 3.50.0 + */ + onBoot: function () + { + }, + + /** + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. It's also called if the renderer + * changes size. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onResize + * @since 3.50.0 + * + * @param {number} width - The new width of this WebGL Pipeline. + * @param {number} height - The new height of this WebGL Pipeline. + */ + onResize: function () + { + }, + + /** + * Sets the currently active shader within this pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setShader + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} shader - The shader to set as being current. + * @param {boolean} [setAttributes=false] - Should the vertex attribute pointers be set? + * + * @return {this} This WebGLPipeline instance. + */ + setShader: function (shader, setAttributes) + { + var renderer = this.renderer; + + if (shader !== this.currentShader || renderer.currentProgram !== this.currentShader.program) + { + this.flush(); + + renderer.resetTextures(); + + renderer.setVertexBuffer(this.vertexBuffer); + + shader.bind(setAttributes, false); + + this.currentShader = shader; + } + + return this; + }, + + /** + * Searches all shaders in this pipeline for one matching the given name, then returns it. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#getShaderByName + * @since 3.50.0 + * + * @param {string} name - The index of the shader to set. + * + * @return {Phaser.Renderer.WebGL.WebGLShader} The WebGLShader instance, if found. + */ + getShaderByName: function (name) + { + var shaders = this.shaders; + + for (var i = 0; i < shaders.length; i++) + { + if (shaders[i].name === name) + { + return shaders[i]; + } + } + }, + + /** + * Destroys all shaders currently set in the `WebGLPipeline.shaders` array and then parses the given + * `config` object, extracting the shaders from it, creating `WebGLShader` instances and finally + * setting them into the `shaders` array of this pipeline. + * + * This is a destructive process. Be very careful when you call it, should you need to. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setShadersFromConfig + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration object for this WebGL Pipeline. + * + * @return {this} This WebGLPipeline instance. + */ + setShadersFromConfig: function (config) + { + var i; + var shaders = this.shaders; + var renderer = this.renderer; + + for (i = 0; i < shaders.length; i++) + { + shaders[i].destroy(); + } + + var vName = 'vertShader'; + var fName = 'fragShader'; + var uName = 'uniforms'; + var aName = 'attributes'; + + var defaultVertShader = GetFastValue(config, vName, null); + var defaultFragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(config, fName, null), renderer.maxTextures); + var defaultUniforms = GetFastValue(config, uName, null); + var defaultAttribs = GetFastValue(config, aName, null); + + var configShaders = GetFastValue(config, 'shaders', []); + + var len = configShaders.length; + + if (len === 0) + { + if (defaultVertShader && defaultFragShader) + { + this.shaders = [ new WebGLShader(this, 'default', defaultVertShader, defaultFragShader, DeepCopy(defaultAttribs), DeepCopy(defaultUniforms)) ]; + } + } + else + { + var newShaders = []; + + for (i = 0; i < len; i++) + { + var shaderEntry = configShaders[i]; + + var name = GetFastValue(shaderEntry, 'name', 'default'); + + var vertShader = GetFastValue(shaderEntry, vName, defaultVertShader); + var fragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(shaderEntry, fName, defaultFragShader), renderer.maxTextures); + var attributes = GetFastValue(shaderEntry, aName, defaultAttribs); + var uniforms = GetFastValue(shaderEntry, uName, defaultUniforms); + + if (vertShader && fragShader) + { + newShaders.push(new WebGLShader(this, name, vertShader, fragShader, DeepCopy(attributes), DeepCopy(uniforms))); + } + } + + this.shaders = newShaders; + } + + if (this.shaders.length === 0) + { + console.warn('Pipeline: ' + this.name + ' - Invalid shader config'); + } + else + { + this.currentShader = this.shaders[0]; + } + + return this; + }, + + /** + * Custom pipelines can use this method in order to perform any required pre-batch tasks + * for the given Game Object. It must return the texture unit the Game Object was assigned. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setGameObject + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. + * @param {Phaser.Textures.Frame} [frame] - Optional frame to use. Can override that of the Game Object. + * + * @return {number} The texture unit the Game Object has been assigned. + */ + setGameObject: function (gameObject, frame) + { + if (frame === undefined) { frame = gameObject.frame; } + + this.currentUnit = this.renderer.setTextureSource(frame.source); + + return this.currentUnit; + }, + + /** + * Check if the current batch of vertices is full. + * + * You can optionally provide an `amount` parameter. If given, it will check if the batch + * needs to flush _if_ the `amount` is added to it. This allows you to test if you should + * flush before populating the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#shouldFlush + * @since 3.0.0 + * + * @param {number} [amount=0] - Will the batch need to flush if this many vertices are added to it? + * + * @return {boolean} `true` if the current batch should be flushed, otherwise `false`. + */ + shouldFlush: function (amount) + { + if (amount === undefined) { amount = 0; } + + return (this.vertexCount + amount > this.vertexCapacity); + }, + + /** + * Resizes the properties used to describe the viewport. + * + * This method is called automatically by the renderer during its resize handler. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#resize + * @since 3.0.0 + * + * @param {number} width - The new width of this WebGL Pipeline. + * @param {number} height - The new height of this WebGL Pipeline. + * + * @return {this} This WebGLPipeline instance. + */ + resize: function (width, height) + { + if (width !== this.width || height !== this.height) + { + this.flush(); + } + + this.width = width; + this.height = height; + + var projectionMatrix = this.projectionMatrix; + + // Because Post FX Pipelines don't have them + if (projectionMatrix) + { + projectionMatrix.ortho(0, width, height, 0, -1000, 1000); + } + + var i; + + var targets = this.renderTargets; + + for (i = 0; i < targets.length; i++) + { + targets[i].resize(width, height); + } + + var shaders = this.shaders; + + for (i = 0; i < shaders.length; i++) + { + var shader = shaders[i]; + + if (shader.hasUniform('uProjectionMatrix')) + { + this.setMatrix4fv('uProjectionMatrix', false, projectionMatrix.val, shader); + } + } + + this.onResize(width, height); + + return this; + }, + + /** + * This method is called every time the Pipeline Manager makes this pipeline the currently active one. + * + * It binds the resources and shader needed for this pipeline, including setting the vertex buffer + * and attribute pointers. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bind + * @since 3.0.0 + * + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {this} This WebGLPipeline instance. + */ + bind: function (currentShader) + { + if (currentShader === undefined) { currentShader = this.currentShader; } + + var wasBound = this.renderer.setVertexBuffer(this.vertexBuffer); + + currentShader.bind(wasBound); + + this.currentShader = currentShader; + + return this; + }, + + /** + * This method is called every time the Pipeline Manager rebinds this pipeline. + * + * It resets all shaders this pipeline uses, setting their attributes again. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#rebind + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + rebind: function () + { + this.renderer.setVertexBuffer(this.vertexBuffer); + + var shaders = this.shaders; + + for (var i = 0; i < shaders.length; i++) + { + shaders[i].rebind(); + } + + this.currentShader = shaders[0]; + + this.onRebind(); + + return this; + }, + + /** + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. When this is called, the + * renderer has just performed a flush. It will bind the current render target, if any are set + * and finally call the `onPreBatch` hook. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#preBatch + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Cameras.Scene2D.Camera)} [gameObject] - The Game Object or Camera that invoked this pipeline, if any. + * + * @return {this} This WebGLPipeline instance. + */ + preBatch: function (gameObject) + { + if (this.currentRenderTarget) + { + this.currentRenderTarget.bind(); + } + + this.onPreBatch(gameObject); + + return this; + }, + + /** + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. When this is called, the + * renderer has just performed a flush. + * + * It calls the `onDraw` hook followed by the `onPostBatch` hook, which can be used to perform + * additional Post FX Pipeline processing. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#postBatch + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Cameras.Scene2D.Camera)} [gameObject] - The Game Object or Camera that invoked this pipeline, if any. + * + * @return {this} This WebGLPipeline instance. + */ + postBatch: function (gameObject) + { + this.onDraw(this.currentRenderTarget); + + this.onPostBatch(gameObject); + + return this; + }, + + /** + * This method is only used by Post FX Pipelines and those that extend from them. + * + * This method is called every time the `postBatch` method is called and is passed a + * reference to the current render target. + * + * At the very least a Post FX Pipeline should call `this.bindAndDraw(renderTarget)`, + * however, you can do as much additional processing as you like in this method if + * you override it from within your own pipelines. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onDraw + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} renderTarget - The Render Target. + */ + onDraw: function () + { + }, + + /** + * This method is called every time the Pipeline Manager deactivates this pipeline, swapping from + * it to another one. This happens after a call to `flush` and before the new pipeline is bound. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#unbind + * @since 3.50.0 + */ + unbind: function () + { + if (this.currentRenderTarget) + { + this.currentRenderTarget.unbind(); + } + }, + + /** + * Uploads the vertex data and emits a draw call for the current batch of vertices. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#flush + * @since 3.0.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + * + * @return {this} This WebGLPipeline instance. + */ + flush: function (isPostFlush) + { + if (isPostFlush === undefined) { isPostFlush = false; } + + var vertexCount = this.vertexCount; + + if (vertexCount > 0) + { + this.onBeforeFlush(isPostFlush); + + var gl = this.gl; + var vertexSize = this.currentShader.vertexSize; + + if (vertexCount === this.vertexCapacity) + { + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW); + } + else + { + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); + } + + gl.drawArrays(this.topology, 0, vertexCount); + + this.vertexCount = 0; + + this.onAfterFlush(isPostFlush); + } + + return this; + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time a **Game Object** asks the Pipeline Manager to use this pipeline. + * + * Unlike the `bind` method, which is only called once per frame, this is called for every object + * that requests use of this pipeline, allowing you to perform per-object set-up, such as loading + * shader uniform data. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBind + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onBind: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called when the Pipeline Manager needs to rebind this pipeline. This happens after a + * pipeline has been cleared, usually when passing control over to a 3rd party WebGL library, like Spine, + * and then returing to Phaser again. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onRebind + * @since 3.50.0 + */ + onRebind: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time the `batchQuad` or `batchTri` methods are called. If this was + * as a result of a Game Object, then the Game Object refernce is passed to this hook too. + * + * This hook is called _after_ the quad (or tri) has been added to the batch, so you can safely + * call 'flush' from within this. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately before a **Game Object** is about to add itself to the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onPreBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after a **Game Object** has been added to the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onPostBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, right before anything has been rendered, but after the canvas + * has been cleared. If this pipeline has a targetTexture, it will be cleared. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreRender + * @since 3.50.0 + */ + onPreRender: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, for every Camera in a Scene that wants to render. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onRender + * @since 3.50.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. + */ + onRender: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, after all rendering has happened and snapshots have been taken. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostRender + * @since 3.50.0 + */ + onPostRender: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time this pipeline is asked to flush its batch. + * + * It is called immediately before the gl.bufferData and gl.drawArray calls are made, so you can + * perform any final pre-render modifications. To apply changes post-render, see `onPostBatch`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBeforeFlush + * @since 3.50.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + */ + onBeforeFlush: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after this pipeline has finished flushing its batch. + * + * It is called after the `gl.drawArrays` call. + * + * You can perform additional post-render effects, but be careful not to call `flush` + * on this pipeline from within this method, or you'll cause an infinite loop. + * + * To apply changes pre-render, see `onBeforeFlush`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onAfterFlush + * @since 3.50.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + */ + onAfterFlush: function () + { + }, + + /** + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchVert + * @since 3.50.0 + * + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} u - UV u value. + * @param {number} v - UV v value. + * @param {number} unit - Texture unit to which the texture needs to be bound. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, u, v, unit, tintEffect, tint) + { + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewF32[++vertexOffset] = u; + vertexViewF32[++vertexOffset] = v; + vertexViewF32[++vertexOffset] = unit; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tint; + + this.vertexCount++; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchQuad + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|null)} gameObject - The Game Object, if any, drawing this quad. + * @param {number} x0 - The top-left x position. + * @param {number} y0 - The top-left y position. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {number} tintBR - The bottom-right tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {number} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchQuad: function (gameObject, x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) + { + if (unit === undefined) { unit = this.currentUnit; } + + var hasFlushed = false; + + if (this.shouldFlush(6)) + { + this.flush(); + + hasFlushed = true; + + unit = this.setTexture2D(texture); + } + + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x1, y1, u0, v1, unit, tintEffect, tintBL); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBR); + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBR); + this.batchVert(x3, y3, u1, v0, unit, tintEffect, tintTR); + + this.onBatch(gameObject); + + return hasFlushed; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchTri + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|null)} gameObject - The Game Object, if any, drawing this quad. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {number} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchTri: function (gameObject, x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) + { + if (unit === undefined) { unit = this.currentUnit; } + + var hasFlushed = false; + + if (this.shouldFlush(3)) + { + this.flush(); + + hasFlushed = true; + + unit = this.setTexture2D(texture); + } + + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x1, y1, u0, v1, unit, tintEffect, tintTR); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBL); + + this.onBatch(gameObject); + + return hasFlushed; + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * + * The dimensions are run through `Math.floor` before the quad is generated. + * + * Rectangle has no transform values and isn't transformed into the local space. + * + * Used for directly batching untransformed rectangles, such as Camera background colors. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#drawFillRect + * @since 3.50.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {number} color - Color of the rectangle to draw. + * @param {number} alpha - Alpha value of the rectangle to draw. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {boolean} [flipUV=true] - Flip the vertical UV coordinates of the texture before rendering? + */ + drawFillRect: function (x, y, width, height, color, alpha, texture, flipUV) + { + if (texture === undefined) { texture = this.renderer.whiteTexture.glTexture; } + if (flipUV === undefined) { flipUV = true; } + + x = Math.floor(x); + y = Math.floor(y); + + var xw = Math.floor(x + width); + var yh = Math.floor(y + height); + + var unit = this.setTexture2D(texture); + + var tint = Utils.getTintAppendFloatAlphaAndSwap(color, alpha); + + var u0 = 0; + var v0 = 0; + var u1 = 1; + var v1 = 1; + + if (flipUV) + { + v0 = 1; + v1 = 0; + } + + this.batchQuad(null, x, y, x, yh, xw, yh, xw, y, u0, v0, u1, v1, tint, tint, tint, tint, 0, texture, unit); + }, + + /** + * Sets the texture to be bound to the next available texture unit and returns + * the unit id. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setTexture2D + * @since 3.50.0 + * + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses `whiteTexture`. + * + * @return {number} The assigned texture unit. + */ + setTexture2D: function (texture) + { + if (texture === undefined) { texture = this.renderer.whiteTexture.glTexture; } + + this.currentUnit = this.renderer.setTexture2D(texture); + + return this.currentUnit; + }, + + /** + * Activates the given WebGL Texture and binds it to the requested texture slot. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bindTexture + * @since 3.50.0 + * + * @param {WebGLTexture} [target] - The WebGLTexture to activate and bind. + * @param {number} [unit=0] - The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. + * + * @return {this} This WebGL Pipeline instance. + */ + bindTexture: function (texture, unit) + { + if (unit === undefined) { unit = 0; } + + var gl = this.gl; + + gl.activeTexture(gl.TEXTURE0 + unit); + + gl.bindTexture(gl.TEXTURE_2D, texture); + + return this; + }, + + /** + * Activates the given Render Target texture and binds it to the + * requested WebGL texture slot. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bindRenderTarget + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The Render Target to activate and bind. + * @param {number} [unit=0] - The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. + * + * @return {this} This WebGL Pipeline instance. + */ + bindRenderTarget: function (target, unit) + { + return this.bindTexture(target.texture, unit); + }, + + /** + * Sets the current duration into a 1f uniform value based on the given name. + * + * This can be used for mapping time uniform values, such as `iTime`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setTime + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * + * @return {this} This WebGLPipeline instance. + */ + setTime: function (uniform) + { + this.set1f(uniform, this.game.loop.getDuration()); + + return this; + }, + + /** + * Sets a 1f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `float` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1f: function (name, x, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1f(name, x); + + return this; + }, + + /** + * Sets a 2f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec2` uniform. + * @param {number} y - The new Y component of the `vec2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2f: function (name, x, y, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2f(name, x, y); + + return this; + }, + + /** + * Sets a 3f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec3` uniform. + * @param {number} y - The new Y component of the `vec3` uniform. + * @param {number} z - The new Z component of the `vec3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3f: function (name, x, y, z, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3f(name, x, y, z); + + return this; + }, + + /** + * Sets a 4f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4f: function (name, x, y, z, w, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4f(name, x, y, z, w); + + return this; + }, + + /** + * Sets a 1fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1fv(name, arr); + + return this; + }, + + /** + * Sets a 2fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2fv(name, arr); + + return this; + }, + + /** + * Sets a 3fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3fv(name, arr); + + return this; + }, + + /** + * Sets a 4fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4fv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4fv(name, arr); + + return this; + }, + + /** + * Sets a 1iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1iv(name, arr); + + return this; + }, + + /** + * Sets a 2iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2iv(name, arr); + + return this; + }, + + /** + * Sets a 3iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3iv(name, arr); + + return this; + }, + + /** + * Sets a 4iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4iv: function (name, arr, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4iv(name, arr); + + return this; + }, + + /** + * Sets a 1i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set1i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `int` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set1i: function (name, x, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set1i(name, x); + + return this; + }, + + /** + * Sets a 2i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set2i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec2` uniform. + * @param {number} y - The new Y component of the `ivec2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set2i: function (name, x, y, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set2i(name, x, y); + + return this; + }, + + /** + * Sets a 3i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set3i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec3` uniform. + * @param {number} y - The new Y component of the `ivec3` uniform. + * @param {number} z - The new Z component of the `ivec3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set3i: function (name, x, y, z, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set3i(name, x, y, z); + + return this; + }, + + /** + * Sets a 4i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#set4i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform. + * @param {number} y - Y component of the uniform. + * @param {number} z - Z component of the uniform. + * @param {number} w - W component of the uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + set4i: function (name, x, y, z, w, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.set4i(name, x, y, z, w); + + return this; + }, + + /** + * Sets a matrix 2fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {number[]|Float32Array} matrix - The new values for the `mat2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix2fv: function (name, transpose, matrix, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix2fv(name, transpose, matrix); + + return this; + }, + + /** + * Sets a matrix 3fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {Float32Array} matrix - The new values for the `mat3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix3fv: function (name, transpose, matrix, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix3fv(name, transpose, matrix); + + return this; + }, + + /** + * Sets a matrix 4fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Should the matrix be transpose + * @param {Float32Array} matrix - Matrix data + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. + * + * @return {this} This WebGLPipeline instance. + */ + setMatrix4fv: function (name, transpose, matrix, shader) + { + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix4fv(name, transpose, matrix); + + return this; + }, + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + destroy: function () + { + var i; + + var shaders = this.shaders; + + for (i = 0; i < shaders.length; i++) + { + shaders[i].destroy(); + } + + var targets = this.renderTargets; + + for (i = 0; i < targets.length; i++) + { + targets[i].destroy(); + } + + this.gl.deleteBuffer(this.vertexBuffer); + + var renderer = this.renderer; + + renderer.off(Events.RESIZE, this.resize, this); + renderer.off(Events.PRE_RENDER, this.onPreRender, this); + renderer.off(Events.RENDER, this.onRender, this); + renderer.off(Events.POST_RENDER, this.onPostRender, this); + + this.game = null; + this.renderer = null; + this.manager = null; + this.gl = null; + this.view = null; + this.shaders = null; + this.renderTargets = null; + this.bytes = null; + this.vertexViewF32 = null; + this.vertexViewU32 = null; + this.vertexData = null; + this.vertexBuffer = null; + this.currentShader = null; + this.currentRenderTarget = null; + + return this; + } + +}); + +module.exports = WebGLPipeline; + + +/***/ }), +/* 76 */ /***/ (function(module, exports) { /** @@ -13487,9 +19302,9 @@ module.exports = Circle; * @function Phaser.Utils.Objects.Clone * @since 3.0.0 * - * @param {object} obj - the object from which to clone + * @param {object} obj - The object to clone. * - * @return {object} a new object with the same properties as the input obj + * @return {object} A new object with the same properties as the input object. */ var Clone = function (obj) { @@ -13514,7 +19329,7 @@ module.exports = Clone; /***/ }), -/* 70 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -13530,8 +19345,8 @@ module.exports = Clone; * @since 3.4.0 * * @param {array} array - The array to check. - * @param {integer} startIndex - The start index. - * @param {integer} endIndex - The end index. + * @param {number} startIndex - The start index. + * @param {number} endIndex - The end index. * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. * * @return {boolean} True if the range is safe, otherwise false. @@ -13563,7 +19378,7 @@ module.exports = SafeRange; /***/ }), -/* 71 */ +/* 78 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13572,8 +19387,8 @@ module.exports = SafeRange; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var EaseMap = __webpack_require__(123); -var UppercaseFirst = __webpack_require__(191); +var EaseMap = __webpack_require__(129); +var UppercaseFirst = __webpack_require__(196); /** * This internal function is used to return the correct ease function for a Tween. @@ -13672,7 +19487,7 @@ module.exports = GetEaseFunction; /***/ }), -/* 72 */ +/* 79 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13681,7 +19496,7 @@ module.exports = GetEaseFunction; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders a stroke outline around the given Shape. @@ -13699,7 +19514,7 @@ var Utils = __webpack_require__(10); var StrokePathWebGL = function (pipeline, src, alpha, dx, dy) { var strokeTint = pipeline.strokeTint; - var strokeTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha); + var strokeTintColor = Utils.getTintAppendFloatAlpha(src.strokeColor, src.strokeAlpha * alpha); strokeTint.TL = strokeTintColor; strokeTint.TR = strokeTintColor; @@ -13724,8 +19539,6 @@ var StrokePathWebGL = function (pipeline, src, alpha, dx, dy) var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - pipeline.setTexture2D(); - pipeline.batchLine( px1, py1, @@ -13747,7 +19560,7 @@ module.exports = StrokePathWebGL; /***/ }), -/* 73 */ +/* 80 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13757,12 +19570,12 @@ module.exports = StrokePathWebGL; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(85); -var GetPoint = __webpack_require__(443); -var GetPoints = __webpack_require__(444); -var GEOM_CONST = __webpack_require__(49); -var Line = __webpack_require__(40); -var Random = __webpack_require__(168); +var Contains = __webpack_require__(110); +var GetPoint = __webpack_require__(453); +var GetPoints = __webpack_require__(454); +var GEOM_CONST = __webpack_require__(55); +var Line = __webpack_require__(45); +var Random = __webpack_require__(173); /** * @classdesc @@ -13800,7 +19613,7 @@ var Triangle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Triangle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -13909,7 +19722,7 @@ var Triangle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param {number} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey. * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created. * @@ -14194,281 +20007,7 @@ module.exports = Triangle; /***/ }), -/* 74 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var File = __webpack_require__(22); -var FileTypesManager = __webpack_require__(8); -var GetFastValue = __webpack_require__(2); -var IsPlainObject = __webpack_require__(7); - -/** - * @classdesc - * A single Image File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image. - * - * @class ImageFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets. - */ -var ImageFile = new Class({ - - Extends: File, - - initialize: - - function ImageFile (loader, key, url, xhrSettings, frameConfig) - { - var extension = 'png'; - var normalMapURL; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - normalMapURL = GetFastValue(config, 'normalMap'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - frameConfig = GetFastValue(config, 'frameConfig'); - } - - if (Array.isArray(url)) - { - normalMapURL = url[1]; - url = url[0]; - } - - var fileConfig = { - type: 'image', - cache: loader.textureManager, - extension: extension, - responseType: 'blob', - key: key, - url: url, - xhrSettings: xhrSettings, - config: frameConfig - }; - - File.call(this, loader, fileConfig); - - // Do we have a normal map to load as well? - if (normalMapURL) - { - var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig); - - normalMap.type = 'normalMap'; - - this.setLink(normalMap); - - loader.addFile(normalMap); - } - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.ImageFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = new Image(); - - this.data.crossOrigin = this.crossOrigin; - - var _this = this; - - this.data.onload = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessComplete(); - }; - - this.data.onerror = function () - { - File.revokeObjectURL(_this.data); - - _this.onProcessError(); - }; - - File.createObjectURL(this.data, this.xhrLoader.response, 'image/png'); - }, - - /** - * Adds this file to its target cache upon successful loading and processing. - * - * @method Phaser.Loader.FileTypes.ImageFile#addToCache - * @since 3.7.0 - */ - addToCache: function () - { - var texture; - var linkFile = this.linkFile; - - if (linkFile && linkFile.state === CONST.FILE_COMPLETE) - { - if (this.type === 'image') - { - texture = this.cache.addImage(this.key, this.data, linkFile.data); - } - else - { - texture = this.cache.addImage(linkFile.key, linkFile.data, this.data); - } - - this.pendingDestroy(texture); - - linkFile.pendingDestroy(texture); - } - else if (!linkFile) - { - texture = this.cache.addImage(this.key, this.data); - - this.pendingDestroy(texture); - } - } - -}); - -/** - * Adds an Image, or array of Images, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.image('logo', 'images/phaserLogo.png'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. - * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback - * of animated gifs to Canvas elements. - * - * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Texture Manager first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details. - * - * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key: - * - * ```javascript - * this.load.image('logo', 'images/AtariLogo.png'); - * // and later in your game ... - * this.add.image(x, y, 'logo'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and - * this is what you would use to retrieve the image from the Texture Manager. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" - * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image, - * then you can specify it by providing an array as the `url` where the second element is the normal map: - * - * ```javascript - * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]); - * ``` - * - * Or, if you are using a config object use the `normalMap` property: - * - * ```javascript - * this.load.image({ - * key: 'logo', - * url: 'images/AtariLogo.png', - * normalMap: 'images/AtariLogo-n.png' - * }); - * ``` - * - * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings. - * Normal maps are a WebGL only feature. - * - * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#image - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('image', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new ImageFile(this, key[i])); - } - } - else - { - this.addFile(new ImageFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = ImageFile; - - -/***/ }), -/* 75 */ +/* 81 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14477,9 +20016,10 @@ module.exports = ImageFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = __webpack_require__(29); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Rectangle = __webpack_require__(465); +var Rectangle = __webpack_require__(479); /** * @classdesc @@ -14497,15 +20037,15 @@ var Rectangle = __webpack_require__(465); * @extends Phaser.GameObjects.Components.Visible * * @param {Phaser.Tilemaps.LayerData} layer - The LayerData object in the Tilemap that this tile belongs to. - * @param {integer} index - The unique index of this tile within the map. - * @param {integer} x - The x coordinate of this tile in tile coordinates. - * @param {integer} y - The y coordinate of this tile in tile coordinates. - * @param {integer} width - Width of the tile in pixels. - * @param {integer} height - Height of the tile in pixels. - * @param {integer} baseWidth - The base width a tile in the map (in pixels). Tiled maps support + * @param {number} index - The unique index of this tile within the map. + * @param {number} x - The x coordinate of this tile in tile coordinates. + * @param {number} y - The y coordinate of this tile in tile coordinates. + * @param {number} width - Width of the tile in pixels. + * @param {number} height - Height of the tile in pixels. + * @param {number} baseWidth - The base width a tile in the map (in pixels). Tiled maps support * multiple tileset sizes within one map, but they are still placed at intervals of the base * tile width. - * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps + * @param {number} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps * support multiple tileset sizes within one map, but they are still placed at intervals of the * base tile height. */ @@ -14535,7 +20075,7 @@ var Tile = new Class({ * represents a blank tile. * * @name Phaser.Tilemaps.Tile#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -14544,7 +20084,7 @@ var Tile = new Class({ * The x map coordinate of this tile in tile units. * * @name Phaser.Tilemaps.Tile#x - * @type {integer} + * @type {number} * @since 3.0.0 */ this.x = x; @@ -14553,7 +20093,7 @@ var Tile = new Class({ * The y map coordinate of this tile in tile units. * * @name Phaser.Tilemaps.Tile#y - * @type {integer} + * @type {number} * @since 3.0.0 */ this.y = y; @@ -14562,7 +20102,7 @@ var Tile = new Class({ * The width of the tile in pixels. * * @name Phaser.Tilemaps.Tile#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = width; @@ -14571,27 +20111,49 @@ var Tile = new Class({ * The height of the tile in pixels. * * @name Phaser.Tilemaps.Tile#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = height; /** - * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes + * The right of the tile in pixels. + * + * Set in the `updatePixelXY` method. + * + * @name Phaser.Tilemaps.Tile#right + * @type {number} + * @since 3.50.0 + */ + this.right; + + /** + * The bottom of the tile in pixels. + * + * Set in the `updatePixelXY` method. + * + * @name Phaser.Tilemaps.Tile#bottom + * @type {number} + * @since 3.50.0 + */ + this.bottom; + + /** + * The maps base width of a tile in pixels. Tiled maps support multiple tileset sizes * within one map, but they are still placed at intervals of the base tile size. * * @name Phaser.Tilemaps.Tile#baseWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.baseWidth = (baseWidth !== undefined) ? baseWidth : width; /** - * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes + * The maps base height of a tile in pixels. Tiled maps support multiple tileset sizes * within one map, but they are still placed at intervals of the base tile size. * * @name Phaser.Tilemaps.Tile#baseHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.baseHeight = (baseHeight !== undefined) ? baseHeight : height; @@ -14675,7 +20237,7 @@ var Tile = new Class({ this.collideDown = false; /** - * Whether the tile's left edge is interesting for collisions. + * Whether the tiles left edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceLeft * @type {boolean} @@ -14684,7 +20246,7 @@ var Tile = new Class({ this.faceLeft = false; /** - * Whether the tile's right edge is interesting for collisions. + * Whether the tiles right edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceRight * @type {boolean} @@ -14693,7 +20255,7 @@ var Tile = new Class({ this.faceRight = false; /** - * Whether the tile's top edge is interesting for collisions. + * Whether the tiles top edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceTop * @type {boolean} @@ -14702,7 +20264,7 @@ var Tile = new Class({ this.faceTop = false; /** - * Whether the tile's bottom edge is interesting for collisions. + * Whether the tiles bottom edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceBottom * @type {boolean} @@ -14717,7 +20279,7 @@ var Tile = new Class({ * @type {function} * @since 3.0.0 */ - this.collisionCallback = null; + this.collisionCallback = undefined; /** * The context in which the collision callback will be called. @@ -14775,7 +20337,7 @@ var Tile = new Class({ * * @param {Phaser.Tilemaps.Tile} tile - The tile to copy from. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ copy: function (tile) { @@ -14804,7 +20366,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#getCollisionGroup * @since 3.0.0 * - * @return {?object} tileset + * @return {?object} The collision group for this Tile, as defined in the Tileset, or `null` if no group was defined. */ getCollisionGroup: function () { @@ -14820,7 +20382,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#getTileData * @since 3.0.0 * - * @return {?object} tileset + * @return {?object} The tile data for this Tile, as defined in the Tileset, or `null` if no data was defined. */ getTileData: function () { @@ -14836,7 +20398,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The left (x) value of this tile. */ getLeft: function (camera) { @@ -14854,7 +20416,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The right (x) value of this tile. */ getRight: function (camera) { @@ -14872,7 +20434,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The top (y) value of this tile. */ getTop: function (camera) { @@ -14895,11 +20457,12 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The bottom (y) value of this tile. */ getBottom: function (camera) { var tilemapLayer = this.tilemapLayer; + return tilemapLayer ? this.getTop(camera) + this.height * tilemapLayer.scaleY : this.getTop(camera) + this.height; @@ -14916,7 +20479,7 @@ var Tile = new Class({ * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * @param {Phaser.Geom.Rectangle} [output] - Optional Rectangle object to store the results in. * - * @return {(Phaser.Geom.Rectangle|object)} + * @return {(Phaser.Geom.Rectangle|object)} The bounds of this Tile. */ getBounds: function (camera, output) { @@ -14939,7 +20502,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The center x position of this Tile. */ getCenterX: function (camera) { @@ -14955,26 +20518,13 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The center y position of this Tile. */ getCenterY: function (camera) { return (this.getTop(camera) + this.getBottom(camera)) / 2; }, - /** - * Clean up memory. - * - * @method Phaser.Tilemaps.Tile#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.collisionCallback = undefined; - this.collisionCallbackContext = undefined; - this.properties = undefined; - }, - /** * Check for intersection with this tile. This does not factor in camera scroll, layer scale or * layer position. @@ -14987,7 +20537,7 @@ var Tile = new Class({ * @param {number} right - The right point. * @param {number} bottom - The bottom point. * - * @return {boolean} + * @return {boolean} `true` if the Tile intersects with the given dimensions, otherwise `false`. */ intersects: function (x, y, right, bottom) { @@ -15010,9 +20560,19 @@ var Tile = new Class({ */ isInteresting: function (collides, faces) { - if (collides && faces) { return (this.canCollide || this.hasInterestingFace); } - else if (collides) { return this.collides; } - else if (faces) { return this.hasInterestingFace; } + if (collides && faces) + { + return (this.canCollide || this.hasInterestingFace); + } + else if (collides) + { + return this.collides; + } + else if (faces) + { + return this.hasInterestingFace; + } + return false; }, @@ -15024,7 +20584,7 @@ var Tile = new Class({ * * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ resetCollision: function (recalculateFaces) { @@ -15059,7 +20619,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#resetFaces * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ resetFaces: function () { @@ -15081,10 +20641,9 @@ var Tile = new Class({ * @param {boolean} [right] - Indicating collide with any object on the right. * @param {boolean} [up] - Indicating collide with any object on the top. * @param {boolean} [down] - Indicating collide with any object on the bottom. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces - * for this tile and its neighbors. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setCollision: function (left, right, up, down, recalculateFaces) { @@ -15126,7 +20685,7 @@ var Tile = new Class({ * @param {function} callback - Callback function. * @param {object} context - Callback will be called within this context. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setCollisionCallback: function (callback, context) { @@ -15150,12 +20709,12 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#setSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tile in pixels. - * @param {integer} tileHeight - The height of the tile in pixels. - * @param {integer} baseWidth - The base width a tile in the map (in pixels). - * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). + * @param {number} tileWidth - The width of the tile in pixels. + * @param {number} tileHeight - The height of the tile in pixels. + * @param {number} baseWidth - The base width a tile in the map (in pixels). + * @param {number} baseHeight - The base height of the tile in pixels (in pixels). * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setSize: function (tileWidth, tileHeight, baseWidth, baseHeight) { @@ -15170,26 +20729,67 @@ var Tile = new Class({ }, /** - * Used internally. Updates the tile's world XY position based on the current tile size. + * Used internally. Updates the tiles world XY position based on the current tile size. * * @method Phaser.Tilemaps.Tile#updatePixelXY * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ updatePixelXY: function () { - // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the - // bottom left, while the Phaser renderer assumes the origin is the top left. The y - // coordinate needs to be adjusted by the difference. - this.pixelX = this.x * this.baseWidth; - this.pixelY = this.y * this.baseHeight; + var orientation = this.layer.orientation; - // this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight); + if (orientation === CONST.ORTHOGONAL) + { + // In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the + // bottom left, while the Phaser renderer assumes the origin is the top left. The y + // coordinate needs to be adjusted by the difference. + + this.pixelX = this.x * this.baseWidth; + this.pixelY = this.y * this.baseHeight; + } + else if (orientation === CONST.ISOMETRIC) + { + // Reminder: For the tilemap to be centered we have to move the image to the right with the camera! + // This is crucial for wordtotile, tiletoworld to work. + + this.pixelX = (this.x - this.y) * this.baseWidth * 0.5; + this.pixelY = (this.x + this.y) * this.baseHeight * 0.5; + } + else if (orientation === CONST.STAGGERED) + { + this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2); + this.pixelY = this.y * (this.baseHeight / 2); + } + else if (orientation === CONST.HEXAGONAL) + { + var len = this.layer.hexSideLength; + var rowHeight = ((this.baseHeight - len) / 2 + len); + + this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2); + this.pixelY = this.y * rowHeight; + } + + this.right = this.pixelX + this.baseWidth; + this.bottom = this.pixelY + this.baseHeight; return this; }, + /** + * Clean up memory. + * + * @method Phaser.Tilemaps.Tile#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.collisionCallback = undefined; + this.collisionCallbackContext = undefined; + this.properties = undefined; + }, + /** * True if this tile can collide on any of its faces or has a collision callback set. * @@ -15199,10 +20799,12 @@ var Tile = new Class({ * @since 3.0.0 */ canCollide: { + get: function () { - return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); + return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || (this.collisionCallback !== undefined)); } + }, /** @@ -15214,10 +20816,12 @@ var Tile = new Class({ * @since 3.0.0 */ collides: { + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); } + }, /** @@ -15229,16 +20833,18 @@ var Tile = new Class({ * @since 3.0.0 */ hasInterestingFace: { + get: function () { return (this.faceTop || this.faceBottom || this.faceLeft || this.faceRight); } + }, /** * The tileset that contains this Tile. This is null if accessed from a LayerData instance - * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has - * an index that doesn't correspond to any of the map's tilesets. + * before the tile is placed in a TilemapLayer, or if the tile has an index that doesn't correspond + * to any of the maps tilesets. * * @name Phaser.Tilemaps.Tile#tileset * @type {?Phaser.Tilemaps.Tileset} @@ -15268,24 +20874,25 @@ var Tile = new Class({ /** * The tilemap layer that contains this Tile. This will only return null if accessed from a - * LayerData instance before the tile is placed within a StaticTilemapLayer or - * DynamicTilemapLayer. + * LayerData instance before the tile is placed within a TilemapLayer. * * @name Phaser.Tilemaps.Tile#tilemapLayer - * @type {?Phaser.Tilemaps.StaticTilemapLayer|Phaser.Tilemaps.DynamicTilemapLayer} + * @type {?Phaser.Tilemaps.TilemapLayer} * @readonly * @since 3.0.0 */ tilemapLayer: { + get: function () { return this.layer.tilemapLayer; } + }, /** * The tilemap that contains this Tile. This will only return null if accessed from a LayerData - * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer. + * instance before the tile is placed within a TilemapLayer. * * @name Phaser.Tilemaps.Tile#tilemap * @type {?Phaser.Tilemaps.Tilemap} @@ -15293,11 +20900,14 @@ var Tile = new Class({ * @since 3.0.0 */ tilemap: { + get: function () { var tilemapLayer = this.tilemapLayer; + return tilemapLayer ? tilemapLayer.tilemap : null; } + } }); @@ -15306,8 +20916,8 @@ module.exports = Tile; /***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { +/* 82 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -15315,481 +20925,94 @@ module.exports = Tile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AnimationState = __webpack_require__(157); -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var SpriteRender = __webpack_require__(991); - -/** - * @classdesc - * A Sprite Game Object. - * - * A Sprite Game Object is used for the display of both static and animated images in your game. - * Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled - * and animated. - * - * The main difference between a Sprite and an Image Game Object is that you cannot animate Images. - * As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation - * Component. If you do not require animation then you can safely use Images to replace Sprites in all cases. - * - * @class Sprite - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Alpha - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Flip - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.GameObjects.Components.Size - * @extends Phaser.GameObjects.Components.TextureCrop - * @extends Phaser.GameObjects.Components.Tint - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Sprite = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Alpha, - Components.BlendMode, - Components.Depth, - Components.Flip, - Components.GetBounds, - Components.Mask, - Components.Origin, - Components.Pipeline, - Components.ScrollFactor, - Components.Size, - Components.TextureCrop, - Components.Tint, - Components.Transform, - Components.Visible, - SpriteRender - ], - - initialize: - - function Sprite (scene, x, y, texture, frame) - { - GameObject.call(this, scene, 'Sprite'); - - /** - * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. - * - * @name Phaser.GameObjects.Sprite#_crop - * @type {object} - * @private - * @since 3.11.0 - */ - this._crop = this.resetCropObject(); - - /** - * The Animation State component of this Sprite. - * - * This component provides features to apply animations to this Sprite. - * It is responsible for playing, loading, queuing animations for later playback, - * mixing between animations and setting the current animation frame to this Sprite. - * - * @name Phaser.GameObjects.Sprite#anims - * @type {Phaser.Animations.AnimationState} - * @since 3.0.0 - */ - this.anims = new AnimationState(this); - - this.setTexture(texture, frame); - this.setPosition(x, y); - this.setSizeToFrame(); - this.setOriginFromFrame(); - this.initPipeline(); - - this.on(GameObjectEvents.ADDED_TO_SCENE, this.addedToScene, this); - this.on(GameObjectEvents.REMOVED_FROM_SCENE, this.removedFromScene, this); - }, - - // Overrides Game Object method - addedToScene: function () - { - this.scene.sys.updateList.add(this); - }, - - // Overrides Game Object method - removedFromScene: function () - { - this.scene.sys.updateList.remove(this); - }, +var PIPELINE_CONST = { /** - * Update this Sprite's animations. + * The Bitmap Mask Pipeline. * - * @method Phaser.GameObjects.Sprite#preUpdate - * @protected - * @since 3.0.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - preUpdate: function (time, delta) - { - this.anims.update(time, delta); - }, - - /** - * Start playing the given animation on this Sprite. - * - * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * - * The benefit of a global animation is that multiple Sprites can all play the same animation, without - * having to duplicate the data. You can just create it once and then play it on any Sprite. - * - * The following code shows how to create a global repeating animation. The animation will be created - * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * - * ```javascript - * var config = { - * key: 'run', - * frames: 'muybridge', - * frameRate: 15, - * repeat: -1 - * }; - * - * // This code should be run from within a Scene: - * this.anims.create(config); - * ``` - * - * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, - * you can call the `Animation.create` method instead. It accepts the exact same parameters as when - * creating a global animation, however the resulting data is kept locally in this Sprite. - * - * With the animation created, either globally or locally, you can now play it on this Sprite: - * - * ```javascript - * this.add.sprite(x, y).play('run'); - * ``` - * - * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config - * object instead: - * - * ```javascript - * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); - * ``` - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * If you need a Sprite to be able to play both local and global animations, make sure they don't - * have conflicting keys. - * - * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * - * Also, see the documentation in the Animation Manager for further details on creating animations. - * - * @method Phaser.GameObjects.Sprite#play - * @fires Phaser.Animations.Events#ANIMATION_START - * @since 3.0.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * - * @return {this} This Game Object. - */ - play: function (key, ignoreIfPlaying) - { - return this.anims.play(key, ignoreIfPlaying); - }, - - /** - * Start playing the given animation on this Sprite, in reverse. - * - * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. - * - * The benefit of a global animation is that multiple Sprites can all play the same animation, without - * having to duplicate the data. You can just create it once and then play it on any Sprite. - * - * The following code shows how to create a global repeating animation. The animation will be created - * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': - * - * ```javascript - * var config = { - * key: 'run', - * frames: 'muybridge', - * frameRate: 15, - * repeat: -1 - * }; - * - * // This code should be run from within a Scene: - * this.anims.create(config); - * ``` - * - * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, - * you can call the `Animation.create` method instead. It accepts the exact same parameters as when - * creating a global animation, however the resulting data is kept locally in this Sprite. - * - * With the animation created, either globally or locally, you can now play it on this Sprite: - * - * ```javascript - * this.add.sprite(x, y).playReverse('run'); - * ``` - * - * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config - * object instead: - * - * ```javascript - * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); - * ``` - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * If you need a Sprite to be able to play both local and global animations, make sure they don't - * have conflicting keys. - * - * See the documentation for the `PlayAnimationConfig` config object for more details about this. - * - * Also, see the documentation in the Animation Manager for further details on creating animations. - * - * @method Phaser.GameObjects.Sprite#playReverse - * @fires Phaser.Animations.Events#ANIMATION_START + * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * - * @return {this} This Game Object. */ - playReverse: function (key, ignoreIfPlaying) - { - return this.anims.playReverse(key, ignoreIfPlaying); - }, + BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', /** - * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * The Light 2D Pipeline. * - * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. - * - * If an animation is already running and a new animation is given to this method, it will wait for - * the given delay before starting the new animation. - * - * If no animation is currently running, the given one begins after the delay. - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * Prior to Phaser 3.50 this method was called 'delayedPlay'. - * - * @method Phaser.GameObjects.Components.Animation#playAfterDelay - * @fires Phaser.Animations.Events#ANIMATION_START + * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. - * - * @return {this} This Game Object. */ - playAfterDelay: function (key, delay) - { - return this.anims.playAfterDelay(key, delay); - }, + LIGHT_PIPELINE: 'Light2D', /** - * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback - * of the given animation. + * The Single Texture Pipeline. * - * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an - * idle animation to a walking animation, by making them blend smoothly into each other. - * - * If no animation is currently running, the given one will start immediately. - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * @method Phaser.GameObjects.Components.Animation#playAfterRepeat - * @fires Phaser.Animations.Events#ANIMATION_START + * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? - * - * @return {this} This Game Object. */ - playAfterRepeat: function (key, repeatCount) - { - return this.anims.playAfterRepeat(key, repeatCount); - }, + SINGLE_PIPELINE: 'SinglePipeline', /** - * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. + * The Multi Texture Pipeline. * - * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, - * or have the `stop` method called directly on it. - * - * An animation set to repeat forever will never enter a completed state. - * - * You can chain a new animation at any point, including before the current one starts playing, during it, - * or when it ends (via its `animationcomplete` event). - * - * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained - * animations without impacting the animation they're playing. - * - * Call this method with no arguments to reset all currently chained animations. - * - * When playing an animation on a Sprite it will first check to see if it can find a matching key - * locally within the Sprite. If it can, it will play the local animation. If not, it will then - * search the global Animation Manager and look for it there. - * - * @method Phaser.GameObjects.Sprite#chain + * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. - * - * @return {this} This Game Object. */ - chain: function (key) - { - return this.anims.chain(key); - }, + MULTI_PIPELINE: 'MultiPipeline', /** - * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. + * The Rope Pipeline. * - * If no animation is playing, no event will be dispatched. - * - * If there is another animation queued (via the `chain` method) then it will start playing immediately. - * - * @method Phaser.GameObjects.Sprite#stop - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @return {this} This Game Object. */ - stop: function () - { - return this.anims.stop(); - }, + ROPE_PIPELINE: 'RopePipeline', /** - * Stops the current animation from playing after the specified time delay, given in milliseconds. + * The Graphics and Shapes Pipeline. * - * It then dispatches the `ANIMATION_STOP` event. - * - * If no animation is running, no events will be dispatched. - * - * If there is another animation in the queue (set via the `chain` method) then it will start playing, - * when the current one stops. - * - * @method Phaser.GameObjects.Sprite#stopAfterDelay - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.GRAPHICS_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. - * - * @return {this} This Game Object. */ - stopAfterDelay: function (delay) - { - return this.anims.stopAfterDelay(delay); - }, + GRAPHICS_PIPELINE: 'GraphicsPipeline', /** - * Stops the current animation from playing after the given number of repeats. + * The Post FX Pipeline. * - * It then dispatches the `ANIMATION_STOP` event. - * - * If no animation is running, no events will be dispatched. - * - * If there is another animation in the queue (set via the `chain` method) then it will start playing, - * when the current one stops. - * - * @method Phaser.GameObjects.Sprite#stopAfterRepeat - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.POSTFX_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? - * - * @return {this} This Game Object. */ - stopAfterRepeat: function (repeatCount) - { - return this.anims.stopAfterRepeat(repeatCount); - }, + POSTFX_PIPELINE: 'PostFXPipeline', /** - * Stops the current animation from playing when it next sets the given frame. - * If this frame doesn't exist within the animation it will not stop it from playing. + * The Utility Pipeline. * - * It then dispatches the `ANIMATION_STOP` event. - * - * If no animation is running, no events will be dispatched. - * - * If there is another animation in the queue (set via the `chain` method) then it will start playing, - * when the current one stops. - * - * @method Phaser.GameObjects.Sprite#stopOnFrame - * @fires Phaser.Animations.Events#ANIMATION_STOP + * @name Phaser.Renderer.WebGL.Pipelines.UTILITY_PIPELINE + * @type {string} + * @const * @since 3.50.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. - * - * @return {this} This Game Object. */ - stopOnFrame: function (frame) - { - return this.anims.stopOnFrame(frame); - }, + UTILITY_PIPELINE: 'UtilityPipeline' +}; - /** - * Build a JSON representation of this Sprite. - * - * @method Phaser.GameObjects.Sprite#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ - toJSON: function () - { - return Components.ToJSON(this); - }, - - /** - * Handles the pre-destroy step for the Sprite, which removes the Animation component. - * - * @method Phaser.GameObjects.Sprite#preDestroy - * @private - * @since 3.14.0 - */ - preDestroy: function () - { - this.anims.destroy(); - - this.anims = undefined; - } - -}); - -module.exports = Sprite; +module.exports = PIPELINE_CONST; /***/ }), -/* 77 */ +/* 83 */ /***/ (function(module, exports) { /** @@ -15817,7 +21040,7 @@ module.exports = GetCenterX; /***/ }), -/* 78 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -15852,7 +21075,7 @@ module.exports = SetCenterX; /***/ }), -/* 79 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -15880,7 +21103,7 @@ module.exports = GetCenterY; /***/ }), -/* 80 */ +/* 86 */ /***/ (function(module, exports) { /** @@ -15915,7 +21138,7 @@ module.exports = SetCenterY; /***/ }), -/* 81 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15924,854 +21147,87 @@ module.exports = SetCenterY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); +var SpliceOne = __webpack_require__(103); /** - * @classdesc - * A representation of a vector in 3D space. + * Removes the given item, or array of items, from the array. * - * A three-component vector. + * The array is modified in-place. * - * @class Vector3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 + * You can optionally specify a callback to be invoked for each item successfully removed from the array. * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. + * @function Phaser.Utils.Array.Remove + * @since 3.4.0 + * + * @param {array} array - The array to be modified. + * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. + * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. + * @param {object} [context] - The context in which the callback is invoked. + * + * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. */ -var Vector3 = new Class({ - - initialize: - - function Vector3 (x, y, z) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - }, - - /** - * Set this Vector to point up. - * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. - */ - clone: function () - { - return new Vector3(this.x, this.y, this.z); - }, - - /** - * Calculate the cross (vector) product of two given Vectors. - * - * @method Phaser.Math.Vector3#crossVectors - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - crossVectors: function (a, b) - { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. - * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - - return this; - }, - - /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. - * - * @method Phaser.Math.Vector3#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - set: function (x, y, z) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - } - else - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - - return this; - }, - - /** - * Negate the `x`, `y` and `z` components of this Vector. - * - * @method Phaser.Math.Vector3#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. - * - * @return {number} The dot product of this Vector and `v`. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z; - }, - - /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. - * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - cross: function (v) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; - } - -}); - -/** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ZERO = new Vector3(); - -/** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.RIGHT = new Vector3(1, 0, 0); - -/** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.LEFT = new Vector3(-1, 0, 0); - -/** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.UP = new Vector3(0, -1, 0); - -/** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.DOWN = new Vector3(0, 1, 0); - -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Removes a single item from an array and returns it without creating gc, like the native splice does. - * Based on code by Mike Reinstein. - * - * @function Phaser.Utils.Array.SpliceOne - * @since 3.0.0 - * - * @param {array} array - The array to splice from. - * @param {integer} index - The index of the item which should be spliced. - * - * @return {*} The item which was spliced (removed). - */ -var SpliceOne = function (array, index) +var Remove = function (array, item, callback, context) { - if (index >= array.length) + if (context === undefined) { context = array; } + + var index; + + // Fast path to avoid array mutation and iteration + if (!Array.isArray(item)) { - return; + index = array.indexOf(item); + + if (index !== -1) + { + SpliceOne(array, index); + + if (callback) + { + callback.call(context, item); + } + + return item; + } + else + { + return null; + } } - var len = array.length - 1; + // If we got this far, we have an array of items to remove - var item = array[index]; + var itemLength = item.length - 1; + var removed = []; - for (var i = index; i < len; i++) + while (itemLength >= 0) { - array[i] = array[i + 1]; + var entry = item[itemLength]; + + index = array.indexOf(entry); + + if (index !== -1) + { + SpliceOne(array, index); + + removed.push(entry); + + if (callback) + { + callback.call(context, entry); + } + } + + itemLength--; } - array.length = len; - - return item; + return removed; }; -module.exports = SpliceOne; +module.exports = Remove; /***/ }), -/* 83 */ +/* 88 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16781,7 +21237,7 @@ module.exports = SpliceOne; */ var Class = __webpack_require__(0); -var FromPoints = __webpack_require__(186); +var FromPoints = __webpack_require__(191); var Rectangle = __webpack_require__(9); var Vector2 = __webpack_require__(3); @@ -16817,7 +21273,7 @@ var Curve = new Class({ * The default number of divisions within the curve. * * @name Phaser.Curves.Curve#defaultDivisions - * @type {integer} + * @type {number} * @default 5 * @since 3.0.0 */ @@ -16827,7 +21283,7 @@ var Curve = new Class({ * The quantity of arc length divisions within the curve. * * @name Phaser.Curves.Curve#arcLengthDivisions - * @type {integer} + * @type {number} * @default 100 * @since 3.0.0 */ @@ -16896,7 +21352,7 @@ var Curve = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn. - * @param {integer} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. + * @param {number} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. * * @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn. */ @@ -16918,7 +21374,7 @@ var Curve = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. If falsey a new object will be created. - * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. + * @param {number} [accuracy=16] - The accuracy of the bounds calculations. * * @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object. */ @@ -16949,7 +21405,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getDistancePoints * @since 3.0.0 * - * @param {integer} distance - The distance, in pixels, between each point along the curve. + * @param {number} distance - The distance, in pixels, between each point along the curve. * * @return {Phaser.Geom.Point[]} An Array of Point objects. */ @@ -17009,7 +21465,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getLengths * @since 3.0.0 * - * @param {integer} [divisions] - The number of divisions or segments. + * @param {number} [divisions] - The number of divisions or segments. * * @return {number[]} An array of cumulative lengths. */ @@ -17091,7 +21547,7 @@ var Curve = new Class({ * * @generic {Phaser.Math.Vector2[]} O - [out,$return] * - * @param {integer} [divisions] - The number of divisions to make. + * @param {number} [divisions] - The number of divisions to make. * @param {number} [stepRate] - The curve distance between points, implying `divisions`. * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in. * @@ -17151,7 +21607,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getSpacedPoints * @since 3.0.0 * - * @param {integer} [divisions=this.defaultDivisions] - The number of divisions to make. + * @param {number} [divisions=this.defaultDivisions] - The number of divisions to make. * @param {number} [stepRate] - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in. * @@ -17271,8 +21727,8 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getTFromDistance * @since 3.0.0 * - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The distance. */ @@ -17293,8 +21749,8 @@ var Curve = new Class({ * @since 3.0.0 * * @param {number} u - A float between 0 and 1. - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The equidistant value. */ @@ -17388,7 +21844,7 @@ module.exports = Curve; /***/ }), -/* 84 */ +/* 89 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17403,75 +21859,198 @@ module.exports = Curve; module.exports = { - ADD: __webpack_require__(898), - COMPLETE: __webpack_require__(899), - FILE_COMPLETE: __webpack_require__(900), - FILE_KEY_COMPLETE: __webpack_require__(901), - FILE_LOAD_ERROR: __webpack_require__(902), - FILE_LOAD: __webpack_require__(903), - FILE_PROGRESS: __webpack_require__(904), - POST_PROCESS: __webpack_require__(905), - PROGRESS: __webpack_require__(906), - START: __webpack_require__(907) + ADD: __webpack_require__(954), + COMPLETE: __webpack_require__(955), + FILE_COMPLETE: __webpack_require__(956), + FILE_KEY_COMPLETE: __webpack_require__(957), + FILE_LOAD_ERROR: __webpack_require__(958), + FILE_LOAD: __webpack_require__(959), + FILE_PROGRESS: __webpack_require__(960), + POST_PROCESS: __webpack_require__(961), + PROGRESS: __webpack_require__(962), + START: __webpack_require__(963) }; /***/ }), -/* 85 */ +/* 90 */ /***/ (function(module, exports) { /** * @author Richard Davey + * @author Angry Bytes (and contributors) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// http://www.blackpawn.com/texts/pointinpoly/ +/** + * The comparator function. + * + * @ignore + * + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. + * + * @return {boolean} True if they localCompare, otherwise false. + */ +function Compare (a, b) +{ + return String(a).localeCompare(b); +} /** - * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * Process the array contents. * - * @function Phaser.Geom.Triangle.Contains + * @ignore + * + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. + * + * @return {array} - The processed array. + */ +function Process (array, compare) +{ + // Short-circuit when there's nothing to sort. + var len = array.length; + + if (len <= 1) + { + return array; + } + + // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. + // Chunks are the size of the left or right hand in merge sort. + // Stop when the left-hand covers all of the array. + var buffer = new Array(len); + + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + + buffer = tmp; + } + + return array; +} + +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ + var len = arr.length; + var i = 0; + + // Step size / double chunk size. + var dbl = chk * 2; + + // Bounds of the left and right chunks. + var l, r, e; + + // Iterators over the left and right chunk. + var li, ri; + + // Iterate over pairs of chunks. + for (l = 0; l < len; l += dbl) + { + r = l + chk; + e = r + chk; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } + + // Iterate both chunks in parallel. + li = l; + ri = r; + + while (true) + { + // Compare the chunks. + if (li < r && ri < e) + { + // This works for a regular `sort()` compatible comparator, + // but also for a simple comparator like: `a > b` + if (comp(arr[li], arr[ri]) <= 0) + { + result[i++] = arr[li++]; + } + else + { + result[i++] = arr[ri++]; + } + } + else if (li < r) + { + // Nothing to compare, just flush what's left. + result[i++] = arr[li++]; + } + else if (ri < e) + { + result[i++] = arr[ri++]; + } + else + { + // Both iterators are at the chunk ends. + break; + } + } + } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort * @since 3.0.0 * - * @param {Phaser.Geom.Triangle} triangle - The Triangle to check. - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. * - * @return {boolean} `true` if the point is inside the Triangle, otherwise `false`. + * @return {array} The sorted result. */ -var Contains = function (triangle, x, y) +var StableSort = function (array, compare) { - var v0x = triangle.x3 - triangle.x1; - var v0y = triangle.y3 - triangle.y1; + if (compare === undefined) { compare = Compare; } - var v1x = triangle.x2 - triangle.x1; - var v1y = triangle.y2 - triangle.y1; + var result = Process(array, compare); - var v2x = x - triangle.x1; - var v2y = y - triangle.y1; + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } - var dot00 = (v0x * v0x) + (v0y * v0y); - var dot01 = (v0x * v1x) + (v0y * v1y); - var dot02 = (v0x * v2x) + (v0y * v2y); - var dot11 = (v1x * v1x) + (v1y * v1y); - var dot12 = (v1x * v2x) + (v1y * v2y); - - // Compute barycentric coordinates - var b = ((dot00 * dot11) - (dot01 * dot01)); - var inv = (b === 0) ? 0 : (1 / b); - var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; - var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; - - return (u >= 0 && v >= 0 && (u + v < 1)); + return array; }; -module.exports = Contains; +module.exports = StableSort; /***/ }), -/* 86 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17547,7 +22126,7 @@ module.exports = LineToLine; /***/ }), -/* 87 */ +/* 92 */ /***/ (function(module, exports) { /** @@ -17575,7 +22154,7 @@ module.exports = Angle; /***/ }), -/* 88 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17592,8 +22171,8 @@ var Vertices = {}; module.exports = Vertices; -var Vector = __webpack_require__(102); -var Common = __webpack_require__(44); +var Vector = __webpack_require__(114); +var Common = __webpack_require__(50); (function() { @@ -18036,7 +22615,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 89 */ +/* 94 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18045,7 +22624,7 @@ var Common = __webpack_require__(44); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -18070,7 +22649,7 @@ module.exports = FromPercent; /***/ }), -/* 90 */ +/* 95 */ /***/ (function(module, exports) { /** @@ -18111,7 +22690,7 @@ module.exports = GetBoolean; /***/ }), -/* 91 */ +/* 96 */ /***/ (function(module, exports) { /** @@ -18126,7 +22705,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.CREATED - * @type {integer} + * @type {number} * @since 3.0.0 */ CREATED: 0, @@ -18135,7 +22714,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.INIT - * @type {integer} + * @type {number} * @since 3.0.0 */ INIT: 1, @@ -18144,7 +22723,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ DELAY: 2, @@ -18153,7 +22732,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.OFFSET_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ OFFSET_DELAY: 3, @@ -18162,7 +22741,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PENDING_RENDER - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_RENDER: 4, @@ -18171,7 +22750,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_FORWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_FORWARD: 5, @@ -18180,7 +22759,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_BACKWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_BACKWARD: 6, @@ -18189,7 +22768,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.HOLD_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ HOLD_DELAY: 7, @@ -18198,7 +22777,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.REPEAT_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ REPEAT_DELAY: 8, @@ -18207,7 +22786,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE: 9, @@ -18218,7 +22797,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_ADD - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_ADD: 20, @@ -18227,7 +22806,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PAUSED - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSED: 21, @@ -18236,7 +22815,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.LOOP_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ LOOP_DELAY: 22, @@ -18245,7 +22824,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.ACTIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ ACTIVE: 23, @@ -18254,7 +22833,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.COMPLETE_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE_DELAY: 24, @@ -18263,7 +22842,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_REMOVE - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_REMOVE: 25, @@ -18272,7 +22851,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.REMOVED - * @type {integer} + * @type {number} * @since 3.0.0 */ REMOVED: 26 @@ -18283,7 +22862,714 @@ module.exports = TWEEN_CONST; /***/ }), -/* 92 */ +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(307); + +/** + * @callback DataEachCallback + * + * @param {*} parent - The parent object of the DataManager. + * @param {string} key - The key of the value. + * @param {*} value - The value. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + */ + +/** + * @classdesc + * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. + * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, + * or have a property called `events` that is an instance of it. + * + * @class DataManager + * @memberof Phaser.Data + * @constructor + * @since 3.0.0 + * + * @param {object} parent - The object that this DataManager belongs to. + * @param {Phaser.Events.EventEmitter} [eventEmitter] - The DataManager's event emitter. + */ +var DataManager = new Class({ + + initialize: + + function DataManager (parent, eventEmitter) + { + /** + * The object that this DataManager belongs to. + * + * @name Phaser.Data.DataManager#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The DataManager's event emitter. + * + * @name Phaser.Data.DataManager#events + * @type {Phaser.Events.EventEmitter} + * @since 3.0.0 + */ + this.events = eventEmitter; + + if (!eventEmitter) + { + this.events = (parent.events) ? parent.events : parent; + } + + /** + * The data list. + * + * @name Phaser.Data.DataManager#list + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.list = {}; + + /** + * The public values list. You can use this to access anything you have stored + * in this Data Manager. For example, if you set a value called `gold` you can + * access it via: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also modify it directly: + * + * ```javascript + * this.data.values.gold += 1000; + * ``` + * + * Doing so will emit a `setdata` event from the parent of this Data Manager. + * + * Do not modify this object directly. Adding properties directly to this object will not + * emit any events. Always use `DataManager.set` to create new items the first time around. + * + * @name Phaser.Data.DataManager#values + * @type {Object.} + * @default {} + * @since 3.10.0 + */ + this.values = {}; + + /** + * Whether setting data is frozen for this DataManager. + * + * @name Phaser.Data.DataManager#_frozen + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._frozen = false; + + if (!parent.hasOwnProperty('sys') && this.events) + { + this.events.once(Events.DESTROY, this.destroy, this); + } + }, + + /** + * Retrieves the value for the given key, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * this.data.get('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * this.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * this.data.get([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.Data.DataManager#get + * @since 3.0.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + get: function (key) + { + var list = this.list; + + if (Array.isArray(key)) + { + var output = []; + + for (var i = 0; i < key.length; i++) + { + output.push(list[key[i]]); + } + + return output; + } + else + { + return list[key]; + } + }, + + /** + * Retrieves all data values in a new object. + * + * @method Phaser.Data.DataManager#getAll + * @since 3.0.0 + * + * @return {Object.} All data values. + */ + getAll: function () + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Queries the DataManager for the values of keys matching the given regular expression. + * + * @method Phaser.Data.DataManager#query + * @since 3.0.0 + * + * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). + * + * @return {Object.} The values of the keys matching the search string. + */ + query: function (search) + { + var results = {}; + + for (var key in this.list) + { + if (this.list.hasOwnProperty(key) && key.match(search)) + { + results[key] = this.list[key]; + } + } + + return results; + }, + + /** + * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * data.set('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `get`: + * + * ```javascript + * data.get('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.Data.DataManager#set + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. + * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This DataManager object. + */ + set: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (typeof key === 'string') + { + return this.setValue(key, data); + } + else + { + for (var entry in key) + { + this.setValue(entry, key[entry]); + } + } + + return this; + }, + + /** + * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * When the value is first set, a `setdata` event is emitted. + * + * @method Phaser.Data.DataManager#inc + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.23.0 + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + inc: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (data === undefined) + { + data = 1; + } + + var value = this.get(key); + if (value === undefined) + { + value = 0; + } + + this.set(key, (value + data)); + + return this; + }, + + /** + * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * When the value is first set, a `setdata` event is emitted. + * + * @method Phaser.Data.DataManager#toggle + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.23.0 + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {Phaser.Data.DataManager} This DataManager object. + */ + toggle: function (key) + { + if (this._frozen) + { + return this; + } + + this.set(key, !this.get(key)); + + return this; + }, + + /** + * Internal value setter, called automatically by the `set` method. + * + * @method Phaser.Data.DataManager#setValue + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @private + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * @param {*} data - The value to set. + * + * @return {this} This DataManager object. + */ + setValue: function (key, data) + { + if (this._frozen) + { + return this; + } + + if (this.has(key)) + { + // Hit the key getter, which will in turn emit the events. + this.values[key] = data; + } + else + { + var _this = this; + var list = this.list; + var events = this.events; + var parent = this.parent; + + Object.defineProperty(this.values, key, { + + enumerable: true, + + configurable: true, + + get: function () + { + return list[key]; + }, + + set: function (value) + { + if (!_this._frozen) + { + var previousValue = list[key]; + list[key] = value; + + events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); + events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); + } + } + + }); + + list[key] = data; + + events.emit(Events.SET_DATA, parent, key, data); + } + + return this; + }, + + /** + * Passes all data entries to the given callback. + * + * @method Phaser.Data.DataManager#each + * @since 3.0.0 + * + * @param {DataEachCallback} callback - The function to call. + * @param {*} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. + * + * @return {this} This DataManager object. + */ + each: function (callback, context) + { + var args = [ this.parent, null, undefined ]; + + for (var i = 1; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (var key in this.list) + { + args[1] = key; + args[2] = this.list[key]; + + callback.apply(context, args); + } + + return this; + }, + + /** + * Merge the given object of key value pairs into this DataManager. + * + * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) + * will emit a `changedata` event. + * + * @method Phaser.Data.DataManager#merge + * @fires Phaser.Data.Events#SET_DATA + * @fires Phaser.Data.Events#CHANGE_DATA + * @fires Phaser.Data.Events#CHANGE_DATA_KEY + * @since 3.0.0 + * + * @param {Object.} data - The data to merge. + * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. + * + * @return {this} This DataManager object. + */ + merge: function (data, overwrite) + { + if (overwrite === undefined) { overwrite = true; } + + // Merge data from another component into this one + for (var key in data) + { + if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) + { + this.setValue(key, data[key]); + } + } + + return this; + }, + + /** + * Remove the value for the given key. + * + * If the key is found in this Data Manager it is removed from the internal lists and a + * `removedata` event is emitted. + * + * You can also pass in an array of keys, in which case all keys in the array will be removed: + * + * ```javascript + * this.data.remove([ 'gold', 'armor', 'health' ]); + * ``` + * + * @method Phaser.Data.DataManager#remove + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {(string|string[])} key - The key to remove, or an array of keys to remove. + * + * @return {this} This DataManager object. + */ + remove: function (key) + { + if (this._frozen) + { + return this; + } + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + this.removeValue(key[i]); + } + } + else + { + return this.removeValue(key); + } + + return this; + }, + + /** + * Internal value remover, called automatically by the `remove` method. + * + * @method Phaser.Data.DataManager#removeValue + * @private + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.10.0 + * + * @param {string} key - The key to set the value for. + * + * @return {this} This DataManager object. + */ + removeValue: function (key) + { + if (this.has(key)) + { + var data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return this; + }, + + /** + * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. + * + * @method Phaser.Data.DataManager#pop + * @fires Phaser.Data.Events#REMOVE_DATA + * @since 3.0.0 + * + * @param {string} key - The key of the value to retrieve and delete. + * + * @return {*} The value of the given key. + */ + pop: function (key) + { + var data = undefined; + + if (!this._frozen && this.has(key)) + { + data = this.list[key]; + + delete this.list[key]; + delete this.values[key]; + + this.events.emit(Events.REMOVE_DATA, this.parent, key, data); + } + + return data; + }, + + /** + * Determines whether the given key is set in this Data Manager. + * + * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.Data.DataManager#has + * @since 3.0.0 + * + * @param {string} key - The key to check. + * + * @return {boolean} Returns `true` if the key exists, otherwise `false`. + */ + has: function (key) + { + return this.list.hasOwnProperty(key); + }, + + /** + * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts + * to create new values or update existing ones. + * + * @method Phaser.Data.DataManager#setFreeze + * @since 3.0.0 + * + * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. + * + * @return {this} This DataManager object. + */ + setFreeze: function (value) + { + this._frozen = value; + + return this; + }, + + /** + * Delete all data in this Data Manager and unfreeze it. + * + * @method Phaser.Data.DataManager#reset + * @since 3.0.0 + * + * @return {this} This DataManager object. + */ + reset: function () + { + for (var key in this.list) + { + delete this.list[key]; + delete this.values[key]; + } + + this._frozen = false; + + return this; + }, + + /** + * Destroy this data manager. + * + * @method Phaser.Data.DataManager#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.reset(); + + this.events.off(Events.CHANGE_DATA); + this.events.off(Events.SET_DATA); + this.events.off(Events.REMOVE_DATA); + + this.parent = null; + }, + + /** + * Gets or sets the frozen state of this Data Manager. + * A frozen Data Manager will block all attempts to create new values or update existing ones. + * + * @name Phaser.Data.DataManager#freeze + * @type {boolean} + * @since 3.0.0 + */ + freeze: { + + get: function () + { + return this._frozen; + }, + + set: function (value) + { + this._frozen = (value) ? true : false; + } + + }, + + /** + * Return the total number of entries in this Data Manager. + * + * @name Phaser.Data.DataManager#count + * @type {number} + * @since 3.0.0 + */ + count: { + + get: function () + { + var i = 0; + + for (var key in this.list) + { + if (this.list[key] !== undefined) + { + i++; + } + } + + return i; + } + + } + +}); + +module.exports = DataManager; + + +/***/ }), +/* 98 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18306,7 +23592,7 @@ var Class = __webpack_require__(0); /** * @classdesc * The keys of a Map can be arbitrary values. - * + * * ```javascript * var map = new Map([ * [ 1, 'one' ], @@ -18560,7 +23846,9 @@ var Map = new Class({ }, /** - * Passes all entries in this Map to the given callback. + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. * * @method Phaser.Structs.Map#each * @since 3.0.0 @@ -18656,7 +23944,7 @@ module.exports = Map; /***/ }), -/* 93 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -18667,12 +23955,12 @@ module.exports = Map; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DegToRad = __webpack_require__(41); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(42); +var DegToRad = __webpack_require__(34); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(35); var Rectangle = __webpack_require__(9); -var TransformMatrix = __webpack_require__(31); -var ValueToColor = __webpack_require__(174); +var TransformMatrix = __webpack_require__(24); +var ValueToColor = __webpack_require__(179); var Vector2 = __webpack_require__(3); /** @@ -18695,10 +23983,10 @@ var Vector2 = __webpack_require__(3); * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, * allowing you to filter Game Objects out on a per-Camera basis. - * + * * The Base Camera is extended by the Camera class, which adds in special effects including Fade, * Flash and Camera Shake, as well as the ability to follow Game Objects. - * + * * The Base Camera was introduced in Phaser 3.12. It was split off from the Camera class, to allow * you to isolate special effects as needed. Therefore the 'since' values for properties of this class relate * to when they were added to the Camera class. @@ -18707,7 +23995,7 @@ var Vector2 = __webpack_require__(3); * @memberof Phaser.Cameras.Scene2D * @constructor * @since 3.12.0 - * + * * @extends Phaser.Events.EventEmitter * @extends Phaser.GameObjects.Components.Alpha * @extends Phaser.GameObjects.Components.Visible @@ -18778,7 +24066,7 @@ var BaseCamera = new Class({ * This value is a bitmask. * * @name Phaser.Cameras.Scene2D.BaseCamera#id - * @type {integer} + * @type {number} * @readonly * @since 3.11.0 */ @@ -18794,19 +24082,6 @@ var BaseCamera = new Class({ */ this.name = ''; - /** - * This property is un-used in v3.16. - * - * The resolution of the Game, used in most Camera calculations. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#resolution - * @type {number} - * @readonly - * @deprecated - * @since 3.12.0 - */ - this.resolution = 1; - /** * Should this camera round its pixel values to integers? * @@ -18856,9 +24131,9 @@ var BaseCamera = new Class({ /** * Is this Camera dirty? - * + * * A dirty Camera has had either its viewport size, bounds, scroll, rotation or zoom levels changed since the last frame. - * + * * This flag is cleared during the `postRenderCamera` method of the renderer. * * @name Phaser.Cameras.Scene2D.BaseCamera#dirty @@ -18892,46 +24167,6 @@ var BaseCamera = new Class({ */ this._y = y; - /** - * Internal Camera X value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_cx - * @type {number} - * @private - * @since 3.12.0 - */ - this._cx = 0; - - /** - * Internal Camera Y value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_cy - * @type {number} - * @private - * @since 3.12.0 - */ - this._cy = 0; - - /** - * Internal Camera Width value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_cw - * @type {number} - * @private - * @since 3.12.0 - */ - this._cw = 0; - - /** - * Internal Camera Height value multiplied by the resolution. - * - * @name Phaser.Cameras.Scene2D.BaseCamera#_ch - * @type {number} - * @private - * @since 3.12.0 - */ - this._ch = 0; - /** * The width of the Camera viewport, in pixels. * @@ -19005,7 +24240,7 @@ var BaseCamera = new Class({ this._scrollY = 0; /** - * The Camera zoom value. Change this value to zoom in, or out of, a Scene. + * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel @@ -19015,13 +24250,32 @@ var BaseCamera = new Class({ * * Be careful to never set this value to zero. * - * @name Phaser.Cameras.Scene2D.BaseCamera#_zoom + * @name Phaser.Cameras.Scene2D.BaseCamera#_zoomX * @type {number} * @private * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ - this._zoom = 1; + this._zoomX = 1; + + /** + * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_zoomY + * @type {number} + * @private + * @default 1 + * @since 3.50.0 + */ + this._zoomY = 1; /** * The rotation of the Camera in radians. @@ -19174,7 +24428,7 @@ var BaseCamera = new Class({ /** * The Camera that this Camera uses for translation during masking. - * + * * If the mask is fixed in position this will be a reference to * the CameraManager.default instance. Otherwise, it'll be a reference * to itself. @@ -19507,19 +24761,18 @@ var BaseCamera = new Class({ var c = Math.cos(this.rotation); var s = Math.sin(this.rotation); - var zoom = this.zoom; - var res = this.resolution; + var zoomX = this.zoomX; + var zoomY = this.zoomY; var scrollX = this.scrollX; var scrollY = this.scrollY; - // Works for zoom of 1 with any resolution, but resolution > 1 and zoom !== 1 breaks - var sx = x + ((scrollX * c - scrollY * s) * zoom); - var sy = y + ((scrollX * s + scrollY * c) * zoom); + var sx = x + ((scrollX * c - scrollY * s) * zoomX); + var sy = y + ((scrollX * s + scrollY * c) * zoomY); // Apply transform to point - output.x = (sx * ima + sy * imc) * res + ime; - output.y = (sx * imb + sy * imd) * res + imf; + output.x = (sx * ima + sy * imc) + ime; + output.y = (sx * imb + sy * imd) + imf; return output; }, @@ -19571,10 +24824,8 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#preRender * @protected * @since 3.0.0 - * - * @param {number} resolution - The game resolution, as set in the Scale Manager. */ - preRender: function (resolution) + preRender: function () { var width = this.width; var height = this.height; @@ -19582,7 +24833,8 @@ var BaseCamera = new Class({ var halfWidth = width * 0.5; var halfHeight = height * 0.5; - var zoom = this.zoom * resolution; + var zoomX = this.zoomX; + var zoomY = this.zoomY; var matrix = this.matrix; var originX = width * this.originX; @@ -19614,8 +24866,8 @@ var BaseCamera = new Class({ // Basically the pixel value of what it's looking at in the middle of the cam this.midPoint.set(midX, midY); - var displayWidth = width / zoom; - var displayHeight = height / zoom; + var displayWidth = width / zoomX; + var displayHeight = height / zoomY; this.worldView.setTo( midX - (displayWidth / 2), @@ -19624,7 +24876,7 @@ var BaseCamera = new Class({ displayHeight ); - matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); + matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoomX, zoomY); matrix.translate(-originX, -originY); }, @@ -19765,15 +25017,15 @@ var BaseCamera = new Class({ /** * Set the bounds of the Camera. The bounds are an axis-aligned rectangle. - * + * * The Camera bounds controls where the Camera can scroll to, stopping it from scrolling off the * edges and into blank space. It does not limit the placement of Game Objects, or where * the Camera viewport can be positioned. - * + * * Temporarily disable the bounds by changing the boolean `Camera.useBounds`. - * + * * Clear the bounds entirely by calling `Camera.removeBounds`. - * + * * If you set bounds that are smaller than the viewport it will stop the Camera from being * able to scroll. The bounds can be positioned where-ever you wish. By default they are from * 0x0 to the canvas width x height. This means that the coordinate 0x0 is the top left of @@ -19785,10 +25037,10 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#setBounds * @since 3.0.0 * - * @param {integer} x - The top-left x coordinate of the bounds. - * @param {integer} y - The top-left y coordinate of the bounds. - * @param {integer} width - The width of the bounds, in pixels. - * @param {integer} height - The height of the bounds, in pixels. + * @param {number} x - The top-left x coordinate of the bounds. + * @param {number} y - The top-left y coordinate of the bounds. + * @param {number} width - The width of the bounds, in pixels. + * @param {number} height - The height of the bounds, in pixels. * @param {boolean} [centerOn=false] - If `true` the Camera will automatically be centered on the new bounds. * * @return {this} This Camera instance. @@ -19817,9 +25069,9 @@ var BaseCamera = new Class({ /** * Returns a rectangle containing the bounds of the Camera. - * + * * If the Camera does not have any bounds the rectangle will be empty. - * + * * The rectangle is a copy of the bounds, so is safe to modify. * * @method Phaser.Cameras.Scene2D.BaseCamera#getBounds @@ -19906,7 +25158,7 @@ var BaseCamera = new Class({ /** * Should the Camera round pixel values to whole integers when rendering Game Objects? - * + * * In some types of game, especially with pixel art, this is required to prevent sub-pixel aliasing. * * @method Phaser.Cameras.Scene2D.BaseCamera#setRoundPixels @@ -19925,8 +25177,6 @@ var BaseCamera = new Class({ /** * Sets the Scene the Camera is bound to. - * - * Also populates the `resolution` property and updates the internal size values. * * @method Phaser.Cameras.Scene2D.BaseCamera#setScene * @since 3.0.0 @@ -19950,15 +25200,6 @@ var BaseCamera = new Class({ this.scaleManager = sys.scale; this.cameraManager = sys.cameras; - var res = this.scaleManager.resolution; - - this.resolution = res; - - this._cx = this._x * res; - this._cy = this._y * res; - this._cw = this._width * res; - this._ch = this._height * res; - this.updateSystem(); return this; @@ -19999,8 +25240,8 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#setSize * @since 3.0.0 * - * @param {integer} width - The width of the Camera viewport. - * @param {integer} [height=width] - The height of the Camera viewport. + * @param {number} width - The width of the Camera viewport. + * @param {number} [height=width] - The height of the Camera viewport. * * @return {this} This Camera instance. */ @@ -20030,8 +25271,8 @@ var BaseCamera = new Class({ * * @param {number} x - The top-left x coordinate of the Camera viewport. * @param {number} y - The top-left y coordinate of the Camera viewport. - * @param {integer} width - The width of the Camera viewport. - * @param {integer} [height=width] - The height of the Camera viewport. + * @param {number} width - The width of the Camera viewport. + * @param {number} [height=width] - The height of the Camera viewport. * * @return {this} This Camera instance. */ @@ -20055,23 +25296,33 @@ var BaseCamera = new Class({ * * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. * + * As of Phaser 3.50 you can now set the horizontal and vertical zoom values independently. + * * @method Phaser.Cameras.Scene2D.BaseCamera#setZoom * @since 3.0.0 * - * @param {number} [value=1] - The zoom value of the Camera. The minimum it can be is 0.001. + * @param {number} [x=1] - The horizontal zoom value of the Camera. The minimum it can be is 0.001. + * @param {number} [y=x] - The vertical zoom value of the Camera. The minimum it can be is 0.001. * * @return {this} This Camera instance. */ - setZoom: function (value) + setZoom: function (x, y) { - if (value === undefined) { value = 1; } + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } - if (value === 0) + if (x === 0) { - value = 0.001; + x = 0.001; } - this.zoom = value; + if (y === 0) + { + y = 0.001; + } + + this.zoomX = x; + this.zoomY = y; return this; }, @@ -20080,14 +25331,14 @@ var BaseCamera = new Class({ * Sets the mask to be applied to this Camera during rendering. * * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. - * + * * Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Camera it will be immediately replaced. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. - * + * * Note: You cannot mask a Camera that has `renderToTexture` set. * * @method Phaser.Cameras.Scene2D.BaseCamera#setMask @@ -20190,7 +25441,7 @@ var BaseCamera = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function () @@ -20234,9 +25485,9 @@ var BaseCamera = new Class({ /** * Destroys this Camera instance and its internal properties and references. * Once destroyed you cannot use this Camera again, even if re-added to a Camera Manager. - * + * * This method is called automatically by `CameraManager.remove` if that methods `runDestroy` argument is `true`, which is the default. - * + * * Unless you have a specific reason otherwise, always use `CameraManager.remove` and allow it to handle the camera destruction, * rather than calling this method directly. * @@ -20287,7 +25538,6 @@ var BaseCamera = new Class({ set: function (value) { this._x = value; - this._cx = value * this.resolution; this.updateSystem(); } @@ -20312,7 +25562,6 @@ var BaseCamera = new Class({ set: function (value) { this._y = value; - this._cy = value * this.resolution; this.updateSystem(); } @@ -20338,7 +25587,6 @@ var BaseCamera = new Class({ set: function (value) { this._width = value; - this._cw = value * this.resolution; this.updateSystem(); } @@ -20364,7 +25612,6 @@ var BaseCamera = new Class({ set: function (value) { this._height = value; - this._ch = value * this.resolution; this.updateSystem(); } @@ -20450,12 +25697,76 @@ var BaseCamera = new Class({ get: function () { - return this._zoom; + return (this._zoomX + this._zoomY) / 2; }, set: function (value) { - this._zoom = value; + this._zoomX = value; + this._zoomY = value; + + this.dirty = true; + } + + }, + + /** + * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#zoomX + * @type {number} + * @default 1 + * @since 3.50.0 + */ + zoomX: { + + get: function () + { + return this._zoomX; + }, + + set: function (value) + { + this._zoomX = value; + this.dirty = true; + } + + }, + + /** + * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#zoomY + * @type {number} + * @default 1 + * @since 3.50.0 + */ + zoomY: { + + get: function () + { + return this._zoomY; + }, + + set: function (value) + { + this._zoomY = value; this.dirty = true; } @@ -20543,7 +25854,7 @@ var BaseCamera = new Class({ get: function () { - return this.width / this.zoom; + return this.width / this.zoomX; } }, @@ -20566,7 +25877,7 @@ var BaseCamera = new Class({ get: function () { - return this.height / this.zoom; + return this.height / this.zoomY; } } @@ -20577,7 +25888,37 @@ module.exports = BaseCamera; /***/ }), -/* 94 */ +/* 100 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Given 3 separate color values this will return an integer representation of it. + * + * @function Phaser.Display.Color.GetColor + * @since 3.0.0 + * + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * + * @return {number} The combined color value. + */ +var GetColor = function (red, green, blue) +{ + return red << 16 | green << 8 | blue; +}; + +module.exports = GetColor; + + +/***/ }), +/* 101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20592,18 +25933,203 @@ module.exports = BaseCamera; module.exports = { - ENTER_FULLSCREEN: __webpack_require__(727), - FULLSCREEN_FAILED: __webpack_require__(728), - FULLSCREEN_UNSUPPORTED: __webpack_require__(729), - LEAVE_FULLSCREEN: __webpack_require__(730), - ORIENTATION_CHANGE: __webpack_require__(731), - RESIZE: __webpack_require__(732) + ENTER_FULLSCREEN: __webpack_require__(768), + FULLSCREEN_FAILED: __webpack_require__(769), + FULLSCREEN_UNSUPPORTED: __webpack_require__(770), + LEAVE_FULLSCREEN: __webpack_require__(771), + ORIENTATION_CHANGE: __webpack_require__(772), + RESIZE: __webpack_require__(773) }; /***/ }), -/* 95 */ +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(process) {/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Determines the operating system of the device running this Phaser Game instance. + * These values are read-only and populated during the boot sequence of the game. + * They are then referenced by internal game systems and are available for you to access + * via `this.sys.game.device.os` from within any Scene. + * + * @typedef {object} Phaser.Device.OS + * @since 3.0.0 + * + * @property {boolean} android - Is running on android? + * @property {boolean} chromeOS - Is running on chromeOS? + * @property {boolean} cordova - Is the game running under Apache Cordova? + * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? + * @property {boolean} desktop - Is running on a desktop? + * @property {boolean} ejecta - Is the game running under Ejecta? + * @property {boolean} electron - Is the game running under GitHub Electron? + * @property {boolean} iOS - Is running on iOS? + * @property {boolean} iPad - Is running on iPad? + * @property {boolean} iPhone - Is running on iPhone? + * @property {boolean} kindle - Is running on an Amazon Kindle? + * @property {boolean} linux - Is running on linux? + * @property {boolean} macOS - Is running on macOS? + * @property {boolean} node - Is the game running under Node.js? + * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? + * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView + * @property {boolean} windows - Is running on windows? + * @property {boolean} windowsPhone - Is running on a Windows Phone? + * @property {number} iOSVersion - If running in iOS this will contain the major version number. + * @property {number} pixelRatio - PixelRatio of the host device? + */ +var OS = { + + android: false, + chromeOS: false, + cordova: false, + crosswalk: false, + desktop: false, + ejecta: false, + electron: false, + iOS: false, + iOSVersion: 0, + iPad: false, + iPhone: false, + kindle: false, + linux: false, + macOS: false, + node: false, + nodeWebkit: false, + pixelRatio: 1, + webApp: false, + windows: false, + windowsPhone: false + +}; + +function init () +{ + var ua = navigator.userAgent; + + if ((/Windows/).test(ua)) + { + OS.windows = true; + } + else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) + { + // Because iOS 13 identifies as Mac OS: + if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) + { + OS.iOS = true; + OS.iPad = true; + + (navigator.appVersion).match(/Version\/(\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + } + else + { + OS.macOS = true; + } + } + else if ((/Android/).test(ua)) + { + OS.android = true; + } + else if ((/Linux/).test(ua)) + { + OS.linux = true; + } + else if ((/iP[ao]d|iPhone/i).test(ua)) + { + OS.iOS = true; + + (navigator.appVersion).match(/OS (\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + + OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; + OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; + } + else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) + { + OS.kindle = true; + + // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... + // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" + } + else if ((/CrOS/).test(ua)) + { + OS.chromeOS = true; + } + + if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) + { + OS.android = false; + OS.iOS = false; + OS.macOS = false; + OS.windows = true; + OS.windowsPhone = true; + } + + var silk = (/Silk/).test(ua); + + if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) + { + OS.desktop = true; + } + + // Windows Phone / Table reset + if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) + { + OS.desktop = false; + } + + // WebApp mode in iOS + if (navigator.standalone) + { + OS.webApp = true; + } + + if (window.cordova !== undefined) + { + OS.cordova = true; + } + + if (typeof process !== 'undefined' && process.versions && process.versions.node) + { + OS.node = true; + } + + if (OS.node && typeof process.versions === 'object') + { + OS.nodeWebkit = !!process.versions['node-webkit']; + + OS.electron = !!process.versions.electron; + } + + if (window.ejecta !== undefined) + { + OS.ejecta = true; + } + + if ((/Crosswalk/).test(ua)) + { + OS.crosswalk = true; + } + + OS.pixelRatio = window['devicePixelRatio'] || 1; + + return OS; +} + +module.exports = init(); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(796))) + +/***/ }), +/* 103 */ /***/ (function(module, exports) { /** @@ -20613,132 +26139,43 @@ module.exports = { */ /** - * Snap a value to nearest grid slice, using floor. + * Removes a single item from an array and returns it without creating gc, like the native splice does. + * Based on code by Mike Reinstein. * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`. - * As will `14` snap to `10`... but `16` will snap to `15`. - * - * @function Phaser.Math.Snap.Floor + * @function Phaser.Utils.Array.SpliceOne * @since 3.0.0 * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * @param {array} array - The array to splice from. + * @param {number} index - The index of the item which should be spliced. * - * @return {number} The snapped value. + * @return {*} The item which was spliced (removed). */ -var SnapFloor = function (value, gap, start, divide) +var SpliceOne = function (array, index) { - if (start === undefined) { start = 0; } - - if (gap === 0) + if (index >= array.length) { - return value; + return; } - value -= start; - value = gap * Math.floor(value / gap); + var len = array.length - 1; - return (divide) ? (start + value) / gap : start + value; -}; + var item = array[index]; -module.exports = SnapFloor; - - -/***/ }), -/* 96 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SpliceOne = __webpack_require__(82); - -/** - * Removes the given item, or array of items, from the array. - * - * The array is modified in-place. - * - * You can optionally specify a callback to be invoked for each item successfully removed from the array. - * - * @function Phaser.Utils.Array.Remove - * @since 3.4.0 - * - * @param {array} array - The array to be modified. - * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array. - * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array. - * @param {object} [context] - The context in which the callback is invoked. - * - * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array. - */ -var Remove = function (array, item, callback, context) -{ - if (context === undefined) { context = array; } - - var index; - - // Fast path to avoid array mutation and iteration - if (!Array.isArray(item)) + for (var i = index; i < len; i++) { - index = array.indexOf(item); - - if (index !== -1) - { - SpliceOne(array, index); - - if (callback) - { - callback.call(context, item); - } - - return item; - } - else - { - return null; - } + array[i] = array[i + 1]; } - // If we got this far, we have an array of items to remove - - var itemLength = item.length - 1; - - while (itemLength >= 0) - { - var entry = item[itemLength]; - - index = array.indexOf(entry); - - if (index !== -1) - { - SpliceOne(array, index); - - if (callback) - { - callback.call(context, entry); - } - } - else - { - // Item wasn't found in the array, so remove it from our return results - item.pop(); - } - - itemLength--; - } + array.length = len; return item; }; -module.exports = Remove; +module.exports = SpliceOne; /***/ }), -/* 97 */ +/* 104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20748,8 +26185,8 @@ module.exports = Remove; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); -var Extend = __webpack_require__(19); +var Clamp = __webpack_require__(16); +var Extend = __webpack_require__(18); /** * @classdesc @@ -20761,8 +26198,8 @@ var Extend = __webpack_require__(19); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. * @param {number} width - The width of this Frame. @@ -20806,7 +26243,7 @@ var Frame = new Class({ * The index of the TextureSource in the Texture sources array. * * @name Phaser.Textures.Frame#sourceIndex - * @type {integer} + * @type {number} * @since 3.0.0 */ this.sourceIndex = sourceIndex; @@ -20825,7 +26262,7 @@ var Frame = new Class({ * X position within the source image to cut from. * * @name Phaser.Textures.Frame#cutX - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutX; @@ -20834,7 +26271,7 @@ var Frame = new Class({ * Y position within the source image to cut from. * * @name Phaser.Textures.Frame#cutY - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutY; @@ -20843,7 +26280,7 @@ var Frame = new Class({ * The width of the area in the source image to cut. * * @name Phaser.Textures.Frame#cutWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutWidth; @@ -20852,7 +26289,7 @@ var Frame = new Class({ * The height of the area in the source image to cut. * * @name Phaser.Textures.Frame#cutHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutHeight; @@ -20861,7 +26298,7 @@ var Frame = new Class({ * The X rendering offset of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#x - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -20871,7 +26308,7 @@ var Frame = new Class({ * The Y rendering offset of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#y - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -20881,7 +26318,7 @@ var Frame = new Class({ * The rendering width of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width; @@ -20890,7 +26327,7 @@ var Frame = new Class({ * The rendering height of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height; @@ -20900,7 +26337,7 @@ var Frame = new Class({ * Precalculated for the renderer. * * @name Phaser.Textures.Frame#halfWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.halfWidth; @@ -20910,7 +26347,7 @@ var Frame = new Class({ * Precalculated for the renderer. * * @name Phaser.Textures.Frame#halfHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.halfHeight; @@ -20919,7 +26356,7 @@ var Frame = new Class({ * The x center of this frame, floored. * * @name Phaser.Textures.Frame#centerX - * @type {integer} + * @type {number} * @since 3.0.0 */ this.centerX; @@ -20928,7 +26365,7 @@ var Frame = new Class({ * The y center of this frame, floored. * * @name Phaser.Textures.Frame#centerY - * @type {integer} + * @type {number} * @since 3.0.0 */ this.centerY; @@ -20984,7 +26421,7 @@ var Frame = new Class({ * 1 = Round * * @name Phaser.Textures.Frame#autoRound - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -21090,10 +26527,10 @@ var Frame = new Class({ * @method Phaser.Textures.Frame#setSize * @since 3.7.0 * - * @param {integer} width - The width of the frame before being trimmed. - * @param {integer} height - The height of the frame before being trimmed. - * @param {integer} [x=0] - The x coordinate of the top-left of this Frame. - * @param {integer} [y=0] - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of the frame before being trimmed. + * @param {number} height - The height of the frame before being trimmed. + * @param {number} [x=0] - The x coordinate of the top-left of this Frame. + * @param {number} [y=0] - The y coordinate of the top-left of this Frame. * * @return {Phaser.Textures.Frame} This Frame object. */ @@ -21595,7 +27032,823 @@ module.exports = Frame; /***/ }), -/* 98 */ +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var ArrayUtils = __webpack_require__(199); +var Class = __webpack_require__(0); +var NOOP = __webpack_require__(1); +var StableSort = __webpack_require__(90); + +/** + * @callback EachListCallback + * + * @param {I} item - The item which is currently being processed. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + +/** + * @classdesc + * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. + * + * @class List + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + * + * @generic T + * + * @param {*} parent - The parent of this list. + */ +var List = new Class({ + + initialize: + + function List (parent) + { + /** + * The parent of this list. + * + * @name Phaser.Structs.List#parent + * @type {*} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * The objects that belong to this collection. + * + * @genericUse {T[]} - [$type] + * + * @name Phaser.Structs.List#list + * @type {Array.<*>} + * @default [] + * @since 3.0.0 + */ + this.list = []; + + /** + * The index of the current element. + * + * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. + * + * @name Phaser.Structs.List#position + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.position = 0; + + /** + * A callback that is invoked every time a child is added to this list. + * + * @name Phaser.Structs.List#addCallback + * @type {function} + * @since 3.4.0 + */ + this.addCallback = NOOP; + + /** + * A callback that is invoked every time a child is removed from this list. + * + * @name Phaser.Structs.List#removeCallback + * @type {function} + * @since 3.4.0 + */ + this.removeCallback = NOOP; + + /** + * The property key to sort by. + * + * @name Phaser.Structs.List#_sortKey + * @type {string} + * @since 3.4.0 + */ + this._sortKey = ''; + }, + + /** + * Adds the given item to the end of the list. Each item must be unique. + * + * @method Phaser.Structs.List#add + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*|Array.<*>} child - The item, or array of items, to add to the list. + * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. + * + * @return {*} The list's underlying array. + */ + add: function (child, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.Add(this.list, child); + } + else + { + return ArrayUtils.Add(this.list, child, 0, this.addCallback, this); + } + }, + + /** + * Adds an item to list, starting at a specified index. Each item must be unique within the list. + * + * @method Phaser.Structs.List#addAt + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item, or array of items, to add to the list. + * @param {number} [index=0] - The index in the list at which the element(s) will be inserted. + * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. + * + * @return {*} The List's underlying array. + */ + addAt: function (child, index, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.AddAt(this.list, child, index); + } + else + { + return ArrayUtils.AddAt(this.list, child, index, 0, this.addCallback, this); + } + }, + + /** + * Retrieves the item at a given position inside the List. + * + * @method Phaser.Structs.List#getAt + * @since 3.0.0 + * + * @genericUse {T} - [$return] + * + * @param {number} index - The index of the item. + * + * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. + */ + getAt: function (index) + { + return this.list[index]; + }, + + /** + * Locates an item within the List and returns its index. + * + * @method Phaser.Structs.List#getIndex + * @since 3.0.0 + * + * @genericUse {T} - [child] + * + * @param {*} child - The item to locate. + * + * @return {number} The index of the item within the List, or -1 if it's not in the List. + */ + getIndex: function (child) + { + // Return -1 if given child isn't a child of this display list + return this.list.indexOf(child); + }, + + /** + * Sort the contents of this List so the items are in order based on the given property. + * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property. + * + * @method Phaser.Structs.List#sort + * @since 3.0.0 + * + * @genericUse {T[]} - [children,$return] + * + * @param {string} property - The property to lexically sort by. + * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. + * + * @return {Phaser.Structs.List} This List object. + */ + sort: function (property, handler) + { + if (!property) + { + return this; + } + + if (handler === undefined) + { + handler = function (childA, childB) + { + return childA[property] - childB[property]; + }; + } + + StableSort(this.list, handler); + + return this; + }, + + /** + * Searches for the first instance of a child with its `name` + * property matching the given argument. Should more than one child have + * the same name only the first is returned. + * + * @method Phaser.Structs.List#getByName + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {string} name - The name to search for. + * + * @return {?*} The first child with a matching name, or null if none were found. + */ + getByName: function (name) + { + return ArrayUtils.GetFirst(this.list, 'name', name); + }, + + /** + * Returns a random child from the group. + * + * @method Phaser.Structs.List#getRandom + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {number} [startIndex=0] - Offset from the front of the group (lowest child). + * @param {number} [length=(to top)] - Restriction on the number of values you want to randomly select from. + * + * @return {?*} A random child of this Group. + */ + getRandom: function (startIndex, length) + { + return ArrayUtils.GetRandom(this.list, startIndex, length); + }, + + /** + * Returns the first element in a given part of the List which matches a specific criterion. + * + * @method Phaser.Structs.List#getFirst + * @since 3.0.0 + * + * @genericUse {T | null} - [$return] + * + * @param {string} property - The name of the property to test or a falsey value to have no criterion. + * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. + * @param {number} [startIndex=0] - The position in the List to start the search at. + * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. + * + * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. + */ + getFirst: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns all children in this List. + * + * You can optionally specify a matching criteria using the `property` and `value` arguments. + * + * For example: `getAll('parent')` would return only children that have a property called `parent`. + * + * You can also specify a value to compare the property to: + * + * `getAll('visible', true)` would return only children that have their visible property set to `true`. + * + * Optionally you can specify a start and end index. For example if this List had 100 children, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50 children in the List. + * + * @method Phaser.Structs.List#getAll + * @since 3.0.0 + * + * @genericUse {T} - [value] + * @genericUse {T[]} - [$return] + * + * @param {string} [property] - An optional property to test against the value argument. + * @param {*} [value] - If property is set then Child.property must strictly equal this value to be included in the results. + * @param {number} [startIndex] - The first child index to start the search from. + * @param {number} [endIndex] - The last child index to search up until. + * + * @return {Array.<*>} All items of the List which match the given criterion, if any. + */ + getAll: function (property, value, startIndex, endIndex) + { + return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex); + }, + + /** + * Returns the total number of items in the List which have a property matching the given value. + * + * @method Phaser.Structs.List#count + * @since 3.0.0 + * + * @genericUse {T} - [value] + * + * @param {string} property - The property to test on each item. + * @param {*} value - The value to test the property against. + * + * @return {number} The total number of matching elements. + */ + count: function (property, value) + { + return ArrayUtils.CountAllMatching(this.list, property, value); + }, + + /** + * Swaps the positions of two items in the list. + * + * @method Phaser.Structs.List#swap + * @since 3.0.0 + * + * @genericUse {T} - [child1,child2] + * + * @param {*} child1 - The first item to swap. + * @param {*} child2 - The second item to swap. + */ + swap: function (child1, child2) + { + ArrayUtils.Swap(this.list, child1, child2); + }, + + /** + * Moves an item in the List to a new position. + * + * @method Phaser.Structs.List#moveTo + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move. + * @param {number} index - Moves an item in the List to a new position. + * + * @return {*} The item that was moved. + */ + moveTo: function (child, index) + { + return ArrayUtils.MoveTo(this.list, child, index); + }, + + /** + * Removes one or many items from the List. + * + * @method Phaser.Structs.List#remove + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item, or array of items, to remove. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {*} The item, or array of items, which were successfully removed from the List. + */ + remove: function (child, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.Remove(this.list, child); + } + else + { + return ArrayUtils.Remove(this.list, child, this.removeCallback, this); + } + }, + + /** + * Removes the item at the given position in the List. + * + * @method Phaser.Structs.List#removeAt + * @since 3.0.0 + * + * @genericUse {T} - [$return] + * + * @param {number} index - The position to remove the item from. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {*} The item that was removed. + */ + removeAt: function (index, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.RemoveAt(this.list, index); + } + else + { + return ArrayUtils.RemoveAt(this.list, index, this.removeCallback, this); + } + }, + + /** + * Removes the items within the given range in the List. + * + * @method Phaser.Structs.List#removeBetween + * @since 3.0.0 + * + * @genericUse {T[]} - [$return] + * + * @param {number} [startIndex=0] - The index to start removing from. + * @param {number} [endIndex] - The position to stop removing at. The item at this position won't be removed. + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {Array.<*>} An array of the items which were removed. + */ + removeBetween: function (startIndex, endIndex, skipCallback) + { + if (skipCallback) + { + return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex); + } + else + { + return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeCallback, this); + } + }, + + /** + * Removes all the items. + * + * @method Phaser.Structs.List#removeAll + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. + * + * @return {Phaser.Structs.List} This List object. + */ + removeAll: function (skipCallback) + { + var i = this.list.length; + + while (i--) + { + this.remove(this.list[i], skipCallback); + } + + return this; + }, + + /** + * Brings the given child to the top of this List. + * + * @method Phaser.Structs.List#bringToTop + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to bring to the top of the List. + * + * @return {*} The item which was moved. + */ + bringToTop: function (child) + { + return ArrayUtils.BringToTop(this.list, child); + }, + + /** + * Sends the given child to the bottom of this List. + * + * @method Phaser.Structs.List#sendToBack + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to send to the back of the list. + * + * @return {*} The item which was moved. + */ + sendToBack: function (child) + { + return ArrayUtils.SendToBack(this.list, child); + }, + + /** + * Moves the given child up one place in this group unless it's already at the top. + * + * @method Phaser.Structs.List#moveUp + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move up. + * + * @return {*} The item which was moved. + */ + moveUp: function (child) + { + ArrayUtils.MoveUp(this.list, child); + + return child; + }, + + /** + * Moves the given child down one place in this group unless it's already at the bottom. + * + * @method Phaser.Structs.List#moveDown + * @since 3.0.0 + * + * @genericUse {T} - [child,$return] + * + * @param {*} child - The item to move down. + * + * @return {*} The item which was moved. + */ + moveDown: function (child) + { + ArrayUtils.MoveDown(this.list, child); + + return child; + }, + + /** + * Reverses the order of all children in this List. + * + * @method Phaser.Structs.List#reverse + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @return {Phaser.Structs.List} This List object. + */ + reverse: function () + { + this.list.reverse(); + + return this; + }, + + /** + * Shuffles the items in the list. + * + * @method Phaser.Structs.List#shuffle + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.List.} - [$return] + * + * @return {Phaser.Structs.List} This List object. + */ + shuffle: function () + { + ArrayUtils.Shuffle(this.list); + + return this; + }, + + /** + * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List. + * + * @method Phaser.Structs.List#replace + * @since 3.0.0 + * + * @genericUse {T} - [oldChild,newChild,$return] + * + * @param {*} oldChild - The child in this List that will be replaced. + * @param {*} newChild - The child to be inserted into this List. + * + * @return {*} Returns the oldChild that was replaced within this group. + */ + replace: function (oldChild, newChild) + { + return ArrayUtils.Replace(this.list, oldChild, newChild); + }, + + /** + * Checks if an item exists within the List. + * + * @method Phaser.Structs.List#exists + * @since 3.0.0 + * + * @genericUse {T} - [child] + * + * @param {*} child - The item to check for the existence of. + * + * @return {boolean} `true` if the item is found in the list, otherwise `false`. + */ + exists: function (child) + { + return (this.list.indexOf(child) > -1); + }, + + /** + * Sets the property `key` to the given value on all members of this List. + * + * @method Phaser.Structs.List#setAll + * @since 3.0.0 + * + * @genericUse {T} - [value] + * + * @param {string} property - The name of the property to set. + * @param {*} value - The value to set the property to. + * @param {number} [startIndex] - The first child index to start the search from. + * @param {number} [endIndex] - The last child index to search up until. + */ + setAll: function (property, value, startIndex, endIndex) + { + ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex); + + return this; + }, + + /** + * Passes all children to the given callback. + * + * @method Phaser.Structs.List#each + * @since 3.0.0 + * + * @genericUse {EachListCallback.} - [callback] + * + * @param {EachListCallback} callback - The function to call. + * @param {*} [context] - Value to use as `this` when executing callback. + * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. + */ + each: function (callback, context) + { + var args = [ null ]; + + for (var i = 2; i < arguments.length; i++) + { + args.push(arguments[i]); + } + + for (i = 0; i < this.list.length; i++) + { + args[0] = this.list[i]; + + callback.apply(context, args); + } + }, + + /** + * Clears the List and recreates its internal array. + * + * @method Phaser.Structs.List#shutdown + * @since 3.0.0 + */ + shutdown: function () + { + this.removeAll(); + + this.list = []; + }, + + /** + * Destroys this List. + * + * @method Phaser.Structs.List#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.removeAll(); + + this.parent = null; + this.addCallback = null; + this.removeCallback = null; + }, + + /** + * The number of items inside the List. + * + * @name Phaser.Structs.List#length + * @type {number} + * @readonly + * @since 3.0.0 + */ + length: { + + get: function () + { + return this.list.length; + } + + }, + + /** + * The first item in the List or `null` for an empty List. + * + * @name Phaser.Structs.List#first + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + first: { + + get: function () + { + this.position = 0; + + if (this.list.length > 0) + { + return this.list[0]; + } + else + { + return null; + } + } + + }, + + /** + * The last item in the List, or `null` for an empty List. + * + * @name Phaser.Structs.List#last + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + last: { + + get: function () + { + if (this.list.length > 0) + { + this.position = this.list.length - 1; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * The next item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. + * + * @name Phaser.Structs.List#next + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + next: { + + get: function () + { + if (this.position < this.list.length) + { + this.position++; + + return this.list[this.position]; + } + else + { + return null; + } + } + + }, + + /** + * The previous item in the List, or `null` if the entire List has been traversed. + * + * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. + * + * @name Phaser.Structs.List#previous + * @genericUse {T} - [$type] + * @type {*} + * @readonly + * @since 3.0.0 + */ + previous: { + + get: function () + { + if (this.position > 0) + { + this.position--; + + return this.list[this.position]; + } + else + { + return null; + } + } + + } + +}); + +module.exports = List; + + +/***/ }), +/* 106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21605,11 +27858,11 @@ module.exports = Frame; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(99); -var GetPoint = __webpack_require__(412); -var GetPoints = __webpack_require__(413); -var GEOM_CONST = __webpack_require__(49); -var Random = __webpack_require__(167); +var Contains = __webpack_require__(107); +var GetPoint = __webpack_require__(422); +var GetPoints = __webpack_require__(423); +var GEOM_CONST = __webpack_require__(55); +var Random = __webpack_require__(172); /** * @classdesc @@ -21645,7 +27898,7 @@ var Ellipse = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Ellipse#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -21737,7 +27990,7 @@ var Ellipse = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -21977,7 +28230,7 @@ module.exports = Ellipse; /***/ }), -/* 99 */ +/* 107 */ /***/ (function(module, exports) { /** @@ -22019,7 +28272,7 @@ module.exports = Contains; /***/ }), -/* 100 */ +/* 108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22028,16 +28281,17 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Actions = __webpack_require__(252); +var Actions = __webpack_require__(267); var Class = __webpack_require__(0); -var Events = __webpack_require__(29); -var GetAll = __webpack_require__(193); +var Events = __webpack_require__(32); +var EventEmitter = __webpack_require__(10); +var GetAll = __webpack_require__(198); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); var IsPlainObject = __webpack_require__(7); -var Range = __webpack_require__(404); -var Set = __webpack_require__(141); -var Sprite = __webpack_require__(76); +var Range = __webpack_require__(414); +var Set = __webpack_require__(145); +var Sprite = __webpack_require__(70); /** * @classdesc @@ -22049,6 +28303,7 @@ var Sprite = __webpack_require__(76); * * @class Group * @memberof Phaser.GameObjects + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @param {Phaser.Scene} scene - The scene this group belongs to. @@ -22060,10 +28315,14 @@ var Sprite = __webpack_require__(76); */ var Group = new Class({ + Extends: EventEmitter, + initialize: function Group (scene, children, config) { + EventEmitter.call(this); + // They can pass in any of the following as the first argument: // 1) A single child @@ -22173,7 +28432,7 @@ var Group = new Class({ * The maximum size of this group, if used as a pool. -1 is no limit. * * @name Phaser.GameObjects.Group#maxSize - * @type {integer} + * @type {number} * @since 3.0.0 * @default -1 */ @@ -22195,7 +28454,7 @@ var Group = new Class({ * A default texture frame to use when creating new group members. * * @name Phaser.GameObjects.Group#defaultFrame - * @type {(string|integer)} + * @type {(string|number)} * @since 3.0.0 */ this.defaultFrame = GetFastValue(config, 'defaultFrame', null); @@ -22269,6 +28528,21 @@ var Group = new Class({ { this.createMultiple(config); } + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); }, /** @@ -22282,7 +28556,7 @@ var Group = new Class({ * @param {number} [x=0] - The horizontal position of the new Game Object in the world. * @param {number} [y=0] - The vertical position of the new Game Object in the world. * @param {string} [key=defaultKey] - The texture key of the new Game Object. - * @param {(string|integer)} [frame=defaultFrame] - The texture frame of the new Game Object. + * @param {(string|number)} [frame=defaultFrame] - The texture frame of the new Game Object. * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object. * @param {boolean} [active=true] - The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object. * @@ -22758,7 +29032,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getLength * @since 3.0.0 * - * @return {integer} + * @return {number} */ getLength: function () { @@ -22779,14 +29053,14 @@ var Group = new Class({ * * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {any[]} An array of matching Group members. The array will be empty if nothing matched. */ getMatching: function (property, value, startIndex, endIndex) { - return GetAll(this.children, property, value, startIndex, endIndex); + return GetAll(this.children.entries, property, value, startIndex, endIndex); }, /** @@ -22804,7 +29078,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -22824,13 +29098,13 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getFirstNth * @since 3.6.0 * - * @param {integer} nth - The nth matching Group member to search for. + * @param {number} nth - The nth matching Group member to search for. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -22855,7 +29129,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -22875,13 +29149,13 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getLastNth * @since 3.6.0 * - * @param {integer} nth - The nth matching Group member to search for. + * @param {number} nth - The nth matching Group member to search for. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -22903,13 +29177,13 @@ var Group = new Class({ * @since 3.6.0 * * @param {boolean} forwards - Search front to back or back to front? - * @param {integer} nth - Stop matching after nth successful matches. + * @param {number} nth - Stop matching after nth successful matches. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -23008,7 +29282,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first inactive group member, or a newly created member, or null. @@ -23032,7 +29306,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {any} The first active group member, or a newly created member, or null. @@ -23057,7 +29331,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {any} The first inactive group member, or a newly created member, or null. @@ -23113,7 +29387,7 @@ var Group = new Class({ * * @param {boolean} [value=true] - Count active (true) or inactive (false) group members. * - * @return {integer} The number of group members with an active state matching the `active` argument. + * @return {number} The number of group members with an active state matching the `active` argument. */ countActive: function (value) { @@ -23138,7 +29412,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getTotalUsed * @since 3.0.0 * - * @return {integer} The number of group members with an active state of true. + * @return {number} The number of group members with an active state of true. */ getTotalUsed: function () { @@ -23153,7 +29427,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getTotalFree * @since 3.0.0 * - * @return {integer} maxSize minus the number of active group numbers; or a large number (if maxSize is -1). + * @return {number} maxSize minus the number of active group numbers; or a large number (if maxSize is -1). */ getTotalFree: function () { @@ -23208,8 +29482,8 @@ var Group = new Class({ * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -23229,8 +29503,8 @@ var Group = new Class({ * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -23364,7 +29638,7 @@ var Group = new Class({ * * @param {number} x - The x coordinate to place the first item in the array at. * @param {number} y - The y coordinate to place the first item in the array at. - * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {number} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. * * @return {this} This Group object. */ @@ -23670,8 +29944,8 @@ var Group = new Class({ * @since 3.21.0 * * @param {boolean} value - The value to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -23729,7 +30003,7 @@ module.exports = Group; /***/ }), -/* 101 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23738,7 +30012,7 @@ module.exports = Group; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders a filled path for the given Shape. @@ -23756,7 +30030,7 @@ var Utils = __webpack_require__(10); */ var FillPathWebGL = function (pipeline, calcMatrix, src, alpha, dx, dy) { - var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + var fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); var path = src.pathData; var pathIndexes = src.pathIndexes; @@ -23783,9 +30057,7 @@ var FillPathWebGL = function (pipeline, calcMatrix, src, alpha, dx, dy) var tx2 = calcMatrix.getX(x2, y2); var ty2 = calcMatrix.getY(x2, y2); - pipeline.setTexture2D(); - - pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, 0, 0, 1, 1, fillTintColor, fillTintColor, fillTintColor, pipeline.tintEffect); + pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, fillTintColor, fillTintColor, fillTintColor); } }; @@ -23793,7 +30065,957 @@ module.exports = FillPathWebGL; /***/ }), -/* 102 */ +/* 110 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// http://www.blackpawn.com/texts/pointinpoly/ + +/** + * Checks if a point (as a pair of coordinates) is inside a Triangle's bounds. + * + * @function Phaser.Geom.Triangle.Contains + * @since 3.0.0 + * + * @param {Phaser.Geom.Triangle} triangle - The Triangle to check. + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is inside the Triangle, otherwise `false`. + */ +var Contains = function (triangle, x, y) +{ + var v0x = triangle.x3 - triangle.x1; + var v0y = triangle.y3 - triangle.y1; + + var v1x = triangle.x2 - triangle.x1; + var v1y = triangle.y2 - triangle.y1; + + var v2x = x - triangle.x1; + var v2y = y - triangle.y1; + + var dot00 = (v0x * v0x) + (v0y * v0y); + var dot01 = (v0x * v1x) + (v0y * v1y); + var dot02 = (v0x * v2x) + (v0y * v2y); + var dot11 = (v1x * v1x) + (v1y * v1y); + var dot12 = (v1x * v2x) + (v1y * v2y); + + // Compute barycentric coordinates + var b = ((dot00 * dot11) - (dot01 * dot01)); + var inv = (b === 0) ? 0 : (1 / b); + var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; + var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; + + return (u >= 0 && v >= 0 && (u + v < 1)); +}; + +module.exports = Contains; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Rectangle = __webpack_require__(9); +var RectangleToRectangle = __webpack_require__(112); +var Vector2 = __webpack_require__(3); + +/** + * Returns the length of the line. + * + * @ignore + * @private + * + * @param {number} x1 - The x1 coordinate. + * @param {number} y1 - The y1 coordinate. + * @param {number} x2 - The x2 coordinate. + * @param {number} y2 - The y2 coordinate. + * + * @return {number} The length of the line. + */ +function GetLength (x1, y1, x2, y2) +{ + var x = x1 - x2; + var y = y1 - y2; + var magnitude = (x * x) + (y * y); + + return Math.sqrt(magnitude); +} + +/** + * @classdesc + * A Face Geometry Object. + * + * A Face is used by the Mesh Game Object. A Mesh consists of one, or more, faces that are + * used to render the Mesh Game Objects in WebGL. + * + * A Face consists of 3 Vertex instances, for the 3 corners of the face and methods to help + * you modify and test them. + * + * @class Face + * @memberof Phaser.Geom.Mesh + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Vertex} vertex1 - The first vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex2 - The second vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex3 - The third vertex of the Face. + */ +var Face = new Class({ + + initialize: + + function Face (vertex1, vertex2, vertex3) + { + /** + * The first vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex1 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex1 = vertex1; + + /** + * The second vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex2 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex2 = vertex2; + + /** + * The third vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex3 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex3 = vertex3; + + /** + * The bounds of this Face. + * + * Be sure to call the `Face.updateBounds` method _before_ using this property. + * + * @name Phaser.Geom.Mesh.Face#bounds + * @type {Phaser.Geom.Rectangle} + * @since 3.50.0 + */ + this.bounds = new Rectangle(); + + /** + * The face inCenter. Do not access directly, instead use the `getInCenter` method. + * + * @name Phaser.Geom.Mesh.Face#_inCenter + * @type {Phaser.Math.Vector2} + * @private + * @since 3.50.0 + */ + this._inCenter = new Vector2(); + }, + + /** + * Calculates and returns the in-center position of this Face. + * + * @method Phaser.Geom.Mesh.Face#getInCenter + * @since 3.50.0 + * + * @param {boolean} [local=true] Return the in center from the un-transformed vertex positions (`true`), or transformed? (`false`) + * + * @return {Phaser.Math.Vector2} A Vector2 containing the in center position of this Face. + */ + getInCenter: function (local) + { + if (local === undefined) { local = true; } + + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var v1x; + var v1y; + + var v2x; + var v2y; + + var v3x; + var v3y; + + if (local) + { + v1x = v1.x; + v1y = v1.y; + + v2x = v2.x; + v2y = v2.y; + + v3x = v3.x; + v3y = v3.y; + } + else + { + v1x = v1.vx; + v1y = v1.vy; + + v2x = v2.vx; + v2y = v2.vy; + + v3x = v3.vx; + v3y = v3.vy; + } + + var d1 = GetLength(v3x, v3y, v2x, v2y); + var d2 = GetLength(v1x, v1y, v3x, v3y); + var d3 = GetLength(v2x, v2y, v1x, v1y); + + var p = d1 + d2 + d3; + + return this._inCenter.set( + (v1x * d1 + v2x * d2 + v3x * d3) / p, + (v1y * d1 + v2y * d2 + v3y * d3) / p + ); + }, + + /** + * Checks if the given coordinates are within this Face. + * + * You can optionally provide a transform matrix. If given, the Face vertices + * will be transformed first, before being checked against the coordinates. + * + * @method Phaser.Geom.Mesh.Face#contains + * @since 3.50.0 + * + * @param {number} x - The horizontal position to check. + * @param {number} y - The vertical position to check. + * @param {Phaser.GameObjects.Components.TransformMatrix} [calcMatrix] - Optional transform matrix to apply to the vertices before comparison. + * + * @return {boolean} `true` if the coordinates lay within this Face, otherwise `false`. + */ + contains: function (x, y, calcMatrix) + { + var vertex1 = this.vertex1; + var vertex2 = this.vertex2; + var vertex3 = this.vertex3; + + var v1x = vertex1.vx; + var v1y = vertex1.vy; + + var v2x = vertex2.vx; + var v2y = vertex2.vy; + + var v3x = vertex3.vx; + var v3y = vertex3.vy; + + if (calcMatrix) + { + var a = calcMatrix.a; + var b = calcMatrix.b; + var c = calcMatrix.c; + var d = calcMatrix.d; + var e = calcMatrix.e; + var f = calcMatrix.f; + + v1x = vertex1.vx * a + vertex1.vy * c + e; + v1y = vertex1.vx * b + vertex1.vy * d + f; + + v2x = vertex2.vx * a + vertex2.vy * c + e; + v2y = vertex2.vx * b + vertex2.vy * d + f; + + v3x = vertex3.vx * a + vertex3.vy * c + e; + v3y = vertex3.vx * b + vertex3.vy * d + f; + } + + var t0x = v3x - v1x; + var t0y = v3y - v1y; + + var t1x = v2x - v1x; + var t1y = v2y - v1y; + + var t2x = x - v1x; + var t2y = y - v1y; + + var dot00 = (t0x * t0x) + (t0y * t0y); + var dot01 = (t0x * t1x) + (t0y * t1y); + var dot02 = (t0x * t2x) + (t0y * t2y); + var dot11 = (t1x * t1x) + (t1y * t1y); + var dot12 = (t1x * t2x) + (t1y * t2y); + + // Compute barycentric coordinates + var bc = ((dot00 * dot11) - (dot01 * dot01)); + var inv = (bc === 0) ? 0 : (1 / bc); + var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; + var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; + + return (u >= 0 && v >= 0 && (u + v < 1)); + }, + + /** + * Checks if the vertices in this Face are orientated counter-clockwise, or not. + * + * It checks the transformed position of the vertices, not the local one. + * + * @method Phaser.Geom.Mesh.Face#isCounterClockwise + * @since 3.50.0 + * + * @param {number} z - The z-axis value to test against. Typically the `Mesh.modelPosition.z`. + * + * @return {boolean} `true` if the vertices in this Face run counter-clockwise, otherwise `false`. + */ + isCounterClockwise: function (z) + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var d = (v2.vx - v1.vx) * (v3.vy - v1.vy) - (v2.vy - v1.vy) * (v3.vx - v1.vx); + + return (z <= 0) ? d >= 0 : d < 0; + }, + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * + * @method Phaser.Geom.Mesh.Face#load + * @since 3.50.0 + * + * @param {Float32Array} F32 - A Float32 Array to insert the position, UV and unit data in to. + * @param {Uint32Array} U32 - A Uint32 Array to insert the color and alpha data in to. + * @param {number} offset - The index of the array to insert this Vertex to. + * @param {number} textureUnit - The texture unit currently in use. + * @param {number} alpha - The alpha of the parent object. + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * + * @return {number} The new vertex index array offset. + */ + load: function (F32, U32, offset, textureUnit, tintEffect) + { + offset = this.vertex1.load(F32, U32, offset, textureUnit, tintEffect); + offset = this.vertex2.load(F32, U32, offset, textureUnit, tintEffect); + offset = this.vertex3.load(F32, U32, offset, textureUnit, tintEffect); + + return offset; + }, + + /** + * Transforms all Face vertices by the given matrix, storing the results in their `vx`, `vy` and `vz` properties. + * + * @method Phaser.Geom.Mesh.Face#transformCoordinatesLocal + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} transformMatrix - The transform matrix to apply to this vertex. + * @param {number} width - The width of the parent Mesh. + * @param {number} height - The height of the parent Mesh. + * @param {number} cameraZ - The z position of the MeshCamera. + * + * @return {this} This Face instance. + */ + transformCoordinatesLocal: function (transformMatrix, width, height, cameraZ) + { + this.vertex1.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + this.vertex2.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + this.vertex3.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + + return this; + }, + + /** + * Updates the bounds of this Face, based on the translated values of the vertices. + * + * Call this method prior to accessing the `Face.bounds` property. + * + * @method Phaser.Geom.Mesh.Face#updateBounds + * @since 3.50.0 + * + * @return {this} This Face instance. + */ + updateBounds: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var bounds = this.bounds; + + bounds.x = Math.min(v1.vx, v2.vx, v3.vx); + bounds.y = Math.min(v1.vy, v2.vy, v3.vy); + bounds.width = Math.max(v1.vx, v2.vx, v3.vx) - bounds.x; + bounds.height = Math.max(v1.vy, v2.vy, v3.vy) - bounds.y; + + return this; + }, + + /** + * Checks if this Face is within the view of the given Camera. + * + * This method is called in the `MeshWebGLRenderer` function. It performs the following tasks: + * + * First, the `Vertex.update` method is called on each of the vertices. This populates them + * with the new translated values, updating their `tx`, `ty` and `ta` properties. + * + * Then it tests to see if this face is visible due to the alpha values, if not, it returns. + * + * After this, if `hideCCW` is set, it calls `isCounterClockwise` and returns if not. + * + * Finally, it will update the `Face.bounds` based on the newly translated vertex values + * and return the results of an intersection test between the bounds and the camera world view + * rectangle. + * + * @method Phaser.Geom.Mesh.Face#isInView + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against. + * @param {boolean} hideCCW - Test the counter-clockwise orientation of the verts? + * @param {number} z - The Cameras z position, used in the CCW test. + * @param {number} alpha - The alpha of the parent object. + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * + * @return {boolean} `true` if this Face can be seen by the Camera. + */ + isInView: function (camera, hideCCW, z, alpha, a, b, c, d, e, f, roundPixels) + { + var v1 = this.vertex1.update(a, b, c, d, e, f, roundPixels, alpha); + var v2 = this.vertex2.update(a, b, c, d, e, f, roundPixels, alpha); + var v3 = this.vertex3.update(a, b, c, d, e, f, roundPixels, alpha); + + // Alpha check first + if (v1.ta <= 0 && v2.ta <= 0 && v3.ta <= 0) + { + return false; + } + + // CCW check + if (hideCCW && !this.isCounterClockwise(z)) + { + return false; + } + + // Bounds check + var bounds = this.bounds; + + bounds.x = Math.min(v1.tx, v2.tx, v3.tx); + bounds.y = Math.min(v1.ty, v2.ty, v3.ty); + bounds.width = Math.max(v1.tx, v2.tx, v3.tx) - bounds.x; + bounds.height = Math.max(v1.ty, v2.ty, v3.ty) - bounds.y; + + return RectangleToRectangle(bounds, camera.worldView); + }, + + /** + * Translates the vertices of this Face by the given amounts. + * + * The actual vertex positions are adjusted, not their transformed position. + * + * Therefore, this updates the vertex data directly. + * + * @method Phaser.Geom.Mesh.Face#translate + * @since 3.50.0 + * + * @param {number} x - The amount to horizontally translate by. + * @param {number} [y=0] - The amount to vertically translate by. + * + * @return {this} This Face instance. + */ + translate: function (x, y) + { + if (y === undefined) { y = 0; } + + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + v1.x += x; + v1.y += y; + + v2.x += x; + v2.y += y; + + v3.x += x; + v3.y += y; + + return this; + }, + + /** + * The x coordinate of this Face, based on the in center position of the Face. + * + * @name Phaser.Geom.Mesh.Face#x + * @type {number} + * @since 3.50.0 + */ + x: { + + get: function () + { + return this.getInCenter().x; + }, + + set: function (value) + { + var current = this.getInCenter(); + + this.translate(value - current.x, 0); + } + + }, + + /** + * The y coordinate of this Face, based on the in center position of the Face. + * + * @name Phaser.Geom.Mesh.Face#y + * @type {number} + * @since 3.50.0 + */ + y: { + + get: function () + { + return this.getInCenter().y; + }, + + set: function (value) + { + var current = this.getInCenter(); + + this.translate(0, value - current.y); + } + + }, + + /** + * Set the alpha value of this Face. + * + * Each vertex is given the same value. If you need to adjust the alpha on a per-vertex basis + * then use the `Vertex.alpha` property instead. + * + * When getting the alpha of this Face, it will return an average of the alpha + * component of all three vertices. + * + * @name Phaser.Geom.Mesh.Face#alpha + * @type {number} + * @since 3.50.0 + */ + alpha: { + + get: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + return (v1.alpha + v2.alpha + v3.alpha) / 3; + }, + + set: function (value) + { + this.vertex1.alpha = value; + this.vertex2.alpha = value; + this.vertex3.alpha = value; + } + + }, + + /** + * The depth of this Face, which is an average of the z component of all three vertices. + * + * The depth is calculated based on the transformed z value, not the local one. + * + * @name Phaser.Geom.Mesh.Face#depth + * @type {number} + * @readonly + * @since 3.50.0 + */ + depth: { + + get: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + return (v1.vz + v2.vz + v3.vz) / 3; + } + + }, + + /** + * Destroys this Face and nulls the references to the vertices. + * + * @method Phaser.Geom.Mesh.Face#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.vertex1 = null; + this.vertex2 = null; + this.vertex3 = null; + } + +}); + +module.exports = Face; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if two Rectangles intersect. + * + * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. + * As such, the two Rectangles are considered "solid". + * A Rectangle with no width or no height will never intersect another Rectangle. + * + * @function Phaser.Geom.Intersects.RectangleToRectangle + * @since 3.0.0 + * + * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection. + * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection. + * + * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`. + */ +var RectangleToRectangle = function (rectA, rectB) +{ + if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0) + { + return false; + } + + return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom); +}; + +module.exports = RectangleToRectangle; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Utils = __webpack_require__(12); +var Vector3 = __webpack_require__(37); + +/** + * @classdesc + * A Vertex Geometry Object. + * + * This class consists of all the information required for a single vertex within a Face Geometry Object. + * + * Faces, and thus Vertex objects, are used by the Mesh Game Object in order to render objects in WebGL. + * + * @class Vertex + * @memberof Phaser.Geom.Mesh + * @constructor + * @extends Phaser.Math.Vector3 + * @since 3.50.0 + * + * @param {number} x - The x position of the vertex. + * @param {number} y - The y position of the vertex. + * @param {number} z - The z position of the vertex. + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * @param {number} [color=0xffffff] - The color value of the vertex. + * @param {number} [alpha=1] - The alpha value of the vertex. + * @param {number} [nx=0] - The x normal value of the vertex. + * @param {number} [ny=0] - The y normal value of the vertex. + * @param {number} [nz=0] - The z normal value of the vertex. + */ +var Vertex = new Class({ + + Extends: Vector3, + + initialize: + + function Vertex (x, y, z, u, v, color, alpha, nx, ny, nz) + { + if (color === undefined) { color = 0xffffff; } + if (alpha === undefined) { alpha = 1; } + if (nx === undefined) { nx = 0; } + if (ny === undefined) { ny = 0; } + if (nz === undefined) { nz = 0; } + + Vector3.call(this, x, y, z); + + /** + * The projected x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vx + * @type {number} + * @since 3.50.0 + */ + this.vx = 0; + + /** + * The projected y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vy + * @type {number} + * @since 3.50.0 + */ + this.vy = 0; + + /** + * The projected z coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vz + * @type {number} + * @since 3.50.0 + */ + this.vz = 0; + + /** + * The projected x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#nx + * @type {number} + * @since 3.50.0 + */ + this.nx = nx; + + /** + * The projected y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ny + * @type {number} + * @since 3.50.0 + */ + this.ny = ny; + + /** + * The projected z coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#nz + * @type {number} + * @since 3.50.0 + */ + this.nz = nz; + + /** + * UV u coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#u + * @type {number} + * @since 3.50.0 + */ + this.u = u; + + /** + * UV v coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#v + * @type {number} + * @since 3.50.0 + */ + this.v = v; + + /** + * The color value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#color + * @type {number} + * @since 3.50.0 + */ + this.color = color; + + /** + * The alpha value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = alpha; + + /** + * The translated x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#tx + * @type {number} + * @since 3.50.0 + */ + this.tx = 0; + + /** + * The translated y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ty + * @type {number} + * @since 3.50.0 + */ + this.ty = 0; + + /** + * The translated alpha value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ta + * @type {number} + * @since 3.50.0 + */ + this.ta = 0; + }, + + /** + * Sets the U and V properties. + * + * @method Phaser.Geom.Mesh.Vertex#setUVs + * @since 3.50.0 + * + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * + * @return {this} This Vertex. + */ + setUVs: function (u, v) + { + this.u = u; + this.v = v; + + return this; + }, + + /** + * Transforms this vertex by the given matrix, storing the results in `vx`, `vy` and `vz`. + * + * @method Phaser.Geom.Mesh.Vertex#transformCoordinatesLocal + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} transformMatrix - The transform matrix to apply to this vertex. + * @param {number} width - The width of the parent Mesh. + * @param {number} height - The height of the parent Mesh. + * @param {number} cameraZ - The z position of the MeshCamera. + */ + transformCoordinatesLocal: function (transformMatrix, width, height, cameraZ) + { + var x = this.x; + var y = this.y; + var z = this.z; + + var m = transformMatrix.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.vx = (tx / tw) * width; + this.vy = -(ty / tw) * height; + + if (cameraZ <= 0) + { + this.vz = (tz / tw); + } + else + { + this.vz = -(tz / tw); + } + }, + + /** + * Updates this Vertex based on the given transform. + * + * @method Phaser.Geom.Mesh.Vertex#update + * @since 3.50.0 + * + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * @param {number} alpha - The alpha of the parent object. + * + * @return {this} This Vertex. + */ + update: function (a, b, c, d, e, f, roundPixels, alpha) + { + var tx = this.vx * a + this.vy * c + e; + var ty = this.vx * b + this.vy * d + f; + + if (roundPixels) + { + tx = Math.round(tx); + ty = Math.round(ty); + } + + this.tx = tx; + this.ty = ty; + this.ta = this.alpha * alpha; + + return this; + }, + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * + * @method Phaser.Geom.Mesh.Vertex#load + * @since 3.50.0 + * + * @param {Float32Array} F32 - A Float32 Array to insert the position, UV and unit data in to. + * @param {Uint32Array} U32 - A Uint32 Array to insert the color and alpha data in to. + * @param {number} offset - The index of the array to insert this Vertex to. + * @param {number} textureUnit - The texture unit currently in use. + * + * @return {number} The new array offset. + */ + load: function (F32, U32, offset, textureUnit, tintEffect) + { + F32[++offset] = this.tx; + F32[++offset] = this.ty; + F32[++offset] = this.u; + F32[++offset] = this.v; + F32[++offset] = textureUnit; + F32[++offset] = tintEffect; + U32[++offset] = Utils.getTintAppendFloatAlpha(this.color, this.ta); + + return offset; + } + +}); + +module.exports = Vertex; + + +/***/ }), +/* 114 */ /***/ (function(module, exports) { /** @@ -24037,7 +31259,7 @@ module.exports = Vector; })(); /***/ }), -/* 103 */ +/* 115 */ /***/ (function(module, exports) { /** @@ -24163,7 +31385,7 @@ module.exports = Bounds; /***/ }), -/* 104 */ +/* 116 */ /***/ (function(module, exports) { /** @@ -24178,8 +31400,8 @@ module.exports = Bounds; * @function Phaser.Tilemaps.Components.IsInLayerBounds * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`. @@ -24193,7 +31415,7 @@ module.exports = IsInLayerBounds; /***/ }), -/* 105 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24203,12 +31425,13 @@ module.exports = IsInLayerBounds; */ var Class = __webpack_require__(0); +var CONST = __webpack_require__(29); var GetFastValue = __webpack_require__(2); /** * @classdesc * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, - * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference + * etc. into this format. Tilemap and TilemapLayer objects have a reference * to this data and use it to look up and perform operations on tiles. * * @class LayerData @@ -24307,6 +31530,15 @@ var LayerData = new Class({ */ this.baseTileHeight = GetFastValue(config, 'baseTileHeight', this.tileHeight); + /** + * The layers orientation, necessary to be able to determine a tiles pixelX and pixelY as well as the layers width and height. + * + * @name Phaser.Tilemaps.LayerData#orientation + * @type {Phaser.Tilemaps.OrientationType} + * @since 3.50.0 + */ + this.orientation = GetFastValue(config, 'orientation', CONST.ORTHOGONAL); + /** * The width in pixels of the entire layer. * @@ -24401,10 +31633,20 @@ var LayerData = new Class({ * A reference to the Tilemap layer that owns this data. * * @name Phaser.Tilemaps.LayerData#tilemapLayer - * @type {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} + * @type {Phaser.Tilemaps.TilemapLayer} * @since 3.0.0 */ this.tilemapLayer = GetFastValue(config, 'tilemapLayer', null); + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.LayerData#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = GetFastValue(config, 'hexSideLength', 0); } }); @@ -24413,7 +31655,7 @@ module.exports = LayerData; /***/ }), -/* 106 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24423,6 +31665,7 @@ module.exports = LayerData; */ var Class = __webpack_require__(0); +var CONST = __webpack_require__(29); var GetFastValue = __webpack_require__(2); /** @@ -24448,7 +31691,7 @@ var MapData = new Class({ /** * The key in the Phaser cache that corresponds to the loaded tilemap data. - * + * * @name Phaser.Tilemaps.MapData#name * @type {string} * @since 3.0.0 @@ -24457,7 +31700,7 @@ var MapData = new Class({ /** * The width of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#width * @type {number} * @since 3.0.0 @@ -24466,7 +31709,7 @@ var MapData = new Class({ /** * The height of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#height * @type {number} * @since 3.0.0 @@ -24484,7 +31727,7 @@ var MapData = new Class({ /** * The width of the tiles. - * + * * @name Phaser.Tilemaps.MapData#tileWidth * @type {number} * @since 3.0.0 @@ -24493,7 +31736,7 @@ var MapData = new Class({ /** * The height of the tiles. - * + * * @name Phaser.Tilemaps.MapData#tileHeight * @type {number} * @since 3.0.0 @@ -24502,7 +31745,7 @@ var MapData = new Class({ /** * The width in pixels of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#widthInPixels * @type {number} * @since 3.0.0 @@ -24511,7 +31754,7 @@ var MapData = new Class({ /** * The height in pixels of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#heightInPixels * @type {number} * @since 3.0.0 @@ -24520,30 +31763,30 @@ var MapData = new Class({ /** * The format of the map data. - * + * * @name Phaser.Tilemaps.MapData#format - * @type {integer} + * @type {number} * @since 3.0.0 */ this.format = GetFastValue(config, 'format', null); /** * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. - * + * * @name Phaser.Tilemaps.MapData#orientation - * @type {string} - * @since 3.0.0 + * @type {Phaser.Tilemaps.OrientationType} + * @since 3.50.0 */ - this.orientation = GetFastValue(config, 'orientation', 'orthogonal'); + this.orientation = GetFastValue(config, 'orientation', CONST.ORTHOGONAL); /** * Determines the draw order of tilemap. Default is right-down - * + * * 0, or 'right-down' * 1, or 'left-down' * 2, or 'right-up' * 3, or 'left-up' - * + * * @name Phaser.Tilemaps.MapData#renderOrder * @type {string} * @since 3.12.0 @@ -24552,7 +31795,7 @@ var MapData = new Class({ /** * The version of the map data (as specified in Tiled). - * + * * @name Phaser.Tilemaps.MapData#version * @type {string} * @since 3.0.0 @@ -24561,7 +31804,7 @@ var MapData = new Class({ /** * Map specific properties (can be specified in Tiled) - * + * * @name Phaser.Tilemaps.MapData#properties * @type {object} * @since 3.0.0 @@ -24570,7 +31813,7 @@ var MapData = new Class({ /** * An array with all the layers configured to the MapData. - * + * * @name Phaser.Tilemaps.MapData#layers * @type {(Phaser.Tilemaps.LayerData[]|Phaser.Tilemaps.ObjectLayer)} * @since 3.0.0 @@ -24579,7 +31822,7 @@ var MapData = new Class({ /** * An array of Tiled Image Layers. - * + * * @name Phaser.Tilemaps.MapData#images * @type {array} * @since 3.0.0 @@ -24588,7 +31831,7 @@ var MapData = new Class({ /** * An object of Tiled Object Layers. - * + * * @name Phaser.Tilemaps.MapData#objects * @type {object} * @since 3.0.0 @@ -24597,7 +31840,7 @@ var MapData = new Class({ /** * An object of collision data. Must be created as physics object or will return undefined. - * + * * @name Phaser.Tilemaps.MapData#collision * @type {object} * @since 3.0.0 @@ -24606,7 +31849,7 @@ var MapData = new Class({ /** * An array of Tilesets. - * + * * @name Phaser.Tilemaps.MapData#tilesets * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 @@ -24615,7 +31858,7 @@ var MapData = new Class({ /** * The collection of images the map uses(specified in Tiled) - * + * * @name Phaser.Tilemaps.MapData#imageCollections * @type {array} * @since 3.0.0 @@ -24624,12 +31867,22 @@ var MapData = new Class({ /** * An array of tile instances. - * + * * @name Phaser.Tilemaps.MapData#tiles * @type {array} * @since 3.0.0 */ this.tiles = GetFastValue(config, 'tiles', []); + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.MapData#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = GetFastValue(config, 'hexSideLength', 0); } }); @@ -24638,7 +31891,7 @@ module.exports = MapData; /***/ }), -/* 107 */ +/* 119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24660,11 +31913,11 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {string} name - The name of the tileset in the map data. - * @param {integer} firstgid - The first tile index this tileset contains. - * @param {integer} [tileWidth=32] - Width of each tile (in pixels). - * @param {integer} [tileHeight=32] - Height of each tile (in pixels). - * @param {integer} [tileMargin=0] - The margin around all tiles in the sheet (in pixels). - * @param {integer} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels). + * @param {number} firstgid - The first tile index this tileset contains. + * @param {number} [tileWidth=32] - Width of each tile (in pixels). + * @param {number} [tileHeight=32] - Height of each tile (in pixels). + * @param {number} [tileMargin=0] - The margin around all tiles in the sheet (in pixels). + * @param {number} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels). * @param {object} [tileProperties={}] - Custom properties defined per tile in the Tileset. * These typically are custom properties created in Tiled when editing a tileset. * @param {object} [tileData={}] - Data stored per tile. These typically are created in Tiled @@ -24696,7 +31949,7 @@ var Tileset = new Class({ * The starting index of the first tile index this Tileset contains. * * @name Phaser.Tilemaps.Tileset#firstgid - * @type {integer} + * @type {number} * @since 3.0.0 */ this.firstgid = firstgid; @@ -24705,7 +31958,7 @@ var Tileset = new Class({ * The width of each tile (in pixels). Use setTileSize to change. * * @name Phaser.Tilemaps.Tileset#tileWidth - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -24715,7 +31968,7 @@ var Tileset = new Class({ * The height of each tile (in pixels). Use setTileSize to change. * * @name Phaser.Tilemaps.Tileset#tileHeight - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -24725,7 +31978,7 @@ var Tileset = new Class({ * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change. * * @name Phaser.Tilemaps.Tileset#tileMargin - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -24735,7 +31988,7 @@ var Tileset = new Class({ * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change. * * @name Phaser.Tilemaps.Tileset#tileSpacing - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -24785,7 +32038,7 @@ var Tileset = new Class({ * The number of tile rows in the the tileset. * * @name Phaser.Tilemaps.Tileset#rows - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -24795,7 +32048,7 @@ var Tileset = new Class({ * The number of tile columns in the tileset. * * @name Phaser.Tilemaps.Tileset#columns - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -24805,7 +32058,7 @@ var Tileset = new Class({ * The total number of tiles in the tileset. * * @name Phaser.Tilemaps.Tileset#total - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -24830,7 +32083,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileProperties * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?(object|undefined)} */ @@ -24849,7 +32102,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileData * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object|undefined} */ @@ -24867,7 +32120,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileCollisionGroup * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object} */ @@ -24884,7 +32137,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#containsTileIndex * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {boolean} */ @@ -24903,7 +32156,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileTextureCoordinates * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object} Object in the form { x, y } representing the top-left UV coordinate * within the Tileset image. @@ -24942,8 +32195,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#setTileSize * @since 3.0.0 * - * @param {integer} [tileWidth] - The width of a tile in pixels. - * @param {integer} [tileHeight] - The height of a tile in pixels. + * @param {number} [tileWidth] - The width of a tile in pixels. + * @param {number} [tileHeight] - The height of a tile in pixels. * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -24966,8 +32219,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#setSpacing * @since 3.0.0 * - * @param {integer} [margin] - The margin around the tiles in the sheet (in pixels). - * @param {integer} [spacing] - The spacing between the tiles in the sheet (in pixels). + * @param {number} [margin] - The margin around the tiles in the sheet (in pixels). + * @param {number} [spacing] - The spacing between the tiles in the sheet (in pixels). * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -24990,8 +32243,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#updateTileData * @since 3.0.0 * - * @param {integer} imageWidth - The (expected) width of the image to slice. - * @param {integer} imageHeight - The (expected) height of the image to slice. + * @param {number} imageWidth - The (expected) width of the image to slice. + * @param {number} imageHeight - The (expected) height of the image to slice. * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -25042,7 +32295,7 @@ module.exports = Tileset; /***/ }), -/* 108 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -25058,7 +32311,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_LEFT * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_LEFT: 0, @@ -25067,7 +32320,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_CENTER: 1, @@ -25076,7 +32329,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_RIGHT * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_RIGHT: 2, @@ -25085,7 +32338,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_TOP * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_TOP: 3, @@ -25094,7 +32347,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_CENTER: 4, @@ -25103,7 +32356,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_BOTTOM * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_BOTTOM: 5, @@ -25112,7 +32365,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ CENTER: 6, @@ -25121,7 +32374,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_TOP * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_TOP: 7, @@ -25130,7 +32383,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_CENTER: 8, @@ -25139,7 +32392,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_BOTTOM * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_BOTTOM: 9, @@ -25148,7 +32401,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_LEFT * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_LEFT: 10, @@ -25157,7 +32410,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_CENTER: 11, @@ -25166,7 +32419,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_RIGHT * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_RIGHT: 12 @@ -25176,7 +32429,7 @@ module.exports = ALIGN_CONST; /***/ }), -/* 109 */ +/* 121 */ /***/ (function(module, exports) { /** @@ -25210,2541 +32463,7 @@ module.exports = Equal; /***/ }), -/* 110 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var PIPELINE_CONST = { - - /** - * The Bitmap Mask Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', - - /** - * The Light 2D Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - LIGHT_PIPELINE: 'Light2D', - - /** - * The Single Texture Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - SINGLE_PIPELINE: 'SinglePipeline', - - /** - * The Multi Texture Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - MULTI_PIPELINE: 'MultiPipeline', - - /** - * The Rope Pipeline. - * - * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE - * @type {string} - * @const - * @since 3.50.0 - */ - ROPE_PIPELINE: 'RopePipeline' - -}; - -module.exports = PIPELINE_CONST; - - -/***/ }), -/* 111 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var GetFastValue = __webpack_require__(2); -var Utils = __webpack_require__(10); - -/** - * @classdesc - * - * The `WebGLPipeline` is a base class used by all of the core Phaser pipelines. - * - * It describes the way elements will be rendered in WebGL. Internally, it handles - * compiling the shaders, creating vertex buffers, assigning primitive topolgy and - * binding vertex attributes, all based on the given configuration data. - * - * The pipeline is configured by passing in a `WebGLPipelineConfig` object. Please - * see the documentation for this type to fully understand the configuration options - * available to you. - * - * Usually, you would not extend from this class directly, but would instead extend - * from one of the core pipelines, such as the Multi Pipeline or Rope Pipeline. - * - * @class WebGLPipeline - * @memberof Phaser.Renderer.WebGL - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration object for this WebGL Pipeline. - */ -var WebGLPipeline = new Class({ - - initialize: - - function WebGLPipeline (config) - { - var game = config.game; - var renderer = game.renderer; - var gl = renderer.gl; - - /** - * Name of the pipeline. Used for identification. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#name - * @type {string} - * @since 3.0.0 - */ - this.name = GetFastValue(config, 'name', 'WebGLPipeline'); - - /** - * The Phaser Game instance to which this pipeline is bound. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#game - * @type {Phaser.Game} - * @since 3.0.0 - */ - this.game = game; - - /** - * The WebGL Renderer instance to which this pipeline is bound. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#renderer - * @type {Phaser.Renderer.WebGL.WebGLRenderer} - * @since 3.0.0 - */ - this.renderer = renderer; - - /** - * The WebGL context this WebGL Pipeline uses. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#gl - * @type {WebGLRenderingContext} - * @since 3.0.0 - */ - this.gl = gl; - - /** - * The canvas which this WebGL Pipeline renders to. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#view - * @type {HTMLCanvasElement} - * @since 3.0.0 - */ - this.view = game.canvas; - - /** - * The current game resolution. - * This is hard-coded to 1. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#resolution - * @type {number} - * @since 3.0.0 - */ - this.resolution = 1; - - /** - * Width of the current viewport. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#width - * @type {number} - * @since 3.0.0 - */ - this.width = 0; - - /** - * Height of the current viewport. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#height - * @type {number} - * @since 3.0.0 - */ - this.height = 0; - - /** - * The current number of vertices that have been added to the pipeline batch. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCount - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.vertexCount = 0; - - /** - * The total number of vertices that the pipeline batch can hold before it will flush. - * This defaults to `batchSize * 6`, where `batchSize` is defined in the Renderer Config. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCapacity - * @type {integer} - * @since 3.0.0 - */ - this.vertexCapacity = GetFastValue(config, 'vertexCapacity', renderer.config.batchSize * 6); - - /** - * The size in bytes of a vertex. - * - * Derived by adding together all of the vertex attributes. - * - * For example, the Texture Tint Pipeline has 2 + 2 + 1 + 1 + 4 for the attributes - * `inPosition` (size 2), `inTexCoord` (size 2), `inTexId` (size 1), `inTintEffect` (size 1) - * and `inTint` (size 4), for a total of 28, which is the default for this property. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexSize - * @type {integer} - * @since 3.0.0 - */ - this.vertexSize = GetFastValue(config, 'vertexSize', 28); - - /** - * Raw byte buffer of vertices. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexData - * @type {ArrayBuffer} - * @since 3.0.0 - */ - this.vertexData = GetFastValue(config, 'vertices', new ArrayBuffer(this.vertexCapacity * this.vertexSize)); - - /** - * The WebGLBuffer that holds the vertex data. - * Created from the `vertices` config ArrayBuffer that was passed in, or set by default, by the pipeline. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexBuffer - * @type {WebGLBuffer} - * @since 3.0.0 - */ - if (GetFastValue(config, 'vertices', null)) - { - this.vertexBuffer = this.renderer.createVertexBuffer(this.vertexData, this.gl.STREAM_DRAW); - } - else - { - this.vertexBuffer = this.renderer.createVertexBuffer(this.vertexData.byteLength, this.gl.STREAM_DRAW); - } - - /** - * The handle to a WebGL program. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#program - * @type {WebGLProgram} - * @since 3.0.0 - */ - this.program = this.renderer.createProgram(config.vertShader, config.fragShader); - - /** - * Array of objects that describe the vertex attributes. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#attributes - * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig} - * @since 3.0.0 - */ - this.attributes = config.attributes; - - /** - * The primitive topology which the pipeline will use to submit draw calls. - * Defaults to GL_TRIANGLES if not otherwise set. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#topology - * @type {GLenum} - * @since 3.0.0 - */ - this.topology = GetFastValue(config, 'topology', gl.TRIANGLES); - - /** - * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#bytes - * @type {Uint8Array} - * @since 3.0.0 - */ - this.bytes = new Uint8Array(this.vertexData); - - /** - * This will store the amount of components of 32 bit length. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexComponentCount - * @type {integer} - * @since 3.0.0 - */ - this.vertexComponentCount = Utils.getComponentCount(this.attributes, gl); - - /** - * Indicates if the current pipeline is flushing the contents to the GPU. - * When the variable is set the flush function will be locked. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#flushLocked - * @type {boolean} - * @since 3.1.0 - */ - this.flushLocked = false; - - /** - * Indicates if the current pipeline is active or not for this frame only. - * Reset in the onRender method. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#active - * @type {boolean} - * @since 3.10.0 - */ - this.active = false; - - /** - * Holds the most recently assigned texture unit. - * Treat this value as read-only. - * - * @name Phaser.Renderer.WebGL.Pipelines.WebGLPipeline#currentUnit - * @type {number} - * @since 3.50.0 - */ - this.currentUnit = 0; - - /** - * Some pipelines require the forced use of texture zero (like the light pipeline). - * This boolean should be set when that is the case. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#forceZero - * @type {boolean} - * @since 3.50.0 - */ - this.forceZero = false; - - /** - * Indicates if the current pipeline has booted or not. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#hasBooted - * @type {boolean} - * @readonly - * @since 3.50.0 - */ - this.hasBooted = false; - }, - - /** - * Called when the Game has fully booted and the Renderer has finished setting up. - * - * By this stage all Game level systems are now in place and you can perform any final - * tasks that the pipeline may need that relied on game systems such as the Texture Manager. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#boot - * @since 3.11.0 - */ - boot: function () - { - var renderer = this.renderer; - - renderer.setProgram(this.program); - renderer.setVertexBuffer(this.vertexBuffer); - - this.setAttribPointers(true); - - this.hasBooted = true; - - return this; - }, - - /** - * Custom pipelines can use this method in order to perform any required pre-batch tasks - * for the given Game Object. It must return the texture unit the Game Object was assigned. - * - * @method Phaser.Renderer.WebGL.Pipelines.WebGLPipeline#setGameObject - * @since 3.50.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. - * @param {Phaser.Textures.Frame} [frame] - Optional frame to use. Can override that of the Game Object. - * - * @return {number} The texture unit the Game Object has been assigned. - */ - setGameObject: function (gameObject, frame) - { - if (frame === undefined) { frame = gameObject.frame; } - - this.currentUnit = this.renderer.setTextureSource(frame.source); - - return this.currentUnit; - }, - - /** - * Adds a description of vertex attribute to the pipeline - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#addAttribute - * @since 3.2.0 - * - * @param {string} name - Name of the vertex attribute - * @param {integer} size - Vertex component size - * @param {integer} type - Type of the attribute - * @param {boolean} normalized - Is the value normalized to a range - * @param {integer} offset - Byte offset to the beginning of the first element in the vertex - * - * @return {this} This WebGLPipeline instance. - */ - addAttribute: function (name, size, type, normalized, offset) - { - this.attributes.push({ - name: name, - size: size, - type: this.renderer.glFormats[type], - normalized: normalized, - offset: offset, - enabled: false, - location: -1 - }); - - this.vertexComponentCount = Utils.getComponentCount( - this.attributes, - this.gl - ); - return this; - }, - - /** - * Check if the current batch of vertices is full. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#shouldFlush - * @since 3.0.0 - * - * @return {boolean} `true` if the current batch should be flushed, otherwise `false`. - */ - shouldFlush: function () - { - return (this.vertexCount >= this.vertexCapacity); - }, - - /** - * Resizes the properties used to describe the viewport - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#resize - * @since 3.0.0 - * - * @param {number} width - The new width of this WebGL Pipeline. - * @param {number} height - The new height of this WebGL Pipeline. - * @param {number} resolution - The resolution this WebGL Pipeline should be resized to. - * - * @return {this} This WebGLPipeline instance. - */ - resize: function (width, height, resolution) - { - this.width = width * resolution; - this.height = height * resolution; - this.resolution = resolution; - - return this; - }, - - /** - * Binds the pipeline resources, including the program, vertex buffer and attribute pointers. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#bind - * @since 3.0.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - var vertexBuffer = this.vertexBuffer; - var program = this.program; - var renderer = this.renderer; - - renderer.setProgram(program); - renderer.setVertexBuffer(vertexBuffer); - - this.setAttribPointers(reset); - - return this; - }, - - /** - * Sets the vertex attribute pointers. - * This should only be called after the vertex buffer has been bound. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setAttribPointers - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Reset the vertex attribute locations? - * - * @return {this} This WebGLPipeline instance. - */ - setAttribPointers: function (reset) - { - if (reset === undefined) { reset = false; } - - var gl = this.gl; - var attributes = this.attributes; - var vertexSize = this.vertexSize; - var program = this.program; - - for (var i = 0; i < attributes.length; i++) - { - var element = attributes[i]; - - if (reset) - { - var location = gl.getAttribLocation(program, element.name); - - if (location >= 0) - { - gl.enableVertexAttribArray(location); - gl.vertexAttribPointer(location, element.size, element.type, element.normalized, vertexSize, element.offset); - element.enabled = true; - element.location = location; - } - else if (location !== -1) - { - gl.disableVertexAttribArray(location); - } - } - else if (element.enabled) - { - gl.vertexAttribPointer(element.location, element.size, element.type, element.normalized, vertexSize, element.offset); - } - else if (!element.enabled && element.location > -1) - { - gl.disableVertexAttribArray(element.location); - element.location = -1; - } - } - }, - - /** - * Set whenever this WebGL Pipeline is bound to a WebGL Renderer. - * - * This method is called every time the WebGL Pipeline is attempted to be bound, even if it already is the current pipeline. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onBind - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - onBind: function () - { - // This is for updating uniform data it's called on each bind attempt. - return this; - }, - - /** - * Called before each frame is rendered, but after the canvas has been cleared. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreRender - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - onPreRender: function () - { - // called once every frame - return this; - }, - - /** - * Called before a Scene's Camera is rendered. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onRender - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene being rendered. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. - * - * @return {this} This WebGLPipeline instance. - */ - onRender: function () - { - // called for each camera - return this; - }, - - /** - * Called after each frame has been completely rendered and snapshots have been taken. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostRender - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - onPostRender: function () - { - // called once every frame - return this; - }, - - /** - * Uploads the vertex data and emits a draw call - * for the current batch of vertices. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#flush - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - flush: function () - { - if (this.flushLocked) { return this; } - - this.flushLocked = true; - - var gl = this.gl; - var vertexCount = this.vertexCount; - var topology = this.topology; - var vertexSize = this.vertexSize; - - if (vertexCount === 0) - { - this.flushLocked = false; - return; - } - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); - gl.drawArrays(topology, 0, vertexCount); - - this.vertexCount = 0; - this.flushLocked = false; - - return this; - }, - - /** - * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - destroy: function () - { - var gl = this.gl; - - gl.deleteProgram(this.program); - gl.deleteBuffer(this.vertexBuffer); - - delete this.program; - delete this.vertexBuffer; - delete this.gl; - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The new value of the `float` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat1: function (name, x) - { - this.renderer.setFloat1(this.program, name, x); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The new X component of the `vec2` uniform. - * @param {number} y - The new Y component of the `vec2` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat2: function (name, x, y) - { - this.renderer.setFloat2(this.program, name, x, y); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The new X component of the `vec3` uniform. - * @param {number} y - The new Y component of the `vec3` uniform. - * @param {number} z - The new Z component of the `vec3` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat3: function (name, x, y, z) - { - this.renderer.setFloat3(this.program, name, x, y, z); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - X component of the uniform - * @param {number} y - Y component of the uniform - * @param {number} z - Z component of the uniform - * @param {number} w - W component of the uniform - * - * @return {this} This WebGLPipeline instance. - */ - setFloat4: function (name, x, y, z, w) - { - this.renderer.setFloat4(this.program, name, x, y, z, w); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat1v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat1v: function (name, arr) - { - this.renderer.setFloat1v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat2v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat2v: function (name, arr) - { - this.renderer.setFloat2v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat3v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat3v: function (name, arr) - { - this.renderer.setFloat3v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setFloat4v - * @since 3.13.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGLPipeline instance. - */ - setFloat4v: function (name, arr) - { - this.renderer.setFloat4v(this.program, name, arr); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt1 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The new value of the `int` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setInt1: function (name, x) - { - this.renderer.setInt1(this.program, name, x); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt2 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The new X component of the `ivec2` uniform. - * @param {integer} y - The new Y component of the `ivec2` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setInt2: function (name, x, y) - { - this.renderer.setInt2(this.program, name, x, y); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt3 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The new X component of the `ivec3` uniform. - * @param {integer} y - The new Y component of the `ivec3` uniform. - * @param {integer} z - The new Z component of the `ivec3` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setInt3: function (name, x, y, z) - { - this.renderer.setInt3(this.program, name, x, y, z); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setInt4 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - X component of the uniform - * @param {integer} y - Y component of the uniform - * @param {integer} z - Z component of the uniform - * @param {integer} w - W component of the uniform - * - * @return {this} This WebGLPipeline instance. - */ - setInt4: function (name, x, y, z, w) - { - this.renderer.setInt4(this.program, name, x, y, z, w); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix2 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. - * @param {Float32Array} matrix - The new values for the `mat2` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setMatrix2: function (name, transpose, matrix) - { - this.renderer.setMatrix2(this.program, name, transpose, matrix); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix3 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. - * @param {Float32Array} matrix - The new values for the `mat3` uniform. - * - * @return {this} This WebGLPipeline instance. - */ - setMatrix3: function (name, transpose, matrix) - { - this.renderer.setMatrix3(this.program, name, transpose, matrix); - - return this; - }, - - /** - * Set a uniform value of the current pipeline program. - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix4 - * @since 3.2.0 - * - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - Should the matrix be transpose - * @param {Float32Array} matrix - Matrix data - * - * @return {this} This WebGLPipeline instance. - */ - setMatrix4: function (name, transpose, matrix) - { - this.renderer.setMatrix4(this.program, name, transpose, matrix); - - return this; - } - -}); - -module.exports = WebGLPipeline; - - -/***/ }), -/* 112 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var GetFastValue = __webpack_require__(2); -var ModelViewProjection = __webpack_require__(113); -var ProjectOrtho = __webpack_require__(185); -var ShaderSourceFS = __webpack_require__(810); -var ShaderSourceVS = __webpack_require__(811); -var TransformMatrix = __webpack_require__(31); -var Utils = __webpack_require__(10); -var WebGLPipeline = __webpack_require__(111); - -/** - * @classdesc - * - * The Multi Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL. - * Virtually all Game Objects use this pipeline by default, including Sprites, Graphics - * and Tilemaps. It handles the batching of quads and tris, as well as methods for - * drawing and batching geometry data. - * - * Prior to Phaser v3.50 this pipeline was called the `TextureTintPipeline`. - * - * In previous versions of Phaser only one single texture unit was supported at any one time. - * The Multi Pipeline is an evolution of the old Texture Tint Pipeline, updated to support - * multi-textures for increased performance. - * - * The fragment shader it uses can be found in `shaders/src/Multi.frag`. - * The vertex shader it uses can be found in `shaders/src/Multi.vert`. - * - * The default shader attributes for this pipeline are: - * - * `inPosition` (vec2, offset 0) - * `inTexCoord` (vec2, offset 8) - * `inTexId` (float, offset 16) - * `inTintEffect` (float, offset 20) - * `inTint` (vec4, offset 24, normalized) - * - * The default shader uniforms for this pipeline are: - * - * `uProjectionMatrix` (mat4) - * `uViewMatrix` (mat4) - * `uModelMatrix` (mat4) - * `uMainSampler` (sampler2D array) - * - * If you wish to create a custom pipeline extending from this one, you can use two string - * declarations in your fragment shader source: `%count%` and `%forloop%`, where `count` is - * used to set the number of `sampler2Ds` available, and `forloop` is a block of GLSL code - * that will get the currently bound texture unit. - * - * This pipeline will automatically inject that code for you, should those values exist - * in your shader source. If you wish to handle this yourself, you can also use the - * function `Utils.parseFragmentShaderMaxTextures`. - * - * If you wish to create a pipeline that works from a single texture, or that doesn't have - * internal texture iteration, please see the `SinglePipeline` instead. - * - * @class MultiPipeline - * @extends Phaser.Renderer.WebGL.WebGLPipeline - * @memberof Phaser.Renderer.WebGL.Pipelines - * @constructor - * @since 3.50.0 - * - * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. - */ -var MultiPipeline = new Class({ - - Extends: WebGLPipeline, - - Mixins: [ - ModelViewProjection - ], - - initialize: - - function MultiPipeline (config) - { - var renderer = config.game.renderer; - var gl = renderer.gl; - - var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); - - // Vertex Size = attribute size added together (2 + 2 + 1 + 1 + 4) inc maxTextures - - config.fragShader = Utils.parseFragmentShaderMaxTextures(fragmentShaderSource, renderer.maxTextures); - config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 - }, - { - name: 'inTexCoord', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 8, - enabled: false, - location: -1 - }, - { - name: 'inTexId', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 16, - enabled: false, - location: -1 - }, - { - name: 'inTintEffect', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 20, - enabled: false, - location: -1 - }, - { - name: 'inTint', - size: 4, - type: gl.UNSIGNED_BYTE, - normalized: true, - offset: 24, - enabled: false, - location: -1 - } - ]); - - WebGLPipeline.call(this, config); - - /** - * Float32 view of the array buffer containing the pipeline's vertices. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#vertexViewF32 - * @type {Float32Array} - * @since 3.0.0 - */ - this.vertexViewF32 = new Float32Array(this.vertexData); - - /** - * Uint32 view of the array buffer containing the pipeline's vertices. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#vertexViewU32 - * @type {Uint32Array} - * @since 3.0.0 - */ - this.vertexViewU32 = new Uint32Array(this.vertexData); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix3 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix4 = new TransformMatrix(); - - /** - * Used internally to draw stroked triangles. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempTriangle - * @type {array} - * @private - * @since 3.12.0 - */ - this.tempTriangle = [ - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 } - ]; - - /** - * The tint effect to be applied by the shader in the next geometry draw: - * - * 0 = texture multiplied by color - * 1 = solid color + texture alpha - * 2 = solid color, no texture - * 3 = solid texture, no color - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tintEffect - * @type {number} - * @private - * @since 3.12.0 - */ - this.tintEffect = 2; - - /** - * Cached stroke tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#strokeTint - * @type {object} - * @private - * @since 3.12.0 - */ - this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Cached fill tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#fillTint - * @type {object} - * @private - * @since 3.12.0 - */ - this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Internal texture frame reference. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#currentFrame - * @type {Phaser.Textures.Frame} - * @private - * @since 3.12.0 - */ - this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#firstQuad - * @type {array} - * @private - * @since 3.12.0 - */ - this.firstQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#prevQuad - * @type {array} - * @private - * @since 3.12.0 - */ - this.prevQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Used internally for triangulating a polygon. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#polygonCache - * @type {array} - * @private - * @since 3.12.0 - */ - this.polygonCache = []; - - this.mvpInit(); - }, - - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - this.renderer.setInt1iv(this.program, 'uMainSampler', this.renderer.textureIndexes); - - return this; - }, - - /** - * Called every time a Game Object needs to use this pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#onBind - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. - * - * @return {this} This WebGLPipeline instance. - */ - onBind: function () - { - this.mvpUpdate(); - - return this; - }, - - /** - * Resizes this pipeline and updates the projection. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#resize - * @since 3.0.0 - * - * @param {number} width - The new width. - * @param {number} height - The new height. - * @param {number} resolution - The resolution. - * - * @return {this} This WebGLPipeline instance. - */ - resize: function (width, height, resolution) - { - WebGLPipeline.prototype.resize.call(this, width, height, resolution); - - ProjectOrtho(this, 0, this.width, this.height, 0, -1000, 1000); - - return this; - }, - - /** - * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#setTexture2D - * @since 3.1.0 - * - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. - * - * @return {number} The assigned texture unit. - */ - setTexture2D: function (texture) - { - if (texture === undefined) { texture = this.renderer.blankTexture.glTexture; } - - this.currentUnit = this.renderer.setTexture2D(texture); - - return this.currentUnit; - }, - - /** - * Uploads the vertex data and emits a draw call for the current batch of vertices. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#flush - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - flush: function () - { - var gl = this.gl; - var vertexCount = this.vertexCount; - var vertexSize = this.vertexSize; - - if (vertexCount > 0) - { - if (vertexCount === this.vertexCapacity) - { - gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW); - } - else - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); - } - - gl.drawArrays(this.topology, 0, vertexCount); - - this.vertexCount = 0; - } - - return this; - }, - - /** - * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchSprite - * @since 3.0.0 - * - * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} sprite - The texture based Game Object to add to the batch. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set. - */ - batchSprite: function (sprite, camera, parentTransformMatrix) - { - // Will cause a flush if this isn't the current pipeline, vertexbuffer or program - this.renderer.pipelines.set(this); - - var camMatrix = this._tempMatrix1; - var spriteMatrix = this._tempMatrix2; - var calcMatrix = this._tempMatrix3; - - var frame = sprite.frame; - var texture = frame.glTexture; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - var frameX = frame.x; - var frameY = frame.y; - var frameWidth = frame.cutWidth; - var frameHeight = frame.cutHeight; - var customPivot = frame.customPivot; - - var displayOriginX = sprite.displayOriginX; - var displayOriginY = sprite.displayOriginY; - - var x = -displayOriginX + frameX; - var y = -displayOriginY + frameY; - - if (sprite.isCropped) - { - var crop = sprite._crop; - - if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) - { - frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); - } - - u0 = crop.u0; - v0 = crop.v0; - u1 = crop.u1; - v1 = crop.v1; - - frameWidth = crop.width; - frameHeight = crop.height; - - frameX = crop.x; - frameY = crop.y; - - x = -displayOriginX + frameX; - y = -displayOriginY + frameY; - } - - var flipX = 1; - var flipY = 1; - - if (sprite.flipX) - { - if (!customPivot) - { - x += (-frame.realWidth + (displayOriginX * 2)); - } - - flipX = -1; - } - - // Auto-invert the flipY if this is coming from a GLTexture - if (sprite.flipY || (frame.source.isGLTexture && !texture.flipY)) - { - if (!customPivot) - { - y += (-frame.realHeight + (displayOriginY * 2)); - } - - flipY = -1; - } - - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); - - camMatrix.copyFrom(camera.matrix); - - if (parentTransformMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = sprite.x; - spriteMatrix.f = sprite.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; - spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - var xw = x + frameWidth; - var yh = y + frameHeight; - - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - var tintTL = Utils.getTintAppendFloatAlpha(sprite._tintTL, camera.alpha * sprite._alphaTL); - var tintTR = Utils.getTintAppendFloatAlpha(sprite._tintTR, camera.alpha * sprite._alphaTR); - var tintBL = Utils.getTintAppendFloatAlpha(sprite._tintBL, camera.alpha * sprite._alphaBL); - var tintBR = Utils.getTintAppendFloatAlpha(sprite._tintBR, camera.alpha * sprite._alphaBR); - - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - // So batchQuad never assigns a unit to the glTexture, but to the textureSource instead - if (this.vertexCount + 6 > this.vertexCapacity) - { - this.flush(); - } - - var unit = this.setGameObject(sprite); - - var tintEffect = (sprite._isTinted && sprite.tintFill); - - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit); - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchQuad - * @since 3.12.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.vertexCount + 6 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - this.vertexCount += 6; - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTri - * @since 3.12.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.vertexCount + 3 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - this.vertexCount += 3; - - return hasFlushed; - }, - - /** - * Generic function for batching a textured quad using argument values instead of a Game Object. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTexture - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject. - * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad. - * @param {integer} textureWidth - Real texture width. - * @param {integer} textureHeight - Real texture height. - * @param {number} srcX - X coordinate of the quad. - * @param {number} srcY - Y coordinate of the quad. - * @param {number} srcWidth - Width of the quad. - * @param {number} srcHeight - Height of the quad. - * @param {number} scaleX - X component of scale. - * @param {number} scaleY - Y component of scale. - * @param {number} rotation - Rotation of the quad. - * @param {boolean} flipX - Indicates if the quad is horizontally flipped. - * @param {boolean} flipY - Indicates if the quad is vertically flipped. - * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll. - * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll. - * @param {number} displayOriginX - Horizontal origin in pixels. - * @param {number} displayOriginY - Vertical origin in pixels. - * @param {number} frameX - X coordinate of the texture frame. - * @param {number} frameY - Y coordinate of the texture frame. - * @param {number} frameWidth - Width of the texture frame. - * @param {number} frameHeight - Height of the texture frame. - * @param {integer} tintTL - Tint for top left. - * @param {integer} tintTR - Tint for top right. - * @param {integer} tintBL - Tint for bottom left. - * @param {integer} tintBR - Tint for bottom right. - * @param {number} tintEffect - The tint effect. - * @param {number} uOffset - Horizontal offset on texture coordinate. - * @param {number} vOffset - Vertical offset on texture coordinate. - * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. - * @param {boolean} [skipFlip=false] - Skip the renderTexture check. - * @param {number} [textureUnit] - Use the currently bound texture unit? - */ - batchTexture: function ( - gameObject, - texture, - textureWidth, textureHeight, - srcX, srcY, - srcWidth, srcHeight, - scaleX, scaleY, - rotation, - flipX, flipY, - scrollFactorX, scrollFactorY, - displayOriginX, displayOriginY, - frameX, frameY, frameWidth, frameHeight, - tintTL, tintTR, tintBL, tintBR, tintEffect, - uOffset, vOffset, - camera, - parentTransformMatrix, - skipFlip, - textureUnit) - { - var renderer = this.renderer; - - renderer.pipelines.set(this, gameObject); - - var camMatrix = this._tempMatrix1; - var spriteMatrix = this._tempMatrix2; - var calcMatrix = this._tempMatrix3; - - var u0 = (frameX / textureWidth) + uOffset; - var v0 = (frameY / textureHeight) + vOffset; - var u1 = (frameX + frameWidth) / textureWidth + uOffset; - var v1 = (frameY + frameHeight) / textureHeight + vOffset; - - var width = srcWidth; - var height = srcHeight; - - var x = -displayOriginX; - var y = -displayOriginY; - - if (gameObject.isCropped) - { - var crop = gameObject._crop; - - width = crop.width; - height = crop.height; - - srcWidth = crop.width; - srcHeight = crop.height; - - frameX = crop.x; - frameY = crop.y; - - var ox = frameX; - var oy = frameY; - - if (flipX) - { - ox = (frameWidth - crop.x - crop.width); - } - - if (flipY && !texture.isRenderTexture) - { - oy = (frameHeight - crop.y - crop.height); - } - - u0 = (ox / textureWidth) + uOffset; - v0 = (oy / textureHeight) + vOffset; - u1 = (ox + crop.width) / textureWidth + uOffset; - v1 = (oy + crop.height) / textureHeight + vOffset; - - x = -displayOriginX + frameX; - y = -displayOriginY + frameY; - } - - // Invert the flipY if this is a RenderTexture - flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); - - if (flipX) - { - width *= -1; - x += srcWidth; - } - - if (flipY) - { - height *= -1; - y += srcHeight; - } - - var xw = x + width; - var yh = y + height; - - spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentTransformMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = srcX; - spriteMatrix.f = srcY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * scrollFactorX; - spriteMatrix.f -= camera.scrollY * scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - if (textureUnit === undefined) - { - textureUnit = this.renderer.setTexture2D(texture); - } - - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); - }, - - /** - * Adds a Texture Frame into the batch for rendering. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTextureFrame - * @since 3.12.0 - * - * @param {Phaser.Textures.Frame} frame - The Texture Frame to be rendered. - * @param {number} x - The horizontal position to render the texture at. - * @param {number} y - The vertical position to render the texture at. - * @param {number} tint - The tint color. - * @param {number} alpha - The alpha value. - * @param {Phaser.GameObjects.Components.TransformMatrix} transformMatrix - The Transform Matrix to use for the texture. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - A parent Transform Matrix. - */ - batchTextureFrame: function ( - frame, - x, y, - tint, alpha, - transformMatrix, - parentTransformMatrix - ) - { - this.renderer.pipelines.set(this); - - var spriteMatrix = this._tempMatrix1.copyFrom(transformMatrix); - var calcMatrix = this._tempMatrix2; - - var xw = x + frame.width; - var yh = y + frame.height; - - if (parentTransformMatrix) - { - spriteMatrix.multiply(parentTransformMatrix, calcMatrix); - } - else - { - calcMatrix = spriteMatrix; - } - - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - // this.setTexture2D(frame.glTexture, 0); - var unit = this.renderer.setTextureSource(frame.source); - - tint = Utils.getTintAppendFloatAlpha(tint, alpha); - - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, unit); - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * - * The dimensions are run through `Math.floor` before the quad is generated. - * - * Rectangle has no transform values and isn't transformed into the local space. - * - * Used for directly batching untransformed rectangles, such as Camera background colors. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#drawFillRect - * @since 3.12.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {number} color - Color of the rectangle to draw. - * @param {number} alpha - Alpha value of the rectangle to draw. - */ - drawFillRect: function (x, y, width, height, color, alpha) - { - x = Math.floor(x); - y = Math.floor(y); - - var xw = Math.floor(x + width); - var yh = Math.floor(y + height); - - var blank = this.renderer.blankTexture.glTexture; - - var unit = this.renderer.setTexture2D(blank); - - var tint = Utils.getTintAppendFloatAlphaAndSwap(color, alpha); - - this.batchQuad(x, y, x, yh, xw, yh, xw, y, 0, 0, 1, 1, tint, tint, tint, tint, 2, blank, unit); - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * Rectangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillRect - * @since 3.12.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var xw = x + width; - var yh = y + height; - - var x0 = calcMatrix.getX(x, y); - var y0 = calcMatrix.getY(x, y); - - var x1 = calcMatrix.getX(x, yh); - var y1 = calcMatrix.getY(x, yh); - - var x2 = calcMatrix.getX(xw, yh); - var y2 = calcMatrix.getY(xw, yh); - - var x3 = calcMatrix.getX(xw, y); - var y3 = calcMatrix.getY(xw, y); - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - var tint = this.fillTint; - - this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tint.TL, tint.TR, tint.BL, tint.BR, this.tintEffect); - }, - - /** - * Pushes a filled triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillTriangle - * @since 3.12.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.tintEffect); - }, - - /** - * Pushes a stroked triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchStrokeTriangle - * @since 3.12.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {number} lineWidth - The width of the line in pixels. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) - { - var tempTriangle = this.tempTriangle; - - tempTriangle[0].x = x0; - tempTriangle[0].y = y0; - tempTriangle[0].width = lineWidth; - - tempTriangle[1].x = x1; - tempTriangle[1].y = y1; - tempTriangle[1].width = lineWidth; - - tempTriangle[2].x = x2; - tempTriangle[2].y = y2; - tempTriangle[2].width = lineWidth; - - tempTriangle[3].x = x0; - tempTriangle[3].y = y0; - tempTriangle[3].width = lineWidth; - - this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillPath - * @since 3.12.0 - * - * @param {array} path - Collection of points that represent the path. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillPath: function (path, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var length = path.length; - var polygonCache = this.polygonCache; - var polygonIndexArray; - var point; - - var tintTL = this.fillTint.TL; - var tintTR = this.fillTint.TR; - var tintBL = this.fillTint.BL; - var tintEffect = this.tintEffect; - - for (var pathIndex = 0; pathIndex < length; ++pathIndex) - { - point = path[pathIndex]; - polygonCache.push(point.x, point.y); - } - - polygonIndexArray = Earcut(polygonCache); - length = polygonIndexArray.length; - - var frame = this.currentFrame; - - for (var index = 0; index < length; index += 3) - { - var p0 = polygonIndexArray[index + 0] * 2; - var p1 = polygonIndexArray[index + 1] * 2; - var p2 = polygonIndexArray[index + 2] * 2; - - var x0 = polygonCache[p0 + 0]; - var y0 = polygonCache[p0 + 1]; - var x1 = polygonCache[p1 + 0]; - var y1 = polygonCache[p1 + 1]; - var x2 = polygonCache[p2 + 0]; - var y2 = polygonCache[p2 + 1]; - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect); - } - - polygonCache.length = 0; - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchStrokePath - * @since 3.12.0 - * - * @param {array} path - Collection of points that represent the path. - * @param {number} lineWidth - The width of the line segments in pixels. - * @param {boolean} pathOpen - Indicates if the path should be closed or left open. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - // Reset the closePath booleans - this.prevQuad[4] = 0; - this.firstQuad[4] = 0; - - var pathLength = path.length - 1; - - for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) - { - var point0 = path[pathIndex]; - var point1 = path[pathIndex + 1]; - - this.batchLine( - point0.x, - point0.y, - point1.x, - point1.y, - point0.width / 2, - point1.width / 2, - lineWidth, - pathIndex, - !pathOpen && (pathIndex === pathLength - 1), - currentMatrix, - parentMatrix - ); - } - }, - - /** - * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. - * Assumes a texture has already been set, prior to calling this function. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchLine - * @since 3.12.0 - * - * @param {number} ax - X coordinate to the start of the line - * @param {number} ay - Y coordinate to the start of the line - * @param {number} bx - X coordinate to the end of the line - * @param {number} by - Y coordinate to the end of the line - * @param {number} aLineWidth - Width of the start of the line - * @param {number} bLineWidth - Width of the end of the line - * @param {Float32Array} currentMatrix - Parent matrix, generally used by containers - */ - batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var dx = bx - ax; - var dy = by - ay; - - var len = Math.sqrt(dx * dx + dy * dy); - var al0 = aLineWidth * (by - ay) / len; - var al1 = aLineWidth * (ax - bx) / len; - var bl0 = bLineWidth * (by - ay) / len; - var bl1 = bLineWidth * (ax - bx) / len; - - var lx0 = bx - bl0; - var ly0 = by - bl1; - var lx1 = ax - al0; - var ly1 = ay - al1; - var lx2 = bx + bl0; - var ly2 = by + bl1; - var lx3 = ax + al0; - var ly3 = ay + al1; - - // tx0 = bottom right - var brX = calcMatrix.getX(lx0, ly0); - var brY = calcMatrix.getY(lx0, ly0); - - // tx1 = bottom left - var blX = calcMatrix.getX(lx1, ly1); - var blY = calcMatrix.getY(lx1, ly1); - - // tx2 = top right - var trX = calcMatrix.getX(lx2, ly2); - var trY = calcMatrix.getY(lx2, ly2); - - // tx3 = top left - var tlX = calcMatrix.getX(lx3, ly3); - var tlY = calcMatrix.getY(lx3, ly3); - - var tint = this.strokeTint; - var tintEffect = this.tintEffect; - - var tintTL = tint.TL; - var tintTR = tint.TR; - var tintBL = tint.BL; - var tintBR = tint.BR; - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - // TL, BL, BR, TR - this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - - if (lineWidth <= 2) - { - // No point doing a linejoin if the line isn't thick enough - return; - } - - var prev = this.prevQuad; - var first = this.firstQuad; - - if (index > 0 && prev[4]) - { - this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - } - else - { - first[0] = tlX; - first[1] = tlY; - first[2] = blX; - first[3] = blY; - first[4] = 1; - } - - if (closePath && first[4]) - { - // Add a join for the final path segment - this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - } - else - { - // Store it - - prev[0] = brX; - prev[1] = brY; - prev[2] = trX; - prev[3] = trY; - prev[4] = 1; - } - } - -}); - -module.exports = MultiPipeline; - - -/***/ }), -/* 113 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Implements a model view projection matrices. - * Pipelines can implement this for doing 2D and 3D rendering. - * - * @namespace Phaser.Renderer.WebGL.Pipelines.ModelViewProjection - * @since 3.0.0 - */ -var ModelViewProjection = { - - /** - * Dirty flag for checking if model matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - modelMatrixDirty: false, - - /** - * Dirty flag for checking if view matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - viewMatrixDirty: false, - - /** - * Dirty flag for checking if projection matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - projectionMatrixDirty: false, - - /** - * Model matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - modelMatrix: null, - - /** - * View matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - viewMatrix: null, - - /** - * Projection matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - projectionMatrix: null, - - /** - * Initializes MVP matrices with an identity matrix - * - * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpInit - * @since 3.0.0 - */ - mvpInit: function () - { - this.modelMatrixDirty = true; - this.viewMatrixDirty = true; - this.projectionMatrixDirty = true; - - this.modelMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - this.viewMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - this.projectionMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * If dirty flags are set then the matrices are uploaded to the GPU. - * - * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpUpdate - * @since 3.0.0 - */ - mvpUpdate: function () - { - var program = this.program; - - if (this.modelMatrixDirty) - { - this.renderer.setMatrix4(program, 'uModelMatrix', false, this.modelMatrix); - this.modelMatrixDirty = false; - } - - if (this.viewMatrixDirty) - { - this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - this.viewMatrixDirty = false; - } - - if (this.projectionMatrixDirty) - { - this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); - this.projectionMatrixDirty = false; - } - - return this; - } -}; - -module.exports = ModelViewProjection; - - -/***/ }), -/* 114 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27756,7 +32475,7 @@ module.exports = ModelViewProjection; var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var ImageRender = __webpack_require__(994); +var ImageRender = __webpack_require__(1051); /** * @classdesc @@ -27792,7 +32511,7 @@ var ImageRender = __webpack_require__(994); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Image = new Class({ @@ -27845,7 +32564,7 @@ module.exports = Image; /***/ }), -/* 115 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -27874,7 +32593,7 @@ module.exports = HasValue; /***/ }), -/* 116 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27892,12 +32611,12 @@ var Bodies = {}; module.exports = Bodies; -var Vertices = __webpack_require__(88); -var Common = __webpack_require__(44); -var Body = __webpack_require__(64); -var Bounds = __webpack_require__(103); -var Vector = __webpack_require__(102); -var decomp = __webpack_require__(1404); +var Vertices = __webpack_require__(93); +var Common = __webpack_require__(50); +var Body = __webpack_require__(68); +var Bounds = __webpack_require__(115); +var Vector = __webpack_require__(114); +var decomp = __webpack_require__(1466); (function() { @@ -28232,7 +32951,7 @@ var decomp = __webpack_require__(1404); /***/ }), -/* 117 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -28241,14 +32960,14 @@ var decomp = __webpack_require__(1404); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); -var Circle = __webpack_require__(68); -var CircleContains = __webpack_require__(57); +var BlendModes = __webpack_require__(48); +var Circle = __webpack_require__(71); +var CircleContains = __webpack_require__(62); var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(50); +var RectangleContains = __webpack_require__(56); /** * @classdesc @@ -28331,7 +33050,7 @@ var Zone = new Class({ * display lists without causing a batch flush. * * @name Phaser.GameObjects.Zone#blendMode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.blendMode = BlendModes.NORMAL; @@ -28545,7 +33264,7 @@ module.exports = Zone; /***/ }), -/* 118 */ +/* 126 */ /***/ (function(module, exports) { /** @@ -28573,743 +33292,7 @@ module.exports = Perimeter; /***/ }), -/* 119 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a hex color value, such as 0xff00ff (for purple), it will return a - * numeric representation of it (i.e. 16711935) for use in WebGL tinting. - * - * @function Phaser.Display.Color.GetColorFromValue - * @since 3.50.0 - * - * @param {number} red - The hex color value, such as 0xff0000. - * - * @return {number} The combined color value. - */ -var GetColorFromValue = function (value) -{ - return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); -}; - -module.exports = GetColorFromValue; - - -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Events = __webpack_require__(293); - -/** - * @callback DataEachCallback - * - * @param {*} parent - The parent object of the DataManager. - * @param {string} key - The key of the value. - * @param {*} value - The value. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. - */ - -/** - * @classdesc - * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin. - * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter, - * or have a property called `events` that is an instance of it. - * - * @class DataManager - * @memberof Phaser.Data - * @constructor - * @since 3.0.0 - * - * @param {object} parent - The object that this DataManager belongs to. - * @param {Phaser.Events.EventEmitter} [eventEmitter] - The DataManager's event emitter. - */ -var DataManager = new Class({ - - initialize: - - function DataManager (parent, eventEmitter) - { - /** - * The object that this DataManager belongs to. - * - * @name Phaser.Data.DataManager#parent - * @type {*} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * The DataManager's event emitter. - * - * @name Phaser.Data.DataManager#events - * @type {Phaser.Events.EventEmitter} - * @since 3.0.0 - */ - this.events = eventEmitter; - - if (!eventEmitter) - { - this.events = (parent.events) ? parent.events : parent; - } - - /** - * The data list. - * - * @name Phaser.Data.DataManager#list - * @type {Object.} - * @default {} - * @since 3.0.0 - */ - this.list = {}; - - /** - * The public values list. You can use this to access anything you have stored - * in this Data Manager. For example, if you set a value called `gold` you can - * access it via: - * - * ```javascript - * this.data.values.gold; - * ``` - * - * You can also modify it directly: - * - * ```javascript - * this.data.values.gold += 1000; - * ``` - * - * Doing so will emit a `setdata` event from the parent of this Data Manager. - * - * Do not modify this object directly. Adding properties directly to this object will not - * emit any events. Always use `DataManager.set` to create new items the first time around. - * - * @name Phaser.Data.DataManager#values - * @type {Object.} - * @default {} - * @since 3.10.0 - */ - this.values = {}; - - /** - * Whether setting data is frozen for this DataManager. - * - * @name Phaser.Data.DataManager#_frozen - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._frozen = false; - - if (!parent.hasOwnProperty('sys') && this.events) - { - this.events.once('destroy', this.destroy, this); - } - }, - - /** - * Retrieves the value for the given key, or undefined if it doesn't exist. - * - * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * - * ```javascript - * this.data.get('gold'); - * ``` - * - * Or access the value directly: - * - * ```javascript - * this.data.values.gold; - * ``` - * - * You can also pass in an array of keys, in which case an array of values will be returned: - * - * ```javascript - * this.data.get([ 'gold', 'armor', 'health' ]); - * ``` - * - * This approach is useful for destructuring arrays in ES6. - * - * @method Phaser.Data.DataManager#get - * @since 3.0.0 - * - * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. - * - * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. - */ - get: function (key) - { - var list = this.list; - - if (Array.isArray(key)) - { - var output = []; - - for (var i = 0; i < key.length; i++) - { - output.push(list[key[i]]); - } - - return output; - } - else - { - return list[key]; - } - }, - - /** - * Retrieves all data values in a new object. - * - * @method Phaser.Data.DataManager#getAll - * @since 3.0.0 - * - * @return {Object.} All data values. - */ - getAll: function () - { - var results = {}; - - for (var key in this.list) - { - if (this.list.hasOwnProperty(key)) - { - results[key] = this.list[key]; - } - } - - return results; - }, - - /** - * Queries the DataManager for the values of keys matching the given regular expression. - * - * @method Phaser.Data.DataManager#query - * @since 3.0.0 - * - * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj). - * - * @return {Object.} The values of the keys matching the search string. - */ - query: function (search) - { - var results = {}; - - for (var key in this.list) - { - if (this.list.hasOwnProperty(key) && key.match(search)) - { - results[key] = this.list[key]; - } - } - - return results; - }, - - /** - * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * - * ```javascript - * data.set('name', 'Red Gem Stone'); - * ``` - * - * You can also pass in an object of key value pairs as the first argument: - * - * ```javascript - * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); - * ``` - * - * To get a value back again you can call `get`: - * - * ```javascript - * data.get('gold'); - * ``` - * - * Or you can access the value directly via the `values` property, where it works like any other variable: - * - * ```javascript - * data.values.gold += 50; - * ``` - * - * When the value is first set, a `setdata` event is emitted. - * - * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. - * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. - * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. - * - * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * - * @method Phaser.Data.DataManager#set - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.0.0 - * - * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored. - * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored. - * - * @return {this} This DataManager object. - */ - set: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (typeof key === 'string') - { - return this.setValue(key, data); - } - else - { - for (var entry in key) - { - this.setValue(entry, key[entry]); - } - } - - return this; - }, - - /** - * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. - * - * When the value is first set, a `setdata` event is emitted. - * - * @method Phaser.Data.DataManager#inc - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.23.0 - * - * @param {(string|object)} key - The key to increase the value for. - * @param {*} [data] - The value to increase for the given key. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - inc: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (data === undefined) - { - data = 1; - } - - var value = this.get(key); - if (value === undefined) - { - value = 0; - } - - this.set(key, (value + data)); - - return this; - }, - - /** - * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. - * - * When the value is first set, a `setdata` event is emitted. - * - * @method Phaser.Data.DataManager#toggle - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.23.0 - * - * @param {(string|object)} key - The key to toggle the value for. - * - * @return {Phaser.Data.DataManager} This DataManager object. - */ - toggle: function (key) - { - if (this._frozen) - { - return this; - } - - this.set(key, !this.get(key)); - - return this; - }, - - /** - * Internal value setter, called automatically by the `set` method. - * - * @method Phaser.Data.DataManager#setValue - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @private - * @since 3.10.0 - * - * @param {string} key - The key to set the value for. - * @param {*} data - The value to set. - * - * @return {this} This DataManager object. - */ - setValue: function (key, data) - { - if (this._frozen) - { - return this; - } - - if (this.has(key)) - { - // Hit the key getter, which will in turn emit the events. - this.values[key] = data; - } - else - { - var _this = this; - var list = this.list; - var events = this.events; - var parent = this.parent; - - Object.defineProperty(this.values, key, { - - enumerable: true, - - configurable: true, - - get: function () - { - return list[key]; - }, - - set: function (value) - { - if (!_this._frozen) - { - var previousValue = list[key]; - list[key] = value; - - events.emit(Events.CHANGE_DATA, parent, key, value, previousValue); - events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue); - } - } - - }); - - list[key] = data; - - events.emit(Events.SET_DATA, parent, key, data); - } - - return this; - }, - - /** - * Passes all data entries to the given callback. - * - * @method Phaser.Data.DataManager#each - * @since 3.0.0 - * - * @param {DataEachCallback} callback - The function to call. - * @param {*} [context] - Value to use as `this` when executing callback. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data. - * - * @return {this} This DataManager object. - */ - each: function (callback, context) - { - var args = [ this.parent, null, undefined ]; - - for (var i = 1; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (var key in this.list) - { - args[1] = key; - args[2] = this.list[key]; - - callback.apply(context, args); - } - - return this; - }, - - /** - * Merge the given object of key value pairs into this DataManager. - * - * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument) - * will emit a `changedata` event. - * - * @method Phaser.Data.DataManager#merge - * @fires Phaser.Data.Events#SET_DATA - * @fires Phaser.Data.Events#CHANGE_DATA - * @fires Phaser.Data.Events#CHANGE_DATA_KEY - * @since 3.0.0 - * - * @param {Object.} data - The data to merge. - * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true. - * - * @return {this} This DataManager object. - */ - merge: function (data, overwrite) - { - if (overwrite === undefined) { overwrite = true; } - - // Merge data from another component into this one - for (var key in data) - { - if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key)))) - { - this.setValue(key, data[key]); - } - } - - return this; - }, - - /** - * Remove the value for the given key. - * - * If the key is found in this Data Manager it is removed from the internal lists and a - * `removedata` event is emitted. - * - * You can also pass in an array of keys, in which case all keys in the array will be removed: - * - * ```javascript - * this.data.remove([ 'gold', 'armor', 'health' ]); - * ``` - * - * @method Phaser.Data.DataManager#remove - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.0.0 - * - * @param {(string|string[])} key - The key to remove, or an array of keys to remove. - * - * @return {this} This DataManager object. - */ - remove: function (key) - { - if (this._frozen) - { - return this; - } - - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - this.removeValue(key[i]); - } - } - else - { - return this.removeValue(key); - } - - return this; - }, - - /** - * Internal value remover, called automatically by the `remove` method. - * - * @method Phaser.Data.DataManager#removeValue - * @private - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.10.0 - * - * @param {string} key - The key to set the value for. - * - * @return {this} This DataManager object. - */ - removeValue: function (key) - { - if (this.has(key)) - { - var data = this.list[key]; - - delete this.list[key]; - delete this.values[key]; - - this.events.emit(Events.REMOVE_DATA, this.parent, key, data); - } - - return this; - }, - - /** - * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it. - * - * @method Phaser.Data.DataManager#pop - * @fires Phaser.Data.Events#REMOVE_DATA - * @since 3.0.0 - * - * @param {string} key - The key of the value to retrieve and delete. - * - * @return {*} The value of the given key. - */ - pop: function (key) - { - var data = undefined; - - if (!this._frozen && this.has(key)) - { - data = this.list[key]; - - delete this.list[key]; - delete this.values[key]; - - this.events.emit(Events.REMOVE_DATA, this.parent, key, data); - } - - return data; - }, - - /** - * Determines whether the given key is set in this Data Manager. - * - * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. - * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. - * - * @method Phaser.Data.DataManager#has - * @since 3.0.0 - * - * @param {string} key - The key to check. - * - * @return {boolean} Returns `true` if the key exists, otherwise `false`. - */ - has: function (key) - { - return this.list.hasOwnProperty(key); - }, - - /** - * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts - * to create new values or update existing ones. - * - * @method Phaser.Data.DataManager#setFreeze - * @since 3.0.0 - * - * @param {boolean} value - Whether to freeze or unfreeze the Data Manager. - * - * @return {this} This DataManager object. - */ - setFreeze: function (value) - { - this._frozen = value; - - return this; - }, - - /** - * Delete all data in this Data Manager and unfreeze it. - * - * @method Phaser.Data.DataManager#reset - * @since 3.0.0 - * - * @return {this} This DataManager object. - */ - reset: function () - { - for (var key in this.list) - { - delete this.list[key]; - delete this.values[key]; - } - - this._frozen = false; - - return this; - }, - - /** - * Destroy this data manager. - * - * @method Phaser.Data.DataManager#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.reset(); - - this.events.off(Events.CHANGE_DATA); - this.events.off(Events.SET_DATA); - this.events.off(Events.REMOVE_DATA); - - this.parent = null; - }, - - /** - * Gets or sets the frozen state of this Data Manager. - * A frozen Data Manager will block all attempts to create new values or update existing ones. - * - * @name Phaser.Data.DataManager#freeze - * @type {boolean} - * @since 3.0.0 - */ - freeze: { - - get: function () - { - return this._frozen; - }, - - set: function (value) - { - this._frozen = (value) ? true : false; - } - - }, - - /** - * Return the total number of entries in this Data Manager. - * - * @name Phaser.Data.DataManager#count - * @type {integer} - * @since 3.0.0 - */ - count: { - - get: function () - { - var i = 0; - - for (var key in this.list) - { - if (this.list[key] !== undefined) - { - i++; - } - } - - return i; - } - - } - -}); - -module.exports = DataManager; - - -/***/ }), -/* 121 */ +/* 127 */ /***/ (function(module, exports) { /** @@ -29350,7 +33333,7 @@ module.exports = Shuffle; /***/ }), -/* 122 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29365,23 +33348,23 @@ module.exports = Shuffle; module.exports = { - ADD_ANIMATION: __webpack_require__(652), - ANIMATION_COMPLETE: __webpack_require__(653), - ANIMATION_COMPLETE_KEY: __webpack_require__(654), - ANIMATION_REPEAT: __webpack_require__(655), - ANIMATION_RESTART: __webpack_require__(656), - ANIMATION_START: __webpack_require__(657), - ANIMATION_STOP: __webpack_require__(658), - ANIMATION_UPDATE: __webpack_require__(659), - PAUSE_ALL: __webpack_require__(660), - REMOVE_ANIMATION: __webpack_require__(661), - RESUME_ALL: __webpack_require__(662) + ADD_ANIMATION: __webpack_require__(692), + ANIMATION_COMPLETE: __webpack_require__(693), + ANIMATION_COMPLETE_KEY: __webpack_require__(694), + ANIMATION_REPEAT: __webpack_require__(695), + ANIMATION_RESTART: __webpack_require__(696), + ANIMATION_START: __webpack_require__(697), + ANIMATION_STOP: __webpack_require__(698), + ANIMATION_UPDATE: __webpack_require__(699), + PAUSE_ALL: __webpack_require__(700), + REMOVE_ANIMATION: __webpack_require__(701), + RESUME_ALL: __webpack_require__(702) }; /***/ }), -/* 123 */ +/* 129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29390,18 +33373,18 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Back = __webpack_require__(315); -var Bounce = __webpack_require__(316); -var Circular = __webpack_require__(317); -var Cubic = __webpack_require__(318); -var Elastic = __webpack_require__(319); -var Expo = __webpack_require__(320); -var Linear = __webpack_require__(321); -var Quadratic = __webpack_require__(322); -var Quartic = __webpack_require__(323); -var Quintic = __webpack_require__(324); -var Sine = __webpack_require__(325); -var Stepped = __webpack_require__(326); +var Back = __webpack_require__(326); +var Bounce = __webpack_require__(327); +var Circular = __webpack_require__(328); +var Cubic = __webpack_require__(329); +var Elastic = __webpack_require__(330); +var Expo = __webpack_require__(331); +var Linear = __webpack_require__(332); +var Quadratic = __webpack_require__(333); +var Quartic = __webpack_require__(334); +var Quintic = __webpack_require__(335); +var Sine = __webpack_require__(336); +var Stepped = __webpack_require__(337); // EaseMap module.exports = { @@ -29462,7 +33445,7 @@ module.exports = { /***/ }), -/* 124 */ +/* 130 */ /***/ (function(module, exports) { /** @@ -29492,179 +33475,7 @@ module.exports = Linear; /***/ }), -/* 125 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Determines the operating system of the device running this Phaser Game instance. - * These values are read-only and populated during the boot sequence of the game. - * They are then referenced by internal game systems and are available for you to access - * via `this.sys.game.device.os` from within any Scene. - * - * @typedef {object} Phaser.Device.OS - * @since 3.0.0 - * - * @property {boolean} android - Is running on android? - * @property {boolean} chromeOS - Is running on chromeOS? - * @property {boolean} cordova - Is the game running under Apache Cordova? - * @property {boolean} crosswalk - Is the game running under the Intel Crosswalk XDK? - * @property {boolean} desktop - Is running on a desktop? - * @property {boolean} ejecta - Is the game running under Ejecta? - * @property {boolean} electron - Is the game running under GitHub Electron? - * @property {boolean} iOS - Is running on iOS? - * @property {boolean} iPad - Is running on iPad? - * @property {boolean} iPhone - Is running on iPhone? - * @property {boolean} kindle - Is running on an Amazon Kindle? - * @property {boolean} linux - Is running on linux? - * @property {boolean} macOS - Is running on macOS? - * @property {boolean} node - Is the game running under Node.js? - * @property {boolean} nodeWebkit - Is the game running under Node-Webkit? - * @property {boolean} webApp - Set to true if running as a WebApp, i.e. within a WebView - * @property {boolean} windows - Is running on windows? - * @property {boolean} windowsPhone - Is running on a Windows Phone? - * @property {number} iOSVersion - If running in iOS this will contain the major version number. - * @property {number} pixelRatio - PixelRatio of the host device? - */ -var OS = { - - android: false, - chromeOS: false, - cordova: false, - crosswalk: false, - desktop: false, - ejecta: false, - electron: false, - iOS: false, - iOSVersion: 0, - iPad: false, - iPhone: false, - kindle: false, - linux: false, - macOS: false, - node: false, - nodeWebkit: false, - pixelRatio: 1, - webApp: false, - windows: false, - windowsPhone: false - -}; - -function init () -{ - var ua = navigator.userAgent; - - if ((/Windows/).test(ua)) - { - OS.windows = true; - } - else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) - { - OS.macOS = true; - } - else if ((/Android/).test(ua)) - { - OS.android = true; - } - else if ((/Linux/).test(ua)) - { - OS.linux = true; - } - else if ((/iP[ao]d|iPhone/i).test(ua)) - { - OS.iOS = true; - - (navigator.appVersion).match(/OS (\d+)/); - - OS.iOSVersion = parseInt(RegExp.$1, 10); - - OS.iPhone = ua.toLowerCase().indexOf('iphone') !== -1; - OS.iPad = ua.toLowerCase().indexOf('ipad') !== -1; - } - else if ((/Kindle/).test(ua) || (/\bKF[A-Z][A-Z]+/).test(ua) || (/Silk.*Mobile Safari/).test(ua)) - { - OS.kindle = true; - - // This will NOT detect early generations of Kindle Fire, I think there is no reliable way... - // E.g. "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" - } - else if ((/CrOS/).test(ua)) - { - OS.chromeOS = true; - } - - if ((/Windows Phone/i).test(ua) || (/IEMobile/i).test(ua)) - { - OS.android = false; - OS.iOS = false; - OS.macOS = false; - OS.windows = true; - OS.windowsPhone = true; - } - - var silk = (/Silk/).test(ua); - - if (OS.windows || OS.macOS || (OS.linux && !silk) || OS.chromeOS) - { - OS.desktop = true; - } - - // Windows Phone / Table reset - if (OS.windowsPhone || (((/Windows NT/i).test(ua)) && ((/Touch/i).test(ua)))) - { - OS.desktop = false; - } - - // WebApp mode in iOS - if (navigator.standalone) - { - OS.webApp = true; - } - - if (window.cordova !== undefined) - { - OS.cordova = true; - } - - if (typeof process !== 'undefined' && process.versions && process.versions.node) - { - OS.node = true; - } - - if (OS.node && typeof process.versions === 'object') - { - OS.nodeWebkit = !!process.versions['node-webkit']; - - OS.electron = !!process.versions.electron; - } - - if (window.ejecta !== undefined) - { - OS.ejecta = true; - } - - if ((/Crosswalk/).test(ua)) - { - OS.crosswalk = true; - } - - OS.pixelRatio = window['devicePixelRatio'] || 1; - - return OS; -} - -module.exports = init(); - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(755))) - -/***/ }), -/* 126 */ +/* 131 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -29673,7 +33484,7 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(125); +var OS = __webpack_require__(102); /** * Determines the browser type and version running this Phaser Game instance. @@ -29774,7 +33585,7 @@ module.exports = init(); /***/ }), -/* 127 */ +/* 132 */ /***/ (function(module, exports) { /** @@ -29803,7 +33614,7 @@ module.exports = FloatBetween; /***/ }), -/* 128 */ +/* 133 */ /***/ (function(module, exports) { /** @@ -29833,7 +33644,51 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 129 */ +/* 134 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Snap a value to nearest grid slice, using ceil. + * + * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. + * As will `14` snap to `15`... but `16` will snap to `20`. + * + * @function Phaser.Math.Snap.Ceil + * @since 3.0.0 + * + * @param {number} value - The value to snap. + * @param {number} gap - The interval gap of the grid. + * @param {number} [start=0] - Optional starting offset for gap. + * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. + * + * @return {number} The snapped value. + */ +var SnapCeil = function (value, gap, start, divide) +{ + if (start === undefined) { start = 0; } + + if (gap === 0) + { + return value; + } + + value -= start; + value = gap * Math.ceil(value / gap); + + return (divide) ? (start + value) / gap : start + value; +}; + +module.exports = SnapCeil; + + +/***/ }), +/* 135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30378,7 +34233,7 @@ module.exports = Vector4; /***/ }), -/* 130 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -30393,17 +34248,17 @@ module.exports = Vector4; module.exports = { - ADD: __webpack_require__(814), - ERROR: __webpack_require__(815), - LOAD: __webpack_require__(816), - READY: __webpack_require__(817), - REMOVE: __webpack_require__(818) + ADD: __webpack_require__(869), + ERROR: __webpack_require__(870), + LOAD: __webpack_require__(871), + READY: __webpack_require__(872), + REMOVE: __webpack_require__(873) }; /***/ }), -/* 131 */ +/* 137 */ /***/ (function(module, exports) { /** @@ -30461,7 +34316,7 @@ module.exports = AddToDOM; /***/ }), -/* 132 */ +/* 138 */ /***/ (function(module, exports) { /** @@ -30484,7 +34339,7 @@ var KeyCodes = { * The BACKSPACE key. * * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE - * @type {integer} + * @type {number} * @since 3.0.0 */ BACKSPACE: 8, @@ -30493,7 +34348,7 @@ var KeyCodes = { * The TAB key. * * @name Phaser.Input.Keyboard.KeyCodes.TAB - * @type {integer} + * @type {number} * @since 3.0.0 */ TAB: 9, @@ -30502,7 +34357,7 @@ var KeyCodes = { * The ENTER key. * * @name Phaser.Input.Keyboard.KeyCodes.ENTER - * @type {integer} + * @type {number} * @since 3.0.0 */ ENTER: 13, @@ -30511,7 +34366,7 @@ var KeyCodes = { * The SHIFT key. * * @name Phaser.Input.Keyboard.KeyCodes.SHIFT - * @type {integer} + * @type {number} * @since 3.0.0 */ SHIFT: 16, @@ -30520,7 +34375,7 @@ var KeyCodes = { * The CTRL key. * * @name Phaser.Input.Keyboard.KeyCodes.CTRL - * @type {integer} + * @type {number} * @since 3.0.0 */ CTRL: 17, @@ -30529,7 +34384,7 @@ var KeyCodes = { * The ALT key. * * @name Phaser.Input.Keyboard.KeyCodes.ALT - * @type {integer} + * @type {number} * @since 3.0.0 */ ALT: 18, @@ -30538,7 +34393,7 @@ var KeyCodes = { * The PAUSE key. * * @name Phaser.Input.Keyboard.KeyCodes.PAUSE - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSE: 19, @@ -30547,7 +34402,7 @@ var KeyCodes = { * The CAPS_LOCK key. * * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK - * @type {integer} + * @type {number} * @since 3.0.0 */ CAPS_LOCK: 20, @@ -30556,7 +34411,7 @@ var KeyCodes = { * The ESC key. * * @name Phaser.Input.Keyboard.KeyCodes.ESC - * @type {integer} + * @type {number} * @since 3.0.0 */ ESC: 27, @@ -30565,7 +34420,7 @@ var KeyCodes = { * The SPACE key. * * @name Phaser.Input.Keyboard.KeyCodes.SPACE - * @type {integer} + * @type {number} * @since 3.0.0 */ SPACE: 32, @@ -30574,7 +34429,7 @@ var KeyCodes = { * The PAGE_UP key. * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP - * @type {integer} + * @type {number} * @since 3.0.0 */ PAGE_UP: 33, @@ -30583,7 +34438,7 @@ var KeyCodes = { * The PAGE_DOWN key. * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ PAGE_DOWN: 34, @@ -30592,7 +34447,7 @@ var KeyCodes = { * The END key. * * @name Phaser.Input.Keyboard.KeyCodes.END - * @type {integer} + * @type {number} * @since 3.0.0 */ END: 35, @@ -30601,7 +34456,7 @@ var KeyCodes = { * The HOME key. * * @name Phaser.Input.Keyboard.KeyCodes.HOME - * @type {integer} + * @type {number} * @since 3.0.0 */ HOME: 36, @@ -30610,7 +34465,7 @@ var KeyCodes = { * The LEFT key. * * @name Phaser.Input.Keyboard.KeyCodes.LEFT - * @type {integer} + * @type {number} * @since 3.0.0 */ LEFT: 37, @@ -30619,7 +34474,7 @@ var KeyCodes = { * The UP key. * * @name Phaser.Input.Keyboard.KeyCodes.UP - * @type {integer} + * @type {number} * @since 3.0.0 */ UP: 38, @@ -30628,7 +34483,7 @@ var KeyCodes = { * The RIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.RIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ RIGHT: 39, @@ -30637,7 +34492,7 @@ var KeyCodes = { * The DOWN key. * * @name Phaser.Input.Keyboard.KeyCodes.DOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ DOWN: 40, @@ -30646,7 +34501,7 @@ var KeyCodes = { * The PRINT_SCREEN key. * * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN - * @type {integer} + * @type {number} * @since 3.0.0 */ PRINT_SCREEN: 42, @@ -30655,7 +34510,7 @@ var KeyCodes = { * The INSERT key. * * @name Phaser.Input.Keyboard.KeyCodes.INSERT - * @type {integer} + * @type {number} * @since 3.0.0 */ INSERT: 45, @@ -30664,7 +34519,7 @@ var KeyCodes = { * The DELETE key. * * @name Phaser.Input.Keyboard.KeyCodes.DELETE - * @type {integer} + * @type {number} * @since 3.0.0 */ DELETE: 46, @@ -30673,7 +34528,7 @@ var KeyCodes = { * The ZERO key. * * @name Phaser.Input.Keyboard.KeyCodes.ZERO - * @type {integer} + * @type {number} * @since 3.0.0 */ ZERO: 48, @@ -30682,7 +34537,7 @@ var KeyCodes = { * The ONE key. * * @name Phaser.Input.Keyboard.KeyCodes.ONE - * @type {integer} + * @type {number} * @since 3.0.0 */ ONE: 49, @@ -30691,7 +34546,7 @@ var KeyCodes = { * The TWO key. * * @name Phaser.Input.Keyboard.KeyCodes.TWO - * @type {integer} + * @type {number} * @since 3.0.0 */ TWO: 50, @@ -30700,7 +34555,7 @@ var KeyCodes = { * The THREE key. * * @name Phaser.Input.Keyboard.KeyCodes.THREE - * @type {integer} + * @type {number} * @since 3.0.0 */ THREE: 51, @@ -30709,7 +34564,7 @@ var KeyCodes = { * The FOUR key. * * @name Phaser.Input.Keyboard.KeyCodes.FOUR - * @type {integer} + * @type {number} * @since 3.0.0 */ FOUR: 52, @@ -30718,7 +34573,7 @@ var KeyCodes = { * The FIVE key. * * @name Phaser.Input.Keyboard.KeyCodes.FIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ FIVE: 53, @@ -30727,7 +34582,7 @@ var KeyCodes = { * The SIX key. * * @name Phaser.Input.Keyboard.KeyCodes.SIX - * @type {integer} + * @type {number} * @since 3.0.0 */ SIX: 54, @@ -30736,7 +34591,7 @@ var KeyCodes = { * The SEVEN key. * * @name Phaser.Input.Keyboard.KeyCodes.SEVEN - * @type {integer} + * @type {number} * @since 3.0.0 */ SEVEN: 55, @@ -30745,7 +34600,7 @@ var KeyCodes = { * The EIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.EIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ EIGHT: 56, @@ -30754,7 +34609,7 @@ var KeyCodes = { * The NINE key. * * @name Phaser.Input.Keyboard.KeyCodes.NINE - * @type {integer} + * @type {number} * @since 3.0.0 */ NINE: 57, @@ -30763,7 +34618,7 @@ var KeyCodes = { * The NUMPAD_ZERO key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_ZERO: 96, @@ -30772,7 +34627,7 @@ var KeyCodes = { * The NUMPAD_ONE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_ONE: 97, @@ -30781,7 +34636,7 @@ var KeyCodes = { * The NUMPAD_TWO key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_TWO: 98, @@ -30790,7 +34645,7 @@ var KeyCodes = { * The NUMPAD_THREE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_THREE: 99, @@ -30799,7 +34654,7 @@ var KeyCodes = { * The NUMPAD_FOUR key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_FOUR: 100, @@ -30808,7 +34663,7 @@ var KeyCodes = { * The NUMPAD_FIVE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_FIVE: 101, @@ -30817,7 +34672,7 @@ var KeyCodes = { * The NUMPAD_SIX key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_SIX: 102, @@ -30826,7 +34681,7 @@ var KeyCodes = { * The NUMPAD_SEVEN key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_SEVEN: 103, @@ -30835,7 +34690,7 @@ var KeyCodes = { * The NUMPAD_EIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_EIGHT: 104, @@ -30844,7 +34699,7 @@ var KeyCodes = { * The NUMPAD_NINE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_NINE: 105, @@ -30853,7 +34708,7 @@ var KeyCodes = { * The Numpad Addition (+) key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD - * @type {integer} + * @type {number} * @since 3.21.0 */ NUMPAD_ADD: 107, @@ -30862,7 +34717,7 @@ var KeyCodes = { * The Numpad Subtraction (-) key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT - * @type {integer} + * @type {number} * @since 3.21.0 */ NUMPAD_SUBTRACT: 109, @@ -30871,7 +34726,7 @@ var KeyCodes = { * The A key. * * @name Phaser.Input.Keyboard.KeyCodes.A - * @type {integer} + * @type {number} * @since 3.0.0 */ A: 65, @@ -30880,7 +34735,7 @@ var KeyCodes = { * The B key. * * @name Phaser.Input.Keyboard.KeyCodes.B - * @type {integer} + * @type {number} * @since 3.0.0 */ B: 66, @@ -30889,7 +34744,7 @@ var KeyCodes = { * The C key. * * @name Phaser.Input.Keyboard.KeyCodes.C - * @type {integer} + * @type {number} * @since 3.0.0 */ C: 67, @@ -30898,7 +34753,7 @@ var KeyCodes = { * The D key. * * @name Phaser.Input.Keyboard.KeyCodes.D - * @type {integer} + * @type {number} * @since 3.0.0 */ D: 68, @@ -30907,7 +34762,7 @@ var KeyCodes = { * The E key. * * @name Phaser.Input.Keyboard.KeyCodes.E - * @type {integer} + * @type {number} * @since 3.0.0 */ E: 69, @@ -30916,7 +34771,7 @@ var KeyCodes = { * The F key. * * @name Phaser.Input.Keyboard.KeyCodes.F - * @type {integer} + * @type {number} * @since 3.0.0 */ F: 70, @@ -30925,7 +34780,7 @@ var KeyCodes = { * The G key. * * @name Phaser.Input.Keyboard.KeyCodes.G - * @type {integer} + * @type {number} * @since 3.0.0 */ G: 71, @@ -30934,7 +34789,7 @@ var KeyCodes = { * The H key. * * @name Phaser.Input.Keyboard.KeyCodes.H - * @type {integer} + * @type {number} * @since 3.0.0 */ H: 72, @@ -30943,7 +34798,7 @@ var KeyCodes = { * The I key. * * @name Phaser.Input.Keyboard.KeyCodes.I - * @type {integer} + * @type {number} * @since 3.0.0 */ I: 73, @@ -30952,7 +34807,7 @@ var KeyCodes = { * The J key. * * @name Phaser.Input.Keyboard.KeyCodes.J - * @type {integer} + * @type {number} * @since 3.0.0 */ J: 74, @@ -30961,7 +34816,7 @@ var KeyCodes = { * The K key. * * @name Phaser.Input.Keyboard.KeyCodes.K - * @type {integer} + * @type {number} * @since 3.0.0 */ K: 75, @@ -30970,7 +34825,7 @@ var KeyCodes = { * The L key. * * @name Phaser.Input.Keyboard.KeyCodes.L - * @type {integer} + * @type {number} * @since 3.0.0 */ L: 76, @@ -30979,7 +34834,7 @@ var KeyCodes = { * The M key. * * @name Phaser.Input.Keyboard.KeyCodes.M - * @type {integer} + * @type {number} * @since 3.0.0 */ M: 77, @@ -30988,7 +34843,7 @@ var KeyCodes = { * The N key. * * @name Phaser.Input.Keyboard.KeyCodes.N - * @type {integer} + * @type {number} * @since 3.0.0 */ N: 78, @@ -30997,7 +34852,7 @@ var KeyCodes = { * The O key. * * @name Phaser.Input.Keyboard.KeyCodes.O - * @type {integer} + * @type {number} * @since 3.0.0 */ O: 79, @@ -31006,7 +34861,7 @@ var KeyCodes = { * The P key. * * @name Phaser.Input.Keyboard.KeyCodes.P - * @type {integer} + * @type {number} * @since 3.0.0 */ P: 80, @@ -31015,7 +34870,7 @@ var KeyCodes = { * The Q key. * * @name Phaser.Input.Keyboard.KeyCodes.Q - * @type {integer} + * @type {number} * @since 3.0.0 */ Q: 81, @@ -31024,7 +34879,7 @@ var KeyCodes = { * The R key. * * @name Phaser.Input.Keyboard.KeyCodes.R - * @type {integer} + * @type {number} * @since 3.0.0 */ R: 82, @@ -31033,7 +34888,7 @@ var KeyCodes = { * The S key. * * @name Phaser.Input.Keyboard.KeyCodes.S - * @type {integer} + * @type {number} * @since 3.0.0 */ S: 83, @@ -31042,7 +34897,7 @@ var KeyCodes = { * The T key. * * @name Phaser.Input.Keyboard.KeyCodes.T - * @type {integer} + * @type {number} * @since 3.0.0 */ T: 84, @@ -31051,7 +34906,7 @@ var KeyCodes = { * The U key. * * @name Phaser.Input.Keyboard.KeyCodes.U - * @type {integer} + * @type {number} * @since 3.0.0 */ U: 85, @@ -31060,7 +34915,7 @@ var KeyCodes = { * The V key. * * @name Phaser.Input.Keyboard.KeyCodes.V - * @type {integer} + * @type {number} * @since 3.0.0 */ V: 86, @@ -31069,7 +34924,7 @@ var KeyCodes = { * The W key. * * @name Phaser.Input.Keyboard.KeyCodes.W - * @type {integer} + * @type {number} * @since 3.0.0 */ W: 87, @@ -31078,7 +34933,7 @@ var KeyCodes = { * The X key. * * @name Phaser.Input.Keyboard.KeyCodes.X - * @type {integer} + * @type {number} * @since 3.0.0 */ X: 88, @@ -31087,7 +34942,7 @@ var KeyCodes = { * The Y key. * * @name Phaser.Input.Keyboard.KeyCodes.Y - * @type {integer} + * @type {number} * @since 3.0.0 */ Y: 89, @@ -31096,7 +34951,7 @@ var KeyCodes = { * The Z key. * * @name Phaser.Input.Keyboard.KeyCodes.Z - * @type {integer} + * @type {number} * @since 3.0.0 */ Z: 90, @@ -31105,7 +34960,7 @@ var KeyCodes = { * The F1 key. * * @name Phaser.Input.Keyboard.KeyCodes.F1 - * @type {integer} + * @type {number} * @since 3.0.0 */ F1: 112, @@ -31114,7 +34969,7 @@ var KeyCodes = { * The F2 key. * * @name Phaser.Input.Keyboard.KeyCodes.F2 - * @type {integer} + * @type {number} * @since 3.0.0 */ F2: 113, @@ -31123,7 +34978,7 @@ var KeyCodes = { * The F3 key. * * @name Phaser.Input.Keyboard.KeyCodes.F3 - * @type {integer} + * @type {number} * @since 3.0.0 */ F3: 114, @@ -31132,7 +34987,7 @@ var KeyCodes = { * The F4 key. * * @name Phaser.Input.Keyboard.KeyCodes.F4 - * @type {integer} + * @type {number} * @since 3.0.0 */ F4: 115, @@ -31141,7 +34996,7 @@ var KeyCodes = { * The F5 key. * * @name Phaser.Input.Keyboard.KeyCodes.F5 - * @type {integer} + * @type {number} * @since 3.0.0 */ F5: 116, @@ -31150,7 +35005,7 @@ var KeyCodes = { * The F6 key. * * @name Phaser.Input.Keyboard.KeyCodes.F6 - * @type {integer} + * @type {number} * @since 3.0.0 */ F6: 117, @@ -31159,7 +35014,7 @@ var KeyCodes = { * The F7 key. * * @name Phaser.Input.Keyboard.KeyCodes.F7 - * @type {integer} + * @type {number} * @since 3.0.0 */ F7: 118, @@ -31168,7 +35023,7 @@ var KeyCodes = { * The F8 key. * * @name Phaser.Input.Keyboard.KeyCodes.F8 - * @type {integer} + * @type {number} * @since 3.0.0 */ F8: 119, @@ -31177,7 +35032,7 @@ var KeyCodes = { * The F9 key. * * @name Phaser.Input.Keyboard.KeyCodes.F9 - * @type {integer} + * @type {number} * @since 3.0.0 */ F9: 120, @@ -31186,7 +35041,7 @@ var KeyCodes = { * The F10 key. * * @name Phaser.Input.Keyboard.KeyCodes.F10 - * @type {integer} + * @type {number} * @since 3.0.0 */ F10: 121, @@ -31195,7 +35050,7 @@ var KeyCodes = { * The F11 key. * * @name Phaser.Input.Keyboard.KeyCodes.F11 - * @type {integer} + * @type {number} * @since 3.0.0 */ F11: 122, @@ -31204,7 +35059,7 @@ var KeyCodes = { * The F12 key. * * @name Phaser.Input.Keyboard.KeyCodes.F12 - * @type {integer} + * @type {number} * @since 3.0.0 */ F12: 123, @@ -31213,7 +35068,7 @@ var KeyCodes = { * The SEMICOLON key. * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON - * @type {integer} + * @type {number} * @since 3.0.0 */ SEMICOLON: 186, @@ -31222,7 +35077,7 @@ var KeyCodes = { * The PLUS key. * * @name Phaser.Input.Keyboard.KeyCodes.PLUS - * @type {integer} + * @type {number} * @since 3.0.0 */ PLUS: 187, @@ -31231,7 +35086,7 @@ var KeyCodes = { * The COMMA key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA: 188, @@ -31240,7 +35095,7 @@ var KeyCodes = { * The MINUS key. * * @name Phaser.Input.Keyboard.KeyCodes.MINUS - * @type {integer} + * @type {number} * @since 3.0.0 */ MINUS: 189, @@ -31249,7 +35104,7 @@ var KeyCodes = { * The PERIOD key. * * @name Phaser.Input.Keyboard.KeyCodes.PERIOD - * @type {integer} + * @type {number} * @since 3.0.0 */ PERIOD: 190, @@ -31258,7 +35113,7 @@ var KeyCodes = { * The FORWARD_SLASH key. * * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH - * @type {integer} + * @type {number} * @since 3.0.0 */ FORWARD_SLASH: 191, @@ -31267,7 +35122,7 @@ var KeyCodes = { * The BACK_SLASH key. * * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH - * @type {integer} + * @type {number} * @since 3.0.0 */ BACK_SLASH: 220, @@ -31276,7 +35131,7 @@ var KeyCodes = { * The QUOTES key. * * @name Phaser.Input.Keyboard.KeyCodes.QUOTES - * @type {integer} + * @type {number} * @since 3.0.0 */ QUOTES: 222, @@ -31285,7 +35140,7 @@ var KeyCodes = { * The BACKTICK key. * * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK - * @type {integer} + * @type {number} * @since 3.0.0 */ BACKTICK: 192, @@ -31294,7 +35149,7 @@ var KeyCodes = { * The OPEN_BRACKET key. * * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET - * @type {integer} + * @type {number} * @since 3.0.0 */ OPEN_BRACKET: 219, @@ -31303,7 +35158,7 @@ var KeyCodes = { * The CLOSED_BRACKET key. * * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET - * @type {integer} + * @type {number} * @since 3.0.0 */ CLOSED_BRACKET: 221, @@ -31312,7 +35167,7 @@ var KeyCodes = { * The SEMICOLON_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ SEMICOLON_FIREFOX: 59, @@ -31321,7 +35176,7 @@ var KeyCodes = { * The COLON key. * * @name Phaser.Input.Keyboard.KeyCodes.COLON - * @type {integer} + * @type {number} * @since 3.0.0 */ COLON: 58, @@ -31330,7 +35185,7 @@ var KeyCodes = { * The COMMA_FIREFOX_WINDOWS key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA_FIREFOX_WINDOWS: 60, @@ -31339,7 +35194,7 @@ var KeyCodes = { * The COMMA_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA_FIREFOX: 62, @@ -31348,7 +35203,7 @@ var KeyCodes = { * The BRACKET_RIGHT_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ BRACKET_RIGHT_FIREFOX: 174, @@ -31357,7 +35212,7 @@ var KeyCodes = { * The BRACKET_LEFT_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ BRACKET_LEFT_FIREFOX: 175 @@ -31367,7 +35222,7 @@ module.exports = KeyCodes; /***/ }), -/* 133 */ +/* 139 */ /***/ (function(module, exports) { /** @@ -31389,7 +35244,7 @@ var CONST = { * * @name Phaser.Scenes.PENDING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING: 0, @@ -31399,7 +35254,7 @@ var CONST = { * * @name Phaser.Scenes.INIT * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ INIT: 1, @@ -31409,7 +35264,7 @@ var CONST = { * * @name Phaser.Scenes.START * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ START: 2, @@ -31419,7 +35274,7 @@ var CONST = { * * @name Phaser.Scenes.LOADING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADING: 3, @@ -31429,7 +35284,7 @@ var CONST = { * * @name Phaser.Scenes.CREATING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ CREATING: 4, @@ -31439,7 +35294,7 @@ var CONST = { * * @name Phaser.Scenes.RUNNING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ RUNNING: 5, @@ -31449,7 +35304,7 @@ var CONST = { * * @name Phaser.Scenes.PAUSED * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSED: 6, @@ -31459,7 +35314,7 @@ var CONST = { * * @name Phaser.Scenes.SLEEPING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ SLEEPING: 7, @@ -31469,7 +35324,7 @@ var CONST = { * * @name Phaser.Scenes.SHUTDOWN * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ SHUTDOWN: 8, @@ -31479,7 +35334,7 @@ var CONST = { * * @name Phaser.Scenes.DESTROYED * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ DESTROYED: 9 @@ -31490,7 +35345,7 @@ module.exports = CONST; /***/ }), -/* 134 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31499,7 +35354,7 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Creates a new Object using all values from obj1 and obj2. @@ -31535,7 +35390,7 @@ module.exports = Merge; /***/ }), -/* 135 */ +/* 141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31546,13 +35401,13 @@ module.exports = Merge; */ var Class = __webpack_require__(0); -var Clone = __webpack_require__(69); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(61); -var GameEvents = __webpack_require__(21); +var Clone = __webpack_require__(76); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var GameEvents = __webpack_require__(23); var NOOP = __webpack_require__(1); -var GetAll = __webpack_require__(193); -var GetFirst = __webpack_require__(395); +var GetAll = __webpack_require__(198); +var GetFirst = __webpack_require__(405); /** * @classdesc @@ -32249,7 +36104,7 @@ module.exports = BaseSoundManager; /***/ }), -/* 136 */ +/* 142 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32260,9 +36115,9 @@ module.exports = BaseSoundManager; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(61); -var Extend = __webpack_require__(19); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(66); +var Extend = __webpack_require__(18); var NOOP = __webpack_require__(1); /** @@ -32749,7 +36604,7 @@ module.exports = BaseSound; /***/ }), -/* 137 */ +/* 143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32758,824 +36613,8 @@ module.exports = BaseSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(194); -var Class = __webpack_require__(0); -var NOOP = __webpack_require__(1); -var StableSort = __webpack_require__(139); - -/** - * @callback EachListCallback - * - * @param {I} item - The item which is currently being processed. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. - */ - -/** - * @classdesc - * List is a generic implementation of an ordered list which contains utility methods for retrieving, manipulating, and iterating items. - * - * @class List - * @memberof Phaser.Structs - * @constructor - * @since 3.0.0 - * - * @generic T - * - * @param {*} parent - The parent of this list. - */ -var List = new Class({ - - initialize: - - function List (parent) - { - /** - * The parent of this list. - * - * @name Phaser.Structs.List#parent - * @type {*} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * The objects that belong to this collection. - * - * @genericUse {T[]} - [$type] - * - * @name Phaser.Structs.List#list - * @type {Array.<*>} - * @default [] - * @since 3.0.0 - */ - this.list = []; - - /** - * The index of the current element. - * - * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. - * - * @name Phaser.Structs.List#position - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.position = 0; - - /** - * A callback that is invoked every time a child is added to this list. - * - * @name Phaser.Structs.List#addCallback - * @type {function} - * @since 3.4.0 - */ - this.addCallback = NOOP; - - /** - * A callback that is invoked every time a child is removed from this list. - * - * @name Phaser.Structs.List#removeCallback - * @type {function} - * @since 3.4.0 - */ - this.removeCallback = NOOP; - - /** - * The property key to sort by. - * - * @name Phaser.Structs.List#_sortKey - * @type {string} - * @since 3.4.0 - */ - this._sortKey = ''; - }, - - /** - * Adds the given item to the end of the list. Each item must be unique. - * - * @method Phaser.Structs.List#add - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*|Array.<*>} child - The item, or array of items, to add to the list. - * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. - * - * @return {*} The list's underlying array. - */ - add: function (child, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.Add(this.list, child); - } - else - { - return ArrayUtils.Add(this.list, child, 0, this.addCallback, this); - } - }, - - /** - * Adds an item to list, starting at a specified index. Each item must be unique within the list. - * - * @method Phaser.Structs.List#addAt - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item, or array of items, to add to the list. - * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted. - * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. - * - * @return {*} The List's underlying array. - */ - addAt: function (child, index, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.AddAt(this.list, child, index); - } - else - { - return ArrayUtils.AddAt(this.list, child, index, 0, this.addCallback, this); - } - }, - - /** - * Retrieves the item at a given position inside the List. - * - * @method Phaser.Structs.List#getAt - * @since 3.0.0 - * - * @genericUse {T} - [$return] - * - * @param {integer} index - The index of the item. - * - * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. - */ - getAt: function (index) - { - return this.list[index]; - }, - - /** - * Locates an item within the List and returns its index. - * - * @method Phaser.Structs.List#getIndex - * @since 3.0.0 - * - * @genericUse {T} - [child] - * - * @param {*} child - The item to locate. - * - * @return {integer} The index of the item within the List, or -1 if it's not in the List. - */ - getIndex: function (child) - { - // Return -1 if given child isn't a child of this display list - return this.list.indexOf(child); - }, - - /** - * Sort the contents of this List so the items are in order based on the given property. - * For example, `sort('alpha')` would sort the List contents based on the value of their `alpha` property. - * - * @method Phaser.Structs.List#sort - * @since 3.0.0 - * - * @genericUse {T[]} - [children,$return] - * - * @param {string} property - The property to lexically sort by. - * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean. - * - * @return {Phaser.Structs.List} This List object. - */ - sort: function (property, handler) - { - if (!property) - { - return this; - } - - if (handler === undefined) - { - handler = function (childA, childB) - { - return childA[property] - childB[property]; - }; - } - - StableSort(this.list, handler); - - return this; - }, - - /** - * Searches for the first instance of a child with its `name` - * property matching the given argument. Should more than one child have - * the same name only the first is returned. - * - * @method Phaser.Structs.List#getByName - * @since 3.0.0 - * - * @genericUse {T | null} - [$return] - * - * @param {string} name - The name to search for. - * - * @return {?*} The first child with a matching name, or null if none were found. - */ - getByName: function (name) - { - return ArrayUtils.GetFirst(this.list, 'name', name); - }, - - /** - * Returns a random child from the group. - * - * @method Phaser.Structs.List#getRandom - * @since 3.0.0 - * - * @genericUse {T | null} - [$return] - * - * @param {integer} [startIndex=0] - Offset from the front of the group (lowest child). - * @param {integer} [length=(to top)] - Restriction on the number of values you want to randomly select from. - * - * @return {?*} A random child of this Group. - */ - getRandom: function (startIndex, length) - { - return ArrayUtils.GetRandom(this.list, startIndex, length); - }, - - /** - * Returns the first element in a given part of the List which matches a specific criterion. - * - * @method Phaser.Structs.List#getFirst - * @since 3.0.0 - * - * @genericUse {T | null} - [$return] - * - * @param {string} property - The name of the property to test or a falsey value to have no criterion. - * @param {*} value - The value to test the `property` against, or `undefined` to allow any value and only check for existence. - * @param {number} [startIndex=0] - The position in the List to start the search at. - * @param {number} [endIndex] - The position in the List to optionally stop the search at. It won't be checked. - * - * @return {?*} The first item which matches the given criterion, or `null` if no such item exists. - */ - getFirst: function (property, value, startIndex, endIndex) - { - return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex); - }, - - /** - * Returns all children in this List. - * - * You can optionally specify a matching criteria using the `property` and `value` arguments. - * - * For example: `getAll('parent')` would return only children that have a property called `parent`. - * - * You can also specify a value to compare the property to: - * - * `getAll('visible', true)` would return only children that have their visible property set to `true`. - * - * Optionally you can specify a start and end index. For example if this List had 100 children, - * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only - * the first 50 children in the List. - * - * @method Phaser.Structs.List#getAll - * @since 3.0.0 - * - * @genericUse {T} - [value] - * @genericUse {T[]} - [$return] - * - * @param {string} [property] - An optional property to test against the value argument. - * @param {*} [value] - If property is set then Child.property must strictly equal this value to be included in the results. - * @param {integer} [startIndex] - The first child index to start the search from. - * @param {integer} [endIndex] - The last child index to search up until. - * - * @return {Array.<*>} All items of the List which match the given criterion, if any. - */ - getAll: function (property, value, startIndex, endIndex) - { - return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex); - }, - - /** - * Returns the total number of items in the List which have a property matching the given value. - * - * @method Phaser.Structs.List#count - * @since 3.0.0 - * - * @genericUse {T} - [value] - * - * @param {string} property - The property to test on each item. - * @param {*} value - The value to test the property against. - * - * @return {integer} The total number of matching elements. - */ - count: function (property, value) - { - return ArrayUtils.CountAllMatching(this.list, property, value); - }, - - /** - * Swaps the positions of two items in the list. - * - * @method Phaser.Structs.List#swap - * @since 3.0.0 - * - * @genericUse {T} - [child1,child2] - * - * @param {*} child1 - The first item to swap. - * @param {*} child2 - The second item to swap. - */ - swap: function (child1, child2) - { - ArrayUtils.Swap(this.list, child1, child2); - }, - - /** - * Moves an item in the List to a new position. - * - * @method Phaser.Structs.List#moveTo - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to move. - * @param {integer} index - Moves an item in the List to a new position. - * - * @return {*} The item that was moved. - */ - moveTo: function (child, index) - { - return ArrayUtils.MoveTo(this.list, child, index); - }, - - /** - * Removes one or many items from the List. - * - * @method Phaser.Structs.List#remove - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item, or array of items, to remove. - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {*} The item, or array of items, which were successfully removed from the List. - */ - remove: function (child, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.Remove(this.list, child); - } - else - { - return ArrayUtils.Remove(this.list, child, this.removeCallback, this); - } - }, - - /** - * Removes the item at the given position in the List. - * - * @method Phaser.Structs.List#removeAt - * @since 3.0.0 - * - * @genericUse {T} - [$return] - * - * @param {integer} index - The position to remove the item from. - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {*} The item that was removed. - */ - removeAt: function (index, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.RemoveAt(this.list, index); - } - else - { - return ArrayUtils.RemoveAt(this.list, index, this.removeCallback, this); - } - }, - - /** - * Removes the items within the given range in the List. - * - * @method Phaser.Structs.List#removeBetween - * @since 3.0.0 - * - * @genericUse {T[]} - [$return] - * - * @param {integer} [startIndex=0] - The index to start removing from. - * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed. - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {Array.<*>} An array of the items which were removed. - */ - removeBetween: function (startIndex, endIndex, skipCallback) - { - if (skipCallback) - { - return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex); - } - else - { - return ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeCallback, this); - } - }, - - /** - * Removes all the items. - * - * @method Phaser.Structs.List#removeAll - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.List.} - [$return] - * - * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. - * - * @return {Phaser.Structs.List} This List object. - */ - removeAll: function (skipCallback) - { - var i = this.list.length; - - while (i--) - { - this.remove(this.list[i], skipCallback); - } - - return this; - }, - - /** - * Brings the given child to the top of this List. - * - * @method Phaser.Structs.List#bringToTop - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to bring to the top of the List. - * - * @return {*} The item which was moved. - */ - bringToTop: function (child) - { - return ArrayUtils.BringToTop(this.list, child); - }, - - /** - * Sends the given child to the bottom of this List. - * - * @method Phaser.Structs.List#sendToBack - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to send to the back of the list. - * - * @return {*} The item which was moved. - */ - sendToBack: function (child) - { - return ArrayUtils.SendToBack(this.list, child); - }, - - /** - * Moves the given child up one place in this group unless it's already at the top. - * - * @method Phaser.Structs.List#moveUp - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to move up. - * - * @return {*} The item which was moved. - */ - moveUp: function (child) - { - ArrayUtils.MoveUp(this.list, child); - - return child; - }, - - /** - * Moves the given child down one place in this group unless it's already at the bottom. - * - * @method Phaser.Structs.List#moveDown - * @since 3.0.0 - * - * @genericUse {T} - [child,$return] - * - * @param {*} child - The item to move down. - * - * @return {*} The item which was moved. - */ - moveDown: function (child) - { - ArrayUtils.MoveDown(this.list, child); - - return child; - }, - - /** - * Reverses the order of all children in this List. - * - * @method Phaser.Structs.List#reverse - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.List.} - [$return] - * - * @return {Phaser.Structs.List} This List object. - */ - reverse: function () - { - this.list.reverse(); - - return this; - }, - - /** - * Shuffles the items in the list. - * - * @method Phaser.Structs.List#shuffle - * @since 3.0.0 - * - * @genericUse {Phaser.Structs.List.} - [$return] - * - * @return {Phaser.Structs.List} This List object. - */ - shuffle: function () - { - ArrayUtils.Shuffle(this.list); - - return this; - }, - - /** - * Replaces a child of this List with the given newChild. The newChild cannot be a member of this List. - * - * @method Phaser.Structs.List#replace - * @since 3.0.0 - * - * @genericUse {T} - [oldChild,newChild,$return] - * - * @param {*} oldChild - The child in this List that will be replaced. - * @param {*} newChild - The child to be inserted into this List. - * - * @return {*} Returns the oldChild that was replaced within this group. - */ - replace: function (oldChild, newChild) - { - return ArrayUtils.Replace(this.list, oldChild, newChild); - }, - - /** - * Checks if an item exists within the List. - * - * @method Phaser.Structs.List#exists - * @since 3.0.0 - * - * @genericUse {T} - [child] - * - * @param {*} child - The item to check for the existence of. - * - * @return {boolean} `true` if the item is found in the list, otherwise `false`. - */ - exists: function (child) - { - return (this.list.indexOf(child) > -1); - }, - - /** - * Sets the property `key` to the given value on all members of this List. - * - * @method Phaser.Structs.List#setAll - * @since 3.0.0 - * - * @genericUse {T} - [value] - * - * @param {string} property - The name of the property to set. - * @param {*} value - The value to set the property to. - * @param {integer} [startIndex] - The first child index to start the search from. - * @param {integer} [endIndex] - The last child index to search up until. - */ - setAll: function (property, value, startIndex, endIndex) - { - ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex); - - return this; - }, - - /** - * Passes all children to the given callback. - * - * @method Phaser.Structs.List#each - * @since 3.0.0 - * - * @genericUse {EachListCallback.} - [callback] - * - * @param {EachListCallback} callback - The function to call. - * @param {*} [context] - Value to use as `this` when executing callback. - * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. - */ - each: function (callback, context) - { - var args = [ null ]; - - for (var i = 2; i < arguments.length; i++) - { - args.push(arguments[i]); - } - - for (i = 0; i < this.list.length; i++) - { - args[0] = this.list[i]; - - callback.apply(context, args); - } - }, - - /** - * Clears the List and recreates its internal array. - * - * @method Phaser.Structs.List#shutdown - * @since 3.0.0 - */ - shutdown: function () - { - this.removeAll(); - - this.list = []; - }, - - /** - * Destroys this List. - * - * @method Phaser.Structs.List#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAll(); - - this.parent = null; - this.addCallback = null; - this.removeCallback = null; - }, - - /** - * The number of items inside the List. - * - * @name Phaser.Structs.List#length - * @type {integer} - * @readonly - * @since 3.0.0 - */ - length: { - - get: function () - { - return this.list.length; - } - - }, - - /** - * The first item in the List or `null` for an empty List. - * - * @name Phaser.Structs.List#first - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - first: { - - get: function () - { - this.position = 0; - - if (this.list.length > 0) - { - return this.list[0]; - } - else - { - return null; - } - } - - }, - - /** - * The last item in the List, or `null` for an empty List. - * - * @name Phaser.Structs.List#last - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - last: { - - get: function () - { - if (this.list.length > 0) - { - this.position = this.list.length - 1; - - return this.list[this.position]; - } - else - { - return null; - } - } - - }, - - /** - * The next item in the List, or `null` if the entire List has been traversed. - * - * This property can be read successively after reading {@link #first} or manually setting the {@link #position} to iterate the List. - * - * @name Phaser.Structs.List#next - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - next: { - - get: function () - { - if (this.position < this.list.length) - { - this.position++; - - return this.list[this.position]; - } - else - { - return null; - } - } - - }, - - /** - * The previous item in the List, or `null` if the entire List has been traversed. - * - * This property can be read successively after reading {@link #last} or manually setting the {@link #position} to iterate the List backwards. - * - * @name Phaser.Structs.List#previous - * @genericUse {T} - [$type] - * @type {*} - * @readonly - * @since 3.0.0 - */ - previous: { - - get: function () - { - if (this.position > 0) - { - this.position--; - - return this.list[this.position]; - } - else - { - return null; - } - } - - } - -}); - -module.exports = List; - - -/***/ }), -/* 138 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CheckMatrix = __webpack_require__(195); -var TransposeMatrix = __webpack_require__(402); +var CheckMatrix = __webpack_require__(200); +var TransposeMatrix = __webpack_require__(412); /** * Rotates the array matrix based on the given rotation value. @@ -33585,6 +36624,20 @@ var TransposeMatrix = __webpack_require__(402); * * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateMatrix * @since 3.0.0 * @@ -33637,183 +36690,7 @@ module.exports = RotateMatrix; /***/ }), -/* 139 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @author Angry Bytes (and contributors) - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The comparator function. - * - * @ignore - * - * @param {*} a - The first item to test. - * @param {*} b - The second itemt to test. - * - * @return {boolean} True if they localCompare, otherwise false. - */ -function Compare (a, b) -{ - return String(a).localeCompare(b); -} - -/** - * Process the array contents. - * - * @ignore - * - * @param {array} array - The array to process. - * @param {function} compare - The comparison function. - * - * @return {array} - The processed array. - */ -function Process (array, compare) -{ - // Short-circuit when there's nothing to sort. - var len = array.length; - - if (len <= 1) - { - return array; - } - - // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. - // Chunks are the size of the left or right hand in merge sort. - // Stop when the left-hand covers all of the array. - var buffer = new Array(len); - - for (var chk = 1; chk < len; chk *= 2) - { - RunPass(array, compare, chk, buffer); - - var tmp = array; - - array = buffer; - - buffer = tmp; - } - - return array; -} - -/** - * Run a single pass with the given chunk size. - * - * @ignore - * - * @param {array} arr - The array to run the pass on. - * @param {function} comp - The comparison function. - * @param {number} chk - The number of iterations. - * @param {array} result - The array to store the result in. - */ -function RunPass (arr, comp, chk, result) -{ - var len = arr.length; - var i = 0; - - // Step size / double chunk size. - var dbl = chk * 2; - - // Bounds of the left and right chunks. - var l, r, e; - - // Iterators over the left and right chunk. - var li, ri; - - // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) - { - r = l + chk; - e = r + chk; - - if (r > len) - { - r = len; - } - - if (e > len) - { - e = len; - } - - // Iterate both chunks in parallel. - li = l; - ri = r; - - while (true) - { - // Compare the chunks. - if (li < r && ri < e) - { - // This works for a regular `sort()` compatible comparator, - // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) - { - result[i++] = arr[li++]; - } - else - { - result[i++] = arr[ri++]; - } - } - else if (li < r) - { - // Nothing to compare, just flush what's left. - result[i++] = arr[li++]; - } - else if (ri < e) - { - result[i++] = arr[ri++]; - } - else - { - // Both iterators are at the chunk ends. - break; - } - } - } -} - -/** - * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. - * - * This is an implementation of merge sort, without recursion. - * - * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable - * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 - * - * @param {array} array - The input array to be sorted. - * @param {function} [compare] - The comparison function. - * - * @return {array} The sorted result. - */ -var StableSort = function (array, compare) -{ - if (compare === undefined) { compare = Compare; } - - var result = Process(array, compare); - - // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. - if (result !== array) - { - RunPass(result, null, array.length, array); - } - - return array; -}; - -module.exports = StableSort; - - -/***/ }), -/* 140 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33823,15 +36700,14 @@ module.exports = StableSort; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GetColorFromValue = __webpack_require__(119); -var GetBitmapTextSize = __webpack_require__(969); -var ParseFromAtlas = __webpack_require__(970); -var ParseXMLBitmapFont = __webpack_require__(198); +var GetBitmapTextSize = __webpack_require__(1026); +var ParseFromAtlas = __webpack_require__(1027); +var ParseXMLBitmapFont = __webpack_require__(203); var Rectangle = __webpack_require__(9); -var Render = __webpack_require__(971); +var Render = __webpack_require__(1028); /** * @classdesc @@ -33879,7 +36755,7 @@ var Render = __webpack_require__(971); * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size of this Bitmap Text. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. */ var BitmapText = new Class({ @@ -33983,7 +36859,7 @@ var BitmapText = new Class({ * The alignment position is based on the longest line of text. * * @name Phaser.GameObjects.BitmapText#_align - * @type {integer} + * @type {number} * @private * @since 3.11.0 */ @@ -34064,22 +36940,13 @@ var BitmapText = new Class({ /** * The color of the drop shadow. * - * @name Phaser.GameObjects.BitmapText#_dropShadowColor - * @type {number} - * @private - * @since 3.50.0 - */ - this._dropShadowColor = 0x000000; - - /** - * The GL encoded color of the drop shadow. + * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. * - * @name Phaser.GameObjects.BitmapText#_dropShadowColorGL + * @name Phaser.GameObjects.BitmapText#dropShadowColor * @type {number} - * @private * @since 3.50.0 */ - this._dropShadowColorGL = 0x000000; + this.dropShadowColor = 0x000000; /** * The alpha value of the drop shadow. @@ -34304,10 +37171,10 @@ var BitmapText = new Class({ * @param {number} [start=0] - The starting character to begin the tint at. If negative, it counts back from the end of the text. * @param {number} [length=1] - The number of characters to tint. Remember that spaces count as a character too. Pass -1 to tint all characters from `start` onwards. * @param {boolean} [tintFill=false] - Use a fill-based tint (true), or an additive tint (false) - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the character. If not other values are given this value is applied evenly, tinting the whole character. - * @param {integer} [topRight] - The tint being applied to the top-right of the character. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the character. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the character. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the character. If not other values are given this value is applied evenly, tinting the whole character. + * @param {number} [topRight] - The tint being applied to the top-right of the character. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the character. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the character. * * @return {this} This BitmapText Object. */ @@ -34354,27 +37221,23 @@ var BitmapText = new Class({ else { var tintEffect = (tintFill) ? 1 : 0; - var tintTL = GetColorFromValue(topLeft); - var tintTR = GetColorFromValue(topRight); - var tintBL = GetColorFromValue(bottomLeft); - var tintBR = GetColorFromValue(bottomRight); if (color) { color.tintEffect = tintEffect; - color.tintTL = tintTL; - color.tintTR = tintTR; - color.tintBL = tintBL; - color.tintBR = tintBR; + color.tintTL = topLeft; + color.tintTR = topRight; + color.tintBL = bottomLeft; + color.tintBR = bottomRight; } else { charColors[i] = { tintEffect: tintEffect, - tintTL: tintTL, - tintTR: tintTR, - tintBL: tintBL, - tintBR: tintBR + tintTL: topLeft, + tintTR: topRight, + tintBL: bottomLeft, + tintBR: bottomRight }; } } @@ -34417,10 +37280,10 @@ var BitmapText = new Class({ * @param {(string|number)} word - The word to search for. Either a string, or an index of the word in the words array. * @param {number} [count=1] - The number of matching words to tint. Pass -1 to tint all matching words. * @param {boolean} [tintFill=false] - Use a fill-based tint (true), or an additive tint (false) - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the word. If not other values are given this value is applied evenly, tinting the whole word. - * @param {integer} [topRight] - The tint being applied to the top-right of the word. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the word. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the word. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the word. If not other values are given this value is applied evenly, tinting the whole word. + * @param {number} [topRight] - The tint being applied to the top-right of the word. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the word. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the word. * * @return {this} This BitmapText Object. */ @@ -34571,7 +37434,7 @@ var BitmapText = new Class({ * * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {number} [size] - The font size of this Bitmap Text. If not specified the current size will be used. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. * * @return {this} This BitmapText Object. */ @@ -34649,7 +37512,7 @@ var BitmapText = new Class({ * The alignment position is based on the longest line of text. * * @name Phaser.GameObjects.BitmapText#align - * @type {integer} + * @type {number} * @since 3.11.0 */ align: { @@ -34807,31 +37670,6 @@ var BitmapText = new Class({ }, - /** - * The color of the drop shadow. - * - * You can also set this via `Phaser.GameObjects.BitmapText#setDropShadow`. - * - * @name Phaser.GameObjects.BitmapText#dropShadowColor - * @type {number} - * @since 3.50.0 - */ - dropShadowColor: { - - get: function () - { - return this._dropShadowColor; - }, - - set: function (value) - { - this._dropShadowColor = value; - - this._dropShadowColorGL = GetColorFromValue(value); - } - - }, - /** * Build a JSON representation of this Bitmap Text. * @@ -34879,7 +37717,7 @@ var BitmapText = new Class({ * Left align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_LEFT - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_LEFT = 0; @@ -34888,7 +37726,7 @@ BitmapText.ALIGN_LEFT = 0; * Center align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_CENTER - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_CENTER = 1; @@ -34897,7 +37735,7 @@ BitmapText.ALIGN_CENTER = 1; * Right align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_RIGHT - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_RIGHT = 2; @@ -34915,8 +37753,8 @@ BitmapText.ALIGN_RIGHT = 2; * @param {string} textureKey - The key of the BitmapFont's texture. * @param {string} frameKey - The key of the BitmapFont texture's frame. * @param {string} xmlKey - The key of the XML data of the font to parse. - * @param {integer} [xSpacing] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing] - The y-axis spacing to add to the line height. * * @return {boolean} Whether the parsing was successful or not. */ @@ -34930,8 +37768,8 @@ BitmapText.ParseFromAtlas = ParseFromAtlas; * * @param {XMLDocument} xml - The XML Document to parse the font from. * @param {Phaser.Textures.Frame} frame - The texture frame to take into account when creating the uv data. - * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing=0] - The y-axis spacing to add to the line height. * * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. */ @@ -34941,7 +37779,7 @@ module.exports = BitmapText; /***/ }), -/* 141 */ +/* 145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35360,7 +38198,7 @@ var Set = new Class({ * Increasing the size larger than the current size has no effect. * * @name Phaser.Structs.Set#size - * @type {integer} + * @type {number} * @since 3.0.0 */ size: { @@ -35390,216 +38228,7 @@ module.exports = Set; /***/ }), -/* 142 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameObject = __webpack_require__(14); -var MeshRender = __webpack_require__(1097); -var NOOP = __webpack_require__(1); - -/** - * @classdesc - * A Mesh Game Object. - * - * @class Mesh - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.GameObjects - * @constructor - * @webglOnly - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Mask - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.Size - * @extends Phaser.GameObjects.Components.Texture - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * @extends Phaser.GameObjects.Components.ScrollFactor - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number[]} vertices - An array containing the vertices data for this Mesh. - * @param {number[]} uv - An array containing the uv data for this Mesh. - * @param {number[]} colors - An array containing the color data for this Mesh. - * @param {number[]} alphas - An array containing the alpha data for this Mesh. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Mesh = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.BlendMode, - Components.Depth, - Components.Mask, - Components.Pipeline, - Components.Size, - Components.Texture, - Components.Transform, - Components.Visible, - Components.ScrollFactor, - MeshRender - ], - - initialize: - - function Mesh (scene, x, y, vertices, uv, colors, alphas, texture, frame) - { - GameObject.call(this, scene, 'Mesh'); - - if (vertices.length !== uv.length) - { - throw new Error('Mesh Vertex count must match UV count'); - } - - var verticesUB = (vertices.length / 2) | 0; - - if (colors.length > 0 && colors.length < verticesUB) - { - throw new Error('Mesh Color count must match Vertex count'); - } - - if (alphas.length > 0 && alphas.length < verticesUB) - { - throw new Error('Mesh Alpha count must match Vertex count'); - } - - var i; - - if (colors.length === 0) - { - for (i = 0; i < verticesUB; ++i) - { - colors[i] = 0xFFFFFF; - } - } - - if (alphas.length === 0) - { - for (i = 0; i < verticesUB; ++i) - { - alphas[i] = 1.0; - } - } - - /** - * An array containing the vertices data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#vertices - * @type {Float32Array} - * @since 3.0.0 - */ - this.vertices = new Float32Array(vertices); - - /** - * An array containing the uv data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#uv - * @type {Float32Array} - * @since 3.0.0 - */ - this.uv = new Float32Array(uv); - - /** - * An array containing the color data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#colors - * @type {Uint32Array} - * @since 3.0.0 - */ - this.colors = new Uint32Array(colors); - - /** - * An array containing the alpha data for this Mesh. - * - * @name Phaser.GameObjects.Mesh#alphas - * @type {Float32Array} - * @since 3.0.0 - */ - this.alphas = new Float32Array(alphas); - - /** - * Fill or additive mode used when blending the color values? - * - * @name Phaser.GameObjects.Mesh#tintFill - * @type {boolean} - * @default false - * @since 3.11.0 - */ - this.tintFill = false; - - this.setTexture(texture, frame); - this.setPosition(x, y); - this.setSizeToFrame(); - this.initPipeline(); - }, - - /** - * This method is left intentionally empty and does not do anything. - * It is retained to allow a Mesh or Quad to be added to a Container. - * - * @method Phaser.GameObjects.Mesh#setAlpha - * @since 3.17.0 - */ - setAlpha: NOOP - -}); - -module.exports = Mesh; - - -/***/ }), -/* 143 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if two Rectangles intersect. - * - * A Rectangle intersects another Rectangle if any part of its bounds is within the other Rectangle's bounds. - * As such, the two Rectangles are considered "solid". - * A Rectangle with no width or no height will never intersect another Rectangle. - * - * @function Phaser.Geom.Intersects.RectangleToRectangle - * @since 3.0.0 - * - * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to check for intersection. - * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to check for intersection. - * - * @return {boolean} `true` if the two Rectangles intersect, otherwise `false`. - */ -var RectangleToRectangle = function (rectA, rectB) -{ - if (rectA.width <= 0 || rectA.height <= 0 || rectB.width <= 0 || rectB.height <= 0) - { - return false; - } - - return !(rectA.right < rectB.x || rectA.bottom < rectB.y || rectA.x > rectB.right || rectA.y > rectB.bottom); -}; - -module.exports = RectangleToRectangle; - - -/***/ }), -/* 144 */ +/* 146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35707,7 +38336,7 @@ module.exports = InputPluginCache; /***/ }), -/* 145 */ +/* 147 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35722,19 +38351,19 @@ module.exports = InputPluginCache; module.exports = { - ANY_KEY_DOWN: __webpack_require__(1239), - ANY_KEY_UP: __webpack_require__(1240), - COMBO_MATCH: __webpack_require__(1241), - DOWN: __webpack_require__(1242), - KEY_DOWN: __webpack_require__(1243), - KEY_UP: __webpack_require__(1244), - UP: __webpack_require__(1245) + ANY_KEY_DOWN: __webpack_require__(1303), + ANY_KEY_UP: __webpack_require__(1304), + COMBO_MATCH: __webpack_require__(1305), + DOWN: __webpack_require__(1306), + KEY_DOWN: __webpack_require__(1307), + KEY_UP: __webpack_require__(1308), + UP: __webpack_require__(1309) }; /***/ }), -/* 146 */ +/* 148 */ /***/ (function(module, exports) { /** @@ -35775,7 +38404,7 @@ module.exports = GetURL; /***/ }), -/* 147 */ +/* 149 */ /***/ (function(module, exports) { /** @@ -35794,7 +38423,7 @@ module.exports = GetURL; * @param {boolean} [async=true] - Should the XHR request use async or not? * @param {string} [user=''] - Optional username for the XHR request. * @param {string} [password=''] - Optional password for the XHR request. - * @param {integer} [timeout=0] - Optional XHR timeout value. + * @param {number} [timeout=0] - Optional XHR timeout value. * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. * * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. @@ -35845,7 +38474,7 @@ module.exports = XHRSettings; /***/ }), -/* 148 */ +/* 150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35855,8 +38484,8 @@ module.exports = XHRSettings; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(228); -var Sprite = __webpack_require__(76); +var Components = __webpack_require__(235); +var Sprite = __webpack_require__(70); /** * @classdesc @@ -35882,6 +38511,7 @@ var Sprite = __webpack_require__(76); * @extends Phaser.Physics.Arcade.Components.Gravity * @extends Phaser.Physics.Arcade.Components.Immovable * @extends Phaser.Physics.Arcade.Components.Mass + * @extends Phaser.Physics.Arcade.Components.Pushable * @extends Phaser.Physics.Arcade.Components.Size * @extends Phaser.Physics.Arcade.Components.Velocity * @extends Phaser.GameObjects.Components.Alpha @@ -35902,7 +38532,7 @@ var Sprite = __webpack_require__(76); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeSprite = new Class({ @@ -35919,6 +38549,7 @@ var ArcadeSprite = new Class({ Components.Gravity, Components.Immovable, Components.Mass, + Components.Pushable, Components.Size, Components.Velocity ], @@ -35946,7 +38577,7 @@ module.exports = ArcadeSprite; /***/ }), -/* 149 */ +/* 151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35955,71 +38586,7 @@ module.exports = ArcadeSprite; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Tilemaps.Components - */ - -module.exports = { - - CalculateFacesAt: __webpack_require__(235), - CalculateFacesWithin: __webpack_require__(53), - Copy: __webpack_require__(1326), - CreateFromTiles: __webpack_require__(1327), - CullTiles: __webpack_require__(1328), - Fill: __webpack_require__(1329), - FilterTiles: __webpack_require__(1330), - FindByIndex: __webpack_require__(1331), - FindTile: __webpack_require__(1332), - ForEachTile: __webpack_require__(1333), - GetTileAt: __webpack_require__(150), - GetTileAtWorldXY: __webpack_require__(1334), - GetTilesWithin: __webpack_require__(24), - GetTilesWithinShape: __webpack_require__(1335), - GetTilesWithinWorldXY: __webpack_require__(1336), - HasTileAt: __webpack_require__(504), - HasTileAtWorldXY: __webpack_require__(1337), - IsInLayerBounds: __webpack_require__(104), - PutTileAt: __webpack_require__(236), - PutTileAtWorldXY: __webpack_require__(1338), - PutTilesAt: __webpack_require__(1339), - Randomize: __webpack_require__(1340), - RemoveTileAt: __webpack_require__(505), - RemoveTileAtWorldXY: __webpack_require__(1341), - RenderDebug: __webpack_require__(1342), - ReplaceByIndex: __webpack_require__(503), - SetCollision: __webpack_require__(1343), - SetCollisionBetween: __webpack_require__(1344), - SetCollisionByExclusion: __webpack_require__(1345), - SetCollisionByProperty: __webpack_require__(1346), - SetCollisionFromCollisionGroup: __webpack_require__(1347), - SetLayerCollisionIndex: __webpack_require__(153), - SetTileCollision: __webpack_require__(65), - SetTileIndexCallback: __webpack_require__(1348), - SetTileLocationCallback: __webpack_require__(1349), - Shuffle: __webpack_require__(1350), - SwapByIndex: __webpack_require__(1351), - TileToWorldX: __webpack_require__(151), - TileToWorldXY: __webpack_require__(1352), - TileToWorldY: __webpack_require__(152), - WeightedRandomize: __webpack_require__(1353), - WorldToTileX: __webpack_require__(66), - WorldToTileXY: __webpack_require__(1354), - WorldToTileY: __webpack_require__(67) - -}; - - -/***/ }), -/* 150 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsInLayerBounds = __webpack_require__(104); +var IsInLayerBounds = __webpack_require__(116); /** * Gets a tile at the given tile coordinates from the given layer. @@ -36027,13 +38594,12 @@ var IsInLayerBounds = __webpack_require__(104); * @function Phaser.Tilemaps.Components.GetTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} nonNull - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ var GetTileAt = function (tileX, tileY, nonNull, layer) { @@ -36042,7 +38608,8 @@ var GetTileAt = function (tileX, tileY, nonNull, layer) if (IsInLayerBounds(tileX, tileY, layer)) { var tile = layer.data[tileY][tileX] || null; - if (tile === null) + + if (!tile) { return null; } @@ -36064,50 +38631,6 @@ var GetTileAt = function (tileX, tileY, nonNull, layer) module.exports = GetTileAt; -/***/ }), -/* 151 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layer's position, scale and scroll. - * - * @function Phaser.Tilemaps.Components.TileToWorldX - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {number} - */ -var TileToWorldX = function (tileX, camera, layer) -{ - var tileWidth = layer.baseTileWidth; - var tilemapLayer = layer.tilemapLayer; - var layerWorldX = 0; - - if (tilemapLayer) - { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } - - layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); - - tileWidth *= tilemapLayer.scaleX; - } - - return layerWorldX + tileX * tileWidth; -}; - -module.exports = TileToWorldX; - - /***/ }), /* 152 */ /***/ (function(module, exports) { @@ -36119,37 +38642,119 @@ module.exports = TileToWorldX; */ /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layer's position, scale and scroll. + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. * - * @function Phaser.Tilemaps.Components.TileToWorldY - * @since 3.0.0 + * @function Phaser.Tilemaps.Components.RunCull + * @since 3.50.0 * - * @param {integer} tileY - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {object} bounds - An object containing the `left`, `right`, `top` and `bottom` bounds. + * @param {number} renderOrder - The rendering order constant. + * @param {array} outputArray - The array to store the Tile objects within. * - * @return {number} + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ -var TileToWorldY = function (tileY, camera, layer) +var RunCull = function (layer, bounds, renderOrder, outputArray) { - var tileHeight = layer.baseTileHeight; + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + var tilemapLayer = layer.tilemapLayer; - var layerWorldY = 0; - if (tilemapLayer) + var drawLeft = Math.max(0, bounds.left); + var drawRight = Math.min(mapWidth, bounds.right); + var drawTop = Math.max(0, bounds.top); + var drawBottom = Math.min(mapHeight, bounds.bottom); + + var x; + var y; + var tile; + + if (renderOrder === 0) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + // right-down - layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; - tileHeight *= tilemapLayer.scaleY; + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } } - return layerWorldY + tileY * tileHeight; + tilemapLayer.tilesDrawn = outputArray.length; + tilemapLayer.tilesTotal = mapWidth * mapHeight; + + return outputArray; }; -module.exports = TileToWorldY; +module.exports = RunCull; /***/ }), @@ -36169,8 +38774,8 @@ module.exports = TileToWorldY; * @function Phaser.Tilemaps.Components.SetLayerCollisionIndex * @since 3.0.0 * - * @param {integer} tileIndex - The tile index to set the collision boolean for. - * @param {boolean} [collides=true] - Should the tile index collide or not? + * @param {number} tileIndex - The tile index to set the collision boolean for. + * @param {boolean} collides - Should the tile index collide or not? * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetLayerCollisionIndex = function (tileIndex, collides, layer) @@ -36325,17 +38930,17 @@ module.exports = GetNewValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(243); +var Defaults = __webpack_require__(256); var GetAdvancedValue = __webpack_require__(15); -var GetBoolean = __webpack_require__(90); -var GetEaseFunction = __webpack_require__(71); +var GetBoolean = __webpack_require__(95); +var GetEaseFunction = __webpack_require__(78); var GetNewValue = __webpack_require__(155); -var GetProps = __webpack_require__(526); -var GetTargets = __webpack_require__(241); +var GetProps = __webpack_require__(562); +var GetTargets = __webpack_require__(254); var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(242); -var Tween = __webpack_require__(244); -var TweenData = __webpack_require__(246); +var GetValueOp = __webpack_require__(255); +var Tween = __webpack_require__(257); +var TweenData = __webpack_require__(259); /** * Creates a new Tween. @@ -36459,10 +39064,10 @@ module.exports = TweenBuilder; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); +var CustomMap = __webpack_require__(98); var GetFastValue = __webpack_require__(2); -var Events = __webpack_require__(122); -var Animation = __webpack_require__(172); +var Events = __webpack_require__(128); +var Animation = __webpack_require__(177); /** * @classdesc @@ -36892,7 +39497,7 @@ var AnimationState = new Class({ * 3 = Waiting for specific frame * * @name Phaser.Animations.AnimationState#_pendingStop - * @type {integer} + * @type {number} * @private * @since 3.4.0 */ @@ -37134,7 +39739,7 @@ var AnimationState = new Class({ * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. + * @param {number} delay - The delay, in milliseconds, to wait before starting the animation playing. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -37180,7 +39785,7 @@ var AnimationState = new Class({ * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * @param {number} [repeatCount=1] - How many times should the animation repeat before the next one starts? * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -37629,7 +40234,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#setRepeat * @since 3.4.0 * - * @param {integer} value - The number of times that the animation should repeat. + * @param {number} value - The number of times that the animation should repeat. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -37805,7 +40410,7 @@ var AnimationState = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.4.0 * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. + * @param {number} delay - The number of milliseconds to wait before stopping this animation. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -37833,7 +40438,7 @@ var AnimationState = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.50.0 * - * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? + * @param {number} [repeatCount=1] - How many times should the animation repeat before stopping? * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -37886,7 +40491,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#getTotalFrames * @since 3.4.0 * - * @return {integer} The total number of frames in the current animation, or zero if no animation has been loaded. + * @return {number} The total number of frames in the current animation, or zero if no animation has been loaded. */ getTotalFrames: function () { @@ -38083,11 +40688,11 @@ var AnimationState = new Class({ * * @param {string} key - The key of the Animation to retrieve. * - * @return {Phaser.Animations.Animation} The Animation, or `undefined` if the key is invalid. + * @return {Phaser.Animations.Animation} The Animation, or `null` if the key is invalid. */ get: function (key) { - return (this.anims && this.anims.get(key)); + return (this.anims) ? this.anims.get(key) : null; }, /** @@ -38098,11 +40703,11 @@ var AnimationState = new Class({ * * @param {string} key - The key of the Animation to check. * - * @return {boolean} `true` if the Animation exists locally, or `false` if the key is available. + * @return {boolean} `true` if the Animation exists locally, or `false` if the key is available, or there are no local animations. */ exists: function (key) { - return (this.anims && this.anims.has(key)); + return (this.anims) ? this.anims.has(key) : false; }, /** @@ -38155,6 +40760,99 @@ var AnimationState = new Class({ return anim; }, + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. + * + * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. + * + * Example: + * + * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * + * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'ruby', + * repeat: -1, + * frames: this.anims.generateFrameNames('gems', { + * prefix: 'ruby_', + * end: 6, + * zeroPad: 4 + * }) + * }); + * ``` + * + * Please see the animation examples for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNames + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNames} [config] - The configuration object for the animation frame names. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNames: function (key, config) + { + return this.animationManager.generateFrameNames(key, config); + }, + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNumbers + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNumbers} config - The configuration object for the animation frames. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNumbers: function (key, config) + { + return this.animationManager.generateFrameNumbers(key, config); + }, + /** * Removes a locally created Animation from this Sprite, based on the given key. * @@ -38236,6 +40934,568 @@ module.exports = AnimationState; /* 158 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); +var ShaderSourceFS = __webpack_require__(860); +var ShaderSourceVS = __webpack_require__(861); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); + +/** + * @classdesc + * + * The Multi Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL. + * Virtually all Game Objects use this pipeline by default, including Sprites, Graphics + * and Tilemaps. It handles the batching of quads and tris, as well as methods for + * drawing and batching geometry data. + * + * Prior to Phaser v3.50 this pipeline was called the `TextureTintPipeline`. + * + * In previous versions of Phaser only one single texture unit was supported at any one time. + * The Multi Pipeline is an evolution of the old Texture Tint Pipeline, updated to support + * multi-textures for increased performance. + * + * The fragment shader it uses can be found in `shaders/src/Multi.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uMainSampler` (sampler2D array) + * + * If you wish to create a custom pipeline extending from this one, you can use two string + * declarations in your fragment shader source: `%count%` and `%forloop%`, where `count` is + * used to set the number of `sampler2Ds` available, and `forloop` is a block of GLSL code + * that will get the currently bound texture unit. + * + * This pipeline will automatically inject that code for you, should those values exist + * in your shader source. If you wish to handle this yourself, you can also use the + * function `Utils.parseFragmentShaderMaxTextures`. + * + * If you wish to create a pipeline that works from a single texture, or that doesn't have + * internal texture iteration, please see the `SinglePipeline` instead. + * + * @class MultiPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var MultiPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function MultiPipeline (config) + { + var renderer = config.game.renderer; + + var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); + + config.fragShader = Utils.parseFragmentShaderMaxTextures(fragmentShaderSource, renderer.maxTextures); + config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTexCoord', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTexId', + size: 1, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTintEffect', + size: 1, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTint', + size: 4, + type: WEBGL_CONST.UNSIGNED_BYTE, + normalized: true + } + ]); + config.uniforms = GetFastValue(config, 'uniforms', [ + 'uProjectionMatrix', + 'uMainSampler' + ]); + + WebGLPipeline.call(this, config); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix1 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix2 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix3 + * @private + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this._tempMatrix3 = new TransformMatrix(); + }, + + /** + * Called every time the pipeline is bound by the renderer. + * Sets the shader program, vertex buffer and other resources. + * Should only be called when changing pipeline. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#bind + * @since 3.50.0 + * + * @return {this} This WebGLPipeline instance. + */ + boot: function () + { + WebGLPipeline.prototype.boot.call(this); + + this.currentShader.set1iv('uMainSampler', this.renderer.textureIndexes); + }, + + /** + * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchSprite + * @since 3.0.0 + * + * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} gameObject - The texture based Game Object to add to the batch. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set. + */ + batchSprite: function (gameObject, camera, parentTransformMatrix) + { + this.manager.set(this, gameObject); + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var frame = gameObject.frame; + var texture = frame.glTexture; + + var u0 = frame.u0; + var v0 = frame.v0; + var u1 = frame.u1; + var v1 = frame.v1; + var frameX = frame.x; + var frameY = frame.y; + var frameWidth = frame.cutWidth; + var frameHeight = frame.cutHeight; + var customPivot = frame.customPivot; + + var displayOriginX = gameObject.displayOriginX; + var displayOriginY = gameObject.displayOriginY; + + var x = -displayOriginX + frameX; + var y = -displayOriginY + frameY; + + if (gameObject.isCropped) + { + var crop = gameObject._crop; + + if (crop.flipX !== gameObject.flipX || crop.flipY !== gameObject.flipY) + { + frame.updateCropUVs(crop, gameObject.flipX, gameObject.flipY); + } + + u0 = crop.u0; + v0 = crop.v0; + u1 = crop.u1; + v1 = crop.v1; + + frameWidth = crop.width; + frameHeight = crop.height; + + frameX = crop.x; + frameY = crop.y; + + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; + } + + var flipX = 1; + var flipY = 1; + + if (gameObject.flipX) + { + if (!customPivot) + { + x += (-frame.realWidth + (displayOriginX * 2)); + } + + flipX = -1; + } + + // Auto-invert the flipY if this is coming from a GLTexture + + if (gameObject.flipY || (frame.source.isGLTexture && !texture.flipY)) + { + if (!customPivot) + { + y += (-frame.realHeight + (displayOriginY * 2)); + } + + flipY = -1; + } + + spriteMatrix.applyITRS(gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX * flipX, gameObject.scaleY * flipY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * gameObject.scrollFactorX, -camera.scrollY * gameObject.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = gameObject.x; + spriteMatrix.f = gameObject.y; + } + else + { + spriteMatrix.e -= camera.scrollX * gameObject.scrollFactorX; + spriteMatrix.f -= camera.scrollY * gameObject.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + var xw = x + frameWidth; + var yh = y + frameHeight; + + var roundPixels = camera.roundPixels; + + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); + + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); + + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); + + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); + + var getTint = Utils.getTintAppendFloatAlpha; + var cameraAlpha = camera.alpha; + + var tintTL = getTint(gameObject.tintTopLeft, cameraAlpha * gameObject._alphaTL); + var tintTR = getTint(gameObject.tintTopRight, cameraAlpha * gameObject._alphaTR); + var tintBL = getTint(gameObject.tintBottomLeft, cameraAlpha * gameObject._alphaBL); + var tintBR = getTint(gameObject.tintBottomRight, cameraAlpha * gameObject._alphaBR); + + if (this.shouldFlush(6)) + { + this.flush(); + } + + var unit = this.setGameObject(gameObject, frame); + + this.manager.preBatch(gameObject); + + this.batchQuad(gameObject, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, gameObject.tintEffect, texture, unit); + + this.manager.postBatch(gameObject); + }, + + /** + * Generic function for batching a textured quad using argument values instead of a Game Object. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTexture + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject. + * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad. + * @param {number} textureWidth - Real texture width. + * @param {number} textureHeight - Real texture height. + * @param {number} srcX - X coordinate of the quad. + * @param {number} srcY - Y coordinate of the quad. + * @param {number} srcWidth - Width of the quad. + * @param {number} srcHeight - Height of the quad. + * @param {number} scaleX - X component of scale. + * @param {number} scaleY - Y component of scale. + * @param {number} rotation - Rotation of the quad. + * @param {boolean} flipX - Indicates if the quad is horizontally flipped. + * @param {boolean} flipY - Indicates if the quad is vertically flipped. + * @param {number} scrollFactorX - By which factor is the quad affected by the camera horizontal scroll. + * @param {number} scrollFactorY - By which factor is the quad effected by the camera vertical scroll. + * @param {number} displayOriginX - Horizontal origin in pixels. + * @param {number} displayOriginY - Vertical origin in pixels. + * @param {number} frameX - X coordinate of the texture frame. + * @param {number} frameY - Y coordinate of the texture frame. + * @param {number} frameWidth - Width of the texture frame. + * @param {number} frameHeight - Height of the texture frame. + * @param {number} tintTL - Tint for top left. + * @param {number} tintTR - Tint for top right. + * @param {number} tintBL - Tint for bottom left. + * @param {number} tintBR - Tint for bottom right. + * @param {number} tintEffect - The tint effect. + * @param {number} uOffset - Horizontal offset on texture coordinate. + * @param {number} vOffset - Vertical offset on texture coordinate. + * @param {Phaser.Cameras.Scene2D.Camera} camera - Current used camera. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentTransformMatrix - Parent container. + * @param {boolean} [skipFlip=false] - Skip the renderTexture check. + * @param {number} [textureUnit] - Use the currently bound texture unit? + */ + batchTexture: function ( + gameObject, + texture, + textureWidth, textureHeight, + srcX, srcY, + srcWidth, srcHeight, + scaleX, scaleY, + rotation, + flipX, flipY, + scrollFactorX, scrollFactorY, + displayOriginX, displayOriginY, + frameX, frameY, frameWidth, frameHeight, + tintTL, tintTR, tintBL, tintBR, tintEffect, + uOffset, vOffset, + camera, + parentTransformMatrix, + skipFlip, + textureUnit) + { + this.manager.set(this, gameObject); + + var camMatrix = this._tempMatrix1; + var spriteMatrix = this._tempMatrix2; + var calcMatrix = this._tempMatrix3; + + var u0 = (frameX / textureWidth) + uOffset; + var v0 = (frameY / textureHeight) + vOffset; + var u1 = (frameX + frameWidth) / textureWidth + uOffset; + var v1 = (frameY + frameHeight) / textureHeight + vOffset; + + var width = srcWidth; + var height = srcHeight; + + var x = -displayOriginX; + var y = -displayOriginY; + + if (gameObject.isCropped) + { + var crop = gameObject._crop; + + var cropWidth = crop.width; + var cropHeight = crop.height; + + width = cropWidth; + height = cropHeight; + + srcWidth = cropWidth; + srcHeight = cropHeight; + + frameX = crop.x; + frameY = crop.y; + + var ox = frameX; + var oy = frameY; + + if (flipX) + { + ox = (frameWidth - crop.x - cropWidth); + } + + if (flipY) + { + oy = (frameHeight - crop.y - cropHeight); + } + + u0 = (ox / textureWidth) + uOffset; + v0 = (oy / textureHeight) + vOffset; + u1 = (ox + cropWidth) / textureWidth + uOffset; + v1 = (oy + cropHeight) / textureHeight + vOffset; + + x = -displayOriginX + frameX; + y = -displayOriginY + frameY; + } + + // Invert the flipY if this is a RenderTexture + flipY = flipY ^ (!skipFlip && texture.isRenderTexture ? 1 : 0); + + if (flipX) + { + width *= -1; + x += srcWidth; + } + + if (flipY) + { + height *= -1; + y += srcHeight; + } + + var xw = x + width; + var yh = y + height; + + spriteMatrix.applyITRS(srcX, srcY, rotation, scaleX, scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = srcX; + spriteMatrix.f = srcY; + } + else + { + spriteMatrix.e -= camera.scrollX * scrollFactorX; + spriteMatrix.f -= camera.scrollY * scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + var roundPixels = camera.roundPixels; + + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); + + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); + + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); + + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); + + if (textureUnit === undefined) + { + textureUnit = this.renderer.setTexture2D(texture); + } + + if (gameObject) + { + this.manager.preBatch(gameObject); + } + + this.batchQuad(gameObject, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + + if (gameObject) + { + this.manager.postBatch(gameObject); + } + }, + + /** + * Adds a Texture Frame into the batch for rendering. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTextureFrame + * @since 3.12.0 + * + * @param {Phaser.Textures.Frame} frame - The Texture Frame to be rendered. + * @param {number} x - The horizontal position to render the texture at. + * @param {number} y - The vertical position to render the texture at. + * @param {number} tint - The tint color. + * @param {number} alpha - The alpha value. + * @param {Phaser.GameObjects.Components.TransformMatrix} transformMatrix - The Transform Matrix to use for the texture. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - A parent Transform Matrix. + */ + batchTextureFrame: function ( + frame, + x, y, + tint, alpha, + transformMatrix, + parentTransformMatrix + ) + { + this.manager.set(this); + + var spriteMatrix = this._tempMatrix1.copyFrom(transformMatrix); + var calcMatrix = this._tempMatrix2; + + var xw = x + frame.width; + var yh = y + frame.height; + + if (parentTransformMatrix) + { + spriteMatrix.multiply(parentTransformMatrix, calcMatrix); + } + else + { + calcMatrix = spriteMatrix; + } + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + var unit = this.renderer.setTextureSource(frame.source); + + tint = Utils.getTintAppendFloatAlpha(tint, alpha); + + this.batchQuad(null, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, unit); + } + +}); + +module.exports = MultiPipeline; + + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + /** * The `Matter.Composite` module contains methods for creating and manipulating composite bodies. * A composite body is a collection of `Matter.Body`, `Matter.Constraint` and other `Matter.Composite`, therefore composites form a tree structure. @@ -38251,10 +41511,10 @@ var Composite = {}; module.exports = Composite; -var Events = __webpack_require__(251); -var Common = __webpack_require__(44); -var Bounds = __webpack_require__(103); -var Body = __webpack_require__(64); +var Events = __webpack_require__(266); +var Common = __webpack_require__(50); +var Bounds = __webpack_require__(115); +var Body = __webpack_require__(68); (function() { @@ -38927,7 +42187,7 @@ var Body = __webpack_require__(64); /***/ }), -/* 159 */ +/* 160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38966,7 +42226,7 @@ module.exports = CircumferencePoint; /***/ }), -/* 160 */ +/* 161 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39010,7 +42270,7 @@ module.exports = Random; /***/ }), -/* 161 */ +/* 162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39019,7 +42279,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(118); +var Perimeter = __webpack_require__(126); var Point = __webpack_require__(4); /** @@ -39091,7 +42351,7 @@ module.exports = GetPoint; /***/ }), -/* 162 */ +/* 163 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39100,7 +42360,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); var Point = __webpack_require__(4); /** @@ -39117,7 +42377,7 @@ var Point = __webpack_require__(4); * @generic {Phaser.Geom.Point[]} O - [out,$return] * * @param {Phaser.Geom.Line} line - The line. - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * @@ -39156,7 +42416,7 @@ module.exports = GetPoints; /***/ }), -/* 163 */ +/* 164 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39196,7 +42456,7 @@ module.exports = Random; /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39234,7 +42494,7 @@ module.exports = Random; /***/ }), -/* 165 */ +/* 166 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39243,7 +42503,8 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PIPELINE_CONST = __webpack_require__(110); +var DeepCopy = __webpack_require__(167); +var PIPELINE_CONST = __webpack_require__(82); /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. @@ -39258,6 +42519,8 @@ var Pipeline = { /** * The initial WebGL pipeline of this Game Object. * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + * * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline * @type {Phaser.Renderer.WebGL.WebGLPipeline} * @default null @@ -39277,61 +42540,251 @@ var Pipeline = { */ pipeline: null, + /** + * Does this Game Object have any Post Pipelines set? + * + * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.50.0 + */ + hasPostPipeline: false, + + /** + * Does this Game Object manage its Post Pipeline directly? + * + * @name Phaser.GameObjects.Components.Pipeline#manualPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.50.0 + */ + manualPostPipeline: false, + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + * + * @name Phaser.GameObjects.Components.Pipeline#postPipeline + * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} + * @webglOnly + * @since 3.50.0 + */ + postPipelines: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.Pipeline#pipelineData + * @type {object} + * @webglOnly + * @since 3.50.0 + */ + pipelineData: null, + /** * Sets the initial WebGL Pipeline of this Game Object. * - * This should only be called during the instantiation of the Game Object. + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. * * @method Phaser.GameObjects.Components.Pipeline#initPipeline * @webglOnly * @since 3.0.0 * - * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (name) + initPipeline: function (pipeline) { - if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } + if (pipeline === undefined) { pipeline = PIPELINE_CONST.MULTI_PIPELINE; } - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) - { - this.defaultPipeline = pipelines.get(name); - this.pipeline = this.defaultPipeline; + this.postPipelines = []; + this.pipelineData = {}; - return true; + if (pipelines) + { + var instance = pipelines.get(pipeline); + + if (instance) + { + this.defaultPipeline = instance; + this.pipeline = instance; + + return true; + } } return false; }, /** - * Sets the active WebGL Pipeline of this Game Object. + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. * * @method Phaser.GameObjects.Components.Pipeline#setPipeline * @webglOnly * @since 3.0.0 * - * @param {string} name - The name of the pipeline to set on this Game Object. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. * * @return {this} This Game Object instance. */ - setPipeline: function (name) + setPipeline: function (pipeline, pipelineData, copyData) { - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) + if (pipelines) { - this.pipeline = pipelines.get(name); + var instance = pipelines.get(pipeline); + + if (instance) + { + this.pipeline = instance; + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } } return this; }, + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPostPipeline: function (pipelines, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + var pipelineManager = renderer.pipelines; + + if (pipelineManager) + { + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelineManager.getPostPipeline(pipelines[i], this); + + if (instance) + { + this.postPipelines.push(instance); + } + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipelineData + * @webglOnly + * @since 3.50.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPipelineData: function (key, value) + { + var data = this.pipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * + * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {string} name - The name of the Post Pipeline to get. + * + * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The first Post Pipeline matching the name, or undefined if no match. + */ + getPostPipeline: function (pipeline) + { + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((typeof pipeline === 'string' && instance.name === name) || instance instanceof pipeline) + { + return instance; + } + } + }, + /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. * @@ -39339,15 +42792,62 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines? + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + * + * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. */ - resetPipeline: function () + resetPipeline: function (resetPostPipelines, resetData) { + if (resetPostPipelines === undefined) { resetPostPipelines = false; } + if (resetData === undefined) { resetData = false; } + this.pipeline = this.defaultPipeline; + if (resetPostPipelines) + { + this.postPipelines = []; + this.hasPostPipeline = false; + } + + if (resetData) + { + this.pipelineData = {}; + } + return (this.pipeline !== null); }, + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + */ + resetPostPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].destroy(); + } + + this.postPipelines = []; + this.hasPostPipeline = false; + + if (resetData) + { + this.pipelineData = {}; + } + }, + /** * Gets the name of the WebGL Pipeline this Game Object is currently using. * @@ -39368,7 +42868,117 @@ module.exports = Pipeline; /***/ }), -/* 166 */ +/* 167 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Deep Copy the given object or array. + * + * @function Phaser.Utils.Objects.DeepCopy + * @since 3.50.0 + * + * @param {object} obj - The object to deep copy. + * + * @return {object} A deep copy of the original object. + */ +var DeepCopy = function (inObject) +{ + var outObject; + var value; + var key; + + if (typeof inObject !== 'object' || inObject === null) + { + // inObject is not an object + return inObject; + } + + // Create an array or object to hold the values + outObject = Array.isArray(inObject) ? [] : {}; + + for (key in inObject) + { + value = inObject[key]; + + // Recursively (deep) copy for nested objects, including arrays + outObject[key] = DeepCopy(value); + } + + return outObject; +}; + +module.exports = DeepCopy; + + +/***/ }), +/* 168 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Build a JSON representation of the given Game Object. + * + * This is typically extended further by Game Object specific implementations. + * + * @method Phaser.GameObjects.Components.ToJSON + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ +var ToJSON = function (gameObject) +{ + var out = { + name: gameObject.name, + type: gameObject.type, + x: gameObject.x, + y: gameObject.y, + depth: gameObject.depth, + scale: { + x: gameObject.scaleX, + y: gameObject.scaleY + }, + origin: { + x: gameObject.originX, + y: gameObject.originY + }, + flipX: gameObject.flipX, + flipY: gameObject.flipY, + rotation: gameObject.rotation, + alpha: gameObject.alpha, + visible: gameObject.visible, + blendMode: gameObject.blendMode, + textureKey: '', + frameKey: '', + data: {} + }; + + if (gameObject.texture) + { + out.textureKey = gameObject.texture.key; + out.frameKey = gameObject.frame.name; + } + + return out; +}; + +module.exports = ToJSON; + + +/***/ }), +/* 169 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39423,7 +43033,87 @@ module.exports = TransformXY; /***/ }), -/* 167 */ +/* 170 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. + * + * @function Phaser.Utils.Array.RotateRight + * @since 3.0.0 + * + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {number} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateRight = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.pop(); + array.unshift(element); + } + + return element; +}; + +module.exports = RotateRight; + + +/***/ }), +/* 172 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39464,7 +43154,7 @@ module.exports = Random; /***/ }), -/* 168 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39520,7 +43210,7 @@ module.exports = Random; /***/ }), -/* 169 */ +/* 174 */ /***/ (function(module, exports) { /** @@ -39561,7 +43251,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 170 */ +/* 175 */ /***/ (function(module, exports) { /** @@ -39600,7 +43290,7 @@ module.exports = SmootherStep; /***/ }), -/* 171 */ +/* 176 */ /***/ (function(module, exports) { /** @@ -39647,7 +43337,7 @@ module.exports = SmoothStep; /***/ }), -/* 172 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39656,13 +43346,13 @@ module.exports = SmoothStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(122); -var FindClosestInSorted = __webpack_require__(298); -var Frame = __webpack_require__(299); +var Events = __webpack_require__(128); +var FindClosestInSorted = __webpack_require__(310); +var Frame = __webpack_require__(311); var GetValue = __webpack_require__(6); -var SortByDigits = __webpack_require__(300); +var SortByDigits = __webpack_require__(312); /** * @classdesc @@ -39740,7 +43430,7 @@ var Animation = new Class({ * The frame rate of playback in frames per second (default 24 if duration is null) * * @name Phaser.Animations.Animation#frameRate - * @type {integer} + * @type {number} * @default 24 * @since 3.0.0 */ @@ -39752,7 +43442,7 @@ var Animation = new Class({ * otherwise the `frameRate` is derived from `duration`. * * @name Phaser.Animations.Animation#duration - * @type {integer} + * @type {number} * @since 3.0.0 */ this.duration = GetValue(config, 'duration', null); @@ -39761,7 +43451,7 @@ var Animation = new Class({ * How many ms per frame, not including frame specific modifiers. * * @name Phaser.Animations.Animation#msPerFrame - * @type {integer} + * @type {number} * @since 3.0.0 */ this.msPerFrame; @@ -39780,7 +43470,7 @@ var Animation = new Class({ * The delay in ms before the playback will begin. * * @name Phaser.Animations.Animation#delay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -39790,7 +43480,7 @@ var Animation = new Class({ * Number of times to repeat the animation. Set to -1 to repeat forever. * * @name Phaser.Animations.Animation#repeat - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -39800,7 +43490,7 @@ var Animation = new Class({ * The delay in ms before the a repeat play starts. * * @name Phaser.Animations.Animation#repeatDelay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -39874,7 +43564,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#calculateDuration * @since 3.50.0 * - * @param {(Phaser.Animations.Animation|Phaser.GameObjects.Components.Animation)} target - The target to set the values on. + * @param {Phaser.Animations.Animation} target - The target to set the values on. * @param {number} totalFrames - The total number of frames in the animation. * @param {number} duration - The duration to calculate the frame rate from. * @param {number} frameRate - The frame ate to calculate the duration from. @@ -39928,7 +43618,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#addFrameAt * @since 3.0.0 * - * @param {integer} index - The index to insert the frame at within the animation. + * @param {number} index - The index to insert the frame at within the animation. * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. * * @return {this} This Animation object. @@ -39967,7 +43657,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#checkFrame * @since 3.0.0 * - * @param {integer} index - The index to be checked. + * @param {number} index - The index to be checked. * * @return {boolean} `true` if the index is valid, otherwise `false`. */ @@ -39984,14 +43674,14 @@ var Animation = new Class({ * @protected * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - getFirstTick: function (component) + getFirstTick: function (state) { // When is the first update due? - component.accumulator = 0; + state.accumulator = 0; - component.nextTick = component.msPerFrame + component.currentFrame.duration; + state.nextTick = state.msPerFrame + state.currentFrame.duration; }, /** @@ -40001,7 +43691,7 @@ var Animation = new Class({ * @protected * @since 3.0.0 * - * @param {integer} index - The index in the AnimationFrame array + * @param {number} index - The index in the AnimationFrame array * * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence */ @@ -40125,13 +43815,13 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#getNextTick * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - getNextTick: function (component) + getNextTick: function (state) { - component.accumulator -= component.nextTick; + state.accumulator -= state.nextTick; - component.nextTick = component.msPerFrame + component.currentFrame.duration; + state.nextTick = state.msPerFrame + state.currentFrame.duration; }, /** @@ -40157,42 +43847,42 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#nextFrame * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {Phaser.Animations.AnimationState} state - The Animation State to advance. */ - nextFrame: function (component) + nextFrame: function (state) { - var frame = component.currentFrame; + var frame = state.currentFrame; if (frame.isLast) { // We're at the end of the animation // Yoyo? (happens before repeat) - if (component.yoyo) + if (state.yoyo) { - this.handleYoyoFrame(component, false); + this.handleYoyoFrame(state, false); } - else if (component.repeatCounter > 0) + else if (state.repeatCounter > 0) { // Repeat (happens before complete) - if (component.inReverse && component.forward) + if (state.inReverse && state.forward) { - component.forward = false; + state.forward = false; } else { - this.repeatAnimation(component); + this.repeatAnimation(state); } } else { - component.complete(); + state.complete(); } } else { - this.updateAndGetNextTick(component, frame.nextFrame); + this.updateAndGetNextTick(state, frame.nextFrame); } }, @@ -40203,37 +43893,37 @@ var Animation = new Class({ * @private * @since 3.12.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {Phaser.Animations.AnimationState} state - The Animation State to advance. * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) */ - handleYoyoFrame: function (component, isReverse) + handleYoyoFrame: function (state, isReverse) { if (!isReverse) { isReverse = false; } - if (component.inReverse === !isReverse && component.repeatCounter > 0) + if (state.inReverse === !isReverse && state.repeatCounter > 0) { - if (component.repeatDelay === 0 || component.pendingRepeat) + if (state.repeatDelay === 0 || state.pendingRepeat) { - component.forward = isReverse; + state.forward = isReverse; } - this.repeatAnimation(component); + this.repeatAnimation(state); return; } - if (component.inReverse !== isReverse && component.repeatCounter === 0) + if (state.inReverse !== isReverse && state.repeatCounter === 0) { - component.complete(); + state.complete(); return; } - component.forward = isReverse; + state.forward = isReverse; - var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; + var frame = (isReverse) ? state.currentFrame.nextFrame : state.currentFrame.prevFrame; - this.updateAndGetNextTick(component, frame); + this.updateAndGetNextTick(state, frame); }, /** @@ -40242,7 +43932,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#getLastFrame * @since 3.12.0 * - * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. + * @return {Phaser.Animations.AnimationFrame} The last Animation Frame. */ getLastFrame: function () { @@ -40256,41 +43946,41 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#previousFrame * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - previousFrame: function (component) + previousFrame: function (state) { - var frame = component.currentFrame; + var frame = state.currentFrame; if (frame.isFirst) { // We're at the start of the animation - if (component.yoyo) + if (state.yoyo) { - this.handleYoyoFrame(component, true); + this.handleYoyoFrame(state, true); } - else if (component.repeatCounter > 0) + else if (state.repeatCounter > 0) { - if (component.inReverse && !component.forward) + if (state.inReverse && !state.forward) { - this.repeatAnimation(component); + this.repeatAnimation(state); } else { // Repeat (happens before complete) - component.forward = true; + state.forward = true; - this.repeatAnimation(component); + this.repeatAnimation(state); } } else { - component.complete(); + state.complete(); } } else { - this.updateAndGetNextTick(component, frame.prevFrame); + this.updateAndGetNextTick(state, frame.prevFrame); } }, @@ -40301,13 +43991,14 @@ var Animation = new Class({ * @private * @since 3.12.0 * + * @param {Phaser.Animations.AnimationState} state - The Animation State. * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. */ - updateAndGetNextTick: function (component, frame) + updateAndGetNextTick: function (state, frame) { - component.setCurrentFrame(frame); + state.setCurrentFrame(frame); - this.getNextTick(component); + this.getNextTick(state); }, /** @@ -40340,7 +44031,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#removeFrameAt * @since 3.0.0 * - * @param {integer} index - The index in the AnimationFrame array + * @param {number} index - The index in the AnimationFrame array * * @return {this} This Animation object. */ @@ -40363,46 +44054,46 @@ var Animation = new Class({ * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - repeatAnimation: function (component) + repeatAnimation: function (state) { - if (component._pendingStop === 2) + if (state._pendingStop === 2) { - if (component._pendingStopValue === 0) + if (state._pendingStopValue === 0) { - return component.stop(); + return state.stop(); } else { - component._pendingStopValue--; + state._pendingStopValue--; } } - if (component.repeatDelay > 0 && !component.pendingRepeat) + if (state.repeatDelay > 0 && !state.pendingRepeat) { - component.pendingRepeat = true; - component.accumulator -= component.nextTick; - component.nextTick += component.repeatDelay; + state.pendingRepeat = true; + state.accumulator -= state.nextTick; + state.nextTick += state.repeatDelay; } else { - component.repeatCounter--; + state.repeatCounter--; - if (component.forward) + if (state.forward) { - component.setCurrentFrame(component.currentFrame.nextFrame); + state.setCurrentFrame(state.currentFrame.nextFrame); } else { - component.setCurrentFrame(component.currentFrame.prevFrame); + state.setCurrentFrame(state.currentFrame.prevFrame); } - if (component.isPlaying) + if (state.isPlaying) { - this.getNextTick(component); + this.getNextTick(state); - component.handleRepeat(); + state.handleRepeat(); } } }, @@ -40561,7 +44252,7 @@ module.exports = Animation; /***/ }), -/* 173 */ +/* 178 */ /***/ (function(module, exports) { /** @@ -40594,9 +44285,9 @@ module.exports = Animation; * @since 3.0.0 * * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. - * @param {integer} [len=0] - The number of characters to be added. + * @param {number} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). - * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). * * @return {string} The padded string. */ @@ -40637,7 +44328,7 @@ module.exports = Pad; /***/ }), -/* 174 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40646,10 +44337,10 @@ module.exports = Pad; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HexStringToColor = __webpack_require__(307); -var IntegerToColor = __webpack_require__(310); -var ObjectToColor = __webpack_require__(312); -var RGBStringToColor = __webpack_require__(313); +var HexStringToColor = __webpack_require__(319); +var IntegerToColor = __webpack_require__(322); +var ObjectToColor = __webpack_require__(323); +var RGBStringToColor = __webpack_require__(324); /** * Converts the given source color value into an instance of a Color class. @@ -40693,37 +44384,7 @@ module.exports = ValueToColor; /***/ }), -/* 175 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given 3 separate color values this will return an integer representation of it. - * - * @function Phaser.Display.Color.GetColor - * @since 3.0.0 - * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * - * @return {number} The combined color value. - */ -var GetColor = function (red, green, blue) -{ - return red << 16 | green << 8 | blue; -}; - -module.exports = GetColor; - - -/***/ }), -/* 176 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40732,7 +44393,7 @@ module.exports = GetColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColor = __webpack_require__(175); +var GetColor = __webpack_require__(100); /** * RGB space conversion. @@ -40804,7 +44465,7 @@ module.exports = HSVToRGB; /***/ }), -/* 177 */ +/* 181 */ /***/ (function(module, exports) { /** @@ -40813,130 +44474,46 @@ module.exports = HSVToRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Browser specific prefix, so not going to change between contexts, only between browsers -var prefix = ''; - /** - * @namespace Phaser.Display.Canvas.Smoothing + * Return the component parts of a color as an Object with the properties alpha, red, green, blue. + * + * Alpha will only be set if it exists in the given color (0xAARRGGBB) + * + * @function Phaser.Display.Color.IntegerToRGB * @since 3.0.0 + * + * @param {number} input - The color value to convert into a Color object. + * + * @return {Phaser.Types.Display.ColorObject} An object with the red, green and blue values set in the r, g and b properties. */ -var Smoothing = function () +var IntegerToRGB = function (color) { - /** - * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. - * - * @function Phaser.Display.Canvas.Smoothing.getPrefix - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. - * - * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. - */ - var getPrefix = function (context) + if (color > 16777215) { - var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; - - for (var i = 0; i < vendors.length; i++) - { - var s = vendors[i] + 'mageSmoothingEnabled'; - - if (s in context) - { - return s; - } - } - - return null; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.enable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var enable = function (context) + // The color value has an alpha component + return { + a: color >>> 24, + r: color >> 16 & 0xFF, + g: color >> 8 & 0xFF, + b: color & 0xFF + }; + } + else { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = true; - } - - return context; - }; - - /** - * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. - * By default browsers have image smoothing enabled, which isn't always what you visually want, especially - * when using pixel art in a game. Note that this sets the property on the context itself, so that any image - * drawn to the context will be affected. This sets the property across all current browsers but support is - * patchy on earlier browsers, especially on mobile. - * - * @function Phaser.Display.Canvas.Smoothing.disable - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. - * - * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. - */ - var disable = function (context) - { - if (prefix === '') - { - prefix = getPrefix(context); - } - - if (prefix) - { - context[prefix] = false; - } - - return context; - }; - - /** - * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. - * Returns null if no smoothing prefix is available. - * - * @function Phaser.Display.Canvas.Smoothing.isEnabled - * @since 3.0.0 - * - * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. - * - * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. - */ - var isEnabled = function (context) - { - return (prefix !== null) ? context[prefix] : null; - }; - - return { - disable: disable, - enable: enable, - getPrefix: getPrefix, - isEnabled: isEnabled - }; - + return { + a: 255, + r: color >> 16 & 0xFF, + g: color >> 8 & 0xFF, + b: color & 0xFF + }; + } }; -module.exports = Smoothing(); +module.exports = IntegerToRGB; /***/ }), -/* 178 */ +/* 182 */ /***/ (function(module, exports) { /** @@ -40973,7 +44550,7 @@ module.exports = CenterOn; /***/ }), -/* 179 */ +/* 183 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40982,9 +44559,9 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(125); -var Browser = __webpack_require__(126); -var CanvasPool = __webpack_require__(26); +var OS = __webpack_require__(102); +var Browser = __webpack_require__(131); +var CanvasPool = __webpack_require__(31); /** * Determines the features of the browser running this Phaser Game instance. @@ -41165,7 +44742,139 @@ module.exports = init(); /***/ }), -/* 180 */ +/* 184 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Browser specific prefix, so not going to change between contexts, only between browsers +var prefix = ''; + +/** + * @namespace Phaser.Display.Canvas.Smoothing + * @since 3.0.0 + */ +var Smoothing = function () +{ + /** + * Gets the Smoothing Enabled vendor prefix being used on the given context, or null if not set. + * + * @function Phaser.Display.Canvas.Smoothing.getPrefix + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The canvas context to check. + * + * @return {string} The name of the property on the context which controls image smoothing (either `imageSmoothingEnabled` or a vendor-prefixed version thereof), or `null` if not supported. + */ + var getPrefix = function (context) + { + var vendors = [ 'i', 'webkitI', 'msI', 'mozI', 'oI' ]; + + for (var i = 0; i < vendors.length; i++) + { + var s = vendors[i] + 'mageSmoothingEnabled'; + + if (s in context) + { + return s; + } + } + + return null; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.enable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to enable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var enable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = true; + } + + return context; + }; + + /** + * Sets the Image Smoothing property on the given context. Set to false to disable image smoothing. + * By default browsers have image smoothing enabled, which isn't always what you visually want, especially + * when using pixel art in a game. Note that this sets the property on the context itself, so that any image + * drawn to the context will be affected. This sets the property across all current browsers but support is + * patchy on earlier browsers, especially on mobile. + * + * @function Phaser.Display.Canvas.Smoothing.disable + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context on which to disable smoothing. + * + * @return {(CanvasRenderingContext2D|WebGLRenderingContext)} The provided context. + */ + var disable = function (context) + { + if (prefix === '') + { + prefix = getPrefix(context); + } + + if (prefix) + { + context[prefix] = false; + } + + return context; + }; + + /** + * Returns `true` if the given context has image smoothing enabled, otherwise returns `false`. + * Returns null if no smoothing prefix is available. + * + * @function Phaser.Display.Canvas.Smoothing.isEnabled + * @since 3.0.0 + * + * @param {(CanvasRenderingContext2D|WebGLRenderingContext)} context - The context to check. + * + * @return {?boolean} `true` if smoothing is enabled on the context, otherwise `false`. `null` if not supported. + */ + var isEnabled = function (context) + { + return (prefix !== null) ? context[prefix] : null; + }; + + return { + disable: disable, + enable: enable, + getPrefix: getPrefix, + isEnabled: isEnabled + }; + +}; + +module.exports = Smoothing(); + + +/***/ }), +/* 185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41175,7 +44884,7 @@ module.exports = init(); */ var CONST = __webpack_require__(13); -var Extend = __webpack_require__(19); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Math @@ -41184,63 +44893,64 @@ var Extend = __webpack_require__(19); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(760), - Distance: __webpack_require__(769), - Easing: __webpack_require__(774), - Fuzzy: __webpack_require__(775), - Interpolation: __webpack_require__(778), - Pow2: __webpack_require__(783), - Snap: __webpack_require__(785), + Angle: __webpack_require__(801), + Distance: __webpack_require__(810), + Easing: __webpack_require__(815), + Fuzzy: __webpack_require__(816), + Interpolation: __webpack_require__(819), + Pow2: __webpack_require__(824), + Snap: __webpack_require__(826), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(787), + RandomDataGenerator: __webpack_require__(828), // Single functions - Average: __webpack_require__(788), - Bernstein: __webpack_require__(337), - Between: __webpack_require__(182), - CatmullRom: __webpack_require__(181), - CeilTo: __webpack_require__(789), - Clamp: __webpack_require__(17), - DegToRad: __webpack_require__(41), - Difference: __webpack_require__(790), - Factorial: __webpack_require__(338), - FloatBetween: __webpack_require__(127), - FloorTo: __webpack_require__(791), - FromPercent: __webpack_require__(89), - GetSpeed: __webpack_require__(792), - IsEven: __webpack_require__(793), - IsEvenStrict: __webpack_require__(794), - Linear: __webpack_require__(124), - MaxAdd: __webpack_require__(795), - MinSub: __webpack_require__(796), - Percent: __webpack_require__(797), - RadToDeg: __webpack_require__(183), - RandomXY: __webpack_require__(798), - RandomXYZ: __webpack_require__(799), - RandomXYZW: __webpack_require__(800), - Rotate: __webpack_require__(344), - RotateAround: __webpack_require__(285), - RotateAroundDistance: __webpack_require__(169), - RotateTo: __webpack_require__(801), - RoundAwayFromZero: __webpack_require__(345), - RoundTo: __webpack_require__(802), - SinCosTableGenerator: __webpack_require__(803), - SmootherStep: __webpack_require__(170), - SmoothStep: __webpack_require__(171), - ToXY: __webpack_require__(804), - TransformXY: __webpack_require__(166), - Within: __webpack_require__(805), - Wrap: __webpack_require__(59), + Average: __webpack_require__(829), + Bernstein: __webpack_require__(348), + Between: __webpack_require__(187), + CatmullRom: __webpack_require__(186), + CeilTo: __webpack_require__(830), + Clamp: __webpack_require__(16), + DegToRad: __webpack_require__(34), + Difference: __webpack_require__(831), + Euler: __webpack_require__(832), + Factorial: __webpack_require__(349), + FloatBetween: __webpack_require__(132), + FloorTo: __webpack_require__(833), + FromPercent: __webpack_require__(94), + GetSpeed: __webpack_require__(834), + IsEven: __webpack_require__(835), + IsEvenStrict: __webpack_require__(836), + Linear: __webpack_require__(130), + MaxAdd: __webpack_require__(837), + MinSub: __webpack_require__(838), + Percent: __webpack_require__(839), + RadToDeg: __webpack_require__(188), + RandomXY: __webpack_require__(840), + RandomXYZ: __webpack_require__(841), + RandomXYZW: __webpack_require__(842), + Rotate: __webpack_require__(354), + RotateAround: __webpack_require__(300), + RotateAroundDistance: __webpack_require__(174), + RotateTo: __webpack_require__(843), + RoundAwayFromZero: __webpack_require__(355), + RoundTo: __webpack_require__(844), + SinCosTableGenerator: __webpack_require__(845), + SmootherStep: __webpack_require__(175), + SmoothStep: __webpack_require__(176), + ToXY: __webpack_require__(846), + TransformXY: __webpack_require__(169), + Within: __webpack_require__(847), + Wrap: __webpack_require__(64), // Vector classes Vector2: __webpack_require__(3), - Vector3: __webpack_require__(81), - Vector4: __webpack_require__(129), - Matrix3: __webpack_require__(346), - Matrix4: __webpack_require__(347), - Quaternion: __webpack_require__(348), - RotateVec3: __webpack_require__(806) + Vector3: __webpack_require__(37), + Vector4: __webpack_require__(135), + Matrix3: __webpack_require__(356), + Matrix4: __webpack_require__(73), + Quaternion: __webpack_require__(357), + RotateVec3: __webpack_require__(848) }; @@ -41254,7 +44964,7 @@ module.exports = PhaserMath; /***/ }), -/* 181 */ +/* 186 */ /***/ (function(module, exports) { /** @@ -41291,7 +45001,7 @@ module.exports = CatmullRom; /***/ }), -/* 182 */ +/* 187 */ /***/ (function(module, exports) { /** @@ -41306,10 +45016,10 @@ module.exports = CatmullRom; * @function Phaser.Math.Between * @since 3.0.0 * - * @param {integer} min - The minimum value. - * @param {integer} max - The maximum value. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. * - * @return {integer} The random integer. + * @return {number} The random integer. */ var Between = function (min, max) { @@ -41320,7 +45030,7 @@ module.exports = Between; /***/ }), -/* 183 */ +/* 188 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41339,7 +45049,7 @@ var CONST = __webpack_require__(13); * * @param {number} radians - The angle in radians to convert ot degrees. * - * @return {integer} The given angle converted to degrees. + * @return {number} The given angle converted to degrees. */ var RadToDeg = function (radians) { @@ -41350,7 +45060,7 @@ module.exports = RadToDeg; /***/ }), -/* 184 */ +/* 189 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41360,11 +45070,11 @@ module.exports = RadToDeg; */ /** - * @typedef {object} Phaser.Plugins.DefaultPlugins - * - * @property {array} Global - These are the Global Managers that are created by the Phaser.Game instance. - * @property {array} CoreScene - These are the core plugins that are installed into every Scene.Systems instance, no matter what. - * @property {array} DefaultScene - These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + * The Default Plugins. + * + * @namespace Phaser.Plugins.DefaultPlugins + * @memberof Phaser.Plugins + * @since 3.0.0 */ var DefaultPlugins = { @@ -41386,7 +45096,8 @@ var DefaultPlugins = { 'registry', 'scale', 'sound', - 'textures' + 'textures', + 'renderer' ], @@ -41451,8 +45162,8 @@ module.exports = DefaultPlugins; /***/ }), -/* 185 */ -/***/ (function(module, exports) { +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -41461,55 +45172,21 @@ module.exports = DefaultPlugins; */ /** - * Translates the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.ProjectOrtho - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} left - The left value. - * @param {number} right - The right value. - * @param {number} bottom - The bottom value. - * @param {number} top - The top value. - * @param {number} near - The near value. - * @param {number} far - The far value. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. + * @namespace Phaser.Renderer.WebGL.Events */ -var ProjectOrtho = function (model, left, right, bottom, top, near, far) -{ - var projectionMatrix = model.projectionMatrix; - var leftRight = 1 / (left - right); - var bottomTop = 1 / (bottom - top); - var nearFar = 1 / (near - far); - projectionMatrix[0] = -2 * leftRight; - projectionMatrix[1] = 0; - projectionMatrix[2] = 0; - projectionMatrix[3] = 0; - projectionMatrix[4] = 0; - projectionMatrix[5] = -2 * bottomTop; - projectionMatrix[6] = 0; - projectionMatrix[7] = 0; - projectionMatrix[8] = 0; - projectionMatrix[9] = 0; - projectionMatrix[10] = 2 * nearFar; - projectionMatrix[11] = 0; - projectionMatrix[12] = (left + right) * leftRight; - projectionMatrix[13] = (top + bottom) * bottomTop; - projectionMatrix[14] = (far + near) * nearFar; - projectionMatrix[15] = 1; +module.exports = { - model.projectionMatrixDirty = true; + POST_RENDER: __webpack_require__(849), + PRE_RENDER: __webpack_require__(850), + RENDER: __webpack_require__(851), + RESIZE: __webpack_require__(852) - return model; }; -module.exports = ProjectOrtho; - /***/ }), -/* 186 */ +/* 191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41595,7 +45272,7 @@ module.exports = FromPoints; /***/ }), -/* 187 */ +/* 192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41606,10 +45283,10 @@ module.exports = FromPoints; var CONST = { - CENTER: __webpack_require__(370), - ORIENTATION: __webpack_require__(371), - SCALE_MODE: __webpack_require__(372), - ZOOM: __webpack_require__(373) + CENTER: __webpack_require__(380), + ORIENTATION: __webpack_require__(381), + SCALE_MODE: __webpack_require__(382), + ZOOM: __webpack_require__(383) }; @@ -41617,7 +45294,7 @@ module.exports = CONST; /***/ }), -/* 188 */ +/* 193 */ /***/ (function(module, exports) { /** @@ -41646,7 +45323,7 @@ module.exports = RemoveFromDOM; /***/ }), -/* 189 */ +/* 194 */ /***/ (function(module, exports) { /** @@ -41661,7 +45338,7 @@ var INPUT_CONST = { * The mouse pointer is being held down. * * @name Phaser.Input.MOUSE_DOWN - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_DOWN: 0, @@ -41670,7 +45347,7 @@ var INPUT_CONST = { * The mouse pointer is being moved. * * @name Phaser.Input.MOUSE_MOVE - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_MOVE: 1, @@ -41679,7 +45356,7 @@ var INPUT_CONST = { * The mouse pointer is released. * * @name Phaser.Input.MOUSE_UP - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_UP: 2, @@ -41688,7 +45365,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_START - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_START: 3, @@ -41697,7 +45374,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_MOVE - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_MOVE: 4, @@ -41706,7 +45383,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_END - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_END: 5, @@ -41715,7 +45392,7 @@ var INPUT_CONST = { * The pointer lock has changed. * * @name Phaser.Input.POINTER_LOCK_CHANGE - * @type {integer} + * @type {number} * @since 3.10.0 */ POINTER_LOCK_CHANGE: 6, @@ -41724,7 +45401,7 @@ var INPUT_CONST = { * A touch pointer has been been cancelled by the browser. * * @name Phaser.Input.TOUCH_CANCEL - * @type {integer} + * @type {number} * @since 3.15.0 */ TOUCH_CANCEL: 7, @@ -41733,7 +45410,7 @@ var INPUT_CONST = { * The mouse wheel changes. * * @name Phaser.Input.MOUSE_WHEEL - * @type {integer} + * @type {number} * @since 3.18.0 */ MOUSE_WHEEL: 8 @@ -41744,7 +45421,7 @@ module.exports = INPUT_CONST; /***/ }), -/* 190 */ +/* 195 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41754,13 +45431,13 @@ module.exports = INPUT_CONST; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(133); -var DefaultPlugins = __webpack_require__(184); +var CONST = __webpack_require__(139); +var DefaultPlugins = __webpack_require__(189); var Events = __webpack_require__(20); -var GetPhysicsPlugins = __webpack_require__(386); -var GetScenePlugins = __webpack_require__(387); +var GetPhysicsPlugins = __webpack_require__(396); +var GetScenePlugins = __webpack_require__(397); var NOOP = __webpack_require__(1); -var Settings = __webpack_require__(388); +var Settings = __webpack_require__(398); /** * @classdesc @@ -42114,13 +45791,15 @@ var Systems = new Class({ */ step: function (time, delta) { - this.events.emit(Events.PRE_UPDATE, time, delta); + var events = this.events; - this.events.emit(Events.UPDATE, time, delta); + events.emit(Events.PRE_UPDATE, time, delta); + + events.emit(Events.UPDATE, time, delta); this.sceneUpdate.call(this.scene, time, delta); - this.events.emit(Events.POST_UPDATE, time, delta); + events.emit(Events.POST_UPDATE, time, delta); }, /** @@ -42180,13 +45859,16 @@ var Systems = new Class({ */ pause: function (data) { + var events = this.events; + var settings = this.settings; + if (this.settings.active) { - this.settings.status = CONST.PAUSED; + settings.status = CONST.PAUSED; - this.settings.active = false; + settings.active = false; - this.events.emit(Events.PAUSE, this, data); + events.emit(Events.PAUSE, this, data); } return this; @@ -42205,13 +45887,16 @@ var Systems = new Class({ */ resume: function (data) { + var events = this.events; + var settings = this.settings; + if (!this.settings.active) { - this.settings.status = CONST.RUNNING; + settings.status = CONST.RUNNING; - this.settings.active = true; + settings.active = true; - this.events.emit(Events.RESUME, this, data); + events.emit(Events.RESUME, this, data); } return this; @@ -42235,12 +45920,15 @@ var Systems = new Class({ */ sleep: function (data) { - this.settings.status = CONST.SLEEPING; + var events = this.events; + var settings = this.settings; - this.settings.active = false; - this.settings.visible = false; + settings.status = CONST.SLEEPING; - this.events.emit(Events.SLEEP, this, data); + settings.active = false; + settings.visible = false; + + events.emit(Events.SLEEP, this, data); return this; }, @@ -42258,6 +45946,7 @@ var Systems = new Class({ */ wake: function (data) { + var events = this.events; var settings = this.settings; settings.status = CONST.RUNNING; @@ -42265,11 +45954,11 @@ var Systems = new Class({ settings.active = true; settings.visible = true; - this.events.emit(Events.WAKE, this, data); + events.emit(Events.WAKE, this, data); if (settings.isTransition) { - this.events.emit(Events.TRANSITION_WAKE, settings.transitionFrom, settings.transitionDuration); + events.emit(Events.TRANSITION_WAKE, settings.transitionFrom, settings.transitionDuration); } return this; @@ -42438,21 +46127,24 @@ var Systems = new Class({ */ start: function (data) { + var events = this.events; + var settings = this.settings; + if (data) { - this.settings.data = data; + settings.data = data; } - this.settings.status = CONST.START; + settings.status = CONST.START; - this.settings.active = true; - this.settings.visible = true; + settings.active = true; + settings.visible = true; // For plugins to listen out for - this.events.emit(Events.START, this); + events.emit(Events.START, this); // For user-land code to listen out for - this.events.emit(Events.READY, this, data); + events.emit(Events.READY, this, data); }, /** @@ -42470,17 +46162,20 @@ var Systems = new Class({ */ shutdown: function (data) { - this.events.off(Events.TRANSITION_INIT); - this.events.off(Events.TRANSITION_START); - this.events.off(Events.TRANSITION_COMPLETE); - this.events.off(Events.TRANSITION_OUT); + var events = this.events; + var settings = this.settings; - this.settings.status = CONST.SHUTDOWN; + events.off(Events.TRANSITION_INIT); + events.off(Events.TRANSITION_START); + events.off(Events.TRANSITION_COMPLETE); + events.off(Events.TRANSITION_OUT); - this.settings.active = false; - this.settings.visible = false; + settings.status = CONST.SHUTDOWN; - this.events.emit(Events.SHUTDOWN, this, data); + settings.active = false; + settings.visible = false; + + events.emit(Events.SHUTDOWN, this, data); }, /** @@ -42495,14 +46190,17 @@ var Systems = new Class({ */ destroy: function () { - this.settings.status = CONST.DESTROYED; + var events = this.events; + var settings = this.settings; - this.settings.active = false; - this.settings.visible = false; + settings.status = CONST.DESTROYED; - this.events.emit(Events.DESTROY, this); + settings.active = false; + settings.visible = false; - this.events.removeAllListeners(); + events.emit(Events.DESTROY, this); + + events.removeAllListeners(); var props = [ 'scene', 'game', 'anims', 'cache', 'plugins', 'registry', 'sound', 'textures', 'add', 'camera', 'displayList', 'events', 'make', 'scenePlugin', 'updateList' ]; @@ -42518,7 +46216,7 @@ module.exports = Systems; /***/ }), -/* 191 */ +/* 196 */ /***/ (function(module, exports) { /** @@ -42555,7 +46253,7 @@ module.exports = UppercaseFirst; /***/ }), -/* 192 */ +/* 197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42565,8 +46263,8 @@ module.exports = UppercaseFirst; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(97); -var TextureSource = __webpack_require__(391); +var Frame = __webpack_require__(104); +var TextureSource = __webpack_require__(401); var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; @@ -42576,7 +46274,7 @@ var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; * The Frames represent the different areas of the Texture. For example a texture atlas * may have many Frames, one for each element within the atlas. Where-as a single image would have * just one frame, that encompasses the whole image. - * + * * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. * This frame represents the entirety of the source image. * @@ -42675,12 +46373,12 @@ var Texture = new Class({ /** * The total number of Frames in this Texture, including the `__BASE` frame. - * + * * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. * * @name Phaser.Textures.Texture#frameTotal - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -42697,14 +46395,14 @@ var Texture = new Class({ * Adds a new Frame to this Texture. * * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. - * + * * The name given must be unique within this Texture. If it already exists, this method will return `null`. * * @method Phaser.Textures.Texture#add * @since 3.0.0 * - * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. * @param {number} width - The width of this Frame. @@ -42739,7 +46437,7 @@ var Texture = new Class({ /** * Removes the given Frame from this Texture. The Frame is destroyed immediately. - * + * * Any Game Objects using this Frame should stop using it _before_ you remove it, * as it does not happen automatically. * @@ -42791,7 +46489,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#get * @since 3.0.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {Phaser.Textures.Frame} The Texture Frame. */ @@ -42826,7 +46524,7 @@ var Texture = new Class({ * * @param {Phaser.Textures.TextureSource} source - The TextureSource to check. * - * @return {integer} The index of the TextureSource within this Texture, or -1 if not in this Texture. + * @return {number} The index of the TextureSource within this Texture, or -1 if not in this Texture. */ getTextureSourceIndex: function (source) { @@ -42847,7 +46545,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getFramesFromTextureSource * @since 3.0.0 * - * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from. + * @param {number} sourceIndex - The index of the TextureSource to get the Frames from. * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? * * @return {Phaser.Textures.Frame[]} An array of Texture Frames. @@ -42916,7 +46614,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getSourceImage * @since 3.0.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} The DOM Image, Canvas Element or Render Texture. */ @@ -42950,7 +46648,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getDataSourceImage * @since 3.7.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element. */ @@ -42995,7 +46693,7 @@ var Texture = new Class({ { data = [ data ]; } - + for (var i = 0; i < data.length; i++) { var source = this.source[i]; @@ -43075,7 +46773,7 @@ module.exports = Texture; /***/ }), -/* 193 */ +/* 198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43084,7 +46782,7 @@ module.exports = Texture; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Returns all elements in the array. @@ -43103,8 +46801,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} All matching elements from the array. */ @@ -43137,7 +46835,7 @@ module.exports = GetAll; /***/ }), -/* 194 */ +/* 199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43152,46 +46850,46 @@ module.exports = GetAll; module.exports = { - Matrix: __webpack_require__(942), + Matrix: __webpack_require__(998), - Add: __webpack_require__(949), - AddAt: __webpack_require__(950), - BringToTop: __webpack_require__(951), - CountAllMatching: __webpack_require__(952), - Each: __webpack_require__(953), - EachInRange: __webpack_require__(954), - FindClosestInSorted: __webpack_require__(298), - GetAll: __webpack_require__(193), - GetFirst: __webpack_require__(395), - GetRandom: __webpack_require__(196), - MoveDown: __webpack_require__(955), - MoveTo: __webpack_require__(956), - MoveUp: __webpack_require__(957), - NumberArray: __webpack_require__(302), - NumberArrayStep: __webpack_require__(958), - QuickSelect: __webpack_require__(403), - Range: __webpack_require__(404), - Remove: __webpack_require__(96), - RemoveAt: __webpack_require__(959), - RemoveBetween: __webpack_require__(960), - RemoveRandomElement: __webpack_require__(961), - Replace: __webpack_require__(962), - RotateLeft: __webpack_require__(295), - RotateRight: __webpack_require__(296), - SafeRange: __webpack_require__(70), - SendToBack: __webpack_require__(963), - SetAll: __webpack_require__(964), - Shuffle: __webpack_require__(121), - SortByDigits: __webpack_require__(300), - SpliceOne: __webpack_require__(82), - StableSort: __webpack_require__(139), - Swap: __webpack_require__(965) + Add: __webpack_require__(1006), + AddAt: __webpack_require__(1007), + BringToTop: __webpack_require__(1008), + CountAllMatching: __webpack_require__(1009), + Each: __webpack_require__(1010), + EachInRange: __webpack_require__(1011), + FindClosestInSorted: __webpack_require__(310), + GetAll: __webpack_require__(198), + GetFirst: __webpack_require__(405), + GetRandom: __webpack_require__(201), + MoveDown: __webpack_require__(1012), + MoveTo: __webpack_require__(1013), + MoveUp: __webpack_require__(1014), + NumberArray: __webpack_require__(314), + NumberArrayStep: __webpack_require__(1015), + QuickSelect: __webpack_require__(413), + Range: __webpack_require__(414), + Remove: __webpack_require__(87), + RemoveAt: __webpack_require__(1016), + RemoveBetween: __webpack_require__(1017), + RemoveRandomElement: __webpack_require__(1018), + Replace: __webpack_require__(1019), + RotateLeft: __webpack_require__(170), + RotateRight: __webpack_require__(171), + SafeRange: __webpack_require__(77), + SendToBack: __webpack_require__(1020), + SetAll: __webpack_require__(1021), + Shuffle: __webpack_require__(127), + SortByDigits: __webpack_require__(312), + SpliceOne: __webpack_require__(103), + StableSort: __webpack_require__(90), + Swap: __webpack_require__(1022) }; /***/ }), -/* 195 */ +/* 200 */ /***/ (function(module, exports) { /** @@ -43203,22 +46901,23 @@ module.exports = { /** * Checks if an array can be used as a matrix. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: * * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] * ``` * * @function Phaser.Utils.Array.Matrix.CheckMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [matrix] * @@ -43252,7 +46951,7 @@ module.exports = CheckMatrix; /***/ }), -/* 196 */ +/* 201 */ /***/ (function(module, exports) { /** @@ -43268,8 +46967,8 @@ module.exports = CheckMatrix; * @since 3.0.0 * * @param {array} array - The array to select the random entry from. - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {*} A random element from the array, or `null` if no element could be found in the range given. */ @@ -43287,7 +46986,7 @@ module.exports = GetRandom; /***/ }), -/* 197 */ +/* 202 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43297,8 +46996,8 @@ module.exports = GetRandom; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(405); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(415); /** * @classdesc @@ -43374,7 +47073,7 @@ var ProcessQueue = new Class({ * The total number of items awaiting processing. * * @name Phaser.Structs.ProcessQueue#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -43556,7 +47255,7 @@ var ProcessQueue = new Class({ * The number of entries in the active list. * * @name Phaser.Structs.ProcessQueue#length - * @type {integer} + * @type {number} * @readonly * @since 3.20.0 */ @@ -43590,7 +47289,7 @@ module.exports = ProcessQueue; /***/ }), -/* 198 */ +/* 203 */ /***/ (function(module, exports) { /** @@ -43609,7 +47308,7 @@ module.exports = ProcessQueue; * @param {Node} node - The XML Node. * @param {string} attribute - The attribute to read. * - * @return {integer} The parsed value. + * @return {number} The parsed value. */ function getValue (node, attribute) { @@ -43625,8 +47324,8 @@ function getValue (node, attribute) * * @param {XMLDocument} xml - The XML Document to parse the font from. * @param {Phaser.Textures.Frame} frame - The texture frame to take into account when creating the uv data. - * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing=0] - The y-axis spacing to add to the line height. * @param {Phaser.Textures.Texture} [texture] - If provided, each glyph in the Bitmap Font will be added to this texture as a frame. * * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. @@ -43751,7 +47450,7 @@ module.exports = ParseXMLBitmapFont; /***/ }), -/* 199 */ +/* 204 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43760,19 +47459,19 @@ module.exports = ParseXMLBitmapFont; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlitterRender = __webpack_require__(975); -var Bob = __webpack_require__(407); +var BlitterRender = __webpack_require__(1032); +var Bob = __webpack_require__(417); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Frame = __webpack_require__(97); +var Frame = __webpack_require__(104); var GameObject = __webpack_require__(14); -var List = __webpack_require__(137); +var List = __webpack_require__(105); /** * @callback CreateCallback * * @param {Phaser.GameObjects.Bob} bob - The Bob that was created by the Blitter. - * @param {integer} index - The position of the Bob within the Blitter display list. + * @param {number} index - The position of the Bob within the Blitter display list. */ /** @@ -43812,7 +47511,7 @@ var List = __webpack_require__(137); * @param {number} [x=0] - The x coordinate of this Game Object in world space. * @param {number} [y=0] - The y coordinate of this Game Object in world space. * @param {string} [texture='__DEFAULT'] - The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. - * @param {(string|integer)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. + * @param {(string|number)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. */ var Blitter = new Class({ @@ -43886,9 +47585,9 @@ var Blitter = new Class({ * * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. * @param {boolean} [visible=true] - Should the created Bob render or not? - * @param {integer} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. + * @param {number} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. * * @return {Phaser.GameObjects.Bob} The newly created Bob object. */ @@ -43922,8 +47621,8 @@ var Blitter = new Class({ * @since 3.0.0 * * @param {CreateCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob. - * @param {integer} quantity - The quantity of Bob objects to create. - * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {number} quantity - The quantity of Bob objects to create. + * @param {(string|number|Phaser.Textures.Frame|string[]|number[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. * @param {boolean} [visible=true] - Should the created Bob render or not? * * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. @@ -43953,8 +47652,8 @@ var Blitter = new Class({ * @method Phaser.GameObjects.Blitter#createMultiple * @since 3.0.0 * - * @param {integer} quantity - The quantity of Bob objects to create. - * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {number} quantity - The quantity of Bob objects to create. + * @param {(string|number|Phaser.Textures.Frame|string[]|number[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. * @param {boolean} [visible=true] - Should the created Bob render or not? * * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. @@ -44050,7 +47749,7 @@ module.exports = Blitter; /***/ }), -/* 200 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44060,16 +47759,15 @@ module.exports = Blitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(194); -var BlendModes = __webpack_require__(54); +var ArrayUtils = __webpack_require__(199); +var BlendModes = __webpack_require__(48); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Events = __webpack_require__(29); +var Events = __webpack_require__(32); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); var Rectangle = __webpack_require__(9); -var Render = __webpack_require__(978); -var Union = __webpack_require__(408); +var Render = __webpack_require__(1035); +var Union = __webpack_require__(418); var Vector2 = __webpack_require__(3); /** @@ -44100,6 +47798,9 @@ var Vector2 = __webpack_require__(3); * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. * + * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, + * or the input area will become misaligned. + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children @@ -44123,6 +47824,7 @@ var Vector2 = __webpack_require__(3); * @extends Phaser.GameObjects.Components.ComputedSize * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @@ -44141,6 +47843,7 @@ var Container = new Class({ Components.ComputedSize, Components.Depth, Components.Mask, + Components.Pipeline, Components.Transform, Components.Visible, Render @@ -44187,7 +47890,7 @@ var Container = new Class({ * the maximum limit the Container can grow in size to. * * @name Phaser.GameObjects.Container#maxSize - * @type {integer} + * @type {number} * @default -1 * @since 3.4.0 */ @@ -44197,7 +47900,7 @@ var Container = new Class({ * The cursor position. * * @name Phaser.GameObjects.Container#position - * @type {integer} + * @type {number} * @since 3.4.0 */ this.position = 0; @@ -44274,7 +47977,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorX * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorX = 1; @@ -44301,10 +48004,12 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorY * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorY = 1; + this.initPipeline(); + this.setPosition(x, y); this.clearAlpha(); @@ -44512,7 +48217,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene); } }, @@ -44537,7 +48242,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene); } }, @@ -44623,7 +48328,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container. - * @param {integer} [index=0] - The position to insert the Game Object/s at. + * @param {number} [index=0] - The position to insert the Game Object/s at. * * @return {this} This Container instance. */ @@ -44640,7 +48345,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getAt * @since 3.4.0 * - * @param {integer} index - The position to get the Game Object from. + * @param {number} index - The position to get the Game Object from. * * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found. */ @@ -44657,7 +48362,7 @@ var Container = new Class({ * * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container. * - * @return {integer} The index of the Game Object in this Container, or -1 if not found. + * @return {number} The index of the Game Object in this Container, or -1 if not found. */ getIndex: function (child) { @@ -44718,8 +48423,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getRandom * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty. */ @@ -44743,8 +48448,8 @@ var Container = new Class({ * * @param {string} property - The property to test on each Game Object in the Container. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found. */ @@ -44773,8 +48478,8 @@ var Container = new Class({ * * @param {string} [property] - The property to test on each Game Object in the Container. * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container. */ @@ -44796,10 +48501,10 @@ var Container = new Class({ * * @param {string} property - The property to check. * @param {any} value - The value to check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * - * @return {integer} The total number of Game Objects in this Container with a property matching the given value. + * @return {number} The total number of Game Objects in this Container with a property matching the given value. */ count: function (property, value, startIndex, endIndex) { @@ -44837,7 +48542,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject} child - The Game Object to move. - * @param {integer} index - The new position of the Game Object in this Container. + * @param {number} index - The new position of the Game Object in this Container. * * @return {this} This Container instance. */ @@ -44891,7 +48596,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeAt * @since 3.4.0 * - * @param {integer} index - The index of the Game Object to be removed. + * @param {number} index - The index of the Game Object to be removed. * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container. * * @return {this} This Container instance. @@ -44916,8 +48621,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeBetween * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container. * * @return {this} This Container instance. @@ -45124,8 +48829,8 @@ var Container = new Class({ * * @param {string} property - The property that must exist on the Game Object. * @param {any} value - The value to get the property to. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {this} This Container instance. */ @@ -45237,7 +48942,7 @@ var Container = new Class({ * them from physics bodies if not accounted for in your code. * * @method Phaser.GameObjects.Container#setScrollFactor - * @since 3.0.0 + * @since 3.4.0 * * @param {number} x - The horizontal scroll factor of this Game Object. * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. @@ -45266,7 +48971,7 @@ var Container = new Class({ * The number of Game Objects inside this Container. * * @name Phaser.GameObjects.Container#length - * @type {integer} + * @type {number} * @readonly * @since 3.4.0 */ @@ -45415,7 +49120,7 @@ module.exports = Container; /***/ }), -/* 201 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45424,9 +49129,9 @@ module.exports = Container; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(140); +var BitmapText = __webpack_require__(144); var Class = __webpack_require__(0); -var Render = __webpack_require__(983); +var Render = __webpack_require__(1040); /** * @classdesc @@ -45468,7 +49173,7 @@ var Render = __webpack_require__(983); * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size of this Bitmap Text. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. */ var DynamicBitmapText = new Class({ @@ -45648,7 +49353,7 @@ module.exports = DynamicBitmapText; /***/ }), -/* 202 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45657,26 +49362,24 @@ module.exports = DynamicBitmapText; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(93); +var BaseCamera = __webpack_require__(99); var Class = __webpack_require__(0); -var Commands = __webpack_require__(203); -var ComponentsAlpha = __webpack_require__(280); -var ComponentsBlendMode = __webpack_require__(281); -var ComponentsDepth = __webpack_require__(282); -var ComponentsMask = __webpack_require__(286); -var ComponentsPipeline = __webpack_require__(165); -var ComponentsTransform = __webpack_require__(291); -var ComponentsVisible = __webpack_require__(292); -var ComponentsScrollFactor = __webpack_require__(289); - -var TransformMatrix = __webpack_require__(31); - -var Ellipse = __webpack_require__(98); +var Commands = __webpack_require__(208); +var ComponentsAlpha = __webpack_require__(295); +var ComponentsBlendMode = __webpack_require__(296); +var ComponentsDepth = __webpack_require__(297); +var ComponentsMask = __webpack_require__(301); +var ComponentsPipeline = __webpack_require__(166); +var ComponentsScrollFactor = __webpack_require__(304); +var ComponentsTransform = __webpack_require__(305); +var ComponentsVisible = __webpack_require__(306); +var Ellipse = __webpack_require__(106); var GameObject = __webpack_require__(14); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); var MATH_CONST = __webpack_require__(13); -var Render = __webpack_require__(989); +var PIPELINES_CONST = __webpack_require__(82); +var Render = __webpack_require__(1046); /** * @classdesc @@ -45763,7 +49466,7 @@ var Graphics = new Class({ GameObject.call(this, scene, 'Graphics'); this.setPosition(x, y); - this.initPipeline(); + this.initPipeline(PIPELINES_CONST.GRAPHICS_PIPELINE); /** * The horizontal display origin of the Graphics. @@ -45855,36 +49558,6 @@ var Graphics = new Class({ */ this._lineWidth = 1.0; - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix3 = new TransformMatrix(); - this.setDefaultStyles(options); }, @@ -45988,21 +49661,28 @@ var Graphics = new Class({ * @webglOnly * @since 3.12.0 * - * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. - * @param {integer} topRight - The tint being applied to the top-right of the Game Object. - * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. - * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. - * @param {number} [alpha=1] - The fill alpha. + * @param {number} topLeft - The top left fill color. + * @param {number} topRight - The top right fill color. + * @param {number} bottomLeft - The bottom left fill color. + * @param {number} bottomRight - The bottom right fill color. Not used when filling triangles. + * @param {number} [alphaTopLeft=1] - The top left alpha value. If you give only this value, it's used for all corners. + * @param {number} [alphaTopRight=1] - The top right alpha value. + * @param {number} [alphaBottomLeft=1] - The bottom left alpha value. + * @param {number} [alphaBottomRight=1] - The bottom right alpha value. * * @return {this} This Game Object. */ - fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alpha) + fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alphaTopLeft, alphaTopRight, alphaBottomLeft, alphaBottomRight) { - if (alpha === undefined) { alpha = 1; } + if (alphaTopLeft === undefined) { alphaTopLeft = 1; } + if (alphaTopRight === undefined) { alphaTopRight = alphaTopLeft; } + if (alphaBottomLeft === undefined) { alphaBottomLeft = alphaTopLeft; } + if (alphaBottomRight === undefined) { alphaBottomRight = alphaTopLeft; } this.commandBuffer.push( Commands.GRADIENT_FILL_STYLE, - alpha, topLeft, topRight, bottomLeft, bottomRight + alphaTopLeft, alphaTopRight, alphaBottomLeft, alphaBottomRight, + topLeft, topRight, bottomLeft, bottomRight ); return this; @@ -46026,10 +49706,10 @@ var Graphics = new Class({ * @since 3.12.0 * * @param {number} lineWidth - The stroke width. - * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. - * @param {integer} topRight - The tint being applied to the top-right of the Game Object. - * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. - * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. + * @param {number} topLeft - The tint being applied to the top-left of the Game Object. + * @param {number} topRight - The tint being applied to the top-right of the Game Object. + * @param {number} bottomLeft - The tint being applied to the bottom-left of the Game Object. + * @param {number} bottomRight - The tint being applied to the bottom-right of the Game Object. * @param {number} [alpha=1] - The fill alpha. * * @return {this} This Game Object. @@ -46046,62 +49726,6 @@ var Graphics = new Class({ return this; }, - /** - * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * Once set, all shapes will use this texture. Call this method with no arguments to clear it. - * - * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason, - * it works best with seamless / tileable textures. - * - * The mode argument controls how the textures are combined with the fill colors. The default value (0) will - * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture, - * and a value of 2 will use just the texture and no fill color at all. - * - * @method Phaser.GameObjects.Graphics#setTexture - * @since 3.12.0 - * @webglOnly - * - * @param {string} [key] - The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. - * @param {number} [mode=0] - The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only. - * - * @return {this} This Game Object. - */ - setTexture: function (key, frame, mode) - { - if (mode === undefined) { mode = 0; } - - if (key === undefined) - { - this.commandBuffer.push( - Commands.CLEAR_TEXTURE - ); - } - else - { - var textureFrame = this.scene.sys.textures.getFrame(key, frame); - - if (textureFrame) - { - if (mode === 2) - { - mode = 3; - } - - this.commandBuffer.push( - Commands.SET_TEXTURE, - textureFrame, - mode - ); - } - } - - return this; - }, - /** * Start a new shape path. * @@ -46457,12 +50081,16 @@ var Graphics = new Class({ this.beginPath(); this.moveTo(x + tl, y); this.lineTo(x + width - tr, y); + this.moveTo(x + width - tr, y); this.arc(x + width - tr, y + tr, tr, -MATH_CONST.TAU, 0); this.lineTo(x + width, y + height - br); + this.moveTo(x + width, y + height - br); this.arc(x + width - br, y + height - br, br, 0, MATH_CONST.TAU); this.lineTo(x + bl, y + height); + this.moveTo(x + bl, y + height); this.arc(x + bl, y + height - bl, bl, MATH_CONST.TAU, Math.PI); this.lineTo(x, y + tl); + this.moveTo(x, y + tl); this.arc(x + tl, y + tl, tl, -Math.PI, -MATH_CONST.TAU); this.strokePath(); @@ -46696,7 +50324,7 @@ var Graphics = new Class({ * @param {(array|Phaser.Geom.Point[])} points - The points to stroke. * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. - * @param {integer} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`. + * @param {number} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`. * * @return {this} This Game Object. */ @@ -46743,7 +50371,7 @@ var Graphics = new Class({ * @param {(array|Phaser.Geom.Point[])} points - The points to fill. * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. - * @param {integer} [endIndex] - The index of `points` to stop at. Defaults to `points.length`. + * @param {number} [endIndex] - The index of `points` to stop at. Defaults to `points.length`. * * @return {this} This Game Object. */ @@ -46784,7 +50412,7 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to stroke. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -46807,7 +50435,7 @@ var Graphics = new Class({ * @param {number} y - The y coordinate of the center of the ellipse. * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -46829,7 +50457,7 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to fill. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -46852,7 +50480,7 @@ var Graphics = new Class({ * @param {number} y - The y coordinate of the center of the ellipse. * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -47109,8 +50737,8 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {(string|HTMLCanvasElement)} key - The key to store the texture with in the Texture Manager, or a Canvas to draw to. - * @param {integer} [width] - The width of the graphics to generate. - * @param {integer} [height] - The height of the graphics to generate. + * @param {number} [width] - The width of the graphics to generate. + * @param {number} [height] - The height of the graphics to generate. * * @return {this} This Game Object. */ @@ -47163,8 +50791,8 @@ var Graphics = new Class({ if (ctx) { - // var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) - this.renderCanvas(renderer, this, 0, Graphics.TargetCamera, null, ctx, false); + // var GraphicsCanvasRenderer = function (renderer, src, camera, parentMatrix, renderTargetCtx, allowClip) + this.renderCanvas(renderer, this, Graphics.TargetCamera, null, ctx, false); if (texture) { @@ -47202,7 +50830,7 @@ module.exports = Graphics; /***/ }), -/* 203 */ +/* 208 */ /***/ (function(module, exports) { /** @@ -47230,8 +50858,6 @@ module.exports = { TRANSLATE: 16, SCALE: 17, ROTATE: 18, - SET_TEXTURE: 19, - CLEAR_TEXTURE: 20, GRADIENT_FILL_STYLE: 21, GRADIENT_LINE_STYLE: 22 @@ -47239,7 +50865,7 @@ module.exports = { /***/ }), -/* 204 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47281,7 +50907,763 @@ module.exports = CircumferencePoint; /***/ }), -/* 205 */ +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = __webpack_require__(48); +var Class = __webpack_require__(0); +var Components = __webpack_require__(11); +var ComponentsToJSON = __webpack_require__(168); +var DataManager = __webpack_require__(97); +var EventEmitter = __webpack_require__(10); +var GameObjectEvents = __webpack_require__(32); +var List = __webpack_require__(105); +var Render = __webpack_require__(1054); +var SceneEvents = __webpack_require__(20); +var StableSort = __webpack_require__(90); + +/** + * @classdesc + * A Layer Game Object. + * + * A Layer is a special type of Game Object that acts as a Display List. You can add any type of Game Object + * to a Layer, just as you would to a Scene. Layers can be used to visually group together 'layers' of Game + * Objects: + * + * ```javascript + * const spaceman = this.add.sprite(150, 300, 'spaceman'); + * const bunny = this.add.sprite(400, 300, 'bunny'); + * const elephant = this.add.sprite(650, 300, 'elephant'); + * + * const layer = this.add.layer(); + * + * layer.add([ spaceman, bunny, elephant ]); + * ``` + * + * The 3 sprites in the example above will now be managed by the Layer they were added to. Therefore, + * if you then set `layer.setVisible(false)` they would all vanish from the display. + * + * You can also control the depth of the Game Objects within the Layer. For example, calling the + * `setDepth` method of a child of a Layer will allow you to adjust the depth of that child _within the + * Layer itself_, rather than the whole Scene. The Layer, too, can have its depth set as well. + * + * The Layer class also offers many different methods for manipulating the list, such as the + * methods `moveUp`, `moveDown`, `sendToBack`, `bringToTop` and so on. These allow you to change the + * display list position of the Layers children, causing it to adjust the order in which they are + * rendered. Using `setDepth` on a child allows you to override this. + * + * Layers can have Post FX Pipelines set, which allows you to easily enable a post pipeline across + * a whole range of children, which, depending on the effect, can often be far more efficient that doing so + * on a per-child basis. + * + * Layers have no position or size within the Scene. This means you cannot enable a Layer for + * physics or input, or change the position, rotation or scale of a Layer. They also have no scroll + * factor, texture, tint, origin, crop or bounds. + * + * If you need those kind of features then you should use a Container instead. Containers can be added + * to Layers, but Layers cannot be added to Containers. + * + * However, you can set the Alpha, Blend Mode, Depth, Mask and Visible state of a Layer. These settings + * will impact all children being rendered by the Layer. + * + * @class Layer + * @extends Phaser.Structs.List. + * @memberof Phaser.GameObjects + * @constructor + * @since 3.50.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Layer. + */ +var Layer = new Class({ + + Extends: List, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.Visible, + EventEmitter, + Render + ], + + initialize: + + function Layer (scene, children) + { + List.call(this, scene); + EventEmitter.call(this); + + /** + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * + * @name Phaser.GameObjects.Layer#scene + * @type {Phaser.Scene} + * @since 3.50.0 + */ + this.scene = scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.Layer#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + * + * @name Phaser.GameObjects.Layer#type + * @type {string} + * @since 3.50.0 + */ + this.type = 'Layer'; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @name Phaser.GameObjects.Layer#state + * @type {(number|string)} + * @since 3.50.0 + */ + this.state = 0; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.Layer#name + * @type {string} + * @default '' + * @since 3.50.0 + */ + this.name = ''; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + * + * @name Phaser.GameObjects.Layer#active + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.active = true; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * + * @name Phaser.GameObjects.Layer#data + * @type {Phaser.Data.DataManager} + * @default null + * @since 3.50.0 + */ + this.data = null; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.Layer#renderFlags + * @type {number} + * @default 15 + * @since 3.50.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.Layer#cameraFilter + * @type {number} + * @default 0 + * @since 3.50.0 + */ + this.cameraFilter = 0; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + * + * @name Phaser.GameObjects.Layer#ignoreDestroy + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.ignoreDestroy = false; + + /** + * A reference to the Scene Systems. + * + * @name Phaser.GameObjects.Layer#systems + * @type {Phaser.Scenes.Systems} + * @since 3.50.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Event Emitter. + * + * @name Phaser.GameObjects.Layer#events + * @type {Phaser.Events.EventEmitter} + * @since 3.50.0 + */ + this.events = scene.sys.events; + + /** + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + * + * @name Phaser.GameObjects.Layer#sortChildrenFlag + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.sortChildrenFlag = false; + + // Set the List callbacks + this.addCallback = this.addChildCallback; + this.removeCallback = this.removeChildCallback; + + this.initPipeline(); + + this.clearAlpha(); + + this.setBlendMode(BlendModes.SKIP_CHECK); + + if (children) + { + this.add(children); + } + + // Tell the Scene to re-sort the children + scene.sys.queueDepthSort(); + }, + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * + * @method Phaser.GameObjects.Layer#setActive + * @since 3.50.0 + * + * @param {boolean} value - True if this Game Object should be set as active, false if not. + * + * @return {this} This GameObject. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * + * @method Phaser.GameObjects.Layer#setName + * @since 3.50.0 + * + * @param {string} value - The name to be given to this Game Object. + * + * @return {this} This GameObject. + */ + setName: function (value) + { + this.name = value; + + return this; + }, + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @method Phaser.GameObjects.Layer#setState + * @since 3.50.0 + * + * @param {(number|string)} value - The state of the Game Object. + * + * @return {this} This GameObject. + */ + setState: function (value) + { + this.state = value; + + return this; + }, + + /** + * Adds a Data Manager component to this Game Object. + * + * @method Phaser.GameObjects.Layer#setDataEnabled + * @since 3.50.0 + * @see Phaser.Data.DataManager + * + * @return {this} This GameObject. + */ + setDataEnabled: function () + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this; + }, + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.GameObjects.Layer#setData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This GameObject. + */ + setData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.set(key, value); + + return this; + }, + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.Layer#incData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {this} This GameObject. + */ + incData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.inc(key, value); + + return this; + }, + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.Layer#toggleData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {this} This GameObject. + */ + toggleData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.toggle(key); + + return this; + }, + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.GameObjects.Layer#getData + * @since 3.50.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + getData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this.data.get(key); + }, + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.Layer#addedToScene + * @since 3.50.0 + */ + addedToScene: function () + { + }, + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.Layer#removedFromScene + * @since 3.50.0 + */ + removedFromScene: function () + { + }, + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * + * @method Phaser.GameObjects.Layer#update + * @since 3.50.0 + * + * @param {...*} [args] - args + */ + update: function () + { + }, + + /** + * Returns a JSON representation of the Game Object. + * + * @method Phaser.GameObjects.Layer#toJSON + * @since 3.50.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return ComponentsToJSON(this); + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * + * @method Phaser.GameObjects.Layer#willRender + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. + * + * @return {boolean} True if the Game Object should be rendered, otherwise false. + */ + willRender: function (camera) + { + return !(this.renderFlags !== 15 || this.list.length === 0 || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + }, + + /** + * Internal method called from `List.addCallback`. + * + * @method Phaser.GameObjects.Layer#addChildCallback + * @private + * @fires Phaser.Scenes.Events#ADDED_TO_SCENE + * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the list. + */ + addChildCallback: function (gameObject) + { + gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + + if (gameObject.displayList) + { + gameObject.displayList.remove(gameObject); + } + + gameObject.displayList = this; + + this.queueDepthSort(); + + this.events.emit(SceneEvents.ADDED_TO_SCENE, gameObject, this.scene); + }, + + /** + * Internal method called from `List.removeCallback`. + * + * @method Phaser.GameObjects.Layer#removeChildCallback + * @private + * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the list. + */ + removeChildCallback: function (gameObject) + { + gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + + gameObject.displayList = null; + + this.queueDepthSort(); + + this.events.emit(SceneEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + }, + + /** + * Force a sort of the display list on the next call to depthSort. + * + * @method Phaser.GameObjects.Layer#queueDepthSort + * @since 3.50.0 + */ + queueDepthSort: function () + { + this.sortChildrenFlag = true; + }, + + /** + * Immediately sorts the display list if the flag is set. + * + * @method Phaser.GameObjects.Layer#depthSort + * @since 3.50.0 + */ + depthSort: function () + { + if (this.sortChildrenFlag) + { + StableSort(this.list, this.sortByDepth); + + this.sortChildrenFlag = false; + } + }, + + /** + * Compare the depth of two Game Objects. + * + * @method Phaser.GameObjects.Layer#sortByDepth + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} childA - The first Game Object. + * @param {Phaser.GameObjects.GameObject} childB - The second Game Object. + * + * @return {number} The difference between the depths of each Game Object. + */ + sortByDepth: function (childA, childB) + { + return childA._depth - childB._depth; + }, + + /** + * Returns an array which contains all Game Objects within this Layer. + * + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + * + * @method Phaser.GameObjects.Layer#getChildren + * @since 3.50.0 + * + * @return {Phaser.GameObjects.GameObject[]} The group members. + */ + getChildren: function () + { + return this.list; + }, + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * + * @method Phaser.GameObjects.Layer#destroy + * @fires Phaser.GameObjects.Events#DESTROY + * @since 3.50.0 + * + * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown? + */ + destroy: function (fromScene) + { + if (fromScene === undefined) { fromScene = false; } + + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + this.removeAll(); + this.removeAllListeners(); + this.resetPostPipeline(true); + + this.emit(GameObjectEvents.DESTROY, this); + + if (!fromScene && this.displayList) + { + this.displayList.remove(this); + this.displayList.queueDepthSort(); + } + + if (this.data) + { + this.data.destroy(); + + this.data = undefined; + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + this.displayList = undefined; + this.systems = undefined; + this.events = undefined; + } + +}); + +module.exports = Layer; + + +/***/ }), +/* 211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47293,11 +51675,11 @@ module.exports = CircumferencePoint; var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var GravityWell = __webpack_require__(417); -var List = __webpack_require__(137); -var ParticleEmitter = __webpack_require__(419); -var Render = __webpack_require__(998); +var GameObjectEvents = __webpack_require__(32); +var GravityWell = __webpack_require__(427); +var List = __webpack_require__(105); +var ParticleEmitter = __webpack_require__(429); +var Render = __webpack_require__(1058); /** * @classdesc @@ -47317,7 +51699,7 @@ var Render = __webpack_require__(998); * * @param {Phaser.Scene} scene - The Scene to which this Emitter Manager belongs. * @param {string} texture - The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. + * @param {(string|number)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. */ var ParticleEmitterManager = new Class({ @@ -47344,7 +51726,7 @@ var ParticleEmitterManager = new Class({ * The blend mode applied to all emitters and particles. * * @name Phaser.GameObjects.Particles.ParticleEmitterManager#blendMode - * @type {integer} + * @type {number} * @default -1 * @private * @since 3.0.0 @@ -47460,7 +51842,7 @@ var ParticleEmitterManager = new Class({ * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Emitter Manager. */ @@ -47481,7 +51863,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setFrame * @since 3.0.0 * - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Emitter Manager. */ @@ -47630,7 +52012,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticle * @since 3.0.0 * - * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param {number} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. * @@ -47661,7 +52043,7 @@ var ParticleEmitterManager = new Class({ * * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. - * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param {number} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. * * @return {this} This Emitter Manager. */ @@ -47723,7 +52105,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#preUpdate * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) @@ -47786,7 +52168,7 @@ module.exports = ParticleEmitterManager; /***/ }), -/* 206 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -47795,19 +52177,20 @@ module.exports = ParticleEmitterManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); -var Camera = __webpack_require__(93); -var CanvasPool = __webpack_require__(26); +var BlendModes = __webpack_require__(48); +var Camera = __webpack_require__(99); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var CONST = __webpack_require__(34); -var Frame = __webpack_require__(97); +var CONST = __webpack_require__(39); +var Frame = __webpack_require__(104); var GameObject = __webpack_require__(14); var NOOP = __webpack_require__(1); -var ProjectOrtho = __webpack_require__(185); -var Render = __webpack_require__(1002); -var Utils = __webpack_require__(10); -var UUID = __webpack_require__(207); +var PIPELINE_CONST = __webpack_require__(82); +var Render = __webpack_require__(1062); +var RenderTarget = __webpack_require__(263); +var Utils = __webpack_require__(12); +var UUID = __webpack_require__(213); /** * @classdesc @@ -47846,8 +52229,8 @@ var UUID = __webpack_require__(207); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. - * @param {integer} [width=32] - The width of the Render Texture. - * @param {integer} [height=32] - The height of the Render Texture. + * @param {number} [width=32] - The width of the Render Texture. + * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. */ @@ -47891,7 +52274,7 @@ var RenderTexture = new Class({ * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.2.0 */ - this.renderer = scene.sys.game.renderer; + this.renderer = scene.sys.renderer; /** * A reference to the Texture Manager. @@ -47931,16 +52314,6 @@ var RenderTexture = new Class({ */ this.canvas = null; - /** - * A reference to the GL Frame Buffer this Render Texture is drawing to. - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.GameObjects.RenderTexture#framebuffer - * @type {?WebGLFramebuffer} - * @since 3.2.0 - */ - this.framebuffer = null; - /** * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself. * @@ -48045,25 +52418,17 @@ var RenderTexture = new Class({ this.camera = new Camera(0, 0, width, height); /** - * A reference to the WebGL Rendering Context. + * The Render Target that belongs to this Render Texture. * - * @name Phaser.GameObjects.RenderTexture#gl - * @type {WebGLRenderingContext} - * @default null - * @since 3.0.0 - */ - this.gl = null; - - /** - * A reference to the WebGLTexture that is being rendered to in a WebGL Context. + * A Render Target encapsulates a framebuffer and texture for the WebGL Renderer. * - * @name Phaser.GameObjects.RenderTexture#glTexture - * @type {WebGLTexture} - * @default null - * @readonly - * @since 3.19.0 + * This property remains `null` under Canvas. + * + * @name Phaser.GameObjects.RenderTexture#renderTarget + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 */ - this.glTexture = null; + this.renderTarget = null; var renderer = this.renderer; @@ -48073,12 +52438,9 @@ var RenderTexture = new Class({ } else if (renderer.type === CONST.WEBGL) { - var gl = renderer.gl; - - this.gl = gl; - this.glTexture = this.frame.source.glTexture; this.drawGameObject = this.batchGameObjectWebGL; - this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); + + this.renderTarget = new RenderTarget(renderer, width, height, 1, 0, false); } else if (renderer.type === CONST.CANVAS) { @@ -48095,7 +52457,8 @@ var RenderTexture = new Class({ } this.setOrigin(0, 0); - this.initPipeline(); + + this.initPipeline(PIPELINE_CONST.SINGLE_PIPELINE); }, /** @@ -48121,8 +52484,10 @@ var RenderTexture = new Class({ * texture will not change. * * If Render Texture was not created from specific frame, the following will happen: + * * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. * In Canvas it will resize the underlying canvas element. + * * Both approaches will erase everything currently drawn to the Render Texture. * * If the dimensions given are the same as those already being used, calling this method will do nothing. @@ -48140,7 +52505,6 @@ var RenderTexture = new Class({ if (height === undefined) { height = width; } var frame = this.frame; - var renderer = this.renderer; if (width !== this.width || height !== this.height) { @@ -48154,30 +52518,48 @@ var RenderTexture = new Class({ this.texture.width = width; this.texture.height = height; - if (this.gl) + var renderTarget = this.renderTarget; + + if (renderTarget) { - var gl = this.gl; + renderTarget.resize(width, height); - renderer.deleteTexture(frame.source.glTexture); - renderer.deleteFramebuffer(this.framebuffer); - - var glTexture = renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - - this.framebuffer = renderer.createFramebuffer(width, height, glTexture, false); + frame.glTexture = renderTarget.texture; frame.source.isRenderTexture = true; - - frame.source.glTexture = glTexture; - - frame.glTexture = glTexture; - - this.glTexture = glTexture; + frame.source.isGLTexture = true; + frame.source.glTexture = renderTarget.texture; } + var camera = this.camera; + frame.source.width = width; frame.source.height = height; - this.camera.setSize(width, height); + var renderer = this.renderer; + var rendererWidth = renderer.width; + var rendererHeight = renderer.height; + + var zoomX = rendererWidth / width; + var zoomY = rendererHeight / height; + + camera.setSize(width, height); + camera.setZoom(zoomX, zoomY); + + var ox = 0.5; + var oy = 0.5; + + if (width !== rendererWidth) + { + ox = 0; + } + + if (height !== rendererHeight) + { + oy = 0; + } + + camera.setOrigin(ox, oy); frame.setSize(width, height); @@ -48223,7 +52605,7 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#setGlobalTint * @since 3.2.0 * - * @param {integer} tint - The tint value. + * @param {number} tint - The tint value. * * @return {this} This Render Texture. */ @@ -48308,9 +52690,7 @@ var RenderTexture = new Class({ */ fill: function (rgb, alpha, x, y, width, height) { - var gl = this.gl; var frame = this.frame; - var texture = this.texture; var camera = this.camera; var renderer = this.renderer; @@ -48320,47 +52700,38 @@ var RenderTexture = new Class({ if (width === undefined) { width = frame.cutWidth; } if (height === undefined) { height = frame.cutHeight; } - var r = ((rgb >> 16) | 0) & 0xff; - var g = ((rgb >> 8) | 0) & 0xff; - var b = (rgb | 0) & 0xff; + var r = (rgb >> 16 & 0xFF) / 255; + var g = (rgb >> 8 & 0xFF) / 255; + var b = (rgb & 0xFF) / 255; - camera.preRender(1, 1); + var renderTarget = this.renderTarget; - if (gl) + camera.preRender(); + + if (renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; - - renderer.resetTextures(true); - - renderer.pushScissor(cx, cy, cw, -ch); - - renderer.setFramebuffer(this.framebuffer, false); + renderTarget.bind(true); var pipeline = this.pipeline; - var tw = texture.width; - var th = texture.height; + pipeline.manager.set(pipeline); - var rw = pipeline.width; - var rh = pipeline.height; + var tw = renderTarget.width; + var th = renderTarget.height; + + var rw = renderer.width; + var rh = renderer.height; var sx = rw / tw; var sy = rh / th; pipeline.drawFillRect( - x * sx, (th - height - y) * sy, width * sx, height * sy, - Utils.getTintFromFloats(r / 255, g / 255, b / 255, 1), + x * sx, y * sy, width * sx, height * sy, + Utils.getTintFromFloats(b, g, r, 1), alpha ); - pipeline.flush(); - - renderer.setFramebuffer(null, false); - - renderer.popScissor(); + renderTarget.unbind(true); } else { @@ -48391,23 +52762,11 @@ var RenderTexture = new Class({ { if (this.dirty) { - var gl = this.gl; + var renderTarget = this.renderTarget; - if (gl) + if (renderTarget) { - var renderer = this.renderer; - - renderer.setFramebuffer(this.framebuffer, true); - - if (this.frame.cutWidth !== this.canvas.width || this.frame.cutHeight !== this.canvas.height) - { - gl.scissor(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight); - } - - gl.clearColor(0, 0, 0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - renderer.setFramebuffer(null, true); + renderTarget.clear(); } else { @@ -48559,37 +52918,21 @@ var RenderTexture = new Class({ entries = [ entries ]; } - var gl = this.gl; var camera = this.camera; var renderer = this.renderer; + var renderTarget = this.renderTarget; - camera.preRender(1, 1); + camera.preRender(); - if (gl) + if (renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + renderTarget.bind(true); renderer.resetTextures(true); - renderer.setFramebuffer(this.framebuffer, false); - - renderer.pushScissor(cx, cy, cw, ch, ch); - - var pipeline = this.pipeline; - - ProjectOrtho(pipeline, 0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); - this.batchList(entries, x, y, alpha, tint); - // Causes a flush + popScissor - renderer.setFramebuffer(null, true); - - renderer.resetTextures(true); - - ProjectOrtho(pipeline, 0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); + renderTarget.unbind(true); } else { @@ -48627,7 +52970,7 @@ var RenderTexture = new Class({ * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * @param {number} [x=0] - The x position to draw the frame at. * @param {number} [y=0] - The y position to draw the frame at. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -48650,41 +52993,21 @@ var RenderTexture = new Class({ tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16); } - var gl = this.gl; var camera = this.camera; - var renderer = this.renderer; + var renderTarget = this.renderTarget; var textureFrame = this.textureManager.getFrame(key, frame); if (textureFrame) { - camera.preRender(1, 1); + camera.preRender(); - if (gl) + if (renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + renderTarget.bind(true); - renderer.resetTextures(true); + this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, camera.matrix, null); - renderer.setFramebuffer(this.framebuffer, false); - - renderer.pushScissor(cx, cy, cw, ch, ch); - - var pipeline = this.pipeline; - - ProjectOrtho(pipeline, 0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); - - pipeline.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, tint, alpha, camera.matrix, null); - - pipeline.flush(); - - renderer.setFramebuffer(null, false); - - renderer.popScissor(); - - ProjectOrtho(pipeline, 0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); + renderTarget.unbind(true); } else { @@ -48750,7 +53073,7 @@ var RenderTexture = new Class({ }, /** - * Internal method that handles the drawing a Phaser Group contents. + * Internal method that handles drawing a Phaser Group contents. * * @method Phaser.GameObjects.RenderTexture#batchGroup * @private @@ -48772,7 +53095,7 @@ var RenderTexture = new Class({ { var entry = children[i]; - if (entry.willRender()) + if (entry.willRender(this.camera)) { var tx = entry.x + x; var ty = entry.y + y; @@ -48808,7 +53131,7 @@ var RenderTexture = new Class({ gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY); - gameObject.renderWebGL(this.renderer, gameObject, 0, this.camera, null); + gameObject.renderWebGL(this.renderer, gameObject, this.camera); gameObject.setPosition(prevX, prevY); }, @@ -48841,7 +53164,7 @@ var RenderTexture = new Class({ gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY); - gameObject.renderCanvas(this.renderer, gameObject, 0, this.camera, null); + gameObject.renderCanvas(this.renderer, gameObject, this.camera, null); gameObject.setPosition(prevX, prevY); @@ -48859,7 +53182,7 @@ var RenderTexture = new Class({ * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * @param {number} [x=0] - The x position to offset the Game Object by. * @param {number} [y=0] - The y position to offset the Game Object by. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -48895,7 +53218,9 @@ var RenderTexture = new Class({ x += this.frame.cutX; y += this.frame.cutY; - if (this.gl) + var renderTarget = this.renderTarget; + + if (renderTarget) { this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null); } @@ -48930,10 +53255,10 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#snapshotArea * @since 3.19.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -48942,9 +53267,9 @@ var RenderTexture = new Class({ */ snapshotArea: function (x, y, width, height, callback, type, encoderOptions) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); } else { @@ -48977,9 +53302,9 @@ var RenderTexture = new Class({ */ snapshot: function (callback, type, encoderOptions) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); } else { @@ -49003,17 +53328,17 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#snapshotPixel * @since 3.19.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This Render Texture instance. */ snapshotPixel: function (x, y, callback) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, true, x, y); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, true, x, y); } else { @@ -49036,9 +53361,9 @@ var RenderTexture = new Class({ { CanvasPool.remove(this.canvas); - if (this.gl) + if (this.renderTarget) { - this.renderer.deleteFramebuffer(this.framebuffer); + this.renderTarget.destroy(); } this.texture.destroy(); @@ -49046,9 +53371,7 @@ var RenderTexture = new Class({ this.canvas = null; this.context = null; - this.framebuffer = null; this.texture = null; - this.glTexture = null; } } @@ -49058,7 +53381,7 @@ module.exports = RenderTexture; /***/ }), -/* 207 */ +/* 213 */ /***/ (function(module, exports) { /** @@ -49093,7 +53416,7 @@ module.exports = UUID; /***/ }), -/* 208 */ +/* 214 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -49106,9 +53429,9 @@ var AnimationState = __webpack_require__(157); var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var PIPELINE_CONST = __webpack_require__(110); -var RopeRender = __webpack_require__(1008); +var GameObjectEvents = __webpack_require__(32); +var PIPELINE_CONST = __webpack_require__(82); +var RopeRender = __webpack_require__(1068); var Vector2 = __webpack_require__(3); /** @@ -49147,8 +53470,8 @@ var Vector2 = __webpack_require__(3); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {string} [texture] - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. If not given, `__DEFAULT` is used. - * @param {(string|integer|null)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. See `setPoints` to set this post-creation. + * @param {(string|number|null)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. See `setPoints` to set this post-creation. * @param {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? * @param {number[]} [colors] - An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. * @param {number[]} [alphas] - An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. @@ -49186,7 +53509,7 @@ var Rope = new Class({ * The Animation State of this Rope. * * @name Phaser.GameObjects.Rope#anims - * @type {Phaser.Animation.AnimationState} + * @type {Phaser.Animations.AnimationState} * @since 3.23.0 */ this.anims = new AnimationState(this); @@ -49265,15 +53588,14 @@ var Rope = new Class({ /** * The tint fill mode. * - * 0 = An additive tint (the default), where vertices colors are blended with the texture. - * 1 = A fill tint, where the vertices colors replace the texture, but respects texture alpha. - * 2 = A complete tint, where the vertices colors replace the texture, including alpha, entirely. + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Rope#tintFill - * @type {integer} + * @type {boolean} * @since 3.23.0 */ - this.tintFill = (texture === '__DEFAULT') ? 2 : 0; + this.tintFill = (texture === '__DEFAULT') ? true : false; /** * If the Rope is marked as `dirty` it will automatically recalculate its vertices @@ -49432,7 +53754,7 @@ var Rope = new Class({ * * @param {string} key - The string-based key of the animation to play. * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * @param {number} [startFrame=0] - Optionally start the animation playing from this frame index. * * @return {this} This Game Object. */ @@ -49469,7 +53791,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setHorizontal * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -49498,7 +53820,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setVertical * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -49521,28 +53843,26 @@ var Rope = new Class({ /** * Sets the tint fill mode. * - * Mode 0 is an additive tint, the default, which blends the vertices colors with the texture. + * Mode 0 (`false`) is an additive tint, the default, which blends the vertices colors with the texture. * This mode respects the texture alpha. * - * Mode 1 is a fill tint. Unlike an additive tint, a fill-tint literally replaces the pixel colors + * Mode 1 (`true`) is a fill tint. Unlike an additive tint, a fill-tint literally replaces the pixel colors * from the texture with those in the tint. You can use this for effects such as making a player flash 'white' * if hit by something. This mode respects the texture alpha. * - * Mode 2 is a complete tint. The texture colors and alpha are replaced entirely by the vertices colors. - * * See the `setColors` method for details of how to color each of the vertices. * * @method Phaser.GameObjects.Rope#setTintFill * @webglOnly * @since 3.23.0 * - * @param {integer} [value=0] - Set to 0 for an Additive tint, 1 for a fill tint with alpha, or 2 for a fill tint without alpha. + * @param {boolean} [value=false] - Set to `false` for an Additive tint or `true` fill tint with alpha. * * @return {this} This Game Object instance. */ setTintFill: function (value) { - if (value === undefined) { value = 0; } + if (value === undefined) { value = false; } this.tintFill = value; @@ -49768,7 +54088,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setPoints * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -49948,7 +54268,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#resizeArrays * @since 3.23.0 * - * @param {integer} newSize - The amount of segments to split the Rope in to. + * @param {number} newSize - The amount of segments to split the Rope in to. * * @return {this} This Game Object instance. */ @@ -50049,9 +54369,10 @@ var Rope = new Class({ /** * This method enables rendering of the Rope vertices to the given Graphics instance. * - * If you enable this feature, you must call `Graphics.clear()` in your Scene `update`, - * otherwise the Graphics instance will fill-in with draw calls. This is not done automatically - * to allow for you to debug render multiple Rope objects to a single Graphics instance. + * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, + * otherwise the Graphics instance you provide to debug will fill-up with draw calls, + * eventually crashing the browser. This is not done automatically to allow you to debug + * draw multiple Rope objects to a single Graphics instance. * * The Rope class has a built-in debug rendering callback `Rope.renderDebugVerts`, however * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. @@ -50106,7 +54427,7 @@ var Rope = new Class({ * @since 3.23.0 * * @param {Phaser.GameObjects.Rope} src - The Rope object being rendered. - * @param {integer} meshLength - The number of vertices in the mesh. + * @param {number} meshLength - The number of vertices in the mesh. * @param {number[]} verts - An array of translated vertex coordinates. */ renderDebugVerts: function (src, meshLength, verts) @@ -50224,7 +54545,7 @@ module.exports = Rope; /***/ }), -/* 209 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -50233,26 +54554,26 @@ module.exports = Rope; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(131); -var CanvasPool = __webpack_require__(26); +var AddToDOM = __webpack_require__(137); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); var GameObject = __webpack_require__(14); -var GetTextSize = __webpack_require__(425); +var GetTextSize = __webpack_require__(435); var GetValue = __webpack_require__(6); -var RemoveFromDOM = __webpack_require__(188); -var TextRender = __webpack_require__(1011); -var TextStyle = __webpack_require__(426); +var RemoveFromDOM = __webpack_require__(193); +var TextRender = __webpack_require__(1071); +var TextStyle = __webpack_require__(436); /** * @classdesc * A Text Game Object. - * + * * Text objects work by creating their own internal hidden Canvas and then renders text to it using * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered * to your game during the render pass. - * + * * Because it uses the Canvas API you can take advantage of all the features this offers, such as * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts * loaded externally, such as Google or TypeKit Web fonts. @@ -50275,7 +54596,7 @@ var TextStyle = __webpack_require__(426); * * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts * across mobile browsers. - * + * * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of @@ -50349,7 +54670,7 @@ var Text = new Class({ * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.12.0 */ - this.renderer = scene.sys.game.renderer; + this.renderer = scene.sys.renderer; this.setPosition(x, y); this.setOrigin(0, 0); @@ -50449,7 +54770,7 @@ var Text = new Class({ * The line spacing value. * This value is added to the font height to calculate the overall line height. * Only has an effect if this Text object contains multiple lines of text. - * + * * If you update this property directly, instead of using the `setLineSpacing` method, then * be sure to call `updateText` after, or you won't see the change reflected in the Text object. * @@ -50469,10 +54790,10 @@ var Text = new Class({ */ this.dirty = false; - // If resolution wasn't set, then we get it from the game config + // If resolution wasn't set, force it to 1 if (this.style.resolution === 0) { - this.style.resolution = scene.sys.game.config.resolution; + this.style.resolution = 1; } /** @@ -50749,7 +55070,12 @@ var Text = new Class({ { var word = words[j]; var wordWidth = context.measureText(word).width; - var wordWidthWithSpace = wordWidth + whiteSpaceWidth; + var wordWidthWithSpace = wordWidth; + + if (j < lastWordIndex) + { + wordWidthWithSpace += whiteSpaceWidth; + } if (wordWidthWithSpace > spaceLeft) { @@ -50909,10 +55235,10 @@ var Text = new Class({ * ```javascript * Text.setFont('"Press Start 2P"'); * ``` - * + * * Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all * quoted properly, too: - * + * * ```javascript * Text.setFont('Georgia, "Goudy Bookletter 1911", Times, serif'); * ``` @@ -51180,9 +55506,9 @@ var Text = new Class({ /** * Set the alignment of the text in this Text object. - * + * * The argument can be one of: `left`, `right`, `center` or `justify`. - * + * * Alignment only works if the Text object has more than one line of text. * * @method Phaser.GameObjects.Text#setAlign @@ -51202,10 +55528,10 @@ var Text = new Class({ * * By default it will be set to match the resolution set in the Game Config, * but you can override it via this method, or by specifying it in the Text style configuration object. - * + * * It allows for much clearer text on High DPI devices, at the cost of memory because it uses larger * internal Canvas textures for the Text. - * + * * Therefore, please use with caution, as the more high res Text you have, the more memory it uses. * * @method Phaser.GameObjects.Text#setResolution @@ -51312,7 +55638,7 @@ var Text = new Class({ * @method Phaser.GameObjects.Text#setMaxLines * @since 3.0.0 * - * @param {integer} [max=0] - The maximum number of lines to draw. + * @param {number} [max=0] - The maximum number of lines to draw. * * @return {this} This Text object. */ @@ -51462,9 +55788,9 @@ var Text = new Class({ var spaceSize = context.measureText(' ').width; var trimmedLine = lines[i].trim(); var array = trimmedLine.split(' '); - + extraSpace += (lines[i].length - trimmedLine.length) * spaceSize; - + var extraSpaceCharacters = Math.floor(extraSpace / spaceSize); var idx = 0; @@ -51474,7 +55800,7 @@ var Text = new Class({ idx = (idx + 1) % (array.length - 1 || 1); --extraSpaceCharacters; } - + lines[i] = array.join(' '); } } @@ -51636,7 +55962,7 @@ module.exports = Text; /***/ }), -/* 210 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -51645,14 +55971,14 @@ module.exports = Text; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); var GameObject = __webpack_require__(14); -var GetPowerOfTwo = __webpack_require__(342); -var Smoothing = __webpack_require__(177); -var TileSpriteRender = __webpack_require__(1014); +var GetPowerOfTwo = __webpack_require__(353); +var Smoothing = __webpack_require__(184); +var TileSpriteRender = __webpack_require__(1074); var Vector2 = __webpack_require__(3); // bitmask flag for GameObject.renderMask @@ -51667,10 +55993,10 @@ var _FLAG = 8; // 1000 * * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` - * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will + * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs. - * + * * An important note about Tile Sprites and NPOT textures: Internally, TileSprite textures use GL_REPEAT to provide * seamless repeating of the textures. This, combined with the way in which the textures are handled in WebGL, means * they need to be POT (power-of-two) sizes in order to wrap. If you provide a NPOT (non power-of-two) texture to a @@ -51705,10 +56031,10 @@ var _FLAG = 8; // 1000 * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. - * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {number} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {number} height - The height of the Game Object. If zero it will use the size of the texture frame. * @param {string} textureKey - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frameKey] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frameKey] - An optional frame from the Texture this Game Object is rendering with. */ var TileSprite = new Class({ @@ -51736,7 +56062,7 @@ var TileSprite = new Class({ function TileSprite (scene, x, y, width, height, textureKey, frameKey) { - var renderer = scene.sys.game.renderer; + var renderer = scene.sys.renderer; GameObject.call(this, scene, 'TileSprite'); @@ -51867,7 +56193,7 @@ var TileSprite = new Class({ * The next power of two value from the width of the Fill Pattern frame. * * @name Phaser.GameObjects.TileSprite#potWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.potWidth = GetPowerOfTwo(displayFrame.width); @@ -51876,7 +56202,7 @@ var TileSprite = new Class({ * The next power of two value from the height of the Fill Pattern frame. * * @name Phaser.GameObjects.TileSprite#potHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.potHeight = GetPowerOfTwo(displayFrame.height); @@ -51936,7 +56262,7 @@ var TileSprite = new Class({ * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -51957,7 +56283,7 @@ var TileSprite = new Class({ * @method Phaser.GameObjects.TileSprite#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -52288,7 +56614,7 @@ module.exports = TileSprite; /***/ }), -/* 211 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -52298,64 +56624,65 @@ module.exports = TileSprite; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Components = __webpack_require__(11); -var Events = __webpack_require__(29); -var GameEvents = __webpack_require__(21); +var Events = __webpack_require__(32); +var GameEvents = __webpack_require__(23); +var InputEvents = __webpack_require__(49); var GameObject = __webpack_require__(14); -var SoundEvents = __webpack_require__(61); -var UUID = __webpack_require__(207); -var VideoRender = __webpack_require__(1017); +var SoundEvents = __webpack_require__(66); +var UUID = __webpack_require__(213); +var VideoRender = __webpack_require__(1077); var MATH_CONST = __webpack_require__(13); /** * @classdesc * A Video Game Object. - * + * * This Game Object is capable of handling playback of a previously loaded video from the Phaser Video Cache, * or playing a video based on a given URL. Videos can be either local, or streamed. - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4'); * } - * + * * create () { * this.add.video(400, 300, 'pixar'); * } * ``` - * + * * To all intents and purposes, a video is a standard Game Object, just like a Sprite. And as such, you can do * all the usual things to it, such as scaling, rotating, cropping, tinting, making interactive, giving a * physics body, etc. - * + * * Transparent videos are also possible via the WebM file format. Providing the video file has was encoded with * an alpha channel, and providing the browser supports WebM playback (not all of them do), then it will render * in-game with full transparency. - * + * * ### Autoplaying Videos - * + * * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. * The policies that control autoplaying are vast and vary between browser. - * You can, ahd should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * You can, and should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', 'loadeddata', false, true); * } * ``` - * + * * The 5th parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for further details. - * + * * Note that due to a bug in IE11 you cannot play a video texture to a Sprite in WebGL. For IE11 force Canvas mode. - * + * * More details about video playback and the supported media formats can be found on MDN: - * + * * https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement * https://developer.mozilla.org/en-US/docs/Web/Media/Formats * @@ -52500,7 +56827,7 @@ var Video = new Class({ * state in this manner until the `retryLimit` is reached and then abort. * * @name Phaser.GameObjects.Video#retryLimit - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retryLimit = 20; @@ -52509,7 +56836,7 @@ var Video = new Class({ * The current retry attempt. * * @name Phaser.GameObjects.Video#retry - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retry = 0; @@ -52518,7 +56845,7 @@ var Video = new Class({ * The number of ms between each retry while monitoring the ready state of a downloading video. * * @name Phaser.GameObjects.Video#retryInterval - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retryInterval = 500; @@ -52527,7 +56854,7 @@ var Video = new Class({ * The setTimeout callback ID. * * @name Phaser.GameObjects.Video#_retryID - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -52613,7 +56940,7 @@ var Video = new Class({ * The in marker. * * @name Phaser.GameObjects.Video#_markerIn - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -52623,7 +56950,7 @@ var Video = new Class({ * The out marker. * * @name Phaser.GameObjects.Video#_markerOut - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -52633,7 +56960,7 @@ var Video = new Class({ * The last time the TextureSource was updated. * * @name Phaser.GameObjects.Video#_lastUpdate - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -52688,40 +57015,55 @@ var Video = new Class({ { sound.on(SoundEvents.GLOBAL_MUTE, this.globalMute, this); } + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); }, /** * Starts this video playing. * * If the video is already playing, or has been queued to play with `changeSource` then this method just returns. - * + * * Videos can only autoplay if the browser has been unlocked. This happens if you have interacted with the browser, i.e. * by clicking on it or pressing a key, or due to server settings. The policies that control autoplaying are vast and * vary between browser. You can read more here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide - * + * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is loaded, * and it will often allow the video to play immediately: - * + * * ```javascript * preload () { * this.load.video('pixar', 'nemo.mp4', 'loadeddata', false, true); * } * ``` - * + * * The 5th parameter in the load call tells Phaser that the video doesn't contain any audio tracks. Video without * audio can autoplay without requiring a user interaction. Video with audio cannot do this unless it satisfies * the browsers MEI settings. See the MDN Autoplay Guide for details. - * + * * If you need audio in your videos, then you'll have to consider the fact that the video cannot start playing until the * user has interacted with the browser, into your game flow. * * @method Phaser.GameObjects.Video#play * @since 3.20.0 - * + * * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. - * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. - * + * @param {number} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. + * * @return {this} This Video Game Object for method chaining. */ play: function (loop, markerIn, markerOut) @@ -52743,7 +57085,7 @@ var Video = new Class({ if (loop === undefined) { loop = video.loop; } var sound = this.scene.sys.sound; - + if (sound && sound.mute) { // Mute will be set based on the global mute state of the Sound Manager (if there is one) @@ -52797,20 +57139,20 @@ var Video = new Class({ * This method allows you to change the source of the current video element. It works by first stopping the * current video, if playing. Then deleting the video texture, if one has been created. Finally, it makes a * new video texture and starts playback of the new source through the existing video element. - * + * * The reason you may wish to do this is because videos that require interaction to unlock, remain in an unlocked * state, even if you change the source of the video. By changing the source to a new video you avoid having to * go through the unlock process again. * * @method Phaser.GameObjects.Video#changeSource * @since 3.20.0 - * + * * @param {string} key - The key of the Video this Game Object will swap to playing, as stored in the Video Cache. * @param {boolean} [autoplay=true] - Should the video start playing immediately, once the swap is complete? * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. - * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. - * + * @param {number} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. + * * @return {this} This Video Game Object for method chaining. */ changeSource: function (key, autoplay, loop, markerIn, markerOut) @@ -52842,7 +57184,7 @@ var Video = new Class({ this.videoTexture = this.scene.sys.textures.create(this._key, newVideo, newVideo.videoWidth, newVideo.videoHeight); this.videoTextureSource = this.videoTexture.source[0]; this.videoTexture.add('__BASE', 0, 0, 0, newVideo.videoWidth, newVideo.videoHeight); - + this.setTexture(this.videoTexture); this.setSizeToFrame(); this.updateDisplayOrigin(); @@ -52873,23 +57215,23 @@ var Video = new Class({ /** * Adds a sequence marker to this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds. - * + * * You can then play back specific markers via the `playMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * * @method Phaser.GameObjects.Video#addMarker * @since 3.20.0 - * + * * @param {string} key - A unique name to give this marker. - * @param {integer} markerIn - The time, in seconds, representing the start of this marker. - * @param {integer} markerOut - The time, in seconds, representing the end of this marker. - * + * @param {number} markerIn - The time, in seconds, representing the start of this marker. + * @param {number} markerOut - The time, in seconds, representing the end of this marker. + * * @return {this} This Video Game Object for method chaining. */ addMarker: function (key, markerIn, markerOut) @@ -52904,21 +57246,21 @@ var Video = new Class({ /** * Plays a pre-defined sequence in this video. - * + * * Markers allow you to split a video up into sequences, delineated by a start and end time, given in seconds and * specified via the `addMarker` method. - * + * * Note that marker timing is _not_ frame-perfect. You should construct your videos in such a way that you allow for * plenty of extra padding before and after each sequence to allow for discrepancies in browser seek and currentTime accuracy. - * + * * See https://github.com/w3c/media-and-entertainment/issues/4 for more details about this issue. * * @method Phaser.GameObjects.Video#playMarker * @since 3.20.0 - * + * * @param {string} key - The name of the marker sequence to play. * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * + * * @return {this} This Video Game Object for method chaining. */ playMarker: function (key, loop) @@ -52935,14 +57277,14 @@ var Video = new Class({ /** * Removes a previously set marker from this video. - * + * * If the marker is currently playing it will _not_ stop playback. * * @method Phaser.GameObjects.Video#removeMarker * @since 3.20.0 - * + * * @param {string} key - The name of the marker to remove. - * + * * @return {this} This Video Game Object for method chaining. */ removeMarker: function (key) @@ -52955,17 +57297,17 @@ var Video = new Class({ /** * Takes a snapshot of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a width and height. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * * @method Phaser.GameObjects.Video#snapshot * @since 3.20.0 - * - * @param {integer} [width] - The width of the resulting CanvasTexture. - * @param {integer} [height] - The height of the resulting CanvasTexture. - * - * @return {Phaser.Textures.CanvasTexture} + * + * @param {number} [width] - The width of the resulting CanvasTexture. + * @param {number} [height] - The height of the resulting CanvasTexture. + * + * @return {Phaser.Textures.CanvasTexture} */ snapshot: function (width, height) { @@ -52978,21 +57320,21 @@ var Video = new Class({ /** * Takes a snapshot of the specified area of the current frame of the video and renders it to a CanvasTexture object, * which is then returned. You can optionally resize the grab by passing a different `destWidth` and `destHeight`. - * + * * This method returns a reference to the `Video.snapshotTexture` object. Calling this method * multiple times will overwrite the previous snapshot with the most recent one. * * @method Phaser.GameObjects.Video#snapshotArea * @since 3.20.0 - * - * @param {integer} [x=0] - The horizontal location of the top-left of the area to grab from. - * @param {integer} [y=0] - The vertical location of the top-left of the area to grab from. - * @param {integer} [srcWidth] - The width of area to grab from the video. If not given it will grab the full video dimensions. - * @param {integer} [srcHeight] - The height of area to grab from the video. If not given it will grab the full video dimensions. - * @param {integer} [destWidth] - The destination width of the grab, allowing you to resize it. - * @param {integer} [destHeight] - The destination height of the grab, allowing you to resize it. - * - * @return {Phaser.Textures.CanvasTexture} + * + * @param {number} [x=0] - The horizontal location of the top-left of the area to grab from. + * @param {number} [y=0] - The vertical location of the top-left of the area to grab from. + * @param {number} [srcWidth] - The width of area to grab from the video. If not given it will grab the full video dimensions. + * @param {number} [srcHeight] - The height of area to grab from the video. If not given it will grab the full video dimensions. + * @param {number} [destWidth] - The destination width of the grab, allowing you to resize it. + * @param {number} [destHeight] - The destination height of the grab, allowing you to resize it. + * + * @return {Phaser.Textures.CanvasTexture} */ snapshotArea: function (x, y, srcWidth, srcHeight, destWidth, destHeight) { @@ -53032,27 +57374,27 @@ var Video = new Class({ /** * Stores a copy of this Videos `snapshotTexture` in the Texture Manager using the given key. - * + * * This texture is created when the `snapshot` or `snapshotArea` methods are called. - * + * * After doing this, any texture based Game Object, such as a Sprite, can use the contents of the * snapshot by using the texture key: - * + * * ```javascript * var vid = this.add.video(0, 0, 'intro'); - * + * * vid.snapshot(); - * + * * vid.saveSnapshotTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * Updating the contents of the `snapshotTexture`, for example by calling `snapshot` again, * will automatically update _any_ Game Object that is using it as a texture. * Calling `saveSnapshotTexture` again will not save another copy of the same texture, * it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. @@ -53080,18 +57422,18 @@ var Video = new Class({ /** * Loads a Video from the given URL, ready for playback with the `Video.play` method. - * + * * You can control at what point the browser determines the video as being ready for playback via * the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement * for more details. * * @method Phaser.GameObjects.Video#loadURL * @since 3.20.0 - * + * * @param {string} url - The URL of the video to load or be streamed. * @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`. * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. - * + * * @return {this} This Video Game Object for method chaining. */ loadURL: function (url, loadEvent, noAudio) @@ -53110,7 +57452,7 @@ var Video = new Class({ } var video = document.createElement('video'); - + video.controls = false; if (noAudio) @@ -53135,6 +57477,70 @@ var Video = new Class({ return this; }, + /** + * Loads a Video from the given MediaStream object, ready for playback with the `Video.play` method. + * + * You can control at what point the browser determines the video as being ready for playback via + * the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement + * for more details. + * + * @method Phaser.GameObjects.Video#loadMediaStream + * @since 3.50.0 + * + * @param {string} stream - The MediaStream object. + * @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`. + * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. + * + * @return {this} This Video Game Object for method chaining. + */ + loadMediaStream: function (stream, loadEvent, noAudio) + { + if (loadEvent === undefined) { loadEvent = 'loadeddata'; } + if (noAudio === undefined) { noAudio = false; } + + if (this.video) + { + this.stop(); + } + + if (this.videoTexture) + { + this.scene.sys.textures.remove(this._key); + } + + var video = document.createElement('video'); + + video.controls = false; + + if (noAudio) + { + video.muted = true; + video.defaultMuted = true; + + video.setAttribute('autoplay', 'autoplay'); + } + + video.setAttribute('playsinline', 'playsinline'); + video.setAttribute('preload', 'auto'); + + video.addEventListener('error', this._callbacks.error, true); + + try + { + video.srcObject = stream; + } + catch (error) + { + video.src = window.URL.createObjectURL(stream); + } + + video.load(); + + this.video = video; + + return this; + }, + /** * This internal method is called automatically if the playback Promise resolves successfully. * @@ -53162,12 +57568,12 @@ var Video = new Class({ * @fires Phaser.GameObjects.Events#VIDEO_ERROR * @private * @since 3.20.0 - * + * * @param {any} error - The Promise resolution error. */ playPromiseErrorHandler: function (error) { - this.scene.sys.input.once('pointerdown', this.unlockHandler, this); + this.scene.sys.input.once(InputEvents.POINTER_DOWN, this.unlockHandler, this); this.touchLocked = true; this.playWhenUnlocked = true; @@ -53177,7 +57583,7 @@ var Video = new Class({ /** * Called when the video emits a `playing` event during load. - * + * * This is only listened for if the browser doesn't support Promises. * * @method Phaser.GameObjects.Video#playHandler @@ -53189,7 +57595,7 @@ var Video = new Class({ this.touchLocked = false; this.emit(Events.VIDEO_PLAY, this); - + this.video.removeEventListener('playing', this._callbacks.play, true); }, @@ -53200,7 +57606,7 @@ var Video = new Class({ * @fires Phaser.GameObjects.Events#VIDEO_ERROR * @private * @since 3.20.0 - * + * * @param {Event} event - The error Event. */ loadErrorHandler: function (event) @@ -53219,7 +57625,7 @@ var Video = new Class({ * @fires Phaser.GameObjects.Events#VIDEO_PLAY * @private * @since 3.20.0 - * + * * @param {any} error - The Promise resolution error. */ unlockHandler: function () @@ -53241,7 +57647,7 @@ var Video = new Class({ /** * Called when the video completes playback, i.e. reaches an `ended` state. - * + * * This will never happen if the video is coming from a live stream, where the duration is `Infinity`. * * @method Phaser.GameObjects.Video#completeHandler @@ -53255,7 +57661,7 @@ var Video = new Class({ /** * Called when the video emits a `timeUpdate` event during playback. - * + * * This event is too slow and irregular to be used for actual video timing or texture updating, * but we can use it to determine if a video has looped. * @@ -53368,11 +57774,11 @@ var Video = new Class({ this.videoTexture = this.scene.sys.textures.create(this._key, video, width, height); this.videoTextureSource = this.videoTexture.source[0]; this.videoTexture.add('__BASE', 0, 0, 0, width, height); - + this.setTexture(this.videoTexture); this.setSizeToFrame(); this.updateDisplayOrigin(); - + this.emit(Events.VIDEO_CREATED, this, width, height); } else @@ -53385,7 +57791,7 @@ var Video = new Class({ textureSource.width = width; textureSource.height = height; } - + textureSource.update(); } }, @@ -53396,7 +57802,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#getVideoKey * @since 3.20.0 - * + * * @return {string} The key of the video being played from the Video Cache, if any. */ getVideoKey: function () @@ -53407,19 +57813,19 @@ var Video = new Class({ /** * Seeks to a given point in the video. The value is given as a float between 0 and 1, * where 0 represents the start of the video and 1 represents the end. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * If you wish to seek based on time instead, use the `Video.setCurrentTime` method. * * @method Phaser.GameObjects.Video#seekTo * @since 3.20.0 - * + * * @param {number} value - The point in the video to seek to. A value between 0 and 1. - * + * * @return {this} This Video Game Object for method chaining. */ seekTo: function (value) @@ -53447,7 +57853,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#getCurrentTime * @since 3.20.0 - * + * * @return {number} A double-precision floating-point value indicating the current playback time in seconds. */ getCurrentTime: function () @@ -53457,22 +57863,22 @@ var Video = new Class({ /** * Seeks to a given playback time in the video. The value is given in _seconds_ or as a string. - * + * * Seeking only works if the video has a duration, so will not work for live streams. - * + * * When seeking begins, this video will emit a `seeking` event. When the video completes * seeking (i.e. reaches its designated timestamp) it will emit a `seeked` event. - * + * * You can provide a string prefixed with either a `+` or a `-`, such as `+2.5` or `-2.5`. * In this case it will seek to +/- the value given, relative to the _current time_. - * + * * If you wish to seek based on a duration percentage instead, use the `Video.seekTo` method. * * @method Phaser.GameObjects.Video#setCurrentTime * @since 3.20.0 - * + * * @param {(string|number)} value - The playback time to seek to in seconds. Can be expressed as a string, such as `+2` to seek 2 seconds ahead from the current time. - * + * * @return {this} This Video Game Object for method chaining. */ setCurrentTime: function (value) @@ -53509,7 +57915,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#isSeeking * @since 3.20.0 - * + * * @return {boolean} A boolean indicating if this Video is currently seeking, or not. */ isSeeking: function () @@ -53557,12 +57963,12 @@ var Video = new Class({ /** * Returns the current progress of the video. Progress is defined as a value between 0 (the start) * and 1 (the end). - * + * * Progress can only be returned if the video has a duration, otherwise it will always return zero. * * @method Phaser.GameObjects.Video#getProgress * @since 3.20.0 - * + * * @return {number} The current progress of playback. If the video has no duration, will always return zero. */ getProgress: function () @@ -53579,20 +57985,20 @@ var Video = new Class({ return now / duration; } } - + return 0; }, /** * A double-precision floating-point value which indicates the duration (total length) of the media in seconds, * on the media's timeline. If no media is present on the element, or the media is not valid, the returned value is NaN. - * + * * If the media has no known end (such as for live streams of unknown duration, web radio, media incoming from WebRTC, * and so forth), this value is +Infinity. - * + * * @method Phaser.GameObjects.Video#getDuration * @since 3.20.0 - * + * * @return {number} A double-precision floating-point value indicating the duration of the media in seconds. */ getDuration: function () @@ -53605,9 +58011,9 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#setMute * @since 3.20.0 - * + * * @param {boolean} [value=true] - The mute value. `true` if the video should be muted, otherwise `false`. - * + * * @return {this} This Video Game Object for method chaining. */ setMute: function (value) @@ -53631,7 +58037,7 @@ var Video = new Class({ * * @method Phaser.GameObjects.Video#isMuted * @since 3.20.0 - * + * * @return {boolean} A boolean indicating if this Video is currently muted, or not. */ isMuted: function () @@ -53645,7 +58051,7 @@ var Video = new Class({ * @method Phaser.GameObjects.Video#globalMute * @private * @since 3.20.0 - * + * * @param {(Phaser.Sound.WebAudioSoundManager|Phaser.Sound.HTML5AudioSoundManager)} soundManager - A reference to the Sound Manager that emitted the event. * @param {boolean} mute - The mute value. `true` if the Sound Manager is now muted, otherwise `false`. */ @@ -53697,17 +58103,17 @@ var Video = new Class({ /** * Sets the paused state of the currently loaded video. - * + * * If the video is playing, calling this method with `true` will pause playback. * If the video is paused, calling this method with `false` will resume playback. - * + * * If no video is loaded, this method does nothing. * * @method Phaser.GameObjects.Video#setPaused * @since 3.20.0 - * + * * @param {boolean} [value=true] - The paused value. `true` if the video should be paused, `false` to resume it. - * + * * @return {this} This Video Game Object for method chaining. */ setPaused: function (value) @@ -53741,27 +58147,27 @@ var Video = new Class({ /** * Returns a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). - * + * * @method Phaser.GameObjects.Video#getVolume * @since 3.20.0 - * + * * @return {number} A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). */ getVolume: function () { return (this.video) ? this.video.volume : 1; }, - + /** * Sets the volume of the currently playing video. - * + * * The value given is a double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). - * + * * @method Phaser.GameObjects.Video#setVolume * @since 3.20.0 - * + * * @param {number} [value=1] - A double indicating the audio volume, from 0.0 (silent) to 1.0 (loudest). - * + * * @return {this} This Video Game Object for method chaining. */ setVolume: function (value) @@ -53778,10 +58184,10 @@ var Video = new Class({ /** * Returns a double that indicates the rate at which the media is being played back. - * + * * @method Phaser.GameObjects.Video#getPlaybackRate * @since 3.20.0 - * + * * @return {number} A double that indicates the rate at which the media is being played back. */ getPlaybackRate: function () @@ -53791,14 +58197,14 @@ var Video = new Class({ /** * Sets the playback rate of the current video. - * + * * The value given is a double that indicates the rate at which the media is being played back. - * + * * @method Phaser.GameObjects.Video#setPlaybackRate * @since 3.20.0 - * + * * @param {number} [rate] - A double that indicates the rate at which the media is being played back. - * + * * @return {this} This Video Game Object for method chaining. */ setPlaybackRate: function (rate) @@ -53813,10 +58219,10 @@ var Video = new Class({ /** * Returns a boolean which indicates whether the media element should start over when it reaches the end. - * + * * @method Phaser.GameObjects.Video#getLoop * @since 3.20.0 - * + * * @return {boolean} A boolean which indicates whether the media element will start over when it reaches the end. */ getLoop: function () @@ -53826,18 +58232,18 @@ var Video = new Class({ /** * Sets the loop state of the current video. - * + * * The value given is a boolean which indicates whether the media element will start over when it reaches the end. - * + * * Not all videos can loop, for example live streams. - * + * * Please note that not all browsers support _seamless_ video looping for all encoding formats. - * + * * @method Phaser.GameObjects.Video#setLoop * @since 3.20.0 - * + * * @param {boolean} [value=true] - A boolean which indicates whether the media element will start over when it reaches the end. - * + * * @return {this} This Video Game Object for method chaining. */ setLoop: function (value) @@ -53854,23 +58260,23 @@ var Video = new Class({ /** * Returns a boolean which indicates whether the video is currently playing. - * + * * @method Phaser.GameObjects.Video#isPlaying * @since 3.20.0 - * + * * @return {boolean} A boolean which indicates whether the video is playing, or not. */ isPlaying: function () { return (this.video) ? !(this.video.paused || this.video.ended) : false; }, - + /** * Returns a boolean which indicates whether the video is currently paused. - * + * * @method Phaser.GameObjects.Video#isPaused * @since 3.20.0 - * + * * @return {boolean} A boolean which indicates whether the video is paused, or not. */ isPaused: function () @@ -53881,26 +58287,26 @@ var Video = new Class({ /** * Stores this Video in the Texture Manager using the given key as a dynamic texture, * which any texture-based Game Object, such as a Sprite, can use as its texture: - * + * * ```javascript * var vid = this.add.video(0, 0, 'intro'); - * + * * vid.play(); - * + * * vid.saveTexture('doodle'); - * + * * this.add.image(400, 300, 'doodle'); * ``` - * + * * The saved texture is automatically updated as the video plays. If you pause this video, * or change its source, then the saved texture updates instantly. - * + * * Calling `saveTexture` again will not save another copy of the same texture, it will just rename the existing one. - * + * * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame. - * + * * If you intend to save the texture so you can use it as the input for a Shader, you may need to set the * `flipY` parameter to `true` if you find the video renders upside down in your shader. * @@ -53937,14 +58343,14 @@ var Video = new Class({ * Stops the video playing and clears all internal event listeners. * * If you only wish to pause playback of the video, and resume it a later time, use the `Video.pause` method instead. - * + * * If the video hasn't finished downloading, calling this method will not abort the download. To do that you need to * call `destroy` instead. * * @method Phaser.GameObjects.Video#stop * @fires Phaser.GameObjects.Events#VIDEO_STOP * @since 3.20.0 - * + * * @return {this} This Video Game Object for method chaining. */ stop: function () @@ -53975,13 +58381,13 @@ var Video = new Class({ /** * Removes the Video element from the DOM by calling parentNode.removeChild on itself. - * + * * Also removes the autoplay and src attributes and nulls the Video reference. - * + * * You should not call this method if you were playing a video from the Video Cache that * you wish to play again in your game, or if another Video object is also using the same * video. - * + * * If you loaded an external video via `Video.loadURL` then you should call this function * to clear up once you are done with the instance. * @@ -54015,9 +58421,9 @@ var Video = new Class({ /** * Handles the pre-destroy step for the Video object. - * + * * This calls `Video.stop` and optionally `Video.removeVideoElement`. - * + * * If any Sprites are using this Video as their texture it is up to you to manage those. * * @method Phaser.GameObjects.Video#preDestroy @@ -54057,7 +58463,7 @@ module.exports = Video; /***/ }), -/* 212 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54067,16 +58473,16 @@ module.exports = Video; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(213); -var GetPoints = __webpack_require__(437); -var GEOM_CONST = __webpack_require__(49); +var Contains = __webpack_require__(219); +var GetPoints = __webpack_require__(447); +var GEOM_CONST = __webpack_require__(55); /** * @classdesc * A Polygon object * * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points. - * Several formats are supported to define the list of points, check the setTo method for details. + * Several formats are supported to define the list of points, check the setTo method for details. * This is a geometry object allowing you to define and inspect the shape. * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. * To render a Polygon you should look at the capabilities of the Graphics class. @@ -54086,7 +58492,7 @@ var GEOM_CONST = __webpack_require__(49); * @constructor * @since 3.0.0 * - * @param {Phaser.Geom.Point[]} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x y properties: `[obj1, obj2, ...]` @@ -54104,7 +58510,7 @@ var Polygon = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Polygon#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -54167,7 +58573,7 @@ var Polygon = new Class({ * @method Phaser.Geom.Polygon#setTo * @since 3.0.0 * - * @param {array} points - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. * * @return {this} This Polygon object. */ @@ -54274,7 +58680,7 @@ var Polygon = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -54291,7 +58697,7 @@ module.exports = Polygon; /***/ }), -/* 213 */ +/* 219 */ /***/ (function(module, exports) { /** @@ -54340,668 +58746,7 @@ module.exports = Contains; /***/ }), -/* 214 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Mesh = __webpack_require__(142); - -/** - * @classdesc - * A Quad Game Object. - * - * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single - * texture spread across them. - * - * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also - * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. - * - * @class Quad - * @extends Phaser.GameObjects.Mesh - * @memberof Phaser.GameObjects - * @constructor - * @webglOnly - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Quad belongs. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Quad = new Class({ - - Extends: Mesh, - - initialize: - - function Quad (scene, x, y, texture, frame) - { - // 0----3 - // |\ B| - // | \ | - // | \ | - // | A \| - // | \ - // 1----2 - - var vertices = [ - 0, 0, // tl - 0, 0, // bl - 0, 0, // br - 0, 0, // tl - 0, 0, // br - 0, 0 // tr - ]; - - var uv = [ - 0, 0, // tl - 0, 1, // bl - 1, 1, // br - 0, 0, // tl - 1, 1, // br - 1, 0 // tr - ]; - - var colors = [ - 0xffffff, // tl - 0xffffff, // bl - 0xffffff, // br - 0xffffff, // tl - 0xffffff, // br - 0xffffff // tr - ]; - - var alphas = [ - 1, // tl - 1, // bl - 1, // br - 1, // tl - 1, // br - 1 // tr - ]; - - Mesh.call(this, scene, x, y, vertices, uv, colors, alphas, texture, frame); - - this.resetPosition(); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * The Frame has to belong to the current Texture being used. - * - * It can be either a string or an index. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Quad#setFrame - * @since 3.11.0 - * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame) - { - this.frame = this.texture.get(frame); - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~8; - } - else - { - this.renderFlags |= 8; - } - - frame = this.frame; - - // TL - this.uv[0] = frame.u0; - this.uv[1] = frame.v0; - - // BL - this.uv[2] = frame.u0; - this.uv[3] = frame.v1; - - // BR - this.uv[4] = frame.u1; - this.uv[5] = frame.v1; - - // TL - this.uv[6] = frame.u0; - this.uv[7] = frame.v0; - - // BR - this.uv[8] = frame.u1; - this.uv[9] = frame.v1; - - // TR - this.uv[10] = frame.u1; - this.uv[11] = frame.v0; - - return this; - }, - - /** - * The top-left x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftX - * @type {number} - * @since 3.0.0 - */ - topLeftX: { - - get: function () - { - return this.x + this.vertices[0]; - }, - - set: function (value) - { - this.vertices[0] = value - this.x; - this.vertices[6] = value - this.x; - } - - }, - - /** - * The top-left y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftY - * @type {number} - * @since 3.0.0 - */ - topLeftY: { - - get: function () - { - return this.y + this.vertices[1]; - }, - - set: function (value) - { - this.vertices[1] = value - this.y; - this.vertices[7] = value - this.y; - } - - }, - - /** - * The top-right x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightX - * @type {number} - * @since 3.0.0 - */ - topRightX: { - - get: function () - { - return this.x + this.vertices[10]; - }, - - set: function (value) - { - this.vertices[10] = value - this.x; - } - - }, - - /** - * The top-right y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightY - * @type {number} - * @since 3.0.0 - */ - topRightY: { - - get: function () - { - return this.y + this.vertices[11]; - }, - - set: function (value) - { - this.vertices[11] = value - this.y; - } - - }, - - /** - * The bottom-left x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftX - * @type {number} - * @since 3.0.0 - */ - bottomLeftX: { - - get: function () - { - return this.x + this.vertices[2]; - }, - - set: function (value) - { - this.vertices[2] = value - this.x; - } - - }, - - /** - * The bottom-left y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftY - * @type {number} - * @since 3.0.0 - */ - bottomLeftY: { - - get: function () - { - return this.y + this.vertices[3]; - }, - - set: function (value) - { - this.vertices[3] = value - this.y; - } - - }, - - /** - * The bottom-right x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightX - * @type {number} - * @since 3.0.0 - */ - bottomRightX: { - - get: function () - { - return this.x + this.vertices[4]; - }, - - set: function (value) - { - this.vertices[4] = value - this.x; - this.vertices[8] = value - this.x; - } - - }, - - /** - * The bottom-right y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightY - * @type {number} - * @since 3.0.0 - */ - bottomRightY: { - - get: function () - { - return this.y + this.vertices[5]; - }, - - set: function (value) - { - this.vertices[5] = value - this.y; - this.vertices[9] = value - this.y; - } - - }, - - /** - * The top-left alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftAlpha - * @type {number} - * @since 3.0.0 - */ - topLeftAlpha: { - - get: function () - { - return this.alphas[0]; - }, - - set: function (value) - { - this.alphas[0] = value; - this.alphas[3] = value; - } - - }, - - /** - * The top-right alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightAlpha - * @type {number} - * @since 3.0.0 - */ - topRightAlpha: { - - get: function () - { - return this.alphas[5]; - }, - - set: function (value) - { - this.alphas[5] = value; - } - - }, - - /** - * The bottom-left alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftAlpha - * @type {number} - * @since 3.0.0 - */ - bottomLeftAlpha: { - - get: function () - { - return this.alphas[1]; - }, - - set: function (value) - { - this.alphas[1] = value; - } - - }, - - /** - * The bottom-right alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightAlpha - * @type {number} - * @since 3.0.0 - */ - bottomRightAlpha: { - - get: function () - { - return this.alphas[2]; - }, - - set: function (value) - { - this.alphas[2] = value; - this.alphas[4] = value; - } - - }, - - /** - * The top-left color value of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftColor - * @type {number} - * @since 3.0.0 - */ - topLeftColor: { - - get: function () - { - return this.colors[0]; - }, - - set: function (value) - { - this.colors[0] = value; - this.colors[3] = value; - } - - }, - - /** - * The top-right color value of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightColor - * @type {number} - * @since 3.0.0 - */ - topRightColor: { - - get: function () - { - return this.colors[5]; - }, - - set: function (value) - { - this.colors[5] = value; - } - - }, - - /** - * The bottom-left color value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftColor - * @type {number} - * @since 3.0.0 - */ - bottomLeftColor: { - - get: function () - { - return this.colors[1]; - }, - - set: function (value) - { - this.colors[1] = value; - } - - }, - - /** - * The bottom-right color value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightColor - * @type {number} - * @since 3.0.0 - */ - bottomRightColor: { - - get: function () - { - return this.colors[2]; - }, - - set: function (value) - { - this.colors[2] = value; - this.colors[4] = value; - } - - }, - - /** - * Sets the top-left vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setTopLeft - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setTopLeft: function (x, y) - { - this.topLeftX = x; - this.topLeftY = y; - - return this; - }, - - /** - * Sets the top-right vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setTopRight - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setTopRight: function (x, y) - { - this.topRightX = x; - this.topRightY = y; - - return this; - }, - - /** - * Sets the bottom-left vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setBottomLeft - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setBottomLeft: function (x, y) - { - this.bottomLeftX = x; - this.bottomLeftY = y; - - return this; - }, - - /** - * Sets the bottom-right vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setBottomRight - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setBottomRight: function (x, y) - { - this.bottomRightX = x; - this.bottomRightY = y; - - return this; - }, - - /** - * Resets the positions of the four corner vertices of this Quad. - * - * @method Phaser.GameObjects.Quad#resetPosition - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetPosition: function () - { - var x = this.x; - var y = this.y; - var halfWidth = Math.floor(this.width / 2); - var halfHeight = Math.floor(this.height / 2); - - this.setTopLeft(x - halfWidth, y - halfHeight); - this.setTopRight(x + halfWidth, y - halfHeight); - this.setBottomLeft(x - halfWidth, y + halfHeight); - this.setBottomRight(x + halfWidth, y + halfHeight); - - return this; - }, - - /** - * Resets the alpha values used by this Quad back to 1. - * - * @method Phaser.GameObjects.Quad#resetAlpha - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetAlpha: function () - { - var alphas = this.alphas; - - alphas[0] = 1; - alphas[1] = 1; - alphas[2] = 1; - alphas[3] = 1; - alphas[4] = 1; - alphas[5] = 1; - - return this; - }, - - /** - * Resets the color values used by this Quad back to 0xffffff. - * - * @method Phaser.GameObjects.Quad#resetColors - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetColors: function () - { - var colors = this.colors; - - colors[0] = 0xffffff; - colors[1] = 0xffffff; - colors[2] = 0xffffff; - colors[3] = 0xffffff; - colors[4] = 0xffffff; - colors[5] = 0xffffff; - - return this; - }, - - /** - * Resets the position, alpha and color values used by this Quad. - * - * @method Phaser.GameObjects.Quad#reset - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - reset: function () - { - this.resetPosition(); - - this.resetAlpha(); - - return this.resetColors(); - } - -}); - -module.exports = Quad; - - -/***/ }), -/* 215 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -55014,10 +58759,10 @@ var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); var GetFastValue = __webpack_require__(2); -var Extend = __webpack_require__(19); -var SetValue = __webpack_require__(445); -var ShaderRender = __webpack_require__(1100); -var TransformMatrix = __webpack_require__(31); +var Extend = __webpack_require__(18); +var SetValue = __webpack_require__(455); +var ShaderRender = __webpack_require__(1159); +var TransformMatrix = __webpack_require__(24); /** * @classdesc @@ -55116,7 +58861,7 @@ var Shader = new Class({ * This Game Object cannot have a blend mode, so skip all checks. * * @name Phaser.GameObjects.Shader#blendMode - * @type {integer} + * @type {number} * @private * @since 3.17.0 */ @@ -55510,9 +59255,9 @@ var Shader = new Class({ var program = renderer.createProgram(this.shader.vertexSrc, this.shader.fragmentSrc); // The default uniforms available within the vertex shader - renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); - renderer.setFloat2(program, 'uResolution', this.width, this.height); + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uViewMatrix'), false, this.viewMatrix); + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uProjectionMatrix'), false, this.projectionMatrix); + gl.uniform2f(gl.getUniformLocation(program, 'uResolution'), this.width, this.height); this.program = program; @@ -55608,7 +59353,12 @@ var Shader = new Class({ var program = this.program; - this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); + var gl = this.gl; + var renderer = this.renderer; + + renderer.setProgram(program); + + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uProjectionMatrix'), false, this.projectionMatrix); this._rendererWidth = right; this._rendererHeight = bottom; @@ -55674,9 +59424,9 @@ var Shader = new Class({ * * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. * @param {WebGLTexture} texture - A WebGLTexture reference. - * @param {integer} width - The width of the texture. - * @param {integer} height - The height of the texture. - * @param {integer} [textureIndex=0] - The texture index. + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} [textureIndex=0] - The texture index. * @param {any} [textureData] - Additional texture data. * * @return {this} This Shader instance. @@ -55715,7 +59465,7 @@ var Shader = new Class({ * * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. - * @param {integer} [textureIndex=0] - The texture index. + * @param {number} [textureIndex=0] - The texture index. * @param {any} [textureData] - Additional texture data. * * @return {this} This Shader instance. @@ -56222,7 +59972,7 @@ module.exports = Shader; /***/ }), -/* 216 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56231,7 +59981,1063 @@ module.exports = Shader; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DistanceBetween = __webpack_require__(55); +var Class = __webpack_require__(0); +var Components = __webpack_require__(11); +var DegToRad = __webpack_require__(34); +var Face = __webpack_require__(111); +var GameObject = __webpack_require__(14); +var GameObjectEvents = __webpack_require__(32); +var GenerateVerts = __webpack_require__(456); +var GenerateObjVerts = __webpack_require__(457); +var GetCalcMatrix = __webpack_require__(21); +var Matrix4 = __webpack_require__(73); +var MeshRender = __webpack_require__(1162); +var StableSort = __webpack_require__(90); +var Vector3 = __webpack_require__(37); +var Vertex = __webpack_require__(113); + +/** + * @classdesc + * A Mesh Game Object. + * + * The Mesh Game Object allows you to render a group of textured vertices and manipulate + * the view of those vertices, such as rotation, translation or scaling. + * + * Support for generating mesh data from grids, model data or Wavefront OBJ Files is included. + * + * Although you can use this to render 3D objects, its primary use is for displaying more complex + * Sprites, or Sprites where you need fine-grained control over the vertice positions in order to + * achieve special effects in your games. Note that rendering still takes place using Phasers + * orthographic camera. As a result, all depth and face tests are done in orthographic space. + * + * The rendering process will iterate through the faces of this Mesh and render out each face + * that is considered as being in view of the camera. No depth buffer is used, and because of this, + * you should be careful not to use model data with too many vertices, or overlapping geometry, + * or you'll probably encounter z-depth fighting. The Mesh was designed to allow for more advanced + * 2D layouts, rather than displaying 3D objects, even though it can do this to a degree. + * + * In short, if you want to remake Crysis, use a 3D engine, not a Mesh. However, if you want + * to easily add some small fun 3D elements into your game, or create some special effects involving + * vertex warping, this is the right object for you. Mesh data becomes part of the WebGL batch, + * just like standard Sprites, so doesn't introduce any additional shader overhead. Because + * the Mesh just generates vertices into the WebGL batch, like any other Sprite, you can use all of + * the common Game Object components on a Mesh too, such as a custom pipeline, mask, blend mode + * or texture. + * + * Note that the Mesh object is WebGL only and does not have a Canvas counterpart. + * + * The Mesh origin is always 0.5 x 0.5 and cannot be changed. + * + * @class Mesh + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @webglOnly + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * @extends Phaser.GameObjects.Components.ScrollFactor + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x] - The horizontal position of this Game Object in the world. + * @param {number} [y] - The vertical position of this Game Object in the world. + * @param {string|Phaser.Textures.Texture} [texture] - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {string|number} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {number[]} [vertices] - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} [uvs] - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + */ +var Mesh = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.Size, + Components.Texture, + Components.Transform, + Components.Visible, + Components.ScrollFactor, + MeshRender + ], + + initialize: + + function Mesh (scene, x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (texture === undefined) { texture = '__WHITE'; } + + GameObject.call(this, scene, 'Mesh'); + + /** + * An array containing the Face instances belonging to this Mesh. + * + * A Face consists of 3 Vertex objects. + * + * This array is populated during calls such as `addVertices` or `addOBJ`. + * + * @name Phaser.GameObjects.Mesh#faces + * @type {Phaser.Geom.Mesh.Face[]} + * @since 3.50.0 + */ + this.faces = []; + + /** + * An array containing Vertex instances. One instance per vertex in this Mesh. + * + * This array is populated during calls such as `addVertex` or `addOBJ`. + * + * @name Phaser.GameObjects.Mesh#vertices + * @type {Phaser.Geom.Mesh.Vertex[]} + * @since 3.50.0 + */ + this.vertices = []; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertex colors replace the texture, but respects texture alpha. + * + * @name Phaser.GameObjects.Mesh#tintFill + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.tintFill = false; + + /** + * You can optionally choose to render the vertices of this Mesh to a Graphics instance. + * + * Achieve this by setting the `debugCallback` and the `debugGraphic` properties. + * + * You can do this in a single call via the `Mesh.setDebug` method, which will use the + * built-in debug function. You can also set it to your own callback. The callback + * will be invoked _once per render_ and sent the following parameters: + * + * `debugCallback(src, meshLength, verts)` + * + * `src` is the Mesh instance being debugged. + * `meshLength` is the number of mesh vertices in total. + * `verts` is an array of the translated vertex coordinates. + * + * To disable rendering, set this property back to `null`. + * + * Please note that high vertex count Meshes will struggle to debug properly. + * + * @name Phaser.GameObjects.Mesh#debugCallback + * @type {function} + * @since 3.50.0 + */ + this.debugCallback = null; + + /** + * The Graphics instance that the debug vertices will be drawn to, if `setDebug` has + * been called. + * + * @name Phaser.GameObjects.Mesh#debugGraphic + * @type {Phaser.GameObjects.Graphics} + * @since 3.50.0 + */ + this.debugGraphic = null; + + /** + * When rendering, skip any Face that isn't counter clockwise? + * + * Enable this to hide backward-facing Faces during rendering. + * + * Disable it to render all Faces. + * + * @name Phaser.GameObjects.Mesh#hideCCW + * @type {boolean} + * @since 3.50.0 + */ + this.hideCCW = true; + + /** + * A Vector3 containing the 3D position of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to reposition where + * the vertices are rendered within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * You can also adjust the 'view' by using the `pan` methods. + * + * @name Phaser.GameObjects.Mesh#modelPosition + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelPosition = new Vector3(); + + /** + * A Vector3 containing the 3D scale of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to scale + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * @name Phaser.GameObjects.Mesh#modelScale + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelScale = new Vector3(1, 1, 1); + + /** + * A Vector3 containing the 3D rotation of the vertices in this Mesh. + * + * The values should be given in radians, i.e. to rotate the vertices by 90 + * degrees you can use `modelRotation.x = Phaser.Math.DegToRad(90)`. + * + * Modifying the components of this property will allow you to rotate + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * @name Phaser.GameObjects.Mesh#modelRotation + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelRotation = new Vector3(); + + /** + * An internal cache, used to compare position, rotation, scale and face data + * each frame, to avoid math calculations in `preUpdate`. + * + * Cache structure = position xyz | rotation xyz | scale xyz | face count | view | ortho + * + * @name Phaser.GameObjects.Mesh#dirtyCache + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.dirtyCache = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; + + /** + * The transformation matrix for this Mesh. + * + * @name Phaser.GameObjects.Mesh#transformMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.transformMatrix = new Matrix4(); + + /** + * The view position for this Mesh. + * + * Use the methods`panX`, `panY` and `panZ` to adjust the view. + * + * @name Phaser.GameObjects.Mesh#viewPosition + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.viewPosition = new Vector3(); + + /** + * The view matrix for this Mesh. + * + * @name Phaser.GameObjects.Mesh#viewMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.viewMatrix = new Matrix4(); + + /** + * The projection matrix for this Mesh. + * + * Update it with the `setPerspective` or `setOrtho` methods. + * + * @name Phaser.GameObjects.Mesh#projectionMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.projectionMatrix = new Matrix4(); + + /** + * How many faces were rendered by this Mesh Game Object in the last + * draw? This is reset in the `preUpdate` method and then incremented + * each time a face is drawn. Note that in multi-camera Scenes this + * value may exceed that found in `Mesh.getFaceCount` due to + * cameras drawing the same faces more than once. + * + * @name Phaser.GameObjects.Mesh#totalRendered + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.totalRendered = 0; + + /** + * Internal cache var for the total number of faces rendered this frame. + * + * See `totalRendered` instead for the actual value. + * + * @name Phaser.GameObjects.Mesh#totalFrame + * @type {number} + * @private + * @since 3.50.0 + */ + this.totalFrame = 0; + + /** + * By default, the Mesh will check to see if its model or view transform has + * changed each frame and only recalculate the vertex positions if they have. + * + * This avoids lots of additional math in the `preUpdate` step when not required. + * + * However, if you are performing per-Face or per-Vertex manipulation on this Mesh, + * such as tweening a Face, or moving it without moving the rest of the Mesh, + * then you may need to disable the dirty cache in order for the Mesh to re-render + * correctly. You can toggle this property to do that. Please note that leaving + * this set to `true` will cause the Mesh to recalculate the position of every single + * vertex in it, every single frame. So only really do this if you know you + * need it. + * + * @name Phaser.GameObjects.Mesh#ignoreDirtyCache + * @type {boolean} + * @since 3.50.0 + */ + this.ignoreDirtyCache = false; + + var renderer = scene.sys.renderer; + + this.setPosition(x, y); + this.setTexture(texture, frame); + this.setSize(renderer.width, renderer.height); + this.initPipeline(); + + this.setPerspective(renderer.width, renderer.height, 45, 0.01, 1000); + + if (vertices) + { + this.addVertices(vertices, uvs, indicies, containsZ, normals, colors, alphas); + } + + this.on(GameObjectEvents.ADDED_TO_SCENE, this.addedToScene, this); + this.on(GameObjectEvents.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); + }, + + /** + * Translates the view position of this Mesh on the x axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panX + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panX: function (v) + { + this.viewPosition.addScale(Vector3.LEFT, v); + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Translates the view position of this Mesh on the y axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panY + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panY: function (v) + { + this.viewPosition.y += Vector3.DOWN.y * v; + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Translates the view position of this Mesh on the z axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panZ + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panZ: function (amount) + { + this.viewPosition.z += amount; + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Builds a new perspective projection matrix from the given values. + * + * See also `setOrtho`. + * + * @method Phaser.GameObjects.Mesh#setPerspective + * @since 3.50.0 + * + * @param {number} width - The width of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param {number} height - The height of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param {number} [fov=45] - The field of view, in degrees. + * @param {number} [near=0.01] - The near value of the view. + * @param {number} [far=1000] - The far value of the view. + */ + setPerspective: function (width, height, fov, near, far) + { + if (fov === undefined) { fov = 45; } + if (near === undefined) { near = 0.01; } + if (far === undefined) { far = 1000; } + + this.projectionMatrix.perspective(DegToRad(fov), width / height, near, far); + + this.dirtyCache[10] = 1; + this.dirtyCache[11] = 0; + + return this; + }, + + /** + * Builds a new orthographic projection matrix from the given values. + * + * If using this mode you will often need to set `Mesh.hideCCW` to `false` as well. + * + * See also `setPerspective`. + * + * @method Phaser.GameObjects.Mesh#setOrtho + * @since 3.50.0 + * + * @param {number} [scaleX=1] - The default horizontal scale in relation to the Mesh / Renderer dimensions. + * @param {number} [scaleY=1] - The default vertical scale in relation to the Mesh / Renderer dimensions. + * @param {number} [near=-1000] - The near value of the view. + * @param {number} [far=1000] - The far value of the view. + */ + setOrtho: function (scaleX, scaleY, near, far) + { + if (scaleX === undefined) { scaleX = 1; } + if (scaleY === undefined) { scaleY = 1; } + if (near === undefined) { near = -1000; } + if (far === undefined) { far = 1000; } + + this.projectionMatrix.ortho(-scaleX, scaleX, -scaleY, scaleY, near, far); + + this.dirtyCache[10] = 1; + this.dirtyCache[11] = 1; + + return this; + }, + + /** + * Iterates and destroys all current Faces in this Mesh, then resets the + * `faces` and `vertices` arrays. + * + * @method Phaser.GameObjects.Mesh#clear + * @since 3.50.0 + * + * @return {this} This Mesh Game Object. + */ + clear: function () + { + this.faces.forEach(function (face) + { + face.destroy(); + }); + + this.faces = []; + this.vertices = []; + + return this; + }, + + /** + * This method will add the data from a triangulated Wavefront OBJ model file to this Mesh. + * + * The data should have been loaded via the OBJFile: + * + * ```javascript + * this.load.obj(key, url); + * ``` + * + * Then use the same `key` as the first parameter to this method. + * + * Multiple Mesh Game Objects can use the same model data without impacting on each other. + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small, or too large, to see. + * You can also offset the vertices of the model via the `x`, `y` and `z` parameters. + * + * @method Phaser.GameObjects.Mesh#addVerticesFromObj + * @since 3.50.0 + * + * @param {string} key - The key of the model data in the OBJ Cache to add to this Mesh. + * @param {number} [scale=1] - An amount to scale the model data by. Use this if the model has exported too small, or large, to see. + * @param {number} [x=0] - Translate the model x position by this amount. + * @param {number} [y=0] - Translate the model y position by this amount. + * @param {number} [z=0] - Translate the model z position by this amount. + * @param {number} [rotateX=0] - Rotate the model on the x axis by this amount, in radians. + * @param {number} [rotateY=0] - Rotate the model on the y axis by this amount, in radians. + * @param {number} [rotateZ=0] - Rotate the model on the z axis by this amount, in radians. + * @param {boolean} [zIsUp=true] - Is the z axis up (true), or is y axis up (false)? + * + * @return {this} This Mesh Game Object. + */ + addVerticesFromObj: function (key, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) + { + var data = this.scene.sys.cache.obj.get(key); + + if (data) + { + GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + } + + return this; + }, + + /** + * Compare the depth of two Faces. + * + * @method Phaser.GameObjects.Mesh#sortByDepth + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Face} faceA - The first Face. + * @param {Phaser.Geom.Mesh.Face} faceB - The second Face. + * + * @return {number} The difference between the depths of each Face. + */ + sortByDepth: function (faceA, faceB) + { + return faceA.depth - faceB.depth; + }, + + /** + * Runs a depth sort across all Faces in this Mesh, comparing their averaged depth. + * + * This is called automatically if you use any of the `rotate` methods, but you can + * also invoke it to sort the Faces should you manually position them. + * + * @method Phaser.GameObjects.Mesh#depthSort + * @since 3.50.0 + * + * @return {this} This Mesh Game Object. + */ + depthSort: function () + { + StableSort(this.faces, this.sortByDepth); + + return this; + }, + + /** + * Adds a new Vertex into the vertices array of this Mesh. + * + * Just adding a vertex isn't enough to render it. You need to also + * make it part of a Face, with 3 Vertex instances per Face. + * + * @method Phaser.GameObjects.Mesh#addVertex + * @since 3.50.0 + * + * @param {number} x - The x position of the vertex. + * @param {number} y - The y position of the vertex. + * @param {number} z - The z position of the vertex. + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * @param {number} [color=0xffffff] - The color value of the vertex. + * @param {number} [alpha=1] - The alpha value of the vertex. + * + * @return {this} This Mesh Game Object. + */ + addVertex: function (x, y, z, u, v, color, alpha) + { + var vert = new Vertex(x, y, z, u, v, color, alpha); + + this.vertices.push(vert); + + return vert; + }, + + /** + * Adds a new Face into the faces array of this Mesh. + * + * A Face consists of references to 3 Vertex instances, which must be provided. + * + * @method Phaser.GameObjects.Mesh#addFace + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Vertex} vertex1 - The first vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex2 - The second vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex3 - The third vertex of the Face. + * + * @return {this} This Mesh Game Object. + */ + addFace: function (vertex1, vertex2, vertex3) + { + var face = new Face(vertex1, vertex2, vertex3); + + this.faces.push(face); + + this.dirtyCache[9] = -1; + + return face; + }, + + /** + * Adds new vertices to this Mesh by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * mesh.addVertices(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * + * @method Phaser.GameObjects.Mesh#addVertices + * @since 3.50.0 + * + * @param {number[]} vertices - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} uvs - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * + * @return {this} This Mesh Game Object. + */ + addVertices: function (vertices, uvs, indicies, containsZ, normals, colors, alphas) + { + var result = GenerateVerts(vertices, uvs, indicies, containsZ, normals, colors, alphas); + + if (result) + { + this.faces = this.faces.concat(result.faces); + this.vertices = this.vertices.concat(result.vertices); + } + + this.dirtyCache[9] = -1; + + return this; + }, + + /** + * Returns the total number of Faces in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getFaceCount + * @since 3.50.0 + * + * @return {number} The number of Faces in this Mesh Game Object. + */ + getFaceCount: function () + { + return this.faces.length; + }, + + /** + * Returns the total number of Vertices in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getVertexCount + * @since 3.50.0 + * + * @return {number} The number of Vertices in this Mesh Game Object. + */ + getVertexCount: function () + { + return this.vertices.length; + }, + + /** + * Returns the Face at the given index in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getFace + * @since 3.50.0 + * + * @param {number} index - The index of the Face to get. + * + * @return {Phaser.Geom.Mesh.Face} The Face at the given index, or `undefined` if index out of range. + */ + getFace: function (index) + { + return this.faces[index]; + }, + + /** + * Return an array of Face objects from this Mesh that intersect with the given coordinates. + * + * The given position is translated through the matrix of this Mesh and the given Camera, + * before being compared against the vertices. + * + * If more than one Face intersects, they will all be returned in the array, but the array will + * be depth sorted first, so the first element will always be that closest to the camera. + * + * @method Phaser.GameObjects.Mesh#getFaceAt + * @since 3.50.0 + * + * @param {number} x - The x position to check against. + * @param {number} y - The y position to check against. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The camera to pass the coordinates through. If not give, the default Scene Camera is used. + * + * @return {Phaser.Geom.Mesh.Face[]} An array of Face objects that intersect with the given point, ordered by depth. + */ + getFaceAt: function (x, y, camera) + { + if (camera === undefined) { camera = this.scene.sys.cameras.main; } + + var calcMatrix = GetCalcMatrix(this, camera).calc; + + var faces = this.faces; + var results = []; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + if (face.contains(x, y, calcMatrix)) + { + results.push(face); + } + } + + return StableSort(results, this.sortByDepth); + }, + + /** + * This method enables rendering of the Mesh vertices to the given Graphics instance. + * + * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, + * otherwise the Graphics instance you provide to debug will fill-up with draw calls, + * eventually crashing the browser. This is not done automatically to allow you to debug + * draw multiple Mesh objects to a single Graphics instance. + * + * The Mesh class has a built-in debug rendering callback `Mesh.renderDebug`, however + * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. + * + * The callback is invoked _once per render_ and sent the following parameters: + * + * `callback(src, faces)` + * + * `src` is the Mesh instance being debugged. + * `faces` is an array of the Faces that were rendered. + * + * You can get the final drawn vertex position from a Face object like this: + * + * ```javascript + * let face = faces[i]; + * + * let x0 = face.vertex1.tx; + * let y0 = face.vertex1.ty; + * let x1 = face.vertex2.tx; + * let y1 = face.vertex2.ty; + * let x2 = face.vertex3.tx; + * let y2 = face.vertex3.ty; + * + * graphic.strokeTriangle(x0, y0, x1, y1, x2, y2); + * ``` + * + * If using your own callback you do not have to provide a Graphics instance to this method. + * + * To disable debug rendering, to either your own callback or the built-in one, call this method + * with no arguments. + * + * @method Phaser.GameObjects.Mesh#setDebug + * @since 3.50.0 + * + * @param {Phaser.GameObjects.Graphics} [graphic] - The Graphic instance to render to if using the built-in callback. + * @param {function} [callback] - The callback to invoke during debug render. Leave as undefined to use the built-in callback. + * + * @return {this} This Game Object instance. + */ + setDebug: function (graphic, callback) + { + this.debugGraphic = graphic; + + if (!graphic && !callback) + { + this.debugCallback = null; + } + else if (!callback) + { + this.debugCallback = this.renderDebug; + } + else + { + this.debugCallback = callback; + } + + return this; + }, + + /** + * Checks if the transformation data in this mesh is dirty. + * + * This is used internally by the `preUpdate` step to determine if the vertices should + * be recalculated or not. + * + * @method Phaser.GameObjects.Mesh#isDirty + * @since 3.50.0 + * + * @return {boolean} Returns `true` if the data of this mesh is dirty, otherwise `false`. + */ + isDirty: function () + { + var position = this.modelPosition; + var rotation = this.modelRotation; + var scale = this.modelScale; + var dirtyCache = this.dirtyCache; + + var px = position.x; + var py = position.y; + var pz = position.z; + + var rx = rotation.x; + var ry = rotation.y; + var rz = rotation.z; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + var faces = this.getFaceCount(); + + var pxCached = dirtyCache[0]; + var pyCached = dirtyCache[1]; + var pzCached = dirtyCache[2]; + + var rxCached = dirtyCache[3]; + var ryCached = dirtyCache[4]; + var rzCached = dirtyCache[5]; + + var sxCached = dirtyCache[6]; + var syCached = dirtyCache[7]; + var szCached = dirtyCache[8]; + + var fCached = dirtyCache[9]; + + dirtyCache[0] = px; + dirtyCache[1] = py; + dirtyCache[2] = pz; + + dirtyCache[3] = rx; + dirtyCache[4] = ry; + dirtyCache[5] = rz; + + dirtyCache[6] = sx; + dirtyCache[7] = sy; + dirtyCache[8] = sz; + + dirtyCache[9] = faces; + + return ( + pxCached !== px || pyCached !== py || pzCached !== pz || + rxCached !== rx || ryCached !== ry || rzCached !== rz || + sxCached !== sx || syCached !== sy || szCached !== sz || + fCached !== faces + ); + }, + + /** + * The Mesh update loop. The following takes place in this method: + * + * First, the `totalRendered` and `totalFrame` properties are set. + * + * If the view matrix of this Mesh isn't dirty, and the model position, rotate or scale properties are + * all clean, then the method returns at this point. + * + * Otherwise, if the viewPosition is dirty (i.e. from calling a method like `panZ`), then it will + * refresh the viewMatrix. + * + * After this, a new transformMatrix is built and it then iterates through all Faces in this + * Mesh, calling `transformCoordinatesLocal` on all of them. Internally, this updates every + * vertex, calculating its new transformed position, based on the new transform matrix. + * + * Finally, the faces are depth sorted. + * + * @method Phaser.GameObjects.Mesh#preUpdate + * @protected + * @since 3.50.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function () + { + this.totalRendered = this.totalFrame; + this.totalFrame = 0; + + var dirty = this.dirtyCache; + + if (!this.ignoreDirtyCache && !dirty[10] && !this.isDirty()) + { + // If neither the view or the mesh is dirty we can bail out and save lots of math + return; + } + + var width = this.width; + var height = this.height; + + var viewMatrix = this.viewMatrix; + var viewPosition = this.viewPosition; + + if (dirty[10]) + { + viewMatrix.identity(); + viewMatrix.translate(viewPosition); + viewMatrix.invert(); + + dirty[10] = 0; + } + + var transformMatrix = this.transformMatrix; + + transformMatrix.setWorldMatrix( + this.modelRotation, + this.modelPosition, + this.modelScale, + this.viewMatrix, + this.projectionMatrix + ); + + var z = viewPosition.z; + + var faces = this.faces; + + for (var i = 0; i < faces.length; i++) + { + faces[i].transformCoordinatesLocal(transformMatrix, width, height, z); + } + + this.depthSort(); + }, + + /** + * The built-in Mesh debug rendering method. + * + * See `Mesh.setDebug` for more details. + * + * @method Phaser.GameObjects.Mesh#renderDebug + * @since 3.50.0 + * + * @param {Phaser.GameObjects.Mesh} src - The Mesh object being rendered. + * @param {Phaser.Geom.Mesh.Face[]} faces - An array of Faces. + */ + renderDebug: function (src, faces) + { + var graphic = src.debugGraphic; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + var x0 = face.vertex1.tx; + var y0 = face.vertex1.ty; + var x1 = face.vertex2.tx; + var y1 = face.vertex2.ty; + var x2 = face.vertex3.tx; + var y2 = face.vertex3.ty; + + graphic.strokeTriangle(x0, y0, x1, y1, x2, y2); + } + }, + + /** + * Handles the pre-destroy step for the Mesh, which removes the Animation component and typed arrays. + * + * @method Phaser.GameObjects.Mesh#preDestroy + * @private + * @since 3.50.0 + */ + preDestroy: function () + { + this.clear(); + + this.debugCallback = null; + this.debugGraphic = null; + } + +}); + +module.exports = Mesh; + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var DistanceBetween = __webpack_require__(61); /** * Checks if two Circles intersect. @@ -56253,7 +61059,7 @@ module.exports = CircleToCircle; /***/ }), -/* 217 */ +/* 223 */ /***/ (function(module, exports) { /** @@ -56307,7 +61113,7 @@ module.exports = CircleToRectangle; /***/ }), -/* 218 */ +/* 224 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56318,7 +61124,7 @@ module.exports = CircleToRectangle; */ var Point = __webpack_require__(4); -var LineToCircle = __webpack_require__(219); +var LineToCircle = __webpack_require__(225); /** * Checks for intersection between the line segment and circle, @@ -56399,7 +61205,7 @@ module.exports = GetLineToCircle; /***/ }), -/* 219 */ +/* 225 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56408,7 +61214,7 @@ module.exports = GetLineToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(57); +var Contains = __webpack_require__(62); var Point = __webpack_require__(4); var tmp = new Point(); @@ -56483,7 +61289,7 @@ module.exports = LineToCircle; /***/ }), -/* 220 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56494,8 +61300,8 @@ module.exports = LineToCircle; */ var Point = __webpack_require__(4); -var LineToLine = __webpack_require__(86); -var LineToRectangle = __webpack_require__(453); +var LineToLine = __webpack_require__(91); +var LineToRectangle = __webpack_require__(465); /** * Checks for intersection between the Line and a Rectangle shape, @@ -56543,7 +61349,7 @@ module.exports = GetLineToRectangle; /***/ }), -/* 221 */ +/* 227 */ /***/ (function(module, exports) { /** @@ -56630,7 +61436,7 @@ module.exports = ContainsArray; /***/ }), -/* 222 */ +/* 228 */ /***/ (function(module, exports) { /** @@ -56678,7 +61484,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 223 */ +/* 229 */ /***/ (function(module, exports) { /** @@ -56706,7 +61512,7 @@ module.exports = GetAspectRatio; /***/ }), -/* 224 */ +/* 230 */ /***/ (function(module, exports) { /** @@ -56760,7 +61566,7 @@ module.exports = RotateAroundXY; /***/ }), -/* 225 */ +/* 231 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56775,18 +61581,18 @@ module.exports = RotateAroundXY; module.exports = { - BUTTON_DOWN: __webpack_require__(1226), - BUTTON_UP: __webpack_require__(1227), - CONNECTED: __webpack_require__(1228), - DISCONNECTED: __webpack_require__(1229), - GAMEPAD_BUTTON_DOWN: __webpack_require__(1230), - GAMEPAD_BUTTON_UP: __webpack_require__(1231) + BUTTON_DOWN: __webpack_require__(1290), + BUTTON_UP: __webpack_require__(1291), + CONNECTED: __webpack_require__(1292), + DISCONNECTED: __webpack_require__(1293), + GAMEPAD_BUTTON_DOWN: __webpack_require__(1294), + GAMEPAD_BUTTON_UP: __webpack_require__(1295) }; /***/ }), -/* 226 */ +/* 232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56795,8 +61601,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); -var XHRSettings = __webpack_require__(147); +var Extend = __webpack_require__(18); +var XHRSettings = __webpack_require__(149); /** * Takes two XHRSettings Objects and creates a new XHRSettings object from them. @@ -56834,7 +61640,7 @@ module.exports = MergeXHRSettings; /***/ }), -/* 227 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -56844,12 +61650,12 @@ module.exports = MergeXHRSettings; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var ParseXML = __webpack_require__(375); +var ParseXML = __webpack_require__(385); /** * @classdesc @@ -57019,7 +61825,186 @@ module.exports = XMLFile; /***/ }), -/* 228 */ +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(19); +var File = __webpack_require__(22); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); + +/** + * @classdesc + * A single Text File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. + * + * @class TextFile + * @extends Phaser.Loader.File + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ +var TextFile = new Class({ + + Extends: File, + + initialize: + + function TextFile (loader, key, url, xhrSettings) + { + var type = 'text'; + var extension = 'txt'; + var cache = loader.cacheManager.text; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + url = GetFastValue(config, 'url'); + xhrSettings = GetFastValue(config, 'xhrSettings'); + extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); + } + + var fileConfig = { + type: type, + cache: cache, + extension: extension, + responseType: 'text', + key: key, + url: url, + xhrSettings: xhrSettings + }; + + File.call(this, loader, fileConfig); + }, + + /** + * Called automatically by Loader.nextFile. + * This method controls what extra work this File does with its loaded data. + * + * @method Phaser.Loader.FileTypes.TextFile#onProcess + * @since 3.7.0 + */ + onProcess: function () + { + this.state = CONST.FILE_PROCESSING; + + this.data = this.xhrLoader.responseText; + + this.onProcessComplete(); + } + +}); + +/** + * Adds a Text file, or array of Text files, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.text('story', 'files/IntroStory.txt'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Text Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Text Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.text({ + * key: 'story', + * url: 'files/IntroStory.txt' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.text('story', 'files/IntroStory.txt'); + * // and later in your game ... + * var data = this.cache.text.get('story'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the text from the Text Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#text + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('text', function (key, url, xhrSettings) +{ + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(new TextFile(this, key[i])); + } + } + else + { + this.addFile(new TextFile(this, key, url, xhrSettings)); + } + + return this; +}); + +module.exports = TextFile; + + +/***/ }), +/* 235 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57034,26 +62019,27 @@ module.exports = XMLFile; module.exports = { - Acceleration: __webpack_require__(1285), - Angular: __webpack_require__(1286), - Bounce: __webpack_require__(1287), - Debug: __webpack_require__(1288), - Drag: __webpack_require__(1289), - Enable: __webpack_require__(1290), - Friction: __webpack_require__(1291), - Gravity: __webpack_require__(1292), - Immovable: __webpack_require__(1293), - Mass: __webpack_require__(1294), - OverlapCirc: __webpack_require__(484), - OverlapRect: __webpack_require__(229), - Size: __webpack_require__(1295), - Velocity: __webpack_require__(1296) + Acceleration: __webpack_require__(1348), + Angular: __webpack_require__(1349), + Bounce: __webpack_require__(1350), + Debug: __webpack_require__(1351), + Drag: __webpack_require__(1352), + Enable: __webpack_require__(1353), + Friction: __webpack_require__(1354), + Gravity: __webpack_require__(1355), + Immovable: __webpack_require__(1356), + Mass: __webpack_require__(1357), + OverlapCirc: __webpack_require__(500), + OverlapRect: __webpack_require__(236), + Pushable: __webpack_require__(1358), + Size: __webpack_require__(1359), + Velocity: __webpack_require__(1360) }; /***/ }), -/* 229 */ +/* 236 */ /***/ (function(module, exports) { /** @@ -57138,7 +62124,7 @@ module.exports = OverlapRect; /***/ }), -/* 230 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57153,20 +62139,20 @@ module.exports = OverlapRect; module.exports = { - COLLIDE: __webpack_require__(1297), - OVERLAP: __webpack_require__(1298), - PAUSE: __webpack_require__(1299), - RESUME: __webpack_require__(1300), - TILE_COLLIDE: __webpack_require__(1301), - TILE_OVERLAP: __webpack_require__(1302), - WORLD_BOUNDS: __webpack_require__(1303), - WORLD_STEP: __webpack_require__(1304) + COLLIDE: __webpack_require__(1361), + OVERLAP: __webpack_require__(1362), + PAUSE: __webpack_require__(1363), + RESUME: __webpack_require__(1364), + TILE_COLLIDE: __webpack_require__(1365), + TILE_OVERLAP: __webpack_require__(1366), + WORLD_BOUNDS: __webpack_require__(1367), + WORLD_STEP: __webpack_require__(1368) }; /***/ }), -/* 231 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57175,7 +62161,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); /** * Calculates and returns the horizontal overlap between two arcade physics bodies and sets their properties @@ -57219,13 +62205,13 @@ var GetOverlapX = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.left = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.right = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.left = true; @@ -57249,13 +62235,13 @@ var GetOverlapX = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.right = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.left = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.right = true; @@ -57274,7 +62260,7 @@ module.exports = GetOverlapX; /***/ }), -/* 232 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57283,7 +62269,7 @@ module.exports = GetOverlapX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); /** * Calculates and returns the vertical overlap between two arcade physics bodies and sets their properties @@ -57327,13 +62313,13 @@ var GetOverlapY = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.up = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.down = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.up = true; @@ -57357,13 +62343,13 @@ var GetOverlapY = function (body1, body2, overlapOnly, bias) body2.touching.none = false; body2.touching.down = true; - if (body2.physicsType === CONST.STATIC_BODY) + if (body2.physicsType === CONST.STATIC_BODY && !overlapOnly) { body1.blocked.none = false; body1.blocked.up = true; } - if (body1.physicsType === CONST.STATIC_BODY) + if (body1.physicsType === CONST.STATIC_BODY && !overlapOnly) { body2.blocked.none = false; body2.blocked.down = true; @@ -57382,7 +62368,7 @@ module.exports = GetOverlapY; /***/ }), -/* 233 */ +/* 240 */ /***/ (function(module, exports) { /** @@ -57418,7 +62404,7 @@ module.exports = TileIntersectsBody; /***/ }), -/* 234 */ +/* 241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57435,12 +62421,12 @@ var Constraint = {}; module.exports = Constraint; -var Vertices = __webpack_require__(88); -var Vector = __webpack_require__(102); -var Sleeping = __webpack_require__(250); -var Bounds = __webpack_require__(103); -var Axes = __webpack_require__(542); -var Common = __webpack_require__(44); +var Vertices = __webpack_require__(93); +var Vector = __webpack_require__(114); +var Sleeping = __webpack_require__(265); +var Bounds = __webpack_require__(115); +var Axes = __webpack_require__(581); +var Common = __webpack_require__(50); (function() { @@ -57907,7 +62893,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 235 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -57916,7 +62902,143 @@ var Common = __webpack_require__(44); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(150); +var CONST = __webpack_require__(29); + +/** + * Get the Tilemap orientation from the given string. + * + * @function Phaser.Tilemaps.Orientation.FromOrientationString + * @since 3.50.0 + * + * @param {string} [orientation] - The orientation type as a string. + * + * @return {Phaser.Tilemaps.OrientationType} The Tilemap Orientation type. + */ +var FromOrientationString = function (orientation) +{ + orientation = orientation.toLowerCase(); + + if (orientation === 'isometric') + { + return CONST.ISOMETRIC; + } + else if (orientation === 'staggered') + { + return CONST.STAGGERED; + } + else if (orientation === 'hexagonal') + { + return CONST.HEXAGONAL; + } + else + { + return CONST.ORTHOGONAL; + } +}; + +module.exports = FromOrientationString; + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Tilemaps.Components + */ + +module.exports = { + + CalculateFacesAt: __webpack_require__(244), + CalculateFacesWithin: __webpack_require__(60), + CheckIsoBounds: __webpack_require__(520), + Copy: __webpack_require__(1393), + CreateFromTiles: __webpack_require__(1394), + CullBounds: __webpack_require__(522), + CullTiles: __webpack_require__(523), + Fill: __webpack_require__(1395), + FilterTiles: __webpack_require__(1396), + FindByIndex: __webpack_require__(1397), + FindTile: __webpack_require__(1398), + ForEachTile: __webpack_require__(1399), + GetCullTilesFunction: __webpack_require__(1400), + GetTileAt: __webpack_require__(151), + GetTileAtWorldXY: __webpack_require__(1401), + GetTilesWithin: __webpack_require__(26), + GetTilesWithinShape: __webpack_require__(1402), + GetTilesWithinWorldXY: __webpack_require__(506), + GetTileToWorldXFunction: __webpack_require__(1403), + GetTileToWorldXYFunction: __webpack_require__(1404), + GetTileToWorldYFunction: __webpack_require__(1405), + GetWorldToTileXFunction: __webpack_require__(1406), + GetWorldToTileXYFunction: __webpack_require__(1407), + GetWorldToTileYFunction: __webpack_require__(1408), + HasTileAt: __webpack_require__(541), + HasTileAtWorldXY: __webpack_require__(1409), + HexagonalCullBounds: __webpack_require__(525), + HexagonalCullTiles: __webpack_require__(524), + HexagonalTileToWorldXY: __webpack_require__(529), + HexagonalTileToWorldY: __webpack_require__(533), + HexagonalWorldToTileXY: __webpack_require__(535), + HexagonalWorldToTileY: __webpack_require__(539), + IsInLayerBounds: __webpack_require__(116), + IsometricCullTiles: __webpack_require__(526), + IsometricTileToWorldXY: __webpack_require__(530), + IsometricWorldToTileXY: __webpack_require__(536), + PutTileAt: __webpack_require__(249), + PutTileAtWorldXY: __webpack_require__(1410), + PutTilesAt: __webpack_require__(1411), + Randomize: __webpack_require__(1412), + RemoveTileAt: __webpack_require__(542), + RemoveTileAtWorldXY: __webpack_require__(1413), + RenderDebug: __webpack_require__(1414), + ReplaceByIndex: __webpack_require__(521), + RunCull: __webpack_require__(152), + SetCollision: __webpack_require__(1415), + SetCollisionBetween: __webpack_require__(1416), + SetCollisionByExclusion: __webpack_require__(1417), + SetCollisionByProperty: __webpack_require__(1418), + SetCollisionFromCollisionGroup: __webpack_require__(1419), + SetLayerCollisionIndex: __webpack_require__(153), + SetTileCollision: __webpack_require__(69), + SetTileIndexCallback: __webpack_require__(1420), + SetTileLocationCallback: __webpack_require__(1421), + Shuffle: __webpack_require__(1422), + StaggeredCullBounds: __webpack_require__(528), + StaggeredCullTiles: __webpack_require__(527), + StaggeredTileToWorldXY: __webpack_require__(531), + StaggeredTileToWorldY: __webpack_require__(534), + StaggeredWorldToTileXY: __webpack_require__(537), + StaggeredWorldToTileY: __webpack_require__(540), + SwapByIndex: __webpack_require__(1423), + TileToWorldX: __webpack_require__(245), + TileToWorldXY: __webpack_require__(532), + TileToWorldY: __webpack_require__(246), + WeightedRandomize: __webpack_require__(1424), + WorldToTileX: __webpack_require__(247), + WorldToTileXY: __webpack_require__(538), + WorldToTileY: __webpack_require__(248) + +}; + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTileAt = __webpack_require__(151); /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting @@ -57926,8 +63048,8 @@ var GetTileAt = __webpack_require__(150); * @function Phaser.Tilemaps.Components.CalculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesAt = function (tileX, tileY, layer) @@ -58001,7 +63123,191 @@ module.exports = CalculateFacesAt; /***/ }), -/* 236 */ +/* 245 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.TileToWorldX + * @since 3.0.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} + */ +var TileToWorldX = function (tileX, camera, layer) +{ + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + var layerWorldX = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + } + + return layerWorldX + tileX * tileWidth; +}; + +module.exports = TileToWorldX; + + +/***/ }), +/* 246 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.TileToWorldY + * @since 3.0.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var TileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return layerWorldY + tileY * tileHeight; +}; + +module.exports = TileToWorldY; + + +/***/ }), +/* 247 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileX + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {?Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The X location in tile units. + */ +var WorldToTileX = function (worldX, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileWidth = layer.baseTileWidth; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + return (snapToFloor) ? Math.floor(worldX / tileWidth) : worldX / tileWidth; +}; + +module.exports = WorldToTileX; + + +/***/ }), +/* 248 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.WorldToTileY + * @since 3.0.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {?Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var WorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return (snapToFloor) ? Math.floor(worldY / tileHeight) : worldY / tileHeight; +}; + +module.exports = WorldToTileY; + + +/***/ }), +/* 249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58010,10 +63316,10 @@ module.exports = CalculateFacesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(75); -var IsInLayerBounds = __webpack_require__(104); -var CalculateFacesAt = __webpack_require__(235); -var SetTileCollision = __webpack_require__(65); +var Tile = __webpack_require__(81); +var IsInLayerBounds = __webpack_require__(116); +var CalculateFacesAt = __webpack_require__(244); +var SetTileCollision = __webpack_require__(69); /** * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index @@ -58024,19 +63330,23 @@ var SetTileCollision = __webpack_require__(65); * @function Phaser.Tilemaps.Components.PutTileAt * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) { - if (!IsInLayerBounds(tileX, tileY, layer)) { return null; } if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!IsInLayerBounds(tileX, tileY, layer)) + { + return null; + } + var oldTile = layer.data[tileY][tileX]; var oldTileCollides = oldTile && oldTile.collides; @@ -58044,7 +63354,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) { if (layer.data[tileY][tileX] === null) { - layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, tile.width, tile.height); + layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, layer.tileWidth, layer.tileHeight); } layer.data[tileY][tileX].copy(tile); @@ -58082,7 +63392,7 @@ module.exports = PutTileAt; /***/ }), -/* 237 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58091,10 +63401,10 @@ module.exports = PutTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var LayerData = __webpack_require__(105); -var MapData = __webpack_require__(106); -var Tile = __webpack_require__(75); +var Formats = __webpack_require__(38); +var LayerData = __webpack_require__(117); +var MapData = __webpack_require__(118); +var Tile = __webpack_require__(81); /** * Parses a 2D array of tile indexes into a new MapData object with a single layer. @@ -58103,9 +63413,9 @@ var Tile = __webpack_require__(75); * @since 3.0.0 * * @param {string} name - The name of the tilemap, used to set the name on the MapData. - * @param {integer[][]} data - 2D array, CSV string or Tiled JSON object. - * @param {integer} tileWidth - The width of a tile in pixels. - * @param {integer} tileHeight - The height of a tile in pixels. + * @param {number[][]} data - 2D array, CSV string or Tiled JSON object. + * @param {number} tileWidth - The width of a tile in pixels. + * @param {number} tileHeight - The height of a tile in pixels. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty * location will get a Tile object with an index of -1. If you've a large sparsely populated map and @@ -58121,7 +63431,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull) tileWidth: tileWidth, tileHeight: tileHeight }); - + var mapData = new MapData({ name: name, tileWidth: tileWidth, @@ -58174,7 +63484,87 @@ module.exports = Parse2DArray; /***/ }), -/* 238 */ +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Pick = __webpack_require__(550); +var ParseGID = __webpack_require__(252); + +var copyPoints = function (p) { return { x: p.x, y: p.y }; }; + +var commonObjectProps = [ 'id', 'name', 'type', 'rotation', 'properties', 'visible', 'x', 'y', 'width', 'height' ]; + +/** + * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseObject + * @since 3.0.0 + * + * @param {object} tiledObject - Tiled object to convert to an internal parsed object normalising and copying properties over. + * @param {number} [offsetX=0] - Optional additional offset to apply to the object's x property. Defaults to 0. + * @param {number} [offsetY=0] - Optional additional offset to apply to the object's y property. Defaults to 0. + * + * @return {object} The parsed object containing properties read from the Tiled object according to it's type with x and y values updated according to the given offsets. + */ +var ParseObject = function (tiledObject, offsetX, offsetY) +{ + if (offsetX === undefined) { offsetX = 0; } + if (offsetY === undefined) { offsetY = 0; } + + var parsedObject = Pick(tiledObject, commonObjectProps); + + parsedObject.x += offsetX; + parsedObject.y += offsetY; + + if (tiledObject.gid) + { + // Object tiles + var gidInfo = ParseGID(tiledObject.gid); + parsedObject.gid = gidInfo.gid; + parsedObject.flippedHorizontal = gidInfo.flippedHorizontal; + parsedObject.flippedVertical = gidInfo.flippedVertical; + parsedObject.flippedAntiDiagonal = gidInfo.flippedAntiDiagonal; + } + else if (tiledObject.polyline) + { + parsedObject.polyline = tiledObject.polyline.map(copyPoints); + } + else if (tiledObject.polygon) + { + parsedObject.polygon = tiledObject.polygon.map(copyPoints); + } + else if (tiledObject.ellipse) + { + parsedObject.ellipse = tiledObject.ellipse; + } + else if (tiledObject.text) + { + parsedObject.text = tiledObject.text; + } + else if (tiledObject.point) + { + parsedObject.point = true; + } + else + { + // Otherwise, assume it is a rectangle + parsedObject.rectangle = true; + } + + return parsedObject; +}; + +module.exports = ParseObject; + + +/***/ }), +/* 252 */ /***/ (function(module, exports) { /** @@ -58264,7 +63654,7 @@ module.exports = ParseGID; /***/ }), -/* 239 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58273,90 +63663,10 @@ module.exports = ParseGID; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pick = __webpack_require__(514); -var ParseGID = __webpack_require__(238); - -var copyPoints = function (p) { return { x: p.x, y: p.y }; }; - -var commonObjectProps = [ 'id', 'name', 'type', 'rotation', 'properties', 'visible', 'x', 'y', 'width', 'height' ]; - -/** - * Convert a Tiled object to an internal parsed object normalising and copying properties over, while applying optional x and y offsets. The parsed object will always have the properties `id`, `name`, `type`, `rotation`, `properties`, `visible`, `x`, `y`, `width` and `height`. Other properties will be added according to the object type (such as text, polyline, gid etc.) - * - * @function Phaser.Tilemaps.Parsers.Tiled.ParseObject - * @since 3.0.0 - * - * @param {object} tiledObject - Tiled object to convert to an internal parsed object normalising and copying properties over. - * @param {number} [offsetX=0] - Optional additional offset to apply to the object's x property. Defaults to 0. - * @param {number} [offsetY=0] - Optional additional offset to apply to the object's y property. Defaults to 0. - * - * @return {object} The parsed object containing properties read from the Tiled object according to it's type with x and y values updated according to the given offsets. - */ -var ParseObject = function (tiledObject, offsetX, offsetY) -{ - if (offsetX === undefined) { offsetX = 0; } - if (offsetY === undefined) { offsetY = 0; } - - var parsedObject = Pick(tiledObject, commonObjectProps); - - parsedObject.x += offsetX; - parsedObject.y += offsetY; - - if (tiledObject.gid) - { - // Object tiles - var gidInfo = ParseGID(tiledObject.gid); - parsedObject.gid = gidInfo.gid; - parsedObject.flippedHorizontal = gidInfo.flippedHorizontal; - parsedObject.flippedVertical = gidInfo.flippedVertical; - parsedObject.flippedAntiDiagonal = gidInfo.flippedAntiDiagonal; - } - else if (tiledObject.polyline) - { - parsedObject.polyline = tiledObject.polyline.map(copyPoints); - } - else if (tiledObject.polygon) - { - parsedObject.polygon = tiledObject.polygon.map(copyPoints); - } - else if (tiledObject.ellipse) - { - parsedObject.ellipse = tiledObject.ellipse; - } - else if (tiledObject.text) - { - parsedObject.text = tiledObject.text; - } - else if (tiledObject.point) - { - parsedObject.point = true; - } - else - { - // Otherwise, assume it is a rectangle - parsedObject.rectangle = true; - } - - return parsedObject; -}; - -module.exports = ParseObject; - - -/***/ }), -/* 240 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Formats = __webpack_require__(33); -var MapData = __webpack_require__(106); -var Parse = __webpack_require__(506); -var Tilemap = __webpack_require__(522); +var Formats = __webpack_require__(38); +var MapData = __webpack_require__(118); +var Parse = __webpack_require__(543); +var Tilemap = __webpack_require__(559); /** * Create a Tilemap from the given key or data. If neither is given, make a blank Tilemap. When @@ -58366,14 +63676,14 @@ var Tilemap = __webpack_require__(522); * * @function Phaser.Tilemaps.ParseToTilemap * @since 3.0.0 - * + * * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs. * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param {integer} [tileWidth=32] - The width of a tile in pixels. - * @param {integer} [tileHeight=32] - The height of a tile in pixels. - * @param {integer} [width=10] - The width of the map in tiles. - * @param {integer} [height=10] - The height of the map in tiles. - * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * @param {number} [tileWidth=32] - The width of a tile in pixels. + * @param {number} [tileHeight=32] - The height of a tile in pixels. + * @param {number} [width=10] - The width of the map in tiles. + * @param {number} [height=10] - The height of the map in tiles. + * @param {number[][]} [data] - Instead of loading from the cache, you can also load directly from * a 2D array of tile indexes. * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty @@ -58381,7 +63691,7 @@ var Tilemap = __webpack_require__(522); * the tile data doesn't need to change then setting this value to `true` will help with memory * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. - * + * * @return {Phaser.Tilemaps.Tilemap} */ var ParseToTilemap = function (scene, key, tileWidth, tileHeight, width, height, data, insertNull) @@ -58430,7 +63740,7 @@ module.exports = ParseToTilemap; /***/ }), -/* 241 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58479,7 +63789,7 @@ module.exports = GetTargets; /***/ }), -/* 242 */ +/* 255 */ /***/ (function(module, exports) { /** @@ -58747,7 +64057,7 @@ module.exports = GetValueOp; /***/ }), -/* 243 */ +/* 256 */ /***/ (function(module, exports) { /** @@ -58791,7 +64101,7 @@ module.exports = TWEEN_DEFAULTS; /***/ }), -/* 244 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -58801,11 +64111,11 @@ module.exports = TWEEN_DEFAULTS; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(245); -var GameObjectCreator = __webpack_require__(16); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(258); +var GameObjectCreator = __webpack_require__(17); var GameObjectFactory = __webpack_require__(5); -var TWEEN_CONST = __webpack_require__(91); +var TWEEN_CONST = __webpack_require__(96); var MATH_CONST = __webpack_require__(13); /** @@ -58866,7 +64176,7 @@ var Tween = new Class({ * The cached length of the data array. * * @name Phaser.Tweens.Tween#totalData - * @type {integer} + * @type {number} * @since 3.0.0 */ this.totalData = data.length; @@ -58884,7 +64194,7 @@ var Tween = new Class({ * Cached target total (not necessarily the same as the data total) * * @name Phaser.Tweens.Tween#totalTargets - * @type {integer} + * @type {number} * @since 3.0.0 */ this.totalTargets = targets.length; @@ -59019,7 +64329,7 @@ var Tween = new Class({ * The current state of the tween * * @name Phaser.Tweens.Tween#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = TWEEN_CONST.PENDING_ADD; @@ -59028,7 +64338,7 @@ var Tween = new Class({ * The state of the tween when it was paused (used by Resume) * * @name Phaser.Tweens.Tween#_pausedState - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -59148,7 +64458,7 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#getValue * @since 3.0.0 * - * @param {integer} [index=0] - The Tween Data to return the value from. + * @param {number} [index=0] - The Tween Data to return the value from. * * @return {number} The value of the requested Tween Data. */ @@ -60080,7 +65390,7 @@ var Tween = new Class({ * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. * - * @return {integer} The state of this Tween. + * @return {number} The state of this Tween. */ setStateFromEnd: function (tween, tweenData, diff) { @@ -60166,7 +65476,7 @@ var Tween = new Class({ * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. * - * @return {integer} The state of this Tween. + * @return {number} The state of this Tween. */ setStateFromStart: function (tween, tweenData, diff) { @@ -60434,7 +65744,7 @@ module.exports = Tween; /***/ }), -/* 245 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60449,26 +65759,26 @@ module.exports = Tween; module.exports = { - TIMELINE_COMPLETE: __webpack_require__(1376), - TIMELINE_LOOP: __webpack_require__(1377), - TIMELINE_PAUSE: __webpack_require__(1378), - TIMELINE_RESUME: __webpack_require__(1379), - TIMELINE_START: __webpack_require__(1380), - TIMELINE_UPDATE: __webpack_require__(1381), - TWEEN_ACTIVE: __webpack_require__(1382), - TWEEN_COMPLETE: __webpack_require__(1383), - TWEEN_LOOP: __webpack_require__(1384), - TWEEN_REPEAT: __webpack_require__(1385), - TWEEN_START: __webpack_require__(1386), - TWEEN_STOP: __webpack_require__(1387), - TWEEN_UPDATE: __webpack_require__(1388), - TWEEN_YOYO: __webpack_require__(1389) + TIMELINE_COMPLETE: __webpack_require__(1438), + TIMELINE_LOOP: __webpack_require__(1439), + TIMELINE_PAUSE: __webpack_require__(1440), + TIMELINE_RESUME: __webpack_require__(1441), + TIMELINE_START: __webpack_require__(1442), + TIMELINE_UPDATE: __webpack_require__(1443), + TWEEN_ACTIVE: __webpack_require__(1444), + TWEEN_COMPLETE: __webpack_require__(1445), + TWEEN_LOOP: __webpack_require__(1446), + TWEEN_REPEAT: __webpack_require__(1447), + TWEEN_START: __webpack_require__(1448), + TWEEN_STOP: __webpack_require__(1449), + TWEEN_UPDATE: __webpack_require__(1450), + TWEEN_YOYO: __webpack_require__(1451) }; /***/ }), -/* 246 */ +/* 259 */ /***/ (function(module, exports) { /** @@ -60488,7 +65798,7 @@ module.exports = { * @since 3.0.0 * * @param {any} target - The target to tween. - * @param {integer} index - The target index within the Tween targets array. + * @param {number} index - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. * @param {function} getEnd - What the property will be at the END of the Tween. * @param {function} getStart - What the property will be at the START of the Tween. @@ -60595,7 +65905,7 @@ module.exports = TweenData; /***/ }), -/* 247 */ +/* 260 */ /***/ (function(module, exports) { /** @@ -60617,7 +65927,7 @@ var ScaleModes = { * Default Scale Mode (Linear). * * @name Phaser.ScaleModes.DEFAULT - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -60627,7 +65937,7 @@ var ScaleModes = { * Linear Scale Mode. * * @name Phaser.ScaleModes.LINEAR - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -60637,7 +65947,7 @@ var ScaleModes = { * Nearest Scale Mode. * * @name Phaser.ScaleModes.NEAREST - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -60649,7 +65959,7 @@ module.exports = ScaleModes; /***/ }), -/* 248 */ +/* 261 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60658,7 +65968,7 @@ module.exports = ScaleModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathWrap = __webpack_require__(59); +var MathWrap = __webpack_require__(64); /** * Wrap an angle. @@ -60681,7 +65991,7 @@ module.exports = Wrap; /***/ }), -/* 249 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60690,7 +66000,7 @@ module.exports = Wrap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * Wrap an angle in degrees. @@ -60713,7 +66023,1011 @@ module.exports = WrapDegrees; /***/ }), -/* 250 */ +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Events = __webpack_require__(190); + +/** + * @classdesc + * A Render Target encapsulates a WebGL framebuffer and the WebGL Texture that displays it. + * + * Instances of this class are typically created by, and belong to WebGL Pipelines, however + * other Game Objects and classes can take advantage of Render Targets as well. + * + * @class RenderTarget + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the WebGLRenderer. + * @param {number} width - The width of this Render Target. + * @param {number} height - The height of this Render Target. + * @param {number} [scale=1] - A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. + * @param {number} [minFilter=0] - The minFilter mode of the texture when created. 0 is `LINEAR`, 1 is `NEAREST`. + * @param {boolean} [autoClear=true] - Automatically clear this framebuffer when bound? + * @param {boolean} [autoResize=false] - Automatically resize this Render Target if the WebGL Renderer resizes? + */ +var RenderTarget = new Class({ + + initialize: + + function RenderTarget (renderer, width, height, scale, minFilter, autoClear, autoResize) + { + if (scale === undefined) { scale = 1; } + if (minFilter === undefined) { minFilter = 0; } + if (autoClear === undefined) { autoClear = true; } + if (autoResize === undefined) { autoResize = false; } + + /** + * A reference to the WebGLRenderer instance. + * + * @name Phaser.Renderer.WebGL.RenderTarget#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.50.0 + */ + this.renderer = renderer; + + /** + * The WebGLFramebuffer of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#framebuffer + * @type {WebGLFramebuffer} + * @since 3.50.0 + */ + this.framebuffer = null; + + /** + * The WebGLTexture of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#texture + * @type {WebGLTexture} + * @since 3.50.0 + */ + this.texture = null; + + /** + * The width of the texture. + * + * @name Phaser.Renderer.WebGL.RenderTarget#width + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.width = 0; + + /** + * The height of the texture. + * + * @name Phaser.Renderer.WebGL.RenderTarget#height + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.height = 0; + + /** + * A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. + * + * A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc. + * + * @name Phaser.Renderer.WebGL.RenderTarget#scale + * @type {number} + * @since 3.50.0 + */ + this.scale = scale; + + /** + * The minFilter mode of the texture. 0 is `LINEAR`, 1 is `NEAREST`. + * + * @name Phaser.Renderer.WebGL.RenderTarget#minFilter + * @type {number} + * @since 3.50.0 + */ + this.minFilter = minFilter; + + /** + * Controls if this Render Target is automatically cleared (via `gl.COLOR_BUFFER_BIT`) + * during the `RenderTarget.bind` method. + * + * If you need more control over how, or if, the target is cleared, you can disable + * this via the config on creation, or even toggle it directly at runtime. + * + * @name Phaser.Renderer.WebGL.RenderTarget#autoClear + * @type {boolean} + * @since 3.50.0 + */ + this.autoClear = autoClear; + + /** + * Does this Render Target automatically resize when the WebGL Renderer does? + * + * Modify this property via the `setAutoResize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#autoResize + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.autoResize = false; + + this.resize(width, height); + + if (autoResize) + { + this.setAutoResize(true); + } + }, + + /** + * Sets if this Render Target should automatically resize when the WebGL Renderer + * emits a resize event. + * + * @method Phaser.Renderer.WebGL.RenderTarget#setAutoResize + * @since 3.50.0 + * + * @param {boolean} autoResize - Automatically resize this Render Target when the WebGL Renderer resizes? + * + * @return {this} This RenderTarget instance. + */ + setAutoResize: function (autoResize) + { + if (autoResize && !this.autoResize) + { + this.renderer.on(Events.RESIZE, this.resize, this); + + this.autoResize = true; + } + else if (!autoResize && this.autoResize) + { + this.renderer.off(Events.RESIZE, this.resize, this); + + this.autoResize = false; + } + + return this; + }, + + /** + * Resizes this Render Target. + * + * Deletes both the frame buffer and texture, if they exist and then re-creates + * them using the new sizes. + * + * This method is called automatically by the pipeline during its resize handler. + * + * @method Phaser.Renderer.WebGL.RenderTarget#resize + * @since 3.50.0 + * + * @param {number} width - The new width of this Render Target. + * @param {number} height - The new height of this Render Target. + * + * @return {this} This RenderTarget instance. + */ + resize: function (width, height) + { + var renderer = this.renderer; + + renderer.deleteFramebuffer(this.framebuffer); + + renderer.deleteTexture(this.texture); + + width *= this.scale; + height *= this.scale; + + this.texture = renderer.createTextureFromSource(null, width, height, this.minFilter); + this.framebuffer = renderer.createFramebuffer(width, height, this.texture, false); + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Pushes this Render Target as the current frame buffer of the renderer. + * + * If `autoClear` is set, then clears the texture. + * + * If `adjustViewport` is `true` then it will flush the renderer and then adjust the GL viewport. + * + * @method Phaser.Renderer.WebGL.RenderTarget#bind + * @since 3.50.0 + * + * @param {boolean} [adjustViewport=false] - Adjust the GL viewport by calling `RenderTarget.adjustViewport` ? + */ + bind: function (adjustViewport) + { + if (adjustViewport === undefined) { adjustViewport = false; } + + if (adjustViewport) + { + this.renderer.flush(); + } + + this.renderer.pushFramebuffer(this.framebuffer, false, false, false); + + if (this.autoClear) + { + var gl = this.renderer.gl; + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + if (adjustViewport) + { + this.adjustViewport(); + } + }, + + /** + * Adjusts the GL viewport to match the WebGL Renderer width and height, + * with a y offset of `RenderTarget.height` - `WebGLRenderer.height`. + * + * @method Phaser.Renderer.WebGL.RenderTarget#adjustViewport + * @since 3.50.0 + */ + adjustViewport: function () + { + var renderer = this.renderer; + + var textureWidth = this.width; + var textureHeight = this.height; + + renderer.gl.viewport(0, 0, textureWidth, textureHeight); + renderer.gl.disable(renderer.gl.SCISSOR_TEST); + }, + + /** + * Clears this Render Target. + * + * @method Phaser.Renderer.WebGL.RenderTarget#clear + * @since 3.50.0 + */ + clear: function () + { + this.renderer.pushFramebuffer(this.framebuffer); + + var gl = this.renderer.gl; + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + + this.renderer.popFramebuffer(); + }, + + /** + * Unbinds this Render Target and optionally flushes the WebGL Renderer first. + * + * @name Phaser.Renderer.WebGL.RenderTarget#unbind + * @since 3.50.0 + * + * @param {boolean} [flush=false] - Flush the WebGL Renderer before unbinding? + * + * @return {WebGLFramebuffer} The Framebuffer that was set, or `null` if there aren't any more in the stack. + */ + unbind: function (flush) + { + if (flush === undefined) { flush = false; } + + var renderer = this.renderer; + + if (flush) + { + renderer.flush(); + + renderer.gl.enable(renderer.gl.SCISSOR_TEST); + + var scissor = renderer.currentScissor; + + if (scissor) + { + var x = scissor[0]; + var y = scissor[1]; + var width = scissor[2]; + var height = scissor[3]; + + renderer.gl.scissor(x, (renderer.drawingBufferHeight - y - height), width, height); + } + } + + return renderer.popFramebuffer(); + }, + + /** + * Removes all external references from this class and deletes the + * WebGL framebuffer and texture instances. + * + * Does not remove this Render Target from the parent pipeline. + * + * @name Phaser.Renderer.WebGL.RenderTarget#destroy + * @since 3.50.0 + */ + destroy: function () + { + var renderer = this.renderer; + + renderer.deleteFramebuffer(this.framebuffer); + renderer.deleteTexture(this.texture); + + renderer.off(Events.RESIZE, this.resize, this); + + this.renderer = null; + this.framebuffer = null; + this.texture = null; + } + +}); + +module.exports = RenderTarget; + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. + * + * Use the method `getData` to return a Float32Array containing the current color values. + * + * @class ColorMatrix + * @memberof Phaser.Display + * @constructor + * @since 3.50.0 + */ +var ColorMatrix = new Class({ + + initialize: + + function ColorMatrix () + { + /** + * Internal ColorMatrix array. + * + * @name Phaser.Display.ColorMatrix#_matrix + * @type {number[]} + * @private + * @since 3.50.0 + */ + this._matrix = [ + 1, 0, 0, 0, 0, + 0, 1, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0 + ]; + + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + * + * @name Phaser.Display.ColorMatrix#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = 1; + + /** + * Is the ColorMatrix array dirty? + * + * @name Phaser.Display.ColorMatrix#_dirty + * @type {boolean} + * @private + * @since 3.50.0 + */ + this._dirty = true; + + /** + * The matrix data as a Float32Array. + * + * Returned by the `getData` method. + * + * @name Phaser.Display.ColorMatrix#data + * @type {Float32Array} + * @private + * @since 3.50.0 + */ + this._data; + }, + + /** + * Sets this ColorMatrix from the given array of color values. + * + * @method Phaser.Display.ColorMatrix#set + * @since 3.50.0 + * + * @param {number[]} value - The ColorMatrix values to set. + * + * @return {this} This ColorMatrix instance. + */ + set: function (value) + { + this._matrix = value; + + this._dirty = true; + + return this; + }, + + /** + * Resets the ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#reset + * @since 3.50.0 + * + * @return {this} This ColorMatrix instance. + */ + reset: function () + { + // Long-winded, but saves on gc, which happens a lot in Post FX Shaders + // that reset the ColorMatrix every frame. + + var m = this._matrix; + + m[0] = 1; + m[1] = 0; + m[2] = 0; + m[3] = 0; + m[4] = 0; + + m[5] = 0; + m[6] = 1; + m[7] = 0; + m[8] = 0; + m[9] = 0; + + m[10] = 0; + m[11] = 0; + m[12] = 1; + m[13] = 0; + m[14] = 0; + + m[15] = 0; + m[16] = 0; + m[17] = 0; + m[18] = 1; + m[19] = 0; + + this._dirty = true; + + return this; + }, + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + * + * @method Phaser.Display.ColorMatrix#getData + * @since 3.50.0 + * + * @return {Float32Array} The ColorMatrix as a Float32Array. + */ + getData: function () + { + if (this._dirty) + { + var f32 = new Float32Array(this._matrix); + + f32[4] /= 255; + f32[9] /= 255; + f32[14] /= 255; + f32[19] /= 255; + + this._data = f32; + + this._dirty = false; + } + + return this._data; + }, + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#brightness + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brightness: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var b = value; + + return this.multiply([ + b, 0, 0, 0, 0, + 0, b, 0, 0, 0, + 0, 0, b, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#saturate + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of saturation to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + saturate: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var x = (value * 2 / 3) + 1; + var y = ((x - 1) * -0.5); + + return this.multiply([ + x, y, y, 0, 0, + y, x, y, 0, 0, + y, y, x, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Desaturates this ColorMatrix (removes color from it). + * + * @method Phaser.Display.ColorMatrix#saturation + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturate: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.saturate(-1, multiply); + }, + + /** + * Rotates the hues of this ColorMatrix by the value given. + * + * @method Phaser.Display.ColorMatrix#hue + * @since 3.50.0 + * + * @param {number} [rotation=0] - The amount of hue rotation to apply to this ColorMatrix, in degrees. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + hue: function (rotation, multiply) + { + if (rotation === undefined) { rotation = 0; } + if (multiply === undefined) { multiply = false; } + + rotation = rotation / 180 * Math.PI; + + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + var lumR = 0.213; + var lumG = 0.715; + var lumB = 0.072; + + return this.multiply([ + lumR + cos * (1 - lumR) + sin * (-lumR),lumG + cos * (-lumG) + sin * (-lumG),lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0, + lumR + cos * (-lumR) + sin * (0.143),lumG + cos * (1 - lumG) + sin * (0.140),lumB + cos * (-lumB) + sin * (-0.283), 0, 0, + lumR + cos * (-lumR) + sin * (-(1 - lumR)),lumG + cos * (-lumG) + sin * (lumG),lumB + cos * (1 - lumB) + sin * (lumB), 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Sets this ColorMatrix to be grayscale. + * + * @method Phaser.Display.ColorMatrix#grayscale + * @since 3.50.0 + * + * @param {number} [value=1] - The grayscale scale (0 is black). + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + grayscale: function (value, multiply) + { + if (value === undefined) { value = 1; } + if (multiply === undefined) { multiply = false; } + + return this.saturate(-value, multiply); + }, + + /** + * Sets this ColorMatrix to be black and white. + * + * @method Phaser.Display.ColorMatrix#blackWhite + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + blackWhite: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.3, 0.6, 0.1, 0, 0, + 0.3, 0.6, 0.1, 0, 0, + 0.3, 0.6, 0.1, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Change the contrast of this ColorMatrix by the amount given. + * + * @method Phaser.Display.ColorMatrix#contrast + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of contrast to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + contrast: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var v = value + 1; + var o = -0.5 * (v - 1); + + return this.multiply([ + v, 0, 0, 0, o, + 0, v, 0, 0, o, + 0, 0, v, 0, o, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Converts this ColorMatrix to have negative values. + * + * @method Phaser.Display.ColorMatrix#negative + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + negative: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + -1, 0, 0, 1, 0, + 0, -1, 0, 1, 0, + 0, 0, -1, 1, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Apply a desaturated luminance to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#desaturateLuminance + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturateLuminance: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a sepia tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#sepia + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + sepia: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.393, 0.7689999, 0.18899999, 0, 0, + 0.349, 0.6859999, 0.16799999, 0, 0, + 0.272, 0.5339999, 0.13099999, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a night vision tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#night + * @since 3.50.0 + * + * @param {number} [intensity=0.1] - The intensity of this effect. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + night: function (intensity, multiply) + { + if (intensity === undefined) { intensity = 0.1; } + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + intensity * (-2.0), -intensity, 0, 0, 0, + -intensity, 0, intensity, 0, 0, + 0, intensity, intensity * 2.0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a trippy color tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#lsd + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + lsd: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 2, -0.4, 0.5, 0, 0, + -0.5, 2, -0.4, 0, 0, + -0.4, -0.5, 3, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a brown tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#brown + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brown: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, + -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, + 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#vintagePinhole + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + vintagePinhole: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, + 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, + 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#kodachrome + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + kodachrome: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, + -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, + -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a technicolor color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#technicolor + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + technicolor: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, + -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, + -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a polaroid color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#polaroid + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + polaroid: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.438, -0.062, -0.062, 0, 0, + -0.122, 1.378, -0.122, 0, 0, + -0.016, -0.016, 1.483, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Shifts the values of this ColorMatrix into BGR order. + * + * @method Phaser.Display.ColorMatrix#shiftToBGR + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + shiftToBGR: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, + 1, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Multiplies the two given matrices. + * + * @method Phaser.Display.ColorMatrix#multiply + * @since 3.50.0 + * + * @param {number[]} a - The 5x4 array to multiply with ColorMatrix._matrix. + * + * @return {this} This ColorMatrix instance. + */ + multiply: function (a, multiply) + { + // Duplicate _matrix into c + + if (!multiply) + { + this.reset(); + } + + var m = this._matrix; + var c = []; + + for (var i = 0; i < 20; i++) + { + c[i] = m[i]; + } + + // R + m[0] = (c[0] * a[0]) + (c[1] * a[5]) + (c[2] * a[10]) + (c[3] * a[15]); + m[1] = (c[0] * a[1]) + (c[1] * a[6]) + (c[2] * a[11]) + (c[3] * a[16]); + m[2] = (c[0] * a[2]) + (c[1] * a[7]) + (c[2] * a[12]) + (c[3] * a[17]); + m[3] = (c[0] * a[3]) + (c[1] * a[8]) + (c[2] * a[13]) + (c[3] * a[18]); + m[4] = (c[0] * a[4]) + (c[1] * a[9]) + (c[2] * a[14]) + (c[3] * a[19]) + c[4]; + + // G + m[5] = (c[5] * a[0]) + (c[6] * a[5]) + (c[7] * a[10]) + (c[8] * a[15]); + m[6] = (c[5] * a[1]) + (c[6] * a[6]) + (c[7] * a[11]) + (c[8] * a[16]); + m[7] = (c[5] * a[2]) + (c[6] * a[7]) + (c[7] * a[12]) + (c[8] * a[17]); + m[8] = (c[5] * a[3]) + (c[6] * a[8]) + (c[7] * a[13]) + (c[8] * a[18]); + m[9] = (c[5] * a[4]) + (c[6] * a[9]) + (c[7] * a[14]) + (c[8] * a[19]) + c[9]; + + // B + m[10] = (c[10] * a[0]) + (c[11] * a[5]) + (c[12] * a[10]) + (c[13] * a[15]); + m[11] = (c[10] * a[1]) + (c[11] * a[6]) + (c[12] * a[11]) + (c[13] * a[16]); + m[12] = (c[10] * a[2]) + (c[11] * a[7]) + (c[12] * a[12]) + (c[13] * a[17]); + m[13] = (c[10] * a[3]) + (c[11] * a[8]) + (c[12] * a[13]) + (c[13] * a[18]); + m[14] = (c[10] * a[4]) + (c[11] * a[9]) + (c[12] * a[14]) + (c[13] * a[19]) + c[14]; + + // A + m[15] = (c[15] * a[0]) + (c[16] * a[5]) + (c[17] * a[10]) + (c[18] * a[15]); + m[16] = (c[15] * a[1]) + (c[16] * a[6]) + (c[17] * a[11]) + (c[18] * a[16]); + m[17] = (c[15] * a[2]) + (c[16] * a[7]) + (c[17] * a[12]) + (c[18] * a[17]); + m[18] = (c[15] * a[3]) + (c[16] * a[8]) + (c[17] * a[13]) + (c[18] * a[18]); + m[19] = (c[15] * a[4]) + (c[16] * a[9]) + (c[17] * a[14]) + (c[18] * a[19]) + c[19]; + + this._dirty = true; + + return this; + } + +}); + +module.exports = ColorMatrix; + + +/***/ }), +/* 265 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60726,7 +67040,7 @@ var Sleeping = {}; module.exports = Sleeping; -var Events = __webpack_require__(251); +var Events = __webpack_require__(266); (function() { @@ -60848,7 +67162,7 @@ var Events = __webpack_require__(251); /***/ }), -/* 251 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60863,7 +67177,7 @@ var Events = {}; module.exports = Events; -var Common = __webpack_require__(44); +var Common = __webpack_require__(50); (function() { @@ -60966,7 +67280,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 252 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -60981,65 +67295,65 @@ var Common = __webpack_require__(44); module.exports = { - AlignTo: __webpack_require__(556), - Angle: __webpack_require__(557), - Call: __webpack_require__(558), - GetFirst: __webpack_require__(559), - GetLast: __webpack_require__(560), - GridAlign: __webpack_require__(561), - IncAlpha: __webpack_require__(606), - IncX: __webpack_require__(607), - IncXY: __webpack_require__(608), - IncY: __webpack_require__(609), - PlaceOnCircle: __webpack_require__(610), - PlaceOnEllipse: __webpack_require__(611), - PlaceOnLine: __webpack_require__(612), - PlaceOnRectangle: __webpack_require__(613), - PlaceOnTriangle: __webpack_require__(614), - PlayAnimation: __webpack_require__(615), - PropertyValueInc: __webpack_require__(39), - PropertyValueSet: __webpack_require__(25), - RandomCircle: __webpack_require__(616), - RandomEllipse: __webpack_require__(617), - RandomLine: __webpack_require__(618), - RandomRectangle: __webpack_require__(619), - RandomTriangle: __webpack_require__(620), - Rotate: __webpack_require__(621), - RotateAround: __webpack_require__(622), - RotateAroundDistance: __webpack_require__(623), - ScaleX: __webpack_require__(624), - ScaleXY: __webpack_require__(625), - ScaleY: __webpack_require__(626), - SetAlpha: __webpack_require__(627), - SetBlendMode: __webpack_require__(628), - SetDepth: __webpack_require__(629), - SetHitArea: __webpack_require__(630), - SetOrigin: __webpack_require__(631), - SetRotation: __webpack_require__(632), - SetScale: __webpack_require__(633), - SetScaleX: __webpack_require__(634), - SetScaleY: __webpack_require__(635), - SetScrollFactor: __webpack_require__(636), - SetScrollFactorX: __webpack_require__(637), - SetScrollFactorY: __webpack_require__(638), - SetTint: __webpack_require__(639), - SetVisible: __webpack_require__(640), - SetX: __webpack_require__(641), - SetXY: __webpack_require__(642), - SetY: __webpack_require__(643), - ShiftPosition: __webpack_require__(644), - Shuffle: __webpack_require__(645), - SmootherStep: __webpack_require__(646), - SmoothStep: __webpack_require__(647), - Spread: __webpack_require__(648), - ToggleVisible: __webpack_require__(649), - WrapInRectangle: __webpack_require__(650) + AlignTo: __webpack_require__(595), + Angle: __webpack_require__(596), + Call: __webpack_require__(597), + GetFirst: __webpack_require__(598), + GetLast: __webpack_require__(599), + GridAlign: __webpack_require__(600), + IncAlpha: __webpack_require__(646), + IncX: __webpack_require__(647), + IncXY: __webpack_require__(648), + IncY: __webpack_require__(649), + PlaceOnCircle: __webpack_require__(650), + PlaceOnEllipse: __webpack_require__(651), + PlaceOnLine: __webpack_require__(652), + PlaceOnRectangle: __webpack_require__(653), + PlaceOnTriangle: __webpack_require__(654), + PlayAnimation: __webpack_require__(655), + PropertyValueInc: __webpack_require__(44), + PropertyValueSet: __webpack_require__(27), + RandomCircle: __webpack_require__(656), + RandomEllipse: __webpack_require__(657), + RandomLine: __webpack_require__(658), + RandomRectangle: __webpack_require__(659), + RandomTriangle: __webpack_require__(660), + Rotate: __webpack_require__(661), + RotateAround: __webpack_require__(662), + RotateAroundDistance: __webpack_require__(663), + ScaleX: __webpack_require__(664), + ScaleXY: __webpack_require__(665), + ScaleY: __webpack_require__(666), + SetAlpha: __webpack_require__(667), + SetBlendMode: __webpack_require__(668), + SetDepth: __webpack_require__(669), + SetHitArea: __webpack_require__(670), + SetOrigin: __webpack_require__(671), + SetRotation: __webpack_require__(672), + SetScale: __webpack_require__(673), + SetScaleX: __webpack_require__(674), + SetScaleY: __webpack_require__(675), + SetScrollFactor: __webpack_require__(676), + SetScrollFactorX: __webpack_require__(677), + SetScrollFactorY: __webpack_require__(678), + SetTint: __webpack_require__(679), + SetVisible: __webpack_require__(680), + SetX: __webpack_require__(681), + SetXY: __webpack_require__(682), + SetY: __webpack_require__(683), + ShiftPosition: __webpack_require__(684), + Shuffle: __webpack_require__(685), + SmootherStep: __webpack_require__(686), + SmoothStep: __webpack_require__(687), + Spread: __webpack_require__(688), + ToggleVisible: __webpack_require__(689), + WrapInRectangle: __webpack_require__(690) }; /***/ }), -/* 253 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61048,22 +67362,22 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(108); +var ALIGN_CONST = __webpack_require__(120); var AlignToMap = []; -AlignToMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(254); -AlignToMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(255); -AlignToMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(256); -AlignToMap[ALIGN_CONST.LEFT_BOTTOM] = __webpack_require__(257); -AlignToMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(258); -AlignToMap[ALIGN_CONST.LEFT_TOP] = __webpack_require__(259); -AlignToMap[ALIGN_CONST.RIGHT_BOTTOM] = __webpack_require__(260); -AlignToMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(261); -AlignToMap[ALIGN_CONST.RIGHT_TOP] = __webpack_require__(262); -AlignToMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(263); -AlignToMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(264); -AlignToMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(265); +AlignToMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(269); +AlignToMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(270); +AlignToMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(271); +AlignToMap[ALIGN_CONST.LEFT_BOTTOM] = __webpack_require__(272); +AlignToMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(273); +AlignToMap[ALIGN_CONST.LEFT_TOP] = __webpack_require__(274); +AlignToMap[ALIGN_CONST.RIGHT_BOTTOM] = __webpack_require__(275); +AlignToMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(276); +AlignToMap[ALIGN_CONST.RIGHT_TOP] = __webpack_require__(277); +AlignToMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(278); +AlignToMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(279); +AlignToMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(280); /** * Takes a Game Object and aligns it next to another, at the given position. @@ -61076,7 +67390,7 @@ AlignToMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(265); * * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned. * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. - * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. + * @param {number} position - The position to align the Game Object with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * @@ -61091,7 +67405,7 @@ module.exports = QuickSet; /***/ }), -/* 254 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61100,10 +67414,10 @@ module.exports = QuickSet; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetCenterX = __webpack_require__(77); -var SetCenterX = __webpack_require__(78); -var SetTop = __webpack_require__(45); +var GetBottom = __webpack_require__(40); +var GetCenterX = __webpack_require__(83); +var SetCenterX = __webpack_require__(84); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom center position of the other. @@ -61135,7 +67449,7 @@ module.exports = BottomCenter; /***/ }), -/* 255 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61144,10 +67458,10 @@ module.exports = BottomCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var SetLeft = __webpack_require__(46); -var SetTop = __webpack_require__(45); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var SetLeft = __webpack_require__(52); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom left position of the other. @@ -61179,7 +67493,7 @@ module.exports = BottomLeft; /***/ }), -/* 256 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61188,10 +67502,10 @@ module.exports = BottomLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetRight = __webpack_require__(37); -var SetRight = __webpack_require__(47); -var SetTop = __webpack_require__(45); +var GetBottom = __webpack_require__(40); +var GetRight = __webpack_require__(42); +var SetRight = __webpack_require__(53); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the bottom right position of the other. @@ -61223,7 +67537,7 @@ module.exports = BottomRight; /***/ }), -/* 257 */ +/* 272 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61232,10 +67546,10 @@ module.exports = BottomRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var SetBottom = __webpack_require__(48); -var SetRight = __webpack_require__(47); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var SetBottom = __webpack_require__(54); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned next to the left bottom position of the other. @@ -61267,7 +67581,7 @@ module.exports = LeftBottom; /***/ }), -/* 258 */ +/* 273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61276,10 +67590,10 @@ module.exports = LeftBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetLeft = __webpack_require__(36); -var SetCenterY = __webpack_require__(80); -var SetRight = __webpack_require__(47); +var GetCenterY = __webpack_require__(85); +var GetLeft = __webpack_require__(41); +var SetCenterY = __webpack_require__(86); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned next to the left center position of the other. @@ -61311,7 +67625,7 @@ module.exports = LeftCenter; /***/ }), -/* 259 */ +/* 274 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61320,10 +67634,10 @@ module.exports = LeftCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLeft = __webpack_require__(36); -var GetTop = __webpack_require__(38); -var SetRight = __webpack_require__(47); -var SetTop = __webpack_require__(45); +var GetLeft = __webpack_require__(41); +var GetTop = __webpack_require__(43); +var SetRight = __webpack_require__(53); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the left top position of the other. @@ -61355,7 +67669,7 @@ module.exports = LeftTop; /***/ }), -/* 260 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61364,10 +67678,10 @@ module.exports = LeftTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetRight = __webpack_require__(37); -var SetBottom = __webpack_require__(48); -var SetLeft = __webpack_require__(46); +var GetBottom = __webpack_require__(40); +var GetRight = __webpack_require__(42); +var SetBottom = __webpack_require__(54); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. @@ -61399,7 +67713,7 @@ module.exports = RightBottom; /***/ }), -/* 261 */ +/* 276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61408,10 +67722,10 @@ module.exports = RightBottom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetRight = __webpack_require__(37); -var SetCenterY = __webpack_require__(80); -var SetLeft = __webpack_require__(46); +var GetCenterY = __webpack_require__(85); +var GetRight = __webpack_require__(42); +var SetCenterY = __webpack_require__(86); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned next to the right center position of the other. @@ -61443,7 +67757,7 @@ module.exports = RightCenter; /***/ }), -/* 262 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61452,10 +67766,10 @@ module.exports = RightCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); -var SetLeft = __webpack_require__(46); -var SetTop = __webpack_require__(45); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); +var SetLeft = __webpack_require__(52); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned next to the right top position of the other. @@ -61487,7 +67801,7 @@ module.exports = RightTop; /***/ }), -/* 263 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61496,10 +67810,10 @@ module.exports = RightTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(77); -var GetTop = __webpack_require__(38); -var SetBottom = __webpack_require__(48); -var SetCenterX = __webpack_require__(78); +var GetCenterX = __webpack_require__(83); +var GetTop = __webpack_require__(43); +var SetBottom = __webpack_require__(54); +var SetCenterX = __webpack_require__(84); /** * Takes given Game Object and aligns it so that it is positioned next to the top center position of the other. @@ -61531,7 +67845,7 @@ module.exports = TopCenter; /***/ }), -/* 264 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61540,10 +67854,10 @@ module.exports = TopCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLeft = __webpack_require__(36); -var GetTop = __webpack_require__(38); -var SetBottom = __webpack_require__(48); -var SetLeft = __webpack_require__(46); +var GetLeft = __webpack_require__(41); +var GetTop = __webpack_require__(43); +var SetBottom = __webpack_require__(54); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned next to the top left position of the other. @@ -61575,7 +67889,7 @@ module.exports = TopLeft; /***/ }), -/* 265 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61584,10 +67898,10 @@ module.exports = TopLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); -var SetBottom = __webpack_require__(48); -var SetRight = __webpack_require__(47); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); +var SetBottom = __webpack_require__(54); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned next to the top right position of the other. @@ -61619,7 +67933,7 @@ module.exports = TopRight; /***/ }), -/* 266 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61628,19 +67942,19 @@ module.exports = TopRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(108); +var ALIGN_CONST = __webpack_require__(120); var AlignInMap = []; -AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(267); -AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(268); -AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(269); -AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(270); -AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(272); -AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(273); -AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(274); -AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(275); -AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(276); +AlignInMap[ALIGN_CONST.BOTTOM_CENTER] = __webpack_require__(282); +AlignInMap[ALIGN_CONST.BOTTOM_LEFT] = __webpack_require__(283); +AlignInMap[ALIGN_CONST.BOTTOM_RIGHT] = __webpack_require__(284); +AlignInMap[ALIGN_CONST.CENTER] = __webpack_require__(285); +AlignInMap[ALIGN_CONST.LEFT_CENTER] = __webpack_require__(287); +AlignInMap[ALIGN_CONST.RIGHT_CENTER] = __webpack_require__(288); +AlignInMap[ALIGN_CONST.TOP_CENTER] = __webpack_require__(289); +AlignInMap[ALIGN_CONST.TOP_LEFT] = __webpack_require__(290); +AlignInMap[ALIGN_CONST.TOP_RIGHT] = __webpack_require__(291); AlignInMap[ALIGN_CONST.LEFT_BOTTOM] = AlignInMap[ALIGN_CONST.BOTTOM_LEFT]; AlignInMap[ALIGN_CONST.LEFT_TOP] = AlignInMap[ALIGN_CONST.TOP_LEFT]; AlignInMap[ALIGN_CONST.RIGHT_BOTTOM] = AlignInMap[ALIGN_CONST.BOTTOM_RIGHT]; @@ -61657,7 +67971,7 @@ AlignInMap[ALIGN_CONST.RIGHT_TOP] = AlignInMap[ALIGN_CONST.TOP_RIGHT]; * * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned. * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. - * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. + * @param {number} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * @@ -61672,7 +67986,7 @@ module.exports = QuickSet; /***/ }), -/* 267 */ +/* 282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61681,10 +67995,10 @@ module.exports = QuickSet; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetCenterX = __webpack_require__(77); -var SetBottom = __webpack_require__(48); -var SetCenterX = __webpack_require__(78); +var GetBottom = __webpack_require__(40); +var GetCenterX = __webpack_require__(83); +var SetBottom = __webpack_require__(54); +var SetCenterX = __webpack_require__(84); /** * Takes given Game Object and aligns it so that it is positioned in the bottom center of the other. @@ -61716,7 +68030,7 @@ module.exports = BottomCenter; /***/ }), -/* 268 */ +/* 283 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61725,10 +68039,10 @@ module.exports = BottomCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var SetBottom = __webpack_require__(48); -var SetLeft = __webpack_require__(46); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var SetBottom = __webpack_require__(54); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned in the bottom left of the other. @@ -61760,7 +68074,7 @@ module.exports = BottomLeft; /***/ }), -/* 269 */ +/* 284 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61769,10 +68083,10 @@ module.exports = BottomLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetRight = __webpack_require__(37); -var SetBottom = __webpack_require__(48); -var SetRight = __webpack_require__(47); +var GetBottom = __webpack_require__(40); +var GetRight = __webpack_require__(42); +var SetBottom = __webpack_require__(54); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned in the bottom right of the other. @@ -61804,7 +68118,7 @@ module.exports = BottomRight; /***/ }), -/* 270 */ +/* 285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61813,9 +68127,9 @@ module.exports = BottomRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(271); -var GetCenterX = __webpack_require__(77); -var GetCenterY = __webpack_require__(79); +var CenterOn = __webpack_require__(286); +var GetCenterX = __webpack_require__(83); +var GetCenterY = __webpack_require__(85); /** * Takes given Game Object and aligns it so that it is positioned in the center of the other. @@ -61846,7 +68160,7 @@ module.exports = Center; /***/ }), -/* 271 */ +/* 286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61855,8 +68169,8 @@ module.exports = Center; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetCenterX = __webpack_require__(78); -var SetCenterY = __webpack_require__(80); +var SetCenterX = __webpack_require__(84); +var SetCenterY = __webpack_require__(86); /** * Positions the Game Object so that it is centered on the given coordinates. @@ -61883,7 +68197,7 @@ module.exports = CenterOn; /***/ }), -/* 272 */ +/* 287 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61892,10 +68206,10 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetLeft = __webpack_require__(36); -var SetCenterY = __webpack_require__(80); -var SetLeft = __webpack_require__(46); +var GetCenterY = __webpack_require__(85); +var GetLeft = __webpack_require__(41); +var SetCenterY = __webpack_require__(86); +var SetLeft = __webpack_require__(52); /** * Takes given Game Object and aligns it so that it is positioned in the left center of the other. @@ -61927,7 +68241,7 @@ module.exports = LeftCenter; /***/ }), -/* 273 */ +/* 288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61936,10 +68250,10 @@ module.exports = LeftCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterY = __webpack_require__(79); -var GetRight = __webpack_require__(37); -var SetCenterY = __webpack_require__(80); -var SetRight = __webpack_require__(47); +var GetCenterY = __webpack_require__(85); +var GetRight = __webpack_require__(42); +var SetCenterY = __webpack_require__(86); +var SetRight = __webpack_require__(53); /** * Takes given Game Object and aligns it so that it is positioned in the right center of the other. @@ -61971,7 +68285,7 @@ module.exports = RightCenter; /***/ }), -/* 274 */ +/* 289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -61980,10 +68294,10 @@ module.exports = RightCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetCenterX = __webpack_require__(77); -var GetTop = __webpack_require__(38); -var SetCenterX = __webpack_require__(78); -var SetTop = __webpack_require__(45); +var GetCenterX = __webpack_require__(83); +var GetTop = __webpack_require__(43); +var SetCenterX = __webpack_require__(84); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned in the top center of the other. @@ -62015,7 +68329,7 @@ module.exports = TopCenter; /***/ }), -/* 275 */ +/* 290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62024,10 +68338,10 @@ module.exports = TopCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLeft = __webpack_require__(36); -var GetTop = __webpack_require__(38); -var SetLeft = __webpack_require__(46); -var SetTop = __webpack_require__(45); +var GetLeft = __webpack_require__(41); +var GetTop = __webpack_require__(43); +var SetLeft = __webpack_require__(52); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned in the top left of the other. @@ -62059,7 +68373,7 @@ module.exports = TopLeft; /***/ }), -/* 276 */ +/* 291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62068,10 +68382,10 @@ module.exports = TopLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); -var SetRight = __webpack_require__(47); -var SetTop = __webpack_require__(45); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); +var SetRight = __webpack_require__(53); +var SetTop = __webpack_require__(51); /** * Takes given Game Object and aligns it so that it is positioned in the top right of the other. @@ -62103,7 +68417,7 @@ module.exports = TopRight; /***/ }), -/* 277 */ +/* 292 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62112,8 +68426,8 @@ module.exports = TopRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(159); -var FromPercent = __webpack_require__(89); +var CircumferencePoint = __webpack_require__(160); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); var Point = __webpack_require__(4); @@ -62146,7 +68460,7 @@ module.exports = GetPoint; /***/ }), -/* 278 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62155,9 +68469,9 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(279); -var CircumferencePoint = __webpack_require__(159); -var FromPercent = __webpack_require__(89); +var Circumference = __webpack_require__(294); +var CircumferencePoint = __webpack_require__(160); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); /** @@ -62168,7 +68482,7 @@ var MATH_CONST = __webpack_require__(13); * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -62198,7 +68512,7 @@ module.exports = GetPoints; /***/ }), -/* 279 */ +/* 294 */ /***/ (function(module, exports) { /** @@ -62226,7 +68540,7 @@ module.exports = Circumference; /***/ }), -/* 280 */ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62235,7 +68549,7 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -62336,7 +68650,7 @@ module.exports = AlphaSingle; /***/ }), -/* 281 */ +/* 296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62345,7 +68659,7 @@ module.exports = AlphaSingle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); +var BlendModes = __webpack_require__(48); /** * Provides methods used for setting the blend mode of a Game Object. @@ -62361,7 +68675,7 @@ var BlendMode = { * Private internal value. Holds the current blend mode. * * @name Phaser.GameObjects.Components.BlendMode#_blendMode - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -62458,7 +68772,7 @@ module.exports = BlendMode; /***/ }), -/* 282 */ +/* 297 */ /***/ (function(module, exports) { /** @@ -62470,7 +68784,7 @@ module.exports = BlendMode; /** * Provides methods used for setting the depth of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Depth * @since 3.0.0 */ @@ -62479,9 +68793,9 @@ var Depth = { /** * Private internal value. Holds the depth of the Game Object. - * + * * @name Phaser.GameObjects.Components.Depth#_depth - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -62490,7 +68804,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -62498,7 +68812,7 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @name Phaser.GameObjects.Components.Depth#depth * @type {number} * @since 3.0.0 @@ -62512,7 +68826,11 @@ var Depth = { set: function (value) { - this.scene.sys.queueDepthSort(); + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + this._depth = value; } @@ -62520,7 +68838,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -62528,12 +68846,12 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {integer} value - The depth of this Game Object. - * + * @param {number} value - The depth of this Game Object. + * * @return {this} This Game Object instance. */ setDepth: function (value) @@ -62551,7 +68869,7 @@ module.exports = Depth; /***/ }), -/* 283 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62560,8 +68878,8 @@ module.exports = Depth; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(161); -var Perimeter = __webpack_require__(118); +var GetPoint = __webpack_require__(162); +var Perimeter = __webpack_require__(126); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -62576,7 +68894,7 @@ var Perimeter = __webpack_require__(118); * * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. - * @param {integer} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. + * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. * * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. @@ -62605,7 +68923,7 @@ module.exports = GetPoints; /***/ }), -/* 284 */ +/* 299 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62644,7 +68962,7 @@ module.exports = GetPoint; /***/ }), -/* 285 */ +/* 300 */ /***/ (function(module, exports) { /** @@ -62688,7 +69006,7 @@ module.exports = RotateAround; /***/ }), -/* 286 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62697,8 +69015,8 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(287); -var GeometryMask = __webpack_require__(288); +var BitmapMask = __webpack_require__(302); +var GeometryMask = __webpack_require__(303); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -62725,10 +69043,10 @@ var Mask = { * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @@ -62774,6 +69092,8 @@ var Mask = { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -62784,7 +69104,7 @@ var Mask = { * * @method Phaser.GameObjects.Components.Mask#createBitmapMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. * * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. @@ -62808,12 +69128,12 @@ var Mask = { * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. @@ -62835,7 +69155,7 @@ module.exports = Mask; /***/ }), -/* 287 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -62845,7 +69165,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); /** * @classdesc @@ -62864,6 +69184,9 @@ var GameEvents = __webpack_require__(21); * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -62888,7 +69211,7 @@ var BitmapMask = new Class({ function BitmapMask (scene, renderable) { - var renderer = scene.sys.game.renderer; + var renderer = scene.sys.renderer; /** * A reference to either the Canvas or WebGL Renderer that this Mask is using. @@ -62956,19 +69279,11 @@ var BitmapMask = new Class({ */ this.maskFramebuffer = null; - /** - * The previous framebuffer set in the renderer before this one was enabled. - * - * @name Phaser.Display.Masks.BitmapMask#prevFramebuffer - * @type {WebGLFramebuffer} - * @since 3.17.0 - */ - this.prevFramebuffer = null; - /** * Whether to invert the masks alpha. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. * * @name Phaser.Display.Masks.BitmapMask#invertAlpha * @type {boolean} @@ -62986,36 +69301,73 @@ var BitmapMask = new Class({ */ this.isStencil = false; - if (renderer && renderer.gl) + this.createMask(); + + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + }, + + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + * + * @method Phaser.Display.Masks.BitmapMask#createMask + * @since 3.50.0 + */ + createMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl) { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) - { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - }, this); + return; } + + if (this.mainTexture) + { + this.clearMask(); + } + + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + }, + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + * + * @method Phaser.Display.Masks.BitmapMask#clearMask + * @since 3.50.0 + */ + clearMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl || !this.mainTexture) + { + return; + } + + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; }, /** @@ -63102,22 +69454,9 @@ var BitmapMask = new Class({ */ destroy: function () { + this.clearMask(); + this.bitmapMask = null; - - var renderer = this.renderer; - - if (renderer && renderer.gl) - { - renderer.deleteTexture(this.mainTexture); - renderer.deleteTexture(this.maskTexture); - renderer.deleteFramebuffer(this.mainFramebuffer); - renderer.deleteFramebuffer(this.maskFramebuffer); - } - - this.mainTexture = null; - this.maskTexture = null; - this.mainFramebuffer = null; - this.maskFramebuffer = null; this.prevFramebuffer = null; this.renderer = null; } @@ -63128,7 +69467,7 @@ module.exports = BitmapMask; /***/ }), -/* 288 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63184,6 +69523,8 @@ var GeometryMask = new Class({ * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels * drawn to the Geometry Mask. * + * This is a WebGL only feature. + * * @name Phaser.Display.Masks.GeometryMask#invertAlpha * @type {boolean} * @since 3.16.0 @@ -63218,7 +69559,7 @@ var GeometryMask = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. - * + * * @return {this} This Geometry Mask */ setShape: function (graphicsGeometry) @@ -63230,13 +69571,16 @@ var GeometryMask = new Class({ /** * Sets the `invertAlpha` property of this Geometry Mask. + * * Inverting the alpha essentially flips the way the mask works. * + * This is a WebGL only feature. + * * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha * @since 3.17.0 * * @param {boolean} [value=true] - Invert the alpha of this mask? - * + * * @return {this} This Geometry Mask */ setInvertAlpha: function (value) @@ -63315,7 +69659,7 @@ var GeometryMask = new Class({ } // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + geometryMask.renderWebGL(renderer, geometryMask, camera); renderer.flush(); @@ -63359,32 +69703,32 @@ var GeometryMask = new Class({ renderer.maskCount--; + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + if (renderer.maskStack.length === 0) { // If this is the only mask in the stack, flush and disable - renderer.flush(); - - renderer.currentMask.mask = null; + current.mask = null; gl.disable(gl.STENCIL_TEST); } else { - // Force flush before disabling stencil test - renderer.flush(); - var prev = renderer.maskStack[renderer.maskStack.length - 1]; prev.mask.applyStencil(renderer, prev.camera, false); if (renderer.currentCameraMask.mask !== prev.mask) { - renderer.currentMask.mask = prev.mask; - renderer.currentMask.camera = prev.camera; + current.mask = prev.mask; + current.camera = prev.camera; } else { - renderer.currentMask.mask = null; + current.mask = null; } } }, @@ -63405,7 +69749,7 @@ var GeometryMask = new Class({ renderer.currentContext.save(); - geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); renderer.currentContext.clip(); }, @@ -63443,7 +69787,7 @@ module.exports = GeometryMask; /***/ }), -/* 289 */ +/* 304 */ /***/ (function(module, exports) { /** @@ -63550,68 +69894,7 @@ module.exports = ScrollFactor; /***/ }), -/* 290 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Build a JSON representation of the given Game Object. - * - * This is typically extended further by Game Object specific implementations. - * - * @method Phaser.GameObjects.Components.ToJSON - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON. - * - * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. - */ -var ToJSON = function (gameObject) -{ - var out = { - name: gameObject.name, - type: gameObject.type, - x: gameObject.x, - y: gameObject.y, - depth: gameObject.depth, - scale: { - x: gameObject.scaleX, - y: gameObject.scaleY - }, - origin: { - x: gameObject.originX, - y: gameObject.originY - }, - flipX: gameObject.flipX, - flipY: gameObject.flipY, - rotation: gameObject.rotation, - alpha: gameObject.alpha, - visible: gameObject.visible, - blendMode: gameObject.blendMode, - textureKey: '', - frameKey: '', - data: {} - }; - - if (gameObject.texture) - { - out.textureKey = gameObject.texture.key; - out.frameKey = gameObject.frame.name; - } - - return out; -}; - -module.exports = ToJSON; - - -/***/ }), -/* 291 */ +/* 305 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -63621,10 +69904,10 @@ module.exports = ToJSON; */ var MATH_CONST = __webpack_require__(13); -var TransformMatrix = __webpack_require__(31); -var TransformXY = __webpack_require__(166); -var WrapAngle = __webpack_require__(248); -var WrapAngleDegrees = __webpack_require__(249); +var TransformMatrix = __webpack_require__(24); +var TransformXY = __webpack_require__(169); +var WrapAngle = __webpack_require__(261); +var WrapAngleDegrees = __webpack_require__(262); var Vector2 = __webpack_require__(3); // global bitmask flag for GameObject.renderMask (used by Scale) @@ -63822,7 +70105,7 @@ var Transform = { * If you prefer to work in radians, see the `rotation` property instead. * * @name Phaser.GameObjects.Components.Transform#angle - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -63895,6 +70178,26 @@ var Transform = { return this; }, + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -64202,7 +70505,7 @@ module.exports = Transform; /***/ }), -/* 292 */ +/* 306 */ /***/ (function(module, exports) { /** @@ -64291,7 +70594,7 @@ module.exports = Visible; /***/ }), -/* 293 */ +/* 307 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64306,16 +70609,17 @@ module.exports = Visible; module.exports = { - CHANGE_DATA: __webpack_require__(589), - CHANGE_DATA_KEY: __webpack_require__(590), - REMOVE_DATA: __webpack_require__(591), - SET_DATA: __webpack_require__(592) + CHANGE_DATA: __webpack_require__(628), + CHANGE_DATA_KEY: __webpack_require__(629), + DESTROY: __webpack_require__(630), + REMOVE_DATA: __webpack_require__(631), + SET_DATA: __webpack_require__(632) }; /***/ }), -/* 294 */ +/* 308 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64324,7 +70628,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Perimeter = __webpack_require__(118); +var Perimeter = __webpack_require__(126); var Point = __webpack_require__(4); @@ -64339,7 +70643,7 @@ var Point = __webpack_require__(4); * * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the perimeter points from. * @param {number} [step] - The distance between each point of the perimeter. Set to `null` if you wish to use the `quantity` parameter instead. - * @param {integer} [quantity] - The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value. + * @param {number} [quantity] - The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value. * @param {(array|Phaser.Geom.Point[])} [out] - An array in which the perimeter points will be stored. If not given, a new array instance is created. * * @return {(array|Phaser.Geom.Point[])} An array containing the perimeter points from the Rectangle. @@ -64434,87 +70738,7 @@ module.exports = MarchingAnts; /***/ }), -/* 295 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 297 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -64532,7 +70756,7 @@ module.exports = RotateRight; * @since 3.0.0 * * @param {Phaser.Geom.Line} line - The line. - * @param {integer} [stepRate=1] - The optional step rate for the points on the line. + * @param {number} [stepRate=1] - The optional step rate for the points on the line. * @param {Phaser.Types.Math.Vector2Like[]} [results] - An optional array to push the resulting coordinates into. * * @return {Phaser.Types.Math.Vector2Like[]} The array of coordinates on the line. @@ -64588,7 +70812,7 @@ module.exports = BresenhamPoints; /***/ }), -/* 298 */ +/* 310 */ /***/ (function(module, exports) { /** @@ -64672,7 +70896,7 @@ module.exports = FindClosestInSorted; /***/ }), -/* 299 */ +/* 311 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64698,16 +70922,19 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. - * @param {integer} index - The index of this AnimationFrame within the Animation sequence. + * @param {(string|number)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. + * @param {number} index - The index of this AnimationFrame within the Animation sequence. * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. + * @param {boolean} [isKeyFrame=false] - Is this Frame a Keyframe within the Animation? */ var AnimationFrame = new Class({ initialize: - function AnimationFrame (textureKey, textureFrame, index, frame) + function AnimationFrame (textureKey, textureFrame, index, frame, isKeyFrame) { + if (isKeyFrame === undefined) { isKeyFrame = false; } + /** * The key of the Texture this AnimationFrame uses. * @@ -64721,7 +70948,7 @@ var AnimationFrame = new Class({ * The key of the Frame within the Texture that this AnimationFrame uses. * * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {(string|integer)} + * @type {(string|number)} * @since 3.0.0 */ this.textureFrame = textureFrame; @@ -64730,7 +70957,7 @@ var AnimationFrame = new Class({ * The index of this AnimationFrame within the Animation sequence. * * @name Phaser.Animations.AnimationFrame#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -64810,6 +71037,15 @@ var AnimationFrame = new Class({ * @since 3.0.0 */ this.progress = 0; + + /** + * Is this Frame a KeyFrame within the Animation? + * + * @name Phaser.Animations.AnimationFrame#isKeyFrame + * @type {boolean} + * @since 3.50.0 + */ + this.isKeyFrame = isKeyFrame; }, /** @@ -64825,7 +71061,8 @@ var AnimationFrame = new Class({ return { key: this.textureKey, frame: this.textureFrame, - duration: this.duration + duration: this.duration, + keyframe: this.isKeyFrame }; }, @@ -64846,7 +71083,7 @@ module.exports = AnimationFrame; /***/ }), -/* 300 */ +/* 312 */ /***/ (function(module, exports) { /** @@ -64884,7 +71121,7 @@ module.exports = SortByDigits; /***/ }), -/* 301 */ +/* 313 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -64893,16 +71130,16 @@ module.exports = SortByDigits; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Animation = __webpack_require__(172); +var Animation = __webpack_require__(177); var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(122); -var GameEvents = __webpack_require__(21); +var CustomMap = __webpack_require__(98); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(128); +var GameEvents = __webpack_require__(23); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); -var Pad = __webpack_require__(173); -var NumberArray = __webpack_require__(302); +var Pad = __webpack_require__(178); +var NumberArray = __webpack_require__(314); /** * @classdesc @@ -64982,7 +71219,7 @@ var AnimationManager = new Class({ * See the {@link #setMix} method for more details. * * @name Phaser.Animations.AnimationManager#mixes - * @type {Phaser.Structs.Map.} + * @type {Phaser.Structs.Map.} * @since 3.50.0 */ this.mixes = new CustomMap(); @@ -65243,17 +71480,17 @@ var AnimationManager = new Class({ * * This was tested with Aseprite 1.2.25. * - * This will export a png and json file which you can load using the Atlas Loader, i.e.: + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: * * ```javascript * function preload () * { * this.load.path = 'assets/animations/aseprite/'; - * this.load.atlas('paladin', 'paladin.png', 'paladin.json'); + * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); * } * ``` * - * Once exported, you can call this method from within a Scene with the 'atlas' key: + * Once loaded, you can call this method from within a Scene with the 'atlas' key: * * ```javascript * this.anims.createFromAseprite('paladin'); @@ -65572,6 +71809,36 @@ var AnimationManager = new Class({ * * If you're working with a texture atlas, see the `generateFrameNames` method instead. * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * * @method Phaser.Animations.AnimationManager#generateFrameNumbers * @since 3.0.0 * @@ -65863,7 +72130,7 @@ module.exports = AnimationManager; /***/ }), -/* 302 */ +/* 314 */ /***/ (function(module, exports) { /** @@ -65956,7 +72223,7 @@ module.exports = NumberArray; /***/ }), -/* 303 */ +/* 315 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -65966,9 +72233,9 @@ module.exports = NumberArray; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(304); +var CustomMap = __webpack_require__(98); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(316); /** * @classdesc @@ -66142,7 +72409,7 @@ module.exports = BaseCache; /***/ }), -/* 304 */ +/* 316 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -66157,14 +72424,14 @@ module.exports = BaseCache; module.exports = { - ADD: __webpack_require__(664), - REMOVE: __webpack_require__(665) + ADD: __webpack_require__(704), + REMOVE: __webpack_require__(705) }; /***/ }), -/* 305 */ +/* 317 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -66173,9 +72440,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCache = __webpack_require__(303); +var BaseCache = __webpack_require__(315); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); /** * @classdesc @@ -66398,7 +72665,7 @@ module.exports = CacheManager; /***/ }), -/* 306 */ +/* 318 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -66407,14 +72674,14 @@ module.exports = CacheManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(93); -var CanvasPool = __webpack_require__(26); -var CenterOn = __webpack_require__(178); -var Clamp = __webpack_require__(17); +var BaseCamera = __webpack_require__(99); +var CenterOn = __webpack_require__(182); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Effects = __webpack_require__(314); -var Linear = __webpack_require__(124); +var Effects = __webpack_require__(325); +var Events = __webpack_require__(35); +var Linear = __webpack_require__(130); var Rectangle = __webpack_require__(9); var Vector2 = __webpack_require__(3); @@ -66449,6 +72716,7 @@ var Vector2 = __webpack_require__(3); * @extends Phaser.Cameras.Scene2D.BaseCamera * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Pipeline * * @param {number} x - The x position of the Camera, relative to the top-left of the game canvas. * @param {number} y - The y position of the Camera, relative to the top-left of the game canvas. @@ -66461,7 +72729,8 @@ var Camera = new Class({ Mixins: [ Components.Flip, - Components.Tint + Components.Tint, + Components.Pipeline ], initialize: @@ -66470,6 +72739,9 @@ var Camera = new Class({ { BaseCamera.call(this, x, y, width, height); + this.postPipelines = []; + this.pipelineData = {}; + /** * Does this Camera allow the Game Objects it renders to receive input events? * @@ -66604,268 +72876,6 @@ var Camera = new Class({ * @since 3.0.0 */ this._follow = null; - - /** - * Is this Camera rendering directly to the canvas or to a texture? - * - * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) - * - * Once enabled you can toggle it by switching this property. - * - * To properly remove a render texture you should call the `clearRenderToTexture()` method. - * - * @name Phaser.Cameras.Scene2D.Camera#renderToTexture - * @type {boolean} - * @default false - * @since 3.13.0 - */ - this.renderToTexture = false; - - /** - * If this Camera is rendering to a texture (via `setRenderToTexture`) then you - * have the option to control if it should also render to the Game canvas as well. - * - * By default, a Camera will render both to its texture and to the Game canvas. - * - * However, if you set ths property to `false` it will only render to the texture - * and skip rendering to the Game canvas. - * - * Setting this property if the Camera isn't rendering to a texture has no effect. - * - * @name Phaser.Cameras.Scene2D.Camera#renderToGame - * @type {boolean} - * @default true - * @since 3.23.0 - */ - this.renderToGame = true; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the HTML Canvas Element that the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#canvas - * @type {HTMLCanvasElement} - * @since 3.13.0 - */ - this.canvas = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the Rendering Context belonging to the Canvas element the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#context - * @type {CanvasRenderingContext2D} - * @since 3.13.0 - */ - this.context = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Texture belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#glTexture - * @type {?WebGLTexture} - * @since 3.13.0 - */ - this.glTexture = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Frame Buffer belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#framebuffer - * @type {?WebGLFramebuffer} - * @since 3.13.0 - */ - this.framebuffer = null; - - /** - * If this Camera has been set to render to a texture and to use a custom pipeline, - * then this holds a reference to the pipeline the Camera is drawing with. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#pipeline - * @type {?Phaser.Renderer.WebGL.WebGLPipeline} - * @since 3.13.0 - */ - this.pipeline = null; - }, - - /** - * Sets the Camera to render to a texture instead of to the main canvas. - * - * The Camera will redirect all Game Objects it's asked to render to this texture. - * - * During the render sequence, the texture itself will then be rendered to the main canvas. - * - * Doing this gives you the ability to modify the texture before this happens, - * allowing for special effects such as Camera specific shaders, or post-processing - * on the texture. - * - * If running under Canvas the Camera will render to its `canvas` property. - * - * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. - * - * If you set a camera to render to a texture then it will emit 2 events during the render loop: - * - * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. - * - * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the - * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before - * it appears in-game. - * - * You should not enable this unless you plan on actually using the texture it creates - * somehow, otherwise you're just doubling the work required to render your game. - * - * If you only require the Camera to render to a texture, and not also to the Game, - * them set the `renderToGame` parameter to `false`. - * - * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. - * - * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, - * which will delete the respective textures and free-up resources. - * - * @method Phaser.Cameras.Scene2D.Camera#setRenderToTexture - * @since 3.13.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. - * @param {boolean} [renderToGame=true] - If you do not need the Camera to still render to the Game, set this parameter to `false`. - * - * @return {this} This Camera instance. - */ - setRenderToTexture: function (pipeline, renderToGame) - { - if (renderToGame === undefined) { renderToGame = true; } - - var renderer = this.scene.sys.game.renderer; - - if (renderer.gl) - { - this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, 0); - this.framebuffer = renderer.createFramebuffer(this.width, this.height, this.glTexture, false); - } - else - { - this.canvas = CanvasPool.create2D(this, this.width, this.height); - this.context = this.canvas.getContext('2d'); - } - - this.renderToTexture = true; - this.renderToGame = renderToGame; - - if (pipeline) - { - this.setPipeline(pipeline); - } - - return this; - }, - - /** - * Sets the WebGL pipeline this Camera is using when rendering to a texture. - * - * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. - * - * Call this method with no arguments to clear any previously set pipeline. - * - * @method Phaser.Cameras.Scene2D.Camera#setPipeline - * @since 3.13.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline. - * - * @return {this} This Camera instance. - */ - setPipeline: function (pipeline) - { - if (typeof pipeline === 'string') - { - var renderer = this.scene.sys.game.renderer; - - if (renderer.gl && renderer.pipelines.has(pipeline)) - { - this.pipeline = renderer.pipelines.get(pipeline); - } - } - else - { - this.pipeline = pipeline; - } - - return this; - }, - - /** - * If this Camera was set to render to a texture, this will clear the resources it was using and - * redirect it to render back to the primary Canvas again. - * - * If you only wish to temporarily disable rendering to a texture then you can toggle the - * property `renderToTexture` instead. - * - * @method Phaser.Cameras.Scene2D.Camera#clearRenderToTexture - * @since 3.13.0 - * - * @return {this} This Camera instance. - */ - clearRenderToTexture: function () - { - if (!this.scene) - { - return; - } - - var renderer = this.scene.sys.game.renderer; - - if (!renderer) - { - return; - } - - if (renderer.gl) - { - if (this.framebuffer) - { - renderer.deleteFramebuffer(this.framebuffer); - } - - if (this.glTexture) - { - renderer.deleteTexture(this.glTexture); - } - - this.framebuffer = null; - this.glTexture = null; - this.pipeline = null; - } - else - { - CanvasPool.remove(this); - - this.canvas = null; - this.context = null; - } - - this.renderToTexture = false; - - return this; }, /** @@ -66938,10 +72948,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE * @since 3.3.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. @@ -66962,10 +72972,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE * @since 3.3.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. @@ -66985,10 +72995,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -67009,10 +73019,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -67033,10 +73043,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=250] - The duration of the effect in milliseconds. - * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=250] - The duration of the effect in milliseconds. + * @param {number} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -67057,7 +73067,7 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [duration=100] - The duration of the effect in milliseconds. * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -67082,7 +73092,7 @@ var Camera = new Class({ * * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -67106,7 +73116,7 @@ var Camera = new Class({ * * @param {number} radians - The destination angle in radians to rotate the Camera viewport to. If the angle is positive then the rotation is clockwise else anticlockwise * @param {boolean} [shortestPath=false] - If shortest path is set to true the camera will rotate in the quickest direction clockwise or anti-clockwise. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the rotation. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the rotation effect to start immediately, even if already running. * @param {CameraRotateCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -67130,7 +73140,7 @@ var Camera = new Class({ * @since 3.11.0 * * @param {number} zoom - The target Camera zoom value. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -67151,10 +73161,8 @@ var Camera = new Class({ * @method Phaser.Cameras.Scene2D.Camera#preRender * @protected * @since 3.0.0 - * - * @param {number} resolution - The game resolution, as set in the Scale Manager. */ - preRender: function (resolution) + preRender: function () { var width = this.width; var height = this.height; @@ -67162,7 +73170,7 @@ var Camera = new Class({ var halfWidth = width * 0.5; var halfHeight = height * 0.5; - var zoom = this.zoom * resolution; + var zoom = this.zoom; var matrix = this.matrix; var originX = width * this.originX; @@ -67179,6 +73187,8 @@ var Camera = new Class({ CenterOn(deadzone, this.midPoint.x, this.midPoint.y); } + var emitFollowEvent = false; + if (follow && !this.panEffect.isRunning) { var fx = (follow.x - this.followOffset.x); @@ -67209,6 +73219,8 @@ var Camera = new Class({ sx = Linear(sx, fx - originX, this.lerp.x); sy = Linear(sy, fy - originY, this.lerp.y); } + + emitFollowEvent = true; } if (this.useBounds) @@ -67221,6 +73233,9 @@ var Camera = new Class({ { originX = Math.round(originX); originY = Math.round(originY); + + sx = Math.round(sx); + sy = Math.round(sy); } // Values are in pixels and not impacted by zooming the Camera @@ -67237,17 +73252,26 @@ var Camera = new Class({ var displayWidth = width / zoom; var displayHeight = height / zoom; - this.worldView.setTo( - midX - (displayWidth / 2), - midY - (displayHeight / 2), - displayWidth, - displayHeight - ); + var vwx = midX - (displayWidth / 2); + var vwy = midY - (displayHeight / 2); + + if (this.roundPixels) + { + vwx = Math.round(vwx); + vwy = Math.round(vwy); + } + + this.worldView.setTo(vwx, vwy, displayWidth, displayHeight); matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); matrix.translate(-originX, -originY); this.shakeEffect.preRender(); + + if (emitFollowEvent) + { + this.emit(Events.FOLLOW_UPDATE, this, follow); + } }, /** @@ -67407,7 +73431,7 @@ var Camera = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -67435,8 +73459,6 @@ var Camera = new Class({ */ destroy: function () { - this.clearRenderToTexture(); - this.resetFX(); BaseCamera.prototype.destroy.call(this); @@ -67452,7 +73474,7 @@ module.exports = Camera; /***/ }), -/* 307 */ +/* 319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67461,7 +73483,7 @@ module.exports = Camera; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); /** * Converts a hex string into a Phaser Color object. @@ -67505,7 +73527,7 @@ module.exports = HexStringToColor; /***/ }), -/* 308 */ +/* 320 */ /***/ (function(module, exports) { /** @@ -67520,10 +73542,10 @@ module.exports = HexStringToColor; * @function Phaser.Display.Color.GetColor32 * @since 3.0.0 * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} alpha - The alpha color value. A number between 0 and 255. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} alpha - The alpha color value. A number between 0 and 255. * * @return {number} The combined color value. */ @@ -67536,7 +73558,7 @@ module.exports = GetColor32; /***/ }), -/* 309 */ +/* 321 */ /***/ (function(module, exports) { /** @@ -67554,9 +73576,9 @@ module.exports = GetColor32; * @function Phaser.Display.Color.RGBToHSV * @since 3.0.0 * - * @param {integer} r - The red color value. A number between 0 and 255. - * @param {integer} g - The green color value. A number between 0 and 255. - * @param {integer} b - The blue color value. A number between 0 and 255. + * @param {number} r - The red color value. A number between 0 and 255. + * @param {number} g - The green color value. A number between 0 and 255. + * @param {number} b - The blue color value. A number between 0 and 255. * @param {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} [out] - An object to store the color values in. If not given an HSV Color Object will be created. * * @return {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} An object with the properties `h`, `s` and `v` set. @@ -67616,7 +73638,7 @@ module.exports = RGBToHSV; /***/ }), -/* 310 */ +/* 322 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67625,8 +73647,8 @@ module.exports = RGBToHSV; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); -var IntegerToRGB = __webpack_require__(311); +var Color = __webpack_require__(36); +var IntegerToRGB = __webpack_require__(181); /** * Converts the given color value into an instance of a Color object. @@ -67634,7 +73656,7 @@ var IntegerToRGB = __webpack_require__(311); * @function Phaser.Display.Color.IntegerToColor * @since 3.0.0 * - * @param {integer} input - The color value to convert into a Color object. + * @param {number} input - The color value to convert into a Color object. * * @return {Phaser.Display.Color} A Color object. */ @@ -67649,55 +73671,7 @@ module.exports = IntegerToColor; /***/ }), -/* 311 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Return the component parts of a color as an Object with the properties alpha, red, green, blue. - * - * Alpha will only be set if it exists in the given color (0xAARRGGBB) - * - * @function Phaser.Display.Color.IntegerToRGB - * @since 3.0.0 - * - * @param {integer} input - The color value to convert into a Color object. - * - * @return {Phaser.Types.Display.ColorObject} An object with the red, green and blue values set in the r, g and b properties. - */ -var IntegerToRGB = function (color) -{ - if (color > 16777215) - { - // The color value has an alpha component - return { - a: color >>> 24, - r: color >> 16 & 0xFF, - g: color >> 8 & 0xFF, - b: color & 0xFF - }; - } - else - { - return { - a: 255, - r: color >> 16 & 0xFF, - g: color >> 8 & 0xFF, - b: color & 0xFF - }; - } -}; - -module.exports = IntegerToRGB; - - -/***/ }), -/* 312 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67706,7 +73680,7 @@ module.exports = IntegerToRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); /** * Converts an object containing `r`, `g`, `b` and `a` properties into a Color class instance. @@ -67727,7 +73701,7 @@ module.exports = ObjectToColor; /***/ }), -/* 313 */ +/* 324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67736,7 +73710,7 @@ module.exports = ObjectToColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); /** * Converts a CSS 'web' string into a Phaser Color object. @@ -67773,7 +73747,7 @@ module.exports = RGBStringToColor; /***/ }), -/* 314 */ +/* 325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67788,255 +73762,12 @@ module.exports = RGBStringToColor; module.exports = { - Fade: __webpack_require__(688), - Flash: __webpack_require__(689), - Pan: __webpack_require__(690), - Shake: __webpack_require__(723), - RotateTo: __webpack_require__(724), - Zoom: __webpack_require__(725) - -}; - - -/***/ }), -/* 315 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Back - */ - -module.exports = { - - In: __webpack_require__(691), - Out: __webpack_require__(692), - InOut: __webpack_require__(693) - -}; - - -/***/ }), -/* 316 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Bounce - */ - -module.exports = { - - In: __webpack_require__(694), - Out: __webpack_require__(695), - InOut: __webpack_require__(696) - -}; - - -/***/ }), -/* 317 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Circular - */ - -module.exports = { - - In: __webpack_require__(697), - Out: __webpack_require__(698), - InOut: __webpack_require__(699) - -}; - - -/***/ }), -/* 318 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Cubic - */ - -module.exports = { - - In: __webpack_require__(700), - Out: __webpack_require__(701), - InOut: __webpack_require__(702) - -}; - - -/***/ }), -/* 319 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Elastic - */ - -module.exports = { - - In: __webpack_require__(703), - Out: __webpack_require__(704), - InOut: __webpack_require__(705) - -}; - - -/***/ }), -/* 320 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Expo - */ - -module.exports = { - - In: __webpack_require__(706), - Out: __webpack_require__(707), - InOut: __webpack_require__(708) - -}; - - -/***/ }), -/* 321 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -module.exports = __webpack_require__(709); - - -/***/ }), -/* 322 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quadratic - */ - -module.exports = { - - In: __webpack_require__(710), - Out: __webpack_require__(711), - InOut: __webpack_require__(712) - -}; - - -/***/ }), -/* 323 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quartic - */ - -module.exports = { - - In: __webpack_require__(713), - Out: __webpack_require__(714), - InOut: __webpack_require__(715) - -}; - - -/***/ }), -/* 324 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Quintic - */ - -module.exports = { - - In: __webpack_require__(716), - Out: __webpack_require__(717), - InOut: __webpack_require__(718) - -}; - - -/***/ }), -/* 325 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Math.Easing.Sine - */ - -module.exports = { - - In: __webpack_require__(719), - Out: __webpack_require__(720), - InOut: __webpack_require__(721) + Fade: __webpack_require__(729), + Flash: __webpack_require__(730), + Pan: __webpack_require__(731), + Shake: __webpack_require__(764), + RotateTo: __webpack_require__(765), + Zoom: __webpack_require__(766) }; @@ -68052,16 +73783,259 @@ module.exports = { */ /** - * @namespace Phaser.Math.Easing.Stepped + * @namespace Phaser.Math.Easing.Back */ -module.exports = __webpack_require__(722); +module.exports = { + + In: __webpack_require__(732), + Out: __webpack_require__(733), + InOut: __webpack_require__(734) + +}; /***/ }), /* 327 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Bounce + */ + +module.exports = { + + In: __webpack_require__(735), + Out: __webpack_require__(736), + InOut: __webpack_require__(737) + +}; + + +/***/ }), +/* 328 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Circular + */ + +module.exports = { + + In: __webpack_require__(738), + Out: __webpack_require__(739), + InOut: __webpack_require__(740) + +}; + + +/***/ }), +/* 329 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Cubic + */ + +module.exports = { + + In: __webpack_require__(741), + Out: __webpack_require__(742), + InOut: __webpack_require__(743) + +}; + + +/***/ }), +/* 330 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Elastic + */ + +module.exports = { + + In: __webpack_require__(744), + Out: __webpack_require__(745), + InOut: __webpack_require__(746) + +}; + + +/***/ }), +/* 331 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Expo + */ + +module.exports = { + + In: __webpack_require__(747), + Out: __webpack_require__(748), + InOut: __webpack_require__(749) + +}; + + +/***/ }), +/* 332 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +module.exports = __webpack_require__(750); + + +/***/ }), +/* 333 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quadratic + */ + +module.exports = { + + In: __webpack_require__(751), + Out: __webpack_require__(752), + InOut: __webpack_require__(753) + +}; + + +/***/ }), +/* 334 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quartic + */ + +module.exports = { + + In: __webpack_require__(754), + Out: __webpack_require__(755), + InOut: __webpack_require__(756) + +}; + + +/***/ }), +/* 335 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Quintic + */ + +module.exports = { + + In: __webpack_require__(757), + Out: __webpack_require__(758), + InOut: __webpack_require__(759) + +}; + + +/***/ }), +/* 336 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Sine + */ + +module.exports = { + + In: __webpack_require__(760), + Out: __webpack_require__(761), + InOut: __webpack_require__(762) + +}; + + +/***/ }), +/* 337 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Math.Easing.Stepped + */ + +module.exports = __webpack_require__(763); + + +/***/ }), +/* 338 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -68069,15 +74043,15 @@ module.exports = __webpack_require__(722); */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(34); -var Device = __webpack_require__(328); +var CONST = __webpack_require__(39); +var Device = __webpack_require__(339); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); var IsPlainObject = __webpack_require__(7); -var PhaserMath = __webpack_require__(180); +var PhaserMath = __webpack_require__(185); var NOOP = __webpack_require__(1); -var DefaultPlugins = __webpack_require__(184); -var ValueToColor = __webpack_require__(174); +var DefaultPlugins = __webpack_require__(189); +var ValueToColor = __webpack_require__(179); /** * @classdesc @@ -68111,25 +74085,20 @@ var Config = new Class({ var defaultBannerTextColor = '#ffffff'; /** - * @const {(integer|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. + * @const {(number|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. */ this.width = GetValue(config, 'width', 1024); /** - * @const {(integer|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. + * @const {(number|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. */ this.height = GetValue(config, 'height', 768); /** - * @const {(Phaser.Scale.ZoomType|integer)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. + * @const {(Phaser.Scale.ZoomType|number)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. */ this.zoom = GetValue(config, 'zoom', 1); - /** - * @const {number} Phaser.Core.Config#resolution - The canvas device pixel resolution. Currently un-used. - */ - this.resolution = GetValue(config, 'resolution', 1); - /** * @const {?*} Phaser.Core.Config#parent - A parent DOM element into which the canvas created by the renderer will be injected. */ @@ -68146,7 +74115,7 @@ var Config = new Class({ this.expandParent = GetValue(config, 'expandParent', true); /** - * @const {integer} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + * @const {number} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. */ this.autoRound = GetValue(config, 'autoRound', false); @@ -68156,7 +74125,7 @@ var Config = new Class({ this.autoCenter = GetValue(config, 'autoCenter', 0); /** - * @const {integer} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? + * @const {number} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? */ this.resizeInterval = GetValue(config, 'resizeInterval', 500); @@ -68166,22 +74135,22 @@ var Config = new Class({ this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null); /** - * @const {integer} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. + * @const {number} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. */ this.minWidth = GetValue(config, 'minWidth', 0); /** - * @const {integer} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. + * @const {number} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. */ this.maxWidth = GetValue(config, 'maxWidth', 0); /** - * @const {integer} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. + * @const {number} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. */ this.minHeight = GetValue(config, 'minHeight', 0); /** - * @const {integer} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. + * @const {number} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. */ this.maxHeight = GetValue(config, 'maxHeight', 0); @@ -68194,7 +74163,6 @@ var Config = new Class({ this.width = GetValue(scaleConfig, 'width', this.width); this.height = GetValue(scaleConfig, 'height', this.height); this.zoom = GetValue(scaleConfig, 'zoom', this.zoom); - this.resolution = GetValue(scaleConfig, 'resolution', this.resolution); this.parent = GetValue(scaleConfig, 'parent', this.parent); this.scaleMode = GetValue(scaleConfig, 'mode', this.scaleMode); this.expandParent = GetValue(scaleConfig, 'expandParent', this.expandParent); @@ -68290,7 +74258,7 @@ var Config = new Class({ this.inputKeyboardEventTarget = GetValue(config, 'input.keyboard.target', window); /** - * @const {?integer[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. + * @const {?number[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. */ this.inputKeyboardCapture = GetValue(config, 'input.keyboard.capture', []); @@ -68305,9 +74273,24 @@ var Config = new Class({ this.inputMouseEventTarget = GetValue(config, 'input.mouse.target', null); /** - * @const {boolean} Phaser.Core.Config#inputMouseCapture - Should mouse events be captured? I.e. have prevent default called on them. + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultDown - Should `mousedown` DOM events have `preventDefault` called on them? */ - this.inputMouseCapture = GetValue(config, 'input.mouse.capture', true); + this.inputMousePreventDefaultDown = GetValue(config, 'input.mouse.preventDefaultDown', true); + + /** + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultUp - Should `mouseup` DOM events have `preventDefault` called on them? + */ + this.inputMousePreventDefaultUp = GetValue(config, 'input.mouse.preventDefaultUp', true); + + /** + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultMove - Should `mousemove` DOM events have `preventDefault` called on them? + */ + this.inputMousePreventDefaultMove = GetValue(config, 'input.mouse.preventDefaultMove', true); + + /** + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultWheel - Should `wheel` DOM events have `preventDefault` called on them? + */ + this.inputMousePreventDefaultWheel = GetValue(config, 'input.mouse.preventDefaultWheel', true); /** * @const {boolean} Phaser.Core.Config#inputTouch - Enable the Touch Plugin. This can be disabled in games that don't need touch input. @@ -68325,12 +74308,12 @@ var Config = new Class({ this.inputTouchCapture = GetValue(config, 'input.touch.capture', true); /** - * @const {integer} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. + * @const {number} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. */ this.inputActivePointers = GetValue(config, 'input.activePointers', 1); /** - * @const {integer} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + * @const {number} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. */ this.inputSmoothFactor = GetValue(config, 'input.smoothFactor', 0); @@ -68357,7 +74340,7 @@ var Config = new Class({ /** * @const {Phaser.Types.Core.AudioConfig} Phaser.Core.Config#audio - The Audio Configuration object. */ - this.audio = GetValue(config, 'audio'); + this.audio = GetValue(config, 'audio', {}); // If you do: { banner: false } it won't display any banner at all @@ -68387,7 +74370,7 @@ var Config = new Class({ } /** - * @const {?Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class. + * @const {Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class. */ this.fps = GetValue(config, 'fps', null); @@ -68396,6 +74379,11 @@ var Config = new Class({ var renderConfig = GetValue(config, 'render', config); + /** + * @const {Phaser.Types.Core.PipelineConfig} Phaser.Core.Config#pipeline - An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances. + */ + this.pipeline = GetValue(renderConfig, 'pipeline', null); + /** * @const {boolean} Phaser.Core.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. */ @@ -68429,6 +74417,7 @@ var Config = new Class({ if (this.pixelArt) { this.antialias = false; + this.antialiasGL = false; this.roundPixels = true; } @@ -68458,17 +74447,17 @@ var Config = new Class({ this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default'); /** - * @const {integer} Phaser.Core.Config#batchSize - The default WebGL Batch size. + * @const {number} Phaser.Core.Config#batchSize - The default WebGL Batch size. Represents the number of _quads_ that can be added to a single batch. */ this.batchSize = GetValue(renderConfig, 'batchSize', 4096); /** - * @const {integer} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. + * @const {number} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. */ this.maxTextures = GetValue(renderConfig, 'maxTextures', -1); /** - * @const {integer} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + * @const {number} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ this.maxLights = GetValue(renderConfig, 'maxLights', 10); @@ -68479,8 +74468,9 @@ var Config = new Class({ */ this.backgroundColor = ValueToColor(bgc); - if (bgc === 0 && this.transparent) + if (this.transparent) { + this.backgroundColor = ValueToColor(0x000000); this.backgroundColor.alpha = 0; } @@ -68515,9 +74505,11 @@ var Config = new Class({ this.loaderPath = GetValue(config, 'loader.path', ''); /** - * @const {integer} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). + * @const {number} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ - this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', 32); + var defaultParallel = (Device.os.android) ? 6 : 32; + + this.loaderMaxParallelDownloads = GetValue(config, 'loader.maxParallelDownloads', defaultParallel); /** * @const {(string|undefined)} Phaser.Core.Config#loaderCrossOrigin - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. @@ -68545,7 +74537,7 @@ var Config = new Class({ this.loaderPassword = GetValue(config, 'loader.password', ''); /** - * @const {integer} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms. + * @const {number} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms. */ this.loaderTimeout = GetValue(config, 'loader.timeout', 0); @@ -68626,6 +74618,11 @@ var Config = new Class({ */ this.missingImage = GetValue(config, 'images.missing', pngPrefix + 'CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=='); + /** + * @const {string} Phaser.Core.Config#whiteImage - A base64 encoded PNG that will be used as the default texture when a texture is assigned that is white or not loaded. + */ + this.whiteImage = GetValue(config, 'images.white', 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC'); + if (window) { if (window.FORCE_WEBGL) @@ -68645,7 +74642,7 @@ module.exports = Config; /***/ }), -/* 328 */ +/* 339 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68679,20 +74676,20 @@ module.exports = Config; module.exports = { - os: __webpack_require__(125), - browser: __webpack_require__(126), - features: __webpack_require__(179), - input: __webpack_require__(756), - audio: __webpack_require__(757), - video: __webpack_require__(758), - fullscreen: __webpack_require__(759), - canvasFeatures: __webpack_require__(329) + os: __webpack_require__(102), + browser: __webpack_require__(131), + features: __webpack_require__(183), + input: __webpack_require__(797), + audio: __webpack_require__(798), + video: __webpack_require__(799), + fullscreen: __webpack_require__(800), + canvasFeatures: __webpack_require__(340) }; /***/ }), -/* 329 */ +/* 340 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -68701,7 +74698,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); /** * Determines the canvas features of the browser running this Phaser Game instance. @@ -68806,7 +74803,7 @@ module.exports = init(); /***/ }), -/* 330 */ +/* 341 */ /***/ (function(module, exports) { /** @@ -68837,7 +74834,7 @@ module.exports = Between; /***/ }), -/* 331 */ +/* 342 */ /***/ (function(module, exports) { /** @@ -68868,7 +74865,7 @@ module.exports = BetweenPoints; /***/ }), -/* 332 */ +/* 343 */ /***/ (function(module, exports) { /** @@ -68905,7 +74902,7 @@ module.exports = Normalize; /***/ }), -/* 333 */ +/* 344 */ /***/ (function(module, exports) { /** @@ -68937,7 +74934,7 @@ module.exports = DistanceBetweenPoints; /***/ }), -/* 334 */ +/* 345 */ /***/ (function(module, exports) { /** @@ -68971,7 +74968,7 @@ module.exports = DistanceSquared; /***/ }), -/* 335 */ +/* 346 */ /***/ (function(module, exports) { /** @@ -69005,7 +75002,7 @@ module.exports = GreaterThan; /***/ }), -/* 336 */ +/* 347 */ /***/ (function(module, exports) { /** @@ -69039,7 +75036,7 @@ module.exports = LessThan; /***/ }), -/* 337 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69048,7 +75045,7 @@ module.exports = LessThan; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Factorial = __webpack_require__(338); +var Factorial = __webpack_require__(349); /** * Calculates the Bernstein basis from the three factorial coefficients. @@ -69070,7 +75067,7 @@ module.exports = Bernstein; /***/ }), -/* 338 */ +/* 349 */ /***/ (function(module, exports) { /** @@ -69110,7 +75107,7 @@ module.exports = Factorial; /***/ }), -/* 339 */ +/* 350 */ /***/ (function(module, exports) { /** @@ -69180,7 +75177,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 340 */ +/* 351 */ /***/ (function(module, exports) { /** @@ -69239,7 +75236,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 341 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -69248,7 +75245,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(171); +var SmoothStep = __webpack_require__(176); /** * A Smooth Step interpolation method. @@ -69272,7 +75269,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 342 */ +/* 353 */ /***/ (function(module, exports) { /** @@ -69289,7 +75286,7 @@ module.exports = SmoothStepInterpolation; * * @param {number} value - The value. * - * @return {integer} The nearest power of 2 to `value`. + * @return {number} The nearest power of 2 to `value`. */ var GetPowerOfTwo = function (value) { @@ -69302,51 +75299,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 343 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Snap a value to nearest grid slice, using ceil. - * - * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`. - * As will `14` snap to `15`... but `16` will snap to `20`. - * - * @function Phaser.Math.Snap.Ceil - * @since 3.0.0 - * - * @param {number} value - The value to snap. - * @param {number} gap - The interval gap of the grid. - * @param {number} [start=0] - Optional starting offset for gap. - * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning. - * - * @return {number} The snapped value. - */ -var SnapCeil = function (value, gap, start, divide) -{ - if (start === undefined) { start = 0; } - - if (gap === 0) - { - return value; - } - - value -= start; - value = gap * Math.ceil(value / gap); - - return (divide) ? (start + value) / gap : start + value; -}; - -module.exports = SnapCeil; - - -/***/ }), -/* 344 */ +/* 354 */ /***/ (function(module, exports) { /** @@ -69381,7 +75334,7 @@ module.exports = Rotate; /***/ }), -/* 345 */ +/* 355 */ /***/ (function(module, exports) { /** @@ -69410,7 +75363,7 @@ module.exports = RoundAwayFromZero; /***/ }), -/* 346 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70003,7 +75956,7 @@ module.exports = Matrix3; /***/ }), -/* 347 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -70016,1470 +75969,9 @@ module.exports = Matrix3; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); - -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - // TODO - Should work with basic values - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - var out = this.val; - - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; - - return this; - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = []; - var m1 = this.val; - var m2 = src.val; - - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; - - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; - - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; - - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; - - return this.fromArray(a); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translate: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scale: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - this.fromArray([ - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromQuat: function (q) - { - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var out = this.val; - - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; - - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var out = this.val; - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - var out = this.val; - - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var out = this.val; - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var out = this.val; - - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix !== undefined) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix !== undefined) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - } - -}); - -var _tempMat1 = new Matrix4(); -var _tempMat2 = new Matrix4(); - -module.exports = Matrix4; - - -/***/ }), -/* 348 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(81); -var Matrix3 = __webpack_require__(346); +var Matrix3 = __webpack_require__(356); +var NOOP = __webpack_require__(1); +var Vector3 = __webpack_require__(37); var EPSILON = 0.000001; @@ -71502,10 +75994,10 @@ var tmpMat3 = new Matrix3(); * @constructor * @since 3.0.0 * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. */ var Quaternion = new Class({ @@ -71516,52 +76008,141 @@ var Quaternion = new Class({ /** * The x component of this Quaternion. * - * @name Phaser.Math.Quaternion#x + * @name Phaser.Math.Quaternion#_x * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The y component of this Quaternion. * - * @name Phaser.Math.Quaternion#y + * @name Phaser.Math.Quaternion#_y * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The z component of this Quaternion. * - * @name Phaser.Math.Quaternion#z + * @name Phaser.Math.Quaternion#_z * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The w component of this Quaternion. * - * @name Phaser.Math.Quaternion#w + * @name Phaser.Math.Quaternion#_w * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ - if (typeof x === 'object') + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); } - else + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); } }, @@ -71577,16 +76158,11 @@ var Quaternion = new Class({ */ copy: function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; + return this.set(src); }, /** - * Set the components of this Quaternion. + * Set the components of this Quaternion and optionally call the `onChangeCallback`. * * @method Phaser.Math.Quaternion#set * @since 3.0.0 @@ -71595,24 +76171,32 @@ var Quaternion = new Class({ * @param {number} [y=0] - The y component. * @param {number} [z=0] - The z component. * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? * * @return {Phaser.Math.Quaternion} This Quaternion. */ - set: function (x, y, z, w) + set: function (x, y, z, w, update) { + if (update === undefined) { update = true; } + if (typeof x === 'object') { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); } return this; @@ -71630,10 +76214,12 @@ var Quaternion = new Class({ */ add: function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); return this; }, @@ -71650,10 +76236,12 @@ var Quaternion = new Class({ */ subtract: function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); return this; }, @@ -71670,10 +76258,12 @@ var Quaternion = new Class({ */ scale: function (scale) { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); return this; }, @@ -71734,12 +76324,14 @@ var Quaternion = new Class({ { len = 1 / Math.sqrt(len); - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; } + this.onChangeCallback(this); + return this; }, @@ -71778,12 +76370,12 @@ var Quaternion = new Class({ var az = this.z; var aw = this.w; - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); }, /** @@ -71815,21 +76407,16 @@ var Quaternion = new Class({ } else if (dot > 0.999999) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); } else { tmpvec.copy(a).cross(b); - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; return this.normalize(); } @@ -71876,12 +76463,7 @@ var Quaternion = new Class({ */ identity: function () { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); }, /** @@ -71901,12 +76483,12 @@ var Quaternion = new Class({ var s = Math.sin(rad); - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); }, /** @@ -71931,12 +76513,12 @@ var Quaternion = new Class({ var bz = b.z; var bw = b.w; - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); }, /** @@ -71994,12 +76576,12 @@ var Quaternion = new Class({ } // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); }, /** @@ -72020,14 +76602,12 @@ var Quaternion = new Class({ var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = (dot) ? 1 / dot : 0; - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); }, /** @@ -72042,9 +76622,11 @@ var Quaternion = new Class({ */ conjugate: function () { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); return this; }, @@ -72071,12 +76653,12 @@ var Quaternion = new Class({ var bx = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); }, /** @@ -72101,12 +76683,12 @@ var Quaternion = new Class({ var by = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); }, /** @@ -72131,12 +76713,12 @@ var Quaternion = new Class({ var bz = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); }, /** @@ -72160,6 +76742,190 @@ var Quaternion = new Class({ return this; }, + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + /** * Convert the given Matrix into this Quaternion. * @@ -72191,9 +76957,9 @@ var Quaternion = new Class({ fRoot = 0.5 / fRoot; // 1/(4w) - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; } else { @@ -72222,12 +76988,14 @@ var Quaternion = new Class({ tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; } + this.onChangeCallback(this); + return this; } @@ -72237,7 +77005,7 @@ module.exports = Quaternion; /***/ }), -/* 349 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72246,10 +77014,10 @@ module.exports = Quaternion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasInterpolation = __webpack_require__(350); -var CanvasPool = __webpack_require__(26); -var CONST = __webpack_require__(34); -var Features = __webpack_require__(179); +var CanvasInterpolation = __webpack_require__(359); +var CanvasPool = __webpack_require__(31); +var CONST = __webpack_require__(39); +var Features = __webpack_require__(183); /** * Called automatically by Phaser.Game and responsible for creating the renderer it will use. @@ -72339,8 +77107,8 @@ var CreateRenderer = function (game) if (true) { - CanvasRenderer = __webpack_require__(532); - WebGLRenderer = __webpack_require__(535); + CanvasRenderer = __webpack_require__(568); + WebGLRenderer = __webpack_require__(571); // Let the config pick the renderer type, as both are included if (config.renderType === CONST.WEBGL) @@ -72365,7 +77133,7 @@ module.exports = CreateRenderer; /***/ }), -/* 350 */ +/* 359 */ /***/ (function(module, exports) { /** @@ -72428,7 +77196,7 @@ module.exports = CanvasInterpolation; /***/ }), -/* 351 */ +/* 360 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72437,7 +77205,7 @@ module.exports = CanvasInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(34); +var CONST = __webpack_require__(39); /** * Called automatically by Phaser.Game and responsible for creating the console.log debug header. @@ -72474,11 +77242,11 @@ var DebugHeader = function (game) var audioType; - if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + if (deviceAudio.webAudio && !audioConfig.disableWebAudio) { audioType = 'Web Audio'; } - else if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + else if (audioConfig.noAudio || (!deviceAudio.webAudio && !deviceAudio.audioData)) { audioType = 'No Audio'; } @@ -72558,7 +77326,7 @@ module.exports = DebugHeader; /***/ }), -/* 352 */ +/* 361 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -72570,7 +77338,7 @@ module.exports = DebugHeader; var Class = __webpack_require__(0); var GetValue = __webpack_require__(6); var NOOP = __webpack_require__(1); -var RequestAnimationFrame = __webpack_require__(353); +var RequestAnimationFrame = __webpack_require__(362); // http://www.testufo.com/#test=animation-time-graph @@ -72652,7 +77420,7 @@ var TimeStep = new Class({ * The minimum fps rate you want the Time Step to run at. * * @name Phaser.Core.TimeStep#minFps - * @type {integer} + * @type {number} * @default 5 * @since 3.0.0 */ @@ -72666,7 +77434,7 @@ var TimeStep = new Class({ * is spiraling out of control. * * @name Phaser.Core.TimeStep#targetFps - * @type {integer} + * @type {number} * @default 60 * @since 3.0.0 */ @@ -72698,7 +77466,7 @@ var TimeStep = new Class({ * An exponential moving average of the frames per second. * * @name Phaser.Core.TimeStep#actualFps - * @type {integer} + * @type {number} * @readonly * @default 60 * @since 3.0.0 @@ -72710,7 +77478,7 @@ var TimeStep = new Class({ * When an fps update happens, the `framesThisSecond` value is reset. * * @name Phaser.Core.TimeStep#nextFpsUpdate - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -72721,7 +77489,7 @@ var TimeStep = new Class({ * The number of frames processed this second. * * @name Phaser.Core.TimeStep#framesThisSecond - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -72786,7 +77554,7 @@ var TimeStep = new Class({ * time has passed and is unaffected by delta smoothing. * * @name Phaser.Core.TimeStep#frame - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -72820,7 +77588,7 @@ var TimeStep = new Class({ * An internal counter to allow for the browser 'cooling down' after coming back into focus. * * @name Phaser.Core.TimeStep#_coolDown - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -72831,7 +77599,7 @@ var TimeStep = new Class({ * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. * * @name Phaser.Core.TimeStep#delta - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -72841,7 +77609,7 @@ var TimeStep = new Class({ * Internal index of the delta history position. * * @name Phaser.Core.TimeStep#deltaIndex - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -72851,7 +77619,7 @@ var TimeStep = new Class({ * Internal array holding the previous delta values, used for delta smoothing. * * @name Phaser.Core.TimeStep#deltaHistory - * @type {integer[]} + * @type {number[]} * @since 3.0.0 */ this.deltaHistory = []; @@ -72862,7 +77630,7 @@ var TimeStep = new Class({ * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. * * @name Phaser.Core.TimeStep#deltaSmoothingMax - * @type {integer} + * @type {number} * @default 10 * @since 3.0.0 */ @@ -72875,7 +77643,7 @@ var TimeStep = new Class({ * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. * * @name Phaser.Core.TimeStep#panicMax - * @type {integer} + * @type {number} * @default 120 * @since 3.0.0 */ @@ -73288,7 +78056,7 @@ module.exports = TimeStep; /***/ }), -/* 353 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73502,7 +78270,7 @@ module.exports = RequestAnimationFrame; /***/ }), -/* 354 */ +/* 363 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73511,7 +78279,7 @@ module.exports = RequestAnimationFrame; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(21); +var Events = __webpack_require__(23); /** * The Visibility Handler is responsible for listening out for document level visibility change events. @@ -73593,7 +78361,7 @@ module.exports = VisibilityHandler; /***/ }), -/* 355 */ +/* 364 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73602,8 +78370,8 @@ module.exports = VisibilityHandler; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arne16 = __webpack_require__(356); -var CanvasPool = __webpack_require__(26); +var Arne16 = __webpack_require__(365); +var CanvasPool = __webpack_require__(31); var GetValue = __webpack_require__(6); /** @@ -73715,7 +78483,7 @@ module.exports = GenerateTexture; /***/ }), -/* 356 */ +/* 365 */ /***/ (function(module, exports) { /** @@ -73753,7 +78521,7 @@ module.exports = { /***/ }), -/* 357 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73765,8 +78533,8 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezier = __webpack_require__(339); -var Curve = __webpack_require__(83); +var CubicBezier = __webpack_require__(350); +var Curve = __webpack_require__(88); var Vector2 = __webpack_require__(3); /** @@ -73907,7 +78675,7 @@ var CubicBezierCurve = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to. - * @param {integer} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. + * @param {number} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. * * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining. */ @@ -73980,7 +78748,7 @@ module.exports = CubicBezierCurve; /***/ }), -/* 358 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -73992,10 +78760,10 @@ module.exports = CubicBezierCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); -var DegToRad = __webpack_require__(41); +var Curve = __webpack_require__(88); +var DegToRad = __webpack_require__(34); var GetValue = __webpack_require__(6); -var RadToDeg = __webpack_require__(183); +var RadToDeg = __webpack_require__(188); var Vector2 = __webpack_require__(3); /** @@ -74014,10 +78782,10 @@ var Vector2 = __webpack_require__(3); * @param {number} [y=0] - The y coordinate of the ellipse. * @param {number} [xRadius=0] - The horizontal radius of ellipse. * @param {number} [yRadius=0] - The vertical radius of ellipse. - * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. - * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {number} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {number} [endAngle=360] - The end angle of the ellipse, in degrees. * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). - * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. + * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ @@ -74604,7 +79372,7 @@ module.exports = EllipseCurve; /***/ }), -/* 359 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -74616,8 +79384,8 @@ module.exports = EllipseCurve; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); -var FromPoints = __webpack_require__(186); +var Curve = __webpack_require__(88); +var FromPoints = __webpack_require__(191); var Rectangle = __webpack_require__(9); var Vector2 = __webpack_require__(3); @@ -74677,7 +79445,7 @@ var LineCurve = new Class({ * The quantity of arc length divisions within the curve. * * @name Phaser.Curves.Line#arcLengthDivisions - * @type {integer} + * @type {number} * @default 1 * @since 3.0.0 */ @@ -74810,8 +79578,8 @@ var LineCurve = new Class({ * @since 3.0.0 * * @param {number} u - A float between 0 and 1. - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The equidistant value. */ @@ -74907,7 +79675,7 @@ module.exports = LineCurve; /***/ }), -/* 360 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75046,7 +79814,7 @@ module.exports = MoveTo; /***/ }), -/* 361 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75056,8 +79824,8 @@ module.exports = MoveTo; */ var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); -var QuadraticBezierInterpolation = __webpack_require__(340); +var Curve = __webpack_require__(88); +var QuadraticBezierInterpolation = __webpack_require__(351); var Vector2 = __webpack_require__(3); /** @@ -75192,7 +79960,7 @@ var QuadraticBezier = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto. - * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. + * @param {number} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. * * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to. */ @@ -75263,7 +80031,7 @@ module.exports = QuadraticBezier; /***/ }), -/* 362 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75274,9 +80042,9 @@ module.exports = QuadraticBezier; // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) -var CatmullRom = __webpack_require__(181); +var CatmullRom = __webpack_require__(186); var Class = __webpack_require__(0); -var Curve = __webpack_require__(83); +var Curve = __webpack_require__(88); var Vector2 = __webpack_require__(3); /** @@ -75488,7 +80256,7 @@ module.exports = SplineCurve; /***/ }), -/* 363 */ +/* 372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75614,7 +80382,7 @@ module.exports = BaseShader; /***/ }), -/* 364 */ +/* 373 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75623,33 +80391,33 @@ module.exports = BaseShader; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); +var Color = __webpack_require__(36); -Color.ColorToRGBA = __webpack_require__(840); -Color.ComponentToHex = __webpack_require__(365); -Color.GetColor = __webpack_require__(175); -Color.GetColor32 = __webpack_require__(308); -Color.GetColorFromValue = __webpack_require__(119); -Color.HexStringToColor = __webpack_require__(307); -Color.HSLToColor = __webpack_require__(841); -Color.HSVColorWheel = __webpack_require__(842); -Color.HSVToRGB = __webpack_require__(176); -Color.HueToComponent = __webpack_require__(366); -Color.IntegerToColor = __webpack_require__(310); -Color.IntegerToRGB = __webpack_require__(311); -Color.Interpolate = __webpack_require__(843); -Color.ObjectToColor = __webpack_require__(312); -Color.RandomRGB = __webpack_require__(844); -Color.RGBStringToColor = __webpack_require__(313); -Color.RGBToHSV = __webpack_require__(309); -Color.RGBToString = __webpack_require__(845); -Color.ValueToColor = __webpack_require__(174); +Color.ColorSpectrum = __webpack_require__(895); +Color.ColorToRGBA = __webpack_require__(896); +Color.ComponentToHex = __webpack_require__(374); +Color.GetColor = __webpack_require__(100); +Color.GetColor32 = __webpack_require__(320); +Color.HexStringToColor = __webpack_require__(319); +Color.HSLToColor = __webpack_require__(897); +Color.HSVColorWheel = __webpack_require__(898); +Color.HSVToRGB = __webpack_require__(180); +Color.HueToComponent = __webpack_require__(375); +Color.IntegerToColor = __webpack_require__(322); +Color.IntegerToRGB = __webpack_require__(181); +Color.Interpolate = __webpack_require__(899); +Color.ObjectToColor = __webpack_require__(323); +Color.RandomRGB = __webpack_require__(900); +Color.RGBStringToColor = __webpack_require__(324); +Color.RGBToHSV = __webpack_require__(321); +Color.RGBToString = __webpack_require__(901); +Color.ValueToColor = __webpack_require__(179); module.exports = Color; /***/ }), -/* 365 */ +/* 374 */ /***/ (function(module, exports) { /** @@ -75664,7 +80432,7 @@ module.exports = Color; * @function Phaser.Display.Color.ComponentToHex * @since 3.0.0 * - * @param {integer} color - The color channel to get the hex value for, must be a value between 0 and 255. + * @param {number} color - The color channel to get the hex value for, must be a value between 0 and 255. * * @return {string} A string of length 2 characters, i.e. 255 = ff, 100 = 64. */ @@ -75679,7 +80447,7 @@ module.exports = ComponentToHex; /***/ }), -/* 366 */ +/* 375 */ /***/ (function(module, exports) { /** @@ -75735,7 +80503,7 @@ module.exports = HueToComponent; /***/ }), -/* 367 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75744,7 +80512,227 @@ module.exports = HueToComponent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var OS = __webpack_require__(125); +var Class = __webpack_require__(0); +var NOOP = __webpack_require__(1); + +/** + * @classdesc + * The RGB class holds a single color value and allows for easy modification and reading of it, + * with optional on-change callback notification and a dirty flag. + * + * @class RGB + * @memberof Phaser.Display + * @constructor + * @since 3.50.0 + * + * @param {number} [red=0] - The red color value. A number between 0 and 1. + * @param {number} [green=0] - The green color value. A number between 0 and 1. + * @param {number} [blue=0] - The blue color value. A number between 0 and 1. + */ +var RGB = new Class({ + + initialize: + + function RGB (red, green, blue) + { + /** + * Cached RGB values. + * + * @name Phaser.Display.RGB#_rgb + * @type {number[]} + * @private + * @since 3.50.0 + */ + this._rgb = [ 0, 0, 0 ]; + + /** + * This callback will be invoked each time one of the RGB color values change. + * + * The callback is sent the new color values as the parameters. + * + * @name Phaser.Display.RGB#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + /** + * Is this color dirty? + * + * @name Phaser.Display.RGB#dirty + * @type {boolean} + * @since 3.50.0 + */ + this.dirty = false; + + this.set(red, green, blue); + }, + + /** + * Sets the red, green and blue values of this RGB object, flags it as being + * dirty and then invokes the `onChangeCallback`, if set. + * + * @method Phaser.Display.RGB#set + * @since 3.50.0 + * + * @param {number} [red=0] - The red color value. A number between 0 and 1. + * @param {number} [green=0] - The green color value. A number between 0 and 1. + * @param {number} [blue=0] - The blue color value. A number between 0 and 1. + * + * @return {this} This RGB instance. + */ + set: function (red, green, blue) + { + if (red === undefined) { red = 0; } + if (green === undefined) { green = 0; } + if (blue === undefined) { blue = 0; } + + this._rgb = [ red, green, blue ]; + + this.onChange(); + + return this; + }, + + /** + * Compares the given rgb parameters with those in this object and returns + * a boolean `true` value if they are equal, otherwise it returns `false`. + * + * @method Phaser.Display.RGB#equals + * @since 3.50.0 + * + * @param {number} red - The red value to compare with this object. + * @param {number} green - The green value to compare with this object. + * @param {number} blue - The blue value to compare with this object. + * + * @return {boolean} `true` if the given values match those in this object, otherwise `false`. + */ + equals: function (red, green, blue) + { + var rgb = this._rgb; + + return (rgb.r === red && rgb.g === green && rgb.b === blue); + }, + + /** + * Internal on change handler. Sets this object as being dirty and + * then invokes the `onChangeCallback`, if set, passing in the + * new RGB values. + * + * @method Phaser.Display.RGB#onChange + * @since 3.50.0 + */ + onChange: function () + { + this.dirty = true; + + var rgb = this._rgb; + + this.onChangeCallback.call(this, rgb[0], rgb[1], rgb[2]); + }, + + /** + * The red color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + * + * @name Phaser.Display.RGB#r + * @type {number} + * @since 3.50.0 + */ + r: { + + get: function () + { + return this._rgb[0]; + }, + + set: function (value) + { + this._rgb[0] = value; + this.onChange(); + } + + }, + + /** + * The green color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + * + * @name Phaser.Display.RGB#g + * @type {number} + * @since 3.50.0 + */ + g: { + + get: function () + { + return this._rgb[1]; + }, + + set: function (value) + { + this._rgb[1] = value; + this.onChange(); + } + + }, + + /** + * The blue color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + * + * @name Phaser.Display.RGB#b + * @type {number} + * @since 3.50.0 + */ + b: { + + get: function () + { + return this._rgb[2]; + }, + + set: function (value) + { + this._rgb[2] = value; + this.onChange(); + } + + }, + + /** + * Nulls any external references this object contains. + * + * @method Phaser.Display.RGB#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.onChangeCallback = null; + } + +}); + +module.exports = RGB; + + +/***/ }), +/* 377 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var OS = __webpack_require__(102); /** * @callback ContentLoadedCallback @@ -75798,7 +80786,7 @@ module.exports = DOMContentLoaded; /***/ }), -/* 368 */ +/* 378 */ /***/ (function(module, exports) { /** @@ -75857,7 +80845,7 @@ module.exports = GetInnerHeight; /***/ }), -/* 369 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -75866,7 +80854,7 @@ module.exports = GetInnerHeight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(187); +var CONST = __webpack_require__(192); /** * Attempts to determine the screen orientation using the Orientation API. @@ -75895,12 +80883,9 @@ var GetScreenOrientation = function (width, height) return orientation; } - if (screen) - { - return (screen.height > screen.width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; - } - else if (typeof window.orientation === 'number') + if (typeof window.orientation === 'number') { + // Do this check first, as iOS supports this, but also has an incomplete window.screen implementation // This may change by device based on "natural" orientation. return (window.orientation === 0 || window.orientation === 180) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; } @@ -75915,15 +80900,17 @@ var GetScreenOrientation = function (width, height) return CONST.ORIENTATION.LANDSCAPE; } } - - return (height > width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; + else + { + return (height > width) ? CONST.ORIENTATION.PORTRAIT : CONST.ORIENTATION.LANDSCAPE; + } }; module.exports = GetScreenOrientation; /***/ }), -/* 370 */ +/* 380 */ /***/ (function(module, exports) { /** @@ -75957,7 +80944,7 @@ module.exports = { * You can still center it yourself via CSS. * * @name Phaser.Scale.Center.NO_CENTER - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -75971,7 +80958,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_BOTH - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -75985,7 +80972,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_HORIZONTALLY - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -75999,7 +80986,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_VERTICALLY - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76009,7 +80996,7 @@ module.exports = { /***/ }), -/* 371 */ +/* 381 */ /***/ (function(module, exports) { /** @@ -76062,7 +81049,7 @@ module.exports = { /***/ }), -/* 372 */ +/* 382 */ /***/ (function(module, exports) { /** @@ -76097,7 +81084,7 @@ module.exports = { * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. * * @name Phaser.Scale.ScaleModes.NONE - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76107,7 +81094,7 @@ module.exports = { * The height is automatically adjusted based on the width. * * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76117,7 +81104,7 @@ module.exports = { * The width is automatically adjusted based on the height. * * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76129,7 +81116,7 @@ module.exports = { * inside the area which is not covered. * * @name Phaser.Scale.ScaleModes.FIT - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76140,7 +81127,7 @@ module.exports = { * area while keeping the aspect ratio. This may extend further out than the target size. * * @name Phaser.Scale.ScaleModes.ENVELOP - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76150,7 +81137,7 @@ module.exports = { * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. * * @name Phaser.Scale.ScaleModes.RESIZE - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76160,7 +81147,7 @@ module.exports = { /***/ }), -/* 373 */ +/* 383 */ /***/ (function(module, exports) { /** @@ -76193,7 +81180,7 @@ module.exports = { * The game canvas will not be zoomed by Phaser. * * @name Phaser.Scale.Zoom.NO_ZOOM - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76203,7 +81190,7 @@ module.exports = { * The game canvas will be 2x zoomed by Phaser. * * @name Phaser.Scale.Zoom.ZOOM_2X - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76213,7 +81200,7 @@ module.exports = { * The game canvas will be 4x zoomed by Phaser. * * @name Phaser.Scale.Zoom.ZOOM_4X - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76224,7 +81211,7 @@ module.exports = { * fit into the parent, or browser window if no parent is set. * * @name Phaser.Scale.Zoom.MAX_ZOOM - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -76234,7 +81221,7 @@ module.exports = { /***/ }), -/* 374 */ +/* 384 */ /***/ (function(module, exports) { /** @@ -76285,7 +81272,7 @@ module.exports = GetTarget; /***/ }), -/* 375 */ +/* 385 */ /***/ (function(module, exports) { /** @@ -76342,7 +81329,7 @@ module.exports = ParseXML; /***/ }), -/* 376 */ +/* 386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76352,16 +81339,16 @@ module.exports = ParseXML; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(189); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(56); -var GameEvents = __webpack_require__(21); -var Keyboard = __webpack_require__(377); -var Mouse = __webpack_require__(378); -var Pointer = __webpack_require__(379); -var Touch = __webpack_require__(380); -var TransformMatrix = __webpack_require__(31); -var TransformXY = __webpack_require__(166); +var CONST = __webpack_require__(194); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(49); +var GameEvents = __webpack_require__(23); +var Keyboard = __webpack_require__(387); +var Mouse = __webpack_require__(388); +var Pointer = __webpack_require__(389); +var Touch = __webpack_require__(390); +var TransformMatrix = __webpack_require__(24); +var TransformXY = __webpack_require__(169); /** * @classdesc @@ -76518,7 +81505,7 @@ var InputManager = new Class({ * setting the `input.activePointers` property in the Game Config. * * @name Phaser.Input.InputManager#pointersTotal - * @type {integer} + * @type {number} * @readonly * @since 3.10.0 */ @@ -76738,7 +81725,7 @@ var InputManager = new Class({ /** * Tells the Input system to set a custom cursor. - * + * * This cursor will be the default cursor used when interacting with the game canvas. * * If an Interactive Object also sets a custom cursor, this is the cursor that is reset after its use. @@ -76748,7 +81735,7 @@ var InputManager = new Class({ * ```javascript * this.input.setDefaultCursor('url(assets/cursors/sword.cur), pointer'); * ``` - * + * * Please read about the differences between browsers when it comes to the file formats and sizes they support: * * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor @@ -76758,7 +81745,7 @@ var InputManager = new Class({ * * @method Phaser.Input.InputManager#setDefaultCursor * @since 3.10.0 - * + * * @param {string} cursor - The CSS to be used when setting the default cursor. */ setDefaultCursor: function (cursor) @@ -76773,7 +81760,7 @@ var InputManager = new Class({ /** * Called by the InputPlugin when processing over and out events. - * + * * Tells the Input Manager to set a custom cursor during its postUpdate step. * * https://developer.mozilla.org/en-US/docs/Web/CSS/cursor @@ -76781,7 +81768,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#setCursor * @private * @since 3.10.0 - * + * * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method. */ setCursor: function (interactiveObject) @@ -76794,13 +81781,13 @@ var InputManager = new Class({ /** * Called by the InputPlugin when processing over and out events. - * + * * Tells the Input Manager to clear the hand cursor, if set, during its postUpdate step. * * @method Phaser.Input.InputManager#resetCursor * @private * @since 3.10.0 - * + * * @param {Phaser.Types.Input.InteractiveObject} interactiveObject - The Interactive Object that called this method. */ resetCursor: function (interactiveObject) @@ -76825,7 +81812,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#addPointer * @since 3.10.0 * - * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * @param {number} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. * * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. */ @@ -76866,7 +81853,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#updateInputPlugins * @since 3.16.0 * - * @param {integer} type - The type of event to process. + * @param {number} type - The type of event to process. * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. */ updateInputPlugins: function (type, pointers) @@ -77059,9 +82046,13 @@ var InputManager = new Class({ */ onMouseDown: function (event) { - this.mousePointer.down(event); + var mousePointer = this.mousePointer; - this.mousePointer.updateMotion(); + mousePointer.down(event); + + mousePointer.updateMotion(); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_DOWN, this.mousePointerContainer); }, @@ -77077,9 +82068,13 @@ var InputManager = new Class({ */ onMouseMove: function (event) { - this.mousePointer.move(event); + var mousePointer = this.mousePointer; - this.mousePointer.updateMotion(); + mousePointer.move(event); + + mousePointer.updateMotion(); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_MOVE, this.mousePointerContainer); }, @@ -77095,9 +82090,13 @@ var InputManager = new Class({ */ onMouseUp: function (event) { - this.mousePointer.up(event); + var mousePointer = this.mousePointer; - this.mousePointer.updateMotion(); + mousePointer.up(event); + + mousePointer.updateMotion(); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_UP, this.mousePointerContainer); }, @@ -77113,7 +82112,11 @@ var InputManager = new Class({ */ onMouseWheel: function (event) { - this.mousePointer.wheel(event); + var mousePointer = this.mousePointer; + + mousePointer.wheel(event); + + this.activePointer = mousePointer; this.updateInputPlugins(CONST.MOUSE_WHEEL, this.mousePointerContainer); }, @@ -77216,12 +82219,6 @@ var InputManager = new Class({ var x = pointer.x; var y = pointer.y; - if (camera.resolution !== 1) - { - x += camera._x; - y += camera._y; - } - // Stores the world point inside of tempPoint camera.getWorldPoint(x, y, tempPoint); @@ -77257,7 +82254,7 @@ var InputManager = new Class({ { TransformXY(px, py, gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX, gameObject.scaleY, point); } - + if (this.pointWithinHitArea(gameObject, point.x, point.y)) { output.push(gameObject); @@ -77424,7 +82421,7 @@ module.exports = InputManager; /***/ }), -/* 377 */ +/* 387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77433,11 +82430,11 @@ module.exports = InputManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(96); +var ArrayRemove = __webpack_require__(87); var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); -var InputEvents = __webpack_require__(56); -var KeyCodes = __webpack_require__(132); +var GameEvents = __webpack_require__(23); +var InputEvents = __webpack_require__(49); +var KeyCodes = __webpack_require__(138); var NOOP = __webpack_require__(1); /** @@ -77521,7 +82518,7 @@ var KeyboardManager = new Class({ * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. * * @name Phaser.Input.Keyboard.KeyboardManager#captures - * @type {integer[]} + * @type {number[]} * @since 3.16.0 */ this.captures = []; @@ -77730,7 +82727,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#addCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser. */ addCapture: function (keycode) { @@ -77797,7 +82794,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#removeCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again. */ removeCapture: function (keycode) { @@ -77868,7 +82865,7 @@ module.exports = KeyboardManager; /***/ }), -/* 378 */ +/* 388 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -77878,8 +82875,8 @@ module.exports = KeyboardManager; */ var Class = __webpack_require__(0); -var Features = __webpack_require__(179); -var InputEvents = __webpack_require__(56); +var Features = __webpack_require__(183); +var InputEvents = __webpack_require__(49); var NOOP = __webpack_require__(1); // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent @@ -77916,14 +82913,44 @@ var MouseManager = new Class({ this.manager = inputManager; /** - * If true the DOM mouse events will have event.preventDefault applied to them, if false they will propagate fully. + * If `true` the DOM `mousedown` event will have `preventDefault` set. * - * @name Phaser.Input.Mouse.MouseManager#capture + * @name Phaser.Input.Mouse.MouseManager#preventDefaultDown * @type {boolean} * @default true - * @since 3.0.0 + * @since 3.50.0 */ - this.capture = true; + this.preventDefaultDown = true; + + /** + * If `true` the DOM `mouseup` event will have `preventDefault` set. + * + * @name Phaser.Input.Mouse.MouseManager#preventDefaultUp + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.preventDefaultUp = true; + + /** + * If `true` the DOM `mousemove` event will have `preventDefault` set. + * + * @name Phaser.Input.Mouse.MouseManager#preventDefaultMove + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.preventDefaultMove = true; + + /** + * If `true` the DOM `wheel` event will have `preventDefault` set. + * + * @name Phaser.Input.Mouse.MouseManager#preventDefaultWheel + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.preventDefaultWheel = false; /** * A boolean that controls if the Mouse Manager is enabled or not. @@ -78055,6 +83082,20 @@ var MouseManager = new Class({ */ this.pointerLockChange = NOOP; + /** + * Are the event listeners hooked into `window.top` or `window`? + * + * This is set during the `boot` sequence. If the browser does not have access to `window.top`, + * such as in cross-origin iframe environments, this property gets set to `false` and the events + * are hooked into `window` instead. + * + * @name Phaser.Input.Mouse.MouseManager#isTop + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.isTop = true; + inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); }, @@ -78071,7 +83112,12 @@ var MouseManager = new Class({ this.enabled = config.inputMouse; this.target = config.inputMouseEventTarget; - this.capture = config.inputMouseCapture; + this.passive = config.inputMousePassive; + + this.preventDefaultDown = config.inputMousePreventDefaultDown; + this.preventDefaultUp = config.inputMousePreventDefaultUp; + this.preventDefaultMove = config.inputMousePreventDefaultMove; + this.preventDefaultWheel = config.inputMousePreventDefaultWheel; if (!this.target) { @@ -78129,6 +83175,12 @@ var MouseManager = new Class({ * It is important to note that pointer lock can only be enabled after an 'engagement gesture', * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. * + * Note for Firefox: There is a bug in certain Firefox releases that cause native DOM events like + * `mousemove` to fire continuously when in pointer lock mode. You can get around this by setting + * `this.preventDefaultMove` to `false` in this class. You may also need to do the same for + * `preventDefaultDown` and/or `preventDefaultUp`. Please test combinations of these if you encounter + * the error. + * * @method Phaser.Input.Mouse.MouseManager#requestPointerLock * @since 3.0.0 */ @@ -78170,17 +83222,25 @@ var MouseManager = new Class({ */ startListeners: function () { + var target = this.target; + + if (!target) + { + return; + } + var _this = this; - var canvas = this.manager.canvas; - var autoFocus = (window && window.focus && this.manager.game.config.autoFocus); + var manager = this.manager; + var canvas = manager.canvas; + var autoFocus = (window && window.focus && manager.game.config.autoFocus); this.onMouseMove = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseMove(event); + manager.onMouseMove(event); - if (_this.capture) + if (_this.preventDefaultMove) { event.preventDefault(); } @@ -78194,11 +83254,11 @@ var MouseManager = new Class({ window.focus(); } - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseDown(event); + manager.onMouseDown(event); - if (_this.capture && event.target === canvas) + if (_this.preventDefaultDown && event.target === canvas) { event.preventDefault(); } @@ -78207,20 +83267,20 @@ var MouseManager = new Class({ this.onMouseDownWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onMouseDown(event); + manager.onMouseDown(event); } }; this.onMouseUp = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseUp(event); + manager.onMouseUp(event); - if (_this.capture && event.target === canvas) + if (_this.preventDefaultUp && event.target === canvas) { event.preventDefault(); } @@ -78229,58 +83289,73 @@ var MouseManager = new Class({ this.onMouseUpWindow = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled && event.target !== canvas) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled && event.target !== canvas) { // Only process the event if the target isn't the canvas - _this.manager.onMouseUp(event); + manager.onMouseUp(event); } }; this.onMouseOver = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.setCanvasOver(event); + manager.setCanvasOver(event); } }; this.onMouseOut = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.setCanvasOut(event); + manager.setCanvasOut(event); } }; this.onMouseWheel = function (event) { - if (!event.defaultPrevented && _this.enabled && _this.manager && _this.manager.enabled) + if (!event.defaultPrevented && _this.enabled && manager && manager.enabled) { - _this.manager.onMouseWheel(event); + manager.onMouseWheel(event); + } + + if (_this.preventDefaultWheel && event.target === canvas) + { + event.preventDefault(); } }; - var target = this.target; + var passive = { passive: true }; - if (!target) + target.addEventListener('mousemove', this.onMouseMove); + target.addEventListener('mousedown', this.onMouseDown); + target.addEventListener('mouseup', this.onMouseUp); + target.addEventListener('mouseover', this.onMouseOver, passive); + target.addEventListener('mouseout', this.onMouseOut, passive); + + if (this.preventDefaultWheel) { - return; + target.addEventListener('wheel', this.onMouseWheel, { passive: false }); + } + else + { + target.addEventListener('wheel', this.onMouseWheel, passive); } - var passive = { passive: true }; - var nonPassive = { passive: false }; - - target.addEventListener('mousemove', this.onMouseMove, (this.capture) ? nonPassive : passive); - target.addEventListener('mousedown', this.onMouseDown, (this.capture) ? nonPassive : passive); - target.addEventListener('mouseup', this.onMouseUp, (this.capture) ? nonPassive : passive); - target.addEventListener('mouseover', this.onMouseOver, (this.capture) ? nonPassive : passive); - target.addEventListener('mouseout', this.onMouseOut, (this.capture) ? nonPassive : passive); - target.addEventListener('wheel', this.onMouseWheel, (this.capture) ? nonPassive : passive); - - if (window && this.manager.game.config.inputWindowEvents) + if (window && manager.game.config.inputWindowEvents) { - window.top.addEventListener('mousedown', this.onMouseDownWindow, nonPassive); - window.top.addEventListener('mouseup', this.onMouseUpWindow, nonPassive); + try + { + window.top.addEventListener('mousedown', this.onMouseDownWindow, passive); + window.top.addEventListener('mouseup', this.onMouseUpWindow, passive); + } + catch (exception) + { + window.addEventListener('mousedown', this.onMouseDownWindow, passive); + window.addEventListener('mouseup', this.onMouseUpWindow, passive); + + this.isTop = false; + } } if (Features.pointerLock) @@ -78291,7 +83366,7 @@ var MouseManager = new Class({ _this.locked = (document.pointerLockElement === element || document.mozPointerLockElement === element || document.webkitPointerLockElement === element) ? true : false; - _this.manager.onPointerLockChange(event); + manager.onPointerLockChange(event); }; document.addEventListener('pointerlockchange', this.pointerLockChange, true); @@ -78321,8 +83396,10 @@ var MouseManager = new Class({ if (window) { - window.top.removeEventListener('mousedown', this.onMouseDownWindow); - window.top.removeEventListener('mouseup', this.onMouseUpWindow); + target = (this.isTop) ? window.top : window; + + target.removeEventListener('mousedown', this.onMouseDownWindow); + target.removeEventListener('mouseup', this.onMouseUpWindow); } if (Features.pointerLock) @@ -78354,7 +83431,7 @@ module.exports = MouseManager; /***/ }), -/* 379 */ +/* 389 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -78363,12 +83440,13 @@ module.exports = MouseManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(330); +var Angle = __webpack_require__(341); var Class = __webpack_require__(0); -var Distance = __webpack_require__(55); -var FuzzyEqual = __webpack_require__(109); -var SmoothStepInterpolation = __webpack_require__(341); +var Distance = __webpack_require__(61); +var FuzzyEqual = __webpack_require__(121); +var SmoothStepInterpolation = __webpack_require__(352); var Vector2 = __webpack_require__(3); +var OS = __webpack_require__(102); /** * @classdesc @@ -78391,7 +83469,7 @@ var Vector2 = __webpack_require__(3); * @since 3.0.0 * * @param {Phaser.Input.InputManager} manager - A reference to the Input Manager. - * @param {integer} id - The internal ID of this Pointer. + * @param {number} id - The internal ID of this Pointer. */ var Pointer = new Class({ @@ -78412,7 +83490,7 @@ var Pointer = new Class({ * The internal ID of this Pointer. * * @name Phaser.Input.Pointer#id - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -78473,7 +83551,7 @@ var Pointer = new Class({ * however, it should behave as if the left button was clicked in the standard button layout. * * @name Phaser.Input.Pointer#button - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.18.0 @@ -78492,7 +83570,7 @@ var Pointer = new Class({ * In this case, the values are read from right to left. * * @name Phaser.Input.Pointer#buttons - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -78867,17 +83945,8 @@ var Pointer = new Class({ */ updateWorldPoint: function (camera) { - var x = this.x; - var y = this.y; - - if (camera.resolution !== 1) - { - x += camera._x; - y += camera._y; - } - // Stores the world point inside of tempPoint - var temp = camera.getWorldPoint(x, y); + var temp = camera.getWorldPoint(this.x, this.y); this.worldX = temp.x; this.worldY = temp.y; @@ -79027,6 +84096,13 @@ var Pointer = new Class({ this.downY = this.y; } + if (OS.macOS && event.ctrlKey) + { + // Override button settings on macOS + this.buttons = 2; + this.primaryDown = false; + } + if (!this.isDown) { this.isDown = true; @@ -79531,7 +84607,7 @@ var Pointer = new Class({ * @method Phaser.Input.Pointer#getInterpolatedPosition * @since 3.11.0 * - * @param {integer} [steps=10] - The number of interpolation steps to use. + * @param {number} [steps=10] - The number of interpolation steps to use. * @param {array} [out] - An array to store the results in. If not provided a new one will be created. * * @return {array} An array of interpolated values. @@ -79641,7 +84717,7 @@ module.exports = Pointer; /***/ }), -/* 380 */ +/* 390 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -79651,7 +84727,7 @@ module.exports = Pointer; */ var Class = __webpack_require__(0); -var InputEvents = __webpack_require__(56); +var InputEvents = __webpack_require__(49); var NOOP = __webpack_require__(1); // https://developer.mozilla.org/en-US/docs/Web/API/Touch_events @@ -80054,7 +85130,7 @@ module.exports = TouchManager; /***/ }), -/* 381 */ +/* 391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80064,14 +85140,14 @@ module.exports = TouchManager; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(21); -var EventEmitter = __webpack_require__(12); +var GameEvents = __webpack_require__(23); +var EventEmitter = __webpack_require__(10); var FileTypesManager = __webpack_require__(8); -var GameObjectCreator = __webpack_require__(16); +var GameObjectCreator = __webpack_require__(17); var GameObjectFactory = __webpack_require__(5); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); -var Remove = __webpack_require__(96); +var PluginCache = __webpack_require__(25); +var Remove = __webpack_require__(87); /** * @classdesc @@ -80532,7 +85608,7 @@ var PluginManager = new Class({ * * @param {string} key - The unique plugin key. * - * @return {integer} The index of the plugin within the plugins array. + * @return {number} The index of the plugin within the plugins array. */ getIndex: function (key) { @@ -80956,7 +86032,7 @@ module.exports = PluginManager; /***/ }), -/* 382 */ +/* 392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -80965,18 +86041,18 @@ module.exports = PluginManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(187); +var CONST = __webpack_require__(192); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(94); -var GameEvents = __webpack_require__(21); -var GetInnerHeight = __webpack_require__(368); -var GetTarget = __webpack_require__(374); -var GetScreenOrientation = __webpack_require__(369); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(101); +var GameEvents = __webpack_require__(23); +var GetInnerHeight = __webpack_require__(378); +var GetTarget = __webpack_require__(384); +var GetScreenOrientation = __webpack_require__(379); var NOOP = __webpack_require__(1); var Rectangle = __webpack_require__(9); -var Size = __webpack_require__(383); -var SnapFloor = __webpack_require__(95); +var Size = __webpack_require__(393); +var SnapFloor = __webpack_require__(72); var Vector2 = __webpack_require__(3); /** @@ -81165,7 +86241,7 @@ var ScaleManager = new Class({ /** * The Base Size component. * - * The modified game size, which is the gameSize * resolution, used to set the canvas width and height + * The modified game size, which is the auto-rounded gameSize, used to set the canvas width and height * (but not the CSS style) * * @name Phaser.Scale.ScaleManager#baseSize @@ -81194,17 +86270,6 @@ var ScaleManager = new Class({ */ this.scaleMode = CONST.SCALE_MODE.NONE; - /** - * The canvas resolution. - * - * This is hard-coded to a value of 1 in the 3.16 release of Phaser and will be enabled at a later date. - * - * @name Phaser.Scale.ScaleManager#resolution - * @type {number} - * @since 3.16.0 - */ - this.resolution = 1; - /** * The game zoom factor. * @@ -81326,7 +86391,7 @@ var ScaleManager = new Class({ * checked here. * * @name Phaser.Scale.ScaleManager#resizeInterval - * @type {integer} + * @type {number} * @since 3.16.0 */ this.resizeInterval = 500; @@ -81335,7 +86400,7 @@ var ScaleManager = new Class({ * Internal size interval tracker. * * @name Phaser.Scale.ScaleManager#_lastCheck - * @type {integer} + * @type {number} * @private * @since 3.16.0 */ @@ -81382,7 +86447,7 @@ var ScaleManager = new Class({ // Parse the config to get the scaling values we need this.parseConfig(this.game.config); - this.game.events.once('boot', this.boot, this); + this.game.events.once(GameEvents.BOOT, this.boot, this); }, /** @@ -81425,6 +86490,7 @@ var ScaleManager = new Class({ } game.events.on(GameEvents.PRE_STEP, this.step, this); + game.events.once(GameEvents.READY, this.refresh, this); game.events.once(GameEvents.DESTROY, this.destroy, this); this.startListeners(); @@ -81451,7 +86517,6 @@ var ScaleManager = new Class({ var width = config.width; var height = config.height; var scaleMode = config.scaleMode; - var resolution = config.resolution; var zoom = config.zoom; var autoRound = config.autoRound; @@ -81487,11 +86552,6 @@ var ScaleManager = new Class({ height = Math.floor(parentHeight * parentScaleY); } - // This is fixed at 1 on purpose. - // Changing it will break all user input. - // Wait for another release to solve this issue. - this.resolution = 1; - this.scaleMode = scaleMode; this.autoRound = autoRound; @@ -81521,8 +86581,8 @@ var ScaleManager = new Class({ this._resetZoom = true; } - // The modified game size, which is the w/h * resolution - this.baseSize.setSize(width * resolution, height * resolution); + // The modified game size + this.baseSize.setSize(width, height); if (autoRound) { @@ -81623,9 +86683,8 @@ var ScaleManager = new Class({ DOMRect.height = GetInnerHeight(true); } - var resolution = this.resolution; - var newWidth = DOMRect.width * resolution; - var newHeight = DOMRect.height * resolution; + var newWidth = DOMRect.width; + var newHeight = DOMRect.height; if (parentSize.width !== newWidth || parentSize.height !== newHeight) { @@ -81705,7 +86764,6 @@ var ScaleManager = new Class({ setGameSize: function (width, height) { var autoRound = this.autoRound; - var resolution = this.resolution; if (autoRound) { @@ -81719,8 +86777,8 @@ var ScaleManager = new Class({ // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc this.gameSize.resize(width, height); - // The modified game size, which is the w/h * resolution - this.baseSize.resize(width * resolution, height * resolution); + // The modified game size + this.baseSize.resize(width, height); if (autoRound) { @@ -81770,7 +86828,6 @@ var ScaleManager = new Class({ resize: function (width, height) { var zoom = this.zoom; - var resolution = this.resolution; var autoRound = this.autoRound; if (autoRound) @@ -81785,8 +86842,8 @@ var ScaleManager = new Class({ // The un-modified game size, as requested in the game config (the raw width / height) as used for world bounds, etc this.gameSize.resize(width, height); - // The modified game size, which is the w/h * resolution - this.baseSize.resize(width * resolution, height * resolution); + // The modified game size + this.baseSize.resize(width, height); if (autoRound) { @@ -81796,7 +86853,7 @@ var ScaleManager = new Class({ // The size used for the canvas style, factoring in the scale mode and parent and zoom value // We just use the w/h here as this is what sets the aspect ratio (which doesn't then change) - this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution); + this.displaySize.setSize((width * zoom), (height * zoom)); this.canvas.width = this.baseSize.width; this.canvas.height = this.baseSize.height; @@ -81828,7 +86885,7 @@ var ScaleManager = new Class({ * @fires Phaser.Scale.Events#RESIZE * @since 3.16.0 * - * @param {integer} value - The new zoom value of the game. + * @param {number} value - The new zoom value of the game. * * @return {this} The Scale Manager instance. */ @@ -81900,7 +86957,7 @@ var ScaleManager = new Class({ domStyle.marginTop = canvasStyle.marginTop; } - this.emit(Events.RESIZE, this.gameSize, this.baseSize, this.displaySize, this.resolution, previousWidth, previousHeight); + this.emit(Events.RESIZE, this.gameSize, this.baseSize, this.displaySize, previousWidth, previousHeight); return this; }, @@ -81949,15 +87006,14 @@ var ScaleManager = new Class({ var zoom = this.zoom; var autoRound = this.autoRound; - var resolution = 1; if (this.scaleMode === CONST.SCALE_MODE.NONE) { // No scale - this.displaySize.setSize((width * zoom) * resolution, (height * zoom) * resolution); + this.displaySize.setSize((width * zoom), (height * zoom)); - styleWidth = this.displaySize.width / resolution; - styleHeight = this.displaySize.height / resolution; + styleWidth = this.displaySize.width; + styleHeight = this.displaySize.height; if (autoRound) { @@ -81982,10 +87038,10 @@ var ScaleManager = new Class({ this.gameSize.setSize(this.displaySize.width, this.displaySize.height); - this.baseSize.setSize(this.displaySize.width * resolution, this.displaySize.height * resolution); + this.baseSize.setSize(this.displaySize.width, this.displaySize.height); - styleWidth = this.displaySize.width / resolution; - styleHeight = this.displaySize.height / resolution; + styleWidth = this.displaySize.width; + styleHeight = this.displaySize.height; if (autoRound) { @@ -82001,8 +87057,8 @@ var ScaleManager = new Class({ // All other scale modes this.displaySize.setSize(this.parentSize.width, this.parentSize.height); - styleWidth = this.displaySize.width / resolution; - styleHeight = this.displaySize.height / resolution; + styleWidth = this.displaySize.width; + styleHeight = this.displaySize.height; if (autoRound) { @@ -82029,7 +87085,7 @@ var ScaleManager = new Class({ * @method Phaser.Scale.ScaleManager#getMaxZoom * @since 3.16.0 * - * @return {integer} The maximum possible zoom factor. At a minimum this value is always at least 1. + * @return {number} The maximum possible zoom factor. At a minimum this value is always at least 1. */ getMaxZoom: function () { @@ -82667,7 +87723,7 @@ module.exports = ScaleManager; /***/ }), -/* 383 */ +/* 393 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -82676,9 +87732,9 @@ module.exports = ScaleManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var SnapFloor = __webpack_require__(95); +var SnapFloor = __webpack_require__(72); var Vector2 = __webpack_require__(3); /** @@ -82696,7 +87752,7 @@ var Vector2 = __webpack_require__(3); * * @param {number} [width=0] - The width of the Size component. * @param {number} [height=width] - The height of the Size component. If not given, it will use the `width`. - * @param {integer} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode. + * @param {number} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode. * @param {any} [parent=null] - The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible. */ var Size = new Class({ @@ -82745,7 +87801,7 @@ var Size = new Class({ * This property is read-only. To change it use the `setAspectMode` method. * * @name Phaser.Structs.Size#aspectMode - * @type {integer} + * @type {number} * @readonly * @since 3.16.0 */ @@ -82843,7 +87899,7 @@ var Size = new Class({ * @method Phaser.Structs.Size#setAspectMode * @since 3.16.0 * - * @param {integer} [value=0] - The aspect mode value. + * @param {number} [value=0] - The aspect mode value. * * @return {this} This Size component instance. */ @@ -83396,7 +88452,7 @@ var Size = new Class({ * * @name Phaser.Structs.Size.NONE * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.NONE = 0; @@ -83406,7 +88462,7 @@ Size.NONE = 0; * * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.WIDTH_CONTROLS_HEIGHT = 1; @@ -83416,7 +88472,7 @@ Size.WIDTH_CONTROLS_HEIGHT = 1; * * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.HEIGHT_CONTROLS_WIDTH = 2; @@ -83426,7 +88482,7 @@ Size.HEIGHT_CONTROLS_WIDTH = 2; * * @name Phaser.Structs.Size.FIT * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.FIT = 3; @@ -83436,7 +88492,7 @@ Size.FIT = 3; * * @name Phaser.Structs.Size.ENVELOP * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.ENVELOP = 4; @@ -83445,7 +88501,7 @@ module.exports = Size; /***/ }), -/* 384 */ +/* 394 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -83455,14 +88511,14 @@ module.exports = Size; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(133); +var CONST = __webpack_require__(139); var Events = __webpack_require__(20); -var GameEvents = __webpack_require__(21); +var GameEvents = __webpack_require__(23); var GetValue = __webpack_require__(6); -var LoaderEvents = __webpack_require__(84); +var LoaderEvents = __webpack_require__(89); var NOOP = __webpack_require__(1); -var Scene = __webpack_require__(385); -var Systems = __webpack_require__(190); +var Scene = __webpack_require__(395); +var Systems = __webpack_require__(195); /** * @classdesc @@ -83470,7 +88526,7 @@ var Systems = __webpack_require__(190); * * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the * Scenes in a Game instance. - * +ó * * * @class SceneManager * @memberof Phaser.Scenes @@ -84606,33 +89662,39 @@ var SceneManager = new Class({ if (scene) { + var sys = scene.sys; + // If the Scene is already running (perhaps they called start from a launched sub-Scene?) // then we close it down before starting it again. - if (scene.sys.isActive() || scene.sys.isPaused()) + if (sys.isActive() || sys.isPaused()) { - scene.sys.shutdown(); + sys.shutdown(); - scene.sys.start(data); + sys.sceneUpdate = NOOP; + + sys.start(data); } else { - scene.sys.start(data); + sys.sceneUpdate = NOOP; + + sys.start(data); var loader; - if (scene.sys.load) + if (sys.load) { - loader = scene.sys.load; + loader = sys.load; } // Files payload? - if (loader && scene.sys.settings.hasOwnProperty('pack')) + if (loader && sys.settings.hasOwnProperty('pack')) { loader.reset(); - if (loader.addPack({ payload: scene.sys.settings.pack })) + if (loader.addPack({ payload: sys.settings.pack })) { - scene.sys.settings.status = CONST.LOADING; + sys.settings.status = CONST.LOADING; loader.once(LoaderEvents.COMPLETE, this.payloadComplete, this); @@ -84711,7 +89773,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#getAt * @since 3.0.0 * - * @param {integer} index - The index of the Scene to retrieve. + * @param {number} index - The index of the Scene to retrieve. * * @return {(Phaser.Scene|undefined)} The Scene. */ @@ -84728,7 +89790,7 @@ var SceneManager = new Class({ * * @param {(string|Phaser.Scene)} key - The key of the Scene. * - * @return {integer} The index of the Scene. + * @return {number} The index of the Scene. */ getIndex: function (key) { @@ -85083,7 +90145,7 @@ module.exports = SceneManager; /***/ }), -/* 385 */ +/* 395 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85093,7 +90155,7 @@ module.exports = SceneManager; */ var Class = __webpack_require__(0); -var Systems = __webpack_require__(190); +var Systems = __webpack_require__(195); /** * @classdesc @@ -85347,6 +90409,15 @@ var Scene = new Class({ * @since 3.0.0 */ this.plugins; + + /** + * A reference to the renderer instance Phaser is using, either Canvas or WebGL. + * + * @name Phaser.Scene#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.50.0 + */ + this.renderer; }, /** @@ -85369,7 +90440,7 @@ module.exports = Scene; /***/ }), -/* 386 */ +/* 396 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85379,7 +90450,7 @@ module.exports = Scene; */ var GetFastValue = __webpack_require__(2); -var UppercaseFirst = __webpack_require__(191); +var UppercaseFirst = __webpack_require__(196); /** * Builds an array of which physics plugins should be activated for the given Scene. @@ -85431,7 +90502,7 @@ module.exports = GetPhysicsPlugins; /***/ }), -/* 387 */ +/* 397 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85478,7 +90549,7 @@ module.exports = GetScenePlugins; /***/ }), -/* 388 */ +/* 398 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85487,10 +90558,10 @@ module.exports = GetScenePlugins; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(133); +var CONST = __webpack_require__(139); var GetValue = __webpack_require__(6); -var Merge = __webpack_require__(134); -var InjectionMap = __webpack_require__(908); +var Merge = __webpack_require__(140); +var InjectionMap = __webpack_require__(964); /** * @namespace Phaser.Scenes.Settings @@ -85574,7 +90645,7 @@ module.exports = Settings; /***/ }), -/* 389 */ +/* 399 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -85583,18 +90654,18 @@ module.exports = Settings; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); -var CanvasTexture = __webpack_require__(390); +var CanvasPool = __webpack_require__(31); +var CanvasTexture = __webpack_require__(400); var Class = __webpack_require__(0); -var Color = __webpack_require__(32); -var CONST = __webpack_require__(34); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(130); -var GameEvents = __webpack_require__(21); -var GenerateTexture = __webpack_require__(355); +var Color = __webpack_require__(36); +var CONST = __webpack_require__(39); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(136); +var GameEvents = __webpack_require__(23); +var GenerateTexture = __webpack_require__(364); var GetValue = __webpack_require__(6); -var Parser = __webpack_require__(392); -var Texture = __webpack_require__(192); +var Parser = __webpack_require__(402); +var Texture = __webpack_require__(197); /** * @callback EachTextureCallback @@ -85683,7 +90754,7 @@ var TextureManager = new Class({ * An counting value used for emitting 'ready' event after all of managers in game is loaded. * * @name Phaser.Textures.TextureManager#_pending - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -85702,13 +90773,16 @@ var TextureManager = new Class({ */ boot: function () { - this._pending = 2; - this.on(Events.LOAD, this.updatePending, this); this.on(Events.ERROR, this.updatePending, this); - this.addBase64('__DEFAULT', this.game.config.defaultImage); - this.addBase64('__MISSING', this.game.config.missingImage); + var config = this.game.config; + + this.addBase64('__DEFAULT', config.defaultImage); + this.addBase64('__MISSING', config.missingImage); + this.addBase64('__WHITE', config.whiteImage); + + this._pending = 3; this.game.events.once(GameEvents.DESTROY, this.destroy, this); }, @@ -85823,6 +90897,10 @@ var TextureManager = new Class({ /** * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. * + * It works by creating an `Image` DOM object, then setting the `src` attribute to + * the given base64 encoded data. As a result, the process is asynchronous by its nature, + * so be sure to listen for the events this method dispatches before using the texture. + * * @method Phaser.Textures.TextureManager#addBase64 * @fires Phaser.Textures.Events#ADD * @fires Phaser.Textures.Events#ERROR @@ -85831,7 +90909,7 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {*} data - The Base64 encoded data. - * + * * @return {this} This Texture Manager instance. */ addBase64: function (key, data) @@ -85866,9 +90944,9 @@ var TextureManager = new Class({ /** * Gets an existing texture frame and converts it into a base64 encoded image and returns the base64 data. - * + * * You can also provide the image type and encoder options. - * + * * This will only work with bitmap based texture frames, such as those created from Texture Atlases. * It will not work with GL Texture objects, such as Shaders, or Render Textures. For those please * see the WebGL Snapshot function instead. @@ -85877,10 +90955,10 @@ var TextureManager = new Class({ * @since 3.12.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. * @param {string} [type='image/png'] - A DOMString indicating the image format. The default format type is image/png. * @param {number} [encoderOptions=0.92] - A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp. If this argument is anything else, the default value for image quality is used. The default value is 0.92. Other arguments are ignored. - * + * * @return {string} The base64 encoded data, or an empty string if the texture frame could not be found. */ getBase64: function (key, frame, type, encoderOptions) @@ -85953,15 +91031,18 @@ var TextureManager = new Class({ this.emit(Events.ADD, key, texture); } - + return texture; }, /** * Takes a WebGL Texture and creates a Phaser Texture from it, which is added to the Texture Manager using the given key. - * + * * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. - * + * + * If the `width` and `height` arguments are omitted, but the WebGL Texture was created by Phaser's WebGL Renderer + * and has `glTexture.width` and `glTexture.height` properties, these values will be used instead. + * * This is a WebGL only feature. * * @method Phaser.Textures.TextureManager#addGLTexture @@ -85970,8 +91051,8 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {WebGLTexture} glTexture - The source Render Texture. - * @param {number} width - The new width of the Texture. - * @param {number} height - The new height of the Texture. + * @param {number} [width] - The new width of the Texture. Read from `glTexture.width` if omitted. + * @param {number} [height] - The new height of the Texture. Read from `glTexture.height` if omitted. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -85981,13 +91062,16 @@ var TextureManager = new Class({ if (this.checkKey(key)) { + if (width === undefined) { width = glTexture.width; } + if (height === undefined) { height = glTexture.height; } + texture = this.create(key, glTexture, width, height); texture.add('__BASE', 0, 0, 0, width, height); this.emit(Events.ADD, key, texture); } - + return texture; }, @@ -86016,17 +91100,17 @@ var TextureManager = new Class({ this.emit(Events.ADD, key, texture); } - + return texture; }, /** * Creates a new Texture using the given config values. - * + * * Generated textures consist of a Canvas element to which the texture data is drawn. - * + * * Generates a texture based on the given Create configuration object. - * + * * The texture is drawn using a fixed-size indexed palette of 16 colors, where the hex value in the * data cells map to a single color. For example, if the texture config looked like this: * @@ -86045,14 +91129,14 @@ var TextureManager = new Class({ * '.27887.78872.', * '.787.....787.' * ]; - * + * * this.textures.generate('star', { data: star, pixelWidth: 4 }); * ``` - * + * * Then it would generate a texture that is 52 x 48 pixels in size, because each cell of the data array * represents 1 pixel multiplied by the `pixelWidth` value. The cell values, such as `8`, maps to color * number 8 in the palette. If a cell contains a period character `.` then it is transparent. - * + * * The default palette is Arne16, but you can specify your own using the `palette` property. * * @method Phaser.Textures.TextureManager#generate @@ -86091,8 +91175,8 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {integer} [width=256] - The width of the Canvas element. - * @param {integer} [height=256] - The height of the Canvas element. + * @param {number} [width=256] - The width of the Canvas element. + * @param {number} [height=256] - The height of the Canvas element. * * @return {?Phaser.Textures.CanvasTexture} The Canvas Texture that was created, or `null` if the key is already in use. */ @@ -86296,7 +91380,7 @@ var TextureManager = new Class({ if (this.checkKey(key)) { texture = this.create(key, source); - + Parser.AtlasXML(texture, 0, data); if (dataSource) @@ -86442,8 +91526,8 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. - * @param {integer} width - The width of the Texture. - * @param {integer} height - The height of the Texture. + * @param {number} width - The width of the Texture. + * @param {number} height - The height of the Texture. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -86478,11 +91562,11 @@ var TextureManager = new Class({ /** * Returns a Texture from the Texture Manager that matches the given key. - * + * * If the key is `undefined` it will return the `__DEFAULT` Texture. - * + * * If the key is an instance of a Texture, it will return the key directly. - * + * * Finally. if the key is given, but not found and not a Texture instance, it will return the `__MISSING` Texture. * * @method Phaser.Textures.TextureManager#get @@ -86517,7 +91601,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} frame - The string or index of the Frame to be cloned. + * @param {(string|number)} frame - The string or index of the Frame to be cloned. * * @return {Phaser.Textures.Frame} A Clone of the given Frame. */ @@ -86536,7 +91620,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. * * @return {Phaser.Textures.Frame} A Texture Frame object. */ @@ -86580,10 +91664,10 @@ var TextureManager = new Class({ * @method Phaser.Textures.TextureManager#getPixel * @since 3.0.0 * - * @param {integer} x - The x coordinate of the pixel within the Texture. - * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {number} x - The x coordinate of the pixel within the Texture. + * @param {number} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel, * or `null` if the coordinates were out of bounds. @@ -86627,12 +91711,12 @@ var TextureManager = new Class({ * @method Phaser.Textures.TextureManager#getPixelAlpha * @since 3.10.0 * - * @param {integer} x - The x coordinate of the pixel within the Texture. - * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {number} x - The x coordinate of the pixel within the Texture. + * @param {number} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * - * @return {integer} A value between 0 and 255, or `null` if the coordinates were out of bounds. + * @return {number} A value between 0 and 255, or `null` if the coordinates were out of bounds. */ getPixelAlpha: function (x, y, key, frame) { @@ -86655,9 +91739,9 @@ var TextureManager = new Class({ ctx.clearRect(0, 0, 1, 1); ctx.drawImage(textureFrame.source.image, x, y, 1, 1, 0, 0, 1, 1); - + var rgb = ctx.getImageData(0, 0, 1, 1); - + return rgb.data[3]; } } @@ -86674,7 +91758,7 @@ var TextureManager = new Class({ * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the texture would be set on. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * * @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on. */ @@ -86691,9 +91775,9 @@ var TextureManager = new Class({ /** * Changes the key being used by a Texture to the new key provided. - * + * * The old key is removed, allowing it to be re-used. - * + * * Game Objects are linked to Textures by a reference to the Texture object, so * all existing references will be retained. * @@ -86776,7 +91860,7 @@ module.exports = TextureManager; /***/ }), -/* 390 */ +/* 400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -86786,11 +91870,11 @@ module.exports = TextureManager; */ var Class = __webpack_require__(0); -var Clamp = __webpack_require__(17); -var Color = __webpack_require__(32); -var CONST = __webpack_require__(34); -var IsSizePowerOfTwo = __webpack_require__(128); -var Texture = __webpack_require__(192); +var Clamp = __webpack_require__(16); +var Color = __webpack_require__(36); +var CONST = __webpack_require__(39); +var IsSizePowerOfTwo = __webpack_require__(133); +var Texture = __webpack_require__(197); /** * @classdesc @@ -86804,10 +91888,10 @@ var Texture = __webpack_require__(192); * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading * texture data to it. This restriction does not apply if using the Canvas Renderer. - * + * * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify * sections of the canvas using the `add` method. - * + * * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause * graphical errors. @@ -86821,8 +91905,8 @@ var Texture = __webpack_require__(192); * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. * @param {string} key - The unique string-based key of this Texture. * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. - * @param {integer} width - The width of the canvas. - * @param {integer} height - The height of the canvas. + * @param {number} width - The width of the canvas. + * @param {number} height - The height of the canvas. */ var CanvasTexture = new Class({ @@ -86872,7 +91956,7 @@ var CanvasTexture = new Class({ * * @name Phaser.Textures.CanvasTexture#width * @readonly - * @type {integer} + * @type {number} * @since 3.7.0 */ this.width = width; @@ -86883,7 +91967,7 @@ var CanvasTexture = new Class({ * * @name Phaser.Textures.CanvasTexture#height * @readonly - * @type {integer} + * @type {number} * @since 3.7.0 */ this.height = height; @@ -86997,11 +92081,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#draw * @since 3.13.0 - * - * @param {integer} x - The x coordinate to draw the source at. - * @param {integer} y - The y coordinate to draw the source at. + * + * @param {number} x - The x coordinate to draw the source at. + * @param {number} y - The y coordinate to draw the source at. * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. - * + * * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. */ draw: function (x, y, source) @@ -87017,12 +92101,12 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#drawFrame * @since 3.16.0 - * + * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. - * @param {integer} [x=0] - The x coordinate to draw the source at. - * @param {integer} [y=0] - The y coordinate to draw the source at. - * + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {number} [x=0] - The x coordinate to draw the source at. + * @param {number} [y=0] - The y coordinate to draw the source at. + * * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. */ drawFrame: function (key, frame, x, y) @@ -87065,14 +92149,14 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#setPixel * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. - * + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. + * * @return {this} This CanvasTexture. */ setPixel: function (x, y, red, green, blue, alpha) @@ -87104,15 +92188,15 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#putData * @since 3.16.0 - * + * * @param {ImageData} imageData - The ImageData to put at the given location. - * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. - * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. - * + * @param {number} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {number} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {number} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. + * @param {number} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. + * * @return {this} This CanvasTexture. */ putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) @@ -87133,12 +92217,12 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#getData * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. - * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. - * + * + * @param {number} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param {number} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + * * @return {ImageData} The ImageData extracted from this CanvasTexture. */ getData: function (x, y, width, height) @@ -87155,17 +92239,17 @@ var CanvasTexture = new Class({ /** * Get the color of a specific pixel from this texture and store it in a Color object. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * * @method Phaser.Textures.CanvasTexture#getPixel * @since 3.13.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. - * + * * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. */ getPixel: function (x, y, out) @@ -87197,18 +92281,18 @@ var CanvasTexture = new Class({ * * If the requested region extends outside the bounds of this CanvasTexture, * the region is truncated to fit. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * * @method Phaser.Textures.CanvasTexture#getPixels * @since 3.16.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. - * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. - * + * + * @param {number} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. + * @param {number} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. + * * @return {Phaser.Types.Textures.PixelConfig[][]} A 2d array of Pixel objects. */ getPixels: function (x, y, width, height) @@ -87257,11 +92341,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#getIndex * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * - * @return {integer} + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @return {number} */ getIndex: function (x, y) { @@ -87327,11 +92411,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#clear * @since 3.7.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. - * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. - * @param {integer} [width] - The width of the region. - * @param {integer} [height] - The height of the region. + * + * @param {number} [x=0] - The x coordinate of the top-left of the region to clear. + * @param {number} [y=0] - The y coordinate of the top-left of the region to clear. + * @param {number} [width] - The width of the region. + * @param {number} [height] - The height of the region. * * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. */ @@ -87353,8 +92437,8 @@ var CanvasTexture = new Class({ * @method Phaser.Textures.CanvasTexture#setSize * @since 3.7.0 * - * @param {integer} width - The new width of the Canvas. - * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. + * @param {number} width - The new width of the Canvas. + * @param {number} [height] - The new height of the Canvas. If not given it will use the width as the height. * * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. */ @@ -87411,7 +92495,7 @@ module.exports = CanvasTexture; /***/ }), -/* 391 */ +/* 401 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87420,10 +92504,10 @@ module.exports = CanvasTexture; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); -var IsSizePowerOfTwo = __webpack_require__(128); -var ScaleModes = __webpack_require__(247); +var IsSizePowerOfTwo = __webpack_require__(133); +var ScaleModes = __webpack_require__(260); /** * @classdesc @@ -87440,8 +92524,8 @@ var ScaleModes = __webpack_require__(247); * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. * @param {(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} source - The source image data. - * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. - * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. + * @param {number} [width] - Optional width of the source image. If not given it's derived from the source itself. + * @param {number} [height] - Optional height of the source image. If not given it's derived from the source itself. * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. */ var TextureSource = new Class({ @@ -87498,7 +92582,7 @@ var TextureSource = new Class({ * Currently un-used. * * @name Phaser.Textures.TextureSource#compressionAlgorithm - * @type {integer} + * @type {number} * @default null * @since 3.0.0 */ @@ -87519,7 +92603,7 @@ var TextureSource = new Class({ * the `naturalWidth` and then `width` properties of the source image. * * @name Phaser.Textures.TextureSource#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = width || source.naturalWidth || source.videoWidth || source.width || 0; @@ -87529,7 +92613,7 @@ var TextureSource = new Class({ * the `naturalHeight` and then `height` properties of the source image. * * @name Phaser.Textures.TextureSource#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = height || source.naturalHeight || source.videoHeight || source.height || 0; @@ -87755,7 +92839,7 @@ var TextureSource = new Class({ { if (this.glTexture) { - this.renderer.deleteTexture(this.glTexture); + this.renderer.deleteTexture(this.glTexture, false); } if (this.isCanvas) @@ -87776,7 +92860,7 @@ module.exports = TextureSource; /***/ }), -/* 392 */ +/* 402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87791,20 +92875,20 @@ module.exports = TextureSource; module.exports = { - AtlasXML: __webpack_require__(909), - Canvas: __webpack_require__(910), - Image: __webpack_require__(911), - JSONArray: __webpack_require__(912), - JSONHash: __webpack_require__(913), - SpriteSheet: __webpack_require__(914), - SpriteSheetFromAtlas: __webpack_require__(915), - UnityYAML: __webpack_require__(916) + AtlasXML: __webpack_require__(965), + Canvas: __webpack_require__(966), + Image: __webpack_require__(967), + JSONArray: __webpack_require__(968), + JSONHash: __webpack_require__(969), + SpriteSheet: __webpack_require__(970), + SpriteSheetFromAtlas: __webpack_require__(971), + UnityYAML: __webpack_require__(972) }; /***/ }), -/* 393 */ +/* 403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87814,9 +92898,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HTML5AudioSoundManager = __webpack_require__(394); -var NoAudioSoundManager = __webpack_require__(397); -var WebAudioSoundManager = __webpack_require__(399); +var HTML5AudioSoundManager = __webpack_require__(404); +var NoAudioSoundManager = __webpack_require__(407); +var WebAudioSoundManager = __webpack_require__(409); /** * Creates a Web Audio, HTML5 Audio or No Audio Sound Manager based on config and device settings. @@ -87827,7 +92911,7 @@ var WebAudioSoundManager = __webpack_require__(399); * @since 3.0.0 * * @param {Phaser.Game} game - Reference to the current game instance. - * + * * @return {(Phaser.Sound.HTML5AudioSoundManager|Phaser.Sound.WebAudioSoundManager|Phaser.Sound.NoAudioSoundManager)} The Sound Manager instance that was created. */ var SoundManagerCreator = { @@ -87837,12 +92921,12 @@ var SoundManagerCreator = { var audioConfig = game.config.audio; var deviceAudio = game.device.audio; - if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + if (audioConfig.noAudio || (!deviceAudio.webAudio && !deviceAudio.audioData)) { return new NoAudioSoundManager(game); } - if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + if (deviceAudio.webAudio && !audioConfig.disableWebAudio) { return new WebAudioSoundManager(game); } @@ -87856,7 +92940,7 @@ module.exports = SoundManagerCreator; /***/ }), -/* 394 */ +/* 404 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -87866,10 +92950,10 @@ module.exports = SoundManagerCreator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(135); +var BaseSoundManager = __webpack_require__(141); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); -var HTML5AudioSound = __webpack_require__(396); +var Events = __webpack_require__(66); +var HTML5AudioSound = __webpack_require__(406); /** * HTML5 Audio implementation of the Sound Manager. @@ -88325,7 +93409,7 @@ module.exports = HTML5AudioSoundManager; /***/ }), -/* 395 */ +/* 405 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88334,7 +93418,7 @@ module.exports = HTML5AudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Returns the first element in the array. @@ -88352,8 +93436,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=array.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) * * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. */ @@ -88384,7 +93468,7 @@ module.exports = GetFirst; /***/ }), -/* 396 */ +/* 406 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -88394,10 +93478,10 @@ module.exports = GetFirst; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(136); +var BaseSound = __webpack_require__(142); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); -var Clamp = __webpack_require__(17); +var Events = __webpack_require__(66); +var Clamp = __webpack_require__(16); /** * @classdesc @@ -89314,7 +94398,7 @@ module.exports = HTML5AudioSound; /***/ }), -/* 397 */ +/* 407 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89324,10 +94408,10 @@ module.exports = HTML5AudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSoundManager = __webpack_require__(135); +var BaseSoundManager = __webpack_require__(141); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var NoAudioSound = __webpack_require__(398); +var EventEmitter = __webpack_require__(10); +var NoAudioSound = __webpack_require__(408); var NOOP = __webpack_require__(1); /** @@ -89432,7 +94516,7 @@ module.exports = NoAudioSoundManager; /***/ }), -/* 398 */ +/* 408 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89442,10 +94526,10 @@ module.exports = NoAudioSoundManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(136); +var BaseSound = __webpack_require__(142); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Extend = __webpack_require__(19); +var EventEmitter = __webpack_require__(10); +var Extend = __webpack_require__(18); var returnFalse = function () { @@ -89623,7 +94707,7 @@ module.exports = NoAudioSound; /***/ }), -/* 399 */ +/* 409 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -89633,11 +94717,11 @@ module.exports = NoAudioSound; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64ToArrayBuffer = __webpack_require__(400); -var BaseSoundManager = __webpack_require__(135); +var Base64ToArrayBuffer = __webpack_require__(410); +var BaseSoundManager = __webpack_require__(141); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); -var WebAudioSound = __webpack_require__(401); +var Events = __webpack_require__(66); +var WebAudioSound = __webpack_require__(411); /** * @classdesc @@ -89736,7 +94820,7 @@ var WebAudioSoundManager = new Class({ { var audioConfig = game.config.audio; - if (audioConfig && audioConfig.context) + if (audioConfig.context) { audioConfig.context.resume(); @@ -89983,7 +95067,7 @@ var WebAudioSoundManager = new Class({ this.masterMuteNode.disconnect(); this.masterMuteNode = null; - if (this.game.config.audio && this.game.config.audio.context) + if (this.game.config.audio.context) { this.context.suspend(); } @@ -90086,7 +95170,7 @@ module.exports = WebAudioSoundManager; /***/ }), -/* 400 */ +/* 410 */ /***/ (function(module, exports) { /** @@ -90161,7 +95245,7 @@ module.exports = Base64ToArrayBuffer; /***/ }), -/* 401 */ +/* 411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -90171,9 +95255,9 @@ module.exports = Base64ToArrayBuffer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseSound = __webpack_require__(136); +var BaseSound = __webpack_require__(142); var Class = __webpack_require__(0); -var Events = __webpack_require__(61); +var Events = __webpack_require__(66); /** * @classdesc @@ -91067,7 +96151,7 @@ module.exports = WebAudioSound; /***/ }), -/* 402 */ +/* 412 */ /***/ (function(module, exports) { /** @@ -91081,12 +96165,26 @@ module.exports = WebAudioSound; * * The transpose of a matrix is a new matrix whose rows are the columns of the original. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.TransposeMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [array,$return] - * + * * @param {T[][]} [array] - The array matrix to transpose. * * @return {T[][]} A new array matrix which is a transposed version of the given array. @@ -91115,7 +96213,7 @@ module.exports = TransposeMatrix; /***/ }), -/* 403 */ +/* 413 */ /***/ (function(module, exports) { /** @@ -91156,9 +96254,9 @@ function defaultCompare (a, b) * @since 3.0.0 * * @param {array} arr - The array to sort. - * @param {integer} k - The k-th element index. - * @param {integer} [left=0] - The index of the left part of the range. - * @param {integer} [right] - The index of the right part of the range. + * @param {number} k - The k-th element index. + * @param {number} [left=0] - The index of the left part of the range. + * @param {number} [right] - The index of the right part of the range. * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. */ var QuickSelect = function (arr, k, left, right, compare) @@ -91237,7 +96335,7 @@ module.exports = QuickSelect; /***/ }), -/* 404 */ +/* 414 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91247,7 +96345,7 @@ module.exports = QuickSelect; */ var GetValue = __webpack_require__(6); -var Shuffle = __webpack_require__(121); +var Shuffle = __webpack_require__(127); var BuildChunk = function (a, b, qty) { @@ -91375,7 +96473,7 @@ module.exports = Range; /***/ }), -/* 405 */ +/* 415 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91390,14 +96488,14 @@ module.exports = Range; module.exports = { - PROCESS_QUEUE_ADD: __webpack_require__(967), - PROCESS_QUEUE_REMOVE: __webpack_require__(968) + PROCESS_QUEUE_ADD: __webpack_require__(1024), + PROCESS_QUEUE_REMOVE: __webpack_require__(1025) }; /***/ }), -/* 406 */ +/* 416 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91437,7 +96535,7 @@ var BuildGameObjectAnimation = function (sprite, config) { // { anims: { // key: string - // startFrame: [string|integer] + // startFrame: [string|number] // delay: [float] // repeat: [integer] // repeatDelay: [float] @@ -91494,7 +96592,7 @@ module.exports = BuildGameObjectAnimation; /***/ }), -/* 407 */ +/* 417 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91504,7 +96602,7 @@ module.exports = BuildGameObjectAnimation; */ var Class = __webpack_require__(0); -var Frame = __webpack_require__(97); +var Frame = __webpack_require__(104); /** * @classdesc @@ -91530,7 +96628,7 @@ var Frame = __webpack_require__(97); * @param {Phaser.GameObjects.Blitter} blitter - The parent Blitter object is responsible for updating this Bob. * @param {number} x - The horizontal position of this Game Object in the world, relative to the parent Blitter position. * @param {number} y - The vertical position of this Game Object in the world, relative to the parent Blitter position. - * @param {(string|integer)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. + * @param {(string|number)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. * @param {boolean} visible - Should the Bob render visible or not to start with? */ var Bob = new Class({ @@ -91649,7 +96747,7 @@ var Bob = new Class({ * @method Phaser.GameObjects.Bob#setFrame * @since 3.0.0 * - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering. * * @return {this} This Bob Game Object. */ @@ -91699,7 +96797,7 @@ var Bob = new Class({ * * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. * * @return {this} This Bob Game Object. */ @@ -91798,7 +96896,7 @@ var Bob = new Class({ /** * Sets the visibility of this Bob. - * + * * An invisible Bob will skip rendering. * * @method Phaser.GameObjects.Bob#setVisible @@ -91818,7 +96916,7 @@ var Bob = new Class({ /** * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * A Bob with alpha 0 will skip rendering. * * @method Phaser.GameObjects.Bob#setAlpha @@ -91872,7 +96970,7 @@ var Bob = new Class({ /** * The visible state of the Bob. - * + * * An invisible Bob will skip rendering. * * @name Phaser.GameObjects.Bob#visible @@ -91896,7 +96994,7 @@ var Bob = new Class({ /** * The alpha value of the Bob, between 0 and 1. - * + * * A Bob with alpha 0 will skip rendering. * * @name Phaser.GameObjects.Bob#alpha @@ -91924,7 +97022,7 @@ module.exports = Bob; /***/ }), -/* 408 */ +/* 418 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91966,7 +97064,7 @@ module.exports = Union; /***/ }), -/* 409 */ +/* 419 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -91977,13 +97075,13 @@ module.exports = Union; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DOMElementRender = __webpack_require__(981); +var DOMElementRender = __webpack_require__(1038); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); +var GameObjectEvents = __webpack_require__(32); var IsPlainObject = __webpack_require__(7); -var RemoveFromDOM = __webpack_require__(188); +var RemoveFromDOM = __webpack_require__(193); var SCENE_EVENTS = __webpack_require__(20); -var Vector4 = __webpack_require__(129); +var Vector4 = __webpack_require__(135); /** * @classdesc @@ -92962,7 +98060,7 @@ module.exports = DOMElement; /***/ }), -/* 410 */ +/* 420 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -92971,8 +98069,13 @@ module.exports = DOMElement; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CSSBlendModes = __webpack_require__(982); +var CSSBlendModes = __webpack_require__(1039); var GameObject = __webpack_require__(14); +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -92985,11 +98088,10 @@ var GameObject = __webpack_require__(14); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active renderer. * @param {Phaser.GameObjects.DOMElement} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var DOMElementCSSRenderer = function (renderer, src, camera, parentMatrix) { var node = src.node; var style = node.style; @@ -93001,7 +98103,7 @@ var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, ca { style.display = 'none'; } - + return; } @@ -93013,9 +98115,9 @@ var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, ca alpha *= parent.alpha; } - var camMatrix = renderer._tempMatrix1; - var srcMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var camMatrix = tempMatrix1; + var srcMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; var dx = 0; var dy = 0; @@ -93046,9 +98148,9 @@ var DOMElementCSSRenderer = function (renderer, src, interpolationPercentage, ca { dx = (src.width) * src.originX; dy = (src.height) * src.originY; - + srcMatrix.applyITRS(src.x - dx, src.y - dy, src.rotation, src.scaleX, src.scaleY); - + camMatrix.copyFrom(camera.matrix); tx = (100 * src.originX) + '%'; @@ -93084,7 +98186,7 @@ module.exports = DOMElementCSSRenderer; /***/ }), -/* 411 */ +/* 421 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93096,8 +98198,8 @@ module.exports = DOMElementCSSRenderer; var Class = __webpack_require__(0); var Components = __webpack_require__(11); var GameObject = __webpack_require__(14); -var GameObjectEvents = __webpack_require__(29); -var ExternRender = __webpack_require__(986); +var GameObjectEvents = __webpack_require__(32); +var ExternRender = __webpack_require__(1043); /** * @classdesc @@ -93196,7 +98298,7 @@ module.exports = Extern; /***/ }), -/* 412 */ +/* 422 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93205,8 +98307,8 @@ module.exports = Extern; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircumferencePoint = __webpack_require__(204); -var FromPercent = __webpack_require__(89); +var CircumferencePoint = __webpack_require__(209); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); var Point = __webpack_require__(4); @@ -93239,7 +98341,7 @@ module.exports = GetPoint; /***/ }), -/* 413 */ +/* 423 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93248,9 +98350,9 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circumference = __webpack_require__(414); -var CircumferencePoint = __webpack_require__(204); -var FromPercent = __webpack_require__(89); +var Circumference = __webpack_require__(424); +var CircumferencePoint = __webpack_require__(209); +var FromPercent = __webpack_require__(94); var MATH_CONST = __webpack_require__(13); /** @@ -93263,7 +98365,7 @@ var MATH_CONST = __webpack_require__(13); * @generic {Phaser.Geom.Point[]} O - [out,$return] * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [out] - An array to insert the points in to. If not provided a new array will be created. * @@ -93293,7 +98395,7 @@ module.exports = GetPoints; /***/ }), -/* 414 */ +/* 424 */ /***/ (function(module, exports) { /** @@ -93325,7 +98427,7 @@ module.exports = Circumference; /***/ }), -/* 415 */ +/* 425 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93334,8 +98436,8 @@ module.exports = Circumference; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(203); -var SetTransform = __webpack_require__(28); +var Commands = __webpack_require__(208); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -93348,13 +98450,12 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested * @param {CanvasRenderingContext2D} [renderTargetCtx] - The target rendering context. * @param {boolean} allowClip - If `true` then path operations will be used instead of fill operations. */ -var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix, renderTargetCtx, allowClip) +var GraphicsCanvasRenderer = function (renderer, src, camera, parentMatrix, renderTargetCtx, allowClip) { var commandBuffer = src.commandBuffer; var commandBufferLength = commandBuffer.length; @@ -93560,10 +98661,6 @@ var GraphicsCanvasRenderer = function (renderer, src, interpolationPercentage, c case Commands.GRADIENT_LINE_STYLE: index += 6; break; - - case Commands.SET_TEXTURE: - index += 2; - break; } } @@ -93575,7 +98672,7 @@ module.exports = GraphicsCanvasRenderer; /***/ }), -/* 416 */ +/* 426 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -93585,10 +98682,10 @@ module.exports = GraphicsCanvasRenderer; */ var Class = __webpack_require__(0); -var FloatBetween = __webpack_require__(127); -var GetEaseFunction = __webpack_require__(71); +var FloatBetween = __webpack_require__(132); +var GetEaseFunction = __webpack_require__(78); var GetFastValue = __webpack_require__(2); -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * @classdesc @@ -93814,6 +98911,10 @@ var EmitterOp = new Class({ var t = typeof value; + // Reset them in case they're not changed below + this.onEmit = this.defaultEmit; + this.onUpdate = this.defaultUpdate; + if (t === 'number') { // Explicit static value: @@ -93850,28 +98951,17 @@ var EmitterOp = new Class({ this.onUpdate = value; } } - else if (t === 'object' && (this.has(value, 'random') || this.hasBoth(value, 'start', 'end') || this.hasBoth(value, 'min', 'max'))) + else if (t === 'object' && this.hasBoth(value, 'start', 'end')) { - this.start = this.has(value, 'start') ? value.start : value.min; - this.end = this.has(value, 'end') ? value.end : value.max; + this.start = value.start; + this.end = value.end; - var isRandom = (this.hasBoth(value, 'min', 'max') || !!value.random); + // x: { start: 100, end: 400, random: true } (random optional) = eases between start and end - // A random starting value (using 'min | max' instead of 'start | end' automatically implies a random value) - - // x: { start: 100, end: 400, random: true } OR { min: 100, max: 400 } OR { random: [ 100, 400 ] } + var isRandom = this.has(value, 'random'); if (isRandom) { - var rnd = value.random; - - // x: { random: [ 100, 400 ] } = the same as doing: x: { start: 100, end: 400, random: true } - if (Array.isArray(rnd)) - { - this.start = rnd[0]; - this.end = rnd[1]; - } - this.onEmit = this.randomRangedValueEmit; } @@ -93896,19 +98986,38 @@ var EmitterOp = new Class({ var easeType = this.has(value, 'ease') ? value.ease : 'Linear'; - this.ease = GetEaseFunction(easeType); + this.ease = GetEaseFunction(easeType, value.easeParams); if (!isRandom) { this.onEmit = this.easedValueEmit; } - // BUG: alpha, rotate, scaleX, scaleY, or tint are eased here if {min, max} is given. - // Probably this branch should exclude isRandom entirely. - this.onUpdate = this.easeValueUpdate; } } + else if (t === 'object' && this.hasBoth(value, 'min', 'max')) + { + // { min: 100, max: 400 } = pick a random number between min and max + + this.start = value.min; + this.end = value.max; + this.onEmit = this.randomRangedValueEmit; + } + else if (t === 'object' && this.has(value, 'random')) + { + // { random: [ 100, 400 ] } = pick a random number between the two elements of the array + + var rnd = value.random; + + if (Array.isArray(rnd)) + { + this.start = rnd[0]; + this.end = rnd[1]; + } + + this.onEmit = this.randomRangedValueEmit; + } else if (t === 'object' && this.hasEither(value, 'onEmit', 'onUpdate')) { // Custom onEmit and onUpdate callbacks @@ -94166,7 +99275,7 @@ module.exports = EmitterOp; /***/ }), -/* 417 */ +/* 427 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94385,7 +99494,7 @@ module.exports = GravityWell; /***/ }), -/* 418 */ +/* 428 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94395,8 +99504,8 @@ module.exports = GravityWell; */ var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var DistanceBetween = __webpack_require__(55); +var DegToRad = __webpack_require__(34); +var DistanceBetween = __webpack_require__(61); /** * @classdesc @@ -94581,7 +99690,7 @@ var Particle = new Class({ * The tint applied to this Particle. * * @name Phaser.GameObjects.Particles.Particle#tint - * @type {integer} + * @type {number} * @webglOnly * @since 3.0.0 */ @@ -94691,11 +99800,6 @@ var Particle = new Class({ if (x === undefined) { - if (emitter.follow) - { - this.x += emitter.follow.x + emitter.followOffset.x; - } - this.x += emitter.x.onEmit(this, 'x'); } else @@ -94705,11 +99809,6 @@ var Particle = new Class({ if (y === undefined) { - if (emitter.follow) - { - this.y += emitter.follow.y + emitter.followOffset.y; - } - this.y += emitter.y.onEmit(this, 'y'); } else @@ -94954,7 +100053,7 @@ module.exports = Particle; /***/ }), -/* 419 */ +/* 429 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -94963,22 +100062,22 @@ module.exports = Particle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(54); +var BlendModes = __webpack_require__(48); var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DeathZone = __webpack_require__(420); -var EdgeZone = __webpack_require__(421); -var EmitterOp = __webpack_require__(416); +var DeathZone = __webpack_require__(430); +var EdgeZone = __webpack_require__(431); +var EmitterOp = __webpack_require__(426); var GetFastValue = __webpack_require__(2); -var GetRandom = __webpack_require__(196); -var HasAny = __webpack_require__(422); -var HasValue = __webpack_require__(115); -var Particle = __webpack_require__(418); -var RandomZone = __webpack_require__(423); +var GetRandom = __webpack_require__(201); +var HasAny = __webpack_require__(432); +var HasValue = __webpack_require__(123); +var Particle = __webpack_require__(428); +var RandomZone = __webpack_require__(433); var Rectangle = __webpack_require__(9); -var StableSort = __webpack_require__(139); +var StableSort = __webpack_require__(90); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * @classdesc @@ -95326,14 +100425,14 @@ var ParticleEmitter = new Class({ this.scaleY = new EmitterOp(config, 'scaleY', 1); /** - * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored. + * Color tint applied to emitted particles. Value must not include the alpha channel. * * @name Phaser.GameObjects.Particles.ParticleEmitter#tint * @type {Phaser.GameObjects.Particles.EmitterOp} - * @default 0xffffffff + * @default 0xffffff * @since 3.0.0 */ - this.tint = new EmitterOp(config, 'tint', 0xffffffff); + this.tint = new EmitterOp(config, 'tint', 0xffffff); /** * The alpha (transparency) of emitted particles. @@ -95423,7 +100522,7 @@ var ParticleEmitter = new Class({ * 0 means unlimited. * * @name Phaser.GameObjects.Particles.ParticleEmitter#maxParticles - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -95600,7 +100699,7 @@ var ParticleEmitter = new Class({ * The blend mode of this emitter's particles. * * @name Phaser.GameObjects.Particles.ParticleEmitter#blendMode - * @type {integer} + * @type {number} * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setBlendMode */ @@ -95644,7 +100743,7 @@ var ParticleEmitter = new Class({ * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. * * @name Phaser.GameObjects.Particles.ParticleEmitter#currentFrame - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame @@ -95666,7 +100765,7 @@ var ParticleEmitter = new Class({ * The number of consecutive particles that receive a single texture frame (per frame cycle). * * @name Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity - * @type {integer} + * @type {number} * @default 1 * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame @@ -95708,7 +100807,7 @@ var ParticleEmitter = new Class({ * Counts up to {@link Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity}. * * @name Phaser.GameObjects.Particles.ParticleEmitter#_frameCounter - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -95822,6 +100921,11 @@ var ParticleEmitter = new Class({ this.setFrame(config.frame); } + if (HasValue(config, 'reserve')) + { + this.reserve(config.reserve); + } + return this; }, @@ -95964,9 +101068,9 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrame * @since 3.0.0 * - * @param {(array|string|integer|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object. + * @param {(array|string|number|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object. * @param {boolean} [pickRandom=true] - Whether frames should be assigned at random from `frames`. - * @param {integer} [quantity=1] - The number of consecutive particles that will receive each frame. + * @param {number} [quantity=1] - The number of consecutive particles that will receive each frame. * * @return {this} This Particle Emitter. */ @@ -96488,7 +101592,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#reserve * @since 3.0.0 * - * @param {integer} particleCount - The number of particles to create. + * @param {number} particleCount - The number of particles to create. * * @return {this} This Particle Emitter. */ @@ -96510,7 +101614,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getAliveParticleCount * @since 3.0.0 * - * @return {integer} The number of particles with `active=true`. + * @return {number} The number of particles with `active=true`. */ getAliveParticleCount: function () { @@ -96523,7 +101627,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getDeadParticleCount * @since 3.0.0 * - * @return {integer} The number of particles with `active=false`. + * @return {number} The number of particles with `active=false`. */ getDeadParticleCount: function () { @@ -96536,7 +101640,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getParticleCount * @since 3.0.0 * - * @return {integer} The number of particles, including both alive and dead. + * @return {number} The number of particles, including both alive and dead. */ getParticleCount: function () { @@ -96818,7 +101922,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#explode * @since 3.0.0 * - * @param {integer} count - The amount of Particles to emit. + * @param {number} count - The amount of Particles to emit. * @param {number} x - The x coordinate to emit the Particles from. * @param {number} y - The y coordinate to emit the Particles from. * @@ -96839,7 +101943,7 @@ var ParticleEmitter = new Class({ * * @param {number} [x=this.x] - The x coordinate to emit the Particles from. * @param {number} [y=this.x] - The y coordinate to emit the Particles from. - * @param {integer} [count=this.quantity] - The number of Particles to emit. + * @param {number} [count=this.quantity] - The number of Particles to emit. * * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. */ @@ -96854,7 +101958,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#emitParticle * @since 3.0.0 * - * @param {integer} [count=this.quantity] - The number of Particles to emit. + * @param {number} [count=this.quantity] - The number of Particles to emit. * @param {number} [x=this.x] - The x coordinate to emit the Particles from. * @param {number} [y=this.x] - The y coordinate to emit the Particles from. * @@ -96916,7 +102020,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#preUpdate * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) @@ -97012,7 +102116,7 @@ var ParticleEmitter = new Class({ * @param {object} a - The first particle. * @param {object} b - The second particle. * - * @return {integer} The difference of a and b's y coordinates. + * @return {number} The difference of a and b's y coordinates. */ depthSortCallback: function (a, b) { @@ -97025,7 +102129,7 @@ module.exports = ParticleEmitter; /***/ }), -/* 420 */ +/* 430 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97103,7 +102207,7 @@ module.exports = DeathZone; /***/ }), -/* 421 */ +/* 431 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97124,7 +102228,7 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. - * @param {integer} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * @param {number} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * @param {number} stepRate - The distance between each particle. When set, `quantity` is implied and should be set to 0. * @param {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start. * @param {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other. @@ -97161,7 +102265,7 @@ var EdgeZone = new Class({ * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * * @name Phaser.GameObjects.Particles.Zones.EdgeZone#quantity - * @type {integer} + * @type {number} * @since 3.0.0 */ this.quantity = quantity; @@ -97347,7 +102451,7 @@ module.exports = EdgeZone; /***/ }), -/* 422 */ +/* 432 */ /***/ (function(module, exports) { /** @@ -97384,7 +102488,7 @@ module.exports = HasAny; /***/ }), -/* 423 */ +/* 433 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97398,7 +102502,7 @@ var Vector2 = __webpack_require__(3); /** * @classdesc - * A zone that places particles randomly within a shape's area. + * A zone that places particles randomly within a shapes area. * * @class RandomZone * @memberof Phaser.GameObjects.Particles.Zones @@ -97457,7 +102561,7 @@ module.exports = RandomZone; /***/ }), -/* 424 */ +/* 434 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97468,7 +102572,7 @@ module.exports = RandomZone; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var Sprite = __webpack_require__(76); +var Sprite = __webpack_require__(70); /** * @classdesc @@ -97496,7 +102600,7 @@ var Sprite = __webpack_require__(76); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var PathFollower = new Class({ @@ -97524,7 +102628,7 @@ var PathFollower = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) @@ -97539,7 +102643,7 @@ module.exports = PathFollower; /***/ }), -/* 425 */ +/* 435 */ /***/ (function(module, exports) { /** @@ -97621,7 +102725,7 @@ module.exports = GetTextSize; /***/ }), -/* 426 */ +/* 436 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -97633,7 +102737,7 @@ module.exports = GetTextSize; var Class = __webpack_require__(0); var GetAdvancedValue = __webpack_require__(15); var GetValue = __webpack_require__(6); -var MeasureText = __webpack_require__(427); +var MeasureText = __webpack_require__(437); // Key: [ Object Key, Default Value ] @@ -97839,7 +102943,7 @@ var TextStyle = new Class({ * The maximum number of lines to draw. * * @name Phaser.GameObjects.TextStyle#maxLines - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -98656,7 +103760,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.TextStyle#setMaxLines * @since 3.0.0 * - * @param {integer} [max=0] - The maximum number of lines to draw. + * @param {number} [max=0] - The maximum number of lines to draw. * * @return {Phaser.GameObjects.Text} The parent Text object. */ @@ -98727,7 +103831,7 @@ module.exports = TextStyle; /***/ }), -/* 427 */ +/* 437 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98736,7 +103840,7 @@ module.exports = TextStyle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); +var CanvasPool = __webpack_require__(31); /** * Calculates the ascent, descent and fontSize of a given font style. @@ -98750,15 +103854,28 @@ var CanvasPool = __webpack_require__(26); */ var MeasureText = function (textStyle) { - // @property {HTMLCanvasElement} canvas - The canvas element that the text is rendered. var canvas = CanvasPool.create(this); - - // @property {HTMLCanvasElement} context - The context of the canvas element that the text is rendered to. var context = canvas.getContext('2d'); textStyle.syncFont(canvas, context); - var width = Math.ceil(context.measureText(textStyle.testString).width * textStyle.baselineX); + var metrics = context.measureText(textStyle.testString); + + if (metrics.hasOwnProperty('actualBoundingBoxAscent')) + { + var ascent = metrics.actualBoundingBoxAscent; + var descent = metrics.actualBoundingBoxDescent; + + CanvasPool.remove(canvas); + + return { + ascent: ascent, + descent: descent, + fontSize: ascent + descent + }; + } + + var width = Math.ceil(metrics.width * textStyle.baselineX); var baseline = width; var height = 2 * baseline; @@ -98862,7 +103979,7 @@ module.exports = MeasureText; /***/ }), -/* 428 */ +/* 438 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -98871,13 +103988,13 @@ module.exports = MeasureText; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcRender = __webpack_require__(1020); +var ArcRender = __webpack_require__(1080); var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var Earcut = __webpack_require__(60); -var GeomCircle = __webpack_require__(68); +var DegToRad = __webpack_require__(34); +var Earcut = __webpack_require__(65); +var GeomCircle = __webpack_require__(71); var MATH_CONST = __webpack_require__(13); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(33); /** * @classdesc @@ -98907,8 +104024,8 @@ var Shape = __webpack_require__(30); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {number} [radius=128] - The radius of the arc. - * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. - * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {number} [startAngle=0] - The start angle of the arc, in degrees. + * @param {number} [endAngle=360] - The end angle of the arc, in degrees. * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. @@ -98938,7 +104055,7 @@ var Arc = new Class({ * Private internal value. Holds the start angle in degrees. * * @name Phaser.GameObjects.Arc#_startAngle - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -98948,7 +104065,7 @@ var Arc = new Class({ * Private internal value. Holds the end angle in degrees. * * @name Phaser.GameObjects.Arc#_endAngle - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -99045,7 +104162,7 @@ var Arc = new Class({ * The start angle of the arc, in degrees. * * @name Phaser.GameObjects.Arc#startAngle - * @type {integer} + * @type {number} * @since 3.13.0 */ startAngle: { @@ -99068,7 +104185,7 @@ var Arc = new Class({ * The end angle of the arc, in degrees. * * @name Phaser.GameObjects.Arc#endAngle - * @type {integer} + * @type {number} * @since 3.13.0 */ endAngle: { @@ -99157,7 +104274,7 @@ var Arc = new Class({ * @method Phaser.GameObjects.Arc#setStartAngle * @since 3.13.0 * - * @param {integer} value - The value to set the starting angle to. + * @param {number} value - The value to set the starting angle to. * * @return {this} This Game Object instance. */ @@ -99180,7 +104297,7 @@ var Arc = new Class({ * @method Phaser.GameObjects.Arc#setEndAngle * @since 3.13.0 * - * @param {integer} value - The value to set the ending angle to. + * @param {number} value - The value to set the ending angle to. * * @return {this} This Game Object instance. */ @@ -99271,7 +104388,7 @@ module.exports = Arc; /***/ }), -/* 429 */ +/* 439 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99281,10 +104398,10 @@ module.exports = Arc; */ var Class = __webpack_require__(0); -var CurveRender = __webpack_require__(1023); -var Earcut = __webpack_require__(60); +var CurveRender = __webpack_require__(1083); +var Earcut = __webpack_require__(65); var Rectangle = __webpack_require__(9); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(33); /** * @classdesc @@ -99338,7 +104455,7 @@ var Curve = new Class({ * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. * * @name Phaser.GameObjects.Curve#_smoothness - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -99372,7 +104489,7 @@ var Curve = new Class({ * Increase this value for smoother curves, at the cost of more polygons being rendered. * * @name Phaser.GameObjects.Curve#smoothness - * @type {integer} + * @type {number} * @default 32 * @since 3.13.0 */ @@ -99400,7 +104517,7 @@ var Curve = new Class({ * @method Phaser.GameObjects.Curve#setSmoothness * @since 3.13.0 * - * @param {integer} value - The value to set the smoothness to. + * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. */ @@ -99453,7 +104570,7 @@ module.exports = Curve; /***/ }), -/* 430 */ +/* 440 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99463,10 +104580,10 @@ module.exports = Curve; */ var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var EllipseRender = __webpack_require__(1026); -var GeomEllipse = __webpack_require__(98); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(65); +var EllipseRender = __webpack_require__(1086); +var GeomEllipse = __webpack_require__(106); +var Shape = __webpack_require__(33); /** * @classdesc @@ -99524,7 +104641,7 @@ var Ellipse = new Class({ * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. * * @name Phaser.GameObjects.Ellipse#_smoothness - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -99549,7 +104666,7 @@ var Ellipse = new Class({ * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. * * @name Phaser.GameObjects.Ellipse#smoothness - * @type {integer} + * @type {number} * @default 64 * @since 3.13.0 */ @@ -99583,6 +104700,9 @@ var Ellipse = new Class({ */ setSize: function (width, height) { + this.width = width; + this.height = height; + this.geom.setPosition(width / 2, height / 2); this.geom.setSize(width, height); return this.updateData(); @@ -99596,7 +104716,7 @@ var Ellipse = new Class({ * @method Phaser.GameObjects.Ellipse#setSmoothness * @since 3.13.0 * - * @param {integer} value - The value to set the smoothness to. + * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. */ @@ -99640,7 +104760,7 @@ module.exports = Ellipse; /***/ }), -/* 431 */ +/* 441 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99650,8 +104770,8 @@ module.exports = Ellipse; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GridRender = __webpack_require__(1029); +var Shape = __webpack_require__(33); +var GridRender = __webpack_require__(1089); /** * @classdesc @@ -99797,7 +104917,11 @@ var Grid = new Class({ this.setSize(width, height); this.setFillStyle(fillColor, fillAlpha); - this.setOutlineStyle(outlineFillColor, outlineFillAlpha); + + if (outlineFillColor !== undefined) + { + this.setOutlineStyle(outlineFillColor, outlineFillAlpha); + } this.updateDisplayOrigin(); }, @@ -99915,7 +105039,7 @@ module.exports = Grid; /***/ }), -/* 432 */ +/* 442 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -99924,9 +105048,9 @@ module.exports = Grid; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsoBoxRender = __webpack_require__(1032); +var IsoBoxRender = __webpack_require__(1092); var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); +var Shape = __webpack_require__(33); /** * @classdesc @@ -99985,7 +105109,7 @@ var IsoBox = new Class({ * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. * * @name Phaser.GameObjects.IsoBox#projection - * @type {integer} + * @type {number} * @default 4 * @since 3.13.0 */ @@ -100063,7 +105187,7 @@ var IsoBox = new Class({ * @method Phaser.GameObjects.IsoBox#setProjection * @since 3.13.0 * - * @param {integer} value - The value to set the projection to. + * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. */ @@ -100130,7 +105254,7 @@ module.exports = IsoBox; /***/ }), -/* 433 */ +/* 443 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100140,8 +105264,8 @@ module.exports = IsoBox; */ var Class = __webpack_require__(0); -var IsoTriangleRender = __webpack_require__(1035); -var Shape = __webpack_require__(30); +var IsoTriangleRender = __webpack_require__(1095); +var Shape = __webpack_require__(33); /** * @classdesc @@ -100203,7 +105327,7 @@ var IsoTriangle = new Class({ * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. * * @name Phaser.GameObjects.IsoTriangle#projection - * @type {integer} + * @type {number} * @default 4 * @since 3.13.0 */ @@ -100291,7 +105415,7 @@ var IsoTriangle = new Class({ * @method Phaser.GameObjects.IsoTriangle#setProjection * @since 3.13.0 * - * @param {integer} value - The value to set the projection to. + * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. */ @@ -100376,7 +105500,7 @@ module.exports = IsoTriangle; /***/ }), -/* 434 */ +/* 444 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100386,9 +105510,9 @@ module.exports = IsoTriangle; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomLine = __webpack_require__(40); -var LineRender = __webpack_require__(1038); +var Shape = __webpack_require__(33); +var GeomLine = __webpack_require__(45); +var LineRender = __webpack_require__(1098); /** * @classdesc @@ -100396,13 +105520,13 @@ var LineRender = __webpack_require__(1038); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only stroke colors and cannot be filled. - * + * * A Line Shape allows you to draw a line between two points in your game. You can control the * stroke color and thickness of the line. In WebGL only you can also specify a different * thickness for the start and end of the line, allowing you to render lines that taper-off. - * + * * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. * * Be aware that as with all Game Objects the default origin is 0.5. If you need to draw a Line @@ -100445,8 +105569,8 @@ var Line = new Class({ Shape.call(this, scene, 'Line', new GeomLine(x1, y1, x2, y2)); - var width = this.geom.right - this.geom.left; - var height = this.geom.bottom - this.geom.top; + var width = Math.max(1, this.geom.right - this.geom.left); + var height = Math.max(1, this.geom.bottom - this.geom.top); /** * The width (or thickness) of the line. @@ -100491,15 +105615,15 @@ var Line = new Class({ /** * Sets the width of the line. - * + * * When using the WebGL renderer you can have different start and end widths. * When using the Canvas renderer only the `startWidth` value is used. The `endWidth` is ignored. - * + * * This call can be chained. * * @method Phaser.GameObjects.Line#setLineWidth * @since 3.13.0 - * + * * @param {number} startWidth - The start width of the line. * @param {number} [endWidth] - The end width of the line. Only used in WebGL. * @@ -100543,7 +105667,7 @@ module.exports = Line; /***/ }), -/* 435 */ +/* 445 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100552,13 +105676,13 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PolygonRender = __webpack_require__(1041); +var PolygonRender = __webpack_require__(1101); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var GetAABB = __webpack_require__(436); -var GeomPolygon = __webpack_require__(212); -var Shape = __webpack_require__(30); -var Smooth = __webpack_require__(439); +var Earcut = __webpack_require__(65); +var GetAABB = __webpack_require__(446); +var GeomPolygon = __webpack_require__(218); +var Shape = __webpack_require__(33); +var Smooth = __webpack_require__(449); /** * @classdesc @@ -100633,7 +105757,7 @@ var Polygon = new Class({ * @method Phaser.GameObjects.Polygon#smooth * @since 3.13.0 * - * @param {integer} [iterations=1] - The number of times to apply the polygon smoothing. + * @param {number} [iterations=1] - The number of times to apply the polygon smoothing. * * @return {this} This Game Object instance. */ @@ -100682,7 +105806,7 @@ module.exports = Polygon; /***/ }), -/* 436 */ +/* 446 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100738,7 +105862,7 @@ module.exports = GetAABB; /***/ }), -/* 437 */ +/* 447 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100747,9 +105871,9 @@ module.exports = GetAABB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); -var Line = __webpack_require__(40); -var Perimeter = __webpack_require__(438); +var Length = __webpack_require__(63); +var Line = __webpack_require__(45); +var Perimeter = __webpack_require__(448); /** * Returns an array of Point objects containing the coordinates of the points around the perimeter of the Polygon, @@ -100759,7 +105883,7 @@ var Perimeter = __webpack_require__(438); * @since 3.12.0 * * @param {Phaser.Geom.Polygon} polygon - The Polygon to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. * @@ -100815,7 +105939,7 @@ module.exports = GetPoints; /***/ }), -/* 438 */ +/* 448 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100824,8 +105948,8 @@ module.exports = GetPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); -var Line = __webpack_require__(40); +var Length = __webpack_require__(63); +var Line = __webpack_require__(45); /** * Returns the perimeter of the given Polygon. @@ -100863,7 +105987,7 @@ module.exports = Perimeter; /***/ }), -/* 439 */ +/* 449 */ /***/ (function(module, exports) { /** @@ -100939,7 +106063,7 @@ module.exports = Smooth; /***/ }), -/* 440 */ +/* 450 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -100950,8 +106074,8 @@ module.exports = Smooth; var Class = __webpack_require__(0); var GeomRectangle = __webpack_require__(9); -var Shape = __webpack_require__(30); -var RectangleRender = __webpack_require__(1044); +var Shape = __webpack_require__(33); +var RectangleRender = __webpack_require__(1104); /** * @classdesc @@ -101082,7 +106206,7 @@ module.exports = Rectangle; /***/ }), -/* 441 */ +/* 451 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101091,10 +106215,10 @@ module.exports = Rectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StarRender = __webpack_require__(1047); +var StarRender = __webpack_require__(1107); var Class = __webpack_require__(0); -var Earcut = __webpack_require__(60); -var Shape = __webpack_require__(30); +var Earcut = __webpack_require__(65); +var Shape = __webpack_require__(33); /** * @classdesc @@ -101153,7 +106277,7 @@ var Star = new Class({ * The number of points in the star. * * @name Phaser.GameObjects.Star#_points - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -101200,7 +106324,7 @@ var Star = new Class({ * @method Phaser.GameObjects.Star#setPoints * @since 3.13.0 * - * @param {integer} value - The amount of points the Star will have. + * @param {number} value - The amount of points the Star will have. * * @return {this} This Game Object instance. */ @@ -101251,7 +106375,7 @@ var Star = new Class({ * The number of points that make up the Star shape. * * @name Phaser.GameObjects.Star#points - * @type {integer} + * @type {number} * @default 5 * @since 3.13.0 */ @@ -101370,7 +106494,7 @@ module.exports = Star; /***/ }), -/* 442 */ +/* 452 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101380,9 +106504,9 @@ module.exports = Star; */ var Class = __webpack_require__(0); -var Shape = __webpack_require__(30); -var GeomTriangle = __webpack_require__(73); -var TriangleRender = __webpack_require__(1050); +var Shape = __webpack_require__(33); +var GeomTriangle = __webpack_require__(80); +var TriangleRender = __webpack_require__(1110); /** * @classdesc @@ -101513,7 +106637,7 @@ module.exports = Triangle; /***/ }), -/* 443 */ +/* 453 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101523,7 +106647,7 @@ module.exports = Triangle; */ var Point = __webpack_require__(4); -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); /** * Returns a Point from around the perimeter of a Triangle. @@ -101600,7 +106724,7 @@ module.exports = GetPoint; /***/ }), -/* 444 */ +/* 454 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101609,7 +106733,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); var Point = __webpack_require__(4); /** @@ -101621,7 +106745,7 @@ var Point = __webpack_require__(4); * @generic {Phaser.Geom.Point} O - [out,$return] * * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from. - * @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param {number} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. * @param {number} stepRate - If `quantity` is 0, the distance between each returned point. * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended. * @@ -101693,7 +106817,7 @@ module.exports = GetPoints; /***/ }), -/* 445 */ +/* 455 */ /***/ (function(module, exports) { /** @@ -101776,7 +106900,342 @@ module.exports = SetValue; /***/ }), -/* 446 */ +/* 456 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = __webpack_require__(111); +var Vertex = __webpack_require__(113); + +/** + * Generates a set of Face and Vertex objects by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * GenerateVerts(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * + * @function Phaser.Geom.Mesh.GenerateVerts + * @since 3.50.0 + * + * @param {number[]} vertices - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} uvs - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * + * @return {Phaser.Types.Geom.Mesh.GenerateVertsResult} The parsed Face and Vertex objects. + */ +var GenerateVerts = function (vertices, uvs, indicies, containsZ, normals, colors, alphas) +{ + if (containsZ === undefined) { containsZ = false; } + if (colors === undefined) { colors = 0xffffff; } + if (alphas === undefined) { alphas = 1; } + + if (vertices.length !== uvs.length) + { + console.warn('GenerateVerts: vertices and uvs count not equal'); + return; + } + + var result = { + faces: [], + verts: [] + }; + + var i; + + var x; + var y; + var z; + + var u; + var v; + + var color; + var alpha; + + var normalX; + var normalY; + var normalZ; + + var iInc = (containsZ) ? 3 : 2; + + var isColorArray = Array.isArray(colors); + var isAlphaArray = Array.isArray(alphas); + + if (Array.isArray(indicies) && indicies.length > 0) + { + for (i = 0; i < indicies.length; i++) + { + var index1 = indicies[i]; + var index2 = indicies[i] * 2; + var index3 = indicies[i] * iInc; + + x = vertices[index3]; + y = vertices[index3 + 1]; + z = (containsZ) ? vertices[index3 + 2] : 0; + + u = uvs[index2]; + v = uvs[index2 + 1]; + + color = (isColorArray) ? colors[index1] : colors; + alpha = (isAlphaArray) ? alphas[index1] : alphas; + + normalX = 0; + normalY = 0; + normalZ = 0; + + if (normals) + { + normalX = normals[index3]; + normalY = normals[index3 + 1]; + normalZ = (containsZ) ? normals[index3 + 2] : 0; + } + + result.verts.push(new Vertex(x, y, z, u, v, color, alpha, normalX, normalY, normalZ)); + } + } + else + { + var uvIndex = 0; + var colorIndex = 0; + + for (i = 0; i < vertices.length; i += iInc) + { + x = vertices[i]; + y = vertices[i + 1]; + z = (containsZ) ? vertices[i + 2] : 0; + + u = uvs[uvIndex]; + v = uvs[uvIndex + 1]; + + color = (isColorArray) ? colors[colorIndex] : colors; + alpha = (isAlphaArray) ? alphas[colorIndex] : alphas; + + normalX = 0; + normalY = 0; + normalZ = 0; + + if (normals) + { + normalX = normals[i]; + normalY = normals[i + 1]; + normalZ = (containsZ) ? normals[i + 2] : 0; + } + + result.verts.push(new Vertex(x, y, z, u, v, color, alpha, normalX, normalY, normalZ)); + + uvIndex += 2; + colorIndex++; + } + } + + for (i = 0; i < result.verts.length; i += 3) + { + var vert1 = result.verts[i]; + var vert2 = result.verts[i + 1]; + var vert3 = result.verts[i + 2]; + + result.faces.push(new Face(vert1, vert2, vert3)); + } + + return result; +}; + +module.exports = GenerateVerts; + + +/***/ }), +/* 457 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = __webpack_require__(111); +var Matrix4 = __webpack_require__(73); +var Vector3 = __webpack_require__(37); +var Vertex = __webpack_require__(113); + +var tempPosition = new Vector3(); +var tempRotation = new Vector3(); +var tempMatrix = new Matrix4(); + +/** + * This method will return an object containing Face and Vertex instances, generated + * from the parsed triangulated OBJ Model data given to this function. + * + * The obj data should have been parsed in advance via the ParseObj function: + * + * ```javascript + * var data = Phaser.Geom.Mesh.ParseObj(rawData, flipUV); + * + * var results = GenerateObjVerts(data); + * ``` + * + * Alternatively, you can parse obj files loaded via the OBJFile loader: + * + * ```javascript + * preload () + * { + * this.load.obj('alien', 'assets/3d/alien.obj); + * } + * + * var results = GenerateObjVerts(this.cache.obj.get('alien)); + * ``` + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can use the data returned by this function to populate the vertices of a Mesh Game Object. + * + * You may add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small (or large) to visualize. + * You can also offset the model via the `x`, `y` and `z` parameters. + * + * @function Phaser.Geom.Mesh.GenerateObjVerts + * @since 3.50.0 + * + * @param {Phaser.Types.Geom.Mesh.OBJData} data - The parsed OBJ model data. + * @param {Phaser.GameObjects.Mesh} [mesh] - An optional Mesh Game Object. If given, the generated Faces will be automatically added to this Mesh. Set to `null` to skip. + * @param {number} [scale=1] - An amount to scale the model data by. Use this if the model has exported too small, or large, to see. + * @param {number} [x=0] - Translate the model x position by this amount. + * @param {number} [y=0] - Translate the model y position by this amount. + * @param {number} [z=0] - Translate the model z position by this amount. + * @param {number} [rotateX=0] - Rotate the model on the x axis by this amount, in radians. + * @param {number} [rotateY=0] - Rotate the model on the y axis by this amount, in radians. + * @param {number} [rotateZ=0] - Rotate the model on the z axis by this amount, in radians. + * @param {boolean} [zIsUp=true] - Is the z axis up (true), or is y axis up (false)? + * + * @return {Phaser.Types.Geom.Mesh.GenerateVertsResult} The parsed Face and Vertex objects. + */ +var GenerateObjVerts = function (data, mesh, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) +{ + if (scale === undefined) { scale = 1; } + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (rotateX === undefined) { rotateX = 0; } + if (rotateY === undefined) { rotateY = 0; } + if (rotateZ === undefined) { rotateZ = 0; } + if (zIsUp === undefined) { zIsUp = true; } + + var result = { + faces: [], + verts: [] + }; + + var materials = data.materials; + + tempPosition.set(x, y, z); + tempRotation.set(rotateX, rotateY, rotateZ); + tempMatrix.fromRotationXYTranslation(tempRotation, tempPosition, zIsUp); + + for (var m = 0; m < data.models.length; m++) + { + var model = data.models[m]; + + var vertices = model.vertices; + var textureCoords = model.textureCoords; + var faces = model.faces; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + var v1 = face.vertices[0]; + var v2 = face.vertices[1]; + var v3 = face.vertices[2]; + + var m1 = vertices[v1.vertexIndex]; + var m2 = vertices[v2.vertexIndex]; + var m3 = vertices[v3.vertexIndex]; + + var t1 = v1.textureCoordsIndex; + var t2 = v2.textureCoordsIndex; + var t3 = v3.textureCoordsIndex; + + var uv1 = (t1 === -1) ? { u: 0, v: 1 } : textureCoords[t1]; + var uv2 = (t2 === -1) ? { u: 0, v: 0 } : textureCoords[t2]; + var uv3 = (t3 === -1) ? { u: 1, v: 1 } : textureCoords[t3]; + + var color = 0xffffff; + + if (face.material !== '' && materials[face.material]) + { + color = materials[face.material]; + } + + var vert1 = new Vertex(m1.x * scale, m1.y * scale, m1.z * scale, uv1.u, uv1.v, color).transformMat4(tempMatrix); + var vert2 = new Vertex(m2.x * scale, m2.y * scale, m2.z * scale, uv2.u, uv2.v, color).transformMat4(tempMatrix); + var vert3 = new Vertex(m3.x * scale, m3.y * scale, m3.z * scale, uv3.u, uv3.v, color).transformMat4(tempMatrix); + + result.verts.push(vert1, vert2, vert3); + result.faces.push(new Face(vert1, vert2, vert3)); + } + } + + if (mesh) + { + mesh.faces = mesh.faces.concat(result.faces); + mesh.vertices = mesh.vertices.concat(result.verts); + } + + return result; +}; + +module.exports = GenerateObjVerts; + + +/***/ }), +/* 458 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -101786,7 +107245,7 @@ module.exports = SetValue; */ var Class = __webpack_require__(0); -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * @classdesc @@ -102267,7 +107726,7 @@ module.exports = Light; /***/ }), -/* 447 */ +/* 459 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102277,8 +107736,9 @@ module.exports = Light; */ var Class = __webpack_require__(0); -var Light = __webpack_require__(446); -var Utils = __webpack_require__(10); +var Light = __webpack_require__(458); +var Utils = __webpack_require__(12); +var PointLight = __webpack_require__(1169); /** * @callback LightForEach @@ -102361,13 +107821,18 @@ var LightsManager = new Class({ * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. * * @name Phaser.GameObjects.LightsManager#maxLights - * @type {integer} + * @type {number} * @readonly * @since 3.15.0 */ this.maxLights = -1; }, + addPointLight: function (x, y, color, radius, intensity) + { + return this.systems.displayList.add(new PointLight(this.scene, x, y, color, radius, intensity)); + }, + /** * Enable the Lights Manager. * @@ -102380,7 +107845,7 @@ var LightsManager = new Class({ { if (this.maxLights === -1) { - this.maxLights = this.scene.sys.game.renderer.config.maxLights; + this.maxLights = this.scene.sys.renderer.config.maxLights; } this.active = true; @@ -102504,7 +107969,7 @@ var LightsManager = new Class({ * @method Phaser.GameObjects.LightsManager#getMaxVisibleLights * @since 3.0.0 * - * @return {integer} The maximum number of Lights allowed to appear at once. + * @return {number} The maximum number of Lights allowed to appear at once. */ getMaxVisibleLights: function () { @@ -102517,7 +107982,7 @@ var LightsManager = new Class({ * @method Phaser.GameObjects.LightsManager#getLightCount * @since 3.0.0 * - * @return {integer} The number of Lights managed by this Lights Manager. + * @return {number} The number of Lights managed by this Lights Manager. */ getLightCount: function () { @@ -102636,7 +108101,7 @@ module.exports = LightsManager; /***/ }), -/* 448 */ +/* 460 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102645,23 +108110,24 @@ module.exports = LightsManager; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(49); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(55); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Geom */ var Geom = { - - Circle: __webpack_require__(1110), - Ellipse: __webpack_require__(1120), - Intersects: __webpack_require__(449), - Line: __webpack_require__(1140), - Point: __webpack_require__(1162), - Polygon: __webpack_require__(1176), - Rectangle: __webpack_require__(465), - Triangle: __webpack_require__(1209) + + Circle: __webpack_require__(1171), + Ellipse: __webpack_require__(1181), + Intersects: __webpack_require__(461), + Line: __webpack_require__(1201), + Mesh: __webpack_require__(1223), + Point: __webpack_require__(1226), + Polygon: __webpack_require__(1240), + Rectangle: __webpack_require__(479), + Triangle: __webpack_require__(1273) }; @@ -102672,7 +108138,7 @@ module.exports = Geom; /***/ }), -/* 449 */ +/* 461 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102687,39 +108153,39 @@ module.exports = Geom; module.exports = { - CircleToCircle: __webpack_require__(216), - CircleToRectangle: __webpack_require__(217), - GetCircleToCircle: __webpack_require__(1130), - GetCircleToRectangle: __webpack_require__(1131), - GetLineToCircle: __webpack_require__(218), - GetLineToLine: __webpack_require__(450), - GetLineToPoints: __webpack_require__(451), - GetLineToPolygon: __webpack_require__(452), - GetLineToRectangle: __webpack_require__(220), - GetRaysFromPointToPolygon: __webpack_require__(1132), - GetRectangleIntersection: __webpack_require__(1133), - GetRectangleToRectangle: __webpack_require__(1134), - GetRectangleToTriangle: __webpack_require__(1135), - GetTriangleToCircle: __webpack_require__(1136), - GetTriangleToLine: __webpack_require__(457), - GetTriangleToTriangle: __webpack_require__(1137), - LineToCircle: __webpack_require__(219), - LineToLine: __webpack_require__(86), - LineToRectangle: __webpack_require__(453), - PointToLine: __webpack_require__(461), - PointToLineSegment: __webpack_require__(1138), - RectangleToRectangle: __webpack_require__(143), - RectangleToTriangle: __webpack_require__(454), - RectangleToValues: __webpack_require__(1139), - TriangleToCircle: __webpack_require__(456), - TriangleToLine: __webpack_require__(458), - TriangleToTriangle: __webpack_require__(459) + CircleToCircle: __webpack_require__(222), + CircleToRectangle: __webpack_require__(223), + GetCircleToCircle: __webpack_require__(1191), + GetCircleToRectangle: __webpack_require__(1192), + GetLineToCircle: __webpack_require__(224), + GetLineToLine: __webpack_require__(462), + GetLineToPoints: __webpack_require__(463), + GetLineToPolygon: __webpack_require__(464), + GetLineToRectangle: __webpack_require__(226), + GetRaysFromPointToPolygon: __webpack_require__(1193), + GetRectangleIntersection: __webpack_require__(1194), + GetRectangleToRectangle: __webpack_require__(1195), + GetRectangleToTriangle: __webpack_require__(1196), + GetTriangleToCircle: __webpack_require__(1197), + GetTriangleToLine: __webpack_require__(469), + GetTriangleToTriangle: __webpack_require__(1198), + LineToCircle: __webpack_require__(225), + LineToLine: __webpack_require__(91), + LineToRectangle: __webpack_require__(465), + PointToLine: __webpack_require__(473), + PointToLineSegment: __webpack_require__(1199), + RectangleToRectangle: __webpack_require__(112), + RectangleToTriangle: __webpack_require__(466), + RectangleToValues: __webpack_require__(1200), + TriangleToCircle: __webpack_require__(468), + TriangleToLine: __webpack_require__(470), + TriangleToTriangle: __webpack_require__(471) }; /***/ }), -/* 450 */ +/* 462 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102728,7 +108194,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); +var Vector3 = __webpack_require__(37); /** * Checks for intersection between the two line segments and returns the intersection point as a Vector3, @@ -102748,23 +108214,35 @@ var Vector3 = __webpack_require__(81); */ var GetLineToLine = function (line1, line2, out) { - var dx1 = line1.x2 - line1.x1; - var dy1 = line1.y2 - line1.y1; + var x1 = line1.x1; + var y1 = line1.y1; + var x2 = line1.x2; + var y2 = line1.y2; - var dx2 = line2.x2 - line2.x1; - var dy2 = line2.y2 - line2.y1; + var x3 = line2.x1; + var y3 = line2.y1; + var x4 = line2.x2; + var y4 = line2.y2; - var mag1 = Math.sqrt(dx1 * dx1 + dy1 * dy1); - var mag2 = Math.sqrt(dx2 * dx2 + dy2 * dy2); + var dx1 = x2 - x1; + var dy1 = y2 - y1; - // Parallel? - if (dx1 / mag1 === dx2 / mag2 && dy1 / mag1 === dy2 / mag2) + var dx2 = x4 - x3; + var dy2 = y4 - y3; + + var denom = dy2 * dx1 - dx2 * dy1; + + // Make sure there is not a division by zero - this also indicates that the lines are parallel. + // If numA and numB were both equal to zero the lines would be on top of each other (coincidental). + // This check is not done because it is not necessary for this implementation (the parallel check accounts for this). + + if (dx1 === 0 || denom === 0) { - return null; + return false; } - var T2 = (dx1 * (line2.y1 - line1.y1) + dy1 * (line1.x1 - line2.x1)) / (dx2 * dy1 - dy2 * dx1); - var T1 = (line2.x1 + dx2 * T2 - line1.x1) / dx1; + var T2 = (dx1 * (y3 - y1) + dy1 * (x1 - x3)) / (dx2 * dy1 - dy2 * dx1); + var T1 = (x3 + dx2 * T2 - x1) / dx1; // Intersects? if (T1 < 0 || T2 < 0 || T2 > 1) @@ -102778,8 +108256,8 @@ var GetLineToLine = function (line1, line2, out) } return out.set( - line1.x1 + dx1 * T1, - line1.y1 + dy1 * T1, + x1 + dx1 * T1, + y1 + dy1 * T1, T1 ); }; @@ -102788,7 +108266,7 @@ module.exports = GetLineToLine; /***/ }), -/* 451 */ +/* 463 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102797,9 +108275,9 @@ module.exports = GetLineToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); -var GetLineToLine = __webpack_require__(450); -var Line = __webpack_require__(40); +var Vector3 = __webpack_require__(37); +var GetLineToLine = __webpack_require__(462); +var Line = __webpack_require__(45); // Temp calculation segment var segment = new Line(); @@ -102865,7 +108343,7 @@ module.exports = GetLineToPoints; /***/ }), -/* 452 */ +/* 464 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -102874,9 +108352,9 @@ module.exports = GetLineToPoints; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); -var Vector4 = __webpack_require__(129); -var GetLineToPoints = __webpack_require__(451); +var Vector3 = __webpack_require__(37); +var Vector4 = __webpack_require__(135); +var GetLineToPoints = __webpack_require__(463); // Temp vec3 var tempIntersect = new Vector3(); @@ -102936,7 +108414,7 @@ module.exports = GetLineToPolygon; /***/ }), -/* 453 */ +/* 465 */ /***/ (function(module, exports) { /** @@ -103037,7 +108515,7 @@ module.exports = LineToRectangle; /***/ }), -/* 454 */ +/* 466 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103046,10 +108524,10 @@ module.exports = LineToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToLine = __webpack_require__(86); -var Contains = __webpack_require__(50); -var ContainsArray = __webpack_require__(221); -var Decompose = __webpack_require__(455); +var LineToLine = __webpack_require__(91); +var Contains = __webpack_require__(56); +var ContainsArray = __webpack_require__(227); +var Decompose = __webpack_require__(467); /** * Checks for intersection between Rectangle shape and Triangle shape. @@ -103130,7 +108608,7 @@ module.exports = RectangleToTriangle; /***/ }), -/* 455 */ +/* 467 */ /***/ (function(module, exports) { /** @@ -103167,7 +108645,7 @@ module.exports = Decompose; /***/ }), -/* 456 */ +/* 468 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103176,8 +108654,8 @@ module.exports = Decompose; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineToCircle = __webpack_require__(219); -var Contains = __webpack_require__(85); +var LineToCircle = __webpack_require__(225); +var Contains = __webpack_require__(110); /** * Checks if a Triangle and a Circle intersect. @@ -103232,7 +108710,7 @@ module.exports = TriangleToCircle; /***/ }), -/* 457 */ +/* 469 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103243,8 +108721,8 @@ module.exports = TriangleToCircle; */ var Point = __webpack_require__(4); -var TriangleToLine = __webpack_require__(458); -var LineToLine = __webpack_require__(86); +var TriangleToLine = __webpack_require__(470); +var LineToLine = __webpack_require__(91); /** * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array. @@ -103291,7 +108769,7 @@ module.exports = GetTriangleToLine; /***/ }), -/* 458 */ +/* 470 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103300,12 +108778,11 @@ module.exports = GetTriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(85); -var LineToLine = __webpack_require__(86); +var LineToLine = __webpack_require__(91); /** * Checks if a Triangle and a Line intersect. - * + * * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * * @function Phaser.Geom.Intersects.TriangleToLine @@ -103319,7 +108796,7 @@ var LineToLine = __webpack_require__(86); var TriangleToLine = function (triangle, line) { // If the Triangle contains either the start or end point of the line, it intersects - if (Contains(triangle, line.getPointA()) || Contains(triangle, line.getPointB())) + if (triangle.contains(line.x1, line.y1) || triangle.contains(line.x2, line.y2)) { return true; } @@ -103347,7 +108824,7 @@ module.exports = TriangleToLine; /***/ }), -/* 459 */ +/* 471 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103356,9 +108833,9 @@ module.exports = TriangleToLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ContainsArray = __webpack_require__(221); -var Decompose = __webpack_require__(460); -var LineToLine = __webpack_require__(86); +var ContainsArray = __webpack_require__(227); +var Decompose = __webpack_require__(472); +var LineToLine = __webpack_require__(91); /** * Checks if two Triangles intersect. @@ -103437,7 +108914,7 @@ module.exports = TriangleToTriangle; /***/ }), -/* 460 */ +/* 472 */ /***/ (function(module, exports) { /** @@ -103472,7 +108949,7 @@ module.exports = Decompose; /***/ }), -/* 461 */ +/* 473 */ /***/ (function(module, exports) { /** @@ -103542,7 +109019,7 @@ module.exports = PointToLine; /***/ }), -/* 462 */ +/* 474 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103552,8 +109029,8 @@ module.exports = PointToLine; */ var MATH_CONST = __webpack_require__(13); -var Wrap = __webpack_require__(59); -var Angle = __webpack_require__(87); +var Wrap = __webpack_require__(64); +var Angle = __webpack_require__(92); /** * Get the angle of the normal of the given line in radians. @@ -103576,7 +109053,401 @@ module.exports = NormalAngle; /***/ }), -/* 463 */ +/* 475 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var flip = true; + +var defaultModelName = 'untitled'; +var currentGroup = ''; +var currentMaterial = ''; + +/** + * @ignore + */ +function stripComments (line) +{ + var idx = line.indexOf('#'); + + return (idx > -1) ? line.substring(0, idx) : line; +} + +/** + * @ignore + */ +function currentModel (result) +{ + if (result.models.length === 0) + { + result.models.push({ + faces: [], + name: defaultModelName, + textureCoords: [], + vertexNormals: [], + vertices: [] + }); + } + + currentGroup = ''; + + return result.models[result.models.length - 1]; +} + +/** + * @ignore + */ +function parseObject (lineItems, result) +{ + var modelName = lineItems.length >= 2 ? lineItems[1] : defaultModelName; + + result.models.push({ + faces: [], + name: modelName, + textureCoords: [], + vertexNormals: [], + vertices: [] + }); + + currentGroup = ''; +} + +/** + * @ignore + */ +function parseGroup (lineItems) +{ + if (lineItems.length === 2) + { + currentGroup = lineItems[1]; + } +} + +/** + * @ignore + */ +function parseVertexCoords (lineItems, result) +{ + var len = lineItems.length; + + var x = (len >= 2) ? parseFloat(lineItems[1]) : 0; + var y = (len >= 3) ? parseFloat(lineItems[2]) : 0; + var z = (len >= 4) ? parseFloat(lineItems[3]) : 0; + + currentModel(result).vertices.push({ x: x, y: y, z: z }); +} + +/** + * @ignore + */ +function parseTextureCoords (lineItems, result) +{ + var len = lineItems.length; + + var u = (len >= 2) ? parseFloat(lineItems[1]) : 0; + var v = (len >= 3) ? parseFloat(lineItems[2]) : 0; + var w = (len >= 4) ? parseFloat(lineItems[3]) : 0; + + if (isNaN(u)) + { + u = 0; + } + + if (isNaN(v)) + { + v = 0; + } + + if (isNaN(w)) + { + w = 0; + } + + if (flip) + { + v = 1 - v; + } + + currentModel(result).textureCoords.push({ u: u, v: v, w: w }); +} + +/** + * @ignore + */ +function parseVertexNormal (lineItems, result) +{ + var len = lineItems.length; + + var x = (len >= 2) ? parseFloat(lineItems[1]) : 0; + var y = (len >= 3) ? parseFloat(lineItems[2]) : 0; + var z = (len >= 4) ? parseFloat(lineItems[3]) : 0; + + currentModel(result).vertexNormals.push({ x: x, y: y, z: z }); +} + +/** + * @ignore + */ +function parsePolygon (lineItems, result) +{ + var totalVertices = lineItems.length - 1; + + if (totalVertices < 3) + { + return; + } + + var face = { + group: currentGroup, + material: currentMaterial, + vertices: [] + }; + + for (var i = 0; i < totalVertices; i++) + { + var vertexString = lineItems[i + 1]; + var vertexValues = vertexString.split('/'); + var vvLen = vertexValues.length; + + if (vvLen < 1 || vvLen > 3) + { + continue; + } + + var vertexIndex = 0; + var textureCoordsIndex = 0; + var vertexNormalIndex = 0; + + vertexIndex = parseInt(vertexValues[0], 10); + + if (vvLen > 1 && vertexValues[1] !== '') + { + textureCoordsIndex = parseInt(vertexValues[1], 10); + } + + if (vvLen > 2) + { + vertexNormalIndex = parseInt(vertexValues[2], 10); + } + + if (vertexIndex !== 0) + { + // Negative vertex indices refer to the nth last defined vertex + // convert these to postive indices for simplicity + if (vertexIndex < 0) + { + vertexIndex = currentModel(result).vertices.length + 1 + vertexIndex; + } + + textureCoordsIndex -= 1; + vertexIndex -= 1; + vertexNormalIndex -= 1; + + face.vertices.push({ + textureCoordsIndex: textureCoordsIndex, + vertexIndex: vertexIndex, + vertexNormalIndex: vertexNormalIndex + }); + } + } + + currentModel(result).faces.push(face); +} + +/** + * @ignore + */ +function parseMtlLib (lineItems, result) +{ + if (lineItems.length >= 2) + { + result.materialLibraries.push(lineItems[1]); + } +} + +/** + * @ignore + */ +function parseUseMtl (lineItems) +{ + if (lineItems.length >= 2) + { + currentMaterial = lineItems[1]; + } +} + +/** + * Parses a Wavefront OBJ File, extracting the models from it and returning them in an array. + * + * The model data *must* be triangulated for a Mesh Game Object to be able to render it. + * + * @function Phaser.Geom.Mesh.ParseObj + * @since 3.50.0 + * + * @param {string} data - The OBJ File data as a raw string. + * @param {boolean} [flipUV=true] - Flip the UV coordinates? + * + * @return {Phaser.Types.Geom.Mesh.OBJData} The parsed model and material data. + */ +var ParseObj = function (data, flipUV) +{ + if (flipUV === undefined) { flipUV = true; } + + flip = flipUV; + + // Store results in here + var result = { + materials: {}, + materialLibraries: [], + models: [] + }; + + currentGroup = ''; + currentMaterial = ''; + + var lines = data.split('\n'); + + for (var i = 0; i < lines.length; i++) + { + var line = stripComments(lines[i]); + + var lineItems = line.replace(/\s\s+/g, ' ').trim().split(' '); + + switch (lineItems[0].toLowerCase()) + { + case 'o': + // Start A New Model + parseObject(lineItems, result); + break; + + case 'g': + // Start a new polygon group + parseGroup(lineItems); + break; + + case 'v': + // Define a vertex for the current model + parseVertexCoords(lineItems, result); + break; + + case 'vt': + // Texture Coords + parseTextureCoords(lineItems, result); + break; + + case 'vn': + // Define a vertex normal for the current model + parseVertexNormal(lineItems, result); + break; + + case 'f': + // Define a Face/Polygon + parsePolygon(lineItems, result); + break; + + case 'mtllib': + // Reference to a material library file (.mtl) + parseMtlLib(lineItems, result); + break; + + case 'usemtl': + // Sets the current material to be applied to polygons defined from this point forward + parseUseMtl(lineItems); + break; + } + } + + return result; +}; + +module.exports = ParseObj; + + +/***/ }), +/* 476 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetColor = __webpack_require__(100); + +/** + * Takes a Wavefront Material file and extracts the diffuse reflectivity of the named + * materials, converts them to integer color values and returns them. + * + * This is used internally by the `addOBJ` and `addModel` methods, but is exposed for + * public consumption as well. + * + * Note this only works with diffuse values, specified in the `Kd r g b` format, where + * `g` and `b` are optional, but `r` is required. It does not support spectral rfl files, + * or any other material statement (such as `Ka` or `Ks`) + * + * @method Phaser.Geom.Mesh.ParseObjMaterial + * @since 3.50.0 + * + * @param {string} mtl - The OBJ MTL file as a raw string, i.e. loaded via `this.load.text`. + * + * @return {object} The parsed material colors, where each property of the object matches the material name. + */ +var ParseObjMaterial = function (mtl) +{ + var output = {}; + + var lines = mtl.split('\n'); + + var currentMaterial = ''; + + for (var i = 0; i < lines.length; i++) + { + var line = lines[i].trim(); + + if (line.indexOf('#') === 0 || line === '') + { + continue; + } + + var lineItems = line.replace(/\s\s+/g, ' ').trim().split(' '); + + switch (lineItems[0].toLowerCase()) + { + case 'newmtl': + { + currentMaterial = lineItems[1]; + break; + } + + // The diffuse reflectivity of the current material + // Support r, [g], [b] format, where g and b are optional + case 'kd': + { + var r = Math.floor(lineItems[1] * 255); + var g = (lineItems.length >= 2) ? Math.floor(lineItems[2] * 255) : r; + var b = (lineItems.length >= 3) ? Math.floor(lineItems[3] * 255) : r; + + output[currentMaterial] = GetColor(r, g, b); + + break; + } + } + } + + return output; +}; + +module.exports = ParseObjMaterial; + + +/***/ }), +/* 477 */ /***/ (function(module, exports) { /** @@ -103604,7 +109475,7 @@ module.exports = GetMagnitude; /***/ }), -/* 464 */ +/* 478 */ /***/ (function(module, exports) { /** @@ -103632,7 +109503,7 @@ module.exports = GetMagnitudeSq; /***/ }), -/* 465 */ +/* 479 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103643,50 +109514,50 @@ module.exports = GetMagnitudeSq; var Rectangle = __webpack_require__(9); -Rectangle.Area = __webpack_require__(1183); -Rectangle.Ceil = __webpack_require__(1184); -Rectangle.CeilAll = __webpack_require__(1185); -Rectangle.CenterOn = __webpack_require__(178); -Rectangle.Clone = __webpack_require__(1186); -Rectangle.Contains = __webpack_require__(50); -Rectangle.ContainsPoint = __webpack_require__(1187); -Rectangle.ContainsRect = __webpack_require__(466); -Rectangle.CopyFrom = __webpack_require__(1188); -Rectangle.Decompose = __webpack_require__(455); -Rectangle.Equals = __webpack_require__(1189); -Rectangle.FitInside = __webpack_require__(1190); -Rectangle.FitOutside = __webpack_require__(1191); -Rectangle.Floor = __webpack_require__(1192); -Rectangle.FloorAll = __webpack_require__(1193); -Rectangle.FromPoints = __webpack_require__(186); -Rectangle.FromXY = __webpack_require__(1194); -Rectangle.GetAspectRatio = __webpack_require__(223); -Rectangle.GetCenter = __webpack_require__(1195); -Rectangle.GetPoint = __webpack_require__(161); -Rectangle.GetPoints = __webpack_require__(283); -Rectangle.GetSize = __webpack_require__(1196); -Rectangle.Inflate = __webpack_require__(1197); -Rectangle.Intersection = __webpack_require__(1198); -Rectangle.MarchingAnts = __webpack_require__(294); -Rectangle.MergePoints = __webpack_require__(1199); -Rectangle.MergeRect = __webpack_require__(1200); -Rectangle.MergeXY = __webpack_require__(1201); -Rectangle.Offset = __webpack_require__(1202); -Rectangle.OffsetPoint = __webpack_require__(1203); -Rectangle.Overlaps = __webpack_require__(1204); -Rectangle.Perimeter = __webpack_require__(118); -Rectangle.PerimeterPoint = __webpack_require__(1205); -Rectangle.Random = __webpack_require__(164); -Rectangle.RandomOutside = __webpack_require__(1206); -Rectangle.SameDimensions = __webpack_require__(1207); -Rectangle.Scale = __webpack_require__(1208); -Rectangle.Union = __webpack_require__(408); +Rectangle.Area = __webpack_require__(1247); +Rectangle.Ceil = __webpack_require__(1248); +Rectangle.CeilAll = __webpack_require__(1249); +Rectangle.CenterOn = __webpack_require__(182); +Rectangle.Clone = __webpack_require__(1250); +Rectangle.Contains = __webpack_require__(56); +Rectangle.ContainsPoint = __webpack_require__(1251); +Rectangle.ContainsRect = __webpack_require__(480); +Rectangle.CopyFrom = __webpack_require__(1252); +Rectangle.Decompose = __webpack_require__(467); +Rectangle.Equals = __webpack_require__(1253); +Rectangle.FitInside = __webpack_require__(1254); +Rectangle.FitOutside = __webpack_require__(1255); +Rectangle.Floor = __webpack_require__(1256); +Rectangle.FloorAll = __webpack_require__(1257); +Rectangle.FromPoints = __webpack_require__(191); +Rectangle.FromXY = __webpack_require__(1258); +Rectangle.GetAspectRatio = __webpack_require__(229); +Rectangle.GetCenter = __webpack_require__(1259); +Rectangle.GetPoint = __webpack_require__(162); +Rectangle.GetPoints = __webpack_require__(298); +Rectangle.GetSize = __webpack_require__(1260); +Rectangle.Inflate = __webpack_require__(1261); +Rectangle.Intersection = __webpack_require__(1262); +Rectangle.MarchingAnts = __webpack_require__(308); +Rectangle.MergePoints = __webpack_require__(1263); +Rectangle.MergeRect = __webpack_require__(1264); +Rectangle.MergeXY = __webpack_require__(1265); +Rectangle.Offset = __webpack_require__(1266); +Rectangle.OffsetPoint = __webpack_require__(1267); +Rectangle.Overlaps = __webpack_require__(1268); +Rectangle.Perimeter = __webpack_require__(126); +Rectangle.PerimeterPoint = __webpack_require__(1269); +Rectangle.Random = __webpack_require__(165); +Rectangle.RandomOutside = __webpack_require__(1270); +Rectangle.SameDimensions = __webpack_require__(1271); +Rectangle.Scale = __webpack_require__(1272); +Rectangle.Union = __webpack_require__(418); module.exports = Rectangle; /***/ }), -/* 466 */ +/* 480 */ /***/ (function(module, exports) { /** @@ -103726,7 +109597,7 @@ module.exports = ContainsRect; /***/ }), -/* 467 */ +/* 481 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103770,7 +109641,7 @@ module.exports = Centroid; /***/ }), -/* 468 */ +/* 482 */ /***/ (function(module, exports) { /** @@ -103811,7 +109682,7 @@ module.exports = Offset; /***/ }), -/* 469 */ +/* 483 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -103876,7 +109747,7 @@ module.exports = InCenter; /***/ }), -/* 470 */ +/* 484 */ /***/ (function(module, exports) { /** @@ -103894,7 +109765,7 @@ module.exports = InCenter; * @since 3.10.0 * * @param {Phaser.Textures.TextureManager} textureManager - A reference to the Texture Manager. - * @param {integer} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction. + * @param {number} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction. * * @return {function} The new Pixel Perfect Handler function. */ @@ -103912,7 +109783,7 @@ module.exports = CreatePixelPerfectHandler; /***/ }), -/* 471 */ +/* 485 */ /***/ (function(module, exports) { /** @@ -103983,7 +109854,7 @@ module.exports = CreateInteractiveObject; /***/ }), -/* 472 */ +/* 486 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -104005,7 +109876,7 @@ var Class = __webpack_require__(0); * @since 3.0.0 * * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Axis belongs to. - * @param {integer} index - The index of this Axis. + * @param {number} index - The index of this Axis. */ var Axis = new Class({ @@ -104035,7 +109906,7 @@ var Axis = new Class({ * The index of this Axis. * * @name Phaser.Input.Gamepad.Axis#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -104108,7 +109979,7 @@ module.exports = Axis; /***/ }), -/* 473 */ +/* 487 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -104118,7 +109989,7 @@ module.exports = Axis; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(225); +var Events = __webpack_require__(231); /** * @classdesc @@ -104131,7 +110002,7 @@ var Events = __webpack_require__(225); * @since 3.0.0 * * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Button belongs to. - * @param {integer} index - The index of this Button. + * @param {number} index - The index of this Button. */ var Button = new Class({ @@ -104161,7 +110032,7 @@ var Button = new Class({ * The index of this Button. * * @name Phaser.Input.Gamepad.Button#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -104254,7 +110125,7 @@ module.exports = Button; /***/ }), -/* 474 */ +/* 488 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -104263,10 +110134,10 @@ module.exports = Button; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Axis = __webpack_require__(472); -var Button = __webpack_require__(473); +var Axis = __webpack_require__(486); +var Button = __webpack_require__(487); var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); +var EventEmitter = __webpack_require__(10); var Vector2 = __webpack_require__(3); /** @@ -104572,6 +110443,16 @@ var Gamepad = new Class({ * @since 3.10.0 */ this.rightStick = new Vector2(); + + /** + * When was this Gamepad created? Used to avoid duplicate event spamming in the update loop. + * + * @name Phaser.Input.Gamepad.Gamepad#_created + * @type {number} + * @private + * @since 3.50.0 + */ + this._created = performance.now(); }, /** @@ -104580,7 +110461,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getAxisTotal * @since 3.10.0 * - * @return {integer} The total number of axes this Gamepad claims to support. + * @return {number} The total number of axes this Gamepad claims to support. */ getAxisTotal: function () { @@ -104595,7 +110476,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getAxisValue * @since 3.10.0 * - * @param {integer} index - The index of the axes to get the value for. + * @param {number} index - The index of the axes to get the value for. * * @return {number} The value of the axis, between 0 and 1. */ @@ -104627,7 +110508,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getButtonTotal * @since 3.10.0 * - * @return {integer} The total number of buttons this Gamepad claims to have. + * @return {number} The total number of buttons this Gamepad claims to have. */ getButtonTotal: function () { @@ -104644,7 +110525,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getButtonValue * @since 3.10.0 * - * @param {integer} index - The index of the button to get the value for. + * @param {number} index - The index of the button to get the value for. * * @return {number} The value of the button, between 0 and 1. */ @@ -104660,7 +110541,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#isButtonDown * @since 3.10.0 * - * @param {integer} index - The index of the button to get the value for. + * @param {number} index - The index of the button to get the value for. * * @return {boolean} `true` if the button is considered as being pressed down, otherwise `false`. */ @@ -104679,6 +110560,11 @@ var Gamepad = new Class({ */ update: function (pad) { + if (pad.timestamp < this._created) + { + return; + } + var i; // Sync the button values @@ -105012,7 +110898,7 @@ module.exports = Gamepad; /***/ }), -/* 475 */ +/* 489 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105022,8 +110908,8 @@ module.exports = Gamepad; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(145); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(147); /** * @classdesc @@ -105037,7 +110923,7 @@ var Events = __webpack_require__(145); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardPlugin} plugin - The Keyboard Plugin instance that owns this Key object. - * @param {integer} keyCode - The keycode of this key. + * @param {number} keyCode - The keycode of this key. */ var Key = new Class({ @@ -105062,7 +110948,7 @@ var Key = new Class({ * The keycode of this key. * * @name Phaser.Input.Keyboard.Key#keyCode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.keyCode = keyCode; @@ -105414,7 +111300,7 @@ module.exports = Key; /***/ }), -/* 476 */ +/* 490 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105424,10 +111310,10 @@ module.exports = Key; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(145); +var Events = __webpack_require__(147); var GetFastValue = __webpack_require__(2); -var ProcessKeyCombo = __webpack_require__(1247); -var ResetKeyCombo = __webpack_require__(1249); +var ProcessKeyCombo = __webpack_require__(491); +var ResetKeyCombo = __webpack_require__(493); /** * @classdesc @@ -105464,7 +111350,7 @@ var ResetKeyCombo = __webpack_require__(1249); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardPlugin} keyboardPlugin - A reference to the Keyboard Plugin. - * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {(string|number[]|object[])} keys - The keys that comprise this combo. * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. */ var KeyCombo = new Class({ @@ -105534,7 +111420,7 @@ var KeyCombo = new Class({ * The current keyCode the combo is waiting for. * * @name Phaser.Input.Keyboard.KeyCombo#current - * @type {integer} + * @type {number} * @since 3.0.0 */ this.current = this.keyCodes[0]; @@ -105543,7 +111429,7 @@ var KeyCombo = new Class({ * The current index of the key being waited for in the 'keys' string. * * @name Phaser.Input.Keyboard.KeyCombo#index - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -105602,7 +111488,7 @@ var KeyCombo = new Class({ * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. * * @name Phaser.Input.Keyboard.KeyCombo#maxKeyDelay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -105707,7 +111593,7 @@ module.exports = KeyCombo; /***/ }), -/* 477 */ +/* 491 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105716,7 +111602,165 @@ module.exports = KeyCombo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(226); +var AdvanceKeyCombo = __webpack_require__(492); + +/** + * Used internally by the KeyCombo class. + * + * @function Phaser.Input.Keyboard.ProcessKeyCombo + * @private + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native Keyboard Event. + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to be processed. + * + * @return {boolean} `true` if the combo was matched, otherwise `false`. + */ +var ProcessKeyCombo = function (event, combo) +{ + if (combo.matched) + { + return true; + } + + var comboMatched = false; + var keyMatched = false; + + if (event.keyCode === combo.current) + { + // Key was correct + + if (combo.index > 0 && combo.maxKeyDelay > 0) + { + // We have to check to see if the delay between + // the new key and the old one was too long (if enabled) + + var timeLimit = combo.timeLastMatched + combo.maxKeyDelay; + + // Check if they pressed it in time or not + if (event.timeStamp <= timeLimit) + { + keyMatched = true; + comboMatched = AdvanceKeyCombo(event, combo); + } + } + else + { + keyMatched = true; + + // We don't check the time for the first key pressed, so just advance it + comboMatched = AdvanceKeyCombo(event, combo); + } + } + + if (!keyMatched && combo.resetOnWrongKey) + { + // Wrong key was pressed + combo.index = 0; + combo.current = combo.keyCodes[0]; + } + + if (comboMatched) + { + combo.timeLastMatched = event.timeStamp; + combo.matched = true; + combo.timeMatched = event.timeStamp; + } + + return comboMatched; +}; + +module.exports = ProcessKeyCombo; + + +/***/ }), +/* 492 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Used internally by the KeyCombo class. + * Return `true` if it reached the end of the combo, `false` if not. + * + * @function Phaser.Input.Keyboard.AdvanceKeyCombo + * @private + * @since 3.0.0 + * + * @param {KeyboardEvent} event - The native Keyboard Event. + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to advance. + * + * @return {boolean} `true` if it reached the end of the combo, `false` if not. + */ +var AdvanceKeyCombo = function (event, combo) +{ + combo.timeLastMatched = event.timeStamp; + combo.index++; + + if (combo.index === combo.size) + { + return true; + } + else + { + combo.current = combo.keyCodes[combo.index]; + return false; + } +}; + +module.exports = AdvanceKeyCombo; + + +/***/ }), +/* 493 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Used internally by the KeyCombo class. + * + * @function Phaser.Input.Keyboard.ResetKeyCombo + * @private + * @since 3.0.0 + * + * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo to reset. + * + * @return {Phaser.Input.Keyboard.KeyCombo} The KeyCombo. + */ +var ResetKeyCombo = function (combo) +{ + combo.current = combo.keyCodes[0]; + combo.index = 0; + combo.timeLastMatched = 0; + combo.matched = false; + combo.timeMatched = 0; + + return combo; +}; + +module.exports = ResetKeyCombo; + + +/***/ }), +/* 494 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MergeXHRSettings = __webpack_require__(232); /** * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings @@ -105788,7 +111832,7 @@ module.exports = XHRLoader; /***/ }), -/* 478 */ +/* 495 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -105798,11 +111842,11 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var HTML5AudioFile = __webpack_require__(479); +var HTML5AudioFile = __webpack_require__(496); var IsPlainObject = __webpack_require__(7); /** @@ -105915,7 +111959,7 @@ AudioFile.create = function (loader, key, urls, config, xhrSettings) // https://developers.google.com/web/updates/2012/02/HTML5-audio-and-the-Web-Audio-API-are-BFFs // var stream = GetFastValue(config, 'stream', false); - if (deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio)) + if (deviceAudio.webAudio && !audioConfig.disableWebAudio) { return new AudioFile(loader, key, urlConfig, xhrSettings, game.sound.context); } @@ -106024,7 +112068,7 @@ FileTypesManager.register('audio', function (key, urls, config, xhrSettings) var audioConfig = game.config.audio; var deviceAudio = game.device.audio; - if ((audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData)) + if (audioConfig.noAudio || (!deviceAudio.webAudio && !deviceAudio.audioData)) { // Sounds are disabled, so skip loading audio return this; @@ -106062,7 +112106,7 @@ module.exports = AudioFile; /***/ }), -/* 479 */ +/* 496 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106072,10 +112116,10 @@ module.exports = AudioFile; */ var Class = __webpack_require__(0); -var Events = __webpack_require__(84); +var Events = __webpack_require__(89); var File = __webpack_require__(22); var GetFastValue = __webpack_require__(2); -var GetURL = __webpack_require__(146); +var GetURL = __webpack_require__(148); var IsPlainObject = __webpack_require__(7); /** @@ -106265,7 +112309,7 @@ module.exports = HTML5AudioFile; /***/ }), -/* 480 */ +/* 497 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106275,7 +112319,7 @@ module.exports = HTML5AudioFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -106436,7 +112480,7 @@ module.exports = ScriptFile; /***/ }), -/* 481 */ +/* 498 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106445,187 +112489,12 @@ module.exports = ScriptFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var ArcadeImage = __webpack_require__(499); +var ArcadeSprite = __webpack_require__(150); var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var File = __webpack_require__(22); -var FileTypesManager = __webpack_require__(8); -var GetFastValue = __webpack_require__(2); -var IsPlainObject = __webpack_require__(7); - -/** - * @classdesc - * A single Text File suitable for loading by the Loader. - * - * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly. - * - * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text. - * - * @class TextFile - * @extends Phaser.Loader.File - * @memberof Phaser.Loader.FileTypes - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - */ -var TextFile = new Class({ - - Extends: File, - - initialize: - - function TextFile (loader, key, url, xhrSettings) - { - var extension = 'txt'; - - if (IsPlainObject(key)) - { - var config = key; - - key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); - } - - var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings - }; - - File.call(this, loader, fileConfig); - }, - - /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. - * - * @method Phaser.Loader.FileTypes.TextFile#onProcess - * @since 3.7.0 - */ - onProcess: function () - { - this.state = CONST.FILE_PROCESSING; - - this.data = this.xhrLoader.responseText; - - this.onProcessComplete(); - } - -}); - -/** - * Adds a Text file, or array of Text files, to the current load queue. - * - * You can call this method from within your Scene's `preload`, along with any other files you wish to load: - * - * ```javascript - * function preload () - * { - * this.load.text('story', 'files/IntroStory.txt'); - * } - * ``` - * - * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, - * or if it's already running, when the next free load slot becomes available. This happens automatically if you - * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued - * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. - * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the - * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been - * loaded. - * - * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load. - * The key should be unique both in terms of files being loaded and files already present in the Text Cache. - * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file - * then remove it from the Text Cache first, before loading a new one. - * - * Instead of passing arguments you can pass a configuration object, such as: - * - * ```javascript - * this.load.text({ - * key: 'story', - * url: 'files/IntroStory.txt' - * }); - * ``` - * - * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details. - * - * Once the file has finished loading you can access it from its Cache using its key: - * - * ```javascript - * this.load.text('story', 'files/IntroStory.txt'); - * // and later in your game ... - * var data = this.cache.text.get('story'); - * ``` - * - * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files - * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and - * this is what you would use to retrieve the text from the Text Cache. - * - * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. - * - * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" - * and no URL is given then the Loader will set the URL to be "story.txt". It will always add `.txt` as the extension, although - * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. - * - * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser. - * It is available in the default build but can be excluded from custom builds. - * - * @method Phaser.Loader.LoaderPlugin#text - * @fires Phaser.Loader.LoaderPlugin#ADD - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.txt". - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. - * - * @return {this} The Loader instance. - */ -FileTypesManager.register('text', function (key, url, xhrSettings) -{ - if (Array.isArray(key)) - { - for (var i = 0; i < key.length; i++) - { - // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new TextFile(this, key[i])); - } - } - else - { - this.addFile(new TextFile(this, key, url, xhrSettings)); - } - - return this; -}); - -module.exports = TextFile; - - -/***/ }), -/* 482 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var ArcadeImage = __webpack_require__(483); -var ArcadeSprite = __webpack_require__(148); -var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); -var PhysicsGroup = __webpack_require__(485); -var StaticPhysicsGroup = __webpack_require__(486); +var CONST = __webpack_require__(59); +var PhysicsGroup = __webpack_require__(501); +var StaticPhysicsGroup = __webpack_require__(502); /** * @classdesc @@ -106742,7 +112611,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithStaticBody} The Image object that was created. */ @@ -106766,7 +112635,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithDynamicBody} The Image object that was created. */ @@ -106790,7 +112659,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.SpriteWithStaticBody} The Sprite object that was created. */ @@ -106815,7 +112684,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.SpriteWithDynamicBody} The Sprite object that was created. */ @@ -106884,7 +112753,7 @@ module.exports = Factory; /***/ }), -/* 483 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -106894,8 +112763,8 @@ module.exports = Factory; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(228); -var Image = __webpack_require__(114); +var Components = __webpack_require__(235); +var Image = __webpack_require__(122); /** * @classdesc @@ -106920,6 +112789,7 @@ var Image = __webpack_require__(114); * @extends Phaser.Physics.Arcade.Components.Gravity * @extends Phaser.Physics.Arcade.Components.Immovable * @extends Phaser.Physics.Arcade.Components.Mass + * @extends Phaser.Physics.Arcade.Components.Pushable * @extends Phaser.Physics.Arcade.Components.Size * @extends Phaser.Physics.Arcade.Components.Velocity * @extends Phaser.GameObjects.Components.Alpha @@ -106940,7 +112810,7 @@ var Image = __webpack_require__(114); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeImage = new Class({ @@ -106957,6 +112827,7 @@ var ArcadeImage = new Class({ Components.Gravity, Components.Immovable, Components.Mass, + Components.Pushable, Components.Size, Components.Velocity ], @@ -106984,13 +112855,13 @@ module.exports = ArcadeImage; /***/ }), -/* 484 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { -var OverlapRect = __webpack_require__(229); -var Circle = __webpack_require__(68); -var CircleToCircle = __webpack_require__(216); -var CircleToRectangle = __webpack_require__(217); +var OverlapRect = __webpack_require__(236); +var Circle = __webpack_require__(71); +var CircleToCircle = __webpack_require__(222); +var CircleToRectangle = __webpack_require__(223); /** * This method will search the given circular area and return an array of all physics bodies that @@ -107052,7 +112923,7 @@ module.exports = OverlapCirc; /***/ }), -/* 485 */ +/* 501 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107061,11 +112932,11 @@ module.exports = OverlapCirc; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(148); +var ArcadeSprite = __webpack_require__(150); var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(100); +var Group = __webpack_require__(108); var IsPlainObject = __webpack_require__(7); /** @@ -107170,7 +113041,7 @@ var PhysicsGroup = new Class({ * The physics type of the Group's members. * * @name Phaser.Physics.Arcade.Group#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.DYNAMIC_BODY * @since 3.0.0 */ @@ -107202,6 +113073,8 @@ var PhysicsGroup = new Class({ setGravityY: GetFastValue(config, 'gravityY', 0), setFrictionX: GetFastValue(config, 'frictionX', 0), setFrictionY: GetFastValue(config, 'frictionY', 0), + setMaxVelocityX: GetFastValue(config, 'maxVelocityX', 10000), + setMaxVelocityY: GetFastValue(config, 'maxVelocityY', 10000), setVelocityX: GetFastValue(config, 'velocityX', 0), setVelocityY: GetFastValue(config, 'velocityY', 0), setAngularVelocity: GetFastValue(config, 'angularVelocity', 0), @@ -107346,7 +113219,7 @@ module.exports = PhysicsGroup; /***/ }), -/* 486 */ +/* 502 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107355,11 +113228,11 @@ module.exports = PhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArcadeSprite = __webpack_require__(148); +var ArcadeSprite = __webpack_require__(150); var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); +var CONST = __webpack_require__(59); var GetFastValue = __webpack_require__(2); -var Group = __webpack_require__(100); +var Group = __webpack_require__(108); var IsPlainObject = __webpack_require__(7); /** @@ -107445,7 +113318,7 @@ var StaticPhysicsGroup = new Class({ * The scene this group belongs to. * * @name Phaser.Physics.Arcade.StaticGroup#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.STATIC_BODY * @since 3.0.0 */ @@ -107545,7 +113418,7 @@ module.exports = StaticPhysicsGroup; /***/ }), -/* 487 */ +/* 503 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -107554,35 +113427,36 @@ module.exports = StaticPhysicsGroup; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AngleBetweenPoints = __webpack_require__(331); -var Body = __webpack_require__(488); -var Clamp = __webpack_require__(17); +var AngleBetweenPoints = __webpack_require__(342); +var Body = __webpack_require__(504); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Collider = __webpack_require__(489); -var CONST = __webpack_require__(52); -var DistanceBetween = __webpack_require__(55); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(230); -var FuzzyEqual = __webpack_require__(109); -var FuzzyGreaterThan = __webpack_require__(335); -var FuzzyLessThan = __webpack_require__(336); -var GetOverlapX = __webpack_require__(231); -var GetOverlapY = __webpack_require__(232); +var Collider = __webpack_require__(505); +var CONST = __webpack_require__(59); +var DistanceBetween = __webpack_require__(61); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(237); +var FuzzyEqual = __webpack_require__(121); +var FuzzyGreaterThan = __webpack_require__(346); +var FuzzyLessThan = __webpack_require__(347); +var GetOverlapX = __webpack_require__(238); +var GetOverlapY = __webpack_require__(239); +var GetTilesWithinWorldXY = __webpack_require__(506); var GetValue = __webpack_require__(6); var MATH_CONST = __webpack_require__(13); -var ProcessQueue = __webpack_require__(197); -var ProcessTileCallbacks = __webpack_require__(490); +var ProcessQueue = __webpack_require__(202); +var ProcessTileCallbacks = __webpack_require__(507); var Rectangle = __webpack_require__(9); -var RTree = __webpack_require__(491); -var SeparateTile = __webpack_require__(492); -var SeparateX = __webpack_require__(497); -var SeparateY = __webpack_require__(498); -var Set = __webpack_require__(141); -var StaticBody = __webpack_require__(499); -var TileIntersectsBody = __webpack_require__(233); -var TransformMatrix = __webpack_require__(31); +var RTree = __webpack_require__(508); +var SeparateTile = __webpack_require__(509); +var SeparateX = __webpack_require__(514); +var SeparateY = __webpack_require__(515); +var Set = __webpack_require__(145); +var StaticBody = __webpack_require__(516); +var TileIntersectsBody = __webpack_require__(240); +var TransformMatrix = __webpack_require__(24); var Vector2 = __webpack_require__(3); -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * @classdesc @@ -107871,7 +113745,7 @@ var World = new Class({ * to allow more items per node and less node division. * * @name Phaser.Physics.Arcade.World#maxEntries - * @type {integer} + * @type {number} * @default 16 * @since 3.0.0 */ @@ -107981,7 +113855,7 @@ var World = new Class({ * @since 3.0.0 * * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object - The object, or objects, on which to create the bodies. - * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + * @param {number} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. */ enable: function (object, bodyType) { @@ -108048,7 +113922,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} object - The Game Object on which to create the body. - * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + * @param {number} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. * * @return {Phaser.GameObjects.GameObject} The Game Object on which the body was created. */ @@ -108444,7 +114318,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#setFPS * @since 3.10.0 * - * @param {integer} framerate - The frame rate to advance the simulation at. + * @param {number} framerate - The frame rate to advance the simulation at. * * @return {this} This World object. */ @@ -108532,7 +114406,7 @@ var World = new Class({ } } - this.emit(Events.WORLD_STEP); + this.emit(Events.WORLD_STEP, fixedDelta); } // Process any additional steps this frame @@ -108591,7 +114465,7 @@ var World = new Class({ } } - this.emit(Events.WORLD_STEP); + this.emit(Events.WORLD_STEP, delta); this.stepsLastFrame++; }, @@ -108797,6 +114671,7 @@ var World = new Class({ if (useDamping) { // Damping based deceleration + dragX = Math.pow(dragX, delta); velocityX *= dragX; @@ -108836,6 +114711,8 @@ var World = new Class({ if (useDamping) { // Damping based deceleration + dragY = Math.pow(dragY, delta); + velocityY *= dragY; speed = Math.sqrt(velocityX * velocityX + velocityY * velocityY); @@ -109016,9 +114893,6 @@ var World = new Class({ */ separateCircle: function (body1, body2, overlapOnly, bias) { - body1.updateCenter(); - body2.updateCenter(); - // Set the bounding box overlap values into the bodies themselves (hence we don't use the return values here) GetOverlapX(body1, body2, false, bias); GetOverlapY(body1, body2, false, bias); @@ -109070,6 +114944,9 @@ var World = new Class({ overlap = (body1.halfWidth + body2.halfWidth) - DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y); } + body1.overlapR = overlap; + body2.overlapR = overlap; + // Can't separate two immovable bodies, or a body with its own custom separation logic if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX) { @@ -109597,10 +115474,10 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Group} group - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. - * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. + * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -109715,7 +115592,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. @@ -109737,9 +115614,6 @@ var World = new Class({ var w = body.width; var h = body.height; - // TODO: this logic should be encapsulated within the Tilemap API at some point. - // If the maps base tile size differs from the layer's tile size, we need to adjust the - // selection area by the difference between the two. var layerData = tilemapLayer.layer; if (layerData.tileWidth > layerData.baseTileWidth) @@ -109757,7 +115631,7 @@ var World = new Class({ h += yDiff; } - var mapData = tilemapLayer.getTilesWithinWorldXY(x, y, w, h); + var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer); if (mapData.length === 0) { @@ -109780,7 +115654,7 @@ var World = new Class({ * @since 3.17.0 * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. @@ -109804,11 +115678,13 @@ var World = new Class({ tilemapLayer = tile.tilemapLayer; - tileWorldRect.left = tilemapLayer.tileToWorldX(tile.x); - tileWorldRect.top = tilemapLayer.tileToWorldY(tile.y); + var point = tilemapLayer.tileToWorldXY(tile.x, tile.y); - // If the map's base tile size differs from the layer's tile size, only the top of the rect - // needs to be adjusted since its origin is (0, 1). + tileWorldRect.left = point.x; + tileWorldRect.top = point.y; + + // If the maps base tile size differs from the layer tile size, only the top of the rect + // needs to be adjusted since its origin is (0, 1). if (tile.baseHeight !== tile.height) { tileWorldRect.top -= (tile.height - tile.baseHeight) * tilemapLayer.scaleY; @@ -109885,7 +115761,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#wrap * @since 3.3.0 * - * @param {*} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. + * @param {any} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. * @param {number} [padding=0] - An amount added to each boundary edge during the operation. */ wrap: function (object, padding) @@ -109978,7 +115854,7 @@ module.exports = World; /***/ }), -/* 488 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -109989,11 +115865,11 @@ module.exports = World; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); -var Events = __webpack_require__(230); -var RadToDeg = __webpack_require__(183); +var CONST = __webpack_require__(59); +var Events = __webpack_require__(237); +var RadToDeg = __webpack_require__(188); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(50); +var RectangleContains = __webpack_require__(56); var Vector2 = __webpack_require__(3); /** @@ -110076,7 +115952,7 @@ var Body = new Class({ * The color of this Body on the debug display. * * @name Phaser.Physics.Arcade.Body#debugBodyColor - * @type {integer} + * @type {number} * @since 3.0.0 */ this.debugBodyColor = world.defaults.bodyDebugColor; @@ -110318,10 +116194,11 @@ var Body = new Class({ /** * When `useDamping` is false (the default), this is absolute loss of velocity due to movement, in pixels per second squared. * - * When `useDamping` is true, this is 1 minus the damping factor. + * When `useDamping` is true, this is a damping multiplier between 0 and 1. + * A value of 0 means the Body stops instantly. + * A value of 0.01 mean the Body loses 99% of its velocity per second. + * A value of 0.1 means the Body loses 90% of its velocity per second. * A value of 1 means the Body loses no velocity. - * A value of 0.95 means the Body loses 5% of its velocity per step. - * A value of 0.5 means the Body loses 50% of its velocity per step. * * The x and y components are applied separately. * @@ -110469,8 +116346,8 @@ var Body = new Class({ * by using damping, avoiding the axis-drift that is prone with linear deceleration. * * If you enable this property then you should use far smaller `drag` values than with linear, as - * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow - * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * they are used as a multiplier on the velocity. Values such as 0.05 will give a nice slow + * deceleration. * * @name Phaser.Physics.Arcade.Body#useDamping * @type {boolean} @@ -110558,7 +116435,7 @@ var Body = new Class({ * If the Body is moving on both axes, this describes motion on the vertical axis only. * * @name Phaser.Physics.Arcade.Body#facing - * @type {integer} + * @type {number} * @since 3.0.0 * * @see Phaser.Physics.Arcade.FACING_UP @@ -110578,6 +116455,25 @@ var Body = new Class({ */ this.immovable = false; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * By default, Dynamic Bodies are always pushable. + * + * @name Phaser.Physics.Arcade.Body#pushable + * @type {boolean} + * @default true + * @since 3.50.0 + * @see Phaser.GameObjects.Components.Pushable#setPushable + */ + this.pushable = true; + /** * Whether the Body's position and rotation are affected by its velocity, acceleration, drag, and gravity. * @@ -110722,7 +116618,7 @@ var Body = new Class({ * The Body's physics type (dynamic or static). * * @name Phaser.Physics.Arcade.Body#physicsType - * @type {integer} + * @type {number} * @readonly * @default Phaser.Physics.Arcade.DYNAMIC_BODY * @since 3.0.0 @@ -111195,6 +117091,7 @@ var Body = new Class({ if (wasSet) { this.blocked.none = false; + this.updateCenter(); } return wasSet; @@ -111202,6 +117099,7 @@ var Body = new Class({ /** * Sets the offset of the Body's position from its Game Object's position. + * The Body's `position` isn't changed until the next `preUpdate`. * * @method Phaser.Physics.Arcade.Body#setOffset * @since 3.0.0 @@ -111216,7 +117114,6 @@ var Body = new Class({ if (y === undefined) { y = x; } this.offset.set(x, y); - this.updateCenter(); return this; }, @@ -111229,8 +117126,8 @@ var Body = new Class({ * @method Phaser.Physics.Arcade.Body#setSize * @since 3.0.0 * - * @param {integer} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. - * @param {integer} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {number} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {number} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param {boolean} [center=true] - Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. * * @return {Phaser.Physics.Arcade.Body} This Body object. @@ -111320,14 +117217,14 @@ var Body = new Class({ }, /** - * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * Sets this Body's parent Game Object to the given coordinates and resets this Body at the new coordinates. * If the Body had any velocity or acceleration it is lost as a result of calling this. * * @method Phaser.Physics.Arcade.Body#reset * @since 3.0.0 * - * @param {number} x - The horizontal position to place the Game Object and Body. - * @param {number} y - The vertical position to place the Game Object and Body. + * @param {number} x - The horizontal position to place the Game Object. + * @param {number} y - The vertical position to place the Game Object. */ reset: function (x, y) { @@ -111670,18 +117567,19 @@ var Body = new Class({ /** * Sets whether this Body collides with the world boundary. * - * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. + * Optionally also sets the World Bounce and `onWorldBounds` values. * * @method Phaser.Physics.Arcade.Body#setCollideWorldBounds * @since 3.0.0 * - * @param {boolean} [value=true] - `true` if this body should collide with the world bounds, otherwise `false`. - * @param {number} [bounceX] - If given this will be replace the `worldBounce.x` value. - * @param {number} [bounceY] - If given this will be replace the `worldBounce.y` value. + * @param {boolean} [value=true] - `true` if the Body should collide with the world bounds, otherwise `false`. + * @param {number} [bounceX] - If given this replaces the Body's `worldBounce.x` value. + * @param {number} [bounceY] - If given this replaces the Body's `worldBounce.y` value. + * @param {boolean} [onWorldBounds] - If given this replaces the Body's `onWorldBounds` value. * * @return {Phaser.Physics.Arcade.Body} This Body object. */ - setCollideWorldBounds: function (value, bounceX, bounceY) + setCollideWorldBounds: function (value, bounceX, bounceY, onWorldBounds) { if (value === undefined) { value = true; } @@ -111708,6 +117606,11 @@ var Body = new Class({ } } + if (onWorldBounds !== undefined) + { + this.onWorldBounds = onWorldBounds; + } + return this; }, @@ -111796,6 +117699,40 @@ var Body = new Class({ return this; }, + /** + * Sets the Body's maximum horizontal velocity. + * + * @method Phaser.Physics.Arcade.Body#setMaxVelocityX + * @since 3.50.0 + * + * @param {number} value - The maximum horizontal velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setMaxVelocityX: function (value) + { + this.maxVelocity.x = value; + + return this; + }, + + /** + * Sets the Body's maximum vertical velocity. + * + * @method Phaser.Physics.Arcade.Body#setMaxVelocityY + * @since 3.50.0 + * + * @param {number} value - The maximum vertical velocity, in pixels per second. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setMaxVelocityY: function (value) + { + this.maxVelocity.y = value; + + return this; + }, + /** * Sets the maximum speed the Body can move. * @@ -111995,6 +117932,31 @@ var Body = new Class({ return this; }, + /** + * If this Body is using `drag` for deceleration this property controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * + * @method Phaser.Physics.Arcade.Body#setDamping + * @since 3.50.0 + * + * @param {boolean} value - `true` to use damping, or `false` to use drag. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setDamping: function (value) + { + this.useDamping = value; + + return this; + }, + /** * Sets the Body's horizontal drag. * @@ -112240,7 +118202,79 @@ var Body = new Class({ }, /** - * The Body's horizontal position (left edge). + * This is an internal handler, called by the `ProcessX` function as part + * of the collision step. You should almost never call this directly. + * + * @method Phaser.Physics.Arcade.Body#processX + * @since 3.50.0 + * + * @param {number} x - The amount to add to the Body position. + * @param {number} [vx] - The amount to add to the Body velocity. + * @param {boolean} [left] - Set the blocked.left value? + * @param {boolean} [right] - Set the blocked.right value? + */ + processX: function (x, vx, left, right) + { + this.x += x; + + this.updateCenter(); + + if (vx !== null) + { + this.velocity.x = vx; + } + + var blocked = this.blocked; + + if (left) + { + blocked.left = true; + } + + if (right) + { + blocked.right = true; + } + }, + + /** + * This is an internal handler, called by the `ProcessY` function as part + * of the collision step. You should almost never call this directly. + * + * @method Phaser.Physics.Arcade.Body#processY + * @since 3.50.0 + * + * @param {number} y - The amount to add to the Body position. + * @param {number} [vy] - The amount to add to the Body velocity. + * @param {boolean} [up] - Set the blocked.up value? + * @param {boolean} [down] - Set the blocked.down value? + */ + processY: function (y, vy, up, down) + { + this.y += y; + + this.updateCenter(); + + if (vy !== null) + { + this.velocity.y = vy; + } + + var blocked = this.blocked; + + if (up) + { + blocked.up = true; + } + + if (down) + { + blocked.down = true; + } + }, + + /** + * The Bodys horizontal position (left edge). * * @name Phaser.Physics.Arcade.Body#x * @type {number} @@ -112261,7 +118295,7 @@ var Body = new Class({ }, /** - * The Body's vertical position (top edge). + * The Bodys vertical position (top edge). * * @name Phaser.Physics.Arcade.Body#y * @type {number} @@ -112355,7 +118389,7 @@ module.exports = Body; /***/ }), -/* 489 */ +/* 505 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112475,7 +118509,7 @@ var Collider = new Class({ /** * A name for the Collider. - * + * * Phaser does not use this value, it's for your own reference. * * @method Phaser.Physics.Arcade.Collider#setName @@ -112538,7 +118572,61 @@ module.exports = Collider; /***/ }), -/* 490 */ +/* 506 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(26); +var Vector2 = __webpack_require__(3); + +var pointStart = new Vector2(); +var pointEnd = new Vector2(); + +/** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * + * @function Phaser.Tilemaps.Components.GetTilesWithinWorldXY + * @since 3.0.0 + * + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + */ +var GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer) +{ + var worldToTileXY = layer.tilemapLayer.tilemap._convert.WorldToTileXY; + + // Top left corner of the rect, rounded down to include partial tiles + worldToTileXY(worldX, worldY, true, pointStart, camera, layer); + + var xStart = pointStart.x; + var yStart = pointStart.y; + + // Bottom right corner of the rect, rounded up to include partial tiles + worldToTileXY(worldX + width, worldY + height, false, pointEnd, camera, layer); + + var xEnd = Math.ceil(pointEnd.x); + var yEnd = Math.ceil(pointEnd.y); + + return GetTilesWithin(xStart, yStart, xEnd - xStart, yEnd - yStart, filteringOptions, layer); +}; + +module.exports = GetTilesWithinWorldXY; + + +/***/ }), +/* 507 */ /***/ (function(module, exports) { /** @@ -112579,7 +118667,7 @@ module.exports = ProcessTileCallbacks; /***/ }), -/* 491 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -112589,7 +118677,7 @@ module.exports = ProcessTileCallbacks; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var quickselect = __webpack_require__(403); +var quickselect = __webpack_require__(413); /** * @classdesc @@ -113190,7 +119278,7 @@ function multiSelect (arr, left, right, n, compare) module.exports = rbush; /***/ }), -/* 492 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113199,9 +119287,9 @@ module.exports = rbush; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileCheckX = __webpack_require__(493); -var TileCheckY = __webpack_require__(495); -var TileIntersectsBody = __webpack_require__(233); +var TileCheckX = __webpack_require__(510); +var TileCheckY = __webpack_require__(512); +var TileIntersectsBody = __webpack_require__(240); /** * The core separation function to separate a physics body and a tile. @@ -113213,7 +119301,7 @@ var TileIntersectsBody = __webpack_require__(233); * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tilemaps.Tile} tile - The tile to collide against. * @param {Phaser.Geom.Rectangle} tileWorldRect - A rectangle-like object defining the dimensions of the tile. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The tilemapLayer to collide against. * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant. * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles? * @@ -113310,7 +119398,7 @@ module.exports = SeparateTile; /***/ }), -/* 493 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113319,7 +119407,7 @@ module.exports = SeparateTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationX = __webpack_require__(494); +var ProcessTileSeparationX = __webpack_require__(511); /** * Check the body against the given tile on the X axis. @@ -113400,7 +119488,7 @@ module.exports = TileCheckX; /***/ }), -/* 494 */ +/* 511 */ /***/ (function(module, exports) { /** @@ -113447,7 +119535,7 @@ module.exports = ProcessTileSeparationX; /***/ }), -/* 495 */ +/* 512 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113456,7 +119544,7 @@ module.exports = ProcessTileSeparationX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ProcessTileSeparationY = __webpack_require__(496); +var ProcessTileSeparationY = __webpack_require__(513); /** * Check the body against the given tile on the Y axis. @@ -113537,7 +119625,7 @@ module.exports = TileCheckY; /***/ }), -/* 496 */ +/* 513 */ /***/ (function(module, exports) { /** @@ -113584,7 +119672,7 @@ module.exports = ProcessTileSeparationY; /***/ }), -/* 497 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113593,7 +119681,8 @@ module.exports = ProcessTileSeparationY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapX = __webpack_require__(231); +var GetOverlapX = __webpack_require__(238); +var ProcessX = __webpack_require__(1369); /** * Separates two overlapping bodies on the X-axis (horizontally). @@ -113610,63 +119699,40 @@ var GetOverlapX = __webpack_require__(231); * @param {boolean} overlapOnly - If `true`, the bodies will only have their overlap data set and no separation will take place. * @param {number} bias - A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. * - * @return {boolean} `true` if the two bodies overlap horizontally, otherwise `false`. + * @return {boolean} `true` if the two bodies overlap vertically, otherwise `false`. */ var SeparateX = function (body1, body2, overlapOnly, bias) { var overlap = GetOverlapX(body1, body2, overlapOnly, bias); + var body1Immovable = body1.immovable; + var body2Immovable = body2.immovable; + // Can't separate two immovable bodies, or a body with its own custom separation logic - if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX) + if (overlapOnly || overlap === 0 || (body1Immovable && body2Immovable) || body1.customSeparateX || body2.customSeparateX) { // return true if there was some overlap, otherwise false return (overlap !== 0) || (body1.embedded && body2.embedded); } - // Adjust their positions and velocities accordingly (if there was any overlap) - var v1 = body1.velocity.x; - var v2 = body2.velocity.x; + var blockedState = ProcessX.Set(body1, body2, overlap); - if (!body1.immovable && !body2.immovable) + if (!body1Immovable && !body2Immovable) { - overlap *= 0.5; - - body1.x -= overlap; - body2.x += overlap; - - var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); - var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); - var avg = (nv1 + nv2) * 0.5; - - nv1 -= avg; - nv2 -= avg; - - body1.velocity.x = avg + nv1 * body1.bounce.x; - body2.velocity.x = avg + nv2 * body2.bounce.x; - } - else if (!body1.immovable) - { - body1.x -= overlap; - body1.velocity.x = v2 - v1 * body1.bounce.x; - - // This is special case code that handles things like vertically moving platforms you can ride - if (body2.moves) + if (blockedState > 0) { - body1.y += (body2.y - body2.prev.y) * body2.friction.y; - body1._dy = body1.y - body1.prev.y; + return true; } - } - else - { - body2.x += overlap; - body2.velocity.x = v1 - v2 * body2.bounce.x; - // This is special case code that handles things like vertically moving platforms you can ride - if (body1.moves) - { - body2.y += (body1.y - body1.prev.y) * body1.friction.y; - body2._dy = body2.y - body2.prev.y; - } + return ProcessX.Check(); + } + else if (body1Immovable) + { + ProcessX.RunImmovableBody1(blockedState); + } + else if (body2Immovable) + { + ProcessX.RunImmovableBody2(blockedState); } // If we got this far then there WAS overlap, and separation is complete, so return true @@ -113677,7 +119743,7 @@ module.exports = SeparateX; /***/ }), -/* 498 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113686,7 +119752,8 @@ module.exports = SeparateX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetOverlapY = __webpack_require__(232); +var GetOverlapY = __webpack_require__(239); +var ProcessY = __webpack_require__(1370); /** * Separates two overlapping bodies on the Y-axis (vertically). @@ -113709,57 +119776,34 @@ var SeparateY = function (body1, body2, overlapOnly, bias) { var overlap = GetOverlapY(body1, body2, overlapOnly, bias); + var body1Immovable = body1.immovable; + var body2Immovable = body2.immovable; + // Can't separate two immovable bodies, or a body with its own custom separation logic - if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateY || body2.customSeparateY) + if (overlapOnly || overlap === 0 || (body1Immovable && body2Immovable) || body1.customSeparateY || body2.customSeparateY) { // return true if there was some overlap, otherwise false return (overlap !== 0) || (body1.embedded && body2.embedded); } - // Adjust their positions and velocities accordingly (if there was any overlap) - var v1 = body1.velocity.y; - var v2 = body2.velocity.y; + var blockedState = ProcessY.Set(body1, body2, overlap); - if (!body1.immovable && !body2.immovable) + if (!body1Immovable && !body2Immovable) { - overlap *= 0.5; - - body1.y -= overlap; - body2.y += overlap; - - var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); - var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); - var avg = (nv1 + nv2) * 0.5; - - nv1 -= avg; - nv2 -= avg; - - body1.velocity.y = avg + nv1 * body1.bounce.y; - body2.velocity.y = avg + nv2 * body2.bounce.y; - } - else if (!body1.immovable) - { - body1.y -= overlap; - body1.velocity.y = v2 - v1 * body1.bounce.y; - - // This is special case code that handles things like horizontal moving platforms you can ride - if (body2.moves) + if (blockedState > 0) { - body1.x += (body2.x - body2.prev.x) * body2.friction.x; - body1._dx = body1.x - body1.prev.x; + return true; } - } - else - { - body2.y += overlap; - body2.velocity.y = v1 - v2 * body2.bounce.y; - // This is special case code that handles things like horizontal moving platforms you can ride - if (body1.moves) - { - body2.x += (body1.x - body1.prev.x) * body1.friction.x; - body2._dx = body2.x - body2.prev.x; - } + return ProcessY.Check(); + } + else if (body1Immovable) + { + ProcessY.RunImmovableBody1(blockedState); + } + else if (body2Immovable) + { + ProcessY.RunImmovableBody2(blockedState); } // If we got this far then there WAS overlap, and separation is complete, so return true @@ -113770,7 +119814,7 @@ module.exports = SeparateY; /***/ }), -/* 499 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -113779,10 +119823,10 @@ module.exports = SeparateY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CircleContains = __webpack_require__(57); +var CircleContains = __webpack_require__(62); var Class = __webpack_require__(0); -var CONST = __webpack_require__(52); -var RectangleContains = __webpack_require__(50); +var CONST = __webpack_require__(59); +var RectangleContains = __webpack_require__(56); var Vector2 = __webpack_require__(3); /** @@ -113844,7 +119888,7 @@ var StaticBody = new Class({ * The color of this Static Body on the debug display. * * @name Phaser.Physics.Arcade.StaticBody#debugBodyColor - * @type {integer} + * @type {number} * @since 3.0.0 */ this.debugBodyColor = world.defaults.staticBodyDebugColor; @@ -114046,6 +120090,25 @@ var StaticBody = new Class({ */ this.immovable = true; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * By default, Static Bodies are not pushable. + * + * @name Phaser.Physics.Arcade.StaticBody#pushable + * @type {boolean} + * @default false + * @since 3.50.0 + * @see Phaser.GameObjects.Components.Pushable#setPushable + */ + this.pushable = false; + /** * A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider. * @@ -114128,7 +120191,8 @@ var StaticBody = new Class({ this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; /** - * Whether this StaticBody has ever collided with another body and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. * * @name Phaser.Physics.Arcade.StaticBody#touching * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -114137,7 +120201,9 @@ var StaticBody = new Class({ this.touching = { none: true, up: false, down: false, left: false, right: false }; /** - * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. + * The values are always false for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#wasTouching * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -114146,7 +120212,8 @@ var StaticBody = new Class({ this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; /** - * Whether this StaticBody has ever collided with a tile or the world boundary. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. * * @name Phaser.Physics.Arcade.StaticBody#blocked * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -114158,7 +120225,7 @@ var StaticBody = new Class({ * The StaticBody's physics type (static by default). * * @name Phaser.Physics.Arcade.StaticBody#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.STATIC_BODY * @since 3.0.0 */ @@ -114294,8 +120361,8 @@ var StaticBody = new Class({ * @method Phaser.Physics.Arcade.StaticBody#setSize * @since 3.0.0 * - * @param {integer} [width] - The width of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. - * @param {integer} [height] - The height of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {number} [width] - The width of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {number} [height] - The height of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param {boolean} [center=true] - Place the Static Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. @@ -114759,7 +120826,7 @@ module.exports = StaticBody; /***/ }), -/* 500 */ +/* 517 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -114774,24 +120841,24 @@ module.exports = StaticBody; module.exports = { - Bounce: __webpack_require__(1417), - Collision: __webpack_require__(1418), - Force: __webpack_require__(1419), - Friction: __webpack_require__(1420), - Gravity: __webpack_require__(1421), - Mass: __webpack_require__(1422), - Sensor: __webpack_require__(1423), - SetBody: __webpack_require__(1424), - Sleep: __webpack_require__(1425), - Static: __webpack_require__(1442), - Transform: __webpack_require__(1443), - Velocity: __webpack_require__(1444) + Bounce: __webpack_require__(1479), + Collision: __webpack_require__(1480), + Force: __webpack_require__(1481), + Friction: __webpack_require__(1482), + Gravity: __webpack_require__(1483), + Mass: __webpack_require__(1484), + Sensor: __webpack_require__(1485), + SetBody: __webpack_require__(1486), + Sleep: __webpack_require__(1487), + Static: __webpack_require__(1504), + Transform: __webpack_require__(1505), + Velocity: __webpack_require__(1506) }; /***/ }), -/* 501 */ +/* 518 */ /***/ (function(module, exports) { /** @@ -114917,7 +120984,7 @@ module.exports = Pair; /***/ }), -/* 502 */ +/* 519 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115047,7 +121114,7 @@ module.exports = BasePlugin; /***/ }), -/* 503 */ +/* 520 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115056,7 +121123,53 @@ module.exports = BasePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); + +/** + * Checks if the given tile coordinate is within the isometric layer bounds, or not. + * + * @function Phaser.Tilemaps.Components.CheckIsoBounds + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to check against. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. + * + * @return {boolean} Returns `true` if the coordinates are within the iso bounds. + */ +var CheckIsoBounds = function (tileX, tileY, layer, camera) +{ + var tilemapLayer = layer.tilemapLayer; + + var cullPaddingX = tilemapLayer.cullPaddingX; + var cullPaddingY = tilemapLayer.cullPaddingY; + + var pos = tilemapLayer.tilemap.tileToWorldXY(tileX, tileY, point, camera, tilemapLayer); + + // we always subtract 1/2 of the tile's height/width to make the culling distance start from the center of the tiles. + return pos.x > camera.worldView.x + tilemapLayer.scaleX * layer.tileWidth * (-cullPaddingX - 0.5) + && pos.x < camera.worldView.right + tilemapLayer.scaleX * layer.tileWidth * (cullPaddingX - 0.5) + && pos.y > camera.worldView.y + tilemapLayer.scaleY * layer.tileHeight * (-cullPaddingY - 1.0) + && pos.y < camera.worldView.bottom + tilemapLayer.scaleY * layer.tileHeight * (cullPaddingY - 0.5); +}; + +module.exports = CheckIsoBounds; + + +/***/ }), +/* 521 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(26); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -115066,12 +121179,12 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.ReplaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer) @@ -115091,7 +121204,7 @@ module.exports = ReplaceByIndex; /***/ }), -/* 504 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115100,7 +121213,1143 @@ module.exports = ReplaceByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsInLayerBounds = __webpack_require__(104); +var Rectangle = __webpack_require__(9); +var SnapCeil = __webpack_require__(134); +var SnapFloor = __webpack_require__(72); + +var bounds = new Rectangle(); + +/** + * Returns the bounds in the given orthogonal layer that are within the cameras viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.CullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {Phaser.Geom.Rectangle} A rectangle containing the culled bounds. If you wish to retain this object, clone it, as it's recycled internally. + */ +var CullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY; + + return bounds.setTo( + boundsLeft, + boundsTop, + (boundsRight - boundsLeft), + (boundsBottom - boundsTop) + ); +}; + +module.exports = CullBounds; + + +/***/ }), +/* 523 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = __webpack_require__(522); +var RunCull = __webpack_require__(152); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.CullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var CullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + var bounds = CullBounds(layer, camera); + + if (tilemapLayer.skipCull || tilemapLayer.scrollFactorX !== 1 || tilemapLayer.scrollFactorY !== 1) + { + bounds.left = 0; + bounds.right = layer.width; + bounds.top = 0; + bounds.bottom = layer.height; + } + + RunCull(layer, bounds, renderOrder, outputArray); + + return outputArray; +}; + +module.exports = CullTiles; + + +/***/ }), +/* 524 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = __webpack_require__(525); +var RunCull = __webpack_require__(152); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.HexagonalCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var HexagonalCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + { + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + + var bounds = CullBounds(layer, camera); + + RunCull(layer, bounds, renderOrder, outputArray); + } + + return outputArray; +}; + +module.exports = HexagonalCullTiles; + + +/***/ }), +/* 525 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SnapCeil = __webpack_require__(134); +var SnapFloor = __webpack_require__(72); + +/** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.HexagonalCullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {object} An object containing the `left`, `right`, `top` and `bottom` bounds. + */ +var HexagonalCullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var len = layer.hexSideLength; + var rowH = ((tileH - len) / 2 + len); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, rowH, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, rowH, 0, true) + tilemapLayer.cullPaddingY; + + return { + left: boundsLeft, + right: boundsRight, + top: boundsTop, + bottom: boundsBottom + }; +}; + +module.exports = HexagonalCullBounds; + + +/***/ }), +/* 526 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CheckIsoBounds = __webpack_require__(520); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.IsometricCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var IsometricCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + + var drawLeft = 0; + var drawRight = mapWidth; + var drawTop = 0; + var drawBottom = mapHeight; + + if (!tilemapLayer.skipCull) + { + var x; + var y; + var tile; + + if (renderOrder === 0) + { + // right-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + } + + tilemapLayer.tilesDrawn = outputArray.length; + tilemapLayer.tilesTotal = mapWidth * mapHeight; + + return outputArray; +}; + +module.exports = IsometricCullTiles; + + +/***/ }), +/* 527 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = __webpack_require__(528); +var RunCull = __webpack_require__(152); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.StaggeredCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var StaggeredCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + { + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + + var bounds = CullBounds(layer, camera); + + RunCull(layer, bounds, renderOrder, outputArray); + } + + return outputArray; +}; + +module.exports = StaggeredCullTiles; + + +/***/ }), +/* 528 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SnapCeil = __webpack_require__(134); +var SnapFloor = __webpack_require__(72); + +/** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.StaggeredCullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {object} An object containing the `left`, `right`, `top` and `bottom` bounds. + */ +var StaggeredCullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH / 2, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH / 2, 0, true) + tilemapLayer.cullPaddingY; + + return { + left: boundsLeft, + right: boundsRight, + top: boundsTop, + bottom: boundsBottom + }; +}; + +module.exports = StaggeredCullBounds; + + +/***/ }), +/* 529 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from hexagonal tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.HexagonalTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var HexagonalTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = layer.hexSideLength; + var rowHeight = ((tileHeight - len) / 2 + len); + + // similar to staggered, because Tiled uses the oddr representation. + var x = layerWorldX + tileX * tileWidth + tileY % 2 * (tileWidth / 2); + var y = layerWorldY + tileY * rowHeight; + + return point.set(x, y); +}; + +module.exports = HexagonalTileToWorldXY; + + +/***/ }), +/* 530 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from isometric tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.IsometricTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var IsometricTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var x = layerWorldX + (tileX - tileY) * (tileWidth / 2); + var y = layerWorldY + (tileX + tileY) * (tileHeight / 2); + + return point.set(x, y); +}; + +module.exports = IsometricTileToWorldXY; + + +/***/ }), +/* 531 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from staggered tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.StaggeredTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var StaggeredTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var x = layerWorldX + tileX * tileWidth + tileY % 2 * (tileWidth / 2); + var y = layerWorldY + tileY * (tileHeight / 2); + + return point.set(x, y); +}; + +module.exports = StaggeredTileToWorldXY; + + +/***/ }), +/* 532 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TileToWorldX = __webpack_require__(245); +var TileToWorldY = __webpack_require__(246); +var Vector2 = __webpack_require__(3); + +/** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.TileToWorldXY + * @since 3.0.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var TileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(0, 0); } + + point.x = TileToWorldX(tileX, camera, layer); + point.y = TileToWorldY(tileY, camera, layer); + + return point; +}; + +module.exports = TileToWorldXY; + + +/***/ }), +/* 533 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from hexagonal tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.HexagonalTileToWorldY + * @since 3.50.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var HexagonalTileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = tilemapLayer.tilemap.hexSideLength; + + var rowHeight = ((tileHeight - len) / 2 + len); + + return layerWorldY + tileY * rowHeight; +}; + +module.exports = HexagonalTileToWorldY; + + +/***/ }), +/* 534 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from staggered tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.StaggeredTileToWorldY + * @since 3.50.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var StaggeredTileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return layerWorldY + tileY * (tileHeight / 2); +}; + +module.exports = StaggeredTileToWorldY; + + +/***/ }), +/* 535 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to hexagonal tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.HexagonalWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinates down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var HexagonalWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + var len = layer.hexSideLength; + var rowHeight = ((tileHeight - len) / 2 + len); + + // similar to staggered, because Tiled uses the oddr representation. + var y = (snapToFloor) ? Math.floor((worldY / rowHeight)) : (worldY / rowHeight); + var x = (snapToFloor) ? Math.floor((worldX - (y % 2) * 0.5 * tileWidth) / tileWidth) : (worldX - (y % 2) * 0.5 * tileWidth) / tileWidth; + + return point.set(x, y); +}; + +module.exports = HexagonalWorldToTileXY; + + +/***/ }), +/* 536 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to isometric tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.IsometricWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var IsometricWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + worldX -= tileWidth / 2; + + var x = (snapToFloor) ? Math.floor((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2) : ((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2); + var y = (snapToFloor) ? Math.floor((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2) : ((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2); + + return point.set(x, y); +}; + +module.exports = IsometricWorldToTileXY; + + +/***/ }), +/* 537 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to staggered tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.StaggeredWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var StaggeredWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + var y = (snapToFloor) ? Math.floor((worldY / (tileHeight / 2))) : (worldY / (tileHeight / 2)); + var x = (snapToFloor) ? Math.floor((worldX + (y % 2) * 0.5 * tileWidth) / tileWidth) : (worldX + (y % 2) * 0.5 * tileWidth) / tileWidth; + + return point.set(x, y); +}; + +module.exports = StaggeredWorldToTileXY; + + +/***/ }), +/* 538 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var WorldToTileX = __webpack_require__(247); +var WorldToTileY = __webpack_require__(248); +var Vector2 = __webpack_require__(3); + +/** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.WorldToTileXY + * @since 3.0.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (snapToFloor === undefined) { snapToFloor = true; } + if (!point) { point = new Vector2(0, 0); } + + point.x = WorldToTileX(worldX, snapToFloor, camera, layer); + point.y = WorldToTileY(worldY, snapToFloor, camera, layer); + + return point; +}; + +module.exports = WorldToTileXY; + + +/***/ }), +/* 539 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to hexagonal tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.HexagonalWorldToTileY + * @since 3.50.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var HexagonalWorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = layer.hexSideLength; + + var rowHeight = ((tileHeight - len) / 2 + len); + + return (snapToFloor) ? Math.floor(worldY / rowHeight) : worldY / rowHeight; +}; + +module.exports = HexagonalWorldToTileY; + + +/***/ }), +/* 540 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to staggered tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.StaggeredWorldToTileY + * @since 3.50.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var StaggeredWorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return (snapToFloor) ? Math.floor(worldY / (tileHeight / 2)) : worldY / (tileHeight / 2); +}; + +module.exports = StaggeredWorldToTileY; + + +/***/ }), +/* 541 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsInLayerBounds = __webpack_require__(116); /** * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns @@ -115109,8 +122358,8 @@ var IsInLayerBounds = __webpack_require__(104); * @function Phaser.Tilemaps.Components.HasTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. @@ -115133,7 +122382,7 @@ module.exports = HasTileAt; /***/ }), -/* 505 */ +/* 542 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115142,9 +122391,9 @@ module.exports = HasTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tile = __webpack_require__(75); -var IsInLayerBounds = __webpack_require__(104); -var CalculateFacesAt = __webpack_require__(235); +var Tile = __webpack_require__(81); +var IsInLayerBounds = __webpack_require__(116); +var CalculateFacesAt = __webpack_require__(244); /** * Removes the tile at the given tile coordinates in the specified layer and updates the layer's @@ -115153,17 +122402,17 @@ var CalculateFacesAt = __webpack_require__(235); * @function Phaser.Tilemaps.Components.RemoveTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. + * @param {boolean} replaceWithNull - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, layer) { - if (replaceWithNull === undefined) { replaceWithNull = false; } + if (replaceWithNull === undefined) { replaceWithNull = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } if (!IsInLayerBounds(tileX, tileY, layer)) @@ -115179,7 +122428,7 @@ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, la } else { - layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height); + layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, layer.tileWidth, layer.tileHeight); } // Recalculate faces only if the removed tile was a colliding tile @@ -115195,7 +122444,7 @@ module.exports = RemoveTileAt; /***/ }), -/* 506 */ +/* 543 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115204,11 +122453,11 @@ module.exports = RemoveTileAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var Parse2DArray = __webpack_require__(237); -var ParseCSV = __webpack_require__(507); -var ParseJSONTiled = __webpack_require__(508); -var ParseWeltmeister = __webpack_require__(519); +var Formats = __webpack_require__(38); +var Parse2DArray = __webpack_require__(250); +var ParseCSV = __webpack_require__(544); +var ParseJSONTiled = __webpack_require__(545); +var ParseWeltmeister = __webpack_require__(556); /** * Parses raw data of a given Tilemap format into a new MapData object. If no recognized data format @@ -115220,11 +122469,11 @@ var ParseWeltmeister = __webpack_require__(519); * @since 3.0.0 * * @param {string} name - The name of the tilemap, used to set the name on the MapData. - * @param {integer} mapFormat - See ../Formats.js. - * @param {(integer[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. - * @param {integer} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but + * @param {number} mapFormat - See ../Formats.js. + * @param {(number[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. + * @param {number} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but * ignored for Tiled JSON. - * @param {integer} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but + * @param {number} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but * ignored for Tiled JSON. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty @@ -115265,7 +122514,7 @@ module.exports = Parse; /***/ }), -/* 507 */ +/* 544 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115274,8 +122523,8 @@ module.exports = Parse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var Parse2DArray = __webpack_require__(237); +var Formats = __webpack_require__(38); +var Parse2DArray = __webpack_require__(250); /** * Parses a CSV string of tile indexes into a new MapData object with a single layer. @@ -115285,8 +122534,8 @@ var Parse2DArray = __webpack_require__(237); * * @param {string} name - The name of the tilemap, used to set the name on the MapData. * @param {string} data - CSV string of tile indexes. - * @param {integer} tileWidth - The width of a tile in pixels. - * @param {integer} tileHeight - The height of a tile in pixels. + * @param {number} tileWidth - The width of a tile in pixels. + * @param {number} tileHeight - The height of a tile in pixels. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty * location will get a Tile object with an index of -1. If you've a large sparsely populated map and @@ -115313,7 +122562,7 @@ module.exports = ParseCSV; /***/ }), -/* 508 */ +/* 545 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115322,14 +122571,16 @@ module.exports = ParseCSV; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var MapData = __webpack_require__(106); -var ParseTileLayers = __webpack_require__(509); -var ParseImageLayers = __webpack_require__(511); -var ParseTilesets = __webpack_require__(512); -var ParseObjectLayers = __webpack_require__(515); -var BuildTilesetIndex = __webpack_require__(517); -var AssignTileProperties = __webpack_require__(518); +var AssignTileProperties = __webpack_require__(546); +var BuildTilesetIndex = __webpack_require__(547); +var CONST = __webpack_require__(29); +var Formats = __webpack_require__(38); +var FromOrientationString = __webpack_require__(242); +var MapData = __webpack_require__(118); +var ParseImageLayers = __webpack_require__(548); +var ParseObjectLayers = __webpack_require__(549); +var ParseTileLayers = __webpack_require__(552); +var ParseTilesets = __webpack_require__(554); /** * Parses a Tiled JSON object into a new MapData object. @@ -115350,12 +122601,6 @@ var AssignTileProperties = __webpack_require__(518); */ var ParseJSONTiled = function (name, json, insertNull) { - if (json.orientation !== 'orthogonal') - { - console.warn('Only orthogonal map types are supported in this version of Phaser'); - return null; - } - // Map data will consist of: layers, objects, images, tilesets, sizes var mapData = new MapData({ width: json.width, @@ -115363,7 +122608,7 @@ var ParseJSONTiled = function (name, json, insertNull) name: name, tileWidth: json.tilewidth, tileHeight: json.tileheight, - orientation: json.orientation, + orientation: FromOrientationString(json.orientation), format: Formats.TILED_JSON, version: json.version, properties: json.properties, @@ -115371,10 +122616,16 @@ var ParseJSONTiled = function (name, json, insertNull) infinite: json.infinite }); + if (mapData.orientation === CONST.HEXAGONAL) + { + mapData.hexSideLength = json.hexsidelength; + } + mapData.layers = ParseTileLayers(json, insertNull); mapData.images = ParseImageLayers(json); var sets = ParseTilesets(json); + mapData.tilesets = sets.tilesets; mapData.imageCollections = sets.imageCollections; @@ -115391,7 +122642,7 @@ module.exports = ParseJSONTiled; /***/ }), -/* 509 */ +/* 546 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115400,257 +122651,72 @@ module.exports = ParseJSONTiled; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Base64Decode = __webpack_require__(510); -var GetFastValue = __webpack_require__(2); -var LayerData = __webpack_require__(105); -var ParseGID = __webpack_require__(238); -var Tile = __webpack_require__(75); -var CreateGroupLayer = __webpack_require__(154); +var Extend = __webpack_require__(18); /** - * Parses all tilemap layers in a Tiled JSON object into new LayerData objects. + * Copy properties from tileset to tiles. * - * @function Phaser.Tilemaps.Parsers.Tiled.ParseTileLayers + * @function Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties * @since 3.0.0 * - * @param {object} json - The Tiled JSON object. - * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map - * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). - * - * @return {Phaser.Tilemaps.LayerData[]} - An array of LayerData objects, one for each entry in - * json.layers with the type 'tilelayer'. + * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. */ -var ParseTileLayers = function (json, insertNull) +var AssignTileProperties = function (mapData) { - var infiniteMap = GetFastValue(json, 'infinite', false); - var tileLayers = []; + var layerData; + var tile; + var sid; + var set; + var row; - // State inherited from a parent group - var groupStack = []; - var curGroupState = CreateGroupLayer(json); - - while (curGroupState.i < curGroupState.layers.length || groupStack.length > 0) + // go through each of the map data layers + for (var i = 0; i < mapData.layers.length; i++) { - if (curGroupState.i >= curGroupState.layers.length) + layerData = mapData.layers[i]; + + set = null; + + // rows of tiles + for (var j = 0; j < layerData.data.length; j++) { - // Ensure recursion stack is not empty first - if (groupStack.length < 1) + row = layerData.data[j]; + + // individual tiles + for (var k = 0; k < row.length; k++) { - console.warn( - 'TilemapParser.parseTiledJSON - Invalid layer group hierarchy' - ); - break; - } + tile = row[k]; - // Return to previous recursive state - curGroupState = groupStack.pop(); - continue; - } - - var curl = curGroupState.layers[curGroupState.i]; - curGroupState.i++; - - if (curl.type !== 'tilelayer') - { - if (curl.type === 'group') - { - // Compute next state inherited from group - var nextGroupState = CreateGroupLayer(json, curl, curGroupState); - - // Preserve current state before recursing - groupStack.push(curGroupState); - curGroupState = nextGroupState; - } - - // Skip this layer OR 'recurse' (iterative style) into the group - continue; - } - - // Base64 decode data if necessary. NOTE: uncompressed base64 only. - if (curl.compression) - { - console.warn( - 'TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer \'' - + curl.name + '\'' - ); - continue; - } - else if (curl.encoding && curl.encoding === 'base64') - { - // Chunks for an infinite map - if (curl.chunks) - { - for (var i = 0; i < curl.chunks.length; i++) + if (tile === null || tile.index < 0) { - curl.chunks[i].data = Base64Decode(curl.chunks[i].data); + continue; } - } - // Non-infinite map data - if (curl.data) - { - curl.data = Base64Decode(curl.data); - } + // find the relevant tileset + sid = mapData.tiles[tile.index][2]; + set = mapData.tilesets[sid]; - delete curl.encoding; // Allow the same map to be parsed multiple times - } + // Ensure that a tile's size matches its tileset + tile.width = set.tileWidth; + tile.height = set.tileHeight; - // This is an array containing the tile indexes, one after the other. -1 = no tile, - // everything else = the tile index (starting at 1 for Tiled, 0 for CSV) If the map - // contains multiple tilesets then the indexes are relative to that which the set starts - // from. Need to set which tileset in the cache = which tileset in the JSON, if you do this - // manually it means you can use the same map data but a new tileset. - - var layerData; - var gidInfo; - var tile; - var blankTile; - - var output = []; - var x = 0; - - if (infiniteMap) - { - var layerOffsetX = (GetFastValue(curl, 'startx', 0) + curl.x); - var layerOffsetY = (GetFastValue(curl, 'starty', 0) + curl.y); - layerData = new LayerData({ - name: (curGroupState.name + curl.name), - x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + layerOffsetX * json.tilewidth), - y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + layerOffsetY * json.tileheight), - width: curl.width, - height: curl.height, - tileWidth: json.tilewidth, - tileHeight: json.tileheight, - alpha: (curGroupState.opacity * curl.opacity), - visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', []) - }); - - for (var c = 0; c < curl.height; c++) - { - output.push([ null ]); - - for (var j = 0; j < curl.width; j++) + // if that tile type has any properties, add them to the tile object + if (set.tileProperties && set.tileProperties[tile.index - set.firstgid]) { - output[c][j] = null; - } - } - - for (c = 0, len = curl.chunks.length; c < len; c++) - { - var chunk = curl.chunks[c]; - - var offsetX = (chunk.x - layerOffsetX); - var offsetY = (chunk.y - layerOffsetY); - - var y = 0; - - for (var t = 0, len2 = chunk.data.length; t < len2; t++) - { - var newOffsetX = x + offsetX; - var newOffsetY = y + offsetY; - - gidInfo = ParseGID(chunk.data[t]); - - // index, x, y, width, height - if (gidInfo.gid > 0) - { - tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth, - json.tileheight); - - // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal - // propeties into flipX, flipY and rotation - tile.rotation = gidInfo.rotation; - tile.flipX = gidInfo.flipped; - - output[newOffsetY][newOffsetX] = tile; - } - else - { - blankTile = insertNull - ? null - : new Tile(layerData, -1, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); - - output[newOffsetY][newOffsetX] = blankTile; - } - - x++; - - if (x === chunk.width) - { - y++; - x = 0; - } + tile.properties = Extend( + tile.properties, set.tileProperties[tile.index - set.firstgid] + ); } } } - else - { - layerData = new LayerData({ - name: (curGroupState.name + curl.name), - x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + curl.x), - y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + curl.y), - width: curl.width, - height: curl.height, - tileWidth: json.tilewidth, - tileHeight: json.tileheight, - alpha: (curGroupState.opacity * curl.opacity), - visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', []) - }); - - var row = []; - - // Loop through the data field in the JSON. - for (var k = 0, len = curl.data.length; k < len; k++) - { - gidInfo = ParseGID(curl.data[k]); - - // index, x, y, width, height - if (gidInfo.gid > 0) - { - tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth, - json.tileheight); - - // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal - // propeties into flipX, flipY and rotation - tile.rotation = gidInfo.rotation; - tile.flipX = gidInfo.flipped; - - row.push(tile); - } - else - { - blankTile = insertNull - ? null - : new Tile(layerData, -1, x, output.length, json.tilewidth, json.tileheight); - row.push(blankTile); - } - - x++; - - if (x === curl.width) - { - output.push(row); - x = 0; - row = []; - } - } - } - - layerData.data = output; - tileLayers.push(layerData); } - - return tileLayers; }; -module.exports = ParseTileLayers; +module.exports = AssignTileProperties; /***/ }), -/* 510 */ -/***/ (function(module, exports) { +/* 547 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -115658,41 +122724,92 @@ module.exports = ParseTileLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Tileset = __webpack_require__(119); + /** - * Decode base-64 encoded data, for example as exported by Tiled. + * Master list of tiles -> x, y, index in tileset. * - * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode + * @function Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex * @since 3.0.0 * - * @param {object} data - Base-64 encoded data to decode. + * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. * - * @return {array} Array containing the decoded bytes. + * @return {array} An array of Tileset objects. */ -var Base64Decode = function (data) +var BuildTilesetIndex = function (mapData) { - var binaryString = window.atob(data); - var len = binaryString.length; - var bytes = new Array(len / 4); + var i; + var set; + var tiles = []; - // Interpret binaryString as an array of bytes representing little-endian encoded uint32 values. - for (var i = 0; i < len; i += 4) + for (i = 0; i < mapData.imageCollections.length; i++) { - bytes[i / 4] = ( - binaryString.charCodeAt(i) | - binaryString.charCodeAt(i + 1) << 8 | - binaryString.charCodeAt(i + 2) << 16 | - binaryString.charCodeAt(i + 3) << 24 - ) >>> 0; + var collection = mapData.imageCollections[i]; + var images = collection.images; + + for (var j = 0; j < images.length; j++) + { + var image = images[j]; + + set = new Tileset(image.image, image.gid, collection.imageWidth, collection.imageHeight, 0, 0); + + set.updateTileData(collection.imageWidth, collection.imageHeight); + + mapData.tilesets.push(set); + } } - return bytes; + for (i = 0; i < mapData.tilesets.length; i++) + { + set = mapData.tilesets[i]; + + var x = set.tileMargin; + var y = set.tileMargin; + + var count = 0; + var countX = 0; + var countY = 0; + + for (var t = set.firstgid; t < set.firstgid + set.total; t++) + { + // Can add extra properties here as needed + tiles[t] = [ x, y, i ]; + + x += set.tileWidth + set.tileSpacing; + + count++; + + if (count === set.total) + { + break; + } + + countX++; + + if (countX === set.columns) + { + x = set.tileMargin; + y += set.tileHeight + set.tileSpacing; + + countX = 0; + countY++; + + if (countY === set.rows) + { + break; + } + } + } + } + + return tiles; }; -module.exports = Base64Decode; +module.exports = BuildTilesetIndex; /***/ }), -/* 511 */ +/* 548 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -115780,392 +122897,7 @@ module.exports = ParseImageLayers; /***/ }), -/* 512 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Tileset = __webpack_require__(107); -var ImageCollection = __webpack_require__(513); -var ParseObject = __webpack_require__(239); - -/** - * Tilesets and Image Collections - * - * @function Phaser.Tilemaps.Parsers.Tiled.ParseTilesets - * @since 3.0.0 - * - * @param {object} json - The Tiled JSON data. - * - * @return {object} An object containing the tileset and image collection data. - */ -var ParseTilesets = function (json) -{ - var tilesets = []; - var imageCollections = []; - var lastSet = null; - var stringID; - - for (var i = 0; i < json.tilesets.length; i++) - { - // name, firstgid, width, height, margin, spacing, properties - var set = json.tilesets[i]; - - if (set.source) - { - console.warn('Phaser can\'t load external tilesets. Use the Embed Tileset button and then export the map again.'); - } - else if (set.image) - { - var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); - - if (json.version > 1) - { - // Tiled 1.2+ - - if (Array.isArray(set.tiles)) - { - var tiles = {}; - var props = {}; - - for (var t = 0; t < set.tiles.length; t++) - { - var tile = set.tiles[t]; - - // Convert tileproperties - if (tile.properties) - { - var newPropData = {}; - - tile.properties.forEach(function (propData) - { - newPropData[propData['name']] = propData['value']; - }); - - props[tile.id] = newPropData; - } - - // Convert objectgroup - if (tile.objectgroup) - { - tiles[tile.id] = { objectgroup: tile.objectgroup }; - - if (tile.objectgroup.objects) - { - var parsedObjects2 = tile.objectgroup.objects.map( - function (obj) { return ParseObject(obj); } - ); - - tiles[tile.id].objectgroup.objects = parsedObjects2; - } - } - - // Copy animation data - if (tile.animation) - { - if (tiles.hasOwnProperty(tile.id)) - { - tiles[tile.id].animation = tile.animation; - } - else - { - tiles[tile.id] = { animation: tile.animation }; - } - } - } - - newSet.tileData = tiles; - newSet.tileProperties = props; - } - } - else - { - // Tiled 1 - - // Properties stored per-tile in object with string indexes starting at "0" - if (set.tileproperties) - { - newSet.tileProperties = set.tileproperties; - } - - // Object & terrain shapes stored per-tile in object with string indexes starting at "0" - if (set.tiles) - { - newSet.tileData = set.tiles; - - // Parse the objects into Phaser format to match handling of other Tiled objects - for (stringID in newSet.tileData) - { - var objectGroup = newSet.tileData[stringID].objectgroup; - if (objectGroup && objectGroup.objects) - { - var parsedObjects1 = objectGroup.objects.map( - function (obj) { return ParseObject(obj); } - ); - newSet.tileData[stringID].objectgroup.objects = parsedObjects1; - } - } - } - } - - // For a normal sliced tileset the row/count/size information is computed when updated. - // This is done (again) after the image is set. - newSet.updateTileData(set.imagewidth, set.imageheight); - - tilesets.push(newSet); - } - else - { - var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth, - set.tileheight, set.margin, set.spacing, set.properties); - - for (stringID in set.tiles) - { - var image = set.tiles[stringID].image; - var gid = set.firstgid + parseInt(stringID, 10); - newCollection.addImage(gid, image); - } - - imageCollections.push(newCollection); - } - - // We've got a new Tileset, so set the lastgid into the previous one - if (lastSet) - { - lastSet.lastgid = set.firstgid - 1; - } - - lastSet = set; - } - - return { tilesets: tilesets, imageCollections: imageCollections }; -}; - -module.exports = ParseTilesets; - - -/***/ }), -/* 513 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); - -/** - * @classdesc - * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image. - * - * Image Collections are normally created automatically when Tiled data is loaded. - * - * @class ImageCollection - * @memberof Phaser.Tilemaps - * @constructor - * @since 3.0.0 - * - * @param {string} name - The name of the image collection in the map data. - * @param {integer} firstgid - The first image index this image collection contains. - * @param {integer} [width=32] - Width of widest image (in pixels). - * @param {integer} [height=32] - Height of tallest image (in pixels). - * @param {integer} [margin=0] - The margin around all images in the collection (in pixels). - * @param {integer} [spacing=0] - The spacing between each image in the collection (in pixels). - * @param {object} [properties={}] - Custom Image Collection properties. - */ -var ImageCollection = new Class({ - - initialize: - - function ImageCollection (name, firstgid, width, height, margin, spacing, properties) - { - if (width === undefined || width <= 0) { width = 32; } - if (height === undefined || height <= 0) { height = 32; } - if (margin === undefined) { margin = 0; } - if (spacing === undefined) { spacing = 0; } - - /** - * The name of the Image Collection. - * - * @name Phaser.Tilemaps.ImageCollection#name - * @type {string} - * @since 3.0.0 - */ - this.name = name; - - /** - * The Tiled firstgid value. - * This is the starting index of the first image index this Image Collection contains. - * - * @name Phaser.Tilemaps.ImageCollection#firstgid - * @type {integer} - * @since 3.0.0 - */ - this.firstgid = firstgid | 0; - - /** - * The width of the widest image (in pixels). - * - * @name Phaser.Tilemaps.ImageCollection#imageWidth - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageWidth = width | 0; - - /** - * The height of the tallest image (in pixels). - * - * @name Phaser.Tilemaps.ImageCollection#imageHeight - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageHeight = height | 0; - - /** - * The margin around the images in the collection (in pixels). - * Use `setSpacing` to change. - * - * @name Phaser.Tilemaps.ImageCollection#imageMarge - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageMargin = margin | 0; - - /** - * The spacing between each image in the collection (in pixels). - * Use `setSpacing` to change. - * - * @name Phaser.Tilemaps.ImageCollection#imageSpacing - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.imageSpacing = spacing | 0; - - /** - * Image Collection-specific properties that are typically defined in the Tiled editor. - * - * @name Phaser.Tilemaps.ImageCollection#properties - * @type {object} - * @since 3.0.0 - */ - this.properties = properties || {}; - - /** - * The cached images that are a part of this collection. - * - * @name Phaser.Tilemaps.ImageCollection#images - * @type {array} - * @readonly - * @since 3.0.0 - */ - this.images = []; - - /** - * The total number of images in the image collection. - * - * @name Phaser.Tilemaps.ImageCollection#total - * @type {integer} - * @readonly - * @since 3.0.0 - */ - this.total = 0; - }, - - /** - * Returns true if and only if this image collection contains the given image index. - * - * @method Phaser.Tilemaps.ImageCollection#containsImageIndex - * @since 3.0.0 - * - * @param {integer} imageIndex - The image index to search for. - * - * @return {boolean} True if this Image Collection contains the given index. - */ - containsImageIndex: function (imageIndex) - { - return (imageIndex >= this.firstgid && imageIndex < (this.firstgid + this.total)); - }, - - /** - * Add an image to this Image Collection. - * - * @method Phaser.Tilemaps.ImageCollection#addImage - * @since 3.0.0 - * - * @param {integer} gid - The gid of the image in the Image Collection. - * @param {string} image - The the key of the image in the Image Collection and in the cache. - * - * @return {Phaser.Tilemaps.ImageCollection} This ImageCollection object. - */ - addImage: function (gid, image) - { - this.images.push({ gid: gid, image: image }); - this.total++; - - return this; - } - -}); - -module.exports = ImageCollection; - - -/***/ }), -/* 514 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var HasValue = __webpack_require__(115); - -/** - * Returns a new object that only contains the `keys` that were found on the object provided. - * If no `keys` are found, an empty object is returned. - * - * @function Phaser.Utils.Objects.Pick - * @since 3.18.0 - * - * @param {object} object - The object to pick the provided keys from. - * @param {array} keys - An array of properties to retrieve from the provided object. - * - * @return {object} A new object that only contains the `keys` that were found on the provided object. If no `keys` were found, an empty object will be returned. - */ -var Pick = function (object, keys) -{ - var obj = {}; - - for (var i = 0; i < keys.length; i++) - { - var key = keys[i]; - - if (HasValue(object, key)) - { - obj[key] = object[key]; - } - } - - return obj; -}; - -module.exports = Pick; - - -/***/ }), -/* 515 */ +/* 549 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116175,8 +122907,8 @@ module.exports = Pick; */ var GetFastValue = __webpack_require__(2); -var ParseObject = __webpack_require__(239); -var ObjectLayer = __webpack_require__(516); +var ParseObject = __webpack_require__(251); +var ObjectLayer = __webpack_require__(551); var CreateGroupLayer = __webpack_require__(154); /** @@ -116264,7 +122996,51 @@ module.exports = ParseObjectLayers; /***/ }), -/* 516 */ +/* 550 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HasValue = __webpack_require__(123); + +/** + * Returns a new object that only contains the `keys` that were found on the object provided. + * If no `keys` are found, an empty object is returned. + * + * @function Phaser.Utils.Objects.Pick + * @since 3.18.0 + * + * @param {object} object - The object to pick the provided keys from. + * @param {array} keys - An array of properties to retrieve from the provided object. + * + * @return {object} A new object that only contains the `keys` that were found on the provided object. If no `keys` were found, an empty object will be returned. + */ +var Pick = function (object, keys) +{ + var obj = {}; + + for (var i = 0; i < keys.length; i++) + { + var key = keys[i]; + + if (HasValue(object, key)) + { + obj[key] = object[key]; + } + } + + return obj; +}; + +module.exports = Pick; + + +/***/ }), +/* 551 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116386,7 +123162,7 @@ module.exports = ObjectLayer; /***/ }), -/* 517 */ +/* 552 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116395,93 +123171,269 @@ module.exports = ObjectLayer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(107); +var Base64Decode = __webpack_require__(553); +var CONST = __webpack_require__(29); +var CreateGroupLayer = __webpack_require__(154); +var FromOrientationString = __webpack_require__(242); +var GetFastValue = __webpack_require__(2); +var LayerData = __webpack_require__(117); +var ParseGID = __webpack_require__(252); +var Tile = __webpack_require__(81); /** - * Master list of tiles -> x, y, index in tileset. + * Parses all tilemap layers in a Tiled JSON object into new LayerData objects. * - * @function Phaser.Tilemaps.Parsers.Tiled.BuildTilesetIndex + * @function Phaser.Tilemaps.Parsers.Tiled.ParseTileLayers * @since 3.0.0 * - * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. + * @param {object} json - The Tiled JSON object. + * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map + * data are handled (see {@link Phaser.Tilemaps.Parsers.Tiled.ParseJSONTiled}). * - * @return {array} An array of Tileset objects. + * @return {Phaser.Tilemaps.LayerData[]} - An array of LayerData objects, one for each entry in + * json.layers with the type 'tilelayer'. */ -var BuildTilesetIndex = function (mapData) +var ParseTileLayers = function (json, insertNull) { - var i; - var set; - var tiles = []; + var infiniteMap = GetFastValue(json, 'infinite', false); + var tileLayers = []; - for (i = 0; i < mapData.imageCollections.length; i++) + // State inherited from a parent group + var groupStack = []; + var curGroupState = CreateGroupLayer(json); + + while (curGroupState.i < curGroupState.layers.length || groupStack.length > 0) { - var collection = mapData.imageCollections[i]; - var images = collection.images; - - for (var j = 0; j < images.length; j++) + if (curGroupState.i >= curGroupState.layers.length) { - var image = images[j]; - - set = new Tileset(image.image, image.gid, collection.imageWidth, collection.imageHeight, 0, 0); - - set.updateTileData(collection.imageWidth, collection.imageHeight); - - mapData.tilesets.push(set); - } - } - - for (i = 0; i < mapData.tilesets.length; i++) - { - set = mapData.tilesets[i]; - - var x = set.tileMargin; - var y = set.tileMargin; - - var count = 0; - var countX = 0; - var countY = 0; - - for (var t = set.firstgid; t < set.firstgid + set.total; t++) - { - // Can add extra properties here as needed - tiles[t] = [ x, y, i ]; - - x += set.tileWidth + set.tileSpacing; - - count++; - - if (count === set.total) + // Ensure recursion stack is not empty first + if (groupStack.length < 1) { + console.warn( + 'TilemapParser.parseTiledJSON - Invalid layer group hierarchy' + ); break; } - countX++; + // Return to previous recursive state + curGroupState = groupStack.pop(); + continue; + } - if (countX === set.columns) + var curl = curGroupState.layers[curGroupState.i]; + curGroupState.i++; + + if (curl.type !== 'tilelayer') + { + if (curl.type === 'group') { - x = set.tileMargin; - y += set.tileHeight + set.tileSpacing; + // Compute next state inherited from group + var nextGroupState = CreateGroupLayer(json, curl, curGroupState); - countX = 0; - countY++; + // Preserve current state before recursing + groupStack.push(curGroupState); + curGroupState = nextGroupState; + } - if (countY === set.rows) + // Skip this layer OR 'recurse' (iterative style) into the group + continue; + } + + // Base64 decode data if necessary. NOTE: uncompressed base64 only. + if (curl.compression) + { + console.warn( + 'TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer \'' + + curl.name + '\'' + ); + continue; + } + else if (curl.encoding && curl.encoding === 'base64') + { + // Chunks for an infinite map + if (curl.chunks) + { + for (var i = 0; i < curl.chunks.length; i++) { - break; + curl.chunks[i].data = Base64Decode(curl.chunks[i].data); + } + } + + // Non-infinite map data + if (curl.data) + { + curl.data = Base64Decode(curl.data); + } + + delete curl.encoding; // Allow the same map to be parsed multiple times + } + + // This is an array containing the tile indexes, one after the other. -1 = no tile, + // everything else = the tile index (starting at 1 for Tiled, 0 for CSV) If the map + // contains multiple tilesets then the indexes are relative to that which the set starts + // from. Need to set which tileset in the cache = which tileset in the JSON, if you do this + // manually it means you can use the same map data but a new tileset. + + var layerData; + var gidInfo; + var tile; + var blankTile; + + var output = []; + var x = 0; + + if (infiniteMap) + { + var layerOffsetX = (GetFastValue(curl, 'startx', 0) + curl.x); + var layerOffsetY = (GetFastValue(curl, 'starty', 0) + curl.y); + + layerData = new LayerData({ + name: (curGroupState.name + curl.name), + x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + layerOffsetX * json.tilewidth), + y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + layerOffsetY * json.tileheight), + width: curl.width, + height: curl.height, + tileWidth: json.tilewidth, + tileHeight: json.tileheight, + alpha: (curGroupState.opacity * curl.opacity), + visible: (curGroupState.visible && curl.visible), + properties: GetFastValue(curl, 'properties', []), + orientation: FromOrientationString(json.orientation) + }); + + if (layerData.orientation === CONST.HEXAGONAL) + { + layerData.hexSideLength = json.hexsidelength; + } + + for (var c = 0; c < curl.height; c++) + { + output.push([ null ]); + + for (var j = 0; j < curl.width; j++) + { + output[c][j] = null; + } + } + + for (c = 0, len = curl.chunks.length; c < len; c++) + { + var chunk = curl.chunks[c]; + + var offsetX = (chunk.x - layerOffsetX); + var offsetY = (chunk.y - layerOffsetY); + + var y = 0; + + for (var t = 0, len2 = chunk.data.length; t < len2; t++) + { + var newOffsetX = x + offsetX; + var newOffsetY = y + offsetY; + + gidInfo = ParseGID(chunk.data[t]); + + // index, x, y, width, height + if (gidInfo.gid > 0) + { + tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); + + // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal + // propeties into flipX, flipY and rotation + tile.rotation = gidInfo.rotation; + tile.flipX = gidInfo.flipped; + + output[newOffsetY][newOffsetX] = tile; + } + else + { + blankTile = insertNull + ? null + : new Tile(layerData, -1, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); + + output[newOffsetY][newOffsetX] = blankTile; + } + + x++; + + if (x === chunk.width) + { + y++; + x = 0; + } } } } + else + { + layerData = new LayerData({ + name: (curGroupState.name + curl.name), + x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + curl.x), + y: (curGroupState.y + GetFastValue(curl, 'offsety', 0) + curl.y), + width: curl.width, + height: curl.height, + tileWidth: json.tilewidth, + tileHeight: json.tileheight, + alpha: (curGroupState.opacity * curl.opacity), + visible: (curGroupState.visible && curl.visible), + properties: GetFastValue(curl, 'properties', []), + orientation: FromOrientationString(json.orientation) + }); + + if (layerData.orientation === CONST.HEXAGONAL) + { + layerData.hexSideLength = json.hexsidelength; + } + var row = []; + + // Loop through the data field in the JSON. + for (var k = 0, len = curl.data.length; k < len; k++) + { + gidInfo = ParseGID(curl.data[k]); + + // index, x, y, width, height + if (gidInfo.gid > 0) + { + tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth, json.tileheight); + + // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal + // propeties into flipX, flipY and rotation + tile.rotation = gidInfo.rotation; + tile.flipX = gidInfo.flipped; + + row.push(tile); + } + else + { + blankTile = insertNull + ? null + : new Tile(layerData, -1, x, output.length, json.tilewidth, json.tileheight); + row.push(blankTile); + } + + x++; + + if (x === curl.width) + { + output.push(row); + x = 0; + row = []; + } + } + } + + layerData.data = output; + tileLayers.push(layerData); } - return tiles; + return tileLayers; }; -module.exports = BuildTilesetIndex; +module.exports = ParseTileLayers; /***/ }), -/* 518 */ -/***/ (function(module, exports, __webpack_require__) { +/* 553 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -116489,71 +123441,41 @@ module.exports = BuildTilesetIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); - /** - * Copy properties from tileset to tiles. + * Decode base-64 encoded data, for example as exported by Tiled. * - * @function Phaser.Tilemaps.Parsers.Tiled.AssignTileProperties + * @function Phaser.Tilemaps.Parsers.Tiled.Base64Decode * @since 3.0.0 * - * @param {Phaser.Tilemaps.MapData} mapData - The Map Data object. + * @param {object} data - Base-64 encoded data to decode. + * + * @return {array} Array containing the decoded bytes. */ -var AssignTileProperties = function (mapData) +var Base64Decode = function (data) { - var layerData; - var tile; - var sid; - var set; - var row; + var binaryString = window.atob(data); + var len = binaryString.length; + var bytes = new Array(len / 4); - // go through each of the map data layers - for (var i = 0; i < mapData.layers.length; i++) + // Interpret binaryString as an array of bytes representing little-endian encoded uint32 values. + for (var i = 0; i < len; i += 4) { - layerData = mapData.layers[i]; - - set = null; - - // rows of tiles - for (var j = 0; j < layerData.data.length; j++) - { - row = layerData.data[j]; - - // individual tiles - for (var k = 0; k < row.length; k++) - { - tile = row[k]; - - if (tile === null || tile.index < 0) - { - continue; - } - - // find the relevant tileset - sid = mapData.tiles[tile.index][2]; - set = mapData.tilesets[sid]; - - // Ensure that a tile's size matches its tileset - tile.width = set.tileWidth; - tile.height = set.tileHeight; - - // if that tile type has any properties, add them to the tile object - if (set.tileProperties && set.tileProperties[tile.index - set.firstgid]) - { - tile.properties = Extend( - tile.properties, set.tileProperties[tile.index - set.firstgid] - ); - } - } - } + bytes[i / 4] = ( + binaryString.charCodeAt(i) | + binaryString.charCodeAt(i + 1) << 8 | + binaryString.charCodeAt(i + 2) << 16 | + binaryString.charCodeAt(i + 3) << 24 + ) >>> 0; } + + return bytes; }; -module.exports = AssignTileProperties; +module.exports = Base64Decode; /***/ }), -/* 519 */ +/* 554 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116562,10 +123484,363 @@ module.exports = AssignTileProperties; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = __webpack_require__(33); -var MapData = __webpack_require__(106); -var ParseTileLayers = __webpack_require__(520); -var ParseTilesets = __webpack_require__(521); +var Tileset = __webpack_require__(119); +var ImageCollection = __webpack_require__(555); +var ParseObject = __webpack_require__(251); + +/** + * Tilesets and Image Collections + * + * @function Phaser.Tilemaps.Parsers.Tiled.ParseTilesets + * @since 3.0.0 + * + * @param {object} json - The Tiled JSON data. + * + * @return {object} An object containing the tileset and image collection data. + */ +var ParseTilesets = function (json) +{ + var tilesets = []; + var imageCollections = []; + var lastSet = null; + var stringID; + + for (var i = 0; i < json.tilesets.length; i++) + { + // name, firstgid, width, height, margin, spacing, properties + var set = json.tilesets[i]; + + if (set.source) + { + console.warn('External tilesets unsupported. Use Embed Tileset and re-export'); + } + else if (set.image) + { + var newSet = new Tileset(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing); + + if (json.version > 1) + { + // Tiled 1.2+ + + if (Array.isArray(set.tiles)) + { + var tiles = {}; + var props = {}; + + for (var t = 0; t < set.tiles.length; t++) + { + var tile = set.tiles[t]; + + // Convert tileproperties + if (tile.properties) + { + var newPropData = {}; + + tile.properties.forEach(function (propData) + { + newPropData[propData['name']] = propData['value']; + }); + + props[tile.id] = newPropData; + } + + // Convert objectgroup + if (tile.objectgroup) + { + tiles[tile.id] = { objectgroup: tile.objectgroup }; + + if (tile.objectgroup.objects) + { + var parsedObjects2 = tile.objectgroup.objects.map(function (obj) + { + return ParseObject(obj); + }); + + tiles[tile.id].objectgroup.objects = parsedObjects2; + } + } + + // Copy animation data + if (tile.animation) + { + if (tiles.hasOwnProperty(tile.id)) + { + tiles[tile.id].animation = tile.animation; + } + else + { + tiles[tile.id] = { animation: tile.animation }; + } + } + } + + newSet.tileData = tiles; + newSet.tileProperties = props; + } + } + else + { + // Tiled 1 + + // Properties stored per-tile in object with string indexes starting at "0" + if (set.tileproperties) + { + newSet.tileProperties = set.tileproperties; + } + + // Object & terrain shapes stored per-tile in object with string indexes starting at "0" + if (set.tiles) + { + newSet.tileData = set.tiles; + + // Parse the objects into Phaser format to match handling of other Tiled objects + for (stringID in newSet.tileData) + { + var objectGroup = newSet.tileData[stringID].objectgroup; + + if (objectGroup && objectGroup.objects) + { + var parsedObjects1 = objectGroup.objects.map(function (obj) + { + return ParseObject(obj); + }); + + newSet.tileData[stringID].objectgroup.objects = parsedObjects1; + } + } + } + } + + // For a normal sliced tileset the row/count/size information is computed when updated. + // This is done (again) after the image is set. + newSet.updateTileData(set.imagewidth, set.imageheight); + + tilesets.push(newSet); + } + else + { + var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing, set.properties); + + var maxId = 0; + + for (t = 0; t < set.tiles.length; t++) + { + tile = set.tiles[t]; + + var image = tile.image; + var tileId = parseInt(tile.id, 10); + var gid = set.firstgid + tileId; + newCollection.addImage(gid, image); + + maxId = Math.max(tileId, maxId); + } + + newCollection.maxId = maxId; + + imageCollections.push(newCollection); + } + + // We've got a new Tileset, so set the lastgid into the previous one + if (lastSet) + { + lastSet.lastgid = set.firstgid - 1; + } + + lastSet = set; + } + + return { tilesets: tilesets, imageCollections: imageCollections }; +}; + +module.exports = ParseTilesets; + + +/***/ }), +/* 555 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * An Image Collection is a special Tile Set containing multiple images, with no slicing into each image. + * + * Image Collections are normally created automatically when Tiled data is loaded. + * + * @class ImageCollection + * @memberof Phaser.Tilemaps + * @constructor + * @since 3.0.0 + * + * @param {string} name - The name of the image collection in the map data. + * @param {number} firstgid - The first image index this image collection contains. + * @param {number} [width=32] - Width of widest image (in pixels). + * @param {number} [height=32] - Height of tallest image (in pixels). + * @param {number} [margin=0] - The margin around all images in the collection (in pixels). + * @param {number} [spacing=0] - The spacing between each image in the collection (in pixels). + * @param {object} [properties={}] - Custom Image Collection properties. + */ +var ImageCollection = new Class({ + + initialize: + + function ImageCollection (name, firstgid, width, height, margin, spacing, properties) + { + if (width === undefined || width <= 0) { width = 32; } + if (height === undefined || height <= 0) { height = 32; } + if (margin === undefined) { margin = 0; } + if (spacing === undefined) { spacing = 0; } + + /** + * The name of the Image Collection. + * + * @name Phaser.Tilemaps.ImageCollection#name + * @type {string} + * @since 3.0.0 + */ + this.name = name; + + /** + * The Tiled firstgid value. + * This is the starting index of the first image index this Image Collection contains. + * + * @name Phaser.Tilemaps.ImageCollection#firstgid + * @type {number} + * @since 3.0.0 + */ + this.firstgid = firstgid | 0; + + /** + * The width of the widest image (in pixels). + * + * @name Phaser.Tilemaps.ImageCollection#imageWidth + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageWidth = width | 0; + + /** + * The height of the tallest image (in pixels). + * + * @name Phaser.Tilemaps.ImageCollection#imageHeight + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageHeight = height | 0; + + /** + * The margin around the images in the collection (in pixels). + * Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.ImageCollection#imageMarge + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageMargin = margin | 0; + + /** + * The spacing between each image in the collection (in pixels). + * Use `setSpacing` to change. + * + * @name Phaser.Tilemaps.ImageCollection#imageSpacing + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.imageSpacing = spacing | 0; + + /** + * Image Collection-specific properties that are typically defined in the Tiled editor. + * + * @name Phaser.Tilemaps.ImageCollection#properties + * @type {object} + * @since 3.0.0 + */ + this.properties = properties || {}; + + /** + * The cached images that are a part of this collection. + * + * @name Phaser.Tilemaps.ImageCollection#images + * @type {array} + * @readonly + * @since 3.0.0 + */ + this.images = []; + + /** + * The total number of images in the image collection. + * + * @name Phaser.Tilemaps.ImageCollection#total + * @type {number} + * @readonly + * @since 3.0.0 + */ + this.total = 0; + }, + + /** + * Returns true if and only if this image collection contains the given image index. + * + * @method Phaser.Tilemaps.ImageCollection#containsImageIndex + * @since 3.0.0 + * + * @param {number} imageIndex - The image index to search for. + * + * @return {boolean} True if this Image Collection contains the given index. + */ + containsImageIndex: function (imageIndex) + { + return (imageIndex >= this.firstgid && imageIndex < (this.firstgid + this.total)); + }, + + /** + * Add an image to this Image Collection. + * + * @method Phaser.Tilemaps.ImageCollection#addImage + * @since 3.0.0 + * + * @param {number} gid - The gid of the image in the Image Collection. + * @param {string} image - The the key of the image in the Image Collection and in the cache. + * + * @return {Phaser.Tilemaps.ImageCollection} This ImageCollection object. + */ + addImage: function (gid, image) + { + this.images.push({ gid: gid, image: image }); + this.total++; + + return this; + } + +}); + +module.exports = ImageCollection; + + +/***/ }), +/* 556 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Formats = __webpack_require__(38); +var MapData = __webpack_require__(118); +var ParseTileLayers = __webpack_require__(557); +var ParseTilesets = __webpack_require__(558); /** * Parses a Weltmeister JSON object into a new MapData object. @@ -116620,7 +123895,7 @@ module.exports = ParseWeltmeister; /***/ }), -/* 520 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116629,8 +123904,8 @@ module.exports = ParseWeltmeister; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LayerData = __webpack_require__(105); -var Tile = __webpack_require__(75); +var LayerData = __webpack_require__(117); +var Tile = __webpack_require__(81); /** * Parses all tilemap layers in an Impact JSON object into new LayerData objects. @@ -116706,7 +123981,7 @@ module.exports = ParseTileLayers; /***/ }), -/* 521 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116715,7 +123990,7 @@ module.exports = ParseTileLayers; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Tileset = __webpack_require__(107); +var Tileset = __webpack_require__(119); /** * Tilesets and Image Collections @@ -116757,7 +124032,7 @@ module.exports = ParseTilesets; /***/ }), -/* 522 */ +/* 559 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -116767,17 +124042,17 @@ module.exports = ParseTilesets; */ var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var DynamicTilemapLayer = __webpack_require__(523); -var Extend = __webpack_require__(19); -var Formats = __webpack_require__(33); -var LayerData = __webpack_require__(105); -var Rotate = __webpack_require__(344); -var SpliceOne = __webpack_require__(82); -var StaticTilemapLayer = __webpack_require__(524); -var Tile = __webpack_require__(75); -var TilemapComponents = __webpack_require__(149); -var Tileset = __webpack_require__(107); +var DegToRad = __webpack_require__(34); +var Formats = __webpack_require__(38); +var GetFastValue = __webpack_require__(2); +var LayerData = __webpack_require__(117); +var Rotate = __webpack_require__(354); +var SpliceOne = __webpack_require__(103); +var Sprite = __webpack_require__(70); +var Tile = __webpack_require__(81); +var TilemapComponents = __webpack_require__(243); +var TilemapLayer = __webpack_require__(560); +var Tileset = __webpack_require__(119); /** * @callback TilemapFilterCallback @@ -116803,25 +124078,39 @@ var Tileset = __webpack_require__(107); * @classdesc * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or - * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display - * objects that actually render tiles. + * more tilemap layers, which are the display objects that actually render the tiles. * - * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free + * The Tilemap data can be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free * software package specifically for creating tile maps, and is available from: * http://www.mapeditor.org * - * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only - * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer. + * As of Phaser 3.50.0 the Tilemap API now supports the following types of map: + * + * 1) Orthogonal + * 2) Isometric + * 3) Hexagonal + * 4) Staggered + * + * Prior to this release, only orthogonal maps were supported. + * + * Another large change in 3.50 was the consolidation of Tilemap Layers. Previously, you created + * either a Static or Dynamic Tilemap Layer. However, as of 3.50 the features of both have been + * merged and the API simplified, so now there is just the single `TilemapLayer` class. + * + * A Tilemap has handy methods for getting and manipulating the tiles within a layer, allowing + * you to build or modify the tilemap data at runtime. * * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a - * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides - * it. + * TilemapLayer may have its own unique tile size that overrides this. * * As of Phaser 3.21.0, if your tilemap includes layer groups (a feature of Tiled 1.2.0+) these - * will be traversed and the following properties will affect children: - * - opacity (blended with parent) and visibility (parent overrides child) + * will be traversed and the following properties will impact children: + * + * - Opacity (blended with parent) and visibility (parent overrides child) * - Vertical and horizontal offset + * * The grouping hierarchy is not preserved and all layers will be flattened into a single array. + * * Group layers are parsed during Tilemap construction but are discarded after parsing so dynamic * layers will NOT continue to be affected by a parent. * @@ -116856,7 +124145,7 @@ var Tilemap = new Class({ * width. * * @name Phaser.Tilemaps.Tilemap#tileWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.tileWidth = mapData.tileWidth; @@ -116866,7 +124155,7 @@ var Tilemap = new Class({ * tile height. * * @name Phaser.Tilemaps.Tilemap#tileHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.tileHeight = mapData.tileHeight; @@ -116962,6 +124251,7 @@ var Tilemap = new Class({ this.heightInPixels = mapData.heightInPixels; /** + * A collection of Images, as parsed from Tiled map data. * * @name Phaser.Tilemaps.Tilemap#imageCollections * @type {Phaser.Tilemaps.ImageCollection[]} @@ -117009,10 +124299,70 @@ var Tilemap = new Class({ * The index of the currently selected LayerData object. * * @name Phaser.Tilemaps.Tilemap#currentLayerIndex - * @type {integer} + * @type {number} * @since 3.0.0 */ this.currentLayerIndex = 0; + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.Tilemap#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = mapData.hexSideLength; + + var orientation = this.orientation; + + /** + * Functions used to handle world to tile, and tile to world, conversion. + * Cached here for internal use by public methods such as `worldToTileXY`, etc. + * + * @name Phaser.Tilemaps.Tilemap#_convert + * @private + * @type {object} + * @since 3.50.0 + */ + this._convert = { + WorldToTileXY: TilemapComponents.GetWorldToTileXYFunction(orientation), + WorldToTileX: TilemapComponents.GetWorldToTileXFunction(orientation), + WorldToTileY: TilemapComponents.GetWorldToTileYFunction(orientation), + TileToWorldXY: TilemapComponents.GetTileToWorldXYFunction(orientation), + TileToWorldX: TilemapComponents.GetTileToWorldXFunction(orientation), + TileToWorldY: TilemapComponents.GetTileToWorldYFunction(orientation) + }; + }, + + /** + * @ignore + */ + createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) + { + console.warn('createBlankDynamicLayer is deprecated. Use createBlankLayer'); + + return this.createBlankLayer(name, tileset, x, y, width, height, tileWidth, tileHeight); + }, + + /** + * @ignore + */ + createDynamicLayer: function (layerID, tileset, x, y) + { + console.warn('createDynamicLayer is deprecated. Use createLayer'); + + return this.createLayer(layerID, tileset, x, y); + }, + + /** + * @ignore + */ + createStaticLayer: function (layerID, tileset, x, y) + { + console.warn('createStaticLayer is deprecated. Use createLayer'); + + return this.createLayer(layerID, tileset, x, y); }, /** @@ -117033,14 +124383,14 @@ var Tilemap = new Class({ * * You can provide either an integer (0 to 3), or the string version of the order. * - * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically + * Calling this method _after_ creating Tilemap Layers will **not** automatically * update them to use the new render order. If you call this method after creating layers, use their * own `setRenderOrder` methods to change them as needed. * * @method Phaser.Tilemaps.Tilemap#setRenderOrder * @since 3.12.0 * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @param {(number|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. * * @return {this} This Tilemap object. */ @@ -117072,17 +124422,17 @@ var Tilemap = new Class({ * @param {string} tilesetName - The name of the tileset as specified in the map data. * @param {string} [key] - The key of the Phaser.Cache image used for this tileset. If * `undefined` or `null` it will look for an image with a key matching the tilesetName parameter. - * @param {integer} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not + * @param {number} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not * given it will default to the map's tileWidth value, or the tileWidth specified in the Tiled * JSON file. - * @param {integer} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If + * @param {number} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If * not given it will default to the map's tileHeight value, or the tileHeight specified in the * Tiled JSON file. - * @param {integer} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not + * @param {number} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not * specified, it will default to 0 or the value specified in the Tiled JSON file. - * @param {integer} [tileSpacing] - The spacing between each the tile in the sheet (in pixels). + * @param {number} [tileSpacing] - The spacing between each the tile in the sheet (in pixels). * If not specified, it will default to 0 or the value specified in the Tiled JSON file. - * @param {integer} [gid=0] - If adding multiple tilesets to a blank map, specify the starting + * @param {number} [gid=0] - If adding multiple tilesets to a blank map, specify the starting * GID this set will use here. * * @return {?Phaser.Tilemaps.Tileset} Returns the Tileset object that was created or updated, or null if it @@ -117135,51 +124485,6 @@ var Tilemap = new Class({ return tileset; }, - /** - * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If - * no layer specified, the map's current layer is used. This is useful if you want to manipulate - * a map at the start of a scene, but then make it non-manipulable and optimize it for speed. - * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value - * returned from this method if you want to manipulate the new StaticTilemapLayer. - * - * @method Phaser.Tilemaps.Tilemap#convertLayerToStatic - * @since 3.0.0 - * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer)} [layer] - The name of the layer from Tiled, the - * index of the layer in the map, or a DynamicTilemapLayer. - * - * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer that was created, or null if it - * failed. - */ - convertLayerToStatic: function (layer) - { - layer = this.getLayer(layer); - - if (layer === null) { return null; } - - var dynamicLayer = layer.tilemapLayer; - - if (!dynamicLayer || !(dynamicLayer instanceof DynamicTilemapLayer)) - { - return null; - } - - var staticLayer = new StaticTilemapLayer( - dynamicLayer.scene, - dynamicLayer.tilemap, - dynamicLayer.layerIndex, - dynamicLayer.tileset, - dynamicLayer.x, - dynamicLayer.y - ); - - this.scene.sys.displayList.add(staticLayer); - - dynamicLayer.destroy(); - - return staticLayer; - }, - /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile * coordinates) within the layer. This copies all tile properties & recalculates collision @@ -117190,14 +124495,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#copy * @since 3.0.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -117205,8 +124510,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'copy')) { return this; } - if (layer !== null) { TilemapComponents.Copy( @@ -117225,23 +124528,25 @@ var Tilemap = new Class({ }, /** - * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. + * Creates a new and empty Tilemap Layer. The currently selected layer in the map is set to this new layer. * - * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer + * Prior to v3.50.0 this method was called `createBlankDynamicLayer`. + * + * @method Phaser.Tilemaps.Tilemap#createBlankLayer * @since 3.0.0 * * @param {string} name - The name of this layer. Must be unique within the map. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. - * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. - * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. - * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + * @param {number} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. + * @param {number} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. + * @param {number} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param {number} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. * - * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer that was created, or `null` if it failed. + * @return {?Phaser.Tilemaps.TilemapLayer} Returns the new layer that was created, or `null` if it failed. */ - createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) + createBlankLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) { if (x === undefined) { x = 0; } if (y === undefined) { y = 0; } @@ -117263,7 +124568,8 @@ var Tilemap = new Class({ tileWidth: tileWidth, tileHeight: tileHeight, width: width, - height: height + height: height, + orientation: this.orientation }); var row; @@ -117284,37 +124590,36 @@ var Tilemap = new Class({ this.currentLayerIndex = this.layers.length - 1; - var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); + var layer = new TilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); - dynamicLayer.setRenderOrder(this.renderOrder); + layer.setRenderOrder(this.renderOrder); - this.scene.sys.displayList.add(dynamicLayer); + this.scene.sys.displayList.add(layer); - return dynamicLayer; + return layer; }, /** - * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given + * Creates a new Tilemap Layer that renders the LayerData associated with the given * `layerID`. The currently selected layer in the map is set to this new layer. * * The `layerID` is important. If you've created your map in Tiled then you can get this by * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and * look at the layers[].name value. Either way it must match. * - * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more - * information. + * Prior to v3.50.0 this method was called `createDynamicLayer`. * - * @method Phaser.Tilemaps.Tilemap#createDynamicLayer + * @method Phaser.Tilemaps.Tilemap#createLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(number|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * - * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. + * @return {?Phaser.Tilemaps.TilemapLayer} Returns the new layer was created, or null if it failed. */ - createDynamicLayer: function (layerID, tileset, x, y) + createLayer: function (layerID, tileset, x, y) { var index = this.getLayerIndex(layerID); @@ -117353,7 +124658,7 @@ var Tilemap = new Class({ y = layerData.y; } - var layer = new DynamicTilemapLayer(this.scene, this, index, tileset, x, y); + var layer = new TilemapLayer(this.scene, this, index, tileset, x, y); layer.setRenderOrder(this.renderOrder); @@ -117363,87 +124668,188 @@ var Tilemap = new Class({ }, /** - * Creates a Sprite for every object matching the given gid in the map data. All properties from - * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy - * way to configure Sprite properties from within the map editor. For example giving an object a - * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created. + * This method will iterate through all of the objects defined in a Tiled Object Layer and then + * convert the matching results into Phaser Game Objects (by default, Sprites) * - * Custom object properties not sharing names with the Sprite's own properties are copied to the - * Sprite's {@link Phaser.GameObjects.Sprite#data data store}. + * Objects are matched on one of 3 criteria: The Object ID, the Object GID or the Object Name. + * + * Within Tiled, Object IDs are unique per Object. Object GIDs, however, are shared by all objects + * using the same image. Finally, Object Names are strings and the same name can be used on multiple + * Objects in Tiled, they do not have to be unique. + * + * You set the configuration parameter accordingly, based on which type of criteria you wish + * to match against. For example, to convert all items on an Object Layer with a `gid` of 26: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26 + * }); + * ``` + * + * Or, to convert objects with the name 'bonus': + * + * ```javascript + * createFromObjects(layerName, { + * name: 'bonus' + * }); + * ``` + * + * Or, to convert an object with a specific id: + * + * ```javascript + * createFromObjects(layerName, { + * id: 9 + * }); + * ``` + * + * You should only specify either `id`, `gid`, `name`, or none of them. Do not add more than + * one criteria to your config. If you do not specify any criteria, then _all_ objects in the + * Object Layer will be converted. + * + * By default this method will convert objects into `Sprite` instances, but you can override + * this by providing your own class type: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26, + * classType: Coin + * }); + * ``` + * + * This will convert all Objects with a gid of 26 into your custom `Coin` class. You can pass + * any class type here, but it _must_ extend `Phaser.GameObjects.GameObject` as its base class. + * Your class will always be passed 1 parameter: `scene`, which is a reference to either the Scene + * specified in the config object or, if not given, the Scene to which this Tilemap belongs. + * + * All properties from object are copied into the Game Object, so you can use this as an easy + * way to configure properties from within the map editor. For example giving an object a + * property of `alpha: 0.5` in Tiled will be reflected in the Game Object that is created. + * + * Custom object properties that do not exist as a Game Object property are set in the + * Game Objects {@link Phaser.GameObjects.GameObject#data data store}. + * + * You can use set a `container` property in the config. If given, the class will be added to + * the Container instance instead of the Scene. + * + * Finally, you can provide an array of config objects, to convert multiple types of object in + * a single call: + * + * ```javascript + * createFromObjects(layerName, [ + * { + * gid: 26, + * classType: Coin + * }, + * { + * id: 9, + * classType: BossMonster + * }, + * { + * name: 'lava', + * classType: LavaTile + * } + * ]); + * ``` + * + * The signature of this method changed significantly in v3.50.0. Prior to this, it did not take config objects. * * @method Phaser.Tilemaps.Tilemap#createFromObjects * @since 3.0.0 * - * @param {string} name - The name of the object layer (from Tiled) to create Sprites from. - * @param {(integer|string)} id - Either the id (object), gid (tile object) or name (object or - * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects - * with the same graphic. The same name can be used on multiple objects. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param {Phaser.Scene} [scene=the scene the map is within] - The Scene to create the Sprites within. + * @param {string} objectLayerName - The name of the Tiled object layer to create the Game Objects from. + * @param {Phaser.Types.Tilemaps.CreateFromObjectLayerConfig|Phaser.Types.Tilemaps.CreateFromObjectLayerConfig[]} config - A CreateFromObjects configuration object, or an array of them. * - * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. + * @return {Phaser.GameObjects.GameObject[]} An array containing the Game Objects that were created. Empty if invalid object layer, or no matching id/gid/name was found. */ - createFromObjects: function (name, id, spriteConfig, scene) + createFromObjects: function (objectLayerName, config) { - if (spriteConfig === undefined) { spriteConfig = {}; } - if (scene === undefined) { scene = this.scene; } + var results = []; - var objectLayer = this.getObjectLayer(name); + var objectLayer = this.getObjectLayer(objectLayerName); if (!objectLayer) { - console.warn('Cannot create from object. Invalid objectgroup name given: ' + name); + console.warn('createFromObjects: Invalid objectLayerName given: ' + objectLayerName); - if (typeof layerID === 'string') - { - console.warn('Valid objectgroup names:\n\t' + this.getObjectLayerNames().join(',\n\t')); - } + return results; + } - return null; + if (!Array.isArray(config)) + { + config = [ config ]; } var objects = objectLayer.objects; - var sprites = []; - for (var i = 0; i < objects.length; i++) + for (var c = 0; c < config.length; c++) { - var found = false; - var obj = objects[i]; + var singleConfig = config[c]; - if (obj.gid !== undefined && typeof id === 'number' && obj.gid === id || - obj.id !== undefined && typeof id === 'number' && obj.id === id || - obj.name !== undefined && typeof id === 'string' && obj.name === id) + var id = GetFastValue(singleConfig, 'id', null); + var gid = GetFastValue(singleConfig, 'gid', null); + var name = GetFastValue(singleConfig, 'name', null); + + var obj; + var toConvert = []; + + // Sweep to get all the objects we want to convert in this pass + for (var s = 0; s < objects.length; s++) { - found = true; + obj = objects[s]; + + if ( + (id === null && gid === null && name === null) || + (id !== null && obj.id === id) || + (gid !== null && obj.gid === gid) || + (name !== null && obj.name === name) + ) + { + toConvert.push(obj); + } } - if (found) + // Now let's convert them ... + + var classType = GetFastValue(singleConfig, 'classType', Sprite); + var scene = GetFastValue(singleConfig, 'scene', this.scene); + var container = GetFastValue(singleConfig, 'container', null); + var texture = GetFastValue(singleConfig, 'key', null); + var frame = GetFastValue(singleConfig, 'frame', null); + + for (var i = 0; i < toConvert.length; i++) { - var config = Extend({}, spriteConfig, obj.properties); + obj = toConvert[i]; - config.x = obj.x; - config.y = obj.y; + var sprite = new classType(scene); - var sprite = scene.make.sprite(config); + sprite.setName(obj.name); + sprite.setPosition(obj.x, obj.y); + sprite.setTexture(texture, frame); - sprite.name = obj.name; + if (obj.width) + { + sprite.displayWidth = obj.width; + } - if (obj.width) { sprite.displayWidth = obj.width; } - if (obj.height) { sprite.displayHeight = obj.height; } + if (obj.height) + { + sprite.displayHeight = obj.height; + } - // Origin is (0, 1) in Tiled, so find the offset that matches the Sprite's origin. - // Do not offset objects with zero dimensions (e.g. points). + // Origin is (0, 1) in Tiled, so find the offset that matches the Sprites origin. + // Do not offset objects with zero dimensions (e.g. points). var offset = { x: sprite.originX * obj.width, y: (sprite.originY - 1) * obj.height }; - // If the object is rotated, then the origin offset also needs to be rotated. + // If the object is rotated, then the origin offset also needs to be rotated. if (obj.rotation) { var angle = DegToRad(obj.rotation); + Rotate(offset, angle); + sprite.rotation = angle; } @@ -117455,23 +124861,38 @@ var Tilemap = new Class({ sprite.setFlip(obj.flippedHorizontal, obj.flippedVertical); } - if (!obj.visible) { sprite.visible = false; } - - for (var key in obj.properties) + if (!obj.visible) { - if (sprite.hasOwnProperty(key)) - { - continue; - } - - sprite.setData(key, obj.properties[key]); + sprite.visible = false; } - sprites.push(sprite); + // Set properties the class may have, or setData those it doesn't + for (var key in obj.properties) + { + if (sprite[key] !== undefined) + { + sprite[key] = obj.properties[key]; + } + else + { + sprite.setData(key, obj.properties[key]); + } + } + + if (container) + { + container.add(sprite); + } + else + { + scene.add.existing(sprite); + } + + results.push(sprite); } } - return sprites; + return results; }, /** @@ -117483,14 +124904,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createFromTiles * @since 3.0.0 * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * @param {(number|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(number|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Scene} [scene] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -117503,80 +124924,6 @@ var Tilemap = new Class({ return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, layer); }, - /** - * Creates a new StaticTilemapLayer that renders the LayerData associated with the given - * `layerID`. The currently selected layer in the map is set to this new layer. - * - * The `layerID` is important. If you've created your map in Tiled then you can get this by - * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and - * look at the layers[].name value. Either way it must match. - * - * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for - * more information. - * - * @method Phaser.Tilemaps.Tilemap#createStaticLayer - * @since 3.0.0 - * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. - * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. - * - * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed. - */ - createStaticLayer: function (layerID, tileset, x, y) - { - var index = this.getLayerIndex(layerID); - - if (index === null) - { - console.warn('Invalid Tilemap Layer ID: ' + layerID); - if (typeof layerID === 'string') - { - console.warn('Valid tilelayer names:\n\t' + this.getTileLayerNames().join(',\n\t')); - } - return null; - } - - var layerData = this.layers[index]; - - // Check for an associated static or dynamic tilemap layer - if (layerData.tilemapLayer) - { - console.warn('Tilemap Layer ID already exists:' + layerID); - return null; - } - - this.currentLayerIndex = index; - - // Default the x/y position to match Tiled layer offset, if it exists. - if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } - if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } - - var layer = new StaticTilemapLayer(this.scene, this, index, tileset, x, y); - - layer.setRenderOrder(this.renderOrder); - - this.scene.sys.displayList.add(layer); - - return layer; - }, - - /** - * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any - * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData. - * - * @method Phaser.Tilemaps.Tilemap#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAllLayers(); - this.tilesets.length = 0; - this.objects.length = 0; - this.scene = undefined; - }, - /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the * specified index. Tiles will be set to collide if the given index is a colliding index. @@ -117588,24 +124935,24 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#fill * @since 3.0.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ fill: function (index, tileX, tileY, width, height, recalculateFaces, layer) { + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } - if (this._isStaticCall(layer, 'fill')) { return this; } - TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, layer); return this; @@ -117623,7 +124970,7 @@ var Tilemap = new Class({ * @param {TilemapFilterCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. * - * @return {?Phaser.GameObjects.GameObject[]} An array of object that match the search, or null if the objectLayer given was invalid. + * @return {?Phaser.Types.Tilemaps.TiledObject[]} An array of object that match the search, or null if the objectLayer given was invalid. */ filterObjects: function (objectLayer, callback, context) { @@ -117656,12 +125003,12 @@ var Tilemap = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -117685,10 +125032,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#findByIndex * @since 3.0.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. + * @param {number} index - The tile index value to search for. + * @param {number} [skip=0] - The number of times to skip a matching tile before returning. * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -117713,7 +125060,7 @@ var Tilemap = new Class({ * @param {TilemapFindCallback} callback - The callback. Each object in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. * - * @return {?Phaser.GameObjects.GameObject} An object that matches the search, or null if no object found. + * @return {?Phaser.Types.Tilemaps.TiledObject} An object that matches the search, or null if no object found. */ findObject: function (objectLayer, callback, context) { @@ -117744,12 +125091,12 @@ var Tilemap = new Class({ * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -117773,12 +125120,12 @@ var Tilemap = new Class({ * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -117801,7 +125148,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the image to get. * - * @return {integer} The index of the image in this tilemap, or null if not found. + * @return {number} The index of the image in this tilemap, or null if not found. */ getImageIndex: function (name) { @@ -117855,15 +125202,12 @@ var Tilemap = new Class({ }, /** - * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid - * `layer` is given. + * Gets the LayerData from `this.layers` that is associated with the given `layer`, or null if the layer is invalid. * * @method Phaser.Tilemaps.Tilemap#getLayer * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the maps current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or Tilemap Layer. If not given will default to the maps current layer index. * * @return {Phaser.Tilemaps.LayerData} The corresponding LayerData within this.layers. */ @@ -117875,15 +125219,14 @@ var Tilemap = new Class({ }, /** - * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer - * is found with that name. + * Gets the ObjectLayer from `this.objects` that has the given `name`, or null if no ObjectLayer is found with that name. * * @method Phaser.Tilemaps.Tilemap#getObjectLayer * @since 3.0.0 * * @param {string} [name] - The name of the object layer from Tiled. * - * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding ObjectLayer within this.objects or null. + * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding `ObjectLayer` within `this.objects`, or null. */ getObjectLayer: function (name) { @@ -117920,11 +125263,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getLayerIndex * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a Tilemap Layer. If not given will default to the map's current layer index. * - * @return {integer} The LayerData index within this.layers. + * @return {number} The LayerData index within this.layers. */ getLayerIndex: function (layer) { @@ -117940,7 +125281,7 @@ var Tilemap = new Class({ { return layer; } - else if (layer instanceof StaticTilemapLayer || layer instanceof DynamicTilemapLayer) + else if (layer instanceof TilemapLayer) { return layer.layerIndex; } @@ -117959,7 +125300,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the layer to get. * - * @return {integer} The LayerData index within this.layers. + * @return {number} The LayerData index within this.layers. */ getLayerIndexByName: function (name) { @@ -117968,15 +125309,16 @@ var Tilemap = new Class({ /** * Gets a tile at the given tile coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -117991,16 +125333,17 @@ var Tilemap = new Class({ /** * Gets a tile at the given world coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [nonNull] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -118036,17 +125379,18 @@ var Tilemap = new Class({ /** * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -118062,15 +125406,16 @@ var Tilemap = new Class({ /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, * Line, Rectangle or Triangle. The shape should be in world coordinates. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithinShape * @since 3.0.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -118085,7 +125430,8 @@ var Tilemap = new Class({ /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY * @since 3.0.0 @@ -118095,8 +125441,8 @@ var Tilemap = new Class({ * @param {number} width - The width of the area. * @param {number} height - The height of the area. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -118135,7 +125481,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the Tileset to get. * - * @return {integer} The Tileset index within this.tilesets. + * @return {number} The Tileset index within this.tilesets. */ getTilesetIndex: function (name) { @@ -118146,14 +125492,14 @@ var Tilemap = new Class({ * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -118170,15 +125516,15 @@ var Tilemap = new Class({ * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -118217,26 +125563,24 @@ var Tilemap = new Class({ * location. If you pass in an index, only the index at the specified location will be changed. * Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. - * - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTileAt * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds. */ putTileAt: function (tile, tileX, tileY, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTileAt')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118249,26 +125593,25 @@ var Tilemap = new Class({ * specified location. If you pass in an index, only the index at the specified location will be * changed. Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. This - * cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTileAtWorldXY * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTileAtWorldXY')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118282,25 +125625,24 @@ var Tilemap = new Class({ * index at the specified location will be changed. Collision information will be recalculated * within the region tiles were changed. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTilesAt')) { return this; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118316,18 +125658,17 @@ var Tilemap = new Class({ * indexes found within the region (excluding -1) will be used for randomly assigning new tile * indexes. This method only modifies tile indexes and does not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -118335,8 +125676,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'randomize')) { return this; } - if (layer === null) { return null; } TilemapComponents.Randomize(tileX, tileY, width, height, indexes, layer); @@ -118349,14 +125688,14 @@ var Tilemap = new Class({ * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#calculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -118376,16 +125715,16 @@ var Tilemap = new Class({ * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -118403,12 +125742,12 @@ var Tilemap = new Class({ /** * Removes the given TilemapLayer from this Tilemap without destroying it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeLayer * @since 3.17.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be removed. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to be removed. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -118419,6 +125758,7 @@ var Tilemap = new Class({ if (index !== null) { SpliceOne(this.layers, index); + for (var i = index; i < this.layers.length; i++) { if (this.layers[i].tilemapLayer) @@ -118443,12 +125783,12 @@ var Tilemap = new Class({ /** * Destroys the given TilemapLayer and removes it from this Tilemap. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#destroyLayer * @since 3.17.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be destroyed. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to be destroyed. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -118478,19 +125818,17 @@ var Tilemap = new Class({ }, /** - * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or - * DynamicTilemapLayers. + * Removes all Tilemap Layers from this Tilemap and calls `destroy` on each of them. * * @method Phaser.Tilemaps.Tilemap#removeAllLayers * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ removeAllLayers: function () { var layers = this.layers; - // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData for (var i = 0; i < layers.length; i++) { if (layers[i].tilemapLayer) @@ -118510,13 +125848,11 @@ var Tilemap = new Class({ * Removes the given Tile, or an array of Tiles, from the layer to which they belong, * and optionally recalculates the collision information. * - * This cannot be applied to Tiles that belong to Static Tilemap Layers. - * * @method Phaser.Tilemaps.Tilemap#removeTile * @since 3.17.0 * * @param {(Phaser.Tilemaps.Tile|Phaser.Tilemaps.Tile[])} tiles - The Tile to remove, or an array of Tiles. - * @param {integer} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. + * @param {number} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile[]} Returns an array of Tiles that were removed. @@ -118549,28 +125885,27 @@ var Tilemap = new Class({ }, /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given tile coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull] - If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces] - If `true` (the default), the faces data will be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns the Tile that was removed, or null if the layer given was invalid. */ removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (replaceWithNull === undefined) { replaceWithNull = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'removeTileAt')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118578,29 +125913,28 @@ var Tilemap = new Class({ }, /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given world coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [replaceWithNull] - If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces] - If `true` (the default), the faces data will be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) { - layer = this.getLayer(layer); + if (replaceWithNull === undefined) { replaceWithNull = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'removeTileAtWorldXY')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118608,19 +125942,19 @@ var Tilemap = new Class({ }, /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * Draws a debug representation of the layer to the given Graphics object. This is helpful when you want to * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation * wherever you want on the screen. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#renderDebug * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -118646,15 +125980,14 @@ var Tilemap = new Class({ * @since 3.17.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. * - * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + * @return {this} This Tilemap instance. */ renderDebugFull: function (graphics, styleConfig) { var layers = this.layers; - // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData for (var i = 0; i < layers.length; i++) { TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]); @@ -118668,19 +126001,18 @@ var Tilemap = new Class({ * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does * not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -118688,8 +126020,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'replaceByIndex')) { return this; } - if (layer === null) { return null; } TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, layer); @@ -118702,21 +126032,25 @@ var Tilemap = new Class({ * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if * collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollision * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollision: function (indexes, collides, recalculateFaces, layer, updateLayer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (updateLayer === undefined) { updateLayer = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118732,21 +126066,24 @@ var Tilemap = new Class({ * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be * enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionBetween * @since 3.0.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionBetween: function (start, stop, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118765,20 +126102,23 @@ var Tilemap = new Class({ * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a * "types" property that matches any of those values, its collision flag will be updated. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty * @since 3.0.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionByProperty: function (properties, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118793,20 +126133,23 @@ var Tilemap = new Class({ * the given array. The `collides` parameter controls if collision will be enabled (true) or * disabled (false). Tile indexes not currently in the layer are not affected. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionByExclusion * @since 3.0.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionByExclusion: function (indexes, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118817,24 +126160,27 @@ var Tilemap = new Class({ }, /** - * Sets collision on the tiles within a layer by checking each tile's collision group data + * Sets collision on the tiles within a layer by checking each tiles collision group data * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * a tiles collision group, the tiles colliding information will be set. The `collides` parameter * controls if collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionFromCollisionGroup: function (collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -118848,17 +126194,17 @@ var Tilemap = new Class({ * Sets a global collision callback for the given tile index within the layer. This will affect all * tiles on this layer that have the same index. If a callback is already set for the tile index it * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. + * at a specific location on the map then see `setTileLocationCallback`. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|number[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. All values should be integers. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -118878,18 +126224,18 @@ var Tilemap = new Class({ * If a callback is already set for the tile index it will be replaced. Set the callback to null to * remove it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -118910,11 +126256,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setLayer * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setLayer: function (layer) { @@ -118935,10 +126279,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setBaseTileSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tiles the map uses for calculations. - * @param {integer} tileHeight - The height of the tiles the map uses for calculations. + * @param {number} tileWidth - The width of the tiles the map uses for calculations. + * @param {number} tileHeight - The height of the tiles the map uses for calculations. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setBaseTileSize: function (tileWidth, tileHeight) { @@ -118947,7 +126291,7 @@ var Tilemap = new Class({ this.widthInPixels = this.width * tileWidth; this.heightInPixels = this.height * tileHeight; - // Update the base tile size on all layers & tiles + // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { this.layers[i].baseTileWidth = tileWidth; @@ -118975,20 +126319,18 @@ var Tilemap = new Class({ }, /** - * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's + * Sets the tile size for a specific `layer`. Note: this does not necessarily match the maps * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any * tiles the layer has. * * @method Phaser.Tilemaps.Tilemap#setLayerTileSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tiles (in pixels) in the layer. - * @param {integer} tileHeight - The height of the tiles (in pixels) in the layer. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {number} tileWidth - The width of the tiles (in pixels) in the layer. + * @param {number} tileHeight - The height of the tiles (in pixels) in the layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setLayerTileSize: function (tileWidth, tileHeight, layer) { @@ -119025,17 +126367,16 @@ var Tilemap = new Class({ * appear to have changed! This method only modifies tile indexes and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -119043,8 +126384,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'shuffle')) { return this; } - if (layer === null) { return null; } TilemapComponents.Shuffle(tileX, tileY, width, height, layer); @@ -119057,19 +126396,18 @@ var Tilemap = new Class({ * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#swapByIndex * @since 3.0.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -119077,8 +126415,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'swapByIndex')) { return this; } - if (layer === null) { return null; } TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, layer); @@ -119090,14 +126426,14 @@ var Tilemap = new Class({ * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -119107,22 +126443,21 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.TileToWorldX(tileX, camera, layer); + return this._convert.TileToWorldX(tileX, camera, layer); }, /** * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer - * to use. If not given the current layer is used. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -119132,7 +126467,7 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.TileToWorldY(tileX, camera, layer); + return this._convert.TileToWorldY(tileX, camera, layer); }, /** @@ -119140,26 +126475,26 @@ var Tilemap = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + * @return {?Phaser.Math.Vector2} Returns a Vector2, or null if the layer given was invalid. */ - tileToWorldXY: function (tileX, tileY, point, camera, layer) + tileToWorldXY: function (tileX, tileY, vec2, camera, layer) { layer = this.getLayer(layer); if (layer === null) { return null; } - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, layer); + return this._convert.TileToWorldXY(tileX, tileY, vec2, camera, layer); }, /** @@ -119174,32 +126509,27 @@ var Tilemap = new Class({ * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 * ] * - * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * The probability of any index being picked is (the indexs weight) / (sum of all weights). This * method only modifies tile indexes and does not change collision information. * - * If no layer specified, the map's current layer is used. This - * cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ - weightedRandomize: function (tileX, tileY, width, height, weightedIndexes, layer) + weightedRandomize: function (weightedIndexes, tileX, tileY, width, height, layer) { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'weightedRandomize')) { return this; } - if (layer === null) { return null; } TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, layer); @@ -119211,16 +126541,15 @@ var Tilemap = new Class({ * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileX * @since 3.0.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer - * to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -119230,22 +126559,22 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, layer); + return this._convert.WorldToTileX(worldX, snapToFloor, camera, layer); }, /** * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileY * @since 3.0.0 * * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -119255,7 +126584,7 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, layer); + return this._convert.WorldToTileY(worldY, snapToFloor, camera, layer); }, /** @@ -119263,49 +126592,44 @@ var Tilemap = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileXY * @since 3.0.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + * @return {?Phaser.Math.Vector2} Returns a vec2, or null if the layer given was invalid. */ - worldToTileXY: function (worldX, worldY, snapToFloor, point, camera, layer) + worldToTileXY: function (worldX, worldY, snapToFloor, vec2, camera, layer) { layer = this.getLayer(layer); if (layer === null) { return null; } - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, layer); + return this._convert.WorldToTileXY(worldX, worldY, snapToFloor, vec2, camera, layer); }, /** - * Used internally to check if a layer is static and prints out a warning. + * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any + * TilemapLayers that have been created. * - * @method Phaser.Tilemaps.Tilemap#_isStaticCall - * @private + * @method Phaser.Tilemaps.Tilemap#destroy * @since 3.0.0 - * - * @return {boolean} */ - _isStaticCall: function (layer, functionName) + destroy: function () { - if (layer.tilemapLayer instanceof StaticTilemapLayer) - { - console.warn(functionName + ': You cannot change the tiles in a static tilemap layer'); - return true; - } - else - { - return false; - } + this.removeAllLayers(); + + this.tilesets.length = 0; + this.objects.length = 0; + + this.scene = null; } }); @@ -119314,7 +126638,7 @@ module.exports = Tilemap; /***/ }), -/* 523 */ +/* 560 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -119325,26 +126649,20 @@ module.exports = Tilemap; var Class = __webpack_require__(0); var Components = __webpack_require__(11); -var DynamicTilemapLayerRender = __webpack_require__(1358); var GameObject = __webpack_require__(14); -var TilemapComponents = __webpack_require__(149); +var TilemapComponents = __webpack_require__(243); +var TilemapLayerRender = __webpack_require__(1428); /** * @classdesc - * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * A Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination * with one, or more, Tilesets. * - * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a - * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the - * tiles in a DynamicTilemapLayer. - * - * Use this over a Static Tilemap Layer when you need those features. - * - * @class DynamicTilemapLayer + * @class TilemapLayer * @extends Phaser.GameObjects.GameObject * @memberof Phaser.Tilemaps * @constructor - * @since 3.0.0 + * @since 3.50.0 * * @extends Phaser.GameObjects.Components.Alpha * @extends Phaser.GameObjects.Components.BlendMode @@ -119360,12 +126678,12 @@ var TilemapComponents = __webpack_require__(149); * * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. - * @param {integer} layerIndex - The index of the LayerData associated with this layer. + * @param {number} layerIndex - The index of the LayerData associated with this layer. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ -var DynamicTilemapLayer = new Class({ +var TilemapLayer = new Class({ Extends: GameObject, @@ -119381,40 +126699,40 @@ var DynamicTilemapLayer = new Class({ Components.Transform, Components.Visible, Components.ScrollFactor, - DynamicTilemapLayerRender + TilemapLayerRender ], initialize: - function DynamicTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) + function TilemapLayer (scene, tilemap, layerIndex, tileset, x, y) { - GameObject.call(this, scene, 'DynamicTilemapLayer'); + GameObject.call(this, scene, 'TilemapLayer'); /** * Used internally by physics system to perform fast type checks. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#isTilemap + * @name Phaser.Tilemaps.TilemapLayer#isTilemap * @type {boolean} * @readonly - * @since 3.0.0 + * @since 3.50.0 */ this.isTilemap = true; /** * The Tilemap that this layer is a part of. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilemap + * @name Phaser.Tilemaps.TilemapLayer#tilemap * @type {Phaser.Tilemaps.Tilemap} - * @since 3.0.0 + * @since 3.50.0 */ this.tilemap = tilemap; /** * The index of the LayerData associated with this layer. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#layerIndex - * @type {integer} - * @since 3.0.0 + * @name Phaser.Tilemaps.TilemapLayer#layerIndex + * @type {number} + * @since 3.50.0 */ this.layerIndex = layerIndex; @@ -119422,9 +126740,9 @@ var DynamicTilemapLayer = new Class({ * The LayerData associated with this layer. LayerData can only be associated with one * tilemap layer. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#layer + * @name Phaser.Tilemaps.TilemapLayer#layer * @type {Phaser.Tilemaps.LayerData} - * @since 3.0.0 + * @since 3.50.0 */ this.layer = tilemap.layers[layerIndex]; @@ -119432,68 +126750,66 @@ var DynamicTilemapLayer = new Class({ this.layer.tilemapLayer = this; /** - * The Tileset/s associated with this layer. + * An array of `Tileset` objects associated with this layer. * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset + * @name Phaser.Tilemaps.TilemapLayer#tileset * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.0.0 + * @since 3.50.0 */ this.tileset = []; - /** - * Used internally with the canvas render. This holds the tiles that are visible within the - * camera. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#culledTiles - * @type {array} - * @since 3.0.0 - */ - this.culledTiles = []; - - /** - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#skipCull - * @type {boolean} - * @since 3.11.0 - */ - this.skipCull = false; - /** * The total number of tiles drawn by the renderer in the last frame. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesDrawn - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#tilesDrawn + * @type {number} * @readonly - * @since 3.11.0 + * @since 3.50.0 */ this.tilesDrawn = 0; /** * The total number of tiles in this layer. Updated every frame. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesTotal - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#tilesTotal + * @type {number} * @readonly - * @since 3.11.0 + * @since 3.50.0 */ this.tilesTotal = this.layer.width * this.layer.height; + /** + * Used internally during rendering. This holds the tiles that are visible within the Camera. + * + * @name Phaser.Tilemaps.TilemapLayer#culledTiles + * @type {Phaser.Tilemaps.Tile[]} + * @since 3.50.0 + */ + this.culledTiles = []; + + /** + * You can control if the camera should cull tiles on this layer before rendering them or not. + * + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + * + * @name Phaser.Tilemaps.TilemapLayer#skipCull + * @type {boolean} + * @since 3.50.0 + */ + this.skipCull = false; + /** * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. * * See the method `setCullPadding` for more details. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingX - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#cullPaddingX + * @type {number} * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ this.cullPaddingX = 1; @@ -119502,31 +126818,39 @@ var DynamicTilemapLayer = new Class({ * * See the method `setCullPadding` for more details. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingY - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#cullPaddingY + * @type {number} * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ this.cullPaddingY = 1; /** * The callback that is invoked when the tiles are culled. * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * It will call a different function based on the map orientation: * - * It will be sent 3 arguments: + * Orthogonal (the default) is `TilemapComponents.CullTiles` + * Isometric is `TilemapComponents.IsometricCullTiles` + * Hexagonal is `TilemapComponents.HexagonalCullTiles` + * Staggered is `TilemapComponents.StaggeredCullTiles` + * + * However, you can override this to call any function you like. + * + * It will be sent 4 arguments: * * 1. The Phaser.Tilemaps.LayerData object for this Layer * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * 4. The Render Order constant. * * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullCallback + * @name Phaser.Tilemaps.TilemapLayer#cullCallback * @type {function} - * @since 3.11.0 + * @since 3.50.0 */ - this.cullCallback = TilemapComponents.CullTiles; + this.cullCallback = TilemapComponents.GetCullTilesFunction(this.layer.orientation); /** * The rendering (draw) order of the tiles in this layer. @@ -119543,20 +126867,20 @@ var DynamicTilemapLayer = new Class({ * * This can be changed via the `setRenderOrder` method. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#_renderOrder - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#_renderOrder + * @type {number} * @default 0 * @private - * @since 3.12.0 + * @since 3.50.0 */ this._renderOrder = 0; /** * An array holding the mapping between the tile indexes and the tileset they belong to. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap + * @name Phaser.Tilemaps.TilemapLayer#gidMap * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.14.0 + * @since 3.50.0 */ this.gidMap = []; @@ -119572,9 +126896,9 @@ var DynamicTilemapLayer = new Class({ /** * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets + * @method Phaser.Tilemaps.TilemapLayer#setTilesets * @private - * @since 3.14.0 + * @since 3.50.0 * * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. */ @@ -119633,10 +126957,10 @@ var DynamicTilemapLayer = new Class({ * * You can provide either an integer (0 to 3), or the string version of the order. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setRenderOrder - * @since 3.12.0 + * @method Phaser.Tilemaps.TilemapLayer#setRenderOrder + * @since 3.50.0 * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @param {(number|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. * * @return {this} This Tilemap Layer object. */ @@ -119662,13 +126986,13 @@ var DynamicTilemapLayer = new Class({ * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#calculateFacesAt + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ calculateFacesAt: function (tileX, tileY) { @@ -119682,15 +127006,15 @@ var DynamicTilemapLayer = new Class({ * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#calculateFacesWithin + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ calculateFacesWithin: function (tileX, tileY, width, height) { @@ -119705,17 +127029,17 @@ var DynamicTilemapLayer = new Class({ * created. This is useful if you want to lay down special tiles in a level that are converted to * Sprites, but want to replace the tile itself with a floor tile or similar once converted. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#createFromTiles - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#createFromTiles + * @since 3.50.0 * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * @param {(number|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(number|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} [spriteConfig] - The config object to pass into the Sprite creator (i.e. * scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * @param {Phaser.Scene} [scene] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when determining the world XY * * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. */ @@ -119726,14 +127050,14 @@ var DynamicTilemapLayer = new Class({ /** * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. + * This is used internally during rendering. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#cull - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#cull + * @since 3.50.0 * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects to render. */ cull: function (camera) { @@ -119745,18 +127069,18 @@ var DynamicTilemapLayer = new Class({ * coordinates) within the layer. This copies all tile properties & recalculates collision * information in the destination region. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#copy - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#copy + * @since 3.50.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ copy: function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces) { @@ -119765,62 +127089,22 @@ var DynamicTilemapLayer = new Class({ return this; }, - /** - * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#destroy - * @since 3.0.0 - * - * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? - */ - destroy: function (removeFromTilemap) - { - if (removeFromTilemap === undefined) { removeFromTilemap = true; } - - if (!this.tilemap) - { - // Abort, we've already been destroyed - return; - } - - // Uninstall this layer only if it is still installed on the LayerData object - if (this.layer.tilemapLayer === this) - { - this.layer.tilemapLayer = undefined; - } - - if (removeFromTilemap) - { - this.tilemap.removeLayer(this); - } - - this.tilemap = undefined; - this.layer = undefined; - this.culledTiles.length = 0; - this.cullCallback = null; - - this.gidMap = []; - this.tileset = []; - - GameObject.prototype.destroy.call(this); - }, - /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the * specified index. Tiles will be set to collide if the given index is a colliding index. * Collision information in the region will be recalculated. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#fill - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#fill + * @since 3.50.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ fill: function (index, tileX, tileY, width, height, recalculateFaces) { @@ -119834,17 +127118,17 @@ var DynamicTilemapLayer = new Class({ * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#filterTiles - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#filterTiles + * @since 3.50.0 * * @param {function} callback - The callback. Each tile in the given area will be passed to this * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. @@ -119861,15 +127145,14 @@ var DynamicTilemapLayer = new Class({ * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to * the top-left. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#findByIndex - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#findByIndex + * @since 3.50.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. + * @param {number} index - The tile index value to search for. + * @param {number} [skip=0] - The number of times to skip a matching tile before returning. + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The first matching Tile object. */ findByIndex: function (findIndex, skip, reverse) { @@ -119881,18 +127164,18 @@ var DynamicTilemapLayer = new Class({ * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns * true. Similar to Array.prototype.find in vanilla JS. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#findTile + * @since 3.50.0 * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * - * @return {?Phaser.Tilemaps.Tile} + * @return {?Phaser.Tilemaps.Tile} The first Tile found at the given location. */ findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) { @@ -119903,18 +127186,18 @@ var DynamicTilemapLayer = new Class({ * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given * callback. Similar to Array.prototype.forEach in vanilla JS. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#forEachTile + * @since 3.50.0 * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {object} [context] - The context, or scope, under which the callback should be run. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) { @@ -119926,14 +127209,14 @@ var DynamicTilemapLayer = new Class({ /** * Gets a tile at the given tile coordinates from the given layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTileAt + * @since 3.50.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. + * @return {Phaser.Tilemaps.Tile} The Tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ getTileAt: function (tileX, tileY, nonNull) { @@ -119943,16 +127226,15 @@ var DynamicTilemapLayer = new Class({ /** * Gets a tile at the given world coordinates from the given layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTileAtWorldXY + * @since 3.50.0 * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ getTileAtWorldXY: function (worldX, worldY, nonNull, camera) { @@ -119962,16 +127244,16 @@ var DynamicTilemapLayer = new Class({ /** * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithin + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the area. */ getTilesWithin: function (tileX, tileY, width, height, filteringOptions) { @@ -119982,14 +127264,14 @@ var DynamicTilemapLayer = new Class({ * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, * Line, Rectangle or Triangle. The shape should be in world coordinates. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinShape - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithinShape + * @since 3.50.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the shape. */ getTilesWithinShape: function (shape, filteringOptions, camera) { @@ -119999,17 +127281,17 @@ var DynamicTilemapLayer = new Class({ /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithinWorldXY + * @since 3.50.0 * * @param {number} worldX - The world x coordinate for the top-left of the area. * @param {number} worldY - The world y coordinate for the top-left of the area. * @param {number} width - The width of the area. * @param {number} height - The height of the area. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the area. */ getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) { @@ -120020,11 +127302,11 @@ var DynamicTilemapLayer = new Class({ * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#hasTileAt + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ @@ -120037,12 +127319,12 @@ var DynamicTilemapLayer = new Class({ * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#hasTileAtWorldXY + * @since 3.50.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. * * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. */ @@ -120057,15 +127339,15 @@ var DynamicTilemapLayer = new Class({ * location. If you pass in an index, only the index at the specified location will be changed. * Collision information will be recalculated at the specified location. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#putTileAt + * @since 3.50.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The Tile object that was inserted at the given coordinates. */ putTileAt: function (tile, tileX, tileY, recalculateFaces) { @@ -120078,16 +127360,16 @@ var DynamicTilemapLayer = new Class({ * specified location. If you pass in an index, only the index at the specified location will be * changed. Collision information will be recalculated at the specified location. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#putTileAtWorldXY + * @since 3.50.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The Tile object that was inserted at the given coordinates. */ putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera) { @@ -120101,15 +127383,15 @@ var DynamicTilemapLayer = new Class({ * index at the specified location will be changed. Collision information will be recalculated * within the region tiles were changed. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#putTilesAt + * @since 3.50.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces) { @@ -120125,16 +127407,16 @@ var DynamicTilemapLayer = new Class({ * indexes found within the region (excluding -1) will be used for randomly assigning new tile * indexes. This method only modifies tile indexes and does not change collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#randomize + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} [indexes] - An array of indexes to randomly draw from during randomization. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ randomize: function (tileX, tileY, width, height, indexes) { @@ -120144,14 +127426,14 @@ var DynamicTilemapLayer = new Class({ }, /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's + * Removes the tile at the given tile coordinates in the specified layer and updates the layers * collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#removeTileAt + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * @@ -120163,19 +127445,19 @@ var DynamicTilemapLayer = new Class({ }, /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's + * Removes the tile at the given world coordinates in the specified layer and updates the layers * collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#removeTileAtWorldXY + * @since 3.50.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Tilemaps.Tile} A Tile object. + * @return {Phaser.Tilemaps.Tile} The Tile object that was removed from the given location. */ removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera) { @@ -120188,13 +127470,13 @@ var DynamicTilemapLayer = new Class({ * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation * wherever you want on the screen. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderDebug - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#renderDebug + * @since 3.50.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ renderDebug: function (graphics, styleConfig) { @@ -120208,17 +127490,17 @@ var DynamicTilemapLayer = new Class({ * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does * not change collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#replaceByIndex + * @since 3.50.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height) { @@ -120229,12 +127511,13 @@ var DynamicTilemapLayer = new Class({ /** * You can control if the Cameras should cull tiles before rendering them or not. + * * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. * * However, there are some instances when you may wish to disable this. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setSkipCull - * @since 3.11.0 + * @method Phaser.Tilemaps.TilemapLayer#setSkipCull + * @since 3.50.0 * * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. * @@ -120256,11 +127539,11 @@ var DynamicTilemapLayer = new Class({ * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCullPadding - * @since 3.11.0 + * @method Phaser.Tilemaps.TilemapLayer#setCullPadding + * @since 3.50.0 * - * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. - * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. + * @param {number} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. + * @param {number} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. * * @return {this} This Tilemap Layer object. */ @@ -120280,18 +127563,15 @@ var DynamicTilemapLayer = new Class({ * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if * collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * @method Phaser.Tilemaps.TilemapLayer#setCollision + * @since 3.50.0 * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollision - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. * - * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + * @return {this} This Tilemap Layer object. */ setCollision: function (indexes, collides, recalculateFaces, updateLayer) { @@ -120306,15 +127586,15 @@ var DynamicTilemapLayer = new Class({ * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be * enabled (true) or disabled (false). * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionBetween - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionBetween + * @since 3.50.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionBetween: function (start, stop, collides, recalculateFaces) { @@ -120332,14 +127612,14 @@ var DynamicTilemapLayer = new Class({ * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a * "types" property that matches any of those values, its collision flag will be updated. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByProperty - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionByProperty + * @since 3.50.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionByProperty: function (properties, collides, recalculateFaces) { @@ -120353,14 +127633,14 @@ var DynamicTilemapLayer = new Class({ * the given array. The `collides` parameter controls if collision will be enabled (true) or * disabled (false). Tile indexes not currently in the layer are not affected. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByExclusion - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionByExclusion + * @since 3.50.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionByExclusion: function (indexes, collides, recalculateFaces) { @@ -120375,13 +127655,13 @@ var DynamicTilemapLayer = new Class({ * a tiles collision group, the tile's colliding information will be set. The `collides` parameter * controls if collision will be enabled (true) or disabled (false). * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionFromCollisionGroup - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setCollisionFromCollisionGroup + * @since 3.50.0 * * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setCollisionFromCollisionGroup: function (collides, recalculateFaces) { @@ -120396,14 +127676,14 @@ var DynamicTilemapLayer = new Class({ * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile * at a specific location on the map then see setTileLocationCallback. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileIndexCallback - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setTileIndexCallback + * @since 3.50.0 * - * @param {(integer|integer[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|number[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setTileIndexCallback: function (indexes, callback, callbackContext) { @@ -120417,17 +127697,17 @@ var DynamicTilemapLayer = new Class({ * If a callback is already set for the tile index it will be replaced. Set the callback to null to * remove it. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#setTileLocationCallback + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {function} [callback] - The callback that will be invoked when the tile is collided with. - * @param {object} [callbackContext] - The context under which the callback is called. + * @param {object} [callbackContext] - The context, or scope, under which the callback is invoked. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) { @@ -120442,15 +127722,15 @@ var DynamicTilemapLayer = new Class({ * appear to have changed! This method only modifies tile indexes and does not change collision * information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#shuffle + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ shuffle: function (tileX, tileY, width, height) { @@ -120464,17 +127744,17 @@ var DynamicTilemapLayer = new Class({ * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision * information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#swapByIndex - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#swapByIndex + * @since 3.50.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ swapByIndex: function (indexA, indexB, tileX, tileY, width, height) { @@ -120487,34 +127767,34 @@ var DynamicTilemapLayer = new Class({ * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldX + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The Tile X coordinate converted to pixels. */ tileToWorldX: function (tileX, camera) { - return TilemapComponents.TileToWorldX(tileX, camera, this.layer); + return this.tilemap.tileToWorldX(tileX, camera, this); }, /** * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldY + * @since 3.50.0 * - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The Tile Y coordinate converted to pixels. */ tileToWorldY: function (tileY, camera) { - return TilemapComponents.TileToWorldY(tileY, camera, this.layer); + return this.tilemap.tileToWorldY(tileY, camera, this); }, /** @@ -120522,19 +127802,19 @@ var DynamicTilemapLayer = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldXY + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Math.Vector2} + * @return {Phaser.Math.Vector2} A Vector2 containing the world coordinates of the Tile. */ tileToWorldXY: function (tileX, tileY, point, camera) { - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); + return this.tilemap.tileToWorldXY(tileX, tileY, point, camera, this); }, /** @@ -120552,18 +127832,16 @@ var DynamicTilemapLayer = new Class({ * The probability of any index being choose is (the index's weight) / (sum of all weights). This * method only modifies tile indexes and does not change collision information. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#weightedRandomize + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ weightedRandomize: function (tileX, tileY, width, height, weightedIndexes) { @@ -120576,36 +127854,36 @@ var DynamicTilemapLayer = new Class({ * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#worldToTileX + * @since 3.50.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The tile X coordinate based on the world value. */ worldToTileX: function (worldX, snapToFloor, camera) { - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); + return this.tilemap.worldToTileX(worldX, snapToFloor, camera, this); }, /** * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the * layers position, scale and scroll. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#worldToTileY + * @since 3.50.0 * * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {number} + * @return {number} The tile Y coordinate based on the world value. */ worldToTileY: function (worldY, snapToFloor, camera) { - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); + return this.tilemap.worldToTileY(worldY, snapToFloor, camera, this); }, /** @@ -120613,1497 +127891,27 @@ var DynamicTilemapLayer = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#worldToTileXY + * @since 3.50.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. * - * @return {Phaser.Math.Vector2} + * @return {Phaser.Math.Vector2} A Vector2 containing the tile coordinates of the world values. */ worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) { - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); - } - -}); - -module.exports = DynamicTilemapLayer; - - -/***/ }), -/* 524 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var Components = __webpack_require__(11); -var GameEvents = __webpack_require__(21); -var GameObject = __webpack_require__(14); -var ModelViewProjection = __webpack_require__(113); -var StaticTilemapLayerRender = __webpack_require__(1361); -var TilemapComponents = __webpack_require__(149); -var TransformMatrix = __webpack_require__(31); -var Utils = __webpack_require__(10); - -/** - * @classdesc - * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination - * with one, or more, Tilesets. - * - * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile - * effects like tint or alpha, or change the tiles or tilesets the layer uses. - * - * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. - * - * @class StaticTilemapLayer - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.Tilemaps - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Alpha - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.ComputedSize - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Flip - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.Renderer.WebGL.Pipelines.ModelViewProjection - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. - * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param {number} [x=0] - The world x position where the top left of this layer will be placed. - * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - */ -var StaticTilemapLayer = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Alpha, - Components.BlendMode, - Components.ComputedSize, - Components.Depth, - Components.Flip, - Components.GetBounds, - Components.Origin, - Components.Pipeline, - Components.Transform, - Components.Visible, - Components.ScrollFactor, - StaticTilemapLayerRender, - ModelViewProjection - ], - - initialize: - - function StaticTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) - { - GameObject.call(this, scene, 'StaticTilemapLayer'); - - /** - * Used internally by physics system to perform fast type checks. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#isTilemap - * @type {boolean} - * @readonly - * @since 3.0.0 - */ - this.isTilemap = true; - - /** - * The Tilemap that this layer is a part of. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilemap - * @type {Phaser.Tilemaps.Tilemap} - * @since 3.0.0 - */ - this.tilemap = tilemap; - - /** - * The index of the LayerData associated with this layer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#layerIndex - * @type {integer} - * @since 3.0.0 - */ - this.layerIndex = layerIndex; - - /** - * The LayerData associated with this layer. LayerData can only be associated with one - * tilemap layer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#layer - * @type {Phaser.Tilemaps.LayerData} - * @since 3.0.0 - */ - this.layer = tilemap.layers[layerIndex]; - - // Link the LayerData with this static tilemap layer - this.layer.tilemapLayer = this; - - /** - * The Tileset/s associated with this layer. - * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.0.0 - */ - this.tileset = []; - - /** - * Used internally by the Canvas renderer. - * This holds the tiles that are visible within the camera in the last frame. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#culledTiles - * @type {array} - * @since 3.0.0 - */ - this.culledTiles = []; - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#skipCull - * @type {boolean} - * @since 3.12.0 - */ - this.skipCull = false; - - /** - * Canvas only. - * - * The total number of tiles drawn by the renderer in the last frame. - * - * This only works when rending with Canvas. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilesDrawn - * @type {integer} - * @readonly - * @since 3.12.0 - */ - this.tilesDrawn = 0; - - /** - * Canvas only. - * - * The total number of tiles in this layer. Updated every frame. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilesTotal - * @type {integer} - * @readonly - * @since 3.12.0 - */ - this.tilesTotal = this.layer.width * this.layer.height; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. - * - * See the method `setCullPadding` for more details. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingX - * @type {integer} - * @default 1 - * @since 3.12.0 - */ - this.cullPaddingX = 1; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. - * - * See the method `setCullPadding` for more details. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingY - * @type {integer} - * @default 1 - * @since 3.12.0 - */ - this.cullPaddingY = 1; - - /** - * Canvas only. - * - * The callback that is invoked when the tiles are culled. - * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. - * - * It will be sent 3 arguments: - * - * 1. The Phaser.Tilemaps.LayerData object for this Layer - * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. - * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. - * - * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullCallback - * @type {function} - * @since 3.12.0 - */ - this.cullCallback = TilemapComponents.CullTiles; - - /** - * A reference to the renderer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#renderer - * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} - * @private - * @since 3.0.0 - */ - this.renderer = scene.sys.game.renderer; - - /** - * An array of vertex buffer objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer - * @type {WebGLBuffer[]} - * @private - * @since 3.0.0 - */ - this.vertexBuffer = []; - - /** - * An array of ArrayBuffer objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData - * @type {ArrayBuffer[]} - * @private - * @since 3.0.0 - */ - this.bufferData = []; - - /** - * An array of Float32 Array objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32 - * @type {Float32Array[]} - * @private - * @since 3.0.0 - */ - this.vertexViewF32 = []; - - /** - * An array of Uint32 Array objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32 - * @type {Uint32Array[]} - * @private - * @since 3.0.0 - */ - this.vertexViewU32 = []; - - /** - * An array of booleans, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single boolean. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#dirty - * @type {boolean[]} - * @private - * @since 3.0.0 - */ - this.dirty = []; - - /** - * An array of integers, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single integer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount - * @type {integer[]} - * @private - * @since 3.0.0 - */ - this.vertexCount = []; - - /** - * The rendering (draw) order of the tiles in this layer. - * - * The default is 0 which is 'right-down', meaning it will draw the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * This can be changed via the `setRenderOrder` method. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#_renderOrder - * @type {integer} - * @default 0 - * @private - * @since 3.12.0 - */ - this._renderOrder = 0; - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.14.0 - */ - this._tempMatrix = new TransformMatrix(); - - /** - * An array holding the mapping between the tile indexes and the tileset they belong to. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap - * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.14.0 - */ - this.gidMap = []; - - this.setTilesets(tileset); - this.setAlpha(this.layer.alpha); - this.setPosition(x, y); - this.setOrigin(); - this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); - - this.updateVBOData(); - - this.initPipeline(); - - this.mvpInit(); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () - { - this.updateVBOData(); - }, this); + return this.tilemap.worldToTileXY(worldX, worldY, snapToFloor, point, camera, this); }, /** - * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. + * Destroys this TilemapLayer and removes its link to the associated LayerData. * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets - * @private - * @since 3.14.0 - * - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - */ - setTilesets: function (tilesets) - { - var gidMap = []; - var setList = []; - var map = this.tilemap; - - if (!Array.isArray(tilesets)) - { - tilesets = [ tilesets ]; - } - - for (var i = 0; i < tilesets.length; i++) - { - var tileset = tilesets[i]; - - if (typeof tileset === 'string') - { - tileset = map.getTileset(tileset); - } - - if (tileset) - { - setList.push(tileset); - - var s = tileset.firstgid; - - for (var t = 0; t < tileset.total; t++) - { - gidMap[s + t] = tileset; - } - } - } - - this.gidMap = gidMap; - this.tileset = setList; - }, - - /** - * Prepares the VBO data arrays for population by the `upload` method. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData - * @private - * @since 3.14.0 - * - * @return {this} This Tilemap Layer object. - */ - updateVBOData: function () - { - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - this.vertexCount[i] = 0; - this.vertexBuffer[i] = null; - this.bufferData[i] = null; - this.vertexViewF32[i] = null; - this.vertexViewU32[i] = null; - } - - return this; - }, - - /** - * If the given tileset is dirty, or hasn't been rendered before, this will create a new - * ArrayBuffer object and iterate through all of the tiles, generating batch data for - * each one, storing the final results into a STATIC vertex buffer. - * - * If the tileset isn't dirty, this method simply returns after setting the vertex buffer - * and buffering the data. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#upload - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to. - * @param {integer} tilesetIndex - The tileset index. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - upload: function (camera, tilesetIndex) - { - var pipeline = this.pipeline; - - var renderer = this.renderer; - - var gl = renderer.gl; - - var vertexBuffer = this.vertexBuffer[tilesetIndex]; - var bufferData = this.bufferData[tilesetIndex]; - - if (!this.dirty[tilesetIndex] && vertexBuffer) - { - renderer.setVertexBuffer(vertexBuffer); - - pipeline.setAttribPointers(); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData); - - return this; - } - - var layer = this.layer; - var tileset = this.tileset[tilesetIndex]; - var mapWidth = layer.width; - var mapHeight = layer.height; - var width = tileset.image.source[0].width; - var height = tileset.image.source[0].height; - var mapData = layer.data; - var tile; - var row; - var col; - var renderOrder = this._renderOrder; - var minTileIndex = tileset.firstgid; - var maxTileIndex = tileset.firstgid + tileset.total; - var vOffset = -1; - var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6; - - this.vertexCount[tilesetIndex] = 0; - - if (bufferData === null) - { - bufferData = new ArrayBuffer(bufferSize); - - this.bufferData[tilesetIndex] = bufferData; - - this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData); - this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData); - } - - if (renderOrder === 0) - { - // right-down - - for (row = 0; row < mapHeight; row++) - { - for (col = 0; col < mapWidth; col++) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 1) - { - // left-down - - for (row = 0; row < mapHeight; row++) - { - for (col = mapWidth - 1; col >= 0; col--) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 2) - { - // right-up - - for (row = mapHeight - 1; row >= 0; row--) - { - for (col = 0; col < mapWidth; col++) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 3) - { - // left-up - - for (row = mapHeight - 1; row >= 0; row--) - { - for (col = mapWidth - 1; col >= 0; col--) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - - this.dirty[tilesetIndex] = false; - - if (vertexBuffer === null) - { - vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW); - - this.vertexBuffer[tilesetIndex] = vertexBuffer; - } - - renderer.setVertexBuffer(vertexBuffer); - - pipeline.setAttribPointers(); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData); - - return this; - }, - - /** - * Add a single tile into the batch. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#batchTile - * @private - * @since 3.12.0 - * - * @param {integer} vOffset - The vertex offset. - * @param {any} tile - The tile being rendered. - * @param {any} tileset - The tileset being used for rendering. - * @param {integer} width - The width of the tileset image in pixels. - * @param {integer} height - The height of the tileset image in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with. - * @param {integer} tilesetIndex - The tileset index. - * - * @return {integer} The new vOffset value. - */ - batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex) - { - var texCoords = tileset.getTileTextureCoordinates(tile.index); - - if (!texCoords) - { - return vOffset; - } - - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - - var halfTileWidth = tileWidth / 2; - var halfTileHeight = tileHeight / 2; - - var u0 = texCoords.x / width; - var v0 = texCoords.y / height; - var u1 = (texCoords.x + tileWidth) / width; - var v1 = (texCoords.y + tileHeight) / height; - - var matrix = this._tempMatrix; - - var x = -halfTileWidth; - var y = -halfTileHeight; - - if (tile.flipX) - { - tileWidth *= -1; - x += tileset.tileWidth; - } - - if (tile.flipY) - { - tileHeight *= -1; - y += tileset.tileHeight; - } - - var xw = x + tileWidth; - var yh = y + tileHeight; - - matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1); - - var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha); - - var tx0 = matrix.getX(x, y); - var ty0 = matrix.getY(x, y); - - var tx1 = matrix.getX(x, yh); - var ty1 = matrix.getY(x, yh); - - var tx2 = matrix.getX(xw, yh); - var ty2 = matrix.getY(xw, yh); - - var tx3 = matrix.getX(xw, y); - var ty3 = matrix.getY(xw, y); - - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - var vertexViewF32 = this.vertexViewF32[tilesetIndex]; - var vertexViewU32 = this.vertexViewU32[tilesetIndex]; - - vertexViewF32[++vOffset] = tx0; - vertexViewF32[++vOffset] = ty0; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx1; - vertexViewF32[++vOffset] = ty1; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx2; - vertexViewF32[++vOffset] = ty2; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx0; - vertexViewF32[++vOffset] = ty0; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx2; - vertexViewF32[++vOffset] = ty2; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx3; - vertexViewF32[++vOffset] = ty3; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - this.vertexCount[tilesetIndex] += 6; - - return vOffset; - }, - - /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder - * @since 3.12.0 - * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. - * - * @return {this} This Tilemap Layer object. - */ - setRenderOrder: function (renderOrder) - { - var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; - - if (typeof renderOrder === 'string') - { - renderOrder = orders.indexOf(renderOrder); - } - - if (renderOrder >= 0 && renderOrder < 4) - { - this._renderOrder = renderOrder; - - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - } - } - - return this; - }, - - /** - * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting - * faces are used internally for optimizing collisions against tiles. This method is mostly used - * internally to optimize recalculating faces when only one tile has been changed. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesAt - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - calculateFacesAt: function (tileX, tileY) - { - TilemapComponents.CalculateFacesAt(tileX, tileY, this.layer); - - return this; - }, - - /** - * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the - * layer. Interesting faces are used internally for optimizing collisions against tiles. This method - * is mostly used internally. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesWithin - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - calculateFacesWithin: function (tileX, tileY, width, height) - { - TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, this.layer); - - return this; - }, - - /** - * Creates a Sprite for every object matching the given tile indexes in the layer. You can - * optionally specify if each tile will be replaced with a new tile after the Sprite has been - * created. This is useful if you want to lay down special tiles in a level that are converted to - * Sprites, but want to replace the tile itself with a floor tile or similar once converted. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#createFromTiles - * @since 3.0.0 - * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY - * - * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. - */ - createFromTiles: function (indexes, replacements, spriteConfig, scene, camera) - { - return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, this.layer); - }, - - /** - * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#cull - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - cull: function (camera) - { - return this.cullCallback(this.layer, camera, this.culledTiles); - }, - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setSkipCull - * @since 3.12.0 - * - * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. - * - * @return {this} This Tilemap Layer object. - */ - setSkipCull: function (value) - { - if (value === undefined) { value = true; } - - this.skipCull = value; - - return this; - }, - - /** - * Canvas only. - * - * When a Camera culls the tiles in this layer it does so using its view into the world, building up a - * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size - * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so - * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px - * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCullPadding - * @since 3.12.0 - * - * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. - * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. - * - * @return {this} This Tilemap Layer object. - */ - setCullPadding: function (paddingX, paddingY) - { - if (paddingX === undefined) { paddingX = 1; } - if (paddingY === undefined) { paddingY = 1; } - - this.cullPaddingX = paddingX; - this.cullPaddingY = paddingY; - - return this; - }, - - /** - * Searches the entire map layer for the first tile matching the given index, then returns that Tile - * object. If no match is found, it returns null. The search starts from the top-left tile and - * continues horizontally until it hits the end of the row, then it drops down to the next column. - * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to - * the top-left. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#findByIndex - * @since 3.0.0 - * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - findByIndex: function (findIndex, skip, reverse) - { - return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer); - }, - - /** - * Find the first tile in the given rectangular area (in tile coordinates) of the layer that - * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns - * true. Similar to Array.prototype.find in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#findTile - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {?Phaser.Tilemaps.Tile} - */ - findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns - * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#filterTiles - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. The callback should return true for tiles that pass the - * filter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * callback. Similar to Array.prototype.forEach in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#forEachTile - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - - return this; - }, - - /** - * Gets a tile at the given tile coordinates from the given layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAt - * @since 3.0.0 - * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. - */ - getTileAt: function (tileX, tileY, nonNull) - { - return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer); - }, - - /** - * Gets a tile at the given world coordinates from the given layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - X position to get the tile from (given in pixels) - * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. - */ - getTileAtWorldXY: function (worldX, worldY, nonNull, camera) - { - return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithin - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithin: function (tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {number} worldY - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {number} width - How many tiles wide from the `tileX` index the area will be. - * @param {number} height - How many tiles high from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer); - }, - - /** - * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, - * Line, Rectangle or Triangle. The shape should be in world coordinates. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinShape - * @since 3.0.0 - * - * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinShape: function (shape, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAt - * @since 3.0.0 - * - * @param {integer} tileX - X position to get the tile from in tile coordinates. - * @param {integer} tileY - Y position to get the tile from in tile coordinates. - * - * @return {boolean} - */ - hasTileAt: function (tileX, tileY) - { - return TilemapComponents.HasTileAt(tileX, tileY, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate of the world position. - * @param {number} worldY - The Y coordinate of the world position. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {boolean} - */ - hasTileAtWorldXY: function (worldX, worldY, camera) - { - return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer); - }, - - /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to - * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles - * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation - * wherever you want on the screen. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderDebug - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - renderDebug: function (graphics, styleConfig) - { - TilemapComponents.RenderDebug(graphics, styleConfig, this.layer); - - return this; - }, - - /** - * Sets collision on the given tile or tiles within a layer by index. You can pass in either a - * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if - * collision will be enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollision - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollision: function (indexes, collides, recalculateFaces, updateLayer) - { - TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer, updateLayer); - - return this; - }, - - /** - * Sets collision on a range of tiles in a layer whose index is between the specified `start` and - * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set - * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be - * enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionBetween - * @since 3.0.0 - * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionBetween: function (start, stop, collides, recalculateFaces) - { - TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property - * that matches the given properties object, its collision flag will be set. The `collides` - * parameter controls if collision will be enabled (true) or disabled (false). Passing in - * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that - * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can - * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a - * "types" property that matches any of those values, its collision flag will be updated. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByProperty - * @since 3.0.0 - * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionByProperty: function (properties, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on all tiles in the given layer, except for tiles that have an index specified in - * the given array. The `collides` parameter controls if collision will be enabled (true) or - * disabled (false). Tile indexes not currently in the layer are not affected. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByExclusion - * @since 3.0.0 - * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionByExclusion: function (indexes, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets a global collision callback for the given tile index within the layer. This will affect all - * tiles on this layer that have the same index. If a callback is already set for the tile index it - * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTileIndexCallback - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. - * @param {function} callback - The callback that will be invoked when the tile is collided with. - * @param {object} callbackContext - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setTileIndexCallback: function (indexes, callback, callbackContext) - { - TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking each tiles collision group data - * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tiles collision group, the tile's colliding information will be set. The `collides` parameter - * controls if collision will be enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionFromCollisionGroup - * @since 3.0.0 - * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionFromCollisionGroup: function (collides, recalculateFaces) - { - TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. - * If a callback is already set for the tile index it will be replaced. Set the callback to null to - * remove it. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTileLocationCallback - * @since 3.0.0 - * - * @param {integer} tileX - The leftmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The topmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. - * @param {function} callback - The callback that will be invoked when the tile is collided with. - * @param {object} [callbackContext] - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) - { - TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldX - * @since 3.0.0 - * - * @param {integer} tileX - The X coordinate, in tile coordinates. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {number} - */ - tileToWorldX: function (tileX, camera) - { - return TilemapComponents.TileToWorldX(tileX, camera, this.layer); - }, - - /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldY - * @since 3.0.0 - * - * @param {integer} tileY - The Y coordinate, in tile coordinates. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {number} - */ - tileToWorldY: function (tileY, camera) - { - return TilemapComponents.TileToWorldY(tileY, camera, this.layer); - }, - - /** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldXY - * @since 3.0.0 - * - * @param {integer} tileX - The X coordinate, in tile coordinates. - * @param {integer} tileY - The Y coordinate, in tile coordinates. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {Phaser.Math.Vector2} - */ - tileToWorldXY: function (tileX, tileY, point, camera) - { - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); - }, - - /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileX - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.] - * - * @return {number} - */ - worldToTileX: function (worldX, snapToFloor, camera) - { - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileY - * @since 3.0.0 - * - * @param {number} worldY - The Y coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {number} - */ - worldToTileY: function (worldY, snapToFloor, camera) - { - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileXY - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate, in world pixels. - * @param {number} worldY - The Y coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Math.Vector2} - */ - worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) - { - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); - }, - - /** - * Destroys this StaticTilemapLayer and removes its link to the associated LayerData. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#destroy - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#destroy + * @since 3.50.0 * * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? */ @@ -122133,16 +127941,6 @@ var StaticTilemapLayer = new Class({ this.culledTiles.length = 0; this.cullCallback = null; - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - this.vertexCount[i] = 0; - this.vertexBuffer[i] = null; - this.bufferData[i] = null; - this.vertexViewF32[i] = null; - this.vertexViewU32[i] = null; - } - this.gidMap = []; this.tileset = []; @@ -122151,11 +127949,11 @@ var StaticTilemapLayer = new Class({ }); -module.exports = StaticTilemapLayer; +module.exports = TilemapLayer; /***/ }), -/* 525 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122428,6 +128226,58 @@ var TimerEvent = new Class({ return this.elapsed * 0.001; }, + /** + * Returns the time interval until the next iteration of the Timer Event. + * + * @method Phaser.Time.TimerEvent#getRemaining + * @since 3.50.0 + * + * @return {number} The time interval in milliseconds. + */ + getRemaining: function () + { + return this.delay - this.elapsed; + }, + + /** + * Returns the time interval until the next iteration of the Timer Event in seconds. + * + * @method Phaser.Time.TimerEvent#getRemainingSeconds + * @since 3.50.0 + * + * @return {number} The time interval in seconds. + */ + getRemainingSeconds: function () + { + return this.getRemaining() * 0.001; + }, + + /** + * Returns the time interval until the last iteration of the Timer Event. + * + * @method Phaser.Time.TimerEvent#getOverallRemaining + * @since 3.50.0 + * + * @return {number} The time interval in milliseconds. + */ + getOverallRemaining: function () + { + return this.delay * (1 + this.repeatCount) - this.elapsed; + }, + + /** + * Returns the time interval until the last iteration of the Timer Event in seconds. + * + * @method Phaser.Time.TimerEvent#getOverallRemainingSeconds + * @since 3.50.0 + * + * @return {number} The time interval in seconds. + */ + getOverallRemainingSeconds: function () + { + return this.getOverallRemaining() * 0.001; + }, + /** * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. * @@ -122468,7 +128318,7 @@ module.exports = TimerEvent; /***/ }), -/* 526 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122477,7 +128327,7 @@ module.exports = TimerEvent; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RESERVED = __webpack_require__(1375); +var RESERVED = __webpack_require__(1437); /** * Internal function used by the Tween Builder to return an array of properties @@ -122529,7 +128379,7 @@ module.exports = GetProps; /***/ }), -/* 527 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122577,7 +128427,7 @@ module.exports = GetTweens; /***/ }), -/* 528 */ +/* 564 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122586,15 +128436,15 @@ module.exports = GetTweens; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Defaults = __webpack_require__(243); +var Defaults = __webpack_require__(256); var GetAdvancedValue = __webpack_require__(15); -var GetBoolean = __webpack_require__(90); -var GetEaseFunction = __webpack_require__(71); +var GetBoolean = __webpack_require__(95); +var GetEaseFunction = __webpack_require__(78); var GetNewValue = __webpack_require__(155); var GetValue = __webpack_require__(6); -var GetValueOp = __webpack_require__(242); -var Tween = __webpack_require__(244); -var TweenData = __webpack_require__(246); +var GetValueOp = __webpack_require__(255); +var Tween = __webpack_require__(257); +var TweenData = __webpack_require__(259); /** * Creates a new Number Tween. @@ -122707,7 +128557,7 @@ module.exports = NumberTweenBuilder; /***/ }), -/* 529 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122716,7 +128566,7 @@ module.exports = NumberTweenBuilder; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetEaseFunction = __webpack_require__(71); +var GetEaseFunction = __webpack_require__(78); var GetValue = __webpack_require__(6); var MATH_CONST = __webpack_require__(13); @@ -122953,7 +128803,7 @@ module.exports = StaggerBuilder; /***/ }), -/* 530 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -122962,16 +128812,16 @@ module.exports = StaggerBuilder; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); -var Defaults = __webpack_require__(243); +var Clone = __webpack_require__(76); +var Defaults = __webpack_require__(256); var GetAdvancedValue = __webpack_require__(15); -var GetBoolean = __webpack_require__(90); -var GetEaseFunction = __webpack_require__(71); +var GetBoolean = __webpack_require__(95); +var GetEaseFunction = __webpack_require__(78); var GetNewValue = __webpack_require__(155); -var GetTargets = __webpack_require__(241); -var GetTweens = __webpack_require__(527); +var GetTargets = __webpack_require__(254); +var GetTweens = __webpack_require__(563); var GetValue = __webpack_require__(6); -var Timeline = __webpack_require__(531); +var Timeline = __webpack_require__(567); var TweenBuilder = __webpack_require__(156); /** @@ -123107,7 +128957,7 @@ module.exports = TimelineBuilder; /***/ }), -/* 531 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -123117,10 +128967,10 @@ module.exports = TimelineBuilder; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(245); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(258); var TweenBuilder = __webpack_require__(156); -var TWEEN_CONST = __webpack_require__(91); +var TWEEN_CONST = __webpack_require__(96); /** * @classdesc @@ -123262,7 +129112,7 @@ var Timeline = new Class({ * The current state of the Timeline. * * @name Phaser.Tweens.Timeline#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = TWEEN_CONST.PENDING_ADD; @@ -123271,7 +129121,7 @@ var Timeline = new Class({ * The state of the Timeline when it was paused (used by Resume) * * @name Phaser.Tweens.Timeline#_pausedState - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -124012,7 +129862,7 @@ module.exports = Timeline; /***/ }), -/* 532 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124022,13 +129872,13 @@ module.exports = Timeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasSnapshot = __webpack_require__(533); -var CameraEvents = __webpack_require__(42); +var CameraEvents = __webpack_require__(35); +var CanvasSnapshot = __webpack_require__(569); var Class = __webpack_require__(0); -var CONST = __webpack_require__(34); -var GetBlendModes = __webpack_require__(534); -var ScaleEvents = __webpack_require__(94); -var TransformMatrix = __webpack_require__(31); +var CONST = __webpack_require__(39); +var GetBlendModes = __webpack_require__(570); +var ScaleEvents = __webpack_require__(101); +var TransformMatrix = __webpack_require__(24); /** * @classdesc @@ -124060,7 +129910,7 @@ var CanvasRenderer = new Class({ * A constant which allows the renderer to be easily identified as a Canvas Renderer. * * @name Phaser.Renderer.Canvas.CanvasRenderer#type - * @type {integer} + * @type {number} * @since 3.0.0 */ this.type = CONST.CANVAS; @@ -124079,7 +129929,7 @@ var CanvasRenderer = new Class({ * The width of the canvas being rendered to. * * @name Phaser.Renderer.Canvas.CanvasRenderer#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = 0; @@ -124088,7 +129938,7 @@ var CanvasRenderer = new Class({ * The height of the canvas being rendered to. * * @name Phaser.Renderer.Canvas.CanvasRenderer#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = 0; @@ -124103,7 +129953,6 @@ var CanvasRenderer = new Class({ this.config = { clearBeforeRender: game.config.clearBeforeRender, backgroundColor: game.config.backgroundColor, - resolution: game.config.resolution, antialias: game.config.antialias, roundPixels: game.config.roundPixels }; @@ -124186,7 +130035,7 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix1 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix1 = new TransformMatrix(); @@ -124196,7 +130045,7 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix2 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix2 = new TransformMatrix(); @@ -124206,20 +130055,10 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix3 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix3 = new TransformMatrix(); - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix4 = new TransformMatrix(); - this.init(); }, @@ -124246,8 +130085,6 @@ var CanvasRenderer = new Class({ * * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. - * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes. - * @param {number} [resolution] - The Scale Manager resolution setting. */ onResize: function (gameSize, baseSize) { @@ -124370,25 +130207,30 @@ var CanvasRenderer = new Class({ }, /** - * Renders the Scene to the given Camera. + * The core render step for a Scene Camera. + * + * Iterates through the given array of Game Objects and renders them with the given Camera. + * + * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked + * by the Scene Systems.render method. + * + * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * * @method Phaser.Renderer.Canvas.CanvasRenderer#render * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.GameObjects.DisplayList} children - The Game Objects within the Scene to be rendered. - * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently unused. + * @param {Phaser.GameObjects.GameObject[]} children - An array of filtered Game Objects that can be rendered by the given Camera. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ - render: function (scene, children, interpolationPercentage, camera) + render: function (scene, children, camera) { - var list = children.list; - var childCount = list.length; + var childCount = children.length; - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + var cx = camera.x; + var cy = camera.y; + var cw = camera.width; + var ch = camera.height; var ctx = (camera.renderToTexture) ? camera.context : scene.sys.context; @@ -124421,7 +130263,7 @@ var CanvasRenderer = new Class({ ctx.globalCompositeOperation = 'source-over'; - this.drawCount += list.length; + this.drawCount += childCount; if (camera.renderToTexture) { @@ -124432,19 +130274,14 @@ var CanvasRenderer = new Class({ for (var i = 0; i < childCount; i++) { - var child = list[i]; - - if (!child.willRender(camera)) - { - continue; - } + var child = children[i]; if (child.mask) { child.mask.preRenderCanvas(this, child, camera); } - child.renderCanvas(this, child, interpolationPercentage, camera); + child.renderCanvas(this, child, camera); if (child.mask) { @@ -124518,10 +130355,10 @@ var CanvasRenderer = new Class({ * @param {HTMLCanvasElement} canvas - The canvas to grab from. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? - * @param {integer} [x=0] - The x coordinate to grab from. - * @param {integer} [y=0] - The y coordinate to grab from. - * @param {integer} [width=canvas.width] - The width of the area to grab. - * @param {integer} [height=canvas.height] - The height of the area to grab. + * @param {number} [x=0] - The x coordinate to grab from. + * @param {number} [y=0] - The y coordinate to grab from. + * @param {number} [width=canvas.width] - The width of the area to grab. + * @param {number} [height=canvas.height] - The height of the area to grab. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. * @@ -124583,10 +130420,10 @@ var CanvasRenderer = new Class({ * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotArea * @since 3.16.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -124624,8 +130461,8 @@ var CanvasRenderer = new Class({ * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotPixel * @since 3.16.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This WebGL Renderer. @@ -124819,7 +130656,7 @@ module.exports = CanvasRenderer; /***/ }), -/* 533 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124828,8 +130665,8 @@ module.exports = CanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); -var Color = __webpack_require__(32); +var CanvasPool = __webpack_require__(31); +var Color = __webpack_require__(36); var GetFastValue = __webpack_require__(2); /** @@ -124912,7 +130749,7 @@ module.exports = CanvasSnapshot; /***/ }), -/* 534 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124921,8 +130758,8 @@ module.exports = CanvasSnapshot; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var modes = __webpack_require__(54); -var CanvasFeatures = __webpack_require__(329); +var modes = __webpack_require__(48); +var CanvasFeatures = __webpack_require__(340); /** * Returns an array which maps the default blend modes to supported Canvas blend modes. @@ -124976,7 +130813,7 @@ module.exports = GetBlendModes; /***/ }), -/* 535 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -124986,22 +130823,21 @@ module.exports = GetBlendModes; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = __webpack_require__(93); -var CameraEvents = __webpack_require__(42); +var ArrayRemove = __webpack_require__(87); +var BaseCamera = __webpack_require__(99); +var CameraEvents = __webpack_require__(35); var Class = __webpack_require__(0); -var CONST = __webpack_require__(34); -var GameEvents = __webpack_require__(21); -var IsSizePowerOfTwo = __webpack_require__(128); +var CONST = __webpack_require__(39); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(190); +var GameEvents = __webpack_require__(23); +var IsSizePowerOfTwo = __webpack_require__(133); var NOOP = __webpack_require__(1); -var PIPELINE_CONST = __webpack_require__(110); -var PipelineManager = __webpack_require__(536); -var ProjectOrtho = __webpack_require__(185); -var ScaleEvents = __webpack_require__(94); -var SpliceOne = __webpack_require__(82); -var TextureEvents = __webpack_require__(130); -var TransformMatrix = __webpack_require__(31); -var Utils = __webpack_require__(10); -var WebGLSnapshot = __webpack_require__(541); +var PipelineManager = __webpack_require__(572); +var ScaleEvents = __webpack_require__(101); +var TextureEvents = __webpack_require__(136); +var Utils = __webpack_require__(12); +var WebGLSnapshot = __webpack_require__(580); /** * @callback WebGLContextCallback @@ -125021,6 +130857,7 @@ var WebGLSnapshot = __webpack_require__(541); * * @class WebGLRenderer * @memberof Phaser.Renderer.WebGL + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @@ -125028,10 +130865,14 @@ var WebGLSnapshot = __webpack_require__(541); */ var WebGLRenderer = new Class({ + Extends: EventEmitter, + initialize: function WebGLRenderer (game) { + EventEmitter.call(this); + var gameConfig = game.config; var contextCreationConfig = { @@ -125057,7 +130898,6 @@ var WebGLRenderer = new Class({ antialias: gameConfig.antialias, backgroundColor: gameConfig.backgroundColor, contextCreation: contextCreationConfig, - resolution: gameConfig.resolution, roundPixels: gameConfig.roundPixels, maxTextures: gameConfig.maxTextures, maxTextureSize: gameConfig.maxTextureSize, @@ -125079,7 +130919,7 @@ var WebGLRenderer = new Class({ * A constant which allows the renderer to be easily identified as a WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#type - * @type {integer} + * @type {number} * @since 3.0.0 */ this.type = CONST.WEBGL; @@ -125106,7 +130946,7 @@ var WebGLRenderer = new Class({ * This is populated in the onResize event handler. * * @name Phaser.Renderer.WebGL.WebGLRenderer#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = 0; @@ -125116,7 +130956,7 @@ var WebGLRenderer = new Class({ * This is populated in the onResize event handler. * * @name Phaser.Renderer.WebGL.WebGLRenderer#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = 0; @@ -125142,16 +130982,6 @@ var WebGLRenderer = new Class({ */ this.blendModes = []; - /** - * Keeps track of any WebGLTexture created with the current WebGLRenderingContext. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#nativeTextures - * @type {array} - * @default [] - * @since 3.0.0 - */ - this.nativeTextures = []; - /** * This property is set to `true` if the WebGL context of the renderer is lost. * @@ -125185,13 +131015,11 @@ var WebGLRenderer = new Class({ bufferHeight: 0 }; - // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc) - /** * Cached value for the last texture unit that was used. * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentActiveTexture - * @type {integer} + * @type {number} * @since 3.1.0 */ this.currentActiveTexture = 0; @@ -125201,7 +131029,7 @@ var WebGLRenderer = new Class({ * This value is constantly updated and should be treated as read-only by your code. * * @name Phaser.Renderer.WebGL.WebGLRenderer#startActiveTexture - * @type {integer} + * @type {number} * @since 3.50.0 */ this.startActiveTexture = 0; @@ -125211,7 +131039,7 @@ var WebGLRenderer = new Class({ * This is set via the Game Config `maxTextures` property and should never be changed after boot. * * @name Phaser.Renderer.WebGL.WebGLRenderer#maxTextures - * @type {integer} + * @type {number} * @since 3.50.0 */ this.maxTextures = 0; @@ -125257,7 +131085,7 @@ var WebGLRenderer = new Class({ this.normalTexture; /** - * Current framebuffer in use. + * The currently bound framebuffer in use. * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentFramebuffer * @type {WebGLFramebuffer} @@ -125266,6 +131094,15 @@ var WebGLRenderer = new Class({ */ this.currentFramebuffer = null; + /** + * A stack into which the frame buffer objects are pushed and popped. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#fboStack + * @type {WebGLFramebuffer[]} + * @since 3.50.0 + */ + this.fboStack = []; + /** * Current WebGLProgram in use. * @@ -125300,7 +131137,7 @@ var WebGLRenderer = new Class({ * Current blend mode in use * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentBlendMode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.currentBlendMode = Infinity; @@ -125364,17 +131201,40 @@ var WebGLRenderer = new Class({ this.gl = null; /** - * Array of strings that indicate which WebGL extensions are supported by the browser + * Array of strings that indicate which WebGL extensions are supported by the browser. + * This is populated in the `boot` method. * * @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions - * @type {object} + * @type {string[]} * @default null * @since 3.0.0 */ this.supportedExtensions = null; /** - * Extensions loaded into the current context + * If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold + * a reference to the glExtension for it. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#instancedArraysExtension + * @type {ANGLE_instanced_arrays} + * @default null + * @since 3.50.0 + */ + this.instancedArraysExtension = null; + + /** + * If the browser supports the `OES_vertex_array_object` extension, this property will hold + * a reference to the glExtension for it. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#vaoExtension + * @type {OES_vertex_array_object} + * @default null + * @since 3.50.0 + */ + this.vaoExtension = null; + + /** + * The WebGL Extensions loaded into the current context. * * @name Phaser.Renderer.WebGL.WebGLRenderer#extensions * @type {object} @@ -125384,7 +131244,7 @@ var WebGLRenderer = new Class({ this.extensions = {}; /** - * Stores the current WebGL component formats for further use + * Stores the current WebGL component formats for further use. * * @name Phaser.Renderer.WebGL.WebGLRenderer#glFormats * @type {array} @@ -125397,7 +131257,7 @@ var WebGLRenderer = new Class({ * Stores the supported WebGL texture compression formats. * * @name Phaser.Renderer.WebGL.WebGLRenderer#compression - * @type {array} + * @type {object} * @since 3.8.0 */ this.compression = { @@ -125427,6 +131287,17 @@ var WebGLRenderer = new Class({ */ this.blankTexture = null; + /** + * A pure white 4x4 texture, as used by the Graphics system where needed. + * This is set in the `boot` method. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#whiteTexture + * @type {WebGLTexture} + * @readonly + * @since 3.50.0 + */ + this.whiteTexture = null; + /** * A default Camera used in calls when no other camera has been provided. * @@ -125436,51 +131307,11 @@ var WebGLRenderer = new Class({ */ this.defaultCamera = new BaseCamera(0, 0, 0, 0); - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix3 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix4 = new TransformMatrix(); - /** * The total number of masks currently stacked. * * @name Phaser.Renderer.WebGL.WebGLRenderer#maskCount - * @type {integer} + * @type {number} * @since 3.17.0 */ this.maskCount = 0; @@ -125596,6 +131427,25 @@ var WebGLRenderer = new Class({ */ this.textureFlush = 0; + /** + * The default scissor, set during `preRender` and modified during `resize`. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#defaultScissor + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.defaultScissor = [ 0, 0, 0, 0 ]; + + /** + * Has this renderer fully booted yet? + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#isBooted + * @type {boolean} + * @since 3.50.0 + */ + this.isBooted = false; + this.init(this.config); }, @@ -125713,7 +131563,7 @@ var WebGLRenderer = new Class({ }; - // Load supported extensions + // Load supported extensions var exts = gl.getSupportedExtensions(); if (!config.maxTextures || config.maxTextures === -1) @@ -125721,6 +131571,11 @@ var WebGLRenderer = new Class({ config.maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); } + if (!config.maxTextureSize) + { + config.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); + } + var extString = 'WEBGL_compressed_texture_'; var wkExtString = 'WEBKIT_' + extString; @@ -125730,6 +131585,14 @@ var WebGLRenderer = new Class({ this.supportedExtensions = exts; + var angleString = 'ANGLE_instanced_arrays'; + + this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null; + + var vaoString = 'OES_vertex_array_object'; + + this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null; + // Setup initial WebGL state gl.disable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); @@ -125770,7 +131633,7 @@ var WebGLRenderer = new Class({ gl.bindTexture(gl.TEXTURE_2D, tempTexture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 255, 255, 255, 255 ])); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 0, 0, 255, 255 ])); tempTextures[index] = tempTexture; @@ -125803,16 +131666,23 @@ var WebGLRenderer = new Class({ boot: function () { var game = this.game; + var pipelineManager = this.pipelines; - this.pipelines.boot(); + var baseSize = game.scale.baseSize; - var multi = this.pipelines.get(PIPELINE_CONST.MULTI_PIPELINE); + this.width = baseSize.width; + this.height = baseSize.height; - var blank = game.textures.getFrame('__DEFAULT'); + this.isBooted = true; - multi.currentFrame = blank; + // Set-up pipelines - this.blankTexture = blank; + pipelineManager.boot(game.config.pipeline); + + // Set-up default textures, fbo and scissor + + this.blankTexture = game.textures.getFrame('__DEFAULT'); + this.whiteTexture = game.textures.getFrame('__WHITE'); var gl = this.gl; @@ -125822,9 +131692,7 @@ var WebGLRenderer = new Class({ game.scale.on(ScaleEvents.RESIZE, this.onResize, this); - var baseSize = game.scale.baseSize; - - this.resize(baseSize.width, baseSize.height, game.scale.resolution); + this.resize(baseSize.width, baseSize.height); }, /** @@ -125834,16 +131702,14 @@ var WebGLRenderer = new Class({ * @since 3.16.0 * * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. - * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. - * @param {Phaser.Structs.Size} displaySize - The display Size object. The size of the canvas style width / height attributes. - * @param {number} [resolution] - The Scale Manager resolution setting. + * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions. The canvas width / height values match this. */ - onResize: function (gameSize, baseSize, displaySize, resolution) + onResize: function (gameSize, baseSize) { // Has the underlying canvas size changed? - if (baseSize.width !== this.width || baseSize.height !== this.height || resolution !== this.resolution) + if (baseSize.width !== this.width || baseSize.height !== this.height) { - this.resize(baseSize.width, baseSize.height, resolution); + this.resize(baseSize.width, baseSize.height); } }, @@ -125851,32 +131717,34 @@ var WebGLRenderer = new Class({ * Resizes the drawing buffer to match that required by the Scale Manager. * * @method Phaser.Renderer.WebGL.WebGLRenderer#resize + * @fires Phaser.Renderer.WebGL.Events#RESIZE * @since 3.0.0 * * @param {number} [width] - The new width of the renderer. * @param {number} [height] - The new height of the renderer. - * @param {number} [resolution] - The new resolution of the renderer. * * @return {this} This WebGLRenderer instance. */ - resize: function (width, height, resolution) + resize: function (width, height) { var gl = this.gl; this.width = width; this.height = height; - this.resolution = resolution; gl.viewport(0, 0, width, height); - this.pipelines.resize(width, height, resolution); - this.drawingBufferHeight = gl.drawingBufferHeight; gl.scissor(0, (gl.drawingBufferHeight - height), width, height); this.defaultCamera.setSize(width, height); + this.defaultScissor[2] = width; + this.defaultScissor[3] = height; + + this.emit(Events.RESIZE, width, height); + return this; }, @@ -125934,13 +131802,13 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor * @since 3.0.0 * - * @param {integer} x - The x position of the scissor. - * @param {integer} y - The y position of the scissor. - * @param {integer} width - The width of the scissor. - * @param {integer} height - The height of the scissor. - * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + * @param {number} x - The x position of the scissor. + * @param {number} y - The y position of the scissor. + * @param {number} width - The width of the scissor. + * @param {number} height - The height of the scissor. + * @param {number} [drawingBufferHeight] - Optional drawingBufferHeight override value. * - * @return {integer[]} An array containing the scissor values. + * @return {number[]} An array containing the scissor values. */ pushScissor: function (x, y, width, height, drawingBufferHeight) { @@ -125965,11 +131833,11 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor * @since 3.0.0 * - * @param {integer} x - The x position of the scissor. - * @param {integer} y - The y position of the scissor. - * @param {integer} width - The width of the scissor. - * @param {integer} height - The height of the scissor. - * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + * @param {number} x - The x position of the scissor. + * @param {number} y - The y position of the scissor. + * @param {number} width - The width of the scissor. + * @param {number} height - The height of the scissor. + * @param {number} [drawingBufferHeight] - Optional drawingBufferHeight override value. */ setScissor: function (x, y, width, height, drawingBufferHeight) { @@ -126049,7 +131917,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setBlendMode * @since 3.0.0 * - * @param {integer} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value. + * @param {number} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value. * @param {boolean} [force=false] - Force the blend mode to be set, regardless of the currently set blend mode. * * @return {boolean} `true` if the blend mode was changed as a result of this call, forcing a flush, otherwise `false`. @@ -126096,7 +131964,7 @@ var WebGLRenderer = new Class({ * @param {GLenum[]} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. * @param {GLenum} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * - * @return {integer} The index of the new blend mode, used for referencing it in the future. + * @return {number} The index of the new blend mode, used for referencing it in the future. */ addBlendMode: function (func, equation) { @@ -126111,7 +131979,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode * @since 3.0.0 * - * @param {integer} index - The index of the custom blend mode. + * @param {number} index - The index of the custom blend mode. * @param {function} func - The function to use for the blend mode. * @param {function} equation - The equation to use for the blend mode. * @@ -126139,7 +132007,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode * @since 3.0.0 * - * @param {integer} index - The index of the custom blend mode to be removed. + * @param {number} index - The index of the custom blend mode to be removed. * * @return {this} This WebGLRenderer instance. */ @@ -126179,7 +132047,7 @@ var WebGLRenderer = new Class({ */ setTextureSource: function (textureSource) { - if (this.pipelines.current.forceZero) + if (this.pipelines.forceZero()) { this.setTextureZero(textureSource.glTexture, true); @@ -126372,16 +132240,22 @@ var WebGLRenderer = new Class({ var gl = this.gl; var temp = this.tempTextures; - var total = (all) ? temp.length : 2; - - for (var i = 0; i < total; i++) - { - gl.activeTexture(gl.TEXTURE0 + i); - gl.bindTexture(gl.TEXTURE_2D, temp[i]); - } - if (all) { + for (var i = 0; i < temp.length; i++) + { + gl.activeTexture(gl.TEXTURE0 + i); + gl.bindTexture(gl.TEXTURE_2D, temp[i]); + } + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(gl.TEXTURE_2D, temp[1]); + } + else + { + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, temp[0]); + gl.activeTexture(gl.TEXTURE1); gl.bindTexture(gl.TEXTURE_2D, temp[1]); } @@ -126409,7 +132283,7 @@ var WebGLRenderer = new Class({ */ setTexture2D: function (texture) { - if (this.pipelines.current.forceZero) + if (this.pipelines.forceZero()) { this.setTextureZero(texture, true); @@ -126456,117 +132330,228 @@ var WebGLRenderer = new Class({ }, /** - * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. + * Pushes a new framebuffer onto the FBO stack and makes it the currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Call `popFramebuffer` to remove it again. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#pushFramebuffer + * @since 3.50.0 + * + * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. + * @param {boolean} [updateScissor=false] - Set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? + * + * @return {this} This WebGLRenderer instance. + */ + pushFramebuffer: function (framebuffer, updateScissor, resetTextures, setViewport) + { + if (framebuffer === this.currentFramebuffer) + { + return this; + } + + this.fboStack.push(framebuffer); + + return this.setFramebuffer(framebuffer, updateScissor, resetTextures, setViewport); + }, + + /** + * Sets the given framebuffer as the active and currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Typically, you should call `pushFramebuffer` instead of this method. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer * @since 3.0.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? * * @return {this} This WebGLRenderer instance. */ - setFramebuffer: function (framebuffer, updateScissor) + setFramebuffer: function (framebuffer, updateScissor, resetTextures, setViewport) { if (updateScissor === undefined) { updateScissor = false; } + if (resetTextures === undefined) { resetTextures = false; } + if (setViewport === undefined) { setViewport = true; } + + if (framebuffer === this.currentFramebuffer) + { + return this; + } var gl = this.gl; var width = this.width; var height = this.height; - if (framebuffer !== this.currentFramebuffer) + if (framebuffer && framebuffer.renderTexture && setViewport) { - if (framebuffer && framebuffer.renderTexture) + width = framebuffer.renderTexture.width; + height = framebuffer.renderTexture.height; + } + else + { + this.flush(); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + + if (setViewport) + { + gl.viewport(0, 0, width, height); + } + + if (updateScissor) + { + if (framebuffer) { - width = framebuffer.renderTexture.width; - height = framebuffer.renderTexture.height; + this.drawingBufferHeight = height; + + this.pushScissor(0, 0, width, height); } else { - this.flush(); + this.drawingBufferHeight = this.height; + + this.popScissor(); } + } - gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + this.currentFramebuffer = framebuffer; - gl.viewport(0, 0, width, height); - - if (updateScissor) - { - if (framebuffer) - { - this.drawingBufferHeight = height; - - this.pushScissor(0, 0, width, height); - } - else - { - this.drawingBufferHeight = this.height; - - this.popScissor(); - } - } - - this.currentFramebuffer = framebuffer; + if (resetTextures) + { + this.resetTextures(); } return this; }, /** - * Binds a program. If there was another program already bound it will force a pipeline flush. + * Pops the previous framebuffer from the fbo stack and sets it. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#popFramebuffer + * @since 3.50.0 + * + * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? + * + * @return {WebGLFramebuffer} The Framebuffer that was set, or `null` if there aren't any more in the stack. + */ + popFramebuffer: function (updateScissor, resetTextures, setViewport) + { + if (updateScissor === undefined) { updateScissor = false; } + if (resetTextures === undefined) { resetTextures = false; } + if (setViewport === undefined) { setViewport = true; } + + var fboStack = this.fboStack; + + // Remove the current fbo + fboStack.pop(); + + // Reset the previous framebuffer + var framebuffer = fboStack[fboStack.length - 1]; + + if (!framebuffer) + { + framebuffer = null; + } + + this.setFramebuffer(framebuffer, updateScissor, resetTextures, setViewport); + + return framebuffer; + }, + + /** + * Binds a shader program. + * + * If there was a different program already bound it will force a pipeline flush first. + * + * If the same program given to this method is already set as the current program, no change + * will take place and this method will return `false`. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram * @since 3.0.0 * * @param {WebGLProgram} program - The program that needs to be bound. * - * @return {this} This WebGLRenderer instance. + * @return {boolean} `true` if the given program was bound, otherwise `false`. */ setProgram: function (program) { - var gl = this.gl; - if (program !== this.currentProgram) { this.flush(); - gl.useProgram(program); + this.gl.useProgram(program); this.currentProgram = program; + + return true; } + return false; + }, + + /** + * Rebinds whatever program `WebGLRenderer.currentProgram` is set as, without + * changing anything, or flushing. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#resetProgram + * @since 3.50.0 + * + * @return {this} This WebGLRenderer instance. + */ + resetProgram: function () + { + this.gl.useProgram(this.currentProgram); + return this; }, /** - * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. + * Binds a vertex buffer. + * + * If there was a different vertex buffer already bound it will force a pipeline flush first. + * + * If the same buffer given to this method is already set as the current buffer, no change + * will take place and this method will return `false`. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer * @since 3.0.0 * * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound. * - * @return {this} This WebGLRenderer instance. + * @return {boolean} `true` if the given buffer was bound, otherwise `false`. */ setVertexBuffer: function (vertexBuffer) { - var gl = this.gl; - - if (vertexBuffer !== this.currentVertexBuffer) + if (vertexBuffer && vertexBuffer !== this.currentVertexBuffer) { + var gl = this.gl; + this.flush(); gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); this.currentVertexBuffer = vertexBuffer; + + return true; } - return this; + return false; }, /** - * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. + * Binds an index buffer. If there is an index buffer already bound it'll force a pipeline flush. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer * @since 3.0.0 @@ -126579,7 +132564,7 @@ var WebGLRenderer = new Class({ { var gl = this.gl; - if (indexBuffer !== this.currentIndexBuffer) + if (indexBuffer && indexBuffer !== this.currentIndexBuffer) { this.flush(); @@ -126598,9 +132583,9 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {object} source - The source of the texture. - * @param {integer} width - The width of the texture. - * @param {integer} height - The height of the texture. - * @param {integer} scaleMode - The scale mode to be used by the texture. + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} scaleMode - The scale mode to be used by the texture. * * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created. */ @@ -126646,15 +132631,15 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D * @since 3.0.0 * - * @param {integer} mipLevel - Mip level of the texture. - * @param {integer} minFilter - Filtering of the texture. - * @param {integer} magFilter - Filtering of the texture. - * @param {integer} wrapT - Wrapping mode of the texture. - * @param {integer} wrapS - Wrapping mode of the texture. - * @param {integer} format - Which format does the texture use. + * @param {number} mipLevel - Mip level of the texture. + * @param {number} minFilter - Filtering of the texture. + * @param {number} magFilter - Filtering of the texture. + * @param {number} wrapT - Wrapping mode of the texture. + * @param {number} wrapS - Wrapping mode of the texture. + * @param {number} format - Which format does the texture use. * @param {?object} pixels - pixel data. - * @param {integer} width - Width of the texture in pixels. - * @param {integer} height - Height of the texture in pixels. + * @param {number} width - Width of the texture in pixels. + * @param {number} height - Height of the texture in pixels. * @param {boolean} [pma=true] - Does the texture have premultiplied alpha? * @param {boolean} [forceSize=false] - If `true` it will use the width and height passed to this method, regardless of the pixels dimension. * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. @@ -126716,21 +132701,19 @@ var WebGLRenderer = new Class({ texture.glIndex = 0; texture.glIndexCounter = -1; - this.nativeTextures.push(texture); - return texture; }, /** - * Wrapper for creating WebGLFramebuffer. + * Creates a WebGL Framebuffer object and optionally binds a depth stencil render buffer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createFramebuffer * @since 3.0.0 * - * @param {integer} width - Width in pixels of the framebuffer - * @param {integer} height - Height in pixels of the framebuffer - * @param {WebGLTexture} renderTexture - The color texture to where the color pixels are written - * @param {boolean} addDepthStencilBuffer - Indicates if the current framebuffer support depth and stencil buffers + * @param {number} width - If `addDepthStencilBuffer` is true, this controls the width of the depth stencil. + * @param {number} height - If `addDepthStencilBuffer` is true, this controls the height of the depth stencil. + * @param {WebGLTexture} renderTexture - The color texture where the color pixels are written. + * @param {boolean} [addDepthStencilBuffer=false] - Create a Renderbuffer for the depth stencil? * * @return {WebGLFramebuffer} Raw WebGLFramebuffer */ @@ -126745,6 +132728,7 @@ var WebGLRenderer = new Class({ if (addDepthStencilBuffer) { var depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); @@ -126766,28 +132750,30 @@ var WebGLRenderer = new Class({ 36061: 'Framebuffer Unsupported' }; - throw new Error('Framebuffer incomplete. Framebuffer status: ' + errors[complete]); + throw new Error('Framebuffer status: ' + errors[complete]); } framebuffer.renderTexture = renderTexture; this.setFramebuffer(null); - this.resetTextures(true); + this.resetTextures(); return framebuffer; }, /** - * Wrapper for creating a WebGLProgram + * Creates a WebGLProgram instance based on the given vertex and fragment shader source. + * + * Then compiles, attaches and links the program before returning it. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createProgram * @since 3.0.0 * - * @param {string} vertexShader - Source to the vertex shader - * @param {string} fragmentShader - Source to the fragment shader + * @param {string} vertexShader - The vertex shader source code as a single string. + * @param {string} fragmentShader - The fragment shader source code as a single string. * - * @return {WebGLProgram} Raw WebGLProgram + * @return {WebGLProgram} The linked WebGLProgram created from the given shader source. */ createProgram: function (vertexShader, fragmentShader) { @@ -126803,11 +132789,12 @@ var WebGLRenderer = new Class({ if (!gl.getShaderParameter(vs, gl.COMPILE_STATUS)) { - throw new Error('Failed to compile Vertex Shader:\n' + gl.getShaderInfoLog(vs)); + throw new Error('Vertex Shader failed:\n' + gl.getShaderInfoLog(vs)); } + if (!gl.getShaderParameter(fs, gl.COMPILE_STATUS)) { - throw new Error('Failed to compile Fragment Shader:\n' + gl.getShaderInfoLog(fs)); + throw new Error('Fragment Shader failed:\n' + gl.getShaderInfoLog(fs)); } gl.attachShader(program, vs); @@ -126816,9 +132803,11 @@ var WebGLRenderer = new Class({ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { - throw new Error('Failed to link program:\n' + gl.getProgramInfoLog(program)); + throw new Error('Link Program failed:\n' + gl.getProgramInfoLog(program)); } + gl.useProgram(program); + return program; }, @@ -126829,7 +132818,7 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + * @param {number} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW * * @return {WebGLBuffer} Raw vertex buffer */ @@ -126838,11 +132827,9 @@ var WebGLRenderer = new Class({ var gl = this.gl; var vertexBuffer = gl.createBuffer(); - this.setVertexBuffer(vertexBuffer); - + gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); gl.bufferData(gl.ARRAY_BUFFER, initialDataOrSize, bufferUsage); - - this.setVertexBuffer(null); + gl.bindBuffer(gl.ARRAY_BUFFER, null); return vertexBuffer; }, @@ -126854,7 +132841,7 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo. - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. + * @param {number} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. * * @return {WebGLBuffer} Raw index buffer */ @@ -126863,37 +132850,36 @@ var WebGLRenderer = new Class({ var gl = this.gl; var indexBuffer = gl.createBuffer(); - this.setIndexBuffer(indexBuffer); - + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, initialDataOrSize, bufferUsage); - - this.setIndexBuffer(null); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); return indexBuffer; }, /** - * Removes the given texture from the nativeTextures array and then deletes it from the GPU. + * Calls `GL.deleteTexture` on the given WebGLTexture and also optionally + * resets the currently defined textures. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture * @since 3.0.0 * * @param {WebGLTexture} texture - The WebGL Texture to be deleted. + * @param {boolean} [reset=false] - Call the `resetTextures` method after deleting this texture? * * @return {this} This WebGLRenderer instance. */ - deleteTexture: function (texture) + deleteTexture: function (texture, reset) { - var index = this.nativeTextures.indexOf(texture); - - if (index !== -1) + if (texture) { - SpliceOne(this.nativeTextures, index); + this.gl.deleteTexture(texture); } - this.gl.deleteTexture(texture); - - this.resetTextures(); + if (reset) + { + this.resetTextures(); + } return this; }, @@ -126910,7 +132896,17 @@ var WebGLRenderer = new Class({ */ deleteFramebuffer: function (framebuffer) { - this.gl.deleteFramebuffer(framebuffer); + if (framebuffer) + { + this.gl.deleteFramebuffer(framebuffer); + + ArrayRemove(this.fboStack, framebuffer); + + if (this.currentFramebuffer === framebuffer) + { + this.currentFramebuffer = null; + } + } return this; }, @@ -126927,7 +132923,10 @@ var WebGLRenderer = new Class({ */ deleteProgram: function (program) { - this.gl.deleteProgram(program); + if (program) + { + this.gl.deleteProgram(program); + } return this; }, @@ -126960,70 +132959,36 @@ var WebGLRenderer = new Class({ */ preRenderCamera: function (camera) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + var cx = camera.x; + var cy = camera.y; + var cw = camera.width; + var ch = camera.height; var color = camera.backgroundColor; - var MultiPipeline = this.pipelines.MULTI_PIPELINE; + camera.emit(CameraEvents.PRE_RENDER, camera); - if (camera.renderToTexture) + this.pipelines.preBatchCamera(camera); + + this.pushScissor(cx, cy, cw, ch); + + if (camera.mask) { - this.flush(); + this.currentCameraMask.mask = camera.mask; + this.currentCameraMask.camera = camera._maskCamera; - this.pushScissor(cx, cy, cw, -ch); - - this.setFramebuffer(camera.framebuffer); - - var gl = this.gl; - - gl.clearColor(0, 0, 0, 0); - - gl.clear(gl.COLOR_BUFFER_BIT); - - ProjectOrtho(MultiPipeline, cx, cw + cx, cy, ch + cy, -1000, 1000); - - if (camera.mask) - { - this.currentCameraMask.mask = camera.mask; - this.currentCameraMask.camera = camera._maskCamera; - - camera.mask.preRenderWebGL(this, camera, camera._maskCamera); - } - - if (color.alphaGL > 0) - { - MultiPipeline.drawFillRect( - cx, cy, cw + cx, ch + cy, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } - - camera.emit(CameraEvents.PRE_RENDER, camera); + camera.mask.preRenderWebGL(this, camera, camera._maskCamera); } - else + + if (color.alphaGL > 0) { - this.pushScissor(cx, cy, cw, ch); + var pipeline = this.pipelines.setMulti(); - if (camera.mask) - { - this.currentCameraMask.mask = camera.mask; - this.currentCameraMask.camera = camera._maskCamera; - - camera.mask.preRenderWebGL(this, camera, camera._maskCamera); - } - - if (color.alphaGL > 0) - { - MultiPipeline.drawFillRect( - cx, cy, cw , ch, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } + pipeline.drawFillRect( + cx, cy, cw, ch, + Utils.getTintFromFloats(color.blueGL, color.greenGL, color.redGL, 1), + color.alphaGL + ); } }, @@ -127054,7 +133019,8 @@ var WebGLRenderer = new Class({ /** * Controls the post-render operations for the given camera. - * Renders the foreground camera effects like flash and fading. It resets the current scissor state. + * + * Renders the foreground camera effects like flash and fading, then resets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera * @since 3.0.0 @@ -127063,70 +133029,35 @@ var WebGLRenderer = new Class({ */ postRenderCamera: function (camera) { - var multiPipeline = this.pipelines.setMulti(); + if (camera.flashEffect.isRunning || camera.fadeEffect.isRunning) + { + var pipeline = this.pipelines.setMulti(); - camera.flashEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats); - camera.fadeEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats); + camera.flashEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats); + camera.fadeEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats); + } camera.dirty = false; this.popScissor(); - if (camera.renderToTexture) - { - multiPipeline.flush(); - - this.setFramebuffer(null); - - camera.emit(CameraEvents.POST_RENDER, camera); - - if (camera.renderToGame) - { - ProjectOrtho(multiPipeline, 0, multiPipeline.width, multiPipeline.height, 0, -1000.0, 1000.0); - - var getTint = Utils.getTintAppendFloatAlpha; - - var pipeline = (camera.pipeline) ? camera.pipeline : multiPipeline; - - pipeline.batchTexture( - camera, - camera.glTexture, - camera.width, camera.height, - camera.x, camera.y, - camera.width, camera.height, - 1, 1, - 0, - camera.flipX, !camera.flipY, - 1, 1, - 0, 0, - 0, 0, camera.width, camera.height, - getTint(camera._tintTL, camera._alphaTL), - getTint(camera._tintTR, camera._alphaTR), - getTint(camera._tintBL, camera._alphaBL), - getTint(camera._tintBR, camera._alphaBR), - (camera._isTinted && camera.tintFill), - 0, 0, - this.defaultCamera, - null - ); - } - - // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it - this.setBlankTexture(true); - } - if (camera.mask) { this.currentCameraMask.mask = null; camera.mask.postRenderWebGL(this, camera._maskCamera); } + + this.pipelines.postBatchCamera(camera); + + camera.emit(CameraEvents.POST_RENDER, camera); }, /** * Clears the current vertex buffer and updates pipelines. * * @method Phaser.Renderer.WebGL.WebGLRenderer#preRender + * @fires Phaser.Renderer.WebGL.Events#PRE_RENDER * @since 3.0.0 */ preRender: function () @@ -127149,13 +133080,10 @@ var WebGLRenderer = new Class({ gl.enable(gl.SCISSOR_TEST); - this.pipelines.preRender(); + this.currentScissor = this.defaultScissor; - // TODO - Find a way to stop needing to create these arrays every frame - // and equally not need a huge array buffer created to hold them - - this.currentScissor = [ 0, 0, this.width, this.height ]; - this.scissorStack = [ this.currentScissor ]; + this.scissorStack.length = 0; + this.scissorStack.push(this.currentScissor); if (this.game.scene.customViewports) { @@ -127168,13 +133096,13 @@ var WebGLRenderer = new Class({ this.textureFlush = 0; - this.pipelines.setMulti(); + this.emit(Events.PRE_RENDER); }, /** * The core render step for a Scene Camera. * - * Iterates through the given Game Object's array and renders them with the given Camera. + * Iterates through the given array of Game Objects and renders them with the given Camera. * * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked * by the Scene Systems.render method. @@ -127182,21 +133110,20 @@ var WebGLRenderer = new Class({ * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * * @method Phaser.Renderer.WebGL.WebGLRenderer#render + * @fires Phaser.Renderer.WebGL.Events#RENDER * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered. - * @param {number} interpolationPercentage - The interpolation percentage to apply. Currently un-used. + * @param {Phaser.GameObjects.GameObject[]} children - An array of filtered Game Objects that can be rendered by the given Camera. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ - render: function (scene, children, interpolationPercentage, camera) + render: function (scene, children, camera) { if (this.contextLost) { return; } - var list = children.list; - var childCount = list.length; + var childCount = children.length; - this.pipelines.render(scene, camera); + this.emit(Events.RENDER, scene, camera); // Apply scissor for cam region + render background color, if not transparent this.preRenderCamera(camera); @@ -127221,17 +133148,7 @@ var WebGLRenderer = new Class({ { this.finalType = (i === childCount - 1); - var child = list[i]; - - if (!child.willRender(camera)) - { - continue; - } - - if (child.blendMode !== this.currentBlendMode) - { - this.setBlendMode(child.blendMode); - } + var child = children[i]; var mask = child.mask; @@ -127248,6 +133165,11 @@ var WebGLRenderer = new Class({ mask.preRenderWebGL(this, child, camera); } + if (child.blendMode !== this.currentBlendMode) + { + this.setBlendMode(child.blendMode); + } + var type = child.type; if (type !== this.currentType) @@ -127256,9 +133178,16 @@ var WebGLRenderer = new Class({ this.currentType = type; } - this.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === this.currentType) : false; + if (!this.finalType) + { + this.nextTypeMatch = (children[i + 1].type === this.currentType); + } + else + { + this.nextTypeMatch = false; + } - child.renderWebGL(this, child, interpolationPercentage, camera); + child.renderWebGL(this, child, camera); this.newType = false; } @@ -127281,6 +133210,7 @@ var WebGLRenderer = new Class({ * The post-render step happens after all Cameras in all Scenes have been rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender + * @fires Phaser.Renderer.WebGL.Events#POST_RENDER * @since 3.0.0 */ postRender: function () @@ -127289,7 +133219,7 @@ var WebGLRenderer = new Class({ this.flush(); - // Unbind custom framebuffer here + this.emit(Events.POST_RENDER); var state = this.snapshotState; @@ -127300,8 +133230,6 @@ var WebGLRenderer = new Class({ state.callback = null; } - this.pipelines.postRender(); - if (this.textureFlush > 0) { this.startActiveTexture++; @@ -127352,10 +133280,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotArea * @since 3.16.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -127393,8 +133321,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotPixel * @since 3.16.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This WebGL Renderer. @@ -127422,14 +133350,14 @@ var WebGLRenderer = new Class({ * @since 3.19.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer to grab from. - * @param {integer} bufferWidth - The width of the framebuffer. - * @param {integer} bufferHeight - The height of the framebuffer. + * @param {number} bufferWidth - The width of the framebuffer. + * @param {number} bufferHeight - The height of the framebuffer. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? - * @param {integer} [x=0] - The x coordinate to grab from. - * @param {integer} [y=0] - The y coordinate to grab from. - * @param {integer} [width=bufferWidth] - The width of the area to grab. - * @param {integer} [height=bufferHeight] - The height of the area to grab. + * @param {number} [x=0] - The x coordinate to grab from. + * @param {number} [y=0] - The y coordinate to grab from. + * @param {number} [width=bufferWidth] - The width of the area to grab. + * @param {number} [height=bufferHeight] - The height of the area to grab. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. * @@ -127674,8 +133602,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter * @since 3.0.0 * - * @param {integer} texture - The texture to set the filter for. - * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. + * @param {number} texture - The texture to set the filter for. + * @param {number} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. * * @return {this} This WebGL Renderer instance. */ @@ -127701,403 +133629,6 @@ var WebGLRenderer = new Class({ return this; }, - /** - * Sets a 1f uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 1f value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat1: function (program, name, x) - { - this.setProgram(program); - - this.gl.uniform1f(this.gl.getUniformLocation(program, name), x); - - return this; - }, - - /** - * Sets the 2f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 2f x value to set on the named uniform. - * @param {number} y - The 2f y value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat2: function (program, name, x, y) - { - this.setProgram(program); - - this.gl.uniform2f(this.gl.getUniformLocation(program, name), x, y); - - return this; - }, - - /** - * Sets the 3f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 3f x value to set on the named uniform. - * @param {number} y - The 3f y value to set on the named uniform. - * @param {number} z - The 3f z value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat3: function (program, name, x, y, z) - { - this.setProgram(program); - - this.gl.uniform3f(this.gl.getUniformLocation(program, name), x, y, z); - - return this; - }, - - /** - * Sets the 4f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 4f x value to set on the named uniform. - * @param {number} y - The 4f y value to set on the named uniform. - * @param {number} z - The 4f z value to set on the named uniform. - * @param {number} w - The 4f w value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat4: function (program, name, x, y, z, w) - { - this.setProgram(program); - - this.gl.uniform4f(this.gl.getUniformLocation(program, name), x, y, z, w); - - return this; - }, - - /** - * Sets the value of a 1fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat1v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform1fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat2v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform2fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat3v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform3fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - - setFloat4v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform4fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets a 1iv uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1iv - * @since 3.50.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Int32List} arr - The 1iv value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt1iv: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform1iv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets a 1i uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 1i value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt1: function (program, name, x) - { - this.setProgram(program); - - this.gl.uniform1i(this.gl.getUniformLocation(program, name), x); - - return this; - }, - - /** - * Sets the 2i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 2i x value to set on the named uniform. - * @param {integer} y - The 2i y value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt2: function (program, name, x, y) - { - this.setProgram(program); - - this.gl.uniform2i(this.gl.getUniformLocation(program, name), x, y); - - return this; - }, - - /** - * Sets the 3i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 3i x value to set on the named uniform. - * @param {integer} y - The 3i y value to set on the named uniform. - * @param {integer} z - The 3i z value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt3: function (program, name, x, y, z) - { - this.setProgram(program); - - this.gl.uniform3i(this.gl.getUniformLocation(program, name), x, y, z); - - return this; - }, - - /** - * Sets the 4i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 4i x value to set on the named uniform. - * @param {integer} y - The 4i y value to set on the named uniform. - * @param {integer} z - The 4i z value to set on the named uniform. - * @param {integer} w - The 4i w value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt4: function (program, name, x, y, z, w) - { - this.setProgram(program); - - this.gl.uniform4i(this.gl.getUniformLocation(program, name), x, y, z, w); - - return this; - }, - - /** - * Sets the value of a matrix 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 4 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix2: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix2fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Sets the value of a matrix 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 9 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix3: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix3fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Sets the value of a matrix 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 16 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix4: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix4fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Returns the maximum number of texture units that can be used in a fragment shader. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextures - * @since 3.8.0 - * - * @return {integer} The maximum number of textures WebGL supports. - */ - getMaxTextures: function () - { - return this.config.maxTextures; - }, - /** * Returns the largest texture size (either width or height) that can be created. * Note that VRAM may not allow a texture of any given size, it just expresses @@ -128106,7 +133637,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextureSize * @since 3.8.0 * - * @return {integer} The maximum supported texture size. + * @return {number} The maximum supported texture size. */ getMaxTextureSize: function () { @@ -128121,46 +133652,34 @@ var WebGLRenderer = new Class({ */ destroy: function () { - // Clear-up anything that should be cleared :) + this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); + this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - var i; var gl = this.gl; var temp = this.tempTextures; - var native = this.nativeTextures; - for (i = 0; i < temp.length; i++) + for (var i = 0; i < temp.length; i++) { gl.deleteTexture(temp[i]); } - for (i = 0; i < native.length; i++) - { - gl.deleteTexture(native[i]); - } - - this.textureIndexes = []; - this.nativeTextures = []; - this.pipelines.destroy(); - this.defaultCamera.destroy(); + this.removeAllListeners(); + + this.fboStack = []; + this.maskStack = []; + this.extensions = {}; + this.textureIndexes = []; + + this.gl = null; + this.game = null; + this.canvas = null; + this.contextLost = true; this.currentMask = null; this.currentCameraMask = null; - - this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); - this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - - this.game = null; - this.gl = null; - this.canvas = null; - - this.maskStack = []; - - this.contextLost = true; - - this.extensions = {}; } }); @@ -128169,7 +133688,7 @@ module.exports = WebGLRenderer; /***/ }), -/* 536 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -128179,19 +133698,36 @@ module.exports = WebGLRenderer; */ var Class = __webpack_require__(0); -var CustomMap = __webpack_require__(92); -var CONST = __webpack_require__(110); +var CONST = __webpack_require__(82); +var CustomMap = __webpack_require__(98); // Default Phaser 3 Pipelines -var BitmapMaskPipeline = __webpack_require__(537); -var LightPipeline = __webpack_require__(538); -var MultiPipeline = __webpack_require__(112); -var RopePipeline = __webpack_require__(539); -var SinglePipeline = __webpack_require__(540); +var BitmapMaskPipeline = __webpack_require__(573); +var GraphicsPipeline = __webpack_require__(575); +var LightPipeline = __webpack_require__(576); +var MultiPipeline = __webpack_require__(158); +var RopePipeline = __webpack_require__(577); +var SinglePipeline = __webpack_require__(578); +var UtilityPipeline = __webpack_require__(864); /** * @classdesc + * The Pipeline Manager is responsible for the creation, activation, running and destruction + * of WebGL Pipelines in Phaser 3. * + * The `WebGLRenderer` owns a single instance of the Pipeline Manager, which you can access + * via the `WebGLRenderer.pipelines` property. + * + * By default, there are 5 pipelines installed into the Pipeline Manager when Phaser boots: + * + * 1. The Multi Pipeline. Responsible for all multi-texture rendering, i.e. Sprites, Shapes. + * 2. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. + * 3. The Rope Pipeline. Responsible for rendering the Rope Game Object. + * 4. The Light Pipeline. Responsible for rendering the Light Game Object. + * 5. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. + * + * You can add your own custom pipeline via the `PipelineManager.add` method. Pipelines are + * identified by unique string-based keys. * * @class PipelineManager * @memberof Phaser.Renderer.WebGL @@ -128224,12 +133760,31 @@ var PipelineManager = new Class({ */ this.renderer = renderer; + /** + * This map stores all pipeline classes available in this manager. + * + * The Utility Class must always come first. + * + * @name Phaser.Renderer.WebGL.PipelineManager#classes + * @type {Phaser.Structs.Map.} + * @since 3.50.0 + */ + this.classes = new CustomMap([ + [ CONST.UTILITY_PIPELINE, UtilityPipeline ], + [ CONST.MULTI_PIPELINE, MultiPipeline ], + [ CONST.BITMAPMASK_PIPELINE, BitmapMaskPipeline ], + [ CONST.SINGLE_PIPELINE, SinglePipeline ], + [ CONST.ROPE_PIPELINE, RopePipeline ], + [ CONST.LIGHT_PIPELINE, LightPipeline ], + [ CONST.GRAPHICS_PIPELINE, GraphicsPipeline ] + ]); + /** * This map stores all pipeline instances in this manager. * * This is populated with the default pipelines in the `boot` method. * - * @name Phaser.Renderer.WebGL.WebGLRenderer#pipelines + * @name Phaser.Renderer.WebGL.PipelineManager#pipelines * @type {Phaser.Structs.Map.} * @since 3.50.0 */ @@ -128282,6 +133837,80 @@ var PipelineManager = new Class({ * @since 3.50.0 */ this.BITMAPMASK_PIPELINE = null; + + /** + * A constant-style reference to the Utility Pipeline Instance. + * + * @name Phaser.Renderer.WebGL.PipelineManager#UTILITY_PIPELINE + * @type {Phaser.Renderer.WebGL.Pipelines.UtilityPipeline} + * @default null + * @since 3.50.0 + */ + this.UTILITY_PIPELINE = null; + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame2; }, /** @@ -128294,19 +133923,57 @@ var PipelineManager = new Class({ * * @method Phaser.Renderer.WebGL.PipelineManager#boot * @since 3.50.0 + * + * @param {Phaser.Types.Core.PipelineConfig} [pipelineConfig] - The pipeline configuration object as set in the Game Config. */ - boot: function () + boot: function (pipelineConfig) { + // Install each of the default pipelines + + var instance; + var _this = this; var game = this.game; - this.MULTI_PIPELINE = this.add(CONST.MULTI_PIPELINE, new MultiPipeline({ game: game })); - this.BITMAPMASK_PIPELINE = this.add(CONST.BITMAPMASK_PIPELINE, new BitmapMaskPipeline({ game: game })); + this.classes.each(function (name, pipeline) + { + instance = _this.add(name, new pipeline({ game: game })); - this.add(CONST.SINGLE_PIPELINE, new SinglePipeline({ game: game })); - this.add(CONST.ROPE_PIPELINE, new RopePipeline({ game: game })); - this.add(CONST.LIGHT_PIPELINE, new LightPipeline({ game: game })); + if (name === CONST.UTILITY_PIPELINE) + { + _this.UTILITY_PIPELINE = instance; - this.set(this.MULTI_PIPELINE); + // FBO references + _this.fullFrame1 = instance.fullFrame1; + _this.fullFrame2 = instance.fullFrame2; + _this.halfFrame1 = instance.halfFrame1; + _this.halfFrame2 = instance.halfFrame2; + } + }); + + // Our const-like references + this.MULTI_PIPELINE = this.get(CONST.MULTI_PIPELINE); + this.BITMAPMASK_PIPELINE = this.get(CONST.BITMAPMASK_PIPELINE); + + // And now the ones in the config, if any + if (pipelineConfig) + { + for (var pipelineName in pipelineConfig) + { + var pipelineClass = pipelineConfig[pipelineName]; + + if (!this.has(pipelineName)) + { + this.classes.set(pipelineName, pipelineClass); + + instance = new pipelineClass(game); + + if (!instance.isPostFX) + { + this.add(pipelineName, instance); + } + } + } + } }, /** @@ -128314,13 +133981,23 @@ var PipelineManager = new Class({ * * The name of the instance must be unique within this manager. * - * Make sure to pass an instance to this method, not a base class. For example: + * Make sure to pass an instance to this method, not a base class. + * + * For example, you should pass it like this: * * ```javascript - * this.add('yourName', new MultiPipeline());` + * this.add('yourName', new CustomPipeline());` * ``` * - * @method Phaser.Renderer.WebGL.PipelineManager#addPipeline + * and **not** like this: + * + * ```javascript + * this.add('yourName', CustomPipeline);` + * ``` + * + * To add a **Post Pipeline**, see `addPostPipeline` instead. + * + * @method Phaser.Renderer.WebGL.PipelineManager#add * @since 3.50.0 * * @param {string} name - A unique string-based key for the pipeline within the manager. @@ -128330,11 +134007,21 @@ var PipelineManager = new Class({ */ add: function (name, pipeline) { + if (pipeline.isPostFX) + { + console.warn(name + ' is a Post Pipeline. Use `addPostPipeline` instead'); + + return; + } + var pipelines = this.pipelines; var renderer = this.renderer; if (!pipelines.has(name)) { + pipeline.name = name; + pipeline.manager = this; + pipelines.set(name, pipeline); } else @@ -128342,95 +134029,52 @@ var PipelineManager = new Class({ console.warn('Pipeline exists: ' + name); } - pipeline.name = name; - if (!pipeline.hasBooted) { pipeline.boot(); } - pipeline.resize(renderer.width, renderer.height, renderer.config.resolution); + if (renderer.width !== 0 && renderer.height !== 0) + { + pipeline.resize(renderer.width, renderer.height); + } return pipeline; }, /** - * Resizes handler. + * Adds a Post Pipeline to this Pipeline Manager. * - * This is called automatically by the `WebGLRenderer` when the game resizes. + * Make sure to pass a base class to this method, not an instance. * - * @method Phaser.Renderer.WebGL.PipelineManager#resize + * For example, you should pass it like this: + * + * ```javascript + * this.addPostPipeline('yourName', CustomPipeline);` + * ``` + * + * and **not** like this: + * + * ```javascript + * this.addPostPipeline('yourName', new CustomPipeline());` + * ``` + * + * To add a regular pipeline, see the `add` method instead. + * + * @method Phaser.Renderer.WebGL.PipelineManager#addPostPipeline * @since 3.50.0 * - * @param {number} [width] - The new width of the renderer. - * @param {number} [height] - The new height of the renderer. - * @param {number} [resolution] - The new resolution of the renderer. + * @param {string} name - A unique string-based key for the pipeline within the manager. + * @param {function} pipeline - A pipeline class which must extend `PostFXPipeline`. + * + * @return {this} This Pipeline Manager. */ - resize: function (width, height, resolution) + addPostPipeline: function (name, pipeline) { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) + if (!this.classes.has(name)) { - pipelineInstance.resize(width, height, resolution); - }); - }, - - /** - * Calls the `onPreRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.preRender` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#preRender - * @since 3.50.0 - */ - preRender: function () - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onPreRender(); - }); - }, - - /** - * Calls the `onRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.render` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#render - * @since 3.50.0 - * - * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. - */ - render: function (scene, camera) - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onRender(scene, camera); - }); - }, - - /** - * Calls the `onPostRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.postRender` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#postRender - * @since 3.50.0 - */ - postRender: function () - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onPostRender(); - }); + this.classes.set(name, pipeline); + } }, /** @@ -128448,39 +134092,109 @@ var PipelineManager = new Class({ }, /** - * Checks if a pipeline is present in the Pipeline Manager. + * Checks if a pipeline is present in this Pipeline Manager. * * @method Phaser.Renderer.WebGL.PipelineManager#has * @since 3.50.0 * - * @param {string} name - The name of the pipeline to check for. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance to look-up. * * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`. */ - has: function (name) + has: function (pipeline) { - return this.pipelines.has(name); + var pipelines = this.pipelines; + + if (typeof pipeline === 'string') + { + return pipelines.has(pipeline); + } + else if (pipelines.contains(pipeline)) + { + return true; + } + + return false; }, /** - * Returns the pipeline instance based on the given name. + * Returns the pipeline instance based on the given name, or instance. * - * If no instance exists in this manager, it returns `undefined` instead. + * If no instance, or matching name, exists in this manager, it returns `undefined`. * * @method Phaser.Renderer.WebGL.PipelineManager#get * @since 3.50.0 * - * @param {string} name - The name of the pipeline to get. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance to look-up. * * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `undefined` if not found. */ - get: function (name) + get: function (pipeline) { - return this.pipelines.get(name); + var pipelines = this.pipelines; + + if (typeof pipeline === 'string') + { + return pipelines.get(pipeline); + } + else if (pipelines.contains(pipeline)) + { + return pipeline; + } }, /** - * Removes a pipeline based on the given name. + * Returns a _new instance_ of the post pipeline based on the given name, or class. + * + * If no instance, or matching name, exists in this manager, it returns `undefined`. + * + * @method Phaser.Renderer.WebGL.PipelineManager#getPostPipeline + * @since 3.50.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance, or class to look-up. + * @param {Phaser.GameObjects.GameObject} [gameObject] - If this post pipeline is being installed into a Game Object or Camera, this is a reference to it. + * + * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The pipeline instance, or `undefined` if not found. + */ + getPostPipeline: function (pipeline, gameObject) + { + var pipelineClasses = this.classes; + + var instance; + + if (typeof pipeline === 'string') + { + instance = pipelineClasses.get(pipeline); + } + else if (typeof pipeline === 'function') + { + // A class + if (pipelineClasses.contains(pipeline)) + { + instance = pipeline; + } + } + else if (typeof pipeline === 'object') + { + // Instance + instance = pipelineClasses.get(pipeline.name); + } + + if (instance) + { + var newPipeline = new instance(this.game); + + if (gameObject) + { + newPipeline.gameObject = gameObject; + } + + return newPipeline; + } + }, + + /** + * Removes a pipeline instance based on the given name. * * If no pipeline matches the name, this method does nothing. * @@ -128491,10 +134205,18 @@ var PipelineManager = new Class({ * @since 3.50.0 * * @param {string} name - The name of the pipeline to be removed. + * @param {boolean} [removeClass=true] - Remove the class as well as the instance? */ - remove: function (name) + remove: function (name, removeClass) { + if (removeClass === undefined) { removeClass = true; } + this.pipelines.delete(name); + + if (removeClass) + { + this.classes.delete(name); + } }, /** @@ -128502,33 +134224,39 @@ var PipelineManager = new Class({ * * This method accepts a pipeline instance as its parameter, not the name. * - * If the pipeline isn't already the current one, it will also call `resetTextures` on - * the `WebGLRenderer`. After this, `WebGLPipeline.bind` and then `onBind` are called. + * If the pipeline isn't already the current one it will call `WebGLPipeline.bind` and then `onBind`. + * + * You cannot set Post FX Pipelines using this method. To use a Post FX Pipeline, you should + * apply it to either a Camera, Container or other supporting Game Object. * * @method Phaser.Renderer.WebGL.PipelineManager#set * @since 3.50.0 * * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline instance to be set as current. * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was set. + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was set, or undefined if it couldn't be set. */ - set: function (pipeline, gameObject) + set: function (pipeline, gameObject, currentShader) { - var renderer = this.renderer; - var current = this.current; - - if ( - current !== pipeline || - current.vertexBuffer !== renderer.currentVertexBuffer || - current.program !== renderer.currentProgram - ) + if (pipeline.isPostFX) { - renderer.resetTextures(); + return; + } + + if (!this.isCurrent(pipeline, currentShader)) + { + this.flush(); + + if (this.current) + { + this.current.unbind(); + } this.current = pipeline; - pipeline.bind(); + pipeline.bind(currentShader); } pipeline.onBind(gameObject); @@ -128536,6 +134264,307 @@ var PipelineManager = new Class({ return pipeline; }, + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. It causes a batch + * flush, then calls the `preBatch` method on the post-fx pipelines belonging to the + * Game Object. + * + * @method Phaser.Renderer.WebGL.PipelineManager#preBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object about to be batched. + */ + preBatch: function (gameObject) + { + if (gameObject.hasPostPipeline) + { + this.flush(); + + var pipelines = gameObject.postPipelines; + + // Iterate in reverse because we need them stacked in the order they're in the array + for (var i = pipelines.length - 1; i >= 0; i--) + { + pipelines[i].preBatch(gameObject); + } + } + }, + + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. It causes a batch + * flush, then calls the `postBatch` method on the post-fx pipelines belonging to the + * Game Object. + * + * @method Phaser.Renderer.WebGL.PipelineManager#postBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to the batch. + */ + postBatch: function (gameObject) + { + if (gameObject.hasPostPipeline) + { + this.flush(); + + var pipelines = gameObject.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].postBatch(gameObject); + } + } + }, + + /** + * Called at the start of the `WebGLRenderer.preRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `preBatch` method on the post-fx pipelines belonging to the Camera. + * + * @method Phaser.Renderer.WebGL.PipelineManager#preBatchCamera + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera about to be rendered. + */ + preBatchCamera: function (camera) + { + if (camera.hasPostPipeline) + { + this.flush(); + + var pipelines = camera.postPipelines; + + // Iterate in reverse because we need them stacked in the order they're in the array + for (var i = pipelines.length - 1; i >= 0; i--) + { + pipelines[i].preBatch(camera); + } + } + }, + + /** + * Called at the end of the `WebGLRenderer.postRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `postBatch` method on the post-fx pipelines belonging to the Camera. + * + * @method Phaser.Renderer.WebGL.PipelineManager#postBatchCamera + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that was just rendered. + */ + postBatchCamera: function (camera) + { + if (camera.hasPostPipeline) + { + this.flush(); + + var pipelines = camera.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].postBatch(camera); + } + } + }, + + /** + * Checks to see if the given pipeline is already the active pipeline, both within this + * Pipeline Manager, and also has the same vertex buffer and shader set within the Renderer. + * + * @method Phaser.Renderer.WebGL.PipelineManager#isCurrent + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline instance to be checked. + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {boolean} `true` if the given pipeline is already the current pipeline, otherwise `false`. + */ + isCurrent: function (pipeline, currentShader) + { + var renderer = this.renderer; + var current = this.current; + + if (current && !currentShader) + { + currentShader = current.currentShader; + } + + return !( + current !== pipeline || + current.vertexBuffer !== renderer.currentVertexBuffer || + currentShader.program !== renderer.currentProgram + ); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * The copy itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.copyShader); + + pipeline.copyFrame(source, target, brightness, clear, clearAlpha); + + return this; + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.PipelineManager#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.copyShader); + + pipeline.copyToGame(source); + + return this; + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * The copy itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Display.ColorMatrix} [colorMatrix] - The Color Matrix to use when performing the draw. + * + * @return {this} This Pipeline Manager instance. + */ + drawFrame: function (source, target, clearAlpha, colorMatrix) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader); + + pipeline.drawFrame(source, target, clearAlpha, colorMatrix); + + return this; + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + blendFrames: function (source1, source2, target, strength, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.linearShader); + + pipeline.blendFrames(source1, source2, target, strength, clearAlpha); + + return this; + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.addShader); + + pipeline.blendFrames(source1, source2, target, strength, clearAlpha); + + return this; + }, + + /** + * Clears the given Render Target. + * + * @method Phaser.Renderer.WebGL.PipelineManager#clearFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to clear. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + clearFrame: function (target, clearAlpha) + { + this.UTILITY_PIPELINE.clearFrame(target, clearAlpha); + + return this; + }, + + /** + * Returns `true` if the current pipeline is forced to use texture unit zero. + * + * @method Phaser.Renderer.WebGL.PipelineManager#forceZero + * @since 3.50.0 + * + * @return {boolean} `true` if the current pipeline is forced to use texture unit zero. + */ + forceZero: function () + { + return (this.current && this.current.forceZero); + }, + /** * Sets the Multi Pipeline to be the currently bound pipeline. * @@ -128551,6 +134580,21 @@ var PipelineManager = new Class({ return this.set(this.MULTI_PIPELINE); }, + /** + * Sets the Utility Pipeline to be the currently bound pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#setUtility + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {Phaser.Renderer.WebGL.Pipelines.UtilityPipeline} The Utility Pipeline instance. + */ + setUtility: function (currentShader) + { + return this.UTILITY_PIPELINE.bind(currentShader); + }, + /** * Use this to reset the gl context to the state that Phaser requires to continue rendering. * @@ -128608,12 +134652,9 @@ var PipelineManager = new Class({ renderer.setBlendMode(0, true); - renderer.resetTextures(); - this.current = pipeline; - pipeline.bind(true); - pipeline.onBind(); + pipeline.rebind(); }, /** @@ -128654,10 +134695,12 @@ var PipelineManager = new Class({ { this.flush(); + this.classes.clear(); this.pipelines.clear(); this.renderer = null; this.game = null; + this.classes = null; this.pipelines = null; this.current = null; this.previous = null; @@ -128669,7 +134712,7 @@ module.exports = PipelineManager; /***/ }), -/* 537 */ +/* 573 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -128681,9 +134724,10 @@ module.exports = PipelineManager; var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var ShaderSourceFS = __webpack_require__(807); -var ShaderSourceVS = __webpack_require__(808); -var WebGLPipeline = __webpack_require__(111); +var ShaderSourceFS = __webpack_require__(853); +var ShaderSourceVS = __webpack_require__(854); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); /** * @classdesc @@ -128724,50 +134768,38 @@ var BitmapMaskPipeline = new Class({ { config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS), config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS), - config.vertexSize = GetFastValue(config, 'vertexSize', 8), - config.vertexCapacity = GetFastValue(config, 'vertexCapacity', 3), + config.batchSize = GetFastValue(config, 'batchSize', 1), config.vertices = GetFastValue(config, 'vertices', new Float32Array([ -1, 1, -1, -7, 7, 1 ]).buffer), config.attributes = GetFastValue(config, 'attributes', [ { name: 'inPosition', size: 2, - type: config.game.renderer.gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 + type: WEBGL_CONST.FLOAT } ]); + config.uniforms = GetFastValue(config, 'uniforms', [ + 'uResolution', + 'uMainSampler', + 'uMaskSampler', + 'uInvertMaskAlpha' + ]); WebGLPipeline.call(this, config); }, - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) + boot: function () { - if (reset === undefined) { reset = false; } + WebGLPipeline.prototype.boot.call(this); - WebGLPipeline.prototype.bind.call(this, reset); + this.set1i('uMainSampler', 0); + this.set1i('uMaskSampler', 1); + }, - var renderer = this.renderer; - var program = this.program; + resize: function (width, height) + { + WebGLPipeline.prototype.resize.call(this, width, height); - renderer.setFloat2(program, 'uResolution', this.width, this.height); - renderer.setInt1(program, 'uMainSampler', 0); - renderer.setInt1(program, 'uMaskSampler', 1); - - return this; + this.set2f('uResolution', width, height); }, /** @@ -128783,24 +134815,19 @@ var BitmapMaskPipeline = new Class({ */ beginMask: function (mask, maskedObject, camera) { - var renderer = this.renderer; var gl = this.gl; // The renderable Game Object that is being used for the bitmap mask - var bitmapMask = mask.bitmapMask; - - if (bitmapMask && gl) + if (mask.bitmapMask && gl) { + var renderer = this.renderer; + renderer.flush(); - mask.prevFramebuffer = renderer.currentFramebuffer; - - renderer.setFramebuffer(mask.mainFramebuffer); + renderer.pushFramebuffer(mask.mainFramebuffer); gl.disable(gl.STENCIL_TEST); - gl.clearColor(0, 0, 0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); if (renderer.currentCameraMask.mask !== mask) @@ -128832,21 +134859,25 @@ var BitmapMaskPipeline = new Class({ if (bitmapMask && gl) { + // mask.mainFramebuffer should now contain all the Game Objects we want masked renderer.flush(); - // First we draw the mask to the mask fb - renderer.setFramebuffer(mask.maskFramebuffer); + // Swap to the mask framebuffer (push, in case the bitmapMask GO has a post-pipeline) + renderer.pushFramebuffer(mask.maskFramebuffer); + // Clear it and draw the Game Object that is acting as a mask to it gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT); renderer.setBlendMode(0, true); - bitmapMask.renderWebGL(renderer, bitmapMask, 0, camera); + bitmapMask.renderWebGL(renderer, bitmapMask, camera); renderer.flush(); - renderer.setFramebuffer(mask.prevFramebuffer); + // Clear the mask framebuffer + main framebuffer + renderer.popFramebuffer(); + renderer.popFramebuffer(); // Is there a stencil further up the stack? var prev = renderer.getCurrentStencilMask(); @@ -128862,7 +134893,7 @@ var BitmapMaskPipeline = new Class({ renderer.currentMask.mask = null; } - // Bind bitmap mask pipeline and draw + // Bind this pipeline and draw renderer.pipelines.set(this); gl.activeTexture(gl.TEXTURE1); @@ -128871,10 +134902,12 @@ var BitmapMaskPipeline = new Class({ gl.activeTexture(gl.TEXTURE0); gl.bindTexture(gl.TEXTURE_2D, mask.mainTexture); - gl.uniform1i(gl.getUniformLocation(this.program, 'uInvertMaskAlpha'), mask.invertAlpha); + this.set1i('uInvertMaskAlpha', mask.invertAlpha); // Finally, draw a triangle filling the whole screen gl.drawArrays(this.topology, 0, 3); + + renderer.resetTextures(); } } @@ -128884,7 +134917,1720 @@ module.exports = BitmapMaskPipeline; /***/ }), -/* 538 */ +/* 574 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var GetFastValue = __webpack_require__(2); +var WEBGL_CONST = __webpack_require__(74); + +/** + * @classdesc + * TODO + * + * @class WebGLShader + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The WebGLPipeline to which this Shader belongs. + * @param {string} name - The name of this Shader. + * @param {string} vertexShader - The vertex shader source code as a single string. + * @param {string} fragmentShader - The fragment shader source code as a single string. + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]} attributes - An array of attributes. + * @param {string[]} [uniforms] - An array of shader uniform names that will be looked-up to get the locations for. + */ +var WebGLShader = new Class({ + + initialize: + + function WebGLShader (pipeline, name, vertexShader, fragmentShader, attributes, uniforms) + { + /** + * A reference to the WebGLPipeline that owns this Shader. + * + * A Shader class can only belong to a single pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLShader#pipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @since 3.50.0 + */ + this.pipeline = pipeline; + + /** + * The name of this shader. + * + * @name Phaser.Renderer.WebGL.WebGLShader#name + * @type {string} + * @since 3.50.0 + */ + this.name = name; + + /** + * A reference to the WebGLRenderer instance. + * + * @name Phaser.Renderer.WebGL.WebGLShader#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.50.0 + */ + this.renderer = pipeline.renderer; + + /** + * A reference to the WebGL Rendering Context the WebGL Renderer is using. + * + * @name Phaser.Renderer.WebGL.WebGLShader#gl + * @type {WebGLRenderingContext} + * @since 3.50.0 + */ + this.gl = this.renderer.gl; + + /** + * The WebGLProgram created from the vertex and fragment shaders. + * + * @name Phaser.Renderer.WebGL.WebGLShader#program + * @type {WebGLProgram} + * @since 3.50.0 + */ + this.program = this.renderer.createProgram(vertexShader, fragmentShader); + + /** + * Array of objects that describe the vertex attributes. + * + * @name Phaser.Renderer.WebGL.WebGLShader#attributes + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineAttribute[]} + * @since 3.50.0 + */ + this.attributes; + + /** + * The amount of vertex attribute components of 32 bit length. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertexComponentCount + * @type {number} + * @since 3.50.0 + */ + this.vertexComponentCount = 0; + + /** + * The size, in bytes, of a single vertex. + * + * This is derived by adding together all of the vertex attributes. + * + * For example, the Multi Pipeline has the following attributes: + * + * inPosition - (size 2 x gl.FLOAT) = 8 + * inTexCoord - (size 2 x gl.FLOAT) = 8 + * inTexId - (size 1 x gl.FLOAT) = 4 + * inTintEffect - (size 1 x gl.FLOAT) = 4 + * inTint - (size 4 x gl.UNSIGNED_BYTE) = 4 + * + * The total, in this case, is 8 + 8 + 4 + 4 + 4 = 28. + * + * This is calculated automatically during the `createAttributes` method. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertexSize + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.vertexSize = 0; + + /** + * The uniforms that this shader requires, as set via the configuration object. + * + * This is an object that maps the uniform names to their WebGL location. + * + * It is populated with their locations via the `setUniformLocations` method. + * + * @name Phaser.Renderer.WebGL.WebGLShader#uniforms + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineUniformsConfig} + * @since 3.50.0 + */ + this.uniforms = {}; + + this.createAttributes(attributes); + + if (uniforms) + { + this.setUniformLocations(uniforms); + } + }, + + /** + * Takes the vertex attributes config and parses it, creating the resulting array that is stored + * in this shaders `attributes` property, calculating the offset, normalization and location + * in the process. + * + * Calling this method resets `WebGLShader.attributes`, `WebGLShader.vertexSize` and + * `WebGLShader.vertexComponentCount`. + * + * It is called automatically when this class is created, but can be called manually if required. + * + * @method Phaser.Renderer.WebGL.WebGLShader#createAttributes + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]} attributes - An array of attributes configs. + */ + createAttributes: function (attributes) + { + var count = 0; + var offset = 0; + var result = []; + + this.vertexComponentCount = 0; + + for (var i = 0; i < attributes.length; i++) + { + var element = attributes[i]; + + var name = element.name; + var size = element.size; // i.e. 1 for a float, 2 for a vec2, 4 for a vec4, etc + var glType = GetFastValue(element, 'type', WEBGL_CONST.FLOAT); + var type = glType.enum; // The GLenum + var typeSize = glType.size; // The size in bytes of the type + + var normalized = (element.normalized) ? true : false; + + result.push({ + name: name, + size: size, + type: type, + normalized: normalized, + offset: offset, + enabled: false, + location: -1 + }); + + if (typeSize === 4) + { + count += size; + } + else + { + count++; + } + + offset += size * typeSize; + } + + this.vertexSize = offset; + this.vertexComponentCount = count; + this.attributes = result; + }, + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * This method is called every time the parent pipeline is made the current active pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLShader#bind + * @since 3.50.0 + * + * @param {boolean} [setAttributes=false] - Should the vertex attribute pointers be set? + * @param {boolean} [flush=false] - Flush the pipeline before binding this shader? + * + * @return {this} This WebGLShader instance. + */ + bind: function (setAttributes, flush) + { + if (setAttributes === undefined) { setAttributes = false; } + if (flush === undefined) { flush = false; } + + if (flush) + { + this.pipeline.flush(); + } + + this.renderer.setProgram(this.program); + + if (setAttributes) + { + this.setAttribPointers(); + } + + return this; + }, + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * Then resets all of the attribute pointers. + * + * @method Phaser.Renderer.WebGL.WebGLShader#rebind + * @since 3.50.0 + * + * @return {this} This WebGLShader instance. + */ + rebind: function () + { + this.renderer.setProgram(this.program); + + this.setAttribPointers(true); + + return this; + }, + + /** + * Sets the vertex attribute pointers. + * + * This should only be called after the vertex buffer has been bound. + * + * It is called automatically during the `bind` method. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setAttribPointers + * @since 3.50.0 + * + * @param {boolean} [reset=false] - Reset the vertex attribute locations? + * + * @return {this} This WebGLShader instance. + */ + setAttribPointers: function (reset) + { + if (reset === undefined) { reset = false; } + + var gl = this.gl; + var vertexSize = this.vertexSize; + var attributes = this.attributes; + var program = this.program; + + for (var i = 0; i < attributes.length; i++) + { + var element = attributes[i]; + + var size = element.size; + var type = element.type; + var offset = element.offset; + var enabled = element.enabled; + var location = element.location; + var normalized = (element.normalized) ? true : false; + + if (reset) + { + var attribLocation = gl.getAttribLocation(program, element.name); + + if (attribLocation >= 0) + { + gl.enableVertexAttribArray(attribLocation); + + gl.vertexAttribPointer(attribLocation, size, type, normalized, vertexSize, offset); + + element.enabled = true; + element.location = attribLocation; + } + else if (attribLocation !== -1) + { + gl.disableVertexAttribArray(attribLocation); + } + } + else if (enabled) + { + gl.vertexAttribPointer(location, size, type, normalized, vertexSize, offset); + } + else if (!enabled && location > -1) + { + gl.disableVertexAttribArray(location); + + element.location = -1; + } + } + + return this; + }, + + /** + * Sets up the `WebGLShader.uniforms` object, populating it with the names + * and locations of the shader uniforms this shader requires. + * + * This method is called automatically when this class is created. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniformLocations + * @since 3.50.0 + * + * @param {string[]} uniformNames - An array of the uniform names to get the locations for. + * + * @return {this} This WebGLShader instance. + */ + setUniformLocations: function (uniformNames) + { + var gl = this.gl; + var program = this.program; + var uniforms = this.uniforms; + + for (var i = 0; i < uniformNames.length; i++) + { + var name = uniformNames[i]; + + var location = gl.getUniformLocation(program, name); + + if (location !== null) + { + uniforms[name] = + { + name: name, + location: location, + value1: null, + value2: null, + value3: null, + value4: null + }; + } + } + + return this; + }, + + /** + * Checks to see if the given uniform name exists and is active in this shader. + * + * @method Phaser.Renderer.WebGL.WebGLShader#hasUniform + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to check for. + * + * @return {boolean} `true` if the uniform exists, otherwise `false`. + */ + hasUniform: function (name) + { + return this.uniforms.hasOwnProperty(name); + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform1 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform1: function (setter, name, value1) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1) + { + uniform.value1 = value1; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform2 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform2: function (setter, name, value1, value2) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2) + { + uniform.value1 = value1; + uniform.value2 = value2; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform3 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value3 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform3: function (setter, name, value1, value2, value3) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2 || uniform.value3 !== value3) + { + uniform.value1 = value1; + uniform.value2 = value2; + uniform.value3 = value3; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2, value3); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform4 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value3 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value4 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform4: function (setter, name, value1, value2, value3, value4) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2 || uniform.value3 !== value3 || uniform.value4 !== value4) + { + uniform.value1 = value1; + uniform.value2 = value2; + uniform.value3 = value3; + uniform.value4 = value4; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2, value3, value4); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets a 1f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `float` uniform. + * + * @return {this} This WebGLShader instance. + */ + set1f: function (name, x) + { + return this.setUniform1(this.gl.uniform1f, name, x); + }, + + /** + * Sets a 2f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec2` uniform. + * @param {number} y - The new Y component of the `vec2` uniform. + * + * @return {this} This WebGLShader instance. + */ + set2f: function (name, x, y) + { + return this.setUniform2(this.gl.uniform2f, name, x, y); + }, + + /** + * Sets a 3f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec3` uniform. + * @param {number} y - The new Y component of the `vec3` uniform. + * @param {number} z - The new Z component of the `vec3` uniform. + * + * @return {this} This WebGLShader instance. + */ + set3f: function (name, x, y, z) + { + return this.setUniform3(this.gl.uniform3f, name, x, y, z); + }, + + /** + * Sets a 4f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * + * @return {this} This WebGLShader instance. + */ + set4f: function (name, x, y, z, w) + { + return this.setUniform4(this.gl.uniform4f, name, x, y, z, w); + }, + + /** + * Sets a 1fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set1fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform1fv, name, arr); + }, + + /** + * Sets a 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set2fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform2fv, name, arr); + }, + + /** + * Sets a 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set3fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform3fv, name, arr); + }, + + /** + * Sets a 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set4fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform4fv, name, arr); + }, + + /** + * Sets a 1iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set1iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform1iv, name, arr); + }, + + /** + * Sets a 2iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set2iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform2iv, name, arr); + }, + + /** + * Sets a 3iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set3iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform3iv, name, arr); + }, + + /** + * Sets a 4iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set4iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform4iv, name, arr); + }, + + /** + * Sets a 1i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `int` uniform. + * + * @return {this} This WebGLShader instance. + */ + set1i: function (name, x) + { + return this.setUniform1(this.gl.uniform1i, name, x); + }, + + /** + * Sets a 2i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec2` uniform. + * @param {number} y - The new Y component of the `ivec2` uniform. + * + * @return {this} This WebGLShader instance. + */ + set2i: function (name, x, y) + { + return this.setUniform2(this.gl.uniform2i, name, x, y); + }, + + /** + * Sets a 3i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec3` uniform. + * @param {number} y - The new Y component of the `ivec3` uniform. + * @param {number} z - The new Z component of the `ivec3` uniform. + * + * @return {this} This WebGLShader instance. + */ + set3i: function (name, x, y, z) + { + return this.setUniform3(this.gl.uniform3i, name, x, y, z); + }, + + /** + * Sets a 4i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * + * @return {this} This WebGLShader instance. + */ + set4i: function (name, x, y, z, w) + { + return this.setUniform4(this.gl.uniform4i, name, x, y, z, w); + }, + + /** + * Sets a matrix 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {number[]|Float32Array} matrix - The new values for the `mat2` uniform. + * + * @return {this} This WebGLShader instance. + */ + setMatrix2fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix2fv, name, transpose, matrix); + }, + + /** + * Sets a matrix 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {Float32Array} matrix - The new values for the `mat3` uniform. + * + * @return {this} This WebGLShader instance. + */ + setMatrix3fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix3fv, name, transpose, matrix); + }, + + /** + * Sets a matrix 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Should the matrix be transpose + * @param {Float32Array} matrix - Matrix data + * + * @return {this} This WebGLShader instance. + */ + setMatrix4fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix4fv, name, transpose, matrix); + }, + + /** + * Removes all external references from this class and deletes the WebGL program from the WebGL context. + * + * Does not remove this shader from the parent pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLShader#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.gl.deleteProgram(this.program); + + this.pipeline = null; + this.renderer = null; + this.gl = null; + this.program = null; + this.attributes = null; + this.uniforms = null; + } + +}); + +module.exports = WebGLShader; + + +/***/ }), +/* 575 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Earcut = __webpack_require__(65); +var GetFastValue = __webpack_require__(2); +var ShaderSourceFS = __webpack_require__(855); +var ShaderSourceVS = __webpack_require__(856); +var TransformMatrix = __webpack_require__(24); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); + +/** + * @classdesc + * The Graphics Pipeline is the rendering pipeline used by Phaser in WebGL when drawing + * primitive geometry objects, such as the Graphics Game Object, or the Shape Game Objects + * such as Arc, Line, Rectangle and Star. It handles the preperation and batching of related vertices. + * + * Prior to Phaser v3.50 the functions of this pipeline were merged with the `TextureTintPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Graphics.frag`. + * The vertex shader it uses can be found in `shaders/src/Graphics.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2) + * `inColor` (vec4, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * + * @class GraphicsPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var GraphicsPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function GraphicsPipeline (config) + { + config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); + config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inColor', + size: 4, + type: WEBGL_CONST.UNSIGNED_BYTE, + normalized: true + } + ]); + config.uniforms = GetFastValue(config, 'uniforms', [ + 'uProjectionMatrix' + ]); + + WebGLPipeline.call(this, config); + + /** + * A temporary Transform Matrix, re-used internally during batching by the + * Shape Game Objects. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#calcMatrix + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.50.0 + */ + this.calcMatrix = new TransformMatrix(); + + /** + * Used internally to draw stroked triangles. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#tempTriangle + * @type {array} + * @private + * @since 3.50.0 + */ + this.tempTriangle = [ + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 } + ]; + + /** + * Cached stroke tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#strokeTint + * @type {object} + * @private + * @since 3.50.0 + */ + this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Cached fill tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#fillTint + * @type {object} + * @private + * @since 3.50.0 + */ + this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Internal texture frame reference. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#currentFrame + * @type {Phaser.Textures.Frame} + * @private + * @since 3.50.0 + */ + this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#firstQuad + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.firstQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#prevQuad + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.prevQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Used internally for triangulating a polygon. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#polygonCache + * @type {array} + * @private + * @since 3.50.0 + */ + this.polygonCache = []; + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * + * Rectangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillRect + * @since 3.50.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var xw = x + width; + var yh = y + height; + + var x0 = calcMatrix.getX(x, y); + var y0 = calcMatrix.getY(x, y); + + var x1 = calcMatrix.getX(x, yh); + var y1 = calcMatrix.getY(x, yh); + + var x2 = calcMatrix.getX(xw, yh); + var y2 = calcMatrix.getY(xw, yh); + + var x3 = calcMatrix.getX(xw, y); + var y3 = calcMatrix.getY(xw, y); + + var tint = this.fillTint; + + this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint.TL, tint.TR, tint.BL, tint.BR); + }, + + /** + * Pushes a filled triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillTriangle + * @since 3.50.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + var tint = this.fillTint; + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tint.TL, tint.TR, tint.BL); + }, + + /** + * Pushes a stroked triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokeTriangle + * @since 3.50.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {number} lineWidth - The width of the line in pixels. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) + { + var tempTriangle = this.tempTriangle; + + tempTriangle[0].x = x0; + tempTriangle[0].y = y0; + tempTriangle[0].width = lineWidth; + + tempTriangle[1].x = x1; + tempTriangle[1].y = y1; + tempTriangle[1].width = lineWidth; + + tempTriangle[2].x = x2; + tempTriangle[2].y = y2; + tempTriangle[2].width = lineWidth; + + tempTriangle[3].x = x0; + tempTriangle[3].y = y0; + tempTriangle[3].width = lineWidth; + + this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillPath + * @since 3.50.0 + * + * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillPath: function (path, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var length = path.length; + var polygonCache = this.polygonCache; + var polygonIndexArray; + var point; + + var tintTL = this.fillTint.TL; + var tintTR = this.fillTint.TR; + var tintBL = this.fillTint.BL; + + for (var pathIndex = 0; pathIndex < length; ++pathIndex) + { + point = path[pathIndex]; + polygonCache.push(point.x, point.y); + } + + polygonIndexArray = Earcut(polygonCache); + length = polygonIndexArray.length; + + for (var index = 0; index < length; index += 3) + { + var p0 = polygonIndexArray[index + 0] * 2; + var p1 = polygonIndexArray[index + 1] * 2; + var p2 = polygonIndexArray[index + 2] * 2; + + var x0 = polygonCache[p0 + 0]; + var y0 = polygonCache[p0 + 1]; + var x1 = polygonCache[p1 + 0]; + var y1 = polygonCache[p1 + 1]; + var x2 = polygonCache[p2 + 0]; + var y2 = polygonCache[p2 + 1]; + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tintTL, tintTR, tintBL); + } + + polygonCache.length = 0; + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokePath + * @since 3.50.0 + * + * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. + * @param {number} lineWidth - The width of the line segments in pixels. + * @param {boolean} pathOpen - Indicates if the path should be closed or left open. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + // Reset the closePath booleans + this.prevQuad[4] = 0; + this.firstQuad[4] = 0; + + var pathLength = path.length - 1; + + for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) + { + var point0 = path[pathIndex]; + var point1 = path[pathIndex + 1]; + + this.batchLine( + point0.x, + point0.y, + point1.x, + point1.y, + point0.width / 2, + point1.width / 2, + lineWidth, + pathIndex, + !pathOpen && (pathIndex === pathLength - 1), + currentMatrix, + parentMatrix + ); + } + }, + + /** + * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchLine + * @since 3.50.0 + * + * @param {number} ax - x coordinate of the start of the line. + * @param {number} ay - y coordinate of the start of the line. + * @param {number} bx - x coordinate of the end of the line. + * @param {number} by - y coordinate of the end of the line. + * @param {number} aLineWidth - Width of the start of the line. + * @param {number} bLineWidth - Width of the end of the line. + * @param {number} index - If this line is part of a multi-line draw, the index of the line in the draw. + * @param {boolean} closePath - Does this line close a multi-line path? + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var dx = bx - ax; + var dy = by - ay; + + var len = Math.sqrt(dx * dx + dy * dy); + var al0 = aLineWidth * (by - ay) / len; + var al1 = aLineWidth * (ax - bx) / len; + var bl0 = bLineWidth * (by - ay) / len; + var bl1 = bLineWidth * (ax - bx) / len; + + var lx0 = bx - bl0; + var ly0 = by - bl1; + var lx1 = ax - al0; + var ly1 = ay - al1; + var lx2 = bx + bl0; + var ly2 = by + bl1; + var lx3 = ax + al0; + var ly3 = ay + al1; + + // tx0 = bottom right + var brX = calcMatrix.getX(lx0, ly0); + var brY = calcMatrix.getY(lx0, ly0); + + // tx1 = bottom left + var blX = calcMatrix.getX(lx1, ly1); + var blY = calcMatrix.getY(lx1, ly1); + + // tx2 = top right + var trX = calcMatrix.getX(lx2, ly2); + var trY = calcMatrix.getY(lx2, ly2); + + // tx3 = top left + var tlX = calcMatrix.getX(lx3, ly3); + var tlY = calcMatrix.getY(lx3, ly3); + + var tint = this.strokeTint; + + var tintTL = tint.TL; + var tintTR = tint.TR; + var tintBL = tint.BL; + var tintBR = tint.BR; + + // TL, BL, BR, TR + this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, tintTL, tintTR, tintBL, tintBR); + + if (lineWidth <= 2) + { + // No point doing a linejoin if the line isn't thick enough + return; + } + + var prev = this.prevQuad; + var first = this.firstQuad; + + if (index > 0 && prev[4]) + { + this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], tintTL, tintTR, tintBL, tintBR); + } + else + { + first[0] = tlX; + first[1] = tlY; + first[2] = blX; + first[3] = blY; + first[4] = 1; + } + + if (closePath && first[4]) + { + // Add a join for the final path segment + this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], tintTL, tintTR, tintBL, tintBR); + } + else + { + // Store it + + prev[0] = brX; + prev[1] = brY; + prev[2] = trX; + prev[3] = trY; + prev[4] = 1; + } + }, + + /** + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchVert + * @since 3.50.0 + * + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, tint) + { + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewU32[++vertexOffset] = tint; + + this.vertexCount++; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchQuad + * @override + * @since 3.50.0 + * + * @param {number} x0 - The top-left x position. + * @param {number} y0 - The top-left y position. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {number} tintBR - The bottom-right tint color value. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, tintTL, tintTR, tintBL, tintBR) + { + var hasFlushed = false; + + if (this.shouldFlush(6)) + { + this.flush(); + + hasFlushed = true; + } + + this.batchVert(x0, y0, tintTL); + this.batchVert(x1, y1, tintBL); + this.batchVert(x2, y2, tintBR); + this.batchVert(x0, y0, tintTL); + this.batchVert(x2, y2, tintBR); + this.batchVert(x3, y3, tintTR); + + return hasFlushed; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchTri + * @override + * @since 3.50.0 + * + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchTri: function (x0, y0, x1, y1, x2, y2, tintTL, tintTR, tintBL) + { + var hasFlushed = false; + + if (this.shouldFlush(3)) + { + this.flush(); + + hasFlushed = true; + } + + this.batchVert(x0, y0, tintTL); + this.batchVert(x1, y1, tintTR); + this.batchVert(x2, y2, tintBL); + + return hasFlushed; + }, + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#destroy + * @since 3.50.0 + * + * @return {this} This WebGLPipeline instance. + */ + destroy: function () + { + WebGLPipeline.prototype.destroy.call(this); + + this.polygonCache = null; + + return this; + } + +}); + +module.exports = GraphicsPipeline; + + +/***/ }), +/* 576 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -128896,9 +136642,12 @@ module.exports = BitmapMaskPipeline; var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var ShaderSourceFS = __webpack_require__(809); -var MultiPipeline = __webpack_require__(112); -var WebGLPipeline = __webpack_require__(111); +var LightShaderSourceFS = __webpack_require__(857); +var PointLightShaderSourceFS = __webpack_require__(858); +var PointLightShaderSourceVS = __webpack_require__(859); +var TransformMatrix = __webpack_require__(24); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); var LIGHT_COUNT = 10; @@ -128952,7 +136701,7 @@ var LIGHT_COUNT = 10; */ var LightPipeline = new Class({ - Extends: MultiPipeline, + Extends: WebGLPipeline, initialize: @@ -128960,11 +136709,73 @@ var LightPipeline = new Class({ { LIGHT_COUNT = config.game.renderer.config.maxLights; - var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); + config.shaders = GetFastValue(config, 'shaders', [ + { + name: 'PointLight', + fragShader: PointLightShaderSourceFS, + vertShader: PointLightShaderSourceVS, + uniforms: [ + 'uProjectionMatrix', + 'uResolution' + ] + }, + { + name: 'Light', + fragShader: LightShaderSourceFS.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString()) + } + ]); - config.fragShader = fragmentShaderSource.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString()); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inLightPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inLightRadius', + size: 1, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inLightColor', + size: 4, + type: WEBGL_CONST.FLOAT + } + ]); - MultiPipeline.call(this, config); + WebGLPipeline.call(this, config); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempMatrix1 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this.tempMatrix1 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempMatrix2 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this.tempMatrix2 = new TransformMatrix(); + + /** + * A temporary Transform Matrix, re-used internally during batching. + * + * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempMatrix3 + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.11.0 + */ + this.tempMatrix3 = new TransformMatrix(); /** * Inverse rotation matrix for normal map rotations. @@ -129000,6 +136811,9 @@ var LightPipeline = new Class({ this.lightCount = 0; this.forceZero = true; + + this.pointLightShader; + this.lightShader; }, /** @@ -129008,7 +136822,7 @@ var LightPipeline = new Class({ * By this stage all Game level systems are now in place and you can perform any final * tasks that the pipeline may need that relied on game systems such as the Texture Manager. * - * @method Phaser.Renderer.WebGL.LightPipeline#boot + * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#boot * @since 3.11.0 */ boot: function () @@ -129027,48 +136841,101 @@ var LightPipeline = new Class({ this.defaultNormalMap = { glTexture: tempTexture }; - return this; + this.pointLightShader = this.shaders[0]; + this.lightShader = this.shaders[1]; }, /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. * - * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#bind + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#batchVert * @since 3.50.0 * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} u - UV u value. + * @param {number} v - UV v value. + * @param {number} unit - Texture unit to which the texture needs to be bound. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, lightX, lightY, radius, r, g, b, a) + { + var vertexViewF32 = this.vertexViewF32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewF32[++vertexOffset] = lightX; + vertexViewF32[++vertexOffset] = lightY; + vertexViewF32[++vertexOffset] = radius; + vertexViewF32[++vertexOffset] = r; + vertexViewF32[++vertexOffset] = g; + vertexViewF32[++vertexOffset] = b; + vertexViewF32[++vertexOffset] = a; + + this.vertexCount++; + }, + + batchLight: function (light, camera, x0, y0, x1, y1, x2, y2, x3, y3, lightX, lightY) + { + var color = light.color; + var intensity = light.intensity; + var radius = light.radius; + + var r = color.r * intensity; + var g = color.g * intensity; + var b = color.b * intensity; + var a = camera.alpha * light.alpha; + + if (this.shouldFlush(6)) + { + this.flush(); + } + + this.batchVert(x0, y0, lightX, lightY, radius, r, g, b, a); + this.batchVert(x1, y1, lightX, lightY, radius, r, g, b, a); + this.batchVert(x2, y2, lightX, lightY, radius, r, g, b, a); + this.batchVert(x0, y0, lightX, lightY, radius, r, g, b, a); + this.batchVert(x2, y2, lightX, lightY, radius, r, g, b, a); + this.batchVert(x3, y3, lightX, lightY, radius, r, g, b, a); + }, + + /** + * Called every time a Game Object needs to use this pipeline. + * + * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#onBind + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. * * @return {this} This WebGLPipeline instance. */ - bind: function (reset) + onBind: function () { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - var renderer = this.renderer; - var program = this.program; - - renderer.setInt1(program, 'uMainSampler', 0); - renderer.setInt1(program, 'uNormSampler', 1); - renderer.setFloat2(program, 'uResolution', this.width, this.height); - - return this; + this.set1i('uMainSampler', 0); + this.set1i('uNormSampler', 1); + this.set2f('uResolution', this.width / 2, this.height / 2); }, /** * This function sets all the needed resources for each camera pass. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#onRender + * @ignore * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene being rendered. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. * * @return {this} This WebGLPipeline instance. - */ onRender: function (scene, camera) { this.active = false; @@ -129140,6 +137007,7 @@ var LightPipeline = new Class({ return this; }, + */ /** * Rotates the normal map vectors inversely by the given angle. @@ -129187,11 +137055,11 @@ var LightPipeline = new Class({ * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#setTexture2D + * @ignore * @since 3.50.0 * * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object being rendered or added to the batch. - */ setTexture2D: function (texture, gameObject) { var renderer = this.renderer; @@ -129216,19 +137084,20 @@ var LightPipeline = new Class({ return 0; }, + */ /** * Custom pipelines can use this method in order to perform any required pre-batch tasks * for the given Game Object. It must return the texture unit the Game Object was assigned. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#setGameObject + * @ignore * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. * @param {Phaser.Textures.Frame} [frame] - Optional frame to use. Can override that of the Game Object. * * @return {number} The texture unit the Game Object has been assigned. - */ setGameObject: function (gameObject, frame) { if (frame === undefined) { frame = gameObject.frame; } @@ -129251,6 +137120,7 @@ var LightPipeline = new Class({ return 0; }, + */ /** * Returns the normal map WebGLTexture from the given Game Object. @@ -129307,7 +137177,7 @@ module.exports = LightPipeline; /***/ }), -/* 539 */ +/* 577 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129317,8 +137187,8 @@ module.exports = LightPipeline; */ var Class = __webpack_require__(0); -var ModelViewProjection = __webpack_require__(113); -var MultiPipeline = __webpack_require__(112); +var GetFastValue = __webpack_require__(2); +var MultiPipeline = __webpack_require__(158); /** * @classdesc @@ -129361,15 +137231,13 @@ var RopePipeline = new Class({ Extends: MultiPipeline, - Mixins: [ - ModelViewProjection - ], - initialize: function RopePipeline (config) { - config.topology = config.game.renderer.gl.TRIANGLE_STRIP; + // GLenum 5 = TRIANGLE_STRIP + config.topology = 5; + config.batchSize = GetFastValue(config, 'batchSize', 256); MultiPipeline.call(this, config); } @@ -129379,7 +137247,7 @@ module.exports = RopePipeline; /***/ }), -/* 540 */ +/* 578 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129390,17 +137258,15 @@ module.exports = RopePipeline; var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var ModelViewProjection = __webpack_require__(113); -var MultiPipeline = __webpack_require__(112); -var ShaderSourceFS = __webpack_require__(812); -var ShaderSourceVS = __webpack_require__(813); -var WebGLPipeline = __webpack_require__(111); +var MultiPipeline = __webpack_require__(158); +var ShaderSourceFS = __webpack_require__(862); +var ShaderSourceVS = __webpack_require__(863); +var WebGLPipeline = __webpack_require__(75); /** * @classdesc - * * The Single Pipeline is a special version of the Multi Pipeline that only ever - * uses one single texture, bound to texture unit zero. Although not as efficient as the + * uses one texture, bound to texture unit zero. Although not as efficient as the * Multi Pipeline, it provides an easier way to create custom pipelines that only require * a single bound texture. * @@ -129413,14 +137279,13 @@ var WebGLPipeline = __webpack_require__(111); * * `inPosition` (vec2, offset 0) * `inTexCoord` (vec2, offset 8) - * `inTintEffect` (float, offset 16) - * `inTint` (vec4, offset 20, normalized) + * `inTexId` (float, offset 16) - this value is always zero in the Single Pipeline + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) * * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uViewMatrix` (mat4) - * `uModelMatrix` (mat4) * `uMainSampler` (sampler2D) * * @class SinglePipeline @@ -129435,274 +137300,22 @@ var SinglePipeline = new Class({ Extends: MultiPipeline, - Mixins: [ - ModelViewProjection - ], - initialize: function SinglePipeline (config) { - var gl = config.game.renderer.gl; - config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS), config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS), - config.vertexSize = GetFastValue(config, 'vertexSize', 24), - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 - }, - { - name: 'inTexCoord', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 8, - enabled: false, - location: -1 - }, - { - name: 'inTintEffect', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 16, - enabled: false, - location: -1 - }, - { - name: 'inTint', - size: 4, - type: gl.UNSIGNED_BYTE, - normalized: true, - offset: 20, - enabled: false, - location: -1 - } - ]); + config.forceZero = true; MultiPipeline.call(this, config); - - this.forceZero = true; }, - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#batchQuad - * @since 3.50.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - This parameter isn't used by this pipeline, but is retained for TTP support. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) + boot: function () { - if (unit === undefined) { unit = this.currentUnit; } + WebGLPipeline.prototype.boot.call(this); - var hasFlushed = false; - - if (this.vertexCount + 6 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - this.vertexCount += 6; - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#batchTri - * @since 3.50.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - This parameter isn't used by this pipeline, but is retained for TTP support. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.vertexCount + 3 > this.vertexCapacity) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - this.vertexCount += 3; - - return hasFlushed; - }, - - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - return this; + this.set1i('uMainSampler', 0); } }); @@ -129711,7 +137324,33 @@ module.exports = SinglePipeline; /***/ }), -/* 541 */ +/* 579 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_QUAD_VS', + '', + 'precision mediump float;', + '', + 'attribute vec2 inPosition;', + 'attribute vec2 inTexCoord;', + '', + 'varying vec2 outFragCoord;', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' outFragCoord = inPosition.xy * 0.5 + 0.5;', + ' outTexCoord = inTexCoord;', + '', + ' gl_Position = vec4(inPosition, 0, 1);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 580 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129720,13 +137359,13 @@ module.exports = SinglePipeline; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasPool = __webpack_require__(26); -var Color = __webpack_require__(32); +var CanvasPool = __webpack_require__(31); +var Color = __webpack_require__(36); var GetFastValue = __webpack_require__(2); /** * Takes a snapshot of an area from the current frame displayed by a WebGL canvas. - * + * * This is then copied to an Image object. When this loads, the results are sent * to the callback provided in the Snapshot Configuration object. * @@ -129773,19 +137412,19 @@ var WebGLSnapshot = function (sourceCanvas, config) var pixels = new Uint8Array(total); gl.readPixels(x, bufferHeight - y - height, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); - + var canvas = CanvasPool.createWebGL(this, width, height); var ctx = canvas.getContext('2d'); var imageData = ctx.getImageData(0, 0, width, height); - + var data = imageData.data; for (var py = 0; py < height; py++) { for (var px = 0; px < width; px++) { - var sourceIndex = ((height - py) * width + px) * 4; + var sourceIndex = ((height - py - 1) * width + px) * 4; var destIndex = (isFramebuffer) ? total - ((py * width + (width - px)) * 4) : (py * width + px) * 4; data[destIndex + 0] = pixels[sourceIndex + 0]; @@ -129796,7 +137435,7 @@ var WebGLSnapshot = function (sourceCanvas, config) } ctx.putImageData(imageData, 0, 0); - + var image = new Image(); image.onerror = function () @@ -129821,7 +137460,7 @@ module.exports = WebGLSnapshot; /***/ }), -/* 542 */ +/* 581 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129834,8 +137473,8 @@ var Axes = {}; module.exports = Axes; -var Vector = __webpack_require__(102); -var Common = __webpack_require__(44); +var Vector = __webpack_require__(114); +var Common = __webpack_require__(50); (function() { @@ -129891,7 +137530,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 543 */ +/* 582 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129906,28 +137545,28 @@ var Common = __webpack_require__(44); module.exports = { - AFTER_ADD: __webpack_require__(1426), - AFTER_REMOVE: __webpack_require__(1427), - AFTER_UPDATE: __webpack_require__(1428), - BEFORE_ADD: __webpack_require__(1429), - BEFORE_REMOVE: __webpack_require__(1430), - BEFORE_UPDATE: __webpack_require__(1431), - COLLISION_ACTIVE: __webpack_require__(1432), - COLLISION_END: __webpack_require__(1433), - COLLISION_START: __webpack_require__(1434), - DRAG_END: __webpack_require__(1435), - DRAG: __webpack_require__(1436), - DRAG_START: __webpack_require__(1437), - PAUSE: __webpack_require__(1438), - RESUME: __webpack_require__(1439), - SLEEP_END: __webpack_require__(1440), - SLEEP_START: __webpack_require__(1441) + AFTER_ADD: __webpack_require__(1488), + AFTER_REMOVE: __webpack_require__(1489), + AFTER_UPDATE: __webpack_require__(1490), + BEFORE_ADD: __webpack_require__(1491), + BEFORE_REMOVE: __webpack_require__(1492), + BEFORE_UPDATE: __webpack_require__(1493), + COLLISION_ACTIVE: __webpack_require__(1494), + COLLISION_END: __webpack_require__(1495), + COLLISION_START: __webpack_require__(1496), + DRAG_END: __webpack_require__(1497), + DRAG: __webpack_require__(1498), + DRAG_START: __webpack_require__(1499), + PAUSE: __webpack_require__(1500), + RESUME: __webpack_require__(1501), + SLEEP_END: __webpack_require__(1502), + SLEEP_START: __webpack_require__(1503) }; /***/ }), -/* 544 */ +/* 583 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -129942,9 +137581,9 @@ var Detector = {}; module.exports = Detector; -var SAT = __webpack_require__(545); -var Pair = __webpack_require__(501); -var Bounds = __webpack_require__(103); +var SAT = __webpack_require__(584); +var Pair = __webpack_require__(518); +var Bounds = __webpack_require__(115); (function() { @@ -130040,7 +137679,7 @@ var Bounds = __webpack_require__(103); /***/ }), -/* 545 */ +/* 584 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130055,8 +137694,8 @@ var SAT = {}; module.exports = SAT; -var Vertices = __webpack_require__(88); -var Vector = __webpack_require__(102); +var Vertices = __webpack_require__(93); +var Vector = __webpack_require__(114); (function() { @@ -130316,7 +137955,7 @@ var Vector = __webpack_require__(102); /***/ }), -/* 546 */ +/* 585 */ /***/ (function(module, exports) { var g; @@ -130342,21 +137981,21 @@ module.exports = g; /***/ }), -/* 547 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(548); -__webpack_require__(549); -__webpack_require__(550); -__webpack_require__(551); -__webpack_require__(552); -__webpack_require__(553); -__webpack_require__(554); -__webpack_require__(555); +__webpack_require__(587); +__webpack_require__(588); +__webpack_require__(589); +__webpack_require__(590); +__webpack_require__(591); +__webpack_require__(592); +__webpack_require__(593); +__webpack_require__(594); /***/ }), -/* 548 */ +/* 587 */ /***/ (function(module, exports) { /** @@ -130396,7 +138035,7 @@ if (!Array.prototype.forEach) /***/ }), -/* 549 */ +/* 588 */ /***/ (function(module, exports) { /** @@ -130412,7 +138051,7 @@ if (!Array.isArray) /***/ }), -/* 550 */ +/* 589 */ /***/ (function(module, exports) { /* Copyright 2013 Chris Wilson @@ -130599,7 +138238,7 @@ BiquadFilterNode.type and OscillatorNode.type. /***/ }), -/* 551 */ +/* 590 */ /***/ (function(module, exports) { /** @@ -130614,7 +138253,7 @@ if (!window.console) /***/ }), -/* 552 */ +/* 591 */ /***/ (function(module, exports) { // ES6 Math.trunc - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc @@ -130626,7 +138265,7 @@ if (!Math.trunc) { /***/ }), -/* 553 */ +/* 592 */ /***/ (function(module, exports) { /** @@ -130663,7 +138302,7 @@ if (!Math.trunc) { /***/ }), -/* 554 */ +/* 593 */ /***/ (function(module, exports) { // References: @@ -130720,7 +138359,7 @@ if (!window.cancelAnimationFrame) /***/ }), -/* 555 */ +/* 594 */ /***/ (function(module, exports) { /** @@ -130773,7 +138412,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o /***/ }), -/* 556 */ +/* 595 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130782,7 +138421,7 @@ if (typeof window.Uint32Array !== 'function' && typeof window.Uint32Array !== 'o * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var QuickSet = __webpack_require__(253); +var QuickSet = __webpack_require__(268); /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, and aligns them next to each other. @@ -130795,7 +138434,7 @@ var QuickSet = __webpack_require__(253); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. - * @param {integer} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. + * @param {number} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * @@ -130821,7 +138460,7 @@ module.exports = AlignTo; /***/ }), -/* 557 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -130830,7 +138469,7 @@ module.exports = AlignTo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `angle` property, @@ -130848,8 +138487,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `angle` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -130862,7 +138501,7 @@ module.exports = Angle; /***/ }), -/* 558 */ +/* 597 */ /***/ (function(module, exports) { /** @@ -130901,7 +138540,7 @@ module.exports = Call; /***/ }), -/* 559 */ +/* 598 */ /***/ (function(module, exports) { /** @@ -130924,7 +138563,7 @@ module.exports = Call; * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [index=0] - An optional offset to start searching from within the items array. * * @return {?(object|Phaser.GameObjects.GameObject)} The first object in the array that matches the comparison object, or `null` if no match was found. */ @@ -130959,7 +138598,7 @@ module.exports = GetFirst; /***/ }), -/* 560 */ +/* 599 */ /***/ (function(module, exports) { /** @@ -130982,7 +138621,7 @@ module.exports = GetFirst; * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [index=0] - An optional offset to start searching from within the items array. * * @return {?(object|Phaser.GameObjects.GameObject)} The last object in the array that matches the comparison object, or `null` if no match was found. */ @@ -131017,7 +138656,7 @@ module.exports = GetLast; /***/ }), -/* 561 */ +/* 600 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131026,11 +138665,11 @@ module.exports = GetLast; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AlignIn = __webpack_require__(266); -var CONST = __webpack_require__(108); +var AlignIn = __webpack_require__(281); +var CONST = __webpack_require__(120); var GetFastValue = __webpack_require__(2); var NOOP = __webpack_require__(1); -var Zone = __webpack_require__(117); +var Zone = __webpack_require__(125); var tempZone = new Zone({ sys: { queueDepthSort: NOOP, events: { once: NOOP } } }, 0, 0, 1, 1); @@ -131136,7 +138775,7 @@ module.exports = GridAlign; /***/ }), -/* 562 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131145,7 +138784,7 @@ module.exports = GridAlign; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -131431,7 +139070,7 @@ module.exports = Alpha; /***/ }), -/* 563 */ +/* 602 */ /***/ (function(module, exports) { /** @@ -131580,7 +139219,7 @@ module.exports = ComputedSize; /***/ }), -/* 564 */ +/* 603 */ /***/ (function(module, exports) { /** @@ -131705,7 +139344,7 @@ module.exports = Crop; /***/ }), -/* 565 */ +/* 604 */ /***/ (function(module, exports) { /** @@ -131869,7 +139508,7 @@ module.exports = Flip; /***/ }), -/* 566 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -131879,7 +139518,7 @@ module.exports = Flip; */ var Rectangle = __webpack_require__(9); -var RotateAround = __webpack_require__(285); +var RotateAround = __webpack_require__(300); var Vector2 = __webpack_require__(3); /** @@ -132228,7 +139867,7 @@ module.exports = GetBounds; /***/ }), -/* 567 */ +/* 606 */ /***/ (function(module, exports) { /** @@ -132251,7 +139890,7 @@ module.exports = 'blur'; /***/ }), -/* 568 */ +/* 607 */ /***/ (function(module, exports) { /** @@ -132273,7 +139912,7 @@ module.exports = 'boot'; /***/ }), -/* 569 */ +/* 608 */ /***/ (function(module, exports) { /** @@ -132296,7 +139935,7 @@ module.exports = 'contextlost'; /***/ }), -/* 570 */ +/* 609 */ /***/ (function(module, exports) { /** @@ -132319,7 +139958,7 @@ module.exports = 'contextrestored'; /***/ }), -/* 571 */ +/* 610 */ /***/ (function(module, exports) { /** @@ -132342,7 +139981,7 @@ module.exports = 'destroy'; /***/ }), -/* 572 */ +/* 611 */ /***/ (function(module, exports) { /** @@ -132364,7 +140003,7 @@ module.exports = 'focus'; /***/ }), -/* 573 */ +/* 612 */ /***/ (function(module, exports) { /** @@ -132390,7 +140029,7 @@ module.exports = 'hidden'; /***/ }), -/* 574 */ +/* 613 */ /***/ (function(module, exports) { /** @@ -132411,7 +140050,7 @@ module.exports = 'pause'; /***/ }), -/* 575 */ +/* 614 */ /***/ (function(module, exports) { /** @@ -132437,7 +140076,7 @@ module.exports = 'postrender'; /***/ }), -/* 576 */ +/* 615 */ /***/ (function(module, exports) { /** @@ -132462,7 +140101,7 @@ module.exports = 'poststep'; /***/ }), -/* 577 */ +/* 616 */ /***/ (function(module, exports) { /** @@ -132487,7 +140126,7 @@ module.exports = 'prerender'; /***/ }), -/* 578 */ +/* 617 */ /***/ (function(module, exports) { /** @@ -132512,7 +140151,7 @@ module.exports = 'prestep'; /***/ }), -/* 579 */ +/* 618 */ /***/ (function(module, exports) { /** @@ -132534,7 +140173,7 @@ module.exports = 'ready'; /***/ }), -/* 580 */ +/* 619 */ /***/ (function(module, exports) { /** @@ -132555,7 +140194,7 @@ module.exports = 'resume'; /***/ }), -/* 581 */ +/* 620 */ /***/ (function(module, exports) { /** @@ -132580,7 +140219,7 @@ module.exports = 'step'; /***/ }), -/* 582 */ +/* 621 */ /***/ (function(module, exports) { /** @@ -132604,7 +140243,7 @@ module.exports = 'visible'; /***/ }), -/* 583 */ +/* 622 */ /***/ (function(module, exports) { /** @@ -132807,7 +140446,7 @@ module.exports = Origin; /***/ }), -/* 584 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -132816,10 +140455,10 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(41); -var GetBoolean = __webpack_require__(90); +var DegToRad = __webpack_require__(34); +var GetBoolean = __webpack_require__(95); var GetValue = __webpack_require__(6); -var TWEEN_CONST = __webpack_require__(91); +var TWEEN_CONST = __webpack_require__(96); var Vector2 = __webpack_require__(3); /** @@ -132914,7 +140553,7 @@ var PathFollower = { * Records the direction of the follower so it can change direction. * * @name Phaser.GameObjects.PathFollower#_prevDirection - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -133234,7 +140873,7 @@ module.exports = PathFollower; /***/ }), -/* 585 */ +/* 624 */ /***/ (function(module, exports) { /** @@ -133421,7 +141060,7 @@ module.exports = Size; /***/ }), -/* 586 */ +/* 625 */ /***/ (function(module, exports) { /** @@ -133479,7 +141118,7 @@ var Texture = { * @since 3.0.0 * * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -133503,7 +141142,7 @@ var Texture = { * @method Phaser.GameObjects.Components.Texture#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * @@ -133551,7 +141190,7 @@ module.exports = Texture; /***/ }), -/* 587 */ +/* 626 */ /***/ (function(module, exports) { /** @@ -133603,24 +141242,24 @@ var TextureCrop = { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. - * + * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @@ -133668,7 +141307,7 @@ var TextureCrop = { * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -133692,7 +141331,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * @@ -133745,7 +141384,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject * @private * @since 3.12.0 - * + * * @return {object} The crop object. */ resetCropObject: function () @@ -133759,8 +141398,8 @@ module.exports = TextureCrop; /***/ }), -/* 588 */ -/***/ (function(module, exports, __webpack_require__) { +/* 627 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -133768,8 +141407,6 @@ module.exports = TextureCrop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColorFromValue = __webpack_require__(119); - /** * Provides methods used for setting the tint of a Game Object. * Should be applied as a mixin and not used directly. @@ -133782,62 +141419,58 @@ var GetColorFromValue = __webpack_require__(119); var Tint = { /** - * Private internal value. Holds the top-left tint value. + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTL + * @name Phaser.GameObjects.Components.Tint#tintTopLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTL: 16777215, + tintTopLeft: 0xffffff, /** - * Private internal value. Holds the top-right tint value. + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTR + * @name Phaser.GameObjects.Components.Tint#tintTopRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTR: 16777215, + tintTopRight: 0xffffff, /** - * Private internal value. Holds the bottom-left tint value. + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBL + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBL: 16777215, + tintBottomLeft: 0xffffff, /** - * Private internal value. Holds the bottom-right tint value. + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBR + * @name Phaser.GameObjects.Components.Tint#tintBottomRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBR: 16777215, + tintBottomRight: 0xffffff, /** - * Private internal value. Holds if the Game Object is tinted or not. + * The tint fill mode. * - * @name Phaser.GameObjects.Components.Tint#_isTinted - * @type {boolean} - * @private - * @default false - * @since 3.11.0 - */ - _isTinted: false, - - /** - * Fill or additive? + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Components.Tint#tintFill * @type {boolean} @@ -133862,8 +141495,6 @@ var Tint = { { this.setTint(0xffffff); - this._isTinted = false; - return this; }, @@ -133887,10 +141518,10 @@ var Tint = { * @webglOnly * @since 3.0.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -133905,12 +141536,10 @@ var Tint = { bottomRight = topLeft; } - this._tintTL = GetColorFromValue(topLeft); - this._tintTR = GetColorFromValue(topRight); - this._tintBL = GetColorFromValue(bottomLeft); - this._tintBR = GetColorFromValue(bottomRight); - - this._isTinted = true; + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; this.tintFill = false; @@ -133938,10 +141567,10 @@ var Tint = { * @webglOnly * @since 3.11.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -133954,108 +141583,12 @@ var Tint = { return this; }, - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopLeft: { - - get: function () - { - return this._tintTL; - }, - - set: function (value) - { - this._tintTL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopRight: { - - get: function () - { - return this._tintTR; - }, - - set: function (value) - { - this._tintTR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomLeft: { - - get: function () - { - return this._tintBL; - }, - - set: function (value) - { - this._tintBL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomRight: { - - get: function () - { - return this._tintBR; - }, - - set: function (value) - { - this._tintBR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. * * @name Phaser.GameObjects.Components.Tint#tint - * @type {integer} + * @type {number} * @webglOnly * @since 3.0.0 */ @@ -134068,7 +141601,10 @@ var Tint = { }, /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. * * @name Phaser.GameObjects.Components.Tint#isTinted * @type {boolean} @@ -134080,7 +141616,15 @@ var Tint = { get: function () { - return this._isTinted; + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); } } @@ -134091,7 +141635,7 @@ module.exports = Tint; /***/ }), -/* 589 */ +/* 628 */ /***/ (function(module, exports) { /** @@ -134123,7 +141667,7 @@ module.exports = 'changedata'; /***/ }), -/* 590 */ +/* 629 */ /***/ (function(module, exports) { /** @@ -134153,7 +141697,28 @@ module.exports = 'changedata-'; /***/ }), -/* 591 */ +/* 630 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Data Manager Destroy Event. + * + * The Data Manager will listen for the destroy event from its parent, and then close itself down. + * + * @event Phaser.Data.Events#DESTROY + * @since 3.50.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 631 */ /***/ (function(module, exports) { /** @@ -134181,7 +141746,7 @@ module.exports = 'removedata'; /***/ }), -/* 592 */ +/* 632 */ /***/ (function(module, exports) { /** @@ -134209,7 +141774,7 @@ module.exports = 'setdata'; /***/ }), -/* 593 */ +/* 633 */ /***/ (function(module, exports) { /** @@ -134235,7 +141800,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 594 */ +/* 634 */ /***/ (function(module, exports) { /** @@ -134260,7 +141825,7 @@ module.exports = 'destroy'; /***/ }), -/* 595 */ +/* 635 */ /***/ (function(module, exports) { /** @@ -134286,7 +141851,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 596 */ +/* 636 */ /***/ (function(module, exports) { /** @@ -134318,7 +141883,7 @@ module.exports = 'complete'; /***/ }), -/* 597 */ +/* 637 */ /***/ (function(module, exports) { /** @@ -134340,14 +141905,14 @@ module.exports = 'complete'; * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - * @param {integer} width - The width of the video. - * @param {integer} height - The height of the video. + * @param {number} width - The width of the video. + * @param {number} height - The height of the video. */ module.exports = 'created'; /***/ }), -/* 598 */ +/* 638 */ /***/ (function(module, exports) { /** @@ -134373,7 +141938,7 @@ module.exports = 'error'; /***/ }), -/* 599 */ +/* 639 */ /***/ (function(module, exports) { /** @@ -134405,7 +141970,7 @@ module.exports = 'loop'; /***/ }), -/* 600 */ +/* 640 */ /***/ (function(module, exports) { /** @@ -134433,7 +141998,7 @@ module.exports = 'play'; /***/ }), -/* 601 */ +/* 641 */ /***/ (function(module, exports) { /** @@ -134458,7 +142023,7 @@ module.exports = 'seeked'; /***/ }), -/* 602 */ +/* 642 */ /***/ (function(module, exports) { /** @@ -134484,7 +142049,7 @@ module.exports = 'seeking'; /***/ }), -/* 603 */ +/* 643 */ /***/ (function(module, exports) { /** @@ -134510,7 +142075,7 @@ module.exports = 'stop'; /***/ }), -/* 604 */ +/* 644 */ /***/ (function(module, exports) { /** @@ -134536,7 +142101,7 @@ module.exports = 'timeout'; /***/ }), -/* 605 */ +/* 645 */ /***/ (function(module, exports) { /** @@ -134562,7 +142127,7 @@ module.exports = 'unlocked'; /***/ }), -/* 606 */ +/* 646 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134571,7 +142136,7 @@ module.exports = 'unlocked'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `alpha` property, @@ -134589,8 +142154,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `alpha` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -134603,7 +142168,7 @@ module.exports = IncAlpha; /***/ }), -/* 607 */ +/* 647 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134612,7 +142177,7 @@ module.exports = IncAlpha; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `x` property, @@ -134630,8 +142195,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `x` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -134644,7 +142209,7 @@ module.exports = IncX; /***/ }), -/* 608 */ +/* 648 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134653,7 +142218,7 @@ module.exports = IncX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, @@ -134673,8 +142238,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {number} [y=x] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -134691,7 +142256,7 @@ module.exports = IncXY; /***/ }), -/* 609 */ +/* 649 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134700,7 +142265,7 @@ module.exports = IncXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `y` property, @@ -134718,8 +142283,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `y` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -134732,7 +142297,7 @@ module.exports = IncY; /***/ }), -/* 610 */ +/* 650 */ /***/ (function(module, exports) { /** @@ -134781,7 +142346,7 @@ module.exports = PlaceOnCircle; /***/ }), -/* 611 */ +/* 651 */ /***/ (function(module, exports) { /** @@ -134833,7 +142398,7 @@ module.exports = PlaceOnEllipse; /***/ }), -/* 612 */ +/* 652 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134842,7 +142407,7 @@ module.exports = PlaceOnEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoints = __webpack_require__(162); +var GetPoints = __webpack_require__(163); /** * Positions an array of Game Objects on evenly spaced points of a Line. @@ -134877,7 +142442,7 @@ module.exports = PlaceOnLine; /***/ }), -/* 613 */ +/* 653 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134886,9 +142451,9 @@ module.exports = PlaceOnLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MarchingAnts = __webpack_require__(294); -var RotateLeft = __webpack_require__(295); -var RotateRight = __webpack_require__(296); +var MarchingAnts = __webpack_require__(308); +var RotateLeft = __webpack_require__(170); +var RotateRight = __webpack_require__(171); /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Rectangle. @@ -134903,7 +142468,7 @@ var RotateRight = __webpack_require__(296); * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on. - * @param {integer} [shift=1] - An optional positional offset. + * @param {number} [shift=1] - An optional positional offset. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -134935,7 +142500,7 @@ module.exports = PlaceOnRectangle; /***/ }), -/* 614 */ +/* 654 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -134944,7 +142509,7 @@ module.exports = PlaceOnRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BresenhamPoints = __webpack_require__(297); +var BresenhamPoints = __webpack_require__(309); /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. @@ -134996,7 +142561,7 @@ module.exports = PlaceOnTriangle; /***/ }), -/* 615 */ +/* 655 */ /***/ (function(module, exports) { /** @@ -135015,7 +142580,7 @@ module.exports = PlaceOnTriangle; * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {string} key - The name of the animation to play. - * @param {(string|integer)} [startFrame] - The starting frame of the animation with the given key. + * @param {(string|number)} [startFrame] - The starting frame of the animation with the given key. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ @@ -135033,7 +142598,7 @@ module.exports = PlayAnimation; /***/ }), -/* 616 */ +/* 656 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135042,7 +142607,7 @@ module.exports = PlayAnimation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(160); +var Random = __webpack_require__(161); /** * Takes an array of Game Objects and positions them at random locations within the Circle. @@ -135073,7 +142638,7 @@ module.exports = RandomCircle; /***/ }), -/* 617 */ +/* 657 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135082,7 +142647,7 @@ module.exports = RandomCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(167); +var Random = __webpack_require__(172); /** * Takes an array of Game Objects and positions them at random locations within the Ellipse. @@ -135113,7 +142678,7 @@ module.exports = RandomEllipse; /***/ }), -/* 618 */ +/* 658 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135122,7 +142687,7 @@ module.exports = RandomEllipse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(163); +var Random = __webpack_require__(164); /** * Takes an array of Game Objects and positions them at random locations on the Line. @@ -135153,7 +142718,7 @@ module.exports = RandomLine; /***/ }), -/* 619 */ +/* 659 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135162,7 +142727,7 @@ module.exports = RandomLine; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(164); +var Random = __webpack_require__(165); /** * Takes an array of Game Objects and positions them at random locations within the Rectangle. @@ -135191,7 +142756,7 @@ module.exports = RandomRectangle; /***/ }), -/* 620 */ +/* 660 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135200,7 +142765,7 @@ module.exports = RandomRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Random = __webpack_require__(168); +var Random = __webpack_require__(173); /** * Takes an array of Game Objects and positions them at random locations within the Triangle. @@ -135231,7 +142796,7 @@ module.exports = RandomTriangle; /***/ }), -/* 621 */ +/* 661 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135240,7 +142805,7 @@ module.exports = RandomTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `rotation` property, @@ -135258,8 +142823,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `rotation` property (in radians). * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135272,7 +142837,7 @@ module.exports = Rotate; /***/ }), -/* 622 */ +/* 662 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135281,8 +142846,8 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundDistance = __webpack_require__(169); -var DistanceBetween = __webpack_require__(55); +var RotateAroundDistance = __webpack_require__(174); +var DistanceBetween = __webpack_require__(61); /** * Rotates each item around the given point by the given angle. @@ -135318,7 +142883,7 @@ module.exports = RotateAround; /***/ }), -/* 623 */ +/* 663 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135327,7 +142892,7 @@ module.exports = RotateAround; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathRotateAroundDistance = __webpack_require__(169); +var MathRotateAroundDistance = __webpack_require__(174); /** * Rotates an array of Game Objects around a point by the given angle and distance. @@ -135367,7 +142932,7 @@ module.exports = RotateAroundDistance; /***/ }), -/* 624 */ +/* 664 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135376,7 +142941,7 @@ module.exports = RotateAroundDistance; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `scaleX` property, @@ -135394,8 +142959,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleX` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135408,7 +142973,7 @@ module.exports = ScaleX; /***/ }), -/* 625 */ +/* 665 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135417,7 +142982,7 @@ module.exports = ScaleX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, @@ -135437,8 +143002,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {number} [scaleY] - The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135455,7 +143020,7 @@ module.exports = ScaleXY; /***/ }), -/* 626 */ +/* 666 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135464,7 +143029,7 @@ module.exports = ScaleXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueInc = __webpack_require__(39); +var PropertyValueInc = __webpack_require__(44); /** * Takes an array of Game Objects, or any objects that have a public `scaleY` property, @@ -135482,8 +143047,8 @@ var PropertyValueInc = __webpack_require__(39); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleY` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135496,7 +143061,7 @@ module.exports = ScaleY; /***/ }), -/* 627 */ +/* 667 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135505,7 +143070,7 @@ module.exports = ScaleY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `alpha` @@ -135523,8 +143088,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135537,7 +143102,7 @@ module.exports = SetAlpha; /***/ }), -/* 628 */ +/* 668 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135546,7 +143111,7 @@ module.exports = SetAlpha; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `blendMode` @@ -135563,8 +143128,8 @@ var PropertyValueSet = __webpack_require__(25); * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135577,7 +143142,7 @@ module.exports = SetBlendMode; /***/ }), -/* 629 */ +/* 669 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135586,7 +143151,7 @@ module.exports = SetBlendMode; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `depth` @@ -135604,8 +143169,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135618,7 +143183,7 @@ module.exports = SetDepth; /***/ }), -/* 630 */ +/* 670 */ /***/ (function(module, exports) { /** @@ -135657,7 +143222,7 @@ module.exports = SetHitArea; /***/ }), -/* 631 */ +/* 671 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135666,7 +143231,7 @@ module.exports = SetHitArea; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `originX` and `originY` @@ -135686,8 +143251,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [originY] - The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. * @param {number} [stepX=0] - This is added to the `originX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `originY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135710,7 +143275,7 @@ module.exports = SetOrigin; /***/ }), -/* 632 */ +/* 672 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135719,7 +143284,7 @@ module.exports = SetOrigin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `rotation` @@ -135737,8 +143302,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135751,7 +143316,7 @@ module.exports = SetRotation; /***/ }), -/* 633 */ +/* 673 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135760,7 +143325,7 @@ module.exports = SetRotation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` @@ -135780,8 +143345,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [scaleY] - The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135798,7 +143363,7 @@ module.exports = SetScale; /***/ }), -/* 634 */ +/* 674 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135807,7 +143372,7 @@ module.exports = SetScale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scaleX` @@ -135825,8 +143390,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135839,7 +143404,7 @@ module.exports = SetScaleX; /***/ }), -/* 635 */ +/* 675 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135848,7 +143413,7 @@ module.exports = SetScaleX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scaleY` @@ -135866,8 +143431,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135880,7 +143445,7 @@ module.exports = SetScaleY; /***/ }), -/* 636 */ +/* 676 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135889,7 +143454,7 @@ module.exports = SetScaleY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `scrollFactorX` and `scrollFactorY` @@ -135909,8 +143474,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [scrollFactorY] - The amount to set the `scrollFactorY` property to. If `undefined` or `null` it uses the `scrollFactorX` value. * @param {number} [stepX=0] - This is added to the `scrollFactorX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scrollFactorY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135927,7 +143492,7 @@ module.exports = SetScrollFactor; /***/ }), -/* 637 */ +/* 677 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135936,7 +143501,7 @@ module.exports = SetScrollFactor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorX` @@ -135954,8 +143519,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -135968,7 +143533,7 @@ module.exports = SetScrollFactorX; /***/ }), -/* 638 */ +/* 678 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -135977,7 +143542,7 @@ module.exports = SetScrollFactorX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorY` @@ -135995,8 +143560,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -136009,7 +143574,7 @@ module.exports = SetScrollFactorY; /***/ }), -/* 639 */ +/* 679 */ /***/ (function(module, exports) { /** @@ -136048,7 +143613,7 @@ module.exports = SetTint; /***/ }), -/* 640 */ +/* 680 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136057,7 +143622,7 @@ module.exports = SetTint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `visible` @@ -136072,8 +143637,8 @@ var PropertyValueSet = __webpack_require__(25); * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {boolean} value - The value to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -136086,7 +143651,7 @@ module.exports = SetVisible; /***/ }), -/* 641 */ +/* 681 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136095,7 +143660,7 @@ module.exports = SetVisible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `x` @@ -136113,8 +143678,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -136127,7 +143692,7 @@ module.exports = SetX; /***/ }), -/* 642 */ +/* 682 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136136,7 +143701,7 @@ module.exports = SetX; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` @@ -136156,8 +143721,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {number} [y=x] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -136174,7 +143739,7 @@ module.exports = SetXY; /***/ }), -/* 643 */ +/* 683 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136183,7 +143748,7 @@ module.exports = SetXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PropertyValueSet = __webpack_require__(25); +var PropertyValueSet = __webpack_require__(27); /** * Takes an array of Game Objects, or any objects that have the public property `y` @@ -136201,8 +143766,8 @@ var PropertyValueSet = __webpack_require__(25); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ @@ -136215,7 +143780,7 @@ module.exports = SetY; /***/ }), -/* 644 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136243,7 +143808,7 @@ var Vector2 = __webpack_require__(3); * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {number} x - The x coordinate to place the first item in the array at. * @param {number} y - The y coordinate to place the first item in the array at. - * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {number} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in. * * @return {Phaser.Math.Vector2} The output vector. @@ -136345,7 +143910,7 @@ module.exports = ShiftPosition; /***/ }), -/* 645 */ +/* 685 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136354,7 +143919,7 @@ module.exports = ShiftPosition; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayShuffle = __webpack_require__(121); +var ArrayShuffle = __webpack_require__(127); /** * Shuffles the array in place. The shuffled array is both modified and returned. @@ -136378,7 +143943,7 @@ module.exports = Shuffle; /***/ }), -/* 646 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136387,7 +143952,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmootherStep = __webpack_require__(170); +var MathSmootherStep = __webpack_require__(175); /** * Smootherstep is a sigmoid-like interpolation and clamping function. @@ -136436,7 +144001,7 @@ module.exports = SmootherStep; /***/ }), -/* 647 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136445,7 +144010,7 @@ module.exports = SmootherStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathSmoothStep = __webpack_require__(171); +var MathSmoothStep = __webpack_require__(176); /** * Smoothstep is a sigmoid-like interpolation and clamping function. @@ -136494,7 +144059,7 @@ module.exports = SmoothStep; /***/ }), -/* 648 */ +/* 688 */ /***/ (function(module, exports) { /** @@ -136557,7 +144122,7 @@ module.exports = Spread; /***/ }), -/* 649 */ +/* 689 */ /***/ (function(module, exports) { /** @@ -136593,7 +144158,7 @@ module.exports = ToggleVisible; /***/ }), -/* 650 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136603,7 +144168,7 @@ module.exports = ToggleVisible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(59); +var Wrap = __webpack_require__(64); /** * Wrap each item's coordinates within a rectangle's area. @@ -136642,7 +144207,7 @@ module.exports = WrapInRectangle; /***/ }), -/* 651 */ +/* 691 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -136657,17 +144222,17 @@ module.exports = WrapInRectangle; module.exports = { - Animation: __webpack_require__(172), - AnimationFrame: __webpack_require__(299), - AnimationManager: __webpack_require__(301), + Animation: __webpack_require__(177), + AnimationFrame: __webpack_require__(311), + AnimationManager: __webpack_require__(313), AnimationState: __webpack_require__(157), - Events: __webpack_require__(122) + Events: __webpack_require__(128) }; /***/ }), -/* 652 */ +/* 692 */ /***/ (function(module, exports) { /** @@ -136694,7 +144259,7 @@ module.exports = 'add'; /***/ }), -/* 653 */ +/* 693 */ /***/ (function(module, exports) { /** @@ -136740,7 +144305,7 @@ module.exports = 'animationcomplete'; /***/ }), -/* 654 */ +/* 694 */ /***/ (function(module, exports) { /** @@ -136790,7 +144355,7 @@ module.exports = 'animationcomplete-'; /***/ }), -/* 655 */ +/* 695 */ /***/ (function(module, exports) { /** @@ -136833,7 +144398,7 @@ module.exports = 'animationrepeat'; /***/ }), -/* 656 */ +/* 696 */ /***/ (function(module, exports) { /** @@ -136874,7 +144439,7 @@ module.exports = 'animationrestart'; /***/ }), -/* 657 */ +/* 697 */ /***/ (function(module, exports) { /** @@ -136916,7 +144481,7 @@ module.exports = 'animationstart'; /***/ }), -/* 658 */ +/* 698 */ /***/ (function(module, exports) { /** @@ -136958,7 +144523,7 @@ module.exports = 'animationstop'; /***/ }), -/* 659 */ +/* 699 */ /***/ (function(module, exports) { /** @@ -137004,7 +144569,7 @@ module.exports = 'animationupdate'; /***/ }), -/* 660 */ +/* 700 */ /***/ (function(module, exports) { /** @@ -137028,7 +144593,7 @@ module.exports = 'pauseall'; /***/ }), -/* 661 */ +/* 701 */ /***/ (function(module, exports) { /** @@ -137052,7 +144617,7 @@ module.exports = 'remove'; /***/ }), -/* 662 */ +/* 702 */ /***/ (function(module, exports) { /** @@ -137075,7 +144640,7 @@ module.exports = 'resumeall'; /***/ }), -/* 663 */ +/* 703 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137090,15 +144655,15 @@ module.exports = 'resumeall'; module.exports = { - BaseCache: __webpack_require__(303), - CacheManager: __webpack_require__(305), - Events: __webpack_require__(304) + BaseCache: __webpack_require__(315), + CacheManager: __webpack_require__(317), + Events: __webpack_require__(316) }; /***/ }), -/* 664 */ +/* 704 */ /***/ (function(module, exports) { /** @@ -137123,7 +144688,7 @@ module.exports = 'add'; /***/ }), -/* 665 */ +/* 705 */ /***/ (function(module, exports) { /** @@ -137148,7 +144713,7 @@ module.exports = 'remove'; /***/ }), -/* 666 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137167,14 +144732,14 @@ module.exports = 'remove'; module.exports = { - Controls: __webpack_require__(667), - Scene2D: __webpack_require__(670) + Controls: __webpack_require__(707), + Scene2D: __webpack_require__(710) }; /***/ }), -/* 667 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137189,14 +144754,14 @@ module.exports = { module.exports = { - FixedKeyControl: __webpack_require__(668), - SmoothedKeyControl: __webpack_require__(669) + FixedKeyControl: __webpack_require__(708), + SmoothedKeyControl: __webpack_require__(709) }; /***/ }), -/* 668 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137502,7 +145067,7 @@ module.exports = FixedKeyControl; /***/ }), -/* 669 */ +/* 709 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -137985,7 +145550,7 @@ module.exports = SmoothedKeyControl; /***/ }), -/* 670 */ +/* 710 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138000,17 +145565,17 @@ module.exports = SmoothedKeyControl; module.exports = { - Camera: __webpack_require__(306), - BaseCamera: __webpack_require__(93), - CameraManager: __webpack_require__(726), - Effects: __webpack_require__(314), - Events: __webpack_require__(42) + Camera: __webpack_require__(318), + BaseCamera: __webpack_require__(99), + CameraManager: __webpack_require__(767), + Effects: __webpack_require__(325), + Events: __webpack_require__(35) }; /***/ }), -/* 671 */ +/* 711 */ /***/ (function(module, exports) { /** @@ -138033,7 +145598,7 @@ module.exports = 'cameradestroy'; /***/ }), -/* 672 */ +/* 712 */ /***/ (function(module, exports) { /** @@ -138059,7 +145624,7 @@ module.exports = 'camerafadeincomplete'; /***/ }), -/* 673 */ +/* 713 */ /***/ (function(module, exports) { /** @@ -138080,16 +145645,16 @@ module.exports = 'camerafadeincomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'camerafadeinstart'; /***/ }), -/* 674 */ +/* 714 */ /***/ (function(module, exports) { /** @@ -138115,7 +145680,7 @@ module.exports = 'camerafadeoutcomplete'; /***/ }), -/* 675 */ +/* 715 */ /***/ (function(module, exports) { /** @@ -138136,16 +145701,16 @@ module.exports = 'camerafadeoutcomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'camerafadeoutstart'; /***/ }), -/* 676 */ +/* 716 */ /***/ (function(module, exports) { /** @@ -138169,7 +145734,7 @@ module.exports = 'cameraflashcomplete'; /***/ }), -/* 677 */ +/* 717 */ /***/ (function(module, exports) { /** @@ -138188,16 +145753,44 @@ module.exports = 'cameraflashcomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Flash} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'cameraflashstart'; /***/ }), -/* 678 */ +/* 718 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Follower Update Event. + * + * This event is dispatched by a Camera instance when it is following a + * Game Object and the Camera position has been updated as a result of + * that following. + * + * Listen to it from a Camera instance using: `camera.on('followupdate', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#FOLLOW_UPDATE + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that emitted the event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the camera is following. + */ +module.exports = 'followupdate'; + + +/***/ }), +/* 719 */ /***/ (function(module, exports) { /** @@ -138221,7 +145814,7 @@ module.exports = 'camerapancomplete'; /***/ }), -/* 679 */ +/* 720 */ /***/ (function(module, exports) { /** @@ -138240,7 +145833,7 @@ module.exports = 'camerapancomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Pan} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} x - The destination scroll x coordinate. * @param {number} y - The destination scroll y coordinate. */ @@ -138248,7 +145841,7 @@ module.exports = 'camerapanstart'; /***/ }), -/* 680 */ +/* 721 */ /***/ (function(module, exports) { /** @@ -138274,7 +145867,7 @@ module.exports = 'postrender'; /***/ }), -/* 681 */ +/* 722 */ /***/ (function(module, exports) { /** @@ -138300,7 +145893,7 @@ module.exports = 'prerender'; /***/ }), -/* 682 */ +/* 723 */ /***/ (function(module, exports) { /** @@ -138324,7 +145917,7 @@ module.exports = 'camerarotatecomplete'; /***/ }), -/* 683 */ +/* 724 */ /***/ (function(module, exports) { /** @@ -138343,14 +145936,14 @@ module.exports = 'camerarotatecomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.RotateTo} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} destination - The destination value. */ module.exports = 'camerarotatestart'; /***/ }), -/* 684 */ +/* 725 */ /***/ (function(module, exports) { /** @@ -138374,7 +145967,7 @@ module.exports = 'camerashakecomplete'; /***/ }), -/* 685 */ +/* 726 */ /***/ (function(module, exports) { /** @@ -138393,14 +145986,14 @@ module.exports = 'camerashakecomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Shake} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} intensity - The intensity of the effect. */ module.exports = 'camerashakestart'; /***/ }), -/* 686 */ +/* 727 */ /***/ (function(module, exports) { /** @@ -138424,7 +146017,7 @@ module.exports = 'camerazoomcomplete'; /***/ }), -/* 687 */ +/* 728 */ /***/ (function(module, exports) { /** @@ -138443,14 +146036,14 @@ module.exports = 'camerazoomcomplete'; * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Zoom} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} zoom - The destination zoom value. */ module.exports = 'camerazoomstart'; /***/ }), -/* 688 */ +/* 729 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138459,9 +146052,9 @@ module.exports = 'camerazoomstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); +var Events = __webpack_require__(35); /** * @classdesc @@ -138538,7 +146131,7 @@ var Fade = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Fade#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -138550,7 +146143,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#red - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -138561,7 +146154,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#green - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -138572,7 +146165,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#blue - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -138639,10 +146232,10 @@ var Fade = new Class({ * @since 3.5.0 * * @param {boolean} [direction=true] - The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent) - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraFadeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -138695,7 +146288,7 @@ var Fade = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Fade#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -138745,7 +146338,7 @@ var Fade = new Class({ var camera = this.camera; ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; - ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + ctx.fillRect(camera.x, camera.y, camera.width, camera.height); return true; }, @@ -138770,12 +146363,12 @@ var Fade = new Class({ var camera = this.camera; var red = this.red / 255; - var blue = this.blue / 255; var green = this.green / 255; + var blue = this.blue / 255; pipeline.drawFillRect( - camera._cx, camera._cy, camera._cw, camera._ch, - getTintFunction(red, green, blue, 1), + camera.x, camera.y, camera.width, camera.height, + getTintFunction(blue, green, red, 1), this.alpha ); @@ -138838,7 +146431,7 @@ module.exports = Fade; /***/ }), -/* 689 */ +/* 730 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -138847,9 +146440,9 @@ module.exports = Fade; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); +var Events = __webpack_require__(35); /** * @classdesc @@ -138901,7 +146494,7 @@ var Flash = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Flash#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -138909,40 +146502,40 @@ var Flash = new Class({ this.duration = 0; /** - * The value of the red color channel the camera will use for the fade effect. + * The value of the red color channel the camera will use for the flash effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#red - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ this.red = 0; /** - * The value of the green color channel the camera will use for the fade effect. + * The value of the green color channel the camera will use for the flash effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#green - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ this.green = 0; /** - * The value of the blue color channel the camera will use for the fade effect. + * The value of the blue color channel the camera will use for the flash effect. * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#blue - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ this.blue = 0; /** - * The value of the alpha channel used during the fade effect. + * The value of the alpha channel used during the flash effect. * A value between 0 and 1. * * @name Phaser.Cameras.Scene2D.Effects.Flash#alpha @@ -139001,10 +146594,10 @@ var Flash = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=250] - The duration of the effect in milliseconds. - * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=250] - The duration of the effect in milliseconds. + * @param {number} [red=255] - The amount to flash the red channel towards. A value between 0 and 255. + * @param {number} [green=255] - The amount to flash the green channel towards. A value between 0 and 255. + * @param {number} [blue=255] - The amount to flash the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraFlashCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -139052,7 +146645,7 @@ var Flash = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Flash#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -139101,7 +146694,7 @@ var Flash = new Class({ var camera = this.camera; ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; - ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + ctx.fillRect(camera.x, camera.y, camera.width, camera.height); return true; }, @@ -139126,12 +146719,12 @@ var Flash = new Class({ var camera = this.camera; var red = this.red / 255; - var blue = this.blue / 255; var green = this.green / 255; + var blue = this.blue / 255; pipeline.drawFillRect( - camera._cx, camera._cy, camera._cw, camera._ch, - getTintFunction(red, green, blue, 1), + camera.x, camera.y, camera.width, camera.height, + getTintFunction(blue, green, red, 1), this.alpha ); @@ -139189,7 +146782,7 @@ module.exports = Flash; /***/ }), -/* 690 */ +/* 731 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -139198,10 +146791,10 @@ module.exports = Flash; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(123); -var Events = __webpack_require__(42); +var EaseMap = __webpack_require__(129); +var Events = __webpack_require__(35); var Vector2 = __webpack_require__(3); /** @@ -139255,7 +146848,7 @@ var Pan = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Pan#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.11.0 @@ -139350,7 +146943,7 @@ var Pan = new Class({ * * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -139414,7 +147007,7 @@ var Pan = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Pan#update * @since 3.11.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -139514,7 +147107,7 @@ module.exports = Pan; /***/ }), -/* 691 */ +/* 732 */ /***/ (function(module, exports) { /** @@ -139545,7 +147138,7 @@ module.exports = In; /***/ }), -/* 692 */ +/* 733 */ /***/ (function(module, exports) { /** @@ -139576,7 +147169,7 @@ module.exports = Out; /***/ }), -/* 693 */ +/* 734 */ /***/ (function(module, exports) { /** @@ -139616,7 +147209,7 @@ module.exports = InOut; /***/ }), -/* 694 */ +/* 735 */ /***/ (function(module, exports) { /** @@ -139661,7 +147254,7 @@ module.exports = In; /***/ }), -/* 695 */ +/* 736 */ /***/ (function(module, exports) { /** @@ -139704,7 +147297,7 @@ module.exports = Out; /***/ }), -/* 696 */ +/* 737 */ /***/ (function(module, exports) { /** @@ -139768,7 +147361,7 @@ module.exports = InOut; /***/ }), -/* 697 */ +/* 738 */ /***/ (function(module, exports) { /** @@ -139796,7 +147389,7 @@ module.exports = In; /***/ }), -/* 698 */ +/* 739 */ /***/ (function(module, exports) { /** @@ -139824,7 +147417,7 @@ module.exports = Out; /***/ }), -/* 699 */ +/* 740 */ /***/ (function(module, exports) { /** @@ -139859,7 +147452,7 @@ module.exports = InOut; /***/ }), -/* 700 */ +/* 741 */ /***/ (function(module, exports) { /** @@ -139887,7 +147480,7 @@ module.exports = In; /***/ }), -/* 701 */ +/* 742 */ /***/ (function(module, exports) { /** @@ -139915,7 +147508,7 @@ module.exports = Out; /***/ }), -/* 702 */ +/* 743 */ /***/ (function(module, exports) { /** @@ -139950,7 +147543,7 @@ module.exports = InOut; /***/ }), -/* 703 */ +/* 744 */ /***/ (function(module, exports) { /** @@ -140005,7 +147598,7 @@ module.exports = In; /***/ }), -/* 704 */ +/* 745 */ /***/ (function(module, exports) { /** @@ -140060,7 +147653,7 @@ module.exports = Out; /***/ }), -/* 705 */ +/* 746 */ /***/ (function(module, exports) { /** @@ -140122,7 +147715,7 @@ module.exports = InOut; /***/ }), -/* 706 */ +/* 747 */ /***/ (function(module, exports) { /** @@ -140150,7 +147743,7 @@ module.exports = In; /***/ }), -/* 707 */ +/* 748 */ /***/ (function(module, exports) { /** @@ -140178,7 +147771,7 @@ module.exports = Out; /***/ }), -/* 708 */ +/* 749 */ /***/ (function(module, exports) { /** @@ -140213,7 +147806,7 @@ module.exports = InOut; /***/ }), -/* 709 */ +/* 750 */ /***/ (function(module, exports) { /** @@ -140241,7 +147834,7 @@ module.exports = Linear; /***/ }), -/* 710 */ +/* 751 */ /***/ (function(module, exports) { /** @@ -140269,7 +147862,7 @@ module.exports = In; /***/ }), -/* 711 */ +/* 752 */ /***/ (function(module, exports) { /** @@ -140297,7 +147890,7 @@ module.exports = Out; /***/ }), -/* 712 */ +/* 753 */ /***/ (function(module, exports) { /** @@ -140332,7 +147925,7 @@ module.exports = InOut; /***/ }), -/* 713 */ +/* 754 */ /***/ (function(module, exports) { /** @@ -140360,7 +147953,7 @@ module.exports = In; /***/ }), -/* 714 */ +/* 755 */ /***/ (function(module, exports) { /** @@ -140388,7 +147981,7 @@ module.exports = Out; /***/ }), -/* 715 */ +/* 756 */ /***/ (function(module, exports) { /** @@ -140423,7 +148016,7 @@ module.exports = InOut; /***/ }), -/* 716 */ +/* 757 */ /***/ (function(module, exports) { /** @@ -140451,7 +148044,7 @@ module.exports = In; /***/ }), -/* 717 */ +/* 758 */ /***/ (function(module, exports) { /** @@ -140479,7 +148072,7 @@ module.exports = Out; /***/ }), -/* 718 */ +/* 759 */ /***/ (function(module, exports) { /** @@ -140514,7 +148107,7 @@ module.exports = InOut; /***/ }), -/* 719 */ +/* 760 */ /***/ (function(module, exports) { /** @@ -140553,7 +148146,7 @@ module.exports = In; /***/ }), -/* 720 */ +/* 761 */ /***/ (function(module, exports) { /** @@ -140592,7 +148185,7 @@ module.exports = Out; /***/ }), -/* 721 */ +/* 762 */ /***/ (function(module, exports) { /** @@ -140631,7 +148224,7 @@ module.exports = InOut; /***/ }), -/* 722 */ +/* 763 */ /***/ (function(module, exports) { /** @@ -140673,7 +148266,7 @@ module.exports = Stepped; /***/ }), -/* 723 */ +/* 764 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -140682,9 +148275,9 @@ module.exports = Stepped; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); +var Events = __webpack_require__(35); var Vector2 = __webpack_require__(3); /** @@ -140737,7 +148330,7 @@ var Shake = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Shake#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -140826,7 +148419,7 @@ var Shake = new Class({ * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [duration=100] - The duration of the effect in milliseconds. * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -140893,7 +148486,7 @@ var Shake = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Shake#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -140915,8 +148508,8 @@ var Shake = new Class({ if (this._elapsed < this.duration) { var intensity = this.intensity; - var width = this.camera._cw; - var height = this.camera._ch; + var width = this.camera.width; + var height = this.camera.height; var zoom = this.camera.zoom; this._offsetX = (Math.random() * intensity.x * width * 2 - intensity.x * width) * zoom; @@ -140992,7 +148585,7 @@ module.exports = Shake; /***/ }), -/* 724 */ +/* 765 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141001,10 +148594,10 @@ module.exports = Shake; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var Events = __webpack_require__(42); -var EaseMap = __webpack_require__(123); +var Events = __webpack_require__(35); +var EaseMap = __webpack_require__(129); /** * @classdesc @@ -141063,7 +148656,7 @@ var RotateTo = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.RotateTo#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.23.0 @@ -141184,7 +148777,7 @@ var RotateTo = new Class({ * * @param {number} radians - The destination angle in radians to rotate the Camera viewport to. If the angle is positive then the rotation is clockwise else anticlockwise * @param {boolean} [shortestPath=false] - If shortest path is set to true the camera will rotate in the quickest direction clockwise or anti-clockwise. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the Rotate. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the rotation effect to start immediately, even if already running. * @param {CameraRotateCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -141299,7 +148892,7 @@ var RotateTo = new Class({ * @method Phaser.Cameras.Scene2D.Effects.RotateTo#update * @since 3.23.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -141425,7 +149018,7 @@ module.exports = RotateTo; /***/ }), -/* 725 */ +/* 766 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141434,10 +149027,10 @@ module.exports = RotateTo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); -var EaseMap = __webpack_require__(123); -var Events = __webpack_require__(42); +var EaseMap = __webpack_require__(129); +var Events = __webpack_require__(35); /** * @classdesc @@ -141486,7 +149079,7 @@ var Zoom = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Zoom#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.11.0 @@ -141570,7 +149163,7 @@ var Zoom = new Class({ * @since 3.11.0 * * @param {number} zoom - The target Camera zoom value. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the Zoom. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the zoom effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraZoomCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -141631,7 +149224,7 @@ var Zoom = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Zoom#update * @since 3.11.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -141718,7 +149311,7 @@ module.exports = Zoom; /***/ }), -/* 726 */ +/* 767 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -141727,24 +149320,24 @@ module.exports = Zoom; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Camera = __webpack_require__(306); +var Camera = __webpack_require__(318); var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); -var RectangleContains = __webpack_require__(50); -var ScaleEvents = __webpack_require__(94); +var PluginCache = __webpack_require__(25); +var RectangleContains = __webpack_require__(56); +var ScaleEvents = __webpack_require__(101); var SceneEvents = __webpack_require__(20); /** * @classdesc * The Camera Manager is a plugin that belongs to a Scene and is responsible for managing all of the Scene Cameras. - * + * * By default you can access the Camera Manager from within a Scene using `this.cameras`, although this can be changed * in your game config. - * + * * Create new Cameras using the `add` method. Or extend the Camera class with your own addition code and then add * the new Camera in using the `addExisting` method. - * + * * Cameras provide a view into your game world, and can be positioned, rotated, zoomed and scrolled accordingly. * * A Camera consists of two elements: The viewport and the scroll values. @@ -141759,7 +149352,7 @@ var SceneEvents = __webpack_require__(20); * viewport, and changing the viewport has no impact on the scrolling. * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, - * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique + * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore * Game Objects, make sure it's one of the first 31 created. @@ -141825,11 +149418,11 @@ var CameraManager = new Class({ * A handy reference to the 'main' camera. By default this is the first Camera the * Camera Manager creates. You can also set it directly, or use the `makeMain` argument * in the `add` and `addExisting` methods. It allows you to access it from your game: - * + * * ```javascript * var cam = this.cameras.main; * ``` - * + * * Also see the properties `camera1`, `camera2` and so on. * * @name Phaser.Cameras.Scene2D.CameraManager#main @@ -141915,7 +149508,7 @@ var CameraManager = new Class({ // Make one this.add(); } - + this.main = this.cameras[0]; } @@ -141927,28 +149520,28 @@ var CameraManager = new Class({ /** * Adds a new Camera into the Camera Manager. The Camera Manager can support up to 31 different Cameras. - * + * * Each Camera has its own viewport, which controls the size of the Camera and its position within the canvas. - * + * * Use the `Camera.scrollX` and `Camera.scrollY` properties to change where the Camera is looking, or the * Camera methods such as `centerOn`. Cameras also have built in special effects, such as fade, flash, shake, * pan and zoom. - * + * * By default Cameras are transparent and will render anything that they can see based on their `scrollX` * and `scrollY` values. Game Objects can be set to be ignored by a Camera by using the `Camera.ignore` method. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after creation if required. - * + * * See the Camera class documentation for more details. * * @method Phaser.Cameras.Scene2D.CameraManager#add * @since 3.0.0 * - * @param {integer} [x=0] - The horizontal position of the Camera viewport. - * @param {integer} [y=0] - The vertical position of the Camera viewport. - * @param {integer} [width] - The width of the Camera viewport. If not given it'll be the game config size. - * @param {integer} [height] - The height of the Camera viewport. If not given it'll be the game config size. + * @param {number} [x=0] - The horizontal position of the Camera viewport. + * @param {number} [y=0] - The vertical position of the Camera viewport. + * @param {number} [width] - The width of the Camera viewport. If not given it'll be the game config size. + * @param {number} [height] - The height of the Camera viewport. If not given it'll be the game config size. * @param {boolean} [makeMain=false] - Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. * @param {string} [name=''] - The name of the Camera. * @@ -141983,15 +149576,15 @@ var CameraManager = new Class({ /** * Adds an existing Camera into the Camera Manager. - * + * * The Camera should either be a `Phaser.Cameras.Scene2D.Camera` instance, or a class that extends from it. - * + * * The Camera will have its `roundPixels` property set to whatever `CameraManager.roundPixels` is. You can change * it after addition if required. - * + * * The Camera will be assigned an ID, which is used for Game Object exclusion and then added to the * manager. As long as it doesn't already exist in the manager it will be added then returned. - * + * * If this method returns `null` then the Camera already exists in this Camera Manager. * * @method Phaser.Cameras.Scene2D.CameraManager#addExisting @@ -142020,7 +149613,7 @@ var CameraManager = new Class({ { this.main = camera; } - + return camera; } @@ -142029,7 +149622,7 @@ var CameraManager = new Class({ /** * Gets the next available Camera ID number. - * + * * The Camera Manager supports up to 31 unique cameras, after which the ID returned will always be zero. * You can create additional cameras beyond 31, but they cannot be used for Game Object exclusion. * @@ -142077,15 +149670,15 @@ var CameraManager = new Class({ /** * Gets the total number of Cameras in this Camera Manager. - * + * * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. * * @method Phaser.Cameras.Scene2D.CameraManager#getTotal * @since 3.11.0 - * + * * @param {boolean} [isVisible=false] - Set the `true` to only include visible Cameras in the total. * - * @return {integer} The total number of Cameras in this Camera Manager. + * @return {number} The total number of Cameras in this Camera Manager. */ getTotal: function (isVisible) { @@ -142110,7 +149703,7 @@ var CameraManager = new Class({ /** * Populates this Camera Manager based on the given configuration object, or an array of config objects. - * + * * See the `Phaser.Types.Cameras.Scene2D.CameraConfig` documentation for details of the object structure. * * @method Phaser.Cameras.Scene2D.CameraManager#fromJSON @@ -142179,7 +149772,7 @@ var CameraManager = new Class({ /** * Gets a Camera based on its name. - * + * * Camera names are optional and don't have to be set, so this method is only of any use if you * have given your Cameras unique names. * @@ -142207,7 +149800,7 @@ var CameraManager = new Class({ /** * Returns an array of all cameras below the given Pointer. - * + * * The first camera in the array is the top-most camera in the camera list. * * @method Phaser.Cameras.Scene2D.CameraManager#getCamerasBelowPointer @@ -142242,10 +149835,10 @@ var CameraManager = new Class({ /** * Removes the given Camera, or an array of Cameras, from this Camera Manager. - * + * * If found in the Camera Manager it will be immediately removed from the local cameras array. * If also currently the 'main' camera, 'main' will be reset to be camera 0. - * + * * The removed Cameras are automatically destroyed if the `runDestroy` argument is `true`, which is the default. * If you wish to re-use the cameras then set this to `false`, but know that they will retain their references * and internal data until destroyed or re-added to a Camera Manager. @@ -142255,8 +149848,8 @@ var CameraManager = new Class({ * * @param {(Phaser.Cameras.Scene2D.Camera|Phaser.Cameras.Scene2D.Camera[])} camera - The Camera, or an array of Cameras, to be removed from this Camera Manager. * @param {boolean} [runDestroy=true] - Automatically call `Camera.destroy` on each Camera removed from this Camera Manager. - * - * @return {integer} The total number of Cameras removed. + * + * @return {number} The total number of Cameras removed. */ remove: function (camera, runDestroy) { @@ -142297,7 +149890,7 @@ var CameraManager = new Class({ /** * The internal render method. This is called automatically by the Scene and should not be invoked directly. - * + * * It will iterate through all local cameras and render them in turn, as long as they're visible and have * an alpha level > 0. * @@ -142306,10 +149899,9 @@ var CameraManager = new Class({ * @since 3.0.0 * * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Renderer that will render the children to this camera. - * @param {Phaser.GameObjects.GameObject[]} children - An array of renderable Game Objects. - * @param {number} interpolation - Interpolation value. Reserved for future use. + * @param {Phaser.GameObjects.DisplayList} children - The Display List for the Scene. */ - render: function (renderer, children, interpolation) + render: function (renderer, children) { var scene = this.scene; var cameras = this.cameras; @@ -142320,17 +149912,48 @@ var CameraManager = new Class({ if (camera.visible && camera.alpha > 0) { - // Hard-coded to 1 for now - camera.preRender(1); + camera.preRender(); - renderer.render(scene, children, interpolation, camera); + var visibleChildren = this.getVisibleChildren(children.getChildren(), camera); + + renderer.render(scene, visibleChildren, camera); } } }, + /** + * Takes an array of Game Objects and a Camera and returns a new array + * containing only those Game Objects that pass the `willRender` test + * against the given Camera. + * + * @method Phaser.Cameras.Scene2D.CameraManager#getVisibleChildren + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to be checked against the camera. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filte the Game Objects against. + * + * @return {Phaser.GameObjects.GameObject[]} A filtered list of only Game Objects within the Scene that will render against the given Camera. + */ + getVisibleChildren: function (children, camera) + { + var visible = []; + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (child.willRender(camera)) + { + visible.push(child); + } + } + + return visible; + }, + /** * Resets this Camera Manager. - * + * * This will iterate through all current Cameras, destroying them all, then it will reset the * cameras array, reset the ID counter and create 1 new single camera using the default values. * @@ -142360,7 +149983,7 @@ var CameraManager = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -142378,9 +150001,9 @@ var CameraManager = new Class({ * @since 3.18.0 * * @param {Phaser.Structs.Size} gameSize - The default Game Size object. This is the un-modified game dimensions. - * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param {Phaser.Structs.Size} baseSize - The base Size object. The game dimensions. The canvas width / height values match this. */ - onResize: function (gameSize, baseSize, displaySize, resolution, previousWidth, previousHeight) + onResize: function (gameSize, baseSize, displaySize, previousWidth, previousHeight) { for (var i = 0; i < this.cameras.length; i++) { @@ -142466,7 +150089,7 @@ module.exports = CameraManager; /***/ }), -/* 727 */ +/* 768 */ /***/ (function(module, exports) { /** @@ -142485,7 +150108,7 @@ module.exports = 'enterfullscreen'; /***/ }), -/* 728 */ +/* 769 */ /***/ (function(module, exports) { /** @@ -142504,7 +150127,7 @@ module.exports = 'fullscreenfailed'; /***/ }), -/* 729 */ +/* 770 */ /***/ (function(module, exports) { /** @@ -142523,7 +150146,7 @@ module.exports = 'fullscreenunsupported'; /***/ }), -/* 730 */ +/* 771 */ /***/ (function(module, exports) { /** @@ -142543,7 +150166,7 @@ module.exports = 'leavefullscreen'; /***/ }), -/* 731 */ +/* 772 */ /***/ (function(module, exports) { /** @@ -142555,16 +150178,18 @@ module.exports = 'leavefullscreen'; /** * The Scale Manager Orientation Change Event. * + * This event is dispatched whenever the Scale Manager detects an orientation change event from the browser. + * * @event Phaser.Scale.Events#ORIENTATION_CHANGE * @since 3.16.1 - * - * @param {string} orientation - + * + * @param {string} orientation - The new orientation value. Either `Phaser.Scale.Orientation.LANDSCAPE` or `Phaser.Scale.Orientation.PORTRAIT`. */ module.exports = 'orientationchange'; /***/ }), -/* 732 */ +/* 773 */ /***/ (function(module, exports) { /** @@ -142575,7 +150200,7 @@ module.exports = 'orientationchange'; /** * The Scale Manager Resize Event. - * + * * This event is dispatched whenever the Scale Manager detects a resize event from the browser. * It sends three parameters to the callback, each of them being Size components. You can read * the `width`, `height`, `aspectRatio` and other properties of these components to help with @@ -142583,11 +150208,10 @@ module.exports = 'orientationchange'; * * @event Phaser.Scale.Events#RESIZE * @since 3.16.1 - * + * * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} resolution - The current resolution. Defaults to 1 at the moment. * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. */ @@ -142595,7 +150219,7 @@ module.exports = 'resize'; /***/ }), -/* 733 */ +/* 774 */ /***/ (function(module, exports) { /** @@ -142621,7 +150245,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 734 */ +/* 775 */ /***/ (function(module, exports) { /** @@ -142646,7 +150270,7 @@ module.exports = 'boot'; /***/ }), -/* 735 */ +/* 776 */ /***/ (function(module, exports) { /** @@ -142675,7 +150299,7 @@ module.exports = 'create'; /***/ }), -/* 736 */ +/* 777 */ /***/ (function(module, exports) { /** @@ -142702,7 +150326,7 @@ module.exports = 'destroy'; /***/ }), -/* 737 */ +/* 778 */ /***/ (function(module, exports) { /** @@ -142729,7 +150353,7 @@ module.exports = 'pause'; /***/ }), -/* 738 */ +/* 779 */ /***/ (function(module, exports) { /** @@ -142766,7 +150390,7 @@ module.exports = 'postupdate'; /***/ }), -/* 739 */ +/* 780 */ /***/ (function(module, exports) { /** @@ -142803,7 +150427,7 @@ module.exports = 'preupdate'; /***/ }), -/* 740 */ +/* 781 */ /***/ (function(module, exports) { /** @@ -142831,7 +150455,7 @@ module.exports = 'ready'; /***/ }), -/* 741 */ +/* 782 */ /***/ (function(module, exports) { /** @@ -142857,7 +150481,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 742 */ +/* 783 */ /***/ (function(module, exports) { /** @@ -142893,7 +150517,7 @@ module.exports = 'render'; /***/ }), -/* 743 */ +/* 784 */ /***/ (function(module, exports) { /** @@ -142920,7 +150544,7 @@ module.exports = 'resume'; /***/ }), -/* 744 */ +/* 785 */ /***/ (function(module, exports) { /** @@ -142950,7 +150574,7 @@ module.exports = 'shutdown'; /***/ }), -/* 745 */ +/* 786 */ /***/ (function(module, exports) { /** @@ -142977,7 +150601,7 @@ module.exports = 'sleep'; /***/ }), -/* 746 */ +/* 787 */ /***/ (function(module, exports) { /** @@ -143002,7 +150626,7 @@ module.exports = 'start'; /***/ }), -/* 747 */ +/* 788 */ /***/ (function(module, exports) { /** @@ -143038,7 +150662,7 @@ module.exports = 'transitioncomplete'; /***/ }), -/* 748 */ +/* 789 */ /***/ (function(module, exports) { /** @@ -143075,7 +150699,7 @@ module.exports = 'transitioninit'; /***/ }), -/* 749 */ +/* 790 */ /***/ (function(module, exports) { /** @@ -143109,7 +150733,7 @@ module.exports = 'transitionout'; /***/ }), -/* 750 */ +/* 791 */ /***/ (function(module, exports) { /** @@ -143149,7 +150773,7 @@ module.exports = 'transitionstart'; /***/ }), -/* 751 */ +/* 792 */ /***/ (function(module, exports) { /** @@ -143184,7 +150808,7 @@ module.exports = 'transitionwake'; /***/ }), -/* 752 */ +/* 793 */ /***/ (function(module, exports) { /** @@ -143221,7 +150845,7 @@ module.exports = 'update'; /***/ }), -/* 753 */ +/* 794 */ /***/ (function(module, exports) { /** @@ -143248,7 +150872,7 @@ module.exports = 'wake'; /***/ }), -/* 754 */ +/* 795 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143263,18 +150887,18 @@ module.exports = 'wake'; module.exports = { - Config: __webpack_require__(327), - CreateRenderer: __webpack_require__(349), - DebugHeader: __webpack_require__(351), - Events: __webpack_require__(21), - TimeStep: __webpack_require__(352), - VisibilityHandler: __webpack_require__(354) + Config: __webpack_require__(338), + CreateRenderer: __webpack_require__(358), + DebugHeader: __webpack_require__(360), + Events: __webpack_require__(23), + TimeStep: __webpack_require__(361), + VisibilityHandler: __webpack_require__(363) }; /***/ }), -/* 755 */ +/* 796 */ /***/ (function(module, exports) { // shim for using process in browser @@ -143464,7 +151088,7 @@ process.umask = function() { return 0; }; /***/ }), -/* 756 */ +/* 797 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143473,7 +151097,7 @@ process.umask = function() { return 0; }; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(126); +var Browser = __webpack_require__(131); /** * Determines the input support of the browser running this Phaser Game instance. @@ -143539,7 +151163,7 @@ module.exports = init(); /***/ }), -/* 757 */ +/* 798 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143548,17 +151172,17 @@ module.exports = init(); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Browser = __webpack_require__(126); +var Browser = __webpack_require__(131); /** * Determines the audio playback capabilities of the device running this Phaser Game instance. * These values are read-only and populated during the boot sequence of the game. * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.audio` from within any Scene. - * + * * @typedef {object} Phaser.Device.Audio * @since 3.0.0 - * + * * @property {boolean} audioData - Can this device play HTML Audio tags? * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? * @property {boolean} m4a - Can this device can play m4a files. @@ -143614,8 +151238,7 @@ function init () // Mimetypes accepted: // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - // bit.ly/iphoneoscodecs - if (audioElement.canPlayType('audio/wav; codecs="1"').replace(/^no$/, '')) + if (audioElement.canPlayType('audio/wav').replace(/^no$/, '')) { Audio.wav = true; } @@ -143664,7 +151287,7 @@ module.exports = init(); /***/ }), -/* 758 */ +/* 799 */ /***/ (function(module, exports) { /** @@ -143751,7 +151374,7 @@ module.exports = init(); /***/ }), -/* 759 */ +/* 800 */ /***/ (function(module, exports) { /** @@ -143855,7 +151478,7 @@ module.exports = init(); /***/ }), -/* 760 */ +/* 801 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143870,25 +151493,25 @@ module.exports = init(); module.exports = { - Between: __webpack_require__(330), - BetweenPoints: __webpack_require__(331), - BetweenPointsY: __webpack_require__(761), - BetweenY: __webpack_require__(762), - CounterClockwise: __webpack_require__(763), - Normalize: __webpack_require__(332), - Random: __webpack_require__(764), - RandomDegrees: __webpack_require__(765), - Reverse: __webpack_require__(766), - RotateTo: __webpack_require__(767), - ShortestBetween: __webpack_require__(768), - Wrap: __webpack_require__(248), - WrapDegrees: __webpack_require__(249) + Between: __webpack_require__(341), + BetweenPoints: __webpack_require__(342), + BetweenPointsY: __webpack_require__(802), + BetweenY: __webpack_require__(803), + CounterClockwise: __webpack_require__(804), + Normalize: __webpack_require__(343), + Random: __webpack_require__(805), + RandomDegrees: __webpack_require__(806), + Reverse: __webpack_require__(807), + RotateTo: __webpack_require__(808), + ShortestBetween: __webpack_require__(809), + Wrap: __webpack_require__(261), + WrapDegrees: __webpack_require__(262) }; /***/ }), -/* 761 */ +/* 802 */ /***/ (function(module, exports) { /** @@ -143920,7 +151543,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 762 */ +/* 803 */ /***/ (function(module, exports) { /** @@ -143954,7 +151577,7 @@ module.exports = BetweenY; /***/ }), -/* 763 */ +/* 804 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -143999,7 +151622,7 @@ module.exports = CounterClockwise; /***/ }), -/* 764 */ +/* 805 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144009,7 +151632,7 @@ module.exports = CounterClockwise; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(127); +var FloatBetween = __webpack_require__(132); /** * Returns a random angle in the range [-pi, pi]. @@ -144028,7 +151651,7 @@ module.exports = Random; /***/ }), -/* 765 */ +/* 806 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144038,7 +151661,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(127); +var FloatBetween = __webpack_require__(132); /** * Returns a random angle in the range [-180, 180]. @@ -144057,7 +151680,7 @@ module.exports = RandomDegrees; /***/ }), -/* 766 */ +/* 807 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144066,7 +151689,7 @@ module.exports = RandomDegrees; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(332); +var Normalize = __webpack_require__(343); /** * Reverse the given angle. @@ -144087,7 +151710,7 @@ module.exports = Reverse; /***/ }), -/* 767 */ +/* 808 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144154,7 +151777,7 @@ module.exports = RotateTo; /***/ }), -/* 768 */ +/* 809 */ /***/ (function(module, exports) { /** @@ -144203,7 +151826,7 @@ module.exports = ShortestBetween; /***/ }), -/* 769 */ +/* 810 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144218,19 +151841,19 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(55), - BetweenPoints: __webpack_require__(333), - BetweenPointsSquared: __webpack_require__(770), - Chebyshev: __webpack_require__(771), - Power: __webpack_require__(772), - Snake: __webpack_require__(773), - Squared: __webpack_require__(334) + Between: __webpack_require__(61), + BetweenPoints: __webpack_require__(344), + BetweenPointsSquared: __webpack_require__(811), + Chebyshev: __webpack_require__(812), + Power: __webpack_require__(813), + Snake: __webpack_require__(814), + Squared: __webpack_require__(345) }; /***/ }), -/* 770 */ +/* 811 */ /***/ (function(module, exports) { /** @@ -144262,7 +151885,7 @@ module.exports = DistanceBetweenPointsSquared; /***/ }), -/* 771 */ +/* 812 */ /***/ (function(module, exports) { /** @@ -144296,7 +151919,7 @@ module.exports = ChebyshevDistance; /***/ }), -/* 772 */ +/* 813 */ /***/ (function(module, exports) { /** @@ -144330,7 +151953,7 @@ module.exports = DistancePower; /***/ }), -/* 773 */ +/* 814 */ /***/ (function(module, exports) { /** @@ -144364,7 +151987,7 @@ module.exports = SnakeDistance; /***/ }), -/* 774 */ +/* 815 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144379,24 +152002,24 @@ module.exports = SnakeDistance; module.exports = { - Back: __webpack_require__(315), - Bounce: __webpack_require__(316), - Circular: __webpack_require__(317), - Cubic: __webpack_require__(318), - Elastic: __webpack_require__(319), - Expo: __webpack_require__(320), - Linear: __webpack_require__(321), - Quadratic: __webpack_require__(322), - Quartic: __webpack_require__(323), - Quintic: __webpack_require__(324), - Sine: __webpack_require__(325), - Stepped: __webpack_require__(326) + Back: __webpack_require__(326), + Bounce: __webpack_require__(327), + Circular: __webpack_require__(328), + Cubic: __webpack_require__(329), + Elastic: __webpack_require__(330), + Expo: __webpack_require__(331), + Linear: __webpack_require__(332), + Quadratic: __webpack_require__(333), + Quartic: __webpack_require__(334), + Quintic: __webpack_require__(335), + Sine: __webpack_require__(336), + Stepped: __webpack_require__(337) }; /***/ }), -/* 775 */ +/* 816 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144411,17 +152034,17 @@ module.exports = { module.exports = { - Ceil: __webpack_require__(776), - Equal: __webpack_require__(109), - Floor: __webpack_require__(777), - GreaterThan: __webpack_require__(335), - LessThan: __webpack_require__(336) + Ceil: __webpack_require__(817), + Equal: __webpack_require__(121), + Floor: __webpack_require__(818), + GreaterThan: __webpack_require__(346), + LessThan: __webpack_require__(347) }; /***/ }), -/* 776 */ +/* 817 */ /***/ (function(module, exports) { /** @@ -144452,7 +152075,7 @@ module.exports = Ceil; /***/ }), -/* 777 */ +/* 818 */ /***/ (function(module, exports) { /** @@ -144483,7 +152106,7 @@ module.exports = Floor; /***/ }), -/* 778 */ +/* 819 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144498,19 +152121,19 @@ module.exports = Floor; module.exports = { - Bezier: __webpack_require__(779), - CatmullRom: __webpack_require__(780), - CubicBezier: __webpack_require__(339), - Linear: __webpack_require__(781), - QuadraticBezier: __webpack_require__(340), - SmoothStep: __webpack_require__(341), - SmootherStep: __webpack_require__(782) + Bezier: __webpack_require__(820), + CatmullRom: __webpack_require__(821), + CubicBezier: __webpack_require__(350), + Linear: __webpack_require__(822), + QuadraticBezier: __webpack_require__(351), + SmoothStep: __webpack_require__(352), + SmootherStep: __webpack_require__(823) }; /***/ }), -/* 779 */ +/* 820 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144519,7 +152142,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(337); +var Bernstein = __webpack_require__(348); /** * A bezier interpolation method. @@ -144549,7 +152172,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 780 */ +/* 821 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144558,7 +152181,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(181); +var CatmullRom = __webpack_require__(186); /** * A Catmull-Rom interpolation method. @@ -144606,7 +152229,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 781 */ +/* 822 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144615,7 +152238,7 @@ module.exports = CatmullRomInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(124); +var Linear = __webpack_require__(130); /** * A linear interpolation method. @@ -144653,7 +152276,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 782 */ +/* 823 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144662,7 +152285,7 @@ module.exports = LinearInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(170); +var SmootherStep = __webpack_require__(175); /** * A Smoother Step interpolation method. @@ -144686,7 +152309,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 783 */ +/* 824 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144701,15 +152324,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(342), - IsSize: __webpack_require__(128), - IsValue: __webpack_require__(784) + GetNext: __webpack_require__(353), + IsSize: __webpack_require__(133), + IsValue: __webpack_require__(825) }; /***/ }), -/* 784 */ +/* 825 */ /***/ (function(module, exports) { /** @@ -144737,7 +152360,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 785 */ +/* 826 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -144752,15 +152375,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(343), - Floor: __webpack_require__(95), - To: __webpack_require__(786) + Ceil: __webpack_require__(134), + Floor: __webpack_require__(72), + To: __webpack_require__(827) }; /***/ }), -/* 786 */ +/* 827 */ /***/ (function(module, exports) { /** @@ -144803,7 +152426,7 @@ module.exports = SnapTo; /***/ }), -/* 787 */ +/* 828 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145313,7 +152936,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 788 */ +/* 829 */ /***/ (function(module, exports) { /** @@ -145348,7 +152971,7 @@ module.exports = Average; /***/ }), -/* 789 */ +/* 830 */ /***/ (function(module, exports) { /** @@ -145367,7 +152990,7 @@ module.exports = Average; * * @param {number} value - The value to round. * @param {number} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -145385,7 +153008,7 @@ module.exports = CeilTo; /***/ }), -/* 790 */ +/* 831 */ /***/ (function(module, exports) { /** @@ -145414,7 +153037,290 @@ module.exports = Difference; /***/ }), -/* 791 */ +/* 832 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(16); +var Class = __webpack_require__(0); +var Matrix4 = __webpack_require__(73); +var NOOP = __webpack_require__(1); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + +/***/ }), +/* 833 */ /***/ (function(module, exports) { /** @@ -145432,8 +153338,8 @@ module.exports = Difference; * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -145451,7 +153357,7 @@ module.exports = FloorTo; /***/ }), -/* 792 */ +/* 834 */ /***/ (function(module, exports) { /** @@ -145467,7 +153373,7 @@ module.exports = FloorTo; * @since 3.0.0 * * @param {number} distance - The distance. - * @param {integer} time - The time, in seconds. + * @param {number} time - The time, in seconds. * * @return {number} The speed, in distance per ms. * @@ -145484,7 +153390,7 @@ module.exports = GetSpeed; /***/ }), -/* 793 */ +/* 835 */ /***/ (function(module, exports) { /** @@ -145515,7 +153421,7 @@ module.exports = IsEven; /***/ }), -/* 794 */ +/* 836 */ /***/ (function(module, exports) { /** @@ -145544,7 +153450,7 @@ module.exports = IsEvenStrict; /***/ }), -/* 795 */ +/* 837 */ /***/ (function(module, exports) { /** @@ -145574,7 +153480,7 @@ module.exports = MaxAdd; /***/ }), -/* 796 */ +/* 838 */ /***/ (function(module, exports) { /** @@ -145604,7 +153510,7 @@ module.exports = MinSub; /***/ }), -/* 797 */ +/* 839 */ /***/ (function(module, exports) { /** @@ -145663,7 +153569,7 @@ module.exports = Percent; /***/ }), -/* 798 */ +/* 840 */ /***/ (function(module, exports) { /** @@ -145703,7 +153609,7 @@ module.exports = RandomXY; /***/ }), -/* 799 */ +/* 841 */ /***/ (function(module, exports) { /** @@ -145742,7 +153648,7 @@ module.exports = RandomXYZ; /***/ }), -/* 800 */ +/* 842 */ /***/ (function(module, exports) { /** @@ -145779,7 +153685,7 @@ module.exports = RandomXYZW; /***/ }), -/* 801 */ +/* 843 */ /***/ (function(module, exports) { /** @@ -145816,7 +153722,7 @@ module.exports = RotateTo; /***/ }), -/* 802 */ +/* 844 */ /***/ (function(module, exports) { /** @@ -145849,8 +153755,8 @@ module.exports = RotateTo; * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -145868,7 +153774,7 @@ module.exports = RoundTo; /***/ }), -/* 803 */ +/* 845 */ /***/ (function(module, exports) { /** @@ -145921,7 +153827,7 @@ module.exports = SinCosTableGenerator; /***/ }), -/* 804 */ +/* 846 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -145942,9 +153848,9 @@ var Vector2 = __webpack_require__(3); * @function Phaser.Math.ToXY * @since 3.19.0 * - * @param {integer} index - The position within the grid to get the x/y value for. - * @param {integer} width - The width of the grid. - * @param {integer} height - The height of the grid. + * @param {number} index - The position within the grid to get the x/y value for. + * @param {number} width - The width of the grid. + * @param {number} height - The height of the grid. * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. * * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. @@ -145979,7 +153885,7 @@ module.exports = ToXY; /***/ }), -/* 805 */ +/* 847 */ /***/ (function(module, exports) { /** @@ -146009,7 +153915,7 @@ module.exports = Within; /***/ }), -/* 806 */ +/* 848 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146018,9 +153924,9 @@ module.exports = Within; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(81); -var Matrix4 = __webpack_require__(347); -var Quaternion = __webpack_require__(348); +var Vector3 = __webpack_require__(37); +var Matrix4 = __webpack_require__(73); +var Quaternion = __webpack_require__(357); var tmpMat4 = new Matrix4(); var tmpQuat = new Quaternion(); @@ -146057,7 +153963,103 @@ module.exports = RotateVec3; /***/ }), -/* 807 */ +/* 849 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Post-Render Event. + * + * This event is dispatched by the WebGL Renderer when all rendering, for all cameras in all Scenes, + * has completed. + * + * @event Phaser.Renderer.WebGL.Events#POST_RENDER + * @since 3.50.0 + */ +module.exports = 'postrender'; + + +/***/ }), +/* 850 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pre-Render Event. + * + * This event is dispatched by the WebGL Renderer. This happens right at the start of the render + * process, after the context has been cleared, the scissors enabled and everything has been + * reset ready for the render. + * + * @event Phaser.Renderer.WebGL.Events#PRE_RENDER + * @since 3.50.0 + */ +module.exports = 'prerender'; + + +/***/ }), +/* 851 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Render Event. + * + * This event is dispatched by the WebGL Renderer for every camera in every Scene. + * + * It is dispatched before any of the children in the Scene have been rendered. + * + * @event Phaser.Renderer.WebGL.Events#RENDER + * @since 3.50.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered. + */ +module.exports = 'render'; + + +/***/ }), +/* 852 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Renderer Resize Event. + * + * This event is dispatched by the WebGL Renderer when it is resized, usually as a result + * of the Scale Manager resizing. + * + * @event Phaser.Renderer.WebGL.Events#RESIZE + * @since 3.50.0 + * + * @param {number} width - The new width of the renderer. + * @param {number} height - The new height of the renderer. + */ +module.exports = 'resize'; + + +/***/ }), +/* 853 */ /***/ (function(module, exports) { module.exports = [ @@ -146070,7 +154072,7 @@ module.exports = [ 'uniform sampler2D uMaskSampler;', 'uniform bool uInvertMaskAlpha;', '', - 'void main()', + 'void main ()', '{', ' vec2 uv = gl_FragCoord.xy / uResolution;', ' vec4 mainColor = texture2D(uMainSampler, uv);', @@ -146093,7 +154095,7 @@ module.exports = [ /***/ }), -/* 808 */ +/* 854 */ /***/ (function(module, exports) { module.exports = [ @@ -146103,7 +154105,7 @@ module.exports = [ '', 'attribute vec2 inPosition;', '', - 'void main()', + 'void main ()', '{', ' gl_Position = vec4(inPosition, 0.0, 1.0);', '}', @@ -146112,7 +154114,52 @@ module.exports = [ /***/ }), -/* 809 */ +/* 855 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_GRAPHICS_FS', + '', + 'precision mediump float;', + '', + 'varying vec4 outColor;', + '', + 'void main ()', + '{', + ' gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 856 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_GRAPHICS_VS', + '', + 'precision mediump float;', + '', + 'uniform mat4 uProjectionMatrix;', + '', + 'attribute vec2 inPosition;', + 'attribute vec4 inColor;', + '', + 'varying vec4 outColor;', + '', + 'void main ()', + '{', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', + '', + ' outColor = inColor;', + '}', + '' +].join('\n'); + + +/***/ }), +/* 857 */ /***/ (function(module, exports) { module.exports = [ @@ -146144,7 +154191,7 @@ module.exports = [ 'void main()', '{', ' vec3 finalColor = vec3(0.0, 0.0, 0.0);', - ' vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);', + ' vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);', ' vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;', ' vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));', ' vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;', @@ -146171,7 +154218,73 @@ module.exports = [ /***/ }), -/* 810 */ +/* 858 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_POINTLIGHT_FS', + '', + 'precision mediump float;', + '', + 'uniform vec2 uResolution;', + '', + 'varying vec4 lightPosition;', + 'varying vec4 lightColor;', + 'varying float lightRadius;', + '', + 'void main ()', + '{', + ' vec2 center = vec2((lightPosition.x + 1.0) * uResolution.x, (lightPosition.y + 1.0) * uResolution.y);', + '', + ' float distance = length(center - gl_FragCoord.xy);', + '', + ' float attenuation = 1.0 / (0.01 * distance * distance);', + ' float radius = 1.0 - min(distance, lightRadius) / lightRadius;', + ' float intensity = smoothstep(0.0, 1.0, min(attenuation, radius));', + '', + ' vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;', + '', + ' gl_FragColor = vec4(color.rgb * lightColor.a, color.a);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 859 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_POINTLIGHT_VS', + '', + 'precision mediump float;', + '', + 'uniform mat4 uProjectionMatrix;', + '', + 'attribute vec2 inPosition;', + 'attribute vec2 inLightPosition;', + 'attribute vec4 inLightColor;', + 'attribute float inLightRadius;', + 'attribute float inLightIntensity;', + '', + 'varying vec4 lightPosition;', + 'varying vec4 lightColor;', + 'varying float lightRadius;', + '', + 'void main ()', + '{', + ' lightColor = inLightColor;', + ' lightRadius = inLightRadius;', + ' lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);', + '', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 860 */ /***/ (function(module, exports) { module.exports = [ @@ -146186,25 +154299,21 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'void main()', + 'void main ()', '{', ' vec4 texture;', '', ' %forloop%', '', - ' vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);', - ' vec4 color = texture;', + ' vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);', '', - ' if (outTintEffect == 0.0)', - ' {', - ' // Multiply texture tint', - ' color = texture * texel;', - ' }', - ' else if (outTintEffect == 1.0)', + ' // Multiply texture tint', + ' vec4 color = texture * texel;', + '', + ' if (outTintEffect == 1.0)', ' {', ' // Solid color + texture alpha', - ' color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);', - ' color.a = texture.a * texel.a;', + ' color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);', ' }', ' else if (outTintEffect == 2.0)', ' {', @@ -146219,7 +154328,7 @@ module.exports = [ /***/ }), -/* 811 */ +/* 861 */ /***/ (function(module, exports) { module.exports = [ @@ -146228,8 +154337,6 @@ module.exports = [ 'precision mediump float;', '', 'uniform mat4 uProjectionMatrix;', - 'uniform mat4 uViewMatrix;', - 'uniform mat4 uModelMatrix;', '', 'attribute vec2 inPosition;', 'attribute vec2 inTexCoord;', @@ -146244,20 +154351,19 @@ module.exports = [ '', 'void main ()', '{', - ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', '', ' outTexCoord = inTexCoord;', ' outTexId = inTexId;', ' outTint = inTint;', ' outTintEffect = inTintEffect;', '}', - '', '' ].join('\n'); /***/ }), -/* 812 */ +/* 862 */ /***/ (function(module, exports) { module.exports = [ @@ -146271,22 +154377,18 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'void main()', + 'void main ()', '{', ' vec4 texture = texture2D(uMainSampler, outTexCoord);', - ' vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);', - ' vec4 color = texture;', + ' vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);', '', - ' if (outTintEffect == 0.0)', - ' {', - ' // Multiply texture tint', - ' color = texture * texel;', - ' }', - ' else if (outTintEffect == 1.0)', + ' // Multiply texture tint', + ' vec4 color = texture * texel;', + '', + ' if (outTintEffect == 1.0)', ' {', ' // Solid color + texture alpha', - ' color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);', - ' color.a = texture.a * texel.a;', + ' color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);', ' }', ' else if (outTintEffect == 2.0)', ' {', @@ -146301,7 +154403,7 @@ module.exports = [ /***/ }), -/* 813 */ +/* 863 */ /***/ (function(module, exports) { module.exports = [ @@ -146310,11 +154412,10 @@ module.exports = [ 'precision mediump float;', '', 'uniform mat4 uProjectionMatrix;', - 'uniform mat4 uViewMatrix;', - 'uniform mat4 uModelMatrix;', '', 'attribute vec2 inPosition;', 'attribute vec2 inTexCoord;', + 'attribute float inTexId;', 'attribute float inTintEffect;', 'attribute vec4 inTint;', '', @@ -146324,7 +154425,7 @@ module.exports = [ '', 'void main ()', '{', - ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', '', ' outTexCoord = inTexCoord;', ' outTint = inTint;', @@ -146335,7 +154436,688 @@ module.exports = [ /***/ }), -/* 814 */ +/* 864 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AddBlendFS = __webpack_require__(865); +var Class = __webpack_require__(0); +var ColorMatrix = __webpack_require__(264); +var ColorMatrixFS = __webpack_require__(866); +var CopyFS = __webpack_require__(867); +var GetFastValue = __webpack_require__(2); +var LinearBlendFS = __webpack_require__(868); +var QuadVS = __webpack_require__(579); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); + +/** + * @classdesc + * The Utility Pipeline is a special-use pipeline that belongs to the Pipeline Manager. + * + * It provides 4 shaders and handy associated methods: + * + * 1) Copy Shader. A fast texture to texture copy shader with optional brightness setting. + * 2) Additive Blend Mode Shader. Blends two textures using an additive blend mode. + * 3) Linear Blend Mode Shader. Blends two textures using a linear blend mode. + * 4) Color Matrix Copy Shader. Draws a texture to a target using a Color Matrix. + * + * You typically do not extend or access this pipeline directly, but instead go + * via the following methods in the Pipeline Manager: + * + * `copyFrame` + * `drawFrame` + * `blendFrames` + * `blendFramesAdditive` + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * This pipeline has a hard-coded batch size of 1 and a hard coded set of vertices. + * + * @class UtilityPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var UtilityPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function UtilityPipeline (config) + { + config.renderTarget = GetFastValue(config, 'renderTarget', [ + { + scale: 1 + }, + { + scale: 1 + }, + { + scale: 0.5 + }, + { + scale: 0.5 + } + ]); + + config.vertShader = GetFastValue(config, 'vertShader', QuadVS); + + config.shaders = GetFastValue(config, 'shaders', [ + { + name: 'Copy', + fragShader: CopyFS, + uniforms: [ + 'uMainSampler', + 'uBrightness' + ] + }, + { + name: 'AddBlend', + fragShader: AddBlendFS, + uniforms: [ + 'uMainSampler1', + 'uMainSampler2', + 'uStrength' + ] + }, + { + name: 'LinearBlend', + fragShader: LinearBlendFS, + uniforms: [ + 'uMainSampler1', + 'uMainSampler2', + 'uStrength' + ] + }, + { + name: 'ColorMatrix', + fragShader: ColorMatrixFS, + uniforms: [ + 'uMainSampler', + 'uColorMatrix', + 'uAlpha' + ] + } + ]); + + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTexCoord', + size: 2, + type: WEBGL_CONST.FLOAT + } + ]); + + // x, y, u, v (x/y in NDC) + config.vertices = new Float32Array([ + -1, -1, 0, 0, + -1, 1, 0, 1, + 1, 1, 1, 1, + -1, -1, 0, 0, + 1, 1, 1, 1, + 1, -1, 1, 0 + ]); + + config.batchSize = 1; + + WebGLPipeline.call(this, config); + + /** + * A default Color Matrix, used by the Color Matrix Shader when one + * isn't provided. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#colorMatrix + * @type {Phaser.Display.ColorMatrix} + * @since 3.50.0 + */ + this.colorMatrix = new ColorMatrix(); + + /** + * A reference to the Copy Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @default null + * @since 3.50.0 + */ + this.copyShader; + + /** + * A reference to the Additive Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#addShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.addShader; + + /** + * A reference to the Linear Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#linearShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.linearShader; + + /** + * A reference to the Color Matrix Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#colorMatrixShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.colorMatrixShader; + + /** + * A reference to the Full Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.halfFrame2; + }, + + boot: function () + { + WebGLPipeline.prototype.boot.call(this); + + var shaders = this.shaders; + var targets = this.renderTargets; + + this.copyShader = shaders[0]; + this.addShader = shaders[1]; + this.linearShader = shaders[2]; + this.colorMatrixShader = shaders[3]; + + this.fullFrame1 = targets[0]; + this.fullFrame2 = targets[1]; + this.halfFrame1 = targets[2]; + this.halfFrame2 = targets[3]; + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + if (brightness === undefined) { brightness = 1; } + if (clear === undefined) { clear = true; } + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.copyShader); + this.set1f('uBrightness', brightness, this.copyShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + } + else + { + gl.viewport(0, 0, source.width, source.height); + } + + if (clear) + { + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.copyShader); + this.set1f('uBrightness', 1, this.copyShader); + + this.renderer.popFramebuffer(); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + this.renderer.resetTextures(); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Display.ColorMatrix} [colorMatrix] - The Color Matrix to use when performing the draw. + */ + drawFrame: function (source, target, clearAlpha, colorMatrix) + { + if (clearAlpha === undefined) { clearAlpha = true; } + if (colorMatrix === undefined) { colorMatrix = this.colorMatrix; } + + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.colorMatrixShader); + this.set1fv('uColorMatrix', colorMatrix.getData(), this.colorMatrixShader); + this.set1f('uAlpha', colorMatrix.alpha, this.colorMatrixShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + } + else + { + gl.viewport(0, 0, source.width, source.height); + } + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Renderer.WebGL.WebGLShader} [blendShader] - The shader to use during the blend copy. + */ + blendFrames: function (source1, source2, target, strength, clearAlpha, blendShader) + { + if (strength === undefined) { strength = 1; } + if (clearAlpha === undefined) { clearAlpha = true; } + if (blendShader === undefined) { blendShader = this.linearShader; } + + var gl = this.gl; + + this.set1i('uMainSampler1', 0, blendShader); + this.set1i('uMainSampler2', 1, blendShader); + this.set1f('uStrength', strength, blendShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source1.texture); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(gl.TEXTURE_2D, source2.texture); + + if (target) + { + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + gl.viewport(0, 0, target.width, target.height); + } + else + { + gl.viewport(0, 0, source1.width, source1.height); + } + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + this.blendFrames(source1, source2, target, strength, clearAlpha, this.addShader); + }, + + /** + * Clears the given Render Target. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#clearFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to clear. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + clearFrame: function (target, clearAlpha) + { + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + + gl.viewport(0, 0, target.width, target.height); + + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + var fbo = this.renderer.currentFramebuffer; + + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + } + +}); + +module.exports = UtilityPipeline; + + +/***/ }), +/* 865 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_ADD_BLEND_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler1;', + 'uniform sampler2D uMainSampler2;', + 'uniform float uStrength;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 frame1 = texture2D(uMainSampler1, outTexCoord);', + ' vec4 frame2 = texture2D(uMainSampler2, outTexCoord);', + '', + ' gl_FragColor = frame1 + frame2 * uStrength;', + '}', + '' +].join('\n'); + + +/***/ }), +/* 866 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_COLORMATRIX_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + 'uniform float uColorMatrix[20];', + 'uniform float uAlpha;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 c = texture2D(uMainSampler, outTexCoord);', + '', + ' if (uAlpha == 0.0)', + ' {', + ' gl_FragColor = c;', + '', + ' return;', + ' }', + '', + ' if (c.a > 0.0)', + ' {', + ' c.rgb /= c.a;', + ' }', + '', + ' vec4 result;', + '', + ' result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];', + ' result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];', + ' result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];', + ' result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];', + '', + ' vec3 rgb = mix(c.rgb, result.rgb, uAlpha);', + '', + ' rgb *= result.a;', + '', + ' gl_FragColor = vec4(rgb, result.a);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 867 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_COPY_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + 'uniform float uBrightness;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;', + '}', + '' +].join('\n'); + + +/***/ }), +/* 868 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_LINEAR_BLEND_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler1;', + 'uniform sampler2D uMainSampler2;', + 'uniform float uStrength;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 frame1 = texture2D(uMainSampler1, outTexCoord);', + ' vec4 frame2 = texture2D(uMainSampler2, outTexCoord);', + '', + ' gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);', + '}', + '' +].join('\n'); + + +/***/ }), +/* 869 */ /***/ (function(module, exports) { /** @@ -146361,7 +155143,7 @@ module.exports = 'addtexture'; /***/ }), -/* 815 */ +/* 870 */ /***/ (function(module, exports) { /** @@ -146387,7 +155169,7 @@ module.exports = 'onerror'; /***/ }), -/* 816 */ +/* 871 */ /***/ (function(module, exports) { /** @@ -146416,7 +155198,7 @@ module.exports = 'onload'; /***/ }), -/* 817 */ +/* 872 */ /***/ (function(module, exports) { /** @@ -146439,7 +155221,7 @@ module.exports = 'ready'; /***/ }), -/* 818 */ +/* 873 */ /***/ (function(module, exports) { /** @@ -146467,7 +155249,7 @@ module.exports = 'removetexture'; /***/ }), -/* 819 */ +/* 874 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146482,14 +155264,14 @@ module.exports = 'removetexture'; module.exports = { - GenerateTexture: __webpack_require__(355), - Palettes: __webpack_require__(820) + GenerateTexture: __webpack_require__(364), + Palettes: __webpack_require__(875) }; /***/ }), -/* 820 */ +/* 875 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146504,17 +155286,17 @@ module.exports = { module.exports = { - ARNE16: __webpack_require__(356), - C64: __webpack_require__(821), - CGA: __webpack_require__(822), - JMP: __webpack_require__(823), - MSX: __webpack_require__(824) + ARNE16: __webpack_require__(365), + C64: __webpack_require__(876), + CGA: __webpack_require__(877), + JMP: __webpack_require__(878), + MSX: __webpack_require__(879) }; /***/ }), -/* 821 */ +/* 876 */ /***/ (function(module, exports) { /** @@ -146552,7 +155334,7 @@ module.exports = { /***/ }), -/* 822 */ +/* 877 */ /***/ (function(module, exports) { /** @@ -146590,7 +155372,7 @@ module.exports = { /***/ }), -/* 823 */ +/* 878 */ /***/ (function(module, exports) { /** @@ -146628,7 +155410,7 @@ module.exports = { /***/ }), -/* 824 */ +/* 879 */ /***/ (function(module, exports) { /** @@ -146666,7 +155448,7 @@ module.exports = { /***/ }), -/* 825 */ +/* 880 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146680,20 +155462,20 @@ module.exports = { */ module.exports = { - Path: __webpack_require__(826), - MoveTo: __webpack_require__(360), + Path: __webpack_require__(881), + MoveTo: __webpack_require__(369), - CubicBezier: __webpack_require__(357), - Curve: __webpack_require__(83), - Ellipse: __webpack_require__(358), - Line: __webpack_require__(359), - QuadraticBezier: __webpack_require__(361), - Spline: __webpack_require__(362) + CubicBezier: __webpack_require__(366), + Curve: __webpack_require__(88), + Ellipse: __webpack_require__(367), + Line: __webpack_require__(368), + QuadraticBezier: __webpack_require__(370), + Spline: __webpack_require__(371) }; /***/ }), -/* 826 */ +/* 881 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -146705,14 +155487,14 @@ module.exports = { // Based on the three.js Curve classes created by [zz85](http://www.lab4games.net/zz85/blog) var Class = __webpack_require__(0); -var CubicBezierCurve = __webpack_require__(357); -var EllipseCurve = __webpack_require__(358); +var CubicBezierCurve = __webpack_require__(366); +var EllipseCurve = __webpack_require__(367); var GameObjectFactory = __webpack_require__(5); -var LineCurve = __webpack_require__(359); -var MovePathTo = __webpack_require__(360); -var QuadraticBezierCurve = __webpack_require__(361); +var LineCurve = __webpack_require__(368); +var MovePathTo = __webpack_require__(369); +var QuadraticBezierCurve = __webpack_require__(370); var Rectangle = __webpack_require__(9); -var SplineCurve = __webpack_require__(362); +var SplineCurve = __webpack_require__(371); var Vector2 = __webpack_require__(3); var MATH_CONST = __webpack_require__(13); @@ -146974,7 +155756,7 @@ var Path = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [out,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The Graphics Game Object to draw to. - * @param {integer} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. + * @param {number} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. * * @return {Phaser.GameObjects.Graphics} The Graphics object which was drawn to. */ @@ -147003,8 +155785,8 @@ var Path = new Class({ * * @param {number} [xRadius=0] - The horizontal radius of ellipse. * @param {number} [yRadius=0] - The vertical radius of ellipse. - * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. - * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {number} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {number} [endAngle=360] - The end angle of the ellipse, in degrees. * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. * @@ -147090,7 +155872,7 @@ var Path = new Class({ * @generic {Phaser.Math.Vector2} O - [out,$return] * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. - * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. + * @param {number} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. * * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. */ @@ -147272,7 +156054,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#getPoints * @since 3.0.0 * - * @param {integer} [divisions=12] - The number of divisions per resolution per curve. + * @param {number} [divisions=12] - The number of divisions per resolution per curve. * * @return {Phaser.Math.Vector2[]} An array of Vector2 objects that containing the points along the Path. */ @@ -147349,7 +156131,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#getSpacedPoints * @since 3.0.0 * - * @param {integer} [divisions=40] - The amount of points to divide this Path into. + * @param {number} [divisions=40] - The amount of points to divide this Path into. * * @return {Phaser.Math.Vector2[]} A list of the points this path was subdivided into. */ @@ -147582,7 +156364,7 @@ module.exports = Path; /***/ }), -/* 827 */ +/* 882 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147597,15 +156379,15 @@ module.exports = Path; module.exports = { - DataManager: __webpack_require__(120), - DataManagerPlugin: __webpack_require__(828), - Events: __webpack_require__(293) + DataManager: __webpack_require__(97), + DataManagerPlugin: __webpack_require__(883), + Events: __webpack_require__(307) }; /***/ }), -/* 828 */ +/* 883 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147615,8 +156397,8 @@ module.exports = { */ var Class = __webpack_require__(0); -var DataManager = __webpack_require__(120); -var PluginCache = __webpack_require__(23); +var DataManager = __webpack_require__(97); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -147732,7 +156514,7 @@ module.exports = DataManagerPlugin; /***/ }), -/* 829 */ +/* 884 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147747,18 +156529,20 @@ module.exports = DataManagerPlugin; module.exports = { - Align: __webpack_require__(830), - BaseShader: __webpack_require__(363), - Bounds: __webpack_require__(833), - Canvas: __webpack_require__(837), - Color: __webpack_require__(364), - Masks: __webpack_require__(846) + Align: __webpack_require__(885), + BaseShader: __webpack_require__(372), + Bounds: __webpack_require__(888), + Canvas: __webpack_require__(892), + Color: __webpack_require__(373), + ColorMatrix: __webpack_require__(264), + Masks: __webpack_require__(902), + RGB: __webpack_require__(376) }; /***/ }), -/* 830 */ +/* 885 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147767,8 +156551,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(108); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(120); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Display.Align @@ -147776,8 +156560,8 @@ var Extend = __webpack_require__(19); var Align = { - In: __webpack_require__(831), - To: __webpack_require__(832) + In: __webpack_require__(886), + To: __webpack_require__(887) }; @@ -147788,7 +156572,7 @@ module.exports = Align; /***/ }), -/* 831 */ +/* 886 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147803,22 +156587,22 @@ module.exports = Align; module.exports = { - BottomCenter: __webpack_require__(267), - BottomLeft: __webpack_require__(268), - BottomRight: __webpack_require__(269), - Center: __webpack_require__(270), - LeftCenter: __webpack_require__(272), - QuickSet: __webpack_require__(266), - RightCenter: __webpack_require__(273), - TopCenter: __webpack_require__(274), - TopLeft: __webpack_require__(275), - TopRight: __webpack_require__(276) + BottomCenter: __webpack_require__(282), + BottomLeft: __webpack_require__(283), + BottomRight: __webpack_require__(284), + Center: __webpack_require__(285), + LeftCenter: __webpack_require__(287), + QuickSet: __webpack_require__(281), + RightCenter: __webpack_require__(288), + TopCenter: __webpack_require__(289), + TopLeft: __webpack_require__(290), + TopRight: __webpack_require__(291) }; /***/ }), -/* 832 */ +/* 887 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147833,25 +156617,25 @@ module.exports = { module.exports = { - BottomCenter: __webpack_require__(254), - BottomLeft: __webpack_require__(255), - BottomRight: __webpack_require__(256), - LeftBottom: __webpack_require__(257), - LeftCenter: __webpack_require__(258), - LeftTop: __webpack_require__(259), - QuickSet: __webpack_require__(253), - RightBottom: __webpack_require__(260), - RightCenter: __webpack_require__(261), - RightTop: __webpack_require__(262), - TopCenter: __webpack_require__(263), - TopLeft: __webpack_require__(264), - TopRight: __webpack_require__(265) + BottomCenter: __webpack_require__(269), + BottomLeft: __webpack_require__(270), + BottomRight: __webpack_require__(271), + LeftBottom: __webpack_require__(272), + LeftCenter: __webpack_require__(273), + LeftTop: __webpack_require__(274), + QuickSet: __webpack_require__(268), + RightBottom: __webpack_require__(275), + RightCenter: __webpack_require__(276), + RightTop: __webpack_require__(277), + TopCenter: __webpack_require__(278), + TopLeft: __webpack_require__(279), + TopRight: __webpack_require__(280) }; /***/ }), -/* 833 */ +/* 888 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147866,28 +156650,28 @@ module.exports = { module.exports = { - CenterOn: __webpack_require__(271), - GetBottom: __webpack_require__(35), - GetBounds: __webpack_require__(834), - GetCenterX: __webpack_require__(77), - GetCenterY: __webpack_require__(79), - GetLeft: __webpack_require__(36), - GetOffsetX: __webpack_require__(835), - GetOffsetY: __webpack_require__(836), - GetRight: __webpack_require__(37), - GetTop: __webpack_require__(38), - SetBottom: __webpack_require__(48), - SetCenterX: __webpack_require__(78), - SetCenterY: __webpack_require__(80), - SetLeft: __webpack_require__(46), - SetRight: __webpack_require__(47), - SetTop: __webpack_require__(45) + CenterOn: __webpack_require__(286), + GetBottom: __webpack_require__(40), + GetBounds: __webpack_require__(889), + GetCenterX: __webpack_require__(83), + GetCenterY: __webpack_require__(85), + GetLeft: __webpack_require__(41), + GetOffsetX: __webpack_require__(890), + GetOffsetY: __webpack_require__(891), + GetRight: __webpack_require__(42), + GetTop: __webpack_require__(43), + SetBottom: __webpack_require__(54), + SetCenterX: __webpack_require__(84), + SetCenterY: __webpack_require__(86), + SetLeft: __webpack_require__(52), + SetRight: __webpack_require__(53), + SetTop: __webpack_require__(51) }; /***/ }), -/* 834 */ +/* 889 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -147896,10 +156680,10 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetBottom = __webpack_require__(35); -var GetLeft = __webpack_require__(36); -var GetRight = __webpack_require__(37); -var GetTop = __webpack_require__(38); +var GetBottom = __webpack_require__(40); +var GetLeft = __webpack_require__(41); +var GetRight = __webpack_require__(42); +var GetTop = __webpack_require__(43); /** * Returns the unrotated bounds of the Game Object as a rectangle. @@ -147931,7 +156715,7 @@ module.exports = GetBounds; /***/ }), -/* 835 */ +/* 890 */ /***/ (function(module, exports) { /** @@ -147961,7 +156745,7 @@ module.exports = GetOffsetX; /***/ }), -/* 836 */ +/* 891 */ /***/ (function(module, exports) { /** @@ -147991,7 +156775,7 @@ module.exports = GetOffsetY; /***/ }), -/* 837 */ +/* 892 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148006,17 +156790,17 @@ module.exports = GetOffsetY; module.exports = { - CanvasInterpolation: __webpack_require__(350), - CanvasPool: __webpack_require__(26), - Smoothing: __webpack_require__(177), - TouchAction: __webpack_require__(838), - UserSelect: __webpack_require__(839) + CanvasInterpolation: __webpack_require__(359), + CanvasPool: __webpack_require__(31), + Smoothing: __webpack_require__(184), + TouchAction: __webpack_require__(893), + UserSelect: __webpack_require__(894) }; /***/ }), -/* 838 */ +/* 893 */ /***/ (function(module, exports) { /** @@ -148051,7 +156835,7 @@ module.exports = TouchAction; /***/ }), -/* 839 */ +/* 894 */ /***/ (function(module, exports) { /** @@ -148098,7 +156882,75 @@ module.exports = UserSelect; /***/ }), -/* 840 */ +/* 895 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetColor = __webpack_require__(100); + +/** + * Return an array of Colors in a Color Spectrum. + * + * @function Phaser.Display.Color.ColorSpectrum + * @since 3.50.0 + * + * @return {Phaser.Types.Display.ColorObject[]} An array containing 1024 elements, where each contains a Color Object. + */ +var ColorSpectrum = function () +{ + var colors = []; + + var range = 255; + + var i; + var r = 255; + var g = 0; + var b = 0; + + // Red to Yellow + for (i = 0; i <= range; i++) + { + colors.push({ r: r, g: i, b: b, color: GetColor(r, i, b) }); + } + + g = 255; + + // Yellow to Green + for (i = range; i >= 0; i--) + { + colors.push({ r: i, g: g, b: b, color: GetColor(i, g, b) }); + } + + r = 0; + + // Green to Blue + for (i = 0; i <= range; i++, g--) + { + colors.push({ r: r, g: g, b: i, color: GetColor(r, g, i) }); + } + + g = 0; + b = 255; + + // Blue to Red + for (i = 0; i <= range; i++, b--, r++) + { + colors.push({ r: r, g: g, b: b, color: GetColor(r, g, b) }); + } + + return colors; +}; + +module.exports = ColorSpectrum; + + +/***/ }), +/* 896 */ /***/ (function(module, exports) { /** @@ -148138,7 +156990,7 @@ module.exports = ColorToRGBA; /***/ }), -/* 841 */ +/* 897 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148147,8 +156999,8 @@ module.exports = ColorToRGBA; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Color = __webpack_require__(32); -var HueToComponent = __webpack_require__(366); +var Color = __webpack_require__(36); +var HueToComponent = __webpack_require__(375); /** * Converts HSL (hue, saturation and lightness) values to a Phaser Color object. @@ -148188,7 +157040,7 @@ module.exports = HSLToColor; /***/ }), -/* 842 */ +/* 898 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148197,7 +157049,7 @@ module.exports = HSLToColor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HSVToRGB = __webpack_require__(176); +var HSVToRGB = __webpack_require__(180); /** * Get HSV color wheel values in an array which will be 360 elements in size. @@ -148229,7 +157081,7 @@ module.exports = HSVColorWheel; /***/ }), -/* 843 */ +/* 899 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148238,7 +157090,7 @@ module.exports = HSVColorWheel; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(124); +var Linear = __webpack_require__(130); /** * @namespace Phaser.Display.Color.Interpolate @@ -148337,7 +157189,7 @@ module.exports = { /***/ }), -/* 844 */ +/* 900 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148346,8 +157198,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(182); -var Color = __webpack_require__(32); +var Between = __webpack_require__(187); +var Color = __webpack_require__(36); /** * Creates a new Color object where the r, g, and b values have been set to random values @@ -148356,8 +157208,8 @@ var Color = __webpack_require__(32); * @function Phaser.Display.Color.RandomRGB * @since 3.0.0 * - * @param {integer} [min=0] - The minimum value to set the random range from (between 0 and 255) - * @param {integer} [max=255] - The maximum value to set the random range from (between 0 and 255) + * @param {number} [min=0] - The minimum value to set the random range from (between 0 and 255) + * @param {number} [max=255] - The maximum value to set the random range from (between 0 and 255) * * @return {Phaser.Display.Color} A Color object. */ @@ -148373,7 +157225,7 @@ module.exports = RandomRGB; /***/ }), -/* 845 */ +/* 901 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148382,7 +157234,7 @@ module.exports = RandomRGB; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ComponentToHex = __webpack_require__(365); +var ComponentToHex = __webpack_require__(374); /** * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. @@ -148390,10 +157242,10 @@ var ComponentToHex = __webpack_require__(365); * @function Phaser.Display.Color.RGBToString * @since 3.0.0 * - * @param {integer} r - The red color value. A number between 0 and 255. - * @param {integer} g - The green color value. A number between 0 and 255. - * @param {integer} b - The blue color value. A number between 0 and 255. - * @param {integer} [a=255] - The alpha value. A number between 0 and 255. + * @param {number} r - The red color value. A number between 0 and 255. + * @param {number} g - The green color value. A number between 0 and 255. + * @param {number} b - The blue color value. A number between 0 and 255. + * @param {number} [a=255] - The alpha value. A number between 0 and 255. * @param {string} [prefix=#] - The prefix of the string. Either `#` or `0x`. * * @return {string} A string-based representation of the color values. @@ -148417,7 +157269,7 @@ module.exports = RGBToString; /***/ }), -/* 846 */ +/* 902 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148432,14 +157284,14 @@ module.exports = RGBToString; module.exports = { - BitmapMask: __webpack_require__(287), - GeometryMask: __webpack_require__(288) + BitmapMask: __webpack_require__(302), + GeometryMask: __webpack_require__(303) }; /***/ }), -/* 847 */ +/* 903 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148454,14 +157306,14 @@ module.exports = { var Dom = { - AddToDOM: __webpack_require__(131), - DOMContentLoaded: __webpack_require__(367), - GetInnerHeight: __webpack_require__(368), - GetScreenOrientation: __webpack_require__(369), - GetTarget: __webpack_require__(374), - ParseXML: __webpack_require__(375), - RemoveFromDOM: __webpack_require__(188), - RequestAnimationFrame: __webpack_require__(353) + AddToDOM: __webpack_require__(137), + DOMContentLoaded: __webpack_require__(377), + GetInnerHeight: __webpack_require__(378), + GetScreenOrientation: __webpack_require__(379), + GetTarget: __webpack_require__(384), + ParseXML: __webpack_require__(385), + RemoveFromDOM: __webpack_require__(193), + RequestAnimationFrame: __webpack_require__(362) }; @@ -148469,7 +157321,7 @@ module.exports = Dom; /***/ }), -/* 848 */ +/* 904 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148482,11 +157334,11 @@ module.exports = Dom; * @namespace Phaser.Events */ -module.exports = { EventEmitter: __webpack_require__(849) }; +module.exports = { EventEmitter: __webpack_require__(905) }; /***/ }), -/* 849 */ +/* 905 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148496,8 +157348,8 @@ module.exports = { EventEmitter: __webpack_require__(849) }; */ var Class = __webpack_require__(0); -var EE = __webpack_require__(12); -var PluginCache = __webpack_require__(23); +var EE = __webpack_require__(10); +var PluginCache = __webpack_require__(25); /** * @classdesc @@ -148670,7 +157522,7 @@ module.exports = EventEmitter; /***/ }), -/* 850 */ +/* 906 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -148679,33 +157531,33 @@ module.exports = EventEmitter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(131); -var AnimationManager = __webpack_require__(301); -var CacheManager = __webpack_require__(305); -var CanvasPool = __webpack_require__(26); +var AddToDOM = __webpack_require__(137); +var AnimationManager = __webpack_require__(313); +var CacheManager = __webpack_require__(317); +var CanvasPool = __webpack_require__(31); var Class = __webpack_require__(0); -var Config = __webpack_require__(327); -var CreateDOMContainer = __webpack_require__(851); -var CreateRenderer = __webpack_require__(349); -var DataManager = __webpack_require__(120); -var DebugHeader = __webpack_require__(351); -var Device = __webpack_require__(328); -var DOMContentLoaded = __webpack_require__(367); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(21); -var InputManager = __webpack_require__(376); -var PluginCache = __webpack_require__(23); -var PluginManager = __webpack_require__(381); -var ScaleManager = __webpack_require__(382); -var SceneManager = __webpack_require__(384); -var TextureEvents = __webpack_require__(130); -var TextureManager = __webpack_require__(389); -var TimeStep = __webpack_require__(352); -var VisibilityHandler = __webpack_require__(354); +var Config = __webpack_require__(338); +var CreateDOMContainer = __webpack_require__(907); +var CreateRenderer = __webpack_require__(358); +var DataManager = __webpack_require__(97); +var DebugHeader = __webpack_require__(360); +var Device = __webpack_require__(339); +var DOMContentLoaded = __webpack_require__(377); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(23); +var InputManager = __webpack_require__(386); +var PluginCache = __webpack_require__(25); +var PluginManager = __webpack_require__(391); +var ScaleManager = __webpack_require__(392); +var SceneManager = __webpack_require__(394); +var TextureEvents = __webpack_require__(136); +var TextureManager = __webpack_require__(399); +var TimeStep = __webpack_require__(361); +var VisibilityHandler = __webpack_require__(363); if (true) { - var SoundManagerCreator = __webpack_require__(393); + var SoundManagerCreator = __webpack_require__(403); } if (false) @@ -149373,7 +158225,7 @@ module.exports = Game; /***/ }), -/* 851 */ +/* 907 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -149382,7 +158234,7 @@ module.exports = Game; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = __webpack_require__(131); +var AddToDOM = __webpack_require__(137); var CreateDOMContainer = function (game) { @@ -149417,7 +158269,7 @@ module.exports = CreateDOMContainer; /***/ }), -/* 852 */ +/* 908 */ /***/ (function(module, exports) { /** @@ -149438,7 +158290,7 @@ module.exports = 'boot'; /***/ }), -/* 853 */ +/* 909 */ /***/ (function(module, exports) { /** @@ -149459,7 +158311,7 @@ module.exports = 'destroy'; /***/ }), -/* 854 */ +/* 910 */ /***/ (function(module, exports) { /** @@ -149487,7 +158339,7 @@ module.exports = 'dragend'; /***/ }), -/* 855 */ +/* 911 */ /***/ (function(module, exports) { /** @@ -149518,7 +158370,7 @@ module.exports = 'dragenter'; /***/ }), -/* 856 */ +/* 912 */ /***/ (function(module, exports) { /** @@ -149550,7 +158402,7 @@ module.exports = 'drag'; /***/ }), -/* 857 */ +/* 913 */ /***/ (function(module, exports) { /** @@ -149581,7 +158433,7 @@ module.exports = 'dragleave'; /***/ }), -/* 858 */ +/* 914 */ /***/ (function(module, exports) { /** @@ -149615,7 +158467,7 @@ module.exports = 'dragover'; /***/ }), -/* 859 */ +/* 915 */ /***/ (function(module, exports) { /** @@ -149645,7 +158497,7 @@ module.exports = 'dragstart'; /***/ }), -/* 860 */ +/* 916 */ /***/ (function(module, exports) { /** @@ -149674,7 +158526,7 @@ module.exports = 'drop'; /***/ }), -/* 861 */ +/* 917 */ /***/ (function(module, exports) { /** @@ -149701,7 +158553,7 @@ module.exports = 'gameout'; /***/ }), -/* 862 */ +/* 918 */ /***/ (function(module, exports) { /** @@ -149728,7 +158580,7 @@ module.exports = 'gameover'; /***/ }), -/* 863 */ +/* 919 */ /***/ (function(module, exports) { /** @@ -149769,7 +158621,7 @@ module.exports = 'gameobjectdown'; /***/ }), -/* 864 */ +/* 920 */ /***/ (function(module, exports) { /** @@ -149800,7 +158652,7 @@ module.exports = 'dragend'; /***/ }), -/* 865 */ +/* 921 */ /***/ (function(module, exports) { /** @@ -149830,7 +158682,7 @@ module.exports = 'dragenter'; /***/ }), -/* 866 */ +/* 922 */ /***/ (function(module, exports) { /** @@ -149861,7 +158713,7 @@ module.exports = 'drag'; /***/ }), -/* 867 */ +/* 923 */ /***/ (function(module, exports) { /** @@ -149891,7 +158743,7 @@ module.exports = 'dragleave'; /***/ }), -/* 868 */ +/* 924 */ /***/ (function(module, exports) { /** @@ -149924,7 +158776,7 @@ module.exports = 'dragover'; /***/ }), -/* 869 */ +/* 925 */ /***/ (function(module, exports) { /** @@ -149958,7 +158810,7 @@ module.exports = 'dragstart'; /***/ }), -/* 870 */ +/* 926 */ /***/ (function(module, exports) { /** @@ -149988,7 +158840,7 @@ module.exports = 'drop'; /***/ }), -/* 871 */ +/* 927 */ /***/ (function(module, exports) { /** @@ -150029,7 +158881,7 @@ module.exports = 'gameobjectmove'; /***/ }), -/* 872 */ +/* 928 */ /***/ (function(module, exports) { /** @@ -150070,7 +158922,7 @@ module.exports = 'gameobjectout'; /***/ }), -/* 873 */ +/* 929 */ /***/ (function(module, exports) { /** @@ -150111,7 +158963,7 @@ module.exports = 'gameobjectover'; /***/ }), -/* 874 */ +/* 930 */ /***/ (function(module, exports) { /** @@ -150152,7 +159004,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 875 */ +/* 931 */ /***/ (function(module, exports) { /** @@ -150193,7 +159045,7 @@ module.exports = 'pointermove'; /***/ }), -/* 876 */ +/* 932 */ /***/ (function(module, exports) { /** @@ -150232,7 +159084,7 @@ module.exports = 'pointerout'; /***/ }), -/* 877 */ +/* 933 */ /***/ (function(module, exports) { /** @@ -150273,7 +159125,7 @@ module.exports = 'pointerover'; /***/ }), -/* 878 */ +/* 934 */ /***/ (function(module, exports) { /** @@ -150314,7 +159166,7 @@ module.exports = 'pointerup'; /***/ }), -/* 879 */ +/* 935 */ /***/ (function(module, exports) { /** @@ -150356,7 +159208,7 @@ module.exports = 'wheel'; /***/ }), -/* 880 */ +/* 936 */ /***/ (function(module, exports) { /** @@ -150397,7 +159249,7 @@ module.exports = 'gameobjectup'; /***/ }), -/* 881 */ +/* 937 */ /***/ (function(module, exports) { /** @@ -150441,7 +159293,7 @@ module.exports = 'gameobjectwheel'; /***/ }), -/* 882 */ +/* 938 */ /***/ (function(module, exports) { /** @@ -150462,7 +159314,7 @@ module.exports = 'boot'; /***/ }), -/* 883 */ +/* 939 */ /***/ (function(module, exports) { /** @@ -150487,7 +159339,7 @@ module.exports = 'process'; /***/ }), -/* 884 */ +/* 940 */ /***/ (function(module, exports) { /** @@ -150508,7 +159360,7 @@ module.exports = 'update'; /***/ }), -/* 885 */ +/* 941 */ /***/ (function(module, exports) { /** @@ -150543,7 +159395,7 @@ module.exports = 'pointerdown'; /***/ }), -/* 886 */ +/* 942 */ /***/ (function(module, exports) { /** @@ -150577,7 +159429,7 @@ module.exports = 'pointerdownoutside'; /***/ }), -/* 887 */ +/* 943 */ /***/ (function(module, exports) { /** @@ -150612,7 +159464,7 @@ module.exports = 'pointermove'; /***/ }), -/* 888 */ +/* 944 */ /***/ (function(module, exports) { /** @@ -150647,7 +159499,7 @@ module.exports = 'pointerout'; /***/ }), -/* 889 */ +/* 945 */ /***/ (function(module, exports) { /** @@ -150682,7 +159534,7 @@ module.exports = 'pointerover'; /***/ }), -/* 890 */ +/* 946 */ /***/ (function(module, exports) { /** @@ -150717,7 +159569,7 @@ module.exports = 'pointerup'; /***/ }), -/* 891 */ +/* 947 */ /***/ (function(module, exports) { /** @@ -150751,7 +159603,7 @@ module.exports = 'pointerupoutside'; /***/ }), -/* 892 */ +/* 948 */ /***/ (function(module, exports) { /** @@ -150789,7 +159641,7 @@ module.exports = 'wheel'; /***/ }), -/* 893 */ +/* 949 */ /***/ (function(module, exports) { /** @@ -150813,7 +159665,7 @@ module.exports = 'pointerlockchange'; /***/ }), -/* 894 */ +/* 950 */ /***/ (function(module, exports) { /** @@ -150835,7 +159687,7 @@ module.exports = 'preupdate'; /***/ }), -/* 895 */ +/* 951 */ /***/ (function(module, exports) { /** @@ -150856,7 +159708,7 @@ module.exports = 'shutdown'; /***/ }), -/* 896 */ +/* 952 */ /***/ (function(module, exports) { /** @@ -150878,7 +159730,7 @@ module.exports = 'start'; /***/ }), -/* 897 */ +/* 953 */ /***/ (function(module, exports) { /** @@ -150903,7 +159755,7 @@ module.exports = 'update'; /***/ }), -/* 898 */ +/* 954 */ /***/ (function(module, exports) { /** @@ -150933,7 +159785,7 @@ module.exports = 'addfile'; /***/ }), -/* 899 */ +/* 955 */ /***/ (function(module, exports) { /** @@ -150954,14 +159806,14 @@ module.exports = 'addfile'; * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {integer} totalComplete - The total number of files that successfully loaded. - * @param {integer} totalFailed - The total number of files that failed to load. + * @param {number} totalComplete - The total number of files that successfully loaded. + * @param {number} totalFailed - The total number of files that failed to load. */ module.exports = 'complete'; /***/ }), -/* 900 */ +/* 956 */ /***/ (function(module, exports) { /** @@ -150990,7 +159842,7 @@ module.exports = 'filecomplete'; /***/ }), -/* 901 */ +/* 957 */ /***/ (function(module, exports) { /** @@ -151044,7 +159896,7 @@ module.exports = 'filecomplete-'; /***/ }), -/* 902 */ +/* 958 */ /***/ (function(module, exports) { /** @@ -151069,7 +159921,7 @@ module.exports = 'loaderror'; /***/ }), -/* 903 */ +/* 959 */ /***/ (function(module, exports) { /** @@ -151095,7 +159947,7 @@ module.exports = 'load'; /***/ }), -/* 904 */ +/* 960 */ /***/ (function(module, exports) { /** @@ -151122,7 +159974,7 @@ module.exports = 'fileprogress'; /***/ }), -/* 905 */ +/* 961 */ /***/ (function(module, exports) { /** @@ -151151,7 +160003,7 @@ module.exports = 'postprocess'; /***/ }), -/* 906 */ +/* 962 */ /***/ (function(module, exports) { /** @@ -151176,7 +160028,7 @@ module.exports = 'progress'; /***/ }), -/* 907 */ +/* 963 */ /***/ (function(module, exports) { /** @@ -151203,7 +160055,7 @@ module.exports = 'start'; /***/ }), -/* 908 */ +/* 964 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151265,7 +160117,7 @@ module.exports = InjectionMap; /***/ }), -/* 909 */ +/* 965 */ /***/ (function(module, exports) { /** @@ -151283,7 +160135,7 @@ module.exports = InjectionMap; * @since 3.7.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {*} xml - The XML data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -151346,7 +160198,7 @@ module.exports = AtlasXML; /***/ }), -/* 910 */ +/* 966 */ /***/ (function(module, exports) { /** @@ -151364,7 +160216,7 @@ module.exports = AtlasXML; * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. */ @@ -151381,7 +160233,7 @@ module.exports = Canvas; /***/ }), -/* 911 */ +/* 967 */ /***/ (function(module, exports) { /** @@ -151399,7 +160251,7 @@ module.exports = Canvas; * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. */ @@ -151416,7 +160268,7 @@ module.exports = Image; /***/ }), -/* 912 */ +/* 968 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151425,7 +160277,7 @@ module.exports = Image; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Parses a Texture Atlas JSON Array and adds the Frames to the Texture. @@ -151437,7 +160289,7 @@ var Clone = __webpack_require__(69); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} json - The JSON data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -151525,7 +160377,7 @@ module.exports = JSONArray; /***/ }), -/* 913 */ +/* 969 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151534,7 +160386,7 @@ module.exports = JSONArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Parses a Texture Atlas JSON Hash and adds the Frames to the Texture. @@ -151546,7 +160398,7 @@ var Clone = __webpack_require__(69); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} json - The JSON data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -151638,7 +160490,7 @@ module.exports = JSONHash; /***/ }), -/* 914 */ +/* 970 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151661,11 +160513,11 @@ var GetFastValue = __webpack_require__(2); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. - * @param {integer} x - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. - * @param {integer} y - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. - * @param {integer} width - The width of the source image. - * @param {integer} height - The height of the source image. + * @param {number} sourceIndex - The index of the TextureSource. + * @param {number} x - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. + * @param {number} y - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. + * @param {number} width - The width of the source image. + * @param {number} height - The height of the source image. * @param {object} config - An object describing how to parse the Sprite Sheet. * @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet. * @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided. @@ -151763,7 +160615,7 @@ module.exports = SpriteSheet; /***/ }), -/* 915 */ +/* 971 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -151954,7 +160806,7 @@ module.exports = SpriteSheetFromAtlas; /***/ }), -/* 916 */ +/* 972 */ /***/ (function(module, exports) { /** @@ -152004,7 +160856,7 @@ var addFrame = function (texture, sourceIndex, name, frame) * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} yaml - The YAML data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. @@ -152124,7 +160976,7 @@ TextureImporter: /***/ }), -/* 917 */ +/* 973 */ /***/ (function(module, exports) { /** @@ -152155,7 +161007,7 @@ module.exports = 'complete'; /***/ }), -/* 918 */ +/* 974 */ /***/ (function(module, exports) { /** @@ -152185,7 +161037,7 @@ module.exports = 'decoded'; /***/ }), -/* 919 */ +/* 975 */ /***/ (function(module, exports) { /** @@ -152217,7 +161069,7 @@ module.exports = 'decodedall'; /***/ }), -/* 920 */ +/* 976 */ /***/ (function(module, exports) { /** @@ -152249,7 +161101,7 @@ module.exports = 'destroy'; /***/ }), -/* 921 */ +/* 977 */ /***/ (function(module, exports) { /** @@ -152282,7 +161134,7 @@ module.exports = 'detune'; /***/ }), -/* 922 */ +/* 978 */ /***/ (function(module, exports) { /** @@ -152310,7 +161162,7 @@ module.exports = 'detune'; /***/ }), -/* 923 */ +/* 979 */ /***/ (function(module, exports) { /** @@ -152337,7 +161189,7 @@ module.exports = 'mute'; /***/ }), -/* 924 */ +/* 980 */ /***/ (function(module, exports) { /** @@ -152365,7 +161217,7 @@ module.exports = 'rate'; /***/ }), -/* 925 */ +/* 981 */ /***/ (function(module, exports) { /** @@ -152392,7 +161244,7 @@ module.exports = 'volume'; /***/ }), -/* 926 */ +/* 982 */ /***/ (function(module, exports) { /** @@ -152426,7 +161278,7 @@ module.exports = 'loop'; /***/ }), -/* 927 */ +/* 983 */ /***/ (function(module, exports) { /** @@ -152460,7 +161312,7 @@ module.exports = 'looped'; /***/ }), -/* 928 */ +/* 984 */ /***/ (function(module, exports) { /** @@ -152493,7 +161345,7 @@ module.exports = 'mute'; /***/ }), -/* 929 */ +/* 985 */ /***/ (function(module, exports) { /** @@ -152520,7 +161372,7 @@ module.exports = 'pauseall'; /***/ }), -/* 930 */ +/* 986 */ /***/ (function(module, exports) { /** @@ -152552,7 +161404,7 @@ module.exports = 'pause'; /***/ }), -/* 931 */ +/* 987 */ /***/ (function(module, exports) { /** @@ -152583,7 +161435,7 @@ module.exports = 'play'; /***/ }), -/* 932 */ +/* 988 */ /***/ (function(module, exports) { /** @@ -152616,7 +161468,7 @@ module.exports = 'rate'; /***/ }), -/* 933 */ +/* 989 */ /***/ (function(module, exports) { /** @@ -152643,7 +161495,7 @@ module.exports = 'resumeall'; /***/ }), -/* 934 */ +/* 990 */ /***/ (function(module, exports) { /** @@ -152676,7 +161528,7 @@ module.exports = 'resume'; /***/ }), -/* 935 */ +/* 991 */ /***/ (function(module, exports) { /** @@ -152709,7 +161561,7 @@ module.exports = 'seek'; /***/ }), -/* 936 */ +/* 992 */ /***/ (function(module, exports) { /** @@ -152736,7 +161588,7 @@ module.exports = 'stopall'; /***/ }), -/* 937 */ +/* 993 */ /***/ (function(module, exports) { /** @@ -152768,7 +161620,7 @@ module.exports = 'stop'; /***/ }), -/* 938 */ +/* 994 */ /***/ (function(module, exports) { /** @@ -152795,7 +161647,7 @@ module.exports = 'unlocked'; /***/ }), -/* 939 */ +/* 995 */ /***/ (function(module, exports) { /** @@ -152828,7 +161680,7 @@ module.exports = 'volume'; /***/ }), -/* 940 */ +/* 996 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152843,111 +161695,114 @@ module.exports = 'volume'; var GameObjects = { - Events: __webpack_require__(29), + Events: __webpack_require__(32), - DisplayList: __webpack_require__(941), - GameObjectCreator: __webpack_require__(16), + DisplayList: __webpack_require__(997), + GameObjectCreator: __webpack_require__(17), GameObjectFactory: __webpack_require__(5), - UpdateList: __webpack_require__(966), + UpdateList: __webpack_require__(1023), Components: __webpack_require__(11), - BuildGameObject: __webpack_require__(27), - BuildGameObjectAnimation: __webpack_require__(406), + BuildGameObject: __webpack_require__(28), + BuildGameObjectAnimation: __webpack_require__(416), GameObject: __webpack_require__(14), - BitmapText: __webpack_require__(140), - Blitter: __webpack_require__(199), - Bob: __webpack_require__(407), - Container: __webpack_require__(200), - DOMElement: __webpack_require__(409), - DynamicBitmapText: __webpack_require__(201), - Extern: __webpack_require__(411), - Graphics: __webpack_require__(202), - Group: __webpack_require__(100), - Image: __webpack_require__(114), - Particles: __webpack_require__(997), - PathFollower: __webpack_require__(424), - RenderTexture: __webpack_require__(206), - RetroFont: __webpack_require__(1005), - Rope: __webpack_require__(208), - Sprite: __webpack_require__(76), + BitmapText: __webpack_require__(144), + Blitter: __webpack_require__(204), + Bob: __webpack_require__(417), + Container: __webpack_require__(205), + DOMElement: __webpack_require__(419), + DynamicBitmapText: __webpack_require__(206), + Extern: __webpack_require__(421), + Graphics: __webpack_require__(207), + Group: __webpack_require__(108), + Image: __webpack_require__(122), + Layer: __webpack_require__(210), + Particles: __webpack_require__(1057), + PathFollower: __webpack_require__(434), + RenderTexture: __webpack_require__(212), + RetroFont: __webpack_require__(1065), + Rope: __webpack_require__(214), + Sprite: __webpack_require__(70), - Text: __webpack_require__(209), - GetTextSize: __webpack_require__(425), - MeasureText: __webpack_require__(427), - TextStyle: __webpack_require__(426), + Text: __webpack_require__(215), + GetTextSize: __webpack_require__(435), + MeasureText: __webpack_require__(437), + TextStyle: __webpack_require__(436), - TileSprite: __webpack_require__(210), - Zone: __webpack_require__(117), - Video: __webpack_require__(211), + TileSprite: __webpack_require__(216), + Zone: __webpack_require__(125), + Video: __webpack_require__(217), // Shapes - Shape: __webpack_require__(30), - Arc: __webpack_require__(428), - Curve: __webpack_require__(429), - Ellipse: __webpack_require__(430), - Grid: __webpack_require__(431), - IsoBox: __webpack_require__(432), - IsoTriangle: __webpack_require__(433), - Line: __webpack_require__(434), - Polygon: __webpack_require__(435), - Rectangle: __webpack_require__(440), - Star: __webpack_require__(441), - Triangle: __webpack_require__(442), + Shape: __webpack_require__(33), + Arc: __webpack_require__(438), + Curve: __webpack_require__(439), + Ellipse: __webpack_require__(440), + Grid: __webpack_require__(441), + IsoBox: __webpack_require__(442), + IsoTriangle: __webpack_require__(443), + Line: __webpack_require__(444), + Polygon: __webpack_require__(445), + Rectangle: __webpack_require__(450), + Star: __webpack_require__(451), + Triangle: __webpack_require__(452), // Game Object Factories Factories: { - Blitter: __webpack_require__(1053), - Container: __webpack_require__(1054), - DOMElement: __webpack_require__(1055), - DynamicBitmapText: __webpack_require__(1056), - Extern: __webpack_require__(1057), - Graphics: __webpack_require__(1058), - Group: __webpack_require__(1059), - Image: __webpack_require__(1060), - Particles: __webpack_require__(1061), - PathFollower: __webpack_require__(1062), - RenderTexture: __webpack_require__(1063), - Rope: __webpack_require__(1064), - Sprite: __webpack_require__(1065), - StaticBitmapText: __webpack_require__(1066), - Text: __webpack_require__(1067), - TileSprite: __webpack_require__(1068), - Zone: __webpack_require__(1069), - Video: __webpack_require__(1070), + Blitter: __webpack_require__(1113), + Container: __webpack_require__(1114), + DOMElement: __webpack_require__(1115), + DynamicBitmapText: __webpack_require__(1116), + Extern: __webpack_require__(1117), + Graphics: __webpack_require__(1118), + Group: __webpack_require__(1119), + Image: __webpack_require__(1120), + Layer: __webpack_require__(1121), + Particles: __webpack_require__(1122), + PathFollower: __webpack_require__(1123), + RenderTexture: __webpack_require__(1124), + Rope: __webpack_require__(1125), + Sprite: __webpack_require__(1126), + StaticBitmapText: __webpack_require__(1127), + Text: __webpack_require__(1128), + TileSprite: __webpack_require__(1129), + Zone: __webpack_require__(1130), + Video: __webpack_require__(1131), // Shapes - Arc: __webpack_require__(1071), - Curve: __webpack_require__(1072), - Ellipse: __webpack_require__(1073), - Grid: __webpack_require__(1074), - IsoBox: __webpack_require__(1075), - IsoTriangle: __webpack_require__(1076), - Line: __webpack_require__(1077), - Polygon: __webpack_require__(1078), - Rectangle: __webpack_require__(1079), - Star: __webpack_require__(1080), - Triangle: __webpack_require__(1081) + Arc: __webpack_require__(1132), + Curve: __webpack_require__(1133), + Ellipse: __webpack_require__(1134), + Grid: __webpack_require__(1135), + IsoBox: __webpack_require__(1136), + IsoTriangle: __webpack_require__(1137), + Line: __webpack_require__(1138), + Polygon: __webpack_require__(1139), + Rectangle: __webpack_require__(1140), + Star: __webpack_require__(1141), + Triangle: __webpack_require__(1142) }, Creators: { - Blitter: __webpack_require__(1082), - Container: __webpack_require__(1083), - DynamicBitmapText: __webpack_require__(1084), - Graphics: __webpack_require__(1085), - Group: __webpack_require__(1086), - Image: __webpack_require__(1087), - Particles: __webpack_require__(1088), - RenderTexture: __webpack_require__(1089), - Rope: __webpack_require__(1090), - Sprite: __webpack_require__(1091), - StaticBitmapText: __webpack_require__(1092), - Text: __webpack_require__(1093), - TileSprite: __webpack_require__(1094), - Zone: __webpack_require__(1095), - Video: __webpack_require__(1096) + Blitter: __webpack_require__(1143), + Container: __webpack_require__(1144), + DynamicBitmapText: __webpack_require__(1145), + Graphics: __webpack_require__(1146), + Group: __webpack_require__(1147), + Image: __webpack_require__(1148), + Layer: __webpack_require__(1149), + Particles: __webpack_require__(1150), + RenderTexture: __webpack_require__(1151), + Rope: __webpack_require__(1152), + Sprite: __webpack_require__(1153), + StaticBitmapText: __webpack_require__(1154), + Text: __webpack_require__(1155), + TileSprite: __webpack_require__(1156), + Zone: __webpack_require__(1157), + Video: __webpack_require__(1158) } }; @@ -152955,28 +161810,25 @@ var GameObjects = { if (true) { // WebGL only Game Objects - GameObjects.Mesh = __webpack_require__(142); - GameObjects.Quad = __webpack_require__(214); - GameObjects.Shader = __webpack_require__(215); + GameObjects.Shader = __webpack_require__(220); + GameObjects.Mesh = __webpack_require__(221); - GameObjects.Factories.Mesh = __webpack_require__(1103); - GameObjects.Factories.Quad = __webpack_require__(1104); - GameObjects.Factories.Shader = __webpack_require__(1105); + GameObjects.Factories.Shader = __webpack_require__(1165); + GameObjects.Factories.Mesh = __webpack_require__(1166); - GameObjects.Creators.Mesh = __webpack_require__(1106); - GameObjects.Creators.Quad = __webpack_require__(1107); - GameObjects.Creators.Shader = __webpack_require__(1108); + GameObjects.Creators.Shader = __webpack_require__(1167); + GameObjects.Creators.Mesh = __webpack_require__(1168); - GameObjects.Light = __webpack_require__(446); - GameObjects.LightsManager = __webpack_require__(447); - GameObjects.LightsPlugin = __webpack_require__(1109); + GameObjects.Light = __webpack_require__(458); + GameObjects.LightsManager = __webpack_require__(459); + GameObjects.LightsPlugin = __webpack_require__(1170); } module.exports = GameObjects; /***/ }), -/* 941 */ +/* 997 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -152986,11 +161838,11 @@ module.exports = GameObjects; */ var Class = __webpack_require__(0); -var List = __webpack_require__(137); -var PluginCache = __webpack_require__(23); -var GameObjectEvents = __webpack_require__(29); +var List = __webpack_require__(105); +var PluginCache = __webpack_require__(25); +var GameObjectEvents = __webpack_require__(32); var SceneEvents = __webpack_require__(20); -var StableSort = __webpack_require__(139); +var StableSort = __webpack_require__(90); /** * @classdesc @@ -153091,6 +161943,15 @@ var DisplayList = new Class({ { gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + if (gameObject.displayList) + { + gameObject.displayList.remove(gameObject); + } + + gameObject.displayList = this; + + this.queueDepthSort(); + this.events.emit(SceneEvents.ADDED_TO_SCENE, gameObject, this.scene); }, @@ -153109,6 +161970,10 @@ var DisplayList = new Class({ { gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.displayList = null; + + this.queueDepthSort(); + this.events.emit(SceneEvents.REMOVED_FROM_SCENE, gameObject, this.scene); }, @@ -153162,7 +162027,7 @@ var DisplayList = new Class({ * @param {Phaser.GameObjects.GameObject} childA - The first Game Object. * @param {Phaser.GameObjects.GameObject} childB - The second Game Object. * - * @return {integer} The difference between the depths of each Game Object. + * @return {number} The difference between the depths of each Game Object. */ sortByDepth: function (childA, childB) { @@ -153234,7 +162099,7 @@ module.exports = DisplayList; /***/ }), -/* 942 */ +/* 998 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153249,21 +162114,22 @@ module.exports = DisplayList; module.exports = { - CheckMatrix: __webpack_require__(195), - MatrixToString: __webpack_require__(943), - ReverseColumns: __webpack_require__(944), - ReverseRows: __webpack_require__(945), - Rotate180: __webpack_require__(946), - RotateLeft: __webpack_require__(947), - RotateMatrix: __webpack_require__(138), - RotateRight: __webpack_require__(948), - TransposeMatrix: __webpack_require__(402) + CheckMatrix: __webpack_require__(200), + MatrixToString: __webpack_require__(999), + ReverseColumns: __webpack_require__(1000), + ReverseRows: __webpack_require__(1001), + Rotate180: __webpack_require__(1002), + RotateLeft: __webpack_require__(1003), + RotateMatrix: __webpack_require__(143), + RotateRight: __webpack_require__(1004), + Translate: __webpack_require__(1005), + TransposeMatrix: __webpack_require__(412) }; /***/ }), -/* 943 */ +/* 999 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153272,12 +162138,26 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(173); -var CheckMatrix = __webpack_require__(195); +var Pad = __webpack_require__(178); +var CheckMatrix = __webpack_require__(200); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * @@ -153344,7 +162224,7 @@ module.exports = MatrixToString; /***/ }), -/* 944 */ +/* 1000 */ /***/ (function(module, exports) { /** @@ -153356,6 +162236,20 @@ module.exports = MatrixToString; /** * Reverses the columns in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * @@ -153375,7 +162269,7 @@ module.exports = ReverseColumns; /***/ }), -/* 945 */ +/* 1001 */ /***/ (function(module, exports) { /** @@ -153387,6 +162281,20 @@ module.exports = ReverseColumns; /** * Reverses the rows in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseRows * @since 3.0.0 * @@ -153411,7 +162319,7 @@ module.exports = ReverseRows; /***/ }), -/* 946 */ +/* 1002 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153420,11 +162328,25 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(138); +var RotateMatrix = __webpack_require__(143); /** * Rotates the array matrix 180 degrees. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.Rotate180 * @since 3.0.0 * @@ -153444,7 +162366,7 @@ module.exports = Rotate180; /***/ }), -/* 947 */ +/* 1003 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153453,11 +162375,25 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(138); +var RotateMatrix = __webpack_require__(143); /** * Rotates the array matrix to the left (or 90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateLeft * @since 3.0.0 * @@ -153477,7 +162413,7 @@ module.exports = RotateLeft; /***/ }), -/* 948 */ +/* 1004 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153486,11 +162422,25 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(138); +var RotateMatrix = __webpack_require__(143); /** * Rotates the array matrix to the left (or -90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateRight * @since 3.0.0 * @@ -153510,7 +162460,96 @@ module.exports = RotateRight; /***/ }), -/* 949 */ +/* 1005 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(170); +var RotateRight = __webpack_require__(171); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), +/* 1006 */ /***/ (function(module, exports) { /** @@ -153536,7 +162575,7 @@ module.exports = RotateRight; * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -153627,7 +162666,7 @@ module.exports = Add; /***/ }), -/* 950 */ +/* 1007 */ /***/ (function(module, exports) { /** @@ -153655,8 +162694,8 @@ module.exports = Add; * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. - * @param {integer} [index=0] - The index in the array where the item will be inserted. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [index=0] - The index in the array where the item will be inserted. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -153749,7 +162788,7 @@ module.exports = AddAt; /***/ }), -/* 951 */ +/* 1008 */ /***/ (function(module, exports) { /** @@ -153787,7 +162826,7 @@ module.exports = BringToTop; /***/ }), -/* 952 */ +/* 1009 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153796,7 +162835,7 @@ module.exports = BringToTop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Returns the total number of elements in the array which have a property matching the given value. @@ -153807,10 +162846,10 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} property - The property to test on each array element. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * - * @return {integer} The total number of elements with properties matching the given value. + * @return {number} The total number of elements with properties matching the given value. */ var CountAllMatching = function (array, property, value, startIndex, endIndex) { @@ -153839,7 +162878,7 @@ module.exports = CountAllMatching; /***/ }), -/* 953 */ +/* 1010 */ /***/ (function(module, exports) { /** @@ -153885,7 +162924,7 @@ module.exports = Each; /***/ }), -/* 954 */ +/* 1011 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -153894,7 +162933,7 @@ module.exports = Each; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Passes each element in the array, between the start and end indexes, to the given callback. @@ -153905,8 +162944,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {function} callback - A callback to be invoked for each item in the array. * @param {object} context - The context in which the callback is invoked. - * @param {integer} startIndex - The start index to search from. - * @param {integer} endIndex - The end index to search to. + * @param {number} startIndex - The start index to search from. + * @param {number} endIndex - The end index to search to. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. * * @return {array} The input array. @@ -153941,7 +162980,7 @@ module.exports = EachInRange; /***/ }), -/* 955 */ +/* 1012 */ /***/ (function(module, exports) { /** @@ -153983,7 +163022,7 @@ module.exports = MoveDown; /***/ }), -/* 956 */ +/* 1013 */ /***/ (function(module, exports) { /** @@ -154001,7 +163040,7 @@ module.exports = MoveDown; * * @param {array} array - The array. * @param {*} item - The element to move. - * @param {integer} index - The new index that the element will be moved to. + * @param {number} index - The new index that the element will be moved to. * * @return {*} The element that was moved. */ @@ -154030,7 +163069,7 @@ module.exports = MoveTo; /***/ }), -/* 957 */ +/* 1014 */ /***/ (function(module, exports) { /** @@ -154072,7 +163111,7 @@ module.exports = MoveUp; /***/ }), -/* 958 */ +/* 1015 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154081,7 +163120,7 @@ module.exports = MoveUp; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RoundAwayFromZero = __webpack_require__(345); +var RoundAwayFromZero = __webpack_require__(355); /** * Create an array of numbers (positive and/or negative) progressing from `start` @@ -154149,7 +163188,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 959 */ +/* 1016 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154158,7 +163197,7 @@ module.exports = NumberArrayStep; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(82); +var SpliceOne = __webpack_require__(103); /** * Removes the item from the given position in the array. @@ -154171,7 +163210,7 @@ var SpliceOne = __webpack_require__(82); * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -154200,7 +163239,7 @@ module.exports = RemoveAt; /***/ }), -/* 960 */ +/* 1017 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154209,7 +163248,7 @@ module.exports = RemoveAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Removes the item within the given range in the array. @@ -154222,8 +163261,8 @@ var SafeRange = __webpack_require__(70); * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} startIndex - The start index to remove from. - * @param {integer} endIndex - The end index to remove to. + * @param {number} startIndex - The start index to remove from. + * @param {number} endIndex - The end index to remove to. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -154263,7 +163302,7 @@ module.exports = RemoveBetween; /***/ }), -/* 961 */ +/* 1018 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154272,7 +163311,7 @@ module.exports = RemoveBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(82); +var SpliceOne = __webpack_require__(103); /** * Removes a random object from the given array and returns it. @@ -154282,8 +163321,8 @@ var SpliceOne = __webpack_require__(82); * @since 3.0.0 * * @param {array} array - The array to removed a random element from. - * @param {integer} [start=0] - The array index to start the search from. - * @param {integer} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * @param {number} [start=0] - The array index to start the search from. + * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. * * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. */ @@ -154301,7 +163340,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 962 */ +/* 1019 */ /***/ (function(module, exports) { /** @@ -154345,7 +163384,7 @@ module.exports = Replace; /***/ }), -/* 963 */ +/* 1020 */ /***/ (function(module, exports) { /** @@ -154383,7 +163422,7 @@ module.exports = SendToBack; /***/ }), -/* 964 */ +/* 1021 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154392,7 +163431,7 @@ module.exports = SendToBack; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SafeRange = __webpack_require__(70); +var SafeRange = __webpack_require__(77); /** * Scans the array for elements with the given property. If found, the property is set to the `value`. @@ -154408,8 +163447,8 @@ var SafeRange = __webpack_require__(70); * @param {array} array - The array to search. * @param {string} property - The property to test for on each array element. * @param {*} value - The value to set the property to. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} The input array. */ @@ -154438,7 +163477,7 @@ module.exports = SetAll; /***/ }), -/* 965 */ +/* 1022 */ /***/ (function(module, exports) { /** @@ -154486,7 +163525,7 @@ module.exports = Swap; /***/ }), -/* 966 */ +/* 1023 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -154496,8 +163535,8 @@ module.exports = Swap; */ var Class = __webpack_require__(0); -var ProcessQueue = __webpack_require__(197); -var PluginCache = __webpack_require__(23); +var ProcessQueue = __webpack_require__(202); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -154581,7 +163620,7 @@ var UpdateList = new Class({ * The total number of items awaiting processing. * * @name Phaser.GameObjects.UpdateList#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -154778,7 +163817,7 @@ var UpdateList = new Class({ * The number of entries in the active list. * * @name Phaser.GameObjects.UpdateList#length - * @type {integer} + * @type {number} * @readonly * @since 3.20.0 */ @@ -154790,7 +163829,7 @@ module.exports = UpdateList; /***/ }), -/* 967 */ +/* 1024 */ /***/ (function(module, exports) { /** @@ -154817,7 +163856,7 @@ module.exports = 'add'; /***/ }), -/* 968 */ +/* 1025 */ /***/ (function(module, exports) { /** @@ -154844,7 +163883,7 @@ module.exports = 'remove'; /***/ }), -/* 969 */ +/* 1026 */ /***/ (function(module, exports) { /** @@ -155366,7 +164405,7 @@ module.exports = GetBitmapTextSize; /***/ }), -/* 970 */ +/* 1027 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155375,7 +164414,7 @@ module.exports = GetBitmapTextSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ParseXMLBitmapFont = __webpack_require__(198); +var ParseXMLBitmapFont = __webpack_require__(203); /** * Parse an XML Bitmap Font from an Atlas. @@ -155391,8 +164430,8 @@ var ParseXMLBitmapFont = __webpack_require__(198); * @param {string} textureKey - The key of the BitmapFont's texture. * @param {string} frameKey - The key of the BitmapFont texture's frame. * @param {string} xmlKey - The key of the XML data of the font to parse. - * @param {integer} [xSpacing] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing] - The y-axis spacing to add to the line height. * * @return {boolean} Whether the parsing was successful or not. */ @@ -155420,7 +164459,7 @@ module.exports = ParseFromAtlas; /***/ }), -/* 971 */ +/* 1028 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155434,12 +164473,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(972); + renderWebGL = __webpack_require__(1029); } if (true) { - renderCanvas = __webpack_require__(974); + renderCanvas = __webpack_require__(1031); } module.exports = { @@ -155451,7 +164490,7 @@ module.exports = { /***/ }), -/* 972 */ +/* 1029 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155460,8 +164499,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BatchChar = __webpack_require__(973); -var Utils = __webpack_require__(10); +var BatchChar = __webpack_require__(1030); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -155474,11 +164514,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BitmapTextWebGLRenderer = function (renderer, src, camera, parentMatrix) { var text = src._text; var textLength = text.length; @@ -155488,36 +164527,9 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; var roundPixels = camera.roundPixels; @@ -155525,12 +164537,12 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, var charColors = src.charColors; - var tintEffect = (src._isTinted && src.tintFill); + var tintEffect = src.tintFill; - var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, cameraAlpha * src._alphaTL); - var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, cameraAlpha * src._alphaTR); - var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, cameraAlpha * src._alphaBL); - var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, cameraAlpha * src._alphaBR); + var tintTL = Utils.getTintAppendFloatAlpha(src.tintTopLeft, cameraAlpha * src._alphaTL); + var tintTR = Utils.getTintAppendFloatAlpha(src.tintTopRight, cameraAlpha * src._alphaTR); + var tintBL = Utils.getTintAppendFloatAlpha(src.tintBottomLeft, cameraAlpha * src._alphaBL); + var tintBR = Utils.getTintAppendFloatAlpha(src.tintBottomRight, cameraAlpha * src._alphaBR); var texture = src.frame.glTexture; var textureUnit = pipeline.setGameObject(src); @@ -155549,6 +164561,8 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, var dropShadow = (dropShadowX !== 0 || dropShadowY !== 0); + renderer.pipelines.preBatch(src); + if (dropShadow) { var srcShadowColor = src._dropShadowColorGL; @@ -155603,13 +164617,15 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, // Debug test if the characters are in the correct place when rendered: // pipeline.drawFillRect(tx0, ty0, tx2 - tx0, ty2 - ty0, 0x00ff00, 0.5); } + + renderer.pipelines.postBatch(src); }; module.exports = BitmapTextWebGLRenderer; /***/ }), -/* 973 */ +/* 1030 */ /***/ (function(module, exports) { /** @@ -155661,14 +164677,14 @@ var BatchChar = function (pipeline, src, char, glyph, offsetX, offsetY, calcMatr var tx3 = calcMatrix.getXRound(xw, y, roundPixels); var ty3 = calcMatrix.getYRound(xw, y, roundPixels); - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, glyph.u0, glyph.v0, glyph.u1, glyph.v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + pipeline.batchQuad(src, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, glyph.u0, glyph.v0, glyph.u1, glyph.v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); }; module.exports = BatchChar; /***/ }), -/* 974 */ +/* 1031 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155677,7 +164693,7 @@ module.exports = BatchChar; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(28); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -155690,11 +164706,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.BitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BitmapTextCanvasRenderer = function (renderer, src, camera, parentMatrix) { var text = src._text; var textLength = text.length; @@ -155705,7 +164720,7 @@ var BitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, { return; } - + var textureFrame = src.frame; var chars = src.fontData.chars; @@ -155850,7 +164865,7 @@ module.exports = BitmapTextCanvasRenderer; /***/ }), -/* 975 */ +/* 1032 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155864,12 +164879,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(976); + renderWebGL = __webpack_require__(1033); } if (true) { - renderCanvas = __webpack_require__(977); + renderCanvas = __webpack_require__(1034); } module.exports = { @@ -155881,7 +164896,7 @@ module.exports = { /***/ }), -/* 976 */ +/* 1033 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -155890,7 +164905,10 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); + +var tempMatrix = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -155903,11 +164921,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix) { var list = src.getRenderList(); @@ -155921,9 +164938,7 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam var cameraScrollX = camera.scrollX * src.scrollFactorX; var cameraScrollY = camera.scrollY * src.scrollFactorY; - var calcMatrix = pipeline._tempMatrix1; - - calcMatrix.copyFrom(camera.matrix); + var calcMatrix = tempMatrix.copyFrom(camera.matrix); if (parentMatrix) { @@ -155940,6 +164955,8 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam var alpha = camera.alpha * src.alpha; var roundPixels = camera.roundPixels; + renderer.pipelines.preBatch(src); + for (var index = 0; index < list.length; index++) { var bob = list[index]; @@ -155998,18 +165015,20 @@ var BlitterWebGLRenderer = function (renderer, src, interpolationPercentage, cam } // TL x/y, BL x/y, BR x/y, TR x/y - if (pipeline.batchQuad(tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit)) + if (pipeline.batchQuad(src, tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit)) { prevTextureSourceIndex = -1; } } + + renderer.pipelines.postBatch(src); }; module.exports = BlitterWebGLRenderer; /***/ }), -/* 977 */ +/* 1034 */ /***/ (function(module, exports) { /** @@ -156029,11 +165048,10 @@ module.exports = BlitterWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Blitter} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var BlitterCanvasRenderer = function (renderer, src, camera, parentMatrix) { var list = src.getRenderList(); @@ -156089,7 +165107,7 @@ var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, ca } ctx.globalAlpha = bobAlpha; - + if (!flip) { if (roundPixels) @@ -156131,7 +165149,7 @@ var BlitterCanvasRenderer = function (renderer, src, interpolationPercentage, ca ctx.restore(); } } - + ctx.restore(); }; @@ -156139,7 +165157,7 @@ module.exports = BlitterCanvasRenderer; /***/ }), -/* 978 */ +/* 1035 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156154,12 +165172,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(979); + renderWebGL = __webpack_require__(1036); } if (true) { - renderCanvas = __webpack_require__(980); + renderCanvas = __webpack_require__(1037); } module.exports = { @@ -156171,7 +165189,7 @@ module.exports = { /***/ }), -/* 979 */ +/* 1036 */ /***/ (function(module, exports) { /** @@ -156192,21 +165210,21 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; + var childCount = children.length; - if (children.length === 0) + if (childCount === 0) { return; } var transformMatrix = container.localTransform; - + if (parentMatrix) { transformMatrix.loadIdentity(); @@ -156220,6 +165238,8 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } + renderer.pipelines.preBatch(container); + var containerHasBlendMode = (container.blendMode !== -1); if (!containerHasBlendMode) @@ -156233,9 +165253,6 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent var scrollFactorX = container.scrollFactorX; var scrollFactorY = container.scrollFactorY; - var list = children; - var childCount = children.length; - for (var i = 0; i < childCount; i++) { var child = children[i]; @@ -156291,7 +165308,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent renderer.currentType = type; } - renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false; + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; // Set parent values child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); @@ -156299,7 +165316,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix); // Restore original values @@ -156314,13 +165331,15 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent renderer.newType = false; } + + renderer.pipelines.postBatch(container); }; module.exports = ContainerWebGLRenderer; /***/ }), -/* 980 */ +/* 1037 */ /***/ (function(module, exports) { /** @@ -156341,11 +165360,10 @@ module.exports = ContainerWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -156410,7 +165428,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); @@ -156427,7 +165445,7 @@ module.exports = ContainerCanvasRenderer; /***/ }), -/* 981 */ +/* 1038 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156441,12 +165459,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(410); + renderWebGL = __webpack_require__(420); } if (true) { - renderCanvas = __webpack_require__(410); + renderCanvas = __webpack_require__(420); } module.exports = { @@ -156458,7 +165476,7 @@ module.exports = { /***/ }), -/* 982 */ +/* 1039 */ /***/ (function(module, exports) { /** @@ -156500,7 +165518,7 @@ module.exports = [ /***/ }), -/* 983 */ +/* 1040 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156514,12 +165532,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(984); + renderWebGL = __webpack_require__(1041); } if (true) { - renderCanvas = __webpack_require__(985); + renderCanvas = __webpack_require__(1042); } module.exports = { @@ -156531,7 +165549,7 @@ module.exports = { /***/ }), -/* 984 */ +/* 1041 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156540,8 +165558,11 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); -var GetColorFromValue = __webpack_require__(119); +var GetCalcMatrix = __webpack_require__(21); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); + +var tempMatrix = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -156554,11 +165575,10 @@ var GetColorFromValue = __webpack_require__(119); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatrix) { var text = src.text; var textLength = text.length; @@ -156568,37 +165588,14 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - var fontMatrix = pipeline._tempMatrix4; + var result = GetCalcMatrix(src, camera, parentMatrix); - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + var spriteMatrix = result.sprite; + var calcMatrix = result.calc; - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var fontMatrix = tempMatrix; var crop = (src.cropWidth > 0 || src.cropHeight > 0); @@ -156616,16 +165613,12 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var frame = src.frame; var texture = frame.glTexture; - var textureX = frame.cutX; - var textureY = frame.cutY; - var textureWidth = texture.width; - var textureHeight = texture.height; - var tintEffect = (src._isTinted && src.tintFill); - var tintTL = Utils.getTintAppendFloatAlpha(src._tintTL, camera.alpha * src._alphaTL); - var tintTR = Utils.getTintAppendFloatAlpha(src._tintTR, camera.alpha * src._alphaTR); - var tintBL = Utils.getTintAppendFloatAlpha(src._tintBL, camera.alpha * src._alphaBL); - var tintBR = Utils.getTintAppendFloatAlpha(src._tintBR, camera.alpha * src._alphaBR); + var tintEffect = src.tintFill; + var tintTL = Utils.getTintAppendFloatAlpha(src.tintTopLeft, camera.alpha * src._alphaTL); + var tintTR = Utils.getTintAppendFloatAlpha(src.tintTopRight, camera.alpha * src._alphaTR); + var tintBL = Utils.getTintAppendFloatAlpha(src.tintBottomLeft, camera.alpha * src._alphaBL); + var tintBR = Utils.getTintAppendFloatAlpha(src.tintBottomRight, camera.alpha * src._alphaBR); var textureUnit = pipeline.setGameObject(src); @@ -156635,8 +165628,6 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var lastCharCode = 0; var letterSpacing = src.letterSpacing; var glyph; - var glyphX = 0; - var glyphY = 0; var glyphW = 0; var glyphH = 0; var lastGlyph; @@ -156654,7 +165645,14 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var lineOffsetX = 0; // Update the bounds - skipped internally if not dirty - src.getTextBounds(false); + var bounds = src.getTextBounds(false); + + // In case the method above changed it (word wrapping) + if (src.maxWidth > 0) + { + text = bounds.wrappedText; + textLength = text.length; + } var lineData = src._bounds.lines; @@ -156671,6 +165669,8 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce var displayCallback = src.displayCallback; var callbackData = src.callbackData; + renderer.pipelines.preBatch(src); + for (var i = 0; i < textLength; i++) { charCode = text.charCodeAt(i); @@ -156703,9 +165703,6 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce continue; } - glyphX = textureX + glyph.x; - glyphY = textureY + glyph.y; - glyphW = glyph.width; glyphH = glyph.height; @@ -156768,10 +165765,10 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce tintBR = output.tint.bottomRight; } - tintTL = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintTL), camera.alpha * src._alphaTL); - tintTR = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintTR), camera.alpha * src._alphaTR); - tintBL = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintBL), camera.alpha * src._alphaBL); - tintBR = Utils.getTintAppendFloatAlpha(GetColorFromValue(tintBR), camera.alpha * src._alphaBR); + tintTL = Utils.getTintAppendFloatAlpha(tintTL, camera.alpha * src._alphaTL); + tintTR = Utils.getTintAppendFloatAlpha(tintTR, camera.alpha * src._alphaTR); + tintBL = Utils.getTintAppendFloatAlpha(tintBL, camera.alpha * src._alphaBL); + tintBR = Utils.getTintAppendFloatAlpha(tintBR, camera.alpha * src._alphaBR); } x *= scale; @@ -156786,10 +165783,10 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce calcMatrix.multiply(fontMatrix, spriteMatrix); - var u0 = glyphX / textureWidth; - var v0 = glyphY / textureHeight; - var u1 = (glyphX + glyphW) / textureWidth; - var v1 = (glyphY + glyphH) / textureHeight; + var u0 = glyph.u0; + var v0 = glyph.v0; + var u1 = glyph.u1; + var v1 = glyph.v1; var xw = glyphW; var yh = glyphH; @@ -156821,7 +165818,7 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce ty3 = Math.round(ty3); } - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + pipeline.batchQuad(src, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); } if (crop) @@ -156830,13 +165827,15 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, interpolationPerce renderer.popScissor(); } + + renderer.pipelines.postBatch(src); }; module.exports = DynamicBitmapTextWebGLRenderer; /***/ }), -/* 985 */ +/* 1042 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -156845,7 +165844,7 @@ module.exports = DynamicBitmapTextWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTransform = __webpack_require__(28); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -156858,11 +165857,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.DynamicBitmapText} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var DynamicBitmapTextCanvasRenderer = function (renderer, src, camera, parentMatrix) { var text = src._text; var textLength = text.length; @@ -156873,7 +165871,7 @@ var DynamicBitmapTextCanvasRenderer = function (renderer, src, interpolationPerc { return; } - + var textureFrame = src.frame; var displayCallback = src.displayCallback; @@ -157047,7 +166045,7 @@ module.exports = DynamicBitmapTextCanvasRenderer; /***/ }), -/* 986 */ +/* 1043 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157061,12 +166059,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(987); + renderWebGL = __webpack_require__(1044); } if (true) { - renderCanvas = __webpack_require__(988); + renderCanvas = __webpack_require__(1045); } module.exports = { @@ -157078,8 +166076,8 @@ module.exports = { /***/ }), -/* 987 */ -/***/ (function(module, exports) { +/* 1044 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -157087,6 +166085,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var GetCalcMatrix = __webpack_require__(21); + /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -157098,44 +166098,15 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Extern} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ExternWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ExternWebGLRenderer = function (renderer, src, camera, parentMatrix) { renderer.pipelines.clear(); - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - // Callback src.render.call(src, renderer, camera, calcMatrix); renderer.pipelines.rebind(); @@ -157145,13 +166116,13 @@ module.exports = ExternWebGLRenderer; /***/ }), -/* 988 */ +/* 1045 */ /***/ (function(module, exports) { /***/ }), -/* 989 */ +/* 1046 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157165,15 +166136,15 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(990); + renderWebGL = __webpack_require__(1047); // Needed for Graphics.generateTexture - renderCanvas = __webpack_require__(415); + renderCanvas = __webpack_require__(425); } if (true) { - renderCanvas = __webpack_require__(415); + renderCanvas = __webpack_require__(425); } module.exports = { @@ -157185,7 +166156,7 @@ module.exports = { /***/ }), -/* 990 */ +/* 1047 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157194,10 +166165,11 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Commands = __webpack_require__(203); -var Utils = __webpack_require__(10); +var Commands = __webpack_require__(208); +var GetCalcMatrix = __webpack_require__(21); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); -// TODO: Remove the use of this var Point = function (x, y, width) { this.x = x; @@ -157205,7 +166177,6 @@ var Point = function (x, y, width) this.width = width; }; -// TODO: Remove the use of this var Path = function (x, y, width) { this.points = []; @@ -157214,6 +166185,7 @@ var Path = function (x, y, width) }; var matrixStack = []; +var tempMatrix = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -157226,49 +166198,23 @@ var matrixStack = []; * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Graphics} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (src.commandBuffer.length === 0) { return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = src._tempMatrix1; - var graphicsMatrix = src._tempMatrix2; - var currentMatrix = src._tempMatrix3; + renderer.pipelines.preBatch(src); - currentMatrix.loadIdentity(); + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - graphicsMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - graphicsMatrix.e = src.x; - graphicsMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(graphicsMatrix); - } - else - { - graphicsMatrix.e -= camera.scrollX * src.scrollFactorX; - graphicsMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(graphicsMatrix); - } + var currentMatrix = tempMatrix.loadIdentity(); var commands = src.commandBuffer; var alpha = camera.alpha * src.alpha; @@ -157287,13 +166233,10 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca var path = []; var pathIndex = 0; - var pathOpen = false; + var pathOpen = true; var lastPath = null; - var getTint = Utils.getTintAppendFloatAlphaAndSwap; - - // Set to a white texture, not a blank one, so Lights2D works too! - var currentTexture = renderer.tempTextures[0]; + var getTint = Utils.getTintAppendFloatAlpha; for (var cmdIndex = 0; cmdIndex < commands.length; cmdIndex++) { @@ -157302,14 +166245,15 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca switch (cmd) { case Commands.BEGIN_PATH: - + { path.length = 0; lastPath = null; pathOpen = true; break; + } case Commands.CLOSE_PATH: - + { pathOpen = false; if (lastPath && lastPath.points.length) @@ -157317,36 +166261,38 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca lastPath.points.push(lastPath.points[0]); } break; + } case Commands.FILL_PATH: + { for (pathIndex = 0; pathIndex < path.length; pathIndex++) { - pipeline.setTexture2D(currentTexture, src); - pipeline.batchFillPath( path[pathIndex].points, currentMatrix, - camMatrix + calcMatrix ); } break; + } case Commands.STROKE_PATH: + { for (pathIndex = 0; pathIndex < path.length; pathIndex++) { - pipeline.setTexture2D(currentTexture, src); - pipeline.batchStrokePath( path[pathIndex].points, lineWidth, pathOpen, currentMatrix, - camMatrix + calcMatrix ); } break; + } case Commands.LINE_STYLE: + { lineWidth = commands[++cmdIndex]; var strokeColor = commands[++cmdIndex]; var strokeAlpha = commands[++cmdIndex] * alpha; @@ -157356,8 +166302,10 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca strokeTint.BL = strokeTintColor; strokeTint.BR = strokeTintColor; break; + } case Commands.FILL_STYLE: + { var fillColor = commands[++cmdIndex]; var fillAlpha = commands[++cmdIndex] * alpha; var fillTintColor = getTint(fillColor, fillAlpha); @@ -157366,16 +166314,24 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca fillTint.BL = fillTintColor; fillTint.BR = fillTintColor; break; + } case Commands.GRADIENT_FILL_STYLE: - var gradientFillAlpha = commands[++cmdIndex] * alpha; - fillTint.TL = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.TR = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.BL = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.BR = getTint(commands[++cmdIndex], gradientFillAlpha); + { + var alphaTL = commands[++cmdIndex] * alpha; + var alphaTR = commands[++cmdIndex] * alpha; + var alphaBL = commands[++cmdIndex] * alpha; + var alphaBR = commands[++cmdIndex] * alpha; + + fillTint.TL = getTint(commands[++cmdIndex], alphaTL); + fillTint.TR = getTint(commands[++cmdIndex], alphaTR); + fillTint.BL = getTint(commands[++cmdIndex], alphaBL); + fillTint.BR = getTint(commands[++cmdIndex], alphaBR); break; + } case Commands.GRADIENT_LINE_STYLE: + { lineWidth = commands[++cmdIndex]; var gradientLineAlpha = commands[++cmdIndex] * alpha; strokeTint.TL = getTint(commands[++cmdIndex], gradientLineAlpha); @@ -157383,8 +166339,10 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca strokeTint.BL = getTint(commands[++cmdIndex], gradientLineAlpha); strokeTint.BR = getTint(commands[++cmdIndex], gradientLineAlpha); break; + } case Commands.ARC: + { var iteration = 0; var x = commands[++cmdIndex]; var y = commands[++cmdIndex]; @@ -157441,21 +166399,23 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca lastPath.points.push(new Point(tx, ty, lineWidth)); break; + } case Commands.FILL_RECT: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchFillRect( commands[++cmdIndex], commands[++cmdIndex], commands[++cmdIndex], commands[++cmdIndex], currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.FILL_TRIANGLE: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchFillTriangle( commands[++cmdIndex], commands[++cmdIndex], @@ -157464,12 +166424,13 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca commands[++cmdIndex], commands[++cmdIndex], currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.STROKE_TRIANGLE: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchStrokeTriangle( commands[++cmdIndex], commands[++cmdIndex], @@ -157479,11 +166440,13 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca commands[++cmdIndex], lineWidth, currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.LINE_TO: + { if (lastPath !== null) { lastPath.points.push(new Point(commands[++cmdIndex], commands[++cmdIndex], lineWidth)); @@ -157494,62 +166457,59 @@ var GraphicsWebGLRenderer = function (renderer, src, interpolationPercentage, ca path.push(lastPath); } break; + } case Commands.MOVE_TO: + { lastPath = new Path(commands[++cmdIndex], commands[++cmdIndex], lineWidth); path.push(lastPath); break; + } case Commands.SAVE: + { matrixStack.push(currentMatrix.copyToArray()); break; + } case Commands.RESTORE: + { currentMatrix.copyFromArray(matrixStack.pop()); break; + } case Commands.TRANSLATE: + { x = commands[++cmdIndex]; y = commands[++cmdIndex]; currentMatrix.translate(x, y); break; + } case Commands.SCALE: + { x = commands[++cmdIndex]; y = commands[++cmdIndex]; currentMatrix.scale(x, y); break; + } case Commands.ROTATE: + { currentMatrix.rotate(commands[++cmdIndex]); break; - - case Commands.SET_TEXTURE: - var frame = commands[++cmdIndex]; - var mode = commands[++cmdIndex]; - - pipeline.currentFrame = frame; - pipeline.setTexture2D(frame.glTexture, src); - pipeline.tintEffect = mode; - - currentTexture = frame.glTexture; - - break; - - case Commands.CLEAR_TEXTURE: - pipeline.currentFrame = renderer.blankTexture; - pipeline.tintEffect = 2; - currentTexture = renderer.tempTextures[0]; - break; + } } } + + renderer.pipelines.postBatch(src); }; module.exports = GraphicsWebGLRenderer; /***/ }), -/* 991 */ +/* 1048 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157563,12 +166523,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(992); + renderWebGL = __webpack_require__(1049); } if (true) { - renderCanvas = __webpack_require__(993); + renderCanvas = __webpack_require__(1050); } module.exports = { @@ -157580,7 +166540,7 @@ module.exports = { /***/ }), -/* 992 */ +/* 1049 */ /***/ (function(module, exports) { /** @@ -157600,11 +166560,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) { this.pipeline.batchSprite(src, camera, parentMatrix); }; @@ -157613,7 +166572,7 @@ module.exports = SpriteWebGLRenderer; /***/ }), -/* 993 */ +/* 1050 */ /***/ (function(module, exports) { /** @@ -157633,11 +166592,10 @@ module.exports = SpriteWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpriteCanvasRenderer = function (renderer, src, camera, parentMatrix) { renderer.batchSprite(src, src.frame, camera, parentMatrix); }; @@ -157646,7 +166604,7 @@ module.exports = SpriteCanvasRenderer; /***/ }), -/* 994 */ +/* 1051 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157660,12 +166618,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(995); + renderWebGL = __webpack_require__(1052); } if (true) { - renderCanvas = __webpack_require__(996); + renderCanvas = __webpack_require__(1053); } module.exports = { @@ -157677,7 +166635,7 @@ module.exports = { /***/ }), -/* 995 */ +/* 1052 */ /***/ (function(module, exports) { /** @@ -157697,11 +166655,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ImageWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ImageWebGLRenderer = function (renderer, src, camera, parentMatrix) { this.pipeline.batchSprite(src, camera, parentMatrix); }; @@ -157710,7 +166667,7 @@ module.exports = ImageWebGLRenderer; /***/ }), -/* 996 */ +/* 1053 */ /***/ (function(module, exports) { /** @@ -157730,11 +166687,10 @@ module.exports = ImageWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Image} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ImageCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ImageCanvasRenderer = function (renderer, src, camera, parentMatrix) { renderer.batchSprite(src, src.frame, camera, parentMatrix); }; @@ -157743,7 +166699,247 @@ module.exports = ImageCanvasRenderer; /***/ }), -/* 997 */ +/* 1054 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); + +if (true) +{ + renderWebGL = __webpack_require__(1055); +} + +if (true) +{ + renderCanvas = __webpack_require__(1056); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; + + +/***/ }), +/* 1055 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Layer#renderWebGL + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var LayerWebGLRenderer = function (renderer, layer, camera) +{ + var children = layer.list; + var childCount = children.length; + + if (childCount === 0) + { + return; + } + + layer.depthSort(); + + renderer.pipelines.preBatch(layer); + + var layerHasBlendMode = (layer.blendMode !== -1); + + if (!layerHasBlendMode) + { + // If Layer is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = layer.alpha; + + for (var i = 0; i < childCount; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlphaTopLeft; + var childAlphaTopRight; + var childAlphaBottomLeft; + var childAlphaBottomRight; + + if (child.alphaTopLeft !== undefined) + { + childAlphaTopLeft = child.alphaTopLeft; + childAlphaTopRight = child.alphaTopRight; + childAlphaBottomLeft = child.alphaBottomLeft; + childAlphaBottomRight = child.alphaBottomRight; + } + else + { + var childAlpha = child.alpha; + + childAlphaTopLeft = childAlpha; + childAlphaTopRight = childAlpha; + childAlphaBottomLeft = childAlpha; + childAlphaBottomRight = childAlpha; + } + + if (!layerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Layer doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + var mask = child.mask; + + if (mask) + { + mask.preRenderWebGL(renderer, child, camera); + } + + var type = child.type; + + if (type !== renderer.currentType) + { + renderer.newType = true; + renderer.currentType = type; + } + + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; + + child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); + + // Render + child.renderWebGL(renderer, child, camera); + + // Restore original values + child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight); + + if (mask) + { + mask.postRenderWebGL(renderer, camera); + } + + renderer.newType = false; + } + + renderer.pipelines.postBatch(layer); +}; + +module.exports = LayerWebGLRenderer; + + +/***/ }), +/* 1056 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Layer#renderCanvas + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var LayerCanvasRenderer = function (renderer, layer, camera) +{ + var children = layer.list; + + if (children.length === 0) + { + return; + } + + layer.depthSort(); + + var layerHasBlendMode = (layer.blendMode !== -1); + + if (!layerHasBlendMode) + { + // If Layer is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = layer._alpha; + + if (layer.mask) + { + layer.mask.preRenderCanvas(renderer, null, camera); + } + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child.alpha; + + if (!layerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Layer doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + // Set parent values + child.setAlpha(childAlpha * alpha); + + // Render + child.renderCanvas(renderer, child, camera); + + // Restore original values + child.setAlpha(childAlpha); + } + + if (layer.mask) + { + layer.mask.postRenderCanvas(renderer); + } +}; + +module.exports = LayerCanvasRenderer; + + +/***/ }), +/* 1057 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157758,18 +166954,18 @@ module.exports = ImageCanvasRenderer; module.exports = { - EmitterOp: __webpack_require__(416), - GravityWell: __webpack_require__(417), - Particle: __webpack_require__(418), - ParticleEmitter: __webpack_require__(419), - ParticleEmitterManager: __webpack_require__(205), - Zones: __webpack_require__(1001) + EmitterOp: __webpack_require__(426), + GravityWell: __webpack_require__(427), + Particle: __webpack_require__(428), + ParticleEmitter: __webpack_require__(429), + ParticleEmitterManager: __webpack_require__(211), + Zones: __webpack_require__(1061) }; /***/ }), -/* 998 */ +/* 1058 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157783,12 +166979,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(999); + renderWebGL = __webpack_require__(1059); } if (true) { - renderCanvas = __webpack_require__(1000); + renderCanvas = __webpack_require__(1060); } module.exports = { @@ -157800,7 +166996,7 @@ module.exports = { /***/ }), -/* 999 */ +/* 1059 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -157809,7 +167005,13 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var TransformMatrix = __webpack_require__(24); +var Utils = __webpack_require__(12); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); +var tempMatrix4 = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -157822,11 +167024,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix) +var ParticleManagerWebGLRenderer = function (renderer, emitterManager, camera, parentMatrix) { var emitters = emitterManager.emitters.list; var emittersLength = emitters.length; @@ -157836,21 +167037,34 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola return; } - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(emitterManager.pipeline); - var camMatrix = pipeline._tempMatrix1.copyFrom(camera.matrix); - var calcMatrix = pipeline._tempMatrix2; - var particleMatrix = pipeline._tempMatrix3; - var managerMatrix = pipeline._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + var camMatrix = tempMatrix1; + var calcMatrix = tempMatrix2; + var particleMatrix = tempMatrix3; + var managerMatrix = tempMatrix4; - camMatrix.multiply(managerMatrix); + if (parentMatrix) + { + managerMatrix.loadIdentity(); + managerMatrix.multiply(parentMatrix); + managerMatrix.translate(emitterManager.x, emitterManager.y); + managerMatrix.rotate(emitterManager.rotation); + managerMatrix.scale(emitterManager.scaleX, emitterManager.scaleY); + } + else + { + managerMatrix.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + } var roundPixels = camera.roundPixels; var texture = emitterManager.defaultFrame.glTexture; - var getTint = Utils.getTintAppendFloatAlphaAndSwap; + var getTint = Utils.getTintAppendFloatAlpha; var textureUnit = pipeline.setGameObject(emitterManager, emitterManager.defaultFrame); + renderer.pipelines.preBatch(emitterManager); + for (var e = 0; e < emittersLength; e++) { var emitter = emitters[e]; @@ -157862,29 +167076,19 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola continue; } - var scrollX = camera.scrollX * emitter.scrollFactorX; - var scrollY = camera.scrollY * emitter.scrollFactorY; + var followX = (emitter.follow) ? emitter.follow.x + emitter.followOffset.x : 0; + var followY = (emitter.follow) ? emitter.follow.y + emitter.followOffset.y : 0; - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY); + var scrollFactorX = emitter.scrollFactorX; + var scrollFactorY = emitter.scrollFactorY; - scrollX = 0; - scrollY = 0; - } - - if (renderer.setBlendMode(emitter.blendMode)) - { - // Rebind the texture if we've flushed - // pipeline.setTexture2D(texture, 0); - } + renderer.setBlendMode(emitter.blendMode); if (emitter.mask) { emitter.mask.preRenderWebGL(renderer, emitter, camera); - // pipeline.setTexture2D(texture, 0); + renderer.pipelines.set(emitterManager.pipeline); } var tintEffect = 0; @@ -157900,67 +167104,58 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, interpola continue; } + particleMatrix.applyITRS(particle.x, particle.y, particle.rotation, particle.scaleX, particle.scaleY); + + camMatrix.copyFrom(camera.matrix); + + camMatrix.multiplyWithOffset(managerMatrix, followX + -camera.scrollX * scrollFactorX, followY + -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + particleMatrix.e = particle.x; + particleMatrix.f = particle.y; + + // Multiply by the particle matrix, store result in calcMatrix + camMatrix.multiply(particleMatrix, calcMatrix); + var frame = particle.frame; - var x = -(frame.halfWidth); - var y = -(frame.halfHeight); + var x = -frame.halfWidth; + var y = -frame.halfHeight; var xw = x + frame.width; var yh = y + frame.height; - particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY); + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); - particleMatrix.e = particle.x - scrollX; - particleMatrix.f = particle.y - scrollY; + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); - camMatrix.multiply(particleMatrix, calcMatrix); + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); - - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); - - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); - - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - if (roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); var tint = getTint(particle.tint, alpha); - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, textureUnit); + pipeline.batchQuad(emitter, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, textureUnit); } if (emitter.mask) { emitter.mask.postRenderWebGL(renderer, camera); - - // pipeline.setTexture2D(texture, 0); } } + + renderer.pipelines.postBatch(emitterManager); }; module.exports = ParticleManagerWebGLRenderer; /***/ }), -/* 1000 */ -/***/ (function(module, exports) { +/* 1060 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -157968,6 +167163,13 @@ module.exports = ParticleManagerWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); +var tempMatrix4 = new TransformMatrix(); + /** * Renders this Game Object with the Canvas Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -157979,11 +167181,10 @@ module.exports = ParticleManagerWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Particles.ParticleEmitterManager} emitterManager - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpolationPercentage, camera, parentMatrix) +var ParticleManagerCanvasRenderer = function (renderer, emitterManager, camera, parentMatrix) { var emitters = emitterManager.emitters.list; var emittersLength = emitters.length; @@ -157993,18 +167194,26 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol return; } - var camMatrix = renderer._tempMatrix1.copyFrom(camera.matrix); - var calcMatrix = renderer._tempMatrix2; - var particleMatrix = renderer._tempMatrix3; - var managerMatrix = renderer._tempMatrix4.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + var camMatrix = tempMatrix1.copyFrom(camera.matrix); + var calcMatrix = tempMatrix2; + var particleMatrix = tempMatrix3; + var managerMatrix = tempMatrix4; - camMatrix.multiply(managerMatrix); - - var roundPixels = camera.roundPixels; + if (parentMatrix) + { + managerMatrix.loadIdentity(); + managerMatrix.multiply(parentMatrix); + managerMatrix.translate(emitterManager.x, emitterManager.y); + managerMatrix.rotate(emitterManager.rotation); + managerMatrix.scale(emitterManager.scaleX, emitterManager.scaleY); + } + else + { + managerMatrix.applyITRS(emitterManager.x, emitterManager.y, emitterManager.rotation, emitterManager.scaleX, emitterManager.scaleY); + } var ctx = renderer.currentContext; - - ctx.save(); + var roundPixels = camera.roundPixels; for (var e = 0; e < emittersLength; e++) { @@ -158017,17 +167226,13 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol continue; } - var scrollX = camera.scrollX * emitter.scrollFactorX; - var scrollY = camera.scrollY * emitter.scrollFactorY; + var followX = (emitter.follow) ? emitter.follow.x + emitter.followOffset.x : 0; + var followY = (emitter.follow) ? emitter.follow.y + emitter.followOffset.y : 0; - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -scrollX, -scrollY); + var scrollFactorX = emitter.scrollFactorX; + var scrollFactorY = emitter.scrollFactorY; - scrollX = 0; - scrollY = 0; - } + ctx.save(); ctx.globalCompositeOperation = renderer.blendModes[emitter.blendMode]; @@ -158042,24 +167247,30 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol continue; } + particleMatrix.applyITRS(particle.x, particle.y, particle.rotation, particle.scaleX, particle.scaleY); + + camMatrix.copyFrom(camera.matrix); + + camMatrix.multiplyWithOffset(managerMatrix, followX + -camera.scrollX * scrollFactorX, followY + -camera.scrollY * scrollFactorY); + + // Undo the camera scroll + particleMatrix.e = particle.x; + particleMatrix.f = particle.y; + + // Multiply by the particle matrix, store result in calcMatrix + camMatrix.multiply(particleMatrix, calcMatrix); + var frame = particle.frame; var cd = frame.canvasData; var x = -(frame.halfWidth); var y = -(frame.halfHeight); - particleMatrix.applyITRS(0, 0, particle.rotation, particle.scaleX, particle.scaleY); - - particleMatrix.e = particle.x - scrollX; - particleMatrix.f = particle.y - scrollY; - - camMatrix.multiply(particleMatrix, calcMatrix); - ctx.globalAlpha = alpha; - + ctx.save(); - calcMatrix.copyToContext(ctx); + calcMatrix.setToContext(ctx); if (roundPixels) { @@ -158073,16 +167284,16 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, interpol ctx.restore(); } - } - ctx.restore(); + ctx.restore(); + } }; module.exports = ParticleManagerCanvasRenderer; /***/ }), -/* 1001 */ +/* 1061 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158097,15 +167308,15 @@ module.exports = ParticleManagerCanvasRenderer; module.exports = { - DeathZone: __webpack_require__(420), - EdgeZone: __webpack_require__(421), - RandomZone: __webpack_require__(423) + DeathZone: __webpack_require__(430), + EdgeZone: __webpack_require__(431), + RandomZone: __webpack_require__(433) }; /***/ }), -/* 1002 */ +/* 1062 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158119,12 +167330,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1003); + renderWebGL = __webpack_require__(1063); } if (true) { - renderCanvas = __webpack_require__(1004); + renderCanvas = __webpack_require__(1064); } module.exports = { @@ -158136,7 +167347,7 @@ module.exports = { /***/ }), -/* 1003 */ +/* 1063 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158145,7 +167356,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -158158,23 +167369,28 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RenderTextureWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var frame = src.frame; - var width = frame.width; - var height = frame.height; - var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(src.pipeline, src); + var cameraAlpha = camera.alpha; - var textureUnit = pipeline.setTexture2D(frame.glTexture, src); + var renderTarget = src.renderTarget; + var width = renderTarget.width; + var height = renderTarget.height; + + var getTint = Utils.getTintAppendFloatAlpha; + + var pipeline = renderer.pipelines.set(src.pipeline); + + var textureUnit = pipeline.setTexture2D(renderTarget.texture); + + renderer.pipelines.preBatch(src); pipeline.batchTexture( src, - frame.glTexture, + renderTarget.texture, width, height, src.x, src.y, width, height, @@ -158184,24 +167400,28 @@ var RenderTextureWebGLRenderer = function (renderer, src, interpolationPercentag src.scrollFactorX, src.scrollFactorY, src.displayOriginX, src.displayOriginY, 0, 0, width, height, - getTint(src._tintTL, camera.alpha * src._alphaTL), - getTint(src._tintTR, camera.alpha * src._alphaTR), - getTint(src._tintBL, camera.alpha * src._alphaBL), - getTint(src._tintBR, camera.alpha * src._alphaBR), - (src._isTinted && src.tintFill), + getTint(src.tintTopLeft, cameraAlpha * src._alphaTL), + getTint(src.tintTopRight, cameraAlpha * src._alphaTR), + getTint(src.tintBottomLeft, cameraAlpha * src._alphaBL), + getTint(src.tintBottomRight, cameraAlpha * src._alphaBR), + src.tintFill, 0, 0, camera, parentMatrix, - false, + true, textureUnit ); + + renderer.resetTextures(); + + renderer.pipelines.postBatch(src); }; module.exports = RenderTextureWebGLRenderer; /***/ }), -/* 1004 */ +/* 1064 */ /***/ (function(module, exports) { /** @@ -158221,11 +167441,10 @@ module.exports = RenderTextureWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.RenderTexture} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RenderTextureCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RenderTextureCanvasRenderer = function (renderer, src, camera, parentMatrix) { renderer.batchSprite(src, src.frame, camera, parentMatrix); }; @@ -158234,7 +167453,7 @@ module.exports = RenderTextureCanvasRenderer; /***/ }), -/* 1005 */ +/* 1065 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158243,15 +167462,15 @@ module.exports = RenderTextureCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RETRO_FONT_CONST = __webpack_require__(1006); -var Extend = __webpack_require__(19); +var RETRO_FONT_CONST = __webpack_require__(1066); +var Extend = __webpack_require__(18); /** * @namespace Phaser.GameObjects.RetroFont * @since 3.6.0 */ -var RetroFont = { Parse: __webpack_require__(1007) }; +var RetroFont = { Parse: __webpack_require__(1067) }; // Merge in the consts RetroFont = Extend(false, RetroFont, RETRO_FONT_CONST); @@ -158260,7 +167479,7 @@ module.exports = RetroFont; /***/ }), -/* 1006 */ +/* 1066 */ /***/ (function(module, exports) { /** @@ -158376,7 +167595,7 @@ module.exports = RETRO_FONT_CONST; /***/ }), -/* 1007 */ +/* 1067 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158403,8 +167622,10 @@ var ParseRetroFont = function (scene, config) { var w = config.width; var h = config.height; + var cx = Math.floor(w / 2); var cy = Math.floor(h / 2); + var letters = GetValue(config, 'chars', ''); if (letters === '') @@ -158413,6 +167634,13 @@ var ParseRetroFont = function (scene, config) } var key = GetValue(config, 'image', ''); + + var frame = scene.sys.textures.getFrame(key); + var textureX = frame.cutX; + var textureY = frame.cutY; + var textureWidth = frame.source.width; + var textureHeight = frame.source.height; + var offsetX = GetValue(config, 'offset.x', 0); var offsetY = GetValue(config, 'offset.y', 0); var spacingX = GetValue(config, 'spacing.x', 0); @@ -158423,7 +167651,7 @@ var ParseRetroFont = function (scene, config) if (charsPerRow === null) { - charsPerRow = scene.sys.textures.getFrame(key).width / w; + charsPerRow = textureWidth / w; if (charsPerRow > letters.length) { @@ -158446,10 +167674,13 @@ var ParseRetroFont = function (scene, config) for (var i = 0; i < letters.length; i++) { - // var node = letters[i]; - var charCode = letters.charCodeAt(i); + var u0 = (textureX + x) / textureWidth; + var v0 = (textureY + y) / textureHeight; + var u1 = (textureX + x + w) / textureWidth; + var v1 = (textureY + y + h) / textureHeight; + data.chars[charCode] = { x: x, @@ -158462,7 +167693,11 @@ var ParseRetroFont = function (scene, config) yOffset: 0, xAdvance: w, data: {}, - kerning: {} + kerning: {}, + u0: u0, + v0: v0, + u1: u1, + v1: v1 }; r++; @@ -158492,7 +167727,7 @@ module.exports = ParseRetroFont; /***/ }), -/* 1008 */ +/* 1068 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158506,12 +167741,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1009); + renderWebGL = __webpack_require__(1069); } if (true) { - renderCanvas = __webpack_require__(1010); + renderCanvas = __webpack_require__(1070); } module.exports = { @@ -158523,7 +167758,7 @@ module.exports = { /***/ }), -/* 1009 */ +/* 1069 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158532,7 +167767,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -158545,49 +167781,21 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Rope} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RopeWebGLRenderer = function (renderer, src, camera, parentMatrix) { var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; var vertices = src.vertices; var uvs = src.uv; var colors = src.colors; var alphas = src.alphas; var alpha = src.alpha; - var getTint = Utils.getTintAppendFloatAlphaAndSwap; + var getTint = Utils.getTintAppendFloatAlpha; var roundPixels = camera.roundPixels; var meshVerticesLength = vertices.length; @@ -158596,12 +167804,14 @@ var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera // Because it's a triangle strip and we don't want lots of degenerate triangles joining things up pipeline.flush(); + renderer.pipelines.preBatch(src); + var textureUnit = pipeline.setGameObject(src); var vertexViewF32 = pipeline.vertexViewF32; var vertexViewU32 = pipeline.vertexViewU32; - var vertexOffset = (pipeline.vertexCount * pipeline.vertexComponentCount) - 1; + var vertexOffset = (pipeline.vertexCount * pipeline.currentShader.vertexComponentCount) - 1; var colorIndex = 0; @@ -158652,13 +167862,15 @@ var RopeWebGLRenderer = function (renderer, src, interpolationPercentage, camera } pipeline.vertexCount += vertexCount; + + renderer.pipelines.postBatch(src); }; module.exports = RopeWebGLRenderer; /***/ }), -/* 1010 */ +/* 1070 */ /***/ (function(module, exports) { /** @@ -158676,7 +167888,6 @@ module.exports = RopeWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Rope} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. */ var RopeCanvasRenderer = function () @@ -158687,7 +167898,7 @@ module.exports = RopeCanvasRenderer; /***/ }), -/* 1011 */ +/* 1071 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158701,12 +167912,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1012); + renderWebGL = __webpack_require__(1072); } if (true) { - renderCanvas = __webpack_require__(1013); + renderCanvas = __webpack_require__(1073); } module.exports = { @@ -158718,7 +167929,7 @@ module.exports = { /***/ }), -/* 1012 */ +/* 1072 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158727,7 +167938,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -158740,11 +167951,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TextWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (src.width === 0 || src.height === 0) { @@ -158755,10 +167965,12 @@ var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera var width = frame.width; var height = frame.height; var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var textureUnit = pipeline.setTexture2D(frame.glTexture, src); + renderer.pipelines.preBatch(src); + pipeline.batchTexture( src, frame.glTexture, @@ -158771,24 +167983,26 @@ var TextWebGLRenderer = function (renderer, src, interpolationPercentage, camera src.scrollFactorX, src.scrollFactorY, src.displayOriginX, src.displayOriginY, 0, 0, width, height, - getTint(src._tintTL, camera.alpha * src._alphaTL), - getTint(src._tintTR, camera.alpha * src._alphaTR), - getTint(src._tintBL, camera.alpha * src._alphaBL), - getTint(src._tintBR, camera.alpha * src._alphaBR), - (src._isTinted && src.tintFill), + getTint(src.tintTopLeft, camera.alpha * src._alphaTL), + getTint(src.tintTopRight, camera.alpha * src._alphaTR), + getTint(src.tintBottomLeft, camera.alpha * src._alphaBL), + getTint(src.tintBottomRight, camera.alpha * src._alphaBR), + src.tintFill, 0, 0, camera, parentMatrix, false, textureUnit ); + + renderer.pipelines.postBatch(src); }; module.exports = TextWebGLRenderer; /***/ }), -/* 1013 */ +/* 1073 */ /***/ (function(module, exports) { /** @@ -158808,13 +168022,12 @@ module.exports = TextWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Text} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TextCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TextCanvasRenderer = function (renderer, src, camera, parentMatrix) { - if ((src.width === 0) || (src.height === 0)) + if (src.width === 0 || src.height === 0) { return; } @@ -158826,7 +168039,7 @@ module.exports = TextCanvasRenderer; /***/ }), -/* 1014 */ +/* 1074 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158840,12 +168053,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1015); + renderWebGL = __webpack_require__(1075); } if (true) { - renderCanvas = __webpack_require__(1016); + renderCanvas = __webpack_require__(1076); } module.exports = { @@ -158857,7 +168070,7 @@ module.exports = { /***/ }), -/* 1015 */ +/* 1075 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158866,7 +168079,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -158879,11 +168092,10 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TileSpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) { src.updateCanvas(); @@ -158894,9 +168106,11 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, return; } + renderer.pipelines.preBatch(src); + var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var textureUnit = pipeline.setTexture2D(src.fillPattern, src); @@ -158912,11 +168126,11 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, src.scrollFactorX, src.scrollFactorY, src.originX * width, src.originY * height, 0, 0, width, height, - getTint(src._tintTL, camera.alpha * src._alphaTL), - getTint(src._tintTR, camera.alpha * src._alphaTR), - getTint(src._tintBL, camera.alpha * src._alphaBL), - getTint(src._tintBR, camera.alpha * src._alphaBR), - (src._isTinted && src.tintFill), + getTint(src.tintTopLeft, camera.alpha * src._alphaTL), + getTint(src.tintTopRight, camera.alpha * src._alphaTR), + getTint(src.tintBottomLeft, camera.alpha * src._alphaBL), + getTint(src.tintBottomRight, camera.alpha * src._alphaBR), + src.tintFill, (src.tilePositionX % src.displayFrame.width) / src.displayFrame.width, (src.tilePositionY % src.displayFrame.height) / src.displayFrame.height, camera, @@ -158924,13 +168138,15 @@ var TileSpriteWebGLRenderer = function (renderer, src, interpolationPercentage, false, textureUnit ); + + renderer.pipelines.postBatch(src); }; module.exports = TileSpriteWebGLRenderer; /***/ }), -/* 1016 */ +/* 1076 */ /***/ (function(module, exports) { /** @@ -158950,11 +168166,10 @@ module.exports = TileSpriteWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.TileSprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TileSpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TileSpriteCanvasRenderer = function (renderer, src, camera, parentMatrix) { src.updateCanvas(); @@ -158965,7 +168180,7 @@ module.exports = TileSpriteCanvasRenderer; /***/ }), -/* 1017 */ +/* 1077 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -158979,12 +168194,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1018); + renderWebGL = __webpack_require__(1078); } if (true) { - renderCanvas = __webpack_require__(1019); + renderCanvas = __webpack_require__(1079); } module.exports = { @@ -158996,7 +168211,7 @@ module.exports = { /***/ }), -/* 1018 */ +/* 1078 */ /***/ (function(module, exports) { /** @@ -159016,15 +168231,14 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Video} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var VideoWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var VideoWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (src.videoTexture) { - this.pipeline.batchSprite(src, camera, parentMatrix); + src.pipeline.batchSprite(src, camera, parentMatrix); } }; @@ -159032,7 +168246,7 @@ module.exports = VideoWebGLRenderer; /***/ }), -/* 1019 */ +/* 1079 */ /***/ (function(module, exports) { /** @@ -159052,11 +168266,10 @@ module.exports = VideoWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Video} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var VideoCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var VideoCanvasRenderer = function (renderer, src, camera, parentMatrix) { if (src.videoTexture) { @@ -159068,7 +168281,7 @@ module.exports = VideoCanvasRenderer; /***/ }), -/* 1020 */ +/* 1080 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159082,12 +168295,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1021); + renderWebGL = __webpack_require__(1081); } if (true) { - renderCanvas = __webpack_require__(1022); + renderCanvas = __webpack_require__(1082); } module.exports = { @@ -159099,7 +168312,7 @@ module.exports = { /***/ }), -/* 1021 */ +/* 1081 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159108,8 +168321,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var GetCalcMatrix = __webpack_require__(21); +var FillPathWebGL = __webpack_require__(109); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -159122,44 +168336,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ArcWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ArcWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -159169,13 +168363,15 @@ var ArcWebGLRenderer = function (renderer, src, interpolationPercentage, camera, { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = ArcWebGLRenderer; /***/ }), -/* 1022 */ +/* 1082 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159184,10 +168380,10 @@ module.exports = ArcWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(41); -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var DegToRad = __webpack_require__(34); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -159200,11 +168396,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Arc} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ArcCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ArcCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -159251,7 +168446,7 @@ module.exports = ArcCanvasRenderer; /***/ }), -/* 1023 */ +/* 1083 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159265,12 +168460,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1024); + renderWebGL = __webpack_require__(1084); } if (true) { - renderCanvas = __webpack_require__(1025); + renderCanvas = __webpack_require__(1085); } module.exports = { @@ -159282,7 +168477,7 @@ module.exports = { /***/ }), -/* 1024 */ +/* 1084 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159291,8 +168486,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -159305,44 +168501,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var CurveWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var CurveWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX + src._curveBounds.x; var dy = src._displayOriginY + src._curveBounds.y; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -159352,13 +168528,15 @@ var CurveWebGLRenderer = function (renderer, src, interpolationPercentage, camer { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = CurveWebGLRenderer; /***/ }), -/* 1025 */ +/* 1085 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159367,9 +168545,9 @@ module.exports = CurveWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -159382,11 +168560,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Curve} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var CurveCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var CurveCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -159394,27 +168571,27 @@ var CurveCanvasRenderer = function (renderer, src, interpolationPercentage, came { var dx = src._displayOriginX + src._curveBounds.x; var dy = src._displayOriginY + src._curveBounds.y; - + var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -159446,7 +168623,7 @@ module.exports = CurveCanvasRenderer; /***/ }), -/* 1026 */ +/* 1086 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159460,12 +168637,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1027); + renderWebGL = __webpack_require__(1087); } if (true) { - renderCanvas = __webpack_require__(1028); + renderCanvas = __webpack_require__(1088); } module.exports = { @@ -159477,7 +168654,7 @@ module.exports = { /***/ }), -/* 1027 */ +/* 1087 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159486,8 +168663,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -159500,44 +168678,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var EllipseWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var EllipseWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -159547,13 +168705,15 @@ var EllipseWebGLRenderer = function (renderer, src, interpolationPercentage, cam { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = EllipseWebGLRenderer; /***/ }), -/* 1028 */ +/* 1088 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159562,9 +168722,9 @@ module.exports = EllipseWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -159577,11 +168737,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Ellipse} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var EllipseCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var EllipseCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -159592,24 +168751,24 @@ var EllipseCanvasRenderer = function (renderer, src, interpolationPercentage, ca var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -159638,7 +168797,7 @@ module.exports = EllipseCanvasRenderer; /***/ }), -/* 1029 */ +/* 1089 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159652,12 +168811,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1030); + renderWebGL = __webpack_require__(1090); } if (true) { - renderCanvas = __webpack_require__(1031); + renderCanvas = __webpack_require__(1091); } module.exports = { @@ -159669,7 +168828,7 @@ module.exports = { /***/ }), -/* 1030 */ +/* 1090 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159678,7 +168837,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -159691,38 +168851,16 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var GridWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); calcMatrix.translate(-src._displayOriginX, -src._displayOriginY); @@ -159758,8 +168896,6 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera var cw = 0; var ch = 0; - pipeline.setTexture2D(); - if (showOutline) { // To make room for the grid lines (in case alpha < 1) @@ -159777,10 +168913,12 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera } } + renderer.pipelines.preBatch(src); + if (showCells && src.fillAlpha > 0) { fillTint = pipeline.fillTint; - fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; @@ -159820,7 +168958,7 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera if (showAltCells && src.altFillAlpha > 0) { fillTint = pipeline.fillTint; - fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.altFillColor, src.altFillAlpha * alpha); + fillTintColor = Utils.getTintAppendFloatAlpha(src.altFillColor, src.altFillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; @@ -159860,7 +168998,7 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera if (showOutline && src.outlineFillAlpha > 0) { var strokeTint = pipeline.strokeTint; - var color = Utils.getTintAppendFloatAlphaAndSwap(src.outlineFillColor, src.outlineFillAlpha * alpha); + var color = Utils.getTintAppendFloatAlpha(src.outlineFillColor, src.outlineFillAlpha * alpha); strokeTint.TL = color; strokeTint.TR = color; @@ -159881,13 +169019,15 @@ var GridWebGLRenderer = function (renderer, src, interpolationPercentage, camera pipeline.batchLine(0, y1, width, y1, 1, 1, 1, 0, false); } } + + renderer.pipelines.postBatch(src); }; module.exports = GridWebGLRenderer; /***/ }), -/* 1031 */ +/* 1091 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -159896,9 +169036,9 @@ module.exports = GridWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -159911,11 +169051,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Grid} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var GridCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var GridCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -160076,7 +169215,7 @@ module.exports = GridCanvasRenderer; /***/ }), -/* 1032 */ +/* 1092 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160090,12 +169229,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1033); + renderWebGL = __webpack_require__(1093); } if (true) { - renderCanvas = __webpack_require__(1034); + renderCanvas = __webpack_require__(1094); } module.exports = { @@ -160107,7 +169246,7 @@ module.exports = { /***/ }), -/* 1033 */ +/* 1093 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160116,7 +169255,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -160129,38 +169269,16 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var size = src.width; var height = src.height; @@ -160189,13 +169307,14 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came var x3; var y3; - pipeline.setTexture2D(); + + renderer.pipelines.preBatch(src); // Top Face if (src.showTop) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillTop, alpha); x0 = calcMatrix.getX(-sizeA, -height); y0 = calcMatrix.getY(-sizeA, -height); @@ -160209,14 +169328,14 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came x3 = calcMatrix.getX(0, sizeB - height); y3 = calcMatrix.getY(0, sizeB - height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Left Face if (src.showLeft) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillLeft, alpha); x0 = calcMatrix.getX(-sizeA, 0); y0 = calcMatrix.getY(-sizeA, 0); @@ -160230,14 +169349,14 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came x3 = calcMatrix.getX(-sizeA, -height); y3 = calcMatrix.getY(-sizeA, -height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Right Face if (src.showRight) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillRight, alpha); x0 = calcMatrix.getX(sizeA, 0); y0 = calcMatrix.getY(sizeA, 0); @@ -160251,15 +169370,17 @@ var IsoBoxWebGLRenderer = function (renderer, src, interpolationPercentage, came x3 = calcMatrix.getX(sizeA, -height); y3 = calcMatrix.getY(sizeA, -height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } + + renderer.pipelines.postBatch(src); }; module.exports = IsoBoxWebGLRenderer; /***/ }), -/* 1034 */ +/* 1094 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160268,8 +169389,8 @@ module.exports = IsoBoxWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -160282,11 +169403,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.IsoBox} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoBoxCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -160294,7 +169414,7 @@ var IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, cam { var size = src.width; var height = src.height; - + var sizeA = size / 2; var sizeB = size / src.projection; @@ -160324,7 +169444,7 @@ var IsoBoxCanvasRenderer = function (renderer, src, interpolationPercentage, cam FillStyleCanvas(ctx, src, src.fillLeft); ctx.beginPath(); - + ctx.moveTo(-sizeA, 0); ctx.lineTo(0, sizeB); ctx.lineTo(0, sizeB - height); @@ -160360,7 +169480,7 @@ module.exports = IsoBoxCanvasRenderer; /***/ }), -/* 1035 */ +/* 1095 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160374,12 +169494,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1036); + renderWebGL = __webpack_require__(1096); } if (true) { - renderCanvas = __webpack_require__(1037); + renderCanvas = __webpack_require__(1097); } module.exports = { @@ -160391,7 +169511,7 @@ module.exports = { /***/ }), -/* 1036 */ +/* 1096 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160400,7 +169520,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -160413,38 +169534,16 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var size = src.width; var height = src.height; @@ -160461,6 +169560,8 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, return; } + renderer.pipelines.preBatch(src); + var tint; var x0; @@ -160472,13 +169573,11 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, var x2; var y2; - pipeline.setTexture2D(); - // Top Face if (src.showTop && reversed) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillTop, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillTop, alpha); x0 = calcMatrix.getX(-sizeA, -height); y0 = calcMatrix.getY(-sizeA, -height); @@ -160492,14 +169591,14 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, var x3 = calcMatrix.getX(0, sizeB - height); var y3 = calcMatrix.getY(0, sizeB - height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 2); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Left Face if (src.showLeft) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillLeft, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillLeft, alpha); if (reversed) { @@ -160524,14 +169623,14 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, y2 = calcMatrix.getY(0, sizeB - height); } - pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2); + pipeline.batchTri(x0, y0, x1, y1, x2, y2, tint, tint, tint); } // Right Face if (src.showRight) { - tint = Utils.getTintAppendFloatAlphaAndSwap(src.fillRight, alpha); + tint = Utils.getTintAppendFloatAlpha(src.fillRight, alpha); if (reversed) { @@ -160556,15 +169655,17 @@ var IsoTriangleWebGLRenderer = function (renderer, src, interpolationPercentage, y2 = calcMatrix.getY(0, sizeB - height); } - pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 2); + pipeline.batchTri(x0, y0, x1, y1, x2, y2, tint, tint, tint); } + + renderer.pipelines.postBatch(src); }; module.exports = IsoTriangleWebGLRenderer; /***/ }), -/* 1037 */ +/* 1097 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160573,8 +169674,8 @@ module.exports = IsoTriangleWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -160587,11 +169688,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.IsoTriangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var IsoTriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var IsoTriangleCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -160599,7 +169699,7 @@ var IsoTriangleCanvasRenderer = function (renderer, src, interpolationPercentage { var size = src.width; var height = src.height; - + var sizeA = size / 2; var sizeB = size / src.projection; @@ -160678,7 +169778,7 @@ module.exports = IsoTriangleCanvasRenderer; /***/ }), -/* 1038 */ +/* 1098 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160692,12 +169792,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1039); + renderWebGL = __webpack_require__(1099); } if (true) { - renderCanvas = __webpack_require__(1040); + renderCanvas = __webpack_require__(1100); } module.exports = { @@ -160709,7 +169809,7 @@ module.exports = { /***/ }), -/* 1039 */ +/* 1099 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160718,7 +169818,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -160731,44 +169832,27 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var LineWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isStroked) { var strokeTint = pipeline.strokeTint; - var color = Utils.getTintAppendFloatAlphaAndSwap(src.strokeColor, src.strokeAlpha * alpha); + var color = Utils.getTintAppendFloatAlpha(src.strokeColor, src.strokeAlpha * alpha); strokeTint.TL = color; strokeTint.TR = color; @@ -160778,8 +169862,6 @@ var LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera var startWidth = src._startWidth; var endWidth = src._endWidth; - pipeline.setTexture2D(); - pipeline.batchLine( src.geom.x1 - dx, src.geom.y1 - dy, @@ -160790,17 +169872,19 @@ var LineWebGLRenderer = function (renderer, src, interpolationPercentage, camera 1, 0, false, - shapeMatrix, - camMatrix + result.sprite, + result.camera ); } + + renderer.pipelines.postBatch(src); }; module.exports = LineWebGLRenderer; /***/ }), -/* 1040 */ +/* 1100 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160809,8 +169893,8 @@ module.exports = LineWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -160823,11 +169907,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Line} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var LineCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var LineCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -160844,7 +169927,7 @@ var LineCanvasRenderer = function (renderer, src, interpolationPercentage, camer ctx.moveTo(src.geom.x1 - dx, src.geom.y1 - dy); ctx.lineTo(src.geom.x2 - dx, src.geom.y2 - dy); - + ctx.stroke(); } @@ -160857,7 +169940,7 @@ module.exports = LineCanvasRenderer; /***/ }), -/* 1041 */ +/* 1101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160871,12 +169954,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1042); + renderWebGL = __webpack_require__(1102); } if (true) { - renderCanvas = __webpack_require__(1043); + renderCanvas = __webpack_require__(1103); } module.exports = { @@ -160888,7 +169971,7 @@ module.exports = { /***/ }), -/* 1042 */ +/* 1102 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160897,8 +169980,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -160911,44 +169995,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var PolygonWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var PolygonWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -160958,13 +170022,15 @@ var PolygonWebGLRenderer = function (renderer, src, interpolationPercentage, cam { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = PolygonWebGLRenderer; /***/ }), -/* 1043 */ +/* 1103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -160973,9 +170039,9 @@ module.exports = PolygonWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -160988,11 +170054,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Polygon} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var PolygonCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var PolygonCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -161003,24 +170068,24 @@ var PolygonCanvasRenderer = function (renderer, src, interpolationPercentage, ca var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -161049,7 +170114,7 @@ module.exports = PolygonCanvasRenderer; /***/ }), -/* 1044 */ +/* 1104 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161063,12 +170128,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1045); + renderWebGL = __webpack_require__(1105); } if (true) { - renderCanvas = __webpack_require__(1046); + renderCanvas = __webpack_require__(1106); } module.exports = { @@ -161080,7 +170145,7 @@ module.exports = { /***/ }), -/* 1045 */ +/* 1105 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161089,8 +170154,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(72); -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -161103,55 +170169,33 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RectangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RectangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { var fillTint = pipeline.fillTint; - var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + var fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; fillTint.BL = fillTintColor; fillTint.BR = fillTintColor; - pipeline.setTexture2D(); - pipeline.batchFillRect( -dx, -dy, @@ -161164,13 +170208,15 @@ var RectangleWebGLRenderer = function (renderer, src, interpolationPercentage, c { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = RectangleWebGLRenderer; /***/ }), -/* 1046 */ +/* 1106 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161179,9 +170225,9 @@ module.exports = RectangleWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -161194,11 +170240,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Rectangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var RectangleCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -161210,7 +170255,7 @@ var RectangleCanvasRenderer = function (renderer, src, interpolationPercentage, if (src.isFilled) { FillStyleCanvas(ctx, src); - + ctx.fillRect( -dx, -dy, @@ -161244,7 +170289,7 @@ module.exports = RectangleCanvasRenderer; /***/ }), -/* 1047 */ +/* 1107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161258,12 +170303,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1048); + renderWebGL = __webpack_require__(1108); } if (true) { - renderCanvas = __webpack_require__(1049); + renderCanvas = __webpack_require__(1109); } module.exports = { @@ -161275,7 +170320,7 @@ module.exports = { /***/ }), -/* 1048 */ +/* 1108 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161284,8 +170329,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillPathWebGL = __webpack_require__(101); -var StrokePathWebGL = __webpack_require__(72); +var FillPathWebGL = __webpack_require__(109); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -161298,44 +170344,24 @@ var StrokePathWebGL = __webpack_require__(72); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var StarWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var StarWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -161345,13 +170371,15 @@ var StarWebGLRenderer = function (renderer, src, interpolationPercentage, camera { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = StarWebGLRenderer; /***/ }), -/* 1049 */ +/* 1109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161360,9 +170388,9 @@ module.exports = StarWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -161375,11 +170403,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Star} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var StarCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var StarCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -161390,24 +170417,24 @@ var StarCanvasRenderer = function (renderer, src, interpolationPercentage, camer var path = src.pathData; var pathLength = path.length - 1; - + var px1 = path[0] - dx; var py1 = path[1] - dy; ctx.beginPath(); ctx.moveTo(px1, py1); - + if (!src.closePath) { pathLength -= 2; } - + for (var i = 2; i < pathLength; i += 2) { var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - + ctx.lineTo(px2, py2); } @@ -161436,7 +170463,7 @@ module.exports = StarCanvasRenderer; /***/ }), -/* 1050 */ +/* 1110 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161450,12 +170477,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1051); + renderWebGL = __webpack_require__(1111); } if (true) { - renderCanvas = __webpack_require__(1052); + renderCanvas = __webpack_require__(1112); } module.exports = { @@ -161467,7 +170494,7 @@ module.exports = { /***/ }), -/* 1051 */ +/* 1111 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161476,8 +170503,9 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var StrokePathWebGL = __webpack_require__(72); -var Utils = __webpack_require__(10); +var GetCalcMatrix = __webpack_require__(21); +var StrokePathWebGL = __webpack_require__(79); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -161490,47 +170518,27 @@ var Utils = __webpack_require__(10); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); - var camMatrix = pipeline._tempMatrix1; - var shapeMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; + var result = GetCalcMatrix(src, camera, parentMatrix); - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { var fillTint = pipeline.fillTint; - var fillTintColor = Utils.getTintAppendFloatAlphaAndSwap(src.fillColor, src.fillAlpha * alpha); + var fillTintColor = Utils.getTintAppendFloatAlpha(src.fillColor, src.fillAlpha * alpha); fillTint.TL = fillTintColor; fillTint.TR = fillTintColor; @@ -161544,8 +170552,6 @@ var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, ca var x3 = src.geom.x3 - dx; var y3 = src.geom.y3 - dy; - pipeline.setTexture2D(); - pipeline.batchFillTriangle( x1, y1, @@ -161553,8 +170559,8 @@ var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, ca y2, x3, y3, - shapeMatrix, - camMatrix + result.sprite, + result.camera ); } @@ -161562,13 +170568,15 @@ var TriangleWebGLRenderer = function (renderer, src, interpolationPercentage, ca { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = TriangleWebGLRenderer; /***/ }), -/* 1052 */ +/* 1112 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161577,9 +170585,9 @@ module.exports = TriangleWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FillStyleCanvas = __webpack_require__(43); -var LineStyleCanvas = __webpack_require__(51); -var SetTransform = __webpack_require__(28); +var FillStyleCanvas = __webpack_require__(46); +var LineStyleCanvas = __webpack_require__(57); +var SetTransform = __webpack_require__(30); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -161592,11 +170600,10 @@ var SetTransform = __webpack_require__(28); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Triangle} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var TriangleCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TriangleCanvasRenderer = function (renderer, src, camera, parentMatrix) { var ctx = renderer.currentContext; @@ -161643,7 +170650,7 @@ module.exports = TriangleCanvasRenderer; /***/ }), -/* 1053 */ +/* 1113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161652,7 +170659,7 @@ module.exports = TriangleCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(199); +var Blitter = __webpack_require__(204); var GameObjectFactory = __webpack_require__(5); /** @@ -161666,8 +170673,8 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} x - The x position of the Game Object. * @param {number} y - The y position of the Game Object. * @param {string} key - The key of the Texture the Blitter object will use. - * @param {(string|integer)} [frame] - The default Frame children of the Blitter will use. - * + * @param {(string|number)} [frame] - The default Frame children of the Blitter will use. + * * @return {Phaser.GameObjects.Blitter} The Game Object that was created. */ GameObjectFactory.register('blitter', function (x, y, key, frame) @@ -161676,16 +170683,16 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns /***/ }), -/* 1054 */ +/* 1114 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161695,7 +170702,7 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Container = __webpack_require__(200); +var Container = __webpack_require__(205); var GameObjectFactory = __webpack_require__(5); /** @@ -161719,7 +170726,7 @@ GameObjectFactory.register('container', function (x, y, children) /***/ }), -/* 1055 */ +/* 1115 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161728,7 +170735,7 @@ GameObjectFactory.register('container', function (x, y, children) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DOMElement = __webpack_require__(409); +var DOMElement = __webpack_require__(419); var GameObjectFactory = __webpack_require__(5); /** @@ -161808,7 +170815,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) /***/ }), -/* 1056 */ +/* 1116 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161817,7 +170824,7 @@ GameObjectFactory.register('dom', function (x, y, element, style, innerText) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DynamicBitmapText = __webpack_require__(201); +var DynamicBitmapText = __webpack_require__(206); var GameObjectFactory = __webpack_require__(5); /** @@ -161877,7 +170884,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size /***/ }), -/* 1057 */ +/* 1117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161886,7 +170893,7 @@ GameObjectFactory.register('dynamicBitmapText', function (x, y, font, text, size * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extern = __webpack_require__(411); +var Extern = __webpack_require__(421); var GameObjectFactory = __webpack_require__(5); /** @@ -161918,7 +170925,7 @@ GameObjectFactory.register('extern', function () /***/ }), -/* 1058 */ +/* 1118 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161927,7 +170934,7 @@ GameObjectFactory.register('extern', function () * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Graphics = __webpack_require__(202); +var Graphics = __webpack_require__(207); var GameObjectFactory = __webpack_require__(5); /** @@ -161957,7 +170964,7 @@ GameObjectFactory.register('graphics', function (config) /***/ }), -/* 1059 */ +/* 1119 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161966,7 +170973,7 @@ GameObjectFactory.register('graphics', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Group = __webpack_require__(100); +var Group = __webpack_require__(108); var GameObjectFactory = __webpack_require__(5); /** @@ -161989,7 +170996,7 @@ GameObjectFactory.register('group', function (children, config) /***/ }), -/* 1060 */ +/* 1120 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -161998,7 +171005,7 @@ GameObjectFactory.register('group', function (children, config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Image = __webpack_require__(114); +var Image = __webpack_require__(122); var GameObjectFactory = __webpack_require__(5); /** @@ -162012,7 +171019,7 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Image} The Game Object that was created. */ @@ -162031,7 +171038,38 @@ GameObjectFactory.register('image', function (x, y, key, frame) /***/ }), -/* 1061 */ +/* 1121 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Layer = __webpack_require__(210); +var GameObjectFactory = __webpack_require__(5); + +/** + * Creates a new Layer Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#layer + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Layer. + * + * @return {Phaser.GameObjects.Layer} The Game Object that was created. + */ +GameObjectFactory.register('layer', function (children) +{ + return this.displayList.add(new Layer(this.scene, children)); +}); + + +/***/ }), +/* 1122 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162041,7 +171079,7 @@ GameObjectFactory.register('image', function (x, y, key, frame) */ var GameObjectFactory = __webpack_require__(5); -var ParticleEmitterManager = __webpack_require__(205); +var ParticleEmitterManager = __webpack_require__(211); /** * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. @@ -162052,7 +171090,7 @@ var ParticleEmitterManager = __webpack_require__(205); * @since 3.0.0 * * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created. @@ -162062,17 +171100,9 @@ GameObjectFactory.register('particles', function (key, frame, emitters) return this.displayList.add(new ParticleEmitterManager(this.scene, key, frame, emitters)); }); -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /***/ }), -/* 1062 */ +/* 1123 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162082,7 +171112,7 @@ GameObjectFactory.register('particles', function (key, frame, emitters) */ var GameObjectFactory = __webpack_require__(5); -var PathFollower = __webpack_require__(424); +var PathFollower = __webpack_require__(434); /** * Creates a new PathFollower Game Object and adds it to the Scene. @@ -162096,7 +171126,7 @@ var PathFollower = __webpack_require__(424); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.PathFollower} The Game Object that was created. */ @@ -162120,7 +171150,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) /***/ }), -/* 1063 */ +/* 1124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162130,7 +171160,7 @@ GameObjectFactory.register('follower', function (path, x, y, key, frame) */ var GameObjectFactory = __webpack_require__(5); -var RenderTexture = __webpack_require__(206); +var RenderTexture = __webpack_require__(212); /** * Creates a new Render Texture Game Object and adds it to the Scene. @@ -162146,8 +171176,8 @@ var RenderTexture = __webpack_require__(206); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} [width=32] - The width of the Render Texture. - * @param {integer} [height=32] - The height of the Render Texture. + * @param {number} [width=32] - The width of the Render Texture. + * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. * @@ -162160,7 +171190,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, /***/ }), -/* 1064 */ +/* 1125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162169,7 +171199,7 @@ GameObjectFactory.register('renderTexture', function (x, y, width, height, key, * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rope = __webpack_require__(208); +var Rope = __webpack_require__(214); var GameObjectFactory = __webpack_require__(5); /** @@ -162184,7 +171214,7 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Math.Vector2Like[]} [points] - An array containing the vertices data for this Rope. If none is provided a simple quad is created. See `setPoints` to set this post-creation. * @param {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? * @param {number[]} [colors] - An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. @@ -162200,17 +171230,9 @@ if (true) }); } -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /***/ }), -/* 1065 */ +/* 1126 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162220,7 +171242,7 @@ if (true) */ var GameObjectFactory = __webpack_require__(5); -var Sprite = __webpack_require__(76); +var Sprite = __webpack_require__(70); /** * Creates a new Sprite Game Object and adds it to the Scene. @@ -162233,7 +171255,7 @@ var Sprite = __webpack_require__(76); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Sprite} The Game Object that was created. */ @@ -162256,7 +171278,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) /***/ }), -/* 1066 */ +/* 1127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162265,7 +171287,7 @@ GameObjectFactory.register('sprite', function (x, y, key, frame) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(140); +var BitmapText = __webpack_require__(144); var GameObjectFactory = __webpack_require__(5); /** @@ -162301,7 +171323,7 @@ var GameObjectFactory = __webpack_require__(5); * @param {string} font - The key of the font to use from the BitmapFont cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size to set. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. * * @return {Phaser.GameObjects.BitmapText} The Game Object that was created. */ @@ -162320,7 +171342,7 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align /***/ }), -/* 1067 */ +/* 1128 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162329,18 +171351,18 @@ GameObjectFactory.register('bitmapText', function (x, y, font, text, size, align * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Text = __webpack_require__(209); +var Text = __webpack_require__(215); var GameObjectFactory = __webpack_require__(5); /** * Creates a new Text Game Object and adds it to the Scene. - * + * * A Text Game Object. - * + * * Text objects work by creating their own internal hidden Canvas and then renders text to it using * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered * to your game during the render pass. - * + * * Because it uses the Canvas API you can take advantage of all the features this offers, such as * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts * loaded externally, such as Google or TypeKit Web fonts. @@ -162351,7 +171373,7 @@ var GameObjectFactory = __webpack_require__(5); * * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts * across mobile browsers. - * + * * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of @@ -162385,7 +171407,7 @@ GameObjectFactory.register('text', function (x, y, text, style) /***/ }), -/* 1068 */ +/* 1129 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162394,7 +171416,7 @@ GameObjectFactory.register('text', function (x, y, text, style) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileSprite = __webpack_require__(210); +var TileSprite = __webpack_require__(216); var GameObjectFactory = __webpack_require__(5); /** @@ -162407,10 +171429,10 @@ var GameObjectFactory = __webpack_require__(5); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. - * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {number} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {number} height - The height of the Game Object. If zero it will use the size of the texture frame. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.TileSprite} The Game Object that was created. */ @@ -162429,7 +171451,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra /***/ }), -/* 1069 */ +/* 1130 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162438,7 +171460,7 @@ GameObjectFactory.register('tileSprite', function (x, y, width, height, key, fra * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Zone = __webpack_require__(117); +var Zone = __webpack_require__(125); var GameObjectFactory = __webpack_require__(5); /** @@ -162471,7 +171493,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) /***/ }), -/* 1070 */ +/* 1131 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162480,7 +171502,7 @@ GameObjectFactory.register('zone', function (x, y, width, height) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Video = __webpack_require__(211); +var Video = __webpack_require__(217); var GameObjectFactory = __webpack_require__(5); /** @@ -162499,25 +171521,12 @@ var GameObjectFactory = __webpack_require__(5); */ GameObjectFactory.register('video', function (x, y, key) { - var video = new Video(this.scene, x, y, key); - - this.displayList.add(video); - this.updateList.add(video); - - return video; + return this.displayList.add(new Video(this.scene, x, y, key)); }); -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns - /***/ }), -/* 1071 */ +/* 1132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162526,7 +171535,7 @@ GameObjectFactory.register('video', function (x, y, key) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Arc = __webpack_require__(428); +var Arc = __webpack_require__(438); var GameObjectFactory = __webpack_require__(5); /** @@ -162552,8 +171561,8 @@ var GameObjectFactory = __webpack_require__(5); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {number} [radius=128] - The radius of the arc. - * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. - * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {number} [startAngle=0] - The start angle of the arc, in degrees. + * @param {number} [endAngle=360] - The end angle of the arc, in degrees. * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. @@ -162590,7 +171599,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph /***/ }), -/* 1072 */ +/* 1133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162600,7 +171609,7 @@ GameObjectFactory.register('circle', function (x, y, radius, fillColor, fillAlph */ var GameObjectFactory = __webpack_require__(5); -var Curve = __webpack_require__(429); +var Curve = __webpack_require__(439); /** * Creates a new Curve Shape Game Object and adds it to the Scene. @@ -162640,7 +171649,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) /***/ }), -/* 1073 */ +/* 1134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162649,7 +171658,7 @@ GameObjectFactory.register('curve', function (x, y, curve, fillColor, fillAlpha) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(430); +var Ellipse = __webpack_require__(440); var GameObjectFactory = __webpack_require__(5); /** @@ -162692,7 +171701,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, /***/ }), -/* 1074 */ +/* 1135 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162702,7 +171711,7 @@ GameObjectFactory.register('ellipse', function (x, y, width, height, fillColor, */ var GameObjectFactory = __webpack_require__(5); -var Grid = __webpack_require__(431); +var Grid = __webpack_require__(441); /** * Creates a new Grid Shape Game Object and adds it to the Scene. @@ -162747,7 +171756,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel /***/ }), -/* 1075 */ +/* 1136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162757,7 +171766,7 @@ GameObjectFactory.register('grid', function (x, y, width, height, cellWidth, cel */ var GameObjectFactory = __webpack_require__(5); -var IsoBox = __webpack_require__(432); +var IsoBox = __webpack_require__(442); /** * Creates a new IsoBox Shape Game Object and adds it to the Scene. @@ -162798,7 +171807,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill /***/ }), -/* 1076 */ +/* 1137 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162808,7 +171817,7 @@ GameObjectFactory.register('isobox', function (x, y, size, height, fillTop, fill */ var GameObjectFactory = __webpack_require__(5); -var IsoTriangle = __webpack_require__(433); +var IsoTriangle = __webpack_require__(443); /** * Creates a new IsoTriangle Shape Game Object and adds it to the Scene. @@ -162851,7 +171860,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed /***/ }), -/* 1077 */ +/* 1138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162861,7 +171870,7 @@ GameObjectFactory.register('isotriangle', function (x, y, size, height, reversed */ var GameObjectFactory = __webpack_require__(5); -var Line = __webpack_require__(434); +var Line = __webpack_require__(444); /** * Creates a new Line Shape Game Object and adds it to the Scene. @@ -162902,7 +171911,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, /***/ }), -/* 1078 */ +/* 1139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162912,7 +171921,7 @@ GameObjectFactory.register('line', function (x, y, x1, y1, x2, y2, strokeColor, */ var GameObjectFactory = __webpack_require__(5); -var Polygon = __webpack_require__(435); +var Polygon = __webpack_require__(445); /** * Creates a new Polygon Shape Game Object and adds it to the Scene. @@ -162955,7 +171964,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp /***/ }), -/* 1079 */ +/* 1140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -162965,7 +171974,7 @@ GameObjectFactory.register('polygon', function (x, y, points, fillColor, fillAlp */ var GameObjectFactory = __webpack_require__(5); -var Rectangle = __webpack_require__(440); +var Rectangle = __webpack_require__(450); /** * Creates a new Rectangle Shape Game Object and adds it to the Scene. @@ -163000,7 +172009,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor /***/ }), -/* 1080 */ +/* 1141 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163009,7 +172018,7 @@ GameObjectFactory.register('rectangle', function (x, y, width, height, fillColor * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Star = __webpack_require__(441); +var Star = __webpack_require__(451); var GameObjectFactory = __webpack_require__(5); /** @@ -163052,7 +172061,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad /***/ }), -/* 1081 */ +/* 1142 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163062,7 +172071,7 @@ GameObjectFactory.register('star', function (x, y, points, innerRadius, outerRad */ var GameObjectFactory = __webpack_require__(5); -var Triangle = __webpack_require__(442); +var Triangle = __webpack_require__(452); /** * Creates a new Triangle Shape Game Object and adds it to the Scene. @@ -163103,7 +172112,7 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f /***/ }), -/* 1082 */ +/* 1143 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163112,9 +172121,9 @@ GameObjectFactory.register('triangle', function (x, y, x1, y1, x2, y2, x3, y3, f * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Blitter = __webpack_require__(199); -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var Blitter = __webpack_require__(204); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); /** @@ -163153,7 +172162,7 @@ GameObjectCreator.register('blitter', function (config, addToScene) /***/ }), -/* 1083 */ +/* 1144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163163,9 +172172,9 @@ GameObjectCreator.register('blitter', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var Container = __webpack_require__(200); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var Container = __webpack_require__(205); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); /** @@ -163203,7 +172212,7 @@ GameObjectCreator.register('container', function (config, addToScene) /***/ }), -/* 1084 */ +/* 1145 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163212,9 +172221,9 @@ GameObjectCreator.register('container', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(201); -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BitmapText = __webpack_require__(206); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); /** @@ -163254,7 +172263,7 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) /***/ }), -/* 1085 */ +/* 1146 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163263,8 +172272,8 @@ GameObjectCreator.register('dynamicBitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); -var Graphics = __webpack_require__(202); +var GameObjectCreator = __webpack_require__(17); +var Graphics = __webpack_require__(207); /** * Creates a new Graphics Game Object and returns it. @@ -163302,7 +172311,7 @@ GameObjectCreator.register('graphics', function (config, addToScene) /***/ }), -/* 1086 */ +/* 1147 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163311,8 +172320,8 @@ GameObjectCreator.register('graphics', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); -var Group = __webpack_require__(100); +var GameObjectCreator = __webpack_require__(17); +var Group = __webpack_require__(108); /** * Creates a new Group Game Object and returns it. @@ -163335,7 +172344,7 @@ GameObjectCreator.register('group', function (config) /***/ }), -/* 1087 */ +/* 1148 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163344,10 +172353,10 @@ GameObjectCreator.register('group', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Image = __webpack_require__(114); +var Image = __webpack_require__(122); /** * Creates a new Image Game Object and returns it. @@ -163385,7 +172394,55 @@ GameObjectCreator.register('image', function (config, addToScene) /***/ }), -/* 1088 */ +/* 1149 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(28); +var Layer = __webpack_require__(210); +var GameObjectCreator = __webpack_require__(17); +var GetAdvancedValue = __webpack_require__(15); + +/** + * Creates a new Layer Game Object and returns it. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#layer + * @since 3.50.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Layer} The Game Object that was created. + */ +GameObjectCreator.register('layer', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var children = GetAdvancedValue(config, 'children', null); + + var layer = new Layer(this.scene, children); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, layer, config); + + return layer; +}); + + +/***/ }), +/* 1150 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163394,10 +172451,10 @@ GameObjectCreator.register('image', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); var GetFastValue = __webpack_require__(2); -var ParticleEmitterManager = __webpack_require__(205); +var ParticleEmitterManager = __webpack_require__(211); /** * Creates a new Particle Emitter Manager Game Object and returns it. @@ -163434,13 +172491,17 @@ GameObjectCreator.register('particles', function (config, addToScene) { this.displayList.add(manager); } + else + { + this.updateList.add(manager); + } return manager; }); /***/ }), -/* 1089 */ +/* 1151 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163449,10 +172510,10 @@ GameObjectCreator.register('particles', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var RenderTexture = __webpack_require__(206); +var RenderTexture = __webpack_require__(212); /** * Creates a new Render Texture Game Object and returns it. @@ -163492,7 +172553,7 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) /***/ }), -/* 1090 */ +/* 1152 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163501,11 +172562,11 @@ GameObjectCreator.register('renderTexture', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); var GetValue = __webpack_require__(6); -var Rope = __webpack_require__(208); +var Rope = __webpack_require__(214); /** * Creates a new Rope Game Object and returns it. @@ -163540,6 +172601,11 @@ GameObjectCreator.register('rope', function (config, addToScene) BuildGameObject(this.scene, rope, config); + if (!config.add) + { + this.updateList.add(rope); + } + return rope; }); @@ -163547,7 +172613,7 @@ GameObjectCreator.register('rope', function (config, addToScene) /***/ }), -/* 1091 */ +/* 1153 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163556,11 +172622,11 @@ GameObjectCreator.register('rope', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var BuildGameObjectAnimation = __webpack_require__(406); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var BuildGameObjectAnimation = __webpack_require__(416); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Sprite = __webpack_require__(76); +var Sprite = __webpack_require__(70); /** * Creates a new Sprite Game Object and returns it. @@ -163600,7 +172666,7 @@ GameObjectCreator.register('sprite', function (config, addToScene) /***/ }), -/* 1092 */ +/* 1154 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163609,9 +172675,9 @@ GameObjectCreator.register('sprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapText = __webpack_require__(140); -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BitmapText = __webpack_require__(144); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); var GetValue = __webpack_require__(6); @@ -163653,7 +172719,7 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) /***/ }), -/* 1093 */ +/* 1155 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163662,10 +172728,10 @@ GameObjectCreator.register('bitmapText', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Text = __webpack_require__(209); +var Text = __webpack_require__(215); /** * Creates a new Text Game Object and returns it. @@ -163740,7 +172806,7 @@ GameObjectCreator.register('text', function (config, addToScene) /***/ }), -/* 1094 */ +/* 1156 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163749,10 +172815,10 @@ GameObjectCreator.register('text', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var TileSprite = __webpack_require__(210); +var TileSprite = __webpack_require__(216); /** * Creates a new TileSprite Game Object and returns it. @@ -163792,7 +172858,7 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) /***/ }), -/* 1095 */ +/* 1157 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163801,9 +172867,9 @@ GameObjectCreator.register('tileSprite', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Zone = __webpack_require__(117); +var Zone = __webpack_require__(125); /** * Creates a new Zone Game Object and returns it. @@ -163831,7 +172897,7 @@ GameObjectCreator.register('zone', function (config) /***/ }), -/* 1096 */ +/* 1158 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163840,10 +172906,10 @@ GameObjectCreator.register('zone', function (config) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Video = __webpack_require__(211); +var Video = __webpack_require__(217); /** * Creates a new Video Game Object and returns it. @@ -163873,6 +172939,11 @@ GameObjectCreator.register('video', function (config, addToScene) BuildGameObject(this.scene, video, config); + if (!config.add) + { + this.updateList.add(video); + } + return video; }); @@ -163880,7 +172951,7 @@ GameObjectCreator.register('video', function (config, addToScene) /***/ }), -/* 1097 */ +/* 1159 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163894,12 +172965,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1098); + renderWebGL = __webpack_require__(1160); } if (true) { - renderCanvas = __webpack_require__(1099); + renderCanvas = __webpack_require__(1161); } module.exports = { @@ -163911,7 +172982,7 @@ module.exports = { /***/ }), -/* 1098 */ +/* 1160 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -163920,179 +172991,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.GameObjects.Mesh#renderWebGL - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var MeshWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) -{ - var pipeline = renderer.pipelines.set(this.pipeline, src); - - var camMatrix = pipeline._tempMatrix1; - var spriteMatrix = pipeline._tempMatrix2; - var calcMatrix = pipeline._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } - - var vertices = src.vertices; - var uvs = src.uv; - var colors = src.colors; - var alphas = src.alphas; - - var meshVerticesLength = vertices.length; - var vertexCount = Math.floor(meshVerticesLength * 0.5); - - if (pipeline.vertexCount + vertexCount > pipeline.vertexCapacity) - { - pipeline.flush(); - } - - var textureUnit = pipeline.setGameObject(src); - - var vertexViewF32 = pipeline.vertexViewF32; - var vertexViewU32 = pipeline.vertexViewU32; - - var vertexOffset = (pipeline.vertexCount * pipeline.vertexComponentCount) - 1; - - var colorIndex = 0; - var tintEffect = src.tintFill; - - for (var i = 0; i < meshVerticesLength; i += 2) - { - var x = vertices[i + 0]; - var y = vertices[i + 1]; - - var tx = x * calcMatrix.a + y * calcMatrix.c + calcMatrix.e; - var ty = x * calcMatrix.b + y * calcMatrix.d + calcMatrix.f; - - if (camera.roundPixels) - { - tx = Math.round(tx); - ty = Math.round(ty); - } - - vertexViewF32[++vertexOffset] = tx; - vertexViewF32[++vertexOffset] = ty; - vertexViewF32[++vertexOffset] = uvs[i + 0]; - vertexViewF32[++vertexOffset] = uvs[i + 1]; - vertexViewF32[++vertexOffset] = textureUnit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = Utils.getTintAppendFloatAlpha(colors[colorIndex], camera.alpha * alphas[colorIndex]); - - colorIndex++; - } - - pipeline.vertexCount += vertexCount; -}; - -module.exports = MeshWebGLRenderer; - - -/***/ }), -/* 1099 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a stub function for Mesh.Render. There is no Canvas renderer for Mesh objects. - * - * @method Phaser.GameObjects.Mesh#renderCanvas - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - */ -var MeshCanvasRenderer = function () -{ -}; - -module.exports = MeshCanvasRenderer; - - -/***/ }), -/* 1100 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var renderWebGL = __webpack_require__(1); -var renderCanvas = __webpack_require__(1); - -if (true) -{ - renderWebGL = __webpack_require__(1101); -} - -if (true) -{ - renderCanvas = __webpack_require__(1102); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 1101 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ +var GetCalcMatrix = __webpack_require__(21); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -164105,11 +173004,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var ShaderWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (!src.shader) { @@ -164125,30 +173023,7 @@ var ShaderWebGLRenderer = function (renderer, src, interpolationPercentage, came } else { - var camMatrix = src._tempMatrix1; - var shapeMatrix = src._tempMatrix2; - var calcMatrix = src._tempMatrix3; - - shapeMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - shapeMatrix.e = src.x; - shapeMatrix.f = src.y; - } - else - { - shapeMatrix.e -= camera.scrollX * src.scrollFactorX; - shapeMatrix.f -= camera.scrollY * src.scrollFactorY; - } - - camMatrix.multiply(shapeMatrix, calcMatrix); + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; // Renderer size changed? if (renderer.width !== src._rendererWidth || renderer.height !== src._rendererHeight) @@ -164167,7 +173042,7 @@ module.exports = ShaderWebGLRenderer; /***/ }), -/* 1102 */ +/* 1161 */ /***/ (function(module, exports) { /** @@ -164185,7 +173060,6 @@ module.exports = ShaderWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Shader} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. */ var ShaderCanvasRenderer = function () @@ -164196,7 +173070,7 @@ module.exports = ShaderCanvasRenderer; /***/ }), -/* 1103 */ +/* 1162 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164205,48 +173079,29 @@ module.exports = ShaderCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Mesh = __webpack_require__(142); -var GameObjectFactory = __webpack_require__(5); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); -/** - * Creates a new Mesh Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. - * - * @method Phaser.GameObjects.GameObjectFactory#mesh - * @webglOnly - * @since 3.0.0 - * - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {number[]} vertices - An array containing the vertices data for this Mesh. - * @param {number[]} uv - An array containing the uv data for this Mesh. - * @param {number[]} colors - An array containing the color data for this Mesh. - * @param {number[]} alphas - An array containing the alpha data for this Mesh. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.GameObjects.Mesh} The Game Object that was created. - */ if (true) { - GameObjectFactory.register('mesh', function (x, y, vertices, uv, colors, alphas, texture, frame) - { - return this.displayList.add(new Mesh(this.scene, x, y, vertices, uv, colors, alphas, texture, frame)); - }); + renderWebGL = __webpack_require__(1163); } -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns +if (true) +{ + renderCanvas = __webpack_require__(1164); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; /***/ }), -/* 1104 */ +/* 1163 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164255,44 +173110,136 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Quad = __webpack_require__(214); -var GameObjectFactory = __webpack_require__(5); +var GetCalcMatrix = __webpack_require__(21); /** - * Creates a new Quad Game Object and adds it to the Scene. + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. - * - * @method Phaser.GameObjects.GameObjectFactory#quad - * @webglOnly + * @method Phaser.GameObjects.Mesh#renderWebGL * @since 3.0.0 + * @private * - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.GameObjects.Quad} The Game Object that was created. + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -if (true) +var MeshWebGLRenderer = function (renderer, src, camera, parentMatrix) { - GameObjectFactory.register('quad', function (x, y, key, frame) - { - return this.displayList.add(new Quad(this.scene, x, y, key, frame)); - }); -} + var faces = src.faces; + var totalFaces = faces.length; -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns + if (totalFaces === 0) + { + return; + } + + var pipeline = renderer.pipelines.set(src.pipeline, src); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var textureUnit = pipeline.setGameObject(src); + + var F32 = pipeline.vertexViewF32; + var U32 = pipeline.vertexViewU32; + + var vertexOffset = (pipeline.vertexCount * pipeline.currentShader.vertexComponentCount) - 1; + + var tintEffect = src.tintFill; + + var debugFaces = []; + var debugCallback = src.debugCallback; + + var a = calcMatrix.a; + var b = calcMatrix.b; + var c = calcMatrix.c; + var d = calcMatrix.d; + var e = calcMatrix.e; + var f = calcMatrix.f; + + var z = src.viewPosition.z; + + var hideCCW = src.hideCCW; + var roundPixels = camera.roundPixels; + var alpha = camera.alpha * src.alpha; + + var totalFacesRendered = 0; + + renderer.pipelines.preBatch(src); + + for (var i = 0; i < totalFaces; i++) + { + var face = faces[i]; + + // If face has alpha <= 0, or hideCCW + clockwise, or isn't in camera view, then don't draw it + if (!face.isInView(camera, hideCCW, z, alpha, a, b, c, d, e, f, roundPixels)) + { + continue; + } + + if (pipeline.shouldFlush(3)) + { + pipeline.flush(); + + vertexOffset = 0; + } + + vertexOffset = face.load(F32, U32, vertexOffset, textureUnit, tintEffect); + + totalFacesRendered++; + pipeline.vertexCount += 3; + + if (debugCallback) + { + debugFaces.push(face); + } + } + + src.totalFrame += totalFacesRendered; + + if (debugCallback) + { + debugCallback.call(src, src, debugFaces); + } + + renderer.pipelines.postBatch(src); +}; + +module.exports = MeshWebGLRenderer; /***/ }), -/* 1105 */ +/* 1164 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a stub function for Mesh.Render. There is no Canvas renderer for Mesh objects. + * + * @method Phaser.GameObjects.Mesh#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var MeshCanvasRenderer = function () +{ +}; + +module.exports = MeshCanvasRenderer; + + +/***/ }), +/* 1165 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164301,7 +173248,7 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Shader = __webpack_require__(215); +var Shader = __webpack_require__(220); var GameObjectFactory = __webpack_require__(5); /** @@ -164333,7 +173280,7 @@ if (true) /***/ }), -/* 1106 */ +/* 1166 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164342,53 +173289,43 @@ if (true) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); -var GetAdvancedValue = __webpack_require__(15); -var GetValue = __webpack_require__(6); -var Mesh = __webpack_require__(142); +var Mesh = __webpack_require__(221); +var GameObjectFactory = __webpack_require__(5); /** - * Creates a new Mesh Game Object and returns it. + * Creates a new Mesh Game Object and adds it to the Scene. * * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. * - * @method Phaser.GameObjects.GameObjectCreator#mesh + * @method Phaser.GameObjects.GameObjectFactory#mesh + * @webglOnly * @since 3.0.0 * - * @param {object} config - The configuration object this Game Object will use to create itself. - * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * @param {number} [x] - The horizontal position of this Game Object in the world. + * @param {number} [y] - The vertical position of this Game Object in the world. + * @param {string|Phaser.Textures.Texture} [texture] - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {string|number} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {number[]} [vertices] - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} [uvs] - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. * * @return {Phaser.GameObjects.Mesh} The Game Object that was created. */ -GameObjectCreator.register('mesh', function (config, addToScene) +if (true) { - if (config === undefined) { config = {}; } - - var key = GetAdvancedValue(config, 'key', null); - var frame = GetAdvancedValue(config, 'frame', null); - var vertices = GetValue(config, 'vertices', []); - var colors = GetValue(config, 'colors', []); - var alphas = GetValue(config, 'alphas', []); - var uv = GetValue(config, 'uv', []); - - var mesh = new Mesh(this.scene, 0, 0, vertices, uv, colors, alphas, key, frame); - - if (addToScene !== undefined) + GameObjectFactory.register('mesh', function (x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas) { - config.add = addToScene; - } - - BuildGameObject(this.scene, mesh, config); - - return mesh; -}); - -// When registering a factory function 'this' refers to the GameObjectCreator context. + return this.displayList.add(new Mesh(this.scene, x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas)); + }); +} /***/ }), -/* 1107 */ +/* 1167 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164397,60 +173334,10 @@ GameObjectCreator.register('mesh', function (config, addToScene) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); var GetAdvancedValue = __webpack_require__(15); -var Quad = __webpack_require__(214); - -/** - * Creates a new Quad Game Object and returns it. - * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. - * - * @method Phaser.GameObjects.GameObjectCreator#quad - * @since 3.0.0 - * - * @param {object} config - The configuration object this Game Object will use to create itself. - * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. - * - * @return {Phaser.GameObjects.Quad} The Game Object that was created. - */ -GameObjectCreator.register('quad', function (config, addToScene) -{ - if (config === undefined) { config = {}; } - - var x = GetAdvancedValue(config, 'x', 0); - var y = GetAdvancedValue(config, 'y', 0); - var key = GetAdvancedValue(config, 'key', null); - var frame = GetAdvancedValue(config, 'frame', null); - - var quad = new Quad(this.scene, x, y, key, frame); - - if (addToScene !== undefined) - { - config.add = addToScene; - } - - BuildGameObject(this.scene, quad, config); - - return quad; -}); - - -/***/ }), -/* 1108 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BuildGameObject = __webpack_require__(27); -var GameObjectCreator = __webpack_require__(16); -var GetAdvancedValue = __webpack_require__(15); -var Shader = __webpack_require__(215); +var Shader = __webpack_require__(220); /** * Creates a new Shader Game Object and returns it. @@ -164491,7 +173378,63 @@ GameObjectCreator.register('shader', function (config, addToScene) /***/ }), -/* 1109 */ +/* 1168 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = __webpack_require__(28); +var GameObjectCreator = __webpack_require__(17); +var GetAdvancedValue = __webpack_require__(15); +var GetValue = __webpack_require__(6); +var Mesh = __webpack_require__(221); + +/** + * Creates a new Mesh Game Object and returns it. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#mesh + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Mesh} The Game Object that was created. + */ +GameObjectCreator.register('mesh', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + var vertices = GetValue(config, 'vertices', []); + var uvs = GetValue(config, 'uvs', []); + var indicies = GetValue(config, 'indicies', []); + var containsZ = GetValue(config, 'containsZ', false); + var normals = GetValue(config, 'normals', []); + var colors = GetValue(config, 'colors', 0xffffff); + var alphas = GetValue(config, 'alphas', 1); + + var mesh = new Mesh(this.scene, 0, 0, key, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, mesh, config); + + return mesh; +}); + + +/***/ }), +/* 1169 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164501,8 +173444,251 @@ GameObjectCreator.register('shader', function (config, addToScene) */ var Class = __webpack_require__(0); -var LightsManager = __webpack_require__(447); -var PluginCache = __webpack_require__(23); +var Components = __webpack_require__(11); +var GameObject = __webpack_require__(14); +var IntegerToRGB = __webpack_require__(181); +var RGB = __webpack_require__(376); + +/** + * @classdesc + * An Image Game Object. + * + * An Image is a light-weight Game Object useful for the display of static images in your game, + * such as logos, backgrounds, scenery or other non-animated elements. Images can have input + * events and physics bodies, or be tweened, tinted or scrolled. The main difference between an + * Image and a Sprite is that you cannot animate an Image as they do not have the Animation component. + * + * @class PointLight + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.50.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + */ +var PointLight = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Pipeline, + Components.ScrollFactor, + Components.Transform, + Components.Visible + ], + + initialize: + + function PointLight (scene, x, y, color, radius, intensity) + { + if (color === undefined) { color = 0xffffff; } + if (radius === undefined) { radius = 128; } + if (intensity === undefined) { intensity = 10; } + + GameObject.call(this, scene, 'PointLight'); + + this.initPipeline('Light2D'); + + this.setPosition(x, y); + + var rgb = IntegerToRGB(color); + + this.color = new RGB( + rgb.r / 255, + rgb.g / 255, + rgb.b / 255 + ); + + this.intensity = intensity; + + // read only: + this.width = radius * 2; + this.height = radius * 2; + + // private + this._radius = radius; + }, + + radius: { + + get: function () + { + return this._radius; + }, + + set: function (value) + { + this._radius = value; + this.width = value * 2; + this.height = value * 2; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#originX + * @type {number} + * @readonly + * @since 3.4.0 + */ + originX: { + + get: function () + { + return 0.5; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#originY + * @type {number} + * @readonly + * @since 3.4.0 + */ + originY: { + + get: function () + { + return 0.5; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#displayOriginX + * @type {number} + * @readonly + * @since 3.4.0 + */ + displayOriginX: { + + get: function () + { + return this._radius; + } + + }, + + /** + * Internal value to allow Containers to be used for input and physics. + * Do not change this value. It has no effect other than to break things. + * + * @name Phaser.GameObjects.Container#displayOriginY + * @type {number} + * @readonly + * @since 3.4.0 + */ + displayOriginY: { + + get: function () + { + return this._radius; + } + + }, + + renderWebGL: function (renderer, src, camera, parentTransformMatrix) + { + var pipeline = renderer.pipelines.set(src.pipeline); + + var camMatrix = pipeline.tempMatrix1; + var lightMatrix = pipeline.tempMatrix2; + var calcMatrix = pipeline.tempMatrix3; + + var width = src.width; + var height = src.height; + + var x = -src.radius; + var y = -src.radius; + + var xw = x + width; + var yh = y + height; + + lightMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentTransformMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + lightMatrix.e = src.x; + lightMatrix.f = src.y; + } + else + { + lightMatrix.e -= camera.scrollX * src.scrollFactorX; + lightMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(lightMatrix, calcMatrix); + + var lightX = calcMatrix.getX(0, 0); + var lightY = calcMatrix.getY(0, 0); + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + pipeline.batchLight(src, camera, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, lightX, lightY); + } + +}); + +module.exports = PointLight; + + +/***/ }), +/* 1170 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var LightsManager = __webpack_require__(459); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); /** @@ -164607,7 +173793,7 @@ module.exports = LightsPlugin; /***/ }), -/* 1110 */ +/* 1171 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164616,29 +173802,29 @@ module.exports = LightsPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); +var Circle = __webpack_require__(71); -Circle.Area = __webpack_require__(1111); -Circle.Circumference = __webpack_require__(279); -Circle.CircumferencePoint = __webpack_require__(159); -Circle.Clone = __webpack_require__(1112); -Circle.Contains = __webpack_require__(57); -Circle.ContainsPoint = __webpack_require__(1113); -Circle.ContainsRect = __webpack_require__(1114); -Circle.CopyFrom = __webpack_require__(1115); -Circle.Equals = __webpack_require__(1116); -Circle.GetBounds = __webpack_require__(1117); -Circle.GetPoint = __webpack_require__(277); -Circle.GetPoints = __webpack_require__(278); -Circle.Offset = __webpack_require__(1118); -Circle.OffsetPoint = __webpack_require__(1119); -Circle.Random = __webpack_require__(160); +Circle.Area = __webpack_require__(1172); +Circle.Circumference = __webpack_require__(294); +Circle.CircumferencePoint = __webpack_require__(160); +Circle.Clone = __webpack_require__(1173); +Circle.Contains = __webpack_require__(62); +Circle.ContainsPoint = __webpack_require__(1174); +Circle.ContainsRect = __webpack_require__(1175); +Circle.CopyFrom = __webpack_require__(1176); +Circle.Equals = __webpack_require__(1177); +Circle.GetBounds = __webpack_require__(1178); +Circle.GetPoint = __webpack_require__(292); +Circle.GetPoints = __webpack_require__(293); +Circle.Offset = __webpack_require__(1179); +Circle.OffsetPoint = __webpack_require__(1180); +Circle.Random = __webpack_require__(161); module.exports = Circle; /***/ }), -/* 1111 */ +/* 1172 */ /***/ (function(module, exports) { /** @@ -164666,7 +173852,7 @@ module.exports = Area; /***/ }), -/* 1112 */ +/* 1173 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164675,7 +173861,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); +var Circle = __webpack_require__(71); /** * Creates a new Circle instance based on the values contained in the given source. @@ -164696,7 +173882,7 @@ module.exports = Clone; /***/ }), -/* 1113 */ +/* 1174 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164705,7 +173891,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(57); +var Contains = __webpack_require__(62); /** * Check to see if the Circle contains the given Point object. @@ -164727,7 +173913,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1114 */ +/* 1175 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164736,7 +173922,7 @@ module.exports = ContainsPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(57); +var Contains = __webpack_require__(62); /** * Check to see if the Circle contains all four points of the given Rectangle object. @@ -164763,7 +173949,7 @@ module.exports = ContainsRect; /***/ }), -/* 1115 */ +/* 1176 */ /***/ (function(module, exports) { /** @@ -164795,7 +173981,7 @@ module.exports = CopyFrom; /***/ }), -/* 1116 */ +/* 1177 */ /***/ (function(module, exports) { /** @@ -164829,7 +174015,7 @@ module.exports = Equals; /***/ }), -/* 1117 */ +/* 1178 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164869,7 +174055,7 @@ module.exports = GetBounds; /***/ }), -/* 1118 */ +/* 1179 */ /***/ (function(module, exports) { /** @@ -164904,7 +174090,7 @@ module.exports = Offset; /***/ }), -/* 1119 */ +/* 1180 */ /***/ (function(module, exports) { /** @@ -164938,7 +174124,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1120 */ +/* 1181 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -164947,29 +174133,29 @@ module.exports = OffsetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(98); +var Ellipse = __webpack_require__(106); -Ellipse.Area = __webpack_require__(1121); -Ellipse.Circumference = __webpack_require__(414); -Ellipse.CircumferencePoint = __webpack_require__(204); -Ellipse.Clone = __webpack_require__(1122); -Ellipse.Contains = __webpack_require__(99); -Ellipse.ContainsPoint = __webpack_require__(1123); -Ellipse.ContainsRect = __webpack_require__(1124); -Ellipse.CopyFrom = __webpack_require__(1125); -Ellipse.Equals = __webpack_require__(1126); -Ellipse.GetBounds = __webpack_require__(1127); -Ellipse.GetPoint = __webpack_require__(412); -Ellipse.GetPoints = __webpack_require__(413); -Ellipse.Offset = __webpack_require__(1128); -Ellipse.OffsetPoint = __webpack_require__(1129); -Ellipse.Random = __webpack_require__(167); +Ellipse.Area = __webpack_require__(1182); +Ellipse.Circumference = __webpack_require__(424); +Ellipse.CircumferencePoint = __webpack_require__(209); +Ellipse.Clone = __webpack_require__(1183); +Ellipse.Contains = __webpack_require__(107); +Ellipse.ContainsPoint = __webpack_require__(1184); +Ellipse.ContainsRect = __webpack_require__(1185); +Ellipse.CopyFrom = __webpack_require__(1186); +Ellipse.Equals = __webpack_require__(1187); +Ellipse.GetBounds = __webpack_require__(1188); +Ellipse.GetPoint = __webpack_require__(422); +Ellipse.GetPoints = __webpack_require__(423); +Ellipse.Offset = __webpack_require__(1189); +Ellipse.OffsetPoint = __webpack_require__(1190); +Ellipse.Random = __webpack_require__(172); module.exports = Ellipse; /***/ }), -/* 1121 */ +/* 1182 */ /***/ (function(module, exports) { /** @@ -165003,7 +174189,7 @@ module.exports = Area; /***/ }), -/* 1122 */ +/* 1183 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165012,7 +174198,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Ellipse = __webpack_require__(98); +var Ellipse = __webpack_require__(106); /** * Creates a new Ellipse instance based on the values contained in the given source. @@ -165033,7 +174219,7 @@ module.exports = Clone; /***/ }), -/* 1123 */ +/* 1184 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165042,7 +174228,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(99); +var Contains = __webpack_require__(107); /** * Check to see if the Ellipse contains the given Point object. @@ -165064,7 +174250,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1124 */ +/* 1185 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165073,7 +174259,7 @@ module.exports = ContainsPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(99); +var Contains = __webpack_require__(107); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. @@ -165100,7 +174286,7 @@ module.exports = ContainsRect; /***/ }), -/* 1125 */ +/* 1186 */ /***/ (function(module, exports) { /** @@ -165132,7 +174318,7 @@ module.exports = CopyFrom; /***/ }), -/* 1126 */ +/* 1187 */ /***/ (function(module, exports) { /** @@ -165167,7 +174353,7 @@ module.exports = Equals; /***/ }), -/* 1127 */ +/* 1188 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165207,7 +174393,7 @@ module.exports = GetBounds; /***/ }), -/* 1128 */ +/* 1189 */ /***/ (function(module, exports) { /** @@ -165242,7 +174428,7 @@ module.exports = Offset; /***/ }), -/* 1129 */ +/* 1190 */ /***/ (function(module, exports) { /** @@ -165276,7 +174462,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1130 */ +/* 1191 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165287,7 +174473,7 @@ module.exports = OffsetPoint; */ var Point = __webpack_require__(4); -var CircleToCircle = __webpack_require__(216); +var CircleToCircle = __webpack_require__(222); /** * Checks if two Circles intersect and returns the intersection points as a Point object array. @@ -165370,7 +174556,7 @@ module.exports = GetCircleToCircle; /***/ }), -/* 1131 */ +/* 1192 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165380,8 +174566,8 @@ module.exports = GetCircleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(218); -var CircleToRectangle = __webpack_require__(217); +var GetLineToCircle = __webpack_require__(224); +var CircleToRectangle = __webpack_require__(223); /** * Checks for intersection between a circle and a rectangle, @@ -165420,7 +174606,7 @@ module.exports = GetCircleToRectangle; /***/ }), -/* 1132 */ +/* 1193 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165429,9 +174615,9 @@ module.exports = GetCircleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector4 = __webpack_require__(129); -var GetLineToPolygon = __webpack_require__(452); -var Line = __webpack_require__(40); +var Vector4 = __webpack_require__(135); +var GetLineToPolygon = __webpack_require__(464); +var Line = __webpack_require__(45); // Temp calculation segment var segment = new Line(); @@ -165522,7 +174708,7 @@ module.exports = GetRaysFromPointToPolygon; /***/ }), -/* 1133 */ +/* 1194 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165532,7 +174718,7 @@ module.exports = GetRaysFromPointToPolygon; */ var Rectangle = __webpack_require__(9); -var RectangleToRectangle = __webpack_require__(143); +var RectangleToRectangle = __webpack_require__(112); /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. @@ -165571,7 +174757,7 @@ module.exports = GetRectangleIntersection; /***/ }), -/* 1134 */ +/* 1195 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165581,8 +174767,8 @@ module.exports = GetRectangleIntersection; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToRectangle = __webpack_require__(220); -var RectangleToRectangle = __webpack_require__(143); +var GetLineToRectangle = __webpack_require__(226); +var RectangleToRectangle = __webpack_require__(112); /** * Checks if two Rectangles intersect and returns the intersection points as a Point object array. @@ -165622,7 +174808,7 @@ module.exports = GetRectangleToRectangle; /***/ }), -/* 1135 */ +/* 1196 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165632,8 +174818,8 @@ module.exports = GetRectangleToRectangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RectangleToTriangle = __webpack_require__(454); -var GetLineToRectangle = __webpack_require__(220); +var RectangleToTriangle = __webpack_require__(466); +var GetLineToRectangle = __webpack_require__(226); /** * Checks for intersection between Rectangle shape and Triangle shape, @@ -165670,7 +174856,7 @@ module.exports = GetRectangleToTriangle; /***/ }), -/* 1136 */ +/* 1197 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165680,8 +174866,8 @@ module.exports = GetRectangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetLineToCircle = __webpack_require__(218); -var TriangleToCircle = __webpack_require__(456); +var GetLineToCircle = __webpack_require__(224); +var TriangleToCircle = __webpack_require__(468); /** * Checks if a Triangle and a Circle intersect, and returns the intersection points as a Point object array. @@ -165719,7 +174905,7 @@ module.exports = GetTriangleToCircle; /***/ }), -/* 1137 */ +/* 1198 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165729,8 +174915,8 @@ module.exports = GetTriangleToCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TriangleToTriangle = __webpack_require__(459); -var GetTriangleToLine = __webpack_require__(457); +var TriangleToTriangle = __webpack_require__(471); +var GetTriangleToLine = __webpack_require__(469); /** * Checks if two Triangles intersect, and returns the intersection points as a Point object array. @@ -165768,7 +174954,7 @@ module.exports = GetTriangleToTriangle; /***/ }), -/* 1138 */ +/* 1199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165777,7 +174963,7 @@ module.exports = GetTriangleToTriangle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PointToLine = __webpack_require__(461); +var PointToLine = __webpack_require__(473); /** * Checks if a Point is located on the given line segment. @@ -165809,7 +174995,7 @@ module.exports = PointToLineSegment; /***/ }), -/* 1139 */ +/* 1200 */ /***/ (function(module, exports) { /** @@ -165849,7 +175035,7 @@ module.exports = RectangleToValues; /***/ }), -/* 1140 */ +/* 1201 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165858,43 +175044,43 @@ module.exports = RectangleToValues; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(40); +var Line = __webpack_require__(45); -Line.Angle = __webpack_require__(87); -Line.BresenhamPoints = __webpack_require__(297); -Line.CenterOn = __webpack_require__(1141); -Line.Clone = __webpack_require__(1142); -Line.CopyFrom = __webpack_require__(1143); -Line.Equals = __webpack_require__(1144); -Line.Extend = __webpack_require__(1145); -Line.GetEasedPoints = __webpack_require__(1146); -Line.GetMidPoint = __webpack_require__(1147); -Line.GetNearestPoint = __webpack_require__(1148); -Line.GetNormal = __webpack_require__(1149); -Line.GetPoint = __webpack_require__(284); -Line.GetPoints = __webpack_require__(162); -Line.GetShortestDistance = __webpack_require__(1150); -Line.Height = __webpack_require__(1151); -Line.Length = __webpack_require__(58); -Line.NormalAngle = __webpack_require__(462); -Line.NormalX = __webpack_require__(1152); -Line.NormalY = __webpack_require__(1153); -Line.Offset = __webpack_require__(1154); -Line.PerpSlope = __webpack_require__(1155); -Line.Random = __webpack_require__(163); -Line.ReflectAngle = __webpack_require__(1156); -Line.Rotate = __webpack_require__(1157); -Line.RotateAroundPoint = __webpack_require__(1158); -Line.RotateAroundXY = __webpack_require__(222); -Line.SetToAngle = __webpack_require__(1159); -Line.Slope = __webpack_require__(1160); -Line.Width = __webpack_require__(1161); +Line.Angle = __webpack_require__(92); +Line.BresenhamPoints = __webpack_require__(309); +Line.CenterOn = __webpack_require__(1202); +Line.Clone = __webpack_require__(1203); +Line.CopyFrom = __webpack_require__(1204); +Line.Equals = __webpack_require__(1205); +Line.Extend = __webpack_require__(1206); +Line.GetEasedPoints = __webpack_require__(1207); +Line.GetMidPoint = __webpack_require__(1208); +Line.GetNearestPoint = __webpack_require__(1209); +Line.GetNormal = __webpack_require__(1210); +Line.GetPoint = __webpack_require__(299); +Line.GetPoints = __webpack_require__(163); +Line.GetShortestDistance = __webpack_require__(1211); +Line.Height = __webpack_require__(1212); +Line.Length = __webpack_require__(63); +Line.NormalAngle = __webpack_require__(474); +Line.NormalX = __webpack_require__(1213); +Line.NormalY = __webpack_require__(1214); +Line.Offset = __webpack_require__(1215); +Line.PerpSlope = __webpack_require__(1216); +Line.Random = __webpack_require__(164); +Line.ReflectAngle = __webpack_require__(1217); +Line.Rotate = __webpack_require__(1218); +Line.RotateAroundPoint = __webpack_require__(1219); +Line.RotateAroundXY = __webpack_require__(228); +Line.SetToAngle = __webpack_require__(1220); +Line.Slope = __webpack_require__(1221); +Line.Width = __webpack_require__(1222); module.exports = Line; /***/ }), -/* 1141 */ +/* 1202 */ /***/ (function(module, exports) { /** @@ -165934,7 +175120,7 @@ module.exports = CenterOn; /***/ }), -/* 1142 */ +/* 1203 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -165943,7 +175129,7 @@ module.exports = CenterOn; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Line = __webpack_require__(40); +var Line = __webpack_require__(45); /** * Clone the given line. @@ -165964,7 +175150,7 @@ module.exports = Clone; /***/ }), -/* 1143 */ +/* 1204 */ /***/ (function(module, exports) { /** @@ -165995,7 +175181,7 @@ module.exports = CopyFrom; /***/ }), -/* 1144 */ +/* 1205 */ /***/ (function(module, exports) { /** @@ -166029,7 +175215,7 @@ module.exports = Equals; /***/ }), -/* 1145 */ +/* 1206 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166038,7 +175224,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); /** * Extends the start and end points of a Line by the given amounts. @@ -166087,7 +175273,7 @@ module.exports = Extend; /***/ }), -/* 1146 */ +/* 1207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166096,8 +175282,8 @@ module.exports = Extend; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DistanceBetweenPoints = __webpack_require__(333); -var GetEaseFunction = __webpack_require__(71); +var DistanceBetweenPoints = __webpack_require__(344); +var GetEaseFunction = __webpack_require__(78); var Point = __webpack_require__(4); /** @@ -166129,7 +175315,7 @@ var Point = __webpack_require__(4); * * @param {Phaser.Geom.Line} line - The Line object. * @param {(string|function)} ease - The ease to use. This can be either a string from the EaseMap, or a custom function. - * @param {integer} quantity - The number of points to return. Note that if you provide a `collinearThreshold`, the resulting array may not always contain this number of points. + * @param {number} quantity - The number of points to return. Note that if you provide a `collinearThreshold`, the resulting array may not always contain this number of points. * @param {number} [collinearThreshold=0] - An optional threshold. The final array is reduced so that each point is spaced out at least this distance apart. This helps reduce clustering in noisey eases. * @param {number[]} [easeParams] - An optional array of ease parameters to go with the ease. * @@ -166207,7 +175393,7 @@ module.exports = GetEasedPoints; /***/ }), -/* 1147 */ +/* 1208 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166245,7 +175431,7 @@ module.exports = GetMidPoint; /***/ }), -/* 1148 */ +/* 1209 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166300,7 +175486,7 @@ module.exports = GetNearestPoint; /***/ }), -/* 1149 */ +/* 1210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166310,7 +175496,7 @@ module.exports = GetNearestPoint; */ var MATH_CONST = __webpack_require__(13); -var Angle = __webpack_require__(87); +var Angle = __webpack_require__(92); var Point = __webpack_require__(4); /** @@ -166344,7 +175530,7 @@ module.exports = GetNormal; /***/ }), -/* 1150 */ +/* 1211 */ /***/ (function(module, exports) { /** @@ -166391,7 +175577,7 @@ module.exports = GetShortestDistance; /***/ }), -/* 1151 */ +/* 1212 */ /***/ (function(module, exports) { /** @@ -166419,7 +175605,7 @@ module.exports = Height; /***/ }), -/* 1152 */ +/* 1213 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166429,7 +175615,7 @@ module.exports = Height; */ var MATH_CONST = __webpack_require__(13); -var Angle = __webpack_require__(87); +var Angle = __webpack_require__(92); /** * Returns the x component of the normal vector of the given line. @@ -166450,7 +175636,7 @@ module.exports = NormalX; /***/ }), -/* 1153 */ +/* 1214 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166460,7 +175646,7 @@ module.exports = NormalX; */ var MATH_CONST = __webpack_require__(13); -var Angle = __webpack_require__(87); +var Angle = __webpack_require__(92); /** * The Y value of the normal of the given line. @@ -166482,7 +175668,7 @@ module.exports = NormalY; /***/ }), -/* 1154 */ +/* 1215 */ /***/ (function(module, exports) { /** @@ -166520,7 +175706,7 @@ module.exports = Offset; /***/ }), -/* 1155 */ +/* 1216 */ /***/ (function(module, exports) { /** @@ -166548,7 +175734,7 @@ module.exports = PerpSlope; /***/ }), -/* 1156 */ +/* 1217 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166557,8 +175743,8 @@ module.exports = PerpSlope; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Angle = __webpack_require__(87); -var NormalAngle = __webpack_require__(462); +var Angle = __webpack_require__(92); +var NormalAngle = __webpack_require__(474); /** * Calculate the reflected angle between two lines. @@ -166582,7 +175768,7 @@ module.exports = ReflectAngle; /***/ }), -/* 1157 */ +/* 1218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166591,7 +175777,7 @@ module.exports = ReflectAngle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(222); +var RotateAroundXY = __webpack_require__(228); /** * Rotate a line around its midpoint by the given angle in radians. @@ -166618,7 +175804,7 @@ module.exports = Rotate; /***/ }), -/* 1158 */ +/* 1219 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166627,7 +175813,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(222); +var RotateAroundXY = __webpack_require__(228); /** * Rotate a line around a point by the given angle in radians. @@ -166652,7 +175838,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1159 */ +/* 1220 */ /***/ (function(module, exports) { /** @@ -166692,7 +175878,7 @@ module.exports = SetToAngle; /***/ }), -/* 1160 */ +/* 1221 */ /***/ (function(module, exports) { /** @@ -166720,7 +175906,7 @@ module.exports = Slope; /***/ }), -/* 1161 */ +/* 1222 */ /***/ (function(module, exports) { /** @@ -166748,7 +175934,334 @@ module.exports = Width; /***/ }), -/* 1162 */ +/* 1223 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Geom.Mesh + */ + +var Mesh = { + + Face: __webpack_require__(111), + GenerateGridVerts: __webpack_require__(1224), + GenerateObjVerts: __webpack_require__(457), + GenerateVerts: __webpack_require__(456), + ParseObj: __webpack_require__(475), + ParseObjMaterial: __webpack_require__(476), + RotateFace: __webpack_require__(1225), + Vertex: __webpack_require__(113) + +}; + +module.exports = Mesh; + + +/***/ }), +/* 1224 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = __webpack_require__(111); +var GetFastValue = __webpack_require__(2); +var Matrix4 = __webpack_require__(73); +var Vector3 = __webpack_require__(37); +var Vertex = __webpack_require__(113); + +var tempPosition = new Vector3(); +var tempRotation = new Vector3(); +var tempMatrix = new Matrix4(); + +/** + * Creates a grid of vertices based on the given configuration object and optionally adds it to a Mesh. + * + * The size of the grid is given in pixels. An example configuration may be: + * + * `{ width: 256, height: 256, widthSegments: 2, heightSegments: 2, tile: true }` + * + * This will create a grid 256 x 256 pixels in size, split into 2 x 2 segments, with + * the texture tiling across the cells. + * + * You can split the grid into segments both vertically and horizontally. This will + * generate two faces per grid segment as a result. + * + * The `tile` parameter allows you to control if the tile will repeat across the grid + * segments, or be displayed in full. + * + * If adding this grid to a Mesh you can offset the grid via the `x` and `y` properties. + * + * UV coordinates are generated based on the given texture and frame in the config. For + * example, no frame is given, the UVs will be in the range 0 to 1. If a frame is given, + * such as from a texture atlas, the UVs will be generated within the range of that frame. + * + * @function Phaser.Geom.Mesh.GeneraterGridVerts + * @since 3.50.0 + * + * @param {Phaser.Types.Geom.Mesh.GenerateGridConfig} config - A Grid configuration object. + * + * @return {Phaser.Types.Geom.Mesh.GenerateGridVertsResult} A Grid Result object, containing the generated vertices and indicies. + */ +var GenerateGridVerts = function (config) +{ + var mesh = GetFastValue(config, 'mesh'); + var texture = GetFastValue(config, 'texture', null); + var frame = GetFastValue(config, 'frame'); + var width = GetFastValue(config, 'width', 1); + var height = GetFastValue(config, 'height', width); + var widthSegments = GetFastValue(config, 'widthSegments', 1); + var heightSegments = GetFastValue(config, 'heightSegments', widthSegments); + var posX = GetFastValue(config, 'x', 0); + var posY = GetFastValue(config, 'y', 0); + var posZ = GetFastValue(config, 'z', 0); + var rotateX = GetFastValue(config, 'rotateX', 0); + var rotateY = GetFastValue(config, 'rotateY', 0); + var rotateZ = GetFastValue(config, 'rotateZ', 0); + var zIsUp = GetFastValue(config, 'zIsUp', true); + var isOrtho = GetFastValue(config, 'isOrtho', (mesh) ? mesh.dirtyCache[11] : false); + var colors = GetFastValue(config, 'colors', [ 0xffffff ]); + var alphas = GetFastValue(config, 'alphas', [ 1 ]); + var tile = GetFastValue(config, 'tile', false); + + var widthSet = GetFastValue(config, 'width', null); + + var result = { + faces: [], + verts: [] + }; + + tempPosition.set(posX, posY, posZ); + tempRotation.set(rotateX, rotateY, rotateZ); + tempMatrix.fromRotationXYTranslation(tempRotation, tempPosition, zIsUp); + + if (!texture && mesh) + { + texture = mesh.texture; + } + else if (mesh && typeof(texture) === 'string') + { + texture = mesh.scene.sys.textures.get(texture); + } + else + { + // There's nothing more we can do without a texture + return result; + } + + var textureFrame = texture.get(frame); + + // If the Mesh is ortho and no width / height is given, we'll default to texture sizes (if set!) + if (!widthSet && isOrtho && texture && mesh) + { + width = textureFrame.width / mesh.height; + height = textureFrame.height / mesh.height; + } + + var halfWidth = width / 2; + var halfHeight = height / 2; + + var gridX = Math.floor(widthSegments); + var gridY = Math.floor(heightSegments); + + var gridX1 = gridX + 1; + var gridY1 = gridY + 1; + + var segmentWidth = width / gridX; + var segmentHeight = height / gridY; + + var uvs = []; + var vertices = []; + + var ix; + var iy; + + var frameU0 = 0; + var frameU1 = 1; + var frameV0 = 0; + var frameV1 = 1; + + if (textureFrame) + { + frameU0 = textureFrame.u0; + frameU1 = textureFrame.u1; + frameV0 = textureFrame.v0; + frameV1 = textureFrame.v1; + } + + var frameU = frameU1 - frameU0; + var frameV = frameV1 - frameV0; + + for (iy = 0; iy < gridY1; iy++) + { + var y = iy * segmentHeight - halfHeight; + + for (ix = 0; ix < gridX1; ix++) + { + var x = ix * segmentWidth - halfWidth; + + vertices.push(x, -y); + + var tu = frameU0 + frameU * (ix / gridX); + var tv = frameV0 + frameV * (iy / gridY); + + uvs.push(tu, tv); + } + } + + if (!Array.isArray(colors)) + { + colors = [ colors ]; + } + + if (!Array.isArray(alphas)) + { + alphas = [ alphas ]; + } + + var alphaIndex = 0; + var colorIndex = 0; + + for (iy = 0; iy < gridY; iy++) + { + for (ix = 0; ix < gridX; ix++) + { + var a = (ix + gridX1 * iy) * 2; + var b = (ix + gridX1 * (iy + 1)) * 2; + var c = ((ix + 1) + gridX1 * (iy + 1)) * 2; + var d = ((ix + 1) + gridX1 * iy) * 2; + + var color = colors[colorIndex]; + var alpha = alphas[alphaIndex]; + + var vert1 = new Vertex(vertices[a], vertices[a + 1], 0, uvs[a], uvs[a + 1], color, alpha).transformMat4(tempMatrix); + var vert2 = new Vertex(vertices[b], vertices[b + 1], 0, uvs[b], uvs[b + 1], color, alpha).transformMat4(tempMatrix); + var vert3 = new Vertex(vertices[d], vertices[d + 1], 0, uvs[d], uvs[d + 1], color, alpha).transformMat4(tempMatrix); + var vert4 = new Vertex(vertices[b], vertices[b + 1], 0, uvs[b], uvs[b + 1], color, alpha).transformMat4(tempMatrix); + var vert5 = new Vertex(vertices[c], vertices[c + 1], 0, uvs[c], uvs[c + 1], color, alpha).transformMat4(tempMatrix); + var vert6 = new Vertex(vertices[d], vertices[d + 1], 0, uvs[d], uvs[d + 1], color, alpha).transformMat4(tempMatrix); + + if (tile) + { + vert1.setUVs(frameU0, frameV1); + vert2.setUVs(frameU0, frameV0); + vert3.setUVs(frameU1, frameV1); + vert4.setUVs(frameU0, frameV0); + vert5.setUVs(frameU1, frameV0); + vert6.setUVs(frameU1, frameV1); + } + + colorIndex++; + + if (colorIndex === colors.length) + { + colorIndex = 0; + } + + alphaIndex++; + + if (alphaIndex === alphas.length) + { + alphaIndex = 0; + } + + result.verts.push(vert1, vert2, vert3, vert4, vert5, vert6); + + result.faces.push( + new Face(vert1, vert2, vert3), + new Face(vert4, vert5, vert6) + ); + } + } + + if (mesh) + { + mesh.faces = mesh.faces.concat(result.faces); + mesh.vertices = mesh.vertices.concat(result.verts); + } + + return result; +}; + +module.exports = GenerateGridVerts; + + +/***/ }), +/* 1225 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotates the vertices of a Face to the given angle. + * + * The actual vertex positions are adjusted, not their transformed positions. + * + * Therefore, this updates the vertex data directly. + * + * @function Phaser.Geom.Mesh.RotateFace + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Face} face - The Face to rotate. + * @param {number} angle - The angle to rotate to, in radians. + * @param {number} [cx] - An optional center of rotation. If not given, the Face in-center is used. + * @param {number} [cy] - An optional center of rotation. If not given, the Face in-center is used. + */ +var RotateFace = function (face, angle, cx, cy) +{ + var x; + var y; + + // No point of rotation? Use the inCenter instead, then. + if (cx === undefined && cy === undefined) + { + var inCenter = face.getInCenter(); + + x = inCenter.x; + y = inCenter.y; + } + + var c = Math.cos(angle); + var s = Math.sin(angle); + + var v1 = face.vertex1; + var v2 = face.vertex2; + var v3 = face.vertex3; + + var tx = v1.x - x; + var ty = v1.y - y; + + v1.set(tx * c - ty * s + x, tx * s + ty * c + y); + + tx = v2.x - x; + ty = v2.y - y; + + v2.set(tx * c - ty * s + x, tx * s + ty * c + y); + + tx = v3.x - x; + ty = v3.y - y; + + v3.set(tx * c - ty * s + x, tx * s + ty * c + y); +}; + +module.exports = RotateFace; + + +/***/ }), +/* 1226 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166759,27 +176272,27 @@ module.exports = Width; var Point = __webpack_require__(4); -Point.Ceil = __webpack_require__(1163); -Point.Clone = __webpack_require__(1164); -Point.CopyFrom = __webpack_require__(1165); -Point.Equals = __webpack_require__(1166); -Point.Floor = __webpack_require__(1167); -Point.GetCentroid = __webpack_require__(1168); -Point.GetMagnitude = __webpack_require__(463); -Point.GetMagnitudeSq = __webpack_require__(464); -Point.GetRectangleFromPoints = __webpack_require__(1169); -Point.Interpolate = __webpack_require__(1170); -Point.Invert = __webpack_require__(1171); -Point.Negative = __webpack_require__(1172); -Point.Project = __webpack_require__(1173); -Point.ProjectUnit = __webpack_require__(1174); -Point.SetMagnitude = __webpack_require__(1175); +Point.Ceil = __webpack_require__(1227); +Point.Clone = __webpack_require__(1228); +Point.CopyFrom = __webpack_require__(1229); +Point.Equals = __webpack_require__(1230); +Point.Floor = __webpack_require__(1231); +Point.GetCentroid = __webpack_require__(1232); +Point.GetMagnitude = __webpack_require__(477); +Point.GetMagnitudeSq = __webpack_require__(478); +Point.GetRectangleFromPoints = __webpack_require__(1233); +Point.Interpolate = __webpack_require__(1234); +Point.Invert = __webpack_require__(1235); +Point.Negative = __webpack_require__(1236); +Point.Project = __webpack_require__(1237); +Point.ProjectUnit = __webpack_require__(1238); +Point.SetMagnitude = __webpack_require__(1239); module.exports = Point; /***/ }), -/* 1163 */ +/* 1227 */ /***/ (function(module, exports) { /** @@ -166809,7 +176322,7 @@ module.exports = Ceil; /***/ }), -/* 1164 */ +/* 1228 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166839,7 +176352,7 @@ module.exports = Clone; /***/ }), -/* 1165 */ +/* 1229 */ /***/ (function(module, exports) { /** @@ -166870,7 +176383,7 @@ module.exports = CopyFrom; /***/ }), -/* 1166 */ +/* 1230 */ /***/ (function(module, exports) { /** @@ -166899,7 +176412,7 @@ module.exports = Equals; /***/ }), -/* 1167 */ +/* 1231 */ /***/ (function(module, exports) { /** @@ -166929,7 +176442,7 @@ module.exports = Floor; /***/ }), -/* 1168 */ +/* 1232 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -166993,7 +176506,7 @@ module.exports = GetCentroid; /***/ }), -/* 1169 */ +/* 1233 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167063,7 +176576,7 @@ module.exports = GetRectangleFromPoints; /***/ }), -/* 1170 */ +/* 1234 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167104,7 +176617,7 @@ module.exports = Interpolate; /***/ }), -/* 1171 */ +/* 1235 */ /***/ (function(module, exports) { /** @@ -167134,7 +176647,7 @@ module.exports = Invert; /***/ }), -/* 1172 */ +/* 1236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167169,7 +176682,7 @@ module.exports = Negative; /***/ }), -/* 1173 */ +/* 1237 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167179,7 +176692,7 @@ module.exports = Negative; */ var Point = __webpack_require__(4); -var GetMagnitudeSq = __webpack_require__(464); +var GetMagnitudeSq = __webpack_require__(478); /** * Calculates the vector projection of `pointA` onto the nonzero `pointB`. This is the @@ -167216,7 +176729,7 @@ module.exports = Project; /***/ }), -/* 1174 */ +/* 1238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167261,7 +176774,7 @@ module.exports = ProjectUnit; /***/ }), -/* 1175 */ +/* 1239 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167270,7 +176783,7 @@ module.exports = ProjectUnit; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetMagnitude = __webpack_require__(463); +var GetMagnitude = __webpack_require__(477); /** * Changes the magnitude (length) of a two-dimensional vector without changing its direction. @@ -167305,7 +176818,7 @@ module.exports = SetMagnitude; /***/ }), -/* 1176 */ +/* 1240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167314,26 +176827,26 @@ module.exports = SetMagnitude; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(212); +var Polygon = __webpack_require__(218); -Polygon.Clone = __webpack_require__(1177); -Polygon.Contains = __webpack_require__(213); -Polygon.ContainsPoint = __webpack_require__(1178); -Polygon.Earcut = __webpack_require__(60); -Polygon.GetAABB = __webpack_require__(436); -Polygon.GetNumberArray = __webpack_require__(1179); -Polygon.GetPoints = __webpack_require__(437); -Polygon.Perimeter = __webpack_require__(438); -Polygon.Reverse = __webpack_require__(1180); -Polygon.Simplify = __webpack_require__(1181); -Polygon.Smooth = __webpack_require__(439); -Polygon.Translate = __webpack_require__(1182); +Polygon.Clone = __webpack_require__(1241); +Polygon.Contains = __webpack_require__(219); +Polygon.ContainsPoint = __webpack_require__(1242); +Polygon.Earcut = __webpack_require__(65); +Polygon.GetAABB = __webpack_require__(446); +Polygon.GetNumberArray = __webpack_require__(1243); +Polygon.GetPoints = __webpack_require__(447); +Polygon.Perimeter = __webpack_require__(448); +Polygon.Reverse = __webpack_require__(1244); +Polygon.Simplify = __webpack_require__(1245); +Polygon.Smooth = __webpack_require__(449); +Polygon.Translate = __webpack_require__(1246); module.exports = Polygon; /***/ }), -/* 1177 */ +/* 1241 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167342,7 +176855,7 @@ module.exports = Polygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Polygon = __webpack_require__(212); +var Polygon = __webpack_require__(218); /** * Create a new polygon which is a copy of the specified polygon @@ -167363,7 +176876,7 @@ module.exports = Clone; /***/ }), -/* 1178 */ +/* 1242 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167372,7 +176885,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(213); +var Contains = __webpack_require__(219); /** * Checks the given Point again the Polygon to see if the Point lays within its vertices. @@ -167394,7 +176907,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1179 */ +/* 1243 */ /***/ (function(module, exports) { /** @@ -167437,7 +176950,7 @@ module.exports = GetNumberArray; /***/ }), -/* 1180 */ +/* 1244 */ /***/ (function(module, exports) { /** @@ -167469,10 +176982,9 @@ module.exports = Reverse; /***/ }), -/* 1181 */ -/***/ (function(module, exports, __webpack_require__) { +/* 1245 */ +/***/ (function(module, exports) { -"use strict"; /** * @author Richard Davey * @author Vladimir Agafonkin @@ -167504,8 +177016,6 @@ module.exports = Reverse; * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - - /** * @ignore */ @@ -167679,7 +177189,7 @@ module.exports = Simplify; /***/ }), -/* 1182 */ +/* 1246 */ /***/ (function(module, exports) { /** @@ -167719,7 +177229,7 @@ module.exports = Translate; /***/ }), -/* 1183 */ +/* 1247 */ /***/ (function(module, exports) { /** @@ -167747,7 +177257,7 @@ module.exports = Area; /***/ }), -/* 1184 */ +/* 1248 */ /***/ (function(module, exports) { /** @@ -167780,7 +177290,7 @@ module.exports = Ceil; /***/ }), -/* 1185 */ +/* 1249 */ /***/ (function(module, exports) { /** @@ -167815,7 +177325,7 @@ module.exports = CeilAll; /***/ }), -/* 1186 */ +/* 1250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167845,7 +177355,7 @@ module.exports = Clone; /***/ }), -/* 1187 */ +/* 1251 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167854,7 +177364,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(50); +var Contains = __webpack_require__(56); /** * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object. @@ -167876,7 +177386,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1188 */ +/* 1252 */ /***/ (function(module, exports) { /** @@ -167907,7 +177417,7 @@ module.exports = CopyFrom; /***/ }), -/* 1189 */ +/* 1253 */ /***/ (function(module, exports) { /** @@ -167941,7 +177451,7 @@ module.exports = Equals; /***/ }), -/* 1190 */ +/* 1254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -167950,7 +177460,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(223); +var GetAspectRatio = __webpack_require__(229); /** * Adjusts the target rectangle, changing its width, height and position, @@ -167994,7 +177504,7 @@ module.exports = FitInside; /***/ }), -/* 1191 */ +/* 1255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168003,7 +177513,7 @@ module.exports = FitInside; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAspectRatio = __webpack_require__(223); +var GetAspectRatio = __webpack_require__(229); /** * Adjusts the target rectangle, changing its width, height and position, @@ -168047,7 +177557,7 @@ module.exports = FitOutside; /***/ }), -/* 1192 */ +/* 1256 */ /***/ (function(module, exports) { /** @@ -168080,7 +177590,7 @@ module.exports = Floor; /***/ }), -/* 1193 */ +/* 1257 */ /***/ (function(module, exports) { /** @@ -168115,7 +177625,7 @@ module.exports = FloorAll; /***/ }), -/* 1194 */ +/* 1258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168158,7 +177668,7 @@ module.exports = FromXY; /***/ }), -/* 1195 */ +/* 1259 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168196,7 +177706,7 @@ module.exports = GetCenter; /***/ }), -/* 1196 */ +/* 1260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168236,7 +177746,7 @@ module.exports = GetSize; /***/ }), -/* 1197 */ +/* 1261 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168245,7 +177755,7 @@ module.exports = GetSize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CenterOn = __webpack_require__(178); +var CenterOn = __webpack_require__(182); /** @@ -168278,7 +177788,7 @@ module.exports = Inflate; /***/ }), -/* 1198 */ +/* 1262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168288,7 +177798,7 @@ module.exports = Inflate; */ var Rectangle = __webpack_require__(9); -var Intersects = __webpack_require__(143); +var Intersects = __webpack_require__(112); /** * Takes two Rectangles and first checks to see if they intersect. @@ -168329,7 +177839,7 @@ module.exports = Intersection; /***/ }), -/* 1199 */ +/* 1263 */ /***/ (function(module, exports) { /** @@ -168378,7 +177888,7 @@ module.exports = MergePoints; /***/ }), -/* 1200 */ +/* 1264 */ /***/ (function(module, exports) { /** @@ -168425,7 +177935,7 @@ module.exports = MergeRect; /***/ }), -/* 1201 */ +/* 1265 */ /***/ (function(module, exports) { /** @@ -168469,7 +177979,7 @@ module.exports = MergeXY; /***/ }), -/* 1202 */ +/* 1266 */ /***/ (function(module, exports) { /** @@ -168504,7 +178014,7 @@ module.exports = Offset; /***/ }), -/* 1203 */ +/* 1267 */ /***/ (function(module, exports) { /** @@ -168538,7 +178048,7 @@ module.exports = OffsetPoint; /***/ }), -/* 1204 */ +/* 1268 */ /***/ (function(module, exports) { /** @@ -168572,7 +178082,7 @@ module.exports = Overlaps; /***/ }), -/* 1205 */ +/* 1269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168582,7 +178092,7 @@ module.exports = Overlaps; */ var Point = __webpack_require__(4); -var DegToRad = __webpack_require__(41); +var DegToRad = __webpack_require__(34); /** * Returns a Point from the perimeter of a Rectangle based on the given angle. @@ -168593,7 +178103,7 @@ var DegToRad = __webpack_require__(41); * @generic {Phaser.Geom.Point} O - [out,$return] * * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. - * @param {integer} angle - The angle of the point, in degrees. + * @param {number} angle - The angle of the point, in degrees. * @param {Phaser.Geom.Point} [out] - The Point object to store the position in. If not given, a new Point instance is created. * * @return {Phaser.Geom.Point} A Point object holding the coordinates of the Rectangle perimeter. @@ -168629,7 +178139,7 @@ module.exports = PerimeterPoint; /***/ }), -/* 1206 */ +/* 1270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168638,8 +178148,8 @@ module.exports = PerimeterPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Between = __webpack_require__(182); -var ContainsRect = __webpack_require__(466); +var Between = __webpack_require__(187); +var ContainsRect = __webpack_require__(480); var Point = __webpack_require__(4); /** @@ -168700,7 +178210,7 @@ module.exports = RandomOutside; /***/ }), -/* 1207 */ +/* 1271 */ /***/ (function(module, exports) { /** @@ -168729,7 +178239,7 @@ module.exports = SameDimensions; /***/ }), -/* 1208 */ +/* 1272 */ /***/ (function(module, exports) { /** @@ -168768,7 +178278,7 @@ module.exports = Scale; /***/ }), -/* 1209 */ +/* 1273 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168777,38 +178287,38 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); -Triangle.Area = __webpack_require__(1210); -Triangle.BuildEquilateral = __webpack_require__(1211); -Triangle.BuildFromPolygon = __webpack_require__(1212); -Triangle.BuildRight = __webpack_require__(1213); -Triangle.CenterOn = __webpack_require__(1214); -Triangle.Centroid = __webpack_require__(467); -Triangle.CircumCenter = __webpack_require__(1215); -Triangle.CircumCircle = __webpack_require__(1216); -Triangle.Clone = __webpack_require__(1217); -Triangle.Contains = __webpack_require__(85); -Triangle.ContainsArray = __webpack_require__(221); -Triangle.ContainsPoint = __webpack_require__(1218); -Triangle.CopyFrom = __webpack_require__(1219); -Triangle.Decompose = __webpack_require__(460); -Triangle.Equals = __webpack_require__(1220); -Triangle.GetPoint = __webpack_require__(443); -Triangle.GetPoints = __webpack_require__(444); -Triangle.InCenter = __webpack_require__(469); -Triangle.Perimeter = __webpack_require__(1221); -Triangle.Offset = __webpack_require__(468); -Triangle.Random = __webpack_require__(168); -Triangle.Rotate = __webpack_require__(1222); -Triangle.RotateAroundPoint = __webpack_require__(1223); -Triangle.RotateAroundXY = __webpack_require__(224); +Triangle.Area = __webpack_require__(1274); +Triangle.BuildEquilateral = __webpack_require__(1275); +Triangle.BuildFromPolygon = __webpack_require__(1276); +Triangle.BuildRight = __webpack_require__(1277); +Triangle.CenterOn = __webpack_require__(1278); +Triangle.Centroid = __webpack_require__(481); +Triangle.CircumCenter = __webpack_require__(1279); +Triangle.CircumCircle = __webpack_require__(1280); +Triangle.Clone = __webpack_require__(1281); +Triangle.Contains = __webpack_require__(110); +Triangle.ContainsArray = __webpack_require__(227); +Triangle.ContainsPoint = __webpack_require__(1282); +Triangle.CopyFrom = __webpack_require__(1283); +Triangle.Decompose = __webpack_require__(472); +Triangle.Equals = __webpack_require__(1284); +Triangle.GetPoint = __webpack_require__(453); +Triangle.GetPoints = __webpack_require__(454); +Triangle.InCenter = __webpack_require__(483); +Triangle.Perimeter = __webpack_require__(1285); +Triangle.Offset = __webpack_require__(482); +Triangle.Random = __webpack_require__(173); +Triangle.Rotate = __webpack_require__(1286); +Triangle.RotateAroundPoint = __webpack_require__(1287); +Triangle.RotateAroundXY = __webpack_require__(230); module.exports = Triangle; /***/ }), -/* 1210 */ +/* 1274 */ /***/ (function(module, exports) { /** @@ -168847,7 +178357,7 @@ module.exports = Area; /***/ }), -/* 1211 */ +/* 1275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168856,7 +178366,7 @@ module.exports = Area; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); /** * Builds an equilateral triangle. In the equilateral triangle, all the sides are the same length (congruent) and all the angles are the same size (congruent). @@ -168891,7 +178401,7 @@ module.exports = BuildEquilateral; /***/ }), -/* 1212 */ +/* 1276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168900,8 +178410,8 @@ module.exports = BuildEquilateral; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var EarCut = __webpack_require__(60); -var Triangle = __webpack_require__(73); +var EarCut = __webpack_require__(65); +var Triangle = __webpack_require__(80); /** * Takes an array of vertex coordinates, and optionally an array of hole indices, then returns an array @@ -168967,7 +178477,7 @@ module.exports = BuildFromPolygon; /***/ }), -/* 1213 */ +/* 1277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -168976,7 +178486,7 @@ module.exports = BuildFromPolygon; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); // Builds a right triangle, with one 90 degree angle and two acute angles // The x/y is the coordinate of the 90 degree angle (and will map to x1/y1 in the resulting Triangle) @@ -169016,7 +178526,7 @@ module.exports = BuildRight; /***/ }), -/* 1214 */ +/* 1278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169025,8 +178535,8 @@ module.exports = BuildRight; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Centroid = __webpack_require__(467); -var Offset = __webpack_require__(468); +var Centroid = __webpack_require__(481); +var Offset = __webpack_require__(482); /** * @callback CenterFunction @@ -169069,7 +178579,7 @@ module.exports = CenterOn; /***/ }), -/* 1215 */ +/* 1279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169145,7 +178655,7 @@ module.exports = CircumCenter; /***/ }), -/* 1216 */ +/* 1280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169154,7 +178664,7 @@ module.exports = CircumCenter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); +var Circle = __webpack_require__(71); // Adapted from https://gist.github.com/mutoo/5617691 @@ -169228,7 +178738,7 @@ module.exports = CircumCircle; /***/ }), -/* 1217 */ +/* 1281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169237,7 +178747,7 @@ module.exports = CircumCircle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Triangle = __webpack_require__(73); +var Triangle = __webpack_require__(80); /** * Clones a Triangle object. @@ -169258,7 +178768,7 @@ module.exports = Clone; /***/ }), -/* 1218 */ +/* 1282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169267,7 +178777,7 @@ module.exports = Clone; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = __webpack_require__(85); +var Contains = __webpack_require__(110); /** * Tests if a triangle contains a point. @@ -169289,7 +178799,7 @@ module.exports = ContainsPoint; /***/ }), -/* 1219 */ +/* 1283 */ /***/ (function(module, exports) { /** @@ -169320,7 +178830,7 @@ module.exports = CopyFrom; /***/ }), -/* 1220 */ +/* 1284 */ /***/ (function(module, exports) { /** @@ -169356,7 +178866,7 @@ module.exports = Equals; /***/ }), -/* 1221 */ +/* 1285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169365,7 +178875,7 @@ module.exports = Equals; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(58); +var Length = __webpack_require__(63); /** * Gets the length of the perimeter of the given triangle. @@ -169391,7 +178901,7 @@ module.exports = Perimeter; /***/ }), -/* 1222 */ +/* 1286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169400,8 +178910,8 @@ module.exports = Perimeter; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(224); -var InCenter = __webpack_require__(469); +var RotateAroundXY = __webpack_require__(230); +var InCenter = __webpack_require__(483); /** * Rotates a Triangle about its incenter, which is the point at which its three angle bisectors meet. @@ -169427,7 +178937,7 @@ module.exports = Rotate; /***/ }), -/* 1223 */ +/* 1287 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169436,7 +178946,7 @@ module.exports = Rotate; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateAroundXY = __webpack_require__(224); +var RotateAroundXY = __webpack_require__(230); /** * Rotates a Triangle at a certain angle about a given Point or object with public `x` and `y` properties. @@ -169461,7 +178971,7 @@ module.exports = RotateAroundPoint; /***/ }), -/* 1224 */ +/* 1288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169470,8 +178980,8 @@ module.exports = RotateAroundPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(189); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(194); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Input @@ -169479,17 +178989,17 @@ var Extend = __webpack_require__(19); var Input = { - CreatePixelPerfectHandler: __webpack_require__(470), - CreateInteractiveObject: __webpack_require__(471), - Events: __webpack_require__(56), - Gamepad: __webpack_require__(1225), - InputManager: __webpack_require__(376), - InputPlugin: __webpack_require__(1237), - InputPluginCache: __webpack_require__(144), - Keyboard: __webpack_require__(1238), - Mouse: __webpack_require__(1255), - Pointer: __webpack_require__(379), - Touch: __webpack_require__(1256) + CreatePixelPerfectHandler: __webpack_require__(484), + CreateInteractiveObject: __webpack_require__(485), + Events: __webpack_require__(49), + Gamepad: __webpack_require__(1289), + InputManager: __webpack_require__(386), + InputPlugin: __webpack_require__(1301), + InputPluginCache: __webpack_require__(146), + Keyboard: __webpack_require__(1302), + Mouse: __webpack_require__(1316), + Pointer: __webpack_require__(389), + Touch: __webpack_require__(1317) }; @@ -169500,7 +179010,7 @@ module.exports = Input; /***/ }), -/* 1225 */ +/* 1289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169515,18 +179025,18 @@ module.exports = Input; module.exports = { - Axis: __webpack_require__(472), - Button: __webpack_require__(473), - Events: __webpack_require__(225), - Gamepad: __webpack_require__(474), - GamepadPlugin: __webpack_require__(1232), + Axis: __webpack_require__(486), + Button: __webpack_require__(487), + Events: __webpack_require__(231), + Gamepad: __webpack_require__(488), + GamepadPlugin: __webpack_require__(1296), - Configs: __webpack_require__(1233) + Configs: __webpack_require__(1297) }; /***/ }), -/* 1226 */ +/* 1290 */ /***/ (function(module, exports) { /** @@ -169555,7 +179065,7 @@ module.exports = 'down'; /***/ }), -/* 1227 */ +/* 1291 */ /***/ (function(module, exports) { /** @@ -169584,7 +179094,7 @@ module.exports = 'up'; /***/ }), -/* 1228 */ +/* 1292 */ /***/ (function(module, exports) { /** @@ -169615,7 +179125,7 @@ module.exports = 'connected'; /***/ }), -/* 1229 */ +/* 1293 */ /***/ (function(module, exports) { /** @@ -169641,7 +179151,7 @@ module.exports = 'disconnected'; /***/ }), -/* 1230 */ +/* 1294 */ /***/ (function(module, exports) { /** @@ -169665,7 +179175,7 @@ module.exports = 'disconnected'; * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN * @since 3.10.0 * - * @param {integer} index - The index of the button that was pressed. + * @param {number} index - The index of the button that was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. */ @@ -169673,7 +179183,7 @@ module.exports = 'down'; /***/ }), -/* 1231 */ +/* 1295 */ /***/ (function(module, exports) { /** @@ -169697,7 +179207,7 @@ module.exports = 'down'; * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP * @since 3.10.0 * - * @param {integer} index - The index of the button that was released. + * @param {number} index - The index of the button that was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. */ @@ -169705,7 +179215,7 @@ module.exports = 'up'; /***/ }), -/* 1232 */ +/* 1296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -169715,12 +179225,12 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(225); -var Gamepad = __webpack_require__(474); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(231); +var Gamepad = __webpack_require__(488); var GetValue = __webpack_require__(6); -var InputPluginCache = __webpack_require__(144); -var InputEvents = __webpack_require__(56); +var InputPluginCache = __webpack_require__(146); +var InputEvents = __webpack_require__(49); /** * @classdesc @@ -169750,6 +179260,9 @@ var InputEvents = __webpack_require__(56); * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on * the `Gamepad` class for more details. * + * As of September 2020 Chrome, and likely other browsers, will soon start to require that games requesting + * access to the Gamepad API are running under SSL. They will actively block API access if they are not. + * * For more information about Gamepad support in browsers see the following resources: * * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API @@ -169931,6 +179444,8 @@ var GamepadPlugin = new Class({ if (this.enabled) { this.startListeners(); + + this.refreshPads(); } this.sceneInputPlugin.pluginEvents.once(InputEvents.SHUTDOWN, this.shutdown, this); @@ -170002,6 +179517,11 @@ var GamepadPlugin = new Class({ this.target.removeEventListener('gamepaddisconnected', this.onGamepadHandler); this.sceneInputPlugin.pluginEvents.off(InputEvents.UPDATE, this.update); + + for (var i = 0; i < this.gamepads.length; i++) + { + this.gamepads[i].removeAllListeners(); + } }, /** @@ -170014,7 +179534,7 @@ var GamepadPlugin = new Class({ { for (var i = 0; i < this.gamepads.length; i++) { - this.gamepads.connected = false; + this.gamepads[i].pad.connected = false; } }, @@ -170199,8 +179719,6 @@ var GamepadPlugin = new Class({ { this.stopListeners(); - this.disconnectAll(); - this.removeAllListeners(); }, @@ -170235,7 +179753,7 @@ var GamepadPlugin = new Class({ * The total number of connected game pads. * * @name Phaser.Input.Gamepad.GamepadPlugin#total - * @type {integer} + * @type {number} * @since 3.10.0 */ total: { @@ -170343,7 +179861,7 @@ module.exports = GamepadPlugin; /***/ }), -/* 1233 */ +/* 1297 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170358,15 +179876,15 @@ module.exports = GamepadPlugin; module.exports = { - DUALSHOCK_4: __webpack_require__(1234), - SNES_USB: __webpack_require__(1235), - XBOX_360: __webpack_require__(1236) + DUALSHOCK_4: __webpack_require__(1298), + SNES_USB: __webpack_require__(1299), + XBOX_360: __webpack_require__(1300) }; /***/ }), -/* 1234 */ +/* 1298 */ /***/ (function(module, exports) { /** @@ -170416,7 +179934,7 @@ module.exports = { /***/ }), -/* 1235 */ +/* 1299 */ /***/ (function(module, exports) { /** @@ -170455,7 +179973,7 @@ module.exports = { /***/ }), -/* 1236 */ +/* 1300 */ /***/ (function(module, exports) { /** @@ -170506,7 +180024,7 @@ module.exports = { /***/ }), -/* 1237 */ +/* 1301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -170515,27 +180033,27 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Circle = __webpack_require__(68); -var CircleContains = __webpack_require__(57); +var Circle = __webpack_require__(71); +var CircleContains = __webpack_require__(62); var Class = __webpack_require__(0); -var CONST = __webpack_require__(189); -var CreateInteractiveObject = __webpack_require__(471); -var CreatePixelPerfectHandler = __webpack_require__(470); -var DistanceBetween = __webpack_require__(55); -var Ellipse = __webpack_require__(98); -var EllipseContains = __webpack_require__(99); -var Events = __webpack_require__(56); -var EventEmitter = __webpack_require__(12); +var CONST = __webpack_require__(194); +var CreateInteractiveObject = __webpack_require__(485); +var CreatePixelPerfectHandler = __webpack_require__(484); +var DistanceBetween = __webpack_require__(61); +var Ellipse = __webpack_require__(106); +var EllipseContains = __webpack_require__(107); +var Events = __webpack_require__(49); +var EventEmitter = __webpack_require__(10); var GetFastValue = __webpack_require__(2); -var GEOM_CONST = __webpack_require__(49); -var InputPluginCache = __webpack_require__(144); +var GEOM_CONST = __webpack_require__(55); +var InputPluginCache = __webpack_require__(146); var IsPlainObject = __webpack_require__(7); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var Rectangle = __webpack_require__(9); -var RectangleContains = __webpack_require__(50); +var RectangleContains = __webpack_require__(56); var SceneEvents = __webpack_require__(20); -var Triangle = __webpack_require__(73); -var TriangleContains = __webpack_require__(85); +var Triangle = __webpack_require__(80); +var TriangleContains = __webpack_require__(110); /** * @classdesc @@ -170711,7 +180229,7 @@ var InputPlugin = new Class({ * Set to 0 to poll constantly. Set to -1 to only poll on user movement. * * @name Phaser.Input.InputPlugin#pollRate - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -170861,7 +180379,7 @@ var InputPlugin = new Class({ * A array containing the dragStates, for this Scene, index by the Pointer ID. * * @name Phaser.Input.InputPlugin#_dragState - * @type {integer[]} + * @type {number[]} * @private * @since 3.16.0 */ @@ -171178,7 +180696,7 @@ var InputPlugin = new Class({ * @fires Phaser.Input.Events#UPDATE * @since 3.0.0 * - * @param {integer} type - The type of event to process. + * @param {number} type - The type of event to process. * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. * * @return {boolean} `true` if this Scene has captured the input events from all other Scenes, otherwise `false`. @@ -171307,8 +180825,6 @@ var InputPlugin = new Class({ input.hitAreaCallback = undefined; input.callbackContext = undefined; - this.manager.resetCursor(input); - gameObject.input = null; // Clear from _draggable, _drag and _over @@ -171331,6 +180847,8 @@ var InputPlugin = new Class({ if (index > -1) { this._over[0].splice(index, 1); + + this.manager.resetCursor(input); } return gameObject; @@ -171468,7 +180986,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer being tested. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processDownEvents: function (pointer) { @@ -171544,7 +181062,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to get the drag state for. * - * @return {integer} The drag state of the given Pointer. + * @return {number} The drag state of the given Pointer. */ getDragState: function (pointer) { @@ -171567,7 +181085,7 @@ var InputPlugin = new Class({ * @since 3.16.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer to set the drag state for. - * @param {integer} state - The drag state value. An integer between 0 and 5. + * @param {number} state - The drag state value. An integer between 0 and 5. */ setDragState: function (pointer, state) { @@ -171621,7 +181139,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that DRAG_START was called on. + * @return {number} The number of items that DRAG_START was called on. */ processDragStartList: function (pointer) { @@ -171670,7 +181188,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were collected on the drag list. + * @return {number} The number of items that were collected on the drag list. */ processDragDownEvent: function (pointer) { @@ -171750,7 +181268,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were updated by this drag event. + * @return {number} The number of items that were updated by this drag event. */ processDragMoveEvent: function (pointer) { @@ -171890,7 +181408,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were updated by this drag event. + * @return {number} The number of items that were updated by this drag event. */ processDragUpEvent: function (pointer) { @@ -171955,7 +181473,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processMoveEvents: function (pointer) { @@ -172023,7 +181541,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processWheelEvent: function (pointer) { @@ -172091,7 +181609,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOverEvents: function (pointer) { @@ -172171,7 +181689,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOutEvents: function (pointer) { @@ -172199,34 +181717,31 @@ var InputPlugin = new Class({ var gameObject = previouslyOver[i]; // Call onOut for everything in the previouslyOver array - for (i = 0; i < total; i++) + gameObject = previouslyOver[i]; + + if (!gameObject.input) { - gameObject = previouslyOver[i]; + continue; + } - if (!gameObject.input) - { - continue; - } + manager.resetCursor(gameObject.input); - manager.resetCursor(gameObject.input); + gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); - gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); + totalInteracted++; - totalInteracted++; + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } - if (_eventData.cancelled || !gameObject.input) - { - aborted = true; - break; - } + this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); - this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); - - if (_eventData.cancelled || !gameObject.input) - { - aborted = true; - break; - } + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; } if (!aborted) @@ -172256,7 +181771,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOverOutEvents: function (pointer) { @@ -172432,7 +181947,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processUpEvents: function (pointer) { @@ -172601,7 +182116,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#makePixelPerfect * @since 3.10.0 * - * @param {integer} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction. + * @param {number} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction. * * @return {function} A Pixel Perfect Handler for use as a hitArea shape callback. */ @@ -173171,7 +182686,7 @@ var InputPlugin = new Class({ * @param {Phaser.GameObjects.GameObject} childA - The first Game Object to compare. * @param {Phaser.GameObjects.GameObject} childB - The second Game Object to compare. * - * @return {integer} Returns either a negative or positive integer, or zero if they match. + * @return {number} Returns either a negative or positive integer, or zero if they match. */ sortHandlerGO: function (childA, childB) { @@ -173259,7 +182774,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#addPointer * @since 3.10.0 * - * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * @param {number} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. * * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. */ @@ -173370,6 +182885,10 @@ var InputPlugin = new Class({ this.removeAllListeners(); + var manager = this.manager; + + manager.canvas.style.cursor = manager.defaultCursor; + var eventEmitter = this.systems.events; eventEmitter.off(SceneEvents.TRANSITION_START, this.transitionIn, this); @@ -173377,8 +182896,8 @@ var InputPlugin = new Class({ eventEmitter.off(SceneEvents.TRANSITION_COMPLETE, this.transitionComplete, this); eventEmitter.off(SceneEvents.PRE_UPDATE, this.preUpdate, this); - this.manager.events.off(Events.GAME_OUT, this.onGameOut, this); - this.manager.events.off(Events.GAME_OVER, this.onGameOver, this); + manager.events.off(Events.GAME_OUT, this.onGameOut, this); + manager.events.off(Events.GAME_OVER, this.onGameOver, this); eventEmitter.off(SceneEvents.SHUTDOWN, this.shutdown, this); }, @@ -173687,7 +183206,7 @@ module.exports = InputPlugin; /***/ }), -/* 1238 */ +/* 1302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173702,26 +183221,30 @@ module.exports = InputPlugin; module.exports = { - Events: __webpack_require__(145), + Events: __webpack_require__(147), - KeyboardManager: __webpack_require__(377), - KeyboardPlugin: __webpack_require__(1246), + KeyboardManager: __webpack_require__(387), + KeyboardPlugin: __webpack_require__(1310), - Key: __webpack_require__(475), - KeyCodes: __webpack_require__(132), + Key: __webpack_require__(489), + KeyCodes: __webpack_require__(138), - KeyCombo: __webpack_require__(476), + KeyCombo: __webpack_require__(490), + + AdvanceKeyCombo: __webpack_require__(492), + ProcessKeyCombo: __webpack_require__(491), + ResetKeyCombo: __webpack_require__(493), + + JustDown: __webpack_require__(1312), + JustUp: __webpack_require__(1313), + DownDuration: __webpack_require__(1314), + UpDuration: __webpack_require__(1315) - JustDown: __webpack_require__(1251), - JustUp: __webpack_require__(1252), - DownDuration: __webpack_require__(1253), - UpDuration: __webpack_require__(1254) - }; /***/ }), -/* 1239 */ +/* 1303 */ /***/ (function(module, exports) { /** @@ -173757,7 +183280,7 @@ module.exports = 'keydown'; /***/ }), -/* 1240 */ +/* 1304 */ /***/ (function(module, exports) { /** @@ -173786,7 +183309,7 @@ module.exports = 'keyup'; /***/ }), -/* 1241 */ +/* 1305 */ /***/ (function(module, exports) { /** @@ -173820,7 +183343,7 @@ module.exports = 'keycombomatch'; /***/ }), -/* 1242 */ +/* 1306 */ /***/ (function(module, exports) { /** @@ -173854,7 +183377,7 @@ module.exports = 'down'; /***/ }), -/* 1243 */ +/* 1307 */ /***/ (function(module, exports) { /** @@ -173893,7 +183416,7 @@ module.exports = 'keydown-'; /***/ }), -/* 1244 */ +/* 1308 */ /***/ (function(module, exports) { /** @@ -173925,7 +183448,7 @@ module.exports = 'keyup-'; /***/ }), -/* 1245 */ +/* 1309 */ /***/ (function(module, exports) { /** @@ -173959,7 +183482,7 @@ module.exports = 'up'; /***/ }), -/* 1246 */ +/* 1310 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -173969,18 +183492,18 @@ module.exports = 'up'; */ var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(145); -var GameEvents = __webpack_require__(21); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(147); +var GameEvents = __webpack_require__(23); var GetValue = __webpack_require__(6); -var InputEvents = __webpack_require__(56); -var InputPluginCache = __webpack_require__(144); -var Key = __webpack_require__(475); -var KeyCodes = __webpack_require__(132); -var KeyCombo = __webpack_require__(476); -var KeyMap = __webpack_require__(1250); +var InputEvents = __webpack_require__(49); +var InputPluginCache = __webpack_require__(146); +var Key = __webpack_require__(489); +var KeyCodes = __webpack_require__(138); +var KeyCombo = __webpack_require__(490); +var KeyMap = __webpack_require__(1311); var SceneEvents = __webpack_require__(20); -var SnapFloor = __webpack_require__(95); +var SnapFloor = __webpack_require__(72); /** * @classdesc @@ -174228,7 +183751,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#addCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable event capture for. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to enable event capture for. * * @return {this} This KeyboardPlugin object. */ @@ -174270,7 +183793,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable event capture for. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to disable event capture for. * * @return {this} This KeyboardPlugin object. */ @@ -174287,7 +183810,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#getCaptures * @since 3.16.0 * - * @return {integer[]} An array of all the currently capturing key codes. + * @return {number[]} An array of all the currently capturing key codes. */ getCaptures: function () { @@ -174435,7 +183958,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#addKey * @since 3.10.0 * - * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [enableCapture=true] - Automatically call `preventDefault` on the native DOM browser event for the key codes being added. * @param {boolean} [emitOnRepeat=false] - Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). * @@ -174499,7 +184022,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeKey * @since 3.10.0 * - * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object? * * @return {this} This KeyboardPlugin object. @@ -174611,7 +184134,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#createCombo * @since 3.10.0 * - * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {(string|number[]|object[])} keys - The keys that comprise this combo. * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. * * @return {Phaser.Input.Keyboard.KeyCombo} The new KeyCombo object. @@ -174894,7 +184417,7 @@ module.exports = KeyboardPlugin; /***/ }), -/* 1247 */ +/* 1311 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -174903,165 +184426,7 @@ module.exports = KeyboardPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AdvanceKeyCombo = __webpack_require__(1248); - -/** - * Used internally by the KeyCombo class. - * - * @function Phaser.Input.Keyboard.KeyCombo.ProcessKeyCombo - * @private - * @since 3.0.0 - * - * @param {KeyboardEvent} event - The native Keyboard Event. - * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to be processed. - * - * @return {boolean} `true` if the combo was matched, otherwise `false`. - */ -var ProcessKeyCombo = function (event, combo) -{ - if (combo.matched) - { - return true; - } - - var comboMatched = false; - var keyMatched = false; - - if (event.keyCode === combo.current) - { - // Key was correct - - if (combo.index > 0 && combo.maxKeyDelay > 0) - { - // We have to check to see if the delay between - // the new key and the old one was too long (if enabled) - - var timeLimit = combo.timeLastMatched + combo.maxKeyDelay; - - // Check if they pressed it in time or not - if (event.timeStamp <= timeLimit) - { - keyMatched = true; - comboMatched = AdvanceKeyCombo(event, combo); - } - } - else - { - keyMatched = true; - - // We don't check the time for the first key pressed, so just advance it - comboMatched = AdvanceKeyCombo(event, combo); - } - } - - if (!keyMatched && combo.resetOnWrongKey) - { - // Wrong key was pressed - combo.index = 0; - combo.current = combo.keyCodes[0]; - } - - if (comboMatched) - { - combo.timeLastMatched = event.timeStamp; - combo.matched = true; - combo.timeMatched = event.timeStamp; - } - - return comboMatched; -}; - -module.exports = ProcessKeyCombo; - - -/***/ }), -/* 1248 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Used internally by the KeyCombo class. - * Return `true` if it reached the end of the combo, `false` if not. - * - * @function Phaser.Input.Keyboard.KeyCombo.AdvanceKeyCombo - * @private - * @since 3.0.0 - * - * @param {KeyboardEvent} event - The native Keyboard Event. - * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo object to advance. - * - * @return {boolean} `true` if it reached the end of the combo, `false` if not. - */ -var AdvanceKeyCombo = function (event, combo) -{ - combo.timeLastMatched = event.timeStamp; - combo.index++; - - if (combo.index === combo.size) - { - return true; - } - else - { - combo.current = combo.keyCodes[combo.index]; - return false; - } -}; - -module.exports = AdvanceKeyCombo; - - -/***/ }), -/* 1249 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Used internally by the KeyCombo class. - * - * @function Phaser.Input.Keyboard.KeyCombo.ResetKeyCombo - * @private - * @since 3.0.0 - * - * @param {Phaser.Input.Keyboard.KeyCombo} combo - The KeyCombo to reset. - * - * @return {Phaser.Input.Keyboard.KeyCombo} The KeyCombo. - */ -var ResetKeyCombo = function (combo) -{ - combo.current = combo.keyCodes[0]; - combo.index = 0; - combo.timeLastMatched = 0; - combo.matched = false; - combo.timeMatched = 0; - - return combo; -}; - -module.exports = ResetKeyCombo; - - -/***/ }), -/* 1250 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var KeyCodes = __webpack_require__(132); +var KeyCodes = __webpack_require__(138); var KeyMap = {}; @@ -175074,7 +184439,7 @@ module.exports = KeyMap; /***/ }), -/* 1251 */ +/* 1312 */ /***/ (function(module, exports) { /** @@ -175116,7 +184481,7 @@ module.exports = JustDown; /***/ }), -/* 1252 */ +/* 1313 */ /***/ (function(module, exports) { /** @@ -175158,7 +184523,7 @@ module.exports = JustUp; /***/ }), -/* 1253 */ +/* 1314 */ /***/ (function(module, exports) { /** @@ -175175,7 +184540,7 @@ module.exports = JustUp; * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. - * @param {integer} [duration=50] - The duration, in ms, within which the key must have been pressed down. + * @param {number} [duration=50] - The duration, in ms, within which the key must have been pressed down. * * @return {boolean} `true` if the Key was pressed down within `duration` ms ago, otherwise `false`. */ @@ -175192,7 +184557,7 @@ module.exports = DownDuration; /***/ }), -/* 1254 */ +/* 1315 */ /***/ (function(module, exports) { /** @@ -175209,7 +184574,7 @@ module.exports = DownDuration; * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. - * @param {integer} [duration=50] - The duration, in ms, within which the key must have been released. + * @param {number} [duration=50] - The duration, in ms, within which the key must have been released. * * @return {boolean} `true` if the Key was released within `duration` ms ago, otherwise `false`. */ @@ -175226,7 +184591,7 @@ module.exports = UpDuration; /***/ }), -/* 1255 */ +/* 1316 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175242,14 +184607,14 @@ module.exports = UpDuration; /* eslint-disable */ module.exports = { - MouseManager: __webpack_require__(378) + MouseManager: __webpack_require__(388) }; /* eslint-enable */ /***/ }), -/* 1256 */ +/* 1317 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175265,14 +184630,14 @@ module.exports = { /* eslint-disable */ module.exports = { - TouchManager: __webpack_require__(380) + TouchManager: __webpack_require__(390) }; /* eslint-enable */ /***/ }), -/* 1257 */ +/* 1318 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175281,8 +184646,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(18); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(19); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Loader @@ -175290,18 +184655,18 @@ var Extend = __webpack_require__(19); var Loader = { - Events: __webpack_require__(84), + Events: __webpack_require__(89), - FileTypes: __webpack_require__(1258), + FileTypes: __webpack_require__(1319), File: __webpack_require__(22), FileTypesManager: __webpack_require__(8), - GetURL: __webpack_require__(146), - LoaderPlugin: __webpack_require__(1282), - MergeXHRSettings: __webpack_require__(226), - MultiFile: __webpack_require__(63), - XHRLoader: __webpack_require__(477), - XHRSettings: __webpack_require__(147) + GetURL: __webpack_require__(148), + LoaderPlugin: __webpack_require__(1345), + MergeXHRSettings: __webpack_require__(232), + MultiFile: __webpack_require__(47), + XHRLoader: __webpack_require__(494), + XHRSettings: __webpack_require__(149) }; @@ -175312,7 +184677,7 @@ module.exports = Loader; /***/ }), -/* 1258 */ +/* 1319 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175327,42 +184692,44 @@ module.exports = Loader; module.exports = { - AnimationJSONFile: __webpack_require__(1259), - AtlasJSONFile: __webpack_require__(1260), - AtlasXMLFile: __webpack_require__(1261), - AudioFile: __webpack_require__(478), - AudioSpriteFile: __webpack_require__(1262), - BinaryFile: __webpack_require__(1263), - BitmapFontFile: __webpack_require__(1264), - CSSFile: __webpack_require__(1265), - GLSLFile: __webpack_require__(1266), - HTML5AudioFile: __webpack_require__(479), - HTMLFile: __webpack_require__(1267), - HTMLTextureFile: __webpack_require__(1268), - ImageFile: __webpack_require__(74), - JSONFile: __webpack_require__(62), - MultiAtlasFile: __webpack_require__(1269), - MultiScriptFile: __webpack_require__(1270), - PackFile: __webpack_require__(1271), - PluginFile: __webpack_require__(1272), - SceneFile: __webpack_require__(1273), - ScenePluginFile: __webpack_require__(1274), - ScriptFile: __webpack_require__(480), - SpriteSheetFile: __webpack_require__(1275), - SVGFile: __webpack_require__(1276), - TextFile: __webpack_require__(481), - TilemapCSVFile: __webpack_require__(1277), - TilemapImpactFile: __webpack_require__(1278), - TilemapJSONFile: __webpack_require__(1279), - UnityAtlasFile: __webpack_require__(1280), - VideoFile: __webpack_require__(1281), - XMLFile: __webpack_require__(227) + AnimationJSONFile: __webpack_require__(1320), + AsepriteFile: __webpack_require__(1321), + AtlasJSONFile: __webpack_require__(1322), + AtlasXMLFile: __webpack_require__(1323), + AudioFile: __webpack_require__(495), + AudioSpriteFile: __webpack_require__(1324), + BinaryFile: __webpack_require__(1325), + BitmapFontFile: __webpack_require__(1326), + CSSFile: __webpack_require__(1327), + GLSLFile: __webpack_require__(1328), + HTML5AudioFile: __webpack_require__(496), + HTMLFile: __webpack_require__(1329), + HTMLTextureFile: __webpack_require__(1330), + ImageFile: __webpack_require__(67), + JSONFile: __webpack_require__(58), + MultiAtlasFile: __webpack_require__(1331), + MultiScriptFile: __webpack_require__(1332), + OBJFile: __webpack_require__(1333), + PackFile: __webpack_require__(1334), + PluginFile: __webpack_require__(1335), + SceneFile: __webpack_require__(1336), + ScenePluginFile: __webpack_require__(1337), + ScriptFile: __webpack_require__(497), + SpriteSheetFile: __webpack_require__(1338), + SVGFile: __webpack_require__(1339), + TextFile: __webpack_require__(234), + TilemapCSVFile: __webpack_require__(1340), + TilemapImpactFile: __webpack_require__(1341), + TilemapJSONFile: __webpack_require__(1342), + UnityAtlasFile: __webpack_require__(1343), + VideoFile: __webpack_require__(1344), + XMLFile: __webpack_require__(233) }; /***/ }), -/* 1259 */ +/* 1320 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175373,8 +184740,8 @@ module.exports = { var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); -var LoaderEvents = __webpack_require__(84); +var JSONFile = __webpack_require__(58); +var LoaderEvents = __webpack_require__(89); /** * @classdesc @@ -175563,7 +184930,7 @@ module.exports = AnimationJSONFile; /***/ }), -/* 1260 */ +/* 1321 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175575,10 +184942,280 @@ module.exports = AnimationJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(62); -var MultiFile = __webpack_require__(63); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); + +/** + * @classdesc + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + * + * @class AsepriteFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AsepriteFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {object|string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ +var AsepriteFile = new Class({ + + Extends: MultiFile, + + initialize: + + function AsepriteFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) + { + var image; + var data; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + image = new ImageFile(loader, { + key: key, + url: GetFastValue(config, 'textureURL'), + extension: GetFastValue(config, 'textureExtension', 'png'), + normalMap: GetFastValue(config, 'normalMap'), + xhrSettings: GetFastValue(config, 'textureXhrSettings') + }); + + data = new JSONFile(loader, { + key: key, + url: GetFastValue(config, 'atlasURL'), + extension: GetFastValue(config, 'atlasExtension', 'json'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + } + else + { + image = new ImageFile(loader, key, textureURL, textureXhrSettings); + data = new JSONFile(loader, key, atlasURL, atlasXhrSettings); + } + + if (image.linkFile) + { + // Image has a normal map + MultiFile.call(this, loader, 'atlasjson', key, [ image, data, image.linkFile ]); + } + else + { + MultiFile.call(this, loader, 'atlasjson', key, [ image, data ]); + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.AsepriteFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var image = this.files[0]; + var json = this.files[1]; + var normalMap = (this.files[2]) ? this.files[2].data : null; + + this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); + + json.addToCache(); + + this.complete = true; + } + } + +}); + +/** + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * Adds a JSON based Aseprite Animation, or array of animations, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.aseprite('gladiator', 'images/Gladiator.png', 'images/Gladiator.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.aseprite({ + * key: 'gladiator', + * textureURL: 'images/Gladiator.png', + * atlasURL: 'images/Gladiator.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AsepriteFileConfig` for more details. + * + * Instead of passing a URL for the JSON data you can also pass in a well formed JSON object instead. + * + * Once loaded, you can call this method from within a Scene with the 'atlas' key: + * + * ```javascript + * this.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use in Phaser and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it in Phaser using that Tag name: + * + * ```javascript + * this.add.sprite(400, 300).play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * this.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Aseprite File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#aseprite + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.50.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.AsepriteFileConfig|Phaser.Types.Loader.FileTypes.AsepriteFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {object|string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('aseprite', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new AsepriteFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new AsepriteFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = AsepriteFile; + + +/***/ }), +/* 1322 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var FileTypesManager = __webpack_require__(8); +var GetFastValue = __webpack_require__(2); +var ImageFile = __webpack_require__(67); +var IsPlainObject = __webpack_require__(7); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); /** * @classdesc @@ -175668,8 +185305,6 @@ var AtlasJSONFile = new Class({ this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); - json.addToCache(); - this.complete = true; } } @@ -175812,7 +185447,7 @@ module.exports = AtlasJSONFile; /***/ }), -/* 1261 */ +/* 1323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -175824,10 +185459,10 @@ module.exports = AtlasJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var XMLFile = __webpack_require__(227); +var MultiFile = __webpack_require__(47); +var XMLFile = __webpack_require__(233); /** * @classdesc @@ -175915,8 +185550,6 @@ var AtlasXMLFile = new Class({ this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap); - xml.addToCache(); - this.complete = true; } } @@ -176055,7 +185688,7 @@ module.exports = AtlasXMLFile; /***/ }), -/* 1262 */ +/* 1324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176064,13 +185697,13 @@ module.exports = AtlasXMLFile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AudioFile = __webpack_require__(478); +var AudioFile = __webpack_require__(495); var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(62); -var MultiFile = __webpack_require__(63); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); /** * @classdesc @@ -176345,7 +185978,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio /***/ }), -/* 1263 */ +/* 1325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176355,7 +185988,7 @@ FileTypesManager.register('audioSprite', function (key, jsonURL, audioURL, audio */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -176527,7 +186160,7 @@ module.exports = BinaryFile; /***/ }), -/* 1264 */ +/* 1326 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176539,11 +186172,11 @@ module.exports = BinaryFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var ParseXMLBitmapFont = __webpack_require__(198); -var XMLFile = __webpack_require__(227); +var MultiFile = __webpack_require__(47); +var ParseXMLBitmapFont = __webpack_require__(203); +var XMLFile = __webpack_require__(233); /** * @classdesc @@ -176629,7 +186262,6 @@ var BitmapFontFile = new Class({ var xml = this.files[1]; image.addToCache(); - xml.addToCache(); var texture = image.cache.get(image.key); @@ -176774,7 +186406,7 @@ module.exports = BitmapFontFile; /***/ }), -/* 1265 */ +/* 1327 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176784,7 +186416,7 @@ module.exports = BitmapFontFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -176942,7 +186574,7 @@ module.exports = CSSFile; /***/ }), -/* 1266 */ +/* 1328 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -176952,12 +186584,12 @@ module.exports = CSSFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var Shader = __webpack_require__(363); +var Shader = __webpack_require__(372); /** * @classdesc @@ -177200,7 +186832,7 @@ var GLSLFile = new Class({ * @since 3.17.0 * * @param {string[]} data - The array of shader data to process. - * @param {integer} offset - The offset to start processing from. + * @param {number} offset - The offset to start processing from. * * @return {any} The processed shader block, or null. */ @@ -177353,7 +186985,7 @@ module.exports = GLSLFile; /***/ }), -/* 1267 */ +/* 1329 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177363,7 +186995,7 @@ module.exports = GLSLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -177385,7 +187017,7 @@ var IsPlainObject = __webpack_require__(7); * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.HTMLFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var HTMLFile = new Class({ @@ -177528,7 +187160,7 @@ module.exports = HTMLFile; /***/ }), -/* 1268 */ +/* 1330 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177538,7 +187170,7 @@ module.exports = HTMLFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -177561,8 +187193,8 @@ var IsPlainObject = __webpack_require__(7); * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig)} key - The key to use for this file, or a file configuration object. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {integer} [width] - The width of the texture the HTML will be rendered to. - * @param {integer} [height] - The height of the texture the HTML will be rendered to. + * @param {number} [width] - The width of the texture the HTML will be rendered to. + * @param {number} [height] - The height of the texture the HTML will be rendered to. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var HTMLTextureFile = new Class({ @@ -177758,8 +187390,8 @@ var HTMLTextureFile = new Class({ * * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". - * @param {integer} [width=512] - The width of the texture the HTML will be rendered to. - * @param {integer} [height=512] - The height of the texture the HTML will be rendered to. + * @param {number} [width=512] - The width of the texture the HTML will be rendered to. + * @param {number} [height=512] - The height of the texture the HTML will be rendered to. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. @@ -177786,7 +187418,7 @@ module.exports = HTMLTextureFile; /***/ }), -/* 1269 */ +/* 1331 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -177798,10 +187430,10 @@ module.exports = HTMLTextureFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var JSONFile = __webpack_require__(62); -var MultiFile = __webpack_require__(63); +var JSONFile = __webpack_require__(58); +var MultiFile = __webpack_require__(47); /** * @classdesc @@ -178119,7 +187751,7 @@ module.exports = MultiAtlasFile; /***/ }), -/* 1270 */ +/* 1332 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178132,8 +187764,8 @@ var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var ScriptFile = __webpack_require__(480); +var MultiFile = __webpack_require__(47); +var ScriptFile = __webpack_require__(497); /** * @classdesc @@ -178336,7 +187968,7 @@ module.exports = MultiScriptFile; /***/ }), -/* 1271 */ +/* 1333 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178346,9 +187978,263 @@ module.exports = MultiScriptFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); +var GetFastValue = __webpack_require__(2); +var IsPlainObject = __webpack_require__(7); +var MultiFile = __webpack_require__(47); +var ParseObj = __webpack_require__(475); +var ParseObjMaterial = __webpack_require__(476); +var TextFile = __webpack_require__(234); + +/** + * @classdesc + * A single Wavefront OBJ File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#obj method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj. + * + * @class OBJFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param {string} [matURL] - The absolute or relative URL to load the material file from. If undefined or `null` it will be set to `.mat`, i.e. if `key` was "alien" then the URL will be "alien.mat". + * @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data? + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for these files. + */ +var OBJFile = new Class({ + + Extends: MultiFile, + + initialize: + + function OBJFile (loader, key, objURL, matURL, flipUV, xhrSettings) + { + var obj; + var mat; + + var cache = loader.cacheManager.obj; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + obj = new TextFile(loader, { + key: key, + type: 'obj', + cache: cache, + url: GetFastValue(config, 'url'), + extension: GetFastValue(config, 'extension', 'obj'), + xhrSettings: GetFastValue(config, 'xhrSettings'), + config: { + flipUV: GetFastValue(config, 'flipUV', flipUV) + } + }); + + matURL = GetFastValue(config, 'matURL'); + + if (matURL) + { + mat = new TextFile(loader, { + key: key, + type: 'mat', + cache: cache, + url: matURL, + extension: GetFastValue(config, 'matExtension', 'mat'), + xhrSettings: GetFastValue(config, 'xhrSettings') + }); + } + } + else + { + obj = new TextFile(loader, { + key: key, + url: objURL, + type: 'obj', + cache: cache, + extension: 'obj', + xhrSettings: xhrSettings, + config: { + flipUV: flipUV + } + }); + + if (matURL) + { + mat = new TextFile(loader, { + key: key, + url: matURL, + type: 'mat', + cache: cache, + extension: 'mat', + xhrSettings: xhrSettings + }); + } + } + + MultiFile.call(this, loader, 'obj', key, [ obj, mat ]); + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.OBJFile#addToCache + * @since 3.50.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var obj = this.files[0]; + var mat = this.files[1]; + + var objData = ParseObj(obj.data, obj.config.flipUV); + + if (mat) + { + objData.materials = ParseObjMaterial(mat.data); + } + + obj.cache.add(obj.key, objData); + + this.complete = true; + } + } + +}); + +/** + * Adds a Wavefront OBJ file, or array of OBJ files, to the current load queue. + * + * Note: You should ensure your 3D package has triangulated the OBJ file prior to export. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.obj('ufo', 'files/spaceship.obj'); + * } + * ``` + * + * You can optionally also load a Wavefront Material file as well, by providing the 3rd parameter: + * + * ```javascript + * function preload () + * { + * this.load.obj('ufo', 'files/spaceship.obj', 'files/spaceship.mtl'); + * } + * ``` + * + * If given, the material will be parsed and stored along with the obj data in the cache. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global OBJ Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the OBJ Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the OBJ Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.obj({ + * key: 'ufo', + * url: 'files/spaceship.obj', + * matURL: 'files/spaceship.mtl', + * flipUV: true + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.OBJFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.obj('ufo', 'files/spaceship.obj'); + * // and later in your game ... + * var data = this.cache.obj.get('ufo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the obj from the OBJ Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.obj". It will always add `.obj` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the OBJ File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#obj + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.50.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig|Phaser.Types.Loader.FileTypes.OBJFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param {string} [matURL] - Optional absolute or relative URL to load the obj material file from. + * @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data? + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('obj', function (key, objURL, matURL, flipUVs, xhrSettings) +{ + var multifile; + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new OBJFile(this, key[i]); + + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object + this.addFile(multifile.files); + } + } + else + { + multifile = new OBJFile(this, key, objURL, matURL, flipUVs, xhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = OBJFile; + + +/***/ }), +/* 1334 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(19); +var FileTypesManager = __webpack_require__(8); +var JSONFile = __webpack_require__(58); /** * @classdesc @@ -178554,7 +188440,7 @@ module.exports = PackFile; /***/ }), -/* 1272 */ +/* 1335 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178564,7 +188450,7 @@ module.exports = PackFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -178766,7 +188652,7 @@ module.exports = PluginFile; /***/ }), -/* 1273 */ +/* 1336 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178776,7 +188662,7 @@ module.exports = PluginFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -178823,7 +188709,6 @@ var SceneFile = new Class({ var fileConfig = { type: 'text', - cache: loader.cacheManager.text, extension: extension, responseType: 'text', key: key, @@ -178987,7 +188872,7 @@ module.exports = SceneFile; /***/ }), -/* 1274 */ +/* 1337 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -178997,7 +188882,7 @@ module.exports = SceneFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -179193,7 +189078,7 @@ module.exports = ScenePluginFile; /***/ }), -/* 1275 */ +/* 1338 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179204,7 +189089,7 @@ module.exports = ScenePluginFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); /** * @classdesc @@ -179384,7 +189269,7 @@ module.exports = SpriteSheetFile; /***/ }), -/* 1276 */ +/* 1339 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179394,7 +189279,7 @@ module.exports = SpriteSheetFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); @@ -179723,7 +189608,7 @@ module.exports = SVGFile; /***/ }), -/* 1277 */ +/* 1340 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179733,12 +189618,12 @@ module.exports = SVGFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); -var TILEMAP_FORMATS = __webpack_require__(33); +var TILEMAP_FORMATS = __webpack_require__(38); /** * @classdesc @@ -179918,7 +189803,7 @@ module.exports = TilemapCSVFile; /***/ }), -/* 1278 */ +/* 1341 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -179929,8 +189814,8 @@ module.exports = TilemapCSVFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); -var TILEMAP_FORMATS = __webpack_require__(33); +var JSONFile = __webpack_require__(58); +var TILEMAP_FORMATS = __webpack_require__(38); /** * @classdesc @@ -180074,7 +189959,7 @@ module.exports = TilemapImpactFile; /***/ }), -/* 1279 */ +/* 1342 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180085,8 +189970,8 @@ module.exports = TilemapImpactFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); -var JSONFile = __webpack_require__(62); -var TILEMAP_FORMATS = __webpack_require__(33); +var JSONFile = __webpack_require__(58); +var TILEMAP_FORMATS = __webpack_require__(38); /** * @classdesc @@ -180230,7 +190115,7 @@ module.exports = TilemapJSONFile; /***/ }), -/* 1280 */ +/* 1343 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180242,10 +190127,10 @@ module.exports = TilemapJSONFile; var Class = __webpack_require__(0); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var ImageFile = __webpack_require__(74); +var ImageFile = __webpack_require__(67); var IsPlainObject = __webpack_require__(7); -var MultiFile = __webpack_require__(63); -var TextFile = __webpack_require__(481); +var MultiFile = __webpack_require__(47); +var TextFile = __webpack_require__(234); /** * @classdesc @@ -180333,8 +190218,6 @@ var UnityAtlasFile = new Class({ this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap); - text.addToCache(); - this.complete = true; } } @@ -180472,7 +190355,7 @@ module.exports = UnityAtlasFile; /***/ }), -/* 1281 */ +/* 1344 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180482,10 +190365,10 @@ module.exports = UnityAtlasFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); +var CONST = __webpack_require__(19); var File = __webpack_require__(22); var FileTypesManager = __webpack_require__(8); -var GetURL = __webpack_require__(146); +var GetURL = __webpack_require__(148); var GetFastValue = __webpack_require__(2); var IsPlainObject = __webpack_require__(7); @@ -180866,7 +190749,7 @@ module.exports = VideoFile; /***/ }), -/* 1282 */ +/* 1345 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -180876,15 +190759,15 @@ module.exports = VideoFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(18); -var CustomSet = __webpack_require__(141); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(84); +var CONST = __webpack_require__(19); +var CustomSet = __webpack_require__(145); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(89); var FileTypesManager = __webpack_require__(8); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); -var XHRSettings = __webpack_require__(147); +var XHRSettings = __webpack_require__(149); /** * @classdesc @@ -181048,7 +190931,7 @@ var LoaderPlugin = new Class({ * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. * * @name Phaser.Loader.LoaderPlugin#maxParallelDownloads - * @type {integer} + * @type {number} * @since 3.0.0 */ this.maxParallelDownloads = GetFastValue(sceneConfig, 'maxParallelDownloads', gameConfig.loaderMaxParallelDownloads); @@ -181083,7 +190966,7 @@ var LoaderPlugin = new Class({ * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. * * @name Phaser.Loader.LoaderPlugin#totalToLoad - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -181158,7 +191041,7 @@ var LoaderPlugin = new Class({ * This value is reset when you call `Loader.start`. * * @name Phaser.Loader.LoaderPlugin#totalFailed - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -181169,7 +191052,7 @@ var LoaderPlugin = new Class({ * This value is reset when you call `Loader.start`. * * @name Phaser.Loader.LoaderPlugin#totalComplete - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -181179,7 +191062,7 @@ var LoaderPlugin = new Class({ * The current state of the Loader. * * @name Phaser.Loader.LoaderPlugin#state - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -181189,7 +191072,7 @@ var LoaderPlugin = new Class({ * The current index being used by multi-file loaders to avoid key clashes. * * @name Phaser.Loader.LoaderPlugin#multiKeyIndex - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -181949,7 +191832,7 @@ module.exports = LoaderPlugin; /***/ }), -/* 1283 */ +/* 1346 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -181958,8 +191841,8 @@ module.exports = LoaderPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(52); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(59); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Physics.Arcade @@ -181967,23 +191850,23 @@ var Extend = __webpack_require__(19); var Arcade = { - ArcadePhysics: __webpack_require__(1284), - Body: __webpack_require__(488), - Collider: __webpack_require__(489), - Components: __webpack_require__(228), - Events: __webpack_require__(230), - Factory: __webpack_require__(482), - GetOverlapX: __webpack_require__(231), - GetOverlapY: __webpack_require__(232), - SeparateX: __webpack_require__(497), - SeparateY: __webpack_require__(498), - Group: __webpack_require__(485), - Image: __webpack_require__(483), - Sprite: __webpack_require__(148), - StaticBody: __webpack_require__(499), - StaticGroup: __webpack_require__(486), - Tilemap: __webpack_require__(1305), - World: __webpack_require__(487) + ArcadePhysics: __webpack_require__(1347), + Body: __webpack_require__(504), + Collider: __webpack_require__(505), + Components: __webpack_require__(235), + Events: __webpack_require__(237), + Factory: __webpack_require__(498), + GetOverlapX: __webpack_require__(238), + GetOverlapY: __webpack_require__(239), + SeparateX: __webpack_require__(514), + SeparateY: __webpack_require__(515), + Group: __webpack_require__(501), + Image: __webpack_require__(499), + Sprite: __webpack_require__(150), + StaticBody: __webpack_require__(516), + StaticGroup: __webpack_require__(502), + Tilemap: __webpack_require__(1371), + World: __webpack_require__(503) }; @@ -181994,7 +191877,7 @@ module.exports = Arcade; /***/ }), -/* 1284 */ +/* 1347 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -182004,18 +191887,18 @@ module.exports = Arcade; */ var Class = __webpack_require__(0); -var DegToRad = __webpack_require__(41); -var DistanceBetween = __webpack_require__(55); -var DistanceSquared = __webpack_require__(334); -var Factory = __webpack_require__(482); +var DegToRad = __webpack_require__(34); +var DistanceBetween = __webpack_require__(61); +var DistanceSquared = __webpack_require__(345); +var Factory = __webpack_require__(498); var GetFastValue = __webpack_require__(2); -var Merge = __webpack_require__(134); -var OverlapCirc = __webpack_require__(484); -var OverlapRect = __webpack_require__(229); -var PluginCache = __webpack_require__(23); +var Merge = __webpack_require__(140); +var OverlapCirc = __webpack_require__(500); +var OverlapRect = __webpack_require__(236); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); var Vector2 = __webpack_require__(3); -var World = __webpack_require__(487); +var World = __webpack_require__(503); /** * @classdesc @@ -182719,7 +192602,7 @@ module.exports = ArcadePhysics; /***/ }), -/* 1285 */ +/* 1348 */ /***/ (function(module, exports) { /** @@ -182794,7 +192677,7 @@ module.exports = Acceleration; /***/ }), -/* 1286 */ +/* 1349 */ /***/ (function(module, exports) { /** @@ -182876,7 +192759,7 @@ module.exports = Angular; /***/ }), -/* 1287 */ +/* 1350 */ /***/ (function(module, exports) { /** @@ -182975,7 +192858,7 @@ module.exports = Bounce; /***/ }), -/* 1288 */ +/* 1351 */ /***/ (function(module, exports) { /** @@ -183102,7 +192985,7 @@ module.exports = Debug; /***/ }), -/* 1289 */ +/* 1352 */ /***/ (function(module, exports) { /** @@ -183235,7 +193118,7 @@ module.exports = Drag; /***/ }), -/* 1290 */ +/* 1353 */ /***/ (function(module, exports) { /** @@ -183359,7 +193242,7 @@ module.exports = Enable; /***/ }), -/* 1291 */ +/* 1354 */ /***/ (function(module, exports) { /** @@ -183447,7 +193330,7 @@ module.exports = Friction; /***/ }), -/* 1292 */ +/* 1355 */ /***/ (function(module, exports) { /** @@ -183525,7 +193408,7 @@ module.exports = Gravity; /***/ }), -/* 1293 */ +/* 1356 */ /***/ (function(module, exports) { /** @@ -183543,12 +193426,16 @@ module.exports = Gravity; var Immovable = { /** - * Sets Whether this Body can be moved by collisions with another Body. + * Sets if this Body can be separated during collisions with other bodies. + * + * When a body is immovable it means it won't move at all, not even to separate it from collision + * overlap. If you just wish to prevent a body from being knocked around by other bodies, see + * the `setPushable` method instead. * * @method Phaser.Physics.Arcade.Components.Immovable#setImmovable * @since 3.0.0 * - * @param {boolean} [value=true] - Sets if this body can be moved by collisions with another Body. + * @param {boolean} [value=true] - Sets if this body will be separated during collisions with other bodies. * * @return {this} This Game Object. */ @@ -183567,7 +193454,7 @@ module.exports = Immovable; /***/ }), -/* 1294 */ +/* 1357 */ /***/ (function(module, exports) { /** @@ -183607,7 +193494,55 @@ module.exports = Mass; /***/ }), -/* 1295 */ +/* 1358 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the pushable property of an Arcade Physics Body. + * + * @namespace Phaser.Physics.Arcade.Components.Pushable + * @since 3.50.0 + */ +var Pushable = { + + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * @method Phaser.Physics.Arcade.Components.Pushable#setPushable + * @since 3.50.0 + * + * @param {boolean} [value=true] - Sets if this body can be pushed by collisions with another Body. + * + * @return {this} This Game Object. + */ + setPushable: function (value) + { + if (value === undefined) { value = true; } + + this.body.pushable = value; + + return this; + } + +}; + +module.exports = Pushable; + + +/***/ }), +/* 1359 */ /***/ (function(module, exports) { /** @@ -183710,7 +193645,7 @@ module.exports = Size; /***/ }), -/* 1296 */ +/* 1360 */ /***/ (function(module, exports) { /** @@ -183809,7 +193744,7 @@ module.exports = Velocity; /***/ }), -/* 1297 */ +/* 1361 */ /***/ (function(module, exports) { /** @@ -183842,7 +193777,7 @@ module.exports = 'collide'; /***/ }), -/* 1298 */ +/* 1362 */ /***/ (function(module, exports) { /** @@ -183875,7 +193810,7 @@ module.exports = 'overlap'; /***/ }), -/* 1299 */ +/* 1363 */ /***/ (function(module, exports) { /** @@ -183898,7 +193833,7 @@ module.exports = 'pause'; /***/ }), -/* 1300 */ +/* 1364 */ /***/ (function(module, exports) { /** @@ -183921,7 +193856,7 @@ module.exports = 'resume'; /***/ }), -/* 1301 */ +/* 1365 */ /***/ (function(module, exports) { /** @@ -183953,7 +193888,7 @@ module.exports = 'tilecollide'; /***/ }), -/* 1302 */ +/* 1366 */ /***/ (function(module, exports) { /** @@ -183985,7 +193920,7 @@ module.exports = 'tileoverlap'; /***/ }), -/* 1303 */ +/* 1367 */ /***/ (function(module, exports) { /** @@ -184017,7 +193952,7 @@ module.exports = 'worldbounds'; /***/ }), -/* 1304 */ +/* 1368 */ /***/ (function(module, exports) { /** @@ -184028,22 +193963,858 @@ module.exports = 'worldbounds'; /** * The Arcade Physics World Step Event. - * + * * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. * It is emitted _after_ the bodies and colliders have been updated. - * + * * In high framerate settings this can be multiple times per game frame. - * + * * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_STEP * @since 3.18.0 + * + * @param {number} delta - The delta time amount of this step, in seconds. */ module.exports = 'worldstep'; /***/ }), -/* 1305 */ +/* 1369 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var body1; +var body2; +var body1Pushable; +var body2Pushable; +var body1MassImpact; +var body2MassImpact; +var body1FullImpact; +var body2FullImpact; +var body1MovingLeft; +var body1MovingRight; +var body1Stationary; +var body2MovingLeft; +var body2MovingRight; +var body2Stationary; +var body1OnLeft; +var body2OnLeft; +var overlap; + +/** + * Sets all of the local processing values and calculates the velocity exchanges. + * + * Then runs `BlockCheck` and returns the value from it. + * + * This method is called by `Phaser.Physics.Arcade.SeparateX` and should not be + * called directly. + * + * @function Phaser.Physics.Arcade.ProcessX.Set + * @ignore + * @since 3.50.0 + * + * @param {Phaser.Physics.Arcade.Body} b1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} b2 - The second Body to separate. + * @param {number} ov - The overlap value. + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var Set = function (b1, b2, ov) +{ + body1 = b1; + body2 = b2; + + var v1 = body1.velocity.x; + var v2 = body2.velocity.x; + + body1Pushable = body1.pushable; + body1MovingLeft = body1._dx < 0; + body1MovingRight = body1._dx > 0; + body1Stationary = body1._dx === 0; + body1OnLeft = Math.abs(body1.right - body2.x) <= Math.abs(body2.right - body1.x); + body1FullImpact = v2 - v1 * body1.bounce.x; + + body2Pushable = body2.pushable; + body2MovingLeft = body2._dx < 0; + body2MovingRight = body2._dx > 0; + body2Stationary = body2._dx === 0; + body2OnLeft = !body1OnLeft; + body2FullImpact = v1 - v2 * body2.bounce.x; + + // negative delta = up, positive delta = down (inc. gravity) + overlap = Math.abs(ov); + + return BlockCheck(); +}; + +/** + * Blocked Direction checks, because it doesn't matter if an object can be pushed + * or not, blocked is blocked. + * + * @function Phaser.Physics.Arcade.ProcessX.BlockCheck + * @ignore + * @since 3.50.0 + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var BlockCheck = function () +{ + // Body1 is moving right and Body2 is blocked from going right any further + if (body1MovingRight && body1OnLeft && body2.blocked.right) + { + body1.processX(-overlap, body1FullImpact, false, true); + + return 1; + } + + // Body1 is moving up and Body2 is blocked from going up any further + if (body1MovingLeft && body2OnLeft && body2.blocked.left) + { + body1.processX(overlap, body1FullImpact, true); + + return 1; + } + + // Body2 is moving right and Body1 is blocked from going right any further + if (body2MovingRight && body2OnLeft && body1.blocked.right) + { + body2.processX(-overlap, body2FullImpact, false, true); + + return 2; + } + + // Body2 is moving up and Body1 is blocked from going up any further + if (body2MovingLeft && body1OnLeft && body1.blocked.left) + { + body2.processX(overlap, body2FullImpact, true); + + return 2; + } + + return 0; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessX.Check + * @ignore + * @since 3.50.0 + * + * @return {boolean} `true` if a check passed, otherwise `false`. + */ +var Check = function () +{ + var v1 = body1.velocity.x; + var v2 = body2.velocity.x; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1MassImpact = avg + nv1 * body1.bounce.x; + body2MassImpact = avg + nv2 * body2.bounce.x; + + // Body1 hits Body2 on the right hand side + if (body1MovingLeft && body2OnLeft) + { + return Run(0); + } + + // Body2 hits Body1 on the right hand side + if (body2MovingLeft && body1OnLeft) + { + return Run(1); + } + + // Body1 hits Body2 on the left hand side + if (body1MovingRight && body1OnLeft) + { + return Run(2); + } + + // Body2 hits Body1 on the left hand side + if (body2MovingRight && body2OnLeft) + { + return Run(3); + } + + return false; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessX.Run + * @ignore + * @since 3.50.0 + * + * @param {number} side - The side to test. As passed in by the `Check` function. + * + * @return {boolean} Always returns `true`. + */ +var Run = function (side) +{ + if (body1Pushable && body2Pushable) + { + // Both pushable, or both moving at the same time, so equal rebound + overlap *= 0.5; + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body1.processX(overlap, body1MassImpact); + body2.processX(-overlap, body2MassImpact); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body1.processX(-overlap, body1MassImpact); + body2.processX(overlap, body2MassImpact); + } + } + else if (body1Pushable && !body2Pushable) + { + // Body1 pushable, Body2 not + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body1.processX(overlap, body1FullImpact, true); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body1.processX(-overlap, body1FullImpact, false, true); + } + } + else if (!body1Pushable && body2Pushable) + { + // Body2 pushable, Body1 not + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body2.processX(-overlap, body2FullImpact, false, true); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body2.processX(overlap, body2FullImpact, true); + } + } + else + { + // Neither body is pushable, so base it on movement + + var halfOverlap = overlap * 0.5; + + if (side === 0) + { + // body1MovingLeft && body2OnLeft + + if (body2Stationary) + { + body1.processX(overlap, 0, true); + body2.processX(0, null, false, true); + } + else if (body2MovingRight) + { + body1.processX(halfOverlap, 0, true); + body2.processX(-halfOverlap, 0, false, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processX(halfOverlap, body2.velocity.x, true); + body2.processX(-halfOverlap, null, false, true); + } + } + else if (side === 1) + { + // body2MovingLeft && body1OnLeft + + if (body1Stationary) + { + body1.processX(0, null, false, true); + body2.processX(overlap, 0, true); + } + else if (body1MovingRight) + { + body1.processX(-halfOverlap, 0, false, true); + body2.processX(halfOverlap, 0, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processX(-halfOverlap, null, false, true); + body2.processX(halfOverlap, body1.velocity.x, true); + } + } + else if (side === 2) + { + // body1MovingRight && body1OnLeft + + if (body2Stationary) + { + body1.processX(-overlap, 0, false, true); + body2.processX(0, null, true); + } + else if (body2MovingLeft) + { + body1.processX(-halfOverlap, 0, false, true); + body2.processX(halfOverlap, 0, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processX(-halfOverlap, body2.velocity.x, false, true); + body2.processX(halfOverlap, null, true); + } + } + else if (side === 3) + { + // body2MovingRight && body2OnLeft + + if (body1Stationary) + { + body1.processX(0, null, true); + body2.processX(-overlap, 0, false, true); + } + else if (body1MovingLeft) + { + body1.processX(halfOverlap, 0, true); + body2.processX(-halfOverlap, 0, false, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processX(halfOverlap, body2.velocity.y, true); + body2.processX(-halfOverlap, null, false, true); + } + } + } + + return true; +}; + +/** + * This function is run when Body1 is Immovable and Body2 is not. + * + * @function Phaser.Physics.Arcade.ProcessX.RunImmovableBody1 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody1 = function (blockedState) +{ + if (blockedState === 1) + { + // But Body2 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body2.velocity.x = 0; + } + else if (body1OnLeft) + { + body2.processX(overlap, body2FullImpact, true); + } + else + { + body2.processX(-overlap, body2FullImpact, false, true); + } + + // This is special case code that handles things like vertically moving platforms you can ride + if (body1.moves) + { + body2.y += (body1.y - body1.prev.y) * body1.friction.y; + body2._dy = body2.y - body2.prev.y; + } +}; + +/** + * This function is run when Body2 is Immovable and Body1 is not. + * + * @function Phaser.Physics.Arcade.ProcessX.RunImmovableBody2 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody2 = function (blockedState) +{ + if (blockedState === 2) + { + // But Body1 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body1.velocity.x = 0; + } + if (body2OnLeft) + { + body1.processX(overlap, body1FullImpact, true); + } + else + { + body1.processX(-overlap, body1FullImpact, false, true); + } + + // This is special case code that handles things like vertically moving platforms you can ride + if (body2.moves) + { + body1.y += (body2.y - body2.prev.y) * body2.friction.y; + body1._dy = body1.y - body1.prev.y; + } +}; + +/** + * @namespace Phaser.Physics.Arcade.ProcessX + * @ignore + */ + +module.exports = { + BlockCheck: BlockCheck, + Check: Check, + Set: Set, + Run: Run, + RunImmovableBody1: RunImmovableBody1, + RunImmovableBody2: RunImmovableBody2 +}; + + +/***/ }), +/* 1370 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var body1; +var body2; +var body1Pushable; +var body2Pushable; +var body1MassImpact; +var body2MassImpact; +var body1FullImpact; +var body2FullImpact; +var body1MovingUp; +var body1MovingDown; +var body1Stationary; +var body2MovingUp; +var body2MovingDown; +var body2Stationary; +var body1OnTop; +var body2OnTop; +var overlap; + +/** + * Sets all of the local processing values and calculates the velocity exchanges. + * + * Then runs `BlockCheck` and returns the value from it. + * + * This method is called by `Phaser.Physics.Arcade.SeparateY` and should not be + * called directly. + * + * @function Phaser.Physics.Arcade.ProcessY.Set + * @ignore + * @since 3.50.0 + * + * @param {Phaser.Physics.Arcade.Body} b1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} b2 - The second Body to separate. + * @param {number} ov - The overlap value. + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var Set = function (b1, b2, ov) +{ + body1 = b1; + body2 = b2; + + var v1 = body1.velocity.y; + var v2 = body2.velocity.y; + + body1Pushable = body1.pushable; + body1MovingUp = body1._dy < 0; + body1MovingDown = body1._dy > 0; + body1Stationary = body1._dy === 0; + body1OnTop = Math.abs(body1.bottom - body2.y) <= Math.abs(body2.bottom - body1.y); + body1FullImpact = v2 - v1 * body1.bounce.y; + + body2Pushable = body2.pushable; + body2MovingUp = body2._dy < 0; + body2MovingDown = body2._dy > 0; + body2Stationary = body2._dy === 0; + body2OnTop = !body1OnTop; + body2FullImpact = v1 - v2 * body2.bounce.y; + + // negative delta = up, positive delta = down (inc. gravity) + overlap = Math.abs(ov); + + return BlockCheck(); +}; + +/** + * Blocked Direction checks, because it doesn't matter if an object can be pushed + * or not, blocked is blocked. + * + * @function Phaser.Physics.Arcade.ProcessY.BlockCheck + * @ignore + * @since 3.50.0 + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var BlockCheck = function () +{ + // Body1 is moving down and Body2 is blocked from going down any further + if (body1MovingDown && body1OnTop && body2.blocked.down) + { + body1.processY(-overlap, body1FullImpact, false, true); + + return 1; + } + + // Body1 is moving up and Body2 is blocked from going up any further + if (body1MovingUp && body2OnTop && body2.blocked.up) + { + body1.processY(overlap, body1FullImpact, true); + + return 1; + } + + // Body2 is moving down and Body1 is blocked from going down any further + if (body2MovingDown && body2OnTop && body1.blocked.down) + { + body2.processY(-overlap, body2FullImpact, false, true); + + return 2; + } + + // Body2 is moving up and Body1 is blocked from going up any further + if (body2MovingUp && body1OnTop && body1.blocked.up) + { + body2.processY(overlap, body2FullImpact, true); + + return 2; + } + + return 0; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessY.Check + * @ignore + * @since 3.50.0 + * + * @return {boolean} `true` if a check passed, otherwise `false`. + */ +var Check = function () +{ + var v1 = body1.velocity.y; + var v2 = body2.velocity.y; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1MassImpact = avg + nv1 * body1.bounce.y; + body2MassImpact = avg + nv2 * body2.bounce.y; + + // Body1 hits Body2 on the bottom side + if (body1MovingUp && body2OnTop) + { + return Run(0); + } + + // Body2 hits Body1 on the bottom side + if (body2MovingUp && body1OnTop) + { + return Run(1); + } + + // Body1 hits Body2 on the top side + if (body1MovingDown && body1OnTop) + { + return Run(2); + } + + // Body2 hits Body1 on the top side + if (body2MovingDown && body2OnTop) + { + return Run(3); + } + + return false; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessY.Run + * @ignore + * @since 3.50.0 + * + * @param {number} side - The side to test. As passed in by the `Check` function. + * + * @return {boolean} Always returns `true`. + */ +var Run = function (side) +{ + if (body1Pushable && body2Pushable) + { + // Both pushable, or both moving at the same time, so equal rebound + overlap *= 0.5; + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body1.processY(overlap, body1MassImpact); + body2.processY(-overlap, body2MassImpact); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body1.processY(-overlap, body1MassImpact); + body2.processY(overlap, body2MassImpact); + } + } + else if (body1Pushable && !body2Pushable) + { + // Body1 pushable, Body2 not + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body1.processY(overlap, body1FullImpact, true); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body1.processY(-overlap, body1FullImpact, false, true); + } + } + else if (!body1Pushable && body2Pushable) + { + // Body2 pushable, Body1 not + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body2.processY(-overlap, body2FullImpact, false, true); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body2.processY(overlap, body2FullImpact, true); + } + } + else + { + // Neither body is pushable, so base it on movement + + var halfOverlap = overlap * 0.5; + + if (side === 0) + { + // body1MovingUp && body2OnTop + + if (body2Stationary) + { + body1.processY(overlap, 0, true); + body2.processY(0, null, false, true); + } + else if (body2MovingDown) + { + body1.processY(halfOverlap, 0, true); + body2.processY(-halfOverlap, 0, false, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processY(halfOverlap, body2.velocity.y, true); + body2.processY(-halfOverlap, null, false, true); + } + } + else if (side === 1) + { + // body2MovingUp && body1OnTop + + if (body1Stationary) + { + body1.processY(0, null, false, true); + body2.processY(overlap, 0, true); + } + else if (body1MovingDown) + { + body1.processY(-halfOverlap, 0, false, true); + body2.processY(halfOverlap, 0, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processY(-halfOverlap, null, false, true); + body2.processY(halfOverlap, body1.velocity.y, true); + } + } + else if (side === 2) + { + // body1MovingDown && body1OnTop + + if (body2Stationary) + { + body1.processY(-overlap, 0, false, true); + body2.processY(0, null, true); + } + else if (body2MovingUp) + { + body1.processY(-halfOverlap, 0, false, true); + body2.processY(halfOverlap, 0, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processY(-halfOverlap, body2.velocity.y, false, true); + body2.processY(halfOverlap, null, true); + } + } + else if (side === 3) + { + // body2MovingDown && body2OnTop + + if (body1Stationary) + { + body1.processY(0, null, true); + body2.processY(-overlap, 0, false, true); + } + else if (body1MovingUp) + { + body1.processY(halfOverlap, 0, true); + body2.processY(-halfOverlap, 0, false, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processY(halfOverlap, body2.velocity.y, true); + body2.processY(-halfOverlap, null, false, true); + } + } + } + + return true; +}; + +/** + * This function is run when Body1 is Immovable and Body2 is not. + * + * @function Phaser.Physics.Arcade.ProcessY.RunImmovableBody1 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody1 = function (blockedState) +{ + if (blockedState === 1) + { + // But Body2 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body2.velocity.y = 0; + } + else if (body1OnTop) + { + body2.processY(overlap, body2FullImpact, true); + } + else + { + body2.processY(-overlap, body2FullImpact, false, true); + } + + // This is special case code that handles things like horizontally moving platforms you can ride + if (body1.moves) + { + body2.x += (body1.x - body1.prev.x) * body1.friction.x; + body2._dx = body2.x - body2.prev.x; + } +}; + +/** + * This function is run when Body2 is Immovable and Body1 is not. + * + * @function Phaser.Physics.Arcade.ProcessY.RunImmovableBody2 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody2 = function (blockedState) +{ + if (blockedState === 2) + { + // But Body1 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body1.velocity.y = 0; + } + else if (body2OnTop) + { + body1.processY(overlap, body1FullImpact, true); + } + else + { + body1.processY(-overlap, body1FullImpact, false, true); + } + + // This is special case code that handles things like horizontally moving platforms you can ride + if (body2.moves) + { + body1.x += (body2.x - body2.prev.x) * body2.friction.x; + body1._dx = body1.x - body1.prev.x; + } +}; + +/** + * @namespace Phaser.Physics.Arcade.ProcessY + * @ignore + */ + +module.exports = { + BlockCheck: BlockCheck, + Check: Check, + Set: Set, + Run: Run, + RunImmovableBody1: RunImmovableBody1, + RunImmovableBody2: RunImmovableBody2 +}; + + +/***/ }), +/* 1371 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184058,13 +194829,13 @@ module.exports = 'worldstep'; var Tilemap = { - ProcessTileCallbacks: __webpack_require__(490), - ProcessTileSeparationX: __webpack_require__(494), - ProcessTileSeparationY: __webpack_require__(496), - SeparateTile: __webpack_require__(492), - TileCheckX: __webpack_require__(493), - TileCheckY: __webpack_require__(495), - TileIntersectsBody: __webpack_require__(233) + ProcessTileCallbacks: __webpack_require__(507), + ProcessTileSeparationX: __webpack_require__(511), + ProcessTileSeparationY: __webpack_require__(513), + SeparateTile: __webpack_require__(509), + TileCheckX: __webpack_require__(510), + TileCheckY: __webpack_require__(512), + TileIntersectsBody: __webpack_require__(240) }; @@ -184072,7 +194843,7 @@ module.exports = Tilemap; /***/ }), -/* 1306 */ +/* 1372 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184083,11 +194854,11 @@ module.exports = Tilemap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(116); -var Body = __webpack_require__(64); -var Common = __webpack_require__(44); +var Bodies = __webpack_require__(124); +var Body = __webpack_require__(68); +var Common = __webpack_require__(50); var GetFastValue = __webpack_require__(2); -var Vertices = __webpack_require__(88); +var Vertices = __webpack_require__(93); /** * Use PhysicsEditorParser.parseBody() to build a Matter body object, based on a physics data file @@ -184214,7 +194985,7 @@ module.exports = PhysicsEditorParser; /***/ }), -/* 1307 */ +/* 1373 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184223,8 +194994,8 @@ module.exports = PhysicsEditorParser; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(116); -var Body = __webpack_require__(64); +var Bodies = __webpack_require__(124); +var Body = __webpack_require__(68); /** * Creates a body using the supplied physics data, as provided by a JSON file. @@ -184331,7 +195102,7 @@ module.exports = PhysicsJSONParser; /***/ }), -/* 1308 */ +/* 1374 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184347,11 +195118,11 @@ var Composites = {}; module.exports = Composites; -var Composite = __webpack_require__(158); -var Constraint = __webpack_require__(234); -var Common = __webpack_require__(44); -var Body = __webpack_require__(64); -var Bodies = __webpack_require__(116); +var Composite = __webpack_require__(159); +var Constraint = __webpack_require__(241); +var Common = __webpack_require__(50); +var Body = __webpack_require__(68); +var Bodies = __webpack_require__(124); (function() { @@ -184664,7 +195435,7 @@ var Bodies = __webpack_require__(116); /***/ }), -/* 1309 */ +/* 1375 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184681,8 +195452,8 @@ var Svg = {}; module.exports = Svg; -var Bounds = __webpack_require__(103); -var Common = __webpack_require__(44); +var Bounds = __webpack_require__(115); +var Common = __webpack_require__(50); (function() { @@ -184895,7 +195666,7 @@ var Common = __webpack_require__(44); })(); /***/ }), -/* 1310 */ +/* 1376 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -184904,14 +195675,14 @@ var Common = __webpack_require__(44); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(116); -var Body = __webpack_require__(64); +var Bodies = __webpack_require__(124); +var Body = __webpack_require__(68); var Class = __webpack_require__(0); -var Components = __webpack_require__(500); -var EventEmitter = __webpack_require__(12); +var Components = __webpack_require__(517); +var EventEmitter = __webpack_require__(10); var GetFastValue = __webpack_require__(2); -var HasValue = __webpack_require__(115); -var Vertices = __webpack_require__(88); +var HasValue = __webpack_require__(123); +var Vertices = __webpack_require__(93); /** * @classdesc @@ -185215,7 +195986,7 @@ module.exports = MatterTileBody; /***/ }), -/* 1311 */ +/* 1377 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185228,36 +195999,36 @@ module.exports = MatterTileBody; * @namespace Phaser.Physics.Matter.Matter */ -var Matter = __webpack_require__(1410); +var Matter = __webpack_require__(1472); -Matter.Body = __webpack_require__(64); -Matter.Composite = __webpack_require__(158); -Matter.World = __webpack_require__(1313); +Matter.Body = __webpack_require__(68); +Matter.Composite = __webpack_require__(159); +Matter.World = __webpack_require__(1379); -Matter.Detector = __webpack_require__(544); -Matter.Grid = __webpack_require__(1314); -Matter.Pairs = __webpack_require__(1315); -Matter.Pair = __webpack_require__(501); -Matter.Query = __webpack_require__(1411); -Matter.Resolver = __webpack_require__(1316); -Matter.SAT = __webpack_require__(545); +Matter.Detector = __webpack_require__(583); +Matter.Grid = __webpack_require__(1380); +Matter.Pairs = __webpack_require__(1381); +Matter.Pair = __webpack_require__(518); +Matter.Query = __webpack_require__(1473); +Matter.Resolver = __webpack_require__(1382); +Matter.SAT = __webpack_require__(584); -Matter.Constraint = __webpack_require__(234); +Matter.Constraint = __webpack_require__(241); -Matter.Common = __webpack_require__(44); -Matter.Engine = __webpack_require__(1412); -Matter.Events = __webpack_require__(251); -Matter.Sleeping = __webpack_require__(250); -Matter.Plugin = __webpack_require__(1312); +Matter.Common = __webpack_require__(50); +Matter.Engine = __webpack_require__(1474); +Matter.Events = __webpack_require__(266); +Matter.Sleeping = __webpack_require__(265); +Matter.Plugin = __webpack_require__(1378); -Matter.Bodies = __webpack_require__(116); -Matter.Composites = __webpack_require__(1308); +Matter.Bodies = __webpack_require__(124); +Matter.Composites = __webpack_require__(1374); -Matter.Axes = __webpack_require__(542); -Matter.Bounds = __webpack_require__(103); -Matter.Svg = __webpack_require__(1309); -Matter.Vector = __webpack_require__(102); -Matter.Vertices = __webpack_require__(88); +Matter.Axes = __webpack_require__(581); +Matter.Bounds = __webpack_require__(115); +Matter.Svg = __webpack_require__(1375); +Matter.Vector = __webpack_require__(114); +Matter.Vertices = __webpack_require__(93); // aliases @@ -185272,7 +196043,7 @@ module.exports = Matter; /***/ }), -/* 1312 */ +/* 1378 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185285,7 +196056,7 @@ var Plugin = {}; module.exports = Plugin; -var Common = __webpack_require__(44); +var Common = __webpack_require__(50); (function() { @@ -185622,7 +196393,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 1313 */ +/* 1379 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185642,9 +196413,9 @@ var World = {}; module.exports = World; -var Composite = __webpack_require__(158); -var Constraint = __webpack_require__(234); -var Common = __webpack_require__(44); +var Composite = __webpack_require__(159); +var Constraint = __webpack_require__(241); +var Common = __webpack_require__(50); (function() { @@ -185775,7 +196546,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 1314 */ +/* 1380 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -185788,9 +196559,9 @@ var Grid = {}; module.exports = Grid; -var Pair = __webpack_require__(501); -var Detector = __webpack_require__(544); -var Common = __webpack_require__(44); +var Pair = __webpack_require__(518); +var Detector = __webpack_require__(583); +var Common = __webpack_require__(50); (function() { @@ -186102,7 +196873,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 1315 */ +/* 1381 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186115,8 +196886,8 @@ var Pairs = {}; module.exports = Pairs; -var Pair = __webpack_require__(501); -var Common = __webpack_require__(44); +var Pair = __webpack_require__(518); +var Common = __webpack_require__(50); (function() { @@ -186267,7 +197038,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 1316 */ +/* 1382 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186280,10 +197051,10 @@ var Resolver = {}; module.exports = Resolver; -var Vertices = __webpack_require__(88); -var Vector = __webpack_require__(102); -var Common = __webpack_require__(44); -var Bounds = __webpack_require__(103); +var Vertices = __webpack_require__(93); +var Vector = __webpack_require__(114); +var Common = __webpack_require__(50); +var Bounds = __webpack_require__(115); (function() { @@ -186623,7 +197394,7 @@ var Bounds = __webpack_require__(103); /***/ }), -/* 1317 */ +/* 1383 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186638,17 +197409,17 @@ var Bounds = __webpack_require__(103); module.exports = { - BasePlugin: __webpack_require__(502), - DefaultPlugins: __webpack_require__(184), - PluginCache: __webpack_require__(23), - PluginManager: __webpack_require__(381), - ScenePlugin: __webpack_require__(1318) + BasePlugin: __webpack_require__(519), + DefaultPlugins: __webpack_require__(189), + PluginCache: __webpack_require__(25), + PluginManager: __webpack_require__(391), + ScenePlugin: __webpack_require__(1384) }; /***/ }), -/* 1318 */ +/* 1384 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186657,7 +197428,7 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ -var BasePlugin = __webpack_require__(502); +var BasePlugin = __webpack_require__(519); var Class = __webpack_require__(0); var SceneEvents = __webpack_require__(20); @@ -186776,7 +197547,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1319 */ +/* 1385 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186785,8 +197556,8 @@ module.exports = ScenePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); -var CONST = __webpack_require__(187); +var Extend = __webpack_require__(18); +var CONST = __webpack_require__(192); /** * @namespace Phaser.Scale @@ -186814,12 +197585,12 @@ var CONST = __webpack_require__(187); var Scale = { - Center: __webpack_require__(370), - Events: __webpack_require__(94), - Orientation: __webpack_require__(371), - ScaleManager: __webpack_require__(382), - ScaleModes: __webpack_require__(372), - Zoom: __webpack_require__(373) + Center: __webpack_require__(380), + Events: __webpack_require__(101), + Orientation: __webpack_require__(381), + ScaleManager: __webpack_require__(392), + ScaleModes: __webpack_require__(382), + Zoom: __webpack_require__(383) }; @@ -186832,7 +197603,7 @@ module.exports = Scale; /***/ }), -/* 1320 */ +/* 1386 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186841,8 +197612,8 @@ module.exports = Scale; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(133); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(139); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Scenes @@ -186851,12 +197622,12 @@ var Extend = __webpack_require__(19); var Scene = { Events: __webpack_require__(20), - GetPhysicsPlugins: __webpack_require__(386), - GetScenePlugins: __webpack_require__(387), - SceneManager: __webpack_require__(384), - ScenePlugin: __webpack_require__(1321), - Settings: __webpack_require__(388), - Systems: __webpack_require__(190) + GetPhysicsPlugins: __webpack_require__(396), + GetScenePlugins: __webpack_require__(397), + SceneManager: __webpack_require__(394), + ScenePlugin: __webpack_require__(1387), + Settings: __webpack_require__(398), + Systems: __webpack_require__(195) }; @@ -186867,7 +197638,7 @@ module.exports = Scene; /***/ }), -/* 1321 */ +/* 1387 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -186876,11 +197647,11 @@ module.exports = Scene; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); var Class = __webpack_require__(0); var Events = __webpack_require__(20); var GetFastValue = __webpack_require__(2); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); /** * @classdesc @@ -186958,7 +197729,7 @@ var ScenePlugin = new Class({ * Transition elapsed timer. * * @name Phaser.Scenes.ScenePlugin#_elapsed - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -186978,7 +197749,7 @@ var ScenePlugin = new Class({ * Transition duration. * * @name Phaser.Scenes.ScenePlugin#_duration - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -187823,7 +198594,7 @@ var ScenePlugin = new Class({ * * @param {(string|Phaser.Scene)} [key] - The Scene to get the index of. * - * @return {integer} The index of the Scene. + * @return {number} The index of the Scene. */ getIndex: function (key) { @@ -187877,7 +198648,7 @@ module.exports = ScenePlugin; /***/ }), -/* 1322 */ +/* 1388 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187892,19 +198663,19 @@ module.exports = ScenePlugin; module.exports = { - Events: __webpack_require__(405), - List: __webpack_require__(137), - Map: __webpack_require__(92), - ProcessQueue: __webpack_require__(197), - RTree: __webpack_require__(491), - Set: __webpack_require__(141), - Size: __webpack_require__(383) + Events: __webpack_require__(415), + List: __webpack_require__(105), + Map: __webpack_require__(98), + ProcessQueue: __webpack_require__(202), + RTree: __webpack_require__(508), + Set: __webpack_require__(145), + Size: __webpack_require__(393) }; /***/ }), -/* 1323 */ +/* 1389 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -187913,8 +198684,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Extend = __webpack_require__(19); -var FilterMode = __webpack_require__(1324); +var Extend = __webpack_require__(18); +var FilterMode = __webpack_require__(1390); /** * @namespace Phaser.Textures @@ -187924,7 +198695,7 @@ var FilterMode = __webpack_require__(1324); * Linear filter type. * * @name Phaser.Textures.LINEAR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -187933,21 +198704,21 @@ var FilterMode = __webpack_require__(1324); * Nearest Neighbor filter type. * * @name Phaser.Textures.NEAREST - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ var Textures = { - CanvasTexture: __webpack_require__(390), - Events: __webpack_require__(130), + CanvasTexture: __webpack_require__(400), + Events: __webpack_require__(136), FilterMode: FilterMode, - Frame: __webpack_require__(97), - Parsers: __webpack_require__(392), - Texture: __webpack_require__(192), - TextureManager: __webpack_require__(389), - TextureSource: __webpack_require__(391) + Frame: __webpack_require__(104), + Parsers: __webpack_require__(402), + Texture: __webpack_require__(197), + TextureManager: __webpack_require__(399), + TextureSource: __webpack_require__(401) }; @@ -187957,7 +198728,7 @@ module.exports = Textures; /***/ }), -/* 1324 */ +/* 1390 */ /***/ (function(module, exports) { /** @@ -187979,7 +198750,7 @@ var CONST = { * Linear filter type. * * @name Phaser.Textures.FilterMode.LINEAR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -187989,7 +198760,7 @@ var CONST = { * Nearest neighbor filter type. * * @name Phaser.Textures.FilterMode.NEAREST - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -188001,7 +198772,7 @@ module.exports = CONST; /***/ }), -/* 1325 */ +/* 1391 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188010,36 +198781,47 @@ module.exports = CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Extend = __webpack_require__(18); +var CONST = __webpack_require__(1392); + /** * @namespace Phaser.Tilemaps + * + * @borrows Phaser.Tilemaps.Orientation.ORTHOGONAL as ORTHOGONAL + * @borrows Phaser.Tilemaps.Orientation.ISOMETRIC as ISOMETRIC + * @borrows Phaser.Tilemaps.Orientation.STAGGERED as STAGGERED + * @borrows Phaser.Tilemaps.Orientation.HEXAGONAL as HEXAGONAL */ -module.exports = { +var Tilemaps = { - Components: __webpack_require__(149), - Parsers: __webpack_require__(1355), + Components: __webpack_require__(243), + Parsers: __webpack_require__(1425), - Formats: __webpack_require__(33), - ImageCollection: __webpack_require__(513), - ParseToTilemap: __webpack_require__(240), - Tile: __webpack_require__(75), - Tilemap: __webpack_require__(522), - TilemapCreator: __webpack_require__(1369), - TilemapFactory: __webpack_require__(1370), - Tileset: __webpack_require__(107), + Formats: __webpack_require__(38), + ImageCollection: __webpack_require__(555), + ParseToTilemap: __webpack_require__(253), + Tile: __webpack_require__(81), + Tilemap: __webpack_require__(559), + TilemapCreator: __webpack_require__(1431), + TilemapFactory: __webpack_require__(1432), + Tileset: __webpack_require__(119), + TilemapLayer: __webpack_require__(560), + Orientation: __webpack_require__(29), - LayerData: __webpack_require__(105), - MapData: __webpack_require__(106), - ObjectLayer: __webpack_require__(516), - - DynamicTilemapLayer: __webpack_require__(523), - StaticTilemapLayer: __webpack_require__(524) + LayerData: __webpack_require__(117), + MapData: __webpack_require__(118), + ObjectLayer: __webpack_require__(551) }; +Tilemaps = Extend(false, Tilemaps, CONST.ORIENTATION); + +module.exports = Tilemaps; + /***/ }), -/* 1326 */ +/* 1392 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188048,8 +198830,28 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var CalculateFacesWithin = __webpack_require__(53); +var CONST = { + + FromOrientationString: __webpack_require__(242), + ORIENTATION: __webpack_require__(29) + +}; + +module.exports = CONST; + + +/***/ }), +/* 1393 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTilesWithin = __webpack_require__(26); +var CalculateFacesWithin = __webpack_require__(60); /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile @@ -188059,20 +198861,21 @@ var CalculateFacesWithin = __webpack_require__(53); * @function Phaser.Tilemaps.Components.Copy * @since 3.0.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) { + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (srcTileX < 0) { srcTileX = 0; } if (srcTileY < 0) { srcTileY = 0; } - if (recalculateFaces === undefined) { recalculateFaces = true; } var srcTiles = GetTilesWithin(srcTileX, srcTileY, width, height, null, layer); @@ -188104,7 +198907,7 @@ module.exports = Copy; /***/ }), -/* 1327 */ +/* 1394 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188113,10 +198916,8 @@ module.exports = Copy; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(151); -var TileToWorldY = __webpack_require__(152); -var GetTilesWithin = __webpack_require__(24); -var ReplaceByIndex = __webpack_require__(503); +var GetTilesWithin = __webpack_require__(26); +var ReplaceByIndex = __webpack_require__(521); /** * Creates a Sprite for every object matching the given tile indexes in the layer. You can @@ -188130,15 +198931,15 @@ var ReplaceByIndex = __webpack_require__(503); * @param {(number|number[])} indexes - The tile index, or array of indexes, to create Sprites from. * @param {(number|number[])} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * @param {Phaser.Scene} scene - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when determining the world XY * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. */ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, camera, layer) { - if (spriteConfig === undefined) { spriteConfig = {}; } + if (!spriteConfig) { spriteConfig = {}; } if (!Array.isArray(indexes)) { @@ -188147,8 +198948,8 @@ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, came var tilemapLayer = layer.tilemapLayer; - if (scene === undefined) { scene = tilemapLayer.scene; } - if (camera === undefined) { camera = scene.cameras.main; } + if (!scene) { scene = tilemapLayer.scene; } + if (!camera) { camera = scene.cameras.main; } var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); var sprites = []; @@ -188160,8 +198961,10 @@ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, came if (indexes.indexOf(tile.index) !== -1) { - spriteConfig.x = TileToWorldX(tile.x, camera, layer); - spriteConfig.y = TileToWorldY(tile.y, camera, layer); + var point = tilemapLayer.tileToWorldXY(tile.x, tile.y, undefined, camera,layer); + + spriteConfig.x = point.x; + spriteConfig.y = point.y; sprites.push(scene.make.sprite(spriteConfig)); } @@ -188191,7 +198994,7 @@ module.exports = CreateFromTiles; /***/ }), -/* 1328 */ +/* 1395 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188200,165 +199003,9 @@ module.exports = CreateFromTiles; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SnapFloor = __webpack_require__(95); -var SnapCeil = __webpack_require__(343); - -/** - * Returns the tiles in the given layer that are within the camera's viewport. This is used internally. - * - * @function Phaser.Tilemaps.Components.CullTiles - * @since 3.0.0 - * - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * @param {array} [outputArray] - An optional array to store the Tile objects within. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ -var CullTiles = function (layer, camera, outputArray, renderOrder) -{ - if (outputArray === undefined) { outputArray = []; } - if (renderOrder === undefined) { renderOrder = 0; } - - outputArray.length = 0; - - var tilemap = layer.tilemapLayer.tilemap; - var tilemapLayer = layer.tilemapLayer; - - var mapData = layer.data; - var mapWidth = layer.width; - var mapHeight = layer.height; - - // We need to use the tile sizes defined for the map as a whole, not the layer, - // in order to calculate the bounds correctly. As different sized tiles may be - // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. - var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); - var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); - - var drawLeft = 0; - var drawRight = mapWidth; - var drawTop = 0; - var drawBottom = mapHeight; - - if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) - { - // Camera world view bounds, snapped for scaled tile size - // Cull Padding values are given in tiles, not pixels - - var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; - var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; - var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY; - var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY; - - drawLeft = Math.max(0, boundsLeft); - drawRight = Math.min(mapWidth, boundsRight); - drawTop = Math.max(0, boundsTop); - drawBottom = Math.min(mapHeight, boundsBottom); - } - - var x; - var y; - var tile; - - if (renderOrder === 0) - { - // right-down - - for (y = drawTop; y < drawBottom; y++) - { - for (x = drawLeft; mapData[y] && x < drawRight; x++) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 1) - { - // left-down - - for (y = drawTop; y < drawBottom; y++) - { - for (x = drawRight; mapData[y] && x >= drawLeft; x--) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 2) - { - // right-up - - for (y = drawBottom; y >= drawTop; y--) - { - for (x = drawLeft; mapData[y] && x < drawRight; x++) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 3) - { - // left-up - - for (y = drawBottom; y >= drawTop; y--) - { - for (x = drawRight; mapData[y] && x >= drawLeft; x--) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - - tilemapLayer.tilesDrawn = outputArray.length; - tilemapLayer.tilesTotal = mapWidth * mapHeight; - - return outputArray; -}; - -module.exports = CullTiles; - - -/***/ }), -/* 1329 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetTilesWithin = __webpack_require__(24); -var CalculateFacesWithin = __webpack_require__(53); -var SetTileCollision = __webpack_require__(65); +var GetTilesWithin = __webpack_require__(26); +var CalculateFacesWithin = __webpack_require__(60); +var SetTileCollision = __webpack_require__(69); /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the @@ -188368,11 +199015,11 @@ var SetTileCollision = __webpack_require__(65); * @function Phaser.Tilemaps.Components.Fill * @since 3.0.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used. */ @@ -188400,7 +199047,7 @@ module.exports = Fill; /***/ }), -/* 1330 */ +/* 1396 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188409,7 +199056,7 @@ module.exports = Fill; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -188422,15 +199069,12 @@ var GetTilesWithin = __webpack_require__(24); * @param {function} callback - The callback. Each tile in the given area will be passed to this * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles. @@ -188446,7 +199090,7 @@ module.exports = FilterTiles; /***/ }), -/* 1331 */ +/* 1397 */ /***/ (function(module, exports) { /** @@ -188465,10 +199109,9 @@ module.exports = FilterTiles; * @function Phaser.Tilemaps.Components.FindByIndex * @since 3.0.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. + * @param {number} index - The tile index value to search for. + * @param {number} skip - The number of times to skip a matching tile before returning. + * @param {boolean} reverse - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} The first (or n skipped) tile with the matching index. @@ -188533,7 +199176,7 @@ module.exports = FindByIndex; /***/ }), -/* 1332 */ +/* 1398 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188542,13 +199185,13 @@ module.exports = FindByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * @callback FindTileCallback * * @param {Phaser.Tilemaps.Tile} value - The Tile. - * @param {integer} index - The index of the tile. + * @param {number} index - The index of the tile. * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. * * @return {boolean} Return `true` if the callback should run, otherwise `false`. @@ -188563,15 +199206,12 @@ var GetTilesWithin = __webpack_require__(24); * @since 3.0.0 * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found @@ -188579,6 +199219,7 @@ var GetTilesWithin = __webpack_require__(24); var FindTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + return tiles.find(callback, context) || null; }; @@ -188586,7 +199227,7 @@ module.exports = FindTile; /***/ }), -/* 1333 */ +/* 1399 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188595,13 +199236,13 @@ module.exports = FindTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * @callback EachTileCallback * * @param {Phaser.Tilemaps.Tile} value - The Tile. - * @param {integer} index - The index of the tile. + * @param {number} index - The index of the tile. * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. */ @@ -188613,15 +199254,12 @@ var GetTilesWithin = __webpack_require__(24); * @since 3.0.0 * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) @@ -188635,7 +199273,7 @@ module.exports = ForEachTile; /***/ }), -/* 1334 */ +/* 1400 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188644,9 +199282,64 @@ module.exports = ForEachTile; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTileAt = __webpack_require__(150); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var CONST = __webpack_require__(29); +var CullTiles = __webpack_require__(523); +var HexagonalCullTiles = __webpack_require__(524); +var IsometricCullTiles = __webpack_require__(526); +var NOOP = __webpack_require__(1); +var StaggeredCullTiles = __webpack_require__(527); + +/** + * Gets the correct function to use to cull tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetCullTilesFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to cull tiles for the given map type. + */ +var GetCullTilesFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return CullTiles; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalCullTiles; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredCullTiles; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricCullTiles; + } + else + { + return NOOP; + } +}; + +module.exports = GetCullTilesFunction; + + +/***/ }), +/* 1401 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetTileAt = __webpack_require__(151); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Gets a tile at the given world coordinates from the given layer. @@ -188656,26 +199349,24 @@ var WorldToTileY = __webpack_require__(67); * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} nonNull - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ var GetTileAtWorldXY = function (worldX, worldY, nonNull, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera); - return GetTileAt(tileX, tileY, nonNull, layer); + return GetTileAt(point.x, point.y, nonNull, layer); }; module.exports = GetTileAtWorldXY; /***/ }), -/* 1335 */ +/* 1402 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188684,22 +199375,20 @@ module.exports = GetTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Geom = __webpack_require__(448); -var GetTilesWithin = __webpack_require__(24); -var Intersects = __webpack_require__(449); +var Geom = __webpack_require__(460); +var GetTilesWithin = __webpack_require__(26); +var Intersects = __webpack_require__(461); var NOOP = __webpack_require__(1); -var TileToWorldX = __webpack_require__(151); -var TileToWorldY = __webpack_require__(152); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var Vector2 = __webpack_require__(3); var TriangleToRectangle = function (triangle, rect) { return Intersects.RectangleToTriangle(rect, triangle); }; -// Note: Could possibly be optimized by copying the shape and shifting it into tilemapLayer -// coordinates instead of shifting the tiles. +var point = new Vector2(); +var pointStart = new Vector2(); +var pointEnd = new Vector2(); /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, @@ -188709,11 +199398,8 @@ var TriangleToRectangle = function (triangle, rect) * @since 3.0.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -188725,45 +199411,40 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) // intersectTest is a function with parameters: shape, rect var intersectTest = NOOP; - switch (typeof(shape)) + if (shape instanceof Geom.Circle) { - case Geom.Circle: - { - intersectTest = Intersects.CircleToRectangle; - break; - } - - case Geom.Rectangle: - { - intersectTest = Intersects.RectangleToRectangle; - break; - } - - case Geom.Triangle: - { - intersectTest = TriangleToRectangle; - break; - } - - case Geom.Line: - { - intersectTest = Intersects.LineToRectangle; - break; - } + intersectTest = Intersects.CircleToRectangle; + } + else if (shape instanceof Geom.Rectangle) + { + intersectTest = Intersects.RectangleToRectangle; + } + else if (shape instanceof Geom.Triangle) + { + intersectTest = TriangleToRectangle; + } + else if (shape instanceof Geom.Line) + { + intersectTest = Intersects.LineToRectangle; } // Top left corner of the shapes's bounding box, rounded down to include partial tiles - var xStart = WorldToTileX(shape.left, true, camera, layer); - var yStart = WorldToTileY(shape.top, true, camera, layer); + layer.tilemapLayer.worldToTileXY(shape.left, shape.top, true, pointStart, camera); + + var xStart = pointStart.x; + var yStart = pointStart.y; // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles - var xEnd = Math.ceil(WorldToTileX(shape.right, false, camera, layer)); - var yEnd = Math.ceil(WorldToTileY(shape.bottom, false, camera, layer)); + layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, true, pointEnd, camera); + + var xEnd = Math.ceil(pointEnd.x); + var yEnd = Math.ceil(pointEnd.y); // Tiles within bounding rectangle of shape. Bounds are forced to be at least 1 x 1 tile in size // to grab tiles for shapes that don't have a height or width (e.g. a horizontal line). var width = Math.max(xEnd - xStart, 1); var height = Math.max(yEnd - yStart, 1); + var tiles = GetTilesWithin(xStart, yStart, width, height, filteringOptions, layer); var tileWidth = layer.tileWidth; @@ -188782,8 +199463,10 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) { var tile = tiles[i]; - tileRect.x = TileToWorldX(tile.x, camera, layer); - tileRect.y = TileToWorldY(tile.y, camera, layer); + layer.tilemapLayer.tileToWorldXY(tile.x, tile.y, point, camera); + + tileRect.x = point.x; + tileRect.y = point.y; if (intersectTest(shape, tileRect)) { @@ -188798,7 +199481,7 @@ module.exports = GetTilesWithinShape; /***/ }), -/* 1336 */ +/* 1403 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188807,47 +199490,37 @@ module.exports = GetTilesWithinShape; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var CONST = __webpack_require__(29); +var NOOP = __webpack_require__(1); +var TileToWorldX = __webpack_require__(245); /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * Gets the correct function to use to translate tiles, based on the map orientation. * - * @function Phaser.Tilemaps.Components.GetTilesWithinWorldXY - * @since 3.0.0 + * @function Phaser.Tilemaps.Components.GetTileToWorldXFunction + * @since 3.50.0 * - * @param {number} worldX - The world x coordinate for the top-left of the area. - * @param {number} worldY - The world y coordinate for the top-left of the area. - * @param {number} width - The width of the area. - * @param {number} height - The height of the area. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {number} orientation - The Tilemap orientation constant. * - * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. + * @return {function} The function to use to translate tiles for the given map type. */ -var GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer) +var GetTileToWorldXFunction = function (orientation) { - // Top left corner of the rect, rounded down to include partial tiles - var xStart = WorldToTileX(worldX, true, camera, layer); - var yStart = WorldToTileY(worldY, true, camera, layer); - - // Bottom right corner of the rect, rounded up to include partial tiles - var xEnd = Math.ceil(WorldToTileX(worldX + width, false, camera, layer)); - var yEnd = Math.ceil(WorldToTileY(worldY + height, false, camera, layer)); - - return GetTilesWithin(xStart, yStart, xEnd - xStart, yEnd - yStart, filteringOptions, layer); + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldX; + } + else + { + return NOOP; + } }; -module.exports = GetTilesWithinWorldXY; +module.exports = GetTileToWorldXFunction; /***/ }), -/* 1337 */ +/* 1404 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188856,9 +199529,255 @@ module.exports = GetTilesWithinWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var HasTileAt = __webpack_require__(504); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var CONST = __webpack_require__(29); +var HexagonalTileToWorldXY = __webpack_require__(529); +var IsometricTileToWorldXY = __webpack_require__(530); +var NOOP = __webpack_require__(1); +var StaggeredTileToWorldXY = __webpack_require__(531); +var TileToWorldXY = __webpack_require__(532); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetTileToWorldXYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetTileToWorldXYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldXY; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricTileToWorldXY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalTileToWorldXY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredTileToWorldXY; + } + else + { + return NOOP; + } +}; + +module.exports = GetTileToWorldXYFunction; + + +/***/ }), +/* 1405 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var HexagonalTileToWorldY = __webpack_require__(533); +var NOOP = __webpack_require__(1); +var StaggeredTileToWorldY = __webpack_require__(534); +var TileToWorldY = __webpack_require__(246); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetTileToWorldYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetTileToWorldYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalTileToWorldY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredTileToWorldY; + } + else + { + return NOOP; + } +}; + +module.exports = GetTileToWorldYFunction; + + +/***/ }), +/* 1406 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var NOOP = __webpack_require__(1); +var WorldToTileX = __webpack_require__(247); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileXFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileXFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileX; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileXFunction; + + +/***/ }), +/* 1407 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var HexagonalWorldToTileXY = __webpack_require__(535); +var IsometricWorldToTileXY = __webpack_require__(536); +var NOOP = __webpack_require__(1); +var StaggeredWorldToTileXY = __webpack_require__(537); +var WorldToTileXY = __webpack_require__(538); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileXYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileXYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileXY; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricWorldToTileXY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalWorldToTileXY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredWorldToTileXY; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileXYFunction; + + +/***/ }), +/* 1408 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(29); +var HexagonalWorldToTileY = __webpack_require__(539); +var NOOP = __webpack_require__(1); +var StaggeredWorldToTileY = __webpack_require__(540); +var WorldToTileY = __webpack_require__(248); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalWorldToTileY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredWorldToTileY; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileYFunction; + + +/***/ }), +/* 1409 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var HasTileAt = __webpack_require__(541); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -188869,15 +199788,17 @@ var WorldToTileY = __webpack_require__(67); * * @param {number} worldX - The X coordinate of the world position. * @param {number} worldY - The Y coordinate of the world position. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAtWorldXY = function (worldX, worldY, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera); + + var tileX = point.x; + var tileY = point.y; return HasTileAt(tileX, tileY, layer); }; @@ -188886,7 +199807,7 @@ module.exports = HasTileAtWorldXY; /***/ }), -/* 1338 */ +/* 1410 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188895,9 +199816,10 @@ module.exports = HasTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var PutTileAt = __webpack_require__(236); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var PutTileAt = __webpack_require__(249); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -188908,28 +199830,27 @@ var WorldToTileY = __webpack_require__(67); * @function Phaser.Tilemaps.Components.PutTileAtWorldXY * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAtWorldXY = function (tile, worldX, worldY, recalculateFaces, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera, layer); - return PutTileAt(tile, tileX, tileY, recalculateFaces, layer); + return PutTileAt(tile, point.x, point.y, recalculateFaces, layer); }; module.exports = PutTileAtWorldXY; /***/ }), -/* 1339 */ +/* 1411 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -188938,8 +199859,8 @@ module.exports = PutTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CalculateFacesWithin = __webpack_require__(53); -var PutTileAt = __webpack_require__(236); +var CalculateFacesWithin = __webpack_require__(60); +var PutTileAt = __webpack_require__(249); /** * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified @@ -188951,17 +199872,21 @@ var PutTileAt = __webpack_require__(236); * @function Phaser.Tilemaps.Components.PutTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer) { - if (!Array.isArray(tilesArray)) { return null; } if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!Array.isArray(tilesArray)) + { + return null; + } + // Force the input array to be a 2D array if (!Array.isArray(tilesArray[0])) { @@ -188992,7 +199917,7 @@ module.exports = PutTilesAt; /***/ }), -/* 1340 */ +/* 1412 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189001,8 +199926,8 @@ module.exports = PutTilesAt; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var GetRandom = __webpack_require__(196); +var GetTilesWithin = __webpack_require__(26); +var GetRandom = __webpack_require__(201); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -189014,20 +199939,20 @@ var GetRandom = __webpack_require__(196); * @function Phaser.Tilemaps.Components.Randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} indexes - An array of indexes to randomly draw from during randomization. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Randomize = function (tileX, tileY, width, height, indexes, layer) { var i; - var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + var tiles = GetTilesWithin(tileX, tileY, width, height, {}, layer); // If no indices are given, then find all the unique indexes within the specified region - if (indexes === undefined) + if (!indexes) { indexes = []; @@ -189050,7 +199975,7 @@ module.exports = Randomize; /***/ }), -/* 1341 */ +/* 1413 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189059,9 +199984,10 @@ module.exports = Randomize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RemoveTileAt = __webpack_require__(505); -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); +var RemoveTileAt = __webpack_require__(542); +var Vector2 = __webpack_require__(3); + +var point = new Vector2(); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -189072,26 +199998,25 @@ var WorldToTileY = __webpack_require__(67); * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} replaceWithNull - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAtWorldXY = function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera, layer); - return RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, layer); + return RemoveTileAt(point.x, point.y, replaceWithNull, recalculateFaces, layer); }; module.exports = RemoveTileAtWorldXY; /***/ }), -/* 1342 */ +/* 1414 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189100,8 +200025,8 @@ module.exports = RemoveTileAtWorldXY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var Color = __webpack_require__(364); +var GetTilesWithin = __webpack_require__(26); +var Color = __webpack_require__(373); var defaultTileColor = new Color(105, 210, 231, 150); var defaultCollidingTileColor = new Color(243, 134, 48, 200); @@ -189117,13 +200042,7 @@ var defaultFaceColor = new Color(40, 39, 37, 150); * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {object} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {?Phaser.Display.Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at - * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. - * @param {?Phaser.Display.Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled - * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. - * @param {?Phaser.Display.Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting - * tile faces. If set to null, interesting tile faces will not be drawn. + * @param {Phaser.Types.Tilemaps.DebugStyleOptions} styleConfig - An object specifying the colors to use for the debug drawing. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var RenderDebug = function (graphics, styleConfig, layer) @@ -189179,7 +200098,7 @@ module.exports = RenderDebug; /***/ }), -/* 1343 */ +/* 1415 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189188,8 +200107,8 @@ module.exports = RenderDebug; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); var SetLayerCollisionIndex = __webpack_require__(153); /** @@ -189200,20 +200119,23 @@ var SetLayerCollisionIndex = __webpack_require__(153); * @function Phaser.Tilemaps.Components.SetCollision * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {boolean} updateLayer - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. */ var SetCollision = function (indexes, collides, recalculateFaces, layer, updateLayer) { if (collides === undefined) { collides = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } - if (!Array.isArray(indexes)) { indexes = [ indexes ]; } if (updateLayer === undefined) { updateLayer = true; } + if (!Array.isArray(indexes)) + { + indexes = [ indexes ]; + } + // Update the array of colliding indexes for (var i = 0; i < indexes.length; i++) { @@ -189247,7 +200169,7 @@ module.exports = SetCollision; /***/ }), -/* 1344 */ +/* 1416 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189256,8 +200178,8 @@ module.exports = SetCollision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); var SetLayerCollisionIndex = __webpack_require__(153); /** @@ -189269,13 +200191,12 @@ var SetLayerCollisionIndex = __webpack_require__(153); * @function Phaser.Tilemaps.Components.SetCollisionBetween * @since 3.0.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. */ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer, updateLayer) { @@ -189283,15 +200204,18 @@ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, lay if (recalculateFaces === undefined) { recalculateFaces = true; } if (updateLayer === undefined) { updateLayer = true; } - if (start > stop) { return; } + if (start > stop) + { + return; + } - // Update the array of colliding indexes + // Update the array of colliding indexes for (var index = start; index <= stop; index++) { SetLayerCollisionIndex(index, collides, layer); } - // Update the tiles + // Update the tiles if (updateLayer) { for (var ty = 0; ty < layer.height; ty++) @@ -189321,7 +200245,7 @@ module.exports = SetCollisionBetween; /***/ }), -/* 1345 */ +/* 1417 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189330,8 +200254,8 @@ module.exports = SetCollisionBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); var SetLayerCollisionIndex = __webpack_require__(153); /** @@ -189342,16 +200266,20 @@ var SetLayerCollisionIndex = __webpack_require__(153); * @function Phaser.Tilemaps.Components.SetCollisionByExclusion * @since 3.0.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer) { if (collides === undefined) { collides = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } - if (!Array.isArray(indexes)) { indexes = [ indexes ]; } + + if (!Array.isArray(indexes)) + { + indexes = [ indexes ]; + } // Note: this only updates layer.collideIndexes for tile indexes found currently in the layer for (var ty = 0; ty < layer.height; ty++) @@ -189359,6 +200287,7 @@ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, lay for (var tx = 0; tx < layer.width; tx++) { var tile = layer.data[ty][tx]; + if (tile && indexes.indexOf(tile.index) === -1) { SetTileCollision(tile, collides); @@ -189377,7 +200306,7 @@ module.exports = SetCollisionByExclusion; /***/ }), -/* 1346 */ +/* 1418 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189386,9 +200315,9 @@ module.exports = SetCollisionByExclusion; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); -var HasValue = __webpack_require__(115); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); +var HasValue = __webpack_require__(123); /** * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property @@ -189403,8 +200332,8 @@ var HasValue = __webpack_require__(115); * @since 3.0.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByProperty = function (properties, collides, recalculateFaces, layer) @@ -189425,6 +200354,7 @@ var SetCollisionByProperty = function (properties, collides, recalculateFaces, l if (!HasValue(tile.properties, property)) { continue; } var values = properties[property]; + if (!Array.isArray(values)) { values = [ values ]; @@ -189451,7 +200381,7 @@ module.exports = SetCollisionByProperty; /***/ }), -/* 1347 */ +/* 1419 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189460,8 +200390,8 @@ module.exports = SetCollisionByProperty; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SetTileCollision = __webpack_require__(65); -var CalculateFacesWithin = __webpack_require__(53); +var SetTileCollision = __webpack_require__(69); +var CalculateFacesWithin = __webpack_require__(60); /** * Sets collision on the tiles within a layer by checking each tile's collision group data @@ -189472,8 +200402,8 @@ var CalculateFacesWithin = __webpack_require__(53); * @function Phaser.Tilemaps.Components.SetCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer) @@ -189510,7 +200440,7 @@ module.exports = SetCollisionFromCollisionGroup; /***/ }), -/* 1348 */ +/* 1420 */ /***/ (function(module, exports) { /** @@ -189528,7 +200458,7 @@ module.exports = SetCollisionFromCollisionGroup; * @function Phaser.Tilemaps.Components.SetTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -189556,7 +200486,7 @@ module.exports = SetTileIndexCallback; /***/ }), -/* 1349 */ +/* 1421 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189565,7 +200495,7 @@ module.exports = SetTileIndexCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. @@ -189575,10 +200505,10 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.SetTileLocationCallback * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. @@ -189597,7 +200527,7 @@ module.exports = SetTileLocationCallback; /***/ }), -/* 1350 */ +/* 1422 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189606,8 +200536,8 @@ module.exports = SetTileLocationCallback; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); -var ShuffleArray = __webpack_require__(121); +var GetTilesWithin = __webpack_require__(26); +var ShuffleArray = __webpack_require__(127); /** * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given @@ -189618,10 +200548,10 @@ var ShuffleArray = __webpack_require__(121); * @function Phaser.Tilemaps.Components.Shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Shuffle = function (tileX, tileY, width, height, layer) @@ -189642,7 +200572,7 @@ module.exports = Shuffle; /***/ }), -/* 1351 */ +/* 1423 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189651,7 +200581,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -189661,12 +200591,12 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.SwapByIndex * @since 3.0.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer) @@ -189693,7 +200623,7 @@ module.exports = SwapByIndex; /***/ }), -/* 1352 */ +/* 1424 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189702,50 +200632,7 @@ module.exports = SwapByIndex; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = __webpack_require__(151); -var TileToWorldY = __webpack_require__(152); -var Vector2 = __webpack_require__(3); - -/** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @function Phaser.Tilemaps.Components.TileToWorldXY - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {Phaser.Math.Vector2} The XY location in world coordinates. - */ -var TileToWorldXY = function (tileX, tileY, point, camera, layer) -{ - if (point === undefined) { point = new Vector2(0, 0); } - - point.x = TileToWorldX(tileX, camera, layer); - point.y = TileToWorldY(tileY, camera, layer); - - return point; -}; - -module.exports = TileToWorldXY; - - -/***/ }), -/* 1353 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GetTilesWithin = __webpack_require__(24); +var GetTilesWithin = __webpack_require__(26); /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -189765,23 +200652,24 @@ var GetTilesWithin = __webpack_require__(24); * @function Phaser.Tilemaps.Components.WeightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var WeightedRandomize = function (tileX, tileY, width, height, weightedIndexes, layer) { - if (weightedIndexes === undefined) { return; } + if (!weightedIndexes) { return; } var i; var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); var weightTotal = 0; + for (i = 0; i < weightedIndexes.length; i++) { weightTotal += weightedIndexes[i].weight; @@ -189818,51 +200706,7 @@ module.exports = WeightedRandomize; /***/ }), -/* 1354 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var WorldToTileX = __webpack_require__(66); -var WorldToTileY = __webpack_require__(67); -var Vector2 = __webpack_require__(3); - -/** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layer's position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @function Phaser.Tilemaps.Components.WorldToTileXY - * @since 3.0.0 - * - * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * - * @return {Phaser.Math.Vector2} The XY location in tile units. - */ -var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) -{ - if (point === undefined) { point = new Vector2(0, 0); } - - point.x = WorldToTileX(worldX, snapToFloor, camera, layer); - point.y = WorldToTileY(worldY, snapToFloor, camera, layer); - - return point; -}; - -module.exports = WorldToTileXY; - - -/***/ }), -/* 1355 */ +/* 1425 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189877,18 +200721,18 @@ module.exports = WorldToTileXY; module.exports = { - Parse: __webpack_require__(506), - Parse2DArray: __webpack_require__(237), - ParseCSV: __webpack_require__(507), + Parse: __webpack_require__(543), + Parse2DArray: __webpack_require__(250), + ParseCSV: __webpack_require__(544), - Impact: __webpack_require__(1356), - Tiled: __webpack_require__(1357) + Impact: __webpack_require__(1426), + Tiled: __webpack_require__(1427) }; /***/ }), -/* 1356 */ +/* 1426 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189903,15 +200747,15 @@ module.exports = { module.exports = { - ParseTileLayers: __webpack_require__(520), - ParseTilesets: __webpack_require__(521), - ParseWeltmeister: __webpack_require__(519) + ParseTileLayers: __webpack_require__(557), + ParseTilesets: __webpack_require__(558), + ParseWeltmeister: __webpack_require__(556) }; /***/ }), -/* 1357 */ +/* 1427 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189926,23 +200770,23 @@ module.exports = { module.exports = { - AssignTileProperties: __webpack_require__(518), - Base64Decode: __webpack_require__(510), - BuildTilesetIndex: __webpack_require__(517), + AssignTileProperties: __webpack_require__(546), + Base64Decode: __webpack_require__(553), + BuildTilesetIndex: __webpack_require__(547), CreateGroupLayer: __webpack_require__(154), - ParseGID: __webpack_require__(238), - ParseImageLayers: __webpack_require__(511), - ParseJSONTiled: __webpack_require__(508), - ParseObject: __webpack_require__(239), - ParseObjectLayers: __webpack_require__(515), - ParseTileLayers: __webpack_require__(509), - ParseTilesets: __webpack_require__(512) + ParseGID: __webpack_require__(252), + ParseImageLayers: __webpack_require__(548), + ParseJSONTiled: __webpack_require__(545), + ParseObject: __webpack_require__(251), + ParseObjectLayers: __webpack_require__(549), + ParseTileLayers: __webpack_require__(552), + ParseTilesets: __webpack_require__(554) }; /***/ }), -/* 1358 */ +/* 1428 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189956,12 +200800,12 @@ var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(1359); + renderWebGL = __webpack_require__(1429); } if (true) { - renderCanvas = __webpack_require__(1360); + renderCanvas = __webpack_require__(1430); } module.exports = { @@ -189973,7 +200817,7 @@ module.exports = { /***/ }), -/* 1359 */ +/* 1429 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -189982,27 +200826,25 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = __webpack_require__(10); +var Utils = __webpack_require__(12); /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. * This method should not be called directly. It is a utility function of the Render module. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderWebGL + * @method Phaser.Tilemaps.TilemapLayer#renderWebGL * @since 3.0.0 * @private * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Tilemaps.TilemapLayer} src - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. */ -var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) +var TilemapLayerWebGLRenderer = function (renderer, src, camera) { - src.cull(camera); + var renderTiles = src.cull(camera); - var renderTiles = src.culledTiles; var tileCount = renderTiles.length; var alpha = camera.alpha * src.alpha; @@ -190012,9 +200854,9 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer } var gidMap = src.gidMap; - var pipeline = renderer.pipelines.set(src.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var getTint = Utils.getTintAppendFloatAlphaAndSwap; + var getTint = Utils.getTintAppendFloatAlpha; var scrollFactorX = src.scrollFactorX; var scrollFactorY = src.scrollFactorY; @@ -190025,75 +200867,66 @@ var DynamicTilemapLayerWebGLRenderer = function (renderer, src, interpolationPer var sx = src.scaleX; var sy = src.scaleY; - var tilesets = src.tileset; + renderer.pipelines.preBatch(src); - // Loop through each tileset in this layer, drawing just the tiles that are in that set each time - // Doing it this way around allows us to batch tiles using the same tileset - for (var c = 0; c < tilesets.length; c++) + for (var i = 0; i < tileCount; i++) { - var currentSet = tilesets[c]; - var texture = currentSet.glTexture; + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords === null) + { + continue; + } + + var texture = tileset.glTexture; + var textureUnit = pipeline.setTexture2D(texture, src); - for (var i = 0; i < tileCount; i++) - { - var tile = renderTiles[i]; + var frameWidth = tileset.tileWidth; + var frameHeight = tileset.tileHeight; - var tileset = gidMap[tile.index]; + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; - if (tileset !== currentSet) - { - // Skip tiles that aren't in this set - continue; - } + var tw = tileset.tileWidth * 0.5; + var th = tileset.tileHeight * 0.5; - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + var tint = getTint(tile.tint, alpha * tile.alpha); - if (tileTexCoords === null) - { - continue; - } - - var frameWidth = tile.width; - var frameHeight = tile.height; - - var frameX = tileTexCoords.x; - var frameY = tileTexCoords.y; - - var tw = tile.width * 0.5; - var th = tile.height * 0.5; - - var tint = getTint(tile.tint, alpha * tile.alpha); - - pipeline.batchTexture( - src, - texture, - texture.width, texture.height, - x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy), - tile.width, tile.height, - sx, sy, - tile.rotation, - tile.flipX, tile.flipY, - scrollFactorX, scrollFactorY, - tw, th, - frameX, frameY, frameWidth, frameHeight, - tint, tint, tint, tint, false, - 0, 0, - camera, - null, - true, - textureUnit - ); - } + pipeline.batchTexture( + src, + texture, + texture.width, texture.height, + x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy), + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, + scrollFactorX, scrollFactorY, + tw, th, + frameX, frameY, frameWidth, frameHeight, + tint, tint, tint, tint, false, + 0, 0, + camera, + null, + true, + textureUnit + ); } + + renderer.pipelines.postBatch(src); }; -module.exports = DynamicTilemapLayerWebGLRenderer; +module.exports = TilemapLayerWebGLRenderer; /***/ }), -/* 1360 */ -/***/ (function(module, exports) { +/* 1430 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -190101,36 +200934,41 @@ module.exports = DynamicTilemapLayerWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = __webpack_require__(24); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + /** * Renders this Game Object with the Canvas Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. * This method should not be called directly. It is a utility function of the Render module. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderCanvas - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#renderCanvas + * @since 3.50.0 * @private * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. + * @param {Phaser.Tilemaps.TilemapLayer} src - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var TilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) { - src.cull(camera); + var renderTiles = src.cull(camera); - var renderTiles = src.culledTiles; var tileCount = renderTiles.length; + var alpha = camera.alpha * src.alpha; - if (tileCount === 0) + if (tileCount === 0 || alpha <= 0) { return; } - var camMatrix = renderer._tempMatrix1; - var layerMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var camMatrix = tempMatrix1; + var layerMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); @@ -190163,8 +201001,6 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe layerMatrix.copyToContext(ctx); } - var alpha = camera.alpha * src.alpha; - if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1) { ctx.imageSmoothingEnabled = false; @@ -190186,482 +201022,9 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, interpolationPe if (tileTexCoords) { - var halfWidth = tile.width / 2; - var halfHeight = tile.height / 2; - - ctx.save(); + var halfWidth = tileset.tileWidth / 2; + var halfHeight = tileset.tileHeight / 2; - ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); - - if (tile.rotation !== 0) - { - ctx.rotate(tile.rotation); - } - - if (tile.flipX || tile.flipY) - { - ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); - } - - ctx.globalAlpha = alpha * tile.alpha; - - ctx.drawImage( - image, - tileTexCoords.x, tileTexCoords.y, - tile.width, tile.height, - -halfWidth, -halfHeight, - tile.width, tile.height - ); - - ctx.restore(); - } - } - - ctx.restore(); -}; - -module.exports = DynamicTilemapLayerCanvasRenderer; - - -/***/ }), -/* 1361 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var renderWebGL = __webpack_require__(1); -var renderCanvas = __webpack_require__(1); - -if (true) -{ - renderWebGL = __webpack_require__(1362); -} - -if (true) -{ - renderCanvas = __webpack_require__(1368); -} - -module.exports = { - - renderWebGL: renderWebGL, - renderCanvas: renderCanvas - -}; - - -/***/ }), -/* 1362 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Identity = __webpack_require__(1363); -var Scale = __webpack_require__(1365); -var Translate = __webpack_require__(1366); -var ViewLoad2D = __webpack_require__(1367); - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * A Static Tilemap Layer renders immediately and does not use any batching. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderWebGL - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - */ -var StaticTilemapLayerWebGLRenderer = function (renderer, src, interpolationPercentage, camera) -{ - var gl = renderer.gl; - var pipeline = src.pipeline; - - renderer.flush(); - - // Restore when we're done - var pipelineVertexBuffer = pipeline.vertexBuffer; - - Identity(src); - Translate(src, src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0); - Scale(src, src.scaleX, src.scaleY, 1); - ViewLoad2D(src, camera.matrix.matrix); - - renderer.pipelines.set(pipeline); - - // The above alters the uniforms, so make sure we call it _after_ setting the MVP stuff above - renderer.setMatrix4(pipeline.program, 'uModelMatrix', false, src.modelMatrix); - renderer.setMatrix4(pipeline.program, 'uViewMatrix', false, src.viewMatrix); - renderer.setMatrix4(pipeline.program, 'uProjectionMatrix', false, pipeline.projectionMatrix); - - for (var i = 0; i < src.tileset.length; i++) - { - var tileset = src.tileset[i]; - var vertexCount = src.vertexCount[i]; - - src.upload(camera, i); - - if (vertexCount > 0) - { - if (pipeline.forceZero) - { - // Light Pipeline, or similar - pipeline.setGameObject(src, tileset); - } - else - { - renderer.setTextureZero(tileset.glTexture); - } - - gl.drawArrays(gl.TRIANGLES, 0, vertexCount); - } - } - - renderer.resetTextures(); - - // Restore the pipeline buffer - pipeline.vertexBuffer = pipelineVertexBuffer; - - renderer.currentVertexBuffer = pipelineVertexBuffer; - - pipeline.setAttribPointers(); - - // Reset the uniforms - renderer.setMatrix4(pipeline.program, 'uModelMatrix', false, pipeline.modelMatrix); - renderer.setMatrix4(pipeline.program, 'uViewMatrix', false, pipeline.viewMatrix); - renderer.setMatrix4(pipeline.program, 'uProjectionMatrix', false, pipeline.projectionMatrix); -}; - -module.exports = StaticTilemapLayerWebGLRenderer; - - -/***/ }), -/* 1363 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SetIdentity = __webpack_require__(1364); - -/** - * Loads an identity matrix into the model matrix. - * - * @method Phaser.Renderer.WebGL.MVP.Identity - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Identity = function (model) -{ - SetIdentity(model.modelMatrix); - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Identity; - - -/***/ }), -/* 1364 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Loads an identity matrix into the model matrix. - * - * @method Phaser.Renderer.WebGL.MVP.SetIdentity - * @since 3.50.0 - * - * @param {Float32Array} array - The array to set to be an identity matrix. - */ -var SetIdentity = function (array) -{ - array[0] = 1; - array[1] = 0; - array[2] = 0; - array[3] = 0; - array[4] = 0; - array[5] = 1; - array[6] = 0; - array[7] = 0; - array[8] = 0; - array[9] = 0; - array[10] = 1; - array[11] = 0; - array[12] = 0; - array[13] = 0; - array[14] = 0; - array[15] = 1; -}; - -module.exports = SetIdentity; - - -/***/ }), -/* 1365 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Scales the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.Scale - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Scale = function (model, x, y, z) -{ - var modelMatrix = model.modelMatrix; - - modelMatrix[0] = modelMatrix[0] * x; - modelMatrix[1] = modelMatrix[1] * x; - modelMatrix[2] = modelMatrix[2] * x; - modelMatrix[3] = modelMatrix[3] * x; - modelMatrix[4] = modelMatrix[4] * y; - modelMatrix[5] = modelMatrix[5] * y; - modelMatrix[6] = modelMatrix[6] * y; - modelMatrix[7] = modelMatrix[7] * y; - modelMatrix[8] = modelMatrix[8] * z; - modelMatrix[9] = modelMatrix[9] * z; - modelMatrix[10] = modelMatrix[10] * z; - modelMatrix[11] = modelMatrix[11] * z; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Scale; - - -/***/ }), -/* 1366 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Translates the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.Translate - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Translate = function (model, x, y, z) -{ - var modelMatrix = model.modelMatrix; - - modelMatrix[12] = modelMatrix[0] * x + modelMatrix[4] * y + modelMatrix[8] * z + modelMatrix[12]; - modelMatrix[13] = modelMatrix[1] * x + modelMatrix[5] * y + modelMatrix[9] * z + modelMatrix[13]; - modelMatrix[14] = modelMatrix[2] * x + modelMatrix[6] * y + modelMatrix[10] * z + modelMatrix[14]; - modelMatrix[15] = modelMatrix[3] * x + modelMatrix[7] * y + modelMatrix[11] * z + modelMatrix[15]; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Translate; - - -/***/ }), -/* 1367 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ViewLoad2D - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {Float32Array} matrix2D - The Matrix2D. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewLoad2D = function (model, matrix2D) -{ - var vm = model.viewMatrix; - - vm[0] = matrix2D[0]; - vm[1] = matrix2D[1]; - vm[2] = 0; - vm[3] = 0; - vm[4] = matrix2D[2]; - vm[5] = matrix2D[3]; - vm[6] = 0; - vm[7] = 0; - vm[8] = matrix2D[4]; - vm[9] = matrix2D[5]; - vm[10] = 1; - vm[11] = 0; - vm[12] = 0; - vm[13] = 0; - vm[14] = 0; - vm[15] = 1; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewLoad2D; - - -/***/ }), -/* 1368 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderCanvas - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) -{ - src.cull(camera); - - var renderTiles = src.culledTiles; - var tileCount = renderTiles.length; - - if (tileCount === 0) - { - return; - } - - var camMatrix = renderer._tempMatrix1; - var layerMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; - - layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - var ctx = renderer.currentContext; - var gidMap = src.gidMap; - - ctx.save(); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - layerMatrix.e = src.x; - layerMatrix.f = src.y; - - camMatrix.multiply(layerMatrix, calcMatrix); - - calcMatrix.copyToContext(ctx); - } - else - { - // Undo the camera scroll - layerMatrix.e -= camera.scrollX * src.scrollFactorX; - layerMatrix.f -= camera.scrollY * src.scrollFactorY; - - layerMatrix.copyToContext(ctx); - } - - var alpha = camera.alpha * src.alpha; - - if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1) - { - ctx.imageSmoothingEnabled = false; - } - - for (var i = 0; i < tileCount; i++) - { - var tile = renderTiles[i]; - - var tileset = gidMap[tile.index]; - - if (!tileset) - { - continue; - } - - var image = tileset.image.getSourceImage(); - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - - if (tileTexCoords) - { - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - var halfWidth = tileWidth / 2; - var halfHeight = tileHeight / 2; - ctx.save(); ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); @@ -190670,22 +201033,22 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPer { ctx.rotate(tile.rotation); } - + if (tile.flipX || tile.flipY) { ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); } ctx.globalAlpha = alpha * tile.alpha; - + ctx.drawImage( image, tileTexCoords.x, tileTexCoords.y, - tileWidth, tileHeight, + tileset.tileWidth , tileset.Height, -halfWidth, -halfHeight, - tileWidth, tileHeight + tileset.tileWidth , tileset.tileHeight ); - + ctx.restore(); } } @@ -190693,11 +201056,11 @@ var StaticTilemapLayerCanvasRenderer = function (renderer, src, interpolationPer ctx.restore(); }; -module.exports = StaticTilemapLayerCanvasRenderer; +module.exports = TilemapLayerCanvasRenderer; /***/ }), -/* 1369 */ +/* 1431 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -190706,8 +201069,8 @@ module.exports = StaticTilemapLayerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GameObjectCreator = __webpack_require__(16); -var ParseToTilemap = __webpack_require__(240); +var GameObjectCreator = __webpack_require__(17); +var ParseToTilemap = __webpack_require__(253); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -190741,7 +201104,7 @@ GameObjectCreator.register('tilemap', function (config) /***/ }), -/* 1370 */ +/* 1432 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -190751,7 +201114,7 @@ GameObjectCreator.register('tilemap', function (config) */ var GameObjectFactory = __webpack_require__(5); -var ParseToTilemap = __webpack_require__(240); +var ParseToTilemap = __webpack_require__(253); /** * Creates a Tilemap from the given key or data, or creates a blank Tilemap if no key/data provided. @@ -190763,15 +201126,15 @@ var ParseToTilemap = __webpack_require__(240); * @since 3.0.0 * * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param {integer} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the + * @param {number} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the * default. - * @param {integer} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the + * @param {number} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the * default. - * @param {integer} [width=10] - The width of the map in tiles. Pass in `null` to leave as the + * @param {number} [width=10] - The width of the map in tiles. Pass in `null` to leave as the * default. - * @param {integer} [height=10] - The height of the map in tiles. Pass in `null` to leave as the + * @param {number} [height=10] - The height of the map in tiles. Pass in `null` to leave as the * default. - * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * @param {number[][]} [data] - Instead of loading from the cache, you can also load directly from * a 2D array of tile indexes. Pass in `null` for no data. * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty @@ -190807,7 +201170,7 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt /***/ }), -/* 1371 */ +/* 1433 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -190822,14 +201185,14 @@ GameObjectFactory.register('tilemap', function (key, tileWidth, tileHeight, widt module.exports = { - Clock: __webpack_require__(1372), - TimerEvent: __webpack_require__(525) + Clock: __webpack_require__(1434), + TimerEvent: __webpack_require__(561) }; /***/ }), -/* 1372 */ +/* 1434 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -190839,10 +201202,10 @@ module.exports = { */ var Class = __webpack_require__(0); -var PluginCache = __webpack_require__(23); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); -var TimerEvent = __webpack_require__(525); -var Remove = __webpack_require__(96); +var TimerEvent = __webpack_require__(561); +var Remove = __webpack_require__(87); /** * @classdesc @@ -191004,7 +201367,7 @@ var Clock = new Class({ { var event; - if (config instanceof Phaser.Time.TimerEvent) + if (config instanceof TimerEvent) { event = config; @@ -191285,7 +201648,7 @@ module.exports = Clock; /***/ }), -/* 1373 */ +/* 1435 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191294,8 +201657,8 @@ module.exports = Clock; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(91); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(96); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Tweens @@ -191303,13 +201666,13 @@ var Extend = __webpack_require__(19); var Tweens = { - Builders: __webpack_require__(1374), - Events: __webpack_require__(245), + Builders: __webpack_require__(1436), + Events: __webpack_require__(258), - TweenManager: __webpack_require__(1390), - Tween: __webpack_require__(244), - TweenData: __webpack_require__(246), - Timeline: __webpack_require__(531) + TweenManager: __webpack_require__(1452), + Tween: __webpack_require__(257), + TweenData: __webpack_require__(259), + Timeline: __webpack_require__(567) }; @@ -191320,7 +201683,7 @@ module.exports = Tweens; /***/ }), -/* 1374 */ +/* 1436 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191335,23 +201698,23 @@ module.exports = Tweens; module.exports = { - GetBoolean: __webpack_require__(90), - GetEaseFunction: __webpack_require__(71), + GetBoolean: __webpack_require__(95), + GetEaseFunction: __webpack_require__(78), GetNewValue: __webpack_require__(155), - GetProps: __webpack_require__(526), - GetTargets: __webpack_require__(241), - GetTweens: __webpack_require__(527), - GetValueOp: __webpack_require__(242), - NumberTweenBuilder: __webpack_require__(528), - StaggerBuilder: __webpack_require__(529), - TimelineBuilder: __webpack_require__(530), + GetProps: __webpack_require__(562), + GetTargets: __webpack_require__(254), + GetTweens: __webpack_require__(563), + GetValueOp: __webpack_require__(255), + NumberTweenBuilder: __webpack_require__(564), + StaggerBuilder: __webpack_require__(565), + TimelineBuilder: __webpack_require__(566), TweenBuilder: __webpack_require__(156) }; /***/ }), -/* 1375 */ +/* 1437 */ /***/ (function(module, exports) { /** @@ -191429,7 +201792,7 @@ module.exports = [ /***/ }), -/* 1376 */ +/* 1438 */ /***/ (function(module, exports) { /** @@ -191465,7 +201828,7 @@ module.exports = 'complete'; /***/ }), -/* 1377 */ +/* 1439 */ /***/ (function(module, exports) { /** @@ -191502,7 +201865,7 @@ module.exports = 'loop'; /***/ }), -/* 1378 */ +/* 1440 */ /***/ (function(module, exports) { /** @@ -191539,7 +201902,7 @@ module.exports = 'pause'; /***/ }), -/* 1379 */ +/* 1441 */ /***/ (function(module, exports) { /** @@ -191576,7 +201939,7 @@ module.exports = 'resume'; /***/ }), -/* 1380 */ +/* 1442 */ /***/ (function(module, exports) { /** @@ -191612,7 +201975,7 @@ module.exports = 'start'; /***/ }), -/* 1381 */ +/* 1443 */ /***/ (function(module, exports) { /** @@ -191649,7 +202012,7 @@ module.exports = 'update'; /***/ }), -/* 1382 */ +/* 1444 */ /***/ (function(module, exports) { /** @@ -191689,7 +202052,7 @@ module.exports = 'active'; /***/ }), -/* 1383 */ +/* 1445 */ /***/ (function(module, exports) { /** @@ -191730,7 +202093,7 @@ module.exports = 'complete'; /***/ }), -/* 1384 */ +/* 1446 */ /***/ (function(module, exports) { /** @@ -191774,7 +202137,7 @@ module.exports = 'loop'; /***/ }), -/* 1385 */ +/* 1447 */ /***/ (function(module, exports) { /** @@ -191819,7 +202182,7 @@ module.exports = 'repeat'; /***/ }), -/* 1386 */ +/* 1448 */ /***/ (function(module, exports) { /** @@ -191859,7 +202222,7 @@ module.exports = 'start'; /***/ }), -/* 1387 */ +/* 1449 */ /***/ (function(module, exports) { /** @@ -191895,7 +202258,7 @@ module.exports = 'stop'; /***/ }), -/* 1388 */ +/* 1450 */ /***/ (function(module, exports) { /** @@ -191938,7 +202301,7 @@ module.exports = 'update'; /***/ }), -/* 1389 */ +/* 1451 */ /***/ (function(module, exports) { /** @@ -191984,7 +202347,7 @@ module.exports = 'yoyo'; /***/ }), -/* 1390 */ +/* 1452 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -191993,14 +202356,14 @@ module.exports = 'yoyo'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayRemove = __webpack_require__(96); +var ArrayRemove = __webpack_require__(87); var Class = __webpack_require__(0); -var NumberTweenBuilder = __webpack_require__(528); -var PluginCache = __webpack_require__(23); +var NumberTweenBuilder = __webpack_require__(564); +var PluginCache = __webpack_require__(25); var SceneEvents = __webpack_require__(20); -var StaggerBuilder = __webpack_require__(529); -var TimelineBuilder = __webpack_require__(530); -var TWEEN_CONST = __webpack_require__(91); +var StaggerBuilder = __webpack_require__(565); +var TimelineBuilder = __webpack_require__(566); +var TWEEN_CONST = __webpack_require__(96); var TweenBuilder = __webpack_require__(156); /** @@ -192094,7 +202457,7 @@ var TweenManager = new Class({ * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame. * * @name Phaser.Tweens.TweenManager#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -192773,7 +203136,7 @@ module.exports = TweenManager; /***/ }), -/* 1391 */ +/* 1453 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -192788,17 +203151,17 @@ module.exports = TweenManager; module.exports = { - Array: __webpack_require__(194), - Base64: __webpack_require__(1392), - Objects: __webpack_require__(1394), - String: __webpack_require__(1398), + Array: __webpack_require__(199), + Base64: __webpack_require__(1454), + Objects: __webpack_require__(1456), + String: __webpack_require__(1460), NOOP: __webpack_require__(1) }; /***/ }), -/* 1392 */ +/* 1454 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -192813,14 +203176,14 @@ module.exports = { module.exports = { - ArrayBufferToBase64: __webpack_require__(1393), - Base64ToArrayBuffer: __webpack_require__(400) + ArrayBufferToBase64: __webpack_require__(1455), + Base64ToArrayBuffer: __webpack_require__(410) }; /***/ }), -/* 1393 */ +/* 1455 */ /***/ (function(module, exports) { /** @@ -192878,7 +203241,7 @@ module.exports = ArrayBufferToBase64; /***/ }), -/* 1394 */ +/* 1456 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -192893,26 +203256,27 @@ module.exports = ArrayBufferToBase64; module.exports = { - Clone: __webpack_require__(69), - Extend: __webpack_require__(19), + Clone: __webpack_require__(76), + DeepCopy: __webpack_require__(167), + Extend: __webpack_require__(18), GetAdvancedValue: __webpack_require__(15), GetFastValue: __webpack_require__(2), - GetMinMaxValue: __webpack_require__(1395), + GetMinMaxValue: __webpack_require__(1457), GetValue: __webpack_require__(6), - HasAll: __webpack_require__(1396), - HasAny: __webpack_require__(422), - HasValue: __webpack_require__(115), + HasAll: __webpack_require__(1458), + HasAny: __webpack_require__(432), + HasValue: __webpack_require__(123), IsPlainObject: __webpack_require__(7), - Merge: __webpack_require__(134), - MergeRight: __webpack_require__(1397), - Pick: __webpack_require__(514), - SetValue: __webpack_require__(445) + Merge: __webpack_require__(140), + MergeRight: __webpack_require__(1459), + Pick: __webpack_require__(550), + SetValue: __webpack_require__(455) }; /***/ }), -/* 1395 */ +/* 1457 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -192922,7 +203286,7 @@ module.exports = { */ var GetValue = __webpack_require__(6); -var Clamp = __webpack_require__(17); +var Clamp = __webpack_require__(16); /** * Retrieves and clamps a numerical value from an object. @@ -192951,7 +203315,7 @@ module.exports = GetMinMaxValue; /***/ }), -/* 1396 */ +/* 1458 */ /***/ (function(module, exports) { /** @@ -192988,7 +203352,7 @@ module.exports = HasAll; /***/ }), -/* 1397 */ +/* 1459 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -192997,7 +203361,7 @@ module.exports = HasAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clone = __webpack_require__(69); +var Clone = __webpack_require__(76); /** * Creates a new Object using all values from obj1. @@ -193031,7 +203395,7 @@ module.exports = MergeRight; /***/ }), -/* 1398 */ +/* 1460 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -193046,18 +203410,18 @@ module.exports = MergeRight; module.exports = { - Format: __webpack_require__(1399), - Pad: __webpack_require__(173), - RemoveAt: __webpack_require__(1400), - Reverse: __webpack_require__(1401), - UppercaseFirst: __webpack_require__(191), - UUID: __webpack_require__(207) + Format: __webpack_require__(1461), + Pad: __webpack_require__(178), + RemoveAt: __webpack_require__(1462), + Reverse: __webpack_require__(1463), + UppercaseFirst: __webpack_require__(196), + UUID: __webpack_require__(213) }; /***/ }), -/* 1399 */ +/* 1461 */ /***/ (function(module, exports) { /** @@ -193092,7 +203456,7 @@ module.exports = Format; /***/ }), -/* 1400 */ +/* 1462 */ /***/ (function(module, exports) { /** @@ -193128,7 +203492,7 @@ module.exports = RemoveAt; /***/ }), -/* 1401 */ +/* 1463 */ /***/ (function(module, exports) { /** @@ -193157,7 +203521,7 @@ module.exports = Reverse; /***/ }), -/* 1402 */ +/* 1464 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -193173,27 +203537,27 @@ module.exports = Reverse; module.exports = { - SoundManagerCreator: __webpack_require__(393), + SoundManagerCreator: __webpack_require__(403), - Events: __webpack_require__(61), + Events: __webpack_require__(66), - BaseSound: __webpack_require__(136), - BaseSoundManager: __webpack_require__(135), + BaseSound: __webpack_require__(142), + BaseSoundManager: __webpack_require__(141), - WebAudioSound: __webpack_require__(401), - WebAudioSoundManager: __webpack_require__(399), + WebAudioSound: __webpack_require__(411), + WebAudioSoundManager: __webpack_require__(409), - HTML5AudioSound: __webpack_require__(396), - HTML5AudioSoundManager: __webpack_require__(394), + HTML5AudioSound: __webpack_require__(406), + HTML5AudioSoundManager: __webpack_require__(404), - NoAudioSound: __webpack_require__(398), - NoAudioSoundManager: __webpack_require__(397) + NoAudioSound: __webpack_require__(408), + NoAudioSoundManager: __webpack_require__(407) }; /***/ }), -/* 1403 */ +/* 1465 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -193599,7 +203963,7 @@ module.exports = BodyBounds; /***/ }), -/* 1404 */ +/* 1466 */ /***/ (function(module, exports) { /** @@ -194269,7 +204633,7 @@ function points_eq(a,b,precision){ /***/ }), -/* 1405 */ +/* 1467 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -194278,19 +204642,19 @@ function points_eq(a,b,precision){ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(116); +var Bodies = __webpack_require__(124); var Class = __webpack_require__(0); -var Composites = __webpack_require__(1308); -var Constraint = __webpack_require__(234); -var Svg = __webpack_require__(1309); -var MatterGameObject = __webpack_require__(1406); -var MatterImage = __webpack_require__(1407); -var MatterSprite = __webpack_require__(1408); -var MatterTileBody = __webpack_require__(1310); -var PhysicsEditorParser = __webpack_require__(1306); -var PhysicsJSONParser = __webpack_require__(1307); -var PointerConstraint = __webpack_require__(1409); -var Vertices = __webpack_require__(88); +var Composites = __webpack_require__(1374); +var Constraint = __webpack_require__(241); +var Svg = __webpack_require__(1375); +var MatterGameObject = __webpack_require__(1468); +var MatterImage = __webpack_require__(1469); +var MatterSprite = __webpack_require__(1470); +var MatterTileBody = __webpack_require__(1376); +var PhysicsEditorParser = __webpack_require__(1372); +var PhysicsJSONParser = __webpack_require__(1373); +var PointerConstraint = __webpack_require__(1471); +var Vertices = __webpack_require__(93); /** * @classdesc @@ -194654,7 +205018,7 @@ var Factory = new Class({ * @since 3.0.0 * * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} frame - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {(string|number)} frame - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {number} x - The horizontal position of this composite in the world. * @param {number} y - The vertical position of this composite in the world. * @param {number} columns - The number of columns in the grid. @@ -195086,7 +205450,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. * * @return {Phaser.Physics.Matter.Image} The Matter Image Game Object. @@ -195142,7 +205506,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. * * @return {Phaser.Physics.Matter.Sprite} The Matter Sprite Game Object. @@ -195173,7 +205537,7 @@ var Factory = new Class({ * @param {(Phaser.Types.Physics.Matter.MatterBodyConfig|MatterJS.Body)} [options] - A Matter Body configuration object, or an instance of a Matter Body. * @param {boolean} [addToWorld=true] - Add this Matter Body to the World? * - * @return {Phaser.Physics.Matter.MatterGameObject} The Game Object that had the Matter Components injected into it. + * @return {(Phaser.Physics.Matter.Image|Phaser.Physics.Matter.Sprite|Phaser.GameObjects.GameObject)} The Game Object that had the Matter Components injected into it. */ gameObject: function (gameObject, options, addToWorld) { @@ -195199,7 +205563,7 @@ module.exports = Factory; /***/ }), -/* 1406 */ +/* 1468 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -195208,7 +205572,7 @@ module.exports = Factory; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Components = __webpack_require__(500); +var Components = __webpack_require__(517); var GetFastValue = __webpack_require__(2); var Vector2 = __webpack_require__(3); @@ -195325,7 +205689,7 @@ module.exports = MatterGameObject; /***/ }), -/* 1407 */ +/* 1469 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -195335,11 +205699,11 @@ module.exports = MatterGameObject; */ var Class = __webpack_require__(0); -var Components = __webpack_require__(500); +var Components = __webpack_require__(517); var GameObject = __webpack_require__(14); var GetFastValue = __webpack_require__(2); -var Image = __webpack_require__(114); -var Pipeline = __webpack_require__(165); +var Image = __webpack_require__(122); +var Pipeline = __webpack_require__(166); var Vector2 = __webpack_require__(3); /** @@ -195387,7 +205751,7 @@ var Vector2 = __webpack_require__(3); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. */ var MatterImage = new Class({ @@ -195471,7 +205835,7 @@ module.exports = MatterImage; /***/ }), -/* 1408 */ +/* 1470 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -195482,11 +205846,11 @@ module.exports = MatterImage; var AnimationState = __webpack_require__(157); var Class = __webpack_require__(0); -var Components = __webpack_require__(500); +var Components = __webpack_require__(517); var GameObject = __webpack_require__(14); var GetFastValue = __webpack_require__(2); -var Pipeline = __webpack_require__(165); -var Sprite = __webpack_require__(76); +var Pipeline = __webpack_require__(166); +var Sprite = __webpack_require__(70); var Vector2 = __webpack_require__(3); /** @@ -195537,7 +205901,7 @@ var Vector2 = __webpack_require__(3); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. */ var MatterSprite = new Class({ @@ -195623,7 +205987,7 @@ module.exports = MatterSprite; /***/ }), -/* 1409 */ +/* 1471 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -195632,17 +205996,17 @@ module.exports = MatterSprite; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bounds = __webpack_require__(103); +var Bounds = __webpack_require__(115); var Class = __webpack_require__(0); -var Composite = __webpack_require__(158); -var Constraint = __webpack_require__(234); -var Detector = __webpack_require__(544); -var Events = __webpack_require__(543); -var InputEvents = __webpack_require__(56); -var Merge = __webpack_require__(134); -var Sleeping = __webpack_require__(250); +var Composite = __webpack_require__(159); +var Constraint = __webpack_require__(241); +var Detector = __webpack_require__(583); +var Events = __webpack_require__(582); +var InputEvents = __webpack_require__(49); +var Merge = __webpack_require__(140); +var Sleeping = __webpack_require__(265); var Vector2 = __webpack_require__(3); -var Vertices = __webpack_require__(88); +var Vertices = __webpack_require__(93); /** * @classdesc @@ -196011,7 +206375,7 @@ module.exports = PointerConstraint; /***/ }), -/* 1410 */ +/* 1472 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -196024,8 +206388,8 @@ var Matter = {}; module.exports = Matter; -var Plugin = __webpack_require__(1312); -var Common = __webpack_require__(44); +var Plugin = __webpack_require__(1378); +var Common = __webpack_require__(50); (function() { @@ -196103,7 +206467,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 1411 */ +/* 1473 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -196118,11 +206482,11 @@ var Query = {}; module.exports = Query; -var Vector = __webpack_require__(102); -var SAT = __webpack_require__(545); -var Bounds = __webpack_require__(103); -var Bodies = __webpack_require__(116); -var Vertices = __webpack_require__(88); +var Vector = __webpack_require__(114); +var SAT = __webpack_require__(584); +var Bounds = __webpack_require__(115); +var Bodies = __webpack_require__(124); +var Vertices = __webpack_require__(93); (function() { @@ -196245,7 +206609,7 @@ var Vertices = __webpack_require__(88); /***/ }), -/* 1412 */ +/* 1474 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -196262,17 +206626,17 @@ var Engine = {}; module.exports = Engine; -var World = __webpack_require__(1313); -var Sleeping = __webpack_require__(250); -var Resolver = __webpack_require__(1316); -var Pairs = __webpack_require__(1315); -var Metrics = __webpack_require__(1445); -var Grid = __webpack_require__(1314); -var Events = __webpack_require__(251); -var Composite = __webpack_require__(158); -var Constraint = __webpack_require__(234); -var Common = __webpack_require__(44); -var Body = __webpack_require__(64); +var World = __webpack_require__(1379); +var Sleeping = __webpack_require__(265); +var Resolver = __webpack_require__(1382); +var Pairs = __webpack_require__(1381); +var Metrics = __webpack_require__(1507); +var Grid = __webpack_require__(1380); +var Events = __webpack_require__(266); +var Composite = __webpack_require__(159); +var Constraint = __webpack_require__(241); +var Common = __webpack_require__(50); +var Body = __webpack_require__(68); (function() { @@ -196738,7 +207102,7 @@ var Body = __webpack_require__(64); /***/ }), -/* 1413 */ +/* 1475 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -196747,21 +207111,21 @@ var Body = __webpack_require__(64); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(116); -var Body = __webpack_require__(64); +var Bodies = __webpack_require__(124); +var Body = __webpack_require__(68); var Class = __webpack_require__(0); -var Common = __webpack_require__(44); -var Composite = __webpack_require__(158); -var Engine = __webpack_require__(1412); -var EventEmitter = __webpack_require__(12); -var Events = __webpack_require__(543); +var Common = __webpack_require__(50); +var Composite = __webpack_require__(159); +var Engine = __webpack_require__(1474); +var EventEmitter = __webpack_require__(10); +var Events = __webpack_require__(582); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); -var MatterBody = __webpack_require__(64); -var MatterEvents = __webpack_require__(251); -var MatterTileBody = __webpack_require__(1310); -var MatterWorld = __webpack_require__(1313); -var Vector = __webpack_require__(102); +var MatterBody = __webpack_require__(68); +var MatterEvents = __webpack_require__(266); +var MatterTileBody = __webpack_require__(1376); +var MatterWorld = __webpack_require__(1379); +var Vector = __webpack_require__(114); /** * @classdesc @@ -197723,8 +208087,7 @@ var World = new Class({ * @method Phaser.Physics.Matter.World#convertTilemapLayer * @since 3.0.0 * - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - - * An array of tiles. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - An array of tiles. * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody} * * @return {this} This Matter World object. @@ -198959,7 +209322,7 @@ module.exports = World; /***/ }), -/* 1414 */ +/* 1476 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {/** @@ -198968,10 +209331,10 @@ module.exports = World; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -__webpack_require__(547); +__webpack_require__(586); -var CONST = __webpack_require__(34); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(39); +var Extend = __webpack_require__(18); /** * @namespace Phaser @@ -198979,46 +209342,46 @@ var Extend = __webpack_require__(19); var Phaser = { - Actions: __webpack_require__(252), - Animations: __webpack_require__(651), - BlendModes: __webpack_require__(54), - Cache: __webpack_require__(663), - Cameras: __webpack_require__(666), - Core: __webpack_require__(754), + Actions: __webpack_require__(267), + Animations: __webpack_require__(691), + BlendModes: __webpack_require__(48), + Cache: __webpack_require__(703), + Cameras: __webpack_require__(706), + Core: __webpack_require__(795), Class: __webpack_require__(0), - Create: __webpack_require__(819), - Curves: __webpack_require__(825), - Data: __webpack_require__(827), - Display: __webpack_require__(829), - DOM: __webpack_require__(847), - Events: __webpack_require__(848), - Game: __webpack_require__(850), - GameObjects: __webpack_require__(940), - Geom: __webpack_require__(448), - Input: __webpack_require__(1224), - Loader: __webpack_require__(1257), - Math: __webpack_require__(180), - Physics: __webpack_require__(1415), - Plugins: __webpack_require__(1317), - Renderer: __webpack_require__(1450), - Scale: __webpack_require__(1319), - ScaleModes: __webpack_require__(247), - Scene: __webpack_require__(385), - Scenes: __webpack_require__(1320), - Structs: __webpack_require__(1322), - Textures: __webpack_require__(1323), - Tilemaps: __webpack_require__(1325), - Time: __webpack_require__(1371), - Tweens: __webpack_require__(1373), - Utils: __webpack_require__(1391) + Create: __webpack_require__(874), + Curves: __webpack_require__(880), + Data: __webpack_require__(882), + Display: __webpack_require__(884), + DOM: __webpack_require__(903), + Events: __webpack_require__(904), + Game: __webpack_require__(906), + GameObjects: __webpack_require__(996), + Geom: __webpack_require__(460), + Input: __webpack_require__(1288), + Loader: __webpack_require__(1318), + Math: __webpack_require__(185), + Physics: __webpack_require__(1477), + Plugins: __webpack_require__(1383), + Renderer: __webpack_require__(1512), + Scale: __webpack_require__(1385), + ScaleModes: __webpack_require__(260), + Scene: __webpack_require__(395), + Scenes: __webpack_require__(1386), + Structs: __webpack_require__(1388), + Textures: __webpack_require__(1389), + Tilemaps: __webpack_require__(1391), + Time: __webpack_require__(1433), + Tweens: __webpack_require__(1435), + Utils: __webpack_require__(1453) }; -// Merge in the optional plugins +// Merge in the optional plugins and WebGL only features if (true) { - Phaser.Sound = __webpack_require__(1402); + Phaser.Sound = __webpack_require__(1464); } if (false) @@ -199050,10 +209413,10 @@ global.Phaser = Phaser; * -- Dick Brandon */ -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(546))) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(585))) /***/ }), -/* 1415 */ +/* 1477 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -199072,14 +209435,14 @@ global.Phaser = Phaser; module.exports = { - Arcade: __webpack_require__(1283), - Matter: __webpack_require__(1416) + Arcade: __webpack_require__(1346), + Matter: __webpack_require__(1478) }; /***/ }), -/* 1416 */ +/* 1478 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -199094,27 +209457,27 @@ module.exports = { module.exports = { - BodyBounds: __webpack_require__(1403), - Components: __webpack_require__(500), - Events: __webpack_require__(543), - Factory: __webpack_require__(1405), - MatterGameObject: __webpack_require__(1406), - Image: __webpack_require__(1407), - Matter: __webpack_require__(1311), - MatterPhysics: __webpack_require__(1446), - PolyDecomp: __webpack_require__(1404), - Sprite: __webpack_require__(1408), - TileBody: __webpack_require__(1310), - PhysicsEditorParser: __webpack_require__(1306), - PhysicsJSONParser: __webpack_require__(1307), - PointerConstraint: __webpack_require__(1409), - World: __webpack_require__(1413) + BodyBounds: __webpack_require__(1465), + Components: __webpack_require__(517), + Events: __webpack_require__(582), + Factory: __webpack_require__(1467), + MatterGameObject: __webpack_require__(1468), + Image: __webpack_require__(1469), + Matter: __webpack_require__(1377), + MatterPhysics: __webpack_require__(1508), + PolyDecomp: __webpack_require__(1466), + Sprite: __webpack_require__(1470), + TileBody: __webpack_require__(1376), + PhysicsEditorParser: __webpack_require__(1372), + PhysicsJSONParser: __webpack_require__(1373), + PointerConstraint: __webpack_require__(1471), + World: __webpack_require__(1475) }; /***/ }), -/* 1417 */ +/* 1479 */ /***/ (function(module, exports) { /** @@ -199154,7 +209517,7 @@ module.exports = Bounce; /***/ }), -/* 1418 */ +/* 1480 */ /***/ (function(module, exports) { /** @@ -199340,7 +209703,7 @@ module.exports = Collision; /***/ }), -/* 1419 */ +/* 1481 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -199349,7 +209712,7 @@ module.exports = Collision; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(64); +var Body = __webpack_require__(68); /** * A component to apply force to Matter.js bodies. @@ -199496,7 +209859,7 @@ module.exports = Force; /***/ }), -/* 1420 */ +/* 1482 */ /***/ (function(module, exports) { /** @@ -199586,7 +209949,7 @@ module.exports = Friction; /***/ }), -/* 1421 */ +/* 1483 */ /***/ (function(module, exports) { /** @@ -199626,7 +209989,7 @@ module.exports = Gravity; /***/ }), -/* 1422 */ +/* 1484 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -199635,7 +209998,7 @@ module.exports = Gravity; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(64); +var Body = __webpack_require__(68); var Vector2 = __webpack_require__(3); /** @@ -199708,7 +210071,7 @@ module.exports = Mass; /***/ }), -/* 1423 */ +/* 1485 */ /***/ (function(module, exports) { /** @@ -199762,7 +210125,7 @@ module.exports = Sensor; /***/ }), -/* 1424 */ +/* 1486 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -199771,13 +210134,13 @@ module.exports = Sensor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bodies = __webpack_require__(116); -var Body = __webpack_require__(64); -var FuzzyEquals = __webpack_require__(109); +var Bodies = __webpack_require__(124); +var Body = __webpack_require__(68); +var FuzzyEquals = __webpack_require__(121); var GetFastValue = __webpack_require__(2); -var PhysicsEditorParser = __webpack_require__(1306); -var PhysicsJSONParser = __webpack_require__(1307); -var Vertices = __webpack_require__(88); +var PhysicsEditorParser = __webpack_require__(1372); +var PhysicsJSONParser = __webpack_require__(1373); +var Vertices = __webpack_require__(93); /** * Enables a Matter-enabled Game Object to set its Body. Should be used as a mixin and not directly. @@ -200052,7 +210415,7 @@ module.exports = SetBody; /***/ }), -/* 1425 */ +/* 1487 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -200061,9 +210424,9 @@ module.exports = SetBody; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Events = __webpack_require__(543); -var Sleeping = __webpack_require__(250); -var MatterEvents = __webpack_require__(251); +var Events = __webpack_require__(582); +var Sleeping = __webpack_require__(265); +var MatterEvents = __webpack_require__(266); /** * Enables a Matter-enabled Game Object to be able to go to sleep. Should be used as a mixin and not directly. @@ -200206,7 +210569,7 @@ module.exports = Sleep; /***/ }), -/* 1426 */ +/* 1488 */ /***/ (function(module, exports) { /** @@ -200240,7 +210603,7 @@ module.exports = 'afteradd'; /***/ }), -/* 1427 */ +/* 1489 */ /***/ (function(module, exports) { /** @@ -200274,7 +210637,7 @@ module.exports = 'afterremove'; /***/ }), -/* 1428 */ +/* 1490 */ /***/ (function(module, exports) { /** @@ -200307,7 +210670,7 @@ module.exports = 'afterupdate'; /***/ }), -/* 1429 */ +/* 1491 */ /***/ (function(module, exports) { /** @@ -200341,7 +210704,7 @@ module.exports = 'beforeadd'; /***/ }), -/* 1430 */ +/* 1492 */ /***/ (function(module, exports) { /** @@ -200375,7 +210738,7 @@ module.exports = 'beforeremove'; /***/ }), -/* 1431 */ +/* 1493 */ /***/ (function(module, exports) { /** @@ -200408,7 +210771,7 @@ module.exports = 'beforeupdate'; /***/ }), -/* 1432 */ +/* 1494 */ /***/ (function(module, exports) { /** @@ -200445,7 +210808,7 @@ module.exports = 'collisionactive'; /***/ }), -/* 1433 */ +/* 1495 */ /***/ (function(module, exports) { /** @@ -200482,7 +210845,7 @@ module.exports = 'collisionend'; /***/ }), -/* 1434 */ +/* 1496 */ /***/ (function(module, exports) { /** @@ -200519,7 +210882,7 @@ module.exports = 'collisionstart'; /***/ }), -/* 1435 */ +/* 1497 */ /***/ (function(module, exports) { /** @@ -200546,7 +210909,7 @@ module.exports = 'dragend'; /***/ }), -/* 1436 */ +/* 1498 */ /***/ (function(module, exports) { /** @@ -200573,7 +210936,7 @@ module.exports = 'drag'; /***/ }), -/* 1437 */ +/* 1499 */ /***/ (function(module, exports) { /** @@ -200601,7 +210964,7 @@ module.exports = 'dragstart'; /***/ }), -/* 1438 */ +/* 1500 */ /***/ (function(module, exports) { /** @@ -200624,7 +210987,7 @@ module.exports = 'pause'; /***/ }), -/* 1439 */ +/* 1501 */ /***/ (function(module, exports) { /** @@ -200647,7 +211010,7 @@ module.exports = 'resume'; /***/ }), -/* 1440 */ +/* 1502 */ /***/ (function(module, exports) { /** @@ -200680,7 +211043,7 @@ module.exports = 'sleepend'; /***/ }), -/* 1441 */ +/* 1503 */ /***/ (function(module, exports) { /** @@ -200713,7 +211076,7 @@ module.exports = 'sleepstart'; /***/ }), -/* 1442 */ +/* 1504 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -200722,7 +211085,7 @@ module.exports = 'sleepstart'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(64); +var Body = __webpack_require__(68); /** * Provides methods used for getting and setting the static state of a physics body. @@ -200768,7 +211131,7 @@ module.exports = Static; /***/ }), -/* 1443 */ +/* 1505 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -200777,10 +211140,10 @@ module.exports = Static; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(64); +var Body = __webpack_require__(68); var MATH_CONST = __webpack_require__(13); -var WrapAngle = __webpack_require__(248); -var WrapAngleDegrees = __webpack_require__(249); +var WrapAngle = __webpack_require__(261); +var WrapAngleDegrees = __webpack_require__(262); // global bitmask flag for GameObject.renderMask (used by Scale) var _FLAG = 4; // 0100 @@ -201083,7 +211446,7 @@ module.exports = Transform; /***/ }), -/* 1444 */ +/* 1506 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -201092,7 +211455,7 @@ module.exports = Transform; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Body = __webpack_require__(64); +var Body = __webpack_require__(68); /** * Contains methods for changing the velocity of a Matter Body. Should be used as a mixin and not called directly. @@ -201184,7 +211547,7 @@ module.exports = Velocity; /***/ }), -/* 1445 */ +/* 1507 */ /***/ (function(module, exports, __webpack_require__) { // @if DEBUG @@ -201197,8 +211560,8 @@ var Metrics = {}; module.exports = Metrics; -var Composite = __webpack_require__(158); -var Common = __webpack_require__(44); +var Composite = __webpack_require__(159); +var Common = __webpack_require__(50); (function() { @@ -201283,7 +211646,7 @@ var Common = __webpack_require__(44); /***/ }), -/* 1446 */ +/* 1508 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -201292,39 +211655,39 @@ var Common = __webpack_require__(44); * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ALIGN_CONST = __webpack_require__(108); -var Axes = __webpack_require__(542); -var Bodies = __webpack_require__(116); -var Body = __webpack_require__(64); -var BodyBounds = __webpack_require__(1403); -var Bounds = __webpack_require__(103); +var ALIGN_CONST = __webpack_require__(120); +var Axes = __webpack_require__(581); +var Bodies = __webpack_require__(124); +var Body = __webpack_require__(68); +var BodyBounds = __webpack_require__(1465); +var Bounds = __webpack_require__(115); var Class = __webpack_require__(0); -var Composite = __webpack_require__(158); -var Composites = __webpack_require__(1308); -var Constraint = __webpack_require__(234); -var Detector = __webpack_require__(544); -var DistanceBetween = __webpack_require__(55); -var Factory = __webpack_require__(1405); +var Composite = __webpack_require__(159); +var Composites = __webpack_require__(1374); +var Constraint = __webpack_require__(241); +var Detector = __webpack_require__(583); +var DistanceBetween = __webpack_require__(61); +var Factory = __webpack_require__(1467); var GetFastValue = __webpack_require__(2); var GetValue = __webpack_require__(6); -var Grid = __webpack_require__(1314); -var MatterAttractors = __webpack_require__(1447); -var MatterCollisionEvents = __webpack_require__(1448); -var MatterLib = __webpack_require__(1410); -var MatterWrap = __webpack_require__(1449); -var Merge = __webpack_require__(134); -var Pair = __webpack_require__(501); -var Pairs = __webpack_require__(1315); -var Plugin = __webpack_require__(1312); -var PluginCache = __webpack_require__(23); -var Query = __webpack_require__(1411); -var Resolver = __webpack_require__(1316); -var SAT = __webpack_require__(545); +var Grid = __webpack_require__(1380); +var MatterAttractors = __webpack_require__(1509); +var MatterCollisionEvents = __webpack_require__(1510); +var MatterLib = __webpack_require__(1472); +var MatterWrap = __webpack_require__(1511); +var Merge = __webpack_require__(140); +var Pair = __webpack_require__(518); +var Pairs = __webpack_require__(1381); +var Plugin = __webpack_require__(1378); +var PluginCache = __webpack_require__(25); +var Query = __webpack_require__(1473); +var Resolver = __webpack_require__(1382); +var SAT = __webpack_require__(584); var SceneEvents = __webpack_require__(20); -var Svg = __webpack_require__(1309); -var Vector = __webpack_require__(102); -var Vertices = __webpack_require__(88); -var World = __webpack_require__(1413); +var Svg = __webpack_require__(1375); +var Vector = __webpack_require__(114); +var Vertices = __webpack_require__(93); +var World = __webpack_require__(1475); /** * @classdesc @@ -202631,7 +212994,7 @@ var MatterPhysics = new Class({ * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to align. * @param {number} x - The horizontal position to align the body to. * @param {number} y - The vertical position to align the body to. - * @param {integer} align - One of the `Phaser.Display.Align` constants, such as `Phaser.Display.Align.TOP_LEFT`. + * @param {number} align - One of the `Phaser.Display.Align` constants, such as `Phaser.Display.Align.TOP_LEFT`. * * @return {this} This Matter Physics instance. */ @@ -202752,10 +213115,10 @@ module.exports = MatterPhysics; /***/ }), -/* 1447 */ +/* 1509 */ /***/ (function(module, exports, __webpack_require__) { -var Matter = __webpack_require__(1311); +var Matter = __webpack_require__(1377); /** * An attractors plugin for matter.js. @@ -202911,7 +213274,7 @@ module.exports = MatterAttractors; /***/ }), -/* 1448 */ +/* 1510 */ /***/ (function(module, exports) { /** @@ -203044,10 +213407,10 @@ module.exports = MatterCollisionEvents; /***/ }), -/* 1449 */ +/* 1511 */ /***/ (function(module, exports, __webpack_require__) { -var Matter = __webpack_require__(1311); +var Matter = __webpack_require__(1377); /** * A coordinate wrapping plugin for matter.js. @@ -203226,7 +213589,7 @@ module.exports = MatterWrap; */ /***/ }), -/* 1450 */ +/* 1512 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -203245,15 +213608,15 @@ module.exports = MatterWrap; module.exports = { - Canvas: __webpack_require__(1451), - Snapshot: __webpack_require__(1452), - WebGL: __webpack_require__(1453) + Canvas: __webpack_require__(1513), + Snapshot: __webpack_require__(1514), + WebGL: __webpack_require__(1515) }; /***/ }), -/* 1451 */ +/* 1513 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -203268,15 +213631,15 @@ module.exports = { module.exports = { - CanvasRenderer: __webpack_require__(532), - GetBlendModes: __webpack_require__(534), - SetTransform: __webpack_require__(28) + CanvasRenderer: __webpack_require__(568), + GetBlendModes: __webpack_require__(570), + SetTransform: __webpack_require__(30) }; /***/ }), -/* 1452 */ +/* 1514 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -203291,14 +213654,14 @@ module.exports = { module.exports = { - Canvas: __webpack_require__(533), - WebGL: __webpack_require__(541) + Canvas: __webpack_require__(569), + WebGL: __webpack_require__(580) }; /***/ }), -/* 1453 */ +/* 1515 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -203307,23 +213670,36 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var WEBGL_CONST = __webpack_require__(74); +var Extend = __webpack_require__(18); + /** * @namespace Phaser.Renderer.WebGL */ -module.exports = { +var WebGL = { - PipelineManager: __webpack_require__(536), - Pipelines: __webpack_require__(1454), - Utils: __webpack_require__(10), - WebGLPipeline: __webpack_require__(111), - WebGLRenderer: __webpack_require__(535) + PipelineManager: __webpack_require__(572), + Pipelines: __webpack_require__(1516), + RenderTarget: __webpack_require__(263), + Utils: __webpack_require__(12), + WebGLPipeline: __webpack_require__(75), + WebGLRenderer: __webpack_require__(571), + WebGLShader: __webpack_require__(574) }; +// Merge in the consts + +WebGL = Extend(false, WebGL, WEBGL_CONST); + +// Export it + +module.exports = WebGL; + /***/ }), -/* 1454 */ +/* 1516 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -203332,8 +213708,8 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(110); -var Extend = __webpack_require__(19); +var CONST = __webpack_require__(82); +var Extend = __webpack_require__(18); /** * @namespace Phaser.Renderer.WebGL.Pipelines @@ -203341,12 +213717,13 @@ var Extend = __webpack_require__(19); var Pipelines = { - BitmapMaskPipeline: __webpack_require__(537), - LightPipeline: __webpack_require__(538), - SinglePipeline: __webpack_require__(540), - MultiPipeline: __webpack_require__(112), - RopePipeline: __webpack_require__(539), - ModelViewProjection: __webpack_require__(113) + BitmapMaskPipeline: __webpack_require__(573), + GraphicsPipeline: __webpack_require__(575), + LightPipeline: __webpack_require__(576), + MultiPipeline: __webpack_require__(158), + PostFXPipeline: __webpack_require__(1517), + RopePipeline: __webpack_require__(577), + SinglePipeline: __webpack_require__(578) }; @@ -203359,6 +213736,404 @@ Pipelines = Extend(false, Pipelines, CONST); module.exports = Pipelines; +/***/ }), +/* 1517 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var ColorMatrix = __webpack_require__(264); +var GetFastValue = __webpack_require__(2); +var ShaderSourceFS = __webpack_require__(1518); +var ShaderSourceVS = __webpack_require__(579); +var WEBGL_CONST = __webpack_require__(74); +var WebGLPipeline = __webpack_require__(75); + +/** + * @classdesc + * TODO + * + * The fragment shader it uses can be found in `shaders/src/PostFX.frag`. + * The vertex shader it uses can be found in `shaders/src/PostFX.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * The default shader uniforms for this pipeline are: + * + * `uMainSampler` (sampler2D) + * + * @class PostFXPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var PostFXPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function PostFXPipeline (config) + { + config.renderTarget = GetFastValue(config, 'renderTarget', 1); + config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); + config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); + config.uniforms = GetFastValue(config, 'uniforms', [ + 'uMainSampler' + ]); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2, + type: WEBGL_CONST.FLOAT + }, + { + name: 'inTexCoord', + size: 2, + type: WEBGL_CONST.FLOAT + } + ]); + config.batchSize = 1; + config.vertices = new Float32Array([ + -1, -1, 0, 0, + -1, 1, 0, 1, + 1, 1, 1, 1, + -1, -1, 0, 0, + 1, 1, 1, 1, + 1, -1, 1, 0 + ]); + + WebGLPipeline.call(this, config); + + this.isPostFX = true; + + /** + * If this post-pipeline belongs to a Game Object or Camera, this contains a reference to it. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.50.0 + */ + this.gameObject; + + /** + * A Color Matrix instance belonging to this pipeline. + * + * Used during calls to the `drawFrame` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#colorMatrix + * @type {Phaser.Display.ColorMatrix} + * @since 3.50.0 + */ + this.colorMatrix = new ColorMatrix(); + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame2; + + if (this.renderer.isBooted) + { + this.manager = this.renderer.pipelines; + + this.boot(); + } + }, + + boot: function () + { + WebGLPipeline.prototype.boot.call(this); + + var utility = this.manager.UTILITY_PIPELINE; + + this.fullFrame1 = utility.fullFrame1; + this.fullFrame2 = utility.fullFrame2; + this.halfFrame1 = utility.halfFrame1; + this.halfFrame2 = utility.halfFrame2; + + this.set1i('uMainSampler', 0); + }, + + onDraw: function (renderTarget) + { + this.bindAndDraw(renderTarget); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + this.manager.copyFrame(source, target, brightness, clear, clearAlpha); + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + this.manager.copyToGame(source); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + drawFrame: function (source, target, clearAlpha) + { + this.manager.drawFrame(source, target, clearAlpha, this.colorMatrix); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + blendFrames: function (source1, source2, target, strength, clearAlpha) + { + this.manager.blendFrames(source1, source2, target, strength, clearAlpha); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + this.manager.blendFramesAdditive(source1, source2, target, strength, clearAlpha); + }, + + /** + * Binds this pipeline and draws the `source` Render Target to the `target` Render Target. + * + * If no `target` is specified, it will pop the framebuffer from the Renderers FBO stack + * and use that instead, which should be done when you need to draw the final results of + * this pipeline to the game canvas. + * + * You can optionally set the shader to be used for the draw here, if this is a multi-shader + * pipeline. By default `currentShader` will be used. If you need to set a shader but not + * a target, just pass `null` as the `target` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#bindAndDraw + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The Render Target to draw to. If not set, it will pop the fbo from the stack. + * @param {boolean} [clear=true] - Clear the target before copying? Only used if `target` parameter is set. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to use during the draw. + */ + bindAndDraw: function (source, target, clear, clearAlpha, currentShader) + { + if (clear === undefined) { clear = true; } + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + var renderer = this.renderer; + + this.bind(currentShader); + + this.set1i('uMainSampler', 0); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + + if (clear) + { + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + } + } + else + { + renderer.popFramebuffer(false, false, false); + + if (!renderer.currentFramebuffer) + { + gl.viewport(0, 0, renderer.width, renderer.height); + } + } + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + if (!target) + { + renderer.resetTextures(); + } + else + { + gl.bindTexture(gl.TEXTURE_2D, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + } + } + +}); + +module.exports = PostFXPipeline; + + +/***/ }), +/* 1518 */ +/***/ (function(module, exports) { + +module.exports = [ + '#define SHADER_NAME PHASER_POSTFX_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' gl_FragColor = texture2D(uMainSampler, outTexCoord);', + '}', + '' +].join('\n'); + + /***/ }) /******/ ]); }); \ No newline at end of file diff --git a/dist/phaser.min.js b/dist/phaser.min.js index 6cf9c1147..67edb2c43 100644 --- a/dist/phaser.min.js +++ b/dist/phaser.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return n={},s.m=i=[function(t,e){function r(t,e,i,n){for(var s in e)if(e.hasOwnProperty(s)){var r=(l=e,u=s,f=d=void 0,f=(c=i)?l[u]:Object.getOwnPropertyDescriptor(l,u),!c&&f.value&&"object"==typeof f.value&&(f=f.value),!(!f||!((d=f).get&&"function"==typeof d.get||d.set&&"function"==typeof d.set))&&(void 0===f.enumerable&&(f.enumerable=!0),void 0===f.configurable&&(f.configurable=!0),f));if(!1!==r){if(o=(n||t).prototype,a=s,h=void 0,(h=Object.getOwnPropertyDescriptor(o,a))&&(h.value&&"object"==typeof h.value&&(h=h.value),!1===h.configurable)){if(p.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,s,r)}else t.prototype[s]=e[s]}var o,a,h,l,u,c,d,f}function o(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;nr.width&&(i=Math.max(r.width-t,0)),e+n>r.height&&(n=Math.max(r.height-e,0));for(var l=[],u=e;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){var n=i(13);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){t.exports={DESTROY:i(671),FADE_IN_COMPLETE:i(672),FADE_IN_START:i(673),FADE_OUT_COMPLETE:i(674),FADE_OUT_START:i(675),FLASH_COMPLETE:i(676),FLASH_START:i(677),PAN_COMPLETE:i(678),PAN_START:i(679),POST_RENDER:i(680),PRE_RENDER:i(681),ROTATE_COMPLETE:i(682),ROTATE_START:i(683),SHAKE_COMPLETE:i(684),SHAKE_START:i(685),ZOOM_COMPLETE:i(686),ZOOM_START:i(687)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e){var h={};t.exports=h,function(){h._nextId=0,h._seed=0,h._nowStartTime=+new Date,h.extend=function(t,e){for(var i,n="boolean"==typeof e?(i=2,e):(i=1,!0),s=i;s=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var d=i(150),f=i(24);t.exports=function(t,e,i,n,s){for(var r,o,a,h,l=f(t,e,i,n,null,s),u=0;u=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,s,r,o,a,h,l,u=e&&e.length,c=u?e[0]*i:t.length,d=g(t,0,c,i,!0),f=[];if(!d||d.next===d.prev)return f;if(u&&(d=function(t,e,i,n){var s,r,o,a,h,l=[];for(s=0,r=e.length;s=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&o=n.x&&n.x>=u&&s!==n.x&&T(ri.x||n.x===i.x&&function(t,e){return w(t.prev,t,e.prev)<0&&w(e.next,t,t.next)<0}(i,n)))&&(i=n,d=h)),n=n.next,n!==l;);return i}(t,e))&&(i=E(e,t),v(e,e.next),v(i,i.next))}}(l[s],i),i=v(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=r=t[0],s=o=t[1];for(var p=i;pr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=x(a,h,e,i,n),d=x(l,u,e,i,n),f=t.prevZ,p=t.nextZ;for(;f&&f.z>=c&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}return!0}(t,n,s,r):function(t){var e=t.prev,i=t,n=t.next;if(0<=w(e,i,n))return!1;var s=t.next.next;for(;s!==t.prev;){if(T(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;s=s.next}return!0}(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),d(t),t=h.next,l=h.next;else if((t=h)===l){o?1===o?m(t=function(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!u(s,r)&&c(s,n,n.next,r)&&b(s,r)&&b(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),d(n),d(n.next),n=t=r),n=n.next}while(n!==t);return v(n)}(v(t),e,i),e,i,n,s,r,2):2===o&&function(t,e,i,n,s,r){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&c(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;for(;i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next,i!==t;);return n}(t,e)&&(w(t.prev,t,e.prev)||w(t,e.prev,e))||u(t,e)&&0=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function l(t){return 0=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t;this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},function(t,e,i){var n=i(0),s=i(18),c=i(22),r=i(8),d=i(2),f=i(7),o=new n({Extends:c,initialize:function t(e,i,n,s,r){var o,a,h="png";f(i)&&(i=d(a=i,"key"),n=d(a,"url"),o=d(a,"normalMap"),s=d(a,"xhrSettings"),h=d(a,"extension",h),r=d(a,"frameConfig")),Array.isArray(n)&&(o=n[1],n=n[0]);var l,u={type:"image",cache:e.textureManager,extension:h,responseType:"blob",key:i,url:n,xhrSettings:s,config:r};c.call(this,e,u),o&&((l=new t(e,this.key,o,s,r)).type="normalMap",this.setLink(l),e.addFile(l))},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){c.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){c.revokeObjectURL(t.data),t.onProcessError()},c.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});r.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e,i){var r=i(157),n=i(0),s=i(11),o=i(14),a=i(29),h=i(991),l=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,h],initialize:function(t,e,i,n,s){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new r(this),this.setTexture(n,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline(),this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=l},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new n(this.x,this.y,this.z)},crossVectors:function(t,e){var i=t.x,n=t.y,s=t.z,r=e.x,o=e.y,a=e.z;return this.x=n*a-s*o,this.y=s*r-i*a,this.z=i*o-n*r,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return 0=t.length)){for(var i=t.length-1,n=t[e],s=e;sh||a.y>l)?(u=Math.max(a.x,e),c=Math.max(a.y,i),b=d=Math.min(a.r,h)-u,E=f=Math.min(a.b,l)-c,T=r?p+(v-(u-a.x)-d):p+(u-a.x),w=o?g+(m-(c-a.y)-f):g+(c-a.y),e=u,i=c,n=d,s=f):E=b=w=T=0):(r&&(T=p+(v-e-n)),o&&(w=g+(m-i-s)));var _=this.source.width,A=this.source.height;return t.u0=Math.max(0,T/_),t.v0=Math.max(0,w/A),t.u1=Math.min(1,(T+b)/_),t.v1=Math.min(1,(w+E)/A),t.x=e,t.y=i,t.cx=T,t.cy=w,t.cw=b,t.ch=E,t.width=n,t.height=s,t.flipX=r,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,s,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=n,this.u1=s,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new r(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=r},function(t,e,i){var n=i(0),s=i(99),r=i(412),o=i(413),a=i(49),h=i(167),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var U=i(252),n=i(0),r=i(29),s=i(193),z=i(2),G=i(6),o=i(7),W=i(404),a=i(141),h=i(76),l=new n({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?o(e[0])&&(i=e,e=null):o(e)&&(i=e,e=null),this.scene=t,this.children=new a,this.isParent=!0,this.type="Group",this.classType=z(i,"classType",h),this.name=z(i,"name",""),this.active=z(i,"active",!0),this.maxSize=z(i,"maxSize",-1),this.defaultKey=z(i,"defaultKey",null),this.defaultFrame=z(i,"defaultFrame",null),this.runChildUpdate=z(i,"runChildUpdate",!1),this.createCallback=z(i,"createCallback",null),this.removeCallback=z(i,"removeCallback",null),this.createMultipleCallback=z(i,"createMultipleCallback",null),this.internalCreateCallback=z(i,"internalCreateCallback",null),this.internalRemoveCallback=z(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;it.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i){return 0<=t&&t=this.firstgid&&t=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(t){void 0===t&&(t=!1);var e=this.vertexBuffer,i=this.program,n=this.renderer;return n.setProgram(i),n.setVertexBuffer(e),this.setAttribPointers(t),this},setAttribPointers:function(t){void 0===t&&(t=!1);for(var e=this.gl,i=this.attributes,n=this.vertexSize,s=this.program,r=0;rthis.vertexCapacity&&this.flush();var N=this.setGameObject(t),Y=t._isTinted&&t.tintFill;this.batchQuad(A,C,M,O,P,R,L,F,l,u,c,d,D,k,I,B,Y,h,N)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){void 0===y&&(y=this.currentUnit);var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,y=this.setTexture2D(m));var T=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount-1;return T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=y,T[++b]=v,w[++b]=d,T[++b]=i,T[++b]=n,T[++b]=h,T[++b]=c,T[++b]=y,T[++b]=v,w[++b]=p,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=y,T[++b]=v,w[++b]=g,T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=y,T[++b]=v,w[++b]=d,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=y,T[++b]=v,w[++b]=g,T[++b]=o,T[++b]=a,T[++b]=u,T[++b]=l,T[++b]=y,T[++b]=v,w[++b]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){void 0===g&&(g=this.currentUnit);var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),v=!0,g=this.setTexture2D(p));var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=g,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=g,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=g,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,_,A,C,M,O,P,R){this.renderer.pipelines.set(this,t);var L,F,D,k=this._tempMatrix1,I=this._tempMatrix2,B=this._tempMatrix3,N=m/i+A,Y=y/n+C,X=(m+x)/i+A,U=(y+T)/n+C,z=o,G=a,W=-g,V=-v;t.isCropped&&(z=(L=t._crop).width,G=L.height,o=L.width,a=L.height,F=m=L.x,D=y=L.y,c&&(F=x-L.x-L.width),d&&!e.isRenderTexture&&(D=T-L.y-L.height),N=F/i+A,Y=D/n+C,X=(F+L.width)/i+A,U=(D+L.height)/n+C,W=-g+m,V=-v+y),c&&(z*=-1,W+=o),(d^=!P&&e.isRenderTexture?1:0)&&(G*=-1,V+=a);var H=W+z,j=V+G;I.applyITRS(s,r,u,h,l),k.copyFrom(M.matrix),O?(k.multiplyWithOffset(O,-M.scrollX*f,-M.scrollY*p),I.e=s,I.f=r):(I.e-=M.scrollX*f,I.f-=M.scrollY*p),k.multiply(I,B);var q=B.getX(W,V),K=B.getY(W,V),Z=B.getX(W,j),J=B.getY(W,j),Q=B.getX(H,j),$=B.getY(H,j),tt=B.getX(H,V),et=B.getY(H,V);M.roundPixels&&(q=Math.round(q),K=Math.round(K),Z=Math.round(Z),J=Math.round(J),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt),et=Math.round(et)),void 0===R&&(R=this.renderer.setTexture2D(e)),this.batchQuad(q,K,Z,J,Q,$,tt,et,N,Y,X,U,w,b,E,S,_,e,R)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.pipelines.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,u=i+t.height;o?a.multiply(o,h):h=a;var c=h.getX(e,i),d=h.getY(e,i),f=h.getX(e,u),p=h.getY(e,u),g=h.getX(l,u),v=h.getY(l,u),m=h.getX(l,i),y=h.getY(l,i),x=this.renderer.setTextureSource(t.source);n=X.getTintAppendFloatAlpha(n,s),this.batchQuad(c,d,f,p,g,v,m,y,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,x)},drawFillRect:function(t,e,i,n,s,r){t=Math.floor(t),e=Math.floor(e);var o=Math.floor(t+i),a=Math.floor(e+n),h=this.renderer.blankTexture.glTexture,l=this.renderer.setTexture2D(h),u=X.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,u,u,u,u,2,h,l)},batchFillRect:function(t,e,i,n,s,r){this.renderer.pipelines.set(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1,b=this.fillTint;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,b.TL,b.TR,b.BL,b.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.pipelines.set(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var s,r,o=t.length,a=this.polygonCache,h=this.fillTint.TL,l=this.fillTint.TR,u=this.fillTint.BL,c=this.tintEffect,d=0;d>16)+(65280&t)+((255&t)<<16)}},function(t,e,i){var n=i(0),a=i(293),s=new n({initialize:function(t,e){this.parent=t,(this.events=e)||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;ne.right||t.y>e.bottom)}},function(t,e,i){var l=i(6),u={},n={register:function(t,e,i,n,s){u[t]={plugin:e,mapping:i,settingsKey:n,configKey:s}},getPlugin:function(t){return u[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,n=e.game.config;for(var s in u){var r=u[s].plugin,o=u[s].mapping,a=u[s].settingsKey,h=u[s].configKey;l(i,a,n[h])&&(t[o]=new r(t))}},remove:function(t){u.hasOwnProperty(t)&&delete u[t]}};t.exports=n},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1239),ANY_KEY_UP:i(1240),COMBO_MATCH:i(1241),DOWN:i(1242),KEY_DOWN:i(1243),KEY_UP:i(1244),UP:i(1245)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),void 0===r&&(r=!1),{responseType:t,async:e,user:i,password:n,timeout:s,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:r}}},function(t,e,i){var n=i(0),s=i(228),r=i(76),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){t.exports={CalculateFacesAt:i(235),CalculateFacesWithin:i(53),Copy:i(1326),CreateFromTiles:i(1327),CullTiles:i(1328),Fill:i(1329),FilterTiles:i(1330),FindByIndex:i(1331),FindTile:i(1332),ForEachTile:i(1333),GetTileAt:i(150),GetTileAtWorldXY:i(1334),GetTilesWithin:i(24),GetTilesWithinShape:i(1335),GetTilesWithinWorldXY:i(1336),HasTileAt:i(504),HasTileAtWorldXY:i(1337),IsInLayerBounds:i(104),PutTileAt:i(236),PutTileAtWorldXY:i(1338),PutTilesAt:i(1339),Randomize:i(1340),RemoveTileAt:i(505),RemoveTileAtWorldXY:i(1341),RenderDebug:i(1342),ReplaceByIndex:i(503),SetCollision:i(1343),SetCollisionBetween:i(1344),SetCollisionByExclusion:i(1345),SetCollisionByProperty:i(1346),SetCollisionFromCollisionGroup:i(1347),SetLayerCollisionIndex:i(153),SetTileCollision:i(65),SetTileIndexCallback:i(1348),SetTileLocationCallback:i(1349),Shuffle:i(1350),SwapByIndex:i(1351),TileToWorldX:i(151),TileToWorldXY:i(1352),TileToWorldY:i(152),WeightedRandomize:i(1353),WorldToTileX:i(66),WorldToTileXY:i(1354),WorldToTileY:i(67)}},function(t,e,i){var r=i(104);t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),r(t,e,n)){var s=n.data[e][t]||null;return null!==s&&(-1!==s.index||i)?s:null}return null}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){var r=i(2);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var n=e.x+r(e,"startx",0)*t.tilewidth+r(e,"offsetx",0),s=e.y+r(e,"starty",0)*t.tileheight+r(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+n,y:i.y+s}}},function(t,e){t.exports=function(o,a,t){return o.hasOwnProperty(a)?"function"==typeof o[a]?function(t,e,i,n,s,r){return o[a](t,e,i,n,s,r)}:function(){return o[a]}:"function"==typeof t?t:function(){return t}}},function(t,e,i){var R=i(243),L=i(15),F=i(90),D=i(71),k=i(155),I=i(526),B=i(241),N=i(6),Y=i(242),X=i(244),U=i(246);t.exports=function(t,e,i){void 0===i&&(i=R);for(var n=i.targets?i.targets:B(e),s=I(e),r=k(e,"delay",i.delay),o=k(e,"duration",i.duration),a=N(e,"easeParams",i.easeParams),h=D(N(e,"ease",i.ease),a),l=k(e,"hold",i.hold),u=k(e,"repeat",i.repeat),c=k(e,"repeatDelay",i.repeatDelay),d=F(e,"yoyo",i.yoyo),f=F(e,"flipX",i.flipX),p=F(e,"flipY",i.flipY),g=[],v=0;vh.getTotalFrames()&&(s=0),r=h.frames[s],0!==s||this.forward||(r=h.getLastFrame()),this.currentFrame=r):console.warn("Missing animation: "+a),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){var i,n;return this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e):(this.delayCounter=e,this.play(t,!0)),this.parent},playAfterRepeat:function(t,e){var i,n;return void 0===e&&(e=1),this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e):this.play(t),this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return n;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(0this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick))for(var n=0;this.forward?i.nextFrame(this):i.previousFrame(this),n++,this.accumulator>this.nextTick&&n<60;);}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(r.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims&&this.anims.get(t)},exists:function(t){return this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new o(this,e,t),this.anims||(this.anims=new s),this.anims.set(e,i))),i},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=a},function(t,e,i){var c={};t.exports=c;var o=i(251),r=i(44),a=i(103),d=i(64);c.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},c.setModified=function(t,e,i,n){if(o.trigger(t,"compositeModified",t),t.isModified=e,i&&t.parent&&c.setModified(t.parent,e,i,n),n)for(var s=0;s=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(1+(s-r)).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=i(307),s=i(310),r=i(312),o=i(313);t.exports=function(t){switch(typeof t){case"string":return("rgb"===t.substr(0,3).toLowerCase()?o:n)(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var a=i(175);function h(t,e,i,n){var s=(t+6*e)%6,r=Math.min(s,4-s,1);return Math.round(255*(n-n*i*Math.max(0,r)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var s=h(5,t,e,i),r=h(3,t,e,i),o=h(1,t,e,i);return n?n.setTo?n.setTo(s,r,o,n.alpha,!1):(n.r=s,n.g=r,n.b=o,n.color=a(s,r,o),n):{r:s,g:r,b:o,color:a(s,r,o)}}},function(t,e){var i="";function n(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;is.width&&(t=s.width-r.cutX),r.cutY+e>s.height&&(e=s.height-r.cutY),r.setSize(t,e,r.cutX,r.cutY)),this.updateDisplayOrigin();var a=this.input;return a&&!a.customHitArea&&(a.hitArea.width=t,a.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){var o=this.gl,a=this.frame,h=this.texture,l=this.camera,u=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=a.cutWidth),void 0===r&&(r=a.cutHeight);var c,d,f,p,g,v,m,y,x,T,w=255&(t>>16|0),b=255&(t>>8|0),E=255&(0|t);return l.preRender(1,1),o?(c=l._cx,d=l._cy,f=l._cw,p=l._ch,u.resetTextures(!0),u.pushScissor(c,d,f,-p),u.setFramebuffer(this.framebuffer,!1),g=this.pipeline,v=h.width,m=h.height,y=g.width/v,x=g.height/m,g.drawFillRect(i*y,(m-r-n)*x,s*y,r*x,S.getTintFromFloats(w/255,b/255,E/255,1),e),g.flush(),u.setFramebuffer(null,!1),u.popScissor()):(T=this.context,u.setContext(T),T.fillStyle="rgba("+w+","+b+","+E+","+e+")",T.fillRect(i+a.cutX,n+a.cutY,s,r),u.setContext()),this.dirty=!0,this},clear:function(){var t,e,i;return this.dirty&&((t=this.gl)?((e=this.renderer).setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)):((i=this.context).save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()),this.dirty=!1),this},erase:function(t,e,i){this._eraseMode=!0;var n=this.renderer.currentBlendMode;return this.renderer.setBlendMode(o.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(n),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r,o,a,h,l,u=this.gl,c=this.camera,d=this.renderer;return c.preRender(1,1),u?(r=c._cx,o=c._cy,a=c._cw,h=c._ch,d.resetTextures(!0),d.setFramebuffer(this.framebuffer,!1),d.pushScissor(r,o,a,h,h),l=this.pipeline,g(l,0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),d.setFramebuffer(null,!0),d.resetTextures(!0),g(l,0,l.width,l.height,0,-1e3,1e3)):(d.setContext(this.context),this.batchList(t,e,i,n,s),d.setContext()),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o,a,h,l,u,c=this.gl,d=this.camera,f=this.renderer,p=this.textureManager.getFrame(t,e);return p&&(d.preRender(1,1),c?(o=d._cx,a=d._cy,h=d._cw,l=d._ch,f.resetTextures(!0),f.setFramebuffer(this.framebuffer,!1),f.pushScissor(o,a,h,l,l),u=this.pipeline,g(u,0,this.texture.width,0,this.texture.height,-1e3,1e3),u.batchTextureFrame(p,i+this.frame.cutX,n+this.frame.cutY,r,s,d.matrix,null),u.flush(),f.setFramebuffer(null,!1),f.popScissor(),g(u,0,u.width,u.height,0,-1e3,1e3)):this.batchTextureFrame(p,i+this.frame.cutX,n+this.frame.cutY,s,r),this.dirty=!0),this},batchList:function(t,e,i,n,s){for(var r=0;rs&&(r=t[s]),n[s]=r,t.length>s+1&&(r=t[s+1]),n[s+1]=r;return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(r=0;rn&&(s=t[n]),i[n]=s,t.length>n+1&&(s=t[n+1]),i[n+1]=s;return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var n,s,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,s=this.frame.width/(o-1),n=0;n=this._markerOut&&(e.loop?(e.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=t,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))},checkVideoProgress:function(){2<=this.video.readyState?this.updateTexture():(this.retry--,0e._dx?r<(s=t.right-e.x)&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxe._dy?r<(s=t.bottom-e.y)&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===o.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===o.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dy=t.right||e.position.y>=t.bottom)}},function(t,e,i){var w={};t.exports=w;var o=i(88),b=i(102),a=i(250),h=i(103),l=i(542),u=i(44);w._warming=.4,w._torqueDampen=1,w._minLength=1e-6,w.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?b.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?b.add(e.bodyB.position,e.pointB):e.pointB,s=b.magnitude(b.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||u.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(0t&&(t=s.totalDuration),s.delay=o.sleepThreshold&&u.set(o,!0)):0u._motionWakeThreshold*i&&u.set(a,!1)))}},u.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},function(t,e,i){var n={};t.exports=n;var u=i(44);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r=t.right&&(o=1,r+=s-t.right,s=t.right);break;case 1:(r+=e)>=t.bottom&&(o=2,s-=r-t.bottom,r=t.bottom);break;case 2:(s-=e)<=t.left&&(o=3,r-=t.left-s,s=t.left);break;case 3:(r-=e)<=t.top&&(o=0,r=t.top)}return n}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;ne.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t){var i=/\D/g;return t.sort(function(t,e){return parseInt(t.replace(i,""),10)-parseInt(e.replace(i,""),10)}),t}},function(t,e,i){var n=i(172),s=i(0),r=i(92),o=i(12),a=i(122),h=i(21),T=i(2),d=i(6),f=i(173),p=i(302),l=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var n,s=this.anims,r=this.mixes,o="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;return s.has(o)&&s.has(a)&&((n=(n=r.get(o))||{})[a]=i,r.set(o,n)),this},removeMix:function(t,e){var i,n=this.mixes,s="string"==typeof t?t:t.key,r=n.get(s);return r&&(e?(i="string"==typeof e?e:e.key,r.hasOwnProperty(i)&&delete r[i]):e||n.delete(s)),this},getMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,s="string"==typeof e?e:e.key,r=i.get(n);return r&&r.hasOwnProperty(s)?r[s]:0},add:function(t,e){return this.anims.has(t)?console.warn("Animation key exists: "+t):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e)),this},exists:function(t){return this.anims.has(t)},createFromAseprite:function(g,v){var m=[],t=this.game.cache.json.get(g);if(!t)return m;var y=this,e=d(t,"meta",null),x=d(t,"frames",null);return e&&x&&d(e,"frameTags",[]).forEach(function(t){var e=[],i=T(t,"name",null),n=T(t,"from",0),s=T(t,"to",0),r=T(t,"direction","forward");if(i&&(!v||v&&-1d.right&&(f=T(f,f+(e-d.right),this.lerp.x)),id.bottom&&(p=T(p,p+(i-d.bottom),this.lerp.y))):(f=T(f,e-l,this.lerp.x),p=T(p,i-u,this.lerp.y))),this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(l=Math.round(l),u=Math.round(u));var g=(this.scrollX=f)+r,v=(this.scrollY=p)+o;this.midPoint.set(g,v);var m=n/a,y=s/a;this.worldView.setTo(g-m/2,v-y/2,m,y),h.applyITRS(this.x+l,this.y+u,this.rotation,a,a),h.translate(-l,-u),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=u(i,0,1),n=u(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var o=this.width/2,a=this.height/2,h=t.x-s,l=t.y-r;return this.midPoint.set(h,l),this.scrollX=h-o,this.scrollY=l-a,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=c},function(t,e,i){var o=i(32);t.exports=function(t){var e=new o;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i,n,s,r=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r&&(i=parseInt(r[1],16),n=parseInt(r[2],16),s=parseInt(r[3],16),e.setTo(i,n,s)),e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(32);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var a=i(32);t.exports=function(t){var e,i,n,s,r=new a,o=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());return o&&(e=parseInt(o[1],10),i=parseInt(o[2],10),n=parseInt(o[3],10),s=void 0!==o[4]?parseFloat(o[4]):1,r.setTo(e,i,n,255*s)),r}},function(t,e,i){t.exports={Fade:i(688),Flash:i(689),Pan:i(690),Shake:i(723),RotateTo:i(724),Zoom:i(725)}},function(t,e,i){t.exports={In:i(691),Out:i(692),InOut:i(693)}},function(t,e,i){t.exports={In:i(694),Out:i(695),InOut:i(696)}},function(t,e,i){t.exports={In:i(697),Out:i(698),InOut:i(699)}},function(t,e,i){t.exports={In:i(700),Out:i(701),InOut:i(702)}},function(t,e,i){t.exports={In:i(703),Out:i(704),InOut:i(705)}},function(t,e,i){t.exports={In:i(706),Out:i(707),InOut:i(708)}},function(t,e,i){t.exports=i(709)},function(t,e,i){t.exports={In:i(710),Out:i(711),InOut:i(712)}},function(t,e,i){t.exports={In:i(713),Out:i(714),InOut:i(715)}},function(t,e,i){t.exports={In:i(716),Out:i(717),InOut:i(718)}},function(t,e,i){t.exports={In:i(719),Out:i(720),InOut:i(721)}},function(t,e,i){t.exports=i(722)},function(t,e,i){var n=i(0),a=i(34),h=i(328),l=i(2),u=i(6),c=i(7),d=i(180),f=i(1),p=i(184),g=i(174),s=new n({initialize:function(t){void 0===t&&(t={});this.width=u(t,"width",1024),this.height=u(t,"height",768),this.zoom=u(t,"zoom",1),this.resolution=u(t,"resolution",1),this.parent=u(t,"parent",void 0),this.scaleMode=u(t,"scaleMode",0),this.expandParent=u(t,"expandParent",!0),this.autoRound=u(t,"autoRound",!1),this.autoCenter=u(t,"autoCenter",0),this.resizeInterval=u(t,"resizeInterval",500),this.fullscreenTarget=u(t,"fullscreenTarget",null),this.minWidth=u(t,"minWidth",0),this.maxWidth=u(t,"maxWidth",0),this.minHeight=u(t,"minHeight",0),this.maxHeight=u(t,"maxHeight",0);var e=u(t,"scale",null);e&&(this.width=u(e,"width",this.width),this.height=u(e,"height",this.height),this.zoom=u(e,"zoom",this.zoom),this.resolution=u(e,"resolution",this.resolution),this.parent=u(e,"parent",this.parent),this.scaleMode=u(e,"mode",this.scaleMode),this.expandParent=u(e,"expandParent",this.expandParent),this.autoRound=u(e,"autoRound",this.autoRound),this.autoCenter=u(e,"autoCenter",this.autoCenter),this.resizeInterval=u(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=u(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=u(e,"min.width",this.minWidth),this.maxWidth=u(e,"max.width",this.maxWidth),this.minHeight=u(e,"min.height",this.minHeight),this.maxHeight=u(e,"max.height",this.maxHeight)),this.renderType=u(t,"type",a.AUTO),this.canvas=u(t,"canvas",null),this.context=u(t,"context",null),this.canvasStyle=u(t,"canvasStyle",null),this.customEnvironment=u(t,"customEnvironment",!1),this.sceneConfig=u(t,"scene",null),this.seed=u(t,"seed",[(Date.now()*Math.random()).toString()]),d.RND=new d.RandomDataGenerator(this.seed),this.gameTitle=u(t,"title",""),this.gameURL=u(t,"url","https://phaser.io"),this.gameVersion=u(t,"version",""),this.autoFocus=u(t,"autoFocus",!0),this.domCreateContainer=u(t,"dom.createContainer",!1),this.domBehindCanvas=u(t,"dom.behindCanvas",!1),this.inputKeyboard=u(t,"input.keyboard",!0),this.inputKeyboardEventTarget=u(t,"input.keyboard.target",window),this.inputKeyboardCapture=u(t,"input.keyboard.capture",[]),this.inputMouse=u(t,"input.mouse",!0),this.inputMouseEventTarget=u(t,"input.mouse.target",null),this.inputMouseCapture=u(t,"input.mouse.capture",!0),this.inputTouch=u(t,"input.touch",h.input.touch),this.inputTouchEventTarget=u(t,"input.touch.target",null),this.inputTouchCapture=u(t,"input.touch.capture",!0),this.inputActivePointers=u(t,"input.activePointers",1),this.inputSmoothFactor=u(t,"input.smoothFactor",0),this.inputWindowEvents=u(t,"input.windowEvents",!0),this.inputGamepad=u(t,"input.gamepad",!1),this.inputGamepadEventTarget=u(t,"input.gamepad.target",window),this.disableContextMenu=u(t,"disableContextMenu",!1),this.audio=u(t,"audio"),this.hideBanner=!1===u(t,"banner",null),this.hidePhaser=u(t,"banner.hidePhaser",!1),this.bannerTextColor=u(t,"banner.text","#ffffff"),this.bannerBackgroundColor=u(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=u(t,"fps",null);var i=u(t,"render",t);this.antialias=u(i,"antialias",!0),this.antialiasGL=u(i,"antialiasGL",!0),this.mipmapFilter=u(i,"mipmapFilter","LINEAR"),this.desynchronized=u(i,"desynchronized",!1),this.roundPixels=u(i,"roundPixels",!1),this.pixelArt=u(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=u(i,"transparent",!1),this.clearBeforeRender=u(i,"clearBeforeRender",!0),this.premultipliedAlpha=u(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=u(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=u(i,"powerPreference","default"),this.batchSize=u(i,"batchSize",4096),this.maxTextures=u(i,"maxTextures",-1),this.maxLights=u(i,"maxLights",10);var n=u(t,"backgroundColor",0);this.backgroundColor=g(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=u(t,"callbacks.preBoot",f),this.postBoot=u(t,"callbacks.postBoot",f),this.physics=u(t,"physics",{}),this.defaultPhysicsSystem=u(this.physics,"default",!1),this.loaderBaseURL=u(t,"loader.baseURL",""),this.loaderPath=u(t,"loader.path",""),this.loaderMaxParallelDownloads=u(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=u(t,"loader.crossOrigin",void 0),this.loaderResponseType=u(t,"loader.responseType",""),this.loaderAsync=u(t,"loader.async",!0),this.loaderUser=u(t,"loader.user",""),this.loaderPassword=u(t,"loader.password",""),this.loaderTimeout=u(t,"loader.timeout",0),this.loaderWithCredentials=u(t,"loader.withCredentials",!1),this.installGlobalPlugins=[],this.installScenePlugins=[];var s=u(t,"plugins",null),r=p.DefaultScene;s&&(Array.isArray(s)?this.defaultPlugins=s:c(s)&&(this.installGlobalPlugins=l(s,"global",[]),this.installScenePlugins=l(s,"scene",[]),Array.isArray(s.default)?r=s.default:Array.isArray(s.defaultMerge)&&(r=r.concat(s.defaultMerge)))),this.defaultPlugins=r;var o="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=u(t,"images.default",o+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=u(t,"images.missing",o+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=a.WEBGL:window.FORCE_CANVAS&&(this.renderType=a.CANVAS))}});t.exports=s},function(t,e,i){t.exports={os:i(125),browser:i(126),features:i(179),input:i(756),audio:i(757),video:i(758),fullscreen:i(759),canvasFeatures:i(329)}},function(t,e,i){var n,s,r,o=i(26),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var i=new Image;i.onload=function(){var t=o.create(i,6,1).getContext("2d");if(t.globalCompositeOperation="multiply",t.drawImage(r,0,0),t.drawImage(i,2,0),!t.getImageData(2,0,1,1))return!1;var e=t.getImageData(2,0,1,1).data;o.remove(i),a.supportNewBlendModes=255===e[0]&&0===e[1]&&0===e[2]},i.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t){return 0<=(t%=2*Math.PI)?t:t+2*Math.PI}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),e-ir[0]&&(e=1),r[8]>r[3*e+e]&&(e=2),i=a[e],n=a[i],s=Math.sqrt(r[3*e+e]-r[3*i+i]-r[3*n+n]+1),h[e]=.5*s,s=.5/s,h[i]=(r[3*i+e]+r[3*e+i])*s,h[n]=(r[3*n+e]+r[3*e+n])*s,this.x=h[0],this.y=h[1],this.z=h[2],this.w=(r[3*n+i]-r[3*i+n])*s),this}});t.exports=d},function(t,e,a){var h=a(350),l=a(26),u=a(34),c=a(179);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===u.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==u.HEADLESS)if(e.renderType===u.CANVAS||e.renderType!==u.CANVAS&&!c.webGL){if(!c.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=u.CANVAS}else e.renderType=u.WEBGL;e.antialias||l.disableSmoothing();var i,n,s=t.scale.baseSize,r=s.width,o=s.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=r,t.canvas.height=o):t.canvas=l.create(t,r,o,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||h.setCrisp(t.canvas),e.renderType!==u.HEADLESS&&(i=a(532),n=a(535),e.renderType===u.WEBGL?t.renderer=new n(t):(t.renderer=new i(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(e){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(t){e.style["image-rendering"]=t}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var l=i(34);t.exports=function(t){var e,i,n,s,r,o,a,h=t.config;h.hideBanner||(e="WebGL",h.renderType===l.CANVAS?e="Canvas":h.renderType===l.HEADLESS&&(e="Headless"),i=h.audio,a=!(n=t.device.audio).webAudio||i&&i.disableWebAudio?i&&i.noAudio||!n.webAudio&&!n.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie?window.console&&console.log("Phaser v"+l.VERSION+" / https://phaser.io"):(r=[s=""],Array.isArray(h.bannerBackgroundColor)?(h.bannerBackgroundColor.forEach(function(t){s=s.concat("%c "),r.push("background: "+t),o=t}),r[r.length-1]="color: "+h.bannerTextColor+"; background: "+o):(s=s.concat("%c "),r.push("color: "+h.bannerTextColor+"; background: "+h.bannerBackgroundColor)),r.push("background: #fff"),h.gameTitle&&(s=s.concat(h.gameTitle),h.gameVersion&&(s=s.concat(" v"+h.gameVersion)),h.hidePhaser||(s=s.concat(" / "))),h.hidePhaser||(s=s.concat("Phaser v"+l.VERSION+" ("+e+" | "+a+")")),s=s.concat(" %c "+h.gameURL),r[0]=s,console.log.apply(console,r)))}},function(t,e,i){var n=i(0),s=i(6),r=i(1),o=i(353),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3;for(var e=this.framesThisSecond=0;ethis._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var a=o=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var n=this;this.step=function t(){var e=window.performance.now();n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.requestAnimationFrame(t)},this.stepTimeout=function t(){var e=Date.now(),i=Math.min(Math.max(2*n.target+n.tick-e,0),n.target);n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.setTimeout(t,i)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(21);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var m=i(356),y=i(26),x=i(6);t.exports=function(t){var e=x(t,"data",[]),i=x(t,"canvas",null),n=x(t,"palette",m),s=x(t,"pixelWidth",1),r=x(t,"pixelHeight",s),o=x(t,"resizeCanvas",!0),a=x(t,"clearCanvas",!0),h=x(t,"preRender",null),l=x(t,"postRender",null),u=Math.floor(Math.abs(e[0].length*s)),c=Math.floor(Math.abs(e.length*r));i||(i=y.create2D(this,u,c),a=o=!1),o&&(i.width=u,i.height=c);var d=i.getContext("2d");a&&d.clearRect(0,0,u,c),h&&h(i,d);for(var f=0;fi.length-2?i.length-1:s+1],l=i[s>i.length-3?i.length-1:s+2];return e.set(u(r,o.x,a.x,h.x,l.x),u(r,o.y,a.y,h.y,l.y))},toJSON:function(){for(var t=[],e=0;ei.width?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?s.ORIENTATION.PORTRAIT:s.ORIENTATION.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return s.ORIENTATION.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return s.ORIENTATION.LANDSCAPE}return tthis.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var e=this.listeners;window.removeEventListener("orientationchange",e.orientationChange,!1),window.removeEventListener("resize",e.windowResize,!1);["webkit","moz",""].forEach(function(t){document.removeEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.removeEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",e.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===c.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===c.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(17),s=i(0),r=i(95),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,0r.START&&n.settings.status<=r.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status=r.x&&t=r.y&&e=r.x&&t=r.y&&e=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s>4,l[a++]=(15&i)<<4|n>>2,l[a++]=(3&n)<<6|63&s;return h}},function(t,e,i){var n=i(136),s=i(0),r=i(61),o=new s({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime>>16,v=(65280&d)>>>8,m=255&d,l.strokeStyle="rgba("+g+","+v+","+m+","+u+")",l.lineWidth=p,y+=3;break;case x.FILL_STYLE:f=a[y+1],c=a[y+2],g=(16711680&f)>>>16,v=(65280&f)>>>8,m=255&f,l.fillStyle="rgba("+g+","+v+","+m+","+c+")",y+=2;break;case x.BEGIN_PATH:l.beginPath();break;case x.CLOSE_PATH:l.closePath();break;case x.FILL_PATH:o||l.fill();break;case x.STROKE_PATH:o||l.stroke();break;case x.FILL_RECT:o?l.rect(a[y+1],a[y+2],a[y+3],a[y+4]):l.fillRect(a[y+1],a[y+2],a[y+3],a[y+4]),y+=4;break;case x.FILL_TRIANGLE:l.beginPath(),l.moveTo(a[y+1],a[y+2]),l.lineTo(a[y+3],a[y+4]),l.lineTo(a[y+5],a[y+6]),l.closePath(),o||l.fill(),y+=6;break;case x.STROKE_TRIANGLE:l.beginPath(),l.moveTo(a[y+1],a[y+2]),l.lineTo(a[y+3],a[y+4]),l.lineTo(a[y+5],a[y+6]),l.closePath(),o||l.stroke(),y+=6;break;case x.LINE_TO:l.lineTo(a[y+1],a[y+2]),y+=2;break;case x.MOVE_TO:l.moveTo(a[y+1],a[y+2]),y+=2;break;case x.LINE_FX_TO:l.lineTo(a[y+1],a[y+2]),y+=5;break;case x.MOVE_FX_TO:l.moveTo(a[y+1],a[y+2]),y+=5;break;case x.SAVE:l.save();break;case x.RESTORE:l.restore();break;case x.TRANSLATE:l.translate(a[y+1],a[y+2]),y+=2;break;case x.SCALE:l.scale(a[y+1],a[y+2]),y+=2;break;case x.ROTATE:l.rotate(a[y+1]),y+=1;break;case x.GRADIENT_FILL_STYLE:y+=5;break;case x.GRADIENT_LINE_STYLE:y+=6;break;case x.SET_TEXTURE:y+=2}}l.restore()}}},function(t,e,i){var n=i(0),s=i(127),r=i(71),o=i(2),a=i(59),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t,e,i,n=this.propertyValue,s=typeof n;return"number"==s?(this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate):Array.isArray(n)?this.onEmit=this.randomStaticValueEmit:"function"==s?this.emitOnly?this.onEmit=n:this.onUpdate=n:"object"==s&&(this.has(n,"random")||this.hasBoth(n,"start","end")||this.hasBoth(n,"min","max"))?(this.start=this.has(n,"start")?n.start:n.min,this.end=this.has(n,"end")?n.end:n.max,(t=this.hasBoth(n,"min","max")||!!n.random)&&(e=n.random,Array.isArray(e)&&(this.start=e[0],this.end=e[1]),this.onEmit=this.randomRangedValueEmit),this.has(n,"steps")?(this.steps=n.steps,this.counter=this.start,this.onEmit=this.steppedEmit):(i=this.has(n,"ease")?n.ease:"Linear",this.ease=r(i),t||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate)):"object"==s&&this.hasEither(n,"onEmit","onUpdate")&&(this.has(n,"onEmit")&&(this.onEmit=n.onEmit),this.has(n,"onUpdate")&&(this.onUpdate=n.onUpdate)),this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){var i;return t&&t.data[e]&&((i=t.data[e]).min=this.start,i.max=this.end),this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(0),o=i(2),s=new n({initialize:function(t,e,i,n,s){var r;"object"==typeof t?(t=o(r=t,"x",0),e=o(r,"y",0),i=o(r,"power",0),n=o(r,"epsilon",100),s=o(r,"gravity",50)):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50)),this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i,n,s=this.x-t.x,r=this.y-t.y,o=s*s+r*r;0!==o&&(i=Math.sqrt(o),oe.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(0this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;id.PI2?s=d.PI2:s<0&&(s=d.PI2+s%d.PI2);for(var a,h=[r+Math.cos(n)*i,o+Math.sin(n)*i];e<1;)a=s*e+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),e+=t;return a=s+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),h.push(r+Math.cos(n)*i,o+Math.sin(n)*i),this.pathIndexes=u(h),this.pathData=h,this}});t.exports=r},function(t,e,i){var n=i(0),s=i(1023),r=i(60),o=i(9),a=i(30),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;st.right||e.rightt.bottom||e.bottome.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottomt.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var a=i(472),h=i(473),n=i(0),l=i(12),u=i(3),s=new n({Extends:l,initialize:function(t,e){l.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=s;for(this.fixedStep||(n=.001*e,o=!0,this._elapsed=0),h=0;h=s;)this._elapsed-=s,this.step(n)}},step:function(t){for(var e,i=this.bodies.entries,n=i.length,s=0;sc)&&(d.xu))return this.separateCircle(t,e,s)}var f=!1,p=!1;s?(f=A(t,e,s,this.OVERLAP_BIAS),p=C(t,e,s,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=p(t.center.x,e.left,e.right),n=p(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;od.baseTileWidth&&(h-=a=(d.tileWidth-d.baseTileWidth)*e.scaleX,u+=a),d.tileHeight>d.baseTileHeight&&(c+=(d.tileHeight-d.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(h,l,u,c);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,u={left:0,right:0,top:0,bottom:0},c=!1,d=0;de.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,r=this.blocked.right=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,r=this.blocked.down=!0),r&&(this.blocked.none=!1),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this.updateCenter(),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n,s,r=this.gameObject;return!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r.getCenter&&(n=(r.width-t)/2,s=(r.height-e)/2,this.offset.set(n,s)),this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return 0=t.minX&&e.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,s){for(var r,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(r=e+Math.ceil((i-e)/n/2)*n,a(t,r,e,i,s),o.push(e,r,r,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!l(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;sthis._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),o=p(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,f(i,this.toBBox),f(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=p([t,e]),this.data.height=t.height+1,this.data.leaf=!1,f(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){for(var n,s,r,o,a,h,l,u,c,d,f,p,g=a=1/0,v=e;v<=i-e;v++)n=m(t,0,v,this.toBBox),s=m(t,v,i,this.toBBox),l=n,u=s,p=f=d=c=void 0,c=Math.max(l.minX,u.minX),d=Math.max(l.minY,u.minY),f=Math.min(l.maxX,u.maxX),p=Math.min(l.maxY,u.maxY),r=Math.max(0,f-c)*Math.max(0,p-d),o=y(n)+y(s),re.deltaAbsY()?g=-1:e.deltaAbsX()i&&s<(o=t.right-i)&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):0i&&s<(o=t.bottom-i)&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):0=r.layers.length){if(s.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=s.pop()}else{var o,a=r.layers[r.i];if(r.i++,"tilelayer"===a.type)if(a.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+a.name+"'");else{if(a.encoding&&"base64"===a.encoding){if(a.chunks)for(var h=0;h>>0;return n}},function(t,e,i){var h=i(2),l=i(154);t.exports=function(t){for(var e=[],i=[],n=l(t);n.i=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r,o,a=n.layers[n.i];n.i++,"imagelayer"===a.type?(s=h(a,"offsetx",0)+h(a,"startx",0),r=h(a,"offsety",0)+h(a,"starty",0),e.push({name:n.name+a.name,image:a.image,x:n.x+s+a.x,y:n.y+r+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:h(a,"properties",{})})):"group"===a.type&&(o=l(t,a,n),i.push(n),n=o)}return e}},function(t,e,i){var x=i(107),T=i(513),w=i(239);t.exports=function(t){for(var e,i=[],n=[],s=null,r=0;r=this.firstgid&&t=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r=n.layers[n.i];if(n.i++,r.opacity*=n.opacity,r.visible=n.visible&&r.visible,"objectgroup"===r.type){r.name=n.name+r.name;for(var o=n.x+d(r,"startx",0)+d(r,"offsetx",0),a=n.y+d(r,"starty",0)+d(r,"offsety",0),h=[],l=0;ln&&(n=e.layer[r].width),e.layer[r].height>s&&(s=e.layer[r].height);var o=new h({width:n,height:s,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:a.WELTMEISTER});return o.layers=l(e,i),o.tilesets=u(e),o}},function(t,e,i){var d=i(105),f=i(75);t.exports=function(t,e){for(var i=[],n=0;nx||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));else if(1===m)for(h=0;hx||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));else if(2===m)for(h=f-1;0<=h;h--)for(l=0;lx||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));else if(3===m)for(h=f-1;0<=h;h--)for(l=d-1;0<=l;l--)!(a=v[h][l])||a.indexx||!a.visible||(T=this.batchTile(T,a,c,p,g,t,e));return this.dirty[e]=!1,null===r&&(r=n.createVertexBuffer(o,s.STATIC_DRAW),this.vertexBuffer[e]=r),n.setVertexBuffer(r),i.setAttribPointers(),s.bufferSubData(s.ARRAY_BUFFER,0,o),this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,u=h/2,c=l/2,d=a.x/n,f=a.y/s,p=(a.x+h)/n,g=(a.y+l)/s,v=this._tempMatrix,m=-u,y=-c;e.flipX&&(h*=-1,m+=i.tileWidth),e.flipY&&(l*=-1,y+=i.tileHeight);var x=m+h,T=y+l;v.applyITRS(u+e.pixelX,c+e.pixelY,e.rotation,1,1);var w=L.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),b=v.getX(m,y),E=v.getY(m,y),S=v.getX(m,T),_=v.getY(m,T),A=v.getX(x,T),C=v.getY(x,T),M=v.getX(x,y),O=v.getY(x,y);r.roundPixels&&(b=Math.round(b),E=Math.round(E),S=Math.round(S),_=Math.round(_),A=Math.round(A),C=Math.round(C),M=Math.round(M),O=Math.round(O));var P=this.vertexViewF32[o],R=this.vertexViewU32[o];return P[++t]=b,P[++t]=E,P[++t]=d,P[++t]=f,P[++t]=0,P[++t]=0,R[++t]=w,P[++t]=S,P[++t]=_,P[++t]=d,P[++t]=g,P[++t]=0,P[++t]=0,R[++t]=w,P[++t]=A,P[++t]=C,P[++t]=p,P[++t]=g,P[++t]=0,P[++t]=0,R[++t]=w,P[++t]=b,P[++t]=E,P[++t]=d,P[++t]=f,P[++t]=0,P[++t]=0,R[++t]=w,P[++t]=A,P[++t]=C,P[++t]=p,P[++t]=g,P[++t]=0,P[++t]=0,R[++t]=w,P[++t]=M,P[++t]=O,P[++t]=p,P[++t]=f,P[++t]=0,P[++t]=0,R[++t]=w,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),0<=t&&t<4){this._renderOrder=t;for(var e=0;ethis.vertexCapacity&&(this.flush(),x=!0,y=this.setTexture2D(m));var T=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount-1;return T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=i,T[++b]=n,T[++b]=h,T[++b]=c,T[++b]=v,w[++b]=p,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=o,T[++b]=a,T[++b]=u,T[++b]=l,T[++b]=v,w[++b]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){void 0===g&&(g=this.currentUnit);var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),v=!0,g=this.setTexture2D(p));var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},bind:function(t){return void 0===t&&(t=!1),l.prototype.bind.call(this,t),this}});t.exports=u},function(t,e,i){var C=i(26),M=i(32),O=i(2);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),n=O(e,"callback"),s=O(e,"type","image/png"),r=O(e,"encoder",.92),o=O(e,"x",0),a=O(e,"y",0),h=O(e,"getPixel",!1),l=O(e,"isFramebuffer",!1),u=l?O(e,"bufferWidth",1):i.drawingBufferWidth,c=l?O(e,"bufferHeight",1):i.drawingBufferHeight;if(h){var d=new Uint8Array(4),f=l?a:c-a;i.readPixels(o,f,1,1,i.RGBA,i.UNSIGNED_BYTE,d),n.call(null,new M(d[0],d[1],d[2],d[3]/255))}else{var p=O(e,"width",u),g=O(e,"height",c),v=p*g*4,m=new Uint8Array(v);i.readPixels(o,c-a-g,p,g,i.RGBA,i.UNSIGNED_BYTE,m);for(var y=C.createWebGL(this,p,g),x=y.getContext("2d"),T=x.getImageData(0,0,p,g),w=T.data,b=0;b>>0;if("function"!=typeof t)throw new TypeError;for(var n=2<=arguments.length?arguments[1]:void 0,s=0;sthis.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001)))},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(306),BaseCamera:i(93),CameraManager:i(726),Effects:i(314),Events:i(42)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerarotatecomplete"},function(t,e){t.exports="camerarotatestart"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(17),s=i(0),l=i(42),r=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o,a){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a;var h=t?l.FADE_OUT_START:l.FADE_IN_START;return this.camera.emit(h,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsedthis.source?Math.abs(this.destination-this.source):Math.abs(this.destination+h)-this.source)<(u=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+h)-this.destination)?this.clockwise=!0:uMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(127);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){var n=i(127);t.exports=function(){return n(-180,180)}},function(t,e,i){var n=i(332);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(13);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new r([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new o(t.x,t.y)):this.add(new o(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return 16777215>>24),e}},function(t,e,i){var h=i(32),l=i(366);t.exports=function(t,e,i){var n,s,r=i,o=i,a=i;return 0!==e&&(r=l(s=2*i-(n=i<.5?i*(1+e):i+e-i*e),n,t+1/3),o=l(s,n,t),a=l(s,n,t-1/3)),(new h).setGLTo(r,o,a,1)}},function(t,e,i){var s=i(176);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},function(t,e,i){function o(t,e,i,n,s,r,o,a){void 0===o&&(o=100),void 0===a&&(a=0);var h=a/o;return{r:l(t,n,h),g:l(e,s,h),b:l(i,r,h)}}var l=i(124);t.exports={RGBWithRGB:o,ColorWithRGB:function(t,e,i,n,s,r){return void 0===s&&(s=100),void 0===r&&(r=0),o(t.r,t.g,t.b,e,i,n,s,r)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),o(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(182),s=i(32);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var r=i(365);t.exports=function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+r(n)+r(t)+r(e)+r(i)}},function(t,e,i){t.exports={BitmapMask:i(287),GeometryMask:i(288)}},function(t,e,i){var n={AddToDOM:i(131),DOMContentLoaded:i(367),GetInnerHeight:i(368),GetScreenOrientation:i(369),GetTarget:i(374),ParseXML:i(375),RemoveFromDOM:i(188),RequestAnimationFrame:i(353)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(849)}},function(t,e,i){var n=i(0),s=i(12),r=i(23),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(131),s=i(301),r=i(305),o=i(26),a=i(0),h=i(327),l=i(851),u=i(349),c=i(120),d=i(351),f=i(328),p=i(367),g=i(12),v=i(21),m=i(376),y=i(23),x=i(381),T=i(382),w=i(384),b=i(130),E=i(389),S=i(352),_=i(354),A=i(393),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),_(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(131);t.exports=function(t){var e,i=t.config;i.parent&&i.domCreateContainer&&((e=document.createElement("div")).style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=e,n(e,i.parent))}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s=i.getElementsByTagName("SubTexture"),r=0;r=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,s=t.indexOf(e);return-1!==s&&st.length-1)throw new Error("Index out of bounds");var s=r(t,e);return i&&i.call(n,s),s}},function(t,e,i){var l=i(70);t.exports=function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),l(t,e,i)){var r=i-e,o=t.splice(e,r);if(n)for(var a=0;a?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var T=i(6);t.exports=function(t,e){var i=e.width,n=e.height,s=Math.floor(i/2),r=Math.floor(n/2),o=T(e,"chars","");if(""!==o){var a=T(e,"image",""),h=T(e,"offset.x",0),l=T(e,"offset.y",0),u=T(e,"spacing.x",0),c=T(e,"spacing.y",0),d=T(e,"lineSpacing",0),f=T(e,"charsPerRow",null);null===f&&(f=t.sys.textures.getFrame(a).width/i)>o.length&&(f=o.length);for(var p=h,g=l,v={retroFont:!0,font:a,size:i,lineHeight:n+d,chars:{}},m=0,y=0;yr.vertexCapacity&&r.flush();for(var g=r.setGameObject(e),v=r.vertexViewF32,m=r.vertexViewU32,y=r.vertexCount*r.vertexComponentCount-1,x=0,T=e.tintFill,w=0;w=i&&t.x<=n&&t.y>=s&&t.y<=r}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||s=n&&(p.push(v),f=v)}var m=o[o.length-1];return y(f,m)i&&(i=a.x),a.xs&&(s=a.y),a.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var r=i(9);t.exports=function(t,e,i,n,s){return void 0===s&&(s=new r),s.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var r=i(178);t.exports=function(t,e,i){var n=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),r(t,n,s)}},function(t,e,i){var n=i(9),s=i(143);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var a=i(4),h=i(41);t.exports=function(t,e,i){void 0===i&&(i=new a),e=h(e);var n=Math.sin(e),s=Math.cos(e),r=0=s||0=t.downTime+n)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],s=this;try{var r=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return s.state=o.FILE_ERRORED,void s.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){l.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){l.revokeObjectURL(s.data),s.onProcessError()},l.createObjectURL(this.data,r,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});s.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r=n[2];if("^"===i.operator)return 0=i.number:0=n[2]:r[2]===n[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var s=i(158),r=(i(234),i(44));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var y={};t.exports=y;var a=i(501),n=i(544),r=i(44);y.create=function(t){var e={controller:y,detector:n.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return r.extend(e,t)},y.update=function(t,e,i,n){for(var s,r,o,a=i.world,h=t.buckets,l=!1,u=i.metrics,c=u.broadphaseTests=0;ca.bounds.max.x||d.bounds.max.ya.bounds.max.y)){var f=y._getRegion(t,d);if(!d.region||f.id!==d.region.id||n){u.broadphaseTests+=1,d.region&&!n||(d.region=f);for(var p=y._regionUnion(f,d.region),g=p.startCol;g<=p.endCol;g++)for(s=p.startRow;s<=p.endRow;s++){r=h[o=y._getBucketId(g,s)];var v=g>=f.startCol&&g<=f.endCol&&s>=f.startRow&&s<=f.endRow,m=g>=d.region.startCol&&g<=d.region.endCol&&s>=d.region.startRow&&s<=d.region.endRow;!v&&m&&m&&r&&y._bucketRemoveBody(t,r,d),(d.region===f||v&&!m||n)&&(r=r||y._createBucket(h,o),y._bucketAddBody(t,r,d))}d.region=f,l=!0}}}l&&(t.pairsList=y._createActivePairsList(t))},y.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},y._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),n=Math.max(t.endCol,e.endCol),s=Math.min(t.startRow,e.startRow),r=Math.max(t.endRow,e.endRow);return y._createRegion(i,n,s,r)},y._getRegion=function(t,e){var i=e.bounds,n=Math.floor(i.min.x/t.bucketWidth),s=Math.floor(i.max.x/t.bucketWidth),r=Math.floor(i.min.y/t.bucketHeight),o=Math.floor(i.max.y/t.bucketHeight);return y._createRegion(n,s,r,o)},y._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},y._getBucketId=function(t,e){return"C"+t+"R"+e},y._createBucket=function(t,e){return t[e]=[]},y._bucketAddBody=function(t,e,i){for(var n=0;nl._pairMaxIdleLife&&a.push(h);for(h=0;hu.friction*u.frictionStatic*R*i&&(F=M,L=U.clamp(u.friction*O*i,-F,F));var D,k,I=X.cross(w,p),B=X.cross(b,p),N=m/(d.inverseMass+f.inverseMass+d.inverseInertia*I*I+f.inverseInertia*B*B);P*=N,L*=N,A<0&&A*A>Y._restingThresh*i?x.normalImpulse=0:(D=x.normalImpulse,x.normalImpulse=Math.min(x.normalImpulse+P,0),P=x.normalImpulse-D),C*C>Y._restingThreshTangent*i?x.tangentImpulse=0:(k=x.tangentImpulse,x.tangentImpulse=U.clamp(x.tangentImpulse+L,-F,F),L=x.tangentImpulse-k),n.x=p.x*P+g.x*L,n.y=p.y*P+g.y*L,d.isStatic||d.isSleeping||(d.positionPrev.x+=n.x*d.inverseMass,d.positionPrev.y+=n.y*d.inverseMass,d.anglePrev+=X.cross(w,n)*d.inverseInertia),f.isStatic||f.isSleeping||(f.positionPrev.x-=n.x*f.inverseMass,f.positionPrev.y-=n.y*f.inverseMass,f.anglePrev-=X.cross(b,n)*f.inverseInertia)}}}}},function(t,e,i){t.exports={BasePlugin:i(502),DefaultPlugins:i(184),PluginCache:i(23),PluginManager:i(381),ScenePlugin:i(1318)}},function(t,e,i){var n=i(502),s=i(0),r=i(20),o=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},function(t,e,i){var n=i(19),s=i(187),r=n(!1,r={Center:i(370),Events:i(94),Orientation:i(371),ScaleManager:i(382),ScaleModes:i(372),Zoom:i(373)},s.CENTER);r=n(!1,r,s.ORIENTATION),r=n(!1,r,s.SCALE_MODE),r=n(!1,r,s.ZOOM),t.exports=r},function(t,e,i){var n=i(133),s=i(19)(!1,s={Events:i(20),GetPhysicsPlugins:i(386),GetScenePlugins:i(387),SceneManager:i(384),ScenePlugin:i(1321),Settings:i(388),Systems:i(190)},n);t.exports=s},function(t,e,i){var n=i(17),s=i(0),a=i(20),h=i(2),r=i(23),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.pluginStart,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(a.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=h(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=h(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=h(t,"sleep",!1),this._willRemove=h(t,"remove",!1);var s=h(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=h(t,"onUpdateScope",this.scene));var r=h(t,"allowInput",!1);this.settings.transitionAllowInput=r;var o=i.sys.settings;return o.isTransition=!0,o.transitionFrom=this.scene,o.transitionDuration=n,o.transitionAllowInput=r,h(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):h(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(h(t,"data")):this.manager.start(e,h(t,"data")),this.systems.events.emit(a.TRANSITION_OUT,i,n),this.systems.events.on(a.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(a.UPDATE,this.step,this),t.events.emit(a.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(a.SHUTDOWN,this.shutdown,this),t.off(a.POST_UPDATE,this.step,this),t.off(a.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});r.register("ScenePlugin",o,"scenePlugin"),t.exports=o},function(t,e,i){t.exports={Events:i(405),List:i(137),Map:i(92),ProcessQueue:i(197),RTree:i(491),Set:i(141),Size:i(383)}},function(t,e,i){var n=i(19),s=i(1324),r=n(!1,r={CanvasTexture:i(390),Events:i(130),FilterMode:s,Frame:i(97),Parsers:i(392),Texture:i(192),TextureManager:i(389),TextureSource:i(391)},s);t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(149),Parsers:i(1355),Formats:i(33),ImageCollection:i(513),ParseToTilemap:i(240),Tile:i(75),Tilemap:i(522),TilemapCreator:i(1369),TilemapFactory:i(1370),Tileset:i(107),LayerData:i(105),MapData:i(106),ObjectLayer:i(516),DynamicTilemapLayer:i(523),StaticTilemapLayer:i(524)}},function(t,e,i){var p=i(24),g=i(53);t.exports=function(t,e,i,n,s,r,o,a){t<0&&(t=0),e<0&&(e=0),void 0===o&&(o=!0);for(var h=p(t,e,i,n,null,a),l=s-t,u=r-e,c=0;c=t&&l.index<=e&&u(l,i)}n&&c(0,0,s.width,s.height,s)}}},function(t,e,i){var a=i(65),h=i(53),l=i(153);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s=s.delay&&(n=s.elapsed-s.delay,s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),0>2],s+=o[(3&i[r])<<4|i[r+1]>>4],s+=o[(15&i[r+1])<<2|i[r+2]>>6],s+=o[63&i[r+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}},function(t,e,i){t.exports={Clone:i(69),Extend:i(19),GetAdvancedValue:i(15),GetFastValue:i(2),GetMinMaxValue:i(1395),GetValue:i(6),HasAll:i(1396),HasAny:i(422),HasValue:i(115),IsPlainObject:i(7),Merge:i(134),MergeRight:i(1397),Pick:i(514),SetValue:i(445)}},function(t,e,i){var o=i(6),a=i(17);t.exports=function(t,e,i,n,s){void 0===s&&(s=i);var r=o(t,e,s);return a(r,i,n)}},function(t,e){t.exports=function(t,e){for(var i=0;ii[e][0])&&(e=n);return!S(O(t,e-1),O(t,e),O(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var u=[],c=[];function M(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function O(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function P(t,e,i,n){for(var s=i;sn.deltaMax?n.deltaMax:e)/n.delta,n.delta=e),0!==n.timeScalePrev&&(r*=s.timeScale/n.timeScalePrev),0===s.timeScale&&(r=0),n.timeScalePrev=s.timeScale,n.correction=r,n.frameCounter+=1,1e3<=t-n.counterTimestamp&&(n.fps=n.frameCounter*((t-n.counterTimestamp)/1e3),n.counterTimestamp=t,n.frameCounter=0),T.update(i,e,r))},step:function(t,e){T.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==u.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return u.allBodies(this.localWorld)},getAllConstraints:function(){return u.allConstraints(this.localWorld)},getAllComposites:function(){return u.allComposites(this.localWorld)},postUpdate:function(){var t,e,i,n;this.drawDebug&&(t=this.debugConfig,e=this.engine,i=this.debugGraphic,n=u.allBodies(this.localWorld),this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(n,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(n),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(n,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(n,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor))},renderGrid:function(t,e,i,n){e.lineStyle(1,i,n);for(var s=y.keys(t.buckets),r=0;re.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,f="~";function s(){}function a(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var r=new a(i,n||t,s),o=f?f+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],r]:t._events[o].push(r):(t._events[o]=r,t._eventsCount++),t}function l(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(f=!1)),o.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(f?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},o.prototype.listeners=function(t){var e=f?f+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,r=new Array(s);n>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){e&&-1!==e||(e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));for(var i=t.createShader(t.FRAGMENT_SHADER),n=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");;){var s=n.replace(/%forloop%/gi,function(t){for(var e="",i=0;ir.width&&(i=Math.max(r.width-t,0)),e+n>r.height&&(n=Math.max(r.height-e,0));for(var l=[],u=e;uthis.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){var s=[];n.forEach(function(t){t&&s.push(t)}),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=s,this.complete=!1,this.pending=s.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var r=0;r=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),h=i(19),l=i(22),s=i(8),u=i(2),c=i(6),d=i(7),r=new n({Extends:l,initialize:function(t,e,i,n,s){var r,o="json";d(e)&&(e=u(r=e,"key"),i=u(r,"url"),n=u(r,"xhrSettings"),o=u(r,"extension",o),s=u(r,"dataKey",s));var a={type:"json",cache:t.cacheManager.json,extension:o,responseType:"text",key:e,url:i,xhrSettings:n,config:s};l.call(this,t,a),d(i)&&(this.data=s?c(i,s):i,this.state=h.FILE_POPULATED)},onProcess:function(){var t,e;this.state!==h.FILE_POPULATED&&(this.state=h.FILE_PROCESSING,t=JSON.parse(this.xhrLoader.responseText),e=this.config,this.data="string"==typeof e?c(t,e,t):t),this.onProcessComplete()}});s.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,s,r,o,a,h,l,u=e&&e.length,c=u?e[0]*i:t.length,d=g(t,0,c,i,!0),f=[];if(!d||d.next===d.prev)return f;if(u&&(d=function(t,e,i,n){var s,r,o,a,h,l=[];for(s=0,r=e.length;s=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&o=n.x&&n.x>=u&&s!==n.x&&T(ri.x||n.x===i.x&&function(t,e){return w(t.prev,t,e.prev)<0&&w(e.next,t,t.next)<0}(i,n)))&&(i=n,d=h)),n=n.next,n!==l;);return i}(t,e))&&(i=E(e,t),v(e,e.next),v(i,i.next))}}(l[s],i),i=v(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=r=t[0],s=o=t[1];for(var p=i;pr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=x(a,h,e,i,n),d=x(l,u,e,i,n),f=t.prevZ,p=t.nextZ;for(;f&&f.z>=c&&p&&p.z<=d;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;if(f=f.prevZ,p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}for(;f&&f.z>=c;){if(f!==t.prev&&f!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,f.x,f.y)&&0<=w(f.prev,f,f.next))return!1;f=f.prevZ}for(;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&T(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&0<=w(p.prev,p,p.next))return!1;p=p.nextZ}return!0}(t,n,s,r):function(t){var e=t.prev,i=t,n=t.next;if(0<=w(e,i,n))return!1;var s=t.next.next;for(;s!==t.prev;){if(T(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&0<=w(s.prev,s,s.next))return!1;s=s.next}return!0}(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),d(t),t=h.next,l=h.next;else if((t=h)===l){o?1===o?m(t=function(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!u(s,r)&&c(s,n,n.next,r)&&b(s,r)&&b(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),d(n),d(n.next),n=t=r),n=n.next}while(n!==t);return v(n)}(v(t),e,i),e,i,n,s,r,2):2===o&&function(t,e,i,n,s,r){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&c(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;for(;i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next,i!==t;);return n}(t,e)&&(w(t.prev,t,e.prev)||w(t,e.prev,e))||u(t,e)&&0=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function l(t){return 0c&&(c=u[d].vertexSize);var f=b(e,"batchSize",i.config.batchSize);this.vertexCapacity=6*f;var p=b(e,"vertices",new ArrayBuffer(this.vertexCapacity*c));for(this.vertexData=p,b(e,"vertices",null)?this.vertexBuffer=i.createVertexBuffer(p,t.STATIC_DRAW):this.vertexBuffer=i.createVertexBuffer(p.byteLength,t.DYNAMIC_DRAW),this.bytes=new Uint8Array(p),this.vertexViewF32=new Float32Array(p),this.vertexViewU32=new Uint32Array(p),this.renderer.setVertexBuffer(this.vertexBuffer),d=0;dthis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;var i=this.projectionMatrix;i&&i.ortho(0,t,e,0,-1e3,1e3);for(var n=this.renderTargets,s=0;s=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t;this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0,e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t;this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},function(t,e,i){var n=i(29),s=i(0),r=i(11),o=i(479),a=new s({Mixins:[r.Alpha,r.Flip,r.Visible],initialize:function(t,e,i,n,s,r,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=s,this.height=r,this.right,this.bottom,this.baseWidth=void 0!==o?o:s,this.baseHeight=void 0!==a?a:r,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,(this.collisionCallbackContext=this).tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){var t,e,i=this.layer.orientation;return i===n.ORTHOGONAL?(this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight):i===n.ISOMETRIC?(this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5):i===n.STAGGERED?(this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2)):i===n.HEXAGONAL&&(t=this.layer.hexSideLength,e=(this.baseHeight-t)/2+t,this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*e),this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},function(t,e){t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e,i){var h=i(103);t.exports=function(t,e,i,n){if(void 0===n&&(n=t),!Array.isArray(e))return-1!==(o=t.indexOf(e))?(h(t,o),i&&i.call(n,e),e):null;for(var s=e.length-1,r=[];0<=s;){var o,a=e[s];-1!==(o=t.indexOf(a))&&(h(t,o),r.push(a),i&&i.call(n,a)),s--}return r}},function(t,e,i){var n=i(0),s=i(191),r=i(9),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t=t||new r,void 0===e&&(e=16);var i=this.getLength();i=t.length)){for(var i=t.length-1,n=t[e],s=e;sh||a.y>l)?(u=Math.max(a.x,e),c=Math.max(a.y,i),b=d=Math.min(a.r,h)-u,E=f=Math.min(a.b,l)-c,T=r?p+(v-(u-a.x)-d):p+(u-a.x),w=o?g+(m-(c-a.y)-f):g+(c-a.y),e=u,i=c,n=d,s=f):E=b=w=T=0):(r&&(T=p+(v-e-n)),o&&(w=g+(m-i-s)));var A=this.source.width,_=this.source.height;return t.u0=Math.max(0,T/A),t.v0=Math.max(0,w/_),t.u1=Math.min(1,(T+b)/A),t.v1=Math.min(1,(w+E)/_),t.x=e,t.y=i,t.cx=T,t.cy=w,t.cw=b,t.ch=E,t.width=n,t.height=s,t.flipX=r,t.flipY=o,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,s,r){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=n,this.u1=s,this.v1=r,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new r(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=r},function(t,e,i){var s=i(199),n=i(0),r=i(1),o=i(90),a=new n({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?s.Add(this.list,t):s.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?s.AddAt(this.list,t,e):s.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(i,t){return i&&(void 0===t&&(t=function(t,e){return t[i]-e[i]}),o(this.list,t)),this},getByName:function(t){return s.GetFirst(this.list,"name",t)},getRandom:function(t,e){return s.GetRandom(this.list,t,e)},getFirst:function(t,e,i,n){return s.GetFirst(this.list,t,e,i,n)},getAll:function(t,e,i,n){return s.GetAll(this.list,t,e,i,n)},count:function(t,e){return s.CountAllMatching(this.list,t,e)},swap:function(t,e){s.Swap(this.list,t,e)},moveTo:function(t,e){return s.MoveTo(this.list,t,e)},remove:function(t,e){return e?s.Remove(this.list,t):s.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?s.RemoveAt(this.list,t):s.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?s.RemoveBetween(this.list,t,e):s.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return s.BringToTop(this.list,t)},sendToBack:function(t){return s.SendToBack(this.list,t)},moveUp:function(t){return s.MoveUp(this.list,t),t},moveDown:function(t){return s.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return s.Shuffle(this.list),this},replace:function(t,e){return s.Replace(this.list,t,e)},exists:function(t){return-1=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;ie.right||t.y>e.bottom)}},function(t,e,i){var n=i(0),r=i(12),u=i(37),s=new n({Extends:u,initialize:function(t,e,i,n,s,r,o,a,h,l){void 0===r&&(r=16777215),void 0===o&&(o=1),void 0===a&&(a=0),void 0===h&&(h=0),void 0===l&&(l=0),u.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=a,this.ny=h,this.nz=l,this.u=n,this.v=s,this.color=r,this.alpha=o,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,n){var s=this.x,r=this.y,o=this.z,a=t.val,h=s*a[0]+r*a[4]+o*a[8]+a[12],l=s*a[1]+r*a[5]+o*a[9]+a[13],u=s*a[2]+r*a[6]+o*a[10]+a[14],c=s*a[3]+r*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=n<=0?u/c:-u/c},update:function(t,e,i,n,s,r,o,a){var h=this.vx*t+this.vy*i+s,l=this.vx*e+this.vy*n+r;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,n,s){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=n,t[++i]=s,e[++i]=r.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=s},function(t,e){var i={};(t.exports=i).create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),s=Math.sin(e);i=i||{};var r=t.x*n-t.y*s;return i.y=t.x*s+t.y*n,i.x=r,i},i.rotateAbout=function(t,e,i,n){var s=Math.cos(e),r=Math.sin(e);n=n||{};var o=i.x+((t.x-i.x)*s-(t.y-i.y)*r);return n.y=i.y+((t.x-i.x)*r+(t.y-i.y)*s),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return(i=i||{}).x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return(i=i||{}).x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e){var i={};(t.exports=i).create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;nt.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i){return 0<=t&&t=this.firstgid&&th.getTotalFrames()&&(s=0),r=h.frames[s],0!==s||this.forward||(r=h.getLastFrame()),this.currentFrame=r):console.warn("Missing animation: "+a),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){var i,n;return this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e):(this.delayCounter=e,this.play(t,!0)),this.parent},playAfterRepeat:function(t,e){var i,n;return void 0===e&&(e=1),this.isPlaying?(i=this.nextAnim,n=this.nextAnimsQueue,i&&n.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e):this.play(t),this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent,s="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===s)return n;if(i&&this.isPlaying){var r=this.animationManager.getMix(i.key,t);if(0this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick))for(var n=0;this.forward?i.nextFrame(this):i.previousFrame(this),n++,this.accumulator>this.nextTick&&n<60;);}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(r.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new o(this,e,t),this.anims||(this.anims=new s),this.anims.set(e,i))),i},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=a},function(t,e,i){var n=i(0),s=i(2),r=i(860),o=i(861),a=i(24),z=i(12),h=i(74),l=i(75),u=new n({Extends:l,initialize:function(t){var e=t.game.renderer,i=s(t,"fragShader",r);t.fragShader=z.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=s(t,"vertShader",o),t.attributes=s(t,"attributes",[{name:"inPosition",size:2,type:h.FLOAT},{name:"inTexCoord",size:2,type:h.FLOAT},{name:"inTexId",size:1,type:h.FLOAT},{name:"inTintEffect",size:1,type:h.FLOAT},{name:"inTint",size:4,type:h.UNSIGNED_BYTE,normalized:!0}]),t.uniforms=s(t,"uniforms",["uProjectionMatrix","uMainSampler"]),l.call(this,t),this._tempMatrix1=new a,this._tempMatrix2=new a,this._tempMatrix3=new a},boot:function(){l.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var n,s=this._tempMatrix1,r=this._tempMatrix2,o=this._tempMatrix3,a=t.frame,h=a.glTexture,l=a.u0,u=a.v0,c=a.u1,d=a.v1,f=a.x,p=a.y,g=a.cutWidth,v=a.cutHeight,m=a.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;t.isCropped&&((n=t._crop).flipX===t.flipX&&n.flipY===t.flipY||a.updateCropUVs(n,t.flipX,t.flipY),l=n.u0,u=n.v0,c=n.u1,d=n.v1,g=n.width,v=n.height,T=-y+n.x,w=-x+n.y);var b=1,E=1;t.flipX&&(m||(T+=-a.realWidth+2*y),b=-1),(t.flipY||a.source.isGLTexture&&!h.flipY)&&(m||(w+=-a.realHeight+2*x),E=-1),r.applyITRS(t.x,t.y,t.rotation,t.scaleX*b,t.scaleY*E),s.copyFrom(e.matrix),i?(s.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),r.e=t.x,r.f=t.y):(r.e-=e.scrollX*t.scrollFactorX,r.f-=e.scrollY*t.scrollFactorY),s.multiply(r,o);var S=T+g,A=w+v,_=e.roundPixels,C=o.getXRound(T,w,_),M=o.getYRound(T,w,_),P=o.getXRound(T,A,_),R=o.getYRound(T,A,_),O=o.getXRound(S,A,_),L=o.getYRound(S,A,_),D=o.getXRound(S,w,_),F=o.getYRound(S,w,_),k=z.getTintAppendFloatAlpha,I=e.alpha,B=k(t.tintTopLeft,I*t._alphaTL),N=k(t.tintTopRight,I*t._alphaTR),Y=k(t.tintBottomLeft,I*t._alphaBL),X=k(t.tintBottomRight,I*t._alphaBR);this.shouldFlush(6)&&this.flush();var U=this.setGameObject(t,a);this.manager.preBatch(t),this.batchQuad(t,C,M,P,R,O,L,D,F,l,u,c,d,B,N,Y,X,t.tintEffect,h,U),this.manager.postBatch(t)},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,A,_,C,M,P,R,O){this.manager.set(this,t);var L,D,F,k,I,B=this._tempMatrix1,N=this._tempMatrix2,Y=this._tempMatrix3,X=m/i+_,U=y/n+C,z=(m+x)/i+_,G=(y+T)/n+C,W=o,V=a,H=-g,j=-v;t.isCropped&&(o=W=D=(L=t._crop).width,a=V=F=L.height,k=m=L.x,I=y=L.y,c&&(k=x-L.x-D),d&&(I=T-L.y-F),X=k/i+_,U=I/n+C,z=(k+D)/i+_,G=(I+F)/n+C,H=-g+m,j=-v+y),c&&(W*=-1,H+=o),(d^=!R&&e.isRenderTexture?1:0)&&(V*=-1,j+=a);var q=H+W,K=j+V;N.applyITRS(s,r,u,h,l),B.copyFrom(M.matrix),P?(B.multiplyWithOffset(P,-M.scrollX*f,-M.scrollY*p),N.e=s,N.f=r):(N.e-=M.scrollX*f,N.f-=M.scrollY*p),B.multiply(N,Y);var Z=M.roundPixels,J=Y.getXRound(H,j,Z),Q=Y.getYRound(H,j,Z),$=Y.getXRound(H,K,Z),tt=Y.getYRound(H,K,Z),et=Y.getXRound(q,K,Z),it=Y.getYRound(q,K,Z),nt=Y.getXRound(q,j,Z),st=Y.getYRound(q,j,Z);void 0===O&&(O=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,nt,st,X,U,z,G,w,b,E,S,A,e,O),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,n,s,r,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,u=i+t.height;o?a.multiply(o,h):h=a;var c=h.getX(e,i),d=h.getY(e,i),f=h.getX(e,u),p=h.getY(e,u),g=h.getX(l,u),v=h.getY(l,u),m=h.getX(l,i),y=h.getY(l,i),x=this.renderer.setTextureSource(t.source);n=z.getTintAppendFloatAlpha(n,s),this.batchQuad(null,c,d,f,p,g,v,m,y,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,x)}});t.exports=u},function(t,e,i){var c={};t.exports=c;var o=i(266),r=i(50),a=i(115),d=i(68);c.create=function(t){return r.extend({id:r.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},c.setModified=function(t,e,i,n){if(o.trigger(t,"compositeModified",t),t.isModified=e,i&&t.parent&&c.setModified(t.parent,e,i,n),n)for(var s=0;s=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(1+(s-r)).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=i(319),s=i(322),r=i(323),o=i(324);t.exports=function(t){switch(typeof t){case"string":return("rgb"===t.substr(0,3).toLowerCase()?o:n)(t);case"number":return s(t);case"object":return r(t)}}},function(t,e,i){var a=i(100);function h(t,e,i,n){var s=(t+6*e)%6,r=Math.min(s,4-s,1);return Math.round(255*(n-n*i*Math.max(0,r)))}t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1);var s=h(5,t,e,i),r=h(3,t,e,i),o=h(1,t,e,i);return n?n.setTo?n.setTo(s,r,o,n.alpha,!1):(n.r=s,n.g=r,n.b=o,n.color=a(s,r,o),n):{r:s,g:r,b:o,color:a(s,r,o)}}},function(t,e){t.exports=function(t){return 16777215>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){var n=i(102),r=i(131),o=i(31),a={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){a.canvas=!!window.CanvasRenderingContext2D;try{a.localStorage=!!localStorage.getItem}catch(t){a.localStorage=!1}a.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),a.fileSystem=!!window.requestFileSystem;var t,e,i,s=!1;return a.webGL=function(){if(window.WebGLRenderingContext)try{var t=o.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=o.create2D(this),n=i.getContext("2d").createImageData(1,1);return s=n.data instanceof Uint8ClampedArray,o.remove(t),o.remove(i),!!e}catch(t){return!1}return!1}(),a.worker=!!window.Worker,a.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,a.getUserMedia=a.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(a.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(a.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(a.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(a.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(a.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),a.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==a.littleEndian&&s,a}()},function(t,e){var i="";function n(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;ic.width&&(t=c.width-d.cutX),d.cutY+e>c.height&&(e=c.height-d.cutY),d.setSize(t,e,d.cutX,d.cutY)),this.updateDisplayOrigin();var f=this.input;return f&&!f.customHitArea&&(f.hitArea.width=t,f.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=o.cutWidth),void 0===r&&(r=o.cutHeight);var l,u,c,d,f,p,g=(t>>16&255)/255,v=(t>>8&255)/255,m=(255&t)/255,y=this.renderTarget;return a.preRender(),y?(y.bind(!0),(l=this.pipeline).manager.set(l),u=y.width,c=y.height,d=h.width/u,f=h.height/c,l.drawFillRect(i*d,n*f,s*d,r*f,x.getTintFromFloats(m,v,g,1),e),y.unbind(!0)):(p=this.context,h.setContext(p),p.fillStyle="rgba("+g+","+v+","+m+","+e+")",p.fillRect(i+o.cutX,n+o.cutY,s,r),h.setContext()),this.dirty=!0,this},clear:function(){var t,e;return this.dirty&&((t=this.renderTarget)?t.clear():((e=this.context).save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()),this.dirty=!1),this},erase:function(t,e,i){this._eraseMode=!0;var n=this.renderer.currentBlendMode;return this.renderer.setBlendMode(o.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(n),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.camera,o=this.renderer,a=this.renderTarget;return r.preRender(),a?(a.bind(!0),o.resetTextures(!0),this.batchList(t,e,i,n,s),a.unbind(!0)):(o.setContext(this.context),this.batchList(t,e,i,n,s),o.setContext()),this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.camera,a=this.renderTarget,h=this.textureManager.getFrame(t,e);return h&&(o.preRender(),a?(a.bind(!0),this.pipeline.batchTextureFrame(h,i,n,r,s,o.matrix,null),a.unbind(!0)):this.batchTextureFrame(h,i+this.frame.cutX,n+this.frame.cutY,s,r),this.dirty=!0),this},batchList:function(t,e,i,n,s){for(var r=0;rs&&(r=t[s]),n[s]=r,t.length>s+1&&(r=t[s+1]),n[s+1]=r;return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var n=0;if(t.length===e)for(r=0;rn&&(s=t[n]),i[n]=s,t.length>n+1&&(s=t[n+1]),i[n+1]=s;return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var n,s,r,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(r=-this.frame.halfWidth,s=this.frame.width/(o-1),n=0;n=this._markerOut&&(e.loop?(e.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=t,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))},checkVideoProgress:function(){2<=this.video.readyState?this.updateTexture():(this.retry--,0e._dx?r<(s=t.right-e.x)&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==o.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==o.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxe._dy?r<(s=t.bottom-e.y)&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==o.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==o.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dy=t.right||e.position.y>=t.bottom)}},function(t,e,i){var w={};t.exports=w;var o=i(93),b=i(114),a=i(265),h=i(115),l=i(581),u=i(50);w._warming=.4,w._torqueDampen=1,w._minLength=1e-6,w.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?b.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?b.add(e.bodyB.position,e.pointB):e.pointB,s=b.magnitude(b.sub(i,n));e.length=void 0!==e.length?e.length:s,e.id=e.id||u.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(0t&&(t=s.totalDuration),s.delay=o.sleepThreshold&&u.set(o,!0)):0u._motionWakeThreshold*i&&u.set(a,!1)))}},u.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||n.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&n.trigger(t,"sleepEnd"))}},function(t,e,i){var n={};t.exports=n;var u=i(50);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r=t.right&&(o=1,r+=s-t.right,s=t.right);break;case 1:(r+=e)>=t.bottom&&(o=2,s-=r-t.bottom,r=t.bottom);break;case 2:(s-=e)<=t.left&&(o=3,r-=t.left-s,s=t.left);break;case 3:(r-=e)<=t.top&&(o=0,r=t.top)}return n}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var n=Math.round(t.x1),s=Math.round(t.y1),r=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(r-n),h=Math.abs(o-s),l=ne.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===s&&(s=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=s},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t){var i=/\D/g;return t.sort(function(t,e){return parseInt(t.replace(i,""),10)-parseInt(e.replace(i,""),10)}),t}},function(t,e,i){var n=i(177),s=i(0),r=i(98),o=i(10),a=i(128),h=i(23),T=i(2),d=i(6),f=i(178),p=i(314),l=new s({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new r,this.mixes=new r,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var n,s=this.anims,r=this.mixes,o="string"==typeof t?t:t.key,a="string"==typeof e?e:e.key;return s.has(o)&&s.has(a)&&((n=(n=r.get(o))||{})[a]=i,r.set(o,n)),this},removeMix:function(t,e){var i,n=this.mixes,s="string"==typeof t?t:t.key,r=n.get(s);return r&&(e?(i="string"==typeof e?e:e.key,r.hasOwnProperty(i)&&delete r[i]):e||n.delete(s)),this},getMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,s="string"==typeof e?e:e.key,r=i.get(n);return r&&r.hasOwnProperty(s)?r[s]:0},add:function(t,e){return this.anims.has(t)?console.warn("Animation key exists: "+t):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e)),this},exists:function(t){return this.anims.has(t)},createFromAseprite:function(g,v){var m=[],t=this.game.cache.json.get(g);if(!t)return m;var y=this,e=d(t,"meta",null),x=d(t,"frames",null);return e&&x&&d(e,"frameTags",[]).forEach(function(t){var e=[],i=T(t,"name",null),n=T(t,"from",0),s=T(t,"to",0),r=T(t,"direction","forward");if(i&&(!v||v&&-1l.right&&(u=E(u,u+(d-l.right),this.lerp.x)),fl.bottom&&(c=E(c,c+(f-l.bottom),this.lerp.y))):(u=E(u,d-o,this.lerp.x),c=E(c,f-a,this.lerp.y)),p=!0),this.useBounds&&(u=this.clampX(u),c=this.clampY(c)),this.roundPixels&&(o=Math.round(o),a=Math.round(a),u=Math.round(u),c=Math.round(c));var g=(this.scrollX=u)+i,v=(this.scrollY=c)+n;this.midPoint.set(g,v);var m=t/s,y=e/s,x=g-m/2,T=v-y/2;this.roundPixels&&(x=Math.round(x),T=Math.round(T)),this.worldView.setTo(x,T,m,y),r.applyITRS(this.x+o,this.y+a,this.rotation,s,s),r.translate(-o,-a),this.shakeEffect.preRender(),p&&this.emit(b.FOLLOW_UPDATE,this,h)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=u(i,0,1),n=u(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var o=this.width/2,a=this.height/2,h=t.x-s,l=t.y-r;return this.midPoint.set(h,l),this.scrollX=h-o,this.scrollY=l-a,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),s.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=l},function(t,e,i){var o=i(36);t.exports=function(t){var e=new o;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i,n,s,r=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r&&(i=parseInt(r[1],16),n=parseInt(r[2],16),s=parseInt(r[3],16),e.setTo(i,n,s)),e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(er[0]&&(e=1),r[8]>r[3*e+e]&&(e=2),i=a[e],n=a[i],s=Math.sqrt(r[3*e+e]-r[3*i+i]-r[3*n+n]+1),h[e]=.5*s,s=.5/s,h[i]=(r[3*i+e]+r[3*e+i])*s,h[n]=(r[3*n+e]+r[3*e+n])*s,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(r[3*n+i]-r[3*i+n])*s),this.onChangeCallback(this),this}});t.exports=f},function(t,e,a){var h=a(359),l=a(31),u=a(39),c=a(183);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===u.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==u.HEADLESS)if(e.renderType===u.CANVAS||e.renderType!==u.CANVAS&&!c.webGL){if(!c.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=u.CANVAS}else e.renderType=u.WEBGL;e.antialias||l.disableSmoothing();var i,n,s=t.scale.baseSize,r=s.width,o=s.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=r,t.canvas.height=o):t.canvas=l.create(t,r,o,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||h.setCrisp(t.canvas),e.renderType!==u.HEADLESS&&(i=a(568),n=a(571),e.renderType===u.WEBGL?t.renderer=new n(t):(t.renderer=new i(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(e){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(t){e.style["image-rendering"]=t}),e.style.msInterpolationMode="nearest-neighbor",e},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var l=i(39);t.exports=function(t){var e,i,n,s,r,o,a,h=t.config;h.hideBanner||(e="WebGL",h.renderType===l.CANVAS?e="Canvas":h.renderType===l.HEADLESS&&(e="Headless"),i=h.audio,a=(n=t.device.audio).webAudio&&!i.disableWebAudio?"Web Audio":i.noAudio||!n.webAudio&&!n.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie?window.console&&console.log("Phaser v"+l.VERSION+" / https://phaser.io"):(r=[s=""],Array.isArray(h.bannerBackgroundColor)?(h.bannerBackgroundColor.forEach(function(t){s=s.concat("%c "),r.push("background: "+t),o=t}),r[r.length-1]="color: "+h.bannerTextColor+"; background: "+o):(s=s.concat("%c "),r.push("color: "+h.bannerTextColor+"; background: "+h.bannerBackgroundColor)),r.push("background: #fff"),h.gameTitle&&(s=s.concat(h.gameTitle),h.gameVersion&&(s=s.concat(" v"+h.gameVersion)),h.hidePhaser||(s=s.concat(" / "))),h.hidePhaser||(s=s.concat("Phaser v"+l.VERSION+" ("+e+" | "+a+")")),s=s.concat(" %c "+h.gameURL),r[0]=s,console.log.apply(console,r)))}},function(t,e,i){var n=i(0),s=i(6),r=i(1),o=i(362),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=s(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3;for(var e=this.framesThisSecond=0;ethis._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var a=o=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var n=this;this.step=function t(){var e=window.performance.now();n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.requestAnimationFrame(t)},this.stepTimeout=function t(){var e=Date.now(),i=Math.min(Math.max(2*n.target+n.tick-e,0),n.target);n.lastTime=n.tick,n.tick=e,n.callback(e),n.timeOutID=window.setTimeout(t,i)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(23);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var m=i(365),y=i(31),x=i(6);t.exports=function(t){var e=x(t,"data",[]),i=x(t,"canvas",null),n=x(t,"palette",m),s=x(t,"pixelWidth",1),r=x(t,"pixelHeight",s),o=x(t,"resizeCanvas",!0),a=x(t,"clearCanvas",!0),h=x(t,"preRender",null),l=x(t,"postRender",null),u=Math.floor(Math.abs(e[0].length*s)),c=Math.floor(Math.abs(e.length*r));i||(i=y.create2D(this,u,c),a=o=!1),o&&(i.width=u,i.height=c);var d=i.getContext("2d");a&&d.clearRect(0,0,u,c),h&&h(i,d);for(var f=0;fi.length-2?i.length-1:s+1],l=i[s>i.length-3?i.length-1:s+2];return e.set(u(r,o.x,a.x,h.x,l.x),u(r,o.y,a.y,h.y,l.y))},toJSON:function(){for(var t=[],e=0;ethis.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var e=this.listeners;window.removeEventListener("orientationchange",e.orientationChange,!1),window.removeEventListener("resize",e.windowResize,!1);["webkit","moz",""].forEach(function(t){document.removeEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.removeEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",e.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===u.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===u.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(16),s=i(0),r=i(72),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,0r.START&&n.settings.status<=r.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status=r.x&&t=r.y&&e=r.x&&t=r.y&&e=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s>4,l[a++]=(15&i)<<4|n>>2,l[a++]=(3&n)<<6|63&s;return h}},function(t,e,i){var n=i(142),s=i(0),r=i(66),o=new s({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime>>16,g=(65280&c)>>>8,v=255&c,h.strokeStyle="rgba("+p+","+g+","+v+","+l+")",h.lineWidth=f,m+=3;break;case y.FILL_STYLE:d=o[m+1],u=o[m+2],p=(16711680&d)>>>16,g=(65280&d)>>>8,v=255&d,h.fillStyle="rgba("+p+","+g+","+v+","+u+")",m+=2;break;case y.BEGIN_PATH:h.beginPath();break;case y.CLOSE_PATH:h.closePath();break;case y.FILL_PATH:r||h.fill();break;case y.STROKE_PATH:r||h.stroke();break;case y.FILL_RECT:r?h.rect(o[m+1],o[m+2],o[m+3],o[m+4]):h.fillRect(o[m+1],o[m+2],o[m+3],o[m+4]),m+=4;break;case y.FILL_TRIANGLE:h.beginPath(),h.moveTo(o[m+1],o[m+2]),h.lineTo(o[m+3],o[m+4]),h.lineTo(o[m+5],o[m+6]),h.closePath(),r||h.fill(),m+=6;break;case y.STROKE_TRIANGLE:h.beginPath(),h.moveTo(o[m+1],o[m+2]),h.lineTo(o[m+3],o[m+4]),h.lineTo(o[m+5],o[m+6]),h.closePath(),r||h.stroke(),m+=6;break;case y.LINE_TO:h.lineTo(o[m+1],o[m+2]),m+=2;break;case y.MOVE_TO:h.moveTo(o[m+1],o[m+2]),m+=2;break;case y.LINE_FX_TO:h.lineTo(o[m+1],o[m+2]),m+=5;break;case y.MOVE_FX_TO:h.moveTo(o[m+1],o[m+2]),m+=5;break;case y.SAVE:h.save();break;case y.RESTORE:h.restore();break;case y.TRANSLATE:h.translate(o[m+1],o[m+2]),m+=2;break;case y.SCALE:h.scale(o[m+1],o[m+2]),m+=2;break;case y.ROTATE:h.rotate(o[m+1]),m+=1;break;case y.GRADIENT_FILL_STYLE:m+=5;break;case y.GRADIENT_LINE_STYLE:m+=6}}h.restore()}}},function(t,e,i){var n=i(0),s=i(132),r=i(78),o=i(2),a=i(64),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t,e,i,n=this.propertyValue,s=typeof n;return this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"==s?(this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate):Array.isArray(n)?this.onEmit=this.randomStaticValueEmit:"function"==s?this.emitOnly?this.onEmit=n:this.onUpdate=n:"object"==s&&this.hasBoth(n,"start","end")?(this.start=n.start,this.end=n.end,(t=this.has(n,"random"))&&(this.onEmit=this.randomRangedValueEmit),this.has(n,"steps")?(this.steps=n.steps,this.counter=this.start,this.onEmit=this.steppedEmit):(e=this.has(n,"ease")?n.ease:"Linear",this.ease=r(e,n.easeParams),t||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate)):"object"==s&&this.hasBoth(n,"min","max")?(this.start=n.min,this.end=n.max,this.onEmit=this.randomRangedValueEmit):"object"==s&&this.has(n,"random")?(i=n.random,Array.isArray(i)&&(this.start=i[0],this.end=i[1]),this.onEmit=this.randomRangedValueEmit):"object"==s&&this.hasEither(n,"onEmit","onUpdate")&&(this.has(n,"onEmit")&&(this.onEmit=n.onEmit),this.has(n,"onUpdate")&&(this.onUpdate=n.onUpdate)),this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){var i;return t&&t.data[e]&&((i=t.data[e]).min=this.start,i.max=this.end),this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(0),o=i(2),s=new n({initialize:function(t,e,i,n,s){var r;"object"==typeof t?(t=o(r=t,"x",0),e=o(r,"y",0),i=o(r,"power",0),n=o(r,"epsilon",100),s=o(r,"gravity",50)):(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50)),this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i,n,s=this.x-t.x,r=this.y-t.y,o=s*s+r*r;0!==o&&(i=Math.sqrt(o),oe.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(0this._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;id.PI2?s=d.PI2:s<0&&(s=d.PI2+s%d.PI2);for(var a,h=[r+Math.cos(n)*i,o+Math.sin(n)*i];e<1;)a=s*e+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),e+=t;return a=s+n,h.push(r+Math.cos(a)*i,o+Math.sin(a)*i),h.push(r+Math.cos(n)*i,o+Math.sin(n)*i),this.pathIndexes=u(h),this.pathData=h,this}});t.exports=r},function(t,e,i){var n=i(0),s=i(1083),r=i(65),o=i(9),a=i(33),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;st.right||e.rightt.bottom||e.bottome.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottomt.width*t.height)&&(e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var a=i(486),h=i(487),n=i(0),l=i(10),u=i(3),s=new n({Extends:l,initialize:function(t,e){l.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],n=0;n=s;for(this.fixedStep||(n=.001*e,o=!0,this._elapsed=0),h=0;h=s;)this._elapsed-=s,this.step(n)}},step:function(t){for(var e,i=this.bodies.entries,n=i.length,s=0;sc)&&(d.xu))return this.separateCircle(t,e,s)}var f=!1,p=!1;s?(f=M(t,e,s,this.OVERLAP_BIAS),p=P(t,e,s,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=p(t.center.x,e.left,e.right),n=p(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var a=Array.isArray(t),h=Array.isArray(e);if(this._total=0,a||h)if(!a&&h)for(o=0;od.baseTileWidth&&(h-=a=(d.tileWidth-d.baseTileWidth)*e.scaleX,u+=a),d.tileHeight>d.baseTileHeight&&(c+=(d.tileHeight-d.baseTileHeight)*e.scaleY);var f=S(h,l,u,c,null,e.scene.cameras.main,e.layer);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,u={left:0,right:0,top:0,bottom:0},c=!1,d=0;de.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,r=this.blocked.right=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,r=this.blocked.down=!0),r&&(this.blocked.none=!1,this.updateCenter()),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n,s,r=this.gameObject;return!t&&r.frame&&(t=r.frame.realWidth),!e&&r.frame&&(e=r.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&r.getCenter&&(n=(r.width-t)/2,s=(r.height-e)/2,this.offset.set(n,s)),this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),0=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return 0=t.minX&&e.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,n,s){for(var r,o=[e,i];o.length;)(i=o.pop())-(e=o.pop())<=n||(r=e+Math.ceil((i-e)/n/2)*n,a(t,r,e,i,s),o.push(e,r,r,i))}n.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!l(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;sthis._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),o=p(i.children.splice(r,i.children.length-r));o.height=i.height,o.leaf=i.leaf,f(i,this.toBBox),f(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(t,e){this.data=p([t,e]),this.data.height=t.height+1,this.data.leaf=!1,f(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){for(var n,s,r,o,a,h,l,u,c,d,f,p,g=a=1/0,v=e;v<=i-e;v++)n=m(t,0,v,this.toBBox),s=m(t,v,i,this.toBBox),l=n,u=s,p=f=d=c=void 0,c=Math.max(l.minX,u.minX),d=Math.max(l.minY,u.minY),f=Math.min(l.maxX,u.maxX),p=Math.min(l.maxY,u.maxY),r=Math.max(0,f-c)*Math.max(0,p-d),o=y(n)+y(s),re.deltaAbsY()?g=-1:e.deltaAbsX()i&&s<(o=t.right-i)&&(o=0),0!==o&&(t.customSeparateX?t.overlapX=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):0i&&s<(o=t.bottom-i)&&(o=0),0!==o&&(t.customSeparateY?t.overlapY=o:c(t,o)),o}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):0n.worldView.x+s.scaleX*i.tileWidth*(-r-.5)&&a.xn.worldView.y+s.scaleY*i.tileHeight*(-o-1)&&a.y=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r,o,a=n.layers[n.i];n.i++,"imagelayer"===a.type?(s=h(a,"offsetx",0)+h(a,"startx",0),r=h(a,"offsety",0)+h(a,"starty",0),e.push({name:n.name+a.name,image:a.image,x:n.x+s+a.x,y:n.y+r+a.y,alpha:n.opacity*a.opacity,visible:n.visible&&a.visible,properties:h(a,"properties",{})})):"group"===a.type&&(o=l(t,a,n),i.push(n),n=o)}return e}},function(t,e,i){var d=i(2),f=i(251),p=i(551),g=i(154);t.exports=function(t){for(var e=[],i=[],n=g(t);n.i=n.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}n=i.pop()}else{var s,r=n.layers[n.i];if(n.i++,r.opacity*=n.opacity,r.visible=n.visible&&r.visible,"objectgroup"===r.type){r.name=n.name+r.name;for(var o=n.x+d(r,"startx",0)+d(r,"offsetx",0),a=n.y+d(r,"starty",0)+d(r,"offsety",0),h=[],l=0;l=r.layers.length){if(s.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}r=s.pop()}else{var o,a=r.layers[r.i];if(r.i++,"tilelayer"===a.type)if(a.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+a.name+"'");else{if(a.encoding&&"base64"===a.encoding){if(a.chunks)for(var h=0;h>>0;return n}},function(t,e,i){var w=i(119),b=i(555),E=i(251);t.exports=function(t){for(var e,i=[],n=[],s=null,r=0;r=this.firstgid&&tn&&(n=e.layer[r].width),e.layer[r].height>s&&(s=e.layer[r].height);var o=new h({width:n,height:s,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:a.WELTMEISTER});return o.layers=l(e,i),o.tilesets=u(e),o}},function(t,e,i){var d=i(117),f=i(81);t.exports=function(t,e){for(var i=[],n=0;n>>0;if("function"!=typeof t)throw new TypeError;for(var n=2<=arguments.length?arguments[1]:void 0,s=0;sthis.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001)))},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(318),BaseCamera:i(99),CameraManager:i(767),Effects:i(325),Events:i(35)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="followupdate"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerarotatecomplete"},function(t,e){t.exports="camerarotatestart"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(16),s=i(0),l=i(35),r=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,r,o,a){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a;var h=t?l.FADE_OUT_START:l.FADE_IN_START;return this.camera.emit(h,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsedthis.source?Math.abs(this.destination-this.source):Math.abs(this.destination+h)-this.source)<(u=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+h)-this.destination)?this.clockwise=!0:uMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(132);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){var n=i(132);t.exports=function(){return n(-180,180)}},function(t,e,i){var n=i(343);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(13);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},function(t,e){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){t.exports="removetexture"},function(t,e,i){t.exports={GenerateTexture:i(364),Palettes:i(875)}},function(t,e,i){t.exports={ARNE16:i(365),C64:i(876),CGA:i(877),JMP:i(878),MSX:i(879)}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){t.exports={Path:i(881),MoveTo:i(369),CubicBezier:i(366),Curve:i(88),Ellipse:i(367),Line:i(368),QuadraticBezier:i(370),Spline:i(371)}},function(t,e,i){var n=i(0),u=i(366),l=i(367),s=i(5),r=i(368),o=i(369),a=i(370),h=i(9),c=i(371),d=i(3),f=i(13),p=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new r(e,t)),this},cubicBezierTo:function(t,e,i,n,s,r){var o,a,h=this.getEndPoint(),l=t instanceof d?(o=t,a=e,i):(o=new d(i,n),a=new d(s,r),new d(t,e));return this.add(new u(h,o,a,l))},quadraticBezierTo:function(t,e,i,n){var s,r=this.getEndPoint(),o=t instanceof d?(s=t,e):(s=new d(i,n),new d(t,e));return this.add(new a(r,s,o))},draw:function(t,e){for(var i=0;i=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getTangentAt(h,e)}s++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new r([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new o(t.x,t.y)):this.add(new o(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return 16777215>>24),e}},function(t,e,i){var h=i(36),l=i(375);t.exports=function(t,e,i){var n,s,r=i,o=i,a=i;return 0!==e&&(r=l(s=2*i-(n=i<.5?i*(1+e):i+e-i*e),n,t+1/3),o=l(s,n,t),a=l(s,n,t-1/3)),(new h).setGLTo(r,o,a,1)}},function(t,e,i){var s=i(180);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],n=0;n<=359;n++)i.push(s(n/359,t,e));return i}},function(t,e,i){function o(t,e,i,n,s,r,o,a){void 0===o&&(o=100),void 0===a&&(a=0);var h=a/o;return{r:l(t,n,h),g:l(e,s,h),b:l(i,r,h)}}var l=i(130);t.exports={RGBWithRGB:o,ColorWithRGB:function(t,e,i,n,s,r){return void 0===s&&(s=100),void 0===r&&(r=0),o(t.r,t.g,t.b,e,i,n,s,r)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),o(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(187),s=i(36);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var r=i(374);t.exports=function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+r(n)+r(t)+r(e)+r(i)}},function(t,e,i){t.exports={BitmapMask:i(302),GeometryMask:i(303)}},function(t,e,i){var n={AddToDOM:i(137),DOMContentLoaded:i(377),GetInnerHeight:i(378),GetScreenOrientation:i(379),GetTarget:i(384),ParseXML:i(385),RemoveFromDOM:i(193),RequestAnimationFrame:i(362)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(905)}},function(t,e,i){var n=i(0),s=i(10),r=i(25),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(137),s=i(313),r=i(317),o=i(31),a=i(0),h=i(338),l=i(907),u=i(358),c=i(97),d=i(360),f=i(339),p=i(377),g=i(10),v=i(23),m=i(386),y=i(25),x=i(391),T=i(392),w=i(394),b=i(136),E=i(399),S=i(361),A=i(363),_=i(403),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=_.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),A(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(137);t.exports=function(t){var e,i=t.config;i.parent&&i.domCreateContainer&&((e=document.createElement("div")).style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=e,n(e,i.parent))}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s=i.getElementsByTagName("SubTexture"),r=0;r=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,s=t.indexOf(e);return-1!==s&&st.length-1)throw new Error("Index out of bounds");var s=r(t,e);return i&&i.call(n,s),s}},function(t,e,i){var l=i(77);t.exports=function(t,e,i,n,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),l(t,e,i)){var r=i-e,o=t.splice(e,r);if(n)for(var a=0;a?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var P=i(6);t.exports=function(t,e){var i=e.width,n=e.height,s=Math.floor(i/2),r=Math.floor(n/2),o=P(e,"chars","");if(""!==o){var a=P(e,"image",""),h=t.sys.textures.getFrame(a),l=h.cutX,u=h.cutY,c=h.source.width,d=h.source.height,f=P(e,"offset.x",0),p=P(e,"offset.y",0),g=P(e,"spacing.x",0),v=P(e,"spacing.y",0),m=P(e,"lineSpacing",0),y=P(e,"charsPerRow",null);null===y&&(y=c/i)>o.length&&(y=o.length);for(var x=f,T=p,w={retroFont:!0,font:a,size:i,lineHeight:n+m,chars:{}},b=0,E=0;E=i&&t.x<=n&&t.y>=s&&t.y<=r}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||s=n&&(p.push(v),f=v)}var m=o[o.length-1];return y(f,m)i&&(i=a.x),a.xs&&(s=a.y),a.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var r=i(9);t.exports=function(t,e,i,n,s){return void 0===s&&(s=new r),s.setTo(Math.min(t,i),Math.min(e,n),Math.abs(t-i),Math.abs(e-n))}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var r=i(182);t.exports=function(t,e,i){var n=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),r(t,n,s)}},function(t,e,i){var n=i(9),s=i(112);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var a=i(4),h=i(34);t.exports=function(t,e,i){void 0===i&&(i=new a),e=h(e);var n=Math.sin(e),s=Math.cos(e),r=0=s||0=t.downTime+n)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],s=this;try{var r=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return s.state=o.FILE_ERRORED,void s.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){l.revokeObjectURL(s.data),s.onProcessComplete()},this.data.onerror=function(){l.revokeObjectURL(s.data),s.onProcessError()},l.createObjectURL(this.data,r,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});s.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r=n[2];if("^"===i.operator)return 0=i.number:0=n[2]:r[2]===n[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var s=i(159),r=(i(241),i(50));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){var y={};t.exports=y;var a=i(518),n=i(583),r=i(50);y.create=function(t){var e={controller:y,detector:n.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return r.extend(e,t)},y.update=function(t,e,i,n){for(var s,r,o,a=i.world,h=t.buckets,l=!1,u=i.metrics,c=u.broadphaseTests=0;ca.bounds.max.x||d.bounds.max.ya.bounds.max.y)){var f=y._getRegion(t,d);if(!d.region||f.id!==d.region.id||n){u.broadphaseTests+=1,d.region&&!n||(d.region=f);for(var p=y._regionUnion(f,d.region),g=p.startCol;g<=p.endCol;g++)for(s=p.startRow;s<=p.endRow;s++){r=h[o=y._getBucketId(g,s)];var v=g>=f.startCol&&g<=f.endCol&&s>=f.startRow&&s<=f.endRow,m=g>=d.region.startCol&&g<=d.region.endCol&&s>=d.region.startRow&&s<=d.region.endRow;!v&&m&&m&&r&&y._bucketRemoveBody(t,r,d),(d.region===f||v&&!m||n)&&(r=r||y._createBucket(h,o),y._bucketAddBody(t,r,d))}d.region=f,l=!0}}}l&&(t.pairsList=y._createActivePairsList(t))},y.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},y._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),n=Math.max(t.endCol,e.endCol),s=Math.min(t.startRow,e.startRow),r=Math.max(t.endRow,e.endRow);return y._createRegion(i,n,s,r)},y._getRegion=function(t,e){var i=e.bounds,n=Math.floor(i.min.x/t.bucketWidth),s=Math.floor(i.max.x/t.bucketWidth),r=Math.floor(i.min.y/t.bucketHeight),o=Math.floor(i.max.y/t.bucketHeight);return y._createRegion(n,s,r,o)},y._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},y._getBucketId=function(t,e){return"C"+t+"R"+e},y._createBucket=function(t,e){return t[e]=[]},y._bucketAddBody=function(t,e,i){for(var n=0;nl._pairMaxIdleLife&&a.push(h);for(h=0;hu.friction*u.frictionStatic*O*i&&(D=M,L=U.clamp(u.friction*P*i,-D,D));var F,k,I=X.cross(w,p),B=X.cross(b,p),N=m/(d.inverseMass+f.inverseMass+d.inverseInertia*I*I+f.inverseInertia*B*B);R*=N,L*=N,_<0&&_*_>Y._restingThresh*i?x.normalImpulse=0:(F=x.normalImpulse,x.normalImpulse=Math.min(x.normalImpulse+R,0),R=x.normalImpulse-F),C*C>Y._restingThreshTangent*i?x.tangentImpulse=0:(k=x.tangentImpulse,x.tangentImpulse=U.clamp(x.tangentImpulse+L,-D,D),L=x.tangentImpulse-k),n.x=p.x*R+g.x*L,n.y=p.y*R+g.y*L,d.isStatic||d.isSleeping||(d.positionPrev.x+=n.x*d.inverseMass,d.positionPrev.y+=n.y*d.inverseMass,d.anglePrev+=X.cross(w,n)*d.inverseInertia),f.isStatic||f.isSleeping||(f.positionPrev.x-=n.x*f.inverseMass,f.positionPrev.y-=n.y*f.inverseMass,f.anglePrev-=X.cross(b,n)*f.inverseInertia)}}}}},function(t,e,i){t.exports={BasePlugin:i(519),DefaultPlugins:i(189),PluginCache:i(25),PluginManager:i(391),ScenePlugin:i(1384)}},function(t,e,i){var n=i(519),s=i(0),r=i(20),o=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},function(t,e,i){var n=i(18),s=i(192),r=n(!1,r={Center:i(380),Events:i(101),Orientation:i(381),ScaleManager:i(392),ScaleModes:i(382),Zoom:i(383)},s.CENTER);r=n(!1,r,s.ORIENTATION),r=n(!1,r,s.SCALE_MODE),r=n(!1,r,s.ZOOM),t.exports=r},function(t,e,i){var n=i(139),s=i(18)(!1,s={Events:i(20),GetPhysicsPlugins:i(396),GetScenePlugins:i(397),SceneManager:i(394),ScenePlugin:i(1387),Settings:i(398),Systems:i(195)},n);t.exports=s},function(t,e,i){var n=i(16),s=i(0),a=i(20),h=i(2),r=i(25),o=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.pluginStart,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(a.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=h(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=h(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=h(t,"sleep",!1),this._willRemove=h(t,"remove",!1);var s=h(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=h(t,"onUpdateScope",this.scene));var r=h(t,"allowInput",!1);this.settings.transitionAllowInput=r;var o=i.sys.settings;return o.isTransition=!0,o.transitionFrom=this.scene,o.transitionDuration=n,o.transitionAllowInput=r,h(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):h(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(h(t,"data")):this.manager.start(e,h(t,"data")),this.systems.events.emit(a.TRANSITION_OUT,i,n),this.systems.events.on(a.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(a.UPDATE,this.step,this),t.events.emit(a.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(a.SHUTDOWN,this.shutdown,this),t.off(a.POST_UPDATE,this.step,this),t.off(a.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});r.register("ScenePlugin",o,"scenePlugin"),t.exports=o},function(t,e,i){t.exports={Events:i(415),List:i(105),Map:i(98),ProcessQueue:i(202),RTree:i(508),Set:i(145),Size:i(393)}},function(t,e,i){var n=i(18),s=i(1390),r=n(!1,r={CanvasTexture:i(400),Events:i(136),FilterMode:s,Frame:i(104),Parsers:i(402),Texture:i(197),TextureManager:i(399),TextureSource:i(401)},s);t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(18),s=i(1392),r=n(!1,r={Components:i(243),Parsers:i(1425),Formats:i(38),ImageCollection:i(555),ParseToTilemap:i(253),Tile:i(81),Tilemap:i(559),TilemapCreator:i(1431),TilemapFactory:i(1432),Tileset:i(119),TilemapLayer:i(560),Orientation:i(29),LayerData:i(117),MapData:i(118),ObjectLayer:i(551)},s.ORIENTATION);t.exports=r},function(t,e,i){var n={FromOrientationString:i(242),ORIENTATION:i(29)};t.exports=n},function(t,e,i){var p=i(26),g=i(60);t.exports=function(t,e,i,n,s,r,o,a){void 0===o&&(o=!0),t<0&&(t=0),e<0&&(e=0);for(var h=p(t,e,i,n,null,a),l=s-t,u=r-e,c=0;c=t&&l.index<=e&&u(l,i)}n&&c(0,0,s.width,s.height,s)}}},function(t,e,i){var a=i(69),h=i(60),l=i(153);t.exports=function(t,e,i,n){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var s=0;s=s.delay&&(n=s.elapsed-s.delay,s.elapsed=s.delay,!s.hasDispatched&&s.callback&&(s.hasDispatched=!0,s.callback.apply(s.callbackScope,s.args)),0>2],s+=o[(3&i[r])<<4|i[r+1]>>4],s+=o[(15&i[r+1])<<2|i[r+2]>>6],s+=o[63&i[r+2]];return n%3==2?s=s.substring(0,s.length-1)+"=":n%3==1&&(s=s.substring(0,s.length-2)+"=="),s}},function(t,e,i){t.exports={Clone:i(76),DeepCopy:i(167),Extend:i(18),GetAdvancedValue:i(15),GetFastValue:i(2),GetMinMaxValue:i(1457),GetValue:i(6),HasAll:i(1458),HasAny:i(432),HasValue:i(123),IsPlainObject:i(7),Merge:i(140),MergeRight:i(1459),Pick:i(550),SetValue:i(455)}},function(t,e,i){var o=i(6),a=i(16);t.exports=function(t,e,i,n,s){void 0===s&&(s=i);var r=o(t,e,s);return a(r,i,n)}},function(t,e){t.exports=function(t,e){for(var i=0;ii[e][0])&&(e=n);return!S(P(t,e-1),P(t,e),P(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var u=[],c=[];function M(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function P(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function R(t,e,i,n){for(var s=i;sn.deltaMax?n.deltaMax:e)/n.delta,n.delta=e),0!==n.timeScalePrev&&(r*=s.timeScale/n.timeScalePrev),0===s.timeScale&&(r=0),n.timeScalePrev=s.timeScale,n.correction=r,n.frameCounter+=1,1e3<=t-n.counterTimestamp&&(n.fps=n.frameCounter*((t-n.counterTimestamp)/1e3),n.counterTimestamp=t,n.frameCounter=0),T.update(i,e,r))},step:function(t,e){T.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==u.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return u.allBodies(this.localWorld)},getAllConstraints:function(){return u.allConstraints(this.localWorld)},getAllComposites:function(){return u.allComposites(this.localWorld)},postUpdate:function(){var t,e,i,n;this.drawDebug&&(t=this.debugConfig,e=this.engine,i=this.debugGraphic,n=u.allBodies(this.localWorld),this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(n,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(n),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(n,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(n,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor))},renderGrid:function(t,e,i,n){e.lineStyle(1,i,n);for(var s=y.keys(t.buckets),r=0;re.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y (http://www.photonstorm.com)", @@ -23,6 +23,7 @@ "buildfb": "webpack --config config/webpack.fb.config.js", "watchfb": "webpack --config config/webpack.fb.config.js --watch", "dist": "webpack --config config/webpack.dist.config.js", + "dist3d": "webpack --config config/webpack.3d.dist.config.js", "distfb": "webpack --config config/webpack.fb.dist.config.js", "distfull": "npm run dist && npm run distfb", "plugin.cam3d": "webpack --config plugins/camera3d/webpack.config.js", @@ -43,6 +44,7 @@ "lintfix": "eslint --config .eslintrc.json \"src/**/*.js\" --fix", "sloc": "node-sloc \"./src\" --include-extensions \"js\"", "bundleshaders": "node scripts/bundle-shaders.js", + "bundle3dshaders": "node scripts/bundle-layer3d-shaders.js", "build-tsgen": "cd scripts/tsgen && tsc", "tsgen": "cd scripts/tsgen && jsdoc -c jsdoc-tsd.conf.json", "test-ts": "cd scripts/tsgen/test && tsc --build tsconfig.json > output.txt", @@ -65,12 +67,13 @@ "@types/source-map": "^0.5.7", "clean-webpack-plugin": "^3.0.0", "dts-dom": "^3.6.0", - "eslint": "^7.9.0", + "eslint": "^7.11.0", "eslint-plugin-es5": "^1.5.0", "fs-extra": "^9.0.1", "jsdoc": "^3.6.6", "node-sloc": "^0.1.12", "remove-files-webpack-plugin": "^1.4.4", + "source-map": "^0.7.3", "typescript": "^4.0.3", "uglifyjs-webpack-plugin": "^2.2.0", "vivid-cli": "^1.1.2", @@ -80,8 +83,8 @@ }, "dependencies": { "eventemitter3": "^4.0.7", - "exports-loader": "^1.1.0", - "imports-loader": "^1.1.0", + "exports-loader": "^1.1.1", + "imports-loader": "^1.2.0", "path": "^0.12.7" } } diff --git a/plugins/camera3d/dist/camera3d.js b/plugins/camera3d/dist/camera3d.js index 298be22e0..78ca9c11e 100644 --- a/plugins/camera3d/dist/camera3d.js +++ b/plugins/camera3d/dist/camera3d.js @@ -82,7 +82,7 @@ var Camera3DPlugin = /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 43); +/******/ return __webpack_require__(__webpack_require__.s = 42); /******/ }) /************************************************************************/ /******/ ([ @@ -353,7 +353,7 @@ module.exports = Class; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); -var FuzzyEqual = __webpack_require__(17); +var FuzzyEqual = __webpack_require__(18); /** * @classdesc @@ -1306,6 +1306,44 @@ var Vector3 = new Class({ return this; }, + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + /** * Make a clone of this Vector3. * @@ -1319,6 +1357,26 @@ var Vector3 = new Class({ return new Vector3(this.x, this.y, this.z); }, + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + /** * Calculate the cross (vector) product of two given Vectors. * @@ -1412,6 +1470,63 @@ var Vector3 = new Class({ return this; }, + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + /** * Add a given Vector to this Vector. Addition is component-wise. * @@ -1431,6 +1546,45 @@ var Vector3 = new Class({ return this; }, + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + /** * Subtract the given Vector from this Vector. Subtraction is component-wise. * @@ -1707,6 +1861,56 @@ var Vector3 = new Class({ return this; }, + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + /** * Transform this Vector with the given Matrix. * @@ -1732,7 +1936,7 @@ var Vector3 = new Class({ }, /** - * Transform this Vector with the given Matrix. + * Transform this Vector with the given Matrix4. * * @method Phaser.Math.Vector3#transformMat4 * @since 3.0.0 @@ -1863,6 +2067,38 @@ var Vector3 = new Class({ return this; }, + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + /** * Unproject this point from 2D space to 3D space. * The point should have its x and y properties set to @@ -1920,7 +2156,7 @@ var Vector3 = new Class({ /** * A static zero Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -1932,7 +2168,7 @@ Vector3.ZERO = new Vector3(); /** * A static right Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -1944,7 +2180,7 @@ Vector3.RIGHT = new Vector3(1, 0, 0); /** * A static left Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -1956,7 +2192,7 @@ Vector3.LEFT = new Vector3(-1, 0, 0); /** * A static up Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -1968,7 +2204,7 @@ Vector3.UP = new Vector3(0, -1, 0); /** * A static down Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -1980,7 +2216,7 @@ Vector3.DOWN = new Vector3(0, 1, 0); /** * A static forward Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -1992,7 +2228,7 @@ Vector3.FORWARD = new Vector3(0, 0, 1); /** * A static back Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -2004,7 +2240,7 @@ Vector3.BACK = new Vector3(0, 0, -1); /** * A static one Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -2058,7 +2294,7 @@ module.exports = Clamp; */ var Class = __webpack_require__(0); -var GEOM_CONST = __webpack_require__(12); +var GEOM_CONST = __webpack_require__(13); /** * @classdesc @@ -2150,8 +2386,1828 @@ module.exports = Point; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(45); -var GetValue = __webpack_require__(11); +var Class = __webpack_require__(0); +var Vector3 = __webpack_require__(3); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH = __webpack_require__(44); +var GetValue = __webpack_require__(12); /** * Retrieves a value from an object. Allows for more advanced selection options, including: @@ -2228,7 +4284,7 @@ module.exports = GetAdvancedValue; /***/ }), -/* 7 */ +/* 9 */ /***/ (function(module, exports) { /** @@ -2257,7 +4313,7 @@ module.exports = FloatBetween; /***/ }), -/* 8 */ +/* 10 */ /***/ (function(module, exports) { /** @@ -2289,7 +4345,7 @@ module.exports = Wrap; /***/ }), -/* 9 */ +/* 11 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2834,1469 +4890,7 @@ module.exports = Vector4; /***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - // TODO - Should work with basic values - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - var out = this.val; - - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; - - return this; - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = []; - var m1 = this.val; - var m2 = src.val; - - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; - - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; - - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; - - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; - - return this.fromArray(a); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translate: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scale: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - this.fromArray([ - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromQuat: function (q) - { - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var out = this.val; - - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; - - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var out = this.val; - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - var out = this.val; - - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var out = this.val; - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var out = this.val; - - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix !== undefined) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix !== undefined) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - } - -}); - -var _tempMat1 = new Matrix4(); -var _tempMat2 = new Matrix4(); - -module.exports = Matrix4; - - -/***/ }), -/* 11 */ +/* 12 */ /***/ (function(module, exports) { /** @@ -4367,7 +4961,7 @@ module.exports = GetValue; /***/ }), -/* 12 */ +/* 13 */ /***/ (function(module, exports) { /** @@ -4447,7 +5041,7 @@ module.exports = GEOM_CONST; /***/ }), -/* 13 */ +/* 14 */ /***/ (function(module, exports) { /** @@ -4786,7 +5380,7 @@ module.exports = { /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports) { /** @@ -4823,7 +5417,7 @@ module.exports = Normalize; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4832,7 +5426,7 @@ module.exports = Normalize; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MathWrap = __webpack_require__(8); +var MathWrap = __webpack_require__(10); /** * Wrap an angle. @@ -4855,7 +5449,7 @@ module.exports = Wrap; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4864,7 +5458,7 @@ module.exports = Wrap; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Wrap = __webpack_require__(8); +var Wrap = __webpack_require__(10); /** * Wrap an angle in degrees. @@ -4887,7 +5481,7 @@ module.exports = WrapDegrees; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports) { /** @@ -4921,7 +5515,7 @@ module.exports = Equal; /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -4930,7 +5524,7 @@ module.exports = Equal; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Factorial = __webpack_require__(19); +var Factorial = __webpack_require__(20); /** * Calculates the Bernstein basis from the three factorial coefficients. @@ -4952,7 +5546,7 @@ module.exports = Bernstein; /***/ }), -/* 19 */ +/* 20 */ /***/ (function(module, exports) { /** @@ -4992,7 +5586,7 @@ module.exports = Factorial; /***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports) { /** @@ -5029,7 +5623,7 @@ module.exports = CatmullRom; /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports) { /** @@ -5059,7 +5653,7 @@ module.exports = Linear; /***/ }), -/* 22 */ +/* 23 */ /***/ (function(module, exports) { /** @@ -5106,7 +5700,7 @@ module.exports = SmoothStep; /***/ }), -/* 23 */ +/* 24 */ /***/ (function(module, exports) { /** @@ -5145,7 +5739,7 @@ module.exports = SmootherStep; /***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5175,7 +5769,7 @@ module.exports = DegToRad; /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, exports) { /** @@ -5214,7 +5808,7 @@ module.exports = RandomXYZ; /***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, exports) { /** @@ -5251,7 +5845,7 @@ module.exports = RandomXYZW; /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, exports) { /** @@ -5295,7 +5889,7 @@ module.exports = RotateAround; /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5350,7 +5944,7 @@ module.exports = TransformXY; /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5943,7 +6537,7 @@ module.exports = Matrix3; /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -5956,8 +6550,9 @@ module.exports = Matrix3; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); +var Matrix3 = __webpack_require__(30); +var NOOP = __webpack_require__(7); var Vector3 = __webpack_require__(3); -var Matrix3 = __webpack_require__(29); var EPSILON = 0.000001; @@ -5980,10 +6575,10 @@ var tmpMat3 = new Matrix3(); * @constructor * @since 3.0.0 * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. */ var Quaternion = new Class({ @@ -5994,52 +6589,141 @@ var Quaternion = new Class({ /** * The x component of this Quaternion. * - * @name Phaser.Math.Quaternion#x + * @name Phaser.Math.Quaternion#_x * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The y component of this Quaternion. * - * @name Phaser.Math.Quaternion#y + * @name Phaser.Math.Quaternion#_y * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The z component of this Quaternion. * - * @name Phaser.Math.Quaternion#z + * @name Phaser.Math.Quaternion#_z * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The w component of this Quaternion. * - * @name Phaser.Math.Quaternion#w + * @name Phaser.Math.Quaternion#_w * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ - if (typeof x === 'object') + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); } - else + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); } }, @@ -6055,16 +6739,11 @@ var Quaternion = new Class({ */ copy: function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; + return this.set(src); }, /** - * Set the components of this Quaternion. + * Set the components of this Quaternion and optionally call the `onChangeCallback`. * * @method Phaser.Math.Quaternion#set * @since 3.0.0 @@ -6073,24 +6752,32 @@ var Quaternion = new Class({ * @param {number} [y=0] - The y component. * @param {number} [z=0] - The z component. * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? * * @return {Phaser.Math.Quaternion} This Quaternion. */ - set: function (x, y, z, w) + set: function (x, y, z, w, update) { + if (update === undefined) { update = true; } + if (typeof x === 'object') { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); } return this; @@ -6108,10 +6795,12 @@ var Quaternion = new Class({ */ add: function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); return this; }, @@ -6128,10 +6817,12 @@ var Quaternion = new Class({ */ subtract: function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); return this; }, @@ -6148,10 +6839,12 @@ var Quaternion = new Class({ */ scale: function (scale) { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); return this; }, @@ -6212,12 +6905,14 @@ var Quaternion = new Class({ { len = 1 / Math.sqrt(len); - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; } + this.onChangeCallback(this); + return this; }, @@ -6256,12 +6951,12 @@ var Quaternion = new Class({ var az = this.z; var aw = this.w; - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); }, /** @@ -6293,21 +6988,16 @@ var Quaternion = new Class({ } else if (dot > 0.999999) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); } else { tmpvec.copy(a).cross(b); - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; return this.normalize(); } @@ -6354,12 +7044,7 @@ var Quaternion = new Class({ */ identity: function () { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); }, /** @@ -6379,12 +7064,12 @@ var Quaternion = new Class({ var s = Math.sin(rad); - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); }, /** @@ -6409,12 +7094,12 @@ var Quaternion = new Class({ var bz = b.z; var bw = b.w; - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); }, /** @@ -6472,12 +7157,12 @@ var Quaternion = new Class({ } // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); }, /** @@ -6498,14 +7183,12 @@ var Quaternion = new Class({ var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = (dot) ? 1 / dot : 0; - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); }, /** @@ -6520,9 +7203,11 @@ var Quaternion = new Class({ */ conjugate: function () { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); return this; }, @@ -6549,12 +7234,12 @@ var Quaternion = new Class({ var bx = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); }, /** @@ -6579,12 +7264,12 @@ var Quaternion = new Class({ var by = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); }, /** @@ -6609,12 +7294,12 @@ var Quaternion = new Class({ var bz = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); }, /** @@ -6638,6 +7323,190 @@ var Quaternion = new Class({ return this; }, + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + /** * Convert the given Matrix into this Quaternion. * @@ -6669,9 +7538,9 @@ var Quaternion = new Class({ fRoot = 0.5 / fRoot; // 1/(4w) - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; } else { @@ -6700,12 +7569,14 @@ var Quaternion = new Class({ tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; } + this.onChangeCallback(this); + return this; } @@ -6715,7 +7586,7 @@ module.exports = Quaternion; /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -6725,8 +7596,8 @@ module.exports = Quaternion; */ var Vector3 = __webpack_require__(3); -var Matrix4 = __webpack_require__(10); -var Quaternion = __webpack_require__(30); +var Matrix4 = __webpack_require__(6); +var Quaternion = __webpack_require__(31); var tmpMat4 = new Matrix4(); var tmpQuat = new Quaternion(); @@ -6763,7 +7634,7 @@ module.exports = RotateVec3; /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -6773,15 +7644,15 @@ module.exports = RotateVec3; */ var Class = __webpack_require__(0); -var Matrix4 = __webpack_require__(10); -var RandomXYZ = __webpack_require__(25); -var RandomXYZW = __webpack_require__(26); -var RotateVec3 = __webpack_require__(31); +var Matrix4 = __webpack_require__(6); +var RandomXYZ = __webpack_require__(26); +var RandomXYZW = __webpack_require__(27); +var RotateVec3 = __webpack_require__(32); var Set = __webpack_require__(158); -var Sprite3D = __webpack_require__(33); +var Sprite3D = __webpack_require__(34); var Vector2 = __webpack_require__(1); var Vector3 = __webpack_require__(3); -var Vector4 = __webpack_require__(9); +var Vector4 = __webpack_require__(11); // Local cache vars var tmpVec3 = new Vector3(); @@ -7840,7 +8711,7 @@ module.exports = Camera; /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7850,10 +8721,10 @@ module.exports = Camera; */ var Class = __webpack_require__(0); -var GameObject = __webpack_require__(34); -var Sprite = __webpack_require__(178); +var GameObject = __webpack_require__(35); +var Sprite = __webpack_require__(180); var Vector2 = __webpack_require__(1); -var Vector4 = __webpack_require__(9); +var Vector4 = __webpack_require__(11); /** * @classdesc @@ -8106,7 +8977,7 @@ module.exports = Sprite3D; /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8116,9 +8987,9 @@ module.exports = Sprite3D; */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(35); +var ComponentsToJSON = __webpack_require__(36); var DataManager = __webpack_require__(159); -var EventEmitter = __webpack_require__(36); +var EventEmitter = __webpack_require__(166); var Events = __webpack_require__(37); /** @@ -8147,12 +9018,15 @@ var GameObject = new Class({ EventEmitter.call(this); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * * @name Phaser.GameObjects.GameObject#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; @@ -8844,7 +9718,7 @@ module.exports = GameObject; /***/ }), -/* 35 */ +/* 36 */ /***/ (function(module, exports) { /** @@ -8904,349 +9778,6 @@ var ToJSON = function (gameObject) module.exports = ToJSON; -/***/ }), -/* 36 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; - -/** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private - */ -function Events() {} - -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); - - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} - -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; -}; - -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} - - /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { @@ -9263,19 +9794,19 @@ if (true) { module.exports = { - ADDED_TO_SCENE: __webpack_require__(165), - DESTROY: __webpack_require__(166), - REMOVED_FROM_SCENE: __webpack_require__(167), - VIDEO_COMPLETE: __webpack_require__(168), - VIDEO_CREATED: __webpack_require__(169), - VIDEO_ERROR: __webpack_require__(170), - VIDEO_LOOP: __webpack_require__(171), - VIDEO_PLAY: __webpack_require__(172), - VIDEO_SEEKED: __webpack_require__(173), - VIDEO_SEEKING: __webpack_require__(174), - VIDEO_STOP: __webpack_require__(175), - VIDEO_TIMEOUT: __webpack_require__(176), - VIDEO_UNLOCKED: __webpack_require__(177) + ADDED_TO_SCENE: __webpack_require__(167), + DESTROY: __webpack_require__(168), + REMOVED_FROM_SCENE: __webpack_require__(169), + VIDEO_COMPLETE: __webpack_require__(170), + VIDEO_CREATED: __webpack_require__(171), + VIDEO_ERROR: __webpack_require__(172), + VIDEO_LOOP: __webpack_require__(173), + VIDEO_PLAY: __webpack_require__(174), + VIDEO_SEEKED: __webpack_require__(175), + VIDEO_SEEKING: __webpack_require__(176), + VIDEO_STOP: __webpack_require__(177), + VIDEO_TIMEOUT: __webpack_require__(178), + VIDEO_UNLOCKED: __webpack_require__(179) }; @@ -9298,22 +9829,15 @@ module.exports = { ADD_ANIMATION: __webpack_require__(184), ANIMATION_COMPLETE: __webpack_require__(185), - ANIMATION_REPEAT: __webpack_require__(186), - ANIMATION_RESTART: __webpack_require__(187), - ANIMATION_START: __webpack_require__(188), - PAUSE_ALL: __webpack_require__(189), - REMOVE_ANIMATION: __webpack_require__(190), - RESUME_ALL: __webpack_require__(191), - SPRITE_ANIMATION_COMPLETE: __webpack_require__(192), - SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(193), - SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(194), - SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(195), - SPRITE_ANIMATION_KEY_START: __webpack_require__(196), - SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(197), - SPRITE_ANIMATION_REPEAT: __webpack_require__(198), - SPRITE_ANIMATION_RESTART: __webpack_require__(199), - SPRITE_ANIMATION_START: __webpack_require__(200), - SPRITE_ANIMATION_UPDATE: __webpack_require__(201) + ANIMATION_COMPLETE_KEY: __webpack_require__(186), + ANIMATION_REPEAT: __webpack_require__(187), + ANIMATION_RESTART: __webpack_require__(188), + ANIMATION_START: __webpack_require__(189), + ANIMATION_STOP: __webpack_require__(190), + ANIMATION_UPDATE: __webpack_require__(191), + PAUSE_ALL: __webpack_require__(192), + REMOVE_ANIMATION: __webpack_require__(193), + RESUME_ALL: __webpack_require__(194) }; @@ -10449,33 +10973,6 @@ module.exports = TransformMatrix; /***/ }), /* 42 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * A NOOP (No Operation) callback function. - * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - * - * @function Phaser.Utils.NOOP - * @since 3.0.0 - */ -var NOOP = function () -{ - // NOOP -}; - -module.exports = NOOP; - - -/***/ }), -/* 43 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10484,14 +10981,14 @@ module.exports = NOOP; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(44); +var BuildGameObject = __webpack_require__(43); var BuildGameObjectAnimation = __webpack_require__(156); var Class = __webpack_require__(0); -var GetAdvancedValue = __webpack_require__(6); +var GetAdvancedValue = __webpack_require__(8); var OrthographicCamera = __webpack_require__(157); -var PerspectiveCamera = __webpack_require__(255); -var ScenePlugin = __webpack_require__(256); -var Sprite3D = __webpack_require__(33); +var PerspectiveCamera = __webpack_require__(253); +var ScenePlugin = __webpack_require__(254); +var Sprite3D = __webpack_require__(34); /** * @classdesc @@ -10821,7 +11318,7 @@ module.exports = Camera3DPlugin; /***/ }), -/* 44 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10830,8 +11327,8 @@ module.exports = Camera3DPlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(13); -var GetAdvancedValue = __webpack_require__(6); +var BlendModes = __webpack_require__(14); +var GetAdvancedValue = __webpack_require__(8); /** * Builds a Game Object using the provided configuration object. @@ -10949,7 +11446,7 @@ module.exports = BuildGameObject; /***/ }), -/* 45 */ +/* 44 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10959,7 +11456,7 @@ module.exports = BuildGameObject; */ var CONST = __webpack_require__(2); -var Extend = __webpack_require__(46); +var Extend = __webpack_require__(45); /** * @namespace Phaser.Math @@ -10968,63 +11465,64 @@ var Extend = __webpack_require__(46); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(48), - Distance: __webpack_require__(59), - Easing: __webpack_require__(67), - Fuzzy: __webpack_require__(112), - Interpolation: __webpack_require__(117), - Pow2: __webpack_require__(125), - Snap: __webpack_require__(129), + Angle: __webpack_require__(47), + Distance: __webpack_require__(58), + Easing: __webpack_require__(66), + Fuzzy: __webpack_require__(111), + Interpolation: __webpack_require__(116), + Pow2: __webpack_require__(124), + Snap: __webpack_require__(128), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(133), + RandomDataGenerator: __webpack_require__(132), // Single functions - Average: __webpack_require__(134), - Bernstein: __webpack_require__(18), - Between: __webpack_require__(135), - CatmullRom: __webpack_require__(20), - CeilTo: __webpack_require__(136), + Average: __webpack_require__(133), + Bernstein: __webpack_require__(19), + Between: __webpack_require__(134), + CatmullRom: __webpack_require__(21), + CeilTo: __webpack_require__(135), Clamp: __webpack_require__(4), - DegToRad: __webpack_require__(24), - Difference: __webpack_require__(137), - Factorial: __webpack_require__(19), - FloatBetween: __webpack_require__(7), + DegToRad: __webpack_require__(25), + Difference: __webpack_require__(136), + Euler: __webpack_require__(137), + Factorial: __webpack_require__(20), + FloatBetween: __webpack_require__(9), FloorTo: __webpack_require__(138), FromPercent: __webpack_require__(139), GetSpeed: __webpack_require__(140), IsEven: __webpack_require__(141), IsEvenStrict: __webpack_require__(142), - Linear: __webpack_require__(21), + Linear: __webpack_require__(22), MaxAdd: __webpack_require__(143), MinSub: __webpack_require__(144), Percent: __webpack_require__(145), RadToDeg: __webpack_require__(146), RandomXY: __webpack_require__(147), - RandomXYZ: __webpack_require__(25), - RandomXYZW: __webpack_require__(26), + RandomXYZ: __webpack_require__(26), + RandomXYZW: __webpack_require__(27), Rotate: __webpack_require__(148), - RotateAround: __webpack_require__(27), + RotateAround: __webpack_require__(28), RotateAroundDistance: __webpack_require__(149), RotateTo: __webpack_require__(150), RoundAwayFromZero: __webpack_require__(151), RoundTo: __webpack_require__(152), SinCosTableGenerator: __webpack_require__(153), - SmootherStep: __webpack_require__(23), - SmoothStep: __webpack_require__(22), + SmootherStep: __webpack_require__(24), + SmoothStep: __webpack_require__(23), ToXY: __webpack_require__(154), - TransformXY: __webpack_require__(28), + TransformXY: __webpack_require__(29), Within: __webpack_require__(155), - Wrap: __webpack_require__(8), + Wrap: __webpack_require__(10), // Vector classes Vector2: __webpack_require__(1), Vector3: __webpack_require__(3), - Vector4: __webpack_require__(9), - Matrix3: __webpack_require__(29), - Matrix4: __webpack_require__(10), - Quaternion: __webpack_require__(30), - RotateVec3: __webpack_require__(31) + Vector4: __webpack_require__(11), + Matrix3: __webpack_require__(30), + Matrix4: __webpack_require__(6), + Quaternion: __webpack_require__(31), + RotateVec3: __webpack_require__(32) }; @@ -11038,7 +11536,7 @@ module.exports = PhaserMath; /***/ }), -/* 46 */ +/* 45 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11047,7 +11545,7 @@ module.exports = PhaserMath; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsPlainObject = __webpack_require__(47); +var IsPlainObject = __webpack_require__(46); // @param {boolean} deep - Perform a deep copy? // @param {object} target - The target object to copy to. @@ -11139,7 +11637,7 @@ module.exports = Extend; /***/ }), -/* 47 */ +/* 46 */ /***/ (function(module, exports) { /** @@ -11195,7 +11693,7 @@ module.exports = IsPlainObject; /***/ }), -/* 48 */ +/* 47 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11210,25 +11708,25 @@ module.exports = IsPlainObject; module.exports = { - Between: __webpack_require__(49), - BetweenPoints: __webpack_require__(50), - BetweenPointsY: __webpack_require__(51), - BetweenY: __webpack_require__(52), - CounterClockwise: __webpack_require__(53), - Normalize: __webpack_require__(14), - Random: __webpack_require__(54), - RandomDegrees: __webpack_require__(55), - Reverse: __webpack_require__(56), - RotateTo: __webpack_require__(57), - ShortestBetween: __webpack_require__(58), - Wrap: __webpack_require__(15), - WrapDegrees: __webpack_require__(16) + Between: __webpack_require__(48), + BetweenPoints: __webpack_require__(49), + BetweenPointsY: __webpack_require__(50), + BetweenY: __webpack_require__(51), + CounterClockwise: __webpack_require__(52), + Normalize: __webpack_require__(15), + Random: __webpack_require__(53), + RandomDegrees: __webpack_require__(54), + Reverse: __webpack_require__(55), + RotateTo: __webpack_require__(56), + ShortestBetween: __webpack_require__(57), + Wrap: __webpack_require__(16), + WrapDegrees: __webpack_require__(17) }; /***/ }), -/* 49 */ +/* 48 */ /***/ (function(module, exports) { /** @@ -11259,7 +11757,7 @@ module.exports = Between; /***/ }), -/* 50 */ +/* 49 */ /***/ (function(module, exports) { /** @@ -11290,7 +11788,7 @@ module.exports = BetweenPoints; /***/ }), -/* 51 */ +/* 50 */ /***/ (function(module, exports) { /** @@ -11322,7 +11820,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 52 */ +/* 51 */ /***/ (function(module, exports) { /** @@ -11356,7 +11854,7 @@ module.exports = BetweenY; /***/ }), -/* 53 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11401,7 +11899,7 @@ module.exports = CounterClockwise; /***/ }), -/* 54 */ +/* 53 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11411,7 +11909,7 @@ module.exports = CounterClockwise; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(7); +var FloatBetween = __webpack_require__(9); /** * Returns a random angle in the range [-pi, pi]. @@ -11430,7 +11928,7 @@ module.exports = Random; /***/ }), -/* 55 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11440,7 +11938,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(7); +var FloatBetween = __webpack_require__(9); /** * Returns a random angle in the range [-180, 180]. @@ -11459,7 +11957,7 @@ module.exports = RandomDegrees; /***/ }), -/* 56 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11468,7 +11966,7 @@ module.exports = RandomDegrees; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(14); +var Normalize = __webpack_require__(15); /** * Reverse the given angle. @@ -11489,7 +11987,7 @@ module.exports = Reverse; /***/ }), -/* 57 */ +/* 56 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11556,7 +12054,7 @@ module.exports = RotateTo; /***/ }), -/* 58 */ +/* 57 */ /***/ (function(module, exports) { /** @@ -11605,7 +12103,7 @@ module.exports = ShortestBetween; /***/ }), -/* 59 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11620,19 +12118,19 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(60), - BetweenPoints: __webpack_require__(61), - BetweenPointsSquared: __webpack_require__(62), - Chebyshev: __webpack_require__(63), - Power: __webpack_require__(64), - Snake: __webpack_require__(65), - Squared: __webpack_require__(66) + Between: __webpack_require__(59), + BetweenPoints: __webpack_require__(60), + BetweenPointsSquared: __webpack_require__(61), + Chebyshev: __webpack_require__(62), + Power: __webpack_require__(63), + Snake: __webpack_require__(64), + Squared: __webpack_require__(65) }; /***/ }), -/* 60 */ +/* 59 */ /***/ (function(module, exports) { /** @@ -11666,7 +12164,7 @@ module.exports = DistanceBetween; /***/ }), -/* 61 */ +/* 60 */ /***/ (function(module, exports) { /** @@ -11698,7 +12196,7 @@ module.exports = DistanceBetweenPoints; /***/ }), -/* 62 */ +/* 61 */ /***/ (function(module, exports) { /** @@ -11730,7 +12228,7 @@ module.exports = DistanceBetweenPointsSquared; /***/ }), -/* 63 */ +/* 62 */ /***/ (function(module, exports) { /** @@ -11764,7 +12262,7 @@ module.exports = ChebyshevDistance; /***/ }), -/* 64 */ +/* 63 */ /***/ (function(module, exports) { /** @@ -11798,7 +12296,7 @@ module.exports = DistancePower; /***/ }), -/* 65 */ +/* 64 */ /***/ (function(module, exports) { /** @@ -11832,7 +12330,7 @@ module.exports = SnakeDistance; /***/ }), -/* 66 */ +/* 65 */ /***/ (function(module, exports) { /** @@ -11866,7 +12364,7 @@ module.exports = DistanceSquared; /***/ }), -/* 67 */ +/* 66 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11881,24 +12379,24 @@ module.exports = DistanceSquared; module.exports = { - Back: __webpack_require__(68), - Bounce: __webpack_require__(72), - Circular: __webpack_require__(76), - Cubic: __webpack_require__(80), - Elastic: __webpack_require__(84), - Expo: __webpack_require__(88), - Linear: __webpack_require__(92), - Quadratic: __webpack_require__(94), - Quartic: __webpack_require__(98), - Quintic: __webpack_require__(102), - Sine: __webpack_require__(106), - Stepped: __webpack_require__(110) + Back: __webpack_require__(67), + Bounce: __webpack_require__(71), + Circular: __webpack_require__(75), + Cubic: __webpack_require__(79), + Elastic: __webpack_require__(83), + Expo: __webpack_require__(87), + Linear: __webpack_require__(91), + Quadratic: __webpack_require__(93), + Quartic: __webpack_require__(97), + Quintic: __webpack_require__(101), + Sine: __webpack_require__(105), + Stepped: __webpack_require__(109) }; /***/ }), -/* 68 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11913,15 +12411,15 @@ module.exports = { module.exports = { - In: __webpack_require__(69), - Out: __webpack_require__(70), - InOut: __webpack_require__(71) + In: __webpack_require__(68), + Out: __webpack_require__(69), + InOut: __webpack_require__(70) }; /***/ }), -/* 69 */ +/* 68 */ /***/ (function(module, exports) { /** @@ -11952,7 +12450,7 @@ module.exports = In; /***/ }), -/* 70 */ +/* 69 */ /***/ (function(module, exports) { /** @@ -11983,7 +12481,7 @@ module.exports = Out; /***/ }), -/* 71 */ +/* 70 */ /***/ (function(module, exports) { /** @@ -12023,7 +12521,7 @@ module.exports = InOut; /***/ }), -/* 72 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12038,15 +12536,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(73), - Out: __webpack_require__(74), - InOut: __webpack_require__(75) + In: __webpack_require__(72), + Out: __webpack_require__(73), + InOut: __webpack_require__(74) }; /***/ }), -/* 73 */ +/* 72 */ /***/ (function(module, exports) { /** @@ -12091,7 +12589,7 @@ module.exports = In; /***/ }), -/* 74 */ +/* 73 */ /***/ (function(module, exports) { /** @@ -12134,7 +12632,7 @@ module.exports = Out; /***/ }), -/* 75 */ +/* 74 */ /***/ (function(module, exports) { /** @@ -12198,7 +12696,7 @@ module.exports = InOut; /***/ }), -/* 76 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12213,15 +12711,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(77), - Out: __webpack_require__(78), - InOut: __webpack_require__(79) + In: __webpack_require__(76), + Out: __webpack_require__(77), + InOut: __webpack_require__(78) }; /***/ }), -/* 77 */ +/* 76 */ /***/ (function(module, exports) { /** @@ -12249,7 +12747,7 @@ module.exports = In; /***/ }), -/* 78 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -12277,7 +12775,7 @@ module.exports = Out; /***/ }), -/* 79 */ +/* 78 */ /***/ (function(module, exports) { /** @@ -12312,7 +12810,7 @@ module.exports = InOut; /***/ }), -/* 80 */ +/* 79 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12327,15 +12825,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(81), - Out: __webpack_require__(82), - InOut: __webpack_require__(83) + In: __webpack_require__(80), + Out: __webpack_require__(81), + InOut: __webpack_require__(82) }; /***/ }), -/* 81 */ +/* 80 */ /***/ (function(module, exports) { /** @@ -12363,7 +12861,7 @@ module.exports = In; /***/ }), -/* 82 */ +/* 81 */ /***/ (function(module, exports) { /** @@ -12391,7 +12889,7 @@ module.exports = Out; /***/ }), -/* 83 */ +/* 82 */ /***/ (function(module, exports) { /** @@ -12426,7 +12924,7 @@ module.exports = InOut; /***/ }), -/* 84 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12441,15 +12939,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(85), - Out: __webpack_require__(86), - InOut: __webpack_require__(87) + In: __webpack_require__(84), + Out: __webpack_require__(85), + InOut: __webpack_require__(86) }; /***/ }), -/* 85 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -12504,7 +13002,7 @@ module.exports = In; /***/ }), -/* 86 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -12559,7 +13057,7 @@ module.exports = Out; /***/ }), -/* 87 */ +/* 86 */ /***/ (function(module, exports) { /** @@ -12621,7 +13119,7 @@ module.exports = InOut; /***/ }), -/* 88 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12636,15 +13134,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(89), - Out: __webpack_require__(90), - InOut: __webpack_require__(91) + In: __webpack_require__(88), + Out: __webpack_require__(89), + InOut: __webpack_require__(90) }; /***/ }), -/* 89 */ +/* 88 */ /***/ (function(module, exports) { /** @@ -12672,7 +13170,7 @@ module.exports = In; /***/ }), -/* 90 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -12700,7 +13198,7 @@ module.exports = Out; /***/ }), -/* 91 */ +/* 90 */ /***/ (function(module, exports) { /** @@ -12735,7 +13233,7 @@ module.exports = InOut; /***/ }), -/* 92 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12744,11 +13242,11 @@ module.exports = InOut; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -module.exports = __webpack_require__(93); +module.exports = __webpack_require__(92); /***/ }), -/* 93 */ +/* 92 */ /***/ (function(module, exports) { /** @@ -12776,7 +13274,7 @@ module.exports = Linear; /***/ }), -/* 94 */ +/* 93 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12791,15 +13289,15 @@ module.exports = Linear; module.exports = { - In: __webpack_require__(95), - Out: __webpack_require__(96), - InOut: __webpack_require__(97) + In: __webpack_require__(94), + Out: __webpack_require__(95), + InOut: __webpack_require__(96) }; /***/ }), -/* 95 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -12827,7 +13325,7 @@ module.exports = In; /***/ }), -/* 96 */ +/* 95 */ /***/ (function(module, exports) { /** @@ -12855,7 +13353,7 @@ module.exports = Out; /***/ }), -/* 97 */ +/* 96 */ /***/ (function(module, exports) { /** @@ -12890,7 +13388,7 @@ module.exports = InOut; /***/ }), -/* 98 */ +/* 97 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12905,15 +13403,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(99), - Out: __webpack_require__(100), - InOut: __webpack_require__(101) + In: __webpack_require__(98), + Out: __webpack_require__(99), + InOut: __webpack_require__(100) }; /***/ }), -/* 99 */ +/* 98 */ /***/ (function(module, exports) { /** @@ -12941,7 +13439,7 @@ module.exports = In; /***/ }), -/* 100 */ +/* 99 */ /***/ (function(module, exports) { /** @@ -12969,7 +13467,7 @@ module.exports = Out; /***/ }), -/* 101 */ +/* 100 */ /***/ (function(module, exports) { /** @@ -13004,7 +13502,7 @@ module.exports = InOut; /***/ }), -/* 102 */ +/* 101 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13019,15 +13517,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(103), - Out: __webpack_require__(104), - InOut: __webpack_require__(105) + In: __webpack_require__(102), + Out: __webpack_require__(103), + InOut: __webpack_require__(104) }; /***/ }), -/* 103 */ +/* 102 */ /***/ (function(module, exports) { /** @@ -13055,7 +13553,7 @@ module.exports = In; /***/ }), -/* 104 */ +/* 103 */ /***/ (function(module, exports) { /** @@ -13083,7 +13581,7 @@ module.exports = Out; /***/ }), -/* 105 */ +/* 104 */ /***/ (function(module, exports) { /** @@ -13118,7 +13616,7 @@ module.exports = InOut; /***/ }), -/* 106 */ +/* 105 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13133,15 +13631,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(107), - Out: __webpack_require__(108), - InOut: __webpack_require__(109) + In: __webpack_require__(106), + Out: __webpack_require__(107), + InOut: __webpack_require__(108) }; /***/ }), -/* 107 */ +/* 106 */ /***/ (function(module, exports) { /** @@ -13180,7 +13678,7 @@ module.exports = In; /***/ }), -/* 108 */ +/* 107 */ /***/ (function(module, exports) { /** @@ -13219,7 +13717,7 @@ module.exports = Out; /***/ }), -/* 109 */ +/* 108 */ /***/ (function(module, exports) { /** @@ -13258,7 +13756,7 @@ module.exports = InOut; /***/ }), -/* 110 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13271,11 +13769,11 @@ module.exports = InOut; * @namespace Phaser.Math.Easing.Stepped */ -module.exports = __webpack_require__(111); +module.exports = __webpack_require__(110); /***/ }), -/* 111 */ +/* 110 */ /***/ (function(module, exports) { /** @@ -13317,7 +13815,7 @@ module.exports = Stepped; /***/ }), -/* 112 */ +/* 111 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13332,17 +13830,17 @@ module.exports = Stepped; module.exports = { - Ceil: __webpack_require__(113), - Equal: __webpack_require__(17), - Floor: __webpack_require__(114), - GreaterThan: __webpack_require__(115), - LessThan: __webpack_require__(116) + Ceil: __webpack_require__(112), + Equal: __webpack_require__(18), + Floor: __webpack_require__(113), + GreaterThan: __webpack_require__(114), + LessThan: __webpack_require__(115) }; /***/ }), -/* 113 */ +/* 112 */ /***/ (function(module, exports) { /** @@ -13373,7 +13871,7 @@ module.exports = Ceil; /***/ }), -/* 114 */ +/* 113 */ /***/ (function(module, exports) { /** @@ -13404,7 +13902,7 @@ module.exports = Floor; /***/ }), -/* 115 */ +/* 114 */ /***/ (function(module, exports) { /** @@ -13438,7 +13936,7 @@ module.exports = GreaterThan; /***/ }), -/* 116 */ +/* 115 */ /***/ (function(module, exports) { /** @@ -13472,7 +13970,7 @@ module.exports = LessThan; /***/ }), -/* 117 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13487,19 +13985,19 @@ module.exports = LessThan; module.exports = { - Bezier: __webpack_require__(118), - CatmullRom: __webpack_require__(119), - CubicBezier: __webpack_require__(120), - Linear: __webpack_require__(121), - QuadraticBezier: __webpack_require__(122), - SmoothStep: __webpack_require__(123), - SmootherStep: __webpack_require__(124) + Bezier: __webpack_require__(117), + CatmullRom: __webpack_require__(118), + CubicBezier: __webpack_require__(119), + Linear: __webpack_require__(120), + QuadraticBezier: __webpack_require__(121), + SmoothStep: __webpack_require__(122), + SmootherStep: __webpack_require__(123) }; /***/ }), -/* 118 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13508,7 +14006,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(18); +var Bernstein = __webpack_require__(19); /** * A bezier interpolation method. @@ -13538,7 +14036,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 119 */ +/* 118 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13547,7 +14045,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(20); +var CatmullRom = __webpack_require__(21); /** * A Catmull-Rom interpolation method. @@ -13595,7 +14093,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 120 */ +/* 119 */ /***/ (function(module, exports) { /** @@ -13665,7 +14163,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 121 */ +/* 120 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13674,7 +14172,7 @@ module.exports = CubicBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(21); +var Linear = __webpack_require__(22); /** * A linear interpolation method. @@ -13712,7 +14210,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 122 */ +/* 121 */ /***/ (function(module, exports) { /** @@ -13771,7 +14269,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 123 */ +/* 122 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13780,7 +14278,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(22); +var SmoothStep = __webpack_require__(23); /** * A Smooth Step interpolation method. @@ -13804,7 +14302,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 124 */ +/* 123 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13813,7 +14311,7 @@ module.exports = SmoothStepInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(23); +var SmootherStep = __webpack_require__(24); /** * A Smoother Step interpolation method. @@ -13837,7 +14335,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 125 */ +/* 124 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13852,15 +14350,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(126), - IsSize: __webpack_require__(127), - IsValue: __webpack_require__(128) + GetNext: __webpack_require__(125), + IsSize: __webpack_require__(126), + IsValue: __webpack_require__(127) }; /***/ }), -/* 126 */ +/* 125 */ /***/ (function(module, exports) { /** @@ -13890,7 +14388,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 127 */ +/* 126 */ /***/ (function(module, exports) { /** @@ -13920,7 +14418,7 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 128 */ +/* 127 */ /***/ (function(module, exports) { /** @@ -13948,7 +14446,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 129 */ +/* 128 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13963,15 +14461,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(130), - Floor: __webpack_require__(131), - To: __webpack_require__(132) + Ceil: __webpack_require__(129), + Floor: __webpack_require__(130), + To: __webpack_require__(131) }; /***/ }), -/* 130 */ +/* 129 */ /***/ (function(module, exports) { /** @@ -14015,7 +14513,7 @@ module.exports = SnapCeil; /***/ }), -/* 131 */ +/* 130 */ /***/ (function(module, exports) { /** @@ -14059,7 +14557,7 @@ module.exports = SnapFloor; /***/ }), -/* 132 */ +/* 131 */ /***/ (function(module, exports) { /** @@ -14102,7 +14600,7 @@ module.exports = SnapTo; /***/ }), -/* 133 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14612,7 +15110,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 134 */ +/* 133 */ /***/ (function(module, exports) { /** @@ -14647,7 +15145,7 @@ module.exports = Average; /***/ }), -/* 135 */ +/* 134 */ /***/ (function(module, exports) { /** @@ -14676,7 +15174,7 @@ module.exports = Between; /***/ }), -/* 136 */ +/* 135 */ /***/ (function(module, exports) { /** @@ -14713,7 +15211,7 @@ module.exports = CeilTo; /***/ }), -/* 137 */ +/* 136 */ /***/ (function(module, exports) { /** @@ -14741,6 +15239,289 @@ var Difference = function (a, b) module.exports = Difference; +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(4); +var Class = __webpack_require__(0); +var Matrix4 = __webpack_require__(6); +var NOOP = __webpack_require__(7); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + /***/ }), /* 138 */ /***/ (function(module, exports) { @@ -15439,7 +16220,7 @@ module.exports = Within; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetAdvancedValue = __webpack_require__(6); +var GetAdvancedValue = __webpack_require__(8); /** * Adds an Animation component to a Sprite and populates it based on the given config. @@ -15483,32 +16264,40 @@ var BuildGameObjectAnimation = function (sprite, config) var anims = sprite.anims; var key = GetAdvancedValue(animConfig, 'key', undefined); - var startFrame = GetAdvancedValue(animConfig, 'startFrame', undefined); - var delay = GetAdvancedValue(animConfig, 'delay', 0); - var repeat = GetAdvancedValue(animConfig, 'repeat', 0); - var repeatDelay = GetAdvancedValue(animConfig, 'repeatDelay', 0); - var yoyo = GetAdvancedValue(animConfig, 'yoyo', false); - - var play = GetAdvancedValue(animConfig, 'play', false); - var delayedPlay = GetAdvancedValue(animConfig, 'delayedPlay', 0); - - anims.setDelay(delay); - anims.setRepeat(repeat); - anims.setRepeatDelay(repeatDelay); - anims.setYoyo(yoyo); - - if (play) + if (key) { - anims.play(key, startFrame); - } - else if (delayedPlay > 0) - { - anims.delayedPlay(delayedPlay, key, startFrame); - } - else - { - anims.load(key); + var startFrame = GetAdvancedValue(animConfig, 'startFrame', undefined); + + var delay = GetAdvancedValue(animConfig, 'delay', 0); + var repeat = GetAdvancedValue(animConfig, 'repeat', 0); + var repeatDelay = GetAdvancedValue(animConfig, 'repeatDelay', 0); + var yoyo = GetAdvancedValue(animConfig, 'yoyo', false); + + var play = GetAdvancedValue(animConfig, 'play', false); + var delayedPlay = GetAdvancedValue(animConfig, 'delayedPlay', 0); + + var playConfig = { + key: key, + delay: delay, + repeat: repeat, + repeatDelay: repeatDelay, + yoyo: yoyo, + startFrame: startFrame + }; + + if (play) + { + anims.play(playConfig); + } + else if (delayedPlay > 0) + { + anims.playAfterDelay(playConfig, delayedPlay); + } + else + { + anims.load(playConfig); + } } } @@ -15528,7 +16317,7 @@ module.exports = BuildGameObjectAnimation; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Camera = __webpack_require__(32); +var Camera = __webpack_require__(33); var Class = __webpack_require__(0); var Vector3 = __webpack_require__(3); @@ -16239,13 +17028,13 @@ var DataManager = new Class({ * ``` * * You can also modify it directly: - * + * * ```javascript * this.data.values.gold += 1000; * ``` * * Doing so will emit a `setdata` event from the parent of this Data Manager. - * + * * Do not modify this object directly. Adding properties directly to this object will not * emit any events. Always use `DataManager.set` to create new items the first time around. * @@ -16269,7 +17058,7 @@ var DataManager = new Class({ if (!parent.hasOwnProperty('sys') && this.events) { - this.events.once('destroy', this.destroy, this); + this.events.once(Events.DESTROY, this.destroy, this); } }, @@ -16277,19 +17066,19 @@ var DataManager = new Class({ * Retrieves the value for the given key, or undefined if it doesn't exist. * * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * + * * ```javascript * this.data.get('gold'); * ``` * * Or access the value directly: - * + * * ```javascript * this.data.values.gold; * ``` * * You can also pass in an array of keys, in which case an array of values will be returned: - * + * * ```javascript * this.data.get([ 'gold', 'armor', 'health' ]); * ``` @@ -16374,7 +17163,7 @@ var DataManager = new Class({ /** * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * + * * ```javascript * data.set('name', 'Red Gem Stone'); * ``` @@ -16386,13 +17175,13 @@ var DataManager = new Class({ * ``` * * To get a value back again you can call `get`: - * + * * ```javascript * data.get('gold'); * ``` - * + * * Or you can access the value directly via the `values` property, where it works like any other variable: - * + * * ```javascript * data.values.gold += 50; * ``` @@ -16441,9 +17230,9 @@ var DataManager = new Class({ /** * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#inc * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -16480,9 +17269,9 @@ var DataManager = new Class({ /** * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#toggle * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -16542,7 +17331,7 @@ var DataManager = new Class({ Object.defineProperty(this.values, key, { enumerable: true, - + configurable: true, get: function () @@ -16642,9 +17431,9 @@ var DataManager = new Class({ * * If the key is found in this Data Manager it is removed from the internal lists and a * `removedata` event is emitted. - * + * * You can also pass in an array of keys, in which case all keys in the array will be removed: - * + * * ```javascript * this.data.remove([ 'gold', 'armor', 'health' ]); * ``` @@ -16736,7 +17525,7 @@ var DataManager = new Class({ /** * Determines whether the given key is set in this Data Manager. - * + * * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @@ -16879,8 +17668,9 @@ module.exports = { CHANGE_DATA: __webpack_require__(161), CHANGE_DATA_KEY: __webpack_require__(162), - REMOVE_DATA: __webpack_require__(163), - SET_DATA: __webpack_require__(164) + DESTROY: __webpack_require__(163), + REMOVE_DATA: __webpack_require__(164), + SET_DATA: __webpack_require__(165) }; @@ -16951,6 +17741,27 @@ module.exports = 'changedata-'; /* 163 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Data Manager Destroy Event. + * + * The Data Manager will listen for the destroy event from its parent, and then close itself down. + * + * @event Phaser.Data.Events#DESTROY + * @since 3.50.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -16976,7 +17787,7 @@ module.exports = 'removedata'; /***/ }), -/* 164 */ +/* 165 */ /***/ (function(module, exports) { /** @@ -17004,7 +17815,350 @@ module.exports = 'setdata'; /***/ }), -/* 165 */ +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 167 */ /***/ (function(module, exports) { /** @@ -17030,7 +18184,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 166 */ +/* 168 */ /***/ (function(module, exports) { /** @@ -17055,7 +18209,7 @@ module.exports = 'destroy'; /***/ }), -/* 167 */ +/* 169 */ /***/ (function(module, exports) { /** @@ -17081,7 +18235,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 168 */ +/* 170 */ /***/ (function(module, exports) { /** @@ -17113,7 +18267,7 @@ module.exports = 'complete'; /***/ }), -/* 169 */ +/* 171 */ /***/ (function(module, exports) { /** @@ -17142,7 +18296,7 @@ module.exports = 'created'; /***/ }), -/* 170 */ +/* 172 */ /***/ (function(module, exports) { /** @@ -17168,7 +18322,7 @@ module.exports = 'error'; /***/ }), -/* 171 */ +/* 173 */ /***/ (function(module, exports) { /** @@ -17200,7 +18354,7 @@ module.exports = 'loop'; /***/ }), -/* 172 */ +/* 174 */ /***/ (function(module, exports) { /** @@ -17228,7 +18382,7 @@ module.exports = 'play'; /***/ }), -/* 173 */ +/* 175 */ /***/ (function(module, exports) { /** @@ -17253,7 +18407,7 @@ module.exports = 'seeked'; /***/ }), -/* 174 */ +/* 176 */ /***/ (function(module, exports) { /** @@ -17279,7 +18433,7 @@ module.exports = 'seeking'; /***/ }), -/* 175 */ +/* 177 */ /***/ (function(module, exports) { /** @@ -17305,7 +18459,7 @@ module.exports = 'stop'; /***/ }), -/* 176 */ +/* 178 */ /***/ (function(module, exports) { /** @@ -17331,7 +18485,7 @@ module.exports = 'timeout'; /***/ }), -/* 177 */ +/* 179 */ /***/ (function(module, exports) { /** @@ -17357,7 +18511,7 @@ module.exports = 'unlocked'; /***/ }), -/* 178 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17366,11 +18520,12 @@ module.exports = 'unlocked'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var AnimationState = __webpack_require__(181); var Class = __webpack_require__(0); -var Components = __webpack_require__(179); -var GameObject = __webpack_require__(34); +var Components = __webpack_require__(199); +var GameObject = __webpack_require__(35); var GameObjectEvents = __webpack_require__(37); -var SpriteRender = __webpack_require__(252); +var SpriteRender = __webpack_require__(250); /** * @classdesc @@ -17450,13 +18605,17 @@ var Sprite = new Class({ this._crop = this.resetCropObject(); /** - * The Animation Controller of this Sprite. + * The Animation State component of this Sprite. + * + * This component provides features to apply animations to this Sprite. + * It is responsible for playing, loading, queuing animations for later playback, + * mixing between animations and setting the current animation frame to this Sprite. * * @name Phaser.GameObjects.Sprite#anims - * @type {Phaser.GameObjects.Components.Animation} + * @type {Phaser.Animations.AnimationState} * @since 3.0.0 */ - this.anims = new Components.Animation(this); + this.anims = new AnimationState(this); this.setTexture(texture, frame); this.setPosition(x, y); @@ -17496,22 +18655,310 @@ var Sprite = new Class({ }, /** - * Start playing the given animation. + * Start playing the given animation on this Sprite. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).play('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. * * @method Phaser.GameObjects.Sprite#play + * @fires Phaser.Animations.Events#ANIMATION_START * @since 3.0.0 * - * @param {string} key - The string-based key of the animation to play. + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. * * @return {this} This Game Object. */ - play: function (key, ignoreIfPlaying, startFrame) + play: function (key, ignoreIfPlaying) { - this.anims.play(key, ignoreIfPlaying, startFrame); + return this.anims.play(key, ignoreIfPlaying); + }, - return this; + /** + * Start playing the given animation on this Sprite, in reverse. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).playReverse('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * + * @method Phaser.GameObjects.Sprite#playReverse + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * + * @return {this} This Game Object. + */ + playReverse: function (key, ignoreIfPlaying) + { + return this.anims.playReverse(key, ignoreIfPlaying); + }, + + /** + * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * + * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. + * + * If an animation is already running and a new animation is given to this method, it will wait for + * the given delay before starting the new animation. + * + * If no animation is currently running, the given one begins after the delay. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * Prior to Phaser 3.50 this method was called 'delayedPlay'. + * + * @method Phaser.GameObjects.Components.Animation#playAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. + * + * @return {this} This Game Object. + */ + playAfterDelay: function (key, delay) + { + return this.anims.playAfterDelay(key, delay); + }, + + /** + * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback + * of the given animation. + * + * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an + * idle animation to a walking animation, by making them blend smoothly into each other. + * + * If no animation is currently running, the given one will start immediately. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * @method Phaser.GameObjects.Components.Animation#playAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * + * @return {this} This Game Object. + */ + playAfterRepeat: function (key, repeatCount) + { + return this.anims.playAfterRepeat(key, repeatCount); + }, + + /** + * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, + * or have the `stop` method called directly on it. + * + * An animation set to repeat forever will never enter a completed state. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, + * or when it ends (via its `animationcomplete` event). + * + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained + * animations without impacting the animation they're playing. + * + * Call this method with no arguments to reset all currently chained animations. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * @method Phaser.GameObjects.Sprite#chain + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * + * @return {this} This Game Object. + */ + chain: function (key) + { + return this.anims.chain(key); + }, + + /** + * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. + * + * If no animation is playing, no event will be dispatched. + * + * If there is another animation queued (via the `chain` method) then it will start playing immediately. + * + * @method Phaser.GameObjects.Sprite#stop + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @return {this} This Game Object. + */ + stop: function () + { + return this.anims.stop(); + }, + + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {integer} delay - The number of milliseconds to wait before stopping this animation. + * + * @return {this} This Game Object. + */ + stopAfterDelay: function (delay) + { + return this.anims.stopAfterDelay(delay); + }, + + /** + * Stops the current animation from playing after the given number of repeats. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? + * + * @return {this} This Game Object. + */ + stopAfterRepeat: function (repeatCount) + { + return this.anims.stopAfterRepeat(repeatCount); + }, + + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.GameObjects.Sprite#stopOnFrame + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. + * + * @return {this} This Game Object. + */ + stopOnFrame: function (frame) + { + return this.anims.stopOnFrame(frame); }, /** @@ -17524,11 +18971,7 @@ var Sprite = new Class({ */ toJSON: function () { - var data = Components.ToJSON(this); - - // Extra Sprite data is added here - - return data; + return Components.ToJSON(this); }, /** @@ -17551,7 +18994,3931 @@ module.exports = Sprite; /***/ }), -/* 179 */ +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CustomMap = __webpack_require__(182); +var GetFastValue = __webpack_require__(183); +var Events = __webpack_require__(38); +var Animation = __webpack_require__(195); + +/** + * @classdesc + * The Animation State Component. + * + * This component provides features to apply animations to Game Objects. It is responsible for + * loading, queuing animations for later playback, mixing between animations and setting + * the current animation frame to the Game Object that owns this component. + * + * This component lives as an instance within any Game Object that has it defined, such as Sprites. + * + * You can access its properties and methods via the `anims` property, i.e. `Sprite.anims`. + * + * As well as playing animations stored in the global Animation Manager, this component + * can also create animations that are stored locally within it. See the `create` method + * for more details. + * + * Prior to Phaser 3.50 this component was called just `Animation` and lived in the + * `Phaser.GameObjects.Components` namespace. It was renamed to `AnimationState` + * in 3.50 to help better identify its true purpose when browsing the documentation. + * + * @class AnimationState + * @memberof Phaser.Animations + * @constructor + * @since 3.0.0 + * + * @param {Phaser.GameObjects.GameObject} parent - The Game Object to which this animation component belongs. + */ +var AnimationState = new Class({ + + initialize: + + function AnimationState (parent) + { + /** + * The Game Object to which this animation component belongs. + * + * You can typically access this component from the Game Object + * via the `this.anims` property. + * + * @name Phaser.Animations.AnimationState#parent + * @type {Phaser.GameObjects.GameObject} + * @since 3.0.0 + */ + this.parent = parent; + + /** + * A reference to the global Animation Manager. + * + * @name Phaser.Animations.AnimationState#animationManager + * @type {Phaser.Animations.AnimationManager} + * @since 3.0.0 + */ + this.animationManager = parent.scene.sys.anims; + + this.animationManager.on(Events.REMOVE_ANIMATION, this.globalRemove, this); + + /** + * A reference to the Texture Manager. + * + * @name Phaser.Animations.AnimationState#textureManager + * @type {Phaser.Textures.TextureManager} + * @protected + * @since 3.50.0 + */ + this.textureManager = this.animationManager.textureManager; + + /** + * The Animations stored locally in this Animation component. + * + * Do not modify the contents of this Map directly, instead use the + * `add`, `create` and `remove` methods of this class instead. + * + * @name Phaser.Animations.AnimationState#anims + * @type {Phaser.Structs.Map.} + * @protected + * @since 3.50.0 + */ + this.anims = null; + + /** + * Is an animation currently playing or not? + * + * @name Phaser.Animations.AnimationState#isPlaying + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.isPlaying = false; + + /** + * Has the current animation started playing, or is it waiting for a delay to expire? + * + * @name Phaser.Animations.AnimationState#hasStarted + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.hasStarted = false; + + /** + * The current Animation loaded into this Animation component. + * + * Will by `null` if no animation is yet loaded. + * + * @name Phaser.Animations.AnimationState#currentAnim + * @type {?Phaser.Animations.Animation} + * @default null + * @since 3.0.0 + */ + this.currentAnim = null; + + /** + * The current AnimationFrame being displayed by this Animation component. + * + * Will by `null` if no animation is yet loaded. + * + * @name Phaser.Animations.AnimationState#currentFrame + * @type {?Phaser.Animations.AnimationFrame} + * @default null + * @since 3.0.0 + */ + this.currentFrame = null; + + /** + * The key, instance, or config of the next Animation to be loaded into this Animation component + * when the current animation completes. + * + * Will by `null` if no animation has been queued. + * + * @name Phaser.Animations.AnimationState#nextAnim + * @type {?(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} + * @default null + * @since 3.16.0 + */ + this.nextAnim = null; + + /** + * A queue of Animations to be loaded into this Animation component when the current animation completes. + * + * Populate this queue via the `chain` method. + * + * @name Phaser.Animations.AnimationState#nextAnimsQueue + * @type {array} + * @since 3.24.0 + */ + this.nextAnimsQueue = []; + + /** + * The Time Scale factor. + * + * You can adjust this value to modify the passage of time for the animation that is currently + * playing. For example, setting it to 2 will make the animation play twice as fast. Or setting + * it to 0.5 will slow the animation down. + * + * You can change this value at run-time, or set it via the `PlayAnimationConfig`. + * + * Prior to Phaser 3.50 this property was private and called `_timeScale`. + * + * @name Phaser.Animations.AnimationState#timeScale + * @type {number} + * @default 1 + * @since 3.50.0 + */ + this.timeScale = 1; + + /** + * The frame rate of playback, of the current animation, in frames per second. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the frame rate, provide a new value in the `PlayAnimationConfig` object. + * + * @name Phaser.Animations.AnimationState#frameRate + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.frameRate = 0; + + /** + * The duration of the current animation, in milliseconds. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the duration, provide a new value in the `PlayAnimationConfig` object. + * + * @name Phaser.Animations.AnimationState#duration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.duration = 0; + + /** + * The number of milliseconds per frame, not including frame specific modifiers that may be present in the + * Animation data. + * + * This value is calculated when a new animation is loaded into this component and should + * be treated as read-only. Changing it will not alter playback speed. + * + * @name Phaser.Animations.AnimationState#msPerFrame + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.msPerFrame = 0; + + /** + * Skip frames if the time lags, or always advanced anyway? + * + * @name Phaser.Animations.AnimationState#skipMissedFrames + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.skipMissedFrames = true; + + /** + * The delay before starting playback of the current animation, in milliseconds. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the delay, provide a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_delay`. + * + * @name Phaser.Animations.AnimationState#delay + * @type {number} + * @default 0 + * @since 3.50.0 + */ + this.delay = 0; + + /** + * The number of times to repeat playback of the current animation. + * + * If -1, it means the animation will repeat forever. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the number of repeats, provide a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_repeat`. + * + * @name Phaser.Animations.AnimationState#repeat + * @type {number} + * @default 0 + * @since 3.50.0 + */ + this.repeat = 0; + + /** + * The number of milliseconds to wait before starting the repeat playback of the current animation. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time. + * + * You can change the repeat delay by providing a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_repeatDelay`. + * + * @name Phaser.Animations.AnimationState#repeatDelay + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.repeatDelay = 0; + + /** + * Should the current animation yoyo? An animation that yoyos will play in reverse, from the end + * to the start, before then repeating or completing. An animation that does not yoyo will just + * play from the start to the end. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time. + * + * You can change the yoyo by providing a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_yoyo`. + * + * @name Phaser.Animations.AnimationState#yoyo + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.yoyo = false; + + /** + * Should the GameObject's `visible` property be set to `true` when the animation starts to play? + * + * This will happen _after_ any delay that may have been set. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time, assuming the animation is currently delayed. + * + * @name Phaser.Animations.AnimationState#showOnStart + * @type {boolean} + * @since 3.50.0 + */ + this.showOnStart = false; + + /** + * Should the GameObject's `visible` property be set to `false` when the animation completes? + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time, assuming the animation is still actively playing. + * + * @name Phaser.Animations.AnimationState#hideOnComplete + * @type {boolean} + * @since 3.50.0 + */ + this.hideOnComplete = false; + + /** + * Is the playhead moving forwards (`true`) or in reverse (`false`) ? + * + * @name Phaser.Animations.AnimationState#forward + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.forward = true; + + /** + * An internal trigger that tells the component if it should plays the animation + * in reverse mode ('true') or not ('false'). This is used because `forward` can + * be changed by the `yoyo` feature. + * + * Prior to Phaser 3.50 this property was private and called `_reverse`. + * + * @name Phaser.Animations.AnimationState#inReverse + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.inReverse = false; + + /** + * Internal time overflow accumulator. + * + * This has the `delta` time added to it as part of the `update` step. + * + * @name Phaser.Animations.AnimationState#accumulator + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.accumulator = 0; + + /** + * The time point at which the next animation frame will change. + * + * This value is compared against the `accumulator` as part of the `update` step. + * + * @name Phaser.Animations.AnimationState#nextTick + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.nextTick = 0; + + /** + * A counter keeping track of how much delay time, in milliseconds, is left before playback begins. + * + * This is set via the `playAfterDelay` method, although it can be modified at run-time + * if required, as long as the animation has not already started playing. + * + * @name Phaser.Animations.AnimationState#delayCounter + * @type {number} + * @default 0 + * @since 3.50.0 + */ + this.delayCounter = 0; + + /** + * A counter that keeps track of how many repeats are left to run. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time. + * + * @name Phaser.Animations.AnimationState#repeatCounter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.repeatCounter = 0; + + /** + * An internal flag keeping track of pending repeats. + * + * @name Phaser.Animations.AnimationState#pendingRepeat + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.pendingRepeat = false; + + /** + * Is the Animation paused? + * + * @name Phaser.Animations.AnimationState#_paused + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._paused = false; + + /** + * Was the animation previously playing before being paused? + * + * @name Phaser.Animations.AnimationState#_wasPlaying + * @type {boolean} + * @private + * @default false + * @since 3.0.0 + */ + this._wasPlaying = false; + + /** + * Internal property tracking if this Animation is waiting to stop. + * + * 0 = No + * 1 = Waiting for ms to pass + * 2 = Waiting for repeat + * 3 = Waiting for specific frame + * + * @name Phaser.Animations.AnimationState#_pendingStop + * @type {integer} + * @private + * @since 3.4.0 + */ + this._pendingStop = 0; + + /** + * Internal property used by _pendingStop. + * + * @name Phaser.Animations.AnimationState#_pendingStopValue + * @type {any} + * @private + * @since 3.4.0 + */ + this._pendingStopValue; + }, + + /** + * Sets an animation, or an array of animations, to be played in the future, after the current one completes or stops. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, + * or have one of the `stop` methods called. + * + * An animation set to repeat forever will never enter a completed state unless stopped. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` event). + * + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. + * + * Call this method with no arguments to reset all currently chained animations. + * + * @method Phaser.Animations.AnimationState#chain + * @since 3.16.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig|string[]|Phaser.Animations.Animation[]|Phaser.Types.Animations.PlayAnimationConfig[])} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + chain: function (key) + { + var parent = this.parent; + + if (key === undefined) + { + this.nextAnimsQueue.length = 0; + this.nextAnim = null; + + return parent; + } + + if (!Array.isArray(key)) + { + key = [ key ]; + } + + for (var i = 0; i < key.length; i++) + { + var anim = key[i]; + + if (this.nextAnim === null) + { + this.nextAnim = anim; + } + else + { + this.nextAnimsQueue.push(anim); + } + } + + return this.parent; + }, + + /** + * Returns the key of the animation currently loaded into this component. + * + * Prior to Phaser 3.50 this method was called `getCurrentKey`. + * + * @method Phaser.Animations.AnimationState#getName + * @since 3.50.0 + * + * @return {string} The key of the Animation currently loaded into this component, or an empty string if none loaded. + */ + getName: function () + { + return (this.currentAnim) ? this.currentAnim.key : ''; + }, + + /** + * Returns the key of the animation frame currently displayed by this component. + * + * @method Phaser.Animations.AnimationState#getFrameName + * @since 3.50.0 + * + * @return {string} The key of the Animation Frame currently displayed by this component, or an empty string if no animation has been loaded. + */ + getFrameName: function () + { + return (this.currentFrame) ? this.currentFrame.textureFrame : ''; + }, + + /** + * Internal method used to load an animation into this component. + * + * @method Phaser.Animations.AnimationState#load + * @protected + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or a `PlayAnimationConfig` object. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + load: function (key) + { + if (this.isPlaying) + { + this.stop(); + } + + var manager = this.animationManager; + var animKey = (typeof key === 'string') ? key : GetFastValue(key, 'key', null); + + // Get the animation, first from the local map and, if not found, from the Animation Manager + var anim = (this.exists(animKey)) ? this.get(animKey) : manager.get(animKey); + + if (!anim) + { + console.warn('Missing animation: ' + animKey); + } + else + { + this.currentAnim = anim; + + // And now override the animation values, if set in the config. + + var totalFrames = anim.getTotalFrames(); + var frameRate = GetFastValue(key, 'frameRate', anim.frameRate); + var duration = GetFastValue(key, 'duration', anim.duration); + + anim.calculateDuration(this, totalFrames, duration, frameRate); + + this.delay = GetFastValue(key, 'delay', anim.delay); + this.repeat = GetFastValue(key, 'repeat', anim.repeat); + this.repeatDelay = GetFastValue(key, 'repeatDelay', anim.repeatDelay); + this.yoyo = GetFastValue(key, 'yoyo', anim.yoyo); + this.showOnStart = GetFastValue(key, 'showOnStart', anim.showOnStart); + this.hideOnComplete = GetFastValue(key, 'hideOnComplete', anim.hideOnComplete); + this.skipMissedFrames = GetFastValue(key, 'skipMissedFrames', anim.skipMissedFrames); + + this.timeScale = GetFastValue(key, 'timeScale', this.timeScale); + + var startFrame = GetFastValue(key, 'startFrame', 0); + + if (startFrame > anim.getTotalFrames()) + { + startFrame = 0; + } + + var frame = anim.frames[startFrame]; + + if (startFrame === 0 && !this.forward) + { + frame = anim.getLastFrame(); + } + + this.currentFrame = frame; + } + + return this.parent; + }, + + /** + * Pause the current animation and set the `isPlaying` property to `false`. + * You can optionally pause it at a specific frame. + * + * @method Phaser.Animations.AnimationState#pause + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationFrame} [atFrame] - An optional frame to set after pausing the animation. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + pause: function (atFrame) + { + if (!this._paused) + { + this._paused = true; + this._wasPlaying = this.isPlaying; + this.isPlaying = false; + } + + if (atFrame !== undefined) + { + this.setCurrentFrame(atFrame); + } + + return this.parent; + }, + + /** + * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. + * You can optionally tell it to start playback from a specific frame. + * + * @method Phaser.Animations.AnimationState#resume + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationFrame} [fromFrame] - An optional frame to set before restarting playback. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + resume: function (fromFrame) + { + if (this._paused) + { + this._paused = false; + this.isPlaying = this._wasPlaying; + } + + if (fromFrame !== undefined) + { + this.setCurrentFrame(fromFrame); + } + + return this.parent; + }, + + /** + * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * + * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. + * + * If an animation is already running and a new animation is given to this method, it will wait for + * the given delay before starting the new animation. + * + * If no animation is currently running, the given one begins after the delay. + * + * Prior to Phaser 3.50 this method was called 'delayedPlay' and the parameters were in the reverse order. + * + * @method Phaser.Animations.AnimationState#playAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + playAfterDelay: function (key, delay) + { + if (!this.isPlaying) + { + this.delayCounter = delay; + + this.play(key, true); + } + else + { + // If we've got a nextAnim, move it to the queue + var nextAnim = this.nextAnim; + var queue = this.nextAnimsQueue; + + if (nextAnim) + { + queue.unshift(nextAnim); + } + + this.nextAnim = key; + + this._pendingStop = 1; + this._pendingStopValue = delay; + } + + return this.parent; + }, + + /** + * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback + * of the given animation. + * + * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an + * idle animation to a walking animation, by making them blend smoothly into each other. + * + * If no animation is currently running, the given one will start immediately. + * + * @method Phaser.Animations.AnimationState#playAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + playAfterRepeat: function (key, repeatCount) + { + if (repeatCount === undefined) { repeatCount = 1; } + + if (!this.isPlaying) + { + this.play(key); + } + else + { + // If we've got a nextAnim, move it to the queue + var nextAnim = this.nextAnim; + var queue = this.nextAnimsQueue; + + if (nextAnim) + { + queue.unshift(nextAnim); + } + + if (this.repeatCounter !== -1 && repeatCount > this.repeatCounter) + { + repeatCount = this.repeatCounter; + } + + this.nextAnim = key; + + this._pendingStop = 2; + this._pendingStopValue = repeatCount; + } + + return this.parent; + }, + + /** + * Start playing the given animation on this Sprite. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).play('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * + * @method Phaser.Animations.AnimationState#play + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.0.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + play: function (key, ignoreIfPlaying) + { + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + var currentAnim = this.currentAnim; + var parent = this.parent; + + // Must be either an Animation instance, or a PlayAnimationConfig object + var animKey = (typeof key === 'string') ? key : key.key; + + if (ignoreIfPlaying && this.isPlaying && currentAnim.key === animKey) + { + return parent; + } + + // Are we mixing? + if (currentAnim && this.isPlaying) + { + var mix = this.animationManager.getMix(currentAnim.key, key); + + if (mix > 0) + { + return this.playAfterDelay(key, mix); + } + } + + this.forward = true; + this.inReverse = false; + + this._paused = false; + this._wasPlaying = true; + + return this.startAnimation(key); + }, + + /** + * Start playing the given animation on this Sprite, in reverse. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).playReverse('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * + * @method Phaser.Animations.AnimationState#playReverse + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.12.0 + * + * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + playReverse: function (key, ignoreIfPlaying) + { + if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } + + // Must be either an Animation instance, or a PlayAnimationConfig object + var animKey = (typeof key === 'string') ? key : key.key; + + if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === animKey) + { + return this.parent; + } + + this.forward = false; + this.inReverse = true; + + this._paused = false; + this._wasPlaying = true; + + return this.startAnimation(key); + }, + + /** + * Load the animation based on the key and set-up all of the internal values + * needed for playback to start. If there is no delay, it will also fire the start events. + * + * @method Phaser.Animations.AnimationState#startAnimation + * @fires Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {(string|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or a `PlayAnimationConfig` object. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + startAnimation: function (key) + { + this.load(key); + + var anim = this.currentAnim; + var gameObject = this.parent; + + if (!anim) + { + return gameObject; + } + + // Should give us 9,007,199,254,740,991 safe repeats + this.repeatCounter = (this.repeat === -1) ? Number.MAX_VALUE : this.repeat; + + anim.getFirstTick(this); + + this.isPlaying = true; + this.pendingRepeat = false; + this.hasStarted = false; + + this._pendingStop = 0; + this._pendingStopValue = 0; + this._paused = false; + + // Add any delay the animation itself may have had as well + this.delayCounter += this.delay; + + if (this.delayCounter === 0) + { + this.handleStart(); + } + + return gameObject; + }, + + /** + * Handles the start of an animation playback. + * + * @method Phaser.Animations.AnimationState#handleStart + * @private + * @since 3.50.0 + */ + handleStart: function () + { + if (this.showOnStart) + { + this.parent.setVisible(true); + } + + this.setCurrentFrame(this.currentFrame); + + this.hasStarted = true; + + this.emitEvents(Events.ANIMATION_START); + }, + + /** + * Handles the repeat of an animation. + * + * @method Phaser.Animations.AnimationState#handleRepeat + * @private + * @since 3.50.0 + */ + handleRepeat: function () + { + this.pendingRepeat = false; + + this.emitEvents(Events.ANIMATION_REPEAT); + }, + + /** + * Handles the stop of an animation playback. + * + * @method Phaser.Animations.AnimationState#handleStop + * @private + * @since 3.50.0 + */ + handleStop: function () + { + this._pendingStop = 0; + + this.isPlaying = false; + + this.emitEvents(Events.ANIMATION_STOP); + }, + + /** + * Handles the completion of an animation playback. + * + * @method Phaser.Animations.AnimationState#handleComplete + * @private + * @since 3.50.0 + */ + handleComplete: function () + { + this._pendingStop = 0; + + this.isPlaying = false; + + if (this.hideOnComplete) + { + this.parent.setVisible(false); + } + + this.emitEvents(Events.ANIMATION_COMPLETE, Events.ANIMATION_COMPLETE_KEY); + }, + + /** + * Fires the given animation event. + * + * @method Phaser.Animations.AnimationState#emitEvents + * @private + * @since 3.50.0 + * + * @param {string} event - The Animation Event to dispatch. + */ + emitEvents: function (event, keyEvent) + { + var anim = this.currentAnim; + var frame = this.currentFrame; + var gameObject = this.parent; + + var frameKey = frame.textureFrame; + + gameObject.emit(event, anim, frame, gameObject, frameKey); + + if (keyEvent) + { + gameObject.emit(keyEvent + anim.key, anim, frame, gameObject, frameKey); + } + }, + + /** + * Reverse the Animation that is already playing on the Game Object. + * + * @method Phaser.Animations.AnimationState#reverse + * @since 3.12.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + reverse: function () + { + if (this.isPlaying) + { + this.inReverse = !this.inReverse; + + this.forward = !this.forward; + } + + return this.parent; + }, + + /** + * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. + * + * The value is based on the current frame and how far that is in the animation, it is not based on + * the duration of the animation. + * + * @method Phaser.Animations.AnimationState#getProgress + * @since 3.4.0 + * + * @return {number} The progress of the current animation in frames, between 0 and 1. + */ + getProgress: function () + { + var frame = this.currentFrame; + + if (!frame) + { + return 0; + } + + var p = frame.progress; + + if (this.inReverse) + { + p *= -1; + } + + return p; + }, + + /** + * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. + * + * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. + * + * The value is based on the current frame and how far that is in the animation, it is not based on + * the duration of the animation. + * + * @method Phaser.Animations.AnimationState#setProgress + * @since 3.4.0 + * + * @param {number} [value=0] - The progress value, between 0 and 1. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + setProgress: function (value) + { + if (!this.forward) + { + value = 1 - value; + } + + this.setCurrentFrame(this.currentAnim.getFrameByProgress(value)); + + return this.parent; + }, + + /** + * Sets the number of times that the animation should repeat after its first play through. + * For example, if repeat is 1, the animation will play a total of twice: the initial play plus 1 repeat. + * + * To repeat indefinitely, use -1. + * The value should always be an integer. + * + * Calling this method only works if the animation is already running. Otherwise, any + * value specified here will be overwritten when the next animation loads in. To avoid this, + * use the `repeat` property of the `PlayAnimationConfig` object instead. + * + * @method Phaser.Animations.AnimationState#setRepeat + * @since 3.4.0 + * + * @param {integer} value - The number of times that the animation should repeat. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + setRepeat: function (value) + { + this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; + + return this.parent; + }, + + /** + * Handle the removal of an animation from the Animation Manager. + * + * @method Phaser.Animations.AnimationState#globalRemove + * @since 3.50.0 + * + * @param {string} [key] - The key of the removed Animation. + * @param {Phaser.Animations.Animation} [animation] - The removed Animation. + */ + globalRemove: function (key, animation) + { + if (animation === undefined) { animation = this.currentAnim; } + + if (this.isPlaying && animation.key === this.currentAnim.key) + { + this.stop(); + + this.setCurrentFrame(this.currentAnim.frames[0]); + } + }, + + /** + * Restarts the current animation from its beginning. + * + * You can optionally reset the delay and repeat counters as well. + * + * Calling this will fire the `ANIMATION_RESTART` event immediately. + * + * If you `includeDelay` then it will also fire the `ANIMATION_START` event once + * the delay has expired, otherwise, playback will just begin immediately. + * + * @method Phaser.Animations.AnimationState#restart + * @fires Phaser.Animations.Events#ANIMATION_RESTART + * @since 3.0.0 + * + * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. + * @param {boolean} [resetRepeats=false] - Whether to reset the repeat counter or not? + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + restart: function (includeDelay, resetRepeats) + { + if (includeDelay === undefined) { includeDelay = false; } + if (resetRepeats === undefined) { resetRepeats = false; } + + var anim = this.currentAnim; + var gameObject = this.parent; + + if (!anim) + { + return gameObject; + } + + if (resetRepeats) + { + this.repeatCounter = (this.repeat === -1) ? Number.MAX_VALUE : this.repeat; + } + + anim.getFirstTick(this); + + this.emitEvents(Events.ANIMATION_RESTART); + + this.isPlaying = true; + this.pendingRepeat = false; + + // Set this to `true` if there is no delay to include, so it skips the `hasStarted` check in `update`. + this.hasStarted = !includeDelay; + + this._pendingStop = 0; + this._pendingStopValue = 0; + this._paused = false; + + this.setCurrentFrame(anim.frames[0]); + + return this.parent; + }, + + /** + * The current animation has completed. This dispatches the `ANIMATION_COMPLETE` event. + * + * This method is called by the Animation instance and should not usually be invoked directly. + * + * If no animation is loaded, no events will be dispatched. + * + * If another animation has been queued for playback, it will be started after the events fire. + * + * @method Phaser.Animations.AnimationState#complete + * @fires Phaser.Animations.Events#ANIMATION_COMPLETE + * @since 3.50.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + complete: function () + { + this._pendingStop = 0; + + this.isPlaying = false; + + if (this.currentAnim) + { + this.handleComplete(); + } + + if (this.nextAnim) + { + var key = this.nextAnim; + + this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null; + + this.play(key); + } + + return this.parent; + }, + + /** + * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing. + * + * @method Phaser.Animations.AnimationState#stop + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.0.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stop: function () + { + this._pendingStop = 0; + + this.isPlaying = false; + + if (this.currentAnim) + { + this.handleStop(); + } + + if (this.nextAnim) + { + var key = this.nextAnim; + + this.nextAnim = this.nextAnimsQueue.shift(); + + this.play(key); + } + + return this.parent; + }, + + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.Animations.AnimationState#stopAfterDelay + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.4.0 + * + * @param {integer} delay - The number of milliseconds to wait before stopping this animation. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stopAfterDelay: function (delay) + { + this._pendingStop = 1; + this._pendingStopValue = delay; + + return this.parent; + }, + + /** + * Stops the current animation from playing when it next repeats. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * Prior to Phaser 3.50 this method was called `stopOnRepeat` and had no parameters. + * + * @method Phaser.Animations.AnimationState#stopAfterRepeat + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stopAfterRepeat: function (repeatCount) + { + if (repeatCount === undefined) { repeatCount = 1; } + + if (this.repeatCounter !== -1 && repeatCount > this.repeatCounter) + { + repeatCount = this.repeatCounter; + } + + this._pendingStop = 2; + this._pendingStopValue = repeatCount; + + return this.parent; + }, + + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * @method Phaser.Animations.AnimationState#stopOnFrame + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.4.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. + * + * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. + */ + stopOnFrame: function (frame) + { + this._pendingStop = 3; + this._pendingStopValue = frame; + + return this.parent; + }, + + /** + * Returns the total number of frames in this animation, or returns zero if no + * animation has been loaded. + * + * @method Phaser.Animations.AnimationState#getTotalFrames + * @since 3.4.0 + * + * @return {integer} The total number of frames in the current animation, or zero if no animation has been loaded. + */ + getTotalFrames: function () + { + return (this.currentAnim) ? this.currentAnim.getTotalFrames() : 0; + }, + + /** + * The internal update loop for the AnimationState Component. + * + * This is called automatically by the `Sprite.preUpdate` method. + * + * @method Phaser.Animations.AnimationState#update + * @since 3.0.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + update: function (time, delta) + { + var anim = this.currentAnim; + + if (!this.isPlaying || !anim || anim.paused) + { + return; + } + + this.accumulator += delta * this.timeScale; + + if (this._pendingStop === 1) + { + this._pendingStopValue -= delta; + + if (this._pendingStopValue <= 0) + { + return this.stop(); + } + } + + if (!this.hasStarted) + { + if (this.accumulator >= this.delayCounter) + { + this.accumulator -= this.delayCounter; + + this.handleStart(); + } + } + else if (this.accumulator >= this.nextTick) + { + // Process one frame advance as standard + + if (this.forward) + { + anim.nextFrame(this); + } + else + { + anim.previousFrame(this); + } + + // And only do more if we're skipping frames and have time left + if (this.isPlaying && this._pendingStop === 0 && this.skipMissedFrames && this.accumulator > this.nextTick) + { + var safetyNet = 0; + + do + { + if (this.forward) + { + anim.nextFrame(this); + } + else + { + anim.previousFrame(this); + } + + safetyNet++; + + } while (this.accumulator > this.nextTick && safetyNet < 60); + } + } + }, + + /** + * Sets the given Animation Frame as being the current frame + * and applies it to the parent Game Object, adjusting size and origin as needed. + * + * @method Phaser.Animations.AnimationState#setCurrentFrame + * @fires Phaser.Animations.Events#ANIMATION_UPDATE + * @fires Phaser.Animations.Events#ANIMATION_STOP + * @since 3.4.0 + * + * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to. + * + * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. + */ + setCurrentFrame: function (animationFrame) + { + var gameObject = this.parent; + + this.currentFrame = animationFrame; + + gameObject.texture = animationFrame.frame.texture; + gameObject.frame = animationFrame.frame; + + if (gameObject.isCropped) + { + gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); + } + + if (animationFrame.setAlpha) + { + gameObject.alpha = animationFrame.alpha; + } + + gameObject.setSizeToFrame(); + + if (gameObject._originComponent) + { + if (animationFrame.frame.customPivot) + { + gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY); + } + else + { + gameObject.updateDisplayOrigin(); + } + } + + if (this.isPlaying && this.hasStarted) + { + this.emitEvents(Events.ANIMATION_UPDATE); + + if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) + { + this.stop(); + } + } + + return gameObject; + }, + + /** + * Advances the animation to the next frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in reverse, calling this method doesn't then change the direction to forwards. + * + * @method Phaser.Animations.AnimationState#nextFrame + * @since 3.16.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. + */ + nextFrame: function () + { + if (this.currentAnim) + { + this.currentAnim.nextFrame(this); + } + + return this.parent; + }, + + /** + * Advances the animation to the previous frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in forwards, calling this method doesn't then change the direction to backwards. + * + * @method Phaser.Animations.AnimationState#previousFrame + * @since 3.16.0 + * + * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. + */ + previousFrame: function () + { + if (this.currentAnim) + { + this.currentAnim.previousFrame(this); + } + + return this.parent; + }, + + /** + * Get an Animation instance that has been created locally on this Sprite. + * + * See the `create` method for more details. + * + * @method Phaser.Animations.AnimationState#get + * @since 3.50.0 + * + * @param {string} key - The key of the Animation to retrieve. + * + * @return {Phaser.Animations.Animation} The Animation, or `null` if the key is invalid. + */ + get: function (key) + { + return (this.anims) ? this.anims.get(key) : null; + }, + + /** + * Checks to see if the given key is already used locally within the animations stored on this Sprite. + * + * @method Phaser.Animations.AnimationState#exists + * @since 3.50.0 + * + * @param {string} key - The key of the Animation to check. + * + * @return {boolean} `true` if the Animation exists locally, or `false` if the key is available, or there are no local animations. + */ + exists: function (key) + { + return (this.anims) ? this.anims.has(key) : false; + }, + + /** + * Creates a new Animation that is local specifically to this Sprite. + * + * When a Sprite owns an animation, it is kept out of the global Animation Manager, which means + * you're free to use keys that may be already defined there. Unless you specifically need a Sprite + * to have a unique animation, you should favor using global animations instead, as they allow for + * the same animation to be used across multiple Sprites, saving on memory. However, if this Sprite + * is the only one to use this animation, it's sensible to create it here. + * + * If an invalid key is given this method will return `false`. + * + * If you pass the key of an animation that already exists locally, that animation will be returned. + * + * A brand new animation is only created if the key is valid and not already in use by this Sprite. + * + * If you wish to re-use an existing key, call the `remove` method first, then this method. + * + * @method Phaser.Animations.AnimationState#create + * @since 3.50.0 + * + * @param {Phaser.Types.Animations.Animation} config - The configuration settings for the Animation. + * + * @return {(Phaser.Animations.Animation|false)} The Animation that was created, or `false` if the key is already in use. + */ + create: function (config) + { + var key = config.key; + + var anim = false; + + if (key) + { + anim = this.get(key); + + if (!anim) + { + anim = new Animation(this, key, config); + + if (!this.anims) + { + this.anims = new CustomMap(); + } + + this.anims.set(key, anim); + } + } + + return anim; + }, + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. + * + * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. + * + * Example: + * + * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * + * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'ruby', + * repeat: -1, + * frames: this.anims.generateFrameNames('gems', { + * prefix: 'ruby_', + * end: 6, + * zeroPad: 4 + * }) + * }); + * ``` + * + * Please see the animation examples for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNames + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNames} [config] - The configuration object for the animation frame names. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNames: function (key, config) + { + return this.animationManager.generateFrameNames(key, config); + }, + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNumbers + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNumbers} config - The configuration object for the animation frames. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNumbers: function (key, config) + { + return this.animationManager.generateFrameNumbers(key, config); + }, + + /** + * Removes a locally created Animation from this Sprite, based on the given key. + * + * Once an Animation has been removed, this Sprite cannot play it again without re-creating it. + * + * @method Phaser.Animations.AnimationState#remove + * @since 3.50.0 + * + * @param {string} key - The key of the animation to remove. + * + * @return {Phaser.Animations.Animation} The Animation instance that was removed from this Sprite, if the key was valid. + */ + remove: function (key) + { + var anim = this.get(key); + + if (anim) + { + if (this.currentAnim === anim) + { + this.stop(); + } + + this.anims.delete(key); + } + + return anim; + }, + + /** + * Destroy this Animation component. + * + * Unregisters event listeners and cleans up its references. + * + * @method Phaser.Animations.AnimationState#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.animationManager.off(Events.REMOVE_ANIMATION, this.globalRemove, this); + + if (this.anims) + { + this.anims.clear(); + } + + this.animationManager = null; + this.parent = null; + this.nextAnim = null; + this.nextAnimsQueue.length = 0; + + this.currentAnim = null; + this.currentFrame = null; + }, + + /** + * `true` if the current animation is paused, otherwise `false`. + * + * @name Phaser.Animations.AnimationState#isPaused + * @readonly + * @type {boolean} + * @since 3.4.0 + */ + isPaused: { + + get: function () + { + return this._paused; + } + + } + +}); + +module.exports = AnimationState; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @callback EachMapCallback + * + * @param {string} key - The key of the Map entry. + * @param {E} entry - The value of the Map entry. + * + * @return {?boolean} The callback result. + */ + +/** + * @classdesc + * The keys of a Map can be arbitrary values. + * + * ```javascript + * var map = new Map([ + * [ 1, 'one' ], + * [ 2, 'two' ], + * [ 3, 'three' ] + * ]); + * ``` + * + * @class Map + * @memberof Phaser.Structs + * @constructor + * @since 3.0.0 + * + * @generic K + * @generic V + * @genericUse {V[]} - [elements] + * + * @param {Array.<*>} elements - An optional array of key-value pairs to populate this Map with. + */ +var Map = new Class({ + + initialize: + + function Map (elements) + { + /** + * The entries in this Map. + * + * @genericUse {Object.} - [$type] + * + * @name Phaser.Structs.Map#entries + * @type {Object.} + * @default {} + * @since 3.0.0 + */ + this.entries = {}; + + /** + * The number of key / value pairs in this Map. + * + * @name Phaser.Structs.Map#size + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.size = 0; + + if (Array.isArray(elements)) + { + for (var i = 0; i < elements.length; i++) + { + this.set(elements[i][0], elements[i][1]); + } + } + }, + + /** + * Adds an element with a specified `key` and `value` to this Map. + * If the `key` already exists, the value will be replaced. + * + * @method Phaser.Structs.Map#set + * @since 3.0.0 + * + * @genericUse {K} - [key] + * @genericUse {V} - [value] + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @param {string} key - The key of the element to be added to this Map. + * @param {*} value - The value of the element to be added to this Map. + * + * @return {Phaser.Structs.Map} This Map object. + */ + set: function (key, value) + { + if (!this.has(key)) + { + this.size++; + } + + this.entries[key] = value; + + return this; + }, + + /** + * Returns the value associated to the `key`, or `undefined` if there is none. + * + * @method Phaser.Structs.Map#get + * @since 3.0.0 + * + * @genericUse {K} - [key] + * @genericUse {V} - [$return] + * + * @param {string} key - The key of the element to return from the `Map` object. + * + * @return {*} The element associated with the specified key or `undefined` if the key can't be found in this Map object. + */ + get: function (key) + { + if (this.has(key)) + { + return this.entries[key]; + } + }, + + /** + * Returns an `Array` of all the values stored in this Map. + * + * @method Phaser.Structs.Map#getArray + * @since 3.0.0 + * + * @genericUse {V[]} - [$return] + * + * @return {Array.<*>} An array of the values stored in this Map. + */ + getArray: function () + { + var output = []; + var entries = this.entries; + + for (var key in entries) + { + output.push(entries[key]); + } + + return output; + }, + + /** + * Returns a boolean indicating whether an element with the specified key exists or not. + * + * @method Phaser.Structs.Map#has + * @since 3.0.0 + * + * @genericUse {K} - [key] + * + * @param {string} key - The key of the element to test for presence of in this Map. + * + * @return {boolean} Returns `true` if an element with the specified key exists in this Map, otherwise `false`. + */ + has: function (key) + { + return (this.entries.hasOwnProperty(key)); + }, + + /** + * Delete the specified element from this Map. + * + * @method Phaser.Structs.Map#delete + * @since 3.0.0 + * + * @genericUse {K} - [key] + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @param {string} key - The key of the element to delete from this Map. + * + * @return {Phaser.Structs.Map} This Map object. + */ + delete: function (key) + { + if (this.has(key)) + { + delete this.entries[key]; + this.size--; + } + + return this; + }, + + /** + * Delete all entries from this Map. + * + * @method Phaser.Structs.Map#clear + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @return {Phaser.Structs.Map} This Map object. + */ + clear: function () + { + Object.keys(this.entries).forEach(function (prop) + { + delete this.entries[prop]; + + }, this); + + this.size = 0; + + return this; + }, + + /** + * Returns all entries keys in this Map. + * + * @method Phaser.Structs.Map#keys + * @since 3.0.0 + * + * @genericUse {K[]} - [$return] + * + * @return {string[]} Array containing entries' keys. + */ + keys: function () + { + return Object.keys(this.entries); + }, + + /** + * Returns an `Array` of all entries. + * + * @method Phaser.Structs.Map#values + * @since 3.0.0 + * + * @genericUse {V[]} - [$return] + * + * @return {Array.<*>} An `Array` of entries. + */ + values: function () + { + var output = []; + var entries = this.entries; + + for (var key in entries) + { + output.push(entries[key]); + } + + return output; + }, + + /** + * Dumps the contents of this Map to the console via `console.group`. + * + * @method Phaser.Structs.Map#dump + * @since 3.0.0 + */ + dump: function () + { + var entries = this.entries; + + // eslint-disable-next-line no-console + console.group('Map'); + + for (var key in entries) + { + console.log(key, entries[key]); + } + + // eslint-disable-next-line no-console + console.groupEnd(); + }, + + /** + * Passes all entries in this Map to the given callback. + * + * @method Phaser.Structs.Map#each + * @since 3.0.0 + * + * @genericUse {EachMapCallback.} - [callback] + * @genericUse {Phaser.Structs.Map.} - [$return] + * + * @param {EachMapCallback} callback - The callback which will receive the keys and entries held in this Map. + * + * @return {Phaser.Structs.Map} This Map object. + */ + each: function (callback) + { + var entries = this.entries; + + for (var key in entries) + { + if (callback(key, entries[key]) === false) + { + break; + } + } + + return this; + }, + + /** + * Returns `true` if the value exists within this Map. Otherwise, returns `false`. + * + * @method Phaser.Structs.Map#contains + * @since 3.0.0 + * + * @genericUse {V} - [value] + * + * @param {*} value - The value to search for. + * + * @return {boolean} `true` if the value is found, otherwise `false`. + */ + contains: function (value) + { + var entries = this.entries; + + for (var key in entries) + { + if (entries[key] === value) + { + return true; + } + } + + return false; + }, + + /** + * Merges all new keys from the given Map into this one. + * If it encounters a key that already exists it will be skipped unless override is set to `true`. + * + * @method Phaser.Structs.Map#merge + * @since 3.0.0 + * + * @genericUse {Phaser.Structs.Map.} - [map,$return] + * + * @param {Phaser.Structs.Map} map - The Map to merge in to this Map. + * @param {boolean} [override=false] - Set to `true` to replace values in this Map with those from the source map, or `false` to skip them. + * + * @return {Phaser.Structs.Map} This Map object. + */ + merge: function (map, override) + { + if (override === undefined) { override = false; } + + var local = this.entries; + var source = map.entries; + + for (var key in source) + { + if (local.hasOwnProperty(key) && override) + { + local[key] = source[key]; + } + else + { + this.set(key, source[key]); + } + } + + return this; + } + +}); + +module.exports = Map; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue} + * + * @function Phaser.Utils.Objects.GetFastValue + * @since 3.0.0 + * + * @param {object} source - The object to search + * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods) + * @param {*} [defaultValue] - The default value to use if the key does not exist. + * + * @return {*} The value if found; otherwise, defaultValue (null if none provided) + */ +var GetFastValue = function (source, key, defaultValue) +{ + var t = typeof(source); + + if (!source || t === 'number' || t === 'string') + { + return defaultValue; + } + else if (source.hasOwnProperty(key) && source[key] !== undefined) + { + return source[key]; + } + else + { + return defaultValue; + } +}; + +module.exports = GetFastValue; + + +/***/ }), +/* 184 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Add Animation Event. + * + * This event is dispatched when a new animation is added to the global Animation Manager. + * + * This can happen either as a result of an animation instance being added to the Animation Manager, + * or the Animation Manager creating a new animation directly. + * + * @event Phaser.Animations.Events#ADD_ANIMATION + * @since 3.0.0 + * + * @param {string} key - The key of the Animation that was added to the global Animation Manager. + * @param {Phaser.Animations.Animation} animation - An instance of the newly created Animation. + */ +module.exports = 'add'; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Complete Event. + * + * This event is dispatched by a Sprite when an animation playing on it completes playback. + * This happens when the animation gets to the end of its sequence, factoring in any delays + * or repeats it may have to process. + * + * An animation that is set to loop, or repeat forever, will never fire this event, because + * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` + * event instead, as this is emitted when the animation is stopped directly. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + * + * @event Phaser.Animations.Events#ANIMATION_COMPLETE + * @since 3.50.0 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. + * @param {string} frameKey - The unique key of the Animation Frame within the Animation. + */ +module.exports = 'animationcomplete'; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Complete Dynamic Key Event. + * + * This event is dispatched by a Sprite when an animation playing on it completes playback. + * This happens when the animation gets to the end of its sequence, factoring in any delays + * or repeats it may have to process. + * + * An animation that is set to loop, or repeat forever, will never fire this event, because + * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` + * event instead, as this is emitted when the animation is stopped directly. + * + * The difference between this and the `ANIMATION_COMPLETE` event is that this one has a + * dynamic event name that contains the name of the animation within it. For example, + * if you had an animation called `explode` you could listen for the completion of that + * specific animation by using: `sprite.on('animationcomplete-explode', listener)`. Or, if you + * wish to use types: `sprite.on(Phaser.Animations.Events.ANIMATION_COMPLETE_KEY + 'explode', listener)`. + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + * + * @event Phaser.Animations.Events#ANIMATION_COMPLETE_KEY + * @since 3.50.0 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. + * @param {string} frameKey - The unique key of the Animation Frame within the Animation. + */ +module.exports = 'animationcomplete-'; + + +/***/ }), +/* 187 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Repeat Event. + * + * This event is dispatched by a Sprite when an animation repeats playing on it. + * This happens if the animation was created, or played, with a `repeat` value specified. + * + * An animation will repeat when it reaches the end of its sequence. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + * + * @event Phaser.Animations.Events#ANIMATION_REPEAT + * @since 3.50.0 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has repeated. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated. + * @param {string} frameKey - The unique key of the Animation Frame within the Animation. + */ +module.exports = 'animationrepeat'; + + +/***/ }), +/* 188 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Restart Event. + * + * This event is dispatched by a Sprite when an animation restarts playing on it. + * This only happens when the `Sprite.anims.restart` method is called. + * + * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + * + * @event Phaser.Animations.Events#ANIMATION_RESTART + * @since 3.50.0 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has restarted. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted. + * @param {string} frameKey - The unique key of the Animation Frame within the Animation. + */ +module.exports = 'animationrestart'; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Start Event. + * + * This event is dispatched by a Sprite when an animation starts playing on it. + * This happens when the animation is played, factoring in any delay that may have been specified. + * This event happens after the delay has expired and prior to the first update event. + * + * Listen for it on the Sprite using `sprite.on('animationstart', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + * + * @event Phaser.Animations.Events#ANIMATION_START + * @since 3.50.0 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has started. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started. + * @param {string} frameKey - The unique key of the Animation Frame within the Animation. + */ +module.exports = 'animationstart'; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Stop Event. + * + * This event is dispatched by a Sprite when an animation is stopped on it. An animation + * will only be stopeed if a method such as `Sprite.stop` or `Sprite.anims.stopAfterDelay` + * is called. It can also be emitted if a new animation is started before the current one completes. + * + * Listen for it on the Sprite using `sprite.on('animationstop', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + * + * @event Phaser.Animations.Events#ANIMATION_STOP + * @since 3.50.0 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has stopped. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation stopped. + * @param {string} frameKey - The unique key of the Animation Frame within the Animation. + */ +module.exports = 'animationstop'; + + +/***/ }), +/* 191 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Animation Update Event. + * + * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame. + * An animation will change frame based on the frme rate and other factors like `timeScale` and `delay`. It can also change + * frame when stopped or restarted. + * + * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` + * + * If an animation is playing faster than the game frame-rate can handle, it's entirely possible for it to emit several + * update events in a single game frame, so please be aware of this in your code. The **final** event received that frame + * is the one that is rendered to the game. + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + * + * @event Phaser.Animations.Events#ANIMATION_UPDATE + * @since 3.50.0 + * + * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated. + * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. + * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. + * @param {string} frameKey - The unique key of the Animation Frame within the Animation. + */ +module.exports = 'animationupdate'; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pause All Animations Event. + * + * This event is dispatched when the global Animation Manager is told to pause. + * + * When this happens all current animations will stop updating, although it doesn't necessarily mean + * that the game has paused as well. + * + * @event Phaser.Animations.Events#PAUSE_ALL + * @since 3.0.0 + */ +module.exports = 'pauseall'; + + +/***/ }), +/* 193 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Remove Animation Event. + * + * This event is dispatched when an animation is removed from the global Animation Manager. + * + * @event Phaser.Animations.Events#REMOVE_ANIMATION + * @since 3.0.0 + * + * @param {string} key - The key of the Animation that was removed from the global Animation Manager. + * @param {Phaser.Animations.Animation} animation - An instance of the removed Animation. + */ +module.exports = 'remove'; + + +/***/ }), +/* 194 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Resume All Animations Event. + * + * This event is dispatched when the global Animation Manager resumes, having been previously paused. + * + * When this happens all current animations will continue updating again. + * + * @event Phaser.Animations.Events#RESUME_ALL + * @since 3.0.0 + */ +module.exports = 'resumeall'; + + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(4); +var Class = __webpack_require__(0); +var Events = __webpack_require__(38); +var FindClosestInSorted = __webpack_require__(196); +var Frame = __webpack_require__(197); +var GetValue = __webpack_require__(12); +var SortByDigits = __webpack_require__(198); + +/** + * @classdesc + * A Frame based Animation. + * + * Animations in Phaser consist of a sequence of `AnimationFrame` objects, which are managed by + * this class, along with properties that impact playback, such as the animations frame rate + * or delay. + * + * This class contains all of the properties and methods needed to handle playback of the animation + * directly to an `AnimationState` instance, which is owned by a Sprite, or similar Game Object. + * + * You don't typically create an instance of this class directly, but instead go via + * either the `AnimationManager` or the `AnimationState` and use their `create` methods, + * depending on if you need a global animation, or local to a specific Sprite. + * + * @class Animation + * @memberof Phaser.Animations + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager + * @param {string} key - The unique identifying string for this animation. + * @param {Phaser.Types.Animations.Animation} config - The Animation configuration. + */ +var Animation = new Class({ + + initialize: + + function Animation (manager, key, config) + { + /** + * A reference to the global Animation Manager. + * + * @name Phaser.Animations.Animation#manager + * @type {Phaser.Animations.AnimationManager} + * @since 3.0.0 + */ + this.manager = manager; + + /** + * The unique identifying string for this animation. + * + * @name Phaser.Animations.Animation#key + * @type {string} + * @since 3.0.0 + */ + this.key = key; + + /** + * A frame based animation (as opposed to a bone based animation) + * + * @name Phaser.Animations.Animation#type + * @type {string} + * @default frame + * @since 3.0.0 + */ + this.type = 'frame'; + + /** + * Extract all the frame data into the frames array. + * + * @name Phaser.Animations.Animation#frames + * @type {Phaser.Animations.AnimationFrame[]} + * @since 3.0.0 + */ + this.frames = this.getFrames( + manager.textureManager, + GetValue(config, 'frames', []), + GetValue(config, 'defaultTextureKey', null), + GetValue(config, 'sortFrames', true) + ); + + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + * + * @name Phaser.Animations.Animation#frameRate + * @type {integer} + * @default 24 + * @since 3.0.0 + */ + this.frameRate = GetValue(config, 'frameRate', null); + + /** + * How long the animation should play for, in milliseconds. + * If the `frameRate` property has been set then it overrides this value, + * otherwise the `frameRate` is derived from `duration`. + * + * @name Phaser.Animations.Animation#duration + * @type {integer} + * @since 3.0.0 + */ + this.duration = GetValue(config, 'duration', null); + + /** + * How many ms per frame, not including frame specific modifiers. + * + * @name Phaser.Animations.Animation#msPerFrame + * @type {integer} + * @since 3.0.0 + */ + this.msPerFrame; + + /** + * Skip frames if the time lags, or always advanced anyway? + * + * @name Phaser.Animations.Animation#skipMissedFrames + * @type {boolean} + * @default true + * @since 3.0.0 + */ + this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true); + + /** + * The delay in ms before the playback will begin. + * + * @name Phaser.Animations.Animation#delay + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.delay = GetValue(config, 'delay', 0); + + /** + * Number of times to repeat the animation. Set to -1 to repeat forever. + * + * @name Phaser.Animations.Animation#repeat + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.repeat = GetValue(config, 'repeat', 0); + + /** + * The delay in ms before the a repeat play starts. + * + * @name Phaser.Animations.Animation#repeatDelay + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + this.repeatDelay = GetValue(config, 'repeatDelay', 0); + + /** + * Should the animation yoyo (reverse back down to the start) before repeating? + * + * @name Phaser.Animations.Animation#yoyo + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.yoyo = GetValue(config, 'yoyo', false); + + /** + * Should the GameObject's `visible` property be set to `true` when the animation starts to play? + * + * @name Phaser.Animations.Animation#showOnStart + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.showOnStart = GetValue(config, 'showOnStart', false); + + /** + * Should the GameObject's `visible` property be set to `false` when the animation finishes? + * + * @name Phaser.Animations.Animation#hideOnComplete + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.hideOnComplete = GetValue(config, 'hideOnComplete', false); + + /** + * Global pause. All Game Objects using this Animation instance are impacted by this property. + * + * @name Phaser.Animations.Animation#paused + * @type {boolean} + * @default false + * @since 3.0.0 + */ + this.paused = false; + + this.calculateDuration(this, this.getTotalFrames(), this.duration, this.frameRate); + + if (this.manager.on) + { + this.manager.on(Events.PAUSE_ALL, this.pause, this); + this.manager.on(Events.RESUME_ALL, this.resume, this); + } + }, + + /** + * Gets the total number of frames in this animation. + * + * @method Phaser.Animations.Animation#getTotalFrames + * @since 3.50.0 + * + * @return {number} The total number of frames in this animation. + */ + getTotalFrames: function () + { + return this.frames.length; + }, + + /** + * Calculates the duration, frame rate and msPerFrame values. + * + * @method Phaser.Animations.Animation#calculateDuration + * @since 3.50.0 + * + * @param {(Phaser.Animations.Animation|Phaser.GameObjects.Components.Animation)} target - The target to set the values on. + * @param {number} totalFrames - The total number of frames in the animation. + * @param {number} duration - The duration to calculate the frame rate from. + * @param {number} frameRate - The frame ate to calculate the duration from. + */ + calculateDuration: function (target, totalFrames, duration, frameRate) + { + if (duration === null && frameRate === null) + { + // No duration or frameRate given, use default frameRate of 24fps + target.frameRate = 24; + target.duration = (24 / totalFrames) * 1000; + } + else if (duration && frameRate === null) + { + // Duration given but no frameRate, so set the frameRate based on duration + // I.e. 12 frames in the animation, duration = 4000 ms + // So frameRate is 12 / (4000 / 1000) = 3 fps + target.duration = duration; + target.frameRate = totalFrames / (duration / 1000); + } + else + { + // frameRate given, derive duration from it (even if duration also specified) + // I.e. 15 frames in the animation, frameRate = 30 fps + // So duration is 15 / 30 = 0.5 * 1000 (half a second, or 500ms) + target.frameRate = frameRate; + target.duration = (totalFrames / frameRate) * 1000; + } + + target.msPerFrame = 1000 / target.frameRate; + }, + + /** + * Add frames to the end of the animation. + * + * @method Phaser.Animations.Animation#addFrame + * @since 3.0.0 + * + * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. + * + * @return {this} This Animation object. + */ + addFrame: function (config) + { + return this.addFrameAt(this.frames.length, config); + }, + + /** + * Add frame/s into the animation. + * + * @method Phaser.Animations.Animation#addFrameAt + * @since 3.0.0 + * + * @param {integer} index - The index to insert the frame at within the animation. + * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. + * + * @return {this} This Animation object. + */ + addFrameAt: function (index, config) + { + var newFrames = this.getFrames(this.manager.textureManager, config); + + if (newFrames.length > 0) + { + if (index === 0) + { + this.frames = newFrames.concat(this.frames); + } + else if (index === this.frames.length) + { + this.frames = this.frames.concat(newFrames); + } + else + { + var pre = this.frames.slice(0, index); + var post = this.frames.slice(index); + + this.frames = pre.concat(newFrames, post); + } + + this.updateFrameSequence(); + } + + return this; + }, + + /** + * Check if the given frame index is valid. + * + * @method Phaser.Animations.Animation#checkFrame + * @since 3.0.0 + * + * @param {integer} index - The index to be checked. + * + * @return {boolean} `true` if the index is valid, otherwise `false`. + */ + checkFrame: function (index) + { + return (index >= 0 && index < this.frames.length); + }, + + /** + * Called internally when this Animation first starts to play. + * Sets the accumulator and nextTick properties. + * + * @method Phaser.Animations.Animation#getFirstTick + * @protected + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + */ + getFirstTick: function (component) + { + // When is the first update due? + component.accumulator = 0; + + component.nextTick = component.msPerFrame + component.currentFrame.duration; + }, + + /** + * Returns the AnimationFrame at the provided index + * + * @method Phaser.Animations.Animation#getFrameAt + * @protected + * @since 3.0.0 + * + * @param {integer} index - The index in the AnimationFrame array + * + * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence + */ + getFrameAt: function (index) + { + return this.frames[index]; + }, + + /** + * Creates AnimationFrame instances based on the given frame data. + * + * @method Phaser.Animations.Animation#getFrames + * @since 3.0.0 + * + * @param {Phaser.Textures.TextureManager} textureManager - A reference to the global Texture Manager. + * @param {(string|Phaser.Types.Animations.AnimationFrame[])} frames - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. + * @param {string} [defaultTextureKey] - The key to use if no key is set in the frame configuration object. + * + * @return {Phaser.Animations.AnimationFrame[]} An array of newly created AnimationFrame instances. + */ + getFrames: function (textureManager, frames, defaultTextureKey, sortFrames) + { + if (sortFrames === undefined) { sortFrames = true; } + + var out = []; + var prev; + var animationFrame; + var index = 1; + var i; + var textureKey; + + // if frames is a string, we'll get all the frames from the texture manager as if it's a sprite sheet + if (typeof frames === 'string') + { + textureKey = frames; + + var texture = textureManager.get(textureKey); + var frameKeys = texture.getFrameNames(); + + if (sortFrames) + { + SortByDigits(frameKeys); + } + + frames = []; + + frameKeys.forEach(function (value) + { + frames.push({ key: textureKey, frame: value }); + }); + } + + if (!Array.isArray(frames) || frames.length === 0) + { + return out; + } + + for (i = 0; i < frames.length; i++) + { + var item = frames[i]; + + var key = GetValue(item, 'key', defaultTextureKey); + + if (!key) + { + continue; + } + + // Could be an integer or a string + var frame = GetValue(item, 'frame', 0); + + // The actual texture frame + var textureFrame = textureManager.getFrame(key, frame); + + animationFrame = new Frame(key, frame, index, textureFrame); + + animationFrame.duration = GetValue(item, 'duration', 0); + + animationFrame.isFirst = (!prev); + + // The previously created animationFrame + if (prev) + { + prev.nextFrame = animationFrame; + + animationFrame.prevFrame = prev; + } + + out.push(animationFrame); + + prev = animationFrame; + + index++; + } + + if (out.length > 0) + { + animationFrame.isLast = true; + + // Link them end-to-end, so they loop + animationFrame.nextFrame = out[0]; + + out[0].prevFrame = animationFrame; + + // Generate the progress data + + var slice = 1 / (out.length - 1); + + for (i = 0; i < out.length; i++) + { + out[i].progress = i * slice; + } + } + + return out; + }, + + /** + * Called internally. Sets the accumulator and nextTick values of the current Animation. + * + * @method Phaser.Animations.Animation#getNextTick + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + */ + getNextTick: function (component) + { + component.accumulator -= component.nextTick; + + component.nextTick = component.msPerFrame + component.currentFrame.duration; + }, + + /** + * Returns the frame closest to the given progress value between 0 and 1. + * + * @method Phaser.Animations.Animation#getFrameByProgress + * @since 3.4.0 + * + * @param {number} value - A value between 0 and 1. + * + * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value. + */ + getFrameByProgress: function (value) + { + value = Clamp(value, 0, 1); + + return FindClosestInSorted(value, this.frames, 'progress'); + }, + + /** + * Advance the animation frame. + * + * @method Phaser.Animations.Animation#nextFrame + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + */ + nextFrame: function (component) + { + var frame = component.currentFrame; + + if (frame.isLast) + { + // We're at the end of the animation + + // Yoyo? (happens before repeat) + if (component.yoyo) + { + this.handleYoyoFrame(component, false); + } + else if (component.repeatCounter > 0) + { + // Repeat (happens before complete) + + if (component.inReverse && component.forward) + { + component.forward = false; + } + else + { + this.repeatAnimation(component); + } + } + else + { + component.complete(); + } + } + else + { + this.updateAndGetNextTick(component, frame.nextFrame); + } + }, + + /** + * Handle the yoyo functionality in nextFrame and previousFrame methods. + * + * @method Phaser.Animations.Animation#handleYoyoFrame + * @private + * @since 3.12.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) + */ + handleYoyoFrame: function (component, isReverse) + { + if (!isReverse) { isReverse = false; } + + if (component.inReverse === !isReverse && component.repeatCounter > 0) + { + if (component.repeatDelay === 0 || component.pendingRepeat) + { + component.forward = isReverse; + } + + this.repeatAnimation(component); + + return; + } + + if (component.inReverse !== isReverse && component.repeatCounter === 0) + { + component.complete(); + + return; + } + + component.forward = isReverse; + + var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; + + this.updateAndGetNextTick(component, frame); + }, + + /** + * Returns the animation last frame. + * + * @method Phaser.Animations.Animation#getLastFrame + * @since 3.12.0 + * + * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. + */ + getLastFrame: function () + { + return this.frames[this.frames.length - 1]; + }, + + /** + * Called internally when the Animation is playing backwards. + * Sets the previous frame, causing a yoyo, repeat, complete or update, accordingly. + * + * @method Phaser.Animations.Animation#previousFrame + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + */ + previousFrame: function (component) + { + var frame = component.currentFrame; + + if (frame.isFirst) + { + // We're at the start of the animation + if (component.yoyo) + { + this.handleYoyoFrame(component, true); + } + else if (component.repeatCounter > 0) + { + if (component.inReverse && !component.forward) + { + this.repeatAnimation(component); + } + else + { + // Repeat (happens before complete) + component.forward = true; + + this.repeatAnimation(component); + } + } + else + { + component.complete(); + } + } + else + { + this.updateAndGetNextTick(component, frame.prevFrame); + } + }, + + /** + * Update Frame and Wait next tick. + * + * @method Phaser.Animations.Animation#updateAndGetNextTick + * @private + * @since 3.12.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. + */ + updateAndGetNextTick: function (component, frame) + { + component.setCurrentFrame(frame); + + this.getNextTick(component); + }, + + /** + * Removes the given AnimationFrame from this Animation instance. + * This is a global action. Any Game Object using this Animation will be impacted by this change. + * + * @method Phaser.Animations.Animation#removeFrame + * @since 3.0.0 + * + * @param {Phaser.Animations.AnimationFrame} frame - The AnimationFrame to be removed. + * + * @return {this} This Animation object. + */ + removeFrame: function (frame) + { + var index = this.frames.indexOf(frame); + + if (index !== -1) + { + this.removeFrameAt(index); + } + + return this; + }, + + /** + * Removes a frame from the AnimationFrame array at the provided index + * and updates the animation accordingly. + * + * @method Phaser.Animations.Animation#removeFrameAt + * @since 3.0.0 + * + * @param {integer} index - The index in the AnimationFrame array + * + * @return {this} This Animation object. + */ + removeFrameAt: function (index) + { + this.frames.splice(index, 1); + + this.updateFrameSequence(); + + return this; + }, + + /** + * Called internally during playback. Forces the animation to repeat, providing there are enough counts left + * in the repeat counter. + * + * @method Phaser.Animations.Animation#repeatAnimation + * @fires Phaser.Animations.Events#ANIMATION_REPEAT + * @fires Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT + * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT + * @since 3.0.0 + * + * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + */ + repeatAnimation: function (component) + { + if (component._pendingStop === 2) + { + if (component._pendingStopValue === 0) + { + return component.stop(); + } + else + { + component._pendingStopValue--; + } + } + + if (component.repeatDelay > 0 && !component.pendingRepeat) + { + component.pendingRepeat = true; + component.accumulator -= component.nextTick; + component.nextTick += component.repeatDelay; + } + else + { + component.repeatCounter--; + + if (component.forward) + { + component.setCurrentFrame(component.currentFrame.nextFrame); + } + else + { + component.setCurrentFrame(component.currentFrame.prevFrame); + } + + if (component.isPlaying) + { + this.getNextTick(component); + + component.handleRepeat(); + } + } + }, + + /** + * Converts the animation data to JSON. + * + * @method Phaser.Animations.Animation#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Animations.JSONAnimation} The resulting JSONAnimation formatted object. + */ + toJSON: function () + { + var output = { + key: this.key, + type: this.type, + frames: [], + frameRate: this.frameRate, + duration: this.duration, + skipMissedFrames: this.skipMissedFrames, + delay: this.delay, + repeat: this.repeat, + repeatDelay: this.repeatDelay, + yoyo: this.yoyo, + showOnStart: this.showOnStart, + hideOnComplete: this.hideOnComplete + }; + + this.frames.forEach(function (frame) + { + output.frames.push(frame.toJSON()); + }); + + return output; + }, + + /** + * Called internally whenever frames are added to, or removed from, this Animation. + * + * @method Phaser.Animations.Animation#updateFrameSequence + * @since 3.0.0 + * + * @return {this} This Animation object. + */ + updateFrameSequence: function () + { + var len = this.frames.length; + var slice = 1 / (len - 1); + + var frame; + + for (var i = 0; i < len; i++) + { + frame = this.frames[i]; + + frame.index = i + 1; + frame.isFirst = false; + frame.isLast = false; + frame.progress = i * slice; + + if (i === 0) + { + frame.isFirst = true; + + if (len === 1) + { + frame.isLast = true; + frame.nextFrame = frame; + frame.prevFrame = frame; + } + else + { + frame.isLast = false; + frame.prevFrame = this.frames[len - 1]; + frame.nextFrame = this.frames[i + 1]; + } + } + else if (i === len - 1 && len > 1) + { + frame.isLast = true; + frame.prevFrame = this.frames[len - 2]; + frame.nextFrame = this.frames[0]; + } + else if (len > 1) + { + frame.prevFrame = this.frames[i - 1]; + frame.nextFrame = this.frames[i + 1]; + } + } + + return this; + }, + + /** + * Pauses playback of this Animation. The paused state is set immediately. + * + * @method Phaser.Animations.Animation#pause + * @since 3.0.0 + * + * @return {this} This Animation object. + */ + pause: function () + { + this.paused = true; + + return this; + }, + + /** + * Resumes playback of this Animation. The paused state is reset immediately. + * + * @method Phaser.Animations.Animation#resume + * @since 3.0.0 + * + * @return {this} This Animation object. + */ + resume: function () + { + this.paused = false; + + return this; + }, + + /** + * Destroys this Animation instance. It will remove all event listeners, + * remove this animation and its key from the global Animation Manager, + * and then destroy all Animation Frames in turn. + * + * @method Phaser.Animations.Animation#destroy + * @since 3.0.0 + */ + destroy: function () + { + if (this.manager.off) + { + this.manager.off(Events.PAUSE_ALL, this.pause, this); + this.manager.off(Events.RESUME_ALL, this.resume, this); + } + + this.manager.remove(this.key); + + for (var i = 0; i < this.frames.length; i++) + { + this.frames[i].destroy(); + } + + this.frames = []; + + this.manager = null; + } + +}); + +module.exports = Animation; + + +/***/ }), +/* 196 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A single frame in an Animation sequence. + * + * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other + * frames in the animation, and index data. It also has the ability to modify the animation timing. + * + * AnimationFrames are generated automatically by the Animation class. + * + * @class AnimationFrame + * @memberof Phaser.Animations + * @constructor + * @since 3.0.0 + * + * @param {string} textureKey - The key of the Texture this AnimationFrame uses. + * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. + * @param {integer} index - The index of this AnimationFrame within the Animation sequence. + * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. + * @param {boolean} [isKeyFrame=false] - Is this Frame a Keyframe within the Animation? + */ +var AnimationFrame = new Class({ + + initialize: + + function AnimationFrame (textureKey, textureFrame, index, frame, isKeyFrame) + { + if (isKeyFrame === undefined) { isKeyFrame = false; } + + /** + * The key of the Texture this AnimationFrame uses. + * + * @name Phaser.Animations.AnimationFrame#textureKey + * @type {string} + * @since 3.0.0 + */ + this.textureKey = textureKey; + + /** + * The key of the Frame within the Texture that this AnimationFrame uses. + * + * @name Phaser.Animations.AnimationFrame#textureFrame + * @type {(string|integer)} + * @since 3.0.0 + */ + this.textureFrame = textureFrame; + + /** + * The index of this AnimationFrame within the Animation sequence. + * + * @name Phaser.Animations.AnimationFrame#index + * @type {integer} + * @since 3.0.0 + */ + this.index = index; + + /** + * A reference to the Texture Frame this AnimationFrame uses for rendering. + * + * @name Phaser.Animations.AnimationFrame#frame + * @type {Phaser.Textures.Frame} + * @since 3.0.0 + */ + this.frame = frame; + + /** + * Is this the first frame in an animation sequence? + * + * @name Phaser.Animations.AnimationFrame#isFirst + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.isFirst = false; + + /** + * Is this the last frame in an animation sequence? + * + * @name Phaser.Animations.AnimationFrame#isLast + * @type {boolean} + * @default false + * @readonly + * @since 3.0.0 + */ + this.isLast = false; + + /** + * A reference to the AnimationFrame that comes before this one in the animation, if any. + * + * @name Phaser.Animations.AnimationFrame#prevFrame + * @type {?Phaser.Animations.AnimationFrame} + * @default null + * @readonly + * @since 3.0.0 + */ + this.prevFrame = null; + + /** + * A reference to the AnimationFrame that comes after this one in the animation, if any. + * + * @name Phaser.Animations.AnimationFrame#nextFrame + * @type {?Phaser.Animations.AnimationFrame} + * @default null + * @readonly + * @since 3.0.0 + */ + this.nextFrame = null; + + /** + * Additional time (in ms) that this frame should appear for during playback. + * The value is added onto the msPerFrame set by the animation. + * + * @name Phaser.Animations.AnimationFrame#duration + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.duration = 0; + + /** + * What % through the animation does this frame come? + * This value is generated when the animation is created and cached here. + * + * @name Phaser.Animations.AnimationFrame#progress + * @type {number} + * @default 0 + * @readonly + * @since 3.0.0 + */ + this.progress = 0; + + /** + * Is this Frame a KeyFrame within the Animation? + * + * @name Phaser.Animations.AnimationFrame#isKeyFrame + * @type {boolean} + * @since 3.50.0 + */ + this.isKeyFrame = isKeyFrame; + }, + + /** + * Generates a JavaScript object suitable for converting to JSON. + * + * @method Phaser.Animations.AnimationFrame#toJSON + * @since 3.0.0 + * + * @return {Phaser.Types.Animations.JSONAnimationFrame} The AnimationFrame data. + */ + toJSON: function () + { + return { + key: this.textureKey, + frame: this.textureFrame, + duration: this.duration, + keyframe: this.isKeyFrame + }; + }, + + /** + * Destroys this object by removing references to external resources and callbacks. + * + * @method Phaser.Animations.AnimationFrame#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.frame = undefined; + } + +}); + +module.exports = AnimationFrame; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * + * @function Phaser.Utils.Array.SortByDigits + * @since 3.50.0 + * + * @param {string[]} array - The input array of strings. + * + * @return {string[]} The sorted input array. + */ +var SortByDigits = function (array) +{ + var re = /\D/g; + + array.sort(function (a, b) + { + return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); + }); + + return array; +}; + +module.exports = SortByDigits; + + +/***/ }), +/* 199 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17566,34 +22933,33 @@ module.exports = Sprite; module.exports = { - Alpha: __webpack_require__(180), - AlphaSingle: __webpack_require__(181), - Animation: __webpack_require__(182), - BlendMode: __webpack_require__(204), - ComputedSize: __webpack_require__(205), - Crop: __webpack_require__(206), - Depth: __webpack_require__(207), - Flip: __webpack_require__(208), - GetBounds: __webpack_require__(209), - Mask: __webpack_require__(219), - Origin: __webpack_require__(239), - PathFollower: __webpack_require__(240), - Pipeline: __webpack_require__(243), - ScrollFactor: __webpack_require__(244), - Size: __webpack_require__(245), - Texture: __webpack_require__(246), - TextureCrop: __webpack_require__(247), - Tint: __webpack_require__(248), - ToJSON: __webpack_require__(35), - Transform: __webpack_require__(250), + Alpha: __webpack_require__(200), + AlphaSingle: __webpack_require__(201), + BlendMode: __webpack_require__(202), + ComputedSize: __webpack_require__(203), + Crop: __webpack_require__(204), + Depth: __webpack_require__(205), + Flip: __webpack_require__(206), + GetBounds: __webpack_require__(207), + Mask: __webpack_require__(217), + Origin: __webpack_require__(237), + PathFollower: __webpack_require__(238), + Pipeline: __webpack_require__(241), + ScrollFactor: __webpack_require__(243), + Size: __webpack_require__(244), + Texture: __webpack_require__(245), + TextureCrop: __webpack_require__(246), + Tint: __webpack_require__(247), + ToJSON: __webpack_require__(36), + Transform: __webpack_require__(248), TransformMatrix: __webpack_require__(41), - Visible: __webpack_require__(251) + Visible: __webpack_require__(249) }; /***/ }), -/* 180 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17888,7 +23254,7 @@ module.exports = Alpha; /***/ }), -/* 181 */ +/* 201 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -17997,2749 +23363,8 @@ var AlphaSingle = { module.exports = AlphaSingle; -/***/ }), -/* 182 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BaseAnimation = __webpack_require__(183); -var Class = __webpack_require__(0); -var Events = __webpack_require__(38); - -/** - * @classdesc - * A Game Object Animation Controller. - * - * This controller lives as an instance within a Game Object, accessible as `sprite.anims`. - * - * @class Animation - * @memberof Phaser.GameObjects.Components - * @constructor - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} parent - The Game Object to which this animation controller belongs. - */ -var Animation = new Class({ - - initialize: - - function Animation (parent) - { - /** - * The Game Object to which this animation controller belongs. - * - * @name Phaser.GameObjects.Components.Animation#parent - * @type {Phaser.GameObjects.GameObject} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.GameObjects.Components.Animation#animationManager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.animationManager = parent.scene.sys.anims; - - this.animationManager.once(Events.REMOVE_ANIMATION, this.remove, this); - - /** - * Is an animation currently playing or not? - * - * @name Phaser.GameObjects.Components.Animation#isPlaying - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.isPlaying = false; - - /** - * The current Animation loaded into this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentAnim - * @type {?Phaser.Animations.Animation} - * @default null - * @since 3.0.0 - */ - this.currentAnim = null; - - /** - * The current AnimationFrame being displayed by this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @since 3.0.0 - */ - this.currentFrame = null; - - /** - * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnim - * @type {?string} - * @default null - * @since 3.16.0 - */ - this.nextAnim = null; - - /** - * A queue of keys of the next Animations to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnimsQueue - * @type {string[]} - * @since 3.24.0 - */ - this.nextAnimsQueue = []; - - /** - * Time scale factor. - * - * @name Phaser.GameObjects.Components.Animation#_timeScale - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - this._timeScale = 1; - - /** - * The frame rate of playback in frames per second. - * The default is 24 if the `duration` property is `null`. - * - * @name Phaser.GameObjects.Components.Animation#frameRate - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.frameRate = 0; - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.GameObjects.Components.Animation#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * ms per frame, not including frame specific modifiers that may be present in the Animation data. - * - * @name Phaser.GameObjects.Components.Animation#msPerFrame - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.msPerFrame = 0; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.GameObjects.Components.Animation#skipMissedFrames - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.skipMissedFrames = true; - - /** - * A delay before starting playback, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_delay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._delay = 0; - - /** - * Number of times to repeat the animation (-1 for infinity) - * - * @name Phaser.GameObjects.Components.Animation#_repeat - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeat = 0; - - /** - * Delay before the repeat starts, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_repeatDelay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeatDelay = 0; - - /** - * Should the animation yoyo? (reverse back down to the start) before repeating? - * - * @name Phaser.GameObjects.Components.Animation#_yoyo - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._yoyo = false; - - /** - * Will the playhead move forwards (`true`) or in reverse (`false`). - * - * @name Phaser.GameObjects.Components.Animation#forward - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.forward = true; - - /** - * An Internal trigger that's play the animation in reverse mode ('true') or not ('false'), - * needed because forward can be changed by yoyo feature. - * - * @name Phaser.GameObjects.Components.Animation#_reverse - * @type {boolean} - * @default false - * @private - * @since 3.12.0 - */ - this._reverse = false; - - /** - * Internal time overflow accumulator. - * - * @name Phaser.GameObjects.Components.Animation#accumulator - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.accumulator = 0; - - /** - * The time point at which the next animation frame will change. - * - * @name Phaser.GameObjects.Components.Animation#nextTick - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.nextTick = 0; - - /** - * An internal counter keeping track of how many repeats are left to play. - * - * @name Phaser.GameObjects.Components.Animation#repeatCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.repeatCounter = 0; - - /** - * An internal flag keeping track of pending repeats. - * - * @name Phaser.GameObjects.Components.Animation#pendingRepeat - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.pendingRepeat = false; - - /** - * Is the Animation paused? - * - * @name Phaser.GameObjects.Components.Animation#_paused - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._paused = false; - - /** - * Was the animation previously playing before being paused? - * - * @name Phaser.GameObjects.Components.Animation#_wasPlaying - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._wasPlaying = false; - - /** - * Internal property tracking if this Animation is waiting to stop. - * - * 0 = No - * 1 = Waiting for ms to pass - * 2 = Waiting for repeat - * 3 = Waiting for specific frame - * - * @name Phaser.GameObjects.Components.Animation#_pendingStop - * @type {integer} - * @private - * @since 3.4.0 - */ - this._pendingStop = 0; - - /** - * Internal property used by _pendingStop. - * - * @name Phaser.GameObjects.Components.Animation#_pendingStopValue - * @type {any} - * @private - * @since 3.4.0 - */ - this._pendingStopValue; - }, - - /** - * Sets an animation to be played immediately after the current one completes. - * - * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. - * - * An animation set to repeat forever will never enter a completed state. - * - * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). - * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. - * - * Call this method with no arguments to reset the chained animation. - * - * @method Phaser.GameObjects.Components.Animation#chain - * @since 3.16.0 - * - * @param {(string|Phaser.Animations.Animation)} [key] - The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - chain: function (key) - { - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (this.nextAnim === null) - { - this.nextAnim = key; - } - else - { - this.nextAnimsQueue.push(key); - } - - return this.parent; - }, - - /** - * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#setDelay - * @since 3.4.0 - * - * @param {integer} [value=0] - The amount of time, in milliseconds, to wait before starting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setDelay: function (value) - { - if (value === undefined) { value = 0; } - - this._delay = value; - - return this.parent; - }, - - /** - * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#getDelay - * @since 3.4.0 - * - * @return {integer} The amount of time, in milliseconds, the Animation will wait before starting playback. - */ - getDelay: function () - { - return this._delay; - }, - - /** - * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. - * - * @method Phaser.GameObjects.Components.Animation#delayedPlay - * @since 3.0.0 - * - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. - * @param {string} key - The key of the animation to play. - * @param {integer} [startFrame=0] - The frame of the animation to start from. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - delayedPlay: function (delay, key, startFrame) - { - this.play(key, true, startFrame); - - this.nextTick += delay; - - return this.parent; - }, - - /** - * Returns the key of the animation currently loaded into this component. - * - * @method Phaser.GameObjects.Components.Animation#getCurrentKey - * @since 3.0.0 - * - * @return {string} The key of the Animation loaded into this component. - */ - getCurrentKey: function () - { - if (this.currentAnim) - { - return this.currentAnim.key; - } - }, - - /** - * Internal method used to load an animation into this component. - * - * @method Phaser.GameObjects.Components.Animation#load - * @protected - * @since 3.0.0 - * - * @param {string} key - The key of the animation to load. - * @param {integer} [startFrame=0] - The start frame of the animation to load. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - load: function (key, startFrame) - { - if (startFrame === undefined) { startFrame = 0; } - - if (this.isPlaying) - { - this.stop(); - } - - // Load the new animation in - this.animationManager.load(this, key, startFrame); - - return this.parent; - }, - - /** - * Pause the current animation and set the `isPlaying` property to `false`. - * You can optionally pause it at a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#pause - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [atFrame] - An optional frame to set after pausing the animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - pause: function (atFrame) - { - if (!this._paused) - { - this._paused = true; - this._wasPlaying = this.isPlaying; - this.isPlaying = false; - } - - if (atFrame !== undefined) - { - this.updateFrame(atFrame); - } - - return this.parent; - }, - - /** - * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. - * You can optionally tell it to start playback from a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#resume - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [fromFrame] - An optional frame to set before restarting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - resume: function (fromFrame) - { - if (this._paused) - { - this._paused = false; - this.isPlaying = this._wasPlaying; - } - - if (fromFrame !== undefined) - { - this.updateFrame(fromFrame); - } - - return this.parent; - }, - - /** - * `true` if the current animation is paused, otherwise `false`. - * - * @name Phaser.GameObjects.Components.Animation#isPaused - * @readonly - * @type {boolean} - * @since 3.4.0 - */ - isPaused: { - - get: function () - { - return this._paused; - } - - }, - - /** - * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. - * - * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. - * - * @method Phaser.GameObjects.Components.Animation#play - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.0.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - play: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = true; - this._reverse = false; - this._paused = false; - this._wasPlaying = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#playReverse - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.12.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - playReverse: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = false; - this._reverse = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. - * - * @method Phaser.GameObjects.Components.Animation#_startAnimation - * @fires Phaser.Animations.Events#ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.12.0 - * - * @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - _startAnimation: function (key, startFrame) - { - this.load(key, startFrame); - - var anim = this.currentAnim; - var gameObject = this.parent; - - if (!anim) - { - return gameObject; - } - - // Should give us 9,007,199,254,740,991 safe repeats - this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; - - anim.getFirstTick(this); - - this.isPlaying = true; - this.pendingRepeat = false; - - if (anim.showOnStart) - { - gameObject.visible = true; - } - - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_START, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_START + key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_START, anim, frame, gameObject); - - return gameObject; - }, - - /** - * Reverse the Animation that is already playing on the Game Object. - * - * @method Phaser.GameObjects.Components.Animation#reverse - * @since 3.12.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - reverse: function () - { - if (this.isPlaying) - { - this._reverse = !this._reverse; - - this.forward = !this.forward; - } - - return this.parent; - }, - - /** - * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. - * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different - * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. - * - * @method Phaser.GameObjects.Components.Animation#getProgress - * @since 3.4.0 - * - * @return {number} The progress of the current animation, between 0 and 1. - */ - getProgress: function () - { - var p = this.currentFrame.progress; - - if (!this.forward) - { - p = 1 - p; - } - - return p; - }, - - /** - * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. - * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. - * - * @method Phaser.GameObjects.Components.Animation#setProgress - * @since 3.4.0 - * - * @param {number} [value=0] - The progress value, between 0 and 1. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setProgress: function (value) - { - if (!this.forward) - { - value = 1 - value; - } - - this.setCurrentFrame(this.currentAnim.getFrameByProgress(value)); - - return this.parent; - }, - - /** - * Handle the removal of an animation from the Animation Manager. - * - * @method Phaser.GameObjects.Components.Animation#remove - * @since 3.0.0 - * - * @param {string} [key] - The key of the removed Animation. - * @param {Phaser.Animations.Animation} [animation] - The removed Animation. - */ - remove: function (key, animation) - { - if (animation === undefined) { animation = this.currentAnim; } - - if (this.isPlaying && animation.key === this.currentAnim.key) - { - this.stop(); - - this.setCurrentFrame(this.currentAnim.frames[0]); - } - }, - - /** - * Gets the number of times that the animation will repeat - * after its first iteration. For example, if returns 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * A value of -1 means the animation will repeat indefinitely. - * - * @method Phaser.GameObjects.Components.Animation#getRepeat - * @since 3.4.0 - * - * @return {integer} The number of times that the animation will repeat. - */ - getRepeat: function () - { - return this._repeat; - }, - - /** - * Sets the number of times that the animation should repeat - * after its first iteration. For example, if repeat is 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * To repeat indefinitely, use -1. repeat should always be an integer. - * - * @method Phaser.GameObjects.Components.Animation#setRepeat - * @since 3.4.0 - * - * @param {integer} value - The number of times that the animation should repeat. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeat: function (value) - { - this._repeat = value; - - this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; - - return this.parent; - }, - - /** - * Gets the amount of delay between repeats, if any. - * - * @method Phaser.GameObjects.Components.Animation#getRepeatDelay - * @since 3.4.0 - * - * @return {number} The delay between repeats. - */ - getRepeatDelay: function () - { - return this._repeatDelay; - }, - - /** - * Sets the amount of time in seconds between repeats. - * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, - * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds - * before doing its final repeat. - * - * @method Phaser.GameObjects.Components.Animation#setRepeatDelay - * @since 3.4.0 - * - * @param {number} value - The delay to wait between repeats, in seconds. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeatDelay: function (value) - { - this._repeatDelay = value; - - return this.parent; - }, - - /** - * Restarts the current animation from its beginning, optionally including its delay value. - * - * @method Phaser.GameObjects.Components.Animation#restart - * @fires Phaser.Animations.Events#ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.0.0 - * - * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - restart: function (includeDelay) - { - if (includeDelay === undefined) { includeDelay = false; } - - var anim = this.currentAnim; - - anim.getFirstTick(this, includeDelay); - - this.forward = true; - this.isPlaying = true; - this.pendingRepeat = false; - this._paused = false; - - // Set frame - this.updateFrame(anim.frames[0]); - - var gameObject = this.parent; - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_RESTART, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_RESTART + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_RESTART, anim, frame, gameObject); - - return this.parent; - }, - - /** - * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. - * - * If no animation is set, no event will be dispatched. - * - * If there is another animation queued (via the `chain` method) then it will start playing immediately. - * - * @method Phaser.GameObjects.Components.Animation#stop - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.0.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stop: function () - { - this._pendingStop = 0; - - this.isPlaying = false; - - var gameObject = this.parent; - var anim = this.currentAnim; - var frame = this.currentFrame; - - if (anim) - { - anim.emit(Events.ANIMATION_COMPLETE, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_COMPLETE + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_COMPLETE, anim, frame, gameObject); - } - - if (this.nextAnim) - { - var key = this.nextAnim; - - this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null; - - this.play(key); - } - - return gameObject; - }, - - /** - * Stops the current animation from playing after the specified time delay, given in milliseconds. - * - * @method Phaser.GameObjects.Components.Animation#stopAfterDelay - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopAfterDelay: function (delay) - { - this._pendingStop = 1; - this._pendingStopValue = delay; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next repeats. - * - * @method Phaser.GameObjects.Components.Animation#stopOnRepeat - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnRepeat: function () - { - this._pendingStop = 2; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next sets the given frame. - * If this frame doesn't exist within the animation it will not stop it from playing. - * - * @method Phaser.GameObjects.Components.Animation#stopOnFrame - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnFrame: function (frame) - { - this._pendingStop = 3; - this._pendingStopValue = frame; - - return this.parent; - }, - - /** - * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. - * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. - * - * @method Phaser.GameObjects.Components.Animation#setTimeScale - * @since 3.4.0 - * - * @param {number} [value=1] - The time scale factor, where 1 is no change, 0.5 is half speed, etc. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setTimeScale: function (value) - { - if (value === undefined) { value = 1; } - - this._timeScale = value; - - return this.parent; - }, - - /** - * Gets the Time Scale factor. - * - * @method Phaser.GameObjects.Components.Animation#getTimeScale - * @since 3.4.0 - * - * @return {number} The Time Scale value. - */ - getTimeScale: function () - { - return this._timeScale; - }, - - /** - * Returns the total number of frames in this animation. - * - * @method Phaser.GameObjects.Components.Animation#getTotalFrames - * @since 3.4.0 - * - * @return {integer} The total number of frames in this animation. - */ - getTotalFrames: function () - { - return this.currentAnim.frames.length; - }, - - /** - * The internal update loop for the Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#update - * @since 3.0.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - update: function (time, delta) - { - if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused) - { - return; - } - - this.accumulator += delta * this._timeScale; - - if (this._pendingStop === 1) - { - this._pendingStopValue -= delta; - - if (this._pendingStopValue <= 0) - { - return this.currentAnim.completeAnimation(this); - } - } - - if (this.accumulator >= this.nextTick) - { - this.currentAnim.setFrame(this); - } - }, - - /** - * Sets the given Animation Frame as being the current frame - * and applies it to the parent Game Object, adjusting its size and origin as needed. - * - * @method Phaser.GameObjects.Components.Animation#setCurrentFrame - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The Animation Frame to set as being current. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setCurrentFrame: function (animationFrame) - { - var gameObject = this.parent; - - this.currentFrame = animationFrame; - - gameObject.texture = animationFrame.frame.texture; - gameObject.frame = animationFrame.frame; - - if (gameObject.isCropped) - { - gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); - } - - gameObject.setSizeToFrame(); - - if (gameObject._originComponent) - { - if (animationFrame.frame.customPivot) - { - gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY); - } - else - { - gameObject.updateDisplayOrigin(); - } - } - - return gameObject; - }, - - /** - * Internal frame change handler. - * - * @method Phaser.GameObjects.Components.Animation#updateFrame - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @private - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to. - */ - updateFrame: function (animationFrame) - { - var gameObject = this.setCurrentFrame(animationFrame); - - if (this.isPlaying) - { - if (animationFrame.setAlpha) - { - gameObject.alpha = animationFrame.alpha; - } - - var anim = this.currentAnim; - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_UPDATE + anim.key, anim, animationFrame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_UPDATE, anim, animationFrame, gameObject); - - if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) - { - this.currentAnim.completeAnimation(this); - } - } - }, - - /** - * Advances the animation to the next frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in reverse, calling this method doesn't then change the direction to forwards. - * - * @method Phaser.GameObjects.Components.Animation#nextFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - nextFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.nextFrame(this); - } - - return this.parent; - }, - - /** - * Advances the animation to the previous frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in forwards, calling this method doesn't then change the direction to backwards. - * - * @method Phaser.GameObjects.Components.Animation#previousFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - previousFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.previousFrame(this); - } - - return this.parent; - }, - - /** - * Sets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#setYoyo - * @since 3.4.0 - * - * @param {boolean} [value=false] - `true` if the animation should yoyo, `false` to not. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setYoyo: function (value) - { - if (value === undefined) { value = false; } - - this._yoyo = value; - - return this.parent; - }, - - /** - * Gets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#getYoyo - * @since 3.4.0 - * - * @return {boolean} `true` if the animation is set to yoyo, `false` if not. - */ - getYoyo: function () - { - return this._yoyo; - }, - - /** - * Destroy this Animation component. - * - * Unregisters event listeners and cleans up its references. - * - * @method Phaser.GameObjects.Components.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.animationManager.off(Events.REMOVE_ANIMATION, this.remove, this); - - this.animationManager = null; - this.parent = null; - this.nextAnimsQueue.length = 0; - - this.currentAnim = null; - this.currentFrame = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 183 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(4); -var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(36); -var Events = __webpack_require__(38); -var FindClosestInSorted = __webpack_require__(202); -var Frame = __webpack_require__(203); -var GetValue = __webpack_require__(11); - -/** - * @classdesc - * A Frame based Animation. - * - * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. - * - * The Animation Manager creates these. Game Objects don't own an instance of these directly. - * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) - * So multiple Game Objects can have playheads all pointing to this one Animation instance. - * - * @class Animation - * @memberof Phaser.Animations - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager - * @param {string} key - The unique identifying string for this animation. - * @param {Phaser.Types.Animations.Animation} config - The Animation configuration. - */ -var Animation = new Class({ - - Extends: EventEmitter, - - initialize: - - function Animation (manager, key, config) - { - EventEmitter.call(this); - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.Animations.Animation#manager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.manager = manager; - - /** - * The unique identifying string for this animation. - * - * @name Phaser.Animations.Animation#key - * @type {string} - * @since 3.0.0 - */ - this.key = key; - - /** - * A frame based animation (as opposed to a bone based animation) - * - * @name Phaser.Animations.Animation#type - * @type {string} - * @default frame - * @since 3.0.0 - */ - this.type = 'frame'; - - /** - * Extract all the frame data into the frames array. - * - * @name Phaser.Animations.Animation#frames - * @type {Phaser.Animations.AnimationFrame[]} - * @since 3.0.0 - */ - this.frames = this.getFrames( - manager.textureManager, - GetValue(config, 'frames', []), - GetValue(config, 'defaultTextureKey', null) - ); - - /** - * The frame rate of playback in frames per second (default 24 if duration is null) - * - * @name Phaser.Animations.Animation#frameRate - * @type {integer} - * @default 24 - * @since 3.0.0 - */ - this.frameRate = GetValue(config, 'frameRate', null); - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.Animations.Animation#duration - * @type {integer} - * @since 3.0.0 - */ - this.duration = GetValue(config, 'duration', null); - - if (this.duration === null && this.frameRate === null) - { - // No duration or frameRate given, use default frameRate of 24fps - this.frameRate = 24; - this.duration = (this.frameRate / this.frames.length) * 1000; - } - else if (this.duration && this.frameRate === null) - { - // Duration given but no frameRate, so set the frameRate based on duration - // I.e. 12 frames in the animation, duration = 4000 ms - // So frameRate is 12 / (4000 / 1000) = 3 fps - this.frameRate = this.frames.length / (this.duration / 1000); - } - else - { - // frameRate given, derive duration from it (even if duration also specified) - // I.e. 15 frames in the animation, frameRate = 30 fps - // So duration is 15 / 30 = 0.5 * 1000 (half a second, or 500ms) - this.duration = (this.frames.length / this.frameRate) * 1000; - } - - /** - * How many ms per frame, not including frame specific modifiers. - * - * @name Phaser.Animations.Animation#msPerFrame - * @type {integer} - * @since 3.0.0 - */ - this.msPerFrame = 1000 / this.frameRate; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.Animations.Animation#skipMissedFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true); - - /** - * The delay in ms before the playback will begin. - * - * @name Phaser.Animations.Animation#delay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.delay = GetValue(config, 'delay', 0); - - /** - * Number of times to repeat the animation. Set to -1 to repeat forever. - * - * @name Phaser.Animations.Animation#repeat - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeat = GetValue(config, 'repeat', 0); - - /** - * The delay in ms before the a repeat play starts. - * - * @name Phaser.Animations.Animation#repeatDelay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeatDelay = GetValue(config, 'repeatDelay', 0); - - /** - * Should the animation yoyo (reverse back down to the start) before repeating? - * - * @name Phaser.Animations.Animation#yoyo - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.yoyo = GetValue(config, 'yoyo', false); - - /** - * Should the GameObject's `visible` property be set to `true` when the animation starts to play? - * - * @name Phaser.Animations.Animation#showOnStart - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.showOnStart = GetValue(config, 'showOnStart', false); - - /** - * Should the GameObject's `visible` property be set to `false` when the animation finishes? - * - * @name Phaser.Animations.Animation#hideOnComplete - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.hideOnComplete = GetValue(config, 'hideOnComplete', false); - - /** - * Global pause. All Game Objects using this Animation instance are impacted by this property. - * - * @name Phaser.Animations.Animation#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - this.manager.on(Events.PAUSE_ALL, this.pause, this); - this.manager.on(Events.RESUME_ALL, this.resume, this); - }, - - /** - * Add frames to the end of the animation. - * - * @method Phaser.Animations.Animation#addFrame - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrame: function (config) - { - return this.addFrameAt(this.frames.length, config); - }, - - /** - * Add frame/s into the animation. - * - * @method Phaser.Animations.Animation#addFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index to insert the frame at within the animation. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrameAt: function (index, config) - { - var newFrames = this.getFrames(this.manager.textureManager, config); - - if (newFrames.length > 0) - { - if (index === 0) - { - this.frames = newFrames.concat(this.frames); - } - else if (index === this.frames.length) - { - this.frames = this.frames.concat(newFrames); - } - else - { - var pre = this.frames.slice(0, index); - var post = this.frames.slice(index); - - this.frames = pre.concat(newFrames, post); - } - - this.updateFrameSequence(); - } - - return this; - }, - - /** - * Check if the given frame index is valid. - * - * @method Phaser.Animations.Animation#checkFrame - * @since 3.0.0 - * - * @param {integer} index - The index to be checked. - * - * @return {boolean} `true` if the index is valid, otherwise `false`. - */ - checkFrame: function (index) - { - return (index >= 0 && index < this.frames.length); - }, - - /** - * Called internally when this Animation completes playback. - * Optionally, hides the parent Game Object, then stops playback. - * - * @method Phaser.Animations.Animation#completeAnimation - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - completeAnimation: function (component) - { - if (this.hideOnComplete) - { - component.parent.visible = false; - } - - component.stop(); - }, - - /** - * Called internally when this Animation first starts to play. - * Sets the accumulator and nextTick properties. - * - * @method Phaser.Animations.Animation#getFirstTick - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - * @param {boolean} [includeDelay=true] - If `true` the Animation Components delay value will be added to the `nextTick` total. - */ - getFirstTick: function (component, includeDelay) - { - if (includeDelay === undefined) { includeDelay = true; } - - // When is the first update due? - component.accumulator = 0; - component.nextTick = component.msPerFrame + component.currentFrame.duration; - - if (includeDelay) - { - component.nextTick += component._delay; - } - }, - - /** - * Returns the AnimationFrame at the provided index - * - * @method Phaser.Animations.Animation#getFrameAt - * @protected - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence - */ - getFrameAt: function (index) - { - return this.frames[index]; - }, - - /** - * Creates AnimationFrame instances based on the given frame data. - * - * @method Phaser.Animations.Animation#getFrames - * @since 3.0.0 - * - * @param {Phaser.Textures.TextureManager} textureManager - A reference to the global Texture Manager. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} frames - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * @param {string} [defaultTextureKey] - The key to use if no key is set in the frame configuration object. - * - * @return {Phaser.Animations.AnimationFrame[]} An array of newly created AnimationFrame instances. - */ - getFrames: function (textureManager, frames, defaultTextureKey) - { - var out = []; - var prev; - var animationFrame; - var index = 1; - var i; - var textureKey; - - // if frames is a string, we'll get all the frames from the texture manager as if it's a sprite sheet - if (typeof frames === 'string') - { - textureKey = frames; - - var texture = textureManager.get(textureKey); - var frameKeys = texture.getFrameNames(); - - frames = []; - - frameKeys.forEach(function (idx, value) - { - frames.push({ key: textureKey, frame: value }); - }); - } - - if (!Array.isArray(frames) || frames.length === 0) - { - return out; - } - - for (i = 0; i < frames.length; i++) - { - var item = frames[i]; - - var key = GetValue(item, 'key', defaultTextureKey); - - if (!key) - { - continue; - } - - // Could be an integer or a string - var frame = GetValue(item, 'frame', 0); - - // The actual texture frame - var textureFrame = textureManager.getFrame(key, frame); - - animationFrame = new Frame(key, frame, index, textureFrame); - - animationFrame.duration = GetValue(item, 'duration', 0); - - animationFrame.isFirst = (!prev); - - // The previously created animationFrame - if (prev) - { - prev.nextFrame = animationFrame; - - animationFrame.prevFrame = prev; - } - - out.push(animationFrame); - - prev = animationFrame; - - index++; - } - - if (out.length > 0) - { - animationFrame.isLast = true; - - // Link them end-to-end, so they loop - animationFrame.nextFrame = out[0]; - - out[0].prevFrame = animationFrame; - - // Generate the progress data - - var slice = 1 / (out.length - 1); - - for (i = 0; i < out.length; i++) - { - out[i].progress = i * slice; - } - } - - return out; - }, - - /** - * Called internally. Sets the accumulator and nextTick values of the current Animation. - * - * @method Phaser.Animations.Animation#getNextTick - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - getNextTick: function (component) - { - // accumulator += delta * _timeScale - // after a large delta surge (perf issue for example) we need to adjust for it here - - // When is the next update due? - component.accumulator -= component.nextTick; - - component.nextTick = component.msPerFrame + component.currentFrame.duration; - }, - - /** - * Loads the Animation values into the Animation Component. - * - * @method Phaser.Animations.Animation#load - * @private - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into. - * @param {integer} startFrame - The start frame of the animation to load. - */ - load: function (component, startFrame) - { - if (startFrame >= this.frames.length) - { - startFrame = 0; - } - - if (component.currentAnim !== this) - { - component.currentAnim = this; - - component.frameRate = this.frameRate; - component.duration = this.duration; - component.msPerFrame = this.msPerFrame; - component.skipMissedFrames = this.skipMissedFrames; - - component._delay = this.delay; - component._repeat = this.repeat; - component._repeatDelay = this.repeatDelay; - component._yoyo = this.yoyo; - } - - var frame = this.frames[startFrame]; - - if (startFrame === 0 && !component.forward) - { - frame = this.getLastFrame(); - } - - component.updateFrame(frame); - }, - - /** - * Returns the frame closest to the given progress value between 0 and 1. - * - * @method Phaser.Animations.Animation#getFrameByProgress - * @since 3.4.0 - * - * @param {number} value - A value between 0 and 1. - * - * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value. - */ - getFrameByProgress: function (value) - { - value = Clamp(value, 0, 1); - - return FindClosestInSorted(value, this.frames, 'progress'); - }, - - /** - * Advance the animation frame. - * - * @method Phaser.Animations.Animation#nextFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - */ - nextFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isLast) - { - // We're at the end of the animation - - // Yoyo? (happens before repeat) - if (component._yoyo) - { - this.handleYoyoFrame(component, false); - } - else if (component.repeatCounter > 0) - { - // Repeat (happens before complete) - - if (component._reverse && component.forward) - { - component.forward = false; - } - else - { - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.nextFrame); - } - }, - - /** - * Handle the yoyo functionality in nextFrame and previousFrame methods. - * - * @method Phaser.Animations.Animation#handleYoyoFrame - * @private - * @since 3.12.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) - */ - handleYoyoFrame: function (component, isReverse) - { - if (!isReverse) { isReverse = false; } - - if (component._reverse === !isReverse && component.repeatCounter > 0) - { - if (!component._repeatDelay || component.pendingRepeat) - - { - component.forward = isReverse; - } - - this.repeatAnimation(component); - - return; - } - - if (component._reverse !== isReverse && component.repeatCounter === 0) - { - this.completeAnimation(component); - - return; - } - - component.forward = isReverse; - - var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; - - this.updateAndGetNextTick(component, frame); - }, - - /** - * Returns the animation last frame. - * - * @method Phaser.Animations.Animation#getLastFrame - * @since 3.12.0 - * - * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. - */ - getLastFrame: function () - { - return this.frames[this.frames.length - 1]; - }, - - /** - * Called internally when the Animation is playing backwards. - * Sets the previous frame, causing a yoyo, repeat, complete or update, accordingly. - * - * @method Phaser.Animations.Animation#previousFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - previousFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isFirst) - { - // We're at the start of the animation - - if (component._yoyo) - { - this.handleYoyoFrame(component, true); - } - else if (component.repeatCounter > 0) - { - if (component._reverse && !component.forward) - { - component.currentFrame = this.getLastFrame(); - this.repeatAnimation(component); - } - else - { - // Repeat (happens before complete) - component.forward = true; - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.prevFrame); - } - }, - - /** - * Update Frame and Wait next tick. - * - * @method Phaser.Animations.Animation#updateAndGetNextTick - * @private - * @since 3.12.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. - */ - updateAndGetNextTick: function (component, frame) - { - component.updateFrame(frame); - - this.getNextTick(component); - }, - - /** - * Removes the given AnimationFrame from this Animation instance. - * This is a global action. Any Game Object using this Animation will be impacted by this change. - * - * @method Phaser.Animations.Animation#removeFrame - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The AnimationFrame to be removed. - * - * @return {this} This Animation object. - */ - removeFrame: function (frame) - { - var index = this.frames.indexOf(frame); - - if (index !== -1) - { - this.removeFrameAt(index); - } - - return this; - }, - - /** - * Removes a frame from the AnimationFrame array at the provided index - * and updates the animation accordingly. - * - * @method Phaser.Animations.Animation#removeFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {this} This Animation object. - */ - removeFrameAt: function (index) - { - this.frames.splice(index, 1); - - this.updateFrameSequence(); - - return this; - }, - - /** - * Called internally during playback. Forces the animation to repeat, providing there are enough counts left - * in the repeat counter. - * - * @method Phaser.Animations.Animation#repeatAnimation - * @fires Phaser.Animations.Events#ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - repeatAnimation: function (component) - { - if (component._pendingStop === 2) - { - return this.completeAnimation(component); - } - - if (component._repeatDelay > 0 && component.pendingRepeat === false) - { - component.pendingRepeat = true; - component.accumulator -= component.nextTick; - component.nextTick += component._repeatDelay; - } - else - { - component.repeatCounter--; - - component.updateFrame(component.currentFrame[(component.forward) ? 'nextFrame' : 'prevFrame']); - - if (component.isPlaying) - { - this.getNextTick(component); - - component.pendingRepeat = false; - - var frame = component.currentFrame; - var parent = component.parent; - - this.emit(Events.ANIMATION_REPEAT, this, frame); - - parent.emit(Events.SPRITE_ANIMATION_KEY_REPEAT + this.key, this, frame, component.repeatCounter, parent); - - parent.emit(Events.SPRITE_ANIMATION_REPEAT, this, frame, component.repeatCounter, parent); - } - } - }, - - /** - * Sets the texture frame the animation uses for rendering. - * - * @method Phaser.Animations.Animation#setFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - setFrame: function (component) - { - // Work out which frame should be set next on the child, and set it - if (component.forward) - { - this.nextFrame(component); - } - else - { - this.previousFrame(component); - } - }, - - /** - * Converts the animation data to JSON. - * - * @method Phaser.Animations.Animation#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimation} The resulting JSONAnimation formatted object. - */ - toJSON: function () - { - var output = { - key: this.key, - type: this.type, - frames: [], - frameRate: this.frameRate, - duration: this.duration, - skipMissedFrames: this.skipMissedFrames, - delay: this.delay, - repeat: this.repeat, - repeatDelay: this.repeatDelay, - yoyo: this.yoyo, - showOnStart: this.showOnStart, - hideOnComplete: this.hideOnComplete - }; - - this.frames.forEach(function (frame) - { - output.frames.push(frame.toJSON()); - }); - - return output; - }, - - /** - * Called internally whenever frames are added to, or removed from, this Animation. - * - * @method Phaser.Animations.Animation#updateFrameSequence - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - updateFrameSequence: function () - { - var len = this.frames.length; - var slice = 1 / (len - 1); - - var frame; - - for (var i = 0; i < len; i++) - { - frame = this.frames[i]; - - frame.index = i + 1; - frame.isFirst = false; - frame.isLast = false; - frame.progress = i * slice; - - if (i === 0) - { - frame.isFirst = true; - - if (len === 1) - { - frame.isLast = true; - frame.nextFrame = frame; - frame.prevFrame = frame; - } - else - { - frame.isLast = false; - frame.prevFrame = this.frames[len - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - else if (i === len - 1 && len > 1) - { - frame.isLast = true; - frame.prevFrame = this.frames[len - 2]; - frame.nextFrame = this.frames[0]; - } - else if (len > 1) - { - frame.prevFrame = this.frames[i - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - - return this; - }, - - /** - * Pauses playback of this Animation. The paused state is set immediately. - * - * @method Phaser.Animations.Animation#pause - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - pause: function () - { - this.paused = true; - - return this; - }, - - /** - * Resumes playback of this Animation. The paused state is reset immediately. - * - * @method Phaser.Animations.Animation#resume - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - resume: function () - { - this.paused = false; - - return this; - }, - - /** - * Destroys this Animation instance. It will remove all event listeners, - * remove this animation and its key from the global Animation Manager, - * and then destroy all Animation Frames in turn. - * - * @method Phaser.Animations.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAllListeners(); - - this.manager.off(Events.PAUSE_ALL, this.pause, this); - this.manager.off(Events.RESUME_ALL, this.resume, this); - - this.manager.remove(this.key); - - for (var i = 0; i < this.frames.length; i++) - { - this.frames[i].destroy(); - } - - this.frames = []; - - this.manager = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 184 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Add Animation Event. - * - * This event is dispatched when a new animation is added to the global Animation Manager. - * - * This can happen either as a result of an animation instance being added to the Animation Manager, - * or the Animation Manager creating a new animation directly. - * - * @event Phaser.Animations.Events#ADD_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was added to the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the newly created Animation. - */ -module.exports = 'add'; - - -/***/ }), -/* 185 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Complete Event. - * - * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. - * - * Be careful with the volume of events this could generate. If a group of Sprites all complete the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'complete'; - - -/***/ }), -/* 186 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Repeat Event. - * - * This event is dispatched when a currently playing animation repeats. - * - * The event is dispatched directly from the Animation object itself. Which means that listeners - * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. - * - * @event Phaser.Animations.Events#ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that repeated. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation was on when it repeated. - */ -module.exports = 'repeat'; - - -/***/ }), -/* 187 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Restart Event. - * - * This event is dispatched by an Animation instance when it restarts. - * - * Be careful with the volume of events this could generate. If a group of Sprites all restart the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that restarted playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'restart'; - - -/***/ }), -/* 188 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Start Event. - * - * This event is dispatched by an Animation instance when it starts playing. - * - * Be careful with the volume of events this could generate. If a group of Sprites all play the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that started playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'start'; - - -/***/ }), -/* 189 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Pause All Animations Event. - * - * This event is dispatched when the global Animation Manager is told to pause. - * - * When this happens all current animations will stop updating, although it doesn't necessarily mean - * that the game has paused as well. - * - * @event Phaser.Animations.Events#PAUSE_ALL - * @since 3.0.0 - */ -module.exports = 'pauseall'; - - -/***/ }), -/* 190 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Remove Animation Event. - * - * This event is dispatched when an animation is removed from the global Animation Manager. - * - * @event Phaser.Animations.Events#REMOVE_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was removed from the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the removed Animation. - */ -module.exports = 'remove'; - - -/***/ }), -/* 191 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Resume All Animations Event. - * - * This event is dispatched when the global Animation Manager resumes, having been previously paused. - * - * When this happens all current animations will continue updating again. - * - * @event Phaser.Animations.Events#RESUME_ALL - * @since 3.0.0 - */ -module.exports = 'resumeall'; - - -/***/ }), -/* 192 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Complete Event. - * - * This event is dispatched by a Sprite when an animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete'; - - -/***/ }), -/* 193 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Complete Event. - * - * This event is dispatched by a Sprite when a specific animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete-'; - - -/***/ }), -/* 194 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Repeat Event. - * - * This event is dispatched by a Sprite when a specific animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat-'; - - -/***/ }), -/* 195 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Restart Event. - * - * This event is dispatched by a Sprite when a specific animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart-'; - - -/***/ }), -/* 196 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Start Event. - * - * This event is dispatched by a Sprite when a specific animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart-'; - - -/***/ }), -/* 197 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Update Event. - * - * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate-'; - - -/***/ }), -/* 198 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Repeat Event. - * - * This event is dispatched by a Sprite when an animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat'; - - -/***/ }), -/* 199 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Restart Event. - * - * This event is dispatched by a Sprite when an animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart'; - - -/***/ }), -/* 200 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Start Event. - * - * This event is dispatched by a Sprite when an animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart'; - - -/***/ }), -/* 201 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Update Event. - * - * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate'; - - /***/ }), /* 202 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Searches a pre-sorted array for the closet value to the given number. - * - * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, - * and will check for the closest value of those to the given number. - * - * @function Phaser.Utils.Array.FindClosestInSorted - * @since 3.0.0 - * - * @param {number} value - The value to search for in the array. - * @param {array} array - The array to search, which must be sorted. - * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. - * - * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. - */ -var FindClosestInSorted = function (value, array, key) -{ - if (!array.length) - { - return NaN; - } - else if (array.length === 1) - { - return array[0]; - } - - var i = 1; - var low; - var high; - - if (key) - { - if (value < array[0][key]) - { - return array[0]; - } - - while (array[i][key] < value) - { - i++; - } - } - else - { - while (array[i] < value) - { - i++; - } - } - - if (i > array.length) - { - i = array.length; - } - - if (key) - { - low = array[i - 1][key]; - high = array[i][key]; - - return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; - } - else - { - low = array[i - 1]; - high = array[i]; - - return ((high - value) <= (value - low)) ? high : low; - } -}; - -module.exports = FindClosestInSorted; - - -/***/ }), -/* 203 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -20748,181 +23373,7 @@ module.exports = FindClosestInSorted; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); - -/** - * @classdesc - * A single frame in an Animation sequence. - * - * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other - * frames in the animation, and index data. It also has the ability to modify the animation timing. - * - * AnimationFrames are generated automatically by the Animation class. - * - * @class AnimationFrame - * @memberof Phaser.Animations - * @constructor - * @since 3.0.0 - * - * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. - * @param {integer} index - The index of this AnimationFrame within the Animation sequence. - * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. - */ -var AnimationFrame = new Class({ - - initialize: - - function AnimationFrame (textureKey, textureFrame, index, frame) - { - /** - * The key of the Texture this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureKey - * @type {string} - * @since 3.0.0 - */ - this.textureKey = textureKey; - - /** - * The key of the Frame within the Texture that this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {(string|integer)} - * @since 3.0.0 - */ - this.textureFrame = textureFrame; - - /** - * The index of this AnimationFrame within the Animation sequence. - * - * @name Phaser.Animations.AnimationFrame#index - * @type {integer} - * @since 3.0.0 - */ - this.index = index; - - /** - * A reference to the Texture Frame this AnimationFrame uses for rendering. - * - * @name Phaser.Animations.AnimationFrame#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - this.frame = frame; - - /** - * Is this the first frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isFirst - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isFirst = false; - - /** - * Is this the last frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isLast - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isLast = false; - - /** - * A reference to the AnimationFrame that comes before this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#prevFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.prevFrame = null; - - /** - * A reference to the AnimationFrame that comes after this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#nextFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.nextFrame = null; - - /** - * Additional time (in ms) that this frame should appear for during playback. - * The value is added onto the msPerFrame set by the animation. - * - * @name Phaser.Animations.AnimationFrame#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * What % through the animation does this frame come? - * This value is generated when the animation is created and cached here. - * - * @name Phaser.Animations.AnimationFrame#progress - * @type {number} - * @default 0 - * @readonly - * @since 3.0.0 - */ - this.progress = 0; - }, - - /** - * Generates a JavaScript object suitable for converting to JSON. - * - * @method Phaser.Animations.AnimationFrame#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimationFrame} The AnimationFrame data. - */ - toJSON: function () - { - return { - key: this.textureKey, - frame: this.textureFrame, - duration: this.duration - }; - }, - - /** - * Destroys this object by removing references to external resources and callbacks. - * - * @method Phaser.Animations.AnimationFrame#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.frame = undefined; - } - -}); - -module.exports = AnimationFrame; - - -/***/ }), -/* 204 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(13); +var BlendModes = __webpack_require__(14); /** * Provides methods used for setting the blend mode of a Game Object. @@ -21035,7 +23486,7 @@ module.exports = BlendMode; /***/ }), -/* 205 */ +/* 203 */ /***/ (function(module, exports) { /** @@ -21184,7 +23635,7 @@ module.exports = ComputedSize; /***/ }), -/* 206 */ +/* 204 */ /***/ (function(module, exports) { /** @@ -21309,7 +23760,7 @@ module.exports = Crop; /***/ }), -/* 207 */ +/* 205 */ /***/ (function(module, exports) { /** @@ -21402,7 +23853,7 @@ module.exports = Depth; /***/ }), -/* 208 */ +/* 206 */ /***/ (function(module, exports) { /** @@ -21566,7 +24017,7 @@ module.exports = Flip; /***/ }), -/* 209 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21575,8 +24026,8 @@ module.exports = Flip; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(210); -var RotateAround = __webpack_require__(27); +var Rectangle = __webpack_require__(208); +var RotateAround = __webpack_require__(28); var Vector2 = __webpack_require__(1); /** @@ -21925,7 +24376,7 @@ module.exports = GetBounds; /***/ }), -/* 210 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -21935,12 +24386,12 @@ module.exports = GetBounds; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(211); +var Contains = __webpack_require__(209); var GetPoint = __webpack_require__(39); -var GetPoints = __webpack_require__(212); -var GEOM_CONST = __webpack_require__(12); -var Line = __webpack_require__(213); -var Random = __webpack_require__(218); +var GetPoints = __webpack_require__(210); +var GEOM_CONST = __webpack_require__(13); +var Line = __webpack_require__(211); +var Random = __webpack_require__(216); /** * @classdesc @@ -22436,7 +24887,7 @@ module.exports = Rectangle; /***/ }), -/* 211 */ +/* 209 */ /***/ (function(module, exports) { /** @@ -22471,7 +24922,7 @@ module.exports = Contains; /***/ }), -/* 212 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22525,7 +24976,7 @@ module.exports = GetPoints; /***/ }), -/* 213 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22535,10 +24986,10 @@ module.exports = GetPoints; */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(214); -var GetPoints = __webpack_require__(215); -var GEOM_CONST = __webpack_require__(12); -var Random = __webpack_require__(217); +var GetPoint = __webpack_require__(212); +var GetPoints = __webpack_require__(213); +var GEOM_CONST = __webpack_require__(13); +var Random = __webpack_require__(215); var Vector2 = __webpack_require__(1); /** @@ -22862,7 +25313,7 @@ module.exports = Line; /***/ }), -/* 214 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22901,7 +25352,7 @@ module.exports = GetPoint; /***/ }), -/* 215 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -22910,7 +25361,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(216); +var Length = __webpack_require__(214); var Point = __webpack_require__(5); /** @@ -22966,7 +25417,7 @@ module.exports = GetPoints; /***/ }), -/* 216 */ +/* 214 */ /***/ (function(module, exports) { /** @@ -22994,7 +25445,7 @@ module.exports = Length; /***/ }), -/* 217 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23034,7 +25485,7 @@ module.exports = Random; /***/ }), -/* 218 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23072,7 +25523,7 @@ module.exports = Random; /***/ }), -/* 219 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23081,8 +25532,8 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(220); -var GeometryMask = __webpack_require__(238); +var BitmapMask = __webpack_require__(218); +var GeometryMask = __webpack_require__(236); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -23109,10 +25560,10 @@ var Mask = { * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @@ -23158,6 +25609,8 @@ var Mask = { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -23168,7 +25621,7 @@ var Mask = { * * @method Phaser.GameObjects.Components.Mask#createBitmapMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. * * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. @@ -23192,12 +25645,12 @@ var Mask = { * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. @@ -23219,7 +25672,7 @@ module.exports = Mask; /***/ }), -/* 220 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23229,7 +25682,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(221); +var GameEvents = __webpack_require__(219); /** * @classdesc @@ -23248,6 +25701,9 @@ var GameEvents = __webpack_require__(221); * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -23370,36 +25826,73 @@ var BitmapMask = new Class({ */ this.isStencil = false; - if (renderer && renderer.gl) + this.createMask(); + + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + }, + + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + * + * @method Phaser.Display.Masks.BitmapMask#createMask + * @since 3.50.0 + */ + createMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl) { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) - { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - }, this); + return; } + + if (this.mainTexture) + { + this.clearMask(); + } + + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + }, + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + * + * @method Phaser.Display.Masks.BitmapMask#clearMask + * @since 3.50.0 + */ + clearMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl || !this.mainTexture) + { + return; + } + + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; }, /** @@ -23429,7 +25922,7 @@ var BitmapMask = new Class({ */ preRenderWebGL: function (renderer, maskedObject, camera) { - renderer.pipelines.BitmapMaskPipeline.beginMask(this, maskedObject, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); }, /** @@ -23444,7 +25937,7 @@ var BitmapMask = new Class({ */ postRenderWebGL: function (renderer, camera) { - renderer.pipelines.BitmapMaskPipeline.endMask(this, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera); }, /** @@ -23477,7 +25970,7 @@ var BitmapMask = new Class({ /** * Destroys this BitmapMask and nulls any references it holds. - * + * * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, * so be sure to call `clearMask` on any Game Object using it, before destroying it. * @@ -23486,22 +25979,9 @@ var BitmapMask = new Class({ */ destroy: function () { + this.clearMask(); + this.bitmapMask = null; - - var renderer = this.renderer; - - if (renderer && renderer.gl) - { - renderer.deleteTexture(this.mainTexture); - renderer.deleteTexture(this.maskTexture); - renderer.deleteFramebuffer(this.mainFramebuffer); - renderer.deleteFramebuffer(this.maskFramebuffer); - } - - this.mainTexture = null; - this.maskTexture = null; - this.mainFramebuffer = null; - this.maskFramebuffer = null; this.prevFramebuffer = null; this.renderer = null; } @@ -23512,7 +25992,7 @@ module.exports = BitmapMask; /***/ }), -/* 221 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -23527,28 +26007,28 @@ module.exports = BitmapMask; module.exports = { - BLUR: __webpack_require__(222), - BOOT: __webpack_require__(223), - CONTEXT_LOST: __webpack_require__(224), - CONTEXT_RESTORED: __webpack_require__(225), - DESTROY: __webpack_require__(226), - FOCUS: __webpack_require__(227), - HIDDEN: __webpack_require__(228), - PAUSE: __webpack_require__(229), - POST_RENDER: __webpack_require__(230), - POST_STEP: __webpack_require__(231), - PRE_RENDER: __webpack_require__(232), - PRE_STEP: __webpack_require__(233), - READY: __webpack_require__(234), - RESUME: __webpack_require__(235), - STEP: __webpack_require__(236), - VISIBLE: __webpack_require__(237) + BLUR: __webpack_require__(220), + BOOT: __webpack_require__(221), + CONTEXT_LOST: __webpack_require__(222), + CONTEXT_RESTORED: __webpack_require__(223), + DESTROY: __webpack_require__(224), + FOCUS: __webpack_require__(225), + HIDDEN: __webpack_require__(226), + PAUSE: __webpack_require__(227), + POST_RENDER: __webpack_require__(228), + POST_STEP: __webpack_require__(229), + PRE_RENDER: __webpack_require__(230), + PRE_STEP: __webpack_require__(231), + READY: __webpack_require__(232), + RESUME: __webpack_require__(233), + STEP: __webpack_require__(234), + VISIBLE: __webpack_require__(235) }; /***/ }), -/* 222 */ +/* 220 */ /***/ (function(module, exports) { /** @@ -23571,7 +26051,7 @@ module.exports = 'blur'; /***/ }), -/* 223 */ +/* 221 */ /***/ (function(module, exports) { /** @@ -23593,7 +26073,7 @@ module.exports = 'boot'; /***/ }), -/* 224 */ +/* 222 */ /***/ (function(module, exports) { /** @@ -23616,7 +26096,7 @@ module.exports = 'contextlost'; /***/ }), -/* 225 */ +/* 223 */ /***/ (function(module, exports) { /** @@ -23639,7 +26119,7 @@ module.exports = 'contextrestored'; /***/ }), -/* 226 */ +/* 224 */ /***/ (function(module, exports) { /** @@ -23662,7 +26142,7 @@ module.exports = 'destroy'; /***/ }), -/* 227 */ +/* 225 */ /***/ (function(module, exports) { /** @@ -23684,7 +26164,7 @@ module.exports = 'focus'; /***/ }), -/* 228 */ +/* 226 */ /***/ (function(module, exports) { /** @@ -23710,7 +26190,7 @@ module.exports = 'hidden'; /***/ }), -/* 229 */ +/* 227 */ /***/ (function(module, exports) { /** @@ -23731,7 +26211,7 @@ module.exports = 'pause'; /***/ }), -/* 230 */ +/* 228 */ /***/ (function(module, exports) { /** @@ -23757,7 +26237,7 @@ module.exports = 'postrender'; /***/ }), -/* 231 */ +/* 229 */ /***/ (function(module, exports) { /** @@ -23782,7 +26262,7 @@ module.exports = 'poststep'; /***/ }), -/* 232 */ +/* 230 */ /***/ (function(module, exports) { /** @@ -23807,7 +26287,7 @@ module.exports = 'prerender'; /***/ }), -/* 233 */ +/* 231 */ /***/ (function(module, exports) { /** @@ -23832,7 +26312,7 @@ module.exports = 'prestep'; /***/ }), -/* 234 */ +/* 232 */ /***/ (function(module, exports) { /** @@ -23854,7 +26334,7 @@ module.exports = 'ready'; /***/ }), -/* 235 */ +/* 233 */ /***/ (function(module, exports) { /** @@ -23875,7 +26355,7 @@ module.exports = 'resume'; /***/ }), -/* 236 */ +/* 234 */ /***/ (function(module, exports) { /** @@ -23900,7 +26380,7 @@ module.exports = 'step'; /***/ }), -/* 237 */ +/* 235 */ /***/ (function(module, exports) { /** @@ -23924,7 +26404,7 @@ module.exports = 'visible'; /***/ }), -/* 238 */ +/* 236 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24014,7 +26494,7 @@ var GeometryMask = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. - * + * * @return {this} This Geometry Mask */ setShape: function (graphicsGeometry) @@ -24032,7 +26512,7 @@ var GeometryMask = new Class({ * @since 3.17.0 * * @param {boolean} [value=true] - Invert the alpha of this mask? - * + * * @return {this} This Geometry Mask */ setInvertAlpha: function (value) @@ -24111,7 +26591,7 @@ var GeometryMask = new Class({ } // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + geometryMask.renderWebGL(renderer, geometryMask, camera); renderer.flush(); @@ -24201,7 +26681,7 @@ var GeometryMask = new Class({ renderer.currentContext.save(); - geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); renderer.currentContext.clip(); }, @@ -24239,7 +26719,7 @@ module.exports = GeometryMask; /***/ }), -/* 239 */ +/* 237 */ /***/ (function(module, exports) { /** @@ -24442,7 +26922,7 @@ module.exports = Origin; /***/ }), -/* 240 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -24451,10 +26931,10 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(24); -var GetBoolean = __webpack_require__(241); -var GetValue = __webpack_require__(11); -var TWEEN_CONST = __webpack_require__(242); +var DegToRad = __webpack_require__(25); +var GetBoolean = __webpack_require__(239); +var GetValue = __webpack_require__(12); +var TWEEN_CONST = __webpack_require__(240); var Vector2 = __webpack_require__(1); /** @@ -24869,7 +27349,7 @@ module.exports = PathFollower; /***/ }), -/* 241 */ +/* 239 */ /***/ (function(module, exports) { /** @@ -24910,7 +27390,7 @@ module.exports = GetBoolean; /***/ }), -/* 242 */ +/* 240 */ /***/ (function(module, exports) { /** @@ -25082,8 +27562,8 @@ module.exports = TWEEN_CONST; /***/ }), -/* 243 */ -/***/ (function(module, exports) { +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -25091,6 +27571,8 @@ module.exports = TWEEN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var PIPELINE_CONST = __webpack_require__(242); + /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. * @@ -25132,19 +27614,20 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} [pipelineName=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (pipelineName) + initPipeline: function (name) { - if (pipelineName === undefined) { pipelineName = 'MultiPipeline'; } + if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.defaultPipeline = renderer.getPipeline(pipelineName); + this.defaultPipeline = pipelines.get(name); this.pipeline = this.defaultPipeline; return true; @@ -25160,17 +27643,18 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} pipelineName - The name of the pipeline to set on this Game Object. + * @param {string} name - The name of the pipeline to set on this Game Object. * * @return {this} This Game Object instance. */ - setPipeline: function (pipelineName) + setPipeline: function (name) { var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.pipeline = renderer.getPipeline(pipelineName); + this.pipeline = pipelines.get(name); } return this; @@ -25212,7 +27696,84 @@ module.exports = Pipeline; /***/ }), -/* 244 */ +/* 242 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PIPELINE_CONST = { + + /** + * The Bitmap Mask Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', + + /** + * The Light 2D Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + LIGHT_PIPELINE: 'Light2D', + + /** + * The Single Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + SINGLE_PIPELINE: 'SinglePipeline', + + /** + * The Multi Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + MULTI_PIPELINE: 'MultiPipeline', + + /** + * The Rope Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + ROPE_PIPELINE: 'RopePipeline', + + /** + * The Mesh Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.MESH_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + MESH_PIPELINE: 'MeshPipeline' + +}; + +module.exports = PIPELINE_CONST; + + +/***/ }), +/* 243 */ /***/ (function(module, exports) { /** @@ -25319,7 +27880,7 @@ module.exports = ScrollFactor; /***/ }), -/* 245 */ +/* 244 */ /***/ (function(module, exports) { /** @@ -25506,7 +28067,7 @@ module.exports = Size; /***/ }), -/* 246 */ +/* 245 */ /***/ (function(module, exports) { /** @@ -25636,7 +28197,7 @@ module.exports = Texture; /***/ }), -/* 247 */ +/* 246 */ /***/ (function(module, exports) { /** @@ -25844,8 +28405,8 @@ module.exports = TextureCrop; /***/ }), -/* 248 */ -/***/ (function(module, exports, __webpack_require__) { +/* 247 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -25853,8 +28414,6 @@ module.exports = TextureCrop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColorFromValue = __webpack_require__(249); - /** * Provides methods used for setting the tint of a Game Object. * Should be applied as a mixin and not used directly. @@ -25867,62 +28426,58 @@ var GetColorFromValue = __webpack_require__(249); var Tint = { /** - * Private internal value. Holds the top-left tint value. + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTL + * @name Phaser.GameObjects.Components.Tint#tintTopLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTL: 16777215, + tintTopLeft: 0xffffff, /** - * Private internal value. Holds the top-right tint value. + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTR + * @name Phaser.GameObjects.Components.Tint#tintTopRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTR: 16777215, + tintTopRight: 0xffffff, /** - * Private internal value. Holds the bottom-left tint value. + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBL + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBL: 16777215, + tintBottomLeft: 0xffffff, /** - * Private internal value. Holds the bottom-right tint value. + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBR + * @name Phaser.GameObjects.Components.Tint#tintBottomRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBR: 16777215, + tintBottomRight: 0xffffff, /** - * Private internal value. Holds if the Game Object is tinted or not. + * The tint fill mode. * - * @name Phaser.GameObjects.Components.Tint#_isTinted - * @type {boolean} - * @private - * @default false - * @since 3.11.0 - */ - _isTinted: false, - - /** - * Fill or additive? + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Components.Tint#tintFill * @type {boolean} @@ -25947,8 +28502,6 @@ var Tint = { { this.setTint(0xffffff); - this._isTinted = false; - return this; }, @@ -25990,12 +28543,10 @@ var Tint = { bottomRight = topLeft; } - this._tintTL = GetColorFromValue(topLeft); - this._tintTR = GetColorFromValue(topRight); - this._tintBL = GetColorFromValue(bottomLeft); - this._tintBR = GetColorFromValue(bottomRight); - - this._isTinted = true; + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; this.tintFill = false; @@ -26039,102 +28590,6 @@ var Tint = { return this; }, - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopLeft: { - - get: function () - { - return this._tintTL; - }, - - set: function (value) - { - this._tintTL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopRight: { - - get: function () - { - return this._tintTR; - }, - - set: function (value) - { - this._tintTR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomLeft: { - - get: function () - { - return this._tintBL; - }, - - set: function (value) - { - this._tintBL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomRight: { - - get: function () - { - return this._tintBR; - }, - - set: function (value) - { - this._tintBR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. @@ -26153,7 +28608,10 @@ var Tint = { }, /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. * * @name Phaser.GameObjects.Components.Tint#isTinted * @type {boolean} @@ -26165,7 +28623,15 @@ var Tint = { get: function () { - return this._isTinted; + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); } } @@ -26176,36 +28642,7 @@ module.exports = Tint; /***/ }), -/* 249 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a hex color value, such as 0xff00ff (for purple), it will return a - * numeric representation of it (i.e. 16711935) for use in WebGL tinting. - * - * @function Phaser.Display.Color.GetColorFromValue - * @since 3.50.0 - * - * @param {number} red - The hex color value, such as 0xff0000. - * - * @return {number} The combined color value. - */ -var GetColorFromValue = function (value) -{ - return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); -}; - -module.exports = GetColorFromValue; - - -/***/ }), -/* 250 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26216,9 +28653,9 @@ module.exports = GetColorFromValue; var MATH_CONST = __webpack_require__(2); var TransformMatrix = __webpack_require__(41); -var TransformXY = __webpack_require__(28); -var WrapAngle = __webpack_require__(15); -var WrapAngleDegrees = __webpack_require__(16); +var TransformXY = __webpack_require__(29); +var WrapAngle = __webpack_require__(16); +var WrapAngleDegrees = __webpack_require__(17); var Vector2 = __webpack_require__(1); // global bitmask flag for GameObject.renderMask (used by Scale) @@ -26489,6 +28926,26 @@ var Transform = { return this; }, + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -26796,7 +29253,7 @@ module.exports = Transform; /***/ }), -/* 251 */ +/* 249 */ /***/ (function(module, exports) { /** @@ -26885,7 +29342,7 @@ module.exports = Visible; /***/ }), -/* 252 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26894,17 +29351,17 @@ module.exports = Visible; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(42); -var renderCanvas = __webpack_require__(42); +var renderWebGL = __webpack_require__(7); +var renderCanvas = __webpack_require__(7); if (typeof WEBGL_RENDERER) { - renderWebGL = __webpack_require__(253); + renderWebGL = __webpack_require__(251); } if (typeof CANVAS_RENDERER) { - renderCanvas = __webpack_require__(254); + renderCanvas = __webpack_require__(252); } module.exports = { @@ -26916,7 +29373,7 @@ module.exports = { /***/ }), -/* 253 */ +/* 251 */ /***/ (function(module, exports) { /** @@ -26936,11 +29393,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpriteWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) { this.pipeline.batchSprite(src, camera, parentMatrix); }; @@ -26949,7 +29405,7 @@ module.exports = SpriteWebGLRenderer; /***/ }), -/* 254 */ +/* 252 */ /***/ (function(module, exports) { /** @@ -26969,11 +29425,10 @@ module.exports = SpriteWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Sprite} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpriteCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpriteCanvasRenderer = function (renderer, src, camera, parentMatrix) { renderer.batchSprite(src, src.frame, camera, parentMatrix); }; @@ -26982,7 +29437,7 @@ module.exports = SpriteCanvasRenderer; /***/ }), -/* 255 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -26991,7 +29446,7 @@ module.exports = SpriteCanvasRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var Camera = __webpack_require__(32); +var Camera = __webpack_require__(33); var Class = __webpack_require__(0); var Vector3 = __webpack_require__(3); @@ -27122,7 +29577,7 @@ module.exports = PerspectiveCamera; /***/ }), -/* 256 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27131,9 +29586,9 @@ module.exports = PerspectiveCamera; * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ -var BasePlugin = __webpack_require__(257); +var BasePlugin = __webpack_require__(255); var Class = __webpack_require__(0); -var SceneEvents = __webpack_require__(258); +var SceneEvents = __webpack_require__(256); /** * @classdesc @@ -27250,7 +29705,7 @@ module.exports = ScenePlugin; /***/ }), -/* 257 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27380,7 +29835,7 @@ module.exports = BasePlugin; /***/ }), -/* 258 */ +/* 256 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -27395,33 +29850,33 @@ module.exports = BasePlugin; module.exports = { - ADDED_TO_SCENE: __webpack_require__(259), - BOOT: __webpack_require__(260), - CREATE: __webpack_require__(261), - DESTROY: __webpack_require__(262), - PAUSE: __webpack_require__(263), - POST_UPDATE: __webpack_require__(264), - PRE_UPDATE: __webpack_require__(265), - READY: __webpack_require__(266), - REMOVED_FROM_SCENE: __webpack_require__(267), - RENDER: __webpack_require__(268), - RESUME: __webpack_require__(269), - SHUTDOWN: __webpack_require__(270), - SLEEP: __webpack_require__(271), - START: __webpack_require__(272), - TRANSITION_COMPLETE: __webpack_require__(273), - TRANSITION_INIT: __webpack_require__(274), - TRANSITION_OUT: __webpack_require__(275), - TRANSITION_START: __webpack_require__(276), - TRANSITION_WAKE: __webpack_require__(277), - UPDATE: __webpack_require__(278), - WAKE: __webpack_require__(279) + ADDED_TO_SCENE: __webpack_require__(257), + BOOT: __webpack_require__(258), + CREATE: __webpack_require__(259), + DESTROY: __webpack_require__(260), + PAUSE: __webpack_require__(261), + POST_UPDATE: __webpack_require__(262), + PRE_UPDATE: __webpack_require__(263), + READY: __webpack_require__(264), + REMOVED_FROM_SCENE: __webpack_require__(265), + RENDER: __webpack_require__(266), + RESUME: __webpack_require__(267), + SHUTDOWN: __webpack_require__(268), + SLEEP: __webpack_require__(269), + START: __webpack_require__(270), + TRANSITION_COMPLETE: __webpack_require__(271), + TRANSITION_INIT: __webpack_require__(272), + TRANSITION_OUT: __webpack_require__(273), + TRANSITION_START: __webpack_require__(274), + TRANSITION_WAKE: __webpack_require__(275), + UPDATE: __webpack_require__(276), + WAKE: __webpack_require__(277) }; /***/ }), -/* 259 */ +/* 257 */ /***/ (function(module, exports) { /** @@ -27447,7 +29902,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 260 */ +/* 258 */ /***/ (function(module, exports) { /** @@ -27472,7 +29927,7 @@ module.exports = 'boot'; /***/ }), -/* 261 */ +/* 259 */ /***/ (function(module, exports) { /** @@ -27501,7 +29956,7 @@ module.exports = 'create'; /***/ }), -/* 262 */ +/* 260 */ /***/ (function(module, exports) { /** @@ -27528,7 +29983,7 @@ module.exports = 'destroy'; /***/ }), -/* 263 */ +/* 261 */ /***/ (function(module, exports) { /** @@ -27555,7 +30010,7 @@ module.exports = 'pause'; /***/ }), -/* 264 */ +/* 262 */ /***/ (function(module, exports) { /** @@ -27592,7 +30047,7 @@ module.exports = 'postupdate'; /***/ }), -/* 265 */ +/* 263 */ /***/ (function(module, exports) { /** @@ -27629,7 +30084,7 @@ module.exports = 'preupdate'; /***/ }), -/* 266 */ +/* 264 */ /***/ (function(module, exports) { /** @@ -27657,7 +30112,7 @@ module.exports = 'ready'; /***/ }), -/* 267 */ +/* 265 */ /***/ (function(module, exports) { /** @@ -27683,7 +30138,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 268 */ +/* 266 */ /***/ (function(module, exports) { /** @@ -27719,7 +30174,7 @@ module.exports = 'render'; /***/ }), -/* 269 */ +/* 267 */ /***/ (function(module, exports) { /** @@ -27746,7 +30201,7 @@ module.exports = 'resume'; /***/ }), -/* 270 */ +/* 268 */ /***/ (function(module, exports) { /** @@ -27776,7 +30231,7 @@ module.exports = 'shutdown'; /***/ }), -/* 271 */ +/* 269 */ /***/ (function(module, exports) { /** @@ -27803,7 +30258,7 @@ module.exports = 'sleep'; /***/ }), -/* 272 */ +/* 270 */ /***/ (function(module, exports) { /** @@ -27828,7 +30283,7 @@ module.exports = 'start'; /***/ }), -/* 273 */ +/* 271 */ /***/ (function(module, exports) { /** @@ -27864,7 +30319,7 @@ module.exports = 'transitioncomplete'; /***/ }), -/* 274 */ +/* 272 */ /***/ (function(module, exports) { /** @@ -27901,7 +30356,7 @@ module.exports = 'transitioninit'; /***/ }), -/* 275 */ +/* 273 */ /***/ (function(module, exports) { /** @@ -27935,7 +30390,7 @@ module.exports = 'transitionout'; /***/ }), -/* 276 */ +/* 274 */ /***/ (function(module, exports) { /** @@ -27975,7 +30430,7 @@ module.exports = 'transitionstart'; /***/ }), -/* 277 */ +/* 275 */ /***/ (function(module, exports) { /** @@ -28010,7 +30465,7 @@ module.exports = 'transitionwake'; /***/ }), -/* 278 */ +/* 276 */ /***/ (function(module, exports) { /** @@ -28047,7 +30502,7 @@ module.exports = 'update'; /***/ }), -/* 279 */ +/* 277 */ /***/ (function(module, exports) { /** diff --git a/plugins/camera3d/dist/camera3d.min.js b/plugins/camera3d/dist/camera3d.min.js index 598872860..15b0d8428 100644 --- a/plugins/camera3d/dist/camera3d.min.js +++ b/plugins/camera3d/dist/camera3d.min.js @@ -1 +1 @@ -var Camera3DPlugin=function(n){var e={};function s(t){if(e[t])return e[t].exports;var i=e[t]={i:t,l:!1,exports:{}};return n[t].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=n,s.c=e,s.d=function(t,i,n){s.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:n})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(i,t){if(1&t&&(i=s(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var e in i)s.d(n,e,function(t){return i[t]}.bind(null,e));return n},s.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(i,"a",i),i},s.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},s.p="",s(s.s=43)}([function(t,i){function r(t,i,n,e){for(var s in i)if(i.hasOwnProperty(s)){var r=(u=i,c=s,l=p=void 0,l=(f=n)?u[c]:Object.getOwnPropertyDescriptor(u,c),!f&&l.value&&"object"==typeof l.value&&(l=l.value),!(!l||!((p=l).get&&"function"==typeof p.get||p.set&&"function"==typeof p.set))&&(void 0===l.enumerable&&(l.enumerable=!0),void 0===l.configurable&&(l.configurable=!0),l));if(!1!==r){if(o=(e||t).prototype,h=s,a=void 0,(a=Object.getOwnPropertyDescriptor(o,h))&&(a.value&&"object"==typeof a.value&&(a=a.value),!1===a.configurable)){if(d.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,s,r)}else t.prototype[s]=i[s]}var o,h,a,u,c,f,p,l}function o(t,i){if(i){Array.isArray(i)||(i=[i]);for(var n=0;nr[0]&&(i=1),r[8]>r[3*i+i]&&(i=2),n=h[i],e=h[n],s=Math.sqrt(r[3*i+i]-r[3*n+n]-r[3*e+e]+1),a[i]=.5*s,s=.5/s,a[n]=(r[3*n+i]+r[3*i+n])*s,a[e]=(r[3*e+i]+r[3*i+e])*s,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(r[3*e+n]-r[3*n+e])*s),this}});t.exports=p},function(t,i,n){var e=n(3),s=n(10),r=n(30),o=new s,h=new r,a=new e;t.exports=function(t,i,n){return h.setAxisAngle(i,n),o.fromRotationTranslation(h,a.set(0,0,0)),t.transformMat4(o)}},function(t,i,n){var e=n(0),s=n(10),r=n(25),o=n(26),h=n(31),a=n(158),u=n(33),c=n(1),f=n(3),p=n(9),l=new f,d=new p,y=new f,x=new f,v=new s,m=new e({initialize:function(t){this.scene=t,this.displayList=t.sys.displayList,this.updateList=t.sys.updateList,this.name="",this.direction=new f(0,0,-1),this.up=new f(0,1,0),this.position=new f,this.pixelScale=128,this.projection=new s,this.view=new s,this.combined=new s,this.invProjectionView=new s,this.near=1,this.far=100,this.ray={origin:new f,direction:new f},this.viewportWidth=0,this.viewportHeight=0,this.billboardMatrixDirty=!0,this.children=new a},setPosition:function(t,i,n){return this.position.set(t,i,n),this.update()},setScene:function(t){return this.scene=t,this},setPixelScale:function(t){return this.pixelScale=t,this.update()},add:function(t){return this.children.set(t),this.displayList.add(t.gameObject),this.updateList.add(t.gameObject),this.updateChildren(),t},remove:function(t){return this.displayList.remove(t.gameObject),this.updateList.remove(t.gameObject),this.children.delete(t),this},clear:function(){for(var t=this.getChildren(),i=0;iMath.PI&&(t-=e.PI2),Math.abs(((t+e.TAU)%e.PI2-e.PI2)%e.PI2)}},function(t,i,n){var e=n(7);t.exports=function(){return e(-Math.PI,Math.PI)}},function(t,i,n){var e=n(7);t.exports=function(){return e(-180,180)}},function(t,i,n){var e=n(14);t.exports=function(t){return e(t+Math.PI)}},function(t,i,n){var e=n(2);t.exports=function(t,i,n){return void 0===n&&(n=.05),t===i||(Math.abs(i-t)<=n||Math.abs(i-t)>=e.PI2-n?t=i:(Math.abs(i-t)>Math.PI&&(i>>0,n=(i*=n)>>>0,n+=4294967296*(i-=n);return 2.3283064365386963e-10*((this.n=n)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var i=0;i=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var i=this.parent;return this.currentFrame=t,i.texture=t.frame.texture,i.frame=t.frame,i.isCropped&&i.frame.updateCropUVs(i._crop,i.flipX,i.flipY),i.setSizeToFrame(),i._originComponent&&(t.frame.customPivot?i.setOrigin(t.frame.pivotX,t.frame.pivotY):i.updateDisplayOrigin()),i},updateFrame:function(t){var i,n=this.setCurrentFrame(t);this.isPlaying&&(t.setAlpha&&(n.alpha=t.alpha),i=this.currentAnim,n.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,n),n.emit(r.SPRITE_ANIMATION_UPDATE,i,t,n),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this))},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,i,n){var e=n(4),s=n(0),r=n(36),o=n(38),h=n(202),y=n(203),x=n(11),a=new s({Extends:r,initialize:function(t,i,n){r.call(this),this.manager=t,this.key=i,this.type="frame",this.frames=this.getFrames(t.textureManager,x(n,"frames",[]),x(n,"defaultTextureKey",null)),this.frameRate=x(n,"frameRate",null),this.duration=x(n,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=x(n,"skipMissedFrames",!0),this.delay=x(n,"delay",0),this.repeat=x(n,"repeat",0),this.repeatDelay=x(n,"repeatDelay",0),this.yoyo=x(n,"yoyo",!1),this.showOnStart=x(n,"showOnStart",!1),this.hideOnComplete=x(n,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,i){var n,e,s=this.getFrames(this.manager.textureManager,i);return 0=this.frames.length&&(i=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var n=this.frames[i];0!==i||t.forward||(n=this.getLastFrame()),t.updateFrame(n)},getFrameByProgress:function(t){return t=e(t,0,1),h(t,this.frames,"progress")},nextFrame:function(t){var i=t.currentFrame;i.isLast?t._yoyo?this.handleYoyoFrame(t,!1):0i.length&&(r=i.length),n?(e=i[r-1][n],(s=i[r][n])-t<=t-e?i[r]:i[r-1]):(e=i[r-1],(s=i[r])-t<=t-e?s:e)}},function(t,i,n){var e=new(n(0))({initialize:function(t,i,n,e){this.textureKey=t,this.textureFrame=i,this.index=n,this.frame=e,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=e},function(t,i,n){var e=n(13),s={_blendMode:e.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=e[t]),-1<=(t|=0)&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,i){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,i){return this.width=t,this.height=i,this},setDisplaySize:function(t,i){return this.displayWidth=t,this.displayHeight=i,this}}},function(t,i){var n={texture:null,frame:null,isCropped:!1,setCrop:function(t,i,n,e){return void 0===t?this.isCropped=!1:this.frame&&("number"==typeof t?this.frame.setCropUVs(this._crop,t,i,n,e,this.flipX,this.flipY):this.frame.setCropUVs(this._crop,t.x,t.y,t.width,t.height,this.flipX,this.flipY),this.isCropped=!0),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=n},function(t,i){var n={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=n},function(t,i){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,i){return this.flipX=t,this.flipY=i,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,i,n){var c=n(210),e=n(27),s=n(1),r={prepareBoundsOutput:function(t,i){return void 0===i&&(i=!1),0!==this.rotation&&e(t,this.x,this.y,this.rotation),i&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,i)},getTopCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,i)},getTopRight:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,i)},getLeftCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,i)},getRightCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,i)},getBottomLeft:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,i)},getBottomCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,i)},getBottomRight:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,i)},getBounds:function(t){var i,n,e,s,r,o,h,a,u;return void 0===t&&(t=new c),a=(h=(this.parentContainer?(u=this.parentContainer.getBoundsTransformMatrix(),this.getTopLeft(t),u.transformPoint(t.x,t.y,t),i=t.x,n=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),e=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),r=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t)):(this.getTopLeft(t),i=t.x,n=t.y,this.getTopRight(t),e=t.x,s=t.y,this.getBottomLeft(t),r=t.x,o=t.y,this.getBottomRight(t)),t.x),t.y),t.x=Math.min(i,e,r,h),t.y=Math.min(n,s,o,a),t.width=Math.max(i,e,r,h)-t.x,t.height=Math.max(n,s,o,a)-t.y,t}};t.exports=r},function(t,i,n){var e=n(0),s=n(211),r=n(39),o=n(212),h=n(12),a=n(213),u=n(218),c=new e({initialize:function(t,i,n,e){void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===e&&(e=0),this.type=h.RECTANGLE,this.x=t,this.y=i,this.width=n,this.height=e},contains:function(t,i){return s(this,t,i)},getPoint:function(t,i){return r(this,t,i)},getPoints:function(t,i,n){return o(this,t,i,n)},getRandomPoint:function(t){return u(this,t)},setTo:function(t,i,n,e){return this.x=t,this.y=i,this.width=n,this.height=e,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,i){return void 0===i&&(i=t),this.x=t,this.y=i,this},setSize:function(t,i){return void 0===i&&(i=t),this.width=t,this.height=i,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,i){t.exports=function(t,i,n){return!(t.width<=0||t.height<=0)&&(t.x<=i&&t.x+t.width>=i&&t.y<=n&&t.y+t.height>=n)}},function(t,i,n){var o=n(39),h=n(40);t.exports=function(t,i,n,e){void 0===e&&(e=[]),!i&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=u},function(t,i,n){var e=n(5);t.exports=function(t,i,n){return void 0===n&&(n=new e),n.x=t.x1+(t.x2-t.x1)*i,n.y=t.y1+(t.y2-t.y1)*i,n}},function(t,i,n){var p=n(216),l=n(5);t.exports=function(t,i,n,e){void 0===e&&(e=[]),!i&&0>16)+(65280&t)+((255&t)<<16)}},function(t,i,n){var e=n(2),s=n(41),a=n(28),r=n(15),o=n(16),u=n(1),h={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*e.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*e.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=r(t)}},setPosition:function(t,i,n,e){return void 0===t&&(t=0),void 0===i&&(i=t),void 0===n&&(n=0),void 0===e&&(e=0),this.x=t,this.y=i,this.z=n,this.w=e,this},setRandomPosition:function(t,i,n,e){return void 0===t&&(t=0),void 0===i&&(i=0),void 0===n&&(n=this.scene.sys.scale.width),void 0===e&&(e=this.scene.sys.scale.height),this.x=t+Math.random()*n,this.y=i+Math.random()*e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,i){return void 0===t&&(t=1),void 0===i&&(i=t),this.scaleX=t,this.scaleY=i,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new s),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,i){void 0===t&&(t=new s),void 0===i&&(i=new s);var n=this.parentContainer;if(!n)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);n;)i.applyITRS(n.x,n.y,n._rotation,n._scaleX,n._scaleY),i.multiply(t,t),n=n.parentContainer;return t},getLocalPoint:function(t,i,n,e){n=n||new u;var s=(e=e||this.scene.sys.cameras.main).scrollX,r=e.scrollY,o=t+s*this.scrollFactorX-s,h=i+r*this.scrollFactorY-r;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,h,n):a(o,h,this.x,this.y,this.rotation,this.scaleX,this.scaleY,n),this._originComponent&&(n.x+=this._displayOriginX,n.y+=this._displayOriginY),n},getParentRotation:function(){for(var t=0,i=this.parentContainer;i;)t+=i.rotation,i=i.parentContainer;return t}};t.exports=h},function(t,i){var n={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=n},function(t,i,n){var e=n(42),s=n(42),e=n(253),s=n(254);t.exports={renderWebGL:e,renderCanvas:s}},function(t,i){t.exports=function(t,i,n,e,s){this.pipeline.batchSprite(i,e,s)}},function(t,i){t.exports=function(t,i,n,e,s){t.batchSprite(i,i.frame,e,s)}},function(t,i,n){var s=n(32),e=n(0),r=new(n(3)),o=new e({Extends:s,initialize:function(t,i,n,e){void 0===i&&(i=80),void 0===n&&(n=0),void 0===e&&(e=0),s.call(this,t),this.viewportWidth=n,this.viewportHeight=e,this.fieldOfView=i*Math.PI/180,this.update()},setFOV:function(t){return this.fieldOfView=t*Math.PI/180,this},update:function(){var t=this.viewportWidth/this.viewportHeight;return this.projection.perspective(this.fieldOfView,t,Math.abs(this.near),Math.abs(this.far)),r.copy(this.position).add(this.direction),this.view.lookAt(this.position,r,this.up),this.combined.copy(this.projection).multiply(this.view),this.invProjectionView.copy(this.combined).invert(),this.billboardMatrixDirty=!0,this.updateChildren(),this}});t.exports=o},function(t,i,n){var e=n(257),s=n(0),r=n(258),o=new s({Extends:e,initialize:function(t,i){e.call(this,i),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},function(t,i,n){var e=new(n(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=e},function(t,i,n){t.exports={ADDED_TO_SCENE:n(259),BOOT:n(260),CREATE:n(261),DESTROY:n(262),PAUSE:n(263),POST_UPDATE:n(264),PRE_UPDATE:n(265),READY:n(266),REMOVED_FROM_SCENE:n(267),RENDER:n(268),RESUME:n(269),SHUTDOWN:n(270),SLEEP:n(271),START:n(272),TRANSITION_COMPLETE:n(273),TRANSITION_INIT:n(274),TRANSITION_OUT:n(275),TRANSITION_START:n(276),TRANSITION_WAKE:n(277),UPDATE:n(278),WAKE:n(279)}},function(t,i){t.exports="addedtoscene"},function(t,i){t.exports="boot"},function(t,i){t.exports="create"},function(t,i){t.exports="destroy"},function(t,i){t.exports="pause"},function(t,i){t.exports="postupdate"},function(t,i){t.exports="preupdate"},function(t,i){t.exports="ready"},function(t,i){t.exports="removedfromscene"},function(t,i){t.exports="render"},function(t,i){t.exports="resume"},function(t,i){t.exports="shutdown"},function(t,i){t.exports="sleep"},function(t,i){t.exports="start"},function(t,i){t.exports="transitioncomplete"},function(t,i){t.exports="transitioninit"},function(t,i){t.exports="transitionout"},function(t,i){t.exports="transitionstart"},function(t,i){t.exports="transitionwake"},function(t,i){t.exports="update"},function(t,i){t.exports="wake"}]); \ No newline at end of file +var Camera3DPlugin=function(e){var n={};function s(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=e,s.c=n,s.d=function(t,i,e){s.o(t,i)||Object.defineProperty(t,i,{enumerable:!0,get:e})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(i,t){if(1&t&&(i=s(i)),8&t)return i;if(4&t&&"object"==typeof i&&i&&i.__esModule)return i;var e=Object.create(null);if(s.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:i}),2&t&&"string"!=typeof i)for(var n in i)s.d(e,n,function(t){return i[t]}.bind(null,n));return e},s.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(i,"a",i),i},s.o=function(t,i){return Object.prototype.hasOwnProperty.call(t,i)},s.p="",s(s.s=42)}([function(t,i){function r(t,i,e,n){for(var s in i)if(i.hasOwnProperty(s)){var r=(u=i,c=s,p=l=void 0,p=(f=e)?u[c]:Object.getOwnPropertyDescriptor(u,c),!f&&p.value&&"object"==typeof p.value&&(p=p.value),!(!p||!((l=p).get&&"function"==typeof l.get||l.set&&"function"==typeof l.set))&&(void 0===p.enumerable&&(p.enumerable=!0),void 0===p.configurable&&(p.configurable=!0),p));if(!1!==r){if(o=(n||t).prototype,h=s,a=void 0,(a=Object.getOwnPropertyDescriptor(o,h))&&(a.value&&"object"==typeof a.value&&(a=a.value),!1===a.configurable)){if(d.ignoreFinals)continue;throw new Error("cannot override final property '"+s+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,s,r)}else t.prototype[s]=i[s]}var o,h,a,u,c,f,l,p}function o(t,i){if(i){Array.isArray(i)||(i=[i]);for(var e=0;er[0]&&(i=1),r[8]>r[3*i+i]&&(i=2),e=h[i],n=h[e],s=Math.sqrt(r[3*i+i]-r[3*e+e]-r[3*n+n]+1),a[i]=.5*s,s=.5/s,a[e]=(r[3*e+i]+r[3*i+e])*s,a[n]=(r[3*n+i]+r[3*i+n])*s,this._x=a[0],this._y=a[1],this._z=a[2],this._w=(r[3*n+e]-r[3*e+n])*s),this.onChangeCallback(this),this}});t.exports=p},function(t,i,e){var n=e(3),s=e(6),r=e(31),o=new s,h=new r,a=new n;t.exports=function(t,i,e){return h.setAxisAngle(i,e),o.fromRotationTranslation(h,a.set(0,0,0)),t.transformMat4(o)}},function(t,i,e){var n=e(0),s=e(6),r=e(26),o=e(27),h=e(32),a=e(158),u=e(34),c=e(1),f=e(3),l=e(11),p=new f,d=new l,y=new f,x=new f,v=new s,m=new n({initialize:function(t){this.scene=t,this.displayList=t.sys.displayList,this.updateList=t.sys.updateList,this.name="",this.direction=new f(0,0,-1),this.up=new f(0,1,0),this.position=new f,this.pixelScale=128,this.projection=new s,this.view=new s,this.combined=new s,this.invProjectionView=new s,this.near=1,this.far=100,this.ray={origin:new f,direction:new f},this.viewportWidth=0,this.viewportHeight=0,this.billboardMatrixDirty=!0,this.children=new a},setPosition:function(t,i,e){return this.position.set(t,i,e),this.update()},setScene:function(t){return this.scene=t,this},setPixelScale:function(t){return this.pixelScale=t,this.update()},add:function(t){return this.children.set(t),this.displayList.add(t.gameObject),this.updateList.add(t.gameObject),this.updateChildren(),t},remove:function(t){return this.displayList.remove(t.gameObject),this.updateList.remove(t.gameObject),this.children.delete(t),this},clear:function(){for(var t=this.getChildren(),i=0;iMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,i,e){var n=e(9);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,i,e){var n=e(9);t.exports=function(){return n(-180,180)}},function(t,i,e){var n=e(15);t.exports=function(t){return n(t+Math.PI)}},function(t,i,e){var n=e(2);t.exports=function(t,i,e){return void 0===e&&(e=.05),t===i||(Math.abs(i-t)<=e||Math.abs(i-t)>=n.PI2-e?t=i:(Math.abs(i-t)>Math.PI&&(i>>0,e=(i*=e)>>>0,e+=4294967296*(i-=e);return 2.3283064365386963e-10*((this.n=e)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var i=0;ia.getTotalFrames()&&(s=0),r=a.frames[s],0!==s||this.forward||(r=a.getLastFrame()),this.currentFrame=r):console.warn("Missing animation: "+h),this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,i){var e,n;return this.isPlaying?(e=this.nextAnim,n=this.nextAnimsQueue,e&&n.unshift(e),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=i):(this.delayCounter=i,this.play(t,!0)),this.parent},playAfterRepeat:function(t,i){var e,n;return void 0===i&&(i=1),this.isPlaying?(e=this.nextAnim,n=this.nextAnimsQueue,e&&n.unshift(e),-1!==this.repeatCounter&&i>this.repeatCounter&&(i=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=i):this.play(t),this.parent},play:function(t,i){void 0===i&&(i=!1);var e=this.currentAnim,n=this.parent,s="string"==typeof t?t:t.key;if(i&&this.isPlaying&&e.key===s)return n;if(e&&this.isPlaying){var r=this.animationManager.getMix(e.key,t);if(0this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,i){var e=this.currentAnim;if(this.isPlaying&&e&&!e.paused){if(this.accumulator+=i*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=i,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?e.nextFrame(this):e.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick))for(var n=0;this.forward?e.nextFrame(this):e.previousFrame(this),n++,this.accumulator>this.nextTick&&n<60;);}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var i=this.parent;return this.currentFrame=t,i.texture=t.frame.texture,i.frame=t.frame,i.isCropped&&i.frame.updateCropUVs(i._crop,i.flipX,i.flipY),t.setAlpha&&(i.alpha=t.alpha),i.setSizeToFrame(),i._originComponent&&(t.frame.customPivot?i.setOrigin(t.frame.pivotX,t.frame.pivotY):i.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(r.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),i},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var i=t.key,e=!1;return i&&((e=this.get(i))||(e=new o(this,i,t),this.anims||(this.anims=new s),this.anims.set(i,e))),e},generateFrameNames:function(t,i){return this.animationManager.generateFrameNames(t,i)},generateFrameNumbers:function(t,i){return this.animationManager.generateFrameNumbers(t,i)},remove:function(t){var i=this.get(t);return i&&(this.currentAnim===i&&this.stop(),this.anims.delete(t)),i},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},function(t,i,e){var n=new(e(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var i=0;ii.length&&(r=i.length),e?(n=i[r-1][e],(s=i[r][e])-t<=t-n?i[r]:i[r-1]):(n=i[r-1],(s=i[r])-t<=t-n?s:n)}},function(t,i,e){var n=new(e(0))({initialize:function(t,i,e,n,s){void 0===s&&(s=!1),this.textureKey=t,this.textureFrame=i,this.index=e,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=s},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,i){t.exports=function(t){var e=/\D/g;return t.sort(function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)}),t}},function(t,i,e){t.exports={Alpha:e(200),AlphaSingle:e(201),BlendMode:e(202),ComputedSize:e(203),Crop:e(204),Depth:e(205),Flip:e(206),GetBounds:e(207),Mask:e(217),Origin:e(237),PathFollower:e(238),Pipeline:e(241),ScrollFactor:e(243),Size:e(244),Texture:e(245),TextureCrop:e(246),Tint:e(247),ToJSON:e(36),Transform:e(248),TransformMatrix:e(41),Visible:e(249)}},function(t,i,e){var s=e(4),n={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,i,e,n){return void 0===t&&(t=1),void 0===i?this.alpha=t:(this._alphaTL=s(t,0,1),this._alphaTR=s(i,0,1),this._alphaBL=s(e,0,1),this._alphaBR=s(n,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var i=s(t,0,1);this._alpha=i,this._alphaTL=i,this._alphaTR=i,this._alphaBL=i,0===(this._alphaBR=i)?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var i=s(t,0,1);0!==(this._alphaTL=i)&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var i=s(t,0,1);0!==(this._alphaTR=i)&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var i=s(t,0,1);0!==(this._alphaBL=i)&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var i=s(t,0,1);0!==(this._alphaBR=i)&&(this.renderFlags|=2)}}};t.exports=n},function(t,i,e){var n=e(4),s={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var i=n(t,0,1);0===(this._alpha=i)?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=s},function(t,i,e){var n=e(14),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),-1<=(t|=0)&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,i){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,i){return this.width=t,this.height=i,this},setDisplaySize:function(t,i){return this.displayWidth=t,this.displayHeight=i,this}}},function(t,i){var e={texture:null,frame:null,isCropped:!1,setCrop:function(t,i,e,n){return void 0===t?this.isCropped=!1:this.frame&&("number"==typeof t?this.frame.setCropUVs(this._crop,t,i,e,n,this.flipX,this.flipY):this.frame.setCropUVs(this._crop,t.x,t.y,t.width,t.height,this.flipX,this.flipY),this.isCropped=!0),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=e},function(t,i){var e={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=e},function(t,i){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,i){return this.flipX=t,this.flipY=i,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,i,e){var c=e(208),n=e(28),s=e(1),r={prepareBoundsOutput:function(t,i){return void 0===i&&(i=!1),0!==this.rotation&&n(t,this.x,this.y,this.rotation),i&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,i)},getTopCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,i)},getTopRight:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,i)},getLeftCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,i)},getRightCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,i)},getBottomLeft:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,i)},getBottomCenter:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,i)},getBottomRight:function(t,i){return(t=t||new s).x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,i)},getBounds:function(t){var i,e,n,s,r,o,h,a,u;return void 0===t&&(t=new c),a=(h=(this.parentContainer?(u=this.parentContainer.getBoundsTransformMatrix(),this.getTopLeft(t),u.transformPoint(t.x,t.y,t),i=t.x,e=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),n=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),r=t.x,o=t.y,this.getBottomRight(t),u.transformPoint(t.x,t.y,t)):(this.getTopLeft(t),i=t.x,e=t.y,this.getTopRight(t),n=t.x,s=t.y,this.getBottomLeft(t),r=t.x,o=t.y,this.getBottomRight(t)),t.x),t.y),t.x=Math.min(i,n,r,h),t.y=Math.min(e,s,o,a),t.width=Math.max(i,n,r,h)-t.x,t.height=Math.max(e,s,o,a)-t.y,t}};t.exports=r},function(t,i,e){var n=e(0),s=e(209),r=e(39),o=e(210),h=e(13),a=e(211),u=e(216),c=new n({initialize:function(t,i,e,n){void 0===t&&(t=0),void 0===i&&(i=0),void 0===e&&(e=0),void 0===n&&(n=0),this.type=h.RECTANGLE,this.x=t,this.y=i,this.width=e,this.height=n},contains:function(t,i){return s(this,t,i)},getPoint:function(t,i){return r(this,t,i)},getPoints:function(t,i,e){return o(this,t,i,e)},getRandomPoint:function(t){return u(this,t)},setTo:function(t,i,e,n){return this.x=t,this.y=i,this.width=e,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,i){return void 0===i&&(i=t),this.x=t,this.y=i,this},setSize:function(t,i){return void 0===i&&(i=t),this.width=t,this.height=i,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new a),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new a),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,i){t.exports=function(t,i,e){return!(t.width<=0||t.height<=0)&&(t.x<=i&&t.x+t.width>=i&&t.y<=e&&t.y+t.height>=e)}},function(t,i,e){var o=e(39),h=e(40);t.exports=function(t,i,e,n){void 0===n&&(n=[]),!i&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=u},function(t,i,e){var n=e(5);t.exports=function(t,i,e){return void 0===e&&(e=new n),e.x=t.x1+(t.x2-t.x1)*i,e.y=t.y1+(t.y2-t.y1)*i,e}},function(t,i,e){var l=e(214),p=e(5);t.exports=function(t,i,e,n){void 0===n&&(n=[]),!i&&0 + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), +/* 2 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1116,7 +1143,7 @@ module.exports = Vector2; /***/ }), -/* 2 */ +/* 3 */ /***/ (function(module, exports) { /** @@ -1207,33 +1234,6 @@ var MATH_CONST = { module.exports = MATH_CONST; -/***/ }), -/* 3 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * A NOOP (No Operation) callback function. - * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - * - * @function Phaser.Utils.NOOP - * @since 3.0.0 - */ -var NOOP = function () -{ - // NOOP -}; - -module.exports = NOOP; - - /***/ }), /* 4 */ /***/ (function(module, exports) { @@ -1317,6 +1317,62 @@ module.exports = Clamp; /* 6 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * + * @function Phaser.Utils.Objects.IsPlainObject + * @since 3.0.0 + * + * @param {object} obj - The object to inspect. + * + * @return {boolean} `true` if the object is plain, otherwise `false`. + */ +var IsPlainObject = function (obj) +{ + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) + { + return false; + } + + // Support: Firefox <20 + // The try/catch suppresses exceptions thrown when attempting to access + // the "constructor" property of certain host objects, ie. |window.location| + // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 + try + { + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) + { + return false; + } + } + catch (e) + { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; +}; + +module.exports = IsPlainObject; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -1384,62 +1440,6 @@ var GetValue = function (source, key, defaultValue) module.exports = GetValue; -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a slightly modified version of jQuery.isPlainObject. - * A plain object is an object whose internal class property is [object Object]. - * - * @function Phaser.Utils.Objects.IsPlainObject - * @since 3.0.0 - * - * @param {object} obj - The object to inspect. - * - * @return {boolean} `true` if the object is plain, otherwise `false`. - */ -var IsPlainObject = function (obj) -{ - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) - { - return false; - } - - // Support: Firefox <20 - // The try/catch suppresses exceptions thrown when attempting to access - // the "constructor" property of certain host objects, ie. |window.location| - // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 - try - { - if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) - { - return false; - } - } - catch (e) - { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; -}; - -module.exports = IsPlainObject; - - /***/ }), /* 8 */ /***/ (function(module, exports) { @@ -1610,6 +1610,1052 @@ module.exports = Wrap; /***/ }), /* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + +/***/ }), +/* 12 */ /***/ (function(module, exports) { /** @@ -1761,7 +2807,7 @@ module.exports = FILE_CONST; /***/ }), -/* 12 */ +/* 13 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1771,7 +2817,7 @@ module.exports = FILE_CONST; */ var CheckMatrix = __webpack_require__(23); -var TransposeMatrix = __webpack_require__(56); +var TransposeMatrix = __webpack_require__(55); /** * Rotates the array matrix based on the given rotation value. @@ -1781,6 +2827,20 @@ var TransposeMatrix = __webpack_require__(56); * * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateMatrix * @since 3.0.0 * @@ -1833,7 +2893,7 @@ module.exports = RotateMatrix; /***/ }), -/* 13 */ +/* 14 */ /***/ (function(module, exports) { /** @@ -1879,7 +2939,7 @@ module.exports = SpliceOne; /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports) { /** @@ -2218,7 +3278,7 @@ module.exports = { /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2227,7 +3287,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); +var CONST = __webpack_require__(3); /** * Takes an angle in Phasers default clockwise format and converts it so that @@ -2263,7 +3323,7 @@ module.exports = CounterClockwise; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports) { /** @@ -2292,7 +3352,7 @@ module.exports = FloatBetween; /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2301,7 +3361,7 @@ module.exports = FloatBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); +var CONST = __webpack_require__(3); /** * Convert the given angle from degrees, to the equivalent angle in radians. @@ -2322,7 +3382,7 @@ module.exports = DegToRad; /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2331,7 +3391,1800 @@ module.exports = DegToRad; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); +var Class = __webpack_require__(0); +var Vector3 = __webpack_require__(11); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(3); /** * Convert the given angle in radians, to the equivalent angle in degrees. @@ -2352,817 +5205,7 @@ module.exports = RadToDeg; /***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 3D space. - * - * A three-component vector. - * - * @class Vector3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Vector3 = new Class({ - - initialize: - - function Vector3 (x, y, z) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - }, - - /** - * Set this Vector to point up. - * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. - */ - clone: function () - { - return new Vector3(this.x, this.y, this.z); - }, - - /** - * Calculate the cross (vector) product of two given Vectors. - * - * @method Phaser.Math.Vector3#crossVectors - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - crossVectors: function (a, b) - { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. - * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - - return this; - }, - - /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. - * - * @method Phaser.Math.Vector3#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - set: function (x, y, z) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - } - else - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - - return this; - }, - - /** - * Negate the `x`, `y` and `z` components of this Vector. - * - * @method Phaser.Math.Vector3#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. - * - * @return {number} The dot product of this Vector and `v`. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z; - }, - - /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. - * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - cross: function (v) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; - } - -}); - -/** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ZERO = new Vector3(); - -/** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.RIGHT = new Vector3(1, 0, 0); - -/** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.LEFT = new Vector3(-1, 0, 0); - -/** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.UP = new Vector3(0, -1, 0); - -/** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.DOWN = new Vector3(0, 1, 0); - -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; - - -/***/ }), -/* 20 */ +/* 21 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3172,13 +5215,13 @@ module.exports = Vector3; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(11); +var CONST = __webpack_require__(12); var Events = __webpack_require__(202); var GetFastValue = __webpack_require__(8); var GetURL = __webpack_require__(213); -var MergeXHRSettings = __webpack_require__(44); +var MergeXHRSettings = __webpack_require__(43); var XHRLoader = __webpack_require__(214); -var XHRSettings = __webpack_require__(45); +var XHRSettings = __webpack_require__(44); /** * @classdesc @@ -3244,7 +5287,18 @@ var File = new Class({ if (!this.type || !this.key) { - throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + throw new Error('Invalid Loader.' + this.type + ' key'); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; } /** @@ -3258,16 +5312,7 @@ var File = new Class({ * @type {object|string} * @since 3.0.0 */ - this.url = GetFastValue(fileConfig, 'url'); - - if (this.url === undefined) - { - this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof this.url === 'string' && this.url.indexOf('blob:') !== 0 && this.url.indexOf('data:') !== 0) - { - this.url = loader.path + this.url; - } + this.url = url; /** * The final URL this file will load from, including baseURL and path. @@ -3710,7 +5755,7 @@ module.exports = File; /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports) { /** @@ -3778,39 +5823,6 @@ var FileTypesManager = { module.exports = FileTypesManager; -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(225), - DESTROY: __webpack_require__(226), - REMOVED_FROM_SCENE: __webpack_require__(227), - VIDEO_COMPLETE: __webpack_require__(228), - VIDEO_CREATED: __webpack_require__(229), - VIDEO_ERROR: __webpack_require__(230), - VIDEO_LOOP: __webpack_require__(231), - VIDEO_PLAY: __webpack_require__(232), - VIDEO_SEEKED: __webpack_require__(233), - VIDEO_SEEKING: __webpack_require__(234), - VIDEO_STOP: __webpack_require__(235), - VIDEO_TIMEOUT: __webpack_require__(236), - VIDEO_UNLOCKED: __webpack_require__(237) - -}; - - /***/ }), /* 23 */ /***/ (function(module, exports) { @@ -3824,22 +5836,23 @@ module.exports = { /** * Checks if an array can be used as a matrix. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: * * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] * ``` * * @function Phaser.Utils.Array.Matrix.CheckMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [matrix] * @@ -3883,12 +5896,12 @@ module.exports = CheckMatrix; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(312); -var GetPoint = __webpack_require__(60); -var GetPoints = __webpack_require__(313); +var Contains = __webpack_require__(294); +var GetPoint = __webpack_require__(59); +var GetPoints = __webpack_require__(295); var GEOM_CONST = __webpack_require__(25); -var Line = __webpack_require__(314); -var Random = __webpack_require__(319); +var Line = __webpack_require__(296); +var Random = __webpack_require__(301); /** * @classdesc @@ -4473,7 +6486,7 @@ module.exports = GEOM_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var IsPlainObject = __webpack_require__(7); +var IsPlainObject = __webpack_require__(6); // @param {boolean} deep - Perform a deep copy? // @param {object} target - The target object to copy to. @@ -5037,7 +7050,7 @@ module.exports = RoundAwayFromZero; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(1); +var Vector2 = __webpack_require__(2); /** * Takes the `x` and `y` coordinates and transforms them into the same space as @@ -5689,1470 +7702,9 @@ module.exports = Matrix3; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); - -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - // TODO - Should work with basic values - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - var out = this.val; - - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; - - return this; - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = []; - var m1 = this.val; - var m2 = src.val; - - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; - - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; - - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; - - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; - - return this.fromArray(a); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translate: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scale: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - this.fromArray([ - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromQuat: function (q) - { - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var out = this.val; - - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; - - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var out = this.val; - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - var out = this.val; - - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var out = this.val; - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var out = this.val; - - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix !== undefined) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix !== undefined) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - } - -}); - -var _tempMat1 = new Matrix4(); -var _tempMat2 = new Matrix4(); - -module.exports = Matrix4; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(19); var Matrix3 = __webpack_require__(41); +var NOOP = __webpack_require__(1); +var Vector3 = __webpack_require__(11); var EPSILON = 0.000001; @@ -7175,10 +7727,10 @@ var tmpMat3 = new Matrix3(); * @constructor * @since 3.0.0 * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. */ var Quaternion = new Class({ @@ -7189,52 +7741,141 @@ var Quaternion = new Class({ /** * The x component of this Quaternion. * - * @name Phaser.Math.Quaternion#x + * @name Phaser.Math.Quaternion#_x * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The y component of this Quaternion. * - * @name Phaser.Math.Quaternion#y + * @name Phaser.Math.Quaternion#_y * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The z component of this Quaternion. * - * @name Phaser.Math.Quaternion#z + * @name Phaser.Math.Quaternion#_z * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The w component of this Quaternion. * - * @name Phaser.Math.Quaternion#w + * @name Phaser.Math.Quaternion#_w * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ - if (typeof x === 'object') + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); } - else + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); } }, @@ -7250,16 +7891,11 @@ var Quaternion = new Class({ */ copy: function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; + return this.set(src); }, /** - * Set the components of this Quaternion. + * Set the components of this Quaternion and optionally call the `onChangeCallback`. * * @method Phaser.Math.Quaternion#set * @since 3.0.0 @@ -7268,24 +7904,32 @@ var Quaternion = new Class({ * @param {number} [y=0] - The y component. * @param {number} [z=0] - The z component. * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? * * @return {Phaser.Math.Quaternion} This Quaternion. */ - set: function (x, y, z, w) + set: function (x, y, z, w, update) { + if (update === undefined) { update = true; } + if (typeof x === 'object') { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); } return this; @@ -7303,10 +7947,12 @@ var Quaternion = new Class({ */ add: function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); return this; }, @@ -7323,10 +7969,12 @@ var Quaternion = new Class({ */ subtract: function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); return this; }, @@ -7343,10 +7991,12 @@ var Quaternion = new Class({ */ scale: function (scale) { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); return this; }, @@ -7407,12 +8057,14 @@ var Quaternion = new Class({ { len = 1 / Math.sqrt(len); - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; } + this.onChangeCallback(this); + return this; }, @@ -7451,12 +8103,12 @@ var Quaternion = new Class({ var az = this.z; var aw = this.w; - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); }, /** @@ -7488,21 +8140,16 @@ var Quaternion = new Class({ } else if (dot > 0.999999) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); } else { tmpvec.copy(a).cross(b); - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; return this.normalize(); } @@ -7549,12 +8196,7 @@ var Quaternion = new Class({ */ identity: function () { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); }, /** @@ -7574,12 +8216,12 @@ var Quaternion = new Class({ var s = Math.sin(rad); - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); }, /** @@ -7604,12 +8246,12 @@ var Quaternion = new Class({ var bz = b.z; var bw = b.w; - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); }, /** @@ -7667,12 +8309,12 @@ var Quaternion = new Class({ } // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); }, /** @@ -7693,14 +8335,12 @@ var Quaternion = new Class({ var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = (dot) ? 1 / dot : 0; - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); }, /** @@ -7715,9 +8355,11 @@ var Quaternion = new Class({ */ conjugate: function () { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); return this; }, @@ -7744,12 +8386,12 @@ var Quaternion = new Class({ var bx = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); }, /** @@ -7774,12 +8416,12 @@ var Quaternion = new Class({ var by = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); }, /** @@ -7804,12 +8446,12 @@ var Quaternion = new Class({ var bz = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); }, /** @@ -7833,6 +8475,190 @@ var Quaternion = new Class({ return this; }, + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + /** * Convert the given Matrix into this Quaternion. * @@ -7864,9 +8690,9 @@ var Quaternion = new Class({ fRoot = 0.5 / fRoot; // 1/(4w) - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; } else { @@ -7895,12 +8721,14 @@ var Quaternion = new Class({ tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; } + this.onChangeCallback(this); + return this; } @@ -7910,7 +8738,7 @@ module.exports = Quaternion; /***/ }), -/* 44 */ +/* 43 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -7920,7 +8748,7 @@ module.exports = Quaternion; */ var Extend = __webpack_require__(26); -var XHRSettings = __webpack_require__(45); +var XHRSettings = __webpack_require__(44); /** * Takes two XHRSettings Objects and creates a new XHRSettings object from them. @@ -7958,7 +8786,7 @@ module.exports = MergeXHRSettings; /***/ }), -/* 45 */ +/* 44 */ /***/ (function(module, exports) { /** @@ -8028,7 +8856,7 @@ module.exports = XHRSettings; /***/ }), -/* 46 */ +/* 45 */ /***/ (function(module, exports) { /** @@ -8177,7 +9005,7 @@ module.exports = ComputedSize; /***/ }), -/* 47 */ +/* 46 */ /***/ (function(module, exports) { /** @@ -8270,7 +9098,7 @@ module.exports = Depth; /***/ }), -/* 48 */ +/* 47 */ /***/ (function(module, exports) { /** @@ -8434,7 +9262,7 @@ module.exports = Flip; /***/ }), -/* 49 */ +/* 48 */ /***/ (function(module, exports) { /** @@ -8541,7 +9369,7 @@ module.exports = ScrollFactor; /***/ }), -/* 50 */ +/* 49 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -8550,12 +9378,12 @@ module.exports = ScrollFactor; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(2); -var TransformMatrix = __webpack_require__(51); +var MATH_CONST = __webpack_require__(3); +var TransformMatrix = __webpack_require__(50); var TransformXY = __webpack_require__(40); var WrapAngle = __webpack_require__(29); var WrapAngleDegrees = __webpack_require__(30); -var Vector2 = __webpack_require__(1); +var Vector2 = __webpack_require__(2); // global bitmask flag for GameObject.renderMask (used by Scale) var _FLAG = 4; // 0100 @@ -8825,6 +9653,26 @@ var Transform = { return this; }, + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -9132,7 +9980,7 @@ module.exports = Transform; /***/ }), -/* 51 */ +/* 50 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -9142,8 +9990,8 @@ module.exports = Transform; */ var Class = __webpack_require__(0); -var MATH_CONST = __webpack_require__(2); -var Vector2 = __webpack_require__(1); +var MATH_CONST = __webpack_require__(3); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -10152,7 +11000,7 @@ module.exports = TransformMatrix; /***/ }), -/* 52 */ +/* 51 */ /***/ (function(module, exports) { /** @@ -10241,7 +11089,7 @@ module.exports = Visible; /***/ }), -/* 53 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10251,10 +11099,10 @@ module.exports = Visible; */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(54); +var ComponentsToJSON = __webpack_require__(53); var DataManager = __webpack_require__(219); -var EventEmitter = __webpack_require__(55); -var Events = __webpack_require__(22); +var EventEmitter = __webpack_require__(226); +var Events = __webpack_require__(54); /** * @classdesc @@ -10282,12 +11130,15 @@ var GameObject = new Class({ EventEmitter.call(this); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * * @name Phaser.GameObjects.GameObject#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; @@ -10979,7 +11830,7 @@ module.exports = GameObject; /***/ }), -/* 54 */ +/* 53 */ /***/ (function(module, exports) { /** @@ -11040,350 +11891,40 @@ module.exports = ToJSON; /***/ }), -/* 55 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ /** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private + * @namespace Phaser.GameObjects.Events */ -function Events() {} -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); +module.exports = { - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} + ADDED_TO_SCENE: __webpack_require__(227), + DESTROY: __webpack_require__(228), + REMOVED_FROM_SCENE: __webpack_require__(229), + VIDEO_COMPLETE: __webpack_require__(230), + VIDEO_CREATED: __webpack_require__(231), + VIDEO_ERROR: __webpack_require__(232), + VIDEO_LOOP: __webpack_require__(233), + VIDEO_PLAY: __webpack_require__(234), + VIDEO_SEEKED: __webpack_require__(235), + VIDEO_SEEKING: __webpack_require__(236), + VIDEO_STOP: __webpack_require__(237), + VIDEO_TIMEOUT: __webpack_require__(238), + VIDEO_UNLOCKED: __webpack_require__(239) -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; }; -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} - /***/ }), -/* 56 */ +/* 55 */ /***/ (function(module, exports) { /** @@ -11397,12 +11938,26 @@ if (true) { * * The transpose of a matrix is a new matrix whose rows are the columns of the original. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.TransposeMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [array,$return] - * + * * @param {T[][]} [array] - The array matrix to transpose. * * @return {T[][]} A new array matrix which is a transposed version of the given array. @@ -11430,6 +11985,46 @@ var TransposeMatrix = function (array) module.exports = TransposeMatrix; +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + /***/ }), /* 57 */ /***/ (function(module, exports) { @@ -11441,77 +12036,33 @@ module.exports = TransposeMatrix; */ /** - * Searches a pre-sorted array for the closet value to the given number. + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. * - * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, - * and will check for the closest value of those to the given number. - * - * @function Phaser.Utils.Array.FindClosestInSorted + * @function Phaser.Utils.Array.RotateRight * @since 3.0.0 * - * @param {number} value - The value to search for in the array. - * @param {array} array - The array to search, which must be sorted. - * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. * - * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + * @return {*} The most recently shifted element. */ -var FindClosestInSorted = function (value, array, key) +var RotateRight = function (array, total) { - if (!array.length) + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) { - return NaN; - } - else if (array.length === 1) - { - return array[0]; + element = array.pop(); + array.unshift(element); } - var i = 1; - var low; - var high; - - if (key) - { - if (value < array[0][key]) - { - return array[0]; - } - - while (array[i][key] < value) - { - i++; - } - } - else - { - while (array[i] < value) - { - i++; - } - } - - if (i > array.length) - { - i = array.length; - } - - if (key) - { - low = array[i - 1][key]; - high = array[i][key]; - - return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; - } - else - { - low = array[i - 1]; - high = array[i]; - - return ((high - value) <= (value - low)) ? high : low; - } + return element; }; -module.exports = FindClosestInSorted; +module.exports = RotateRight; /***/ }), @@ -11565,45 +12116,7 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Animations.Events - */ - -module.exports = { - - ADD_ANIMATION: __webpack_require__(290), - ANIMATION_COMPLETE: __webpack_require__(291), - ANIMATION_REPEAT: __webpack_require__(292), - ANIMATION_RESTART: __webpack_require__(293), - ANIMATION_START: __webpack_require__(294), - PAUSE_ALL: __webpack_require__(295), - REMOVE_ANIMATION: __webpack_require__(296), - RESUME_ALL: __webpack_require__(297), - SPRITE_ANIMATION_COMPLETE: __webpack_require__(298), - SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(299), - SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(300), - SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(301), - SPRITE_ANIMATION_KEY_START: __webpack_require__(302), - SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(303), - SPRITE_ANIMATION_REPEAT: __webpack_require__(304), - SPRITE_ANIMATION_RESTART: __webpack_require__(305), - SPRITE_ANIMATION_START: __webpack_require__(306), - SPRITE_ANIMATION_UPDATE: __webpack_require__(307) - -}; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Perimeter = __webpack_require__(61); +var Perimeter = __webpack_require__(60); var Point = __webpack_require__(9); /** @@ -11675,7 +12188,7 @@ module.exports = GetPoint; /***/ }), -/* 61 */ +/* 60 */ /***/ (function(module, exports) { /** @@ -11703,7 +12216,7 @@ module.exports = Perimeter; /***/ }), -/* 62 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11712,16 +12225,19 @@ module.exports = Perimeter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(63); +var BuildGameObject = __webpack_require__(62); var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(7); var ResizeEvent = __webpack_require__(174); var ScenePlugin = __webpack_require__(175); var Spine = __webpack_require__(199); var SpineFile = __webpack_require__(200); var SpineGameObject = __webpack_require__(218); -var SpineContainer = __webpack_require__(247); -var NOOP = __webpack_require__(3); +var SpineContainer = __webpack_require__(249); +var NOOP = __webpack_require__(1); + +// Plugin specific instance of the Spine Scene Renderer +var sceneRenderer; /** * @classdesc @@ -11784,10 +12300,15 @@ var NOOP = __webpack_require__(3); * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true); * ``` * - * It also installs a Game Object Factory method, allowing you to create Spine Game Objects: + * It also installs two Game Object Factory methods, allowing you to create Spine Game Objects + * and Spine Containers: * * ```javascript - * this.add.spine(512, 650, 'stretchyman') + * const man = this.add.spine(512, 650, 'stretchyman'); + * + * const container = this.add.spineContainer(); + * + * container.add(man); * ``` * * The first argument is the key which you used when importing the Spine data. There are lots of @@ -11919,6 +12440,8 @@ var SpinePlugin = new Class({ /** * An instance of the Spine WebGL Scene Renderer. * + * There is only one instance of the Scene Renderer shared across the whole plugin. + * * Only set if running in WebGL mode. * * @name SpinePlugin#sceneRenderer @@ -11949,7 +12472,7 @@ var SpinePlugin = new Class({ /** * A reference to the Spine runtime. - * This is the runtime created by Esoteric Software + * This is the runtime created by Esoteric Software. * * @name SpinePlugin#plugin * @type {spine} @@ -12087,7 +12610,7 @@ var SpinePlugin = new Class({ pluginManager.registerFileType('spine', this.spineFileCallback, scene); pluginManager.registerGameObject('spine', add, make); - pluginManager.registerGameObject('spinecontainer', addContainer, makeContainer); + pluginManager.registerGameObject('spineContainer', addContainer, makeContainer); }, /** @@ -12114,6 +12637,8 @@ var SpinePlugin = new Class({ eventEmitter.once('shutdown', this.shutdown, this); eventEmitter.once('destroy', this.destroy, this); + + this.game.events.once('destroy', this.gameDestroy, this); }, /** @@ -12137,8 +12662,6 @@ var SpinePlugin = new Class({ */ bootWebGL: function () { - this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); - // Monkeypatch the Spine setBlendMode functions, or batching is destroyed! var setBlendMode = function (srcBlend, dstBlend) @@ -12158,11 +12681,17 @@ var SpinePlugin = new Class({ } }; - this.sceneRenderer.batcher.setBlendMode = setBlendMode; - this.sceneRenderer.shapes.setBlendMode = setBlendMode; + if (!sceneRenderer) + { + sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + sceneRenderer.batcher.setBlendMode = setBlendMode; + sceneRenderer.shapes.setBlendMode = setBlendMode; + } - this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; - this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer; + // All share the same instance + this.sceneRenderer = sceneRenderer; + this.skeletonRenderer = sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer; this.temp1 = new Spine.webgl.Vector3(0, 0, 0); this.temp2 = new Spine.webgl.Vector3(0, 0, 0); @@ -12760,8 +13289,7 @@ var SpinePlugin = new Class({ sceneRenderer.camera.position.x = viewportWidth / 2; sceneRenderer.camera.position.y = viewportHeight / 2; - sceneRenderer.camera.viewportWidth = viewportWidth; - sceneRenderer.camera.viewportHeight = viewportHeight; + sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); }, /** @@ -12798,14 +13326,6 @@ var SpinePlugin = new Class({ { this.shutdown(); - if (this.sceneRenderer) - { - this.sceneRenderer.dispose(); - } - - this.pluginManager.removeGameObject('spine', true, true); - - this.pluginManager = null; this.game = null; this.scene = null; this.systems = null; @@ -12814,14 +13334,39 @@ var SpinePlugin = new Class({ this.spineTextures = null; this.json = null; this.textures = null; - this.sceneRenderer = null; this.skeletonRenderer = null; this.gl = null; + }, + + /** + * The Game that owns this plugin is being destroyed. + * + * Dispose of the Scene Renderer and remove the Game Objects. + * + * @method SpinePlugin#gameDestroy + * @private + * @since 3.50.0 + */ + gameDestroy: function () + { + this.destroy(); + + if (sceneRenderer) + { + sceneRenderer.dispose(); + } + + this.sceneRenderer = null; + this.pluginManager = null; + + this.pluginManager.removeGameObject('spine', true, true); + this.pluginManager.removeGameObject('spineContainer', true, true); } }); SpinePlugin.SpineGameObject = SpineGameObject; +SpinePlugin.SpineContainer = SpineContainer; /** * Creates a new Spine Game Object and adds it to the Scene. @@ -12893,7 +13438,7 @@ module.exports = SpinePlugin; /***/ }), -/* 63 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12902,8 +13447,8 @@ module.exports = SpinePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(14); -var GetAdvancedValue = __webpack_require__(64); +var BlendModes = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(63); /** * Builds a Game Object using the provided configuration object. @@ -13021,7 +13566,7 @@ module.exports = BuildGameObject; /***/ }), -/* 64 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13030,8 +13575,8 @@ module.exports = BuildGameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(65); -var GetValue = __webpack_require__(6); +var MATH = __webpack_require__(64); +var GetValue = __webpack_require__(7); /** * Retrieves a value from an object. Allows for more advanced selection options, including: @@ -13108,7 +13653,7 @@ module.exports = GetAdvancedValue; /***/ }), -/* 65 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13117,7 +13662,7 @@ module.exports = GetAdvancedValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); +var CONST = __webpack_require__(3); var Extend = __webpack_require__(26); /** @@ -13127,28 +13672,29 @@ var Extend = __webpack_require__(26); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(66), - Distance: __webpack_require__(75), - Easing: __webpack_require__(83), - Fuzzy: __webpack_require__(128), - Interpolation: __webpack_require__(133), - Pow2: __webpack_require__(141), - Snap: __webpack_require__(145), + Angle: __webpack_require__(65), + Distance: __webpack_require__(74), + Easing: __webpack_require__(82), + Fuzzy: __webpack_require__(127), + Interpolation: __webpack_require__(132), + Pow2: __webpack_require__(140), + Snap: __webpack_require__(144), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(149), + RandomDataGenerator: __webpack_require__(148), // Single functions - Average: __webpack_require__(150), + Average: __webpack_require__(149), Bernstein: __webpack_require__(32), - Between: __webpack_require__(151), + Between: __webpack_require__(150), CatmullRom: __webpack_require__(34), - CeilTo: __webpack_require__(152), + CeilTo: __webpack_require__(151), Clamp: __webpack_require__(5), - DegToRad: __webpack_require__(17), - Difference: __webpack_require__(153), + DegToRad: __webpack_require__(18), + Difference: __webpack_require__(152), + Euler: __webpack_require__(153), Factorial: __webpack_require__(33), - FloatBetween: __webpack_require__(16), + FloatBetween: __webpack_require__(17), FloorTo: __webpack_require__(154), FromPercent: __webpack_require__(155), GetSpeed: __webpack_require__(156), @@ -13158,7 +13704,7 @@ var PhaserMath = { MaxAdd: __webpack_require__(159), MinSub: __webpack_require__(160), Percent: __webpack_require__(161), - RadToDeg: __webpack_require__(18), + RadToDeg: __webpack_require__(20), RandomXY: __webpack_require__(162), RandomXYZ: __webpack_require__(163), RandomXYZW: __webpack_require__(164), @@ -13177,12 +13723,12 @@ var PhaserMath = { Wrap: __webpack_require__(10), // Vector classes - Vector2: __webpack_require__(1), - Vector3: __webpack_require__(19), + Vector2: __webpack_require__(2), + Vector3: __webpack_require__(11), Vector4: __webpack_require__(172), Matrix3: __webpack_require__(41), - Matrix4: __webpack_require__(42), - Quaternion: __webpack_require__(43), + Matrix4: __webpack_require__(19), + Quaternion: __webpack_require__(42), RotateVec3: __webpack_require__(173) }; @@ -13197,7 +13743,7 @@ module.exports = PhaserMath; /***/ }), -/* 66 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13213,16 +13759,16 @@ module.exports = PhaserMath; module.exports = { Between: __webpack_require__(27), - BetweenPoints: __webpack_require__(67), - BetweenPointsY: __webpack_require__(68), - BetweenY: __webpack_require__(69), - CounterClockwise: __webpack_require__(15), + BetweenPoints: __webpack_require__(66), + BetweenPointsY: __webpack_require__(67), + BetweenY: __webpack_require__(68), + CounterClockwise: __webpack_require__(16), Normalize: __webpack_require__(28), - Random: __webpack_require__(70), - RandomDegrees: __webpack_require__(71), - Reverse: __webpack_require__(72), - RotateTo: __webpack_require__(73), - ShortestBetween: __webpack_require__(74), + Random: __webpack_require__(69), + RandomDegrees: __webpack_require__(70), + Reverse: __webpack_require__(71), + RotateTo: __webpack_require__(72), + ShortestBetween: __webpack_require__(73), Wrap: __webpack_require__(29), WrapDegrees: __webpack_require__(30) @@ -13230,7 +13776,7 @@ module.exports = { /***/ }), -/* 67 */ +/* 66 */ /***/ (function(module, exports) { /** @@ -13261,7 +13807,7 @@ module.exports = BetweenPoints; /***/ }), -/* 68 */ +/* 67 */ /***/ (function(module, exports) { /** @@ -13293,7 +13839,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 69 */ +/* 68 */ /***/ (function(module, exports) { /** @@ -13327,7 +13873,7 @@ module.exports = BetweenY; /***/ }), -/* 70 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13337,7 +13883,7 @@ module.exports = BetweenY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(16); +var FloatBetween = __webpack_require__(17); /** * Returns a random angle in the range [-pi, pi]. @@ -13356,7 +13902,7 @@ module.exports = Random; /***/ }), -/* 71 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13366,7 +13912,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(16); +var FloatBetween = __webpack_require__(17); /** * Returns a random angle in the range [-180, 180]. @@ -13385,7 +13931,7 @@ module.exports = RandomDegrees; /***/ }), -/* 72 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13415,7 +13961,7 @@ module.exports = Reverse; /***/ }), -/* 73 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13424,7 +13970,7 @@ module.exports = Reverse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(2); +var MATH_CONST = __webpack_require__(3); /** * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. @@ -13482,7 +14028,7 @@ module.exports = RotateTo; /***/ }), -/* 74 */ +/* 73 */ /***/ (function(module, exports) { /** @@ -13531,7 +14077,7 @@ module.exports = ShortestBetween; /***/ }), -/* 75 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13546,19 +14092,19 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(76), - BetweenPoints: __webpack_require__(77), - BetweenPointsSquared: __webpack_require__(78), - Chebyshev: __webpack_require__(79), - Power: __webpack_require__(80), - Snake: __webpack_require__(81), - Squared: __webpack_require__(82) + Between: __webpack_require__(75), + BetweenPoints: __webpack_require__(76), + BetweenPointsSquared: __webpack_require__(77), + Chebyshev: __webpack_require__(78), + Power: __webpack_require__(79), + Snake: __webpack_require__(80), + Squared: __webpack_require__(81) }; /***/ }), -/* 76 */ +/* 75 */ /***/ (function(module, exports) { /** @@ -13592,7 +14138,7 @@ module.exports = DistanceBetween; /***/ }), -/* 77 */ +/* 76 */ /***/ (function(module, exports) { /** @@ -13624,7 +14170,7 @@ module.exports = DistanceBetweenPoints; /***/ }), -/* 78 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -13656,7 +14202,7 @@ module.exports = DistanceBetweenPointsSquared; /***/ }), -/* 79 */ +/* 78 */ /***/ (function(module, exports) { /** @@ -13690,7 +14236,7 @@ module.exports = ChebyshevDistance; /***/ }), -/* 80 */ +/* 79 */ /***/ (function(module, exports) { /** @@ -13724,7 +14270,7 @@ module.exports = DistancePower; /***/ }), -/* 81 */ +/* 80 */ /***/ (function(module, exports) { /** @@ -13758,7 +14304,7 @@ module.exports = SnakeDistance; /***/ }), -/* 82 */ +/* 81 */ /***/ (function(module, exports) { /** @@ -13792,7 +14338,7 @@ module.exports = DistanceSquared; /***/ }), -/* 83 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13807,24 +14353,24 @@ module.exports = DistanceSquared; module.exports = { - Back: __webpack_require__(84), - Bounce: __webpack_require__(88), - Circular: __webpack_require__(92), - Cubic: __webpack_require__(96), - Elastic: __webpack_require__(100), - Expo: __webpack_require__(104), - Linear: __webpack_require__(108), - Quadratic: __webpack_require__(110), - Quartic: __webpack_require__(114), - Quintic: __webpack_require__(118), - Sine: __webpack_require__(122), - Stepped: __webpack_require__(126) + Back: __webpack_require__(83), + Bounce: __webpack_require__(87), + Circular: __webpack_require__(91), + Cubic: __webpack_require__(95), + Elastic: __webpack_require__(99), + Expo: __webpack_require__(103), + Linear: __webpack_require__(107), + Quadratic: __webpack_require__(109), + Quartic: __webpack_require__(113), + Quintic: __webpack_require__(117), + Sine: __webpack_require__(121), + Stepped: __webpack_require__(125) }; /***/ }), -/* 84 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13839,15 +14385,15 @@ module.exports = { module.exports = { - In: __webpack_require__(85), - Out: __webpack_require__(86), - InOut: __webpack_require__(87) + In: __webpack_require__(84), + Out: __webpack_require__(85), + InOut: __webpack_require__(86) }; /***/ }), -/* 85 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -13878,7 +14424,7 @@ module.exports = In; /***/ }), -/* 86 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -13909,7 +14455,7 @@ module.exports = Out; /***/ }), -/* 87 */ +/* 86 */ /***/ (function(module, exports) { /** @@ -13949,7 +14495,7 @@ module.exports = InOut; /***/ }), -/* 88 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13964,15 +14510,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(89), - Out: __webpack_require__(90), - InOut: __webpack_require__(91) + In: __webpack_require__(88), + Out: __webpack_require__(89), + InOut: __webpack_require__(90) }; /***/ }), -/* 89 */ +/* 88 */ /***/ (function(module, exports) { /** @@ -14017,7 +14563,7 @@ module.exports = In; /***/ }), -/* 90 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -14060,7 +14606,7 @@ module.exports = Out; /***/ }), -/* 91 */ +/* 90 */ /***/ (function(module, exports) { /** @@ -14124,7 +14670,7 @@ module.exports = InOut; /***/ }), -/* 92 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14139,15 +14685,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(93), - Out: __webpack_require__(94), - InOut: __webpack_require__(95) + In: __webpack_require__(92), + Out: __webpack_require__(93), + InOut: __webpack_require__(94) }; /***/ }), -/* 93 */ +/* 92 */ /***/ (function(module, exports) { /** @@ -14175,7 +14721,7 @@ module.exports = In; /***/ }), -/* 94 */ +/* 93 */ /***/ (function(module, exports) { /** @@ -14203,7 +14749,7 @@ module.exports = Out; /***/ }), -/* 95 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -14238,7 +14784,7 @@ module.exports = InOut; /***/ }), -/* 96 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14253,15 +14799,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(97), - Out: __webpack_require__(98), - InOut: __webpack_require__(99) + In: __webpack_require__(96), + Out: __webpack_require__(97), + InOut: __webpack_require__(98) }; /***/ }), -/* 97 */ +/* 96 */ /***/ (function(module, exports) { /** @@ -14289,7 +14835,7 @@ module.exports = In; /***/ }), -/* 98 */ +/* 97 */ /***/ (function(module, exports) { /** @@ -14317,7 +14863,7 @@ module.exports = Out; /***/ }), -/* 99 */ +/* 98 */ /***/ (function(module, exports) { /** @@ -14352,7 +14898,7 @@ module.exports = InOut; /***/ }), -/* 100 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14367,15 +14913,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(101), - Out: __webpack_require__(102), - InOut: __webpack_require__(103) + In: __webpack_require__(100), + Out: __webpack_require__(101), + InOut: __webpack_require__(102) }; /***/ }), -/* 101 */ +/* 100 */ /***/ (function(module, exports) { /** @@ -14430,7 +14976,7 @@ module.exports = In; /***/ }), -/* 102 */ +/* 101 */ /***/ (function(module, exports) { /** @@ -14485,7 +15031,7 @@ module.exports = Out; /***/ }), -/* 103 */ +/* 102 */ /***/ (function(module, exports) { /** @@ -14547,7 +15093,7 @@ module.exports = InOut; /***/ }), -/* 104 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14562,15 +15108,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(105), - Out: __webpack_require__(106), - InOut: __webpack_require__(107) + In: __webpack_require__(104), + Out: __webpack_require__(105), + InOut: __webpack_require__(106) }; /***/ }), -/* 105 */ +/* 104 */ /***/ (function(module, exports) { /** @@ -14598,7 +15144,7 @@ module.exports = In; /***/ }), -/* 106 */ +/* 105 */ /***/ (function(module, exports) { /** @@ -14626,7 +15172,7 @@ module.exports = Out; /***/ }), -/* 107 */ +/* 106 */ /***/ (function(module, exports) { /** @@ -14661,7 +15207,7 @@ module.exports = InOut; /***/ }), -/* 108 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14670,11 +15216,11 @@ module.exports = InOut; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -module.exports = __webpack_require__(109); +module.exports = __webpack_require__(108); /***/ }), -/* 109 */ +/* 108 */ /***/ (function(module, exports) { /** @@ -14702,7 +15248,7 @@ module.exports = Linear; /***/ }), -/* 110 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14717,15 +15263,15 @@ module.exports = Linear; module.exports = { - In: __webpack_require__(111), - Out: __webpack_require__(112), - InOut: __webpack_require__(113) + In: __webpack_require__(110), + Out: __webpack_require__(111), + InOut: __webpack_require__(112) }; /***/ }), -/* 111 */ +/* 110 */ /***/ (function(module, exports) { /** @@ -14753,7 +15299,7 @@ module.exports = In; /***/ }), -/* 112 */ +/* 111 */ /***/ (function(module, exports) { /** @@ -14781,7 +15327,7 @@ module.exports = Out; /***/ }), -/* 113 */ +/* 112 */ /***/ (function(module, exports) { /** @@ -14816,7 +15362,7 @@ module.exports = InOut; /***/ }), -/* 114 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14831,15 +15377,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(115), - Out: __webpack_require__(116), - InOut: __webpack_require__(117) + In: __webpack_require__(114), + Out: __webpack_require__(115), + InOut: __webpack_require__(116) }; /***/ }), -/* 115 */ +/* 114 */ /***/ (function(module, exports) { /** @@ -14867,7 +15413,7 @@ module.exports = In; /***/ }), -/* 116 */ +/* 115 */ /***/ (function(module, exports) { /** @@ -14895,7 +15441,7 @@ module.exports = Out; /***/ }), -/* 117 */ +/* 116 */ /***/ (function(module, exports) { /** @@ -14930,7 +15476,7 @@ module.exports = InOut; /***/ }), -/* 118 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14945,15 +15491,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(119), - Out: __webpack_require__(120), - InOut: __webpack_require__(121) + In: __webpack_require__(118), + Out: __webpack_require__(119), + InOut: __webpack_require__(120) }; /***/ }), -/* 119 */ +/* 118 */ /***/ (function(module, exports) { /** @@ -14981,7 +15527,7 @@ module.exports = In; /***/ }), -/* 120 */ +/* 119 */ /***/ (function(module, exports) { /** @@ -15009,7 +15555,7 @@ module.exports = Out; /***/ }), -/* 121 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -15044,7 +15590,7 @@ module.exports = InOut; /***/ }), -/* 122 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15059,15 +15605,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(123), - Out: __webpack_require__(124), - InOut: __webpack_require__(125) + In: __webpack_require__(122), + Out: __webpack_require__(123), + InOut: __webpack_require__(124) }; /***/ }), -/* 123 */ +/* 122 */ /***/ (function(module, exports) { /** @@ -15106,7 +15652,7 @@ module.exports = In; /***/ }), -/* 124 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -15145,7 +15691,7 @@ module.exports = Out; /***/ }), -/* 125 */ +/* 124 */ /***/ (function(module, exports) { /** @@ -15184,7 +15730,7 @@ module.exports = InOut; /***/ }), -/* 126 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15197,11 +15743,11 @@ module.exports = InOut; * @namespace Phaser.Math.Easing.Stepped */ -module.exports = __webpack_require__(127); +module.exports = __webpack_require__(126); /***/ }), -/* 127 */ +/* 126 */ /***/ (function(module, exports) { /** @@ -15243,7 +15789,7 @@ module.exports = Stepped; /***/ }), -/* 128 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15258,17 +15804,17 @@ module.exports = Stepped; module.exports = { - Ceil: __webpack_require__(129), + Ceil: __webpack_require__(128), Equal: __webpack_require__(31), - Floor: __webpack_require__(130), - GreaterThan: __webpack_require__(131), - LessThan: __webpack_require__(132) + Floor: __webpack_require__(129), + GreaterThan: __webpack_require__(130), + LessThan: __webpack_require__(131) }; /***/ }), -/* 129 */ +/* 128 */ /***/ (function(module, exports) { /** @@ -15299,7 +15845,7 @@ module.exports = Ceil; /***/ }), -/* 130 */ +/* 129 */ /***/ (function(module, exports) { /** @@ -15330,7 +15876,7 @@ module.exports = Floor; /***/ }), -/* 131 */ +/* 130 */ /***/ (function(module, exports) { /** @@ -15364,7 +15910,7 @@ module.exports = GreaterThan; /***/ }), -/* 132 */ +/* 131 */ /***/ (function(module, exports) { /** @@ -15398,7 +15944,7 @@ module.exports = LessThan; /***/ }), -/* 133 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15413,19 +15959,19 @@ module.exports = LessThan; module.exports = { - Bezier: __webpack_require__(134), - CatmullRom: __webpack_require__(135), - CubicBezier: __webpack_require__(136), - Linear: __webpack_require__(137), - QuadraticBezier: __webpack_require__(138), - SmoothStep: __webpack_require__(139), - SmootherStep: __webpack_require__(140) + Bezier: __webpack_require__(133), + CatmullRom: __webpack_require__(134), + CubicBezier: __webpack_require__(135), + Linear: __webpack_require__(136), + QuadraticBezier: __webpack_require__(137), + SmoothStep: __webpack_require__(138), + SmootherStep: __webpack_require__(139) }; /***/ }), -/* 134 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15464,7 +16010,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 135 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15521,7 +16067,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 136 */ +/* 135 */ /***/ (function(module, exports) { /** @@ -15591,7 +16137,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 137 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15638,7 +16184,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 138 */ +/* 137 */ /***/ (function(module, exports) { /** @@ -15697,7 +16243,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 139 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15730,7 +16276,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 140 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15763,7 +16309,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 141 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15778,15 +16324,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(142), - IsSize: __webpack_require__(143), - IsValue: __webpack_require__(144) + GetNext: __webpack_require__(141), + IsSize: __webpack_require__(142), + IsValue: __webpack_require__(143) }; /***/ }), -/* 142 */ +/* 141 */ /***/ (function(module, exports) { /** @@ -15816,7 +16362,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 143 */ +/* 142 */ /***/ (function(module, exports) { /** @@ -15846,7 +16392,7 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 144 */ +/* 143 */ /***/ (function(module, exports) { /** @@ -15874,7 +16420,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 145 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15889,15 +16435,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(146), - Floor: __webpack_require__(147), - To: __webpack_require__(148) + Ceil: __webpack_require__(145), + Floor: __webpack_require__(146), + To: __webpack_require__(147) }; /***/ }), -/* 146 */ +/* 145 */ /***/ (function(module, exports) { /** @@ -15941,7 +16487,7 @@ module.exports = SnapCeil; /***/ }), -/* 147 */ +/* 146 */ /***/ (function(module, exports) { /** @@ -15985,7 +16531,7 @@ module.exports = SnapFloor; /***/ }), -/* 148 */ +/* 147 */ /***/ (function(module, exports) { /** @@ -16028,7 +16574,7 @@ module.exports = SnapTo; /***/ }), -/* 149 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16538,7 +17084,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 150 */ +/* 149 */ /***/ (function(module, exports) { /** @@ -16573,7 +17119,7 @@ module.exports = Average; /***/ }), -/* 151 */ +/* 150 */ /***/ (function(module, exports) { /** @@ -16602,7 +17148,7 @@ module.exports = Between; /***/ }), -/* 152 */ +/* 151 */ /***/ (function(module, exports) { /** @@ -16639,7 +17185,7 @@ module.exports = CeilTo; /***/ }), -/* 153 */ +/* 152 */ /***/ (function(module, exports) { /** @@ -16667,6 +17213,289 @@ var Difference = function (a, b) module.exports = Difference; +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(5); +var Class = __webpack_require__(0); +var Matrix4 = __webpack_require__(19); +var NOOP = __webpack_require__(1); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + /***/ }), /* 154 */ /***/ (function(module, exports) { @@ -17294,7 +18123,7 @@ module.exports = SinCosTableGenerator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(1); +var Vector2 = __webpack_require__(2); /** * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. @@ -17927,9 +18756,9 @@ module.exports = Vector4; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(19); -var Matrix4 = __webpack_require__(42); -var Quaternion = __webpack_require__(43); +var Vector3 = __webpack_require__(11); +var Matrix4 = __webpack_require__(19); +var Quaternion = __webpack_require__(42); var tmpMat4 = new Matrix4(); var tmpQuat = new Quaternion(); @@ -17977,7 +18806,7 @@ module.exports = RotateVec3; /** * The Scale Manager Resize Event. - * + * * This event is dispatched whenever the Scale Manager detects a resize event from the browser. * It sends three parameters to the callback, each of them being Size components. You can read * the `width`, `height`, `aspectRatio` and other properties of these components to help with @@ -17985,11 +18814,10 @@ module.exports = RotateVec3; * * @event Phaser.Scale.Events#RESIZE * @since 3.16.1 - * + * * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} resolution - The current resolution. Defaults to 1 at the moment. * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. */ @@ -27416,7 +28244,7 @@ module.exports = spine; var Class = __webpack_require__(0); var GetFastValue = __webpack_require__(8); var ImageFile = __webpack_require__(201); -var IsPlainObject = __webpack_require__(7); +var IsPlainObject = __webpack_require__(6); var JSONFile = __webpack_require__(215); var MultiFile = __webpack_require__(216); var TextFile = __webpack_require__(217); @@ -27493,7 +28321,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { atlas = new TextFile(loader, { - key: key + '_' + i, + key: key + '!' + i, url: atlasURL[i], extension: GetFastValue(config, 'atlasExtension', 'atlas'), xhrSettings: GetFastValue(config, 'atlasXhrSettings') @@ -27515,7 +28343,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { - atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings); + atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); atlas.cache = cache; files.push(atlas); @@ -27589,9 +28417,12 @@ var SpineFile = new Class({ var image = new ImageFile(loader, key, textureURL, textureXhrSettings); - this.addToMultiFile(image); + if (!loader.keyExists(image)) + { + this.addToMultiFile(image); - loader.addFile(image); + loader.addFile(image); + } } // Reset the loader settings @@ -27620,6 +28451,7 @@ var SpineFile = new Class({ var atlasKey = ''; var combinedAtlasData = ''; var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + var textureManager = this.loader.textureManager; for (var i = 1; i < this.files.length; i++) { @@ -27627,7 +28459,7 @@ var SpineFile = new Class({ if (file.type === 'text') { - atlasKey = file.key.replace(/_[\d]$/, ''); + atlasKey = file.key.replace(/![\d]$/, ''); atlasCache = file.cache; @@ -27636,10 +28468,13 @@ var SpineFile = new Class({ else { var src = file.key.trim(); - var pos = src.indexOf('_'); + var pos = src.indexOf('!'); var key = src.substr(pos + 1); - this.loader.textureManager.addImage(key, file.data); + if (!textureManager.exists(key)) + { + textureManager.addImage(key, file.data); + } } file.pendingDestroy(); @@ -27667,11 +28502,11 @@ module.exports = SpineFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(11); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); +var CONST = __webpack_require__(12); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); var GetFastValue = __webpack_require__(8); -var IsPlainObject = __webpack_require__(7); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -28311,7 +29146,7 @@ module.exports = GetURL; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MergeXHRSettings = __webpack_require__(44); +var MergeXHRSettings = __webpack_require__(43); /** * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings @@ -28393,12 +29228,12 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(11); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); +var CONST = __webpack_require__(12); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); var GetFastValue = __webpack_require__(8); -var GetValue = __webpack_require__(6); -var IsPlainObject = __webpack_require__(7); +var GetValue = __webpack_require__(7); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -28628,7 +29463,7 @@ var Class = __webpack_require__(0); * @classdesc * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * + * * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. * * @class MultiFile @@ -28647,6 +29482,17 @@ var MultiFile = new Class({ function MultiFile (loader, type, key, files) { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + /** * A reference to the Loader that is going to load this file. * @@ -28691,7 +29537,7 @@ var MultiFile = new Class({ * @type {Phaser.Loader.File[]} * @since 3.7.0 */ - this.files = files; + this.files = finalFiles; /** * The completion status of this MultiFile. @@ -28711,7 +29557,7 @@ var MultiFile = new Class({ * @since 3.7.0 */ - this.pending = files.length; + this.pending = finalFiles.length; /** * The number of files that failed to load. @@ -28763,9 +29609,9 @@ var MultiFile = new Class({ this.prefix = loader.prefix; // Link the files - for (var i = 0; i < files.length; i++) + for (var i = 0; i < finalFiles.length; i++) { - files[i].multiFile = this; + finalFiles[i].multiFile = this; } }, @@ -28857,11 +29703,11 @@ module.exports = MultiFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(11); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); +var CONST = __webpack_require__(12); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); var GetFastValue = __webpack_require__(8); -var IsPlainObject = __webpack_require__(7); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -28890,7 +29736,9 @@ var TextFile = new Class({ function TextFile (loader, key, url, xhrSettings) { + var type = 'text'; var extension = 'txt'; + var cache = loader.cacheManager.text; if (IsPlainObject(key)) { @@ -28900,11 +29748,13 @@ var TextFile = new Class({ url = GetFastValue(config, 'url'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); } var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, + type: type, + cache: cache, extension: extension, responseType: 'text', key: key, @@ -29034,18 +29884,18 @@ module.exports = TextFile; var AngleBetween = __webpack_require__(27); var Clamp = __webpack_require__(5); var Class = __webpack_require__(0); -var ComponentsComputedSize = __webpack_require__(46); -var ComponentsDepth = __webpack_require__(47); -var ComponentsFlip = __webpack_require__(48); -var ComponentsScrollFactor = __webpack_require__(49); -var ComponentsTransform = __webpack_require__(50); -var ComponentsVisible = __webpack_require__(52); -var CounterClockwise = __webpack_require__(15); -var DegToRad = __webpack_require__(17); -var GameObject = __webpack_require__(53); -var RadToDeg = __webpack_require__(18); -var SpineEvents = __webpack_require__(238); -var SpineGameObjectRender = __webpack_require__(245); +var ComponentsComputedSize = __webpack_require__(45); +var ComponentsDepth = __webpack_require__(46); +var ComponentsFlip = __webpack_require__(47); +var ComponentsScrollFactor = __webpack_require__(48); +var ComponentsTransform = __webpack_require__(49); +var ComponentsVisible = __webpack_require__(51); +var CounterClockwise = __webpack_require__(16); +var DegToRad = __webpack_require__(18); +var GameObject = __webpack_require__(52); +var RadToDeg = __webpack_require__(20); +var SpineEvents = __webpack_require__(240); +var SpineGameObjectRender = __webpack_require__(247); /** * @classdesc @@ -29269,17 +30119,27 @@ var SpineGameObject = new Class({ }, /** - * Overrides the default Game Object method and always returns true. - * Rendering is decided in the renderer functions. + * Returns `true` if this Spine Game Object both has a skeleton and + * also passes the render tests for the given Camera. * * @method SpineGameObject#willRender * @since 3.19.0 * - * @return {boolean} Always returns `true`. + * @return {boolean} `true` if this Game Object should be rendered, otherwise `false`. */ - willRender: function () + willRender: function (camera) { - return true; + var skeleton = this.skeleton; + + if (!skeleton) + { + return false; + } + + var GameObjectRenderMask = 15; + var childAlpha = skeleton.color.a; + + return !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)) || childAlpha === 0); }, /** @@ -30016,7 +30876,7 @@ var SpineGameObject = new Class({ * @param {integer} trackIndex - The track index to play the animation on. * @param {string} animationName - The string-based key of the animation to play. * @param {boolean} [loop=false] - Should the animation be looped when played? - * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * @param {boolean} [ignoreIfPlaying=false] - If the animation specified by the track index is already playing then ignore this call. * * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. */ @@ -30027,7 +30887,7 @@ var SpineGameObject = new Class({ if (ignoreIfPlaying && this.state) { - var currentTrack = this.state.getCurrent(0); + var currentTrack = this.state.getCurrent(trackIndex); if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) { @@ -30064,6 +30924,9 @@ var SpineGameObject = new Class({ */ addAnimation: function (trackIndex, animationName, loop, delay) { + if (loop === undefined) { loop = false; } + if (delay === undefined) { delay = 0; } + return this.state.addAnimation(trackIndex, animationName, loop, delay); }, @@ -30698,13 +31561,13 @@ var DataManager = new Class({ * ``` * * You can also modify it directly: - * + * * ```javascript * this.data.values.gold += 1000; * ``` * * Doing so will emit a `setdata` event from the parent of this Data Manager. - * + * * Do not modify this object directly. Adding properties directly to this object will not * emit any events. Always use `DataManager.set` to create new items the first time around. * @@ -30728,7 +31591,7 @@ var DataManager = new Class({ if (!parent.hasOwnProperty('sys') && this.events) { - this.events.once('destroy', this.destroy, this); + this.events.once(Events.DESTROY, this.destroy, this); } }, @@ -30736,19 +31599,19 @@ var DataManager = new Class({ * Retrieves the value for the given key, or undefined if it doesn't exist. * * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * + * * ```javascript * this.data.get('gold'); * ``` * * Or access the value directly: - * + * * ```javascript * this.data.values.gold; * ``` * * You can also pass in an array of keys, in which case an array of values will be returned: - * + * * ```javascript * this.data.get([ 'gold', 'armor', 'health' ]); * ``` @@ -30833,7 +31696,7 @@ var DataManager = new Class({ /** * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * + * * ```javascript * data.set('name', 'Red Gem Stone'); * ``` @@ -30845,13 +31708,13 @@ var DataManager = new Class({ * ``` * * To get a value back again you can call `get`: - * + * * ```javascript * data.get('gold'); * ``` - * + * * Or you can access the value directly via the `values` property, where it works like any other variable: - * + * * ```javascript * data.values.gold += 50; * ``` @@ -30900,9 +31763,9 @@ var DataManager = new Class({ /** * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#inc * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -30939,9 +31802,9 @@ var DataManager = new Class({ /** * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#toggle * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -31001,7 +31864,7 @@ var DataManager = new Class({ Object.defineProperty(this.values, key, { enumerable: true, - + configurable: true, get: function () @@ -31101,9 +31964,9 @@ var DataManager = new Class({ * * If the key is found in this Data Manager it is removed from the internal lists and a * `removedata` event is emitted. - * + * * You can also pass in an array of keys, in which case all keys in the array will be removed: - * + * * ```javascript * this.data.remove([ 'gold', 'armor', 'health' ]); * ``` @@ -31195,7 +32058,7 @@ var DataManager = new Class({ /** * Determines whether the given key is set in this Data Manager. - * + * * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @@ -31338,8 +32201,9 @@ module.exports = { CHANGE_DATA: __webpack_require__(221), CHANGE_DATA_KEY: __webpack_require__(222), - REMOVE_DATA: __webpack_require__(223), - SET_DATA: __webpack_require__(224) + DESTROY: __webpack_require__(223), + REMOVE_DATA: __webpack_require__(224), + SET_DATA: __webpack_require__(225) }; @@ -31410,6 +32274,27 @@ module.exports = 'changedata-'; /* 223 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Data Manager Destroy Event. + * + * The Data Manager will listen for the destroy event from its parent, and then close itself down. + * + * @event Phaser.Data.Events#DESTROY + * @since 3.50.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 224 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -31435,7 +32320,7 @@ module.exports = 'removedata'; /***/ }), -/* 224 */ +/* 225 */ /***/ (function(module, exports) { /** @@ -31463,7 +32348,350 @@ module.exports = 'setdata'; /***/ }), -/* 225 */ +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 227 */ /***/ (function(module, exports) { /** @@ -31489,7 +32717,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 226 */ +/* 228 */ /***/ (function(module, exports) { /** @@ -31514,7 +32742,7 @@ module.exports = 'destroy'; /***/ }), -/* 227 */ +/* 229 */ /***/ (function(module, exports) { /** @@ -31540,7 +32768,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 228 */ +/* 230 */ /***/ (function(module, exports) { /** @@ -31572,7 +32800,7 @@ module.exports = 'complete'; /***/ }), -/* 229 */ +/* 231 */ /***/ (function(module, exports) { /** @@ -31601,7 +32829,7 @@ module.exports = 'created'; /***/ }), -/* 230 */ +/* 232 */ /***/ (function(module, exports) { /** @@ -31627,7 +32855,7 @@ module.exports = 'error'; /***/ }), -/* 231 */ +/* 233 */ /***/ (function(module, exports) { /** @@ -31659,7 +32887,7 @@ module.exports = 'loop'; /***/ }), -/* 232 */ +/* 234 */ /***/ (function(module, exports) { /** @@ -31687,7 +32915,7 @@ module.exports = 'play'; /***/ }), -/* 233 */ +/* 235 */ /***/ (function(module, exports) { /** @@ -31712,7 +32940,7 @@ module.exports = 'seeked'; /***/ }), -/* 234 */ +/* 236 */ /***/ (function(module, exports) { /** @@ -31738,7 +32966,7 @@ module.exports = 'seeking'; /***/ }), -/* 235 */ +/* 237 */ /***/ (function(module, exports) { /** @@ -31764,7 +32992,7 @@ module.exports = 'stop'; /***/ }), -/* 236 */ +/* 238 */ /***/ (function(module, exports) { /** @@ -31790,7 +33018,7 @@ module.exports = 'timeout'; /***/ }), -/* 237 */ +/* 239 */ /***/ (function(module, exports) { /** @@ -31816,7 +33044,7 @@ module.exports = 'unlocked'; /***/ }), -/* 238 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31831,18 +33059,18 @@ module.exports = 'unlocked'; module.exports = { - COMPLETE: __webpack_require__(239), - DISPOSE: __webpack_require__(240), - END: __webpack_require__(241), - EVENT: __webpack_require__(242), - INTERRUPTED: __webpack_require__(243), - START: __webpack_require__(244) + COMPLETE: __webpack_require__(241), + DISPOSE: __webpack_require__(242), + END: __webpack_require__(243), + EVENT: __webpack_require__(244), + INTERRUPTED: __webpack_require__(245), + START: __webpack_require__(246) }; /***/ }), -/* 239 */ +/* 241 */ /***/ (function(module, exports) { /** @@ -31861,7 +33089,7 @@ module.exports = 'complete'; /***/ }), -/* 240 */ +/* 242 */ /***/ (function(module, exports) { /** @@ -31880,7 +33108,7 @@ module.exports = 'dispose'; /***/ }), -/* 241 */ +/* 243 */ /***/ (function(module, exports) { /** @@ -31899,7 +33127,7 @@ module.exports = 'end'; /***/ }), -/* 242 */ +/* 244 */ /***/ (function(module, exports) { /** @@ -31918,7 +33146,7 @@ module.exports = 'event'; /***/ }), -/* 243 */ +/* 245 */ /***/ (function(module, exports) { /** @@ -31937,7 +33165,7 @@ module.exports = 'interrupted'; /***/ }), -/* 244 */ +/* 246 */ /***/ (function(module, exports) { /** @@ -31956,7 +33184,7 @@ module.exports = 'start'; /***/ }), -/* 245 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31965,15 +33193,15 @@ module.exports = 'start'; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var renderWebGL = __webpack_require__(3); -var renderCanvas = __webpack_require__(3); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (false) {} if (true) { - renderCanvas = __webpack_require__(246); + renderCanvas = __webpack_require__(248); } module.exports = { @@ -31985,7 +33213,7 @@ module.exports = { /***/ }), -/* 246 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -31994,8 +33222,8 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CounterClockwise = __webpack_require__(15); -var RadToDeg = __webpack_require__(18); +var CounterClockwise = __webpack_require__(16); +var RadToDeg = __webpack_require__(20); var Wrap = __webpack_require__(10); /** @@ -32009,11 +33237,10 @@ var Wrap = __webpack_require__(10); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix) { var context = renderer.currentContext; @@ -32021,15 +33248,6 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercen var skeleton = src.skeleton; var skeletonRenderer = plugin.skeletonRenderer; - var GameObjectRenderMask = 15; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); - - if (!skeleton || !willRender) - { - return; - } - var camMatrix = renderer._tempMatrix1; var spriteMatrix = renderer._tempMatrix2; var calcMatrix = renderer._tempMatrix3; @@ -32099,7 +33317,6 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercen skeleton.scaleY *= -1; } - // Add autoUpdate option skeleton.updateWorldTransform(); skeletonRenderer.ctx = context; @@ -32116,7 +33333,7 @@ module.exports = SpineGameObjectCanvasRenderer; /***/ }), -/* 247 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32126,16 +33343,16 @@ module.exports = SpineGameObjectCanvasRenderer; */ var Class = __webpack_require__(0); -var Container = __webpack_require__(248); -var SpineContainerRender = __webpack_require__(353); +var Container = __webpack_require__(250); +var SpineContainerRender = __webpack_require__(335); /** * @classdesc * A Spine Container is a special kind of Container created specifically for Spine Game Objects. * * You have all of the same features of a standard Container, but the rendering functions are optimized specifically - * for Spine Game Objects. You cannot mix and match Spine Game Objects with regular Game Objects inside of this - * type of Container, however. + * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. + * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. * * To create one in a Scene, use the factory methods: * @@ -32149,7 +33366,11 @@ var SpineContainerRender = __webpack_require__(353); * this.make.spinecontainer(); * ``` * - * See the Container documentation for further details. + * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the + * container children. You can, however, mask children of Spine Containers if they are embedded within other + * Spine Containers. In short, if you need masking, don't mix and match the types. + * + * See the Container documentation for further details about what Containers can do. * * @class SpineContainer * @extends Phaser.GameObjects.Container @@ -32182,11 +33403,30 @@ var SpineContainer = new Class({ /** * A reference to the Spine Plugin. * - * @name SpineGameObject#plugin + * @name SpineContainer#plugin * @type {SpinePlugin} - * @since 3.19.0 + * @since 3.50.0 */ this.plugin = plugin; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineContainer#preDestroy + * @protected + * @since 3.50.0 + */ + preDestroy: function () + { + this.removeAll(!!this.exclusive); + + this.localTransform.destroy(); + this.tempTransformMatrix.destroy(); + + this.list = []; + this._displayList = null; + this.plugin = null; } }); @@ -32195,7 +33435,7 @@ module.exports = SpineContainer; /***/ }), -/* 248 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -32205,17 +33445,16 @@ module.exports = SpineContainer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(249); -var BlendModes = __webpack_require__(14); +var ArrayUtils = __webpack_require__(251); +var BlendModes = __webpack_require__(15); var Class = __webpack_require__(0); -var Components = __webpack_require__(285); -var Events = __webpack_require__(22); -var GameObject = __webpack_require__(53); -var GameObjectEvents = __webpack_require__(22); +var Components = __webpack_require__(288); +var Events = __webpack_require__(54); +var GameObject = __webpack_require__(52); var Rectangle = __webpack_require__(24); -var Render = __webpack_require__(350); -var Union = __webpack_require__(352); -var Vector2 = __webpack_require__(1); +var Render = __webpack_require__(332); +var Union = __webpack_require__(334); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -32245,6 +33484,9 @@ var Vector2 = __webpack_require__(1); * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. * + * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, + * or the input area will become misaligned. + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children @@ -32657,7 +33899,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene); } }, @@ -32682,7 +33924,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene); } }, @@ -32836,7 +34078,7 @@ var Container = new Class({ }; } - ArrayUtils.StableSort.inplace(this.list, handler); + ArrayUtils.StableSort(this.list, handler); return this; }, @@ -33560,7 +34802,7 @@ module.exports = Container; /***/ }), -/* 249 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33575,45 +34817,46 @@ module.exports = Container; module.exports = { - Matrix: __webpack_require__(250), + Matrix: __webpack_require__(252), - Add: __webpack_require__(258), - AddAt: __webpack_require__(259), - BringToTop: __webpack_require__(260), - CountAllMatching: __webpack_require__(261), - Each: __webpack_require__(262), - EachInRange: __webpack_require__(263), - FindClosestInSorted: __webpack_require__(57), - GetAll: __webpack_require__(264), - GetFirst: __webpack_require__(265), - GetRandom: __webpack_require__(266), - MoveDown: __webpack_require__(267), - MoveTo: __webpack_require__(268), - MoveUp: __webpack_require__(269), - NumberArray: __webpack_require__(270), - NumberArrayStep: __webpack_require__(271), - QuickSelect: __webpack_require__(272), - Range: __webpack_require__(273), - Remove: __webpack_require__(274), - RemoveAt: __webpack_require__(275), - RemoveBetween: __webpack_require__(276), - RemoveRandomElement: __webpack_require__(277), - Replace: __webpack_require__(278), - RotateLeft: __webpack_require__(279), - RotateRight: __webpack_require__(280), + Add: __webpack_require__(261), + AddAt: __webpack_require__(262), + BringToTop: __webpack_require__(263), + CountAllMatching: __webpack_require__(264), + Each: __webpack_require__(265), + EachInRange: __webpack_require__(266), + FindClosestInSorted: __webpack_require__(267), + GetAll: __webpack_require__(268), + GetFirst: __webpack_require__(269), + GetRandom: __webpack_require__(270), + MoveDown: __webpack_require__(271), + MoveTo: __webpack_require__(272), + MoveUp: __webpack_require__(273), + NumberArray: __webpack_require__(274), + NumberArrayStep: __webpack_require__(275), + QuickSelect: __webpack_require__(276), + Range: __webpack_require__(277), + Remove: __webpack_require__(278), + RemoveAt: __webpack_require__(279), + RemoveBetween: __webpack_require__(280), + RemoveRandomElement: __webpack_require__(281), + Replace: __webpack_require__(282), + RotateLeft: __webpack_require__(56), + RotateRight: __webpack_require__(57), SafeRange: __webpack_require__(4), - SendToBack: __webpack_require__(281), - SetAll: __webpack_require__(282), + SendToBack: __webpack_require__(283), + SetAll: __webpack_require__(284), Shuffle: __webpack_require__(58), - SpliceOne: __webpack_require__(13), - StableSort: __webpack_require__(283), - Swap: __webpack_require__(284) + SortByDigits: __webpack_require__(285), + SpliceOne: __webpack_require__(14), + StableSort: __webpack_require__(286), + Swap: __webpack_require__(287) }; /***/ }), -/* 250 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33629,20 +34872,21 @@ module.exports = { module.exports = { CheckMatrix: __webpack_require__(23), - MatrixToString: __webpack_require__(251), - ReverseColumns: __webpack_require__(253), - ReverseRows: __webpack_require__(254), - Rotate180: __webpack_require__(255), - RotateLeft: __webpack_require__(256), - RotateMatrix: __webpack_require__(12), - RotateRight: __webpack_require__(257), - TransposeMatrix: __webpack_require__(56) + MatrixToString: __webpack_require__(253), + ReverseColumns: __webpack_require__(255), + ReverseRows: __webpack_require__(256), + Rotate180: __webpack_require__(257), + RotateLeft: __webpack_require__(258), + RotateMatrix: __webpack_require__(13), + RotateRight: __webpack_require__(259), + Translate: __webpack_require__(260), + TransposeMatrix: __webpack_require__(55) }; /***/ }), -/* 251 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33651,12 +34895,26 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(252); +var Pad = __webpack_require__(254); var CheckMatrix = __webpack_require__(23); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * @@ -33723,7 +34981,7 @@ module.exports = MatrixToString; /***/ }), -/* 252 */ +/* 254 */ /***/ (function(module, exports) { /** @@ -33799,7 +35057,7 @@ module.exports = Pad; /***/ }), -/* 253 */ +/* 255 */ /***/ (function(module, exports) { /** @@ -33811,6 +35069,20 @@ module.exports = Pad; /** * Reverses the columns in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * @@ -33830,7 +35102,7 @@ module.exports = ReverseColumns; /***/ }), -/* 254 */ +/* 256 */ /***/ (function(module, exports) { /** @@ -33842,6 +35114,20 @@ module.exports = ReverseColumns; /** * Reverses the rows in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseRows * @since 3.0.0 * @@ -33866,7 +35152,7 @@ module.exports = ReverseRows; /***/ }), -/* 255 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33875,11 +35161,25 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(12); +var RotateMatrix = __webpack_require__(13); /** * Rotates the array matrix 180 degrees. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.Rotate180 * @since 3.0.0 * @@ -33899,7 +35199,7 @@ module.exports = Rotate180; /***/ }), -/* 256 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33908,11 +35208,25 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(12); +var RotateMatrix = __webpack_require__(13); /** * Rotates the array matrix to the left (or 90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateLeft * @since 3.0.0 * @@ -33932,7 +35246,7 @@ module.exports = RotateLeft; /***/ }), -/* 257 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33941,11 +35255,25 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(12); +var RotateMatrix = __webpack_require__(13); /** * Rotates the array matrix to the left (or -90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateRight * @since 3.0.0 * @@ -33965,7 +35293,96 @@ module.exports = RotateRight; /***/ }), -/* 258 */ +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(56); +var RotateRight = __webpack_require__(57); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), +/* 261 */ /***/ (function(module, exports) { /** @@ -34082,7 +35499,7 @@ module.exports = Add; /***/ }), -/* 259 */ +/* 262 */ /***/ (function(module, exports) { /** @@ -34204,7 +35621,7 @@ module.exports = AddAt; /***/ }), -/* 260 */ +/* 263 */ /***/ (function(module, exports) { /** @@ -34242,7 +35659,7 @@ module.exports = BringToTop; /***/ }), -/* 261 */ +/* 264 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34294,7 +35711,7 @@ module.exports = CountAllMatching; /***/ }), -/* 262 */ +/* 265 */ /***/ (function(module, exports) { /** @@ -34340,7 +35757,7 @@ module.exports = Each; /***/ }), -/* 263 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34396,7 +35813,91 @@ module.exports = EachInRange; /***/ }), -/* 264 */ +/* 267 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), +/* 268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34458,7 +35959,7 @@ module.exports = GetAll; /***/ }), -/* 265 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34517,7 +36018,7 @@ module.exports = GetFirst; /***/ }), -/* 266 */ +/* 270 */ /***/ (function(module, exports) { /** @@ -34552,7 +36053,7 @@ module.exports = GetRandom; /***/ }), -/* 267 */ +/* 271 */ /***/ (function(module, exports) { /** @@ -34594,7 +36095,7 @@ module.exports = MoveDown; /***/ }), -/* 268 */ +/* 272 */ /***/ (function(module, exports) { /** @@ -34641,7 +36142,7 @@ module.exports = MoveTo; /***/ }), -/* 269 */ +/* 273 */ /***/ (function(module, exports) { /** @@ -34683,7 +36184,7 @@ module.exports = MoveUp; /***/ }), -/* 270 */ +/* 274 */ /***/ (function(module, exports) { /** @@ -34696,16 +36197,17 @@ module.exports = MoveUp; * Create an array representing the range of numbers (usually integers), between, and inclusive of, * the given `start` and `end` arguments. For example: * - * `var array = numberArray(2, 4); // array = [2, 3, 4]` - * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` + * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` * - * This is equivalent to `numberArrayStep(start, end, 1)`. + * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. * * You can optionally provide a prefix and / or suffix string. If given the array will contain * strings, not integers. For example: * - * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` - * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` * * @function Phaser.Utils.Array.NumberArray * @since 3.0.0 @@ -34721,22 +36223,50 @@ var NumberArray = function (start, end, prefix, suffix) { var result = []; - for (var i = start; i <= end; i++) + var i; + var asString = false; + + if (prefix || suffix) { - if (prefix || suffix) + asString = true; + + if (!prefix) { - var key = (prefix) ? prefix + i.toString() : i.toString(); - - if (suffix) - { - key = key.concat(suffix); - } - - result.push(key); + prefix = ''; } - else + + if (!suffix) { - result.push(i); + suffix = ''; + } + } + + if (end < start) + { + for (i = start; i >= end; i--) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + else + { + for (i = start; i <= end; i++) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } } } @@ -34747,7 +36277,7 @@ module.exports = NumberArray; /***/ }), -/* 271 */ +/* 275 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34824,7 +36354,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 272 */ +/* 276 */ /***/ (function(module, exports) { /** @@ -34946,7 +36476,7 @@ module.exports = QuickSelect; /***/ }), -/* 273 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34955,7 +36485,7 @@ module.exports = QuickSelect; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(7); var Shuffle = __webpack_require__(58); var BuildChunk = function (a, b, qty) @@ -35084,7 +36614,7 @@ module.exports = Range; /***/ }), -/* 274 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35093,7 +36623,7 @@ module.exports = Range; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(13); +var SpliceOne = __webpack_require__(14); /** * Removes the given item, or array of items, from the array. @@ -35175,7 +36705,7 @@ module.exports = Remove; /***/ }), -/* 275 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35184,7 +36714,7 @@ module.exports = Remove; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(13); +var SpliceOne = __webpack_require__(14); /** * Removes the item from the given position in the array. @@ -35226,7 +36756,7 @@ module.exports = RemoveAt; /***/ }), -/* 276 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35289,7 +36819,7 @@ module.exports = RemoveBetween; /***/ }), -/* 277 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35298,7 +36828,7 @@ module.exports = RemoveBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(13); +var SpliceOne = __webpack_require__(14); /** * Removes a random object from the given array and returns it. @@ -35327,7 +36857,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 278 */ +/* 282 */ /***/ (function(module, exports) { /** @@ -35371,87 +36901,7 @@ module.exports = Replace; /***/ }), -/* 279 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 280 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 281 */ +/* 283 */ /***/ (function(module, exports) { /** @@ -35489,7 +36939,7 @@ module.exports = SendToBack; /***/ }), -/* 282 */ +/* 284 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35544,8 +36994,8 @@ module.exports = SetAll; /***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { +/* 285 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -35553,143 +37003,212 @@ module.exports = SetAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -//! stable.js 0.1.6, https://github.com/Two-Screen/stable -//! © 2017 Angry Bytes and contributors. MIT licensed. +/** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * + * @function Phaser.Utils.Array.SortByDigits + * @since 3.50.0 + * + * @param {string[]} array - The input array of strings. + * + * @return {string[]} The sorted input array. + */ +var SortByDigits = function (array) +{ + var re = /\D/g; + + array.sort(function (a, b) + { + return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); + }); + + return array; +}; + +module.exports = SortByDigits; + + +/***/ }), +/* 286 */ +/***/ (function(module, exports) { /** - * @namespace Phaser.Utils.Array.StableSortFunctions + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -(function() { - - /** - * A stable array sort, because `Array#sort()` is not guaranteed stable. - * This is an implementation of merge sort, without recursion. +/** + * The comparator function. * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 + * @ignore * - * @param {array} arr - The input array to be sorted. - * @param {function} comp - The comparison handler. + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. * - * @return {array} The sorted result. + * @return {boolean} True if they localCompare, otherwise false. */ -var stable = function(arr, comp) { - return exec(arr.slice(), comp); -}; +function Compare (a, b) +{ + return String(a).localeCompare(b); +} - /** - * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes. +/** + * Process the array contents. * - * @function Phaser.Utils.Array.StableSortFunctions.inplace - * @memberof Phaser.Utils.Array.StableSortFunctions - * @since 3.0.0 + * @ignore * - * @param {array} arr - The input array. - * @param {function} comp - The comparison handler. + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. * - * @return {array} The sorted array. + * @return {array} - The processed array. */ -stable.inplace = function(arr, comp) { - var result = exec(arr, comp); - - // This simply copies back if the result isn't in the original array, - // which happens on an odd number of passes. - if (result !== arr) { - pass(result, null, arr.length, arr); - } - - return arr; -}; - -// Execute the sort using the input array and a second buffer as work space. -// Returns one of those two, containing the final result. -function exec(arr, comp) { - if (typeof(comp) !== 'function') { - comp = function(a, b) { - return String(a).localeCompare(b); - }; - } - +function Process (array, compare) +{ // Short-circuit when there's nothing to sort. - var len = arr.length; - if (len <= 1) { - return arr; + var len = array.length; + + if (len <= 1) + { + return array; } // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. // Chunks are the size of the left or right hand in merge sort. // Stop when the left-hand covers all of the array. var buffer = new Array(len); - for (var chk = 1; chk < len; chk *= 2) { - pass(arr, comp, chk, buffer); - var tmp = arr; - arr = buffer; + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + buffer = tmp; } - return arr; + return array; } -// Run a single pass with the given chunk size. -var pass = function(arr, comp, chk, result) { +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ var len = arr.length; var i = 0; + // Step size / double chunk size. var dbl = chk * 2; + // Bounds of the left and right chunks. var l, r, e; + // Iterators over the left and right chunk. var li, ri; // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) { + for (l = 0; l < len; l += dbl) + { r = l + chk; e = r + chk; - if (r > len) r = len; - if (e > len) e = len; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } // Iterate both chunks in parallel. li = l; ri = r; - while (true) { + + while (true) + { // Compare the chunks. - if (li < r && ri < e) { + if (li < r && ri < e) + { // This works for a regular `sort()` compatible comparator, // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) { + if (comp(arr[li], arr[ri]) <= 0) + { result[i++] = arr[li++]; } - else { + else + { result[i++] = arr[ri++]; } } - // Nothing to compare, just flush what's left. - else if (li < r) { + else if (li < r) + { + // Nothing to compare, just flush what's left. result[i++] = arr[li++]; } - else if (ri < e) { + else if (ri < e) + { result[i++] = arr[ri++]; } - // Both iterators are at the chunk ends. - else { + else + { + // Both iterators are at the chunk ends. break; } } } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort + * @since 3.0.0 + * + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. + * + * @return {array} The sorted result. + */ +var StableSort = function (array, compare) +{ + if (compare === undefined) { compare = Compare; } + + var result = Process(array, compare); + + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } + + return array; }; -// Export using CommonJS or to the window. -if (true) { - module.exports = stable; -} -else {} +module.exports = StableSort; -})(); /***/ }), -/* 284 */ +/* 287 */ /***/ (function(module, exports) { /** @@ -35737,7 +37256,7 @@ module.exports = Swap; /***/ }), -/* 285 */ +/* 288 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35752,34 +37271,33 @@ module.exports = Swap; module.exports = { - Alpha: __webpack_require__(286), - AlphaSingle: __webpack_require__(287), - Animation: __webpack_require__(288), - BlendMode: __webpack_require__(309), - ComputedSize: __webpack_require__(46), - Crop: __webpack_require__(310), - Depth: __webpack_require__(47), - Flip: __webpack_require__(48), - GetBounds: __webpack_require__(311), - Mask: __webpack_require__(320), - Origin: __webpack_require__(340), - PathFollower: __webpack_require__(341), - Pipeline: __webpack_require__(344), - ScrollFactor: __webpack_require__(49), - Size: __webpack_require__(345), - Texture: __webpack_require__(346), - TextureCrop: __webpack_require__(347), - Tint: __webpack_require__(348), - ToJSON: __webpack_require__(54), - Transform: __webpack_require__(50), - TransformMatrix: __webpack_require__(51), - Visible: __webpack_require__(52) + Alpha: __webpack_require__(289), + AlphaSingle: __webpack_require__(290), + BlendMode: __webpack_require__(291), + ComputedSize: __webpack_require__(45), + Crop: __webpack_require__(292), + Depth: __webpack_require__(46), + Flip: __webpack_require__(47), + GetBounds: __webpack_require__(293), + Mask: __webpack_require__(302), + Origin: __webpack_require__(322), + PathFollower: __webpack_require__(323), + Pipeline: __webpack_require__(326), + ScrollFactor: __webpack_require__(48), + Size: __webpack_require__(328), + Texture: __webpack_require__(329), + TextureCrop: __webpack_require__(330), + Tint: __webpack_require__(331), + ToJSON: __webpack_require__(53), + Transform: __webpack_require__(49), + TransformMatrix: __webpack_require__(50), + Visible: __webpack_require__(51) }; /***/ }), -/* 286 */ +/* 289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36074,7 +37592,7 @@ module.exports = Alpha; /***/ }), -/* 287 */ +/* 290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36183,2665 +37701,8 @@ var AlphaSingle = { module.exports = AlphaSingle; -/***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BaseAnimation = __webpack_require__(289); -var Class = __webpack_require__(0); -var Events = __webpack_require__(59); - -/** - * @classdesc - * A Game Object Animation Controller. - * - * This controller lives as an instance within a Game Object, accessible as `sprite.anims`. - * - * @class Animation - * @memberof Phaser.GameObjects.Components - * @constructor - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} parent - The Game Object to which this animation controller belongs. - */ -var Animation = new Class({ - - initialize: - - function Animation (parent) - { - /** - * The Game Object to which this animation controller belongs. - * - * @name Phaser.GameObjects.Components.Animation#parent - * @type {Phaser.GameObjects.GameObject} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.GameObjects.Components.Animation#animationManager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.animationManager = parent.scene.sys.anims; - - this.animationManager.once(Events.REMOVE_ANIMATION, this.remove, this); - - /** - * Is an animation currently playing or not? - * - * @name Phaser.GameObjects.Components.Animation#isPlaying - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.isPlaying = false; - - /** - * The current Animation loaded into this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentAnim - * @type {?Phaser.Animations.Animation} - * @default null - * @since 3.0.0 - */ - this.currentAnim = null; - - /** - * The current AnimationFrame being displayed by this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @since 3.0.0 - */ - this.currentFrame = null; - - /** - * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnim - * @type {?string} - * @default null - * @since 3.16.0 - */ - this.nextAnim = null; - - /** - * A queue of keys of the next Animations to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnimsQueue - * @type {string[]} - * @since 3.24.0 - */ - this.nextAnimsQueue = []; - - /** - * Time scale factor. - * - * @name Phaser.GameObjects.Components.Animation#_timeScale - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - this._timeScale = 1; - - /** - * The frame rate of playback in frames per second. - * The default is 24 if the `duration` property is `null`. - * - * @name Phaser.GameObjects.Components.Animation#frameRate - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.frameRate = 0; - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.GameObjects.Components.Animation#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * ms per frame, not including frame specific modifiers that may be present in the Animation data. - * - * @name Phaser.GameObjects.Components.Animation#msPerFrame - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.msPerFrame = 0; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.GameObjects.Components.Animation#skipMissedFrames - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.skipMissedFrames = true; - - /** - * A delay before starting playback, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_delay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._delay = 0; - - /** - * Number of times to repeat the animation (-1 for infinity) - * - * @name Phaser.GameObjects.Components.Animation#_repeat - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeat = 0; - - /** - * Delay before the repeat starts, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_repeatDelay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeatDelay = 0; - - /** - * Should the animation yoyo? (reverse back down to the start) before repeating? - * - * @name Phaser.GameObjects.Components.Animation#_yoyo - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._yoyo = false; - - /** - * Will the playhead move forwards (`true`) or in reverse (`false`). - * - * @name Phaser.GameObjects.Components.Animation#forward - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.forward = true; - - /** - * An Internal trigger that's play the animation in reverse mode ('true') or not ('false'), - * needed because forward can be changed by yoyo feature. - * - * @name Phaser.GameObjects.Components.Animation#_reverse - * @type {boolean} - * @default false - * @private - * @since 3.12.0 - */ - this._reverse = false; - - /** - * Internal time overflow accumulator. - * - * @name Phaser.GameObjects.Components.Animation#accumulator - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.accumulator = 0; - - /** - * The time point at which the next animation frame will change. - * - * @name Phaser.GameObjects.Components.Animation#nextTick - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.nextTick = 0; - - /** - * An internal counter keeping track of how many repeats are left to play. - * - * @name Phaser.GameObjects.Components.Animation#repeatCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.repeatCounter = 0; - - /** - * An internal flag keeping track of pending repeats. - * - * @name Phaser.GameObjects.Components.Animation#pendingRepeat - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.pendingRepeat = false; - - /** - * Is the Animation paused? - * - * @name Phaser.GameObjects.Components.Animation#_paused - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._paused = false; - - /** - * Was the animation previously playing before being paused? - * - * @name Phaser.GameObjects.Components.Animation#_wasPlaying - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._wasPlaying = false; - - /** - * Internal property tracking if this Animation is waiting to stop. - * - * 0 = No - * 1 = Waiting for ms to pass - * 2 = Waiting for repeat - * 3 = Waiting for specific frame - * - * @name Phaser.GameObjects.Components.Animation#_pendingStop - * @type {integer} - * @private - * @since 3.4.0 - */ - this._pendingStop = 0; - - /** - * Internal property used by _pendingStop. - * - * @name Phaser.GameObjects.Components.Animation#_pendingStopValue - * @type {any} - * @private - * @since 3.4.0 - */ - this._pendingStopValue; - }, - - /** - * Sets an animation to be played immediately after the current one completes. - * - * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. - * - * An animation set to repeat forever will never enter a completed state. - * - * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). - * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. - * - * Call this method with no arguments to reset the chained animation. - * - * @method Phaser.GameObjects.Components.Animation#chain - * @since 3.16.0 - * - * @param {(string|Phaser.Animations.Animation)} [key] - The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - chain: function (key) - { - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (this.nextAnim === null) - { - this.nextAnim = key; - } - else - { - this.nextAnimsQueue.push(key); - } - - return this.parent; - }, - - /** - * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#setDelay - * @since 3.4.0 - * - * @param {integer} [value=0] - The amount of time, in milliseconds, to wait before starting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setDelay: function (value) - { - if (value === undefined) { value = 0; } - - this._delay = value; - - return this.parent; - }, - - /** - * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#getDelay - * @since 3.4.0 - * - * @return {integer} The amount of time, in milliseconds, the Animation will wait before starting playback. - */ - getDelay: function () - { - return this._delay; - }, - - /** - * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. - * - * @method Phaser.GameObjects.Components.Animation#delayedPlay - * @since 3.0.0 - * - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. - * @param {string} key - The key of the animation to play. - * @param {integer} [startFrame=0] - The frame of the animation to start from. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - delayedPlay: function (delay, key, startFrame) - { - this.play(key, true, startFrame); - - this.nextTick += delay; - - return this.parent; - }, - - /** - * Returns the key of the animation currently loaded into this component. - * - * @method Phaser.GameObjects.Components.Animation#getCurrentKey - * @since 3.0.0 - * - * @return {string} The key of the Animation loaded into this component. - */ - getCurrentKey: function () - { - if (this.currentAnim) - { - return this.currentAnim.key; - } - }, - - /** - * Internal method used to load an animation into this component. - * - * @method Phaser.GameObjects.Components.Animation#load - * @protected - * @since 3.0.0 - * - * @param {string} key - The key of the animation to load. - * @param {integer} [startFrame=0] - The start frame of the animation to load. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - load: function (key, startFrame) - { - if (startFrame === undefined) { startFrame = 0; } - - if (this.isPlaying) - { - this.stop(); - } - - // Load the new animation in - this.animationManager.load(this, key, startFrame); - - return this.parent; - }, - - /** - * Pause the current animation and set the `isPlaying` property to `false`. - * You can optionally pause it at a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#pause - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [atFrame] - An optional frame to set after pausing the animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - pause: function (atFrame) - { - if (!this._paused) - { - this._paused = true; - this._wasPlaying = this.isPlaying; - this.isPlaying = false; - } - - if (atFrame !== undefined) - { - this.updateFrame(atFrame); - } - - return this.parent; - }, - - /** - * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. - * You can optionally tell it to start playback from a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#resume - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [fromFrame] - An optional frame to set before restarting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - resume: function (fromFrame) - { - if (this._paused) - { - this._paused = false; - this.isPlaying = this._wasPlaying; - } - - if (fromFrame !== undefined) - { - this.updateFrame(fromFrame); - } - - return this.parent; - }, - - /** - * `true` if the current animation is paused, otherwise `false`. - * - * @name Phaser.GameObjects.Components.Animation#isPaused - * @readonly - * @type {boolean} - * @since 3.4.0 - */ - isPaused: { - - get: function () - { - return this._paused; - } - - }, - - /** - * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. - * - * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. - * - * @method Phaser.GameObjects.Components.Animation#play - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.0.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - play: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = true; - this._reverse = false; - this._paused = false; - this._wasPlaying = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#playReverse - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.12.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - playReverse: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = false; - this._reverse = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. - * - * @method Phaser.GameObjects.Components.Animation#_startAnimation - * @fires Phaser.Animations.Events#ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.12.0 - * - * @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - _startAnimation: function (key, startFrame) - { - this.load(key, startFrame); - - var anim = this.currentAnim; - var gameObject = this.parent; - - if (!anim) - { - return gameObject; - } - - // Should give us 9,007,199,254,740,991 safe repeats - this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; - - anim.getFirstTick(this); - - this.isPlaying = true; - this.pendingRepeat = false; - - if (anim.showOnStart) - { - gameObject.visible = true; - } - - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_START, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_START + key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_START, anim, frame, gameObject); - - return gameObject; - }, - - /** - * Reverse the Animation that is already playing on the Game Object. - * - * @method Phaser.GameObjects.Components.Animation#reverse - * @since 3.12.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - reverse: function () - { - if (this.isPlaying) - { - this._reverse = !this._reverse; - - this.forward = !this.forward; - } - - return this.parent; - }, - - /** - * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. - * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different - * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. - * - * @method Phaser.GameObjects.Components.Animation#getProgress - * @since 3.4.0 - * - * @return {number} The progress of the current animation, between 0 and 1. - */ - getProgress: function () - { - var p = this.currentFrame.progress; - - if (!this.forward) - { - p = 1 - p; - } - - return p; - }, - - /** - * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. - * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. - * - * @method Phaser.GameObjects.Components.Animation#setProgress - * @since 3.4.0 - * - * @param {number} [value=0] - The progress value, between 0 and 1. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setProgress: function (value) - { - if (!this.forward) - { - value = 1 - value; - } - - this.setCurrentFrame(this.currentAnim.getFrameByProgress(value)); - - return this.parent; - }, - - /** - * Handle the removal of an animation from the Animation Manager. - * - * @method Phaser.GameObjects.Components.Animation#remove - * @since 3.0.0 - * - * @param {string} [key] - The key of the removed Animation. - * @param {Phaser.Animations.Animation} [animation] - The removed Animation. - */ - remove: function (key, animation) - { - if (animation === undefined) { animation = this.currentAnim; } - - if (this.isPlaying && animation.key === this.currentAnim.key) - { - this.stop(); - - this.setCurrentFrame(this.currentAnim.frames[0]); - } - }, - - /** - * Gets the number of times that the animation will repeat - * after its first iteration. For example, if returns 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * A value of -1 means the animation will repeat indefinitely. - * - * @method Phaser.GameObjects.Components.Animation#getRepeat - * @since 3.4.0 - * - * @return {integer} The number of times that the animation will repeat. - */ - getRepeat: function () - { - return this._repeat; - }, - - /** - * Sets the number of times that the animation should repeat - * after its first iteration. For example, if repeat is 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * To repeat indefinitely, use -1. repeat should always be an integer. - * - * @method Phaser.GameObjects.Components.Animation#setRepeat - * @since 3.4.0 - * - * @param {integer} value - The number of times that the animation should repeat. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeat: function (value) - { - this._repeat = value; - - this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; - - return this.parent; - }, - - /** - * Gets the amount of delay between repeats, if any. - * - * @method Phaser.GameObjects.Components.Animation#getRepeatDelay - * @since 3.4.0 - * - * @return {number} The delay between repeats. - */ - getRepeatDelay: function () - { - return this._repeatDelay; - }, - - /** - * Sets the amount of time in seconds between repeats. - * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, - * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds - * before doing its final repeat. - * - * @method Phaser.GameObjects.Components.Animation#setRepeatDelay - * @since 3.4.0 - * - * @param {number} value - The delay to wait between repeats, in seconds. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeatDelay: function (value) - { - this._repeatDelay = value; - - return this.parent; - }, - - /** - * Restarts the current animation from its beginning, optionally including its delay value. - * - * @method Phaser.GameObjects.Components.Animation#restart - * @fires Phaser.Animations.Events#ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.0.0 - * - * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - restart: function (includeDelay) - { - if (includeDelay === undefined) { includeDelay = false; } - - var anim = this.currentAnim; - - anim.getFirstTick(this, includeDelay); - - this.forward = true; - this.isPlaying = true; - this.pendingRepeat = false; - this._paused = false; - - // Set frame - this.updateFrame(anim.frames[0]); - - var gameObject = this.parent; - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_RESTART, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_RESTART + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_RESTART, anim, frame, gameObject); - - return this.parent; - }, - - /** - * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. - * - * If no animation is set, no event will be dispatched. - * - * If there is another animation queued (via the `chain` method) then it will start playing immediately. - * - * @method Phaser.GameObjects.Components.Animation#stop - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.0.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stop: function () - { - this._pendingStop = 0; - - this.isPlaying = false; - - var gameObject = this.parent; - var anim = this.currentAnim; - var frame = this.currentFrame; - - if (anim) - { - anim.emit(Events.ANIMATION_COMPLETE, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_COMPLETE + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_COMPLETE, anim, frame, gameObject); - } - - if (this.nextAnim) - { - var key = this.nextAnim; - - this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null; - - this.play(key); - } - - return gameObject; - }, - - /** - * Stops the current animation from playing after the specified time delay, given in milliseconds. - * - * @method Phaser.GameObjects.Components.Animation#stopAfterDelay - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopAfterDelay: function (delay) - { - this._pendingStop = 1; - this._pendingStopValue = delay; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next repeats. - * - * @method Phaser.GameObjects.Components.Animation#stopOnRepeat - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnRepeat: function () - { - this._pendingStop = 2; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next sets the given frame. - * If this frame doesn't exist within the animation it will not stop it from playing. - * - * @method Phaser.GameObjects.Components.Animation#stopOnFrame - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnFrame: function (frame) - { - this._pendingStop = 3; - this._pendingStopValue = frame; - - return this.parent; - }, - - /** - * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. - * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. - * - * @method Phaser.GameObjects.Components.Animation#setTimeScale - * @since 3.4.0 - * - * @param {number} [value=1] - The time scale factor, where 1 is no change, 0.5 is half speed, etc. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setTimeScale: function (value) - { - if (value === undefined) { value = 1; } - - this._timeScale = value; - - return this.parent; - }, - - /** - * Gets the Time Scale factor. - * - * @method Phaser.GameObjects.Components.Animation#getTimeScale - * @since 3.4.0 - * - * @return {number} The Time Scale value. - */ - getTimeScale: function () - { - return this._timeScale; - }, - - /** - * Returns the total number of frames in this animation. - * - * @method Phaser.GameObjects.Components.Animation#getTotalFrames - * @since 3.4.0 - * - * @return {integer} The total number of frames in this animation. - */ - getTotalFrames: function () - { - return this.currentAnim.frames.length; - }, - - /** - * The internal update loop for the Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#update - * @since 3.0.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - update: function (time, delta) - { - if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused) - { - return; - } - - this.accumulator += delta * this._timeScale; - - if (this._pendingStop === 1) - { - this._pendingStopValue -= delta; - - if (this._pendingStopValue <= 0) - { - return this.currentAnim.completeAnimation(this); - } - } - - if (this.accumulator >= this.nextTick) - { - this.currentAnim.setFrame(this); - } - }, - - /** - * Sets the given Animation Frame as being the current frame - * and applies it to the parent Game Object, adjusting its size and origin as needed. - * - * @method Phaser.GameObjects.Components.Animation#setCurrentFrame - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The Animation Frame to set as being current. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setCurrentFrame: function (animationFrame) - { - var gameObject = this.parent; - - this.currentFrame = animationFrame; - - gameObject.texture = animationFrame.frame.texture; - gameObject.frame = animationFrame.frame; - - if (gameObject.isCropped) - { - gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); - } - - gameObject.setSizeToFrame(); - - if (gameObject._originComponent) - { - if (animationFrame.frame.customPivot) - { - gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY); - } - else - { - gameObject.updateDisplayOrigin(); - } - } - - return gameObject; - }, - - /** - * Internal frame change handler. - * - * @method Phaser.GameObjects.Components.Animation#updateFrame - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @private - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to. - */ - updateFrame: function (animationFrame) - { - var gameObject = this.setCurrentFrame(animationFrame); - - if (this.isPlaying) - { - if (animationFrame.setAlpha) - { - gameObject.alpha = animationFrame.alpha; - } - - var anim = this.currentAnim; - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_UPDATE + anim.key, anim, animationFrame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_UPDATE, anim, animationFrame, gameObject); - - if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) - { - this.currentAnim.completeAnimation(this); - } - } - }, - - /** - * Advances the animation to the next frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in reverse, calling this method doesn't then change the direction to forwards. - * - * @method Phaser.GameObjects.Components.Animation#nextFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - nextFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.nextFrame(this); - } - - return this.parent; - }, - - /** - * Advances the animation to the previous frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in forwards, calling this method doesn't then change the direction to backwards. - * - * @method Phaser.GameObjects.Components.Animation#previousFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - previousFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.previousFrame(this); - } - - return this.parent; - }, - - /** - * Sets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#setYoyo - * @since 3.4.0 - * - * @param {boolean} [value=false] - `true` if the animation should yoyo, `false` to not. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setYoyo: function (value) - { - if (value === undefined) { value = false; } - - this._yoyo = value; - - return this.parent; - }, - - /** - * Gets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#getYoyo - * @since 3.4.0 - * - * @return {boolean} `true` if the animation is set to yoyo, `false` if not. - */ - getYoyo: function () - { - return this._yoyo; - }, - - /** - * Destroy this Animation component. - * - * Unregisters event listeners and cleans up its references. - * - * @method Phaser.GameObjects.Components.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.animationManager.off(Events.REMOVE_ANIMATION, this.remove, this); - - this.animationManager = null; - this.parent = null; - this.nextAnimsQueue.length = 0; - - this.currentAnim = null; - this.currentFrame = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(5); -var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(55); -var Events = __webpack_require__(59); -var FindClosestInSorted = __webpack_require__(57); -var Frame = __webpack_require__(308); -var GetValue = __webpack_require__(6); - -/** - * @classdesc - * A Frame based Animation. - * - * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. - * - * The Animation Manager creates these. Game Objects don't own an instance of these directly. - * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) - * So multiple Game Objects can have playheads all pointing to this one Animation instance. - * - * @class Animation - * @memberof Phaser.Animations - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager - * @param {string} key - The unique identifying string for this animation. - * @param {Phaser.Types.Animations.Animation} config - The Animation configuration. - */ -var Animation = new Class({ - - Extends: EventEmitter, - - initialize: - - function Animation (manager, key, config) - { - EventEmitter.call(this); - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.Animations.Animation#manager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.manager = manager; - - /** - * The unique identifying string for this animation. - * - * @name Phaser.Animations.Animation#key - * @type {string} - * @since 3.0.0 - */ - this.key = key; - - /** - * A frame based animation (as opposed to a bone based animation) - * - * @name Phaser.Animations.Animation#type - * @type {string} - * @default frame - * @since 3.0.0 - */ - this.type = 'frame'; - - /** - * Extract all the frame data into the frames array. - * - * @name Phaser.Animations.Animation#frames - * @type {Phaser.Animations.AnimationFrame[]} - * @since 3.0.0 - */ - this.frames = this.getFrames( - manager.textureManager, - GetValue(config, 'frames', []), - GetValue(config, 'defaultTextureKey', null) - ); - - /** - * The frame rate of playback in frames per second (default 24 if duration is null) - * - * @name Phaser.Animations.Animation#frameRate - * @type {integer} - * @default 24 - * @since 3.0.0 - */ - this.frameRate = GetValue(config, 'frameRate', null); - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.Animations.Animation#duration - * @type {integer} - * @since 3.0.0 - */ - this.duration = GetValue(config, 'duration', null); - - if (this.duration === null && this.frameRate === null) - { - // No duration or frameRate given, use default frameRate of 24fps - this.frameRate = 24; - this.duration = (this.frameRate / this.frames.length) * 1000; - } - else if (this.duration && this.frameRate === null) - { - // Duration given but no frameRate, so set the frameRate based on duration - // I.e. 12 frames in the animation, duration = 4000 ms - // So frameRate is 12 / (4000 / 1000) = 3 fps - this.frameRate = this.frames.length / (this.duration / 1000); - } - else - { - // frameRate given, derive duration from it (even if duration also specified) - // I.e. 15 frames in the animation, frameRate = 30 fps - // So duration is 15 / 30 = 0.5 * 1000 (half a second, or 500ms) - this.duration = (this.frames.length / this.frameRate) * 1000; - } - - /** - * How many ms per frame, not including frame specific modifiers. - * - * @name Phaser.Animations.Animation#msPerFrame - * @type {integer} - * @since 3.0.0 - */ - this.msPerFrame = 1000 / this.frameRate; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.Animations.Animation#skipMissedFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true); - - /** - * The delay in ms before the playback will begin. - * - * @name Phaser.Animations.Animation#delay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.delay = GetValue(config, 'delay', 0); - - /** - * Number of times to repeat the animation. Set to -1 to repeat forever. - * - * @name Phaser.Animations.Animation#repeat - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeat = GetValue(config, 'repeat', 0); - - /** - * The delay in ms before the a repeat play starts. - * - * @name Phaser.Animations.Animation#repeatDelay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeatDelay = GetValue(config, 'repeatDelay', 0); - - /** - * Should the animation yoyo (reverse back down to the start) before repeating? - * - * @name Phaser.Animations.Animation#yoyo - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.yoyo = GetValue(config, 'yoyo', false); - - /** - * Should the GameObject's `visible` property be set to `true` when the animation starts to play? - * - * @name Phaser.Animations.Animation#showOnStart - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.showOnStart = GetValue(config, 'showOnStart', false); - - /** - * Should the GameObject's `visible` property be set to `false` when the animation finishes? - * - * @name Phaser.Animations.Animation#hideOnComplete - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.hideOnComplete = GetValue(config, 'hideOnComplete', false); - - /** - * Global pause. All Game Objects using this Animation instance are impacted by this property. - * - * @name Phaser.Animations.Animation#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - this.manager.on(Events.PAUSE_ALL, this.pause, this); - this.manager.on(Events.RESUME_ALL, this.resume, this); - }, - - /** - * Add frames to the end of the animation. - * - * @method Phaser.Animations.Animation#addFrame - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrame: function (config) - { - return this.addFrameAt(this.frames.length, config); - }, - - /** - * Add frame/s into the animation. - * - * @method Phaser.Animations.Animation#addFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index to insert the frame at within the animation. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrameAt: function (index, config) - { - var newFrames = this.getFrames(this.manager.textureManager, config); - - if (newFrames.length > 0) - { - if (index === 0) - { - this.frames = newFrames.concat(this.frames); - } - else if (index === this.frames.length) - { - this.frames = this.frames.concat(newFrames); - } - else - { - var pre = this.frames.slice(0, index); - var post = this.frames.slice(index); - - this.frames = pre.concat(newFrames, post); - } - - this.updateFrameSequence(); - } - - return this; - }, - - /** - * Check if the given frame index is valid. - * - * @method Phaser.Animations.Animation#checkFrame - * @since 3.0.0 - * - * @param {integer} index - The index to be checked. - * - * @return {boolean} `true` if the index is valid, otherwise `false`. - */ - checkFrame: function (index) - { - return (index >= 0 && index < this.frames.length); - }, - - /** - * Called internally when this Animation completes playback. - * Optionally, hides the parent Game Object, then stops playback. - * - * @method Phaser.Animations.Animation#completeAnimation - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - completeAnimation: function (component) - { - if (this.hideOnComplete) - { - component.parent.visible = false; - } - - component.stop(); - }, - - /** - * Called internally when this Animation first starts to play. - * Sets the accumulator and nextTick properties. - * - * @method Phaser.Animations.Animation#getFirstTick - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - * @param {boolean} [includeDelay=true] - If `true` the Animation Components delay value will be added to the `nextTick` total. - */ - getFirstTick: function (component, includeDelay) - { - if (includeDelay === undefined) { includeDelay = true; } - - // When is the first update due? - component.accumulator = 0; - component.nextTick = component.msPerFrame + component.currentFrame.duration; - - if (includeDelay) - { - component.nextTick += component._delay; - } - }, - - /** - * Returns the AnimationFrame at the provided index - * - * @method Phaser.Animations.Animation#getFrameAt - * @protected - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence - */ - getFrameAt: function (index) - { - return this.frames[index]; - }, - - /** - * Creates AnimationFrame instances based on the given frame data. - * - * @method Phaser.Animations.Animation#getFrames - * @since 3.0.0 - * - * @param {Phaser.Textures.TextureManager} textureManager - A reference to the global Texture Manager. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} frames - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * @param {string} [defaultTextureKey] - The key to use if no key is set in the frame configuration object. - * - * @return {Phaser.Animations.AnimationFrame[]} An array of newly created AnimationFrame instances. - */ - getFrames: function (textureManager, frames, defaultTextureKey) - { - var out = []; - var prev; - var animationFrame; - var index = 1; - var i; - var textureKey; - - // if frames is a string, we'll get all the frames from the texture manager as if it's a sprite sheet - if (typeof frames === 'string') - { - textureKey = frames; - - var texture = textureManager.get(textureKey); - var frameKeys = texture.getFrameNames(); - - frames = []; - - frameKeys.forEach(function (idx, value) - { - frames.push({ key: textureKey, frame: value }); - }); - } - - if (!Array.isArray(frames) || frames.length === 0) - { - return out; - } - - for (i = 0; i < frames.length; i++) - { - var item = frames[i]; - - var key = GetValue(item, 'key', defaultTextureKey); - - if (!key) - { - continue; - } - - // Could be an integer or a string - var frame = GetValue(item, 'frame', 0); - - // The actual texture frame - var textureFrame = textureManager.getFrame(key, frame); - - animationFrame = new Frame(key, frame, index, textureFrame); - - animationFrame.duration = GetValue(item, 'duration', 0); - - animationFrame.isFirst = (!prev); - - // The previously created animationFrame - if (prev) - { - prev.nextFrame = animationFrame; - - animationFrame.prevFrame = prev; - } - - out.push(animationFrame); - - prev = animationFrame; - - index++; - } - - if (out.length > 0) - { - animationFrame.isLast = true; - - // Link them end-to-end, so they loop - animationFrame.nextFrame = out[0]; - - out[0].prevFrame = animationFrame; - - // Generate the progress data - - var slice = 1 / (out.length - 1); - - for (i = 0; i < out.length; i++) - { - out[i].progress = i * slice; - } - } - - return out; - }, - - /** - * Called internally. Sets the accumulator and nextTick values of the current Animation. - * - * @method Phaser.Animations.Animation#getNextTick - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - getNextTick: function (component) - { - // accumulator += delta * _timeScale - // after a large delta surge (perf issue for example) we need to adjust for it here - - // When is the next update due? - component.accumulator -= component.nextTick; - - component.nextTick = component.msPerFrame + component.currentFrame.duration; - }, - - /** - * Loads the Animation values into the Animation Component. - * - * @method Phaser.Animations.Animation#load - * @private - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into. - * @param {integer} startFrame - The start frame of the animation to load. - */ - load: function (component, startFrame) - { - if (startFrame >= this.frames.length) - { - startFrame = 0; - } - - if (component.currentAnim !== this) - { - component.currentAnim = this; - - component.frameRate = this.frameRate; - component.duration = this.duration; - component.msPerFrame = this.msPerFrame; - component.skipMissedFrames = this.skipMissedFrames; - - component._delay = this.delay; - component._repeat = this.repeat; - component._repeatDelay = this.repeatDelay; - component._yoyo = this.yoyo; - } - - var frame = this.frames[startFrame]; - - if (startFrame === 0 && !component.forward) - { - frame = this.getLastFrame(); - } - - component.updateFrame(frame); - }, - - /** - * Returns the frame closest to the given progress value between 0 and 1. - * - * @method Phaser.Animations.Animation#getFrameByProgress - * @since 3.4.0 - * - * @param {number} value - A value between 0 and 1. - * - * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value. - */ - getFrameByProgress: function (value) - { - value = Clamp(value, 0, 1); - - return FindClosestInSorted(value, this.frames, 'progress'); - }, - - /** - * Advance the animation frame. - * - * @method Phaser.Animations.Animation#nextFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - */ - nextFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isLast) - { - // We're at the end of the animation - - // Yoyo? (happens before repeat) - if (component._yoyo) - { - this.handleYoyoFrame(component, false); - } - else if (component.repeatCounter > 0) - { - // Repeat (happens before complete) - - if (component._reverse && component.forward) - { - component.forward = false; - } - else - { - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.nextFrame); - } - }, - - /** - * Handle the yoyo functionality in nextFrame and previousFrame methods. - * - * @method Phaser.Animations.Animation#handleYoyoFrame - * @private - * @since 3.12.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) - */ - handleYoyoFrame: function (component, isReverse) - { - if (!isReverse) { isReverse = false; } - - if (component._reverse === !isReverse && component.repeatCounter > 0) - { - if (!component._repeatDelay || component.pendingRepeat) - - { - component.forward = isReverse; - } - - this.repeatAnimation(component); - - return; - } - - if (component._reverse !== isReverse && component.repeatCounter === 0) - { - this.completeAnimation(component); - - return; - } - - component.forward = isReverse; - - var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; - - this.updateAndGetNextTick(component, frame); - }, - - /** - * Returns the animation last frame. - * - * @method Phaser.Animations.Animation#getLastFrame - * @since 3.12.0 - * - * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. - */ - getLastFrame: function () - { - return this.frames[this.frames.length - 1]; - }, - - /** - * Called internally when the Animation is playing backwards. - * Sets the previous frame, causing a yoyo, repeat, complete or update, accordingly. - * - * @method Phaser.Animations.Animation#previousFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - previousFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isFirst) - { - // We're at the start of the animation - - if (component._yoyo) - { - this.handleYoyoFrame(component, true); - } - else if (component.repeatCounter > 0) - { - if (component._reverse && !component.forward) - { - component.currentFrame = this.getLastFrame(); - this.repeatAnimation(component); - } - else - { - // Repeat (happens before complete) - component.forward = true; - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.prevFrame); - } - }, - - /** - * Update Frame and Wait next tick. - * - * @method Phaser.Animations.Animation#updateAndGetNextTick - * @private - * @since 3.12.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. - */ - updateAndGetNextTick: function (component, frame) - { - component.updateFrame(frame); - - this.getNextTick(component); - }, - - /** - * Removes the given AnimationFrame from this Animation instance. - * This is a global action. Any Game Object using this Animation will be impacted by this change. - * - * @method Phaser.Animations.Animation#removeFrame - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The AnimationFrame to be removed. - * - * @return {this} This Animation object. - */ - removeFrame: function (frame) - { - var index = this.frames.indexOf(frame); - - if (index !== -1) - { - this.removeFrameAt(index); - } - - return this; - }, - - /** - * Removes a frame from the AnimationFrame array at the provided index - * and updates the animation accordingly. - * - * @method Phaser.Animations.Animation#removeFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {this} This Animation object. - */ - removeFrameAt: function (index) - { - this.frames.splice(index, 1); - - this.updateFrameSequence(); - - return this; - }, - - /** - * Called internally during playback. Forces the animation to repeat, providing there are enough counts left - * in the repeat counter. - * - * @method Phaser.Animations.Animation#repeatAnimation - * @fires Phaser.Animations.Events#ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - repeatAnimation: function (component) - { - if (component._pendingStop === 2) - { - return this.completeAnimation(component); - } - - if (component._repeatDelay > 0 && component.pendingRepeat === false) - { - component.pendingRepeat = true; - component.accumulator -= component.nextTick; - component.nextTick += component._repeatDelay; - } - else - { - component.repeatCounter--; - - component.updateFrame(component.currentFrame[(component.forward) ? 'nextFrame' : 'prevFrame']); - - if (component.isPlaying) - { - this.getNextTick(component); - - component.pendingRepeat = false; - - var frame = component.currentFrame; - var parent = component.parent; - - this.emit(Events.ANIMATION_REPEAT, this, frame); - - parent.emit(Events.SPRITE_ANIMATION_KEY_REPEAT + this.key, this, frame, component.repeatCounter, parent); - - parent.emit(Events.SPRITE_ANIMATION_REPEAT, this, frame, component.repeatCounter, parent); - } - } - }, - - /** - * Sets the texture frame the animation uses for rendering. - * - * @method Phaser.Animations.Animation#setFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - setFrame: function (component) - { - // Work out which frame should be set next on the child, and set it - if (component.forward) - { - this.nextFrame(component); - } - else - { - this.previousFrame(component); - } - }, - - /** - * Converts the animation data to JSON. - * - * @method Phaser.Animations.Animation#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimation} The resulting JSONAnimation formatted object. - */ - toJSON: function () - { - var output = { - key: this.key, - type: this.type, - frames: [], - frameRate: this.frameRate, - duration: this.duration, - skipMissedFrames: this.skipMissedFrames, - delay: this.delay, - repeat: this.repeat, - repeatDelay: this.repeatDelay, - yoyo: this.yoyo, - showOnStart: this.showOnStart, - hideOnComplete: this.hideOnComplete - }; - - this.frames.forEach(function (frame) - { - output.frames.push(frame.toJSON()); - }); - - return output; - }, - - /** - * Called internally whenever frames are added to, or removed from, this Animation. - * - * @method Phaser.Animations.Animation#updateFrameSequence - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - updateFrameSequence: function () - { - var len = this.frames.length; - var slice = 1 / (len - 1); - - var frame; - - for (var i = 0; i < len; i++) - { - frame = this.frames[i]; - - frame.index = i + 1; - frame.isFirst = false; - frame.isLast = false; - frame.progress = i * slice; - - if (i === 0) - { - frame.isFirst = true; - - if (len === 1) - { - frame.isLast = true; - frame.nextFrame = frame; - frame.prevFrame = frame; - } - else - { - frame.isLast = false; - frame.prevFrame = this.frames[len - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - else if (i === len - 1 && len > 1) - { - frame.isLast = true; - frame.prevFrame = this.frames[len - 2]; - frame.nextFrame = this.frames[0]; - } - else if (len > 1) - { - frame.prevFrame = this.frames[i - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - - return this; - }, - - /** - * Pauses playback of this Animation. The paused state is set immediately. - * - * @method Phaser.Animations.Animation#pause - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - pause: function () - { - this.paused = true; - - return this; - }, - - /** - * Resumes playback of this Animation. The paused state is reset immediately. - * - * @method Phaser.Animations.Animation#resume - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - resume: function () - { - this.paused = false; - - return this; - }, - - /** - * Destroys this Animation instance. It will remove all event listeners, - * remove this animation and its key from the global Animation Manager, - * and then destroy all Animation Frames in turn. - * - * @method Phaser.Animations.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAllListeners(); - - this.manager.off(Events.PAUSE_ALL, this.pause, this); - this.manager.off(Events.RESUME_ALL, this.resume, this); - - this.manager.remove(this.key); - - for (var i = 0; i < this.frames.length; i++) - { - this.frames[i].destroy(); - } - - this.frames = []; - - this.manager = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 290 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Add Animation Event. - * - * This event is dispatched when a new animation is added to the global Animation Manager. - * - * This can happen either as a result of an animation instance being added to the Animation Manager, - * or the Animation Manager creating a new animation directly. - * - * @event Phaser.Animations.Events#ADD_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was added to the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the newly created Animation. - */ -module.exports = 'add'; - - /***/ }), /* 291 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Complete Event. - * - * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. - * - * Be careful with the volume of events this could generate. If a group of Sprites all complete the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'complete'; - - -/***/ }), -/* 292 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Repeat Event. - * - * This event is dispatched when a currently playing animation repeats. - * - * The event is dispatched directly from the Animation object itself. Which means that listeners - * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. - * - * @event Phaser.Animations.Events#ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that repeated. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation was on when it repeated. - */ -module.exports = 'repeat'; - - -/***/ }), -/* 293 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Restart Event. - * - * This event is dispatched by an Animation instance when it restarts. - * - * Be careful with the volume of events this could generate. If a group of Sprites all restart the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that restarted playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'restart'; - - -/***/ }), -/* 294 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Start Event. - * - * This event is dispatched by an Animation instance when it starts playing. - * - * Be careful with the volume of events this could generate. If a group of Sprites all play the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that started playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'start'; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Pause All Animations Event. - * - * This event is dispatched when the global Animation Manager is told to pause. - * - * When this happens all current animations will stop updating, although it doesn't necessarily mean - * that the game has paused as well. - * - * @event Phaser.Animations.Events#PAUSE_ALL - * @since 3.0.0 - */ -module.exports = 'pauseall'; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Remove Animation Event. - * - * This event is dispatched when an animation is removed from the global Animation Manager. - * - * @event Phaser.Animations.Events#REMOVE_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was removed from the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the removed Animation. - */ -module.exports = 'remove'; - - -/***/ }), -/* 297 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Resume All Animations Event. - * - * This event is dispatched when the global Animation Manager resumes, having been previously paused. - * - * When this happens all current animations will continue updating again. - * - * @event Phaser.Animations.Events#RESUME_ALL - * @since 3.0.0 - */ -module.exports = 'resumeall'; - - -/***/ }), -/* 298 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Complete Event. - * - * This event is dispatched by a Sprite when an animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete'; - - -/***/ }), -/* 299 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Complete Event. - * - * This event is dispatched by a Sprite when a specific animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete-'; - - -/***/ }), -/* 300 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Repeat Event. - * - * This event is dispatched by a Sprite when a specific animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat-'; - - -/***/ }), -/* 301 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Restart Event. - * - * This event is dispatched by a Sprite when a specific animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart-'; - - -/***/ }), -/* 302 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Start Event. - * - * This event is dispatched by a Sprite when a specific animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart-'; - - -/***/ }), -/* 303 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Update Event. - * - * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate-'; - - -/***/ }), -/* 304 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Repeat Event. - * - * This event is dispatched by a Sprite when an animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat'; - - -/***/ }), -/* 305 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Restart Event. - * - * This event is dispatched by a Sprite when an animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart'; - - -/***/ }), -/* 306 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Start Event. - * - * This event is dispatched by a Sprite when an animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart'; - - -/***/ }), -/* 307 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Update Event. - * - * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate'; - - -/***/ }), -/* 308 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38850,181 +37711,7 @@ module.exports = 'animationupdate'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); - -/** - * @classdesc - * A single frame in an Animation sequence. - * - * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other - * frames in the animation, and index data. It also has the ability to modify the animation timing. - * - * AnimationFrames are generated automatically by the Animation class. - * - * @class AnimationFrame - * @memberof Phaser.Animations - * @constructor - * @since 3.0.0 - * - * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. - * @param {integer} index - The index of this AnimationFrame within the Animation sequence. - * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. - */ -var AnimationFrame = new Class({ - - initialize: - - function AnimationFrame (textureKey, textureFrame, index, frame) - { - /** - * The key of the Texture this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureKey - * @type {string} - * @since 3.0.0 - */ - this.textureKey = textureKey; - - /** - * The key of the Frame within the Texture that this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {(string|integer)} - * @since 3.0.0 - */ - this.textureFrame = textureFrame; - - /** - * The index of this AnimationFrame within the Animation sequence. - * - * @name Phaser.Animations.AnimationFrame#index - * @type {integer} - * @since 3.0.0 - */ - this.index = index; - - /** - * A reference to the Texture Frame this AnimationFrame uses for rendering. - * - * @name Phaser.Animations.AnimationFrame#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - this.frame = frame; - - /** - * Is this the first frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isFirst - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isFirst = false; - - /** - * Is this the last frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isLast - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isLast = false; - - /** - * A reference to the AnimationFrame that comes before this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#prevFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.prevFrame = null; - - /** - * A reference to the AnimationFrame that comes after this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#nextFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.nextFrame = null; - - /** - * Additional time (in ms) that this frame should appear for during playback. - * The value is added onto the msPerFrame set by the animation. - * - * @name Phaser.Animations.AnimationFrame#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * What % through the animation does this frame come? - * This value is generated when the animation is created and cached here. - * - * @name Phaser.Animations.AnimationFrame#progress - * @type {number} - * @default 0 - * @readonly - * @since 3.0.0 - */ - this.progress = 0; - }, - - /** - * Generates a JavaScript object suitable for converting to JSON. - * - * @method Phaser.Animations.AnimationFrame#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimationFrame} The AnimationFrame data. - */ - toJSON: function () - { - return { - key: this.textureKey, - frame: this.textureFrame, - duration: this.duration - }; - }, - - /** - * Destroys this object by removing references to external resources and callbacks. - * - * @method Phaser.Animations.AnimationFrame#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.frame = undefined; - } - -}); - -module.exports = AnimationFrame; - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(14); +var BlendModes = __webpack_require__(15); /** * Provides methods used for setting the blend mode of a Game Object. @@ -39137,7 +37824,7 @@ module.exports = BlendMode; /***/ }), -/* 310 */ +/* 292 */ /***/ (function(module, exports) { /** @@ -39262,7 +37949,7 @@ module.exports = Crop; /***/ }), -/* 311 */ +/* 293 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39273,7 +37960,7 @@ module.exports = Crop; var Rectangle = __webpack_require__(24); var RotateAround = __webpack_require__(38); -var Vector2 = __webpack_require__(1); +var Vector2 = __webpack_require__(2); /** * Provides methods used for obtaining the bounds of a Game Object. @@ -39621,7 +38308,7 @@ module.exports = GetBounds; /***/ }), -/* 312 */ +/* 294 */ /***/ (function(module, exports) { /** @@ -39656,7 +38343,7 @@ module.exports = Contains; /***/ }), -/* 313 */ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39665,8 +38352,8 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(60); -var Perimeter = __webpack_require__(61); +var GetPoint = __webpack_require__(59); +var Perimeter = __webpack_require__(60); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -39710,7 +38397,7 @@ module.exports = GetPoints; /***/ }), -/* 314 */ +/* 296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -39720,11 +38407,11 @@ module.exports = GetPoints; */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(315); -var GetPoints = __webpack_require__(316); +var GetPoint = __webpack_require__(297); +var GetPoints = __webpack_require__(298); var GEOM_CONST = __webpack_require__(25); -var Random = __webpack_require__(318); -var Vector2 = __webpack_require__(1); +var Random = __webpack_require__(300); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -40047,7 +38734,7 @@ module.exports = Line; /***/ }), -/* 315 */ +/* 297 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40086,7 +38773,7 @@ module.exports = GetPoint; /***/ }), -/* 316 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40095,7 +38782,7 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(317); +var Length = __webpack_require__(299); var Point = __webpack_require__(9); /** @@ -40151,7 +38838,7 @@ module.exports = GetPoints; /***/ }), -/* 317 */ +/* 299 */ /***/ (function(module, exports) { /** @@ -40179,7 +38866,7 @@ module.exports = Length; /***/ }), -/* 318 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40219,7 +38906,7 @@ module.exports = Random; /***/ }), -/* 319 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40257,7 +38944,7 @@ module.exports = Random; /***/ }), -/* 320 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40266,8 +38953,8 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(321); -var GeometryMask = __webpack_require__(339); +var BitmapMask = __webpack_require__(303); +var GeometryMask = __webpack_require__(321); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -40294,10 +38981,10 @@ var Mask = { * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @@ -40343,6 +39030,8 @@ var Mask = { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -40353,7 +39042,7 @@ var Mask = { * * @method Phaser.GameObjects.Components.Mask#createBitmapMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. * * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. @@ -40377,12 +39066,12 @@ var Mask = { * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. @@ -40404,7 +39093,7 @@ module.exports = Mask; /***/ }), -/* 321 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40414,7 +39103,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(322); +var GameEvents = __webpack_require__(304); /** * @classdesc @@ -40433,6 +39122,9 @@ var GameEvents = __webpack_require__(322); * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -40555,36 +39247,73 @@ var BitmapMask = new Class({ */ this.isStencil = false; - if (renderer && renderer.gl) + this.createMask(); + + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + }, + + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + * + * @method Phaser.Display.Masks.BitmapMask#createMask + * @since 3.50.0 + */ + createMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl) { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) - { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - }, this); + return; } + + if (this.mainTexture) + { + this.clearMask(); + } + + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + }, + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + * + * @method Phaser.Display.Masks.BitmapMask#clearMask + * @since 3.50.0 + */ + clearMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl || !this.mainTexture) + { + return; + } + + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; }, /** @@ -40614,7 +39343,7 @@ var BitmapMask = new Class({ */ preRenderWebGL: function (renderer, maskedObject, camera) { - renderer.pipelines.BitmapMaskPipeline.beginMask(this, maskedObject, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); }, /** @@ -40629,7 +39358,7 @@ var BitmapMask = new Class({ */ postRenderWebGL: function (renderer, camera) { - renderer.pipelines.BitmapMaskPipeline.endMask(this, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera); }, /** @@ -40662,7 +39391,7 @@ var BitmapMask = new Class({ /** * Destroys this BitmapMask and nulls any references it holds. - * + * * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, * so be sure to call `clearMask` on any Game Object using it, before destroying it. * @@ -40671,22 +39400,9 @@ var BitmapMask = new Class({ */ destroy: function () { + this.clearMask(); + this.bitmapMask = null; - - var renderer = this.renderer; - - if (renderer && renderer.gl) - { - renderer.deleteTexture(this.mainTexture); - renderer.deleteTexture(this.maskTexture); - renderer.deleteFramebuffer(this.mainFramebuffer); - renderer.deleteFramebuffer(this.maskFramebuffer); - } - - this.mainTexture = null; - this.maskTexture = null; - this.mainFramebuffer = null; - this.maskFramebuffer = null; this.prevFramebuffer = null; this.renderer = null; } @@ -40697,7 +39413,7 @@ module.exports = BitmapMask; /***/ }), -/* 322 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40712,28 +39428,28 @@ module.exports = BitmapMask; module.exports = { - BLUR: __webpack_require__(323), - BOOT: __webpack_require__(324), - CONTEXT_LOST: __webpack_require__(325), - CONTEXT_RESTORED: __webpack_require__(326), - DESTROY: __webpack_require__(327), - FOCUS: __webpack_require__(328), - HIDDEN: __webpack_require__(329), - PAUSE: __webpack_require__(330), - POST_RENDER: __webpack_require__(331), - POST_STEP: __webpack_require__(332), - PRE_RENDER: __webpack_require__(333), - PRE_STEP: __webpack_require__(334), - READY: __webpack_require__(335), - RESUME: __webpack_require__(336), - STEP: __webpack_require__(337), - VISIBLE: __webpack_require__(338) + BLUR: __webpack_require__(305), + BOOT: __webpack_require__(306), + CONTEXT_LOST: __webpack_require__(307), + CONTEXT_RESTORED: __webpack_require__(308), + DESTROY: __webpack_require__(309), + FOCUS: __webpack_require__(310), + HIDDEN: __webpack_require__(311), + PAUSE: __webpack_require__(312), + POST_RENDER: __webpack_require__(313), + POST_STEP: __webpack_require__(314), + PRE_RENDER: __webpack_require__(315), + PRE_STEP: __webpack_require__(316), + READY: __webpack_require__(317), + RESUME: __webpack_require__(318), + STEP: __webpack_require__(319), + VISIBLE: __webpack_require__(320) }; /***/ }), -/* 323 */ +/* 305 */ /***/ (function(module, exports) { /** @@ -40756,7 +39472,7 @@ module.exports = 'blur'; /***/ }), -/* 324 */ +/* 306 */ /***/ (function(module, exports) { /** @@ -40778,7 +39494,7 @@ module.exports = 'boot'; /***/ }), -/* 325 */ +/* 307 */ /***/ (function(module, exports) { /** @@ -40801,7 +39517,7 @@ module.exports = 'contextlost'; /***/ }), -/* 326 */ +/* 308 */ /***/ (function(module, exports) { /** @@ -40824,7 +39540,7 @@ module.exports = 'contextrestored'; /***/ }), -/* 327 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -40847,7 +39563,7 @@ module.exports = 'destroy'; /***/ }), -/* 328 */ +/* 310 */ /***/ (function(module, exports) { /** @@ -40869,7 +39585,7 @@ module.exports = 'focus'; /***/ }), -/* 329 */ +/* 311 */ /***/ (function(module, exports) { /** @@ -40895,7 +39611,7 @@ module.exports = 'hidden'; /***/ }), -/* 330 */ +/* 312 */ /***/ (function(module, exports) { /** @@ -40916,7 +39632,7 @@ module.exports = 'pause'; /***/ }), -/* 331 */ +/* 313 */ /***/ (function(module, exports) { /** @@ -40942,7 +39658,7 @@ module.exports = 'postrender'; /***/ }), -/* 332 */ +/* 314 */ /***/ (function(module, exports) { /** @@ -40967,7 +39683,7 @@ module.exports = 'poststep'; /***/ }), -/* 333 */ +/* 315 */ /***/ (function(module, exports) { /** @@ -40992,7 +39708,7 @@ module.exports = 'prerender'; /***/ }), -/* 334 */ +/* 316 */ /***/ (function(module, exports) { /** @@ -41017,7 +39733,7 @@ module.exports = 'prestep'; /***/ }), -/* 335 */ +/* 317 */ /***/ (function(module, exports) { /** @@ -41039,7 +39755,7 @@ module.exports = 'ready'; /***/ }), -/* 336 */ +/* 318 */ /***/ (function(module, exports) { /** @@ -41060,7 +39776,7 @@ module.exports = 'resume'; /***/ }), -/* 337 */ +/* 319 */ /***/ (function(module, exports) { /** @@ -41085,7 +39801,7 @@ module.exports = 'step'; /***/ }), -/* 338 */ +/* 320 */ /***/ (function(module, exports) { /** @@ -41109,7 +39825,7 @@ module.exports = 'visible'; /***/ }), -/* 339 */ +/* 321 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41199,7 +39915,7 @@ var GeometryMask = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. - * + * * @return {this} This Geometry Mask */ setShape: function (graphicsGeometry) @@ -41217,7 +39933,7 @@ var GeometryMask = new Class({ * @since 3.17.0 * * @param {boolean} [value=true] - Invert the alpha of this mask? - * + * * @return {this} This Geometry Mask */ setInvertAlpha: function (value) @@ -41296,7 +40012,7 @@ var GeometryMask = new Class({ } // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + geometryMask.renderWebGL(renderer, geometryMask, camera); renderer.flush(); @@ -41340,32 +40056,32 @@ var GeometryMask = new Class({ renderer.maskCount--; + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + if (renderer.maskStack.length === 0) { // If this is the only mask in the stack, flush and disable - renderer.flush(); - - renderer.currentMask.mask = null; + current.mask = null; gl.disable(gl.STENCIL_TEST); } else { - // Force flush before disabling stencil test - renderer.flush(); - var prev = renderer.maskStack[renderer.maskStack.length - 1]; prev.mask.applyStencil(renderer, prev.camera, false); if (renderer.currentCameraMask.mask !== prev.mask) { - renderer.currentMask.mask = prev.mask; - renderer.currentMask.camera = prev.camera; + current.mask = prev.mask; + current.camera = prev.camera; } else { - renderer.currentMask.mask = null; + current.mask = null; } } }, @@ -41386,7 +40102,7 @@ var GeometryMask = new Class({ renderer.currentContext.save(); - geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); renderer.currentContext.clip(); }, @@ -41424,7 +40140,7 @@ module.exports = GeometryMask; /***/ }), -/* 340 */ +/* 322 */ /***/ (function(module, exports) { /** @@ -41627,7 +40343,7 @@ module.exports = Origin; /***/ }), -/* 341 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41636,11 +40352,11 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(17); -var GetBoolean = __webpack_require__(342); -var GetValue = __webpack_require__(6); -var TWEEN_CONST = __webpack_require__(343); -var Vector2 = __webpack_require__(1); +var DegToRad = __webpack_require__(18); +var GetBoolean = __webpack_require__(324); +var GetValue = __webpack_require__(7); +var TWEEN_CONST = __webpack_require__(325); +var Vector2 = __webpack_require__(2); /** * Provides methods used for managing a Game Object following a Path. @@ -42054,7 +40770,7 @@ module.exports = PathFollower; /***/ }), -/* 342 */ +/* 324 */ /***/ (function(module, exports) { /** @@ -42095,7 +40811,7 @@ module.exports = GetBoolean; /***/ }), -/* 343 */ +/* 325 */ /***/ (function(module, exports) { /** @@ -42267,8 +40983,8 @@ module.exports = TWEEN_CONST; /***/ }), -/* 344 */ -/***/ (function(module, exports) { +/* 326 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -42276,6 +40992,8 @@ module.exports = TWEEN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var PIPELINE_CONST = __webpack_require__(327); + /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. * @@ -42317,19 +41035,20 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} [pipelineName=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (pipelineName) + initPipeline: function (name) { - if (pipelineName === undefined) { pipelineName = 'MultiPipeline'; } + if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.defaultPipeline = renderer.getPipeline(pipelineName); + this.defaultPipeline = pipelines.get(name); this.pipeline = this.defaultPipeline; return true; @@ -42345,17 +41064,18 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} pipelineName - The name of the pipeline to set on this Game Object. + * @param {string} name - The name of the pipeline to set on this Game Object. * * @return {this} This Game Object instance. */ - setPipeline: function (pipelineName) + setPipeline: function (name) { var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.pipeline = renderer.getPipeline(pipelineName); + this.pipeline = pipelines.get(name); } return this; @@ -42397,7 +41117,74 @@ module.exports = Pipeline; /***/ }), -/* 345 */ +/* 327 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PIPELINE_CONST = { + + /** + * The Bitmap Mask Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', + + /** + * The Light 2D Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + LIGHT_PIPELINE: 'Light2D', + + /** + * The Single Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + SINGLE_PIPELINE: 'SinglePipeline', + + /** + * The Multi Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + MULTI_PIPELINE: 'MultiPipeline', + + /** + * The Rope Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + ROPE_PIPELINE: 'RopePipeline' + +}; + +module.exports = PIPELINE_CONST; + + +/***/ }), +/* 328 */ /***/ (function(module, exports) { /** @@ -42584,7 +41371,7 @@ module.exports = Size; /***/ }), -/* 346 */ +/* 329 */ /***/ (function(module, exports) { /** @@ -42714,7 +41501,7 @@ module.exports = Texture; /***/ }), -/* 347 */ +/* 330 */ /***/ (function(module, exports) { /** @@ -42922,8 +41709,8 @@ module.exports = TextureCrop; /***/ }), -/* 348 */ -/***/ (function(module, exports, __webpack_require__) { +/* 331 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -42931,8 +41718,6 @@ module.exports = TextureCrop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColorFromValue = __webpack_require__(349); - /** * Provides methods used for setting the tint of a Game Object. * Should be applied as a mixin and not used directly. @@ -42945,62 +41730,58 @@ var GetColorFromValue = __webpack_require__(349); var Tint = { /** - * Private internal value. Holds the top-left tint value. + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTL + * @name Phaser.GameObjects.Components.Tint#tintTopLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTL: 16777215, + tintTopLeft: 0xffffff, /** - * Private internal value. Holds the top-right tint value. + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTR + * @name Phaser.GameObjects.Components.Tint#tintTopRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTR: 16777215, + tintTopRight: 0xffffff, /** - * Private internal value. Holds the bottom-left tint value. + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBL + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBL: 16777215, + tintBottomLeft: 0xffffff, /** - * Private internal value. Holds the bottom-right tint value. + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBR + * @name Phaser.GameObjects.Components.Tint#tintBottomRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBR: 16777215, + tintBottomRight: 0xffffff, /** - * Private internal value. Holds if the Game Object is tinted or not. + * The tint fill mode. * - * @name Phaser.GameObjects.Components.Tint#_isTinted - * @type {boolean} - * @private - * @default false - * @since 3.11.0 - */ - _isTinted: false, - - /** - * Fill or additive? + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Components.Tint#tintFill * @type {boolean} @@ -43025,8 +41806,6 @@ var Tint = { { this.setTint(0xffffff); - this._isTinted = false; - return this; }, @@ -43068,12 +41847,10 @@ var Tint = { bottomRight = topLeft; } - this._tintTL = GetColorFromValue(topLeft); - this._tintTR = GetColorFromValue(topRight); - this._tintBL = GetColorFromValue(bottomLeft); - this._tintBR = GetColorFromValue(bottomRight); - - this._isTinted = true; + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; this.tintFill = false; @@ -43117,102 +41894,6 @@ var Tint = { return this; }, - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopLeft: { - - get: function () - { - return this._tintTL; - }, - - set: function (value) - { - this._tintTL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopRight: { - - get: function () - { - return this._tintTR; - }, - - set: function (value) - { - this._tintTR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomLeft: { - - get: function () - { - return this._tintBL; - }, - - set: function (value) - { - this._tintBL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomRight: { - - get: function () - { - return this._tintBR; - }, - - set: function (value) - { - this._tintBR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. @@ -43231,7 +41912,10 @@ var Tint = { }, /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. * * @name Phaser.GameObjects.Components.Tint#isTinted * @type {boolean} @@ -43243,7 +41927,15 @@ var Tint = { get: function () { - return this._isTinted; + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); } } @@ -43254,36 +41946,7 @@ module.exports = Tint; /***/ }), -/* 349 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a hex color value, such as 0xff00ff (for purple), it will return a - * numeric representation of it (i.e. 16711935) for use in WebGL tinting. - * - * @function Phaser.Display.Color.GetColorFromValue - * @since 3.50.0 - * - * @param {number} red - The hex color value, such as 0xff0000. - * - * @return {number} The combined color value. - */ -var GetColorFromValue = function (value) -{ - return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); -}; - -module.exports = GetColorFromValue; - - -/***/ }), -/* 350 */ +/* 332 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43293,15 +41956,15 @@ module.exports = GetColorFromValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(3); -var renderCanvas = __webpack_require__(3); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (false) {} if (true) { - renderCanvas = __webpack_require__(351); + renderCanvas = __webpack_require__(333); } module.exports = { @@ -43313,7 +41976,7 @@ module.exports = { /***/ }), -/* 351 */ +/* 333 */ /***/ (function(module, exports) { /** @@ -43334,11 +41997,10 @@ module.exports = { * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -43403,7 +42065,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); @@ -43420,7 +42082,7 @@ module.exports = ContainerCanvasRenderer; /***/ }), -/* 352 */ +/* 334 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43462,7 +42124,7 @@ module.exports = Union; /***/ }), -/* 353 */ +/* 335 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43471,15 +42133,15 @@ module.exports = Union; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(3); -var renderCanvas = __webpack_require__(3); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (false) {} if (true) { - renderCanvas = __webpack_require__(354); + renderCanvas = __webpack_require__(336); } module.exports = { @@ -43491,7 +42153,7 @@ module.exports = { /***/ }), -/* 354 */ +/* 336 */ /***/ (function(module, exports) { /** @@ -43511,11 +42173,10 @@ module.exports = { * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -43580,7 +42241,7 @@ var SpineContainerCanvasRenderer = function (renderer, container, interpolationP child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); diff --git a/plugins/spine/dist/SpineCanvasPlugin.min.js b/plugins/spine/dist/SpineCanvasPlugin.min.js index e727c3e5a..836f9a75b 100644 --- a/plugins/spine/dist/SpineCanvasPlugin.min.js +++ b/plugins/spine/dist/SpineCanvasPlugin.min.js @@ -1 +1 @@ -window.SpinePlugin=function(n){var i={};function r(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=n,r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=62)}([function(t,e){function s(t,e,n,i){for(var r in e)if(e.hasOwnProperty(r)){var s=(l=e,u=r,d=f=void 0,d=(c=n)?l[u]:Object.getOwnPropertyDescriptor(l,u),!c&&d.value&&"object"==typeof d.value&&(d=d.value),!(!d||!((f=d).get&&"function"==typeof f.get||f.set&&"function"==typeof f.set))&&(void 0===d.enumerable&&(d.enumerable=!0),void 0===d.configurable&&(d.configurable=!0),d));if(!1!==s){if(a=(i||t).prototype,o=r,h=void 0,(h=Object.getOwnPropertyDescriptor(a,o))&&(h.value&&"object"==typeof h.value&&(h=h.value),!1===h.configurable)){if(p.ignoreFinals)continue;throw new Error("cannot override final property '"+r+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,r,s)}else t.prototype[r]=e[r]}var a,o,h,l,u,c,f,d}function a(t,e){if(e){Array.isArray(e)||(e=[e]);for(var n=0;n=t.length)){for(var n=t.length-1,i=t[e],r=e;rMath.PI&&(t-=i.PI2),Math.abs(((t+i.TAU)%i.PI2-i.PI2)%i.PI2)}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,n){var i=n(2);t.exports=function(t){return t*i.DEG_TO_RAD}},function(t,e,n){var i=n(2);t.exports=function(t){return t*i.RAD_TO_DEG}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new i(this.x,this.y,this.z)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return Math.sqrt(e*e+n*n+i*i)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return e*e+n*n+i*i},length:function(){var t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)},lengthSq:function(){var t=this.x,e=this.y,n=this.z;return t*t+e*e+n*n},normalize:function(){var t=this.x,e=this.y,n=this.z,i=t*t+e*e+n*n;return 0=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e,n){var u=n(7),c=function(){var t,e,n,i,r,s,a=arguments[0]||{},o=1,h=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},o=2),h===o&&(a=this,--o);os[0]&&(e=1),s[8]>s[3*e+e]&&(e=2),n=o[e],i=o[n],r=Math.sqrt(s[3*e+e]-s[3*n+n]-s[3*i+i]+1),h[e]=.5*r,r=.5/r,h[n]=(s[3*n+e]+s[3*e+n])*r,h[i]=(s[3*i+e]+s[3*e+i])*r,this.x=h[0],this.y=h[1],this.z=h[2],this.w=(s[3*i+n]-s[3*n+i])*r),this}});t.exports=f},function(t,e,n){var r=n(26),s=n(45);t.exports=function(t,e){var n=void 0===t?s():r({},t);if(e)for(var i in e)void 0!==e[i]&&(n[i]=e[i]);return n}},function(t,e){t.exports=function(t,e,n,i,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:n,password:i,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){var n={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=n},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var n={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=n},function(t,e,n){var i=n(2),r=n(51),h=n(40),s=n(29),a=n(30),l=n(1),o={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*i.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*i.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,n,i){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=n,this.w=i,this},setRandomPosition:function(t,e,n,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=this.scene.sys.scale.width),void 0===i&&(i=this.scene.sys.scale.height),this.x=t+Math.random()*n,this.y=e+Math.random()*i,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var n=this.parentContainer;if(!n)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);n;)e.applyITRS(n.x,n.y,n._rotation,n._scaleX,n._scaleY),e.multiply(t,t),n=n.parentContainer;return t},getLocalPoint:function(t,e,n,i){n=n||new l;var r=(i=i||this.scene.sys.cameras.main).scrollX,s=i.scrollY,a=t+r*this.scrollFactorX-r,o=e+s*this.scrollFactorY-s;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,o,n):h(a,o,this.x,this.y,this.rotation,this.scaleX,this.scaleY,n),this._originComponent&&(n.x+=this._displayOriginX,n.y+=this._displayOriginY),n},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=o},function(t,e,n){var i=n(0),s=n(2),c=n(1),r=new i({initialize:function(t,e,n,i,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,n,i,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],n=t[1],i=t[2],r=t[3];return e||n?0e.length&&(s=e.length),n?(i=e[s-1][n],(r=e[s][n])-t<=t-i?e[s]:e[s-1]):(i=e[s-1],(r=e[s])-t<=t-i?r:i)}},function(t,e){t.exports=function(t){for(var e=t.length-1;0=i.PI2-n?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,n=(e*=n)>>>0,n+=4294967296*(e-=n);return 2.3283064365386963e-10*((this.n=n)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}function Dt(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}function Kt(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new V.Vector2,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var n=0;n>>1;;){if(t[(s+1)*n]<=e?i=s+1:r=s,i==r)return(i+1)*n;s=i+r>>>1}},r.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;return-1},r);function r(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var i=0;i 0: "+t);this.curves=B.Utils.newFloatArray((t-1)*y.BEZIER_SIZE)}B.CurveTimeline=s;var a,o=(_t(v,a=s),v.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},v.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+v.ROTATION]=n},v.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-v.ENTRIES]){var u=o[o.length+v.PREV_ROTATION];switch(s){case U.setup:h.rotation=h.data.rotation+u*r;break;case U.first:case U.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case U.add:h.rotation+=u*r}}else{var c=z.binarySearch(o,n,v.ENTRIES),f=o[c+v.PREV_ROTATION],d=o[c],p=this.getCurvePercent((c>>1)-1,1-(n-d)/(o[c+v.PREV_TIME]-d)),m=f+((m=o[c+v.ROTATION]-f)-360*(16384-(16384.499999999996-m/360|0)))*p;switch(s){case U.setup:h.rotation=h.data.rotation+(m-360*(16384-(16384.499999999996-m/360|0)))*r;break;case U.first:case U.replace:m+=h.data.rotation-h.rotation;case U.add:h.rotation+=(m-360*(16384-(16384.499999999996-m/360|0)))*r}}},v.ENTRIES=2,v.PREV_TIME=-2,v.PREV_ROTATION=-1,v.ROTATION=1,v);function v(t){var e=a.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t<<1),e}B.RotateTimeline=o;var h,l=(_t(p,h=s),p.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},p.prototype.setFrame=function(t,e,n,i){t*=p.ENTRIES,this.frames[t]=e,this.frames[t+p.X]=n,this.frames[t+p.Y]=i},p.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-p.ENTRIES]?(f=o[o.length+p.PREV_X],d=o[o.length+p.PREV_Y]):(f=o[(l=z.binarySearch(o,n,p.ENTRIES))+p.PREV_X],d=o[l+p.PREV_Y],u=o[l],c=this.getCurvePercent(l/p.ENTRIES-1,1-(n-u)/(o[l+p.PREV_TIME]-u)),f+=(o[l+p.X]-f)*c,d+=(o[l+p.Y]-d)*c),s){case U.setup:h.x=h.data.x+f*r,h.y=h.data.y+d*r;break;case U.first:case U.replace:h.x+=(h.data.x+f-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case U.add:h.x+=f*r,h.y+=d*r}}},p.ENTRIES=3,p.PREV_TIME=-3,p.PREV_X=-2,p.PREV_Y=-1,p.X=1,p.Y=2,p);function p(t){var e=h.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*p.ENTRIES),e}B.TranslateTimeline=l;var u,c=(_t(x,u=l),x.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},x.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-x.ENTRIES]?(f=o[o.length+x.PREV_X]*h.data.scaleX,o[o.length+x.PREV_Y]*h.data.scaleY):(f=o[(l=z.binarySearch(o,n,x.ENTRIES))+x.PREV_X],d=o[l+x.PREV_Y],u=o[l],c=this.getCurvePercent(l/x.ENTRIES-1,1-(n-u)/(o[l+x.PREV_TIME]-u)),f=(f+(o[l+x.X]-f)*c)*h.data.scaleX,(d+(o[l+x.Y]-d)*c)*h.data.scaleY),1==r)s==U.add?(h.scaleX+=f-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=f,h.scaleY=d);else{var p=0,m=0;if(a==g.mixOut)switch(s){case U.setup:p=h.data.scaleX,m=h.data.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-p)*r,h.scaleY=m+(Math.abs(d)*B.MathUtils.signum(m)-m)*r;break;case U.first:case U.replace:p=h.scaleX,m=h.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-p)*r,h.scaleY=m+(Math.abs(d)*B.MathUtils.signum(m)-m)*r;break;case U.add:p=h.scaleX,m=h.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-h.data.scaleX)*r,h.scaleY=m+(Math.abs(d)*B.MathUtils.signum(m)-h.data.scaleY)*r}else switch(s){case U.setup:p=Math.abs(h.data.scaleX)*B.MathUtils.signum(f),m=Math.abs(h.data.scaleY)*B.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=m+(d-m)*r;break;case U.first:case U.replace:p=Math.abs(h.scaleX)*B.MathUtils.signum(f),m=Math.abs(h.scaleY)*B.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=m+(d-m)*r;break;case U.add:p=B.MathUtils.signum(f),m=B.MathUtils.signum(d),h.scaleX=Math.abs(h.scaleX)*p+(f-Math.abs(h.data.scaleX)*p)*r,h.scaleY=Math.abs(h.scaleY)*m+(d-Math.abs(h.data.scaleY)*m)*r}}}},x);function x(t){return u.call(this,t)||this}B.ScaleTimeline=c;var f,d=(_t(m,f=l),m.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},m.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-m.ENTRIES]?(f=o[o.length+m.PREV_X],d=o[o.length+m.PREV_Y]):(f=o[(l=z.binarySearch(o,n,m.ENTRIES))+m.PREV_X],d=o[l+m.PREV_Y],u=o[l],c=this.getCurvePercent(l/m.ENTRIES-1,1-(n-u)/(o[l+m.PREV_TIME]-u)),f+=(o[l+m.X]-f)*c,d+=(o[l+m.Y]-d)*c),s){case U.setup:h.shearX=h.data.shearX+f*r,h.shearY=h.data.shearY+d*r;break;case U.first:case U.replace:h.shearX+=(h.data.shearX+f-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case U.add:h.shearX+=f*r,h.shearY+=d*r}}},m);function m(t){return f.call(this,t)||this}B.ShearTimeline=d;var w,M=(_t(T,w=s),T.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},T.prototype.setFrame=function(t,e,n,i,r,s){t*=T.ENTRIES,this.frames[t]=e,this.frames[t+T.R]=n,this.frames[t+T.G]=i,this.frames[t+T.B]=r,this.frames[t+T.A]=s},T.prototype.apply=function(t,e,n,i,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-T.ENTRIES]?(m=h[(c=h.length)+T.PREV_R],g=h[c+T.PREV_G],v=h[c+T.PREV_B],y=h[c+T.PREV_A]):(m=h[(f=z.binarySearch(h,n,T.ENTRIES))+T.PREV_R],g=h[f+T.PREV_G],v=h[f+T.PREV_B],y=h[f+T.PREV_A],d=h[f],p=this.getCurvePercent(f/T.ENTRIES-1,1-(n-d)/(h[f+T.PREV_TIME]-d)),m+=(h[f+T.R]-m)*p,g+=(h[f+T.G]-g)*p,v+=(h[f+T.B]-v)*p,y+=(h[f+T.A]-y)*p),1==r?o.color.set(m,g,v,y):(l=o.color,s==U.setup&&l.setFromColor(o.data.color),l.add((m-l.r)*r,(g-l.g)*r,(v-l.b)*r,(y-l.a)*r))}}},T.ENTRIES=5,T.PREV_TIME=-5,T.PREV_R=-4,T.PREV_G=-3,T.PREV_B=-2,T.PREV_A=-1,T.R=1,T.G=2,T.B=3,T.A=4,T);function T(t){var e=w.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*T.ENTRIES),e}B.ColorTimeline=M;var E,A=(_t(R,E=s),R.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},R.prototype.setFrame=function(t,e,n,i,r,s,a,o,h){t*=R.ENTRIES,this.frames[t]=e,this.frames[t+R.R]=n,this.frames[t+R.G]=i,this.frames[t+R.B]=r,this.frames[t+R.A]=s,this.frames[t+R.R2]=a,this.frames[t+R.G2]=o,this.frames[t+R.B2]=h},R.prototype.apply=function(t,e,n,i,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-R.ENTRIES]?(v=h[(d=h.length)+R.PREV_R],y=h[d+R.PREV_G],x=h[d+R.PREV_B],w=h[d+R.PREV_A],M=h[d+R.PREV_R2],T=h[d+R.PREV_G2],E=h[d+R.PREV_B2]):(v=h[(p=z.binarySearch(h,n,R.ENTRIES))+R.PREV_R],y=h[p+R.PREV_G],x=h[p+R.PREV_B],w=h[p+R.PREV_A],M=h[p+R.PREV_R2],T=h[p+R.PREV_G2],E=h[p+R.PREV_B2],m=h[p],g=this.getCurvePercent(p/R.ENTRIES-1,1-(n-m)/(h[p+R.PREV_TIME]-m)),v+=(h[p+R.R]-v)*g,y+=(h[p+R.G]-y)*g,x+=(h[p+R.B]-x)*g,w+=(h[p+R.A]-w)*g,M+=(h[p+R.R2]-M)*g,T+=(h[p+R.G2]-T)*g,E+=(h[p+R.B2]-E)*g),1==r?(o.color.set(v,y,x,w),o.darkColor.set(M,T,E,1)):(l=o.color,u=o.darkColor,s==U.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((v-l.r)*r,(y-l.g)*r,(x-l.b)*r,(w-l.a)*r),u.add((M-u.r)*r,(T-u.g)*r,(E-u.b)*r,0))}}},R.ENTRIES=8,R.PREV_TIME=-8,R.PREV_R=-7,R.PREV_G=-6,R.PREV_B=-5,R.PREV_A=-4,R.PREV_R2=-3,R.PREV_G2=-2,R.PREV_B2=-1,R.R=1,R.G=2,R.B=3,R.A=4,R.R2=5,R.G2=6,R.B2=7,R);function R(t){var e=E.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*R.ENTRIES),e}B.TwoColorTimeline=A;var S=(b.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},b.prototype.getFrameCount=function(){return this.frames.length},b.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},b.prototype.apply=function(t,e,n,i,r,s,a){var o,h,l,u=t.slots[this.slotIndex];u.bone.active&&(a!=g.mixOut?n<(o=this.frames)[0]?s!=U.setup&&s!=U.first||this.setAttachment(t,u,u.data.attachmentName):(h=0,h=n>=o[o.length-1]?o.length-1:z.binarySearch(o,n,1)-1,l=this.attachmentNames[h],t.slots[this.slotIndex].setAttachment(null==l?null:t.getAttachment(this.slotIndex,l))):s==U.setup&&this.setAttachment(t,u,u.data.attachmentName))},b.prototype.setAttachment=function(t,e,n){e.attachment=null==n?null:t.getAttachment(this.slotIndex,n)},b);function b(t){this.frames=B.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}B.AttachmentTimeline=S;var I,C=null,P=(_t(_,I=s),_.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},_.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},_.prototype.apply=function(t,e,n,i,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof B.VertexAttachment&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(s=U.setup);var u=this.frameVertices,c=u[0].length,f=this.frames;if(n=f[f.length-1]){var y=u[f.length-1];if(1==r)if(s==U.add)if(null==(d=h).bones)for(var m=d.vertices,x=0;x=o[h-1])return;if(!(n=o[l];l++)i.push(this.events[l])}}},F);function F(t){this.frames=B.Utils.newFloatArray(t),this.events=new Array(t)}B.EventTimeline=k;var O=(L.prototype.getPropertyId=function(){return n.drawOrder<<24},L.prototype.getFrameCount=function(){return this.frames.length},L.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},L.prototype.apply=function(t,e,n,i,r,s,a){var o=t.drawOrder,h=t.slots;if(a!=g.mixOut){var l=this.frames;if(n=l[l.length-1]?l.length-1:z.binarySearch(l,n)-1,c=this.drawOrders[u];if(null==c)B.Utils.arrayCopy(h,0,o,0,h.length);else for(var f=0,d=c.length;f=f[f.length-V.ENTRIES]?s==U.setup?(d.mix=d.data.mix+(f[f.length+V.PREV_MIX]-d.data.mix)*r,d.softness=d.data.softness+(f[f.length+V.PREV_SOFTNESS]-d.data.softness)*r,a==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[f.length+V.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+V.PREV_COMPRESS],d.stretch=0!=f[f.length+V.PREV_STRETCH])):(d.mix+=(f[f.length+V.PREV_MIX]-d.mix)*r,d.softness+=(f[f.length+V.PREV_SOFTNESS]-d.softness)*r,a==g.mixIn&&(d.bendDirection=f[f.length+V.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+V.PREV_COMPRESS],d.stretch=0!=f[f.length+V.PREV_STRETCH])):(h=f[(o=z.binarySearch(f,n,V.ENTRIES))+V.PREV_MIX],l=f[o+V.PREV_SOFTNESS],u=f[o],c=this.getCurvePercent(o/V.ENTRIES-1,1-(n-u)/(f[o+V.PREV_TIME]-u)),s==U.setup?(d.mix=d.data.mix+(h+(f[o+V.MIX]-h)*c-d.data.mix)*r,d.softness=d.data.softness+(l+(f[o+V.SOFTNESS]-l)*c-d.data.softness)*r,a==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[o+V.PREV_BEND_DIRECTION],d.compress=0!=f[o+V.PREV_COMPRESS],d.stretch=0!=f[o+V.PREV_STRETCH])):(d.mix+=(h+(f[o+V.MIX]-h)*c-d.mix)*r,d.softness+=(l+(f[o+V.SOFTNESS]-l)*c-d.softness)*r,a==g.mixIn&&(d.bendDirection=f[o+V.PREV_BEND_DIRECTION],d.compress=0!=f[o+V.PREV_COMPRESS],d.stretch=0!=f[o+V.PREV_STRETCH])))},V.ENTRIES=6,V.PREV_TIME=-6,V.PREV_MIX=-5,V.PREV_SOFTNESS=-4,V.PREV_BEND_DIRECTION=-3,V.PREV_COMPRESS=-2,V.PREV_STRETCH=-1,V.MIX=1,V.SOFTNESS=2,V.BEND_DIRECTION=3,V.COMPRESS=4,V.STRETCH=5,V);function V(t){var e=N.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*V.ENTRIES),e}B.IkConstraintTimeline=D;var Y,X=(_t(W,Y=s),W.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},W.prototype.setFrame=function(t,e,n,i,r,s){t*=W.ENTRIES,this.frames[t]=e,this.frames[t+W.ROTATE]=n,this.frames[t+W.TRANSLATE]=i,this.frames[t+W.SCALE]=r,this.frames[t+W.SHEAR]=s},W.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(n=o[o.length-W.ENTRIES]?(p=o[(u=o.length)+W.PREV_ROTATE],m=o[u+W.PREV_TRANSLATE],g=o[u+W.PREV_SCALE],v=o[u+W.PREV_SHEAR]):(p=o[(c=z.binarySearch(o,n,W.ENTRIES))+W.PREV_ROTATE],m=o[c+W.PREV_TRANSLATE],g=o[c+W.PREV_SCALE],v=o[c+W.PREV_SHEAR],f=o[c],d=this.getCurvePercent(c/W.ENTRIES-1,1-(n-f)/(o[c+W.PREV_TIME]-f)),p+=(o[c+W.ROTATE]-p)*d,m+=(o[c+W.TRANSLATE]-m)*d,g+=(o[c+W.SCALE]-g)*d,v+=(o[c+W.SHEAR]-v)*d),s==U.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(m-l.translateMix)*r,h.scaleMix=l.scaleMix+(g-l.scaleMix)*r,h.shearMix=l.shearMix+(v-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(m-h.translateMix)*r,h.scaleMix+=(g-h.scaleMix)*r,h.shearMix+=(v-h.shearMix)*r)}},W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4,W);function W(t){var e=Y.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*W.ENTRIES),e}B.TransformConstraintTimeline=X;var q,G=(_t(H,q=s),H.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},H.prototype.setFrame=function(t,e,n){t*=H.ENTRIES,this.frames[t]=e,this.frames[t+H.VALUE]=n},H.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-H.ENTRIES]?f=o[o.length+H.PREV_VALUE]:(f=o[(l=z.binarySearch(o,n,H.ENTRIES))+H.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/H.ENTRIES-1,1-(n-u)/(o[l+H.PREV_TIME]-u)),f+=(o[l+H.VALUE]-f)*c),s==U.setup?h.position=h.data.position+(f-h.data.position)*r:h.position+=(f-h.position)*r}},H.ENTRIES=2,H.PREV_TIME=-2,H.PREV_VALUE=-1,H.VALUE=1,H);function H(t){var e=q.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*H.ENTRIES),e}B.PathConstraintPositionTimeline=G;var j,K=(_t(Z,j=G),Z.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},Z.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-Z.ENTRIES]?f=o[o.length+Z.PREV_VALUE]:(f=o[(l=z.binarySearch(o,n,Z.ENTRIES))+Z.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/Z.ENTRIES-1,1-(n-u)/(o[l+Z.PREV_TIME]-u)),f+=(o[l+Z.VALUE]-f)*c),s==U.setup?h.spacing=h.data.spacing+(f-h.data.spacing)*r:h.spacing+=(f-h.spacing)*r}},Z);function Z(t){return j.call(this,t)||this}B.PathConstraintSpacingTimeline=K;var Q,J=(_t($,Q=s),$.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},$.prototype.setFrame=function(t,e,n,i){t*=$.ENTRIES,this.frames[t]=e,this.frames[t+$.ROTATE]=n,this.frames[t+$.TRANSLATE]=i},$.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-$.ENTRIES]?(f=o[o.length+$.PREV_ROTATE],d=o[o.length+$.PREV_TRANSLATE]):(f=o[(l=z.binarySearch(o,n,$.ENTRIES))+$.PREV_ROTATE],d=o[l+$.PREV_TRANSLATE],u=o[l],c=this.getCurvePercent(l/$.ENTRIES-1,1-(n-u)/(o[l+$.PREV_TIME]-u)),f+=(o[l+$.ROTATE]-f)*c,d+=(o[l+$.TRANSLATE]-d)*c),s==U.setup?(h.rotateMix=h.data.rotateMix+(f-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(f-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}},$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2,$);function $(t){var e=Q.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*$.ENTRIES),e}B.PathConstraintMixTimeline=J}(bt=bt||{}),function(S){var t=(b.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},b.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,0=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},b.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,i=!1,r=0,s=n.length;r=a.trackEnd&&null==a.next&&(h=0);var l=a.animationLast,u=a.getAnimationTime(),c=a.animation.timelines.length,f=a.animation.timelines;if(0==r&&1==h||o==S.MixBlend.add)for(var d=0;d=s[s.length-1]?s.length-1:S.Animation.binarySearch(s,n)-1,this.setAttachment(e,o,t.attachmentNames[a],r)),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+b.SETUP))},b.prototype.setAttachment=function(t,e,n,i){e.attachment=null==n?null:t.getAttachment(e.data.index,n),i&&(e.attachmentState=this.unkeyedState+b.CURRENT)},b.prototype.applyRotateTimeline=function(t,e,n,i,r,s,a,o){if(o&&(s[a]=0),1!=i){var h=t,l=h.frames,u=e.bones[h.boneIndex];if(u.active){var c=0,f=0;if(n=l[l.length-S.RotateTimeline.ENTRIES]?f=u.data.rotation+l[l.length+S.RotateTimeline.PREV_ROTATION]:(p=l[(d=S.Animation.binarySearch(l,n,S.RotateTimeline.ENTRIES))+S.RotateTimeline.PREV_ROTATION],m=l[d],g=h.getCurvePercent((d>>1)-1,1-(n-m)/(l[d+S.RotateTimeline.PREV_TIME]-m)),f=l[d+S.RotateTimeline.ROTATION]-p,f=p+(f-=360*(16384-(16384.499999999996-f/360|0)))*g+u.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0)))}var v,y,x,w,M=0,T=f-c;0==(T-=360*(16384-(16384.499999999996-T/360|0)))?M=s[a]:(y=v=0,y=o?(v=0,T):(v=s[a],s[a+1]),x=0i||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:i<=e&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var i=n.mixingFrom;if(null==i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},b.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),((e.mixingFrom=i).mixingTo=e).mixTime=0,null!=i.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},b.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},b.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);0<=e&&this.listeners.splice(e,1)},b.prototype.clearListeners=function(){this.listeners.length=0},b.prototype.clearListenerNotifications=function(){this.queue.clear()},b.emptyAnimation=new S.Animation("",[],0),b.SUBSEQUENT=0,b.FIRST=1,b.HOLD_SUBSEQUENT=2,b.HOLD_FIRST=3,b.HOLD_MIX=4,b.SETUP=1,b.CURRENT=2,b);function b(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new S.IntSet,this.animationsChanged=!1,this.trackEntryPool=new S.Pool(function(){return new e}),this.data=t}S.AnimationState=t;var e=(n.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},n.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},n.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},n.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n);function n(){this.mixBlend=S.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}S.TrackEntry=e;var o,i,r=(s.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},s.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},s.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},s.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},s.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;nj.MathUtils.PI?Y-=j.MathUtils.PI2:Y<-j.MathUtils.PI&&(Y+=j.MathUtils.PI2),Y*=e,N=Math.cos(Y),D=Math.sin(Y),S.a=N*k-D*O,S.b=N*F-D*L,S.c=D*k+N*O,S.d=D*F+N*L),S.appliedValid=!1}}}},Yt.prototype.computeWorldPositions=function(t,e,n,i,r){var s=this.target,a=this.position,o=this.spaces,h=j.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,f=c/6,d=Yt.NONE;if(!t.constantSpeed){var p=t.lengths,m=p[f-=u?1:2];if(i&&(a*=m),r)for(var g=1;g>>1^-(1&n)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&i)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&i)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(i),n++}}return e},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,n,i){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===i&&(i=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=i}var V=function(t,e,n,i,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(bt=bt||{}),C=bt=bt||{},Wt.prototype.update=function(t,e){if(null==t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,i=this.polygons,r=this.polygonPool,s=t.slots,a=s.length;n.length=0,r.freeAll(i);for(var o=i.length=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},Wt.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=s&&i<=s||a<=t&&a<=n||o<=e&&o<=i)return!1;var h=(i-e)/(n-t),l=h*(r-t)+e;if(st.minX&&this.minYt.minY},Wt.prototype.containsPoint=function(t,e){for(var n=this.polygons,i=0,r=n.length;i>1,V=this.clipOutput,Y=K.Utils.setArraySize(l,P+D*d),X=0;X<_;X+=2){var B=V[X],U=V[X+1];Y[P]=B,Y[P+1]=U,Y[P+2]=s.r,Y[P+3]=s.g,Y[P+4]=s.b,Y[P+5]=s.a;var z=B-R,W=U-S,q=(k*z+F*W)*N,G=(L*z+O*W)*N,H=1-q-G;Y[P+6]=x*q+E*G+b*H,Y[P+7]=w*q+A*G+I*H,o&&(Y[P+8]=a.r,Y[P+9]=a.g,Y[P+10]=a.b,Y[P+11]=a.a),P+=d}P=u.length;var j=K.Utils.setArraySize(u,P+3*(D-2));for(D--,X=1;X>1;o=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},e.prototype.addSkin=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},n.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},n.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var s=e.indexOf(",",r);if(-1==s)break;t[i]=e.substr(r,s-r).trim(),r=s+1}return t[i]=e.substring(r).trim(),i+1},n);function n(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var m=function(){};d.TextureAtlasPage=m;var i,g=(i=d.TextureRegion,_t(r,i),r);function r(){return null!==i&&i.apply(this,arguments)||this}d.TextureAtlasRegion=g}(bt=bt||{}),V=bt=bt||{},Kt.prototype.isActive=function(){return this.active},Kt.prototype.apply=function(){this.update()},Kt.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},Kt.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0V.MathUtils.PI?A-=V.MathUtils.PI2:A<-V.MathUtils.PI&&(A+=V.MathUtils.PI2),A*=t,v=Math.cos(A),y=Math.sin(A),S.a=v*m-y*g,S.b=v*M-y*T,S.c=y*m+v*g,S.d=y*M+v*T,b=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),S.worldX+=(x.x-S.worldX)*e,S.worldY+=(x.y-S.worldY)*e,b=!0),0V.MathUtils.PI?A-=V.MathUtils.PI2:A<-V.MathUtils.PI&&(A+=V.MathUtils.PI2),A=E+(A+c)*i,R=Math.sqrt(M*M+T*T),S.b=Math.cos(A)*R,S.d=Math.sin(A)*R,b=!0),b&&(S.appliedValid=!1)}},Kt.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0V.MathUtils.PI?w-=V.MathUtils.PI2:w<-V.MathUtils.PI&&(w+=V.MathUtils.PI2),w*=t,v=Math.cos(w),y=Math.sin(w),A.a=v*m-y*g,A.b=v*M-y*T,A.c=y*m+v*g,A.d=y*M+v*T,R=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),A.worldX+=x.x*e,A.worldY+=x.y*e,R=!0),0V.MathUtils.PI?w-=V.MathUtils.PI2:w<-V.MathUtils.PI&&(w+=V.MathUtils.PI2),M=A.b,T=A.d,w=Math.atan2(T,M)+(w-V.MathUtils.PI/2+c)*i,E=Math.sqrt(M*M+T*T),A.b=Math.cos(w)*E,A.d=Math.sin(w)*E,R=!0),R&&(A.appliedValid=!1)}},Kt.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a>1,i=this.indicesArray,r=i.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},r.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},r.WHITE=new r(1,1,1,1),r.RED=new r(1,0,0,1),r.GREEN=new r(0,1,0,1),r.BLUE=new r(0,0,1,1),r.MAGENTA=new r(1,0,1,1),r);function r(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}t.Color=i;var s=(a.clamp=function(t,e,n){return t=e?t:g.setArraySize(t,e,n)},g.newArray=function(t,e){for(var n=new Array(t),i=0;ithis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},S.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},S.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f>16&255)/255,r=(t>>8&255)/255,s=(255&t)/255,a=16777215>>24)/255:null,o=this.skeleton;return!e||(n=this.findSlot(e))&&(o=n),o.color.r=i,o.color.g=r,o.color.b=s,null!==a&&(o.color.a=a),this},setSkeletonFromJSON:function(t,e,n,i){return this.setSkeleton(t,e,n,i)},setSkeleton:function(t,e,n,i){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,i);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,n),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,n,i){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===n&&(n=0),void 0===i&&(i=0),this.width=t,this.height=e,this.displayOriginX=r.x-n,this.displayOriginY=r.y-i,this},setOffset:function(t,e){var n=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=n.x-t,this.displayOriginY=n.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,n=this.scaleX,i=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=n,t.scaleY=i,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var n=0;n=(t=t.toString()).length)switch(i){case 1:t=new Array(e+1-t.length).join(n)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(1+(r-s)).join(n)+t+new Array(s+1).join(n);break;default:t+=new Array(e+1-t.length).join(n)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e=t.length)throw new Error("Supplied index out of bounds");return i!==n&&(t.splice(i,1),t.splice(n,0,e)),e}},function(t,e){t.exports=function(t,e){var n,i,r=t.indexOf(e);return-1!==r&&rt.length-1)throw new Error("Index out of bounds");var r=s(t,e);return n&&n.call(i,r),r}},function(t,e,n){var l=n(4);t.exports=function(t,e,n,i,r){if(void 0===e&&(e=0),void 0===n&&(n=t.length),void 0===r&&(r=t),l(t,e,n)){var s=n-e,a=t.splice(e,s);if(i)for(var o=0;o=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),e},updateFrame:function(t){var e,n=this.setCurrentFrame(t);this.isPlaying&&(t.setAlpha&&(n.alpha=t.alpha),e=this.currentAnim,n.emit(s.SPRITE_ANIMATION_KEY_UPDATE+e.key,e,t,n),n.emit(s.SPRITE_ANIMATION_UPDATE,e,t,n),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this))},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(s.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null}});t.exports=a},function(t,e,n){var i=n(5),r=n(0),s=n(55),a=n(59),o=n(57),m=n(308),g=n(6),h=new r({Extends:s,initialize:function(t,e,n){s.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,g(n,"frames",[]),g(n,"defaultTextureKey",null)),this.frameRate=g(n,"frameRate",null),this.duration=g(n,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=g(n,"skipMissedFrames",!0),this.delay=g(n,"delay",0),this.repeat=g(n,"repeat",0),this.repeatDelay=g(n,"repeatDelay",0),this.yoyo=g(n,"yoyo",!1),this.showOnStart=g(n,"showOnStart",!1),this.hideOnComplete=g(n,"hideOnComplete",!1),this.paused=!1,this.manager.on(a.PAUSE_ALL,this.pause,this),this.manager.on(a.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var n,i,r=this.getFrames(this.manager.textureManager,e);return 0=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var n=this.frames[e];0!==e||t.forward||(n=this.getLastFrame()),t.updateFrame(n)},getFrameByProgress:function(t){return t=i(t,0,1),o(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):0=e&&t.y<=n&&t.y+t.height>=n)}},function(t,e,n){var a=n(60),o=n(61);t.exports=function(t,e,n,i){void 0===i&&(i=[]),!e&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,n){var i=n(9);t.exports=function(t,e,n){return void 0===n&&(n=new i),n.x=t.x1+(t.x2-t.x1)*e,n.y=t.y1+(t.y2-t.y1)*e,n}},function(t,e,n){var f=n(317),d=n(9);t.exports=function(t,e,n,i){void 0===i&&(i=[]),!e&&0>16)+(65280&t)+((255&t)<<16)}},function(t,e,n){var i=n(3),r=n(3);r=n(351),t.exports={renderWebGL:i,renderCanvas:r}},function(t,e){t.exports=function(t,e,n,i,r){var s=e.list;if(0!==s.length){var a=e.localTransform;r?(a.loadIdentity(),a.multiply(r),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var h=e._alpha,l=e.scrollFactorX,u=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var c=0;c=t.length)){for(var n=t.length-1,i=t[e],r=e;rMath.PI&&(t-=i.PI2),Math.abs(((t+i.TAU)%i.PI2-i.PI2)%i.PI2)}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,n){var i=n(3);t.exports=function(t){return t*i.DEG_TO_RAD}},function(t,e,n){var i=n(0),r=n(11),s=new i({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},setValues:function(t,e,n,i,r,s,a,o,h,l,u,c,f,d,p,g){var m=this.val;return m[0]=t,m[1]=e,m[2]=n,m[3]=i,m[4]=r,m[5]=s,m[6]=a,m[7]=o,m[8]=h,m[9]=l,m[10]=u,m[11]=c,m[12]=f,m[13]=d,m[14]=p,m[15]=g,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,n){var i=h.fromQuat(n).val,r=e.x,s=e.y,a=e.z;return this.setValues(i[0]*r,i[1]*r,i[2]*r,0,i[4]*s,i[5]*s,i[6]*s,0,i[8]*a,i[9]*a,i[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,n){this.identity();var i=this.val;return i[12]=t,i[13]=e,i[14]=n,this},scaling:function(t,e,n){this.zero();var i=this.val;return i[0]=t,i[5]=e,i[10]=n,i[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],n=t[2],i=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=n,t[9]=r,t[11]=t[14],t[12]=i,t[13]=s,t[14]=a,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15],v=e*a-n*s,y=e*o-i*s,x=e*h-r*s,M=n*o-i*a,w=n*h-r*a,E=i*h-r*o,T=l*p-u*d,A=l*g-c*d,b=l*m-f*d,R=u*g-c*p,S=u*m-f*p,I=c*m-f*g,C=v*I-y*S+x*R+M*b-w*A+E*T;return C?(C=1/C,this.setValues((a*I-o*S+h*R)*C,(i*S-n*I-r*R)*C,(p*E-g*w+m*M)*C,(c*w-u*E-f*M)*C,(o*b-s*I-h*A)*C,(e*I-i*b+r*A)*C,(g*x-d*E-m*y)*C,(l*E-c*x+f*y)*C,(s*S-a*b+h*T)*C,(n*b-e*S-r*T)*C,(d*w-p*x+m*v)*C,(u*x-l*w-f*v)*C,(a*A-s*R-o*T)*C,(e*R-n*A+i*T)*C,(p*y-d*M-g*v)*C,(l*M-u*y+c*v)*C)):this},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return this.setValues(a*(c*m-f*g)-u*(o*m-h*g)+p*(o*f-h*c),-(n*(c*m-f*g)-u*(i*m-r*g)+p*(i*f-r*c)),n*(o*m-h*g)-a*(i*m-r*g)+p*(i*h-r*o),-(n*(o*f-h*c)-a*(i*f-r*c)+u*(i*h-r*o)),-(s*(c*m-f*g)-l*(o*m-h*g)+d*(o*f-h*c)),e*(c*m-f*g)-l*(i*m-r*g)+d*(i*f-r*c),-(e*(o*m-h*g)-s*(i*m-r*g)+d*(i*h-r*o)),e*(o*f-h*c)-s*(i*f-r*c)+l*(i*h-r*o),s*(u*m-f*p)-l*(a*m-h*p)+d*(a*f-h*u),-(e*(u*m-f*p)-l*(n*m-r*p)+d*(n*f-r*u)),e*(a*m-h*p)-s*(n*m-r*p)+d*(n*h-r*a),-(e*(a*f-h*u)-s*(n*f-r*u)+l*(n*h-r*a)),-(s*(u*g-c*p)-l*(a*g-o*p)+d*(a*c-o*u)),e*(u*g-c*p)-l*(n*g-i*p)+d*(n*c-i*u),-(e*(a*g-o*p)-s*(n*g-i*p)+d*(n*o-i*a)),e*(a*c-o*u)-s*(n*c-i*u)+l*(n*o-i*a))},determinant:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*s)*(c*m-f*g)-(e*o-i*s)*(u*m-f*p)+(e*h-r*s)*(u*g-c*p)+(n*o-i*a)*(l*m-f*d)-(n*h-r*a)*(l*g-c*d)+(i*h-r*o)*(l*p-u*d)},multiply:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=t.val,x=y[0],M=y[1],w=y[2],E=y[3];return e[0]=x*n+M*a+w*u+E*p,e[1]=x*i+M*o+w*c+E*g,e[2]=x*r+M*h+w*f+E*m,e[3]=x*s+M*l+w*d+E*v,x=y[4],M=y[5],w=y[6],E=y[7],e[4]=x*n+M*a+w*u+E*p,e[5]=x*i+M*o+w*c+E*g,e[6]=x*r+M*h+w*f+E*m,e[7]=x*s+M*l+w*d+E*v,x=y[8],M=y[9],w=y[10],E=y[11],e[8]=x*n+M*a+w*u+E*p,e[9]=x*i+M*o+w*c+E*g,e[10]=x*r+M*h+w*f+E*m,e[11]=x*s+M*l+w*d+E*v,x=y[12],M=y[13],w=y[14],E=y[15],e[12]=x*n+M*a+w*u+E*p,e[13]=x*i+M*o+w*c+E*g,e[14]=x*r+M*h+w*f+E*m,e[15]=x*s+M*l+w*d+E*v,this},multiplyLocal:function(t){var e=this.val,n=t.val;return this.setValues(e[0]*n[0]+e[1]*n[4]+e[2]*n[8]+e[3]*n[12],e[0]*n[1]+e[1]*n[5]+e[2]*n[9]+e[3]*n[13],e[0]*n[2]+e[1]*n[6]+e[2]*n[10]+e[3]*n[14],e[0]*n[3]+e[1]*n[7]+e[2]*n[11]+e[3]*n[15],e[4]*n[0]+e[5]*n[4]+e[6]*n[8]+e[7]*n[12],e[4]*n[1]+e[5]*n[5]+e[6]*n[9]+e[7]*n[13],e[4]*n[2]+e[5]*n[6]+e[6]*n[10]+e[7]*n[14],e[4]*n[3]+e[5]*n[7]+e[6]*n[11]+e[7]*n[15],e[8]*n[0]+e[9]*n[4]+e[10]*n[8]+e[11]*n[12],e[8]*n[1]+e[9]*n[5]+e[10]*n[9]+e[11]*n[13],e[8]*n[2]+e[9]*n[6]+e[10]*n[10]+e[11]*n[14],e[8]*n[3]+e[9]*n[7]+e[10]*n[11]+e[11]*n[15],e[12]*n[0]+e[13]*n[4]+e[14]*n[8]+e[15]*n[12],e[12]*n[1]+e[13]*n[5]+e[14]*n[9]+e[15]*n[13],e[12]*n[2]+e[13]*n[6]+e[14]*n[10]+e[15]*n[14],e[12]*n[3]+e[13]*n[7]+e[14]*n[11]+e[15]*n[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.val,i=e.val,r=n[0],s=n[4],a=n[8],o=n[12],h=n[1],l=n[5],u=n[9],c=n[13],f=n[2],d=n[6],p=n[10],g=n[14],m=n[3],v=n[7],y=n[11],x=n[15],M=i[0],w=i[4],E=i[8],T=i[12],A=i[1],b=i[5],R=i[9],S=i[13],I=i[2],C=i[6],P=i[10],k=i[14],_=i[3],O=i[7],F=i[11],L=i[15];return this.setValues(r*M+s*A+a*I+o*_,h*M+l*A+u*I+c*_,f*M+d*A+p*I+g*_,m*M+v*A+y*I+x*_,r*w+s*b+a*C+o*O,h*w+l*b+u*C+c*O,f*w+d*b+p*C+g*O,m*w+v*b+y*C+x*O,r*E+s*R+a*P+o*F,h*E+l*R+u*P+c*F,f*E+d*R+p*P+g*F,m*E+v*R+y*P+x*F,r*T+s*S+a*k+o*L,h*T+l*S+u*k+c*L,f*T+d*S+p*k+g*L,m*T+v*S+y*k+x*L)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,n){var i=this.val;return i[12]=i[0]*t+i[4]*e+i[8]*n+i[12],i[13]=i[1]*t+i[5]*e+i[9]*n+i[13],i[14]=i[2]*t+i[6]*e+i[10]*n+i[14],i[15]=i[3]*t+i[7]*e+i[11]*n+i[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,n){var i=this.val;return i[0]=i[0]*t,i[1]=i[1]*t,i[2]=i[2]*t,i[3]=i[3]*t,i[4]=i[4]*e,i[5]=i[5]*e,i[6]=i[6]*e,i[7]=i[7]*e,i[8]=i[8]*n,i[9]=i[9]*n,i[10]=i[10]*n,i[11]=i[11]*n,this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.setValues(h*s+n,h*a-i*o,h*o+i*a,0,h*a+i*o,l*a+n,l*o-i*s,0,h*o-i*a,l*o+i*s,r*o*o+n,0,0,0,0,1)},rotate:function(t,e){var n=this.val,i=e.x,r=e.y,s=e.z,a=Math.sqrt(i*i+r*r+s*s);if(Math.abs(a)<1e-6)return this;i*=a=1/a,r*=a,s*=a;var o=Math.sin(t),h=Math.cos(t),l=1-h,u=n[0],c=n[1],f=n[2],d=n[3],p=n[4],g=n[5],m=n[6],v=n[7],y=n[8],x=n[9],M=n[10],w=n[11],E=n[12],T=n[13],A=n[14],b=n[15],R=i*i*l+h,S=r*i*l+s*o,I=s*i*l-r*o,C=i*r*l-s*o,P=r*r*l+h,k=s*r*l+i*o,_=i*s*l+r*o,O=r*s*l-i*o,F=s*s*l+h;return this.setValues(u*R+p*S+y*I,c*R+g*S+x*I,f*R+m*S+M*I,d*R+v*S+w*I,u*C+p*P+y*k,c*C+g*P+x*k,f*C+m*P+M*k,d*C+v*P+w*k,u*_+p*O+y*F,c*_+g*O+x*F,f*_+m*O+M*F,d*_+v*O+w*F,E,T,A,b)},rotateX:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[4],s=e[5],a=e[6],o=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=r*i+h*n,e[5]=s*i+l*n,e[6]=a*i+u*n,e[7]=o*i+c*n,e[8]=h*i-r*n,e[9]=l*i-s*n,e[10]=u*i-a*n,e[11]=c*i-o*n,this},rotateY:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],a=e[2],o=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=r*i-h*n,e[1]=s*i-l*n,e[2]=a*i-u*n,e[3]=o*i-c*n,e[8]=r*n+h*i,e[9]=s*n+l*i,e[10]=a*n+u*i,e[11]=o*n+c*i,this},rotateZ:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=r*i+h*n,e[1]=s*i+l*n,e[2]=a*i+u*n,e[3]=o*i+c*n,e[4]=h*i-r*n,e[5]=l*i-s*n,e[6]=u*i-a*n,e[7]=c*i-o*n,this},fromRotationTranslation:function(t,e){var n=t.x,i=t.y,r=t.z,s=t.w,a=n+n,o=i+i,h=r+r,l=n*a,u=n*o,c=n*h,f=i*o,d=i*h,p=r*h,g=s*a,m=s*o,v=s*h;return this.setValues(1-(f+p),u+v,c-m,0,u-v,1-(l+p),d+g,0,c+m,d-g,1-(l+f),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,n=t.y,i=t.z,r=t.w,s=e+e,a=n+n,o=i+i,h=e*s,l=e*a,u=e*o,c=n*a,f=n*o,d=i*o,p=r*s,g=r*a,m=r*o;return this.setValues(1-(c+d),l+m,u-g,0,l-m,1-(h+d),f+p,0,u+g,f-p,1-(h+c),0,0,0,0,1)},frustum:function(t,e,n,i,r,s){var a=1/(e-t),o=1/(i-n),h=1/(r-s);return this.setValues(2*r*a,0,0,0,0,2*r*o,0,0,(e+t)*a,(i+n)*o,(s+r)*h,-1,0,0,s*r*2*h,0)},perspective:function(t,e,n,i){var r=1/Math.tan(t/2),s=1/(n-i);return this.setValues(r/e,0,0,0,0,r,0,0,0,0,(i+n)*s,-1,0,0,2*i*n*s,0)},perspectiveLH:function(t,e,n,i){return this.setValues(2*n/t,0,0,0,0,2*n/e,0,0,0,0,-i/(n-i),1,0,0,n*i/(n-i),0)},ortho:function(t,e,n,i,r,s){var a=0===(a=t-e)?a:1/a,o=0===(o=n-i)?o:1/o,h=0===(h=r-s)?h:1/h;return this.setValues(-2*a,0,0,0,0,-2*o,0,0,0,0,2*h,0,(t+e)*a,(i+n)*o,(s+r)*h,1)},lookAtRH:function(t,e,n){var i=this.val;return u.subVectors(t,e),0===u.getLengthSquared()&&(u.z=1),u.normalize(),a.crossVectors(n,u),0===a.getLengthSquared()&&(1===Math.abs(n.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),a.crossVectors(n,u)),a.normalize(),o.crossVectors(u,a),i[0]=a.x,i[1]=a.y,i[2]=a.z,i[4]=o.x,i[5]=o.y,i[6]=o.z,i[8]=u.x,i[9]=u.y,i[10]=u.z,this},lookAt:function(t,e,n){var i=t.x,r=t.y,s=t.z,a=n.x,o=n.y,h=n.z,l=e.x,u=e.y,c=e.z;if(Math.abs(i-l)<1e-6&&Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6)return this.identity();var f=i-l,d=r-u,p=s-c,g=1/Math.sqrt(f*f+d*d+p*p),m=o*(p*=g)-h*(d*=g),v=h*(f*=g)-a*p,y=a*d-o*f;(g=Math.sqrt(m*m+v*v+y*y))?(m*=g=1/g,v*=g,y*=g):y=v=m=0;var x=d*y-p*v,M=p*m-f*y,w=f*v-d*m;return(g=Math.sqrt(x*x+M*M+w*w))?(x*=g=1/g,M*=g,w*=g):w=M=x=0,this.setValues(m,x,f,0,v,M,d,0,y,w,p,0,-(m*i+v*r+y*s),-(x*i+M*r+w*s),-(f*i+d*r+p*s),1)},yawPitchRoll:function(t,e,n){this.zero(),h.zero(),l.zero();var i=this.val,r=h.val,s=l.val,a=Math.sin(n),o=Math.cos(n);return i[10]=1,i[15]=1,i[0]=o,i[1]=a,i[4]=-a,i[5]=o,a=Math.sin(e),o=Math.cos(e),r[0]=1,r[15]=1,r[5]=o,r[10]=o,r[9]=-a,r[6]=a,a=Math.sin(t),o=Math.cos(t),s[5]=1,s[15]=1,s[0]=o,s[2]=-a,s[8]=a,s[10]=o,this.multiplyLocal(h),this.multiplyLocal(l),this},setWorldMatrix:function(t,e,n,i,r){return this.yawPitchRoll(t.y,t.x,t.z),h.scaling(n.x,n.y,n.z),l.xyz(e.x,e.y,e.z),this.multiplyLocal(h),this.multiplyLocal(l),i&&this.multiplyLocal(i),r&&this.multiplyLocal(r),this},multiplyToMat4:function(t,e){var n=this.val,i=t.val,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5],u=n[6],c=n[7],f=n[8],d=n[9],p=n[10],g=n[11],m=n[12],v=n[13],y=n[14],x=n[15],M=i[0],w=i[1],E=i[2],T=i[3],A=i[4],b=i[5],R=i[6],S=i[7],I=i[8],C=i[9],P=i[10],k=i[11],_=i[12],O=i[13],F=i[14],L=i[15];return e.setValues(M*r+w*h+E*f+T*m,w*s+w*l+E*d+T*v,E*a+w*u+E*p+T*y,T*o+w*c+E*g+T*x,A*r+b*h+R*f+S*m,A*s+b*l+R*d+S*v,A*a+b*u+R*p+S*y,A*o+b*c+R*g+S*x,I*r+C*h+P*f+k*m,I*s+C*l+P*d+k*v,I*a+C*u+P*p+k*y,I*o+C*c+P*g+k*x,_*r+O*h+F*f+L*m,_*s+O*l+F*d+L*v,_*a+O*u+F*p+L*y,_*o+O*c+F*g+L*x)},fromRotationXYTranslation:function(t,e,n){var i=e.x,r=e.y,s=e.z,a=Math.sin(t.x),o=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),u=i,c=r,f=s,d=-a,p=0-d*h,g=0-o*h,m=d*l,v=o*l;return n||(u=l*i+h*s,c=p*i+o*r+m*s,f=g*i+a*r+v*s),this.setValues(l,p,g,0,0,o,a,0,h,m,v,0,u,c,f,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}}),h=new s,l=new s,a=new r,o=new r,u=new r;t.exports=s},function(t,e,n){var i=n(3);t.exports=function(t){return t*i.RAD_TO_DEG}},function(t,e,n){var i=n(0),r=n(12),s=n(202),a=n(8),o=n(213),h=n(43),l=n(214),u=n(44),c=new i({initialize:function(t,e){this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),this.key=a(e,"key",!1);var n=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+n),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var i=a(e,"url");void 0===i?i=t.path+n+"."+a(e,"extension",""):"string"!=typeof i||i.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)||(i=t.path+i),this.url=i,this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){(this.linkFile=t).linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var n=t.responseURL&&0===t.responseURL.indexOf("file://")&&0===e.target.status,i=!(e.target&&200!==e.target.status)||n;4===t.readyState&&400<=t.status&&t.status<=599&&(i=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,n=this.type;this.loader.emit(s.FILE_COMPLETE,e,n,t),this.loader.emit(s.FILE_KEY_COMPLETE+n+"-"+e,e,n,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,n){var i;"function"==typeof URL?t.src=URL.createObjectURL(e):((i=new FileReader).onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||n)+";base64,"+i.result.split(",")[1]},i.onerror=t.onerror,i.readAsDataURL(e))},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){var n={},i={install:function(t){for(var e in n)t[e]=n[e]},register:function(t,e){n[t]=e},destroy:function(){n={}}};t.exports=i},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,n=1;n=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e,n){var u=n(6),c=function(){var t,e,n,i,r,s,a=arguments[0]||{},o=1,h=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},o=2),h===o&&(a=this,--o);os[0]&&(e=1),s[8]>s[3*e+e]&&(e=2),n=o[e],i=o[n],r=Math.sqrt(s[3*e+e]-s[3*n+n]-s[3*i+i]+1),h[e]=.5*r,r=.5/r,h[n]=(s[3*n+e]+s[3*e+n])*r,h[i]=(s[3*i+e]+s[3*e+i])*r,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(s[3*i+n]-s[3*n+i])*r),this.onChangeCallback(this),this}});t.exports=d},function(t,e,n){var r=n(26),s=n(44);t.exports=function(t,e){var n=void 0===t?s():r({},t);if(e)for(var i in e)void 0!==e[i]&&(n[i]=e[i]);return n}},function(t,e){t.exports=function(t,e,n,i,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:n,password:i,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){var n={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=n},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var n={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=n},function(t,e,n){var i=n(3),r=n(50),h=n(40),s=n(29),a=n(30),l=n(2),o={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*i.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*i.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,n,i){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=n,this.w=i,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,n,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=this.scene.sys.scale.width),void 0===i&&(i=this.scene.sys.scale.height),this.x=t+Math.random()*n,this.y=e+Math.random()*i,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var n=this.parentContainer;if(!n)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);n;)e.applyITRS(n.x,n.y,n._rotation,n._scaleX,n._scaleY),e.multiply(t,t),n=n.parentContainer;return t},getLocalPoint:function(t,e,n,i){n=n||new l;var r=(i=i||this.scene.sys.cameras.main).scrollX,s=i.scrollY,a=t+r*this.scrollFactorX-r,o=e+s*this.scrollFactorY-s;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,o,n):h(a,o,this.x,this.y,this.rotation,this.scaleX,this.scaleY,n),this._originComponent&&(n.x+=this._displayOriginX,n.y+=this._displayOriginY),n},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=o},function(t,e,n){var i=n(0),s=n(3),c=n(2),r=new i({initialize:function(t,e,n,i,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,n,i,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],n=t[1],i=t[2],r=t[3];return e||n?0=i.PI2-n?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,n=(e*=n)>>>0,n+=4294967296*(e-=n);return 2.3283064365386963e-10*((this.n=n)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=n}function Dt(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n= 0.");if(null==e)throw new Error("name cannot be null.");if(null==n)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=n}function Zt(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new N.Vector2,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var n=0;n>>1;;){if(t[(s+1)*n]<=e?i=s+1:r=s,i==r)return(i+1)*n;s=i+r>>>1}},r.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;return-1},r);function r(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var i=0;i 0: "+t);this.curves=B.Utils.newFloatArray((t-1)*y.BEZIER_SIZE)}B.CurveTimeline=s;var a,o=(kt(v,a=s),v.prototype.getPropertyId=function(){return(n.rotate<<24)+this.boneIndex},v.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+v.ROTATION]=n},v.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-v.ENTRIES]){var u=o[o.length+v.PREV_ROTATION];switch(s){case U.setup:h.rotation=h.data.rotation+u*r;break;case U.first:case U.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case U.add:h.rotation+=u*r}}else{var c=z.binarySearch(o,n,v.ENTRIES),f=o[c+v.PREV_ROTATION],d=o[c],p=this.getCurvePercent((c>>1)-1,1-(n-d)/(o[c+v.PREV_TIME]-d)),g=f+((g=o[c+v.ROTATION]-f)-360*(16384-(16384.499999999996-g/360|0)))*p;switch(s){case U.setup:h.rotation=h.data.rotation+(g-360*(16384-(16384.499999999996-g/360|0)))*r;break;case U.first:case U.replace:g+=h.data.rotation-h.rotation;case U.add:h.rotation+=(g-360*(16384-(16384.499999999996-g/360|0)))*r}}},v.ENTRIES=2,v.PREV_TIME=-2,v.PREV_ROTATION=-1,v.ROTATION=1,v);function v(t){var e=a.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t<<1),e}B.RotateTimeline=o;var h,l=(kt(p,h=s),p.prototype.getPropertyId=function(){return(n.translate<<24)+this.boneIndex},p.prototype.setFrame=function(t,e,n,i){t*=p.ENTRIES,this.frames[t]=e,this.frames[t+p.X]=n,this.frames[t+p.Y]=i},p.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-p.ENTRIES]?(f=o[o.length+p.PREV_X],d=o[o.length+p.PREV_Y]):(f=o[(l=z.binarySearch(o,n,p.ENTRIES))+p.PREV_X],d=o[l+p.PREV_Y],u=o[l],c=this.getCurvePercent(l/p.ENTRIES-1,1-(n-u)/(o[l+p.PREV_TIME]-u)),f+=(o[l+p.X]-f)*c,d+=(o[l+p.Y]-d)*c),s){case U.setup:h.x=h.data.x+f*r,h.y=h.data.y+d*r;break;case U.first:case U.replace:h.x+=(h.data.x+f-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case U.add:h.x+=f*r,h.y+=d*r}}},p.ENTRIES=3,p.PREV_TIME=-3,p.PREV_X=-2,p.PREV_Y=-1,p.X=1,p.Y=2,p);function p(t){var e=h.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*p.ENTRIES),e}B.TranslateTimeline=l;var u,c=(kt(x,u=l),x.prototype.getPropertyId=function(){return(n.scale<<24)+this.boneIndex},x.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-x.ENTRIES]?(f=o[o.length+x.PREV_X]*h.data.scaleX,o[o.length+x.PREV_Y]*h.data.scaleY):(f=o[(l=z.binarySearch(o,n,x.ENTRIES))+x.PREV_X],d=o[l+x.PREV_Y],u=o[l],c=this.getCurvePercent(l/x.ENTRIES-1,1-(n-u)/(o[l+x.PREV_TIME]-u)),f=(f+(o[l+x.X]-f)*c)*h.data.scaleX,(d+(o[l+x.Y]-d)*c)*h.data.scaleY),1==r)s==U.add?(h.scaleX+=f-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=f,h.scaleY=d);else{var p=0,g=0;if(a==m.mixOut)switch(s){case U.setup:p=h.data.scaleX,g=h.data.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-p)*r,h.scaleY=g+(Math.abs(d)*B.MathUtils.signum(g)-g)*r;break;case U.first:case U.replace:p=h.scaleX,g=h.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-p)*r,h.scaleY=g+(Math.abs(d)*B.MathUtils.signum(g)-g)*r;break;case U.add:p=h.scaleX,g=h.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-h.data.scaleX)*r,h.scaleY=g+(Math.abs(d)*B.MathUtils.signum(g)-h.data.scaleY)*r}else switch(s){case U.setup:p=Math.abs(h.data.scaleX)*B.MathUtils.signum(f),g=Math.abs(h.data.scaleY)*B.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=g+(d-g)*r;break;case U.first:case U.replace:p=Math.abs(h.scaleX)*B.MathUtils.signum(f),g=Math.abs(h.scaleY)*B.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=g+(d-g)*r;break;case U.add:p=B.MathUtils.signum(f),g=B.MathUtils.signum(d),h.scaleX=Math.abs(h.scaleX)*p+(f-Math.abs(h.data.scaleX)*p)*r,h.scaleY=Math.abs(h.scaleY)*g+(d-Math.abs(h.data.scaleY)*g)*r}}}},x);function x(t){return u.call(this,t)||this}B.ScaleTimeline=c;var f,d=(kt(g,f=l),g.prototype.getPropertyId=function(){return(n.shear<<24)+this.boneIndex},g.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(n=o[o.length-g.ENTRIES]?(f=o[o.length+g.PREV_X],d=o[o.length+g.PREV_Y]):(f=o[(l=z.binarySearch(o,n,g.ENTRIES))+g.PREV_X],d=o[l+g.PREV_Y],u=o[l],c=this.getCurvePercent(l/g.ENTRIES-1,1-(n-u)/(o[l+g.PREV_TIME]-u)),f+=(o[l+g.X]-f)*c,d+=(o[l+g.Y]-d)*c),s){case U.setup:h.shearX=h.data.shearX+f*r,h.shearY=h.data.shearY+d*r;break;case U.first:case U.replace:h.shearX+=(h.data.shearX+f-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case U.add:h.shearX+=f*r,h.shearY+=d*r}}},g);function g(t){return f.call(this,t)||this}B.ShearTimeline=d;var M,w=(kt(E,M=s),E.prototype.getPropertyId=function(){return(n.color<<24)+this.slotIndex},E.prototype.setFrame=function(t,e,n,i,r,s){t*=E.ENTRIES,this.frames[t]=e,this.frames[t+E.R]=n,this.frames[t+E.G]=i,this.frames[t+E.B]=r,this.frames[t+E.A]=s},E.prototype.apply=function(t,e,n,i,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-E.ENTRIES]?(g=h[(c=h.length)+E.PREV_R],m=h[c+E.PREV_G],v=h[c+E.PREV_B],y=h[c+E.PREV_A]):(g=h[(f=z.binarySearch(h,n,E.ENTRIES))+E.PREV_R],m=h[f+E.PREV_G],v=h[f+E.PREV_B],y=h[f+E.PREV_A],d=h[f],p=this.getCurvePercent(f/E.ENTRIES-1,1-(n-d)/(h[f+E.PREV_TIME]-d)),g+=(h[f+E.R]-g)*p,m+=(h[f+E.G]-m)*p,v+=(h[f+E.B]-v)*p,y+=(h[f+E.A]-y)*p),1==r?o.color.set(g,m,v,y):(l=o.color,s==U.setup&&l.setFromColor(o.data.color),l.add((g-l.r)*r,(m-l.g)*r,(v-l.b)*r,(y-l.a)*r))}}},E.ENTRIES=5,E.PREV_TIME=-5,E.PREV_R=-4,E.PREV_G=-3,E.PREV_B=-2,E.PREV_A=-1,E.R=1,E.G=2,E.B=3,E.A=4,E);function E(t){var e=M.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*E.ENTRIES),e}B.ColorTimeline=w;var T,A=(kt(b,T=s),b.prototype.getPropertyId=function(){return(n.twoColor<<24)+this.slotIndex},b.prototype.setFrame=function(t,e,n,i,r,s,a,o,h){t*=b.ENTRIES,this.frames[t]=e,this.frames[t+b.R]=n,this.frames[t+b.G]=i,this.frames[t+b.B]=r,this.frames[t+b.A]=s,this.frames[t+b.R2]=a,this.frames[t+b.G2]=o,this.frames[t+b.B2]=h},b.prototype.apply=function(t,e,n,i,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(n=h[h.length-b.ENTRIES]?(v=h[(d=h.length)+b.PREV_R],y=h[d+b.PREV_G],x=h[d+b.PREV_B],M=h[d+b.PREV_A],w=h[d+b.PREV_R2],E=h[d+b.PREV_G2],T=h[d+b.PREV_B2]):(v=h[(p=z.binarySearch(h,n,b.ENTRIES))+b.PREV_R],y=h[p+b.PREV_G],x=h[p+b.PREV_B],M=h[p+b.PREV_A],w=h[p+b.PREV_R2],E=h[p+b.PREV_G2],T=h[p+b.PREV_B2],g=h[p],m=this.getCurvePercent(p/b.ENTRIES-1,1-(n-g)/(h[p+b.PREV_TIME]-g)),v+=(h[p+b.R]-v)*m,y+=(h[p+b.G]-y)*m,x+=(h[p+b.B]-x)*m,M+=(h[p+b.A]-M)*m,w+=(h[p+b.R2]-w)*m,E+=(h[p+b.G2]-E)*m,T+=(h[p+b.B2]-T)*m),1==r?(o.color.set(v,y,x,M),o.darkColor.set(w,E,T,1)):(l=o.color,u=o.darkColor,s==U.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((v-l.r)*r,(y-l.g)*r,(x-l.b)*r,(M-l.a)*r),u.add((w-u.r)*r,(E-u.g)*r,(T-u.b)*r,0))}}},b.ENTRIES=8,b.PREV_TIME=-8,b.PREV_R=-7,b.PREV_G=-6,b.PREV_B=-5,b.PREV_A=-4,b.PREV_R2=-3,b.PREV_G2=-2,b.PREV_B2=-1,b.R=1,b.G=2,b.B=3,b.A=4,b.R2=5,b.G2=6,b.B2=7,b);function b(t){var e=T.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*b.ENTRIES),e}B.TwoColorTimeline=A;var R=(S.prototype.getPropertyId=function(){return(n.attachment<<24)+this.slotIndex},S.prototype.getFrameCount=function(){return this.frames.length},S.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},S.prototype.apply=function(t,e,n,i,r,s,a){var o,h,l,u=t.slots[this.slotIndex];u.bone.active&&(a!=m.mixOut?n<(o=this.frames)[0]?s!=U.setup&&s!=U.first||this.setAttachment(t,u,u.data.attachmentName):(h=0,h=n>=o[o.length-1]?o.length-1:z.binarySearch(o,n,1)-1,l=this.attachmentNames[h],t.slots[this.slotIndex].setAttachment(null==l?null:t.getAttachment(this.slotIndex,l))):s==U.setup&&this.setAttachment(t,u,u.data.attachmentName))},S.prototype.setAttachment=function(t,e,n){e.attachment=null==n?null:t.getAttachment(this.slotIndex,n)},S);function S(t){this.frames=B.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}B.AttachmentTimeline=R;var I,C=null,P=(kt(k,I=s),k.prototype.getPropertyId=function(){return(n.deform<<27)+ +this.attachment.id+this.slotIndex},k.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},k.prototype.apply=function(t,e,n,i,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof B.VertexAttachment&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(s=U.setup);var u=this.frameVertices,c=u[0].length,f=this.frames;if(n=f[f.length-1]){var y=u[f.length-1];if(1==r)if(s==U.add)if(null==(d=h).bones)for(var g=d.vertices,x=0;x=o[h-1])return;if(!(n=o[l];l++)i.push(this.events[l])}}},O);function O(t){this.frames=B.Utils.newFloatArray(t),this.events=new Array(t)}B.EventTimeline=_;var F=(L.prototype.getPropertyId=function(){return n.drawOrder<<24},L.prototype.getFrameCount=function(){return this.frames.length},L.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},L.prototype.apply=function(t,e,n,i,r,s,a){var o=t.drawOrder,h=t.slots;if(a!=m.mixOut){var l=this.frames;if(n=l[l.length-1]?l.length-1:z.binarySearch(l,n)-1,c=this.drawOrders[u];if(null==c)B.Utils.arrayCopy(h,0,o,0,h.length);else for(var f=0,d=c.length;f=f[f.length-N.ENTRIES]?s==U.setup?(d.mix=d.data.mix+(f[f.length+N.PREV_MIX]-d.data.mix)*r,d.softness=d.data.softness+(f[f.length+N.PREV_SOFTNESS]-d.data.softness)*r,a==m.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[f.length+N.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+N.PREV_COMPRESS],d.stretch=0!=f[f.length+N.PREV_STRETCH])):(d.mix+=(f[f.length+N.PREV_MIX]-d.mix)*r,d.softness+=(f[f.length+N.PREV_SOFTNESS]-d.softness)*r,a==m.mixIn&&(d.bendDirection=f[f.length+N.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+N.PREV_COMPRESS],d.stretch=0!=f[f.length+N.PREV_STRETCH])):(h=f[(o=z.binarySearch(f,n,N.ENTRIES))+N.PREV_MIX],l=f[o+N.PREV_SOFTNESS],u=f[o],c=this.getCurvePercent(o/N.ENTRIES-1,1-(n-u)/(f[o+N.PREV_TIME]-u)),s==U.setup?(d.mix=d.data.mix+(h+(f[o+N.MIX]-h)*c-d.data.mix)*r,d.softness=d.data.softness+(l+(f[o+N.SOFTNESS]-l)*c-d.data.softness)*r,a==m.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[o+N.PREV_BEND_DIRECTION],d.compress=0!=f[o+N.PREV_COMPRESS],d.stretch=0!=f[o+N.PREV_STRETCH])):(d.mix+=(h+(f[o+N.MIX]-h)*c-d.mix)*r,d.softness+=(l+(f[o+N.SOFTNESS]-l)*c-d.softness)*r,a==m.mixIn&&(d.bendDirection=f[o+N.PREV_BEND_DIRECTION],d.compress=0!=f[o+N.PREV_COMPRESS],d.stretch=0!=f[o+N.PREV_STRETCH])))},N.ENTRIES=6,N.PREV_TIME=-6,N.PREV_MIX=-5,N.PREV_SOFTNESS=-4,N.PREV_BEND_DIRECTION=-3,N.PREV_COMPRESS=-2,N.PREV_STRETCH=-1,N.MIX=1,N.SOFTNESS=2,N.BEND_DIRECTION=3,N.COMPRESS=4,N.STRETCH=5,N);function N(t){var e=V.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*N.ENTRIES),e}B.IkConstraintTimeline=D;var Y,X=(kt(W,Y=s),W.prototype.getPropertyId=function(){return(n.transformConstraint<<24)+this.transformConstraintIndex},W.prototype.setFrame=function(t,e,n,i,r,s){t*=W.ENTRIES,this.frames[t]=e,this.frames[t+W.ROTATE]=n,this.frames[t+W.TRANSLATE]=i,this.frames[t+W.SCALE]=r,this.frames[t+W.SHEAR]=s},W.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(n=o[o.length-W.ENTRIES]?(p=o[(u=o.length)+W.PREV_ROTATE],g=o[u+W.PREV_TRANSLATE],m=o[u+W.PREV_SCALE],v=o[u+W.PREV_SHEAR]):(p=o[(c=z.binarySearch(o,n,W.ENTRIES))+W.PREV_ROTATE],g=o[c+W.PREV_TRANSLATE],m=o[c+W.PREV_SCALE],v=o[c+W.PREV_SHEAR],f=o[c],d=this.getCurvePercent(c/W.ENTRIES-1,1-(n-f)/(o[c+W.PREV_TIME]-f)),p+=(o[c+W.ROTATE]-p)*d,g+=(o[c+W.TRANSLATE]-g)*d,m+=(o[c+W.SCALE]-m)*d,v+=(o[c+W.SHEAR]-v)*d),s==U.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(g-l.translateMix)*r,h.scaleMix=l.scaleMix+(m-l.scaleMix)*r,h.shearMix=l.shearMix+(v-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(g-h.translateMix)*r,h.scaleMix+=(m-h.scaleMix)*r,h.shearMix+=(v-h.shearMix)*r)}},W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4,W);function W(t){var e=Y.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*W.ENTRIES),e}B.TransformConstraintTimeline=X;var q,G=(kt(H,q=s),H.prototype.getPropertyId=function(){return(n.pathConstraintPosition<<24)+this.pathConstraintIndex},H.prototype.setFrame=function(t,e,n){t*=H.ENTRIES,this.frames[t]=e,this.frames[t+H.VALUE]=n},H.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-H.ENTRIES]?f=o[o.length+H.PREV_VALUE]:(f=o[(l=z.binarySearch(o,n,H.ENTRIES))+H.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/H.ENTRIES-1,1-(n-u)/(o[l+H.PREV_TIME]-u)),f+=(o[l+H.VALUE]-f)*c),s==U.setup?h.position=h.data.position+(f-h.data.position)*r:h.position+=(f-h.position)*r}},H.ENTRIES=2,H.PREV_TIME=-2,H.PREV_VALUE=-1,H.VALUE=1,H);function H(t){var e=q.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*H.ENTRIES),e}B.PathConstraintPositionTimeline=G;var j,Z=(kt(K,j=G),K.prototype.getPropertyId=function(){return(n.pathConstraintSpacing<<24)+this.pathConstraintIndex},K.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-K.ENTRIES]?f=o[o.length+K.PREV_VALUE]:(f=o[(l=z.binarySearch(o,n,K.ENTRIES))+K.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/K.ENTRIES-1,1-(n-u)/(o[l+K.PREV_TIME]-u)),f+=(o[l+K.VALUE]-f)*c),s==U.setup?h.spacing=h.data.spacing+(f-h.data.spacing)*r:h.spacing+=(f-h.spacing)*r}},K);function K(t){return j.call(this,t)||this}B.PathConstraintSpacingTimeline=Z;var Q,J=(kt($,Q=s),$.prototype.getPropertyId=function(){return(n.pathConstraintMix<<24)+this.pathConstraintIndex},$.prototype.setFrame=function(t,e,n,i){t*=$.ENTRIES,this.frames[t]=e,this.frames[t+$.ROTATE]=n,this.frames[t+$.TRANSLATE]=i},$.prototype.apply=function(t,e,n,i,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(n=o[o.length-$.ENTRIES]?(f=o[o.length+$.PREV_ROTATE],d=o[o.length+$.PREV_TRANSLATE]):(f=o[(l=z.binarySearch(o,n,$.ENTRIES))+$.PREV_ROTATE],d=o[l+$.PREV_TRANSLATE],u=o[l],c=this.getCurvePercent(l/$.ENTRIES-1,1-(n-u)/(o[l+$.PREV_TIME]-u)),f+=(o[l+$.ROTATE]-f)*c,d+=(o[l+$.TRANSLATE]-d)*c),s==U.setup?(h.rotateMix=h.data.rotateMix+(f-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(f-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}},$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2,$);function $(t){var e=Q.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*$.ENTRIES),e}B.PathConstraintMixTimeline=J}(St=St||{}),function(R){var t=(S.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},S.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,0=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},S.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,n=this.tracks,i=!1,r=0,s=n.length;r=a.trackEnd&&null==a.next&&(h=0);var l=a.animationLast,u=a.getAnimationTime(),c=a.animation.timelines.length,f=a.animation.timelines;if(0==r&&1==h||o==R.MixBlend.add)for(var d=0;d=s[s.length-1]?s.length-1:R.Animation.binarySearch(s,n)-1,this.setAttachment(e,o,t.attachmentNames[a],r)),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+S.SETUP))},S.prototype.setAttachment=function(t,e,n,i){e.attachment=null==n?null:t.getAttachment(e.data.index,n),i&&(e.attachmentState=this.unkeyedState+S.CURRENT)},S.prototype.applyRotateTimeline=function(t,e,n,i,r,s,a,o){if(o&&(s[a]=0),1!=i){var h=t,l=h.frames,u=e.bones[h.boneIndex];if(u.active){var c=0,f=0;if(n=l[l.length-R.RotateTimeline.ENTRIES]?f=u.data.rotation+l[l.length+R.RotateTimeline.PREV_ROTATION]:(p=l[(d=R.Animation.binarySearch(l,n,R.RotateTimeline.ENTRIES))+R.RotateTimeline.PREV_ROTATION],g=l[d],m=h.getCurvePercent((d>>1)-1,1-(n-g)/(l[d+R.RotateTimeline.PREV_TIME]-g)),f=l[d+R.RotateTimeline.ROTATION]-p,f=p+(f-=360*(16384-(16384.499999999996-f/360|0)))*m+u.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0)))}var v,y,x,M,w=0,E=f-c;0==(E-=360*(16384-(16384.499999999996-E/360|0)))?w=s[a]:(y=v=0,y=o?(v=0,E):(v=s[a],s[a+1]),x=0i||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:i<=e&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var i=n.mixingFrom;if(null==i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},S.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),((e.mixingFrom=i).mixingTo=e).mixTime=0,null!=i.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},S.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},S.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);0<=e&&this.listeners.splice(e,1)},S.prototype.clearListeners=function(){this.listeners.length=0},S.prototype.clearListenerNotifications=function(){this.queue.clear()},S.emptyAnimation=new R.Animation("",[],0),S.SUBSEQUENT=0,S.FIRST=1,S.HOLD_SUBSEQUENT=2,S.HOLD_FIRST=3,S.HOLD_MIX=4,S.SETUP=1,S.CURRENT=2,S);function S(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new R.IntSet,this.animationsChanged=!1,this.trackEntryPool=new R.Pool(function(){return new e}),this.data=t}R.AnimationState=t;var e=(n.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},n.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},n.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},n.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},n.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},n);function n(){this.mixBlend=R.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}R.TrackEntry=e;var o,i,r=(s.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},s.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},s.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},s.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},s.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;nj.MathUtils.PI?Y-=j.MathUtils.PI2:Y<-j.MathUtils.PI&&(Y+=j.MathUtils.PI2),Y*=e,V=Math.cos(Y),D=Math.sin(Y),R.a=V*_-D*F,R.b=V*O-D*L,R.c=D*_+V*F,R.d=D*O+V*L),R.appliedValid=!1}}}},Yt.prototype.computeWorldPositions=function(t,e,n,i,r){var s=this.target,a=this.position,o=this.spaces,h=j.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,f=c/6,d=Yt.NONE;if(!t.constantSpeed){var p=t.lengths,g=p[f-=u?1:2];if(i&&(a*=g),r)for(var m=1;m>>1^-(1&n)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n>4){case 12:case 13:e+=String.fromCharCode((31&i)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&i)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(i),n++}}return e},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,n,i){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===i&&(i=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=i}var N=function(t,e,n,i,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(St=St||{}),C=St=St||{},Wt.prototype.update=function(t,e){if(null==t)throw new Error("skeleton cannot be null.");var n=this.boundingBoxes,i=this.polygons,r=this.polygonPool,s=t.slots,a=s.length;n.length=0,r.freeAll(i);for(var o=i.length=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},Wt.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=s&&i<=s||a<=t&&a<=n||o<=e&&o<=i)return!1;var h=(i-e)/(n-t),l=h*(r-t)+e;if(st.minX&&this.minYt.minY},Wt.prototype.containsPoint=function(t,e){for(var n=this.polygons,i=0,r=n.length;i>1,N=this.clipOutput,Y=Z.Utils.setArraySize(l,P+D*d),X=0;X>1;o=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},e.prototype.addSkin=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},n.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},n.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var s=e.indexOf(",",r);if(-1==s)break;t[i]=e.substr(r,s-r).trim(),r=s+1}return t[i]=e.substring(r).trim(),i+1},n);function n(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var g=function(){};d.TextureAtlasPage=g;var i,m=(i=d.TextureRegion,kt(r,i),r);function r(){return null!==i&&i.apply(this,arguments)||this}d.TextureAtlasRegion=m}(St=St||{}),N=St=St||{},Zt.prototype.isActive=function(){return this.active},Zt.prototype.apply=function(){this.update()},Zt.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},Zt.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0N.MathUtils.PI?A-=N.MathUtils.PI2:A<-N.MathUtils.PI&&(A+=N.MathUtils.PI2),A*=t,v=Math.cos(A),y=Math.sin(A),R.a=v*g-y*m,R.b=v*w-y*E,R.c=y*g+v*m,R.d=y*w+v*E,S=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),R.worldX+=(x.x-R.worldX)*e,R.worldY+=(x.y-R.worldY)*e,S=!0),0N.MathUtils.PI?A-=N.MathUtils.PI2:A<-N.MathUtils.PI&&(A+=N.MathUtils.PI2),A=T+(A+c)*i,b=Math.sqrt(w*w+E*E),R.b=Math.cos(A)*b,R.d=Math.sin(A)*b,S=!0),S&&(R.appliedValid=!1)}},Zt.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0N.MathUtils.PI?M-=N.MathUtils.PI2:M<-N.MathUtils.PI&&(M+=N.MathUtils.PI2),M*=t,v=Math.cos(M),y=Math.sin(M),A.a=v*g-y*m,A.b=v*w-y*E,A.c=y*g+v*m,A.d=y*w+v*E,b=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),A.worldX+=x.x*e,A.worldY+=x.y*e,b=!0),0N.MathUtils.PI?M-=N.MathUtils.PI2:M<-N.MathUtils.PI&&(M+=N.MathUtils.PI2),w=A.b,E=A.d,M=Math.atan2(E,w)+(M-N.MathUtils.PI/2+c)*i,T=Math.sqrt(w*w+E*E),A.b=Math.cos(M)*T,A.d=Math.sin(M)*T,b=!0),b&&(A.appliedValid=!1)}},Zt.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a>1,i=this.indicesArray,r=i.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},r.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},r.WHITE=new r(1,1,1,1),r.RED=new r(1,0,0,1),r.GREEN=new r(0,1,0,1),r.BLUE=new r(0,0,1,1),r.MAGENTA=new r(1,0,1,1),r);function r(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}t.Color=i;var s=(a.clamp=function(t,e,n){return t=e?t:m.setArraySize(t,e,n)},m.newArray=function(t,e){for(var n=new Array(t),i=0;ithis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},R.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},R.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f>16&255)/255,r=(t>>8&255)/255,s=(255&t)/255,a=16777215>>24)/255:null,o=this.skeleton;return!e||(n=this.findSlot(e))&&(o=n),o.color.r=i,o.color.g=r,o.color.b=s,null!==a&&(o.color.a=a),this},setSkeletonFromJSON:function(t,e,n,i){return this.setSkeleton(t,e,n,i)},setSkeleton:function(t,e,n,i){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,i);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,n),this.root=this.getRootBone(),this.root&&(this.root.rotation=g(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(m.COMPLETE,t)},onDispose:function(t){this.emit(m.DISPOSE,t)},onEnd:function(t){this.emit(m.END,t)},onEvent:function(t,e){this.emit(m.EVENT,t,e)},onInterrupted:function(t){this.emit(m.INTERRUPTED,t)},onStart:function(t){this.emit(m.START,t)},refresh:function(){return this.root&&(this.root.rotation=g(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,n,i){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===n&&(n=0),void 0===i&&(i=0),this.width=t,this.height=e,this.displayOriginX=r.x-n,this.displayOriginY=r.y-i,this},setOffset:function(t,e){var n=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=n.x-t,this.displayOriginY=n.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,n=this.scaleX,i=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=n,t.scaleY=i,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var n=0;n=(t=t.toString()).length)switch(i){case 1:t=new Array(e+1-t.length).join(n)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(1+(r-s)).join(n)+t+new Array(s+1).join(n);break;default:t+=new Array(e+1-t.length).join(n)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;ee.length&&(s=e.length),n?(i=e[s-1][n],(r=e[s][n])-t<=t-i?e[s]:e[s-1]):(i=e[s-1],(r=e[s])-t<=t-i?r:i)}},function(t,e,n){var h=n(4);t.exports=function(t,e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=t.length);var s=[];if(h(t,i,r))for(var a=i;a=t.length)throw new Error("Supplied index out of bounds");return i!==n&&(t.splice(i,1),t.splice(n,0,e)),e}},function(t,e){t.exports=function(t,e){var n,i,r=t.indexOf(e);return-1!==r&&rt.length-1)throw new Error("Index out of bounds");var r=s(t,e);return n&&n.call(i,r),r}},function(t,e,n){var l=n(4);t.exports=function(t,e,n,i,r){if(void 0===e&&(e=0),void 0===n&&(n=t.length),void 0===r&&(r=t),l(t,e,n)){var s=n-e,a=t.splice(e,s);if(i)for(var o=0;o=e&&t.y<=n&&t.y+t.height>=n)}},function(t,e,n){var a=n(59),o=n(60);t.exports=function(t,e,n,i){void 0===i&&(i=[]),!e&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,n){var i=n(9);t.exports=function(t,e,n){return void 0===n&&(n=new i),n.x=t.x1+(t.x2-t.x1)*e,n.y=t.y1+(t.y2-t.y1)*e,n}},function(t,e,n){var f=n(299),d=n(9);t.exports=function(t,e,n,i){void 0===i&&(i=[]),!e&&0 + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), +/* 2 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -353,7 +380,7 @@ module.exports = Class; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); -var FuzzyEqual = __webpack_require__(31); +var FuzzyEqual = __webpack_require__(32); /** * @classdesc @@ -1116,7 +1143,7 @@ module.exports = Vector2; /***/ }), -/* 2 */ +/* 3 */ /***/ (function(module, exports) { /** @@ -1208,7 +1235,7 @@ module.exports = MATH_CONST; /***/ }), -/* 3 */ +/* 4 */ /***/ (function(module, exports) { /** @@ -1237,33 +1264,6 @@ var Clamp = function (value, min, max) module.exports = Clamp; -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * A NOOP (No Operation) callback function. - * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - * - * @function Phaser.Utils.NOOP - * @since 3.0.0 - */ -var NOOP = function () -{ - // NOOP -}; - -module.exports = NOOP; - - /***/ }), /* 5 */ /***/ (function(module, exports) { @@ -1317,6 +1317,62 @@ module.exports = SafeRange; /* 6 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * + * @function Phaser.Utils.Objects.IsPlainObject + * @since 3.0.0 + * + * @param {object} obj - The object to inspect. + * + * @return {boolean} `true` if the object is plain, otherwise `false`. + */ +var IsPlainObject = function (obj) +{ + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) + { + return false; + } + + // Support: Firefox <20 + // The try/catch suppresses exceptions thrown when attempting to access + // the "constructor" property of certain host objects, ie. |window.location| + // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 + try + { + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) + { + return false; + } + } + catch (e) + { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; +}; + +module.exports = IsPlainObject; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -1346,7 +1402,7 @@ module.exports = Wrap; /***/ }), -/* 7 */ +/* 8 */ /***/ (function(module, exports) { /** @@ -1416,139 +1472,8 @@ var GetValue = function (source, key, defaultValue) module.exports = GetValue; -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a slightly modified version of jQuery.isPlainObject. - * A plain object is an object whose internal class property is [object Object]. - * - * @function Phaser.Utils.Objects.IsPlainObject - * @since 3.0.0 - * - * @param {object} obj - The object to inspect. - * - * @return {boolean} `true` if the object is plain, otherwise `false`. - */ -var IsPlainObject = function (obj) -{ - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) - { - return false; - } - - // Support: Firefox <20 - // The try/catch suppresses exceptions thrown when attempting to access - // the "constructor" property of certain host objects, ie. |window.location| - // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 - try - { - if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) - { - return false; - } - } - catch (e) - { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; -}; - -module.exports = IsPlainObject; - - /***/ }), /* 9 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(2); - -/** - * Takes an angle in Phasers default clockwise format and converts it so that - * 0 is North, 90 is West, 180 is South and 270 is East, - * therefore running counter-clockwise instead of clockwise. - * - * You can pass in the angle from a Game Object using: - * - * ```javascript - * var converted = CounterClockwise(gameobject.rotation); - * ``` - * - * All values for this function are in radians. - * - * @function Phaser.Math.Angle.CounterClockwise - * @since 3.16.0 - * - * @param {number} angle - The angle to convert, in radians. - * - * @return {number} The converted angle, in radians. - */ -var CounterClockwise = function (angle) -{ - if (angle > Math.PI) - { - angle -= CONST.PI2; - } - - return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); -}; - -module.exports = CounterClockwise; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(2); - -/** - * Convert the given angle in radians, to the equivalent angle in degrees. - * - * @function Phaser.Math.RadToDeg - * @since 3.0.0 - * - * @param {number} radians - The angle in radians to convert ot degrees. - * - * @return {integer} The given angle converted to degrees. - */ -var RadToDeg = function (radians) -{ - return radians * CONST.RAD_TO_DEG; -}; - -module.exports = RadToDeg; - - -/***/ }), -/* 11 */ /***/ (function(module, exports) { /** @@ -1591,7 +1516,7 @@ module.exports = GetFastValue; /***/ }), -/* 12 */ +/* 10 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1601,7 +1526,7 @@ module.exports = GetFastValue; */ var Class = __webpack_require__(0); -var GEOM_CONST = __webpack_require__(25); +var GEOM_CONST = __webpack_require__(26); /** * @classdesc @@ -1683,8 +1608,1129 @@ var Point = new Class({ module.exports = Point; +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(3); + +/** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * + * @function Phaser.Math.Angle.CounterClockwise + * @since 3.16.0 + * + * @param {number} angle - The angle to convert, in radians. + * + * @return {number} The converted angle, in radians. + */ +var CounterClockwise = function (angle) +{ + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); +}; + +module.exports = CounterClockwise; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A representation of a vector in 3D space. + * + * A three-component vector. + * + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) + { + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; + } + +}); + +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; + + /***/ }), /* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(3); + +/** + * Convert the given angle in radians, to the equivalent angle in degrees. + * + * @function Phaser.Math.RadToDeg + * @since 3.0.0 + * + * @param {number} radians - The angle in radians to convert ot degrees. + * + * @return {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), +/* 14 */ /***/ (function(module, exports) { /** @@ -1836,7 +2882,7 @@ module.exports = FILE_CONST; /***/ }), -/* 14 */ +/* 15 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1845,8 +2891,8 @@ module.exports = FILE_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CheckMatrix = __webpack_require__(23); -var TransposeMatrix = __webpack_require__(56); +var CheckMatrix = __webpack_require__(24); +var TransposeMatrix = __webpack_require__(55); /** * Rotates the array matrix based on the given rotation value. @@ -1856,6 +2902,20 @@ var TransposeMatrix = __webpack_require__(56); * * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateMatrix * @since 3.0.0 * @@ -1908,7 +2968,7 @@ module.exports = RotateMatrix; /***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, exports) { /** @@ -1954,7 +3014,7 @@ module.exports = SpliceOne; /***/ }), -/* 16 */ +/* 17 */ /***/ (function(module, exports) { /** @@ -2293,7 +3353,7 @@ module.exports = { /***/ }), -/* 17 */ +/* 18 */ /***/ (function(module, exports) { /** @@ -2322,7 +3382,7 @@ module.exports = FloatBetween; /***/ }), -/* 18 */ +/* 19 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -2331,7 +3391,7 @@ module.exports = FloatBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); +var CONST = __webpack_require__(3); /** * Convert the given angle from degrees, to the equivalent angle in radians. @@ -2351,816 +3411,6 @@ var DegToRad = function (degrees) module.exports = DegToRad; -/***/ }), -/* 19 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A representation of a vector in 3D space. - * - * A three-component vector. - * - * @class Vector3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - */ -var Vector3 = new Class({ - - initialize: - - function Vector3 (x, y, z) - { - /** - * The x component of this Vector. - * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = 0; - - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - }, - - /** - * Set this Vector to point up. - * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. - */ - clone: function () - { - return new Vector3(this.x, this.y, this.z); - }, - - /** - * Calculate the cross (vector) product of two given Vectors. - * - * @method Phaser.Math.Vector3#crossVectors - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - crossVectors: function (a, b) - { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Check whether this Vector is equal to a given Vector. - * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. - * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; - - return this; - }, - - /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. - * - * @method Phaser.Math.Vector3#set - * @since 3.0.0 - * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - set: function (x, y, z) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - } - - return this; - }, - - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; - - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - } - else - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - return this; - }, - - /** - * Perform a component-wise division between this Vector and the given Vector. - * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - divide: function (v) - { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; - - return this; - }, - - /** - * Negate the `x`, `y` and `z` components of this Vector. - * - * @method Phaser.Math.Vector3#negate - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - negate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. - * - * @return {number} The dot product of this Vector and `v`. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z; - }, - - /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. - * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - cross: function (v) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; - - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; - - return this; - }, - - /** - * Linearly interpolate between this Vector and the given Vector. - * - * Interpolates this Vector towards the given Vector. - * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; - } - -}); - -/** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ZERO = new Vector3(); - -/** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.RIGHT = new Vector3(1, 0, 0); - -/** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.LEFT = new Vector3(-1, 0, 0); - -/** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.UP = new Vector3(0, -1, 0); - -/** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.DOWN = new Vector3(0, 1, 0); - -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; - - /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { @@ -3172,9 +3422,1802 @@ module.exports = Vector3; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); +var Vector3 = __webpack_require__(12); + +/** + * @ignore + */ +var EPSILON = 0.000001; + +/** + * @classdesc + * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * + * @class Matrix4 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. + */ +var Matrix4 = new Class({ + + initialize: + + function Matrix4 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(16); + + if (m) + { + // Assume Matrix4 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix4. + * + * @method Phaser.Math.Matrix4#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. + */ + clone: function () + { + return new Matrix4(this); + }, + + /** + * This method is an alias for `Matrix4.copy`. + * + * @method Phaser.Math.Matrix4#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. + * + * @return {this} This Matrix4. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix4#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. + * + * @return {this} This Matrix4. + */ + copy: function (src) + { + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; + + return this; + }, + + /** + * Set the scaling values of this Matrix. + * + * @method Phaser.Math.Matrix4#scaling + * @since 3.0.0 + * + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. + * + * @return {this} This Matrix4. + */ + scaling: function (x, y, z) + { + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; + } + else + { + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; + } + + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; + + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); + + if (!len) + { + y0 = 0; + y1 = 0; + y2 = 0; + } + else + { + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; + } + + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); + }, + + /** + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. + * + * @method Phaser.Math.Matrix4#yawPitchRoll + * @since 3.0.0 + * + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. + * + * @return {this} This Matrix4. + */ + yawPitchRoll: function (yaw, pitch, roll) + { + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + return this; + }, + + /** + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. + * + * @method Phaser.Math.Matrix4#setWorldMatrix + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. + */ + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) + { + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); + + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); + + if (viewMatrix) + { + this.multiplyLocal(viewMatrix); + } + + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); + } + + return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); + } + +}); + +/** + * @ignore + */ +var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ +var _tempMat2 = new Matrix4(); + +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + +module.exports = Matrix4; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var CONST = __webpack_require__(14); var Events = __webpack_require__(202); -var GetFastValue = __webpack_require__(11); +var GetFastValue = __webpack_require__(9); var GetURL = __webpack_require__(213); var MergeXHRSettings = __webpack_require__(44); var XHRLoader = __webpack_require__(214); @@ -3244,7 +5287,18 @@ var File = new Class({ if (!this.type || !this.key) { - throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + throw new Error('Invalid Loader.' + this.type + ' key'); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; } /** @@ -3258,16 +5312,7 @@ var File = new Class({ * @type {object|string} * @since 3.0.0 */ - this.url = GetFastValue(fileConfig, 'url'); - - if (this.url === undefined) - { - this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof this.url === 'string' && this.url.indexOf('blob:') !== 0 && this.url.indexOf('data:') !== 0) - { - this.url = loader.path + this.url; - } + this.url = url; /** * The final URL this file will load from, including baseURL and path. @@ -3710,7 +5755,7 @@ module.exports = File; /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports) { /** @@ -3778,102 +5823,8 @@ var FileTypesManager = { module.exports = FileTypesManager; -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(225), - DESTROY: __webpack_require__(226), - REMOVED_FROM_SCENE: __webpack_require__(227), - VIDEO_COMPLETE: __webpack_require__(228), - VIDEO_CREATED: __webpack_require__(229), - VIDEO_ERROR: __webpack_require__(230), - VIDEO_LOOP: __webpack_require__(231), - VIDEO_PLAY: __webpack_require__(232), - VIDEO_SEEKED: __webpack_require__(233), - VIDEO_SEEKING: __webpack_require__(234), - VIDEO_STOP: __webpack_require__(235), - VIDEO_TIMEOUT: __webpack_require__(236), - VIDEO_UNLOCKED: __webpack_require__(237) - -}; - - /***/ }), /* 23 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if an array can be used as a matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.CheckMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - The array to check. - * - * @return {boolean} `true` if the given `matrix` array is a valid matrix. - */ -var CheckMatrix = function (matrix) -{ - if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0])) - { - return false; - } - - // How long is the first row? - var size = matrix[0].length; - - // Validate the rest of the rows are the same length - for (var i = 1; i < matrix.length; i++) - { - if (matrix[i].length !== size) - { - return false; - } - } - - return true; -}; - -module.exports = CheckMatrix; - - -/***/ }), -/* 24 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3883,5267 +5834,8 @@ module.exports = CheckMatrix; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(313); -var GetPoint = __webpack_require__(60); -var GetPoints = __webpack_require__(314); -var GEOM_CONST = __webpack_require__(25); -var Line = __webpack_require__(315); -var Random = __webpack_require__(320); - -/** - * @classdesc - * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {integer} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [output,$return] - * - * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. - * - * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [point,$return] - * - * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. - */ - getRandomPoint: function (point) - { - return Random(this, point); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GEOM_CONST = { - - /** - * A Circle Geometry object type. - * - * @name Phaser.Geom.CIRCLE - * @type {integer} - * @since 3.19.0 - */ - CIRCLE: 0, - - /** - * An Ellipse Geometry object type. - * - * @name Phaser.Geom.ELLIPSE - * @type {integer} - * @since 3.19.0 - */ - ELLIPSE: 1, - - /** - * A Line Geometry object type. - * - * @name Phaser.Geom.LINE - * @type {integer} - * @since 3.19.0 - */ - LINE: 2, - - /** - * A Point Geometry object type. - * - * @name Phaser.Geom.POINT - * @type {integer} - * @since 3.19.0 - */ - POINT: 3, - - /** - * A Polygon Geometry object type. - * - * @name Phaser.Geom.POLYGON - * @type {integer} - * @since 3.19.0 - */ - POLYGON: 4, - - /** - * A Rectangle Geometry object type. - * - * @name Phaser.Geom.RECTANGLE - * @type {integer} - * @since 3.19.0 - */ - RECTANGLE: 5, - - /** - * A Triangle Geometry object type. - * - * @name Phaser.Geom.TRIANGLE - * @type {integer} - * @since 3.19.0 - */ - TRIANGLE: 6 - -}; - -module.exports = GEOM_CONST; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsPlainObject = __webpack_require__(8); - -// @param {boolean} deep - Perform a deep copy? -// @param {object} target - The target object to copy to. -// @return {object} The extended object. - -/** - * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ - * - * @function Phaser.Utils.Objects.Extend - * @since 3.0.0 - * - * @param {...*} [args] - The objects that will be mixed. - * - * @return {object} The extended object. - */ -var Extend = function () -{ - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') - { - deep = target; - target = arguments[1] || {}; - - // skip the boolean and the target - i = 2; - } - - // extend Phaser if only one argument is passed - if (length === i) - { - target = this; - --i; - } - - for (; i < length; i++) - { - // Only deal with non-null/undefined values - if ((options = arguments[i]) != null) - { - // Extend the base object - for (name in options) - { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target === copy) - { - continue; - } - - // Recurse if we're merging plain objects or arrays - if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) - { - if (copyIsArray) - { - copyIsArray = false; - clone = src && Array.isArray(src) ? src : []; - } - else - { - clone = src && IsPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = Extend(deep, clone, copy); - - // Don't bring in undefined values - } - else if (copy !== undefined) - { - target[name] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -module.exports = Extend; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * @function Phaser.Math.Angle.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var Between = function (x1, y1, x2, y2) -{ - return Math.atan2(y2 - y1, x2 - x1); -}; - -module.exports = Between; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Normalize an angle to the [0, 2pi] range. - * - * @function Phaser.Math.Angle.Normalize - * @since 3.0.0 - * - * @param {number} angle - The angle to normalize, in radians. - * - * @return {number} The normalized angle, in radians. - */ -var Normalize = function (angle) -{ - angle = angle % (2 * Math.PI); - - if (angle >= 0) - { - return angle; - } - else - { - return angle + 2 * Math.PI; - } -}; - -module.exports = Normalize; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MathWrap = __webpack_require__(6); - -/** - * Wrap an angle. - * - * Wraps the angle to a value in the range of -PI to PI. - * - * @function Phaser.Math.Angle.Wrap - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in radians. - * - * @return {number} The wrapped angle, in radians. - */ -var Wrap = function (angle) -{ - return MathWrap(angle, -Math.PI, Math.PI); -}; - -module.exports = Wrap; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Wrap = __webpack_require__(6); - -/** - * Wrap an angle in degrees. - * - * Wraps the angle to a value in the range of -180 to 180. - * - * @function Phaser.Math.Angle.WrapDegrees - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in degrees. - * - * @return {number} The wrapped angle, in degrees. - */ -var WrapDegrees = function (angle) -{ - return Wrap(angle, -180, 180); -}; - -module.exports = WrapDegrees; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; - -module.exports = Equal; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Factorial = __webpack_require__(33); - -/** - * Calculates the Bernstein basis from the three factorial coefficients. - * - * @function Phaser.Math.Bernstein - * @since 3.0.0 - * - * @param {number} n - The first value. - * @param {number} i - The second value. - * - * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) - */ -var Bernstein = function (n, i) -{ - return Factorial(n) / Factorial(i) / Factorial(n - i); -}; - -module.exports = Bernstein; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the factorial of a given number for integer values greater than 0. - * - * @function Phaser.Math.Factorial - * @since 3.0.0 - * - * @param {number} value - A positive integer to calculate the factorial of. - * - * @return {number} The factorial of the given number. - */ -var Factorial = function (value) -{ - if (value === 0) - { - return 1; - } - - var res = value; - - while (--value) - { - res *= value; - } - - return res; -}; - -module.exports = Factorial; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. - * - * @function Phaser.Math.CatmullRom - * @since 3.0.0 - * - * @param {number} t - The amount to interpolate by. - * @param {number} p0 - The first control point. - * @param {number} p1 - The second control point. - * @param {number} p2 - The third control point. - * @param {number} p3 - The fourth control point. - * - * @return {number} The Catmull-Rom value. - */ -var CatmullRom = function (t, p0, p1, p2, p3) -{ - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - var t2 = t * t; - var t3 = t * t2; - - return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; -}; - -module.exports = CatmullRom; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a linear (interpolation) value over t. - * - * @function Phaser.Math.Linear - * @since 3.0.0 - * - * @param {number} p0 - The first point. - * @param {number} p1 - The second point. - * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. - * - * @return {number} The step t% of the way between p0 and p1. - */ -var Linear = function (p0, p1, t) -{ - return (p1 - p0) * t + p0; -}; - -module.exports = Linear; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smooth interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * @function Phaser.Math.SmoothStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmoothStep = function (x, min, max) -{ - if (x <= min) - { - return 0; - } - - if (x >= max) - { - return 1; - } - - x = (x - min) / (max - min); - - return x * x * (3 - 2 * x); -}; - -module.exports = SmoothStep; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smoother interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. - * - * @function Phaser.Math.SmootherStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmootherStep = function (x, min, max) -{ - x = Math.max(0, Math.min(1, (x - min) / (max - min))); - - return x * x * x * (x * (x * 6 - 15) + 10); -}; - -module.exports = SmootherStep; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. - * - * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAround - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAround = function (point, x, y, angle) -{ - var c = Math.cos(angle); - var s = Math.sin(angle); - - var tx = point.x - x; - var ty = point.y - y; - - point.x = tx * c - ty * s + x; - point.y = tx * s + ty * c + y; - - return point; -}; - -module.exports = RotateAround; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. - * - * @function Phaser.Math.RoundAwayFromZero - * @since 3.0.0 - * - * @param {number} value - The number to round. - * - * @return {number} The rounded number, rounded away from zero. - */ -var RoundAwayFromZero = function (value) -{ - // "Opposite" of truncate. - return (value > 0) ? Math.ceil(value) : Math.floor(value); -}; - -module.exports = RoundAwayFromZero; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(1); - -/** - * Takes the `x` and `y` coordinates and transforms them into the same space as - * defined by the position, rotation and scale values. - * - * @function Phaser.Math.TransformXY - * @since 3.0.0 - * - * @param {number} x - The x coordinate to be transformed. - * @param {number} y - The y coordinate to be transformed. - * @param {number} positionX - Horizontal position of the transform point. - * @param {number} positionY - Vertical position of the transform point. - * @param {number} rotation - Rotation of the transform point, in radians. - * @param {number} scaleX - Horizontal scale of the transform point. - * @param {number} scaleY - Vertical scale of the transform point. - * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. - * - * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. - */ -var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) -{ - if (output === undefined) { output = new Vector2(); } - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Rotate and Scale - var a = radianCos * scaleX; - var b = radianSin * scaleX; - var c = -radianSin * scaleY; - var d = radianCos * scaleY; - - // Invert - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); - - return output; -}; - -module.exports = TransformXY; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A three-dimensional matrix. - * - * Defaults to the identity matrix when instantiated. - * - * @class Matrix3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. - */ -var Matrix3 = new Class({ - - initialize: - - function Matrix3 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix3#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(9); - - if (m) - { - // Assume Matrix3 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix3. - * - * @method Phaser.Math.Matrix3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} A clone of this Matrix3. - */ - clone: function () - { - return new Matrix3(this); - }, - - /** - * This method is an alias for `Matrix3.copy`. - * - * @method Phaser.Math.Matrix3#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix3#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Copy the values of a given Matrix4 into this Matrix3. - * - * @method Phaser.Math.Matrix3#fromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromMat4: function (m) - { - var a = m.val; - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix3#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix3#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix3#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - transpose: function () - { - var a = this.val; - var a01 = a[1]; - var a02 = a[2]; - var a12 = a[5]; - - a[1] = a[3]; - a[2] = a[6]; - a[3] = a01; - a[5] = a[7]; - a[6] = a02; - a[7] = a12; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix3#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; - - // Calculate the determinant - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = b01 * det; - a[1] = (-a22 * a01 + a02 * a21) * det; - a[2] = (a12 * a01 - a02 * a11) * det; - a[3] = b11 * det; - a[4] = (a22 * a00 - a02 * a20) * det; - a[5] = (-a12 * a00 + a02 * a10) * det; - a[6] = b21 * det; - a[7] = (-a21 * a00 + a01 * a20) * det; - a[8] = (a11 * a00 - a01 * a10) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix3#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - a[0] = (a11 * a22 - a12 * a21); - a[1] = (a02 * a21 - a01 * a22); - a[2] = (a01 * a12 - a02 * a11); - a[3] = (a12 * a20 - a10 * a22); - a[4] = (a00 * a22 - a02 * a20); - a[5] = (a02 * a10 - a00 * a12); - a[6] = (a10 * a21 - a11 * a20); - a[7] = (a01 * a20 - a00 * a21); - a[8] = (a00 * a11 - a01 * a10); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix3#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix3#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b = src.val; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b10 = b[3]; - var b11 = b[4]; - var b12 = b[5]; - var b20 = b[6]; - var b21 = b[7]; - var b22 = b[8]; - - a[0] = b00 * a00 + b01 * a10 + b02 * a20; - a[1] = b00 * a01 + b01 * a11 + b02 * a21; - a[2] = b00 * a02 + b01 * a12 + b02 * a22; - - a[3] = b10 * a00 + b11 * a10 + b12 * a20; - a[4] = b10 * a01 + b11 * a11 + b12 * a21; - a[5] = b10 * a02 + b11 * a12 + b12 * a22; - - a[6] = b20 * a00 + b21 * a10 + b22 * a20; - a[7] = b20 * a01 + b21 * a11 + b22 * a21; - a[8] = b20 * a02 + b21 * a12 + b22 * a22; - - return this; - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix3#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - translate: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[6] = x * a[0] + y * a[3] + a[6]; - a[7] = x * a[1] + y * a[4] + a[7]; - a[8] = x * a[2] + y * a[5] + a[8]; - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix3#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - rotate: function (rad) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - - var s = Math.sin(rad); - var c = Math.cos(rad); - - a[0] = c * a00 + s * a10; - a[1] = c * a01 + s * a11; - a[2] = c * a02 + s * a12; - - a[3] = c * a10 - s * a00; - a[4] = c * a11 - s * a01; - a[5] = c * a12 - s * a02; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x` and `y` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix3#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - scale: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[0] = x * a[0]; - a[1] = x * a[1]; - a[2] = x * a[2]; - - a[3] = y * a[3]; - a[4] = y * a[4]; - a[5] = y * a[5]; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix3#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - var out = this.val; - - out[0] = 1 - (yy + zz); - out[3] = xy + wz; - out[6] = xz - wy; - - out[1] = xy - wz; - out[4] = 1 - (xx + zz); - out[7] = yz + wx; - - out[2] = xz + wy; - out[5] = yz - wx; - out[8] = 1 - (xx + yy); - - return this; - }, - - /** - * Set the values of this Matrix3 to be normalized from the given Matrix4. - * - * @method Phaser.Math.Matrix3#normalFromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - normalFromMat4: function (m) - { - var a = m.val; - var out = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - - return this; - } - -}); - -module.exports = Matrix3; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - // TODO - Should work with basic values - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - var out = this.val; - - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; - - return this; - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = []; - var m1 = this.val; - var m2 = src.val; - - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; - - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; - - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; - - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; - - return this.fromArray(a); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translate: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scale: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - this.fromArray([ - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromQuat: function (q) - { - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var out = this.val; - - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; - - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var out = this.val; - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - var out = this.val; - - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var out = this.val; - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var out = this.val; - - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix !== undefined) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix !== undefined) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - } - -}); - -var _tempMat1 = new Matrix4(); -var _tempMat2 = new Matrix4(); - -module.exports = Matrix4; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(19); -var Matrix3 = __webpack_require__(41); - -var EPSILON = 0.000001; - -// Some shared 'private' arrays -var siNext = new Int8Array([ 1, 2, 0 ]); -var tmp = new Float32Array([ 0, 0, 0 ]); - -var xUnitVec3 = new Vector3(1, 0, 0); -var yUnitVec3 = new Vector3(0, 1, 0); - -var tmpvec = new Vector3(); -var tmpMat3 = new Matrix3(); - -/** - * @classdesc - * A quaternion. - * - * @class Quaternion - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. - */ -var Quaternion = new Class({ - - initialize: - - function Quaternion (x, y, z, w) - { - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - }, - - /** - * Copy the components of a given Quaternion or Vector into this Quaternion. - * - * @method Phaser.Math.Quaternion#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; - }, - - /** - * Set the components of this Quaternion. - * - * @method Phaser.Math.Quaternion#set - * @since 3.0.0 - * - * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=0] - The w component. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - set: function (x, y, z, w) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - - return this; - }, - - /** - * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. - * - * @method Phaser.Math.Quaternion#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; - - return this; - }, - - /** - * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. - * - * @method Phaser.Math.Quaternion#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; - - return this; - }, - - /** - * Scale this Quaternion by the given value. - * - * @method Phaser.Math.Quaternion#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - scale: function (scale) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; - - return this; - }, - - /** - * Calculate the length of this Quaternion. - * - * @method Phaser.Math.Quaternion#length - * @since 3.0.0 - * - * @return {number} The length of this Quaternion. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Quaternion squared. - * - * @method Phaser.Math.Quaternion#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Quaternion, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Quaternion. - * - * @method Phaser.Math.Quaternion#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Quaternion and the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#dot - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. - * - * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#lerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. - * @param {number} [t=0] - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; - }, - - /** - * Rotates this Quaternion based on the two given vectors. - * - * @method Phaser.Math.Quaternion#rotationTo - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The transform rotation vector. - * @param {Phaser.Math.Vector3} b - The target rotation vector. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotationTo: function (a, b) - { - var dot = a.x * b.x + a.y * b.y + a.z * b.z; - - if (dot < -0.999999) - { - if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) - { - tmpvec.copy(yUnitVec3).cross(a); - } - - tmpvec.normalize(); - - return this.setAxisAngle(tmpvec, Math.PI); - - } - else if (dot > 0.999999) - { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; - } - else - { - tmpvec.copy(a).cross(b); - - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; - - return this.normalize(); - } - }, - - /** - * Set the axes of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxes - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} view - The view axis. - * @param {Phaser.Math.Vector3} right - The right axis. - * @param {Phaser.Math.Vector3} up - The upwards axis. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxes: function (view, right, up) - { - var m = tmpMat3.val; - - m[0] = right.x; - m[3] = right.y; - m[6] = right.z; - - m[1] = up.x; - m[4] = up.y; - m[7] = up.z; - - m[2] = -view.x; - m[5] = -view.y; - m[8] = -view.z; - - return this.fromMat3(tmpMat3).normalize(); - }, - - /** - * Reset this Matrix to an identity (default) Quaternion. - * - * @method Phaser.Math.Quaternion#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - identity: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; - }, - - /** - * Set the axis angle of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxisAngle - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} axis - The axis. - * @param {number} rad - The angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxisAngle: function (axis, rad) - { - rad = rad * 0.5; - - var s = Math.sin(rad); - - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; - }, - - /** - * Multiply this Quaternion by the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - multiply: function (b) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; - }, - - /** - * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#slerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. - * @param {number} t - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - slerp: function (b, t) - { - // benchmarks: http://jsperf.com/quaternion-slerp-implementations - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - // calc cosine - var cosom = ax * bx + ay * by + az * bz + aw * bw; - - // adjust signs (if necessary) - if (cosom < 0) - { - cosom = -cosom; - bx = - bx; - by = - by; - bz = - bz; - bw = - bw; - } - - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - var scale0 = 1 - t; - var scale1 = t; - - // calculate coefficients - if ((1 - cosom) > EPSILON) - { - // standard case (slerp) - var omega = Math.acos(cosom); - var sinom = Math.sin(omega); - - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } - - // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; - }, - - /** - * Invert this Quaternion. - * - * @method Phaser.Math.Quaternion#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - invert: function () - { - var a0 = this.x; - var a1 = this.y; - var a2 = this.z; - var a3 = this.w; - - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = (dot) ? 1 / dot : 0; - - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; - }, - - /** - * Convert this Quaternion into its conjugate. - * - * Sets the x, y and z components. - * - * @method Phaser.Math.Quaternion#conjugate - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - conjugate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Rotate this Quaternion on the X axis. - * - * @method Phaser.Math.Quaternion#rotateX - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateX: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = Math.sin(rad); - var bw = Math.cos(rad); - - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; - }, - - /** - * Rotate this Quaternion on the Y axis. - * - * @method Phaser.Math.Quaternion#rotateY - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateY: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var by = Math.sin(rad); - var bw = Math.cos(rad); - - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; - }, - - /** - * Rotate this Quaternion on the Z axis. - * - * @method Phaser.Math.Quaternion#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateZ: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bz = Math.sin(rad); - var bw = Math.cos(rad); - - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; - }, - - /** - * Create a unit (or rotation) Quaternion from its x, y, and z components. - * - * Sets the w component. - * - * @method Phaser.Math.Quaternion#calculateW - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - calculateW: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); - - return this; - }, - - /** - * Convert the given Matrix into this Quaternion. - * - * @method Phaser.Math.Quaternion#fromMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - fromMat3: function (mat) - { - // benchmarks: - // http://jsperf.com/typed-array-access-speed - // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion - - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var m = mat.val; - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0) - { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - this.w = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; // 1/(4w) - - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; - } - else - { - // |w| <= 1/2 - var i = 0; - - if (m[4] > m[0]) - { - i = 1; - } - - if (m[8] > m[i * 3 + i]) - { - i = 2; - } - - var j = siNext[i]; - var k = siNext[j]; - - // This isn't quite as clean without array access - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); - tmp[i] = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; - - tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; - } - - return this; - } - -}); - -module.exports = Quaternion; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Extend = __webpack_require__(26); -var XHRSettings = __webpack_require__(45); - -/** - * Takes two XHRSettings Objects and creates a new XHRSettings object from them. - * - * The new object is seeded by the values given in the global settings, but any setting in - * the local object overrides the global ones. - * - * @function Phaser.Loader.MergeXHRSettings - * @since 3.0.0 - * - * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. - * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. - */ -var MergeXHRSettings = function (global, local) -{ - var output = (global === undefined) ? XHRSettings() : Extend({}, global); - - if (local) - { - for (var setting in local) - { - if (local[setting] !== undefined) - { - output[setting] = local[setting]; - } - } - } - - return output; -}; - -module.exports = MergeXHRSettings; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Creates an XHRSettings Object with default values. - * - * @function Phaser.Loader.XHRSettings - * @since 3.0.0 - * - * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. - * @param {boolean} [async=true] - Should the XHR request use async or not? - * @param {string} [user=''] - Optional username for the XHR request. - * @param {string} [password=''] - Optional password for the XHR request. - * @param {integer} [timeout=0] - Optional XHR timeout value. - * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. - */ -var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) -{ - if (responseType === undefined) { responseType = ''; } - if (async === undefined) { async = true; } - if (user === undefined) { user = ''; } - if (password === undefined) { password = ''; } - if (timeout === undefined) { timeout = 0; } - if (withCredentials === undefined) { withCredentials = false; } - - // Before sending a request, set the xhr.responseType to "text", - // "arraybuffer", "blob", or "document", depending on your data needs. - // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". - - return { - - // Ignored by the Loader, only used by File. - responseType: responseType, - - async: async, - - // credentials - user: user, - password: password, - - // timeout in ms (0 = no timeout) - timeout: timeout, - - // setRequestHeader - headers: undefined, - header: undefined, - headerValue: undefined, - requestedWith: false, - - // overrideMimeType - overrideMimeType: undefined, - - // withCredentials - withCredentials: withCredentials - - }; -}; - -module.exports = XHRSettings; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for calculating and setting the size of a non-Frame based Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.ComputedSize - * @since 3.0.0 - */ - -var ComputedSize = { - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.ComputedSize#setSize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = ComputedSize; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {integer} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - this.scene.sys.queueDepthSort(); - this._depth = value; - } - - }, - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {integer} value - The depth of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - } - -}; - -module.exports = Depth; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for visually flipping a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Flip - * @since 3.0.0 - */ - -var Flip = { - - /** - * The horizontally flipped state of the Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipX - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipX: false, - - /** - * The vertically flipped state of the Game Object. - * - * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipY - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipY: false, - - /** - * Toggles the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipX - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipX: function () - { - this.flipX = !this.flipX; - - return this; - }, - - /** - * Toggles the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipY - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipY: function () - { - this.flipY = !this.flipY; - - return this; - }, - - /** - * Sets the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlipX - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipX: function (value) - { - this.flipX = value; - - return this; - }, - - /** - * Sets the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#setFlipY - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipY: function (value) - { - this.flipY = value; - - return this; - }, - - /** - * Sets the horizontal and vertical flipped state of this Game Object. - * - * A Game Object that is flipped will render inversed on the flipped axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlip - * @since 3.0.0 - * - * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlip: function (x, y) - { - this.flipX = x; - this.flipY = y; - - return this; - }, - - /** - * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * - * @method Phaser.GameObjects.Components.Flip#resetFlip - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - resetFlip: function () - { - this.flipX = false; - this.flipY = false; - - return this; - } - -}; - -module.exports = Flip; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the Scroll Factor of a Game Object. - * - * @namespace Phaser.GameObjects.Components.ScrollFactor - * @since 3.0.0 - */ - -var ScrollFactor = { - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorX: 1, - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorY: 1, - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor - * @since 3.0.0 - * - * @param {number} x - The horizontal scroll factor of this Game Object. - * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScrollFactor: function (x, y) - { - if (y === undefined) { y = x; } - - this.scrollFactorX = x; - this.scrollFactorY = y; - - return this; - } - -}; - -module.exports = ScrollFactor; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(2); -var TransformMatrix = __webpack_require__(51); -var TransformXY = __webpack_require__(40); -var WrapAngle = __webpack_require__(29); -var WrapAngleDegrees = __webpack_require__(30); -var Vector2 = __webpack_require__(1); - -// global bitmask flag for GameObject.renderMask (used by Scale) -var _FLAG = 4; // 0100 - -/** - * Provides methods used for getting and setting the position, scale and rotation of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Transform - * @since 3.0.0 - */ - -var Transform = { - - /** - * Private internal value. Holds the horizontal scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleX - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleX: 1, - - /** - * Private internal value. Holds the vertical scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleY - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleY: 1, - - /** - * Private internal value. Holds the rotation value in radians. - * - * @name Phaser.GameObjects.Components.Transform#_rotation - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _rotation: 0, - - /** - * The x position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: 0, - - /** - * The y position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: 0, - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - * - * @name Phaser.GameObjects.Components.Transform#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: 0, - - /** - * The w position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: 0, - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - * - * @name Phaser.GameObjects.Components.Transform#scale - * @type {number} - * @default 1 - * @since 3.18.0 - */ - scale: { - - get: function () - { - return (this._scaleX + this._scaleY) / 2; - }, - - set: function (value) - { - this._scaleX = value; - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The horizontal scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleX: { - - get: function () - { - return this._scaleX; - }, - - set: function (value) - { - this._scaleX = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The vertical scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleY: { - - get: function () - { - return this._scaleY; - }, - - set: function (value) - { - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - * - * @name Phaser.GameObjects.Components.Transform#angle - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - angle: { - - get: function () - { - return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); - }, - - set: function (value) - { - // value is in degrees - this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; - } - }, - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - * - * @name Phaser.GameObjects.Components.Transform#rotation - * @type {number} - * @default 1 - * @since 3.0.0 - */ - rotation: { - - get: function () - { - return this._rotation; - }, - - set: function (value) - { - // value is in radians - this._rotation = WrapAngle(value); - } - }, - - /** - * Sets the position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setPosition - * @since 3.0.0 - * - * @param {number} [x=0] - The x position of this Game Object. - * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. - * @param {number} [z=0] - The z position of this Game Object. - * @param {number} [w=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setPosition: function (x, y, z, w) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - if (z === undefined) { z = 0; } - if (w === undefined) { w = 0; } - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - }, - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * - * @method Phaser.GameObjects.Components.Transform#setRandomPosition - * @since 3.8.0 - * - * @param {number} [x=0] - The x position of the top-left of the random area. - * @param {number} [y=0] - The y position of the top-left of the random area. - * @param {number} [width] - The width of the random area. - * @param {number} [height] - The height of the random area. - * - * @return {this} This Game Object instance. - */ - setRandomPosition: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.scene.sys.scale.width; } - if (height === undefined) { height = this.scene.sys.scale.height; } - - this.x = x + (Math.random() * width); - this.y = y + (Math.random() * height); - - return this; - }, - - /** - * Sets the rotation of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setRotation - * @since 3.0.0 - * - * @param {number} [radians=0] - The rotation of this Game Object, in radians. - * - * @return {this} This Game Object instance. - */ - setRotation: function (radians) - { - if (radians === undefined) { radians = 0; } - - this.rotation = radians; - - return this; - }, - - /** - * Sets the angle of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setAngle - * @since 3.0.0 - * - * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. - * - * @return {this} This Game Object instance. - */ - setAngle: function (degrees) - { - if (degrees === undefined) { degrees = 0; } - - this.angle = degrees; - - return this; - }, - - /** - * Sets the scale of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setScale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale of this Game Object. - * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScale: function (x, y) - { - if (x === undefined) { x = 1; } - if (y === undefined) { y = x; } - - this.scaleX = x; - this.scaleY = y; - - return this; - }, - - /** - * Sets the x position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setX - * @since 3.0.0 - * - * @param {number} [value=0] - The x position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setX: function (value) - { - if (value === undefined) { value = 0; } - - this.x = value; - - return this; - }, - - /** - * Sets the y position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setY - * @since 3.0.0 - * - * @param {number} [value=0] - The y position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setY: function (value) - { - if (value === undefined) { value = 0; } - - this.y = value; - - return this; - }, - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * - * @method Phaser.GameObjects.Components.Transform#setZ - * @since 3.0.0 - * - * @param {number} [value=0] - The z position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setZ: function (value) - { - if (value === undefined) { value = 0; } - - this.z = value; - - return this; - }, - - /** - * Sets the w position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setW - * @since 3.0.0 - * - * @param {number} [value=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setW: function (value) - { - if (value === undefined) { value = 0; } - - this.w = value; - - return this; - }, - - /** - * Gets the local transform matrix for this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getLocalTransformMatrix: function (tempMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - - return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - }, - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * - * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getWorldTransformMatrix: function (tempMatrix, parentMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } - - var parent = this.parentContainer; - - if (!parent) - { - return this.getLocalTransformMatrix(tempMatrix); - } - - tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - - while (parent) - { - parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); - - parentMatrix.multiply(tempMatrix, tempMatrix); - - parent = parent.parentContainer; - } - - return tempMatrix; - }, - - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * - * @method Phaser.GameObjects.Components.Transform#getLocalPoint - * @since 3.50.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. - * - * @return {Phaser.Math.Vector2} The translated point. - */ - getLocalPoint: function (x, y, point, camera) - { - if (!point) { point = new Vector2(); } - if (!camera) { camera = this.scene.sys.cameras.main; } - - var csx = camera.scrollX; - var csy = camera.scrollY; - - var px = x + (csx * this.scrollFactorX) - csx; - var py = y + (csy * this.scrollFactorY) - csy; - - if (this.parentContainer) - { - this.getWorldTransformMatrix().applyInverse(px, py, point); - } - else - { - TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); - } - - // Normalize origin - if (this._originComponent) - { - point.x += this._displayOriginX; - point.y += this._displayOriginY; - } - - return point; - }, - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - * - * @method Phaser.GameObjects.Components.Transform#getParentRotation - * @since 3.18.0 - * - * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. - */ - getParentRotation: function () - { - var rotation = 0; - - var parent = this.parentContainer; - - while (parent) - { - rotation += parent.rotation; - - parent = parent.parentContainer; - } - - return rotation; - } - -}; - -module.exports = Transform; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var MATH_CONST = __webpack_require__(2); -var Vector2 = __webpack_require__(1); +var MATH_CONST = __webpack_require__(3); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -10152,7 +6844,4163 @@ module.exports = TransformMatrix; /***/ }), -/* 52 */ +/* 24 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.CheckMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - The array to check. + * + * @return {boolean} `true` if the given `matrix` array is a valid matrix. + */ +var CheckMatrix = function (matrix) +{ + if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0])) + { + return false; + } + + // How long is the first row? + var size = matrix[0].length; + + // Validate the rest of the rows are the same length + for (var i = 1; i < matrix.length; i++) + { + if (matrix[i].length !== size) + { + return false; + } + } + + return true; +}; + +module.exports = CheckMatrix; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Contains = __webpack_require__(296); +var GetPoint = __webpack_require__(59); +var GetPoints = __webpack_require__(297); +var GEOM_CONST = __webpack_require__(26); +var Line = __webpack_require__(298); +var Random = __webpack_require__(303); + +/** + * @classdesc + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) + * + * @class Rectangle + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. + * @param {number} [width=0] - The width of the Rectangle. + * @param {number} [height=0] - The height of the Rectangle. + */ +var Rectangle = new Class({ + + initialize: + + function Rectangle (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + /** + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Rectangle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @name Phaser.Geom.Rectangle#width + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @name Phaser.Geom.Rectangle#height + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.height = height; + }, + + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#contains + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @method Phaser.Geom.Rectangle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * + * @method Phaser.Geom.Rectangle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. + * + * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a random point within the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the position, width, and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setTo + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} y - The Y coordinate of the top left corner of the Rectangle. + * @param {number} width - The width of the Rectangle. + * @param {number} height - The height of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setTo: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @method Phaser.Geom.Rectangle#setEmpty + * @since 3.0.0 + * + * @return {this} This Rectangle object. + */ + setEmpty: function () + { + return this.setTo(0, 0, 0, 0); + }, + + /** + * Sets the position of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setPosition + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Sets the width and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setSize + * @since 3.0.0 + * + * @param {number} width - The width to set the Rectangle to. + * @param {number} [height=width] - The height to set the Rectangle to. + * + * @return {this} This Rectangle object. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @method Phaser.Geom.Rectangle#isEmpty + * @since 3.0.0 + * + * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. + */ + isEmpty: function () + { + return (this.width <= 0 || this.height <= 0); + }, + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineA + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. + */ + getLineA: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.y, this.right, this.y); + + return line; + }, + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. + */ + getLineB: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.y, this.right, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineC + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. + */ + getLineC: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.bottom, this.x, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineD + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. + */ + getLineD: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.bottom, this.x, this.y); + + return line; + }, + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @name Phaser.Geom.Rectangle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () + { + return this.x; + }, + + set: function (value) + { + if (value >= this.right) + { + this.width = 0; + } + else + { + this.width = this.right - value; + } + + this.x = value; + } + + }, + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + * + * @name Phaser.Geom.Rectangle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + this.width; + }, + + set: function (value) + { + if (value <= this.x) + { + this.width = 0; + } + else + { + this.width = value - this.x; + } + } + + }, + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * + * @name Phaser.Geom.Rectangle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y; + }, + + set: function (value) + { + if (value >= this.bottom) + { + this.height = 0; + } + else + { + this.height = (this.bottom - value); + } + + this.y = value; + } + + }, + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * + * @name Phaser.Geom.Rectangle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + this.height; + }, + + set: function (value) + { + if (value <= this.y) + { + this.height = 0; + } + else + { + this.height = value - this.y; + } + } + + }, + + /** + * The x coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerX + * @type {number} + * @since 3.0.0 + */ + centerX: { + + get: function () + { + return this.x + (this.width / 2); + }, + + set: function (value) + { + this.x = value - (this.width / 2); + } + + }, + + /** + * The y coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerY + * @type {number} + * @since 3.0.0 + */ + centerY: { + + get: function () + { + return this.y + (this.height / 2); + }, + + set: function (value) + { + this.y = value - (this.height / 2); + } + + } + +}); + +module.exports = Rectangle; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GEOM_CONST = { + + /** + * A Circle Geometry object type. + * + * @name Phaser.Geom.CIRCLE + * @type {integer} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {integer} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {integer} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {integer} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {integer} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {integer} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {integer} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(6); + +// @param {boolean} deep - Perform a deep copy? +// @param {object} target - The target object to copy to. +// @return {object} The extended object. + +/** + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ + * + * @function Phaser.Utils.Objects.Extend + * @since 3.0.0 + * + * @param {...*} [args] - The objects that will be mixed. + * + * @return {object} The extended object. + */ +var Extend = function () +{ + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') + { + deep = target; + target = arguments[1] || {}; + + // skip the boolean and the target + i = 2; + } + + // extend Phaser if only one argument is passed + if (length === i) + { + target = this; + --i; + } + + for (; i < length; i++) + { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) + { + // Extend the base object + for (name in options) + { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target === copy) + { + continue; + } + + // Recurse if we're merging plain objects or arrays + if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) + { + if (copyIsArray) + { + copyIsArray = false; + clone = src && Array.isArray(src) ? src : []; + } + else + { + clone = src && IsPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = Extend(deep, clone, copy); + + // Don't bring in undefined values + } + else if (copy !== undefined) + { + target[name] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +module.exports = Extend; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * @function Phaser.Math.Angle.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var Between = function (x1, y1, x2, y2) +{ + return Math.atan2(y2 - y1, x2 - x1); +}; + +module.exports = Between; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Normalize an angle to the [0, 2pi] range. + * + * @function Phaser.Math.Angle.Normalize + * @since 3.0.0 + * + * @param {number} angle - The angle to normalize, in radians. + * + * @return {number} The normalized angle, in radians. + */ +var Normalize = function (angle) +{ + angle = angle % (2 * Math.PI); + + if (angle >= 0) + { + return angle; + } + else + { + return angle + 2 * Math.PI; + } +}; + +module.exports = Normalize; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(7); + +/** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * + * @function Phaser.Math.Angle.Wrap + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in radians. + * + * @return {number} The wrapped angle, in radians. + */ +var Wrap = function (angle) +{ + return MathWrap(angle, -Math.PI, Math.PI); +}; + +module.exports = Wrap; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(7); + +/** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * + * @function Phaser.Math.Angle.WrapDegrees + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in degrees. + * + * @return {number} The wrapped angle, in degrees. + */ +var WrapDegrees = function (angle) +{ + return Wrap(angle, -180, 180); +}; + +module.exports = WrapDegrees; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * + * @function Phaser.Math.Fuzzy.Equal + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. + */ +var Equal = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.abs(a - b) < epsilon; +}; + +module.exports = Equal; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(34); + +/** + * Calculates the Bernstein basis from the three factorial coefficients. + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - The first value. + * @param {number} i - The second value. + * + * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the factorial of a given number for integer values greater than 0. + * + * @function Phaser.Math.Factorial + * @since 3.0.0 + * + * @param {number} value - A positive integer to calculate the factorial of. + * + * @return {number} The factorial of the given number. + */ +var Factorial = function (value) +{ + if (value === 0) + { + return 1; + } + + var res = value; + + while (--value) + { + res *= value; + } + + return res; +}; + +module.exports = Factorial; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - The amount to interpolate by. + * @param {number} p0 - The first control point. + * @param {number} p1 - The second control point. + * @param {number} p2 - The third control point. + * @param {number} p3 - The fourth control point. + * + * @return {number} The Catmull-Rom value. + */ +var CatmullRom = function (t, p0, p1, p2, p3) +{ + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + var t2 = t * t; + var t3 = t * t2; + + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; +}; + +module.exports = CatmullRom; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a linear (interpolation) value over t. + * + * @function Phaser.Math.Linear + * @since 3.0.0 + * + * @param {number} p0 - The first point. + * @param {number} p1 - The second point. + * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. + * + * @return {number} The step t% of the way between p0 and p1. + */ +var Linear = function (p0, p1, t) +{ + return (p1 - p0) * t + p0; +}; + +module.exports = Linear; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * @function Phaser.Math.SmoothStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmoothStep = function (x, min, max) +{ + if (x <= min) + { + return 0; + } + + if (x >= max) + { + return 1; + } + + x = (x - min) / (max - min); + + return x * x * (3 - 2 * x); +}; + +module.exports = SmoothStep; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * + * @function Phaser.Math.SmootherStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmootherStep = function (x, min, max) +{ + x = Math.max(0, Math.min(1, (x - min) / (max - min))); + + return x * x * x * (x * (x * 6 - 15) + 10); +}; + +module.exports = SmootherStep; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. + * + * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAround = function (point, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = point.x - x; + var ty = point.y - y; + + point.x = tx * c - ty * s + x; + point.y = tx * s + ty * c + y; + + return point; +}; + +module.exports = RotateAround; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * + * @function Phaser.Math.RoundAwayFromZero + * @since 3.0.0 + * + * @param {number} value - The number to round. + * + * @return {number} The rounded number, rounded away from zero. + */ +var RoundAwayFromZero = function (value) +{ + // "Opposite" of truncate. + return (value > 0) ? Math.ceil(value) : Math.floor(value); +}; + +module.exports = RoundAwayFromZero; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2); + +/** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * + * @function Phaser.Math.TransformXY + * @since 3.0.0 + * + * @param {number} x - The x coordinate to be transformed. + * @param {number} y - The y coordinate to be transformed. + * @param {number} positionX - Horizontal position of the transform point. + * @param {number} positionY - Vertical position of the transform point. + * @param {number} rotation - Rotation of the transform point, in radians. + * @param {number} scaleX - Horizontal scale of the transform point. + * @param {number} scaleY - Vertical scale of the transform point. + * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. + * + * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. + */ +var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) +{ + if (output === undefined) { output = new Vector2(); } + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Rotate and Scale + var a = radianCos * scaleX; + var b = radianSin * scaleX; + var c = -radianSin * scaleY; + var d = radianCos * scaleY; + + // Invert + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); + + return output; +}; + +module.exports = TransformXY; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + * + * @class Matrix3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. + */ +var Matrix3 = new Class({ + + initialize: + + function Matrix3 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix3#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(9); + + if (m) + { + // Assume Matrix3 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix3. + * + * @method Phaser.Math.Matrix3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} A clone of this Matrix3. + */ + clone: function () + { + return new Matrix3(this); + }, + + /** + * This method is an alias for `Matrix3.copy`. + * + * @method Phaser.Math.Matrix3#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix3#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + copy: function (src) + { + var out = this.val; + var a = src.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * + * @method Phaser.Math.Matrix3#fromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromMat4: function (m) + { + var a = m.val; + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix3#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromArray: function (a) + { + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix3#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix3#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + transpose: function () + { + var a = this.val; + var a01 = a[1]; + var a02 = a[2]; + var a12 = a[5]; + + a[1] = a[3]; + a[2] = a[6]; + a[3] = a01; + a[5] = a[7]; + a[6] = a02; + a[7] = a12; + + return this; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix3#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) + { + return null; + } + + det = 1 / det; + + a[0] = b01 * det; + a[1] = (-a22 * a01 + a02 * a21) * det; + a[2] = (a12 * a01 - a02 * a11) * det; + a[3] = b11 * det; + a[4] = (a22 * a00 - a02 * a20) * det; + a[5] = (-a12 * a00 + a02 * a10) * det; + a[6] = b21 * det; + a[7] = (-a21 * a00 + a01 * a20) * det; + a[8] = (a11 * a00 - a01 * a10) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix3#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + a[0] = (a11 * a22 - a12 * a21); + a[1] = (a02 * a21 - a01 * a22); + a[2] = (a01 * a12 - a02 * a11); + a[3] = (a12 * a20 - a10 * a22); + a[4] = (a00 * a22 - a02 * a20); + a[5] = (a02 * a10 - a00 * a12); + a[6] = (a10 * a21 - a11 * a20); + a[7] = (a01 * a20 - a00 * a21); + a[8] = (a00 * a11 - a01 * a10); + + return this; + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix3#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix3#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b = src.val; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b10 = b[3]; + var b11 = b[4]; + var b12 = b[5]; + var b20 = b[6]; + var b21 = b[7]; + var b22 = b[8]; + + a[0] = b00 * a00 + b01 * a10 + b02 * a20; + a[1] = b00 * a01 + b01 * a11 + b02 * a21; + a[2] = b00 * a02 + b01 * a12 + b02 * a22; + + a[3] = b10 * a00 + b11 * a10 + b12 * a20; + a[4] = b10 * a01 + b11 * a11 + b12 * a21; + a[5] = b10 * a02 + b11 * a12 + b12 * a22; + + a[6] = b20 * a00 + b21 * a10 + b22 * a20; + a[7] = b20 * a01 + b21 * a11 + b22 * a21; + a[8] = b20 * a02 + b21 * a12 + b22 * a22; + + return this; + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix3#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + translate: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[6] = x * a[0] + y * a[3] + a[6]; + a[7] = x * a[1] + y * a[4] + a[7]; + a[8] = x * a[2] + y * a[5] + a[8]; + + return this; + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix3#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + rotate: function (rad) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + + var s = Math.sin(rad); + var c = Math.cos(rad); + + a[0] = c * a00 + s * a10; + a[1] = c * a01 + s * a11; + a[2] = c * a02 + s * a12; + + a[3] = c * a10 - s * a00; + a[4] = c * a11 - s * a01; + a[5] = c * a12 - s * a02; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix3#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + scale: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[0] = x * a[0]; + a[1] = x * a[1]; + a[2] = x * a[2]; + + a[3] = y * a[3]; + a[4] = y * a[4]; + a[5] = y * a[5]; + + return this; + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix3#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + var out = this.val; + + out[0] = 1 - (yy + zz); + out[3] = xy + wz; + out[6] = xz - wy; + + out[1] = xy - wz; + out[4] = 1 - (xx + zz); + out[7] = yz + wx; + + out[2] = xz + wy; + out[5] = yz - wx; + out[8] = 1 - (xx + yy); + + return this; + }, + + /** + * Set the values of this Matrix3 to be normalized from the given Matrix4. + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + normalFromMat4: function (m) + { + var a = m.val; + var out = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return null; + } + + det = 1 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return this; + } + +}); + +module.exports = Matrix3; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); +var Matrix3 = __webpack_require__(42); +var NOOP = __webpack_require__(1); +var Vector3 = __webpack_require__(12); + +var EPSILON = 0.000001; + +// Some shared 'private' arrays +var siNext = new Int8Array([ 1, 2, 0 ]); +var tmp = new Float32Array([ 0, 0, 0 ]); + +var xUnitVec3 = new Vector3(1, 0, 0); +var yUnitVec3 = new Vector3(0, 1, 0); + +var tmpvec = new Vector3(); +var tmpMat3 = new Matrix3(); + +/** + * @classdesc + * A quaternion. + * + * @class Quaternion + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. + */ +var Quaternion = new Class({ + + initialize: + + function Quaternion (x, y, z, w) + { + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_x + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_y + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_z + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_w + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); + } + }, + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * + * @method Phaser.Math.Quaternion#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + copy: function (src) + { + return this.set(src); + }, + + /** + * Set the components of this Quaternion and optionally call the `onChangeCallback`. + * + * @method Phaser.Math.Quaternion#set + * @since 3.0.0 + * + * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + set: function (x, y, z, w, update) + { + if (update === undefined) { update = true; } + + if (typeof x === 'object') + { + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; + } + else + { + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); + } + + return this; + }, + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * + * @method Phaser.Math.Quaternion#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + add: function (v) + { + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * + * @method Phaser.Math.Quaternion#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + subtract: function (v) + { + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Scale this Quaternion by the given value. + * + * @method Phaser.Math.Quaternion#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + scale: function (scale) + { + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the length of this Quaternion. + * + * @method Phaser.Math.Quaternion#length + * @since 3.0.0 + * + * @return {number} The length of this Quaternion. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Quaternion squared. + * + * @method Phaser.Math.Quaternion#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Quaternion, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Quaternion. + * + * @method Phaser.Math.Quaternion#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; + } + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#dot + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. + * + * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#lerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. + * @param {number} [t=0] - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); + }, + + /** + * Rotates this Quaternion based on the two given vectors. + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The transform rotation vector. + * @param {Phaser.Math.Vector3} b - The target rotation vector. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotationTo: function (a, b) + { + var dot = a.x * b.x + a.y * b.y + a.z * b.z; + + if (dot < -0.999999) + { + if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) + { + tmpvec.copy(yUnitVec3).cross(a); + } + + tmpvec.normalize(); + + return this.setAxisAngle(tmpvec, Math.PI); + + } + else if (dot > 0.999999) + { + return this.set(0, 0, 0, 1); + } + else + { + tmpvec.copy(a).cross(b); + + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; + + return this.normalize(); + } + }, + + /** + * Set the axes of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxes + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} view - The view axis. + * @param {Phaser.Math.Vector3} right - The right axis. + * @param {Phaser.Math.Vector3} up - The upwards axis. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxes: function (view, right, up) + { + var m = tmpMat3.val; + + m[0] = right.x; + m[3] = right.y; + m[6] = right.z; + + m[1] = up.x; + m[4] = up.y; + m[7] = up.z; + + m[2] = -view.x; + m[5] = -view.y; + m[8] = -view.z; + + return this.fromMat3(tmpMat3).normalize(); + }, + + /** + * Reset this Matrix to an identity (default) Quaternion. + * + * @method Phaser.Math.Quaternion#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + identity: function () + { + return this.set(0, 0, 0, 1); + }, + + /** + * Set the axis angle of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxisAngle + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} axis - The axis. + * @param {number} rad - The angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxisAngle: function (axis, rad) + { + rad = rad * 0.5; + + var s = Math.sin(rad); + + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); + }, + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + multiply: function (b) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); + }, + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#slerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. + * @param {number} t - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + slerp: function (b, t) + { + // benchmarks: http://jsperf.com/quaternion-slerp-implementations + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + // calc cosine + var cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if (cosom < 0) + { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + var scale0 = 1 - t; + var scale1 = t; + + // calculate coefficients + if ((1 - cosom) > EPSILON) + { + // standard case (slerp) + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } + + // calculate final values + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); + }, + + /** + * Invert this Quaternion. + * + * @method Phaser.Math.Quaternion#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + invert: function () + { + var a0 = this.x; + var a1 = this.y; + var a2 = this.z; + var a3 = this.w; + + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = (dot) ? 1 / dot : 0; + + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); + }, + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + * + * @method Phaser.Math.Quaternion#conjugate + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + conjugate: function () + { + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Rotate this Quaternion on the X axis. + * + * @method Phaser.Math.Quaternion#rotateX + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateX: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); + }, + + /** + * Rotate this Quaternion on the Y axis. + * + * @method Phaser.Math.Quaternion#rotateY + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateY: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var by = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); + }, + + /** + * Rotate this Quaternion on the Z axis. + * + * @method Phaser.Math.Quaternion#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateZ: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bz = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); + }, + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + * + * @method Phaser.Math.Quaternion#calculateW + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + calculateW: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); + + return this; + }, + + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + + /** + * Convert the given Matrix into this Quaternion. + * + * @method Phaser.Math.Quaternion#fromMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + fromMat3: function (mat) + { + // benchmarks: + // http://jsperf.com/typed-array-access-speed + // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion + + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var m = mat.val; + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0) + { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + this.w = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; // 1/(4w) + + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; + } + else + { + // |w| <= 1/2 + var i = 0; + + if (m[4] > m[0]) + { + i = 1; + } + + if (m[8] > m[i * 3 + i]) + { + i = 2; + } + + var j = siNext[i]; + var k = siNext[j]; + + // This isn't quite as clean without array access + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + tmp[i] = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; + + tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + } + + this.onChangeCallback(this); + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(27); +var XHRSettings = __webpack_require__(45); + +/** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * + * @function Phaser.Loader.MergeXHRSettings + * @since 3.0.0 + * + * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. + * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. + */ +var MergeXHRSettings = function (global, local) +{ + var output = (global === undefined) ? XHRSettings() : Extend({}, global); + + if (local) + { + for (var setting in local) + { + if (local[setting] !== undefined) + { + output[setting] = local[setting]; + } + } + } + + return output; +}; + +module.exports = MergeXHRSettings; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates an XHRSettings Object with default values. + * + * @function Phaser.Loader.XHRSettings + * @since 3.0.0 + * + * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. + * @param {boolean} [async=true] - Should the XHR request use async or not? + * @param {string} [user=''] - Optional username for the XHR request. + * @param {string} [password=''] - Optional password for the XHR request. + * @param {integer} [timeout=0] - Optional XHR timeout value. + * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + if (withCredentials === undefined) { withCredentials = false; } + + // Before sending a request, set the xhr.responseType to "text", + // "arraybuffer", "blob", or "document", depending on your data needs. + // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". + + return { + + // Ignored by the Loader, only used by File. + responseType: responseType, + + async: async, + + // credentials + user: user, + password: password, + + // timeout in ms (0 = no timeout) + timeout: timeout, + + // setRequestHeader + headers: undefined, + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined, + + // withCredentials + withCredentials: withCredentials + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.ComputedSize + * @since 3.0.0 + */ + +var ComputedSize = { + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.ComputedSize#setSize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = ComputedSize; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Depth + * @since 3.0.0 + */ + +var Depth = { + + /** + * Private internal value. Holds the depth of the Game Object. + * + * @name Phaser.GameObjects.Components.Depth#_depth + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @name Phaser.GameObjects.Components.Depth#depth + * @type {number} + * @since 3.0.0 + */ + depth: { + + get: function () + { + return this._depth; + }, + + set: function (value) + { + this.scene.sys.queueDepthSort(); + this._depth = value; + } + + }, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @method Phaser.GameObjects.Components.Depth#setDepth + * @since 3.0.0 + * + * @param {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Flip + * @since 3.0.0 + */ + +var Flip = { + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipX: false, + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipY: false, + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipX + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipX: function () + { + this.flipX = !this.flipX; + + return this; + }, + + /** + * Toggles the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipY + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipY: function () + { + this.flipY = !this.flipY; + + return this; + }, + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlipX + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipX: function (value) + { + this.flipX = value; + + return this; + }, + + /** + * Sets the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#setFlipY + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipY: function (value) + { + this.flipY = value; + + return this; + }, + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlip + * @since 3.0.0 + * + * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlip: function (x, y) + { + this.flipX = x; + this.flipY = y; + + return this; + }, + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + * + * @method Phaser.GameObjects.Components.Flip#resetFlip + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + resetFlip: function () + { + this.flipX = false; + this.flipY = false; + + return this; + } + +}; + +module.exports = Flip; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + * + * @namespace Phaser.GameObjects.Components.ScrollFactor + * @since 3.0.0 + */ + +var ScrollFactor = { + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorX: 1, + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorY: 1, + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of this Game Object. + * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScrollFactor: function (x, y) + { + if (y === undefined) { y = x; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + return this; + } + +}; + +module.exports = ScrollFactor; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(3); +var TransformMatrix = __webpack_require__(23); +var TransformXY = __webpack_require__(41); +var WrapAngle = __webpack_require__(30); +var WrapAngleDegrees = __webpack_require__(31); +var Vector2 = __webpack_require__(2); + +// global bitmask flag for GameObject.renderMask (used by Scale) +var _FLAG = 4; // 0100 + +/** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Transform + * @since 3.0.0 + */ + +var Transform = { + + /** + * Private internal value. Holds the horizontal scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleX + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleX: 1, + + /** + * Private internal value. Holds the vertical scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleY + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleY: 1, + + /** + * Private internal value. Holds the rotation value in radians. + * + * @name Phaser.GameObjects.Components.Transform#_rotation + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _rotation: 0, + + /** + * The x position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: 0, + + /** + * The y position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: 0, + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + * + * @name Phaser.GameObjects.Components.Transform#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: 0, + + /** + * The w position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: 0, + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + * + * @name Phaser.GameObjects.Components.Transform#scale + * @type {number} + * @default 1 + * @since 3.18.0 + */ + scale: { + + get: function () + { + return (this._scaleX + this._scaleY) / 2; + }, + + set: function (value) + { + this._scaleX = value; + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The horizontal scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The vertical scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + * + * @name Phaser.GameObjects.Components.Transform#angle + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + angle: { + + get: function () + { + return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); + }, + + set: function (value) + { + // value is in degrees + this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; + } + }, + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + * + * @name Phaser.GameObjects.Components.Transform#rotation + * @type {number} + * @default 1 + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + // value is in radians + this._rotation = WrapAngle(value); + } + }, + + /** + * Sets the position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of this Game Object. + * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. + * @param {number} [z=0] - The z position of this Game Object. + * @param {number} [w=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setPosition: function (x, y, z, w) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + if (z === undefined) { z = 0; } + if (w === undefined) { w = 0; } + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + }, + + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * + * @method Phaser.GameObjects.Components.Transform#setRandomPosition + * @since 3.8.0 + * + * @param {number} [x=0] - The x position of the top-left of the random area. + * @param {number} [y=0] - The y position of the top-left of the random area. + * @param {number} [width] - The width of the random area. + * @param {number} [height] - The height of the random area. + * + * @return {this} This Game Object instance. + */ + setRandomPosition: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + + this.x = x + (Math.random() * width); + this.y = y + (Math.random() * height); + + return this; + }, + + /** + * Sets the rotation of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setRotation + * @since 3.0.0 + * + * @param {number} [radians=0] - The rotation of this Game Object, in radians. + * + * @return {this} This Game Object instance. + */ + setRotation: function (radians) + { + if (radians === undefined) { radians = 0; } + + this.rotation = radians; + + return this; + }, + + /** + * Sets the angle of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setAngle + * @since 3.0.0 + * + * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. + * + * @return {this} This Game Object instance. + */ + setAngle: function (degrees) + { + if (degrees === undefined) { degrees = 0; } + + this.angle = degrees; + + return this; + }, + + /** + * Sets the scale of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setScale + * @since 3.0.0 + * + * @param {number} x - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScale: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.scaleX = x; + this.scaleY = y; + + return this; + }, + + /** + * Sets the x position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setX + * @since 3.0.0 + * + * @param {number} [value=0] - The x position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setX: function (value) + { + if (value === undefined) { value = 0; } + + this.x = value; + + return this; + }, + + /** + * Sets the y position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setY + * @since 3.0.0 + * + * @param {number} [value=0] - The y position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setY: function (value) + { + if (value === undefined) { value = 0; } + + this.y = value; + + return this; + }, + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * + * @method Phaser.GameObjects.Components.Transform#setZ + * @since 3.0.0 + * + * @param {number} [value=0] - The z position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setZ: function (value) + { + if (value === undefined) { value = 0; } + + this.z = value; + + return this; + }, + + /** + * Sets the w position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setW + * @since 3.0.0 + * + * @param {number} [value=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setW: function (value) + { + if (value === undefined) { value = 0; } + + this.w = value; + + return this; + }, + + /** + * Gets the local transform matrix for this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getLocalTransformMatrix: function (tempMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + }, + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * + * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getWorldTransformMatrix: function (tempMatrix, parentMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } + + var parent = this.parentContainer; + + if (!parent) + { + return this.getLocalTransformMatrix(tempMatrix); + } + + tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + + while (parent) + { + parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); + + parentMatrix.multiply(tempMatrix, tempMatrix); + + parent = parent.parentContainer; + } + + return tempMatrix; + }, + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * + * @method Phaser.GameObjects.Components.Transform#getLocalPoint + * @since 3.50.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. + * + * @return {Phaser.Math.Vector2} The translated point. + */ + getLocalPoint: function (x, y, point, camera) + { + if (!point) { point = new Vector2(); } + if (!camera) { camera = this.scene.sys.cameras.main; } + + var csx = camera.scrollX; + var csy = camera.scrollY; + + var px = x + (csx * this.scrollFactorX) - csx; + var py = y + (csy * this.scrollFactorY) - csy; + + if (this.parentContainer) + { + this.getWorldTransformMatrix().applyInverse(px, py, point); + } + else + { + TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); + } + + // Normalize origin + if (this._originComponent) + { + point.x += this._displayOriginX; + point.y += this._displayOriginY; + } + + return point; + }, + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + * + * @method Phaser.GameObjects.Components.Transform#getParentRotation + * @since 3.18.0 + * + * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. + */ + getParentRotation: function () + { + var rotation = 0; + + var parent = this.parentContainer; + + while (parent) + { + rotation += parent.rotation; + + parent = parent.parentContainer; + } + + return rotation; + } + +}; + +module.exports = Transform; + + +/***/ }), +/* 51 */ /***/ (function(module, exports) { /** @@ -10241,7 +11089,7 @@ module.exports = Visible; /***/ }), -/* 53 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10251,10 +11099,10 @@ module.exports = Visible; */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(54); +var ComponentsToJSON = __webpack_require__(53); var DataManager = __webpack_require__(219); -var EventEmitter = __webpack_require__(55); -var Events = __webpack_require__(22); +var EventEmitter = __webpack_require__(226); +var Events = __webpack_require__(54); /** * @classdesc @@ -10282,12 +11130,15 @@ var GameObject = new Class({ EventEmitter.call(this); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * * @name Phaser.GameObjects.GameObject#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; @@ -10979,7 +11830,7 @@ module.exports = GameObject; /***/ }), -/* 54 */ +/* 53 */ /***/ (function(module, exports) { /** @@ -11040,350 +11891,40 @@ module.exports = ToJSON; /***/ }), -/* 55 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ /** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private + * @namespace Phaser.GameObjects.Events */ -function Events() {} -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); +module.exports = { - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} + ADDED_TO_SCENE: __webpack_require__(227), + DESTROY: __webpack_require__(228), + REMOVED_FROM_SCENE: __webpack_require__(229), + VIDEO_COMPLETE: __webpack_require__(230), + VIDEO_CREATED: __webpack_require__(231), + VIDEO_ERROR: __webpack_require__(232), + VIDEO_LOOP: __webpack_require__(233), + VIDEO_PLAY: __webpack_require__(234), + VIDEO_SEEKED: __webpack_require__(235), + VIDEO_SEEKING: __webpack_require__(236), + VIDEO_STOP: __webpack_require__(237), + VIDEO_TIMEOUT: __webpack_require__(238), + VIDEO_UNLOCKED: __webpack_require__(239) -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; }; -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} - /***/ }), -/* 56 */ +/* 55 */ /***/ (function(module, exports) { /** @@ -11397,12 +11938,26 @@ if (true) { * * The transpose of a matrix is a new matrix whose rows are the columns of the original. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.TransposeMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [array,$return] - * + * * @param {T[][]} [array] - The array matrix to transpose. * * @return {T[][]} A new array matrix which is a transposed version of the given array. @@ -11430,6 +11985,46 @@ var TransposeMatrix = function (array) module.exports = TransposeMatrix; +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + /***/ }), /* 57 */ /***/ (function(module, exports) { @@ -11441,77 +12036,33 @@ module.exports = TransposeMatrix; */ /** - * Searches a pre-sorted array for the closet value to the given number. + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. * - * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, - * and will check for the closest value of those to the given number. - * - * @function Phaser.Utils.Array.FindClosestInSorted + * @function Phaser.Utils.Array.RotateRight * @since 3.0.0 * - * @param {number} value - The value to search for in the array. - * @param {array} array - The array to search, which must be sorted. - * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. * - * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + * @return {*} The most recently shifted element. */ -var FindClosestInSorted = function (value, array, key) +var RotateRight = function (array, total) { - if (!array.length) + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) { - return NaN; - } - else if (array.length === 1) - { - return array[0]; + element = array.pop(); + array.unshift(element); } - var i = 1; - var low; - var high; - - if (key) - { - if (value < array[0][key]) - { - return array[0]; - } - - while (array[i][key] < value) - { - i++; - } - } - else - { - while (array[i] < value) - { - i++; - } - } - - if (i > array.length) - { - i = array.length; - } - - if (key) - { - low = array[i - 1][key]; - high = array[i][key]; - - return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; - } - else - { - low = array[i - 1]; - high = array[i]; - - return ((high - value) <= (value - low)) ? high : low; - } + return element; }; -module.exports = FindClosestInSorted; +module.exports = RotateRight; /***/ }), @@ -11565,46 +12116,8 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Animations.Events - */ - -module.exports = { - - ADD_ANIMATION: __webpack_require__(291), - ANIMATION_COMPLETE: __webpack_require__(292), - ANIMATION_REPEAT: __webpack_require__(293), - ANIMATION_RESTART: __webpack_require__(294), - ANIMATION_START: __webpack_require__(295), - PAUSE_ALL: __webpack_require__(296), - REMOVE_ANIMATION: __webpack_require__(297), - RESUME_ALL: __webpack_require__(298), - SPRITE_ANIMATION_COMPLETE: __webpack_require__(299), - SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(300), - SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(301), - SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(302), - SPRITE_ANIMATION_KEY_START: __webpack_require__(303), - SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(304), - SPRITE_ANIMATION_REPEAT: __webpack_require__(305), - SPRITE_ANIMATION_RESTART: __webpack_require__(306), - SPRITE_ANIMATION_START: __webpack_require__(307), - SPRITE_ANIMATION_UPDATE: __webpack_require__(308) - -}; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Perimeter = __webpack_require__(61); -var Point = __webpack_require__(12); +var Perimeter = __webpack_require__(60); +var Point = __webpack_require__(10); /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. @@ -11675,7 +12188,7 @@ module.exports = GetPoint; /***/ }), -/* 61 */ +/* 60 */ /***/ (function(module, exports) { /** @@ -11703,7 +12216,7 @@ module.exports = Perimeter; /***/ }), -/* 62 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11712,16 +12225,19 @@ module.exports = Perimeter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(63); +var BuildGameObject = __webpack_require__(62); var Class = __webpack_require__(0); -var GetValue = __webpack_require__(7); +var GetValue = __webpack_require__(8); var ResizeEvent = __webpack_require__(174); var ScenePlugin = __webpack_require__(175); var Spine = __webpack_require__(199); var SpineFile = __webpack_require__(200); var SpineGameObject = __webpack_require__(218); -var SpineContainer = __webpack_require__(248); -var NOOP = __webpack_require__(4); +var SpineContainer = __webpack_require__(251); +var NOOP = __webpack_require__(1); + +// Plugin specific instance of the Spine Scene Renderer +var sceneRenderer; /** * @classdesc @@ -11784,10 +12300,15 @@ var NOOP = __webpack_require__(4); * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true); * ``` * - * It also installs a Game Object Factory method, allowing you to create Spine Game Objects: + * It also installs two Game Object Factory methods, allowing you to create Spine Game Objects + * and Spine Containers: * * ```javascript - * this.add.spine(512, 650, 'stretchyman') + * const man = this.add.spine(512, 650, 'stretchyman'); + * + * const container = this.add.spineContainer(); + * + * container.add(man); * ``` * * The first argument is the key which you used when importing the Spine data. There are lots of @@ -11919,6 +12440,8 @@ var SpinePlugin = new Class({ /** * An instance of the Spine WebGL Scene Renderer. * + * There is only one instance of the Scene Renderer shared across the whole plugin. + * * Only set if running in WebGL mode. * * @name SpinePlugin#sceneRenderer @@ -11949,7 +12472,7 @@ var SpinePlugin = new Class({ /** * A reference to the Spine runtime. - * This is the runtime created by Esoteric Software + * This is the runtime created by Esoteric Software. * * @name SpinePlugin#plugin * @type {spine} @@ -12087,7 +12610,7 @@ var SpinePlugin = new Class({ pluginManager.registerFileType('spine', this.spineFileCallback, scene); pluginManager.registerGameObject('spine', add, make); - pluginManager.registerGameObject('spinecontainer', addContainer, makeContainer); + pluginManager.registerGameObject('spineContainer', addContainer, makeContainer); }, /** @@ -12114,6 +12637,8 @@ var SpinePlugin = new Class({ eventEmitter.once('shutdown', this.shutdown, this); eventEmitter.once('destroy', this.destroy, this); + + this.game.events.once('destroy', this.gameDestroy, this); }, /** @@ -12137,8 +12662,6 @@ var SpinePlugin = new Class({ */ bootWebGL: function () { - this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); - // Monkeypatch the Spine setBlendMode functions, or batching is destroyed! var setBlendMode = function (srcBlend, dstBlend) @@ -12158,11 +12681,17 @@ var SpinePlugin = new Class({ } }; - this.sceneRenderer.batcher.setBlendMode = setBlendMode; - this.sceneRenderer.shapes.setBlendMode = setBlendMode; + if (!sceneRenderer) + { + sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + sceneRenderer.batcher.setBlendMode = setBlendMode; + sceneRenderer.shapes.setBlendMode = setBlendMode; + } - this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; - this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer; + // All share the same instance + this.sceneRenderer = sceneRenderer; + this.skeletonRenderer = sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer; this.temp1 = new Spine.webgl.Vector3(0, 0, 0); this.temp2 = new Spine.webgl.Vector3(0, 0, 0); @@ -12760,8 +13289,7 @@ var SpinePlugin = new Class({ sceneRenderer.camera.position.x = viewportWidth / 2; sceneRenderer.camera.position.y = viewportHeight / 2; - sceneRenderer.camera.viewportWidth = viewportWidth; - sceneRenderer.camera.viewportHeight = viewportHeight; + sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); }, /** @@ -12798,14 +13326,6 @@ var SpinePlugin = new Class({ { this.shutdown(); - if (this.sceneRenderer) - { - this.sceneRenderer.dispose(); - } - - this.pluginManager.removeGameObject('spine', true, true); - - this.pluginManager = null; this.game = null; this.scene = null; this.systems = null; @@ -12814,14 +13334,39 @@ var SpinePlugin = new Class({ this.spineTextures = null; this.json = null; this.textures = null; - this.sceneRenderer = null; this.skeletonRenderer = null; this.gl = null; + }, + + /** + * The Game that owns this plugin is being destroyed. + * + * Dispose of the Scene Renderer and remove the Game Objects. + * + * @method SpinePlugin#gameDestroy + * @private + * @since 3.50.0 + */ + gameDestroy: function () + { + this.destroy(); + + if (sceneRenderer) + { + sceneRenderer.dispose(); + } + + this.sceneRenderer = null; + this.pluginManager = null; + + this.pluginManager.removeGameObject('spine', true, true); + this.pluginManager.removeGameObject('spineContainer', true, true); } }); SpinePlugin.SpineGameObject = SpineGameObject; +SpinePlugin.SpineContainer = SpineContainer; /** * Creates a new Spine Game Object and adds it to the Scene. @@ -12893,7 +13438,7 @@ module.exports = SpinePlugin; /***/ }), -/* 63 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12902,8 +13447,8 @@ module.exports = SpinePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(16); -var GetAdvancedValue = __webpack_require__(64); +var BlendModes = __webpack_require__(17); +var GetAdvancedValue = __webpack_require__(63); /** * Builds a Game Object using the provided configuration object. @@ -13021,7 +13566,7 @@ module.exports = BuildGameObject; /***/ }), -/* 64 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13030,8 +13575,8 @@ module.exports = BuildGameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(65); -var GetValue = __webpack_require__(7); +var MATH = __webpack_require__(64); +var GetValue = __webpack_require__(8); /** * Retrieves a value from an object. Allows for more advanced selection options, including: @@ -13108,7 +13653,7 @@ module.exports = GetAdvancedValue; /***/ }), -/* 65 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13117,8 +13662,8 @@ module.exports = GetAdvancedValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); -var Extend = __webpack_require__(26); +var CONST = __webpack_require__(3); +var Extend = __webpack_require__(27); /** * @namespace Phaser.Math @@ -13127,61 +13672,62 @@ var Extend = __webpack_require__(26); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(66), - Distance: __webpack_require__(75), - Easing: __webpack_require__(83), - Fuzzy: __webpack_require__(128), - Interpolation: __webpack_require__(133), - Pow2: __webpack_require__(141), - Snap: __webpack_require__(145), + Angle: __webpack_require__(65), + Distance: __webpack_require__(74), + Easing: __webpack_require__(82), + Fuzzy: __webpack_require__(127), + Interpolation: __webpack_require__(132), + Pow2: __webpack_require__(140), + Snap: __webpack_require__(144), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(149), + RandomDataGenerator: __webpack_require__(148), // Single functions - Average: __webpack_require__(150), - Bernstein: __webpack_require__(32), - Between: __webpack_require__(151), - CatmullRom: __webpack_require__(34), - CeilTo: __webpack_require__(152), - Clamp: __webpack_require__(3), - DegToRad: __webpack_require__(18), - Difference: __webpack_require__(153), - Factorial: __webpack_require__(33), - FloatBetween: __webpack_require__(17), + Average: __webpack_require__(149), + Bernstein: __webpack_require__(33), + Between: __webpack_require__(150), + CatmullRom: __webpack_require__(35), + CeilTo: __webpack_require__(151), + Clamp: __webpack_require__(4), + DegToRad: __webpack_require__(19), + Difference: __webpack_require__(152), + Euler: __webpack_require__(153), + Factorial: __webpack_require__(34), + FloatBetween: __webpack_require__(18), FloorTo: __webpack_require__(154), FromPercent: __webpack_require__(155), GetSpeed: __webpack_require__(156), IsEven: __webpack_require__(157), IsEvenStrict: __webpack_require__(158), - Linear: __webpack_require__(35), + Linear: __webpack_require__(36), MaxAdd: __webpack_require__(159), MinSub: __webpack_require__(160), Percent: __webpack_require__(161), - RadToDeg: __webpack_require__(10), + RadToDeg: __webpack_require__(13), RandomXY: __webpack_require__(162), RandomXYZ: __webpack_require__(163), RandomXYZW: __webpack_require__(164), Rotate: __webpack_require__(165), - RotateAround: __webpack_require__(38), + RotateAround: __webpack_require__(39), RotateAroundDistance: __webpack_require__(166), RotateTo: __webpack_require__(167), - RoundAwayFromZero: __webpack_require__(39), + RoundAwayFromZero: __webpack_require__(40), RoundTo: __webpack_require__(168), SinCosTableGenerator: __webpack_require__(169), - SmootherStep: __webpack_require__(37), - SmoothStep: __webpack_require__(36), + SmootherStep: __webpack_require__(38), + SmoothStep: __webpack_require__(37), ToXY: __webpack_require__(170), - TransformXY: __webpack_require__(40), + TransformXY: __webpack_require__(41), Within: __webpack_require__(171), - Wrap: __webpack_require__(6), + Wrap: __webpack_require__(7), // Vector classes - Vector2: __webpack_require__(1), - Vector3: __webpack_require__(19), + Vector2: __webpack_require__(2), + Vector3: __webpack_require__(12), Vector4: __webpack_require__(172), - Matrix3: __webpack_require__(41), - Matrix4: __webpack_require__(42), + Matrix3: __webpack_require__(42), + Matrix4: __webpack_require__(20), Quaternion: __webpack_require__(43), RotateVec3: __webpack_require__(173) @@ -13197,7 +13743,7 @@ module.exports = PhaserMath; /***/ }), -/* 66 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13212,25 +13758,25 @@ module.exports = PhaserMath; module.exports = { - Between: __webpack_require__(27), - BetweenPoints: __webpack_require__(67), - BetweenPointsY: __webpack_require__(68), - BetweenY: __webpack_require__(69), - CounterClockwise: __webpack_require__(9), - Normalize: __webpack_require__(28), - Random: __webpack_require__(70), - RandomDegrees: __webpack_require__(71), - Reverse: __webpack_require__(72), - RotateTo: __webpack_require__(73), - ShortestBetween: __webpack_require__(74), - Wrap: __webpack_require__(29), - WrapDegrees: __webpack_require__(30) + Between: __webpack_require__(28), + BetweenPoints: __webpack_require__(66), + BetweenPointsY: __webpack_require__(67), + BetweenY: __webpack_require__(68), + CounterClockwise: __webpack_require__(11), + Normalize: __webpack_require__(29), + Random: __webpack_require__(69), + RandomDegrees: __webpack_require__(70), + Reverse: __webpack_require__(71), + RotateTo: __webpack_require__(72), + ShortestBetween: __webpack_require__(73), + Wrap: __webpack_require__(30), + WrapDegrees: __webpack_require__(31) }; /***/ }), -/* 67 */ +/* 66 */ /***/ (function(module, exports) { /** @@ -13261,7 +13807,7 @@ module.exports = BetweenPoints; /***/ }), -/* 68 */ +/* 67 */ /***/ (function(module, exports) { /** @@ -13293,7 +13839,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 69 */ +/* 68 */ /***/ (function(module, exports) { /** @@ -13327,7 +13873,7 @@ module.exports = BetweenY; /***/ }), -/* 70 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13337,7 +13883,7 @@ module.exports = BetweenY; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(17); +var FloatBetween = __webpack_require__(18); /** * Returns a random angle in the range [-pi, pi]. @@ -13356,7 +13902,7 @@ module.exports = Random; /***/ }), -/* 71 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13366,7 +13912,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var FloatBetween = __webpack_require__(17); +var FloatBetween = __webpack_require__(18); /** * Returns a random angle in the range [-180, 180]. @@ -13385,7 +13931,7 @@ module.exports = RandomDegrees; /***/ }), -/* 72 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13394,7 +13940,7 @@ module.exports = RandomDegrees; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(28); +var Normalize = __webpack_require__(29); /** * Reverse the given angle. @@ -13415,7 +13961,7 @@ module.exports = Reverse; /***/ }), -/* 73 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13424,7 +13970,7 @@ module.exports = Reverse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(2); +var MATH_CONST = __webpack_require__(3); /** * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. @@ -13482,7 +14028,7 @@ module.exports = RotateTo; /***/ }), -/* 74 */ +/* 73 */ /***/ (function(module, exports) { /** @@ -13531,7 +14077,7 @@ module.exports = ShortestBetween; /***/ }), -/* 75 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13546,19 +14092,19 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(76), - BetweenPoints: __webpack_require__(77), - BetweenPointsSquared: __webpack_require__(78), - Chebyshev: __webpack_require__(79), - Power: __webpack_require__(80), - Snake: __webpack_require__(81), - Squared: __webpack_require__(82) + Between: __webpack_require__(75), + BetweenPoints: __webpack_require__(76), + BetweenPointsSquared: __webpack_require__(77), + Chebyshev: __webpack_require__(78), + Power: __webpack_require__(79), + Snake: __webpack_require__(80), + Squared: __webpack_require__(81) }; /***/ }), -/* 76 */ +/* 75 */ /***/ (function(module, exports) { /** @@ -13592,7 +14138,7 @@ module.exports = DistanceBetween; /***/ }), -/* 77 */ +/* 76 */ /***/ (function(module, exports) { /** @@ -13624,7 +14170,7 @@ module.exports = DistanceBetweenPoints; /***/ }), -/* 78 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -13656,7 +14202,7 @@ module.exports = DistanceBetweenPointsSquared; /***/ }), -/* 79 */ +/* 78 */ /***/ (function(module, exports) { /** @@ -13690,7 +14236,7 @@ module.exports = ChebyshevDistance; /***/ }), -/* 80 */ +/* 79 */ /***/ (function(module, exports) { /** @@ -13724,7 +14270,7 @@ module.exports = DistancePower; /***/ }), -/* 81 */ +/* 80 */ /***/ (function(module, exports) { /** @@ -13758,7 +14304,7 @@ module.exports = SnakeDistance; /***/ }), -/* 82 */ +/* 81 */ /***/ (function(module, exports) { /** @@ -13792,7 +14338,7 @@ module.exports = DistanceSquared; /***/ }), -/* 83 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13807,24 +14353,24 @@ module.exports = DistanceSquared; module.exports = { - Back: __webpack_require__(84), - Bounce: __webpack_require__(88), - Circular: __webpack_require__(92), - Cubic: __webpack_require__(96), - Elastic: __webpack_require__(100), - Expo: __webpack_require__(104), - Linear: __webpack_require__(108), - Quadratic: __webpack_require__(110), - Quartic: __webpack_require__(114), - Quintic: __webpack_require__(118), - Sine: __webpack_require__(122), - Stepped: __webpack_require__(126) + Back: __webpack_require__(83), + Bounce: __webpack_require__(87), + Circular: __webpack_require__(91), + Cubic: __webpack_require__(95), + Elastic: __webpack_require__(99), + Expo: __webpack_require__(103), + Linear: __webpack_require__(107), + Quadratic: __webpack_require__(109), + Quartic: __webpack_require__(113), + Quintic: __webpack_require__(117), + Sine: __webpack_require__(121), + Stepped: __webpack_require__(125) }; /***/ }), -/* 84 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13839,15 +14385,15 @@ module.exports = { module.exports = { - In: __webpack_require__(85), - Out: __webpack_require__(86), - InOut: __webpack_require__(87) + In: __webpack_require__(84), + Out: __webpack_require__(85), + InOut: __webpack_require__(86) }; /***/ }), -/* 85 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -13878,7 +14424,7 @@ module.exports = In; /***/ }), -/* 86 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -13909,7 +14455,7 @@ module.exports = Out; /***/ }), -/* 87 */ +/* 86 */ /***/ (function(module, exports) { /** @@ -13949,7 +14495,7 @@ module.exports = InOut; /***/ }), -/* 88 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13964,15 +14510,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(89), - Out: __webpack_require__(90), - InOut: __webpack_require__(91) + In: __webpack_require__(88), + Out: __webpack_require__(89), + InOut: __webpack_require__(90) }; /***/ }), -/* 89 */ +/* 88 */ /***/ (function(module, exports) { /** @@ -14017,7 +14563,7 @@ module.exports = In; /***/ }), -/* 90 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -14060,7 +14606,7 @@ module.exports = Out; /***/ }), -/* 91 */ +/* 90 */ /***/ (function(module, exports) { /** @@ -14124,7 +14670,7 @@ module.exports = InOut; /***/ }), -/* 92 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14139,15 +14685,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(93), - Out: __webpack_require__(94), - InOut: __webpack_require__(95) + In: __webpack_require__(92), + Out: __webpack_require__(93), + InOut: __webpack_require__(94) }; /***/ }), -/* 93 */ +/* 92 */ /***/ (function(module, exports) { /** @@ -14175,7 +14721,7 @@ module.exports = In; /***/ }), -/* 94 */ +/* 93 */ /***/ (function(module, exports) { /** @@ -14203,7 +14749,7 @@ module.exports = Out; /***/ }), -/* 95 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -14238,7 +14784,7 @@ module.exports = InOut; /***/ }), -/* 96 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14253,15 +14799,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(97), - Out: __webpack_require__(98), - InOut: __webpack_require__(99) + In: __webpack_require__(96), + Out: __webpack_require__(97), + InOut: __webpack_require__(98) }; /***/ }), -/* 97 */ +/* 96 */ /***/ (function(module, exports) { /** @@ -14289,7 +14835,7 @@ module.exports = In; /***/ }), -/* 98 */ +/* 97 */ /***/ (function(module, exports) { /** @@ -14317,7 +14863,7 @@ module.exports = Out; /***/ }), -/* 99 */ +/* 98 */ /***/ (function(module, exports) { /** @@ -14352,7 +14898,7 @@ module.exports = InOut; /***/ }), -/* 100 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14367,15 +14913,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(101), - Out: __webpack_require__(102), - InOut: __webpack_require__(103) + In: __webpack_require__(100), + Out: __webpack_require__(101), + InOut: __webpack_require__(102) }; /***/ }), -/* 101 */ +/* 100 */ /***/ (function(module, exports) { /** @@ -14430,7 +14976,7 @@ module.exports = In; /***/ }), -/* 102 */ +/* 101 */ /***/ (function(module, exports) { /** @@ -14485,7 +15031,7 @@ module.exports = Out; /***/ }), -/* 103 */ +/* 102 */ /***/ (function(module, exports) { /** @@ -14547,7 +15093,7 @@ module.exports = InOut; /***/ }), -/* 104 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14562,15 +15108,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(105), - Out: __webpack_require__(106), - InOut: __webpack_require__(107) + In: __webpack_require__(104), + Out: __webpack_require__(105), + InOut: __webpack_require__(106) }; /***/ }), -/* 105 */ +/* 104 */ /***/ (function(module, exports) { /** @@ -14598,7 +15144,7 @@ module.exports = In; /***/ }), -/* 106 */ +/* 105 */ /***/ (function(module, exports) { /** @@ -14626,7 +15172,7 @@ module.exports = Out; /***/ }), -/* 107 */ +/* 106 */ /***/ (function(module, exports) { /** @@ -14661,7 +15207,7 @@ module.exports = InOut; /***/ }), -/* 108 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14670,11 +15216,11 @@ module.exports = InOut; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -module.exports = __webpack_require__(109); +module.exports = __webpack_require__(108); /***/ }), -/* 109 */ +/* 108 */ /***/ (function(module, exports) { /** @@ -14702,7 +15248,7 @@ module.exports = Linear; /***/ }), -/* 110 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14717,15 +15263,15 @@ module.exports = Linear; module.exports = { - In: __webpack_require__(111), - Out: __webpack_require__(112), - InOut: __webpack_require__(113) + In: __webpack_require__(110), + Out: __webpack_require__(111), + InOut: __webpack_require__(112) }; /***/ }), -/* 111 */ +/* 110 */ /***/ (function(module, exports) { /** @@ -14753,7 +15299,7 @@ module.exports = In; /***/ }), -/* 112 */ +/* 111 */ /***/ (function(module, exports) { /** @@ -14781,7 +15327,7 @@ module.exports = Out; /***/ }), -/* 113 */ +/* 112 */ /***/ (function(module, exports) { /** @@ -14816,7 +15362,7 @@ module.exports = InOut; /***/ }), -/* 114 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14831,15 +15377,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(115), - Out: __webpack_require__(116), - InOut: __webpack_require__(117) + In: __webpack_require__(114), + Out: __webpack_require__(115), + InOut: __webpack_require__(116) }; /***/ }), -/* 115 */ +/* 114 */ /***/ (function(module, exports) { /** @@ -14867,7 +15413,7 @@ module.exports = In; /***/ }), -/* 116 */ +/* 115 */ /***/ (function(module, exports) { /** @@ -14895,7 +15441,7 @@ module.exports = Out; /***/ }), -/* 117 */ +/* 116 */ /***/ (function(module, exports) { /** @@ -14930,7 +15476,7 @@ module.exports = InOut; /***/ }), -/* 118 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14945,15 +15491,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(119), - Out: __webpack_require__(120), - InOut: __webpack_require__(121) + In: __webpack_require__(118), + Out: __webpack_require__(119), + InOut: __webpack_require__(120) }; /***/ }), -/* 119 */ +/* 118 */ /***/ (function(module, exports) { /** @@ -14981,7 +15527,7 @@ module.exports = In; /***/ }), -/* 120 */ +/* 119 */ /***/ (function(module, exports) { /** @@ -15009,7 +15555,7 @@ module.exports = Out; /***/ }), -/* 121 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -15044,7 +15590,7 @@ module.exports = InOut; /***/ }), -/* 122 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15059,15 +15605,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(123), - Out: __webpack_require__(124), - InOut: __webpack_require__(125) + In: __webpack_require__(122), + Out: __webpack_require__(123), + InOut: __webpack_require__(124) }; /***/ }), -/* 123 */ +/* 122 */ /***/ (function(module, exports) { /** @@ -15106,7 +15652,7 @@ module.exports = In; /***/ }), -/* 124 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -15145,7 +15691,7 @@ module.exports = Out; /***/ }), -/* 125 */ +/* 124 */ /***/ (function(module, exports) { /** @@ -15184,7 +15730,7 @@ module.exports = InOut; /***/ }), -/* 126 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15197,11 +15743,11 @@ module.exports = InOut; * @namespace Phaser.Math.Easing.Stepped */ -module.exports = __webpack_require__(127); +module.exports = __webpack_require__(126); /***/ }), -/* 127 */ +/* 126 */ /***/ (function(module, exports) { /** @@ -15243,7 +15789,7 @@ module.exports = Stepped; /***/ }), -/* 128 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15258,17 +15804,17 @@ module.exports = Stepped; module.exports = { - Ceil: __webpack_require__(129), - Equal: __webpack_require__(31), - Floor: __webpack_require__(130), - GreaterThan: __webpack_require__(131), - LessThan: __webpack_require__(132) + Ceil: __webpack_require__(128), + Equal: __webpack_require__(32), + Floor: __webpack_require__(129), + GreaterThan: __webpack_require__(130), + LessThan: __webpack_require__(131) }; /***/ }), -/* 129 */ +/* 128 */ /***/ (function(module, exports) { /** @@ -15299,7 +15845,7 @@ module.exports = Ceil; /***/ }), -/* 130 */ +/* 129 */ /***/ (function(module, exports) { /** @@ -15330,7 +15876,7 @@ module.exports = Floor; /***/ }), -/* 131 */ +/* 130 */ /***/ (function(module, exports) { /** @@ -15364,7 +15910,7 @@ module.exports = GreaterThan; /***/ }), -/* 132 */ +/* 131 */ /***/ (function(module, exports) { /** @@ -15398,7 +15944,7 @@ module.exports = LessThan; /***/ }), -/* 133 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15413,19 +15959,19 @@ module.exports = LessThan; module.exports = { - Bezier: __webpack_require__(134), - CatmullRom: __webpack_require__(135), - CubicBezier: __webpack_require__(136), - Linear: __webpack_require__(137), - QuadraticBezier: __webpack_require__(138), - SmoothStep: __webpack_require__(139), - SmootherStep: __webpack_require__(140) + Bezier: __webpack_require__(133), + CatmullRom: __webpack_require__(134), + CubicBezier: __webpack_require__(135), + Linear: __webpack_require__(136), + QuadraticBezier: __webpack_require__(137), + SmoothStep: __webpack_require__(138), + SmootherStep: __webpack_require__(139) }; /***/ }), -/* 134 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15434,7 +15980,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(32); +var Bernstein = __webpack_require__(33); /** * A bezier interpolation method. @@ -15464,7 +16010,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 135 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15473,7 +16019,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(34); +var CatmullRom = __webpack_require__(35); /** * A Catmull-Rom interpolation method. @@ -15521,7 +16067,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 136 */ +/* 135 */ /***/ (function(module, exports) { /** @@ -15591,7 +16137,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 137 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15600,7 +16146,7 @@ module.exports = CubicBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(35); +var Linear = __webpack_require__(36); /** * A linear interpolation method. @@ -15638,7 +16184,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 138 */ +/* 137 */ /***/ (function(module, exports) { /** @@ -15697,7 +16243,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 139 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15706,7 +16252,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(36); +var SmoothStep = __webpack_require__(37); /** * A Smooth Step interpolation method. @@ -15730,7 +16276,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 140 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15739,7 +16285,7 @@ module.exports = SmoothStepInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(37); +var SmootherStep = __webpack_require__(38); /** * A Smoother Step interpolation method. @@ -15763,7 +16309,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 141 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15778,15 +16324,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(142), - IsSize: __webpack_require__(143), - IsValue: __webpack_require__(144) + GetNext: __webpack_require__(141), + IsSize: __webpack_require__(142), + IsValue: __webpack_require__(143) }; /***/ }), -/* 142 */ +/* 141 */ /***/ (function(module, exports) { /** @@ -15816,7 +16362,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 143 */ +/* 142 */ /***/ (function(module, exports) { /** @@ -15846,7 +16392,7 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 144 */ +/* 143 */ /***/ (function(module, exports) { /** @@ -15874,7 +16420,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 145 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15889,15 +16435,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(146), - Floor: __webpack_require__(147), - To: __webpack_require__(148) + Ceil: __webpack_require__(145), + Floor: __webpack_require__(146), + To: __webpack_require__(147) }; /***/ }), -/* 146 */ +/* 145 */ /***/ (function(module, exports) { /** @@ -15941,7 +16487,7 @@ module.exports = SnapCeil; /***/ }), -/* 147 */ +/* 146 */ /***/ (function(module, exports) { /** @@ -15985,7 +16531,7 @@ module.exports = SnapFloor; /***/ }), -/* 148 */ +/* 147 */ /***/ (function(module, exports) { /** @@ -16028,7 +16574,7 @@ module.exports = SnapTo; /***/ }), -/* 149 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16538,7 +17084,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 150 */ +/* 149 */ /***/ (function(module, exports) { /** @@ -16573,7 +17119,7 @@ module.exports = Average; /***/ }), -/* 151 */ +/* 150 */ /***/ (function(module, exports) { /** @@ -16602,7 +17148,7 @@ module.exports = Between; /***/ }), -/* 152 */ +/* 151 */ /***/ (function(module, exports) { /** @@ -16639,7 +17185,7 @@ module.exports = CeilTo; /***/ }), -/* 153 */ +/* 152 */ /***/ (function(module, exports) { /** @@ -16667,6 +17213,289 @@ var Difference = function (a, b) module.exports = Difference; +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(4); +var Class = __webpack_require__(0); +var Matrix4 = __webpack_require__(20); +var NOOP = __webpack_require__(1); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + /***/ }), /* 154 */ /***/ (function(module, exports) { @@ -16714,7 +17543,7 @@ module.exports = FloorTo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(3); +var Clamp = __webpack_require__(4); /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -17294,7 +18123,7 @@ module.exports = SinCosTableGenerator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(1); +var Vector2 = __webpack_require__(2); /** * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. @@ -17927,8 +18756,8 @@ module.exports = Vector4; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(19); -var Matrix4 = __webpack_require__(42); +var Vector3 = __webpack_require__(12); +var Matrix4 = __webpack_require__(20); var Quaternion = __webpack_require__(43); var tmpMat4 = new Matrix4(); @@ -17977,7 +18806,7 @@ module.exports = RotateVec3; /** * The Scale Manager Resize Event. - * + * * This event is dispatched whenever the Scale Manager detects a resize event from the browser. * It sends three parameters to the callback, each of them being Size components. You can read * the `width`, `height`, `aspectRatio` and other properties of these components to help with @@ -17985,11 +18814,10 @@ module.exports = RotateVec3; * * @event Phaser.Scale.Events#RESIZE * @since 3.16.1 - * + * * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} resolution - The current resolution. Defaults to 1 at the moment. * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. */ @@ -29752,9 +30580,9 @@ module.exports = spine; */ var Class = __webpack_require__(0); -var GetFastValue = __webpack_require__(11); +var GetFastValue = __webpack_require__(9); var ImageFile = __webpack_require__(201); -var IsPlainObject = __webpack_require__(8); +var IsPlainObject = __webpack_require__(6); var JSONFile = __webpack_require__(215); var MultiFile = __webpack_require__(216); var TextFile = __webpack_require__(217); @@ -29831,7 +30659,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { atlas = new TextFile(loader, { - key: key + '_' + i, + key: key + '!' + i, url: atlasURL[i], extension: GetFastValue(config, 'atlasExtension', 'atlas'), xhrSettings: GetFastValue(config, 'atlasXhrSettings') @@ -29853,7 +30681,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { - atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings); + atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); atlas.cache = cache; files.push(atlas); @@ -29927,9 +30755,12 @@ var SpineFile = new Class({ var image = new ImageFile(loader, key, textureURL, textureXhrSettings); - this.addToMultiFile(image); + if (!loader.keyExists(image)) + { + this.addToMultiFile(image); - loader.addFile(image); + loader.addFile(image); + } } // Reset the loader settings @@ -29958,6 +30789,7 @@ var SpineFile = new Class({ var atlasKey = ''; var combinedAtlasData = ''; var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + var textureManager = this.loader.textureManager; for (var i = 1; i < this.files.length; i++) { @@ -29965,7 +30797,7 @@ var SpineFile = new Class({ if (file.type === 'text') { - atlasKey = file.key.replace(/_[\d]$/, ''); + atlasKey = file.key.replace(/![\d]$/, ''); atlasCache = file.cache; @@ -29974,10 +30806,13 @@ var SpineFile = new Class({ else { var src = file.key.trim(); - var pos = src.indexOf('_'); + var pos = src.indexOf('!'); var key = src.substr(pos + 1); - this.loader.textureManager.addImage(key, file.data); + if (!textureManager.exists(key)) + { + textureManager.addImage(key, file.data); + } } file.pendingDestroy(); @@ -30005,11 +30840,11 @@ module.exports = SpineFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); -var GetFastValue = __webpack_require__(11); -var IsPlainObject = __webpack_require__(8); +var CONST = __webpack_require__(14); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); +var GetFastValue = __webpack_require__(9); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -30731,12 +31566,12 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); -var GetFastValue = __webpack_require__(11); -var GetValue = __webpack_require__(7); -var IsPlainObject = __webpack_require__(8); +var CONST = __webpack_require__(14); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); +var GetFastValue = __webpack_require__(9); +var GetValue = __webpack_require__(8); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -30966,7 +31801,7 @@ var Class = __webpack_require__(0); * @classdesc * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * + * * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. * * @class MultiFile @@ -30985,6 +31820,17 @@ var MultiFile = new Class({ function MultiFile (loader, type, key, files) { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + /** * A reference to the Loader that is going to load this file. * @@ -31029,7 +31875,7 @@ var MultiFile = new Class({ * @type {Phaser.Loader.File[]} * @since 3.7.0 */ - this.files = files; + this.files = finalFiles; /** * The completion status of this MultiFile. @@ -31049,7 +31895,7 @@ var MultiFile = new Class({ * @since 3.7.0 */ - this.pending = files.length; + this.pending = finalFiles.length; /** * The number of files that failed to load. @@ -31101,9 +31947,9 @@ var MultiFile = new Class({ this.prefix = loader.prefix; // Link the files - for (var i = 0; i < files.length; i++) + for (var i = 0; i < finalFiles.length; i++) { - files[i].multiFile = this; + finalFiles[i].multiFile = this; } }, @@ -31195,11 +32041,11 @@ module.exports = MultiFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); -var GetFastValue = __webpack_require__(11); -var IsPlainObject = __webpack_require__(8); +var CONST = __webpack_require__(14); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); +var GetFastValue = __webpack_require__(9); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -31228,7 +32074,9 @@ var TextFile = new Class({ function TextFile (loader, key, url, xhrSettings) { + var type = 'text'; var extension = 'txt'; + var cache = loader.cacheManager.text; if (IsPlainObject(key)) { @@ -31238,11 +32086,13 @@ var TextFile = new Class({ url = GetFastValue(config, 'url'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); } var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, + type: type, + cache: cache, extension: extension, responseType: 'text', key: key, @@ -31369,21 +32219,21 @@ module.exports = TextFile; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var AngleBetween = __webpack_require__(27); -var Clamp = __webpack_require__(3); +var AngleBetween = __webpack_require__(28); +var Clamp = __webpack_require__(4); var Class = __webpack_require__(0); var ComponentsComputedSize = __webpack_require__(46); var ComponentsDepth = __webpack_require__(47); var ComponentsFlip = __webpack_require__(48); var ComponentsScrollFactor = __webpack_require__(49); var ComponentsTransform = __webpack_require__(50); -var ComponentsVisible = __webpack_require__(52); -var CounterClockwise = __webpack_require__(9); -var DegToRad = __webpack_require__(18); -var GameObject = __webpack_require__(53); -var RadToDeg = __webpack_require__(10); -var SpineEvents = __webpack_require__(238); -var SpineGameObjectRender = __webpack_require__(245); +var ComponentsVisible = __webpack_require__(51); +var CounterClockwise = __webpack_require__(11); +var DegToRad = __webpack_require__(19); +var GameObject = __webpack_require__(52); +var RadToDeg = __webpack_require__(13); +var SpineEvents = __webpack_require__(240); +var SpineGameObjectRender = __webpack_require__(247); /** * @classdesc @@ -31607,17 +32457,27 @@ var SpineGameObject = new Class({ }, /** - * Overrides the default Game Object method and always returns true. - * Rendering is decided in the renderer functions. + * Returns `true` if this Spine Game Object both has a skeleton and + * also passes the render tests for the given Camera. * * @method SpineGameObject#willRender * @since 3.19.0 * - * @return {boolean} Always returns `true`. + * @return {boolean} `true` if this Game Object should be rendered, otherwise `false`. */ - willRender: function () + willRender: function (camera) { - return true; + var skeleton = this.skeleton; + + if (!skeleton) + { + return false; + } + + var GameObjectRenderMask = 15; + var childAlpha = skeleton.color.a; + + return !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)) || childAlpha === 0); }, /** @@ -32354,7 +33214,7 @@ var SpineGameObject = new Class({ * @param {integer} trackIndex - The track index to play the animation on. * @param {string} animationName - The string-based key of the animation to play. * @param {boolean} [loop=false] - Should the animation be looped when played? - * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * @param {boolean} [ignoreIfPlaying=false] - If the animation specified by the track index is already playing then ignore this call. * * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. */ @@ -32365,7 +33225,7 @@ var SpineGameObject = new Class({ if (ignoreIfPlaying && this.state) { - var currentTrack = this.state.getCurrent(0); + var currentTrack = this.state.getCurrent(trackIndex); if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) { @@ -32402,6 +33262,9 @@ var SpineGameObject = new Class({ */ addAnimation: function (trackIndex, animationName, loop, delay) { + if (loop === undefined) { loop = false; } + if (delay === undefined) { delay = 0; } + return this.state.addAnimation(trackIndex, animationName, loop, delay); }, @@ -33036,13 +33899,13 @@ var DataManager = new Class({ * ``` * * You can also modify it directly: - * + * * ```javascript * this.data.values.gold += 1000; * ``` * * Doing so will emit a `setdata` event from the parent of this Data Manager. - * + * * Do not modify this object directly. Adding properties directly to this object will not * emit any events. Always use `DataManager.set` to create new items the first time around. * @@ -33066,7 +33929,7 @@ var DataManager = new Class({ if (!parent.hasOwnProperty('sys') && this.events) { - this.events.once('destroy', this.destroy, this); + this.events.once(Events.DESTROY, this.destroy, this); } }, @@ -33074,19 +33937,19 @@ var DataManager = new Class({ * Retrieves the value for the given key, or undefined if it doesn't exist. * * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * + * * ```javascript * this.data.get('gold'); * ``` * * Or access the value directly: - * + * * ```javascript * this.data.values.gold; * ``` * * You can also pass in an array of keys, in which case an array of values will be returned: - * + * * ```javascript * this.data.get([ 'gold', 'armor', 'health' ]); * ``` @@ -33171,7 +34034,7 @@ var DataManager = new Class({ /** * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * + * * ```javascript * data.set('name', 'Red Gem Stone'); * ``` @@ -33183,13 +34046,13 @@ var DataManager = new Class({ * ``` * * To get a value back again you can call `get`: - * + * * ```javascript * data.get('gold'); * ``` - * + * * Or you can access the value directly via the `values` property, where it works like any other variable: - * + * * ```javascript * data.values.gold += 50; * ``` @@ -33238,9 +34101,9 @@ var DataManager = new Class({ /** * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#inc * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -33277,9 +34140,9 @@ var DataManager = new Class({ /** * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#toggle * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -33339,7 +34202,7 @@ var DataManager = new Class({ Object.defineProperty(this.values, key, { enumerable: true, - + configurable: true, get: function () @@ -33439,9 +34302,9 @@ var DataManager = new Class({ * * If the key is found in this Data Manager it is removed from the internal lists and a * `removedata` event is emitted. - * + * * You can also pass in an array of keys, in which case all keys in the array will be removed: - * + * * ```javascript * this.data.remove([ 'gold', 'armor', 'health' ]); * ``` @@ -33533,7 +34396,7 @@ var DataManager = new Class({ /** * Determines whether the given key is set in this Data Manager. - * + * * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @@ -33676,8 +34539,9 @@ module.exports = { CHANGE_DATA: __webpack_require__(221), CHANGE_DATA_KEY: __webpack_require__(222), - REMOVE_DATA: __webpack_require__(223), - SET_DATA: __webpack_require__(224) + DESTROY: __webpack_require__(223), + REMOVE_DATA: __webpack_require__(224), + SET_DATA: __webpack_require__(225) }; @@ -33748,6 +34612,27 @@ module.exports = 'changedata-'; /* 223 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Data Manager Destroy Event. + * + * The Data Manager will listen for the destroy event from its parent, and then close itself down. + * + * @event Phaser.Data.Events#DESTROY + * @since 3.50.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 224 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -33773,7 +34658,7 @@ module.exports = 'removedata'; /***/ }), -/* 224 */ +/* 225 */ /***/ (function(module, exports) { /** @@ -33801,7 +34686,350 @@ module.exports = 'setdata'; /***/ }), -/* 225 */ +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 227 */ /***/ (function(module, exports) { /** @@ -33827,7 +35055,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 226 */ +/* 228 */ /***/ (function(module, exports) { /** @@ -33852,7 +35080,7 @@ module.exports = 'destroy'; /***/ }), -/* 227 */ +/* 229 */ /***/ (function(module, exports) { /** @@ -33878,7 +35106,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 228 */ +/* 230 */ /***/ (function(module, exports) { /** @@ -33910,7 +35138,7 @@ module.exports = 'complete'; /***/ }), -/* 229 */ +/* 231 */ /***/ (function(module, exports) { /** @@ -33939,7 +35167,7 @@ module.exports = 'created'; /***/ }), -/* 230 */ +/* 232 */ /***/ (function(module, exports) { /** @@ -33965,7 +35193,7 @@ module.exports = 'error'; /***/ }), -/* 231 */ +/* 233 */ /***/ (function(module, exports) { /** @@ -33997,7 +35225,7 @@ module.exports = 'loop'; /***/ }), -/* 232 */ +/* 234 */ /***/ (function(module, exports) { /** @@ -34025,7 +35253,7 @@ module.exports = 'play'; /***/ }), -/* 233 */ +/* 235 */ /***/ (function(module, exports) { /** @@ -34050,7 +35278,7 @@ module.exports = 'seeked'; /***/ }), -/* 234 */ +/* 236 */ /***/ (function(module, exports) { /** @@ -34076,7 +35304,7 @@ module.exports = 'seeking'; /***/ }), -/* 235 */ +/* 237 */ /***/ (function(module, exports) { /** @@ -34102,7 +35330,7 @@ module.exports = 'stop'; /***/ }), -/* 236 */ +/* 238 */ /***/ (function(module, exports) { /** @@ -34128,7 +35356,7 @@ module.exports = 'timeout'; /***/ }), -/* 237 */ +/* 239 */ /***/ (function(module, exports) { /** @@ -34154,7 +35382,7 @@ module.exports = 'unlocked'; /***/ }), -/* 238 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34169,18 +35397,18 @@ module.exports = 'unlocked'; module.exports = { - COMPLETE: __webpack_require__(239), - DISPOSE: __webpack_require__(240), - END: __webpack_require__(241), - EVENT: __webpack_require__(242), - INTERRUPTED: __webpack_require__(243), - START: __webpack_require__(244) + COMPLETE: __webpack_require__(241), + DISPOSE: __webpack_require__(242), + END: __webpack_require__(243), + EVENT: __webpack_require__(244), + INTERRUPTED: __webpack_require__(245), + START: __webpack_require__(246) }; /***/ }), -/* 239 */ +/* 241 */ /***/ (function(module, exports) { /** @@ -34199,7 +35427,7 @@ module.exports = 'complete'; /***/ }), -/* 240 */ +/* 242 */ /***/ (function(module, exports) { /** @@ -34218,7 +35446,7 @@ module.exports = 'dispose'; /***/ }), -/* 241 */ +/* 243 */ /***/ (function(module, exports) { /** @@ -34237,7 +35465,7 @@ module.exports = 'end'; /***/ }), -/* 242 */ +/* 244 */ /***/ (function(module, exports) { /** @@ -34256,7 +35484,7 @@ module.exports = 'event'; /***/ }), -/* 243 */ +/* 245 */ /***/ (function(module, exports) { /** @@ -34275,7 +35503,7 @@ module.exports = 'interrupted'; /***/ }), -/* 244 */ +/* 246 */ /***/ (function(module, exports) { /** @@ -34294,7 +35522,7 @@ module.exports = 'start'; /***/ }), -/* 245 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34303,17 +35531,17 @@ module.exports = 'start'; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var renderWebGL = __webpack_require__(4); -var renderCanvas = __webpack_require__(4); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(246); + renderWebGL = __webpack_require__(248); } if (true) { - renderCanvas = __webpack_require__(247); + renderCanvas = __webpack_require__(250); } module.exports = { @@ -34325,7 +35553,7 @@ module.exports = { /***/ }), -/* 246 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34334,9 +35562,11 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CounterClockwise = __webpack_require__(9); -var RadToDeg = __webpack_require__(10); -var Wrap = __webpack_require__(6); +var Clamp = __webpack_require__(4); +var CounterClockwise = __webpack_require__(11); +var GetCalcMatrix = __webpack_require__(249); +var RadToDeg = __webpack_require__(13); +var Wrap = __webpack_require__(7); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -34349,74 +35579,36 @@ var Wrap = __webpack_require__(6); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container) { var plugin = src.plugin; var skeleton = src.skeleton; - var childAlpha = skeleton.color.a; var sceneRenderer = plugin.sceneRenderer; - var GameObjectRenderMask = 15; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0); - - if (!skeleton || !willRender) - { - // If there is already a batch running, we need to close it - if (!renderer.nextTypeMatch) - { - // The next object in the display list is not a Spine object, so we end the batch - sceneRenderer.end(); - - if (!renderer.finalType) - { - // Reset the current type - renderer.currentType = ''; - - renderer.rebindPipeline(renderer.pipelines.MultiPipeline); - } - } - - return; - } - if (renderer.newType) { - renderer.clearPipeline(); + // flush + clear previous pipeline if this is a new type + renderer.pipelines.clear(); + + sceneRenderer.begin(); } - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + var alpha = skeleton.color.a; - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) + if (container) { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + src.scrollFactorX = container.scrollFactorX; + src.scrollFactorY = container.scrollFactorY; - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); + skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; var viewportHeight = renderer.height; @@ -34430,7 +35622,8 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent { skeleton.scaleX *= -1; - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); + // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled + src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); } else { @@ -34458,17 +35651,18 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent skeleton.scaleY *= -1; } - // Add autoUpdate option skeleton.updateWorldTransform(); - if (renderer.newType) - { - sceneRenderer.begin(); - } - // Draw the current skeleton sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + if (container) + { + src.scrollFactorX = scrollFactorX; + src.scrollFactorY = scrollFactorY; + skeleton.color.a = alpha; + } + if (plugin.drawDebug || src.drawDebug) { // Because if we don't, the bones render positions are completely wrong (*sigh*) @@ -34486,13 +35680,11 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent if (!renderer.nextTypeMatch) { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch. + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch sceneRenderer.end(); - if (!renderer.finalType) - { - renderer.rebindPipeline(renderer.pipelines.MultiPipeline); - } + // And rebind the previous pipeline + renderer.pipelines.rebind(); } }; @@ -34500,7 +35692,78 @@ module.exports = SpineGameObjectWebGLRenderer; /***/ }), -/* 247 */ +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TransformMatrix = __webpack_require__(23); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + +var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; + +/** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * + * @function Phaser.GameObjects.GetCalcMatrix + * @memberof Phaser.GameObjects + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. + * + * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. + */ +var GetCalcMatrix = function (src, camera, parentMatrix) +{ + var camMatrix = tempMatrix1; + var spriteMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + return result; +}; + +module.exports = GetCalcMatrix; + + +/***/ }), +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34509,9 +35772,9 @@ module.exports = SpineGameObjectWebGLRenderer; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CounterClockwise = __webpack_require__(9); -var RadToDeg = __webpack_require__(10); -var Wrap = __webpack_require__(6); +var CounterClockwise = __webpack_require__(11); +var RadToDeg = __webpack_require__(13); +var Wrap = __webpack_require__(7); /** * Renders this Game Object with the Canvas Renderer to the given Camera. @@ -34524,11 +35787,10 @@ var Wrap = __webpack_require__(6); * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix) { var context = renderer.currentContext; @@ -34536,15 +35798,6 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercen var skeleton = src.skeleton; var skeletonRenderer = plugin.skeletonRenderer; - var GameObjectRenderMask = 15; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); - - if (!skeleton || !willRender) - { - return; - } - var camMatrix = renderer._tempMatrix1; var spriteMatrix = renderer._tempMatrix2; var calcMatrix = renderer._tempMatrix3; @@ -34614,7 +35867,6 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercen skeleton.scaleY *= -1; } - // Add autoUpdate option skeleton.updateWorldTransform(); skeletonRenderer.ctx = context; @@ -34631,7 +35883,7 @@ module.exports = SpineGameObjectCanvasRenderer; /***/ }), -/* 248 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34641,16 +35893,16 @@ module.exports = SpineGameObjectCanvasRenderer; */ var Class = __webpack_require__(0); -var Container = __webpack_require__(249); -var SpineContainerRender = __webpack_require__(355); +var Container = __webpack_require__(252); +var SpineContainerRender = __webpack_require__(338); /** * @classdesc * A Spine Container is a special kind of Container created specifically for Spine Game Objects. * * You have all of the same features of a standard Container, but the rendering functions are optimized specifically - * for Spine Game Objects. You cannot mix and match Spine Game Objects with regular Game Objects inside of this - * type of Container, however. + * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. + * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. * * To create one in a Scene, use the factory methods: * @@ -34664,7 +35916,11 @@ var SpineContainerRender = __webpack_require__(355); * this.make.spinecontainer(); * ``` * - * See the Container documentation for further details. + * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the + * container children. You can, however, mask children of Spine Containers if they are embedded within other + * Spine Containers. In short, if you need masking, don't mix and match the types. + * + * See the Container documentation for further details about what Containers can do. * * @class SpineContainer * @extends Phaser.GameObjects.Container @@ -34697,11 +35953,30 @@ var SpineContainer = new Class({ /** * A reference to the Spine Plugin. * - * @name SpineGameObject#plugin + * @name SpineContainer#plugin * @type {SpinePlugin} - * @since 3.19.0 + * @since 3.50.0 */ this.plugin = plugin; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineContainer#preDestroy + * @protected + * @since 3.50.0 + */ + preDestroy: function () + { + this.removeAll(!!this.exclusive); + + this.localTransform.destroy(); + this.tempTransformMatrix.destroy(); + + this.list = []; + this._displayList = null; + this.plugin = null; } }); @@ -34710,7 +35985,7 @@ module.exports = SpineContainer; /***/ }), -/* 249 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34720,17 +35995,16 @@ module.exports = SpineContainer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(250); -var BlendModes = __webpack_require__(16); +var ArrayUtils = __webpack_require__(253); +var BlendModes = __webpack_require__(17); var Class = __webpack_require__(0); -var Components = __webpack_require__(286); -var Events = __webpack_require__(22); -var GameObject = __webpack_require__(53); -var GameObjectEvents = __webpack_require__(22); -var Rectangle = __webpack_require__(24); -var Render = __webpack_require__(351); -var Union = __webpack_require__(354); -var Vector2 = __webpack_require__(1); +var Components = __webpack_require__(290); +var Events = __webpack_require__(54); +var GameObject = __webpack_require__(52); +var Rectangle = __webpack_require__(25); +var Render = __webpack_require__(334); +var Union = __webpack_require__(337); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -34760,6 +36034,9 @@ var Vector2 = __webpack_require__(1); * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. * + * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, + * or the input area will become misaligned. + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children @@ -35172,7 +36449,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene); } }, @@ -35197,7 +36474,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene); } }, @@ -35351,7 +36628,7 @@ var Container = new Class({ }; } - ArrayUtils.StableSort.inplace(this.list, handler); + ArrayUtils.StableSort(this.list, handler); return this; }, @@ -36075,7 +37352,7 @@ module.exports = Container; /***/ }), -/* 250 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36090,45 +37367,46 @@ module.exports = Container; module.exports = { - Matrix: __webpack_require__(251), + Matrix: __webpack_require__(254), - Add: __webpack_require__(259), - AddAt: __webpack_require__(260), - BringToTop: __webpack_require__(261), - CountAllMatching: __webpack_require__(262), - Each: __webpack_require__(263), - EachInRange: __webpack_require__(264), - FindClosestInSorted: __webpack_require__(57), - GetAll: __webpack_require__(265), - GetFirst: __webpack_require__(266), - GetRandom: __webpack_require__(267), - MoveDown: __webpack_require__(268), - MoveTo: __webpack_require__(269), - MoveUp: __webpack_require__(270), - NumberArray: __webpack_require__(271), - NumberArrayStep: __webpack_require__(272), - QuickSelect: __webpack_require__(273), - Range: __webpack_require__(274), - Remove: __webpack_require__(275), - RemoveAt: __webpack_require__(276), - RemoveBetween: __webpack_require__(277), - RemoveRandomElement: __webpack_require__(278), - Replace: __webpack_require__(279), - RotateLeft: __webpack_require__(280), - RotateRight: __webpack_require__(281), + Add: __webpack_require__(263), + AddAt: __webpack_require__(264), + BringToTop: __webpack_require__(265), + CountAllMatching: __webpack_require__(266), + Each: __webpack_require__(267), + EachInRange: __webpack_require__(268), + FindClosestInSorted: __webpack_require__(269), + GetAll: __webpack_require__(270), + GetFirst: __webpack_require__(271), + GetRandom: __webpack_require__(272), + MoveDown: __webpack_require__(273), + MoveTo: __webpack_require__(274), + MoveUp: __webpack_require__(275), + NumberArray: __webpack_require__(276), + NumberArrayStep: __webpack_require__(277), + QuickSelect: __webpack_require__(278), + Range: __webpack_require__(279), + Remove: __webpack_require__(280), + RemoveAt: __webpack_require__(281), + RemoveBetween: __webpack_require__(282), + RemoveRandomElement: __webpack_require__(283), + Replace: __webpack_require__(284), + RotateLeft: __webpack_require__(56), + RotateRight: __webpack_require__(57), SafeRange: __webpack_require__(5), - SendToBack: __webpack_require__(282), - SetAll: __webpack_require__(283), + SendToBack: __webpack_require__(285), + SetAll: __webpack_require__(286), Shuffle: __webpack_require__(58), - SpliceOne: __webpack_require__(15), - StableSort: __webpack_require__(284), - Swap: __webpack_require__(285) + SortByDigits: __webpack_require__(287), + SpliceOne: __webpack_require__(16), + StableSort: __webpack_require__(288), + Swap: __webpack_require__(289) }; /***/ }), -/* 251 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36143,21 +37421,22 @@ module.exports = { module.exports = { - CheckMatrix: __webpack_require__(23), - MatrixToString: __webpack_require__(252), - ReverseColumns: __webpack_require__(254), - ReverseRows: __webpack_require__(255), - Rotate180: __webpack_require__(256), - RotateLeft: __webpack_require__(257), - RotateMatrix: __webpack_require__(14), - RotateRight: __webpack_require__(258), - TransposeMatrix: __webpack_require__(56) + CheckMatrix: __webpack_require__(24), + MatrixToString: __webpack_require__(255), + ReverseColumns: __webpack_require__(257), + ReverseRows: __webpack_require__(258), + Rotate180: __webpack_require__(259), + RotateLeft: __webpack_require__(260), + RotateMatrix: __webpack_require__(15), + RotateRight: __webpack_require__(261), + Translate: __webpack_require__(262), + TransposeMatrix: __webpack_require__(55) }; /***/ }), -/* 252 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36166,12 +37445,26 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(253); -var CheckMatrix = __webpack_require__(23); +var Pad = __webpack_require__(256); +var CheckMatrix = __webpack_require__(24); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * @@ -36238,7 +37531,7 @@ module.exports = MatrixToString; /***/ }), -/* 253 */ +/* 256 */ /***/ (function(module, exports) { /** @@ -36314,7 +37607,7 @@ module.exports = Pad; /***/ }), -/* 254 */ +/* 257 */ /***/ (function(module, exports) { /** @@ -36326,6 +37619,20 @@ module.exports = Pad; /** * Reverses the columns in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * @@ -36345,7 +37652,7 @@ module.exports = ReverseColumns; /***/ }), -/* 255 */ +/* 258 */ /***/ (function(module, exports) { /** @@ -36357,6 +37664,20 @@ module.exports = ReverseColumns; /** * Reverses the rows in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseRows * @since 3.0.0 * @@ -36381,7 +37702,7 @@ module.exports = ReverseRows; /***/ }), -/* 256 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36390,11 +37711,25 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(14); +var RotateMatrix = __webpack_require__(15); /** * Rotates the array matrix 180 degrees. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.Rotate180 * @since 3.0.0 * @@ -36414,7 +37749,7 @@ module.exports = Rotate180; /***/ }), -/* 257 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36423,11 +37758,25 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(14); +var RotateMatrix = __webpack_require__(15); /** * Rotates the array matrix to the left (or 90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateLeft * @since 3.0.0 * @@ -36447,7 +37796,7 @@ module.exports = RotateLeft; /***/ }), -/* 258 */ +/* 261 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36456,11 +37805,25 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(14); +var RotateMatrix = __webpack_require__(15); /** * Rotates the array matrix to the left (or -90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateRight * @since 3.0.0 * @@ -36480,7 +37843,96 @@ module.exports = RotateRight; /***/ }), -/* 259 */ +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(56); +var RotateRight = __webpack_require__(57); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), +/* 263 */ /***/ (function(module, exports) { /** @@ -36597,7 +38049,7 @@ module.exports = Add; /***/ }), -/* 260 */ +/* 264 */ /***/ (function(module, exports) { /** @@ -36719,7 +38171,7 @@ module.exports = AddAt; /***/ }), -/* 261 */ +/* 265 */ /***/ (function(module, exports) { /** @@ -36757,7 +38209,7 @@ module.exports = BringToTop; /***/ }), -/* 262 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36809,7 +38261,7 @@ module.exports = CountAllMatching; /***/ }), -/* 263 */ +/* 267 */ /***/ (function(module, exports) { /** @@ -36855,7 +38307,7 @@ module.exports = Each; /***/ }), -/* 264 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36911,7 +38363,91 @@ module.exports = EachInRange; /***/ }), -/* 265 */ +/* 269 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), +/* 270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36973,7 +38509,7 @@ module.exports = GetAll; /***/ }), -/* 266 */ +/* 271 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37032,7 +38568,7 @@ module.exports = GetFirst; /***/ }), -/* 267 */ +/* 272 */ /***/ (function(module, exports) { /** @@ -37067,7 +38603,7 @@ module.exports = GetRandom; /***/ }), -/* 268 */ +/* 273 */ /***/ (function(module, exports) { /** @@ -37109,7 +38645,7 @@ module.exports = MoveDown; /***/ }), -/* 269 */ +/* 274 */ /***/ (function(module, exports) { /** @@ -37156,7 +38692,7 @@ module.exports = MoveTo; /***/ }), -/* 270 */ +/* 275 */ /***/ (function(module, exports) { /** @@ -37198,7 +38734,7 @@ module.exports = MoveUp; /***/ }), -/* 271 */ +/* 276 */ /***/ (function(module, exports) { /** @@ -37211,16 +38747,17 @@ module.exports = MoveUp; * Create an array representing the range of numbers (usually integers), between, and inclusive of, * the given `start` and `end` arguments. For example: * - * `var array = numberArray(2, 4); // array = [2, 3, 4]` - * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` + * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` * - * This is equivalent to `numberArrayStep(start, end, 1)`. + * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. * * You can optionally provide a prefix and / or suffix string. If given the array will contain * strings, not integers. For example: * - * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` - * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` * * @function Phaser.Utils.Array.NumberArray * @since 3.0.0 @@ -37236,22 +38773,50 @@ var NumberArray = function (start, end, prefix, suffix) { var result = []; - for (var i = start; i <= end; i++) + var i; + var asString = false; + + if (prefix || suffix) { - if (prefix || suffix) + asString = true; + + if (!prefix) { - var key = (prefix) ? prefix + i.toString() : i.toString(); - - if (suffix) - { - key = key.concat(suffix); - } - - result.push(key); + prefix = ''; } - else + + if (!suffix) { - result.push(i); + suffix = ''; + } + } + + if (end < start) + { + for (i = start; i >= end; i--) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + else + { + for (i = start; i <= end; i++) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } } } @@ -37262,7 +38827,7 @@ module.exports = NumberArray; /***/ }), -/* 272 */ +/* 277 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37271,7 +38836,7 @@ module.exports = NumberArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RoundAwayFromZero = __webpack_require__(39); +var RoundAwayFromZero = __webpack_require__(40); /** * Create an array of numbers (positive and/or negative) progressing from `start` @@ -37339,7 +38904,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 273 */ +/* 278 */ /***/ (function(module, exports) { /** @@ -37461,7 +39026,7 @@ module.exports = QuickSelect; /***/ }), -/* 274 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37470,7 +39035,7 @@ module.exports = QuickSelect; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(7); +var GetValue = __webpack_require__(8); var Shuffle = __webpack_require__(58); var BuildChunk = function (a, b, qty) @@ -37599,7 +39164,7 @@ module.exports = Range; /***/ }), -/* 275 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37608,7 +39173,7 @@ module.exports = Range; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(15); +var SpliceOne = __webpack_require__(16); /** * Removes the given item, or array of items, from the array. @@ -37690,7 +39255,7 @@ module.exports = Remove; /***/ }), -/* 276 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37699,7 +39264,7 @@ module.exports = Remove; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(15); +var SpliceOne = __webpack_require__(16); /** * Removes the item from the given position in the array. @@ -37741,7 +39306,7 @@ module.exports = RemoveAt; /***/ }), -/* 277 */ +/* 282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37804,7 +39369,7 @@ module.exports = RemoveBetween; /***/ }), -/* 278 */ +/* 283 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37813,7 +39378,7 @@ module.exports = RemoveBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(15); +var SpliceOne = __webpack_require__(16); /** * Removes a random object from the given array and returns it. @@ -37842,7 +39407,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 279 */ +/* 284 */ /***/ (function(module, exports) { /** @@ -37886,87 +39451,7 @@ module.exports = Replace; /***/ }), -/* 280 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 281 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 282 */ +/* 285 */ /***/ (function(module, exports) { /** @@ -38004,7 +39489,7 @@ module.exports = SendToBack; /***/ }), -/* 283 */ +/* 286 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38059,8 +39544,8 @@ module.exports = SetAll; /***/ }), -/* 284 */ -/***/ (function(module, exports, __webpack_require__) { +/* 287 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -38068,143 +39553,212 @@ module.exports = SetAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -//! stable.js 0.1.6, https://github.com/Two-Screen/stable -//! © 2017 Angry Bytes and contributors. MIT licensed. +/** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * + * @function Phaser.Utils.Array.SortByDigits + * @since 3.50.0 + * + * @param {string[]} array - The input array of strings. + * + * @return {string[]} The sorted input array. + */ +var SortByDigits = function (array) +{ + var re = /\D/g; + + array.sort(function (a, b) + { + return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); + }); + + return array; +}; + +module.exports = SortByDigits; + + +/***/ }), +/* 288 */ +/***/ (function(module, exports) { /** - * @namespace Phaser.Utils.Array.StableSortFunctions + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -(function() { - - /** - * A stable array sort, because `Array#sort()` is not guaranteed stable. - * This is an implementation of merge sort, without recursion. +/** + * The comparator function. * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 + * @ignore * - * @param {array} arr - The input array to be sorted. - * @param {function} comp - The comparison handler. + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. * - * @return {array} The sorted result. + * @return {boolean} True if they localCompare, otherwise false. */ -var stable = function(arr, comp) { - return exec(arr.slice(), comp); -}; +function Compare (a, b) +{ + return String(a).localeCompare(b); +} - /** - * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes. +/** + * Process the array contents. * - * @function Phaser.Utils.Array.StableSortFunctions.inplace - * @memberof Phaser.Utils.Array.StableSortFunctions - * @since 3.0.0 + * @ignore * - * @param {array} arr - The input array. - * @param {function} comp - The comparison handler. + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. * - * @return {array} The sorted array. + * @return {array} - The processed array. */ -stable.inplace = function(arr, comp) { - var result = exec(arr, comp); - - // This simply copies back if the result isn't in the original array, - // which happens on an odd number of passes. - if (result !== arr) { - pass(result, null, arr.length, arr); - } - - return arr; -}; - -// Execute the sort using the input array and a second buffer as work space. -// Returns one of those two, containing the final result. -function exec(arr, comp) { - if (typeof(comp) !== 'function') { - comp = function(a, b) { - return String(a).localeCompare(b); - }; - } - +function Process (array, compare) +{ // Short-circuit when there's nothing to sort. - var len = arr.length; - if (len <= 1) { - return arr; + var len = array.length; + + if (len <= 1) + { + return array; } // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. // Chunks are the size of the left or right hand in merge sort. // Stop when the left-hand covers all of the array. var buffer = new Array(len); - for (var chk = 1; chk < len; chk *= 2) { - pass(arr, comp, chk, buffer); - var tmp = arr; - arr = buffer; + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + buffer = tmp; } - return arr; + return array; } -// Run a single pass with the given chunk size. -var pass = function(arr, comp, chk, result) { +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ var len = arr.length; var i = 0; + // Step size / double chunk size. var dbl = chk * 2; + // Bounds of the left and right chunks. var l, r, e; + // Iterators over the left and right chunk. var li, ri; // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) { + for (l = 0; l < len; l += dbl) + { r = l + chk; e = r + chk; - if (r > len) r = len; - if (e > len) e = len; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } // Iterate both chunks in parallel. li = l; ri = r; - while (true) { + + while (true) + { // Compare the chunks. - if (li < r && ri < e) { + if (li < r && ri < e) + { // This works for a regular `sort()` compatible comparator, // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) { + if (comp(arr[li], arr[ri]) <= 0) + { result[i++] = arr[li++]; } - else { + else + { result[i++] = arr[ri++]; } } - // Nothing to compare, just flush what's left. - else if (li < r) { + else if (li < r) + { + // Nothing to compare, just flush what's left. result[i++] = arr[li++]; } - else if (ri < e) { + else if (ri < e) + { result[i++] = arr[ri++]; } - // Both iterators are at the chunk ends. - else { + else + { + // Both iterators are at the chunk ends. break; } } } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort + * @since 3.0.0 + * + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. + * + * @return {array} The sorted result. + */ +var StableSort = function (array, compare) +{ + if (compare === undefined) { compare = Compare; } + + var result = Process(array, compare); + + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } + + return array; }; -// Export using CommonJS or to the window. -if (true) { - module.exports = stable; -} -else {} +module.exports = StableSort; -})(); /***/ }), -/* 285 */ +/* 289 */ /***/ (function(module, exports) { /** @@ -38252,7 +39806,7 @@ module.exports = Swap; /***/ }), -/* 286 */ +/* 290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38267,34 +39821,33 @@ module.exports = Swap; module.exports = { - Alpha: __webpack_require__(287), - AlphaSingle: __webpack_require__(288), - Animation: __webpack_require__(289), - BlendMode: __webpack_require__(310), + Alpha: __webpack_require__(291), + AlphaSingle: __webpack_require__(292), + BlendMode: __webpack_require__(293), ComputedSize: __webpack_require__(46), - Crop: __webpack_require__(311), + Crop: __webpack_require__(294), Depth: __webpack_require__(47), Flip: __webpack_require__(48), - GetBounds: __webpack_require__(312), - Mask: __webpack_require__(321), - Origin: __webpack_require__(341), - PathFollower: __webpack_require__(342), - Pipeline: __webpack_require__(345), + GetBounds: __webpack_require__(295), + Mask: __webpack_require__(304), + Origin: __webpack_require__(324), + PathFollower: __webpack_require__(325), + Pipeline: __webpack_require__(328), ScrollFactor: __webpack_require__(49), - Size: __webpack_require__(346), - Texture: __webpack_require__(347), - TextureCrop: __webpack_require__(348), - Tint: __webpack_require__(349), - ToJSON: __webpack_require__(54), + Size: __webpack_require__(330), + Texture: __webpack_require__(331), + TextureCrop: __webpack_require__(332), + Tint: __webpack_require__(333), + ToJSON: __webpack_require__(53), Transform: __webpack_require__(50), - TransformMatrix: __webpack_require__(51), - Visible: __webpack_require__(52) + TransformMatrix: __webpack_require__(23), + Visible: __webpack_require__(51) }; /***/ }), -/* 287 */ +/* 291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38303,7 +39856,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(3); +var Clamp = __webpack_require__(4); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -38589,7 +40142,7 @@ module.exports = Alpha; /***/ }), -/* 288 */ +/* 292 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38598,7 +40151,7 @@ module.exports = Alpha; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(3); +var Clamp = __webpack_require__(4); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -38698,2665 +40251,8 @@ var AlphaSingle = { module.exports = AlphaSingle; -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BaseAnimation = __webpack_require__(290); -var Class = __webpack_require__(0); -var Events = __webpack_require__(59); - -/** - * @classdesc - * A Game Object Animation Controller. - * - * This controller lives as an instance within a Game Object, accessible as `sprite.anims`. - * - * @class Animation - * @memberof Phaser.GameObjects.Components - * @constructor - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} parent - The Game Object to which this animation controller belongs. - */ -var Animation = new Class({ - - initialize: - - function Animation (parent) - { - /** - * The Game Object to which this animation controller belongs. - * - * @name Phaser.GameObjects.Components.Animation#parent - * @type {Phaser.GameObjects.GameObject} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.GameObjects.Components.Animation#animationManager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.animationManager = parent.scene.sys.anims; - - this.animationManager.once(Events.REMOVE_ANIMATION, this.remove, this); - - /** - * Is an animation currently playing or not? - * - * @name Phaser.GameObjects.Components.Animation#isPlaying - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.isPlaying = false; - - /** - * The current Animation loaded into this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentAnim - * @type {?Phaser.Animations.Animation} - * @default null - * @since 3.0.0 - */ - this.currentAnim = null; - - /** - * The current AnimationFrame being displayed by this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @since 3.0.0 - */ - this.currentFrame = null; - - /** - * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnim - * @type {?string} - * @default null - * @since 3.16.0 - */ - this.nextAnim = null; - - /** - * A queue of keys of the next Animations to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnimsQueue - * @type {string[]} - * @since 3.24.0 - */ - this.nextAnimsQueue = []; - - /** - * Time scale factor. - * - * @name Phaser.GameObjects.Components.Animation#_timeScale - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - this._timeScale = 1; - - /** - * The frame rate of playback in frames per second. - * The default is 24 if the `duration` property is `null`. - * - * @name Phaser.GameObjects.Components.Animation#frameRate - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.frameRate = 0; - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.GameObjects.Components.Animation#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * ms per frame, not including frame specific modifiers that may be present in the Animation data. - * - * @name Phaser.GameObjects.Components.Animation#msPerFrame - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.msPerFrame = 0; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.GameObjects.Components.Animation#skipMissedFrames - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.skipMissedFrames = true; - - /** - * A delay before starting playback, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_delay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._delay = 0; - - /** - * Number of times to repeat the animation (-1 for infinity) - * - * @name Phaser.GameObjects.Components.Animation#_repeat - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeat = 0; - - /** - * Delay before the repeat starts, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_repeatDelay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeatDelay = 0; - - /** - * Should the animation yoyo? (reverse back down to the start) before repeating? - * - * @name Phaser.GameObjects.Components.Animation#_yoyo - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._yoyo = false; - - /** - * Will the playhead move forwards (`true`) or in reverse (`false`). - * - * @name Phaser.GameObjects.Components.Animation#forward - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.forward = true; - - /** - * An Internal trigger that's play the animation in reverse mode ('true') or not ('false'), - * needed because forward can be changed by yoyo feature. - * - * @name Phaser.GameObjects.Components.Animation#_reverse - * @type {boolean} - * @default false - * @private - * @since 3.12.0 - */ - this._reverse = false; - - /** - * Internal time overflow accumulator. - * - * @name Phaser.GameObjects.Components.Animation#accumulator - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.accumulator = 0; - - /** - * The time point at which the next animation frame will change. - * - * @name Phaser.GameObjects.Components.Animation#nextTick - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.nextTick = 0; - - /** - * An internal counter keeping track of how many repeats are left to play. - * - * @name Phaser.GameObjects.Components.Animation#repeatCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.repeatCounter = 0; - - /** - * An internal flag keeping track of pending repeats. - * - * @name Phaser.GameObjects.Components.Animation#pendingRepeat - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.pendingRepeat = false; - - /** - * Is the Animation paused? - * - * @name Phaser.GameObjects.Components.Animation#_paused - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._paused = false; - - /** - * Was the animation previously playing before being paused? - * - * @name Phaser.GameObjects.Components.Animation#_wasPlaying - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._wasPlaying = false; - - /** - * Internal property tracking if this Animation is waiting to stop. - * - * 0 = No - * 1 = Waiting for ms to pass - * 2 = Waiting for repeat - * 3 = Waiting for specific frame - * - * @name Phaser.GameObjects.Components.Animation#_pendingStop - * @type {integer} - * @private - * @since 3.4.0 - */ - this._pendingStop = 0; - - /** - * Internal property used by _pendingStop. - * - * @name Phaser.GameObjects.Components.Animation#_pendingStopValue - * @type {any} - * @private - * @since 3.4.0 - */ - this._pendingStopValue; - }, - - /** - * Sets an animation to be played immediately after the current one completes. - * - * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. - * - * An animation set to repeat forever will never enter a completed state. - * - * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). - * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. - * - * Call this method with no arguments to reset the chained animation. - * - * @method Phaser.GameObjects.Components.Animation#chain - * @since 3.16.0 - * - * @param {(string|Phaser.Animations.Animation)} [key] - The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - chain: function (key) - { - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (this.nextAnim === null) - { - this.nextAnim = key; - } - else - { - this.nextAnimsQueue.push(key); - } - - return this.parent; - }, - - /** - * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#setDelay - * @since 3.4.0 - * - * @param {integer} [value=0] - The amount of time, in milliseconds, to wait before starting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setDelay: function (value) - { - if (value === undefined) { value = 0; } - - this._delay = value; - - return this.parent; - }, - - /** - * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#getDelay - * @since 3.4.0 - * - * @return {integer} The amount of time, in milliseconds, the Animation will wait before starting playback. - */ - getDelay: function () - { - return this._delay; - }, - - /** - * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. - * - * @method Phaser.GameObjects.Components.Animation#delayedPlay - * @since 3.0.0 - * - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. - * @param {string} key - The key of the animation to play. - * @param {integer} [startFrame=0] - The frame of the animation to start from. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - delayedPlay: function (delay, key, startFrame) - { - this.play(key, true, startFrame); - - this.nextTick += delay; - - return this.parent; - }, - - /** - * Returns the key of the animation currently loaded into this component. - * - * @method Phaser.GameObjects.Components.Animation#getCurrentKey - * @since 3.0.0 - * - * @return {string} The key of the Animation loaded into this component. - */ - getCurrentKey: function () - { - if (this.currentAnim) - { - return this.currentAnim.key; - } - }, - - /** - * Internal method used to load an animation into this component. - * - * @method Phaser.GameObjects.Components.Animation#load - * @protected - * @since 3.0.0 - * - * @param {string} key - The key of the animation to load. - * @param {integer} [startFrame=0] - The start frame of the animation to load. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - load: function (key, startFrame) - { - if (startFrame === undefined) { startFrame = 0; } - - if (this.isPlaying) - { - this.stop(); - } - - // Load the new animation in - this.animationManager.load(this, key, startFrame); - - return this.parent; - }, - - /** - * Pause the current animation and set the `isPlaying` property to `false`. - * You can optionally pause it at a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#pause - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [atFrame] - An optional frame to set after pausing the animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - pause: function (atFrame) - { - if (!this._paused) - { - this._paused = true; - this._wasPlaying = this.isPlaying; - this.isPlaying = false; - } - - if (atFrame !== undefined) - { - this.updateFrame(atFrame); - } - - return this.parent; - }, - - /** - * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. - * You can optionally tell it to start playback from a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#resume - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [fromFrame] - An optional frame to set before restarting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - resume: function (fromFrame) - { - if (this._paused) - { - this._paused = false; - this.isPlaying = this._wasPlaying; - } - - if (fromFrame !== undefined) - { - this.updateFrame(fromFrame); - } - - return this.parent; - }, - - /** - * `true` if the current animation is paused, otherwise `false`. - * - * @name Phaser.GameObjects.Components.Animation#isPaused - * @readonly - * @type {boolean} - * @since 3.4.0 - */ - isPaused: { - - get: function () - { - return this._paused; - } - - }, - - /** - * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. - * - * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. - * - * @method Phaser.GameObjects.Components.Animation#play - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.0.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - play: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = true; - this._reverse = false; - this._paused = false; - this._wasPlaying = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#playReverse - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.12.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - playReverse: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = false; - this._reverse = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. - * - * @method Phaser.GameObjects.Components.Animation#_startAnimation - * @fires Phaser.Animations.Events#ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.12.0 - * - * @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - _startAnimation: function (key, startFrame) - { - this.load(key, startFrame); - - var anim = this.currentAnim; - var gameObject = this.parent; - - if (!anim) - { - return gameObject; - } - - // Should give us 9,007,199,254,740,991 safe repeats - this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; - - anim.getFirstTick(this); - - this.isPlaying = true; - this.pendingRepeat = false; - - if (anim.showOnStart) - { - gameObject.visible = true; - } - - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_START, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_START + key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_START, anim, frame, gameObject); - - return gameObject; - }, - - /** - * Reverse the Animation that is already playing on the Game Object. - * - * @method Phaser.GameObjects.Components.Animation#reverse - * @since 3.12.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - reverse: function () - { - if (this.isPlaying) - { - this._reverse = !this._reverse; - - this.forward = !this.forward; - } - - return this.parent; - }, - - /** - * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. - * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different - * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. - * - * @method Phaser.GameObjects.Components.Animation#getProgress - * @since 3.4.0 - * - * @return {number} The progress of the current animation, between 0 and 1. - */ - getProgress: function () - { - var p = this.currentFrame.progress; - - if (!this.forward) - { - p = 1 - p; - } - - return p; - }, - - /** - * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. - * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. - * - * @method Phaser.GameObjects.Components.Animation#setProgress - * @since 3.4.0 - * - * @param {number} [value=0] - The progress value, between 0 and 1. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setProgress: function (value) - { - if (!this.forward) - { - value = 1 - value; - } - - this.setCurrentFrame(this.currentAnim.getFrameByProgress(value)); - - return this.parent; - }, - - /** - * Handle the removal of an animation from the Animation Manager. - * - * @method Phaser.GameObjects.Components.Animation#remove - * @since 3.0.0 - * - * @param {string} [key] - The key of the removed Animation. - * @param {Phaser.Animations.Animation} [animation] - The removed Animation. - */ - remove: function (key, animation) - { - if (animation === undefined) { animation = this.currentAnim; } - - if (this.isPlaying && animation.key === this.currentAnim.key) - { - this.stop(); - - this.setCurrentFrame(this.currentAnim.frames[0]); - } - }, - - /** - * Gets the number of times that the animation will repeat - * after its first iteration. For example, if returns 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * A value of -1 means the animation will repeat indefinitely. - * - * @method Phaser.GameObjects.Components.Animation#getRepeat - * @since 3.4.0 - * - * @return {integer} The number of times that the animation will repeat. - */ - getRepeat: function () - { - return this._repeat; - }, - - /** - * Sets the number of times that the animation should repeat - * after its first iteration. For example, if repeat is 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * To repeat indefinitely, use -1. repeat should always be an integer. - * - * @method Phaser.GameObjects.Components.Animation#setRepeat - * @since 3.4.0 - * - * @param {integer} value - The number of times that the animation should repeat. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeat: function (value) - { - this._repeat = value; - - this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; - - return this.parent; - }, - - /** - * Gets the amount of delay between repeats, if any. - * - * @method Phaser.GameObjects.Components.Animation#getRepeatDelay - * @since 3.4.0 - * - * @return {number} The delay between repeats. - */ - getRepeatDelay: function () - { - return this._repeatDelay; - }, - - /** - * Sets the amount of time in seconds between repeats. - * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, - * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds - * before doing its final repeat. - * - * @method Phaser.GameObjects.Components.Animation#setRepeatDelay - * @since 3.4.0 - * - * @param {number} value - The delay to wait between repeats, in seconds. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeatDelay: function (value) - { - this._repeatDelay = value; - - return this.parent; - }, - - /** - * Restarts the current animation from its beginning, optionally including its delay value. - * - * @method Phaser.GameObjects.Components.Animation#restart - * @fires Phaser.Animations.Events#ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.0.0 - * - * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - restart: function (includeDelay) - { - if (includeDelay === undefined) { includeDelay = false; } - - var anim = this.currentAnim; - - anim.getFirstTick(this, includeDelay); - - this.forward = true; - this.isPlaying = true; - this.pendingRepeat = false; - this._paused = false; - - // Set frame - this.updateFrame(anim.frames[0]); - - var gameObject = this.parent; - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_RESTART, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_RESTART + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_RESTART, anim, frame, gameObject); - - return this.parent; - }, - - /** - * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. - * - * If no animation is set, no event will be dispatched. - * - * If there is another animation queued (via the `chain` method) then it will start playing immediately. - * - * @method Phaser.GameObjects.Components.Animation#stop - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.0.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stop: function () - { - this._pendingStop = 0; - - this.isPlaying = false; - - var gameObject = this.parent; - var anim = this.currentAnim; - var frame = this.currentFrame; - - if (anim) - { - anim.emit(Events.ANIMATION_COMPLETE, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_COMPLETE + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_COMPLETE, anim, frame, gameObject); - } - - if (this.nextAnim) - { - var key = this.nextAnim; - - this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null; - - this.play(key); - } - - return gameObject; - }, - - /** - * Stops the current animation from playing after the specified time delay, given in milliseconds. - * - * @method Phaser.GameObjects.Components.Animation#stopAfterDelay - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopAfterDelay: function (delay) - { - this._pendingStop = 1; - this._pendingStopValue = delay; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next repeats. - * - * @method Phaser.GameObjects.Components.Animation#stopOnRepeat - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnRepeat: function () - { - this._pendingStop = 2; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next sets the given frame. - * If this frame doesn't exist within the animation it will not stop it from playing. - * - * @method Phaser.GameObjects.Components.Animation#stopOnFrame - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnFrame: function (frame) - { - this._pendingStop = 3; - this._pendingStopValue = frame; - - return this.parent; - }, - - /** - * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. - * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. - * - * @method Phaser.GameObjects.Components.Animation#setTimeScale - * @since 3.4.0 - * - * @param {number} [value=1] - The time scale factor, where 1 is no change, 0.5 is half speed, etc. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setTimeScale: function (value) - { - if (value === undefined) { value = 1; } - - this._timeScale = value; - - return this.parent; - }, - - /** - * Gets the Time Scale factor. - * - * @method Phaser.GameObjects.Components.Animation#getTimeScale - * @since 3.4.0 - * - * @return {number} The Time Scale value. - */ - getTimeScale: function () - { - return this._timeScale; - }, - - /** - * Returns the total number of frames in this animation. - * - * @method Phaser.GameObjects.Components.Animation#getTotalFrames - * @since 3.4.0 - * - * @return {integer} The total number of frames in this animation. - */ - getTotalFrames: function () - { - return this.currentAnim.frames.length; - }, - - /** - * The internal update loop for the Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#update - * @since 3.0.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - update: function (time, delta) - { - if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused) - { - return; - } - - this.accumulator += delta * this._timeScale; - - if (this._pendingStop === 1) - { - this._pendingStopValue -= delta; - - if (this._pendingStopValue <= 0) - { - return this.currentAnim.completeAnimation(this); - } - } - - if (this.accumulator >= this.nextTick) - { - this.currentAnim.setFrame(this); - } - }, - - /** - * Sets the given Animation Frame as being the current frame - * and applies it to the parent Game Object, adjusting its size and origin as needed. - * - * @method Phaser.GameObjects.Components.Animation#setCurrentFrame - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The Animation Frame to set as being current. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setCurrentFrame: function (animationFrame) - { - var gameObject = this.parent; - - this.currentFrame = animationFrame; - - gameObject.texture = animationFrame.frame.texture; - gameObject.frame = animationFrame.frame; - - if (gameObject.isCropped) - { - gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); - } - - gameObject.setSizeToFrame(); - - if (gameObject._originComponent) - { - if (animationFrame.frame.customPivot) - { - gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY); - } - else - { - gameObject.updateDisplayOrigin(); - } - } - - return gameObject; - }, - - /** - * Internal frame change handler. - * - * @method Phaser.GameObjects.Components.Animation#updateFrame - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @private - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to. - */ - updateFrame: function (animationFrame) - { - var gameObject = this.setCurrentFrame(animationFrame); - - if (this.isPlaying) - { - if (animationFrame.setAlpha) - { - gameObject.alpha = animationFrame.alpha; - } - - var anim = this.currentAnim; - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_UPDATE + anim.key, anim, animationFrame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_UPDATE, anim, animationFrame, gameObject); - - if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) - { - this.currentAnim.completeAnimation(this); - } - } - }, - - /** - * Advances the animation to the next frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in reverse, calling this method doesn't then change the direction to forwards. - * - * @method Phaser.GameObjects.Components.Animation#nextFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - nextFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.nextFrame(this); - } - - return this.parent; - }, - - /** - * Advances the animation to the previous frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in forwards, calling this method doesn't then change the direction to backwards. - * - * @method Phaser.GameObjects.Components.Animation#previousFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - previousFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.previousFrame(this); - } - - return this.parent; - }, - - /** - * Sets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#setYoyo - * @since 3.4.0 - * - * @param {boolean} [value=false] - `true` if the animation should yoyo, `false` to not. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setYoyo: function (value) - { - if (value === undefined) { value = false; } - - this._yoyo = value; - - return this.parent; - }, - - /** - * Gets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#getYoyo - * @since 3.4.0 - * - * @return {boolean} `true` if the animation is set to yoyo, `false` if not. - */ - getYoyo: function () - { - return this._yoyo; - }, - - /** - * Destroy this Animation component. - * - * Unregisters event listeners and cleans up its references. - * - * @method Phaser.GameObjects.Components.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.animationManager.off(Events.REMOVE_ANIMATION, this.remove, this); - - this.animationManager = null; - this.parent = null; - this.nextAnimsQueue.length = 0; - - this.currentAnim = null; - this.currentFrame = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 290 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(3); -var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(55); -var Events = __webpack_require__(59); -var FindClosestInSorted = __webpack_require__(57); -var Frame = __webpack_require__(309); -var GetValue = __webpack_require__(7); - -/** - * @classdesc - * A Frame based Animation. - * - * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. - * - * The Animation Manager creates these. Game Objects don't own an instance of these directly. - * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) - * So multiple Game Objects can have playheads all pointing to this one Animation instance. - * - * @class Animation - * @memberof Phaser.Animations - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager - * @param {string} key - The unique identifying string for this animation. - * @param {Phaser.Types.Animations.Animation} config - The Animation configuration. - */ -var Animation = new Class({ - - Extends: EventEmitter, - - initialize: - - function Animation (manager, key, config) - { - EventEmitter.call(this); - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.Animations.Animation#manager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.manager = manager; - - /** - * The unique identifying string for this animation. - * - * @name Phaser.Animations.Animation#key - * @type {string} - * @since 3.0.0 - */ - this.key = key; - - /** - * A frame based animation (as opposed to a bone based animation) - * - * @name Phaser.Animations.Animation#type - * @type {string} - * @default frame - * @since 3.0.0 - */ - this.type = 'frame'; - - /** - * Extract all the frame data into the frames array. - * - * @name Phaser.Animations.Animation#frames - * @type {Phaser.Animations.AnimationFrame[]} - * @since 3.0.0 - */ - this.frames = this.getFrames( - manager.textureManager, - GetValue(config, 'frames', []), - GetValue(config, 'defaultTextureKey', null) - ); - - /** - * The frame rate of playback in frames per second (default 24 if duration is null) - * - * @name Phaser.Animations.Animation#frameRate - * @type {integer} - * @default 24 - * @since 3.0.0 - */ - this.frameRate = GetValue(config, 'frameRate', null); - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.Animations.Animation#duration - * @type {integer} - * @since 3.0.0 - */ - this.duration = GetValue(config, 'duration', null); - - if (this.duration === null && this.frameRate === null) - { - // No duration or frameRate given, use default frameRate of 24fps - this.frameRate = 24; - this.duration = (this.frameRate / this.frames.length) * 1000; - } - else if (this.duration && this.frameRate === null) - { - // Duration given but no frameRate, so set the frameRate based on duration - // I.e. 12 frames in the animation, duration = 4000 ms - // So frameRate is 12 / (4000 / 1000) = 3 fps - this.frameRate = this.frames.length / (this.duration / 1000); - } - else - { - // frameRate given, derive duration from it (even if duration also specified) - // I.e. 15 frames in the animation, frameRate = 30 fps - // So duration is 15 / 30 = 0.5 * 1000 (half a second, or 500ms) - this.duration = (this.frames.length / this.frameRate) * 1000; - } - - /** - * How many ms per frame, not including frame specific modifiers. - * - * @name Phaser.Animations.Animation#msPerFrame - * @type {integer} - * @since 3.0.0 - */ - this.msPerFrame = 1000 / this.frameRate; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.Animations.Animation#skipMissedFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true); - - /** - * The delay in ms before the playback will begin. - * - * @name Phaser.Animations.Animation#delay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.delay = GetValue(config, 'delay', 0); - - /** - * Number of times to repeat the animation. Set to -1 to repeat forever. - * - * @name Phaser.Animations.Animation#repeat - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeat = GetValue(config, 'repeat', 0); - - /** - * The delay in ms before the a repeat play starts. - * - * @name Phaser.Animations.Animation#repeatDelay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeatDelay = GetValue(config, 'repeatDelay', 0); - - /** - * Should the animation yoyo (reverse back down to the start) before repeating? - * - * @name Phaser.Animations.Animation#yoyo - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.yoyo = GetValue(config, 'yoyo', false); - - /** - * Should the GameObject's `visible` property be set to `true` when the animation starts to play? - * - * @name Phaser.Animations.Animation#showOnStart - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.showOnStart = GetValue(config, 'showOnStart', false); - - /** - * Should the GameObject's `visible` property be set to `false` when the animation finishes? - * - * @name Phaser.Animations.Animation#hideOnComplete - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.hideOnComplete = GetValue(config, 'hideOnComplete', false); - - /** - * Global pause. All Game Objects using this Animation instance are impacted by this property. - * - * @name Phaser.Animations.Animation#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - this.manager.on(Events.PAUSE_ALL, this.pause, this); - this.manager.on(Events.RESUME_ALL, this.resume, this); - }, - - /** - * Add frames to the end of the animation. - * - * @method Phaser.Animations.Animation#addFrame - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrame: function (config) - { - return this.addFrameAt(this.frames.length, config); - }, - - /** - * Add frame/s into the animation. - * - * @method Phaser.Animations.Animation#addFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index to insert the frame at within the animation. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrameAt: function (index, config) - { - var newFrames = this.getFrames(this.manager.textureManager, config); - - if (newFrames.length > 0) - { - if (index === 0) - { - this.frames = newFrames.concat(this.frames); - } - else if (index === this.frames.length) - { - this.frames = this.frames.concat(newFrames); - } - else - { - var pre = this.frames.slice(0, index); - var post = this.frames.slice(index); - - this.frames = pre.concat(newFrames, post); - } - - this.updateFrameSequence(); - } - - return this; - }, - - /** - * Check if the given frame index is valid. - * - * @method Phaser.Animations.Animation#checkFrame - * @since 3.0.0 - * - * @param {integer} index - The index to be checked. - * - * @return {boolean} `true` if the index is valid, otherwise `false`. - */ - checkFrame: function (index) - { - return (index >= 0 && index < this.frames.length); - }, - - /** - * Called internally when this Animation completes playback. - * Optionally, hides the parent Game Object, then stops playback. - * - * @method Phaser.Animations.Animation#completeAnimation - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - completeAnimation: function (component) - { - if (this.hideOnComplete) - { - component.parent.visible = false; - } - - component.stop(); - }, - - /** - * Called internally when this Animation first starts to play. - * Sets the accumulator and nextTick properties. - * - * @method Phaser.Animations.Animation#getFirstTick - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - * @param {boolean} [includeDelay=true] - If `true` the Animation Components delay value will be added to the `nextTick` total. - */ - getFirstTick: function (component, includeDelay) - { - if (includeDelay === undefined) { includeDelay = true; } - - // When is the first update due? - component.accumulator = 0; - component.nextTick = component.msPerFrame + component.currentFrame.duration; - - if (includeDelay) - { - component.nextTick += component._delay; - } - }, - - /** - * Returns the AnimationFrame at the provided index - * - * @method Phaser.Animations.Animation#getFrameAt - * @protected - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence - */ - getFrameAt: function (index) - { - return this.frames[index]; - }, - - /** - * Creates AnimationFrame instances based on the given frame data. - * - * @method Phaser.Animations.Animation#getFrames - * @since 3.0.0 - * - * @param {Phaser.Textures.TextureManager} textureManager - A reference to the global Texture Manager. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} frames - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * @param {string} [defaultTextureKey] - The key to use if no key is set in the frame configuration object. - * - * @return {Phaser.Animations.AnimationFrame[]} An array of newly created AnimationFrame instances. - */ - getFrames: function (textureManager, frames, defaultTextureKey) - { - var out = []; - var prev; - var animationFrame; - var index = 1; - var i; - var textureKey; - - // if frames is a string, we'll get all the frames from the texture manager as if it's a sprite sheet - if (typeof frames === 'string') - { - textureKey = frames; - - var texture = textureManager.get(textureKey); - var frameKeys = texture.getFrameNames(); - - frames = []; - - frameKeys.forEach(function (idx, value) - { - frames.push({ key: textureKey, frame: value }); - }); - } - - if (!Array.isArray(frames) || frames.length === 0) - { - return out; - } - - for (i = 0; i < frames.length; i++) - { - var item = frames[i]; - - var key = GetValue(item, 'key', defaultTextureKey); - - if (!key) - { - continue; - } - - // Could be an integer or a string - var frame = GetValue(item, 'frame', 0); - - // The actual texture frame - var textureFrame = textureManager.getFrame(key, frame); - - animationFrame = new Frame(key, frame, index, textureFrame); - - animationFrame.duration = GetValue(item, 'duration', 0); - - animationFrame.isFirst = (!prev); - - // The previously created animationFrame - if (prev) - { - prev.nextFrame = animationFrame; - - animationFrame.prevFrame = prev; - } - - out.push(animationFrame); - - prev = animationFrame; - - index++; - } - - if (out.length > 0) - { - animationFrame.isLast = true; - - // Link them end-to-end, so they loop - animationFrame.nextFrame = out[0]; - - out[0].prevFrame = animationFrame; - - // Generate the progress data - - var slice = 1 / (out.length - 1); - - for (i = 0; i < out.length; i++) - { - out[i].progress = i * slice; - } - } - - return out; - }, - - /** - * Called internally. Sets the accumulator and nextTick values of the current Animation. - * - * @method Phaser.Animations.Animation#getNextTick - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - getNextTick: function (component) - { - // accumulator += delta * _timeScale - // after a large delta surge (perf issue for example) we need to adjust for it here - - // When is the next update due? - component.accumulator -= component.nextTick; - - component.nextTick = component.msPerFrame + component.currentFrame.duration; - }, - - /** - * Loads the Animation values into the Animation Component. - * - * @method Phaser.Animations.Animation#load - * @private - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into. - * @param {integer} startFrame - The start frame of the animation to load. - */ - load: function (component, startFrame) - { - if (startFrame >= this.frames.length) - { - startFrame = 0; - } - - if (component.currentAnim !== this) - { - component.currentAnim = this; - - component.frameRate = this.frameRate; - component.duration = this.duration; - component.msPerFrame = this.msPerFrame; - component.skipMissedFrames = this.skipMissedFrames; - - component._delay = this.delay; - component._repeat = this.repeat; - component._repeatDelay = this.repeatDelay; - component._yoyo = this.yoyo; - } - - var frame = this.frames[startFrame]; - - if (startFrame === 0 && !component.forward) - { - frame = this.getLastFrame(); - } - - component.updateFrame(frame); - }, - - /** - * Returns the frame closest to the given progress value between 0 and 1. - * - * @method Phaser.Animations.Animation#getFrameByProgress - * @since 3.4.0 - * - * @param {number} value - A value between 0 and 1. - * - * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value. - */ - getFrameByProgress: function (value) - { - value = Clamp(value, 0, 1); - - return FindClosestInSorted(value, this.frames, 'progress'); - }, - - /** - * Advance the animation frame. - * - * @method Phaser.Animations.Animation#nextFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - */ - nextFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isLast) - { - // We're at the end of the animation - - // Yoyo? (happens before repeat) - if (component._yoyo) - { - this.handleYoyoFrame(component, false); - } - else if (component.repeatCounter > 0) - { - // Repeat (happens before complete) - - if (component._reverse && component.forward) - { - component.forward = false; - } - else - { - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.nextFrame); - } - }, - - /** - * Handle the yoyo functionality in nextFrame and previousFrame methods. - * - * @method Phaser.Animations.Animation#handleYoyoFrame - * @private - * @since 3.12.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) - */ - handleYoyoFrame: function (component, isReverse) - { - if (!isReverse) { isReverse = false; } - - if (component._reverse === !isReverse && component.repeatCounter > 0) - { - if (!component._repeatDelay || component.pendingRepeat) - - { - component.forward = isReverse; - } - - this.repeatAnimation(component); - - return; - } - - if (component._reverse !== isReverse && component.repeatCounter === 0) - { - this.completeAnimation(component); - - return; - } - - component.forward = isReverse; - - var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; - - this.updateAndGetNextTick(component, frame); - }, - - /** - * Returns the animation last frame. - * - * @method Phaser.Animations.Animation#getLastFrame - * @since 3.12.0 - * - * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. - */ - getLastFrame: function () - { - return this.frames[this.frames.length - 1]; - }, - - /** - * Called internally when the Animation is playing backwards. - * Sets the previous frame, causing a yoyo, repeat, complete or update, accordingly. - * - * @method Phaser.Animations.Animation#previousFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - previousFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isFirst) - { - // We're at the start of the animation - - if (component._yoyo) - { - this.handleYoyoFrame(component, true); - } - else if (component.repeatCounter > 0) - { - if (component._reverse && !component.forward) - { - component.currentFrame = this.getLastFrame(); - this.repeatAnimation(component); - } - else - { - // Repeat (happens before complete) - component.forward = true; - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.prevFrame); - } - }, - - /** - * Update Frame and Wait next tick. - * - * @method Phaser.Animations.Animation#updateAndGetNextTick - * @private - * @since 3.12.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. - */ - updateAndGetNextTick: function (component, frame) - { - component.updateFrame(frame); - - this.getNextTick(component); - }, - - /** - * Removes the given AnimationFrame from this Animation instance. - * This is a global action. Any Game Object using this Animation will be impacted by this change. - * - * @method Phaser.Animations.Animation#removeFrame - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The AnimationFrame to be removed. - * - * @return {this} This Animation object. - */ - removeFrame: function (frame) - { - var index = this.frames.indexOf(frame); - - if (index !== -1) - { - this.removeFrameAt(index); - } - - return this; - }, - - /** - * Removes a frame from the AnimationFrame array at the provided index - * and updates the animation accordingly. - * - * @method Phaser.Animations.Animation#removeFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {this} This Animation object. - */ - removeFrameAt: function (index) - { - this.frames.splice(index, 1); - - this.updateFrameSequence(); - - return this; - }, - - /** - * Called internally during playback. Forces the animation to repeat, providing there are enough counts left - * in the repeat counter. - * - * @method Phaser.Animations.Animation#repeatAnimation - * @fires Phaser.Animations.Events#ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - repeatAnimation: function (component) - { - if (component._pendingStop === 2) - { - return this.completeAnimation(component); - } - - if (component._repeatDelay > 0 && component.pendingRepeat === false) - { - component.pendingRepeat = true; - component.accumulator -= component.nextTick; - component.nextTick += component._repeatDelay; - } - else - { - component.repeatCounter--; - - component.updateFrame(component.currentFrame[(component.forward) ? 'nextFrame' : 'prevFrame']); - - if (component.isPlaying) - { - this.getNextTick(component); - - component.pendingRepeat = false; - - var frame = component.currentFrame; - var parent = component.parent; - - this.emit(Events.ANIMATION_REPEAT, this, frame); - - parent.emit(Events.SPRITE_ANIMATION_KEY_REPEAT + this.key, this, frame, component.repeatCounter, parent); - - parent.emit(Events.SPRITE_ANIMATION_REPEAT, this, frame, component.repeatCounter, parent); - } - } - }, - - /** - * Sets the texture frame the animation uses for rendering. - * - * @method Phaser.Animations.Animation#setFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - setFrame: function (component) - { - // Work out which frame should be set next on the child, and set it - if (component.forward) - { - this.nextFrame(component); - } - else - { - this.previousFrame(component); - } - }, - - /** - * Converts the animation data to JSON. - * - * @method Phaser.Animations.Animation#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimation} The resulting JSONAnimation formatted object. - */ - toJSON: function () - { - var output = { - key: this.key, - type: this.type, - frames: [], - frameRate: this.frameRate, - duration: this.duration, - skipMissedFrames: this.skipMissedFrames, - delay: this.delay, - repeat: this.repeat, - repeatDelay: this.repeatDelay, - yoyo: this.yoyo, - showOnStart: this.showOnStart, - hideOnComplete: this.hideOnComplete - }; - - this.frames.forEach(function (frame) - { - output.frames.push(frame.toJSON()); - }); - - return output; - }, - - /** - * Called internally whenever frames are added to, or removed from, this Animation. - * - * @method Phaser.Animations.Animation#updateFrameSequence - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - updateFrameSequence: function () - { - var len = this.frames.length; - var slice = 1 / (len - 1); - - var frame; - - for (var i = 0; i < len; i++) - { - frame = this.frames[i]; - - frame.index = i + 1; - frame.isFirst = false; - frame.isLast = false; - frame.progress = i * slice; - - if (i === 0) - { - frame.isFirst = true; - - if (len === 1) - { - frame.isLast = true; - frame.nextFrame = frame; - frame.prevFrame = frame; - } - else - { - frame.isLast = false; - frame.prevFrame = this.frames[len - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - else if (i === len - 1 && len > 1) - { - frame.isLast = true; - frame.prevFrame = this.frames[len - 2]; - frame.nextFrame = this.frames[0]; - } - else if (len > 1) - { - frame.prevFrame = this.frames[i - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - - return this; - }, - - /** - * Pauses playback of this Animation. The paused state is set immediately. - * - * @method Phaser.Animations.Animation#pause - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - pause: function () - { - this.paused = true; - - return this; - }, - - /** - * Resumes playback of this Animation. The paused state is reset immediately. - * - * @method Phaser.Animations.Animation#resume - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - resume: function () - { - this.paused = false; - - return this; - }, - - /** - * Destroys this Animation instance. It will remove all event listeners, - * remove this animation and its key from the global Animation Manager, - * and then destroy all Animation Frames in turn. - * - * @method Phaser.Animations.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAllListeners(); - - this.manager.off(Events.PAUSE_ALL, this.pause, this); - this.manager.off(Events.RESUME_ALL, this.resume, this); - - this.manager.remove(this.key); - - for (var i = 0; i < this.frames.length; i++) - { - this.frames[i].destroy(); - } - - this.frames = []; - - this.manager = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 291 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Add Animation Event. - * - * This event is dispatched when a new animation is added to the global Animation Manager. - * - * This can happen either as a result of an animation instance being added to the Animation Manager, - * or the Animation Manager creating a new animation directly. - * - * @event Phaser.Animations.Events#ADD_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was added to the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the newly created Animation. - */ -module.exports = 'add'; - - -/***/ }), -/* 292 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Complete Event. - * - * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. - * - * Be careful with the volume of events this could generate. If a group of Sprites all complete the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'complete'; - - /***/ }), /* 293 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Repeat Event. - * - * This event is dispatched when a currently playing animation repeats. - * - * The event is dispatched directly from the Animation object itself. Which means that listeners - * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. - * - * @event Phaser.Animations.Events#ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that repeated. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation was on when it repeated. - */ -module.exports = 'repeat'; - - -/***/ }), -/* 294 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Restart Event. - * - * This event is dispatched by an Animation instance when it restarts. - * - * Be careful with the volume of events this could generate. If a group of Sprites all restart the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that restarted playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'restart'; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Start Event. - * - * This event is dispatched by an Animation instance when it starts playing. - * - * Be careful with the volume of events this could generate. If a group of Sprites all play the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that started playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'start'; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Pause All Animations Event. - * - * This event is dispatched when the global Animation Manager is told to pause. - * - * When this happens all current animations will stop updating, although it doesn't necessarily mean - * that the game has paused as well. - * - * @event Phaser.Animations.Events#PAUSE_ALL - * @since 3.0.0 - */ -module.exports = 'pauseall'; - - -/***/ }), -/* 297 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Remove Animation Event. - * - * This event is dispatched when an animation is removed from the global Animation Manager. - * - * @event Phaser.Animations.Events#REMOVE_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was removed from the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the removed Animation. - */ -module.exports = 'remove'; - - -/***/ }), -/* 298 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Resume All Animations Event. - * - * This event is dispatched when the global Animation Manager resumes, having been previously paused. - * - * When this happens all current animations will continue updating again. - * - * @event Phaser.Animations.Events#RESUME_ALL - * @since 3.0.0 - */ -module.exports = 'resumeall'; - - -/***/ }), -/* 299 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Complete Event. - * - * This event is dispatched by a Sprite when an animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete'; - - -/***/ }), -/* 300 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Complete Event. - * - * This event is dispatched by a Sprite when a specific animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete-'; - - -/***/ }), -/* 301 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Repeat Event. - * - * This event is dispatched by a Sprite when a specific animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat-'; - - -/***/ }), -/* 302 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Restart Event. - * - * This event is dispatched by a Sprite when a specific animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart-'; - - -/***/ }), -/* 303 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Start Event. - * - * This event is dispatched by a Sprite when a specific animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart-'; - - -/***/ }), -/* 304 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Update Event. - * - * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate-'; - - -/***/ }), -/* 305 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Repeat Event. - * - * This event is dispatched by a Sprite when an animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat'; - - -/***/ }), -/* 306 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Restart Event. - * - * This event is dispatched by a Sprite when an animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart'; - - -/***/ }), -/* 307 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Start Event. - * - * This event is dispatched by a Sprite when an animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart'; - - -/***/ }), -/* 308 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Update Event. - * - * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate'; - - -/***/ }), -/* 309 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41365,181 +40261,7 @@ module.exports = 'animationupdate'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); - -/** - * @classdesc - * A single frame in an Animation sequence. - * - * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other - * frames in the animation, and index data. It also has the ability to modify the animation timing. - * - * AnimationFrames are generated automatically by the Animation class. - * - * @class AnimationFrame - * @memberof Phaser.Animations - * @constructor - * @since 3.0.0 - * - * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. - * @param {integer} index - The index of this AnimationFrame within the Animation sequence. - * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. - */ -var AnimationFrame = new Class({ - - initialize: - - function AnimationFrame (textureKey, textureFrame, index, frame) - { - /** - * The key of the Texture this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureKey - * @type {string} - * @since 3.0.0 - */ - this.textureKey = textureKey; - - /** - * The key of the Frame within the Texture that this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {(string|integer)} - * @since 3.0.0 - */ - this.textureFrame = textureFrame; - - /** - * The index of this AnimationFrame within the Animation sequence. - * - * @name Phaser.Animations.AnimationFrame#index - * @type {integer} - * @since 3.0.0 - */ - this.index = index; - - /** - * A reference to the Texture Frame this AnimationFrame uses for rendering. - * - * @name Phaser.Animations.AnimationFrame#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - this.frame = frame; - - /** - * Is this the first frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isFirst - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isFirst = false; - - /** - * Is this the last frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isLast - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isLast = false; - - /** - * A reference to the AnimationFrame that comes before this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#prevFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.prevFrame = null; - - /** - * A reference to the AnimationFrame that comes after this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#nextFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.nextFrame = null; - - /** - * Additional time (in ms) that this frame should appear for during playback. - * The value is added onto the msPerFrame set by the animation. - * - * @name Phaser.Animations.AnimationFrame#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * What % through the animation does this frame come? - * This value is generated when the animation is created and cached here. - * - * @name Phaser.Animations.AnimationFrame#progress - * @type {number} - * @default 0 - * @readonly - * @since 3.0.0 - */ - this.progress = 0; - }, - - /** - * Generates a JavaScript object suitable for converting to JSON. - * - * @method Phaser.Animations.AnimationFrame#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimationFrame} The AnimationFrame data. - */ - toJSON: function () - { - return { - key: this.textureKey, - frame: this.textureFrame, - duration: this.duration - }; - }, - - /** - * Destroys this object by removing references to external resources and callbacks. - * - * @method Phaser.Animations.AnimationFrame#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.frame = undefined; - } - -}); - -module.exports = AnimationFrame; - - -/***/ }), -/* 310 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(16); +var BlendModes = __webpack_require__(17); /** * Provides methods used for setting the blend mode of a Game Object. @@ -41652,7 +40374,7 @@ module.exports = BlendMode; /***/ }), -/* 311 */ +/* 294 */ /***/ (function(module, exports) { /** @@ -41777,7 +40499,7 @@ module.exports = Crop; /***/ }), -/* 312 */ +/* 295 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41786,9 +40508,9 @@ module.exports = Crop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(24); -var RotateAround = __webpack_require__(38); -var Vector2 = __webpack_require__(1); +var Rectangle = __webpack_require__(25); +var RotateAround = __webpack_require__(39); +var Vector2 = __webpack_require__(2); /** * Provides methods used for obtaining the bounds of a Game Object. @@ -42136,7 +40858,7 @@ module.exports = GetBounds; /***/ }), -/* 313 */ +/* 296 */ /***/ (function(module, exports) { /** @@ -42171,7 +40893,7 @@ module.exports = Contains; /***/ }), -/* 314 */ +/* 297 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42180,8 +40902,8 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(60); -var Perimeter = __webpack_require__(61); +var GetPoint = __webpack_require__(59); +var Perimeter = __webpack_require__(60); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -42225,7 +40947,7 @@ module.exports = GetPoints; /***/ }), -/* 315 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42235,11 +40957,11 @@ module.exports = GetPoints; */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(316); -var GetPoints = __webpack_require__(317); -var GEOM_CONST = __webpack_require__(25); -var Random = __webpack_require__(319); -var Vector2 = __webpack_require__(1); +var GetPoint = __webpack_require__(299); +var GetPoints = __webpack_require__(300); +var GEOM_CONST = __webpack_require__(26); +var Random = __webpack_require__(302); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -42562,7 +41284,7 @@ module.exports = Line; /***/ }), -/* 316 */ +/* 299 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42571,7 +41293,7 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(12); +var Point = __webpack_require__(10); /** * Get a point on a line that's a given percentage along its length. @@ -42601,7 +41323,7 @@ module.exports = GetPoint; /***/ }), -/* 317 */ +/* 300 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42610,8 +41332,8 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(318); -var Point = __webpack_require__(12); +var Length = __webpack_require__(301); +var Point = __webpack_require__(10); /** * Get a number of points along a line's length. @@ -42666,7 +41388,7 @@ module.exports = GetPoints; /***/ }), -/* 318 */ +/* 301 */ /***/ (function(module, exports) { /** @@ -42694,7 +41416,7 @@ module.exports = Length; /***/ }), -/* 319 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42703,7 +41425,7 @@ module.exports = Length; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(12); +var Point = __webpack_require__(10); /** * Returns a random point on a given Line. @@ -42734,7 +41456,7 @@ module.exports = Random; /***/ }), -/* 320 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42743,7 +41465,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(12); +var Point = __webpack_require__(10); /** * Returns a random point within a Rectangle. @@ -42772,7 +41494,7 @@ module.exports = Random; /***/ }), -/* 321 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42781,8 +41503,8 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(322); -var GeometryMask = __webpack_require__(340); +var BitmapMask = __webpack_require__(305); +var GeometryMask = __webpack_require__(323); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -42809,10 +41531,10 @@ var Mask = { * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @@ -42858,6 +41580,8 @@ var Mask = { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -42868,7 +41592,7 @@ var Mask = { * * @method Phaser.GameObjects.Components.Mask#createBitmapMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. * * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. @@ -42892,12 +41616,12 @@ var Mask = { * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. @@ -42919,7 +41643,7 @@ module.exports = Mask; /***/ }), -/* 322 */ +/* 305 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42929,7 +41653,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(323); +var GameEvents = __webpack_require__(306); /** * @classdesc @@ -42948,6 +41672,9 @@ var GameEvents = __webpack_require__(323); * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -43070,36 +41797,73 @@ var BitmapMask = new Class({ */ this.isStencil = false; - if (renderer && renderer.gl) + this.createMask(); + + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + }, + + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + * + * @method Phaser.Display.Masks.BitmapMask#createMask + * @since 3.50.0 + */ + createMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl) { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) - { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - }, this); + return; } + + if (this.mainTexture) + { + this.clearMask(); + } + + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + }, + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + * + * @method Phaser.Display.Masks.BitmapMask#clearMask + * @since 3.50.0 + */ + clearMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl || !this.mainTexture) + { + return; + } + + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; }, /** @@ -43129,7 +41893,7 @@ var BitmapMask = new Class({ */ preRenderWebGL: function (renderer, maskedObject, camera) { - renderer.pipelines.BitmapMaskPipeline.beginMask(this, maskedObject, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); }, /** @@ -43144,7 +41908,7 @@ var BitmapMask = new Class({ */ postRenderWebGL: function (renderer, camera) { - renderer.pipelines.BitmapMaskPipeline.endMask(this, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera); }, /** @@ -43177,7 +41941,7 @@ var BitmapMask = new Class({ /** * Destroys this BitmapMask and nulls any references it holds. - * + * * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, * so be sure to call `clearMask` on any Game Object using it, before destroying it. * @@ -43186,22 +41950,9 @@ var BitmapMask = new Class({ */ destroy: function () { + this.clearMask(); + this.bitmapMask = null; - - var renderer = this.renderer; - - if (renderer && renderer.gl) - { - renderer.deleteTexture(this.mainTexture); - renderer.deleteTexture(this.maskTexture); - renderer.deleteFramebuffer(this.mainFramebuffer); - renderer.deleteFramebuffer(this.maskFramebuffer); - } - - this.mainTexture = null; - this.maskTexture = null; - this.mainFramebuffer = null; - this.maskFramebuffer = null; this.prevFramebuffer = null; this.renderer = null; } @@ -43212,7 +41963,7 @@ module.exports = BitmapMask; /***/ }), -/* 323 */ +/* 306 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43227,28 +41978,28 @@ module.exports = BitmapMask; module.exports = { - BLUR: __webpack_require__(324), - BOOT: __webpack_require__(325), - CONTEXT_LOST: __webpack_require__(326), - CONTEXT_RESTORED: __webpack_require__(327), - DESTROY: __webpack_require__(328), - FOCUS: __webpack_require__(329), - HIDDEN: __webpack_require__(330), - PAUSE: __webpack_require__(331), - POST_RENDER: __webpack_require__(332), - POST_STEP: __webpack_require__(333), - PRE_RENDER: __webpack_require__(334), - PRE_STEP: __webpack_require__(335), - READY: __webpack_require__(336), - RESUME: __webpack_require__(337), - STEP: __webpack_require__(338), - VISIBLE: __webpack_require__(339) + BLUR: __webpack_require__(307), + BOOT: __webpack_require__(308), + CONTEXT_LOST: __webpack_require__(309), + CONTEXT_RESTORED: __webpack_require__(310), + DESTROY: __webpack_require__(311), + FOCUS: __webpack_require__(312), + HIDDEN: __webpack_require__(313), + PAUSE: __webpack_require__(314), + POST_RENDER: __webpack_require__(315), + POST_STEP: __webpack_require__(316), + PRE_RENDER: __webpack_require__(317), + PRE_STEP: __webpack_require__(318), + READY: __webpack_require__(319), + RESUME: __webpack_require__(320), + STEP: __webpack_require__(321), + VISIBLE: __webpack_require__(322) }; /***/ }), -/* 324 */ +/* 307 */ /***/ (function(module, exports) { /** @@ -43271,7 +42022,7 @@ module.exports = 'blur'; /***/ }), -/* 325 */ +/* 308 */ /***/ (function(module, exports) { /** @@ -43293,7 +42044,7 @@ module.exports = 'boot'; /***/ }), -/* 326 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -43316,7 +42067,7 @@ module.exports = 'contextlost'; /***/ }), -/* 327 */ +/* 310 */ /***/ (function(module, exports) { /** @@ -43339,7 +42090,7 @@ module.exports = 'contextrestored'; /***/ }), -/* 328 */ +/* 311 */ /***/ (function(module, exports) { /** @@ -43362,7 +42113,7 @@ module.exports = 'destroy'; /***/ }), -/* 329 */ +/* 312 */ /***/ (function(module, exports) { /** @@ -43384,7 +42135,7 @@ module.exports = 'focus'; /***/ }), -/* 330 */ +/* 313 */ /***/ (function(module, exports) { /** @@ -43410,7 +42161,7 @@ module.exports = 'hidden'; /***/ }), -/* 331 */ +/* 314 */ /***/ (function(module, exports) { /** @@ -43431,7 +42182,7 @@ module.exports = 'pause'; /***/ }), -/* 332 */ +/* 315 */ /***/ (function(module, exports) { /** @@ -43457,7 +42208,7 @@ module.exports = 'postrender'; /***/ }), -/* 333 */ +/* 316 */ /***/ (function(module, exports) { /** @@ -43482,7 +42233,7 @@ module.exports = 'poststep'; /***/ }), -/* 334 */ +/* 317 */ /***/ (function(module, exports) { /** @@ -43507,7 +42258,7 @@ module.exports = 'prerender'; /***/ }), -/* 335 */ +/* 318 */ /***/ (function(module, exports) { /** @@ -43532,7 +42283,7 @@ module.exports = 'prestep'; /***/ }), -/* 336 */ +/* 319 */ /***/ (function(module, exports) { /** @@ -43554,7 +42305,7 @@ module.exports = 'ready'; /***/ }), -/* 337 */ +/* 320 */ /***/ (function(module, exports) { /** @@ -43575,7 +42326,7 @@ module.exports = 'resume'; /***/ }), -/* 338 */ +/* 321 */ /***/ (function(module, exports) { /** @@ -43600,7 +42351,7 @@ module.exports = 'step'; /***/ }), -/* 339 */ +/* 322 */ /***/ (function(module, exports) { /** @@ -43624,7 +42375,7 @@ module.exports = 'visible'; /***/ }), -/* 340 */ +/* 323 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43714,7 +42465,7 @@ var GeometryMask = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. - * + * * @return {this} This Geometry Mask */ setShape: function (graphicsGeometry) @@ -43732,7 +42483,7 @@ var GeometryMask = new Class({ * @since 3.17.0 * * @param {boolean} [value=true] - Invert the alpha of this mask? - * + * * @return {this} This Geometry Mask */ setInvertAlpha: function (value) @@ -43811,7 +42562,7 @@ var GeometryMask = new Class({ } // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + geometryMask.renderWebGL(renderer, geometryMask, camera); renderer.flush(); @@ -43855,32 +42606,32 @@ var GeometryMask = new Class({ renderer.maskCount--; + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + if (renderer.maskStack.length === 0) { // If this is the only mask in the stack, flush and disable - renderer.flush(); - - renderer.currentMask.mask = null; + current.mask = null; gl.disable(gl.STENCIL_TEST); } else { - // Force flush before disabling stencil test - renderer.flush(); - var prev = renderer.maskStack[renderer.maskStack.length - 1]; prev.mask.applyStencil(renderer, prev.camera, false); if (renderer.currentCameraMask.mask !== prev.mask) { - renderer.currentMask.mask = prev.mask; - renderer.currentMask.camera = prev.camera; + current.mask = prev.mask; + current.camera = prev.camera; } else { - renderer.currentMask.mask = null; + current.mask = null; } } }, @@ -43901,7 +42652,7 @@ var GeometryMask = new Class({ renderer.currentContext.save(); - geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); renderer.currentContext.clip(); }, @@ -43939,7 +42690,7 @@ module.exports = GeometryMask; /***/ }), -/* 341 */ +/* 324 */ /***/ (function(module, exports) { /** @@ -44142,7 +42893,7 @@ module.exports = Origin; /***/ }), -/* 342 */ +/* 325 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -44151,11 +42902,11 @@ module.exports = Origin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var DegToRad = __webpack_require__(18); -var GetBoolean = __webpack_require__(343); -var GetValue = __webpack_require__(7); -var TWEEN_CONST = __webpack_require__(344); -var Vector2 = __webpack_require__(1); +var DegToRad = __webpack_require__(19); +var GetBoolean = __webpack_require__(326); +var GetValue = __webpack_require__(8); +var TWEEN_CONST = __webpack_require__(327); +var Vector2 = __webpack_require__(2); /** * Provides methods used for managing a Game Object following a Path. @@ -44569,7 +43320,7 @@ module.exports = PathFollower; /***/ }), -/* 343 */ +/* 326 */ /***/ (function(module, exports) { /** @@ -44610,7 +43361,7 @@ module.exports = GetBoolean; /***/ }), -/* 344 */ +/* 327 */ /***/ (function(module, exports) { /** @@ -44782,8 +43533,8 @@ module.exports = TWEEN_CONST; /***/ }), -/* 345 */ -/***/ (function(module, exports) { +/* 328 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -44791,6 +43542,8 @@ module.exports = TWEEN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var PIPELINE_CONST = __webpack_require__(329); + /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. * @@ -44832,19 +43585,20 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} [pipelineName=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (pipelineName) + initPipeline: function (name) { - if (pipelineName === undefined) { pipelineName = 'MultiPipeline'; } + if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.defaultPipeline = renderer.getPipeline(pipelineName); + this.defaultPipeline = pipelines.get(name); this.pipeline = this.defaultPipeline; return true; @@ -44860,17 +43614,18 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} pipelineName - The name of the pipeline to set on this Game Object. + * @param {string} name - The name of the pipeline to set on this Game Object. * * @return {this} This Game Object instance. */ - setPipeline: function (pipelineName) + setPipeline: function (name) { var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.pipeline = renderer.getPipeline(pipelineName); + this.pipeline = pipelines.get(name); } return this; @@ -44912,7 +43667,74 @@ module.exports = Pipeline; /***/ }), -/* 346 */ +/* 329 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PIPELINE_CONST = { + + /** + * The Bitmap Mask Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', + + /** + * The Light 2D Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + LIGHT_PIPELINE: 'Light2D', + + /** + * The Single Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + SINGLE_PIPELINE: 'SinglePipeline', + + /** + * The Multi Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + MULTI_PIPELINE: 'MultiPipeline', + + /** + * The Rope Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + ROPE_PIPELINE: 'RopePipeline' + +}; + +module.exports = PIPELINE_CONST; + + +/***/ }), +/* 330 */ /***/ (function(module, exports) { /** @@ -45099,7 +43921,7 @@ module.exports = Size; /***/ }), -/* 347 */ +/* 331 */ /***/ (function(module, exports) { /** @@ -45229,7 +44051,7 @@ module.exports = Texture; /***/ }), -/* 348 */ +/* 332 */ /***/ (function(module, exports) { /** @@ -45437,8 +44259,8 @@ module.exports = TextureCrop; /***/ }), -/* 349 */ -/***/ (function(module, exports, __webpack_require__) { +/* 333 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -45446,8 +44268,6 @@ module.exports = TextureCrop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColorFromValue = __webpack_require__(350); - /** * Provides methods used for setting the tint of a Game Object. * Should be applied as a mixin and not used directly. @@ -45460,62 +44280,58 @@ var GetColorFromValue = __webpack_require__(350); var Tint = { /** - * Private internal value. Holds the top-left tint value. + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTL + * @name Phaser.GameObjects.Components.Tint#tintTopLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTL: 16777215, + tintTopLeft: 0xffffff, /** - * Private internal value. Holds the top-right tint value. + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTR + * @name Phaser.GameObjects.Components.Tint#tintTopRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTR: 16777215, + tintTopRight: 0xffffff, /** - * Private internal value. Holds the bottom-left tint value. + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBL + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBL: 16777215, + tintBottomLeft: 0xffffff, /** - * Private internal value. Holds the bottom-right tint value. + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBR + * @name Phaser.GameObjects.Components.Tint#tintBottomRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBR: 16777215, + tintBottomRight: 0xffffff, /** - * Private internal value. Holds if the Game Object is tinted or not. + * The tint fill mode. * - * @name Phaser.GameObjects.Components.Tint#_isTinted - * @type {boolean} - * @private - * @default false - * @since 3.11.0 - */ - _isTinted: false, - - /** - * Fill or additive? + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Components.Tint#tintFill * @type {boolean} @@ -45540,8 +44356,6 @@ var Tint = { { this.setTint(0xffffff); - this._isTinted = false; - return this; }, @@ -45583,12 +44397,10 @@ var Tint = { bottomRight = topLeft; } - this._tintTL = GetColorFromValue(topLeft); - this._tintTR = GetColorFromValue(topRight); - this._tintBL = GetColorFromValue(bottomLeft); - this._tintBR = GetColorFromValue(bottomRight); - - this._isTinted = true; + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; this.tintFill = false; @@ -45632,102 +44444,6 @@ var Tint = { return this; }, - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopLeft: { - - get: function () - { - return this._tintTL; - }, - - set: function (value) - { - this._tintTL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopRight: { - - get: function () - { - return this._tintTR; - }, - - set: function (value) - { - this._tintTR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomLeft: { - - get: function () - { - return this._tintBL; - }, - - set: function (value) - { - this._tintBL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomRight: { - - get: function () - { - return this._tintBR; - }, - - set: function (value) - { - this._tintBR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. @@ -45746,7 +44462,10 @@ var Tint = { }, /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. * * @name Phaser.GameObjects.Components.Tint#isTinted * @type {boolean} @@ -45758,7 +44477,15 @@ var Tint = { get: function () { - return this._isTinted; + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); } } @@ -45769,36 +44496,7 @@ module.exports = Tint; /***/ }), -/* 350 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a hex color value, such as 0xff00ff (for purple), it will return a - * numeric representation of it (i.e. 16711935) for use in WebGL tinting. - * - * @function Phaser.Display.Color.GetColorFromValue - * @since 3.50.0 - * - * @param {number} red - The hex color value, such as 0xff0000. - * - * @return {number} The combined color value. - */ -var GetColorFromValue = function (value) -{ - return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); -}; - -module.exports = GetColorFromValue; - - -/***/ }), -/* 351 */ +/* 334 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45808,17 +44506,17 @@ module.exports = GetColorFromValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(4); -var renderCanvas = __webpack_require__(4); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(352); + renderWebGL = __webpack_require__(335); } if (true) { - renderCanvas = __webpack_require__(353); + renderCanvas = __webpack_require__(336); } module.exports = { @@ -45830,7 +44528,7 @@ module.exports = { /***/ }), -/* 352 */ +/* 335 */ /***/ (function(module, exports) { /** @@ -45851,11 +44549,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -45865,7 +44562,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent } var transformMatrix = container.localTransform; - + if (parentMatrix) { transformMatrix.loadIdentity(); @@ -45958,7 +44655,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix); // Restore original values @@ -45979,7 +44676,7 @@ module.exports = ContainerWebGLRenderer; /***/ }), -/* 353 */ +/* 336 */ /***/ (function(module, exports) { /** @@ -46000,11 +44697,10 @@ module.exports = ContainerWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -46069,7 +44765,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); @@ -46086,7 +44782,7 @@ module.exports = ContainerCanvasRenderer; /***/ }), -/* 354 */ +/* 337 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46095,7 +44791,7 @@ module.exports = ContainerCanvasRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(24); +var Rectangle = __webpack_require__(25); /** * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. @@ -46128,7 +44824,7 @@ module.exports = Union; /***/ }), -/* 355 */ +/* 338 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -46137,17 +44833,17 @@ module.exports = Union; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(4); -var renderCanvas = __webpack_require__(4); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(356); + renderWebGL = __webpack_require__(339); } if (true) { - renderCanvas = __webpack_require__(357); + renderCanvas = __webpack_require__(340); } module.exports = { @@ -46159,8 +44855,8 @@ module.exports = { /***/ }), -/* 356 */ -/***/ (function(module, exports, __webpack_require__) { +/* 339 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -46168,11 +44864,6 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CounterClockwise = __webpack_require__(9); -var Clamp = __webpack_require__(3); -var RadToDeg = __webpack_require__(10); -var Wrap = __webpack_require__(6); - /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -46184,11 +44875,10 @@ var Wrap = __webpack_require__(6); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var plugin = container.plugin; var sceneRenderer = plugin.sceneRenderer; @@ -46199,6 +44889,8 @@ var SpineContainerWebGLRenderer = function (renderer, container, interpolationPe if (sceneRenderer.batcher.isDrawing && renderer.finalType) { sceneRenderer.end(); + + renderer.pipelines.rebind(); } return; @@ -46219,110 +44911,67 @@ var SpineContainerWebGLRenderer = function (renderer, container, interpolationPe transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } - var alpha = container.alpha; - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - var GameObjectRenderMask = 15; - if (renderer.newType) { + // flush + clear if this is a new type + renderer.pipelines.clear(); + sceneRenderer.begin(); } + var rendererNextType = renderer.nextTypeMatch; + + // Force these to avoid batch flushing during SpineGameObject.renderWebGL + renderer.nextTypeMatch = true; + renderer.newType = false; + for (var i = 0; i < children.length; i++) { - var src = children[i]; + var child = children[i]; - var skeleton = src.skeleton; - var childAlpha = skeleton.color.a; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0); - - if (!skeleton || !willRender) + if (child.willRender(camera)) { - continue; - } + var mask = child.mask; - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); - - camMatrix.copyFrom(camera.matrix); - - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(transformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - - var viewportHeight = renderer.height; - - skeleton.x = calcMatrix.tx; - skeleton.y = viewportHeight - calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - skeleton.scaleY = calcMatrix.scaleY; - - if (src.scaleX < 0) - { - skeleton.scaleX *= -1; - - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } - - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; - - if (src.scaleX < 0) + if (mask) { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.preRenderWebGL(renderer, child, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); } - else + + child.renderWebGL(renderer, child, camera, transformMatrix, container); + + if (mask) { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.postRenderWebGL(renderer, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); } } - - if (camera.renderToTexture || renderer.currentFramebuffer !== null) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - - // Add autoUpdate option - skeleton.updateWorldTransform(); - - skeleton.color.a = Clamp(childAlpha * alpha, 0, 1); - - // Draw the current skeleton - sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); - - // Restore alpha - skeleton.color.a = childAlpha; } - if (!renderer.nextTypeMatch) + renderer.nextTypeMatch = rendererNextType; + + if (!rendererNextType) { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch. + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch sceneRenderer.end(); - if (!renderer.finalType) - { - renderer.rebindPipeline(renderer.pipelines.MultiPipeline); - } + // And rebind the previous pipeline + renderer.pipelines.rebind(); } }; @@ -46330,7 +44979,7 @@ module.exports = SpineContainerWebGLRenderer; /***/ }), -/* 357 */ +/* 340 */ /***/ (function(module, exports) { /** @@ -46350,11 +44999,10 @@ module.exports = SpineContainerWebGLRenderer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -46419,7 +45067,7 @@ var SpineContainerCanvasRenderer = function (renderer, container, interpolationP child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); diff --git a/plugins/spine/dist/SpinePlugin.min.js b/plugins/spine/dist/SpinePlugin.min.js index 767243775..ba9e278d5 100644 --- a/plugins/spine/dist/SpinePlugin.min.js +++ b/plugins/spine/dist/SpinePlugin.min.js @@ -1 +1 @@ -window.SpinePlugin=function(i){var n={};function r(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=i,r.c=n,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=62)}([function(t,e){function s(t,e,i,n){for(var r in e)if(e.hasOwnProperty(r)){var s=(l=e,u=r,d=f=void 0,d=(c=i)?l[u]:Object.getOwnPropertyDescriptor(l,u),!c&&d.value&&"object"==typeof d.value&&(d=d.value),!(!d||!((f=d).get&&"function"==typeof f.get||f.set&&"function"==typeof f.set))&&(void 0===d.enumerable&&(d.enumerable=!0),void 0===d.configurable&&(d.configurable=!0),d));if(!1!==s){if(a=(n||t).prototype,o=r,h=void 0,(h=Object.getOwnPropertyDescriptor(a,o))&&(h.value&&"object"==typeof h.value&&(h=h.value),!1===h.configurable)){if(p.ignoreFinals)continue;throw new Error("cannot override final property '"+r+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,r,s)}else t.prototype[r]=e[r]}var a,o,h,l,u,c,f,d}function a(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;iMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(2);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e){t.exports=function(t,e,i){var n=typeof t;return t&&"number"!=n&&"string"!=n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e,i){var n=i(0),r=i(25),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){var n=i(23),r=i(56);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i=t.length)){for(var i=t.length-1,n=t[e],r=e;r=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e,i){var u=i(8),c=function(){var t,e,i,n,r,s,a=arguments[0]||{},o=1,h=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},o=2),h===o&&(a=this,--o);os[0]&&(e=1),s[8]>s[3*e+e]&&(e=2),i=o[e],n=o[i],r=Math.sqrt(s[3*e+e]-s[3*i+i]-s[3*n+n]+1),h[e]=.5*r,r=.5/r,h[i]=(s[3*i+e]+s[3*e+i])*r,h[n]=(s[3*n+e]+s[3*e+n])*r,this.x=h[0],this.y=h[1],this.z=h[2],this.w=(s[3*n+i]-s[3*i+n])*r),this}});t.exports=f},function(t,e,i){var r=i(26),s=i(45);t.exports=function(t,e){var i=void 0===t?s():r({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=i(2),r=i(51),h=i(40),s=i(29),a=i(30),l=i(1),o={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i=i||new l;var r=(n=n||this.scene.sys.cameras.main).scrollX,s=n.scrollY,a=t+r*this.scrollFactorX-r,o=e+s*this.scrollFactorY-s;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,o,i):h(a,o,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=o},function(t,e,i){var n=i(0),s=i(2),c=i(1),r=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3];return e||i?0e.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},function(t,e){t.exports=function(t){for(var e=t.length-1;0=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}function Ee(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i= 0.");if(null==e)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}function ke(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new V.Vector2,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var i=0;i>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},r.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},r);function r(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n 0: "+t);this.curves=U.Utils.newFloatArray((t-1)*M.BEZIER_SIZE)}U.CurveTimeline=s;var a,o=(ve(v,a=s),v.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},v.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+v.ROTATION]=i},v.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-v.ENTRIES]){var u=o[o.length+v.PREV_ROTATION];switch(s){case X.setup:h.rotation=h.data.rotation+u*r;break;case X.first:case X.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case X.add:h.rotation+=u*r}}else{var c=z.binarySearch(o,i,v.ENTRIES),f=o[c+v.PREV_ROTATION],d=o[c],p=this.getCurvePercent((c>>1)-1,1-(i-d)/(o[c+v.PREV_TIME]-d)),m=f+((m=o[c+v.ROTATION]-f)-360*(16384-(16384.499999999996-m/360|0)))*p;switch(s){case X.setup:h.rotation=h.data.rotation+(m-360*(16384-(16384.499999999996-m/360|0)))*r;break;case X.first:case X.replace:m+=h.data.rotation-h.rotation;case X.add:h.rotation+=(m-360*(16384-(16384.499999999996-m/360|0)))*r}}},v.ENTRIES=2,v.PREV_TIME=-2,v.PREV_ROTATION=-1,v.ROTATION=1,v);function v(t){var e=a.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t<<1),e}U.RotateTimeline=o;var h,l=(ve(p,h=s),p.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},p.prototype.setFrame=function(t,e,i,n){t*=p.ENTRIES,this.frames[t]=e,this.frames[t+p.X]=i,this.frames[t+p.Y]=n},p.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-p.ENTRIES]?(f=o[o.length+p.PREV_X],d=o[o.length+p.PREV_Y]):(f=o[(l=z.binarySearch(o,i,p.ENTRIES))+p.PREV_X],d=o[l+p.PREV_Y],u=o[l],c=this.getCurvePercent(l/p.ENTRIES-1,1-(i-u)/(o[l+p.PREV_TIME]-u)),f+=(o[l+p.X]-f)*c,d+=(o[l+p.Y]-d)*c),s){case X.setup:h.x=h.data.x+f*r,h.y=h.data.y+d*r;break;case X.first:case X.replace:h.x+=(h.data.x+f-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case X.add:h.x+=f*r,h.y+=d*r}}},p.ENTRIES=3,p.PREV_TIME=-3,p.PREV_X=-2,p.PREV_Y=-1,p.X=1,p.Y=2,p);function p(t){var e=h.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t*p.ENTRIES),e}U.TranslateTimeline=l;var u,c=(ve(x,u=l),x.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},x.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-x.ENTRIES]?(f=o[o.length+x.PREV_X]*h.data.scaleX,o[o.length+x.PREV_Y]*h.data.scaleY):(f=o[(l=z.binarySearch(o,i,x.ENTRIES))+x.PREV_X],d=o[l+x.PREV_Y],u=o[l],c=this.getCurvePercent(l/x.ENTRIES-1,1-(i-u)/(o[l+x.PREV_TIME]-u)),f=(f+(o[l+x.X]-f)*c)*h.data.scaleX,(d+(o[l+x.Y]-d)*c)*h.data.scaleY),1==r)s==X.add?(h.scaleX+=f-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=f,h.scaleY=d);else{var p=0,m=0;if(a==g.mixOut)switch(s){case X.setup:p=h.data.scaleX,m=h.data.scaleY,h.scaleX=p+(Math.abs(f)*U.MathUtils.signum(p)-p)*r,h.scaleY=m+(Math.abs(d)*U.MathUtils.signum(m)-m)*r;break;case X.first:case X.replace:p=h.scaleX,m=h.scaleY,h.scaleX=p+(Math.abs(f)*U.MathUtils.signum(p)-p)*r,h.scaleY=m+(Math.abs(d)*U.MathUtils.signum(m)-m)*r;break;case X.add:p=h.scaleX,m=h.scaleY,h.scaleX=p+(Math.abs(f)*U.MathUtils.signum(p)-h.data.scaleX)*r,h.scaleY=m+(Math.abs(d)*U.MathUtils.signum(m)-h.data.scaleY)*r}else switch(s){case X.setup:p=Math.abs(h.data.scaleX)*U.MathUtils.signum(f),m=Math.abs(h.data.scaleY)*U.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=m+(d-m)*r;break;case X.first:case X.replace:p=Math.abs(h.scaleX)*U.MathUtils.signum(f),m=Math.abs(h.scaleY)*U.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=m+(d-m)*r;break;case X.add:p=U.MathUtils.signum(f),m=U.MathUtils.signum(d),h.scaleX=Math.abs(h.scaleX)*p+(f-Math.abs(h.data.scaleX)*p)*r,h.scaleY=Math.abs(h.scaleY)*m+(d-Math.abs(h.data.scaleY)*m)*r}}}},x);function x(t){return u.call(this,t)||this}U.ScaleTimeline=c;var f,d=(ve(m,f=l),m.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},m.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-m.ENTRIES]?(f=o[o.length+m.PREV_X],d=o[o.length+m.PREV_Y]):(f=o[(l=z.binarySearch(o,i,m.ENTRIES))+m.PREV_X],d=o[l+m.PREV_Y],u=o[l],c=this.getCurvePercent(l/m.ENTRIES-1,1-(i-u)/(o[l+m.PREV_TIME]-u)),f+=(o[l+m.X]-f)*c,d+=(o[l+m.Y]-d)*c),s){case X.setup:h.shearX=h.data.shearX+f*r,h.shearY=h.data.shearY+d*r;break;case X.first:case X.replace:h.shearX+=(h.data.shearX+f-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case X.add:h.shearX+=f*r,h.shearY+=d*r}}},m);function m(t){return f.call(this,t)||this}U.ShearTimeline=d;var y,w=(ve(T,y=s),T.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},T.prototype.setFrame=function(t,e,i,n,r,s){t*=T.ENTRIES,this.frames[t]=e,this.frames[t+T.R]=i,this.frames[t+T.G]=n,this.frames[t+T.B]=r,this.frames[t+T.A]=s},T.prototype.apply=function(t,e,i,n,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(i=h[h.length-T.ENTRIES]?(m=h[(c=h.length)+T.PREV_R],g=h[c+T.PREV_G],v=h[c+T.PREV_B],M=h[c+T.PREV_A]):(m=h[(f=z.binarySearch(h,i,T.ENTRIES))+T.PREV_R],g=h[f+T.PREV_G],v=h[f+T.PREV_B],M=h[f+T.PREV_A],d=h[f],p=this.getCurvePercent(f/T.ENTRIES-1,1-(i-d)/(h[f+T.PREV_TIME]-d)),m+=(h[f+T.R]-m)*p,g+=(h[f+T.G]-g)*p,v+=(h[f+T.B]-v)*p,M+=(h[f+T.A]-M)*p),1==r?o.color.set(m,g,v,M):(l=o.color,s==X.setup&&l.setFromColor(o.data.color),l.add((m-l.r)*r,(g-l.g)*r,(v-l.b)*r,(M-l.a)*r))}}},T.ENTRIES=5,T.PREV_TIME=-5,T.PREV_R=-4,T.PREV_G=-3,T.PREV_B=-2,T.PREV_A=-1,T.R=1,T.G=2,T.B=3,T.A=4,T);function T(t){var e=y.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t*T.ENTRIES),e}U.ColorTimeline=w;var E,A=(ve(b,E=s),b.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},b.prototype.setFrame=function(t,e,i,n,r,s,a,o,h){t*=b.ENTRIES,this.frames[t]=e,this.frames[t+b.R]=i,this.frames[t+b.G]=n,this.frames[t+b.B]=r,this.frames[t+b.A]=s,this.frames[t+b.R2]=a,this.frames[t+b.G2]=o,this.frames[t+b.B2]=h},b.prototype.apply=function(t,e,i,n,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(i=h[h.length-b.ENTRIES]?(v=h[(d=h.length)+b.PREV_R],M=h[d+b.PREV_G],x=h[d+b.PREV_B],y=h[d+b.PREV_A],w=h[d+b.PREV_R2],T=h[d+b.PREV_G2],E=h[d+b.PREV_B2]):(v=h[(p=z.binarySearch(h,i,b.ENTRIES))+b.PREV_R],M=h[p+b.PREV_G],x=h[p+b.PREV_B],y=h[p+b.PREV_A],w=h[p+b.PREV_R2],T=h[p+b.PREV_G2],E=h[p+b.PREV_B2],m=h[p],g=this.getCurvePercent(p/b.ENTRIES-1,1-(i-m)/(h[p+b.PREV_TIME]-m)),v+=(h[p+b.R]-v)*g,M+=(h[p+b.G]-M)*g,x+=(h[p+b.B]-x)*g,y+=(h[p+b.A]-y)*g,w+=(h[p+b.R2]-w)*g,T+=(h[p+b.G2]-T)*g,E+=(h[p+b.B2]-E)*g),1==r?(o.color.set(v,M,x,y),o.darkColor.set(w,T,E,1)):(l=o.color,u=o.darkColor,s==X.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((v-l.r)*r,(M-l.g)*r,(x-l.b)*r,(y-l.a)*r),u.add((w-u.r)*r,(T-u.g)*r,(E-u.b)*r,0))}}},b.ENTRIES=8,b.PREV_TIME=-8,b.PREV_R=-7,b.PREV_G=-6,b.PREV_B=-5,b.PREV_A=-4,b.PREV_R2=-3,b.PREV_G2=-2,b.PREV_B2=-1,b.R=1,b.G=2,b.B=3,b.A=4,b.R2=5,b.G2=6,b.B2=7,b);function b(t){var e=E.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t*b.ENTRIES),e}U.TwoColorTimeline=A;var R=(S.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},S.prototype.getFrameCount=function(){return this.frames.length},S.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},S.prototype.apply=function(t,e,i,n,r,s,a){var o,h,l,u=t.slots[this.slotIndex];u.bone.active&&(a!=g.mixOut?i<(o=this.frames)[0]?s!=X.setup&&s!=X.first||this.setAttachment(t,u,u.data.attachmentName):(h=0,h=i>=o[o.length-1]?o.length-1:z.binarySearch(o,i,1)-1,l=this.attachmentNames[h],t.slots[this.slotIndex].setAttachment(null==l?null:t.getAttachment(this.slotIndex,l))):s==X.setup&&this.setAttachment(t,u,u.data.attachmentName))},S.prototype.setAttachment=function(t,e,i){e.attachment=null==i?null:t.getAttachment(this.slotIndex,i)},S);function S(t){this.frames=U.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}U.AttachmentTimeline=R;var I,C=null,P=(ve(_,I=s),_.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},_.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},_.prototype.apply=function(t,e,i,n,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof U.VertexAttachment&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(s=X.setup);var u=this.frameVertices,c=u[0].length,f=this.frames;if(i=f[f.length-1]){var M=u[f.length-1];if(1==r)if(s==X.add)if(null==(d=h).bones)for(var m=d.vertices,x=0;x=o[h-1])return;if(!(i=o[l];l++)n.push(this.events[l])}}},L);function L(t){this.frames=U.Utils.newFloatArray(t),this.events=new Array(t)}U.EventTimeline=F;var O=(k.prototype.getPropertyId=function(){return i.drawOrder<<24},k.prototype.getFrameCount=function(){return this.frames.length},k.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},k.prototype.apply=function(t,e,i,n,r,s,a){var o=t.drawOrder,h=t.slots;if(a!=g.mixOut){var l=this.frames;if(i=l[l.length-1]?l.length-1:z.binarySearch(l,i)-1,c=this.drawOrders[u];if(null==c)U.Utils.arrayCopy(h,0,o,0,h.length);else for(var f=0,d=c.length;f=f[f.length-V.ENTRIES]?s==X.setup?(d.mix=d.data.mix+(f[f.length+V.PREV_MIX]-d.data.mix)*r,d.softness=d.data.softness+(f[f.length+V.PREV_SOFTNESS]-d.data.softness)*r,a==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[f.length+V.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+V.PREV_COMPRESS],d.stretch=0!=f[f.length+V.PREV_STRETCH])):(d.mix+=(f[f.length+V.PREV_MIX]-d.mix)*r,d.softness+=(f[f.length+V.PREV_SOFTNESS]-d.softness)*r,a==g.mixIn&&(d.bendDirection=f[f.length+V.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+V.PREV_COMPRESS],d.stretch=0!=f[f.length+V.PREV_STRETCH])):(h=f[(o=z.binarySearch(f,i,V.ENTRIES))+V.PREV_MIX],l=f[o+V.PREV_SOFTNESS],u=f[o],c=this.getCurvePercent(o/V.ENTRIES-1,1-(i-u)/(f[o+V.PREV_TIME]-u)),s==X.setup?(d.mix=d.data.mix+(h+(f[o+V.MIX]-h)*c-d.data.mix)*r,d.softness=d.data.softness+(l+(f[o+V.SOFTNESS]-l)*c-d.data.softness)*r,a==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[o+V.PREV_BEND_DIRECTION],d.compress=0!=f[o+V.PREV_COMPRESS],d.stretch=0!=f[o+V.PREV_STRETCH])):(d.mix+=(h+(f[o+V.MIX]-h)*c-d.mix)*r,d.softness+=(l+(f[o+V.SOFTNESS]-l)*c-d.softness)*r,a==g.mixIn&&(d.bendDirection=f[o+V.PREV_BEND_DIRECTION],d.compress=0!=f[o+V.PREV_COMPRESS],d.stretch=0!=f[o+V.PREV_STRETCH])))},V.ENTRIES=6,V.PREV_TIME=-6,V.PREV_MIX=-5,V.PREV_SOFTNESS=-4,V.PREV_BEND_DIRECTION=-3,V.PREV_COMPRESS=-2,V.PREV_STRETCH=-1,V.MIX=1,V.SOFTNESS=2,V.BEND_DIRECTION=3,V.COMPRESS=4,V.STRETCH=5,V);function V(t){var e=N.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t*V.ENTRIES),e}U.IkConstraintTimeline=D;var B,Y=(ve(W,B=s),W.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},W.prototype.setFrame=function(t,e,i,n,r,s){t*=W.ENTRIES,this.frames[t]=e,this.frames[t+W.ROTATE]=i,this.frames[t+W.TRANSLATE]=n,this.frames[t+W.SCALE]=r,this.frames[t+W.SHEAR]=s},W.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(i=o[o.length-W.ENTRIES]?(p=o[(u=o.length)+W.PREV_ROTATE],m=o[u+W.PREV_TRANSLATE],g=o[u+W.PREV_SCALE],v=o[u+W.PREV_SHEAR]):(p=o[(c=z.binarySearch(o,i,W.ENTRIES))+W.PREV_ROTATE],m=o[c+W.PREV_TRANSLATE],g=o[c+W.PREV_SCALE],v=o[c+W.PREV_SHEAR],f=o[c],d=this.getCurvePercent(c/W.ENTRIES-1,1-(i-f)/(o[c+W.PREV_TIME]-f)),p+=(o[c+W.ROTATE]-p)*d,m+=(o[c+W.TRANSLATE]-m)*d,g+=(o[c+W.SCALE]-g)*d,v+=(o[c+W.SHEAR]-v)*d),s==X.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(m-l.translateMix)*r,h.scaleMix=l.scaleMix+(g-l.scaleMix)*r,h.shearMix=l.shearMix+(v-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(m-h.translateMix)*r,h.scaleMix+=(g-h.scaleMix)*r,h.shearMix+=(v-h.shearMix)*r)}},W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4,W);function W(t){var e=B.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t*W.ENTRIES),e}U.TransformConstraintTimeline=Y;var G,H=(ve(q,G=s),q.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},q.prototype.setFrame=function(t,e,i){t*=q.ENTRIES,this.frames[t]=e,this.frames[t+q.VALUE]=i},q.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=o[o.length-q.ENTRIES]?f=o[o.length+q.PREV_VALUE]:(f=o[(l=z.binarySearch(o,i,q.ENTRIES))+q.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/q.ENTRIES-1,1-(i-u)/(o[l+q.PREV_TIME]-u)),f+=(o[l+q.VALUE]-f)*c),s==X.setup?h.position=h.data.position+(f-h.data.position)*r:h.position+=(f-h.position)*r}},q.ENTRIES=2,q.PREV_TIME=-2,q.PREV_VALUE=-1,q.VALUE=1,q);function q(t){var e=G.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t*q.ENTRIES),e}U.PathConstraintPositionTimeline=H;var j,K=(ve(Q,j=H),Q.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},Q.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=o[o.length-Q.ENTRIES]?f=o[o.length+Q.PREV_VALUE]:(f=o[(l=z.binarySearch(o,i,Q.ENTRIES))+Q.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/Q.ENTRIES-1,1-(i-u)/(o[l+Q.PREV_TIME]-u)),f+=(o[l+Q.VALUE]-f)*c),s==X.setup?h.spacing=h.data.spacing+(f-h.data.spacing)*r:h.spacing+=(f-h.spacing)*r}},Q);function Q(t){return j.call(this,t)||this}U.PathConstraintSpacingTimeline=K;var Z,J=(ve($,Z=s),$.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},$.prototype.setFrame=function(t,e,i,n){t*=$.ENTRIES,this.frames[t]=e,this.frames[t+$.ROTATE]=i,this.frames[t+$.TRANSLATE]=n},$.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=o[o.length-$.ENTRIES]?(f=o[o.length+$.PREV_ROTATE],d=o[o.length+$.PREV_TRANSLATE]):(f=o[(l=z.binarySearch(o,i,$.ENTRIES))+$.PREV_ROTATE],d=o[l+$.PREV_TRANSLATE],u=o[l],c=this.getCurvePercent(l/$.ENTRIES-1,1-(i-u)/(o[l+$.PREV_TIME]-u)),f+=(o[l+$.ROTATE]-f)*c,d+=(o[l+$.TRANSLATE]-d)*c),s==X.setup?(h.rotateMix=h.data.rotateMix+(f-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(f-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}},$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2,$);function $(t){var e=Z.call(this,t)||this;return e.frames=U.Utils.newFloatArray(t*$.ENTRIES),e}U.PathConstraintMixTimeline=J}(me=me||{}),function(R){var t=(S.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},S.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,0=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},S.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,i=this.tracks,n=!1,r=0,s=i.length;r=a.trackEnd&&null==a.next&&(h=0);var l=a.animationLast,u=a.getAnimationTime(),c=a.animation.timelines.length,f=a.animation.timelines;if(0==r&&1==h||o==R.MixBlend.add)for(var d=0;d=s[s.length-1]?s.length-1:R.Animation.binarySearch(s,i)-1,this.setAttachment(e,o,t.attachmentNames[a],r)),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+S.SETUP))},S.prototype.setAttachment=function(t,e,i,n){e.attachment=null==i?null:t.getAttachment(e.data.index,i),n&&(e.attachmentState=this.unkeyedState+S.CURRENT)},S.prototype.applyRotateTimeline=function(t,e,i,n,r,s,a,o){if(o&&(s[a]=0),1!=n){var h=t,l=h.frames,u=e.bones[h.boneIndex];if(u.active){var c=0,f=0;if(i=l[l.length-R.RotateTimeline.ENTRIES]?f=u.data.rotation+l[l.length+R.RotateTimeline.PREV_ROTATION]:(p=l[(d=R.Animation.binarySearch(l,i,R.RotateTimeline.ENTRIES))+R.RotateTimeline.PREV_ROTATION],m=l[d],g=h.getCurvePercent((d>>1)-1,1-(i-m)/(l[d+R.RotateTimeline.PREV_TIME]-m)),f=l[d+R.RotateTimeline.ROTATION]-p,f=p+(f-=360*(16384-(16384.499999999996-f/360|0)))*g+u.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0)))}var v,M,x,y,w=0,T=f-c;0==(T-=360*(16384-(16384.499999999996-T/360|0)))?w=s[a]:(M=v=0,M=o?(v=0,T):(v=s[a],s[a+1]),x=0n||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:n<=e&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},S.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),((e.mixingFrom=n).mixingTo=e).mixTime=0,null!=n.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},S.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},S.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);0<=e&&this.listeners.splice(e,1)},S.prototype.clearListeners=function(){this.listeners.length=0},S.prototype.clearListenerNotifications=function(){this.queue.clear()},S.emptyAnimation=new R.Animation("",[],0),S.SUBSEQUENT=0,S.FIRST=1,S.HOLD_SUBSEQUENT=2,S.HOLD_FIRST=3,S.HOLD_MIX=4,S.SETUP=1,S.CURRENT=2,S);function S(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new R.IntSet,this.animationsChanged=!1,this.trackEntryPool=new R.Pool(function(){return new e}),this.data=t}R.AnimationState=t;var e=(i.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},i.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},i.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},i.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},i.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},i);function i(){this.mixBlend=R.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}R.TrackEntry=e;var o,n,r=(s.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},s.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},s.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},s.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},s.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;ij.MathUtils.PI?B-=j.MathUtils.PI2:B<-j.MathUtils.PI&&(B+=j.MathUtils.PI2),B*=e,N=Math.cos(B),D=Math.sin(B),R.a=N*F-D*O,R.b=N*L-D*k,R.c=D*F+N*O,R.d=D*L+N*k),R.appliedValid=!1}}}},be.prototype.computeWorldPositions=function(t,e,i,n,r){var s=this.target,a=this.position,o=this.spaces,h=j.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,f=c/6,d=be.NONE;if(!t.constantSpeed){var p=t.lengths,m=p[f-=u?1:2];if(n&&(a*=m),r)for(var g=1;g>>1^-(1&i)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,i,n){void 0===e&&(e=new Array),void 0===i&&(i=0),void 0===n&&(n=new DataView(t.buffer)),this.strings=e,this.index=i,this.buffer=n}var V=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(me=me||{}),C=me=me||{},Pe.prototype.update=function(t,e){if(null==t)throw new Error("skeleton cannot be null.");var i=this.boundingBoxes,n=this.polygons,r=this.polygonPool,s=t.slots,a=s.length;i.length=0,r.freeAll(n);for(var o=n.length=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},Pe.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||a<=t&&a<=i||o<=e&&o<=n)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(st.minX&&this.minYt.minY},Pe.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n>1,V=this.clipOutput,B=K.Utils.setArraySize(l,P+D*d),Y=0;Y<_;Y+=2){var U=V[Y],X=V[Y+1];B[P]=U,B[P+1]=X,B[P+2]=s.r,B[P+3]=s.g,B[P+4]=s.b,B[P+5]=s.a;var z=U-b,W=X-R,G=(F*z+L*W)*N,H=(k*z+O*W)*N,q=1-G-H;B[P+6]=x*G+E*H+S*q,B[P+7]=y*G+A*H+I*q,o&&(B[P+8]=a.r,B[P+9]=a.g,B[P+10]=a.b,B[P+11]=a.a),P+=d}P=u.length;var j=K.Utils.setArraySize(u,P+3*(D-2));for(D--,Y=1;Y>1;o=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},e.prototype.addSkin=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},i.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},i.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},i);function i(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var m=function(){};d.TextureAtlasPage=m;var n,g=(n=d.TextureRegion,ve(r,n),r);function r(){return null!==n&&n.apply(this,arguments)||this}d.TextureAtlasRegion=g}(me=me||{}),V=me=me||{},ke.prototype.isActive=function(){return this.active},ke.prototype.apply=function(){this.update()},ke.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},ke.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0V.MathUtils.PI?A-=V.MathUtils.PI2:A<-V.MathUtils.PI&&(A+=V.MathUtils.PI2),A*=t,v=Math.cos(A),M=Math.sin(A),R.a=v*m-M*g,R.b=v*w-M*T,R.c=M*m+v*g,R.d=M*w+v*T,S=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),R.worldX+=(x.x-R.worldX)*e,R.worldY+=(x.y-R.worldY)*e,S=!0),0V.MathUtils.PI?A-=V.MathUtils.PI2:A<-V.MathUtils.PI&&(A+=V.MathUtils.PI2),A=E+(A+c)*n,b=Math.sqrt(w*w+T*T),R.b=Math.cos(A)*b,R.d=Math.sin(A)*b,S=!0),S&&(R.appliedValid=!1)}},ke.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0V.MathUtils.PI?y-=V.MathUtils.PI2:y<-V.MathUtils.PI&&(y+=V.MathUtils.PI2),y*=t,v=Math.cos(y),M=Math.sin(y),A.a=v*m-M*g,A.b=v*w-M*T,A.c=M*m+v*g,A.d=M*w+v*T,b=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),A.worldX+=x.x*e,A.worldY+=x.y*e,b=!0),0V.MathUtils.PI?y-=V.MathUtils.PI2:y<-V.MathUtils.PI&&(y+=V.MathUtils.PI2),w=A.b,T=A.d,y=Math.atan2(T,w)+(y-V.MathUtils.PI/2+c)*n,E=Math.sqrt(w*w+T*T),A.b=Math.cos(y)*E,A.d=Math.sin(y)*E,b=!0),b&&(A.appliedValid=!1)}},ke.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a>1,n=this.indicesArray,r=n.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},r.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},r.WHITE=new r(1,1,1,1),r.RED=new r(1,0,0,1),r.GREEN=new r(0,1,0,1),r.BLUE=new r(0,0,1,1),r.MAGENTA=new r(1,0,1,1),r);function r(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}t.Color=n;var s=(a.clamp=function(t,e,i){return t=e?t:g.setArraySize(t,e,i)},g.newArray=function(t,e){for(var i=new Array(t),n=0;nthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},R.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},R.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;fthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,0this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,a=0;a 0.");null===r&&(r=this.color);var a=2*te.MathUtils.PI/s,o=Math.cos(a),h=Math.sin(a),l=n,u=0;if(t){for(this.check(ie.Filled,3*s+3),s--,f=0;f>1))-2],w=f[p-1],m=0,g=p;m>1,f.numFloats=f.numVertices*T,f.numFloats>f.vertices.length&&(f.vertices=this.vertices=he.Utils.newFloatArray(f.numFloats)),S.computeWorldVertices(E,0,S.worldVerticesLength,f.vertices,0,T),p=S.triangles,b=S.region.renderObject.texture,d=S.uvs,g=S.color}if(null!=b){var I=E.color,C=this.tempColor;C.r=v.r*I.r*g.r,C.g=v.g*I.g*g.g,C.b=v.b*I.b*g.b,C.a=v.a*I.a*g.a,s&&(C.r*=C.a,C.g*=C.a,C.b*=C.a);var P=this.tempColor2;null==E.darkColor?P.set(0,0,0,1):(s?(P.r=E.darkColor.r*C.a,P.g=E.darkColor.g*C.a,P.b=E.darkColor.b*C.a):P.setFromColor(E.darkColor),P.a=s?1:0);var _=E.data.blendMode;if(_!=o&&(o=_,t.setBlendMode(le.WebGLBlendModeConverter.getSourceGLBlendMode(o,s),le.WebGLBlendModeConverter.getDestGLBlendMode(o))),r.isClipping()){r.clipTriangles(f.vertices,f.numFloats,p,p.length,d,C,P,a);var F=new Float32Array(r.clippedVertices),L=r.clippedTriangles;if(null!=this.vertexEffect){var O=this.vertexEffect,k=F;if(a)for(var N=0,D=F.length;N>16&255)/255,r=(t>>8&255)/255,s=(255&t)/255,a=16777215>>24)/255:null,o=this.skeleton;return!e||(i=this.findSlot(e))&&(o=i),o.color.r=n,o.color.g=r,o.color.b=s,null!==a&&(o.color.a=a),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(1+(r-s)).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,r=t.indexOf(e);return-1!==r&&rt.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){var l=i(5);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),l(t,e,i)){var s=i-e,a=t.splice(e,s);if(n)for(var o=0;o=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),e},updateFrame:function(t){var e,i=this.setCurrentFrame(t);this.isPlaying&&(t.setAlpha&&(i.alpha=t.alpha),e=this.currentAnim,i.emit(s.SPRITE_ANIMATION_KEY_UPDATE+e.key,e,t,i),i.emit(s.SPRITE_ANIMATION_UPDATE,e,t,i),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this))},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(s.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null}});t.exports=a},function(t,e,i){var n=i(3),r=i(0),s=i(55),a=i(59),o=i(57),m=i(309),g=i(7),h=new r({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,g(i,"frames",[]),g(i,"defaultTextureKey",null)),this.frameRate=g(i,"frameRate",null),this.duration=g(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=g(i,"skipMissedFrames",!0),this.delay=g(i,"delay",0),this.repeat=g(i,"repeat",0),this.repeatDelay=g(i,"repeatDelay",0),this.yoyo=g(i,"yoyo",!1),this.showOnStart=g(i,"showOnStart",!1),this.hideOnComplete=g(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(a.PAUSE_ALL,this.pause,this),this.manager.on(a.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i,n,r=this.getFrames(this.manager.textureManager,e);return 0=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),o(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):0=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){var a=i(60),o=i(61);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){var n=i(12);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var f=i(318),d=i(12);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0>16)+(65280&t)+((255&t)<<16)}},function(t,e,i){var n=i(4),r=i(4),n=i(352),r=i(353);t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n,r){var s=e.list;if(0!==s.length){var a=e.localTransform;r?(a.loadIdentity(),a.multiply(r),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=s,f=s.length,d=0;dMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return 0=t.length)){for(var i=t.length-1,n=t[e],r=e;r=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e,i){var u=i(6),c=function(){var t,e,i,n,r,s,o=arguments[0]||{},a=1,h=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[1]||{},a=2),h===a&&(o=this,--a);as[0]&&(e=1),s[8]>s[3*e+e]&&(e=2),i=a[e],n=a[i],r=Math.sqrt(s[3*e+e]-s[3*i+i]-s[3*n+n]+1),h[e]=.5*r,r=.5/r,h[i]=(s[3*i+e]+s[3*e+i])*r,h[n]=(s[3*n+e]+s[3*e+n])*r,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(s[3*n+i]-s[3*i+n])*r),this.onChangeCallback(this),this}});t.exports=d},function(t,e,i){var r=i(27),s=i(45);t.exports=function(t,e){var i=void 0===t?s():r({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=i(3),r=i(23),h=i(41),s=i(30),o=i(31),l=i(2),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i=i||new l;var r=(n=n||this.scene.sys.cameras.main).scrollX,s=n.scrollY,o=t+r*this.scrollFactorX-r,a=e+s*this.scrollFactorY-s;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,a,i):h(o,a,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=a},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(0),r=i(53),s=i(219),o=i(226),a=i(54),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),(t=e).parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){var e;void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy&&(this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this),e=this.scene.sys,t||e.displayList.remove(this),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners())}});h.RENDER_MASK=15,t.exports=h},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){t.exports={ADDED_TO_SCENE:i(227),DESTROY:i(228),REMOVED_FROM_SCENE:i(229),VIDEO_COMPLETE:i(230),VIDEO_CREATED:i(231),VIDEO_ERROR:i(232),VIDEO_LOOP:i(233),VIDEO_PLAY:i(234),VIDEO_SEEKED:i(235),VIDEO_SEEKING:i(236),VIDEO_STOP:i(237),VIDEO_TIMEOUT:i(238),VIDEO_UNLOCKED:i(239)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}function Ee(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i= 0.");if(null==e)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}function Fe(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new N.Vector2,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var i=0;i>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},r.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},r);function r(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n 0: "+t);this.curves=B.Utils.newFloatArray((t-1)*M.BEZIER_SIZE)}B.CurveTimeline=s;var o,a=(me(m,o=s),m.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},m.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+m.ROTATION]=i},m.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-m.ENTRIES]){var u=a[a.length+m.PREV_ROTATION];switch(s){case U.setup:h.rotation=h.data.rotation+u*r;break;case U.first:case U.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case U.add:h.rotation+=u*r}}else{var c=z.binarySearch(a,i,m.ENTRIES),f=a[c+m.PREV_ROTATION],d=a[c],p=this.getCurvePercent((c>>1)-1,1-(i-d)/(a[c+m.PREV_TIME]-d)),g=f+((g=a[c+m.ROTATION]-f)-360*(16384-(16384.499999999996-g/360|0)))*p;switch(s){case U.setup:h.rotation=h.data.rotation+(g-360*(16384-(16384.499999999996-g/360|0)))*r;break;case U.first:case U.replace:g+=h.data.rotation-h.rotation;case U.add:h.rotation+=(g-360*(16384-(16384.499999999996-g/360|0)))*r}}},m.ENTRIES=2,m.PREV_TIME=-2,m.PREV_ROTATION=-1,m.ROTATION=1,m);function m(t){var e=o.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t<<1),e}B.RotateTimeline=a;var h,l=(me(p,h=s),p.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},p.prototype.setFrame=function(t,e,i,n){t*=p.ENTRIES,this.frames[t]=e,this.frames[t+p.X]=i,this.frames[t+p.Y]=n},p.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-p.ENTRIES]?(f=a[a.length+p.PREV_X],d=a[a.length+p.PREV_Y]):(f=a[(l=z.binarySearch(a,i,p.ENTRIES))+p.PREV_X],d=a[l+p.PREV_Y],u=a[l],c=this.getCurvePercent(l/p.ENTRIES-1,1-(i-u)/(a[l+p.PREV_TIME]-u)),f+=(a[l+p.X]-f)*c,d+=(a[l+p.Y]-d)*c),s){case U.setup:h.x=h.data.x+f*r,h.y=h.data.y+d*r;break;case U.first:case U.replace:h.x+=(h.data.x+f-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case U.add:h.x+=f*r,h.y+=d*r}}},p.ENTRIES=3,p.PREV_TIME=-3,p.PREV_X=-2,p.PREV_Y=-1,p.X=1,p.Y=2,p);function p(t){var e=h.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*p.ENTRIES),e}B.TranslateTimeline=l;var u,c=(me(x,u=l),x.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},x.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-x.ENTRIES]?(f=a[a.length+x.PREV_X]*h.data.scaleX,a[a.length+x.PREV_Y]*h.data.scaleY):(f=a[(l=z.binarySearch(a,i,x.ENTRIES))+x.PREV_X],d=a[l+x.PREV_Y],u=a[l],c=this.getCurvePercent(l/x.ENTRIES-1,1-(i-u)/(a[l+x.PREV_TIME]-u)),f=(f+(a[l+x.X]-f)*c)*h.data.scaleX,(d+(a[l+x.Y]-d)*c)*h.data.scaleY),1==r)s==U.add?(h.scaleX+=f-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=f,h.scaleY=d);else{var p=0,g=0;if(o==v.mixOut)switch(s){case U.setup:p=h.data.scaleX,g=h.data.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-p)*r,h.scaleY=g+(Math.abs(d)*B.MathUtils.signum(g)-g)*r;break;case U.first:case U.replace:p=h.scaleX,g=h.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-p)*r,h.scaleY=g+(Math.abs(d)*B.MathUtils.signum(g)-g)*r;break;case U.add:p=h.scaleX,g=h.scaleY,h.scaleX=p+(Math.abs(f)*B.MathUtils.signum(p)-h.data.scaleX)*r,h.scaleY=g+(Math.abs(d)*B.MathUtils.signum(g)-h.data.scaleY)*r}else switch(s){case U.setup:p=Math.abs(h.data.scaleX)*B.MathUtils.signum(f),g=Math.abs(h.data.scaleY)*B.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=g+(d-g)*r;break;case U.first:case U.replace:p=Math.abs(h.scaleX)*B.MathUtils.signum(f),g=Math.abs(h.scaleY)*B.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=g+(d-g)*r;break;case U.add:p=B.MathUtils.signum(f),g=B.MathUtils.signum(d),h.scaleX=Math.abs(h.scaleX)*p+(f-Math.abs(h.data.scaleX)*p)*r,h.scaleY=Math.abs(h.scaleY)*g+(d-Math.abs(h.data.scaleY)*g)*r}}}},x);function x(t){return u.call(this,t)||this}B.ScaleTimeline=c;var f,d=(me(g,f=l),g.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},g.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-g.ENTRIES]?(f=a[a.length+g.PREV_X],d=a[a.length+g.PREV_Y]):(f=a[(l=z.binarySearch(a,i,g.ENTRIES))+g.PREV_X],d=a[l+g.PREV_Y],u=a[l],c=this.getCurvePercent(l/g.ENTRIES-1,1-(i-u)/(a[l+g.PREV_TIME]-u)),f+=(a[l+g.X]-f)*c,d+=(a[l+g.Y]-d)*c),s){case U.setup:h.shearX=h.data.shearX+f*r,h.shearY=h.data.shearY+d*r;break;case U.first:case U.replace:h.shearX+=(h.data.shearX+f-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case U.add:h.shearX+=f*r,h.shearY+=d*r}}},g);function g(t){return f.call(this,t)||this}B.ShearTimeline=d;var y,w=(me(T,y=s),T.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},T.prototype.setFrame=function(t,e,i,n,r,s){t*=T.ENTRIES,this.frames[t]=e,this.frames[t+T.R]=i,this.frames[t+T.G]=n,this.frames[t+T.B]=r,this.frames[t+T.A]=s},T.prototype.apply=function(t,e,i,n,r,s,o){var a=t.slots[this.slotIndex];if(a.bone.active){var h=this.frames;if(i=h[h.length-T.ENTRIES]?(g=h[(c=h.length)+T.PREV_R],v=h[c+T.PREV_G],m=h[c+T.PREV_B],M=h[c+T.PREV_A]):(g=h[(f=z.binarySearch(h,i,T.ENTRIES))+T.PREV_R],v=h[f+T.PREV_G],m=h[f+T.PREV_B],M=h[f+T.PREV_A],d=h[f],p=this.getCurvePercent(f/T.ENTRIES-1,1-(i-d)/(h[f+T.PREV_TIME]-d)),g+=(h[f+T.R]-g)*p,v+=(h[f+T.G]-v)*p,m+=(h[f+T.B]-m)*p,M+=(h[f+T.A]-M)*p),1==r?a.color.set(g,v,m,M):(l=a.color,s==U.setup&&l.setFromColor(a.data.color),l.add((g-l.r)*r,(v-l.g)*r,(m-l.b)*r,(M-l.a)*r))}}},T.ENTRIES=5,T.PREV_TIME=-5,T.PREV_R=-4,T.PREV_G=-3,T.PREV_B=-2,T.PREV_A=-1,T.R=1,T.G=2,T.B=3,T.A=4,T);function T(t){var e=y.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*T.ENTRIES),e}B.ColorTimeline=w;var E,b=(me(A,E=s),A.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},A.prototype.setFrame=function(t,e,i,n,r,s,o,a,h){t*=A.ENTRIES,this.frames[t]=e,this.frames[t+A.R]=i,this.frames[t+A.G]=n,this.frames[t+A.B]=r,this.frames[t+A.A]=s,this.frames[t+A.R2]=o,this.frames[t+A.G2]=a,this.frames[t+A.B2]=h},A.prototype.apply=function(t,e,i,n,r,s,o){var a=t.slots[this.slotIndex];if(a.bone.active){var h=this.frames;if(i=h[h.length-A.ENTRIES]?(m=h[(d=h.length)+A.PREV_R],M=h[d+A.PREV_G],x=h[d+A.PREV_B],y=h[d+A.PREV_A],w=h[d+A.PREV_R2],T=h[d+A.PREV_G2],E=h[d+A.PREV_B2]):(m=h[(p=z.binarySearch(h,i,A.ENTRIES))+A.PREV_R],M=h[p+A.PREV_G],x=h[p+A.PREV_B],y=h[p+A.PREV_A],w=h[p+A.PREV_R2],T=h[p+A.PREV_G2],E=h[p+A.PREV_B2],g=h[p],v=this.getCurvePercent(p/A.ENTRIES-1,1-(i-g)/(h[p+A.PREV_TIME]-g)),m+=(h[p+A.R]-m)*v,M+=(h[p+A.G]-M)*v,x+=(h[p+A.B]-x)*v,y+=(h[p+A.A]-y)*v,w+=(h[p+A.R2]-w)*v,T+=(h[p+A.G2]-T)*v,E+=(h[p+A.B2]-E)*v),1==r?(a.color.set(m,M,x,y),a.darkColor.set(w,T,E,1)):(l=a.color,u=a.darkColor,s==U.setup&&(l.setFromColor(a.data.color),u.setFromColor(a.data.darkColor)),l.add((m-l.r)*r,(M-l.g)*r,(x-l.b)*r,(y-l.a)*r),u.add((w-u.r)*r,(T-u.g)*r,(E-u.b)*r,0))}}},A.ENTRIES=8,A.PREV_TIME=-8,A.PREV_R=-7,A.PREV_G=-6,A.PREV_B=-5,A.PREV_A=-4,A.PREV_R2=-3,A.PREV_G2=-2,A.PREV_B2=-1,A.R=1,A.G=2,A.B=3,A.A=4,A.R2=5,A.G2=6,A.B2=7,A);function A(t){var e=E.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*A.ENTRIES),e}B.TwoColorTimeline=b;var R=(S.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},S.prototype.getFrameCount=function(){return this.frames.length},S.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},S.prototype.apply=function(t,e,i,n,r,s,o){var a,h,l,u=t.slots[this.slotIndex];u.bone.active&&(o!=v.mixOut?i<(a=this.frames)[0]?s!=U.setup&&s!=U.first||this.setAttachment(t,u,u.data.attachmentName):(h=0,h=i>=a[a.length-1]?a.length-1:z.binarySearch(a,i,1)-1,l=this.attachmentNames[h],t.slots[this.slotIndex].setAttachment(null==l?null:t.getAttachment(this.slotIndex,l))):s==U.setup&&this.setAttachment(t,u,u.data.attachmentName))},S.prototype.setAttachment=function(t,e,i){e.attachment=null==i?null:t.getAttachment(this.slotIndex,i)},S);function S(t){this.frames=B.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}B.AttachmentTimeline=R;var C,I=null,P=(me(_,C=s),_.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},_.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},_.prototype.apply=function(t,e,i,n,r,s,o){var a=t.slots[this.slotIndex];if(a.bone.active){var h=a.getAttachment();if(h instanceof B.VertexAttachment&&h.deformAttachment==this.attachment){var l=a.deform;0==l.length&&(s=U.setup);var u=this.frameVertices,c=u[0].length,f=this.frames;if(i=f[f.length-1]){var M=u[f.length-1];if(1==r)if(s==U.add)if(null==(d=h).bones)for(var g=d.vertices,x=0;x=a[h-1])return;if(!(i=a[l];l++)n.push(this.events[l])}}},k);function k(t){this.frames=B.Utils.newFloatArray(t),this.events=new Array(t)}B.EventTimeline=L;var O=(F.prototype.getPropertyId=function(){return i.drawOrder<<24},F.prototype.getFrameCount=function(){return this.frames.length},F.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},F.prototype.apply=function(t,e,i,n,r,s,o){var a=t.drawOrder,h=t.slots;if(o!=v.mixOut){var l=this.frames;if(i=l[l.length-1]?l.length-1:z.binarySearch(l,i)-1,c=this.drawOrders[u];if(null==c)B.Utils.arrayCopy(h,0,a,0,h.length);else for(var f=0,d=c.length;f=f[f.length-N.ENTRIES]?s==U.setup?(d.mix=d.data.mix+(f[f.length+N.PREV_MIX]-d.data.mix)*r,d.softness=d.data.softness+(f[f.length+N.PREV_SOFTNESS]-d.data.softness)*r,o==v.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[f.length+N.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+N.PREV_COMPRESS],d.stretch=0!=f[f.length+N.PREV_STRETCH])):(d.mix+=(f[f.length+N.PREV_MIX]-d.mix)*r,d.softness+=(f[f.length+N.PREV_SOFTNESS]-d.softness)*r,o==v.mixIn&&(d.bendDirection=f[f.length+N.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+N.PREV_COMPRESS],d.stretch=0!=f[f.length+N.PREV_STRETCH])):(h=f[(a=z.binarySearch(f,i,N.ENTRIES))+N.PREV_MIX],l=f[a+N.PREV_SOFTNESS],u=f[a],c=this.getCurvePercent(a/N.ENTRIES-1,1-(i-u)/(f[a+N.PREV_TIME]-u)),s==U.setup?(d.mix=d.data.mix+(h+(f[a+N.MIX]-h)*c-d.data.mix)*r,d.softness=d.data.softness+(l+(f[a+N.SOFTNESS]-l)*c-d.data.softness)*r,o==v.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[a+N.PREV_BEND_DIRECTION],d.compress=0!=f[a+N.PREV_COMPRESS],d.stretch=0!=f[a+N.PREV_STRETCH])):(d.mix+=(h+(f[a+N.MIX]-h)*c-d.mix)*r,d.softness+=(l+(f[a+N.SOFTNESS]-l)*c-d.softness)*r,o==v.mixIn&&(d.bendDirection=f[a+N.PREV_BEND_DIRECTION],d.compress=0!=f[a+N.PREV_COMPRESS],d.stretch=0!=f[a+N.PREV_STRETCH])))},N.ENTRIES=6,N.PREV_TIME=-6,N.PREV_MIX=-5,N.PREV_SOFTNESS=-4,N.PREV_BEND_DIRECTION=-3,N.PREV_COMPRESS=-2,N.PREV_STRETCH=-1,N.MIX=1,N.SOFTNESS=2,N.BEND_DIRECTION=3,N.COMPRESS=4,N.STRETCH=5,N);function N(t){var e=V.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*N.ENTRIES),e}B.IkConstraintTimeline=D;var Y,X=(me(W,Y=s),W.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},W.prototype.setFrame=function(t,e,i,n,r,s){t*=W.ENTRIES,this.frames[t]=e,this.frames[t+W.ROTATE]=i,this.frames[t+W.TRANSLATE]=n,this.frames[t+W.SCALE]=r,this.frames[t+W.SHEAR]=s},W.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(i=a[a.length-W.ENTRIES]?(p=a[(u=a.length)+W.PREV_ROTATE],g=a[u+W.PREV_TRANSLATE],v=a[u+W.PREV_SCALE],m=a[u+W.PREV_SHEAR]):(p=a[(c=z.binarySearch(a,i,W.ENTRIES))+W.PREV_ROTATE],g=a[c+W.PREV_TRANSLATE],v=a[c+W.PREV_SCALE],m=a[c+W.PREV_SHEAR],f=a[c],d=this.getCurvePercent(c/W.ENTRIES-1,1-(i-f)/(a[c+W.PREV_TIME]-f)),p+=(a[c+W.ROTATE]-p)*d,g+=(a[c+W.TRANSLATE]-g)*d,v+=(a[c+W.SCALE]-v)*d,m+=(a[c+W.SHEAR]-m)*d),s==U.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(g-l.translateMix)*r,h.scaleMix=l.scaleMix+(v-l.scaleMix)*r,h.shearMix=l.shearMix+(m-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(g-h.translateMix)*r,h.scaleMix+=(v-h.scaleMix)*r,h.shearMix+=(m-h.shearMix)*r)}},W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4,W);function W(t){var e=Y.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*W.ENTRIES),e}B.TransformConstraintTimeline=X;var G,q=(me(H,G=s),H.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},H.prototype.setFrame=function(t,e,i){t*=H.ENTRIES,this.frames[t]=e,this.frames[t+H.VALUE]=i},H.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=a[a.length-H.ENTRIES]?f=a[a.length+H.PREV_VALUE]:(f=a[(l=z.binarySearch(a,i,H.ENTRIES))+H.PREV_VALUE],u=a[l],c=this.getCurvePercent(l/H.ENTRIES-1,1-(i-u)/(a[l+H.PREV_TIME]-u)),f+=(a[l+H.VALUE]-f)*c),s==U.setup?h.position=h.data.position+(f-h.data.position)*r:h.position+=(f-h.position)*r}},H.ENTRIES=2,H.PREV_TIME=-2,H.PREV_VALUE=-1,H.VALUE=1,H);function H(t){var e=G.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*H.ENTRIES),e}B.PathConstraintPositionTimeline=q;var j,Z=(me(K,j=q),K.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},K.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=a[a.length-K.ENTRIES]?f=a[a.length+K.PREV_VALUE]:(f=a[(l=z.binarySearch(a,i,K.ENTRIES))+K.PREV_VALUE],u=a[l],c=this.getCurvePercent(l/K.ENTRIES-1,1-(i-u)/(a[l+K.PREV_TIME]-u)),f+=(a[l+K.VALUE]-f)*c),s==U.setup?h.spacing=h.data.spacing+(f-h.data.spacing)*r:h.spacing+=(f-h.spacing)*r}},K);function K(t){return j.call(this,t)||this}B.PathConstraintSpacingTimeline=Z;var Q,J=(me($,Q=s),$.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},$.prototype.setFrame=function(t,e,i,n){t*=$.ENTRIES,this.frames[t]=e,this.frames[t+$.ROTATE]=i,this.frames[t+$.TRANSLATE]=n},$.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=a[a.length-$.ENTRIES]?(f=a[a.length+$.PREV_ROTATE],d=a[a.length+$.PREV_TRANSLATE]):(f=a[(l=z.binarySearch(a,i,$.ENTRIES))+$.PREV_ROTATE],d=a[l+$.PREV_TRANSLATE],u=a[l],c=this.getCurvePercent(l/$.ENTRIES-1,1-(i-u)/(a[l+$.PREV_TIME]-u)),f+=(a[l+$.ROTATE]-f)*c,d+=(a[l+$.TRANSLATE]-d)*c),s==U.setup?(h.rotateMix=h.data.rotateMix+(f-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(f-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}},$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2,$);function $(t){var e=Q.call(this,t)||this;return e.frames=B.Utils.newFloatArray(t*$.ENTRIES),e}B.PathConstraintMixTimeline=J}(ge=ge||{}),function(R){var t=(S.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},S.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,0=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},S.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,i=this.tracks,n=!1,r=0,s=i.length;r=o.trackEnd&&null==o.next&&(h=0);var l=o.animationLast,u=o.getAnimationTime(),c=o.animation.timelines.length,f=o.animation.timelines;if(0==r&&1==h||a==R.MixBlend.add)for(var d=0;d=s[s.length-1]?s.length-1:R.Animation.binarySearch(s,i)-1,this.setAttachment(e,a,t.attachmentNames[o],r)),a.attachmentState<=this.unkeyedState&&(a.attachmentState=this.unkeyedState+S.SETUP))},S.prototype.setAttachment=function(t,e,i,n){e.attachment=null==i?null:t.getAttachment(e.data.index,i),n&&(e.attachmentState=this.unkeyedState+S.CURRENT)},S.prototype.applyRotateTimeline=function(t,e,i,n,r,s,o,a){if(a&&(s[o]=0),1!=n){var h=t,l=h.frames,u=e.bones[h.boneIndex];if(u.active){var c=0,f=0;if(i=l[l.length-R.RotateTimeline.ENTRIES]?f=u.data.rotation+l[l.length+R.RotateTimeline.PREV_ROTATION]:(p=l[(d=R.Animation.binarySearch(l,i,R.RotateTimeline.ENTRIES))+R.RotateTimeline.PREV_ROTATION],g=l[d],v=h.getCurvePercent((d>>1)-1,1-(i-g)/(l[d+R.RotateTimeline.PREV_TIME]-g)),f=l[d+R.RotateTimeline.ROTATION]-p,f=p+(f-=360*(16384-(16384.499999999996-f/360|0)))*v+u.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0)))}var m,M,x,y,w=0,T=f-c;0==(T-=360*(16384-(16384.499999999996-T/360|0)))?w=s[o]:(M=m=0,M=a?(m=0,T):(m=s[o],s[o+1]),x=0n||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:n<=e&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},S.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),((e.mixingFrom=n).mixingTo=e).mixTime=0,null!=n.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},S.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},S.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);0<=e&&this.listeners.splice(e,1)},S.prototype.clearListeners=function(){this.listeners.length=0},S.prototype.clearListenerNotifications=function(){this.queue.clear()},S.emptyAnimation=new R.Animation("",[],0),S.SUBSEQUENT=0,S.FIRST=1,S.HOLD_SUBSEQUENT=2,S.HOLD_FIRST=3,S.HOLD_MIX=4,S.SETUP=1,S.CURRENT=2,S);function S(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new R.IntSet,this.animationsChanged=!1,this.trackEntryPool=new R.Pool(function(){return new e}),this.data=t}R.AnimationState=t;var e=(i.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},i.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},i.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},i.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},i.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},i);function i(){this.mixBlend=R.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}R.TrackEntry=e;var a,n,r=(s.prototype.start=function(t){this.objects.push(a.start),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.interrupt=function(t){this.objects.push(a.interrupt),this.objects.push(t)},s.prototype.end=function(t){this.objects.push(a.end),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.dispose=function(t){this.objects.push(a.dispose),this.objects.push(t)},s.prototype.complete=function(t){this.objects.push(a.complete),this.objects.push(t)},s.prototype.event=function(t,e){this.objects.push(a.event),this.objects.push(t),this.objects.push(e)},s.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;ij.MathUtils.PI?Y-=j.MathUtils.PI2:Y<-j.MathUtils.PI&&(Y+=j.MathUtils.PI2),Y*=e,V=Math.cos(Y),D=Math.sin(Y),R.a=V*L-D*O,R.b=V*k-D*F,R.c=D*L+V*O,R.d=D*k+V*F),R.appliedValid=!1}}}},Ae.prototype.computeWorldPositions=function(t,e,i,n,r){var s=this.target,o=this.position,a=this.spaces,h=j.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,f=c/6,d=Ae.NONE;if(!t.constantSpeed){var p=t.lengths,g=p[f-=u?1:2];if(n&&(o*=g),r)for(var v=1;v>>1^-(1&i)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,i,n){void 0===e&&(e=new Array),void 0===i&&(i=0),void 0===n&&(n=new DataView(t.buffer)),this.strings=e,this.index=i,this.buffer=n}var N=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(ge=ge||{}),I=ge=ge||{},Pe.prototype.update=function(t,e){if(null==t)throw new Error("skeleton cannot be null.");var i=this.boundingBoxes,n=this.polygons,r=this.polygonPool,s=t.slots,o=s.length;i.length=0,r.freeAll(n);for(var a=n.length=0;a=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},Pe.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,o=this.maxX,a=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||o<=t&&o<=i||a<=e&&a<=n)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(st.minX&&this.minYt.minY},Pe.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n>1,N=this.clipOutput,Y=Z.Utils.setArraySize(l,P+D*d),X=0;X<_;X+=2){var B=N[X],U=N[X+1];Y[P]=B,Y[P+1]=U,Y[P+2]=s.r,Y[P+3]=s.g,Y[P+4]=s.b,Y[P+5]=s.a;var z=B-A,W=U-R,G=(L*z+k*W)*V,q=(F*z+O*W)*V,H=1-G-q;Y[P+6]=x*G+E*q+S*H,Y[P+7]=y*G+b*q+C*H,a&&(Y[P+8]=o.r,Y[P+9]=o.g,Y[P+10]=o.b,Y[P+11]=o.a),P+=d}P=u.length;var j=Z.Utils.setArraySize(u,P+3*(D-2));for(D--,X=1;X>1;a=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},e.prototype.addSkin=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},i.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},i.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},i);function i(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var g=function(){};d.TextureAtlasPage=g;var n,v=(n=d.TextureRegion,me(r,n),r);function r(){return null!==n&&n.apply(this,arguments)||this}d.TextureAtlasRegion=v}(ge=ge||{}),N=ge=ge||{},Fe.prototype.isActive=function(){return this.active},Fe.prototype.apply=function(){this.update()},Fe.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},Fe.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,o=r.b,a=r.c,h=r.d,l=0N.MathUtils.PI?b-=N.MathUtils.PI2:b<-N.MathUtils.PI&&(b+=N.MathUtils.PI2),b*=t,m=Math.cos(b),M=Math.sin(b),R.a=m*g-M*v,R.b=m*w-M*T,R.c=M*g+m*v,R.d=M*w+m*T,S=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),R.worldX+=(x.x-R.worldX)*e,R.worldY+=(x.y-R.worldY)*e,S=!0),0N.MathUtils.PI?b-=N.MathUtils.PI2:b<-N.MathUtils.PI&&(b+=N.MathUtils.PI2),b=E+(b+c)*n,A=Math.sqrt(w*w+T*T),R.b=Math.cos(b)*A,R.d=Math.sin(b)*A,S=!0),S&&(R.appliedValid=!1)}},Fe.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,o=r.b,a=r.c,h=r.d,l=0N.MathUtils.PI?y-=N.MathUtils.PI2:y<-N.MathUtils.PI&&(y+=N.MathUtils.PI2),y*=t,m=Math.cos(y),M=Math.sin(y),b.a=m*g-M*v,b.b=m*w-M*T,b.c=M*g+m*v,b.d=M*w+m*T,A=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),b.worldX+=x.x*e,b.worldY+=x.y*e,A=!0),0N.MathUtils.PI?y-=N.MathUtils.PI2:y<-N.MathUtils.PI&&(y+=N.MathUtils.PI2),w=b.b,T=b.d,y=Math.atan2(T,w)+(y-N.MathUtils.PI/2+c)*n,E=Math.sqrt(w*w+T*T),b.b=Math.cos(y)*E,b.d=Math.sin(y)*E,A=!0),A&&(b.appliedValid=!1)}},Fe.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,o=0,a=s.length;o>1,n=this.indicesArray,r=n.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},r.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},r.WHITE=new r(1,1,1,1),r.RED=new r(1,0,0,1),r.GREEN=new r(0,1,0,1),r.BLUE=new r(0,0,1,1),r.MAGENTA=new r(1,0,1,1),r);function r(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}t.Color=n;var s=(o.clamp=function(t,e,i){return t=e?t:v.setArraySize(t,e,i)},v.newArray=function(t,e){for(var i=new Array(t),n=0;nthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},R.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},R.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var o=t.bone.skeleton,a=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;fthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,0this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,o=0;o 0.");null===r&&(r=this.color);var o=2*te.MathUtils.PI/s,a=Math.cos(o),h=Math.sin(o),l=n,u=0;if(t){for(this.check(ie.Filled,3*s+3),s--,f=0;f>1))-2],w=f[p-1],g=0,v=p;g>1,f.numFloats=f.numVertices*T,f.numFloats>f.vertices.length&&(f.vertices=this.vertices=he.Utils.newFloatArray(f.numFloats)),S.computeWorldVertices(E,0,S.worldVerticesLength,f.vertices,0,T),p=S.triangles,A=S.region.renderObject.texture,d=S.uvs,v=S.color}if(null!=A){var C=E.color,I=this.tempColor;I.r=m.r*C.r*v.r,I.g=m.g*C.g*v.g,I.b=m.b*C.b*v.b,I.a=m.a*C.a*v.a,s&&(I.r*=I.a,I.g*=I.a,I.b*=I.a);var P=this.tempColor2;null==E.darkColor?P.set(0,0,0,1):(s?(P.r=E.darkColor.r*I.a,P.g=E.darkColor.g*I.a,P.b=E.darkColor.b*I.a):P.setFromColor(E.darkColor),P.a=s?1:0);var _=E.data.blendMode;if(_!=a&&(a=_,t.setBlendMode(le.WebGLBlendModeConverter.getSourceGLBlendMode(a,s),le.WebGLBlendModeConverter.getDestGLBlendMode(a))),r.isClipping()){r.clipTriangles(f.vertices,f.numFloats,p,p.length,d,I,P,o);var L=new Float32Array(r.clippedVertices),k=r.clippedTriangles;if(null!=this.vertexEffect){var O=this.vertexEffect,F=L;if(o)for(var V=0,D=L.length;V>16&255)/255,r=(t>>8&255)/255,s=(255&t)/255,o=16777215>>24)/255:null,a=this.skeleton;return!e||(i=this.findSlot(e))&&(a=i),a.color.r=n,a.color.g=r,a.color.b=s,null!==o&&(a.color.a=o),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=g(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(v.COMPLETE,t)},onDispose:function(t){this.emit(v.DISPOSE,t)},onEnd:function(t){this.emit(v.END,t)},onEvent:function(t,e){this.emit(v.EVENT,t,e)},onInterrupted:function(t){this.emit(v.INTERRUPTED,t)},onStart:function(t){this.emit(v.START,t)},refresh:function(){return this.root&&(this.root.rotation=g(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(1+(r-s)).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;ee.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},function(t,e,i){var h=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var s=[];if(h(t,n,r))for(var o=n;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,r=t.indexOf(e);return-1!==r&&rt.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){var l=i(5);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),l(t,e,i)){var s=i-e,o=t.splice(e,s);if(n)for(var a=0;a=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){var o=i(59),a=i(60);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){var n=i(10);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var f=i(301),d=i(10);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0 - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a hex color value, such as 0xff00ff (for purple), it will return a - * numeric representation of it (i.e. 16711935) for use in WebGL tinting. - * - * @function Phaser.Display.Color.GetColorFromValue - * @since 3.50.0 - * - * @param {number} red - The hex color value, such as 0xff0000. - * - * @return {number} The combined color value. - */ -var GetColorFromValue = function (value) -{ - return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); -}; - -module.exports = GetColorFromValue; - - /***/ }), /***/ "../../../src/display/mask/BitmapMask.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/display/mask/BitmapMask.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/display/mask/BitmapMask.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -1887,6 +1853,7 @@ module.exports = GetColorFromValue; var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Class.js"); var GameEvents = __webpack_require__(/*! ../../core/events */ "../../../src/core/events/index.js"); +var RenderEvents = __webpack_require__(/*! ../../renderer/events */ "../../../src/renderer/events/index.js"); /** * @classdesc @@ -1905,6 +1872,9 @@ var GameEvents = __webpack_require__(/*! ../../core/events */ "../../../src/core * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -1929,7 +1899,7 @@ var BitmapMask = new Class({ function BitmapMask (scene, renderable) { - var renderer = scene.sys.game.renderer; + var renderer = scene.sys.renderer; /** * A reference to either the Canvas or WebGL Renderer that this Mask is using. @@ -1950,7 +1920,7 @@ var BitmapMask = new Class({ this.bitmapMask = renderable; /** - * The texture used for the mask's framebuffer. + * The texture used for the masks framebuffer. * * @name Phaser.Display.Masks.BitmapMask#maskTexture * @type {WebGLTexture} @@ -1997,19 +1967,11 @@ var BitmapMask = new Class({ */ this.maskFramebuffer = null; - /** - * The previous framebuffer set in the renderer before this one was enabled. - * - * @name Phaser.Display.Masks.BitmapMask#prevFramebuffer - * @type {WebGLFramebuffer} - * @since 3.17.0 - */ - this.prevFramebuffer = null; - /** * Whether to invert the masks alpha. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. * * @name Phaser.Display.Masks.BitmapMask#invertAlpha * @type {boolean} @@ -2027,36 +1989,75 @@ var BitmapMask = new Class({ */ this.isStencil = false; - if (renderer && renderer.gl) + this.createMask(); + + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + + renderer.on(RenderEvents.RESIZE, this.createMask, this); + }, + + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + * + * @method Phaser.Display.Masks.BitmapMask#createMask + * @since 3.50.0 + */ + createMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl) { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) - { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - }, this); + return; } + + if (this.mainTexture) + { + this.clearMask(); + } + + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + }, + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + * + * @method Phaser.Display.Masks.BitmapMask#clearMask + * @since 3.50.0 + */ + clearMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl || !this.mainTexture) + { + return; + } + + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; }, /** @@ -2143,22 +2144,11 @@ var BitmapMask = new Class({ */ destroy: function () { + this.clearMask(); + + this.renderer.off(RenderEvents.RESIZE, this.createMask, this); + this.bitmapMask = null; - - var renderer = this.renderer; - - if (renderer && renderer.gl) - { - renderer.deleteTexture(this.mainTexture); - renderer.deleteTexture(this.maskTexture); - renderer.deleteFramebuffer(this.mainFramebuffer); - renderer.deleteFramebuffer(this.maskFramebuffer); - } - - this.mainTexture = null; - this.maskTexture = null; - this.mainFramebuffer = null; - this.maskFramebuffer = null; this.prevFramebuffer = null; this.renderer = null; } @@ -2171,9 +2161,9 @@ module.exports = BitmapMask; /***/ }), /***/ "../../../src/display/mask/GeometryMask.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/display/mask/GeometryMask.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/display/mask/GeometryMask.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -2230,6 +2220,8 @@ var GeometryMask = new Class({ * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels * drawn to the Geometry Mask. * + * This is a WebGL only feature. + * * @name Phaser.Display.Masks.GeometryMask#invertAlpha * @type {boolean} * @since 3.16.0 @@ -2264,7 +2256,7 @@ var GeometryMask = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. - * + * * @return {this} This Geometry Mask */ setShape: function (graphicsGeometry) @@ -2276,13 +2268,16 @@ var GeometryMask = new Class({ /** * Sets the `invertAlpha` property of this Geometry Mask. + * * Inverting the alpha essentially flips the way the mask works. * + * This is a WebGL only feature. + * * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha * @since 3.17.0 * * @param {boolean} [value=true] - Invert the alpha of this mask? - * + * * @return {this} This Geometry Mask */ setInvertAlpha: function (value) @@ -2361,7 +2356,7 @@ var GeometryMask = new Class({ } // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + geometryMask.renderWebGL(renderer, geometryMask, camera); renderer.flush(); @@ -2405,32 +2400,32 @@ var GeometryMask = new Class({ renderer.maskCount--; + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + if (renderer.maskStack.length === 0) { // If this is the only mask in the stack, flush and disable - renderer.flush(); - - renderer.currentMask.mask = null; + current.mask = null; gl.disable(gl.STENCIL_TEST); } else { - // Force flush before disabling stencil test - renderer.flush(); - var prev = renderer.maskStack[renderer.maskStack.length - 1]; prev.mask.applyStencil(renderer, prev.camera, false); if (renderer.currentCameraMask.mask !== prev.mask) { - renderer.currentMask.mask = prev.mask; - renderer.currentMask.camera = prev.camera; + current.mask = prev.mask; + current.camera = prev.camera; } else { - renderer.currentMask.mask = null; + current.mask = null; } } }, @@ -2451,7 +2446,7 @@ var GeometryMask = new Class({ renderer.currentContext.save(); - geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); renderer.currentContext.clip(); }, @@ -2491,9 +2486,9 @@ module.exports = GeometryMask; /***/ }), /***/ "../../../src/gameobjects/BuildGameObject.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/BuildGameObject.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -2624,9 +2619,9 @@ module.exports = BuildGameObject; /***/ }), /***/ "../../../src/gameobjects/GameObject.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/GameObject.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/GameObject.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -2668,16 +2663,33 @@ var GameObject = new Class({ EventEmitter.call(this); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * * @name Phaser.GameObjects.GameObject#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.GameObject#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + /** * A textual representation of this Game Object, i.e. `sprite`. * Used internally by Phaser but is available for your own custom classes to populate. @@ -2699,7 +2711,7 @@ var GameObject = new Class({ * If you need to store complex data about your Game Object, look at using the Data Component instead. * * @name Phaser.GameObjects.GameObject#state - * @type {(integer|string)} + * @type {(number|string)} * @since 3.16.0 */ this.state = 0; @@ -2741,7 +2753,7 @@ var GameObject = new Class({ * Reserved for future use by plugins and the Input Manager. * * @name Phaser.GameObjects.GameObject#tabIndex - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -2765,7 +2777,7 @@ var GameObject = new Class({ * If those components are not used by your custom class then you can use this bitmask as you wish. * * @name Phaser.GameObjects.GameObject#renderFlags - * @type {integer} + * @type {number} * @default 15 * @since 3.0.0 */ @@ -2873,7 +2885,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#setState * @since 3.16.0 * - * @param {(integer|string)} value - The state of the Game Object. + * @param {(number|string)} value - The state of the Game Object. * * @return {this} This GameObject. */ @@ -3239,7 +3251,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#getIndexList * @since 3.4.0 * - * @return {integer[]} An array of display list position indexes. + * @return {number[]} An array of display list position indexes. */ getIndexList: function () { @@ -3288,13 +3300,9 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#destroy * @fires Phaser.GameObjects.Events#DESTROY * @since 3.0.0 - * - * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown? */ - destroy: function (fromScene) + destroy: function () { - if (fromScene === undefined) { fromScene = false; } - // This Game Object has already been destroyed if (!this.scene || this.ignoreDestroy) { @@ -3308,16 +3316,23 @@ var GameObject = new Class({ this.emit(Events.DESTROY, this); - var sys = this.scene.sys; + this.removeAllListeners(); - if (!fromScene) + if (this.postPipelines) { - sys.displayList.remove(this); + this.resetPostPipeline(true); + } + + if (this.displayList) + { + this.displayList.queueDepthSort(); + this.displayList.remove(this); } if (this.input) { - sys.input.clear(this); + this.scene.sys.input.clear(this); + this.input = undefined; } @@ -3331,23 +3346,16 @@ var GameObject = new Class({ if (this.body) { this.body.destroy(); - this.body = undefined; - } - // Tell the Scene to re-sort the children - if (!fromScene) - { - sys.queueDepthSort(); + this.body = undefined; } this.active = false; this.visible = false; this.scene = undefined; - + this.displayList = undefined; this.parentContainer = undefined; - - this.removeAllListeners(); } }); @@ -3355,7 +3363,7 @@ var GameObject = new Class({ /** * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. * - * @constant {integer} RENDER_MASK + * @constant {number} RENDER_MASK * @memberof Phaser.GameObjects.GameObject * @default */ @@ -3364,12 +3372,88 @@ GameObject.RENDER_MASK = 15; module.exports = GameObject; +/***/ }), + +/***/ "../../../src/gameobjects/GetCalcMatrix.js": +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/GetCalcMatrix.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TransformMatrix = __webpack_require__(/*! ./components/TransformMatrix */ "../../../src/gameobjects/components/TransformMatrix.js"); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + +var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; + +/** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * + * @function Phaser.GameObjects.GetCalcMatrix + * @memberof Phaser.GameObjects + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. + * + * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. + */ +var GetCalcMatrix = function (src, camera, parentMatrix) +{ + var camMatrix = tempMatrix1; + var spriteMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + return result; +}; + +module.exports = GetCalcMatrix; + + /***/ }), /***/ "../../../src/gameobjects/components/Alpha.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Alpha.js ***! - \**************************************************************/ +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Alpha.js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -3667,9 +3751,9 @@ module.exports = Alpha; /***/ }), /***/ "../../../src/gameobjects/components/AlphaSingle.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/AlphaSingle.js ***! - \********************************************************************/ +/*!*************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/AlphaSingle.js ***! + \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -3782,9 +3866,9 @@ module.exports = AlphaSingle; /***/ }), /***/ "../../../src/gameobjects/components/BlendMode.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/BlendMode.js ***! - \******************************************************************/ +/*!***********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/BlendMode.js ***! + \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -3810,7 +3894,7 @@ var BlendMode = { * Private internal value. Holds the current blend mode. * * @name Phaser.GameObjects.Components.BlendMode#_blendMode - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -3909,9 +3993,9 @@ module.exports = BlendMode; /***/ }), /***/ "../../../src/gameobjects/components/ComputedSize.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/ComputedSize.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -4063,9 +4147,9 @@ module.exports = ComputedSize; /***/ }), /***/ "../../../src/gameobjects/components/Crop.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Crop.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Crop.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -4193,9 +4277,9 @@ module.exports = Crop; /***/ }), /***/ "../../../src/gameobjects/components/Depth.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Depth.js ***! - \**************************************************************/ +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Depth.js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -4208,7 +4292,7 @@ module.exports = Crop; /** * Provides methods used for setting the depth of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Depth * @since 3.0.0 */ @@ -4217,9 +4301,9 @@ var Depth = { /** * Private internal value. Holds the depth of the Game Object. - * + * * @name Phaser.GameObjects.Components.Depth#_depth - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -4228,7 +4312,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -4236,7 +4320,7 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @name Phaser.GameObjects.Components.Depth#depth * @type {number} * @since 3.0.0 @@ -4250,7 +4334,11 @@ var Depth = { set: function (value) { - this.scene.sys.queueDepthSort(); + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + this._depth = value; } @@ -4258,7 +4346,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -4266,12 +4354,12 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {integer} value - The depth of this Game Object. - * + * @param {number} value - The depth of this Game Object. + * * @return {this} This Game Object instance. */ setDepth: function (value) @@ -4291,9 +4379,9 @@ module.exports = Depth; /***/ }), /***/ "../../../src/gameobjects/components/Flip.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Flip.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Flip.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -4460,9 +4548,9 @@ module.exports = Flip; /***/ }), /***/ "../../../src/gameobjects/components/GetBounds.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/GetBounds.js ***! - \******************************************************************/ +/*!***********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/GetBounds.js ***! + \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -4824,9 +4912,9 @@ module.exports = GetBounds; /***/ }), /***/ "../../../src/gameobjects/components/Mask.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Mask.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Mask.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -4864,10 +4952,10 @@ var Mask = { * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @@ -4913,6 +5001,8 @@ var Mask = { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -4923,7 +5013,7 @@ var Mask = { * * @method Phaser.GameObjects.Components.Mask#createBitmapMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. * * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. @@ -4947,12 +5037,12 @@ var Mask = { * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. @@ -4976,9 +5066,9 @@ module.exports = Mask; /***/ }), /***/ "../../../src/gameobjects/components/Origin.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Origin.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Origin.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -5184,9 +5274,9 @@ module.exports = Origin; /***/ }), /***/ "../../../src/gameobjects/components/PathFollower.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/PathFollower.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/PathFollower.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -5294,7 +5384,7 @@ var PathFollower = { * Records the direction of the follower so it can change direction. * * @name Phaser.GameObjects.PathFollower#_prevDirection - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -5616,9 +5706,9 @@ module.exports = PathFollower; /***/ }), /***/ "../../../src/gameobjects/components/Pipeline.js": -/*!*****************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Pipeline.js ***! - \*****************************************************************/ +/*!**********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Pipeline.js ***! + \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -5628,7 +5718,9 @@ module.exports = PathFollower; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var DeepCopy = __webpack_require__(/*! ../../utils/object/DeepCopy */ "../../../src/utils/object/DeepCopy.js"); var PIPELINE_CONST = __webpack_require__(/*! ../../renderer/webgl/pipelines/const */ "../../../src/renderer/webgl/pipelines/const.js"); +var SpliceOne = __webpack_require__(/*! ../../utils/array/SpliceOne */ "../../../src/utils/array/SpliceOne.js"); /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. @@ -5643,6 +5735,8 @@ var Pipeline = { /** * The initial WebGL pipeline of this Game Object. * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + * * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline * @type {Phaser.Renderer.WebGL.WebGLPipeline} * @default null @@ -5662,61 +5756,241 @@ var Pipeline = { */ pipeline: null, + /** + * Does this Game Object have any Post Pipelines set? + * + * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.50.0 + */ + hasPostPipeline: false, + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + * + * @name Phaser.GameObjects.Components.Pipeline#postPipeline + * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} + * @webglOnly + * @since 3.50.0 + */ + postPipelines: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.Pipeline#pipelineData + * @type {object} + * @webglOnly + * @since 3.50.0 + */ + pipelineData: null, + /** * Sets the initial WebGL Pipeline of this Game Object. * - * This should only be called during the instantiation of the Game Object. + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. * * @method Phaser.GameObjects.Components.Pipeline#initPipeline * @webglOnly * @since 3.0.0 * - * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (name) + initPipeline: function (pipeline) { - if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } + if (pipeline === undefined) { pipeline = PIPELINE_CONST.MULTI_PIPELINE; } - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) - { - this.defaultPipeline = pipelines.get(name); - this.pipeline = this.defaultPipeline; + this.postPipelines = []; + this.pipelineData = {}; - return true; + if (pipelines) + { + var instance = pipelines.get(pipeline); + + if (instance) + { + this.defaultPipeline = instance; + this.pipeline = instance; + + return true; + } } return false; }, /** - * Sets the active WebGL Pipeline of this Game Object. + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. * * @method Phaser.GameObjects.Components.Pipeline#setPipeline * @webglOnly * @since 3.0.0 * - * @param {string} name - The name of the pipeline to set on this Game Object. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. * * @return {this} This Game Object instance. */ - setPipeline: function (name) + setPipeline: function (pipeline, pipelineData, copyData) { - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) + if (pipelines) { - this.pipeline = pipelines.get(name); + var instance = pipelines.get(pipeline); + + if (instance) + { + this.pipeline = instance; + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } } return this; }, + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPostPipeline: function (pipelines, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + var pipelineManager = renderer.pipelines; + + if (pipelineManager) + { + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelineManager.getPostPipeline(pipelines[i], this); + + if (instance) + { + this.postPipelines.push(instance); + } + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipelineData + * @webglOnly + * @since 3.50.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPipelineData: function (key, value) + { + var data = this.pipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * + * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The first Post Pipeline matching the name, or undefined if no match. + */ + getPostPipeline: function (pipeline) + { + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((typeof pipeline === 'string' && instance.name === pipeline) || instance instanceof pipeline) + { + return instance; + } + } + }, + /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. * @@ -5724,15 +5998,96 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines? + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + * + * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. */ - resetPipeline: function () + resetPipeline: function (resetPostPipelines, resetData) { + if (resetPostPipelines === undefined) { resetPostPipelines = false; } + if (resetData === undefined) { resetData = false; } + this.pipeline = this.defaultPipeline; + if (resetPostPipelines) + { + this.postPipelines = []; + this.hasPostPipeline = false; + } + + if (resetData) + { + this.pipelineData = {}; + } + return (this.pipeline !== null); }, + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + */ + resetPostPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].destroy(); + } + + this.postPipelines = []; + this.hasPostPipeline = false; + + if (resetData) + { + this.pipelineData = {}; + } + }, + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * + * @method Phaser.GameObjects.Components.Pipeline#removePostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {this} This Game Object. + */ + removePostPipeline: function (pipeline) + { + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((typeof pipeline === 'string' && instance.name === pipeline) || instance instanceof pipeline) + { + instance.destroy(); + + SpliceOne(pipelines, i); + + return this; + } + } + + return this; + }, + /** * Gets the name of the WebGL Pipeline this Game Object is currently using. * @@ -5755,9 +6110,9 @@ module.exports = Pipeline; /***/ }), /***/ "../../../src/gameobjects/components/ScrollFactor.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/ScrollFactor.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -5867,9 +6222,9 @@ module.exports = ScrollFactor; /***/ }), /***/ "../../../src/gameobjects/components/Size.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Size.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Size.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -6059,9 +6414,9 @@ module.exports = Size; /***/ }), /***/ "../../../src/gameobjects/components/Texture.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Texture.js ***! - \****************************************************************/ +/*!*********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Texture.js ***! + \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -6120,7 +6475,7 @@ var Texture = { * @since 3.0.0 * * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -6144,7 +6499,7 @@ var Texture = { * @method Phaser.GameObjects.Components.Texture#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * @@ -6194,9 +6549,9 @@ module.exports = Texture; /***/ }), /***/ "../../../src/gameobjects/components/TextureCrop.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/TextureCrop.js ***! - \********************************************************************/ +/*!*************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/TextureCrop.js ***! + \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -6249,24 +6604,24 @@ var TextureCrop = { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. - * + * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @@ -6314,7 +6669,7 @@ var TextureCrop = { * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -6338,7 +6693,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * @@ -6391,7 +6746,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject * @private * @since 3.12.0 - * + * * @return {object} The crop object. */ resetCropObject: function () @@ -6407,11 +6762,11 @@ module.exports = TextureCrop; /***/ }), /***/ "../../../src/gameobjects/components/Tint.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Tint.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Tint.js ***! + \******************************************************************************/ /*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { /** * @author Richard Davey @@ -6419,8 +6774,6 @@ module.exports = TextureCrop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColorFromValue = __webpack_require__(/*! ../../display/color/GetColorFromValue */ "../../../src/display/color/GetColorFromValue.js"); - /** * Provides methods used for setting the tint of a Game Object. * Should be applied as a mixin and not used directly. @@ -6433,62 +6786,58 @@ var GetColorFromValue = __webpack_require__(/*! ../../display/color/GetColorFrom var Tint = { /** - * Private internal value. Holds the top-left tint value. + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTL + * @name Phaser.GameObjects.Components.Tint#tintTopLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTL: 16777215, + tintTopLeft: 0xffffff, /** - * Private internal value. Holds the top-right tint value. + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTR + * @name Phaser.GameObjects.Components.Tint#tintTopRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTR: 16777215, + tintTopRight: 0xffffff, /** - * Private internal value. Holds the bottom-left tint value. + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBL + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBL: 16777215, + tintBottomLeft: 0xffffff, /** - * Private internal value. Holds the bottom-right tint value. + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBR + * @name Phaser.GameObjects.Components.Tint#tintBottomRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBR: 16777215, + tintBottomRight: 0xffffff, /** - * Private internal value. Holds if the Game Object is tinted or not. + * The tint fill mode. * - * @name Phaser.GameObjects.Components.Tint#_isTinted - * @type {boolean} - * @private - * @default false - * @since 3.11.0 - */ - _isTinted: false, - - /** - * Fill or additive? + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Components.Tint#tintFill * @type {boolean} @@ -6513,8 +6862,6 @@ var Tint = { { this.setTint(0xffffff); - this._isTinted = false; - return this; }, @@ -6538,10 +6885,10 @@ var Tint = { * @webglOnly * @since 3.0.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -6556,12 +6903,10 @@ var Tint = { bottomRight = topLeft; } - this._tintTL = GetColorFromValue(topLeft); - this._tintTR = GetColorFromValue(topRight); - this._tintBL = GetColorFromValue(bottomLeft); - this._tintBR = GetColorFromValue(bottomRight); - - this._isTinted = true; + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; this.tintFill = false; @@ -6589,10 +6934,10 @@ var Tint = { * @webglOnly * @since 3.11.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -6605,108 +6950,12 @@ var Tint = { return this; }, - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopLeft: { - - get: function () - { - return this._tintTL; - }, - - set: function (value) - { - this._tintTL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopRight: { - - get: function () - { - return this._tintTR; - }, - - set: function (value) - { - this._tintTR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomLeft: { - - get: function () - { - return this._tintBL; - }, - - set: function (value) - { - this._tintBL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomRight: { - - get: function () - { - return this._tintBR; - }, - - set: function (value) - { - this._tintBR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. * * @name Phaser.GameObjects.Components.Tint#tint - * @type {integer} + * @type {number} * @webglOnly * @since 3.0.0 */ @@ -6719,7 +6968,10 @@ var Tint = { }, /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. * * @name Phaser.GameObjects.Components.Tint#isTinted * @type {boolean} @@ -6731,7 +6983,15 @@ var Tint = { get: function () { - return this._isTinted; + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); } } @@ -6744,9 +7004,9 @@ module.exports = Tint; /***/ }), /***/ "../../../src/gameobjects/components/ToJSON.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/ToJSON.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -6810,9 +7070,9 @@ module.exports = ToJSON; /***/ }), /***/ "../../../src/gameobjects/components/Transform.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Transform.js ***! - \******************************************************************/ +/*!***********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Transform.js ***! + \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -7024,7 +7284,7 @@ var Transform = { * If you prefer to work in radians, see the `rotation` property instead. * * @name Phaser.GameObjects.Components.Transform#angle - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -7097,6 +7357,26 @@ var Transform = { return this; }, + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -7406,9 +7686,9 @@ module.exports = Transform; /***/ }), /***/ "../../../src/gameobjects/components/TransformMatrix.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js ***! - \************************************************************************/ +/*!*****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/TransformMatrix.js ***! + \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -7692,13 +7972,13 @@ var TransformMatrix = new Class({ if (a || b) { // var r = Math.sqrt(a * a + b * b); - + return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); } else if (c || d) { // var s = Math.sqrt(c * c + d * d); - + return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); } else @@ -7841,7 +8121,7 @@ var TransformMatrix = new Class({ /** * Multiply this Matrix by the given Matrix. - * + * * If an `out` Matrix is given then the results will be stored in it. * If it is not given, this matrix will be updated in place instead. * Use an `out` Matrix if you do not wish to mutate this matrix. @@ -7887,7 +8167,7 @@ var TransformMatrix = new Class({ /** * Multiply this Matrix by the matrix given, including the offset. - * + * * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. * @@ -8121,7 +8401,7 @@ var TransformMatrix = new Class({ /** * Copy the values in this Matrix to the array given. - * + * * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. * * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray @@ -8183,9 +8463,9 @@ var TransformMatrix = new Class({ /** * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. - * + * * The result must be applied in the following order to reproduce the current matrix: - * + * * translate -> rotate -> scale * * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix @@ -8277,7 +8557,7 @@ var TransformMatrix = new Class({ /** * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of * the current matrix with its transformation applied. - * + * * Can be used to translate points from world to local space. * * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse @@ -8316,7 +8596,7 @@ var TransformMatrix = new Class({ * * @method Phaser.GameObjects.Components.TransformMatrix#getX * @since 3.12.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @@ -8333,7 +8613,7 @@ var TransformMatrix = new Class({ * * @method Phaser.GameObjects.Components.TransformMatrix#getY * @since 3.12.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @@ -8346,12 +8626,12 @@ var TransformMatrix = new Class({ /** * Returns the X component of this matrix multiplied by the given values. - * + * * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. * * @method Phaser.GameObjects.Components.TransformMatrix#getXRound * @since 3.50.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @param {boolean} [round=false] - Math.round the resulting value? @@ -8372,12 +8652,12 @@ var TransformMatrix = new Class({ /** * Returns the Y component of this matrix multiplied by the given values. - * + * * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. * * @method Phaser.GameObjects.Components.TransformMatrix#getYRound * @since 3.50.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @param {boolean} [round=false] - Math.round the resulting value? @@ -8431,9 +8711,9 @@ module.exports = TransformMatrix; /***/ }), /***/ "../../../src/gameobjects/components/Visible.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/Visible.js ***! - \****************************************************************/ +/*!*********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Visible.js ***! + \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -8525,9 +8805,9 @@ module.exports = Visible; /***/ }), /***/ "../../../src/gameobjects/components/index.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/components/index.js ***! - \**************************************************************/ +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/components/index.js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -8571,9 +8851,9 @@ module.exports = { /***/ }), /***/ "../../../src/gameobjects/container/Container.js": -/*!*****************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/container/Container.js ***! - \*****************************************************************/ +/*!**********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/container/Container.js ***! + \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -8590,7 +8870,6 @@ var Class = __webpack_require__(/*! ../../utils/Class */ "../../../src/utils/Cla var Components = __webpack_require__(/*! ../components */ "../../../src/gameobjects/components/index.js"); var Events = __webpack_require__(/*! ../events */ "../../../src/gameobjects/events/index.js"); var GameObject = __webpack_require__(/*! ../GameObject */ "../../../src/gameobjects/GameObject.js"); -var GameObjectEvents = __webpack_require__(/*! ../events */ "../../../src/gameobjects/events/index.js"); var Rectangle = __webpack_require__(/*! ../../geom/rectangle/Rectangle */ "../../../src/geom/rectangle/Rectangle.js"); var Render = __webpack_require__(/*! ./ContainerRender */ "../../../src/gameobjects/container/ContainerRender.js"); var Union = __webpack_require__(/*! ../../geom/rectangle/Union */ "../../../src/geom/rectangle/Union.js"); @@ -8623,7 +8902,7 @@ var Vector2 = __webpack_require__(/*! ../../math/Vector2 */ "../../../src/math/V * * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. - * + * * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, * or the input area will become misaligned. * @@ -8650,6 +8929,7 @@ var Vector2 = __webpack_require__(/*! ../../math/Vector2 */ "../../../src/math/V * @extends Phaser.GameObjects.Components.ComputedSize * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @@ -8668,6 +8948,7 @@ var Container = new Class({ Components.ComputedSize, Components.Depth, Components.Mask, + Components.Pipeline, Components.Transform, Components.Visible, Render @@ -8714,7 +8995,7 @@ var Container = new Class({ * the maximum limit the Container can grow in size to. * * @name Phaser.GameObjects.Container#maxSize - * @type {integer} + * @type {number} * @default -1 * @since 3.4.0 */ @@ -8724,7 +9005,7 @@ var Container = new Class({ * The cursor position. * * @name Phaser.GameObjects.Container#position - * @type {integer} + * @type {number} * @since 3.4.0 */ this.position = 0; @@ -8801,7 +9082,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorX * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorX = 1; @@ -8828,10 +9109,12 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorY * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorY = 1; + this.initPipeline(); + this.setPosition(x, y); this.clearAlpha(); @@ -9039,7 +9322,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene); } }, @@ -9064,7 +9347,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene); } }, @@ -9150,7 +9433,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container. - * @param {integer} [index=0] - The position to insert the Game Object/s at. + * @param {number} [index=0] - The position to insert the Game Object/s at. * * @return {this} This Container instance. */ @@ -9167,7 +9450,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getAt * @since 3.4.0 * - * @param {integer} index - The position to get the Game Object from. + * @param {number} index - The position to get the Game Object from. * * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found. */ @@ -9184,7 +9467,7 @@ var Container = new Class({ * * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container. * - * @return {integer} The index of the Game Object in this Container, or -1 if not found. + * @return {number} The index of the Game Object in this Container, or -1 if not found. */ getIndex: function (child) { @@ -9245,8 +9528,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getRandom * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty. */ @@ -9270,8 +9553,8 @@ var Container = new Class({ * * @param {string} property - The property to test on each Game Object in the Container. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found. */ @@ -9300,8 +9583,8 @@ var Container = new Class({ * * @param {string} [property] - The property to test on each Game Object in the Container. * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container. */ @@ -9323,10 +9606,10 @@ var Container = new Class({ * * @param {string} property - The property to check. * @param {any} value - The value to check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * - * @return {integer} The total number of Game Objects in this Container with a property matching the given value. + * @return {number} The total number of Game Objects in this Container with a property matching the given value. */ count: function (property, value, startIndex, endIndex) { @@ -9364,7 +9647,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject} child - The Game Object to move. - * @param {integer} index - The new position of the Game Object in this Container. + * @param {number} index - The new position of the Game Object in this Container. * * @return {this} This Container instance. */ @@ -9418,7 +9701,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeAt * @since 3.4.0 * - * @param {integer} index - The index of the Game Object to be removed. + * @param {number} index - The index of the Game Object to be removed. * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container. * * @return {this} This Container instance. @@ -9443,8 +9726,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeBetween * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container. * * @return {this} This Container instance. @@ -9651,8 +9934,8 @@ var Container = new Class({ * * @param {string} property - The property that must exist on the Game Object. * @param {any} value - The value to get the property to. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {this} This Container instance. */ @@ -9764,7 +10047,7 @@ var Container = new Class({ * them from physics bodies if not accounted for in your code. * * @method Phaser.GameObjects.Container#setScrollFactor - * @since 3.0.0 + * @since 3.4.0 * * @param {number} x - The horizontal scroll factor of this Game Object. * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. @@ -9793,7 +10076,7 @@ var Container = new Class({ * The number of Game Objects inside this Container. * * @name Phaser.GameObjects.Container#length - * @type {integer} + * @type {number} * @readonly * @since 3.4.0 */ @@ -9944,9 +10227,9 @@ module.exports = Container; /***/ }), /***/ "../../../src/gameobjects/container/ContainerCanvasRenderer.js": -/*!*******************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/container/ContainerCanvasRenderer.js ***! - \*******************************************************************************/ +/*!************************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/container/ContainerCanvasRenderer.js ***! + \************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -9968,11 +10251,10 @@ module.exports = Container; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -10037,7 +10319,7 @@ var ContainerCanvasRenderer = function (renderer, container, interpolationPercen child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); @@ -10056,9 +10338,9 @@ module.exports = ContainerCanvasRenderer; /***/ }), /***/ "../../../src/gameobjects/container/ContainerRender.js": -/*!***********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/container/ContainerRender.js ***! - \***********************************************************************/ +/*!****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/container/ContainerRender.js ***! + \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -10093,9 +10375,9 @@ module.exports = { /***/ }), /***/ "../../../src/gameobjects/container/ContainerWebGLRenderer.js": -/*!******************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/container/ContainerWebGLRenderer.js ***! - \******************************************************************************/ +/*!***********************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/container/ContainerWebGLRenderer.js ***! + \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10117,21 +10399,21 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; + var childCount = children.length; - if (children.length === 0) + if (childCount === 0) { return; } var transformMatrix = container.localTransform; - + if (parentMatrix) { transformMatrix.loadIdentity(); @@ -10145,6 +10427,8 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } + renderer.pipelines.preBatch(container); + var containerHasBlendMode = (container.blendMode !== -1); if (!containerHasBlendMode) @@ -10158,9 +10442,6 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent var scrollFactorX = container.scrollFactorX; var scrollFactorY = container.scrollFactorY; - var list = children; - var childCount = children.length; - for (var i = 0; i < childCount; i++) { var child = children[i]; @@ -10216,7 +10497,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent renderer.currentType = type; } - renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false; + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; // Set parent values child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); @@ -10224,7 +10505,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix); // Restore original values @@ -10239,6 +10520,8 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent renderer.newType = false; } + + renderer.pipelines.postBatch(container); }; module.exports = ContainerWebGLRenderer; @@ -10247,9 +10530,9 @@ module.exports = ContainerWebGLRenderer; /***/ }), /***/ "../../../src/gameobjects/events/ADDED_TO_SCENE_EVENT.js": -/*!*************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js ***! - \*************************************************************************/ +/*!******************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js ***! + \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10278,9 +10561,9 @@ module.exports = 'addedtoscene'; /***/ }), /***/ "../../../src/gameobjects/events/DESTROY_EVENT.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js ***! - \******************************************************************/ +/*!***********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/DESTROY_EVENT.js ***! + \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10308,9 +10591,9 @@ module.exports = 'destroy'; /***/ }), /***/ "../../../src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js": -/*!*****************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js ***! - \*****************************************************************************/ +/*!**********************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js ***! + \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10339,9 +10622,9 @@ module.exports = 'removedfromscene'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_COMPLETE_EVENT.js": -/*!*************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js ***! - \*************************************************************************/ +/*!******************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js ***! + \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10376,9 +10659,9 @@ module.exports = 'complete'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_CREATED_EVENT.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js ***! - \************************************************************************/ +/*!*****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js ***! + \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10401,8 +10684,8 @@ module.exports = 'complete'; * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - * @param {integer} width - The width of the video. - * @param {integer} height - The height of the video. + * @param {number} width - The width of the video. + * @param {number} height - The height of the video. */ module.exports = 'created'; @@ -10410,9 +10693,9 @@ module.exports = 'created'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_ERROR_EVENT.js": -/*!**********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js ***! - \**********************************************************************/ +/*!***************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js ***! + \***************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10441,9 +10724,9 @@ module.exports = 'error'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_LOOP_EVENT.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10478,9 +10761,9 @@ module.exports = 'loop'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_PLAY_EVENT.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10511,9 +10794,9 @@ module.exports = 'play'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_SEEKED_EVENT.js": -/*!***********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js ***! - \***********************************************************************/ +/*!****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js ***! + \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10541,9 +10824,9 @@ module.exports = 'seeked'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_SEEKING_EVENT.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js ***! - \************************************************************************/ +/*!*****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js ***! + \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10572,9 +10855,9 @@ module.exports = 'seeking'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_STOP_EVENT.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10603,9 +10886,9 @@ module.exports = 'stop'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js ***! - \************************************************************************/ +/*!*****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js ***! + \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10634,9 +10917,9 @@ module.exports = 'timeout'; /***/ }), /***/ "../../../src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js": -/*!*************************************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js ***! - \*************************************************************************/ +/*!******************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js ***! + \******************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10665,9 +10948,9 @@ module.exports = 'unlocked'; /***/ }), /***/ "../../../src/gameobjects/events/index.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/gameobjects/events/index.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/gameobjects/events/index.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -10703,9 +10986,9 @@ module.exports = { /***/ }), /***/ "../../../src/geom/const.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/geom/const.js ***! - \********************************************/ +/*!*************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/const.js ***! + \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10721,7 +11004,7 @@ var GEOM_CONST = { * A Circle Geometry object type. * * @name Phaser.Geom.CIRCLE - * @type {integer} + * @type {number} * @since 3.19.0 */ CIRCLE: 0, @@ -10730,7 +11013,7 @@ var GEOM_CONST = { * An Ellipse Geometry object type. * * @name Phaser.Geom.ELLIPSE - * @type {integer} + * @type {number} * @since 3.19.0 */ ELLIPSE: 1, @@ -10739,7 +11022,7 @@ var GEOM_CONST = { * A Line Geometry object type. * * @name Phaser.Geom.LINE - * @type {integer} + * @type {number} * @since 3.19.0 */ LINE: 2, @@ -10748,7 +11031,7 @@ var GEOM_CONST = { * A Point Geometry object type. * * @name Phaser.Geom.POINT - * @type {integer} + * @type {number} * @since 3.19.0 */ POINT: 3, @@ -10757,7 +11040,7 @@ var GEOM_CONST = { * A Polygon Geometry object type. * * @name Phaser.Geom.POLYGON - * @type {integer} + * @type {number} * @since 3.19.0 */ POLYGON: 4, @@ -10766,7 +11049,7 @@ var GEOM_CONST = { * A Rectangle Geometry object type. * * @name Phaser.Geom.RECTANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ RECTANGLE: 5, @@ -10775,7 +11058,7 @@ var GEOM_CONST = { * A Triangle Geometry object type. * * @name Phaser.Geom.TRIANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ TRIANGLE: 6 @@ -10788,9 +11071,9 @@ module.exports = GEOM_CONST; /***/ }), /***/ "../../../src/geom/line/GetPoint.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/line/GetPoint.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/line/GetPoint.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -10832,9 +11115,9 @@ module.exports = GetPoint; /***/ }), /***/ "../../../src/geom/line/GetPoints.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/line/GetPoints.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/line/GetPoints.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -10861,7 +11144,7 @@ var Point = __webpack_require__(/*! ../point/Point */ "../../../src/geom/point/P * @generic {Phaser.Geom.Point[]} O - [out,$return] * * @param {Phaser.Geom.Line} line - The line. - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * @@ -10902,9 +11185,9 @@ module.exports = GetPoints; /***/ }), /***/ "../../../src/geom/line/Length.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/line/Length.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/line/Length.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -10935,9 +11218,9 @@ module.exports = Length; /***/ }), /***/ "../../../src/geom/line/Line.js": -/*!************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/line/Line.js ***! - \************************************************/ +/*!*****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/line/Line.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -10984,7 +11267,7 @@ var Line = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Line#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -11058,8 +11341,8 @@ var Line = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. - * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. @@ -11277,9 +11560,9 @@ module.exports = Line; /***/ }), /***/ "../../../src/geom/line/Random.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/line/Random.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/line/Random.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -11322,9 +11605,9 @@ module.exports = Random; /***/ }), /***/ "../../../src/geom/point/Point.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/point/Point.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/point/Point.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -11363,7 +11646,7 @@ var Point = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Point#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -11420,9 +11703,9 @@ module.exports = Point; /***/ }), /***/ "../../../src/geom/rectangle/Contains.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/rectangle/Contains.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Contains.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -11460,9 +11743,9 @@ module.exports = Contains; /***/ }), /***/ "../../../src/geom/rectangle/GetPoint.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/rectangle/GetPoint.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/rectangle/GetPoint.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -11546,9 +11829,9 @@ module.exports = GetPoint; /***/ }), /***/ "../../../src/geom/rectangle/GetPoints.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/rectangle/GetPoints.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/rectangle/GetPoints.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -11574,7 +11857,7 @@ var Perimeter = __webpack_require__(/*! ./Perimeter */ "../../../src/geom/rectan * * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. - * @param {integer} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. + * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. * * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. @@ -11605,9 +11888,9 @@ module.exports = GetPoints; /***/ }), /***/ "../../../src/geom/rectangle/Perimeter.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/rectangle/Perimeter.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Perimeter.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -11638,9 +11921,9 @@ module.exports = Perimeter; /***/ }), /***/ "../../../src/geom/rectangle/Random.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/rectangle/Random.js ***! - \*******************************************************/ +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Random.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -11681,9 +11964,9 @@ module.exports = Random; /***/ }), /***/ "../../../src/geom/rectangle/Rectangle.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/rectangle/Rectangle.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Rectangle.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -11731,7 +12014,7 @@ var Rectangle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Rectangle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -11824,7 +12107,7 @@ var Rectangle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. * @@ -12197,9 +12480,9 @@ module.exports = Rectangle; /***/ }), /***/ "../../../src/geom/rectangle/Union.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/geom/rectangle/Union.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Union.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -12244,9 +12527,9 @@ module.exports = Union; /***/ }), /***/ "../../../src/loader/File.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/loader/File.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/File.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -12329,7 +12612,18 @@ var File = new Class({ if (!this.type || !this.key) { - throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + throw new Error('Invalid Loader.' + this.type + ' key'); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; } /** @@ -12343,16 +12637,7 @@ var File = new Class({ * @type {object|string} * @since 3.0.0 */ - this.url = GetFastValue(fileConfig, 'url'); - - if (this.url === undefined) - { - this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof this.url === 'string' && this.url.indexOf('blob:') !== 0 && this.url.indexOf('data:') !== 0) - { - this.url = loader.path + this.url; - } + this.url = url; /** * The final URL this file will load from, including baseURL and path. @@ -12391,7 +12676,7 @@ var File = new Class({ * The current state of the file. One of the FILE_CONST values. * * @name Phaser.Loader.File#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; @@ -12797,9 +13082,9 @@ module.exports = File; /***/ }), /***/ "../../../src/loader/FileTypesManager.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/FileTypesManager.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/FileTypesManager.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -12871,9 +13156,9 @@ module.exports = FileTypesManager; /***/ }), /***/ "../../../src/loader/GetURL.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/loader/GetURL.js ***! - \***********************************************/ +/*!****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/GetURL.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -12917,9 +13202,9 @@ module.exports = GetURL; /***/ }), /***/ "../../../src/loader/MergeXHRSettings.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/MergeXHRSettings.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/MergeXHRSettings.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -12970,9 +13255,9 @@ module.exports = MergeXHRSettings; /***/ }), /***/ "../../../src/loader/MultiFile.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/MultiFile.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/MultiFile.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -12988,7 +13273,7 @@ var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class. * @classdesc * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * + * * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. * * @class MultiFile @@ -13007,6 +13292,17 @@ var MultiFile = new Class({ function MultiFile (loader, type, key, files) { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + /** * A reference to the Loader that is going to load this file. * @@ -13038,7 +13334,7 @@ var MultiFile = new Class({ * The current index being used by multi-file loaders to avoid key clashes. * * @name Phaser.Loader.MultiFile#multiKeyIndex - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -13051,7 +13347,7 @@ var MultiFile = new Class({ * @type {Phaser.Loader.File[]} * @since 3.7.0 */ - this.files = files; + this.files = finalFiles; /** * The completion status of this MultiFile. @@ -13067,17 +13363,17 @@ var MultiFile = new Class({ * The number of files to load. * * @name Phaser.Loader.MultiFile#pending - * @type {integer} + * @type {number} * @since 3.7.0 */ - this.pending = files.length; + this.pending = finalFiles.length; /** * The number of files that failed to load. * * @name Phaser.Loader.MultiFile#failed - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -13123,9 +13419,9 @@ var MultiFile = new Class({ this.prefix = loader.prefix; // Link the files - for (var i = 0; i < files.length; i++) + for (var i = 0; i < finalFiles.length; i++) { - files[i].multiFile = this; + finalFiles[i].multiFile = this; } }, @@ -13209,9 +13505,9 @@ module.exports = MultiFile; /***/ }), /***/ "../../../src/loader/XHRLoader.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/XHRLoader.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/XHRLoader.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -13295,9 +13591,9 @@ module.exports = XHRLoader; /***/ }), /***/ "../../../src/loader/XHRSettings.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/XHRSettings.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/XHRSettings.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13317,7 +13613,7 @@ module.exports = XHRLoader; * @param {boolean} [async=true] - Should the XHR request use async or not? * @param {string} [user=''] - Optional username for the XHR request. * @param {string} [password=''] - Optional password for the XHR request. - * @param {integer} [timeout=0] - Optional XHR timeout value. + * @param {number} [timeout=0] - Optional XHR timeout value. * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. * * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. @@ -13370,9 +13666,9 @@ module.exports = XHRSettings; /***/ }), /***/ "../../../src/loader/const.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/loader/const.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/const.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13388,7 +13684,7 @@ var FILE_CONST = { * The Loader is idle. * * @name Phaser.Loader.LOADER_IDLE - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_IDLE: 0, @@ -13397,7 +13693,7 @@ var FILE_CONST = { * The Loader is actively loading. * * @name Phaser.Loader.LOADER_LOADING - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_LOADING: 1, @@ -13406,7 +13702,7 @@ var FILE_CONST = { * The Loader is processing files is has loaded. * * @name Phaser.Loader.LOADER_PROCESSING - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_PROCESSING: 2, @@ -13415,7 +13711,7 @@ var FILE_CONST = { * The Loader has completed loading and processing. * * @name Phaser.Loader.LOADER_COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_COMPLETE: 3, @@ -13424,7 +13720,7 @@ var FILE_CONST = { * The Loader is shutting down. * * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_SHUTDOWN: 4, @@ -13433,7 +13729,7 @@ var FILE_CONST = { * The Loader has been destroyed. * * @name Phaser.Loader.LOADER_DESTROYED - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_DESTROYED: 5, @@ -13442,7 +13738,7 @@ var FILE_CONST = { * File is in the load queue but not yet started * * @name Phaser.Loader.FILE_PENDING - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_PENDING: 10, @@ -13451,7 +13747,7 @@ var FILE_CONST = { * File has been started to load by the loader (onLoad called) * * @name Phaser.Loader.FILE_LOADING - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_LOADING: 11, @@ -13460,7 +13756,7 @@ var FILE_CONST = { * File has loaded successfully, awaiting processing * * @name Phaser.Loader.FILE_LOADED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_LOADED: 12, @@ -13469,7 +13765,7 @@ var FILE_CONST = { * File failed to load * * @name Phaser.Loader.FILE_FAILED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_FAILED: 13, @@ -13478,7 +13774,7 @@ var FILE_CONST = { * File is being processed (onProcess callback) * * @name Phaser.Loader.FILE_PROCESSING - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_PROCESSING: 14, @@ -13487,7 +13783,7 @@ var FILE_CONST = { * The File has errored somehow during processing. * * @name Phaser.Loader.FILE_ERRORED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_ERRORED: 16, @@ -13496,7 +13792,7 @@ var FILE_CONST = { * File has finished processing. * * @name Phaser.Loader.FILE_COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_COMPLETE: 17, @@ -13505,7 +13801,7 @@ var FILE_CONST = { * File has been destroyed * * @name Phaser.Loader.FILE_DESTROYED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_DESTROYED: 18, @@ -13514,7 +13810,7 @@ var FILE_CONST = { * File was populated from local data and doesn't need an HTTP request * * @name Phaser.Loader.FILE_POPULATED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_POPULATED: 19 @@ -13527,9 +13823,9 @@ module.exports = FILE_CONST; /***/ }), /***/ "../../../src/loader/events/ADD_EVENT.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/ADD_EVENT.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13562,9 +13858,9 @@ module.exports = 'addfile'; /***/ }), /***/ "../../../src/loader/events/COMPLETE_EVENT.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js ***! - \**************************************************************/ +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/COMPLETE_EVENT.js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13586,8 +13882,8 @@ module.exports = 'addfile'; * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {integer} totalComplete - The total number of files that successfully loaded. - * @param {integer} totalFailed - The total number of files that failed to load. + * @param {number} totalComplete - The total number of files that successfully loaded. + * @param {number} totalFailed - The total number of files that failed to load. */ module.exports = 'complete'; @@ -13595,9 +13891,9 @@ module.exports = 'complete'; /***/ }), /***/ "../../../src/loader/events/FILE_COMPLETE_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js ***! - \*******************************************************************/ +/*!************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_COMPLETE_EVENT.js ***! + \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13629,9 +13925,9 @@ module.exports = 'filecomplete'; /***/ }), /***/ "../../../src/loader/events/FILE_KEY_COMPLETE_EVENT.js": -/*!***********************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js ***! - \***********************************************************************/ +/*!****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js ***! + \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13688,9 +13984,9 @@ module.exports = 'filecomplete-'; /***/ }), /***/ "../../../src/loader/events/FILE_LOAD_ERROR_EVENT.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13718,9 +14014,9 @@ module.exports = 'loaderror'; /***/ }), /***/ "../../../src/loader/events/FILE_LOAD_EVENT.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_LOAD_EVENT.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13749,9 +14045,9 @@ module.exports = 'load'; /***/ }), /***/ "../../../src/loader/events/FILE_PROGRESS_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js ***! - \*******************************************************************/ +/*!************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_PROGRESS_EVENT.js ***! + \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13781,9 +14077,9 @@ module.exports = 'fileprogress'; /***/ }), /***/ "../../../src/loader/events/POST_PROCESS_EVENT.js": -/*!******************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js ***! - \******************************************************************/ +/*!***********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/POST_PROCESS_EVENT.js ***! + \***********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13815,9 +14111,9 @@ module.exports = 'postprocess'; /***/ }), /***/ "../../../src/loader/events/PROGRESS_EVENT.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js ***! - \**************************************************************/ +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/PROGRESS_EVENT.js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13845,9 +14141,9 @@ module.exports = 'progress'; /***/ }), /***/ "../../../src/loader/events/START_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/START_EVENT.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/START_EVENT.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -13877,9 +14173,9 @@ module.exports = 'start'; /***/ }), /***/ "../../../src/loader/events/index.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/events/index.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/events/index.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -13912,9 +14208,9 @@ module.exports = { /***/ }), /***/ "../../../src/loader/filetypes/ImageFile.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/filetypes/ImageFile.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -14191,9 +14487,9 @@ module.exports = ImageFile; /***/ }), /***/ "../../../src/loader/filetypes/JSONFile.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/filetypes/JSONFile.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -14426,9 +14722,9 @@ module.exports = JSONFile; /***/ }), /***/ "../../../src/loader/filetypes/TextFile.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/loader/filetypes/TextFile.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/loader/filetypes/TextFile.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -14472,7 +14768,9 @@ var TextFile = new Class({ function TextFile (loader, key, url, xhrSettings) { + var type = 'text'; var extension = 'txt'; + var cache = loader.cacheManager.text; if (IsPlainObject(key)) { @@ -14482,11 +14780,13 @@ var TextFile = new Class({ url = GetFastValue(config, 'url'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); } var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, + type: type, + cache: cache, extension: extension, responseType: 'text', key: key, @@ -14606,9 +14906,9 @@ module.exports = TextFile; /***/ }), /***/ "../../../src/math/Average.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Average.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Average.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14646,9 +14946,9 @@ module.exports = Average; /***/ }), /***/ "../../../src/math/Bernstein.js": -/*!************************************************!*\ - !*** D:/wamp/www/phaser/src/math/Bernstein.js ***! - \************************************************/ +/*!*****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Bernstein.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -14682,9 +14982,9 @@ module.exports = Bernstein; /***/ }), /***/ "../../../src/math/Between.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Between.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Between.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14700,10 +15000,10 @@ module.exports = Bernstein; * @function Phaser.Math.Between * @since 3.0.0 * - * @param {integer} min - The minimum value. - * @param {integer} max - The maximum value. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. * - * @return {integer} The random integer. + * @return {number} The random integer. */ var Between = function (min, max) { @@ -14716,9 +15016,9 @@ module.exports = Between; /***/ }), /***/ "../../../src/math/CatmullRom.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/CatmullRom.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/CatmullRom.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14758,9 +15058,9 @@ module.exports = CatmullRom; /***/ }), /***/ "../../../src/math/CeilTo.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/math/CeilTo.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/CeilTo.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14780,7 +15080,7 @@ module.exports = CatmullRom; * * @param {number} value - The value to round. * @param {number} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -14800,9 +15100,9 @@ module.exports = CeilTo; /***/ }), /***/ "../../../src/math/Clamp.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Clamp.js ***! - \********************************************/ +/*!*************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Clamp.js ***! + \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14835,9 +15135,9 @@ module.exports = Clamp; /***/ }), /***/ "../../../src/math/DegToRad.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/math/DegToRad.js ***! - \***********************************************/ +/*!****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/DegToRad.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -14855,7 +15155,7 @@ var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); * @function Phaser.Math.DegToRad * @since 3.0.0 * - * @param {integer} degrees - The angle (in degrees) to convert to radians. + * @param {number} degrees - The angle (in degrees) to convert to radians. * * @return {number} The given angle converted to radians. */ @@ -14870,9 +15170,9 @@ module.exports = DegToRad; /***/ }), /***/ "../../../src/math/Difference.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/Difference.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Difference.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14901,12 +15201,300 @@ var Difference = function (a, b) module.exports = Difference; +/***/ }), + +/***/ "../../../src/math/Euler.js": +/*!*************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Euler.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"); +var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Matrix4 = __webpack_require__(/*! ./Matrix4 */ "../../../src/math/Matrix4.js"); +var NOOP = __webpack_require__(/*! ../utils/NOOP */ "../../../src/utils/NOOP.js"); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + /***/ }), /***/ "../../../src/math/Factorial.js": -/*!************************************************!*\ - !*** D:/wamp/www/phaser/src/math/Factorial.js ***! - \************************************************/ +/*!*****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Factorial.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14949,9 +15537,9 @@ module.exports = Factorial; /***/ }), /***/ "../../../src/math/FloatBetween.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/math/FloatBetween.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/FloatBetween.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -14983,9 +15571,9 @@ module.exports = FloatBetween; /***/ }), /***/ "../../../src/math/FloorTo.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/FloorTo.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/FloorTo.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -15004,8 +15592,8 @@ module.exports = FloatBetween; * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -15025,9 +15613,9 @@ module.exports = FloorTo; /***/ }), /***/ "../../../src/math/FromPercent.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/math/FromPercent.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/FromPercent.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -15064,9 +15652,9 @@ module.exports = FromPercent; /***/ }), /***/ "../../../src/math/GetSpeed.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/math/GetSpeed.js ***! - \***********************************************/ +/*!****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/GetSpeed.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -15083,7 +15671,7 @@ module.exports = FromPercent; * @since 3.0.0 * * @param {number} distance - The distance. - * @param {integer} time - The time, in seconds. + * @param {number} time - The time, in seconds. * * @return {number} The speed, in distance per ms. * @@ -15102,9 +15690,9 @@ module.exports = GetSpeed; /***/ }), /***/ "../../../src/math/IsEven.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/math/IsEven.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/IsEven.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -15138,9 +15726,9 @@ module.exports = IsEven; /***/ }), /***/ "../../../src/math/IsEvenStrict.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/math/IsEvenStrict.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/IsEvenStrict.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -15172,9 +15760,9 @@ module.exports = IsEvenStrict; /***/ }), /***/ "../../../src/math/Linear.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Linear.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Linear.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -15207,9 +15795,9 @@ module.exports = Linear; /***/ }), /***/ "../../../src/math/Matrix3.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Matrix3.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Matrix3.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -15805,9 +16393,9 @@ module.exports = Matrix3; /***/ }), /***/ "../../../src/math/Matrix4.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Matrix4.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Matrix4.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -15817,17 +16405,21 @@ module.exports = Matrix3; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); +var Vector3 = __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"); +/** + * @ignore + */ var EPSILON = 0.000001; /** * @classdesc * A four-dimensional matrix. * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * * @class Matrix4 * @memberof Phaser.Math * @constructor @@ -15875,8 +16467,6 @@ var Matrix4 = new Class({ return new Matrix4(this); }, - // TODO - Should work with basic values - /** * This method is an alias for `Matrix4.copy`. * @@ -15885,13 +16475,62 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ set: function (src) { return this.copy(src); }, + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; + + return this; + }, + /** * Copy the values of a given Matrix into this Matrix. * @@ -15900,31 +16539,13 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ copy: function (src) { - var out = this.val; var a = src.val; - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); }, /** @@ -15933,32 +16554,13 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#fromArray * @since 3.0.0 * - * @param {array} a - The array to copy the values from. + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ fromArray: function (a) { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); }, /** @@ -15973,26 +16575,52 @@ var Matrix4 = new Class({ */ zero: function () { - var out = this.val; + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); - return this; + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); }, /** @@ -16005,7 +16633,7 @@ var Matrix4 = new Class({ * @param {number} y - The y value. * @param {number} z - The z value. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ xyz: function (x, y, z) { @@ -16030,7 +16658,7 @@ var Matrix4 = new Class({ * @param {number} y - The y scaling value. * @param {number} z - The z scaling value. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ scaling: function (x, y, z) { @@ -16052,30 +16680,11 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#identity * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ identity: function () { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }, /** @@ -16084,7 +16693,7 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#transpose * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ transpose: function () { @@ -16113,13 +16722,30 @@ var Matrix4 = new Class({ return this; }, + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + /** * Invert this Matrix. * * @method Phaser.Math.Matrix4#invert * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ invert: function () { @@ -16160,34 +16786,34 @@ var Matrix4 = new Class({ var b10 = a21 * a33 - a23 * a31; var b11 = a22 * a33 - a23 * a32; - // Calculate the determinant + // Calculate the determinant var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; if (!det) { - return null; + return this; } det = 1 / det; - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); }, /** @@ -16196,7 +16822,7 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#adjoint * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ adjoint: function () { @@ -16222,24 +16848,24 @@ var Matrix4 = new Class({ var a32 = a[14]; var a33 = a[15]; - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); }, /** @@ -16299,7 +16925,7 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ multiply: function (src) { @@ -16379,35 +17005,121 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ multiplyLocal: function (src) { - var a = []; - var m1 = this.val; - var m2 = src.val; + var a = this.val; + var b = src.val; - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, - return this.fromArray(a); + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); }, /** @@ -16418,21 +17130,11 @@ var Matrix4 = new Class({ * * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ translate: function (v) { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; + return this.translateXYZ(v.x, v.y, v.z); }, /** @@ -16445,7 +17147,7 @@ var Matrix4 = new Class({ * @param {number} y - The y component. * @param {number} z - The z component. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ translateXYZ: function (x, y, z) { @@ -16469,31 +17171,11 @@ var Matrix4 = new Class({ * * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ scale: function (v) { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; + return this.scaleXYZ(v.x, v.y, v.z); }, /** @@ -16506,7 +17188,7 @@ var Matrix4 = new Class({ * @param {number} y - The y component. * @param {number} z - The z component. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ scaleXYZ: function (x, y, z) { @@ -16539,7 +17221,7 @@ var Matrix4 = new Class({ * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. * @param {number} angle - The rotation angle in radians. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ makeRotationAxis: function (axis, angle) { @@ -16554,14 +17236,12 @@ var Matrix4 = new Class({ var tx = t * x; var ty = t * y; - this.fromArray([ + return this.setValues( tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1 - ]); - - return this; + ); }, /** @@ -16573,7 +17253,7 @@ var Matrix4 = new Class({ * @param {number} rad - The angle in radians to rotate by. * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotate: function (rad, axis) { @@ -16585,7 +17265,7 @@ var Matrix4 = new Class({ if (Math.abs(len) < EPSILON) { - return null; + return this; } len = 1 / len; @@ -16612,7 +17292,12 @@ var Matrix4 = new Class({ var a22 = a[10]; var a23 = a[11]; - // Construct the elements of the rotation matrix + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix var b00 = x * x * t + c; var b01 = y * x * t + z * s; var b02 = z * x * t - y * s; @@ -16625,21 +17310,22 @@ var Matrix4 = new Class({ var b21 = y * z * t - x * s; var b22 = z * z * t + c; - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); }, /** @@ -16650,7 +17336,7 @@ var Matrix4 = new Class({ * * @param {number} rad - The angle in radians to rotate by. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotateX: function (rad) { @@ -16668,7 +17354,7 @@ var Matrix4 = new Class({ var a22 = a[10]; var a23 = a[11]; - // Perform axis-specific matrix multiplication + // Perform axis-specific matrix multiplication a[4] = a10 * c + a20 * s; a[5] = a11 * c + a21 * s; a[6] = a12 * c + a22 * s; @@ -16689,7 +17375,7 @@ var Matrix4 = new Class({ * * @param {number} rad - The angle to rotate by, in radians. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotateY: function (rad) { @@ -16707,7 +17393,7 @@ var Matrix4 = new Class({ var a22 = a[10]; var a23 = a[11]; - // Perform axis-specific matrix multiplication + // Perform axis-specific matrix multiplication a[0] = a00 * c - a20 * s; a[1] = a01 * c - a21 * s; a[2] = a02 * c - a22 * s; @@ -16728,7 +17414,7 @@ var Matrix4 = new Class({ * * @param {number} rad - The angle to rotate by, in radians. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotateZ: function (rad) { @@ -16746,7 +17432,7 @@ var Matrix4 = new Class({ var a12 = a[6]; var a13 = a[7]; - // Perform axis-specific matrix multiplication + // Perform axis-specific matrix multiplication a[0] = a00 * c + a10 * s; a[1] = a01 * c + a11 * s; a[2] = a02 * c + a12 * s; @@ -16768,13 +17454,11 @@ var Matrix4 = new Class({ * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. * @param {Phaser.Math.Vector3} v - The Vector to set translation from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ fromRotationTranslation: function (q, v) { - // Quaternion math - var out = this.val; - + // Quaternion math var x = q.x; var y = q.y; var z = q.z; @@ -16796,27 +17480,27 @@ var Matrix4 = new Class({ var wy = w * y2; var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; + v.x, + v.y, + v.z, + 1 + ); }, /** @@ -16827,12 +17511,10 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ fromQuat: function (q) { - var out = this.val; - var x = q.x; var y = q.y; var z = q.z; @@ -16854,27 +17536,27 @@ var Matrix4 = new Class({ var wy = w * y2; var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; + 0, + 0, + 0, + 1 + ); }, /** @@ -16890,37 +17572,35 @@ var Matrix4 = new Class({ * @param {number} near - The near bound of the frustum. * @param {number} far - The far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ frustum: function (left, right, bottom, top, near, far) { - var out = this.val; - var rl = 1 / (right - left); var tb = 1 / (top - bottom); var nf = 1 / (near - far); - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; + 0, + (near * 2) * tb, + 0, + 0, - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; + 0, + 0, + (far * near * 2) * nf, + 0 + ); }, /** @@ -16934,35 +17614,34 @@ var Matrix4 = new Class({ * @param {number} near - Near bound of the frustum. * @param {number} far - Far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ perspective: function (fovy, aspect, near, far) { - var out = this.val; var f = 1.0 / Math.tan(fovy / 2); var nf = 1 / (near - far); - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; + return this.setValues( + f / aspect, + 0, + 0, + 0, - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; + 0, + f, + 0, + 0, - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; + 0, + 0, + (far + near) * nf, + -1, - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; + 0, + 0, + (2 * far * near) * nf, + 0 + ); }, /** @@ -16976,33 +17655,31 @@ var Matrix4 = new Class({ * @param {number} near - Near bound of the frustum. * @param {number} far - Far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ perspectiveLH: function (width, height, near, far) { - var out = this.val; + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; + 0, + (2 * near) / height, + 0, + 0, - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; + 0, + 0, + -far / (near - far), + 1, - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; + 0, + 0, + (near * far) / (near - far), + 0 + ); }, /** @@ -17018,11 +17695,10 @@ var Matrix4 = new Class({ * @param {number} near - The near bound of the frustum. * @param {number} far - The far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ ortho: function (left, right, bottom, top, near, far) { - var out = this.val; var lr = left - right; var bt = bottom - top; var nf = near - far; @@ -17032,25 +17708,85 @@ var Matrix4 = new Class({ bt = (bt === 0) ? bt : 1 / bt; nf = (nf === 0) ? nf : 1 / nf; - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; + return this.setValues( + -2 * lr, + 0, + 0, + 0, - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; + 0, + -2 * bt, + 0, + 0, - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; + 0, + 0, + 2 * nf, + 0, - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; return this; }, @@ -17065,12 +17801,10 @@ var Matrix4 = new Class({ * @param {Phaser.Math.Vector3} center - Point the viewer is looking at * @param {Phaser.Math.Vector3} up - vec3 pointing up. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ lookAt: function (eye, center, up) { - var out = this.val; - var eyex = eye.x; var eyey = eye.y; var eyez = eye.z; @@ -17140,27 +17874,27 @@ var Matrix4 = new Class({ y2 *= len; } - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; + return this.setValues( + x0, + y0, + z0, + 0, - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; + x1, + y1, + z1, + 0, - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; + x2, + y2, + z2, + 0, - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); }, /** @@ -17173,7 +17907,7 @@ var Matrix4 = new Class({ * @param {number} pitch - The pitch value. * @param {number} roll - The roll value. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ yawPitchRoll: function (yaw, pitch, roll) { @@ -17236,7 +17970,7 @@ var Matrix4 = new Class({ * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) { @@ -17248,33 +17982,218 @@ var Matrix4 = new Class({ this.multiplyLocal(_tempMat1); this.multiplyLocal(_tempMat2); - if (viewMatrix !== undefined) + if (viewMatrix) { this.multiplyLocal(viewMatrix); } - if (projectionMatrix !== undefined) + if (projectionMatrix) { this.multiplyLocal(projectionMatrix); } return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); } }); +/** + * @ignore + */ var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ var _tempMat2 = new Matrix4(); +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + module.exports = Matrix4; /***/ }), /***/ "../../../src/math/MaxAdd.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/math/MaxAdd.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/MaxAdd.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -17307,9 +18226,9 @@ module.exports = MaxAdd; /***/ }), /***/ "../../../src/math/MinSub.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/math/MinSub.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/MinSub.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -17342,9 +18261,9 @@ module.exports = MinSub; /***/ }), /***/ "../../../src/math/Percent.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Percent.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Percent.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -17406,9 +18325,9 @@ module.exports = Percent; /***/ }), /***/ "../../../src/math/Quaternion.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/Quaternion.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Quaternion.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -17422,8 +18341,9 @@ module.exports = Percent; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(/*! ../utils/Class */ "../../../src/utils/Class.js"); -var Vector3 = __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"); var Matrix3 = __webpack_require__(/*! ./Matrix3 */ "../../../src/math/Matrix3.js"); +var NOOP = __webpack_require__(/*! ../utils/NOOP */ "../../../src/utils/NOOP.js"); +var Vector3 = __webpack_require__(/*! ./Vector3 */ "../../../src/math/Vector3.js"); var EPSILON = 0.000001; @@ -17446,10 +18366,10 @@ var tmpMat3 = new Matrix3(); * @constructor * @since 3.0.0 * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. */ var Quaternion = new Class({ @@ -17460,52 +18380,141 @@ var Quaternion = new Class({ /** * The x component of this Quaternion. * - * @name Phaser.Math.Quaternion#x + * @name Phaser.Math.Quaternion#_x * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The y component of this Quaternion. * - * @name Phaser.Math.Quaternion#y + * @name Phaser.Math.Quaternion#_y * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The z component of this Quaternion. * - * @name Phaser.Math.Quaternion#z + * @name Phaser.Math.Quaternion#_z * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The w component of this Quaternion. * - * @name Phaser.Math.Quaternion#w + * @name Phaser.Math.Quaternion#_w * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ - if (typeof x === 'object') + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); } - else + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); } }, @@ -17521,16 +18530,11 @@ var Quaternion = new Class({ */ copy: function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; + return this.set(src); }, /** - * Set the components of this Quaternion. + * Set the components of this Quaternion and optionally call the `onChangeCallback`. * * @method Phaser.Math.Quaternion#set * @since 3.0.0 @@ -17539,24 +18543,32 @@ var Quaternion = new Class({ * @param {number} [y=0] - The y component. * @param {number} [z=0] - The z component. * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? * * @return {Phaser.Math.Quaternion} This Quaternion. */ - set: function (x, y, z, w) + set: function (x, y, z, w, update) { + if (update === undefined) { update = true; } + if (typeof x === 'object') { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); } return this; @@ -17574,10 +18586,12 @@ var Quaternion = new Class({ */ add: function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); return this; }, @@ -17594,10 +18608,12 @@ var Quaternion = new Class({ */ subtract: function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); return this; }, @@ -17614,10 +18630,12 @@ var Quaternion = new Class({ */ scale: function (scale) { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); return this; }, @@ -17678,12 +18696,14 @@ var Quaternion = new Class({ { len = 1 / Math.sqrt(len); - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; } + this.onChangeCallback(this); + return this; }, @@ -17722,12 +18742,12 @@ var Quaternion = new Class({ var az = this.z; var aw = this.w; - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); }, /** @@ -17759,21 +18779,16 @@ var Quaternion = new Class({ } else if (dot > 0.999999) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); } else { tmpvec.copy(a).cross(b); - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; return this.normalize(); } @@ -17820,12 +18835,7 @@ var Quaternion = new Class({ */ identity: function () { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); }, /** @@ -17845,12 +18855,12 @@ var Quaternion = new Class({ var s = Math.sin(rad); - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); }, /** @@ -17875,12 +18885,12 @@ var Quaternion = new Class({ var bz = b.z; var bw = b.w; - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); }, /** @@ -17938,12 +18948,12 @@ var Quaternion = new Class({ } // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); }, /** @@ -17964,14 +18974,12 @@ var Quaternion = new Class({ var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = (dot) ? 1 / dot : 0; - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); }, /** @@ -17986,9 +18994,11 @@ var Quaternion = new Class({ */ conjugate: function () { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); return this; }, @@ -18015,12 +19025,12 @@ var Quaternion = new Class({ var bx = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); }, /** @@ -18045,12 +19055,12 @@ var Quaternion = new Class({ var by = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); }, /** @@ -18075,12 +19085,12 @@ var Quaternion = new Class({ var bz = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); }, /** @@ -18104,6 +19114,190 @@ var Quaternion = new Class({ return this; }, + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + /** * Convert the given Matrix into this Quaternion. * @@ -18135,9 +19329,9 @@ var Quaternion = new Class({ fRoot = 0.5 / fRoot; // 1/(4w) - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; } else { @@ -18166,12 +19360,14 @@ var Quaternion = new Class({ tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; } + this.onChangeCallback(this); + return this; } @@ -18183,9 +19379,9 @@ module.exports = Quaternion; /***/ }), /***/ "../../../src/math/RadToDeg.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/math/RadToDeg.js ***! - \***********************************************/ +/*!****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RadToDeg.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -18205,7 +19401,7 @@ var CONST = __webpack_require__(/*! ./const */ "../../../src/math/const.js"); * * @param {number} radians - The angle in radians to convert ot degrees. * - * @return {integer} The given angle converted to degrees. + * @return {number} The given angle converted to degrees. */ var RadToDeg = function (radians) { @@ -18218,9 +19414,9 @@ module.exports = RadToDeg; /***/ }), /***/ "../../../src/math/RandomXY.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/math/RandomXY.js ***! - \***********************************************/ +/*!****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RandomXY.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18263,9 +19459,9 @@ module.exports = RandomXY; /***/ }), /***/ "../../../src/math/RandomXYZ.js": -/*!************************************************!*\ - !*** D:/wamp/www/phaser/src/math/RandomXYZ.js ***! - \************************************************/ +/*!*****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RandomXYZ.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18307,9 +19503,9 @@ module.exports = RandomXYZ; /***/ }), /***/ "../../../src/math/RandomXYZW.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/RandomXYZW.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RandomXYZW.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18349,9 +19545,9 @@ module.exports = RandomXYZW; /***/ }), /***/ "../../../src/math/Rotate.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Rotate.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Rotate.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18389,9 +19585,9 @@ module.exports = Rotate; /***/ }), /***/ "../../../src/math/RotateAround.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/math/RotateAround.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RotateAround.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18438,9 +19634,9 @@ module.exports = RotateAround; /***/ }), /***/ "../../../src/math/RotateAroundDistance.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/RotateAroundDistance.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RotateAroundDistance.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18484,9 +19680,9 @@ module.exports = RotateAroundDistance; /***/ }), /***/ "../../../src/math/RotateTo.js": -/*!***********************************************!*\ - !*** D:/wamp/www/phaser/src/math/RotateTo.js ***! - \***********************************************/ +/*!****************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RotateTo.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18526,9 +19722,9 @@ module.exports = RotateTo; /***/ }), /***/ "../../../src/math/RotateVec3.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/RotateVec3.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RotateVec3.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -18579,9 +19775,9 @@ module.exports = RotateVec3; /***/ }), /***/ "../../../src/math/RoundAwayFromZero.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/RoundAwayFromZero.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RoundAwayFromZero.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18613,9 +19809,9 @@ module.exports = RoundAwayFromZero; /***/ }), /***/ "../../../src/math/RoundTo.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/RoundTo.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/RoundTo.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18649,8 +19845,8 @@ module.exports = RoundAwayFromZero; * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ @@ -18670,9 +19866,9 @@ module.exports = RoundTo; /***/ }), /***/ "../../../src/math/SinCosTableGenerator.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/SinCosTableGenerator.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/SinCosTableGenerator.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18728,9 +19924,9 @@ module.exports = SinCosTableGenerator; /***/ }), /***/ "../../../src/math/SmoothStep.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/SmoothStep.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/SmoothStep.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18780,9 +19976,9 @@ module.exports = SmoothStep; /***/ }), /***/ "../../../src/math/SmootherStep.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/math/SmootherStep.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/SmootherStep.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -18824,9 +20020,9 @@ module.exports = SmootherStep; /***/ }), /***/ "../../../src/math/ToXY.js": -/*!*******************************************!*\ - !*** D:/wamp/www/phaser/src/math/ToXY.js ***! - \*******************************************/ +/*!************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/ToXY.js ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -18848,9 +20044,9 @@ var Vector2 = __webpack_require__(/*! ./Vector2 */ "../../../src/math/Vector2.js * @function Phaser.Math.ToXY * @since 3.19.0 * - * @param {integer} index - The position within the grid to get the x/y value for. - * @param {integer} width - The width of the grid. - * @param {integer} height - The height of the grid. + * @param {number} index - The position within the grid to get the x/y value for. + * @param {number} width - The width of the grid. + * @param {number} height - The height of the grid. * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. * * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. @@ -18887,9 +20083,9 @@ module.exports = ToXY; /***/ }), /***/ "../../../src/math/TransformXY.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/math/TransformXY.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/TransformXY.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -18947,9 +20143,9 @@ module.exports = TransformXY; /***/ }), /***/ "../../../src/math/Vector2.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Vector2.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Vector2.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -19728,9 +20924,9 @@ module.exports = Vector2; /***/ }), /***/ "../../../src/math/Vector3.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Vector3.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Vector3.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -19829,6 +21025,44 @@ var Vector3 = new Class({ return this; }, + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + /** * Make a clone of this Vector3. * @@ -19842,6 +21076,26 @@ var Vector3 = new Class({ return new Vector3(this.x, this.y, this.z); }, + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + /** * Calculate the cross (vector) product of two given Vectors. * @@ -19935,6 +21189,63 @@ var Vector3 = new Class({ return this; }, + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + /** * Add a given Vector to this Vector. Addition is component-wise. * @@ -19954,6 +21265,45 @@ var Vector3 = new Class({ return this; }, + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + /** * Subtract the given Vector from this Vector. Subtraction is component-wise. * @@ -20230,6 +21580,56 @@ var Vector3 = new Class({ return this; }, + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + /** * Transform this Vector with the given Matrix. * @@ -20255,7 +21655,7 @@ var Vector3 = new Class({ }, /** - * Transform this Vector with the given Matrix. + * Transform this Vector with the given Matrix4. * * @method Phaser.Math.Vector3#transformMat4 * @since 3.0.0 @@ -20386,6 +21786,38 @@ var Vector3 = new Class({ return this; }, + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + /** * Unproject this point from 2D space to 3D space. * The point should have its x and y properties set to @@ -20443,7 +21875,7 @@ var Vector3 = new Class({ /** * A static zero Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20455,7 +21887,7 @@ Vector3.ZERO = new Vector3(); /** * A static right Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20467,7 +21899,7 @@ Vector3.RIGHT = new Vector3(1, 0, 0); /** * A static left Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20479,7 +21911,7 @@ Vector3.LEFT = new Vector3(-1, 0, 0); /** * A static up Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20491,7 +21923,7 @@ Vector3.UP = new Vector3(0, -1, 0); /** * A static down Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20503,7 +21935,7 @@ Vector3.DOWN = new Vector3(0, 1, 0); /** * A static forward Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20515,7 +21947,7 @@ Vector3.FORWARD = new Vector3(0, 0, 1); /** * A static back Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20527,7 +21959,7 @@ Vector3.BACK = new Vector3(0, 0, -1); /** * A static one Vector3 for use by reference. - * + * * This constant is meant for comparison operations and should not be modified directly. * * @constant @@ -20543,9 +21975,9 @@ module.exports = Vector3; /***/ }), /***/ "../../../src/math/Vector4.js": -/*!**********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Vector4.js ***! - \**********************************************/ +/*!***************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Vector4.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21093,9 +22525,9 @@ module.exports = Vector4; /***/ }), /***/ "../../../src/math/Within.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/math/Within.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Within.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21128,9 +22560,9 @@ module.exports = Within; /***/ }), /***/ "../../../src/math/Wrap.js": -/*!*******************************************!*\ - !*** D:/wamp/www/phaser/src/math/Wrap.js ***! - \*******************************************/ +/*!************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/Wrap.js ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21165,9 +22597,9 @@ module.exports = Wrap; /***/ }), /***/ "../../../src/math/angle/Between.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/Between.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/Between.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21201,9 +22633,9 @@ module.exports = Between; /***/ }), /***/ "../../../src/math/angle/BetweenPoints.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/BetweenPoints.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/BetweenPoints.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21237,9 +22669,9 @@ module.exports = BetweenPoints; /***/ }), /***/ "../../../src/math/angle/BetweenPointsY.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/BetweenPointsY.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21274,9 +22706,9 @@ module.exports = BetweenPointsY; /***/ }), /***/ "../../../src/math/angle/BetweenY.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/BetweenY.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/BetweenY.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21313,9 +22745,9 @@ module.exports = BetweenY; /***/ }), /***/ "../../../src/math/angle/CounterClockwise.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/CounterClockwise.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/CounterClockwise.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21363,9 +22795,9 @@ module.exports = CounterClockwise; /***/ }), /***/ "../../../src/math/angle/Normalize.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/Normalize.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/Normalize.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21405,9 +22837,9 @@ module.exports = Normalize; /***/ }), /***/ "../../../src/math/angle/Random.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/Random.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/Random.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21439,9 +22871,9 @@ module.exports = Random; /***/ }), /***/ "../../../src/math/angle/RandomDegrees.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/RandomDegrees.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/RandomDegrees.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21473,9 +22905,9 @@ module.exports = RandomDegrees; /***/ }), /***/ "../../../src/math/angle/Reverse.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/Reverse.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/Reverse.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21508,9 +22940,9 @@ module.exports = Reverse; /***/ }), /***/ "../../../src/math/angle/RotateTo.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/RotateTo.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/RotateTo.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21580,9 +23012,9 @@ module.exports = RotateTo; /***/ }), /***/ "../../../src/math/angle/ShortestBetween.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/ShortestBetween.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/ShortestBetween.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21634,9 +23066,9 @@ module.exports = ShortestBetween; /***/ }), /***/ "../../../src/math/angle/Wrap.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/Wrap.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/Wrap.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21671,9 +23103,9 @@ module.exports = Wrap; /***/ }), /***/ "../../../src/math/angle/WrapDegrees.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/WrapDegrees.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/WrapDegrees.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21708,9 +23140,9 @@ module.exports = WrapDegrees; /***/ }), /***/ "../../../src/math/angle/index.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/math/angle/index.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/angle/index.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -21746,9 +23178,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/const.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/math/const.js ***! - \********************************************/ +/*!*************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/const.js ***! + \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21843,9 +23275,9 @@ module.exports = MATH_CONST; /***/ }), /***/ "../../../src/math/distance/DistanceBetween.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/DistanceBetween.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceBetween.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21882,9 +23314,9 @@ module.exports = DistanceBetween; /***/ }), /***/ "../../../src/math/distance/DistanceBetweenPoints.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/DistanceBetweenPoints.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceBetweenPoints.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21919,9 +23351,9 @@ module.exports = DistanceBetweenPoints; /***/ }), /***/ "../../../src/math/distance/DistanceBetweenPointsSquared.js": -/*!****************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/DistanceBetweenPointsSquared.js ***! - \****************************************************************************/ +/*!*********************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceBetweenPointsSquared.js ***! + \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21956,9 +23388,9 @@ module.exports = DistanceBetweenPointsSquared; /***/ }), /***/ "../../../src/math/distance/DistanceChebyshev.js": -/*!*****************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/DistanceChebyshev.js ***! - \*****************************************************************/ +/*!**********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceChebyshev.js ***! + \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -21995,9 +23427,9 @@ module.exports = ChebyshevDistance; /***/ }), /***/ "../../../src/math/distance/DistancePower.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/DistancePower.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/DistancePower.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22034,9 +23466,9 @@ module.exports = DistancePower; /***/ }), /***/ "../../../src/math/distance/DistanceSnake.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/DistanceSnake.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceSnake.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22073,9 +23505,9 @@ module.exports = SnakeDistance; /***/ }), /***/ "../../../src/math/distance/DistanceSquared.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/DistanceSquared.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceSquared.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22112,9 +23544,9 @@ module.exports = DistanceSquared; /***/ }), /***/ "../../../src/math/distance/index.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/distance/index.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/distance/index.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -22144,9 +23576,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/back/In.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/back/In.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/back/In.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22180,9 +23612,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/back/InOut.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/back/InOut.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/back/InOut.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22225,9 +23657,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/back/Out.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/back/Out.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/back/Out.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22261,9 +23693,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/back/index.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/back/index.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/back/index.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -22289,9 +23721,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/bounce/In.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/bounce/In.js ***! - \*******************************************************/ +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/In.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22339,9 +23771,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/bounce/InOut.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/bounce/InOut.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/InOut.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22408,9 +23840,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/bounce/Out.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/bounce/Out.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/Out.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22456,9 +23888,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/bounce/index.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/bounce/index.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/index.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -22484,9 +23916,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/circular/In.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/circular/In.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/circular/In.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22517,9 +23949,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/circular/InOut.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/circular/InOut.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/circular/InOut.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22557,9 +23989,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/circular/Out.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/circular/Out.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/circular/Out.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22590,9 +24022,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/circular/index.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/circular/index.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/circular/index.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -22618,9 +24050,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/cubic/In.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/cubic/In.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/In.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22651,9 +24083,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/cubic/InOut.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/cubic/InOut.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/InOut.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22691,9 +24123,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/cubic/Out.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/cubic/Out.js ***! - \*******************************************************/ +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/Out.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22724,9 +24156,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/cubic/index.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/cubic/index.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/index.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -22752,9 +24184,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/elastic/In.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/elastic/In.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/In.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22812,9 +24244,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/elastic/InOut.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/elastic/InOut.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/InOut.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22879,9 +24311,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/elastic/Out.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/elastic/Out.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/Out.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -22939,9 +24371,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/elastic/index.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/elastic/index.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/index.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -22967,9 +24399,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/expo/In.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/expo/In.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/expo/In.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23000,9 +24432,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/expo/InOut.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/expo/InOut.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/expo/InOut.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23040,9 +24472,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/expo/Out.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/expo/Out.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/expo/Out.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23073,9 +24505,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/expo/index.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/expo/index.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/expo/index.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23101,9 +24533,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/index.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/index.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/index.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23138,9 +24570,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/linear/Linear.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/linear/Linear.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/linear/Linear.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23171,9 +24603,9 @@ module.exports = Linear; /***/ }), /***/ "../../../src/math/easing/linear/index.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/linear/index.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/linear/index.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23189,9 +24621,9 @@ module.exports = __webpack_require__(/*! ./Linear */ "../../../src/math/easing/l /***/ }), /***/ "../../../src/math/easing/quadratic/In.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quadratic/In.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/In.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23222,9 +24654,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/quadratic/InOut.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/InOut.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23262,9 +24694,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/quadratic/Out.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quadratic/Out.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/Out.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23295,9 +24727,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/quadratic/index.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quadratic/index.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/index.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23323,9 +24755,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/quartic/In.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quartic/In.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/In.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23356,9 +24788,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/quartic/InOut.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quartic/InOut.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/InOut.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23396,9 +24828,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/quartic/Out.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quartic/Out.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/Out.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23429,9 +24861,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/quartic/index.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quartic/index.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/index.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23457,9 +24889,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/quintic/In.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quintic/In.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/In.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23490,9 +24922,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/quintic/InOut.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quintic/InOut.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/InOut.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23530,9 +24962,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/quintic/Out.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quintic/Out.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/Out.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23563,9 +24995,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/quintic/index.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/quintic/index.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/index.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23591,9 +25023,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/sine/In.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/sine/In.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/sine/In.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23635,9 +25067,9 @@ module.exports = In; /***/ }), /***/ "../../../src/math/easing/sine/InOut.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/sine/InOut.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/sine/InOut.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23679,9 +25111,9 @@ module.exports = InOut; /***/ }), /***/ "../../../src/math/easing/sine/Out.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/sine/Out.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/sine/Out.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23723,9 +25155,9 @@ module.exports = Out; /***/ }), /***/ "../../../src/math/easing/sine/index.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/sine/index.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/sine/index.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23751,9 +25183,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/easing/stepped/Stepped.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/stepped/Stepped.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23798,9 +25230,9 @@ module.exports = Stepped; /***/ }), /***/ "../../../src/math/easing/stepped/index.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/easing/stepped/index.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/easing/stepped/index.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -23820,9 +25252,9 @@ module.exports = __webpack_require__(/*! ./Stepped */ "../../../src/math/easing/ /***/ }), /***/ "../../../src/math/fuzzy/Ceil.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/fuzzy/Ceil.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/fuzzy/Ceil.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23856,9 +25288,9 @@ module.exports = Ceil; /***/ }), /***/ "../../../src/math/fuzzy/Equal.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/math/fuzzy/Equal.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/fuzzy/Equal.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23895,9 +25327,9 @@ module.exports = Equal; /***/ }), /***/ "../../../src/math/fuzzy/Floor.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/math/fuzzy/Floor.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/fuzzy/Floor.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23931,9 +25363,9 @@ module.exports = Floor; /***/ }), /***/ "../../../src/math/fuzzy/GreaterThan.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/fuzzy/GreaterThan.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -23970,9 +25402,9 @@ module.exports = GreaterThan; /***/ }), /***/ "../../../src/math/fuzzy/LessThan.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/fuzzy/LessThan.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/fuzzy/LessThan.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -24009,9 +25441,9 @@ module.exports = LessThan; /***/ }), /***/ "../../../src/math/fuzzy/index.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/math/fuzzy/index.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/fuzzy/index.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24039,9 +25471,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/index.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/math/index.js ***! - \********************************************/ +/*!*************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/index.js ***! + \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24081,6 +25513,7 @@ var PhaserMath = { Clamp: __webpack_require__(/*! ./Clamp */ "../../../src/math/Clamp.js"), DegToRad: __webpack_require__(/*! ./DegToRad */ "../../../src/math/DegToRad.js"), Difference: __webpack_require__(/*! ./Difference */ "../../../src/math/Difference.js"), + Euler: __webpack_require__(/*! ./Euler */ "../../../src/math/Euler.js"), Factorial: __webpack_require__(/*! ./Factorial */ "../../../src/math/Factorial.js"), FloatBetween: __webpack_require__(/*! ./FloatBetween */ "../../../src/math/FloatBetween.js"), FloorTo: __webpack_require__(/*! ./FloorTo */ "../../../src/math/FloorTo.js"), @@ -24133,9 +25566,9 @@ module.exports = PhaserMath; /***/ }), /***/ "../../../src/math/interpolation/BezierInterpolation.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js ***! - \************************************************************************/ +/*!*****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/BezierInterpolation.js ***! + \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24177,9 +25610,9 @@ module.exports = BezierInterpolation; /***/ }), /***/ "../../../src/math/interpolation/CatmullRomInterpolation.js": -/*!****************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js ***! - \****************************************************************************/ +/*!*********************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/CatmullRomInterpolation.js ***! + \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24239,9 +25672,9 @@ module.exports = CatmullRomInterpolation; /***/ }), /***/ "../../../src/math/interpolation/CubicBezierInterpolation.js": -/*!*****************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js ***! - \*****************************************************************************/ +/*!**********************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/CubicBezierInterpolation.js ***! + \**********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -24314,9 +25747,9 @@ module.exports = CubicBezierInterpolation; /***/ }), /***/ "../../../src/math/interpolation/LinearInterpolation.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js ***! - \************************************************************************/ +/*!*****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/LinearInterpolation.js ***! + \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24366,9 +25799,9 @@ module.exports = LinearInterpolation; /***/ }), /***/ "../../../src/math/interpolation/QuadraticBezierInterpolation.js": -/*!*********************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js ***! - \*********************************************************************************/ +/*!**************************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/QuadraticBezierInterpolation.js ***! + \**************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -24430,9 +25863,9 @@ module.exports = QuadraticBezierInterpolation; /***/ }), /***/ "../../../src/math/interpolation/SmoothStepInterpolation.js": -/*!****************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js ***! - \****************************************************************************/ +/*!*********************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/SmoothStepInterpolation.js ***! + \*********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24468,9 +25901,9 @@ module.exports = SmoothStepInterpolation; /***/ }), /***/ "../../../src/math/interpolation/SmootherStepInterpolation.js": -/*!******************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js ***! - \******************************************************************************/ +/*!***********************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/SmootherStepInterpolation.js ***! + \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24506,9 +25939,9 @@ module.exports = SmootherStepInterpolation; /***/ }), /***/ "../../../src/math/interpolation/index.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/interpolation/index.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/interpolation/index.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24538,9 +25971,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/pow2/GetPowerOfTwo.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/pow2/GetPowerOfTwo.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -24558,7 +25991,7 @@ module.exports = { * * @param {number} value - The value. * - * @return {integer} The nearest power of 2 to `value`. + * @return {number} The nearest power of 2 to `value`. */ var GetPowerOfTwo = function (value) { @@ -24573,9 +26006,9 @@ module.exports = GetPowerOfTwo; /***/ }), /***/ "../../../src/math/pow2/IsSizePowerOfTwo.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/pow2/IsSizePowerOfTwo.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -24608,9 +26041,9 @@ module.exports = IsSizePowerOfTwo; /***/ }), /***/ "../../../src/math/pow2/IsValuePowerOfTwo.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/pow2/IsValuePowerOfTwo.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -24641,9 +26074,9 @@ module.exports = IsValuePowerOfTwo; /***/ }), /***/ "../../../src/math/pow2/index.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/pow2/index.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/pow2/index.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -24669,9 +26102,9 @@ module.exports = { /***/ }), /***/ "../../../src/math/random-data-generator/RandomDataGenerator.js": -/*!********************************************************************************!*\ - !*** D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js ***! - \********************************************************************************/ +/*!*************************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/random-data-generator/RandomDataGenerator.js ***! + \*************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -25184,9 +26617,9 @@ module.exports = RandomDataGenerator; /***/ }), /***/ "../../../src/math/snap/SnapCeil.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/snap/SnapCeil.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/snap/SnapCeil.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -25233,9 +26666,9 @@ module.exports = SnapCeil; /***/ }), /***/ "../../../src/math/snap/SnapFloor.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/math/snap/SnapFloor.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/snap/SnapFloor.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -25282,9 +26715,9 @@ module.exports = SnapFloor; /***/ }), /***/ "../../../src/math/snap/SnapTo.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/math/snap/SnapTo.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/snap/SnapTo.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -25330,9 +26763,9 @@ module.exports = SnapTo; /***/ }), /***/ "../../../src/math/snap/index.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/math/snap/index.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/math/snap/index.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -25358,9 +26791,9 @@ module.exports = { /***/ }), /***/ "../../../src/plugins/BasePlugin.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/plugins/BasePlugin.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/plugins/BasePlugin.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -25493,9 +26926,9 @@ module.exports = BasePlugin; /***/ }), /***/ "../../../src/plugins/ScenePlugin.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/plugins/ScenePlugin.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/plugins/ScenePlugin.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -25626,9 +27059,9 @@ module.exports = ScenePlugin; /***/ }), /***/ "../../../src/renderer/BlendModes.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/renderer/BlendModes.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/renderer/BlendModes.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -25651,7 +27084,7 @@ module.exports = { * Skips the Blend Mode check in the renderer. * * @name Phaser.BlendModes.SKIP_CHECK - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25662,7 +27095,7 @@ module.exports = { * This is the default setting and draws new shapes on top of the existing canvas content. * * @name Phaser.BlendModes.NORMAL - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25673,7 +27106,7 @@ module.exports = { * Where both shapes overlap the color is determined by adding color values. * * @name Phaser.BlendModes.ADD - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25684,7 +27117,7 @@ module.exports = { * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. * * @name Phaser.BlendModes.MULTIPLY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25695,7 +27128,7 @@ module.exports = { * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) * * @name Phaser.BlendModes.SCREEN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25706,7 +27139,7 @@ module.exports = { * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. * * @name Phaser.BlendModes.OVERLAY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25717,7 +27150,7 @@ module.exports = { * Retains the darkest pixels of both layers. * * @name Phaser.BlendModes.DARKEN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25728,7 +27161,7 @@ module.exports = { * Retains the lightest pixels of both layers. * * @name Phaser.BlendModes.LIGHTEN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25739,7 +27172,7 @@ module.exports = { * Divides the bottom layer by the inverted top layer. * * @name Phaser.BlendModes.COLOR_DODGE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25750,7 +27183,7 @@ module.exports = { * Divides the inverted bottom layer by the top layer, and then inverts the result. * * @name Phaser.BlendModes.COLOR_BURN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25761,7 +27194,7 @@ module.exports = { * A combination of multiply and screen like overlay, but with top and bottom layer swapped. * * @name Phaser.BlendModes.HARD_LIGHT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25772,7 +27205,7 @@ module.exports = { * A softer version of hard-light. Pure black or white does not result in pure black or white. * * @name Phaser.BlendModes.SOFT_LIGHT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25783,7 +27216,7 @@ module.exports = { * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. * * @name Phaser.BlendModes.DIFFERENCE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25794,7 +27227,7 @@ module.exports = { * Like difference, but with lower contrast. * * @name Phaser.BlendModes.EXCLUSION - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25805,7 +27238,7 @@ module.exports = { * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. * * @name Phaser.BlendModes.HUE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25816,7 +27249,7 @@ module.exports = { * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. * * @name Phaser.BlendModes.SATURATION - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25827,7 +27260,7 @@ module.exports = { * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. * * @name Phaser.BlendModes.COLOR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25838,7 +27271,7 @@ module.exports = { * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. * * @name Phaser.BlendModes.LUMINOSITY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25848,7 +27281,7 @@ module.exports = { * Alpha erase blend mode. For Canvas and WebGL. * * @name Phaser.BlendModes.ERASE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25859,7 +27292,7 @@ module.exports = { * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. * * @name Phaser.BlendModes.SOURCE_IN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25870,7 +27303,7 @@ module.exports = { * The new shape is drawn where it doesn't overlap the existing canvas content. * * @name Phaser.BlendModes.SOURCE_OUT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25881,7 +27314,7 @@ module.exports = { * The new shape is only drawn where it overlaps the existing canvas content. * * @name Phaser.BlendModes.SOURCE_ATOP - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25892,7 +27325,7 @@ module.exports = { * New shapes are drawn behind the existing canvas content. * * @name Phaser.BlendModes.DESTINATION_OVER - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25903,7 +27336,7 @@ module.exports = { * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. * * @name Phaser.BlendModes.DESTINATION_IN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25914,7 +27347,7 @@ module.exports = { * The existing content is kept where it doesn't overlap the new shape. * * @name Phaser.BlendModes.DESTINATION_OUT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25925,7 +27358,7 @@ module.exports = { * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. * * @name Phaser.BlendModes.DESTINATION_ATOP - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25936,7 +27369,7 @@ module.exports = { * Where both shapes overlap the color is determined by adding color values. * * @name Phaser.BlendModes.LIGHTER - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25947,7 +27380,7 @@ module.exports = { * Only the new shape is shown. * * @name Phaser.BlendModes.COPY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25958,7 +27391,7 @@ module.exports = { * Shapes are made transparent where both overlap and drawn normal everywhere else. * * @name Phaser.BlendModes.XOR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -25967,12 +27400,157 @@ module.exports = { }; +/***/ }), + +/***/ "../../../src/renderer/events/POST_RENDER_EVENT.js": +/*!************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/renderer/events/POST_RENDER_EVENT.js ***! + \************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Post-Render Event. + * + * This event is dispatched by the Renderer when all rendering, for all cameras in all Scenes, + * has completed, but before any pending snap shots have been taken. + * + * @event Phaser.Renderer.Events#POST_RENDER + * @since 3.50.0 + */ +module.exports = 'postrender'; + + +/***/ }), + +/***/ "../../../src/renderer/events/PRE_RENDER_EVENT.js": +/*!***********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/renderer/events/PRE_RENDER_EVENT.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pre-Render Event. + * + * This event is dispatched by the Phaser Renderer. This happens right at the start of the render + * process, after the context has been cleared, the scissors enabled (WebGL only) and everything has been + * reset ready for the render. + * + * @event Phaser.Renderer.Events#PRE_RENDER + * @since 3.50.0 + */ +module.exports = 'prerender'; + + +/***/ }), + +/***/ "../../../src/renderer/events/RENDER_EVENT.js": +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/renderer/events/RENDER_EVENT.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Render Event. + * + * This event is dispatched by the Phaser Renderer for every camera in every Scene. + * + * It is dispatched before any of the children in the Scene have been rendered. + * + * @event Phaser.Renderer.Events#RENDER + * @since 3.50.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered. + */ +module.exports = 'render'; + + +/***/ }), + +/***/ "../../../src/renderer/events/RESIZE_EVENT.js": +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/renderer/events/RESIZE_EVENT.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Renderer Resize Event. + * + * This event is dispatched by the Phaser Renderer when it is resized, usually as a result + * of the Scale Manager resizing. + * + * @event Phaser.Renderer.Events#RESIZE + * @since 3.50.0 + * + * @param {number} width - The new width of the renderer. + * @param {number} height - The new height of the renderer. + */ +module.exports = 'resize'; + + +/***/ }), + +/***/ "../../../src/renderer/events/index.js": +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/renderer/events/index.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.Events + */ + +module.exports = { + + POST_RENDER: __webpack_require__(/*! ./POST_RENDER_EVENT */ "../../../src/renderer/events/POST_RENDER_EVENT.js"), + PRE_RENDER: __webpack_require__(/*! ./PRE_RENDER_EVENT */ "../../../src/renderer/events/PRE_RENDER_EVENT.js"), + RENDER: __webpack_require__(/*! ./RENDER_EVENT */ "../../../src/renderer/events/RENDER_EVENT.js"), + RESIZE: __webpack_require__(/*! ./RESIZE_EVENT */ "../../../src/renderer/events/RESIZE_EVENT.js") + +}; + + /***/ }), /***/ "../../../src/renderer/webgl/pipelines/const.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/renderer/webgl/pipelines/const.js ***! - \****************************************************************/ +/*!*********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/renderer/webgl/pipelines/const.js ***! + \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26004,6 +27582,16 @@ var PIPELINE_CONST = { */ LIGHT_PIPELINE: 'Light2D', + /** + * The Point Light Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.POINTLIGHT_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + POINTLIGHT_PIPELINE: 'PointLightPipeline', + /** * The Single Texture Pipeline. * @@ -26032,8 +27620,37 @@ var PIPELINE_CONST = { * @const * @since 3.50.0 */ - ROPE_PIPELINE: 'RopePipeline' + ROPE_PIPELINE: 'RopePipeline', + /** + * The Graphics and Shapes Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.GRAPHICS_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + GRAPHICS_PIPELINE: 'GraphicsPipeline', + + /** + * The Post FX Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.POSTFX_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + POSTFX_PIPELINE: 'PostFXPipeline', + + /** + * The Utility Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.UTILITY_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + UTILITY_PIPELINE: 'UtilityPipeline' }; module.exports = PIPELINE_CONST; @@ -26042,9 +27659,9 @@ module.exports = PIPELINE_CONST; /***/ }), /***/ "../../../src/scale/events/RESIZE_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scale/events/RESIZE_EVENT.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26056,7 +27673,7 @@ module.exports = PIPELINE_CONST; /** * The Scale Manager Resize Event. - * + * * This event is dispatched whenever the Scale Manager detects a resize event from the browser. * It sends three parameters to the callback, each of them being Size components. You can read * the `width`, `height`, `aspectRatio` and other properties of these components to help with @@ -26064,11 +27681,10 @@ module.exports = PIPELINE_CONST; * * @event Phaser.Scale.Events#RESIZE * @since 3.16.1 - * + * * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} resolution - The current resolution. Defaults to 1 at the moment. * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. */ @@ -26078,9 +27694,9 @@ module.exports = 'resize'; /***/ }), /***/ "../../../src/scene/events/ADDED_TO_SCENE_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/ADDED_TO_SCENE_EVENT.js ***! - \*******************************************************************/ +/*!************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/ADDED_TO_SCENE_EVENT.js ***! + \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26109,9 +27725,9 @@ module.exports = 'addedtoscene'; /***/ }), /***/ "../../../src/scene/events/BOOT_EVENT.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/BOOT_EVENT.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26139,9 +27755,9 @@ module.exports = 'boot'; /***/ }), /***/ "../../../src/scene/events/CREATE_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/CREATE_EVENT.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26173,9 +27789,9 @@ module.exports = 'create'; /***/ }), /***/ "../../../src/scene/events/DESTROY_EVENT.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/DESTROY_EVENT.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26205,9 +27821,9 @@ module.exports = 'destroy'; /***/ }), /***/ "../../../src/scene/events/PAUSE_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/PAUSE_EVENT.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26237,9 +27853,9 @@ module.exports = 'pause'; /***/ }), /***/ "../../../src/scene/events/POST_UPDATE_EVENT.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js ***! - \****************************************************************/ +/*!*********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/POST_UPDATE_EVENT.js ***! + \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26279,9 +27895,9 @@ module.exports = 'postupdate'; /***/ }), /***/ "../../../src/scene/events/PRE_UPDATE_EVENT.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/PRE_UPDATE_EVENT.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26321,9 +27937,9 @@ module.exports = 'preupdate'; /***/ }), /***/ "../../../src/scene/events/READY_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/READY_EVENT.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/READY_EVENT.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26354,9 +27970,9 @@ module.exports = 'ready'; /***/ }), /***/ "../../../src/scene/events/REMOVED_FROM_SCENE_EVENT.js": -/*!***********************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/REMOVED_FROM_SCENE_EVENT.js ***! - \***********************************************************************/ +/*!****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/REMOVED_FROM_SCENE_EVENT.js ***! + \****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26385,9 +28001,9 @@ module.exports = 'removedfromscene'; /***/ }), /***/ "../../../src/scene/events/RENDER_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/RENDER_EVENT.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26426,9 +28042,9 @@ module.exports = 'render'; /***/ }), /***/ "../../../src/scene/events/RESUME_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/RESUME_EVENT.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26458,9 +28074,9 @@ module.exports = 'resume'; /***/ }), /***/ "../../../src/scene/events/SHUTDOWN_EVENT.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/SHUTDOWN_EVENT.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26493,9 +28109,9 @@ module.exports = 'shutdown'; /***/ }), /***/ "../../../src/scene/events/SLEEP_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/SLEEP_EVENT.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26525,9 +28141,9 @@ module.exports = 'sleep'; /***/ }), /***/ "../../../src/scene/events/START_EVENT.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/START_EVENT.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/START_EVENT.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26555,9 +28171,9 @@ module.exports = 'start'; /***/ }), /***/ "../../../src/scene/events/TRANSITION_COMPLETE_EVENT.js": -/*!************************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js ***! - \************************************************************************/ +/*!*****************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js ***! + \*****************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26596,9 +28212,9 @@ module.exports = 'transitioncomplete'; /***/ }), /***/ "../../../src/scene/events/TRANSITION_INIT_EVENT.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js ***! - \********************************************************************/ +/*!*************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_INIT_EVENT.js ***! + \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26638,9 +28254,9 @@ module.exports = 'transitioninit'; /***/ }), /***/ "../../../src/scene/events/TRANSITION_OUT_EVENT.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js ***! - \*******************************************************************/ +/*!************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_OUT_EVENT.js ***! + \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26677,9 +28293,9 @@ module.exports = 'transitionout'; /***/ }), /***/ "../../../src/scene/events/TRANSITION_START_EVENT.js": -/*!*********************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js ***! - \*********************************************************************/ +/*!**************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_START_EVENT.js ***! + \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26722,9 +28338,9 @@ module.exports = 'transitionstart'; /***/ }), /***/ "../../../src/scene/events/TRANSITION_WAKE_EVENT.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js ***! - \********************************************************************/ +/*!*************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js ***! + \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26762,9 +28378,9 @@ module.exports = 'transitionwake'; /***/ }), /***/ "../../../src/scene/events/UPDATE_EVENT.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/UPDATE_EVENT.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26804,9 +28420,9 @@ module.exports = 'update'; /***/ }), /***/ "../../../src/scene/events/WAKE_EVENT.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/WAKE_EVENT.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26836,9 +28452,9 @@ module.exports = 'wake'; /***/ }), /***/ "../../../src/scene/events/index.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/scene/events/index.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/scene/events/index.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -26882,9 +28498,9 @@ module.exports = { /***/ }), /***/ "../../../src/tweens/builders/GetBoolean.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/tweens/builders/GetBoolean.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/tweens/builders/GetBoolean.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26928,9 +28544,9 @@ module.exports = GetBoolean; /***/ }), /***/ "../../../src/tweens/tween/const.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/tweens/tween/const.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/tweens/tween/const.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -26946,7 +28562,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.CREATED - * @type {integer} + * @type {number} * @since 3.0.0 */ CREATED: 0, @@ -26955,7 +28571,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.INIT - * @type {integer} + * @type {number} * @since 3.0.0 */ INIT: 1, @@ -26964,7 +28580,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ DELAY: 2, @@ -26973,7 +28589,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.OFFSET_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ OFFSET_DELAY: 3, @@ -26982,7 +28598,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PENDING_RENDER - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_RENDER: 4, @@ -26991,7 +28607,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_FORWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_FORWARD: 5, @@ -27000,7 +28616,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_BACKWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_BACKWARD: 6, @@ -27009,7 +28625,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.HOLD_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ HOLD_DELAY: 7, @@ -27018,7 +28634,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.REPEAT_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ REPEAT_DELAY: 8, @@ -27027,7 +28643,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE: 9, @@ -27038,7 +28654,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_ADD - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_ADD: 20, @@ -27047,7 +28663,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PAUSED - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSED: 21, @@ -27056,7 +28672,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.LOOP_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ LOOP_DELAY: 22, @@ -27065,7 +28681,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.ACTIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ ACTIVE: 23, @@ -27074,7 +28690,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.COMPLETE_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE_DELAY: 24, @@ -27083,7 +28699,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_REMOVE - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_REMOVE: 25, @@ -27092,7 +28708,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.REMOVED - * @type {integer} + * @type {number} * @since 3.0.0 */ REMOVED: 26 @@ -27105,9 +28721,9 @@ module.exports = TWEEN_CONST; /***/ }), /***/ "../../../src/utils/Class.js": -/*!*********************************************!*\ - !*** D:/wamp/www/phaser/src/utils/Class.js ***! - \*********************************************/ +/*!**************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/Class.js ***! + \**************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -27183,6 +28799,7 @@ function hasNonConfigurable (obj, k) * Extends the given `myClass` object's prototype with the properties of `definition`. * * @function extend + * @ignore * @param {Object} ctor The constructor object to mix into. * @param {Object} definition A dictionary of functions for the class. * @param {boolean} isClassDescriptor Is the definition a class descriptor? @@ -27234,6 +28851,7 @@ function extend (ctor, definition, isClassDescriptor, extend) * Applies the given `mixins` to the prototype of `myClass`. * * @function mixin + * @ignore * @param {Object} myClass The constructor object to mix into. * @param {Object|Array} mixins The mixins to apply to the constructor. */ @@ -27364,9 +28982,9 @@ module.exports = Class; /***/ }), /***/ "../../../src/utils/NOOP.js": -/*!********************************************!*\ - !*** D:/wamp/www/phaser/src/utils/NOOP.js ***! - \********************************************/ +/*!*************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/NOOP.js ***! + \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -27396,9 +29014,9 @@ module.exports = NOOP; /***/ }), /***/ "../../../src/utils/array/Add.js": -/*!*************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/Add.js ***! - \*************************************************/ +/*!******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/Add.js ***! + \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -27425,7 +29043,7 @@ module.exports = NOOP; * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -27518,9 +29136,9 @@ module.exports = Add; /***/ }), /***/ "../../../src/utils/array/AddAt.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/AddAt.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/AddAt.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -27549,8 +29167,8 @@ module.exports = Add; * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. - * @param {integer} [index=0] - The index in the array where the item will be inserted. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [index=0] - The index in the array where the item will be inserted. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -27645,9 +29263,9 @@ module.exports = AddAt; /***/ }), /***/ "../../../src/utils/array/BringToTop.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/BringToTop.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/BringToTop.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -27688,9 +29306,9 @@ module.exports = BringToTop; /***/ }), /***/ "../../../src/utils/array/CountAllMatching.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/CountAllMatching.js ***! - \**************************************************************/ +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/CountAllMatching.js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -27711,10 +29329,10 @@ var SafeRange = __webpack_require__(/*! ./SafeRange */ "../../../src/utils/array * @param {array} array - The array to search. * @param {string} property - The property to test on each array element. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * - * @return {integer} The total number of elements with properties matching the given value. + * @return {number} The total number of elements with properties matching the given value. */ var CountAllMatching = function (array, property, value, startIndex, endIndex) { @@ -27745,9 +29363,9 @@ module.exports = CountAllMatching; /***/ }), /***/ "../../../src/utils/array/Each.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/Each.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/Each.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -27796,9 +29414,9 @@ module.exports = Each; /***/ }), /***/ "../../../src/utils/array/EachInRange.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/EachInRange.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/EachInRange.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -27819,8 +29437,8 @@ var SafeRange = __webpack_require__(/*! ./SafeRange */ "../../../src/utils/array * @param {array} array - The array to search. * @param {function} callback - A callback to be invoked for each item in the array. * @param {object} context - The context in which the callback is invoked. - * @param {integer} startIndex - The start index to search from. - * @param {integer} endIndex - The end index to search to. + * @param {number} startIndex - The start index to search from. + * @param {number} endIndex - The end index to search to. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. * * @return {array} The input array. @@ -27857,9 +29475,9 @@ module.exports = EachInRange; /***/ }), /***/ "../../../src/utils/array/FindClosestInSorted.js": -/*!*****************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/FindClosestInSorted.js ***! - \*****************************************************************/ +/*!**********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/FindClosestInSorted.js ***! + \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -27946,9 +29564,9 @@ module.exports = FindClosestInSorted; /***/ }), /***/ "../../../src/utils/array/GetAll.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/GetAll.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/GetAll.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -27977,8 +29595,8 @@ var SafeRange = __webpack_require__(/*! ./SafeRange */ "../../../src/utils/array * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} All matching elements from the array. */ @@ -28013,9 +29631,9 @@ module.exports = GetAll; /***/ }), /***/ "../../../src/utils/array/GetFirst.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/GetFirst.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/GetFirst.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -28043,8 +29661,8 @@ var SafeRange = __webpack_require__(/*! ./SafeRange */ "../../../src/utils/array * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=array.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) * * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. */ @@ -28077,9 +29695,9 @@ module.exports = GetFirst; /***/ }), /***/ "../../../src/utils/array/GetRandom.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/GetRandom.js ***! - \*******************************************************/ +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/GetRandom.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -28096,8 +29714,8 @@ module.exports = GetFirst; * @since 3.0.0 * * @param {array} array - The array to select the random entry from. - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {*} A random element from the array, or `null` if no element could be found in the range given. */ @@ -28117,9 +29735,9 @@ module.exports = GetRandom; /***/ }), /***/ "../../../src/utils/array/MoveDown.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/MoveDown.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/MoveDown.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -28164,9 +29782,9 @@ module.exports = MoveDown; /***/ }), /***/ "../../../src/utils/array/MoveTo.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/MoveTo.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/MoveTo.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -28185,7 +29803,7 @@ module.exports = MoveDown; * * @param {array} array - The array. * @param {*} item - The element to move. - * @param {integer} index - The new index that the element will be moved to. + * @param {number} index - The new index that the element will be moved to. * * @return {*} The element that was moved. */ @@ -28216,9 +29834,9 @@ module.exports = MoveTo; /***/ }), /***/ "../../../src/utils/array/MoveUp.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/MoveUp.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/MoveUp.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -28263,9 +29881,9 @@ module.exports = MoveUp; /***/ }), /***/ "../../../src/utils/array/NumberArray.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/NumberArray.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/NumberArray.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -28361,9 +29979,9 @@ module.exports = NumberArray; /***/ }), /***/ "../../../src/utils/array/NumberArrayStep.js": -/*!*************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/NumberArrayStep.js ***! - \*************************************************************/ +/*!******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/NumberArrayStep.js ***! + \******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -28443,9 +30061,9 @@ module.exports = NumberArrayStep; /***/ }), /***/ "../../../src/utils/array/QuickSelect.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/QuickSelect.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/QuickSelect.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -28487,9 +30105,9 @@ function defaultCompare (a, b) * @since 3.0.0 * * @param {array} arr - The array to sort. - * @param {integer} k - The k-th element index. - * @param {integer} [left=0] - The index of the left part of the range. - * @param {integer} [right] - The index of the right part of the range. + * @param {number} k - The k-th element index. + * @param {number} [left=0] - The index of the left part of the range. + * @param {number} [right] - The index of the right part of the range. * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. */ var QuickSelect = function (arr, k, left, right, compare) @@ -28570,9 +30188,9 @@ module.exports = QuickSelect; /***/ }), /***/ "../../../src/utils/array/Range.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/Range.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/Range.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -28713,9 +30331,9 @@ module.exports = Range; /***/ }), /***/ "../../../src/utils/array/Remove.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/Remove.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/Remove.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -28729,9 +30347,9 @@ var SpliceOne = __webpack_require__(/*! ./SpliceOne */ "../../../src/utils/array /** * Removes the given item, or array of items, from the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for each item successfully removed from the array. * * @function Phaser.Utils.Array.Remove @@ -28775,6 +30393,7 @@ var Remove = function (array, item, callback, context) // If we got this far, we have an array of items to remove var itemLength = item.length - 1; + var removed = []; while (itemLength >= 0) { @@ -28786,21 +30405,18 @@ var Remove = function (array, item, callback, context) { SpliceOne(array, index); + removed.push(entry); + if (callback) { callback.call(context, entry); } } - else - { - // Item wasn't found in the array, so remove it from our return results - item.pop(); - } itemLength--; } - return item; + return removed; }; module.exports = Remove; @@ -28809,9 +30425,9 @@ module.exports = Remove; /***/ }), /***/ "../../../src/utils/array/RemoveAt.js": -/*!******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/RemoveAt.js ***! - \******************************************************/ +/*!***********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/RemoveAt.js ***! + \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -28834,7 +30450,7 @@ var SpliceOne = __webpack_require__(/*! ./SpliceOne */ "../../../src/utils/array * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -28865,9 +30481,9 @@ module.exports = RemoveAt; /***/ }), /***/ "../../../src/utils/array/RemoveBetween.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/RemoveBetween.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/RemoveBetween.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -28890,8 +30506,8 @@ var SafeRange = __webpack_require__(/*! ./SafeRange */ "../../../src/utils/array * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} startIndex - The start index to remove from. - * @param {integer} endIndex - The end index to remove to. + * @param {number} startIndex - The start index to remove from. + * @param {number} endIndex - The end index to remove to. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * @@ -28933,9 +30549,9 @@ module.exports = RemoveBetween; /***/ }), /***/ "../../../src/utils/array/RemoveRandomElement.js": -/*!*****************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/RemoveRandomElement.js ***! - \*****************************************************************/ +/*!**********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/RemoveRandomElement.js ***! + \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -28955,8 +30571,8 @@ var SpliceOne = __webpack_require__(/*! ./SpliceOne */ "../../../src/utils/array * @since 3.0.0 * * @param {array} array - The array to removed a random element from. - * @param {integer} [start=0] - The array index to start the search from. - * @param {integer} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * @param {number} [start=0] - The array index to start the search from. + * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. * * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. */ @@ -28976,9 +30592,9 @@ module.exports = RemoveRandomElement; /***/ }), /***/ "../../../src/utils/array/Replace.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/Replace.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/Replace.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29025,9 +30641,9 @@ module.exports = Replace; /***/ }), /***/ "../../../src/utils/array/RotateLeft.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/RotateLeft.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/RotateLeft.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29045,7 +30661,7 @@ module.exports = Replace; * @since 3.0.0 * * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. + * @param {number} [total=1] - The number of times to shift the array. * * @return {*} The most recently shifted element. */ @@ -29070,9 +30686,9 @@ module.exports = RotateLeft; /***/ }), /***/ "../../../src/utils/array/RotateRight.js": -/*!*********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/RotateRight.js ***! - \*********************************************************/ +/*!**************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/RotateRight.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29090,7 +30706,7 @@ module.exports = RotateLeft; * @since 3.0.0 * * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. + * @param {number} [total=1] - The number of times to shift the array. * * @return {*} The most recently shifted element. */ @@ -29115,9 +30731,9 @@ module.exports = RotateRight; /***/ }), /***/ "../../../src/utils/array/SafeRange.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/SafeRange.js ***! - \*******************************************************/ +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/SafeRange.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29134,8 +30750,8 @@ module.exports = RotateRight; * @since 3.4.0 * * @param {array} array - The array to check. - * @param {integer} startIndex - The start index. - * @param {integer} endIndex - The end index. + * @param {number} startIndex - The start index. + * @param {number} endIndex - The end index. * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. * * @return {boolean} True if the range is safe, otherwise false. @@ -29169,9 +30785,9 @@ module.exports = SafeRange; /***/ }), /***/ "../../../src/utils/array/SendToBack.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/SendToBack.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/SendToBack.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29212,9 +30828,9 @@ module.exports = SendToBack; /***/ }), /***/ "../../../src/utils/array/SetAll.js": -/*!****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/SetAll.js ***! - \****************************************************/ +/*!*********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/SetAll.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -29240,8 +30856,8 @@ var SafeRange = __webpack_require__(/*! ./SafeRange */ "../../../src/utils/array * @param {array} array - The array to search. * @param {string} property - The property to test for on each array element. * @param {*} value - The value to set the property to. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} The input array. */ @@ -29272,9 +30888,9 @@ module.exports = SetAll; /***/ }), /***/ "../../../src/utils/array/Shuffle.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/Shuffle.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/Shuffle.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29318,9 +30934,9 @@ module.exports = Shuffle; /***/ }), /***/ "../../../src/utils/array/SortByDigits.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/SortByDigits.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/SortByDigits.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29361,9 +30977,9 @@ module.exports = SortByDigits; /***/ }), /***/ "../../../src/utils/array/SpliceOne.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/SpliceOne.js ***! - \*******************************************************/ +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/SpliceOne.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29381,7 +30997,7 @@ module.exports = SortByDigits; * @since 3.0.0 * * @param {array} array - The array to splice from. - * @param {integer} index - The index of the item which should be spliced. + * @param {number} index - The index of the item which should be spliced. * * @return {*} The item which was spliced (removed). */ @@ -29412,9 +31028,9 @@ module.exports = SpliceOne; /***/ }), /***/ "../../../src/utils/array/StableSort.js": -/*!********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/StableSort.js ***! - \********************************************************/ +/*!*************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/StableSort.js ***! + \*************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29593,9 +31209,9 @@ module.exports = StableSort; /***/ }), /***/ "../../../src/utils/array/Swap.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/Swap.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/Swap.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29646,9 +31262,9 @@ module.exports = Swap; /***/ }), /***/ "../../../src/utils/array/index.js": -/*!***************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/index.js ***! - \***************************************************/ +/*!********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/index.js ***! + \********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -29705,9 +31321,9 @@ module.exports = { /***/ }), /***/ "../../../src/utils/array/matrix/CheckMatrix.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/CheckMatrix.js ***! - \****************************************************************/ +/*!*********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/CheckMatrix.js ***! + \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29720,22 +31336,23 @@ module.exports = { /** * Checks if an array can be used as a matrix. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: * * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] * ``` * * @function Phaser.Utils.Array.Matrix.CheckMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [matrix] * @@ -29771,9 +31388,9 @@ module.exports = CheckMatrix; /***/ }), /***/ "../../../src/utils/array/matrix/MatrixToString.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/MatrixToString.js ***! - \*******************************************************************/ +/*!************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/MatrixToString.js ***! + \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -29789,6 +31406,20 @@ var CheckMatrix = __webpack_require__(/*! ./CheckMatrix */ "../../../src/utils/a /** * Generates a string (which you can pass to console.log) from the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * @@ -29857,9 +31488,9 @@ module.exports = MatrixToString; /***/ }), /***/ "../../../src/utils/array/matrix/ReverseColumns.js": -/*!*******************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/ReverseColumns.js ***! - \*******************************************************************/ +/*!************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/ReverseColumns.js ***! + \************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29872,6 +31503,20 @@ module.exports = MatrixToString; /** * Reverses the columns in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * @@ -29893,9 +31538,9 @@ module.exports = ReverseColumns; /***/ }), /***/ "../../../src/utils/array/matrix/ReverseRows.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/ReverseRows.js ***! - \****************************************************************/ +/*!*********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/ReverseRows.js ***! + \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -29908,6 +31553,20 @@ module.exports = ReverseColumns; /** * Reverses the rows in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseRows * @since 3.0.0 * @@ -29934,9 +31593,9 @@ module.exports = ReverseRows; /***/ }), /***/ "../../../src/utils/array/matrix/Rotate180.js": -/*!**************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/Rotate180.js ***! - \**************************************************************/ +/*!*******************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/Rotate180.js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -29951,6 +31610,20 @@ var RotateMatrix = __webpack_require__(/*! ./RotateMatrix */ "../../../src/utils /** * Rotates the array matrix 180 degrees. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.Rotate180 * @since 3.0.0 * @@ -29972,9 +31645,9 @@ module.exports = Rotate180; /***/ }), /***/ "../../../src/utils/array/matrix/RotateLeft.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/RotateLeft.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/RotateLeft.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -29989,6 +31662,20 @@ var RotateMatrix = __webpack_require__(/*! ./RotateMatrix */ "../../../src/utils /** * Rotates the array matrix to the left (or 90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateLeft * @since 3.0.0 * @@ -30010,9 +31697,9 @@ module.exports = RotateLeft; /***/ }), /***/ "../../../src/utils/array/matrix/RotateMatrix.js": -/*!*****************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/RotateMatrix.js ***! - \*****************************************************************/ +/*!**********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/RotateMatrix.js ***! + \**********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -30033,6 +31720,20 @@ var TransposeMatrix = __webpack_require__(/*! ./TransposeMatrix */ "../../../src * * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateMatrix * @since 3.0.0 * @@ -30087,9 +31788,9 @@ module.exports = RotateMatrix; /***/ }), /***/ "../../../src/utils/array/matrix/RotateRight.js": -/*!****************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/RotateRight.js ***! - \****************************************************************/ +/*!*********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/RotateRight.js ***! + \*********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -30104,6 +31805,20 @@ var RotateMatrix = __webpack_require__(/*! ./RotateMatrix */ "../../../src/utils /** * Rotates the array matrix to the left (or -90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateRight * @since 3.0.0 * @@ -30122,12 +31837,106 @@ var RotateRight = function (matrix) module.exports = RotateRight; +/***/ }), + +/***/ "../../../src/utils/array/matrix/TranslateMatrix.js": +/*!*************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/TranslateMatrix.js ***! + \*************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(/*! ../RotateLeft */ "../../../src/utils/array/RotateLeft.js"); +var RotateRight = __webpack_require__(/*! ../RotateRight */ "../../../src/utils/array/RotateRight.js"); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + /***/ }), /***/ "../../../src/utils/array/matrix/TransposeMatrix.js": -/*!********************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/TransposeMatrix.js ***! - \********************************************************************/ +/*!*************************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/TransposeMatrix.js ***! + \*************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -30142,12 +31951,26 @@ module.exports = RotateRight; * * The transpose of a matrix is a new matrix whose rows are the columns of the original. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.TransposeMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [array,$return] - * + * * @param {T[][]} [array] - The array matrix to transpose. * * @return {T[][]} A new array matrix which is a transposed version of the given array. @@ -30178,9 +32001,9 @@ module.exports = TransposeMatrix; /***/ }), /***/ "../../../src/utils/array/matrix/index.js": -/*!**********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/array/matrix/index.js ***! - \**********************************************************/ +/*!***************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/index.js ***! + \***************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -30204,17 +32027,72 @@ module.exports = { RotateLeft: __webpack_require__(/*! ./RotateLeft */ "../../../src/utils/array/matrix/RotateLeft.js"), RotateMatrix: __webpack_require__(/*! ./RotateMatrix */ "../../../src/utils/array/matrix/RotateMatrix.js"), RotateRight: __webpack_require__(/*! ./RotateRight */ "../../../src/utils/array/matrix/RotateRight.js"), + Translate: __webpack_require__(/*! ./TranslateMatrix */ "../../../src/utils/array/matrix/TranslateMatrix.js"), TransposeMatrix: __webpack_require__(/*! ./TransposeMatrix */ "../../../src/utils/array/matrix/TransposeMatrix.js") }; +/***/ }), + +/***/ "../../../src/utils/object/DeepCopy.js": +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/object/DeepCopy.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Deep Copy the given object or array. + * + * @function Phaser.Utils.Objects.DeepCopy + * @since 3.50.0 + * + * @param {object} obj - The object to deep copy. + * + * @return {object} A deep copy of the original object. + */ +var DeepCopy = function (inObject) +{ + var outObject; + var value; + var key; + + if (typeof inObject !== 'object' || inObject === null) + { + // inObject is not an object + return inObject; + } + + // Create an array or object to hold the values + outObject = Array.isArray(inObject) ? [] : {}; + + for (key in inObject) + { + value = inObject[key]; + + // Recursively (deep) copy for nested objects, including arrays + outObject[key] = DeepCopy(value); + } + + return outObject; +}; + +module.exports = DeepCopy; + + /***/ }), /***/ "../../../src/utils/object/Extend.js": -/*!*****************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/Extend.js ***! - \*****************************************************/ +/*!**********************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/object/Extend.js ***! + \**********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -30318,9 +32196,9 @@ module.exports = Extend; /***/ }), /***/ "../../../src/utils/object/GetAdvancedValue.js": -/*!***************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js ***! - \***************************************************************/ +/*!********************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/object/GetAdvancedValue.js ***! + \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -30410,9 +32288,9 @@ module.exports = GetAdvancedValue; /***/ }), /***/ "../../../src/utils/object/GetFastValue.js": -/*!***********************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/GetFastValue.js ***! - \***********************************************************/ +/*!****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/object/GetFastValue.js ***! + \****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -30458,9 +32336,9 @@ module.exports = GetFastValue; /***/ }), /***/ "../../../src/utils/object/GetValue.js": -/*!*******************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/GetValue.js ***! - \*******************************************************/ +/*!************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/object/GetValue.js ***! + \************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -30534,9 +32412,9 @@ module.exports = GetValue; /***/ }), /***/ "../../../src/utils/object/IsPlainObject.js": -/*!************************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/object/IsPlainObject.js ***! - \************************************************************/ +/*!*****************************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/object/IsPlainObject.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -30595,9 +32473,9 @@ module.exports = IsPlainObject; /***/ }), /***/ "../../../src/utils/string/Pad.js": -/*!**************************************************!*\ - !*** D:/wamp/www/phaser/src/utils/string/Pad.js ***! - \**************************************************/ +/*!*******************************************************************!*\ + !*** /Users/rich/Documents/GitHub/phaser/src/utils/string/Pad.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { @@ -30631,9 +32509,9 @@ module.exports = IsPlainObject; * @since 3.0.0 * * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. - * @param {integer} [len=0] - The number of characters to be added. + * @param {number} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). - * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). * * @return {string} The padded string. */ @@ -30768,7 +32646,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { atlas = new TextFile(loader, { - key: key + '_' + i, + key: key + '!' + i, url: atlasURL[i], extension: GetFastValue(config, 'atlasExtension', 'atlas'), xhrSettings: GetFastValue(config, 'atlasXhrSettings') @@ -30790,7 +32668,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { - atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings); + atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); atlas.cache = cache; files.push(atlas); @@ -30864,9 +32742,12 @@ var SpineFile = new Class({ var image = new ImageFile(loader, key, textureURL, textureXhrSettings); - this.addToMultiFile(image); + if (!loader.keyExists(image)) + { + this.addToMultiFile(image); - loader.addFile(image); + loader.addFile(image); + } } // Reset the loader settings @@ -30903,7 +32784,7 @@ var SpineFile = new Class({ if (file.type === 'text') { - atlasKey = file.key.replace(/_[\d]$/, ''); + atlasKey = file.key.replace(/![\d]$/, ''); atlasCache = file.cache; @@ -30912,7 +32793,7 @@ var SpineFile = new Class({ else { var src = file.key.trim(); - var pos = src.indexOf('_'); + var pos = src.indexOf('!'); var key = src.substr(pos + 1); if (!textureManager.exists(key)) @@ -30961,6 +32842,9 @@ var SpineGameObject = __webpack_require__(/*! ./gameobject/SpineGameObject */ ". var SpineContainer = __webpack_require__(/*! ./container/SpineContainer */ "./container/SpineContainer.js"); var NOOP = __webpack_require__(/*! ../../../src/utils/NOOP */ "../../../src/utils/NOOP.js"); +// Plugin specific instance of the Spine Scene Renderer +var sceneRenderer; + /** * @classdesc * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game Objects. @@ -31162,6 +33046,8 @@ var SpinePlugin = new Class({ /** * An instance of the Spine WebGL Scene Renderer. * + * There is only one instance of the Scene Renderer shared across the whole plugin. + * * Only set if running in WebGL mode. * * @name SpinePlugin#sceneRenderer @@ -31192,7 +33078,7 @@ var SpinePlugin = new Class({ /** * A reference to the Spine runtime. - * This is the runtime created by Esoteric Software + * This is the runtime created by Esoteric Software. * * @name SpinePlugin#plugin * @type {spine} @@ -31382,8 +33268,6 @@ var SpinePlugin = new Class({ */ bootWebGL: function () { - this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); - // Monkeypatch the Spine setBlendMode functions, or batching is destroyed! var setBlendMode = function (srcBlend, dstBlend) @@ -31403,11 +33287,17 @@ var SpinePlugin = new Class({ } }; - this.sceneRenderer.batcher.setBlendMode = setBlendMode; - this.sceneRenderer.shapes.setBlendMode = setBlendMode; + if (!sceneRenderer) + { + sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + sceneRenderer.batcher.setBlendMode = setBlendMode; + sceneRenderer.shapes.setBlendMode = setBlendMode; + } - this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; - this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer; + // All share the same instance + this.sceneRenderer = sceneRenderer; + this.skeletonRenderer = sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer; this.temp1 = new Spine.webgl.Vector3(0, 0, 0); this.temp2 = new Spine.webgl.Vector3(0, 0, 0); @@ -32005,8 +33895,7 @@ var SpinePlugin = new Class({ sceneRenderer.camera.position.x = viewportWidth / 2; sceneRenderer.camera.position.y = viewportHeight / 2; - sceneRenderer.camera.viewportWidth = viewportWidth; - sceneRenderer.camera.viewportHeight = viewportHeight; + sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); }, /** @@ -32068,9 +33957,9 @@ var SpinePlugin = new Class({ { this.destroy(); - if (this.sceneRenderer) + if (sceneRenderer) { - this.sceneRenderer.dispose(); + sceneRenderer.dispose(); } this.sceneRenderer = null; @@ -32178,8 +34067,8 @@ var SpineContainerRender = __webpack_require__(/*! ./SpineContainerRender */ "./ * A Spine Container is a special kind of Container created specifically for Spine Game Objects. * * You have all of the same features of a standard Container, but the rendering functions are optimized specifically - * for Spine Game Objects. You must only add ever Spine Game Objects to this type of Container. Although Phaser will - * not prevent you from adding other types, they will not render and are likely to throw runtime errors. + * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. + * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. * * To create one in a Scene, use the factory methods: * @@ -32193,6 +34082,10 @@ var SpineContainerRender = __webpack_require__(/*! ./SpineContainerRender */ "./ * this.make.spinecontainer(); * ``` * + * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the + * container children. You can, however, mask children of Spine Containers if they are embedded within other + * Spine Containers. In short, if you need masking, don't mix and match the types. + * * See the Container documentation for further details about what Containers can do. * * @class SpineContainer @@ -32283,11 +34176,10 @@ module.exports = SpineContainer; * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -32352,7 +34244,7 @@ var SpineContainerCanvasRenderer = function (renderer, container, interpolationP child.setAlpha(childAlpha * alpha); // Render - child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderCanvas(renderer, child, camera, transformMatrix); // Restore original values child.setAlpha(childAlpha); @@ -32411,7 +34303,7 @@ module.exports = { !*** ./container/SpineContainerWebGLRenderer.js ***! \**************************************************/ /*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { /** * @author Richard Davey @@ -32419,11 +34311,6 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); -var Clamp = __webpack_require__(/*! ../../../../src/math/Clamp */ "../../../src/math/Clamp.js"); -var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); -var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/math/Wrap.js"); - /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -32435,11 +34322,10 @@ var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/ma * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var plugin = container.plugin; var sceneRenderer = plugin.sceneRenderer; @@ -32472,12 +34358,6 @@ var SpineContainerWebGLRenderer = function (renderer, container, interpolationPe transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } - var alpha = container.alpha; - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - var GameObjectRenderMask = 15; - if (renderer.newType) { // flush + clear if this is a new type @@ -32486,91 +34366,53 @@ var SpineContainerWebGLRenderer = function (renderer, container, interpolationPe sceneRenderer.begin(); } + var rendererNextType = renderer.nextTypeMatch; + + // Force these to avoid batch flushing during SpineGameObject.renderWebGL + renderer.nextTypeMatch = true; + renderer.newType = false; + for (var i = 0; i < children.length; i++) { - var src = children[i]; + var child = children[i]; - var skeleton = src.skeleton; - var childAlpha = skeleton.color.a; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0); - - if (!skeleton || !willRender) + if (child.willRender(camera)) { - continue; - } + var mask = child.mask; - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); - - camMatrix.copyFrom(camera.matrix); - - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(transformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - - var viewportHeight = renderer.height; - - skeleton.x = calcMatrix.tx; - skeleton.y = viewportHeight - calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - skeleton.scaleY = calcMatrix.scaleY; - - if (src.scaleX < 0) - { - skeleton.scaleX *= -1; - - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } - - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; - - if (src.scaleX < 0) + if (mask) { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.preRenderWebGL(renderer, child, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); } - else + + child.renderWebGL(renderer, child, camera, transformMatrix, container); + + if (mask) { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.postRenderWebGL(renderer, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); } } - - if (camera.renderToTexture || renderer.currentFramebuffer !== null) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - - // Add autoUpdate option - skeleton.updateWorldTransform(); - - skeleton.color.a = Clamp(childAlpha * alpha, 0, 1); - - // Draw the current skeleton - sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); - - // Restore alpha - skeleton.color.a = childAlpha; } - if (!renderer.nextTypeMatch) + renderer.nextTypeMatch = rendererNextType; + + if (!rendererNextType) { // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch sceneRenderer.end(); @@ -33011,17 +34853,24 @@ var SpineGameObject = new Class({ }, /** - * Overrides the default Game Object method and always returns true. - * Rendering is decided in the renderer functions. + * Returns `true` if this Spine Game Object both has a skeleton and + * also passes the render tests for the given Camera. * * @method SpineGameObject#willRender * @since 3.19.0 * - * @return {boolean} Always returns `true`. + * @return {boolean} `true` if this Game Object should be rendered, otherwise `false`. */ - willRender: function () + willRender: function (camera) { - return true; + if (!this.skeleton) + { + return false; + } + + var GameObjectRenderMask = 15; + + return !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); }, /** @@ -33806,6 +35655,9 @@ var SpineGameObject = new Class({ */ addAnimation: function (trackIndex, animationName, loop, delay) { + if (loop === undefined) { loop = false; } + if (delay === undefined) { delay = 0; } + return this.state.addAnimation(trackIndex, animationName, loop, delay); }, @@ -34385,11 +36237,10 @@ var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/ma * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix) { var context = renderer.currentContext; @@ -34397,15 +36248,6 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercen var skeleton = src.skeleton; var skeletonRenderer = plugin.skeletonRenderer; - var GameObjectRenderMask = 15; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id))); - - if (!skeleton || !willRender) - { - return; - } - var camMatrix = renderer._tempMatrix1; var spriteMatrix = renderer._tempMatrix2; var calcMatrix = renderer._tempMatrix3; @@ -34475,7 +36317,6 @@ var SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercen skeleton.scaleY *= -1; } - // Add autoUpdate option skeleton.updateWorldTransform(); skeletonRenderer.ctx = context; @@ -34542,7 +36383,9 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ +var Clamp = __webpack_require__(/*! ../../../../src/math/Clamp */ "../../../src/math/Clamp.js"); var CounterClockwise = __webpack_require__(/*! ../../../../src/math/angle/CounterClockwise */ "../../../src/math/angle/CounterClockwise.js"); +var GetCalcMatrix = __webpack_require__(/*! ../../../../src/gameobjects/GetCalcMatrix */ "../../../src/gameobjects/GetCalcMatrix.js"); var RadToDeg = __webpack_require__(/*! ../../../../src/math/RadToDeg */ "../../../src/math/RadToDeg.js"); var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/math/Wrap.js"); @@ -34557,76 +36400,36 @@ var Wrap = __webpack_require__(/*! ../../../../src/math/Wrap */ "../../../src/ma * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container) { var plugin = src.plugin; var skeleton = src.skeleton; - var childAlpha = skeleton.color.a; var sceneRenderer = plugin.sceneRenderer; - var GameObjectRenderMask = 15; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0); - - if (!skeleton || !willRender) - { - // If there is already a batch running, and the next type isn't a Spine object, or this is the end, we need to close it - - if (sceneRenderer.batcher.isDrawing && (!renderer.nextTypeMatch || renderer.finalType)) - { - // The next object in the display list is not a Spine object, so we end the batch - sceneRenderer.end(); - - renderer.pipelines.rebind(); - } - - if (!renderer.finalType) - { - // Reset the current type - renderer.currentType = ''; - } - - return; - } - if (renderer.newType) { // flush + clear previous pipeline if this is a new type renderer.pipelines.clear(); + + sceneRenderer.begin(); } - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + var alpha = skeleton.color.a; - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) + if (container) { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + src.scrollFactorX = container.scrollFactorX; + src.scrollFactorY = container.scrollFactorY; - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); + skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; var viewportHeight = renderer.height; @@ -34640,7 +36443,8 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent { skeleton.scaleX *= -1; - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); + // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled + src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); } else { @@ -34668,17 +36472,18 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent skeleton.scaleY *= -1; } - // Add autoUpdate option skeleton.updateWorldTransform(); - if (renderer.newType) - { - sceneRenderer.begin(); - } - // Draw the current skeleton sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + if (container) + { + src.scrollFactorX = scrollFactorX; + src.scrollFactorY = scrollFactorY; + skeleton.color.a = alpha; + } + if (plugin.drawDebug || src.drawDebug) { // Because if we don't, the bones render positions are completely wrong (*sigh*) @@ -38293,15 +40098,35 @@ var spine; path = this.pathPrefix + path; if (!this.queueAsset(clientId, textureLoader, path)) return; - var img = new Image(); - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - _this.rawAssets[path] = img; - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - }; - img.src = path; + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; + if (isWebWorker) { + var options = { mode: "cors" }; + fetch(path, options).then(function (response) { + if (!response.ok) { + _this.errors[path] = "Couldn't load image " + path; + } + return response.blob(); + }).then(function (blob) { + return createImageBitmap(blob, { + premultiplyAlpha: 'none', + colorSpaceConversion: 'none' + }); + }).then(function (bitmap) { + _this.rawAssets[path] = bitmap; + }); + } + else { + var img_1 = new Image(); + img_1.crossOrigin = "anonymous"; + img_1.onload = function (ev) { + _this.rawAssets[path] = img_1; + }; + img_1.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + img_1.src = path; + } }; SharedAssetManager.prototype.get = function (clientId, path) { path = this.pathPrefix + path; @@ -38311,6 +40136,8 @@ var spine; return clientAssets.assets[path]; }; SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; for (var i = 0; i < clientAssets.toLoad.length; i++) { var path = clientAssets.toLoad[i]; var asset = clientAssets.assets[path]; @@ -38318,11 +40145,21 @@ var spine; var rawAsset = this.rawAssets[path]; if (rawAsset === null || rawAsset === undefined) continue; - if (rawAsset instanceof HTMLImageElement) { - clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + if (isWebWorker) { + if (rawAsset instanceof ImageBitmap) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } else { - clientAssets.assets[path] = rawAsset; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } } } @@ -42470,7 +44307,7 @@ var spine; return _this; } BoundingBoxAttachment.prototype.copy = function () { - var copy = new BoundingBoxAttachment(name); + var copy = new BoundingBoxAttachment(this.name); this.copyTo(copy); copy.color.setFromColor(this.color); return copy; @@ -42489,7 +44326,7 @@ var spine; return _this; } ClippingAttachment.prototype.copy = function () { - var copy = new ClippingAttachment(name); + var copy = new ClippingAttachment(this.name); this.copyTo(copy); copy.endSlot = this.endSlot; copy.color.setFromColor(this.color); @@ -42633,7 +44470,7 @@ var spine; return _this; } PathAttachment.prototype.copy = function () { - var copy = new PathAttachment(name); + var copy = new PathAttachment(this.name); this.copyTo(copy); copy.lengths = new Array(this.lengths.length); spine.Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length); @@ -42667,7 +44504,7 @@ var spine; return Math.atan2(y, x) * spine.MathUtils.radDeg; }; PointAttachment.prototype.copy = function () { - var copy = new PointAttachment(name); + var copy = new PointAttachment(this.name); copy.x = this.x; copy.y = this.y; copy.rotation = this.rotation; @@ -45427,30 +47264,32 @@ var spine; (function (webgl) { var ManagedWebGLRenderingContext = (function () { function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { - var _this = this; if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } this.restorables = new Array(); - if (canvasOrContext instanceof HTMLCanvasElement) { - var canvas_1 = canvasOrContext; - this.gl = (canvas_1.getContext("webgl2", contextConfig) || canvas_1.getContext("webgl", contextConfig)); - this.canvas = canvas_1; - canvas_1.addEventListener("webglcontextlost", function (e) { - var event = e; - if (e) { - e.preventDefault(); - } - }); - canvas_1.addEventListener("webglcontextrestored", function (e) { - for (var i = 0, n = _this.restorables.length; i < n; i++) { - _this.restorables[i].restore(); - } - }); + if (canvasOrContext instanceof HTMLCanvasElement || canvasOrContext instanceof EventTarget) { + this.setupCanvas(canvasOrContext, contextConfig); } else { this.gl = canvasOrContext; this.canvas = this.gl.canvas; } } + ManagedWebGLRenderingContext.prototype.setupCanvas = function (canvas, contextConfig) { + var _this = this; + this.gl = (canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig)); + this.canvas = canvas; + canvas.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + }; ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { this.restorables.push(restorable); }; diff --git a/plugins/spine/dist/SpinePluginDebug.js.map b/plugins/spine/dist/SpinePluginDebug.js.map index ae726bd45..e4ac0cd86 100644 --- a/plugins/spine/dist/SpinePluginDebug.js.map +++ b/plugins/spine/dist/SpinePluginDebug.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///D:/wamp/www/phaser/node_modules/eventemitter3/index.js","webpack:///D:/wamp/www/phaser/src/core/events/BLUR_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/BOOT_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/CONTEXT_LOST_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/CONTEXT_RESTORED_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/FOCUS_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/HIDDEN_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/PAUSE_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/POST_RENDER_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/POST_STEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/PRE_RENDER_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/PRE_STEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/READY_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/RESUME_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/STEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/VISIBLE_EVENT.js","webpack:///D:/wamp/www/phaser/src/core/events/index.js","webpack:///D:/wamp/www/phaser/src/data/DataManager.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/REMOVE_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/SET_DATA_EVENT.js","webpack:///D:/wamp/www/phaser/src/data/events/index.js","webpack:///D:/wamp/www/phaser/src/display/color/GetColorFromValue.js","webpack:///D:/wamp/www/phaser/src/display/mask/BitmapMask.js","webpack:///D:/wamp/www/phaser/src/display/mask/GeometryMask.js","webpack:///D:/wamp/www/phaser/src/gameobjects/BuildGameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/GameObject.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Alpha.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/AlphaSingle.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/BlendMode.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ComputedSize.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Crop.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Depth.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Flip.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/GetBounds.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Mask.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Origin.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/PathFollower.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Pipeline.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ScrollFactor.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Size.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Texture.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/TextureCrop.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Tint.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/ToJSON.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Transform.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/TransformMatrix.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/Visible.js","webpack:///D:/wamp/www/phaser/src/gameobjects/components/index.js","webpack:///D:/wamp/www/phaser/src/gameobjects/container/Container.js","webpack:///D:/wamp/www/phaser/src/gameobjects/container/ContainerCanvasRenderer.js","webpack:///D:/wamp/www/phaser/src/gameobjects/container/ContainerRender.js","webpack:///D:/wamp/www/phaser/src/gameobjects/container/ContainerWebGLRenderer.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js","webpack:///D:/wamp/www/phaser/src/gameobjects/events/index.js","webpack:///D:/wamp/www/phaser/src/geom/const.js","webpack:///D:/wamp/www/phaser/src/geom/line/GetPoint.js","webpack:///D:/wamp/www/phaser/src/geom/line/GetPoints.js","webpack:///D:/wamp/www/phaser/src/geom/line/Length.js","webpack:///D:/wamp/www/phaser/src/geom/line/Line.js","webpack:///D:/wamp/www/phaser/src/geom/line/Random.js","webpack:///D:/wamp/www/phaser/src/geom/point/Point.js","webpack:///D:/wamp/www/phaser/src/geom/rectangle/Contains.js","webpack:///D:/wamp/www/phaser/src/geom/rectangle/GetPoint.js","webpack:///D:/wamp/www/phaser/src/geom/rectangle/GetPoints.js","webpack:///D:/wamp/www/phaser/src/geom/rectangle/Perimeter.js","webpack:///D:/wamp/www/phaser/src/geom/rectangle/Random.js","webpack:///D:/wamp/www/phaser/src/geom/rectangle/Rectangle.js","webpack:///D:/wamp/www/phaser/src/geom/rectangle/Union.js","webpack:///D:/wamp/www/phaser/src/loader/File.js","webpack:///D:/wamp/www/phaser/src/loader/FileTypesManager.js","webpack:///D:/wamp/www/phaser/src/loader/GetURL.js","webpack:///D:/wamp/www/phaser/src/loader/MergeXHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/MultiFile.js","webpack:///D:/wamp/www/phaser/src/loader/XHRLoader.js","webpack:///D:/wamp/www/phaser/src/loader/XHRSettings.js","webpack:///D:/wamp/www/phaser/src/loader/const.js","webpack:///D:/wamp/www/phaser/src/loader/events/ADD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_LOAD_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/FILE_PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/POST_PROCESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/PROGRESS_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/loader/events/index.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/ImageFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/JSONFile.js","webpack:///D:/wamp/www/phaser/src/loader/filetypes/TextFile.js","webpack:///D:/wamp/www/phaser/src/math/Average.js","webpack:///D:/wamp/www/phaser/src/math/Bernstein.js","webpack:///D:/wamp/www/phaser/src/math/Between.js","webpack:///D:/wamp/www/phaser/src/math/CatmullRom.js","webpack:///D:/wamp/www/phaser/src/math/CeilTo.js","webpack:///D:/wamp/www/phaser/src/math/Clamp.js","webpack:///D:/wamp/www/phaser/src/math/DegToRad.js","webpack:///D:/wamp/www/phaser/src/math/Difference.js","webpack:///D:/wamp/www/phaser/src/math/Factorial.js","webpack:///D:/wamp/www/phaser/src/math/FloatBetween.js","webpack:///D:/wamp/www/phaser/src/math/FloorTo.js","webpack:///D:/wamp/www/phaser/src/math/FromPercent.js","webpack:///D:/wamp/www/phaser/src/math/GetSpeed.js","webpack:///D:/wamp/www/phaser/src/math/IsEven.js","webpack:///D:/wamp/www/phaser/src/math/IsEvenStrict.js","webpack:///D:/wamp/www/phaser/src/math/Linear.js","webpack:///D:/wamp/www/phaser/src/math/Matrix3.js","webpack:///D:/wamp/www/phaser/src/math/Matrix4.js","webpack:///D:/wamp/www/phaser/src/math/MaxAdd.js","webpack:///D:/wamp/www/phaser/src/math/MinSub.js","webpack:///D:/wamp/www/phaser/src/math/Percent.js","webpack:///D:/wamp/www/phaser/src/math/Quaternion.js","webpack:///D:/wamp/www/phaser/src/math/RadToDeg.js","webpack:///D:/wamp/www/phaser/src/math/RandomXY.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZ.js","webpack:///D:/wamp/www/phaser/src/math/RandomXYZW.js","webpack:///D:/wamp/www/phaser/src/math/Rotate.js","webpack:///D:/wamp/www/phaser/src/math/RotateAround.js","webpack:///D:/wamp/www/phaser/src/math/RotateAroundDistance.js","webpack:///D:/wamp/www/phaser/src/math/RotateTo.js","webpack:///D:/wamp/www/phaser/src/math/RotateVec3.js","webpack:///D:/wamp/www/phaser/src/math/RoundAwayFromZero.js","webpack:///D:/wamp/www/phaser/src/math/RoundTo.js","webpack:///D:/wamp/www/phaser/src/math/SinCosTableGenerator.js","webpack:///D:/wamp/www/phaser/src/math/SmoothStep.js","webpack:///D:/wamp/www/phaser/src/math/SmootherStep.js","webpack:///D:/wamp/www/phaser/src/math/ToXY.js","webpack:///D:/wamp/www/phaser/src/math/TransformXY.js","webpack:///D:/wamp/www/phaser/src/math/Vector2.js","webpack:///D:/wamp/www/phaser/src/math/Vector3.js","webpack:///D:/wamp/www/phaser/src/math/Vector4.js","webpack:///D:/wamp/www/phaser/src/math/Within.js","webpack:///D:/wamp/www/phaser/src/math/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/Between.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPoints.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenPointsY.js","webpack:///D:/wamp/www/phaser/src/math/angle/BetweenY.js","webpack:///D:/wamp/www/phaser/src/math/angle/CounterClockwise.js","webpack:///D:/wamp/www/phaser/src/math/angle/Normalize.js","webpack:///D:/wamp/www/phaser/src/math/angle/Random.js","webpack:///D:/wamp/www/phaser/src/math/angle/RandomDegrees.js","webpack:///D:/wamp/www/phaser/src/math/angle/Reverse.js","webpack:///D:/wamp/www/phaser/src/math/angle/RotateTo.js","webpack:///D:/wamp/www/phaser/src/math/angle/ShortestBetween.js","webpack:///D:/wamp/www/phaser/src/math/angle/Wrap.js","webpack:///D:/wamp/www/phaser/src/math/angle/WrapDegrees.js","webpack:///D:/wamp/www/phaser/src/math/angle/index.js","webpack:///D:/wamp/www/phaser/src/math/const.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceBetween.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceBetweenPoints.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceBetweenPointsSquared.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceChebyshev.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistancePower.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceSnake.js","webpack:///D:/wamp/www/phaser/src/math/distance/DistanceSquared.js","webpack:///D:/wamp/www/phaser/src/math/distance/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/back/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/bounce/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/circular/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/cubic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/elastic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/expo/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/Linear.js","webpack:///D:/wamp/www/phaser/src/math/easing/linear/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quadratic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quartic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/quintic/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/In.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/InOut.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/Out.js","webpack:///D:/wamp/www/phaser/src/math/easing/sine/index.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/Stepped.js","webpack:///D:/wamp/www/phaser/src/math/easing/stepped/index.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Ceil.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Equal.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/Floor.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/GreaterThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/LessThan.js","webpack:///D:/wamp/www/phaser/src/math/fuzzy/index.js","webpack:///D:/wamp/www/phaser/src/math/index.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/BezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CatmullRomInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/CubicBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/LinearInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/QuadraticBezierInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmoothStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/SmootherStepInterpolation.js","webpack:///D:/wamp/www/phaser/src/math/interpolation/index.js","webpack:///D:/wamp/www/phaser/src/math/pow2/GetPowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsSizePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/IsValuePowerOfTwo.js","webpack:///D:/wamp/www/phaser/src/math/pow2/index.js","webpack:///D:/wamp/www/phaser/src/math/random-data-generator/RandomDataGenerator.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapCeil.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapFloor.js","webpack:///D:/wamp/www/phaser/src/math/snap/SnapTo.js","webpack:///D:/wamp/www/phaser/src/math/snap/index.js","webpack:///D:/wamp/www/phaser/src/plugins/BasePlugin.js","webpack:///D:/wamp/www/phaser/src/plugins/ScenePlugin.js","webpack:///D:/wamp/www/phaser/src/renderer/BlendModes.js","webpack:///D:/wamp/www/phaser/src/renderer/webgl/pipelines/const.js","webpack:///D:/wamp/www/phaser/src/scale/events/RESIZE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/ADDED_TO_SCENE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/BOOT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/CREATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/DESTROY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PAUSE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/POST_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/PRE_UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/READY_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/REMOVED_FROM_SCENE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RENDER_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/RESUME_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SHUTDOWN_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/SLEEP_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_INIT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_OUT_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_START_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/UPDATE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/WAKE_EVENT.js","webpack:///D:/wamp/www/phaser/src/scene/events/index.js","webpack:///D:/wamp/www/phaser/src/tweens/builders/GetBoolean.js","webpack:///D:/wamp/www/phaser/src/tweens/tween/const.js","webpack:///D:/wamp/www/phaser/src/utils/Class.js","webpack:///D:/wamp/www/phaser/src/utils/NOOP.js","webpack:///D:/wamp/www/phaser/src/utils/array/Add.js","webpack:///D:/wamp/www/phaser/src/utils/array/AddAt.js","webpack:///D:/wamp/www/phaser/src/utils/array/BringToTop.js","webpack:///D:/wamp/www/phaser/src/utils/array/CountAllMatching.js","webpack:///D:/wamp/www/phaser/src/utils/array/Each.js","webpack:///D:/wamp/www/phaser/src/utils/array/EachInRange.js","webpack:///D:/wamp/www/phaser/src/utils/array/FindClosestInSorted.js","webpack:///D:/wamp/www/phaser/src/utils/array/GetAll.js","webpack:///D:/wamp/www/phaser/src/utils/array/GetFirst.js","webpack:///D:/wamp/www/phaser/src/utils/array/GetRandom.js","webpack:///D:/wamp/www/phaser/src/utils/array/MoveDown.js","webpack:///D:/wamp/www/phaser/src/utils/array/MoveTo.js","webpack:///D:/wamp/www/phaser/src/utils/array/MoveUp.js","webpack:///D:/wamp/www/phaser/src/utils/array/NumberArray.js","webpack:///D:/wamp/www/phaser/src/utils/array/NumberArrayStep.js","webpack:///D:/wamp/www/phaser/src/utils/array/QuickSelect.js","webpack:///D:/wamp/www/phaser/src/utils/array/Range.js","webpack:///D:/wamp/www/phaser/src/utils/array/Remove.js","webpack:///D:/wamp/www/phaser/src/utils/array/RemoveAt.js","webpack:///D:/wamp/www/phaser/src/utils/array/RemoveBetween.js","webpack:///D:/wamp/www/phaser/src/utils/array/RemoveRandomElement.js","webpack:///D:/wamp/www/phaser/src/utils/array/Replace.js","webpack:///D:/wamp/www/phaser/src/utils/array/RotateLeft.js","webpack:///D:/wamp/www/phaser/src/utils/array/RotateRight.js","webpack:///D:/wamp/www/phaser/src/utils/array/SafeRange.js","webpack:///D:/wamp/www/phaser/src/utils/array/SendToBack.js","webpack:///D:/wamp/www/phaser/src/utils/array/SetAll.js","webpack:///D:/wamp/www/phaser/src/utils/array/Shuffle.js","webpack:///D:/wamp/www/phaser/src/utils/array/SortByDigits.js","webpack:///D:/wamp/www/phaser/src/utils/array/SpliceOne.js","webpack:///D:/wamp/www/phaser/src/utils/array/StableSort.js","webpack:///D:/wamp/www/phaser/src/utils/array/Swap.js","webpack:///D:/wamp/www/phaser/src/utils/array/index.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/CheckMatrix.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/MatrixToString.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/ReverseColumns.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/ReverseRows.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/Rotate180.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/RotateLeft.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/RotateMatrix.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/RotateRight.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/TransposeMatrix.js","webpack:///D:/wamp/www/phaser/src/utils/array/matrix/index.js","webpack:///D:/wamp/www/phaser/src/utils/object/Extend.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetAdvancedValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetFastValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/GetValue.js","webpack:///D:/wamp/www/phaser/src/utils/object/IsPlainObject.js","webpack:///D:/wamp/www/phaser/src/utils/string/Pad.js","webpack:///./SpineFile.js","webpack:///./SpinePlugin.js","webpack:///./container/SpineContainer.js","webpack:///./container/SpineContainerCanvasRenderer.js","webpack:///./container/SpineContainerRender.js","webpack:///./container/SpineContainerWebGLRenderer.js","webpack:///./events/COMPLETE_EVENT.js","webpack:///./events/DISPOSE_EVENT.js","webpack:///./events/END_EVENT.js","webpack:///./events/EVENT_EVENT.js","webpack:///./events/INTERRUPTED_EVENT.js","webpack:///./events/START_EVENT.js","webpack:///./events/index.js","webpack:///./gameobject/SpineGameObject.js","webpack:///./gameobject/SpineGameObjectCanvasRenderer.js","webpack:///./gameobject/SpineGameObjectRender.js","webpack:///./gameobject/SpineGameObjectWebGLRenderer.js","webpack:///./runtimes/spine-both.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,eAAe,YAAY;AAC3B;;AAEA;AACA,2DAA2D;AAC3D,+DAA+D;AAC/D,mEAAmE;AACnE,uEAAuE;AACvE;AACA,0DAA0D,SAAS;AACnE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,IAA6B;AACjC;AACA;;;;;;;;;;;;AC/UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAO,CAAC,4DAAc;AAChC,UAAU,mBAAO,CAAC,4DAAc;AAChC,kBAAkB,mBAAO,CAAC,4EAAsB;AAChD,sBAAsB,mBAAO,CAAC,oFAA0B;AACxD,aAAa,mBAAO,CAAC,kEAAiB;AACtC,WAAW,mBAAO,CAAC,8DAAe;AAClC,YAAY,mBAAO,CAAC,gEAAgB;AACpC,WAAW,mBAAO,CAAC,8DAAe;AAClC,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,eAAe,mBAAO,CAAC,sEAAmB;AAC1C,gBAAgB,mBAAO,CAAC,wEAAoB;AAC5C,cAAc,mBAAO,CAAC,oEAAkB;AACxC,WAAW,mBAAO,CAAC,8DAAe;AAClC,YAAY,mBAAO,CAAC,gEAAgB;AACpC,UAAU,mBAAO,CAAC,4DAAc;AAChC,aAAa,mBAAO,CAAC,kEAAiB;;AAEtC;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,aAAa,mBAAO,CAAC,mDAAU;;AAE/B;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,KAAK;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;;AAEb;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,sCAAsC,kBAAkB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC5rBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,qBAAqB,mBAAO,CAAC,kFAAyB;AACtD,aAAa,mBAAO,CAAC,kEAAiB;AACtC,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,cAAc,mBAAO,CAAC,oEAAkB;;AAExC;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,4DAAmB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,8BAA8B;AACzC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC9RA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,4BAA4B;AACvC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4BAA4B;AAC3C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC,6BAA6B;;AAE9D;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,eAAe,8BAA8B;AAC7C,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sCAAsC;AACrD,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sCAAsC;AACrD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACpTA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,mEAAwB;AACjD,uBAAuB,mBAAO,CAAC,uFAAkC;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,8BAA8B;AACzC,WAAW,0CAA0C;AACrD;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,iBAAiB,WAAW,KAAK,SAAS;;AAE1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,kBAAkB,KAAK,gBAAgB;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,iBAAiB,cAAc,KAAK,UAAU;;AAE9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,uBAAuB,mBAAO,CAAC,0EAAqB;AACpD,kBAAkB,mBAAO,CAAC,6DAAqB;AAC/C,mBAAmB,mBAAO,CAAC,mEAAe;AAC1C,aAAa,mBAAO,CAAC,0DAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAA2D;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,mCAAmC;AAClD,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,UAAU;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,sCAAsC,mBAAmB;;AAEzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3tBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,oDAAkB;;AAEtC;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;AChSA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,oDAAkB;;AAEtC;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACvGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sEAA2B;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACnHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+BAA+B;AAC9C,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;;AAEA;;;;;;;;;;;;ACtHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA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AK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA,eAAe,+BAA+B;AAC9C;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA,mCAAmC,0BAA0B;;AAE7D;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AChWA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,8EAA+B;AACxD,mBAAmB,mBAAO,CAAC,kFAAiC;;AAE5D;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kEAAkE;AACjF;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,wCAAwC,qBAAqB;;AAE7D;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,gCAAgC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4BAA4B;AAC3C;AACA,gBAAgB,kCAAkC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC5IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,SAAS;AACvC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpMA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0DAAqB;AAC5C,iBAAiB,mBAAO,CAAC,oFAAkC;AAC3D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,kBAAkB,mBAAO,CAAC,oEAA0B;AACpD,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B,uDAAuD;AAClF;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,uGAAuG;AACtH;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,0BAA0B;;AAE7D;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,YAAY;;AAE/C;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uGAAuG,WAAW;AACjI,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,aAAa;AAChD,oCAAoC,aAAa;;AAEjD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpaA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,qBAAqB,mBAAO,CAAC,4FAAsC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,iCAAiC,sCAAsC;;AAEvE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC/HA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,oBAAoB;;AAEtD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpLA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iCAAiC;AAChD,eAAe,iBAAiB;AAChC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D,yCAAyC,qBAAqB;;AAE9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC3HA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+BAA+B;AAC9C,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,iBAAiB;AAChC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D,yCAAyC,qBAAqB;;AAE9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;;AAEA;;;;;;;;;;;;ACzMA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,wBAAwB,mBAAO,CAAC,8FAAuC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,oBAAoB;;AAExD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACrUA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,sBAAsB,mBAAO,CAAC,iFAAmB;AACjD,kBAAkB,mBAAO,CAAC,gEAAwB;AAClD,gBAAgB,mBAAO,CAAC,8DAAuB;AAC/C,uBAAuB,mBAAO,CAAC,4EAA8B;AAC7D,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,gDAAgD;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,oCAAoC;AACtE,mCAAmC,sCAAsC;;AAEzE;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,QAAQ,mDAAmD;AAC3D;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;;AAE3E;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,yCAAyC,sCAAsC;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C,sBAAsB,sCAAsC;;AAE5D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACxkBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,qDAAqD;AACrE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,kCAAkC,UAAU,cAAc;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACr/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,WAAW,mBAAO,C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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,gCAAgC;AAC3C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA,gBAAgB,sBAAsB;AACtC;AACA;AACA;AACA,mCAAmC,0BAA0B;;AAE7D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,2BAA2B,qBAAqB;AAChD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+CAA+C;AAC9D,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,gCAAgC;AAChD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,2CAA2C,wBAAwB;;AAEnE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACj1CA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,6BAA6B;AACxC,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,oDAAkB;AAC5C,mBAAmB,mBAAO,CAAC,oDAAkB;;AAE7C,IAAI,IAAqB;AACzB;AACA,kBAAkB,mBAAO,CAAC,8FAA0B;AACpD;;AAEA,IAAI,IAAsB;AAC1B;AACA,mBAAmB,mBAAO,CAAC,gGAA2B;AACtD;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,6BAA6B;AACxC,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,MAAM;AACjB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AAC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,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACzEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA,WAAW,iBAAiB;AAC5B,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA,4BAA4B,mBAAmB;;AAE/C;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,kDAAU;AAC/B,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA,WAAW,iBAAiB;AAC5B,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,4BAA4B;AACvC;AACA,YAAY,4BAA4B;AACxC;AACA;AACA;AACA,4BAA4B,UAAU;;AAEtC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,mBAAmB,cAAc;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC1DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AA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AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,iCAAiC,sBAAsB;;AAEvD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,iCAAiC,sBAAsB;;AAEvD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA,WAAW,iBAAiB;AAC5B,WAAW,2BAA2B;AACtC;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA,4BAA4B,mBAAmB;;AAE/C;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,4CAAU;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,6DAAa;AACrC,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA,4BAA4B,mBAAmB;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC1EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,2DAAY;AACnC,gBAAgB,mBAAO,CAAC,6DAAa;;AAErC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,4BAA4B;AACvC;AACA,YAAY,4BAA4B;AACxC;AACA;AACA;AACA,4BAA4B,UAAU;;AAEtC;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,cAAc;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA,WAAW,sBAAsB;AACjC,WAAW,kBAAkB;AAC7B;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA,4BAA4B,mBAAmB;;AAE/C;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,eAAe,mBAAO,CAAC,2DAAY;AACnC,eAAe,mBAAO,CAAC,2DAAY;AACnC,gBAAgB,mBAAO,CAAC,6DAAa;AACrC,iBAAiB,mBAAO,CAAC,4CAAU;AACnC,WAAW,mBAAO,CAAC,oDAAc;AACjC,aAAa,mBAAO,CAAC,uDAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,WAAW;AAC7C,mCAAmC,YAAY;;AAE/C;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA,eAAe,OAAO;AACtB,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,4BAA4B;AAC3C;AACA,gBAAgB,4BAA4B;AAC5C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,gBAAgB;;AAEnD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACxfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,6DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA,WAAW,sBAAsB;AACjC,WAAW,sBAAsB;AACjC,WAAW,sBAAsB;AACjC;AACA,YAAY,sBAAsB;AAClC;AACA;AACA;AACA,4BAA4B,uBAAuB;;AAEnD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,YAAY,mBAAO,CAAC,6CAAS;AAC7B,aAAa,mBAAO,CAAC,qDAAU;AAC/B,mBAAmB,mBAAO,CAAC,+EAA8B;AACzD,aAAa,mBAAO,CAAC,+CAAU;AAC/B,uBAAuB,mBAAO,CAAC,mEAAoB;AACnD,gBAAgB,mBAAO,CAAC,qDAAa;AACrC,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,+BAA+B;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,4GAA4G;AAC5G;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kBAAkB;;AAEnD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iEAAiE;AACjE;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC7hBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,mEAAwB;AAC7C,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,sCAAsC;AACjD;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,mEAAmE;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA,uBAAuB,kBAAkB;AACzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACnOA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,mEAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,sCAAsC;AACjD;AACA,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC1EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,8BAA8B,cAAc;AAC5C,6BAA6B,WAAW;AACxC,iCAAiC,eAAe;AAChD,gCAAgC,aAAa;AAC7C,wCAAwC,yBAAyB;;AAEjE;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjJA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,2BAA2B;AACtC,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,uDAAuD;AACjJ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,oFAAoF,mDAAmD;AACvI;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA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B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,uDAAuD;AAClE,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD,WAAW,+CAA+C;AAC1D;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uGAAuG;AAClH,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC3QA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC/NA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;ACxKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,mDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1kBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA;;;;;;;;;;;;AC/6CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,eAAe;;AAE3C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,cAAc,mBAAO,CAAC,+CAAW;AACjC,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;;AAE5C;;AAEA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC7vBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,+BAA+B,YAAY;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA,WAAW,8BAA8B;AACzC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,qDAAiB;AACvC,cAAc,mBAAO,CAAC,qDAAiB;AACvC,iBAAiB,mBAAO,CAAC,2DAAoB;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C,+BAA+B,YAAY;AAC3C,kCAAkC,eAAe;;AAEjD;;AAEA;AACA;;AAEA,mBAAmB,YAAY;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6BAA6B;AAC9E;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,oBAAoB;AAC/B;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,4BAA4B,qBAAqB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+CAA+C;AAC1D;AACA,YAAY,+CAA+C;AAC3D;AACA;AACA;AACA,+BAA+B,wBAAwB;;AAEvD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,iBAAiB,mBAAO,CAAC,6DAAqB;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;;AAEzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,6BAA6B,YAAY;;AAEzC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACjwBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACnyBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1hBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,sCAAsC;AACjF;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,gCAAgC;AAC3E;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,4CAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,yDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,4CAAU;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,6BAA6B,aAAa;;AAE1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;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;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACrFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA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O;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,mDAAM;AACtB,SAAS,mBAAO,CAAC,qDAAO;AACxB,WAAW,mBAAO,CAAC,yDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,qDAAM;AACtB,SAAS,mBAAO,CAAC,uDAAO;AACxB,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,kDAAM;AACtB,SAAS,mBAAO,CAAC,oDAAO;AACxB,WAAW,mBAAO,CAAC,wDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;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A;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,8DAAW;;;;;;;;;;;;ACVpC;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAO,CAAC,+CAAQ;AAC1B,WAAW,mBAAO,CAAC,iDAAS;AAC5B,WAAW,mBAAO,CAAC,iDAAS;AAC5B,iBAAiB,mBAAO,CA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A;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,8CAAW;;AAEhC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;A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AClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,gEAAiB;AACtC,YAAY,mBAAO,CAAC,sEAAoB;AACxC,aAAa,mBAAO,CAAC,wEAAqB;;AAE1C;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA,kCAAkC,qDAAqD;;AAEvF;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;;AAEA,kDAAkD;AAClD,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,wCAAwC;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,UAAU;AAClC;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB,oBAAoB,EAAE;AACtB;AACA,eAAe,IAAI;AACnB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB,oBAAoB,EAAE;AACtB;AACA,eAAe,IAAI;AACnB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB;AACA,eAAe,IAAI;AACnB;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;;AAEA,yBAAyB,OAAO;AAChC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACvfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAO,CAAC,sDAAY;AAC9B,WAAW,mBAAO,CAAC,wDAAa;AAChC,QAAQ,mBAAO,CAAC,kDAAU;;AAE1B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,4DAA4D,sCAAsC;AAClG;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3HA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,iBAAiB,mBAAO,CAAC,wDAAc;AACvC,YAAY,mBAAO,CAAC,mDAAgB;AACpC,kBAAkB,mBAAO,CAAC,2DAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACzHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,6CAA6C;AACpF;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,qDAAqD;AACpH;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA,4EAA4E,sDAAsD;AAClI;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACrKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9GA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gCAAgC,QAAQ;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBA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A,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;;AAEA;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,+BAA+B,uBAAuB;;AAEtD;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,qDAAqD;AACrD,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D,oEAAoE;AACpE;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,UAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,UAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,wBAAwB,mBAAO,CAAC,4EAA8B;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,4BAA4B,YAAY;AACxC,6BAA6B,UAAU;;AAEvC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA;AACA,6BAA6B,UAAU;AACvC,8BAA8B,wBAAwB;AACtD,gCAAgC,0BAA0B;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,iEAAoB;AAC3C,cAAc,mBAAO,CAAC,sDAAW;;AAEjC;AACA;AACA;;AAEA,wBAAwB,mBAAmB;AAC3C;AACA,4BAA4B,mBAAmB;AAC/C;AACA,2BAA2B,SAAS;AACpC;AACA,0BAA0B,6BAA6B;AACvD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,aAAa;AAChC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnIA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,YAAY;AACvB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,YAAY;AACxB;AACA;AACA;AACA,gCAAgC,iBAAiB;;AAEjD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,UAAU;AACtB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;AAC1D,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,+BAA+B,uBAAuB;;AAEtD;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA,WAAW,IAAI;AACf;AACA,YAAY,IAAI;AAChB;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,QAAQ;AACnB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,uBAAuB,SAAS;AAChC;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvCA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAqB,WAAW;AAChC;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe,SAAS;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,gCAAgC,mBAAmB;;AAEnD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;A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;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,UAAU,mBAAO,CAAC,0DAAkB;AACpC,kBAAkB,mBAAO,CAAC,qEAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA,uBAAuB,sBAAsB;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,sBAAsB;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC1EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,uEAAgB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,uEAAgB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,qEAAe;AACzC,sBAAsB,mBAAO,CAAC,6EAAmB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6CAA6C;AAC3E;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB,WAAW,gBAAgB;AAC3B;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,kCAAkC,gBAAgB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,uEAAgB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AACl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AC9FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,8CAAY;AAC/B,eAAe,mBAAO,CAAC,yDAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,8CAA8C,aAAa,qBAAqB;AAChF;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE,oBAAoB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;;AAEA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qBAAqB;AAChC,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,SAAS;AACrC,4BAA4B,WAAW;AACvC,4BAA4B,SAAS;;AAErC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,mBAAmB,mBAAO,CAAC,yFAAwC;AACnE,gBAAgB,mBAAO,CAAC,8FAA4C;AACpE,oBAAoB,mBAAO,CAAC,2FAAyC;AACrE,eAAe,mBAAO,CAAC,4FAA2C;AAClE,gBAAgB,mBAAO,CAAC,0EAAkC;AAC1D,eAAe,mBAAO,CAAC,4FAA2C;;AAElE;AACA,aAAa,OAAO;AACpB;AACA,cAAc,OAAO;AACrB,cAAc,gBAAgB;AAC9B,cAAc,OAAO;AACrB,cAAc,QAAQ;AACtB,cAAc,kBAAkB;AAChC,cAAc,kBAAkB;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,iDAAiD;AAC5D,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,kBAAkB;AAC7B,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,+BAA+B,oBAAoB;AACnD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,+BAA+B,qBAAqB;AACpD;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B,uBAAuB;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sCAAsC,uFAAuF;;AAE7H;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1PA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,sBAAsB,mBAAO,CAAC,6FAA0C;AACxE,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,eAAe,mBAAO,CAAC,iFAAoC;AAC3D,kBAAkB,mBAAO,CAAC,yFAAwC;AAClE,kBAAkB,mBAAO,CAAC,6EAAkC;AAC5D,YAAY,mBAAO,CAAC,uCAAO;AAC3B,gBAAgB,mBAAO,CAAC,mCAAa;AACrC,sBAAsB,mBAAO,CAAC,qEAA8B;AAC5D,qBAAqB,mBAAO,CAAC,iEAA4B;AACzD,WAAW,mBAAO,CAAC,2DAAyB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,uCAAuC,aAAa;;AAEpD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,uCAAuC,aAAa;;AAEpD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qGAAqG;AACpH,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,sCAAsC;AACrD,eAAe,sCAAsC;AACrD;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,eAAe;AAC9B,eAAe,WAAW;AAC1B;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,gBAAgB;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,QAAQ;AACnB;AACA,YAAY,gBAAgB;AAC5B;;AAEA;;;;;;;;;;;;ACvrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,gEAA6B;AACjD,gBAAgB,mBAAO,CAAC,wGAAiD;AACzE,2BAA2B,mBAAO,CAAC,mEAAwB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,6BAA6B;AACxC,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,8DAA4B;AACtD,mBAAmB,mBAAO,CAAC,8DAA4B;;AAEvD,IAAI,IAAqB;AACzB;AACA,kBAAkB,mBAAO,CAAC,iFAA+B;AACzD;;AAEA,IAAI,IAAsB;AAC1B;AACA,mBAAmB,mBAAO,CAAC,mFAAgC;AAC3D;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,gGAA6C;AAC5E,YAAY,mBAAO,CAAC,8DAA4B;AAChD,eAAe,mBAAO,CAAC,oEAA+B;AACtD,WAAW,mBAAO,CAAC,4DAA2B;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,6BAA6B;AACxC,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB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AAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,kBAAkB;;AAEpD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,kCAAkC,6BAA6B;AAC/D,mCAAmC,+BAA+B;AAClE,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,2BAA2B;AAClD;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,uCAAuC,gBAAgB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,4CAA4C,yBAAyB;;AAErE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,YAAY;AAC/C,qCAAqC,cAAc;AACnD,qCAAqC,gBAAgB;;AAErD;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,8BAA8B;AAC9C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACjjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,gGAA6C;AAC5E,eAAe,mBAAO,CAAC,oEAA+B;AACtD,WAAW,mBAAO,CAAC,4DAA2B;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AAC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ACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxKA;;AAEA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,mDAAmD;AACxD;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,OAAO;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iBAAiB;AAC5D;AACA;AACA;AACA;AACA,2CAA2C,iBAAiB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA,yCAAyC,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,oBAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6CAA6C;AAC/D;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,OAAO;AACxE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,yBAAyB,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,YAAY;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sDAAsD;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qGAAqG;AACrG;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,2DAA2D,0BAA0B;AACrF;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sDAAsD;AAC3D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kEAAkE;AACvE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gBAAgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA,0DAA0D,iBAAiB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA,KAAK,4DAA4D;AACjE;AACA;AACA;AACA;AACA;AACA,KAAK,yDAAyD;AAC9D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gCAAgC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;AACA,2BAA2B,sCAAsC;AACjE;AACA;AACA;AACA;AACA,2BAA2B,iCAAiC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD,gCAAgC,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA,wDAAwD,OAAO;AAC/D;AACA,wDAAwD,OAAO;AAC/D;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,OAAO;AACtC;AACA;AACA;AACA,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA;AACA;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA;AACA;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA,0DAA0D,SAAS;AACnE;AACA,gEAAgE,WAAW;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA,uEAAuE,QAAQ;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,qCAAqC,uBAAuB;AAC5D,mCAAmC,WAAW;AAC9C,oCAAoC,oCAAoC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,mCAAmC,cAAc;AACjD,sCAAsC,iBAAiB;AACvD;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,gCAAgC,0BAA0B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,OAAO;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2BAA2B;AAC1D;AACA;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA,wCAAwC,2BAA2B;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,+BAA+B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,0BAA0B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,OAAO;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,OAAO;AAChG;AACA;AACA;AACA,uDAAuD,kBAAkB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA,+BAA+B,6BAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA,+BAA+B,6BAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kEAAkE;AACvE;AACA;AACA;AACA;AACA;AACA,KAAK,4DAA4D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E,kEAAkE;AAClE,qDAAqD;AACrD;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oDAAoD,+BAA+B;AACnF;AACA;AACA;AACA;AACA,mCAAmC,WAAW;AAC9C;AACA;AACA;AACA;AACA;AACA,qCAAqC,UAAU;AAC/C;AACA;AACA;AACA;AACA;AACA,mCAAmC,WAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iBAAiB;AACvD,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,WAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,WAAW;AAC5E;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,qEAAqE;AAC1E,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB;AAC7D,2DAA2D,8CAA8C,EAAE;AAC3G;AACA;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF,wEAAwE;AACxE,2DAA2D;AAC3D;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,OAAO;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB;AAC7D;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oBAAoB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,wBAAwB;AAChF,sDAAsD,sDAAsD;AAC5G,sDAAsD,qDAAqD;AAC3G;AACA;AACA;AACA;AACA,sDAAsD,sBAAsB;AAC5E,qDAAqD,4BAA4B;AACjF,qDAAqD,2BAA2B;AAChF;AACA;AACA;AACA;AACA,qDAAqD,qBAAqB;AAC1E;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS,oFAAoF;AAC7F,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,oBAAoB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,uBAAuB;AACxF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF,gDAAgD,qBAAqB;AACrE,8CAA8C,mBAAmB;AACjE;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,qBAAqB;AAC5E,4DAA4D,0BAA0B;AACtF,8DAA8D,4BAA4B;AAC1F,kEAAkE,sBAAsB;AACxF,8DAA8D,sBAAsB;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,8CAA8C,kDAAkD,iDAAiD,+BAA+B,mCAAmC,0BAA0B,2CAA2C,mDAAmD,8EAA8E,WAAW;AAC/e,iHAAiH,2FAA2F,mCAAmC,sCAAsC,0BAA0B,uEAAuE,WAAW;AACjY;AACA;AACA;AACA,2EAA2E,8CAA8C,+CAA+C,kDAAkD,iDAAiD,+BAA+B,8BAA8B,mCAAmC,0BAA0B,2CAA2C,2CAA2C,mDAAmD,8EAA8E,WAAW;AACvmB,iHAAiH,2FAA2F,mCAAmC,mCAAmC,sCAAsC,0BAA0B,8DAA8D,oDAAoD,8HAA8H,WAAW;AAC7kB;AACA;AACA;AACA,2EAA2E,8CAA8C,iDAAiD,+BAA+B,0BAA0B,2CAA2C,8EAA8E,WAAW;AACvW,iHAAiH,2FAA2F,0BAA0B,mCAAmC,WAAW;AACpR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sDAAsD;AAC/D,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,YAAY;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,qBAAqB;AACrE,8CAA8C,mBAAmB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,SAAS;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,SAAS;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C,mCAAmC,OAAO;AAC1C,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,kBAAkB,iBAAiB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,qEAAqE,OAAO;AAC5E;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;;AAEA,CAAC","file":"SpinePluginDebug.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./SpinePlugin.js\");\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Blur Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded\r\n * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps\r\n * tab, or if they simply remove focus from the browser to another app.\r\n *\r\n * @event Phaser.Core.Events#BLUR\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'blur';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Boot Event.\r\n * \r\n * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running.\r\n * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required.\r\n *\r\n * @event Phaser.Core.Events#BOOT\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'boot';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Context Lost Event.\r\n * \r\n * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser.\r\n * \r\n * The partner event is `CONTEXT_RESTORED`.\r\n *\r\n * @event Phaser.Core.Events#CONTEXT_LOST\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'contextlost';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Context Restored Event.\r\n * \r\n * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser.\r\n * \r\n * The partner event is `CONTEXT_LOST`.\r\n *\r\n * @event Phaser.Core.Events#CONTEXT_RESTORED\r\n * @since 3.19.0\r\n */\r\nmodule.exports = 'contextrestored';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Destroy Event.\r\n * \r\n * This event is dispatched when the game instance has been told to destroy itself.\r\n * Lots of internal systems listen to this event in order to clear themselves out.\r\n * Custom plugins and game code should also do the same.\r\n *\r\n * @event Phaser.Core.Events#DESTROY\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Focus Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded\r\n * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it.\r\n *\r\n * @event Phaser.Core.Events#FOCUS\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'focus';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Hidden Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded\r\n * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted.\r\n * \r\n * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which\r\n * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something\r\n * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games)\r\n *\r\n * @event Phaser.Core.Events#HIDDEN\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'hidden';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Pause Event.\r\n * \r\n * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler.\r\n *\r\n * @event Phaser.Core.Events#PAUSE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'pause';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Post-Render Event.\r\n * \r\n * This event is dispatched right at the end of the render process.\r\n * \r\n * Every Scene will have rendered and been drawn to the canvas by the time this event is fired.\r\n * Use it for any last minute post-processing before the next game step begins.\r\n *\r\n * @event Phaser.Core.Events#POST_RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance.\r\n */\r\nmodule.exports = 'postrender';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Post-Step Event.\r\n * \r\n * This event is dispatched after the Scene Manager has updated.\r\n * Hook into it from plugins or systems that need to do things before the render starts.\r\n *\r\n * @event Phaser.Core.Events#POST_STEP\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'poststep';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Pre-Render Event.\r\n * \r\n * This event is dispatched immediately before any of the Scenes have started to render.\r\n * \r\n * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet.\r\n *\r\n * @event Phaser.Core.Events#PRE_RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance.\r\n */\r\nmodule.exports = 'prerender';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Pre-Step Event.\r\n * \r\n * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened.\r\n * Hook into it from plugins or systems that need to update before the Scene Manager does.\r\n *\r\n * @event Phaser.Core.Events#PRE_STEP\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'prestep';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Ready Event.\r\n * \r\n * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready,\r\n * and all local systems are now able to start.\r\n *\r\n * @event Phaser.Core.Events#READY\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'ready';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Resume Event.\r\n * \r\n * This event is dispatched when the game loop leaves a paused state and resumes running.\r\n *\r\n * @event Phaser.Core.Events#RESUME\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'resume';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Step Event.\r\n * \r\n * This event is dispatched after the Game Pre-Step and before the Scene Manager steps.\r\n * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have.\r\n *\r\n * @event Phaser.Core.Events#STEP\r\n * @since 3.0.0\r\n * \r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'step';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Visible Event.\r\n * \r\n * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded\r\n * enters a visible state, previously having been hidden.\r\n * \r\n * Only browsers that support the Visibility API will cause this event to be emitted.\r\n *\r\n * @event Phaser.Core.Events#VISIBLE\r\n * @since 3.0.0\r\n */\r\nmodule.exports = 'visible';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Core.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n BLUR: require('./BLUR_EVENT'),\r\n BOOT: require('./BOOT_EVENT'),\r\n CONTEXT_LOST: require('./CONTEXT_LOST_EVENT'),\r\n CONTEXT_RESTORED: require('./CONTEXT_RESTORED_EVENT'),\r\n DESTROY: require('./DESTROY_EVENT'),\r\n FOCUS: require('./FOCUS_EVENT'),\r\n HIDDEN: require('./HIDDEN_EVENT'),\r\n PAUSE: require('./PAUSE_EVENT'),\r\n POST_RENDER: require('./POST_RENDER_EVENT'),\r\n POST_STEP: require('./POST_STEP_EVENT'),\r\n PRE_RENDER: require('./PRE_RENDER_EVENT'),\r\n PRE_STEP: require('./PRE_STEP_EVENT'),\r\n READY: require('./READY_EVENT'),\r\n RESUME: require('./RESUME_EVENT'),\r\n STEP: require('./STEP_EVENT'),\r\n VISIBLE: require('./VISIBLE_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\nvar Events = require('./events');\r\n\r\n/**\r\n * @callback DataEachCallback\r\n *\r\n * @param {*} parent - The parent object of the DataManager.\r\n * @param {string} key - The key of the value.\r\n * @param {*} value - The value.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin.\r\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\r\n * or have a property called `events` that is an instance of it.\r\n *\r\n * @class DataManager\r\n * @memberof Phaser.Data\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {object} parent - The object that this DataManager belongs to.\r\n * @param {Phaser.Events.EventEmitter} [eventEmitter] - The DataManager's event emitter.\r\n */\r\nvar DataManager = new Class({\r\n\r\n initialize:\r\n\r\n function DataManager (parent, eventEmitter)\r\n {\r\n /**\r\n * The object that this DataManager belongs to.\r\n *\r\n * @name Phaser.Data.DataManager#parent\r\n * @type {*}\r\n * @since 3.0.0\r\n */\r\n this.parent = parent;\r\n\r\n /**\r\n * The DataManager's event emitter.\r\n *\r\n * @name Phaser.Data.DataManager#events\r\n * @type {Phaser.Events.EventEmitter}\r\n * @since 3.0.0\r\n */\r\n this.events = eventEmitter;\r\n\r\n if (!eventEmitter)\r\n {\r\n this.events = (parent.events) ? parent.events : parent;\r\n }\r\n\r\n /**\r\n * The data list.\r\n *\r\n * @name Phaser.Data.DataManager#list\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.0.0\r\n */\r\n this.list = {};\r\n\r\n /**\r\n * The public values list. You can use this to access anything you have stored\r\n * in this Data Manager. For example, if you set a value called `gold` you can\r\n * access it via:\r\n *\r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also modify it directly:\r\n *\r\n * ```javascript\r\n * this.data.values.gold += 1000;\r\n * ```\r\n *\r\n * Doing so will emit a `setdata` event from the parent of this Data Manager.\r\n *\r\n * Do not modify this object directly. Adding properties directly to this object will not\r\n * emit any events. Always use `DataManager.set` to create new items the first time around.\r\n *\r\n * @name Phaser.Data.DataManager#values\r\n * @type {Object.}\r\n * @default {}\r\n * @since 3.10.0\r\n */\r\n this.values = {};\r\n\r\n /**\r\n * Whether setting data is frozen for this DataManager.\r\n *\r\n * @name Phaser.Data.DataManager#_frozen\r\n * @type {boolean}\r\n * @private\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n this._frozen = false;\r\n\r\n if (!parent.hasOwnProperty('sys') && this.events)\r\n {\r\n this.events.once(Events.DESTROY, this.destroy, this);\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves the value for the given key, or undefined if it doesn't exist.\r\n *\r\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\r\n *\r\n * ```javascript\r\n * this.data.get('gold');\r\n * ```\r\n *\r\n * Or access the value directly:\r\n *\r\n * ```javascript\r\n * this.data.values.gold;\r\n * ```\r\n *\r\n * You can also pass in an array of keys, in which case an array of values will be returned:\r\n *\r\n * ```javascript\r\n * this.data.get([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * This approach is useful for destructuring arrays in ES6.\r\n *\r\n * @method Phaser.Data.DataManager#get\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\r\n *\r\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\r\n */\r\n get: function (key)\r\n {\r\n var list = this.list;\r\n\r\n if (Array.isArray(key))\r\n {\r\n var output = [];\r\n\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n output.push(list[key[i]]);\r\n }\r\n\r\n return output;\r\n }\r\n else\r\n {\r\n return list[key];\r\n }\r\n },\r\n\r\n /**\r\n * Retrieves all data values in a new object.\r\n *\r\n * @method Phaser.Data.DataManager#getAll\r\n * @since 3.0.0\r\n *\r\n * @return {Object.} All data values.\r\n */\r\n getAll: function ()\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Queries the DataManager for the values of keys matching the given regular expression.\r\n *\r\n * @method Phaser.Data.DataManager#query\r\n * @since 3.0.0\r\n *\r\n * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).\r\n *\r\n * @return {Object.} The values of the keys matching the search string.\r\n */\r\n query: function (search)\r\n {\r\n var results = {};\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list.hasOwnProperty(key) && key.match(search))\r\n {\r\n results[key] = this.list[key];\r\n }\r\n }\r\n\r\n return results;\r\n },\r\n\r\n /**\r\n * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created.\r\n *\r\n * ```javascript\r\n * data.set('name', 'Red Gem Stone');\r\n * ```\r\n *\r\n * You can also pass in an object of key value pairs as the first argument:\r\n *\r\n * ```javascript\r\n * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\r\n * ```\r\n *\r\n * To get a value back again you can call `get`:\r\n *\r\n * ```javascript\r\n * data.get('gold');\r\n * ```\r\n *\r\n * Or you can access the value directly via the `values` property, where it works like any other variable:\r\n *\r\n * ```javascript\r\n * data.values.gold += 50;\r\n * ```\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\r\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\r\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\r\n *\r\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#set\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored.\r\n * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored.\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n set: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (typeof key === 'string')\r\n {\r\n return this.setValue(key, data);\r\n }\r\n else\r\n {\r\n for (var entry in key)\r\n {\r\n this.setValue(entry, key[entry]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0.\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * @method Phaser.Data.DataManager#inc\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.23.0\r\n *\r\n * @param {(string|object)} key - The key to increase the value for.\r\n * @param {*} [data] - The value to increase for the given key.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n inc: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (data === undefined)\r\n {\r\n data = 1;\r\n }\r\n\r\n var value = this.get(key);\r\n if (value === undefined)\r\n {\r\n value = 0;\r\n }\r\n\r\n this.set(key, (value + data));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false.\r\n *\r\n * When the value is first set, a `setdata` event is emitted.\r\n *\r\n * @method Phaser.Data.DataManager#toggle\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.23.0\r\n *\r\n * @param {(string|object)} key - The key to toggle the value for.\r\n *\r\n * @return {Phaser.Data.DataManager} This DataManager object.\r\n */\r\n toggle: function (key)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n this.set(key, !this.get(key));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value setter, called automatically by the `set` method.\r\n *\r\n * @method Phaser.Data.DataManager#setValue\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @private\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n * @param {*} data - The value to set.\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n setValue: function (key, data)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (this.has(key))\r\n {\r\n // Hit the key getter, which will in turn emit the events.\r\n this.values[key] = data;\r\n }\r\n else\r\n {\r\n var _this = this;\r\n var list = this.list;\r\n var events = this.events;\r\n var parent = this.parent;\r\n\r\n Object.defineProperty(this.values, key, {\r\n\r\n enumerable: true,\r\n\r\n configurable: true,\r\n\r\n get: function ()\r\n {\r\n return list[key];\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (!_this._frozen)\r\n {\r\n var previousValue = list[key];\r\n list[key] = value;\r\n\r\n events.emit(Events.CHANGE_DATA, parent, key, value, previousValue);\r\n events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue);\r\n }\r\n }\r\n\r\n });\r\n\r\n list[key] = data;\r\n\r\n events.emit(Events.SET_DATA, parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all data entries to the given callback.\r\n *\r\n * @method Phaser.Data.DataManager#each\r\n * @since 3.0.0\r\n *\r\n * @param {DataEachCallback} callback - The function to call.\r\n * @param {*} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ this.parent, null, undefined ];\r\n\r\n for (var i = 1; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (var key in this.list)\r\n {\r\n args[1] = key;\r\n args[2] = this.list[key];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Merge the given object of key value pairs into this DataManager.\r\n *\r\n * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument)\r\n * will emit a `changedata` event.\r\n *\r\n * @method Phaser.Data.DataManager#merge\r\n * @fires Phaser.Data.Events#SET_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA\r\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.0.0\r\n *\r\n * @param {Object.} data - The data to merge.\r\n * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true.\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n merge: function (data, overwrite)\r\n {\r\n if (overwrite === undefined) { overwrite = true; }\r\n\r\n // Merge data from another component into this one\r\n for (var key in data)\r\n {\r\n if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key))))\r\n {\r\n this.setValue(key, data[key]);\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Remove the value for the given key.\r\n *\r\n * If the key is found in this Data Manager it is removed from the internal lists and a\r\n * `removedata` event is emitted.\r\n *\r\n * You can also pass in an array of keys, in which case all keys in the array will be removed:\r\n *\r\n * ```javascript\r\n * this.data.remove([ 'gold', 'armor', 'health' ]);\r\n * ```\r\n *\r\n * @method Phaser.Data.DataManager#remove\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} key - The key to remove, or an array of keys to remove.\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n remove: function (key)\r\n {\r\n if (this._frozen)\r\n {\r\n return this;\r\n }\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n this.removeValue(key[i]);\r\n }\r\n }\r\n else\r\n {\r\n return this.removeValue(key);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal value remover, called automatically by the `remove` method.\r\n *\r\n * @method Phaser.Data.DataManager#removeValue\r\n * @private\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.10.0\r\n *\r\n * @param {string} key - The key to set the value for.\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n removeValue: function (key)\r\n {\r\n if (this.has(key))\r\n {\r\n var data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it.\r\n *\r\n * @method Phaser.Data.DataManager#pop\r\n * @fires Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the value to retrieve and delete.\r\n *\r\n * @return {*} The value of the given key.\r\n */\r\n pop: function (key)\r\n {\r\n var data = undefined;\r\n\r\n if (!this._frozen && this.has(key))\r\n {\r\n data = this.list[key];\r\n\r\n delete this.list[key];\r\n delete this.values[key];\r\n\r\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\r\n }\r\n\r\n return data;\r\n },\r\n\r\n /**\r\n * Determines whether the given key is set in this Data Manager.\r\n *\r\n * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings.\r\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\r\n *\r\n * @method Phaser.Data.DataManager#has\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key to check.\r\n *\r\n * @return {boolean} Returns `true` if the key exists, otherwise `false`.\r\n */\r\n has: function (key)\r\n {\r\n return this.list.hasOwnProperty(key);\r\n },\r\n\r\n /**\r\n * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts\r\n * to create new values or update existing ones.\r\n *\r\n * @method Phaser.Data.DataManager#setFreeze\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether to freeze or unfreeze the Data Manager.\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n setFreeze: function (value)\r\n {\r\n this._frozen = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Delete all data in this Data Manager and unfreeze it.\r\n *\r\n * @method Phaser.Data.DataManager#reset\r\n * @since 3.0.0\r\n *\r\n * @return {this} This DataManager object.\r\n */\r\n reset: function ()\r\n {\r\n for (var key in this.list)\r\n {\r\n delete this.list[key];\r\n delete this.values[key];\r\n }\r\n\r\n this._frozen = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Destroy this data manager.\r\n *\r\n * @method Phaser.Data.DataManager#destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n this.reset();\r\n\r\n this.events.off(Events.CHANGE_DATA);\r\n this.events.off(Events.SET_DATA);\r\n this.events.off(Events.REMOVE_DATA);\r\n\r\n this.parent = null;\r\n },\r\n\r\n /**\r\n * Gets or sets the frozen state of this Data Manager.\r\n * A frozen Data Manager will block all attempts to create new values or update existing ones.\r\n *\r\n * @name Phaser.Data.DataManager#freeze\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n freeze: {\r\n\r\n get: function ()\r\n {\r\n return this._frozen;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._frozen = (value) ? true : false;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Return the total number of entries in this Data Manager.\r\n *\r\n * @name Phaser.Data.DataManager#count\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n count: {\r\n\r\n get: function ()\r\n {\r\n var i = 0;\r\n\r\n for (var key in this.list)\r\n {\r\n if (this.list[key] !== undefined)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n return i;\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = DataManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`.\r\n * \r\n * This event is dispatched for all items that change in the Data Manager.\r\n * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} value - The new value of the item in the Data Manager.\r\n * @param {any} previousValue - The previous value of the item in the Data Manager.\r\n */\r\nmodule.exports = 'changedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Change Data Key Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item in the data store is changed.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`,\r\n * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold`\r\n * then you can listen for `sprite.data.on('changedata-gold')`.\r\n *\r\n * @event Phaser.Data.Events#CHANGE_DATA_KEY\r\n * @since 3.16.1\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'changedata-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Data Manager Destroy Event.\r\n *\r\n * The Data Manager will listen for the destroy event from its parent, and then close itself down.\r\n *\r\n * @event Phaser.Data.Events#DESTROY\r\n * @since 3.50.0\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Remove Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when an item is removed from it.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#REMOVE_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'removedata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Set Data Event.\r\n * \r\n * This event is dispatched by a Data Manager when a new item is added to the data store.\r\n * \r\n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\r\n * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`.\r\n *\r\n * @event Phaser.Data.Events#SET_DATA\r\n * @since 3.0.0\r\n * \r\n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\r\n * @param {string} key - The unique key of the data item within the Data Manager.\r\n * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\r\n */\r\nmodule.exports = 'setdata';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Data.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CHANGE_DATA: require('./CHANGE_DATA_EVENT'),\r\n CHANGE_DATA_KEY: require('./CHANGE_DATA_KEY_EVENT'),\r\n DESTROY: require('./DESTROY_EVENT'),\r\n REMOVE_DATA: require('./REMOVE_DATA_EVENT'),\r\n SET_DATA: require('./SET_DATA_EVENT')\r\n\r\n};\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Given a hex color value, such as 0xff00ff (for purple), it will return a\n * numeric representation of it (i.e. 16711935) for use in WebGL tinting.\n *\n * @function Phaser.Display.Color.GetColorFromValue\n * @since 3.50.0\n *\n * @param {number} red - The hex color value, such as 0xff0000.\n *\n * @return {number} The combined color value.\n */\nvar GetColorFromValue = function (value)\n{\n return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n};\n\nmodule.exports = GetColorFromValue;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar GameEvents = require('../../core/events');\r\n\r\n/**\r\n * @classdesc\r\n * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel.\r\n * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask,\r\n * not a clipping path. It is only available when using the WebGL Renderer.\r\n *\r\n * A Bitmap Mask can use any Game Object to determine the alpha of each pixel of the masked Game Object(s).\r\n * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha\r\n * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the\r\n * Bitmap Mask doesn't matter.\r\n *\r\n * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an\r\n * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means\r\n * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects\r\n * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the\r\n * corresponding pixel in the mask.\r\n *\r\n * The Bitmap Mask's location matches the location of its Game Object, not the location of the\r\n * masked objects. Moving or transforming the underlying Game Object will change the mask\r\n * (and affect the visibility of any masked objects), whereas moving or transforming a masked object\r\n * will not affect the mask.\r\n *\r\n * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a\r\n * Scene's display list, it will only be used for the mask and its full texture will not be directly\r\n * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will\r\n * render as a normal Game Object and will also serve as a mask.\r\n *\r\n * @class BitmapMask\r\n * @memberof Phaser.Display.Masks\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - The Scene which this Bitmap Mask will be used in.\r\n * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite.\r\n */\r\nvar BitmapMask = new Class({\r\n\r\n initialize:\r\n\r\n function BitmapMask (scene, renderable)\r\n {\r\n var renderer = scene.sys.game.renderer;\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Mask is using.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.11.0\r\n */\r\n this.renderer = renderer;\r\n\r\n /**\r\n * A renderable Game Object that uses a texture, such as a Sprite.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#bitmapMask\r\n * @type {Phaser.GameObjects.GameObject}\r\n * @since 3.0.0\r\n */\r\n this.bitmapMask = renderable;\r\n\r\n /**\r\n * The texture used for the mask's framebuffer.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#maskTexture\r\n * @type {WebGLTexture}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.maskTexture = null;\r\n\r\n /**\r\n * The texture used for the main framebuffer.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#mainTexture\r\n * @type {WebGLTexture}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n this.mainTexture = null;\r\n\r\n /**\r\n * Whether the Bitmap Mask is dirty and needs to be updated.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#dirty\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n this.dirty = true;\r\n\r\n /**\r\n * The framebuffer to which a masked Game Object is rendered.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#mainFramebuffer\r\n * @type {WebGLFramebuffer}\r\n * @since 3.0.0\r\n */\r\n this.mainFramebuffer = null;\r\n\r\n /**\r\n * The framebuffer to which the Bitmap Mask's masking Game Object is rendered.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#maskFramebuffer\r\n * @type {WebGLFramebuffer}\r\n * @since 3.0.0\r\n */\r\n this.maskFramebuffer = null;\r\n\r\n /**\r\n * The previous framebuffer set in the renderer before this one was enabled.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#prevFramebuffer\r\n * @type {WebGLFramebuffer}\r\n * @since 3.17.0\r\n */\r\n this.prevFramebuffer = null;\r\n\r\n /**\r\n * Whether to invert the masks alpha.\r\n *\r\n * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible.\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#invertAlpha\r\n * @type {boolean}\r\n * @since 3.1.2\r\n */\r\n this.invertAlpha = false;\r\n\r\n /**\r\n * Is this mask a stencil mask?\r\n *\r\n * @name Phaser.Display.Masks.BitmapMask#isStencil\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.isStencil = false;\r\n\r\n if (renderer && renderer.gl)\r\n {\r\n var width = renderer.width;\r\n var height = renderer.height;\r\n var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0);\r\n var gl = renderer.gl;\r\n var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;\r\n var filter = gl.LINEAR;\r\n\r\n this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true);\r\n this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true);\r\n\r\n scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer)\r\n {\r\n var width = renderer.width;\r\n var height = renderer.height;\r\n var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0);\r\n var gl = renderer.gl;\r\n var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;\r\n var filter = gl.LINEAR;\r\n\r\n this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\r\n this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true);\r\n this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true);\r\n\r\n }, this);\r\n }\r\n },\r\n\r\n /**\r\n * Sets a new masking Game Object for the Bitmap Mask.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#setBitmap\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite.\r\n */\r\n setBitmap: function (renderable)\r\n {\r\n this.bitmapMask = renderable;\r\n },\r\n\r\n /**\r\n * Prepares the WebGL Renderer to render a Game Object with this mask applied.\r\n *\r\n * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare.\r\n * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to.\r\n */\r\n preRenderWebGL: function (renderer, maskedObject, camera)\r\n {\r\n renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera);\r\n },\r\n\r\n /**\r\n * Finalizes rendering of a masked Game Object.\r\n *\r\n * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up.\r\n */\r\n postRenderWebGL: function (renderer, camera)\r\n {\r\n renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera);\r\n },\r\n\r\n /**\r\n * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to.\r\n * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to.\r\n */\r\n preRenderCanvas: function ()\r\n {\r\n // NOOP\r\n },\r\n\r\n /**\r\n * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to.\r\n */\r\n postRenderCanvas: function ()\r\n {\r\n // NOOP\r\n },\r\n\r\n /**\r\n * Destroys this BitmapMask and nulls any references it holds.\r\n *\r\n * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it,\r\n * so be sure to call `clearMask` on any Game Object using it, before destroying it.\r\n *\r\n * @method Phaser.Display.Masks.BitmapMask#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.bitmapMask = null;\r\n\r\n var renderer = this.renderer;\r\n\r\n if (renderer && renderer.gl)\r\n {\r\n renderer.deleteTexture(this.mainTexture);\r\n renderer.deleteTexture(this.maskTexture);\r\n renderer.deleteFramebuffer(this.mainFramebuffer);\r\n renderer.deleteFramebuffer(this.maskFramebuffer);\r\n }\r\n\r\n this.mainTexture = null;\r\n this.maskTexture = null;\r\n this.mainFramebuffer = null;\r\n this.maskFramebuffer = null;\r\n this.prevFramebuffer = null;\r\n this.renderer = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BitmapMask;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect\r\n * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only\r\n * make a masked pixel fully visible or fully invisible without changing its alpha (opacity).\r\n *\r\n * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s)\r\n * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed\r\n * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and\r\n * alpha of the pixel from the Geometry Mask do not matter.\r\n *\r\n * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects.\r\n * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility\r\n * of any masked objects), whereas moving or transforming a masked object will not affect the mask.\r\n * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed\r\n * in front of all masked objects which has its own visual properties and, naturally, respects the camera's\r\n * visual properties, but isn't affected by and doesn't follow the masked objects by itself.\r\n *\r\n * @class GeometryMask\r\n * @memberof Phaser.Display.Masks\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - This parameter is not used.\r\n * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List.\r\n */\r\nvar GeometryMask = new Class({\r\n\r\n initialize:\r\n\r\n function GeometryMask (scene, graphicsGeometry)\r\n {\r\n /**\r\n * The Graphics object which describes the Geometry Mask.\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#geometryMask\r\n * @type {Phaser.GameObjects.Graphics}\r\n * @since 3.0.0\r\n */\r\n this.geometryMask = graphicsGeometry;\r\n\r\n /**\r\n * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels\r\n * drawn to the Geometry Mask.\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#invertAlpha\r\n * @type {boolean}\r\n * @since 3.16.0\r\n */\r\n this.invertAlpha = false;\r\n\r\n /**\r\n * Is this mask a stencil mask?\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#isStencil\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.17.0\r\n */\r\n this.isStencil = true;\r\n\r\n /**\r\n * The current stencil level.\r\n *\r\n * @name Phaser.Display.Masks.GeometryMask#level\r\n * @type {boolean}\r\n * @private\r\n * @since 3.17.0\r\n */\r\n this.level = 0;\r\n },\r\n\r\n /**\r\n * Sets a new Graphics object for the Geometry Mask.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#setShape\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask.\r\n * \r\n * @return {this} This Geometry Mask\r\n */\r\n setShape: function (graphicsGeometry)\r\n {\r\n this.geometryMask = graphicsGeometry;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the `invertAlpha` property of this Geometry Mask.\r\n * Inverting the alpha essentially flips the way the mask works.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha\r\n * @since 3.17.0\r\n *\r\n * @param {boolean} [value=true] - Invert the alpha of this mask?\r\n * \r\n * @return {this} This Geometry Mask\r\n */\r\n setInvertAlpha: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.invertAlpha = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\r\n */\r\n preRenderWebGL: function (renderer, child, camera)\r\n {\r\n var gl = renderer.gl;\r\n\r\n // Force flushing before drawing to stencil buffer\r\n renderer.flush();\r\n\r\n if (renderer.maskStack.length === 0)\r\n {\r\n gl.enable(gl.STENCIL_TEST);\r\n gl.clear(gl.STENCIL_BUFFER_BIT);\r\n\r\n renderer.maskCount = 0;\r\n }\r\n\r\n if (renderer.currentCameraMask.mask !== this)\r\n {\r\n renderer.currentMask.mask = this;\r\n }\r\n\r\n renderer.maskStack.push({ mask: this, camera: camera });\r\n\r\n this.applyStencil(renderer, camera, true);\r\n\r\n renderer.maskCount++;\r\n },\r\n\r\n /**\r\n * Applies the current stencil mask to the renderer.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#applyStencil\r\n * @since 3.17.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\r\n * @param {boolean} inc - Is this an INCR stencil or a DECR stencil?\r\n */\r\n applyStencil: function (renderer, camera, inc)\r\n {\r\n var gl = renderer.gl;\r\n var geometryMask = this.geometryMask;\r\n var level = renderer.maskCount;\r\n\r\n gl.colorMask(false, false, false, false);\r\n\r\n if (inc)\r\n {\r\n gl.stencilFunc(gl.EQUAL, level, 0xFF);\r\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\r\n }\r\n else\r\n {\r\n gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\r\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\r\n }\r\n\r\n // Write stencil buffer\r\n geometryMask.renderWebGL(renderer, geometryMask, 0, camera);\r\n\r\n renderer.flush();\r\n\r\n gl.colorMask(true, true, true, true);\r\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\r\n\r\n if (inc)\r\n {\r\n if (this.invertAlpha)\r\n {\r\n gl.stencilFunc(gl.NOTEQUAL, level + 1, 0xFF);\r\n }\r\n else\r\n {\r\n gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\r\n }\r\n }\r\n else if (this.invertAlpha)\r\n {\r\n gl.stencilFunc(gl.NOTEQUAL, level, 0xFF);\r\n }\r\n else\r\n {\r\n gl.stencilFunc(gl.EQUAL, level, 0xFF);\r\n }\r\n },\r\n\r\n /**\r\n * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush.\r\n */\r\n postRenderWebGL: function (renderer)\r\n {\r\n var gl = renderer.gl;\r\n\r\n renderer.maskStack.pop();\r\n\r\n renderer.maskCount--;\r\n\r\n if (renderer.maskStack.length === 0)\r\n {\r\n // If this is the only mask in the stack, flush and disable\r\n renderer.flush();\r\n\r\n renderer.currentMask.mask = null;\r\n\r\n gl.disable(gl.STENCIL_TEST);\r\n }\r\n else\r\n {\r\n // Force flush before disabling stencil test\r\n renderer.flush();\r\n\r\n var prev = renderer.maskStack[renderer.maskStack.length - 1];\r\n\r\n prev.mask.applyStencil(renderer, prev.camera, false);\r\n\r\n if (renderer.currentCameraMask.mask !== prev.mask)\r\n {\r\n renderer.currentMask.mask = prev.mask;\r\n renderer.currentMask.camera = prev.camera;\r\n }\r\n else\r\n {\r\n renderer.currentMask.mask = null;\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on.\r\n * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\r\n */\r\n preRenderCanvas: function (renderer, mask, camera)\r\n {\r\n var geometryMask = this.geometryMask;\r\n\r\n renderer.currentContext.save();\r\n\r\n geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true);\r\n\r\n renderer.currentContext.clip();\r\n },\r\n\r\n /**\r\n * Restore the canvas context's previous clipping path, thus turning off the mask for it.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored.\r\n */\r\n postRenderCanvas: function (renderer)\r\n {\r\n renderer.currentContext.restore();\r\n },\r\n\r\n /**\r\n * Destroys this GeometryMask and nulls any references it holds.\r\n *\r\n * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it,\r\n * so be sure to call `clearMask` on any Game Object using it, before destroying it.\r\n *\r\n * @method Phaser.Display.Masks.GeometryMask#destroy\r\n * @since 3.7.0\r\n */\r\n destroy: function ()\r\n {\r\n this.geometryMask = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = GeometryMask;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = require('../renderer/BlendModes');\r\nvar GetAdvancedValue = require('../utils/object/GetAdvancedValue');\r\n\r\n/**\r\n * Builds a Game Object using the provided configuration object.\r\n *\r\n * @function Phaser.GameObjects.BuildGameObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene.\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.\r\n * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with.\r\n *\r\n * @return {Phaser.GameObjects.GameObject} The built Game Object.\r\n */\r\nvar BuildGameObject = function (scene, gameObject, config)\r\n{\r\n // Position\r\n\r\n gameObject.x = GetAdvancedValue(config, 'x', 0);\r\n gameObject.y = GetAdvancedValue(config, 'y', 0);\r\n gameObject.depth = GetAdvancedValue(config, 'depth', 0);\r\n\r\n // Flip\r\n\r\n gameObject.flipX = GetAdvancedValue(config, 'flipX', false);\r\n gameObject.flipY = GetAdvancedValue(config, 'flipY', false);\r\n\r\n // Scale\r\n // Either: { scale: 2 } or { scale: { x: 2, y: 2 }}\r\n\r\n var scale = GetAdvancedValue(config, 'scale', null);\r\n\r\n if (typeof scale === 'number')\r\n {\r\n gameObject.setScale(scale);\r\n }\r\n else if (scale !== null)\r\n {\r\n gameObject.scaleX = GetAdvancedValue(scale, 'x', 1);\r\n gameObject.scaleY = GetAdvancedValue(scale, 'y', 1);\r\n }\r\n\r\n // ScrollFactor\r\n // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }}\r\n\r\n var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null);\r\n\r\n if (typeof scrollFactor === 'number')\r\n {\r\n gameObject.setScrollFactor(scrollFactor);\r\n }\r\n else if (scrollFactor !== null)\r\n {\r\n gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1);\r\n gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1);\r\n }\r\n\r\n // Rotation\r\n\r\n gameObject.rotation = GetAdvancedValue(config, 'rotation', 0);\r\n\r\n var angle = GetAdvancedValue(config, 'angle', null);\r\n\r\n if (angle !== null)\r\n {\r\n gameObject.angle = angle;\r\n }\r\n\r\n // Alpha\r\n\r\n gameObject.alpha = GetAdvancedValue(config, 'alpha', 1);\r\n\r\n // Origin\r\n // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }}\r\n\r\n var origin = GetAdvancedValue(config, 'origin', null);\r\n\r\n if (typeof origin === 'number')\r\n {\r\n gameObject.setOrigin(origin);\r\n }\r\n else if (origin !== null)\r\n {\r\n var ox = GetAdvancedValue(origin, 'x', 0.5);\r\n var oy = GetAdvancedValue(origin, 'y', 0.5);\r\n\r\n gameObject.setOrigin(ox, oy);\r\n }\r\n\r\n // BlendMode\r\n\r\n gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL);\r\n\r\n // Visible\r\n\r\n gameObject.visible = GetAdvancedValue(config, 'visible', true);\r\n\r\n // Add to Scene\r\n\r\n var add = GetAdvancedValue(config, 'add', true);\r\n\r\n if (add)\r\n {\r\n scene.sys.displayList.add(gameObject);\r\n }\r\n\r\n if (gameObject.preUpdate)\r\n {\r\n scene.sys.updateList.add(gameObject);\r\n }\r\n\r\n return gameObject;\r\n};\r\n\r\nmodule.exports = BuildGameObject;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../utils/Class');\nvar ComponentsToJSON = require('./components/ToJSON');\nvar DataManager = require('../data/DataManager');\nvar EventEmitter = require('eventemitter3');\nvar Events = require('./events');\n\n/**\n * @classdesc\n * The base class that all Game Objects extend.\n * You don't create GameObjects directly and they cannot be added to the display list.\n * Instead, use them as the base for your own custom classes.\n *\n * @class GameObject\n * @memberof Phaser.GameObjects\n * @extends Phaser.Events.EventEmitter\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\n * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`.\n */\nvar GameObject = new Class({\n\n Extends: EventEmitter,\n\n initialize:\n\n function GameObject (scene, type)\n {\n EventEmitter.call(this);\n\n /**\n * The Scene to which this Game Object belongs.\n * Game Objects can only belong to one Scene.\n *\n * @name Phaser.GameObjects.GameObject#scene\n * @type {Phaser.Scene}\n * @protected\n * @since 3.0.0\n */\n this.scene = scene;\n\n /**\n * A textual representation of this Game Object, i.e. `sprite`.\n * Used internally by Phaser but is available for your own custom classes to populate.\n *\n * @name Phaser.GameObjects.GameObject#type\n * @type {string}\n * @since 3.0.0\n */\n this.type = type;\n\n /**\n * The current state of this Game Object.\n *\n * Phaser itself will never modify this value, although plugins may do so.\n *\n * Use this property to track the state of a Game Object during its lifetime. For example, it could change from\n * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant\n * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons.\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\n *\n * @name Phaser.GameObjects.GameObject#state\n * @type {(integer|string)}\n * @since 3.16.0\n */\n this.state = 0;\n\n /**\n * The parent Container of this Game Object, if it has one.\n *\n * @name Phaser.GameObjects.GameObject#parentContainer\n * @type {Phaser.GameObjects.Container}\n * @since 3.4.0\n */\n this.parentContainer = null;\n\n /**\n * The name of this Game Object.\n * Empty by default and never populated by Phaser, this is left for developers to use.\n *\n * @name Phaser.GameObjects.GameObject#name\n * @type {string}\n * @default ''\n * @since 3.0.0\n */\n this.name = '';\n\n /**\n * The active state of this Game Object.\n * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it.\n * An active object is one which is having its logic and internal systems updated.\n *\n * @name Phaser.GameObjects.GameObject#active\n * @type {boolean}\n * @default true\n * @since 3.0.0\n */\n this.active = true;\n\n /**\n * The Tab Index of the Game Object.\n * Reserved for future use by plugins and the Input Manager.\n *\n * @name Phaser.GameObjects.GameObject#tabIndex\n * @type {integer}\n * @default -1\n * @since 3.0.0\n */\n this.tabIndex = -1;\n\n /**\n * A Data Manager.\n * It allows you to store, query and get key/value paired information specific to this Game Object.\n * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`.\n *\n * @name Phaser.GameObjects.GameObject#data\n * @type {Phaser.Data.DataManager}\n * @default null\n * @since 3.0.0\n */\n this.data = null;\n\n /**\n * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.\n * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.\n * If those components are not used by your custom class then you can use this bitmask as you wish.\n *\n * @name Phaser.GameObjects.GameObject#renderFlags\n * @type {integer}\n * @default 15\n * @since 3.0.0\n */\n this.renderFlags = 15;\n\n /**\n * A bitmask that controls if this Game Object is drawn by a Camera or not.\n * Not usually set directly, instead call `Camera.ignore`, however you can\n * set this property directly using the Camera.id property:\n *\n * @example\n * this.cameraFilter |= camera.id\n *\n * @name Phaser.GameObjects.GameObject#cameraFilter\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.cameraFilter = 0;\n\n /**\n * If this Game Object is enabled for input then this property will contain an InteractiveObject instance.\n * Not usually set directly. Instead call `GameObject.setInteractive()`.\n *\n * @name Phaser.GameObjects.GameObject#input\n * @type {?Phaser.Types.Input.InteractiveObject}\n * @default null\n * @since 3.0.0\n */\n this.input = null;\n\n /**\n * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body.\n *\n * @name Phaser.GameObjects.GameObject#body\n * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)}\n * @default null\n * @since 3.0.0\n */\n this.body = null;\n\n /**\n * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`.\n * This includes calls that may come from a Group, Container or the Scene itself.\n * While it allows you to persist a Game Object across Scenes, please understand you are entirely\n * responsible for managing references to and from this Game Object.\n *\n * @name Phaser.GameObjects.GameObject#ignoreDestroy\n * @type {boolean}\n * @default false\n * @since 3.5.0\n */\n this.ignoreDestroy = false;\n\n // Tell the Scene to re-sort the children\n scene.sys.queueDepthSort();\n },\n\n /**\n * Sets the `active` property of this Game Object and returns this Game Object for further chaining.\n * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList.\n *\n * @method Phaser.GameObjects.GameObject#setActive\n * @since 3.0.0\n *\n * @param {boolean} value - True if this Game Object should be set as active, false if not.\n *\n * @return {this} This GameObject.\n */\n setActive: function (value)\n {\n this.active = value;\n\n return this;\n },\n\n /**\n * Sets the `name` property of this Game Object and returns this Game Object for further chaining.\n * The `name` property is not populated by Phaser and is presented for your own use.\n *\n * @method Phaser.GameObjects.GameObject#setName\n * @since 3.0.0\n *\n * @param {string} value - The name to be given to this Game Object.\n *\n * @return {this} This GameObject.\n */\n setName: function (value)\n {\n this.name = value;\n\n return this;\n },\n\n /**\n * Sets the current state of this Game Object.\n *\n * Phaser itself will never modify the State of a Game Object, although plugins may do so.\n *\n * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'.\n * The state value should typically be an integer (ideally mapped to a constant\n * in your game code), but could also be a string. It is recommended to keep it light and simple.\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\n *\n * @method Phaser.GameObjects.GameObject#setState\n * @since 3.16.0\n *\n * @param {(integer|string)} value - The state of the Game Object.\n *\n * @return {this} This GameObject.\n */\n setState: function (value)\n {\n this.state = value;\n\n return this;\n },\n\n /**\n * Adds a Data Manager component to this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#setDataEnabled\n * @since 3.0.0\n * @see Phaser.Data.DataManager\n *\n * @return {this} This GameObject.\n */\n setDataEnabled: function ()\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n return this;\n },\n\n /**\n * Allows you to store a key value pair within this Game Objects Data Manager.\n *\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\n * before setting the value.\n *\n * If the key doesn't already exist in the Data Manager then it is created.\n *\n * ```javascript\n * sprite.setData('name', 'Red Gem Stone');\n * ```\n *\n * You can also pass in an object of key value pairs as the first argument:\n *\n * ```javascript\n * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\n * ```\n *\n * To get a value back again you can call `getData`:\n *\n * ```javascript\n * sprite.getData('gold');\n * ```\n *\n * Or you can access the value directly via the `values` property, where it works like any other variable:\n *\n * ```javascript\n * sprite.data.values.gold += 50;\n * ```\n *\n * When the value is first set, a `setdata` event is emitted from this Game Object.\n *\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\n *\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\n *\n * @method Phaser.GameObjects.GameObject#setData\n * @since 3.0.0\n *\n * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored.\n * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored.\n *\n * @return {this} This GameObject.\n */\n setData: function (key, value)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n this.data.set(key, value);\n\n return this;\n },\n\n /**\n * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0.\n *\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\n * before setting the value.\n *\n * If the key doesn't already exist in the Data Manager then it is created.\n *\n * When the value is first set, a `setdata` event is emitted from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#incData\n * @since 3.23.0\n *\n * @param {(string|object)} key - The key to increase the value for.\n * @param {*} [data] - The value to increase for the given key.\n *\n * @return {this} This GameObject.\n */\n incData: function (key, value)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n this.data.inc(key, value);\n\n return this;\n },\n\n /**\n * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false.\n *\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\n * before setting the value.\n *\n * If the key doesn't already exist in the Data Manager then it is created.\n *\n * When the value is first set, a `setdata` event is emitted from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#toggleData\n * @since 3.23.0\n *\n * @param {(string|object)} key - The key to toggle the value for.\n *\n * @return {this} This GameObject.\n */\n toggleData: function (key)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n this.data.toggle(key);\n\n return this;\n },\n\n /**\n * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.\n *\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\n *\n * ```javascript\n * sprite.getData('gold');\n * ```\n *\n * Or access the value directly:\n *\n * ```javascript\n * sprite.data.values.gold;\n * ```\n *\n * You can also pass in an array of keys, in which case an array of values will be returned:\n *\n * ```javascript\n * sprite.getData([ 'gold', 'armor', 'health' ]);\n * ```\n *\n * This approach is useful for destructuring arrays in ES6.\n *\n * @method Phaser.GameObjects.GameObject#getData\n * @since 3.0.0\n *\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\n *\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\n */\n getData: function (key)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n return this.data.get(key);\n },\n\n /**\n * Pass this Game Object to the Input Manager to enable it for Input.\n *\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\n * input detection.\n *\n * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If\n * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific\n * shape for it to use.\n *\n * You can also provide an Input Configuration Object as the only argument to this method.\n *\n * @example\n * sprite.setInteractive();\n *\n * @example\n * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains);\n *\n * @example\n * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains);\n *\n * @method Phaser.GameObjects.GameObject#setInteractive\n * @since 3.0.0\n *\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame.\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback.\n * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target?\n *\n * @return {this} This GameObject.\n */\n setInteractive: function (hitArea, hitAreaCallback, dropZone)\n {\n this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone);\n\n return this;\n },\n\n /**\n * If this Game Object has previously been enabled for input, this will disable it.\n *\n * An object that is disabled for input stops processing or being considered for\n * input events, but can be turned back on again at any time by simply calling\n * `setInteractive()` with no arguments provided.\n *\n * If want to completely remove interaction from this Game Object then use `removeInteractive` instead.\n *\n * @method Phaser.GameObjects.GameObject#disableInteractive\n * @since 3.7.0\n *\n * @return {this} This GameObject.\n */\n disableInteractive: function ()\n {\n if (this.input)\n {\n this.input.enabled = false;\n }\n\n return this;\n },\n\n /**\n * If this Game Object has previously been enabled for input, this will queue it\n * for removal, causing it to no longer be interactive. The removal happens on\n * the next game step, it is not immediate.\n *\n * The Interactive Object that was assigned to this Game Object will be destroyed,\n * removed from the Input Manager and cleared from this Game Object.\n *\n * If you wish to re-enable this Game Object at a later date you will need to\n * re-create its InteractiveObject by calling `setInteractive` again.\n *\n * If you wish to only temporarily stop an object from receiving input then use\n * `disableInteractive` instead, as that toggles the interactive state, where-as\n * this erases it completely.\n *\n * If you wish to resize a hit area, don't remove and then set it as being\n * interactive. Instead, access the hitarea object directly and resize the shape\n * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the\n * shape is a Rectangle, which it is by default.)\n *\n * @method Phaser.GameObjects.GameObject#removeInteractive\n * @since 3.7.0\n *\n * @return {this} This GameObject.\n */\n removeInteractive: function ()\n {\n this.scene.sys.input.clear(this);\n\n this.input = undefined;\n\n return this;\n },\n\n /**\n * This callback is invoked when this Game Object is added to a Scene.\n *\n * Can be overriden by custom Game Objects, but be aware of some Game Objects that\n * will use this, such as Sprites, to add themselves into the Update List.\n *\n * You can also listen for the `ADDED_TO_SCENE` event from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#addedToScene\n * @since 3.50.0\n */\n addedToScene: function ()\n {\n },\n\n /**\n * This callback is invoked when this Game Object is removed from a Scene.\n *\n * Can be overriden by custom Game Objects, but be aware of some Game Objects that\n * will use this, such as Sprites, to removed themselves from the Update List.\n *\n * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#removedFromScene\n * @since 3.50.0\n */\n removedFromScene: function ()\n {\n },\n\n /**\n * To be overridden by custom GameObjects. Allows base objects to be used in a Pool.\n *\n * @method Phaser.GameObjects.GameObject#update\n * @since 3.0.0\n *\n * @param {...*} [args] - args\n */\n update: function ()\n {\n },\n\n /**\n * Returns a JSON representation of the Game Object.\n *\n * @method Phaser.GameObjects.GameObject#toJSON\n * @since 3.0.0\n *\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\n */\n toJSON: function ()\n {\n return ComponentsToJSON(this);\n },\n\n /**\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\n * Also checks the Game Object against the given Cameras exclusion list.\n *\n * @method Phaser.GameObjects.GameObject#willRender\n * @since 3.0.0\n *\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\n *\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\n */\n willRender: function (camera)\n {\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\n },\n\n /**\n * Returns an array containing the display list index of either this Game Object, or if it has one,\n * its parent Container. It then iterates up through all of the parent containers until it hits the\n * root of the display list (which is index 0 in the returned array).\n *\n * Used internally by the InputPlugin but also useful if you wish to find out the display depth of\n * this Game Object and all of its ancestors.\n *\n * @method Phaser.GameObjects.GameObject#getIndexList\n * @since 3.4.0\n *\n * @return {integer[]} An array of display list position indexes.\n */\n getIndexList: function ()\n {\n // eslint-disable-next-line consistent-this\n var child = this;\n var parent = this.parentContainer;\n\n var indexes = [];\n\n while (parent)\n {\n // indexes.unshift([parent.getIndex(child), parent.name]);\n indexes.unshift(parent.getIndex(child));\n\n child = parent;\n\n if (!parent.parentContainer)\n {\n break;\n }\n else\n {\n parent = parent.parentContainer;\n }\n }\n\n // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']);\n indexes.unshift(this.scene.sys.displayList.getIndex(child));\n\n return indexes;\n },\n\n /**\n * Destroys this Game Object removing it from the Display List and Update List and\n * severing all ties to parent resources.\n *\n * Also removes itself from the Input Manager and Physics Manager if previously enabled.\n *\n * Use this to remove a Game Object from your game if you don't ever plan to use it again.\n * As long as no reference to it exists within your own code it should become free for\n * garbage collection by the browser.\n *\n * If you just want to temporarily disable an object then look at using the\n * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected.\n *\n * @method Phaser.GameObjects.GameObject#destroy\n * @fires Phaser.GameObjects.Events#DESTROY\n * @since 3.0.0\n *\n * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown?\n */\n destroy: function (fromScene)\n {\n if (fromScene === undefined) { fromScene = false; }\n\n // This Game Object has already been destroyed\n if (!this.scene || this.ignoreDestroy)\n {\n return;\n }\n\n if (this.preDestroy)\n {\n this.preDestroy.call(this);\n }\n\n this.emit(Events.DESTROY, this);\n\n var sys = this.scene.sys;\n\n if (!fromScene)\n {\n sys.displayList.remove(this);\n }\n\n if (this.input)\n {\n sys.input.clear(this);\n this.input = undefined;\n }\n\n if (this.data)\n {\n this.data.destroy();\n\n this.data = undefined;\n }\n\n if (this.body)\n {\n this.body.destroy();\n this.body = undefined;\n }\n\n // Tell the Scene to re-sort the children\n if (!fromScene)\n {\n sys.queueDepthSort();\n }\n\n this.active = false;\n this.visible = false;\n\n this.scene = undefined;\n\n this.parentContainer = undefined;\n\n this.removeAllListeners();\n }\n\n});\n\n/**\n * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not.\n *\n * @constant {integer} RENDER_MASK\n * @memberof Phaser.GameObjects.GameObject\n * @default\n */\nGameObject.RENDER_MASK = 15;\n\nmodule.exports = GameObject;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = require('../../math/Clamp');\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 2; // 0010\r\n\r\n/**\r\n * Provides methods used for setting the alpha properties of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Alpha\r\n * @since 3.0.0\r\n */\r\n\r\nvar Alpha = {\r\n\r\n /**\r\n * Private internal value. Holds the global alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alpha\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alpha: 1,\r\n\r\n /**\r\n * Private internal value. Holds the top-left alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaTL\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaTL: 1,\r\n\r\n /**\r\n * Private internal value. Holds the top-right alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaTR\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaTR: 1,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-left alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaBL\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaBL: 1,\r\n\r\n /**\r\n * Private internal value. Holds the bottom-right alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#_alphaBR\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alphaBR: 1,\r\n\r\n /**\r\n * Clears all alpha values associated with this Game Object.\r\n *\r\n * Immediately sets the alpha levels back to 1 (fully opaque).\r\n *\r\n * @method Phaser.GameObjects.Components.Alpha#clearAlpha\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n clearAlpha: function ()\r\n {\r\n return this.setAlpha(1);\r\n },\r\n\r\n /**\r\n * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * If your game is running under WebGL you can optionally specify four different alpha values, each of which\r\n * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used.\r\n *\r\n * @method Phaser.GameObjects.Components.Alpha#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object.\r\n * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only.\r\n * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only.\r\n * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (topLeft, topRight, bottomLeft, bottomRight)\r\n {\r\n if (topLeft === undefined) { topLeft = 1; }\r\n\r\n // Treat as if there is only one alpha value for the whole Game Object\r\n if (topRight === undefined)\r\n {\r\n this.alpha = topLeft;\r\n }\r\n else\r\n {\r\n this._alphaTL = Clamp(topLeft, 0, 1);\r\n this._alphaTR = Clamp(topRight, 0, 1);\r\n this._alphaBL = Clamp(bottomLeft, 0, 1);\r\n this._alphaBR = Clamp(bottomRight, 0, 1);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Game Object.\r\n *\r\n * This is a global value, impacting the entire Game Object, not just a region of it.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this._alpha;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alpha = v;\r\n this._alphaTL = v;\r\n this._alphaTR = v;\r\n this._alphaBL = v;\r\n this._alphaBR = v;\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the top-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaTopLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaTL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaTL = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the top-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaTopRight\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaTopRight: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaTR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaTR = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the bottom-left of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaBottomLeft: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaBL;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaBL = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The alpha value starting from the bottom-right of the Game Object.\r\n * This value is interpolated from the corner to the center of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight\r\n * @type {number}\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n alphaBottomRight: {\r\n\r\n get: function ()\r\n {\r\n return this._alphaBR;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alphaBR = v;\r\n\r\n if (v !== 0)\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Alpha;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = require('../../math/Clamp');\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 2; // 0010\r\n\r\n/**\r\n * Provides methods used for setting the alpha property of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.AlphaSingle\r\n * @since 3.22.0\r\n */\r\n\r\nvar AlphaSingle = {\r\n\r\n /**\r\n * Private internal value. Holds the global alpha value.\r\n *\r\n * @name Phaser.GameObjects.Components.AlphaSingle#_alpha\r\n * @type {number}\r\n * @private\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n _alpha: 1,\r\n\r\n /**\r\n * Clears all alpha values associated with this Game Object.\r\n *\r\n * Immediately sets the alpha levels back to 1 (fully opaque).\r\n *\r\n * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n clearAlpha: function ()\r\n {\r\n return this.setAlpha(1);\r\n },\r\n\r\n /**\r\n * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha\r\n * @since 3.0.0\r\n *\r\n * @param {number} [value=1] - The alpha value applied across the whole Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (value)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n this.alpha = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Game Object.\r\n *\r\n * This is a global value, impacting the entire Game Object, not just a region of it.\r\n *\r\n * @name Phaser.GameObjects.Components.AlphaSingle#alpha\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this._alpha;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n this._alpha = v;\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n }\r\n\r\n }\r\n\r\n};\r\n\r\nmodule.exports = AlphaSingle;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BlendModes = require('../../renderer/BlendModes');\r\n\r\n/**\r\n * Provides methods used for setting the blend mode of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.BlendMode\r\n * @since 3.0.0\r\n */\r\n\r\nvar BlendMode = {\r\n\r\n /**\r\n * Private internal value. Holds the current blend mode.\r\n * \r\n * @name Phaser.GameObjects.Components.BlendMode#_blendMode\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _blendMode: BlendModes.NORMAL,\r\n\r\n /**\r\n * Sets the Blend Mode being used by this Game Object.\r\n *\r\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\r\n *\r\n * Under WebGL only the following Blend Modes are available:\r\n *\r\n * * ADD\r\n * * MULTIPLY\r\n * * SCREEN\r\n * * ERASE\r\n *\r\n * Canvas has more available depending on browser support.\r\n *\r\n * You can also create your own custom Blend Modes in WebGL.\r\n *\r\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\r\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\r\n * reasons try to be careful about the construction of your Scene and the frequency of which blend modes\r\n * are used.\r\n *\r\n * @name Phaser.GameObjects.Components.BlendMode#blendMode\r\n * @type {(Phaser.BlendModes|string)}\r\n * @since 3.0.0\r\n */\r\n blendMode: {\r\n\r\n get: function ()\r\n {\r\n return this._blendMode;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (typeof value === 'string')\r\n {\r\n value = BlendModes[value];\r\n }\r\n\r\n value |= 0;\r\n\r\n if (value >= -1)\r\n {\r\n this._blendMode = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the Blend Mode being used by this Game Object.\r\n *\r\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\r\n *\r\n * Under WebGL only the following Blend Modes are available:\r\n *\r\n * * ADD\r\n * * MULTIPLY\r\n * * SCREEN\r\n * * ERASE (only works when rendering to a framebuffer, like a Render Texture)\r\n *\r\n * Canvas has more available depending on browser support.\r\n *\r\n * You can also create your own custom Blend Modes in WebGL.\r\n *\r\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\r\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\r\n * reasons try to be careful about the construction of your Scene and the frequency in which blend modes\r\n * are used.\r\n *\r\n * @method Phaser.GameObjects.Components.BlendMode#setBlendMode\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.BlendModes)} value - The BlendMode value. Either a string or a CONST.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setBlendMode: function (value)\r\n {\r\n this.blendMode = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = BlendMode;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for calculating and setting the size of a non-Frame based Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.ComputedSize\r\n * @since 3.0.0\r\n */\r\n\r\nvar ComputedSize = {\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleX * this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.ComputedSize#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return this.scaleY * this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setSize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize\r\n * @since 3.4.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ComputedSize;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the texture of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Crop\r\n * @since 3.12.0\r\n */\r\n\r\nvar Crop = {\r\n\r\n /**\r\n * The Texture this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Crop#texture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @since 3.0.0\r\n */\r\n texture: null,\r\n\r\n /**\r\n * The Texture Frame this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Crop#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n frame: null,\r\n\r\n /**\r\n * A boolean flag indicating if this Game Object is being cropped or not.\r\n * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off.\r\n * Equally, calling `setCrop` with no arguments will reset the crop and disable it.\r\n *\r\n * @name Phaser.GameObjects.Components.Crop#isCropped\r\n * @type {boolean}\r\n * @since 3.11.0\r\n */\r\n isCropped: false,\r\n\r\n /**\r\n * Applies a crop to a texture based Game Object, such as a Sprite or Image.\r\n * \r\n * The crop is a rectangle that limits the area of the texture frame that is visible during rendering.\r\n * \r\n * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just\r\n * changes what is shown when rendered.\r\n * \r\n * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left.\r\n * \r\n * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left\r\n * half of it, you could call `setCrop(0, 0, 400, 600)`.\r\n * \r\n * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop\r\n * an area of 200x100 when applied to a Game Object that had a scale factor of 2.\r\n * \r\n * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument.\r\n * \r\n * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`.\r\n * \r\n * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow\r\n * the renderer to skip several internal calculations.\r\n *\r\n * @method Phaser.GameObjects.Components.Crop#setCrop\r\n * @since 3.11.0\r\n *\r\n * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored.\r\n * @param {number} [y] - The y coordinate to start the crop from.\r\n * @param {number} [width] - The width of the crop rectangle in pixels.\r\n * @param {number} [height] - The height of the crop rectangle in pixels.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setCrop: function (x, y, width, height)\r\n {\r\n if (x === undefined)\r\n {\r\n this.isCropped = false;\r\n }\r\n else if (this.frame)\r\n {\r\n if (typeof x === 'number')\r\n {\r\n this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY);\r\n }\r\n else\r\n {\r\n var rect = x;\r\n\r\n this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY);\r\n }\r\n\r\n this.isCropped = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that returns a blank, well-formed crop object for use by a Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Crop#resetCropObject\r\n * @private\r\n * @since 3.12.0\r\n * \r\n * @return {object} The crop object.\r\n */\r\n resetCropObject: function ()\r\n {\r\n return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 };\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Crop;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for setting the depth of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Depth\r\n * @since 3.0.0\r\n */\r\n\r\nvar Depth = {\r\n\r\n /**\r\n * Private internal value. Holds the depth of the Game Object.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#_depth\r\n * @type {integer}\r\n * @private\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n _depth: 0,\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The default depth is zero. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @name Phaser.GameObjects.Components.Depth#depth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n depth: {\r\n\r\n get: function ()\r\n {\r\n return this._depth;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scene.sys.queueDepthSort();\r\n this._depth = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The depth of this Game Object within the Scene.\r\n * \r\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\r\n * of Game Objects, without actually moving their position in the display list.\r\n *\r\n * The default depth is zero. A Game Object with a higher depth\r\n * value will always render in front of one with a lower value.\r\n *\r\n * Setting the depth will queue a depth sort event within the Scene.\r\n * \r\n * @method Phaser.GameObjects.Components.Depth#setDepth\r\n * @since 3.0.0\r\n *\r\n * @param {integer} value - The depth of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDepth: function (value)\r\n {\r\n if (value === undefined) { value = 0; }\r\n\r\n this.depth = value;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Depth;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for visually flipping a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Flip\r\n * @since 3.0.0\r\n */\r\n\r\nvar Flip = {\r\n\r\n /**\r\n * The horizontally flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipX\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipX: false,\r\n\r\n /**\r\n * The vertically flipped state of the Game Object.\r\n * \r\n * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @name Phaser.GameObjects.Components.Flip#flipY\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n flipY: false,\r\n\r\n /**\r\n * Toggles the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipX\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipX: function ()\r\n {\r\n this.flipX = !this.flipX;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Toggles the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#toggleFlipY\r\n * @since 3.0.0\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n toggleFlipY: function ()\r\n {\r\n this.flipY = !this.flipY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipX\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipX: function (value)\r\n {\r\n this.flipX = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the vertical flipped state of this Game Object.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlipY\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlipY: function (value)\r\n {\r\n this.flipY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the horizontal and vertical flipped state of this Game Object.\r\n * \r\n * A Game Object that is flipped will render inversed on the flipped axis.\r\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\r\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#setFlip\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setFlip: function (x, y)\r\n {\r\n this.flipX = x;\r\n this.flipY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.\r\n * \r\n * @method Phaser.GameObjects.Components.Flip#resetFlip\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n resetFlip: function ()\r\n {\r\n this.flipX = false;\r\n this.flipY = false;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Flip;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = require('../../geom/rectangle/Rectangle');\r\nvar RotateAround = require('../../math/RotateAround');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * Provides methods used for obtaining the bounds of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.GetBounds\r\n * @since 3.0.0\r\n */\r\n\r\nvar GetBounds = {\r\n\r\n /**\r\n * Processes the bounds output vector before returning it.\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput\r\n * @private\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n prepareBoundsOutput: function (output, includeParent)\r\n {\r\n if (includeParent === undefined) { includeParent = false; }\r\n\r\n if (this.rotation !== 0)\r\n {\r\n RotateAround(output, this.x, this.y, this.rotation);\r\n }\r\n\r\n if (includeParent && this.parentContainer)\r\n {\r\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\r\n\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Gets the center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getCenter\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getCenter: function (output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2);\r\n output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Gets the top-left corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getTopLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getTopLeft: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX);\r\n output.y = this.y - (this.displayHeight * this.originY);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the top-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getTopCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getTopCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2);\r\n output.y = this.y - (this.displayHeight * this.originY);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the top-right corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getTopRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getTopRight: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\r\n output.y = this.y - (this.displayHeight * this.originY);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the left-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getLeftCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX);\r\n output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the right-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getRightCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getRightCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\r\n output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2);\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bottom-left corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getBottomLeft: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = this.x - (this.displayWidth * this.originX);\r\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bottom-center coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter\r\n * @since 3.18.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getBottomCenter: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2);\r\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bottom-right corner coordinate of this Game Object, regardless of origin.\r\n * The returned point is calculated in local space and does not factor in any parent containers\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBottomRight\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [output,$return]\r\n *\r\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\r\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\r\n *\r\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\r\n */\r\n getBottomRight: function (output, includeParent)\r\n {\r\n if (!output) { output = new Vector2(); }\r\n\r\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\r\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\r\n\r\n return this.prepareBoundsOutput(output, includeParent);\r\n },\r\n\r\n /**\r\n * Gets the bounds of this Game Object, regardless of origin.\r\n * The values are stored and returned in a Rectangle, or Rectangle-like, object.\r\n *\r\n * @method Phaser.GameObjects.Components.GetBounds#getBounds\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [output,$return]\r\n *\r\n * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created.\r\n *\r\n * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object.\r\n */\r\n getBounds: function (output)\r\n {\r\n if (output === undefined) { output = new Rectangle(); }\r\n\r\n // We can use the output object to temporarily store the x/y coords in:\r\n\r\n var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy;\r\n\r\n // Instead of doing a check if parent container is \r\n // defined per corner we only do it once.\r\n if (this.parentContainer)\r\n {\r\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\r\n\r\n this.getTopLeft(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n TLx = output.x;\r\n TLy = output.y;\r\n\r\n this.getTopRight(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n TRx = output.x;\r\n TRy = output.y;\r\n\r\n this.getBottomLeft(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n BLx = output.x;\r\n BLy = output.y;\r\n\r\n this.getBottomRight(output);\r\n parentMatrix.transformPoint(output.x, output.y, output);\r\n\r\n BRx = output.x;\r\n BRy = output.y;\r\n }\r\n else\r\n {\r\n this.getTopLeft(output);\r\n\r\n TLx = output.x;\r\n TLy = output.y;\r\n\r\n this.getTopRight(output);\r\n\r\n TRx = output.x;\r\n TRy = output.y;\r\n\r\n this.getBottomLeft(output);\r\n\r\n BLx = output.x;\r\n BLy = output.y;\r\n\r\n this.getBottomRight(output);\r\n\r\n BRx = output.x;\r\n BRy = output.y;\r\n }\r\n\r\n output.x = Math.min(TLx, TRx, BLx, BRx);\r\n output.y = Math.min(TLy, TRy, BLy, BRy);\r\n output.width = Math.max(TLx, TRx, BLx, BRx) - output.x;\r\n output.height = Math.max(TLy, TRy, BLy, BRy) - output.y;\r\n\r\n return output;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = GetBounds;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar BitmapMask = require('../../display/mask/BitmapMask');\r\nvar GeometryMask = require('../../display/mask/GeometryMask');\r\n\r\n/**\r\n * Provides methods used for getting and setting the mask of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Mask\r\n * @since 3.0.0\r\n */\r\n\r\nvar Mask = {\r\n\r\n /**\r\n * The Mask this Game Object is using during render.\r\n *\r\n * @name Phaser.GameObjects.Components.Mask#mask\r\n * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask}\r\n * @since 3.0.0\r\n */\r\n mask: null,\r\n\r\n /**\r\n * Sets the mask that this Game Object will use to render with.\r\n *\r\n * The mask must have been previously created and can be either a GeometryMask or a BitmapMask.\r\n * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas.\r\n *\r\n * If a mask is already set on this Game Object it will be immediately replaced.\r\n * \r\n * Masks are positioned in global space and are not relative to the Game Object to which they\r\n * are applied. The reason for this is that multiple Game Objects can all share the same mask.\r\n * \r\n * Masks have no impact on physics or input detection. They are purely a rendering component\r\n * that allows you to limit what is visible during the render pass.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#setMask\r\n * @since 3.6.2\r\n *\r\n * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setMask: function (mask)\r\n {\r\n this.mask = mask;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Clears the mask that this Game Object was using.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#clearMask\r\n * @since 3.6.2\r\n *\r\n * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n clearMask: function (destroyMask)\r\n {\r\n if (destroyMask === undefined) { destroyMask = false; }\r\n\r\n if (destroyMask && this.mask)\r\n {\r\n this.mask.destroy();\r\n }\r\n\r\n this.mask = null;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates and returns a Bitmap Mask. This mask can be used by any Game Object,\r\n * including this one.\r\n *\r\n * To create the mask you need to pass in a reference to a renderable Game Object.\r\n * A renderable Game Object is one that uses a texture to render with, such as an\r\n * Image, Sprite, Render Texture or BitmapText.\r\n *\r\n * If you do not provide a renderable object, and this Game Object has a texture,\r\n * it will use itself as the object. This means you can call this method to create\r\n * a Bitmap Mask from any renderable Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#createBitmapMask\r\n * @since 3.6.2\r\n * \r\n * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite.\r\n *\r\n * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created.\r\n */\r\n createBitmapMask: function (renderable)\r\n {\r\n if (renderable === undefined && (this.texture || this.shader))\r\n {\r\n // eslint-disable-next-line consistent-this\r\n renderable = this;\r\n }\r\n\r\n return new BitmapMask(this.scene, renderable);\r\n },\r\n\r\n /**\r\n * Creates and returns a Geometry Mask. This mask can be used by any Game Object,\r\n * including this one.\r\n *\r\n * To create the mask you need to pass in a reference to a Graphics Game Object.\r\n *\r\n * If you do not provide a graphics object, and this Game Object is an instance\r\n * of a Graphics object, then it will use itself to create the mask.\r\n * \r\n * This means you can call this method to create a Geometry Mask from any Graphics Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Mask#createGeometryMask\r\n * @since 3.6.2\r\n * \r\n * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask.\r\n *\r\n * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created.\r\n */\r\n createGeometryMask: function (graphics)\r\n {\r\n if (graphics === undefined && this.type === 'Graphics')\r\n {\r\n // eslint-disable-next-line consistent-this\r\n graphics = this;\r\n }\r\n\r\n return new GeometryMask(this.scene, graphics);\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Mask;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the origin of a Game Object.\r\n * Values are normalized, given in the range 0 to 1.\r\n * Display values contain the calculated pixel values.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Origin\r\n * @since 3.0.0\r\n */\r\n\r\nvar Origin = {\r\n\r\n /**\r\n * A property indicating that a Game Object has this component.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#_originComponent\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.2.0\r\n */\r\n _originComponent: true,\r\n\r\n /**\r\n * The horizontal origin of this Game Object.\r\n * The origin maps the relationship between the size and position of the Game Object.\r\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\r\n * Setting the value to 0 means the position now relates to the left of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#originX\r\n * @type {number}\r\n * @default 0.5\r\n * @since 3.0.0\r\n */\r\n originX: 0.5,\r\n\r\n /**\r\n * The vertical origin of this Game Object.\r\n * The origin maps the relationship between the size and position of the Game Object.\r\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\r\n * Setting the value to 0 means the position now relates to the top of the Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#originY\r\n * @type {number}\r\n * @default 0.5\r\n * @since 3.0.0\r\n */\r\n originY: 0.5,\r\n\r\n // private + read only\r\n _displayOriginX: 0,\r\n _displayOriginY: 0,\r\n\r\n /**\r\n * The horizontal display origin of this Game Object.\r\n * The origin is a normalized value between 0 and 1.\r\n * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#displayOriginX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayOriginX: {\r\n\r\n get: function ()\r\n {\r\n return this._displayOriginX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._displayOriginX = value;\r\n this.originX = value / this.width;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical display origin of this Game Object.\r\n * The origin is a normalized value between 0 and 1.\r\n * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.\r\n *\r\n * @name Phaser.GameObjects.Components.Origin#displayOriginY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayOriginY: {\r\n\r\n get: function ()\r\n {\r\n return this._displayOriginY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._displayOriginY = value;\r\n this.originY = value / this.height;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the origin of this Game Object.\r\n *\r\n * The values are given in the range 0 to 1.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#setOrigin\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0.5] - The horizontal origin value.\r\n * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setOrigin: function (x, y)\r\n {\r\n if (x === undefined) { x = 0.5; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.originX = x;\r\n this.originY = y;\r\n\r\n return this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the origin of this Game Object based on the Pivot values in its Frame.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setOriginFromFrame: function ()\r\n {\r\n if (!this.frame || !this.frame.customPivot)\r\n {\r\n return this.setOrigin();\r\n }\r\n else\r\n {\r\n this.originX = this.frame.pivotX;\r\n this.originY = this.frame.pivotY;\r\n }\r\n\r\n return this.updateDisplayOrigin();\r\n },\r\n\r\n /**\r\n * Sets the display origin of this Game Object.\r\n * The difference between this and setting the origin is that you can use pixel values for setting the display origin.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The horizontal display origin value.\r\n * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplayOrigin: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.displayOriginX = x;\r\n this.displayOriginY = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Updates the Display Origin cached values internally stored on this Game Object.\r\n * You don't usually call this directly, but it is exposed for edge-cases where you may.\r\n *\r\n * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n updateDisplayOrigin: function ()\r\n {\r\n this._displayOriginX = this.originX * this.width;\r\n this._displayOriginY = this.originY * this.height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Origin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar DegToRad = require('../../math/DegToRad');\r\nvar GetBoolean = require('../../tweens/builders/GetBoolean');\r\nvar GetValue = require('../../utils/object/GetValue');\r\nvar TWEEN_CONST = require('../../tweens/tween/const');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * Provides methods used for managing a Game Object following a Path.\r\n * Should be applied as a mixin and not used directly.\r\n *\r\n * @namespace Phaser.GameObjects.Components.PathFollower\r\n * @since 3.17.0\r\n */\r\n\r\nvar PathFollower = {\r\n\r\n /**\r\n * The Path this PathFollower is following. It can only follow one Path at a time.\r\n *\r\n * @name Phaser.GameObjects.Components.PathFollower#path\r\n * @type {Phaser.Curves.Path}\r\n * @since 3.0.0\r\n */\r\n path: null,\r\n\r\n /**\r\n * Should the PathFollower automatically rotate to point in the direction of the Path?\r\n *\r\n * @name Phaser.GameObjects.Components.PathFollower#rotateToPath\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.0.0\r\n */\r\n rotateToPath: false,\r\n\r\n /**\r\n * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath)\r\n * this value is added to the rotation value. This allows you to rotate objects to a path but control\r\n * the angle of the rotation as well.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathRotationOffset\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n pathRotationOffset: 0,\r\n\r\n /**\r\n * An additional vector to add to the PathFollowers position, allowing you to offset it from the\r\n * Path coordinates.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathOffset\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n pathOffset: null,\r\n\r\n /**\r\n * A Vector2 that stores the current point of the path the follower is on.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathVector\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.0.0\r\n */\r\n pathVector: null,\r\n\r\n /**\r\n * The distance the follower has traveled from the previous point to the current one, at the last update.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathDelta\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.23.0\r\n */\r\n pathDelta: null,\r\n\r\n /**\r\n * The Tween used for following the Path.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathTween\r\n * @type {Phaser.Tweens.Tween}\r\n * @since 3.0.0\r\n */\r\n pathTween: null,\r\n\r\n /**\r\n * Settings for the PathFollower.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#pathConfig\r\n * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig}\r\n * @default null\r\n * @since 3.0.0\r\n */\r\n pathConfig: null,\r\n\r\n /**\r\n * Records the direction of the follower so it can change direction.\r\n *\r\n * @name Phaser.GameObjects.PathFollower#_prevDirection\r\n * @type {integer}\r\n * @private\r\n * @since 3.0.0\r\n */\r\n _prevDirection: TWEEN_CONST.PLAYING_FORWARD,\r\n\r\n /**\r\n * Set the Path that this PathFollower should follow.\r\n *\r\n * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#setPath\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.\r\n * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setPath: function (path, config)\r\n {\r\n if (config === undefined) { config = this.pathConfig; }\r\n\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.stop();\r\n }\r\n\r\n this.path = path;\r\n\r\n if (config)\r\n {\r\n this.startFollow(config);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set whether the PathFollower should automatically rotate to point in the direction of the Path.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path.\r\n * @param {number} [offset=0] - Rotation offset in degrees.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setRotateToPath: function (value, offset)\r\n {\r\n if (offset === undefined) { offset = 0; }\r\n\r\n this.rotateToPath = value;\r\n\r\n this.pathRotationOffset = offset;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Is this PathFollower actively following a Path or not?\r\n *\r\n * To be considered as `isFollowing` it must be currently moving on a Path, and not paused.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#isFollowing\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`.\r\n */\r\n isFollowing: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n return (tween && tween.isPlaying());\r\n },\r\n\r\n /**\r\n * Starts this PathFollower following its given Path.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#startFollow\r\n * @since 3.3.0\r\n *\r\n * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object.\r\n * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n startFollow: function (config, startAt)\r\n {\r\n if (config === undefined) { config = {}; }\r\n if (startAt === undefined) { startAt = 0; }\r\n\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.stop();\r\n }\r\n\r\n if (typeof config === 'number')\r\n {\r\n config = { duration: config };\r\n }\r\n\r\n // Override in case they've been specified in the config\r\n config.from = GetValue(config, 'from', 0);\r\n config.to = GetValue(config, 'to', 1);\r\n\r\n var positionOnPath = GetBoolean(config, 'positionOnPath', false);\r\n\r\n this.rotateToPath = GetBoolean(config, 'rotateToPath', false);\r\n this.pathRotationOffset = GetValue(config, 'rotationOffset', 0);\r\n\r\n // This works, but it's not an ideal way of doing it as the follower jumps position\r\n var seek = GetValue(config, 'startAt', startAt);\r\n\r\n if (seek)\r\n {\r\n config.onStart = function (tween)\r\n {\r\n var tweenData = tween.data[0];\r\n tweenData.progress = seek;\r\n tweenData.elapsed = tweenData.duration * seek;\r\n var v = tweenData.ease(tweenData.progress);\r\n tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v);\r\n tweenData.target[tweenData.key] = tweenData.current;\r\n };\r\n }\r\n\r\n if (!this.pathOffset)\r\n {\r\n this.pathOffset = new Vector2(this.x, this.y);\r\n }\r\n\r\n if (!this.pathVector)\r\n {\r\n this.pathVector = new Vector2();\r\n }\r\n\r\n if (!this.pathDelta)\r\n {\r\n this.pathDelta = new Vector2();\r\n }\r\n\r\n this.pathDelta.reset();\r\n\r\n this.pathTween = this.scene.sys.tweens.addCounter(config);\r\n\r\n // The starting point of the path, relative to this follower\r\n this.path.getStartPoint(this.pathOffset);\r\n\r\n if (positionOnPath)\r\n {\r\n this.x = this.pathOffset.x;\r\n this.y = this.pathOffset.y;\r\n }\r\n\r\n this.pathOffset.x = this.x - this.pathOffset.x;\r\n this.pathOffset.y = this.y - this.pathOffset.y;\r\n\r\n this._prevDirection = TWEEN_CONST.PLAYING_FORWARD;\r\n\r\n if (this.rotateToPath)\r\n {\r\n // Set the rotation now (in case the tween has a delay on it, etc)\r\n var nextPoint = this.path.getPoint(0.1);\r\n\r\n this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset);\r\n }\r\n\r\n this.pathConfig = config;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the\r\n * point on the Path at which you paused it.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#pauseFollow\r\n * @since 3.3.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n pauseFollow: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.pause();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resumes a previously paused PathFollower.\r\n *\r\n * If the PathFollower was not paused this has no effect.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#resumeFollow\r\n * @since 3.3.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n resumeFollow: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPaused())\r\n {\r\n tween.resume();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Stops this PathFollower from following the path any longer.\r\n *\r\n * This will invoke any 'stop' conditions that may exist on the Path, or for the follower.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#stopFollow\r\n * @since 3.3.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n stopFollow: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween && tween.isPlaying())\r\n {\r\n tween.stop();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal update handler that advances this PathFollower along the path.\r\n *\r\n * Called automatically by the Scene step, should not typically be called directly.\r\n *\r\n * @method Phaser.GameObjects.Components.PathFollower#pathUpdate\r\n * @since 3.17.0\r\n */\r\n pathUpdate: function ()\r\n {\r\n var tween = this.pathTween;\r\n\r\n if (tween)\r\n {\r\n var tweenData = tween.data[0];\r\n var pathDelta = this.pathDelta;\r\n var pathVector = this.pathVector;\r\n\r\n pathDelta.copy(pathVector).negate();\r\n\r\n if (tweenData.state === TWEEN_CONST.COMPLETE)\r\n {\r\n this.path.getPoint(1, pathVector);\r\n\r\n pathDelta.add(pathVector);\r\n pathVector.add(this.pathOffset);\r\n\r\n this.setPosition(pathVector.x, pathVector.y);\r\n\r\n return;\r\n }\r\n else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD)\r\n {\r\n // If delayed, etc then bail out\r\n return;\r\n }\r\n\r\n this.path.getPoint(tween.getValue(), pathVector);\r\n\r\n pathDelta.add(pathVector);\r\n pathVector.add(this.pathOffset);\r\n\r\n var oldX = this.x;\r\n var oldY = this.y;\r\n\r\n this.setPosition(pathVector.x, pathVector.y);\r\n\r\n var speedX = this.x - oldX;\r\n var speedY = this.y - oldY;\r\n\r\n if (speedX === 0 && speedY === 0)\r\n {\r\n // Bail out early\r\n return;\r\n }\r\n\r\n if (tweenData.state !== this._prevDirection)\r\n {\r\n // We've changed direction, so don't do a rotate this frame\r\n this._prevDirection = tweenData.state;\r\n\r\n return;\r\n }\r\n\r\n if (this.rotateToPath)\r\n {\r\n this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset);\r\n }\r\n }\r\n }\r\n\r\n};\r\n\r\nmodule.exports = PathFollower;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PIPELINE_CONST = require('../../renderer/webgl/pipelines/const');\r\n\r\n/**\r\n * Provides methods used for setting the WebGL rendering pipeline of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Pipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n\r\nvar Pipeline = {\r\n\r\n /**\r\n * The initial WebGL pipeline of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline\r\n * @type {Phaser.Renderer.WebGL.WebGLPipeline}\r\n * @default null\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n defaultPipeline: null,\r\n\r\n /**\r\n * The current WebGL pipeline of this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Pipeline#pipeline\r\n * @type {Phaser.Renderer.WebGL.WebGLPipeline}\r\n * @default null\r\n * @webglOnly\r\n * @since 3.0.0\r\n */\r\n pipeline: null,\r\n\r\n /**\r\n * Sets the initial WebGL Pipeline of this Game Object.\r\n *\r\n * This should only be called during the instantiation of the Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#initPipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline.\r\n *\r\n * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`.\r\n */\r\n initPipeline: function (name)\r\n {\r\n if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; }\r\n\r\n var renderer = this.scene.sys.game.renderer;\r\n var pipelines = renderer.pipelines;\r\n\r\n if (pipelines && pipelines.has(name))\r\n {\r\n this.defaultPipeline = pipelines.get(name);\r\n this.pipeline = this.defaultPipeline;\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n\r\n /**\r\n * Sets the active WebGL Pipeline of this Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#setPipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @param {string} name - The name of the pipeline to set on this Game Object.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setPipeline: function (name)\r\n {\r\n var renderer = this.scene.sys.game.renderer;\r\n var pipelines = renderer.pipelines;\r\n\r\n if (pipelines && pipelines.has(name))\r\n {\r\n this.pipeline = pipelines.get(name);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the WebGL Pipeline of this Game Object back to the default it was created with.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#resetPipeline\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`.\r\n */\r\n resetPipeline: function ()\r\n {\r\n this.pipeline = this.defaultPipeline;\r\n\r\n return (this.pipeline !== null);\r\n },\r\n\r\n /**\r\n * Gets the name of the WebGL Pipeline this Game Object is currently using.\r\n *\r\n * @method Phaser.GameObjects.Components.Pipeline#getPipelineName\r\n * @webglOnly\r\n * @since 3.0.0\r\n *\r\n * @return {string} The string-based name of the pipeline being used by this Game Object.\r\n */\r\n getPipelineName: function ()\r\n {\r\n return this.pipeline.name;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Pipeline;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the Scroll Factor of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.ScrollFactor\r\n * @since 3.0.0\r\n */\r\n\r\nvar ScrollFactor = {\r\n\r\n /**\r\n * The horizontal scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorX: 1,\r\n\r\n /**\r\n * The vertical scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n scrollFactorY: 1,\r\n\r\n /**\r\n * Sets the scroll factor of this Game Object.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n * \r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = ScrollFactor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Provides methods used for getting and setting the size of a Game Object.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Size\r\n * @since 3.0.0\r\n */\r\n\r\nvar Size = {\r\n\r\n /**\r\n * A property indicating that a Game Object has this component.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#_sizeComponent\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.2.0\r\n */\r\n _sizeComponent: true,\r\n\r\n /**\r\n * The native (un-scaled) width of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayWidth` property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#width\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n width: 0,\r\n\r\n /**\r\n * The native (un-scaled) height of this Game Object.\r\n * \r\n * Changing this value will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or use\r\n * the `displayHeight` property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#height\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n height: 0,\r\n\r\n /**\r\n * The displayed width of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#displayWidth\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayWidth: {\r\n\r\n get: function ()\r\n {\r\n return Math.abs(this.scaleX * this.frame.realWidth);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleX = value / this.frame.realWidth;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The displayed height of this Game Object.\r\n * \r\n * This value takes into account the scale factor.\r\n * \r\n * Setting this value will adjust the Game Object's scale property.\r\n * \r\n * @name Phaser.GameObjects.Components.Size#displayHeight\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n displayHeight: {\r\n\r\n get: function ()\r\n {\r\n return Math.abs(this.scaleY * this.frame.realHeight);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.scaleY = value / this.frame.realHeight;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object to be that of the given Frame.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.Size#setSizeToFrame\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSizeToFrame: function (frame)\r\n {\r\n if (frame === undefined) { frame = this.frame; }\r\n\r\n this.width = frame.realWidth;\r\n this.height = frame.realHeight;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\r\n * \r\n * This will not change the size that the Game Object is rendered in-game.\r\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\r\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\r\n * to do so by giving pixel values.\r\n * \r\n * If you have enabled this Game Object for input, changing the size will _not_ change the\r\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\r\n * \r\n * @method Phaser.GameObjects.Components.Size#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setSize: function (width, height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the display size of this Game Object.\r\n * \r\n * Calling this will adjust the scale.\r\n * \r\n * @method Phaser.GameObjects.Components.Size#setDisplaySize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of this Game Object.\r\n * @param {number} height - The height of this Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setDisplaySize: function (width, height)\r\n {\r\n this.displayWidth = width;\r\n this.displayHeight = height;\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Size;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 8; // 1000\r\n\r\n/**\r\n * Provides methods used for getting and setting the texture of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.Texture\r\n * @since 3.0.0\r\n */\r\n\r\nvar Texture = {\r\n\r\n /**\r\n * The Texture this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Texture#texture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @since 3.0.0\r\n */\r\n texture: null,\r\n\r\n /**\r\n * The Texture Frame this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.Texture#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n frame: null,\r\n\r\n /**\r\n * Internal flag. Not to be set by this Game Object.\r\n *\r\n * @name Phaser.GameObjects.Components.Texture#isCropped\r\n * @type {boolean}\r\n * @private\r\n * @since 3.11.0\r\n */\r\n isCropped: false,\r\n\r\n /**\r\n * Sets the texture and frame this Game Object will use to render with.\r\n *\r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n *\r\n * @method Phaser.GameObjects.Components.Texture#setTexture\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setTexture: function (key, frame)\r\n {\r\n this.texture = this.scene.sys.textures.get(key);\r\n\r\n return this.setFrame(frame);\r\n },\r\n\r\n /**\r\n * Sets the frame this Game Object will use to render with.\r\n *\r\n * The Frame has to belong to the current Texture being used.\r\n *\r\n * It can be either a string or an index.\r\n *\r\n * Calling `setFrame` will modify the `width` and `height` properties of your Game Object.\r\n * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer.\r\n *\r\n * @method Phaser.GameObjects.Components.Texture#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} frame - The name or index of the frame within the Texture.\r\n * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object?\r\n * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFrame: function (frame, updateSize, updateOrigin)\r\n {\r\n if (updateSize === undefined) { updateSize = true; }\r\n if (updateOrigin === undefined) { updateOrigin = true; }\r\n\r\n this.frame = this.texture.get(frame);\r\n\r\n if (!this.frame.cutWidth || !this.frame.cutHeight)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n\r\n if (this._sizeComponent && updateSize)\r\n {\r\n this.setSizeToFrame();\r\n }\r\n\r\n if (this._originComponent && updateOrigin)\r\n {\r\n if (this.frame.customPivot)\r\n {\r\n this.setOrigin(this.frame.pivotX, this.frame.pivotY);\r\n }\r\n else\r\n {\r\n this.updateDisplayOrigin();\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n};\r\n\r\nmodule.exports = Texture;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 8; // 1000\r\n\r\n/**\r\n * Provides methods used for getting and setting the texture of a Game Object.\r\n *\r\n * @namespace Phaser.GameObjects.Components.TextureCrop\r\n * @since 3.0.0\r\n */\r\n\r\nvar TextureCrop = {\r\n\r\n /**\r\n * The Texture this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.TextureCrop#texture\r\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\r\n * @since 3.0.0\r\n */\r\n texture: null,\r\n\r\n /**\r\n * The Texture Frame this Game Object is using to render with.\r\n *\r\n * @name Phaser.GameObjects.Components.TextureCrop#frame\r\n * @type {Phaser.Textures.Frame}\r\n * @since 3.0.0\r\n */\r\n frame: null,\r\n\r\n /**\r\n * A boolean flag indicating if this Game Object is being cropped or not.\r\n * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off.\r\n * Equally, calling `setCrop` with no arguments will reset the crop and disable it.\r\n *\r\n * @name Phaser.GameObjects.Components.TextureCrop#isCropped\r\n * @type {boolean}\r\n * @since 3.11.0\r\n */\r\n isCropped: false,\r\n\r\n /**\r\n * Applies a crop to a texture based Game Object, such as a Sprite or Image.\r\n * \r\n * The crop is a rectangle that limits the area of the texture frame that is visible during rendering.\r\n * \r\n * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just\r\n * changes what is shown when rendered.\r\n * \r\n * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left.\r\n * \r\n * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left\r\n * half of it, you could call `setCrop(0, 0, 400, 600)`.\r\n * \r\n * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop\r\n * an area of 200x100 when applied to a Game Object that had a scale factor of 2.\r\n * \r\n * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument.\r\n * \r\n * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`.\r\n * \r\n * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow\r\n * the renderer to skip several internal calculations.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#setCrop\r\n * @since 3.11.0\r\n *\r\n * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored.\r\n * @param {number} [y] - The y coordinate to start the crop from.\r\n * @param {number} [width] - The width of the crop rectangle in pixels.\r\n * @param {number} [height] - The height of the crop rectangle in pixels.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setCrop: function (x, y, width, height)\r\n {\r\n if (x === undefined)\r\n {\r\n this.isCropped = false;\r\n }\r\n else if (this.frame)\r\n {\r\n if (typeof x === 'number')\r\n {\r\n this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY);\r\n }\r\n else\r\n {\r\n var rect = x;\r\n\r\n this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY);\r\n }\r\n\r\n this.isCropped = true;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the texture and frame this Game Object will use to render with.\r\n *\r\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#setTexture\r\n * @since 3.0.0\r\n *\r\n * @param {string} key - The key of the texture to be used, as stored in the Texture Manager.\r\n * @param {(string|integer)} [frame] - The name or index of the frame within the Texture.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setTexture: function (key, frame)\r\n {\r\n this.texture = this.scene.sys.textures.get(key);\r\n\r\n return this.setFrame(frame);\r\n },\r\n\r\n /**\r\n * Sets the frame this Game Object will use to render with.\r\n *\r\n * The Frame has to belong to the current Texture being used.\r\n *\r\n * It can be either a string or an index.\r\n *\r\n * Calling `setFrame` will modify the `width` and `height` properties of your Game Object.\r\n * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#setFrame\r\n * @since 3.0.0\r\n *\r\n * @param {(string|integer)} frame - The name or index of the frame within the Texture.\r\n * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object?\r\n * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setFrame: function (frame, updateSize, updateOrigin)\r\n {\r\n if (updateSize === undefined) { updateSize = true; }\r\n if (updateOrigin === undefined) { updateOrigin = true; }\r\n\r\n this.frame = this.texture.get(frame);\r\n\r\n if (!this.frame.cutWidth || !this.frame.cutHeight)\r\n {\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n else\r\n {\r\n this.renderFlags |= _FLAG;\r\n }\r\n\r\n if (this._sizeComponent && updateSize)\r\n {\r\n this.setSizeToFrame();\r\n }\r\n\r\n if (this._originComponent && updateOrigin)\r\n {\r\n if (this.frame.customPivot)\r\n {\r\n this.setOrigin(this.frame.pivotX, this.frame.pivotY);\r\n }\r\n else\r\n {\r\n this.updateDisplayOrigin();\r\n }\r\n }\r\n\r\n if (this.isCropped)\r\n {\r\n this.frame.updateCropUVs(this._crop, this.flipX, this.flipY);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that returns a blank, well-formed crop object for use by a Game Object.\r\n *\r\n * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject\r\n * @private\r\n * @since 3.12.0\r\n * \r\n * @return {object} The crop object.\r\n */\r\n resetCropObject: function ()\r\n {\r\n return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 };\r\n }\r\n\r\n};\r\n\r\nmodule.exports = TextureCrop;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar GetColorFromValue = require('../../display/color/GetColorFromValue');\n\n/**\n * Provides methods used for setting the tint of a Game Object.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.Tint\n * @webglOnly\n * @since 3.0.0\n */\n\nvar Tint = {\n\n /**\n * Private internal value. Holds the top-left tint value.\n *\n * @name Phaser.GameObjects.Components.Tint#_tintTL\n * @type {number}\n * @private\n * @default 16777215\n * @since 3.0.0\n */\n _tintTL: 16777215,\n\n /**\n * Private internal value. Holds the top-right tint value.\n *\n * @name Phaser.GameObjects.Components.Tint#_tintTR\n * @type {number}\n * @private\n * @default 16777215\n * @since 3.0.0\n */\n _tintTR: 16777215,\n\n /**\n * Private internal value. Holds the bottom-left tint value.\n *\n * @name Phaser.GameObjects.Components.Tint#_tintBL\n * @type {number}\n * @private\n * @default 16777215\n * @since 3.0.0\n */\n _tintBL: 16777215,\n\n /**\n * Private internal value. Holds the bottom-right tint value.\n *\n * @name Phaser.GameObjects.Components.Tint#_tintBR\n * @type {number}\n * @private\n * @default 16777215\n * @since 3.0.0\n */\n _tintBR: 16777215,\n\n /**\n * Private internal value. Holds if the Game Object is tinted or not.\n *\n * @name Phaser.GameObjects.Components.Tint#_isTinted\n * @type {boolean}\n * @private\n * @default false\n * @since 3.11.0\n */\n _isTinted: false,\n\n /**\n * Fill or additive?\n *\n * @name Phaser.GameObjects.Components.Tint#tintFill\n * @type {boolean}\n * @default false\n * @since 3.11.0\n */\n tintFill: false,\n\n /**\n * Clears all tint values associated with this Game Object.\n *\n * Immediately sets the color values back to 0xffffff and the tint type to 'additive',\n * which results in no visible change to the texture.\n *\n * @method Phaser.GameObjects.Components.Tint#clearTint\n * @webglOnly\n * @since 3.0.0\n *\n * @return {this} This Game Object instance.\n */\n clearTint: function ()\n {\n this.setTint(0xffffff);\n\n this._isTinted = false;\n\n return this;\n },\n\n /**\n * Sets an additive tint on this Game Object.\n *\n * The tint works by taking the pixel color values from the Game Objects texture, and then\n * multiplying it by the color value of the tint. You can provide either one color value,\n * in which case the whole Game Object will be tinted in that color. Or you can provide a color\n * per corner. The colors are blended together across the extent of the Game Object.\n *\n * To modify the tint color once set, either call this method again with new values or use the\n * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,\n * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.\n *\n * To remove a tint call `clearTint`.\n *\n * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`.\n *\n * @method Phaser.GameObjects.Components.Tint#setTint\n * @webglOnly\n * @since 3.0.0\n *\n * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object.\n * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object.\n * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object.\n * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setTint: function (topLeft, topRight, bottomLeft, bottomRight)\n {\n if (topLeft === undefined) { topLeft = 0xffffff; }\n\n if (topRight === undefined)\n {\n topRight = topLeft;\n bottomLeft = topLeft;\n bottomRight = topLeft;\n }\n\n this._tintTL = GetColorFromValue(topLeft);\n this._tintTR = GetColorFromValue(topRight);\n this._tintBL = GetColorFromValue(bottomLeft);\n this._tintBR = GetColorFromValue(bottomRight);\n\n this._isTinted = true;\n\n this.tintFill = false;\n\n return this;\n },\n\n /**\n * Sets a fill-based tint on this Game Object.\n *\n * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture\n * with those in the tint. You can use this for effects such as making a player flash 'white'\n * if hit by something. You can provide either one color value, in which case the whole\n * Game Object will be rendered in that color. Or you can provide a color per corner. The colors\n * are blended together across the extent of the Game Object.\n *\n * To modify the tint color once set, either call this method again with new values or use the\n * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,\n * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.\n *\n * To remove a tint call `clearTint`.\n *\n * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`.\n *\n * @method Phaser.GameObjects.Components.Tint#setTintFill\n * @webglOnly\n * @since 3.11.0\n *\n * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object.\n * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object.\n * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object.\n * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setTintFill: function (topLeft, topRight, bottomLeft, bottomRight)\n {\n this.setTint(topLeft, topRight, bottomLeft, bottomRight);\n\n this.tintFill = true;\n\n return this;\n },\n\n /**\n * The tint value being applied to the top-left of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Tint#tintTopLeft\n * @type {integer}\n * @webglOnly\n * @since 3.0.0\n */\n tintTopLeft: {\n\n get: function ()\n {\n return this._tintTL;\n },\n\n set: function (value)\n {\n this._tintTL = GetColorFromValue(value);\n this._isTinted = true;\n }\n\n },\n\n /**\n * The tint value being applied to the top-right of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Tint#tintTopRight\n * @type {integer}\n * @webglOnly\n * @since 3.0.0\n */\n tintTopRight: {\n\n get: function ()\n {\n return this._tintTR;\n },\n\n set: function (value)\n {\n this._tintTR = GetColorFromValue(value);\n this._isTinted = true;\n }\n\n },\n\n /**\n * The tint value being applied to the bottom-left of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Tint#tintBottomLeft\n * @type {integer}\n * @webglOnly\n * @since 3.0.0\n */\n tintBottomLeft: {\n\n get: function ()\n {\n return this._tintBL;\n },\n\n set: function (value)\n {\n this._tintBL = GetColorFromValue(value);\n this._isTinted = true;\n }\n\n },\n\n /**\n * The tint value being applied to the bottom-right of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Tint#tintBottomRight\n * @type {integer}\n * @webglOnly\n * @since 3.0.0\n */\n tintBottomRight: {\n\n get: function ()\n {\n return this._tintBR;\n },\n\n set: function (value)\n {\n this._tintBR = GetColorFromValue(value);\n this._isTinted = true;\n }\n\n },\n\n /**\n * The tint value being applied to the whole of the Game Object.\n * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.\n *\n * @name Phaser.GameObjects.Components.Tint#tint\n * @type {integer}\n * @webglOnly\n * @since 3.0.0\n */\n tint: {\n\n set: function (value)\n {\n this.setTint(value, value, value, value);\n }\n },\n\n /**\n * Does this Game Object have a tint applied to it or not?\n *\n * @name Phaser.GameObjects.Components.Tint#isTinted\n * @type {boolean}\n * @webglOnly\n * @readonly\n * @since 3.11.0\n */\n isTinted: {\n\n get: function ()\n {\n return this._isTinted;\n }\n\n }\n\n};\n\nmodule.exports = Tint;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Build a JSON representation of the given Game Object.\r\n *\r\n * This is typically extended further by Game Object specific implementations.\r\n *\r\n * @method Phaser.GameObjects.Components.ToJSON\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.\r\n *\r\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\r\n */\r\nvar ToJSON = function (gameObject)\r\n{\r\n var out = {\r\n name: gameObject.name,\r\n type: gameObject.type,\r\n x: gameObject.x,\r\n y: gameObject.y,\r\n depth: gameObject.depth,\r\n scale: {\r\n x: gameObject.scaleX,\r\n y: gameObject.scaleY\r\n },\r\n origin: {\r\n x: gameObject.originX,\r\n y: gameObject.originY\r\n },\r\n flipX: gameObject.flipX,\r\n flipY: gameObject.flipY,\r\n rotation: gameObject.rotation,\r\n alpha: gameObject.alpha,\r\n visible: gameObject.visible,\r\n blendMode: gameObject.blendMode,\r\n textureKey: '',\r\n frameKey: '',\r\n data: {}\r\n };\r\n\r\n if (gameObject.texture)\r\n {\r\n out.textureKey = gameObject.texture.key;\r\n out.frameKey = gameObject.frame.name;\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToJSON;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar MATH_CONST = require('../../math/const');\nvar TransformMatrix = require('./TransformMatrix');\nvar TransformXY = require('../../math/TransformXY');\nvar WrapAngle = require('../../math/angle/Wrap');\nvar WrapAngleDegrees = require('../../math/angle/WrapDegrees');\nvar Vector2 = require('../../math/Vector2');\n\n// global bitmask flag for GameObject.renderMask (used by Scale)\nvar _FLAG = 4; // 0100\n\n/**\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.Transform\n * @since 3.0.0\n */\n\nvar Transform = {\n\n /**\n * Private internal value. Holds the horizontal scale value.\n *\n * @name Phaser.GameObjects.Components.Transform#_scaleX\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _scaleX: 1,\n\n /**\n * Private internal value. Holds the vertical scale value.\n *\n * @name Phaser.GameObjects.Components.Transform#_scaleY\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _scaleY: 1,\n\n /**\n * Private internal value. Holds the rotation value in radians.\n *\n * @name Phaser.GameObjects.Components.Transform#_rotation\n * @type {number}\n * @private\n * @default 0\n * @since 3.0.0\n */\n _rotation: 0,\n\n /**\n * The x position of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n x: 0,\n\n /**\n * The y position of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n y: 0,\n\n /**\n * The z position of this Game Object.\n *\n * Note: The z position does not control the rendering order of 2D Game Objects. Use\n * {@link Phaser.GameObjects.Components.Depth#depth} instead.\n *\n * @name Phaser.GameObjects.Components.Transform#z\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n z: 0,\n\n /**\n * The w position of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#w\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n w: 0,\n\n /**\n * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object\n * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`.\n *\n * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this\n * isn't the case, use the `scaleX` or `scaleY` properties instead.\n *\n * @name Phaser.GameObjects.Components.Transform#scale\n * @type {number}\n * @default 1\n * @since 3.18.0\n */\n scale: {\n\n get: function ()\n {\n return (this._scaleX + this._scaleY) / 2;\n },\n\n set: function (value)\n {\n this._scaleX = value;\n this._scaleY = value;\n\n if (value === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The horizontal scale of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#scaleX\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n scaleX: {\n\n get: function ()\n {\n return this._scaleX;\n },\n\n set: function (value)\n {\n this._scaleX = value;\n\n if (value === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The vertical scale of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#scaleY\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n scaleY: {\n\n get: function ()\n {\n return this._scaleY;\n },\n\n set: function (value)\n {\n this._scaleY = value;\n\n if (value === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The angle of this Game Object as expressed in degrees.\n *\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\n * and -90 is up.\n *\n * If you prefer to work in radians, see the `rotation` property instead.\n *\n * @name Phaser.GameObjects.Components.Transform#angle\n * @type {integer}\n * @default 0\n * @since 3.0.0\n */\n angle: {\n\n get: function ()\n {\n return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG);\n },\n\n set: function (value)\n {\n // value is in degrees\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\n }\n },\n\n /**\n * The angle of this Game Object in radians.\n *\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left\n * and -PI/2 is up.\n *\n * If you prefer to work in degrees, see the `angle` property instead.\n *\n * @name Phaser.GameObjects.Components.Transform#rotation\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n rotation: {\n\n get: function ()\n {\n return this._rotation;\n },\n\n set: function (value)\n {\n // value is in radians\n this._rotation = WrapAngle(value);\n }\n },\n\n /**\n * Sets the position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setPosition\n * @since 3.0.0\n *\n * @param {number} [x=0] - The x position of this Game Object.\n * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value.\n * @param {number} [z=0] - The z position of this Game Object.\n * @param {number} [w=0] - The w position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setPosition: function (x, y, z, w)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = x; }\n if (z === undefined) { z = 0; }\n if (w === undefined) { w = 0; }\n\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n\n return this;\n },\n\n /**\n * Sets the position of this Game Object to be a random position within the confines of\n * the given area.\n *\n * If no area is specified a random position between 0 x 0 and the game width x height is used instead.\n *\n * The position does not factor in the size of this Game Object, meaning that only the origin is\n * guaranteed to be within the area.\n *\n * @method Phaser.GameObjects.Components.Transform#setRandomPosition\n * @since 3.8.0\n *\n * @param {number} [x=0] - The x position of the top-left of the random area.\n * @param {number} [y=0] - The y position of the top-left of the random area.\n * @param {number} [width] - The width of the random area.\n * @param {number} [height] - The height of the random area.\n *\n * @return {this} This Game Object instance.\n */\n setRandomPosition: function (x, y, width, height)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = 0; }\n if (width === undefined) { width = this.scene.sys.scale.width; }\n if (height === undefined) { height = this.scene.sys.scale.height; }\n\n this.x = x + (Math.random() * width);\n this.y = y + (Math.random() * height);\n\n return this;\n },\n\n /**\n * Sets the rotation of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setRotation\n * @since 3.0.0\n *\n * @param {number} [radians=0] - The rotation of this Game Object, in radians.\n *\n * @return {this} This Game Object instance.\n */\n setRotation: function (radians)\n {\n if (radians === undefined) { radians = 0; }\n\n this.rotation = radians;\n\n return this;\n },\n\n /**\n * Sets the angle of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setAngle\n * @since 3.0.0\n *\n * @param {number} [degrees=0] - The rotation of this Game Object, in degrees.\n *\n * @return {this} This Game Object instance.\n */\n setAngle: function (degrees)\n {\n if (degrees === undefined) { degrees = 0; }\n\n this.angle = degrees;\n\n return this;\n },\n\n /**\n * Sets the scale of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setScale\n * @since 3.0.0\n *\n * @param {number} x - The horizontal scale of this Game Object.\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.\n *\n * @return {this} This Game Object instance.\n */\n setScale: function (x, y)\n {\n if (x === undefined) { x = 1; }\n if (y === undefined) { y = x; }\n\n this.scaleX = x;\n this.scaleY = y;\n\n return this;\n },\n\n /**\n * Sets the x position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setX\n * @since 3.0.0\n *\n * @param {number} [value=0] - The x position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setX: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.x = value;\n\n return this;\n },\n\n /**\n * Sets the y position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setY\n * @since 3.0.0\n *\n * @param {number} [value=0] - The y position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setY: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.y = value;\n\n return this;\n },\n\n /**\n * Sets the z position of this Game Object.\n *\n * Note: The z position does not control the rendering order of 2D Game Objects. Use\n * {@link Phaser.GameObjects.Components.Depth#setDepth} instead.\n *\n * @method Phaser.GameObjects.Components.Transform#setZ\n * @since 3.0.0\n *\n * @param {number} [value=0] - The z position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setZ: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.z = value;\n\n return this;\n },\n\n /**\n * Sets the w position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setW\n * @since 3.0.0\n *\n * @param {number} [value=0] - The w position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setW: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.w = value;\n\n return this;\n },\n\n /**\n * Gets the local transform matrix for this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\n *\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\n */\n getLocalTransformMatrix: function (tempMatrix)\n {\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\n\n return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\n },\n\n /**\n * Gets the world transform matrix for this Game Object, factoring in any parent Containers.\n *\n * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations.\n *\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\n */\n getWorldTransformMatrix: function (tempMatrix, parentMatrix)\n {\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\n if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); }\n\n var parent = this.parentContainer;\n\n if (!parent)\n {\n return this.getLocalTransformMatrix(tempMatrix);\n }\n\n tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\n\n while (parent)\n {\n parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY);\n\n parentMatrix.multiply(tempMatrix, tempMatrix);\n\n parent = parent.parentContainer;\n }\n\n return tempMatrix;\n },\n\n /**\n * Takes the given `x` and `y` coordinates and converts them into local space for this\n * Game Object, taking into account parent and local transforms, and the Display Origin.\n *\n * The returned Vector2 contains the translated point in its properties.\n *\n * A Camera needs to be provided in order to handle modified scroll factors. If no\n * camera is specified, it will use the `main` camera from the Scene to which this\n * Game Object belongs.\n *\n * @method Phaser.GameObjects.Components.Transform#getLocalPoint\n * @since 3.50.0\n *\n * @param {number} x - The x position to translate.\n * @param {number} y - The y position to translate.\n * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in.\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera.\n *\n * @return {Phaser.Math.Vector2} The translated point.\n */\n getLocalPoint: function (x, y, point, camera)\n {\n if (!point) { point = new Vector2(); }\n if (!camera) { camera = this.scene.sys.cameras.main; }\n\n var csx = camera.scrollX;\n var csy = camera.scrollY;\n\n var px = x + (csx * this.scrollFactorX) - csx;\n var py = y + (csy * this.scrollFactorY) - csy;\n\n if (this.parentContainer)\n {\n this.getWorldTransformMatrix().applyInverse(px, py, point);\n }\n else\n {\n TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point);\n }\n\n // Normalize origin\n if (this._originComponent)\n {\n point.x += this._displayOriginX;\n point.y += this._displayOriginY;\n }\n\n return point;\n },\n\n /**\n * Gets the sum total rotation of all of this Game Objects parent Containers.\n *\n * The returned value is in radians and will be zero if this Game Object has no parent container.\n *\n * @method Phaser.GameObjects.Components.Transform#getParentRotation\n * @since 3.18.0\n *\n * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object.\n */\n getParentRotation: function ()\n {\n var rotation = 0;\n\n var parent = this.parentContainer;\n\n while (parent)\n {\n rotation += parent.rotation;\n\n parent = parent.parentContainer;\n }\n\n return rotation;\n }\n\n};\n\nmodule.exports = Transform;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar MATH_CONST = require('../../math/const');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * @classdesc\r\n * A Matrix used for display transformations for rendering.\r\n *\r\n * It is represented like so:\r\n *\r\n * ```\r\n * | a | c | tx |\r\n * | b | d | ty |\r\n * | 0 | 0 | 1 |\r\n * ```\r\n *\r\n * @class TransformMatrix\r\n * @memberof Phaser.GameObjects.Components\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [a=1] - The Scale X value.\r\n * @param {number} [b=0] - The Skew Y value.\r\n * @param {number} [c=0] - The Skew X value.\r\n * @param {number} [d=1] - The Scale Y value.\r\n * @param {number} [tx=0] - The Translate X value.\r\n * @param {number} [ty=0] - The Translate Y value.\r\n */\r\nvar TransformMatrix = new Class({\r\n\r\n initialize:\r\n\r\n function TransformMatrix (a, b, c, d, tx, ty)\r\n {\r\n if (a === undefined) { a = 1; }\r\n if (b === undefined) { b = 0; }\r\n if (c === undefined) { c = 0; }\r\n if (d === undefined) { d = 1; }\r\n if (tx === undefined) { tx = 0; }\r\n if (ty === undefined) { ty = 0; }\r\n\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#matrix\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);\r\n\r\n /**\r\n * The decomposed matrix.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix\r\n * @type {object}\r\n * @since 3.0.0\r\n */\r\n this.decomposedMatrix = {\r\n translateX: 0,\r\n translateY: 0,\r\n scaleX: 1,\r\n scaleY: 1,\r\n rotation: 0\r\n };\r\n },\r\n\r\n /**\r\n * The Scale X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#a\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n a: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[0];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[0] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#b\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n b: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[1];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[1] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Skew X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#c\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n c: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[2];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[2] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Scale Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#d\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n d: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[3];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[3] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#e\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n e: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#f\r\n * @type {number}\r\n * @since 3.11.0\r\n */\r\n f: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate X value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#tx\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n tx: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[4];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[4] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The Translate Y value.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#ty\r\n * @type {number}\r\n * @since 3.4.0\r\n */\r\n ty: {\r\n\r\n get: function ()\r\n {\r\n return this.matrix[5];\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.matrix[5] = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotation\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n rotation: {\r\n\r\n get: function ()\r\n {\r\n return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The rotation of the Matrix, normalized to be within the Phaser right-handed\r\n * clockwise rotation space. Value is in radians.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n rotationNormalized: {\r\n\r\n get: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n if (a || b)\r\n {\r\n // var r = Math.sqrt(a * a + b * b);\r\n \r\n return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX);\r\n }\r\n else if (c || d)\r\n {\r\n // var s = Math.sqrt(c * c + d * d);\r\n \r\n return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY));\r\n }\r\n else\r\n {\r\n return 0;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed horizontal scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.a * this.a) + (this.b * this.b));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The decomposed vertical scale of the Matrix. This value is always positive.\r\n *\r\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return Math.sqrt((this.c * this.c) + (this.d * this.d));\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Reset the Matrix to an identity matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n loadIdentity: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = 1;\r\n matrix[1] = 0;\r\n matrix[2] = 0;\r\n matrix[3] = 1;\r\n matrix[4] = 0;\r\n matrix[5] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#translate\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation value.\r\n * @param {number} y - The vertical translation value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n translate: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4];\r\n matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scale value.\r\n * @param {number} y - The vertical scale value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n scale: function (x, y)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] *= x;\r\n matrix[1] *= x;\r\n matrix[2] *= y;\r\n matrix[3] *= y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n rotate: function (angle)\r\n {\r\n var sin = Math.sin(angle);\r\n var cos = Math.cos(angle);\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n matrix[0] = a * cos + c * sin;\r\n matrix[1] = b * cos + d * sin;\r\n matrix[2] = a * -sin + c * cos;\r\n matrix[3] = b * -sin + d * cos;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n * \r\n * If an `out` Matrix is given then the results will be stored in it.\r\n * If it is not given, this matrix will be updated in place instead.\r\n * Use an `out` Matrix if you do not wish to mutate this matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in.\r\n *\r\n * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments.\r\n */\r\n multiply: function (rhs, out)\r\n {\r\n var matrix = this.matrix;\r\n var source = rhs.matrix;\r\n\r\n var localA = matrix[0];\r\n var localB = matrix[1];\r\n var localC = matrix[2];\r\n var localD = matrix[3];\r\n var localE = matrix[4];\r\n var localF = matrix[5];\r\n\r\n var sourceA = source[0];\r\n var sourceB = source[1];\r\n var sourceC = source[2];\r\n var sourceD = source[3];\r\n var sourceE = source[4];\r\n var sourceF = source[5];\r\n\r\n var destinationMatrix = (out === undefined) ? this : out;\r\n\r\n destinationMatrix.a = (sourceA * localA) + (sourceB * localC);\r\n destinationMatrix.b = (sourceA * localB) + (sourceB * localD);\r\n destinationMatrix.c = (sourceC * localA) + (sourceD * localC);\r\n destinationMatrix.d = (sourceC * localB) + (sourceD * localD);\r\n destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE;\r\n destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF;\r\n\r\n return destinationMatrix;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the matrix given, including the offset.\r\n * \r\n * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`.\r\n * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n * @param {number} offsetX - Horizontal offset to factor in to the multiplication.\r\n * @param {number} offsetY - Vertical offset to factor in to the multiplication.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n multiplyWithOffset: function (src, offsetX, offsetY)\r\n {\r\n var matrix = this.matrix;\r\n var otherMatrix = src.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n var pse = offsetX * a0 + offsetY * c0 + tx0;\r\n var psf = offsetX * b0 + offsetY * d0 + ty0;\r\n\r\n var a1 = otherMatrix[0];\r\n var b1 = otherMatrix[1];\r\n var c1 = otherMatrix[2];\r\n var d1 = otherMatrix[3];\r\n var tx1 = otherMatrix[4];\r\n var ty1 = otherMatrix[5];\r\n\r\n matrix[0] = a1 * a0 + b1 * c0;\r\n matrix[1] = a1 * b0 + b1 * d0;\r\n matrix[2] = c1 * a0 + d1 * c0;\r\n matrix[3] = c1 * b0 + d1 * d0;\r\n matrix[4] = tx1 * a0 + ty1 * c0 + pse;\r\n matrix[5] = tx1 * b0 + ty1 * d0 + psf;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n transform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a0 = matrix[0];\r\n var b0 = matrix[1];\r\n var c0 = matrix[2];\r\n var d0 = matrix[3];\r\n var tx0 = matrix[4];\r\n var ty0 = matrix[5];\r\n\r\n matrix[0] = a * a0 + b * c0;\r\n matrix[1] = a * b0 + b * d0;\r\n matrix[2] = c * a0 + d * c0;\r\n matrix[3] = c * b0 + d * d0;\r\n matrix[4] = tx * a0 + ty * c0 + tx0;\r\n matrix[5] = tx * b0 + ty * d0 + ty0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform a point using this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate of the point to transform.\r\n * @param {number} y - The y coordinate of the point to transform.\r\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.\r\n *\r\n * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.\r\n */\r\n transformPoint: function (x, y, point)\r\n {\r\n if (point === undefined) { point = { x: 0, y: 0 }; }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n point.x = x * a + y * c + tx;\r\n point.y = x * b + y * d + ty;\r\n\r\n return point;\r\n },\r\n\r\n /**\r\n * Invert the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#invert\r\n * @since 3.0.0\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n invert: function ()\r\n {\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var n = a * d - b * c;\r\n\r\n matrix[0] = d / n;\r\n matrix[1] = -b / n;\r\n matrix[2] = -c / n;\r\n matrix[3] = a / n;\r\n matrix[4] = (c * ty - d * tx) / n;\r\n matrix[5] = -(a * ty - b * tx) / n;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the matrix given.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom\r\n * @since 3.11.0\r\n *\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFrom: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src.a;\r\n matrix[1] = src.b;\r\n matrix[2] = src.c;\r\n matrix[3] = src.d;\r\n matrix[4] = src.e;\r\n matrix[5] = src.f;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix to copy those of the array given.\r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray\r\n * @since 3.11.0\r\n *\r\n * @param {array} src - The array of values to set into this matrix.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n copyFromArray: function (src)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = src[0];\r\n matrix[1] = src[1];\r\n matrix[2] = src[2];\r\n matrix[3] = src[3];\r\n matrix[4] = src[4];\r\n matrix[5] = src[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.transform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n copyToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values from this Matrix to the given Canvas Rendering Context.\r\n * This will use the Context.setTransform method.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setToContext\r\n * @since 3.12.0\r\n *\r\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\r\n *\r\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\r\n */\r\n setToContext: function (ctx)\r\n {\r\n var matrix = this.matrix;\r\n\r\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\r\n\r\n return ctx;\r\n },\r\n\r\n /**\r\n * Copy the values in this Matrix to the array given.\r\n * \r\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray\r\n * @since 3.12.0\r\n *\r\n * @param {array} [out] - The array to copy the matrix values in to.\r\n *\r\n * @return {array} An array where elements 0 to 5 contain the values from this matrix.\r\n */\r\n copyToArray: function (out)\r\n {\r\n var matrix = this.matrix;\r\n\r\n if (out === undefined)\r\n {\r\n out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ];\r\n }\r\n else\r\n {\r\n out[0] = matrix[0];\r\n out[1] = matrix[1];\r\n out[2] = matrix[2];\r\n out[3] = matrix[3];\r\n out[4] = matrix[4];\r\n out[5] = matrix[5];\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#setTransform\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The Scale X value.\r\n * @param {number} b - The Shear Y value.\r\n * @param {number} c - The Shear X value.\r\n * @param {number} d - The Scale Y value.\r\n * @param {number} tx - The Translate X value.\r\n * @param {number} ty - The Translate Y value.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n setTransform: function (a, b, c, d, tx, ty)\r\n {\r\n var matrix = this.matrix;\r\n\r\n matrix[0] = a;\r\n matrix[1] = b;\r\n matrix[2] = c;\r\n matrix[3] = d;\r\n matrix[4] = tx;\r\n matrix[5] = ty;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Decompose this Matrix into its translation, scale and rotation values using QR decomposition.\r\n * \r\n * The result must be applied in the following order to reproduce the current matrix:\r\n * \r\n * translate -> rotate -> scale\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix\r\n * @since 3.0.0\r\n *\r\n * @return {object} The decomposed Matrix.\r\n */\r\n decomposeMatrix: function ()\r\n {\r\n var decomposedMatrix = this.decomposedMatrix;\r\n\r\n var matrix = this.matrix;\r\n\r\n // a = scale X (1)\r\n // b = shear Y (0)\r\n // c = shear X (0)\r\n // d = scale Y (1)\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n\r\n var determ = a * d - b * c;\r\n\r\n decomposedMatrix.translateX = matrix[4];\r\n decomposedMatrix.translateY = matrix[5];\r\n\r\n if (a || b)\r\n {\r\n var r = Math.sqrt(a * a + b * b);\r\n\r\n decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r);\r\n decomposedMatrix.scaleX = r;\r\n decomposedMatrix.scaleY = determ / r;\r\n }\r\n else if (c || d)\r\n {\r\n var s = Math.sqrt(c * c + d * d);\r\n\r\n decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\r\n decomposedMatrix.scaleX = determ / s;\r\n decomposedMatrix.scaleY = s;\r\n }\r\n else\r\n {\r\n decomposedMatrix.rotation = 0;\r\n decomposedMatrix.scaleX = 0;\r\n decomposedMatrix.scaleY = 0;\r\n }\r\n\r\n return decomposedMatrix;\r\n },\r\n\r\n /**\r\n * Apply the identity, translate, rotate and scale operations on the Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal translation.\r\n * @param {number} y - The vertical translation.\r\n * @param {number} rotation - The angle of rotation in radians.\r\n * @param {number} scaleX - The horizontal scale.\r\n * @param {number} scaleY - The vertical scale.\r\n *\r\n * @return {this} This TransformMatrix.\r\n */\r\n applyITRS: function (x, y, rotation, scaleX, scaleY)\r\n {\r\n var matrix = this.matrix;\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Translate\r\n matrix[4] = x;\r\n matrix[5] = y;\r\n\r\n // Rotate and Scale\r\n matrix[0] = radianCos * scaleX;\r\n matrix[1] = radianSin * scaleX;\r\n matrix[2] = -radianSin * scaleY;\r\n matrix[3] = radianCos * scaleY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of\r\n * the current matrix with its transformation applied.\r\n * \r\n * Can be used to translate points from world to local space.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse\r\n * @since 3.12.0\r\n *\r\n * @param {number} x - The x position to translate.\r\n * @param {number} y - The y position to translate.\r\n * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in.\r\n *\r\n * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix.\r\n */\r\n applyInverse: function (x, y, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var matrix = this.matrix;\r\n\r\n var a = matrix[0];\r\n var b = matrix[1];\r\n var c = matrix[2];\r\n var d = matrix[3];\r\n var tx = matrix[4];\r\n var ty = matrix[5];\r\n\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the X component of this matrix multiplied by the given values.\r\n * This is the same as `x * a + y * c + e`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getX\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated x value.\r\n */\r\n getX: function (x, y)\r\n {\r\n return x * this.a + y * this.c + this.e;\r\n },\r\n\r\n /**\r\n * Returns the Y component of this matrix multiplied by the given values.\r\n * This is the same as `x * b + y * d + f`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getY\r\n * @since 3.12.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n *\r\n * @return {number} The calculated y value.\r\n */\r\n getY: function (x, y)\r\n {\r\n return x * this.b + y * this.d + this.f;\r\n },\r\n\r\n /**\r\n * Returns the X component of this matrix multiplied by the given values.\r\n * \r\n * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getXRound\r\n * @since 3.50.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {boolean} [round=false] - Math.round the resulting value?\r\n *\r\n * @return {number} The calculated x value.\r\n */\r\n getXRound: function (x, y, round)\r\n {\r\n var v = this.getX(x, y);\r\n\r\n if (round)\r\n {\r\n v = Math.round(v);\r\n }\r\n\r\n return v;\r\n },\r\n\r\n /**\r\n * Returns the Y component of this matrix multiplied by the given values.\r\n * \r\n * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getYRound\r\n * @since 3.50.0\r\n * \r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {boolean} [round=false] - Math.round the resulting value?\r\n *\r\n * @return {number} The calculated y value.\r\n */\r\n getYRound: function (x, y, round)\r\n {\r\n var v = this.getY(x, y);\r\n\r\n if (round)\r\n {\r\n v = Math.round(v);\r\n }\r\n\r\n return v;\r\n },\r\n\r\n /**\r\n * Returns a string that can be used in a CSS Transform call as a `matrix` property.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix\r\n * @since 3.12.0\r\n *\r\n * @return {string} A string containing the CSS Transform matrix values.\r\n */\r\n getCSSMatrix: function ()\r\n {\r\n var m = this.matrix;\r\n\r\n return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';\r\n },\r\n\r\n /**\r\n * Destroys this Transform Matrix.\r\n *\r\n * @method Phaser.GameObjects.Components.TransformMatrix#destroy\r\n * @since 3.4.0\r\n */\r\n destroy: function ()\r\n {\r\n this.matrix = null;\r\n this.decomposedMatrix = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = TransformMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// bitmask flag for GameObject.renderMask\r\nvar _FLAG = 1; // 0001\r\n\r\n/**\r\n * Provides methods used for setting the visibility of a Game Object.\r\n * Should be applied as a mixin and not used directly.\r\n * \r\n * @namespace Phaser.GameObjects.Components.Visible\r\n * @since 3.0.0\r\n */\r\n\r\nvar Visible = {\r\n\r\n /**\r\n * Private internal value. Holds the visible value.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#_visible\r\n * @type {boolean}\r\n * @private\r\n * @default true\r\n * @since 3.0.0\r\n */\r\n _visible: true,\r\n\r\n /**\r\n * The visible state of the Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n * \r\n * @name Phaser.GameObjects.Components.Visible#visible\r\n * @type {boolean}\r\n * @since 3.0.0\r\n */\r\n visible: {\r\n\r\n get: function ()\r\n {\r\n return this._visible;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value)\r\n {\r\n this._visible = true;\r\n this.renderFlags |= _FLAG;\r\n }\r\n else\r\n {\r\n this._visible = false;\r\n this.renderFlags &= ~_FLAG;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the visibility of this Game Object.\r\n * \r\n * An invisible Game Object will skip rendering, but will still process update logic.\r\n *\r\n * @method Phaser.GameObjects.Components.Visible#setVisible\r\n * @since 3.0.0\r\n *\r\n * @param {boolean} value - The visible state of the Game Object.\r\n * \r\n * @return {this} This Game Object instance.\r\n */\r\n setVisible: function (value)\r\n {\r\n this.visible = value;\r\n\r\n return this;\r\n }\r\n};\r\n\r\nmodule.exports = Visible;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.GameObjects.Components\n */\n\nmodule.exports = {\n\n Alpha: require('./Alpha'),\n AlphaSingle: require('./AlphaSingle'),\n BlendMode: require('./BlendMode'),\n ComputedSize: require('./ComputedSize'),\n Crop: require('./Crop'),\n Depth: require('./Depth'),\n Flip: require('./Flip'),\n GetBounds: require('./GetBounds'),\n Mask: require('./Mask'),\n Origin: require('./Origin'),\n PathFollower: require('./PathFollower'),\n Pipeline: require('./Pipeline'),\n ScrollFactor: require('./ScrollFactor'),\n Size: require('./Size'),\n Texture: require('./Texture'),\n TextureCrop: require('./TextureCrop'),\n Tint: require('./Tint'),\n ToJSON: require('./ToJSON'),\n Transform: require('./Transform'),\n TransformMatrix: require('./TransformMatrix'),\n Visible: require('./Visible')\n\n};\n","/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar ArrayUtils = require('../../utils/array');\r\nvar BlendModes = require('../../renderer/BlendModes');\r\nvar Class = require('../../utils/Class');\r\nvar Components = require('../components');\r\nvar Events = require('../events');\r\nvar GameObject = require('../GameObject');\r\nvar GameObjectEvents = require('../events');\r\nvar Rectangle = require('../../geom/rectangle/Rectangle');\r\nvar Render = require('./ContainerRender');\r\nvar Union = require('../../geom/rectangle/Union');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * @classdesc\r\n * A Container Game Object.\r\n *\r\n * A Container, as the name implies, can 'contain' other types of Game Object.\r\n * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it.\r\n * By default it will be removed from the Display List and instead added to the Containers own internal list.\r\n *\r\n * The position of the Game Object automatically becomes relative to the position of the Container.\r\n *\r\n * The origin of a Container is 0x0 (in local space) and that cannot be changed. The children you add to the\r\n * Container should be positioned with this value in mind. I.e. you should treat 0x0 as being the center of\r\n * the Container, and position children positively and negative around it as required.\r\n *\r\n * When the Container is rendered, all of its children are rendered as well, in the order in which they exist\r\n * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`.\r\n *\r\n * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will\r\n * automatically influence all children as well.\r\n *\r\n * Containers can include other Containers for deeply nested transforms.\r\n *\r\n * Containers can have masks set on them and can be used as a mask too. However, Container children cannot be masked.\r\n * The masks do not 'stack up'. Only a Container on the root of the display list will use its mask.\r\n *\r\n * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them\r\n * to use as their hit area. Container children can also be enabled for input, independent of the Container.\r\n * \r\n * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child,\r\n * or the input area will become misaligned.\r\n *\r\n * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However,\r\n * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies,\r\n * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children\r\n * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure\r\n * your game to work around this.\r\n *\r\n * It's important to understand the impact of using Containers. They add additional processing overhead into\r\n * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true\r\n * for input events. You also loose the ability to set the display depth of Container children in the same\r\n * flexible manner as those not within them. In short, don't use them for the sake of it. You pay a small cost\r\n * every time you create one, try to structure your game around avoiding that where possible.\r\n *\r\n * @class Container\r\n * @extends Phaser.GameObjects.GameObject\r\n * @memberof Phaser.GameObjects\r\n * @constructor\r\n * @since 3.4.0\r\n *\r\n * @extends Phaser.GameObjects.Components.AlphaSingle\r\n * @extends Phaser.GameObjects.Components.BlendMode\r\n * @extends Phaser.GameObjects.Components.ComputedSize\r\n * @extends Phaser.GameObjects.Components.Depth\r\n * @extends Phaser.GameObjects.Components.Mask\r\n * @extends Phaser.GameObjects.Components.Transform\r\n * @extends Phaser.GameObjects.Components.Visible\r\n *\r\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\r\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\r\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\r\n * @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container.\r\n */\r\nvar Container = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n Components.AlphaSingle,\r\n Components.BlendMode,\r\n Components.ComputedSize,\r\n Components.Depth,\r\n Components.Mask,\r\n Components.Transform,\r\n Components.Visible,\r\n Render\r\n ],\r\n\r\n initialize:\r\n\r\n function Container (scene, x, y, children)\r\n {\r\n GameObject.call(this, scene, 'Container');\r\n\r\n /**\r\n * An array holding the children of this Container.\r\n *\r\n * @name Phaser.GameObjects.Container#list\r\n * @type {Phaser.GameObjects.GameObject[]}\r\n * @since 3.4.0\r\n */\r\n this.list = [];\r\n\r\n /**\r\n * Does this Container exclusively manage its children?\r\n *\r\n * The default is `true` which means a child added to this Container cannot\r\n * belong in another Container, which includes the Scene display list.\r\n *\r\n * If you disable this then this Container will no longer exclusively manage its children.\r\n * This allows you to create all kinds of interesting graphical effects, such as replicating\r\n * Game Objects without reparenting them all over the Scene.\r\n * However, doing so will prevent children from receiving any kind of input event or have\r\n * their physics bodies work by default, as they're no longer a single entity on the\r\n * display list, but are being replicated where-ever this Container is.\r\n *\r\n * @name Phaser.GameObjects.Container#exclusive\r\n * @type {boolean}\r\n * @default true\r\n * @since 3.4.0\r\n */\r\n this.exclusive = true;\r\n\r\n /**\r\n * Containers can have an optional maximum size. If set to anything above 0 it\r\n * will constrict the addition of new Game Objects into the Container, capping off\r\n * the maximum limit the Container can grow in size to.\r\n *\r\n * @name Phaser.GameObjects.Container#maxSize\r\n * @type {integer}\r\n * @default -1\r\n * @since 3.4.0\r\n */\r\n this.maxSize = -1;\r\n\r\n /**\r\n * The cursor position.\r\n *\r\n * @name Phaser.GameObjects.Container#position\r\n * @type {integer}\r\n * @since 3.4.0\r\n */\r\n this.position = 0;\r\n\r\n /**\r\n * Internal Transform Matrix used for local space conversion.\r\n *\r\n * @name Phaser.GameObjects.Container#localTransform\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @since 3.4.0\r\n */\r\n this.localTransform = new Components.TransformMatrix();\r\n\r\n /**\r\n * Internal temporary Transform Matrix used to avoid object creation.\r\n *\r\n * @name Phaser.GameObjects.Container#tempTransformMatrix\r\n * @type {Phaser.GameObjects.Components.TransformMatrix}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this.tempTransformMatrix = new Components.TransformMatrix();\r\n\r\n /**\r\n * A reference to the Scene Display List.\r\n *\r\n * @name Phaser.GameObjects.Container#_displayList\r\n * @type {Phaser.GameObjects.DisplayList}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._displayList = scene.sys.displayList;\r\n\r\n /**\r\n * The property key to sort by.\r\n *\r\n * @name Phaser.GameObjects.Container#_sortKey\r\n * @type {string}\r\n * @private\r\n * @since 3.4.0\r\n */\r\n this._sortKey = '';\r\n\r\n /**\r\n * A reference to the Scene Systems Event Emitter.\r\n *\r\n * @name Phaser.GameObjects.Container#_sysEvents\r\n * @type {Phaser.Events.EventEmitter}\r\n * @private\r\n * @since 3.9.0\r\n */\r\n this._sysEvents = scene.sys.events;\r\n\r\n /**\r\n * The horizontal scroll factor of this Container.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Container.\r\n *\r\n * When a camera scrolls it will change the location at which this Container is rendered on-screen.\r\n * It does not change the Containers actual position values.\r\n *\r\n * For a Container, setting this value will only update the Container itself, not its children.\r\n * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Container.\r\n *\r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Container#scrollFactorX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.scrollFactorX = 1;\r\n\r\n /**\r\n * The vertical scroll factor of this Container.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Container.\r\n *\r\n * When a camera scrolls it will change the location at which this Container is rendered on-screen.\r\n * It does not change the Containers actual position values.\r\n *\r\n * For a Container, setting this value will only update the Container itself, not its children.\r\n * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Container.\r\n *\r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @name Phaser.GameObjects.Container#scrollFactorY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.0.0\r\n */\r\n this.scrollFactorY = 1;\r\n\r\n this.setPosition(x, y);\r\n\r\n this.clearAlpha();\r\n\r\n this.setBlendMode(BlendModes.SKIP_CHECK);\r\n\r\n if (children)\r\n {\r\n this.add(children);\r\n }\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#originX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n originX: {\r\n\r\n get: function ()\r\n {\r\n return 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#originY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n originY: {\r\n\r\n get: function ()\r\n {\r\n return 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#displayOriginX\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n displayOriginX: {\r\n\r\n get: function ()\r\n {\r\n return this.width * 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal value to allow Containers to be used for input and physics.\r\n * Do not change this value. It has no effect other than to break things.\r\n *\r\n * @name Phaser.GameObjects.Container#displayOriginY\r\n * @type {number}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n displayOriginY: {\r\n\r\n get: function ()\r\n {\r\n return this.height * 0.5;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Does this Container exclusively manage its children?\r\n *\r\n * The default is `true` which means a child added to this Container cannot\r\n * belong in another Container, which includes the Scene display list.\r\n *\r\n * If you disable this then this Container will no longer exclusively manage its children.\r\n * This allows you to create all kinds of interesting graphical effects, such as replicating\r\n * Game Objects without reparenting them all over the Scene.\r\n * However, doing so will prevent children from receiving any kind of input event or have\r\n * their physics bodies work by default, as they're no longer a single entity on the\r\n * display list, but are being replicated where-ever this Container is.\r\n *\r\n * @method Phaser.GameObjects.Container#setExclusive\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} [value=true] - The exclusive state of this Container.\r\n *\r\n * @return {this} This Container.\r\n */\r\n setExclusive: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.exclusive = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the bounds of this Container. It works by iterating all children of the Container,\r\n * getting their respective bounds, and then working out a min-max rectangle from that.\r\n * It does not factor in if the children render or not, all are included.\r\n *\r\n * Some children are unable to return their bounds, such as Graphics objects, in which case\r\n * they are skipped.\r\n *\r\n * Depending on the quantity of children in this Container it could be a really expensive call,\r\n * so cache it and only poll it as needed.\r\n *\r\n * The values are stored and returned in a Rectangle object.\r\n *\r\n * @method Phaser.GameObjects.Container#getBounds\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} [output] - A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The values stored in the output object.\r\n */\r\n getBounds: function (output)\r\n {\r\n if (output === undefined) { output = new Rectangle(); }\r\n\r\n output.setTo(this.x, this.y, 0, 0);\r\n\r\n if (this.parentContainer)\r\n {\r\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\r\n var transformedPosition = parentMatrix.transformPoint(this.x, this.y);\r\n\r\n output.setTo(transformedPosition.x, transformedPosition.y, 0, 0);\r\n }\r\n\r\n if (this.list.length > 0)\r\n {\r\n var children = this.list;\r\n var tempRect = new Rectangle();\r\n var hasSetFirst = false;\r\n\r\n output.setEmpty();\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n var entry = children[i];\r\n\r\n if (entry.getBounds)\r\n {\r\n entry.getBounds(tempRect);\r\n\r\n if (!hasSetFirst)\r\n {\r\n output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height);\r\n hasSetFirst = true;\r\n }\r\n else\r\n {\r\n Union(tempRect, output, output);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Internal add handler.\r\n *\r\n * @method Phaser.GameObjects.Container#addHandler\r\n * @private\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to this Container.\r\n */\r\n addHandler: function (gameObject)\r\n {\r\n gameObject.once(Events.DESTROY, this.remove, this);\r\n\r\n if (this.exclusive)\r\n {\r\n this._displayList.remove(gameObject);\r\n\r\n if (gameObject.parentContainer)\r\n {\r\n gameObject.parentContainer.remove(gameObject);\r\n }\r\n\r\n gameObject.parentContainer = this;\r\n }\r\n\r\n // Is only on the Display List via this Container\r\n if (!this.scene.sys.displayList.exists(gameObject))\r\n {\r\n gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene);\r\n }\r\n },\r\n\r\n /**\r\n * Internal remove handler.\r\n *\r\n * @method Phaser.GameObjects.Container#removeHandler\r\n * @private\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just removed from this Container.\r\n */\r\n removeHandler: function (gameObject)\r\n {\r\n gameObject.off(Events.DESTROY, this.remove);\r\n\r\n if (this.exclusive)\r\n {\r\n gameObject.parentContainer = null;\r\n }\r\n\r\n // Is only on the Display List via this Container\r\n if (!this.scene.sys.displayList.exists(gameObject))\r\n {\r\n gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene);\r\n }\r\n },\r\n\r\n /**\r\n * Takes a Point-like object, such as a Vector2, Geom.Point or object with public x and y properties,\r\n * and transforms it into the space of this Container, then returns it in the output object.\r\n *\r\n * @method Phaser.GameObjects.Container#pointToContainer\r\n * @since 3.4.0\r\n *\r\n * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} source - The Source Point to be transformed.\r\n * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} [output] - A destination object to store the transformed point in. If none given a Vector2 will be created and returned.\r\n *\r\n * @return {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} The transformed point.\r\n */\r\n pointToContainer: function (source, output)\r\n {\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n if (this.parentContainer)\r\n {\r\n this.parentContainer.pointToContainer(source, output);\r\n }\r\n else\r\n {\r\n output = new Vector2(source.x, source.y);\r\n }\r\n\r\n var tempMatrix = this.tempTransformMatrix;\r\n\r\n // No need to loadIdentity because applyITRS overwrites every value anyway\r\n tempMatrix.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY);\r\n\r\n tempMatrix.invert();\r\n\r\n tempMatrix.transformPoint(source.x, source.y, output);\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the world transform matrix as used for Bounds checks.\r\n *\r\n * The returned matrix is temporal and shouldn't be stored.\r\n *\r\n * @method Phaser.GameObjects.Container#getBoundsTransformMatrix\r\n * @since 3.4.0\r\n *\r\n * @return {Phaser.GameObjects.Components.TransformMatrix} The world transform matrix.\r\n */\r\n getBoundsTransformMatrix: function ()\r\n {\r\n return this.getWorldTransformMatrix(this.tempTransformMatrix, this.localTransform);\r\n },\r\n\r\n /**\r\n * Adds the given Game Object, or array of Game Objects, to this Container.\r\n *\r\n * Each Game Object must be unique within the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#add\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n add: function (child)\r\n {\r\n ArrayUtils.Add(this.list, child, this.maxSize, this.addHandler, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Adds the given Game Object, or array of Game Objects, to this Container at the specified position.\r\n *\r\n * Existing Game Objects in the Container are shifted up.\r\n *\r\n * Each Game Object must be unique within the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#addAt\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.\r\n * @param {integer} [index=0] - The position to insert the Game Object/s at.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n addAt: function (child, index)\r\n {\r\n ArrayUtils.AddAt(this.list, child, index, this.maxSize, this.addHandler, this);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns the Game Object at the given position in this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#getAt\r\n * @since 3.4.0\r\n *\r\n * @param {integer} index - The position to get the Game Object from.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found.\r\n */\r\n getAt: function (index)\r\n {\r\n return this.list[index];\r\n },\r\n\r\n /**\r\n * Returns the index of the given Game Object in this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#getIndex\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container.\r\n *\r\n * @return {integer} The index of the Game Object in this Container, or -1 if not found.\r\n */\r\n getIndex: function (child)\r\n {\r\n return this.list.indexOf(child);\r\n },\r\n\r\n /**\r\n * Sort the contents of this Container so the items are in order based on the given property.\r\n * For example: `sort('alpha')` would sort the elements based on the value of their `alpha` property.\r\n *\r\n * @method Phaser.GameObjects.Container#sort\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property to lexically sort by.\r\n * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n sort: function (property, handler)\r\n {\r\n if (!property)\r\n {\r\n return this;\r\n }\r\n\r\n if (handler === undefined)\r\n {\r\n handler = function (childA, childB)\r\n {\r\n return childA[property] - childB[property];\r\n };\r\n }\r\n\r\n ArrayUtils.StableSort(this.list, handler);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Searches for the first instance of a child with its `name` property matching the given argument.\r\n * Should more than one child have the same name only the first is returned.\r\n *\r\n * @method Phaser.GameObjects.Container#getByName\r\n * @since 3.4.0\r\n *\r\n * @param {string} name - The name to search for.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} The first child with a matching name, or `null` if none were found.\r\n */\r\n getByName: function (name)\r\n {\r\n return ArrayUtils.GetFirst(this.list, 'name', name);\r\n },\r\n\r\n /**\r\n * Returns a random Game Object from this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#getRandom\r\n * @since 3.4.0\r\n *\r\n * @param {integer} [startIndex=0] - An optional start index.\r\n * @param {integer} [length] - An optional length, the total number of elements (from the startIndex) to choose from.\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty.\r\n */\r\n getRandom: function (startIndex, length)\r\n {\r\n return ArrayUtils.GetRandom(this.list, startIndex, length);\r\n },\r\n\r\n /**\r\n * Gets the first Game Object in this Container.\r\n *\r\n * You can also specify a property and value to search for, in which case it will return the first\r\n * Game Object in this Container with a matching property and / or value.\r\n *\r\n * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set.\r\n *\r\n * You can limit the search to the `startIndex` - `endIndex` range.\r\n *\r\n * @method Phaser.GameObjects.Container#getFirst\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property to test on each Game Object in the Container.\r\n * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found.\r\n */\r\n getFirst: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Returns all Game Objects in this Container.\r\n *\r\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\r\n *\r\n * For example: `getAll('body')` would return only Game Objects that have a body property.\r\n *\r\n * You can also specify a value to compare the property to:\r\n *\r\n * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`.\r\n *\r\n * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\r\n * the first 50 Game Objects.\r\n *\r\n * @method Phaser.GameObjects.Container#getAll\r\n * @since 3.4.0\r\n *\r\n * @param {string} [property] - The property to test on each Game Object in the Container.\r\n * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container.\r\n */\r\n getAll: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Returns the total number of Game Objects in this Container that have a property\r\n * matching the given value.\r\n *\r\n * For example: `count('visible', true)` would count all the elements that have their visible property set.\r\n *\r\n * You can optionally limit the operation to the `startIndex` - `endIndex` range.\r\n *\r\n * @method Phaser.GameObjects.Container#count\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property to check.\r\n * @param {any} value - The value to check.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {integer} The total number of Game Objects in this Container with a property matching the given value.\r\n */\r\n count: function (property, value, startIndex, endIndex)\r\n {\r\n return ArrayUtils.CountAllMatching(this.list, property, value, startIndex, endIndex);\r\n },\r\n\r\n /**\r\n * Swaps the position of two Game Objects in this Container.\r\n * Both Game Objects must belong to this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#swap\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child1 - The first Game Object to swap.\r\n * @param {Phaser.GameObjects.GameObject} child2 - The second Game Object to swap.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n swap: function (child1, child2)\r\n {\r\n ArrayUtils.Swap(this.list, child1, child2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves a Game Object to a new position within this Container.\r\n *\r\n * The Game Object must already be a child of this Container.\r\n *\r\n * The Game Object is removed from its old position and inserted into the new one.\r\n * Therefore the Container size does not change. Other children will change position accordingly.\r\n *\r\n * @method Phaser.GameObjects.Container#moveTo\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to move.\r\n * @param {integer} index - The new position of the Game Object in this Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n moveTo: function (child, index)\r\n {\r\n ArrayUtils.MoveTo(this.list, child, index);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the given Game Object, or array of Game Objects, from this Container.\r\n *\r\n * The Game Objects must already be children of this Container.\r\n *\r\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#remove\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to be removed from the Container.\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each child successfully removed from this Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n remove: function (child, destroyChild)\r\n {\r\n var removed = ArrayUtils.Remove(this.list, child, this.removeHandler, this);\r\n\r\n if (destroyChild && removed)\r\n {\r\n if (!Array.isArray(removed))\r\n {\r\n removed = [ removed ];\r\n }\r\n\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n removed[i].destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the Game Object at the given position in this Container.\r\n *\r\n * You can also optionally call `destroy` on the Game Object, if one is found.\r\n *\r\n * @method Phaser.GameObjects.Container#removeAt\r\n * @since 3.4.0\r\n *\r\n * @param {integer} index - The index of the Game Object to be removed.\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n removeAt: function (index, destroyChild)\r\n {\r\n var removed = ArrayUtils.RemoveAt(this.list, index, this.removeHandler, this);\r\n\r\n if (destroyChild && removed)\r\n {\r\n removed.destroy();\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes the Game Objects between the given positions in this Container.\r\n *\r\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#removeBetween\r\n * @since 3.4.0\r\n *\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n removeBetween: function (startIndex, endIndex, destroyChild)\r\n {\r\n var removed = ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeHandler, this);\r\n\r\n if (destroyChild)\r\n {\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n removed[i].destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes all Game Objects from this Container.\r\n *\r\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#removeAll\r\n * @since 3.4.0\r\n *\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n removeAll: function (destroyChild)\r\n {\r\n var removed = ArrayUtils.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this);\r\n\r\n if (destroyChild)\r\n {\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n removed[i].destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Brings the given Game Object to the top of this Container.\r\n * This will cause it to render on-top of any other objects in the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#bringToTop\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to bring to the top of the Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n bringToTop: function (child)\r\n {\r\n ArrayUtils.BringToTop(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sends the given Game Object to the bottom of this Container.\r\n * This will cause it to render below any other objects in the Container.\r\n *\r\n * @method Phaser.GameObjects.Container#sendToBack\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to send to the bottom of the Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n sendToBack: function (child)\r\n {\r\n ArrayUtils.SendToBack(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the given Game Object up one place in this Container, unless it's already at the top.\r\n *\r\n * @method Phaser.GameObjects.Container#moveUp\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n moveUp: function (child)\r\n {\r\n ArrayUtils.MoveUp(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Moves the given Game Object down one place in this Container, unless it's already at the bottom.\r\n *\r\n * @method Phaser.GameObjects.Container#moveDown\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n moveDown: function (child)\r\n {\r\n ArrayUtils.MoveDown(this.list, child);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reverses the order of all Game Objects in this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#reverse\r\n * @since 3.4.0\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n reverse: function ()\r\n {\r\n this.list.reverse();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Shuffles the all Game Objects in this Container using the Fisher-Yates implementation.\r\n *\r\n * @method Phaser.GameObjects.Container#shuffle\r\n * @since 3.4.0\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n shuffle: function ()\r\n {\r\n ArrayUtils.Shuffle(this.list);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Replaces a Game Object in this Container with the new Game Object.\r\n * The new Game Object cannot already be a child of this Container.\r\n *\r\n * @method Phaser.GameObjects.Container#replace\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} oldChild - The Game Object in this Container that will be replaced.\r\n * @param {Phaser.GameObjects.GameObject} newChild - The Game Object to be added to this Container.\r\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n replace: function (oldChild, newChild, destroyChild)\r\n {\r\n var moved = ArrayUtils.Replace(this.list, oldChild, newChild);\r\n\r\n if (moved)\r\n {\r\n this.addHandler(newChild);\r\n this.removeHandler(oldChild);\r\n\r\n if (destroyChild)\r\n {\r\n oldChild.destroy();\r\n }\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns `true` if the given Game Object is a direct child of this Container.\r\n *\r\n * This check does not scan nested Containers.\r\n *\r\n * @method Phaser.GameObjects.Container#exists\r\n * @since 3.4.0\r\n *\r\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to check for within this Container.\r\n *\r\n * @return {boolean} True if the Game Object is an immediate child of this Container, otherwise false.\r\n */\r\n exists: function (child)\r\n {\r\n return (this.list.indexOf(child) > -1);\r\n },\r\n\r\n /**\r\n * Sets the property to the given value on all Game Objects in this Container.\r\n *\r\n * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\r\n * the first 50 Game Objects.\r\n *\r\n * @method Phaser.GameObjects.Container#setAll\r\n * @since 3.4.0\r\n *\r\n * @param {string} property - The property that must exist on the Game Object.\r\n * @param {any} value - The value to get the property to.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n setAll: function (property, value, startIndex, endIndex)\r\n {\r\n ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * @callback EachContainerCallback\r\n * @generic I - [item]\r\n *\r\n * @param {*} item - The child Game Object of the Container.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n */\r\n\r\n /**\r\n * Passes all Game Objects in this Container to the given callback.\r\n *\r\n * A copy of the Container is made before passing each entry to your callback.\r\n * This protects against the callback itself modifying the Container.\r\n *\r\n * If you know for sure that the callback will not change the size of this Container\r\n * then you can use the more performant `Container.iterate` method instead.\r\n *\r\n * @method Phaser.GameObjects.Container#each\r\n * @since 3.4.0\r\n *\r\n * @param {function} callback - The function to call.\r\n * @param {object} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n each: function (callback, context)\r\n {\r\n var args = [ null ];\r\n var i;\r\n var temp = this.list.slice();\r\n var len = temp.length;\r\n\r\n for (i = 2; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = 0; i < len; i++)\r\n {\r\n args[0] = temp[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Passes all Game Objects in this Container to the given callback.\r\n *\r\n * Only use this method when you absolutely know that the Container will not be modified during\r\n * the iteration, i.e. by removing or adding to its contents.\r\n *\r\n * @method Phaser.GameObjects.Container#iterate\r\n * @since 3.4.0\r\n *\r\n * @param {function} callback - The function to call.\r\n * @param {object} [context] - Value to use as `this` when executing callback.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n *\r\n * @return {this} This Container instance.\r\n */\r\n iterate: function (callback, context)\r\n {\r\n var args = [ null ];\r\n var i;\r\n\r\n for (i = 2; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = 0; i < this.list.length; i++)\r\n {\r\n args[0] = this.list[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the scroll factor of this Container and optionally all of its children.\r\n *\r\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\r\n *\r\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\r\n * It does not change the Game Objects actual position values.\r\n *\r\n * A value of 1 means it will move exactly in sync with a camera.\r\n * A value of 0 means it will not move at all, even if the camera moves.\r\n * Other values control the degree to which the camera movement is mapped to this Game Object.\r\n *\r\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\r\n * calculating physics collisions. Bodies always collide based on their world position, but changing\r\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\r\n * them from physics bodies if not accounted for in your code.\r\n *\r\n * @method Phaser.GameObjects.Container#setScrollFactor\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The horizontal scroll factor of this Game Object.\r\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\r\n * @param {boolean} [updateChildren=false] - Apply this scrollFactor to all Container children as well?\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setScrollFactor: function (x, y, updateChildren)\r\n {\r\n if (y === undefined) { y = x; }\r\n if (updateChildren === undefined) { updateChildren = false; }\r\n\r\n this.scrollFactorX = x;\r\n this.scrollFactorY = y;\r\n\r\n if (updateChildren)\r\n {\r\n ArrayUtils.SetAll(this.list, 'scrollFactorX', x);\r\n ArrayUtils.SetAll(this.list, 'scrollFactorY', y);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The number of Game Objects inside this Container.\r\n *\r\n * @name Phaser.GameObjects.Container#length\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n length: {\r\n\r\n get: function ()\r\n {\r\n return this.list.length;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the first Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#first\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n first: {\r\n\r\n get: function ()\r\n {\r\n this.position = 0;\r\n\r\n if (this.list.length > 0)\r\n {\r\n return this.list[0];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the last Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#last\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n last: {\r\n\r\n get: function ()\r\n {\r\n if (this.list.length > 0)\r\n {\r\n this.position = this.list.length - 1;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the next Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#next\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n next: {\r\n\r\n get: function ()\r\n {\r\n if (this.position < this.list.length)\r\n {\r\n this.position++;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns the previous Game Object within the Container, or `null` if it is empty.\r\n *\r\n * You can move the cursor by calling `Container.next` and `Container.previous`.\r\n *\r\n * @name Phaser.GameObjects.Container#previous\r\n * @type {?Phaser.GameObjects.GameObject}\r\n * @readonly\r\n * @since 3.4.0\r\n */\r\n previous: {\r\n\r\n get: function ()\r\n {\r\n if (this.position > 0)\r\n {\r\n this.position--;\r\n\r\n return this.list[this.position];\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method Phaser.GameObjects.Container#preDestroy\r\n * @protected\r\n * @since 3.9.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.removeAll(!!this.exclusive);\r\n\r\n this.localTransform.destroy();\r\n this.tempTransformMatrix.destroy();\r\n\r\n this.list = [];\r\n this._displayList = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Container;\r\n","/**\n * @author Richard Davey \n * @author Felipe Alfonso <@bitnenfer>\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Renders this Game Object with the Canvas Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method Phaser.GameObjects.Container#renderCanvas\n * @since 3.4.0\n * @private\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar ContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix)\n{\n var children = container.list;\n\n if (children.length === 0)\n {\n return;\n }\n\n var transformMatrix = container.localTransform;\n\n if (parentMatrix)\n {\n transformMatrix.loadIdentity();\n transformMatrix.multiply(parentMatrix);\n transformMatrix.translate(container.x, container.y);\n transformMatrix.rotate(container.rotation);\n transformMatrix.scale(container.scaleX, container.scaleY);\n }\n else\n {\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\n }\n\n var containerHasBlendMode = (container.blendMode !== -1);\n\n if (!containerHasBlendMode)\n {\n // If Container is SKIP_TEST then set blend mode to be Normal\n renderer.setBlendMode(0);\n }\n\n var alpha = container._alpha;\n var scrollFactorX = container.scrollFactorX;\n var scrollFactorY = container.scrollFactorY;\n\n if (container.mask)\n {\n container.mask.preRenderCanvas(renderer, null, camera);\n }\n\n for (var i = 0; i < children.length; i++)\n {\n var child = children[i];\n\n if (!child.willRender(camera))\n {\n continue;\n }\n\n var childAlpha = child.alpha;\n var childScrollFactorX = child.scrollFactorX;\n var childScrollFactorY = child.scrollFactorY;\n\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\n {\n // If Container doesn't have its own blend mode, then a child can have one\n renderer.setBlendMode(child.blendMode);\n }\n\n // Set parent values\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\n child.setAlpha(childAlpha * alpha);\n\n // Render\n child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix);\n\n // Restore original values\n child.setAlpha(childAlpha);\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\n }\n\n if (container.mask)\n {\n container.mask.postRenderCanvas(renderer);\n }\n};\n\nmodule.exports = ContainerCanvasRenderer;\n","/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar renderWebGL = require('../../utils/NOOP');\r\nvar renderCanvas = require('../../utils/NOOP');\r\n\r\nif (typeof WEBGL_RENDERER)\r\n{\r\n renderWebGL = require('./ContainerWebGLRenderer');\r\n}\r\n\r\nif (typeof CANVAS_RENDERER)\r\n{\r\n renderCanvas = require('./ContainerCanvasRenderer');\r\n}\r\n\r\nmodule.exports = {\r\n\r\n renderWebGL: renderWebGL,\r\n renderCanvas: renderCanvas\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @author Felipe Alfonso <@bitnenfer>\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method Phaser.GameObjects.Container#renderWebGL\r\n * @since 3.4.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var children = container.list;\r\n\r\n if (children.length === 0)\r\n {\r\n return;\r\n }\r\n\r\n var transformMatrix = container.localTransform;\r\n \r\n if (parentMatrix)\r\n {\r\n transformMatrix.loadIdentity();\r\n transformMatrix.multiply(parentMatrix);\r\n transformMatrix.translate(container.x, container.y);\r\n transformMatrix.rotate(container.rotation);\r\n transformMatrix.scale(container.scaleX, container.scaleY);\r\n }\r\n else\r\n {\r\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\r\n }\r\n\r\n var containerHasBlendMode = (container.blendMode !== -1);\r\n\r\n if (!containerHasBlendMode)\r\n {\r\n // If Container is SKIP_TEST then set blend mode to be Normal\r\n renderer.setBlendMode(0);\r\n }\r\n\r\n var alpha = container.alpha;\r\n\r\n var scrollFactorX = container.scrollFactorX;\r\n var scrollFactorY = container.scrollFactorY;\r\n\r\n var list = children;\r\n var childCount = children.length;\r\n\r\n for (var i = 0; i < childCount; i++)\r\n {\r\n var child = children[i];\r\n\r\n if (!child.willRender(camera))\r\n {\r\n continue;\r\n }\r\n\r\n var childAlphaTopLeft;\r\n var childAlphaTopRight;\r\n var childAlphaBottomLeft;\r\n var childAlphaBottomRight;\r\n\r\n if (child.alphaTopLeft !== undefined)\r\n {\r\n childAlphaTopLeft = child.alphaTopLeft;\r\n childAlphaTopRight = child.alphaTopRight;\r\n childAlphaBottomLeft = child.alphaBottomLeft;\r\n childAlphaBottomRight = child.alphaBottomRight;\r\n }\r\n else\r\n {\r\n var childAlpha = child.alpha;\r\n\r\n childAlphaTopLeft = childAlpha;\r\n childAlphaTopRight = childAlpha;\r\n childAlphaBottomLeft = childAlpha;\r\n childAlphaBottomRight = childAlpha;\r\n }\r\n\r\n var childScrollFactorX = child.scrollFactorX;\r\n var childScrollFactorY = child.scrollFactorY;\r\n\r\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\r\n {\r\n // If Container doesn't have its own blend mode, then a child can have one\r\n renderer.setBlendMode(child.blendMode);\r\n }\r\n\r\n var mask = child.mask;\r\n\r\n if (mask)\r\n {\r\n mask.preRenderWebGL(renderer, child, camera);\r\n }\r\n\r\n var type = child.type;\r\n\r\n if (type !== renderer.currentType)\r\n {\r\n renderer.newType = true;\r\n renderer.currentType = type;\r\n }\r\n\r\n renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false;\r\n\r\n // Set parent values\r\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\r\n\r\n child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha);\r\n\r\n // Render\r\n child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix);\r\n\r\n // Restore original values\r\n\r\n child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight);\r\n\r\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\r\n\r\n if (mask)\r\n {\r\n mask.postRenderWebGL(renderer, camera);\r\n }\r\n\r\n renderer.newType = false;\r\n }\r\n};\r\n\r\nmodule.exports = ContainerWebGLRenderer;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Added to Scene Event.\n *\n * This event is dispatched when a Game Object is added to a Scene.\n *\n * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`.\n *\n * @event Phaser.GameObjects.Events#ADDED_TO_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene.\n * @param {Phaser.Scene} scene - The Scene to which the Game Object was added.\n */\nmodule.exports = 'addedtoscene';\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Game Object Destroy Event.\r\n * \r\n * This event is dispatched when a Game Object instance is being destroyed.\r\n * \r\n * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Removed from Scene Event.\n *\n * This event is dispatched when a Game Object is removed from a Scene.\n *\n * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`.\n *\n * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene.\n * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed.\n */\nmodule.exports = 'removedfromscene';\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Complete Event.\r\n * \r\n * This event is dispatched when a Video finishes playback by reaching the end of its duration. It\r\n * is also dispatched if a video marker sequence is being played and reaches the end.\r\n * \r\n * Note that not all videos can fire this event. Live streams, for example, have no fixed duration,\r\n * so never technically 'complete'.\r\n * \r\n * If a video is stopped from playback, via the `Video.stop` method, it will emit the\r\n * `VIDEO_STOP` event instead of this one.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_COMPLETE\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback.\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Created Event.\r\n * \r\n * This event is dispatched when the texture for a Video has been created. This happens\r\n * when enough of the video source has been loaded that the browser is able to render a\r\n * frame from it.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('created', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_CREATED\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event.\r\n * @param {integer} width - The width of the video.\r\n * @param {integer} height - The height of the video.\r\n */\r\nmodule.exports = 'created';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Error Event.\r\n * \r\n * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('error', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_ERROR\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error.\r\n * @param {Event} event - The native DOM event the browser raised during playback.\r\n */\r\nmodule.exports = 'error';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Loop Event.\r\n * \r\n * This event is dispatched when a Video that is currently playing has looped. This only\r\n * happens if the `loop` parameter was specified, or the `setLoop` method was called,\r\n * and if the video has a fixed duration. Video streams, for example, cannot loop, as\r\n * they have no duration.\r\n * \r\n * Looping is based on the result of the Video `timeupdate` event. This event is not\r\n * frame-accurate, due to the way browsers work, so please do not rely on this loop\r\n * event to be time or frame precise.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_LOOP\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped.\r\n */\r\nmodule.exports = 'loop';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Play Event.\r\n * \r\n * This event is dispatched when a Video begins playback. For videos that do not require\r\n * interaction unlocking, this is usually as soon as the `Video.play` method is called.\r\n * However, for videos that require unlocking, it is fired once playback begins after\r\n * they've been unlocked.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('play', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_PLAY\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback.\r\n */\r\nmodule.exports = 'play';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Seeked Event.\r\n * \r\n * This event is dispatched when a Video completes seeking to a new point in its timeline.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_SEEKED\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking.\r\n */\r\nmodule.exports = 'seeked';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Seeking Event.\r\n * \r\n * This event is dispatched when a Video _begins_ seeking to a new point in its timeline.\r\n * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_SEEKING\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking.\r\n */\r\nmodule.exports = 'seeking';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Stopped Event.\r\n * \r\n * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method,\r\n * either directly via game code, or indirectly as the result of changing a video source or destroying it.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_STOP\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback.\r\n */\r\nmodule.exports = 'stop';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Timeout Event.\r\n * \r\n * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video\r\n * source to start playback.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out.\r\n */\r\nmodule.exports = 'timeout';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Video Game Object Unlocked Event.\r\n * \r\n * This event is dispatched when a Video that was prevented from playback due to the browsers\r\n * Media Engagement Interaction policy, is unlocked by a user gesture.\r\n * \r\n * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`.\r\n *\r\n * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED\r\n * @since 3.20.0\r\n * \r\n * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event.\r\n */\r\nmodule.exports = 'unlocked';\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.GameObjects.Events\n */\n\nmodule.exports = {\n\n ADDED_TO_SCENE: require('./ADDED_TO_SCENE_EVENT'),\n DESTROY: require('./DESTROY_EVENT'),\n REMOVED_FROM_SCENE: require('./REMOVED_FROM_SCENE_EVENT'),\n VIDEO_COMPLETE: require('./VIDEO_COMPLETE_EVENT'),\n VIDEO_CREATED: require('./VIDEO_CREATED_EVENT'),\n VIDEO_ERROR: require('./VIDEO_ERROR_EVENT'),\n VIDEO_LOOP: require('./VIDEO_LOOP_EVENT'),\n VIDEO_PLAY: require('./VIDEO_PLAY_EVENT'),\n VIDEO_SEEKED: require('./VIDEO_SEEKED_EVENT'),\n VIDEO_SEEKING: require('./VIDEO_SEEKING_EVENT'),\n VIDEO_STOP: require('./VIDEO_STOP_EVENT'),\n VIDEO_TIMEOUT: require('./VIDEO_TIMEOUT_EVENT'),\n VIDEO_UNLOCKED: require('./VIDEO_UNLOCKED_EVENT')\n\n};\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GEOM_CONST = {\r\n\r\n /**\r\n * A Circle Geometry object type.\r\n * \r\n * @name Phaser.Geom.CIRCLE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n CIRCLE: 0,\r\n\r\n /**\r\n * An Ellipse Geometry object type.\r\n * \r\n * @name Phaser.Geom.ELLIPSE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n ELLIPSE: 1,\r\n\r\n /**\r\n * A Line Geometry object type.\r\n * \r\n * @name Phaser.Geom.LINE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n LINE: 2,\r\n\r\n /**\r\n * A Point Geometry object type.\r\n * \r\n * @name Phaser.Geom.POINT\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n POINT: 3,\r\n\r\n /**\r\n * A Polygon Geometry object type.\r\n * \r\n * @name Phaser.Geom.POLYGON\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n POLYGON: 4,\r\n\r\n /**\r\n * A Rectangle Geometry object type.\r\n * \r\n * @name Phaser.Geom.RECTANGLE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n RECTANGLE: 5,\r\n\r\n /**\r\n * A Triangle Geometry object type.\r\n * \r\n * @name Phaser.Geom.TRIANGLE\r\n * @type {integer}\r\n * @since 3.19.0\r\n */\r\n TRIANGLE: 6\r\n\r\n};\r\n\r\nmodule.exports = GEOM_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = require('../point/Point');\r\n\r\n/**\r\n * Get a point on a line that's a given percentage along its length.\r\n *\r\n * @function Phaser.Geom.Line.GetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line.\r\n * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The point on the line.\r\n */\r\nvar GetPoint = function (line, position, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = line.x1 + (line.x2 - line.x1) * position;\r\n out.y = line.y1 + (line.y2 - line.y1) * position;\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoint;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Length = require('./Length');\r\nvar Point = require('../point/Point');\r\n\r\n/**\r\n * Get a number of points along a line's length.\r\n *\r\n * Provide a `quantity` to get an exact number of points along the line.\r\n *\r\n * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when\r\n * providing a `stepRate`.\r\n *\r\n * @function Phaser.Geom.Line.GetPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The line.\r\n * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead.\r\n * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`.\r\n * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line.\r\n */\r\nvar GetPoints = function (line, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity && stepRate > 0)\r\n {\r\n quantity = Length(line) / stepRate;\r\n }\r\n\r\n var x1 = line.x1;\r\n var y1 = line.y1;\r\n\r\n var x2 = line.x2;\r\n var y2 = line.y2;\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var position = i / quantity;\r\n\r\n var x = x1 + (x2 - x1) * position;\r\n var y = y1 + (y2 - y1) * position;\r\n\r\n out.push(new Point(x, y));\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the length of the given line.\r\n *\r\n * @function Phaser.Geom.Line.Length\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Line} line - The line to calculate the length of.\r\n *\r\n * @return {number} The length of the line.\r\n */\r\nvar Length = function (line)\r\n{\r\n return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1));\r\n};\r\n\r\nmodule.exports = Length;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar GetPoint = require('./GetPoint');\r\nvar GetPoints = require('./GetPoints');\r\nvar GEOM_CONST = require('../const');\r\nvar Random = require('./Random');\r\nvar Vector2 = require('../../math/Vector2');\r\n\r\n/**\r\n * @classdesc\r\n * Defines a Line segment, a part of a line between two endpoints.\r\n *\r\n * @class Line\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x1=0] - The x coordinate of the lines starting point.\r\n * @param {number} [y1=0] - The y coordinate of the lines starting point.\r\n * @param {number} [x2=0] - The x coordinate of the lines ending point.\r\n * @param {number} [y2=0] - The y coordinate of the lines ending point.\r\n */\r\nvar Line = new Class({\r\n\r\n initialize:\r\n\r\n function Line (x1, y1, x2, y2)\r\n {\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 0; }\r\n if (x2 === undefined) { x2 = 0; }\r\n if (y2 === undefined) { y2 = 0; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.LINE`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Line#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.LINE;\r\n\r\n /**\r\n * The x coordinate of the lines starting point.\r\n *\r\n * @name Phaser.Geom.Line#x1\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x1 = x1;\r\n\r\n /**\r\n * The y coordinate of the lines starting point.\r\n *\r\n * @name Phaser.Geom.Line#y1\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y1 = y1;\r\n\r\n /**\r\n * The x coordinate of the lines ending point.\r\n *\r\n * @name Phaser.Geom.Line#x2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.x2 = x2;\r\n\r\n /**\r\n * The y coordinate of the lines ending point.\r\n *\r\n * @name Phaser.Geom.Line#y2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n this.y2 = y2;\r\n },\r\n\r\n /**\r\n * Get a point on a line that's a given percentage along its length.\r\n *\r\n * @method Phaser.Geom.Line#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [output,$return]\r\n *\r\n * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line.\r\n * @param {(Phaser.Geom.Point|object)} [output] - An optional point, or point-like object, to store the coordinates of the point on the line.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point on the line.\r\n */\r\n getPoint: function (position, output)\r\n {\r\n return GetPoint(this, position, output);\r\n },\r\n\r\n /**\r\n * Get a number of points along a line's length.\r\n *\r\n * Provide a `quantity` to get an exact number of points along the line.\r\n *\r\n * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when\r\n * providing a `stepRate`.\r\n *\r\n * @method Phaser.Geom.Line#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead.\r\n * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line.\r\n */\r\n getPoints: function (quantity, stepRate, output)\r\n {\r\n return GetPoints(this, quantity, stepRate, output);\r\n },\r\n\r\n /**\r\n * Get a random Point on the Line.\r\n *\r\n * @method Phaser.Geom.Line#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {(Phaser.Geom.Point|object)} [point] - An instance of a Point to be modified.\r\n *\r\n * @return {Phaser.Geom.Point} A random Point on the Line.\r\n */\r\n getRandomPoint: function (point)\r\n {\r\n return Random(this, point);\r\n },\r\n\r\n /**\r\n * Set new coordinates for the line endpoints.\r\n *\r\n * @method Phaser.Geom.Line#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x1=0] - The x coordinate of the lines starting point.\r\n * @param {number} [y1=0] - The y coordinate of the lines starting point.\r\n * @param {number} [x2=0] - The x coordinate of the lines ending point.\r\n * @param {number} [y2=0] - The y coordinate of the lines ending point.\r\n *\r\n * @return {this} This Line object.\r\n */\r\n setTo: function (x1, y1, x2, y2)\r\n {\r\n if (x1 === undefined) { x1 = 0; }\r\n if (y1 === undefined) { y1 = 0; }\r\n if (x2 === undefined) { x2 = 0; }\r\n if (y2 === undefined) { y2 = 0; }\r\n\r\n this.x1 = x1;\r\n this.y1 = y1;\r\n\r\n this.x2 = x2;\r\n this.y2 = y2;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Returns a Vector2 object that corresponds to the start of this Line.\r\n *\r\n * @method Phaser.Geom.Line#getPointA\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [vec2,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the start of this Line.\r\n */\r\n getPointA: function (vec2)\r\n {\r\n if (vec2 === undefined) { vec2 = new Vector2(); }\r\n\r\n vec2.set(this.x1, this.y1);\r\n\r\n return vec2;\r\n },\r\n\r\n /**\r\n * Returns a Vector2 object that corresponds to the end of this Line.\r\n *\r\n * @method Phaser.Geom.Line#getPointB\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Math.Vector2} O - [vec2,$return]\r\n *\r\n * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the end of this Line.\r\n */\r\n getPointB: function (vec2)\r\n {\r\n if (vec2 === undefined) { vec2 = new Vector2(); }\r\n\r\n vec2.set(this.x2, this.y2);\r\n\r\n return vec2;\r\n },\r\n\r\n /**\r\n * The left position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#left\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return Math.min(this.x1, this.x2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.x1 <= this.x2)\r\n {\r\n this.x1 = value;\r\n }\r\n else\r\n {\r\n this.x2 = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The right position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#right\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return Math.max(this.x1, this.x2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.x1 > this.x2)\r\n {\r\n this.x1 = value;\r\n }\r\n else\r\n {\r\n this.x2 = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The top position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#top\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return Math.min(this.y1, this.y2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.y1 <= this.y2)\r\n {\r\n this.y1 = value;\r\n }\r\n else\r\n {\r\n this.y2 = value;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The bottom position of the Line.\r\n *\r\n * @name Phaser.Geom.Line#bottom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return Math.max(this.y1, this.y2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (this.y1 > this.y2)\r\n {\r\n this.y1 = value;\r\n }\r\n else\r\n {\r\n this.y2 = value;\r\n }\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Line;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = require('../point/Point');\r\n\r\n/**\r\n * Returns a random point on a given Line.\r\n *\r\n * @function Phaser.Geom.Line.Random\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Line} line - The Line to calculate the random Point on.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An instance of a Point to be modified.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} A random Point on the Line.\r\n */\r\nvar Random = function (line, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n var t = Math.random();\r\n\r\n out.x = line.x1 + t * (line.x2 - line.x1);\r\n out.y = line.y1 + t * (line.y2 - line.y1);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Random;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar GEOM_CONST = require('../const');\r\n\r\n/**\r\n * @classdesc\r\n * Defines a Point in 2D space, with an x and y component.\r\n *\r\n * @class Point\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x coordinate of this Point.\r\n * @param {number} [y=x] - The y coordinate of this Point.\r\n */\r\nvar Point = new Class({\r\n\r\n initialize:\r\n\r\n function Point (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.POINT`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Point#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.POINT;\r\n\r\n /**\r\n * The x coordinate of this Point.\r\n *\r\n * @name Phaser.Geom.Point#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The y coordinate of this Point.\r\n *\r\n * @name Phaser.Geom.Point#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n },\r\n\r\n /**\r\n * Set the x and y coordinates of the point to the given values.\r\n *\r\n * @method Phaser.Geom.Point#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The x coordinate of this Point.\r\n * @param {number} [y=x] - The y coordinate of this Point.\r\n *\r\n * @return {this} This Point object.\r\n */\r\n setTo: function (x, y)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Point;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if a given point is inside a Rectangle's bounds.\r\n *\r\n * @function Phaser.Geom.Rectangle.Contains\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check.\r\n * @param {number} x - The X coordinate of the point to check.\r\n * @param {number} y - The Y coordinate of the point to check.\r\n *\r\n * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`.\r\n */\r\nvar Contains = function (rect, x, y)\r\n{\r\n if (rect.width <= 0 || rect.height <= 0)\r\n {\r\n return false;\r\n }\r\n\r\n return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y);\r\n};\r\n\r\nmodule.exports = Contains;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Perimeter = require('./Perimeter');\r\nvar Point = require('../point/Point');\r\n\r\n/**\r\n * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter.\r\n * \r\n * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is.\r\n * \r\n * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side.\r\n *\r\n * @function Phaser.Geom.Rectangle.GetPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from.\r\n * @param {number} position - The normalized distance into the Rectangle's perimeter to return.\r\n * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point.\r\n *\r\n * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given.\r\n */\r\nvar GetPoint = function (rectangle, position, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n if (position <= 0 || position >= 1)\r\n {\r\n out.x = rectangle.x;\r\n out.y = rectangle.y;\r\n\r\n return out;\r\n }\r\n\r\n var p = Perimeter(rectangle) * position;\r\n\r\n if (position > 0.5)\r\n {\r\n p -= (rectangle.width + rectangle.height);\r\n\r\n if (p <= rectangle.width)\r\n {\r\n // Face 3\r\n out.x = rectangle.right - p;\r\n out.y = rectangle.bottom;\r\n }\r\n else\r\n {\r\n // Face 4\r\n out.x = rectangle.x;\r\n out.y = rectangle.bottom - (p - rectangle.width);\r\n }\r\n }\r\n else if (p <= rectangle.width)\r\n {\r\n // Face 1\r\n out.x = rectangle.x + p;\r\n out.y = rectangle.y;\r\n }\r\n else\r\n {\r\n // Face 2\r\n out.x = rectangle.right;\r\n out.y = rectangle.y + (p - rectangle.width);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoint;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetPoint = require('./GetPoint');\r\nvar Perimeter = require('./Perimeter');\r\n\r\n// Return an array of points from the perimeter of the rectangle\r\n// each spaced out based on the quantity or step required\r\n\r\n/**\r\n * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required.\r\n *\r\n * @function Phaser.Geom.Rectangle.GetPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from.\r\n * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive.\r\n * @param {integer} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points.\r\n * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle.\r\n */\r\nvar GetPoints = function (rectangle, quantity, stepRate, out)\r\n{\r\n if (out === undefined) { out = []; }\r\n\r\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\r\n if (!quantity && stepRate > 0)\r\n {\r\n quantity = Perimeter(rectangle) / stepRate;\r\n }\r\n\r\n for (var i = 0; i < quantity; i++)\r\n {\r\n var position = i / quantity;\r\n\r\n out.push(GetPoint(rectangle, position));\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = GetPoints;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the perimeter of a Rectangle.\r\n *\r\n * @function Phaser.Geom.Rectangle.Perimeter\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use.\r\n *\r\n * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`.\r\n */\r\nvar Perimeter = function (rect)\r\n{\r\n return 2 * (rect.width + rect.height);\r\n};\r\n\r\nmodule.exports = Perimeter;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Point = require('../point/Point');\r\n\r\n/**\r\n * Returns a random point within a Rectangle.\r\n *\r\n * @function Phaser.Geom.Rectangle.Random\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from.\r\n * @param {Phaser.Geom.Point} out - The object to update with the point's coordinates.\r\n *\r\n * @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided.\r\n */\r\nvar Random = function (rect, out)\r\n{\r\n if (out === undefined) { out = new Point(); }\r\n\r\n out.x = rect.x + (Math.random() * rect.width);\r\n out.y = rect.y + (Math.random() * rect.height);\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Random;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar Contains = require('./Contains');\r\nvar GetPoint = require('./GetPoint');\r\nvar GetPoints = require('./GetPoints');\r\nvar GEOM_CONST = require('../const');\r\nvar Line = require('../line/Line');\r\nvar Random = require('./Random');\r\n\r\n/**\r\n * @classdesc\r\n * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height)\r\n *\r\n * @class Rectangle\r\n * @memberof Phaser.Geom\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle.\r\n * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle.\r\n * @param {number} [width=0] - The width of the Rectangle.\r\n * @param {number} [height=0] - The height of the Rectangle.\r\n */\r\nvar Rectangle = new Class({\r\n\r\n initialize:\r\n\r\n function Rectangle (x, y, width, height)\r\n {\r\n if (x === undefined) { x = 0; }\r\n if (y === undefined) { y = 0; }\r\n if (width === undefined) { width = 0; }\r\n if (height === undefined) { height = 0; }\r\n\r\n /**\r\n * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`.\r\n * Used for fast type comparisons.\r\n *\r\n * @name Phaser.Geom.Rectangle#type\r\n * @type {integer}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.type = GEOM_CONST.RECTANGLE;\r\n\r\n /**\r\n * The X coordinate of the top left corner of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The Y coordinate of the top left corner of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side.\r\n *\r\n * @name Phaser.Geom.Rectangle#width\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.width = width;\r\n\r\n /**\r\n * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side.\r\n *\r\n * @name Phaser.Geom.Rectangle#height\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.height = height;\r\n },\r\n\r\n /**\r\n * Checks if the given point is inside the Rectangle's bounds.\r\n *\r\n * @method Phaser.Geom.Rectangle#contains\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the point to check.\r\n * @param {number} y - The Y coordinate of the point to check.\r\n *\r\n * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`.\r\n */\r\n contains: function (x, y)\r\n {\r\n return Contains(this, x, y);\r\n },\r\n\r\n /**\r\n * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter.\r\n * \r\n * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is.\r\n * \r\n * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side.\r\n *\r\n * @method Phaser.Geom.Rectangle#getPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [output,$return]\r\n *\r\n * @param {number} position - The normalized distance into the Rectangle's perimeter to return.\r\n * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point.\r\n *\r\n * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given.\r\n */\r\n getPoint: function (position, output)\r\n {\r\n return GetPoint(this, position, output);\r\n },\r\n\r\n /**\r\n * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required.\r\n *\r\n * @method Phaser.Geom.Rectangle#getPoints\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\r\n *\r\n * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`.\r\n * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point.\r\n * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points.\r\n *\r\n * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided.\r\n */\r\n getPoints: function (quantity, stepRate, output)\r\n {\r\n return GetPoints(this, quantity, stepRate, output);\r\n },\r\n\r\n /**\r\n * Returns a random point within the Rectangle's bounds.\r\n *\r\n * @method Phaser.Geom.Rectangle#getRandomPoint\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Point} O - [point,$return]\r\n *\r\n * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point.\r\n *\r\n * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided.\r\n */\r\n getRandomPoint: function (point)\r\n {\r\n return Random(this, point);\r\n },\r\n\r\n /**\r\n * Sets the position, width, and height of the Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#setTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the top left corner of the Rectangle.\r\n * @param {number} y - The Y coordinate of the top left corner of the Rectangle.\r\n * @param {number} width - The width of the Rectangle.\r\n * @param {number} height - The height of the Rectangle.\r\n *\r\n * @return {this} This Rectangle object.\r\n */\r\n setTo: function (x, y, width, height)\r\n {\r\n this.x = x;\r\n this.y = y;\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Resets the position, width, and height of the Rectangle to 0.\r\n *\r\n * @method Phaser.Geom.Rectangle#setEmpty\r\n * @since 3.0.0\r\n *\r\n * @return {this} This Rectangle object.\r\n */\r\n setEmpty: function ()\r\n {\r\n return this.setTo(0, 0, 0, 0);\r\n },\r\n\r\n /**\r\n * Sets the position of the Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#setPosition\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The X coordinate of the top left corner of the Rectangle.\r\n * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle.\r\n *\r\n * @return {this} This Rectangle object.\r\n */\r\n setPosition: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the width and height of the Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#setSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width to set the Rectangle to.\r\n * @param {number} [height=width] - The height to set the Rectangle to.\r\n *\r\n * @return {this} This Rectangle object.\r\n */\r\n setSize: function (width, height)\r\n {\r\n if (height === undefined) { height = width; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0.\r\n *\r\n * @method Phaser.Geom.Rectangle#isEmpty\r\n * @since 3.0.0\r\n *\r\n * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0.\r\n */\r\n isEmpty: function ()\r\n {\r\n return (this.width <= 0 || this.height <= 0);\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the top of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineA\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle.\r\n */\r\n getLineA: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.x, this.y, this.right, this.y);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the right of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineB\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle.\r\n */\r\n getLineB: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.right, this.y, this.right, this.bottom);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the bottom of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineC\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle.\r\n */\r\n getLineC: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.right, this.bottom, this.x, this.bottom);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * Returns a Line object that corresponds to the left of this Rectangle.\r\n *\r\n * @method Phaser.Geom.Rectangle#getLineD\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Line} O - [line,$return]\r\n *\r\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\r\n *\r\n * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle.\r\n */\r\n getLineD: function (line)\r\n {\r\n if (line === undefined) { line = new Line(); }\r\n\r\n line.setTo(this.x, this.bottom, this.x, this.y);\r\n\r\n return line;\r\n },\r\n\r\n /**\r\n * The x coordinate of the left of the Rectangle.\r\n * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property.\r\n *\r\n * @name Phaser.Geom.Rectangle#left\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n left: {\r\n\r\n get: function ()\r\n {\r\n return this.x;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value >= this.right)\r\n {\r\n this.width = 0;\r\n }\r\n else\r\n {\r\n this.width = this.right - value;\r\n }\r\n\r\n this.x = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The sum of the x and width properties.\r\n * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property.\r\n *\r\n * @name Phaser.Geom.Rectangle#right\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n right: {\r\n\r\n get: function ()\r\n {\r\n return this.x + this.width;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value <= this.x)\r\n {\r\n this.width = 0;\r\n }\r\n else\r\n {\r\n this.width = value - this.x;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties.\r\n * However it does affect the height property, whereas changing the y value does not affect the height property.\r\n *\r\n * @name Phaser.Geom.Rectangle#top\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n top: {\r\n\r\n get: function ()\r\n {\r\n return this.y;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value >= this.bottom)\r\n {\r\n this.height = 0;\r\n }\r\n else\r\n {\r\n this.height = (this.bottom - value);\r\n }\r\n\r\n this.y = value;\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The sum of the y and height properties.\r\n * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.\r\n *\r\n * @name Phaser.Geom.Rectangle#bottom\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n bottom: {\r\n\r\n get: function ()\r\n {\r\n return this.y + this.height;\r\n },\r\n\r\n set: function (value)\r\n {\r\n if (value <= this.y)\r\n {\r\n this.height = 0;\r\n }\r\n else\r\n {\r\n this.height = value - this.y;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The x coordinate of the center of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#centerX\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n centerX: {\r\n\r\n get: function ()\r\n {\r\n return this.x + (this.width / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.x = value - (this.width / 2);\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The y coordinate of the center of the Rectangle.\r\n *\r\n * @name Phaser.Geom.Rectangle#centerY\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n centerY: {\r\n\r\n get: function ()\r\n {\r\n return this.y + (this.height / 2);\r\n },\r\n\r\n set: function (value)\r\n {\r\n this.y = value - (this.height / 2);\r\n }\r\n\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Rectangle;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Rectangle = require('./Rectangle');\r\n\r\n/**\r\n * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union.\r\n *\r\n * @function Phaser.Geom.Rectangle.Union\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\r\n *\r\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use.\r\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use.\r\n * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in.\r\n *\r\n * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided.\r\n */\r\nvar Union = function (rectA, rectB, out)\r\n{\r\n if (out === undefined) { out = new Rectangle(); }\r\n\r\n // Cache vars so we can use one of the input rects as the output rect\r\n var x = Math.min(rectA.x, rectB.x);\r\n var y = Math.min(rectA.y, rectB.y);\r\n var w = Math.max(rectA.right, rectB.right) - x;\r\n var h = Math.max(rectA.bottom, rectB.bottom) - y;\r\n\r\n return out.setTo(x, y, w, h);\r\n};\r\n\r\nmodule.exports = Union;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../utils/Class');\nvar CONST = require('./const');\nvar Events = require('./events');\nvar GetFastValue = require('../utils/object/GetFastValue');\nvar GetURL = require('./GetURL');\nvar MergeXHRSettings = require('./MergeXHRSettings');\nvar XHRLoader = require('./XHRLoader');\nvar XHRSettings = require('./XHRSettings');\n\n/**\n * @classdesc\n * The base File class used by all File Types that the Loader can support.\n * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods.\n *\n * @class File\n * @memberof Phaser.Loader\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\n * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type.\n */\nvar File = new Class({\n\n initialize:\n\n function File (loader, fileConfig)\n {\n /**\n * A reference to the Loader that is going to load this file.\n *\n * @name Phaser.Loader.File#loader\n * @type {Phaser.Loader.LoaderPlugin}\n * @since 3.0.0\n */\n this.loader = loader;\n\n /**\n * A reference to the Cache, or Texture Manager, that is going to store this file if it loads.\n *\n * @name Phaser.Loader.File#cache\n * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)}\n * @since 3.7.0\n */\n this.cache = GetFastValue(fileConfig, 'cache', false);\n\n /**\n * The file type string (image, json, etc) for sorting within the Loader.\n *\n * @name Phaser.Loader.File#type\n * @type {string}\n * @since 3.0.0\n */\n this.type = GetFastValue(fileConfig, 'type', false);\n\n /**\n * Unique cache key (unique within its file type)\n *\n * @name Phaser.Loader.File#key\n * @type {string}\n * @since 3.0.0\n */\n this.key = GetFastValue(fileConfig, 'key', false);\n\n var loadKey = this.key;\n\n if (loader.prefix && loader.prefix !== '')\n {\n this.key = loader.prefix + loadKey;\n }\n\n if (!this.type || !this.key)\n {\n throw new Error('Error calling \\'Loader.' + this.type + '\\' invalid key provided.');\n }\n\n /**\n * The URL of the file, not including baseURL.\n *\n * Automatically has Loader.path prepended to it if a string.\n *\n * Can also be a JavaScript Object, such as the results of parsing JSON data.\n *\n * @name Phaser.Loader.File#url\n * @type {object|string}\n * @since 3.0.0\n */\n this.url = GetFastValue(fileConfig, 'url');\n\n if (this.url === undefined)\n {\n this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', '');\n }\n else if (typeof this.url === 'string' && this.url.indexOf('blob:') !== 0 && this.url.indexOf('data:') !== 0)\n {\n this.url = loader.path + this.url;\n }\n\n /**\n * The final URL this file will load from, including baseURL and path.\n * Set automatically when the Loader calls 'load' on this file.\n *\n * @name Phaser.Loader.File#src\n * @type {string}\n * @since 3.0.0\n */\n this.src = '';\n\n /**\n * The merged XHRSettings for this file.\n *\n * @name Phaser.Loader.File#xhrSettings\n * @type {Phaser.Types.Loader.XHRSettingsObject}\n * @since 3.0.0\n */\n this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));\n\n if (GetFastValue(fileConfig, 'xhrSettings', false))\n {\n this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {}));\n }\n\n /**\n * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.\n *\n * @name Phaser.Loader.File#xhrLoader\n * @type {?XMLHttpRequest}\n * @since 3.0.0\n */\n this.xhrLoader = null;\n\n /**\n * The current state of the file. One of the FILE_CONST values.\n *\n * @name Phaser.Loader.File#state\n * @type {integer}\n * @since 3.0.0\n */\n this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING;\n\n /**\n * The total size of this file.\n * Set by onProgress and only if loading via XHR.\n *\n * @name Phaser.Loader.File#bytesTotal\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.bytesTotal = 0;\n\n /**\n * Updated as the file loads.\n * Only set if loading via XHR.\n *\n * @name Phaser.Loader.File#bytesLoaded\n * @type {number}\n * @default -1\n * @since 3.0.0\n */\n this.bytesLoaded = -1;\n\n /**\n * A percentage value between 0 and 1 indicating how much of this file has loaded.\n * Only set if loading via XHR.\n *\n * @name Phaser.Loader.File#percentComplete\n * @type {number}\n * @default -1\n * @since 3.0.0\n */\n this.percentComplete = -1;\n\n /**\n * For CORs based loading.\n * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)\n *\n * @name Phaser.Loader.File#crossOrigin\n * @type {(string|undefined)}\n * @since 3.0.0\n */\n this.crossOrigin = undefined;\n\n /**\n * The processed file data, stored here after the file has loaded.\n *\n * @name Phaser.Loader.File#data\n * @type {*}\n * @since 3.0.0\n */\n this.data = undefined;\n\n /**\n * A config object that can be used by file types to store transitional data.\n *\n * @name Phaser.Loader.File#config\n * @type {*}\n * @since 3.0.0\n */\n this.config = GetFastValue(fileConfig, 'config', {});\n\n /**\n * If this is a multipart file, i.e. an atlas and its json together, then this is a reference\n * to the parent MultiFile. Set and used internally by the Loader or specific file types.\n *\n * @name Phaser.Loader.File#multiFile\n * @type {?Phaser.Loader.MultiFile}\n * @since 3.7.0\n */\n this.multiFile;\n\n /**\n * Does this file have an associated linked file? Such as an image and a normal map.\n * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't\n * actually bound by data, where-as a linkFile is.\n *\n * @name Phaser.Loader.File#linkFile\n * @type {?Phaser.Loader.File}\n * @since 3.7.0\n */\n this.linkFile;\n },\n\n /**\n * Links this File with another, so they depend upon each other for loading and processing.\n *\n * @method Phaser.Loader.File#setLink\n * @since 3.7.0\n *\n * @param {Phaser.Loader.File} fileB - The file to link to this one.\n */\n setLink: function (fileB)\n {\n this.linkFile = fileB;\n\n fileB.linkFile = this;\n },\n\n /**\n * Resets the XHRLoader instance this file is using.\n *\n * @method Phaser.Loader.File#resetXHR\n * @since 3.0.0\n */\n resetXHR: function ()\n {\n if (this.xhrLoader)\n {\n this.xhrLoader.onload = undefined;\n this.xhrLoader.onerror = undefined;\n this.xhrLoader.onprogress = undefined;\n }\n },\n\n /**\n * Called by the Loader, starts the actual file downloading.\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\n *\n * @method Phaser.Loader.File#load\n * @since 3.0.0\n */\n load: function ()\n {\n if (this.state === CONST.FILE_POPULATED)\n {\n // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL\n this.loader.nextFile(this, true);\n }\n else\n {\n this.state = CONST.FILE_LOADING;\n\n this.src = GetURL(this, this.loader.baseURL);\n\n if (this.src.indexOf('data:') === 0)\n {\n console.warn('Local data URIs are not supported: ' + this.key);\n }\n else\n {\n // The creation of this XHRLoader starts the load process going.\n // It will automatically call the following, based on the load outcome:\n //\n // xhr.onload = this.onLoad\n // xhr.onerror = this.onError\n // xhr.onprogress = this.onProgress\n\n this.xhrLoader = XHRLoader(this, this.loader.xhr);\n }\n }\n },\n\n /**\n * Called when the file finishes loading, is sent a DOM ProgressEvent.\n *\n * @method Phaser.Loader.File#onLoad\n * @since 3.0.0\n *\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\n */\n onLoad: function (xhr, event)\n {\n var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0));\n\n var success = !(event.target && event.target.status !== 200) || localFileOk;\n\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)\n {\n success = false;\n }\n\n this.state = CONST.FILE_LOADED;\n\n this.resetXHR();\n\n this.loader.nextFile(this, success);\n },\n\n /**\n * Called if the file errors while loading, is sent a DOM ProgressEvent.\n *\n * @method Phaser.Loader.File#onError\n * @since 3.0.0\n *\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error.\n */\n onError: function ()\n {\n this.resetXHR();\n\n this.loader.nextFile(this, false);\n },\n\n /**\n * Called during the file load progress. Is sent a DOM ProgressEvent.\n *\n * @method Phaser.Loader.File#onProgress\n * @fires Phaser.Loader.Events#FILE_PROGRESS\n * @since 3.0.0\n *\n * @param {ProgressEvent} event - The DOM ProgressEvent.\n */\n onProgress: function (event)\n {\n if (event.lengthComputable)\n {\n this.bytesLoaded = event.loaded;\n this.bytesTotal = event.total;\n\n this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1);\n\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\n }\n },\n\n /**\n * Usually overridden by the FileTypes and is called by Loader.nextFile.\n * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.\n *\n * @method Phaser.Loader.File#onProcess\n * @since 3.0.0\n */\n onProcess: function ()\n {\n this.state = CONST.FILE_PROCESSING;\n\n this.onProcessComplete();\n },\n\n /**\n * Called when the File has completed processing.\n * Checks on the state of its multifile, if set.\n *\n * @method Phaser.Loader.File#onProcessComplete\n * @since 3.7.0\n */\n onProcessComplete: function ()\n {\n this.state = CONST.FILE_COMPLETE;\n\n if (this.multiFile)\n {\n this.multiFile.onFileComplete(this);\n }\n\n this.loader.fileProcessComplete(this);\n },\n\n /**\n * Called when the File has completed processing but it generated an error.\n * Checks on the state of its multifile, if set.\n *\n * @method Phaser.Loader.File#onProcessError\n * @since 3.7.0\n */\n onProcessError: function ()\n {\n this.state = CONST.FILE_ERRORED;\n\n if (this.multiFile)\n {\n this.multiFile.onFileFailed(this);\n }\n\n this.loader.fileProcessComplete(this);\n },\n\n /**\n * Checks if a key matching the one used by this file exists in the target Cache or not.\n * This is called automatically by the LoaderPlugin to decide if the file can be safely\n * loaded or will conflict.\n *\n * @method Phaser.Loader.File#hasCacheConflict\n * @since 3.7.0\n *\n * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`.\n */\n hasCacheConflict: function ()\n {\n return (this.cache && this.cache.exists(this.key));\n },\n\n /**\n * Adds this file to its target cache upon successful loading and processing.\n * This method is often overridden by specific file types.\n *\n * @method Phaser.Loader.File#addToCache\n * @since 3.7.0\n */\n addToCache: function ()\n {\n if (this.cache)\n {\n this.cache.add(this.key, this.data);\n }\n\n this.pendingDestroy();\n },\n\n /**\n * Called once the file has been added to its cache and is now ready for deletion from the Loader.\n * It will emit a `filecomplete` event from the LoaderPlugin.\n *\n * @method Phaser.Loader.File#pendingDestroy\n * @fires Phaser.Loader.Events#FILE_COMPLETE\n * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE\n * @since 3.7.0\n */\n pendingDestroy: function (data)\n {\n if (data === undefined) { data = this.data; }\n\n var key = this.key;\n var type = this.type;\n\n this.loader.emit(Events.FILE_COMPLETE, key, type, data);\n this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data);\n\n this.loader.flagForRemoval(this);\n },\n\n /**\n * Destroy this File and any references it holds.\n *\n * @method Phaser.Loader.File#destroy\n * @since 3.7.0\n */\n destroy: function ()\n {\n this.loader = null;\n this.cache = null;\n this.xhrSettings = null;\n this.multiFile = null;\n this.linkFile = null;\n this.data = null;\n }\n\n});\n\n/**\n * Static method for creating object URL using URL API and setting it as image 'src' attribute.\n * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader.\n *\n * @method Phaser.Loader.File.createObjectURL\n * @static\n * @since 3.7.0\n *\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.\n * @param {Blob} blob - A Blob object to create an object URL for.\n * @param {string} defaultType - Default mime type used if blob type is not available.\n */\nFile.createObjectURL = function (image, blob, defaultType)\n{\n if (typeof URL === 'function')\n {\n image.src = URL.createObjectURL(blob);\n }\n else\n {\n var reader = new FileReader();\n\n reader.onload = function ()\n {\n image.removeAttribute('crossOrigin');\n image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];\n };\n\n reader.onerror = image.onerror;\n\n reader.readAsDataURL(blob);\n }\n};\n\n/**\n * Static method for releasing an existing object URL which was previously created\n * by calling {@link File#createObjectURL} method.\n *\n * @method Phaser.Loader.File.revokeObjectURL\n * @static\n * @since 3.7.0\n *\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.\n */\nFile.revokeObjectURL = function (image)\n{\n if (typeof URL === 'function')\n {\n URL.revokeObjectURL(image.src);\n }\n};\n\nmodule.exports = File;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar types = {};\r\n\r\n/**\r\n * @namespace Phaser.Loader.FileTypesManager\r\n */\r\n\r\nvar FileTypesManager = {\r\n\r\n /**\r\n * Static method called when a LoaderPlugin is created.\r\n * \r\n * Loops through the local types object and injects all of them as\r\n * properties into the LoaderPlugin instance.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.install\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.\r\n */\r\n install: function (loader)\r\n {\r\n for (var key in types)\r\n {\r\n loader[key] = types[key];\r\n }\r\n },\r\n\r\n /**\r\n * Static method called directly by the File Types.\r\n * \r\n * The key is a reference to the function used to load the files via the Loader, i.e. `image`.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.register\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key that will be used as the method name in the LoaderPlugin.\r\n * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked.\r\n */\r\n register: function (key, factoryFunction)\r\n {\r\n types[key] = factoryFunction;\r\n },\r\n\r\n /**\r\n * Removed all associated file types.\r\n *\r\n * @method Phaser.Loader.FileTypesManager.destroy\r\n * @since 3.0.0\r\n */\r\n destroy: function ()\r\n {\r\n types = {};\r\n }\r\n\r\n};\r\n\r\nmodule.exports = FileTypesManager;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Given a File and a baseURL value this returns the URL the File will use to download from.\r\n *\r\n * @function Phaser.Loader.GetURL\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File object.\r\n * @param {string} baseURL - A default base URL.\r\n *\r\n * @return {string} The URL the File will use.\r\n */\r\nvar GetURL = function (file, baseURL)\r\n{\r\n if (!file.url)\r\n {\r\n return false;\r\n }\r\n\r\n if (file.url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\r\n {\r\n return file.url;\r\n }\r\n else\r\n {\r\n return baseURL + file.url;\r\n }\r\n};\r\n\r\nmodule.exports = GetURL;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Extend = require('../utils/object/Extend');\r\nvar XHRSettings = require('./XHRSettings');\r\n\r\n/**\r\n * Takes two XHRSettings Objects and creates a new XHRSettings object from them.\r\n *\r\n * The new object is seeded by the values given in the global settings, but any setting in\r\n * the local object overrides the global ones.\r\n *\r\n * @function Phaser.Loader.MergeXHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object.\r\n */\r\nvar MergeXHRSettings = function (global, local)\r\n{\r\n var output = (global === undefined) ? XHRSettings() : Extend({}, global);\r\n\r\n if (local)\r\n {\r\n for (var setting in local)\r\n {\r\n if (local[setting] !== undefined)\r\n {\r\n output[setting] = local[setting];\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = MergeXHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after\r\n * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont.\r\n * \r\n * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods.\r\n *\r\n * @class MultiFile\r\n * @memberof Phaser.Loader\r\n * @constructor\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\r\n * @param {string} type - The file type string for sorting within the Loader.\r\n * @param {string} key - The key of the file within the loader.\r\n * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile.\r\n */\r\nvar MultiFile = new Class({\r\n\r\n initialize:\r\n\r\n function MultiFile (loader, type, key, files)\r\n {\r\n /**\r\n * A reference to the Loader that is going to load this file.\r\n *\r\n * @name Phaser.Loader.MultiFile#loader\r\n * @type {Phaser.Loader.LoaderPlugin}\r\n * @since 3.7.0\r\n */\r\n this.loader = loader;\r\n\r\n /**\r\n * The file type string for sorting within the Loader.\r\n *\r\n * @name Phaser.Loader.MultiFile#type\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.type = type;\r\n\r\n /**\r\n * Unique cache key (unique within its file type)\r\n *\r\n * @name Phaser.Loader.MultiFile#key\r\n * @type {string}\r\n * @since 3.7.0\r\n */\r\n this.key = key;\r\n\r\n /**\r\n * The current index being used by multi-file loaders to avoid key clashes.\r\n *\r\n * @name Phaser.Loader.MultiFile#multiKeyIndex\r\n * @type {integer}\r\n * @private\r\n * @since 3.20.0\r\n */\r\n this.multiKeyIndex = loader.multiKeyIndex++;\r\n\r\n /**\r\n * Array of files that make up this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#files\r\n * @type {Phaser.Loader.File[]}\r\n * @since 3.7.0\r\n */\r\n this.files = files;\r\n\r\n /**\r\n * The completion status of this MultiFile.\r\n *\r\n * @name Phaser.Loader.MultiFile#complete\r\n * @type {boolean}\r\n * @default false\r\n * @since 3.7.0\r\n */\r\n this.complete = false;\r\n\r\n /**\r\n * The number of files to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#pending\r\n * @type {integer}\r\n * @since 3.7.0\r\n */\r\n\r\n this.pending = files.length;\r\n\r\n /**\r\n * The number of files that failed to load.\r\n *\r\n * @name Phaser.Loader.MultiFile#failed\r\n * @type {integer}\r\n * @default 0\r\n * @since 3.7.0\r\n */\r\n this.failed = 0;\r\n\r\n /**\r\n * A storage container for transient data that the loading files need.\r\n *\r\n * @name Phaser.Loader.MultiFile#config\r\n * @type {any}\r\n * @since 3.7.0\r\n */\r\n this.config = {};\r\n\r\n /**\r\n * A reference to the Loaders baseURL at the time this MultiFile was created.\r\n * Used to populate child-files.\r\n *\r\n * @name Phaser.Loader.MultiFile#baseURL\r\n * @type {string}\r\n * @since 3.20.0\r\n */\r\n this.baseURL = loader.baseURL;\r\n\r\n /**\r\n * A reference to the Loaders path at the time this MultiFile was created.\r\n * Used to populate child-files.\r\n *\r\n * @name Phaser.Loader.MultiFile#path\r\n * @type {string}\r\n * @since 3.20.0\r\n */\r\n this.path = loader.path;\r\n\r\n /**\r\n * A reference to the Loaders prefix at the time this MultiFile was created.\r\n * Used to populate child-files.\r\n *\r\n * @name Phaser.Loader.MultiFile#prefix\r\n * @type {string}\r\n * @since 3.20.0\r\n */\r\n this.prefix = loader.prefix;\r\n\r\n // Link the files\r\n for (var i = 0; i < files.length; i++)\r\n {\r\n files[i].multiFile = this;\r\n }\r\n },\r\n\r\n /**\r\n * Checks if this MultiFile is ready to process its children or not.\r\n *\r\n * @method Phaser.Loader.MultiFile#isReadyToProcess\r\n * @since 3.7.0\r\n *\r\n * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`.\r\n */\r\n isReadyToProcess: function ()\r\n {\r\n return (this.pending === 0 && this.failed === 0 && !this.complete);\r\n },\r\n\r\n /**\r\n * Adds another child to this MultiFile, increases the pending count and resets the completion status.\r\n *\r\n * @method Phaser.Loader.MultiFile#addToMultiFile\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} files - The File to add to this MultiFile.\r\n *\r\n * @return {Phaser.Loader.MultiFile} This MultiFile instance.\r\n */\r\n addToMultiFile: function (file)\r\n {\r\n this.files.push(file);\r\n\r\n file.multiFile = this;\r\n\r\n this.pending++;\r\n\r\n this.complete = false;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileComplete\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n }\r\n },\r\n\r\n /**\r\n * Called by each File that fails to load.\r\n *\r\n * @method Phaser.Loader.MultiFile#onFileFailed\r\n * @since 3.7.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has failed to load.\r\n */\r\n onFileFailed: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.failed++;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = MultiFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MergeXHRSettings = require('./MergeXHRSettings');\r\n\r\n/**\r\n * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings\r\n * and starts the download of it. It uses the Files own XHRSettings and merges them\r\n * with the global XHRSettings object to set the xhr values before download.\r\n *\r\n * @function Phaser.Loader.XHRLoader\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File to download.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object.\r\n *\r\n * @return {XMLHttpRequest} The XHR object.\r\n */\r\nvar XHRLoader = function (file, globalXHRSettings)\r\n{\r\n var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings);\r\n\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', file.src, config.async, config.user, config.password);\r\n\r\n xhr.responseType = file.xhrSettings.responseType;\r\n xhr.timeout = config.timeout;\r\n\r\n if (config.headers)\r\n {\r\n for (var key in config.headers)\r\n {\r\n xhr.setRequestHeader(key, config.headers[key]);\r\n }\r\n }\r\n\r\n if (config.header && config.headerValue)\r\n {\r\n xhr.setRequestHeader(config.header, config.headerValue);\r\n }\r\n\r\n if (config.requestedWith)\r\n {\r\n xhr.setRequestHeader('X-Requested-With', config.requestedWith);\r\n }\r\n\r\n if (config.overrideMimeType)\r\n {\r\n xhr.overrideMimeType(config.overrideMimeType);\r\n }\r\n\r\n if (config.withCredentials)\r\n {\r\n xhr.withCredentials = true;\r\n }\r\n\r\n // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.)\r\n\r\n xhr.onload = file.onLoad.bind(file, xhr);\r\n xhr.onerror = file.onError.bind(file, xhr);\r\n xhr.onprogress = file.onProgress.bind(file);\r\n\r\n // This is the only standard method, the ones above are browser additions (maybe not universal?)\r\n // xhr.onreadystatechange\r\n\r\n xhr.send();\r\n\r\n return xhr;\r\n};\r\n\r\nmodule.exports = XHRLoader;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Creates an XHRSettings Object with default values.\r\n *\r\n * @function Phaser.Loader.XHRSettings\r\n * @since 3.0.0\r\n *\r\n * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'.\r\n * @param {boolean} [async=true] - Should the XHR request use async or not?\r\n * @param {string} [user=''] - Optional username for the XHR request.\r\n * @param {string} [password=''] - Optional password for the XHR request.\r\n * @param {integer} [timeout=0] - Optional XHR timeout value.\r\n * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value.\r\n *\r\n * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader.\r\n */\r\nvar XHRSettings = function (responseType, async, user, password, timeout, withCredentials)\r\n{\r\n if (responseType === undefined) { responseType = ''; }\r\n if (async === undefined) { async = true; }\r\n if (user === undefined) { user = ''; }\r\n if (password === undefined) { password = ''; }\r\n if (timeout === undefined) { timeout = 0; }\r\n if (withCredentials === undefined) { withCredentials = false; }\r\n\r\n // Before sending a request, set the xhr.responseType to \"text\",\r\n // \"arraybuffer\", \"blob\", or \"document\", depending on your data needs.\r\n // Note, setting xhr.responseType = '' (or omitting) will default the response to \"text\".\r\n\r\n return {\r\n\r\n // Ignored by the Loader, only used by File.\r\n responseType: responseType,\r\n\r\n async: async,\r\n\r\n // credentials\r\n user: user,\r\n password: password,\r\n\r\n // timeout in ms (0 = no timeout)\r\n timeout: timeout,\r\n\r\n // setRequestHeader\r\n headers: undefined,\r\n header: undefined,\r\n headerValue: undefined,\r\n requestedWith: false,\r\n\r\n // overrideMimeType\r\n overrideMimeType: undefined,\r\n\r\n // withCredentials\r\n withCredentials: withCredentials\r\n\r\n };\r\n};\r\n\r\nmodule.exports = XHRSettings;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FILE_CONST = {\r\n\r\n /**\r\n * The Loader is idle.\r\n * \r\n * @name Phaser.Loader.LOADER_IDLE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_IDLE: 0,\r\n\r\n /**\r\n * The Loader is actively loading.\r\n * \r\n * @name Phaser.Loader.LOADER_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_LOADING: 1,\r\n\r\n /**\r\n * The Loader is processing files is has loaded.\r\n * \r\n * @name Phaser.Loader.LOADER_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_PROCESSING: 2,\r\n\r\n /**\r\n * The Loader has completed loading and processing.\r\n * \r\n * @name Phaser.Loader.LOADER_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_COMPLETE: 3,\r\n\r\n /**\r\n * The Loader is shutting down.\r\n * \r\n * @name Phaser.Loader.LOADER_SHUTDOWN\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_SHUTDOWN: 4,\r\n\r\n /**\r\n * The Loader has been destroyed.\r\n * \r\n * @name Phaser.Loader.LOADER_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOADER_DESTROYED: 5,\r\n\r\n /**\r\n * File is in the load queue but not yet started\r\n * \r\n * @name Phaser.Loader.FILE_PENDING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PENDING: 10,\r\n\r\n /**\r\n * File has been started to load by the loader (onLoad called)\r\n * \r\n * @name Phaser.Loader.FILE_LOADING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADING: 11,\r\n\r\n /**\r\n * File has loaded successfully, awaiting processing \r\n * \r\n * @name Phaser.Loader.FILE_LOADED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_LOADED: 12,\r\n\r\n /**\r\n * File failed to load\r\n * \r\n * @name Phaser.Loader.FILE_FAILED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_FAILED: 13,\r\n\r\n /**\r\n * File is being processed (onProcess callback)\r\n * \r\n * @name Phaser.Loader.FILE_PROCESSING\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_PROCESSING: 14,\r\n\r\n /**\r\n * The File has errored somehow during processing.\r\n * \r\n * @name Phaser.Loader.FILE_ERRORED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_ERRORED: 16,\r\n\r\n /**\r\n * File has finished processing.\r\n * \r\n * @name Phaser.Loader.FILE_COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_COMPLETE: 17,\r\n\r\n /**\r\n * File has been destroyed\r\n * \r\n * @name Phaser.Loader.FILE_DESTROYED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_DESTROYED: 18,\r\n\r\n /**\r\n * File was populated from local data and doesn't need an HTTP request\r\n * \r\n * @name Phaser.Loader.FILE_POPULATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n FILE_POPULATED: 19\r\n\r\n};\r\n\r\nmodule.exports = FILE_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Add File Event.\r\n * \r\n * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('addfile', listener)`.\r\n * \r\n * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them.\r\n *\r\n * @event Phaser.Loader.Events#ADD\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The unique key of the file that was added to the Loader.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`.\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader.\r\n */\r\nmodule.exports = 'addfile';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Complete Event.\r\n * \r\n * This event is dispatched when the Loader has fully processed everything in the load queue.\r\n * By this point every loaded file will now be in its associated cache and ready for use.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('complete', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n * @param {integer} totalComplete - The total number of files that successfully loaded.\r\n * @param {integer} totalFailed - The total number of files that failed to load.\r\n */\r\nmodule.exports = 'complete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`.\r\n * \r\n * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Complete Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\r\n * \r\n * It uses a special dynamic event name constructed from the key and type of the file.\r\n * \r\n * For example, if you have loaded an `image` with a key of `monster`, you can listen for it\r\n * using the following:\r\n *\r\n * ```javascript\r\n * this.load.on('filecomplete-image-monster', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n *\r\n * Or, if you have loaded a texture `atlas` with a key of `Level1`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-atlas-Level1', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`:\r\n * \r\n * ```javascript\r\n * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {\r\n * // Your handler code\r\n * });\r\n * ```\r\n * \r\n * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event.\r\n *\r\n * @event Phaser.Loader.Events#FILE_KEY_COMPLETE\r\n * @since 3.0.0\r\n * \r\n * @param {string} key - The key of the file that just loaded and finished processing.\r\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\r\n * @param {any} data - The raw data the file contained.\r\n */\r\nmodule.exports = 'filecomplete-';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Error Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file fails to load.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('loaderror', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD_ERROR\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n */\r\nmodule.exports = 'loaderror';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when a file finishes loading,\r\n * but _before_ it is processed and added to the internal Phaser caches.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('load', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_LOAD\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which just finished loading.\r\n */\r\nmodule.exports = 'load';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The File Load Progress Event.\r\n * \r\n * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and\r\n * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#FILE_PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\r\n * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is.\r\n */\r\nmodule.exports = 'fileprogress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Post Process Event.\r\n * \r\n * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue.\r\n * It is dispatched before the internal lists are cleared and each File is destroyed.\r\n * \r\n * Use this hook to perform any last minute processing of files that can only happen once the\r\n * Loader has completed, but prior to it emitting the `complete` event.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('postprocess', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#POST_PROCESS\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'postprocess';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Progress Event.\r\n * \r\n * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('progress', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#PROGRESS\r\n * @since 3.0.0\r\n * \r\n * @param {number} progress - The current progress of the load. A value between 0 and 1.\r\n */\r\nmodule.exports = 'progress';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Loader Plugin Start Event.\r\n * \r\n * This event is dispatched when the Loader starts running. At this point load progress is zero.\r\n * \r\n * This event is dispatched even if there aren't any files in the load queue.\r\n * \r\n * Listen to it from a Scene using: `this.load.on('start', listener)`.\r\n *\r\n * @event Phaser.Loader.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Loader.Events\r\n */\r\n\r\nmodule.exports = {\r\n\r\n ADD: require('./ADD_EVENT'),\r\n COMPLETE: require('./COMPLETE_EVENT'),\r\n FILE_COMPLETE: require('./FILE_COMPLETE_EVENT'),\r\n FILE_KEY_COMPLETE: require('./FILE_KEY_COMPLETE_EVENT'),\r\n FILE_LOAD_ERROR: require('./FILE_LOAD_ERROR_EVENT'),\r\n FILE_LOAD: require('./FILE_LOAD_EVENT'),\r\n FILE_PROGRESS: require('./FILE_PROGRESS_EVENT'),\r\n POST_PROCESS: require('./POST_PROCESS_EVENT'),\r\n PROGRESS: require('./PROGRESS_EVENT'),\r\n START: require('./START_EVENT')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Image File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.\r\n *\r\n * @class ImageFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets.\r\n */\r\nvar ImageFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function ImageFile (loader, key, url, xhrSettings, frameConfig)\r\n {\r\n var extension = 'png';\r\n var normalMapURL;\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n normalMapURL = GetFastValue(config, 'normalMap');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n frameConfig = GetFastValue(config, 'frameConfig');\r\n }\r\n\r\n if (Array.isArray(url))\r\n {\r\n normalMapURL = url[1];\r\n url = url[0];\r\n }\r\n\r\n var fileConfig = {\r\n type: 'image',\r\n cache: loader.textureManager,\r\n extension: extension,\r\n responseType: 'blob',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings,\r\n config: frameConfig\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n\r\n // Do we have a normal map to load as well?\r\n if (normalMapURL)\r\n {\r\n var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig);\r\n\r\n normalMap.type = 'normalMap';\r\n\r\n this.setLink(normalMap);\r\n\r\n loader.addFile(normalMap);\r\n }\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = new Image();\r\n\r\n this.data.crossOrigin = this.crossOrigin;\r\n\r\n var _this = this;\r\n\r\n this.data.onload = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessComplete();\r\n };\r\n\r\n this.data.onerror = function ()\r\n {\r\n File.revokeObjectURL(_this.data);\r\n\r\n _this.onProcessError();\r\n };\r\n\r\n File.createObjectURL(this.data, this.xhrLoader.response, 'image/png');\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.ImageFile#addToCache\r\n * @since 3.7.0\r\n */\r\n addToCache: function ()\r\n {\r\n var texture;\r\n var linkFile = this.linkFile;\r\n\r\n if (linkFile && linkFile.state === CONST.FILE_COMPLETE)\r\n {\r\n if (this.type === 'image')\r\n {\r\n texture = this.cache.addImage(this.key, this.data, linkFile.data);\r\n }\r\n else\r\n {\r\n texture = this.cache.addImage(linkFile.key, linkFile.data, this.data);\r\n }\r\n\r\n this.pendingDestroy(texture);\r\n\r\n linkFile.pendingDestroy(texture);\r\n }\r\n else if (!linkFile)\r\n {\r\n texture = this.cache.addImage(this.key, this.data);\r\n\r\n this.pendingDestroy(texture);\r\n }\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds an Image, or array of Images, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.image('logo', 'images/phaserLogo.png');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\r\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\r\n * of animated gifs to Canvas elements.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Texture Manager first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\r\n *\r\n * ```javascript\r\n * this.load.image('logo', 'images/AtariLogo.png');\r\n * // and later in your game ...\r\n * this.add.image(x, y, 'logo');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the image from the Texture Manager.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\r\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\r\n *\r\n * ```javascript\r\n * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);\r\n * ```\r\n *\r\n * Or, if you are using a config object use the `normalMap` property:\r\n *\r\n * ```javascript\r\n * this.load.image({\r\n * key: 'logo',\r\n * url: 'images/AtariLogo.png',\r\n * normalMap: 'images/AtariLogo-n.png'\r\n * });\r\n * ```\r\n *\r\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\r\n * Normal maps are a WebGL only feature.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#image\r\n * @fires Phaser.Loader.LoaderPlugin#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {this} The Loader instance.\r\n */\r\nFileTypesManager.register('image', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new ImageFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new ImageFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = ImageFile;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar CONST = require('../const');\nvar File = require('../File');\nvar FileTypesManager = require('../FileTypesManager');\nvar GetFastValue = require('../../utils/object/GetFastValue');\nvar GetValue = require('../../utils/object/GetValue');\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\n\n/**\n * @classdesc\n * A single JSON File suitable for loading by the Loader.\n *\n * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.\n *\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.\n *\n * @class JSONFile\n * @extends Phaser.Loader.File\n * @memberof Phaser.Loader.FileTypes\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\n * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\". Or, can be a fully formed JSON Object.\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\n */\nvar JSONFile = new Class({\n\n Extends: File,\n\n initialize:\n\n // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\n\n function JSONFile (loader, key, url, xhrSettings, dataKey)\n {\n var extension = 'json';\n\n if (IsPlainObject(key))\n {\n var config = key;\n\n key = GetFastValue(config, 'key');\n url = GetFastValue(config, 'url');\n xhrSettings = GetFastValue(config, 'xhrSettings');\n extension = GetFastValue(config, 'extension', extension);\n dataKey = GetFastValue(config, 'dataKey', dataKey);\n }\n\n var fileConfig = {\n type: 'json',\n cache: loader.cacheManager.json,\n extension: extension,\n responseType: 'text',\n key: key,\n url: url,\n xhrSettings: xhrSettings,\n config: dataKey\n };\n\n File.call(this, loader, fileConfig);\n\n if (IsPlainObject(url))\n {\n // Object provided instead of a URL, so no need to actually load it (populate data with value)\n if (dataKey)\n {\n this.data = GetValue(url, dataKey);\n }\n else\n {\n this.data = url;\n }\n\n this.state = CONST.FILE_POPULATED;\n }\n },\n\n /**\n * Called automatically by Loader.nextFile.\n * This method controls what extra work this File does with its loaded data.\n *\n * @method Phaser.Loader.FileTypes.JSONFile#onProcess\n * @since 3.7.0\n */\n onProcess: function ()\n {\n if (this.state !== CONST.FILE_POPULATED)\n {\n this.state = CONST.FILE_PROCESSING;\n\n var json = JSON.parse(this.xhrLoader.responseText);\n\n var key = this.config;\n\n if (typeof key === 'string')\n {\n this.data = GetValue(json, key, json);\n }\n else\n {\n this.data = json;\n }\n }\n\n this.onProcessComplete();\n }\n\n});\n\n/**\n * Adds a JSON file, or array of JSON files, to the current load queue.\n *\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\n *\n * ```javascript\n * function preload ()\n * {\n * this.load.json('wavedata', 'files/AlienWaveData.json');\n * }\n * ```\n *\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\n * loaded.\n *\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\n * then remove it from the JSON Cache first, before loading a new one.\n *\n * Instead of passing arguments you can pass a configuration object, such as:\n *\n * ```javascript\n * this.load.json({\n * key: 'wavedata',\n * url: 'files/AlienWaveData.json'\n * });\n * ```\n *\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\n *\n * Once the file has finished loading you can access it from its Cache using its key:\n *\n * ```javascript\n * this.load.json('wavedata', 'files/AlienWaveData.json');\n * // and later in your game ...\n * var data = this.cache.json.get('wavedata');\n * ```\n *\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\n * this is what you would use to retrieve the text from the JSON Cache.\n *\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\n *\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"data\"\n * and no URL is given then the Loader will set the URL to be \"data.json\". It will always add `.json` as the extension, although\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\n *\n * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache,\n * rather than the whole file. For example, if your JSON data had a structure like this:\n *\n * ```json\n * {\n * \"level1\": {\n * \"baddies\": {\n * \"aliens\": {},\n * \"boss\": {}\n * }\n * },\n * \"level2\": {},\n * \"level3\": {}\n * }\n * ```\n *\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\n *\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\n * It is available in the default build but can be excluded from custom builds.\n *\n * @method Phaser.Loader.LoaderPlugin#json\n * @fires Phaser.Loader.LoaderPlugin#ADD\n * @since 3.0.0\n *\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\n * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\". Or, can be a fully formed JSON Object.\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\n *\n * @return {this} The Loader instance.\n */\nFileTypesManager.register('json', function (key, url, dataKey, xhrSettings)\n{\n if (Array.isArray(key))\n {\n for (var i = 0; i < key.length; i++)\n {\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\n this.addFile(new JSONFile(this, key[i]));\n }\n }\n else\n {\n this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey));\n }\n\n return this;\n});\n\nmodule.exports = JSONFile;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\nvar CONST = require('../const');\r\nvar File = require('../File');\r\nvar FileTypesManager = require('../FileTypesManager');\r\nvar GetFastValue = require('../../utils/object/GetFastValue');\r\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\r\n\r\n/**\r\n * @classdesc\r\n * A single Text File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text.\r\n *\r\n * @class TextFile\r\n * @extends Phaser.Loader.File\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\r\n */\r\nvar TextFile = new Class({\r\n\r\n Extends: File,\r\n\r\n initialize:\r\n\r\n function TextFile (loader, key, url, xhrSettings)\r\n {\r\n var extension = 'txt';\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n url = GetFastValue(config, 'url');\r\n xhrSettings = GetFastValue(config, 'xhrSettings');\r\n extension = GetFastValue(config, 'extension', extension);\r\n }\r\n\r\n var fileConfig = {\r\n type: 'text',\r\n cache: loader.cacheManager.text,\r\n extension: extension,\r\n responseType: 'text',\r\n key: key,\r\n url: url,\r\n xhrSettings: xhrSettings\r\n };\r\n\r\n File.call(this, loader, fileConfig);\r\n },\r\n\r\n /**\r\n * Called automatically by Loader.nextFile.\r\n * This method controls what extra work this File does with its loaded data.\r\n *\r\n * @method Phaser.Loader.FileTypes.TextFile#onProcess\r\n * @since 3.7.0\r\n */\r\n onProcess: function ()\r\n {\r\n this.state = CONST.FILE_PROCESSING;\r\n\r\n this.data = this.xhrLoader.responseText;\r\n\r\n this.onProcessComplete();\r\n }\r\n\r\n});\r\n\r\n/**\r\n * Adds a Text file, or array of Text files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Text Cache.\r\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\r\n * then remove it from the Text Cache first, before loading a new one.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.text({\r\n * key: 'story',\r\n * url: 'files/IntroStory.txt'\r\n * });\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details.\r\n *\r\n * Once the file has finished loading you can access it from its Cache using its key:\r\n *\r\n * ```javascript\r\n * this.load.text('story', 'files/IntroStory.txt');\r\n * // and later in your game ...\r\n * var data = this.cache.text.get('story');\r\n * ```\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\r\n * this is what you would use to retrieve the text from the Text Cache.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"story\"\r\n * and no URL is given then the Loader will set the URL to be \"story.txt\". It will always add `.txt` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser.\r\n * It is available in the default build but can be excluded from custom builds.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#text\r\n * @fires Phaser.Loader.LoaderPlugin#ADD\r\n * @since 3.0.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {this} The Loader instance.\r\n */\r\nFileTypesManager.register('text', function (key, url, xhrSettings)\r\n{\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\r\n this.addFile(new TextFile(this, key[i]));\r\n }\r\n }\r\n else\r\n {\r\n this.addFile(new TextFile(this, key, url, xhrSettings));\r\n }\r\n\r\n return this;\r\n});\r\n\r\nmodule.exports = TextFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the mean average of the given values.\r\n *\r\n * @function Phaser.Math.Average\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} values - The values to average.\r\n *\r\n * @return {number} The average value.\r\n */\r\nvar Average = function (values)\r\n{\r\n var sum = 0;\r\n\r\n for (var i = 0; i < values.length; i++)\r\n {\r\n sum += (+values[i]);\r\n }\r\n\r\n return sum / values.length;\r\n};\r\n\r\nmodule.exports = Average;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Factorial = require('./Factorial');\r\n\r\n/**\r\n * Calculates the Bernstein basis from the three factorial coefficients.\r\n *\r\n * @function Phaser.Math.Bernstein\r\n * @since 3.0.0\r\n *\r\n * @param {number} n - The first value.\r\n * @param {number} i - The second value.\r\n *\r\n * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i)\r\n */\r\nvar Bernstein = function (n, i)\r\n{\r\n return Factorial(n) / Factorial(i) / Factorial(n - i);\r\n};\r\n\r\nmodule.exports = Bernstein;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random integer between the `min` and `max` values, inclusive.\r\n *\r\n * @function Phaser.Math.Between\r\n * @since 3.0.0\r\n *\r\n * @param {integer} min - The minimum value.\r\n * @param {integer} max - The maximum value.\r\n *\r\n * @return {integer} The random integer.\r\n */\r\nvar Between = function (min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5.\r\n *\r\n * @function Phaser.Math.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - The amount to interpolate by.\r\n * @param {number} p0 - The first control point.\r\n * @param {number} p1 - The second control point.\r\n * @param {number} p2 - The third control point.\r\n * @param {number} p3 - The fourth control point.\r\n *\r\n * @return {number} The Catmull-Rom value.\r\n */\r\nvar CatmullRom = function (t, p0, p1, p2, p3)\r\n{\r\n var v0 = (p2 - p0) * 0.5;\r\n var v1 = (p3 - p1) * 0.5;\r\n var t2 = t * t;\r\n var t3 = t * t2;\r\n\r\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\r\n};\r\n\r\nmodule.exports = CatmullRom;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Ceils to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.CeilTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {number} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar CeilTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.ceil(value * p) / p;\r\n};\r\n\r\nmodule.exports = CeilTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Force a value within the boundaries by clamping it to the range `min`, `max`.\r\n *\r\n * @function Phaser.Math.Clamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to be clamped.\r\n * @param {number} min - The minimum bounds.\r\n * @param {number} max - The maximum bounds.\r\n *\r\n * @return {number} The clamped value.\r\n */\r\nvar Clamp = function (value, min, max)\r\n{\r\n return Math.max(min, Math.min(max, value));\r\n};\r\n\r\nmodule.exports = Clamp;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle from degrees, to the equivalent angle in radians.\r\n *\r\n * @function Phaser.Math.DegToRad\r\n * @since 3.0.0\r\n *\r\n * @param {integer} degrees - The angle (in degrees) to convert to radians.\r\n *\r\n * @return {number} The given angle converted to radians.\r\n */\r\nvar DegToRad = function (degrees)\r\n{\r\n return degrees * CONST.DEG_TO_RAD;\r\n};\r\n\r\nmodule.exports = DegToRad;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the positive difference of two given numbers.\r\n *\r\n * @function Phaser.Math.Difference\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first number in the calculation.\r\n * @param {number} b - The second number in the calculation.\r\n *\r\n * @return {number} The positive difference of the two given numbers.\r\n */\r\nvar Difference = function (a, b)\r\n{\r\n return Math.abs(a - b);\r\n};\r\n\r\nmodule.exports = Difference;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates the factorial of a given number for integer values greater than 0.\r\n *\r\n * @function Phaser.Math.Factorial\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - A positive integer to calculate the factorial of.\r\n *\r\n * @return {number} The factorial of the given number.\r\n */\r\nvar Factorial = function (value)\r\n{\r\n if (value === 0)\r\n {\r\n return 1;\r\n }\r\n\r\n var res = value;\r\n\r\n while (--value)\r\n {\r\n res *= value;\r\n }\r\n\r\n return res;\r\n};\r\n\r\nmodule.exports = Factorial;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive.\r\n *\r\n * @function Phaser.Math.FloatBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The lower bound for the float, inclusive.\r\n * @param {number} max - The upper bound for the float exclusive.\r\n *\r\n * @return {number} A random float within the given range.\r\n */\r\nvar FloatBetween = function (min, max)\r\n{\r\n return Math.random() * (max - min) + min;\r\n};\r\n\r\nmodule.exports = FloatBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Floors to some place comparative to a `base`, default is 10 for decimal place.\r\n *\r\n * The `place` is represented by the power applied to `base` to get that place.\r\n *\r\n * @function Phaser.Math.FloorTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar FloorTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.floor(value * p) / p;\r\n};\r\n\r\nmodule.exports = FloorTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Clamp = require('./Clamp');\r\n\r\n/**\r\n * Return a value based on the range between `min` and `max` and the percentage given.\r\n *\r\n * @function Phaser.Math.FromPercent\r\n * @since 3.0.0\r\n *\r\n * @param {number} percent - A value between 0 and 1 representing the percentage.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n *\r\n * @return {number} The value that is `percent` percent between `min` and `max`.\r\n */\r\nvar FromPercent = function (percent, min, max)\r\n{\r\n percent = Clamp(percent, 0, 1);\r\n\r\n return (max - min) * percent;\r\n};\r\n\r\nmodule.exports = FromPercent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a per-ms speed from a distance and time (given in seconds).\r\n *\r\n * @function Phaser.Math.GetSpeed\r\n * @since 3.0.0\r\n *\r\n * @param {number} distance - The distance.\r\n * @param {integer} time - The time, in seconds.\r\n *\r\n * @return {number} The speed, in distance per ms.\r\n *\r\n * @example\r\n * // 400px over 1 second is 0.4 px/ms\r\n * Phaser.Math.GetSpeed(400, 1) // -> 0.4\r\n */\r\nvar GetSpeed = function (distance, time)\r\n{\r\n return (distance / time) / 1000;\r\n};\r\n\r\nmodule.exports = GetSpeed;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number.\r\n *\r\n * @function Phaser.Math.IsEven\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEven = function (value)\r\n{\r\n // Use abstract equality == for \"is number\" test\r\n\r\n // eslint-disable-next-line eqeqeq\r\n return (value == parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEven;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check if a given value is an even number using a strict type check.\r\n *\r\n * @function Phaser.Math.IsEvenStrict\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to perform the check with.\r\n *\r\n * @return {boolean} Whether the number is even or not.\r\n */\r\nvar IsEvenStrict = function (value)\r\n{\r\n // Use strict equality === for \"is number\" test\r\n return (value === parseFloat(value)) ? !(value % 2) : void 0;\r\n};\r\n\r\nmodule.exports = IsEvenStrict;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculates a linear (interpolation) value over t.\r\n *\r\n * @function Phaser.Math.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} p0 - The first point.\r\n * @param {number} p1 - The second point.\r\n * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1.\r\n *\r\n * @return {number} The step t% of the way between p0 and p1.\r\n */\r\nvar Linear = function (p0, p1, t)\r\n{\r\n return (p1 - p0) * t + p0;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A three-dimensional matrix.\r\n *\r\n * Defaults to the identity matrix when instantiated.\r\n *\r\n * @class Matrix3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from.\r\n */\r\nvar Matrix3 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix3 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix3#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(9);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix3 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} A clone of this Matrix3.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix3(this);\r\n },\r\n\r\n /**\r\n * This method is an alias for `Matrix3.copy`.\r\n *\r\n * @method Phaser.Math.Matrix3#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix4 into this Matrix3.\r\n *\r\n * @method Phaser.Math.Matrix3#fromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[4];\r\n out[4] = a[5];\r\n out[5] = a[6];\r\n out[6] = a[8];\r\n out[7] = a[9];\r\n out[8] = a[10];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix3#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 1;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a12 = a[5];\r\n\r\n a[1] = a[3];\r\n a[2] = a[6];\r\n a[3] = a01;\r\n a[5] = a[7];\r\n a[6] = a02;\r\n a[7] = a12;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b01 = a22 * a11 - a12 * a21;\r\n var b11 = -a22 * a10 + a12 * a20;\r\n var b21 = a21 * a10 - a11 * a20;\r\n\r\n // Calculate the determinant\r\n var det = a00 * b01 + a01 * b11 + a02 * b21;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = b01 * det;\r\n a[1] = (-a22 * a01 + a02 * a21) * det;\r\n a[2] = (a12 * a01 - a02 * a11) * det;\r\n a[3] = b11 * det;\r\n a[4] = (a22 * a00 - a02 * a20) * det;\r\n a[5] = (-a12 * a00 + a02 * a10) * det;\r\n a[6] = b21 * det;\r\n a[7] = (-a21 * a00 + a01 * a20) * det;\r\n a[8] = (a11 * a00 - a01 * a10) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n a[0] = (a11 * a22 - a12 * a21);\r\n a[1] = (a02 * a21 - a01 * a22);\r\n a[2] = (a01 * a12 - a02 * a11);\r\n a[3] = (a12 * a20 - a10 * a22);\r\n a[4] = (a00 * a22 - a02 * a20);\r\n a[5] = (a02 * a10 - a00 * a12);\r\n a[6] = (a10 * a21 - a11 * a20);\r\n a[7] = (a01 * a20 - a00 * a21);\r\n a[8] = (a00 * a11 - a01 * a10);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n var a20 = a[6];\r\n var a21 = a[7];\r\n var a22 = a[8];\r\n\r\n var b = src.val;\r\n\r\n var b00 = b[0];\r\n var b01 = b[1];\r\n var b02 = b[2];\r\n var b10 = b[3];\r\n var b11 = b[4];\r\n var b12 = b[5];\r\n var b20 = b[6];\r\n var b21 = b[7];\r\n var b22 = b[8];\r\n\r\n a[0] = b00 * a00 + b01 * a10 + b02 * a20;\r\n a[1] = b00 * a01 + b01 * a11 + b02 * a21;\r\n a[2] = b00 * a02 + b01 * a12 + b02 * a22;\r\n\r\n a[3] = b10 * a00 + b11 * a10 + b12 * a20;\r\n a[4] = b10 * a01 + b11 * a11 + b12 * a21;\r\n a[5] = b10 * a02 + b11 * a12 + b12 * a22;\r\n\r\n a[6] = b20 * a00 + b21 * a10 + b22 * a20;\r\n a[7] = b20 * a01 + b21 * a11 + b22 * a21;\r\n a[8] = b20 * a02 + b21 * a12 + b22 * a22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix3#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n translate: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[6] = x * a[0] + y * a[3] + a[6];\r\n a[7] = x * a[1] + y * a[4] + a[7];\r\n a[8] = x * a[2] + y * a[5] + a[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n rotate: function (rad)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a10 = a[3];\r\n var a11 = a[4];\r\n var a12 = a[5];\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n a[0] = c * a00 + s * a10;\r\n a[1] = c * a01 + s * a11;\r\n a[2] = c * a02 + s * a12;\r\n\r\n a[3] = c * a10 - s * a00;\r\n a[4] = c * a11 - s * a01;\r\n a[5] = c * a12 - s * a02;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x` and `y` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n scale: function (v)\r\n {\r\n var a = this.val;\r\n var x = v.x;\r\n var y = v.y;\r\n\r\n a[0] = x * a[0];\r\n a[1] = x * a[1];\r\n a[2] = x * a[2];\r\n\r\n a[3] = y * a[3];\r\n a[4] = y * a[4];\r\n a[5] = y * a[5];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix3#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n var out = this.val;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[3] = xy + wz;\r\n out[6] = xz - wy;\r\n\r\n out[1] = xy - wz;\r\n out[4] = 1 - (xx + zz);\r\n out[7] = yz + wx;\r\n\r\n out[2] = xz + wy;\r\n out[5] = yz - wx;\r\n out[8] = 1 - (xx + yy);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix3 to be normalized from the given Matrix4.\r\n *\r\n * @method Phaser.Math.Matrix3#normalFromMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from.\r\n *\r\n * @return {Phaser.Math.Matrix3} This Matrix3.\r\n */\r\n normalFromMat4: function (m)\r\n {\r\n var a = m.val;\r\n var out = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n\r\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n\r\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Matrix3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n/**\r\n * @classdesc\r\n * A four-dimensional matrix.\r\n *\r\n * @class Matrix4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from.\r\n */\r\nvar Matrix4 = new Class({\r\n\r\n initialize:\r\n\r\n function Matrix4 (m)\r\n {\r\n /**\r\n * The matrix values.\r\n *\r\n * @name Phaser.Math.Matrix4#val\r\n * @type {Float32Array}\r\n * @since 3.0.0\r\n */\r\n this.val = new Float32Array(16);\r\n\r\n if (m)\r\n {\r\n // Assume Matrix4 with val:\r\n this.copy(m);\r\n }\r\n else\r\n {\r\n // Default to identity\r\n this.identity();\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Matrix4.\r\n *\r\n * @method Phaser.Math.Matrix4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} A clone of this Matrix4.\r\n */\r\n clone: function ()\r\n {\r\n return new Matrix4(this);\r\n },\r\n\r\n // TODO - Should work with basic values\r\n\r\n /**\r\n * This method is an alias for `Matrix4.copy`.\r\n *\r\n * @method Phaser.Math.Matrix4#set\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n set: function (src)\r\n {\r\n return this.copy(src);\r\n },\r\n\r\n /**\r\n * Copy the values of a given Matrix into this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n copy: function (src)\r\n {\r\n var out = this.val;\r\n var a = src.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given array.\r\n *\r\n * @method Phaser.Math.Matrix4#fromArray\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The array to copy the values from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromArray: function (a)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = a[0];\r\n out[1] = a[1];\r\n out[2] = a[2];\r\n out[3] = a[3];\r\n out[4] = a[4];\r\n out[5] = a[5];\r\n out[6] = a[6];\r\n out[7] = a[7];\r\n out[8] = a[8];\r\n out[9] = a[9];\r\n out[10] = a[10];\r\n out[11] = a[11];\r\n out[12] = a[12];\r\n out[13] = a[13];\r\n out[14] = a[14];\r\n out[15] = a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix.\r\n *\r\n * Sets all values to `0`.\r\n *\r\n * @method Phaser.Math.Matrix4#zero\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n zero: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 0;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 0;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 0;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y` and `z` values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#xyz\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value.\r\n * @param {number} y - The y value.\r\n * @param {number} z - The z value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n xyz: function (x, y, z)\r\n {\r\n this.identity();\r\n\r\n var out = this.val;\r\n\r\n out[12] = x;\r\n out[13] = y;\r\n out[14] = z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the scaling values of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaling\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x scaling value.\r\n * @param {number} y - The y scaling value.\r\n * @param {number} z - The z scaling value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaling: function (x, y, z)\r\n {\r\n this.zero();\r\n\r\n var out = this.val;\r\n\r\n out[0] = x;\r\n out[5] = y;\r\n out[10] = z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n identity: function ()\r\n {\r\n var out = this.val;\r\n\r\n out[0] = 1;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n out[4] = 0;\r\n out[5] = 1;\r\n out[6] = 0;\r\n out[7] = 0;\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 1;\r\n out[11] = 0;\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transpose this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#transpose\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n transpose: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n var a23 = a[11];\r\n\r\n a[1] = a[4];\r\n a[2] = a[8];\r\n a[3] = a[12];\r\n a[4] = a01;\r\n a[6] = a[9];\r\n a[7] = a[13];\r\n a[8] = a02;\r\n a[9] = a12;\r\n a[11] = a[14];\r\n a[12] = a03;\r\n a[13] = a13;\r\n a[14] = a23;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n invert: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n\r\n if (!det)\r\n {\r\n return null;\r\n }\r\n\r\n det = 1 / det;\r\n\r\n a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\r\n a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\r\n a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\r\n a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\r\n a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\r\n a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\r\n a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\r\n a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\r\n a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\r\n a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\r\n a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\r\n a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\r\n a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\r\n a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\r\n a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\r\n a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the adjoint, or adjugate, of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#adjoint\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n adjoint: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22));\r\n a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\r\n a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12));\r\n a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\r\n a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\r\n a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22));\r\n a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\r\n a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12));\r\n a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21));\r\n a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\r\n a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11));\r\n a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\r\n a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\r\n a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21));\r\n a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\r\n a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11));\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the determinant of this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#determinant\r\n * @since 3.0.0\r\n *\r\n * @return {number} The determinant of this Matrix.\r\n */\r\n determinant: function ()\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b00 = a00 * a11 - a01 * a10;\r\n var b01 = a00 * a12 - a02 * a10;\r\n var b02 = a00 * a13 - a03 * a10;\r\n var b03 = a01 * a12 - a02 * a11;\r\n var b04 = a01 * a13 - a03 * a11;\r\n var b05 = a02 * a13 - a03 * a12;\r\n var b06 = a20 * a31 - a21 * a30;\r\n var b07 = a20 * a32 - a22 * a30;\r\n var b08 = a20 * a33 - a23 * a30;\r\n var b09 = a21 * a32 - a22 * a31;\r\n var b10 = a21 * a33 - a23 * a31;\r\n var b11 = a22 * a33 - a23 * a32;\r\n\r\n // Calculate the determinant\r\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\r\n },\r\n\r\n /**\r\n * Multiply this Matrix by the given Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiply: function (src)\r\n {\r\n var a = this.val;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n var a30 = a[12];\r\n var a31 = a[13];\r\n var a32 = a[14];\r\n var a33 = a[15];\r\n\r\n var b = src.val;\r\n\r\n // Cache only the current line of the second matrix\r\n var b0 = b[0];\r\n var b1 = b[1];\r\n var b2 = b[2];\r\n var b3 = b[3];\r\n\r\n a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n\r\n a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n\r\n a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n\r\n a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\r\n a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\r\n a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\r\n a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply the values of this Matrix4 by those given in the `src` argument.\r\n *\r\n * @method Phaser.Math.Matrix4#multiplyLocal\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n multiplyLocal: function (src)\r\n {\r\n var a = [];\r\n var m1 = this.val;\r\n var m2 = src.val;\r\n\r\n a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12];\r\n a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13];\r\n a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14];\r\n a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15];\r\n\r\n a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12];\r\n a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13];\r\n a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14];\r\n a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15];\r\n\r\n a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12];\r\n a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13];\r\n a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14];\r\n a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15];\r\n\r\n a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12];\r\n a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13];\r\n a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14];\r\n a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15];\r\n\r\n return this.fromArray(a);\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#translate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translate: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Translate this Matrix using the given values.\r\n *\r\n * @method Phaser.Math.Matrix4#translateXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n translateXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\r\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\r\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\r\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scale: function (v)\r\n {\r\n var x = v.x;\r\n var y = v.y;\r\n var z = v.z;\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a scale transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#scaleXYZ\r\n * @since 3.16.0\r\n *\r\n * @param {number} x - The x component.\r\n * @param {number} y - The y component.\r\n * @param {number} z - The z component.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n scaleXYZ: function (x, y, z)\r\n {\r\n var a = this.val;\r\n\r\n a[0] = a[0] * x;\r\n a[1] = a[1] * x;\r\n a[2] = a[2] * x;\r\n a[3] = a[3] * x;\r\n\r\n a[4] = a[4] * y;\r\n a[5] = a[5] * y;\r\n a[6] = a[6] * y;\r\n a[7] = a[7] * y;\r\n\r\n a[8] = a[8] * z;\r\n a[9] = a[9] * z;\r\n a[10] = a[10] * z;\r\n a[11] = a[11] * z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Derive a rotation matrix around the given axis.\r\n *\r\n * @method Phaser.Math.Matrix4#makeRotationAxis\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis.\r\n * @param {number} angle - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n makeRotationAxis: function (axis, angle)\r\n {\r\n // Based on http://www.gamedev.net/reference/articles/article1199.asp\r\n\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n var t = 1 - c;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var tx = t * x;\r\n var ty = t * y;\r\n\r\n this.fromArray([\r\n tx * x + c, tx * y - s * z, tx * z + s * y, 0,\r\n tx * y + s * z, ty * y + c, ty * z - s * x, 0,\r\n tx * z - s * y, ty * z + s * x, t * z * z + c, 0,\r\n 0, 0, 0, 1\r\n ]);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Apply a rotation transformation to this Matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#rotate\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate upon.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotate: function (rad, axis)\r\n {\r\n var a = this.val;\r\n var x = axis.x;\r\n var y = axis.y;\r\n var z = axis.z;\r\n var len = Math.sqrt(x * x + y * y + z * z);\r\n\r\n if (Math.abs(len) < EPSILON)\r\n {\r\n return null;\r\n }\r\n\r\n len = 1 / len;\r\n x *= len;\r\n y *= len;\r\n z *= len;\r\n\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n var t = 1 - c;\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Construct the elements of the rotation matrix\r\n var b00 = x * x * t + c;\r\n var b01 = y * x * t + z * s;\r\n var b02 = z * x * t - y * s;\r\n\r\n var b10 = x * y * t - z * s;\r\n var b11 = y * y * t + c;\r\n var b12 = z * y * t + x * s;\r\n\r\n var b20 = x * z * t + y * s;\r\n var b21 = y * z * t - x * s;\r\n var b22 = z * z * t + c;\r\n\r\n // Perform rotation-specific matrix multiplication\r\n a[0] = a00 * b00 + a10 * b01 + a20 * b02;\r\n a[1] = a01 * b00 + a11 * b01 + a21 * b02;\r\n a[2] = a02 * b00 + a12 * b01 + a22 * b02;\r\n a[3] = a03 * b00 + a13 * b01 + a23 * b02;\r\n a[4] = a00 * b10 + a10 * b11 + a20 * b12;\r\n a[5] = a01 * b10 + a11 * b11 + a21 * b12;\r\n a[6] = a02 * b10 + a12 * b11 + a22 * b12;\r\n a[7] = a03 * b10 + a13 * b11 + a23 * b12;\r\n a[8] = a00 * b20 + a10 * b21 + a20 * b22;\r\n a[9] = a01 * b20 + a11 * b21 + a21 * b22;\r\n a[10] = a02 * b20 + a12 * b21 + a22 * b22;\r\n a[11] = a03 * b20 + a13 * b21 + a23 * b22;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its X axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle in radians to rotate by.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateX: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[4] = a10 * c + a20 * s;\r\n a[5] = a11 * c + a21 * s;\r\n a[6] = a12 * c + a22 * s;\r\n a[7] = a13 * c + a23 * s;\r\n a[8] = a20 * c - a10 * s;\r\n a[9] = a21 * c - a11 * s;\r\n a[10] = a22 * c - a12 * s;\r\n a[11] = a23 * c - a13 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Y axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateY: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a20 = a[8];\r\n var a21 = a[9];\r\n var a22 = a[10];\r\n var a23 = a[11];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c - a20 * s;\r\n a[1] = a01 * c - a21 * s;\r\n a[2] = a02 * c - a22 * s;\r\n a[3] = a03 * c - a23 * s;\r\n a[8] = a00 * s + a20 * c;\r\n a[9] = a01 * s + a21 * c;\r\n a[10] = a02 * s + a22 * c;\r\n a[11] = a03 * s + a23 * c;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this matrix on its Z axis.\r\n *\r\n * @method Phaser.Math.Matrix4#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n var a = this.val;\r\n var s = Math.sin(rad);\r\n var c = Math.cos(rad);\r\n\r\n var a00 = a[0];\r\n var a01 = a[1];\r\n var a02 = a[2];\r\n var a03 = a[3];\r\n\r\n var a10 = a[4];\r\n var a11 = a[5];\r\n var a12 = a[6];\r\n var a13 = a[7];\r\n\r\n // Perform axis-specific matrix multiplication\r\n a[0] = a00 * c + a10 * s;\r\n a[1] = a01 * c + a11 * s;\r\n a[2] = a02 * c + a12 * s;\r\n a[3] = a03 * c + a13 * s;\r\n a[4] = a10 * c - a00 * s;\r\n a[5] = a11 * c - a01 * s;\r\n a[6] = a12 * c - a02 * s;\r\n a[7] = a13 * c - a03 * s;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given rotation Quaternion and translation Vector.\r\n *\r\n * @method Phaser.Math.Matrix4#fromRotationTranslation\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from.\r\n * @param {Phaser.Math.Vector3} v - The Vector to set translation from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromRotationTranslation: function (q, v)\r\n {\r\n // Quaternion math\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = v.x;\r\n out[13] = v.y;\r\n out[14] = v.z;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this Matrix from the given Quaternion.\r\n *\r\n * @method Phaser.Math.Matrix4#fromQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n fromQuat: function (q)\r\n {\r\n var out = this.val;\r\n\r\n var x = q.x;\r\n var y = q.y;\r\n var z = q.z;\r\n var w = q.w;\r\n\r\n var x2 = x + x;\r\n var y2 = y + y;\r\n var z2 = z + z;\r\n\r\n var xx = x * x2;\r\n var xy = x * y2;\r\n var xz = x * z2;\r\n\r\n var yy = y * y2;\r\n var yz = y * z2;\r\n var zz = z * z2;\r\n\r\n var wx = w * x2;\r\n var wy = w * y2;\r\n var wz = w * z2;\r\n\r\n out[0] = 1 - (yy + zz);\r\n out[1] = xy + wz;\r\n out[2] = xz - wy;\r\n out[3] = 0;\r\n\r\n out[4] = xy - wz;\r\n out[5] = 1 - (xx + zz);\r\n out[6] = yz + wx;\r\n out[7] = 0;\r\n\r\n out[8] = xz + wy;\r\n out[9] = yz - wx;\r\n out[10] = 1 - (xx + yy);\r\n out[11] = 0;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = 0;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a frustum matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#frustum\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n frustum: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n\r\n var rl = 1 / (right - left);\r\n var tb = 1 / (top - bottom);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = (near * 2) * rl;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (near * 2) * tb;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = (right + left) * rl;\r\n out[9] = (top + bottom) * tb;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (far * near * 2) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspective\r\n * @since 3.0.0\r\n *\r\n * @param {number} fovy - Vertical field of view in radians\r\n * @param {number} aspect - Aspect ratio. Typically viewport width /height.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspective: function (fovy, aspect, near, far)\r\n {\r\n var out = this.val;\r\n var f = 1.0 / Math.tan(fovy / 2);\r\n var nf = 1 / (near - far);\r\n\r\n out[0] = f / aspect;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = f;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = (far + near) * nf;\r\n out[11] = -1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (2 * far * near) * nf;\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a perspective projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#perspectiveLH\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width of the frustum.\r\n * @param {number} height - The height of the frustum.\r\n * @param {number} near - Near bound of the frustum.\r\n * @param {number} far - Far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n perspectiveLH: function (width, height, near, far)\r\n {\r\n var out = this.val;\r\n\r\n out[0] = (2 * near) / width;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = (2 * near) / height;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = -far / (near - far);\r\n out[11] = 1;\r\n\r\n out[12] = 0;\r\n out[13] = 0;\r\n out[14] = (near * far) / (near - far);\r\n out[15] = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate an orthogonal projection matrix with the given bounds.\r\n *\r\n * @method Phaser.Math.Matrix4#ortho\r\n * @since 3.0.0\r\n *\r\n * @param {number} left - The left bound of the frustum.\r\n * @param {number} right - The right bound of the frustum.\r\n * @param {number} bottom - The bottom bound of the frustum.\r\n * @param {number} top - The top bound of the frustum.\r\n * @param {number} near - The near bound of the frustum.\r\n * @param {number} far - The far bound of the frustum.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n ortho: function (left, right, bottom, top, near, far)\r\n {\r\n var out = this.val;\r\n var lr = left - right;\r\n var bt = bottom - top;\r\n var nf = near - far;\r\n\r\n // Avoid division by zero\r\n lr = (lr === 0) ? lr : 1 / lr;\r\n bt = (bt === 0) ? bt : 1 / bt;\r\n nf = (nf === 0) ? nf : 1 / nf;\r\n\r\n out[0] = -2 * lr;\r\n out[1] = 0;\r\n out[2] = 0;\r\n out[3] = 0;\r\n\r\n out[4] = 0;\r\n out[5] = -2 * bt;\r\n out[6] = 0;\r\n out[7] = 0;\r\n\r\n out[8] = 0;\r\n out[9] = 0;\r\n out[10] = 2 * nf;\r\n out[11] = 0;\r\n\r\n out[12] = (left + right) * lr;\r\n out[13] = (top + bottom) * bt;\r\n out[14] = (far + near) * nf;\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a look-at matrix with the given eye position, focal point, and up axis.\r\n *\r\n * @method Phaser.Math.Matrix4#lookAt\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} eye - Position of the viewer\r\n * @param {Phaser.Math.Vector3} center - Point the viewer is looking at\r\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n lookAt: function (eye, center, up)\r\n {\r\n var out = this.val;\r\n\r\n var eyex = eye.x;\r\n var eyey = eye.y;\r\n var eyez = eye.z;\r\n\r\n var upx = up.x;\r\n var upy = up.y;\r\n var upz = up.z;\r\n\r\n var centerx = center.x;\r\n var centery = center.y;\r\n var centerz = center.z;\r\n\r\n if (Math.abs(eyex - centerx) < EPSILON &&\r\n Math.abs(eyey - centery) < EPSILON &&\r\n Math.abs(eyez - centerz) < EPSILON)\r\n {\r\n return this.identity();\r\n }\r\n\r\n var z0 = eyex - centerx;\r\n var z1 = eyey - centery;\r\n var z2 = eyez - centerz;\r\n\r\n var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\r\n\r\n z0 *= len;\r\n z1 *= len;\r\n z2 *= len;\r\n\r\n var x0 = upy * z2 - upz * z1;\r\n var x1 = upz * z0 - upx * z2;\r\n var x2 = upx * z1 - upy * z0;\r\n\r\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\r\n\r\n if (!len)\r\n {\r\n x0 = 0;\r\n x1 = 0;\r\n x2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n x0 *= len;\r\n x1 *= len;\r\n x2 *= len;\r\n }\r\n\r\n var y0 = z1 * x2 - z2 * x1;\r\n var y1 = z2 * x0 - z0 * x2;\r\n var y2 = z0 * x1 - z1 * x0;\r\n\r\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\r\n\r\n if (!len)\r\n {\r\n y0 = 0;\r\n y1 = 0;\r\n y2 = 0;\r\n }\r\n else\r\n {\r\n len = 1 / len;\r\n y0 *= len;\r\n y1 *= len;\r\n y2 *= len;\r\n }\r\n\r\n out[0] = x0;\r\n out[1] = y0;\r\n out[2] = z0;\r\n out[3] = 0;\r\n\r\n out[4] = x1;\r\n out[5] = y1;\r\n out[6] = z1;\r\n out[7] = 0;\r\n\r\n out[8] = x2;\r\n out[9] = y2;\r\n out[10] = z2;\r\n out[11] = 0;\r\n\r\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\r\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\r\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\r\n out[15] = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values.\r\n *\r\n * @method Phaser.Math.Matrix4#yawPitchRoll\r\n * @since 3.0.0\r\n *\r\n * @param {number} yaw - The yaw value.\r\n * @param {number} pitch - The pitch value.\r\n * @param {number} roll - The roll value.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n yawPitchRoll: function (yaw, pitch, roll)\r\n {\r\n this.zero();\r\n _tempMat1.zero();\r\n _tempMat2.zero();\r\n\r\n var m0 = this.val;\r\n var m1 = _tempMat1.val;\r\n var m2 = _tempMat2.val;\r\n\r\n // Rotate Z\r\n var s = Math.sin(roll);\r\n var c = Math.cos(roll);\r\n\r\n m0[10] = 1;\r\n m0[15] = 1;\r\n m0[0] = c;\r\n m0[1] = s;\r\n m0[4] = -s;\r\n m0[5] = c;\r\n\r\n // Rotate X\r\n s = Math.sin(pitch);\r\n c = Math.cos(pitch);\r\n\r\n m1[0] = 1;\r\n m1[15] = 1;\r\n m1[5] = c;\r\n m1[10] = c;\r\n m1[9] = -s;\r\n m1[6] = s;\r\n\r\n // Rotate Y\r\n s = Math.sin(yaw);\r\n c = Math.cos(yaw);\r\n\r\n m2[5] = 1;\r\n m2[15] = 1;\r\n m2[0] = c;\r\n m2[2] = -s;\r\n m2[8] = s;\r\n m2[10] = c;\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.\r\n *\r\n * @method Phaser.Math.Matrix4#setWorldMatrix\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix.\r\n * @param {Phaser.Math.Vector3} position - The position of the world matrix.\r\n * @param {Phaser.Math.Vector3} scale - The scale of the world matrix.\r\n * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix.\r\n * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix.\r\n *\r\n * @return {Phaser.Math.Matrix4} This Matrix4.\r\n */\r\n setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix)\r\n {\r\n this.yawPitchRoll(rotation.y, rotation.x, rotation.z);\r\n\r\n _tempMat1.scaling(scale.x, scale.y, scale.z);\r\n _tempMat2.xyz(position.x, position.y, position.z);\r\n\r\n this.multiplyLocal(_tempMat1);\r\n this.multiplyLocal(_tempMat2);\r\n\r\n if (viewMatrix !== undefined)\r\n {\r\n this.multiplyLocal(viewMatrix);\r\n }\r\n\r\n if (projectionMatrix !== undefined)\r\n {\r\n this.multiplyLocal(projectionMatrix);\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nvar _tempMat1 = new Matrix4();\r\nvar _tempMat2 = new Matrix4();\r\n\r\nmodule.exports = Matrix4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Add an `amount` to a `value`, limiting the maximum result to `max`.\r\n *\r\n * @function Phaser.Math.MaxAdd\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to add to.\r\n * @param {number} amount - The amount to add.\r\n * @param {number} max - The maximum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MaxAdd = function (value, amount, max)\r\n{\r\n return Math.min(value + amount, max);\r\n};\r\n\r\nmodule.exports = MaxAdd;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Subtract an `amount` from `value`, limiting the minimum result to `min`.\r\n *\r\n * @function Phaser.Math.MinSub\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to subtract from.\r\n * @param {number} amount - The amount to subtract.\r\n * @param {number} min - The minimum value to return.\r\n *\r\n * @return {number} The resulting value.\r\n */\r\nvar MinSub = function (value, amount, min)\r\n{\r\n return Math.max(value - amount, min);\r\n};\r\n\r\nmodule.exports = MinSub;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Work out what percentage `value` is of the range between `min` and `max`.\r\n * If `max` isn't given then it will return the percentage of `value` to `min`.\r\n *\r\n * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again.\r\n *\r\n * @function Phaser.Math.Percent\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to determine the percentage of.\r\n * @param {number} min - The minimum value.\r\n * @param {number} [max] - The maximum value.\r\n * @param {number} [upperMax] - The mid-way point in the range that represents 100%.\r\n *\r\n * @return {number} A value between 0 and 1 representing the percentage.\r\n */\r\nvar Percent = function (value, min, max, upperMax)\r\n{\r\n if (max === undefined) { max = min + 1; }\r\n\r\n var percentage = (value - min) / (max - min);\r\n\r\n if (percentage > 1)\r\n {\r\n if (upperMax !== undefined)\r\n {\r\n percentage = ((upperMax - value)) / (upperMax - max);\r\n\r\n if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n }\r\n else\r\n {\r\n percentage = 1;\r\n }\r\n }\r\n else if (percentage < 0)\r\n {\r\n percentage = 0;\r\n }\r\n\r\n return percentage;\r\n};\r\n\r\nmodule.exports = Percent;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\nvar Vector3 = require('./Vector3');\r\nvar Matrix3 = require('./Matrix3');\r\n\r\nvar EPSILON = 0.000001;\r\n\r\n// Some shared 'private' arrays\r\nvar siNext = new Int8Array([ 1, 2, 0 ]);\r\nvar tmp = new Float32Array([ 0, 0, 0 ]);\r\n\r\nvar xUnitVec3 = new Vector3(1, 0, 0);\r\nvar yUnitVec3 = new Vector3(0, 1, 0);\r\n\r\nvar tmpvec = new Vector3();\r\nvar tmpMat3 = new Matrix3();\r\n\r\n/**\r\n * @classdesc\r\n * A quaternion.\r\n *\r\n * @class Quaternion\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Quaternion = new Class({\r\n\r\n initialize:\r\n\r\n function Quaternion (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The y component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The z component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n /**\r\n * The w component of this Quaternion.\r\n *\r\n * @name Phaser.Math.Quaternion#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Copy the components of a given Quaternion or Vector into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z;\r\n this.w = src.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the components of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components.\r\n * @param {number} [y=0] - The y component.\r\n * @param {number} [z=0] - The z component.\r\n * @param {number} [w=0] - The w component.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z;\r\n this.w += v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Quaternion#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z;\r\n this.w -= v.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Quaternion by the given value.\r\n *\r\n * @method Phaser.Math.Quaternion#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Quaternion squared.\r\n *\r\n * @method Phaser.Math.Quaternion#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Quaternion, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Quaternion and the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#dot\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion.\r\n *\r\n * @return {number} The dot product of this Quaternion and the given Quaternion or Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards.\r\n * @param {number} [t=0] - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotates this Quaternion based on the two given vectors.\r\n *\r\n * @method Phaser.Math.Quaternion#rotationTo\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - The transform rotation vector.\r\n * @param {Phaser.Math.Vector3} b - The target rotation vector.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotationTo: function (a, b)\r\n {\r\n var dot = a.x * b.x + a.y * b.y + a.z * b.z;\r\n\r\n if (dot < -0.999999)\r\n {\r\n if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON)\r\n {\r\n tmpvec.copy(yUnitVec3).cross(a);\r\n }\r\n\r\n tmpvec.normalize();\r\n\r\n return this.setAxisAngle(tmpvec, Math.PI);\r\n\r\n }\r\n else if (dot > 0.999999)\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n }\r\n else\r\n {\r\n tmpvec.copy(a).cross(b);\r\n\r\n this.x = tmpvec.x;\r\n this.y = tmpvec.y;\r\n this.z = tmpvec.z;\r\n this.w = 1 + dot;\r\n\r\n return this.normalize();\r\n }\r\n },\r\n\r\n /**\r\n * Set the axes of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxes\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} view - The view axis.\r\n * @param {Phaser.Math.Vector3} right - The right axis.\r\n * @param {Phaser.Math.Vector3} up - The upwards axis.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxes: function (view, right, up)\r\n {\r\n var m = tmpMat3.val;\r\n\r\n m[0] = right.x;\r\n m[3] = right.y;\r\n m[6] = right.z;\r\n\r\n m[1] = up.x;\r\n m[4] = up.y;\r\n m[7] = up.z;\r\n\r\n m[2] = -view.x;\r\n m[5] = -view.y;\r\n m[8] = -view.z;\r\n\r\n return this.fromMat3(tmpMat3).normalize();\r\n },\r\n\r\n /**\r\n * Reset this Matrix to an identity (default) Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#identity\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n identity: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the axis angle of this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#setAxisAngle\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} axis - The axis.\r\n * @param {number} rad - The angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n setAxisAngle: function (axis, rad)\r\n {\r\n rad = rad * 0.5;\r\n\r\n var s = Math.sin(rad);\r\n\r\n this.x = s * axis.x;\r\n this.y = s * axis.y;\r\n this.z = s * axis.z;\r\n this.w = Math.cos(rad);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiply this Quaternion by the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n multiply: function (b)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n this.x = ax * bw + aw * bx + ay * bz - az * by;\r\n this.y = ay * bw + aw * by + az * bx - ax * bz;\r\n this.z = az * bw + aw * bz + ax * by - ay * bx;\r\n this.w = aw * bw - ax * bx - ay * by - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector.\r\n *\r\n * @method Phaser.Math.Quaternion#slerp\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards.\r\n * @param {number} t - The percentage of interpolation.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n slerp: function (b, t)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-slerp-implementations\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n var bw = b.w;\r\n\r\n // calc cosine\r\n var cosom = ax * bx + ay * by + az * bz + aw * bw;\r\n\r\n // adjust signs (if necessary)\r\n if (cosom < 0)\r\n {\r\n cosom = -cosom;\r\n bx = - bx;\r\n by = - by;\r\n bz = - bz;\r\n bw = - bw;\r\n }\r\n\r\n // \"from\" and \"to\" quaternions are very close\r\n // ... so we can do a linear interpolation\r\n var scale0 = 1 - t;\r\n var scale1 = t;\r\n\r\n // calculate coefficients\r\n if ((1 - cosom) > EPSILON)\r\n {\r\n // standard case (slerp)\r\n var omega = Math.acos(cosom);\r\n var sinom = Math.sin(omega);\r\n\r\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\r\n scale1 = Math.sin(t * omega) / sinom;\r\n }\r\n\r\n // calculate final values\r\n this.x = scale0 * ax + scale1 * bx;\r\n this.y = scale0 * ay + scale1 * by;\r\n this.z = scale0 * az + scale1 * bz;\r\n this.w = scale0 * aw + scale1 * bw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Invert this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#invert\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n invert: function ()\r\n {\r\n var a0 = this.x;\r\n var a1 = this.y;\r\n var a2 = this.z;\r\n var a3 = this.w;\r\n\r\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\r\n var invDot = (dot) ? 1 / dot : 0;\r\n\r\n // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\r\n\r\n this.x = -a0 * invDot;\r\n this.y = -a1 * invDot;\r\n this.z = -a2 * invDot;\r\n this.w = a3 * invDot;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert this Quaternion into its conjugate.\r\n *\r\n * Sets the x, y and z components.\r\n *\r\n * @method Phaser.Math.Quaternion#conjugate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n conjugate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the X axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateX\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateX: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bx = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + aw * bx;\r\n this.y = ay * bw + az * bx;\r\n this.z = az * bw - ay * bx;\r\n this.w = aw * bw - ax * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Y axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateY\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateY: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var by = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw - az * by;\r\n this.y = ay * bw + aw * by;\r\n this.z = az * bw + ax * by;\r\n this.w = aw * bw - ay * by;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Quaternion on the Z axis.\r\n *\r\n * @method Phaser.Math.Quaternion#rotateZ\r\n * @since 3.0.0\r\n *\r\n * @param {number} rad - The rotation angle in radians.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n rotateZ: function (rad)\r\n {\r\n rad *= 0.5;\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n var bz = Math.sin(rad);\r\n var bw = Math.cos(rad);\r\n\r\n this.x = ax * bw + ay * bz;\r\n this.y = ay * bw - ax * bz;\r\n this.z = az * bw + aw * bz;\r\n this.w = aw * bw - az * bz;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Create a unit (or rotation) Quaternion from its x, y, and z components.\r\n *\r\n * Sets the w component.\r\n *\r\n * @method Phaser.Math.Quaternion#calculateW\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n calculateW: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n this.w = -Math.sqrt(1.0 - x * x - y * y - z * z);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Convert the given Matrix into this Quaternion.\r\n *\r\n * @method Phaser.Math.Quaternion#fromMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from.\r\n *\r\n * @return {Phaser.Math.Quaternion} This Quaternion.\r\n */\r\n fromMat3: function (mat)\r\n {\r\n // benchmarks:\r\n // http://jsperf.com/typed-array-access-speed\r\n // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion\r\n\r\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\r\n // article \"Quaternion Calculus and Fast Animation\".\r\n var m = mat.val;\r\n var fTrace = m[0] + m[4] + m[8];\r\n var fRoot;\r\n\r\n if (fTrace > 0)\r\n {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\r\n\r\n this.w = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot; // 1/(4w)\r\n\r\n this.x = (m[7] - m[5]) * fRoot;\r\n this.y = (m[2] - m[6]) * fRoot;\r\n this.z = (m[3] - m[1]) * fRoot;\r\n }\r\n else\r\n {\r\n // |w| <= 1/2\r\n var i = 0;\r\n\r\n if (m[4] > m[0])\r\n {\r\n i = 1;\r\n }\r\n\r\n if (m[8] > m[i * 3 + i])\r\n {\r\n i = 2;\r\n }\r\n\r\n var j = siNext[i];\r\n var k = siNext[j];\r\n\r\n // This isn't quite as clean without array access\r\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\r\n tmp[i] = 0.5 * fRoot;\r\n\r\n fRoot = 0.5 / fRoot;\r\n\r\n tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\r\n tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\r\n\r\n this.x = tmp[0];\r\n this.y = tmp[1];\r\n this.z = tmp[2];\r\n this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot;\r\n }\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = Quaternion;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\n\r\n/**\r\n * Convert the given angle in radians, to the equivalent angle in degrees.\r\n *\r\n * @function Phaser.Math.RadToDeg\r\n * @since 3.0.0\r\n *\r\n * @param {number} radians - The angle in radians to convert ot degrees.\r\n *\r\n * @return {integer} The given angle converted to degrees.\r\n */\r\nvar RadToDeg = function (radians)\r\n{\r\n return radians * CONST.RAD_TO_DEG;\r\n};\r\n\r\nmodule.exports = RadToDeg;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random unit vector.\r\n *\r\n * Computes random values for the given vector between -1 and 1 that can be used to represent a direction.\r\n *\r\n * Optionally accepts a scale value to scale the resulting vector by.\r\n *\r\n * @function Phaser.Math.RandomXY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector2} The given Vector.\r\n */\r\nvar RandomXY = function (vector, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n\r\n vector.x = Math.cos(r) * scale;\r\n vector.y = Math.sin(r) * scale;\r\n\r\n return vector;\r\n};\r\n\r\nmodule.exports = RandomXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random position vector in a spherical area, optionally defined by the given radius.\r\n *\r\n * @function Phaser.Math.RandomXYZ\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for.\r\n * @param {number} [radius=1] - The radius.\r\n *\r\n * @return {Phaser.Math.Vector3} The given Vector.\r\n */\r\nvar RandomXYZ = function (vec3, radius)\r\n{\r\n if (radius === undefined) { radius = 1; }\r\n\r\n var r = Math.random() * 2 * Math.PI;\r\n var z = (Math.random() * 2) - 1;\r\n var zScale = Math.sqrt(1 - z * z) * radius;\r\n\r\n vec3.x = Math.cos(r) * zScale;\r\n vec3.y = Math.sin(r) * zScale;\r\n vec3.z = z * radius;\r\n\r\n return vec3;\r\n};\r\n\r\nmodule.exports = RandomXYZ;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Compute a random four-dimensional vector.\r\n *\r\n * @function Phaser.Math.RandomXYZW\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for.\r\n * @param {number} [scale=1] - The scale of the random values.\r\n *\r\n * @return {Phaser.Math.Vector4} The given Vector.\r\n */\r\nvar RandomXYZW = function (vec4, scale)\r\n{\r\n if (scale === undefined) { scale = 1; }\r\n\r\n // TODO: Not spherical; should fix this for more uniform distribution\r\n vec4.x = (Math.random() * 2 - 1) * scale;\r\n vec4.y = (Math.random() * 2 - 1) * scale;\r\n vec4.z = (Math.random() * 2 - 1) * scale;\r\n vec4.w = (Math.random() * 2 - 1) * scale;\r\n\r\n return vec4;\r\n};\r\n\r\nmodule.exports = RandomXYZW;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction.\r\n *\r\n * @function Phaser.Math.Rotate\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} angle - The angle to be rotated by in an anticlockwise direction.\r\n *\r\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction.\r\n */\r\nvar Rotate = function (point, angle)\r\n{\r\n var x = point.x;\r\n var y = point.y;\r\n\r\n point.x = (x * Math.cos(angle)) - (y * Math.sin(angle));\r\n point.y = (x * Math.sin(angle)) + (y * Math.cos(angle));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = Rotate;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance.\r\n *\r\n * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y).\r\n *\r\n * @function Phaser.Math.RotateAround\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return]\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Types.Math.Vector2Like} The given point.\r\n */\r\nvar RotateAround = function (point, x, y, angle)\r\n{\r\n var c = Math.cos(angle);\r\n var s = Math.sin(angle);\r\n\r\n var tx = point.x - x;\r\n var ty = point.y - y;\r\n\r\n point.x = tx * c - ty * s + x;\r\n point.y = tx * s + ty * c + y;\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAround;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Rotate a `point` around `x` and `y` by the given `angle` and `distance`.\r\n *\r\n * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y).\r\n *\r\n * @function Phaser.Math.RotateAroundDistance\r\n * @since 3.0.0\r\n *\r\n * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return]\r\n *\r\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\r\n * @param {number} x - The horizontal coordinate to rotate around.\r\n * @param {number} y - The vertical coordinate to rotate around.\r\n * @param {number} angle - The angle of rotation in radians.\r\n * @param {number} distance - The distance from (x, y) to place the point at.\r\n *\r\n * @return {Phaser.Types.Math.Vector2Like} The given point.\r\n */\r\nvar RotateAroundDistance = function (point, x, y, angle, distance)\r\n{\r\n var t = angle + Math.atan2(point.y - y, point.x - x);\r\n\r\n point.x = x + (distance * Math.cos(t));\r\n point.y = y + (distance * Math.sin(t));\r\n\r\n return point;\r\n};\r\n\r\nmodule.exports = RotateAroundDistance;\r\n","/**\n * @author samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Position a `point` at the given `angle` and `distance` to (`x`, `y`).\n *\n * @function Phaser.Math.RotateTo\n * @since 3.24.0\n *\n * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return]\n *\n * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned.\n * @param {number} x - The horizontal coordinate to position from.\n * @param {number} y - The vertical coordinate to position from.\n * @param {number} angle - The angle of rotation in radians.\n * @param {number} distance - The distance from (x, y) to place the point at.\n *\n * @return {Phaser.Types.Math.Vector2Like} The given point.\n */\nvar RotateTo = function (point, x, y, angle, distance)\n{\n point.x = x + (distance * Math.cos(angle));\n point.y = y + (distance * Math.sin(angle));\n\n return point;\n};\n\nmodule.exports = RotateTo;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector3 = require('../math/Vector3');\r\nvar Matrix4 = require('../math/Matrix4');\r\nvar Quaternion = require('../math/Quaternion');\r\n\r\nvar tmpMat4 = new Matrix4();\r\nvar tmpQuat = new Quaternion();\r\nvar tmpVec3 = new Vector3();\r\n\r\n/**\r\n * Rotates a vector in place by axis angle.\r\n *\r\n * This is the same as transforming a point by an\r\n * axis-angle quaternion, but it has higher precision.\r\n *\r\n * @function Phaser.Math.RotateVec3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} vec - The vector to be rotated.\r\n * @param {Phaser.Math.Vector3} axis - The axis to rotate around.\r\n * @param {number} radians - The angle of rotation in radians.\r\n *\r\n * @return {Phaser.Math.Vector3} The given vector.\r\n */\r\nvar RotateVec3 = function (vec, axis, radians)\r\n{\r\n // Set the quaternion to our axis angle\r\n tmpQuat.setAxisAngle(axis, radians);\r\n\r\n // Create a rotation matrix from the axis angle\r\n tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0));\r\n\r\n // Multiply our vector by the rotation matrix\r\n return vec.transformMat4(tmpMat4);\r\n};\r\n\r\nmodule.exports = RotateVec3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down.\r\n *\r\n * @function Phaser.Math.RoundAwayFromZero\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The number to round.\r\n *\r\n * @return {number} The rounded number, rounded away from zero.\r\n */\r\nvar RoundAwayFromZero = function (value)\r\n{\r\n // \"Opposite\" of truncate.\r\n return (value > 0) ? Math.ceil(value) : Math.floor(value);\r\n};\r\n\r\nmodule.exports = RoundAwayFromZero;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Round a value to the given precision.\r\n * \r\n * For example:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456, 0) = 123\r\n * RoundTo(123.456, 1) = 120\r\n * RoundTo(123.456, 2) = 100\r\n * ```\r\n * \r\n * To round the decimal, i.e. to round to precision, pass in a negative `place`:\r\n * \r\n * ```javascript\r\n * RoundTo(123.456789, 0) = 123\r\n * RoundTo(123.456789, -1) = 123.5\r\n * RoundTo(123.456789, -2) = 123.46\r\n * RoundTo(123.456789, -3) = 123.457\r\n * ```\r\n *\r\n * @function Phaser.Math.RoundTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to round.\r\n * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal.\r\n * @param {integer} [base=10] - The base to round in. Default is 10 for decimal.\r\n *\r\n * @return {number} The rounded value.\r\n */\r\nvar RoundTo = function (value, place, base)\r\n{\r\n if (place === undefined) { place = 0; }\r\n if (base === undefined) { base = 10; }\r\n\r\n var p = Math.pow(base, -place);\r\n\r\n return Math.round(value * p) / p;\r\n};\r\n\r\nmodule.exports = RoundTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Generate a series of sine and cosine values.\r\n *\r\n * @function Phaser.Math.SinCosTableGenerator\r\n * @since 3.0.0\r\n *\r\n * @param {number} length - The number of values to generate.\r\n * @param {number} [sinAmp=1] - The sine value amplitude.\r\n * @param {number} [cosAmp=1] - The cosine value amplitude.\r\n * @param {number} [frequency=1] - The frequency of the values.\r\n *\r\n * @return {Phaser.Types.Math.SinCosTable} The generated values.\r\n */\r\nvar SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency)\r\n{\r\n if (sinAmp === undefined) { sinAmp = 1; }\r\n if (cosAmp === undefined) { cosAmp = 1; }\r\n if (frequency === undefined) { frequency = 1; }\r\n\r\n frequency *= Math.PI / length;\r\n\r\n var cos = [];\r\n var sin = [];\r\n\r\n for (var c = 0; c < length; c++)\r\n {\r\n cosAmp -= sinAmp * frequency;\r\n sinAmp += cosAmp * frequency;\r\n\r\n cos[c] = cosAmp;\r\n sin[c] = sinAmp;\r\n }\r\n\r\n return {\r\n sin: sin,\r\n cos: cos,\r\n length: length\r\n };\r\n};\r\n\r\nmodule.exports = SinCosTableGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smooth interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * @function Phaser.Math.SmoothStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmoothStep = function (x, min, max)\r\n{\r\n if (x <= min)\r\n {\r\n return 0;\r\n }\r\n\r\n if (x >= max)\r\n {\r\n return 1;\r\n }\r\n\r\n x = (x - min) / (max - min);\r\n\r\n return x * x * (3 - 2 * x);\r\n};\r\n\r\nmodule.exports = SmoothStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate a smoother interpolation percentage of `x` between `min` and `max`.\r\n *\r\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\r\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\r\n * between 0 and 1 otherwise.\r\n *\r\n * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}.\r\n *\r\n * @function Phaser.Math.SmootherStep\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} x - The input value.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The percentage of interpolation, between 0 and 1.\r\n */\r\nvar SmootherStep = function (x, min, max)\r\n{\r\n x = Math.max(0, Math.min(1, (x - min) / (max - min)));\r\n\r\n return x * x * x * (x * (x * 6 - 15) + 10);\r\n};\r\n\r\nmodule.exports = SmootherStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid.\r\n * \r\n * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2.\r\n * \r\n * If the given index is out of range an empty Vector2 is returned.\r\n *\r\n * @function Phaser.Math.ToXY\r\n * @since 3.19.0\r\n *\r\n * @param {integer} index - The position within the grid to get the x/y value for.\r\n * @param {integer} width - The width of the grid.\r\n * @param {integer} height - The height of the grid.\r\n * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created.\r\n *\r\n * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index.\r\n */\r\nvar ToXY = function (index, width, height, out)\r\n{\r\n if (out === undefined) { out = new Vector2(); }\r\n\r\n var x = 0;\r\n var y = 0;\r\n var total = width * height;\r\n\r\n if (index > 0 && index <= total)\r\n {\r\n if (index > width - 1)\r\n {\r\n y = Math.floor(index / width);\r\n x = index - (y * width);\r\n }\r\n else\r\n {\r\n x = index;\r\n }\r\n\r\n out.set(x, y);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = ToXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Vector2 = require('./Vector2');\r\n\r\n/**\r\n * Takes the `x` and `y` coordinates and transforms them into the same space as\r\n * defined by the position, rotation and scale values.\r\n *\r\n * @function Phaser.Math.TransformXY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x coordinate to be transformed.\r\n * @param {number} y - The y coordinate to be transformed.\r\n * @param {number} positionX - Horizontal position of the transform point.\r\n * @param {number} positionY - Vertical position of the transform point.\r\n * @param {number} rotation - Rotation of the transform point, in radians.\r\n * @param {number} scaleX - Horizontal scale of the transform point.\r\n * @param {number} scaleY - Vertical scale of the transform point.\r\n * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates.\r\n *\r\n * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point.\r\n */\r\nvar TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output)\r\n{\r\n if (output === undefined) { output = new Vector2(); }\r\n\r\n var radianSin = Math.sin(rotation);\r\n var radianCos = Math.cos(rotation);\r\n\r\n // Rotate and Scale\r\n var a = radianCos * scaleX;\r\n var b = radianSin * scaleX;\r\n var c = -radianSin * scaleY;\r\n var d = radianCos * scaleY;\r\n\r\n // Invert\r\n var id = 1 / ((a * d) + (c * -b));\r\n\r\n output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id);\r\n output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id);\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = TransformXY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\nvar FuzzyEqual = require('../math/fuzzy/Equal');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 2D space.\r\n *\r\n * A two-component vector.\r\n *\r\n * @class Vector2\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties.\r\n * @param {number} [y] - The y component.\r\n */\r\nvar Vector2 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector2 (x, y)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector2#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n }\r\n else\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector2.\r\n *\r\n * @method Phaser.Math.Vector2#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} A clone of this Vector2.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector2(this.x, this.y);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x || 0;\r\n this.y = src.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the component values of this Vector from a given Vector2Like object.\r\n *\r\n * @method Phaser.Math.Vector2#setFromObject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setFromObject: function (obj)\r\n {\r\n this.x = obj.x || 0;\r\n this.y = obj.y || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x` and `y` components of the this Vector to the given `x` and `y` values.\r\n *\r\n * @method Phaser.Math.Vector2#set\r\n * @since 3.0.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n set: function (x, y)\r\n {\r\n if (y === undefined) { y = x; }\r\n\r\n this.x = x;\r\n this.y = y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * This method is an alias for `Vector2.set`.\r\n *\r\n * @method Phaser.Math.Vector2#setTo\r\n * @since 3.4.0\r\n *\r\n * @param {number} x - The x value to set for this Vector.\r\n * @param {number} [y=x] - The y value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setTo: function (x, y)\r\n {\r\n return this.set(x, y);\r\n },\r\n\r\n /**\r\n * Sets the `x` and `y` values of this object from a given polar coordinate.\r\n *\r\n * @method Phaser.Math.Vector2#setToPolar\r\n * @since 3.0.0\r\n *\r\n * @param {number} azimuth - The angular coordinate, in radians.\r\n * @param {number} [radius=1] - The radial coordinate (length).\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setToPolar: function (azimuth, radius)\r\n {\r\n if (radius == null) { radius = 1; }\r\n\r\n this.x = Math.cos(azimuth) * radius;\r\n this.y = Math.sin(azimuth) * radius;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector2#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\r\n *\r\n * @return {boolean} Whether the given Vector is equal to this Vector.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y));\r\n },\r\n\r\n /**\r\n * Check whether this Vector is approximately equal to a given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#fuzzyEquals\r\n * @since 3.23.0\r\n *\r\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\r\n * @param {number} [epsilon=0.0001] - The tolerance value.\r\n *\r\n * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`.\r\n */\r\n fuzzyEquals: function (v, epsilon)\r\n {\r\n return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon));\r\n },\r\n\r\n /**\r\n * Calculate the angle between this Vector and the positive x-axis, in radians.\r\n *\r\n * @method Phaser.Math.Vector2#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} The angle between this Vector, and the positive x-axis, given in radians.\r\n */\r\n angle: function ()\r\n {\r\n // computes the angle in radians with respect to the positive x-axis\r\n\r\n var angle = Math.atan2(this.y, this.x);\r\n\r\n if (angle < 0)\r\n {\r\n angle += 2 * Math.PI;\r\n }\r\n\r\n return angle;\r\n },\r\n\r\n /**\r\n * Set the angle of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#setAngle\r\n * @since 3.23.0\r\n *\r\n * @param {number} angle - The angle, in radians.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setAngle: function (angle)\r\n {\r\n return this.setToPolar(angle, this.length());\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#add\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n add: function (src)\r\n {\r\n this.x += src.x;\r\n this.y += src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector2#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n subtract: function (src)\r\n {\r\n this.x -= src.x;\r\n this.y -= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n multiply: function (src)\r\n {\r\n this.x *= src.x;\r\n this.y *= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector2#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n scale: function (value)\r\n {\r\n if (isFinite(value))\r\n {\r\n this.x *= value;\r\n this.y *= value;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#divide\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n divide: function (src)\r\n {\r\n this.x /= src.x;\r\n this.y /= src.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x` and `y` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#distance\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector2#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (src)\r\n {\r\n var dx = src.x - this.x;\r\n var dy = src.y - this.y;\r\n\r\n return dx * dx + dy * dy;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return Math.sqrt(x * x + y * y);\r\n },\r\n\r\n /**\r\n * Set the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#setLength\r\n * @since 3.23.0\r\n *\r\n * @param {number} length\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n setLength: function (length)\r\n {\r\n return this.normalize().scale(length);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector2#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n\r\n return x * x + y * y;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var len = x * x + y * y;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Vector to its perpendicular, in the positive direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalizeRightHand\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalizeRightHand: function ()\r\n {\r\n var x = this.x;\r\n\r\n this.x = this.y * -1;\r\n this.y = x;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Rotate this Vector to its perpendicular, in the negative direction.\r\n *\r\n * @method Phaser.Math.Vector2#normalizeLeftHand\r\n * @since 3.23.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n normalizeLeftHand: function ()\r\n {\r\n var x = this.x;\r\n\r\n this.x = this.y;\r\n this.y = x * -1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (src)\r\n {\r\n return this.x * src.x + this.y * src.y;\r\n },\r\n\r\n /**\r\n * Calculate the cross product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2.\r\n *\r\n * @return {number} The cross product of this Vector and the given Vector.\r\n */\r\n cross: function (src)\r\n {\r\n return this.x * src.y - this.y * src.x;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector2#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n lerp: function (src, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n\r\n this.x = ax + t * (src.x - ax);\r\n this.y = ay + t * (src.y - ay);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[3] * y + m[6];\r\n this.y = m[1] * x + m[4] * y + m[7];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector2#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[12];\r\n this.y = m[1] * x + m[5] * y + m[13];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0).\r\n *\r\n * @method Phaser.Math.Vector2#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Limit the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector2#limit\r\n * @since 3.23.0\r\n *\r\n * @param {number} max - The maximum length.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n limit: function (max)\r\n {\r\n var len = this.length();\r\n\r\n if (len && len > max)\r\n {\r\n this.scale(max / len);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Reflect this Vector off a line defined by a normal.\r\n *\r\n * @method Phaser.Math.Vector2#reflect\r\n * @since 3.23.0\r\n *\r\n * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n reflect: function (normal)\r\n {\r\n normal = normal.clone().normalize();\r\n\r\n return this.subtract(normal.scale(2 * this.dot(normal)));\r\n },\r\n\r\n /**\r\n * Reflect this Vector across another.\r\n *\r\n * @method Phaser.Math.Vector2#mirror\r\n * @since 3.23.0\r\n *\r\n * @param {Phaser.Math.Vector2} axis - A vector to reflect across.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n mirror: function (axis)\r\n {\r\n return this.reflect(axis).negate();\r\n },\r\n\r\n /**\r\n * Rotate this Vector by an angle amount.\r\n *\r\n * @method Phaser.Math.Vector2#rotate\r\n * @since 3.23.0\r\n *\r\n * @param {number} delta - The angle to rotate by, in radians.\r\n *\r\n * @return {Phaser.Math.Vector2} This Vector2.\r\n */\r\n rotate: function (delta)\r\n {\r\n var cos = Math.cos(delta);\r\n var sin = Math.sin(delta);\r\n\r\n return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y);\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector2 for use by reference.\r\n *\r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ZERO\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.1.0\r\n */\r\nVector2.ZERO = new Vector2();\r\n\r\n/**\r\n * A static right Vector2 for use by reference.\r\n *\r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.RIGHT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.RIGHT = new Vector2(1, 0);\r\n\r\n/**\r\n * A static left Vector2 for use by reference.\r\n *\r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.LEFT\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.LEFT = new Vector2(-1, 0);\r\n\r\n/**\r\n * A static up Vector2 for use by reference.\r\n *\r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.UP\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.UP = new Vector2(0, -1);\r\n\r\n/**\r\n * A static down Vector2 for use by reference.\r\n *\r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.DOWN\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.DOWN = new Vector2(0, 1);\r\n\r\n/**\r\n * A static one Vector2 for use by reference.\r\n *\r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector2.ONE\r\n * @type {Phaser.Math.Vector2}\r\n * @since 3.16.0\r\n */\r\nVector2.ONE = new Vector2(1, 1);\r\n\r\nmodule.exports = Vector2;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 3D space.\r\n *\r\n * A three-component vector.\r\n *\r\n * @class Vector3\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n */\r\nvar Vector3 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector3 (x, y, z)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector3#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Set this Vector to point up.\r\n *\r\n * Sets the y component of the vector to 1, and the others to 0.\r\n *\r\n * @method Phaser.Math.Vector3#up\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n up: function ()\r\n {\r\n this.x = 0;\r\n this.y = 1;\r\n this.z = 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector3.\r\n *\r\n * @method Phaser.Math.Vector3#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector3(this.x, this.y, this.z);\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of two given Vectors.\r\n *\r\n * @method Phaser.Math.Vector3#crossVectors\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} a - The first Vector to multiply.\r\n * @param {Phaser.Math.Vector3} b - The second Vector to multiply.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n crossVectors: function (a, b)\r\n {\r\n var ax = a.x;\r\n var ay = a.y;\r\n var az = a.z;\r\n var bx = b.x;\r\n var by = b.y;\r\n var bz = b.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict equality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector3#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to compare against.\r\n *\r\n * @return {boolean} True if the two vectors strictly match, otherwise false.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z));\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#copy\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values.\r\n *\r\n * @method Phaser.Math.Vector3#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components.\r\n * @param {number} [y] - The y value to set for this Vector.\r\n * @param {number} [z] - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n set: function (x, y, z)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector3#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector3#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n scale: function (scale)\r\n {\r\n if (isFinite(scale))\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n }\r\n else\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y` and `z` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector3#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector3#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return Math.sqrt(x * x + y * y + z * z);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector3#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n\r\n return x * x + y * y + z * z;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector3#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var len = x * x + y * y + z * z;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3.\r\n *\r\n * @return {number} The dot product of this Vector and `v`.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z;\r\n },\r\n\r\n /**\r\n * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#cross\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector to cross product with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n cross: function (v)\r\n {\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var bx = v.x;\r\n var by = v.y;\r\n var bz = v.z;\r\n\r\n this.x = ay * bz - az * by;\r\n this.y = az * bx - ax * bz;\r\n this.z = ax * by - ay * bx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector3#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat3\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat3: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = x * m[0] + y * m[3] + z * m[6];\r\n this.y = x * m[1] + y * m[4] + z * m[7];\r\n this.z = x * m[2] + y * m[5] + z * m[8];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector3#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12];\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13];\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14];\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transforms the coordinates of this Vector3 with the given Matrix4.\r\n *\r\n * @method Phaser.Math.Vector3#transformCoordinates\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformCoordinates: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12];\r\n var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13];\r\n var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14];\r\n var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15];\r\n\r\n this.x = tx / tw;\r\n this.y = ty / tw;\r\n this.z = tz / tw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector3#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection,\r\n * e.g. unprojecting a 2D point into 3D space.\r\n *\r\n * @method Phaser.Math.Vector3#project\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n project: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var m = mat.val;\r\n\r\n var a00 = m[0];\r\n var a01 = m[1];\r\n var a02 = m[2];\r\n var a03 = m[3];\r\n var a10 = m[4];\r\n var a11 = m[5];\r\n var a12 = m[6];\r\n var a13 = m[7];\r\n var a20 = m[8];\r\n var a21 = m[9];\r\n var a22 = m[10];\r\n var a23 = m[11];\r\n var a30 = m[12];\r\n var a31 = m[13];\r\n var a32 = m[14];\r\n var a33 = m[15];\r\n\r\n var lw = 1 / (x * a03 + y * a13 + z * a23 + a33);\r\n\r\n this.x = (x * a00 + y * a10 + z * a20 + a30) * lw;\r\n this.y = (x * a01 + y * a11 + z * a21 + a31) * lw;\r\n this.z = (x * a02 + y * a12 + z * a22 + a32) * lw;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Unproject this point from 2D space to 3D space.\r\n * The point should have its x and y properties set to\r\n * 2D screen space, and the z either at 0 (near plane)\r\n * or 1 (far plane). The provided matrix is assumed to already\r\n * be combined, i.e. projection * view * model.\r\n *\r\n * After this operation, this vector's (x, y, z) components will\r\n * represent the unprojected 3D coordinate.\r\n *\r\n * @method Phaser.Math.Vector3#unproject\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels.\r\n * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix.\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n unproject: function (viewport, invProjectionView)\r\n {\r\n var viewX = viewport.x;\r\n var viewY = viewport.y;\r\n var viewWidth = viewport.z;\r\n var viewHeight = viewport.w;\r\n\r\n var x = this.x - viewX;\r\n var y = (viewHeight - this.y - 1) - viewY;\r\n var z = this.z;\r\n\r\n this.x = (2 * x) / viewWidth - 1;\r\n this.y = (2 * y) / viewHeight - 1;\r\n this.z = 2 * z - 1;\r\n\r\n return this.project(invProjectionView);\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector3#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector3} This Vector3.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n/**\r\n * A static zero Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ZERO\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ZERO = new Vector3();\r\n\r\n/**\r\n * A static right Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.RIGHT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.RIGHT = new Vector3(1, 0, 0);\r\n\r\n/**\r\n * A static left Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.LEFT\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.LEFT = new Vector3(-1, 0, 0);\r\n\r\n/**\r\n * A static up Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.UP\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.UP = new Vector3(0, -1, 0);\r\n\r\n/**\r\n * A static down Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.DOWN\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.DOWN = new Vector3(0, 1, 0);\r\n\r\n/**\r\n * A static forward Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.FORWARD\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.FORWARD = new Vector3(0, 0, 1);\r\n\r\n/**\r\n * A static back Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.BACK\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.BACK = new Vector3(0, 0, -1);\r\n\r\n/**\r\n * A static one Vector3 for use by reference.\r\n * \r\n * This constant is meant for comparison operations and should not be modified directly.\r\n *\r\n * @constant\r\n * @name Phaser.Math.Vector3.ONE\r\n * @type {Phaser.Math.Vector3}\r\n * @since 3.16.0\r\n */\r\nVector3.ONE = new Vector3(1, 1, 1);\r\n\r\nmodule.exports = Vector3;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\r\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A representation of a vector in 4D space.\r\n *\r\n * A four-component vector.\r\n *\r\n * @class Vector4\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {number} [x] - The x component.\r\n * @param {number} [y] - The y component.\r\n * @param {number} [z] - The z component.\r\n * @param {number} [w] - The w component.\r\n */\r\nvar Vector4 = new Class({\r\n\r\n initialize:\r\n\r\n function Vector4 (x, y, z, w)\r\n {\r\n /**\r\n * The x component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#x\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.x = 0;\r\n\r\n /**\r\n * The y component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#y\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.y = 0;\r\n\r\n /**\r\n * The z component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#z\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.z = 0;\r\n\r\n /**\r\n * The w component of this Vector.\r\n *\r\n * @name Phaser.Math.Vector4#w\r\n * @type {number}\r\n * @default 0\r\n * @since 3.0.0\r\n */\r\n this.w = 0;\r\n\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n },\r\n\r\n /**\r\n * Make a clone of this Vector4.\r\n *\r\n * @method Phaser.Math.Vector4#clone\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} A clone of this Vector4.\r\n */\r\n clone: function ()\r\n {\r\n return new Vector4(this.x, this.y, this.z, this.w);\r\n },\r\n\r\n /**\r\n * Copy the components of a given Vector into this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#copy\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} src - The Vector to copy the components from.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n copy: function (src)\r\n {\r\n this.x = src.x;\r\n this.y = src.y;\r\n this.z = src.z || 0;\r\n this.w = src.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Check whether this Vector is equal to a given Vector.\r\n *\r\n * Performs a strict quality check against each Vector's components.\r\n *\r\n * @method Phaser.Math.Vector4#equals\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The vector to check equality with.\r\n *\r\n * @return {boolean} A boolean indicating whether the two Vectors are equal or not.\r\n */\r\n equals: function (v)\r\n {\r\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w));\r\n },\r\n\r\n /**\r\n * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values.\r\n *\r\n * @method Phaser.Math.Vector4#set\r\n * @since 3.0.0\r\n *\r\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components.\r\n * @param {number} y - The y value to set for this Vector.\r\n * @param {number} z - The z value to set for this Vector.\r\n * @param {number} w - The z value to set for this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n set: function (x, y, z, w)\r\n {\r\n if (typeof x === 'object')\r\n {\r\n this.x = x.x || 0;\r\n this.y = x.y || 0;\r\n this.z = x.z || 0;\r\n this.w = x.w || 0;\r\n }\r\n else\r\n {\r\n this.x = x || 0;\r\n this.y = y || 0;\r\n this.z = z || 0;\r\n this.w = w || 0;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Add a given Vector to this Vector. Addition is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#add\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n add: function (v)\r\n {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z || 0;\r\n this.w += v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\r\n *\r\n * @method Phaser.Math.Vector4#subtract\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n subtract: function (v)\r\n {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z || 0;\r\n this.w -= v.w || 0;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Scale this Vector by the given value.\r\n *\r\n * @method Phaser.Math.Vector4#scale\r\n * @since 3.0.0\r\n *\r\n * @param {number} scale - The value to scale this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n scale: function (scale)\r\n {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the length (or magnitude) of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#length\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector.\r\n */\r\n length: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n },\r\n\r\n /**\r\n * Calculate the length of this Vector squared.\r\n *\r\n * @method Phaser.Math.Vector4#lengthSq\r\n * @since 3.0.0\r\n *\r\n * @return {number} The length of this Vector, squared.\r\n */\r\n lengthSq: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n },\r\n\r\n /**\r\n * Normalize this Vector.\r\n *\r\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\r\n *\r\n * @method Phaser.Math.Vector4#normalize\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n normalize: function ()\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var len = x * x + y * y + z * z + w * w;\r\n\r\n if (len > 0)\r\n {\r\n len = 1 / Math.sqrt(len);\r\n\r\n this.x = x * len;\r\n this.y = y * len;\r\n this.z = z * len;\r\n this.w = w * len;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the dot product of this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#dot\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4.\r\n *\r\n * @return {number} The dot product of this Vector and the given Vector.\r\n */\r\n dot: function (v)\r\n {\r\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\r\n },\r\n\r\n /**\r\n * Linearly interpolate between this Vector and the given Vector.\r\n *\r\n * Interpolates this Vector towards the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#lerp\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards.\r\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n lerp: function (v, t)\r\n {\r\n if (t === undefined) { t = 0; }\r\n\r\n var ax = this.x;\r\n var ay = this.y;\r\n var az = this.z;\r\n var aw = this.w;\r\n\r\n this.x = ax + t * (v.x - ax);\r\n this.y = ay + t * (v.y - ay);\r\n this.z = az + t * (v.z - az);\r\n this.w = aw + t * (v.w - aw);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise multiplication between this Vector and the given Vector.\r\n *\r\n * Multiplies this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#multiply\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n multiply: function (v)\r\n {\r\n this.x *= v.x;\r\n this.y *= v.y;\r\n this.z *= v.z || 1;\r\n this.w *= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Perform a component-wise division between this Vector and the given Vector.\r\n *\r\n * Divides this Vector by the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#divide\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n divide: function (v)\r\n {\r\n this.x /= v.x;\r\n this.y /= v.y;\r\n this.z /= v.z || 1;\r\n this.w /= v.w || 1;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector.\r\n *\r\n * @method Phaser.Math.Vector4#distance\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector.\r\n */\r\n distance: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\r\n },\r\n\r\n /**\r\n * Calculate the distance between this Vector and the given Vector, squared.\r\n *\r\n * @method Phaser.Math.Vector4#distanceSq\r\n * @since 3.0.0\r\n *\r\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\r\n *\r\n * @return {number} The distance from this Vector to the given Vector, squared.\r\n */\r\n distanceSq: function (v)\r\n {\r\n var dx = v.x - this.x;\r\n var dy = v.y - this.y;\r\n var dz = v.z - this.z || 0;\r\n var dw = v.w - this.w || 0;\r\n\r\n return dx * dx + dy * dy + dz * dz + dw * dw;\r\n },\r\n\r\n /**\r\n * Negate the `x`, `y`, `z` and `w` components of this Vector.\r\n *\r\n * @method Phaser.Math.Vector4#negate\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n negate: function ()\r\n {\r\n this.x = -this.x;\r\n this.y = -this.y;\r\n this.z = -this.z;\r\n this.w = -this.w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Matrix.\r\n *\r\n * @method Phaser.Math.Vector4#transformMat4\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformMat4: function (mat)\r\n {\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var w = this.w;\r\n var m = mat.val;\r\n\r\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\r\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\r\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\r\n this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Transform this Vector with the given Quaternion.\r\n *\r\n * @method Phaser.Math.Vector4#transformQuat\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n transformQuat: function (q)\r\n {\r\n // TODO: is this really the same as Vector3?\r\n // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/\r\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\r\n var x = this.x;\r\n var y = this.y;\r\n var z = this.z;\r\n var qx = q.x;\r\n var qy = q.y;\r\n var qz = q.z;\r\n var qw = q.w;\r\n\r\n // calculate quat * vec\r\n var ix = qw * x + qy * z - qz * y;\r\n var iy = qw * y + qz * x - qx * z;\r\n var iz = qw * z + qx * y - qy * x;\r\n var iw = -qx * x - qy * y - qz * z;\r\n\r\n // calculate result * inverse quat\r\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\r\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\r\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Make this Vector the zero vector (0, 0, 0, 0).\r\n *\r\n * @method Phaser.Math.Vector4#reset\r\n * @since 3.0.0\r\n *\r\n * @return {Phaser.Math.Vector4} This Vector4.\r\n */\r\n reset: function ()\r\n {\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.w = 0;\r\n\r\n return this;\r\n }\r\n\r\n});\r\n\r\n// TODO: Check if these are required internally, if not, remove.\r\nVector4.prototype.sub = Vector4.prototype.subtract;\r\nVector4.prototype.mul = Vector4.prototype.multiply;\r\nVector4.prototype.div = Vector4.prototype.divide;\r\nVector4.prototype.dist = Vector4.prototype.distance;\r\nVector4.prototype.distSq = Vector4.prototype.distanceSq;\r\nVector4.prototype.len = Vector4.prototype.length;\r\nVector4.prototype.lenSq = Vector4.prototype.lengthSq;\r\n\r\nmodule.exports = Vector4;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the two values are within the given `tolerance` of each other.\r\n *\r\n * @function Phaser.Math.Within\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value to use in the calculation.\r\n * @param {number} b - The second value to use in the calculation.\r\n * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range.\r\n *\r\n * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`.\r\n */\r\nvar Within = function (a, b, tolerance)\r\n{\r\n return (Math.abs(a - b) <= tolerance);\r\n};\r\n\r\nmodule.exports = Within;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Wrap the given `value` between `min` and `max.\r\n *\r\n * @function Phaser.Math.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to wrap.\r\n * @param {number} min - The minimum value.\r\n * @param {number} max - The maximum value.\r\n *\r\n * @return {number} The wrapped value.\r\n */\r\nvar Wrap = function (value, min, max)\r\n{\r\n var range = max - min;\r\n\r\n return (min + ((((value - min) % range) + range) % range));\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * @function Phaser.Math.Angle.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar Between = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(y2 - y1, x2 - x1);\r\n};\r\n\r\nmodule.exports = Between;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * Calculates the angle of the vector from the first point to the second point.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPoints\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} point1 - The first point.\r\n * @param {Phaser.Types.Math.Vector2Like} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPoints = function (point1, point2)\r\n{\r\n return Math.atan2(point2.y - point1.y, point2.x - point1.x);\r\n};\r\n\r\nmodule.exports = BetweenPoints;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenPointsY\r\n * @since 3.0.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} point1 - The first point.\r\n * @param {Phaser.Types.Math.Vector2Like} point2 - The second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenPointsY = function (point1, point2)\r\n{\r\n return Math.atan2(point2.x - point1.x, point2.y - point1.y);\r\n};\r\n\r\nmodule.exports = BetweenPointsY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\r\n *\r\n * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate\r\n * travels down the screen.\r\n *\r\n * @function Phaser.Math.Angle.BetweenY\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The angle in radians.\r\n */\r\nvar BetweenY = function (x1, y1, x2, y2)\r\n{\r\n return Math.atan2(x2 - x1, y2 - y1);\r\n};\r\n\r\nmodule.exports = BetweenY;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('../const');\r\n\r\n/**\r\n * Takes an angle in Phasers default clockwise format and converts it so that\r\n * 0 is North, 90 is West, 180 is South and 270 is East,\r\n * therefore running counter-clockwise instead of clockwise.\r\n * \r\n * You can pass in the angle from a Game Object using:\r\n * \r\n * ```javascript\r\n * var converted = CounterClockwise(gameobject.rotation);\r\n * ```\r\n * \r\n * All values for this function are in radians.\r\n *\r\n * @function Phaser.Math.Angle.CounterClockwise\r\n * @since 3.16.0\r\n *\r\n * @param {number} angle - The angle to convert, in radians.\r\n *\r\n * @return {number} The converted angle, in radians.\r\n */\r\nvar CounterClockwise = function (angle)\r\n{\r\n if (angle > Math.PI)\r\n {\r\n angle -= CONST.PI2;\r\n }\r\n\r\n return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2);\r\n};\r\n\r\nmodule.exports = CounterClockwise;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Normalize an angle to the [0, 2pi] range.\r\n *\r\n * @function Phaser.Math.Angle.Normalize\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to normalize, in radians.\r\n *\r\n * @return {number} The normalized angle, in radians.\r\n */\r\nvar Normalize = function (angle)\r\n{\r\n angle = angle % (2 * Math.PI);\r\n\r\n if (angle >= 0)\r\n {\r\n return angle;\r\n }\r\n else\r\n {\r\n return angle + 2 * Math.PI;\r\n }\r\n};\r\n\r\nmodule.exports = Normalize;\r\n","/**\r\n * @author Richard Davey \r\n * @author @samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FloatBetween = require('../FloatBetween');\r\n\r\n/**\r\n * Returns a random angle in the range [-pi, pi].\r\n *\r\n * @function Phaser.Math.Angle.Random\r\n * @since 3.23.0\r\n *\r\n * @return {number} The angle, in radians.\r\n */\r\nvar Random = function ()\r\n{\r\n return FloatBetween(-Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = Random;\r\n","/**\r\n * @author Richard Davey \r\n * @author @samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar FloatBetween = require('../FloatBetween');\r\n\r\n/**\r\n * Returns a random angle in the range [-180, 180].\r\n *\r\n * @function Phaser.Math.Angle.RandomDegrees\r\n * @since 3.23.0\r\n *\r\n * @return {number} The angle, in degrees.\r\n */\r\nvar RandomDegrees = function ()\r\n{\r\n return FloatBetween(-180, 180);\r\n};\r\n\r\nmodule.exports = RandomDegrees;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Normalize = require('./Normalize');\r\n\r\n/**\r\n * Reverse the given angle.\r\n *\r\n * @function Phaser.Math.Angle.Reverse\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to reverse, in radians.\r\n *\r\n * @return {number} The reversed angle, in radians.\r\n */\r\nvar Reverse = function (angle)\r\n{\r\n return Normalize(angle + Math.PI);\r\n};\r\n\r\nmodule.exports = Reverse;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = require('../const');\r\n\r\n/**\r\n * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call.\r\n *\r\n * @function Phaser.Math.Angle.RotateTo\r\n * @since 3.0.0\r\n *\r\n * @param {number} currentAngle - The current angle, in radians.\r\n * @param {number} targetAngle - The target angle to rotate to, in radians.\r\n * @param {number} [lerp=0.05] - The lerp value to add to the current angle.\r\n *\r\n * @return {number} The adjusted angle.\r\n */\r\nvar RotateTo = function (currentAngle, targetAngle, lerp)\r\n{\r\n if (lerp === undefined) { lerp = 0.05; }\r\n\r\n if (currentAngle === targetAngle)\r\n {\r\n return currentAngle;\r\n }\r\n\r\n if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp))\r\n {\r\n currentAngle = targetAngle;\r\n }\r\n else\r\n {\r\n if (Math.abs(targetAngle - currentAngle) > Math.PI)\r\n {\r\n if (targetAngle < currentAngle)\r\n {\r\n targetAngle += MATH_CONST.PI2;\r\n }\r\n else\r\n {\r\n targetAngle -= MATH_CONST.PI2;\r\n }\r\n }\r\n\r\n if (targetAngle > currentAngle)\r\n {\r\n currentAngle += lerp;\r\n }\r\n else if (targetAngle < currentAngle)\r\n {\r\n currentAngle -= lerp;\r\n }\r\n }\r\n\r\n return currentAngle;\r\n};\r\n\r\nmodule.exports = RotateTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Gets the shortest angle between `angle1` and `angle2`.\r\n *\r\n * Both angles must be in the range -180 to 180, which is the same clamped\r\n * range that `sprite.angle` uses, so you can pass in two sprite angles to\r\n * this method and get the shortest angle back between the two of them.\r\n *\r\n * The angle returned will be in the same range. If the returned angle is\r\n * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's\r\n * a clockwise rotation.\r\n *\r\n * TODO: Wrap the angles in this function?\r\n *\r\n * @function Phaser.Math.Angle.ShortestBetween\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle1 - The first angle in the range -180 to 180.\r\n * @param {number} angle2 - The second angle in the range -180 to 180.\r\n *\r\n * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation.\r\n */\r\nvar ShortestBetween = function (angle1, angle2)\r\n{\r\n var difference = angle2 - angle1;\r\n\r\n if (difference === 0)\r\n {\r\n return 0;\r\n }\r\n\r\n var times = Math.floor((difference - (-180)) / 360);\r\n\r\n return difference - (times * 360);\r\n\r\n};\r\n\r\nmodule.exports = ShortestBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MathWrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle.\r\n *\r\n * Wraps the angle to a value in the range of -PI to PI.\r\n *\r\n * @function Phaser.Math.Angle.Wrap\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in radians.\r\n *\r\n * @return {number} The wrapped angle, in radians.\r\n */\r\nvar Wrap = function (angle)\r\n{\r\n return MathWrap(angle, -Math.PI, Math.PI);\r\n};\r\n\r\nmodule.exports = Wrap;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Wrap = require('../Wrap');\r\n\r\n/**\r\n * Wrap an angle in degrees.\r\n *\r\n * Wraps the angle to a value in the range of -180 to 180.\r\n *\r\n * @function Phaser.Math.Angle.WrapDegrees\r\n * @since 3.0.0\r\n *\r\n * @param {number} angle - The angle to wrap, in degrees.\r\n *\r\n * @return {number} The wrapped angle, in degrees.\r\n */\r\nvar WrapDegrees = function (angle)\r\n{\r\n return Wrap(angle, -180, 180);\r\n};\r\n\r\nmodule.exports = WrapDegrees;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Angle\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./Between'),\r\n BetweenPoints: require('./BetweenPoints'),\r\n BetweenPointsY: require('./BetweenPointsY'),\r\n BetweenY: require('./BetweenY'),\r\n CounterClockwise: require('./CounterClockwise'),\r\n Normalize: require('./Normalize'),\r\n Random: require('./Random'),\r\n RandomDegrees: require('./RandomDegrees'),\r\n Reverse: require('./Reverse'),\r\n RotateTo: require('./RotateTo'),\r\n ShortestBetween: require('./ShortestBetween'),\r\n Wrap: require('./Wrap'),\r\n WrapDegrees: require('./WrapDegrees')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH_CONST = {\r\n\r\n /**\r\n * The value of PI * 2.\r\n * \r\n * @name Phaser.Math.PI2\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n PI2: Math.PI * 2,\r\n\r\n /**\r\n * The value of PI * 0.5.\r\n * \r\n * @name Phaser.Math.TAU\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n TAU: Math.PI * 0.5,\r\n\r\n /**\r\n * An epsilon value (1.0e-6)\r\n * \r\n * @name Phaser.Math.EPSILON\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n EPSILON: 1.0e-6,\r\n\r\n /**\r\n * For converting degrees to radians (PI / 180)\r\n * \r\n * @name Phaser.Math.DEG_TO_RAD\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n DEG_TO_RAD: Math.PI / 180,\r\n\r\n /**\r\n * For converting radians to degrees (180 / PI)\r\n * \r\n * @name Phaser.Math.RAD_TO_DEG\r\n * @type {number}\r\n * @since 3.0.0\r\n */\r\n RAD_TO_DEG: 180 / Math.PI,\r\n\r\n /**\r\n * An instance of the Random Number Generator.\r\n * This is not set until the Game boots.\r\n * \r\n * @name Phaser.Math.RND\r\n * @type {Phaser.Math.RandomDataGenerator}\r\n * @since 3.0.0\r\n */\r\n RND: null,\r\n\r\n /**\r\n * The minimum safe integer this browser supports.\r\n * We use a const for backward compatibility with Internet Explorer.\r\n * \r\n * @name Phaser.Math.MIN_SAFE_INTEGER\r\n * @type {number}\r\n * @since 3.21.0\r\n */\r\n MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991,\r\n\r\n /**\r\n * The maximum safe integer this browser supports.\r\n * We use a const for backward compatibility with Internet Explorer.\r\n * \r\n * @name Phaser.Math.MAX_SAFE_INTEGER\r\n * @type {number}\r\n * @since 3.21.0\r\n */\r\n MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991\r\n\r\n};\r\n\r\nmodule.exports = MATH_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points).\r\n *\r\n * @function Phaser.Math.Distance.Between\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistanceBetween = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n};\r\n\r\nmodule.exports = DistanceBetween;\r\n","/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two points.\r\n *\r\n * @function Phaser.Math.Distance.BetweenPoints\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} a - The first point.\r\n * @param {Phaser.Types.Math.Vector2Like} b - The second point.\r\n *\r\n * @return {number} The distance between the points.\r\n */\r\nvar DistanceBetweenPoints = function (a, b)\r\n{\r\n var dx = a.x - b.x;\r\n var dy = a.y - b.y;\r\n\r\n return Math.sqrt(dx * dx + dy * dy);\r\n};\r\n\r\nmodule.exports = DistanceBetweenPoints;\r\n","/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the squared distance between two points.\r\n *\r\n * @function Phaser.Math.Distance.BetweenPointsSquared\r\n * @since 3.22.0\r\n *\r\n * @param {Phaser.Types.Math.Vector2Like} a - The first point.\r\n * @param {Phaser.Types.Math.Vector2Like} b - The second point.\r\n *\r\n * @return {number} The squared distance between the points.\r\n */\r\nvar DistanceBetweenPointsSquared = function (a, b)\r\n{\r\n var dx = a.x - b.x;\r\n var dy = a.y - b.y;\r\n\r\n return dx * dx + dy * dy;\r\n};\r\n\r\nmodule.exports = DistanceBetweenPointsSquared;\r\n","/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the Chebyshev distance between two sets of coordinates (points).\r\n *\r\n * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances.\r\n * It's the effective distance when movement can be horizontal, vertical, or diagonal.\r\n *\r\n * @function Phaser.Math.Distance.Chebyshev\r\n * @since 3.22.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar ChebyshevDistance = function (x1, y1, x2, y2)\r\n{\r\n return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2));\r\n};\r\n\r\nmodule.exports = ChebyshevDistance;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points) to the power of `pow`.\r\n *\r\n * @function Phaser.Math.Distance.Power\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n * @param {number} pow - The exponent.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar DistancePower = function (x1, y1, x2, y2, pow)\r\n{\r\n if (pow === undefined) { pow = 2; }\r\n\r\n return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow));\r\n};\r\n\r\nmodule.exports = DistancePower;\r\n","/**\r\n * @author samme\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the snake distance between two sets of coordinates (points).\r\n *\r\n * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances.\r\n * It's the effective distance when movement is allowed only horizontally or vertically (but not both).\r\n *\r\n * @function Phaser.Math.Distance.Snake\r\n * @since 3.22.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point.\r\n */\r\nvar SnakeDistance = function (x1, y1, x2, y2)\r\n{\r\n return Math.abs(x1 - x2) + Math.abs(y1 - y2);\r\n};\r\n\r\nmodule.exports = SnakeDistance;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the distance between two sets of coordinates (points), squared.\r\n *\r\n * @function Phaser.Math.Distance.Squared\r\n * @since 3.0.0\r\n *\r\n * @param {number} x1 - The x coordinate of the first point.\r\n * @param {number} y1 - The y coordinate of the first point.\r\n * @param {number} x2 - The x coordinate of the second point.\r\n * @param {number} y2 - The y coordinate of the second point.\r\n *\r\n * @return {number} The distance between each point, squared.\r\n */\r\nvar DistanceSquared = function (x1, y1, x2, y2)\r\n{\r\n var dx = x1 - x2;\r\n var dy = y1 - y2;\r\n\r\n return dx * dx + dy * dy;\r\n};\r\n\r\nmodule.exports = DistanceSquared;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Distance\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Between: require('./DistanceBetween'),\r\n BetweenPoints: require('./DistanceBetweenPoints'),\r\n BetweenPointsSquared: require('./DistanceBetweenPointsSquared'),\r\n Chebyshev: require('./DistanceChebyshev'),\r\n Power: require('./DistancePower'),\r\n Snake: require('./DistanceSnake'),\r\n Squared: require('./DistanceSquared')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Back.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return v * v * ((overshoot + 1) * v - overshoot);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Back.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n var s = overshoot * 1.525;\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * (v * v * ((s + 1) * v - s));\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Back ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Back.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [overshoot=1.70158] - The overshoot amount.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, overshoot)\r\n{\r\n if (overshoot === undefined) { overshoot = 1.70158; }\r\n\r\n return --v * v * ((overshoot + 1) * v + overshoot) + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Back\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n v = 1 - v;\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n return 1 - (7.5625 * v * v);\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75);\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375);\r\n }\r\n else\r\n {\r\n return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n var reverse = false;\r\n\r\n if (v < 0.5)\r\n {\r\n v = 1 - (v * 2);\r\n reverse = true;\r\n }\r\n else\r\n {\r\n v = (v * 2) - 1;\r\n }\r\n\r\n if (v < 1 / 2.75)\r\n {\r\n v = 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n\r\n if (reverse)\r\n {\r\n return (1 - v) * 0.5;\r\n }\r\n else\r\n {\r\n return v * 0.5 + 0.5;\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Bounce ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Bounce.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v < 1 / 2.75)\r\n {\r\n return 7.5625 * v * v;\r\n }\r\n else if (v < 2 / 2.75)\r\n {\r\n return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\r\n }\r\n else if (v < 2.5 / 2.75)\r\n {\r\n return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\r\n }\r\n else\r\n {\r\n return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Bounce\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Circular.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return 1 - Math.sqrt(1 - v * v);\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (Math.sqrt(1 - v * v) - 1);\r\n }\r\n else\r\n {\r\n return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Circular ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Circular.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return Math.sqrt(1 - (--v * v));\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Circular\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Cubic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Cubic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Cubic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n if ((v *= 2) < 1)\r\n {\r\n return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\r\n }\r\n else\r\n {\r\n return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Elastic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Elastic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\r\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v, amplitude, period)\r\n{\r\n if (amplitude === undefined) { amplitude = 0.1; }\r\n if (period === undefined) { period = 0.1; }\r\n\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n var s = period / 4;\r\n\r\n if (amplitude < 1)\r\n {\r\n amplitude = 1;\r\n }\r\n else\r\n {\r\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\r\n }\r\n\r\n return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Elastic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Expo.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return Math.pow(2, 10 * (v - 1)) - 0.001;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * Math.pow(2, 10 * (v - 1));\r\n }\r\n else\r\n {\r\n return 0.5 * (2 - Math.pow(2, -10 * (v - 1)));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Exponential ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Expo.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - Math.pow(2, -10 * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Expo\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Back: require('./back'),\r\n Bounce: require('./bounce'),\r\n Circular: require('./circular'),\r\n Cubic: require('./cubic'),\r\n Elastic: require('./elastic'),\r\n Expo: require('./expo'),\r\n Linear: require('./linear'),\r\n Quadratic: require('./quadratic'),\r\n Quartic: require('./quartic'),\r\n Quintic: require('./quintic'),\r\n Sine: require('./sine'),\r\n Stepped: require('./stepped')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Linear easing (no variation).\r\n *\r\n * @function Phaser.Math.Easing.Linear\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Linear = function (v)\r\n{\r\n return v;\r\n};\r\n\r\nmodule.exports = Linear;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nmodule.exports = require('./Linear');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * (--v * (v - 2) - 1);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quadratic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quadratic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return v * (2 - v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quadratic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v;\r\n }\r\n else\r\n {\r\n return -0.5 * ((v -= 2) * v * v * v - 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quartic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quartic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return 1 - (--v * v * v * v);\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quartic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n return v * v * v * v * v;\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if ((v *= 2) < 1)\r\n {\r\n return 0.5 * v * v * v * v * v;\r\n }\r\n else\r\n {\r\n return 0.5 * ((v -= 2) * v * v * v * v + 2);\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Quintic ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Quintic.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n return --v * v * v * v * v + 1;\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Quintic\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in.\r\n *\r\n * @function Phaser.Math.Easing.Sine.In\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar In = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 1 - Math.cos(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = In;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-in/out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.InOut\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar InOut = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return 0.5 * (1 - Math.cos(Math.PI * v));\r\n }\r\n};\r\n\r\nmodule.exports = InOut;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Sinusoidal ease-out.\r\n *\r\n * @function Phaser.Math.Easing.Sine.Out\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Out = function (v)\r\n{\r\n if (v === 0)\r\n {\r\n return 0;\r\n }\r\n else if (v === 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return Math.sin(v * Math.PI / 2);\r\n }\r\n};\r\n\r\nmodule.exports = Out;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Sine\r\n */\r\n\r\nmodule.exports = {\r\n\r\n In: require('./In'),\r\n Out: require('./Out'),\r\n InOut: require('./InOut')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Stepped easing.\r\n *\r\n * @function Phaser.Math.Easing.Stepped\r\n * @since 3.0.0\r\n *\r\n * @param {number} v - The value to be tweened.\r\n * @param {number} [steps=1] - The number of steps in the ease.\r\n *\r\n * @return {number} The tweened value.\r\n */\r\nvar Stepped = function (v, steps)\r\n{\r\n if (steps === undefined) { steps = 1; }\r\n\r\n if (v <= 0)\r\n {\r\n return 0;\r\n }\r\n else if (v >= 1)\r\n {\r\n return 1;\r\n }\r\n else\r\n {\r\n return (((steps * v) | 0) + 1) * (1 / steps);\r\n }\r\n};\r\n\r\nmodule.exports = Stepped;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Easing.Stepped\r\n */\r\n\r\nmodule.exports = require('./Stepped');\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy ceiling of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The fuzzy ceiling of the value.\r\n */\r\nvar Ceil = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.ceil(value - epsilon);\r\n};\r\n\r\nmodule.exports = Ceil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether the given values are fuzzily equal.\r\n *\r\n * Two numbers are fuzzily equal if their difference is less than `epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.Equal\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`.\r\n */\r\nvar Equal = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.abs(a - b) < epsilon;\r\n};\r\n\r\nmodule.exports = Equal;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Calculate the fuzzy floor of the given value.\r\n *\r\n * @function Phaser.Math.Fuzzy.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {number} The floor of the value.\r\n */\r\nvar Floor = function (value, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return Math.floor(value + epsilon);\r\n};\r\n\r\nmodule.exports = Floor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily greater than `b`.\r\n *\r\n * `a` is fuzzily greater than `b` if it is more than `b - epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.GreaterThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`.\r\n */\r\nvar GreaterThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a > b - epsilon;\r\n};\r\n\r\nmodule.exports = GreaterThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Check whether `a` is fuzzily less than `b`.\r\n *\r\n * `a` is fuzzily less than `b` if it is less than `b + epsilon`.\r\n *\r\n * @function Phaser.Math.Fuzzy.LessThan\r\n * @since 3.0.0\r\n *\r\n * @param {number} a - The first value.\r\n * @param {number} b - The second value.\r\n * @param {number} [epsilon=0.0001] - The epsilon.\r\n *\r\n * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`.\r\n */\r\nvar LessThan = function (a, b, epsilon)\r\n{\r\n if (epsilon === undefined) { epsilon = 0.0001; }\r\n\r\n return a < b + epsilon;\r\n};\r\n\r\nmodule.exports = LessThan;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Fuzzy\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./Ceil'),\r\n Equal: require('./Equal'),\r\n Floor: require('./Floor'),\r\n GreaterThan: require('./GreaterThan'),\r\n LessThan: require('./LessThan')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CONST = require('./const');\r\nvar Extend = require('../utils/object/Extend');\r\n\r\n/**\r\n * @namespace Phaser.Math\r\n */\r\n\r\nvar PhaserMath = {\r\n\r\n // Collections of functions\r\n Angle: require('./angle/'),\r\n Distance: require('./distance/'),\r\n Easing: require('./easing/'),\r\n Fuzzy: require('./fuzzy/'),\r\n Interpolation: require('./interpolation/'),\r\n Pow2: require('./pow2/'),\r\n Snap: require('./snap/'),\r\n\r\n // Expose the RNG Class\r\n RandomDataGenerator: require('./random-data-generator/RandomDataGenerator'),\r\n\r\n // Single functions\r\n Average: require('./Average'),\r\n Bernstein: require('./Bernstein'),\r\n Between: require('./Between'),\r\n CatmullRom: require('./CatmullRom'),\r\n CeilTo: require('./CeilTo'),\r\n Clamp: require('./Clamp'),\r\n DegToRad: require('./DegToRad'),\r\n Difference: require('./Difference'),\r\n Factorial: require('./Factorial'),\r\n FloatBetween: require('./FloatBetween'),\r\n FloorTo: require('./FloorTo'),\r\n FromPercent: require('./FromPercent'),\r\n GetSpeed: require('./GetSpeed'),\r\n IsEven: require('./IsEven'),\r\n IsEvenStrict: require('./IsEvenStrict'),\r\n Linear: require('./Linear'),\r\n MaxAdd: require('./MaxAdd'),\r\n MinSub: require('./MinSub'),\r\n Percent: require('./Percent'),\r\n RadToDeg: require('./RadToDeg'),\r\n RandomXY: require('./RandomXY'),\r\n RandomXYZ: require('./RandomXYZ'),\r\n RandomXYZW: require('./RandomXYZW'),\r\n Rotate: require('./Rotate'),\r\n RotateAround: require('./RotateAround'),\r\n RotateAroundDistance: require('./RotateAroundDistance'),\r\n RotateTo: require('./RotateTo'),\r\n RoundAwayFromZero: require('./RoundAwayFromZero'),\r\n RoundTo: require('./RoundTo'),\r\n SinCosTableGenerator: require('./SinCosTableGenerator'),\r\n SmootherStep: require('./SmootherStep'),\r\n SmoothStep: require('./SmoothStep'),\r\n ToXY: require('./ToXY'),\r\n TransformXY: require('./TransformXY'),\r\n Within: require('./Within'),\r\n Wrap: require('./Wrap'),\r\n\r\n // Vector classes\r\n Vector2: require('./Vector2'),\r\n Vector3: require('./Vector3'),\r\n Vector4: require('./Vector4'),\r\n Matrix3: require('./Matrix3'),\r\n Matrix4: require('./Matrix4'),\r\n Quaternion: require('./Quaternion'),\r\n RotateVec3: require('./RotateVec3')\r\n\r\n};\r\n\r\n// Merge in the consts\r\n\r\nPhaserMath = Extend(false, PhaserMath, CONST);\r\n\r\n// Export it\r\n\r\nmodule.exports = PhaserMath;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Bernstein = require('../Bernstein');\r\n\r\n/**\r\n * A bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Bezier\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar BezierInterpolation = function (v, k)\r\n{\r\n var b = 0;\r\n var n = v.length - 1;\r\n\r\n for (var i = 0; i <= n; i++)\r\n {\r\n b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i);\r\n }\r\n\r\n return b;\r\n};\r\n\r\nmodule.exports = BezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CatmullRom = require('../CatmullRom');\r\n\r\n/**\r\n * A Catmull-Rom interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.CatmullRom\r\n * @since 3.0.0\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CatmullRomInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (v[0] === v[m])\r\n {\r\n if (k < 0)\r\n {\r\n i = Math.floor(f = m * (1 + k));\r\n }\r\n\r\n return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]);\r\n }\r\n else\r\n {\r\n if (k < 0)\r\n {\r\n return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]);\r\n }\r\n\r\n if (k > 1)\r\n {\r\n return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]);\r\n }\r\n\r\n return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]);\r\n }\r\n};\r\n\r\nmodule.exports = CatmullRomInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return 3 * k * k * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return 3 * (1 - t) * t * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P3 (t, p)\r\n{\r\n return t * t * t * p;\r\n}\r\n\r\n/**\r\n * A cubic bezier interpolation method.\r\n *\r\n * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a\r\n *\r\n * @function Phaser.Math.Interpolation.CubicBezier\r\n * @since 3.0.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The first control point.\r\n * @param {number} p2 - The second control point.\r\n * @param {number} p3 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar CubicBezierInterpolation = function (t, p0, p1, p2, p3)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3);\r\n};\r\n\r\nmodule.exports = CubicBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Linear = require('../Linear');\r\n\r\n/**\r\n * A linear interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.Linear\r\n * @since 3.0.0\r\n * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation}\r\n *\r\n * @param {number[]} v - The input array of values to interpolate between.\r\n * @param {!number} k - The percentage of interpolation, between 0 and 1.\r\n *\r\n * @return {!number} The interpolated value.\r\n */\r\nvar LinearInterpolation = function (v, k)\r\n{\r\n var m = v.length - 1;\r\n var f = m * k;\r\n var i = Math.floor(f);\r\n\r\n if (k < 0)\r\n {\r\n return Linear(v[0], v[1], f);\r\n }\r\n else if (k > 1)\r\n {\r\n return Linear(v[m], v[m - 1], m - f);\r\n }\r\n else\r\n {\r\n return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i);\r\n }\r\n};\r\n\r\nmodule.exports = LinearInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P0 (t, p)\r\n{\r\n var k = 1 - t;\r\n\r\n return k * k * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P1 (t, p)\r\n{\r\n return 2 * (1 - t) * t * p;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction P2 (t, p)\r\n{\r\n return t * t * p;\r\n}\r\n\r\n// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js\r\n\r\n/**\r\n * A quadratic bezier interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.QuadraticBezier\r\n * @since 3.2.0\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} p0 - The start point.\r\n * @param {number} p1 - The control point.\r\n * @param {number} p2 - The end point.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar QuadraticBezierInterpolation = function (t, p0, p1, p2)\r\n{\r\n return P0(t, p0) + P1(t, p1) + P2(t, p2);\r\n};\r\n\r\nmodule.exports = QuadraticBezierInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmoothStep = require('../SmoothStep');\r\n\r\n/**\r\n * A Smooth Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmoothStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmoothStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmoothStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmoothStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SmootherStep = require('../SmootherStep');\r\n\r\n/**\r\n * A Smoother Step interpolation method.\r\n *\r\n * @function Phaser.Math.Interpolation.SmootherStep\r\n * @since 3.9.0\r\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\r\n *\r\n * @param {number} t - The percentage of interpolation, between 0 and 1.\r\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\r\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\r\n *\r\n * @return {number} The interpolated value.\r\n */\r\nvar SmootherStepInterpolation = function (t, min, max)\r\n{\r\n return min + (max - min) * SmootherStep(t, 0, 1);\r\n};\r\n\r\nmodule.exports = SmootherStepInterpolation;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Interpolation\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Bezier: require('./BezierInterpolation'),\r\n CatmullRom: require('./CatmullRomInterpolation'),\r\n CubicBezier: require('./CubicBezierInterpolation'),\r\n Linear: require('./LinearInterpolation'),\r\n QuadraticBezier: require('./QuadraticBezierInterpolation'),\r\n SmoothStep: require('./SmoothStepInterpolation'),\r\n SmootherStep: require('./SmootherStepInterpolation')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns the nearest power of 2 to the given `value`.\r\n *\r\n * @function Phaser.Math.Pow2.GetNext\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value.\r\n *\r\n * @return {integer} The nearest power of 2 to `value`.\r\n */\r\nvar GetPowerOfTwo = function (value)\r\n{\r\n var index = Math.log(value) / 0.6931471805599453;\r\n\r\n return (1 << Math.ceil(index));\r\n};\r\n\r\nmodule.exports = GetPowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if the given `width` and `height` are a power of two.\r\n * Useful for checking texture dimensions.\r\n *\r\n * @function Phaser.Math.Pow2.IsSize\r\n * @since 3.0.0\r\n *\r\n * @param {number} width - The width.\r\n * @param {number} height - The height.\r\n *\r\n * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`.\r\n */\r\nvar IsSizePowerOfTwo = function (width, height)\r\n{\r\n return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsSizePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests the value and returns `true` if it is a power of two.\r\n *\r\n * @function Phaser.Math.Pow2.IsValue\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to check if it's a power of two.\r\n *\r\n * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`.\r\n */\r\nvar IsValuePowerOfTwo = function (value)\r\n{\r\n return (value > 0 && (value & (value - 1)) === 0);\r\n};\r\n\r\nmodule.exports = IsValuePowerOfTwo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Pow2\r\n */\r\n\r\nmodule.exports = {\r\n\r\n GetNext: require('./GetPowerOfTwo'),\r\n IsSize: require('./IsSizePowerOfTwo'),\r\n IsValue: require('./IsValuePowerOfTwo')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Class = require('../../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A seeded Random Data Generator.\r\n * \r\n * Access via `Phaser.Math.RND` which is an instance of this class pre-defined\r\n * by Phaser. Or, create your own instance to use as you require.\r\n * \r\n * The `Math.RND` generator is seeded by the Game Config property value `seed`.\r\n * If no such config property exists, a random number is used.\r\n * \r\n * If you create your own instance of this class you should provide a seed for it.\r\n * If no seed is given it will use a 'random' one based on Date.now.\r\n *\r\n * @class RandomDataGenerator\r\n * @memberof Phaser.Math\r\n * @constructor\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} [seeds] - The seeds to use for the random number generator.\r\n */\r\nvar RandomDataGenerator = new Class({\r\n\r\n initialize:\r\n\r\n function RandomDataGenerator (seeds)\r\n {\r\n if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; }\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#c\r\n * @type {number}\r\n * @default 1\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.c = 1;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s0\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s0 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s1\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s1 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#s2\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.0.0\r\n */\r\n this.s2 = 0;\r\n\r\n /**\r\n * Internal var.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#n\r\n * @type {number}\r\n * @default 0\r\n * @private\r\n * @since 3.2.0\r\n */\r\n this.n = 0;\r\n\r\n /**\r\n * Signs to choose from.\r\n *\r\n * @name Phaser.Math.RandomDataGenerator#signs\r\n * @type {number[]}\r\n * @since 3.0.0\r\n */\r\n this.signs = [ -1, 1 ];\r\n\r\n if (seeds)\r\n {\r\n this.init(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Private random helper.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rnd\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @return {number} A random number.\r\n */\r\n rnd: function ()\r\n {\r\n var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32\r\n\r\n this.c = t | 0;\r\n this.s0 = this.s1;\r\n this.s1 = this.s2;\r\n this.s2 = t - this.c;\r\n\r\n return this.s2;\r\n },\r\n\r\n /**\r\n * Internal method that creates a seed hash.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#hash\r\n * @since 3.0.0\r\n * @private\r\n *\r\n * @param {string} data - The value to hash.\r\n *\r\n * @return {number} The hashed value.\r\n */\r\n hash: function (data)\r\n {\r\n var h;\r\n var n = this.n;\r\n\r\n data = data.toString();\r\n\r\n for (var i = 0; i < data.length; i++)\r\n {\r\n n += data.charCodeAt(i);\r\n h = 0.02519603282416938 * n;\r\n n = h >>> 0;\r\n h -= n;\r\n h *= n;\r\n n = h >>> 0;\r\n h -= n;\r\n n += h * 0x100000000;// 2^32\r\n }\r\n\r\n this.n = n;\r\n\r\n return (n >>> 0) * 2.3283064365386963e-10;// 2^-32\r\n },\r\n\r\n /**\r\n * Initialize the state of the random data generator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#init\r\n * @since 3.0.0\r\n *\r\n * @param {(string|string[])} seeds - The seeds to initialize the random data generator with.\r\n */\r\n init: function (seeds)\r\n {\r\n if (typeof seeds === 'string')\r\n {\r\n this.state(seeds);\r\n }\r\n else\r\n {\r\n this.sow(seeds);\r\n }\r\n },\r\n\r\n /**\r\n * Reset the seed of the random data generator.\r\n *\r\n * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sow\r\n * @since 3.0.0\r\n *\r\n * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used.\r\n */\r\n sow: function (seeds)\r\n {\r\n // Always reset to default seed\r\n this.n = 0xefc8249d;\r\n this.s0 = this.hash(' ');\r\n this.s1 = this.hash(' ');\r\n this.s2 = this.hash(' ');\r\n this.c = 1;\r\n\r\n if (!seeds)\r\n {\r\n return;\r\n }\r\n\r\n // Apply any seeds\r\n for (var i = 0; i < seeds.length && (seeds[i] != null); i++)\r\n {\r\n var seed = seeds[i];\r\n\r\n this.s0 -= this.hash(seed);\r\n this.s0 += ~~(this.s0 < 0);\r\n this.s1 -= this.hash(seed);\r\n this.s1 += ~~(this.s1 < 0);\r\n this.s2 -= this.hash(seed);\r\n this.s2 += ~~(this.s2 < 0);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a random integer between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integer\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random integer between 0 and 2^32.\r\n */\r\n integer: function ()\r\n {\r\n // 2^32\r\n return this.rnd() * 0x100000000;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#frac\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 1.\r\n */\r\n frac: function ()\r\n {\r\n // 2^-53\r\n return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16;\r\n },\r\n\r\n /**\r\n * Returns a random real number between 0 and 2^32.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#real\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between 0 and 2^32.\r\n */\r\n real: function ()\r\n {\r\n return this.integer() + this.frac();\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#integerInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n integerInRange: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random integer between and including min and max.\r\n * This method is an alias for RandomDataGenerator.integerInRange.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#between\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n between: function (min, max)\r\n {\r\n return Math.floor(this.realInRange(0, max - min + 1) + min);\r\n },\r\n\r\n /**\r\n * Returns a random real number between min and max.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#realInRange\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random number between min and max.\r\n */\r\n realInRange: function (min, max)\r\n {\r\n return this.frac() * (max - min) + min;\r\n },\r\n\r\n /**\r\n * Returns a random real number between -1 and 1.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#normal\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random real number between -1 and 1.\r\n */\r\n normal: function ()\r\n {\r\n return 1 - (2 * this.frac());\r\n },\r\n\r\n /**\r\n * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#uuid\r\n * @since 3.0.0\r\n *\r\n * @return {string} A valid RFC4122 version4 ID hex string\r\n */\r\n uuid: function ()\r\n {\r\n var a = '';\r\n var b = '';\r\n\r\n for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-')\r\n {\r\n // eslint-disable-next-line no-empty\r\n }\r\n\r\n return b;\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#pick\r\n * @since 3.0.0\r\n * \r\n * @generic T\r\n * @genericUse {T[]} - [array]\r\n * @genericUse {T} - [$return]\r\n *\r\n * @param {T[]} array - The array to pick a random element from.\r\n *\r\n * @return {T} A random member of the array.\r\n */\r\n pick: function (array)\r\n {\r\n return array[this.integerInRange(0, array.length - 1)];\r\n },\r\n\r\n /**\r\n * Returns a sign to be used with multiplication operator.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#sign\r\n * @since 3.0.0\r\n *\r\n * @return {number} -1 or +1.\r\n */\r\n sign: function ()\r\n {\r\n return this.pick(this.signs);\r\n },\r\n\r\n /**\r\n * Returns a random element from within the given array, favoring the earlier entries.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#weightedPick\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[]} - [array]\r\n * @genericUse {T} - [$return]\r\n *\r\n * @param {T[]} array - The array to pick a random element from.\r\n *\r\n * @return {T} A random member of the array.\r\n */\r\n weightedPick: function (array)\r\n {\r\n return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)];\r\n },\r\n\r\n /**\r\n * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#timestamp\r\n * @since 3.0.0\r\n *\r\n * @param {number} min - The minimum value in the range.\r\n * @param {number} max - The maximum value in the range.\r\n *\r\n * @return {number} A random timestamp between min and max.\r\n */\r\n timestamp: function (min, max)\r\n {\r\n return this.realInRange(min || 946684800000, max || 1577862000000);\r\n },\r\n\r\n /**\r\n * Returns a random angle between -180 and 180.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#angle\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -180 and 180.\r\n */\r\n angle: function ()\r\n {\r\n return this.integerInRange(-180, 180);\r\n },\r\n\r\n /**\r\n * Returns a random rotation in radians, between -3.141 and 3.141\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#rotation\r\n * @since 3.0.0\r\n *\r\n * @return {number} A random number between -3.141 and 3.141\r\n */\r\n rotation: function ()\r\n {\r\n return this.realInRange(-3.1415926, 3.1415926);\r\n },\r\n\r\n /**\r\n * Gets or Sets the state of the generator. This allows you to retain the values\r\n * that the generator is using between games, i.e. in a game save file.\r\n *\r\n * To seed this generator with a previously saved state you can pass it as the\r\n * `seed` value in your game config, or call this method directly after Phaser has booted.\r\n *\r\n * Call this method with no parameters to return the current state.\r\n *\r\n * If providing a state it should match the same format that this method\r\n * returns, which is a string with a header `!rnd` followed by the `c`,\r\n * `s0`, `s1` and `s2` values respectively, each comma-delimited.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#state\r\n * @since 3.0.0\r\n *\r\n * @param {string} [state] - Generator state to be set.\r\n *\r\n * @return {string} The current state of the generator.\r\n */\r\n state: function (state)\r\n {\r\n if (typeof state === 'string' && state.match(/^!rnd/))\r\n {\r\n state = state.split(',');\r\n\r\n this.c = parseFloat(state[1]);\r\n this.s0 = parseFloat(state[2]);\r\n this.s1 = parseFloat(state[3]);\r\n this.s2 = parseFloat(state[4]);\r\n }\r\n\r\n return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(',');\r\n },\r\n\r\n /**\r\n * Shuffles the given array, using the current seed.\r\n *\r\n * @method Phaser.Math.RandomDataGenerator#shuffle\r\n * @since 3.7.0\r\n *\r\n * @generic T\r\n * @genericUse {T[]} - [array,$return]\r\n *\r\n * @param {T[]} [array] - The array to be shuffled.\r\n *\r\n * @return {T[]} The shuffled array.\r\n */\r\n shuffle: function (array)\r\n {\r\n var len = array.length - 1;\r\n\r\n for (var i = len; i > 0; i--)\r\n {\r\n var randomIndex = Math.floor(this.frac() * (i + 1));\r\n var itemAtIndex = array[randomIndex];\r\n\r\n array[randomIndex] = array[i];\r\n array[i] = itemAtIndex;\r\n }\r\n\r\n return array;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = RandomDataGenerator;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using ceil.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`.\r\n * As will `14` snap to `15`... but `16` will snap to `20`.\r\n *\r\n * @function Phaser.Math.Snap.Ceil\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapCeil = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.ceil(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapCeil;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using floor.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`.\r\n * As will `14` snap to `10`... but `16` will snap to `15`.\r\n *\r\n * @function Phaser.Math.Snap.Floor\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapFloor = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.floor(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapFloor;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Snap a value to nearest grid slice, using rounding.\r\n *\r\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`.\r\n *\r\n * @function Phaser.Math.Snap.To\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to snap.\r\n * @param {number} gap - The interval gap of the grid.\r\n * @param {number} [start=0] - Optional starting offset for gap.\r\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\r\n *\r\n * @return {number} The snapped value.\r\n */\r\nvar SnapTo = function (value, gap, start, divide)\r\n{\r\n if (start === undefined) { start = 0; }\r\n\r\n if (gap === 0)\r\n {\r\n return value;\r\n }\r\n\r\n value -= start;\r\n value = gap * Math.round(value / gap);\r\n\r\n return (divide) ? (start + value) / gap : start + value;\r\n};\r\n\r\nmodule.exports = SnapTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Math.Snap\r\n */\r\n\r\nmodule.exports = {\r\n\r\n Ceil: require('./SnapCeil'),\r\n Floor: require('./SnapFloor'),\r\n To: require('./SnapTo')\r\n\r\n};\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2020 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar Class = require('../utils/Class');\r\n\r\n/**\r\n * @classdesc\r\n * A Global Plugin is installed just once into the Game owned Plugin Manager.\r\n * It can listen for Game events and respond to them.\r\n *\r\n * @class BasePlugin\r\n * @memberof Phaser.Plugins\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar BasePlugin = new Class({\r\n\r\n initialize:\r\n\r\n function BasePlugin (pluginManager)\r\n {\r\n /**\r\n * A handy reference to the Plugin Manager that is responsible for this plugin.\r\n * Can be used as a route to gain access to game systems and events.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#pluginManager\r\n * @type {Phaser.Plugins.PluginManager}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.pluginManager = pluginManager;\r\n\r\n /**\r\n * A reference to the Game instance this plugin is running under.\r\n *\r\n * @name Phaser.Plugins.BasePlugin#game\r\n * @type {Phaser.Game}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.game = pluginManager.game;\r\n },\r\n\r\n /**\r\n * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated.\r\n * It will never be called again on this instance.\r\n * In here you can set-up whatever you need for this plugin to run.\r\n * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this.\r\n * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#init\r\n * @since 3.8.0\r\n *\r\n * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually).\r\n */\r\n init: function ()\r\n {\r\n },\r\n\r\n /**\r\n * The PluginManager calls this method on a Global Plugin when the plugin is started.\r\n * If a plugin is stopped, and then started again, this will get called again.\r\n * Typically called immediately after `BasePlugin.init`.\r\n * On a Scene Plugin, this method is never called.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#start\r\n * @since 3.8.0\r\n */\r\n start: function ()\r\n {\r\n // Here are the game-level events you can listen to.\r\n // At the very least you should offer a destroy handler for when the game closes down.\r\n\r\n // var eventEmitter = this.game.events;\r\n\r\n // eventEmitter.once('destroy', this.gameDestroy, this);\r\n // eventEmitter.on('pause', this.gamePause, this);\r\n // eventEmitter.on('resume', this.gameResume, this);\r\n // eventEmitter.on('resize', this.gameResize, this);\r\n // eventEmitter.on('prestep', this.gamePreStep, this);\r\n // eventEmitter.on('step', this.gameStep, this);\r\n // eventEmitter.on('poststep', this.gamePostStep, this);\r\n // eventEmitter.on('prerender', this.gamePreRender, this);\r\n // eventEmitter.on('postrender', this.gamePostRender, this);\r\n },\r\n\r\n /**\r\n * The PluginManager calls this method on a Global Plugin when the plugin is stopped.\r\n * The game code has requested that your plugin stop doing whatever it does.\r\n * It is now considered as 'inactive' by the PluginManager.\r\n * Handle that process here (i.e. stop listening for events, etc)\r\n * If the plugin is started again then `BasePlugin.start` will be called again.\r\n * On a Scene Plugin, this method is never called.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#stop\r\n * @since 3.8.0\r\n */\r\n stop: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.BasePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = BasePlugin;\r\n","/**\r\n* @author Richard Davey \r\n* @copyright 2020 Photon Storm Ltd.\r\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\r\n*/\r\n\r\nvar BasePlugin = require('./BasePlugin');\r\nvar Class = require('../utils/Class');\r\nvar SceneEvents = require('../scene/events');\r\n\r\n/**\r\n * @classdesc\r\n * A Scene Level Plugin is installed into every Scene and belongs to that Scene.\r\n * It can listen for Scene events and respond to them.\r\n * It can map itself to a Scene property, or into the Scene Systems, or both.\r\n *\r\n * @class ScenePlugin\r\n * @memberof Phaser.Plugins\r\n * @extends Phaser.Plugins.BasePlugin\r\n * @constructor\r\n * @since 3.8.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\r\n */\r\nvar ScenePlugin = new Class({\r\n\r\n Extends: BasePlugin,\r\n\r\n initialize:\r\n\r\n function ScenePlugin (scene, pluginManager)\r\n {\r\n BasePlugin.call(this, pluginManager);\r\n\r\n /**\r\n * A reference to the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You can use it during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.ScenePlugin#scene\r\n * @type {?Phaser.Scene}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.scene = scene;\r\n\r\n /**\r\n * A reference to the Scene Systems of the Scene that has installed this plugin.\r\n * Only set if it's a Scene Plugin, otherwise `null`.\r\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\r\n * You can use it during the `boot` method.\r\n *\r\n * @name Phaser.Plugins.ScenePlugin#systems\r\n * @type {?Phaser.Scenes.Systems}\r\n * @protected\r\n * @since 3.8.0\r\n */\r\n this.systems = scene.sys;\r\n\r\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\r\n },\r\n\r\n /**\r\n * This method is called when the Scene boots. It is only ever called once.\r\n *\r\n * By this point the plugin properties `scene` and `systems` will have already been set.\r\n *\r\n * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run.\r\n * Here are the Scene events you can listen to:\r\n *\r\n * - start\r\n * - ready\r\n * - preupdate\r\n * - update\r\n * - postupdate\r\n * - resize\r\n * - pause\r\n * - resume\r\n * - sleep\r\n * - wake\r\n * - transitioninit\r\n * - transitionstart\r\n * - transitioncomplete\r\n * - transitionout\r\n * - shutdown\r\n * - destroy\r\n *\r\n * At the very least you should offer a destroy handler for when the Scene closes down, i.e:\r\n *\r\n * ```javascript\r\n * var eventEmitter = this.systems.events;\r\n * eventEmitter.once('destroy', this.sceneDestroy, this);\r\n * ```\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#boot\r\n * @since 3.8.0\r\n */\r\n boot: function ()\r\n {\r\n },\r\n\r\n /**\r\n * Game instance has been destroyed.\r\n * \r\n * You must release everything in here, all references, all objects, free it all up.\r\n *\r\n * @method Phaser.Plugins.ScenePlugin#destroy\r\n * @since 3.8.0\r\n */\r\n destroy: function ()\r\n {\r\n this.pluginManager = null;\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = ScenePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Phaser Blend Modes.\r\n * \r\n * @namespace Phaser.BlendModes\r\n * @since 3.0.0\r\n */\r\n\r\nmodule.exports = {\r\n\r\n /**\r\n * Skips the Blend Mode check in the renderer.\r\n * \r\n * @name Phaser.BlendModes.SKIP_CHECK\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SKIP_CHECK: -1,\r\n\r\n /**\r\n * Normal blend mode. For Canvas and WebGL.\r\n * This is the default setting and draws new shapes on top of the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.NORMAL\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n NORMAL: 0,\r\n\r\n /**\r\n * Add blend mode. For Canvas and WebGL.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.ADD\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ADD: 1,\r\n\r\n /**\r\n * Multiply blend mode. For Canvas and WebGL.\r\n * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.\r\n * \r\n * @name Phaser.BlendModes.MULTIPLY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n MULTIPLY: 2,\r\n\r\n /**\r\n * Screen blend mode. For Canvas and WebGL.\r\n * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)\r\n * \r\n * @name Phaser.BlendModes.SCREEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SCREEN: 3,\r\n\r\n /**\r\n * Overlay blend mode. For Canvas only.\r\n * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.\r\n * \r\n * @name Phaser.BlendModes.OVERLAY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n OVERLAY: 4,\r\n\r\n /**\r\n * Darken blend mode. For Canvas only.\r\n * Retains the darkest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.DARKEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DARKEN: 5,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Retains the lightest pixels of both layers.\r\n * \r\n * @name Phaser.BlendModes.LIGHTEN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTEN: 6,\r\n\r\n /**\r\n * Color Dodge blend mode. For Canvas only.\r\n * Divides the bottom layer by the inverted top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR_DODGE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_DODGE: 7,\r\n\r\n /**\r\n * Color Burn blend mode. For Canvas only.\r\n * Divides the inverted bottom layer by the top layer, and then inverts the result.\r\n * \r\n * @name Phaser.BlendModes.COLOR_BURN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR_BURN: 8,\r\n\r\n /**\r\n * Hard Light blend mode. For Canvas only.\r\n * A combination of multiply and screen like overlay, but with top and bottom layer swapped.\r\n * \r\n * @name Phaser.BlendModes.HARD_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HARD_LIGHT: 9,\r\n\r\n /**\r\n * Soft Light blend mode. For Canvas only.\r\n * A softer version of hard-light. Pure black or white does not result in pure black or white.\r\n * \r\n * @name Phaser.BlendModes.SOFT_LIGHT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOFT_LIGHT: 10,\r\n\r\n /**\r\n * Difference blend mode. For Canvas only.\r\n * Subtracts the bottom layer from the top layer or the other way round to always get a positive value.\r\n * \r\n * @name Phaser.BlendModes.DIFFERENCE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DIFFERENCE: 11,\r\n\r\n /**\r\n * Exclusion blend mode. For Canvas only.\r\n * Like difference, but with lower contrast.\r\n * \r\n * @name Phaser.BlendModes.EXCLUSION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n EXCLUSION: 12,\r\n\r\n /**\r\n * Hue blend mode. For Canvas only.\r\n * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.\r\n * \r\n * @name Phaser.BlendModes.HUE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n HUE: 13,\r\n\r\n /**\r\n * Saturation blend mode. For Canvas only.\r\n * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.SATURATION\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SATURATION: 14,\r\n\r\n /**\r\n * Color blend mode. For Canvas only.\r\n * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.COLOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COLOR: 15,\r\n\r\n /**\r\n * Luminosity blend mode. For Canvas only.\r\n * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.\r\n * \r\n * @name Phaser.BlendModes.LUMINOSITY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LUMINOSITY: 16,\r\n\r\n /**\r\n * Alpha erase blend mode. For Canvas and WebGL.\r\n * \r\n * @name Phaser.BlendModes.ERASE\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n ERASE: 17,\r\n\r\n /**\r\n * Source-in blend mode. For Canvas only.\r\n * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_IN: 18,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is drawn where it doesn't overlap the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_OUT: 19,\r\n\r\n /**\r\n * Source-out blend mode. For Canvas only.\r\n * The new shape is only drawn where it overlaps the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.SOURCE_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n SOURCE_ATOP: 20,\r\n\r\n /**\r\n * Destination-over blend mode. For Canvas only.\r\n * New shapes are drawn behind the existing canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OVER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OVER: 21,\r\n\r\n /**\r\n * Destination-in blend mode. For Canvas only.\r\n * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_IN\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_IN: 22,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing content is kept where it doesn't overlap the new shape.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_OUT\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_OUT: 23,\r\n\r\n /**\r\n * Destination-out blend mode. For Canvas only.\r\n * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.\r\n * \r\n * @name Phaser.BlendModes.DESTINATION_ATOP\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n DESTINATION_ATOP: 24,\r\n\r\n /**\r\n * Lighten blend mode. For Canvas only.\r\n * Where both shapes overlap the color is determined by adding color values.\r\n * \r\n * @name Phaser.BlendModes.LIGHTER\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n LIGHTER: 25,\r\n\r\n /**\r\n * Copy blend mode. For Canvas only.\r\n * Only the new shape is shown.\r\n * \r\n * @name Phaser.BlendModes.COPY\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n COPY: 26,\r\n\r\n /**\r\n * Xor blend mode. For Canvas only.\r\n * Shapes are made transparent where both overlap and drawn normal everywhere else.\r\n * \r\n * @name Phaser.BlendModes.XOR\r\n * @type {integer}\r\n * @const\r\n * @since 3.0.0\r\n */\r\n XOR: 27\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar PIPELINE_CONST = {\r\n\r\n /**\r\n * The Bitmap Mask Pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE\r\n * @type {string}\r\n * @const\r\n * @since 3.50.0\r\n */\r\n BITMAPMASK_PIPELINE: 'BitmapMaskPipeline',\r\n\r\n /**\r\n * The Light 2D Pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE\r\n * @type {string}\r\n * @const\r\n * @since 3.50.0\r\n */\r\n LIGHT_PIPELINE: 'Light2D',\r\n\r\n /**\r\n * The Single Texture Pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE\r\n * @type {string}\r\n * @const\r\n * @since 3.50.0\r\n */\r\n SINGLE_PIPELINE: 'SinglePipeline',\r\n\r\n /**\r\n * The Multi Texture Pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE\r\n * @type {string}\r\n * @const\r\n * @since 3.50.0\r\n */\r\n MULTI_PIPELINE: 'MultiPipeline',\r\n\r\n /**\r\n * The Rope Pipeline.\r\n *\r\n * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE\r\n * @type {string}\r\n * @const\r\n * @since 3.50.0\r\n */\r\n ROPE_PIPELINE: 'RopePipeline'\r\n\r\n};\r\n\r\nmodule.exports = PIPELINE_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scale Manager Resize Event.\r\n * \r\n * This event is dispatched whenever the Scale Manager detects a resize event from the browser.\r\n * It sends three parameters to the callback, each of them being Size components. You can read\r\n * the `width`, `height`, `aspectRatio` and other properties of these components to help with\r\n * scaling your own game content.\r\n *\r\n * @event Phaser.Scale.Events#RESIZE\r\n * @since 3.16.1\r\n * \r\n * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas.\r\n * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution.\r\n * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.\r\n * @param {number} resolution - The current resolution. Defaults to 1 at the moment.\r\n * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width.\r\n * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height.\r\n */\r\nmodule.exports = 'resize';\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Added to Scene Event.\n *\n * This event is dispatched when a Game Object is added to a Scene.\n *\n * Listen for it from a Scene using `this.scene.events.on('addedtoscene', listener)`.\n *\n * @event Phaser.Scenes.Events#ADDED_TO_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene.\n * @param {Phaser.Scene} scene - The Scene to which the Game Object was added.\n */\nmodule.exports = 'addedtoscene';\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Boot Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('boot', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#BOOT\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'boot';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Create Event.\r\n * \r\n * This event is dispatched by a Scene after it has been created by the Scene Manager.\r\n * \r\n * If a Scene has a `create` method then this event is emitted _after_ that has run.\r\n * \r\n * If there is a transition, this event will be fired after the `TRANSITION_START` event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('create', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#CREATE\r\n * @since 3.17.0\r\n * \r\n * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event.\r\n */\r\nmodule.exports = 'create';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Destroy Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems destroy process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`.\r\n * \r\n * You should destroy any resources that may be in use by your Scene in this event handler.\r\n * \r\n * @event Phaser.Scenes.Events#DESTROY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'destroy';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pause Event.\r\n * \r\n * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an\r\n * action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('pause', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#PAUSE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was paused.\r\n */\r\nmodule.exports = 'pause';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Post Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#POST_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'postupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Pre Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#PRE_UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'preupdate';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Ready Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process.\r\n * By this point in the process the Scene is now fully active and rendering.\r\n * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('ready', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#READY\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was started.\r\n */\r\nmodule.exports = 'ready';\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Removed from Scene Event.\n *\n * This event is dispatched when a Game Object is removed from a Scene.\n *\n * Listen for it from a Scene using `this.scene.events.on('removedfromscene', listener)`.\n *\n * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene.\n * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed.\n */\nmodule.exports = 'removedfromscene';\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Render Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('render', listener)`.\r\n * \r\n * A Scene will only render if it is visible and active.\r\n * By the time this event is dispatched, the Scene will have already been rendered.\r\n * \r\n * @event Phaser.Scenes.Events#RENDER\r\n * @since 3.0.0\r\n * \r\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene.\r\n */\r\nmodule.exports = 'render';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Resume Event.\r\n * \r\n * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('resume', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#RESUME\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed.\r\n */\r\nmodule.exports = 'resume';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Shutdown Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems shutdown process.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`.\r\n * \r\n * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding\r\n * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not\r\n * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources.\r\n * \r\n * @event Phaser.Scenes.Events#SHUTDOWN\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown.\r\n */\r\nmodule.exports = 'shutdown';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Sleep Event.\r\n * \r\n * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#SLEEP\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep.\r\n */\r\nmodule.exports = 'sleep';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Start Event.\r\n * \r\n * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('start', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#START\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n */\r\nmodule.exports = 'start';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Complete Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration\r\n * of the transition.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_COMPLETE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} scene -The Scene on which the transitioned completed.\r\n */\r\nmodule.exports = 'transitioncomplete';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Init Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition.\r\n * \r\n * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method,\r\n * this event is not dispatched.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_INIT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitioninit';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Out Event.\r\n * \r\n * This event is dispatched by a Scene when it initiates a transition to another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_OUT\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionout';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Start Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.\r\n * \r\n * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method,\r\n * this event is dispatched anyway.\r\n * \r\n * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is\r\n * dispatched instead of this event.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_START\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionstart';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Transition Wake Event.\r\n * \r\n * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before\r\n * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`.\r\n * \r\n * The Scene Transition event flow is as follows:\r\n * \r\n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\r\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\r\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\r\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\r\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\r\n * \r\n * @event Phaser.Scenes.Events#TRANSITION_WAKE\r\n * @since 3.5.0\r\n * \r\n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\r\n * @param {number} duration - The duration of the transition in ms.\r\n */\r\nmodule.exports = 'transitionwake';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Update Event.\r\n * \r\n * This event is dispatched by a Scene during the main game loop step.\r\n * \r\n * The event flow for a single step of a Scene is as follows:\r\n * \r\n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\r\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\r\n * 3. The `Scene.update` method is called, if it exists\r\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\r\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('update', listener)`.\r\n * \r\n * A Scene will only run its step if it is active.\r\n * \r\n * @event Phaser.Scenes.Events#UPDATE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\r\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\r\n */\r\nmodule.exports = 'update';\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The Scene Systems Wake Event.\r\n * \r\n * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method,\r\n * or as an action from another Scene.\r\n * \r\n * Listen to it from a Scene using `this.scene.events.on('wake', listener)`.\r\n * \r\n * @event Phaser.Scenes.Events#WAKE\r\n * @since 3.0.0\r\n * \r\n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\r\n * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up.\r\n */\r\nmodule.exports = 'wake';\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Scenes.Events\n */\n\nmodule.exports = {\n\n ADDED_TO_SCENE: require('./ADDED_TO_SCENE_EVENT'),\n BOOT: require('./BOOT_EVENT'),\n CREATE: require('./CREATE_EVENT'),\n DESTROY: require('./DESTROY_EVENT'),\n PAUSE: require('./PAUSE_EVENT'),\n POST_UPDATE: require('./POST_UPDATE_EVENT'),\n PRE_UPDATE: require('./PRE_UPDATE_EVENT'),\n READY: require('./READY_EVENT'),\n REMOVED_FROM_SCENE: require('./REMOVED_FROM_SCENE_EVENT'),\n RENDER: require('./RENDER_EVENT'),\n RESUME: require('./RESUME_EVENT'),\n SHUTDOWN: require('./SHUTDOWN_EVENT'),\n SLEEP: require('./SLEEP_EVENT'),\n START: require('./START_EVENT'),\n TRANSITION_COMPLETE: require('./TRANSITION_COMPLETE_EVENT'),\n TRANSITION_INIT: require('./TRANSITION_INIT_EVENT'),\n TRANSITION_OUT: require('./TRANSITION_OUT_EVENT'),\n TRANSITION_START: require('./TRANSITION_START_EVENT'),\n TRANSITION_WAKE: require('./TRANSITION_WAKE_EVENT'),\n UPDATE: require('./UPDATE_EVENT'),\n WAKE: require('./WAKE_EVENT')\n\n};\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Retrieves the value of the given key from an object.\r\n *\r\n * @function Phaser.Tweens.Builders.GetBoolean\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @param {string} key - The key to look for in the `source` object.\r\n * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided.\r\n *\r\n * @return {*} The retrieved value.\r\n */\r\nvar GetBoolean = function (source, key, defaultValue)\r\n{\r\n if (!source)\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetBoolean;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar TWEEN_CONST = {\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.CREATED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n CREATED: 0,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.INIT\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n INIT: 1,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n DELAY: 2,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.OFFSET_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n OFFSET_DELAY: 3,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.PENDING_RENDER\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PENDING_RENDER: 4,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.PLAYING_FORWARD\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PLAYING_FORWARD: 5,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.PLAYING_BACKWARD\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PLAYING_BACKWARD: 6,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.HOLD_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n HOLD_DELAY: 7,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.REPEAT_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n REPEAT_DELAY: 8,\r\n\r\n /**\r\n * TweenData state.\r\n * \r\n * @name Phaser.Tweens.COMPLETE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COMPLETE: 9,\r\n\r\n // Tween specific (starts from 20 to cleanly allow extra TweenData consts in the future)\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.PENDING_ADD\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PENDING_ADD: 20,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.PAUSED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PAUSED: 21,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.LOOP_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n LOOP_DELAY: 22,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.ACTIVE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n ACTIVE: 23,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.COMPLETE_DELAY\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n COMPLETE_DELAY: 24,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.PENDING_REMOVE\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n PENDING_REMOVE: 25,\r\n\r\n /**\r\n * Tween state.\r\n * \r\n * @name Phaser.Tweens.REMOVED\r\n * @type {integer}\r\n * @since 3.0.0\r\n */\r\n REMOVED: 26\r\n\r\n};\r\n\r\nmodule.exports = TWEEN_CONST;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Taken from klasse by mattdesl https://github.com/mattdesl/klasse\r\n\r\nfunction hasGetterOrSetter (def)\r\n{\r\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\r\n}\r\n\r\nfunction getProperty (definition, k, isClassDescriptor)\r\n{\r\n // This may be a lightweight object, OR it might be a property that was defined previously.\r\n\r\n // For simple class descriptors we can just assume its NOT previously defined.\r\n var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);\r\n\r\n if (!isClassDescriptor && def.value && typeof def.value === 'object')\r\n {\r\n def = def.value;\r\n }\r\n\r\n // This might be a regular property, or it may be a getter/setter the user defined in a class.\r\n if (def && hasGetterOrSetter(def))\r\n {\r\n if (typeof def.enumerable === 'undefined')\r\n {\r\n def.enumerable = true;\r\n }\r\n\r\n if (typeof def.configurable === 'undefined')\r\n {\r\n def.configurable = true;\r\n }\r\n\r\n return def;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}\r\n\r\nfunction hasNonConfigurable (obj, k)\r\n{\r\n var prop = Object.getOwnPropertyDescriptor(obj, k);\r\n\r\n if (!prop)\r\n {\r\n return false;\r\n }\r\n\r\n if (prop.value && typeof prop.value === 'object')\r\n {\r\n prop = prop.value;\r\n }\r\n\r\n if (prop.configurable === false)\r\n {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Extends the given `myClass` object's prototype with the properties of `definition`.\r\n *\r\n * @function extend\r\n * @param {Object} ctor The constructor object to mix into.\r\n * @param {Object} definition A dictionary of functions for the class.\r\n * @param {boolean} isClassDescriptor Is the definition a class descriptor?\r\n * @param {Object} [extend] The parent constructor object.\r\n */\r\nfunction extend (ctor, definition, isClassDescriptor, extend)\r\n{\r\n for (var k in definition)\r\n {\r\n if (!definition.hasOwnProperty(k))\r\n {\r\n continue;\r\n }\r\n\r\n var def = getProperty(definition, k, isClassDescriptor);\r\n\r\n if (def !== false)\r\n {\r\n // If Extends is used, we will check its prototype to see if the final variable exists.\r\n\r\n var parent = extend || ctor;\r\n\r\n if (hasNonConfigurable(parent.prototype, k))\r\n {\r\n // Just skip the final property\r\n if (Class.ignoreFinals)\r\n {\r\n continue;\r\n }\r\n\r\n // We cannot re-define a property that is configurable=false.\r\n // So we will consider them final and throw an error. This is by\r\n // default so it is clear to the developer what is happening.\r\n // You can set ignoreFinals to true if you need to extend a class\r\n // which has configurable=false; it will simply not re-define final properties.\r\n throw new Error('cannot override final property \\'' + k + '\\', set Class.ignoreFinals = true to skip');\r\n }\r\n\r\n Object.defineProperty(ctor.prototype, k, def);\r\n }\r\n else\r\n {\r\n ctor.prototype[k] = definition[k];\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Applies the given `mixins` to the prototype of `myClass`.\r\n *\r\n * @function mixin\r\n * @param {Object} myClass The constructor object to mix into.\r\n * @param {Object|Array} mixins The mixins to apply to the constructor.\r\n */\r\nfunction mixin (myClass, mixins)\r\n{\r\n if (!mixins)\r\n {\r\n return;\r\n }\r\n\r\n if (!Array.isArray(mixins))\r\n {\r\n mixins = [ mixins ];\r\n }\r\n\r\n for (var i = 0; i < mixins.length; i++)\r\n {\r\n extend(myClass, mixins[i].prototype || mixins[i]);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new class with the given descriptor.\r\n * The constructor, defined by the name `initialize`,\r\n * is an optional function. If unspecified, an anonymous\r\n * function will be used which calls the parent class (if\r\n * one exists).\r\n *\r\n * You can also use `Extends` and `Mixins` to provide subclassing\r\n * and inheritance.\r\n *\r\n * @class Phaser.Class\r\n * @constructor\r\n * @param {Object} definition a dictionary of functions for the class\r\n * @example\r\n *\r\n * var MyClass = new Phaser.Class({\r\n *\r\n * initialize: function() {\r\n * this.foo = 2.0;\r\n * },\r\n *\r\n * bar: function() {\r\n * return this.foo + 5;\r\n * }\r\n * });\r\n */\r\nfunction Class (definition)\r\n{\r\n if (!definition)\r\n {\r\n definition = {};\r\n }\r\n\r\n // The variable name here dictates what we see in Chrome debugger\r\n var initialize;\r\n var Extends;\r\n\r\n if (definition.initialize)\r\n {\r\n if (typeof definition.initialize !== 'function')\r\n {\r\n throw new Error('initialize must be a function');\r\n }\r\n\r\n initialize = definition.initialize;\r\n\r\n // Usually we should avoid 'delete' in V8 at all costs.\r\n // However, its unlikely to make any performance difference\r\n // here since we only call this on class creation (i.e. not object creation).\r\n delete definition.initialize;\r\n }\r\n else if (definition.Extends)\r\n {\r\n var base = definition.Extends;\r\n\r\n initialize = function ()\r\n {\r\n base.apply(this, arguments);\r\n };\r\n }\r\n else\r\n {\r\n initialize = function () {};\r\n }\r\n\r\n if (definition.Extends)\r\n {\r\n initialize.prototype = Object.create(definition.Extends.prototype);\r\n initialize.prototype.constructor = initialize;\r\n\r\n // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin)\r\n\r\n Extends = definition.Extends;\r\n\r\n delete definition.Extends;\r\n }\r\n else\r\n {\r\n initialize.prototype.constructor = initialize;\r\n }\r\n\r\n // Grab the mixins, if they are specified...\r\n var mixins = null;\r\n\r\n if (definition.Mixins)\r\n {\r\n mixins = definition.Mixins;\r\n delete definition.Mixins;\r\n }\r\n\r\n // First, mixin if we can.\r\n mixin(initialize, mixins);\r\n\r\n // Now we grab the actual definition which defines the overrides.\r\n extend(initialize, definition, true, Extends);\r\n\r\n return initialize;\r\n}\r\n\r\nClass.extend = extend;\r\nClass.mixin = mixin;\r\nClass.ignoreFinals = false;\r\n\r\nmodule.exports = Class;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * A NOOP (No Operation) callback function.\r\n *\r\n * Used internally by Phaser when it's more expensive to determine if a callback exists\r\n * than it is to just invoke an empty function.\r\n *\r\n * @function Phaser.Utils.NOOP\r\n * @since 3.0.0\r\n */\r\nvar NOOP = function ()\r\n{\r\n // NOOP\r\n};\r\n\r\nmodule.exports = NOOP;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Adds the given item, or array of items, to the array.\r\n *\r\n * Each item must be unique within the array.\r\n *\r\n * The array is modified in-place and returned.\r\n *\r\n * You can optionally specify a limit to the maximum size of the array. If the quantity of items being\r\n * added will take the array length over this limit, it will stop adding once the limit is reached.\r\n *\r\n * You can optionally specify a callback to be invoked for each item successfully added to the array.\r\n *\r\n * @function Phaser.Utils.Array.Add\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be added to.\r\n * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array.\r\n * @param {integer} [limit] - Optional limit which caps the size of the array.\r\n * @param {function} [callback] - A callback to be invoked for each item successfully added to the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar Add = function (array, item, limit, callback, context)\r\n{\r\n if (context === undefined) { context = array; }\r\n\r\n if (limit > 0)\r\n {\r\n var remaining = limit - array.length;\r\n\r\n // There's nothing more we can do here, the array is full\r\n if (remaining <= 0)\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // Fast path to avoid array mutation and iteration\r\n if (!Array.isArray(item))\r\n {\r\n if (array.indexOf(item) === -1)\r\n {\r\n array.push(item);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // If we got this far, we have an array of items to insert\r\n\r\n // Ensure all the items are unique\r\n var itemLength = item.length - 1;\r\n\r\n while (itemLength >= 0)\r\n {\r\n if (array.indexOf(item[itemLength]) !== -1)\r\n {\r\n // Already exists in array, so remove it\r\n item.splice(itemLength, 1);\r\n }\r\n\r\n itemLength--;\r\n }\r\n\r\n // Anything left?\r\n itemLength = item.length;\r\n\r\n if (itemLength === 0)\r\n {\r\n return null;\r\n }\r\n\r\n if (limit > 0 && itemLength > remaining)\r\n {\r\n item.splice(remaining);\r\n\r\n itemLength = remaining;\r\n }\r\n\r\n for (var i = 0; i < itemLength; i++)\r\n {\r\n var entry = item[i];\r\n\r\n array.push(entry);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, entry);\r\n }\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = Add;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Adds the given item, or array of items, to the array starting at the index specified.\r\n * \r\n * Each item must be unique within the array.\r\n * \r\n * Existing elements in the array are shifted up.\r\n * \r\n * The array is modified in-place and returned.\r\n * \r\n * You can optionally specify a limit to the maximum size of the array. If the quantity of items being\r\n * added will take the array length over this limit, it will stop adding once the limit is reached.\r\n * \r\n * You can optionally specify a callback to be invoked for each item successfully added to the array.\r\n *\r\n * @function Phaser.Utils.Array.AddAt\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be added to.\r\n * @param {any|any[]} item - The item, or array of items, to add to the array.\r\n * @param {integer} [index=0] - The index in the array where the item will be inserted.\r\n * @param {integer} [limit] - Optional limit which caps the size of the array.\r\n * @param {function} [callback] - A callback to be invoked for each item successfully added to the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar AddAt = function (array, item, index, limit, callback, context)\r\n{\r\n if (index === undefined) { index = 0; }\r\n if (context === undefined) { context = array; }\r\n\r\n if (limit > 0)\r\n {\r\n var remaining = limit - array.length;\r\n\r\n // There's nothing more we can do here, the array is full\r\n if (remaining <= 0)\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // Fast path to avoid array mutation and iteration\r\n if (!Array.isArray(item))\r\n {\r\n if (array.indexOf(item) === -1)\r\n {\r\n array.splice(index, 0, item);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // If we got this far, we have an array of items to insert\r\n\r\n // Ensure all the items are unique\r\n var itemLength = item.length - 1;\r\n\r\n while (itemLength >= 0)\r\n {\r\n if (array.indexOf(item[itemLength]) !== -1)\r\n {\r\n // Already exists in array, so remove it\r\n item.pop();\r\n }\r\n\r\n itemLength--;\r\n }\r\n\r\n // Anything left?\r\n itemLength = item.length;\r\n\r\n if (itemLength === 0)\r\n {\r\n return null;\r\n }\r\n\r\n // Truncate to the limit\r\n if (limit > 0 && itemLength > remaining)\r\n {\r\n item.splice(remaining);\r\n\r\n itemLength = remaining;\r\n }\r\n\r\n for (var i = itemLength - 1; i >= 0; i--)\r\n {\r\n var entry = item[i];\r\n\r\n array.splice(index, 0, entry);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, entry);\r\n }\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = AddAt;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given element to the top of the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.BringToTop\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array.\r\n * @param {*} item - The element to move.\r\n *\r\n * @return {*} The element that was moved.\r\n */\r\nvar BringToTop = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex !== -1 && currentIndex < array.length)\r\n {\r\n array.splice(currentIndex, 1);\r\n array.push(item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = BringToTop;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = require('./SafeRange');\r\n\r\n/**\r\n * Returns the total number of elements in the array which have a property matching the given value.\r\n *\r\n * @function Phaser.Utils.Array.CountAllMatching\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} property - The property to test on each array element.\r\n * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex] - An optional start index to search from.\r\n * @param {integer} [endIndex] - An optional end index to search to.\r\n *\r\n * @return {integer} The total number of elements with properties matching the given value.\r\n */\r\nvar CountAllMatching = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n var total = 0;\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var child = array[i];\r\n\r\n if (child[property] === value)\r\n {\r\n total++;\r\n }\r\n }\r\n }\r\n\r\n return total;\r\n};\r\n\r\nmodule.exports = CountAllMatching;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Passes each element in the array to the given callback.\r\n *\r\n * @function Phaser.Utils.Array.Each\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {function} callback - A callback to be invoked for each item in the array.\r\n * @param {object} context - The context in which the callback is invoked.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar Each = function (array, callback, context)\r\n{\r\n var i;\r\n var args = [ null ];\r\n\r\n for (i = 3; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = 0; i < array.length; i++)\r\n {\r\n args[0] = array[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = Each;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = require('./SafeRange');\r\n\r\n/**\r\n * Passes each element in the array, between the start and end indexes, to the given callback.\r\n *\r\n * @function Phaser.Utils.Array.EachInRange\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {function} callback - A callback to be invoked for each item in the array.\r\n * @param {object} context - The context in which the callback is invoked.\r\n * @param {integer} startIndex - The start index to search from.\r\n * @param {integer} endIndex - The end index to search to.\r\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar EachInRange = function (array, callback, context, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n var i;\r\n var args = [ null ];\r\n\r\n for (i = 5; i < arguments.length; i++)\r\n {\r\n args.push(arguments[i]);\r\n }\r\n\r\n for (i = startIndex; i < endIndex; i++)\r\n {\r\n args[0] = array[i];\r\n\r\n callback.apply(context, args);\r\n }\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = EachInRange;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Searches a pre-sorted array for the closet value to the given number.\r\n *\r\n * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name,\r\n * and will check for the closest value of those to the given number.\r\n *\r\n * @function Phaser.Utils.Array.FindClosestInSorted\r\n * @since 3.0.0\r\n *\r\n * @param {number} value - The value to search for in the array.\r\n * @param {array} array - The array to search, which must be sorted.\r\n * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value.\r\n *\r\n * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value.\r\n */\r\nvar FindClosestInSorted = function (value, array, key)\r\n{\r\n if (!array.length)\r\n {\r\n return NaN;\r\n }\r\n else if (array.length === 1)\r\n {\r\n return array[0];\r\n }\r\n\r\n var i = 1;\r\n var low;\r\n var high;\r\n\r\n if (key)\r\n {\r\n if (value < array[0][key])\r\n {\r\n return array[0];\r\n }\r\n\r\n while (array[i][key] < value)\r\n {\r\n i++;\r\n }\r\n }\r\n else\r\n {\r\n while (array[i] < value)\r\n {\r\n i++;\r\n }\r\n }\r\n\r\n if (i > array.length)\r\n {\r\n i = array.length;\r\n }\r\n\r\n if (key)\r\n {\r\n low = array[i - 1][key];\r\n high = array[i][key];\r\n\r\n return ((high - value) <= (value - low)) ? array[i] : array[i - 1];\r\n }\r\n else\r\n {\r\n low = array[i - 1];\r\n high = array[i];\r\n\r\n return ((high - value) <= (value - low)) ? high : low;\r\n }\r\n};\r\n\r\nmodule.exports = FindClosestInSorted;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = require('./SafeRange');\r\n\r\n/**\r\n * Returns all elements in the array.\r\n *\r\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\r\n *\r\n * For example: `getAll('visible', true)` would return only elements that have their visible property set.\r\n *\r\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\r\n * the first 50 elements.\r\n *\r\n * @function Phaser.Utils.Array.GetAll\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} [property] - The property to test on each array element.\r\n * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex] - An optional start index to search from.\r\n * @param {integer} [endIndex] - An optional end index to search to.\r\n *\r\n * @return {array} All matching elements from the array.\r\n */\r\nvar GetAll = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n var output = [];\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var child = array[i];\r\n\r\n if (!property ||\r\n (property && value === undefined && child.hasOwnProperty(property)) ||\r\n (property && value !== undefined && child[property] === value))\r\n {\r\n output.push(child);\r\n }\r\n }\r\n }\r\n\r\n return output;\r\n};\r\n\r\nmodule.exports = GetAll;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = require('./SafeRange');\r\n\r\n/**\r\n * Returns the first element in the array.\r\n *\r\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\r\n *\r\n * For example: `getAll('visible', true)` would return the first element that had its `visible` property set.\r\n *\r\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements.\r\n *\r\n * @function Phaser.Utils.Array.GetFirst\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} [property] - The property to test on each array element.\r\n * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check.\r\n * @param {integer} [startIndex=0] - An optional start index to search from.\r\n * @param {integer} [endIndex=array.length] - An optional end index to search up to (but not included)\r\n *\r\n * @return {object} The first matching element from the array, or `null` if no element could be found in the range given.\r\n */\r\nvar GetFirst = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var child = array[i];\r\n\r\n if (!property ||\r\n (property && value === undefined && child.hasOwnProperty(property)) ||\r\n (property && value !== undefined && child[property] === value))\r\n {\r\n return child;\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\nmodule.exports = GetFirst;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Returns a Random element from the array.\r\n *\r\n * @function Phaser.Utils.Array.GetRandom\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to select the random entry from.\r\n * @param {integer} [startIndex=0] - An optional start index.\r\n * @param {integer} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from.\r\n *\r\n * @return {*} A random element from the array, or `null` if no element could be found in the range given.\r\n */\r\nvar GetRandom = function (array, startIndex, length)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (length === undefined) { length = array.length; }\r\n\r\n var randomIndex = startIndex + Math.floor(Math.random() * length);\r\n\r\n return (array[randomIndex] === undefined) ? null : array[randomIndex];\r\n};\r\n\r\nmodule.exports = GetRandom;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given array element down one place in the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.MoveDown\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The input array.\r\n * @param {*} item - The element to move down the array.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar MoveDown = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex > 0)\r\n {\r\n var item2 = array[currentIndex - 1];\r\n\r\n var index2 = array.indexOf(item2);\r\n\r\n array[currentIndex] = item2;\r\n array[index2] = item;\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = MoveDown;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves an element in an array to a new position within the same array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.MoveTo\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array.\r\n * @param {*} item - The element to move.\r\n * @param {integer} index - The new index that the element will be moved to.\r\n *\r\n * @return {*} The element that was moved.\r\n */\r\nvar MoveTo = function (array, item, index)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex === -1 || index < 0 || index >= array.length)\r\n {\r\n throw new Error('Supplied index out of bounds');\r\n }\r\n\r\n if (currentIndex !== index)\r\n {\r\n // Remove\r\n array.splice(currentIndex, 1);\r\n\r\n // Add in new location\r\n array.splice(index, 0, item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = MoveTo;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given array element up one place in the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.MoveUp\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The input array.\r\n * @param {*} item - The element to move up the array.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar MoveUp = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex !== -1 && currentIndex < array.length - 1)\r\n {\r\n // The element one above `item` in the array\r\n var item2 = array[currentIndex + 1];\r\n var index2 = array.indexOf(item2);\r\n\r\n array[currentIndex] = item2;\r\n array[index2] = item;\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = MoveUp;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Create an array representing the range of numbers (usually integers), between, and inclusive of,\n * the given `start` and `end` arguments. For example:\n *\n * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]`\n * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`\n * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]`\n *\n * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`.\n *\n * You can optionally provide a prefix and / or suffix string. If given the array will contain\n * strings, not integers. For example:\n *\n * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = [\"Level 1\", \"Level 2\", \"Level 3\", \"Level 4\"]`\n * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = [\"HD-5.png\", \"HD-6.png\", \"HD-7.png\"]`\n *\n * @function Phaser.Utils.Array.NumberArray\n * @since 3.0.0\n *\n * @param {number} start - The minimum value the array starts with.\n * @param {number} end - The maximum value the array contains.\n * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers.\n * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers.\n *\n * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided.\n */\nvar NumberArray = function (start, end, prefix, suffix)\n{\n var result = [];\n\n var i;\n var asString = false;\n\n if (prefix || suffix)\n {\n asString = true;\n\n if (!prefix)\n {\n prefix = '';\n }\n\n if (!suffix)\n {\n suffix = '';\n }\n }\n\n if (end < start)\n {\n for (i = start; i >= end; i--)\n {\n if (asString)\n {\n result.push(prefix + i.toString() + suffix);\n }\n else\n {\n result.push(i);\n }\n }\n }\n else\n {\n for (i = start; i <= end; i++)\n {\n if (asString)\n {\n result.push(prefix + i.toString() + suffix);\n }\n else\n {\n result.push(i);\n }\n }\n }\n\n return result;\n};\n\nmodule.exports = NumberArray;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RoundAwayFromZero = require('../../math/RoundAwayFromZero');\r\n\r\n/**\r\n * Create an array of numbers (positive and/or negative) progressing from `start`\r\n * up to but not including `end` by advancing by `step`.\r\n *\r\n * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified.\r\n *\r\n * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;\r\n * for forward compatibility make sure to pass in actual numbers.\r\n * \r\n * @example\r\n * NumberArrayStep(4);\r\n * // => [0, 1, 2, 3]\r\n *\r\n * NumberArrayStep(1, 5);\r\n * // => [1, 2, 3, 4]\r\n *\r\n * NumberArrayStep(0, 20, 5);\r\n * // => [0, 5, 10, 15]\r\n *\r\n * NumberArrayStep(0, -4, -1);\r\n * // => [0, -1, -2, -3]\r\n *\r\n * NumberArrayStep(1, 4, 0);\r\n * // => [1, 1, 1]\r\n *\r\n * NumberArrayStep(0);\r\n * // => []\r\n *\r\n * @function Phaser.Utils.Array.NumberArrayStep\r\n * @since 3.0.0\r\n *\r\n * @param {number} [start=0] - The start of the range.\r\n * @param {number} [end=null] - The end of the range.\r\n * @param {number} [step=1] - The value to increment or decrement by.\r\n *\r\n * @return {number[]} The array of number values.\r\n */\r\nvar NumberArrayStep = function (start, end, step)\r\n{\r\n if (start === undefined) { start = 0; }\r\n if (end === undefined) { end = null; }\r\n if (step === undefined) { step = 1; }\r\n\r\n if (end === null)\r\n {\r\n end = start;\r\n start = 0;\r\n }\r\n\r\n var result = [];\r\n\r\n var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0);\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n result.push(start);\r\n start += step;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nmodule.exports = NumberArrayStep;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction swap (arr, i, j)\r\n{\r\n var tmp = arr[i];\r\n arr[i] = arr[j];\r\n arr[j] = tmp;\r\n}\r\n\r\n/**\r\n * @ignore\r\n */\r\nfunction defaultCompare (a, b)\r\n{\r\n return a < b ? -1 : a > b ? 1 : 0;\r\n}\r\n\r\n/**\r\n * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm.\r\n *\r\n * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right];\r\n * The k-th element will have the (k - left + 1)th smallest value in [left, right].\r\n *\r\n * The array is modified in-place.\r\n *\r\n * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner)\r\n *\r\n * @function Phaser.Utils.Array.QuickSelect\r\n * @since 3.0.0\r\n *\r\n * @param {array} arr - The array to sort.\r\n * @param {integer} k - The k-th element index.\r\n * @param {integer} [left=0] - The index of the left part of the range.\r\n * @param {integer} [right] - The index of the right part of the range.\r\n * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1.\r\n */\r\nvar QuickSelect = function (arr, k, left, right, compare)\r\n{\r\n if (left === undefined) { left = 0; }\r\n if (right === undefined) { right = arr.length - 1; }\r\n if (compare === undefined) { compare = defaultCompare; }\r\n\r\n while (right > left)\r\n {\r\n if (right - left > 600)\r\n {\r\n var n = right - left + 1;\r\n var m = k - left + 1;\r\n var z = Math.log(n);\r\n var s = 0.5 * Math.exp(2 * z / 3);\r\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\r\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\r\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\r\n\r\n QuickSelect(arr, k, newLeft, newRight, compare);\r\n }\r\n\r\n var t = arr[k];\r\n var i = left;\r\n var j = right;\r\n\r\n swap(arr, left, k);\r\n\r\n if (compare(arr[right], t) > 0)\r\n {\r\n swap(arr, left, right);\r\n }\r\n\r\n while (i < j)\r\n {\r\n swap(arr, i, j);\r\n\r\n i++;\r\n j--;\r\n\r\n while (compare(arr[i], t) < 0)\r\n {\r\n i++;\r\n }\r\n\r\n while (compare(arr[j], t) > 0)\r\n {\r\n j--;\r\n }\r\n }\r\n\r\n if (compare(arr[left], t) === 0)\r\n {\r\n swap(arr, left, j);\r\n }\r\n else\r\n {\r\n j++;\r\n swap(arr, j, right);\r\n }\r\n\r\n if (j <= k)\r\n {\r\n left = j + 1;\r\n }\r\n\r\n if (k <= j)\r\n {\r\n right = j - 1;\r\n }\r\n }\r\n};\r\n\r\nmodule.exports = QuickSelect;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar GetValue = require('../object/GetValue');\r\nvar Shuffle = require('./Shuffle');\r\n\r\nvar BuildChunk = function (a, b, qty)\r\n{\r\n var out = [];\r\n\r\n for (var aIndex = 0; aIndex < a.length; aIndex++)\r\n {\r\n for (var bIndex = 0; bIndex < b.length; bIndex++)\r\n {\r\n for (var i = 0; i < qty; i++)\r\n {\r\n out.push({ a: a[aIndex], b: b[bIndex] });\r\n }\r\n }\r\n }\r\n\r\n return out;\r\n};\r\n\r\n/**\r\n * Creates an array populated with a range of values, based on the given arguments and configuration object.\r\n *\r\n * Range ([a,b,c], [1,2,3]) =\r\n * a1, a2, a3, b1, b2, b3, c1, c2, c3\r\n * \r\n * Range ([a,b], [1,2,3], qty = 3) =\r\n * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3\r\n * \r\n * Range ([a,b,c], [1,2,3], repeat x1) =\r\n * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3\r\n * \r\n * Range ([a,b], [1,2], repeat -1 = endless, max = 14) =\r\n * Maybe if max is set then repeat goes to -1 automatically?\r\n * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements)\r\n * \r\n * Range ([a], [1,2,3,4,5], random = true) =\r\n * a4, a1, a5, a2, a3\r\n * \r\n * Range ([a, b], [1,2,3], random = true) =\r\n * b3, a2, a1, b1, a3, b2\r\n * \r\n * Range ([a, b, c], [1,2,3], randomB = true) =\r\n * a3, a1, a2, b2, b3, b1, c1, c3, c2\r\n * \r\n * Range ([a], [1,2,3,4,5], yoyo = true) =\r\n * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1\r\n * \r\n * Range ([a, b], [1,2,3], yoyo = true) =\r\n * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1\r\n *\r\n * @function Phaser.Utils.Array.Range\r\n * @since 3.0.0\r\n *\r\n * @param {array} a - The first array of range elements.\r\n * @param {array} b - The second array of range elements.\r\n * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty.\r\n *\r\n * @return {array} An array of arranged elements.\r\n */\r\nvar Range = function (a, b, options)\r\n{\r\n var max = GetValue(options, 'max', 0);\r\n var qty = GetValue(options, 'qty', 1);\r\n var random = GetValue(options, 'random', false);\r\n var randomB = GetValue(options, 'randomB', false);\r\n var repeat = GetValue(options, 'repeat', 0);\r\n var yoyo = GetValue(options, 'yoyo', false);\r\n\r\n var out = [];\r\n\r\n if (randomB)\r\n {\r\n Shuffle(b);\r\n }\r\n\r\n // Endless repeat, so limit by max\r\n if (repeat === -1)\r\n {\r\n if (max === 0)\r\n {\r\n repeat = 0;\r\n }\r\n else\r\n {\r\n // Work out how many repeats we need\r\n var total = (a.length * b.length) * qty;\r\n\r\n if (yoyo)\r\n {\r\n total *= 2;\r\n }\r\n\r\n repeat = Math.ceil(max / total);\r\n }\r\n }\r\n\r\n for (var i = 0; i <= repeat; i++)\r\n {\r\n var chunk = BuildChunk(a, b, qty);\r\n\r\n if (random)\r\n {\r\n Shuffle(chunk);\r\n }\r\n\r\n out = out.concat(chunk);\r\n\r\n if (yoyo)\r\n {\r\n chunk.reverse();\r\n\r\n out = out.concat(chunk);\r\n }\r\n }\r\n\r\n if (max)\r\n {\r\n out.splice(max);\r\n }\r\n\r\n return out;\r\n};\r\n\r\nmodule.exports = Range;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SpliceOne = require('./SpliceOne');\r\n\r\n/**\r\n * Removes the given item, or array of items, from the array.\r\n * \r\n * The array is modified in-place.\r\n * \r\n * You can optionally specify a callback to be invoked for each item successfully removed from the array.\r\n *\r\n * @function Phaser.Utils.Array.Remove\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be modified.\r\n * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array.\r\n * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array.\r\n */\r\nvar Remove = function (array, item, callback, context)\r\n{\r\n if (context === undefined) { context = array; }\r\n\r\n var index;\r\n\r\n // Fast path to avoid array mutation and iteration\r\n if (!Array.isArray(item))\r\n {\r\n index = array.indexOf(item);\r\n\r\n if (index !== -1)\r\n {\r\n SpliceOne(array, index);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n }\r\n\r\n // If we got this far, we have an array of items to remove\r\n\r\n var itemLength = item.length - 1;\r\n\r\n while (itemLength >= 0)\r\n {\r\n var entry = item[itemLength];\r\n\r\n index = array.indexOf(entry);\r\n\r\n if (index !== -1)\r\n {\r\n SpliceOne(array, index);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, entry);\r\n }\r\n }\r\n else\r\n {\r\n // Item wasn't found in the array, so remove it from our return results\r\n item.pop();\r\n }\r\n\r\n itemLength--;\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = Remove;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SpliceOne = require('./SpliceOne');\r\n\r\n/**\r\n * Removes the item from the given position in the array.\r\n * \r\n * The array is modified in-place.\r\n * \r\n * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array.\r\n *\r\n * @function Phaser.Utils.Array.RemoveAt\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be modified.\r\n * @param {integer} index - The array index to remove the item from. The index must be in bounds or it will throw an error.\r\n * @param {function} [callback] - A callback to be invoked for the item removed from the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {*} The item that was removed.\r\n */\r\nvar RemoveAt = function (array, index, callback, context)\r\n{\r\n if (context === undefined) { context = array; }\r\n\r\n if (index < 0 || index > array.length - 1)\r\n {\r\n throw new Error('Index out of bounds');\r\n }\r\n\r\n var item = SpliceOne(array, index);\r\n\r\n if (callback)\r\n {\r\n callback.call(context, item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = RemoveAt;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = require('./SafeRange');\r\n\r\n/**\r\n * Removes the item within the given range in the array.\r\n * \r\n * The array is modified in-place.\r\n * \r\n * You can optionally specify a callback to be invoked for the item/s successfully removed from the array.\r\n *\r\n * @function Phaser.Utils.Array.RemoveBetween\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to be modified.\r\n * @param {integer} startIndex - The start index to remove from.\r\n * @param {integer} endIndex - The end index to remove to.\r\n * @param {function} [callback] - A callback to be invoked for the item removed from the array.\r\n * @param {object} [context] - The context in which the callback is invoked.\r\n *\r\n * @return {Array.<*>} An array of items that were removed.\r\n */\r\nvar RemoveBetween = function (array, startIndex, endIndex, callback, context)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n if (context === undefined) { context = array; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n var size = endIndex - startIndex;\r\n\r\n var removed = array.splice(startIndex, size);\r\n\r\n if (callback)\r\n {\r\n for (var i = 0; i < removed.length; i++)\r\n {\r\n var entry = removed[i];\r\n\r\n callback.call(context, entry);\r\n }\r\n }\r\n\r\n return removed;\r\n }\r\n else\r\n {\r\n return [];\r\n }\r\n};\r\n\r\nmodule.exports = RemoveBetween;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SpliceOne = require('./SpliceOne');\r\n\r\n/**\r\n * Removes a random object from the given array and returns it.\r\n * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index.\r\n *\r\n * @function Phaser.Utils.Array.RemoveRandomElement\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to removed a random element from.\r\n * @param {integer} [start=0] - The array index to start the search from.\r\n * @param {integer} [length=array.length] - Optional restriction on the number of elements to randomly select from.\r\n *\r\n * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range.\r\n */\r\nvar RemoveRandomElement = function (array, start, length)\r\n{\r\n if (start === undefined) { start = 0; }\r\n if (length === undefined) { length = array.length; }\r\n\r\n var randomIndex = start + Math.floor(Math.random() * length);\r\n\r\n return SpliceOne(array, randomIndex);\r\n};\r\n\r\nmodule.exports = RemoveRandomElement;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Replaces an element of the array with the new element.\r\n * The new element cannot already be a member of the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.Replace\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search within.\r\n * @param {*} oldChild - The element in the array that will be replaced.\r\n * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`.\r\n *\r\n * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false.\r\n */\r\nvar Replace = function (array, oldChild, newChild)\r\n{\r\n var index1 = array.indexOf(oldChild);\r\n var index2 = array.indexOf(newChild);\r\n\r\n if (index1 !== -1 && index2 === -1)\r\n {\r\n array[index1] = newChild;\r\n\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n};\r\n\r\nmodule.exports = Replace;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the element at the start of the array to the end, shifting all items in the process.\r\n * The \"rotation\" happens to the left.\r\n *\r\n * @function Phaser.Utils.Array.RotateLeft\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to shift to the left. This array is modified in place.\r\n * @param {integer} [total=1] - The number of times to shift the array.\r\n *\r\n * @return {*} The most recently shifted element.\r\n */\r\nvar RotateLeft = function (array, total)\r\n{\r\n if (total === undefined) { total = 1; }\r\n\r\n var element = null;\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n element = array.shift();\r\n array.push(element);\r\n }\r\n\r\n return element;\r\n};\r\n\r\nmodule.exports = RotateLeft;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the element at the end of the array to the start, shifting all items in the process.\r\n * The \"rotation\" happens to the right.\r\n *\r\n * @function Phaser.Utils.Array.RotateRight\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to shift to the right. This array is modified in place.\r\n * @param {integer} [total=1] - The number of times to shift the array.\r\n *\r\n * @return {*} The most recently shifted element.\r\n */\r\nvar RotateRight = function (array, total)\r\n{\r\n if (total === undefined) { total = 1; }\r\n\r\n var element = null;\r\n\r\n for (var i = 0; i < total; i++)\r\n {\r\n element = array.pop();\r\n array.unshift(element);\r\n }\r\n\r\n return element;\r\n};\r\n\r\nmodule.exports = RotateRight;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Tests if the start and end indexes are a safe range for the given array.\r\n * \r\n * @function Phaser.Utils.Array.SafeRange\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to check.\r\n * @param {integer} startIndex - The start index.\r\n * @param {integer} endIndex - The end index.\r\n * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds.\r\n *\r\n * @return {boolean} True if the range is safe, otherwise false.\r\n */\r\nvar SafeRange = function (array, startIndex, endIndex, throwError)\r\n{\r\n var len = array.length;\r\n\r\n if (startIndex < 0 ||\r\n startIndex > len ||\r\n startIndex >= endIndex ||\r\n endIndex > len ||\r\n startIndex + endIndex > len)\r\n {\r\n if (throwError)\r\n {\r\n throw new Error('Range Error: Values outside acceptable range');\r\n }\r\n\r\n return false;\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n};\r\n\r\nmodule.exports = SafeRange;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Moves the given element to the bottom of the array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.SendToBack\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array.\r\n * @param {*} item - The element to move.\r\n *\r\n * @return {*} The element that was moved.\r\n */\r\nvar SendToBack = function (array, item)\r\n{\r\n var currentIndex = array.indexOf(item);\r\n\r\n if (currentIndex !== -1 && currentIndex > 0)\r\n {\r\n array.splice(currentIndex, 1);\r\n array.unshift(item);\r\n }\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = SendToBack;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar SafeRange = require('./SafeRange');\r\n\r\n/**\r\n * Scans the array for elements with the given property. If found, the property is set to the `value`.\r\n *\r\n * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`.\r\n *\r\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\r\n * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements.\r\n *\r\n * @function Phaser.Utils.Array.SetAll\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The array to search.\r\n * @param {string} property - The property to test for on each array element.\r\n * @param {*} value - The value to set the property to.\r\n * @param {integer} [startIndex] - An optional start index to search from.\r\n * @param {integer} [endIndex] - An optional end index to search to.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar SetAll = function (array, property, value, startIndex, endIndex)\r\n{\r\n if (startIndex === undefined) { startIndex = 0; }\r\n if (endIndex === undefined) { endIndex = array.length; }\r\n\r\n if (SafeRange(array, startIndex, endIndex))\r\n {\r\n for (var i = startIndex; i < endIndex; i++)\r\n {\r\n var entry = array[i];\r\n\r\n if (entry.hasOwnProperty(property))\r\n {\r\n entry[property] = value;\r\n }\r\n }\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = SetAll;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Shuffles the contents of the given array using the Fisher-Yates implementation.\r\n *\r\n * The original array is modified directly and returned.\r\n *\r\n * @function Phaser.Utils.Array.Shuffle\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[]} - [array,$return]\r\n *\r\n * @param {T[]} array - The array to shuffle. This array is modified in place.\r\n *\r\n * @return {T[]} The shuffled array.\r\n */\r\nvar Shuffle = function (array)\r\n{\r\n for (var i = array.length - 1; i > 0; i--)\r\n {\r\n var j = Math.floor(Math.random() * (i + 1));\r\n var temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp;\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = Shuffle;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Takes the given array and runs a numeric sort on it, ignoring any non-digits that\n * may be in the entries.\n *\n * You should only run this on arrays containing strings.\n *\n * @function Phaser.Utils.Array.SortByDigits\n * @since 3.50.0\n *\n * @param {string[]} array - The input array of strings.\n *\n * @return {string[]} The sorted input array.\n */\nvar SortByDigits = function (array)\n{\n var re = /\\D/g;\n\n array.sort(function (a, b)\n {\n return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10));\n });\n\n return array;\n};\n\nmodule.exports = SortByDigits;\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Removes a single item from an array and returns it without creating gc, like the native splice does.\r\n * Based on code by Mike Reinstein.\r\n *\r\n * @function Phaser.Utils.Array.SpliceOne\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The array to splice from.\r\n * @param {integer} index - The index of the item which should be spliced.\r\n *\r\n * @return {*} The item which was spliced (removed).\r\n */\r\nvar SpliceOne = function (array, index)\r\n{\r\n if (index >= array.length)\r\n {\r\n return;\r\n }\r\n\r\n var len = array.length - 1;\r\n\r\n var item = array[index];\r\n\r\n for (var i = index; i < len; i++)\r\n {\r\n array[i] = array[i + 1];\r\n }\r\n\r\n array.length = len;\r\n\r\n return item;\r\n};\r\n\r\nmodule.exports = SpliceOne;\r\n","/**\r\n * @author Richard Davey \r\n * @author Angry Bytes (and contributors)\r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * The comparator function.\r\n *\r\n * @ignore\r\n *\r\n * @param {*} a - The first item to test.\r\n * @param {*} b - The second itemt to test.\r\n *\r\n * @return {boolean} True if they localCompare, otherwise false.\r\n */\r\nfunction Compare (a, b)\r\n{\r\n return String(a).localeCompare(b);\r\n}\r\n\r\n/**\r\n * Process the array contents.\r\n *\r\n * @ignore\r\n *\r\n * @param {array} array - The array to process.\r\n * @param {function} compare - The comparison function.\r\n *\r\n * @return {array} - The processed array.\r\n */\r\nfunction Process (array, compare)\r\n{\r\n // Short-circuit when there's nothing to sort.\r\n var len = array.length;\r\n\r\n if (len <= 1)\r\n {\r\n return array;\r\n }\r\n\r\n // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc.\r\n // Chunks are the size of the left or right hand in merge sort.\r\n // Stop when the left-hand covers all of the array.\r\n var buffer = new Array(len);\r\n\r\n for (var chk = 1; chk < len; chk *= 2)\r\n {\r\n RunPass(array, compare, chk, buffer);\r\n\r\n var tmp = array;\r\n\r\n array = buffer;\r\n\r\n buffer = tmp;\r\n }\r\n\r\n return array;\r\n}\r\n\r\n/**\r\n * Run a single pass with the given chunk size.\r\n *\r\n * @ignore\r\n *\r\n * @param {array} arr - The array to run the pass on.\r\n * @param {function} comp - The comparison function.\r\n * @param {number} chk - The number of iterations.\r\n * @param {array} result - The array to store the result in.\r\n */\r\nfunction RunPass (arr, comp, chk, result)\r\n{\r\n var len = arr.length;\r\n var i = 0;\r\n\r\n // Step size / double chunk size.\r\n var dbl = chk * 2;\r\n\r\n // Bounds of the left and right chunks.\r\n var l, r, e;\r\n\r\n // Iterators over the left and right chunk.\r\n var li, ri;\r\n\r\n // Iterate over pairs of chunks.\r\n for (l = 0; l < len; l += dbl)\r\n {\r\n r = l + chk;\r\n e = r + chk;\r\n\r\n if (r > len)\r\n {\r\n r = len;\r\n }\r\n\r\n if (e > len)\r\n {\r\n e = len;\r\n }\r\n\r\n // Iterate both chunks in parallel.\r\n li = l;\r\n ri = r;\r\n\r\n while (true)\r\n {\r\n // Compare the chunks.\r\n if (li < r && ri < e)\r\n {\r\n // This works for a regular `sort()` compatible comparator,\r\n // but also for a simple comparator like: `a > b`\r\n if (comp(arr[li], arr[ri]) <= 0)\r\n {\r\n result[i++] = arr[li++];\r\n }\r\n else\r\n {\r\n result[i++] = arr[ri++];\r\n }\r\n }\r\n else if (li < r)\r\n {\r\n // Nothing to compare, just flush what's left.\r\n result[i++] = arr[li++];\r\n }\r\n else if (ri < e)\r\n {\r\n result[i++] = arr[ri++];\r\n }\r\n else\r\n {\r\n // Both iterators are at the chunk ends.\r\n break;\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * An in-place stable array sort, because `Array#sort()` is not guaranteed stable.\r\n *\r\n * This is an implementation of merge sort, without recursion.\r\n *\r\n * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable\r\n *\r\n * @function Phaser.Utils.Array.StableSort\r\n * @since 3.0.0\r\n *\r\n * @param {array} array - The input array to be sorted.\r\n * @param {function} [compare] - The comparison function.\r\n *\r\n * @return {array} The sorted result.\r\n */\r\nvar StableSort = function (array, compare)\r\n{\r\n if (compare === undefined) { compare = Compare; }\r\n\r\n var result = Process(array, compare);\r\n\r\n // This simply copies back if the result isn't in the original array, which happens on an odd number of passes.\r\n if (result !== array)\r\n {\r\n RunPass(result, null, array.length, array);\r\n }\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = StableSort;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Swaps the position of two elements in the given array.\r\n * The elements must exist in the same array.\r\n * The array is modified in-place.\r\n *\r\n * @function Phaser.Utils.Array.Swap\r\n * @since 3.4.0\r\n *\r\n * @param {array} array - The input array.\r\n * @param {*} item1 - The first element to swap.\r\n * @param {*} item2 - The second element to swap.\r\n *\r\n * @return {array} The input array.\r\n */\r\nvar Swap = function (array, item1, item2)\r\n{\r\n if (item1 === item2)\r\n {\r\n return;\r\n }\r\n\r\n var index1 = array.indexOf(item1);\r\n var index2 = array.indexOf(item2);\r\n\r\n if (index1 < 0 || index2 < 0)\r\n {\r\n throw new Error('Supplied items must be elements of the same array');\r\n }\r\n\r\n array[index1] = item2;\r\n array[index2] = item1;\r\n\r\n return array;\r\n};\r\n\r\nmodule.exports = Swap;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Utils.Array\n */\n\nmodule.exports = {\n\n Matrix: require('./matrix'),\n\n Add: require('./Add'),\n AddAt: require('./AddAt'),\n BringToTop: require('./BringToTop'),\n CountAllMatching: require('./CountAllMatching'),\n Each: require('./Each'),\n EachInRange: require('./EachInRange'),\n FindClosestInSorted: require('./FindClosestInSorted'),\n GetAll: require('./GetAll'),\n GetFirst: require('./GetFirst'),\n GetRandom: require('./GetRandom'),\n MoveDown: require('./MoveDown'),\n MoveTo: require('./MoveTo'),\n MoveUp: require('./MoveUp'),\n NumberArray: require('./NumberArray'),\n NumberArrayStep: require('./NumberArrayStep'),\n QuickSelect: require('./QuickSelect'),\n Range: require('./Range'),\n Remove: require('./Remove'),\n RemoveAt: require('./RemoveAt'),\n RemoveBetween: require('./RemoveBetween'),\n RemoveRandomElement: require('./RemoveRandomElement'),\n Replace: require('./Replace'),\n RotateLeft: require('./RotateLeft'),\n RotateRight: require('./RotateRight'),\n SafeRange: require('./SafeRange'),\n SendToBack: require('./SendToBack'),\n SetAll: require('./SetAll'),\n Shuffle: require('./Shuffle'),\n SortByDigits: require('./SortByDigits'),\n SpliceOne: require('./SpliceOne'),\n StableSort: require('./StableSort'),\n Swap: require('./Swap')\n\n};\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Checks if an array can be used as a matrix.\r\n *\r\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows:\r\n *\r\n * ```\r\n * [\r\n * [ 1, 1, 1, 1, 1, 1 ],\r\n * [ 2, 0, 0, 0, 0, 4 ],\r\n * [ 2, 0, 1, 2, 0, 4 ],\r\n * [ 2, 0, 3, 4, 0, 4 ],\r\n * [ 2, 0, 0, 0, 0, 4 ],\r\n * [ 3, 3, 3, 3, 3, 3 ]\r\n * ]\r\n * ```\r\n *\r\n * @function Phaser.Utils.Array.Matrix.CheckMatrix\r\n * @since 3.0.0\r\n * \r\n * @generic T\r\n * @genericUse {T[][]} - [matrix]\r\n *\r\n * @param {T[][]} [matrix] - The array to check.\r\n *\r\n * @return {boolean} `true` if the given `matrix` array is a valid matrix.\r\n */\r\nvar CheckMatrix = function (matrix)\r\n{\r\n if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0]))\r\n {\r\n return false;\r\n }\r\n\r\n // How long is the first row?\r\n var size = matrix[0].length;\r\n\r\n // Validate the rest of the rows are the same length\r\n for (var i = 1; i < matrix.length; i++)\r\n {\r\n if (matrix[i].length !== size)\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nmodule.exports = CheckMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar Pad = require('../../string/Pad');\r\nvar CheckMatrix = require('./CheckMatrix');\r\n\r\n/**\r\n * Generates a string (which you can pass to console.log) from the given Array Matrix.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.MatrixToString\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix]\r\n *\r\n * @param {T[][]} [matrix] - A 2-dimensional array.\r\n *\r\n * @return {string} A string representing the matrix.\r\n */\r\nvar MatrixToString = function (matrix)\r\n{\r\n var str = '';\r\n\r\n if (!CheckMatrix(matrix))\r\n {\r\n return str;\r\n }\r\n\r\n for (var r = 0; r < matrix.length; r++)\r\n {\r\n for (var c = 0; c < matrix[r].length; c++)\r\n {\r\n var cell = matrix[r][c].toString();\r\n\r\n if (cell !== 'undefined')\r\n {\r\n str += Pad(cell, 2);\r\n }\r\n else\r\n {\r\n str += '?';\r\n }\r\n\r\n if (c < matrix[r].length - 1)\r\n {\r\n str += ' |';\r\n }\r\n }\r\n\r\n if (r < matrix.length - 1)\r\n {\r\n str += '\\n';\r\n\r\n for (var i = 0; i < matrix[r].length; i++)\r\n {\r\n str += '---';\r\n\r\n if (i < matrix[r].length - 1)\r\n {\r\n str += '+';\r\n }\r\n }\r\n\r\n str += '\\n';\r\n }\r\n\r\n }\r\n\r\n return str;\r\n};\r\n\r\nmodule.exports = MatrixToString;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Reverses the columns in the given Array Matrix.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.ReverseColumns\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array matrix to reverse the columns for.\r\n *\r\n * @return {T[][]} The column reversed matrix.\r\n */\r\nvar ReverseColumns = function (matrix)\r\n{\r\n return matrix.reverse();\r\n};\r\n\r\nmodule.exports = ReverseColumns;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Reverses the rows in the given Array Matrix.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.ReverseRows\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array matrix to reverse the rows for.\r\n *\r\n * @return {T[][]} The column reversed matrix.\r\n */\r\nvar ReverseRows = function (matrix)\r\n{\r\n for (var i = 0; i < matrix.length; i++)\r\n {\r\n matrix[i].reverse();\r\n }\r\n\r\n return matrix;\r\n};\r\n\r\nmodule.exports = ReverseRows;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateMatrix = require('./RotateMatrix');\r\n\r\n/**\r\n * Rotates the array matrix 180 degrees.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.Rotate180\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar Rotate180 = function (matrix)\r\n{\r\n return RotateMatrix(matrix, 180);\r\n};\r\n\r\nmodule.exports = Rotate180;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateMatrix = require('./RotateMatrix');\r\n\r\n/**\r\n * Rotates the array matrix to the left (or 90 degrees)\r\n *\r\n * @function Phaser.Utils.Array.Matrix.RotateLeft\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar RotateLeft = function (matrix)\r\n{\r\n return RotateMatrix(matrix, 90);\r\n};\r\n\r\nmodule.exports = RotateLeft;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CheckMatrix = require('./CheckMatrix');\r\nvar TransposeMatrix = require('./TransposeMatrix');\r\n\r\n/**\r\n * Rotates the array matrix based on the given rotation value.\r\n *\r\n * The value can be given in degrees: 90, -90, 270, -270 or 180,\r\n * or a string command: `rotateLeft`, `rotateRight` or `rotate180`.\r\n *\r\n * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.RotateMatrix\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n * @param {(number|string)} [direction=90] - The amount to rotate the matrix by.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar RotateMatrix = function (matrix, direction)\r\n{\r\n if (direction === undefined) { direction = 90; }\r\n\r\n if (!CheckMatrix(matrix))\r\n {\r\n return null;\r\n }\r\n\r\n if (typeof direction !== 'string')\r\n {\r\n direction = ((direction % 360) + 360) % 360;\r\n }\r\n\r\n if (direction === 90 || direction === -270 || direction === 'rotateLeft')\r\n {\r\n matrix = TransposeMatrix(matrix);\r\n matrix.reverse();\r\n }\r\n else if (direction === -90 || direction === 270 || direction === 'rotateRight')\r\n {\r\n matrix.reverse();\r\n matrix = TransposeMatrix(matrix);\r\n }\r\n else if (Math.abs(direction) === 180 || direction === 'rotate180')\r\n {\r\n for (var i = 0; i < matrix.length; i++)\r\n {\r\n matrix[i].reverse();\r\n }\r\n\r\n matrix.reverse();\r\n }\r\n\r\n return matrix;\r\n};\r\n\r\nmodule.exports = RotateMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar RotateMatrix = require('./RotateMatrix');\r\n\r\n/**\r\n * Rotates the array matrix to the left (or -90 degrees)\r\n *\r\n * @function Phaser.Utils.Array.Matrix.RotateRight\r\n * @since 3.0.0\r\n *\r\n * @generic T\r\n * @genericUse {T[][]} - [matrix,$return]\r\n *\r\n * @param {T[][]} [matrix] - The array to rotate.\r\n *\r\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\r\n */\r\nvar RotateRight = function (matrix)\r\n{\r\n return RotateMatrix(matrix, -90);\r\n};\r\n\r\nmodule.exports = RotateRight;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Transposes the elements of the given matrix (array of arrays).\r\n *\r\n * The transpose of a matrix is a new matrix whose rows are the columns of the original.\r\n *\r\n * @function Phaser.Utils.Array.Matrix.TransposeMatrix\r\n * @since 3.0.0\r\n * \r\n * @generic T\r\n * @genericUse {T[][]} - [array,$return]\r\n * \r\n * @param {T[][]} [array] - The array matrix to transpose.\r\n *\r\n * @return {T[][]} A new array matrix which is a transposed version of the given array.\r\n */\r\nvar TransposeMatrix = function (array)\r\n{\r\n var sourceRowCount = array.length;\r\n var sourceColCount = array[0].length;\r\n\r\n var result = new Array(sourceColCount);\r\n\r\n for (var i = 0; i < sourceColCount; i++)\r\n {\r\n result[i] = new Array(sourceRowCount);\r\n\r\n for (var j = sourceRowCount - 1; j > -1; j--)\r\n {\r\n result[i][j] = array[j][i];\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nmodule.exports = TransposeMatrix;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * @namespace Phaser.Utils.Array.Matrix\r\n */\r\n\r\nmodule.exports = {\r\n\r\n CheckMatrix: require('./CheckMatrix'),\r\n MatrixToString: require('./MatrixToString'),\r\n ReverseColumns: require('./ReverseColumns'),\r\n ReverseRows: require('./ReverseRows'),\r\n Rotate180: require('./Rotate180'),\r\n RotateLeft: require('./RotateLeft'),\r\n RotateMatrix: require('./RotateMatrix'),\r\n RotateRight: require('./RotateRight'),\r\n TransposeMatrix: require('./TransposeMatrix')\r\n\r\n};\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar IsPlainObject = require('./IsPlainObject');\r\n\r\n// @param {boolean} deep - Perform a deep copy?\r\n// @param {object} target - The target object to copy to.\r\n// @return {object} The extended object.\r\n\r\n/**\r\n * This is a slightly modified version of http://api.jquery.com/jQuery.extend/\r\n *\r\n * @function Phaser.Utils.Objects.Extend\r\n * @since 3.0.0\r\n *\r\n * @param {...*} [args] - The objects that will be mixed.\r\n *\r\n * @return {object} The extended object.\r\n */\r\nvar Extend = function ()\r\n{\r\n var options, name, src, copy, copyIsArray, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === 'boolean')\r\n {\r\n deep = target;\r\n target = arguments[1] || {};\r\n\r\n // skip the boolean and the target\r\n i = 2;\r\n }\r\n\r\n // extend Phaser if only one argument is passed\r\n if (length === i)\r\n {\r\n target = this;\r\n --i;\r\n }\r\n\r\n for (; i < length; i++)\r\n {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null)\r\n {\r\n // Extend the base object\r\n for (name in options)\r\n {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy)\r\n {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy))))\r\n {\r\n if (copyIsArray)\r\n {\r\n copyIsArray = false;\r\n clone = src && Array.isArray(src) ? src : [];\r\n }\r\n else\r\n {\r\n clone = src && IsPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = Extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n }\r\n else if (copy !== undefined)\r\n {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n};\r\n\r\nmodule.exports = Extend;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar MATH = require('../../math');\r\nvar GetValue = require('./GetValue');\r\n\r\n/**\r\n * Retrieves a value from an object. Allows for more advanced selection options, including:\r\n *\r\n * Allowed types:\r\n * \r\n * Implicit\r\n * {\r\n * x: 4\r\n * }\r\n *\r\n * From function\r\n * {\r\n * x: function ()\r\n * }\r\n *\r\n * Randomly pick one element from the array\r\n * {\r\n * x: [a, b, c, d, e, f]\r\n * }\r\n *\r\n * Random integer between min and max:\r\n * {\r\n * x: { randInt: [min, max] }\r\n * }\r\n *\r\n * Random float between min and max:\r\n * {\r\n * x: { randFloat: [min, max] }\r\n * }\r\n * \r\n *\r\n * @function Phaser.Utils.Objects.GetAdvancedValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetAdvancedValue = function (source, key, defaultValue)\r\n{\r\n var value = GetValue(source, key, null);\r\n\r\n if (value === null)\r\n {\r\n return defaultValue;\r\n }\r\n else if (Array.isArray(value))\r\n {\r\n return MATH.RND.pick(value);\r\n }\r\n else if (typeof value === 'object')\r\n {\r\n if (value.hasOwnProperty('randInt'))\r\n {\r\n return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]);\r\n }\r\n else if (value.hasOwnProperty('randFloat'))\r\n {\r\n return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]);\r\n }\r\n }\r\n else if (typeof value === 'function')\r\n {\r\n return value(key);\r\n }\r\n\r\n return value;\r\n};\r\n\r\nmodule.exports = GetAdvancedValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}\r\n *\r\n * @function Phaser.Utils.Objects.GetFastValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to search\r\n * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)\r\n * @param {*} [defaultValue] - The default value to use if the key does not exist.\r\n *\r\n * @return {*} The value if found; otherwise, defaultValue (null if none provided)\r\n */\r\nvar GetFastValue = function (source, key, defaultValue)\r\n{\r\n var t = typeof(source);\r\n\r\n if (!source || t === 'number' || t === 'string')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key) && source[key] !== undefined)\r\n {\r\n return source[key];\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetFastValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n// Source object\r\n// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'\r\n// The default value to use if the key doesn't exist\r\n\r\n/**\r\n * Retrieves a value from an object.\r\n *\r\n * @function Phaser.Utils.Objects.GetValue\r\n * @since 3.0.0\r\n *\r\n * @param {object} source - The object to retrieve the value from.\r\n * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object.\r\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\r\n *\r\n * @return {*} The value of the requested key.\r\n */\r\nvar GetValue = function (source, key, defaultValue)\r\n{\r\n if (!source || typeof source === 'number')\r\n {\r\n return defaultValue;\r\n }\r\n else if (source.hasOwnProperty(key))\r\n {\r\n return source[key];\r\n }\r\n else if (key.indexOf('.') !== -1)\r\n {\r\n var keys = key.split('.');\r\n var parent = source;\r\n var value = defaultValue;\r\n\r\n // Use for loop here so we can break early\r\n for (var i = 0; i < keys.length; i++)\r\n {\r\n if (parent.hasOwnProperty(keys[i]))\r\n {\r\n // Yes it has a key property, let's carry on down\r\n value = parent[keys[i]];\r\n\r\n parent = parent[keys[i]];\r\n }\r\n else\r\n {\r\n // Can't go any further, so reset to default\r\n value = defaultValue;\r\n break;\r\n }\r\n }\r\n\r\n return value;\r\n }\r\n else\r\n {\r\n return defaultValue;\r\n }\r\n};\r\n\r\nmodule.exports = GetValue;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * This is a slightly modified version of jQuery.isPlainObject.\r\n * A plain object is an object whose internal class property is [object Object].\r\n *\r\n * @function Phaser.Utils.Objects.IsPlainObject\r\n * @since 3.0.0\r\n *\r\n * @param {object} obj - The object to inspect.\r\n *\r\n * @return {boolean} `true` if the object is plain, otherwise `false`.\r\n */\r\nvar IsPlainObject = function (obj)\r\n{\r\n // Not plain objects:\r\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\r\n // - DOM nodes\r\n // - window\r\n if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window)\r\n {\r\n return false;\r\n }\r\n\r\n // Support: Firefox <20\r\n // The try/catch suppresses exceptions thrown when attempting to access\r\n // the \"constructor\" property of certain host objects, ie. |window.location|\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=814622\r\n try\r\n {\r\n if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'))\r\n {\r\n return false;\r\n }\r\n }\r\n catch (e)\r\n {\r\n return false;\r\n }\r\n\r\n // If the function hasn't returned already, we're confident that\r\n // |obj| is a plain object, created by {} or constructed with new Object\r\n return true;\r\n};\r\n\r\nmodule.exports = IsPlainObject;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\n/**\r\n * Takes the given string and pads it out, to the length required, using the character\r\n * specified. For example if you need a string to be 6 characters long, you can call:\r\n *\r\n * `pad('bob', 6, '-', 2)`\r\n *\r\n * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right.\r\n *\r\n * You can also use it to pad numbers (they are always returned as strings):\r\n * \r\n * `pad(512, 6, '0', 1)`\r\n *\r\n * Would return: `000512` with the string padded to the left.\r\n *\r\n * If you don't specify a direction it'll pad to both sides:\r\n * \r\n * `pad('c64', 7, '*')`\r\n *\r\n * Would return: `**c64**`\r\n *\r\n * @function Phaser.Utils.String.Pad\r\n * @since 3.0.0\r\n *\r\n * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers.\r\n * @param {integer} [len=0] - The number of characters to be added.\r\n * @param {string} [pad=\" \"] - The string to pad it out with (defaults to a space).\r\n * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both).\r\n * \r\n * @return {string} The padded string.\r\n */\r\nvar Pad = function (str, len, pad, dir)\r\n{\r\n if (len === undefined) { len = 0; }\r\n if (pad === undefined) { pad = ' '; }\r\n if (dir === undefined) { dir = 3; }\r\n\r\n str = str.toString();\r\n\r\n var padlen = 0;\r\n\r\n if (len + 1 >= str.length)\r\n {\r\n switch (dir)\r\n {\r\n case 1:\r\n str = new Array(len + 1 - str.length).join(pad) + str;\r\n break;\r\n\r\n case 3:\r\n var right = Math.ceil((padlen = len - str.length) / 2);\r\n var left = padlen - right;\r\n str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad);\r\n break;\r\n\r\n default:\r\n str = str + new Array(len + 1 - str.length).join(pad);\r\n break;\r\n }\r\n }\r\n\r\n return str;\r\n};\r\n\r\nmodule.exports = Pad;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2018 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetFastValue = require('../../../src/utils/object/GetFastValue');\r\nvar ImageFile = require('../../../src/loader/filetypes/ImageFile.js');\r\nvar IsPlainObject = require('../../../src/utils/object/IsPlainObject');\r\nvar JSONFile = require('../../../src/loader/filetypes/JSONFile.js');\r\nvar MultiFile = require('../../../src/loader/MultiFile.js');\r\nvar TextFile = require('../../../src/loader/filetypes/TextFile.js');\r\n\r\n/**\r\n * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig\r\n *\r\n * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager.\r\n * @property {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\".\r\n * @property {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @property {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not?\r\n * @property {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\r\n * @property {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\n\r\n/**\r\n * @classdesc\r\n * A Spine File suitable for loading by the Loader.\r\n *\r\n * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly.\r\n *\r\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine.\r\n *\r\n * @class SpineFile\r\n * @extends Phaser.Loader.MultiFile\r\n * @memberof Phaser.Loader.FileTypes\r\n * @constructor\r\n *\r\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\r\n * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object.\r\n * @param {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\".\r\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\r\n * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not?\r\n * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\r\n */\r\nvar SpineFile = new Class({\r\n\r\n Extends: MultiFile,\r\n\r\n initialize:\r\n\r\n function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var i;\r\n var json;\r\n var atlas;\r\n var files = [];\r\n var cache = loader.cacheManager.custom.spine;\r\n\r\n // atlas can be an array of atlas files, not just a single one\r\n\r\n if (IsPlainObject(key))\r\n {\r\n var config = key;\r\n\r\n key = GetFastValue(config, 'key');\r\n\r\n json = new JSONFile(loader, {\r\n key: key,\r\n url: GetFastValue(config, 'jsonURL'),\r\n extension: GetFastValue(config, 'jsonExtension', 'json'),\r\n xhrSettings: GetFastValue(config, 'jsonXhrSettings')\r\n });\r\n\r\n atlasURL = GetFastValue(config, 'atlasURL');\r\n preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha');\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, {\r\n key: key + '_' + i,\r\n url: atlasURL[i],\r\n extension: GetFastValue(config, 'atlasExtension', 'atlas'),\r\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\r\n });\r\n\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n else\r\n {\r\n json = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\r\n\r\n if (!Array.isArray(atlasURL))\r\n {\r\n atlasURL = [ atlasURL ];\r\n }\r\n\r\n for (i = 0; i < atlasURL.length; i++)\r\n {\r\n atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings);\r\n atlas.cache = cache;\r\n\r\n files.push(atlas);\r\n }\r\n }\r\n\r\n files.unshift(json);\r\n\r\n MultiFile.call(this, loader, 'spine', key, files);\r\n\r\n this.config.preMultipliedAlpha = preMultipliedAlpha;\r\n },\r\n\r\n /**\r\n * Called by each File when it finishes loading.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Loader.File} file - The File that has completed processing.\r\n */\r\n onFileComplete: function (file)\r\n {\r\n var index = this.files.indexOf(file);\r\n\r\n if (index !== -1)\r\n {\r\n this.pending--;\r\n\r\n if (file.type === 'text')\r\n {\r\n // Inspect the data for the files to now load\r\n var content = file.data.split('\\n');\r\n\r\n // Extract the textures\r\n var textures = [];\r\n\r\n for (var t = 0; t < content.length; t++)\r\n {\r\n var line = content[t];\r\n\r\n if (line.trim() === '' && t < content.length - 1)\r\n {\r\n line = content[t + 1];\r\n\r\n textures.push(line);\r\n }\r\n }\r\n\r\n var config = this.config;\r\n var loader = this.loader;\r\n\r\n var currentBaseURL = loader.baseURL;\r\n var currentPath = loader.path;\r\n var currentPrefix = loader.prefix;\r\n\r\n var baseURL = GetFastValue(config, 'baseURL', this.baseURL);\r\n var path = GetFastValue(config, 'path', file.src.match(/^.*\\//))[0];\r\n var prefix = GetFastValue(config, 'prefix', this.prefix);\r\n var textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\r\n\r\n loader.setBaseURL(baseURL);\r\n loader.setPath(path);\r\n loader.setPrefix(prefix);\r\n\r\n for (var i = 0; i < textures.length; i++)\r\n {\r\n var textureURL = textures[i];\r\n\r\n var key = this.prefix + textureURL;\r\n\r\n var image = new ImageFile(loader, key, textureURL, textureXhrSettings);\r\n\r\n this.addToMultiFile(image);\r\n\r\n loader.addFile(image);\r\n }\r\n\r\n // Reset the loader settings\r\n loader.setBaseURL(currentBaseURL);\r\n loader.setPath(currentPath);\r\n loader.setPrefix(currentPrefix);\r\n }\r\n }\r\n },\r\n\r\n /**\r\n * Adds this file to its target cache upon successful loading and processing.\r\n *\r\n * @method Phaser.Loader.FileTypes.SpineFile#addToCache\r\n * @since 3.19.0\r\n */\r\n addToCache: function ()\r\n {\r\n if (this.isReadyToProcess())\r\n {\r\n var fileJSON = this.files[0];\r\n\r\n fileJSON.addToCache();\r\n\r\n var atlasCache;\r\n var atlasKey = '';\r\n var combinedAtlasData = '';\r\n var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false;\r\n var textureManager = this.loader.textureManager;\r\n\r\n for (var i = 1; i < this.files.length; i++)\r\n {\r\n var file = this.files[i];\r\n\r\n if (file.type === 'text')\r\n {\r\n atlasKey = file.key.replace(/_[\\d]$/, '');\r\n\r\n atlasCache = file.cache;\r\n\r\n combinedAtlasData = combinedAtlasData.concat(file.data);\r\n }\r\n else\r\n {\r\n var src = file.key.trim();\r\n var pos = src.indexOf('_');\r\n var key = src.substr(pos + 1);\r\n\r\n if (!textureManager.exists(key))\r\n {\r\n textureManager.addImage(key, file.data);\r\n }\r\n }\r\n\r\n file.pendingDestroy();\r\n }\r\n\r\n atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlasData, prefix: this.prefix });\r\n\r\n this.complete = true;\r\n }\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineFile;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar BuildGameObject = require('../../../src/gameobjects/BuildGameObject');\r\nvar Class = require('../../../src/utils/Class');\r\nvar GetValue = require('../../../src/utils/object/GetValue');\r\nvar ResizeEvent = require('../../../src/scale/events/RESIZE_EVENT');\r\nvar ScenePlugin = require('../../../src/plugins/ScenePlugin');\r\nvar Spine = require('Spine');\r\nvar SpineFile = require('./SpineFile');\r\nvar SpineGameObject = require('./gameobject/SpineGameObject');\r\nvar SpineContainer = require('./container/SpineContainer');\r\nvar NOOP = require('../../../src/utils/NOOP');\r\n\r\n/**\r\n * @classdesc\r\n * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game Objects.\r\n *\r\n * Find more details about Spine itself at http://esotericsoftware.com/.\r\n *\r\n * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin\r\n * uses the Spine 3.8.95 runtimes. Please note that due to the way the Spine runtimes use semver, you will\r\n * get breaking changes in point-releases. Therefore, files created in a different version of Spine may not\r\n * work as a result, without you first updating the runtimes and rebuilding the plugin.\r\n *\r\n * Esoteric themselves recommend that you freeze your Spine editor version against the runtime versions.\r\n * You can find more information about this here: http://esotericsoftware.com/spine-settings#Version\r\n *\r\n * Please note that you require a Spine license in order to use Spine Runtimes in your games.\r\n *\r\n * You can install this plugin into your Phaser game by either importing it, if you're using ES6:\r\n *\r\n * ```javascript\r\n * import * as SpinePlugin from './SpinePlugin.js';\r\n * ```\r\n *\r\n * and then adding it to your Phaser Game configuration:\r\n *\r\n * ```javascript\r\n * plugins: {\r\n * scene: [\r\n * { key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' }\r\n * ]\r\n * }\r\n * ```\r\n *\r\n * If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your\r\n * Game Configuration object, like this:\r\n *\r\n * ```javascript\r\n * scene: {\r\n * preload: preload,\r\n * create: create,\r\n * pack: {\r\n * files: [\r\n * { type: 'scenePlugin', key: 'SpinePlugin', url: 'plugins/SpinePlugin.js', sceneKey: 'spine' }\r\n * ]\r\n * }\r\n * }\r\n * ```\r\n *\r\n * Loading it like this allows you to then use commands such as `this.load.spine` from within the\r\n * same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal\r\n * Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any\r\n * subsequent Scenes.\r\n *\r\n * Assuming a default environment you access it from within a Scene by using the `this.spine` reference.\r\n *\r\n * When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load\r\n * Spine files directly, i.e.:\r\n *\r\n * ```javascript\r\n * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true);\r\n * ```\r\n *\r\n * It also installs two Game Object Factory methods, allowing you to create Spine Game Objects\r\n * and Spine Containers:\r\n *\r\n * ```javascript\r\n * const man = this.add.spine(512, 650, 'stretchyman');\r\n *\r\n * const container = this.add.spineContainer();\r\n *\r\n * container.add(man);\r\n * ```\r\n *\r\n * The first argument is the key which you used when importing the Spine data. There are lots of\r\n * things you can specify, such as the animation name, skeleton, slot attachments and more. Please\r\n * see the respective documentation and examples for further details.\r\n *\r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary.\r\n * The associated atlas files are scanned for any texture files present in them, which are then loaded.\r\n * If you have exported your Spine data with preMultipliedAlpha set, then you should enable this in the\r\n * load arguments, or you may see black outlines around skeleton textures.\r\n *\r\n * The Spine plugin is local to the Scene in which it is installed. This means a change to something,\r\n * such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene.\r\n * The only exception to this is with the caches this plugin creates. Spine atlas and texture data are\r\n * stored in their own caches, which are global, meaning they're accessible from any Scene in your\r\n * game, regardless if the Scene loaded the Spine data or not.\r\n *\r\n * When destroying a Phaser Game instance, if you need to re-create it again on the same page without\r\n * reloading, you must remember to remove the Spine Plugin as part of your tear-down process:\r\n *\r\n * ```javascript\r\n * this.plugins.removeScenePlugin('SpinePlugin');\r\n * ```\r\n *\r\n * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference\r\n *\r\n * @class SpinePlugin\r\n * @extends Phaser.Plugins.ScenePlugin\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\r\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager.\r\n */\r\nvar SpinePlugin = new Class({\r\n\r\n Extends: ScenePlugin,\r\n\r\n initialize:\r\n\r\n function SpinePlugin (scene, pluginManager)\r\n {\r\n ScenePlugin.call(this, scene, pluginManager);\r\n\r\n var game = pluginManager.game;\r\n\r\n /**\r\n * A read-only flag that indicates if the game is running under WebGL or Canvas.\r\n *\r\n * @name SpinePlugin#isWebGL\r\n * @type {boolean}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.isWebGL = (game.config.renderType === 2);\r\n\r\n /**\r\n * A custom cache that stores the Spine atlas data.\r\n *\r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#cache\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.cache = game.cache.addCustom('spine');\r\n\r\n /**\r\n * A custom cache that stores the Spine Textures.\r\n *\r\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\r\n * no matter which Scene you are in.\r\n *\r\n * @name SpinePlugin#spineTextures\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.spineTextures = game.cache.addCustom('spineTextures');\r\n\r\n /**\r\n * A reference to the global JSON Cache.\r\n *\r\n * @name SpinePlugin#json\r\n * @type {Phaser.Cache.BaseCache}\r\n * @since 3.19.0\r\n */\r\n this.json = game.cache.json;\r\n\r\n /**\r\n * A reference to the global Texture Manager.\r\n *\r\n * @name SpinePlugin#textures\r\n * @type {Phaser.Textures.TextureManager}\r\n * @since 3.19.0\r\n */\r\n this.textures = game.textures;\r\n\r\n /**\r\n * A flag that sets if the Skeleton Renderers will render debug information over the top\r\n * of the skeleton or not.\r\n *\r\n * @name SpinePlugin#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The underlying WebGL context of the Phaser renderer.\r\n *\r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#gl\r\n * @type {WebGLRenderingContext}\r\n * @since 3.19.0\r\n */\r\n this.gl;\r\n\r\n /**\r\n * A reference to either the Canvas or WebGL Renderer that this Game is using.\r\n *\r\n * @name SpinePlugin#renderer\r\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.renderer;\r\n\r\n /**\r\n * An instance of the Spine WebGL Scene Renderer.\r\n *\r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#sceneRenderer\r\n * @type {spine.webgl.SceneRenderer}\r\n * @since 3.19.0\r\n */\r\n this.sceneRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Renderer.\r\n *\r\n * @name SpinePlugin#skeletonRenderer\r\n * @type {(spine.canvas.SkeletonRenderer|spine.webgl.SkeletonRenderer)}\r\n * @since 3.19.0\r\n */\r\n this.skeletonRenderer;\r\n\r\n /**\r\n * An instance of the Spine Skeleton Debug Renderer.\r\n *\r\n * Only set if running in WebGL mode.\r\n *\r\n * @name SpinePlugin#skeletonDebugRenderer\r\n * @type {spine.webgl.skeletonDebugRenderer}\r\n * @since 3.19.0\r\n */\r\n this.skeletonDebugRenderer;\r\n\r\n /**\r\n * A reference to the Spine runtime.\r\n * This is the runtime created by Esoteric Software\r\n *\r\n * @name SpinePlugin#plugin\r\n * @type {spine}\r\n * @since 3.19.0\r\n */\r\n this.plugin = Spine;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp1\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp1;\r\n\r\n /**\r\n * An internal vector3 used by the screen to world method.\r\n *\r\n * @name SpinePlugin#temp2\r\n * @private\r\n * @type {spine.webgl.Vector3}\r\n * @since 3.19.0\r\n */\r\n this.temp2;\r\n\r\n if (this.isWebGL)\r\n {\r\n this.runtime = Spine.webgl;\r\n\r\n this.renderer = game.renderer;\r\n this.gl = game.renderer.gl;\r\n\r\n this.getAtlas = this.getAtlasWebGL;\r\n }\r\n else\r\n {\r\n this.runtime = Spine.canvas;\r\n\r\n this.renderer = game.renderer;\r\n\r\n this.getAtlas = this.getAtlasCanvas;\r\n }\r\n\r\n // Headless mode?\r\n if (!this.renderer)\r\n {\r\n this.renderer = {\r\n width: game.scale.width,\r\n height: game.scale.height,\r\n preRender: NOOP,\r\n postRender: NOOP,\r\n render: NOOP,\r\n destroy: NOOP\r\n };\r\n }\r\n\r\n var _this = this;\r\n\r\n var add = function (x, y, key, animationName, loop)\r\n {\r\n var spineGO = new SpineGameObject(this.scene, _this, x, y, key, animationName, loop);\r\n\r\n this.displayList.add(spineGO);\r\n this.updateList.add(spineGO);\r\n\r\n return spineGO;\r\n };\r\n\r\n var make = function (config, addToScene)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var key = GetValue(config, 'key', null);\r\n var animationName = GetValue(config, 'animationName', null);\r\n var loop = GetValue(config, 'loop', false);\r\n\r\n var spineGO = new SpineGameObject(this.scene, _this, 0, 0, key, animationName, loop);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, spineGO, config);\r\n\r\n // Spine specific\r\n var skinName = GetValue(config, 'skinName', false);\r\n\r\n if (skinName)\r\n {\r\n spineGO.setSkinByName(skinName);\r\n }\r\n\r\n var slotName = GetValue(config, 'slotName', false);\r\n var attachmentName = GetValue(config, 'attachmentName', null);\r\n\r\n if (slotName)\r\n {\r\n spineGO.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return spineGO.refresh();\r\n };\r\n\r\n var addContainer = function (x, y, children)\r\n {\r\n var spineGO = new SpineContainer(this.scene, _this, x, y, children);\r\n\r\n this.displayList.add(spineGO);\r\n\r\n return spineGO;\r\n };\r\n\r\n var makeContainer = function (config, addToScene)\r\n {\r\n if (config === undefined) { config = {}; }\r\n\r\n var x = GetValue(config, 'x', 0);\r\n var y = GetValue(config, 'y', 0);\r\n var children = GetValue(config, 'children', null);\r\n\r\n var container = new SpineContainer(this.scene, _this, x, y, children);\r\n\r\n if (addToScene !== undefined)\r\n {\r\n config.add = addToScene;\r\n }\r\n\r\n BuildGameObject(this.scene, container, config);\r\n\r\n return container;\r\n };\r\n\r\n pluginManager.registerFileType('spine', this.spineFileCallback, scene);\r\n pluginManager.registerGameObject('spine', add, make);\r\n pluginManager.registerGameObject('spineContainer', addContainer, makeContainer);\r\n },\r\n\r\n /**\r\n * Internal boot handler.\r\n *\r\n * @method SpinePlugin#boot\r\n * @private\r\n * @since 3.19.0\r\n */\r\n boot: function ()\r\n {\r\n if (this.isWebGL)\r\n {\r\n this.bootWebGL();\r\n this.onResize();\r\n this.game.scale.on(ResizeEvent, this.onResize, this);\r\n }\r\n else\r\n {\r\n this.bootCanvas();\r\n }\r\n\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.once('shutdown', this.shutdown, this);\r\n eventEmitter.once('destroy', this.destroy, this);\r\n\r\n this.game.events.once('destroy', this.gameDestroy, this);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the Canvas Renderer.\r\n *\r\n * @method SpinePlugin#bootCanvas\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootCanvas: function ()\r\n {\r\n this.skeletonRenderer = new Spine.canvas.SkeletonRenderer(this.scene.sys.context);\r\n },\r\n\r\n /**\r\n * Internal boot handler for the WebGL Renderer.\r\n *\r\n * @method SpinePlugin#bootWebGL\r\n * @private\r\n * @since 3.19.0\r\n */\r\n bootWebGL: function ()\r\n {\r\n this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true);\r\n\r\n // Monkeypatch the Spine setBlendMode functions, or batching is destroyed!\r\n\r\n var setBlendMode = function (srcBlend, dstBlend)\r\n {\r\n if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend)\r\n {\r\n var gl = this.context.gl;\r\n\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n\r\n if (this.isDrawing)\r\n {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n }\r\n };\r\n\r\n this.sceneRenderer.batcher.setBlendMode = setBlendMode;\r\n this.sceneRenderer.shapes.setBlendMode = setBlendMode;\r\n\r\n this.skeletonRenderer = this.sceneRenderer.skeletonRenderer;\r\n this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer;\r\n\r\n this.temp1 = new Spine.webgl.Vector3(0, 0, 0);\r\n this.temp2 = new Spine.webgl.Vector3(0, 0, 0);\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasCanvas\r\n * @since 3.19.0\r\n *\r\n * @param {string} key - The key of the Spine Atlas to create.\r\n *\r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasCanvas: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = spineTextures.get(key);\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n return new Spine.canvas.CanvasTexture(textures.get(atlasEntry.prefix + path).getSourceImage());\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\r\n * then returns it. You do not normally need to invoke this method directly.\r\n *\r\n * @method SpinePlugin#getAtlasWebGL\r\n * @since 3.19.0\r\n *\r\n * @param {string} key - The key of the Spine Atlas to create.\r\n *\r\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\r\n */\r\n getAtlasWebGL: function (key)\r\n {\r\n var atlasEntry = this.cache.get(key);\r\n\r\n if (!atlasEntry)\r\n {\r\n console.warn('No atlas data for: ' + key);\r\n return;\r\n }\r\n\r\n var atlas;\r\n var spineTextures = this.spineTextures;\r\n\r\n if (spineTextures.has(key))\r\n {\r\n atlas = spineTextures.get(key);\r\n }\r\n else\r\n {\r\n var textures = this.textures;\r\n\r\n var gl = this.sceneRenderer.context.gl;\r\n\r\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\r\n\r\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\r\n {\r\n return new Spine.webgl.GLTexture(gl, textures.get(atlasEntry.prefix + path).getSourceImage(), false);\r\n });\r\n }\r\n\r\n return atlas;\r\n },\r\n\r\n /**\r\n * Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue.\r\n *\r\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('spineBoy', 'boy.json', 'boy.atlas', true);\r\n * }\r\n * ```\r\n *\r\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\r\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\r\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\r\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\r\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\r\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\r\n * loaded.\r\n *\r\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\r\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\r\n *\r\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated\r\n * atlas files are scanned for any texture files present in them, which are then loaded. If you have exported\r\n * your Spine data with preMultipliedAlpha set, then you should enable this in the arguments, or you may see black\r\n * outlines around skeleton textures.\r\n *\r\n * The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load.\r\n * The key should be unique both in terms of files being loaded and files already present in the Spine cache.\r\n * Loading a file using a key that is already taken will result in a warning.\r\n *\r\n * Instead of passing arguments you can pass a configuration object, such as:\r\n *\r\n * ```javascript\r\n * this.load.spine({\r\n * key: 'mainmenu',\r\n * jsonURL: 'boy.json',\r\n * atlasURL: 'boy.atlas',\r\n * preMultipliedAlpha: true\r\n * });\r\n * ```\r\n *\r\n * If you need to load multiple Spine atlas files, provide them as an array:\r\n *\r\n * ```javascript\r\n * function preload ()\r\n * {\r\n * this.load.spine('demos', 'demos.json', [ 'atlas1.atlas', 'atlas2.atlas' ], true);\r\n * }\r\n * ```\r\n *\r\n * See the documentation for `Phaser.Types.Loader.FileTypes.SpineFileConfig` for more details.\r\n *\r\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\r\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\r\n * this is what you would use to retrieve the data from the Spine plugin.\r\n *\r\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\r\n *\r\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\r\n * and no URL is given then the Loader will set the URL to be \"alien.json\". It will always add `.json` as the extension, although\r\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\r\n *\r\n * Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser.\r\n *\r\n * @method Phaser.Loader.LoaderPlugin#spine\r\n * @fires Phaser.Loader.LoaderPlugin#ADD\r\n * @since 3.19.0\r\n *\r\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\r\n * @param {string} jsonURL - The absolute or relative URL to load the Spine json file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\".\r\n * @param {string|string[]} atlasURL - The absolute or relative URL to load the Spine atlas file from. If undefined or `null` it will be set to `.atlas`, i.e. if `key` was \"alien\" then the URL will be \"alien.atlas\".\r\n * @param {boolean} [preMultipliedAlpha=false] - Do the texture files include pre-multiplied alpha or not?\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings.\r\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings.\r\n *\r\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\r\n */\r\n spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\r\n {\r\n var multifile;\r\n\r\n if (Array.isArray(key))\r\n {\r\n for (var i = 0; i < key.length; i++)\r\n {\r\n multifile = new SpineFile(this, key[i]);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n }\r\n else\r\n {\r\n multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings);\r\n\r\n this.addFile(multifile.files);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Converts the given x and y screen coordinates into the world space of the given Skeleton.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#worldToLocal\r\n * @since 3.19.0\r\n *\r\n * @param {number} x - The screen space x coordinate to convert.\r\n * @param {number} y - The screen space y coordinate to convert.\r\n * @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into.\r\n * @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into.\r\n *\r\n * @return {spine.Vector2} A Vector2 containing the translated point.\r\n */\r\n worldToLocal: function (x, y, skeleton, bone)\r\n {\r\n var temp1 = this.temp1;\r\n var temp2 = this.temp2;\r\n var camera = this.sceneRenderer.camera;\r\n\r\n temp1.set(x + skeleton.x, y - skeleton.y, 0);\r\n\r\n var width = camera.viewportWidth;\r\n var height = camera.viewportHeight;\r\n\r\n camera.screenToWorld(temp1, width, height);\r\n\r\n if (bone && bone.parent !== null)\r\n {\r\n bone.parent.worldToLocal(temp2.set(temp1.x - skeleton.x, temp1.y - skeleton.y, 0));\r\n\r\n return new Spine.Vector2(temp2.x, temp2.y);\r\n }\r\n else if (bone)\r\n {\r\n return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y);\r\n }\r\n else\r\n {\r\n return new Spine.Vector2(temp1.x, temp1.y);\r\n }\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x and y values.\r\n *\r\n * @method SpinePlugin#getVector2\r\n * @since 3.19.0\r\n *\r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n *\r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector2: function (x, y)\r\n {\r\n return new Spine.Vector2(x, y);\r\n },\r\n\r\n /**\r\n * Returns a Spine Vector2 based on the given x, y and z values.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#getVector3\r\n * @since 3.19.0\r\n *\r\n * @param {number} x - The Vector x value.\r\n * @param {number} y - The Vector y value.\r\n * @param {number} z - The Vector z value.\r\n *\r\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\r\n */\r\n getVector3: function (x, y, z)\r\n {\r\n return new Spine.webgl.Vector3(x, y, z);\r\n },\r\n\r\n /**\r\n * Sets `drawBones` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBones\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBones: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBones = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugRegionAttachments\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugRegionAttachments: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawRegionAttachments = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugBoundingBoxes\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugBoundingBoxes: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawBoundingBoxes = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshHull` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshHull\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshHull: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshHull = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugMeshTriangles\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugMeshTriangles: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawMeshTriangles = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawPaths` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugPaths\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugPaths: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawPaths = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugSkeletonXY\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugSkeletonXY: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawSkeletonXY = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets `drawClipping` in the Spine Skeleton Debug Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setDebugClipping\r\n * @since 3.19.0\r\n *\r\n * @param {boolean} [value=true] - The value to set in the debug property.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setDebugClipping: function (value)\r\n {\r\n if (value === undefined) { value = true; }\r\n\r\n this.skeletonDebugRenderer.drawClipping = value;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the given vertex effect on the Spine Skeleton Renderer.\r\n *\r\n * Only works in WebGL.\r\n *\r\n * @method SpinePlugin#setEffect\r\n * @since 3.19.0\r\n *\r\n * @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer.\r\n *\r\n * @return {this} This Spine Plugin.\r\n */\r\n setEffect: function (effect)\r\n {\r\n this.sceneRenderer.skeletonRenderer.vertexEffect = effect;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Creates a Spine Skeleton based on the given key and optional Skeleton JSON data.\r\n *\r\n * The Skeleton data should have already been loaded before calling this method.\r\n *\r\n * @method SpinePlugin#createSkeleton\r\n * @since 3.19.0\r\n *\r\n * @param {string} key - The key of the Spine skeleton data, as loaded by the plugin. If the Spine JSON contains multiple skeletons, reference them with a period, i.e. `set.spineBoy`.\r\n * @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache.\r\n *\r\n * @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid.\r\n */\r\n createSkeleton: function (key, skeletonJSON)\r\n {\r\n var atlasKey = key;\r\n var jsonKey = key;\r\n var split = (key.indexOf('.') !== -1);\r\n\r\n if (split)\r\n {\r\n var parts = key.split('.');\r\n\r\n atlasKey = parts.shift();\r\n jsonKey = parts.join('.');\r\n }\r\n\r\n var atlasData = this.cache.get(atlasKey);\r\n var atlas = this.getAtlas(atlasKey);\r\n\r\n if (!atlas)\r\n {\r\n return null;\r\n }\r\n\r\n if (!this.spineTextures.has(atlasKey))\r\n {\r\n this.spineTextures.add(atlasKey, atlas);\r\n }\r\n\r\n var preMultipliedAlpha = atlasData.preMultipliedAlpha;\r\n\r\n var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);\r\n\r\n var skeletonJson = new Spine.SkeletonJson(atlasLoader);\r\n\r\n var data;\r\n\r\n if (skeletonJSON)\r\n {\r\n data = skeletonJSON;\r\n }\r\n else\r\n {\r\n var json = this.json.get(atlasKey);\r\n\r\n data = (split) ? GetValue(json, jsonKey) : json;\r\n }\r\n\r\n if (data)\r\n {\r\n var skeletonData = skeletonJson.readSkeletonData(data);\r\n\r\n var skeleton = new Spine.Skeleton(skeletonData);\r\n\r\n return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha };\r\n }\r\n else\r\n {\r\n return null;\r\n }\r\n },\r\n\r\n /**\r\n * Creates a new Animation State and Animation State Data for the given skeleton.\r\n *\r\n * The returned object contains two properties: `state` and `stateData` respectively.\r\n *\r\n * @method SpinePlugin#createAnimationState\r\n * @since 3.19.0\r\n *\r\n * @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for.\r\n *\r\n * @return {any} An object containing the Animation State and Animation State Data instances.\r\n */\r\n createAnimationState: function (skeleton)\r\n {\r\n var stateData = new Spine.AnimationStateData(skeleton.data);\r\n\r\n var state = new Spine.AnimationState(stateData);\r\n\r\n return { stateData: stateData, state: state };\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n *\r\n * The returned object contains two properties: `offset` and `size`:\r\n *\r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpinePlugin#getBounds\r\n * @since 3.19.0\r\n *\r\n * @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from.\r\n *\r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function (skeleton)\r\n {\r\n var offset = new Spine.Vector2();\r\n var size = new Spine.Vector2();\r\n\r\n skeleton.getBounds(offset, size, []);\r\n\r\n return { offset: offset, size: size };\r\n },\r\n\r\n /**\r\n * Internal handler for when the renderer resizes.\r\n *\r\n * Only called if running in WebGL.\r\n *\r\n * @method SpinePlugin#onResize\r\n * @since 3.19.0\r\n */\r\n onResize: function ()\r\n {\r\n var renderer = this.renderer;\r\n var sceneRenderer = this.sceneRenderer;\r\n\r\n var viewportWidth = renderer.width;\r\n var viewportHeight = renderer.height;\r\n\r\n sceneRenderer.camera.position.x = viewportWidth / 2;\r\n sceneRenderer.camera.position.y = viewportHeight / 2;\r\n\r\n sceneRenderer.camera.viewportWidth = viewportWidth;\r\n sceneRenderer.camera.viewportHeight = viewportHeight;\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is shutting down.\r\n *\r\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\r\n *\r\n * @method SpinePlugin#shutdown\r\n * @private\r\n * @since 3.19.0\r\n */\r\n shutdown: function ()\r\n {\r\n var eventEmitter = this.systems.events;\r\n\r\n eventEmitter.off('shutdown', this.shutdown, this);\r\n\r\n if (this.isWebGL)\r\n {\r\n this.game.scale.off(ResizeEvent, this.onResize, this);\r\n }\r\n },\r\n\r\n /**\r\n * The Scene that owns this plugin is being destroyed.\r\n *\r\n * We need to shutdown and then kill off all external references.\r\n *\r\n * @method SpinePlugin#destroy\r\n * @private\r\n * @since 3.19.0\r\n */\r\n destroy: function ()\r\n {\r\n this.shutdown();\r\n\r\n this.game = null;\r\n this.scene = null;\r\n this.systems = null;\r\n\r\n this.cache = null;\r\n this.spineTextures = null;\r\n this.json = null;\r\n this.textures = null;\r\n this.skeletonRenderer = null;\r\n this.gl = null;\r\n },\r\n\r\n /**\r\n * The Game that owns this plugin is being destroyed.\r\n *\r\n * Dispose of the Scene Renderer and remove the Game Objects.\r\n *\r\n * @method SpinePlugin#gameDestroy\r\n * @private\r\n * @since 3.50.0\r\n */\r\n gameDestroy: function ()\r\n {\r\n this.destroy();\r\n\r\n if (this.sceneRenderer)\r\n {\r\n this.sceneRenderer.dispose();\r\n }\r\n\r\n this.sceneRenderer = null;\r\n this.pluginManager = null;\r\n\r\n this.pluginManager.removeGameObject('spine', true, true);\r\n this.pluginManager.removeGameObject('spineContainer', true, true);\r\n }\r\n\r\n});\r\n\r\nSpinePlugin.SpineGameObject = SpineGameObject;\r\nSpinePlugin.SpineContainer = SpineContainer;\r\n\r\n/**\r\n * Creates a new Spine Game Object and adds it to the Scene.\r\n *\r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n *\r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n *\r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n *\r\n * The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it.\r\n *\r\n * The animation name is also optional and can be set later via `SpineGameObject.setAnimation`.\r\n *\r\n * Should you wish for more control over the object creation, such as setting a slot attachment or skin\r\n * name, then use `SpinePlugin.make` instead.\r\n *\r\n * @method SpinePlugin#add\r\n * @since 3.19.0\r\n *\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n\r\n/**\r\n * Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene.\r\n *\r\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\r\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\r\n * do not have a Phaser origin.\r\n *\r\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\r\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\r\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\r\n * that.\r\n *\r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 500, y: 500, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-idle', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n *\r\n * @method SpinePlugin#make\r\n * @since 3.19.0\r\n *\r\n * @param {any} config - The configuration object this Game Object will use to create itself.\r\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\r\n *\r\n * @return {SpineGameObject} The Game Object that was created.\r\n */\r\n\r\nmodule.exports = SpinePlugin;\r\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar Class = require('../../../../src/utils/Class');\r\nvar Container = require('../../../../src/gameobjects/container/Container');\r\nvar SpineContainerRender = require('./SpineContainerRender');\r\n\r\n/**\r\n * @classdesc\r\n * A Spine Container is a special kind of Container created specifically for Spine Game Objects.\r\n *\r\n * You have all of the same features of a standard Container, but the rendering functions are optimized specifically\r\n * for Spine Game Objects. You must only add ever Spine Game Objects to this type of Container. Although Phaser will\r\n * not prevent you from adding other types, they will not render and are likely to throw runtime errors.\r\n *\r\n * To create one in a Scene, use the factory methods:\r\n *\r\n * ```javascript\r\n * this.add.spinecontainer();\r\n * ```\r\n *\r\n * or\r\n *\r\n * ```javascript\r\n * this.make.spinecontainer();\r\n * ```\r\n *\r\n * See the Container documentation for further details about what Containers can do.\r\n *\r\n * @class SpineContainer\r\n * @extends Phaser.GameObjects.Container\r\n * @constructor\r\n * @since 3.50.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to.\r\n * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container.\r\n */\r\nvar SpineContainer = new Class({\r\n\r\n Extends: Container,\r\n\r\n Mixins: [\r\n SpineContainerRender\r\n ],\r\n\r\n initialize:\r\n\r\n function SpineContainer (scene, plugin, x, y, children)\r\n {\r\n Container.call(this, scene, x, y, children);\r\n\r\n // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching\r\n this.type = 'Spine';\r\n\r\n /**\r\n * A reference to the Spine Plugin.\r\n *\r\n * @name SpineContainer#plugin\r\n * @type {SpinePlugin}\r\n * @since 3.50.0\r\n */\r\n this.plugin = plugin;\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method SpineContainer#preDestroy\r\n * @protected\r\n * @since 3.50.0\r\n */\r\n preDestroy: function ()\r\n {\r\n this.removeAll(!!this.exclusive);\r\n\r\n this.localTransform.destroy();\r\n this.tempTransformMatrix.destroy();\r\n\r\n this.list = [];\r\n this._displayList = null;\r\n this.plugin = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineContainer;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Renders this Game Object with the Canvas Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method Phaser.GameObjects.Container#renderCanvas\n * @since 3.4.0\n * @private\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar SpineContainerCanvasRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix)\n{\n var children = container.list;\n\n if (children.length === 0)\n {\n return;\n }\n\n var transformMatrix = container.localTransform;\n\n if (parentMatrix)\n {\n transformMatrix.loadIdentity();\n transformMatrix.multiply(parentMatrix);\n transformMatrix.translate(container.x, container.y);\n transformMatrix.rotate(container.rotation);\n transformMatrix.scale(container.scaleX, container.scaleY);\n }\n else\n {\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\n }\n\n var containerHasBlendMode = (container.blendMode !== -1);\n\n if (!containerHasBlendMode)\n {\n // If Container is SKIP_TEST then set blend mode to be Normal\n renderer.setBlendMode(0);\n }\n\n var alpha = container._alpha;\n var scrollFactorX = container.scrollFactorX;\n var scrollFactorY = container.scrollFactorY;\n\n if (container.mask)\n {\n container.mask.preRenderCanvas(renderer, null, camera);\n }\n\n for (var i = 0; i < children.length; i++)\n {\n var child = children[i];\n\n if (!child.willRender(camera))\n {\n continue;\n }\n\n var childAlpha = child.alpha;\n var childScrollFactorX = child.scrollFactorX;\n var childScrollFactorY = child.scrollFactorY;\n\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\n {\n // If Container doesn't have its own blend mode, then a child can have one\n renderer.setBlendMode(child.blendMode);\n }\n\n // Set parent values\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\n child.setAlpha(childAlpha * alpha);\n\n // Render\n child.renderCanvas(renderer, child, interpolationPercentage, camera, transformMatrix);\n\n // Restore original values\n child.setAlpha(childAlpha);\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\n }\n\n if (container.mask)\n {\n container.mask.postRenderCanvas(renderer);\n }\n};\n\nmodule.exports = SpineContainerCanvasRenderer;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar renderWebGL = require('../../../../src/utils/NOOP');\nvar renderCanvas = require('../../../../src/utils/NOOP');\n\nif (typeof WEBGL_RENDERER)\n{\n renderWebGL = require('./SpineContainerWebGLRenderer');\n}\n\nif (typeof CANVAS_RENDERER)\n{\n renderCanvas = require('./SpineContainerCanvasRenderer');\n}\n\nmodule.exports = {\n\n renderWebGL: renderWebGL,\n renderCanvas: renderCanvas\n\n};\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\r\n */\r\n\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar Clamp = require('../../../../src/math/Clamp');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar Wrap = require('../../../../src/math/Wrap');\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method SpineContainerWebGLRenderer#renderWebGL\r\n * @since 3.50.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var plugin = container.plugin;\r\n var sceneRenderer = plugin.sceneRenderer;\r\n var children = container.list;\r\n\r\n if (children.length === 0)\r\n {\r\n if (sceneRenderer.batcher.isDrawing && renderer.finalType)\r\n {\r\n sceneRenderer.end();\r\n\r\n renderer.pipelines.rebind();\r\n }\r\n\r\n return;\r\n }\r\n\r\n var transformMatrix = container.localTransform;\r\n\r\n if (parentMatrix)\r\n {\r\n transformMatrix.loadIdentity();\r\n transformMatrix.multiply(parentMatrix);\r\n transformMatrix.translate(container.x, container.y);\r\n transformMatrix.rotate(container.rotation);\r\n transformMatrix.scale(container.scaleX, container.scaleY);\r\n }\r\n else\r\n {\r\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\r\n }\r\n\r\n var alpha = container.alpha;\r\n var scrollFactorX = container.scrollFactorX;\r\n var scrollFactorY = container.scrollFactorY;\r\n\r\n var GameObjectRenderMask = 15;\r\n\r\n if (renderer.newType)\r\n {\r\n // flush + clear if this is a new type\r\n renderer.pipelines.clear();\r\n\r\n sceneRenderer.begin();\r\n }\r\n\r\n for (var i = 0; i < children.length; i++)\r\n {\r\n var src = children[i];\r\n\r\n var skeleton = src.skeleton;\r\n var childAlpha = skeleton.color.a;\r\n\r\n var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0);\r\n\r\n if (!skeleton || !willRender)\r\n {\r\n continue;\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(transformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n\r\n var viewportHeight = renderer.height;\r\n\r\n skeleton.x = calcMatrix.tx;\r\n skeleton.y = viewportHeight - calcMatrix.ty;\r\n\r\n skeleton.scaleX = calcMatrix.scaleX;\r\n skeleton.scaleY = calcMatrix.scaleY;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n skeleton.scaleX *= -1;\r\n\r\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\r\n }\r\n else\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\r\n }\r\n\r\n if (src.scaleY < 0)\r\n {\r\n skeleton.scaleY *= -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n else\r\n {\r\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n }\r\n\r\n if (camera.renderToTexture || renderer.currentFramebuffer !== null)\r\n {\r\n skeleton.y = calcMatrix.ty;\r\n skeleton.scaleY *= -1;\r\n }\r\n\r\n // Add autoUpdate option\r\n skeleton.updateWorldTransform();\r\n\r\n skeleton.color.a = Clamp(childAlpha * alpha, 0, 1);\r\n\r\n // Draw the current skeleton\r\n sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha);\r\n\r\n // Restore alpha\r\n skeleton.color.a = childAlpha;\r\n }\r\n\r\n if (!renderer.nextTypeMatch)\r\n {\r\n // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch\r\n sceneRenderer.end();\r\n\r\n // And rebind the previous pipeline\r\n renderer.pipelines.rebind();\r\n }\r\n};\r\n\r\nmodule.exports = SpineContainerWebGLRenderer;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Complete Event.\n *\n * @event SpinePluginEvents#COMPLETE\n * @since 3.19.0\n */\nmodule.exports = 'complete';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Dispose Event.\n *\n * @event SpinePluginEvents#DISPOSE\n * @since 3.19.0\n */\nmodule.exports = 'dispose';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The End Event.\n *\n * @event SpinePluginEvents#END\n * @since 3.19.0\n */\nmodule.exports = 'end';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Custom Event Event.\n *\n * @event SpinePluginEvents#EVENT\n * @since 3.19.0\n */\nmodule.exports = 'event';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Interrupted Event.\n *\n * @event SpinePluginEvents#INTERRUPTED\n * @since 3.19.0\n */\nmodule.exports = 'interrupted';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Start Event.\n *\n * @event SpinePluginEvents#START\n * @since 3.19.0\n */\nmodule.exports = 'start';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace SpinePluginEvents\n */\n\nmodule.exports = {\n\n COMPLETE: require('./COMPLETE_EVENT'),\n DISPOSE: require('./DISPOSE_EVENT'),\n END: require('./END_EVENT'),\n EVENT: require('./EVENT_EVENT'),\n INTERRUPTED: require('./INTERRUPTED_EVENT'),\n START: require('./START_EVENT')\n\n};\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar AngleBetween = require('../../../../src/math/angle/Between');\r\nvar Clamp = require('../../../../src/math/Clamp');\r\nvar Class = require('../../../../src/utils/Class');\r\nvar ComponentsComputedSize = require('../../../../src/gameobjects/components/ComputedSize');\r\nvar ComponentsDepth = require('../../../../src/gameobjects/components/Depth');\r\nvar ComponentsFlip = require('../../../../src/gameobjects/components/Flip');\r\nvar ComponentsScrollFactor = require('../../../../src/gameobjects/components/ScrollFactor');\r\nvar ComponentsTransform = require('../../../../src/gameobjects/components/Transform');\r\nvar ComponentsVisible = require('../../../../src/gameobjects/components/Visible');\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar DegToRad = require('../../../../src/math/DegToRad');\r\nvar GameObject = require('../../../../src/gameobjects/GameObject');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar SpineEvents = require('../events/');\r\nvar SpineGameObjectRender = require('./SpineGameObjectRender');\r\n\r\n/**\r\n * @classdesc\r\n * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates\r\n * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to\r\n * easily change the skin, slot attachment, bone positions and more.\r\n *\r\n * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly.\r\n * You can only create them if the Spine plugin has been loaded into Phaser.\r\n *\r\n * The quickest way is the Game Object Factory:\r\n *\r\n * ```javascript\r\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\r\n * ```\r\n *\r\n * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly`\r\n * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is\r\n * an optional animation to start playing on the skeleton. The final argument `true` sets the\r\n * animation to loop. Look at the documentation for further details on each of these options.\r\n *\r\n * For more control, you can use the Game Object Creator, passing in a Spine Game Object\r\n * Configuration object:\r\n *\r\n * ```javascript\r\n * let jelly = this.make.spine({\r\n * x: 512, y: 550, key: 'jelly',\r\n * scale: 1.5,\r\n * skinName: 'square_Green',\r\n * animationName: 'jelly-think', loop: true,\r\n * slotName: 'hat', attachmentName: 'images/La_14'\r\n * });\r\n * ```\r\n *\r\n * Here, you've got the ability to specify extra details, such as the slot name, attachments or\r\n * overall scale.\r\n *\r\n * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to\r\n * update and render, it must be added to the display and update lists of your Scene:\r\n *\r\n * ```javascript\r\n * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true);\r\n * this.sys.displayList.add(jelly);\r\n * this.sys.updateList.add(jelly);\r\n * ```\r\n *\r\n * It's possible to enable Spine Game Objects for input, but you should be aware that it will use\r\n * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but\r\n * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created.\r\n * If it's not suitable, provide your own shape to the `setInteractive` method.\r\n *\r\n * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for\r\n * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game\r\n * Object position with it. See the examples for further details.\r\n *\r\n * If your Spine Game Object has black outlines around the different parts of the texture when it\r\n * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have\r\n * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details.\r\n *\r\n * @class SpineGameObject\r\n * @constructor\r\n * @since 3.19.0\r\n *\r\n * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to.\r\n * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin.\r\n * @param {number} x - The horizontal position of this Game Object in the world.\r\n * @param {number} y - The vertical position of this Game Object in the world.\r\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\r\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\r\n */\r\nvar SpineGameObject = new Class({\r\n\r\n Extends: GameObject,\r\n\r\n Mixins: [\r\n ComponentsComputedSize,\r\n ComponentsDepth,\r\n ComponentsFlip,\r\n ComponentsScrollFactor,\r\n ComponentsTransform,\r\n ComponentsVisible,\r\n SpineGameObjectRender\r\n ],\r\n\r\n initialize:\r\n\r\n function SpineGameObject (scene, plugin, x, y, key, animationName, loop)\r\n {\r\n GameObject.call(this, scene, 'Spine');\r\n\r\n /**\r\n * A reference to the Spine Plugin.\r\n *\r\n * @name SpineGameObject#plugin\r\n * @type {SpinePlugin}\r\n * @since 3.19.0\r\n */\r\n this.plugin = plugin;\r\n\r\n /**\r\n * The Spine Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeleton\r\n * @type {spine.Skeleton}\r\n * @since 3.19.0\r\n */\r\n this.skeleton = null;\r\n\r\n /**\r\n * The Spine Skeleton Data associated with the Skeleton this Game Object is using.\r\n *\r\n * @name SpineGameObject#skeletonData\r\n * @type {spine.SkeletonData}\r\n * @since 3.19.0\r\n */\r\n this.skeletonData = null;\r\n\r\n /**\r\n * The Spine Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#state\r\n * @type {spine.AnimationState}\r\n * @since 3.19.0\r\n */\r\n this.state = null;\r\n\r\n /**\r\n * The Spine Animation State Data associated with the Animation State this Game Object is using.\r\n *\r\n * @name SpineGameObject#stateData\r\n * @type {spine.AnimationStateData}\r\n * @since 3.19.0\r\n */\r\n this.stateData = null;\r\n\r\n /**\r\n * A reference to the root bone of the Skeleton.\r\n *\r\n * @name SpineGameObject#root\r\n * @type {spine.Bone}\r\n * @since 3.19.0\r\n */\r\n this.root = null;\r\n\r\n /**\r\n * This object holds the calculated bounds of the current\r\n * pose, as set when a new Skeleton is applied.\r\n *\r\n * @name SpineGameObject#bounds\r\n * @type {any}\r\n * @since 3.19.0\r\n */\r\n this.bounds = null;\r\n\r\n /**\r\n * A Game Object level flag that allows you to enable debug drawing\r\n * to the Skeleton Debug Renderer by toggling it.\r\n *\r\n * @name SpineGameObject#drawDebug\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.drawDebug = false;\r\n\r\n /**\r\n * The factor to scale the Animation update time by.\r\n *\r\n * @name SpineGameObject#timeScale\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.timeScale = 1;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginX\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginX = 0;\r\n\r\n /**\r\n * The calculated Display Origin of this Game Object.\r\n *\r\n * @name SpineGameObject#displayOriginY\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n this.displayOriginY = 0;\r\n\r\n /**\r\n * A flag that stores if the texture associated with the current\r\n * Skin being used by this Game Object, has its alpha pre-multiplied\r\n * into it, or not.\r\n *\r\n * @name SpineGameObject#preMultipliedAlpha\r\n * @type {boolean}\r\n * @since 3.19.0\r\n */\r\n this.preMultipliedAlpha = false;\r\n\r\n /**\r\n * A default Blend Mode. You cannot change the blend mode of a\r\n * Spine Game Object.\r\n *\r\n * @name SpineGameObject#blendMode\r\n * @type {number}\r\n * @readonly\r\n * @since 3.19.0\r\n */\r\n this.blendMode = -1;\r\n\r\n this.setPosition(x, y);\r\n\r\n if (key)\r\n {\r\n this.setSkeleton(key, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Overrides the default Game Object method and always returns true.\r\n * Rendering is decided in the renderer functions.\r\n *\r\n * @method SpineGameObject#willRender\r\n * @since 3.19.0\r\n *\r\n * @return {boolean} Always returns `true`.\r\n */\r\n willRender: function ()\r\n {\r\n return true;\r\n },\r\n\r\n /**\r\n * Set the Alpha level for the whole Skeleton of this Game Object.\r\n *\r\n * The alpha controls the opacity of the Game Object as it renders.\r\n *\r\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\r\n *\r\n * @method SpineGameObject#setAlpha\r\n * @since 3.19.0\r\n *\r\n * @param {number} [value=1] - The alpha value used for the whole Skeleton.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setAlpha: function (value, slotName)\r\n {\r\n if (value === undefined) { value = 1; }\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n slot.color.a = Clamp(value, 0, 1);\r\n }\r\n }\r\n else\r\n {\r\n this.alpha = value;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The alpha value of the Skeleton.\r\n *\r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#alpha\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n alpha: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.a;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.a = v;\r\n }\r\n\r\n if (v === 0)\r\n {\r\n this.renderFlags &= ~2;\r\n }\r\n else\r\n {\r\n this.renderFlags |= 2;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of red used when rendering the Skeleton.\r\n *\r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#red\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n red: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.r;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.r = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of green used when rendering the Skeleton.\r\n *\r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#green\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n green: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.g;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.g = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The amount of blue used when rendering the Skeleton.\r\n *\r\n * A value between 0 and 1.\r\n *\r\n * This is a global value, impacting the entire Skeleton, not just a region of it.\r\n *\r\n * @name SpineGameObject#blue\r\n * @type {number}\r\n * @since 3.19.0\r\n */\r\n blue: {\r\n\r\n get: function ()\r\n {\r\n return this.skeleton.color.b;\r\n },\r\n\r\n set: function (value)\r\n {\r\n var v = Clamp(value, 0, 1);\r\n\r\n if (this.skeleton)\r\n {\r\n this.skeleton.color.b = v;\r\n }\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton.\r\n *\r\n * @method SpineGameObject#setColor\r\n * @since 3.19.0\r\n *\r\n * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color.\r\n * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton.\r\n *\r\n * @return {this} This Game Object instance.\r\n */\r\n setColor: function (color, slotName)\r\n {\r\n if (color === undefined) { color = 0xffffff; }\r\n\r\n var red = (color >> 16 & 0xFF) / 255;\r\n var green = (color >> 8 & 0xFF) / 255;\r\n var blue = (color & 0xFF) / 255;\r\n var alpha = (color > 16777215) ? (color >>> 24) / 255 : null;\r\n\r\n var target = this.skeleton;\r\n\r\n if (slotName)\r\n {\r\n var slot = this.findSlot(slotName);\r\n\r\n if (slot)\r\n {\r\n target = slot;\r\n }\r\n }\r\n\r\n target.color.r = red;\r\n target.color.g = green;\r\n target.color.b = blue;\r\n\r\n if (alpha !== null)\r\n {\r\n target.color.a = alpha;\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object\r\n * that contains the Skeleton data.\r\n *\r\n * @method SpineGameObject#setSkeletonFromJSON\r\n * @since 3.19.0\r\n *\r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop)\r\n {\r\n return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop);\r\n },\r\n\r\n /**\r\n * Sets this Game Object to use the given Skeleton based on its cache key.\r\n *\r\n * Typically, once set, the Skeleton doesn't change. Instead, you change the skin,\r\n * or slot attachment, or any other property to adjust it.\r\n *\r\n * @method SpineGameObject#setSkeleton\r\n * @since 3.19.0\r\n *\r\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\r\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\r\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\r\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON)\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON);\r\n\r\n this.skeletonData = data.skeletonData;\r\n\r\n this.preMultipliedAlpha = data.preMultipliedAlpha;\r\n\r\n var skeleton = data.skeleton;\r\n\r\n skeleton.setSkin();\r\n skeleton.setToSetupPose();\r\n\r\n this.skeleton = skeleton;\r\n\r\n // AnimationState\r\n data = this.plugin.createAnimationState(skeleton);\r\n\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.state = data.state;\r\n this.stateData = data.stateData;\r\n\r\n this.state.addListener({\r\n event: this.onEvent.bind(this),\r\n complete: this.onComplete.bind(this),\r\n start: this.onStart.bind(this),\r\n end: this.onEnd.bind(this),\r\n dispose: this.onDispose.bind(this),\r\n interrupted: this.onInterrupted.bind(this)\r\n });\r\n\r\n if (animationName)\r\n {\r\n this.setAnimation(0, animationName, loop);\r\n }\r\n\r\n this.root = this.getRootBone();\r\n\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.state.apply(skeleton);\r\n\r\n skeleton.updateCache();\r\n\r\n return this.updateSize();\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onComplete event via this Game Object.\r\n *\r\n * @method SpineGameObject#onComplete\r\n * @fires SpinePluginEvents#COMPLETE\r\n * @private\r\n * @since 3.19.0\r\n *\r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onComplete: function (entry)\r\n {\r\n this.emit(SpineEvents.COMPLETE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onDispose event via this Game Object.\r\n *\r\n * @method SpineGameObject#onDispose\r\n * @fires SpinePluginEvents#DISPOSE\r\n * @private\r\n * @since 3.19.0\r\n *\r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onDispose: function (entry)\r\n {\r\n this.emit(SpineEvents.DISPOSE, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onEnd event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEnd\r\n * @fires SpinePluginEvents#END\r\n * @private\r\n * @since 3.19.0\r\n *\r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onEnd: function (entry)\r\n {\r\n this.emit(SpineEvents.END, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine Event event via this Game Object.\r\n *\r\n * @method SpineGameObject#onEvent\r\n * @fires SpinePluginEvents#EVENT\r\n * @private\r\n * @since 3.19.0\r\n *\r\n * @param {any} entry - The event data from Spine.\r\n * @param {spine.Event} event - The Spine event.\r\n */\r\n onEvent: function (entry, event)\r\n {\r\n this.emit(SpineEvents.EVENT, entry, event);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onInterrupted event via this Game Object.\r\n *\r\n * @method SpineGameObject#onInterrupted\r\n * @fires SpinePluginEvents#INTERRUPTED\r\n * @private\r\n * @since 3.19.0\r\n *\r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onInterrupted: function (entry)\r\n {\r\n this.emit(SpineEvents.INTERRUPTED, entry);\r\n },\r\n\r\n /**\r\n * Internal event handler that emits the Spine onStart event via this Game Object.\r\n *\r\n * @method SpineGameObject#onStart\r\n * @fires SpinePluginEvents#START\r\n * @private\r\n * @since 3.19.0\r\n *\r\n * @param {any} entry - The event data from Spine.\r\n */\r\n onStart: function (entry)\r\n {\r\n this.emit(SpineEvents.START, entry);\r\n },\r\n\r\n /**\r\n * Refreshes the data about the current Skeleton.\r\n *\r\n * This will reset the rotation, position and size of the Skeleton to match this Game Object.\r\n *\r\n * Call this method if you need to access the Skeleton data directly, and it may have changed\r\n * recently.\r\n *\r\n * @method SpineGameObject#refresh\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n refresh: function ()\r\n {\r\n if (this.root)\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\r\n }\r\n\r\n this.updateSize();\r\n\r\n this.skeleton.updateCache();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the size of this Game Object.\r\n *\r\n * If no arguments are given it uses the current skeleton data dimensions.\r\n *\r\n * You can use this method to set a fixed size of this Game Object, such as for input detection,\r\n * when the skeleton data doesn't match what is required in-game.\r\n *\r\n * @method SpineGameObject#setSize\r\n * @since 3.19.0\r\n *\r\n * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width.\r\n * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height.\r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSize: function (width, height, offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (width === undefined) { width = skeleton.data.width; }\r\n if (height === undefined) { height = skeleton.data.height; }\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.width = width;\r\n this.height = height;\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the offset of this Game Object from the Skeleton position.\r\n *\r\n * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using.\r\n *\r\n * @method SpineGameObject#setOffset\r\n * @since 3.19.0\r\n *\r\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\r\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setOffset: function (offsetX, offsetY)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n if (offsetX === undefined) { offsetX = 0; }\r\n if (offsetY === undefined) { offsetY = 0; }\r\n\r\n this.displayOriginX = skeleton.x - offsetX;\r\n this.displayOriginY = skeleton.y - offsetY;\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Internal method that syncs all of the Game Object position and scale data to the Skeleton.\r\n * It then syncs the skeleton bounds back to this Game Object.\r\n *\r\n * This method is called automatically as needed internally, however, it's also exposed should\r\n * you require overriding the size settings.\r\n *\r\n * @method SpineGameObject#updateSize\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n updateSize: function ()\r\n {\r\n var skeleton = this.skeleton;\r\n var renderer = this.plugin.renderer;\r\n\r\n var height = renderer.height;\r\n\r\n var oldScaleX = this.scaleX;\r\n var oldScaleY = this.scaleY;\r\n\r\n skeleton.x = this.x;\r\n skeleton.y = height - this.y;\r\n skeleton.scaleX = 1;\r\n skeleton.scaleY = 1;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n var bounds = this.getBounds();\r\n\r\n this.width = bounds.size.x;\r\n this.height = bounds.size.y;\r\n\r\n this.displayOriginX = this.x - bounds.offset.x;\r\n this.displayOriginY = this.y - (height - (this.height + bounds.offset.y));\r\n\r\n skeleton.scaleX = oldScaleX;\r\n skeleton.scaleY = oldScaleY;\r\n\r\n skeleton.updateWorldTransform();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * The horizontal scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleX\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleX: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleX;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleX = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * The vertical scale of this Game Object, as applied to the Skeleton it is using.\r\n *\r\n * @name SpineGameObject#scaleY\r\n * @type {number}\r\n * @default 1\r\n * @since 3.19.0\r\n */\r\n scaleY: {\r\n\r\n get: function ()\r\n {\r\n return this._scaleY;\r\n },\r\n\r\n set: function (value)\r\n {\r\n this._scaleY = value;\r\n\r\n this.refresh();\r\n }\r\n\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the bones in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getBoneList\r\n * @since 3.19.0\r\n *\r\n * @return {string[]} An array containing the names of all the bones in the Skeleton Data.\r\n */\r\n getBoneList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.bones.length; i++)\r\n {\r\n output.push(skeletonData.bones[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the skins in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getSkinList\r\n * @since 3.19.0\r\n *\r\n * @return {string[]} An array containing the names of all the skins in the Skeleton Data.\r\n */\r\n getSkinList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.skins.length; i++)\r\n {\r\n output.push(skeletonData.skins[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the slots in the Skeleton.\r\n *\r\n * @method SpineGameObject#getSlotList\r\n * @since 3.19.0\r\n *\r\n * @return {string[]} An array containing the names of all the slots in the Skeleton.\r\n */\r\n getSlotList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeleton = this.skeleton;\r\n\r\n for (var i = 0; i < skeleton.slots.length; i++)\r\n {\r\n output.push(skeleton.slots[i].data.name);\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns an array containing the names of all the animations in the Skeleton Data.\r\n *\r\n * @method SpineGameObject#getAnimationList\r\n * @since 3.19.0\r\n *\r\n * @return {string[]} An array containing the names of all the animations in the Skeleton Data.\r\n */\r\n getAnimationList: function ()\r\n {\r\n var output = [];\r\n\r\n var skeletonData = this.skeletonData;\r\n\r\n if (skeletonData)\r\n {\r\n for (var i = 0; i < skeletonData.animations.length; i++)\r\n {\r\n output.push(skeletonData.animations[i].name);\r\n }\r\n }\r\n\r\n return output;\r\n },\r\n\r\n /**\r\n * Returns the current animation being played on the given track, if any.\r\n *\r\n * @method SpineGameObject#getCurrentAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} [trackIndex=0] - The track to return the current animation on.\r\n *\r\n * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation.\r\n */\r\n getCurrentAnimation: function (trackIndex)\r\n {\r\n if (trackIndex === undefined) { trackIndex = 0; }\r\n\r\n var current = this.state.getCurrent(trackIndex);\r\n\r\n if (current)\r\n {\r\n return current.animation;\r\n }\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n *\r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#play\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\r\n *\r\n * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead.\r\n */\r\n play: function (animationName, loop, ignoreIfPlaying)\r\n {\r\n this.setAnimation(0, animationName, loop, ignoreIfPlaying);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the current animation for a track, discarding any queued animations.\r\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\r\n *\r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * @method SpineGameObject#setAnimation\r\n * @fires SpinePluginEvents#START\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to play the animation on.\r\n * @param {string} animationName - The string-based key of the animation to play.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {boolean} [ignoreIfPlaying=false] - If the animation specified by the track index is already playing then ignore this call.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying)\r\n {\r\n if (loop === undefined) { loop = false; }\r\n if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }\r\n\r\n if (ignoreIfPlaying && this.state)\r\n {\r\n var currentTrack = this.state.getCurrent(trackIndex);\r\n\r\n if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete())\r\n {\r\n return;\r\n }\r\n }\r\n\r\n if (this.findAnimation(animationName))\r\n {\r\n return this.state.setAnimation(trackIndex, animationName, loop);\r\n }\r\n },\r\n\r\n /**\r\n * Adds an animation to be played after the current or last queued animation for a track.\r\n * If the track is empty, it is equivalent to calling setAnimation.\r\n *\r\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\r\n *\r\n * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous\r\n * track entry minus any mix duration (from the AnimationStateData) plus the specified delay\r\n * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration).\r\n * If the previous entry is looping, its next loop completion is used instead of its duration.\r\n *\r\n * @method SpineGameObject#addAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {string} animationName - The string-based key of the animation to add.\r\n * @param {boolean} [loop=false] - Should the animation be looped when played?\r\n * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played.\r\n *\r\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\r\n */\r\n addAnimation: function (trackIndex, animationName, loop, delay)\r\n {\r\n return this.state.addAnimation(trackIndex, animationName, loop, delay);\r\n },\r\n\r\n /**\r\n * Sets an empty animation for a track, discarding any queued animations, and sets the track\r\n * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out.\r\n *\r\n * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation,\r\n * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be\r\n * applied less and less over the mix duration. Properties keyed in the previous animation transition to\r\n * the value from lower tracks or to the setup pose value if no lower tracks key the property.\r\n * A mix duration of 0 still mixes out over one frame.\r\n *\r\n * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation\r\n * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new\r\n * animation to be applied more and more over the mix duration. Properties keyed in the new animation\r\n * transition from the value from lower tracks or from the setup pose value if no lower tracks key the\r\n * property to the value keyed in the new animation.\r\n *\r\n * @method SpineGameObject#setEmptyAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {spine.TrackEntry} The returned Track Entry.\r\n */\r\n setEmptyAnimation: function (trackIndex, mixDuration)\r\n {\r\n return this.state.setEmptyAnimation(trackIndex, mixDuration);\r\n },\r\n\r\n /**\r\n * Removes all animations from the track, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTrack\r\n * @since 3.19.0\r\n *\r\n * @param {integer} trackIndex - The track index to add the animation to.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTrack: function (trackIndex)\r\n {\r\n this.state.clearTrack(trackIndex);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Removes all animations from all tracks, leaving skeletons in their current pose.\r\n *\r\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\r\n * rather than leaving them in their current pose.\r\n *\r\n * @method SpineGameObject#clearTracks\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n clearTracks: function ()\r\n {\r\n this.state.clearTracks();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n *\r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n *\r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkinByName\r\n * @since 3.19.0\r\n *\r\n * @param {string} skinName - The name of the skin to set.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkinByName: function (skinName)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkinByName(skinName);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the skin used to look up attachments before looking in the defaultSkin.\r\n *\r\n * Attachments from the new skin are attached if the corresponding attachment from the\r\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\r\n * attached from the new skin.\r\n *\r\n * After changing the skin, the visible attachments can be reset to those attached in the\r\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\r\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\r\n * or show attachments from the new skin.\r\n *\r\n * @method SpineGameObject#setSkin\r\n * @since 3.19.0\r\n *\r\n * @param {?spine.Skin} newSkin - The Skin to set. May be `null`.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSkin: function (newSkin)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n skeleton.setSkin(newSkin);\r\n\r\n skeleton.setSlotsToSetupPose();\r\n\r\n this.state.apply(skeleton);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the mix duration when changing from the specified animation to the other.\r\n *\r\n * @method SpineGameObject#setMix\r\n * @since 3.19.0\r\n *\r\n * @param {string} fromName - The animation to mix from.\r\n * @param {string} toName - The animation to mix to.\r\n * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setMix: function (fromName, toName, duration)\r\n {\r\n this.stateData.setMix(fromName, toName, duration);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot\r\n * index and attachment name. First the skin is checked and if the attachment was not found,\r\n * the default skin is checked.\r\n *\r\n * @method SpineGameObject#getAttachment\r\n * @since 3.19.0\r\n *\r\n * @param {integer} slotIndex - The slot index to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachment: function (slotIndex, attachmentName)\r\n {\r\n return this.skeleton.getAttachment(slotIndex, attachmentName);\r\n },\r\n\r\n /**\r\n * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name.\r\n *\r\n * @method SpineGameObject#getAttachmentByName\r\n * @since 3.19.0\r\n *\r\n * @param {string} slotName - The slot name to search.\r\n * @param {string} attachmentName - The attachment name to look for.\r\n *\r\n * @return {?spine.Attachment} The Attachment, if found. May be null.\r\n */\r\n getAttachmentByName: function (slotName, attachmentName)\r\n {\r\n return this.skeleton.getAttachmentByName(slotName, attachmentName);\r\n },\r\n\r\n /**\r\n * A convenience method to set an attachment by finding the slot with findSlot,\r\n * finding the attachment with getAttachment, then setting the slot's attachment.\r\n *\r\n * @method SpineGameObject#setAttachment\r\n * @since 3.19.0\r\n *\r\n * @param {string} slotName - The slot name to add the attachment to.\r\n * @param {string} attachmentName - The attachment name to add.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setAttachment: function (slotName, attachmentName)\r\n {\r\n if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length)\r\n {\r\n for (var i = 0; i < slotName.length; i++)\r\n {\r\n this.skeleton.setAttachment(slotName[i], attachmentName[i]);\r\n }\r\n }\r\n else\r\n {\r\n this.skeleton.setAttachment(slotName, attachmentName);\r\n }\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones, constraints, slots, and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setToSetupPose: function ()\r\n {\r\n this.skeleton.setToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the slots and draw order to their setup pose values.\r\n *\r\n * @method SpineGameObject#setSlotsToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setSlotsToSetupPose: function ()\r\n {\r\n this.skeleton.setSlotsToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Sets the bones and constraints to their setup pose values.\r\n *\r\n * @method SpineGameObject#setBonesToSetupPose\r\n * @since 3.19.0\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n setBonesToSetupPose: function ()\r\n {\r\n this.skeleton.setBonesToSetupPose();\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Gets the root bone, or null.\r\n *\r\n * @method SpineGameObject#getRootBone\r\n * @since 3.19.0\r\n *\r\n * @return {spine.Bone} The root bone, or null.\r\n */\r\n getRootBone: function ()\r\n {\r\n return this.skeleton.getRootBone();\r\n },\r\n\r\n /**\r\n * Takes a Bone object and a position in world space and rotates the Bone so it is angled\r\n * towards the given position. You can set an optional angle offset, should the bone be\r\n * designed at a specific angle already. You can also set a minimum and maximum range for the angle.\r\n *\r\n * @method SpineGameObject#angleBoneToXY\r\n * @since 3.19.0\r\n *\r\n * @param {spine.Bone} bone - The bone to rotate towards the world position.\r\n * @param {number} worldX - The world x coordinate to rotate the bone towards.\r\n * @param {number} worldY - The world y coordinate to rotate the bone towards.\r\n * @param {number} [offset=0] - An offset to add to the rotation angle.\r\n * @param {number} [minAngle=0] - The minimum range of the rotation angle.\r\n * @param {number} [maxAngle=360] - The maximum range of the rotation angle.\r\n *\r\n * @return {this} This Game Object.\r\n */\r\n angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle)\r\n {\r\n if (offset === undefined) { offset = 0; }\r\n if (minAngle === undefined) { minAngle = 0; }\r\n if (maxAngle === undefined) { maxAngle = 360; }\r\n\r\n var renderer = this.plugin.renderer;\r\n var height = renderer.height;\r\n\r\n var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset));\r\n\r\n bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle);\r\n\r\n return this;\r\n },\r\n\r\n /**\r\n * Finds a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBone\r\n * @since 3.19.0\r\n *\r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {spine.Bone} The bone, or null.\r\n */\r\n findBone: function (boneName)\r\n {\r\n return this.skeleton.findBone(boneName);\r\n },\r\n\r\n /**\r\n * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findBoneIndex\r\n * @since 3.19.0\r\n *\r\n * @param {string} boneName - The name of the bone to find.\r\n *\r\n * @return {integer} The bone index. Or -1 if the bone was not found.\r\n */\r\n findBoneIndex: function (boneName)\r\n {\r\n return this.skeleton.findBoneIndex(boneName);\r\n },\r\n\r\n /**\r\n * Finds a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlot\r\n * @since 3.19.0\r\n *\r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {spine.Slot} The Slot. May be null.\r\n */\r\n findSlot: function (slotName)\r\n {\r\n return this.skeleton.findSlot(slotName);\r\n },\r\n\r\n /**\r\n * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSlotIndex\r\n * @since 3.19.0\r\n *\r\n * @param {string} slotName - The name of the slot to find.\r\n *\r\n * @return {integer} The slot index. Or -1 if the Slot was not found.\r\n */\r\n findSlotIndex: function (slotName)\r\n {\r\n return this.skeleton.findSlotIndex(slotName);\r\n },\r\n\r\n /**\r\n * Finds a skin by comparing each skin's name. It is more efficient to cache the results of\r\n * this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findSkin\r\n * @since 3.19.0\r\n *\r\n * @param {string} skinName - The name of the skin to find.\r\n *\r\n * @return {spine.Skin} The Skin. May be null.\r\n */\r\n findSkin: function (skinName)\r\n {\r\n return this.skeletonData.findSkin(skinName);\r\n },\r\n\r\n /**\r\n * Finds an event by comparing each events's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findEvent\r\n * @since 3.19.0\r\n *\r\n * @param {string} eventDataName - The name of the event to find.\r\n *\r\n * @return {spine.EventData} The Event Data. May be null.\r\n */\r\n findEvent: function (eventDataName)\r\n {\r\n return this.skeletonData.findEvent(eventDataName);\r\n },\r\n\r\n /**\r\n * Finds an animation by comparing each animation's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findAnimation\r\n * @since 3.19.0\r\n *\r\n * @param {string} animationName - The name of the animation to find.\r\n *\r\n * @return {spine.Animation} The Animation. May be null.\r\n */\r\n findAnimation: function (animationName)\r\n {\r\n return this.skeletonData.findAnimation(animationName);\r\n },\r\n\r\n /**\r\n * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results\r\n * of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findIkConstraint\r\n * @since 3.19.0\r\n *\r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.IkConstraintData} The IK constraint. May be null.\r\n */\r\n findIkConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findIkConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds an transform constraint by comparing each transform constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findTransformConstraint\r\n * @since 3.19.0\r\n *\r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.TransformConstraintData} The transform constraint. May be null.\r\n */\r\n findTransformConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findTransformConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraint\r\n * @since 3.19.0\r\n *\r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {spine.PathConstraintData} The path constraint. May be null.\r\n */\r\n findPathConstraint: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraint(constraintName);\r\n },\r\n\r\n /**\r\n * Finds the index of a path constraint by comparing each path constraint's name.\r\n * It is more efficient to cache the results of this method than to call it multiple times.\r\n *\r\n * @method SpineGameObject#findPathConstraintIndex\r\n * @since 3.19.0\r\n *\r\n * @param {string} constraintName - The name of the constraint to find.\r\n *\r\n * @return {integer} The constraint index. Or -1 if the constraint was not found.\r\n */\r\n findPathConstraintIndex: function (constraintName)\r\n {\r\n return this.skeletonData.findPathConstraintIndex(constraintName);\r\n },\r\n\r\n /**\r\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\r\n *\r\n * The returned object contains two properties: `offset` and `size`:\r\n *\r\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\r\n * `size` - The width and height of the AABB.\r\n *\r\n * @method SpineGameObject#getBounds\r\n * @since 3.19.0\r\n *\r\n * @return {any} The bounds object.\r\n */\r\n getBounds: function ()\r\n {\r\n return this.plugin.getBounds(this.skeleton);\r\n },\r\n\r\n /**\r\n * Internal update handler.\r\n *\r\n * @method SpineGameObject#preUpdate\r\n * @protected\r\n * @since 3.19.0\r\n *\r\n * @param {number} time - The current timestamp.\r\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\r\n */\r\n preUpdate: function (time, delta)\r\n {\r\n var skeleton = this.skeleton;\r\n\r\n this.state.update((delta / 1000) * this.timeScale);\r\n\r\n this.state.apply(skeleton);\r\n },\r\n\r\n /**\r\n * Internal destroy handler, called as part of the destroy process.\r\n *\r\n * @method SpineGameObject#preDestroy\r\n * @protected\r\n * @since 3.19.0\r\n */\r\n preDestroy: function ()\r\n {\r\n if (this.state)\r\n {\r\n this.state.clearListeners();\r\n this.state.clearListenerNotifications();\r\n }\r\n\r\n this.plugin = null;\r\n\r\n this.skeleton = null;\r\n this.skeletonData = null;\r\n\r\n this.state = null;\r\n this.stateData = null;\r\n }\r\n\r\n});\r\n\r\nmodule.exports = SpineGameObject;\r\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\nvar RadToDeg = require('../../../../src/math/RadToDeg');\nvar Wrap = require('../../../../src/math/Wrap');\n\n/**\n * Renders this Game Object with the Canvas Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method SpineGameObject#renderCanvas\n * @since 3.19.0\n * @private\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar SpineGameObjectCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\n{\n var context = renderer.currentContext;\n\n var plugin = src.plugin;\n var skeleton = src.skeleton;\n var skeletonRenderer = plugin.skeletonRenderer;\n\n var GameObjectRenderMask = 15;\n\n var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)));\n\n if (!skeleton || !willRender)\n {\n return;\n }\n\n var camMatrix = renderer._tempMatrix1;\n var spriteMatrix = renderer._tempMatrix2;\n var calcMatrix = renderer._tempMatrix3;\n\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\n\n camMatrix.copyFrom(camera.matrix);\n\n if (parentMatrix)\n {\n // Multiply the camera by the parent matrix\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\n\n // Undo the camera scroll\n spriteMatrix.e = src.x;\n spriteMatrix.f = src.y;\n\n // Multiply by the Sprite matrix, store result in calcMatrix\n camMatrix.multiply(spriteMatrix, calcMatrix);\n }\n else\n {\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\n\n // Multiply by the Sprite matrix, store result in calcMatrix\n camMatrix.multiply(spriteMatrix, calcMatrix);\n }\n\n skeleton.x = calcMatrix.tx;\n skeleton.y = calcMatrix.ty;\n\n skeleton.scaleX = calcMatrix.scaleX;\n\n // Inverse or we get upside-down skeletons\n skeleton.scaleY = calcMatrix.scaleY * -1;\n\n if (src.scaleX < 0)\n {\n skeleton.scaleX *= -1;\n\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\n }\n else\n {\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\n }\n\n if (src.scaleY < 0)\n {\n skeleton.scaleY *= -1;\n\n if (src.scaleX < 0)\n {\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\n }\n else\n {\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\n }\n }\n\n if (camera.renderToTexture)\n {\n skeleton.y = calcMatrix.ty;\n skeleton.scaleY *= -1;\n }\n\n // Add autoUpdate option\n skeleton.updateWorldTransform();\n\n skeletonRenderer.ctx = context;\n skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug);\n\n context.save();\n\n skeletonRenderer.draw(skeleton);\n\n context.restore();\n};\n\nmodule.exports = SpineGameObjectCanvasRenderer;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar renderWebGL = require('../../../../src/utils/NOOP');\nvar renderCanvas = require('../../../../src/utils/NOOP');\n\nif (typeof WEBGL_RENDERER)\n{\n renderWebGL = require('./SpineGameObjectWebGLRenderer');\n}\n\nif (typeof CANVAS_RENDERER)\n{\n renderCanvas = require('./SpineGameObjectCanvasRenderer');\n}\n\nmodule.exports = {\n\n renderWebGL: renderWebGL,\n renderCanvas: renderCanvas\n\n};\n","/**\r\n * @author Richard Davey \r\n * @copyright 2020 Photon Storm Ltd.\r\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\r\n\r\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\r\nvar RadToDeg = require('../../../../src/math/RadToDeg');\r\nvar Wrap = require('../../../../src/math/Wrap');\r\n\r\n/**\r\n * Renders this Game Object with the WebGL Renderer to the given Camera.\r\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\r\n * This method should not be called directly. It is a utility function of the Render module.\r\n *\r\n * @method SpineGameObject#renderWebGL\r\n * @since 3.19.0\r\n * @private\r\n *\r\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\r\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\r\n * @param {number} interpolationPercentage - Reserved for future use and custom pipelines.\r\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\r\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\r\n */\r\nvar SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)\r\n{\r\n var plugin = src.plugin;\r\n var skeleton = src.skeleton;\r\n var childAlpha = skeleton.color.a;\r\n var sceneRenderer = plugin.sceneRenderer;\r\n\r\n var GameObjectRenderMask = 15;\r\n\r\n var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0);\r\n\r\n if (!skeleton || !willRender)\r\n {\r\n // If there is already a batch running, and the next type isn't a Spine object, or this is the end, we need to close it\r\n\r\n if (sceneRenderer.batcher.isDrawing && (!renderer.nextTypeMatch || renderer.finalType))\r\n {\r\n // The next object in the display list is not a Spine object, so we end the batch\r\n sceneRenderer.end();\r\n\r\n renderer.pipelines.rebind();\r\n }\r\n\r\n if (!renderer.finalType)\r\n {\r\n // Reset the current type\r\n renderer.currentType = '';\r\n }\r\n\r\n return;\r\n }\r\n\r\n if (renderer.newType)\r\n {\r\n // flush + clear previous pipeline if this is a new type\r\n renderer.pipelines.clear();\r\n }\r\n\r\n var camMatrix = renderer._tempMatrix1;\r\n var spriteMatrix = renderer._tempMatrix2;\r\n var calcMatrix = renderer._tempMatrix3;\r\n\r\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\r\n\r\n camMatrix.copyFrom(camera.matrix);\r\n\r\n if (parentMatrix)\r\n {\r\n // Multiply the camera by the parent matrix\r\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\r\n\r\n // Undo the camera scroll\r\n spriteMatrix.e = src.x;\r\n spriteMatrix.f = src.y;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n else\r\n {\r\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\r\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\r\n\r\n // Multiply by the Sprite matrix, store result in calcMatrix\r\n camMatrix.multiply(spriteMatrix, calcMatrix);\r\n }\r\n\r\n var viewportHeight = renderer.height;\r\n\r\n skeleton.x = calcMatrix.tx;\r\n skeleton.y = viewportHeight - calcMatrix.ty;\r\n\r\n skeleton.scaleX = calcMatrix.scaleX;\r\n skeleton.scaleY = calcMatrix.scaleY;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n skeleton.scaleX *= -1;\r\n\r\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\r\n }\r\n else\r\n {\r\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\r\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\r\n }\r\n\r\n if (src.scaleY < 0)\r\n {\r\n skeleton.scaleY *= -1;\r\n\r\n if (src.scaleX < 0)\r\n {\r\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n else\r\n {\r\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\r\n }\r\n }\r\n\r\n if (camera.renderToTexture || renderer.currentFramebuffer !== null)\r\n {\r\n skeleton.y = calcMatrix.ty;\r\n skeleton.scaleY *= -1;\r\n }\r\n\r\n // Add autoUpdate option\r\n skeleton.updateWorldTransform();\r\n\r\n if (renderer.newType)\r\n {\r\n sceneRenderer.begin();\r\n }\r\n\r\n // Draw the current skeleton\r\n sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha);\r\n\r\n if (plugin.drawDebug || src.drawDebug)\r\n {\r\n // Because if we don't, the bones render positions are completely wrong (*sigh*)\r\n var oldX = skeleton.x;\r\n var oldY = skeleton.y;\r\n\r\n skeleton.x = 0;\r\n skeleton.y = 0;\r\n\r\n sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha);\r\n\r\n skeleton.x = oldX;\r\n skeleton.y = oldY;\r\n }\r\n\r\n if (!renderer.nextTypeMatch)\r\n {\r\n // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch\r\n sceneRenderer.end();\r\n\r\n // And rebind the previous pipeline\r\n renderer.pipelines.rebind();\r\n }\r\n};\r\n\r\nmodule.exports = SpineGameObjectWebGLRenderer;\r\n","/*** IMPORTS FROM imports-loader ***/\n\n(function() {\nvar __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n var Animation = (function () {\r\n function Animation(name, timelines, duration) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (timelines == null)\r\n throw new Error(\"timelines cannot be null.\");\r\n this.name = name;\r\n this.timelines = timelines;\r\n this.timelineIds = [];\r\n for (var i = 0; i < timelines.length; i++)\r\n this.timelineIds[timelines[i].getPropertyId()] = true;\r\n this.duration = duration;\r\n }\r\n Animation.prototype.hasTimeline = function (id) {\r\n return this.timelineIds[id] == true;\r\n };\r\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (loop && this.duration != 0) {\r\n time %= this.duration;\r\n if (lastTime > 0)\r\n lastTime %= this.duration;\r\n }\r\n var timelines = this.timelines;\r\n for (var i = 0, n = timelines.length; i < n; i++)\r\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\r\n };\r\n Animation.binarySearch = function (values, target, step) {\r\n if (step === void 0) { step = 1; }\r\n var low = 0;\r\n var high = values.length / step - 2;\r\n if (high == 0)\r\n return step;\r\n var current = high >>> 1;\r\n while (true) {\r\n if (values[(current + 1) * step] <= target)\r\n low = current + 1;\r\n else\r\n high = current;\r\n if (low == high)\r\n return (low + 1) * step;\r\n current = (low + high) >>> 1;\r\n }\r\n };\r\n Animation.linearSearch = function (values, target, step) {\r\n for (var i = 0, last = values.length - step; i <= last; i += step)\r\n if (values[i] > target)\r\n return i;\r\n return -1;\r\n };\r\n return Animation;\r\n }());\r\n spine.Animation = Animation;\r\n var MixBlend;\r\n (function (MixBlend) {\r\n MixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\r\n MixBlend[MixBlend[\"first\"] = 1] = \"first\";\r\n MixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\r\n MixBlend[MixBlend[\"add\"] = 3] = \"add\";\r\n })(MixBlend = spine.MixBlend || (spine.MixBlend = {}));\r\n var MixDirection;\r\n (function (MixDirection) {\r\n MixDirection[MixDirection[\"mixIn\"] = 0] = \"mixIn\";\r\n MixDirection[MixDirection[\"mixOut\"] = 1] = \"mixOut\";\r\n })(MixDirection = spine.MixDirection || (spine.MixDirection = {}));\r\n var TimelineType;\r\n (function (TimelineType) {\r\n TimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\r\n TimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\r\n TimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\r\n TimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\r\n TimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\r\n TimelineType[TimelineType[\"color\"] = 5] = \"color\";\r\n TimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\r\n TimelineType[TimelineType[\"event\"] = 7] = \"event\";\r\n TimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\r\n TimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\r\n TimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\r\n TimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\r\n TimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\r\n TimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\r\n TimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\r\n })(TimelineType = spine.TimelineType || (spine.TimelineType = {}));\r\n var CurveTimeline = (function () {\r\n function CurveTimeline(frameCount) {\r\n if (frameCount <= 0)\r\n throw new Error(\"frameCount must be > 0: \" + frameCount);\r\n this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\r\n }\r\n CurveTimeline.prototype.getFrameCount = function () {\r\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\r\n };\r\n CurveTimeline.prototype.setLinear = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\r\n };\r\n CurveTimeline.prototype.setStepped = function (frameIndex) {\r\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\r\n };\r\n CurveTimeline.prototype.getCurveType = function (frameIndex) {\r\n var index = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n if (index == this.curves.length)\r\n return CurveTimeline.LINEAR;\r\n var type = this.curves[index];\r\n if (type == CurveTimeline.LINEAR)\r\n return CurveTimeline.LINEAR;\r\n if (type == CurveTimeline.STEPPED)\r\n return CurveTimeline.STEPPED;\r\n return CurveTimeline.BEZIER;\r\n };\r\n CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\r\n var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\r\n var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\r\n var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\r\n var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var curves = this.curves;\r\n curves[i++] = CurveTimeline.BEZIER;\r\n var x = dfx, y = dfy;\r\n for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n curves[i] = x;\r\n curves[i + 1] = y;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n x += dfx;\r\n y += dfy;\r\n }\r\n };\r\n CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\r\n percent = spine.MathUtils.clamp(percent, 0, 1);\r\n var curves = this.curves;\r\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\r\n var type = curves[i];\r\n if (type == CurveTimeline.LINEAR)\r\n return percent;\r\n if (type == CurveTimeline.STEPPED)\r\n return 0;\r\n i++;\r\n var x = 0;\r\n for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\r\n x = curves[i];\r\n if (x >= percent) {\r\n var prevX = void 0, prevY = void 0;\r\n if (i == start) {\r\n prevX = 0;\r\n prevY = 0;\r\n }\r\n else {\r\n prevX = curves[i - 2];\r\n prevY = curves[i - 1];\r\n }\r\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\r\n }\r\n }\r\n var y = curves[i - 1];\r\n return y + (1 - y) * (percent - x) / (1 - x);\r\n };\r\n CurveTimeline.LINEAR = 0;\r\n CurveTimeline.STEPPED = 1;\r\n CurveTimeline.BEZIER = 2;\r\n CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\r\n return CurveTimeline;\r\n }());\r\n spine.CurveTimeline = CurveTimeline;\r\n var RotateTimeline = (function (_super) {\r\n __extends(RotateTimeline, _super);\r\n function RotateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount << 1);\r\n return _this;\r\n }\r\n RotateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.rotate << 24) + this.boneIndex;\r\n };\r\n RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\r\n frameIndex <<= 1;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\r\n };\r\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n return;\r\n case MixBlend.first:\r\n var r_1 = bone.data.rotation - bone.rotation;\r\n bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) {\r\n var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + r_2 * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r_2 += bone.data.rotation - bone.rotation;\r\n r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360;\r\n case MixBlend.add:\r\n bone.rotation += r_2 * alpha;\r\n }\r\n return;\r\n }\r\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\r\n var r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\r\n r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n r += bone.data.rotation - bone.rotation;\r\n case MixBlend.add:\r\n bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\r\n }\r\n };\r\n RotateTimeline.ENTRIES = 2;\r\n RotateTimeline.PREV_TIME = -2;\r\n RotateTimeline.PREV_ROTATION = -1;\r\n RotateTimeline.ROTATION = 1;\r\n return RotateTimeline;\r\n }(CurveTimeline));\r\n spine.RotateTimeline = RotateTimeline;\r\n var TranslateTimeline = (function (_super) {\r\n __extends(TranslateTimeline, _super);\r\n function TranslateTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TranslateTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.translate << 24) + this.boneIndex;\r\n };\r\n TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\r\n frameIndex *= TranslateTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TranslateTimeline.X] = x;\r\n this.frames[frameIndex + TranslateTimeline.Y] = y;\r\n };\r\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x;\r\n bone.y = bone.data.y;\r\n return;\r\n case MixBlend.first:\r\n bone.x += (bone.data.x - bone.x) * alpha;\r\n bone.y += (bone.data.y - bone.y) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) {\r\n x = frames[frames.length + TranslateTimeline.PREV_X];\r\n y = frames[frames.length + TranslateTimeline.PREV_Y];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\r\n x = frames[frame + TranslateTimeline.PREV_X];\r\n y = frames[frame + TranslateTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\r\n x += (frames[frame + TranslateTimeline.X] - x) * percent;\r\n y += (frames[frame + TranslateTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.x = bone.data.x + x * alpha;\r\n bone.y = bone.data.y + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.x += (bone.data.x + x - bone.x) * alpha;\r\n bone.y += (bone.data.y + y - bone.y) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.x += x * alpha;\r\n bone.y += y * alpha;\r\n }\r\n };\r\n TranslateTimeline.ENTRIES = 3;\r\n TranslateTimeline.PREV_TIME = -3;\r\n TranslateTimeline.PREV_X = -2;\r\n TranslateTimeline.PREV_Y = -1;\r\n TranslateTimeline.X = 1;\r\n TranslateTimeline.Y = 2;\r\n return TranslateTimeline;\r\n }(CurveTimeline));\r\n spine.TranslateTimeline = TranslateTimeline;\r\n var ScaleTimeline = (function (_super) {\r\n __extends(ScaleTimeline, _super);\r\n function ScaleTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ScaleTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.scale << 24) + this.boneIndex;\r\n };\r\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.scaleX = bone.data.scaleX;\r\n bone.scaleY = bone.data.scaleY;\r\n return;\r\n case MixBlend.first:\r\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\r\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) {\r\n x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\r\n y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\r\n x = frames[frame + ScaleTimeline.PREV_X];\r\n y = frames[frame + ScaleTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\r\n x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\r\n y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\r\n }\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n bone.scaleX += x - bone.data.scaleX;\r\n bone.scaleY += y - bone.data.scaleY;\r\n }\r\n else {\r\n bone.scaleX = x;\r\n bone.scaleY = y;\r\n }\r\n }\r\n else {\r\n var bx = 0, by = 0;\r\n if (direction == MixDirection.mixOut) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = bone.data.scaleX;\r\n by = bone.data.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = bone.scaleX;\r\n by = bone.scaleY;\r\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha;\r\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha;\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x);\r\n by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x);\r\n by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y);\r\n bone.scaleX = bx + (x - bx) * alpha;\r\n bone.scaleY = by + (y - by) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bx = spine.MathUtils.signum(x);\r\n by = spine.MathUtils.signum(y);\r\n bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\r\n bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\r\n }\r\n }\r\n }\r\n };\r\n return ScaleTimeline;\r\n }(TranslateTimeline));\r\n spine.ScaleTimeline = ScaleTimeline;\r\n var ShearTimeline = (function (_super) {\r\n __extends(ShearTimeline, _super);\r\n function ShearTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n ShearTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.shear << 24) + this.boneIndex;\r\n };\r\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var bone = skeleton.bones[this.boneIndex];\r\n if (!bone.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX;\r\n bone.shearY = bone.data.shearY;\r\n return;\r\n case MixBlend.first:\r\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\r\n }\r\n return;\r\n }\r\n var x = 0, y = 0;\r\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) {\r\n x = frames[frames.length + ShearTimeline.PREV_X];\r\n y = frames[frames.length + ShearTimeline.PREV_Y];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\r\n x = frames[frame + ShearTimeline.PREV_X];\r\n y = frames[frame + ShearTimeline.PREV_Y];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\r\n x = x + (frames[frame + ShearTimeline.X] - x) * percent;\r\n y = y + (frames[frame + ShearTimeline.Y] - y) * percent;\r\n }\r\n switch (blend) {\r\n case MixBlend.setup:\r\n bone.shearX = bone.data.shearX + x * alpha;\r\n bone.shearY = bone.data.shearY + y * alpha;\r\n break;\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\r\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\r\n break;\r\n case MixBlend.add:\r\n bone.shearX += x * alpha;\r\n bone.shearY += y * alpha;\r\n }\r\n };\r\n return ShearTimeline;\r\n }(TranslateTimeline));\r\n spine.ShearTimeline = ShearTimeline;\r\n var ColorTimeline = (function (_super) {\r\n __extends(ColorTimeline, _super);\r\n function ColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n ColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.color << 24) + this.slotIndex;\r\n };\r\n ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\r\n frameIndex *= ColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + ColorTimeline.R] = r;\r\n this.frames[frameIndex + ColorTimeline.G] = g;\r\n this.frames[frameIndex + ColorTimeline.B] = b;\r\n this.frames[frameIndex + ColorTimeline.A] = a;\r\n };\r\n ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n return;\r\n case MixBlend.first:\r\n var color = slot.color, setup = slot.data.color;\r\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0;\r\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) {\r\n var i = frames.length;\r\n r = frames[i + ColorTimeline.PREV_R];\r\n g = frames[i + ColorTimeline.PREV_G];\r\n b = frames[i + ColorTimeline.PREV_B];\r\n a = frames[i + ColorTimeline.PREV_A];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\r\n r = frames[frame + ColorTimeline.PREV_R];\r\n g = frames[frame + ColorTimeline.PREV_G];\r\n b = frames[frame + ColorTimeline.PREV_B];\r\n a = frames[frame + ColorTimeline.PREV_A];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + ColorTimeline.R] - r) * percent;\r\n g += (frames[frame + ColorTimeline.G] - g) * percent;\r\n b += (frames[frame + ColorTimeline.B] - b) * percent;\r\n a += (frames[frame + ColorTimeline.A] - a) * percent;\r\n }\r\n if (alpha == 1)\r\n slot.color.set(r, g, b, a);\r\n else {\r\n var color = slot.color;\r\n if (blend == MixBlend.setup)\r\n color.setFromColor(slot.data.color);\r\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\r\n }\r\n };\r\n ColorTimeline.ENTRIES = 5;\r\n ColorTimeline.PREV_TIME = -5;\r\n ColorTimeline.PREV_R = -4;\r\n ColorTimeline.PREV_G = -3;\r\n ColorTimeline.PREV_B = -2;\r\n ColorTimeline.PREV_A = -1;\r\n ColorTimeline.R = 1;\r\n ColorTimeline.G = 2;\r\n ColorTimeline.B = 3;\r\n ColorTimeline.A = 4;\r\n return ColorTimeline;\r\n }(CurveTimeline));\r\n spine.ColorTimeline = ColorTimeline;\r\n var TwoColorTimeline = (function (_super) {\r\n __extends(TwoColorTimeline, _super);\r\n function TwoColorTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TwoColorTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.twoColor << 24) + this.slotIndex;\r\n };\r\n TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\r\n frameIndex *= TwoColorTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TwoColorTimeline.R] = r;\r\n this.frames[frameIndex + TwoColorTimeline.G] = g;\r\n this.frames[frameIndex + TwoColorTimeline.B] = b;\r\n this.frames[frameIndex + TwoColorTimeline.A] = a;\r\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\r\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\r\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\r\n };\r\n TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n slot.color.setFromColor(slot.data.color);\r\n slot.darkColor.setFromColor(slot.data.darkColor);\r\n return;\r\n case MixBlend.first:\r\n var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\r\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\r\n dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\r\n }\r\n return;\r\n }\r\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\r\n if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) {\r\n var i = frames.length;\r\n r = frames[i + TwoColorTimeline.PREV_R];\r\n g = frames[i + TwoColorTimeline.PREV_G];\r\n b = frames[i + TwoColorTimeline.PREV_B];\r\n a = frames[i + TwoColorTimeline.PREV_A];\r\n r2 = frames[i + TwoColorTimeline.PREV_R2];\r\n g2 = frames[i + TwoColorTimeline.PREV_G2];\r\n b2 = frames[i + TwoColorTimeline.PREV_B2];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\r\n r = frames[frame + TwoColorTimeline.PREV_R];\r\n g = frames[frame + TwoColorTimeline.PREV_G];\r\n b = frames[frame + TwoColorTimeline.PREV_B];\r\n a = frames[frame + TwoColorTimeline.PREV_A];\r\n r2 = frames[frame + TwoColorTimeline.PREV_R2];\r\n g2 = frames[frame + TwoColorTimeline.PREV_G2];\r\n b2 = frames[frame + TwoColorTimeline.PREV_B2];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\r\n r += (frames[frame + TwoColorTimeline.R] - r) * percent;\r\n g += (frames[frame + TwoColorTimeline.G] - g) * percent;\r\n b += (frames[frame + TwoColorTimeline.B] - b) * percent;\r\n a += (frames[frame + TwoColorTimeline.A] - a) * percent;\r\n r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\r\n g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\r\n b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\r\n }\r\n if (alpha == 1) {\r\n slot.color.set(r, g, b, a);\r\n slot.darkColor.set(r2, g2, b2, 1);\r\n }\r\n else {\r\n var light = slot.color, dark = slot.darkColor;\r\n if (blend == MixBlend.setup) {\r\n light.setFromColor(slot.data.color);\r\n dark.setFromColor(slot.data.darkColor);\r\n }\r\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\r\n dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\r\n }\r\n };\r\n TwoColorTimeline.ENTRIES = 8;\r\n TwoColorTimeline.PREV_TIME = -8;\r\n TwoColorTimeline.PREV_R = -7;\r\n TwoColorTimeline.PREV_G = -6;\r\n TwoColorTimeline.PREV_B = -5;\r\n TwoColorTimeline.PREV_A = -4;\r\n TwoColorTimeline.PREV_R2 = -3;\r\n TwoColorTimeline.PREV_G2 = -2;\r\n TwoColorTimeline.PREV_B2 = -1;\r\n TwoColorTimeline.R = 1;\r\n TwoColorTimeline.G = 2;\r\n TwoColorTimeline.B = 3;\r\n TwoColorTimeline.A = 4;\r\n TwoColorTimeline.R2 = 5;\r\n TwoColorTimeline.G2 = 6;\r\n TwoColorTimeline.B2 = 7;\r\n return TwoColorTimeline;\r\n }(CurveTimeline));\r\n spine.TwoColorTimeline = TwoColorTimeline;\r\n var AttachmentTimeline = (function () {\r\n function AttachmentTimeline(frameCount) {\r\n this.frames = spine.Utils.newFloatArray(frameCount);\r\n this.attachmentNames = new Array(frameCount);\r\n }\r\n AttachmentTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.attachment << 24) + this.slotIndex;\r\n };\r\n AttachmentTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\r\n this.frames[frameIndex] = time;\r\n this.attachmentNames[frameIndex] = attachmentName;\r\n };\r\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\r\n return;\r\n }\r\n var frameIndex = 0;\r\n if (time >= frames[frames.length - 1])\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\r\n var attachmentName = this.attachmentNames[frameIndex];\r\n skeleton.slots[this.slotIndex]\r\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\r\n };\r\n AttachmentTimeline.prototype.setAttachment = function (skeleton, slot, attachmentName) {\r\n slot.attachment = attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName);\r\n };\r\n return AttachmentTimeline;\r\n }());\r\n spine.AttachmentTimeline = AttachmentTimeline;\r\n var zeros = null;\r\n var DeformTimeline = (function (_super) {\r\n __extends(DeformTimeline, _super);\r\n function DeformTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount);\r\n _this.frameVertices = new Array(frameCount);\r\n if (zeros == null)\r\n zeros = spine.Utils.newFloatArray(64);\r\n return _this;\r\n }\r\n DeformTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\r\n };\r\n DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\r\n this.frames[frameIndex] = time;\r\n this.frameVertices[frameIndex] = vertices;\r\n };\r\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var slot = skeleton.slots[this.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var slotAttachment = slot.getAttachment();\r\n if (!(slotAttachment instanceof spine.VertexAttachment) || !(slotAttachment.deformAttachment == this.attachment))\r\n return;\r\n var deformArray = slot.deform;\r\n if (deformArray.length == 0)\r\n blend = MixBlend.setup;\r\n var frameVertices = this.frameVertices;\r\n var vertexCount = frameVertices[0].length;\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n var vertexAttachment = slotAttachment;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n deformArray.length = 0;\r\n return;\r\n case MixBlend.first:\r\n if (alpha == 1) {\r\n deformArray.length = 0;\r\n break;\r\n }\r\n var deform_1 = spine.Utils.setArraySize(deformArray, vertexCount);\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform_1[i] += (setupVertices[i] - deform_1[i]) * alpha;\r\n }\r\n else {\r\n alpha = 1 - alpha;\r\n for (var i = 0; i < vertexCount; i++)\r\n deform_1[i] *= alpha;\r\n }\r\n }\r\n return;\r\n }\r\n var deform = spine.Utils.setArraySize(deformArray, vertexCount);\r\n if (time >= frames[frames.length - 1]) {\r\n var lastVertices = frameVertices[frames.length - 1];\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_1 = 0; i_1 < vertexCount; i_1++) {\r\n deform[i_1] += lastVertices[i_1] - setupVertices[i_1];\r\n }\r\n }\r\n else {\r\n for (var i_2 = 0; i_2 < vertexCount; i_2++)\r\n deform[i_2] += lastVertices[i_2];\r\n }\r\n }\r\n else {\r\n spine.Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_1 = slotAttachment;\r\n if (vertexAttachment_1.bones == null) {\r\n var setupVertices = vertexAttachment_1.vertices;\r\n for (var i_3 = 0; i_3 < vertexCount; i_3++) {\r\n var setup = setupVertices[i_3];\r\n deform[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_4 = 0; i_4 < vertexCount; i_4++)\r\n deform[i_4] = lastVertices[i_4] * alpha;\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_5 = 0; i_5 < vertexCount; i_5++)\r\n deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_6 = 0; i_6 < vertexCount; i_6++) {\r\n deform[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_7 = 0; i_7 < vertexCount; i_7++)\r\n deform[i_7] += lastVertices[i_7] * alpha;\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n var frame = Animation.binarySearch(frames, time);\r\n var prevVertices = frameVertices[frame - 1];\r\n var nextVertices = frameVertices[frame];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\r\n if (alpha == 1) {\r\n if (blend == MixBlend.add) {\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_8 = 0; i_8 < vertexCount; i_8++) {\r\n var prev = prevVertices[i_8];\r\n deform[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\r\n }\r\n }\r\n else {\r\n for (var i_9 = 0; i_9 < vertexCount; i_9++) {\r\n var prev = prevVertices[i_9];\r\n deform[i_9] += prev + (nextVertices[i_9] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i_10 = 0; i_10 < vertexCount; i_10++) {\r\n var prev = prevVertices[i_10];\r\n deform[i_10] = prev + (nextVertices[i_10] - prev) * percent;\r\n }\r\n }\r\n }\r\n else {\r\n switch (blend) {\r\n case MixBlend.setup: {\r\n var vertexAttachment_2 = slotAttachment;\r\n if (vertexAttachment_2.bones == null) {\r\n var setupVertices = vertexAttachment_2.vertices;\r\n for (var i_11 = 0; i_11 < vertexCount; i_11++) {\r\n var prev = prevVertices[i_11], setup = setupVertices[i_11];\r\n deform[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_12 = 0; i_12 < vertexCount; i_12++) {\r\n var prev = prevVertices[i_12];\r\n deform[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\r\n }\r\n }\r\n break;\r\n }\r\n case MixBlend.first:\r\n case MixBlend.replace:\r\n for (var i_13 = 0; i_13 < vertexCount; i_13++) {\r\n var prev = prevVertices[i_13];\r\n deform[i_13] += (prev + (nextVertices[i_13] - prev) * percent - deform[i_13]) * alpha;\r\n }\r\n break;\r\n case MixBlend.add:\r\n var vertexAttachment = slotAttachment;\r\n if (vertexAttachment.bones == null) {\r\n var setupVertices = vertexAttachment.vertices;\r\n for (var i_14 = 0; i_14 < vertexCount; i_14++) {\r\n var prev = prevVertices[i_14];\r\n deform[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\r\n }\r\n }\r\n else {\r\n for (var i_15 = 0; i_15 < vertexCount; i_15++) {\r\n var prev = prevVertices[i_15];\r\n deform[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n return DeformTimeline;\r\n }(CurveTimeline));\r\n spine.DeformTimeline = DeformTimeline;\r\n var EventTimeline = (function () {\r\n function EventTimeline(frameCount) {\r\n this.frames = spine.Utils.newFloatArray(frameCount);\r\n this.events = new Array(frameCount);\r\n }\r\n EventTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.event << 24;\r\n };\r\n EventTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n EventTimeline.prototype.setFrame = function (frameIndex, event) {\r\n this.frames[frameIndex] = event.time;\r\n this.events[frameIndex] = event;\r\n };\r\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n if (firedEvents == null)\r\n return;\r\n var frames = this.frames;\r\n var frameCount = this.frames.length;\r\n if (lastTime > time) {\r\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\r\n lastTime = -1;\r\n }\r\n else if (lastTime >= frames[frameCount - 1])\r\n return;\r\n if (time < frames[0])\r\n return;\r\n var frame = 0;\r\n if (lastTime < frames[0])\r\n frame = 0;\r\n else {\r\n frame = Animation.binarySearch(frames, lastTime);\r\n var frameTime = frames[frame];\r\n while (frame > 0) {\r\n if (frames[frame - 1] != frameTime)\r\n break;\r\n frame--;\r\n }\r\n }\r\n for (; frame < frameCount && time >= frames[frame]; frame++)\r\n firedEvents.push(this.events[frame]);\r\n };\r\n return EventTimeline;\r\n }());\r\n spine.EventTimeline = EventTimeline;\r\n var DrawOrderTimeline = (function () {\r\n function DrawOrderTimeline(frameCount) {\r\n this.frames = spine.Utils.newFloatArray(frameCount);\r\n this.drawOrders = new Array(frameCount);\r\n }\r\n DrawOrderTimeline.prototype.getPropertyId = function () {\r\n return TimelineType.drawOrder << 24;\r\n };\r\n DrawOrderTimeline.prototype.getFrameCount = function () {\r\n return this.frames.length;\r\n };\r\n DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\r\n this.frames[frameIndex] = time;\r\n this.drawOrders[frameIndex] = drawOrder;\r\n };\r\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var drawOrder = skeleton.drawOrder;\r\n var slots = skeleton.slots;\r\n if (direction == MixDirection.mixOut) {\r\n if (blend == MixBlend.setup)\r\n spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frames = this.frames;\r\n if (time < frames[0]) {\r\n if (blend == MixBlend.setup || blend == MixBlend.first)\r\n spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\r\n return;\r\n }\r\n var frame = 0;\r\n if (time >= frames[frames.length - 1])\r\n frame = frames.length - 1;\r\n else\r\n frame = Animation.binarySearch(frames, time) - 1;\r\n var drawOrderToSetupIndex = this.drawOrders[frame];\r\n if (drawOrderToSetupIndex == null)\r\n spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\r\n else {\r\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\r\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\r\n }\r\n };\r\n return DrawOrderTimeline;\r\n }());\r\n spine.DrawOrderTimeline = DrawOrderTimeline;\r\n var IkConstraintTimeline = (function (_super) {\r\n __extends(IkConstraintTimeline, _super);\r\n function IkConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n IkConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\r\n };\r\n IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, softness, bendDirection, compress, stretch) {\r\n frameIndex *= IkConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\r\n this.frames[frameIndex + IkConstraintTimeline.SOFTNESS] = softness;\r\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\r\n this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\r\n this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\r\n };\r\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n return;\r\n case MixBlend.first:\r\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\r\n constraint.softness += (constraint.data.softness - constraint.softness) * alpha;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n return;\r\n }\r\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness\r\n + (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\r\n constraint.softness += (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n return;\r\n }\r\n var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\r\n var mix = frames[frame + IkConstraintTimeline.PREV_MIX];\r\n var softness = frames[frame + IkConstraintTimeline.PREV_SOFTNESS];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\r\n if (blend == MixBlend.setup) {\r\n constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\r\n constraint.softness = constraint.data.softness\r\n + (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.data.softness) * alpha;\r\n if (direction == MixDirection.mixOut) {\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n else {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n else {\r\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\r\n constraint.softness += (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.softness) * alpha;\r\n if (direction == MixDirection.mixIn) {\r\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\r\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\r\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\r\n }\r\n }\r\n };\r\n IkConstraintTimeline.ENTRIES = 6;\r\n IkConstraintTimeline.PREV_TIME = -6;\r\n IkConstraintTimeline.PREV_MIX = -5;\r\n IkConstraintTimeline.PREV_SOFTNESS = -4;\r\n IkConstraintTimeline.PREV_BEND_DIRECTION = -3;\r\n IkConstraintTimeline.PREV_COMPRESS = -2;\r\n IkConstraintTimeline.PREV_STRETCH = -1;\r\n IkConstraintTimeline.MIX = 1;\r\n IkConstraintTimeline.SOFTNESS = 2;\r\n IkConstraintTimeline.BEND_DIRECTION = 3;\r\n IkConstraintTimeline.COMPRESS = 4;\r\n IkConstraintTimeline.STRETCH = 5;\r\n return IkConstraintTimeline;\r\n }(CurveTimeline));\r\n spine.IkConstraintTimeline = IkConstraintTimeline;\r\n var TransformConstraintTimeline = (function (_super) {\r\n __extends(TransformConstraintTimeline, _super);\r\n function TransformConstraintTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\r\n return _this;\r\n }\r\n TransformConstraintTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\r\n };\r\n TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\r\n frameIndex *= TransformConstraintTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\r\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\r\n };\r\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n var data = constraint.data;\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0, scale = 0, shear = 0;\r\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) {\r\n var i = frames.length;\r\n rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[i + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\r\n rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\r\n translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\r\n scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\r\n shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\r\n scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\r\n shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\r\n constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\r\n constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\r\n constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n constraint.scaleMix += (scale - constraint.scaleMix) * alpha;\r\n constraint.shearMix += (shear - constraint.shearMix) * alpha;\r\n }\r\n };\r\n TransformConstraintTimeline.ENTRIES = 5;\r\n TransformConstraintTimeline.PREV_TIME = -5;\r\n TransformConstraintTimeline.PREV_ROTATE = -4;\r\n TransformConstraintTimeline.PREV_TRANSLATE = -3;\r\n TransformConstraintTimeline.PREV_SCALE = -2;\r\n TransformConstraintTimeline.PREV_SHEAR = -1;\r\n TransformConstraintTimeline.ROTATE = 1;\r\n TransformConstraintTimeline.TRANSLATE = 2;\r\n TransformConstraintTimeline.SCALE = 3;\r\n TransformConstraintTimeline.SHEAR = 4;\r\n return TransformConstraintTimeline;\r\n }(CurveTimeline));\r\n spine.TransformConstraintTimeline = TransformConstraintTimeline;\r\n var PathConstraintPositionTimeline = (function (_super) {\r\n __extends(PathConstraintPositionTimeline, _super);\r\n function PathConstraintPositionTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintPositionTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\r\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\r\n };\r\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.position = constraint.data.position;\r\n return;\r\n case MixBlend.first:\r\n constraint.position += (constraint.data.position - constraint.position) * alpha;\r\n }\r\n return;\r\n }\r\n var position = 0;\r\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES])\r\n position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\r\n else {\r\n var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\r\n position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\r\n position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\r\n else\r\n constraint.position += (position - constraint.position) * alpha;\r\n };\r\n PathConstraintPositionTimeline.ENTRIES = 2;\r\n PathConstraintPositionTimeline.PREV_TIME = -2;\r\n PathConstraintPositionTimeline.PREV_VALUE = -1;\r\n PathConstraintPositionTimeline.VALUE = 1;\r\n return PathConstraintPositionTimeline;\r\n }(CurveTimeline));\r\n spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;\r\n var PathConstraintSpacingTimeline = (function (_super) {\r\n __extends(PathConstraintSpacingTimeline, _super);\r\n function PathConstraintSpacingTimeline(frameCount) {\r\n return _super.call(this, frameCount) || this;\r\n }\r\n PathConstraintSpacingTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.spacing = constraint.data.spacing;\r\n return;\r\n case MixBlend.first:\r\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\r\n }\r\n return;\r\n }\r\n var spacing = 0;\r\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES])\r\n spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\r\n else {\r\n var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\r\n spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\r\n spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\r\n }\r\n if (blend == MixBlend.setup)\r\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\r\n else\r\n constraint.spacing += (spacing - constraint.spacing) * alpha;\r\n };\r\n return PathConstraintSpacingTimeline;\r\n }(PathConstraintPositionTimeline));\r\n spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline;\r\n var PathConstraintMixTimeline = (function (_super) {\r\n __extends(PathConstraintMixTimeline, _super);\r\n function PathConstraintMixTimeline(frameCount) {\r\n var _this = _super.call(this, frameCount) || this;\r\n _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\r\n return _this;\r\n }\r\n PathConstraintMixTimeline.prototype.getPropertyId = function () {\r\n return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\r\n };\r\n PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\r\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\r\n this.frames[frameIndex] = time;\r\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\r\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\r\n };\r\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\r\n var frames = this.frames;\r\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\r\n if (!constraint.active)\r\n return;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case MixBlend.setup:\r\n constraint.rotateMix = constraint.data.rotateMix;\r\n constraint.translateMix = constraint.data.translateMix;\r\n return;\r\n case MixBlend.first:\r\n constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\r\n }\r\n return;\r\n }\r\n var rotate = 0, translate = 0;\r\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) {\r\n rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n }\r\n else {\r\n var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\r\n rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\r\n translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\r\n var frameTime = frames[frame];\r\n var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\r\n rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\r\n translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\r\n }\r\n if (blend == MixBlend.setup) {\r\n constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\r\n constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\r\n }\r\n else {\r\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\r\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\r\n }\r\n };\r\n PathConstraintMixTimeline.ENTRIES = 3;\r\n PathConstraintMixTimeline.PREV_TIME = -3;\r\n PathConstraintMixTimeline.PREV_ROTATE = -2;\r\n PathConstraintMixTimeline.PREV_TRANSLATE = -1;\r\n PathConstraintMixTimeline.ROTATE = 1;\r\n PathConstraintMixTimeline.TRANSLATE = 2;\r\n return PathConstraintMixTimeline;\r\n }(CurveTimeline));\r\n spine.PathConstraintMixTimeline = PathConstraintMixTimeline;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AnimationState = (function () {\r\n function AnimationState(data) {\r\n this.tracks = new Array();\r\n this.timeScale = 1;\r\n this.unkeyedState = 0;\r\n this.events = new Array();\r\n this.listeners = new Array();\r\n this.queue = new EventQueue(this);\r\n this.propertyIDs = new spine.IntSet();\r\n this.animationsChanged = false;\r\n this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); });\r\n this.data = data;\r\n }\r\n AnimationState.prototype.update = function (delta) {\r\n delta *= this.timeScale;\r\n var tracks = this.tracks;\r\n for (var i = 0, n = tracks.length; i < n; i++) {\r\n var current = tracks[i];\r\n if (current == null)\r\n continue;\r\n current.animationLast = current.nextAnimationLast;\r\n current.trackLast = current.nextTrackLast;\r\n var currentDelta = delta * current.timeScale;\r\n if (current.delay > 0) {\r\n current.delay -= currentDelta;\r\n if (current.delay > 0)\r\n continue;\r\n currentDelta = -current.delay;\r\n current.delay = 0;\r\n }\r\n var next = current.next;\r\n if (next != null) {\r\n var nextTime = current.trackLast - next.delay;\r\n if (nextTime >= 0) {\r\n next.delay = 0;\r\n next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\r\n current.trackTime += currentDelta;\r\n this.setCurrent(i, next, true);\r\n while (next.mixingFrom != null) {\r\n next.mixTime += delta;\r\n next = next.mixingFrom;\r\n }\r\n continue;\r\n }\r\n }\r\n else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\r\n tracks[i] = null;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n continue;\r\n }\r\n if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\r\n var from = current.mixingFrom;\r\n current.mixingFrom = null;\r\n if (from != null)\r\n from.mixingTo = null;\r\n while (from != null) {\r\n this.queue.end(from);\r\n from = from.mixingFrom;\r\n }\r\n }\r\n current.trackTime += currentDelta;\r\n }\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\r\n var from = to.mixingFrom;\r\n if (from == null)\r\n return true;\r\n var finished = this.updateMixingFrom(from, delta);\r\n from.animationLast = from.nextAnimationLast;\r\n from.trackLast = from.nextTrackLast;\r\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\r\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\r\n to.mixingFrom = from.mixingFrom;\r\n if (from.mixingFrom != null)\r\n from.mixingFrom.mixingTo = to;\r\n to.interruptAlpha = from.interruptAlpha;\r\n this.queue.end(from);\r\n }\r\n return finished;\r\n }\r\n from.trackTime += delta * from.timeScale;\r\n to.mixTime += delta;\r\n return false;\r\n };\r\n AnimationState.prototype.apply = function (skeleton) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n if (this.animationsChanged)\r\n this._animationsChanged();\r\n var events = this.events;\r\n var tracks = this.tracks;\r\n var applied = false;\r\n for (var i_16 = 0, n_1 = tracks.length; i_16 < n_1; i_16++) {\r\n var current = tracks[i_16];\r\n if (current == null || current.delay > 0)\r\n continue;\r\n applied = true;\r\n var blend = i_16 == 0 ? spine.MixBlend.first : current.mixBlend;\r\n var mix = current.alpha;\r\n if (current.mixingFrom != null)\r\n mix *= this.applyMixingFrom(current, skeleton, blend);\r\n else if (current.trackTime >= current.trackEnd && current.next == null)\r\n mix = 0;\r\n var animationLast = current.animationLast, animationTime = current.getAnimationTime();\r\n var timelineCount = current.animation.timelines.length;\r\n var timelines = current.animation.timelines;\r\n if ((i_16 == 0 && mix == 1) || blend == spine.MixBlend.add) {\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n spine.Utils.webkit602BugfixHelper(mix, blend);\r\n var timeline = timelines[ii];\r\n if (timeline instanceof spine.AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, blend, true);\r\n else\r\n timeline.apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);\r\n }\r\n }\r\n else {\r\n var timelineMode = current.timelineMode;\r\n var firstFrame = current.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = current.timelinesRotation;\r\n for (var ii = 0; ii < timelineCount; ii++) {\r\n var timeline_1 = timelines[ii];\r\n var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup;\r\n if (timeline_1 instanceof spine.RotateTimeline) {\r\n this.applyRotateTimeline(timeline_1, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\r\n }\r\n else if (timeline_1 instanceof spine.AttachmentTimeline) {\r\n this.applyAttachmentTimeline(timeline_1, skeleton, animationTime, blend, true);\r\n }\r\n else {\r\n spine.Utils.webkit602BugfixHelper(mix, blend);\r\n timeline_1.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);\r\n }\r\n }\r\n }\r\n this.queueEvents(current, animationTime);\r\n events.length = 0;\r\n current.nextAnimationLast = animationTime;\r\n current.nextTrackLast = current.trackTime;\r\n }\r\n var setupState = this.unkeyedState + AnimationState.SETUP;\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = skeleton.slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.attachmentState == setupState) {\r\n var attachmentName = slot.data.attachmentName;\r\n slot.attachment = (attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));\r\n }\r\n }\r\n this.unkeyedState += 2;\r\n this.queue.drain();\r\n return applied;\r\n };\r\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\r\n var from = to.mixingFrom;\r\n if (from.mixingFrom != null)\r\n this.applyMixingFrom(from, skeleton, blend);\r\n var mix = 0;\r\n if (to.mixDuration == 0) {\r\n mix = 1;\r\n if (blend == spine.MixBlend.first)\r\n blend = spine.MixBlend.setup;\r\n }\r\n else {\r\n mix = to.mixTime / to.mixDuration;\r\n if (mix > 1)\r\n mix = 1;\r\n if (blend != spine.MixBlend.first)\r\n blend = from.mixBlend;\r\n }\r\n var events = mix < from.eventThreshold ? this.events : null;\r\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\r\n var animationLast = from.animationLast, animationTime = from.getAnimationTime();\r\n var timelineCount = from.animation.timelines.length;\r\n var timelines = from.animation.timelines;\r\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\r\n if (blend == spine.MixBlend.add) {\r\n for (var i = 0; i < timelineCount; i++)\r\n timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);\r\n }\r\n else {\r\n var timelineMode = from.timelineMode;\r\n var timelineHoldMix = from.timelineHoldMix;\r\n var firstFrame = from.timelinesRotation.length == 0;\r\n if (firstFrame)\r\n spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\r\n var timelinesRotation = from.timelinesRotation;\r\n from.totalAlpha = 0;\r\n for (var i = 0; i < timelineCount; i++) {\r\n var timeline = timelines[i];\r\n var direction = spine.MixDirection.mixOut;\r\n var timelineBlend = void 0;\r\n var alpha = 0;\r\n switch (timelineMode[i]) {\r\n case AnimationState.SUBSEQUENT:\r\n if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)\r\n continue;\r\n timelineBlend = blend;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.FIRST:\r\n timelineBlend = spine.MixBlend.setup;\r\n alpha = alphaMix;\r\n break;\r\n case AnimationState.HOLD_SUBSEQUENT:\r\n timelineBlend = blend;\r\n alpha = alphaHold;\r\n break;\r\n case AnimationState.HOLD_FIRST:\r\n timelineBlend = spine.MixBlend.setup;\r\n alpha = alphaHold;\r\n break;\r\n default:\r\n timelineBlend = spine.MixBlend.setup;\r\n var holdMix = timelineHoldMix[i];\r\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\r\n break;\r\n }\r\n from.totalAlpha += alpha;\r\n if (timeline instanceof spine.RotateTimeline)\r\n this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\r\n else if (timeline instanceof spine.AttachmentTimeline)\r\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, timelineBlend, attachments);\r\n else {\r\n spine.Utils.webkit602BugfixHelper(alpha, blend);\r\n if (drawOrder && timeline instanceof spine.DrawOrderTimeline && timelineBlend == spine.MixBlend.setup)\r\n direction = spine.MixDirection.mixIn;\r\n timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\r\n }\r\n }\r\n }\r\n if (to.mixDuration > 0)\r\n this.queueEvents(from, animationTime);\r\n this.events.length = 0;\r\n from.nextAnimationLast = animationTime;\r\n from.nextTrackLast = from.trackTime;\r\n return mix;\r\n };\r\n AnimationState.prototype.applyAttachmentTimeline = function (timeline, skeleton, time, blend, attachments) {\r\n var slot = skeleton.slots[timeline.slotIndex];\r\n if (!slot.bone.active)\r\n return;\r\n var frames = timeline.frames;\r\n if (time < frames[0]) {\r\n if (blend == spine.MixBlend.setup || blend == spine.MixBlend.first)\r\n this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\r\n }\r\n else {\r\n var frameIndex;\r\n if (time >= frames[frames.length - 1])\r\n frameIndex = frames.length - 1;\r\n else\r\n frameIndex = spine.Animation.binarySearch(frames, time) - 1;\r\n this.setAttachment(skeleton, slot, timeline.attachmentNames[frameIndex], attachments);\r\n }\r\n if (slot.attachmentState <= this.unkeyedState)\r\n slot.attachmentState = this.unkeyedState + AnimationState.SETUP;\r\n };\r\n AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {\r\n slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);\r\n if (attachments)\r\n slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;\r\n };\r\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\r\n if (firstFrame)\r\n timelinesRotation[i] = 0;\r\n if (alpha == 1) {\r\n timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);\r\n return;\r\n }\r\n var rotateTimeline = timeline;\r\n var frames = rotateTimeline.frames;\r\n var bone = skeleton.bones[rotateTimeline.boneIndex];\r\n if (!bone.active)\r\n return;\r\n var r1 = 0, r2 = 0;\r\n if (time < frames[0]) {\r\n switch (blend) {\r\n case spine.MixBlend.setup:\r\n bone.rotation = bone.data.rotation;\r\n default:\r\n return;\r\n case spine.MixBlend.first:\r\n r1 = bone.rotation;\r\n r2 = bone.data.rotation;\r\n }\r\n }\r\n else {\r\n r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation;\r\n if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES])\r\n r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION];\r\n else {\r\n var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES);\r\n var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION];\r\n var frameTime = frames[frame];\r\n var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime));\r\n r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n r2 = prevRotation + r2 * percent + bone.data.rotation;\r\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\r\n }\r\n }\r\n var total = 0, diff = r2 - r1;\r\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\r\n if (diff == 0) {\r\n total = timelinesRotation[i];\r\n }\r\n else {\r\n var lastTotal = 0, lastDiff = 0;\r\n if (firstFrame) {\r\n lastTotal = 0;\r\n lastDiff = diff;\r\n }\r\n else {\r\n lastTotal = timelinesRotation[i];\r\n lastDiff = timelinesRotation[i + 1];\r\n }\r\n var current = diff > 0, dir = lastTotal >= 0;\r\n if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\r\n if (Math.abs(lastTotal) > 180)\r\n lastTotal += 360 * spine.MathUtils.signum(lastTotal);\r\n dir = current;\r\n }\r\n total = diff + lastTotal - lastTotal % 360;\r\n if (dir != current)\r\n total += 360 * spine.MathUtils.signum(lastTotal);\r\n timelinesRotation[i] = total;\r\n }\r\n timelinesRotation[i + 1] = diff;\r\n r1 += total * alpha;\r\n bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\r\n };\r\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\r\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\r\n var duration = animationEnd - animationStart;\r\n var trackLastWrapped = entry.trackLast % duration;\r\n var events = this.events;\r\n var i = 0, n = events.length;\r\n for (; i < n; i++) {\r\n var event_1 = events[i];\r\n if (event_1.time < trackLastWrapped)\r\n break;\r\n if (event_1.time > animationEnd)\r\n continue;\r\n this.queue.event(entry, event_1);\r\n }\r\n var complete = false;\r\n if (entry.loop)\r\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\r\n else\r\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\r\n if (complete)\r\n this.queue.complete(entry);\r\n for (; i < n; i++) {\r\n var event_2 = events[i];\r\n if (event_2.time < animationStart)\r\n continue;\r\n this.queue.event(entry, events[i]);\r\n }\r\n };\r\n AnimationState.prototype.clearTracks = function () {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++)\r\n this.clearTrack(i);\r\n this.tracks.length = 0;\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.clearTrack = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return;\r\n var current = this.tracks[trackIndex];\r\n if (current == null)\r\n return;\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n var entry = current;\r\n while (true) {\r\n var from = entry.mixingFrom;\r\n if (from == null)\r\n break;\r\n this.queue.end(from);\r\n entry.mixingFrom = null;\r\n entry.mixingTo = null;\r\n entry = from;\r\n }\r\n this.tracks[current.trackIndex] = null;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\r\n var from = this.expandToIndex(index);\r\n this.tracks[index] = current;\r\n if (from != null) {\r\n if (interrupt)\r\n this.queue.interrupt(from);\r\n current.mixingFrom = from;\r\n from.mixingTo = current;\r\n current.mixTime = 0;\r\n if (from.mixingFrom != null && from.mixDuration > 0)\r\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\r\n from.timelinesRotation.length = 0;\r\n }\r\n this.queue.start(current);\r\n };\r\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.setAnimationWith(trackIndex, animation, loop);\r\n };\r\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var interrupt = true;\r\n var current = this.expandToIndex(trackIndex);\r\n if (current != null) {\r\n if (current.nextTrackLast == -1) {\r\n this.tracks[trackIndex] = current.mixingFrom;\r\n this.queue.interrupt(current);\r\n this.queue.end(current);\r\n this.disposeNext(current);\r\n current = current.mixingFrom;\r\n interrupt = false;\r\n }\r\n else\r\n this.disposeNext(current);\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, current);\r\n this.setCurrent(trackIndex, entry, interrupt);\r\n this.queue.drain();\r\n return entry;\r\n };\r\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\r\n var animation = this.data.skeletonData.findAnimation(animationName);\r\n if (animation == null)\r\n throw new Error(\"Animation not found: \" + animationName);\r\n return this.addAnimationWith(trackIndex, animation, loop, delay);\r\n };\r\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\r\n if (animation == null)\r\n throw new Error(\"animation cannot be null.\");\r\n var last = this.expandToIndex(trackIndex);\r\n if (last != null) {\r\n while (last.next != null)\r\n last = last.next;\r\n }\r\n var entry = this.trackEntry(trackIndex, animation, loop, last);\r\n if (last == null) {\r\n this.setCurrent(trackIndex, entry, true);\r\n this.queue.drain();\r\n }\r\n else {\r\n last.next = entry;\r\n if (delay <= 0) {\r\n var duration = last.animationEnd - last.animationStart;\r\n if (duration != 0) {\r\n if (last.loop)\r\n delay += duration * (1 + ((last.trackTime / duration) | 0));\r\n else\r\n delay += Math.max(duration, last.trackTime);\r\n delay -= this.data.getMix(last.animation, animation);\r\n }\r\n else\r\n delay = last.trackTime;\r\n }\r\n }\r\n entry.delay = delay;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\r\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\r\n if (delay <= 0)\r\n delay -= mixDuration;\r\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\r\n entry.mixDuration = mixDuration;\r\n entry.trackEnd = mixDuration;\r\n return entry;\r\n };\r\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\r\n var oldDrainDisabled = this.queue.drainDisabled;\r\n this.queue.drainDisabled = true;\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var current = this.tracks[i];\r\n if (current != null)\r\n this.setEmptyAnimation(current.trackIndex, mixDuration);\r\n }\r\n this.queue.drainDisabled = oldDrainDisabled;\r\n this.queue.drain();\r\n };\r\n AnimationState.prototype.expandToIndex = function (index) {\r\n if (index < this.tracks.length)\r\n return this.tracks[index];\r\n spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null);\r\n this.tracks.length = index + 1;\r\n return null;\r\n };\r\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\r\n var entry = this.trackEntryPool.obtain();\r\n entry.trackIndex = trackIndex;\r\n entry.animation = animation;\r\n entry.loop = loop;\r\n entry.holdPrevious = false;\r\n entry.eventThreshold = 0;\r\n entry.attachmentThreshold = 0;\r\n entry.drawOrderThreshold = 0;\r\n entry.animationStart = 0;\r\n entry.animationEnd = animation.duration;\r\n entry.animationLast = -1;\r\n entry.nextAnimationLast = -1;\r\n entry.delay = 0;\r\n entry.trackTime = 0;\r\n entry.trackLast = -1;\r\n entry.nextTrackLast = -1;\r\n entry.trackEnd = Number.MAX_VALUE;\r\n entry.timeScale = 1;\r\n entry.alpha = 1;\r\n entry.interruptAlpha = 1;\r\n entry.mixTime = 0;\r\n entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\r\n entry.mixBlend = spine.MixBlend.replace;\r\n return entry;\r\n };\r\n AnimationState.prototype.disposeNext = function (entry) {\r\n var next = entry.next;\r\n while (next != null) {\r\n this.queue.dispose(next);\r\n next = next.next;\r\n }\r\n entry.next = null;\r\n };\r\n AnimationState.prototype._animationsChanged = function () {\r\n this.animationsChanged = false;\r\n this.propertyIDs.clear();\r\n for (var i = 0, n = this.tracks.length; i < n; i++) {\r\n var entry = this.tracks[i];\r\n if (entry == null)\r\n continue;\r\n while (entry.mixingFrom != null)\r\n entry = entry.mixingFrom;\r\n do {\r\n if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add)\r\n this.computeHold(entry);\r\n entry = entry.mixingTo;\r\n } while (entry != null);\r\n }\r\n };\r\n AnimationState.prototype.computeHold = function (entry) {\r\n var to = entry.mixingTo;\r\n var timelines = entry.animation.timelines;\r\n var timelinesCount = entry.animation.timelines.length;\r\n var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount);\r\n entry.timelineHoldMix.length = 0;\r\n var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\r\n var propertyIDs = this.propertyIDs;\r\n if (to != null && to.holdPrevious) {\r\n for (var i = 0; i < timelinesCount; i++) {\r\n timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;\r\n }\r\n return;\r\n }\r\n outer: for (var i = 0; i < timelinesCount; i++) {\r\n var timeline = timelines[i];\r\n var id = timeline.getPropertyId();\r\n if (!propertyIDs.add(id))\r\n timelineMode[i] = AnimationState.SUBSEQUENT;\r\n else if (to == null || timeline instanceof spine.AttachmentTimeline || timeline instanceof spine.DrawOrderTimeline\r\n || timeline instanceof spine.EventTimeline || !to.animation.hasTimeline(id)) {\r\n timelineMode[i] = AnimationState.FIRST;\r\n }\r\n else {\r\n for (var next = to.mixingTo; next != null; next = next.mixingTo) {\r\n if (next.animation.hasTimeline(id))\r\n continue;\r\n if (entry.mixDuration > 0) {\r\n timelineMode[i] = AnimationState.HOLD_MIX;\r\n timelineDipMix[i] = next;\r\n continue outer;\r\n }\r\n break;\r\n }\r\n timelineMode[i] = AnimationState.HOLD_FIRST;\r\n }\r\n }\r\n };\r\n AnimationState.prototype.getCurrent = function (trackIndex) {\r\n if (trackIndex >= this.tracks.length)\r\n return null;\r\n return this.tracks[trackIndex];\r\n };\r\n AnimationState.prototype.addListener = function (listener) {\r\n if (listener == null)\r\n throw new Error(\"listener cannot be null.\");\r\n this.listeners.push(listener);\r\n };\r\n AnimationState.prototype.removeListener = function (listener) {\r\n var index = this.listeners.indexOf(listener);\r\n if (index >= 0)\r\n this.listeners.splice(index, 1);\r\n };\r\n AnimationState.prototype.clearListeners = function () {\r\n this.listeners.length = 0;\r\n };\r\n AnimationState.prototype.clearListenerNotifications = function () {\r\n this.queue.clear();\r\n };\r\n AnimationState.emptyAnimation = new spine.Animation(\"\", [], 0);\r\n AnimationState.SUBSEQUENT = 0;\r\n AnimationState.FIRST = 1;\r\n AnimationState.HOLD_SUBSEQUENT = 2;\r\n AnimationState.HOLD_FIRST = 3;\r\n AnimationState.HOLD_MIX = 4;\r\n AnimationState.SETUP = 1;\r\n AnimationState.CURRENT = 2;\r\n return AnimationState;\r\n }());\r\n spine.AnimationState = AnimationState;\r\n var TrackEntry = (function () {\r\n function TrackEntry() {\r\n this.mixBlend = spine.MixBlend.replace;\r\n this.timelineMode = new Array();\r\n this.timelineHoldMix = new Array();\r\n this.timelinesRotation = new Array();\r\n }\r\n TrackEntry.prototype.reset = function () {\r\n this.next = null;\r\n this.mixingFrom = null;\r\n this.mixingTo = null;\r\n this.animation = null;\r\n this.listener = null;\r\n this.timelineMode.length = 0;\r\n this.timelineHoldMix.length = 0;\r\n this.timelinesRotation.length = 0;\r\n };\r\n TrackEntry.prototype.getAnimationTime = function () {\r\n if (this.loop) {\r\n var duration = this.animationEnd - this.animationStart;\r\n if (duration == 0)\r\n return this.animationStart;\r\n return (this.trackTime % duration) + this.animationStart;\r\n }\r\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\r\n };\r\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\r\n this.animationLast = animationLast;\r\n this.nextAnimationLast = animationLast;\r\n };\r\n TrackEntry.prototype.isComplete = function () {\r\n return this.trackTime >= this.animationEnd - this.animationStart;\r\n };\r\n TrackEntry.prototype.resetRotationDirections = function () {\r\n this.timelinesRotation.length = 0;\r\n };\r\n return TrackEntry;\r\n }());\r\n spine.TrackEntry = TrackEntry;\r\n var EventQueue = (function () {\r\n function EventQueue(animState) {\r\n this.objects = [];\r\n this.drainDisabled = false;\r\n this.animState = animState;\r\n }\r\n EventQueue.prototype.start = function (entry) {\r\n this.objects.push(EventType.start);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.interrupt = function (entry) {\r\n this.objects.push(EventType.interrupt);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.end = function (entry) {\r\n this.objects.push(EventType.end);\r\n this.objects.push(entry);\r\n this.animState.animationsChanged = true;\r\n };\r\n EventQueue.prototype.dispose = function (entry) {\r\n this.objects.push(EventType.dispose);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.complete = function (entry) {\r\n this.objects.push(EventType.complete);\r\n this.objects.push(entry);\r\n };\r\n EventQueue.prototype.event = function (entry, event) {\r\n this.objects.push(EventType.event);\r\n this.objects.push(entry);\r\n this.objects.push(event);\r\n };\r\n EventQueue.prototype.drain = function () {\r\n if (this.drainDisabled)\r\n return;\r\n this.drainDisabled = true;\r\n var objects = this.objects;\r\n var listeners = this.animState.listeners;\r\n for (var i = 0; i < objects.length; i += 2) {\r\n var type = objects[i];\r\n var entry = objects[i + 1];\r\n switch (type) {\r\n case EventType.start:\r\n if (entry.listener != null && entry.listener.start)\r\n entry.listener.start(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].start)\r\n listeners[ii].start(entry);\r\n break;\r\n case EventType.interrupt:\r\n if (entry.listener != null && entry.listener.interrupt)\r\n entry.listener.interrupt(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].interrupt)\r\n listeners[ii].interrupt(entry);\r\n break;\r\n case EventType.end:\r\n if (entry.listener != null && entry.listener.end)\r\n entry.listener.end(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].end)\r\n listeners[ii].end(entry);\r\n case EventType.dispose:\r\n if (entry.listener != null && entry.listener.dispose)\r\n entry.listener.dispose(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].dispose)\r\n listeners[ii].dispose(entry);\r\n this.animState.trackEntryPool.free(entry);\r\n break;\r\n case EventType.complete:\r\n if (entry.listener != null && entry.listener.complete)\r\n entry.listener.complete(entry);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].complete)\r\n listeners[ii].complete(entry);\r\n break;\r\n case EventType.event:\r\n var event_3 = objects[i++ + 2];\r\n if (entry.listener != null && entry.listener.event)\r\n entry.listener.event(entry, event_3);\r\n for (var ii = 0; ii < listeners.length; ii++)\r\n if (listeners[ii].event)\r\n listeners[ii].event(entry, event_3);\r\n break;\r\n }\r\n }\r\n this.clear();\r\n this.drainDisabled = false;\r\n };\r\n EventQueue.prototype.clear = function () {\r\n this.objects.length = 0;\r\n };\r\n return EventQueue;\r\n }());\r\n spine.EventQueue = EventQueue;\r\n var EventType;\r\n (function (EventType) {\r\n EventType[EventType[\"start\"] = 0] = \"start\";\r\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\r\n EventType[EventType[\"end\"] = 2] = \"end\";\r\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\r\n EventType[EventType[\"complete\"] = 4] = \"complete\";\r\n EventType[EventType[\"event\"] = 5] = \"event\";\r\n })(EventType = spine.EventType || (spine.EventType = {}));\r\n var AnimationStateAdapter = (function () {\r\n function AnimationStateAdapter() {\r\n }\r\n AnimationStateAdapter.prototype.start = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.interrupt = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.end = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.dispose = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.complete = function (entry) {\r\n };\r\n AnimationStateAdapter.prototype.event = function (entry, event) {\r\n };\r\n return AnimationStateAdapter;\r\n }());\r\n spine.AnimationStateAdapter = AnimationStateAdapter;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AnimationStateData = (function () {\r\n function AnimationStateData(skeletonData) {\r\n this.animationToMixTime = {};\r\n this.defaultMix = 0;\r\n if (skeletonData == null)\r\n throw new Error(\"skeletonData cannot be null.\");\r\n this.skeletonData = skeletonData;\r\n }\r\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\r\n var from = this.skeletonData.findAnimation(fromName);\r\n if (from == null)\r\n throw new Error(\"Animation not found: \" + fromName);\r\n var to = this.skeletonData.findAnimation(toName);\r\n if (to == null)\r\n throw new Error(\"Animation not found: \" + toName);\r\n this.setMixWith(from, to, duration);\r\n };\r\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\r\n if (from == null)\r\n throw new Error(\"from cannot be null.\");\r\n if (to == null)\r\n throw new Error(\"to cannot be null.\");\r\n var key = from.name + \".\" + to.name;\r\n this.animationToMixTime[key] = duration;\r\n };\r\n AnimationStateData.prototype.getMix = function (from, to) {\r\n var key = from.name + \".\" + to.name;\r\n var value = this.animationToMixTime[key];\r\n return value === undefined ? this.defaultMix : value;\r\n };\r\n return AnimationStateData;\r\n }());\r\n spine.AnimationStateData = AnimationStateData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AssetManager = (function () {\r\n function AssetManager(textureLoader, pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n this.assets = {};\r\n this.errors = {};\r\n this.toLoad = 0;\r\n this.loaded = 0;\r\n this.rawDataUris = {};\r\n this.textureLoader = textureLoader;\r\n this.pathPrefix = pathPrefix;\r\n }\r\n AssetManager.prototype.downloadText = function (url, success, error) {\r\n var request = new XMLHttpRequest();\r\n request.overrideMimeType(\"text/html\");\r\n if (this.rawDataUris[url])\r\n url = this.rawDataUris[url];\r\n request.open(\"GET\", url, true);\r\n request.onload = function () {\r\n if (request.status == 200) {\r\n success(request.responseText);\r\n }\r\n else {\r\n error(request.status, request.responseText);\r\n }\r\n };\r\n request.onerror = function () {\r\n error(request.status, request.responseText);\r\n };\r\n request.send();\r\n };\r\n AssetManager.prototype.downloadBinary = function (url, success, error) {\r\n var request = new XMLHttpRequest();\r\n if (this.rawDataUris[url])\r\n url = this.rawDataUris[url];\r\n request.open(\"GET\", url, true);\r\n request.responseType = \"arraybuffer\";\r\n request.onload = function () {\r\n if (request.status == 200) {\r\n success(new Uint8Array(request.response));\r\n }\r\n else {\r\n error(request.status, request.responseText);\r\n }\r\n };\r\n request.onerror = function () {\r\n error(request.status, request.responseText);\r\n };\r\n request.send();\r\n };\r\n AssetManager.prototype.setRawDataURI = function (path, data) {\r\n this.rawDataUris[this.pathPrefix + path] = data;\r\n };\r\n AssetManager.prototype.loadBinary = function (path, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n path = this.pathPrefix + path;\r\n this.toLoad++;\r\n this.downloadBinary(path, function (data) {\r\n _this.assets[path] = data;\r\n if (success)\r\n success(path, data);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }, function (state, responseText) {\r\n _this.errors[path] = \"Couldn't load binary \" + path + \": status \" + status + \", \" + responseText;\r\n if (error)\r\n error(path, \"Couldn't load binary \" + path + \": status \" + status + \", \" + responseText);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n });\r\n };\r\n AssetManager.prototype.loadText = function (path, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n path = this.pathPrefix + path;\r\n this.toLoad++;\r\n this.downloadText(path, function (data) {\r\n _this.assets[path] = data;\r\n if (success)\r\n success(path, data);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }, function (state, responseText) {\r\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText;\r\n if (error)\r\n error(path, \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n });\r\n };\r\n AssetManager.prototype.loadTexture = function (path, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n path = this.pathPrefix + path;\r\n var storagePath = path;\r\n this.toLoad++;\r\n var img = new Image();\r\n img.crossOrigin = \"anonymous\";\r\n img.onload = function (ev) {\r\n var texture = _this.textureLoader(img);\r\n _this.assets[storagePath] = texture;\r\n _this.toLoad--;\r\n _this.loaded++;\r\n if (success)\r\n success(path, img);\r\n };\r\n img.onerror = function (ev) {\r\n _this.errors[path] = \"Couldn't load image \" + path;\r\n _this.toLoad--;\r\n _this.loaded++;\r\n if (error)\r\n error(path, \"Couldn't load image \" + path);\r\n };\r\n if (this.rawDataUris[path])\r\n path = this.rawDataUris[path];\r\n img.src = path;\r\n };\r\n AssetManager.prototype.loadTextureAtlas = function (path, success, error) {\r\n var _this = this;\r\n if (success === void 0) { success = null; }\r\n if (error === void 0) { error = null; }\r\n var parent = path.lastIndexOf(\"/\") >= 0 ? path.substring(0, path.lastIndexOf(\"/\")) : \"\";\r\n path = this.pathPrefix + path;\r\n this.toLoad++;\r\n this.downloadText(path, function (atlasData) {\r\n var pagesLoaded = { count: 0 };\r\n var atlasPages = new Array();\r\n try {\r\n var atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n atlasPages.push(parent == \"\" ? path : parent + \"/\" + path);\r\n var image = document.createElement(\"img\");\r\n image.width = 16;\r\n image.height = 16;\r\n return new spine.FakeTexture(image);\r\n });\r\n }\r\n catch (e) {\r\n var ex = e;\r\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n return;\r\n }\r\n var _loop_1 = function (atlasPage) {\r\n var pageLoadError = false;\r\n _this.loadTexture(atlasPage, function (imagePath, image) {\r\n pagesLoaded.count++;\r\n if (pagesLoaded.count == atlasPages.length) {\r\n if (!pageLoadError) {\r\n try {\r\n var atlas = new spine.TextureAtlas(atlasData, function (path) {\r\n return _this.get(parent == \"\" ? path : parent + \"/\" + path);\r\n });\r\n _this.assets[path] = atlas;\r\n if (success)\r\n success(path, atlas);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n catch (e) {\r\n var ex = e;\r\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n }\r\n else {\r\n _this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n }\r\n }, function (imagePath, errorMessage) {\r\n pageLoadError = true;\r\n pagesLoaded.count++;\r\n if (pagesLoaded.count == atlasPages.length) {\r\n _this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n }\r\n });\r\n };\r\n for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) {\r\n var atlasPage = atlasPages_1[_i];\r\n _loop_1(atlasPage);\r\n }\r\n }, function (state, responseText) {\r\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText;\r\n if (error)\r\n error(path, \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText);\r\n _this.toLoad--;\r\n _this.loaded++;\r\n });\r\n };\r\n AssetManager.prototype.get = function (path) {\r\n path = this.pathPrefix + path;\r\n return this.assets[path];\r\n };\r\n AssetManager.prototype.remove = function (path) {\r\n path = this.pathPrefix + path;\r\n var asset = this.assets[path];\r\n if (asset.dispose)\r\n asset.dispose();\r\n this.assets[path] = null;\r\n };\r\n AssetManager.prototype.removeAll = function () {\r\n for (var key in this.assets) {\r\n var asset = this.assets[key];\r\n if (asset.dispose)\r\n asset.dispose();\r\n }\r\n this.assets = {};\r\n };\r\n AssetManager.prototype.isLoadingComplete = function () {\r\n return this.toLoad == 0;\r\n };\r\n AssetManager.prototype.getToLoad = function () {\r\n return this.toLoad;\r\n };\r\n AssetManager.prototype.getLoaded = function () {\r\n return this.loaded;\r\n };\r\n AssetManager.prototype.dispose = function () {\r\n this.removeAll();\r\n };\r\n AssetManager.prototype.hasErrors = function () {\r\n return Object.keys(this.errors).length > 0;\r\n };\r\n AssetManager.prototype.getErrors = function () {\r\n return this.errors;\r\n };\r\n return AssetManager;\r\n }());\r\n spine.AssetManager = AssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AtlasAttachmentLoader = (function () {\r\n function AtlasAttachmentLoader(atlas) {\r\n this.atlas = atlas;\r\n }\r\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n var attachment = new spine.RegionAttachment(name);\r\n attachment.setRegion(region);\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\r\n var region = this.atlas.findRegion(path);\r\n if (region == null)\r\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\r\n region.renderObject = region;\r\n var attachment = new spine.MeshAttachment(name);\r\n attachment.region = region;\r\n return attachment;\r\n };\r\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\r\n return new spine.BoundingBoxAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\r\n return new spine.PathAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\r\n return new spine.PointAttachment(name);\r\n };\r\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\r\n return new spine.ClippingAttachment(name);\r\n };\r\n return AtlasAttachmentLoader;\r\n }());\r\n spine.AtlasAttachmentLoader = AtlasAttachmentLoader;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var BlendMode;\r\n (function (BlendMode) {\r\n BlendMode[BlendMode[\"Normal\"] = 0] = \"Normal\";\r\n BlendMode[BlendMode[\"Additive\"] = 1] = \"Additive\";\r\n BlendMode[BlendMode[\"Multiply\"] = 2] = \"Multiply\";\r\n BlendMode[BlendMode[\"Screen\"] = 3] = \"Screen\";\r\n })(BlendMode = spine.BlendMode || (spine.BlendMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Bone = (function () {\r\n function Bone(data, skeleton, parent) {\r\n this.children = new Array();\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 0;\r\n this.scaleY = 0;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.ax = 0;\r\n this.ay = 0;\r\n this.arotation = 0;\r\n this.ascaleX = 0;\r\n this.ascaleY = 0;\r\n this.ashearX = 0;\r\n this.ashearY = 0;\r\n this.appliedValid = false;\r\n this.a = 0;\r\n this.b = 0;\r\n this.c = 0;\r\n this.d = 0;\r\n this.worldY = 0;\r\n this.worldX = 0;\r\n this.sorted = false;\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.skeleton = skeleton;\r\n this.parent = parent;\r\n this.setToSetupPose();\r\n }\r\n Bone.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n Bone.prototype.update = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n Bone.prototype.updateWorldTransform = function () {\r\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\r\n };\r\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\r\n this.ax = x;\r\n this.ay = y;\r\n this.arotation = rotation;\r\n this.ascaleX = scaleX;\r\n this.ascaleY = scaleY;\r\n this.ashearX = shearX;\r\n this.ashearY = shearY;\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n if (parent == null) {\r\n var skeleton = this.skeleton;\r\n var rotationY = rotation + 90 + shearY;\r\n var sx = skeleton.scaleX;\r\n var sy = skeleton.scaleY;\r\n this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\r\n this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx;\r\n this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\r\n this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;\r\n this.worldX = x * sx + skeleton.x;\r\n this.worldY = y * sy + skeleton.y;\r\n return;\r\n }\r\n var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n this.worldX = pa * x + pb * y + parent.worldX;\r\n this.worldY = pc * x + pd * y + parent.worldY;\r\n switch (this.data.transformMode) {\r\n case spine.TransformMode.Normal: {\r\n var rotationY = rotation + 90 + shearY;\r\n var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n this.a = pa * la + pb * lc;\r\n this.b = pa * lb + pb * ld;\r\n this.c = pc * la + pd * lc;\r\n this.d = pc * lb + pd * ld;\r\n return;\r\n }\r\n case spine.TransformMode.OnlyTranslation: {\r\n var rotationY = rotation + 90 + shearY;\r\n this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\r\n this.b = spine.MathUtils.cosDeg(rotationY) * scaleY;\r\n this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\r\n this.d = spine.MathUtils.sinDeg(rotationY) * scaleY;\r\n break;\r\n }\r\n case spine.TransformMode.NoRotationOrReflection: {\r\n var s = pa * pa + pc * pc;\r\n var prx = 0;\r\n if (s > 0.0001) {\r\n s = Math.abs(pa * pd - pb * pc) / s;\r\n pa /= this.skeleton.scaleX;\r\n pc /= this.skeleton.scaleY;\r\n pb = pc * s;\r\n pd = pa * s;\r\n prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;\r\n }\r\n else {\r\n pa = 0;\r\n pc = 0;\r\n prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;\r\n }\r\n var rx = rotation + shearX - prx;\r\n var ry = rotation + shearY - prx + 90;\r\n var la = spine.MathUtils.cosDeg(rx) * scaleX;\r\n var lb = spine.MathUtils.cosDeg(ry) * scaleY;\r\n var lc = spine.MathUtils.sinDeg(rx) * scaleX;\r\n var ld = spine.MathUtils.sinDeg(ry) * scaleY;\r\n this.a = pa * la - pb * lc;\r\n this.b = pa * lb - pb * ld;\r\n this.c = pc * la + pd * lc;\r\n this.d = pc * lb + pd * ld;\r\n break;\r\n }\r\n case spine.TransformMode.NoScale:\r\n case spine.TransformMode.NoScaleOrReflection: {\r\n var cos = spine.MathUtils.cosDeg(rotation);\r\n var sin = spine.MathUtils.sinDeg(rotation);\r\n var za = (pa * cos + pb * sin) / this.skeleton.scaleX;\r\n var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\r\n var s = Math.sqrt(za * za + zc * zc);\r\n if (s > 0.00001)\r\n s = 1 / s;\r\n za *= s;\r\n zc *= s;\r\n s = Math.sqrt(za * za + zc * zc);\r\n if (this.data.transformMode == spine.TransformMode.NoScale\r\n && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))\r\n s = -s;\r\n var r = Math.PI / 2 + Math.atan2(zc, za);\r\n var zb = Math.cos(r) * s;\r\n var zd = Math.sin(r) * s;\r\n var la = spine.MathUtils.cosDeg(shearX) * scaleX;\r\n var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;\r\n var lc = spine.MathUtils.sinDeg(shearX) * scaleX;\r\n var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;\r\n this.a = za * la + zb * lc;\r\n this.b = za * lb + zb * ld;\r\n this.c = zc * la + zd * lc;\r\n this.d = zc * lb + zd * ld;\r\n break;\r\n }\r\n }\r\n this.a *= this.skeleton.scaleX;\r\n this.b *= this.skeleton.scaleX;\r\n this.c *= this.skeleton.scaleY;\r\n this.d *= this.skeleton.scaleY;\r\n };\r\n Bone.prototype.setToSetupPose = function () {\r\n var data = this.data;\r\n this.x = data.x;\r\n this.y = data.y;\r\n this.rotation = data.rotation;\r\n this.scaleX = data.scaleX;\r\n this.scaleY = data.scaleY;\r\n this.shearX = data.shearX;\r\n this.shearY = data.shearY;\r\n };\r\n Bone.prototype.getWorldRotationX = function () {\r\n return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldRotationY = function () {\r\n return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;\r\n };\r\n Bone.prototype.getWorldScaleX = function () {\r\n return Math.sqrt(this.a * this.a + this.c * this.c);\r\n };\r\n Bone.prototype.getWorldScaleY = function () {\r\n return Math.sqrt(this.b * this.b + this.d * this.d);\r\n };\r\n Bone.prototype.updateAppliedTransform = function () {\r\n this.appliedValid = true;\r\n var parent = this.parent;\r\n if (parent == null) {\r\n this.ax = this.worldX;\r\n this.ay = this.worldY;\r\n this.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\r\n this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\r\n this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\r\n this.ashearX = 0;\r\n this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;\r\n return;\r\n }\r\n var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\r\n var pid = 1 / (pa * pd - pb * pc);\r\n var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\r\n this.ax = (dx * pd * pid - dy * pb * pid);\r\n this.ay = (dy * pa * pid - dx * pc * pid);\r\n var ia = pid * pd;\r\n var id = pid * pa;\r\n var ib = pid * pb;\r\n var ic = pid * pc;\r\n var ra = ia * this.a - ib * this.c;\r\n var rb = ia * this.b - ib * this.d;\r\n var rc = id * this.c - ic * this.a;\r\n var rd = id * this.d - ic * this.b;\r\n this.ashearX = 0;\r\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\r\n if (this.ascaleX > 0.0001) {\r\n var det = ra * rd - rb * rc;\r\n this.ascaleY = det / this.ascaleX;\r\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;\r\n this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;\r\n }\r\n else {\r\n this.ascaleX = 0;\r\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\r\n this.ashearY = 0;\r\n this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;\r\n }\r\n };\r\n Bone.prototype.worldToLocal = function (world) {\r\n var a = this.a, b = this.b, c = this.c, d = this.d;\r\n var invDet = 1 / (a * d - b * c);\r\n var x = world.x - this.worldX, y = world.y - this.worldY;\r\n world.x = (x * d * invDet - y * b * invDet);\r\n world.y = (y * a * invDet - x * c * invDet);\r\n return world;\r\n };\r\n Bone.prototype.localToWorld = function (local) {\r\n var x = local.x, y = local.y;\r\n local.x = x * this.a + y * this.b + this.worldX;\r\n local.y = x * this.c + y * this.d + this.worldY;\r\n return local;\r\n };\r\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\r\n var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);\r\n return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX;\r\n };\r\n Bone.prototype.localToWorldRotation = function (localRotation) {\r\n localRotation -= this.rotation - this.shearX;\r\n var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);\r\n return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;\r\n };\r\n Bone.prototype.rotateWorld = function (degrees) {\r\n var a = this.a, b = this.b, c = this.c, d = this.d;\r\n var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);\r\n this.a = cos * a - sin * c;\r\n this.b = cos * b - sin * d;\r\n this.c = sin * a + cos * c;\r\n this.d = sin * b + cos * d;\r\n this.appliedValid = false;\r\n };\r\n return Bone;\r\n }());\r\n spine.Bone = Bone;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var BoneData = (function () {\r\n function BoneData(index, name, parent) {\r\n this.x = 0;\r\n this.y = 0;\r\n this.rotation = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.shearX = 0;\r\n this.shearY = 0;\r\n this.transformMode = TransformMode.Normal;\r\n this.skinRequired = false;\r\n this.color = new spine.Color();\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.parent = parent;\r\n }\r\n return BoneData;\r\n }());\r\n spine.BoneData = BoneData;\r\n var TransformMode;\r\n (function (TransformMode) {\r\n TransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\r\n TransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\r\n TransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\r\n TransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\r\n TransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\r\n })(TransformMode = spine.TransformMode || (spine.TransformMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var ConstraintData = (function () {\r\n function ConstraintData(name, order, skinRequired) {\r\n this.name = name;\r\n this.order = order;\r\n this.skinRequired = skinRequired;\r\n }\r\n return ConstraintData;\r\n }());\r\n spine.ConstraintData = ConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Event = (function () {\r\n function Event(time, data) {\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.time = time;\r\n this.data = data;\r\n }\r\n return Event;\r\n }());\r\n spine.Event = Event;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var EventData = (function () {\r\n function EventData(name) {\r\n this.name = name;\r\n }\r\n return EventData;\r\n }());\r\n spine.EventData = EventData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var IkConstraint = (function () {\r\n function IkConstraint(data, skeleton) {\r\n this.bendDirection = 0;\r\n this.compress = false;\r\n this.stretch = false;\r\n this.mix = 1;\r\n this.softness = 0;\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.mix = data.mix;\r\n this.softness = data.softness;\r\n this.bendDirection = data.bendDirection;\r\n this.compress = data.compress;\r\n this.stretch = data.stretch;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n IkConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n IkConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n IkConstraint.prototype.update = function () {\r\n var target = this.target;\r\n var bones = this.bones;\r\n switch (bones.length) {\r\n case 1:\r\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\r\n break;\r\n case 2:\r\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.softness, this.mix);\r\n break;\r\n }\r\n };\r\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var p = bone.parent;\r\n var pa = p.a, pb = p.b, pc = p.c, pd = p.d;\r\n var rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\r\n switch (bone.data.transformMode) {\r\n case spine.TransformMode.OnlyTranslation:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n break;\r\n case spine.TransformMode.NoRotationOrReflection:\r\n var s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\r\n var sa = pa / bone.skeleton.scaleX;\r\n var sc = pc / bone.skeleton.scaleY;\r\n pb = -sc * s * bone.skeleton.scaleX;\r\n pd = sa * s * bone.skeleton.scaleY;\r\n rotationIK += Math.atan2(sc, sa) * spine.MathUtils.radDeg;\r\n default:\r\n var x = targetX - p.worldX, y = targetY - p.worldY;\r\n var d = pa * pd - pb * pc;\r\n tx = (x * pd - y * pb) / d - bone.ax;\r\n ty = (y * pa - x * pc) / d - bone.ay;\r\n }\r\n rotationIK += Math.atan2(ty, tx) * spine.MathUtils.radDeg;\r\n if (bone.ascaleX < 0)\r\n rotationIK += 180;\r\n if (rotationIK > 180)\r\n rotationIK -= 360;\r\n else if (rotationIK < -180)\r\n rotationIK += 360;\r\n var sx = bone.ascaleX, sy = bone.ascaleY;\r\n if (compress || stretch) {\r\n switch (bone.data.transformMode) {\r\n case spine.TransformMode.NoScale:\r\n case spine.TransformMode.NoScaleOrReflection:\r\n tx = targetX - bone.worldX;\r\n ty = targetY - bone.worldY;\r\n }\r\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\r\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\r\n var s = (dd / b - 1) * alpha + 1;\r\n sx *= s;\r\n if (uniform)\r\n sy *= s;\r\n }\r\n }\r\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\r\n };\r\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, softness, alpha) {\r\n if (alpha == 0) {\r\n child.updateWorldTransform();\r\n return;\r\n }\r\n if (!parent.appliedValid)\r\n parent.updateAppliedTransform();\r\n if (!child.appliedValid)\r\n child.updateAppliedTransform();\r\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\r\n var os1 = 0, os2 = 0, s2 = 0;\r\n if (psx < 0) {\r\n psx = -psx;\r\n os1 = 180;\r\n s2 = -1;\r\n }\r\n else {\r\n os1 = 0;\r\n s2 = 1;\r\n }\r\n if (psy < 0) {\r\n psy = -psy;\r\n s2 = -s2;\r\n }\r\n if (csx < 0) {\r\n csx = -csx;\r\n os2 = 180;\r\n }\r\n else\r\n os2 = 0;\r\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\r\n var u = Math.abs(psx - psy) <= 0.0001;\r\n if (!u) {\r\n cy = 0;\r\n cwx = a * cx + parent.worldX;\r\n cwy = c * cx + parent.worldY;\r\n }\r\n else {\r\n cy = child.ay;\r\n cwx = a * cx + b * cy + parent.worldX;\r\n cwy = c * cx + d * cy + parent.worldY;\r\n }\r\n var pp = parent.parent;\r\n a = pp.a;\r\n b = pp.b;\r\n c = pp.c;\r\n d = pp.d;\r\n var id = 1 / (a * d - b * c), x = cwx - pp.worldX, y = cwy - pp.worldY;\r\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\r\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\r\n if (l1 < 0.0001) {\r\n this.apply1(parent, targetX, targetY, false, stretch, false, alpha);\r\n child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n return;\r\n }\r\n x = targetX - pp.worldX;\r\n y = targetY - pp.worldY;\r\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\r\n var dd = tx * tx + ty * ty;\r\n if (softness != 0) {\r\n softness *= psx * (csx + 1) / 2;\r\n var td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\r\n if (sd > 0) {\r\n var p = Math.min(1, sd / (softness * 2)) - 1;\r\n p = (sd - softness * (1 - p * p)) / td;\r\n tx -= p * tx;\r\n ty -= p * ty;\r\n dd = tx * tx + ty * ty;\r\n }\r\n }\r\n outer: if (u) {\r\n l2 *= psx;\r\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\r\n if (cos < -1)\r\n cos = -1;\r\n else if (cos > 1) {\r\n cos = 1;\r\n if (stretch)\r\n sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\r\n }\r\n a2 = Math.acos(cos) * bendDir;\r\n a = l1 + l2 * cos;\r\n b = l2 * Math.sin(a2);\r\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\r\n }\r\n else {\r\n a = psx * l2;\r\n b = psy * l2;\r\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\r\n c = bb * l1 * l1 + aa * dd - aa * bb;\r\n var c1 = -2 * bb * l1, c2 = bb - aa;\r\n d = c1 * c1 - 4 * c2 * c;\r\n if (d >= 0) {\r\n var q = Math.sqrt(d);\r\n if (c1 < 0)\r\n q = -q;\r\n q = -(c1 + q) / 2;\r\n var r0 = q / c2, r1 = c / q;\r\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\r\n if (r * r <= dd) {\r\n y = Math.sqrt(dd - r * r) * bendDir;\r\n a1 = ta - Math.atan2(y, r);\r\n a2 = Math.atan2(y / psy, (r - l1) / psx);\r\n break outer;\r\n }\r\n }\r\n var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\r\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\r\n c = -a * l1 / (aa - bb);\r\n if (c >= -1 && c <= 1) {\r\n c = Math.acos(c);\r\n x = a * Math.cos(c) + l1;\r\n y = b * Math.sin(c);\r\n d = x * x + y * y;\r\n if (d < minDist) {\r\n minAngle = c;\r\n minDist = d;\r\n minX = x;\r\n minY = y;\r\n }\r\n if (d > maxDist) {\r\n maxAngle = c;\r\n maxDist = d;\r\n maxX = x;\r\n maxY = y;\r\n }\r\n }\r\n if (dd <= (minDist + maxDist) / 2) {\r\n a1 = ta - Math.atan2(minY * bendDir, minX);\r\n a2 = minAngle * bendDir;\r\n }\r\n else {\r\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\r\n a2 = maxAngle * bendDir;\r\n }\r\n }\r\n var os = Math.atan2(cy, cx) * s2;\r\n var rotation = parent.arotation;\r\n a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;\r\n if (a1 > 180)\r\n a1 -= 360;\r\n else if (a1 < -180)\r\n a1 += 360;\r\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\r\n rotation = child.arotation;\r\n a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\r\n if (a2 > 180)\r\n a2 -= 360;\r\n else if (a2 < -180)\r\n a2 += 360;\r\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\r\n };\r\n return IkConstraint;\r\n }());\r\n spine.IkConstraint = IkConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var IkConstraintData = (function (_super) {\r\n __extends(IkConstraintData, _super);\r\n function IkConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n _this.bendDirection = 1;\r\n _this.compress = false;\r\n _this.stretch = false;\r\n _this.uniform = false;\r\n _this.mix = 1;\r\n _this.softness = 0;\r\n return _this;\r\n }\r\n return IkConstraintData;\r\n }(spine.ConstraintData));\r\n spine.IkConstraintData = IkConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PathConstraint = (function () {\r\n function PathConstraint(data, skeleton) {\r\n this.position = 0;\r\n this.spacing = 0;\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.spaces = new Array();\r\n this.positions = new Array();\r\n this.world = new Array();\r\n this.curves = new Array();\r\n this.lengths = new Array();\r\n this.segments = new Array();\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0, n = data.bones.length; i < n; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findSlot(data.target.name);\r\n this.position = data.position;\r\n this.spacing = data.spacing;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n }\r\n PathConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n PathConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n PathConstraint.prototype.update = function () {\r\n var attachment = this.target.getAttachment();\r\n if (!(attachment instanceof spine.PathAttachment))\r\n return;\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix;\r\n var translate = translateMix > 0, rotate = rotateMix > 0;\r\n if (!translate && !rotate)\r\n return;\r\n var data = this.data;\r\n var percentSpacing = data.spacingMode == spine.SpacingMode.Percent;\r\n var rotateMode = data.rotateMode;\r\n var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;\r\n var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\r\n var bones = this.bones;\r\n var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;\r\n var spacing = this.spacing;\r\n if (scale || !percentSpacing) {\r\n if (scale)\r\n lengths = spine.Utils.setArraySize(this.lengths, boneCount);\r\n var lengthSpacing = data.spacingMode == spine.SpacingMode.Length;\r\n for (var i = 0, n = spacesCount - 1; i < n;) {\r\n var bone = bones[i];\r\n var setupLength = bone.data.length;\r\n if (setupLength < PathConstraint.epsilon) {\r\n if (scale)\r\n lengths[i] = 0;\r\n spaces[++i] = 0;\r\n }\r\n else if (percentSpacing) {\r\n if (scale) {\r\n var x = setupLength * bone.a, y = setupLength * bone.c;\r\n var length_1 = Math.sqrt(x * x + y * y);\r\n lengths[i] = length_1;\r\n }\r\n spaces[++i] = spacing;\r\n }\r\n else {\r\n var x = setupLength * bone.a, y = setupLength * bone.c;\r\n var length_2 = Math.sqrt(x * x + y * y);\r\n if (scale)\r\n lengths[i] = length_2;\r\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\r\n }\r\n }\r\n }\r\n else {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] = spacing;\r\n }\r\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing);\r\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\r\n var tip = false;\r\n if (offsetRotation == 0)\r\n tip = rotateMode == spine.RotateMode.Chain;\r\n else {\r\n tip = false;\r\n var p = this.target.bone;\r\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n }\r\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\r\n var bone = bones[i];\r\n bone.worldX += (boneX - bone.worldX) * translateMix;\r\n bone.worldY += (boneY - bone.worldY) * translateMix;\r\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\r\n if (scale) {\r\n var length_3 = lengths[i];\r\n if (length_3 != 0) {\r\n var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1;\r\n bone.a *= s;\r\n bone.c *= s;\r\n }\r\n }\r\n boneX = x;\r\n boneY = y;\r\n if (rotate) {\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\r\n if (tangents)\r\n r = positions[p - 1];\r\n else if (spaces[i + 1] == 0)\r\n r = positions[p + 2];\r\n else\r\n r = Math.atan2(dy, dx);\r\n r -= Math.atan2(c, a);\r\n if (tip) {\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n var length_4 = bone.data.length;\r\n boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix;\r\n boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix;\r\n }\r\n else {\r\n r += offsetRotation;\r\n }\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r *= rotateMix;\r\n cos = Math.cos(r);\r\n sin = Math.sin(r);\r\n bone.a = cos * a - sin * c;\r\n bone.b = cos * b - sin * d;\r\n bone.c = sin * a + cos * c;\r\n bone.d = sin * b + cos * d;\r\n }\r\n bone.appliedValid = false;\r\n }\r\n };\r\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\r\n var target = this.target;\r\n var position = this.position;\r\n var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\r\n var closed = path.closed;\r\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\r\n if (!path.constantSpeed) {\r\n var lengths = path.lengths;\r\n curveCount -= closed ? 1 : 2;\r\n var pathLength_1 = lengths[curveCount];\r\n if (percentPosition)\r\n position *= pathLength_1;\r\n if (percentSpacing) {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] *= pathLength_1;\r\n }\r\n world = spine.Utils.setArraySize(this.world, 8);\r\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength_1;\r\n if (p < 0)\r\n p += pathLength_1;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n if (prevCurve != PathConstraint.BEFORE) {\r\n prevCurve = PathConstraint.BEFORE;\r\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\r\n }\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength_1) {\r\n if (prevCurve != PathConstraint.AFTER) {\r\n prevCurve = PathConstraint.AFTER;\r\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\r\n }\r\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\r\n continue;\r\n }\r\n for (;; curve++) {\r\n var length_5 = lengths[curve];\r\n if (p > length_5)\r\n continue;\r\n if (curve == 0)\r\n p /= length_5;\r\n else {\r\n var prev = lengths[curve - 1];\r\n p = (p - prev) / (length_5 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n if (closed && curve == curveCount) {\r\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\r\n }\r\n else\r\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\r\n }\r\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n }\r\n if (closed) {\r\n verticesLength += 2;\r\n world = spine.Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\r\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\r\n world[verticesLength - 2] = world[0];\r\n world[verticesLength - 1] = world[1];\r\n }\r\n else {\r\n curveCount--;\r\n verticesLength -= 4;\r\n world = spine.Utils.setArraySize(this.world, verticesLength);\r\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\r\n }\r\n var curves = spine.Utils.setArraySize(this.curves, curveCount);\r\n var pathLength = 0;\r\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\r\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\r\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\r\n cx1 = world[w];\r\n cy1 = world[w + 1];\r\n cx2 = world[w + 2];\r\n cy2 = world[w + 3];\r\n x2 = world[w + 4];\r\n y2 = world[w + 5];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n curves[i] = pathLength;\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n if (percentPosition)\r\n position *= pathLength;\r\n else\r\n position *= pathLength / path.lengths[curveCount - 1];\r\n if (percentSpacing) {\r\n for (var i = 1; i < spacesCount; i++)\r\n spaces[i] *= pathLength;\r\n }\r\n var segments = this.segments;\r\n var curveLength = 0;\r\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\r\n var space = spaces[i];\r\n position += space;\r\n var p = position;\r\n if (closed) {\r\n p %= pathLength;\r\n if (p < 0)\r\n p += pathLength;\r\n curve = 0;\r\n }\r\n else if (p < 0) {\r\n this.addBeforePosition(p, world, 0, out, o);\r\n continue;\r\n }\r\n else if (p > pathLength) {\r\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\r\n continue;\r\n }\r\n for (;; curve++) {\r\n var length_6 = curves[curve];\r\n if (p > length_6)\r\n continue;\r\n if (curve == 0)\r\n p /= length_6;\r\n else {\r\n var prev = curves[curve - 1];\r\n p = (p - prev) / (length_6 - prev);\r\n }\r\n break;\r\n }\r\n if (curve != prevCurve) {\r\n prevCurve = curve;\r\n var ii = curve * 6;\r\n x1 = world[ii];\r\n y1 = world[ii + 1];\r\n cx1 = world[ii + 2];\r\n cy1 = world[ii + 3];\r\n cx2 = world[ii + 4];\r\n cy2 = world[ii + 5];\r\n x2 = world[ii + 6];\r\n y2 = world[ii + 7];\r\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\r\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\r\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\r\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\r\n ddfx = tmpx * 2 + dddfx;\r\n ddfy = tmpy * 2 + dddfy;\r\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\r\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\r\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[0] = curveLength;\r\n for (ii = 1; ii < 8; ii++) {\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[ii] = curveLength;\r\n }\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[8] = curveLength;\r\n dfx += ddfx + dddfx;\r\n dfy += ddfy + dddfy;\r\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\r\n segments[9] = curveLength;\r\n segment = 0;\r\n }\r\n p *= curveLength;\r\n for (;; segment++) {\r\n var length_7 = segments[segment];\r\n if (p > length_7)\r\n continue;\r\n if (segment == 0)\r\n p /= length_7;\r\n else {\r\n var prev = segments[segment - 1];\r\n p = segment + (p - prev) / (length_7 - prev);\r\n }\r\n break;\r\n }\r\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\r\n }\r\n return out;\r\n };\r\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\r\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\r\n out[o] = x1 + p * Math.cos(r);\r\n out[o + 1] = y1 + p * Math.sin(r);\r\n out[o + 2] = r;\r\n };\r\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\r\n if (p == 0 || isNaN(p)) {\r\n out[o] = x1;\r\n out[o + 1] = y1;\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n return;\r\n }\r\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\r\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\r\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\r\n out[o] = x;\r\n out[o + 1] = y;\r\n if (tangents) {\r\n if (p < 0.001)\r\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\r\n else\r\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\r\n }\r\n };\r\n PathConstraint.NONE = -1;\r\n PathConstraint.BEFORE = -2;\r\n PathConstraint.AFTER = -3;\r\n PathConstraint.epsilon = 0.00001;\r\n return PathConstraint;\r\n }());\r\n spine.PathConstraint = PathConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PathConstraintData = (function (_super) {\r\n __extends(PathConstraintData, _super);\r\n function PathConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n return _this;\r\n }\r\n return PathConstraintData;\r\n }(spine.ConstraintData));\r\n spine.PathConstraintData = PathConstraintData;\r\n var PositionMode;\r\n (function (PositionMode) {\r\n PositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\r\n PositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\r\n })(PositionMode = spine.PositionMode || (spine.PositionMode = {}));\r\n var SpacingMode;\r\n (function (SpacingMode) {\r\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\r\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\r\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\r\n })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {}));\r\n var RotateMode;\r\n (function (RotateMode) {\r\n RotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\r\n RotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\r\n RotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\r\n })(RotateMode = spine.RotateMode || (spine.RotateMode = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Assets = (function () {\r\n function Assets(clientId) {\r\n this.toLoad = new Array();\r\n this.assets = {};\r\n this.clientId = clientId;\r\n }\r\n Assets.prototype.loaded = function () {\r\n var i = 0;\r\n for (var v in this.assets)\r\n i++;\r\n return i;\r\n };\r\n return Assets;\r\n }());\r\n var SharedAssetManager = (function () {\r\n function SharedAssetManager(pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n this.clientAssets = {};\r\n this.queuedAssets = {};\r\n this.rawAssets = {};\r\n this.errors = {};\r\n this.pathPrefix = pathPrefix;\r\n }\r\n SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {\r\n var clientAssets = this.clientAssets[clientId];\r\n if (clientAssets === null || clientAssets === undefined) {\r\n clientAssets = new Assets(clientId);\r\n this.clientAssets[clientId] = clientAssets;\r\n }\r\n if (textureLoader !== null)\r\n clientAssets.textureLoader = textureLoader;\r\n clientAssets.toLoad.push(path);\r\n if (this.queuedAssets[path] === path) {\r\n return false;\r\n }\r\n else {\r\n this.queuedAssets[path] = path;\r\n return true;\r\n }\r\n };\r\n SharedAssetManager.prototype.loadText = function (clientId, path) {\r\n var _this = this;\r\n path = this.pathPrefix + path;\r\n if (!this.queueAsset(clientId, null, path))\r\n return;\r\n var request = new XMLHttpRequest();\r\n request.overrideMimeType(\"text/html\");\r\n request.onreadystatechange = function () {\r\n if (request.readyState == XMLHttpRequest.DONE) {\r\n if (request.status >= 200 && request.status < 300) {\r\n _this.rawAssets[path] = request.responseText;\r\n }\r\n else {\r\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n }\r\n }\r\n };\r\n request.open(\"GET\", path, true);\r\n request.send();\r\n };\r\n SharedAssetManager.prototype.loadJson = function (clientId, path) {\r\n var _this = this;\r\n path = this.pathPrefix + path;\r\n if (!this.queueAsset(clientId, null, path))\r\n return;\r\n var request = new XMLHttpRequest();\r\n request.overrideMimeType(\"text/html\");\r\n request.onreadystatechange = function () {\r\n if (request.readyState == XMLHttpRequest.DONE) {\r\n if (request.status >= 200 && request.status < 300) {\r\n _this.rawAssets[path] = JSON.parse(request.responseText);\r\n }\r\n else {\r\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\r\n }\r\n }\r\n };\r\n request.open(\"GET\", path, true);\r\n request.send();\r\n };\r\n SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {\r\n var _this = this;\r\n path = this.pathPrefix + path;\r\n if (!this.queueAsset(clientId, textureLoader, path))\r\n return;\r\n var img = new Image();\r\n img.crossOrigin = \"anonymous\";\r\n img.onload = function (ev) {\r\n _this.rawAssets[path] = img;\r\n };\r\n img.onerror = function (ev) {\r\n _this.errors[path] = \"Couldn't load image \" + path;\r\n };\r\n img.src = path;\r\n };\r\n SharedAssetManager.prototype.get = function (clientId, path) {\r\n path = this.pathPrefix + path;\r\n var clientAssets = this.clientAssets[clientId];\r\n if (clientAssets === null || clientAssets === undefined)\r\n return true;\r\n return clientAssets.assets[path];\r\n };\r\n SharedAssetManager.prototype.updateClientAssets = function (clientAssets) {\r\n for (var i = 0; i < clientAssets.toLoad.length; i++) {\r\n var path = clientAssets.toLoad[i];\r\n var asset = clientAssets.assets[path];\r\n if (asset === null || asset === undefined) {\r\n var rawAsset = this.rawAssets[path];\r\n if (rawAsset === null || rawAsset === undefined)\r\n continue;\r\n if (rawAsset instanceof HTMLImageElement) {\r\n clientAssets.assets[path] = clientAssets.textureLoader(rawAsset);\r\n }\r\n else {\r\n clientAssets.assets[path] = rawAsset;\r\n }\r\n }\r\n }\r\n };\r\n SharedAssetManager.prototype.isLoadingComplete = function (clientId) {\r\n var clientAssets = this.clientAssets[clientId];\r\n if (clientAssets === null || clientAssets === undefined)\r\n return true;\r\n this.updateClientAssets(clientAssets);\r\n return clientAssets.toLoad.length == clientAssets.loaded();\r\n };\r\n SharedAssetManager.prototype.dispose = function () {\r\n };\r\n SharedAssetManager.prototype.hasErrors = function () {\r\n return Object.keys(this.errors).length > 0;\r\n };\r\n SharedAssetManager.prototype.getErrors = function () {\r\n return this.errors;\r\n };\r\n return SharedAssetManager;\r\n }());\r\n spine.SharedAssetManager = SharedAssetManager;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Skeleton = (function () {\r\n function Skeleton(data) {\r\n this._updateCache = new Array();\r\n this.updateCacheReset = new Array();\r\n this.time = 0;\r\n this.scaleX = 1;\r\n this.scaleY = 1;\r\n this.x = 0;\r\n this.y = 0;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n this.data = data;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++) {\r\n var boneData = data.bones[i];\r\n var bone = void 0;\r\n if (boneData.parent == null)\r\n bone = new spine.Bone(boneData, this, null);\r\n else {\r\n var parent_1 = this.bones[boneData.parent.index];\r\n bone = new spine.Bone(boneData, this, parent_1);\r\n parent_1.children.push(bone);\r\n }\r\n this.bones.push(bone);\r\n }\r\n this.slots = new Array();\r\n this.drawOrder = new Array();\r\n for (var i = 0; i < data.slots.length; i++) {\r\n var slotData = data.slots[i];\r\n var bone = this.bones[slotData.boneData.index];\r\n var slot = new spine.Slot(slotData, bone);\r\n this.slots.push(slot);\r\n this.drawOrder.push(slot);\r\n }\r\n this.ikConstraints = new Array();\r\n for (var i = 0; i < data.ikConstraints.length; i++) {\r\n var ikConstraintData = data.ikConstraints[i];\r\n this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));\r\n }\r\n this.transformConstraints = new Array();\r\n for (var i = 0; i < data.transformConstraints.length; i++) {\r\n var transformConstraintData = data.transformConstraints[i];\r\n this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));\r\n }\r\n this.pathConstraints = new Array();\r\n for (var i = 0; i < data.pathConstraints.length; i++) {\r\n var pathConstraintData = data.pathConstraints[i];\r\n this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));\r\n }\r\n this.color = new spine.Color(1, 1, 1, 1);\r\n this.updateCache();\r\n }\r\n Skeleton.prototype.updateCache = function () {\r\n var updateCache = this._updateCache;\r\n updateCache.length = 0;\r\n this.updateCacheReset.length = 0;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n bone.sorted = bone.data.skinRequired;\r\n bone.active = !bone.sorted;\r\n }\r\n if (this.skin != null) {\r\n var skinBones = this.skin.bones;\r\n for (var i = 0, n = this.skin.bones.length; i < n; i++) {\r\n var bone = this.bones[skinBones[i].index];\r\n do {\r\n bone.sorted = false;\r\n bone.active = true;\r\n bone = bone.parent;\r\n } while (bone != null);\r\n }\r\n }\r\n var ikConstraints = this.ikConstraints;\r\n var transformConstraints = this.transformConstraints;\r\n var pathConstraints = this.pathConstraints;\r\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\r\n var constraintCount = ikCount + transformCount + pathCount;\r\n outer: for (var i = 0; i < constraintCount; i++) {\r\n for (var ii = 0; ii < ikCount; ii++) {\r\n var constraint = ikConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortIkConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < transformCount; ii++) {\r\n var constraint = transformConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortTransformConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n for (var ii = 0; ii < pathCount; ii++) {\r\n var constraint = pathConstraints[ii];\r\n if (constraint.data.order == i) {\r\n this.sortPathConstraint(constraint);\r\n continue outer;\r\n }\r\n }\r\n }\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n this.sortBone(bones[i]);\r\n };\r\n Skeleton.prototype.sortIkConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && spine.Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var target = constraint.target;\r\n this.sortBone(target);\r\n var constrained = constraint.bones;\r\n var parent = constrained[0];\r\n this.sortBone(parent);\r\n if (constrained.length > 1) {\r\n var child = constrained[constrained.length - 1];\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n this._updateCache.push(constraint);\r\n this.sortReset(parent.children);\r\n constrained[constrained.length - 1].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraint = function (constraint) {\r\n constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin != null && spine.Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n var slot = constraint.target;\r\n var slotIndex = slot.data.index;\r\n var slotBone = slot.bone;\r\n if (this.skin != null)\r\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\r\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\r\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\r\n for (var i = 0, n = this.data.skins.length; i < n; i++)\r\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.PathAttachment)\r\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortBone(constrained[i]);\r\n this._updateCache.push(constraint);\r\n for (var i = 0; i < boneCount; i++)\r\n this.sortReset(constrained[i].children);\r\n for (var i = 0; i < boneCount; i++)\r\n constrained[i].sorted = true;\r\n };\r\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\r\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && spine.Utils.contains(this.skin.constraints, constraint.data, true)));\r\n if (!constraint.active)\r\n return;\r\n this.sortBone(constraint.target);\r\n var constrained = constraint.bones;\r\n var boneCount = constrained.length;\r\n if (constraint.data.local) {\r\n for (var i = 0; i < boneCount; i++) {\r\n var child = constrained[i];\r\n this.sortBone(child.parent);\r\n if (!(this._updateCache.indexOf(child) > -1))\r\n this.updateCacheReset.push(child);\r\n }\r\n }\r\n else {\r\n for (var i = 0; i < boneCount; i++) {\r\n this.sortBone(constrained[i]);\r\n }\r\n }\r\n this._updateCache.push(constraint);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n this.sortReset(constrained[ii].children);\r\n for (var ii = 0; ii < boneCount; ii++)\r\n constrained[ii].sorted = true;\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\r\n var attachments = skin.attachments[slotIndex];\r\n if (!attachments)\r\n return;\r\n for (var key in attachments) {\r\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\r\n }\r\n };\r\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\r\n if (!(attachment instanceof spine.PathAttachment))\r\n return;\r\n var pathBones = attachment.bones;\r\n if (pathBones == null)\r\n this.sortBone(slotBone);\r\n else {\r\n var bones = this.bones;\r\n var i = 0;\r\n while (i < pathBones.length) {\r\n var boneCount = pathBones[i++];\r\n for (var n = i + boneCount; i < n; i++) {\r\n var boneIndex = pathBones[i];\r\n this.sortBone(bones[boneIndex]);\r\n }\r\n }\r\n }\r\n };\r\n Skeleton.prototype.sortBone = function (bone) {\r\n if (bone.sorted)\r\n return;\r\n var parent = bone.parent;\r\n if (parent != null)\r\n this.sortBone(parent);\r\n bone.sorted = true;\r\n this._updateCache.push(bone);\r\n };\r\n Skeleton.prototype.sortReset = function (bones) {\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.active)\r\n continue;\r\n if (bone.sorted)\r\n this.sortReset(bone.children);\r\n bone.sorted = false;\r\n }\r\n };\r\n Skeleton.prototype.updateWorldTransform = function () {\r\n var updateCacheReset = this.updateCacheReset;\r\n for (var i = 0, n = updateCacheReset.length; i < n; i++) {\r\n var bone = updateCacheReset[i];\r\n bone.ax = bone.x;\r\n bone.ay = bone.y;\r\n bone.arotation = bone.rotation;\r\n bone.ascaleX = bone.scaleX;\r\n bone.ascaleY = bone.scaleY;\r\n bone.ashearX = bone.shearX;\r\n bone.ashearY = bone.shearY;\r\n bone.appliedValid = true;\r\n }\r\n var updateCache = this._updateCache;\r\n for (var i = 0, n = updateCache.length; i < n; i++)\r\n updateCache[i].update();\r\n };\r\n Skeleton.prototype.setToSetupPose = function () {\r\n this.setBonesToSetupPose();\r\n this.setSlotsToSetupPose();\r\n };\r\n Skeleton.prototype.setBonesToSetupPose = function () {\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n bones[i].setToSetupPose();\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n constraint.mix = constraint.data.mix;\r\n constraint.softness = constraint.data.softness;\r\n constraint.bendDirection = constraint.data.bendDirection;\r\n constraint.compress = constraint.data.compress;\r\n constraint.stretch = constraint.data.stretch;\r\n }\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n var data = constraint.data;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n constraint.scaleMix = data.scaleMix;\r\n constraint.shearMix = data.shearMix;\r\n }\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n var data = constraint.data;\r\n constraint.position = data.position;\r\n constraint.spacing = data.spacing;\r\n constraint.rotateMix = data.rotateMix;\r\n constraint.translateMix = data.translateMix;\r\n }\r\n };\r\n Skeleton.prototype.setSlotsToSetupPose = function () {\r\n var slots = this.slots;\r\n spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n slots[i].setToSetupPose();\r\n };\r\n Skeleton.prototype.getRootBone = function () {\r\n if (this.bones.length == 0)\r\n return null;\r\n return this.bones[0];\r\n };\r\n Skeleton.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.data.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].data.name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n Skeleton.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].data.name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n Skeleton.prototype.setSkinByName = function (skinName) {\r\n var skin = this.data.findSkin(skinName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + skinName);\r\n this.setSkin(skin);\r\n };\r\n Skeleton.prototype.setSkin = function (newSkin) {\r\n if (newSkin == this.skin)\r\n return;\r\n if (newSkin != null) {\r\n if (this.skin != null)\r\n newSkin.attachAll(this, this.skin);\r\n else {\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var name_1 = slot.data.attachmentName;\r\n if (name_1 != null) {\r\n var attachment = newSkin.getAttachment(i, name_1);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n }\r\n }\r\n }\r\n }\r\n this.skin = newSkin;\r\n this.updateCache();\r\n };\r\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\r\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\r\n };\r\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\r\n if (attachmentName == null)\r\n throw new Error(\"attachmentName cannot be null.\");\r\n if (this.skin != null) {\r\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\r\n if (attachment != null)\r\n return attachment;\r\n }\r\n if (this.data.defaultSkin != null)\r\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\r\n return null;\r\n };\r\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.data.name == slotName) {\r\n var attachment = null;\r\n if (attachmentName != null) {\r\n attachment = this.getAttachment(i, attachmentName);\r\n if (attachment == null)\r\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\r\n }\r\n slot.setAttachment(attachment);\r\n return;\r\n }\r\n }\r\n throw new Error(\"Slot not found: \" + slotName);\r\n };\r\n Skeleton.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var ikConstraint = ikConstraints[i];\r\n if (ikConstraint.data.name == constraintName)\r\n return ikConstraint;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.data.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n Skeleton.prototype.getBounds = function (offset, size, temp) {\r\n if (temp === void 0) { temp = new Array(2); }\r\n if (offset == null)\r\n throw new Error(\"offset cannot be null.\");\r\n if (size == null)\r\n throw new Error(\"size cannot be null.\");\r\n var drawOrder = this.drawOrder;\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var verticesLength = 0;\r\n var vertices = null;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.RegionAttachment) {\r\n verticesLength = 8;\r\n vertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n attachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n }\r\n else if (attachment instanceof spine.MeshAttachment) {\r\n var mesh = attachment;\r\n verticesLength = mesh.worldVerticesLength;\r\n vertices = spine.Utils.setArraySize(temp, verticesLength, 0);\r\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\r\n }\r\n if (vertices != null) {\r\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n }\r\n offset.set(minX, minY);\r\n size.set(maxX - minX, maxY - minY);\r\n };\r\n Skeleton.prototype.update = function (delta) {\r\n this.time += delta;\r\n };\r\n return Skeleton;\r\n }());\r\n spine.Skeleton = Skeleton;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonBinary = (function () {\r\n function SkeletonBinary(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonBinary.prototype.readSkeletonData = function (binary) {\r\n var scale = this.scale;\r\n var skeletonData = new spine.SkeletonData();\r\n skeletonData.name = \"\";\r\n var input = new BinaryInput(binary);\r\n skeletonData.hash = input.readString();\r\n skeletonData.version = input.readString();\r\n if (\"3.8.75\" == skeletonData.version)\r\n throw new Error(\"Unsupported skeleton data, please export with a newer version of Spine.\");\r\n skeletonData.x = input.readFloat();\r\n skeletonData.y = input.readFloat();\r\n skeletonData.width = input.readFloat();\r\n skeletonData.height = input.readFloat();\r\n var nonessential = input.readBoolean();\r\n if (nonessential) {\r\n skeletonData.fps = input.readFloat();\r\n skeletonData.imagesPath = input.readString();\r\n skeletonData.audioPath = input.readString();\r\n }\r\n var n = 0;\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++)\r\n input.strings.push(input.readString());\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var name_2 = input.readString();\r\n var parent_2 = i == 0 ? null : skeletonData.bones[input.readInt(true)];\r\n var data = new spine.BoneData(i, name_2, parent_2);\r\n data.rotation = input.readFloat();\r\n data.x = input.readFloat() * scale;\r\n data.y = input.readFloat() * scale;\r\n data.scaleX = input.readFloat();\r\n data.scaleY = input.readFloat();\r\n data.shearX = input.readFloat();\r\n data.shearY = input.readFloat();\r\n data.length = input.readFloat() * scale;\r\n data.transformMode = SkeletonBinary.TransformModeValues[input.readInt(true)];\r\n data.skinRequired = input.readBoolean();\r\n if (nonessential)\r\n spine.Color.rgba8888ToColor(data.color, input.readInt32());\r\n skeletonData.bones.push(data);\r\n }\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var slotName = input.readString();\r\n var boneData = skeletonData.bones[input.readInt(true)];\r\n var data = new spine.SlotData(i, slotName, boneData);\r\n spine.Color.rgba8888ToColor(data.color, input.readInt32());\r\n var darkColor = input.readInt32();\r\n if (darkColor != -1)\r\n spine.Color.rgb888ToColor(data.darkColor = new spine.Color(), darkColor);\r\n data.attachmentName = input.readStringRef();\r\n data.blendMode = SkeletonBinary.BlendModeValues[input.readInt(true)];\r\n skeletonData.slots.push(data);\r\n }\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new spine.IkConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.mix = input.readFloat();\r\n data.softness = input.readFloat() * scale;\r\n data.bendDirection = input.readByte();\r\n data.compress = input.readBoolean();\r\n data.stretch = input.readBoolean();\r\n data.uniform = input.readBoolean();\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new spine.TransformConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.bones[input.readInt(true)];\r\n data.local = input.readBoolean();\r\n data.relative = input.readBoolean();\r\n data.offsetRotation = input.readFloat();\r\n data.offsetX = input.readFloat() * scale;\r\n data.offsetY = input.readFloat() * scale;\r\n data.offsetScaleX = input.readFloat();\r\n data.offsetScaleY = input.readFloat();\r\n data.offsetShearY = input.readFloat();\r\n data.rotateMix = input.readFloat();\r\n data.translateMix = input.readFloat();\r\n data.scaleMix = input.readFloat();\r\n data.shearMix = input.readFloat();\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n n = input.readInt(true);\r\n for (var i = 0, nn = void 0; i < n; i++) {\r\n var data = new spine.PathConstraintData(input.readString());\r\n data.order = input.readInt(true);\r\n data.skinRequired = input.readBoolean();\r\n nn = input.readInt(true);\r\n for (var ii = 0; ii < nn; ii++)\r\n data.bones.push(skeletonData.bones[input.readInt(true)]);\r\n data.target = skeletonData.slots[input.readInt(true)];\r\n data.positionMode = SkeletonBinary.PositionModeValues[input.readInt(true)];\r\n data.spacingMode = SkeletonBinary.SpacingModeValues[input.readInt(true)];\r\n data.rotateMode = SkeletonBinary.RotateModeValues[input.readInt(true)];\r\n data.offsetRotation = input.readFloat();\r\n data.position = input.readFloat();\r\n if (data.positionMode == spine.PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = input.readFloat();\r\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = input.readFloat();\r\n data.translateMix = input.readFloat();\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n var defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\r\n if (defaultSkin != null) {\r\n skeletonData.defaultSkin = defaultSkin;\r\n skeletonData.skins.push(defaultSkin);\r\n }\r\n {\r\n var i = skeletonData.skins.length;\r\n spine.Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\r\n for (; i < n; i++)\r\n skeletonData.skins[i] = this.readSkin(input, skeletonData, false, nonessential);\r\n }\r\n n = this.linkedMeshes.length;\r\n for (var i = 0; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_3 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_3 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_3);\r\n linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++) {\r\n var data = new spine.EventData(input.readStringRef());\r\n data.intValue = input.readInt(false);\r\n data.floatValue = input.readFloat();\r\n data.stringValue = input.readString();\r\n data.audioPath = input.readString();\r\n if (data.audioPath != null) {\r\n data.volume = input.readFloat();\r\n data.balance = input.readFloat();\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n n = input.readInt(true);\r\n for (var i = 0; i < n; i++)\r\n skeletonData.animations.push(this.readAnimation(input, input.readString(), skeletonData));\r\n return skeletonData;\r\n };\r\n SkeletonBinary.prototype.readSkin = function (input, skeletonData, defaultSkin, nonessential) {\r\n var skin = null;\r\n var slotCount = 0;\r\n if (defaultSkin) {\r\n slotCount = input.readInt(true);\r\n if (slotCount == 0)\r\n return null;\r\n skin = new spine.Skin(\"default\");\r\n }\r\n else {\r\n skin = new spine.Skin(input.readStringRef());\r\n skin.bones.length = input.readInt(true);\r\n for (var i = 0, n = skin.bones.length; i < n; i++)\r\n skin.bones[i] = skeletonData.bones[input.readInt(true)];\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\r\n for (var i = 0, n = input.readInt(true); i < n; i++)\r\n skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\r\n slotCount = input.readInt(true);\r\n }\r\n for (var i = 0; i < slotCount; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var name_3 = input.readStringRef();\r\n var attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name_3, nonessential);\r\n if (attachment != null)\r\n skin.setAttachment(slotIndex, name_3, attachment);\r\n }\r\n }\r\n return skin;\r\n };\r\n SkeletonBinary.prototype.readAttachment = function (input, skeletonData, skin, slotIndex, attachmentName, nonessential) {\r\n var scale = this.scale;\r\n var name = input.readStringRef();\r\n if (name == null)\r\n name = attachmentName;\r\n var typeIndex = input.readByte();\r\n var type = SkeletonBinary.AttachmentTypeValues[typeIndex];\r\n switch (type) {\r\n case spine.AttachmentType.Region: {\r\n var path = input.readStringRef();\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var scaleX = input.readFloat();\r\n var scaleY = input.readFloat();\r\n var width = input.readFloat();\r\n var height = input.readFloat();\r\n var color = input.readInt32();\r\n if (path == null)\r\n path = name;\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = x * scale;\r\n region.y = y * scale;\r\n region.scaleX = scaleX;\r\n region.scaleY = scaleY;\r\n region.rotation = rotation;\r\n region.width = width * scale;\r\n region.height = height * scale;\r\n spine.Color.rgba8888ToColor(region.color, color);\r\n region.updateOffset();\r\n return region;\r\n }\r\n case spine.AttachmentType.BoundingBox: {\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n box.worldVerticesLength = vertexCount << 1;\r\n box.vertices = vertices.vertices;\r\n box.bones = vertices.bones;\r\n if (nonessential)\r\n spine.Color.rgba8888ToColor(box.color, color);\r\n return box;\r\n }\r\n case spine.AttachmentType.Mesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var vertexCount = input.readInt(true);\r\n var uvs = this.readFloatArray(input, vertexCount << 1, 1);\r\n var triangles = this.readShortArray(input);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var hullLength = input.readInt(true);\r\n var edges = null;\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n edges = this.readShortArray(input);\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (path == null)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n spine.Color.rgba8888ToColor(mesh.color, color);\r\n mesh.bones = vertices.bones;\r\n mesh.vertices = vertices.vertices;\r\n mesh.worldVerticesLength = vertexCount << 1;\r\n mesh.triangles = triangles;\r\n mesh.regionUVs = uvs;\r\n mesh.updateUVs();\r\n mesh.hullLength = hullLength << 1;\r\n if (nonessential) {\r\n mesh.edges = edges;\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n return mesh;\r\n }\r\n case spine.AttachmentType.LinkedMesh: {\r\n var path = input.readStringRef();\r\n var color = input.readInt32();\r\n var skinName = input.readStringRef();\r\n var parent_4 = input.readStringRef();\r\n var inheritDeform = input.readBoolean();\r\n var width = 0, height = 0;\r\n if (nonessential) {\r\n width = input.readFloat();\r\n height = input.readFloat();\r\n }\r\n if (path == null)\r\n path = name;\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n spine.Color.rgba8888ToColor(mesh.color, color);\r\n if (nonessential) {\r\n mesh.width = width * scale;\r\n mesh.height = height * scale;\r\n }\r\n this.linkedMeshes.push(new LinkedMesh(mesh, skinName, slotIndex, parent_4, inheritDeform));\r\n return mesh;\r\n }\r\n case spine.AttachmentType.Path: {\r\n var closed_1 = input.readBoolean();\r\n var constantSpeed = input.readBoolean();\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var lengths = spine.Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0, n = lengths.length; i < n; i++)\r\n lengths[i] = input.readFloat() * scale;\r\n var color = nonessential ? input.readInt32() : 0;\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = closed_1;\r\n path.constantSpeed = constantSpeed;\r\n path.worldVerticesLength = vertexCount << 1;\r\n path.vertices = vertices.vertices;\r\n path.bones = vertices.bones;\r\n path.lengths = lengths;\r\n if (nonessential)\r\n spine.Color.rgba8888ToColor(path.color, color);\r\n return path;\r\n }\r\n case spine.AttachmentType.Point: {\r\n var rotation = input.readFloat();\r\n var x = input.readFloat();\r\n var y = input.readFloat();\r\n var color = nonessential ? input.readInt32() : 0;\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = x * scale;\r\n point.y = y * scale;\r\n point.rotation = rotation;\r\n if (nonessential)\r\n spine.Color.rgba8888ToColor(point.color, color);\r\n return point;\r\n }\r\n case spine.AttachmentType.Clipping: {\r\n var endSlotIndex = input.readInt(true);\r\n var vertexCount = input.readInt(true);\r\n var vertices = this.readVertices(input, vertexCount);\r\n var color = nonessential ? input.readInt32() : 0;\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n clip.endSlot = skeletonData.slots[endSlotIndex];\r\n clip.worldVerticesLength = vertexCount << 1;\r\n clip.vertices = vertices.vertices;\r\n clip.bones = vertices.bones;\r\n if (nonessential)\r\n spine.Color.rgba8888ToColor(clip.color, color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonBinary.prototype.readVertices = function (input, vertexCount) {\r\n var verticesLength = vertexCount << 1;\r\n var vertices = new Vertices();\r\n var scale = this.scale;\r\n if (!input.readBoolean()) {\r\n vertices.vertices = this.readFloatArray(input, verticesLength, scale);\r\n return vertices;\r\n }\r\n var weights = new Array();\r\n var bonesArray = new Array();\r\n for (var i = 0; i < vertexCount; i++) {\r\n var boneCount = input.readInt(true);\r\n bonesArray.push(boneCount);\r\n for (var ii = 0; ii < boneCount; ii++) {\r\n bonesArray.push(input.readInt(true));\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat() * scale);\r\n weights.push(input.readFloat());\r\n }\r\n }\r\n vertices.vertices = spine.Utils.toFloatArray(weights);\r\n vertices.bones = bonesArray;\r\n return vertices;\r\n };\r\n SkeletonBinary.prototype.readFloatArray = function (input, n, scale) {\r\n var array = new Array(n);\r\n if (scale == 1) {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat();\r\n }\r\n else {\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readFloat() * scale;\r\n }\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readShortArray = function (input) {\r\n var n = input.readInt(true);\r\n var array = new Array(n);\r\n for (var i = 0; i < n; i++)\r\n array[i] = input.readShort();\r\n return array;\r\n };\r\n SkeletonBinary.prototype.readAnimation = function (input, name, skeletonData) {\r\n var timelines = new Array();\r\n var scale = this.scale;\r\n var duration = 0;\r\n var tempColor1 = new spine.Color();\r\n var tempColor2 = new spine.Color();\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var slotIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.SLOT_ATTACHMENT: {\r\n var timeline = new spine.AttachmentTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++)\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readStringRef());\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\r\n break;\r\n }\r\n case SkeletonBinary.SLOT_COLOR: {\r\n var timeline = new spine.ColorTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n spine.Color.rgba8888ToColor(tempColor1, input.readInt32());\r\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.ColorTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.SLOT_TWO_COLOR: {\r\n var timeline = new spine.TwoColorTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n spine.Color.rgba8888ToColor(tempColor1, input.readInt32());\r\n spine.Color.rgb888ToColor(tempColor2, input.readInt32());\r\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a, tempColor2.r, tempColor2.g, tempColor2.b);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.TwoColorTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var boneIndex = input.readInt(true);\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.BONE_ROTATE: {\r\n var timeline = new spine.RotateTimeline(frameCount);\r\n timeline.boneIndex = boneIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.RotateTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.BONE_TRANSLATE:\r\n case SkeletonBinary.BONE_SCALE:\r\n case SkeletonBinary.BONE_SHEAR: {\r\n var timeline = void 0;\r\n var timelineScale = 1;\r\n if (timelineType == SkeletonBinary.BONE_SCALE)\r\n timeline = new spine.ScaleTimeline(frameCount);\r\n else if (timelineType == SkeletonBinary.BONE_SHEAR)\r\n timeline = new spine.ShearTimeline(frameCount);\r\n else {\r\n timeline = new spine.TranslateTimeline(frameCount);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale, input.readFloat() * timelineScale);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.TranslateTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var frameCount = input.readInt(true);\r\n var timeline = new spine.IkConstraintTimeline(frameCount);\r\n timeline.ikConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat() * scale, input.readByte(), input.readBoolean(), input.readBoolean());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.IkConstraintTimeline.ENTRIES]);\r\n }\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var frameCount = input.readInt(true);\r\n var timeline = new spine.TransformConstraintTimeline(frameCount);\r\n timeline.transformConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.TransformConstraintTimeline.ENTRIES]);\r\n }\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var index = input.readInt(true);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var timelineType = input.readByte();\r\n var frameCount = input.readInt(true);\r\n switch (timelineType) {\r\n case SkeletonBinary.PATH_POSITION:\r\n case SkeletonBinary.PATH_SPACING: {\r\n var timeline = void 0;\r\n var timelineScale = 1;\r\n if (timelineType == SkeletonBinary.PATH_SPACING) {\r\n timeline = new spine.PathConstraintSpacingTimeline(frameCount);\r\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new spine.PathConstraintPositionTimeline(frameCount);\r\n if (data.positionMode == spine.PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\r\n break;\r\n }\r\n case SkeletonBinary.PATH_MIX: {\r\n var timeline = new spine.PathConstraintMixTimeline(frameCount);\r\n timeline.pathConstraintIndex = index;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat());\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n for (var i = 0, n = input.readInt(true); i < n; i++) {\r\n var skin = skeletonData.skins[input.readInt(true)];\r\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\r\n var slotIndex = input.readInt(true);\r\n for (var iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\r\n var attachment = skin.getAttachment(slotIndex, input.readStringRef());\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var frameCount = input.readInt(true);\r\n var timeline = new spine.DeformTimeline(frameCount);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\r\n var time = input.readFloat();\r\n var deform = void 0;\r\n var end = input.readInt(true);\r\n if (end == 0)\r\n deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = spine.Utils.newFloatArray(deformLength);\r\n var start = input.readInt(true);\r\n end += start;\r\n if (scale == 1) {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat();\r\n }\r\n else {\r\n for (var v = start; v < end; v++)\r\n deform[v] = input.readFloat() * scale;\r\n }\r\n if (!weighted) {\r\n for (var v = 0, vn = deform.length; v < vn; v++)\r\n deform[v] += vertices[v];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, time, deform);\r\n if (frameIndex < frameCount - 1)\r\n this.readCurve(input, frameIndex, timeline);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\r\n }\r\n }\r\n }\r\n var drawOrderCount = input.readInt(true);\r\n if (drawOrderCount > 0) {\r\n var timeline = new spine.DrawOrderTimeline(drawOrderCount);\r\n var slotCount = skeletonData.slots.length;\r\n for (var i = 0; i < drawOrderCount; i++) {\r\n var time = input.readFloat();\r\n var offsetCount = input.readInt(true);\r\n var drawOrder = spine.Utils.newArray(slotCount, 0);\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n drawOrder[ii] = -1;\r\n var unchanged = spine.Utils.newArray(slotCount - offsetCount, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var ii = 0; ii < offsetCount; ii++) {\r\n var slotIndex = input.readInt(true);\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n drawOrder[originalIndex + input.readInt(true)] = originalIndex++;\r\n }\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n for (var ii = slotCount - 1; ii >= 0; ii--)\r\n if (drawOrder[ii] == -1)\r\n drawOrder[ii] = unchanged[--unchangedIndex];\r\n timeline.setFrame(i, time, drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[drawOrderCount - 1]);\r\n }\r\n var eventCount = input.readInt(true);\r\n if (eventCount > 0) {\r\n var timeline = new spine.EventTimeline(eventCount);\r\n for (var i = 0; i < eventCount; i++) {\r\n var time = input.readFloat();\r\n var eventData = skeletonData.events[input.readInt(true)];\r\n var event_4 = new spine.Event(time, eventData);\r\n event_4.intValue = input.readInt(false);\r\n event_4.floatValue = input.readFloat();\r\n event_4.stringValue = input.readBoolean() ? input.readString() : eventData.stringValue;\r\n if (event_4.data.audioPath != null) {\r\n event_4.volume = input.readFloat();\r\n event_4.balance = input.readFloat();\r\n }\r\n timeline.setFrame(i, event_4);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[eventCount - 1]);\r\n }\r\n return new spine.Animation(name, timelines, duration);\r\n };\r\n SkeletonBinary.prototype.readCurve = function (input, frameIndex, timeline) {\r\n switch (input.readByte()) {\r\n case SkeletonBinary.CURVE_STEPPED:\r\n timeline.setStepped(frameIndex);\r\n break;\r\n case SkeletonBinary.CURVE_BEZIER:\r\n this.setCurve(timeline, frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\r\n break;\r\n }\r\n };\r\n SkeletonBinary.prototype.setCurve = function (timeline, frameIndex, cx1, cy1, cx2, cy2) {\r\n timeline.setCurve(frameIndex, cx1, cy1, cx2, cy2);\r\n };\r\n SkeletonBinary.AttachmentTypeValues = [0, 1, 2, 3, 4, 5, 6];\r\n SkeletonBinary.TransformModeValues = [spine.TransformMode.Normal, spine.TransformMode.OnlyTranslation, spine.TransformMode.NoRotationOrReflection, spine.TransformMode.NoScale, spine.TransformMode.NoScaleOrReflection];\r\n SkeletonBinary.PositionModeValues = [spine.PositionMode.Fixed, spine.PositionMode.Percent];\r\n SkeletonBinary.SpacingModeValues = [spine.SpacingMode.Length, spine.SpacingMode.Fixed, spine.SpacingMode.Percent];\r\n SkeletonBinary.RotateModeValues = [spine.RotateMode.Tangent, spine.RotateMode.Chain, spine.RotateMode.ChainScale];\r\n SkeletonBinary.BlendModeValues = [spine.BlendMode.Normal, spine.BlendMode.Additive, spine.BlendMode.Multiply, spine.BlendMode.Screen];\r\n SkeletonBinary.BONE_ROTATE = 0;\r\n SkeletonBinary.BONE_TRANSLATE = 1;\r\n SkeletonBinary.BONE_SCALE = 2;\r\n SkeletonBinary.BONE_SHEAR = 3;\r\n SkeletonBinary.SLOT_ATTACHMENT = 0;\r\n SkeletonBinary.SLOT_COLOR = 1;\r\n SkeletonBinary.SLOT_TWO_COLOR = 2;\r\n SkeletonBinary.PATH_POSITION = 0;\r\n SkeletonBinary.PATH_SPACING = 1;\r\n SkeletonBinary.PATH_MIX = 2;\r\n SkeletonBinary.CURVE_LINEAR = 0;\r\n SkeletonBinary.CURVE_STEPPED = 1;\r\n SkeletonBinary.CURVE_BEZIER = 2;\r\n return SkeletonBinary;\r\n }());\r\n spine.SkeletonBinary = SkeletonBinary;\r\n var BinaryInput = (function () {\r\n function BinaryInput(data, strings, index, buffer) {\r\n if (strings === void 0) { strings = new Array(); }\r\n if (index === void 0) { index = 0; }\r\n if (buffer === void 0) { buffer = new DataView(data.buffer); }\r\n this.strings = strings;\r\n this.index = index;\r\n this.buffer = buffer;\r\n }\r\n BinaryInput.prototype.readByte = function () {\r\n return this.buffer.getInt8(this.index++);\r\n };\r\n BinaryInput.prototype.readShort = function () {\r\n var value = this.buffer.getInt16(this.index);\r\n this.index += 2;\r\n return value;\r\n };\r\n BinaryInput.prototype.readInt32 = function () {\r\n var value = this.buffer.getInt32(this.index);\r\n this.index += 4;\r\n return value;\r\n };\r\n BinaryInput.prototype.readInt = function (optimizePositive) {\r\n var b = this.readByte();\r\n var result = b & 0x7F;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 7;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 14;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 21;\r\n if ((b & 0x80) != 0) {\r\n b = this.readByte();\r\n result |= (b & 0x7F) << 28;\r\n }\r\n }\r\n }\r\n }\r\n return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\r\n };\r\n BinaryInput.prototype.readStringRef = function () {\r\n var index = this.readInt(true);\r\n return index == 0 ? null : this.strings[index - 1];\r\n };\r\n BinaryInput.prototype.readString = function () {\r\n var byteCount = this.readInt(true);\r\n switch (byteCount) {\r\n case 0:\r\n return null;\r\n case 1:\r\n return \"\";\r\n }\r\n byteCount--;\r\n var chars = \"\";\r\n var charCount = 0;\r\n for (var i = 0; i < byteCount;) {\r\n var b = this.readByte();\r\n switch (b >> 4) {\r\n case 12:\r\n case 13:\r\n chars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\r\n i += 2;\r\n break;\r\n case 14:\r\n chars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\r\n i += 3;\r\n break;\r\n default:\r\n chars += String.fromCharCode(b);\r\n i++;\r\n }\r\n }\r\n return chars;\r\n };\r\n BinaryInput.prototype.readFloat = function () {\r\n var value = this.buffer.getFloat32(this.index);\r\n this.index += 4;\r\n return value;\r\n };\r\n BinaryInput.prototype.readBoolean = function () {\r\n return this.readByte() != 0;\r\n };\r\n return BinaryInput;\r\n }());\r\n var LinkedMesh = (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritDeform = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n }());\r\n var Vertices = (function () {\r\n function Vertices(bones, vertices) {\r\n if (bones === void 0) { bones = null; }\r\n if (vertices === void 0) { vertices = null; }\r\n this.bones = bones;\r\n this.vertices = vertices;\r\n }\r\n return Vertices;\r\n }());\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonBounds = (function () {\r\n function SkeletonBounds() {\r\n this.minX = 0;\r\n this.minY = 0;\r\n this.maxX = 0;\r\n this.maxY = 0;\r\n this.boundingBoxes = new Array();\r\n this.polygons = new Array();\r\n this.polygonPool = new spine.Pool(function () {\r\n return spine.Utils.newFloatArray(16);\r\n });\r\n }\r\n SkeletonBounds.prototype.update = function (skeleton, updateAabb) {\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n var boundingBoxes = this.boundingBoxes;\r\n var polygons = this.polygons;\r\n var polygonPool = this.polygonPool;\r\n var slots = skeleton.slots;\r\n var slotCount = slots.length;\r\n boundingBoxes.length = 0;\r\n polygonPool.freeAll(polygons);\r\n polygons.length = 0;\r\n for (var i = 0; i < slotCount; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.BoundingBoxAttachment) {\r\n var boundingBox = attachment;\r\n boundingBoxes.push(boundingBox);\r\n var polygon = polygonPool.obtain();\r\n if (polygon.length != boundingBox.worldVerticesLength) {\r\n polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);\r\n }\r\n polygons.push(polygon);\r\n boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\r\n }\r\n }\r\n if (updateAabb) {\r\n this.aabbCompute();\r\n }\r\n else {\r\n this.minX = Number.POSITIVE_INFINITY;\r\n this.minY = Number.POSITIVE_INFINITY;\r\n this.maxX = Number.NEGATIVE_INFINITY;\r\n this.maxY = Number.NEGATIVE_INFINITY;\r\n }\r\n };\r\n SkeletonBounds.prototype.aabbCompute = function () {\r\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++) {\r\n var polygon = polygons[i];\r\n var vertices = polygon;\r\n for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\r\n var x = vertices[ii];\r\n var y = vertices[ii + 1];\r\n minX = Math.min(minX, x);\r\n minY = Math.min(minY, y);\r\n maxX = Math.max(maxX, x);\r\n maxY = Math.max(maxY, y);\r\n }\r\n }\r\n this.minX = minX;\r\n this.minY = minY;\r\n this.maxX = maxX;\r\n this.maxY = maxY;\r\n };\r\n SkeletonBounds.prototype.aabbContainsPoint = function (x, y) {\r\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\r\n };\r\n SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\r\n var minX = this.minX;\r\n var minY = this.minY;\r\n var maxX = this.maxX;\r\n var maxY = this.maxY;\r\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\r\n return false;\r\n var m = (y2 - y1) / (x2 - x1);\r\n var y = m * (minX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n y = m * (maxX - x1) + y1;\r\n if (y > minY && y < maxY)\r\n return true;\r\n var x = (minY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n x = (maxY - y1) / m + x1;\r\n if (x > minX && x < maxX)\r\n return true;\r\n return false;\r\n };\r\n SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {\r\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\r\n };\r\n SkeletonBounds.prototype.containsPoint = function (x, y) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.containsPointPolygon(polygons[i], x, y))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var prevIndex = nn - 2;\r\n var inside = false;\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var vertexY = vertices[ii + 1];\r\n var prevY = vertices[prevIndex + 1];\r\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\r\n var vertexX = vertices[ii];\r\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\r\n inside = !inside;\r\n }\r\n prevIndex = ii;\r\n }\r\n return inside;\r\n };\r\n SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {\r\n var polygons = this.polygons;\r\n for (var i = 0, n = polygons.length; i < n; i++)\r\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\r\n return this.boundingBoxes[i];\r\n return null;\r\n };\r\n SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\r\n var vertices = polygon;\r\n var nn = polygon.length;\r\n var width12 = x1 - x2, height12 = y1 - y2;\r\n var det1 = x1 * y2 - y1 * x2;\r\n var x3 = vertices[nn - 2], y3 = vertices[nn - 1];\r\n for (var ii = 0; ii < nn; ii += 2) {\r\n var x4 = vertices[ii], y4 = vertices[ii + 1];\r\n var det2 = x3 * y4 - y3 * x4;\r\n var width34 = x3 - x4, height34 = y3 - y4;\r\n var det3 = width12 * height34 - height12 * width34;\r\n var x = (det1 * width34 - width12 * det2) / det3;\r\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\r\n var y = (det1 * height34 - height12 * det2) / det3;\r\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\r\n return true;\r\n }\r\n x3 = x4;\r\n y3 = y4;\r\n }\r\n return false;\r\n };\r\n SkeletonBounds.prototype.getPolygon = function (boundingBox) {\r\n if (boundingBox == null)\r\n throw new Error(\"boundingBox cannot be null.\");\r\n var index = this.boundingBoxes.indexOf(boundingBox);\r\n return index == -1 ? null : this.polygons[index];\r\n };\r\n SkeletonBounds.prototype.getWidth = function () {\r\n return this.maxX - this.minX;\r\n };\r\n SkeletonBounds.prototype.getHeight = function () {\r\n return this.maxY - this.minY;\r\n };\r\n return SkeletonBounds;\r\n }());\r\n spine.SkeletonBounds = SkeletonBounds;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonClipping = (function () {\r\n function SkeletonClipping() {\r\n this.triangulator = new spine.Triangulator();\r\n this.clippingPolygon = new Array();\r\n this.clipOutput = new Array();\r\n this.clippedVertices = new Array();\r\n this.clippedTriangles = new Array();\r\n this.scratch = new Array();\r\n }\r\n SkeletonClipping.prototype.clipStart = function (slot, clip) {\r\n if (this.clipAttachment != null)\r\n return 0;\r\n this.clipAttachment = clip;\r\n var n = clip.worldVerticesLength;\r\n var vertices = spine.Utils.setArraySize(this.clippingPolygon, n);\r\n clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\r\n var clippingPolygon = this.clippingPolygon;\r\n SkeletonClipping.makeClockwise(clippingPolygon);\r\n var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\r\n for (var i = 0, n_2 = clippingPolygons.length; i < n_2; i++) {\r\n var polygon = clippingPolygons[i];\r\n SkeletonClipping.makeClockwise(polygon);\r\n polygon.push(polygon[0]);\r\n polygon.push(polygon[1]);\r\n }\r\n return clippingPolygons.length;\r\n };\r\n SkeletonClipping.prototype.clipEndWithSlot = function (slot) {\r\n if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)\r\n this.clipEnd();\r\n };\r\n SkeletonClipping.prototype.clipEnd = function () {\r\n if (this.clipAttachment == null)\r\n return;\r\n this.clipAttachment = null;\r\n this.clippingPolygons = null;\r\n this.clippedVertices.length = 0;\r\n this.clippedTriangles.length = 0;\r\n this.clippingPolygon.length = 0;\r\n };\r\n SkeletonClipping.prototype.isClipping = function () {\r\n return this.clipAttachment != null;\r\n };\r\n SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {\r\n var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\r\n var clippedTriangles = this.clippedTriangles;\r\n var polygons = this.clippingPolygons;\r\n var polygonsCount = this.clippingPolygons.length;\r\n var vertexSize = twoColor ? 12 : 8;\r\n var index = 0;\r\n clippedVertices.length = 0;\r\n clippedTriangles.length = 0;\r\n outer: for (var i = 0; i < trianglesLength; i += 3) {\r\n var vertexOffset = triangles[i] << 1;\r\n var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\r\n var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\r\n vertexOffset = triangles[i + 1] << 1;\r\n var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\r\n var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\r\n vertexOffset = triangles[i + 2] << 1;\r\n var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\r\n var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\r\n for (var p = 0; p < polygonsCount; p++) {\r\n var s = clippedVertices.length;\r\n if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\r\n var clipOutputLength = clipOutput.length;\r\n if (clipOutputLength == 0)\r\n continue;\r\n var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\r\n var d = 1 / (d0 * d2 + d1 * (y1 - y3));\r\n var clipOutputCount = clipOutputLength >> 1;\r\n var clipOutputItems = this.clipOutput;\r\n var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\r\n for (var ii = 0; ii < clipOutputLength; ii += 2) {\r\n var x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\r\n clippedVerticesItems[s] = x;\r\n clippedVerticesItems[s + 1] = y;\r\n clippedVerticesItems[s + 2] = light.r;\r\n clippedVerticesItems[s + 3] = light.g;\r\n clippedVerticesItems[s + 4] = light.b;\r\n clippedVerticesItems[s + 5] = light.a;\r\n var c0 = x - x3, c1 = y - y3;\r\n var a = (d0 * c0 + d1 * c1) * d;\r\n var b = (d4 * c0 + d2 * c1) * d;\r\n var c = 1 - a - b;\r\n clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\r\n clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\r\n if (twoColor) {\r\n clippedVerticesItems[s + 8] = dark.r;\r\n clippedVerticesItems[s + 9] = dark.g;\r\n clippedVerticesItems[s + 10] = dark.b;\r\n clippedVerticesItems[s + 11] = dark.a;\r\n }\r\n s += vertexSize;\r\n }\r\n s = clippedTriangles.length;\r\n var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\r\n clipOutputCount--;\r\n for (var ii = 1; ii < clipOutputCount; ii++) {\r\n clippedTrianglesItems[s] = index;\r\n clippedTrianglesItems[s + 1] = (index + ii);\r\n clippedTrianglesItems[s + 2] = (index + ii + 1);\r\n s += 3;\r\n }\r\n index += clipOutputCount + 1;\r\n }\r\n else {\r\n var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\r\n clippedVerticesItems[s] = x1;\r\n clippedVerticesItems[s + 1] = y1;\r\n clippedVerticesItems[s + 2] = light.r;\r\n clippedVerticesItems[s + 3] = light.g;\r\n clippedVerticesItems[s + 4] = light.b;\r\n clippedVerticesItems[s + 5] = light.a;\r\n if (!twoColor) {\r\n clippedVerticesItems[s + 6] = u1;\r\n clippedVerticesItems[s + 7] = v1;\r\n clippedVerticesItems[s + 8] = x2;\r\n clippedVerticesItems[s + 9] = y2;\r\n clippedVerticesItems[s + 10] = light.r;\r\n clippedVerticesItems[s + 11] = light.g;\r\n clippedVerticesItems[s + 12] = light.b;\r\n clippedVerticesItems[s + 13] = light.a;\r\n clippedVerticesItems[s + 14] = u2;\r\n clippedVerticesItems[s + 15] = v2;\r\n clippedVerticesItems[s + 16] = x3;\r\n clippedVerticesItems[s + 17] = y3;\r\n clippedVerticesItems[s + 18] = light.r;\r\n clippedVerticesItems[s + 19] = light.g;\r\n clippedVerticesItems[s + 20] = light.b;\r\n clippedVerticesItems[s + 21] = light.a;\r\n clippedVerticesItems[s + 22] = u3;\r\n clippedVerticesItems[s + 23] = v3;\r\n }\r\n else {\r\n clippedVerticesItems[s + 6] = u1;\r\n clippedVerticesItems[s + 7] = v1;\r\n clippedVerticesItems[s + 8] = dark.r;\r\n clippedVerticesItems[s + 9] = dark.g;\r\n clippedVerticesItems[s + 10] = dark.b;\r\n clippedVerticesItems[s + 11] = dark.a;\r\n clippedVerticesItems[s + 12] = x2;\r\n clippedVerticesItems[s + 13] = y2;\r\n clippedVerticesItems[s + 14] = light.r;\r\n clippedVerticesItems[s + 15] = light.g;\r\n clippedVerticesItems[s + 16] = light.b;\r\n clippedVerticesItems[s + 17] = light.a;\r\n clippedVerticesItems[s + 18] = u2;\r\n clippedVerticesItems[s + 19] = v2;\r\n clippedVerticesItems[s + 20] = dark.r;\r\n clippedVerticesItems[s + 21] = dark.g;\r\n clippedVerticesItems[s + 22] = dark.b;\r\n clippedVerticesItems[s + 23] = dark.a;\r\n clippedVerticesItems[s + 24] = x3;\r\n clippedVerticesItems[s + 25] = y3;\r\n clippedVerticesItems[s + 26] = light.r;\r\n clippedVerticesItems[s + 27] = light.g;\r\n clippedVerticesItems[s + 28] = light.b;\r\n clippedVerticesItems[s + 29] = light.a;\r\n clippedVerticesItems[s + 30] = u3;\r\n clippedVerticesItems[s + 31] = v3;\r\n clippedVerticesItems[s + 32] = dark.r;\r\n clippedVerticesItems[s + 33] = dark.g;\r\n clippedVerticesItems[s + 34] = dark.b;\r\n clippedVerticesItems[s + 35] = dark.a;\r\n }\r\n s = clippedTriangles.length;\r\n var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);\r\n clippedTrianglesItems[s] = index;\r\n clippedTrianglesItems[s + 1] = (index + 1);\r\n clippedTrianglesItems[s + 2] = (index + 2);\r\n index += 3;\r\n continue outer;\r\n }\r\n }\r\n }\r\n };\r\n SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {\r\n var originalOutput = output;\r\n var clipped = false;\r\n var input = null;\r\n if (clippingArea.length % 4 >= 2) {\r\n input = output;\r\n output = this.scratch;\r\n }\r\n else\r\n input = this.scratch;\r\n input.length = 0;\r\n input.push(x1);\r\n input.push(y1);\r\n input.push(x2);\r\n input.push(y2);\r\n input.push(x3);\r\n input.push(y3);\r\n input.push(x1);\r\n input.push(y1);\r\n output.length = 0;\r\n var clippingVertices = clippingArea;\r\n var clippingVerticesLast = clippingArea.length - 4;\r\n for (var i = 0;; i += 2) {\r\n var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\r\n var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];\r\n var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;\r\n var inputVertices = input;\r\n var inputVerticesLength = input.length - 2, outputStart = output.length;\r\n for (var ii = 0; ii < inputVerticesLength; ii += 2) {\r\n var inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\r\n var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];\r\n var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;\r\n if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {\r\n if (side2) {\r\n output.push(inputX2);\r\n output.push(inputY2);\r\n continue;\r\n }\r\n var c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n if (Math.abs(s) > 0.000001) {\r\n var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n output.push(edgeX + (edgeX2 - edgeX) * ua);\r\n output.push(edgeY + (edgeY2 - edgeY) * ua);\r\n }\r\n else {\r\n output.push(edgeX);\r\n output.push(edgeY);\r\n }\r\n }\r\n else if (side2) {\r\n var c0 = inputY2 - inputY, c2 = inputX2 - inputX;\r\n var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\r\n if (Math.abs(s) > 0.000001) {\r\n var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\r\n output.push(edgeX + (edgeX2 - edgeX) * ua);\r\n output.push(edgeY + (edgeY2 - edgeY) * ua);\r\n }\r\n else {\r\n output.push(edgeX);\r\n output.push(edgeY);\r\n }\r\n output.push(inputX2);\r\n output.push(inputY2);\r\n }\r\n clipped = true;\r\n }\r\n if (outputStart == output.length) {\r\n originalOutput.length = 0;\r\n return true;\r\n }\r\n output.push(output[0]);\r\n output.push(output[1]);\r\n if (i == clippingVerticesLast)\r\n break;\r\n var temp = output;\r\n output = input;\r\n output.length = 0;\r\n input = temp;\r\n }\r\n if (originalOutput != output) {\r\n originalOutput.length = 0;\r\n for (var i = 0, n = output.length - 2; i < n; i++)\r\n originalOutput[i] = output[i];\r\n }\r\n else\r\n originalOutput.length = originalOutput.length - 2;\r\n return clipped;\r\n };\r\n SkeletonClipping.makeClockwise = function (polygon) {\r\n var vertices = polygon;\r\n var verticeslength = polygon.length;\r\n var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\r\n for (var i = 0, n = verticeslength - 3; i < n; i += 2) {\r\n p1x = vertices[i];\r\n p1y = vertices[i + 1];\r\n p2x = vertices[i + 2];\r\n p2y = vertices[i + 3];\r\n area += p1x * p2y - p2x * p1y;\r\n }\r\n if (area < 0)\r\n return;\r\n for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\r\n var x = vertices[i], y = vertices[i + 1];\r\n var other = lastX - i;\r\n vertices[i] = vertices[other];\r\n vertices[i + 1] = vertices[other + 1];\r\n vertices[other] = x;\r\n vertices[other + 1] = y;\r\n }\r\n };\r\n return SkeletonClipping;\r\n }());\r\n spine.SkeletonClipping = SkeletonClipping;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonData = (function () {\r\n function SkeletonData() {\r\n this.bones = new Array();\r\n this.slots = new Array();\r\n this.skins = new Array();\r\n this.events = new Array();\r\n this.animations = new Array();\r\n this.ikConstraints = new Array();\r\n this.transformConstraints = new Array();\r\n this.pathConstraints = new Array();\r\n this.fps = 0;\r\n }\r\n SkeletonData.prototype.findBone = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (bone.name == boneName)\r\n return bone;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findBoneIndex = function (boneName) {\r\n if (boneName == null)\r\n throw new Error(\"boneName cannot be null.\");\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++)\r\n if (bones[i].name == boneName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSlot = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (slot.name == slotName)\r\n return slot;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findSlotIndex = function (slotName) {\r\n if (slotName == null)\r\n throw new Error(\"slotName cannot be null.\");\r\n var slots = this.slots;\r\n for (var i = 0, n = slots.length; i < n; i++)\r\n if (slots[i].name == slotName)\r\n return i;\r\n return -1;\r\n };\r\n SkeletonData.prototype.findSkin = function (skinName) {\r\n if (skinName == null)\r\n throw new Error(\"skinName cannot be null.\");\r\n var skins = this.skins;\r\n for (var i = 0, n = skins.length; i < n; i++) {\r\n var skin = skins[i];\r\n if (skin.name == skinName)\r\n return skin;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findEvent = function (eventDataName) {\r\n if (eventDataName == null)\r\n throw new Error(\"eventDataName cannot be null.\");\r\n var events = this.events;\r\n for (var i = 0, n = events.length; i < n; i++) {\r\n var event_5 = events[i];\r\n if (event_5.name == eventDataName)\r\n return event_5;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findAnimation = function (animationName) {\r\n if (animationName == null)\r\n throw new Error(\"animationName cannot be null.\");\r\n var animations = this.animations;\r\n for (var i = 0, n = animations.length; i < n; i++) {\r\n var animation = animations[i];\r\n if (animation.name == animationName)\r\n return animation;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var ikConstraints = this.ikConstraints;\r\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\r\n var constraint = ikConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var transformConstraints = this.transformConstraints;\r\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\r\n var constraint = transformConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\r\n if (constraintName == null)\r\n throw new Error(\"constraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\r\n var constraint = pathConstraints[i];\r\n if (constraint.name == constraintName)\r\n return constraint;\r\n }\r\n return null;\r\n };\r\n SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\r\n if (pathConstraintName == null)\r\n throw new Error(\"pathConstraintName cannot be null.\");\r\n var pathConstraints = this.pathConstraints;\r\n for (var i = 0, n = pathConstraints.length; i < n; i++)\r\n if (pathConstraints[i].name == pathConstraintName)\r\n return i;\r\n return -1;\r\n };\r\n return SkeletonData;\r\n }());\r\n spine.SkeletonData = SkeletonData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkeletonJson = (function () {\r\n function SkeletonJson(attachmentLoader) {\r\n this.scale = 1;\r\n this.linkedMeshes = new Array();\r\n this.attachmentLoader = attachmentLoader;\r\n }\r\n SkeletonJson.prototype.readSkeletonData = function (json) {\r\n var scale = this.scale;\r\n var skeletonData = new spine.SkeletonData();\r\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\r\n var skeletonMap = root.skeleton;\r\n if (skeletonMap != null) {\r\n skeletonData.hash = skeletonMap.hash;\r\n skeletonData.version = skeletonMap.spine;\r\n if (\"3.8.75\" == skeletonData.version)\r\n throw new Error(\"Unsupported skeleton data, please export with a newer version of Spine.\");\r\n skeletonData.x = skeletonMap.x;\r\n skeletonData.y = skeletonMap.y;\r\n skeletonData.width = skeletonMap.width;\r\n skeletonData.height = skeletonMap.height;\r\n skeletonData.fps = skeletonMap.fps;\r\n skeletonData.imagesPath = skeletonMap.images;\r\n }\r\n if (root.bones) {\r\n for (var i = 0; i < root.bones.length; i++) {\r\n var boneMap = root.bones[i];\r\n var parent_5 = null;\r\n var parentName = this.getValue(boneMap, \"parent\", null);\r\n if (parentName != null) {\r\n parent_5 = skeletonData.findBone(parentName);\r\n if (parent_5 == null)\r\n throw new Error(\"Parent bone not found: \" + parentName);\r\n }\r\n var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_5);\r\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\r\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\r\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\r\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\r\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\r\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\r\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\r\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\r\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\r\n data.skinRequired = this.getValue(boneMap, \"skin\", false);\r\n skeletonData.bones.push(data);\r\n }\r\n }\r\n if (root.slots) {\r\n for (var i = 0; i < root.slots.length; i++) {\r\n var slotMap = root.slots[i];\r\n var slotName = slotMap.name;\r\n var boneName = slotMap.bone;\r\n var boneData = skeletonData.findBone(boneName);\r\n if (boneData == null)\r\n throw new Error(\"Slot bone not found: \" + boneName);\r\n var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);\r\n var color = this.getValue(slotMap, \"color\", null);\r\n if (color != null)\r\n data.color.setFromString(color);\r\n var dark = this.getValue(slotMap, \"dark\", null);\r\n if (dark != null) {\r\n data.darkColor = new spine.Color(1, 1, 1, 1);\r\n data.darkColor.setFromString(dark);\r\n }\r\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\r\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\r\n skeletonData.slots.push(data);\r\n }\r\n }\r\n if (root.ik) {\r\n for (var i = 0; i < root.ik.length; i++) {\r\n var constraintMap = root.ik[i];\r\n var data = new spine.IkConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"IK bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"IK target bone not found: \" + targetName);\r\n data.mix = this.getValue(constraintMap, \"mix\", 1);\r\n data.softness = this.getValue(constraintMap, \"softness\", 0) * scale;\r\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\r\n data.compress = this.getValue(constraintMap, \"compress\", false);\r\n data.stretch = this.getValue(constraintMap, \"stretch\", false);\r\n data.uniform = this.getValue(constraintMap, \"uniform\", false);\r\n skeletonData.ikConstraints.push(data);\r\n }\r\n }\r\n if (root.transform) {\r\n for (var i = 0; i < root.transform.length; i++) {\r\n var constraintMap = root.transform[i];\r\n var data = new spine.TransformConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findBone(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Transform constraint target bone not found: \" + targetName);\r\n data.local = this.getValue(constraintMap, \"local\", false);\r\n data.relative = this.getValue(constraintMap, \"relative\", false);\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\r\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\r\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\r\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\r\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\r\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\r\n skeletonData.transformConstraints.push(data);\r\n }\r\n }\r\n if (root.path) {\r\n for (var i = 0; i < root.path.length; i++) {\r\n var constraintMap = root.path[i];\r\n var data = new spine.PathConstraintData(constraintMap.name);\r\n data.order = this.getValue(constraintMap, \"order\", 0);\r\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\r\n for (var j = 0; j < constraintMap.bones.length; j++) {\r\n var boneName = constraintMap.bones[j];\r\n var bone = skeletonData.findBone(boneName);\r\n if (bone == null)\r\n throw new Error(\"Transform constraint bone not found: \" + boneName);\r\n data.bones.push(bone);\r\n }\r\n var targetName = constraintMap.target;\r\n data.target = skeletonData.findSlot(targetName);\r\n if (data.target == null)\r\n throw new Error(\"Path target slot not found: \" + targetName);\r\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\r\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\r\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\r\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\r\n data.position = this.getValue(constraintMap, \"position\", 0);\r\n if (data.positionMode == spine.PositionMode.Fixed)\r\n data.position *= scale;\r\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\r\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n data.spacing *= scale;\r\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\r\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\r\n skeletonData.pathConstraints.push(data);\r\n }\r\n }\r\n if (root.skins) {\r\n for (var i = 0; i < root.skins.length; i++) {\r\n var skinMap = root.skins[i];\r\n var skin = new spine.Skin(skinMap.name);\r\n if (skinMap.bones) {\r\n for (var ii = 0; ii < skinMap.bones.length; ii++) {\r\n var bone = skeletonData.findBone(skinMap.bones[ii]);\r\n if (bone == null)\r\n throw new Error(\"Skin bone not found: \" + skinMap.bones[i]);\r\n skin.bones.push(bone);\r\n }\r\n }\r\n if (skinMap.ik) {\r\n for (var ii = 0; ii < skinMap.ik.length; ii++) {\r\n var constraint = skeletonData.findIkConstraint(skinMap.ik[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin IK constraint not found: \" + skinMap.ik[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.transform) {\r\n for (var ii = 0; ii < skinMap.transform.length; ii++) {\r\n var constraint = skeletonData.findTransformConstraint(skinMap.transform[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin transform constraint not found: \" + skinMap.transform[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n if (skinMap.path) {\r\n for (var ii = 0; ii < skinMap.path.length; ii++) {\r\n var constraint = skeletonData.findPathConstraint(skinMap.path[ii]);\r\n if (constraint == null)\r\n throw new Error(\"Skin path constraint not found: \" + skinMap.path[i]);\r\n skin.constraints.push(constraint);\r\n }\r\n }\r\n for (var slotName in skinMap.attachments) {\r\n var slot = skeletonData.findSlot(slotName);\r\n if (slot == null)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n var slotMap = skinMap.attachments[slotName];\r\n for (var entryName in slotMap) {\r\n var attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\r\n if (attachment != null)\r\n skin.setAttachment(slot.index, entryName, attachment);\r\n }\r\n }\r\n skeletonData.skins.push(skin);\r\n if (skin.name == \"default\")\r\n skeletonData.defaultSkin = skin;\r\n }\r\n }\r\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\r\n var linkedMesh = this.linkedMeshes[i];\r\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\r\n var parent_6 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\r\n if (parent_6 == null)\r\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\r\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_6 : linkedMesh.mesh;\r\n linkedMesh.mesh.setParentMesh(parent_6);\r\n linkedMesh.mesh.updateUVs();\r\n }\r\n this.linkedMeshes.length = 0;\r\n if (root.events) {\r\n for (var eventName in root.events) {\r\n var eventMap = root.events[eventName];\r\n var data = new spine.EventData(eventName);\r\n data.intValue = this.getValue(eventMap, \"int\", 0);\r\n data.floatValue = this.getValue(eventMap, \"float\", 0);\r\n data.stringValue = this.getValue(eventMap, \"string\", \"\");\r\n data.audioPath = this.getValue(eventMap, \"audio\", null);\r\n if (data.audioPath != null) {\r\n data.volume = this.getValue(eventMap, \"volume\", 1);\r\n data.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n skeletonData.events.push(data);\r\n }\r\n }\r\n if (root.animations) {\r\n for (var animationName in root.animations) {\r\n var animationMap = root.animations[animationName];\r\n this.readAnimation(animationMap, animationName, skeletonData);\r\n }\r\n }\r\n return skeletonData;\r\n };\r\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\r\n var scale = this.scale;\r\n name = this.getValue(map, \"name\", name);\r\n var type = this.getValue(map, \"type\", \"region\");\r\n switch (type) {\r\n case \"region\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\r\n if (region == null)\r\n return null;\r\n region.path = path;\r\n region.x = this.getValue(map, \"x\", 0) * scale;\r\n region.y = this.getValue(map, \"y\", 0) * scale;\r\n region.scaleX = this.getValue(map, \"scaleX\", 1);\r\n region.scaleY = this.getValue(map, \"scaleY\", 1);\r\n region.rotation = this.getValue(map, \"rotation\", 0);\r\n region.width = map.width * scale;\r\n region.height = map.height * scale;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n region.color.setFromString(color);\r\n region.updateOffset();\r\n return region;\r\n }\r\n case \"boundingbox\": {\r\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\r\n if (box == null)\r\n return null;\r\n this.readVertices(map, box, map.vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n box.color.setFromString(color);\r\n return box;\r\n }\r\n case \"mesh\":\r\n case \"linkedmesh\": {\r\n var path = this.getValue(map, \"path\", name);\r\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\r\n if (mesh == null)\r\n return null;\r\n mesh.path = path;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n mesh.color.setFromString(color);\r\n mesh.width = this.getValue(map, \"width\", 0) * scale;\r\n mesh.height = this.getValue(map, \"height\", 0) * scale;\r\n var parent_7 = this.getValue(map, \"parent\", null);\r\n if (parent_7 != null) {\r\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_7, this.getValue(map, \"deform\", true)));\r\n return mesh;\r\n }\r\n var uvs = map.uvs;\r\n this.readVertices(map, mesh, uvs.length);\r\n mesh.triangles = map.triangles;\r\n mesh.regionUVs = uvs;\r\n mesh.updateUVs();\r\n mesh.edges = this.getValue(map, \"edges\", null);\r\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\r\n return mesh;\r\n }\r\n case \"path\": {\r\n var path = this.attachmentLoader.newPathAttachment(skin, name);\r\n if (path == null)\r\n return null;\r\n path.closed = this.getValue(map, \"closed\", false);\r\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, path, vertexCount << 1);\r\n var lengths = spine.Utils.newArray(vertexCount / 3, 0);\r\n for (var i = 0; i < map.lengths.length; i++)\r\n lengths[i] = map.lengths[i] * scale;\r\n path.lengths = lengths;\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n path.color.setFromString(color);\r\n return path;\r\n }\r\n case \"point\": {\r\n var point = this.attachmentLoader.newPointAttachment(skin, name);\r\n if (point == null)\r\n return null;\r\n point.x = this.getValue(map, \"x\", 0) * scale;\r\n point.y = this.getValue(map, \"y\", 0) * scale;\r\n point.rotation = this.getValue(map, \"rotation\", 0);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n point.color.setFromString(color);\r\n return point;\r\n }\r\n case \"clipping\": {\r\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\r\n if (clip == null)\r\n return null;\r\n var end = this.getValue(map, \"end\", null);\r\n if (end != null) {\r\n var slot = skeletonData.findSlot(end);\r\n if (slot == null)\r\n throw new Error(\"Clipping end slot not found: \" + end);\r\n clip.endSlot = slot;\r\n }\r\n var vertexCount = map.vertexCount;\r\n this.readVertices(map, clip, vertexCount << 1);\r\n var color = this.getValue(map, \"color\", null);\r\n if (color != null)\r\n clip.color.setFromString(color);\r\n return clip;\r\n }\r\n }\r\n return null;\r\n };\r\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\r\n var scale = this.scale;\r\n attachment.worldVerticesLength = verticesLength;\r\n var vertices = map.vertices;\r\n if (verticesLength == vertices.length) {\r\n var scaledVertices = spine.Utils.toFloatArray(vertices);\r\n if (scale != 1) {\r\n for (var i = 0, n = vertices.length; i < n; i++)\r\n scaledVertices[i] *= scale;\r\n }\r\n attachment.vertices = scaledVertices;\r\n return;\r\n }\r\n var weights = new Array();\r\n var bones = new Array();\r\n for (var i = 0, n = vertices.length; i < n;) {\r\n var boneCount = vertices[i++];\r\n bones.push(boneCount);\r\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\r\n bones.push(vertices[i]);\r\n weights.push(vertices[i + 1] * scale);\r\n weights.push(vertices[i + 2] * scale);\r\n weights.push(vertices[i + 3]);\r\n }\r\n }\r\n attachment.bones = bones;\r\n attachment.vertices = spine.Utils.toFloatArray(weights);\r\n };\r\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\r\n var scale = this.scale;\r\n var timelines = new Array();\r\n var duration = 0;\r\n if (map.slots) {\r\n for (var slotName in map.slots) {\r\n var slotMap = map.slots[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotName);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n if (timelineName == \"attachment\") {\r\n var timeline = new spine.AttachmentTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex++, this.getValue(valueMap, \"time\", 0), valueMap.name);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n else if (timelineName == \"color\") {\r\n var timeline = new spine.ColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var color = new spine.Color();\r\n color.setFromString(valueMap.color);\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), color.r, color.g, color.b, color.a);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);\r\n }\r\n else if (timelineName == \"twoColor\") {\r\n var timeline = new spine.TwoColorTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var light = new spine.Color();\r\n var dark = new spine.Color();\r\n light.setFromString(valueMap.light);\r\n dark.setFromString(valueMap.dark);\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\r\n }\r\n }\r\n }\r\n if (map.bones) {\r\n for (var boneName in map.bones) {\r\n var boneMap = map.bones[boneName];\r\n var boneIndex = skeletonData.findBoneIndex(boneName);\r\n if (boneIndex == -1)\r\n throw new Error(\"Bone not found: \" + boneName);\r\n for (var timelineName in boneMap) {\r\n var timelineMap = boneMap[timelineName];\r\n if (timelineName === \"rotate\") {\r\n var timeline = new spine.RotateTimeline(timelineMap.length);\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"angle\", 0));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\r\n var timeline = null;\r\n var timelineScale = 1, defaultValue = 0;\r\n if (timelineName === \"scale\") {\r\n timeline = new spine.ScaleTimeline(timelineMap.length);\r\n defaultValue = 1;\r\n }\r\n else if (timelineName === \"shear\")\r\n timeline = new spine.ShearTimeline(timelineMap.length);\r\n else {\r\n timeline = new spine.TranslateTimeline(timelineMap.length);\r\n timelineScale = scale;\r\n }\r\n timeline.boneIndex = boneIndex;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n var x = this.getValue(valueMap, \"x\", defaultValue), y = this.getValue(valueMap, \"y\", defaultValue);\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), x * timelineScale, y * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);\r\n }\r\n else\r\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\r\n }\r\n }\r\n }\r\n if (map.ik) {\r\n for (var constraintName in map.ik) {\r\n var constraintMap = map.ik[constraintName];\r\n var constraint = skeletonData.findIkConstraint(constraintName);\r\n var timeline = new spine.IkConstraintTimeline(constraintMap.length);\r\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"softness\", 0) * scale, this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n if (map.transform) {\r\n for (var constraintName in map.transform) {\r\n var constraintMap = map.transform[constraintName];\r\n var constraint = skeletonData.findTransformConstraint(constraintName);\r\n var timeline = new spine.TransformConstraintTimeline(constraintMap.length);\r\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\r\n var frameIndex = 0;\r\n for (var i = 0; i < constraintMap.length; i++) {\r\n var valueMap = constraintMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);\r\n }\r\n }\r\n if (map.path) {\r\n for (var constraintName in map.path) {\r\n var constraintMap = map.path[constraintName];\r\n var index = skeletonData.findPathConstraintIndex(constraintName);\r\n if (index == -1)\r\n throw new Error(\"Path constraint not found: \" + constraintName);\r\n var data = skeletonData.pathConstraints[index];\r\n for (var timelineName in constraintMap) {\r\n var timelineMap = constraintMap[timelineName];\r\n if (timelineName === \"position\" || timelineName === \"spacing\") {\r\n var timeline = null;\r\n var timelineScale = 1;\r\n if (timelineName === \"spacing\") {\r\n timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);\r\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n else {\r\n timeline = new spine.PathConstraintPositionTimeline(timelineMap.length);\r\n if (data.positionMode == spine.PositionMode.Fixed)\r\n timelineScale = scale;\r\n }\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, timelineName, 0) * timelineScale);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\r\n }\r\n else if (timelineName === \"mix\") {\r\n var timeline = new spine.PathConstraintMixTimeline(timelineMap.length);\r\n timeline.pathConstraintIndex = index;\r\n var frameIndex = 0;\r\n for (var i = 0; i < timelineMap.length; i++) {\r\n var valueMap = timelineMap[i];\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\r\n }\r\n }\r\n }\r\n }\r\n if (map.deform) {\r\n for (var deformName in map.deform) {\r\n var deformMap = map.deform[deformName];\r\n var skin = skeletonData.findSkin(deformName);\r\n if (skin == null)\r\n throw new Error(\"Skin not found: \" + deformName);\r\n for (var slotName in deformMap) {\r\n var slotMap = deformMap[slotName];\r\n var slotIndex = skeletonData.findSlotIndex(slotName);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + slotMap.name);\r\n for (var timelineName in slotMap) {\r\n var timelineMap = slotMap[timelineName];\r\n var attachment = skin.getAttachment(slotIndex, timelineName);\r\n if (attachment == null)\r\n throw new Error(\"Deform attachment not found: \" + timelineMap.name);\r\n var weighted = attachment.bones != null;\r\n var vertices = attachment.vertices;\r\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\r\n var timeline = new spine.DeformTimeline(timelineMap.length);\r\n timeline.slotIndex = slotIndex;\r\n timeline.attachment = attachment;\r\n var frameIndex = 0;\r\n for (var j = 0; j < timelineMap.length; j++) {\r\n var valueMap = timelineMap[j];\r\n var deform = void 0;\r\n var verticesValue = this.getValue(valueMap, \"vertices\", null);\r\n if (verticesValue == null)\r\n deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\r\n else {\r\n deform = spine.Utils.newFloatArray(deformLength);\r\n var start = this.getValue(valueMap, \"offset\", 0);\r\n spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\r\n if (scale != 1) {\r\n for (var i = start, n = i + verticesValue.length; i < n; i++)\r\n deform[i] *= scale;\r\n }\r\n if (!weighted) {\r\n for (var i = 0; i < deformLength; i++)\r\n deform[i] += vertices[i];\r\n }\r\n }\r\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), deform);\r\n this.readCurve(valueMap, timeline, frameIndex);\r\n frameIndex++;\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n }\r\n }\r\n }\r\n var drawOrderNode = map.drawOrder;\r\n if (drawOrderNode == null)\r\n drawOrderNode = map.draworder;\r\n if (drawOrderNode != null) {\r\n var timeline = new spine.DrawOrderTimeline(drawOrderNode.length);\r\n var slotCount = skeletonData.slots.length;\r\n var frameIndex = 0;\r\n for (var j = 0; j < drawOrderNode.length; j++) {\r\n var drawOrderMap = drawOrderNode[j];\r\n var drawOrder = null;\r\n var offsets = this.getValue(drawOrderMap, \"offsets\", null);\r\n if (offsets != null) {\r\n drawOrder = spine.Utils.newArray(slotCount, -1);\r\n var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);\r\n var originalIndex = 0, unchangedIndex = 0;\r\n for (var i = 0; i < offsets.length; i++) {\r\n var offsetMap = offsets[i];\r\n var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\r\n if (slotIndex == -1)\r\n throw new Error(\"Slot not found: \" + offsetMap.slot);\r\n while (originalIndex != slotIndex)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\r\n }\r\n while (originalIndex < slotCount)\r\n unchanged[unchangedIndex++] = originalIndex++;\r\n for (var i = slotCount - 1; i >= 0; i--)\r\n if (drawOrder[i] == -1)\r\n drawOrder[i] = unchanged[--unchangedIndex];\r\n }\r\n timeline.setFrame(frameIndex++, this.getValue(drawOrderMap, \"time\", 0), drawOrder);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (map.events) {\r\n var timeline = new spine.EventTimeline(map.events.length);\r\n var frameIndex = 0;\r\n for (var i = 0; i < map.events.length; i++) {\r\n var eventMap = map.events[i];\r\n var eventData = skeletonData.findEvent(eventMap.name);\r\n if (eventData == null)\r\n throw new Error(\"Event not found: \" + eventMap.name);\r\n var event_6 = new spine.Event(spine.Utils.toSinglePrecision(this.getValue(eventMap, \"time\", 0)), eventData);\r\n event_6.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\r\n event_6.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\r\n event_6.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\r\n if (event_6.data.audioPath != null) {\r\n event_6.volume = this.getValue(eventMap, \"volume\", 1);\r\n event_6.balance = this.getValue(eventMap, \"balance\", 0);\r\n }\r\n timeline.setFrame(frameIndex++, event_6);\r\n }\r\n timelines.push(timeline);\r\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\r\n }\r\n if (isNaN(duration)) {\r\n throw new Error(\"Error while parsing animation, duration is NaN\");\r\n }\r\n skeletonData.animations.push(new spine.Animation(name, timelines, duration));\r\n };\r\n SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\r\n if (!map.hasOwnProperty(\"curve\"))\r\n return;\r\n if (map.curve == \"stepped\")\r\n timeline.setStepped(frameIndex);\r\n else {\r\n var curve = map.curve;\r\n timeline.setCurve(frameIndex, curve, this.getValue(map, \"c2\", 0), this.getValue(map, \"c3\", 1), this.getValue(map, \"c4\", 1));\r\n }\r\n };\r\n SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\r\n return map[prop] !== undefined ? map[prop] : defaultValue;\r\n };\r\n SkeletonJson.blendModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return spine.BlendMode.Normal;\r\n if (str == \"additive\")\r\n return spine.BlendMode.Additive;\r\n if (str == \"multiply\")\r\n return spine.BlendMode.Multiply;\r\n if (str == \"screen\")\r\n return spine.BlendMode.Screen;\r\n throw new Error(\"Unknown blend mode: \" + str);\r\n };\r\n SkeletonJson.positionModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"fixed\")\r\n return spine.PositionMode.Fixed;\r\n if (str == \"percent\")\r\n return spine.PositionMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.spacingModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"length\")\r\n return spine.SpacingMode.Length;\r\n if (str == \"fixed\")\r\n return spine.SpacingMode.Fixed;\r\n if (str == \"percent\")\r\n return spine.SpacingMode.Percent;\r\n throw new Error(\"Unknown position mode: \" + str);\r\n };\r\n SkeletonJson.rotateModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"tangent\")\r\n return spine.RotateMode.Tangent;\r\n if (str == \"chain\")\r\n return spine.RotateMode.Chain;\r\n if (str == \"chainscale\")\r\n return spine.RotateMode.ChainScale;\r\n throw new Error(\"Unknown rotate mode: \" + str);\r\n };\r\n SkeletonJson.transformModeFromString = function (str) {\r\n str = str.toLowerCase();\r\n if (str == \"normal\")\r\n return spine.TransformMode.Normal;\r\n if (str == \"onlytranslation\")\r\n return spine.TransformMode.OnlyTranslation;\r\n if (str == \"norotationorreflection\")\r\n return spine.TransformMode.NoRotationOrReflection;\r\n if (str == \"noscale\")\r\n return spine.TransformMode.NoScale;\r\n if (str == \"noscaleorreflection\")\r\n return spine.TransformMode.NoScaleOrReflection;\r\n throw new Error(\"Unknown transform mode: \" + str);\r\n };\r\n return SkeletonJson;\r\n }());\r\n spine.SkeletonJson = SkeletonJson;\r\n var LinkedMesh = (function () {\r\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\r\n this.mesh = mesh;\r\n this.skin = skin;\r\n this.slotIndex = slotIndex;\r\n this.parent = parent;\r\n this.inheritDeform = inheritDeform;\r\n }\r\n return LinkedMesh;\r\n }());\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SkinEntry = (function () {\r\n function SkinEntry(slotIndex, name, attachment) {\r\n this.slotIndex = slotIndex;\r\n this.name = name;\r\n this.attachment = attachment;\r\n }\r\n return SkinEntry;\r\n }());\r\n spine.SkinEntry = SkinEntry;\r\n var Skin = (function () {\r\n function Skin(name) {\r\n this.attachments = new Array();\r\n this.bones = Array();\r\n this.constraints = new Array();\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n Skin.prototype.setAttachment = function (slotIndex, name, attachment) {\r\n if (attachment == null)\r\n throw new Error(\"attachment cannot be null.\");\r\n var attachments = this.attachments;\r\n if (slotIndex >= attachments.length)\r\n attachments.length = slotIndex + 1;\r\n if (!attachments[slotIndex])\r\n attachments[slotIndex] = {};\r\n attachments[slotIndex][name] = attachment;\r\n };\r\n Skin.prototype.addSkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var j = 0; j < this.bones.length; j++) {\r\n if (this.bones[j] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var j = 0; j < this.constraints.length; j++) {\r\n if (this.constraints[j] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n };\r\n Skin.prototype.copySkin = function (skin) {\r\n for (var i = 0; i < skin.bones.length; i++) {\r\n var bone = skin.bones[i];\r\n var contained = false;\r\n for (var j = 0; j < this.bones.length; j++) {\r\n if (this.bones[j] == bone) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.bones.push(bone);\r\n }\r\n for (var i = 0; i < skin.constraints.length; i++) {\r\n var constraint = skin.constraints[i];\r\n var contained = false;\r\n for (var j = 0; j < this.constraints.length; j++) {\r\n if (this.constraints[j] == constraint) {\r\n contained = true;\r\n break;\r\n }\r\n }\r\n if (!contained)\r\n this.constraints.push(constraint);\r\n }\r\n var attachments = skin.getAttachments();\r\n for (var i = 0; i < attachments.length; i++) {\r\n var attachment = attachments[i];\r\n if (attachment.attachment == null)\r\n continue;\r\n if (attachment.attachment instanceof spine.MeshAttachment) {\r\n attachment.attachment = attachment.attachment.newLinkedMesh();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n else {\r\n attachment.attachment = attachment.attachment.copy();\r\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\r\n }\r\n }\r\n };\r\n Skin.prototype.getAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n return dictionary ? dictionary[name] : null;\r\n };\r\n Skin.prototype.removeAttachment = function (slotIndex, name) {\r\n var dictionary = this.attachments[slotIndex];\r\n if (dictionary)\r\n dictionary[name] = null;\r\n };\r\n Skin.prototype.getAttachments = function () {\r\n var entries = new Array();\r\n for (var i = 0; i < this.attachments.length; i++) {\r\n var slotAttachments = this.attachments[i];\r\n if (slotAttachments) {\r\n for (var name_4 in slotAttachments) {\r\n var attachment = slotAttachments[name_4];\r\n if (attachment)\r\n entries.push(new SkinEntry(i, name_4, attachment));\r\n }\r\n }\r\n }\r\n return entries;\r\n };\r\n Skin.prototype.getAttachmentsForSlot = function (slotIndex, attachments) {\r\n var slotAttachments = this.attachments[slotIndex];\r\n if (slotAttachments) {\r\n for (var name_5 in slotAttachments) {\r\n var attachment = slotAttachments[name_5];\r\n if (attachment)\r\n attachments.push(new SkinEntry(slotIndex, name_5, attachment));\r\n }\r\n }\r\n };\r\n Skin.prototype.clear = function () {\r\n this.attachments.length = 0;\r\n this.bones.length = 0;\r\n this.constraints.length = 0;\r\n };\r\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\r\n var slotIndex = 0;\r\n for (var i = 0; i < skeleton.slots.length; i++) {\r\n var slot = skeleton.slots[i];\r\n var slotAttachment = slot.getAttachment();\r\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\r\n var dictionary = oldSkin.attachments[slotIndex];\r\n for (var key in dictionary) {\r\n var skinAttachment = dictionary[key];\r\n if (slotAttachment == skinAttachment) {\r\n var attachment = this.getAttachment(slotIndex, key);\r\n if (attachment != null)\r\n slot.setAttachment(attachment);\r\n break;\r\n }\r\n }\r\n }\r\n slotIndex++;\r\n }\r\n };\r\n return Skin;\r\n }());\r\n spine.Skin = Skin;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Slot = (function () {\r\n function Slot(data, bone) {\r\n this.deform = new Array();\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (bone == null)\r\n throw new Error(\"bone cannot be null.\");\r\n this.data = data;\r\n this.bone = bone;\r\n this.color = new spine.Color();\r\n this.darkColor = data.darkColor == null ? null : new spine.Color();\r\n this.setToSetupPose();\r\n }\r\n Slot.prototype.getSkeleton = function () {\r\n return this.bone.skeleton;\r\n };\r\n Slot.prototype.getAttachment = function () {\r\n return this.attachment;\r\n };\r\n Slot.prototype.setAttachment = function (attachment) {\r\n if (this.attachment == attachment)\r\n return;\r\n this.attachment = attachment;\r\n this.attachmentTime = this.bone.skeleton.time;\r\n this.deform.length = 0;\r\n };\r\n Slot.prototype.setAttachmentTime = function (time) {\r\n this.attachmentTime = this.bone.skeleton.time - time;\r\n };\r\n Slot.prototype.getAttachmentTime = function () {\r\n return this.bone.skeleton.time - this.attachmentTime;\r\n };\r\n Slot.prototype.setToSetupPose = function () {\r\n this.color.setFromColor(this.data.color);\r\n if (this.darkColor != null)\r\n this.darkColor.setFromColor(this.data.darkColor);\r\n if (this.data.attachmentName == null)\r\n this.attachment = null;\r\n else {\r\n this.attachment = null;\r\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\r\n }\r\n };\r\n return Slot;\r\n }());\r\n spine.Slot = Slot;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SlotData = (function () {\r\n function SlotData(index, name, boneData) {\r\n this.color = new spine.Color(1, 1, 1, 1);\r\n if (index < 0)\r\n throw new Error(\"index must be >= 0.\");\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n if (boneData == null)\r\n throw new Error(\"boneData cannot be null.\");\r\n this.index = index;\r\n this.name = name;\r\n this.boneData = boneData;\r\n }\r\n return SlotData;\r\n }());\r\n spine.SlotData = SlotData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Texture = (function () {\r\n function Texture(image) {\r\n this._image = image;\r\n }\r\n Texture.prototype.getImage = function () {\r\n return this._image;\r\n };\r\n Texture.filterFromString = function (text) {\r\n switch (text.toLowerCase()) {\r\n case \"nearest\": return TextureFilter.Nearest;\r\n case \"linear\": return TextureFilter.Linear;\r\n case \"mipmap\": return TextureFilter.MipMap;\r\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\r\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\r\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\r\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\r\n default: throw new Error(\"Unknown texture filter \" + text);\r\n }\r\n };\r\n Texture.wrapFromString = function (text) {\r\n switch (text.toLowerCase()) {\r\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\r\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\r\n case \"repeat\": return TextureWrap.Repeat;\r\n default: throw new Error(\"Unknown texture wrap \" + text);\r\n }\r\n };\r\n return Texture;\r\n }());\r\n spine.Texture = Texture;\r\n var TextureFilter;\r\n (function (TextureFilter) {\r\n TextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\r\n TextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\r\n TextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\r\n TextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\r\n TextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\r\n TextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\r\n TextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\";\r\n })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {}));\r\n var TextureWrap;\r\n (function (TextureWrap) {\r\n TextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\r\n TextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\r\n TextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\";\r\n })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {}));\r\n var TextureRegion = (function () {\r\n function TextureRegion() {\r\n this.u = 0;\r\n this.v = 0;\r\n this.u2 = 0;\r\n this.v2 = 0;\r\n this.width = 0;\r\n this.height = 0;\r\n this.rotate = false;\r\n this.offsetX = 0;\r\n this.offsetY = 0;\r\n this.originalWidth = 0;\r\n this.originalHeight = 0;\r\n }\r\n return TextureRegion;\r\n }());\r\n spine.TextureRegion = TextureRegion;\r\n var FakeTexture = (function (_super) {\r\n __extends(FakeTexture, _super);\r\n function FakeTexture() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n FakeTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n FakeTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n FakeTexture.prototype.dispose = function () { };\r\n return FakeTexture;\r\n }(Texture));\r\n spine.FakeTexture = FakeTexture;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var TextureAtlas = (function () {\r\n function TextureAtlas(atlasText, textureLoader) {\r\n this.pages = new Array();\r\n this.regions = new Array();\r\n this.load(atlasText, textureLoader);\r\n }\r\n TextureAtlas.prototype.load = function (atlasText, textureLoader) {\r\n if (textureLoader == null)\r\n throw new Error(\"textureLoader cannot be null.\");\r\n var reader = new TextureAtlasReader(atlasText);\r\n var tuple = new Array(4);\r\n var page = null;\r\n while (true) {\r\n var line = reader.readLine();\r\n if (line == null)\r\n break;\r\n line = line.trim();\r\n if (line.length == 0)\r\n page = null;\r\n else if (!page) {\r\n page = new TextureAtlasPage();\r\n page.name = line;\r\n if (reader.readTuple(tuple) == 2) {\r\n page.width = parseInt(tuple[0]);\r\n page.height = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n }\r\n reader.readTuple(tuple);\r\n page.minFilter = spine.Texture.filterFromString(tuple[0]);\r\n page.magFilter = spine.Texture.filterFromString(tuple[1]);\r\n var direction = reader.readValue();\r\n page.uWrap = spine.TextureWrap.ClampToEdge;\r\n page.vWrap = spine.TextureWrap.ClampToEdge;\r\n if (direction == \"x\")\r\n page.uWrap = spine.TextureWrap.Repeat;\r\n else if (direction == \"y\")\r\n page.vWrap = spine.TextureWrap.Repeat;\r\n else if (direction == \"xy\")\r\n page.uWrap = page.vWrap = spine.TextureWrap.Repeat;\r\n page.texture = textureLoader(line);\r\n page.texture.setFilters(page.minFilter, page.magFilter);\r\n page.texture.setWraps(page.uWrap, page.vWrap);\r\n page.width = page.texture.getImage().width;\r\n page.height = page.texture.getImage().height;\r\n this.pages.push(page);\r\n }\r\n else {\r\n var region = new TextureAtlasRegion();\r\n region.name = line;\r\n region.page = page;\r\n var rotateValue = reader.readValue();\r\n if (rotateValue.toLocaleLowerCase() == \"true\") {\r\n region.degrees = 90;\r\n }\r\n else if (rotateValue.toLocaleLowerCase() == \"false\") {\r\n region.degrees = 0;\r\n }\r\n else {\r\n region.degrees = parseFloat(rotateValue);\r\n }\r\n region.rotate = region.degrees == 90;\r\n reader.readTuple(tuple);\r\n var x = parseInt(tuple[0]);\r\n var y = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n var width = parseInt(tuple[0]);\r\n var height = parseInt(tuple[1]);\r\n region.u = x / page.width;\r\n region.v = y / page.height;\r\n if (region.rotate) {\r\n region.u2 = (x + height) / page.width;\r\n region.v2 = (y + width) / page.height;\r\n }\r\n else {\r\n region.u2 = (x + width) / page.width;\r\n region.v2 = (y + height) / page.height;\r\n }\r\n region.x = x;\r\n region.y = y;\r\n region.width = Math.abs(width);\r\n region.height = Math.abs(height);\r\n if (reader.readTuple(tuple) == 4) {\r\n if (reader.readTuple(tuple) == 4) {\r\n reader.readTuple(tuple);\r\n }\r\n }\r\n region.originalWidth = parseInt(tuple[0]);\r\n region.originalHeight = parseInt(tuple[1]);\r\n reader.readTuple(tuple);\r\n region.offsetX = parseInt(tuple[0]);\r\n region.offsetY = parseInt(tuple[1]);\r\n region.index = parseInt(reader.readValue());\r\n region.texture = page.texture;\r\n this.regions.push(region);\r\n }\r\n }\r\n };\r\n TextureAtlas.prototype.findRegion = function (name) {\r\n for (var i = 0; i < this.regions.length; i++) {\r\n if (this.regions[i].name == name) {\r\n return this.regions[i];\r\n }\r\n }\r\n return null;\r\n };\r\n TextureAtlas.prototype.dispose = function () {\r\n for (var i = 0; i < this.pages.length; i++) {\r\n this.pages[i].texture.dispose();\r\n }\r\n };\r\n return TextureAtlas;\r\n }());\r\n spine.TextureAtlas = TextureAtlas;\r\n var TextureAtlasReader = (function () {\r\n function TextureAtlasReader(text) {\r\n this.index = 0;\r\n this.lines = text.split(/\\r\\n|\\r|\\n/);\r\n }\r\n TextureAtlasReader.prototype.readLine = function () {\r\n if (this.index >= this.lines.length)\r\n return null;\r\n return this.lines[this.index++];\r\n };\r\n TextureAtlasReader.prototype.readValue = function () {\r\n var line = this.readLine();\r\n var colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n return line.substring(colon + 1).trim();\r\n };\r\n TextureAtlasReader.prototype.readTuple = function (tuple) {\r\n var line = this.readLine();\r\n var colon = line.indexOf(\":\");\r\n if (colon == -1)\r\n throw new Error(\"Invalid line: \" + line);\r\n var i = 0, lastMatch = colon + 1;\r\n for (; i < 3; i++) {\r\n var comma = line.indexOf(\",\", lastMatch);\r\n if (comma == -1)\r\n break;\r\n tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\r\n lastMatch = comma + 1;\r\n }\r\n tuple[i] = line.substring(lastMatch).trim();\r\n return i + 1;\r\n };\r\n return TextureAtlasReader;\r\n }());\r\n var TextureAtlasPage = (function () {\r\n function TextureAtlasPage() {\r\n }\r\n return TextureAtlasPage;\r\n }());\r\n spine.TextureAtlasPage = TextureAtlasPage;\r\n var TextureAtlasRegion = (function (_super) {\r\n __extends(TextureAtlasRegion, _super);\r\n function TextureAtlasRegion() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n return TextureAtlasRegion;\r\n }(spine.TextureRegion));\r\n spine.TextureAtlasRegion = TextureAtlasRegion;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var TransformConstraint = (function () {\r\n function TransformConstraint(data, skeleton) {\r\n this.rotateMix = 0;\r\n this.translateMix = 0;\r\n this.scaleMix = 0;\r\n this.shearMix = 0;\r\n this.temp = new spine.Vector2();\r\n this.active = false;\r\n if (data == null)\r\n throw new Error(\"data cannot be null.\");\r\n if (skeleton == null)\r\n throw new Error(\"skeleton cannot be null.\");\r\n this.data = data;\r\n this.rotateMix = data.rotateMix;\r\n this.translateMix = data.translateMix;\r\n this.scaleMix = data.scaleMix;\r\n this.shearMix = data.shearMix;\r\n this.bones = new Array();\r\n for (var i = 0; i < data.bones.length; i++)\r\n this.bones.push(skeleton.findBone(data.bones[i].name));\r\n this.target = skeleton.findBone(data.target.name);\r\n }\r\n TransformConstraint.prototype.isActive = function () {\r\n return this.active;\r\n };\r\n TransformConstraint.prototype.apply = function () {\r\n this.update();\r\n };\r\n TransformConstraint.prototype.update = function () {\r\n if (this.data.local) {\r\n if (this.data.relative)\r\n this.applyRelativeLocal();\r\n else\r\n this.applyAbsoluteLocal();\r\n }\r\n else {\r\n if (this.data.relative)\r\n this.applyRelativeWorld();\r\n else\r\n this.applyAbsoluteWorld();\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect;\r\n var offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n if (rotateMix != 0) {\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n bone.a = cos * a - sin * c;\r\n bone.b = cos * b - sin * d;\r\n bone.c = sin * a + cos * c;\r\n bone.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n bone.worldX += (temp.x - bone.worldX) * translateMix;\r\n bone.worldY += (temp.y - bone.worldY) * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\r\n var ts = Math.sqrt(ta * ta + tc * tc);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\r\n bone.a *= s;\r\n bone.c *= s;\r\n s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\r\n ts = Math.sqrt(tb * tb + td * td);\r\n if (s > 0.00001)\r\n s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\r\n bone.b *= s;\r\n bone.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var b = bone.b, d = bone.d;\r\n var by = Math.atan2(d, b);\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r = by + (r + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n bone.b = Math.cos(r) * s;\r\n bone.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeWorld = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n var ta = target.a, tb = target.b, tc = target.c, td = target.d;\r\n var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\r\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n var modified = false;\r\n if (rotateMix != 0) {\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n var r = Math.atan2(tc, ta) + offsetRotation;\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n r *= rotateMix;\r\n var cos = Math.cos(r), sin = Math.sin(r);\r\n bone.a = cos * a - sin * c;\r\n bone.b = cos * b - sin * d;\r\n bone.c = sin * a + cos * c;\r\n bone.d = sin * b + cos * d;\r\n modified = true;\r\n }\r\n if (translateMix != 0) {\r\n var temp = this.temp;\r\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\r\n bone.worldX += temp.x * translateMix;\r\n bone.worldY += temp.y * translateMix;\r\n modified = true;\r\n }\r\n if (scaleMix > 0) {\r\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\r\n bone.a *= s;\r\n bone.c *= s;\r\n s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\r\n bone.b *= s;\r\n bone.d *= s;\r\n modified = true;\r\n }\r\n if (shearMix > 0) {\r\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\r\n if (r > spine.MathUtils.PI)\r\n r -= spine.MathUtils.PI2;\r\n else if (r < -spine.MathUtils.PI)\r\n r += spine.MathUtils.PI2;\r\n var b = bone.b, d = bone.d;\r\n r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;\r\n var s = Math.sqrt(b * b + d * d);\r\n bone.b = Math.cos(r) * s;\r\n bone.d = Math.sin(r) * s;\r\n modified = true;\r\n }\r\n if (modified)\r\n bone.appliedValid = false;\r\n }\r\n };\r\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0) {\r\n var r = target.arotation - rotation + this.data.offsetRotation;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n rotation += r * rotateMix;\r\n }\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax - x + this.data.offsetX) * translateMix;\r\n y += (target.ay - y + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix != 0) {\r\n if (scaleX > 0.00001)\r\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\r\n if (scaleY > 0.00001)\r\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix != 0) {\r\n var r = target.ashearY - shearY + this.data.offsetShearY;\r\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\r\n bone.shearY += r * shearMix;\r\n }\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n TransformConstraint.prototype.applyRelativeLocal = function () {\r\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\r\n var target = this.target;\r\n if (!target.appliedValid)\r\n target.updateAppliedTransform();\r\n var bones = this.bones;\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (!bone.appliedValid)\r\n bone.updateAppliedTransform();\r\n var rotation = bone.arotation;\r\n if (rotateMix != 0)\r\n rotation += (target.arotation + this.data.offsetRotation) * rotateMix;\r\n var x = bone.ax, y = bone.ay;\r\n if (translateMix != 0) {\r\n x += (target.ax + this.data.offsetX) * translateMix;\r\n y += (target.ay + this.data.offsetY) * translateMix;\r\n }\r\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\r\n if (scaleMix != 0) {\r\n if (scaleX > 0.00001)\r\n scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\r\n if (scaleY > 0.00001)\r\n scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\r\n }\r\n var shearY = bone.ashearY;\r\n if (shearMix != 0)\r\n shearY += (target.ashearY + this.data.offsetShearY) * shearMix;\r\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\r\n }\r\n };\r\n return TransformConstraint;\r\n }());\r\n spine.TransformConstraint = TransformConstraint;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var TransformConstraintData = (function (_super) {\r\n __extends(TransformConstraintData, _super);\r\n function TransformConstraintData(name) {\r\n var _this = _super.call(this, name, 0, false) || this;\r\n _this.bones = new Array();\r\n _this.rotateMix = 0;\r\n _this.translateMix = 0;\r\n _this.scaleMix = 0;\r\n _this.shearMix = 0;\r\n _this.offsetRotation = 0;\r\n _this.offsetX = 0;\r\n _this.offsetY = 0;\r\n _this.offsetScaleX = 0;\r\n _this.offsetScaleY = 0;\r\n _this.offsetShearY = 0;\r\n _this.relative = false;\r\n _this.local = false;\r\n return _this;\r\n }\r\n return TransformConstraintData;\r\n }(spine.ConstraintData));\r\n spine.TransformConstraintData = TransformConstraintData;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var Triangulator = (function () {\r\n function Triangulator() {\r\n this.convexPolygons = new Array();\r\n this.convexPolygonsIndices = new Array();\r\n this.indicesArray = new Array();\r\n this.isConcaveArray = new Array();\r\n this.triangles = new Array();\r\n this.polygonPool = new spine.Pool(function () {\r\n return new Array();\r\n });\r\n this.polygonIndicesPool = new spine.Pool(function () {\r\n return new Array();\r\n });\r\n }\r\n Triangulator.prototype.triangulate = function (verticesArray) {\r\n var vertices = verticesArray;\r\n var vertexCount = verticesArray.length >> 1;\r\n var indices = this.indicesArray;\r\n indices.length = 0;\r\n for (var i = 0; i < vertexCount; i++)\r\n indices[i] = i;\r\n var isConcave = this.isConcaveArray;\r\n isConcave.length = 0;\r\n for (var i = 0, n = vertexCount; i < n; ++i)\r\n isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\r\n var triangles = this.triangles;\r\n triangles.length = 0;\r\n while (vertexCount > 3) {\r\n var previous = vertexCount - 1, i = 0, next = 1;\r\n while (true) {\r\n outer: if (!isConcave[i]) {\r\n var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\r\n var p1x = vertices[p1], p1y = vertices[p1 + 1];\r\n var p2x = vertices[p2], p2y = vertices[p2 + 1];\r\n var p3x = vertices[p3], p3y = vertices[p3 + 1];\r\n for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\r\n if (!isConcave[ii])\r\n continue;\r\n var v = indices[ii] << 1;\r\n var vx = vertices[v], vy = vertices[v + 1];\r\n if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\r\n if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\r\n if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))\r\n break outer;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n if (next == 0) {\r\n do {\r\n if (!isConcave[i])\r\n break;\r\n i--;\r\n } while (i > 0);\r\n break;\r\n }\r\n previous = i;\r\n i = next;\r\n next = (next + 1) % vertexCount;\r\n }\r\n triangles.push(indices[(vertexCount + i - 1) % vertexCount]);\r\n triangles.push(indices[i]);\r\n triangles.push(indices[(i + 1) % vertexCount]);\r\n indices.splice(i, 1);\r\n isConcave.splice(i, 1);\r\n vertexCount--;\r\n var previousIndex = (vertexCount + i - 1) % vertexCount;\r\n var nextIndex = i == vertexCount ? 0 : i;\r\n isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\r\n isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\r\n }\r\n if (vertexCount == 3) {\r\n triangles.push(indices[2]);\r\n triangles.push(indices[0]);\r\n triangles.push(indices[1]);\r\n }\r\n return triangles;\r\n };\r\n Triangulator.prototype.decompose = function (verticesArray, triangles) {\r\n var vertices = verticesArray;\r\n var convexPolygons = this.convexPolygons;\r\n this.polygonPool.freeAll(convexPolygons);\r\n convexPolygons.length = 0;\r\n var convexPolygonsIndices = this.convexPolygonsIndices;\r\n this.polygonIndicesPool.freeAll(convexPolygonsIndices);\r\n convexPolygonsIndices.length = 0;\r\n var polygonIndices = this.polygonIndicesPool.obtain();\r\n polygonIndices.length = 0;\r\n var polygon = this.polygonPool.obtain();\r\n polygon.length = 0;\r\n var fanBaseIndex = -1, lastWinding = 0;\r\n for (var i = 0, n = triangles.length; i < n; i += 3) {\r\n var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\r\n var x1 = vertices[t1], y1 = vertices[t1 + 1];\r\n var x2 = vertices[t2], y2 = vertices[t2 + 1];\r\n var x3 = vertices[t3], y3 = vertices[t3 + 1];\r\n var merged = false;\r\n if (fanBaseIndex == t1) {\r\n var o = polygon.length - 4;\r\n var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\r\n var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\r\n if (winding1 == lastWinding && winding2 == lastWinding) {\r\n polygon.push(x3);\r\n polygon.push(y3);\r\n polygonIndices.push(t3);\r\n merged = true;\r\n }\r\n }\r\n if (!merged) {\r\n if (polygon.length > 0) {\r\n convexPolygons.push(polygon);\r\n convexPolygonsIndices.push(polygonIndices);\r\n }\r\n else {\r\n this.polygonPool.free(polygon);\r\n this.polygonIndicesPool.free(polygonIndices);\r\n }\r\n polygon = this.polygonPool.obtain();\r\n polygon.length = 0;\r\n polygon.push(x1);\r\n polygon.push(y1);\r\n polygon.push(x2);\r\n polygon.push(y2);\r\n polygon.push(x3);\r\n polygon.push(y3);\r\n polygonIndices = this.polygonIndicesPool.obtain();\r\n polygonIndices.length = 0;\r\n polygonIndices.push(t1);\r\n polygonIndices.push(t2);\r\n polygonIndices.push(t3);\r\n lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\r\n fanBaseIndex = t1;\r\n }\r\n }\r\n if (polygon.length > 0) {\r\n convexPolygons.push(polygon);\r\n convexPolygonsIndices.push(polygonIndices);\r\n }\r\n for (var i = 0, n = convexPolygons.length; i < n; i++) {\r\n polygonIndices = convexPolygonsIndices[i];\r\n if (polygonIndices.length == 0)\r\n continue;\r\n var firstIndex = polygonIndices[0];\r\n var lastIndex = polygonIndices[polygonIndices.length - 1];\r\n polygon = convexPolygons[i];\r\n var o = polygon.length - 4;\r\n var prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\r\n var prevX = polygon[o + 2], prevY = polygon[o + 3];\r\n var firstX = polygon[0], firstY = polygon[1];\r\n var secondX = polygon[2], secondY = polygon[3];\r\n var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\r\n for (var ii = 0; ii < n; ii++) {\r\n if (ii == i)\r\n continue;\r\n var otherIndices = convexPolygonsIndices[ii];\r\n if (otherIndices.length != 3)\r\n continue;\r\n var otherFirstIndex = otherIndices[0];\r\n var otherSecondIndex = otherIndices[1];\r\n var otherLastIndex = otherIndices[2];\r\n var otherPoly = convexPolygons[ii];\r\n var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\r\n if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)\r\n continue;\r\n var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\r\n var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\r\n if (winding1 == winding && winding2 == winding) {\r\n otherPoly.length = 0;\r\n otherIndices.length = 0;\r\n polygon.push(x3);\r\n polygon.push(y3);\r\n polygonIndices.push(otherLastIndex);\r\n prevPrevX = prevX;\r\n prevPrevY = prevY;\r\n prevX = x3;\r\n prevY = y3;\r\n ii = 0;\r\n }\r\n }\r\n }\r\n for (var i = convexPolygons.length - 1; i >= 0; i--) {\r\n polygon = convexPolygons[i];\r\n if (polygon.length == 0) {\r\n convexPolygons.splice(i, 1);\r\n this.polygonPool.free(polygon);\r\n polygonIndices = convexPolygonsIndices[i];\r\n convexPolygonsIndices.splice(i, 1);\r\n this.polygonIndicesPool.free(polygonIndices);\r\n }\r\n }\r\n return convexPolygons;\r\n };\r\n Triangulator.isConcave = function (index, vertexCount, vertices, indices) {\r\n var previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\r\n var current = indices[index] << 1;\r\n var next = indices[(index + 1) % vertexCount] << 1;\r\n return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);\r\n };\r\n Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\r\n };\r\n Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {\r\n var px = p2x - p1x, py = p2y - p1y;\r\n return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\r\n };\r\n return Triangulator;\r\n }());\r\n spine.Triangulator = Triangulator;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var IntSet = (function () {\r\n function IntSet() {\r\n this.array = new Array();\r\n }\r\n IntSet.prototype.add = function (value) {\r\n var contains = this.contains(value);\r\n this.array[value | 0] = value | 0;\r\n return !contains;\r\n };\r\n IntSet.prototype.contains = function (value) {\r\n return this.array[value | 0] != undefined;\r\n };\r\n IntSet.prototype.remove = function (value) {\r\n this.array[value | 0] = undefined;\r\n };\r\n IntSet.prototype.clear = function () {\r\n this.array.length = 0;\r\n };\r\n return IntSet;\r\n }());\r\n spine.IntSet = IntSet;\r\n var Color = (function () {\r\n function Color(r, g, b, a) {\r\n if (r === void 0) { r = 0; }\r\n if (g === void 0) { g = 0; }\r\n if (b === void 0) { b = 0; }\r\n if (a === void 0) { a = 0; }\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n }\r\n Color.prototype.set = function (r, g, b, a) {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n this.clamp();\r\n return this;\r\n };\r\n Color.prototype.setFromColor = function (c) {\r\n this.r = c.r;\r\n this.g = c.g;\r\n this.b = c.b;\r\n this.a = c.a;\r\n return this;\r\n };\r\n Color.prototype.setFromString = function (hex) {\r\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\r\n this.r = parseInt(hex.substr(0, 2), 16) / 255.0;\r\n this.g = parseInt(hex.substr(2, 2), 16) / 255.0;\r\n this.b = parseInt(hex.substr(4, 2), 16) / 255.0;\r\n this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\r\n return this;\r\n };\r\n Color.prototype.add = function (r, g, b, a) {\r\n this.r += r;\r\n this.g += g;\r\n this.b += b;\r\n this.a += a;\r\n this.clamp();\r\n return this;\r\n };\r\n Color.prototype.clamp = function () {\r\n if (this.r < 0)\r\n this.r = 0;\r\n else if (this.r > 1)\r\n this.r = 1;\r\n if (this.g < 0)\r\n this.g = 0;\r\n else if (this.g > 1)\r\n this.g = 1;\r\n if (this.b < 0)\r\n this.b = 0;\r\n else if (this.b > 1)\r\n this.b = 1;\r\n if (this.a < 0)\r\n this.a = 0;\r\n else if (this.a > 1)\r\n this.a = 1;\r\n return this;\r\n };\r\n Color.rgba8888ToColor = function (color, value) {\r\n color.r = ((value & 0xff000000) >>> 24) / 255;\r\n color.g = ((value & 0x00ff0000) >>> 16) / 255;\r\n color.b = ((value & 0x0000ff00) >>> 8) / 255;\r\n color.a = ((value & 0x000000ff)) / 255;\r\n };\r\n Color.rgb888ToColor = function (color, value) {\r\n color.r = ((value & 0x00ff0000) >>> 16) / 255;\r\n color.g = ((value & 0x0000ff00) >>> 8) / 255;\r\n color.b = ((value & 0x000000ff)) / 255;\r\n };\r\n Color.WHITE = new Color(1, 1, 1, 1);\r\n Color.RED = new Color(1, 0, 0, 1);\r\n Color.GREEN = new Color(0, 1, 0, 1);\r\n Color.BLUE = new Color(0, 0, 1, 1);\r\n Color.MAGENTA = new Color(1, 0, 1, 1);\r\n return Color;\r\n }());\r\n spine.Color = Color;\r\n var MathUtils = (function () {\r\n function MathUtils() {\r\n }\r\n MathUtils.clamp = function (value, min, max) {\r\n if (value < min)\r\n return min;\r\n if (value > max)\r\n return max;\r\n return value;\r\n };\r\n MathUtils.cosDeg = function (degrees) {\r\n return Math.cos(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.sinDeg = function (degrees) {\r\n return Math.sin(degrees * MathUtils.degRad);\r\n };\r\n MathUtils.signum = function (value) {\r\n return value > 0 ? 1 : value < 0 ? -1 : 0;\r\n };\r\n MathUtils.toInt = function (x) {\r\n return x > 0 ? Math.floor(x) : Math.ceil(x);\r\n };\r\n MathUtils.cbrt = function (x) {\r\n var y = Math.pow(Math.abs(x), 1 / 3);\r\n return x < 0 ? -y : y;\r\n };\r\n MathUtils.randomTriangular = function (min, max) {\r\n return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\r\n };\r\n MathUtils.randomTriangularWith = function (min, max, mode) {\r\n var u = Math.random();\r\n var d = max - min;\r\n if (u <= (mode - min) / d)\r\n return min + Math.sqrt(u * d * (mode - min));\r\n return max - Math.sqrt((1 - u) * d * (max - mode));\r\n };\r\n MathUtils.PI = 3.1415927;\r\n MathUtils.PI2 = MathUtils.PI * 2;\r\n MathUtils.radiansToDegrees = 180 / MathUtils.PI;\r\n MathUtils.radDeg = MathUtils.radiansToDegrees;\r\n MathUtils.degreesToRadians = MathUtils.PI / 180;\r\n MathUtils.degRad = MathUtils.degreesToRadians;\r\n return MathUtils;\r\n }());\r\n spine.MathUtils = MathUtils;\r\n var Interpolation = (function () {\r\n function Interpolation() {\r\n }\r\n Interpolation.prototype.apply = function (start, end, a) {\r\n return start + (end - start) * this.applyInternal(a);\r\n };\r\n return Interpolation;\r\n }());\r\n spine.Interpolation = Interpolation;\r\n var Pow = (function (_super) {\r\n __extends(Pow, _super);\r\n function Pow(power) {\r\n var _this = _super.call(this) || this;\r\n _this.power = 2;\r\n _this.power = power;\r\n return _this;\r\n }\r\n Pow.prototype.applyInternal = function (a) {\r\n if (a <= 0.5)\r\n return Math.pow(a * 2, this.power) / 2;\r\n return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\r\n };\r\n return Pow;\r\n }(Interpolation));\r\n spine.Pow = Pow;\r\n var PowOut = (function (_super) {\r\n __extends(PowOut, _super);\r\n function PowOut(power) {\r\n return _super.call(this, power) || this;\r\n }\r\n PowOut.prototype.applyInternal = function (a) {\r\n return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\r\n };\r\n return PowOut;\r\n }(Pow));\r\n spine.PowOut = PowOut;\r\n var Utils = (function () {\r\n function Utils() {\r\n }\r\n Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\r\n for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\r\n dest[j] = source[i];\r\n }\r\n };\r\n Utils.setArraySize = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n var oldSize = array.length;\r\n if (oldSize == size)\r\n return array;\r\n array.length = size;\r\n if (oldSize < size) {\r\n for (var i = oldSize; i < size; i++)\r\n array[i] = value;\r\n }\r\n return array;\r\n };\r\n Utils.ensureArrayCapacity = function (array, size, value) {\r\n if (value === void 0) { value = 0; }\r\n if (array.length >= size)\r\n return array;\r\n return Utils.setArraySize(array, size, value);\r\n };\r\n Utils.newArray = function (size, defaultValue) {\r\n var array = new Array(size);\r\n for (var i = 0; i < size; i++)\r\n array[i] = defaultValue;\r\n return array;\r\n };\r\n Utils.newFloatArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n return new Float32Array(size);\r\n }\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.newShortArray = function (size) {\r\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\r\n return new Int16Array(size);\r\n }\r\n else {\r\n var array = new Array(size);\r\n for (var i = 0; i < array.length; i++)\r\n array[i] = 0;\r\n return array;\r\n }\r\n };\r\n Utils.toFloatArray = function (array) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\r\n };\r\n Utils.toSinglePrecision = function (value) {\r\n return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\r\n };\r\n Utils.webkit602BugfixHelper = function (alpha, blend) {\r\n };\r\n Utils.contains = function (array, element, identity) {\r\n if (identity === void 0) { identity = true; }\r\n for (var i = 0; i < array.length; i++) {\r\n if (array[i] == element)\r\n return true;\r\n }\r\n return false;\r\n };\r\n Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\r\n return Utils;\r\n }());\r\n spine.Utils = Utils;\r\n var DebugUtils = (function () {\r\n function DebugUtils() {\r\n }\r\n DebugUtils.logBones = function (skeleton) {\r\n for (var i = 0; i < skeleton.bones.length; i++) {\r\n var bone = skeleton.bones[i];\r\n console.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\r\n }\r\n };\r\n return DebugUtils;\r\n }());\r\n spine.DebugUtils = DebugUtils;\r\n var Pool = (function () {\r\n function Pool(instantiator) {\r\n this.items = new Array();\r\n this.instantiator = instantiator;\r\n }\r\n Pool.prototype.obtain = function () {\r\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\r\n };\r\n Pool.prototype.free = function (item) {\r\n if (item.reset)\r\n item.reset();\r\n this.items.push(item);\r\n };\r\n Pool.prototype.freeAll = function (items) {\r\n for (var i = 0; i < items.length; i++) {\r\n this.free(items[i]);\r\n }\r\n };\r\n Pool.prototype.clear = function () {\r\n this.items.length = 0;\r\n };\r\n return Pool;\r\n }());\r\n spine.Pool = Pool;\r\n var Vector2 = (function () {\r\n function Vector2(x, y) {\r\n if (x === void 0) { x = 0; }\r\n if (y === void 0) { y = 0; }\r\n this.x = x;\r\n this.y = y;\r\n }\r\n Vector2.prototype.set = function (x, y) {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n };\r\n Vector2.prototype.length = function () {\r\n var x = this.x;\r\n var y = this.y;\r\n return Math.sqrt(x * x + y * y);\r\n };\r\n Vector2.prototype.normalize = function () {\r\n var len = this.length();\r\n if (len != 0) {\r\n this.x /= len;\r\n this.y /= len;\r\n }\r\n return this;\r\n };\r\n return Vector2;\r\n }());\r\n spine.Vector2 = Vector2;\r\n var TimeKeeper = (function () {\r\n function TimeKeeper() {\r\n this.maxDelta = 0.064;\r\n this.framesPerSecond = 0;\r\n this.delta = 0;\r\n this.totalTime = 0;\r\n this.lastTime = Date.now() / 1000;\r\n this.frameCount = 0;\r\n this.frameTime = 0;\r\n }\r\n TimeKeeper.prototype.update = function () {\r\n var now = Date.now() / 1000;\r\n this.delta = now - this.lastTime;\r\n this.frameTime += this.delta;\r\n this.totalTime += this.delta;\r\n if (this.delta > this.maxDelta)\r\n this.delta = this.maxDelta;\r\n this.lastTime = now;\r\n this.frameCount++;\r\n if (this.frameTime > 1) {\r\n this.framesPerSecond = this.frameCount / this.frameTime;\r\n this.frameTime = 0;\r\n this.frameCount = 0;\r\n }\r\n };\r\n return TimeKeeper;\r\n }());\r\n spine.TimeKeeper = TimeKeeper;\r\n var WindowedMean = (function () {\r\n function WindowedMean(windowSize) {\r\n if (windowSize === void 0) { windowSize = 32; }\r\n this.addedValues = 0;\r\n this.lastValue = 0;\r\n this.mean = 0;\r\n this.dirty = true;\r\n this.values = new Array(windowSize);\r\n }\r\n WindowedMean.prototype.hasEnoughData = function () {\r\n return this.addedValues >= this.values.length;\r\n };\r\n WindowedMean.prototype.addValue = function (value) {\r\n if (this.addedValues < this.values.length)\r\n this.addedValues++;\r\n this.values[this.lastValue++] = value;\r\n if (this.lastValue > this.values.length - 1)\r\n this.lastValue = 0;\r\n this.dirty = true;\r\n };\r\n WindowedMean.prototype.getMean = function () {\r\n if (this.hasEnoughData()) {\r\n if (this.dirty) {\r\n var mean = 0;\r\n for (var i = 0; i < this.values.length; i++) {\r\n mean += this.values[i];\r\n }\r\n this.mean = mean / this.values.length;\r\n this.dirty = false;\r\n }\r\n return this.mean;\r\n }\r\n else {\r\n return 0;\r\n }\r\n };\r\n return WindowedMean;\r\n }());\r\n spine.WindowedMean = WindowedMean;\r\n})(spine || (spine = {}));\r\n(function () {\r\n if (!Math.fround) {\r\n Math.fround = (function (array) {\r\n return function (x) {\r\n return array[0] = x, array[0];\r\n };\r\n })(new Float32Array(1));\r\n }\r\n})();\r\nvar spine;\r\n(function (spine) {\r\n var Attachment = (function () {\r\n function Attachment(name) {\r\n if (name == null)\r\n throw new Error(\"name cannot be null.\");\r\n this.name = name;\r\n }\r\n return Attachment;\r\n }());\r\n spine.Attachment = Attachment;\r\n var VertexAttachment = (function (_super) {\r\n __extends(VertexAttachment, _super);\r\n function VertexAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.id = (VertexAttachment.nextID++ & 65535) << 11;\r\n _this.worldVerticesLength = 0;\r\n _this.deformAttachment = _this;\r\n return _this;\r\n }\r\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\r\n count = offset + (count >> 1) * stride;\r\n var skeleton = slot.bone.skeleton;\r\n var deformArray = slot.deform;\r\n var vertices = this.vertices;\r\n var bones = this.bones;\r\n if (bones == null) {\r\n if (deformArray.length > 0)\r\n vertices = deformArray;\r\n var bone = slot.bone;\r\n var x = bone.worldX;\r\n var y = bone.worldY;\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\r\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\r\n worldVertices[w] = vx * a + vy * b + x;\r\n worldVertices[w + 1] = vx * c + vy * d + y;\r\n }\r\n return;\r\n }\r\n var v = 0, skip = 0;\r\n for (var i = 0; i < start; i += 2) {\r\n var n = bones[v];\r\n v += n + 1;\r\n skip += n;\r\n }\r\n var skeletonBones = skeleton.bones;\r\n if (deformArray.length == 0) {\r\n for (var w = offset, b = skip * 3; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3) {\r\n var bone = skeletonBones[bones[v]];\r\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\r\n wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n else {\r\n var deform = deformArray;\r\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\r\n var wx = 0, wy = 0;\r\n var n = bones[v++];\r\n n += v;\r\n for (; v < n; v++, b += 3, f += 2) {\r\n var bone = skeletonBones[bones[v]];\r\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\r\n wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\r\n wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\r\n }\r\n worldVertices[w] = wx;\r\n worldVertices[w + 1] = wy;\r\n }\r\n }\r\n };\r\n VertexAttachment.prototype.copyTo = function (attachment) {\r\n if (this.bones != null) {\r\n attachment.bones = new Array(this.bones.length);\r\n spine.Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\r\n }\r\n else\r\n attachment.bones = null;\r\n if (this.vertices != null) {\r\n attachment.vertices = spine.Utils.newFloatArray(this.vertices.length);\r\n spine.Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\r\n }\r\n else\r\n attachment.vertices = null;\r\n attachment.worldVerticesLength = this.worldVerticesLength;\r\n attachment.deformAttachment = this.deformAttachment;\r\n };\r\n VertexAttachment.nextID = 0;\r\n return VertexAttachment;\r\n }(Attachment));\r\n spine.VertexAttachment = VertexAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var AttachmentType;\r\n (function (AttachmentType) {\r\n AttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\r\n AttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\r\n AttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\r\n AttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\r\n AttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\r\n AttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\r\n AttachmentType[AttachmentType[\"Clipping\"] = 6] = \"Clipping\";\r\n })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var BoundingBoxAttachment = (function (_super) {\r\n __extends(BoundingBoxAttachment, _super);\r\n function BoundingBoxAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n BoundingBoxAttachment.prototype.copy = function () {\r\n var copy = new BoundingBoxAttachment(name);\r\n this.copyTo(copy);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return BoundingBoxAttachment;\r\n }(spine.VertexAttachment));\r\n spine.BoundingBoxAttachment = BoundingBoxAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var ClippingAttachment = (function (_super) {\r\n __extends(ClippingAttachment, _super);\r\n function ClippingAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);\r\n return _this;\r\n }\r\n ClippingAttachment.prototype.copy = function () {\r\n var copy = new ClippingAttachment(name);\r\n this.copyTo(copy);\r\n copy.endSlot = this.endSlot;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return ClippingAttachment;\r\n }(spine.VertexAttachment));\r\n spine.ClippingAttachment = ClippingAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var MeshAttachment = (function (_super) {\r\n __extends(MeshAttachment, _super);\r\n function MeshAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n _this.tempColor = new spine.Color(0, 0, 0, 0);\r\n return _this;\r\n }\r\n MeshAttachment.prototype.updateUVs = function () {\r\n var regionUVs = this.regionUVs;\r\n if (this.uvs == null || this.uvs.length != regionUVs.length)\r\n this.uvs = spine.Utils.newFloatArray(regionUVs.length);\r\n var uvs = this.uvs;\r\n var n = this.uvs.length;\r\n var u = this.region.u, v = this.region.v, width = 0, height = 0;\r\n if (this.region instanceof spine.TextureAtlasRegion) {\r\n var region = this.region;\r\n var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;\r\n switch (region.degrees) {\r\n case 90:\r\n u -= (region.originalHeight - region.offsetY - region.height) / textureWidth;\r\n v -= (region.originalWidth - region.offsetX - region.width) / textureHeight;\r\n width = region.originalHeight / textureWidth;\r\n height = region.originalWidth / textureHeight;\r\n for (var i = 0; i < n; i += 2) {\r\n uvs[i] = u + regionUVs[i + 1] * width;\r\n uvs[i + 1] = v + (1 - regionUVs[i]) * height;\r\n }\r\n return;\r\n case 180:\r\n u -= (region.originalWidth - region.offsetX - region.width) / textureWidth;\r\n v -= region.offsetY / textureHeight;\r\n width = region.originalWidth / textureWidth;\r\n height = region.originalHeight / textureHeight;\r\n for (var i = 0; i < n; i += 2) {\r\n uvs[i] = u + (1 - regionUVs[i]) * width;\r\n uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;\r\n }\r\n return;\r\n case 270:\r\n u -= region.offsetY / textureWidth;\r\n v -= region.offsetX / textureHeight;\r\n width = region.originalHeight / textureWidth;\r\n height = region.originalWidth / textureHeight;\r\n for (var i = 0; i < n; i += 2) {\r\n uvs[i] = u + (1 - regionUVs[i + 1]) * width;\r\n uvs[i + 1] = v + regionUVs[i] * height;\r\n }\r\n return;\r\n }\r\n u -= region.offsetX / textureWidth;\r\n v -= (region.originalHeight - region.offsetY - region.height) / textureHeight;\r\n width = region.originalWidth / textureWidth;\r\n height = region.originalHeight / textureHeight;\r\n }\r\n else if (this.region == null) {\r\n u = v = 0;\r\n width = height = 1;\r\n }\r\n else {\r\n width = this.region.u2 - u;\r\n height = this.region.v2 - v;\r\n }\r\n for (var i = 0; i < n; i += 2) {\r\n uvs[i] = u + regionUVs[i] * width;\r\n uvs[i + 1] = v + regionUVs[i + 1] * height;\r\n }\r\n };\r\n MeshAttachment.prototype.getParentMesh = function () {\r\n return this.parentMesh;\r\n };\r\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\r\n this.parentMesh = parentMesh;\r\n if (parentMesh != null) {\r\n this.bones = parentMesh.bones;\r\n this.vertices = parentMesh.vertices;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n this.regionUVs = parentMesh.regionUVs;\r\n this.triangles = parentMesh.triangles;\r\n this.hullLength = parentMesh.hullLength;\r\n this.worldVerticesLength = parentMesh.worldVerticesLength;\r\n }\r\n };\r\n MeshAttachment.prototype.copy = function () {\r\n if (this.parentMesh != null)\r\n return this.newLinkedMesh();\r\n var copy = new MeshAttachment(this.name);\r\n copy.region = this.region;\r\n copy.path = this.path;\r\n copy.color.setFromColor(this.color);\r\n this.copyTo(copy);\r\n copy.regionUVs = new Array(this.regionUVs.length);\r\n spine.Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\r\n copy.uvs = new Array(this.uvs.length);\r\n spine.Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);\r\n copy.triangles = new Array(this.triangles.length);\r\n spine.Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\r\n copy.hullLength = this.hullLength;\r\n if (this.edges != null) {\r\n copy.edges = new Array(this.edges.length);\r\n spine.Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\r\n }\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n return copy;\r\n };\r\n MeshAttachment.prototype.newLinkedMesh = function () {\r\n var copy = new MeshAttachment(this.name);\r\n copy.region = this.region;\r\n copy.path = this.path;\r\n copy.color.setFromColor(this.color);\r\n copy.deformAttachment = this.deformAttachment;\r\n copy.setParentMesh(this.parentMesh != null ? this.parentMesh : this);\r\n copy.updateUVs();\r\n return copy;\r\n };\r\n return MeshAttachment;\r\n }(spine.VertexAttachment));\r\n spine.MeshAttachment = MeshAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PathAttachment = (function (_super) {\r\n __extends(PathAttachment, _super);\r\n function PathAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.closed = false;\r\n _this.constantSpeed = false;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n PathAttachment.prototype.copy = function () {\r\n var copy = new PathAttachment(name);\r\n this.copyTo(copy);\r\n copy.lengths = new Array(this.lengths.length);\r\n spine.Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\r\n copy.closed = closed;\r\n copy.constantSpeed = this.constantSpeed;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PathAttachment;\r\n }(spine.VertexAttachment));\r\n spine.PathAttachment = PathAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var PointAttachment = (function (_super) {\r\n __extends(PointAttachment, _super);\r\n function PointAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.color = new spine.Color(0.38, 0.94, 0, 1);\r\n return _this;\r\n }\r\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\r\n point.x = this.x * bone.a + this.y * bone.b + bone.worldX;\r\n point.y = this.x * bone.c + this.y * bone.d + bone.worldY;\r\n return point;\r\n };\r\n PointAttachment.prototype.computeWorldRotation = function (bone) {\r\n var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);\r\n var x = cos * bone.a + sin * bone.b;\r\n var y = cos * bone.c + sin * bone.d;\r\n return Math.atan2(y, x) * spine.MathUtils.radDeg;\r\n };\r\n PointAttachment.prototype.copy = function () {\r\n var copy = new PointAttachment(name);\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.rotation = this.rotation;\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n return PointAttachment;\r\n }(spine.VertexAttachment));\r\n spine.PointAttachment = PointAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var RegionAttachment = (function (_super) {\r\n __extends(RegionAttachment, _super);\r\n function RegionAttachment(name) {\r\n var _this = _super.call(this, name) || this;\r\n _this.x = 0;\r\n _this.y = 0;\r\n _this.scaleX = 1;\r\n _this.scaleY = 1;\r\n _this.rotation = 0;\r\n _this.width = 0;\r\n _this.height = 0;\r\n _this.color = new spine.Color(1, 1, 1, 1);\r\n _this.offset = spine.Utils.newFloatArray(8);\r\n _this.uvs = spine.Utils.newFloatArray(8);\r\n _this.tempColor = new spine.Color(1, 1, 1, 1);\r\n return _this;\r\n }\r\n RegionAttachment.prototype.updateOffset = function () {\r\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\r\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\r\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\r\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\r\n var localX2 = localX + this.region.width * regionScaleX;\r\n var localY2 = localY + this.region.height * regionScaleY;\r\n var radians = this.rotation * Math.PI / 180;\r\n var cos = Math.cos(radians);\r\n var sin = Math.sin(radians);\r\n var localXCos = localX * cos + this.x;\r\n var localXSin = localX * sin;\r\n var localYCos = localY * cos + this.y;\r\n var localYSin = localY * sin;\r\n var localX2Cos = localX2 * cos + this.x;\r\n var localX2Sin = localX2 * sin;\r\n var localY2Cos = localY2 * cos + this.y;\r\n var localY2Sin = localY2 * sin;\r\n var offset = this.offset;\r\n offset[RegionAttachment.OX1] = localXCos - localYSin;\r\n offset[RegionAttachment.OY1] = localYCos + localXSin;\r\n offset[RegionAttachment.OX2] = localXCos - localY2Sin;\r\n offset[RegionAttachment.OY2] = localY2Cos + localXSin;\r\n offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\r\n offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\r\n offset[RegionAttachment.OX4] = localX2Cos - localYSin;\r\n offset[RegionAttachment.OY4] = localYCos + localX2Sin;\r\n };\r\n RegionAttachment.prototype.setRegion = function (region) {\r\n this.region = region;\r\n var uvs = this.uvs;\r\n if (region.rotate) {\r\n uvs[2] = region.u;\r\n uvs[3] = region.v2;\r\n uvs[4] = region.u;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v;\r\n uvs[0] = region.u2;\r\n uvs[1] = region.v2;\r\n }\r\n else {\r\n uvs[0] = region.u;\r\n uvs[1] = region.v2;\r\n uvs[2] = region.u;\r\n uvs[3] = region.v;\r\n uvs[4] = region.u2;\r\n uvs[5] = region.v;\r\n uvs[6] = region.u2;\r\n uvs[7] = region.v2;\r\n }\r\n };\r\n RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\r\n var vertexOffset = this.offset;\r\n var x = bone.worldX, y = bone.worldY;\r\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\r\n var offsetX = 0, offsetY = 0;\r\n offsetX = vertexOffset[RegionAttachment.OX1];\r\n offsetY = vertexOffset[RegionAttachment.OY1];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX2];\r\n offsetY = vertexOffset[RegionAttachment.OY2];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX3];\r\n offsetY = vertexOffset[RegionAttachment.OY3];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n offset += stride;\r\n offsetX = vertexOffset[RegionAttachment.OX4];\r\n offsetY = vertexOffset[RegionAttachment.OY4];\r\n worldVertices[offset] = offsetX * a + offsetY * b + x;\r\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\r\n };\r\n RegionAttachment.prototype.copy = function () {\r\n var copy = new RegionAttachment(this.name);\r\n copy.region = this.region;\r\n copy.rendererObject = this.rendererObject;\r\n copy.path = this.path;\r\n copy.x = this.x;\r\n copy.y = this.y;\r\n copy.scaleX = this.scaleX;\r\n copy.scaleY = this.scaleY;\r\n copy.rotation = this.rotation;\r\n copy.width = this.width;\r\n copy.height = this.height;\r\n spine.Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\r\n spine.Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\r\n copy.color.setFromColor(this.color);\r\n return copy;\r\n };\r\n RegionAttachment.OX1 = 0;\r\n RegionAttachment.OY1 = 1;\r\n RegionAttachment.OX2 = 2;\r\n RegionAttachment.OY2 = 3;\r\n RegionAttachment.OX3 = 4;\r\n RegionAttachment.OY3 = 5;\r\n RegionAttachment.OX4 = 6;\r\n RegionAttachment.OY4 = 7;\r\n RegionAttachment.X1 = 0;\r\n RegionAttachment.Y1 = 1;\r\n RegionAttachment.C1R = 2;\r\n RegionAttachment.C1G = 3;\r\n RegionAttachment.C1B = 4;\r\n RegionAttachment.C1A = 5;\r\n RegionAttachment.U1 = 6;\r\n RegionAttachment.V1 = 7;\r\n RegionAttachment.X2 = 8;\r\n RegionAttachment.Y2 = 9;\r\n RegionAttachment.C2R = 10;\r\n RegionAttachment.C2G = 11;\r\n RegionAttachment.C2B = 12;\r\n RegionAttachment.C2A = 13;\r\n RegionAttachment.U2 = 14;\r\n RegionAttachment.V2 = 15;\r\n RegionAttachment.X3 = 16;\r\n RegionAttachment.Y3 = 17;\r\n RegionAttachment.C3R = 18;\r\n RegionAttachment.C3G = 19;\r\n RegionAttachment.C3B = 20;\r\n RegionAttachment.C3A = 21;\r\n RegionAttachment.U3 = 22;\r\n RegionAttachment.V3 = 23;\r\n RegionAttachment.X4 = 24;\r\n RegionAttachment.Y4 = 25;\r\n RegionAttachment.C4R = 26;\r\n RegionAttachment.C4G = 27;\r\n RegionAttachment.C4B = 28;\r\n RegionAttachment.C4A = 29;\r\n RegionAttachment.U4 = 30;\r\n RegionAttachment.V4 = 31;\r\n return RegionAttachment;\r\n }(spine.Attachment));\r\n spine.RegionAttachment = RegionAttachment;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var JitterEffect = (function () {\r\n function JitterEffect(jitterX, jitterY) {\r\n this.jitterX = 0;\r\n this.jitterY = 0;\r\n this.jitterX = jitterX;\r\n this.jitterY = jitterY;\r\n }\r\n JitterEffect.prototype.begin = function (skeleton) {\r\n };\r\n JitterEffect.prototype.transform = function (position, uv, light, dark) {\r\n position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\r\n };\r\n JitterEffect.prototype.end = function () {\r\n };\r\n return JitterEffect;\r\n }());\r\n spine.JitterEffect = JitterEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var SwirlEffect = (function () {\r\n function SwirlEffect(radius) {\r\n this.centerX = 0;\r\n this.centerY = 0;\r\n this.radius = 0;\r\n this.angle = 0;\r\n this.worldX = 0;\r\n this.worldY = 0;\r\n this.radius = radius;\r\n }\r\n SwirlEffect.prototype.begin = function (skeleton) {\r\n this.worldX = skeleton.x + this.centerX;\r\n this.worldY = skeleton.y + this.centerY;\r\n };\r\n SwirlEffect.prototype.transform = function (position, uv, light, dark) {\r\n var radAngle = this.angle * spine.MathUtils.degreesToRadians;\r\n var x = position.x - this.worldX;\r\n var y = position.y - this.worldY;\r\n var dist = Math.sqrt(x * x + y * y);\r\n if (dist < this.radius) {\r\n var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\r\n var cos = Math.cos(theta);\r\n var sin = Math.sin(theta);\r\n position.x = cos * x - sin * y + this.worldX;\r\n position.y = sin * x + cos * y + this.worldY;\r\n }\r\n };\r\n SwirlEffect.prototype.end = function () {\r\n };\r\n SwirlEffect.interpolation = new spine.PowOut(2);\r\n return SwirlEffect;\r\n }());\r\n spine.SwirlEffect = SwirlEffect;\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var canvas;\r\n (function (canvas) {\r\n var AssetManager = (function (_super) {\r\n __extends(AssetManager, _super);\r\n function AssetManager(pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this;\r\n }\r\n return AssetManager;\r\n }(spine.AssetManager));\r\n canvas.AssetManager = AssetManager;\r\n })(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var canvas;\r\n (function (canvas) {\r\n var CanvasTexture = (function (_super) {\r\n __extends(CanvasTexture, _super);\r\n function CanvasTexture(image) {\r\n return _super.call(this, image) || this;\r\n }\r\n CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { };\r\n CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { };\r\n CanvasTexture.prototype.dispose = function () { };\r\n return CanvasTexture;\r\n }(spine.Texture));\r\n canvas.CanvasTexture = CanvasTexture;\r\n })(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var canvas;\r\n (function (canvas) {\r\n var SkeletonRenderer = (function () {\r\n function SkeletonRenderer(context) {\r\n this.triangleRendering = false;\r\n this.debugRendering = false;\r\n this.vertices = spine.Utils.newFloatArray(8 * 1024);\r\n this.tempColor = new spine.Color();\r\n this.ctx = context;\r\n }\r\n SkeletonRenderer.prototype.draw = function (skeleton) {\r\n if (this.triangleRendering)\r\n this.drawTriangles(skeleton);\r\n else\r\n this.drawImages(skeleton);\r\n };\r\n SkeletonRenderer.prototype.drawImages = function (skeleton) {\r\n var ctx = this.ctx;\r\n var drawOrder = skeleton.drawOrder;\r\n if (this.debugRendering)\r\n ctx.strokeStyle = \"green\";\r\n ctx.save();\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var attachment = slot.getAttachment();\r\n var regionAttachment = null;\r\n var region = null;\r\n var image = null;\r\n if (attachment instanceof spine.RegionAttachment) {\r\n regionAttachment = attachment;\r\n region = regionAttachment.region;\r\n image = region.texture.getImage();\r\n }\r\n else\r\n continue;\r\n var skeleton_1 = slot.bone.skeleton;\r\n var skeletonColor = skeleton_1.color;\r\n var slotColor = slot.color;\r\n var regionColor = regionAttachment.color;\r\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha);\r\n var att = attachment;\r\n var bone = slot.bone;\r\n var w = region.width;\r\n var h = region.height;\r\n ctx.save();\r\n ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\r\n ctx.translate(attachment.offset[0], attachment.offset[1]);\r\n ctx.rotate(attachment.rotation * Math.PI / 180);\r\n var atlasScale = att.width / w;\r\n ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\r\n ctx.translate(w / 2, h / 2);\r\n if (attachment.region.rotate) {\r\n var t = w;\r\n w = h;\r\n h = t;\r\n ctx.rotate(-Math.PI / 2);\r\n }\r\n ctx.scale(1, -1);\r\n ctx.translate(-w / 2, -h / 2);\r\n if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n ctx.globalAlpha = color.a;\r\n }\r\n ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);\r\n if (this.debugRendering)\r\n ctx.strokeRect(0, 0, w, h);\r\n ctx.restore();\r\n }\r\n ctx.restore();\r\n };\r\n SkeletonRenderer.prototype.drawTriangles = function (skeleton) {\r\n var blendMode = null;\r\n var vertices = this.vertices;\r\n var triangles = null;\r\n var drawOrder = skeleton.drawOrder;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var slot = drawOrder[i];\r\n var attachment = slot.getAttachment();\r\n var texture = null;\r\n var region = null;\r\n if (attachment instanceof spine.RegionAttachment) {\r\n var regionAttachment = attachment;\r\n vertices = this.computeRegionVertices(slot, regionAttachment, false);\r\n triangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n region = regionAttachment.region;\r\n texture = region.texture.getImage();\r\n }\r\n else if (attachment instanceof spine.MeshAttachment) {\r\n var mesh = attachment;\r\n vertices = this.computeMeshVertices(slot, mesh, false);\r\n triangles = mesh.triangles;\r\n texture = mesh.region.renderObject.texture.getImage();\r\n }\r\n else\r\n continue;\r\n if (texture != null) {\r\n var slotBlendMode = slot.data.blendMode;\r\n if (slotBlendMode != blendMode) {\r\n blendMode = slotBlendMode;\r\n }\r\n var skeleton_2 = slot.bone.skeleton;\r\n var skeletonColor = skeleton_2.color;\r\n var slotColor = slot.color;\r\n var attachmentColor = attachment.color;\r\n var alpha = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha);\r\n var ctx = this.ctx;\r\n if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\r\n ctx.globalAlpha = color.a;\r\n }\r\n for (var j = 0; j < triangles.length; j += 3) {\r\n var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\r\n var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\r\n var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\r\n var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\r\n this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\r\n if (this.debugRendering) {\r\n ctx.strokeStyle = \"green\";\r\n ctx.beginPath();\r\n ctx.moveTo(x0, y0);\r\n ctx.lineTo(x1, y1);\r\n ctx.lineTo(x2, y2);\r\n ctx.lineTo(x0, y0);\r\n ctx.stroke();\r\n }\r\n }\r\n }\r\n }\r\n this.ctx.globalAlpha = 1;\r\n };\r\n SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) {\r\n var ctx = this.ctx;\r\n u0 *= img.width;\r\n v0 *= img.height;\r\n u1 *= img.width;\r\n v1 *= img.height;\r\n u2 *= img.width;\r\n v2 *= img.height;\r\n ctx.beginPath();\r\n ctx.moveTo(x0, y0);\r\n ctx.lineTo(x1, y1);\r\n ctx.lineTo(x2, y2);\r\n ctx.closePath();\r\n x1 -= x0;\r\n y1 -= y0;\r\n x2 -= x0;\r\n y2 -= y0;\r\n u1 -= u0;\r\n v1 -= v0;\r\n u2 -= u0;\r\n v2 -= v0;\r\n var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0;\r\n ctx.save();\r\n ctx.transform(a, b, c, d, e, f);\r\n ctx.clip();\r\n ctx.drawImage(img, 0, 0);\r\n ctx.restore();\r\n };\r\n SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) {\r\n var skeleton = slot.bone.skeleton;\r\n var skeletonColor = skeleton.color;\r\n var slotColor = slot.color;\r\n var regionColor = region.color;\r\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n var multiplier = pma ? alpha : 1;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n var vertices = this.vertices;\r\n var uvs = region.uvs;\r\n vertices[spine.RegionAttachment.C1R] = color.r;\r\n vertices[spine.RegionAttachment.C1G] = color.g;\r\n vertices[spine.RegionAttachment.C1B] = color.b;\r\n vertices[spine.RegionAttachment.C1A] = color.a;\r\n vertices[spine.RegionAttachment.U1] = uvs[0];\r\n vertices[spine.RegionAttachment.V1] = uvs[1];\r\n vertices[spine.RegionAttachment.C2R] = color.r;\r\n vertices[spine.RegionAttachment.C2G] = color.g;\r\n vertices[spine.RegionAttachment.C2B] = color.b;\r\n vertices[spine.RegionAttachment.C2A] = color.a;\r\n vertices[spine.RegionAttachment.U2] = uvs[2];\r\n vertices[spine.RegionAttachment.V2] = uvs[3];\r\n vertices[spine.RegionAttachment.C3R] = color.r;\r\n vertices[spine.RegionAttachment.C3G] = color.g;\r\n vertices[spine.RegionAttachment.C3B] = color.b;\r\n vertices[spine.RegionAttachment.C3A] = color.a;\r\n vertices[spine.RegionAttachment.U3] = uvs[4];\r\n vertices[spine.RegionAttachment.V3] = uvs[5];\r\n vertices[spine.RegionAttachment.C4R] = color.r;\r\n vertices[spine.RegionAttachment.C4G] = color.g;\r\n vertices[spine.RegionAttachment.C4B] = color.b;\r\n vertices[spine.RegionAttachment.C4A] = color.a;\r\n vertices[spine.RegionAttachment.U4] = uvs[6];\r\n vertices[spine.RegionAttachment.V4] = uvs[7];\r\n return vertices;\r\n };\r\n SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) {\r\n var skeleton = slot.bone.skeleton;\r\n var skeletonColor = skeleton.color;\r\n var slotColor = slot.color;\r\n var regionColor = mesh.color;\r\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\r\n var multiplier = pma ? alpha : 1;\r\n var color = this.tempColor;\r\n color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\r\n var numVertices = mesh.worldVerticesLength / 2;\r\n if (this.vertices.length < mesh.worldVerticesLength) {\r\n this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength);\r\n }\r\n var vertices = this.vertices;\r\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\r\n var uvs = mesh.uvs;\r\n for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) {\r\n vertices[v++] = color.r;\r\n vertices[v++] = color.g;\r\n vertices[v++] = color.b;\r\n vertices[v++] = color.a;\r\n vertices[v++] = uvs[u++];\r\n vertices[v++] = uvs[u++];\r\n v += 2;\r\n }\r\n return vertices;\r\n };\r\n SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4;\r\n return SkeletonRenderer;\r\n }());\r\n canvas.SkeletonRenderer = SkeletonRenderer;\r\n })(canvas = spine.canvas || (spine.canvas = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var AssetManager = (function (_super) {\r\n __extends(AssetManager, _super);\r\n function AssetManager(context, pathPrefix) {\r\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\r\n return _super.call(this, function (image) {\r\n return new spine.webgl.GLTexture(context, image);\r\n }, pathPrefix) || this;\r\n }\r\n return AssetManager;\r\n }(spine.AssetManager));\r\n webgl.AssetManager = AssetManager;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var OrthoCamera = (function () {\r\n function OrthoCamera(viewportWidth, viewportHeight) {\r\n this.position = new webgl.Vector3(0, 0, 0);\r\n this.direction = new webgl.Vector3(0, 0, -1);\r\n this.up = new webgl.Vector3(0, 1, 0);\r\n this.near = 0;\r\n this.far = 100;\r\n this.zoom = 1;\r\n this.viewportWidth = 0;\r\n this.viewportHeight = 0;\r\n this.projectionView = new webgl.Matrix4();\r\n this.inverseProjectionView = new webgl.Matrix4();\r\n this.projection = new webgl.Matrix4();\r\n this.view = new webgl.Matrix4();\r\n this.tmp = new webgl.Vector3();\r\n this.viewportWidth = viewportWidth;\r\n this.viewportHeight = viewportHeight;\r\n this.update();\r\n }\r\n OrthoCamera.prototype.update = function () {\r\n var projection = this.projection;\r\n var view = this.view;\r\n var projectionView = this.projectionView;\r\n var inverseProjectionView = this.inverseProjectionView;\r\n var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\r\n projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far);\r\n view.lookAt(this.position, this.direction, this.up);\r\n projectionView.set(projection.values);\r\n projectionView.multiply(view);\r\n inverseProjectionView.set(projectionView.values).invert();\r\n };\r\n OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) {\r\n var x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\r\n var tmp = this.tmp;\r\n tmp.x = (2 * x) / screenWidth - 1;\r\n tmp.y = (2 * y) / screenHeight - 1;\r\n tmp.z = (2 * screenCoords.z) - 1;\r\n tmp.project(this.inverseProjectionView);\r\n screenCoords.set(tmp.x, tmp.y, tmp.z);\r\n return screenCoords;\r\n };\r\n OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) {\r\n this.viewportWidth = viewportWidth;\r\n this.viewportHeight = viewportHeight;\r\n };\r\n return OrthoCamera;\r\n }());\r\n webgl.OrthoCamera = OrthoCamera;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var GLTexture = (function (_super) {\r\n __extends(GLTexture, _super);\r\n function GLTexture(context, image, useMipMaps) {\r\n if (useMipMaps === void 0) { useMipMaps = false; }\r\n var _this = _super.call(this, image) || this;\r\n _this.texture = null;\r\n _this.boundUnit = 0;\r\n _this.useMipMaps = false;\r\n _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n _this.useMipMaps = useMipMaps;\r\n _this.restore();\r\n _this.context.addRestorable(_this);\r\n return _this;\r\n }\r\n GLTexture.prototype.setFilters = function (minFilter, magFilter) {\r\n var gl = this.context.gl;\r\n this.bind();\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, GLTexture.validateMagFilter(magFilter));\r\n };\r\n GLTexture.validateMagFilter = function (magFilter) {\r\n switch (magFilter) {\r\n case spine.TextureFilter.MipMap:\r\n case spine.TextureFilter.MipMapLinearLinear:\r\n case spine.TextureFilter.MipMapLinearNearest:\r\n case spine.TextureFilter.MipMapNearestLinear:\r\n case spine.TextureFilter.MipMapNearestNearest:\r\n return spine.TextureFilter.Linear;\r\n default:\r\n return magFilter;\r\n }\r\n };\r\n GLTexture.prototype.setWraps = function (uWrap, vWrap) {\r\n var gl = this.context.gl;\r\n this.bind();\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\r\n };\r\n GLTexture.prototype.update = function (useMipMaps) {\r\n var gl = this.context.gl;\r\n if (!this.texture) {\r\n this.texture = this.context.gl.createTexture();\r\n }\r\n this.bind();\r\n if (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL)\r\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\r\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\r\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\r\n if (useMipMaps)\r\n gl.generateMipmap(gl.TEXTURE_2D);\r\n };\r\n GLTexture.prototype.restore = function () {\r\n this.texture = null;\r\n this.update(this.useMipMaps);\r\n };\r\n GLTexture.prototype.bind = function (unit) {\r\n if (unit === void 0) { unit = 0; }\r\n var gl = this.context.gl;\r\n this.boundUnit = unit;\r\n gl.activeTexture(gl.TEXTURE0 + unit);\r\n gl.bindTexture(gl.TEXTURE_2D, this.texture);\r\n };\r\n GLTexture.prototype.unbind = function () {\r\n var gl = this.context.gl;\r\n gl.activeTexture(gl.TEXTURE0 + this.boundUnit);\r\n gl.bindTexture(gl.TEXTURE_2D, null);\r\n };\r\n GLTexture.prototype.dispose = function () {\r\n this.context.removeRestorable(this);\r\n var gl = this.context.gl;\r\n gl.deleteTexture(this.texture);\r\n };\r\n GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;\r\n return GLTexture;\r\n }(spine.Texture));\r\n webgl.GLTexture = GLTexture;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n webgl.M00 = 0;\r\n webgl.M01 = 4;\r\n webgl.M02 = 8;\r\n webgl.M03 = 12;\r\n webgl.M10 = 1;\r\n webgl.M11 = 5;\r\n webgl.M12 = 9;\r\n webgl.M13 = 13;\r\n webgl.M20 = 2;\r\n webgl.M21 = 6;\r\n webgl.M22 = 10;\r\n webgl.M23 = 14;\r\n webgl.M30 = 3;\r\n webgl.M31 = 7;\r\n webgl.M32 = 11;\r\n webgl.M33 = 15;\r\n var Matrix4 = (function () {\r\n function Matrix4() {\r\n this.temp = new Float32Array(16);\r\n this.values = new Float32Array(16);\r\n var v = this.values;\r\n v[webgl.M00] = 1;\r\n v[webgl.M11] = 1;\r\n v[webgl.M22] = 1;\r\n v[webgl.M33] = 1;\r\n }\r\n Matrix4.prototype.set = function (values) {\r\n this.values.set(values);\r\n return this;\r\n };\r\n Matrix4.prototype.transpose = function () {\r\n var t = this.temp;\r\n var v = this.values;\r\n t[webgl.M00] = v[webgl.M00];\r\n t[webgl.M01] = v[webgl.M10];\r\n t[webgl.M02] = v[webgl.M20];\r\n t[webgl.M03] = v[webgl.M30];\r\n t[webgl.M10] = v[webgl.M01];\r\n t[webgl.M11] = v[webgl.M11];\r\n t[webgl.M12] = v[webgl.M21];\r\n t[webgl.M13] = v[webgl.M31];\r\n t[webgl.M20] = v[webgl.M02];\r\n t[webgl.M21] = v[webgl.M12];\r\n t[webgl.M22] = v[webgl.M22];\r\n t[webgl.M23] = v[webgl.M32];\r\n t[webgl.M30] = v[webgl.M03];\r\n t[webgl.M31] = v[webgl.M13];\r\n t[webgl.M32] = v[webgl.M23];\r\n t[webgl.M33] = v[webgl.M33];\r\n return this.set(t);\r\n };\r\n Matrix4.prototype.identity = function () {\r\n var v = this.values;\r\n v[webgl.M00] = 1;\r\n v[webgl.M01] = 0;\r\n v[webgl.M02] = 0;\r\n v[webgl.M03] = 0;\r\n v[webgl.M10] = 0;\r\n v[webgl.M11] = 1;\r\n v[webgl.M12] = 0;\r\n v[webgl.M13] = 0;\r\n v[webgl.M20] = 0;\r\n v[webgl.M21] = 0;\r\n v[webgl.M22] = 1;\r\n v[webgl.M23] = 0;\r\n v[webgl.M30] = 0;\r\n v[webgl.M31] = 0;\r\n v[webgl.M32] = 0;\r\n v[webgl.M33] = 1;\r\n return this;\r\n };\r\n Matrix4.prototype.invert = function () {\r\n var v = this.values;\r\n var t = this.temp;\r\n var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n if (l_det == 0)\r\n throw new Error(\"non-invertible matrix\");\r\n var inv_det = 1.0 / l_det;\r\n t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32]\r\n - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32]\r\n + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32]\r\n - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33];\r\n t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22]\r\n + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23];\r\n t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32]\r\n + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32]\r\n - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33];\r\n t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32]\r\n + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33];\r\n t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22]\r\n - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23];\r\n t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31]\r\n - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33];\r\n t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31]\r\n + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33];\r\n t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31]\r\n - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33];\r\n t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21]\r\n + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23];\r\n t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31]\r\n + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32];\r\n t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31]\r\n - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32];\r\n t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31]\r\n + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32];\r\n t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21]\r\n - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22];\r\n v[webgl.M00] = t[webgl.M00] * inv_det;\r\n v[webgl.M01] = t[webgl.M01] * inv_det;\r\n v[webgl.M02] = t[webgl.M02] * inv_det;\r\n v[webgl.M03] = t[webgl.M03] * inv_det;\r\n v[webgl.M10] = t[webgl.M10] * inv_det;\r\n v[webgl.M11] = t[webgl.M11] * inv_det;\r\n v[webgl.M12] = t[webgl.M12] * inv_det;\r\n v[webgl.M13] = t[webgl.M13] * inv_det;\r\n v[webgl.M20] = t[webgl.M20] * inv_det;\r\n v[webgl.M21] = t[webgl.M21] * inv_det;\r\n v[webgl.M22] = t[webgl.M22] * inv_det;\r\n v[webgl.M23] = t[webgl.M23] * inv_det;\r\n v[webgl.M30] = t[webgl.M30] * inv_det;\r\n v[webgl.M31] = t[webgl.M31] * inv_det;\r\n v[webgl.M32] = t[webgl.M32] * inv_det;\r\n v[webgl.M33] = t[webgl.M33] * inv_det;\r\n return this;\r\n };\r\n Matrix4.prototype.determinant = function () {\r\n var v = this.values;\r\n return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\r\n + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\r\n - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\r\n - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\r\n + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\r\n + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\r\n - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\r\n - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\r\n };\r\n Matrix4.prototype.translate = function (x, y, z) {\r\n var v = this.values;\r\n v[webgl.M03] += x;\r\n v[webgl.M13] += y;\r\n v[webgl.M23] += z;\r\n return this;\r\n };\r\n Matrix4.prototype.copy = function () {\r\n return new Matrix4().set(this.values);\r\n };\r\n Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) {\r\n this.identity();\r\n var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\r\n var l_a1 = (far + near) / (near - far);\r\n var l_a2 = (2 * far * near) / (near - far);\r\n var v = this.values;\r\n v[webgl.M00] = l_fd / aspectRatio;\r\n v[webgl.M10] = 0;\r\n v[webgl.M20] = 0;\r\n v[webgl.M30] = 0;\r\n v[webgl.M01] = 0;\r\n v[webgl.M11] = l_fd;\r\n v[webgl.M21] = 0;\r\n v[webgl.M31] = 0;\r\n v[webgl.M02] = 0;\r\n v[webgl.M12] = 0;\r\n v[webgl.M22] = l_a1;\r\n v[webgl.M32] = -1;\r\n v[webgl.M03] = 0;\r\n v[webgl.M13] = 0;\r\n v[webgl.M23] = l_a2;\r\n v[webgl.M33] = 0;\r\n return this;\r\n };\r\n Matrix4.prototype.ortho2d = function (x, y, width, height) {\r\n return this.ortho(x, x + width, y, y + height, 0, 1);\r\n };\r\n Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) {\r\n this.identity();\r\n var x_orth = 2 / (right - left);\r\n var y_orth = 2 / (top - bottom);\r\n var z_orth = -2 / (far - near);\r\n var tx = -(right + left) / (right - left);\r\n var ty = -(top + bottom) / (top - bottom);\r\n var tz = -(far + near) / (far - near);\r\n var v = this.values;\r\n v[webgl.M00] = x_orth;\r\n v[webgl.M10] = 0;\r\n v[webgl.M20] = 0;\r\n v[webgl.M30] = 0;\r\n v[webgl.M01] = 0;\r\n v[webgl.M11] = y_orth;\r\n v[webgl.M21] = 0;\r\n v[webgl.M31] = 0;\r\n v[webgl.M02] = 0;\r\n v[webgl.M12] = 0;\r\n v[webgl.M22] = z_orth;\r\n v[webgl.M32] = 0;\r\n v[webgl.M03] = tx;\r\n v[webgl.M13] = ty;\r\n v[webgl.M23] = tz;\r\n v[webgl.M33] = 1;\r\n return this;\r\n };\r\n Matrix4.prototype.multiply = function (matrix) {\r\n var t = this.temp;\r\n var v = this.values;\r\n var m = matrix.values;\r\n t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30];\r\n t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31];\r\n t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32];\r\n t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33];\r\n t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30];\r\n t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31];\r\n t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32];\r\n t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33];\r\n t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30];\r\n t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31];\r\n t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32];\r\n t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33];\r\n t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30];\r\n t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31];\r\n t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32];\r\n t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33];\r\n return this.set(this.temp);\r\n };\r\n Matrix4.prototype.multiplyLeft = function (matrix) {\r\n var t = this.temp;\r\n var v = this.values;\r\n var m = matrix.values;\r\n t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30];\r\n t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31];\r\n t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32];\r\n t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33];\r\n t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30];\r\n t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31];\r\n t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32];\r\n t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33];\r\n t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30];\r\n t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31];\r\n t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32];\r\n t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33];\r\n t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30];\r\n t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31];\r\n t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32];\r\n t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33];\r\n return this.set(this.temp);\r\n };\r\n Matrix4.prototype.lookAt = function (position, direction, up) {\r\n Matrix4.initTemps();\r\n var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\r\n zAxis.setFrom(direction).normalize();\r\n xAxis.setFrom(direction).normalize();\r\n xAxis.cross(up).normalize();\r\n yAxis.setFrom(xAxis).cross(zAxis).normalize();\r\n this.identity();\r\n var val = this.values;\r\n val[webgl.M00] = xAxis.x;\r\n val[webgl.M01] = xAxis.y;\r\n val[webgl.M02] = xAxis.z;\r\n val[webgl.M10] = yAxis.x;\r\n val[webgl.M11] = yAxis.y;\r\n val[webgl.M12] = yAxis.z;\r\n val[webgl.M20] = -zAxis.x;\r\n val[webgl.M21] = -zAxis.y;\r\n val[webgl.M22] = -zAxis.z;\r\n Matrix4.tmpMatrix.identity();\r\n Matrix4.tmpMatrix.values[webgl.M03] = -position.x;\r\n Matrix4.tmpMatrix.values[webgl.M13] = -position.y;\r\n Matrix4.tmpMatrix.values[webgl.M23] = -position.z;\r\n this.multiply(Matrix4.tmpMatrix);\r\n return this;\r\n };\r\n Matrix4.initTemps = function () {\r\n if (Matrix4.xAxis === null)\r\n Matrix4.xAxis = new webgl.Vector3();\r\n if (Matrix4.yAxis === null)\r\n Matrix4.yAxis = new webgl.Vector3();\r\n if (Matrix4.zAxis === null)\r\n Matrix4.zAxis = new webgl.Vector3();\r\n };\r\n Matrix4.xAxis = null;\r\n Matrix4.yAxis = null;\r\n Matrix4.zAxis = null;\r\n Matrix4.tmpMatrix = new Matrix4();\r\n return Matrix4;\r\n }());\r\n webgl.Matrix4 = Matrix4;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Mesh = (function () {\r\n function Mesh(context, attributes, maxVertices, maxIndices) {\r\n this.attributes = attributes;\r\n this.verticesLength = 0;\r\n this.dirtyVertices = false;\r\n this.indicesLength = 0;\r\n this.dirtyIndices = false;\r\n this.elementsPerVertex = 0;\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.elementsPerVertex = 0;\r\n for (var i = 0; i < attributes.length; i++) {\r\n this.elementsPerVertex += attributes[i].numElements;\r\n }\r\n this.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\r\n this.indices = new Uint16Array(maxIndices);\r\n this.context.addRestorable(this);\r\n }\r\n Mesh.prototype.getAttributes = function () { return this.attributes; };\r\n Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; };\r\n Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; };\r\n Mesh.prototype.setVerticesLength = function (length) {\r\n this.dirtyVertices = true;\r\n this.verticesLength = length;\r\n };\r\n Mesh.prototype.getVertices = function () { return this.vertices; };\r\n Mesh.prototype.maxIndices = function () { return this.indices.length; };\r\n Mesh.prototype.numIndices = function () { return this.indicesLength; };\r\n Mesh.prototype.setIndicesLength = function (length) {\r\n this.dirtyIndices = true;\r\n this.indicesLength = length;\r\n };\r\n Mesh.prototype.getIndices = function () { return this.indices; };\r\n ;\r\n Mesh.prototype.getVertexSizeInFloats = function () {\r\n var size = 0;\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attribute = this.attributes[i];\r\n size += attribute.numElements;\r\n }\r\n return size;\r\n };\r\n Mesh.prototype.setVertices = function (vertices) {\r\n this.dirtyVertices = true;\r\n if (vertices.length > this.vertices.length)\r\n throw Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\r\n this.vertices.set(vertices, 0);\r\n this.verticesLength = vertices.length;\r\n };\r\n Mesh.prototype.setIndices = function (indices) {\r\n this.dirtyIndices = true;\r\n if (indices.length > this.indices.length)\r\n throw Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\r\n this.indices.set(indices, 0);\r\n this.indicesLength = indices.length;\r\n };\r\n Mesh.prototype.draw = function (shader, primitiveType) {\r\n this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\r\n };\r\n Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) {\r\n var gl = this.context.gl;\r\n if (this.dirtyVertices || this.dirtyIndices)\r\n this.update();\r\n this.bind(shader);\r\n if (this.indicesLength > 0) {\r\n gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\r\n }\r\n else {\r\n gl.drawArrays(primitiveType, offset, count);\r\n }\r\n this.unbind(shader);\r\n };\r\n Mesh.prototype.bind = function (shader) {\r\n var gl = this.context.gl;\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n var offset = 0;\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attrib = this.attributes[i];\r\n var location_1 = shader.getAttributeLocation(attrib.name);\r\n gl.enableVertexAttribArray(location_1);\r\n gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\r\n offset += attrib.numElements;\r\n }\r\n if (this.indicesLength > 0)\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n };\r\n Mesh.prototype.unbind = function (shader) {\r\n var gl = this.context.gl;\r\n for (var i = 0; i < this.attributes.length; i++) {\r\n var attrib = this.attributes[i];\r\n var location_2 = shader.getAttributeLocation(attrib.name);\r\n gl.disableVertexAttribArray(location_2);\r\n }\r\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n if (this.indicesLength > 0)\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\r\n };\r\n Mesh.prototype.update = function () {\r\n var gl = this.context.gl;\r\n if (this.dirtyVertices) {\r\n if (!this.verticesBuffer) {\r\n this.verticesBuffer = gl.createBuffer();\r\n }\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\r\n this.dirtyVertices = false;\r\n }\r\n if (this.dirtyIndices) {\r\n if (!this.indicesBuffer) {\r\n this.indicesBuffer = gl.createBuffer();\r\n }\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\r\n this.dirtyIndices = false;\r\n }\r\n };\r\n Mesh.prototype.restore = function () {\r\n this.verticesBuffer = null;\r\n this.indicesBuffer = null;\r\n this.update();\r\n };\r\n Mesh.prototype.dispose = function () {\r\n this.context.removeRestorable(this);\r\n var gl = this.context.gl;\r\n gl.deleteBuffer(this.verticesBuffer);\r\n gl.deleteBuffer(this.indicesBuffer);\r\n };\r\n return Mesh;\r\n }());\r\n webgl.Mesh = Mesh;\r\n var VertexAttribute = (function () {\r\n function VertexAttribute(name, type, numElements) {\r\n this.name = name;\r\n this.type = type;\r\n this.numElements = numElements;\r\n }\r\n return VertexAttribute;\r\n }());\r\n webgl.VertexAttribute = VertexAttribute;\r\n var Position2Attribute = (function (_super) {\r\n __extends(Position2Attribute, _super);\r\n function Position2Attribute() {\r\n return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this;\r\n }\r\n return Position2Attribute;\r\n }(VertexAttribute));\r\n webgl.Position2Attribute = Position2Attribute;\r\n var Position3Attribute = (function (_super) {\r\n __extends(Position3Attribute, _super);\r\n function Position3Attribute() {\r\n return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this;\r\n }\r\n return Position3Attribute;\r\n }(VertexAttribute));\r\n webgl.Position3Attribute = Position3Attribute;\r\n var TexCoordAttribute = (function (_super) {\r\n __extends(TexCoordAttribute, _super);\r\n function TexCoordAttribute(unit) {\r\n if (unit === void 0) { unit = 0; }\r\n return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2) || this;\r\n }\r\n return TexCoordAttribute;\r\n }(VertexAttribute));\r\n webgl.TexCoordAttribute = TexCoordAttribute;\r\n var ColorAttribute = (function (_super) {\r\n __extends(ColorAttribute, _super);\r\n function ColorAttribute() {\r\n return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this;\r\n }\r\n return ColorAttribute;\r\n }(VertexAttribute));\r\n webgl.ColorAttribute = ColorAttribute;\r\n var Color2Attribute = (function (_super) {\r\n __extends(Color2Attribute, _super);\r\n function Color2Attribute() {\r\n return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this;\r\n }\r\n return Color2Attribute;\r\n }(VertexAttribute));\r\n webgl.Color2Attribute = Color2Attribute;\r\n var VertexAttributeType;\r\n (function (VertexAttributeType) {\r\n VertexAttributeType[VertexAttributeType[\"Float\"] = 0] = \"Float\";\r\n })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {}));\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var PolygonBatcher = (function () {\r\n function PolygonBatcher(context, twoColorTint, maxVertices) {\r\n if (twoColorTint === void 0) { twoColorTint = true; }\r\n if (maxVertices === void 0) { maxVertices = 10920; }\r\n this.isDrawing = false;\r\n this.shader = null;\r\n this.lastTexture = null;\r\n this.verticesLength = 0;\r\n this.indicesLength = 0;\r\n if (maxVertices > 10920)\r\n throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n var attributes = twoColorTint ?\r\n [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] :\r\n [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()];\r\n this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3);\r\n this.srcBlend = this.context.gl.SRC_ALPHA;\r\n this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n }\r\n PolygonBatcher.prototype.begin = function (shader) {\r\n var gl = this.context.gl;\r\n if (this.isDrawing)\r\n throw new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\r\n this.drawCalls = 0;\r\n this.shader = shader;\r\n this.lastTexture = null;\r\n this.isDrawing = true;\r\n gl.enable(gl.BLEND);\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n };\r\n PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n var gl = this.context.gl;\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n if (this.isDrawing) {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n };\r\n PolygonBatcher.prototype.draw = function (texture, vertices, indices) {\r\n if (texture != this.lastTexture) {\r\n this.flush();\r\n this.lastTexture = texture;\r\n }\r\n else if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\r\n this.indicesLength + indices.length > this.mesh.getIndices().length) {\r\n this.flush();\r\n }\r\n var indexStart = this.mesh.numVertices();\r\n this.mesh.getVertices().set(vertices, this.verticesLength);\r\n this.verticesLength += vertices.length;\r\n this.mesh.setVerticesLength(this.verticesLength);\r\n var indicesArray = this.mesh.getIndices();\r\n for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++)\r\n indicesArray[i] = indices[j] + indexStart;\r\n this.indicesLength += indices.length;\r\n this.mesh.setIndicesLength(this.indicesLength);\r\n };\r\n PolygonBatcher.prototype.flush = function () {\r\n var gl = this.context.gl;\r\n if (this.verticesLength == 0)\r\n return;\r\n this.lastTexture.bind();\r\n this.mesh.draw(this.shader, gl.TRIANGLES);\r\n this.verticesLength = 0;\r\n this.indicesLength = 0;\r\n this.mesh.setVerticesLength(0);\r\n this.mesh.setIndicesLength(0);\r\n this.drawCalls++;\r\n };\r\n PolygonBatcher.prototype.end = function () {\r\n var gl = this.context.gl;\r\n if (!this.isDrawing)\r\n throw new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\r\n if (this.verticesLength > 0 || this.indicesLength > 0)\r\n this.flush();\r\n this.shader = null;\r\n this.lastTexture = null;\r\n this.isDrawing = false;\r\n gl.disable(gl.BLEND);\r\n };\r\n PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; };\r\n PolygonBatcher.prototype.dispose = function () {\r\n this.mesh.dispose();\r\n };\r\n return PolygonBatcher;\r\n }());\r\n webgl.PolygonBatcher = PolygonBatcher;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var SceneRenderer = (function () {\r\n function SceneRenderer(canvas, context, twoColorTint) {\r\n if (twoColorTint === void 0) { twoColorTint = true; }\r\n this.twoColorTint = false;\r\n this.activeRenderer = null;\r\n this.QUAD = [\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n 0, 0, 1, 1, 1, 1, 0, 0,\r\n ];\r\n this.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n this.WHITE = new spine.Color(1, 1, 1, 1);\r\n this.canvas = canvas;\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.twoColorTint = twoColorTint;\r\n this.camera = new webgl.OrthoCamera(canvas.width, canvas.height);\r\n this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context);\r\n this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint);\r\n this.shapesShader = webgl.Shader.newColored(this.context);\r\n this.shapes = new webgl.ShapeRenderer(this.context);\r\n this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint);\r\n this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context);\r\n }\r\n SceneRenderer.prototype.begin = function () {\r\n this.camera.update();\r\n this.enableRenderer(this.batcher);\r\n };\r\n SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) {\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n if (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n if (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n this.enableRenderer(this.batcher);\r\n this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\r\n this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd);\r\n };\r\n SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) {\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n if (ignoredBones === void 0) { ignoredBones = null; }\r\n this.enableRenderer(this.shapes);\r\n this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\r\n this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\r\n };\r\n SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var i = 0;\r\n quad[i++] = x;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var i = 0;\r\n quad[i++] = x;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u;\r\n quad[i++] = v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u2;\r\n quad[i++] = v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u2;\r\n quad[i++] = v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = u;\r\n quad[i++] = v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) {\r\n if (color === void 0) { color = null; }\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var worldOriginX = x + pivotX;\r\n var worldOriginY = y + pivotY;\r\n var fx = -pivotX;\r\n var fy = -pivotY;\r\n var fx2 = width - pivotX;\r\n var fy2 = height - pivotY;\r\n var p1x = fx;\r\n var p1y = fy;\r\n var p2x = fx;\r\n var p2y = fy2;\r\n var p3x = fx2;\r\n var p3y = fy2;\r\n var p4x = fx2;\r\n var p4y = fy;\r\n var x1 = 0;\r\n var y1 = 0;\r\n var x2 = 0;\r\n var y2 = 0;\r\n var x3 = 0;\r\n var y3 = 0;\r\n var x4 = 0;\r\n var y4 = 0;\r\n if (angle != 0) {\r\n var cos = spine.MathUtils.cosDeg(angle);\r\n var sin = spine.MathUtils.sinDeg(angle);\r\n x1 = cos * p1x - sin * p1y;\r\n y1 = sin * p1x + cos * p1y;\r\n x4 = cos * p2x - sin * p2y;\r\n y4 = sin * p2x + cos * p2y;\r\n x3 = cos * p3x - sin * p3y;\r\n y3 = sin * p3x + cos * p3y;\r\n x2 = x3 + (x1 - x4);\r\n y2 = y3 + (y1 - y4);\r\n }\r\n else {\r\n x1 = p1x;\r\n y1 = p1y;\r\n x4 = p2x;\r\n y4 = p2y;\r\n x3 = p3x;\r\n y3 = p3y;\r\n x2 = p4x;\r\n y2 = p4y;\r\n }\r\n x1 += worldOriginX;\r\n y1 += worldOriginY;\r\n x2 += worldOriginX;\r\n y2 += worldOriginY;\r\n x3 += worldOriginX;\r\n y3 += worldOriginY;\r\n x4 += worldOriginX;\r\n y4 += worldOriginY;\r\n var i = 0;\r\n quad[i++] = x1;\r\n quad[i++] = y1;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x2;\r\n quad[i++] = y2;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 1;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x3;\r\n quad[i++] = y3;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 1;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x4;\r\n quad[i++] = y4;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) {\r\n if (color === void 0) { color = null; }\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n this.enableRenderer(this.batcher);\r\n if (color === null)\r\n color = this.WHITE;\r\n var quad = this.QUAD;\r\n var i = 0;\r\n quad[i++] = x;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u;\r\n quad[i++] = region.v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u2;\r\n quad[i++] = region.v2;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x + width;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u2;\r\n quad[i++] = region.v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n quad[i++] = x;\r\n quad[i++] = y + height;\r\n quad[i++] = color.r;\r\n quad[i++] = color.g;\r\n quad[i++] = color.b;\r\n quad[i++] = color.a;\r\n quad[i++] = region.u;\r\n quad[i++] = region.v;\r\n if (this.twoColorTint) {\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n quad[i++] = 0;\r\n }\r\n this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES);\r\n };\r\n SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.line(x, y, x2, y2, color);\r\n };\r\n SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\r\n };\r\n SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n if (color4 === void 0) { color4 = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\r\n };\r\n SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.rect(filled, x, y, width, height, color);\r\n };\r\n SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\r\n };\r\n SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.polygon(polygonVertices, offset, count, color);\r\n };\r\n SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n if (color === void 0) { color = null; }\r\n if (segments === void 0) { segments = 0; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.circle(filled, x, y, radius, color, segments);\r\n };\r\n SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n if (color === void 0) { color = null; }\r\n this.enableRenderer(this.shapes);\r\n this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\r\n };\r\n SceneRenderer.prototype.end = function () {\r\n if (this.activeRenderer === this.batcher)\r\n this.batcher.end();\r\n else if (this.activeRenderer === this.shapes)\r\n this.shapes.end();\r\n this.activeRenderer = null;\r\n };\r\n SceneRenderer.prototype.resize = function (resizeMode) {\r\n var canvas = this.canvas;\r\n var w = canvas.clientWidth;\r\n var h = canvas.clientHeight;\r\n if (canvas.width != w || canvas.height != h) {\r\n canvas.width = w;\r\n canvas.height = h;\r\n }\r\n this.context.gl.viewport(0, 0, canvas.width, canvas.height);\r\n if (resizeMode === ResizeMode.Stretch) {\r\n }\r\n else if (resizeMode === ResizeMode.Expand) {\r\n this.camera.setViewport(w, h);\r\n }\r\n else if (resizeMode === ResizeMode.Fit) {\r\n var sourceWidth = canvas.width, sourceHeight = canvas.height;\r\n var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\r\n var targetRatio = targetHeight / targetWidth;\r\n var sourceRatio = sourceHeight / sourceWidth;\r\n var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\r\n this.camera.viewportWidth = sourceWidth * scale;\r\n this.camera.viewportHeight = sourceHeight * scale;\r\n }\r\n this.camera.update();\r\n };\r\n SceneRenderer.prototype.enableRenderer = function (renderer) {\r\n if (this.activeRenderer === renderer)\r\n return;\r\n this.end();\r\n if (renderer instanceof webgl.PolygonBatcher) {\r\n this.batcherShader.bind();\r\n this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n this.batcherShader.setUniformi(\"u_texture\", 0);\r\n this.batcher.begin(this.batcherShader);\r\n this.activeRenderer = this.batcher;\r\n }\r\n else if (renderer instanceof webgl.ShapeRenderer) {\r\n this.shapesShader.bind();\r\n this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\r\n this.shapes.begin(this.shapesShader);\r\n this.activeRenderer = this.shapes;\r\n }\r\n else {\r\n this.activeRenderer = this.skeletonDebugRenderer;\r\n }\r\n };\r\n SceneRenderer.prototype.dispose = function () {\r\n this.batcher.dispose();\r\n this.batcherShader.dispose();\r\n this.shapes.dispose();\r\n this.shapesShader.dispose();\r\n this.skeletonDebugRenderer.dispose();\r\n };\r\n return SceneRenderer;\r\n }());\r\n webgl.SceneRenderer = SceneRenderer;\r\n var ResizeMode;\r\n (function (ResizeMode) {\r\n ResizeMode[ResizeMode[\"Stretch\"] = 0] = \"Stretch\";\r\n ResizeMode[ResizeMode[\"Expand\"] = 1] = \"Expand\";\r\n ResizeMode[ResizeMode[\"Fit\"] = 2] = \"Fit\";\r\n })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {}));\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Shader = (function () {\r\n function Shader(context, vertexShader, fragmentShader) {\r\n this.vertexShader = vertexShader;\r\n this.fragmentShader = fragmentShader;\r\n this.vs = null;\r\n this.fs = null;\r\n this.program = null;\r\n this.tmp2x2 = new Float32Array(2 * 2);\r\n this.tmp3x3 = new Float32Array(3 * 3);\r\n this.tmp4x4 = new Float32Array(4 * 4);\r\n this.vsSource = vertexShader;\r\n this.fsSource = fragmentShader;\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.context.addRestorable(this);\r\n this.compile();\r\n }\r\n Shader.prototype.getProgram = function () { return this.program; };\r\n Shader.prototype.getVertexShader = function () { return this.vertexShader; };\r\n Shader.prototype.getFragmentShader = function () { return this.fragmentShader; };\r\n Shader.prototype.getVertexShaderSource = function () { return this.vsSource; };\r\n Shader.prototype.getFragmentSource = function () { return this.fsSource; };\r\n Shader.prototype.compile = function () {\r\n var gl = this.context.gl;\r\n try {\r\n this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\r\n this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\r\n this.program = this.compileProgram(this.vs, this.fs);\r\n }\r\n catch (e) {\r\n this.dispose();\r\n throw e;\r\n }\r\n };\r\n Shader.prototype.compileShader = function (type, source) {\r\n var gl = this.context.gl;\r\n var shader = gl.createShader(type);\r\n gl.shaderSource(shader, source);\r\n gl.compileShader(shader);\r\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\r\n var error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\r\n gl.deleteShader(shader);\r\n if (!gl.isContextLost())\r\n throw new Error(error);\r\n }\r\n return shader;\r\n };\r\n Shader.prototype.compileProgram = function (vs, fs) {\r\n var gl = this.context.gl;\r\n var program = gl.createProgram();\r\n gl.attachShader(program, vs);\r\n gl.attachShader(program, fs);\r\n gl.linkProgram(program);\r\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\r\n var error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\r\n gl.deleteProgram(program);\r\n if (!gl.isContextLost())\r\n throw new Error(error);\r\n }\r\n return program;\r\n };\r\n Shader.prototype.restore = function () {\r\n this.compile();\r\n };\r\n Shader.prototype.bind = function () {\r\n this.context.gl.useProgram(this.program);\r\n };\r\n Shader.prototype.unbind = function () {\r\n this.context.gl.useProgram(null);\r\n };\r\n Shader.prototype.setUniformi = function (uniform, value) {\r\n this.context.gl.uniform1i(this.getUniformLocation(uniform), value);\r\n };\r\n Shader.prototype.setUniformf = function (uniform, value) {\r\n this.context.gl.uniform1f(this.getUniformLocation(uniform), value);\r\n };\r\n Shader.prototype.setUniform2f = function (uniform, value, value2) {\r\n this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\r\n };\r\n Shader.prototype.setUniform3f = function (uniform, value, value2, value3) {\r\n this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\r\n };\r\n Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) {\r\n this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\r\n };\r\n Shader.prototype.setUniform2x2f = function (uniform, value) {\r\n var gl = this.context.gl;\r\n this.tmp2x2.set(value);\r\n gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\r\n };\r\n Shader.prototype.setUniform3x3f = function (uniform, value) {\r\n var gl = this.context.gl;\r\n this.tmp3x3.set(value);\r\n gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\r\n };\r\n Shader.prototype.setUniform4x4f = function (uniform, value) {\r\n var gl = this.context.gl;\r\n this.tmp4x4.set(value);\r\n gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\r\n };\r\n Shader.prototype.getUniformLocation = function (uniform) {\r\n var gl = this.context.gl;\r\n var location = gl.getUniformLocation(this.program, uniform);\r\n if (!location && !gl.isContextLost())\r\n throw new Error(\"Couldn't find location for uniform \" + uniform);\r\n return location;\r\n };\r\n Shader.prototype.getAttributeLocation = function (attribute) {\r\n var gl = this.context.gl;\r\n var location = gl.getAttribLocation(this.program, attribute);\r\n if (location == -1 && !gl.isContextLost())\r\n throw new Error(\"Couldn't find location for attribute \" + attribute);\r\n return location;\r\n };\r\n Shader.prototype.dispose = function () {\r\n this.context.removeRestorable(this);\r\n var gl = this.context.gl;\r\n if (this.vs) {\r\n gl.deleteShader(this.vs);\r\n this.vs = null;\r\n }\r\n if (this.fs) {\r\n gl.deleteShader(this.fs);\r\n this.fs = null;\r\n }\r\n if (this.program) {\r\n gl.deleteProgram(this.program);\r\n this.program = null;\r\n }\r\n };\r\n Shader.newColoredTextured = function (context) {\r\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_color;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_color = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n var fs = \"\\n\\t\\t\\t\\t#ifdef GL_ES\\n\\t\\t\\t\\t\\t#define LOWP lowp\\n\\t\\t\\t\\t\\tprecision mediump float;\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\t#define LOWP\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tvarying LOWP vec4 v_color;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\t\\t\\t\\tuniform sampler2D u_texture;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n return new Shader(context, vs, fs);\r\n };\r\n Shader.newTwoColoredTextured = function (context) {\r\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_light;\\n\\t\\t\\t\\tvarying vec4 v_dark;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_light = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_dark = \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n var fs = \"\\n\\t\\t\\t\\t#ifdef GL_ES\\n\\t\\t\\t\\t\\t#define LOWP lowp\\n\\t\\t\\t\\t\\tprecision mediump float;\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\t#define LOWP\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tvarying LOWP vec4 v_light;\\n\\t\\t\\t\\tvarying LOWP vec4 v_dark;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\t\\t\\t\\tuniform sampler2D u_texture;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tvec4 texColor = texture2D(u_texture, v_texCoords);\\n\\t\\t\\t\\t\\tgl_FragColor.a = texColor.a * v_light.a;\\n\\t\\t\\t\\t\\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n return new Shader(context, vs, fs);\r\n };\r\n Shader.newColored = function (context) {\r\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_color;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_color = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n var fs = \"\\n\\t\\t\\t\\t#ifdef GL_ES\\n\\t\\t\\t\\t\\t#define LOWP lowp\\n\\t\\t\\t\\t\\tprecision mediump float;\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\t#define LOWP\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tvarying LOWP vec4 v_color;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tgl_FragColor = v_color;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\r\n return new Shader(context, vs, fs);\r\n };\r\n Shader.MVP_MATRIX = \"u_projTrans\";\r\n Shader.POSITION = \"a_position\";\r\n Shader.COLOR = \"a_color\";\r\n Shader.COLOR2 = \"a_color2\";\r\n Shader.TEXCOORDS = \"a_texCoords\";\r\n Shader.SAMPLER = \"u_texture\";\r\n return Shader;\r\n }());\r\n webgl.Shader = Shader;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var ShapeRenderer = (function () {\r\n function ShapeRenderer(context, maxVertices) {\r\n if (maxVertices === void 0) { maxVertices = 10920; }\r\n this.isDrawing = false;\r\n this.shapeType = ShapeType.Filled;\r\n this.color = new spine.Color(1, 1, 1, 1);\r\n this.vertexIndex = 0;\r\n this.tmp = new spine.Vector2();\r\n if (maxVertices > 10920)\r\n throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0);\r\n this.srcBlend = this.context.gl.SRC_ALPHA;\r\n this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\r\n }\r\n ShapeRenderer.prototype.begin = function (shader) {\r\n if (this.isDrawing)\r\n throw new Error(\"ShapeRenderer.begin() has already been called\");\r\n this.shader = shader;\r\n this.vertexIndex = 0;\r\n this.isDrawing = true;\r\n var gl = this.context.gl;\r\n gl.enable(gl.BLEND);\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n };\r\n ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) {\r\n var gl = this.context.gl;\r\n this.srcBlend = srcBlend;\r\n this.dstBlend = dstBlend;\r\n if (this.isDrawing) {\r\n this.flush();\r\n gl.blendFunc(this.srcBlend, this.dstBlend);\r\n }\r\n };\r\n ShapeRenderer.prototype.setColor = function (color) {\r\n this.color.setFromColor(color);\r\n };\r\n ShapeRenderer.prototype.setColorWith = function (r, g, b, a) {\r\n this.color.set(r, g, b, a);\r\n };\r\n ShapeRenderer.prototype.point = function (x, y, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(ShapeType.Point, 1);\r\n if (color === null)\r\n color = this.color;\r\n this.vertex(x, y, color);\r\n };\r\n ShapeRenderer.prototype.line = function (x, y, x2, y2, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(ShapeType.Line, 2);\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n if (color === null)\r\n color = this.color;\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color);\r\n };\r\n ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n if (color === null)\r\n color = this.color;\r\n if (color2 === null)\r\n color2 = this.color;\r\n if (color3 === null)\r\n color3 = this.color;\r\n if (filled) {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x3, y3, color3);\r\n }\r\n else {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x2, y2, color);\r\n this.vertex(x3, y3, color2);\r\n this.vertex(x3, y3, color);\r\n this.vertex(x, y, color2);\r\n }\r\n };\r\n ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\r\n if (color === void 0) { color = null; }\r\n if (color2 === void 0) { color2 = null; }\r\n if (color3 === void 0) { color3 = null; }\r\n if (color4 === void 0) { color4 = null; }\r\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n if (color === null)\r\n color = this.color;\r\n if (color2 === null)\r\n color2 = this.color;\r\n if (color3 === null)\r\n color3 = this.color;\r\n if (color4 === null)\r\n color4 = this.color;\r\n if (filled) {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x4, y4, color4);\r\n this.vertex(x, y, color);\r\n }\r\n else {\r\n this.vertex(x, y, color);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x2, y2, color2);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x3, y3, color3);\r\n this.vertex(x4, y4, color4);\r\n this.vertex(x4, y4, color4);\r\n this.vertex(x, y, color);\r\n }\r\n };\r\n ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) {\r\n if (color === void 0) { color = null; }\r\n this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\r\n };\r\n ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\r\n if (color === null)\r\n color = this.color;\r\n var t = this.tmp.set(y2 - y1, x1 - x2);\r\n t.normalize();\r\n width *= 0.5;\r\n var tx = t.x * width;\r\n var ty = t.y * width;\r\n if (!filled) {\r\n this.vertex(x1 + tx, y1 + ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x2 - tx, y2 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x1 + tx, y1 + ty, color);\r\n this.vertex(x2 - tx, y2 - ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n }\r\n else {\r\n this.vertex(x1 + tx, y1 + ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x2 - tx, y2 - ty, color);\r\n this.vertex(x2 + tx, y2 + ty, color);\r\n this.vertex(x1 - tx, y1 - ty, color);\r\n }\r\n };\r\n ShapeRenderer.prototype.x = function (x, y, size) {\r\n this.line(x - size, y - size, x + size, y + size);\r\n this.line(x - size, y + size, x + size, y - size);\r\n };\r\n ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\r\n if (color === void 0) { color = null; }\r\n if (count < 3)\r\n throw new Error(\"Polygon must contain at least 3 vertices\");\r\n this.check(ShapeType.Line, count * 2);\r\n if (color === null)\r\n color = this.color;\r\n var vertices = this.mesh.getVertices();\r\n var idx = this.vertexIndex;\r\n offset <<= 1;\r\n count <<= 1;\r\n var firstX = polygonVertices[offset];\r\n var firstY = polygonVertices[offset + 1];\r\n var last = offset + count;\r\n for (var i = offset, n = offset + count - 2; i < n; i += 2) {\r\n var x1 = polygonVertices[i];\r\n var y1 = polygonVertices[i + 1];\r\n var x2 = 0;\r\n var y2 = 0;\r\n if (i + 2 >= last) {\r\n x2 = firstX;\r\n y2 = firstY;\r\n }\r\n else {\r\n x2 = polygonVertices[i + 2];\r\n y2 = polygonVertices[i + 3];\r\n }\r\n this.vertex(x1, y1, color);\r\n this.vertex(x2, y2, color);\r\n }\r\n };\r\n ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\r\n if (color === void 0) { color = null; }\r\n if (segments === void 0) { segments = 0; }\r\n if (segments === 0)\r\n segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0);\r\n if (segments <= 0)\r\n throw new Error(\"segments must be > 0.\");\r\n if (color === null)\r\n color = this.color;\r\n var angle = 2 * spine.MathUtils.PI / segments;\r\n var cos = Math.cos(angle);\r\n var sin = Math.sin(angle);\r\n var cx = radius, cy = 0;\r\n if (!filled) {\r\n this.check(ShapeType.Line, segments * 2 + 2);\r\n for (var i = 0; i < segments; i++) {\r\n this.vertex(x + cx, y + cy, color);\r\n var temp_1 = cx;\r\n cx = cos * cx - sin * cy;\r\n cy = sin * temp_1 + cos * cy;\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n else {\r\n this.check(ShapeType.Filled, segments * 3 + 3);\r\n segments--;\r\n for (var i = 0; i < segments; i++) {\r\n this.vertex(x, y, color);\r\n this.vertex(x + cx, y + cy, color);\r\n var temp_2 = cx;\r\n cx = cos * cx - sin * cy;\r\n cy = sin * temp_2 + cos * cy;\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n this.vertex(x, y, color);\r\n this.vertex(x + cx, y + cy, color);\r\n }\r\n var temp = cx;\r\n cx = radius;\r\n cy = 0;\r\n this.vertex(x + cx, y + cy, color);\r\n };\r\n ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\r\n if (color === void 0) { color = null; }\r\n this.check(ShapeType.Line, segments * 2 + 2);\r\n if (color === null)\r\n color = this.color;\r\n var subdiv_step = 1 / segments;\r\n var subdiv_step2 = subdiv_step * subdiv_step;\r\n var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\r\n var pre1 = 3 * subdiv_step;\r\n var pre2 = 3 * subdiv_step2;\r\n var pre4 = 6 * subdiv_step2;\r\n var pre5 = 6 * subdiv_step3;\r\n var tmp1x = x1 - cx1 * 2 + cx2;\r\n var tmp1y = y1 - cy1 * 2 + cy2;\r\n var tmp2x = (cx1 - cx2) * 3 - x1 + x2;\r\n var tmp2y = (cy1 - cy2) * 3 - y1 + y2;\r\n var fx = x1;\r\n var fy = y1;\r\n var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\r\n var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\r\n var ddfx = tmp1x * pre4 + tmp2x * pre5;\r\n var ddfy = tmp1y * pre4 + tmp2y * pre5;\r\n var dddfx = tmp2x * pre5;\r\n var dddfy = tmp2y * pre5;\r\n while (segments-- > 0) {\r\n this.vertex(fx, fy, color);\r\n fx += dfx;\r\n fy += dfy;\r\n dfx += ddfx;\r\n dfy += ddfy;\r\n ddfx += dddfx;\r\n ddfy += dddfy;\r\n this.vertex(fx, fy, color);\r\n }\r\n this.vertex(fx, fy, color);\r\n this.vertex(x2, y2, color);\r\n };\r\n ShapeRenderer.prototype.vertex = function (x, y, color) {\r\n var idx = this.vertexIndex;\r\n var vertices = this.mesh.getVertices();\r\n vertices[idx++] = x;\r\n vertices[idx++] = y;\r\n vertices[idx++] = color.r;\r\n vertices[idx++] = color.g;\r\n vertices[idx++] = color.b;\r\n vertices[idx++] = color.a;\r\n this.vertexIndex = idx;\r\n };\r\n ShapeRenderer.prototype.end = function () {\r\n if (!this.isDrawing)\r\n throw new Error(\"ShapeRenderer.begin() has not been called\");\r\n this.flush();\r\n this.context.gl.disable(this.context.gl.BLEND);\r\n this.isDrawing = false;\r\n };\r\n ShapeRenderer.prototype.flush = function () {\r\n if (this.vertexIndex == 0)\r\n return;\r\n this.mesh.setVerticesLength(this.vertexIndex);\r\n this.mesh.draw(this.shader, this.shapeType);\r\n this.vertexIndex = 0;\r\n };\r\n ShapeRenderer.prototype.check = function (shapeType, numVertices) {\r\n if (!this.isDrawing)\r\n throw new Error(\"ShapeRenderer.begin() has not been called\");\r\n if (this.shapeType == shapeType) {\r\n if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices)\r\n this.flush();\r\n else\r\n return;\r\n }\r\n else {\r\n this.flush();\r\n this.shapeType = shapeType;\r\n }\r\n };\r\n ShapeRenderer.prototype.dispose = function () {\r\n this.mesh.dispose();\r\n };\r\n return ShapeRenderer;\r\n }());\r\n webgl.ShapeRenderer = ShapeRenderer;\r\n var ShapeType;\r\n (function (ShapeType) {\r\n ShapeType[ShapeType[\"Point\"] = 0] = \"Point\";\r\n ShapeType[ShapeType[\"Line\"] = 1] = \"Line\";\r\n ShapeType[ShapeType[\"Filled\"] = 4] = \"Filled\";\r\n })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {}));\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var SkeletonDebugRenderer = (function () {\r\n function SkeletonDebugRenderer(context) {\r\n this.boneLineColor = new spine.Color(1, 0, 0, 1);\r\n this.boneOriginColor = new spine.Color(0, 1, 0, 1);\r\n this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5);\r\n this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5);\r\n this.pathColor = new spine.Color().setFromString(\"FF7F00\");\r\n this.clipColor = new spine.Color(0.8, 0, 0, 2);\r\n this.aabbColor = new spine.Color(0, 1, 0, 0.5);\r\n this.drawBones = true;\r\n this.drawRegionAttachments = true;\r\n this.drawBoundingBoxes = true;\r\n this.drawMeshHull = true;\r\n this.drawMeshTriangles = true;\r\n this.drawPaths = true;\r\n this.drawSkeletonXY = false;\r\n this.drawClipping = true;\r\n this.premultipliedAlpha = false;\r\n this.scale = 1;\r\n this.boneWidth = 2;\r\n this.bounds = new spine.SkeletonBounds();\r\n this.temp = new Array();\r\n this.vertices = spine.Utils.newFloatArray(2 * 1024);\r\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\r\n }\r\n SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) {\r\n if (ignoredBones === void 0) { ignoredBones = null; }\r\n var skeletonX = skeleton.x;\r\n var skeletonY = skeleton.y;\r\n var gl = this.context.gl;\r\n var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\r\n shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA);\r\n var bones = skeleton.bones;\r\n if (this.drawBones) {\r\n shapes.setColor(this.boneLineColor);\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n continue;\r\n if (bone.parent == null)\r\n continue;\r\n var x = skeletonX + bone.data.length * bone.a + bone.worldX;\r\n var y = skeletonY + bone.data.length * bone.c + bone.worldY;\r\n shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale);\r\n }\r\n if (this.drawSkeletonXY)\r\n shapes.x(skeletonX, skeletonY, 4 * this.scale);\r\n }\r\n if (this.drawRegionAttachments) {\r\n shapes.setColor(this.attachmentLineColor);\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n var attachment = slot.getAttachment();\r\n if (attachment instanceof spine.RegionAttachment) {\r\n var regionAttachment = attachment;\r\n var vertices = this.vertices;\r\n regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2);\r\n shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\r\n shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\r\n shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\r\n shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\r\n }\r\n }\r\n }\r\n if (this.drawMeshHull || this.drawMeshTriangles) {\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var attachment = slot.getAttachment();\r\n if (!(attachment instanceof spine.MeshAttachment))\r\n continue;\r\n var mesh = attachment;\r\n var vertices = this.vertices;\r\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\r\n var triangles = mesh.triangles;\r\n var hullLength = mesh.hullLength;\r\n if (this.drawMeshTriangles) {\r\n shapes.setColor(this.triangleLineColor);\r\n for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) {\r\n var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\r\n shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]);\r\n }\r\n }\r\n if (this.drawMeshHull && hullLength > 0) {\r\n shapes.setColor(this.attachmentLineColor);\r\n hullLength = (hullLength >> 1) * 2;\r\n var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\r\n for (var ii = 0, nn = hullLength; ii < nn; ii += 2) {\r\n var x = vertices[ii], y = vertices[ii + 1];\r\n shapes.line(x, y, lastX, lastY);\r\n lastX = x;\r\n lastY = y;\r\n }\r\n }\r\n }\r\n }\r\n if (this.drawBoundingBoxes) {\r\n var bounds = this.bounds;\r\n bounds.update(skeleton, true);\r\n shapes.setColor(this.aabbColor);\r\n shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\r\n var polygons = bounds.polygons;\r\n var boxes = bounds.boundingBoxes;\r\n for (var i = 0, n = polygons.length; i < n; i++) {\r\n var polygon = polygons[i];\r\n shapes.setColor(boxes[i].color);\r\n shapes.polygon(polygon, 0, polygon.length);\r\n }\r\n }\r\n if (this.drawPaths) {\r\n var slots = skeleton.slots;\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var attachment = slot.getAttachment();\r\n if (!(attachment instanceof spine.PathAttachment))\r\n continue;\r\n var path = attachment;\r\n var nn = path.worldVerticesLength;\r\n var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n path.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n var color = this.pathColor;\r\n var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\r\n if (path.closed) {\r\n shapes.setColor(color);\r\n var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\r\n x2 = world[nn - 4];\r\n y2 = world[nn - 3];\r\n shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n shapes.line(x1, y1, cx1, cy1);\r\n shapes.line(x2, y2, cx2, cy2);\r\n }\r\n nn -= 4;\r\n for (var ii = 4; ii < nn; ii += 6) {\r\n var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\r\n x2 = world[ii + 4];\r\n y2 = world[ii + 5];\r\n shapes.setColor(color);\r\n shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\r\n shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\r\n shapes.line(x1, y1, cx1, cy1);\r\n shapes.line(x2, y2, cx2, cy2);\r\n x1 = x2;\r\n y1 = y2;\r\n }\r\n }\r\n }\r\n if (this.drawBones) {\r\n shapes.setColor(this.boneOriginColor);\r\n for (var i = 0, n = bones.length; i < n; i++) {\r\n var bone = bones[i];\r\n if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\r\n continue;\r\n shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);\r\n }\r\n }\r\n if (this.drawClipping) {\r\n var slots = skeleton.slots;\r\n shapes.setColor(this.clipColor);\r\n for (var i = 0, n = slots.length; i < n; i++) {\r\n var slot = slots[i];\r\n if (!slot.bone.active)\r\n continue;\r\n var attachment = slot.getAttachment();\r\n if (!(attachment instanceof spine.ClippingAttachment))\r\n continue;\r\n var clip = attachment;\r\n var nn = clip.worldVerticesLength;\r\n var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\r\n clip.computeWorldVertices(slot, 0, nn, world, 0, 2);\r\n for (var i_17 = 0, n_3 = world.length; i_17 < n_3; i_17 += 2) {\r\n var x = world[i_17];\r\n var y = world[i_17 + 1];\r\n var x2 = world[(i_17 + 2) % world.length];\r\n var y2 = world[(i_17 + 3) % world.length];\r\n shapes.line(x, y, x2, y2);\r\n }\r\n }\r\n }\r\n };\r\n SkeletonDebugRenderer.prototype.dispose = function () {\r\n };\r\n SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1);\r\n SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1);\r\n return SkeletonDebugRenderer;\r\n }());\r\n webgl.SkeletonDebugRenderer = SkeletonDebugRenderer;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Renderable = (function () {\r\n function Renderable(vertices, numVertices, numFloats) {\r\n this.vertices = vertices;\r\n this.numVertices = numVertices;\r\n this.numFloats = numFloats;\r\n }\r\n return Renderable;\r\n }());\r\n ;\r\n var SkeletonRenderer = (function () {\r\n function SkeletonRenderer(context, twoColorTint) {\r\n if (twoColorTint === void 0) { twoColorTint = true; }\r\n this.premultipliedAlpha = false;\r\n this.vertexEffect = null;\r\n this.tempColor = new spine.Color();\r\n this.tempColor2 = new spine.Color();\r\n this.vertexSize = 2 + 2 + 4;\r\n this.twoColorTint = false;\r\n this.renderable = new Renderable(null, 0, 0);\r\n this.clipper = new spine.SkeletonClipping();\r\n this.temp = new spine.Vector2();\r\n this.temp2 = new spine.Vector2();\r\n this.temp3 = new spine.Color();\r\n this.temp4 = new spine.Color();\r\n this.twoColorTint = twoColorTint;\r\n if (twoColorTint)\r\n this.vertexSize += 4;\r\n this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024);\r\n }\r\n SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) {\r\n if (slotRangeStart === void 0) { slotRangeStart = -1; }\r\n if (slotRangeEnd === void 0) { slotRangeEnd = -1; }\r\n var clipper = this.clipper;\r\n var premultipliedAlpha = this.premultipliedAlpha;\r\n var twoColorTint = this.twoColorTint;\r\n var blendMode = null;\r\n var tempPos = this.temp;\r\n var tempUv = this.temp2;\r\n var tempLight = this.temp3;\r\n var tempDark = this.temp4;\r\n var renderable = this.renderable;\r\n var uvs = null;\r\n var triangles = null;\r\n var drawOrder = skeleton.drawOrder;\r\n var attachmentColor = null;\r\n var skeletonColor = skeleton.color;\r\n var vertexSize = twoColorTint ? 12 : 8;\r\n var inRange = false;\r\n if (slotRangeStart == -1)\r\n inRange = true;\r\n for (var i = 0, n = drawOrder.length; i < n; i++) {\r\n var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\r\n var slot = drawOrder[i];\r\n if (!slot.bone.active) {\r\n clipper.clipEndWithSlot(slot);\r\n continue;\r\n }\r\n if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\r\n inRange = true;\r\n }\r\n if (!inRange) {\r\n clipper.clipEndWithSlot(slot);\r\n continue;\r\n }\r\n if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\r\n inRange = false;\r\n }\r\n var attachment = slot.getAttachment();\r\n var texture = null;\r\n if (attachment instanceof spine.RegionAttachment) {\r\n var region = attachment;\r\n renderable.vertices = this.vertices;\r\n renderable.numVertices = 4;\r\n renderable.numFloats = clippedVertexSize << 2;\r\n region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize);\r\n triangles = SkeletonRenderer.QUAD_TRIANGLES;\r\n uvs = region.uvs;\r\n texture = region.region.renderObject.texture;\r\n attachmentColor = region.color;\r\n }\r\n else if (attachment instanceof spine.MeshAttachment) {\r\n var mesh = attachment;\r\n renderable.vertices = this.vertices;\r\n renderable.numVertices = (mesh.worldVerticesLength >> 1);\r\n renderable.numFloats = renderable.numVertices * clippedVertexSize;\r\n if (renderable.numFloats > renderable.vertices.length) {\r\n renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats);\r\n }\r\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\r\n triangles = mesh.triangles;\r\n texture = mesh.region.renderObject.texture;\r\n uvs = mesh.uvs;\r\n attachmentColor = mesh.color;\r\n }\r\n else if (attachment instanceof spine.ClippingAttachment) {\r\n var clip = (attachment);\r\n clipper.clipStart(slot, clip);\r\n continue;\r\n }\r\n else {\r\n clipper.clipEndWithSlot(slot);\r\n continue;\r\n }\r\n if (texture != null) {\r\n var slotColor = slot.color;\r\n var finalColor = this.tempColor;\r\n finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\r\n finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\r\n finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\r\n finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\r\n if (premultipliedAlpha) {\r\n finalColor.r *= finalColor.a;\r\n finalColor.g *= finalColor.a;\r\n finalColor.b *= finalColor.a;\r\n }\r\n var darkColor = this.tempColor2;\r\n if (slot.darkColor == null)\r\n darkColor.set(0, 0, 0, 1.0);\r\n else {\r\n if (premultipliedAlpha) {\r\n darkColor.r = slot.darkColor.r * finalColor.a;\r\n darkColor.g = slot.darkColor.g * finalColor.a;\r\n darkColor.b = slot.darkColor.b * finalColor.a;\r\n }\r\n else {\r\n darkColor.setFromColor(slot.darkColor);\r\n }\r\n darkColor.a = premultipliedAlpha ? 1.0 : 0.0;\r\n }\r\n var slotBlendMode = slot.data.blendMode;\r\n if (slotBlendMode != blendMode) {\r\n blendMode = slotBlendMode;\r\n batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode));\r\n }\r\n if (clipper.isClipping()) {\r\n clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\r\n var clippedVertices = new Float32Array(clipper.clippedVertices);\r\n var clippedTriangles = clipper.clippedTriangles;\r\n if (this.vertexEffect != null) {\r\n var vertexEffect = this.vertexEffect;\r\n var verts = clippedVertices;\r\n if (!twoColorTint) {\r\n for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n tempUv.x = verts[v + 6];\r\n tempUv.y = verts[v + 7];\r\n tempDark.set(0, 0, 0, 0);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n }\r\n }\r\n else {\r\n for (var v = 0, n_5 = clippedVertices.length; v < n_5; v += vertexSize) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\r\n tempUv.x = verts[v + 6];\r\n tempUv.y = verts[v + 7];\r\n tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n verts[v + 8] = tempDark.r;\r\n verts[v + 9] = tempDark.g;\r\n verts[v + 10] = tempDark.b;\r\n verts[v + 11] = tempDark.a;\r\n }\r\n }\r\n }\r\n batcher.draw(texture, clippedVertices, clippedTriangles);\r\n }\r\n else {\r\n var verts = renderable.vertices;\r\n if (this.vertexEffect != null) {\r\n var vertexEffect = this.vertexEffect;\r\n if (!twoColorTint) {\r\n for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempUv.x = uvs[u];\r\n tempUv.y = uvs[u + 1];\r\n tempLight.setFromColor(finalColor);\r\n tempDark.set(0, 0, 0, 0);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n }\r\n }\r\n else {\r\n for (var v = 0, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) {\r\n tempPos.x = verts[v];\r\n tempPos.y = verts[v + 1];\r\n tempUv.x = uvs[u];\r\n tempUv.y = uvs[u + 1];\r\n tempLight.setFromColor(finalColor);\r\n tempDark.setFromColor(darkColor);\r\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\r\n verts[v] = tempPos.x;\r\n verts[v + 1] = tempPos.y;\r\n verts[v + 2] = tempLight.r;\r\n verts[v + 3] = tempLight.g;\r\n verts[v + 4] = tempLight.b;\r\n verts[v + 5] = tempLight.a;\r\n verts[v + 6] = tempUv.x;\r\n verts[v + 7] = tempUv.y;\r\n verts[v + 8] = tempDark.r;\r\n verts[v + 9] = tempDark.g;\r\n verts[v + 10] = tempDark.b;\r\n verts[v + 11] = tempDark.a;\r\n }\r\n }\r\n }\r\n else {\r\n if (!twoColorTint) {\r\n for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) {\r\n verts[v] = finalColor.r;\r\n verts[v + 1] = finalColor.g;\r\n verts[v + 2] = finalColor.b;\r\n verts[v + 3] = finalColor.a;\r\n verts[v + 4] = uvs[u];\r\n verts[v + 5] = uvs[u + 1];\r\n }\r\n }\r\n else {\r\n for (var v = 2, u = 0, n_9 = renderable.numFloats; v < n_9; v += vertexSize, u += 2) {\r\n verts[v] = finalColor.r;\r\n verts[v + 1] = finalColor.g;\r\n verts[v + 2] = finalColor.b;\r\n verts[v + 3] = finalColor.a;\r\n verts[v + 4] = uvs[u];\r\n verts[v + 5] = uvs[u + 1];\r\n verts[v + 6] = darkColor.r;\r\n verts[v + 7] = darkColor.g;\r\n verts[v + 8] = darkColor.b;\r\n verts[v + 9] = darkColor.a;\r\n }\r\n }\r\n }\r\n var view = renderable.vertices.subarray(0, renderable.numFloats);\r\n batcher.draw(texture, view, triangles);\r\n }\r\n }\r\n clipper.clipEndWithSlot(slot);\r\n }\r\n clipper.clipEnd();\r\n };\r\n SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\r\n return SkeletonRenderer;\r\n }());\r\n webgl.SkeletonRenderer = SkeletonRenderer;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var Vector3 = (function () {\r\n function Vector3(x, y, z) {\r\n if (x === void 0) { x = 0; }\r\n if (y === void 0) { y = 0; }\r\n if (z === void 0) { z = 0; }\r\n this.x = 0;\r\n this.y = 0;\r\n this.z = 0;\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n }\r\n Vector3.prototype.setFrom = function (v) {\r\n this.x = v.x;\r\n this.y = v.y;\r\n this.z = v.z;\r\n return this;\r\n };\r\n Vector3.prototype.set = function (x, y, z) {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n return this;\r\n };\r\n Vector3.prototype.add = function (v) {\r\n this.x += v.x;\r\n this.y += v.y;\r\n this.z += v.z;\r\n return this;\r\n };\r\n Vector3.prototype.sub = function (v) {\r\n this.x -= v.x;\r\n this.y -= v.y;\r\n this.z -= v.z;\r\n return this;\r\n };\r\n Vector3.prototype.scale = function (s) {\r\n this.x *= s;\r\n this.y *= s;\r\n this.z *= s;\r\n return this;\r\n };\r\n Vector3.prototype.normalize = function () {\r\n var len = this.length();\r\n if (len == 0)\r\n return this;\r\n len = 1 / len;\r\n this.x *= len;\r\n this.y *= len;\r\n this.z *= len;\r\n return this;\r\n };\r\n Vector3.prototype.cross = function (v) {\r\n return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);\r\n };\r\n Vector3.prototype.multiply = function (matrix) {\r\n var l_mat = matrix.values;\r\n return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]);\r\n };\r\n Vector3.prototype.project = function (matrix) {\r\n var l_mat = matrix.values;\r\n var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]);\r\n return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w);\r\n };\r\n Vector3.prototype.dot = function (v) {\r\n return this.x * v.x + this.y * v.y + this.z * v.z;\r\n };\r\n Vector3.prototype.length = function () {\r\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\r\n };\r\n Vector3.prototype.distance = function (v) {\r\n var a = v.x - this.x;\r\n var b = v.y - this.y;\r\n var c = v.z - this.z;\r\n return Math.sqrt(a * a + b * b + c * c);\r\n };\r\n return Vector3;\r\n }());\r\n webgl.Vector3 = Vector3;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\nvar spine;\r\n(function (spine) {\r\n var webgl;\r\n (function (webgl) {\r\n var ManagedWebGLRenderingContext = (function () {\r\n function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) {\r\n var _this = this;\r\n if (contextConfig === void 0) { contextConfig = { alpha: \"true\" }; }\r\n this.restorables = new Array();\r\n if (canvasOrContext instanceof HTMLCanvasElement) {\r\n var canvas_1 = canvasOrContext;\r\n this.gl = (canvas_1.getContext(\"webgl2\", contextConfig) || canvas_1.getContext(\"webgl\", contextConfig));\r\n this.canvas = canvas_1;\r\n canvas_1.addEventListener(\"webglcontextlost\", function (e) {\r\n var event = e;\r\n if (e) {\r\n e.preventDefault();\r\n }\r\n });\r\n canvas_1.addEventListener(\"webglcontextrestored\", function (e) {\r\n for (var i = 0, n = _this.restorables.length; i < n; i++) {\r\n _this.restorables[i].restore();\r\n }\r\n });\r\n }\r\n else {\r\n this.gl = canvasOrContext;\r\n this.canvas = this.gl.canvas;\r\n }\r\n }\r\n ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) {\r\n this.restorables.push(restorable);\r\n };\r\n ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) {\r\n var index = this.restorables.indexOf(restorable);\r\n if (index > -1)\r\n this.restorables.splice(index, 1);\r\n };\r\n return ManagedWebGLRenderingContext;\r\n }());\r\n webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext;\r\n var WebGLBlendModeConverter = (function () {\r\n function WebGLBlendModeConverter() {\r\n }\r\n WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) {\r\n switch (blendMode) {\r\n case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE;\r\n case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\r\n default: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n }\r\n };\r\n WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) {\r\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\r\n switch (blendMode) {\r\n case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\r\n case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR;\r\n case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE;\r\n default: throw new Error(\"Unknown blend mode: \" + blendMode);\r\n }\r\n };\r\n WebGLBlendModeConverter.ZERO = 0;\r\n WebGLBlendModeConverter.ONE = 1;\r\n WebGLBlendModeConverter.SRC_COLOR = 0x0300;\r\n WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301;\r\n WebGLBlendModeConverter.SRC_ALPHA = 0x0302;\r\n WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303;\r\n WebGLBlendModeConverter.DST_ALPHA = 0x0304;\r\n WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305;\r\n WebGLBlendModeConverter.DST_COLOR = 0x0306;\r\n return WebGLBlendModeConverter;\r\n }());\r\n webgl.WebGLBlendModeConverter = WebGLBlendModeConverter;\r\n })(webgl = spine.webgl || (spine.webgl = {}));\r\n})(spine || (spine = {}));\r\n//# sourceMappingURL=spine-both.js.map\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = spine;\n\n}.call(window));\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:////Users/rich/Documents/GitHub/phaser/node_modules/eventemitter3/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/BLUR_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/BOOT_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/CONTEXT_LOST_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/CONTEXT_RESTORED_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/DESTROY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/FOCUS_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/HIDDEN_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/PAUSE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/POST_RENDER_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/POST_STEP_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/PRE_RENDER_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/PRE_STEP_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/READY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/RESUME_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/STEP_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/VISIBLE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/core/events/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/data/DataManager.js","webpack:////Users/rich/Documents/GitHub/phaser/src/data/events/CHANGE_DATA_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/data/events/CHANGE_DATA_KEY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/data/events/DESTROY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/data/events/REMOVE_DATA_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/data/events/SET_DATA_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/data/events/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/display/mask/BitmapMask.js","webpack:////Users/rich/Documents/GitHub/phaser/src/display/mask/GeometryMask.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/BuildGameObject.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/GameObject.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/GetCalcMatrix.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Alpha.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/AlphaSingle.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/BlendMode.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/ComputedSize.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Crop.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Depth.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Flip.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/GetBounds.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Mask.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Origin.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/PathFollower.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Pipeline.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/ScrollFactor.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Size.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Texture.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/TextureCrop.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Tint.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/ToJSON.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Transform.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/TransformMatrix.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/Visible.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/components/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/container/Container.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/container/ContainerCanvasRenderer.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/container/ContainerRender.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/container/ContainerWebGLRenderer.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/ADDED_TO_SCENE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/DESTROY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/REMOVED_FROM_SCENE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_COMPLETE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_CREATED_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_ERROR_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_LOOP_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_PLAY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_SEEKED_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_SEEKING_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_STOP_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_TIMEOUT_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/VIDEO_UNLOCKED_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/gameobjects/events/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/const.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/line/GetPoint.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/line/GetPoints.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/line/Length.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/line/Line.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/line/Random.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/point/Point.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Contains.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/rectangle/GetPoint.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/rectangle/GetPoints.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Perimeter.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Random.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Rectangle.js","webpack:////Users/rich/Documents/GitHub/phaser/src/geom/rectangle/Union.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/File.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/FileTypesManager.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/GetURL.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/MergeXHRSettings.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/MultiFile.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/XHRLoader.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/XHRSettings.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/const.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/ADD_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/COMPLETE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_COMPLETE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_KEY_COMPLETE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_LOAD_ERROR_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_LOAD_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/FILE_PROGRESS_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/POST_PROCESS_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/PROGRESS_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/START_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/events/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/filetypes/ImageFile.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/filetypes/JSONFile.js","webpack:////Users/rich/Documents/GitHub/phaser/src/loader/filetypes/TextFile.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Average.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Bernstein.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Between.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/CatmullRom.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/CeilTo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Clamp.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/DegToRad.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Difference.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Euler.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Factorial.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/FloatBetween.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/FloorTo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/FromPercent.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/GetSpeed.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/IsEven.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/IsEvenStrict.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Linear.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Matrix3.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Matrix4.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/MaxAdd.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/MinSub.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Percent.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Quaternion.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RadToDeg.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RandomXY.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RandomXYZ.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RandomXYZW.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Rotate.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RotateAround.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RotateAroundDistance.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RotateTo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RotateVec3.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RoundAwayFromZero.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/RoundTo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/SinCosTableGenerator.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/SmoothStep.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/SmootherStep.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/ToXY.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/TransformXY.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Vector2.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Vector3.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Vector4.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Within.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/Wrap.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/Between.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/BetweenPoints.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/BetweenPointsY.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/BetweenY.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/CounterClockwise.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/Normalize.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/Random.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/RandomDegrees.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/Reverse.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/RotateTo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/ShortestBetween.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/Wrap.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/WrapDegrees.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/angle/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/const.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceBetween.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceBetweenPoints.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceBetweenPointsSquared.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceChebyshev.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/DistancePower.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceSnake.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/DistanceSquared.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/distance/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/back/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/back/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/back/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/back/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/bounce/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/circular/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/circular/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/circular/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/circular/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/cubic/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/elastic/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/expo/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/expo/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/expo/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/expo/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/linear/Linear.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/linear/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quadratic/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quartic/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/quintic/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/sine/In.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/sine/InOut.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/sine/Out.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/sine/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/stepped/Stepped.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/easing/stepped/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/fuzzy/Ceil.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/fuzzy/Equal.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/fuzzy/Floor.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/fuzzy/GreaterThan.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/fuzzy/LessThan.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/fuzzy/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/BezierInterpolation.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/CatmullRomInterpolation.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/CubicBezierInterpolation.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/LinearInterpolation.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/QuadraticBezierInterpolation.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/SmoothStepInterpolation.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/SmootherStepInterpolation.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/interpolation/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/pow2/GetPowerOfTwo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/pow2/IsSizePowerOfTwo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/pow2/IsValuePowerOfTwo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/pow2/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/random-data-generator/RandomDataGenerator.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/snap/SnapCeil.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/snap/SnapFloor.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/snap/SnapTo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/math/snap/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/plugins/BasePlugin.js","webpack:////Users/rich/Documents/GitHub/phaser/src/plugins/ScenePlugin.js","webpack:////Users/rich/Documents/GitHub/phaser/src/renderer/BlendModes.js","webpack:////Users/rich/Documents/GitHub/phaser/src/renderer/events/POST_RENDER_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/renderer/events/PRE_RENDER_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/renderer/events/RENDER_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/renderer/events/RESIZE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/renderer/events/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/renderer/webgl/pipelines/const.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scale/events/RESIZE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/ADDED_TO_SCENE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/BOOT_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/CREATE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/DESTROY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/PAUSE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/POST_UPDATE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/PRE_UPDATE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/READY_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/REMOVED_FROM_SCENE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/RENDER_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/RESUME_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/SHUTDOWN_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/SLEEP_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/START_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_COMPLETE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_INIT_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_OUT_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_START_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/TRANSITION_WAKE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/UPDATE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/WAKE_EVENT.js","webpack:////Users/rich/Documents/GitHub/phaser/src/scene/events/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/tweens/builders/GetBoolean.js","webpack:////Users/rich/Documents/GitHub/phaser/src/tweens/tween/const.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/Class.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/NOOP.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/Add.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/AddAt.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/BringToTop.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/CountAllMatching.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/Each.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/EachInRange.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/FindClosestInSorted.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/GetAll.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/GetFirst.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/GetRandom.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/MoveDown.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/MoveTo.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/MoveUp.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/NumberArray.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/NumberArrayStep.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/QuickSelect.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/Range.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/Remove.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/RemoveAt.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/RemoveBetween.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/RemoveRandomElement.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/Replace.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/RotateLeft.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/RotateRight.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/SafeRange.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/SendToBack.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/SetAll.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/Shuffle.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/SortByDigits.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/SpliceOne.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/StableSort.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/Swap.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/CheckMatrix.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/MatrixToString.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/ReverseColumns.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/ReverseRows.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/Rotate180.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/RotateLeft.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/RotateMatrix.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/RotateRight.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/TranslateMatrix.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/TransposeMatrix.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/array/matrix/index.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/object/DeepCopy.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/object/Extend.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/object/GetAdvancedValue.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/object/GetFastValue.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/object/GetValue.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/object/IsPlainObject.js","webpack:////Users/rich/Documents/GitHub/phaser/src/utils/string/Pad.js","webpack:///./SpineFile.js","webpack:///./SpinePlugin.js","webpack:///./container/SpineContainer.js","webpack:///./container/SpineContainerCanvasRenderer.js","webpack:///./container/SpineContainerRender.js","webpack:///./container/SpineContainerWebGLRenderer.js","webpack:///./events/COMPLETE_EVENT.js","webpack:///./events/DISPOSE_EVENT.js","webpack:///./events/END_EVENT.js","webpack:///./events/EVENT_EVENT.js","webpack:///./events/INTERRUPTED_EVENT.js","webpack:///./events/START_EVENT.js","webpack:///./events/index.js","webpack:///./gameobject/SpineGameObject.js","webpack:///./gameobject/SpineGameObjectCanvasRenderer.js","webpack:///./gameobject/SpineGameObjectRender.js","webpack:///./gameobject/SpineGameObjectWebGLRenderer.js","webpack:///./runtimes/spine-both.js"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,gBAAgB;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,yDAAyD,OAAO;AAChE;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,yCAAyC,SAAS;AAClD;AACA;;AAEA;AACA,GAAG;AACH;AACA;;AAEA,eAAe,YAAY;AAC3B;;AAEA;AACA,2DAA2D;AAC3D,+DAA+D;AAC/D,mEAAmE;AACnE,uEAAuE;AACvE;AACA,0DAA0D,SAAS;AACnE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,aAAa,aAAa;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW,SAAS;AACpB,WAAW,EAAE;AACb,WAAW,QAAQ;AACnB,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,2DAA2D,YAAY;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,aAAa,aAAa;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI,IAA6B;AACjC;AACA;;;;;;;;;;;;AC/UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW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,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2DAA2D;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,aAAa;;AAEb;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,sCAAsC,kBAAkB;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC5rBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,IAAI;AACf,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,OAAO;AAClB,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,qBAAqB,mBAAO,CAAC,kFAAyB;AACtD,aAAa,mBAAO,CAAC,kEAAiB;AACtC,iBAAiB,mBAAO,CAAC,0EAAqB;AAC9C,cAAc,mBAAO,CAAC,oEAAkB;;AAExC;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,4DAAmB;AAC5C,mBAAmB,mBAAO,CAAC,oEAAuB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,8BAA8B;AACzC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4EAA4E;AAC3F;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACtTA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,4BAA4B;AACvC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4BAA4B;AAC3C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC,6BAA6B;;AAE9D;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,eAAe,8BAA8B;AAC7C,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sCAAsC;AACrD,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sCAAsC;AACrD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACzTA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,mEAAwB;AACjD,uBAAuB,mBAAO,CAAC,uFAAkC;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,8BAA8B;AACzC,WAAW,0CAA0C;AACrD;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,iBAAiB,WAAW,KAAK,SAAS;;AAE1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,kBAAkB,KAAK,gBAAgB;;AAExD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,iBAAiB,cAAc,KAAK,UAAU;;AAE9C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,uBAAuB,mBAAO,CAAC,0EAAqB;AACpD,kBAAkB,mBAAO,CAAC,6DAAqB;AAC/C,mBAAmB,mBAAO,CAAC,mEAAe;AAC1C,aAAa,mBAAO,CAAC,0DAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2DAA2D;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,EAAE;AACjB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D,eAAe,mCAAmC;AAClD,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,wCAAwC;AACxD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxuBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,sBAAsB,mBAAO,CAAC,4FAA8B;;AAE5D;AACA;AACA;;AAEA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA,YAAY,8CAA8C;AAC1D;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,oDAAkB;;AAEtC;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;AChSA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,oDAAkB;;AAEtC;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACvGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sEAA2B;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACnHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+BAA+B;AAC9C,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;;AAEA;;;;;;;;;;;;ACtHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC1FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC7JA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,m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A;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AChWA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,8EAA+B;AACxD,mBAAmB,mBAAO,CAAC,kFAAiC;;AAE5D;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kEAAkE;AACjF;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,wCAAwC,qBAAqB;;AAE7D;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,gCAAgC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4BAA4B;AAC3C;AACA,gBAAgB,kCAAkC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,SAAS;AACvC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpMA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0DAAqB;AAC5C,iBAAiB,mBAAO,CAAC,oFAAkC;AAC3D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,kBAAkB,mBAAO,CAAC,oEAA0B;AACpD,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,2BAA2B,uDAAuD;AAClF;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC,eAAe,uGAAuG;AACtH;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,0BAA0B;;AAE7D;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,YAAY;;AAE/C;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uGAAuG,WAAW;AACjI,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,aAAa;AAChD,oCAAoC,aAAa;;AAEjD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpaA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0EAA6B;AACpD,qBAAqB,mBAAO,CAAC,4FAAsC;AACnE,gBAAgB,mBAAO,CAAC,0EAA6B;;AAErD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,qCAAqC,0CAA0C;;AAE/E;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sIAAsI;AACrJ,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B,sBAAsB;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iEAAiE;AAChF;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,+CAA+C,4BAA4B;AAC3E,sCAAsC,mBAAmB;;AAEzD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA,sCAAsC,mBAAmB;;AAEzD;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sDAAsD;AACrE;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,uBAAuB,sBAAsB;AAC7C;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACxYA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,oBAAoB;;AAEtD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACpLA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iCAAiC;AAChD,eAAe,gBAAgB;AAC/B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D,yCAAyC,qBAAqB;;AAE9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC3HA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+BAA+B;AAC9C,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,uCAAuC,mBAAmB;AAC1D,yCAAyC,qBAAqB;;AAE9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,gBAAgB;AAChB;;AAEA;;AAEA;;;;;;;;;;;;ACzMA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,oBAAoB;;AAExD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACtOA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA,YAAY,wCAAwC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,sBAAsB,mBAAO,CAAC,iFAAmB;AACjD,kBAAkB,mBAAO,CAAC,gEAAwB;AAClD,gBAAgB,mBAAO,CAAC,8DAAuB;AAC/C,uBAAuB,mBAAO,CAAC,4EAA8B;AAC7D,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ,gDAAgD;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,4FAA4F;AAC3G;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,qCAAqC,mBAAmB;AACxD,qCAAqC,mBAAmB;AACxD,qCAAqC,mBAAmB;;AAExD;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,oCAAoC;AACtE,mCAAmC,sCAAsC;;AAEzE;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,oCAAoC,aAAa;;AAEjD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,QAAQ,mDAAmD;AAC3D;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;;AAE3E;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA,uCAAuC,oCAAoC;AAC3E,yCAAyC,sCAAsC;;AAE/E;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,qBAAqB,uBAAuB;AAC5C,sBAAsB,sCAAsC;;AAE5D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC5lBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,oDAAkB;AAC3C,cAAc,mBAAO,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,qDAAqD;AACrE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,kCAAkC,UAAU,cAAc;;AAE1D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8CAA8C;AAC7D;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,yBAAyB;AACxC;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,MAAM;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACr/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,cAAc;;AAEd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,WAAW,mBAAO,CAAC,6DAAS;AAC5B,iBAAiB,mBAAO,CAAC,yEAAe;AACxC,eAAe,mBAAO,CAAC,qEAAa;AACpC,kBAAkB,mBAAO,CAAC,2EAAgB;AAC1C,UAAU,mBAAO,CAAC,2DAAQ;AAC1B,WAAW,mBA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AW,aAAa;AACxB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,gCAAgC;AAC3C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC;AACA,gBAAgB,sBAAsB;AACtC;AACA;AACA;AACA,mCAAmC,0BAA0B;;AAE7D;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,2BAA2B,qBAAqB;AAChD;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,+CAA+C;AAC9D,eAAe,+CAA+C;AAC9D;AACA,gBAAgB,+CAA+C;AAC/D;AACA;AACA;AACA,mCAAmC,wBAAwB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8CAA8C;AAC9D;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,EAAE;AACjB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,+BAA+B;AAC/C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,gCAAgC;AAChD;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C,eAAe,8BAA8B;AAC7C,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,IAAI;AACnB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,EAAE;AACjB,eAAe,KAAK;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA,mBAAmB,SAAS;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,eAAe,KAAK;AACpB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,2CAA2C,wBAAwB;;AAEnE;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACp1CA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,6BAA6B;AACxC,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnGA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,oDAAkB;AAC5C,mBAAmB,mBAAO,CAAC,oDAAkB;;AAE7C,IAAI,IAAqB;AACzB;AACA,kBAAkB,mBAAO,CAAC,8FAA0B;AACpD;;AAEA,IAAI,IAAsB;AAC1B;AACA,mBAAmB,mBAAO,CAAC,gGAA2B;AACtD;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,6BAA6B;AACxC,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/IA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,MAAM;AACjB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB,mBAAO,CAAC,uFAAwB;AACpD,aAAa,mBAAO,CAAC,yEAAiB;AACtC,wBAAwB,mBAAO,CAAC,+FAA4B;AAC5D,oBAAoB,mBAAO,CAAC,uFAAwB;AACpD,mBAAmB,mBAAO,CAAC,qFAAuB;AAClD,iBAAiB,mBAAO,CAAC,iFAAqB;AAC9C,gBAAgB,mBAAO,CAAC,+EAAoB;AAC5C,gBAAgB,mBAAO,CAAC,+EAAoB;AAC5C,kBAAkB,mBAAO,CAAC,mFAAsB;AAChD,mBAAmB,mBAAO,CAAC,qFAAuB;AAClD,gBAAgB,mBAAO,CAAC,+EAAoB;AAC5C,mBAAmB,mBAAO,CAAC,qFAAuB;AAClD,oBAAoB,mBAAO,CAAC,uFAAwB;;AAEpD;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc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,CAAC,wDAAoB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA,eAAe,OAAO;AACtB,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,4BAA4B;AAC3C;AACA,gBAAgB,4BAA4B;AAC5C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;AACvC,+BAA+B,QAAQ;;AAEvC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,iCAAiC,sBAAsB;;AAEvD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,iCAAiC,sBAAsB;;AAEvD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA,WAAW,iBAAiB;AAC5B,WAAW,2BAA2B;AACtC;AACA,YAAY,2BAA2B;AACvC;AACA;AACA;AACA,4BAA4B,mBAAmB;;AAE/C;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,iBAAiB,mBAAO,CAAC,4CAAU;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,6DAAa;AACrC,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,2BAA2B;AACtC;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA,4BAA4B,mBAAmB;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC1EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,2DAAY;AACnC,gBAAgB,mBAAO,CAAC,6DAAa;;AAErC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,4BAA4B;AACvC;AACA,YAAY,4BAA4B;AACxC;AACA;AACA;AACA,4BAA4B,UAAU;;AAEtC;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,cAAc;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,wDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA,WAAW,sBAAsB;AACjC,WAAW,kBAAkB;AAC7B;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA,4BAA4B,mBAAmB;;AAE/C;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,eAAe,mBAAO,CAAC,2DAAY;AACnC,eAAe,mBAAO,CAAC,2DAAY;AACnC,gBAAgB,mBAAO,CAAC,6DAAa;AACrC,iBAAiB,mBAAO,CAAC,4CAAU;AACnC,WAAW,mBAAO,CAAC,oDAAc;AACjC,aAAa,mBAAO,CAAC,uDAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,WAAW;AAC7C,mCAAmC,YAAY;;AAE/C;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA,eAAe,OAAO;AACtB,eAAe,2BAA2B;AAC1C;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oBAAoB;AACrC;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,4BAA4B;AAC3C;AACA,gBAAgB,4BAA4B;AAC5C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA,eAAe,kBAAkB;AACjC;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,gBAAgB;;AAEnD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA,eAAe,iBAAiB;AAChC;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,mBAAmB;;AAEpD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACxfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,6DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA,WAAW,sBAAsB;AACjC,WAAW,sBAAsB;AACjC,WAAW,sBAAsB;AACjC;AACA,YAAY,sBAAsB;AAClC;AACA;AACA;AACA,4BAA4B,uBAAuB;;AAEnD;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,YAAY,mBAAO,CAAC,6CAAS;AAC7B,aAAa,mBAAO,CAAC,qDAAU;AAC/B,mBAAmB,mBAAO,CAAC,+EAA8B;AACzD,aAAa,mBAAO,CAAC,+CAAU;AAC/B,uBAAuB,mBAAO,CAAC,mEAAoB;AACnD,gBAAgB,mBAAO,CAAC,qDAAa;AACrC,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,+BAA+B;AAC1C;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA,4GAA4G;AAC5G;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA,2DAA2D;;AAE3D;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B,eAAe,cAAc;AAC7B;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kBAAkB;;AAEnD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B,WAAW,KAAK;AAChB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iEAAiE;AACjE;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA,WAAW,iBAAiB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC/hBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;AC9DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,mEAAwB;AAC7C,kBAAkB,mBAAO,CAAC,yDAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,sCAAsC;AACjD;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,mEAAmE;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,wBAAwB;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC9OA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,mEAAoB;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,sCAAsC;AACjD;AACA,YAAY,eAAe;AAC3B;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC1EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,sCAAsC;AAClD;AACA;AACA;AACA,qCAAqC,mBAAmB;AACxD,8BAA8B,cAAc;AAC5C,6BAA6B,WAAW;AACxC,iCAAiC,eAAe;AAChD,gCAAgC,aAAa;AAC7C,wCAAwC,yBAAyB;;AAEjE;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACjJA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,2BAA2B;AACtC,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,uDAAuD;AACjJ;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,oFAAoF,mDAAmD;AACvI;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO,wBAAwB,8BAA8B;AACxE,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,mBAAmB;AAC9B;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAA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BAA2B;AACtC,WAAW,uDAAuD;AAClE,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD,WAAW,+CAA+C;AAC1D;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,uGAAuG;AAClH,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC3QA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,eAAe,mBAAO,CAAC,0EAA6B;AACpD,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,gBAAgB;AAC3B,WAAW,sCAAsC;AACjD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,QAAQ;AACR,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,gBAAgB;AAC3B,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC/NA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;AACvC,YAAY,mBAAO,CAAC,8CAAU;AAC9B,WAAW,mBAAO,CAAC,4CAAS;AAC5B,uBAAuB,mBAAO,CAAC,oEAAqB;AACpD,mBAAmB,mBAAO,CAAC,kFAAiC;AAC5D,oBAAoB,mBAAO,CAAC,oFAAkC;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,sDAAsD;AACjE,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qGAAqG;AAChH,WAAW,OAAO;AAClB,WAAW,sCAAsC;AACjD;AACA,YAAY,KAAK;AACjB;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;;;;;;;;;;;;AC5KA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,mDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;AAC7B,YAAY,mBAAO,CAAC,mDAAgB;AACpC,cAAc,mBAAO,CAAC,+CAAW;AACjC,WAAW,mBAAO,CAAC,iDAAe;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,8BAA8B,OAAO;AACrC,kCAAkC,4BAA4B;;AAE9D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,kCAAkC,qBAAqB;;AAEvD;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,kCAAkC,qBAAqB;AACvD,mCAAmC,gBAAgB;;AAEnD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA,kCAAkC,qBAAqB;AACvD,mCAAmC,gBAAgB;;AAEnD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;AAEA;;AAEA;;;;;;;;;;;;ACpRA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC1kBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,uBAAuB;AACtC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1vDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,eAAe;;AAE3C;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,cAAc,mBAAO,CAAC,+CAAW;AACjC,WAAW,mBAAO,CAAC,iDAAe;AAClC,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA,mCAAmC,eAAe;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6CAA6C;AAC5D,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC,eAAe,QAAQ;AACvB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;;AAE5C;;AAEA,gCAAgC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AClhCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,2CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,+BAA+B,YAAY;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB;AACA,YAAY,kBAAkB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA,WAAW,2BAA2B;AACtC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA,WAAW,8BAA8B;AACzC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,qDAAiB;AACvC,cAAc,mBAAO,CAAC,qDAAiB;AACvC,iBAAiB,mBAAO,CAAC,2DAAoB;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,6BAA6B,WAAW;;AAExC;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA,+BAA+B,YAAY;AAC3C,+BAA+B,YAAY;AAC3C,kCAAkC,eAAe;;AAEjD;;AAEA;AACA;;AAEA,mBAAmB,YAAY;AAC/B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,6BAA6B;AAC9E;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,oBAAoB;AAC/B;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA,4BAA4B,qBAAqB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,cAAc,mBAAO,CAAC,+CAAW;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,+CAA+C;AAC1D;AACA,YAAY,+CAA+C;AAC3D;AACA;AACA;AACA,+BAA+B,wBAAwB;;AAEvD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;AACpC,iBAAiB,mBAAO,CAAC,6DAAqB;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,OAAO;;AAEzC;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8BAA8B;AAC7C;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,6BAA6B,YAAY;;AAEzC;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;ACjwBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,mCAAmC,YAAY;;AAE/C;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0CAA0C;AACzD;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;;;;;;;;;;;;AC/gCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC,eAAe,OAAO;AACtB;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA,8BAA8B,OAAO;;AAErC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,8DAA8D;AAC7E;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB;AACnC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uBAAuB;AACtC;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1hBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,sCAAsC;AACjF;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA,2CAA2C,gCAAgC;AAC3E;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,4CAAU;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,yDAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,4CAAU;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,6BAA6B,aAAa;;AAE1C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,0CAAS;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,0CAAS;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,qDAAW;AAChC,mBAAmB,mBAAO,CAAC,iEAAiB;AAC5C,oBAAoB,mBAAO,CAAC,mEAAkB;AAC9C,cAAc,mBAAO,CAAC,uDAAY;AAClC,sBAAsB,mBAAO,CAAC,uEAAoB;AAClD,eAAe,mBAAO,CAAC,yDAAa;AACpC,YAAY,mBAAO,CAAC,mDAAU;AAC9B,mBAAmB,mBAAO,CAAC,iEAAiB;AAC5C,aAAa,mBAAO,CAAC,qDAAW;AAChC,cAAc,mBAAO,CAAC,uDAAY;AAClC,qBAAqB,mBAAO,CAAC,qEAAmB;AAChD,UAAU,mBAAO,CAAC,+CAAQ;AAC1B,iBAAiB,mBAAO,CAAC,6DAAe;;AAExC;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACrFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,SAAS;;AAErC;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,mDAAM;AACtB,SAAS,mBAAO,CAAC,qDAAO;AACxB,WAAW,mBAAO,CAAC,yDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,qDAAM;AACtB,SAAS,mBAAO,CAAC,uDAAO;AACxB,WAAW,mBAAO,CAAC,2DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,kDAAM;AACtB,SAAS,mBAAO,CAAC,oDAAO;AACxB,WAAW,mBAAO,CAAC,wDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,kCAAkC,iBAAiB;AACnD,+BAA+B,cAAc;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;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BAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,sDAAM;AACtB,SAAS,mBAAO,CAAC,wDAAO;AACxB,WAAW,mBAAO,CAAC,4DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,oDAAM;AACtB,SAAS,mBAAO,CAAC,sDAAO;AACxB,WAAW,mBAAO,CAAC,0DAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,QAAQ,mBAAO,CAAC,iDAAM;AACtB,SAAS,mBAAO,CAAC,mDAAO;AACxB,WAAW,mBAAO,CAAC,uDAAS;;AAE5B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA,iBAAiB,mBAAO,CAAC,8DAAW;;;;;;;;;;;;ACVpC;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,gCAAgC,kBAAkB;;AAElD;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AACl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BAAgB,mBAAO,CAAC,qDAAc;AACtC,gBAAgB,mBAAO,CAAC,qDAAc;;AAEtC;;AAEA;;AAEA;;AAEA;;AAEA;;;;;;;;;;;;ACnFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,oDAAc;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA,mBAAmB,QAAQ;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AClDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC/DA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,aAAa,mBAAO,CAAC,8CAAW;;AAEhC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,SAAS;AACpB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,sDAAe;;AAExC;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,0DAAiB;;AAE5C;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,YAAY,mBAAO,CAAC,qFAAuB;AAC3C,gBAAgB,mBAAO,CAAC,6FAA2B;AACnD,iBAAiB,mBAAO,CAAC,+FAA4B;AACrD,YAAY,mBAAO,CAAC,qFAAuB;AAC3C,qBAAqB,mBAAO,CAAC,uGAAgC;AAC7D,gBAAgB,mBAAO,CAAC,6FAA2B;AACnD,kBAAkB,mBAAO,CAAC,iGAA6B;;AAEvD;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,aAAa,mBAAO,CAAC,gEAAiB;AACtC,YAAY,mBAAO,CAAC,sEAAoB;AACxC,aAAa,mBAAO,CAAC,wEAAqB;;AAE1C;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,sDAAmB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA,kCAAkC,qDAAqD;;AAEvF;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;;AAEA;;AAEA,kDAAkD;AAClD,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,wCAAwC;AAC/D;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,UAAU;AAClC;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB,oBAAoB,EAAE;AACtB;AACA,eAAe,IAAI;AACnB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB,oBAAoB,EAAE;AACtB;AACA,eAAe,IAAI;AACnB;AACA,gBAAgB,EAAE;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,OAAO;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,IAAI;AACxB;AACA,eAAe,IAAI;AACnB;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;;AAEA,yBAAyB,OAAO;AAChC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACvfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,UAAU,mBAAO,CAAC,sDAAY;AAC9B,WAAW,mBAAO,CAAC,wDAAa;AAChC,QAAQ,mBAAO,CAAC,kDAAU;;AAE1B;;;;;;;;;;;;AChBA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,YAAY,mBAAO,CAAC,mDAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,4DAA4D,sCAAsC;AAClG;AACA;AACA;AACA;AACA,eAAe,KAAK;AACpB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3HA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA,iBAAiB,mBAAO,CAAC,wDAAc;AACvC,YAAY,mBAAO,CAAC,mDAAgB;AACpC,kBAAkB,mBAAO,CAAC,2DAAiB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,mCAAmC,wCAAwC;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;ACzHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC5UA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,8BAA8B;AACzC;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;;AAEA,iBAAiB,mBAAO,CAAC,8EAAqB;AAC9C,gBAAgB,mBAAO,CAAC,4EAAoB;AAC5C,YAAY,mBAAO,CAAC,oEAAgB;AACpC,YAAY,mBAAO,CAAC,oEAAgB;;AAEpC;;;;;;;;;;;;ACjBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,oBAAoB;AAC/B,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;;;;;;;;;;;AC9BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACrBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;ACnBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,eAAe;AACf;AACA,oBAAoB;AACpB,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,4EAA4E;AACvF;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,6CAA6C;AACpF;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACvBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,IAAI;AACf;AACA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC;AACA;;;;;;;;;;;;AClBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,oDAAoD;AAC3E,wBAAwB,qDAAqD;AAC7E,yBAAyB,sDAAsD;AAC/E,wBAAwB,qDAAqD;AAC7E,4BAA4B,yDAAyD;AACrF;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB;AACA;;;;;;;;;;;;AC7BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;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AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;;AAEA;;;;;;;;;;;;ACrKA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,qBAAqB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;ACzPA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC9GA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,UAAU;AACrB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,gCAAgC,QAAQ;AACxC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;;AAEA;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC7CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,KAAK;AAChB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA,eAAe,sBAAsB;AACrC;AACA;AACA;;AAEA,eAAe,kBAAkB;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,KAAK;AAChB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;AACA;AACA;AACA;;AAEA,mBAAmB,sBAAsB;AACzC;AACA;AACA;;AAEA,4BAA4B,cAAc;AAC1C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,aAAa;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC7EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;;AAEA;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,+BAA+B,uBAAuB;;AAEtD;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA,qDAAqD;AACrD,qDAAqD;AACrD,qDAAqD;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D;AAC/D,oEAAoE;AACpE;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,uBAAuB,UAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,UAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,wBAAwB,mBAAO,CAAC,4EAA8B;;AAE9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,4BAA4B,YAAY;AACxC,6BAA6B,UAAU;;AAEvC;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACtEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB;AACA;AACA;AACA,6BAA6B,UAAU;AACvC,8BAA8B,wBAAwB;AACtD,gCAAgC,0BAA0B;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACnHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,eAAe,mBAAO,CAAC,iEAAoB;AAC3C,cAAc,mBAAO,CAAC,sDAAW;;AAEjC;AACA;AACA;;AAEA,wBAAwB,mBAAmB;AAC3C;AACA,4BAA4B,mBAAmB;AAC/C;AACA,2BAA2B,SAAS;AACpC;AACA,0BAA0B,6BAA6B;AACvD;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,aAAa;AAChC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACnIA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,YAAY;AACvB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,YAAY;AACxB;AACA;AACA;AACA,gCAAgC,iBAAiB;;AAEjD;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AClFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC5CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB;AACA,YAAY,UAAU;AACtB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;AAC1D,gCAAgC,iBAAiB;;AAEjD;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,8BAA8B,WAAW;AACzC,+BAA+B,uBAAuB;;AAEtD;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA,8BAA8B,WAAW;;AAEzC;;AAEA,mBAAmB,WAAW;AAC9B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACjCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,gBAAgB,mBAAO,CAAC,0DAAa;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,iCAAiC,yBAAyB;;AAE1D;AACA;AACA,gCAAgC,cAAc;AAC9C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA,WAAW,IAAI;AACf;AACA,YAAY,IAAI;AAChB;AACA;AACA;AACA,kCAAkC,OAAO;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AClCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,SAAS;AACpB;AACA,YAAY,SAAS;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;;;;;;;;;;;;AC/BA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,uBAAuB,SAAS;AAChC;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvCA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE;AACb,WAAW,EAAE;AACb;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,qBAAqB,WAAW;AAChC;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB,WAAW,OAAO;AAClB,WAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe,SAAS;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,MAAM;AACjB,WAAW,SAAS;AACpB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,gCAAgC,mBAAmB;;AAEnD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACzKA;AACA;AACA;AACA,kBAAkB;AA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AAO,CAAC,oDAAU;AAC9B,aAAa,mBAAO,CAAC,sDAAW;AAChC,kBAAkB,mBAAO,CAAC,gEAAgB;AAC1C,eAAe,mBAAO,CAAC,0DAAa;AACpC,gBAAgB,mBAAO,CAAC,4DAAc;AACtC,UAAU,mBAAO,CAAC,gDAAQ;;AAE1B;;;;;;;;;;;;AC/CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACvDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,UAAU,mBAAO,CAAC,0DAAkB;AACpC,kBAAkB,mBAAO,CAAC,qEAAe;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,mBAAmB;AACtC;AACA,uBAAuB,sBAAsB;AAC7C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,2BAA2B,sBAAsB;AACjD;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,mBAAmB,mBAAmB;AACtC;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC3CA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,uEAAgB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,uEAAgB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,qEAAe;AACzC,sBAAsB,mBAAO,CAAC,6EAAmB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,6CAA6C;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB,WAAW,gBAAgB;AAC3B;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,kCAAkC,gBAAgB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AC/EA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,mBAAmB,mBAAO,CAAC,uEAAgB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,iBAAiB,mBAAO,CAAC,6DAAe;AACxC,kBAAkB,mBAAO,CAAC,+DAAgB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;AACA,WAAW,MAAM;AACjB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,MAAM;AAClB;AACA;AACA;AACA,0BAA0B,OAAO;AACjC,0BAA0B,OAAO;;AAEjC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AClFA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O;AACnB;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;;;;AC9FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,WAAW,mBAAO,CAAC,8CAAY;AAC/B,eAAe,mBAAO,CAAC,yDAAY;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;AChFA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA,8CAA8C,aAAa,qBAAqB;AAChF;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE,oBAAoB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,EAAE;AACb;AACA,YAAY,EAAE;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AChEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;;AAEA;;;;;;;;;;;;ACjDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,qBAAqB;AAChC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA,YAAY,OAAO;AACnB;AACA;AACA;AACA,4BAA4B,SAAS;AACrC,4BAA4B,WAAW;AACvC,4BAA4B,SAAS;;AAErC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACrEA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,mBAAmB,mBAAO,CAAC,yFAAwC;AACnE,gBAAgB,mBAAO,CAAC,8F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;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,2BAA2B,uBAAuB;AAClD;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sCAAsC,uFAAuF;;AAE7H;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC7PA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,sBAAsB,mBAAO,CAAC,6FAA0C;AACxE,YAAY,mBAAO,CAAC,6DAA0B;AAC9C,eAAe,mBAAO,CAAC,iFAAoC;AAC3D,kBAAkB,mBAAO,CAAC,yFAAwC;AAClE,kBAAkB,mBAAO,CAAC,6EAAkC;AAC5D,YAAY,mBAAO,CAAC,uCAAO;AAC3B,gBAAgB,mBAAO,CAAC,mCAAa;AACrC,sBAAsB,mBAAO,CAAC,qEAA8B;AAC5D,qBAAqB,mBAAO,CAAC,iEAA4B;AACzD,WAAW,mBAAO,CAAC,2DAAyB;;AAE5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,6BAA6B;AACxC;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,uCAAuC,aAAa;;AAEpD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,uCAAuC,aAAa;;AAEpD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qGAAqG;AACpH,eAAe,OAAO;AACtB,eAAe,gBAAgB;AAC/B,eAAe,QAAQ;AACvB,eAAe,sCAAsC;AACrD,eAAe,sCAAsC;AACrD;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,gBAAgB;AAC3C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,eAAe;AAC9B,eAAe,WAAW;AAC1B;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,cAAc;AAC9B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,cAAc;;AAEhD;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAmB;AAClC;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB;AAChB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA,YAAY,gBAAgB;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,WAAW,IAAI;AACf,WAAW,QAAQ;AACnB;AACA,YAAY,gBAAgB;AAC5B;;AAEA;;;;;;;;;;;;AC/rCA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,YAAY,mBAAO,CAAC,gEAA6B;AACjD,gBAAgB,mBAAO,CAAC,wGAAiD;AACzE,2BAA2B,mBAAO,CAAC,mEAAwB;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,kBAAkB;AAC7B;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC/FA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,sCAAsC;AACjD,WAAW,6BAA6B;AACxC,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AClGA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,kBAAkB,mBAAO,CAAC,8DAA4B;AACtD,mBAAmB,mBAAO,CAAC,8DAA4B;;AAEvD,IAAI,IAAqB;AACzB;AACA,kBAAkB,mBAAO,CAAC,iFAA+B;AACzD;;AAEA,IAAI,IAAsB;AAC1B;AACA,mBAAmB,mBAAO,CAAC,mFAAgC;AAC3D;;AAEA;;AAEA;AACA;;AAEA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,6BAA6B;AACxC,WAAW,8BAA8B;AACzC,WAAW,8CAA8C;AACzD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA,mBAAmB,qBAAqB;AACxC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACrHA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACZA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA;AACA;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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,aAAa;AACxB,WAAW,YAAY;AACvB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,WAAW;;AAE7C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,kCAAkC,kBAAkB;;AAEpD;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB,eAAe,YAAY;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,IAAI;AACnB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,kCAAkC,6BAA6B;AAC/D,mCAAmC,+BAA+B;AAClE,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA,oCAAoC,aAAa;AACjD,oCAAoC,aAAa;;AAEjD;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;;AAEA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA,uBAAuB,2BAA2B;AAClD;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,2BAA2B,oCAAoC;AAC/D;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,uCAAuC,gBAAgB;;AAEvD;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,4CAA4C,yBAAyB;;AAErE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,kCAAkC,WAAW;;AAE7C;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,YAAY;AAC3B;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,kBAAkB;AAClC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;AACA;AACA,2BAA2B,qBAAqB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,gBAAgB,KAAK;AACrB;AACA;AACA;AACA,mCAAmC,YAAY;AAC/C,qCAAqC,cAAc;AACnD,qCAAqC,gBAAgB;;AAErD;AACA;;AAEA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,WAAW;AAC3B;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,uBAAuB;AACvC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,8BAA8B;AAC9C;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,yBAAyB;AACzC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,CAAC;;AAED;;;;;;;;;;;;AC3jDA;AACA;AACA;AACA,kBAAkB;AAClB;;AAEA,uBAAuB,mBAAO,CAAC,gGAA6C;AAC5E,eAAe,mBAAO,CAAC,oEAA+B;AACtD,WAAW,mBAAO,CAAC,4DAA2B;;AAE9C;AACA;AACA;AAC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ACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACpIA;;AAEA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,mDAAmD;AACxD;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,OAAO;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,iBAAiB;AAC5D;AACA;AACA;AACA;AACA,2CAA2C,iBAAiB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA,iDAAiD,mBAAmB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA,yCAAyC,mBAAmB;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,oBAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA,8CAA8C,oBAAoB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,6CAA6C;AAC/D;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,OAAO;AACxE;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,yBAAyB,EAAE;AACzF;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,YAAY;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oBAAoB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA,kCAAkC,oBAAoB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,cAAc;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sDAAsD;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yGAAyG;AACzG;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,qGAAqG;AACrG;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,2DAA2D,0BAA0B;AACrF;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,sDAAsD;AAC3D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kEAAkE;AACvE,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,eAAe;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,iBAAiB;AACpD;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,gBAAgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,iBAAiB;AAChD;AACA;AACA;AACA;AACA,0DAA0D,iBAAiB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK,+DAA+D;AACpE;AACA;AACA;AACA;AACA;AACA,KAAK,4DAA4D;AACjE;AACA;AACA;AACA;AACA;AACA,KAAK,yDAAyD;AAC9D,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;AACjB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,gCAAgC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,+BAA+B;AAC1D;AACA;AACA;AACA;AACA,2BAA2B,sCAAsC;AACjE;AACA;AACA;AACA;AACA,2BAA2B,iCAAiC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D,OAAO;AAClE;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD,gCAAgC,cAAc;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,qBAAqB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB;AAC5C;AACA,4BAA4B,gBAAgB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,OAAO;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,OAAO;AAC/C;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,OAAO;AAC7B;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA,wDAAwD,OAAO;AAC/D;AACA,wDAAwD,OAAO;AAC/D;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA,gCAAgC,gBAAgB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,OAAO;AACtC;AACA;AACA;AACA,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA;AACA;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA;AACA;AACA,wCAAwC,yBAAyB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO;AAC3D;AACA,0DAA0D,SAAS;AACnE;AACA,gEAAgE,WAAW;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,yBAAyB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA,uDAAuD,SAAS;AAChE;AACA;AACA;AACA,uEAAuE,QAAQ;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA,oCAAoC,kBAAkB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,SAAS;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,qCAAqC,uBAAuB;AAC5D,mCAAmC,WAAW;AAC9C,oCAAoC,oCAAoC;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,mCAAmC,cAAc;AACjD,sCAAsC,iBAAiB;AACvD;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,eAAe;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA,qDAAqD,SAAS;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,SAAS;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,SAAS;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,qBAAqB;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,mBAAmB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,uBAAuB;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,sBAAsB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA,gCAAgC,0BAA0B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,OAAO;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,OAAO;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,OAAO;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,OAAO;AAC9D;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,oBAAoB;AACnD;AACA;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,2BAA2B;AAC1D;AACA;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,sBAAsB;AACrD;AACA;AACA;AACA;AACA,mCAAmC,gCAAgC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA,wCAAwC,2BAA2B;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,wBAAwB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,+BAA+B;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,0BAA0B;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,OAAO;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA,gDAAgD,QAAQ;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,0BAA0B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,wBAAwB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,OAAO;AAChG;AACA;AACA;AACA,uDAAuD,kBAAkB;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,0BAA0B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oBAAoB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA,+BAA+B,6BAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA,+BAA+B,6BAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,wBAAwB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,6BAA6B;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,kEAAkE;AACvE;AACA;AACA;AACA;AACA;AACA,KAAK,4DAA4D;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E;AAC5E,kEAAkE;AAClE,qDAAqD;AACrD;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,yBAAyB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,uBAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,OAAO;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA,4CAA4C,OAAO;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,gBAAgB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,OAAO;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD,OAAO;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,QAAQ;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,QAAQ;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,oDAAoD,+BAA+B;AACnF;AACA;AACA;AACA;AACA,mCAAmC,WAAW;AAC9C;AACA;AACA;AACA;AACA;AACA,qCAAqC,UAAU;AAC/C;AACA;AACA;AACA;AACA;AACA,mCAAmC,WAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,UAAU;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kBAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,iBAAiB;AACvD,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,2BAA2B,2BAA2B;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,+BAA+B,OAAO;AACtC,+BAA+B,OAAO;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,wCAAwC,iBAAiB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,wBAAwB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,WAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,WAAW;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,WAAW;AAC7D;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,WAAW;AAC5E;AACA;AACA;AACA,0BAA0B,OAAO;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,qEAAqE;AAC1E,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,OAAO;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,OAAO;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB;AAC7D,2DAA2D,8CAA8C,EAAE;AAC3G;AACA;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF;AAClF,wEAAwE;AACxE,2DAA2D;AAC3D;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,OAAO;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,6CAA6C;AAClD,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,iBAAiB;AAC7D;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,oBAAoB;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,uBAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,wBAAwB;AAChF,sDAAsD,sDAAsD;AAC5G,sDAAsD,qDAAqD;AAC3G;AACA;AACA;AACA;AACA,sDAAsD,sBAAsB;AAC5E,qDAAqD,4BAA4B;AACjF,qDAAqD,2BAA2B;AAChF;AACA;AACA;AACA;AACA,qDAAqD,qBAAqB;AAC1E;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4BAA4B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,sCAAsC,UAAU;AAChD;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS,oFAAoF;AAC7F,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,oBAAoB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,uBAAuB;AACxF;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF,gDAAgD,qBAAqB;AACrE,8CAA8C,mBAAmB;AACjE;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,yDAAyD;AAClE,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,qBAAqB;AAC5E,4DAA4D,0BAA0B;AACtF,8DAA8D,4BAA4B;AAC1F,kEAAkE,sBAAsB;AACxF,8DAA8D,sBAAsB;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,8CAA8C,kDAAkD,iDAAiD,+BAA+B,mCAAmC,0BAA0B,2CAA2C,mDAAmD,8EAA8E,WAAW;AAC/e,iHAAiH,2FAA2F,mCAAmC,sCAAsC,0BAA0B,uEAAuE,WAAW;AACjY;AACA;AACA;AACA,2EAA2E,8CAA8C,+CAA+C,kDAAkD,iDAAiD,+BAA+B,8BAA8B,mCAAmC,0BAA0B,2CAA2C,2CAA2C,mDAAmD,8EAA8E,WAAW;AACvmB,iHAAiH,2FAA2F,mCAAmC,mCAAmC,sCAAsC,0BAA0B,8DAA8D,oDAAoD,8HAA8H,WAAW;AAC7kB;AACA;AACA;AACA,2EAA2E,8CAA8C,iDAAiD,+BAA+B,0BAA0B,2CAA2C,8EAA8E,WAAW;AACvW,iHAAiH,2FAA2F,0BAA0B,mCAAmC,WAAW;AACpR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,qBAAqB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD,wCAAwC,eAAe;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,OAAO;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD,0CAA0C,cAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,cAAc;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,cAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,sDAAsD;AAC/D,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE,SAAS;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,SAAS;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,OAAO;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8DAA8D,YAAY;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,8CAA8C,qBAAqB;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD,qBAAqB;AACrE,8CAA8C,mBAAmB;AACjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,SAAS;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,SAAS;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,SAAS;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,OAAO;AAC1C,mCAAmC,OAAO;AAC1C,mCAAmC,OAAO;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,kBAAkB,iBAAiB;AAClF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iEAAiE,OAAO;AACxE;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,4BAA4B;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK,0CAA0C;AAC/C,CAAC,sBAAsB;AACvB;AACA;AACA;;AAEA,CAAC","file":"SpinePluginDebug.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./SpinePlugin.js\");\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Blur Event.\n * \n * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded\n * enters a blurred state. The blur event is raised when the window loses focus. This can happen if a user swaps\n * tab, or if they simply remove focus from the browser to another app.\n *\n * @event Phaser.Core.Events#BLUR\n * @since 3.0.0\n */\nmodule.exports = 'blur';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Boot Event.\n * \n * This event is dispatched when the Phaser Game instance has finished booting, but before it is ready to start running.\n * The global systems use this event to know when to set themselves up, dispatching their own `ready` events as required.\n *\n * @event Phaser.Core.Events#BOOT\n * @since 3.0.0\n */\nmodule.exports = 'boot';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Context Lost Event.\n * \n * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Lost event from the browser.\n * \n * The partner event is `CONTEXT_RESTORED`.\n *\n * @event Phaser.Core.Events#CONTEXT_LOST\n * @since 3.19.0\n */\nmodule.exports = 'contextlost';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Context Restored Event.\n * \n * This event is dispatched by the Game if the WebGL Renderer it is using encounters a WebGL Context Restored event from the browser.\n * \n * The partner event is `CONTEXT_LOST`.\n *\n * @event Phaser.Core.Events#CONTEXT_RESTORED\n * @since 3.19.0\n */\nmodule.exports = 'contextrestored';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Destroy Event.\n * \n * This event is dispatched when the game instance has been told to destroy itself.\n * Lots of internal systems listen to this event in order to clear themselves out.\n * Custom plugins and game code should also do the same.\n *\n * @event Phaser.Core.Events#DESTROY\n * @since 3.0.0\n */\nmodule.exports = 'destroy';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Focus Event.\n * \n * This event is dispatched by the Game Visibility Handler when the window in which the Game instance is embedded\n * enters a focused state. The focus event is raised when the window re-gains focus, having previously lost it.\n *\n * @event Phaser.Core.Events#FOCUS\n * @since 3.0.0\n */\nmodule.exports = 'focus';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Hidden Event.\n * \n * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded\n * enters a hidden state. Only browsers that support the Visibility API will cause this event to be emitted.\n * \n * In most modern browsers, when the document enters a hidden state, the Request Animation Frame and setTimeout, which\n * control the main game loop, will automatically pause. There is no way to stop this from happening. It is something\n * your game should account for in its own code, should the pause be an issue (i.e. for multiplayer games)\n *\n * @event Phaser.Core.Events#HIDDEN\n * @since 3.0.0\n */\nmodule.exports = 'hidden';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Pause Event.\n * \n * This event is dispatched when the Game loop enters a paused state, usually as a result of the Visibility Handler.\n *\n * @event Phaser.Core.Events#PAUSE\n * @since 3.0.0\n */\nmodule.exports = 'pause';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Post-Render Event.\n * \n * This event is dispatched right at the end of the render process.\n * \n * Every Scene will have rendered and been drawn to the canvas by the time this event is fired.\n * Use it for any last minute post-processing before the next game step begins.\n *\n * @event Phaser.Core.Events#POST_RENDER\n * @since 3.0.0\n * \n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance.\n */\nmodule.exports = 'postrender';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Post-Step Event.\n * \n * This event is dispatched after the Scene Manager has updated.\n * Hook into it from plugins or systems that need to do things before the render starts.\n *\n * @event Phaser.Core.Events#POST_STEP\n * @since 3.0.0\n * \n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\n */\nmodule.exports = 'poststep';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Pre-Render Event.\n * \n * This event is dispatched immediately before any of the Scenes have started to render.\n * \n * The renderer will already have been initialized this frame, clearing itself and preparing to receive the Scenes for rendering, but it won't have actually drawn anything yet.\n *\n * @event Phaser.Core.Events#PRE_RENDER\n * @since 3.0.0\n * \n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - A reference to the current renderer being used by the Game instance.\n */\nmodule.exports = 'prerender';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Pre-Step Event.\n * \n * This event is dispatched before the main Game Step starts. By this point in the game cycle none of the Scene updates have yet happened.\n * Hook into it from plugins or systems that need to update before the Scene Manager does.\n *\n * @event Phaser.Core.Events#PRE_STEP\n * @since 3.0.0\n * \n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\n */\nmodule.exports = 'prestep';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Ready Event.\n * \n * This event is dispatched when the Phaser Game instance has finished booting, the Texture Manager is fully ready,\n * and all local systems are now able to start.\n *\n * @event Phaser.Core.Events#READY\n * @since 3.0.0\n */\nmodule.exports = 'ready';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Resume Event.\n * \n * This event is dispatched when the game loop leaves a paused state and resumes running.\n *\n * @event Phaser.Core.Events#RESUME\n * @since 3.0.0\n */\nmodule.exports = 'resume';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Step Event.\n * \n * This event is dispatched after the Game Pre-Step and before the Scene Manager steps.\n * Hook into it from plugins or systems that need to update before the Scene Manager does, but after the core Systems have.\n *\n * @event Phaser.Core.Events#STEP\n * @since 3.0.0\n * \n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\n */\nmodule.exports = 'step';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Visible Event.\n * \n * This event is dispatched by the Game Visibility Handler when the document in which the Game instance is embedded\n * enters a visible state, previously having been hidden.\n * \n * Only browsers that support the Visibility API will cause this event to be emitted.\n *\n * @event Phaser.Core.Events#VISIBLE\n * @since 3.0.0\n */\nmodule.exports = 'visible';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Core.Events\n */\n\nmodule.exports = {\n\n BLUR: require('./BLUR_EVENT'),\n BOOT: require('./BOOT_EVENT'),\n CONTEXT_LOST: require('./CONTEXT_LOST_EVENT'),\n CONTEXT_RESTORED: require('./CONTEXT_RESTORED_EVENT'),\n DESTROY: require('./DESTROY_EVENT'),\n FOCUS: require('./FOCUS_EVENT'),\n HIDDEN: require('./HIDDEN_EVENT'),\n PAUSE: require('./PAUSE_EVENT'),\n POST_RENDER: require('./POST_RENDER_EVENT'),\n POST_STEP: require('./POST_STEP_EVENT'),\n PRE_RENDER: require('./PRE_RENDER_EVENT'),\n PRE_STEP: require('./PRE_STEP_EVENT'),\n READY: require('./READY_EVENT'),\n RESUME: require('./RESUME_EVENT'),\n STEP: require('./STEP_EVENT'),\n VISIBLE: require('./VISIBLE_EVENT')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../utils/Class');\nvar Events = require('./events');\n\n/**\n * @callback DataEachCallback\n *\n * @param {*} parent - The parent object of the DataManager.\n * @param {string} key - The key of the value.\n * @param {*} value - The value.\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\n */\n\n/**\n * @classdesc\n * The Data Manager Component features a means to store pieces of data specific to a Game Object, System or Plugin.\n * You can then search, query it, and retrieve the data. The parent must either extend EventEmitter,\n * or have a property called `events` that is an instance of it.\n *\n * @class DataManager\n * @memberof Phaser.Data\n * @constructor\n * @since 3.0.0\n *\n * @param {object} parent - The object that this DataManager belongs to.\n * @param {Phaser.Events.EventEmitter} [eventEmitter] - The DataManager's event emitter.\n */\nvar DataManager = new Class({\n\n initialize:\n\n function DataManager (parent, eventEmitter)\n {\n /**\n * The object that this DataManager belongs to.\n *\n * @name Phaser.Data.DataManager#parent\n * @type {*}\n * @since 3.0.0\n */\n this.parent = parent;\n\n /**\n * The DataManager's event emitter.\n *\n * @name Phaser.Data.DataManager#events\n * @type {Phaser.Events.EventEmitter}\n * @since 3.0.0\n */\n this.events = eventEmitter;\n\n if (!eventEmitter)\n {\n this.events = (parent.events) ? parent.events : parent;\n }\n\n /**\n * The data list.\n *\n * @name Phaser.Data.DataManager#list\n * @type {Object.}\n * @default {}\n * @since 3.0.0\n */\n this.list = {};\n\n /**\n * The public values list. You can use this to access anything you have stored\n * in this Data Manager. For example, if you set a value called `gold` you can\n * access it via:\n *\n * ```javascript\n * this.data.values.gold;\n * ```\n *\n * You can also modify it directly:\n *\n * ```javascript\n * this.data.values.gold += 1000;\n * ```\n *\n * Doing so will emit a `setdata` event from the parent of this Data Manager.\n *\n * Do not modify this object directly. Adding properties directly to this object will not\n * emit any events. Always use `DataManager.set` to create new items the first time around.\n *\n * @name Phaser.Data.DataManager#values\n * @type {Object.}\n * @default {}\n * @since 3.10.0\n */\n this.values = {};\n\n /**\n * Whether setting data is frozen for this DataManager.\n *\n * @name Phaser.Data.DataManager#_frozen\n * @type {boolean}\n * @private\n * @default false\n * @since 3.0.0\n */\n this._frozen = false;\n\n if (!parent.hasOwnProperty('sys') && this.events)\n {\n this.events.once(Events.DESTROY, this.destroy, this);\n }\n },\n\n /**\n * Retrieves the value for the given key, or undefined if it doesn't exist.\n *\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\n *\n * ```javascript\n * this.data.get('gold');\n * ```\n *\n * Or access the value directly:\n *\n * ```javascript\n * this.data.values.gold;\n * ```\n *\n * You can also pass in an array of keys, in which case an array of values will be returned:\n *\n * ```javascript\n * this.data.get([ 'gold', 'armor', 'health' ]);\n * ```\n *\n * This approach is useful for destructuring arrays in ES6.\n *\n * @method Phaser.Data.DataManager#get\n * @since 3.0.0\n *\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\n *\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\n */\n get: function (key)\n {\n var list = this.list;\n\n if (Array.isArray(key))\n {\n var output = [];\n\n for (var i = 0; i < key.length; i++)\n {\n output.push(list[key[i]]);\n }\n\n return output;\n }\n else\n {\n return list[key];\n }\n },\n\n /**\n * Retrieves all data values in a new object.\n *\n * @method Phaser.Data.DataManager#getAll\n * @since 3.0.0\n *\n * @return {Object.} All data values.\n */\n getAll: function ()\n {\n var results = {};\n\n for (var key in this.list)\n {\n if (this.list.hasOwnProperty(key))\n {\n results[key] = this.list[key];\n }\n }\n\n return results;\n },\n\n /**\n * Queries the DataManager for the values of keys matching the given regular expression.\n *\n * @method Phaser.Data.DataManager#query\n * @since 3.0.0\n *\n * @param {RegExp} search - A regular expression object. If a non-RegExp object obj is passed, it is implicitly converted to a RegExp by using new RegExp(obj).\n *\n * @return {Object.} The values of the keys matching the search string.\n */\n query: function (search)\n {\n var results = {};\n\n for (var key in this.list)\n {\n if (this.list.hasOwnProperty(key) && key.match(search))\n {\n results[key] = this.list[key];\n }\n }\n\n return results;\n },\n\n /**\n * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created.\n *\n * ```javascript\n * data.set('name', 'Red Gem Stone');\n * ```\n *\n * You can also pass in an object of key value pairs as the first argument:\n *\n * ```javascript\n * data.set({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\n * ```\n *\n * To get a value back again you can call `get`:\n *\n * ```javascript\n * data.get('gold');\n * ```\n *\n * Or you can access the value directly via the `values` property, where it works like any other variable:\n *\n * ```javascript\n * data.values.gold += 50;\n * ```\n *\n * When the value is first set, a `setdata` event is emitted.\n *\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\n *\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\n *\n * @method Phaser.Data.DataManager#set\n * @fires Phaser.Data.Events#SET_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\n * @since 3.0.0\n *\n * @param {(string|object)} key - The key to set the value for. Or an object or key value pairs. If an object the `data` argument is ignored.\n * @param {*} data - The value to set for the given key. If an object is provided as the key this argument is ignored.\n *\n * @return {this} This DataManager object.\n */\n set: function (key, data)\n {\n if (this._frozen)\n {\n return this;\n }\n\n if (typeof key === 'string')\n {\n return this.setValue(key, data);\n }\n else\n {\n for (var entry in key)\n {\n this.setValue(entry, key[entry]);\n }\n }\n\n return this;\n },\n\n /**\n * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0.\n *\n * When the value is first set, a `setdata` event is emitted.\n *\n * @method Phaser.Data.DataManager#inc\n * @fires Phaser.Data.Events#SET_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\n * @since 3.23.0\n *\n * @param {(string|object)} key - The key to increase the value for.\n * @param {*} [data] - The value to increase for the given key.\n *\n * @return {Phaser.Data.DataManager} This DataManager object.\n */\n inc: function (key, data)\n {\n if (this._frozen)\n {\n return this;\n }\n\n if (data === undefined)\n {\n data = 1;\n }\n\n var value = this.get(key);\n if (value === undefined)\n {\n value = 0;\n }\n\n this.set(key, (value + data));\n\n return this;\n },\n\n /**\n * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false.\n *\n * When the value is first set, a `setdata` event is emitted.\n *\n * @method Phaser.Data.DataManager#toggle\n * @fires Phaser.Data.Events#SET_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\n * @since 3.23.0\n *\n * @param {(string|object)} key - The key to toggle the value for.\n *\n * @return {Phaser.Data.DataManager} This DataManager object.\n */\n toggle: function (key)\n {\n if (this._frozen)\n {\n return this;\n }\n\n this.set(key, !this.get(key));\n\n return this;\n },\n\n /**\n * Internal value setter, called automatically by the `set` method.\n *\n * @method Phaser.Data.DataManager#setValue\n * @fires Phaser.Data.Events#SET_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\n * @private\n * @since 3.10.0\n *\n * @param {string} key - The key to set the value for.\n * @param {*} data - The value to set.\n *\n * @return {this} This DataManager object.\n */\n setValue: function (key, data)\n {\n if (this._frozen)\n {\n return this;\n }\n\n if (this.has(key))\n {\n // Hit the key getter, which will in turn emit the events.\n this.values[key] = data;\n }\n else\n {\n var _this = this;\n var list = this.list;\n var events = this.events;\n var parent = this.parent;\n\n Object.defineProperty(this.values, key, {\n\n enumerable: true,\n\n configurable: true,\n\n get: function ()\n {\n return list[key];\n },\n\n set: function (value)\n {\n if (!_this._frozen)\n {\n var previousValue = list[key];\n list[key] = value;\n\n events.emit(Events.CHANGE_DATA, parent, key, value, previousValue);\n events.emit(Events.CHANGE_DATA_KEY + key, parent, value, previousValue);\n }\n }\n\n });\n\n list[key] = data;\n\n events.emit(Events.SET_DATA, parent, key, data);\n }\n\n return this;\n },\n\n /**\n * Passes all data entries to the given callback.\n *\n * @method Phaser.Data.DataManager#each\n * @since 3.0.0\n *\n * @param {DataEachCallback} callback - The function to call.\n * @param {*} [context] - Value to use as `this` when executing callback.\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the game object, key, and data.\n *\n * @return {this} This DataManager object.\n */\n each: function (callback, context)\n {\n var args = [ this.parent, null, undefined ];\n\n for (var i = 1; i < arguments.length; i++)\n {\n args.push(arguments[i]);\n }\n\n for (var key in this.list)\n {\n args[1] = key;\n args[2] = this.list[key];\n\n callback.apply(context, args);\n }\n\n return this;\n },\n\n /**\n * Merge the given object of key value pairs into this DataManager.\n *\n * Any newly created values will emit a `setdata` event. Any updated values (see the `overwrite` argument)\n * will emit a `changedata` event.\n *\n * @method Phaser.Data.DataManager#merge\n * @fires Phaser.Data.Events#SET_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA\n * @fires Phaser.Data.Events#CHANGE_DATA_KEY\n * @since 3.0.0\n *\n * @param {Object.} data - The data to merge.\n * @param {boolean} [overwrite=true] - Whether to overwrite existing data. Defaults to true.\n *\n * @return {this} This DataManager object.\n */\n merge: function (data, overwrite)\n {\n if (overwrite === undefined) { overwrite = true; }\n\n // Merge data from another component into this one\n for (var key in data)\n {\n if (data.hasOwnProperty(key) && (overwrite || (!overwrite && !this.has(key))))\n {\n this.setValue(key, data[key]);\n }\n }\n\n return this;\n },\n\n /**\n * Remove the value for the given key.\n *\n * If the key is found in this Data Manager it is removed from the internal lists and a\n * `removedata` event is emitted.\n *\n * You can also pass in an array of keys, in which case all keys in the array will be removed:\n *\n * ```javascript\n * this.data.remove([ 'gold', 'armor', 'health' ]);\n * ```\n *\n * @method Phaser.Data.DataManager#remove\n * @fires Phaser.Data.Events#REMOVE_DATA\n * @since 3.0.0\n *\n * @param {(string|string[])} key - The key to remove, or an array of keys to remove.\n *\n * @return {this} This DataManager object.\n */\n remove: function (key)\n {\n if (this._frozen)\n {\n return this;\n }\n\n if (Array.isArray(key))\n {\n for (var i = 0; i < key.length; i++)\n {\n this.removeValue(key[i]);\n }\n }\n else\n {\n return this.removeValue(key);\n }\n\n return this;\n },\n\n /**\n * Internal value remover, called automatically by the `remove` method.\n *\n * @method Phaser.Data.DataManager#removeValue\n * @private\n * @fires Phaser.Data.Events#REMOVE_DATA\n * @since 3.10.0\n *\n * @param {string} key - The key to set the value for.\n *\n * @return {this} This DataManager object.\n */\n removeValue: function (key)\n {\n if (this.has(key))\n {\n var data = this.list[key];\n\n delete this.list[key];\n delete this.values[key];\n\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\n }\n\n return this;\n },\n\n /**\n * Retrieves the data associated with the given 'key', deletes it from this Data Manager, then returns it.\n *\n * @method Phaser.Data.DataManager#pop\n * @fires Phaser.Data.Events#REMOVE_DATA\n * @since 3.0.0\n *\n * @param {string} key - The key of the value to retrieve and delete.\n *\n * @return {*} The value of the given key.\n */\n pop: function (key)\n {\n var data = undefined;\n\n if (!this._frozen && this.has(key))\n {\n data = this.list[key];\n\n delete this.list[key];\n delete this.values[key];\n\n this.events.emit(Events.REMOVE_DATA, this.parent, key, data);\n }\n\n return data;\n },\n\n /**\n * Determines whether the given key is set in this Data Manager.\n *\n * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings.\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\n *\n * @method Phaser.Data.DataManager#has\n * @since 3.0.0\n *\n * @param {string} key - The key to check.\n *\n * @return {boolean} Returns `true` if the key exists, otherwise `false`.\n */\n has: function (key)\n {\n return this.list.hasOwnProperty(key);\n },\n\n /**\n * Freeze or unfreeze this Data Manager. A frozen Data Manager will block all attempts\n * to create new values or update existing ones.\n *\n * @method Phaser.Data.DataManager#setFreeze\n * @since 3.0.0\n *\n * @param {boolean} value - Whether to freeze or unfreeze the Data Manager.\n *\n * @return {this} This DataManager object.\n */\n setFreeze: function (value)\n {\n this._frozen = value;\n\n return this;\n },\n\n /**\n * Delete all data in this Data Manager and unfreeze it.\n *\n * @method Phaser.Data.DataManager#reset\n * @since 3.0.0\n *\n * @return {this} This DataManager object.\n */\n reset: function ()\n {\n for (var key in this.list)\n {\n delete this.list[key];\n delete this.values[key];\n }\n\n this._frozen = false;\n\n return this;\n },\n\n /**\n * Destroy this data manager.\n *\n * @method Phaser.Data.DataManager#destroy\n * @since 3.0.0\n */\n destroy: function ()\n {\n this.reset();\n\n this.events.off(Events.CHANGE_DATA);\n this.events.off(Events.SET_DATA);\n this.events.off(Events.REMOVE_DATA);\n\n this.parent = null;\n },\n\n /**\n * Gets or sets the frozen state of this Data Manager.\n * A frozen Data Manager will block all attempts to create new values or update existing ones.\n *\n * @name Phaser.Data.DataManager#freeze\n * @type {boolean}\n * @since 3.0.0\n */\n freeze: {\n\n get: function ()\n {\n return this._frozen;\n },\n\n set: function (value)\n {\n this._frozen = (value) ? true : false;\n }\n\n },\n\n /**\n * Return the total number of entries in this Data Manager.\n *\n * @name Phaser.Data.DataManager#count\n * @type {number}\n * @since 3.0.0\n */\n count: {\n\n get: function ()\n {\n var i = 0;\n\n for (var key in this.list)\n {\n if (this.list[key] !== undefined)\n {\n i++;\n }\n }\n\n return i;\n }\n\n }\n\n});\n\nmodule.exports = DataManager;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Change Data Event.\n * \n * This event is dispatched by a Data Manager when an item in the data store is changed.\n * \n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\n * a change data event from a Game Object you would use: `sprite.data.on('changedata', listener)`.\n * \n * This event is dispatched for all items that change in the Data Manager.\n * To listen for the change of a specific item, use the `CHANGE_DATA_KEY_EVENT` event.\n *\n * @event Phaser.Data.Events#CHANGE_DATA\n * @since 3.0.0\n * \n * @param {any} parent - A reference to the object that the Data Manager responsible for this event belongs to.\n * @param {string} key - The unique key of the data item within the Data Manager.\n * @param {any} value - The new value of the item in the Data Manager.\n * @param {any} previousValue - The previous value of the item in the Data Manager.\n */\nmodule.exports = 'changedata';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Change Data Key Event.\n * \n * This event is dispatched by a Data Manager when an item in the data store is changed.\n * \n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\n * the change of a specific data item from a Game Object you would use: `sprite.data.on('changedata-key', listener)`,\n * where `key` is the unique string key of the data item. For example, if you have a data item stored called `gold`\n * then you can listen for `sprite.data.on('changedata-gold')`.\n *\n * @event Phaser.Data.Events#CHANGE_DATA_KEY\n * @since 3.16.1\n * \n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\n * @param {any} value - The item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\n * @param {any} previousValue - The previous item that was updated in the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\n */\nmodule.exports = 'changedata-';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Data Manager Destroy Event.\n *\n * The Data Manager will listen for the destroy event from its parent, and then close itself down.\n *\n * @event Phaser.Data.Events#DESTROY\n * @since 3.50.0\n */\nmodule.exports = 'destroy';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Remove Data Event.\n * \n * This event is dispatched by a Data Manager when an item is removed from it.\n * \n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\n * the removal of a data item on a Game Object you would use: `sprite.data.on('removedata', listener)`.\n *\n * @event Phaser.Data.Events#REMOVE_DATA\n * @since 3.0.0\n * \n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\n * @param {string} key - The unique key of the data item within the Data Manager.\n * @param {any} data - The item that was removed from the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\n */\nmodule.exports = 'removedata';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Set Data Event.\n * \n * This event is dispatched by a Data Manager when a new item is added to the data store.\n * \n * Game Objects with data enabled have an instance of a Data Manager under the `data` property. So, to listen for\n * the addition of a new data item on a Game Object you would use: `sprite.data.on('setdata', listener)`.\n *\n * @event Phaser.Data.Events#SET_DATA\n * @since 3.0.0\n * \n * @param {any} parent - A reference to the object that owns the instance of the Data Manager responsible for this event.\n * @param {string} key - The unique key of the data item within the Data Manager.\n * @param {any} data - The item that was added to the Data Manager. This can be of any data type, i.e. a string, boolean, number, object or instance.\n */\nmodule.exports = 'setdata';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Data.Events\n */\n\nmodule.exports = {\n\n CHANGE_DATA: require('./CHANGE_DATA_EVENT'),\n CHANGE_DATA_KEY: require('./CHANGE_DATA_KEY_EVENT'),\n DESTROY: require('./DESTROY_EVENT'),\n REMOVE_DATA: require('./REMOVE_DATA_EVENT'),\n SET_DATA: require('./SET_DATA_EVENT')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar GameEvents = require('../../core/events');\nvar RenderEvents = require('../../renderer/events');\n\n/**\n * @classdesc\n * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel.\n * Unlike the Geometry Mask, which is a clipping path, a Bitmap Mask behaves like an alpha mask,\n * not a clipping path. It is only available when using the WebGL Renderer.\n *\n * A Bitmap Mask can use any Game Object to determine the alpha of each pixel of the masked Game Object(s).\n * For any given point of a masked Game Object's texture, the pixel's alpha will be multiplied by the alpha\n * of the pixel at the same position in the Bitmap Mask's Game Object. The color of the pixel from the\n * Bitmap Mask doesn't matter.\n *\n * For example, if a pure blue pixel with an alpha of 0.95 is masked with a pure red pixel with an\n * alpha of 0.5, the resulting pixel will be pure blue with an alpha of 0.475. Naturally, this means\n * that a pixel in the mask with an alpha of 0 will hide the corresponding pixel in all masked Game Objects\n * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the\n * corresponding pixel in the mask.\n *\n * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however,\n * combine Geometry Masks and Blend Modes together.\n *\n * The Bitmap Mask's location matches the location of its Game Object, not the location of the\n * masked objects. Moving or transforming the underlying Game Object will change the mask\n * (and affect the visibility of any masked objects), whereas moving or transforming a masked object\n * will not affect the mask.\n *\n * The Bitmap Mask will not render its Game Object by itself. If the Game Object is not in a\n * Scene's display list, it will only be used for the mask and its full texture will not be directly\n * visible. Adding the underlying Game Object to a Scene will not cause any problems - it will\n * render as a normal Game Object and will also serve as a mask.\n *\n * @class BitmapMask\n * @memberof Phaser.Display.Masks\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Scene} scene - The Scene which this Bitmap Mask will be used in.\n * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite.\n */\nvar BitmapMask = new Class({\n\n initialize:\n\n function BitmapMask (scene, renderable)\n {\n var renderer = scene.sys.renderer;\n\n /**\n * A reference to either the Canvas or WebGL Renderer that this Mask is using.\n *\n * @name Phaser.Display.Masks.BitmapMask#renderer\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\n * @since 3.11.0\n */\n this.renderer = renderer;\n\n /**\n * A renderable Game Object that uses a texture, such as a Sprite.\n *\n * @name Phaser.Display.Masks.BitmapMask#bitmapMask\n * @type {Phaser.GameObjects.GameObject}\n * @since 3.0.0\n */\n this.bitmapMask = renderable;\n\n /**\n * The texture used for the masks framebuffer.\n *\n * @name Phaser.Display.Masks.BitmapMask#maskTexture\n * @type {WebGLTexture}\n * @default null\n * @since 3.0.0\n */\n this.maskTexture = null;\n\n /**\n * The texture used for the main framebuffer.\n *\n * @name Phaser.Display.Masks.BitmapMask#mainTexture\n * @type {WebGLTexture}\n * @default null\n * @since 3.0.0\n */\n this.mainTexture = null;\n\n /**\n * Whether the Bitmap Mask is dirty and needs to be updated.\n *\n * @name Phaser.Display.Masks.BitmapMask#dirty\n * @type {boolean}\n * @default true\n * @since 3.0.0\n */\n this.dirty = true;\n\n /**\n * The framebuffer to which a masked Game Object is rendered.\n *\n * @name Phaser.Display.Masks.BitmapMask#mainFramebuffer\n * @type {WebGLFramebuffer}\n * @since 3.0.0\n */\n this.mainFramebuffer = null;\n\n /**\n * The framebuffer to which the Bitmap Mask's masking Game Object is rendered.\n *\n * @name Phaser.Display.Masks.BitmapMask#maskFramebuffer\n * @type {WebGLFramebuffer}\n * @since 3.0.0\n */\n this.maskFramebuffer = null;\n\n /**\n * Whether to invert the masks alpha.\n *\n * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel.\n * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible.\n *\n * @name Phaser.Display.Masks.BitmapMask#invertAlpha\n * @type {boolean}\n * @since 3.1.2\n */\n this.invertAlpha = false;\n\n /**\n * Is this mask a stencil mask?\n *\n * @name Phaser.Display.Masks.BitmapMask#isStencil\n * @type {boolean}\n * @readonly\n * @since 3.17.0\n */\n this.isStencil = false;\n\n this.createMask();\n\n scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this);\n\n renderer.on(RenderEvents.RESIZE, this.createMask, this);\n },\n\n /**\n * Creates the WebGL Texture2D objects and Framebuffers required for this\n * mask. If this mask has already been created, then `clearMask` is called first.\n *\n * @method Phaser.Display.Masks.BitmapMask#createMask\n * @since 3.50.0\n */\n createMask: function ()\n {\n var renderer = this.renderer;\n\n if (!renderer.gl)\n {\n return;\n }\n\n if (this.mainTexture)\n {\n this.clearMask();\n }\n\n var width = renderer.width;\n var height = renderer.height;\n var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0);\n var gl = renderer.gl;\n var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE;\n var filter = gl.LINEAR;\n\n this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\n this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height);\n this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true);\n this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true);\n },\n\n /**\n * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes\n * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references.\n *\n * This is called when this mask is destroyed, or if you try to creat a new\n * mask from this object when one is already set.\n *\n * @method Phaser.Display.Masks.BitmapMask#clearMask\n * @since 3.50.0\n */\n clearMask: function ()\n {\n var renderer = this.renderer;\n\n if (!renderer.gl || !this.mainTexture)\n {\n return;\n }\n\n renderer.deleteTexture(this.mainTexture);\n renderer.deleteTexture(this.maskTexture);\n renderer.deleteFramebuffer(this.mainFramebuffer);\n renderer.deleteFramebuffer(this.maskFramebuffer);\n\n this.mainTexture = null;\n this.maskTexture = null;\n this.mainFramebuffer = null;\n this.maskFramebuffer = null;\n },\n\n /**\n * Sets a new masking Game Object for the Bitmap Mask.\n *\n * @method Phaser.Display.Masks.BitmapMask#setBitmap\n * @since 3.0.0\n *\n * @param {Phaser.GameObjects.GameObject} renderable - A renderable Game Object that uses a texture, such as a Sprite.\n */\n setBitmap: function (renderable)\n {\n this.bitmapMask = renderable;\n },\n\n /**\n * Prepares the WebGL Renderer to render a Game Object with this mask applied.\n *\n * This renders the masking Game Object to the mask framebuffer and switches to the main framebuffer so that the masked Game Object will be rendered to it instead of being rendered directly to the frame.\n *\n * @method Phaser.Display.Masks.BitmapMask#preRenderWebGL\n * @since 3.0.0\n *\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to prepare.\n * @param {Phaser.GameObjects.GameObject} maskedObject - The masked Game Object which will be drawn.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to.\n */\n preRenderWebGL: function (renderer, maskedObject, camera)\n {\n renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera);\n },\n\n /**\n * Finalizes rendering of a masked Game Object.\n *\n * This resets the previously bound framebuffer and switches the WebGL Renderer to the Bitmap Mask Pipeline, which uses a special fragment shader to apply the masking effect.\n *\n * @method Phaser.Display.Masks.BitmapMask#postRenderWebGL\n * @since 3.0.0\n *\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The WebGL Renderer to clean up.\n */\n postRenderWebGL: function (renderer, camera)\n {\n renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera);\n },\n\n /**\n * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer.\n *\n * @method Phaser.Display.Masks.BitmapMask#preRenderCanvas\n * @since 3.0.0\n *\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to.\n * @param {Phaser.GameObjects.GameObject} mask - The masked Game Object which would be rendered.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to render to.\n */\n preRenderCanvas: function ()\n {\n // NOOP\n },\n\n /**\n * This is a NOOP method. Bitmap Masks are not supported by the Canvas Renderer.\n *\n * @method Phaser.Display.Masks.BitmapMask#postRenderCanvas\n * @since 3.0.0\n *\n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Canvas Renderer which would be rendered to.\n */\n postRenderCanvas: function ()\n {\n // NOOP\n },\n\n /**\n * Destroys this BitmapMask and nulls any references it holds.\n *\n * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it,\n * so be sure to call `clearMask` on any Game Object using it, before destroying it.\n *\n * @method Phaser.Display.Masks.BitmapMask#destroy\n * @since 3.7.0\n */\n destroy: function ()\n {\n this.clearMask();\n\n this.renderer.off(RenderEvents.RESIZE, this.createMask, this);\n\n this.bitmapMask = null;\n this.prevFramebuffer = null;\n this.renderer = null;\n }\n\n});\n\nmodule.exports = BitmapMask;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\n\n/**\n * @classdesc\n * A Geometry Mask can be applied to a Game Object to hide any pixels of it which don't intersect\n * a visible pixel from the geometry mask. The mask is essentially a clipping path which can only\n * make a masked pixel fully visible or fully invisible without changing its alpha (opacity).\n *\n * A Geometry Mask uses a Graphics Game Object to determine which pixels of the masked Game Object(s)\n * should be clipped. For any given point of a masked Game Object's texture, the pixel will only be displayed\n * if the Graphics Game Object of the Geometry Mask has a visible pixel at the same position. The color and\n * alpha of the pixel from the Geometry Mask do not matter.\n *\n * The Geometry Mask's location matches the location of its Graphics object, not the location of the masked objects.\n * Moving or transforming the underlying Graphics object will change the mask (and affect the visibility\n * of any masked objects), whereas moving or transforming a masked object will not affect the mask.\n * You can think of the Geometry Mask (or rather, of its Graphics object) as an invisible curtain placed\n * in front of all masked objects which has its own visual properties and, naturally, respects the camera's\n * visual properties, but isn't affected by and doesn't follow the masked objects by itself.\n *\n * @class GeometryMask\n * @memberof Phaser.Display.Masks\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Scene} scene - This parameter is not used.\n * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics Game Object to use for the Geometry Mask. Doesn't have to be in the Display List.\n */\nvar GeometryMask = new Class({\n\n initialize:\n\n function GeometryMask (scene, graphicsGeometry)\n {\n /**\n * The Graphics object which describes the Geometry Mask.\n *\n * @name Phaser.Display.Masks.GeometryMask#geometryMask\n * @type {Phaser.GameObjects.Graphics}\n * @since 3.0.0\n */\n this.geometryMask = graphicsGeometry;\n\n /**\n * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels\n * drawn to the Geometry Mask.\n *\n * This is a WebGL only feature.\n *\n * @name Phaser.Display.Masks.GeometryMask#invertAlpha\n * @type {boolean}\n * @since 3.16.0\n */\n this.invertAlpha = false;\n\n /**\n * Is this mask a stencil mask?\n *\n * @name Phaser.Display.Masks.GeometryMask#isStencil\n * @type {boolean}\n * @readonly\n * @since 3.17.0\n */\n this.isStencil = true;\n\n /**\n * The current stencil level.\n *\n * @name Phaser.Display.Masks.GeometryMask#level\n * @type {boolean}\n * @private\n * @since 3.17.0\n */\n this.level = 0;\n },\n\n /**\n * Sets a new Graphics object for the Geometry Mask.\n *\n * @method Phaser.Display.Masks.GeometryMask#setShape\n * @since 3.0.0\n *\n * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask.\n *\n * @return {this} This Geometry Mask\n */\n setShape: function (graphicsGeometry)\n {\n this.geometryMask = graphicsGeometry;\n\n return this;\n },\n\n /**\n * Sets the `invertAlpha` property of this Geometry Mask.\n *\n * Inverting the alpha essentially flips the way the mask works.\n *\n * This is a WebGL only feature.\n *\n * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha\n * @since 3.17.0\n *\n * @param {boolean} [value=true] - Invert the alpha of this mask?\n *\n * @return {this} This Geometry Mask\n */\n setInvertAlpha: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.invertAlpha = value;\n\n return this;\n },\n\n /**\n * Renders the Geometry Mask's underlying Graphics object to the OpenGL stencil buffer and enables the stencil test, which clips rendered pixels according to the mask.\n *\n * @method Phaser.Display.Masks.GeometryMask#preRenderWebGL\n * @since 3.0.0\n *\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.\n * @param {Phaser.GameObjects.GameObject} child - The Game Object being rendered.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\n */\n preRenderWebGL: function (renderer, child, camera)\n {\n var gl = renderer.gl;\n\n // Force flushing before drawing to stencil buffer\n renderer.flush();\n\n if (renderer.maskStack.length === 0)\n {\n gl.enable(gl.STENCIL_TEST);\n gl.clear(gl.STENCIL_BUFFER_BIT);\n\n renderer.maskCount = 0;\n }\n\n if (renderer.currentCameraMask.mask !== this)\n {\n renderer.currentMask.mask = this;\n }\n\n renderer.maskStack.push({ mask: this, camera: camera });\n\n this.applyStencil(renderer, camera, true);\n\n renderer.maskCount++;\n },\n\n /**\n * Applies the current stencil mask to the renderer.\n *\n * @method Phaser.Display.Masks.GeometryMask#applyStencil\n * @since 3.17.0\n *\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw to.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\n * @param {boolean} inc - Is this an INCR stencil or a DECR stencil?\n */\n applyStencil: function (renderer, camera, inc)\n {\n var gl = renderer.gl;\n var geometryMask = this.geometryMask;\n var level = renderer.maskCount;\n\n gl.colorMask(false, false, false, false);\n\n if (inc)\n {\n gl.stencilFunc(gl.EQUAL, level, 0xFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n }\n else\n {\n gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n }\n\n // Write stencil buffer\n geometryMask.renderWebGL(renderer, geometryMask, camera);\n\n renderer.flush();\n\n gl.colorMask(true, true, true, true);\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n\n if (inc)\n {\n if (this.invertAlpha)\n {\n gl.stencilFunc(gl.NOTEQUAL, level + 1, 0xFF);\n }\n else\n {\n gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\n }\n }\n else if (this.invertAlpha)\n {\n gl.stencilFunc(gl.NOTEQUAL, level, 0xFF);\n }\n else\n {\n gl.stencilFunc(gl.EQUAL, level, 0xFF);\n }\n },\n\n /**\n * Flushes all rendered pixels and disables the stencil test of a WebGL context, thus disabling the mask for it.\n *\n * @method Phaser.Display.Masks.GeometryMask#postRenderWebGL\n * @since 3.0.0\n *\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGL Renderer instance to draw flush.\n */\n postRenderWebGL: function (renderer)\n {\n var gl = renderer.gl;\n\n renderer.maskStack.pop();\n\n renderer.maskCount--;\n\n // Force flush before disabling stencil test\n renderer.flush();\n\n var current = renderer.currentMask;\n\n if (renderer.maskStack.length === 0)\n {\n // If this is the only mask in the stack, flush and disable\n current.mask = null;\n\n gl.disable(gl.STENCIL_TEST);\n }\n else\n {\n var prev = renderer.maskStack[renderer.maskStack.length - 1];\n\n prev.mask.applyStencil(renderer, prev.camera, false);\n\n if (renderer.currentCameraMask.mask !== prev.mask)\n {\n current.mask = prev.mask;\n current.camera = prev.camera;\n }\n else\n {\n current.mask = null;\n }\n }\n },\n\n /**\n * Sets the clipping path of a 2D canvas context to the Geometry Mask's underlying Graphics object.\n *\n * @method Phaser.Display.Masks.GeometryMask#preRenderCanvas\n * @since 3.0.0\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance to set the clipping path on.\n * @param {Phaser.GameObjects.GameObject} mask - The Game Object being rendered.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the Game Object is being rendered through.\n */\n preRenderCanvas: function (renderer, mask, camera)\n {\n var geometryMask = this.geometryMask;\n\n renderer.currentContext.save();\n\n geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true);\n\n renderer.currentContext.clip();\n },\n\n /**\n * Restore the canvas context's previous clipping path, thus turning off the mask for it.\n *\n * @method Phaser.Display.Masks.GeometryMask#postRenderCanvas\n * @since 3.0.0\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - The Canvas Renderer instance being restored.\n */\n postRenderCanvas: function (renderer)\n {\n renderer.currentContext.restore();\n },\n\n /**\n * Destroys this GeometryMask and nulls any references it holds.\n *\n * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it,\n * so be sure to call `clearMask` on any Game Object using it, before destroying it.\n *\n * @method Phaser.Display.Masks.GeometryMask#destroy\n * @since 3.7.0\n */\n destroy: function ()\n {\n this.geometryMask = null;\n }\n\n});\n\nmodule.exports = GeometryMask;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar BlendModes = require('../renderer/BlendModes');\nvar GetAdvancedValue = require('../utils/object/GetAdvancedValue');\n\n/**\n * Builds a Game Object using the provided configuration object.\n *\n * @function Phaser.GameObjects.BuildGameObject\n * @since 3.0.0\n *\n * @param {Phaser.Scene} scene - A reference to the Scene.\n * @param {Phaser.GameObjects.GameObject} gameObject - The initial GameObject.\n * @param {Phaser.Types.GameObjects.GameObjectConfig} config - The config to build the GameObject with.\n *\n * @return {Phaser.GameObjects.GameObject} The built Game Object.\n */\nvar BuildGameObject = function (scene, gameObject, config)\n{\n // Position\n\n gameObject.x = GetAdvancedValue(config, 'x', 0);\n gameObject.y = GetAdvancedValue(config, 'y', 0);\n gameObject.depth = GetAdvancedValue(config, 'depth', 0);\n\n // Flip\n\n gameObject.flipX = GetAdvancedValue(config, 'flipX', false);\n gameObject.flipY = GetAdvancedValue(config, 'flipY', false);\n\n // Scale\n // Either: { scale: 2 } or { scale: { x: 2, y: 2 }}\n\n var scale = GetAdvancedValue(config, 'scale', null);\n\n if (typeof scale === 'number')\n {\n gameObject.setScale(scale);\n }\n else if (scale !== null)\n {\n gameObject.scaleX = GetAdvancedValue(scale, 'x', 1);\n gameObject.scaleY = GetAdvancedValue(scale, 'y', 1);\n }\n\n // ScrollFactor\n // Either: { scrollFactor: 2 } or { scrollFactor: { x: 2, y: 2 }}\n\n var scrollFactor = GetAdvancedValue(config, 'scrollFactor', null);\n\n if (typeof scrollFactor === 'number')\n {\n gameObject.setScrollFactor(scrollFactor);\n }\n else if (scrollFactor !== null)\n {\n gameObject.scrollFactorX = GetAdvancedValue(scrollFactor, 'x', 1);\n gameObject.scrollFactorY = GetAdvancedValue(scrollFactor, 'y', 1);\n }\n\n // Rotation\n\n gameObject.rotation = GetAdvancedValue(config, 'rotation', 0);\n\n var angle = GetAdvancedValue(config, 'angle', null);\n\n if (angle !== null)\n {\n gameObject.angle = angle;\n }\n\n // Alpha\n\n gameObject.alpha = GetAdvancedValue(config, 'alpha', 1);\n\n // Origin\n // Either: { origin: 0.5 } or { origin: { x: 0.5, y: 0.5 }}\n\n var origin = GetAdvancedValue(config, 'origin', null);\n\n if (typeof origin === 'number')\n {\n gameObject.setOrigin(origin);\n }\n else if (origin !== null)\n {\n var ox = GetAdvancedValue(origin, 'x', 0.5);\n var oy = GetAdvancedValue(origin, 'y', 0.5);\n\n gameObject.setOrigin(ox, oy);\n }\n\n // BlendMode\n\n gameObject.blendMode = GetAdvancedValue(config, 'blendMode', BlendModes.NORMAL);\n\n // Visible\n\n gameObject.visible = GetAdvancedValue(config, 'visible', true);\n\n // Add to Scene\n\n var add = GetAdvancedValue(config, 'add', true);\n\n if (add)\n {\n scene.sys.displayList.add(gameObject);\n }\n\n if (gameObject.preUpdate)\n {\n scene.sys.updateList.add(gameObject);\n }\n\n return gameObject;\n};\n\nmodule.exports = BuildGameObject;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../utils/Class');\nvar ComponentsToJSON = require('./components/ToJSON');\nvar DataManager = require('../data/DataManager');\nvar EventEmitter = require('eventemitter3');\nvar Events = require('./events');\n\n/**\n * @classdesc\n * The base class that all Game Objects extend.\n * You don't create GameObjects directly and they cannot be added to the display list.\n * Instead, use them as the base for your own custom classes.\n *\n * @class GameObject\n * @memberof Phaser.GameObjects\n * @extends Phaser.Events.EventEmitter\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.\n * @param {string} type - A textual representation of the type of Game Object, i.e. `sprite`.\n */\nvar GameObject = new Class({\n\n Extends: EventEmitter,\n\n initialize:\n\n function GameObject (scene, type)\n {\n EventEmitter.call(this);\n\n /**\n * A reference to the Scene to which this Game Object belongs.\n *\n * Game Objects can only belong to one Scene.\n *\n * You should consider this property as being read-only. You cannot move a\n * Game Object to another Scene by simply changing it.\n *\n * @name Phaser.GameObjects.GameObject#scene\n * @type {Phaser.Scene}\n * @since 3.0.0\n */\n this.scene = scene;\n\n /**\n * Holds a reference to the Display List that contains this Game Object.\n *\n * This is set automatically when this Game Object is added to a Scene or Layer.\n *\n * You should treat this property as being read-only.\n *\n * @name Phaser.GameObjects.GameObject#displayList\n * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)}\n * @default null\n * @since 3.50.0\n */\n this.displayList = null;\n\n /**\n * A textual representation of this Game Object, i.e. `sprite`.\n * Used internally by Phaser but is available for your own custom classes to populate.\n *\n * @name Phaser.GameObjects.GameObject#type\n * @type {string}\n * @since 3.0.0\n */\n this.type = type;\n\n /**\n * The current state of this Game Object.\n *\n * Phaser itself will never modify this value, although plugins may do so.\n *\n * Use this property to track the state of a Game Object during its lifetime. For example, it could change from\n * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant\n * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons.\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\n *\n * @name Phaser.GameObjects.GameObject#state\n * @type {(number|string)}\n * @since 3.16.0\n */\n this.state = 0;\n\n /**\n * The parent Container of this Game Object, if it has one.\n *\n * @name Phaser.GameObjects.GameObject#parentContainer\n * @type {Phaser.GameObjects.Container}\n * @since 3.4.0\n */\n this.parentContainer = null;\n\n /**\n * The name of this Game Object.\n * Empty by default and never populated by Phaser, this is left for developers to use.\n *\n * @name Phaser.GameObjects.GameObject#name\n * @type {string}\n * @default ''\n * @since 3.0.0\n */\n this.name = '';\n\n /**\n * The active state of this Game Object.\n * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it.\n * An active object is one which is having its logic and internal systems updated.\n *\n * @name Phaser.GameObjects.GameObject#active\n * @type {boolean}\n * @default true\n * @since 3.0.0\n */\n this.active = true;\n\n /**\n * The Tab Index of the Game Object.\n * Reserved for future use by plugins and the Input Manager.\n *\n * @name Phaser.GameObjects.GameObject#tabIndex\n * @type {number}\n * @default -1\n * @since 3.0.0\n */\n this.tabIndex = -1;\n\n /**\n * A Data Manager.\n * It allows you to store, query and get key/value paired information specific to this Game Object.\n * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`.\n *\n * @name Phaser.GameObjects.GameObject#data\n * @type {Phaser.Data.DataManager}\n * @default null\n * @since 3.0.0\n */\n this.data = null;\n\n /**\n * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.\n * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.\n * If those components are not used by your custom class then you can use this bitmask as you wish.\n *\n * @name Phaser.GameObjects.GameObject#renderFlags\n * @type {number}\n * @default 15\n * @since 3.0.0\n */\n this.renderFlags = 15;\n\n /**\n * A bitmask that controls if this Game Object is drawn by a Camera or not.\n * Not usually set directly, instead call `Camera.ignore`, however you can\n * set this property directly using the Camera.id property:\n *\n * @example\n * this.cameraFilter |= camera.id\n *\n * @name Phaser.GameObjects.GameObject#cameraFilter\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.cameraFilter = 0;\n\n /**\n * If this Game Object is enabled for input then this property will contain an InteractiveObject instance.\n * Not usually set directly. Instead call `GameObject.setInteractive()`.\n *\n * @name Phaser.GameObjects.GameObject#input\n * @type {?Phaser.Types.Input.InteractiveObject}\n * @default null\n * @since 3.0.0\n */\n this.input = null;\n\n /**\n * If this Game Object is enabled for Arcade or Matter Physics then this property will contain a reference to a Physics Body.\n *\n * @name Phaser.GameObjects.GameObject#body\n * @type {?(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody|MatterJS.BodyType)}\n * @default null\n * @since 3.0.0\n */\n this.body = null;\n\n /**\n * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`.\n * This includes calls that may come from a Group, Container or the Scene itself.\n * While it allows you to persist a Game Object across Scenes, please understand you are entirely\n * responsible for managing references to and from this Game Object.\n *\n * @name Phaser.GameObjects.GameObject#ignoreDestroy\n * @type {boolean}\n * @default false\n * @since 3.5.0\n */\n this.ignoreDestroy = false;\n\n // Tell the Scene to re-sort the children\n scene.sys.queueDepthSort();\n },\n\n /**\n * Sets the `active` property of this Game Object and returns this Game Object for further chaining.\n * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList.\n *\n * @method Phaser.GameObjects.GameObject#setActive\n * @since 3.0.0\n *\n * @param {boolean} value - True if this Game Object should be set as active, false if not.\n *\n * @return {this} This GameObject.\n */\n setActive: function (value)\n {\n this.active = value;\n\n return this;\n },\n\n /**\n * Sets the `name` property of this Game Object and returns this Game Object for further chaining.\n * The `name` property is not populated by Phaser and is presented for your own use.\n *\n * @method Phaser.GameObjects.GameObject#setName\n * @since 3.0.0\n *\n * @param {string} value - The name to be given to this Game Object.\n *\n * @return {this} This GameObject.\n */\n setName: function (value)\n {\n this.name = value;\n\n return this;\n },\n\n /**\n * Sets the current state of this Game Object.\n *\n * Phaser itself will never modify the State of a Game Object, although plugins may do so.\n *\n * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'.\n * The state value should typically be an integer (ideally mapped to a constant\n * in your game code), but could also be a string. It is recommended to keep it light and simple.\n * If you need to store complex data about your Game Object, look at using the Data Component instead.\n *\n * @method Phaser.GameObjects.GameObject#setState\n * @since 3.16.0\n *\n * @param {(number|string)} value - The state of the Game Object.\n *\n * @return {this} This GameObject.\n */\n setState: function (value)\n {\n this.state = value;\n\n return this;\n },\n\n /**\n * Adds a Data Manager component to this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#setDataEnabled\n * @since 3.0.0\n * @see Phaser.Data.DataManager\n *\n * @return {this} This GameObject.\n */\n setDataEnabled: function ()\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n return this;\n },\n\n /**\n * Allows you to store a key value pair within this Game Objects Data Manager.\n *\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\n * before setting the value.\n *\n * If the key doesn't already exist in the Data Manager then it is created.\n *\n * ```javascript\n * sprite.setData('name', 'Red Gem Stone');\n * ```\n *\n * You can also pass in an object of key value pairs as the first argument:\n *\n * ```javascript\n * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 });\n * ```\n *\n * To get a value back again you can call `getData`:\n *\n * ```javascript\n * sprite.getData('gold');\n * ```\n *\n * Or you can access the value directly via the `values` property, where it works like any other variable:\n *\n * ```javascript\n * sprite.data.values.gold += 50;\n * ```\n *\n * When the value is first set, a `setdata` event is emitted from this Game Object.\n *\n * If the key already exists, a `changedata` event is emitted instead, along an event named after the key.\n * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`.\n * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter.\n *\n * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings.\n * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager.\n *\n * @method Phaser.GameObjects.GameObject#setData\n * @since 3.0.0\n *\n * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored.\n * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored.\n *\n * @return {this} This GameObject.\n */\n setData: function (key, value)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n this.data.set(key, value);\n\n return this;\n },\n\n /**\n * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0.\n *\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\n * before setting the value.\n *\n * If the key doesn't already exist in the Data Manager then it is created.\n *\n * When the value is first set, a `setdata` event is emitted from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#incData\n * @since 3.23.0\n *\n * @param {(string|object)} key - The key to increase the value for.\n * @param {*} [data] - The value to increase for the given key.\n *\n * @return {this} This GameObject.\n */\n incData: function (key, value)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n this.data.inc(key, value);\n\n return this;\n },\n\n /**\n * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false.\n *\n * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled\n * before setting the value.\n *\n * If the key doesn't already exist in the Data Manager then it is created.\n *\n * When the value is first set, a `setdata` event is emitted from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#toggleData\n * @since 3.23.0\n *\n * @param {(string|object)} key - The key to toggle the value for.\n *\n * @return {this} This GameObject.\n */\n toggleData: function (key)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n this.data.toggle(key);\n\n return this;\n },\n\n /**\n * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist.\n *\n * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either:\n *\n * ```javascript\n * sprite.getData('gold');\n * ```\n *\n * Or access the value directly:\n *\n * ```javascript\n * sprite.data.values.gold;\n * ```\n *\n * You can also pass in an array of keys, in which case an array of values will be returned:\n *\n * ```javascript\n * sprite.getData([ 'gold', 'armor', 'health' ]);\n * ```\n *\n * This approach is useful for destructuring arrays in ES6.\n *\n * @method Phaser.GameObjects.GameObject#getData\n * @since 3.0.0\n *\n * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys.\n *\n * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array.\n */\n getData: function (key)\n {\n if (!this.data)\n {\n this.data = new DataManager(this);\n }\n\n return this.data.get(key);\n },\n\n /**\n * Pass this Game Object to the Input Manager to enable it for Input.\n *\n * Input works by using hit areas, these are nearly always geometric shapes, such as rectangles or circles, that act as the hit area\n * for the Game Object. However, you can provide your own hit area shape and callback, should you wish to handle some more advanced\n * input detection.\n *\n * If no arguments are provided it will try and create a rectangle hit area based on the texture frame the Game Object is using. If\n * this isn't a texture-bound object, such as a Graphics or BitmapText object, this will fail, and you'll need to provide a specific\n * shape for it to use.\n *\n * You can also provide an Input Configuration Object as the only argument to this method.\n *\n * @example\n * sprite.setInteractive();\n *\n * @example\n * sprite.setInteractive(new Phaser.Geom.Circle(45, 46, 45), Phaser.Geom.Circle.Contains);\n *\n * @example\n * graphics.setInteractive(new Phaser.Geom.Rectangle(0, 0, 128, 128), Phaser.Geom.Rectangle.Contains);\n *\n * @method Phaser.GameObjects.GameObject#setInteractive\n * @since 3.0.0\n *\n * @param {(Phaser.Types.Input.InputConfiguration|any)} [hitArea] - Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame.\n * @param {Phaser.Types.Input.HitAreaCallback} [callback] - The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback.\n * @param {boolean} [dropZone=false] - Should this Game Object be treated as a drop zone target?\n *\n * @return {this} This GameObject.\n */\n setInteractive: function (hitArea, hitAreaCallback, dropZone)\n {\n this.scene.sys.input.enable(this, hitArea, hitAreaCallback, dropZone);\n\n return this;\n },\n\n /**\n * If this Game Object has previously been enabled for input, this will disable it.\n *\n * An object that is disabled for input stops processing or being considered for\n * input events, but can be turned back on again at any time by simply calling\n * `setInteractive()` with no arguments provided.\n *\n * If want to completely remove interaction from this Game Object then use `removeInteractive` instead.\n *\n * @method Phaser.GameObjects.GameObject#disableInteractive\n * @since 3.7.0\n *\n * @return {this} This GameObject.\n */\n disableInteractive: function ()\n {\n if (this.input)\n {\n this.input.enabled = false;\n }\n\n return this;\n },\n\n /**\n * If this Game Object has previously been enabled for input, this will queue it\n * for removal, causing it to no longer be interactive. The removal happens on\n * the next game step, it is not immediate.\n *\n * The Interactive Object that was assigned to this Game Object will be destroyed,\n * removed from the Input Manager and cleared from this Game Object.\n *\n * If you wish to re-enable this Game Object at a later date you will need to\n * re-create its InteractiveObject by calling `setInteractive` again.\n *\n * If you wish to only temporarily stop an object from receiving input then use\n * `disableInteractive` instead, as that toggles the interactive state, where-as\n * this erases it completely.\n *\n * If you wish to resize a hit area, don't remove and then set it as being\n * interactive. Instead, access the hitarea object directly and resize the shape\n * being used. I.e.: `sprite.input.hitArea.setSize(width, height)` (assuming the\n * shape is a Rectangle, which it is by default.)\n *\n * @method Phaser.GameObjects.GameObject#removeInteractive\n * @since 3.7.0\n *\n * @return {this} This GameObject.\n */\n removeInteractive: function ()\n {\n this.scene.sys.input.clear(this);\n\n this.input = undefined;\n\n return this;\n },\n\n /**\n * This callback is invoked when this Game Object is added to a Scene.\n *\n * Can be overriden by custom Game Objects, but be aware of some Game Objects that\n * will use this, such as Sprites, to add themselves into the Update List.\n *\n * You can also listen for the `ADDED_TO_SCENE` event from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#addedToScene\n * @since 3.50.0\n */\n addedToScene: function ()\n {\n },\n\n /**\n * This callback is invoked when this Game Object is removed from a Scene.\n *\n * Can be overriden by custom Game Objects, but be aware of some Game Objects that\n * will use this, such as Sprites, to removed themselves from the Update List.\n *\n * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object.\n *\n * @method Phaser.GameObjects.GameObject#removedFromScene\n * @since 3.50.0\n */\n removedFromScene: function ()\n {\n },\n\n /**\n * To be overridden by custom GameObjects. Allows base objects to be used in a Pool.\n *\n * @method Phaser.GameObjects.GameObject#update\n * @since 3.0.0\n *\n * @param {...*} [args] - args\n */\n update: function ()\n {\n },\n\n /**\n * Returns a JSON representation of the Game Object.\n *\n * @method Phaser.GameObjects.GameObject#toJSON\n * @since 3.0.0\n *\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\n */\n toJSON: function ()\n {\n return ComponentsToJSON(this);\n },\n\n /**\n * Compares the renderMask with the renderFlags to see if this Game Object will render or not.\n * Also checks the Game Object against the given Cameras exclusion list.\n *\n * @method Phaser.GameObjects.GameObject#willRender\n * @since 3.0.0\n *\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object.\n *\n * @return {boolean} True if the Game Object should be rendered, otherwise false.\n */\n willRender: function (camera)\n {\n return !(GameObject.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\n },\n\n /**\n * Returns an array containing the display list index of either this Game Object, or if it has one,\n * its parent Container. It then iterates up through all of the parent containers until it hits the\n * root of the display list (which is index 0 in the returned array).\n *\n * Used internally by the InputPlugin but also useful if you wish to find out the display depth of\n * this Game Object and all of its ancestors.\n *\n * @method Phaser.GameObjects.GameObject#getIndexList\n * @since 3.4.0\n *\n * @return {number[]} An array of display list position indexes.\n */\n getIndexList: function ()\n {\n // eslint-disable-next-line consistent-this\n var child = this;\n var parent = this.parentContainer;\n\n var indexes = [];\n\n while (parent)\n {\n // indexes.unshift([parent.getIndex(child), parent.name]);\n indexes.unshift(parent.getIndex(child));\n\n child = parent;\n\n if (!parent.parentContainer)\n {\n break;\n }\n else\n {\n parent = parent.parentContainer;\n }\n }\n\n // indexes.unshift([this.scene.sys.displayList.getIndex(child), 'root']);\n indexes.unshift(this.scene.sys.displayList.getIndex(child));\n\n return indexes;\n },\n\n /**\n * Destroys this Game Object removing it from the Display List and Update List and\n * severing all ties to parent resources.\n *\n * Also removes itself from the Input Manager and Physics Manager if previously enabled.\n *\n * Use this to remove a Game Object from your game if you don't ever plan to use it again.\n * As long as no reference to it exists within your own code it should become free for\n * garbage collection by the browser.\n *\n * If you just want to temporarily disable an object then look at using the\n * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected.\n *\n * @method Phaser.GameObjects.GameObject#destroy\n * @fires Phaser.GameObjects.Events#DESTROY\n * @since 3.0.0\n */\n destroy: function ()\n {\n // This Game Object has already been destroyed\n if (!this.scene || this.ignoreDestroy)\n {\n return;\n }\n\n if (this.preDestroy)\n {\n this.preDestroy.call(this);\n }\n\n this.emit(Events.DESTROY, this);\n\n this.removeAllListeners();\n\n if (this.postPipelines)\n {\n this.resetPostPipeline(true);\n }\n\n if (this.displayList)\n {\n this.displayList.queueDepthSort();\n this.displayList.remove(this);\n }\n\n if (this.input)\n {\n this.scene.sys.input.clear(this);\n\n this.input = undefined;\n }\n\n if (this.data)\n {\n this.data.destroy();\n\n this.data = undefined;\n }\n\n if (this.body)\n {\n this.body.destroy();\n\n this.body = undefined;\n }\n\n this.active = false;\n this.visible = false;\n\n this.scene = undefined;\n this.displayList = undefined;\n this.parentContainer = undefined;\n }\n\n});\n\n/**\n * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not.\n *\n * @constant {number} RENDER_MASK\n * @memberof Phaser.GameObjects.GameObject\n * @default\n */\nGameObject.RENDER_MASK = 15;\n\nmodule.exports = GameObject;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar TransformMatrix = require('./components/TransformMatrix');\n\nvar tempMatrix1 = new TransformMatrix();\nvar tempMatrix2 = new TransformMatrix();\nvar tempMatrix3 = new TransformMatrix();\n\nvar result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 };\n\n/**\n * Calculates the Transform Matrix of the given Game Object and Camera, factoring in\n * the parent matrix if provided.\n *\n * Note that the object this results contains _references_ to the Transform Matrices,\n * not new instances of them. Therefore, you should use their values immediately, or\n * copy them to your own matrix, as they will be replaced as soon as another Game\n * Object is rendered.\n *\n * @function Phaser.GameObjects.GetCalcMatrix\n * @memberof Phaser.GameObjects\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any.\n *\n * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices.\n */\nvar GetCalcMatrix = function (src, camera, parentMatrix)\n{\n var camMatrix = tempMatrix1;\n var spriteMatrix = tempMatrix2;\n var calcMatrix = tempMatrix3;\n\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY);\n\n camMatrix.copyFrom(camera.matrix);\n\n if (parentMatrix)\n {\n // Multiply the camera by the parent matrix\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\n\n // Undo the camera scroll\n spriteMatrix.e = src.x;\n spriteMatrix.f = src.y;\n }\n else\n {\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\n }\n\n // Multiply by the Sprite matrix, store result in calcMatrix\n camMatrix.multiply(spriteMatrix, calcMatrix);\n\n return result;\n};\n\nmodule.exports = GetCalcMatrix;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Clamp = require('../../math/Clamp');\n\n// bitmask flag for GameObject.renderMask\nvar _FLAG = 2; // 0010\n\n/**\n * Provides methods used for setting the alpha properties of a Game Object.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.Alpha\n * @since 3.0.0\n */\n\nvar Alpha = {\n\n /**\n * Private internal value. Holds the global alpha value.\n *\n * @name Phaser.GameObjects.Components.Alpha#_alpha\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _alpha: 1,\n\n /**\n * Private internal value. Holds the top-left alpha value.\n *\n * @name Phaser.GameObjects.Components.Alpha#_alphaTL\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _alphaTL: 1,\n\n /**\n * Private internal value. Holds the top-right alpha value.\n *\n * @name Phaser.GameObjects.Components.Alpha#_alphaTR\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _alphaTR: 1,\n\n /**\n * Private internal value. Holds the bottom-left alpha value.\n *\n * @name Phaser.GameObjects.Components.Alpha#_alphaBL\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _alphaBL: 1,\n\n /**\n * Private internal value. Holds the bottom-right alpha value.\n *\n * @name Phaser.GameObjects.Components.Alpha#_alphaBR\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _alphaBR: 1,\n\n /**\n * Clears all alpha values associated with this Game Object.\n *\n * Immediately sets the alpha levels back to 1 (fully opaque).\n *\n * @method Phaser.GameObjects.Components.Alpha#clearAlpha\n * @since 3.0.0\n *\n * @return {this} This Game Object instance.\n */\n clearAlpha: function ()\n {\n return this.setAlpha(1);\n },\n\n /**\n * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\n *\n * If your game is running under WebGL you can optionally specify four different alpha values, each of which\n * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used.\n *\n * @method Phaser.GameObjects.Components.Alpha#setAlpha\n * @since 3.0.0\n *\n * @param {number} [topLeft=1] - The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object.\n * @param {number} [topRight] - The alpha value used for the top-right of the Game Object. WebGL only.\n * @param {number} [bottomLeft] - The alpha value used for the bottom-left of the Game Object. WebGL only.\n * @param {number} [bottomRight] - The alpha value used for the bottom-right of the Game Object. WebGL only.\n *\n * @return {this} This Game Object instance.\n */\n setAlpha: function (topLeft, topRight, bottomLeft, bottomRight)\n {\n if (topLeft === undefined) { topLeft = 1; }\n\n // Treat as if there is only one alpha value for the whole Game Object\n if (topRight === undefined)\n {\n this.alpha = topLeft;\n }\n else\n {\n this._alphaTL = Clamp(topLeft, 0, 1);\n this._alphaTR = Clamp(topRight, 0, 1);\n this._alphaBL = Clamp(bottomLeft, 0, 1);\n this._alphaBR = Clamp(bottomRight, 0, 1);\n }\n\n return this;\n },\n\n /**\n * The alpha value of the Game Object.\n *\n * This is a global value, impacting the entire Game Object, not just a region of it.\n *\n * @name Phaser.GameObjects.Components.Alpha#alpha\n * @type {number}\n * @since 3.0.0\n */\n alpha: {\n\n get: function ()\n {\n return this._alpha;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n this._alpha = v;\n this._alphaTL = v;\n this._alphaTR = v;\n this._alphaBL = v;\n this._alphaBR = v;\n\n if (v === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The alpha value starting from the top-left of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Alpha#alphaTopLeft\n * @type {number}\n * @webglOnly\n * @since 3.0.0\n */\n alphaTopLeft: {\n\n get: function ()\n {\n return this._alphaTL;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n this._alphaTL = v;\n\n if (v !== 0)\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The alpha value starting from the top-right of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Alpha#alphaTopRight\n * @type {number}\n * @webglOnly\n * @since 3.0.0\n */\n alphaTopRight: {\n\n get: function ()\n {\n return this._alphaTR;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n this._alphaTR = v;\n\n if (v !== 0)\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The alpha value starting from the bottom-left of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomLeft\n * @type {number}\n * @webglOnly\n * @since 3.0.0\n */\n alphaBottomLeft: {\n\n get: function ()\n {\n return this._alphaBL;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n this._alphaBL = v;\n\n if (v !== 0)\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The alpha value starting from the bottom-right of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Alpha#alphaBottomRight\n * @type {number}\n * @webglOnly\n * @since 3.0.0\n */\n alphaBottomRight: {\n\n get: function ()\n {\n return this._alphaBR;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n this._alphaBR = v;\n\n if (v !== 0)\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n }\n\n};\n\nmodule.exports = Alpha;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Clamp = require('../../math/Clamp');\n\n// bitmask flag for GameObject.renderMask\nvar _FLAG = 2; // 0010\n\n/**\n * Provides methods used for setting the alpha property of a Game Object.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.AlphaSingle\n * @since 3.22.0\n */\n\nvar AlphaSingle = {\n\n /**\n * Private internal value. Holds the global alpha value.\n *\n * @name Phaser.GameObjects.Components.AlphaSingle#_alpha\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _alpha: 1,\n\n /**\n * Clears all alpha values associated with this Game Object.\n *\n * Immediately sets the alpha levels back to 1 (fully opaque).\n *\n * @method Phaser.GameObjects.Components.AlphaSingle#clearAlpha\n * @since 3.0.0\n *\n * @return {this} This Game Object instance.\n */\n clearAlpha: function ()\n {\n return this.setAlpha(1);\n },\n\n /**\n * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders.\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\n *\n * @method Phaser.GameObjects.Components.AlphaSingle#setAlpha\n * @since 3.0.0\n *\n * @param {number} [value=1] - The alpha value applied across the whole Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setAlpha: function (value)\n {\n if (value === undefined) { value = 1; }\n\n this.alpha = value;\n\n return this;\n },\n\n /**\n * The alpha value of the Game Object.\n *\n * This is a global value, impacting the entire Game Object, not just a region of it.\n *\n * @name Phaser.GameObjects.Components.AlphaSingle#alpha\n * @type {number}\n * @since 3.0.0\n */\n alpha: {\n\n get: function ()\n {\n return this._alpha;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n this._alpha = v;\n\n if (v === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n }\n\n};\n\nmodule.exports = AlphaSingle;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar BlendModes = require('../../renderer/BlendModes');\n\n/**\n * Provides methods used for setting the blend mode of a Game Object.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.BlendMode\n * @since 3.0.0\n */\n\nvar BlendMode = {\n\n /**\n * Private internal value. Holds the current blend mode.\n * \n * @name Phaser.GameObjects.Components.BlendMode#_blendMode\n * @type {number}\n * @private\n * @default 0\n * @since 3.0.0\n */\n _blendMode: BlendModes.NORMAL,\n\n /**\n * Sets the Blend Mode being used by this Game Object.\n *\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\n *\n * Under WebGL only the following Blend Modes are available:\n *\n * * ADD\n * * MULTIPLY\n * * SCREEN\n * * ERASE\n *\n * Canvas has more available depending on browser support.\n *\n * You can also create your own custom Blend Modes in WebGL.\n *\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\n * reasons try to be careful about the construction of your Scene and the frequency of which blend modes\n * are used.\n *\n * @name Phaser.GameObjects.Components.BlendMode#blendMode\n * @type {(Phaser.BlendModes|string)}\n * @since 3.0.0\n */\n blendMode: {\n\n get: function ()\n {\n return this._blendMode;\n },\n\n set: function (value)\n {\n if (typeof value === 'string')\n {\n value = BlendModes[value];\n }\n\n value |= 0;\n\n if (value >= -1)\n {\n this._blendMode = value;\n }\n }\n\n },\n\n /**\n * Sets the Blend Mode being used by this Game Object.\n *\n * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay)\n *\n * Under WebGL only the following Blend Modes are available:\n *\n * * ADD\n * * MULTIPLY\n * * SCREEN\n * * ERASE (only works when rendering to a framebuffer, like a Render Texture)\n *\n * Canvas has more available depending on browser support.\n *\n * You can also create your own custom Blend Modes in WebGL.\n *\n * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending\n * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these\n * reasons try to be careful about the construction of your Scene and the frequency in which blend modes\n * are used.\n *\n * @method Phaser.GameObjects.Components.BlendMode#setBlendMode\n * @since 3.0.0\n *\n * @param {(string|Phaser.BlendModes)} value - The BlendMode value. Either a string or a CONST.\n *\n * @return {this} This Game Object instance.\n */\n setBlendMode: function (value)\n {\n this.blendMode = value;\n\n return this;\n }\n\n};\n\nmodule.exports = BlendMode;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for calculating and setting the size of a non-Frame based Game Object.\n * Should be applied as a mixin and not used directly.\n * \n * @namespace Phaser.GameObjects.Components.ComputedSize\n * @since 3.0.0\n */\n\nvar ComputedSize = {\n\n /**\n * The native (un-scaled) width of this Game Object.\n * \n * Changing this value will not change the size that the Game Object is rendered in-game.\n * For that you need to either set the scale of the Game Object (`setScale`) or use\n * the `displayWidth` property.\n * \n * @name Phaser.GameObjects.Components.ComputedSize#width\n * @type {number}\n * @since 3.0.0\n */\n width: 0,\n\n /**\n * The native (un-scaled) height of this Game Object.\n * \n * Changing this value will not change the size that the Game Object is rendered in-game.\n * For that you need to either set the scale of the Game Object (`setScale`) or use\n * the `displayHeight` property.\n * \n * @name Phaser.GameObjects.Components.ComputedSize#height\n * @type {number}\n * @since 3.0.0\n */\n height: 0,\n\n /**\n * The displayed width of this Game Object.\n * \n * This value takes into account the scale factor.\n * \n * Setting this value will adjust the Game Object's scale property.\n * \n * @name Phaser.GameObjects.Components.ComputedSize#displayWidth\n * @type {number}\n * @since 3.0.0\n */\n displayWidth: {\n\n get: function ()\n {\n return this.scaleX * this.width;\n },\n\n set: function (value)\n {\n this.scaleX = value / this.width;\n }\n\n },\n\n /**\n * The displayed height of this Game Object.\n * \n * This value takes into account the scale factor.\n * \n * Setting this value will adjust the Game Object's scale property.\n * \n * @name Phaser.GameObjects.Components.ComputedSize#displayHeight\n * @type {number}\n * @since 3.0.0\n */\n displayHeight: {\n\n get: function ()\n {\n return this.scaleY * this.height;\n },\n\n set: function (value)\n {\n this.scaleY = value / this.height;\n }\n\n },\n\n /**\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\n * \n * This will not change the size that the Game Object is rendered in-game.\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\n * to do so by giving pixel values.\n * \n * If you have enabled this Game Object for input, changing the size will _not_ change the\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\n * \n * @method Phaser.GameObjects.Components.ComputedSize#setSize\n * @since 3.4.0\n *\n * @param {number} width - The width of this Game Object.\n * @param {number} height - The height of this Game Object.\n * \n * @return {this} This Game Object instance.\n */\n setSize: function (width, height)\n {\n this.width = width;\n this.height = height;\n\n return this;\n },\n\n /**\n * Sets the display size of this Game Object.\n * \n * Calling this will adjust the scale.\n * \n * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize\n * @since 3.4.0\n *\n * @param {number} width - The width of this Game Object.\n * @param {number} height - The height of this Game Object.\n * \n * @return {this} This Game Object instance.\n */\n setDisplaySize: function (width, height)\n {\n this.displayWidth = width;\n this.displayHeight = height;\n\n return this;\n }\n\n};\n\nmodule.exports = ComputedSize;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for getting and setting the texture of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.Crop\n * @since 3.12.0\n */\n\nvar Crop = {\n\n /**\n * The Texture this Game Object is using to render with.\n *\n * @name Phaser.GameObjects.Components.Crop#texture\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\n * @since 3.0.0\n */\n texture: null,\n\n /**\n * The Texture Frame this Game Object is using to render with.\n *\n * @name Phaser.GameObjects.Components.Crop#frame\n * @type {Phaser.Textures.Frame}\n * @since 3.0.0\n */\n frame: null,\n\n /**\n * A boolean flag indicating if this Game Object is being cropped or not.\n * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off.\n * Equally, calling `setCrop` with no arguments will reset the crop and disable it.\n *\n * @name Phaser.GameObjects.Components.Crop#isCropped\n * @type {boolean}\n * @since 3.11.0\n */\n isCropped: false,\n\n /**\n * Applies a crop to a texture based Game Object, such as a Sprite or Image.\n * \n * The crop is a rectangle that limits the area of the texture frame that is visible during rendering.\n * \n * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just\n * changes what is shown when rendered.\n * \n * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left.\n * \n * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left\n * half of it, you could call `setCrop(0, 0, 400, 600)`.\n * \n * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop\n * an area of 200x100 when applied to a Game Object that had a scale factor of 2.\n * \n * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument.\n * \n * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`.\n * \n * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow\n * the renderer to skip several internal calculations.\n *\n * @method Phaser.GameObjects.Components.Crop#setCrop\n * @since 3.11.0\n *\n * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored.\n * @param {number} [y] - The y coordinate to start the crop from.\n * @param {number} [width] - The width of the crop rectangle in pixels.\n * @param {number} [height] - The height of the crop rectangle in pixels.\n *\n * @return {this} This Game Object instance.\n */\n setCrop: function (x, y, width, height)\n {\n if (x === undefined)\n {\n this.isCropped = false;\n }\n else if (this.frame)\n {\n if (typeof x === 'number')\n {\n this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY);\n }\n else\n {\n var rect = x;\n\n this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY);\n }\n\n this.isCropped = true;\n }\n\n return this;\n },\n\n /**\n * Internal method that returns a blank, well-formed crop object for use by a Game Object.\n *\n * @method Phaser.GameObjects.Components.Crop#resetCropObject\n * @private\n * @since 3.12.0\n * \n * @return {object} The crop object.\n */\n resetCropObject: function ()\n {\n return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 };\n }\n\n};\n\nmodule.exports = Crop;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for setting the depth of a Game Object.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.Depth\n * @since 3.0.0\n */\n\nvar Depth = {\n\n /**\n * Private internal value. Holds the depth of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Depth#_depth\n * @type {number}\n * @private\n * @default 0\n * @since 3.0.0\n */\n _depth: 0,\n\n /**\n * The depth of this Game Object within the Scene.\n *\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\n * of Game Objects, without actually moving their position in the display list.\n *\n * The default depth is zero. A Game Object with a higher depth\n * value will always render in front of one with a lower value.\n *\n * Setting the depth will queue a depth sort event within the Scene.\n *\n * @name Phaser.GameObjects.Components.Depth#depth\n * @type {number}\n * @since 3.0.0\n */\n depth: {\n\n get: function ()\n {\n return this._depth;\n },\n\n set: function (value)\n {\n if (this.displayList)\n {\n this.displayList.queueDepthSort();\n }\n\n this._depth = value;\n }\n\n },\n\n /**\n * The depth of this Game Object within the Scene.\n *\n * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order\n * of Game Objects, without actually moving their position in the display list.\n *\n * The default depth is zero. A Game Object with a higher depth\n * value will always render in front of one with a lower value.\n *\n * Setting the depth will queue a depth sort event within the Scene.\n *\n * @method Phaser.GameObjects.Components.Depth#setDepth\n * @since 3.0.0\n *\n * @param {number} value - The depth of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setDepth: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.depth = value;\n\n return this;\n }\n\n};\n\nmodule.exports = Depth;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for visually flipping a Game Object.\n * Should be applied as a mixin and not used directly.\n * \n * @namespace Phaser.GameObjects.Components.Flip\n * @since 3.0.0\n */\n\nvar Flip = {\n\n /**\n * The horizontally flipped state of the Game Object.\n * \n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\n * \n * @name Phaser.GameObjects.Components.Flip#flipX\n * @type {boolean}\n * @default false\n * @since 3.0.0\n */\n flipX: false,\n\n /**\n * The vertically flipped state of the Game Object.\n * \n * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down)\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\n * \n * @name Phaser.GameObjects.Components.Flip#flipY\n * @type {boolean}\n * @default false\n * @since 3.0.0\n */\n flipY: false,\n\n /**\n * Toggles the horizontal flipped state of this Game Object.\n * \n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\n * \n * @method Phaser.GameObjects.Components.Flip#toggleFlipX\n * @since 3.0.0\n * \n * @return {this} This Game Object instance.\n */\n toggleFlipX: function ()\n {\n this.flipX = !this.flipX;\n\n return this;\n },\n\n /**\n * Toggles the vertical flipped state of this Game Object.\n * \n * @method Phaser.GameObjects.Components.Flip#toggleFlipY\n * @since 3.0.0\n * \n * @return {this} This Game Object instance.\n */\n toggleFlipY: function ()\n {\n this.flipY = !this.flipY;\n\n return this;\n },\n\n /**\n * Sets the horizontal flipped state of this Game Object.\n * \n * A Game Object that is flipped horizontally will render inversed on the horizontal axis.\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\n * \n * @method Phaser.GameObjects.Components.Flip#setFlipX\n * @since 3.0.0\n *\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\n * \n * @return {this} This Game Object instance.\n */\n setFlipX: function (value)\n {\n this.flipX = value;\n\n return this;\n },\n\n /**\n * Sets the vertical flipped state of this Game Object.\n * \n * @method Phaser.GameObjects.Components.Flip#setFlipY\n * @since 3.0.0\n *\n * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped.\n * \n * @return {this} This Game Object instance.\n */\n setFlipY: function (value)\n {\n this.flipY = value;\n\n return this;\n },\n\n /**\n * Sets the horizontal and vertical flipped state of this Game Object.\n * \n * A Game Object that is flipped will render inversed on the flipped axis.\n * Flipping always takes place from the middle of the texture and does not impact the scale value.\n * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.\n * \n * @method Phaser.GameObjects.Components.Flip#setFlip\n * @since 3.0.0\n *\n * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\n * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped.\n * \n * @return {this} This Game Object instance.\n */\n setFlip: function (x, y)\n {\n this.flipX = x;\n this.flipY = y;\n\n return this;\n },\n\n /**\n * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state.\n * \n * @method Phaser.GameObjects.Components.Flip#resetFlip\n * @since 3.0.0\n *\n * @return {this} This Game Object instance.\n */\n resetFlip: function ()\n {\n this.flipX = false;\n this.flipY = false;\n\n return this;\n }\n\n};\n\nmodule.exports = Flip;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Rectangle = require('../../geom/rectangle/Rectangle');\nvar RotateAround = require('../../math/RotateAround');\nvar Vector2 = require('../../math/Vector2');\n\n/**\n * Provides methods used for obtaining the bounds of a Game Object.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.GetBounds\n * @since 3.0.0\n */\n\nvar GetBounds = {\n\n /**\n * Processes the bounds output vector before returning it.\n *\n * @method Phaser.GameObjects.Components.GetBounds#prepareBoundsOutput\n * @private\n * @since 3.18.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} output - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n prepareBoundsOutput: function (output, includeParent)\n {\n if (includeParent === undefined) { includeParent = false; }\n\n if (this.rotation !== 0)\n {\n RotateAround(output, this.x, this.y, this.rotation);\n }\n\n if (includeParent && this.parentContainer)\n {\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\n\n parentMatrix.transformPoint(output.x, output.y, output);\n }\n\n return output;\n },\n\n /**\n * Gets the center coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getCenter\n * @since 3.0.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getCenter: function (output)\n {\n if (output === undefined) { output = new Vector2(); }\n\n output.x = this.x - (this.displayWidth * this.originX) + (this.displayWidth / 2);\n output.y = this.y - (this.displayHeight * this.originY) + (this.displayHeight / 2);\n\n return output;\n },\n\n /**\n * Gets the top-left corner coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getTopLeft\n * @since 3.0.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getTopLeft: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = this.x - (this.displayWidth * this.originX);\n output.y = this.y - (this.displayHeight * this.originY);\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the top-center coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getTopCenter\n * @since 3.18.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getTopCenter: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2);\n output.y = this.y - (this.displayHeight * this.originY);\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the top-right corner coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getTopRight\n * @since 3.0.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getTopRight: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\n output.y = this.y - (this.displayHeight * this.originY);\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the left-center coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getLeftCenter\n * @since 3.18.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getLeftCenter: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = this.x - (this.displayWidth * this.originX);\n output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2);\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the right-center coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getRightCenter\n * @since 3.18.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getRightCenter: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\n output.y = (this.y - (this.displayHeight * this.originY)) + (this.displayHeight / 2);\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the bottom-left corner coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getBottomLeft\n * @since 3.0.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getBottomLeft: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = this.x - (this.displayWidth * this.originX);\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the bottom-center coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getBottomCenter\n * @since 3.18.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getBottomCenter: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = (this.x - (this.displayWidth * this.originX)) + (this.displayWidth / 2);\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the bottom-right corner coordinate of this Game Object, regardless of origin.\n * The returned point is calculated in local space and does not factor in any parent containers\n *\n * @method Phaser.GameObjects.Components.GetBounds#getBottomRight\n * @since 3.0.0\n *\n * @generic {Phaser.Math.Vector2} O - [output,$return]\n *\n * @param {(Phaser.Math.Vector2|object)} [output] - An object to store the values in. If not provided a new Vector2 will be created.\n * @param {boolean} [includeParent=false] - If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector?\n *\n * @return {(Phaser.Math.Vector2|object)} The values stored in the output object.\n */\n getBottomRight: function (output, includeParent)\n {\n if (!output) { output = new Vector2(); }\n\n output.x = (this.x - (this.displayWidth * this.originX)) + this.displayWidth;\n output.y = (this.y - (this.displayHeight * this.originY)) + this.displayHeight;\n\n return this.prepareBoundsOutput(output, includeParent);\n },\n\n /**\n * Gets the bounds of this Game Object, regardless of origin.\n * The values are stored and returned in a Rectangle, or Rectangle-like, object.\n *\n * @method Phaser.GameObjects.Components.GetBounds#getBounds\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Rectangle} O - [output,$return]\n *\n * @param {(Phaser.Geom.Rectangle|object)} [output] - An object to store the values in. If not provided a new Rectangle will be created.\n *\n * @return {(Phaser.Geom.Rectangle|object)} The values stored in the output object.\n */\n getBounds: function (output)\n {\n if (output === undefined) { output = new Rectangle(); }\n\n // We can use the output object to temporarily store the x/y coords in:\n\n var TLx, TLy, TRx, TRy, BLx, BLy, BRx, BRy;\n\n // Instead of doing a check if parent container is \n // defined per corner we only do it once.\n if (this.parentContainer)\n {\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\n\n this.getTopLeft(output);\n parentMatrix.transformPoint(output.x, output.y, output);\n\n TLx = output.x;\n TLy = output.y;\n\n this.getTopRight(output);\n parentMatrix.transformPoint(output.x, output.y, output);\n\n TRx = output.x;\n TRy = output.y;\n\n this.getBottomLeft(output);\n parentMatrix.transformPoint(output.x, output.y, output);\n\n BLx = output.x;\n BLy = output.y;\n\n this.getBottomRight(output);\n parentMatrix.transformPoint(output.x, output.y, output);\n\n BRx = output.x;\n BRy = output.y;\n }\n else\n {\n this.getTopLeft(output);\n\n TLx = output.x;\n TLy = output.y;\n\n this.getTopRight(output);\n\n TRx = output.x;\n TRy = output.y;\n\n this.getBottomLeft(output);\n\n BLx = output.x;\n BLy = output.y;\n\n this.getBottomRight(output);\n\n BRx = output.x;\n BRy = output.y;\n }\n\n output.x = Math.min(TLx, TRx, BLx, BRx);\n output.y = Math.min(TLy, TRy, BLy, BRy);\n output.width = Math.max(TLx, TRx, BLx, BRx) - output.x;\n output.height = Math.max(TLy, TRy, BLy, BRy) - output.y;\n\n return output;\n }\n\n};\n\nmodule.exports = GetBounds;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar BitmapMask = require('../../display/mask/BitmapMask');\nvar GeometryMask = require('../../display/mask/GeometryMask');\n\n/**\n * Provides methods used for getting and setting the mask of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.Mask\n * @since 3.0.0\n */\n\nvar Mask = {\n\n /**\n * The Mask this Game Object is using during render.\n *\n * @name Phaser.GameObjects.Components.Mask#mask\n * @type {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask}\n * @since 3.0.0\n */\n mask: null,\n\n /**\n * Sets the mask that this Game Object will use to render with.\n *\n * The mask must have been previously created and can be either a GeometryMask or a BitmapMask.\n * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas.\n *\n * If a mask is already set on this Game Object it will be immediately replaced.\n *\n * Masks are positioned in global space and are not relative to the Game Object to which they\n * are applied. The reason for this is that multiple Game Objects can all share the same mask.\n *\n * Masks have no impact on physics or input detection. They are purely a rendering component\n * that allows you to limit what is visible during the render pass.\n *\n * @method Phaser.GameObjects.Components.Mask#setMask\n * @since 3.6.2\n *\n * @param {Phaser.Display.Masks.BitmapMask|Phaser.Display.Masks.GeometryMask} mask - The mask this Game Object will use when rendering.\n *\n * @return {this} This Game Object instance.\n */\n setMask: function (mask)\n {\n this.mask = mask;\n\n return this;\n },\n\n /**\n * Clears the mask that this Game Object was using.\n *\n * @method Phaser.GameObjects.Components.Mask#clearMask\n * @since 3.6.2\n *\n * @param {boolean} [destroyMask=false] - Destroy the mask before clearing it?\n *\n * @return {this} This Game Object instance.\n */\n clearMask: function (destroyMask)\n {\n if (destroyMask === undefined) { destroyMask = false; }\n\n if (destroyMask && this.mask)\n {\n this.mask.destroy();\n }\n\n this.mask = null;\n\n return this;\n },\n\n /**\n * Creates and returns a Bitmap Mask. This mask can be used by any Game Object,\n * including this one.\n *\n * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas.\n *\n * To create the mask you need to pass in a reference to a renderable Game Object.\n * A renderable Game Object is one that uses a texture to render with, such as an\n * Image, Sprite, Render Texture or BitmapText.\n *\n * If you do not provide a renderable object, and this Game Object has a texture,\n * it will use itself as the object. This means you can call this method to create\n * a Bitmap Mask from any renderable Game Object.\n *\n * @method Phaser.GameObjects.Components.Mask#createBitmapMask\n * @since 3.6.2\n *\n * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite.\n *\n * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created.\n */\n createBitmapMask: function (renderable)\n {\n if (renderable === undefined && (this.texture || this.shader))\n {\n // eslint-disable-next-line consistent-this\n renderable = this;\n }\n\n return new BitmapMask(this.scene, renderable);\n },\n\n /**\n * Creates and returns a Geometry Mask. This mask can be used by any Game Object,\n * including this one.\n *\n * To create the mask you need to pass in a reference to a Graphics Game Object.\n *\n * If you do not provide a graphics object, and this Game Object is an instance\n * of a Graphics object, then it will use itself to create the mask.\n *\n * This means you can call this method to create a Geometry Mask from any Graphics Game Object.\n *\n * @method Phaser.GameObjects.Components.Mask#createGeometryMask\n * @since 3.6.2\n *\n * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask.\n *\n * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created.\n */\n createGeometryMask: function (graphics)\n {\n if (graphics === undefined && this.type === 'Graphics')\n {\n // eslint-disable-next-line consistent-this\n graphics = this;\n }\n\n return new GeometryMask(this.scene, graphics);\n }\n\n};\n\nmodule.exports = Mask;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for getting and setting the origin of a Game Object.\n * Values are normalized, given in the range 0 to 1.\n * Display values contain the calculated pixel values.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.Origin\n * @since 3.0.0\n */\n\nvar Origin = {\n\n /**\n * A property indicating that a Game Object has this component.\n *\n * @name Phaser.GameObjects.Components.Origin#_originComponent\n * @type {boolean}\n * @private\n * @default true\n * @since 3.2.0\n */\n _originComponent: true,\n\n /**\n * The horizontal origin of this Game Object.\n * The origin maps the relationship between the size and position of the Game Object.\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\n * Setting the value to 0 means the position now relates to the left of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Origin#originX\n * @type {number}\n * @default 0.5\n * @since 3.0.0\n */\n originX: 0.5,\n\n /**\n * The vertical origin of this Game Object.\n * The origin maps the relationship between the size and position of the Game Object.\n * The default value is 0.5, meaning all Game Objects are positioned based on their center.\n * Setting the value to 0 means the position now relates to the top of the Game Object.\n *\n * @name Phaser.GameObjects.Components.Origin#originY\n * @type {number}\n * @default 0.5\n * @since 3.0.0\n */\n originY: 0.5,\n\n // private + read only\n _displayOriginX: 0,\n _displayOriginY: 0,\n\n /**\n * The horizontal display origin of this Game Object.\n * The origin is a normalized value between 0 and 1.\n * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.\n *\n * @name Phaser.GameObjects.Components.Origin#displayOriginX\n * @type {number}\n * @since 3.0.0\n */\n displayOriginX: {\n\n get: function ()\n {\n return this._displayOriginX;\n },\n\n set: function (value)\n {\n this._displayOriginX = value;\n this.originX = value / this.width;\n }\n\n },\n\n /**\n * The vertical display origin of this Game Object.\n * The origin is a normalized value between 0 and 1.\n * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin.\n *\n * @name Phaser.GameObjects.Components.Origin#displayOriginY\n * @type {number}\n * @since 3.0.0\n */\n displayOriginY: {\n\n get: function ()\n {\n return this._displayOriginY;\n },\n\n set: function (value)\n {\n this._displayOriginY = value;\n this.originY = value / this.height;\n }\n\n },\n\n /**\n * Sets the origin of this Game Object.\n *\n * The values are given in the range 0 to 1.\n *\n * @method Phaser.GameObjects.Components.Origin#setOrigin\n * @since 3.0.0\n *\n * @param {number} [x=0.5] - The horizontal origin value.\n * @param {number} [y=x] - The vertical origin value. If not defined it will be set to the value of `x`.\n *\n * @return {this} This Game Object instance.\n */\n setOrigin: function (x, y)\n {\n if (x === undefined) { x = 0.5; }\n if (y === undefined) { y = x; }\n\n this.originX = x;\n this.originY = y;\n\n return this.updateDisplayOrigin();\n },\n\n /**\n * Sets the origin of this Game Object based on the Pivot values in its Frame.\n *\n * @method Phaser.GameObjects.Components.Origin#setOriginFromFrame\n * @since 3.0.0\n *\n * @return {this} This Game Object instance.\n */\n setOriginFromFrame: function ()\n {\n if (!this.frame || !this.frame.customPivot)\n {\n return this.setOrigin();\n }\n else\n {\n this.originX = this.frame.pivotX;\n this.originY = this.frame.pivotY;\n }\n\n return this.updateDisplayOrigin();\n },\n\n /**\n * Sets the display origin of this Game Object.\n * The difference between this and setting the origin is that you can use pixel values for setting the display origin.\n *\n * @method Phaser.GameObjects.Components.Origin#setDisplayOrigin\n * @since 3.0.0\n *\n * @param {number} [x=0] - The horizontal display origin value.\n * @param {number} [y=x] - The vertical display origin value. If not defined it will be set to the value of `x`.\n *\n * @return {this} This Game Object instance.\n */\n setDisplayOrigin: function (x, y)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = x; }\n\n this.displayOriginX = x;\n this.displayOriginY = y;\n\n return this;\n },\n\n /**\n * Updates the Display Origin cached values internally stored on this Game Object.\n * You don't usually call this directly, but it is exposed for edge-cases where you may.\n *\n * @method Phaser.GameObjects.Components.Origin#updateDisplayOrigin\n * @since 3.0.0\n *\n * @return {this} This Game Object instance.\n */\n updateDisplayOrigin: function ()\n {\n this._displayOriginX = this.originX * this.width;\n this._displayOriginY = this.originY * this.height;\n\n return this;\n }\n\n};\n\nmodule.exports = Origin;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar DegToRad = require('../../math/DegToRad');\nvar GetBoolean = require('../../tweens/builders/GetBoolean');\nvar GetValue = require('../../utils/object/GetValue');\nvar TWEEN_CONST = require('../../tweens/tween/const');\nvar Vector2 = require('../../math/Vector2');\n\n/**\n * Provides methods used for managing a Game Object following a Path.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.PathFollower\n * @since 3.17.0\n */\n\nvar PathFollower = {\n\n /**\n * The Path this PathFollower is following. It can only follow one Path at a time.\n *\n * @name Phaser.GameObjects.Components.PathFollower#path\n * @type {Phaser.Curves.Path}\n * @since 3.0.0\n */\n path: null,\n\n /**\n * Should the PathFollower automatically rotate to point in the direction of the Path?\n *\n * @name Phaser.GameObjects.Components.PathFollower#rotateToPath\n * @type {boolean}\n * @default false\n * @since 3.0.0\n */\n rotateToPath: false,\n\n /**\n * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath)\n * this value is added to the rotation value. This allows you to rotate objects to a path but control\n * the angle of the rotation as well.\n *\n * @name Phaser.GameObjects.PathFollower#pathRotationOffset\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n pathRotationOffset: 0,\n\n /**\n * An additional vector to add to the PathFollowers position, allowing you to offset it from the\n * Path coordinates.\n *\n * @name Phaser.GameObjects.PathFollower#pathOffset\n * @type {Phaser.Math.Vector2}\n * @since 3.0.0\n */\n pathOffset: null,\n\n /**\n * A Vector2 that stores the current point of the path the follower is on.\n *\n * @name Phaser.GameObjects.PathFollower#pathVector\n * @type {Phaser.Math.Vector2}\n * @since 3.0.0\n */\n pathVector: null,\n\n /**\n * The distance the follower has traveled from the previous point to the current one, at the last update.\n *\n * @name Phaser.GameObjects.PathFollower#pathDelta\n * @type {Phaser.Math.Vector2}\n * @since 3.23.0\n */\n pathDelta: null,\n\n /**\n * The Tween used for following the Path.\n *\n * @name Phaser.GameObjects.PathFollower#pathTween\n * @type {Phaser.Tweens.Tween}\n * @since 3.0.0\n */\n pathTween: null,\n\n /**\n * Settings for the PathFollower.\n *\n * @name Phaser.GameObjects.PathFollower#pathConfig\n * @type {?Phaser.Types.GameObjects.PathFollower.PathConfig}\n * @default null\n * @since 3.0.0\n */\n pathConfig: null,\n\n /**\n * Records the direction of the follower so it can change direction.\n *\n * @name Phaser.GameObjects.PathFollower#_prevDirection\n * @type {number}\n * @private\n * @since 3.0.0\n */\n _prevDirection: TWEEN_CONST.PLAYING_FORWARD,\n\n /**\n * Set the Path that this PathFollower should follow.\n *\n * Optionally accepts {@link Phaser.Types.GameObjects.PathFollower.PathConfig} settings.\n *\n * @method Phaser.GameObjects.Components.PathFollower#setPath\n * @since 3.0.0\n *\n * @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.\n * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config] - Settings for the PathFollower.\n *\n * @return {this} This Game Object.\n */\n setPath: function (path, config)\n {\n if (config === undefined) { config = this.pathConfig; }\n\n var tween = this.pathTween;\n\n if (tween && tween.isPlaying())\n {\n tween.stop();\n }\n\n this.path = path;\n\n if (config)\n {\n this.startFollow(config);\n }\n\n return this;\n },\n\n /**\n * Set whether the PathFollower should automatically rotate to point in the direction of the Path.\n *\n * @method Phaser.GameObjects.Components.PathFollower#setRotateToPath\n * @since 3.0.0\n *\n * @param {boolean} value - Whether the PathFollower should automatically rotate to point in the direction of the Path.\n * @param {number} [offset=0] - Rotation offset in degrees.\n *\n * @return {this} This Game Object.\n */\n setRotateToPath: function (value, offset)\n {\n if (offset === undefined) { offset = 0; }\n\n this.rotateToPath = value;\n\n this.pathRotationOffset = offset;\n\n return this;\n },\n\n /**\n * Is this PathFollower actively following a Path or not?\n *\n * To be considered as `isFollowing` it must be currently moving on a Path, and not paused.\n *\n * @method Phaser.GameObjects.Components.PathFollower#isFollowing\n * @since 3.0.0\n *\n * @return {boolean} `true` is this PathFollower is actively following a Path, otherwise `false`.\n */\n isFollowing: function ()\n {\n var tween = this.pathTween;\n\n return (tween && tween.isPlaying());\n },\n\n /**\n * Starts this PathFollower following its given Path.\n *\n * @method Phaser.GameObjects.Components.PathFollower#startFollow\n * @since 3.3.0\n *\n * @param {(number|Phaser.Types.GameObjects.PathFollower.PathConfig|Phaser.Types.Tweens.NumberTweenBuilderConfig)} [config={}] - The duration of the follow, or a PathFollower config object.\n * @param {number} [startAt=0] - Optional start position of the follow, between 0 and 1.\n *\n * @return {this} This Game Object.\n */\n startFollow: function (config, startAt)\n {\n if (config === undefined) { config = {}; }\n if (startAt === undefined) { startAt = 0; }\n\n var tween = this.pathTween;\n\n if (tween && tween.isPlaying())\n {\n tween.stop();\n }\n\n if (typeof config === 'number')\n {\n config = { duration: config };\n }\n\n // Override in case they've been specified in the config\n config.from = GetValue(config, 'from', 0);\n config.to = GetValue(config, 'to', 1);\n\n var positionOnPath = GetBoolean(config, 'positionOnPath', false);\n\n this.rotateToPath = GetBoolean(config, 'rotateToPath', false);\n this.pathRotationOffset = GetValue(config, 'rotationOffset', 0);\n\n // This works, but it's not an ideal way of doing it as the follower jumps position\n var seek = GetValue(config, 'startAt', startAt);\n\n if (seek)\n {\n config.onStart = function (tween)\n {\n var tweenData = tween.data[0];\n tweenData.progress = seek;\n tweenData.elapsed = tweenData.duration * seek;\n var v = tweenData.ease(tweenData.progress);\n tweenData.current = tweenData.start + ((tweenData.end - tweenData.start) * v);\n tweenData.target[tweenData.key] = tweenData.current;\n };\n }\n\n if (!this.pathOffset)\n {\n this.pathOffset = new Vector2(this.x, this.y);\n }\n\n if (!this.pathVector)\n {\n this.pathVector = new Vector2();\n }\n\n if (!this.pathDelta)\n {\n this.pathDelta = new Vector2();\n }\n\n this.pathDelta.reset();\n\n this.pathTween = this.scene.sys.tweens.addCounter(config);\n\n // The starting point of the path, relative to this follower\n this.path.getStartPoint(this.pathOffset);\n\n if (positionOnPath)\n {\n this.x = this.pathOffset.x;\n this.y = this.pathOffset.y;\n }\n\n this.pathOffset.x = this.x - this.pathOffset.x;\n this.pathOffset.y = this.y - this.pathOffset.y;\n\n this._prevDirection = TWEEN_CONST.PLAYING_FORWARD;\n\n if (this.rotateToPath)\n {\n // Set the rotation now (in case the tween has a delay on it, etc)\n var nextPoint = this.path.getPoint(0.1);\n\n this.rotation = Math.atan2(nextPoint.y - this.y, nextPoint.x - this.x) + DegToRad(this.pathRotationOffset);\n }\n\n this.pathConfig = config;\n\n return this;\n },\n\n /**\n * Pauses this PathFollower. It will still continue to render, but it will remain motionless at the\n * point on the Path at which you paused it.\n *\n * @method Phaser.GameObjects.Components.PathFollower#pauseFollow\n * @since 3.3.0\n *\n * @return {this} This Game Object.\n */\n pauseFollow: function ()\n {\n var tween = this.pathTween;\n\n if (tween && tween.isPlaying())\n {\n tween.pause();\n }\n\n return this;\n },\n\n /**\n * Resumes a previously paused PathFollower.\n *\n * If the PathFollower was not paused this has no effect.\n *\n * @method Phaser.GameObjects.Components.PathFollower#resumeFollow\n * @since 3.3.0\n *\n * @return {this} This Game Object.\n */\n resumeFollow: function ()\n {\n var tween = this.pathTween;\n\n if (tween && tween.isPaused())\n {\n tween.resume();\n }\n\n return this;\n },\n\n /**\n * Stops this PathFollower from following the path any longer.\n *\n * This will invoke any 'stop' conditions that may exist on the Path, or for the follower.\n *\n * @method Phaser.GameObjects.Components.PathFollower#stopFollow\n * @since 3.3.0\n *\n * @return {this} This Game Object.\n */\n stopFollow: function ()\n {\n var tween = this.pathTween;\n\n if (tween && tween.isPlaying())\n {\n tween.stop();\n }\n\n return this;\n },\n\n /**\n * Internal update handler that advances this PathFollower along the path.\n *\n * Called automatically by the Scene step, should not typically be called directly.\n *\n * @method Phaser.GameObjects.Components.PathFollower#pathUpdate\n * @since 3.17.0\n */\n pathUpdate: function ()\n {\n var tween = this.pathTween;\n\n if (tween)\n {\n var tweenData = tween.data[0];\n var pathDelta = this.pathDelta;\n var pathVector = this.pathVector;\n\n pathDelta.copy(pathVector).negate();\n\n if (tweenData.state === TWEEN_CONST.COMPLETE)\n {\n this.path.getPoint(1, pathVector);\n\n pathDelta.add(pathVector);\n pathVector.add(this.pathOffset);\n\n this.setPosition(pathVector.x, pathVector.y);\n\n return;\n }\n else if (tweenData.state !== TWEEN_CONST.PLAYING_FORWARD && tweenData.state !== TWEEN_CONST.PLAYING_BACKWARD)\n {\n // If delayed, etc then bail out\n return;\n }\n\n this.path.getPoint(tween.getValue(), pathVector);\n\n pathDelta.add(pathVector);\n pathVector.add(this.pathOffset);\n\n var oldX = this.x;\n var oldY = this.y;\n\n this.setPosition(pathVector.x, pathVector.y);\n\n var speedX = this.x - oldX;\n var speedY = this.y - oldY;\n\n if (speedX === 0 && speedY === 0)\n {\n // Bail out early\n return;\n }\n\n if (tweenData.state !== this._prevDirection)\n {\n // We've changed direction, so don't do a rotate this frame\n this._prevDirection = tweenData.state;\n\n return;\n }\n\n if (this.rotateToPath)\n {\n this.rotation = Math.atan2(speedY, speedX) + DegToRad(this.pathRotationOffset);\n }\n }\n }\n\n};\n\nmodule.exports = PathFollower;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar DeepCopy = require('../../utils/object/DeepCopy');\nvar PIPELINE_CONST = require('../../renderer/webgl/pipelines/const');\nvar SpliceOne = require('../../utils/array/SpliceOne');\n\n/**\n * Provides methods used for setting the WebGL rendering pipeline of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.Pipeline\n * @webglOnly\n * @since 3.0.0\n */\n\nvar Pipeline = {\n\n /**\n * The initial WebGL pipeline of this Game Object.\n *\n * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default.\n *\n * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline\n * @type {Phaser.Renderer.WebGL.WebGLPipeline}\n * @default null\n * @webglOnly\n * @since 3.0.0\n */\n defaultPipeline: null,\n\n /**\n * The current WebGL pipeline of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Pipeline#pipeline\n * @type {Phaser.Renderer.WebGL.WebGLPipeline}\n * @default null\n * @webglOnly\n * @since 3.0.0\n */\n pipeline: null,\n\n /**\n * Does this Game Object have any Post Pipelines set?\n *\n * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline\n * @type {boolean}\n * @webglOnly\n * @since 3.50.0\n */\n hasPostPipeline: false,\n\n /**\n * The WebGL Post FX Pipelines this Game Object uses for post-render effects.\n *\n * The pipelines are processed in the order in which they appear in this array.\n *\n * If you modify this array directly, be sure to set the\n * `hasPostPipeline` property accordingly.\n *\n * @name Phaser.GameObjects.Components.Pipeline#postPipeline\n * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]}\n * @webglOnly\n * @since 3.50.0\n */\n postPipelines: null,\n\n /**\n * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses.\n *\n * @name Phaser.GameObjects.Components.Pipeline#pipelineData\n * @type {object}\n * @webglOnly\n * @since 3.50.0\n */\n pipelineData: null,\n\n /**\n * Sets the initial WebGL Pipeline of this Game Object.\n *\n * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`.\n *\n * @method Phaser.GameObjects.Components.Pipeline#initPipeline\n * @webglOnly\n * @since 3.0.0\n *\n * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set.\n *\n * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`.\n */\n initPipeline: function (pipeline)\n {\n if (pipeline === undefined) { pipeline = PIPELINE_CONST.MULTI_PIPELINE; }\n\n var renderer = this.scene.sys.renderer;\n var pipelines = renderer.pipelines;\n\n this.postPipelines = [];\n this.pipelineData = {};\n\n if (pipelines)\n {\n var instance = pipelines.get(pipeline);\n\n if (instance)\n {\n this.defaultPipeline = instance;\n this.pipeline = instance;\n\n return true;\n }\n }\n\n return false;\n },\n\n /**\n * Sets the main WebGL Pipeline of this Game Object.\n *\n * Also sets the `pipelineData` property, if the parameter is given.\n *\n * Both the pipeline and post pipelines share the same pipeline data object.\n *\n * @method Phaser.GameObjects.Components.Pipeline#setPipeline\n * @webglOnly\n * @since 3.0.0\n *\n * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set.\n * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object.\n * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead.\n *\n * @return {this} This Game Object instance.\n */\n setPipeline: function (pipeline, pipelineData, copyData)\n {\n var renderer = this.scene.sys.renderer;\n var pipelines = renderer.pipelines;\n\n if (pipelines)\n {\n var instance = pipelines.get(pipeline);\n\n if (instance)\n {\n this.pipeline = instance;\n }\n\n if (pipelineData)\n {\n this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData;\n }\n }\n\n return this;\n },\n\n /**\n * Sets one, or more, Post Pipelines on this Game Object.\n *\n * Post Pipelines are invoked after this Game Object has rendered to its target and\n * are commonly used for post-fx.\n *\n * The post pipelines are appended to the `postPipelines` array belonging to this\n * Game Object. When the renderer processes this Game Object, it iterates through the post\n * pipelines in the order in which they appear in the array. If you are stacking together\n * multiple effects, be aware that the order is important.\n *\n * If you call this method multiple times, the new pipelines will be appended to any existing\n * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required.\n *\n * You can optionally also sets the `pipelineData` property, if the parameter is given.\n *\n * Both the pipeline and post pipelines share the pipeline data object together.\n *\n * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline\n * @webglOnly\n * @since 3.50.0\n *\n * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them.\n * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object.\n * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead.\n *\n * @return {this} This Game Object instance.\n */\n setPostPipeline: function (pipelines, pipelineData, copyData)\n {\n var renderer = this.scene.sys.renderer;\n var pipelineManager = renderer.pipelines;\n\n if (pipelineManager)\n {\n if (!Array.isArray(pipelines))\n {\n pipelines = [ pipelines ];\n }\n\n for (var i = 0; i < pipelines.length; i++)\n {\n var instance = pipelineManager.getPostPipeline(pipelines[i], this);\n\n if (instance)\n {\n this.postPipelines.push(instance);\n }\n }\n\n if (pipelineData)\n {\n this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData;\n }\n }\n\n this.hasPostPipeline = (this.postPipelines.length > 0);\n\n return this;\n },\n\n /**\n * Adds an entry to the `pipelineData` object belonging to this Game Object.\n *\n * If the 'key' already exists, its value is updated. If it doesn't exist, it is created.\n *\n * If `value` is undefined, and `key` exists, `key` is removed from the data object.\n *\n * Both the pipeline and post pipelines share the pipeline data object together.\n *\n * @method Phaser.GameObjects.Components.Pipeline#setPipelineData\n * @webglOnly\n * @since 3.50.0\n *\n * @param {string} key - The key of the pipeline data to set, update, or delete.\n * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object.\n *\n * @return {this} This Game Object instance.\n */\n setPipelineData: function (key, value)\n {\n var data = this.pipelineData;\n\n if (value === undefined)\n {\n delete data[key];\n }\n else\n {\n data[key] = value;\n }\n\n return this;\n },\n\n /**\n * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it.\n *\n * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline\n * @webglOnly\n * @since 3.50.0\n *\n * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class.\n *\n * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The first Post Pipeline matching the name, or undefined if no match.\n */\n getPostPipeline: function (pipeline)\n {\n var pipelines = this.postPipelines;\n\n for (var i = 0; i < pipelines.length; i++)\n {\n var instance = pipelines[i];\n\n if ((typeof pipeline === 'string' && instance.name === pipeline) || instance instanceof pipeline)\n {\n return instance;\n }\n }\n },\n\n /**\n * Resets the WebGL Pipeline of this Game Object back to the default it was created with.\n *\n * @method Phaser.GameObjects.Components.Pipeline#resetPipeline\n * @webglOnly\n * @since 3.0.0\n *\n * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines?\n * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object?\n *\n * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`.\n */\n resetPipeline: function (resetPostPipelines, resetData)\n {\n if (resetPostPipelines === undefined) { resetPostPipelines = false; }\n if (resetData === undefined) { resetData = false; }\n\n this.pipeline = this.defaultPipeline;\n\n if (resetPostPipelines)\n {\n this.postPipelines = [];\n this.hasPostPipeline = false;\n }\n\n if (resetData)\n {\n this.pipelineData = {};\n }\n\n return (this.pipeline !== null);\n },\n\n /**\n * Resets the WebGL Post Pipelines of this Game Object. It does this by calling\n * the `destroy` method on each post pipeline and then clearing the local array.\n *\n * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline\n * @webglOnly\n * @since 3.50.0\n *\n * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object?\n */\n resetPostPipeline: function (resetData)\n {\n if (resetData === undefined) { resetData = false; }\n\n var pipelines = this.postPipelines;\n\n for (var i = 0; i < pipelines.length; i++)\n {\n pipelines[i].destroy();\n }\n\n this.postPipelines = [];\n this.hasPostPipeline = false;\n\n if (resetData)\n {\n this.pipelineData = {};\n }\n },\n\n /**\n * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it.\n *\n * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead.\n *\n * @method Phaser.GameObjects.Components.Pipeline#removePostPipeline\n * @webglOnly\n * @since 3.50.0\n *\n * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class.\n *\n * @return {this} This Game Object.\n */\n removePostPipeline: function (pipeline)\n {\n var pipelines = this.postPipelines;\n\n for (var i = 0; i < pipelines.length; i++)\n {\n var instance = pipelines[i];\n\n if ((typeof pipeline === 'string' && instance.name === pipeline) || instance instanceof pipeline)\n {\n instance.destroy();\n\n SpliceOne(pipelines, i);\n\n return this;\n }\n }\n\n return this;\n },\n\n /**\n * Gets the name of the WebGL Pipeline this Game Object is currently using.\n *\n * @method Phaser.GameObjects.Components.Pipeline#getPipelineName\n * @webglOnly\n * @since 3.0.0\n *\n * @return {string} The string-based name of the pipeline being used by this Game Object.\n */\n getPipelineName: function ()\n {\n return this.pipeline.name;\n }\n\n};\n\nmodule.exports = Pipeline;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for getting and setting the Scroll Factor of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.ScrollFactor\n * @since 3.0.0\n */\n\nvar ScrollFactor = {\n\n /**\n * The horizontal scroll factor of this Game Object.\n *\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\n *\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\n * It does not change the Game Objects actual position values.\n *\n * A value of 1 means it will move exactly in sync with a camera.\n * A value of 0 means it will not move at all, even if the camera moves.\n * Other values control the degree to which the camera movement is mapped to this Game Object.\n * \n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\n * calculating physics collisions. Bodies always collide based on their world position, but changing\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\n * them from physics bodies if not accounted for in your code.\n *\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n scrollFactorX: 1,\n\n /**\n * The vertical scroll factor of this Game Object.\n *\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\n *\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\n * It does not change the Game Objects actual position values.\n *\n * A value of 1 means it will move exactly in sync with a camera.\n * A value of 0 means it will not move at all, even if the camera moves.\n * Other values control the degree to which the camera movement is mapped to this Game Object.\n * \n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\n * calculating physics collisions. Bodies always collide based on their world position, but changing\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\n * them from physics bodies if not accounted for in your code.\n *\n * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n scrollFactorY: 1,\n\n /**\n * Sets the scroll factor of this Game Object.\n *\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\n *\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\n * It does not change the Game Objects actual position values.\n *\n * A value of 1 means it will move exactly in sync with a camera.\n * A value of 0 means it will not move at all, even if the camera moves.\n * Other values control the degree to which the camera movement is mapped to this Game Object.\n * \n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\n * calculating physics collisions. Bodies always collide based on their world position, but changing\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\n * them from physics bodies if not accounted for in your code.\n *\n * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor\n * @since 3.0.0\n *\n * @param {number} x - The horizontal scroll factor of this Game Object.\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\n *\n * @return {this} This Game Object instance.\n */\n setScrollFactor: function (x, y)\n {\n if (y === undefined) { y = x; }\n\n this.scrollFactorX = x;\n this.scrollFactorY = y;\n\n return this;\n }\n\n};\n\nmodule.exports = ScrollFactor;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for getting and setting the size of a Game Object.\n * \n * @namespace Phaser.GameObjects.Components.Size\n * @since 3.0.0\n */\n\nvar Size = {\n\n /**\n * A property indicating that a Game Object has this component.\n * \n * @name Phaser.GameObjects.Components.Size#_sizeComponent\n * @type {boolean}\n * @private\n * @default true\n * @since 3.2.0\n */\n _sizeComponent: true,\n\n /**\n * The native (un-scaled) width of this Game Object.\n * \n * Changing this value will not change the size that the Game Object is rendered in-game.\n * For that you need to either set the scale of the Game Object (`setScale`) or use\n * the `displayWidth` property.\n * \n * @name Phaser.GameObjects.Components.Size#width\n * @type {number}\n * @since 3.0.0\n */\n width: 0,\n\n /**\n * The native (un-scaled) height of this Game Object.\n * \n * Changing this value will not change the size that the Game Object is rendered in-game.\n * For that you need to either set the scale of the Game Object (`setScale`) or use\n * the `displayHeight` property.\n * \n * @name Phaser.GameObjects.Components.Size#height\n * @type {number}\n * @since 3.0.0\n */\n height: 0,\n\n /**\n * The displayed width of this Game Object.\n * \n * This value takes into account the scale factor.\n * \n * Setting this value will adjust the Game Object's scale property.\n * \n * @name Phaser.GameObjects.Components.Size#displayWidth\n * @type {number}\n * @since 3.0.0\n */\n displayWidth: {\n\n get: function ()\n {\n return Math.abs(this.scaleX * this.frame.realWidth);\n },\n\n set: function (value)\n {\n this.scaleX = value / this.frame.realWidth;\n }\n\n },\n\n /**\n * The displayed height of this Game Object.\n * \n * This value takes into account the scale factor.\n * \n * Setting this value will adjust the Game Object's scale property.\n * \n * @name Phaser.GameObjects.Components.Size#displayHeight\n * @type {number}\n * @since 3.0.0\n */\n displayHeight: {\n\n get: function ()\n {\n return Math.abs(this.scaleY * this.frame.realHeight);\n },\n\n set: function (value)\n {\n this.scaleY = value / this.frame.realHeight;\n }\n\n },\n\n /**\n * Sets the size of this Game Object to be that of the given Frame.\n * \n * This will not change the size that the Game Object is rendered in-game.\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\n * to do so by giving pixel values.\n * \n * If you have enabled this Game Object for input, changing the size will _not_ change the\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\n * \n * @method Phaser.GameObjects.Components.Size#setSizeToFrame\n * @since 3.0.0\n *\n * @param {Phaser.Textures.Frame} frame - The frame to base the size of this Game Object on.\n * \n * @return {this} This Game Object instance.\n */\n setSizeToFrame: function (frame)\n {\n if (frame === undefined) { frame = this.frame; }\n\n this.width = frame.realWidth;\n this.height = frame.realHeight;\n\n return this;\n },\n\n /**\n * Sets the internal size of this Game Object, as used for frame or physics body creation.\n * \n * This will not change the size that the Game Object is rendered in-game.\n * For that you need to either set the scale of the Game Object (`setScale`) or call the\n * `setDisplaySize` method, which is the same thing as changing the scale but allows you\n * to do so by giving pixel values.\n * \n * If you have enabled this Game Object for input, changing the size will _not_ change the\n * size of the hit area. To do this you should adjust the `input.hitArea` object directly.\n * \n * @method Phaser.GameObjects.Components.Size#setSize\n * @since 3.0.0\n *\n * @param {number} width - The width of this Game Object.\n * @param {number} height - The height of this Game Object.\n * \n * @return {this} This Game Object instance.\n */\n setSize: function (width, height)\n {\n this.width = width;\n this.height = height;\n\n return this;\n },\n\n /**\n * Sets the display size of this Game Object.\n * \n * Calling this will adjust the scale.\n * \n * @method Phaser.GameObjects.Components.Size#setDisplaySize\n * @since 3.0.0\n *\n * @param {number} width - The width of this Game Object.\n * @param {number} height - The height of this Game Object.\n * \n * @return {this} This Game Object instance.\n */\n setDisplaySize: function (width, height)\n {\n this.displayWidth = width;\n this.displayHeight = height;\n\n return this;\n }\n\n};\n\nmodule.exports = Size;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// bitmask flag for GameObject.renderMask\nvar _FLAG = 8; // 1000\n\n/**\n * Provides methods used for getting and setting the texture of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.Texture\n * @since 3.0.0\n */\n\nvar Texture = {\n\n /**\n * The Texture this Game Object is using to render with.\n *\n * @name Phaser.GameObjects.Components.Texture#texture\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\n * @since 3.0.0\n */\n texture: null,\n\n /**\n * The Texture Frame this Game Object is using to render with.\n *\n * @name Phaser.GameObjects.Components.Texture#frame\n * @type {Phaser.Textures.Frame}\n * @since 3.0.0\n */\n frame: null,\n\n /**\n * Internal flag. Not to be set by this Game Object.\n *\n * @name Phaser.GameObjects.Components.Texture#isCropped\n * @type {boolean}\n * @private\n * @since 3.11.0\n */\n isCropped: false,\n\n /**\n * Sets the texture and frame this Game Object will use to render with.\n *\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\n *\n * @method Phaser.GameObjects.Components.Texture#setTexture\n * @since 3.0.0\n *\n * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance.\n * @param {(string|number)} [frame] - The name or index of the frame within the Texture.\n *\n * @return {this} This Game Object instance.\n */\n setTexture: function (key, frame)\n {\n this.texture = this.scene.sys.textures.get(key);\n\n return this.setFrame(frame);\n },\n\n /**\n * Sets the frame this Game Object will use to render with.\n *\n * The Frame has to belong to the current Texture being used.\n *\n * It can be either a string or an index.\n *\n * Calling `setFrame` will modify the `width` and `height` properties of your Game Object.\n * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer.\n *\n * @method Phaser.GameObjects.Components.Texture#setFrame\n * @since 3.0.0\n *\n * @param {(string|number)} frame - The name or index of the frame within the Texture.\n * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object?\n * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object?\n *\n * @return {this} This Game Object instance.\n */\n setFrame: function (frame, updateSize, updateOrigin)\n {\n if (updateSize === undefined) { updateSize = true; }\n if (updateOrigin === undefined) { updateOrigin = true; }\n\n this.frame = this.texture.get(frame);\n\n if (!this.frame.cutWidth || !this.frame.cutHeight)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n\n if (this._sizeComponent && updateSize)\n {\n this.setSizeToFrame();\n }\n\n if (this._originComponent && updateOrigin)\n {\n if (this.frame.customPivot)\n {\n this.setOrigin(this.frame.pivotX, this.frame.pivotY);\n }\n else\n {\n this.updateDisplayOrigin();\n }\n }\n\n return this;\n }\n\n};\n\nmodule.exports = Texture;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// bitmask flag for GameObject.renderMask\nvar _FLAG = 8; // 1000\n\n/**\n * Provides methods used for getting and setting the texture of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.TextureCrop\n * @since 3.0.0\n */\n\nvar TextureCrop = {\n\n /**\n * The Texture this Game Object is using to render with.\n *\n * @name Phaser.GameObjects.Components.TextureCrop#texture\n * @type {Phaser.Textures.Texture|Phaser.Textures.CanvasTexture}\n * @since 3.0.0\n */\n texture: null,\n\n /**\n * The Texture Frame this Game Object is using to render with.\n *\n * @name Phaser.GameObjects.Components.TextureCrop#frame\n * @type {Phaser.Textures.Frame}\n * @since 3.0.0\n */\n frame: null,\n\n /**\n * A boolean flag indicating if this Game Object is being cropped or not.\n * You can toggle this at any time after `setCrop` has been called, to turn cropping on or off.\n * Equally, calling `setCrop` with no arguments will reset the crop and disable it.\n *\n * @name Phaser.GameObjects.Components.TextureCrop#isCropped\n * @type {boolean}\n * @since 3.11.0\n */\n isCropped: false,\n\n /**\n * Applies a crop to a texture based Game Object, such as a Sprite or Image.\n *\n * The crop is a rectangle that limits the area of the texture frame that is visible during rendering.\n *\n * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just\n * changes what is shown when rendered.\n *\n * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left.\n *\n * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left\n * half of it, you could call `setCrop(0, 0, 400, 600)`.\n *\n * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop\n * an area of 200x100 when applied to a Game Object that had a scale factor of 2.\n *\n * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument.\n *\n * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`.\n *\n * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow\n * the renderer to skip several internal calculations.\n *\n * @method Phaser.GameObjects.Components.TextureCrop#setCrop\n * @since 3.11.0\n *\n * @param {(number|Phaser.Geom.Rectangle)} [x] - The x coordinate to start the crop from. Or a Phaser.Geom.Rectangle object, in which case the rest of the arguments are ignored.\n * @param {number} [y] - The y coordinate to start the crop from.\n * @param {number} [width] - The width of the crop rectangle in pixels.\n * @param {number} [height] - The height of the crop rectangle in pixels.\n *\n * @return {this} This Game Object instance.\n */\n setCrop: function (x, y, width, height)\n {\n if (x === undefined)\n {\n this.isCropped = false;\n }\n else if (this.frame)\n {\n if (typeof x === 'number')\n {\n this.frame.setCropUVs(this._crop, x, y, width, height, this.flipX, this.flipY);\n }\n else\n {\n var rect = x;\n\n this.frame.setCropUVs(this._crop, rect.x, rect.y, rect.width, rect.height, this.flipX, this.flipY);\n }\n\n this.isCropped = true;\n }\n\n return this;\n },\n\n /**\n * Sets the texture and frame this Game Object will use to render with.\n *\n * Textures are referenced by their string-based keys, as stored in the Texture Manager.\n *\n * @method Phaser.GameObjects.Components.TextureCrop#setTexture\n * @since 3.0.0\n *\n * @param {string} key - The key of the texture to be used, as stored in the Texture Manager.\n * @param {(string|number)} [frame] - The name or index of the frame within the Texture.\n *\n * @return {this} This Game Object instance.\n */\n setTexture: function (key, frame)\n {\n this.texture = this.scene.sys.textures.get(key);\n\n return this.setFrame(frame);\n },\n\n /**\n * Sets the frame this Game Object will use to render with.\n *\n * The Frame has to belong to the current Texture being used.\n *\n * It can be either a string or an index.\n *\n * Calling `setFrame` will modify the `width` and `height` properties of your Game Object.\n * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer.\n *\n * @method Phaser.GameObjects.Components.TextureCrop#setFrame\n * @since 3.0.0\n *\n * @param {(string|number)} frame - The name or index of the frame within the Texture.\n * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object?\n * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object?\n *\n * @return {this} This Game Object instance.\n */\n setFrame: function (frame, updateSize, updateOrigin)\n {\n if (updateSize === undefined) { updateSize = true; }\n if (updateOrigin === undefined) { updateOrigin = true; }\n\n this.frame = this.texture.get(frame);\n\n if (!this.frame.cutWidth || !this.frame.cutHeight)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n\n if (this._sizeComponent && updateSize)\n {\n this.setSizeToFrame();\n }\n\n if (this._originComponent && updateOrigin)\n {\n if (this.frame.customPivot)\n {\n this.setOrigin(this.frame.pivotX, this.frame.pivotY);\n }\n else\n {\n this.updateDisplayOrigin();\n }\n }\n\n if (this.isCropped)\n {\n this.frame.updateCropUVs(this._crop, this.flipX, this.flipY);\n }\n\n return this;\n },\n\n /**\n * Internal method that returns a blank, well-formed crop object for use by a Game Object.\n *\n * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject\n * @private\n * @since 3.12.0\n *\n * @return {object} The crop object.\n */\n resetCropObject: function ()\n {\n return { u0: 0, v0: 0, u1: 0, v1: 0, width: 0, height: 0, x: 0, y: 0, flipX: false, flipY: false, cx: 0, cy: 0, cw: 0, ch: 0 };\n }\n\n};\n\nmodule.exports = TextureCrop;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Provides methods used for setting the tint of a Game Object.\n * Should be applied as a mixin and not used directly.\n *\n * @namespace Phaser.GameObjects.Components.Tint\n * @webglOnly\n * @since 3.0.0\n */\n\nvar Tint = {\n\n /**\n * The tint value being applied to the top-left vertice of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.\n *\n * @name Phaser.GameObjects.Components.Tint#tintTopLeft\n * @type {number}\n * @default 0xffffff\n * @since 3.0.0\n */\n tintTopLeft: 0xffffff,\n\n /**\n * The tint value being applied to the top-right vertice of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.\n *\n * @name Phaser.GameObjects.Components.Tint#tintTopRight\n * @type {number}\n * @default 0xffffff\n * @since 3.0.0\n */\n tintTopRight: 0xffffff,\n\n /**\n * The tint value being applied to the bottom-left vertice of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.\n *\n * @name Phaser.GameObjects.Components.Tint#tintBottomLeft\n * @type {number}\n * @default 0xffffff\n * @since 3.0.0\n */\n tintBottomLeft: 0xffffff,\n\n /**\n * The tint value being applied to the bottom-right vertice of the Game Object.\n * This value is interpolated from the corner to the center of the Game Object.\n * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple.\n *\n * @name Phaser.GameObjects.Components.Tint#tintBottomRight\n * @type {number}\n * @default 0xffffff\n * @since 3.0.0\n */\n tintBottomRight: 0xffffff,\n\n /**\n * The tint fill mode.\n *\n * `false` = An additive tint (the default), where vertices colors are blended with the texture.\n * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha.\n *\n * @name Phaser.GameObjects.Components.Tint#tintFill\n * @type {boolean}\n * @default false\n * @since 3.11.0\n */\n tintFill: false,\n\n /**\n * Clears all tint values associated with this Game Object.\n *\n * Immediately sets the color values back to 0xffffff and the tint type to 'additive',\n * which results in no visible change to the texture.\n *\n * @method Phaser.GameObjects.Components.Tint#clearTint\n * @webglOnly\n * @since 3.0.0\n *\n * @return {this} This Game Object instance.\n */\n clearTint: function ()\n {\n this.setTint(0xffffff);\n\n return this;\n },\n\n /**\n * Sets an additive tint on this Game Object.\n *\n * The tint works by taking the pixel color values from the Game Objects texture, and then\n * multiplying it by the color value of the tint. You can provide either one color value,\n * in which case the whole Game Object will be tinted in that color. Or you can provide a color\n * per corner. The colors are blended together across the extent of the Game Object.\n *\n * To modify the tint color once set, either call this method again with new values or use the\n * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,\n * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.\n *\n * To remove a tint call `clearTint`.\n *\n * To swap this from being an additive tint to a fill based tint set the property `tintFill` to `true`.\n *\n * @method Phaser.GameObjects.Components.Tint#setTint\n * @webglOnly\n * @since 3.0.0\n *\n * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object.\n * @param {number} [topRight] - The tint being applied to the top-right of the Game Object.\n * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object.\n * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setTint: function (topLeft, topRight, bottomLeft, bottomRight)\n {\n if (topLeft === undefined) { topLeft = 0xffffff; }\n\n if (topRight === undefined)\n {\n topRight = topLeft;\n bottomLeft = topLeft;\n bottomRight = topLeft;\n }\n\n this.tintTopLeft = topLeft;\n this.tintTopRight = topRight;\n this.tintBottomLeft = bottomLeft;\n this.tintBottomRight = bottomRight;\n\n this.tintFill = false;\n\n return this;\n },\n\n /**\n * Sets a fill-based tint on this Game Object.\n *\n * Unlike an additive tint, a fill-tint literally replaces the pixel colors from the texture\n * with those in the tint. You can use this for effects such as making a player flash 'white'\n * if hit by something. You can provide either one color value, in which case the whole\n * Game Object will be rendered in that color. Or you can provide a color per corner. The colors\n * are blended together across the extent of the Game Object.\n *\n * To modify the tint color once set, either call this method again with new values or use the\n * `tint` property to set all colors at once. Or, use the properties `tintTopLeft`, `tintTopRight,\n * `tintBottomLeft` and `tintBottomRight` to set the corner color values independently.\n *\n * To remove a tint call `clearTint`.\n *\n * To swap this from being a fill-tint to an additive tint set the property `tintFill` to `false`.\n *\n * @method Phaser.GameObjects.Components.Tint#setTintFill\n * @webglOnly\n * @since 3.11.0\n *\n * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object.\n * @param {number} [topRight] - The tint being applied to the top-right of the Game Object.\n * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object.\n * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setTintFill: function (topLeft, topRight, bottomLeft, bottomRight)\n {\n this.setTint(topLeft, topRight, bottomLeft, bottomRight);\n\n this.tintFill = true;\n\n return this;\n },\n\n /**\n * The tint value being applied to the whole of the Game Object.\n * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value.\n *\n * @name Phaser.GameObjects.Components.Tint#tint\n * @type {number}\n * @webglOnly\n * @since 3.0.0\n */\n tint: {\n\n set: function (value)\n {\n this.setTint(value, value, value, value);\n }\n },\n\n /**\n * Does this Game Object have a tint applied?\n *\n * It checks to see if the 4 tint properties are set to the value 0xffffff\n * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted.\n *\n * @name Phaser.GameObjects.Components.Tint#isTinted\n * @type {boolean}\n * @webglOnly\n * @readonly\n * @since 3.11.0\n */\n isTinted: {\n\n get: function ()\n {\n var white = 0xffffff;\n\n return (\n this.tintFill ||\n this.tintTopLeft !== white ||\n this.tintTopRight !== white ||\n this.tintBottomLeft !== white ||\n this.tintBottomRight !== white\n );\n }\n\n }\n\n};\n\nmodule.exports = Tint;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Build a JSON representation of the given Game Object.\n *\n * This is typically extended further by Game Object specific implementations.\n *\n * @method Phaser.GameObjects.Components.ToJSON\n * @since 3.0.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object to export as JSON.\n *\n * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object.\n */\nvar ToJSON = function (gameObject)\n{\n var out = {\n name: gameObject.name,\n type: gameObject.type,\n x: gameObject.x,\n y: gameObject.y,\n depth: gameObject.depth,\n scale: {\n x: gameObject.scaleX,\n y: gameObject.scaleY\n },\n origin: {\n x: gameObject.originX,\n y: gameObject.originY\n },\n flipX: gameObject.flipX,\n flipY: gameObject.flipY,\n rotation: gameObject.rotation,\n alpha: gameObject.alpha,\n visible: gameObject.visible,\n blendMode: gameObject.blendMode,\n textureKey: '',\n frameKey: '',\n data: {}\n };\n\n if (gameObject.texture)\n {\n out.textureKey = gameObject.texture.key;\n out.frameKey = gameObject.frame.name;\n }\n\n return out;\n};\n\nmodule.exports = ToJSON;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar MATH_CONST = require('../../math/const');\nvar TransformMatrix = require('./TransformMatrix');\nvar TransformXY = require('../../math/TransformXY');\nvar WrapAngle = require('../../math/angle/Wrap');\nvar WrapAngleDegrees = require('../../math/angle/WrapDegrees');\nvar Vector2 = require('../../math/Vector2');\n\n// global bitmask flag for GameObject.renderMask (used by Scale)\nvar _FLAG = 4; // 0100\n\n/**\n * Provides methods used for getting and setting the position, scale and rotation of a Game Object.\n *\n * @namespace Phaser.GameObjects.Components.Transform\n * @since 3.0.0\n */\n\nvar Transform = {\n\n /**\n * Private internal value. Holds the horizontal scale value.\n *\n * @name Phaser.GameObjects.Components.Transform#_scaleX\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _scaleX: 1,\n\n /**\n * Private internal value. Holds the vertical scale value.\n *\n * @name Phaser.GameObjects.Components.Transform#_scaleY\n * @type {number}\n * @private\n * @default 1\n * @since 3.0.0\n */\n _scaleY: 1,\n\n /**\n * Private internal value. Holds the rotation value in radians.\n *\n * @name Phaser.GameObjects.Components.Transform#_rotation\n * @type {number}\n * @private\n * @default 0\n * @since 3.0.0\n */\n _rotation: 0,\n\n /**\n * The x position of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n x: 0,\n\n /**\n * The y position of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n y: 0,\n\n /**\n * The z position of this Game Object.\n *\n * Note: The z position does not control the rendering order of 2D Game Objects. Use\n * {@link Phaser.GameObjects.Components.Depth#depth} instead.\n *\n * @name Phaser.GameObjects.Components.Transform#z\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n z: 0,\n\n /**\n * The w position of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#w\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n w: 0,\n\n /**\n * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object\n * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`.\n *\n * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this\n * isn't the case, use the `scaleX` or `scaleY` properties instead.\n *\n * @name Phaser.GameObjects.Components.Transform#scale\n * @type {number}\n * @default 1\n * @since 3.18.0\n */\n scale: {\n\n get: function ()\n {\n return (this._scaleX + this._scaleY) / 2;\n },\n\n set: function (value)\n {\n this._scaleX = value;\n this._scaleY = value;\n\n if (value === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The horizontal scale of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#scaleX\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n scaleX: {\n\n get: function ()\n {\n return this._scaleX;\n },\n\n set: function (value)\n {\n this._scaleX = value;\n\n if (value === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The vertical scale of this Game Object.\n *\n * @name Phaser.GameObjects.Components.Transform#scaleY\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n scaleY: {\n\n get: function ()\n {\n return this._scaleY;\n },\n\n set: function (value)\n {\n this._scaleY = value;\n\n if (value === 0)\n {\n this.renderFlags &= ~_FLAG;\n }\n else\n {\n this.renderFlags |= _FLAG;\n }\n }\n\n },\n\n /**\n * The angle of this Game Object as expressed in degrees.\n *\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left\n * and -90 is up.\n *\n * If you prefer to work in radians, see the `rotation` property instead.\n *\n * @name Phaser.GameObjects.Components.Transform#angle\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n angle: {\n\n get: function ()\n {\n return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG);\n },\n\n set: function (value)\n {\n // value is in degrees\n this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD;\n }\n },\n\n /**\n * The angle of this Game Object in radians.\n *\n * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left\n * and -PI/2 is up.\n *\n * If you prefer to work in degrees, see the `angle` property instead.\n *\n * @name Phaser.GameObjects.Components.Transform#rotation\n * @type {number}\n * @default 1\n * @since 3.0.0\n */\n rotation: {\n\n get: function ()\n {\n return this._rotation;\n },\n\n set: function (value)\n {\n // value is in radians\n this._rotation = WrapAngle(value);\n }\n },\n\n /**\n * Sets the position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setPosition\n * @since 3.0.0\n *\n * @param {number} [x=0] - The x position of this Game Object.\n * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value.\n * @param {number} [z=0] - The z position of this Game Object.\n * @param {number} [w=0] - The w position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setPosition: function (x, y, z, w)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = x; }\n if (z === undefined) { z = 0; }\n if (w === undefined) { w = 0; }\n\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n\n return this;\n },\n\n /**\n * Copies an object's coordinates to this Game Object's position.\n *\n * @method Phaser.GameObjects.Components.Transform#copyPosition\n * @since 3.50.0\n *\n * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied.\n *\n * @return {this} This Game Object instance.\n */\n copyPosition: function (source)\n {\n if (source.x !== undefined) { this.x = source.x; }\n if (source.y !== undefined) { this.y = source.y; }\n if (source.z !== undefined) { this.z = source.z; }\n if (source.w !== undefined) { this.w = source.w; }\n\n return this;\n },\n\n /**\n * Sets the position of this Game Object to be a random position within the confines of\n * the given area.\n *\n * If no area is specified a random position between 0 x 0 and the game width x height is used instead.\n *\n * The position does not factor in the size of this Game Object, meaning that only the origin is\n * guaranteed to be within the area.\n *\n * @method Phaser.GameObjects.Components.Transform#setRandomPosition\n * @since 3.8.0\n *\n * @param {number} [x=0] - The x position of the top-left of the random area.\n * @param {number} [y=0] - The y position of the top-left of the random area.\n * @param {number} [width] - The width of the random area.\n * @param {number} [height] - The height of the random area.\n *\n * @return {this} This Game Object instance.\n */\n setRandomPosition: function (x, y, width, height)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = 0; }\n if (width === undefined) { width = this.scene.sys.scale.width; }\n if (height === undefined) { height = this.scene.sys.scale.height; }\n\n this.x = x + (Math.random() * width);\n this.y = y + (Math.random() * height);\n\n return this;\n },\n\n /**\n * Sets the rotation of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setRotation\n * @since 3.0.0\n *\n * @param {number} [radians=0] - The rotation of this Game Object, in radians.\n *\n * @return {this} This Game Object instance.\n */\n setRotation: function (radians)\n {\n if (radians === undefined) { radians = 0; }\n\n this.rotation = radians;\n\n return this;\n },\n\n /**\n * Sets the angle of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setAngle\n * @since 3.0.0\n *\n * @param {number} [degrees=0] - The rotation of this Game Object, in degrees.\n *\n * @return {this} This Game Object instance.\n */\n setAngle: function (degrees)\n {\n if (degrees === undefined) { degrees = 0; }\n\n this.angle = degrees;\n\n return this;\n },\n\n /**\n * Sets the scale of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setScale\n * @since 3.0.0\n *\n * @param {number} x - The horizontal scale of this Game Object.\n * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.\n *\n * @return {this} This Game Object instance.\n */\n setScale: function (x, y)\n {\n if (x === undefined) { x = 1; }\n if (y === undefined) { y = x; }\n\n this.scaleX = x;\n this.scaleY = y;\n\n return this;\n },\n\n /**\n * Sets the x position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setX\n * @since 3.0.0\n *\n * @param {number} [value=0] - The x position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setX: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.x = value;\n\n return this;\n },\n\n /**\n * Sets the y position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setY\n * @since 3.0.0\n *\n * @param {number} [value=0] - The y position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setY: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.y = value;\n\n return this;\n },\n\n /**\n * Sets the z position of this Game Object.\n *\n * Note: The z position does not control the rendering order of 2D Game Objects. Use\n * {@link Phaser.GameObjects.Components.Depth#setDepth} instead.\n *\n * @method Phaser.GameObjects.Components.Transform#setZ\n * @since 3.0.0\n *\n * @param {number} [value=0] - The z position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setZ: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.z = value;\n\n return this;\n },\n\n /**\n * Sets the w position of this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#setW\n * @since 3.0.0\n *\n * @param {number} [value=0] - The w position of this Game Object.\n *\n * @return {this} This Game Object instance.\n */\n setW: function (value)\n {\n if (value === undefined) { value = 0; }\n\n this.w = value;\n\n return this;\n },\n\n /**\n * Gets the local transform matrix for this Game Object.\n *\n * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\n *\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\n */\n getLocalTransformMatrix: function (tempMatrix)\n {\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\n\n return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\n },\n\n /**\n * Gets the world transform matrix for this Game Object, factoring in any parent Containers.\n *\n * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations.\n *\n * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix.\n */\n getWorldTransformMatrix: function (tempMatrix, parentMatrix)\n {\n if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); }\n if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); }\n\n var parent = this.parentContainer;\n\n if (!parent)\n {\n return this.getLocalTransformMatrix(tempMatrix);\n }\n\n tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY);\n\n while (parent)\n {\n parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY);\n\n parentMatrix.multiply(tempMatrix, tempMatrix);\n\n parent = parent.parentContainer;\n }\n\n return tempMatrix;\n },\n\n /**\n * Takes the given `x` and `y` coordinates and converts them into local space for this\n * Game Object, taking into account parent and local transforms, and the Display Origin.\n *\n * The returned Vector2 contains the translated point in its properties.\n *\n * A Camera needs to be provided in order to handle modified scroll factors. If no\n * camera is specified, it will use the `main` camera from the Scene to which this\n * Game Object belongs.\n *\n * @method Phaser.GameObjects.Components.Transform#getLocalPoint\n * @since 3.50.0\n *\n * @param {number} x - The x position to translate.\n * @param {number} y - The y position to translate.\n * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in.\n * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera.\n *\n * @return {Phaser.Math.Vector2} The translated point.\n */\n getLocalPoint: function (x, y, point, camera)\n {\n if (!point) { point = new Vector2(); }\n if (!camera) { camera = this.scene.sys.cameras.main; }\n\n var csx = camera.scrollX;\n var csy = camera.scrollY;\n\n var px = x + (csx * this.scrollFactorX) - csx;\n var py = y + (csy * this.scrollFactorY) - csy;\n\n if (this.parentContainer)\n {\n this.getWorldTransformMatrix().applyInverse(px, py, point);\n }\n else\n {\n TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point);\n }\n\n // Normalize origin\n if (this._originComponent)\n {\n point.x += this._displayOriginX;\n point.y += this._displayOriginY;\n }\n\n return point;\n },\n\n /**\n * Gets the sum total rotation of all of this Game Objects parent Containers.\n *\n * The returned value is in radians and will be zero if this Game Object has no parent container.\n *\n * @method Phaser.GameObjects.Components.Transform#getParentRotation\n * @since 3.18.0\n *\n * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object.\n */\n getParentRotation: function ()\n {\n var rotation = 0;\n\n var parent = this.parentContainer;\n\n while (parent)\n {\n rotation += parent.rotation;\n\n parent = parent.parentContainer;\n }\n\n return rotation;\n }\n\n};\n\nmodule.exports = Transform;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar MATH_CONST = require('../../math/const');\nvar Vector2 = require('../../math/Vector2');\n\n/**\n * @classdesc\n * A Matrix used for display transformations for rendering.\n *\n * It is represented like so:\n *\n * ```\n * | a | c | tx |\n * | b | d | ty |\n * | 0 | 0 | 1 |\n * ```\n *\n * @class TransformMatrix\n * @memberof Phaser.GameObjects.Components\n * @constructor\n * @since 3.0.0\n *\n * @param {number} [a=1] - The Scale X value.\n * @param {number} [b=0] - The Skew Y value.\n * @param {number} [c=0] - The Skew X value.\n * @param {number} [d=1] - The Scale Y value.\n * @param {number} [tx=0] - The Translate X value.\n * @param {number} [ty=0] - The Translate Y value.\n */\nvar TransformMatrix = new Class({\n\n initialize:\n\n function TransformMatrix (a, b, c, d, tx, ty)\n {\n if (a === undefined) { a = 1; }\n if (b === undefined) { b = 0; }\n if (c === undefined) { c = 0; }\n if (d === undefined) { d = 1; }\n if (tx === undefined) { tx = 0; }\n if (ty === undefined) { ty = 0; }\n\n /**\n * The matrix values.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#matrix\n * @type {Float32Array}\n * @since 3.0.0\n */\n this.matrix = new Float32Array([ a, b, c, d, tx, ty, 0, 0, 1 ]);\n\n /**\n * The decomposed matrix.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#decomposedMatrix\n * @type {object}\n * @since 3.0.0\n */\n this.decomposedMatrix = {\n translateX: 0,\n translateY: 0,\n scaleX: 1,\n scaleY: 1,\n rotation: 0\n };\n },\n\n /**\n * The Scale X value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#a\n * @type {number}\n * @since 3.4.0\n */\n a: {\n\n get: function ()\n {\n return this.matrix[0];\n },\n\n set: function (value)\n {\n this.matrix[0] = value;\n }\n\n },\n\n /**\n * The Skew Y value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#b\n * @type {number}\n * @since 3.4.0\n */\n b: {\n\n get: function ()\n {\n return this.matrix[1];\n },\n\n set: function (value)\n {\n this.matrix[1] = value;\n }\n\n },\n\n /**\n * The Skew X value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#c\n * @type {number}\n * @since 3.4.0\n */\n c: {\n\n get: function ()\n {\n return this.matrix[2];\n },\n\n set: function (value)\n {\n this.matrix[2] = value;\n }\n\n },\n\n /**\n * The Scale Y value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#d\n * @type {number}\n * @since 3.4.0\n */\n d: {\n\n get: function ()\n {\n return this.matrix[3];\n },\n\n set: function (value)\n {\n this.matrix[3] = value;\n }\n\n },\n\n /**\n * The Translate X value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#e\n * @type {number}\n * @since 3.11.0\n */\n e: {\n\n get: function ()\n {\n return this.matrix[4];\n },\n\n set: function (value)\n {\n this.matrix[4] = value;\n }\n\n },\n\n /**\n * The Translate Y value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#f\n * @type {number}\n * @since 3.11.0\n */\n f: {\n\n get: function ()\n {\n return this.matrix[5];\n },\n\n set: function (value)\n {\n this.matrix[5] = value;\n }\n\n },\n\n /**\n * The Translate X value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#tx\n * @type {number}\n * @since 3.4.0\n */\n tx: {\n\n get: function ()\n {\n return this.matrix[4];\n },\n\n set: function (value)\n {\n this.matrix[4] = value;\n }\n\n },\n\n /**\n * The Translate Y value.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#ty\n * @type {number}\n * @since 3.4.0\n */\n ty: {\n\n get: function ()\n {\n return this.matrix[5];\n },\n\n set: function (value)\n {\n this.matrix[5] = value;\n }\n\n },\n\n /**\n * The rotation of the Matrix. Value is in radians.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#rotation\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n rotation: {\n\n get: function ()\n {\n return Math.acos(this.a / this.scaleX) * ((Math.atan(-this.c / this.a) < 0) ? -1 : 1);\n }\n\n },\n\n /**\n * The rotation of the Matrix, normalized to be within the Phaser right-handed\n * clockwise rotation space. Value is in radians.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#rotationNormalized\n * @type {number}\n * @readonly\n * @since 3.19.0\n */\n rotationNormalized: {\n\n get: function ()\n {\n var matrix = this.matrix;\n\n var a = matrix[0];\n var b = matrix[1];\n var c = matrix[2];\n var d = matrix[3];\n\n if (a || b)\n {\n // var r = Math.sqrt(a * a + b * b);\n\n return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX);\n }\n else if (c || d)\n {\n // var s = Math.sqrt(c * c + d * d);\n\n return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY));\n }\n else\n {\n return 0;\n }\n }\n\n },\n\n /**\n * The decomposed horizontal scale of the Matrix. This value is always positive.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleX\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n scaleX: {\n\n get: function ()\n {\n return Math.sqrt((this.a * this.a) + (this.b * this.b));\n }\n\n },\n\n /**\n * The decomposed vertical scale of the Matrix. This value is always positive.\n *\n * @name Phaser.GameObjects.Components.TransformMatrix#scaleY\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n scaleY: {\n\n get: function ()\n {\n return Math.sqrt((this.c * this.c) + (this.d * this.d));\n }\n\n },\n\n /**\n * Reset the Matrix to an identity matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#loadIdentity\n * @since 3.0.0\n *\n * @return {this} This TransformMatrix.\n */\n loadIdentity: function ()\n {\n var matrix = this.matrix;\n\n matrix[0] = 1;\n matrix[1] = 0;\n matrix[2] = 0;\n matrix[3] = 1;\n matrix[4] = 0;\n matrix[5] = 0;\n\n return this;\n },\n\n /**\n * Translate the Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#translate\n * @since 3.0.0\n *\n * @param {number} x - The horizontal translation value.\n * @param {number} y - The vertical translation value.\n *\n * @return {this} This TransformMatrix.\n */\n translate: function (x, y)\n {\n var matrix = this.matrix;\n\n matrix[4] = matrix[0] * x + matrix[2] * y + matrix[4];\n matrix[5] = matrix[1] * x + matrix[3] * y + matrix[5];\n\n return this;\n },\n\n /**\n * Scale the Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#scale\n * @since 3.0.0\n *\n * @param {number} x - The horizontal scale value.\n * @param {number} y - The vertical scale value.\n *\n * @return {this} This TransformMatrix.\n */\n scale: function (x, y)\n {\n var matrix = this.matrix;\n\n matrix[0] *= x;\n matrix[1] *= x;\n matrix[2] *= y;\n matrix[3] *= y;\n\n return this;\n },\n\n /**\n * Rotate the Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#rotate\n * @since 3.0.0\n *\n * @param {number} angle - The angle of rotation in radians.\n *\n * @return {this} This TransformMatrix.\n */\n rotate: function (angle)\n {\n var sin = Math.sin(angle);\n var cos = Math.cos(angle);\n\n var matrix = this.matrix;\n\n var a = matrix[0];\n var b = matrix[1];\n var c = matrix[2];\n var d = matrix[3];\n\n matrix[0] = a * cos + c * sin;\n matrix[1] = b * cos + d * sin;\n matrix[2] = a * -sin + c * cos;\n matrix[3] = b * -sin + d * cos;\n\n return this;\n },\n\n /**\n * Multiply this Matrix by the given Matrix.\n *\n * If an `out` Matrix is given then the results will be stored in it.\n * If it is not given, this matrix will be updated in place instead.\n * Use an `out` Matrix if you do not wish to mutate this matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#multiply\n * @since 3.0.0\n *\n * @param {Phaser.GameObjects.Components.TransformMatrix} rhs - The Matrix to multiply by.\n * @param {Phaser.GameObjects.Components.TransformMatrix} [out] - An optional Matrix to store the results in.\n *\n * @return {(this|Phaser.GameObjects.Components.TransformMatrix)} Either this TransformMatrix, or the `out` Matrix, if given in the arguments.\n */\n multiply: function (rhs, out)\n {\n var matrix = this.matrix;\n var source = rhs.matrix;\n\n var localA = matrix[0];\n var localB = matrix[1];\n var localC = matrix[2];\n var localD = matrix[3];\n var localE = matrix[4];\n var localF = matrix[5];\n\n var sourceA = source[0];\n var sourceB = source[1];\n var sourceC = source[2];\n var sourceD = source[3];\n var sourceE = source[4];\n var sourceF = source[5];\n\n var destinationMatrix = (out === undefined) ? this : out;\n\n destinationMatrix.a = (sourceA * localA) + (sourceB * localC);\n destinationMatrix.b = (sourceA * localB) + (sourceB * localD);\n destinationMatrix.c = (sourceC * localA) + (sourceD * localC);\n destinationMatrix.d = (sourceC * localB) + (sourceD * localD);\n destinationMatrix.e = (sourceE * localA) + (sourceF * localC) + localE;\n destinationMatrix.f = (sourceE * localB) + (sourceF * localD) + localF;\n\n return destinationMatrix;\n },\n\n /**\n * Multiply this Matrix by the matrix given, including the offset.\n *\n * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`.\n * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#multiplyWithOffset\n * @since 3.11.0\n *\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\n * @param {number} offsetX - Horizontal offset to factor in to the multiplication.\n * @param {number} offsetY - Vertical offset to factor in to the multiplication.\n *\n * @return {this} This TransformMatrix.\n */\n multiplyWithOffset: function (src, offsetX, offsetY)\n {\n var matrix = this.matrix;\n var otherMatrix = src.matrix;\n\n var a0 = matrix[0];\n var b0 = matrix[1];\n var c0 = matrix[2];\n var d0 = matrix[3];\n var tx0 = matrix[4];\n var ty0 = matrix[5];\n\n var pse = offsetX * a0 + offsetY * c0 + tx0;\n var psf = offsetX * b0 + offsetY * d0 + ty0;\n\n var a1 = otherMatrix[0];\n var b1 = otherMatrix[1];\n var c1 = otherMatrix[2];\n var d1 = otherMatrix[3];\n var tx1 = otherMatrix[4];\n var ty1 = otherMatrix[5];\n\n matrix[0] = a1 * a0 + b1 * c0;\n matrix[1] = a1 * b0 + b1 * d0;\n matrix[2] = c1 * a0 + d1 * c0;\n matrix[3] = c1 * b0 + d1 * d0;\n matrix[4] = tx1 * a0 + ty1 * c0 + pse;\n matrix[5] = tx1 * b0 + ty1 * d0 + psf;\n\n return this;\n },\n\n /**\n * Transform the Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#transform\n * @since 3.0.0\n *\n * @param {number} a - The Scale X value.\n * @param {number} b - The Shear Y value.\n * @param {number} c - The Shear X value.\n * @param {number} d - The Scale Y value.\n * @param {number} tx - The Translate X value.\n * @param {number} ty - The Translate Y value.\n *\n * @return {this} This TransformMatrix.\n */\n transform: function (a, b, c, d, tx, ty)\n {\n var matrix = this.matrix;\n\n var a0 = matrix[0];\n var b0 = matrix[1];\n var c0 = matrix[2];\n var d0 = matrix[3];\n var tx0 = matrix[4];\n var ty0 = matrix[5];\n\n matrix[0] = a * a0 + b * c0;\n matrix[1] = a * b0 + b * d0;\n matrix[2] = c * a0 + d * c0;\n matrix[3] = c * b0 + d * d0;\n matrix[4] = tx * a0 + ty * c0 + tx0;\n matrix[5] = tx * b0 + ty * d0 + ty0;\n\n return this;\n },\n\n /**\n * Transform a point using this Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#transformPoint\n * @since 3.0.0\n *\n * @param {number} x - The x coordinate of the point to transform.\n * @param {number} y - The y coordinate of the point to transform.\n * @param {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} point - The Point object to store the transformed coordinates.\n *\n * @return {(Phaser.Geom.Point|Phaser.Math.Vector2|object)} The Point containing the transformed coordinates.\n */\n transformPoint: function (x, y, point)\n {\n if (point === undefined) { point = { x: 0, y: 0 }; }\n\n var matrix = this.matrix;\n\n var a = matrix[0];\n var b = matrix[1];\n var c = matrix[2];\n var d = matrix[3];\n var tx = matrix[4];\n var ty = matrix[5];\n\n point.x = x * a + y * c + tx;\n point.y = x * b + y * d + ty;\n\n return point;\n },\n\n /**\n * Invert the Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#invert\n * @since 3.0.0\n *\n * @return {this} This TransformMatrix.\n */\n invert: function ()\n {\n var matrix = this.matrix;\n\n var a = matrix[0];\n var b = matrix[1];\n var c = matrix[2];\n var d = matrix[3];\n var tx = matrix[4];\n var ty = matrix[5];\n\n var n = a * d - b * c;\n\n matrix[0] = d / n;\n matrix[1] = -b / n;\n matrix[2] = -c / n;\n matrix[3] = a / n;\n matrix[4] = (c * ty - d * tx) / n;\n matrix[5] = -(a * ty - b * tx) / n;\n\n return this;\n },\n\n /**\n * Set the values of this Matrix to copy those of the matrix given.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFrom\n * @since 3.11.0\n *\n * @param {Phaser.GameObjects.Components.TransformMatrix} src - The source Matrix to copy from.\n *\n * @return {this} This TransformMatrix.\n */\n copyFrom: function (src)\n {\n var matrix = this.matrix;\n\n matrix[0] = src.a;\n matrix[1] = src.b;\n matrix[2] = src.c;\n matrix[3] = src.d;\n matrix[4] = src.e;\n matrix[5] = src.f;\n\n return this;\n },\n\n /**\n * Set the values of this Matrix to copy those of the array given.\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#copyFromArray\n * @since 3.11.0\n *\n * @param {array} src - The array of values to set into this matrix.\n *\n * @return {this} This TransformMatrix.\n */\n copyFromArray: function (src)\n {\n var matrix = this.matrix;\n\n matrix[0] = src[0];\n matrix[1] = src[1];\n matrix[2] = src[2];\n matrix[3] = src[3];\n matrix[4] = src[4];\n matrix[5] = src[5];\n\n return this;\n },\n\n /**\n * Copy the values from this Matrix to the given Canvas Rendering Context.\n * This will use the Context.transform method.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToContext\n * @since 3.12.0\n *\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\n *\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\n */\n copyToContext: function (ctx)\n {\n var matrix = this.matrix;\n\n ctx.transform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\n\n return ctx;\n },\n\n /**\n * Copy the values from this Matrix to the given Canvas Rendering Context.\n * This will use the Context.setTransform method.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#setToContext\n * @since 3.12.0\n *\n * @param {CanvasRenderingContext2D} ctx - The Canvas Rendering Context to copy the matrix values to.\n *\n * @return {CanvasRenderingContext2D} The Canvas Rendering Context.\n */\n setToContext: function (ctx)\n {\n var matrix = this.matrix;\n\n ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);\n\n return ctx;\n },\n\n /**\n * Copy the values in this Matrix to the array given.\n *\n * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray\n * @since 3.12.0\n *\n * @param {array} [out] - The array to copy the matrix values in to.\n *\n * @return {array} An array where elements 0 to 5 contain the values from this matrix.\n */\n copyToArray: function (out)\n {\n var matrix = this.matrix;\n\n if (out === undefined)\n {\n out = [ matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5] ];\n }\n else\n {\n out[0] = matrix[0];\n out[1] = matrix[1];\n out[2] = matrix[2];\n out[3] = matrix[3];\n out[4] = matrix[4];\n out[5] = matrix[5];\n }\n\n return out;\n },\n\n /**\n * Set the values of this Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#setTransform\n * @since 3.0.0\n *\n * @param {number} a - The Scale X value.\n * @param {number} b - The Shear Y value.\n * @param {number} c - The Shear X value.\n * @param {number} d - The Scale Y value.\n * @param {number} tx - The Translate X value.\n * @param {number} ty - The Translate Y value.\n *\n * @return {this} This TransformMatrix.\n */\n setTransform: function (a, b, c, d, tx, ty)\n {\n var matrix = this.matrix;\n\n matrix[0] = a;\n matrix[1] = b;\n matrix[2] = c;\n matrix[3] = d;\n matrix[4] = tx;\n matrix[5] = ty;\n\n return this;\n },\n\n /**\n * Decompose this Matrix into its translation, scale and rotation values using QR decomposition.\n *\n * The result must be applied in the following order to reproduce the current matrix:\n *\n * translate -> rotate -> scale\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix\n * @since 3.0.0\n *\n * @return {object} The decomposed Matrix.\n */\n decomposeMatrix: function ()\n {\n var decomposedMatrix = this.decomposedMatrix;\n\n var matrix = this.matrix;\n\n // a = scale X (1)\n // b = shear Y (0)\n // c = shear X (0)\n // d = scale Y (1)\n\n var a = matrix[0];\n var b = matrix[1];\n var c = matrix[2];\n var d = matrix[3];\n\n var determ = a * d - b * c;\n\n decomposedMatrix.translateX = matrix[4];\n decomposedMatrix.translateY = matrix[5];\n\n if (a || b)\n {\n var r = Math.sqrt(a * a + b * b);\n\n decomposedMatrix.rotation = (b > 0) ? Math.acos(a / r) : -Math.acos(a / r);\n decomposedMatrix.scaleX = r;\n decomposedMatrix.scaleY = determ / r;\n }\n else if (c || d)\n {\n var s = Math.sqrt(c * c + d * d);\n\n decomposedMatrix.rotation = Math.PI * 0.5 - (d > 0 ? Math.acos(-c / s) : -Math.acos(c / s));\n decomposedMatrix.scaleX = determ / s;\n decomposedMatrix.scaleY = s;\n }\n else\n {\n decomposedMatrix.rotation = 0;\n decomposedMatrix.scaleX = 0;\n decomposedMatrix.scaleY = 0;\n }\n\n return decomposedMatrix;\n },\n\n /**\n * Apply the identity, translate, rotate and scale operations on the Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#applyITRS\n * @since 3.0.0\n *\n * @param {number} x - The horizontal translation.\n * @param {number} y - The vertical translation.\n * @param {number} rotation - The angle of rotation in radians.\n * @param {number} scaleX - The horizontal scale.\n * @param {number} scaleY - The vertical scale.\n *\n * @return {this} This TransformMatrix.\n */\n applyITRS: function (x, y, rotation, scaleX, scaleY)\n {\n var matrix = this.matrix;\n\n var radianSin = Math.sin(rotation);\n var radianCos = Math.cos(rotation);\n\n // Translate\n matrix[4] = x;\n matrix[5] = y;\n\n // Rotate and Scale\n matrix[0] = radianCos * scaleX;\n matrix[1] = radianSin * scaleX;\n matrix[2] = -radianSin * scaleY;\n matrix[3] = radianCos * scaleY;\n\n return this;\n },\n\n /**\n * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of\n * the current matrix with its transformation applied.\n *\n * Can be used to translate points from world to local space.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse\n * @since 3.12.0\n *\n * @param {number} x - The x position to translate.\n * @param {number} y - The y position to translate.\n * @param {Phaser.Math.Vector2} [output] - A Vector2, or point-like object, to store the results in.\n *\n * @return {Phaser.Math.Vector2} The coordinates, inverse-transformed through this matrix.\n */\n applyInverse: function (x, y, output)\n {\n if (output === undefined) { output = new Vector2(); }\n\n var matrix = this.matrix;\n\n var a = matrix[0];\n var b = matrix[1];\n var c = matrix[2];\n var d = matrix[3];\n var tx = matrix[4];\n var ty = matrix[5];\n\n var id = 1 / ((a * d) + (c * -b));\n\n output.x = (d * id * x) + (-c * id * y) + (((ty * c) - (tx * d)) * id);\n output.y = (a * id * y) + (-b * id * x) + (((-ty * a) + (tx * b)) * id);\n\n return output;\n },\n\n /**\n * Returns the X component of this matrix multiplied by the given values.\n * This is the same as `x * a + y * c + e`.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#getX\n * @since 3.12.0\n *\n * @param {number} x - The x value.\n * @param {number} y - The y value.\n *\n * @return {number} The calculated x value.\n */\n getX: function (x, y)\n {\n return x * this.a + y * this.c + this.e;\n },\n\n /**\n * Returns the Y component of this matrix multiplied by the given values.\n * This is the same as `x * b + y * d + f`.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#getY\n * @since 3.12.0\n *\n * @param {number} x - The x value.\n * @param {number} y - The y value.\n *\n * @return {number} The calculated y value.\n */\n getY: function (x, y)\n {\n return x * this.b + y * this.d + this.f;\n },\n\n /**\n * Returns the X component of this matrix multiplied by the given values.\n *\n * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#getXRound\n * @since 3.50.0\n *\n * @param {number} x - The x value.\n * @param {number} y - The y value.\n * @param {boolean} [round=false] - Math.round the resulting value?\n *\n * @return {number} The calculated x value.\n */\n getXRound: function (x, y, round)\n {\n var v = this.getX(x, y);\n\n if (round)\n {\n v = Math.round(v);\n }\n\n return v;\n },\n\n /**\n * Returns the Y component of this matrix multiplied by the given values.\n *\n * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#getYRound\n * @since 3.50.0\n *\n * @param {number} x - The x value.\n * @param {number} y - The y value.\n * @param {boolean} [round=false] - Math.round the resulting value?\n *\n * @return {number} The calculated y value.\n */\n getYRound: function (x, y, round)\n {\n var v = this.getY(x, y);\n\n if (round)\n {\n v = Math.round(v);\n }\n\n return v;\n },\n\n /**\n * Returns a string that can be used in a CSS Transform call as a `matrix` property.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#getCSSMatrix\n * @since 3.12.0\n *\n * @return {string} A string containing the CSS Transform matrix values.\n */\n getCSSMatrix: function ()\n {\n var m = this.matrix;\n\n return 'matrix(' + m[0] + ',' + m[1] + ',' + m[2] + ',' + m[3] + ',' + m[4] + ',' + m[5] + ')';\n },\n\n /**\n * Destroys this Transform Matrix.\n *\n * @method Phaser.GameObjects.Components.TransformMatrix#destroy\n * @since 3.4.0\n */\n destroy: function ()\n {\n this.matrix = null;\n this.decomposedMatrix = null;\n }\n\n});\n\nmodule.exports = TransformMatrix;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// bitmask flag for GameObject.renderMask\nvar _FLAG = 1; // 0001\n\n/**\n * Provides methods used for setting the visibility of a Game Object.\n * Should be applied as a mixin and not used directly.\n * \n * @namespace Phaser.GameObjects.Components.Visible\n * @since 3.0.0\n */\n\nvar Visible = {\n\n /**\n * Private internal value. Holds the visible value.\n * \n * @name Phaser.GameObjects.Components.Visible#_visible\n * @type {boolean}\n * @private\n * @default true\n * @since 3.0.0\n */\n _visible: true,\n\n /**\n * The visible state of the Game Object.\n * \n * An invisible Game Object will skip rendering, but will still process update logic.\n * \n * @name Phaser.GameObjects.Components.Visible#visible\n * @type {boolean}\n * @since 3.0.0\n */\n visible: {\n\n get: function ()\n {\n return this._visible;\n },\n\n set: function (value)\n {\n if (value)\n {\n this._visible = true;\n this.renderFlags |= _FLAG;\n }\n else\n {\n this._visible = false;\n this.renderFlags &= ~_FLAG;\n }\n }\n\n },\n\n /**\n * Sets the visibility of this Game Object.\n * \n * An invisible Game Object will skip rendering, but will still process update logic.\n *\n * @method Phaser.GameObjects.Components.Visible#setVisible\n * @since 3.0.0\n *\n * @param {boolean} value - The visible state of the Game Object.\n * \n * @return {this} This Game Object instance.\n */\n setVisible: function (value)\n {\n this.visible = value;\n\n return this;\n }\n};\n\nmodule.exports = Visible;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.GameObjects.Components\n */\n\nmodule.exports = {\n\n Alpha: require('./Alpha'),\n AlphaSingle: require('./AlphaSingle'),\n BlendMode: require('./BlendMode'),\n ComputedSize: require('./ComputedSize'),\n Crop: require('./Crop'),\n Depth: require('./Depth'),\n Flip: require('./Flip'),\n GetBounds: require('./GetBounds'),\n Mask: require('./Mask'),\n Origin: require('./Origin'),\n PathFollower: require('./PathFollower'),\n Pipeline: require('./Pipeline'),\n ScrollFactor: require('./ScrollFactor'),\n Size: require('./Size'),\n Texture: require('./Texture'),\n TextureCrop: require('./TextureCrop'),\n Tint: require('./Tint'),\n ToJSON: require('./ToJSON'),\n Transform: require('./Transform'),\n TransformMatrix: require('./TransformMatrix'),\n Visible: require('./Visible')\n\n};\n","/**\n * @author Richard Davey \n * @author Felipe Alfonso <@bitnenfer>\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar ArrayUtils = require('../../utils/array');\nvar BlendModes = require('../../renderer/BlendModes');\nvar Class = require('../../utils/Class');\nvar Components = require('../components');\nvar Events = require('../events');\nvar GameObject = require('../GameObject');\nvar Rectangle = require('../../geom/rectangle/Rectangle');\nvar Render = require('./ContainerRender');\nvar Union = require('../../geom/rectangle/Union');\nvar Vector2 = require('../../math/Vector2');\n\n/**\n * @classdesc\n * A Container Game Object.\n *\n * A Container, as the name implies, can 'contain' other types of Game Object.\n * When a Game Object is added to a Container, the Container becomes responsible for the rendering of it.\n * By default it will be removed from the Display List and instead added to the Containers own internal list.\n *\n * The position of the Game Object automatically becomes relative to the position of the Container.\n *\n * The origin of a Container is 0x0 (in local space) and that cannot be changed. The children you add to the\n * Container should be positioned with this value in mind. I.e. you should treat 0x0 as being the center of\n * the Container, and position children positively and negative around it as required.\n *\n * When the Container is rendered, all of its children are rendered as well, in the order in which they exist\n * within the Container. Container children can be repositioned using methods such as `MoveUp`, `MoveDown` and `SendToBack`.\n *\n * If you modify a transform property of the Container, such as `Container.x` or `Container.rotation` then it will\n * automatically influence all children as well.\n *\n * Containers can include other Containers for deeply nested transforms.\n *\n * Containers can have masks set on them and can be used as a mask too. However, Container children cannot be masked.\n * The masks do not 'stack up'. Only a Container on the root of the display list will use its mask.\n *\n * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them\n * to use as their hit area. Container children can also be enabled for input, independent of the Container.\n *\n * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child,\n * or the input area will become misaligned.\n *\n * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However,\n * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies,\n * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children\n * with physics do not factor in the Container due to the excessive extra calculations needed. Please structure\n * your game to work around this.\n *\n * It's important to understand the impact of using Containers. They add additional processing overhead into\n * every one of their children. The deeper you nest them, the more the cost escalates. This is especially true\n * for input events. You also loose the ability to set the display depth of Container children in the same\n * flexible manner as those not within them. In short, don't use them for the sake of it. You pay a small cost\n * every time you create one, try to structure your game around avoiding that where possible.\n *\n * @class Container\n * @extends Phaser.GameObjects.GameObject\n * @memberof Phaser.GameObjects\n * @constructor\n * @since 3.4.0\n *\n * @extends Phaser.GameObjects.Components.AlphaSingle\n * @extends Phaser.GameObjects.Components.BlendMode\n * @extends Phaser.GameObjects.Components.ComputedSize\n * @extends Phaser.GameObjects.Components.Depth\n * @extends Phaser.GameObjects.Components.Mask\n * @extends Phaser.GameObjects.Components.Pipeline\n * @extends Phaser.GameObjects.Components.Transform\n * @extends Phaser.GameObjects.Components.Visible\n *\n * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.\n * @param {number} [x=0] - The horizontal position of this Game Object in the world.\n * @param {number} [y=0] - The vertical position of this Game Object in the world.\n * @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Container.\n */\nvar Container = new Class({\n\n Extends: GameObject,\n\n Mixins: [\n Components.AlphaSingle,\n Components.BlendMode,\n Components.ComputedSize,\n Components.Depth,\n Components.Mask,\n Components.Pipeline,\n Components.Transform,\n Components.Visible,\n Render\n ],\n\n initialize:\n\n function Container (scene, x, y, children)\n {\n GameObject.call(this, scene, 'Container');\n\n /**\n * An array holding the children of this Container.\n *\n * @name Phaser.GameObjects.Container#list\n * @type {Phaser.GameObjects.GameObject[]}\n * @since 3.4.0\n */\n this.list = [];\n\n /**\n * Does this Container exclusively manage its children?\n *\n * The default is `true` which means a child added to this Container cannot\n * belong in another Container, which includes the Scene display list.\n *\n * If you disable this then this Container will no longer exclusively manage its children.\n * This allows you to create all kinds of interesting graphical effects, such as replicating\n * Game Objects without reparenting them all over the Scene.\n * However, doing so will prevent children from receiving any kind of input event or have\n * their physics bodies work by default, as they're no longer a single entity on the\n * display list, but are being replicated where-ever this Container is.\n *\n * @name Phaser.GameObjects.Container#exclusive\n * @type {boolean}\n * @default true\n * @since 3.4.0\n */\n this.exclusive = true;\n\n /**\n * Containers can have an optional maximum size. If set to anything above 0 it\n * will constrict the addition of new Game Objects into the Container, capping off\n * the maximum limit the Container can grow in size to.\n *\n * @name Phaser.GameObjects.Container#maxSize\n * @type {number}\n * @default -1\n * @since 3.4.0\n */\n this.maxSize = -1;\n\n /**\n * The cursor position.\n *\n * @name Phaser.GameObjects.Container#position\n * @type {number}\n * @since 3.4.0\n */\n this.position = 0;\n\n /**\n * Internal Transform Matrix used for local space conversion.\n *\n * @name Phaser.GameObjects.Container#localTransform\n * @type {Phaser.GameObjects.Components.TransformMatrix}\n * @since 3.4.0\n */\n this.localTransform = new Components.TransformMatrix();\n\n /**\n * Internal temporary Transform Matrix used to avoid object creation.\n *\n * @name Phaser.GameObjects.Container#tempTransformMatrix\n * @type {Phaser.GameObjects.Components.TransformMatrix}\n * @private\n * @since 3.4.0\n */\n this.tempTransformMatrix = new Components.TransformMatrix();\n\n /**\n * A reference to the Scene Display List.\n *\n * @name Phaser.GameObjects.Container#_displayList\n * @type {Phaser.GameObjects.DisplayList}\n * @private\n * @since 3.4.0\n */\n this._displayList = scene.sys.displayList;\n\n /**\n * The property key to sort by.\n *\n * @name Phaser.GameObjects.Container#_sortKey\n * @type {string}\n * @private\n * @since 3.4.0\n */\n this._sortKey = '';\n\n /**\n * A reference to the Scene Systems Event Emitter.\n *\n * @name Phaser.GameObjects.Container#_sysEvents\n * @type {Phaser.Events.EventEmitter}\n * @private\n * @since 3.9.0\n */\n this._sysEvents = scene.sys.events;\n\n /**\n * The horizontal scroll factor of this Container.\n *\n * The scroll factor controls the influence of the movement of a Camera upon this Container.\n *\n * When a camera scrolls it will change the location at which this Container is rendered on-screen.\n * It does not change the Containers actual position values.\n *\n * For a Container, setting this value will only update the Container itself, not its children.\n * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method.\n *\n * A value of 1 means it will move exactly in sync with a camera.\n * A value of 0 means it will not move at all, even if the camera moves.\n * Other values control the degree to which the camera movement is mapped to this Container.\n *\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\n * calculating physics collisions. Bodies always collide based on their world position, but changing\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\n * them from physics bodies if not accounted for in your code.\n *\n * @name Phaser.GameObjects.Container#scrollFactorX\n * @type {number}\n * @default 1\n * @since 3.4.0\n */\n this.scrollFactorX = 1;\n\n /**\n * The vertical scroll factor of this Container.\n *\n * The scroll factor controls the influence of the movement of a Camera upon this Container.\n *\n * When a camera scrolls it will change the location at which this Container is rendered on-screen.\n * It does not change the Containers actual position values.\n *\n * For a Container, setting this value will only update the Container itself, not its children.\n * If you wish to change the scrollFactor of the children as well, use the `setScrollFactor` method.\n *\n * A value of 1 means it will move exactly in sync with a camera.\n * A value of 0 means it will not move at all, even if the camera moves.\n * Other values control the degree to which the camera movement is mapped to this Container.\n *\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\n * calculating physics collisions. Bodies always collide based on their world position, but changing\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\n * them from physics bodies if not accounted for in your code.\n *\n * @name Phaser.GameObjects.Container#scrollFactorY\n * @type {number}\n * @default 1\n * @since 3.4.0\n */\n this.scrollFactorY = 1;\n\n this.initPipeline();\n\n this.setPosition(x, y);\n\n this.clearAlpha();\n\n this.setBlendMode(BlendModes.SKIP_CHECK);\n\n if (children)\n {\n this.add(children);\n }\n },\n\n /**\n * Internal value to allow Containers to be used for input and physics.\n * Do not change this value. It has no effect other than to break things.\n *\n * @name Phaser.GameObjects.Container#originX\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n originX: {\n\n get: function ()\n {\n return 0.5;\n }\n\n },\n\n /**\n * Internal value to allow Containers to be used for input and physics.\n * Do not change this value. It has no effect other than to break things.\n *\n * @name Phaser.GameObjects.Container#originY\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n originY: {\n\n get: function ()\n {\n return 0.5;\n }\n\n },\n\n /**\n * Internal value to allow Containers to be used for input and physics.\n * Do not change this value. It has no effect other than to break things.\n *\n * @name Phaser.GameObjects.Container#displayOriginX\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n displayOriginX: {\n\n get: function ()\n {\n return this.width * 0.5;\n }\n\n },\n\n /**\n * Internal value to allow Containers to be used for input and physics.\n * Do not change this value. It has no effect other than to break things.\n *\n * @name Phaser.GameObjects.Container#displayOriginY\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n displayOriginY: {\n\n get: function ()\n {\n return this.height * 0.5;\n }\n\n },\n\n /**\n * Does this Container exclusively manage its children?\n *\n * The default is `true` which means a child added to this Container cannot\n * belong in another Container, which includes the Scene display list.\n *\n * If you disable this then this Container will no longer exclusively manage its children.\n * This allows you to create all kinds of interesting graphical effects, such as replicating\n * Game Objects without reparenting them all over the Scene.\n * However, doing so will prevent children from receiving any kind of input event or have\n * their physics bodies work by default, as they're no longer a single entity on the\n * display list, but are being replicated where-ever this Container is.\n *\n * @method Phaser.GameObjects.Container#setExclusive\n * @since 3.4.0\n *\n * @param {boolean} [value=true] - The exclusive state of this Container.\n *\n * @return {this} This Container.\n */\n setExclusive: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.exclusive = value;\n\n return this;\n },\n\n /**\n * Gets the bounds of this Container. It works by iterating all children of the Container,\n * getting their respective bounds, and then working out a min-max rectangle from that.\n * It does not factor in if the children render or not, all are included.\n *\n * Some children are unable to return their bounds, such as Graphics objects, in which case\n * they are skipped.\n *\n * Depending on the quantity of children in this Container it could be a really expensive call,\n * so cache it and only poll it as needed.\n *\n * The values are stored and returned in a Rectangle object.\n *\n * @method Phaser.GameObjects.Container#getBounds\n * @since 3.4.0\n *\n * @param {Phaser.Geom.Rectangle} [output] - A Geom.Rectangle object to store the values in. If not provided a new Rectangle will be created.\n *\n * @return {Phaser.Geom.Rectangle} The values stored in the output object.\n */\n getBounds: function (output)\n {\n if (output === undefined) { output = new Rectangle(); }\n\n output.setTo(this.x, this.y, 0, 0);\n\n if (this.parentContainer)\n {\n var parentMatrix = this.parentContainer.getBoundsTransformMatrix();\n var transformedPosition = parentMatrix.transformPoint(this.x, this.y);\n\n output.setTo(transformedPosition.x, transformedPosition.y, 0, 0);\n }\n\n if (this.list.length > 0)\n {\n var children = this.list;\n var tempRect = new Rectangle();\n var hasSetFirst = false;\n\n output.setEmpty();\n\n for (var i = 0; i < children.length; i++)\n {\n var entry = children[i];\n\n if (entry.getBounds)\n {\n entry.getBounds(tempRect);\n\n if (!hasSetFirst)\n {\n output.setTo(tempRect.x, tempRect.y, tempRect.width, tempRect.height);\n hasSetFirst = true;\n }\n else\n {\n Union(tempRect, output, output);\n }\n }\n }\n }\n\n return output;\n },\n\n /**\n * Internal add handler.\n *\n * @method Phaser.GameObjects.Container#addHandler\n * @private\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to this Container.\n */\n addHandler: function (gameObject)\n {\n gameObject.once(Events.DESTROY, this.remove, this);\n\n if (this.exclusive)\n {\n this._displayList.remove(gameObject);\n\n if (gameObject.parentContainer)\n {\n gameObject.parentContainer.remove(gameObject);\n }\n\n gameObject.parentContainer = this;\n }\n\n // Is only on the Display List via this Container\n if (!this.scene.sys.displayList.exists(gameObject))\n {\n gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene);\n }\n },\n\n /**\n * Internal remove handler.\n *\n * @method Phaser.GameObjects.Container#removeHandler\n * @private\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just removed from this Container.\n */\n removeHandler: function (gameObject)\n {\n gameObject.off(Events.DESTROY, this.remove);\n\n if (this.exclusive)\n {\n gameObject.parentContainer = null;\n }\n\n // Is only on the Display List via this Container\n if (!this.scene.sys.displayList.exists(gameObject))\n {\n gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene);\n }\n },\n\n /**\n * Takes a Point-like object, such as a Vector2, Geom.Point or object with public x and y properties,\n * and transforms it into the space of this Container, then returns it in the output object.\n *\n * @method Phaser.GameObjects.Container#pointToContainer\n * @since 3.4.0\n *\n * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} source - The Source Point to be transformed.\n * @param {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} [output] - A destination object to store the transformed point in. If none given a Vector2 will be created and returned.\n *\n * @return {(object|Phaser.Geom.Point|Phaser.Math.Vector2)} The transformed point.\n */\n pointToContainer: function (source, output)\n {\n if (output === undefined) { output = new Vector2(); }\n\n if (this.parentContainer)\n {\n this.parentContainer.pointToContainer(source, output);\n }\n else\n {\n output = new Vector2(source.x, source.y);\n }\n\n var tempMatrix = this.tempTransformMatrix;\n\n // No need to loadIdentity because applyITRS overwrites every value anyway\n tempMatrix.applyITRS(this.x, this.y, this.rotation, this.scaleX, this.scaleY);\n\n tempMatrix.invert();\n\n tempMatrix.transformPoint(source.x, source.y, output);\n\n return output;\n },\n\n /**\n * Returns the world transform matrix as used for Bounds checks.\n *\n * The returned matrix is temporal and shouldn't be stored.\n *\n * @method Phaser.GameObjects.Container#getBoundsTransformMatrix\n * @since 3.4.0\n *\n * @return {Phaser.GameObjects.Components.TransformMatrix} The world transform matrix.\n */\n getBoundsTransformMatrix: function ()\n {\n return this.getWorldTransformMatrix(this.tempTransformMatrix, this.localTransform);\n },\n\n /**\n * Adds the given Game Object, or array of Game Objects, to this Container.\n *\n * Each Game Object must be unique within the Container.\n *\n * @method Phaser.GameObjects.Container#add\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.\n *\n * @return {this} This Container instance.\n */\n add: function (child)\n {\n ArrayUtils.Add(this.list, child, this.maxSize, this.addHandler, this);\n\n return this;\n },\n\n /**\n * Adds the given Game Object, or array of Game Objects, to this Container at the specified position.\n *\n * Existing Game Objects in the Container are shifted up.\n *\n * Each Game Object must be unique within the Container.\n *\n * @method Phaser.GameObjects.Container#addAt\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.\n * @param {number} [index=0] - The position to insert the Game Object/s at.\n *\n * @return {this} This Container instance.\n */\n addAt: function (child, index)\n {\n ArrayUtils.AddAt(this.list, child, index, this.maxSize, this.addHandler, this);\n\n return this;\n },\n\n /**\n * Returns the Game Object at the given position in this Container.\n *\n * @method Phaser.GameObjects.Container#getAt\n * @since 3.4.0\n *\n * @param {number} index - The position to get the Game Object from.\n *\n * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found.\n */\n getAt: function (index)\n {\n return this.list[index];\n },\n\n /**\n * Returns the index of the given Game Object in this Container.\n *\n * @method Phaser.GameObjects.Container#getIndex\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container.\n *\n * @return {number} The index of the Game Object in this Container, or -1 if not found.\n */\n getIndex: function (child)\n {\n return this.list.indexOf(child);\n },\n\n /**\n * Sort the contents of this Container so the items are in order based on the given property.\n * For example: `sort('alpha')` would sort the elements based on the value of their `alpha` property.\n *\n * @method Phaser.GameObjects.Container#sort\n * @since 3.4.0\n *\n * @param {string} property - The property to lexically sort by.\n * @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean.\n *\n * @return {this} This Container instance.\n */\n sort: function (property, handler)\n {\n if (!property)\n {\n return this;\n }\n\n if (handler === undefined)\n {\n handler = function (childA, childB)\n {\n return childA[property] - childB[property];\n };\n }\n\n ArrayUtils.StableSort(this.list, handler);\n\n return this;\n },\n\n /**\n * Searches for the first instance of a child with its `name` property matching the given argument.\n * Should more than one child have the same name only the first is returned.\n *\n * @method Phaser.GameObjects.Container#getByName\n * @since 3.4.0\n *\n * @param {string} name - The name to search for.\n *\n * @return {?Phaser.GameObjects.GameObject} The first child with a matching name, or `null` if none were found.\n */\n getByName: function (name)\n {\n return ArrayUtils.GetFirst(this.list, 'name', name);\n },\n\n /**\n * Returns a random Game Object from this Container.\n *\n * @method Phaser.GameObjects.Container#getRandom\n * @since 3.4.0\n *\n * @param {number} [startIndex=0] - An optional start index.\n * @param {number} [length] - An optional length, the total number of elements (from the startIndex) to choose from.\n *\n * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty.\n */\n getRandom: function (startIndex, length)\n {\n return ArrayUtils.GetRandom(this.list, startIndex, length);\n },\n\n /**\n * Gets the first Game Object in this Container.\n *\n * You can also specify a property and value to search for, in which case it will return the first\n * Game Object in this Container with a matching property and / or value.\n *\n * For example: `getFirst('visible', true)` would return the first Game Object that had its `visible` property set.\n *\n * You can limit the search to the `startIndex` - `endIndex` range.\n *\n * @method Phaser.GameObjects.Container#getFirst\n * @since 3.4.0\n *\n * @param {string} property - The property to test on each Game Object in the Container.\n * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check.\n * @param {number} [startIndex=0] - An optional start index to search from.\n * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included)\n *\n * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found.\n */\n getFirst: function (property, value, startIndex, endIndex)\n {\n return ArrayUtils.GetFirst(this.list, property, value, startIndex, endIndex);\n },\n\n /**\n * Returns all Game Objects in this Container.\n *\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\n *\n * For example: `getAll('body')` would return only Game Objects that have a body property.\n *\n * You can also specify a value to compare the property to:\n *\n * `getAll('visible', true)` would return only Game Objects that have their visible property set to `true`.\n *\n * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects,\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\n * the first 50 Game Objects.\n *\n * @method Phaser.GameObjects.Container#getAll\n * @since 3.4.0\n *\n * @param {string} [property] - The property to test on each Game Object in the Container.\n * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results.\n * @param {number} [startIndex=0] - An optional start index to search from.\n * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included)\n *\n * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container.\n */\n getAll: function (property, value, startIndex, endIndex)\n {\n return ArrayUtils.GetAll(this.list, property, value, startIndex, endIndex);\n },\n\n /**\n * Returns the total number of Game Objects in this Container that have a property\n * matching the given value.\n *\n * For example: `count('visible', true)` would count all the elements that have their visible property set.\n *\n * You can optionally limit the operation to the `startIndex` - `endIndex` range.\n *\n * @method Phaser.GameObjects.Container#count\n * @since 3.4.0\n *\n * @param {string} property - The property to check.\n * @param {any} value - The value to check.\n * @param {number} [startIndex=0] - An optional start index to search from.\n * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included)\n *\n * @return {number} The total number of Game Objects in this Container with a property matching the given value.\n */\n count: function (property, value, startIndex, endIndex)\n {\n return ArrayUtils.CountAllMatching(this.list, property, value, startIndex, endIndex);\n },\n\n /**\n * Swaps the position of two Game Objects in this Container.\n * Both Game Objects must belong to this Container.\n *\n * @method Phaser.GameObjects.Container#swap\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child1 - The first Game Object to swap.\n * @param {Phaser.GameObjects.GameObject} child2 - The second Game Object to swap.\n *\n * @return {this} This Container instance.\n */\n swap: function (child1, child2)\n {\n ArrayUtils.Swap(this.list, child1, child2);\n\n return this;\n },\n\n /**\n * Moves a Game Object to a new position within this Container.\n *\n * The Game Object must already be a child of this Container.\n *\n * The Game Object is removed from its old position and inserted into the new one.\n * Therefore the Container size does not change. Other children will change position accordingly.\n *\n * @method Phaser.GameObjects.Container#moveTo\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to move.\n * @param {number} index - The new position of the Game Object in this Container.\n *\n * @return {this} This Container instance.\n */\n moveTo: function (child, index)\n {\n ArrayUtils.MoveTo(this.list, child, index);\n\n return this;\n },\n\n /**\n * Removes the given Game Object, or array of Game Objects, from this Container.\n *\n * The Game Objects must already be children of this Container.\n *\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\n *\n * @method Phaser.GameObjects.Container#remove\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to be removed from the Container.\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each child successfully removed from this Container.\n *\n * @return {this} This Container instance.\n */\n remove: function (child, destroyChild)\n {\n var removed = ArrayUtils.Remove(this.list, child, this.removeHandler, this);\n\n if (destroyChild && removed)\n {\n if (!Array.isArray(removed))\n {\n removed = [ removed ];\n }\n\n for (var i = 0; i < removed.length; i++)\n {\n removed[i].destroy();\n }\n }\n\n return this;\n },\n\n /**\n * Removes the Game Object at the given position in this Container.\n *\n * You can also optionally call `destroy` on the Game Object, if one is found.\n *\n * @method Phaser.GameObjects.Container#removeAt\n * @since 3.4.0\n *\n * @param {number} index - The index of the Game Object to be removed.\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.\n *\n * @return {this} This Container instance.\n */\n removeAt: function (index, destroyChild)\n {\n var removed = ArrayUtils.RemoveAt(this.list, index, this.removeHandler, this);\n\n if (destroyChild && removed)\n {\n removed.destroy();\n }\n\n return this;\n },\n\n /**\n * Removes the Game Objects between the given positions in this Container.\n *\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\n *\n * @method Phaser.GameObjects.Container#removeBetween\n * @since 3.4.0\n *\n * @param {number} [startIndex=0] - An optional start index to search from.\n * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included)\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.\n *\n * @return {this} This Container instance.\n */\n removeBetween: function (startIndex, endIndex, destroyChild)\n {\n var removed = ArrayUtils.RemoveBetween(this.list, startIndex, endIndex, this.removeHandler, this);\n\n if (destroyChild)\n {\n for (var i = 0; i < removed.length; i++)\n {\n removed[i].destroy();\n }\n }\n\n return this;\n },\n\n /**\n * Removes all Game Objects from this Container.\n *\n * You can also optionally call `destroy` on each Game Object that is removed from the Container.\n *\n * @method Phaser.GameObjects.Container#removeAll\n * @since 3.4.0\n *\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.\n *\n * @return {this} This Container instance.\n */\n removeAll: function (destroyChild)\n {\n var removed = ArrayUtils.RemoveBetween(this.list, 0, this.list.length, this.removeHandler, this);\n\n if (destroyChild)\n {\n for (var i = 0; i < removed.length; i++)\n {\n removed[i].destroy();\n }\n }\n\n return this;\n },\n\n /**\n * Brings the given Game Object to the top of this Container.\n * This will cause it to render on-top of any other objects in the Container.\n *\n * @method Phaser.GameObjects.Container#bringToTop\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to bring to the top of the Container.\n *\n * @return {this} This Container instance.\n */\n bringToTop: function (child)\n {\n ArrayUtils.BringToTop(this.list, child);\n\n return this;\n },\n\n /**\n * Sends the given Game Object to the bottom of this Container.\n * This will cause it to render below any other objects in the Container.\n *\n * @method Phaser.GameObjects.Container#sendToBack\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to send to the bottom of the Container.\n *\n * @return {this} This Container instance.\n */\n sendToBack: function (child)\n {\n ArrayUtils.SendToBack(this.list, child);\n\n return this;\n },\n\n /**\n * Moves the given Game Object up one place in this Container, unless it's already at the top.\n *\n * @method Phaser.GameObjects.Container#moveUp\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.\n *\n * @return {this} This Container instance.\n */\n moveUp: function (child)\n {\n ArrayUtils.MoveUp(this.list, child);\n\n return this;\n },\n\n /**\n * Moves the given Game Object down one place in this Container, unless it's already at the bottom.\n *\n * @method Phaser.GameObjects.Container#moveDown\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.\n *\n * @return {this} This Container instance.\n */\n moveDown: function (child)\n {\n ArrayUtils.MoveDown(this.list, child);\n\n return this;\n },\n\n /**\n * Reverses the order of all Game Objects in this Container.\n *\n * @method Phaser.GameObjects.Container#reverse\n * @since 3.4.0\n *\n * @return {this} This Container instance.\n */\n reverse: function ()\n {\n this.list.reverse();\n\n return this;\n },\n\n /**\n * Shuffles the all Game Objects in this Container using the Fisher-Yates implementation.\n *\n * @method Phaser.GameObjects.Container#shuffle\n * @since 3.4.0\n *\n * @return {this} This Container instance.\n */\n shuffle: function ()\n {\n ArrayUtils.Shuffle(this.list);\n\n return this;\n },\n\n /**\n * Replaces a Game Object in this Container with the new Game Object.\n * The new Game Object cannot already be a child of this Container.\n *\n * @method Phaser.GameObjects.Container#replace\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} oldChild - The Game Object in this Container that will be replaced.\n * @param {Phaser.GameObjects.GameObject} newChild - The Game Object to be added to this Container.\n * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.\n *\n * @return {this} This Container instance.\n */\n replace: function (oldChild, newChild, destroyChild)\n {\n var moved = ArrayUtils.Replace(this.list, oldChild, newChild);\n\n if (moved)\n {\n this.addHandler(newChild);\n this.removeHandler(oldChild);\n\n if (destroyChild)\n {\n oldChild.destroy();\n }\n }\n\n return this;\n },\n\n /**\n * Returns `true` if the given Game Object is a direct child of this Container.\n *\n * This check does not scan nested Containers.\n *\n * @method Phaser.GameObjects.Container#exists\n * @since 3.4.0\n *\n * @param {Phaser.GameObjects.GameObject} child - The Game Object to check for within this Container.\n *\n * @return {boolean} True if the Game Object is an immediate child of this Container, otherwise false.\n */\n exists: function (child)\n {\n return (this.list.indexOf(child) > -1);\n },\n\n /**\n * Sets the property to the given value on all Game Objects in this Container.\n *\n * Optionally you can specify a start and end index. For example if this Container had 100 Game Objects,\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\n * the first 50 Game Objects.\n *\n * @method Phaser.GameObjects.Container#setAll\n * @since 3.4.0\n *\n * @param {string} property - The property that must exist on the Game Object.\n * @param {any} value - The value to get the property to.\n * @param {number} [startIndex=0] - An optional start index to search from.\n * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included)\n *\n * @return {this} This Container instance.\n */\n setAll: function (property, value, startIndex, endIndex)\n {\n ArrayUtils.SetAll(this.list, property, value, startIndex, endIndex);\n\n return this;\n },\n\n /**\n * @callback EachContainerCallback\n * @generic I - [item]\n *\n * @param {*} item - The child Game Object of the Container.\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\n */\n\n /**\n * Passes all Game Objects in this Container to the given callback.\n *\n * A copy of the Container is made before passing each entry to your callback.\n * This protects against the callback itself modifying the Container.\n *\n * If you know for sure that the callback will not change the size of this Container\n * then you can use the more performant `Container.iterate` method instead.\n *\n * @method Phaser.GameObjects.Container#each\n * @since 3.4.0\n *\n * @param {function} callback - The function to call.\n * @param {object} [context] - Value to use as `this` when executing callback.\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\n *\n * @return {this} This Container instance.\n */\n each: function (callback, context)\n {\n var args = [ null ];\n var i;\n var temp = this.list.slice();\n var len = temp.length;\n\n for (i = 2; i < arguments.length; i++)\n {\n args.push(arguments[i]);\n }\n\n for (i = 0; i < len; i++)\n {\n args[0] = temp[i];\n\n callback.apply(context, args);\n }\n\n return this;\n },\n\n /**\n * Passes all Game Objects in this Container to the given callback.\n *\n * Only use this method when you absolutely know that the Container will not be modified during\n * the iteration, i.e. by removing or adding to its contents.\n *\n * @method Phaser.GameObjects.Container#iterate\n * @since 3.4.0\n *\n * @param {function} callback - The function to call.\n * @param {object} [context] - Value to use as `this` when executing callback.\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\n *\n * @return {this} This Container instance.\n */\n iterate: function (callback, context)\n {\n var args = [ null ];\n var i;\n\n for (i = 2; i < arguments.length; i++)\n {\n args.push(arguments[i]);\n }\n\n for (i = 0; i < this.list.length; i++)\n {\n args[0] = this.list[i];\n\n callback.apply(context, args);\n }\n\n return this;\n },\n\n /**\n * Sets the scroll factor of this Container and optionally all of its children.\n *\n * The scroll factor controls the influence of the movement of a Camera upon this Game Object.\n *\n * When a camera scrolls it will change the location at which this Game Object is rendered on-screen.\n * It does not change the Game Objects actual position values.\n *\n * A value of 1 means it will move exactly in sync with a camera.\n * A value of 0 means it will not move at all, even if the camera moves.\n * Other values control the degree to which the camera movement is mapped to this Game Object.\n *\n * Please be aware that scroll factor values other than 1 are not taken in to consideration when\n * calculating physics collisions. Bodies always collide based on their world position, but changing\n * the scroll factor is a visual adjustment to where the textures are rendered, which can offset\n * them from physics bodies if not accounted for in your code.\n *\n * @method Phaser.GameObjects.Container#setScrollFactor\n * @since 3.4.0\n *\n * @param {number} x - The horizontal scroll factor of this Game Object.\n * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value.\n * @param {boolean} [updateChildren=false] - Apply this scrollFactor to all Container children as well?\n *\n * @return {this} This Game Object instance.\n */\n setScrollFactor: function (x, y, updateChildren)\n {\n if (y === undefined) { y = x; }\n if (updateChildren === undefined) { updateChildren = false; }\n\n this.scrollFactorX = x;\n this.scrollFactorY = y;\n\n if (updateChildren)\n {\n ArrayUtils.SetAll(this.list, 'scrollFactorX', x);\n ArrayUtils.SetAll(this.list, 'scrollFactorY', y);\n }\n\n return this;\n },\n\n /**\n * The number of Game Objects inside this Container.\n *\n * @name Phaser.GameObjects.Container#length\n * @type {number}\n * @readonly\n * @since 3.4.0\n */\n length: {\n\n get: function ()\n {\n return this.list.length;\n }\n\n },\n\n /**\n * Returns the first Game Object within the Container, or `null` if it is empty.\n *\n * You can move the cursor by calling `Container.next` and `Container.previous`.\n *\n * @name Phaser.GameObjects.Container#first\n * @type {?Phaser.GameObjects.GameObject}\n * @readonly\n * @since 3.4.0\n */\n first: {\n\n get: function ()\n {\n this.position = 0;\n\n if (this.list.length > 0)\n {\n return this.list[0];\n }\n else\n {\n return null;\n }\n }\n\n },\n\n /**\n * Returns the last Game Object within the Container, or `null` if it is empty.\n *\n * You can move the cursor by calling `Container.next` and `Container.previous`.\n *\n * @name Phaser.GameObjects.Container#last\n * @type {?Phaser.GameObjects.GameObject}\n * @readonly\n * @since 3.4.0\n */\n last: {\n\n get: function ()\n {\n if (this.list.length > 0)\n {\n this.position = this.list.length - 1;\n\n return this.list[this.position];\n }\n else\n {\n return null;\n }\n }\n\n },\n\n /**\n * Returns the next Game Object within the Container, or `null` if it is empty.\n *\n * You can move the cursor by calling `Container.next` and `Container.previous`.\n *\n * @name Phaser.GameObjects.Container#next\n * @type {?Phaser.GameObjects.GameObject}\n * @readonly\n * @since 3.4.0\n */\n next: {\n\n get: function ()\n {\n if (this.position < this.list.length)\n {\n this.position++;\n\n return this.list[this.position];\n }\n else\n {\n return null;\n }\n }\n\n },\n\n /**\n * Returns the previous Game Object within the Container, or `null` if it is empty.\n *\n * You can move the cursor by calling `Container.next` and `Container.previous`.\n *\n * @name Phaser.GameObjects.Container#previous\n * @type {?Phaser.GameObjects.GameObject}\n * @readonly\n * @since 3.4.0\n */\n previous: {\n\n get: function ()\n {\n if (this.position > 0)\n {\n this.position--;\n\n return this.list[this.position];\n }\n else\n {\n return null;\n }\n }\n\n },\n\n /**\n * Internal destroy handler, called as part of the destroy process.\n *\n * @method Phaser.GameObjects.Container#preDestroy\n * @protected\n * @since 3.9.0\n */\n preDestroy: function ()\n {\n this.removeAll(!!this.exclusive);\n\n this.localTransform.destroy();\n this.tempTransformMatrix.destroy();\n\n this.list = [];\n this._displayList = null;\n }\n\n});\n\nmodule.exports = Container;\n","/**\n * @author Richard Davey \n * @author Felipe Alfonso <@bitnenfer>\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Renders this Game Object with the Canvas Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method Phaser.GameObjects.Container#renderCanvas\n * @since 3.4.0\n * @private\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar ContainerCanvasRenderer = function (renderer, container, camera, parentMatrix)\n{\n var children = container.list;\n\n if (children.length === 0)\n {\n return;\n }\n\n var transformMatrix = container.localTransform;\n\n if (parentMatrix)\n {\n transformMatrix.loadIdentity();\n transformMatrix.multiply(parentMatrix);\n transformMatrix.translate(container.x, container.y);\n transformMatrix.rotate(container.rotation);\n transformMatrix.scale(container.scaleX, container.scaleY);\n }\n else\n {\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\n }\n\n var containerHasBlendMode = (container.blendMode !== -1);\n\n if (!containerHasBlendMode)\n {\n // If Container is SKIP_TEST then set blend mode to be Normal\n renderer.setBlendMode(0);\n }\n\n var alpha = container._alpha;\n var scrollFactorX = container.scrollFactorX;\n var scrollFactorY = container.scrollFactorY;\n\n if (container.mask)\n {\n container.mask.preRenderCanvas(renderer, null, camera);\n }\n\n for (var i = 0; i < children.length; i++)\n {\n var child = children[i];\n\n if (!child.willRender(camera))\n {\n continue;\n }\n\n var childAlpha = child.alpha;\n var childScrollFactorX = child.scrollFactorX;\n var childScrollFactorY = child.scrollFactorY;\n\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\n {\n // If Container doesn't have its own blend mode, then a child can have one\n renderer.setBlendMode(child.blendMode);\n }\n\n // Set parent values\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\n child.setAlpha(childAlpha * alpha);\n\n // Render\n child.renderCanvas(renderer, child, camera, transformMatrix);\n\n // Restore original values\n child.setAlpha(childAlpha);\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\n }\n\n if (container.mask)\n {\n container.mask.postRenderCanvas(renderer);\n }\n};\n\nmodule.exports = ContainerCanvasRenderer;\n","/**\n * @author Richard Davey \n * @author Felipe Alfonso <@bitnenfer>\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar renderWebGL = require('../../utils/NOOP');\nvar renderCanvas = require('../../utils/NOOP');\n\nif (typeof WEBGL_RENDERER)\n{\n renderWebGL = require('./ContainerWebGLRenderer');\n}\n\nif (typeof CANVAS_RENDERER)\n{\n renderCanvas = require('./ContainerCanvasRenderer');\n}\n\nmodule.exports = {\n\n renderWebGL: renderWebGL,\n renderCanvas: renderCanvas\n\n};\n","/**\n * @author Richard Davey \n * @author Felipe Alfonso <@bitnenfer>\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Renders this Game Object with the WebGL Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method Phaser.GameObjects.Container#renderWebGL\n * @since 3.4.0\n * @private\n *\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix)\n{\n var children = container.list;\n var childCount = children.length;\n\n if (childCount === 0)\n {\n return;\n }\n\n var transformMatrix = container.localTransform;\n\n if (parentMatrix)\n {\n transformMatrix.loadIdentity();\n transformMatrix.multiply(parentMatrix);\n transformMatrix.translate(container.x, container.y);\n transformMatrix.rotate(container.rotation);\n transformMatrix.scale(container.scaleX, container.scaleY);\n }\n else\n {\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\n }\n\n renderer.pipelines.preBatch(container);\n\n var containerHasBlendMode = (container.blendMode !== -1);\n\n if (!containerHasBlendMode)\n {\n // If Container is SKIP_TEST then set blend mode to be Normal\n renderer.setBlendMode(0);\n }\n\n var alpha = container.alpha;\n\n var scrollFactorX = container.scrollFactorX;\n var scrollFactorY = container.scrollFactorY;\n\n for (var i = 0; i < childCount; i++)\n {\n var child = children[i];\n\n if (!child.willRender(camera))\n {\n continue;\n }\n\n var childAlphaTopLeft;\n var childAlphaTopRight;\n var childAlphaBottomLeft;\n var childAlphaBottomRight;\n\n if (child.alphaTopLeft !== undefined)\n {\n childAlphaTopLeft = child.alphaTopLeft;\n childAlphaTopRight = child.alphaTopRight;\n childAlphaBottomLeft = child.alphaBottomLeft;\n childAlphaBottomRight = child.alphaBottomRight;\n }\n else\n {\n var childAlpha = child.alpha;\n\n childAlphaTopLeft = childAlpha;\n childAlphaTopRight = childAlpha;\n childAlphaBottomLeft = childAlpha;\n childAlphaBottomRight = childAlpha;\n }\n\n var childScrollFactorX = child.scrollFactorX;\n var childScrollFactorY = child.scrollFactorY;\n\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\n {\n // If Container doesn't have its own blend mode, then a child can have one\n renderer.setBlendMode(child.blendMode);\n }\n\n var mask = child.mask;\n\n if (mask)\n {\n mask.preRenderWebGL(renderer, child, camera);\n }\n\n var type = child.type;\n\n if (type !== renderer.currentType)\n {\n renderer.newType = true;\n renderer.currentType = type;\n }\n\n renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false;\n\n // Set parent values\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\n\n child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha);\n\n // Render\n child.renderWebGL(renderer, child, camera, transformMatrix);\n\n // Restore original values\n\n child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight);\n\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\n\n if (mask)\n {\n mask.postRenderWebGL(renderer, camera);\n }\n\n renderer.newType = false;\n }\n\n renderer.pipelines.postBatch(container);\n};\n\nmodule.exports = ContainerWebGLRenderer;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Added to Scene Event.\n *\n * This event is dispatched when a Game Object is added to a Scene.\n *\n * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`.\n *\n * @event Phaser.GameObjects.Events#ADDED_TO_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene.\n * @param {Phaser.Scene} scene - The Scene to which the Game Object was added.\n */\nmodule.exports = 'addedtoscene';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Destroy Event.\n * \n * This event is dispatched when a Game Object instance is being destroyed.\n * \n * Listen for it on a Game Object instance using `GameObject.on('destroy', listener)`.\n *\n * @event Phaser.GameObjects.Events#DESTROY\n * @since 3.0.0\n * \n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object which is being destroyed.\n */\nmodule.exports = 'destroy';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Removed from Scene Event.\n *\n * This event is dispatched when a Game Object is removed from a Scene.\n *\n * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`.\n *\n * @event Phaser.GameObjects.Events#REMOVED_FROM_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene.\n * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed.\n */\nmodule.exports = 'removedfromscene';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Complete Event.\n * \n * This event is dispatched when a Video finishes playback by reaching the end of its duration. It\n * is also dispatched if a video marker sequence is being played and reaches the end.\n * \n * Note that not all videos can fire this event. Live streams, for example, have no fixed duration,\n * so never technically 'complete'.\n * \n * If a video is stopped from playback, via the `Video.stop` method, it will emit the\n * `VIDEO_STOP` event instead of this one.\n * \n * Listen for it from a Video Game Object instance using `Video.on('complete', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_COMPLETE\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed playback.\n */\nmodule.exports = 'complete';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Created Event.\n * \n * This event is dispatched when the texture for a Video has been created. This happens\n * when enough of the video source has been loaded that the browser is able to render a\n * frame from it.\n * \n * Listen for it from a Video Game Object instance using `Video.on('created', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_CREATED\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event.\n * @param {number} width - The width of the video.\n * @param {number} height - The height of the video.\n */\nmodule.exports = 'created';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Error Event.\n * \n * This event is dispatched when a Video tries to play a source that does not exist, or is the wrong file type.\n * \n * Listen for it from a Video Game Object instance using `Video.on('error', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_ERROR\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which threw the error.\n * @param {Event} event - The native DOM event the browser raised during playback.\n */\nmodule.exports = 'error';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Loop Event.\n * \n * This event is dispatched when a Video that is currently playing has looped. This only\n * happens if the `loop` parameter was specified, or the `setLoop` method was called,\n * and if the video has a fixed duration. Video streams, for example, cannot loop, as\n * they have no duration.\n * \n * Looping is based on the result of the Video `timeupdate` event. This event is not\n * frame-accurate, due to the way browsers work, so please do not rely on this loop\n * event to be time or frame precise.\n * \n * Listen for it from a Video Game Object instance using `Video.on('loop', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_LOOP\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which has looped.\n */\nmodule.exports = 'loop';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Play Event.\n * \n * This event is dispatched when a Video begins playback. For videos that do not require\n * interaction unlocking, this is usually as soon as the `Video.play` method is called.\n * However, for videos that require unlocking, it is fired once playback begins after\n * they've been unlocked.\n * \n * Listen for it from a Video Game Object instance using `Video.on('play', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_PLAY\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which started playback.\n */\nmodule.exports = 'play';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Seeked Event.\n * \n * This event is dispatched when a Video completes seeking to a new point in its timeline.\n * \n * Listen for it from a Video Game Object instance using `Video.on('seeked', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_SEEKED\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which completed seeking.\n */\nmodule.exports = 'seeked';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Seeking Event.\n * \n * This event is dispatched when a Video _begins_ seeking to a new point in its timeline.\n * When the seek is complete, it will dispatch the `VIDEO_SEEKED` event to conclude.\n * \n * Listen for it from a Video Game Object instance using `Video.on('seeking', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_SEEKING\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which started seeking.\n */\nmodule.exports = 'seeking';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Stopped Event.\n * \n * This event is dispatched when a Video is stopped from playback via a call to the `Video.stop` method,\n * either directly via game code, or indirectly as the result of changing a video source or destroying it.\n * \n * Listen for it from a Video Game Object instance using `Video.on('stop', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_STOP\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which stopped playback.\n */\nmodule.exports = 'stop';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Timeout Event.\n * \n * This event is dispatched when a Video has exhausted its allocated time while trying to connect to a video\n * source to start playback.\n * \n * Listen for it from a Video Game Object instance using `Video.on('timeout', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_TIMEOUT\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which timed out.\n */\nmodule.exports = 'timeout';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Video Game Object Unlocked Event.\n * \n * This event is dispatched when a Video that was prevented from playback due to the browsers\n * Media Engagement Interaction policy, is unlocked by a user gesture.\n * \n * Listen for it from a Video Game Object instance using `Video.on('unlocked', listener)`.\n *\n * @event Phaser.GameObjects.Events#VIDEO_UNLOCKED\n * @since 3.20.0\n * \n * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event.\n */\nmodule.exports = 'unlocked';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.GameObjects.Events\n */\n\nmodule.exports = {\n\n ADDED_TO_SCENE: require('./ADDED_TO_SCENE_EVENT'),\n DESTROY: require('./DESTROY_EVENT'),\n REMOVED_FROM_SCENE: require('./REMOVED_FROM_SCENE_EVENT'),\n VIDEO_COMPLETE: require('./VIDEO_COMPLETE_EVENT'),\n VIDEO_CREATED: require('./VIDEO_CREATED_EVENT'),\n VIDEO_ERROR: require('./VIDEO_ERROR_EVENT'),\n VIDEO_LOOP: require('./VIDEO_LOOP_EVENT'),\n VIDEO_PLAY: require('./VIDEO_PLAY_EVENT'),\n VIDEO_SEEKED: require('./VIDEO_SEEKED_EVENT'),\n VIDEO_SEEKING: require('./VIDEO_SEEKING_EVENT'),\n VIDEO_STOP: require('./VIDEO_STOP_EVENT'),\n VIDEO_TIMEOUT: require('./VIDEO_TIMEOUT_EVENT'),\n VIDEO_UNLOCKED: require('./VIDEO_UNLOCKED_EVENT')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar GEOM_CONST = {\n\n /**\n * A Circle Geometry object type.\n * \n * @name Phaser.Geom.CIRCLE\n * @type {number}\n * @since 3.19.0\n */\n CIRCLE: 0,\n\n /**\n * An Ellipse Geometry object type.\n * \n * @name Phaser.Geom.ELLIPSE\n * @type {number}\n * @since 3.19.0\n */\n ELLIPSE: 1,\n\n /**\n * A Line Geometry object type.\n * \n * @name Phaser.Geom.LINE\n * @type {number}\n * @since 3.19.0\n */\n LINE: 2,\n\n /**\n * A Point Geometry object type.\n * \n * @name Phaser.Geom.POINT\n * @type {number}\n * @since 3.19.0\n */\n POINT: 3,\n\n /**\n * A Polygon Geometry object type.\n * \n * @name Phaser.Geom.POLYGON\n * @type {number}\n * @since 3.19.0\n */\n POLYGON: 4,\n\n /**\n * A Rectangle Geometry object type.\n * \n * @name Phaser.Geom.RECTANGLE\n * @type {number}\n * @since 3.19.0\n */\n RECTANGLE: 5,\n\n /**\n * A Triangle Geometry object type.\n * \n * @name Phaser.Geom.TRIANGLE\n * @type {number}\n * @since 3.19.0\n */\n TRIANGLE: 6\n\n};\n\nmodule.exports = GEOM_CONST;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Point = require('../point/Point');\n\n/**\n * Get a point on a line that's a given percentage along its length.\n *\n * @function Phaser.Geom.Line.GetPoint\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [out,$return]\n *\n * @param {Phaser.Geom.Line} line - The line.\n * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line.\n * @param {(Phaser.Geom.Point|object)} [out] - An optional point, or point-like object, to store the coordinates of the point on the line.\n *\n * @return {(Phaser.Geom.Point|object)} The point on the line.\n */\nvar GetPoint = function (line, position, out)\n{\n if (out === undefined) { out = new Point(); }\n\n out.x = line.x1 + (line.x2 - line.x1) * position;\n out.y = line.y1 + (line.y2 - line.y1) * position;\n\n return out;\n};\n\nmodule.exports = GetPoint;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Length = require('./Length');\nvar Point = require('../point/Point');\n\n/**\n * Get a number of points along a line's length.\n *\n * Provide a `quantity` to get an exact number of points along the line.\n *\n * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when\n * providing a `stepRate`.\n *\n * @function Phaser.Geom.Line.GetPoints\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\n *\n * @param {Phaser.Geom.Line} line - The line.\n * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead.\n * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`.\n * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line.\n *\n * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line.\n */\nvar GetPoints = function (line, quantity, stepRate, out)\n{\n if (out === undefined) { out = []; }\n\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\n if (!quantity && stepRate > 0)\n {\n quantity = Length(line) / stepRate;\n }\n\n var x1 = line.x1;\n var y1 = line.y1;\n\n var x2 = line.x2;\n var y2 = line.y2;\n\n for (var i = 0; i < quantity; i++)\n {\n var position = i / quantity;\n\n var x = x1 + (x2 - x1) * position;\n var y = y1 + (y2 - y1) * position;\n\n out.push(new Point(x, y));\n }\n\n return out;\n};\n\nmodule.exports = GetPoints;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the length of the given line.\n *\n * @function Phaser.Geom.Line.Length\n * @since 3.0.0\n *\n * @param {Phaser.Geom.Line} line - The line to calculate the length of.\n *\n * @return {number} The length of the line.\n */\nvar Length = function (line)\n{\n return Math.sqrt((line.x2 - line.x1) * (line.x2 - line.x1) + (line.y2 - line.y1) * (line.y2 - line.y1));\n};\n\nmodule.exports = Length;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar GetPoint = require('./GetPoint');\nvar GetPoints = require('./GetPoints');\nvar GEOM_CONST = require('../const');\nvar Random = require('./Random');\nvar Vector2 = require('../../math/Vector2');\n\n/**\n * @classdesc\n * Defines a Line segment, a part of a line between two endpoints.\n *\n * @class Line\n * @memberof Phaser.Geom\n * @constructor\n * @since 3.0.0\n *\n * @param {number} [x1=0] - The x coordinate of the lines starting point.\n * @param {number} [y1=0] - The y coordinate of the lines starting point.\n * @param {number} [x2=0] - The x coordinate of the lines ending point.\n * @param {number} [y2=0] - The y coordinate of the lines ending point.\n */\nvar Line = new Class({\n\n initialize:\n\n function Line (x1, y1, x2, y2)\n {\n if (x1 === undefined) { x1 = 0; }\n if (y1 === undefined) { y1 = 0; }\n if (x2 === undefined) { x2 = 0; }\n if (y2 === undefined) { y2 = 0; }\n\n /**\n * The geometry constant type of this object: `GEOM_CONST.LINE`.\n * Used for fast type comparisons.\n *\n * @name Phaser.Geom.Line#type\n * @type {number}\n * @readonly\n * @since 3.19.0\n */\n this.type = GEOM_CONST.LINE;\n\n /**\n * The x coordinate of the lines starting point.\n *\n * @name Phaser.Geom.Line#x1\n * @type {number}\n * @since 3.0.0\n */\n this.x1 = x1;\n\n /**\n * The y coordinate of the lines starting point.\n *\n * @name Phaser.Geom.Line#y1\n * @type {number}\n * @since 3.0.0\n */\n this.y1 = y1;\n\n /**\n * The x coordinate of the lines ending point.\n *\n * @name Phaser.Geom.Line#x2\n * @type {number}\n * @since 3.0.0\n */\n this.x2 = x2;\n\n /**\n * The y coordinate of the lines ending point.\n *\n * @name Phaser.Geom.Line#y2\n * @type {number}\n * @since 3.0.0\n */\n this.y2 = y2;\n },\n\n /**\n * Get a point on a line that's a given percentage along its length.\n *\n * @method Phaser.Geom.Line#getPoint\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [output,$return]\n *\n * @param {number} position - A value between 0 and 1, where 0 is the start, 0.5 is the middle and 1 is the end of the line.\n * @param {(Phaser.Geom.Point|object)} [output] - An optional point, or point-like object, to store the coordinates of the point on the line.\n *\n * @return {(Phaser.Geom.Point|object)} A Point, or point-like object, containing the coordinates of the point on the line.\n */\n getPoint: function (position, output)\n {\n return GetPoint(this, position, output);\n },\n\n /**\n * Get a number of points along a line's length.\n *\n * Provide a `quantity` to get an exact number of points along the line.\n *\n * Provide a `stepRate` to ensure a specific distance between each point on the line. Set `quantity` to `0` when\n * providing a `stepRate`.\n *\n * @method Phaser.Geom.Line#getPoints\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\n *\n * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead.\n * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`.\n * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line.\n *\n * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line.\n */\n getPoints: function (quantity, stepRate, output)\n {\n return GetPoints(this, quantity, stepRate, output);\n },\n\n /**\n * Get a random Point on the Line.\n *\n * @method Phaser.Geom.Line#getRandomPoint\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [point,$return]\n *\n * @param {(Phaser.Geom.Point|object)} [point] - An instance of a Point to be modified.\n *\n * @return {Phaser.Geom.Point} A random Point on the Line.\n */\n getRandomPoint: function (point)\n {\n return Random(this, point);\n },\n\n /**\n * Set new coordinates for the line endpoints.\n *\n * @method Phaser.Geom.Line#setTo\n * @since 3.0.0\n *\n * @param {number} [x1=0] - The x coordinate of the lines starting point.\n * @param {number} [y1=0] - The y coordinate of the lines starting point.\n * @param {number} [x2=0] - The x coordinate of the lines ending point.\n * @param {number} [y2=0] - The y coordinate of the lines ending point.\n *\n * @return {this} This Line object.\n */\n setTo: function (x1, y1, x2, y2)\n {\n if (x1 === undefined) { x1 = 0; }\n if (y1 === undefined) { y1 = 0; }\n if (x2 === undefined) { x2 = 0; }\n if (y2 === undefined) { y2 = 0; }\n\n this.x1 = x1;\n this.y1 = y1;\n\n this.x2 = x2;\n this.y2 = y2;\n\n return this;\n },\n\n /**\n * Returns a Vector2 object that corresponds to the start of this Line.\n *\n * @method Phaser.Geom.Line#getPointA\n * @since 3.0.0\n *\n * @generic {Phaser.Math.Vector2} O - [vec2,$return]\n *\n * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created.\n *\n * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the start of this Line.\n */\n getPointA: function (vec2)\n {\n if (vec2 === undefined) { vec2 = new Vector2(); }\n\n vec2.set(this.x1, this.y1);\n\n return vec2;\n },\n\n /**\n * Returns a Vector2 object that corresponds to the end of this Line.\n *\n * @method Phaser.Geom.Line#getPointB\n * @since 3.0.0\n *\n * @generic {Phaser.Math.Vector2} O - [vec2,$return]\n *\n * @param {Phaser.Math.Vector2} [vec2] - A Vector2 object to set the results in. If `undefined` a new Vector2 will be created.\n *\n * @return {Phaser.Math.Vector2} A Vector2 object that corresponds to the end of this Line.\n */\n getPointB: function (vec2)\n {\n if (vec2 === undefined) { vec2 = new Vector2(); }\n\n vec2.set(this.x2, this.y2);\n\n return vec2;\n },\n\n /**\n * The left position of the Line.\n *\n * @name Phaser.Geom.Line#left\n * @type {number}\n * @since 3.0.0\n */\n left: {\n\n get: function ()\n {\n return Math.min(this.x1, this.x2);\n },\n\n set: function (value)\n {\n if (this.x1 <= this.x2)\n {\n this.x1 = value;\n }\n else\n {\n this.x2 = value;\n }\n }\n\n },\n\n /**\n * The right position of the Line.\n *\n * @name Phaser.Geom.Line#right\n * @type {number}\n * @since 3.0.0\n */\n right: {\n\n get: function ()\n {\n return Math.max(this.x1, this.x2);\n },\n\n set: function (value)\n {\n if (this.x1 > this.x2)\n {\n this.x1 = value;\n }\n else\n {\n this.x2 = value;\n }\n }\n\n },\n\n /**\n * The top position of the Line.\n *\n * @name Phaser.Geom.Line#top\n * @type {number}\n * @since 3.0.0\n */\n top: {\n\n get: function ()\n {\n return Math.min(this.y1, this.y2);\n },\n\n set: function (value)\n {\n if (this.y1 <= this.y2)\n {\n this.y1 = value;\n }\n else\n {\n this.y2 = value;\n }\n }\n\n },\n\n /**\n * The bottom position of the Line.\n *\n * @name Phaser.Geom.Line#bottom\n * @type {number}\n * @since 3.0.0\n */\n bottom: {\n\n get: function ()\n {\n return Math.max(this.y1, this.y2);\n },\n\n set: function (value)\n {\n if (this.y1 > this.y2)\n {\n this.y1 = value;\n }\n else\n {\n this.y2 = value;\n }\n }\n\n }\n\n});\n\nmodule.exports = Line;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Point = require('../point/Point');\n\n/**\n * Returns a random point on a given Line.\n *\n * @function Phaser.Geom.Line.Random\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [out,$return]\n *\n * @param {Phaser.Geom.Line} line - The Line to calculate the random Point on.\n * @param {(Phaser.Geom.Point|object)} [out] - An instance of a Point to be modified.\n *\n * @return {(Phaser.Geom.Point|object)} A random Point on the Line.\n */\nvar Random = function (line, out)\n{\n if (out === undefined) { out = new Point(); }\n\n var t = Math.random();\n\n out.x = line.x1 + t * (line.x2 - line.x1);\n out.y = line.y1 + t * (line.y2 - line.y1);\n\n return out;\n};\n\nmodule.exports = Random;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar GEOM_CONST = require('../const');\n\n/**\n * @classdesc\n * Defines a Point in 2D space, with an x and y component.\n *\n * @class Point\n * @memberof Phaser.Geom\n * @constructor\n * @since 3.0.0\n *\n * @param {number} [x=0] - The x coordinate of this Point.\n * @param {number} [y=x] - The y coordinate of this Point.\n */\nvar Point = new Class({\n\n initialize:\n\n function Point (x, y)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = x; }\n\n /**\n * The geometry constant type of this object: `GEOM_CONST.POINT`.\n * Used for fast type comparisons.\n *\n * @name Phaser.Geom.Point#type\n * @type {number}\n * @readonly\n * @since 3.19.0\n */\n this.type = GEOM_CONST.POINT;\n\n /**\n * The x coordinate of this Point.\n *\n * @name Phaser.Geom.Point#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.x = x;\n\n /**\n * The y coordinate of this Point.\n *\n * @name Phaser.Geom.Point#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.y = y;\n },\n\n /**\n * Set the x and y coordinates of the point to the given values.\n *\n * @method Phaser.Geom.Point#setTo\n * @since 3.0.0\n *\n * @param {number} [x=0] - The x coordinate of this Point.\n * @param {number} [y=x] - The y coordinate of this Point.\n *\n * @return {this} This Point object.\n */\n setTo: function (x, y)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = x; }\n\n this.x = x;\n this.y = y;\n\n return this;\n }\n\n});\n\nmodule.exports = Point;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Checks if a given point is inside a Rectangle's bounds.\n *\n * @function Phaser.Geom.Rectangle.Contains\n * @since 3.0.0\n *\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to check.\n * @param {number} x - The X coordinate of the point to check.\n * @param {number} y - The Y coordinate of the point to check.\n *\n * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`.\n */\nvar Contains = function (rect, x, y)\n{\n if (rect.width <= 0 || rect.height <= 0)\n {\n return false;\n }\n\n return (rect.x <= x && rect.x + rect.width >= x && rect.y <= y && rect.y + rect.height >= y);\n};\n\nmodule.exports = Contains;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Perimeter = require('./Perimeter');\nvar Point = require('../point/Point');\n\n/**\n * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter.\n * \n * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is.\n * \n * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side.\n *\n * @function Phaser.Geom.Rectangle.GetPoint\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [out,$return]\n *\n * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from.\n * @param {number} position - The normalized distance into the Rectangle's perimeter to return.\n * @param {(Phaser.Geom.Point|object)} [out] - An object to update with the `x` and `y` coordinates of the point.\n *\n * @return {Phaser.Geom.Point} The updated `output` object, or a new Point if no `output` object was given.\n */\nvar GetPoint = function (rectangle, position, out)\n{\n if (out === undefined) { out = new Point(); }\n\n if (position <= 0 || position >= 1)\n {\n out.x = rectangle.x;\n out.y = rectangle.y;\n\n return out;\n }\n\n var p = Perimeter(rectangle) * position;\n\n if (position > 0.5)\n {\n p -= (rectangle.width + rectangle.height);\n\n if (p <= rectangle.width)\n {\n // Face 3\n out.x = rectangle.right - p;\n out.y = rectangle.bottom;\n }\n else\n {\n // Face 4\n out.x = rectangle.x;\n out.y = rectangle.bottom - (p - rectangle.width);\n }\n }\n else if (p <= rectangle.width)\n {\n // Face 1\n out.x = rectangle.x + p;\n out.y = rectangle.y;\n }\n else\n {\n // Face 2\n out.x = rectangle.right;\n out.y = rectangle.y + (p - rectangle.width);\n }\n\n return out;\n};\n\nmodule.exports = GetPoint;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar GetPoint = require('./GetPoint');\nvar Perimeter = require('./Perimeter');\n\n// Return an array of points from the perimeter of the rectangle\n// each spaced out based on the quantity or step required\n\n/**\n * Return an array of points from the perimeter of the rectangle, each spaced out based on the quantity or step required.\n *\n * @function Phaser.Geom.Rectangle.GetPoints\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point[]} O - [out,$return]\n *\n * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from.\n * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive.\n * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points.\n * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in.\n *\n * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle.\n */\nvar GetPoints = function (rectangle, quantity, stepRate, out)\n{\n if (out === undefined) { out = []; }\n\n // If quantity is a falsey value (false, null, 0, undefined, etc) then we calculate it based on the stepRate instead.\n if (!quantity && stepRate > 0)\n {\n quantity = Perimeter(rectangle) / stepRate;\n }\n\n for (var i = 0; i < quantity; i++)\n {\n var position = i / quantity;\n\n out.push(GetPoint(rectangle, position));\n }\n\n return out;\n};\n\nmodule.exports = GetPoints;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculates the perimeter of a Rectangle.\n *\n * @function Phaser.Geom.Rectangle.Perimeter\n * @since 3.0.0\n *\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to use.\n *\n * @return {number} The perimeter of the Rectangle, equal to `(width * 2) + (height * 2)`.\n */\nvar Perimeter = function (rect)\n{\n return 2 * (rect.width + rect.height);\n};\n\nmodule.exports = Perimeter;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Point = require('../point/Point');\n\n/**\n * Returns a random point within a Rectangle.\n *\n * @function Phaser.Geom.Rectangle.Random\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [out,$return]\n *\n * @param {Phaser.Geom.Rectangle} rect - The Rectangle to return a point from.\n * @param {Phaser.Geom.Point} out - The object to update with the point's coordinates.\n *\n * @return {Phaser.Geom.Point} The modified `out` object, or a new Point if none was provided.\n */\nvar Random = function (rect, out)\n{\n if (out === undefined) { out = new Point(); }\n\n out.x = rect.x + (Math.random() * rect.width);\n out.y = rect.y + (Math.random() * rect.height);\n\n return out;\n};\n\nmodule.exports = Random;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar Contains = require('./Contains');\nvar GetPoint = require('./GetPoint');\nvar GetPoints = require('./GetPoints');\nvar GEOM_CONST = require('../const');\nvar Line = require('../line/Line');\nvar Random = require('./Random');\n\n/**\n * @classdesc\n * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height)\n *\n * @class Rectangle\n * @memberof Phaser.Geom\n * @constructor\n * @since 3.0.0\n *\n * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle.\n * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle.\n * @param {number} [width=0] - The width of the Rectangle.\n * @param {number} [height=0] - The height of the Rectangle.\n */\nvar Rectangle = new Class({\n\n initialize:\n\n function Rectangle (x, y, width, height)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = 0; }\n if (width === undefined) { width = 0; }\n if (height === undefined) { height = 0; }\n\n /**\n * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`.\n * Used for fast type comparisons.\n *\n * @name Phaser.Geom.Rectangle#type\n * @type {number}\n * @readonly\n * @since 3.19.0\n */\n this.type = GEOM_CONST.RECTANGLE;\n\n /**\n * The X coordinate of the top left corner of the Rectangle.\n *\n * @name Phaser.Geom.Rectangle#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.x = x;\n\n /**\n * The Y coordinate of the top left corner of the Rectangle.\n *\n * @name Phaser.Geom.Rectangle#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.y = y;\n\n /**\n * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side.\n *\n * @name Phaser.Geom.Rectangle#width\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.width = width;\n\n /**\n * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side.\n *\n * @name Phaser.Geom.Rectangle#height\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.height = height;\n },\n\n /**\n * Checks if the given point is inside the Rectangle's bounds.\n *\n * @method Phaser.Geom.Rectangle#contains\n * @since 3.0.0\n *\n * @param {number} x - The X coordinate of the point to check.\n * @param {number} y - The Y coordinate of the point to check.\n *\n * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`.\n */\n contains: function (x, y)\n {\n return Contains(this, x, y);\n },\n\n /**\n * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter.\n * \n * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is.\n * \n * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side.\n *\n * @method Phaser.Geom.Rectangle#getPoint\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [output,$return]\n *\n * @param {number} position - The normalized distance into the Rectangle's perimeter to return.\n * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point.\n *\n * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given.\n */\n getPoint: function (position, output)\n {\n return GetPoint(this, position, output);\n },\n\n /**\n * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required.\n *\n * @method Phaser.Geom.Rectangle#getPoints\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point[]} O - [output,$return]\n *\n * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`.\n * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point.\n * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points.\n *\n * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided.\n */\n getPoints: function (quantity, stepRate, output)\n {\n return GetPoints(this, quantity, stepRate, output);\n },\n\n /**\n * Returns a random point within the Rectangle's bounds.\n *\n * @method Phaser.Geom.Rectangle#getRandomPoint\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Point} O - [point,$return]\n *\n * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point.\n *\n * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided.\n */\n getRandomPoint: function (point)\n {\n return Random(this, point);\n },\n\n /**\n * Sets the position, width, and height of the Rectangle.\n *\n * @method Phaser.Geom.Rectangle#setTo\n * @since 3.0.0\n *\n * @param {number} x - The X coordinate of the top left corner of the Rectangle.\n * @param {number} y - The Y coordinate of the top left corner of the Rectangle.\n * @param {number} width - The width of the Rectangle.\n * @param {number} height - The height of the Rectangle.\n *\n * @return {this} This Rectangle object.\n */\n setTo: function (x, y, width, height)\n {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n\n return this;\n },\n\n /**\n * Resets the position, width, and height of the Rectangle to 0.\n *\n * @method Phaser.Geom.Rectangle#setEmpty\n * @since 3.0.0\n *\n * @return {this} This Rectangle object.\n */\n setEmpty: function ()\n {\n return this.setTo(0, 0, 0, 0);\n },\n\n /**\n * Sets the position of the Rectangle.\n *\n * @method Phaser.Geom.Rectangle#setPosition\n * @since 3.0.0\n *\n * @param {number} x - The X coordinate of the top left corner of the Rectangle.\n * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle.\n *\n * @return {this} This Rectangle object.\n */\n setPosition: function (x, y)\n {\n if (y === undefined) { y = x; }\n\n this.x = x;\n this.y = y;\n\n return this;\n },\n\n /**\n * Sets the width and height of the Rectangle.\n *\n * @method Phaser.Geom.Rectangle#setSize\n * @since 3.0.0\n *\n * @param {number} width - The width to set the Rectangle to.\n * @param {number} [height=width] - The height to set the Rectangle to.\n *\n * @return {this} This Rectangle object.\n */\n setSize: function (width, height)\n {\n if (height === undefined) { height = width; }\n\n this.width = width;\n this.height = height;\n\n return this;\n },\n\n /**\n * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0.\n *\n * @method Phaser.Geom.Rectangle#isEmpty\n * @since 3.0.0\n *\n * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0.\n */\n isEmpty: function ()\n {\n return (this.width <= 0 || this.height <= 0);\n },\n\n /**\n * Returns a Line object that corresponds to the top of this Rectangle.\n *\n * @method Phaser.Geom.Rectangle#getLineA\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Line} O - [line,$return]\n *\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\n *\n * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle.\n */\n getLineA: function (line)\n {\n if (line === undefined) { line = new Line(); }\n\n line.setTo(this.x, this.y, this.right, this.y);\n\n return line;\n },\n\n /**\n * Returns a Line object that corresponds to the right of this Rectangle.\n *\n * @method Phaser.Geom.Rectangle#getLineB\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Line} O - [line,$return]\n *\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\n *\n * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle.\n */\n getLineB: function (line)\n {\n if (line === undefined) { line = new Line(); }\n\n line.setTo(this.right, this.y, this.right, this.bottom);\n\n return line;\n },\n\n /**\n * Returns a Line object that corresponds to the bottom of this Rectangle.\n *\n * @method Phaser.Geom.Rectangle#getLineC\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Line} O - [line,$return]\n *\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\n *\n * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle.\n */\n getLineC: function (line)\n {\n if (line === undefined) { line = new Line(); }\n\n line.setTo(this.right, this.bottom, this.x, this.bottom);\n\n return line;\n },\n\n /**\n * Returns a Line object that corresponds to the left of this Rectangle.\n *\n * @method Phaser.Geom.Rectangle#getLineD\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Line} O - [line,$return]\n *\n * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created.\n *\n * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle.\n */\n getLineD: function (line)\n {\n if (line === undefined) { line = new Line(); }\n\n line.setTo(this.x, this.bottom, this.x, this.y);\n\n return line;\n },\n\n /**\n * The x coordinate of the left of the Rectangle.\n * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property.\n *\n * @name Phaser.Geom.Rectangle#left\n * @type {number}\n * @since 3.0.0\n */\n left: {\n\n get: function ()\n {\n return this.x;\n },\n\n set: function (value)\n {\n if (value >= this.right)\n {\n this.width = 0;\n }\n else\n {\n this.width = this.right - value;\n }\n\n this.x = value;\n }\n\n },\n\n /**\n * The sum of the x and width properties.\n * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property.\n *\n * @name Phaser.Geom.Rectangle#right\n * @type {number}\n * @since 3.0.0\n */\n right: {\n\n get: function ()\n {\n return this.x + this.width;\n },\n\n set: function (value)\n {\n if (value <= this.x)\n {\n this.width = 0;\n }\n else\n {\n this.width = value - this.x;\n }\n }\n\n },\n\n /**\n * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties.\n * However it does affect the height property, whereas changing the y value does not affect the height property.\n *\n * @name Phaser.Geom.Rectangle#top\n * @type {number}\n * @since 3.0.0\n */\n top: {\n\n get: function ()\n {\n return this.y;\n },\n\n set: function (value)\n {\n if (value >= this.bottom)\n {\n this.height = 0;\n }\n else\n {\n this.height = (this.bottom - value);\n }\n\n this.y = value;\n }\n\n },\n\n /**\n * The sum of the y and height properties.\n * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property.\n *\n * @name Phaser.Geom.Rectangle#bottom\n * @type {number}\n * @since 3.0.0\n */\n bottom: {\n\n get: function ()\n {\n return this.y + this.height;\n },\n\n set: function (value)\n {\n if (value <= this.y)\n {\n this.height = 0;\n }\n else\n {\n this.height = value - this.y;\n }\n }\n\n },\n\n /**\n * The x coordinate of the center of the Rectangle.\n *\n * @name Phaser.Geom.Rectangle#centerX\n * @type {number}\n * @since 3.0.0\n */\n centerX: {\n\n get: function ()\n {\n return this.x + (this.width / 2);\n },\n\n set: function (value)\n {\n this.x = value - (this.width / 2);\n }\n\n },\n\n /**\n * The y coordinate of the center of the Rectangle.\n *\n * @name Phaser.Geom.Rectangle#centerY\n * @type {number}\n * @since 3.0.0\n */\n centerY: {\n\n get: function ()\n {\n return this.y + (this.height / 2);\n },\n\n set: function (value)\n {\n this.y = value - (this.height / 2);\n }\n\n }\n\n});\n\nmodule.exports = Rectangle;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Rectangle = require('./Rectangle');\n\n/**\n * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union.\n *\n * @function Phaser.Geom.Rectangle.Union\n * @since 3.0.0\n *\n * @generic {Phaser.Geom.Rectangle} O - [out,$return]\n *\n * @param {Phaser.Geom.Rectangle} rectA - The first Rectangle to use.\n * @param {Phaser.Geom.Rectangle} rectB - The second Rectangle to use.\n * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the union in.\n *\n * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided.\n */\nvar Union = function (rectA, rectB, out)\n{\n if (out === undefined) { out = new Rectangle(); }\n\n // Cache vars so we can use one of the input rects as the output rect\n var x = Math.min(rectA.x, rectB.x);\n var y = Math.min(rectA.y, rectB.y);\n var w = Math.max(rectA.right, rectB.right) - x;\n var h = Math.max(rectA.bottom, rectB.bottom) - y;\n\n return out.setTo(x, y, w, h);\n};\n\nmodule.exports = Union;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../utils/Class');\nvar CONST = require('./const');\nvar Events = require('./events');\nvar GetFastValue = require('../utils/object/GetFastValue');\nvar GetURL = require('./GetURL');\nvar MergeXHRSettings = require('./MergeXHRSettings');\nvar XHRLoader = require('./XHRLoader');\nvar XHRSettings = require('./XHRSettings');\n\n/**\n * @classdesc\n * The base File class used by all File Types that the Loader can support.\n * You shouldn't create an instance of a File directly, but should extend it with your own class, setting a custom type and processing methods.\n *\n * @class File\n * @memberof Phaser.Loader\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\n * @param {Phaser.Types.Loader.FileConfig} fileConfig - The file configuration object, as created by the file type.\n */\nvar File = new Class({\n\n initialize:\n\n function File (loader, fileConfig)\n {\n /**\n * A reference to the Loader that is going to load this file.\n *\n * @name Phaser.Loader.File#loader\n * @type {Phaser.Loader.LoaderPlugin}\n * @since 3.0.0\n */\n this.loader = loader;\n\n /**\n * A reference to the Cache, or Texture Manager, that is going to store this file if it loads.\n *\n * @name Phaser.Loader.File#cache\n * @type {(Phaser.Cache.BaseCache|Phaser.Textures.TextureManager)}\n * @since 3.7.0\n */\n this.cache = GetFastValue(fileConfig, 'cache', false);\n\n /**\n * The file type string (image, json, etc) for sorting within the Loader.\n *\n * @name Phaser.Loader.File#type\n * @type {string}\n * @since 3.0.0\n */\n this.type = GetFastValue(fileConfig, 'type', false);\n\n /**\n * Unique cache key (unique within its file type)\n *\n * @name Phaser.Loader.File#key\n * @type {string}\n * @since 3.0.0\n */\n this.key = GetFastValue(fileConfig, 'key', false);\n\n var loadKey = this.key;\n\n if (loader.prefix && loader.prefix !== '')\n {\n this.key = loader.prefix + loadKey;\n }\n\n if (!this.type || !this.key)\n {\n throw new Error('Invalid Loader.' + this.type + ' key');\n }\n\n var url = GetFastValue(fileConfig, 'url');\n\n if (url === undefined)\n {\n url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', '');\n }\n else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\n {\n url = loader.path + url;\n }\n\n /**\n * The URL of the file, not including baseURL.\n *\n * Automatically has Loader.path prepended to it if a string.\n *\n * Can also be a JavaScript Object, such as the results of parsing JSON data.\n *\n * @name Phaser.Loader.File#url\n * @type {object|string}\n * @since 3.0.0\n */\n this.url = url;\n\n /**\n * The final URL this file will load from, including baseURL and path.\n * Set automatically when the Loader calls 'load' on this file.\n *\n * @name Phaser.Loader.File#src\n * @type {string}\n * @since 3.0.0\n */\n this.src = '';\n\n /**\n * The merged XHRSettings for this file.\n *\n * @name Phaser.Loader.File#xhrSettings\n * @type {Phaser.Types.Loader.XHRSettingsObject}\n * @since 3.0.0\n */\n this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));\n\n if (GetFastValue(fileConfig, 'xhrSettings', false))\n {\n this.xhrSettings = MergeXHRSettings(this.xhrSettings, GetFastValue(fileConfig, 'xhrSettings', {}));\n }\n\n /**\n * The XMLHttpRequest instance (as created by XHR Loader) that is loading this File.\n *\n * @name Phaser.Loader.File#xhrLoader\n * @type {?XMLHttpRequest}\n * @since 3.0.0\n */\n this.xhrLoader = null;\n\n /**\n * The current state of the file. One of the FILE_CONST values.\n *\n * @name Phaser.Loader.File#state\n * @type {number}\n * @since 3.0.0\n */\n this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING;\n\n /**\n * The total size of this file.\n * Set by onProgress and only if loading via XHR.\n *\n * @name Phaser.Loader.File#bytesTotal\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.bytesTotal = 0;\n\n /**\n * Updated as the file loads.\n * Only set if loading via XHR.\n *\n * @name Phaser.Loader.File#bytesLoaded\n * @type {number}\n * @default -1\n * @since 3.0.0\n */\n this.bytesLoaded = -1;\n\n /**\n * A percentage value between 0 and 1 indicating how much of this file has loaded.\n * Only set if loading via XHR.\n *\n * @name Phaser.Loader.File#percentComplete\n * @type {number}\n * @default -1\n * @since 3.0.0\n */\n this.percentComplete = -1;\n\n /**\n * For CORs based loading.\n * If this is undefined then the File will check BaseLoader.crossOrigin and use that (if set)\n *\n * @name Phaser.Loader.File#crossOrigin\n * @type {(string|undefined)}\n * @since 3.0.0\n */\n this.crossOrigin = undefined;\n\n /**\n * The processed file data, stored here after the file has loaded.\n *\n * @name Phaser.Loader.File#data\n * @type {*}\n * @since 3.0.0\n */\n this.data = undefined;\n\n /**\n * A config object that can be used by file types to store transitional data.\n *\n * @name Phaser.Loader.File#config\n * @type {*}\n * @since 3.0.0\n */\n this.config = GetFastValue(fileConfig, 'config', {});\n\n /**\n * If this is a multipart file, i.e. an atlas and its json together, then this is a reference\n * to the parent MultiFile. Set and used internally by the Loader or specific file types.\n *\n * @name Phaser.Loader.File#multiFile\n * @type {?Phaser.Loader.MultiFile}\n * @since 3.7.0\n */\n this.multiFile;\n\n /**\n * Does this file have an associated linked file? Such as an image and a normal map.\n * Atlases and Bitmap Fonts use the multiFile, because those files need loading together but aren't\n * actually bound by data, where-as a linkFile is.\n *\n * @name Phaser.Loader.File#linkFile\n * @type {?Phaser.Loader.File}\n * @since 3.7.0\n */\n this.linkFile;\n },\n\n /**\n * Links this File with another, so they depend upon each other for loading and processing.\n *\n * @method Phaser.Loader.File#setLink\n * @since 3.7.0\n *\n * @param {Phaser.Loader.File} fileB - The file to link to this one.\n */\n setLink: function (fileB)\n {\n this.linkFile = fileB;\n\n fileB.linkFile = this;\n },\n\n /**\n * Resets the XHRLoader instance this file is using.\n *\n * @method Phaser.Loader.File#resetXHR\n * @since 3.0.0\n */\n resetXHR: function ()\n {\n if (this.xhrLoader)\n {\n this.xhrLoader.onload = undefined;\n this.xhrLoader.onerror = undefined;\n this.xhrLoader.onprogress = undefined;\n }\n },\n\n /**\n * Called by the Loader, starts the actual file downloading.\n * During the load the methods onLoad, onError and onProgress are called, based on the XHR events.\n * You shouldn't normally call this method directly, it's meant to be invoked by the Loader.\n *\n * @method Phaser.Loader.File#load\n * @since 3.0.0\n */\n load: function ()\n {\n if (this.state === CONST.FILE_POPULATED)\n {\n // Can happen for example in a JSONFile if they've provided a JSON object instead of a URL\n this.loader.nextFile(this, true);\n }\n else\n {\n this.state = CONST.FILE_LOADING;\n\n this.src = GetURL(this, this.loader.baseURL);\n\n if (this.src.indexOf('data:') === 0)\n {\n console.warn('Local data URIs are not supported: ' + this.key);\n }\n else\n {\n // The creation of this XHRLoader starts the load process going.\n // It will automatically call the following, based on the load outcome:\n //\n // xhr.onload = this.onLoad\n // xhr.onerror = this.onError\n // xhr.onprogress = this.onProgress\n\n this.xhrLoader = XHRLoader(this, this.loader.xhr);\n }\n }\n },\n\n /**\n * Called when the file finishes loading, is sent a DOM ProgressEvent.\n *\n * @method Phaser.Loader.File#onLoad\n * @since 3.0.0\n *\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this load.\n */\n onLoad: function (xhr, event)\n {\n var localFileOk = ((xhr.responseURL && xhr.responseURL.indexOf('file://') === 0 && event.target.status === 0));\n\n var success = !(event.target && event.target.status !== 200) || localFileOk;\n\n // Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.\n if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)\n {\n success = false;\n }\n\n this.state = CONST.FILE_LOADED;\n\n this.resetXHR();\n\n this.loader.nextFile(this, success);\n },\n\n /**\n * Called if the file errors while loading, is sent a DOM ProgressEvent.\n *\n * @method Phaser.Loader.File#onError\n * @since 3.0.0\n *\n * @param {XMLHttpRequest} xhr - The XMLHttpRequest that caused this onload event.\n * @param {ProgressEvent} event - The DOM ProgressEvent that resulted from this error.\n */\n onError: function ()\n {\n this.resetXHR();\n\n this.loader.nextFile(this, false);\n },\n\n /**\n * Called during the file load progress. Is sent a DOM ProgressEvent.\n *\n * @method Phaser.Loader.File#onProgress\n * @fires Phaser.Loader.Events#FILE_PROGRESS\n * @since 3.0.0\n *\n * @param {ProgressEvent} event - The DOM ProgressEvent.\n */\n onProgress: function (event)\n {\n if (event.lengthComputable)\n {\n this.bytesLoaded = event.loaded;\n this.bytesTotal = event.total;\n\n this.percentComplete = Math.min((this.bytesLoaded / this.bytesTotal), 1);\n\n this.loader.emit(Events.FILE_PROGRESS, this, this.percentComplete);\n }\n },\n\n /**\n * Usually overridden by the FileTypes and is called by Loader.nextFile.\n * This method controls what extra work this File does with its loaded data, for example a JSON file will parse itself during this stage.\n *\n * @method Phaser.Loader.File#onProcess\n * @since 3.0.0\n */\n onProcess: function ()\n {\n this.state = CONST.FILE_PROCESSING;\n\n this.onProcessComplete();\n },\n\n /**\n * Called when the File has completed processing.\n * Checks on the state of its multifile, if set.\n *\n * @method Phaser.Loader.File#onProcessComplete\n * @since 3.7.0\n */\n onProcessComplete: function ()\n {\n this.state = CONST.FILE_COMPLETE;\n\n if (this.multiFile)\n {\n this.multiFile.onFileComplete(this);\n }\n\n this.loader.fileProcessComplete(this);\n },\n\n /**\n * Called when the File has completed processing but it generated an error.\n * Checks on the state of its multifile, if set.\n *\n * @method Phaser.Loader.File#onProcessError\n * @since 3.7.0\n */\n onProcessError: function ()\n {\n this.state = CONST.FILE_ERRORED;\n\n if (this.multiFile)\n {\n this.multiFile.onFileFailed(this);\n }\n\n this.loader.fileProcessComplete(this);\n },\n\n /**\n * Checks if a key matching the one used by this file exists in the target Cache or not.\n * This is called automatically by the LoaderPlugin to decide if the file can be safely\n * loaded or will conflict.\n *\n * @method Phaser.Loader.File#hasCacheConflict\n * @since 3.7.0\n *\n * @return {boolean} `true` if adding this file will cause a conflict, otherwise `false`.\n */\n hasCacheConflict: function ()\n {\n return (this.cache && this.cache.exists(this.key));\n },\n\n /**\n * Adds this file to its target cache upon successful loading and processing.\n * This method is often overridden by specific file types.\n *\n * @method Phaser.Loader.File#addToCache\n * @since 3.7.0\n */\n addToCache: function ()\n {\n if (this.cache)\n {\n this.cache.add(this.key, this.data);\n }\n\n this.pendingDestroy();\n },\n\n /**\n * Called once the file has been added to its cache and is now ready for deletion from the Loader.\n * It will emit a `filecomplete` event from the LoaderPlugin.\n *\n * @method Phaser.Loader.File#pendingDestroy\n * @fires Phaser.Loader.Events#FILE_COMPLETE\n * @fires Phaser.Loader.Events#FILE_KEY_COMPLETE\n * @since 3.7.0\n */\n pendingDestroy: function (data)\n {\n if (data === undefined) { data = this.data; }\n\n var key = this.key;\n var type = this.type;\n\n this.loader.emit(Events.FILE_COMPLETE, key, type, data);\n this.loader.emit(Events.FILE_KEY_COMPLETE + type + '-' + key, key, type, data);\n\n this.loader.flagForRemoval(this);\n },\n\n /**\n * Destroy this File and any references it holds.\n *\n * @method Phaser.Loader.File#destroy\n * @since 3.7.0\n */\n destroy: function ()\n {\n this.loader = null;\n this.cache = null;\n this.xhrSettings = null;\n this.multiFile = null;\n this.linkFile = null;\n this.data = null;\n }\n\n});\n\n/**\n * Static method for creating object URL using URL API and setting it as image 'src' attribute.\n * If URL API is not supported (usually on old browsers) it falls back to creating Base64 encoded url using FileReader.\n *\n * @method Phaser.Loader.File.createObjectURL\n * @static\n * @since 3.7.0\n *\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.\n * @param {Blob} blob - A Blob object to create an object URL for.\n * @param {string} defaultType - Default mime type used if blob type is not available.\n */\nFile.createObjectURL = function (image, blob, defaultType)\n{\n if (typeof URL === 'function')\n {\n image.src = URL.createObjectURL(blob);\n }\n else\n {\n var reader = new FileReader();\n\n reader.onload = function ()\n {\n image.removeAttribute('crossOrigin');\n image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];\n };\n\n reader.onerror = image.onerror;\n\n reader.readAsDataURL(blob);\n }\n};\n\n/**\n * Static method for releasing an existing object URL which was previously created\n * by calling {@link File#createObjectURL} method.\n *\n * @method Phaser.Loader.File.revokeObjectURL\n * @static\n * @since 3.7.0\n *\n * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.\n */\nFile.revokeObjectURL = function (image)\n{\n if (typeof URL === 'function')\n {\n URL.revokeObjectURL(image.src);\n }\n};\n\nmodule.exports = File;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar types = {};\n\n/**\n * @namespace Phaser.Loader.FileTypesManager\n */\n\nvar FileTypesManager = {\n\n /**\n * Static method called when a LoaderPlugin is created.\n * \n * Loops through the local types object and injects all of them as\n * properties into the LoaderPlugin instance.\n *\n * @method Phaser.Loader.FileTypesManager.install\n * @since 3.0.0\n * \n * @param {Phaser.Loader.LoaderPlugin} loader - The LoaderPlugin to install the types into.\n */\n install: function (loader)\n {\n for (var key in types)\n {\n loader[key] = types[key];\n }\n },\n\n /**\n * Static method called directly by the File Types.\n * \n * The key is a reference to the function used to load the files via the Loader, i.e. `image`.\n *\n * @method Phaser.Loader.FileTypesManager.register\n * @since 3.0.0\n * \n * @param {string} key - The key that will be used as the method name in the LoaderPlugin.\n * @param {function} factoryFunction - The function that will be called when LoaderPlugin.key is invoked.\n */\n register: function (key, factoryFunction)\n {\n types[key] = factoryFunction;\n },\n\n /**\n * Removed all associated file types.\n *\n * @method Phaser.Loader.FileTypesManager.destroy\n * @since 3.0.0\n */\n destroy: function ()\n {\n types = {};\n }\n\n};\n\nmodule.exports = FileTypesManager;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Given a File and a baseURL value this returns the URL the File will use to download from.\n *\n * @function Phaser.Loader.GetURL\n * @since 3.0.0\n *\n * @param {Phaser.Loader.File} file - The File object.\n * @param {string} baseURL - A default base URL.\n *\n * @return {string} The URL the File will use.\n */\nvar GetURL = function (file, baseURL)\n{\n if (!file.url)\n {\n return false;\n }\n\n if (file.url.match(/^(?:blob:|data:|http:\\/\\/|https:\\/\\/|\\/\\/)/))\n {\n return file.url;\n }\n else\n {\n return baseURL + file.url;\n }\n};\n\nmodule.exports = GetURL;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Extend = require('../utils/object/Extend');\nvar XHRSettings = require('./XHRSettings');\n\n/**\n * Takes two XHRSettings Objects and creates a new XHRSettings object from them.\n *\n * The new object is seeded by the values given in the global settings, but any setting in\n * the local object overrides the global ones.\n *\n * @function Phaser.Loader.MergeXHRSettings\n * @since 3.0.0\n *\n * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object.\n * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object.\n *\n * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object.\n */\nvar MergeXHRSettings = function (global, local)\n{\n var output = (global === undefined) ? XHRSettings() : Extend({}, global);\n\n if (local)\n {\n for (var setting in local)\n {\n if (local[setting] !== undefined)\n {\n output[setting] = local[setting];\n }\n }\n }\n\n return output;\n};\n\nmodule.exports = MergeXHRSettings;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../utils/Class');\n\n/**\n * @classdesc\n * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after\n * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont.\n *\n * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods.\n *\n * @class MultiFile\n * @memberof Phaser.Loader\n * @constructor\n * @since 3.7.0\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - The Loader that is going to load this File.\n * @param {string} type - The file type string for sorting within the Loader.\n * @param {string} key - The key of the file within the loader.\n * @param {Phaser.Loader.File[]} files - An array of Files that make-up this MultiFile.\n */\nvar MultiFile = new Class({\n\n initialize:\n\n function MultiFile (loader, type, key, files)\n {\n var finalFiles = [];\n\n // Clean out any potential 'null' or 'undefined' file entries\n files.forEach(function (file)\n {\n if (file)\n {\n finalFiles.push(file);\n }\n });\n\n /**\n * A reference to the Loader that is going to load this file.\n *\n * @name Phaser.Loader.MultiFile#loader\n * @type {Phaser.Loader.LoaderPlugin}\n * @since 3.7.0\n */\n this.loader = loader;\n\n /**\n * The file type string for sorting within the Loader.\n *\n * @name Phaser.Loader.MultiFile#type\n * @type {string}\n * @since 3.7.0\n */\n this.type = type;\n\n /**\n * Unique cache key (unique within its file type)\n *\n * @name Phaser.Loader.MultiFile#key\n * @type {string}\n * @since 3.7.0\n */\n this.key = key;\n\n /**\n * The current index being used by multi-file loaders to avoid key clashes.\n *\n * @name Phaser.Loader.MultiFile#multiKeyIndex\n * @type {number}\n * @private\n * @since 3.20.0\n */\n this.multiKeyIndex = loader.multiKeyIndex++;\n\n /**\n * Array of files that make up this MultiFile.\n *\n * @name Phaser.Loader.MultiFile#files\n * @type {Phaser.Loader.File[]}\n * @since 3.7.0\n */\n this.files = finalFiles;\n\n /**\n * The completion status of this MultiFile.\n *\n * @name Phaser.Loader.MultiFile#complete\n * @type {boolean}\n * @default false\n * @since 3.7.0\n */\n this.complete = false;\n\n /**\n * The number of files to load.\n *\n * @name Phaser.Loader.MultiFile#pending\n * @type {number}\n * @since 3.7.0\n */\n\n this.pending = finalFiles.length;\n\n /**\n * The number of files that failed to load.\n *\n * @name Phaser.Loader.MultiFile#failed\n * @type {number}\n * @default 0\n * @since 3.7.0\n */\n this.failed = 0;\n\n /**\n * A storage container for transient data that the loading files need.\n *\n * @name Phaser.Loader.MultiFile#config\n * @type {any}\n * @since 3.7.0\n */\n this.config = {};\n\n /**\n * A reference to the Loaders baseURL at the time this MultiFile was created.\n * Used to populate child-files.\n *\n * @name Phaser.Loader.MultiFile#baseURL\n * @type {string}\n * @since 3.20.0\n */\n this.baseURL = loader.baseURL;\n\n /**\n * A reference to the Loaders path at the time this MultiFile was created.\n * Used to populate child-files.\n *\n * @name Phaser.Loader.MultiFile#path\n * @type {string}\n * @since 3.20.0\n */\n this.path = loader.path;\n\n /**\n * A reference to the Loaders prefix at the time this MultiFile was created.\n * Used to populate child-files.\n *\n * @name Phaser.Loader.MultiFile#prefix\n * @type {string}\n * @since 3.20.0\n */\n this.prefix = loader.prefix;\n\n // Link the files\n for (var i = 0; i < finalFiles.length; i++)\n {\n finalFiles[i].multiFile = this;\n }\n },\n\n /**\n * Checks if this MultiFile is ready to process its children or not.\n *\n * @method Phaser.Loader.MultiFile#isReadyToProcess\n * @since 3.7.0\n *\n * @return {boolean} `true` if all children of this MultiFile have loaded, otherwise `false`.\n */\n isReadyToProcess: function ()\n {\n return (this.pending === 0 && this.failed === 0 && !this.complete);\n },\n\n /**\n * Adds another child to this MultiFile, increases the pending count and resets the completion status.\n *\n * @method Phaser.Loader.MultiFile#addToMultiFile\n * @since 3.7.0\n *\n * @param {Phaser.Loader.File} files - The File to add to this MultiFile.\n *\n * @return {Phaser.Loader.MultiFile} This MultiFile instance.\n */\n addToMultiFile: function (file)\n {\n this.files.push(file);\n\n file.multiFile = this;\n\n this.pending++;\n\n this.complete = false;\n\n return this;\n },\n\n /**\n * Called by each File when it finishes loading.\n *\n * @method Phaser.Loader.MultiFile#onFileComplete\n * @since 3.7.0\n *\n * @param {Phaser.Loader.File} file - The File that has completed processing.\n */\n onFileComplete: function (file)\n {\n var index = this.files.indexOf(file);\n\n if (index !== -1)\n {\n this.pending--;\n }\n },\n\n /**\n * Called by each File that fails to load.\n *\n * @method Phaser.Loader.MultiFile#onFileFailed\n * @since 3.7.0\n *\n * @param {Phaser.Loader.File} file - The File that has failed to load.\n */\n onFileFailed: function (file)\n {\n var index = this.files.indexOf(file);\n\n if (index !== -1)\n {\n this.failed++;\n }\n }\n\n});\n\nmodule.exports = MultiFile;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar MergeXHRSettings = require('./MergeXHRSettings');\n\n/**\n * Creates a new XMLHttpRequest (xhr) object based on the given File and XHRSettings\n * and starts the download of it. It uses the Files own XHRSettings and merges them\n * with the global XHRSettings object to set the xhr values before download.\n *\n * @function Phaser.Loader.XHRLoader\n * @since 3.0.0\n *\n * @param {Phaser.Loader.File} file - The File to download.\n * @param {Phaser.Types.Loader.XHRSettingsObject} globalXHRSettings - The global XHRSettings object.\n *\n * @return {XMLHttpRequest} The XHR object.\n */\nvar XHRLoader = function (file, globalXHRSettings)\n{\n var config = MergeXHRSettings(globalXHRSettings, file.xhrSettings);\n\n var xhr = new XMLHttpRequest();\n\n xhr.open('GET', file.src, config.async, config.user, config.password);\n\n xhr.responseType = file.xhrSettings.responseType;\n xhr.timeout = config.timeout;\n\n if (config.headers)\n {\n for (var key in config.headers)\n {\n xhr.setRequestHeader(key, config.headers[key]);\n }\n }\n\n if (config.header && config.headerValue)\n {\n xhr.setRequestHeader(config.header, config.headerValue);\n }\n\n if (config.requestedWith)\n {\n xhr.setRequestHeader('X-Requested-With', config.requestedWith);\n }\n\n if (config.overrideMimeType)\n {\n xhr.overrideMimeType(config.overrideMimeType);\n }\n\n if (config.withCredentials)\n {\n xhr.withCredentials = true;\n }\n\n // After a successful request, the xhr.response property will contain the requested data as a DOMString, ArrayBuffer, Blob, or Document (depending on what was set for responseType.)\n\n xhr.onload = file.onLoad.bind(file, xhr);\n xhr.onerror = file.onError.bind(file, xhr);\n xhr.onprogress = file.onProgress.bind(file);\n\n // This is the only standard method, the ones above are browser additions (maybe not universal?)\n // xhr.onreadystatechange\n\n xhr.send();\n\n return xhr;\n};\n\nmodule.exports = XHRLoader;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Creates an XHRSettings Object with default values.\n *\n * @function Phaser.Loader.XHRSettings\n * @since 3.0.0\n *\n * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'.\n * @param {boolean} [async=true] - Should the XHR request use async or not?\n * @param {string} [user=''] - Optional username for the XHR request.\n * @param {string} [password=''] - Optional password for the XHR request.\n * @param {number} [timeout=0] - Optional XHR timeout value.\n * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value.\n *\n * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader.\n */\nvar XHRSettings = function (responseType, async, user, password, timeout, withCredentials)\n{\n if (responseType === undefined) { responseType = ''; }\n if (async === undefined) { async = true; }\n if (user === undefined) { user = ''; }\n if (password === undefined) { password = ''; }\n if (timeout === undefined) { timeout = 0; }\n if (withCredentials === undefined) { withCredentials = false; }\n\n // Before sending a request, set the xhr.responseType to \"text\",\n // \"arraybuffer\", \"blob\", or \"document\", depending on your data needs.\n // Note, setting xhr.responseType = '' (or omitting) will default the response to \"text\".\n\n return {\n\n // Ignored by the Loader, only used by File.\n responseType: responseType,\n\n async: async,\n\n // credentials\n user: user,\n password: password,\n\n // timeout in ms (0 = no timeout)\n timeout: timeout,\n\n // setRequestHeader\n headers: undefined,\n header: undefined,\n headerValue: undefined,\n requestedWith: false,\n\n // overrideMimeType\n overrideMimeType: undefined,\n\n // withCredentials\n withCredentials: withCredentials\n\n };\n};\n\nmodule.exports = XHRSettings;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar FILE_CONST = {\n\n /**\n * The Loader is idle.\n * \n * @name Phaser.Loader.LOADER_IDLE\n * @type {number}\n * @since 3.0.0\n */\n LOADER_IDLE: 0,\n\n /**\n * The Loader is actively loading.\n * \n * @name Phaser.Loader.LOADER_LOADING\n * @type {number}\n * @since 3.0.0\n */\n LOADER_LOADING: 1,\n\n /**\n * The Loader is processing files is has loaded.\n * \n * @name Phaser.Loader.LOADER_PROCESSING\n * @type {number}\n * @since 3.0.0\n */\n LOADER_PROCESSING: 2,\n\n /**\n * The Loader has completed loading and processing.\n * \n * @name Phaser.Loader.LOADER_COMPLETE\n * @type {number}\n * @since 3.0.0\n */\n LOADER_COMPLETE: 3,\n\n /**\n * The Loader is shutting down.\n * \n * @name Phaser.Loader.LOADER_SHUTDOWN\n * @type {number}\n * @since 3.0.0\n */\n LOADER_SHUTDOWN: 4,\n\n /**\n * The Loader has been destroyed.\n * \n * @name Phaser.Loader.LOADER_DESTROYED\n * @type {number}\n * @since 3.0.0\n */\n LOADER_DESTROYED: 5,\n\n /**\n * File is in the load queue but not yet started\n * \n * @name Phaser.Loader.FILE_PENDING\n * @type {number}\n * @since 3.0.0\n */\n FILE_PENDING: 10,\n\n /**\n * File has been started to load by the loader (onLoad called)\n * \n * @name Phaser.Loader.FILE_LOADING\n * @type {number}\n * @since 3.0.0\n */\n FILE_LOADING: 11,\n\n /**\n * File has loaded successfully, awaiting processing \n * \n * @name Phaser.Loader.FILE_LOADED\n * @type {number}\n * @since 3.0.0\n */\n FILE_LOADED: 12,\n\n /**\n * File failed to load\n * \n * @name Phaser.Loader.FILE_FAILED\n * @type {number}\n * @since 3.0.0\n */\n FILE_FAILED: 13,\n\n /**\n * File is being processed (onProcess callback)\n * \n * @name Phaser.Loader.FILE_PROCESSING\n * @type {number}\n * @since 3.0.0\n */\n FILE_PROCESSING: 14,\n\n /**\n * The File has errored somehow during processing.\n * \n * @name Phaser.Loader.FILE_ERRORED\n * @type {number}\n * @since 3.0.0\n */\n FILE_ERRORED: 16,\n\n /**\n * File has finished processing.\n * \n * @name Phaser.Loader.FILE_COMPLETE\n * @type {number}\n * @since 3.0.0\n */\n FILE_COMPLETE: 17,\n\n /**\n * File has been destroyed\n * \n * @name Phaser.Loader.FILE_DESTROYED\n * @type {number}\n * @since 3.0.0\n */\n FILE_DESTROYED: 18,\n\n /**\n * File was populated from local data and doesn't need an HTTP request\n * \n * @name Phaser.Loader.FILE_POPULATED\n * @type {number}\n * @since 3.0.0\n */\n FILE_POPULATED: 19\n\n};\n\nmodule.exports = FILE_CONST;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Loader Plugin Add File Event.\n * \n * This event is dispatched when a new file is successfully added to the Loader and placed into the load queue.\n * \n * Listen to it from a Scene using: `this.load.on('addfile', listener)`.\n * \n * If you add lots of files to a Loader from a `preload` method, it will dispatch this event for each one of them.\n *\n * @event Phaser.Loader.Events#ADD\n * @since 3.0.0\n * \n * @param {string} key - The unique key of the file that was added to the Loader.\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} string of the file that was added to the Loader, i.e. `image`.\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\n * @param {Phaser.Loader.File} file - A reference to the File which was added to the Loader.\n */\nmodule.exports = 'addfile';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Loader Plugin Complete Event.\n * \n * This event is dispatched when the Loader has fully processed everything in the load queue.\n * By this point every loaded file will now be in its associated cache and ready for use.\n * \n * Listen to it from a Scene using: `this.load.on('complete', listener)`.\n *\n * @event Phaser.Loader.Events#COMPLETE\n * @since 3.0.0\n * \n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\n * @param {number} totalComplete - The total number of files that successfully loaded.\n * @param {number} totalFailed - The total number of files that failed to load.\n */\nmodule.exports = 'complete';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The File Load Complete Event.\n * \n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\n * \n * Listen to it from a Scene using: `this.load.on('filecomplete', listener)`.\n * \n * You can also listen for the completion of a specific file. See the [FILE_KEY_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_KEY_COMPLETE} event.\n *\n * @event Phaser.Loader.Events#FILE_COMPLETE\n * @since 3.0.0\n * \n * @param {string} key - The key of the file that just loaded and finished processing.\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\n * @param {any} data - The raw data the file contained.\n */\nmodule.exports = 'filecomplete';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The File Load Complete Event.\n * \n * This event is dispatched by the Loader Plugin when any file in the queue finishes loading.\n * \n * It uses a special dynamic event name constructed from the key and type of the file.\n * \n * For example, if you have loaded an `image` with a key of `monster`, you can listen for it\n * using the following:\n *\n * ```javascript\n * this.load.on('filecomplete-image-monster', function (key, type, data) {\n * // Your handler code\n * });\n * ```\n *\n * Or, if you have loaded a texture `atlas` with a key of `Level1`:\n * \n * ```javascript\n * this.load.on('filecomplete-atlas-Level1', function (key, type, data) {\n * // Your handler code\n * });\n * ```\n * \n * Or, if you have loaded a sprite sheet with a key of `Explosion` and a prefix of `GAMEOVER`:\n * \n * ```javascript\n * this.load.on('filecomplete-spritesheet-GAMEOVERExplosion', function (key, type, data) {\n * // Your handler code\n * });\n * ```\n * \n * You can also listen for the generic completion of files. See the [FILE_COMPLETE]{@linkcode Phaser.Loader.Events#event:FILE_COMPLETE} event.\n *\n * @event Phaser.Loader.Events#FILE_KEY_COMPLETE\n * @since 3.0.0\n * \n * @param {string} key - The key of the file that just loaded and finished processing.\n * @param {string} type - The [file type]{@link Phaser.Loader.File#type} of the file that just loaded, i.e. `image`.\n * @param {any} data - The raw data the file contained.\n */\nmodule.exports = 'filecomplete-';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The File Load Error Event.\n * \n * This event is dispatched by the Loader Plugin when a file fails to load.\n * \n * Listen to it from a Scene using: `this.load.on('loaderror', listener)`.\n *\n * @event Phaser.Loader.Events#FILE_LOAD_ERROR\n * @since 3.0.0\n * \n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\n */\nmodule.exports = 'loaderror';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The File Load Event.\n * \n * This event is dispatched by the Loader Plugin when a file finishes loading,\n * but _before_ it is processed and added to the internal Phaser caches.\n * \n * Listen to it from a Scene using: `this.load.on('load', listener)`.\n *\n * @event Phaser.Loader.Events#FILE_LOAD\n * @since 3.0.0\n * \n * @param {Phaser.Loader.File} file - A reference to the File which just finished loading.\n */\nmodule.exports = 'load';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The File Load Progress Event.\n * \n * This event is dispatched by the Loader Plugin during the load of a file, if the browser receives a DOM ProgressEvent and\n * the `lengthComputable` event property is true. Depending on the size of the file and browser in use, this may, or may not happen.\n * \n * Listen to it from a Scene using: `this.load.on('fileprogress', listener)`.\n *\n * @event Phaser.Loader.Events#FILE_PROGRESS\n * @since 3.0.0\n * \n * @param {Phaser.Loader.File} file - A reference to the File which errored during load.\n * @param {number} percentComplete - A value between 0 and 1 indicating how 'complete' this file is.\n */\nmodule.exports = 'fileprogress';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Loader Plugin Post Process Event.\n * \n * This event is dispatched by the Loader Plugin when the Loader has finished loading everything in the load queue.\n * It is dispatched before the internal lists are cleared and each File is destroyed.\n * \n * Use this hook to perform any last minute processing of files that can only happen once the\n * Loader has completed, but prior to it emitting the `complete` event.\n * \n * Listen to it from a Scene using: `this.load.on('postprocess', listener)`.\n *\n * @event Phaser.Loader.Events#POST_PROCESS\n * @since 3.0.0\n * \n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\n */\nmodule.exports = 'postprocess';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Loader Plugin Progress Event.\n * \n * This event is dispatched when the Loader updates its load progress, typically as a result of a file having completed loading.\n * \n * Listen to it from a Scene using: `this.load.on('progress', listener)`.\n *\n * @event Phaser.Loader.Events#PROGRESS\n * @since 3.0.0\n * \n * @param {number} progress - The current progress of the load. A value between 0 and 1.\n */\nmodule.exports = 'progress';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Loader Plugin Start Event.\n * \n * This event is dispatched when the Loader starts running. At this point load progress is zero.\n * \n * This event is dispatched even if there aren't any files in the load queue.\n * \n * Listen to it from a Scene using: `this.load.on('start', listener)`.\n *\n * @event Phaser.Loader.Events#START\n * @since 3.0.0\n * \n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event.\n */\nmodule.exports = 'start';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Loader.Events\n */\n\nmodule.exports = {\n\n ADD: require('./ADD_EVENT'),\n COMPLETE: require('./COMPLETE_EVENT'),\n FILE_COMPLETE: require('./FILE_COMPLETE_EVENT'),\n FILE_KEY_COMPLETE: require('./FILE_KEY_COMPLETE_EVENT'),\n FILE_LOAD_ERROR: require('./FILE_LOAD_ERROR_EVENT'),\n FILE_LOAD: require('./FILE_LOAD_EVENT'),\n FILE_PROGRESS: require('./FILE_PROGRESS_EVENT'),\n POST_PROCESS: require('./POST_PROCESS_EVENT'),\n PROGRESS: require('./PROGRESS_EVENT'),\n START: require('./START_EVENT')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar CONST = require('../const');\nvar File = require('../File');\nvar FileTypesManager = require('../FileTypesManager');\nvar GetFastValue = require('../../utils/object/GetFastValue');\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\n\n/**\n * @classdesc\n * A single Image File suitable for loading by the Loader.\n *\n * These are created when you use the Phaser.Loader.LoaderPlugin#image method and are not typically created directly.\n *\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#image.\n *\n * @class ImageFile\n * @extends Phaser.Loader.File\n * @memberof Phaser.Loader.FileTypes\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig)} key - The key to use for this file, or a file configuration object.\n * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\n * @param {Phaser.Types.Loader.FileTypes.ImageFrameConfig} [frameConfig] - The frame configuration object. Only provided for, and used by, Sprite Sheets.\n */\nvar ImageFile = new Class({\n\n Extends: File,\n\n initialize:\n\n function ImageFile (loader, key, url, xhrSettings, frameConfig)\n {\n var extension = 'png';\n var normalMapURL;\n\n if (IsPlainObject(key))\n {\n var config = key;\n\n key = GetFastValue(config, 'key');\n url = GetFastValue(config, 'url');\n normalMapURL = GetFastValue(config, 'normalMap');\n xhrSettings = GetFastValue(config, 'xhrSettings');\n extension = GetFastValue(config, 'extension', extension);\n frameConfig = GetFastValue(config, 'frameConfig');\n }\n\n if (Array.isArray(url))\n {\n normalMapURL = url[1];\n url = url[0];\n }\n\n var fileConfig = {\n type: 'image',\n cache: loader.textureManager,\n extension: extension,\n responseType: 'blob',\n key: key,\n url: url,\n xhrSettings: xhrSettings,\n config: frameConfig\n };\n\n File.call(this, loader, fileConfig);\n\n // Do we have a normal map to load as well?\n if (normalMapURL)\n {\n var normalMap = new ImageFile(loader, this.key, normalMapURL, xhrSettings, frameConfig);\n\n normalMap.type = 'normalMap';\n\n this.setLink(normalMap);\n\n loader.addFile(normalMap);\n }\n },\n\n /**\n * Called automatically by Loader.nextFile.\n * This method controls what extra work this File does with its loaded data.\n *\n * @method Phaser.Loader.FileTypes.ImageFile#onProcess\n * @since 3.7.0\n */\n onProcess: function ()\n {\n this.state = CONST.FILE_PROCESSING;\n\n this.data = new Image();\n\n this.data.crossOrigin = this.crossOrigin;\n\n var _this = this;\n\n this.data.onload = function ()\n {\n File.revokeObjectURL(_this.data);\n\n _this.onProcessComplete();\n };\n\n this.data.onerror = function ()\n {\n File.revokeObjectURL(_this.data);\n\n _this.onProcessError();\n };\n\n File.createObjectURL(this.data, this.xhrLoader.response, 'image/png');\n },\n\n /**\n * Adds this file to its target cache upon successful loading and processing.\n *\n * @method Phaser.Loader.FileTypes.ImageFile#addToCache\n * @since 3.7.0\n */\n addToCache: function ()\n {\n var texture;\n var linkFile = this.linkFile;\n\n if (linkFile && linkFile.state === CONST.FILE_COMPLETE)\n {\n if (this.type === 'image')\n {\n texture = this.cache.addImage(this.key, this.data, linkFile.data);\n }\n else\n {\n texture = this.cache.addImage(linkFile.key, linkFile.data, this.data);\n }\n\n this.pendingDestroy(texture);\n\n linkFile.pendingDestroy(texture);\n }\n else if (!linkFile)\n {\n texture = this.cache.addImage(this.key, this.data);\n\n this.pendingDestroy(texture);\n }\n }\n\n});\n\n/**\n * Adds an Image, or array of Images, to the current load queue.\n *\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\n *\n * ```javascript\n * function preload ()\n * {\n * this.load.image('logo', 'images/phaserLogo.png');\n * }\n * ```\n *\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\n * loaded.\n *\n * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle.\n * If you try to load an animated gif only the first frame will be rendered. Browsers do not natively support playback\n * of animated gifs to Canvas elements.\n *\n * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load.\n * The key should be unique both in terms of files being loaded and files already present in the Texture Manager.\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\n * then remove it from the Texture Manager first, before loading a new one.\n *\n * Instead of passing arguments you can pass a configuration object, such as:\n *\n * ```javascript\n * this.load.image({\n * key: 'logo',\n * url: 'images/AtariLogo.png'\n * });\n * ```\n *\n * See the documentation for `Phaser.Types.Loader.FileTypes.ImageFileConfig` for more details.\n *\n * Once the file has finished loading you can use it as a texture for a Game Object by referencing its key:\n *\n * ```javascript\n * this.load.image('logo', 'images/AtariLogo.png');\n * // and later in your game ...\n * this.add.image(x, y, 'logo');\n * ```\n *\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\n * this is what you would use to retrieve the image from the Texture Manager.\n *\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\n *\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\n * and no URL is given then the Loader will set the URL to be \"alien.png\". It will always add `.png` as the extension, although\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\n *\n * Phaser also supports the automatic loading of associated normal maps. If you have a normal map to go with this image,\n * then you can specify it by providing an array as the `url` where the second element is the normal map:\n *\n * ```javascript\n * this.load.image('logo', [ 'images/AtariLogo.png', 'images/AtariLogo-n.png' ]);\n * ```\n *\n * Or, if you are using a config object use the `normalMap` property:\n *\n * ```javascript\n * this.load.image({\n * key: 'logo',\n * url: 'images/AtariLogo.png',\n * normalMap: 'images/AtariLogo-n.png'\n * });\n * ```\n *\n * The normal map file is subject to the same conditions as the image file with regard to the path, baseURL, CORs and XHR Settings.\n * Normal maps are a WebGL only feature.\n *\n * Note: The ability to load this type of file will only be available if the Image File type has been built into Phaser.\n * It is available in the default build but can be excluded from custom builds.\n *\n * @method Phaser.Loader.LoaderPlugin#image\n * @fires Phaser.Loader.LoaderPlugin#ADD\n * @since 3.0.0\n *\n * @param {(string|Phaser.Types.Loader.FileTypes.ImageFileConfig|Phaser.Types.Loader.FileTypes.ImageFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\n * @param {string|string[]} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was \"alien\" then the URL will be \"alien.png\".\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\n *\n * @return {this} The Loader instance.\n */\nFileTypesManager.register('image', function (key, url, xhrSettings)\n{\n if (Array.isArray(key))\n {\n for (var i = 0; i < key.length; i++)\n {\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\n this.addFile(new ImageFile(this, key[i]));\n }\n }\n else\n {\n this.addFile(new ImageFile(this, key, url, xhrSettings));\n }\n\n return this;\n});\n\nmodule.exports = ImageFile;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar CONST = require('../const');\nvar File = require('../File');\nvar FileTypesManager = require('../FileTypesManager');\nvar GetFastValue = require('../../utils/object/GetFastValue');\nvar GetValue = require('../../utils/object/GetValue');\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\n\n/**\n * @classdesc\n * A single JSON File suitable for loading by the Loader.\n *\n * These are created when you use the Phaser.Loader.LoaderPlugin#json method and are not typically created directly.\n *\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#json.\n *\n * @class JSONFile\n * @extends Phaser.Loader.File\n * @memberof Phaser.Loader.FileTypes\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig)} key - The key to use for this file, or a file configuration object.\n * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\". Or, can be a fully formed JSON Object.\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\n */\nvar JSONFile = new Class({\n\n Extends: File,\n\n initialize:\n\n // url can either be a string, in which case it is treated like a proper url, or an object, in which case it is treated as a ready-made JS Object\n // dataKey allows you to pluck a specific object out of the JSON and put just that into the cache, rather than the whole thing\n\n function JSONFile (loader, key, url, xhrSettings, dataKey)\n {\n var extension = 'json';\n\n if (IsPlainObject(key))\n {\n var config = key;\n\n key = GetFastValue(config, 'key');\n url = GetFastValue(config, 'url');\n xhrSettings = GetFastValue(config, 'xhrSettings');\n extension = GetFastValue(config, 'extension', extension);\n dataKey = GetFastValue(config, 'dataKey', dataKey);\n }\n\n var fileConfig = {\n type: 'json',\n cache: loader.cacheManager.json,\n extension: extension,\n responseType: 'text',\n key: key,\n url: url,\n xhrSettings: xhrSettings,\n config: dataKey\n };\n\n File.call(this, loader, fileConfig);\n\n if (IsPlainObject(url))\n {\n // Object provided instead of a URL, so no need to actually load it (populate data with value)\n if (dataKey)\n {\n this.data = GetValue(url, dataKey);\n }\n else\n {\n this.data = url;\n }\n\n this.state = CONST.FILE_POPULATED;\n }\n },\n\n /**\n * Called automatically by Loader.nextFile.\n * This method controls what extra work this File does with its loaded data.\n *\n * @method Phaser.Loader.FileTypes.JSONFile#onProcess\n * @since 3.7.0\n */\n onProcess: function ()\n {\n if (this.state !== CONST.FILE_POPULATED)\n {\n this.state = CONST.FILE_PROCESSING;\n\n var json = JSON.parse(this.xhrLoader.responseText);\n\n var key = this.config;\n\n if (typeof key === 'string')\n {\n this.data = GetValue(json, key, json);\n }\n else\n {\n this.data = json;\n }\n }\n\n this.onProcessComplete();\n }\n\n});\n\n/**\n * Adds a JSON file, or array of JSON files, to the current load queue.\n *\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\n *\n * ```javascript\n * function preload ()\n * {\n * this.load.json('wavedata', 'files/AlienWaveData.json');\n * }\n * ```\n *\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\n * loaded.\n *\n * The key must be a unique String. It is used to add the file to the global JSON Cache upon a successful load.\n * The key should be unique both in terms of files being loaded and files already present in the JSON Cache.\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\n * then remove it from the JSON Cache first, before loading a new one.\n *\n * Instead of passing arguments you can pass a configuration object, such as:\n *\n * ```javascript\n * this.load.json({\n * key: 'wavedata',\n * url: 'files/AlienWaveData.json'\n * });\n * ```\n *\n * See the documentation for `Phaser.Types.Loader.FileTypes.JSONFileConfig` for more details.\n *\n * Once the file has finished loading you can access it from its Cache using its key:\n *\n * ```javascript\n * this.load.json('wavedata', 'files/AlienWaveData.json');\n * // and later in your game ...\n * var data = this.cache.json.get('wavedata');\n * ```\n *\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\n * key. For example, if the prefix was `LEVEL1.` and the key was `Waves` the final key will be `LEVEL1.Waves` and\n * this is what you would use to retrieve the text from the JSON Cache.\n *\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\n *\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"data\"\n * and no URL is given then the Loader will set the URL to be \"data.json\". It will always add `.json` as the extension, although\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\n *\n * You can also optionally provide a `dataKey` to use. This allows you to extract only a part of the JSON and store it in the Cache,\n * rather than the whole file. For example, if your JSON data had a structure like this:\n *\n * ```json\n * {\n * \"level1\": {\n * \"baddies\": {\n * \"aliens\": {},\n * \"boss\": {}\n * }\n * },\n * \"level2\": {},\n * \"level3\": {}\n * }\n * ```\n *\n * And you only wanted to store the `boss` data in the Cache, then you could pass `level1.baddies.boss`as the `dataKey`.\n *\n * Note: The ability to load this type of file will only be available if the JSON File type has been built into Phaser.\n * It is available in the default build but can be excluded from custom builds.\n *\n * @method Phaser.Loader.LoaderPlugin#json\n * @fires Phaser.Loader.LoaderPlugin#ADD\n * @since 3.0.0\n *\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\n * @param {(object|string)} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\". Or, can be a fully formed JSON Object.\n * @param {string} [dataKey] - When the JSON file loads only this property will be stored in the Cache.\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\n *\n * @return {this} The Loader instance.\n */\nFileTypesManager.register('json', function (key, url, dataKey, xhrSettings)\n{\n if (Array.isArray(key))\n {\n for (var i = 0; i < key.length; i++)\n {\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\n this.addFile(new JSONFile(this, key[i]));\n }\n }\n else\n {\n this.addFile(new JSONFile(this, key, url, xhrSettings, dataKey));\n }\n\n return this;\n});\n\nmodule.exports = JSONFile;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\nvar CONST = require('../const');\nvar File = require('../File');\nvar FileTypesManager = require('../FileTypesManager');\nvar GetFastValue = require('../../utils/object/GetFastValue');\nvar IsPlainObject = require('../../utils/object/IsPlainObject');\n\n/**\n * @classdesc\n * A single Text File suitable for loading by the Loader.\n *\n * These are created when you use the Phaser.Loader.LoaderPlugin#text method and are not typically created directly.\n *\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#text.\n *\n * @class TextFile\n * @extends Phaser.Loader.File\n * @memberof Phaser.Loader.FileTypes\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig)} key - The key to use for this file, or a file configuration object.\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file.\n */\nvar TextFile = new Class({\n\n Extends: File,\n\n initialize:\n\n function TextFile (loader, key, url, xhrSettings)\n {\n var type = 'text';\n var extension = 'txt';\n var cache = loader.cacheManager.text;\n\n if (IsPlainObject(key))\n {\n var config = key;\n\n key = GetFastValue(config, 'key');\n url = GetFastValue(config, 'url');\n xhrSettings = GetFastValue(config, 'xhrSettings');\n extension = GetFastValue(config, 'extension', extension);\n type = GetFastValue(config, 'type', type);\n cache = GetFastValue(config, 'cache', cache);\n }\n\n var fileConfig = {\n type: type,\n cache: cache,\n extension: extension,\n responseType: 'text',\n key: key,\n url: url,\n xhrSettings: xhrSettings\n };\n\n File.call(this, loader, fileConfig);\n },\n\n /**\n * Called automatically by Loader.nextFile.\n * This method controls what extra work this File does with its loaded data.\n *\n * @method Phaser.Loader.FileTypes.TextFile#onProcess\n * @since 3.7.0\n */\n onProcess: function ()\n {\n this.state = CONST.FILE_PROCESSING;\n\n this.data = this.xhrLoader.responseText;\n\n this.onProcessComplete();\n }\n\n});\n\n/**\n * Adds a Text file, or array of Text files, to the current load queue.\n *\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\n *\n * ```javascript\n * function preload ()\n * {\n * this.load.text('story', 'files/IntroStory.txt');\n * }\n * ```\n *\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\n * loaded.\n *\n * The key must be a unique String. It is used to add the file to the global Text Cache upon a successful load.\n * The key should be unique both in terms of files being loaded and files already present in the Text Cache.\n * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file\n * then remove it from the Text Cache first, before loading a new one.\n *\n * Instead of passing arguments you can pass a configuration object, such as:\n *\n * ```javascript\n * this.load.text({\n * key: 'story',\n * url: 'files/IntroStory.txt'\n * });\n * ```\n *\n * See the documentation for `Phaser.Types.Loader.FileTypes.TextFileConfig` for more details.\n *\n * Once the file has finished loading you can access it from its Cache using its key:\n *\n * ```javascript\n * this.load.text('story', 'files/IntroStory.txt');\n * // and later in your game ...\n * var data = this.cache.text.get('story');\n * ```\n *\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\n * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and\n * this is what you would use to retrieve the text from the Text Cache.\n *\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\n *\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"story\"\n * and no URL is given then the Loader will set the URL to be \"story.txt\". It will always add `.txt` as the extension, although\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\n *\n * Note: The ability to load this type of file will only be available if the Text File type has been built into Phaser.\n * It is available in the default build but can be excluded from custom builds.\n *\n * @method Phaser.Loader.LoaderPlugin#text\n * @fires Phaser.Loader.LoaderPlugin#ADD\n * @since 3.0.0\n *\n * @param {(string|Phaser.Types.Loader.FileTypes.TextFileConfig|Phaser.Types.Loader.FileTypes.TextFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\n * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\n * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings.\n *\n * @return {this} The Loader instance.\n */\nFileTypesManager.register('text', function (key, url, xhrSettings)\n{\n if (Array.isArray(key))\n {\n for (var i = 0; i < key.length; i++)\n {\n // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object\n this.addFile(new TextFile(this, key[i]));\n }\n }\n else\n {\n this.addFile(new TextFile(this, key, url, xhrSettings));\n }\n\n return this;\n});\n\nmodule.exports = TextFile;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the mean average of the given values.\n *\n * @function Phaser.Math.Average\n * @since 3.0.0\n *\n * @param {number[]} values - The values to average.\n *\n * @return {number} The average value.\n */\nvar Average = function (values)\n{\n var sum = 0;\n\n for (var i = 0; i < values.length; i++)\n {\n sum += (+values[i]);\n }\n\n return sum / values.length;\n};\n\nmodule.exports = Average;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Factorial = require('./Factorial');\n\n/**\n * Calculates the Bernstein basis from the three factorial coefficients.\n *\n * @function Phaser.Math.Bernstein\n * @since 3.0.0\n *\n * @param {number} n - The first value.\n * @param {number} i - The second value.\n *\n * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i)\n */\nvar Bernstein = function (n, i)\n{\n return Factorial(n) / Factorial(i) / Factorial(n - i);\n};\n\nmodule.exports = Bernstein;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Compute a random integer between the `min` and `max` values, inclusive.\n *\n * @function Phaser.Math.Between\n * @since 3.0.0\n *\n * @param {number} min - The minimum value.\n * @param {number} max - The maximum value.\n *\n * @return {number} The random integer.\n */\nvar Between = function (min, max)\n{\n return Math.floor(Math.random() * (max - min + 1) + min);\n};\n\nmodule.exports = Between;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5.\n *\n * @function Phaser.Math.CatmullRom\n * @since 3.0.0\n *\n * @param {number} t - The amount to interpolate by.\n * @param {number} p0 - The first control point.\n * @param {number} p1 - The second control point.\n * @param {number} p2 - The third control point.\n * @param {number} p3 - The fourth control point.\n *\n * @return {number} The Catmull-Rom value.\n */\nvar CatmullRom = function (t, p0, p1, p2, p3)\n{\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n var t2 = t * t;\n var t3 = t * t2;\n\n return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n};\n\nmodule.exports = CatmullRom;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Ceils to some place comparative to a `base`, default is 10 for decimal place.\n *\n * The `place` is represented by the power applied to `base` to get that place.\n *\n * @function Phaser.Math.CeilTo\n * @since 3.0.0\n *\n * @param {number} value - The value to round.\n * @param {number} [place=0] - The place to round to.\n * @param {number} [base=10] - The base to round in. Default is 10 for decimal.\n *\n * @return {number} The rounded value.\n */\nvar CeilTo = function (value, place, base)\n{\n if (place === undefined) { place = 0; }\n if (base === undefined) { base = 10; }\n\n var p = Math.pow(base, -place);\n\n return Math.ceil(value * p) / p;\n};\n\nmodule.exports = CeilTo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Force a value within the boundaries by clamping it to the range `min`, `max`.\n *\n * @function Phaser.Math.Clamp\n * @since 3.0.0\n *\n * @param {number} value - The value to be clamped.\n * @param {number} min - The minimum bounds.\n * @param {number} max - The maximum bounds.\n *\n * @return {number} The clamped value.\n */\nvar Clamp = function (value, min, max)\n{\n return Math.max(min, Math.min(max, value));\n};\n\nmodule.exports = Clamp;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar CONST = require('./const');\n\n/**\n * Convert the given angle from degrees, to the equivalent angle in radians.\n *\n * @function Phaser.Math.DegToRad\n * @since 3.0.0\n *\n * @param {number} degrees - The angle (in degrees) to convert to radians.\n *\n * @return {number} The given angle converted to radians.\n */\nvar DegToRad = function (degrees)\n{\n return degrees * CONST.DEG_TO_RAD;\n};\n\nmodule.exports = DegToRad;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculates the positive difference of two given numbers.\n *\n * @function Phaser.Math.Difference\n * @since 3.0.0\n *\n * @param {number} a - The first number in the calculation.\n * @param {number} b - The second number in the calculation.\n *\n * @return {number} The positive difference of the two given numbers.\n */\nvar Difference = function (a, b)\n{\n return Math.abs(a - b);\n};\n\nmodule.exports = Difference;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Clamp = require('./Clamp');\nvar Class = require('../utils/Class');\nvar Matrix4 = require('./Matrix4');\nvar NOOP = require('../utils/NOOP');\n\nvar tempMatrix = new Matrix4();\n\n/**\n * @classdesc\n *\n * @class Euler\n * @memberof Phaser.Math\n * @constructor\n * @since 3.50.0\n *\n * @param {number} [x] - The x component.\n * @param {number} [y] - The y component.\n * @param {number} [z] - The z component.\n */\nvar Euler = new Class({\n\n initialize:\n\n function Euler (x, y, z, order)\n {\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = 0; }\n if (z === undefined) { z = 0; }\n if (order === undefined) { order = Euler.DefaultOrder; }\n\n this._x = x;\n this._y = y;\n this._z = z;\n this._order = order;\n\n this.onChangeCallback = NOOP;\n },\n\n x: {\n get: function ()\n {\n return this._x;\n },\n\n set: function (value)\n {\n this._x = value;\n\n this.onChangeCallback(this);\n }\n },\n\n y: {\n get: function ()\n {\n return this._y;\n },\n\n set: function (value)\n {\n this._y = value;\n\n this.onChangeCallback(this);\n }\n },\n\n z: {\n get: function ()\n {\n return this._z;\n },\n\n set: function (value)\n {\n this._z = value;\n\n this.onChangeCallback(this);\n }\n },\n\n order: {\n get: function ()\n {\n return this._order;\n },\n\n set: function (value)\n {\n this._order = value;\n\n this.onChangeCallback(this);\n }\n },\n\n set: function (x, y, z, order)\n {\n if (order === undefined) { order = this._order; }\n\n this._x = x;\n this._y = y;\n this._z = z;\n this._order = order;\n\n this.onChangeCallback(this);\n\n return this;\n },\n\n copy: function (euler)\n {\n return this.set(euler.x, euler.y, euler.z, euler.order);\n },\n\n setFromQuaternion: function (quaternion, order, update)\n {\n if (order === undefined) { order = this._order; }\n if (update === undefined) { update = false; }\n\n tempMatrix.fromQuat(quaternion);\n\n return this.setFromRotationMatrix(tempMatrix, order, update);\n },\n\n setFromRotationMatrix: function (matrix, order, update)\n {\n if (order === undefined) { order = this._order; }\n if (update === undefined) { update = false; }\n\n var elements = matrix.val;\n\n // Upper 3x3 of matrix is un-scaled rotation matrix\n var m11 = elements[0];\n var m12 = elements[4];\n var m13 = elements[8];\n var m21 = elements[1];\n var m22 = elements[5];\n var m23 = elements[9];\n var m31 = elements[2];\n var m32 = elements[6];\n var m33 = elements[10];\n\n var x = 0;\n var y = 0;\n var z = 0;\n var epsilon = 0.99999;\n\n switch (order)\n {\n case 'XYZ':\n {\n y = Math.asin(Clamp(m13, -1, 1));\n\n if (Math.abs(m13) < epsilon)\n {\n x = Math.atan2(-m23, m33);\n z = Math.atan2(-m12, m11);\n }\n else\n {\n x = Math.atan2(m32, m22);\n }\n\n break;\n }\n\n case 'YXZ':\n {\n x = Math.asin(-Clamp(m23, -1, 1));\n\n if (Math.abs(m23) < epsilon)\n {\n y = Math.atan2(m13, m33);\n z = Math.atan2(m21, m22);\n }\n else\n {\n y = Math.atan2(-m31, m11);\n }\n\n break;\n }\n\n case 'ZXY':\n {\n x = Math.asin(Clamp(m32, -1, 1));\n\n if (Math.abs(m32) < epsilon)\n {\n y = Math.atan2(-m31, m33);\n z = Math.atan2(-m12, m22);\n }\n else\n {\n z = Math.atan2(m21, m11);\n }\n\n break;\n }\n\n case 'ZYX':\n {\n y = Math.asin(-Clamp(m31, -1, 1));\n\n if (Math.abs(m31) < epsilon)\n {\n x = Math.atan2(m32, m33);\n z = Math.atan2(m21, m11);\n }\n else\n {\n z = Math.atan2(-m12, m22);\n }\n\n break;\n }\n\n case 'YZX':\n {\n z = Math.asin(Clamp(m21, -1, 1));\n\n if (Math.abs(m21) < epsilon)\n {\n x = Math.atan2(-m23, m22);\n y = Math.atan2(-m31, m11);\n }\n else\n {\n y = Math.atan2(m13, m33);\n }\n\n break;\n }\n\n case 'XZY':\n {\n z = Math.asin(-Clamp(m12, -1, 1));\n\n if (Math.abs(m12) < epsilon)\n {\n x = Math.atan2(m32, m22);\n y = Math.atan2(m13, m11);\n }\n else\n {\n x = Math.atan2(-m23, m33);\n }\n\n break;\n }\n }\n\n this._x = x;\n this._y = y;\n this._z = z;\n this._order = order;\n\n if (update)\n {\n this.onChangeCallback(this);\n }\n\n return this;\n }\n\n});\n\nEuler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ];\n\nEuler.DefaultOrder = 'XYZ';\n\nmodule.exports = Euler;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculates the factorial of a given number for integer values greater than 0.\n *\n * @function Phaser.Math.Factorial\n * @since 3.0.0\n *\n * @param {number} value - A positive integer to calculate the factorial of.\n *\n * @return {number} The factorial of the given number.\n */\nvar Factorial = function (value)\n{\n if (value === 0)\n {\n return 1;\n }\n\n var res = value;\n\n while (--value)\n {\n res *= value;\n }\n\n return res;\n};\n\nmodule.exports = Factorial;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Generate a random floating point number between the two given bounds, minimum inclusive, maximum exclusive.\n *\n * @function Phaser.Math.FloatBetween\n * @since 3.0.0\n *\n * @param {number} min - The lower bound for the float, inclusive.\n * @param {number} max - The upper bound for the float exclusive.\n *\n * @return {number} A random float within the given range.\n */\nvar FloatBetween = function (min, max)\n{\n return Math.random() * (max - min) + min;\n};\n\nmodule.exports = FloatBetween;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Floors to some place comparative to a `base`, default is 10 for decimal place.\n *\n * The `place` is represented by the power applied to `base` to get that place.\n *\n * @function Phaser.Math.FloorTo\n * @since 3.0.0\n *\n * @param {number} value - The value to round.\n * @param {number} [place=0] - The place to round to.\n * @param {number} [base=10] - The base to round in. Default is 10 for decimal.\n *\n * @return {number} The rounded value.\n */\nvar FloorTo = function (value, place, base)\n{\n if (place === undefined) { place = 0; }\n if (base === undefined) { base = 10; }\n\n var p = Math.pow(base, -place);\n\n return Math.floor(value * p) / p;\n};\n\nmodule.exports = FloorTo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Clamp = require('./Clamp');\n\n/**\n * Return a value based on the range between `min` and `max` and the percentage given.\n *\n * @function Phaser.Math.FromPercent\n * @since 3.0.0\n *\n * @param {number} percent - A value between 0 and 1 representing the percentage.\n * @param {number} min - The minimum value.\n * @param {number} [max] - The maximum value.\n *\n * @return {number} The value that is `percent` percent between `min` and `max`.\n */\nvar FromPercent = function (percent, min, max)\n{\n percent = Clamp(percent, 0, 1);\n\n return (max - min) * percent;\n};\n\nmodule.exports = FromPercent;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate a per-ms speed from a distance and time (given in seconds).\n *\n * @function Phaser.Math.GetSpeed\n * @since 3.0.0\n *\n * @param {number} distance - The distance.\n * @param {number} time - The time, in seconds.\n *\n * @return {number} The speed, in distance per ms.\n *\n * @example\n * // 400px over 1 second is 0.4 px/ms\n * Phaser.Math.GetSpeed(400, 1) // -> 0.4\n */\nvar GetSpeed = function (distance, time)\n{\n return (distance / time) / 1000;\n};\n\nmodule.exports = GetSpeed;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Check if a given value is an even number.\n *\n * @function Phaser.Math.IsEven\n * @since 3.0.0\n *\n * @param {number} value - The number to perform the check with.\n *\n * @return {boolean} Whether the number is even or not.\n */\nvar IsEven = function (value)\n{\n // Use abstract equality == for \"is number\" test\n\n // eslint-disable-next-line eqeqeq\n return (value == parseFloat(value)) ? !(value % 2) : void 0;\n};\n\nmodule.exports = IsEven;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Check if a given value is an even number using a strict type check.\n *\n * @function Phaser.Math.IsEvenStrict\n * @since 3.0.0\n *\n * @param {number} value - The number to perform the check with.\n *\n * @return {boolean} Whether the number is even or not.\n */\nvar IsEvenStrict = function (value)\n{\n // Use strict equality === for \"is number\" test\n return (value === parseFloat(value)) ? !(value % 2) : void 0;\n};\n\nmodule.exports = IsEvenStrict;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculates a linear (interpolation) value over t.\n *\n * @function Phaser.Math.Linear\n * @since 3.0.0\n *\n * @param {number} p0 - The first point.\n * @param {number} p1 - The second point.\n * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1.\n *\n * @return {number} The step t% of the way between p0 and p1.\n */\nvar Linear = function (p0, p1, t)\n{\n return (p1 - p0) * t + p0;\n};\n\nmodule.exports = Linear;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\n\nvar Class = require('../utils/Class');\n\n/**\n * @classdesc\n * A three-dimensional matrix.\n *\n * Defaults to the identity matrix when instantiated.\n *\n * @class Matrix3\n * @memberof Phaser.Math\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from.\n */\nvar Matrix3 = new Class({\n\n initialize:\n\n function Matrix3 (m)\n {\n /**\n * The matrix values.\n *\n * @name Phaser.Math.Matrix3#val\n * @type {Float32Array}\n * @since 3.0.0\n */\n this.val = new Float32Array(9);\n\n if (m)\n {\n // Assume Matrix3 with val:\n this.copy(m);\n }\n else\n {\n // Default to identity\n this.identity();\n }\n },\n\n /**\n * Make a clone of this Matrix3.\n *\n * @method Phaser.Math.Matrix3#clone\n * @since 3.0.0\n *\n * @return {Phaser.Math.Matrix3} A clone of this Matrix3.\n */\n clone: function ()\n {\n return new Matrix3(this);\n },\n\n /**\n * This method is an alias for `Matrix3.copy`.\n *\n * @method Phaser.Math.Matrix3#set\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n set: function (src)\n {\n return this.copy(src);\n },\n\n /**\n * Copy the values of a given Matrix into this Matrix.\n *\n * @method Phaser.Math.Matrix3#copy\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n copy: function (src)\n {\n var out = this.val;\n var a = src.val;\n\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n\n return this;\n },\n\n /**\n * Copy the values of a given Matrix4 into this Matrix3.\n *\n * @method Phaser.Math.Matrix3#fromMat4\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n fromMat4: function (m)\n {\n var a = m.val;\n var out = this.val;\n\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n\n return this;\n },\n\n /**\n * Set the values of this Matrix from the given array.\n *\n * @method Phaser.Math.Matrix3#fromArray\n * @since 3.0.0\n *\n * @param {array} a - The array to copy the values from.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n fromArray: function (a)\n {\n var out = this.val;\n\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n\n return this;\n },\n\n /**\n * Reset this Matrix to an identity (default) matrix.\n *\n * @method Phaser.Math.Matrix3#identity\n * @since 3.0.0\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n identity: function ()\n {\n var out = this.val;\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n\n return this;\n },\n\n /**\n * Transpose this Matrix.\n *\n * @method Phaser.Math.Matrix3#transpose\n * @since 3.0.0\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n transpose: function ()\n {\n var a = this.val;\n var a01 = a[1];\n var a02 = a[2];\n var a12 = a[5];\n\n a[1] = a[3];\n a[2] = a[6];\n a[3] = a01;\n a[5] = a[7];\n a[6] = a02;\n a[7] = a12;\n\n return this;\n },\n\n /**\n * Invert this Matrix.\n *\n * @method Phaser.Math.Matrix3#invert\n * @since 3.0.0\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n invert: function ()\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a10 = a[3];\n var a11 = a[4];\n var a12 = a[5];\n var a20 = a[6];\n var a21 = a[7];\n var a22 = a[8];\n\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20;\n\n // Calculate the determinant\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det)\n {\n return null;\n }\n\n det = 1 / det;\n\n a[0] = b01 * det;\n a[1] = (-a22 * a01 + a02 * a21) * det;\n a[2] = (a12 * a01 - a02 * a11) * det;\n a[3] = b11 * det;\n a[4] = (a22 * a00 - a02 * a20) * det;\n a[5] = (-a12 * a00 + a02 * a10) * det;\n a[6] = b21 * det;\n a[7] = (-a21 * a00 + a01 * a20) * det;\n a[8] = (a11 * a00 - a01 * a10) * det;\n\n return this;\n },\n\n /**\n * Calculate the adjoint, or adjugate, of this Matrix.\n *\n * @method Phaser.Math.Matrix3#adjoint\n * @since 3.0.0\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n adjoint: function ()\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a10 = a[3];\n var a11 = a[4];\n var a12 = a[5];\n var a20 = a[6];\n var a21 = a[7];\n var a22 = a[8];\n\n a[0] = (a11 * a22 - a12 * a21);\n a[1] = (a02 * a21 - a01 * a22);\n a[2] = (a01 * a12 - a02 * a11);\n a[3] = (a12 * a20 - a10 * a22);\n a[4] = (a00 * a22 - a02 * a20);\n a[5] = (a02 * a10 - a00 * a12);\n a[6] = (a10 * a21 - a11 * a20);\n a[7] = (a01 * a20 - a00 * a21);\n a[8] = (a00 * a11 - a01 * a10);\n\n return this;\n },\n\n /**\n * Calculate the determinant of this Matrix.\n *\n * @method Phaser.Math.Matrix3#determinant\n * @since 3.0.0\n *\n * @return {number} The determinant of this Matrix.\n */\n determinant: function ()\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a10 = a[3];\n var a11 = a[4];\n var a12 = a[5];\n var a20 = a[6];\n var a21 = a[7];\n var a22 = a[8];\n\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n },\n\n /**\n * Multiply this Matrix by the given Matrix.\n *\n * @method Phaser.Math.Matrix3#multiply\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n multiply: function (src)\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a10 = a[3];\n var a11 = a[4];\n var a12 = a[5];\n var a20 = a[6];\n var a21 = a[7];\n var a22 = a[8];\n\n var b = src.val;\n\n var b00 = b[0];\n var b01 = b[1];\n var b02 = b[2];\n var b10 = b[3];\n var b11 = b[4];\n var b12 = b[5];\n var b20 = b[6];\n var b21 = b[7];\n var b22 = b[8];\n\n a[0] = b00 * a00 + b01 * a10 + b02 * a20;\n a[1] = b00 * a01 + b01 * a11 + b02 * a21;\n a[2] = b00 * a02 + b01 * a12 + b02 * a22;\n\n a[3] = b10 * a00 + b11 * a10 + b12 * a20;\n a[4] = b10 * a01 + b11 * a11 + b12 * a21;\n a[5] = b10 * a02 + b11 * a12 + b12 * a22;\n\n a[6] = b20 * a00 + b21 * a10 + b22 * a20;\n a[7] = b20 * a01 + b21 * a11 + b22 * a21;\n a[8] = b20 * a02 + b21 * a12 + b22 * a22;\n\n return this;\n },\n\n /**\n * Translate this Matrix using the given Vector.\n *\n * @method Phaser.Math.Matrix3#translate\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n translate: function (v)\n {\n var a = this.val;\n var x = v.x;\n var y = v.y;\n\n a[6] = x * a[0] + y * a[3] + a[6];\n a[7] = x * a[1] + y * a[4] + a[7];\n a[8] = x * a[2] + y * a[5] + a[8];\n\n return this;\n },\n\n /**\n * Apply a rotation transformation to this Matrix.\n *\n * @method Phaser.Math.Matrix3#rotate\n * @since 3.0.0\n *\n * @param {number} rad - The angle in radians to rotate by.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n rotate: function (rad)\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a10 = a[3];\n var a11 = a[4];\n var a12 = a[5];\n\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n\n a[0] = c * a00 + s * a10;\n a[1] = c * a01 + s * a11;\n a[2] = c * a02 + s * a12;\n\n a[3] = c * a10 - s * a00;\n a[4] = c * a11 - s * a01;\n a[5] = c * a12 - s * a02;\n\n return this;\n },\n\n /**\n * Apply a scale transformation to this Matrix.\n *\n * Uses the `x` and `y` components of the given Vector to scale the Matrix.\n *\n * @method Phaser.Math.Matrix3#scale\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n scale: function (v)\n {\n var a = this.val;\n var x = v.x;\n var y = v.y;\n\n a[0] = x * a[0];\n a[1] = x * a[1];\n a[2] = x * a[2];\n\n a[3] = y * a[3];\n a[4] = y * a[4];\n a[5] = y * a[5];\n\n return this;\n },\n\n /**\n * Set the values of this Matrix from the given Quaternion.\n *\n * @method Phaser.Math.Matrix3#fromQuat\n * @since 3.0.0\n *\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n fromQuat: function (q)\n {\n var x = q.x;\n var y = q.y;\n var z = q.z;\n var w = q.w;\n\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n\n var out = this.val;\n\n out[0] = 1 - (yy + zz);\n out[3] = xy + wz;\n out[6] = xz - wy;\n\n out[1] = xy - wz;\n out[4] = 1 - (xx + zz);\n out[7] = yz + wx;\n\n out[2] = xz + wy;\n out[5] = yz - wx;\n out[8] = 1 - (xx + yy);\n\n return this;\n },\n\n /**\n * Set the values of this Matrix3 to be normalized from the given Matrix4.\n *\n * @method Phaser.Math.Matrix3#normalFromMat4\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from.\n *\n * @return {Phaser.Math.Matrix3} This Matrix3.\n */\n normalFromMat4: function (m)\n {\n var a = m.val;\n var out = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15];\n\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det)\n {\n return null;\n }\n\n det = 1 / det;\n\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n\n return this;\n }\n\n});\n\nmodule.exports = Matrix3;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../utils/Class');\nvar Vector3 = require('./Vector3');\n\n/**\n * @ignore\n */\nvar EPSILON = 0.000001;\n\n/**\n * @classdesc\n * A four-dimensional matrix.\n *\n * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\n * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\n *\n * @class Matrix4\n * @memberof Phaser.Math\n * @constructor\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from.\n */\nvar Matrix4 = new Class({\n\n initialize:\n\n function Matrix4 (m)\n {\n /**\n * The matrix values.\n *\n * @name Phaser.Math.Matrix4#val\n * @type {Float32Array}\n * @since 3.0.0\n */\n this.val = new Float32Array(16);\n\n if (m)\n {\n // Assume Matrix4 with val:\n this.copy(m);\n }\n else\n {\n // Default to identity\n this.identity();\n }\n },\n\n /**\n * Make a clone of this Matrix4.\n *\n * @method Phaser.Math.Matrix4#clone\n * @since 3.0.0\n *\n * @return {Phaser.Math.Matrix4} A clone of this Matrix4.\n */\n clone: function ()\n {\n return new Matrix4(this);\n },\n\n /**\n * This method is an alias for `Matrix4.copy`.\n *\n * @method Phaser.Math.Matrix4#set\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from.\n *\n * @return {this} This Matrix4.\n */\n set: function (src)\n {\n return this.copy(src);\n },\n\n /**\n * Sets all values of this Matrix4.\n *\n * @method Phaser.Math.Matrix4#setValues\n * @since 3.50.0\n *\n * @param {number} m00 - The m00 value.\n * @param {number} m01 - The m01 value.\n * @param {number} m02 - The m02 value.\n * @param {number} m03 - The m03 value.\n * @param {number} m10 - The m10 value.\n * @param {number} m11 - The m11 value.\n * @param {number} m12 - The m12 value.\n * @param {number} m13 - The m13 value.\n * @param {number} m20 - The m20 value.\n * @param {number} m21 - The m21 value.\n * @param {number} m22 - The m22 value.\n * @param {number} m23 - The m23 value.\n * @param {number} m30 - The m30 value.\n * @param {number} m31 - The m31 value.\n * @param {number} m32 - The m32 value.\n * @param {number} m33 - The m33 value.\n *\n * @return {this} This Matrix4 instance.\n */\n setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33)\n {\n var out = this.val;\n\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n\n return this;\n },\n\n /**\n * Copy the values of a given Matrix into this Matrix.\n *\n * @method Phaser.Math.Matrix4#copy\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from.\n *\n * @return {this} This Matrix4.\n */\n copy: function (src)\n {\n var a = src.val;\n\n return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n },\n\n /**\n * Set the values of this Matrix from the given array.\n *\n * @method Phaser.Math.Matrix4#fromArray\n * @since 3.0.0\n *\n * @param {number[]} a - The array to copy the values from. Must have at least 16 elements.\n *\n * @return {this} This Matrix4.\n */\n fromArray: function (a)\n {\n return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n },\n\n /**\n * Reset this Matrix.\n *\n * Sets all values to `0`.\n *\n * @method Phaser.Math.Matrix4#zero\n * @since 3.0.0\n *\n * @return {Phaser.Math.Matrix4} This Matrix4.\n */\n zero: function ()\n {\n return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n },\n\n /**\n * Generates a transform matrix based on the given position, scale and rotation.\n *\n * @method Phaser.Math.Matrix4#transform\n * @since 3.50.0\n *\n * @param {Phaser.Math.Vector3} position - The position vector.\n * @param {Phaser.Math.Vector3} scale - The scale vector.\n * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion.\n *\n * @return {this} This Matrix4.\n */\n transform: function (position, scale, rotation)\n {\n var rotMatrix = _tempMat1.fromQuat(rotation);\n\n var rm = rotMatrix.val;\n\n var sx = scale.x;\n var sy = scale.y;\n var sz = scale.z;\n\n return this.setValues(\n rm[0] * sx,\n rm[1] * sx,\n rm[2] * sx,\n 0,\n\n rm[4] * sy,\n rm[5] * sy,\n rm[6] * sy,\n 0,\n\n rm[8] * sz,\n rm[9] * sz,\n rm[10] * sz,\n 0,\n\n position.x,\n position.y,\n position.z,\n 1\n );\n },\n\n /**\n * Set the `x`, `y` and `z` values of this Matrix.\n *\n * @method Phaser.Math.Matrix4#xyz\n * @since 3.0.0\n *\n * @param {number} x - The x value.\n * @param {number} y - The y value.\n * @param {number} z - The z value.\n *\n * @return {this} This Matrix4.\n */\n xyz: function (x, y, z)\n {\n this.identity();\n\n var out = this.val;\n\n out[12] = x;\n out[13] = y;\n out[14] = z;\n\n return this;\n },\n\n /**\n * Set the scaling values of this Matrix.\n *\n * @method Phaser.Math.Matrix4#scaling\n * @since 3.0.0\n *\n * @param {number} x - The x scaling value.\n * @param {number} y - The y scaling value.\n * @param {number} z - The z scaling value.\n *\n * @return {this} This Matrix4.\n */\n scaling: function (x, y, z)\n {\n this.zero();\n\n var out = this.val;\n\n out[0] = x;\n out[5] = y;\n out[10] = z;\n out[15] = 1;\n\n return this;\n },\n\n /**\n * Reset this Matrix to an identity (default) matrix.\n *\n * @method Phaser.Math.Matrix4#identity\n * @since 3.0.0\n *\n * @return {this} This Matrix4.\n */\n identity: function ()\n {\n return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n },\n\n /**\n * Transpose this Matrix.\n *\n * @method Phaser.Math.Matrix4#transpose\n * @since 3.0.0\n *\n * @return {this} This Matrix4.\n */\n transpose: function ()\n {\n var a = this.val;\n\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a12 = a[6];\n var a13 = a[7];\n var a23 = a[11];\n\n a[1] = a[4];\n a[2] = a[8];\n a[3] = a[12];\n a[4] = a01;\n a[6] = a[9];\n a[7] = a[13];\n a[8] = a02;\n a[9] = a12;\n a[11] = a[14];\n a[12] = a03;\n a[13] = a13;\n a[14] = a23;\n\n return this;\n },\n\n /**\n * Copies the given Matrix4 into this Matrix and then inverses it.\n *\n * @method Phaser.Math.Matrix4#getInverse\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4.\n *\n * @return {this} This Matrix4.\n */\n getInverse: function (m)\n {\n this.copy(m);\n\n return this.invert();\n },\n\n /**\n * Invert this Matrix.\n *\n * @method Phaser.Math.Matrix4#invert\n * @since 3.0.0\n *\n * @return {this} This Matrix4.\n */\n invert: function ()\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15];\n\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det)\n {\n return this;\n }\n\n det = 1 / det;\n\n return this.setValues(\n (a11 * b11 - a12 * b10 + a13 * b09) * det,\n (a02 * b10 - a01 * b11 - a03 * b09) * det,\n (a31 * b05 - a32 * b04 + a33 * b03) * det,\n (a22 * b04 - a21 * b05 - a23 * b03) * det,\n (a12 * b08 - a10 * b11 - a13 * b07) * det,\n (a00 * b11 - a02 * b08 + a03 * b07) * det,\n (a32 * b02 - a30 * b05 - a33 * b01) * det,\n (a20 * b05 - a22 * b02 + a23 * b01) * det,\n (a10 * b10 - a11 * b08 + a13 * b06) * det,\n (a01 * b08 - a00 * b10 - a03 * b06) * det,\n (a30 * b04 - a31 * b02 + a33 * b00) * det,\n (a21 * b02 - a20 * b04 - a23 * b00) * det,\n (a11 * b07 - a10 * b09 - a12 * b06) * det,\n (a00 * b09 - a01 * b07 + a02 * b06) * det,\n (a31 * b01 - a30 * b03 - a32 * b00) * det,\n (a20 * b03 - a21 * b01 + a22 * b00) * det\n );\n },\n\n /**\n * Calculate the adjoint, or adjugate, of this Matrix.\n *\n * @method Phaser.Math.Matrix4#adjoint\n * @since 3.0.0\n *\n * @return {this} This Matrix4.\n */\n adjoint: function ()\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15];\n\n return this.setValues(\n (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)),\n -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)),\n (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)),\n -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)),\n -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)),\n (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)),\n -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)),\n (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)),\n (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)),\n -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)),\n (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)),\n -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)),\n -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)),\n (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)),\n -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)),\n (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11))\n );\n },\n\n /**\n * Calculate the determinant of this Matrix.\n *\n * @method Phaser.Math.Matrix4#determinant\n * @since 3.0.0\n *\n * @return {number} The determinant of this Matrix.\n */\n determinant: function ()\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15];\n\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32;\n\n // Calculate the determinant\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n },\n\n /**\n * Multiply this Matrix by the given Matrix.\n *\n * @method Phaser.Math.Matrix4#multiply\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by.\n *\n * @return {this} This Matrix4.\n */\n multiply: function (src)\n {\n var a = this.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15];\n\n var b = src.val;\n\n // Cache only the current line of the second matrix\n var b0 = b[0];\n var b1 = b[1];\n var b2 = b[2];\n var b3 = b[3];\n\n a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n\n a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n\n a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n\n a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n\n return this;\n },\n\n /**\n * Multiply the values of this Matrix4 by those given in the `src` argument.\n *\n * @method Phaser.Math.Matrix4#multiplyLocal\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by.\n *\n * @return {this} This Matrix4.\n */\n multiplyLocal: function (src)\n {\n var a = this.val;\n var b = src.val;\n\n return this.setValues(\n a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12],\n a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13],\n a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14],\n a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15],\n\n a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12],\n a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13],\n a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14],\n a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15],\n\n a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12],\n a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13],\n a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14],\n a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15],\n\n a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12],\n a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13],\n a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14],\n a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15]\n );\n },\n\n /**\n * Multiplies the given Matrix4 object with this Matrix.\n *\n * This is the same as calling `multiplyMatrices(m, this)`.\n *\n * @method Phaser.Math.Matrix4#premultiply\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one.\n *\n * @return {this} This Matrix4.\n */\n premultiply: function (m)\n {\n return this.multiplyMatrices(m, this);\n },\n\n /**\n * Multiplies the two given Matrix4 objects and stores the results in this Matrix.\n *\n * @method Phaser.Math.Matrix4#multiplyMatrices\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply.\n * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply.\n *\n * @return {this} This Matrix4.\n */\n multiplyMatrices: function (a, b)\n {\n var am = a.val;\n var bm = b.val;\n\n var a11 = am[0];\n var a12 = am[4];\n var a13 = am[8];\n var a14 = am[12];\n var a21 = am[1];\n var a22 = am[5];\n var a23 = am[9];\n var a24 = am[13];\n var a31 = am[2];\n var a32 = am[6];\n var a33 = am[10];\n var a34 = am[14];\n var a41 = am[3];\n var a42 = am[7];\n var a43 = am[11];\n var a44 = am[15];\n\n var b11 = bm[0];\n var b12 = bm[4];\n var b13 = bm[8];\n var b14 = bm[12];\n var b21 = bm[1];\n var b22 = bm[5];\n var b23 = bm[9];\n var b24 = bm[13];\n var b31 = bm[2];\n var b32 = bm[6];\n var b33 = bm[10];\n var b34 = bm[14];\n var b41 = bm[3];\n var b42 = bm[7];\n var b43 = bm[11];\n var b44 = bm[15];\n\n return this.setValues(\n a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41,\n a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41,\n a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41,\n a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41,\n a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42,\n a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42,\n a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42,\n a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42,\n a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43,\n a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43,\n a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43,\n a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43,\n a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44,\n a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44,\n a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44,\n a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44\n );\n },\n\n /**\n * Translate this Matrix using the given Vector.\n *\n * @method Phaser.Math.Matrix4#translate\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with.\n *\n * @return {this} This Matrix4.\n */\n translate: function (v)\n {\n return this.translateXYZ(v.x, v.y, v.z);\n },\n\n /**\n * Translate this Matrix using the given values.\n *\n * @method Phaser.Math.Matrix4#translateXYZ\n * @since 3.16.0\n *\n * @param {number} x - The x component.\n * @param {number} y - The y component.\n * @param {number} z - The z component.\n *\n * @return {this} This Matrix4.\n */\n translateXYZ: function (x, y, z)\n {\n var a = this.val;\n\n a[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n a[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n a[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n a[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n\n return this;\n },\n\n /**\n * Apply a scale transformation to this Matrix.\n *\n * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix.\n *\n * @method Phaser.Math.Matrix4#scale\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with.\n *\n * @return {this} This Matrix4.\n */\n scale: function (v)\n {\n return this.scaleXYZ(v.x, v.y, v.z);\n },\n\n /**\n * Apply a scale transformation to this Matrix.\n *\n * @method Phaser.Math.Matrix4#scaleXYZ\n * @since 3.16.0\n *\n * @param {number} x - The x component.\n * @param {number} y - The y component.\n * @param {number} z - The z component.\n *\n * @return {this} This Matrix4.\n */\n scaleXYZ: function (x, y, z)\n {\n var a = this.val;\n\n a[0] = a[0] * x;\n a[1] = a[1] * x;\n a[2] = a[2] * x;\n a[3] = a[3] * x;\n\n a[4] = a[4] * y;\n a[5] = a[5] * y;\n a[6] = a[6] * y;\n a[7] = a[7] * y;\n\n a[8] = a[8] * z;\n a[9] = a[9] * z;\n a[10] = a[10] * z;\n a[11] = a[11] * z;\n\n return this;\n },\n\n /**\n * Derive a rotation matrix around the given axis.\n *\n * @method Phaser.Math.Matrix4#makeRotationAxis\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis.\n * @param {number} angle - The rotation angle in radians.\n *\n * @return {this} This Matrix4.\n */\n makeRotationAxis: function (axis, angle)\n {\n // Based on http://www.gamedev.net/reference/articles/article1199.asp\n\n var c = Math.cos(angle);\n var s = Math.sin(angle);\n var t = 1 - c;\n var x = axis.x;\n var y = axis.y;\n var z = axis.z;\n var tx = t * x;\n var ty = t * y;\n\n return this.setValues(\n tx * x + c, tx * y - s * z, tx * z + s * y, 0,\n tx * y + s * z, ty * y + c, ty * z - s * x, 0,\n tx * z - s * y, ty * z + s * x, t * z * z + c, 0,\n 0, 0, 0, 1\n );\n },\n\n /**\n * Apply a rotation transformation to this Matrix.\n *\n * @method Phaser.Math.Matrix4#rotate\n * @since 3.0.0\n *\n * @param {number} rad - The angle in radians to rotate by.\n * @param {Phaser.Math.Vector3} axis - The axis to rotate upon.\n *\n * @return {this} This Matrix4.\n */\n rotate: function (rad, axis)\n {\n var a = this.val;\n var x = axis.x;\n var y = axis.y;\n var z = axis.z;\n var len = Math.sqrt(x * x + y * y + z * z);\n\n if (Math.abs(len) < EPSILON)\n {\n return this;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var t = 1 - c;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15];\n\n // Construct the elements of the rotation matrix\n var b00 = x * x * t + c;\n var b01 = y * x * t + z * s;\n var b02 = z * x * t - y * s;\n\n var b10 = x * y * t - z * s;\n var b11 = y * y * t + c;\n var b12 = z * y * t + x * s;\n\n var b20 = x * z * t + y * s;\n var b21 = y * z * t - x * s;\n var b22 = z * z * t + c;\n\n // Perform rotation-specific matrix multiplication\n return this.setValues(\n a00 * b00 + a10 * b01 + a20 * b02,\n a01 * b00 + a11 * b01 + a21 * b02,\n a02 * b00 + a12 * b01 + a22 * b02,\n a03 * b00 + a13 * b01 + a23 * b02,\n a00 * b10 + a10 * b11 + a20 * b12,\n a01 * b10 + a11 * b11 + a21 * b12,\n a02 * b10 + a12 * b11 + a22 * b12,\n a03 * b10 + a13 * b11 + a23 * b12,\n a00 * b20 + a10 * b21 + a20 * b22,\n a01 * b20 + a11 * b21 + a21 * b22,\n a02 * b20 + a12 * b21 + a22 * b22,\n a03 * b20 + a13 * b21 + a23 * b22,\n a30, a31, a32, a33\n );\n },\n\n /**\n * Rotate this matrix on its X axis.\n *\n * @method Phaser.Math.Matrix4#rotateX\n * @since 3.0.0\n *\n * @param {number} rad - The angle in radians to rotate by.\n *\n * @return {this} This Matrix4.\n */\n rotateX: function (rad)\n {\n var a = this.val;\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n // Perform axis-specific matrix multiplication\n a[4] = a10 * c + a20 * s;\n a[5] = a11 * c + a21 * s;\n a[6] = a12 * c + a22 * s;\n a[7] = a13 * c + a23 * s;\n a[8] = a20 * c - a10 * s;\n a[9] = a21 * c - a11 * s;\n a[10] = a22 * c - a12 * s;\n a[11] = a23 * c - a13 * s;\n\n return this;\n },\n\n /**\n * Rotate this matrix on its Y axis.\n *\n * @method Phaser.Math.Matrix4#rotateY\n * @since 3.0.0\n *\n * @param {number} rad - The angle to rotate by, in radians.\n *\n * @return {this} This Matrix4.\n */\n rotateY: function (rad)\n {\n var a = this.val;\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n // Perform axis-specific matrix multiplication\n a[0] = a00 * c - a20 * s;\n a[1] = a01 * c - a21 * s;\n a[2] = a02 * c - a22 * s;\n a[3] = a03 * c - a23 * s;\n a[8] = a00 * s + a20 * c;\n a[9] = a01 * s + a21 * c;\n a[10] = a02 * s + a22 * c;\n a[11] = a03 * s + a23 * c;\n\n return this;\n },\n\n /**\n * Rotate this matrix on its Z axis.\n *\n * @method Phaser.Math.Matrix4#rotateZ\n * @since 3.0.0\n *\n * @param {number} rad - The angle to rotate by, in radians.\n *\n * @return {this} This Matrix4.\n */\n rotateZ: function (rad)\n {\n var a = this.val;\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n // Perform axis-specific matrix multiplication\n a[0] = a00 * c + a10 * s;\n a[1] = a01 * c + a11 * s;\n a[2] = a02 * c + a12 * s;\n a[3] = a03 * c + a13 * s;\n a[4] = a10 * c - a00 * s;\n a[5] = a11 * c - a01 * s;\n a[6] = a12 * c - a02 * s;\n a[7] = a13 * c - a03 * s;\n\n return this;\n },\n\n /**\n * Set the values of this Matrix from the given rotation Quaternion and translation Vector.\n *\n * @method Phaser.Math.Matrix4#fromRotationTranslation\n * @since 3.0.0\n *\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from.\n * @param {Phaser.Math.Vector3} v - The Vector to set translation from.\n *\n * @return {this} This Matrix4.\n */\n fromRotationTranslation: function (q, v)\n {\n // Quaternion math\n var x = q.x;\n var y = q.y;\n var z = q.z;\n var w = q.w;\n\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n\n return this.setValues(\n 1 - (yy + zz),\n xy + wz,\n xz - wy,\n 0,\n\n xy - wz,\n 1 - (xx + zz),\n yz + wx,\n 0,\n\n xz + wy,\n yz - wx,\n 1 - (xx + yy),\n 0,\n\n v.x,\n v.y,\n v.z,\n 1\n );\n },\n\n /**\n * Set the values of this Matrix from the given Quaternion.\n *\n * @method Phaser.Math.Matrix4#fromQuat\n * @since 3.0.0\n *\n * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from.\n *\n * @return {this} This Matrix4.\n */\n fromQuat: function (q)\n {\n var x = q.x;\n var y = q.y;\n var z = q.z;\n var w = q.w;\n\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n\n return this.setValues(\n 1 - (yy + zz),\n xy + wz,\n xz - wy,\n 0,\n\n xy - wz,\n 1 - (xx + zz),\n yz + wx,\n 0,\n\n xz + wy,\n yz - wx,\n 1 - (xx + yy),\n 0,\n\n 0,\n 0,\n 0,\n 1\n );\n },\n\n /**\n * Generate a frustum matrix with the given bounds.\n *\n * @method Phaser.Math.Matrix4#frustum\n * @since 3.0.0\n *\n * @param {number} left - The left bound of the frustum.\n * @param {number} right - The right bound of the frustum.\n * @param {number} bottom - The bottom bound of the frustum.\n * @param {number} top - The top bound of the frustum.\n * @param {number} near - The near bound of the frustum.\n * @param {number} far - The far bound of the frustum.\n *\n * @return {this} This Matrix4.\n */\n frustum: function (left, right, bottom, top, near, far)\n {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n\n return this.setValues(\n (near * 2) * rl,\n 0,\n 0,\n 0,\n\n 0,\n (near * 2) * tb,\n 0,\n 0,\n\n (right + left) * rl,\n (top + bottom) * tb,\n (far + near) * nf,\n -1,\n\n 0,\n 0,\n (far * near * 2) * nf,\n 0\n );\n },\n\n /**\n * Generate a perspective projection matrix with the given bounds.\n *\n * @method Phaser.Math.Matrix4#perspective\n * @since 3.0.0\n *\n * @param {number} fovy - Vertical field of view in radians\n * @param {number} aspect - Aspect ratio. Typically viewport width /height.\n * @param {number} near - Near bound of the frustum.\n * @param {number} far - Far bound of the frustum.\n *\n * @return {this} This Matrix4.\n */\n perspective: function (fovy, aspect, near, far)\n {\n var f = 1.0 / Math.tan(fovy / 2);\n var nf = 1 / (near - far);\n\n return this.setValues(\n f / aspect,\n 0,\n 0,\n 0,\n\n 0,\n f,\n 0,\n 0,\n\n 0,\n 0,\n (far + near) * nf,\n -1,\n\n 0,\n 0,\n (2 * far * near) * nf,\n 0\n );\n },\n\n /**\n * Generate a perspective projection matrix with the given bounds.\n *\n * @method Phaser.Math.Matrix4#perspectiveLH\n * @since 3.0.0\n *\n * @param {number} width - The width of the frustum.\n * @param {number} height - The height of the frustum.\n * @param {number} near - Near bound of the frustum.\n * @param {number} far - Far bound of the frustum.\n *\n * @return {this} This Matrix4.\n */\n perspectiveLH: function (width, height, near, far)\n {\n return this.setValues(\n (2 * near) / width,\n 0,\n 0,\n 0,\n\n 0,\n (2 * near) / height,\n 0,\n 0,\n\n 0,\n 0,\n -far / (near - far),\n 1,\n\n 0,\n 0,\n (near * far) / (near - far),\n 0\n );\n },\n\n /**\n * Generate an orthogonal projection matrix with the given bounds.\n *\n * @method Phaser.Math.Matrix4#ortho\n * @since 3.0.0\n *\n * @param {number} left - The left bound of the frustum.\n * @param {number} right - The right bound of the frustum.\n * @param {number} bottom - The bottom bound of the frustum.\n * @param {number} top - The top bound of the frustum.\n * @param {number} near - The near bound of the frustum.\n * @param {number} far - The far bound of the frustum.\n *\n * @return {this} This Matrix4.\n */\n ortho: function (left, right, bottom, top, near, far)\n {\n var lr = left - right;\n var bt = bottom - top;\n var nf = near - far;\n\n // Avoid division by zero\n lr = (lr === 0) ? lr : 1 / lr;\n bt = (bt === 0) ? bt : 1 / bt;\n nf = (nf === 0) ? nf : 1 / nf;\n\n return this.setValues(\n -2 * lr,\n 0,\n 0,\n 0,\n\n 0,\n -2 * bt,\n 0,\n 0,\n\n 0,\n 0,\n 2 * nf,\n 0,\n\n (left + right) * lr,\n (top + bottom) * bt,\n (far + near) * nf,\n 1\n );\n },\n\n /**\n * Generate a right-handed look-at matrix with the given eye position, target and up axis.\n *\n * @method Phaser.Math.Matrix4#lookAtRH\n * @since 3.50.0\n *\n * @param {Phaser.Math.Vector3} eye - Position of the viewer.\n * @param {Phaser.Math.Vector3} target - Point the viewer is looking at.\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\n *\n * @return {this} This Matrix4.\n */\n lookAtRH: function (eye, target, up)\n {\n var m = this.val;\n\n _z.subVectors(eye, target);\n\n if (_z.getLengthSquared() === 0)\n {\n // eye and target are in the same position\n _z.z = 1;\n }\n\n _z.normalize();\n _x.crossVectors(up, _z);\n\n if (_x.getLengthSquared() === 0)\n {\n // up and z are parallel\n\n if (Math.abs(up.z) === 1)\n {\n _z.x += 0.0001;\n }\n else\n {\n _z.z += 0.0001;\n }\n\n _z.normalize();\n _x.crossVectors(up, _z);\n }\n\n _x.normalize();\n _y.crossVectors(_z, _x);\n\n m[0] = _x.x;\n m[1] = _x.y;\n m[2] = _x.z;\n m[4] = _y.x;\n m[5] = _y.y;\n m[6] = _y.z;\n m[8] = _z.x;\n m[9] = _z.y;\n m[10] = _z.z;\n\n return this;\n },\n\n /**\n * Generate a look-at matrix with the given eye position, focal point, and up axis.\n *\n * @method Phaser.Math.Matrix4#lookAt\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} eye - Position of the viewer\n * @param {Phaser.Math.Vector3} center - Point the viewer is looking at\n * @param {Phaser.Math.Vector3} up - vec3 pointing up.\n *\n * @return {this} This Matrix4.\n */\n lookAt: function (eye, center, up)\n {\n var eyex = eye.x;\n var eyey = eye.y;\n var eyez = eye.z;\n\n var upx = up.x;\n var upy = up.y;\n var upz = up.z;\n\n var centerx = center.x;\n var centery = center.y;\n var centerz = center.z;\n\n if (Math.abs(eyex - centerx) < EPSILON &&\n Math.abs(eyey - centery) < EPSILON &&\n Math.abs(eyez - centerz) < EPSILON)\n {\n return this.identity();\n }\n\n var z0 = eyex - centerx;\n var z1 = eyey - centery;\n var z2 = eyez - centerz;\n\n var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2);\n\n z0 *= len;\n z1 *= len;\n z2 *= len;\n\n var x0 = upy * z2 - upz * z1;\n var x1 = upz * z0 - upx * z2;\n var x2 = upx * z1 - upy * z0;\n\n len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2);\n\n if (!len)\n {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n }\n else\n {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n var y0 = z1 * x2 - z2 * x1;\n var y1 = z2 * x0 - z0 * x2;\n var y2 = z0 * x1 - z1 * x0;\n\n len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2);\n\n if (!len)\n {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n }\n else\n {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n return this.setValues(\n x0,\n y0,\n z0,\n 0,\n\n x1,\n y1,\n z1,\n 0,\n\n x2,\n y2,\n z2,\n 0,\n\n -(x0 * eyex + x1 * eyey + x2 * eyez),\n -(y0 * eyex + y1 * eyey + y2 * eyez),\n -(z0 * eyex + z1 * eyey + z2 * eyez),\n 1\n );\n },\n\n /**\n * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values.\n *\n * @method Phaser.Math.Matrix4#yawPitchRoll\n * @since 3.0.0\n *\n * @param {number} yaw - The yaw value.\n * @param {number} pitch - The pitch value.\n * @param {number} roll - The roll value.\n *\n * @return {this} This Matrix4.\n */\n yawPitchRoll: function (yaw, pitch, roll)\n {\n this.zero();\n _tempMat1.zero();\n _tempMat2.zero();\n\n var m0 = this.val;\n var m1 = _tempMat1.val;\n var m2 = _tempMat2.val;\n\n // Rotate Z\n var s = Math.sin(roll);\n var c = Math.cos(roll);\n\n m0[10] = 1;\n m0[15] = 1;\n m0[0] = c;\n m0[1] = s;\n m0[4] = -s;\n m0[5] = c;\n\n // Rotate X\n s = Math.sin(pitch);\n c = Math.cos(pitch);\n\n m1[0] = 1;\n m1[15] = 1;\n m1[5] = c;\n m1[10] = c;\n m1[9] = -s;\n m1[6] = s;\n\n // Rotate Y\n s = Math.sin(yaw);\n c = Math.cos(yaw);\n\n m2[5] = 1;\n m2[15] = 1;\n m2[0] = c;\n m2[2] = -s;\n m2[8] = s;\n m2[10] = c;\n\n this.multiplyLocal(_tempMat1);\n this.multiplyLocal(_tempMat2);\n\n return this;\n },\n\n /**\n * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix.\n *\n * @method Phaser.Math.Matrix4#setWorldMatrix\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix.\n * @param {Phaser.Math.Vector3} position - The position of the world matrix.\n * @param {Phaser.Math.Vector3} scale - The scale of the world matrix.\n * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix.\n * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix.\n *\n * @return {this} This Matrix4.\n */\n setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix)\n {\n this.yawPitchRoll(rotation.y, rotation.x, rotation.z);\n\n _tempMat1.scaling(scale.x, scale.y, scale.z);\n _tempMat2.xyz(position.x, position.y, position.z);\n\n this.multiplyLocal(_tempMat1);\n this.multiplyLocal(_tempMat2);\n\n if (viewMatrix)\n {\n this.multiplyLocal(viewMatrix);\n }\n\n if (projectionMatrix)\n {\n this.multiplyLocal(projectionMatrix);\n }\n\n return this;\n },\n\n /**\n * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4.\n *\n * @method Phaser.Math.Matrix4#multiplyToMat4\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one.\n * @param {Phaser.Math.Matrix4} out - The receiving Matrix.\n *\n * @return {Phaser.Math.Matrix4} This `out` Matrix4.\n */\n multiplyToMat4: function (src, out)\n {\n var a = this.val;\n var b = src.val;\n\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n var a30 = a[12];\n var a31 = a[13];\n var a32 = a[14];\n var a33 = a[15];\n\n var b00 = b[0];\n var b01 = b[1];\n var b02 = b[2];\n var b03 = b[3];\n var b10 = b[4];\n var b11 = b[5];\n var b12 = b[6];\n var b13 = b[7];\n var b20 = b[8];\n var b21 = b[9];\n var b22 = b[10];\n var b23 = b[11];\n var b30 = b[12];\n var b31 = b[13];\n var b32 = b[14];\n var b33 = b[15];\n\n return out.setValues(\n b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30,\n b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31,\n b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32,\n b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33,\n\n b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30,\n b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31,\n b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32,\n b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33,\n\n b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30,\n b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31,\n b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32,\n b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33,\n\n b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30,\n b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31,\n b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32,\n b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33\n );\n },\n\n /**\n * Takes the rotation and position vectors and builds this Matrix4 from them.\n *\n * @method Phaser.Math.Matrix4#fromRotationXYTranslation\n * @since 3.50.0\n *\n * @param {Phaser.Math.Vector3} rotation - The rotation vector.\n * @param {Phaser.Math.Vector3} position - The position vector.\n * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`)\n *\n * @return {this} This Matrix4.\n */\n fromRotationXYTranslation: function (rotation, position, translateFirst)\n {\n var x = position.x;\n var y = position.y;\n var z = position.z;\n\n var sx = Math.sin(rotation.x);\n var cx = Math.cos(rotation.x);\n\n var sy = Math.sin(rotation.y);\n var cy = Math.cos(rotation.y);\n\n var a30 = x;\n var a31 = y;\n var a32 = z;\n\n // Rotate X\n\n var b21 = -sx;\n\n // Rotate Y\n\n var c01 = 0 - b21 * sy;\n\n var c02 = 0 - cx * sy;\n\n var c21 = b21 * cy;\n\n var c22 = cx * cy;\n\n // Translate\n if (!translateFirst)\n {\n // a30 = cy * x + 0 * y + sy * z;\n a30 = cy * x + sy * z;\n a31 = c01 * x + cx * y + c21 * z;\n a32 = c02 * x + sx * y + c22 * z;\n }\n\n return this.setValues(\n cy,\n c01,\n c02,\n 0,\n 0,\n cx,\n sx,\n 0,\n sy,\n c21,\n c22,\n 0,\n a30,\n a31,\n a32,\n 1\n );\n },\n\n /**\n * Returns the maximum axis scale from this Matrix4.\n *\n * @method Phaser.Math.Matrix4#getMaxScaleOnAxis\n * @since 3.50.0\n *\n * @return {number} The maximum axis scale.\n */\n getMaxScaleOnAxis: function ()\n {\n var m = this.val;\n\n var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2];\n var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6];\n var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10];\n\n return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n }\n\n});\n\n/**\n * @ignore\n */\nvar _tempMat1 = new Matrix4();\n\n/**\n * @ignore\n */\nvar _tempMat2 = new Matrix4();\n\n/**\n * @ignore\n */\nvar _x = new Vector3();\n\n/**\n * @ignore\n */\nvar _y = new Vector3();\n\n/**\n * @ignore\n */\nvar _z = new Vector3();\n\nmodule.exports = Matrix4;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Add an `amount` to a `value`, limiting the maximum result to `max`.\n *\n * @function Phaser.Math.MaxAdd\n * @since 3.0.0\n *\n * @param {number} value - The value to add to.\n * @param {number} amount - The amount to add.\n * @param {number} max - The maximum value to return.\n *\n * @return {number} The resulting value.\n */\nvar MaxAdd = function (value, amount, max)\n{\n return Math.min(value + amount, max);\n};\n\nmodule.exports = MaxAdd;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Subtract an `amount` from `value`, limiting the minimum result to `min`.\n *\n * @function Phaser.Math.MinSub\n * @since 3.0.0\n *\n * @param {number} value - The value to subtract from.\n * @param {number} amount - The amount to subtract.\n * @param {number} min - The minimum value to return.\n *\n * @return {number} The resulting value.\n */\nvar MinSub = function (value, amount, min)\n{\n return Math.max(value - amount, min);\n};\n\nmodule.exports = MinSub;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Work out what percentage `value` is of the range between `min` and `max`.\n * If `max` isn't given then it will return the percentage of `value` to `min`.\n *\n * You can optionally specify an `upperMax` value, which is a mid-way point in the range that represents 100%, after which the % starts to go down to zero again.\n *\n * @function Phaser.Math.Percent\n * @since 3.0.0\n *\n * @param {number} value - The value to determine the percentage of.\n * @param {number} min - The minimum value.\n * @param {number} [max] - The maximum value.\n * @param {number} [upperMax] - The mid-way point in the range that represents 100%.\n *\n * @return {number} A value between 0 and 1 representing the percentage.\n */\nvar Percent = function (value, min, max, upperMax)\n{\n if (max === undefined) { max = min + 1; }\n\n var percentage = (value - min) / (max - min);\n\n if (percentage > 1)\n {\n if (upperMax !== undefined)\n {\n percentage = ((upperMax - value)) / (upperMax - max);\n\n if (percentage < 0)\n {\n percentage = 0;\n }\n }\n else\n {\n percentage = 1;\n }\n }\n else if (percentage < 0)\n {\n percentage = 0;\n }\n\n return percentage;\n};\n\nmodule.exports = Percent;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\n\nvar Class = require('../utils/Class');\nvar Matrix3 = require('./Matrix3');\nvar NOOP = require('../utils/NOOP');\nvar Vector3 = require('./Vector3');\n\nvar EPSILON = 0.000001;\n\n// Some shared 'private' arrays\nvar siNext = new Int8Array([ 1, 2, 0 ]);\nvar tmp = new Float32Array([ 0, 0, 0 ]);\n\nvar xUnitVec3 = new Vector3(1, 0, 0);\nvar yUnitVec3 = new Vector3(0, 1, 0);\n\nvar tmpvec = new Vector3();\nvar tmpMat3 = new Matrix3();\n\n/**\n * @classdesc\n * A quaternion.\n *\n * @class Quaternion\n * @memberof Phaser.Math\n * @constructor\n * @since 3.0.0\n *\n * @param {number} [x=0] - The x component.\n * @param {number} [y=0] - The y component.\n * @param {number} [z=0] - The z component.\n * @param {number} [w=1] - The w component.\n */\nvar Quaternion = new Class({\n\n initialize:\n\n function Quaternion (x, y, z, w)\n {\n /**\n * The x component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#_x\n * @type {number}\n * @default 0\n * @private\n * @since 3.50.0\n */\n\n /**\n * The y component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#_y\n * @type {number}\n * @default 0\n * @private\n * @since 3.50.0\n */\n\n /**\n * The z component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#_z\n * @type {number}\n * @default 0\n * @private\n * @since 3.50.0\n */\n\n /**\n * The w component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#_w\n * @type {number}\n * @default 0\n * @private\n * @since 3.50.0\n */\n\n /**\n * This callback is invoked, if set, each time a value in this quaternion is changed.\n * The callback is passed one argument, a reference to this quaternion.\n *\n * @name Phaser.Math.Quaternion#onChangeCallback\n * @type {function}\n * @since 3.50.0\n */\n this.onChangeCallback = NOOP;\n\n this.set(x, y, z, w);\n },\n\n /**\n * The x component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n x: {\n get: function ()\n {\n return this._x;\n },\n\n set: function (value)\n {\n this._x = value;\n\n this.onChangeCallback(this);\n }\n },\n\n /**\n * The y component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n y: {\n get: function ()\n {\n return this._y;\n },\n\n set: function (value)\n {\n this._y = value;\n\n this.onChangeCallback(this);\n }\n },\n\n /**\n * The z component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#z\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n z: {\n get: function ()\n {\n return this._z;\n },\n\n set: function (value)\n {\n this._z = value;\n\n this.onChangeCallback(this);\n }\n },\n\n /**\n * The w component of this Quaternion.\n *\n * @name Phaser.Math.Quaternion#w\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n w: {\n get: function ()\n {\n return this._w;\n },\n\n set: function (value)\n {\n this._w = value;\n\n this.onChangeCallback(this);\n }\n },\n\n /**\n * Copy the components of a given Quaternion or Vector into this Quaternion.\n *\n * @method Phaser.Math.Quaternion#copy\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n copy: function (src)\n {\n return this.set(src);\n },\n\n /**\n * Set the components of this Quaternion and optionally call the `onChangeCallback`.\n *\n * @method Phaser.Math.Quaternion#set\n * @since 3.0.0\n *\n * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components.\n * @param {number} [y=0] - The y component.\n * @param {number} [z=0] - The z component.\n * @param {number} [w=0] - The w component.\n * @param {boolean} [update=true] - Call the `onChangeCallback`?\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n set: function (x, y, z, w, update)\n {\n if (update === undefined) { update = true; }\n\n if (typeof x === 'object')\n {\n this._x = x.x || 0;\n this._y = x.y || 0;\n this._z = x.z || 0;\n this._w = x.w || 0;\n }\n else\n {\n this._x = x || 0;\n this._y = y || 0;\n this._z = z || 0;\n this._w = w || 0;\n }\n\n if (update)\n {\n this.onChangeCallback(this);\n }\n\n return this;\n },\n\n /**\n * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise.\n *\n * @method Phaser.Math.Quaternion#add\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n add: function (v)\n {\n this._x += v.x;\n this._y += v.y;\n this._z += v.z;\n this._w += v.w;\n\n this.onChangeCallback(this);\n\n return this;\n },\n\n /**\n * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise.\n *\n * @method Phaser.Math.Quaternion#subtract\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n subtract: function (v)\n {\n this._x -= v.x;\n this._y -= v.y;\n this._z -= v.z;\n this._w -= v.w;\n\n this.onChangeCallback(this);\n\n return this;\n },\n\n /**\n * Scale this Quaternion by the given value.\n *\n * @method Phaser.Math.Quaternion#scale\n * @since 3.0.0\n *\n * @param {number} scale - The value to scale this Quaternion by.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n scale: function (scale)\n {\n this._x *= scale;\n this._y *= scale;\n this._z *= scale;\n this._w *= scale;\n\n this.onChangeCallback(this);\n\n return this;\n },\n\n /**\n * Calculate the length of this Quaternion.\n *\n * @method Phaser.Math.Quaternion#length\n * @since 3.0.0\n *\n * @return {number} The length of this Quaternion.\n */\n length: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var w = this.w;\n\n return Math.sqrt(x * x + y * y + z * z + w * w);\n },\n\n /**\n * Calculate the length of this Quaternion squared.\n *\n * @method Phaser.Math.Quaternion#lengthSq\n * @since 3.0.0\n *\n * @return {number} The length of this Quaternion, squared.\n */\n lengthSq: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var w = this.w;\n\n return x * x + y * y + z * z + w * w;\n },\n\n /**\n * Normalize this Quaternion.\n *\n * @method Phaser.Math.Quaternion#normalize\n * @since 3.0.0\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n normalize: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var w = this.w;\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0)\n {\n len = 1 / Math.sqrt(len);\n\n this._x = x * len;\n this._y = y * len;\n this._z = z * len;\n this._w = w * len;\n }\n\n this.onChangeCallback(this);\n\n return this;\n },\n\n /**\n * Calculate the dot product of this Quaternion and the given Quaternion or Vector.\n *\n * @method Phaser.Math.Quaternion#dot\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion.\n *\n * @return {number} The dot product of this Quaternion and the given Quaternion or Vector.\n */\n dot: function (v)\n {\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n },\n\n /**\n * Linearly interpolate this Quaternion towards the given Quaternion or Vector.\n *\n * @method Phaser.Math.Quaternion#lerp\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards.\n * @param {number} [t=0] - The percentage of interpolation.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n lerp: function (v, t)\n {\n if (t === undefined) { t = 0; }\n\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var aw = this.w;\n\n return this.set(\n ax + t * (v.x - ax),\n ay + t * (v.y - ay),\n az + t * (v.z - az),\n aw + t * (v.w - aw)\n );\n },\n\n /**\n * Rotates this Quaternion based on the two given vectors.\n *\n * @method Phaser.Math.Quaternion#rotationTo\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} a - The transform rotation vector.\n * @param {Phaser.Math.Vector3} b - The target rotation vector.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n rotationTo: function (a, b)\n {\n var dot = a.x * b.x + a.y * b.y + a.z * b.z;\n\n if (dot < -0.999999)\n {\n if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON)\n {\n tmpvec.copy(yUnitVec3).cross(a);\n }\n\n tmpvec.normalize();\n\n return this.setAxisAngle(tmpvec, Math.PI);\n\n }\n else if (dot > 0.999999)\n {\n return this.set(0, 0, 0, 1);\n }\n else\n {\n tmpvec.copy(a).cross(b);\n\n this._x = tmpvec.x;\n this._y = tmpvec.y;\n this._z = tmpvec.z;\n this._w = 1 + dot;\n\n return this.normalize();\n }\n },\n\n /**\n * Set the axes of this Quaternion.\n *\n * @method Phaser.Math.Quaternion#setAxes\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} view - The view axis.\n * @param {Phaser.Math.Vector3} right - The right axis.\n * @param {Phaser.Math.Vector3} up - The upwards axis.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n setAxes: function (view, right, up)\n {\n var m = tmpMat3.val;\n\n m[0] = right.x;\n m[3] = right.y;\n m[6] = right.z;\n\n m[1] = up.x;\n m[4] = up.y;\n m[7] = up.z;\n\n m[2] = -view.x;\n m[5] = -view.y;\n m[8] = -view.z;\n\n return this.fromMat3(tmpMat3).normalize();\n },\n\n /**\n * Reset this Matrix to an identity (default) Quaternion.\n *\n * @method Phaser.Math.Quaternion#identity\n * @since 3.0.0\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n identity: function ()\n {\n return this.set(0, 0, 0, 1);\n },\n\n /**\n * Set the axis angle of this Quaternion.\n *\n * @method Phaser.Math.Quaternion#setAxisAngle\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} axis - The axis.\n * @param {number} rad - The angle in radians.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n setAxisAngle: function (axis, rad)\n {\n rad = rad * 0.5;\n\n var s = Math.sin(rad);\n\n return this.set(\n s * axis.x,\n s * axis.y,\n s * axis.z,\n Math.cos(rad)\n );\n },\n\n /**\n * Multiply this Quaternion by the given Quaternion or Vector.\n *\n * @method Phaser.Math.Quaternion#multiply\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n multiply: function (b)\n {\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var aw = this.w;\n\n var bx = b.x;\n var by = b.y;\n var bz = b.z;\n var bw = b.w;\n\n return this.set(\n ax * bw + aw * bx + ay * bz - az * by,\n ay * bw + aw * by + az * bx - ax * bz,\n az * bw + aw * bz + ax * by - ay * bx,\n aw * bw - ax * bx - ay * by - az * bz\n );\n },\n\n /**\n * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector.\n *\n * @method Phaser.Math.Quaternion#slerp\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards.\n * @param {number} t - The percentage of interpolation.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n slerp: function (b, t)\n {\n // benchmarks: http://jsperf.com/quaternion-slerp-implementations\n\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var aw = this.w;\n\n var bx = b.x;\n var by = b.y;\n var bz = b.z;\n var bw = b.w;\n\n // calc cosine\n var cosom = ax * bx + ay * by + az * bz + aw * bw;\n\n // adjust signs (if necessary)\n if (cosom < 0)\n {\n cosom = -cosom;\n bx = - bx;\n by = - by;\n bz = - bz;\n bw = - bw;\n }\n\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n var scale0 = 1 - t;\n var scale1 = t;\n\n // calculate coefficients\n if ((1 - cosom) > EPSILON)\n {\n // standard case (slerp)\n var omega = Math.acos(cosom);\n var sinom = Math.sin(omega);\n\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n }\n\n // calculate final values\n return this.set(\n scale0 * ax + scale1 * bx,\n scale0 * ay + scale1 * by,\n scale0 * az + scale1 * bz,\n scale0 * aw + scale1 * bw\n );\n },\n\n /**\n * Invert this Quaternion.\n *\n * @method Phaser.Math.Quaternion#invert\n * @since 3.0.0\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n invert: function ()\n {\n var a0 = this.x;\n var a1 = this.y;\n var a2 = this.z;\n var a3 = this.w;\n\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = (dot) ? 1 / dot : 0;\n\n return this.set(\n -a0 * invDot,\n -a1 * invDot,\n -a2 * invDot,\n a3 * invDot\n );\n },\n\n /**\n * Convert this Quaternion into its conjugate.\n *\n * Sets the x, y and z components.\n *\n * @method Phaser.Math.Quaternion#conjugate\n * @since 3.0.0\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n conjugate: function ()\n {\n this._x = -this.x;\n this._y = -this.y;\n this._z = -this.z;\n\n this.onChangeCallback(this);\n\n return this;\n },\n\n /**\n * Rotate this Quaternion on the X axis.\n *\n * @method Phaser.Math.Quaternion#rotateX\n * @since 3.0.0\n *\n * @param {number} rad - The rotation angle in radians.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n rotateX: function (rad)\n {\n rad *= 0.5;\n\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var aw = this.w;\n\n var bx = Math.sin(rad);\n var bw = Math.cos(rad);\n\n return this.set(\n ax * bw + aw * bx,\n ay * bw + az * bx,\n az * bw - ay * bx,\n aw * bw - ax * bx\n );\n },\n\n /**\n * Rotate this Quaternion on the Y axis.\n *\n * @method Phaser.Math.Quaternion#rotateY\n * @since 3.0.0\n *\n * @param {number} rad - The rotation angle in radians.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n rotateY: function (rad)\n {\n rad *= 0.5;\n\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var aw = this.w;\n\n var by = Math.sin(rad);\n var bw = Math.cos(rad);\n\n return this.set(\n ax * bw - az * by,\n ay * bw + aw * by,\n az * bw + ax * by,\n aw * bw - ay * by\n );\n },\n\n /**\n * Rotate this Quaternion on the Z axis.\n *\n * @method Phaser.Math.Quaternion#rotateZ\n * @since 3.0.0\n *\n * @param {number} rad - The rotation angle in radians.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n rotateZ: function (rad)\n {\n rad *= 0.5;\n\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var aw = this.w;\n\n var bz = Math.sin(rad);\n var bw = Math.cos(rad);\n\n return this.set(\n ax * bw + ay * bz,\n ay * bw - ax * bz,\n az * bw + aw * bz,\n aw * bw - az * bz\n );\n },\n\n /**\n * Create a unit (or rotation) Quaternion from its x, y, and z components.\n *\n * Sets the w component.\n *\n * @method Phaser.Math.Quaternion#calculateW\n * @since 3.0.0\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n calculateW: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n\n this.w = -Math.sqrt(1.0 - x * x - y * y - z * z);\n\n return this;\n },\n\n /**\n * Set this Quaternion from the given Euler, based on Euler order.\n *\n * @method Phaser.Math.Quaternion#setFromEuler\n * @since 3.50.0\n *\n * @param {Phaser.Math.Euler} euler - The Euler to convert from.\n * @param {boolean} [update=true] - Run the `onChangeCallback`?\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n setFromEuler: function (euler, update)\n {\n var x = euler.x / 2;\n var y = euler.y / 2;\n var z = euler.z / 2;\n\n var c1 = Math.cos(x);\n var c2 = Math.cos(y);\n var c3 = Math.cos(z);\n\n var s1 = Math.sin(x);\n var s2 = Math.sin(y);\n var s3 = Math.sin(z);\n\n switch (euler.order)\n {\n case 'XYZ':\n {\n this.set(\n s1 * c2 * c3 + c1 * s2 * s3,\n c1 * s2 * c3 - s1 * c2 * s3,\n c1 * c2 * s3 + s1 * s2 * c3,\n c1 * c2 * c3 - s1 * s2 * s3,\n update\n );\n\n break;\n }\n\n case 'YXZ':\n {\n this.set(\n s1 * c2 * c3 + c1 * s2 * s3,\n c1 * s2 * c3 - s1 * c2 * s3,\n c1 * c2 * s3 - s1 * s2 * c3,\n c1 * c2 * c3 + s1 * s2 * s3,\n update\n );\n\n break;\n }\n\n case 'ZXY':\n {\n this.set(\n s1 * c2 * c3 - c1 * s2 * s3,\n c1 * s2 * c3 + s1 * c2 * s3,\n c1 * c2 * s3 + s1 * s2 * c3,\n c1 * c2 * c3 - s1 * s2 * s3,\n update\n );\n\n break;\n }\n\n case 'ZYX':\n {\n this.set(\n s1 * c2 * c3 - c1 * s2 * s3,\n c1 * s2 * c3 + s1 * c2 * s3,\n c1 * c2 * s3 - s1 * s2 * c3,\n c1 * c2 * c3 + s1 * s2 * s3,\n update\n );\n\n break;\n }\n\n case 'YZX':\n {\n this.set(\n s1 * c2 * c3 + c1 * s2 * s3,\n c1 * s2 * c3 + s1 * c2 * s3,\n c1 * c2 * s3 - s1 * s2 * c3,\n c1 * c2 * c3 - s1 * s2 * s3,\n update\n );\n\n break;\n }\n\n case 'XZY':\n {\n this.set(\n s1 * c2 * c3 - c1 * s2 * s3,\n c1 * s2 * c3 - s1 * c2 * s3,\n c1 * c2 * s3 + s1 * s2 * c3,\n c1 * c2 * c3 + s1 * s2 * s3,\n update\n );\n\n break;\n }\n }\n\n return this;\n },\n\n /**\n * Sets the rotation of this Quaternion from the given Matrix4.\n *\n * @method Phaser.Math.Quaternion#setFromRotationMatrix\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n setFromRotationMatrix: function (mat4)\n {\n var m = mat4.val;\n\n var m11 = m[0];\n var m12 = m[4];\n var m13 = m[8];\n var m21 = m[1];\n var m22 = m[5];\n var m23 = m[9];\n var m31 = m[2];\n var m32 = m[6];\n var m33 = m[10];\n\n var trace = m11 + m22 + m33;\n var s;\n\n if (trace > 0)\n {\n s = 0.5 / Math.sqrt(trace + 1.0);\n\n this.set(\n (m32 - m23) * s,\n (m13 - m31) * s,\n (m21 - m12) * s,\n 0.25 / s\n );\n }\n else if (m11 > m22 && m11 > m33)\n {\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\n this.set(\n 0.25 * s,\n (m12 + m21) / s,\n (m13 + m31) / s,\n (m32 - m23) / s\n );\n }\n else if (m22 > m33)\n {\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\n this.set(\n (m12 + m21) / s,\n 0.25 * s,\n (m23 + m32) / s,\n (m13 - m31) / s\n );\n }\n else\n {\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\n this.set(\n (m13 + m31) / s,\n (m23 + m32) / s,\n 0.25 * s,\n (m21 - m12) / s\n );\n }\n\n return this;\n },\n\n /**\n * Convert the given Matrix into this Quaternion.\n *\n * @method Phaser.Math.Quaternion#fromMat3\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from.\n *\n * @return {Phaser.Math.Quaternion} This Quaternion.\n */\n fromMat3: function (mat)\n {\n // benchmarks:\n // http://jsperf.com/typed-array-access-speed\n // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion\n\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var m = mat.val;\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0)\n {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n this.w = 0.5 * fRoot;\n\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n this._x = (m[7] - m[5]) * fRoot;\n this._y = (m[2] - m[6]) * fRoot;\n this._z = (m[3] - m[1]) * fRoot;\n }\n else\n {\n // |w| <= 1/2\n var i = 0;\n\n if (m[4] > m[0])\n {\n i = 1;\n }\n\n if (m[8] > m[i * 3 + i])\n {\n i = 2;\n }\n\n var j = siNext[i];\n var k = siNext[j];\n\n // This isn't quite as clean without array access\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1);\n tmp[i] = 0.5 * fRoot;\n\n fRoot = 0.5 / fRoot;\n\n tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n\n this._x = tmp[0];\n this._y = tmp[1];\n this._z = tmp[2];\n this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot;\n }\n\n this.onChangeCallback(this);\n\n return this;\n }\n\n});\n\nmodule.exports = Quaternion;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar CONST = require('./const');\n\n/**\n * Convert the given angle in radians, to the equivalent angle in degrees.\n *\n * @function Phaser.Math.RadToDeg\n * @since 3.0.0\n *\n * @param {number} radians - The angle in radians to convert ot degrees.\n *\n * @return {number} The given angle converted to degrees.\n */\nvar RadToDeg = function (radians)\n{\n return radians * CONST.RAD_TO_DEG;\n};\n\nmodule.exports = RadToDeg;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Compute a random unit vector.\n *\n * Computes random values for the given vector between -1 and 1 that can be used to represent a direction.\n *\n * Optionally accepts a scale value to scale the resulting vector by.\n *\n * @function Phaser.Math.RandomXY\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} vector - The Vector to compute random values for.\n * @param {number} [scale=1] - The scale of the random values.\n *\n * @return {Phaser.Math.Vector2} The given Vector.\n */\nvar RandomXY = function (vector, scale)\n{\n if (scale === undefined) { scale = 1; }\n\n var r = Math.random() * 2 * Math.PI;\n\n vector.x = Math.cos(r) * scale;\n vector.y = Math.sin(r) * scale;\n\n return vector;\n};\n\nmodule.exports = RandomXY;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Compute a random position vector in a spherical area, optionally defined by the given radius.\n *\n * @function Phaser.Math.RandomXYZ\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} vec3 - The Vector to compute random values for.\n * @param {number} [radius=1] - The radius.\n *\n * @return {Phaser.Math.Vector3} The given Vector.\n */\nvar RandomXYZ = function (vec3, radius)\n{\n if (radius === undefined) { radius = 1; }\n\n var r = Math.random() * 2 * Math.PI;\n var z = (Math.random() * 2) - 1;\n var zScale = Math.sqrt(1 - z * z) * radius;\n\n vec3.x = Math.cos(r) * zScale;\n vec3.y = Math.sin(r) * zScale;\n vec3.z = z * radius;\n\n return vec3;\n};\n\nmodule.exports = RandomXYZ;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Compute a random four-dimensional vector.\n *\n * @function Phaser.Math.RandomXYZW\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector4} vec4 - The Vector to compute random values for.\n * @param {number} [scale=1] - The scale of the random values.\n *\n * @return {Phaser.Math.Vector4} The given Vector.\n */\nvar RandomXYZW = function (vec4, scale)\n{\n if (scale === undefined) { scale = 1; }\n\n // TODO: Not spherical; should fix this for more uniform distribution\n vec4.x = (Math.random() * 2 - 1) * scale;\n vec4.y = (Math.random() * 2 - 1) * scale;\n vec4.z = (Math.random() * 2 - 1) * scale;\n vec4.w = (Math.random() * 2 - 1) * scale;\n\n return vec4;\n};\n\nmodule.exports = RandomXYZW;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Rotate a given point by a given angle around the origin (0, 0), in an anti-clockwise direction.\n *\n * @function Phaser.Math.Rotate\n * @since 3.0.0\n *\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\n * @param {number} angle - The angle to be rotated by in an anticlockwise direction.\n *\n * @return {Phaser.Geom.Point} The given point, rotated by the given angle in an anticlockwise direction.\n */\nvar Rotate = function (point, angle)\n{\n var x = point.x;\n var y = point.y;\n\n point.x = (x * Math.cos(angle)) - (y * Math.sin(angle));\n point.y = (x * Math.sin(angle)) + (y * Math.cos(angle));\n\n return point;\n};\n\nmodule.exports = Rotate;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance.\n *\n * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y).\n *\n * @function Phaser.Math.RotateAround\n * @since 3.0.0\n *\n * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return]\n *\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\n * @param {number} x - The horizontal coordinate to rotate around.\n * @param {number} y - The vertical coordinate to rotate around.\n * @param {number} angle - The angle of rotation in radians.\n *\n * @return {Phaser.Types.Math.Vector2Like} The given point.\n */\nvar RotateAround = function (point, x, y, angle)\n{\n var c = Math.cos(angle);\n var s = Math.sin(angle);\n\n var tx = point.x - x;\n var ty = point.y - y;\n\n point.x = tx * c - ty * s + x;\n point.y = tx * s + ty * c + y;\n\n return point;\n};\n\nmodule.exports = RotateAround;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Rotate a `point` around `x` and `y` by the given `angle` and `distance`.\n *\n * In polar notation, this maps a point from (r, t) to (distance, t + angle), vs. the origin (x, y).\n *\n * @function Phaser.Math.RotateAroundDistance\n * @since 3.0.0\n *\n * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return]\n *\n * @param {(Phaser.Geom.Point|object)} point - The point to be rotated.\n * @param {number} x - The horizontal coordinate to rotate around.\n * @param {number} y - The vertical coordinate to rotate around.\n * @param {number} angle - The angle of rotation in radians.\n * @param {number} distance - The distance from (x, y) to place the point at.\n *\n * @return {Phaser.Types.Math.Vector2Like} The given point.\n */\nvar RotateAroundDistance = function (point, x, y, angle, distance)\n{\n var t = angle + Math.atan2(point.y - y, point.x - x);\n\n point.x = x + (distance * Math.cos(t));\n point.y = y + (distance * Math.sin(t));\n\n return point;\n};\n\nmodule.exports = RotateAroundDistance;\n","/**\n * @author samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Position a `point` at the given `angle` and `distance` to (`x`, `y`).\n *\n * @function Phaser.Math.RotateTo\n * @since 3.24.0\n *\n * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return]\n *\n * @param {Phaser.Types.Math.Vector2Like} point - The point to be positioned.\n * @param {number} x - The horizontal coordinate to position from.\n * @param {number} y - The vertical coordinate to position from.\n * @param {number} angle - The angle of rotation in radians.\n * @param {number} distance - The distance from (x, y) to place the point at.\n *\n * @return {Phaser.Types.Math.Vector2Like} The given point.\n */\nvar RotateTo = function (point, x, y, angle, distance)\n{\n point.x = x + (distance * Math.cos(angle));\n point.y = y + (distance * Math.sin(angle));\n\n return point;\n};\n\nmodule.exports = RotateTo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Vector3 = require('../math/Vector3');\nvar Matrix4 = require('../math/Matrix4');\nvar Quaternion = require('../math/Quaternion');\n\nvar tmpMat4 = new Matrix4();\nvar tmpQuat = new Quaternion();\nvar tmpVec3 = new Vector3();\n\n/**\n * Rotates a vector in place by axis angle.\n *\n * This is the same as transforming a point by an\n * axis-angle quaternion, but it has higher precision.\n *\n * @function Phaser.Math.RotateVec3\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} vec - The vector to be rotated.\n * @param {Phaser.Math.Vector3} axis - The axis to rotate around.\n * @param {number} radians - The angle of rotation in radians.\n *\n * @return {Phaser.Math.Vector3} The given vector.\n */\nvar RotateVec3 = function (vec, axis, radians)\n{\n // Set the quaternion to our axis angle\n tmpQuat.setAxisAngle(axis, radians);\n\n // Create a rotation matrix from the axis angle\n tmpMat4.fromRotationTranslation(tmpQuat, tmpVec3.set(0, 0, 0));\n\n // Multiply our vector by the rotation matrix\n return vec.transformMat4(tmpMat4);\n};\n\nmodule.exports = RotateVec3;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down.\n *\n * @function Phaser.Math.RoundAwayFromZero\n * @since 3.0.0\n *\n * @param {number} value - The number to round.\n *\n * @return {number} The rounded number, rounded away from zero.\n */\nvar RoundAwayFromZero = function (value)\n{\n // \"Opposite\" of truncate.\n return (value > 0) ? Math.ceil(value) : Math.floor(value);\n};\n\nmodule.exports = RoundAwayFromZero;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Round a value to the given precision.\n * \n * For example:\n * \n * ```javascript\n * RoundTo(123.456, 0) = 123\n * RoundTo(123.456, 1) = 120\n * RoundTo(123.456, 2) = 100\n * ```\n * \n * To round the decimal, i.e. to round to precision, pass in a negative `place`:\n * \n * ```javascript\n * RoundTo(123.456789, 0) = 123\n * RoundTo(123.456789, -1) = 123.5\n * RoundTo(123.456789, -2) = 123.46\n * RoundTo(123.456789, -3) = 123.457\n * ```\n *\n * @function Phaser.Math.RoundTo\n * @since 3.0.0\n *\n * @param {number} value - The value to round.\n * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal.\n * @param {number} [base=10] - The base to round in. Default is 10 for decimal.\n *\n * @return {number} The rounded value.\n */\nvar RoundTo = function (value, place, base)\n{\n if (place === undefined) { place = 0; }\n if (base === undefined) { base = 10; }\n\n var p = Math.pow(base, -place);\n\n return Math.round(value * p) / p;\n};\n\nmodule.exports = RoundTo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Generate a series of sine and cosine values.\n *\n * @function Phaser.Math.SinCosTableGenerator\n * @since 3.0.0\n *\n * @param {number} length - The number of values to generate.\n * @param {number} [sinAmp=1] - The sine value amplitude.\n * @param {number} [cosAmp=1] - The cosine value amplitude.\n * @param {number} [frequency=1] - The frequency of the values.\n *\n * @return {Phaser.Types.Math.SinCosTable} The generated values.\n */\nvar SinCosTableGenerator = function (length, sinAmp, cosAmp, frequency)\n{\n if (sinAmp === undefined) { sinAmp = 1; }\n if (cosAmp === undefined) { cosAmp = 1; }\n if (frequency === undefined) { frequency = 1; }\n\n frequency *= Math.PI / length;\n\n var cos = [];\n var sin = [];\n\n for (var c = 0; c < length; c++)\n {\n cosAmp -= sinAmp * frequency;\n sinAmp += cosAmp * frequency;\n\n cos[c] = cosAmp;\n sin[c] = sinAmp;\n }\n\n return {\n sin: sin,\n cos: cos,\n length: length\n };\n};\n\nmodule.exports = SinCosTableGenerator;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate a smooth interpolation percentage of `x` between `min` and `max`.\n *\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\n * between 0 and 1 otherwise.\n *\n * @function Phaser.Math.SmoothStep\n * @since 3.0.0\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\n *\n * @param {number} x - The input value.\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\n *\n * @return {number} The percentage of interpolation, between 0 and 1.\n */\nvar SmoothStep = function (x, min, max)\n{\n if (x <= min)\n {\n return 0;\n }\n\n if (x >= max)\n {\n return 1;\n }\n\n x = (x - min) / (max - min);\n\n return x * x * (3 - 2 * x);\n};\n\nmodule.exports = SmoothStep;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate a smoother interpolation percentage of `x` between `min` and `max`.\n *\n * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge,\n * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial,\n * between 0 and 1 otherwise.\n *\n * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}.\n *\n * @function Phaser.Math.SmootherStep\n * @since 3.0.0\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\n *\n * @param {number} x - The input value.\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\n *\n * @return {number} The percentage of interpolation, between 0 and 1.\n */\nvar SmootherStep = function (x, min, max)\n{\n x = Math.max(0, Math.min(1, (x - min) / (max - min)));\n\n return x * x * x * (x * (x * 6 - 15) + 10);\n};\n\nmodule.exports = SmootherStep;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Vector2 = require('./Vector2');\n\n/**\n * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid.\n * \n * For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2.\n * \n * If the given index is out of range an empty Vector2 is returned.\n *\n * @function Phaser.Math.ToXY\n * @since 3.19.0\n *\n * @param {number} index - The position within the grid to get the x/y value for.\n * @param {number} width - The width of the grid.\n * @param {number} height - The height of the grid.\n * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created.\n *\n * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index.\n */\nvar ToXY = function (index, width, height, out)\n{\n if (out === undefined) { out = new Vector2(); }\n\n var x = 0;\n var y = 0;\n var total = width * height;\n\n if (index > 0 && index <= total)\n {\n if (index > width - 1)\n {\n y = Math.floor(index / width);\n x = index - (y * width);\n }\n else\n {\n x = index;\n }\n\n out.set(x, y);\n }\n\n return out;\n};\n\nmodule.exports = ToXY;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Vector2 = require('./Vector2');\n\n/**\n * Takes the `x` and `y` coordinates and transforms them into the same space as\n * defined by the position, rotation and scale values.\n *\n * @function Phaser.Math.TransformXY\n * @since 3.0.0\n *\n * @param {number} x - The x coordinate to be transformed.\n * @param {number} y - The y coordinate to be transformed.\n * @param {number} positionX - Horizontal position of the transform point.\n * @param {number} positionY - Vertical position of the transform point.\n * @param {number} rotation - Rotation of the transform point, in radians.\n * @param {number} scaleX - Horizontal scale of the transform point.\n * @param {number} scaleY - Vertical scale of the transform point.\n * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates.\n *\n * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point.\n */\nvar TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output)\n{\n if (output === undefined) { output = new Vector2(); }\n\n var radianSin = Math.sin(rotation);\n var radianCos = Math.cos(rotation);\n\n // Rotate and Scale\n var a = radianCos * scaleX;\n var b = radianSin * scaleX;\n var c = -radianSin * scaleY;\n var d = radianCos * scaleY;\n\n // Invert\n var id = 1 / ((a * d) + (c * -b));\n\n output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id);\n output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id);\n\n return output;\n};\n\nmodule.exports = TransformXY;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\n\nvar Class = require('../utils/Class');\nvar FuzzyEqual = require('../math/fuzzy/Equal');\n\n/**\n * @classdesc\n * A representation of a vector in 2D space.\n *\n * A two-component vector.\n *\n * @class Vector2\n * @memberof Phaser.Math\n * @constructor\n * @since 3.0.0\n *\n * @param {number|Phaser.Types.Math.Vector2Like} [x] - The x component, or an object with `x` and `y` properties.\n * @param {number} [y] - The y component.\n */\nvar Vector2 = new Class({\n\n initialize:\n\n function Vector2 (x, y)\n {\n /**\n * The x component of this Vector.\n *\n * @name Phaser.Math.Vector2#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.x = 0;\n\n /**\n * The y component of this Vector.\n *\n * @name Phaser.Math.Vector2#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.y = 0;\n\n if (typeof x === 'object')\n {\n this.x = x.x || 0;\n this.y = x.y || 0;\n }\n else\n {\n if (y === undefined) { y = x; }\n\n this.x = x || 0;\n this.y = y || 0;\n }\n },\n\n /**\n * Make a clone of this Vector2.\n *\n * @method Phaser.Math.Vector2#clone\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector2} A clone of this Vector2.\n */\n clone: function ()\n {\n return new Vector2(this.x, this.y);\n },\n\n /**\n * Copy the components of a given Vector into this Vector.\n *\n * @method Phaser.Math.Vector2#copy\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector to copy the components from.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n copy: function (src)\n {\n this.x = src.x || 0;\n this.y = src.y || 0;\n\n return this;\n },\n\n /**\n * Set the component values of this Vector from a given Vector2Like object.\n *\n * @method Phaser.Math.Vector2#setFromObject\n * @since 3.0.0\n *\n * @param {Phaser.Types.Math.Vector2Like} obj - The object containing the component values to set for this Vector.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n setFromObject: function (obj)\n {\n this.x = obj.x || 0;\n this.y = obj.y || 0;\n\n return this;\n },\n\n /**\n * Set the `x` and `y` components of the this Vector to the given `x` and `y` values.\n *\n * @method Phaser.Math.Vector2#set\n * @since 3.0.0\n *\n * @param {number} x - The x value to set for this Vector.\n * @param {number} [y=x] - The y value to set for this Vector.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n set: function (x, y)\n {\n if (y === undefined) { y = x; }\n\n this.x = x;\n this.y = y;\n\n return this;\n },\n\n /**\n * This method is an alias for `Vector2.set`.\n *\n * @method Phaser.Math.Vector2#setTo\n * @since 3.4.0\n *\n * @param {number} x - The x value to set for this Vector.\n * @param {number} [y=x] - The y value to set for this Vector.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n setTo: function (x, y)\n {\n return this.set(x, y);\n },\n\n /**\n * Sets the `x` and `y` values of this object from a given polar coordinate.\n *\n * @method Phaser.Math.Vector2#setToPolar\n * @since 3.0.0\n *\n * @param {number} azimuth - The angular coordinate, in radians.\n * @param {number} [radius=1] - The radial coordinate (length).\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n setToPolar: function (azimuth, radius)\n {\n if (radius == null) { radius = 1; }\n\n this.x = Math.cos(azimuth) * radius;\n this.y = Math.sin(azimuth) * radius;\n\n return this;\n },\n\n /**\n * Check whether this Vector is equal to a given Vector.\n *\n * Performs a strict equality check against each Vector's components.\n *\n * @method Phaser.Math.Vector2#equals\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\n *\n * @return {boolean} Whether the given Vector is equal to this Vector.\n */\n equals: function (v)\n {\n return ((this.x === v.x) && (this.y === v.y));\n },\n\n /**\n * Check whether this Vector is approximately equal to a given Vector.\n *\n * @method Phaser.Math.Vector2#fuzzyEquals\n * @since 3.23.0\n *\n * @param {Phaser.Math.Vector2} v - The vector to compare with this Vector.\n * @param {number} [epsilon=0.0001] - The tolerance value.\n *\n * @return {boolean} Whether both absolute differences of the x and y components are smaller than `epsilon`.\n */\n fuzzyEquals: function (v, epsilon)\n {\n return (FuzzyEqual(this.x, v.x, epsilon) && FuzzyEqual(this.y, v.y, epsilon));\n },\n\n /**\n * Calculate the angle between this Vector and the positive x-axis, in radians.\n *\n * @method Phaser.Math.Vector2#angle\n * @since 3.0.0\n *\n * @return {number} The angle between this Vector, and the positive x-axis, given in radians.\n */\n angle: function ()\n {\n // computes the angle in radians with respect to the positive x-axis\n\n var angle = Math.atan2(this.y, this.x);\n\n if (angle < 0)\n {\n angle += 2 * Math.PI;\n }\n\n return angle;\n },\n\n /**\n * Set the angle of this Vector.\n *\n * @method Phaser.Math.Vector2#setAngle\n * @since 3.23.0\n *\n * @param {number} angle - The angle, in radians.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n setAngle: function (angle)\n {\n return this.setToPolar(angle, this.length());\n },\n\n /**\n * Add a given Vector to this Vector. Addition is component-wise.\n *\n * @method Phaser.Math.Vector2#add\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector to add to this Vector.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n add: function (src)\n {\n this.x += src.x;\n this.y += src.y;\n\n return this;\n },\n\n /**\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\n *\n * @method Phaser.Math.Vector2#subtract\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector to subtract from this Vector.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n subtract: function (src)\n {\n this.x -= src.x;\n this.y -= src.y;\n\n return this;\n },\n\n /**\n * Perform a component-wise multiplication between this Vector and the given Vector.\n *\n * Multiplies this Vector by the given Vector.\n *\n * @method Phaser.Math.Vector2#multiply\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector to multiply this Vector by.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n multiply: function (src)\n {\n this.x *= src.x;\n this.y *= src.y;\n\n return this;\n },\n\n /**\n * Scale this Vector by the given value.\n *\n * @method Phaser.Math.Vector2#scale\n * @since 3.0.0\n *\n * @param {number} value - The value to scale this Vector by.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n scale: function (value)\n {\n if (isFinite(value))\n {\n this.x *= value;\n this.y *= value;\n }\n else\n {\n this.x = 0;\n this.y = 0;\n }\n\n return this;\n },\n\n /**\n * Perform a component-wise division between this Vector and the given Vector.\n *\n * Divides this Vector by the given Vector.\n *\n * @method Phaser.Math.Vector2#divide\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector to divide this Vector by.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n divide: function (src)\n {\n this.x /= src.x;\n this.y /= src.y;\n\n return this;\n },\n\n /**\n * Negate the `x` and `y` components of this Vector.\n *\n * @method Phaser.Math.Vector2#negate\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n negate: function ()\n {\n this.x = -this.x;\n this.y = -this.y;\n\n return this;\n },\n\n /**\n * Calculate the distance between this Vector and the given Vector.\n *\n * @method Phaser.Math.Vector2#distance\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\n *\n * @return {number} The distance from this Vector to the given Vector.\n */\n distance: function (src)\n {\n var dx = src.x - this.x;\n var dy = src.y - this.y;\n\n return Math.sqrt(dx * dx + dy * dy);\n },\n\n /**\n * Calculate the distance between this Vector and the given Vector, squared.\n *\n * @method Phaser.Math.Vector2#distanceSq\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector to calculate the distance to.\n *\n * @return {number} The distance from this Vector to the given Vector, squared.\n */\n distanceSq: function (src)\n {\n var dx = src.x - this.x;\n var dy = src.y - this.y;\n\n return dx * dx + dy * dy;\n },\n\n /**\n * Calculate the length (or magnitude) of this Vector.\n *\n * @method Phaser.Math.Vector2#length\n * @since 3.0.0\n *\n * @return {number} The length of this Vector.\n */\n length: function ()\n {\n var x = this.x;\n var y = this.y;\n\n return Math.sqrt(x * x + y * y);\n },\n\n /**\n * Set the length (or magnitude) of this Vector.\n *\n * @method Phaser.Math.Vector2#setLength\n * @since 3.23.0\n *\n * @param {number} length\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n setLength: function (length)\n {\n return this.normalize().scale(length);\n },\n\n /**\n * Calculate the length of this Vector squared.\n *\n * @method Phaser.Math.Vector2#lengthSq\n * @since 3.0.0\n *\n * @return {number} The length of this Vector, squared.\n */\n lengthSq: function ()\n {\n var x = this.x;\n var y = this.y;\n\n return x * x + y * y;\n },\n\n /**\n * Normalize this Vector.\n *\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\n *\n * @method Phaser.Math.Vector2#normalize\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n normalize: function ()\n {\n var x = this.x;\n var y = this.y;\n var len = x * x + y * y;\n\n if (len > 0)\n {\n len = 1 / Math.sqrt(len);\n\n this.x = x * len;\n this.y = y * len;\n }\n\n return this;\n },\n\n /**\n * Rotate this Vector to its perpendicular, in the positive direction.\n *\n * @method Phaser.Math.Vector2#normalizeRightHand\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n normalizeRightHand: function ()\n {\n var x = this.x;\n\n this.x = this.y * -1;\n this.y = x;\n\n return this;\n },\n\n /**\n * Rotate this Vector to its perpendicular, in the negative direction.\n *\n * @method Phaser.Math.Vector2#normalizeLeftHand\n * @since 3.23.0\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n normalizeLeftHand: function ()\n {\n var x = this.x;\n\n this.x = this.y;\n this.y = x * -1;\n\n return this;\n },\n\n /**\n * Calculate the dot product of this Vector and the given Vector.\n *\n * @method Phaser.Math.Vector2#dot\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector2 to dot product with this Vector2.\n *\n * @return {number} The dot product of this Vector and the given Vector.\n */\n dot: function (src)\n {\n return this.x * src.x + this.y * src.y;\n },\n\n /**\n * Calculate the cross product of this Vector and the given Vector.\n *\n * @method Phaser.Math.Vector2#cross\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector2 to cross with this Vector2.\n *\n * @return {number} The cross product of this Vector and the given Vector.\n */\n cross: function (src)\n {\n return this.x * src.y - this.y * src.x;\n },\n\n /**\n * Linearly interpolate between this Vector and the given Vector.\n *\n * Interpolates this Vector towards the given Vector.\n *\n * @method Phaser.Math.Vector2#lerp\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector2} src - The Vector2 to interpolate towards.\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n lerp: function (src, t)\n {\n if (t === undefined) { t = 0; }\n\n var ax = this.x;\n var ay = this.y;\n\n this.x = ax + t * (src.x - ax);\n this.y = ay + t * (src.y - ay);\n\n return this;\n },\n\n /**\n * Transform this Vector with the given Matrix.\n *\n * @method Phaser.Math.Vector2#transformMat3\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector2 with.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n transformMat3: function (mat)\n {\n var x = this.x;\n var y = this.y;\n var m = mat.val;\n\n this.x = m[0] * x + m[3] * y + m[6];\n this.y = m[1] * x + m[4] * y + m[7];\n\n return this;\n },\n\n /**\n * Transform this Vector with the given Matrix.\n *\n * @method Phaser.Math.Vector2#transformMat4\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector2 with.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n transformMat4: function (mat)\n {\n var x = this.x;\n var y = this.y;\n var m = mat.val;\n\n this.x = m[0] * x + m[4] * y + m[12];\n this.y = m[1] * x + m[5] * y + m[13];\n\n return this;\n },\n\n /**\n * Make this Vector the zero vector (0, 0).\n *\n * @method Phaser.Math.Vector2#reset\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n reset: function ()\n {\n this.x = 0;\n this.y = 0;\n\n return this;\n },\n\n /**\n * Limit the length (or magnitude) of this Vector.\n *\n * @method Phaser.Math.Vector2#limit\n * @since 3.23.0\n *\n * @param {number} max - The maximum length.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n limit: function (max)\n {\n var len = this.length();\n\n if (len && len > max)\n {\n this.scale(max / len);\n }\n\n return this;\n },\n\n /**\n * Reflect this Vector off a line defined by a normal.\n *\n * @method Phaser.Math.Vector2#reflect\n * @since 3.23.0\n *\n * @param {Phaser.Math.Vector2} normal - A vector perpendicular to the line.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n reflect: function (normal)\n {\n normal = normal.clone().normalize();\n\n return this.subtract(normal.scale(2 * this.dot(normal)));\n },\n\n /**\n * Reflect this Vector across another.\n *\n * @method Phaser.Math.Vector2#mirror\n * @since 3.23.0\n *\n * @param {Phaser.Math.Vector2} axis - A vector to reflect across.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n mirror: function (axis)\n {\n return this.reflect(axis).negate();\n },\n\n /**\n * Rotate this Vector by an angle amount.\n *\n * @method Phaser.Math.Vector2#rotate\n * @since 3.23.0\n *\n * @param {number} delta - The angle to rotate by, in radians.\n *\n * @return {Phaser.Math.Vector2} This Vector2.\n */\n rotate: function (delta)\n {\n var cos = Math.cos(delta);\n var sin = Math.sin(delta);\n\n return this.set(cos * this.x - sin * this.y, sin * this.x + cos * this.y);\n }\n\n});\n\n/**\n * A static zero Vector2 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector2.ZERO\n * @type {Phaser.Math.Vector2}\n * @since 3.1.0\n */\nVector2.ZERO = new Vector2();\n\n/**\n * A static right Vector2 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector2.RIGHT\n * @type {Phaser.Math.Vector2}\n * @since 3.16.0\n */\nVector2.RIGHT = new Vector2(1, 0);\n\n/**\n * A static left Vector2 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector2.LEFT\n * @type {Phaser.Math.Vector2}\n * @since 3.16.0\n */\nVector2.LEFT = new Vector2(-1, 0);\n\n/**\n * A static up Vector2 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector2.UP\n * @type {Phaser.Math.Vector2}\n * @since 3.16.0\n */\nVector2.UP = new Vector2(0, -1);\n\n/**\n * A static down Vector2 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector2.DOWN\n * @type {Phaser.Math.Vector2}\n * @since 3.16.0\n */\nVector2.DOWN = new Vector2(0, 1);\n\n/**\n * A static one Vector2 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector2.ONE\n * @type {Phaser.Math.Vector2}\n * @since 3.16.0\n */\nVector2.ONE = new Vector2(1, 1);\n\nmodule.exports = Vector2;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\n\nvar Class = require('../utils/Class');\n\n/**\n * @classdesc\n * A representation of a vector in 3D space.\n *\n * A three-component vector.\n *\n * @class Vector3\n * @memberof Phaser.Math\n * @constructor\n * @since 3.0.0\n *\n * @param {number} [x] - The x component.\n * @param {number} [y] - The y component.\n * @param {number} [z] - The z component.\n */\nvar Vector3 = new Class({\n\n initialize:\n\n function Vector3 (x, y, z)\n {\n /**\n * The x component of this Vector.\n *\n * @name Phaser.Math.Vector3#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.x = 0;\n\n /**\n * The y component of this Vector.\n *\n * @name Phaser.Math.Vector3#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.y = 0;\n\n /**\n * The z component of this Vector.\n *\n * @name Phaser.Math.Vector3#z\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.z = 0;\n\n if (typeof x === 'object')\n {\n this.x = x.x || 0;\n this.y = x.y || 0;\n this.z = x.z || 0;\n }\n else\n {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n }\n },\n\n /**\n * Set this Vector to point up.\n *\n * Sets the y component of the vector to 1, and the others to 0.\n *\n * @method Phaser.Math.Vector3#up\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n up: function ()\n {\n this.x = 0;\n this.y = 1;\n this.z = 0;\n\n return this;\n },\n\n /**\n * Sets the components of this Vector to be the `Math.min` result from the given vector.\n *\n * @method Phaser.Math.Vector3#min\n * @since 3.50.0\n *\n * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n min: function (v)\n {\n this.x = Math.min(this.x, v.x);\n this.y = Math.min(this.y, v.y);\n this.z = Math.min(this.z, v.z);\n\n return this;\n },\n\n /**\n * Sets the components of this Vector to be the `Math.max` result from the given vector.\n *\n * @method Phaser.Math.Vector3#max\n * @since 3.50.0\n *\n * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n max: function (v)\n {\n this.x = Math.max(this.x, v.x);\n this.y = Math.max(this.y, v.y);\n this.z = Math.max(this.z, v.z);\n\n return this;\n },\n\n /**\n * Make a clone of this Vector3.\n *\n * @method Phaser.Math.Vector3#clone\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values.\n */\n clone: function ()\n {\n return new Vector3(this.x, this.y, this.z);\n },\n\n /**\n * Adds the two given Vector3s and sets the results into this Vector3.\n *\n * @method Phaser.Math.Vector3#addVectors\n * @since 3.50.0\n *\n * @param {Phaser.Math.Vector3} a - The first Vector to add.\n * @param {Phaser.Math.Vector3} b - The second Vector to add.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n addVectors: function (a, b)\n {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n this.z = a.z + b.z;\n\n return this;\n },\n\n /**\n * Calculate the cross (vector) product of two given Vectors.\n *\n * @method Phaser.Math.Vector3#crossVectors\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} a - The first Vector to multiply.\n * @param {Phaser.Math.Vector3} b - The second Vector to multiply.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n crossVectors: function (a, b)\n {\n var ax = a.x;\n var ay = a.y;\n var az = a.z;\n var bx = b.x;\n var by = b.y;\n var bz = b.z;\n\n this.x = ay * bz - az * by;\n this.y = az * bx - ax * bz;\n this.z = ax * by - ay * bx;\n\n return this;\n },\n\n /**\n * Check whether this Vector is equal to a given Vector.\n *\n * Performs a strict equality check against each Vector's components.\n *\n * @method Phaser.Math.Vector3#equals\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} v - The Vector3 to compare against.\n *\n * @return {boolean} True if the two vectors strictly match, otherwise false.\n */\n equals: function (v)\n {\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z));\n },\n\n /**\n * Copy the components of a given Vector into this Vector.\n *\n * @method Phaser.Math.Vector3#copy\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n copy: function (src)\n {\n this.x = src.x;\n this.y = src.y;\n this.z = src.z || 0;\n\n return this;\n },\n\n /**\n * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values.\n *\n * @method Phaser.Math.Vector3#set\n * @since 3.0.0\n *\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components.\n * @param {number} [y] - The y value to set for this Vector.\n * @param {number} [z] - The z value to set for this Vector.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n set: function (x, y, z)\n {\n if (typeof x === 'object')\n {\n this.x = x.x || 0;\n this.y = x.y || 0;\n this.z = x.z || 0;\n }\n else\n {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n }\n\n return this;\n },\n\n /**\n * Sets the components of this Vector3 from the position of the given Matrix4.\n *\n * @method Phaser.Math.Vector3#setFromMatrixPosition\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n setFromMatrixPosition: function (m)\n {\n return this.fromArray(m.val, 12);\n },\n\n /**\n * Sets the components of this Vector3 from the Matrix4 column specified.\n *\n * @method Phaser.Math.Vector3#setFromMatrixColumn\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from.\n * @param {number} index - The column index.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n setFromMatrixColumn: function (mat4, index)\n {\n return this.fromArray(mat4.val, index * 4);\n },\n\n /**\n * Sets the components of this Vector3 from the given array, based on the offset.\n *\n * Vector3.x = array[offset]\n * Vector3.y = array[offset + 1]\n * Vector3.z = array[offset + 2]\n *\n * @method Phaser.Math.Vector3#fromArray\n * @since 3.50.0\n *\n * @param {number[]} array - The array of values to get this Vector from.\n * @param {number} [offset=0] - The offset index into the array.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n fromArray: function (array, offset)\n {\n if (offset === undefined) { offset = 0; }\n\n this.x = array[offset];\n this.y = array[offset + 1];\n this.z = array[offset + 2];\n\n return this;\n },\n\n /**\n * Add a given Vector to this Vector. Addition is component-wise.\n *\n * @method Phaser.Math.Vector3#add\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n add: function (v)\n {\n this.x += v.x;\n this.y += v.y;\n this.z += v.z || 0;\n\n return this;\n },\n\n /**\n * Add the given value to each component of this Vector.\n *\n * @method Phaser.Math.Vector3#addScalar\n * @since 3.50.0\n *\n * @param {number} s - The amount to add to this Vector.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n addScalar: function (s)\n {\n this.x += s;\n this.y += s;\n this.z += s;\n\n return this;\n },\n\n /**\n * Add and scale a given Vector to this Vector. Addition is component-wise.\n *\n * @method Phaser.Math.Vector3#addScale\n * @since 3.50.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector.\n * @param {number} scale - The amount to scale `v` by.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n addScale: function (v, scale)\n {\n this.x += v.x * scale;\n this.y += v.y * scale;\n this.z += v.z * scale || 0;\n\n return this;\n },\n\n /**\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\n *\n * @method Phaser.Math.Vector3#subtract\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n subtract: function (v)\n {\n this.x -= v.x;\n this.y -= v.y;\n this.z -= v.z || 0;\n\n return this;\n },\n\n /**\n * Perform a component-wise multiplication between this Vector and the given Vector.\n *\n * Multiplies this Vector by the given Vector.\n *\n * @method Phaser.Math.Vector3#multiply\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n multiply: function (v)\n {\n this.x *= v.x;\n this.y *= v.y;\n this.z *= v.z || 1;\n\n return this;\n },\n\n /**\n * Scale this Vector by the given value.\n *\n * @method Phaser.Math.Vector3#scale\n * @since 3.0.0\n *\n * @param {number} scale - The value to scale this Vector by.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n scale: function (scale)\n {\n if (isFinite(scale))\n {\n this.x *= scale;\n this.y *= scale;\n this.z *= scale;\n }\n else\n {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }\n\n return this;\n },\n\n /**\n * Perform a component-wise division between this Vector and the given Vector.\n *\n * Divides this Vector by the given Vector.\n *\n * @method Phaser.Math.Vector3#divide\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n divide: function (v)\n {\n this.x /= v.x;\n this.y /= v.y;\n this.z /= v.z || 1;\n\n return this;\n },\n\n /**\n * Negate the `x`, `y` and `z` components of this Vector.\n *\n * @method Phaser.Math.Vector3#negate\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n negate: function ()\n {\n this.x = -this.x;\n this.y = -this.y;\n this.z = -this.z;\n\n return this;\n },\n\n /**\n * Calculate the distance between this Vector and the given Vector.\n *\n * @method Phaser.Math.Vector3#distance\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\n *\n * @return {number} The distance from this Vector to the given Vector.\n */\n distance: function (v)\n {\n var dx = v.x - this.x;\n var dy = v.y - this.y;\n var dz = v.z - this.z || 0;\n\n return Math.sqrt(dx * dx + dy * dy + dz * dz);\n },\n\n /**\n * Calculate the distance between this Vector and the given Vector, squared.\n *\n * @method Phaser.Math.Vector3#distanceSq\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to.\n *\n * @return {number} The distance from this Vector to the given Vector, squared.\n */\n distanceSq: function (v)\n {\n var dx = v.x - this.x;\n var dy = v.y - this.y;\n var dz = v.z - this.z || 0;\n\n return dx * dx + dy * dy + dz * dz;\n },\n\n /**\n * Calculate the length (or magnitude) of this Vector.\n *\n * @method Phaser.Math.Vector3#length\n * @since 3.0.0\n *\n * @return {number} The length of this Vector.\n */\n length: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n\n return Math.sqrt(x * x + y * y + z * z);\n },\n\n /**\n * Calculate the length of this Vector squared.\n *\n * @method Phaser.Math.Vector3#lengthSq\n * @since 3.0.0\n *\n * @return {number} The length of this Vector, squared.\n */\n lengthSq: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n\n return x * x + y * y + z * z;\n },\n\n /**\n * Normalize this Vector.\n *\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\n *\n * @method Phaser.Math.Vector3#normalize\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n normalize: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var len = x * x + y * y + z * z;\n\n if (len > 0)\n {\n len = 1 / Math.sqrt(len);\n\n this.x = x * len;\n this.y = y * len;\n this.z = z * len;\n }\n\n return this;\n },\n\n /**\n * Calculate the dot product of this Vector and the given Vector.\n *\n * @method Phaser.Math.Vector3#dot\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3.\n *\n * @return {number} The dot product of this Vector and `v`.\n */\n dot: function (v)\n {\n return this.x * v.x + this.y * v.y + this.z * v.z;\n },\n\n /**\n * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector.\n *\n * @method Phaser.Math.Vector3#cross\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} v - The Vector to cross product with.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n cross: function (v)\n {\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var bx = v.x;\n var by = v.y;\n var bz = v.z;\n\n this.x = ay * bz - az * by;\n this.y = az * bx - ax * bz;\n this.z = ax * by - ay * bx;\n\n return this;\n },\n\n /**\n * Linearly interpolate between this Vector and the given Vector.\n *\n * Interpolates this Vector towards the given Vector.\n *\n * @method Phaser.Math.Vector3#lerp\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards.\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n lerp: function (v, t)\n {\n if (t === undefined) { t = 0; }\n\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n\n this.x = ax + t * (v.x - ax);\n this.y = ay + t * (v.y - ay);\n this.z = az + t * (v.z - az);\n\n return this;\n },\n\n /**\n * Takes a Matrix3 and applies it to this Vector3.\n *\n * @method Phaser.Math.Vector3#applyMatrix3\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n applyMatrix3: function (mat3)\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var m = mat3.val;\n\n this.x = m[0] * x + m[3] * y + m[6] * z;\n this.y = m[1] * x + m[4] * y + m[7] * z;\n this.z = m[2] * x + m[5] * y + m[8] * z;\n\n return this;\n },\n\n /**\n * Takes a Matrix4 and applies it to this Vector3.\n *\n * @method Phaser.Math.Vector3#applyMatrix4\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n applyMatrix4: function (mat4)\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var m = mat4.val;\n\n var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]);\n\n this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w;\n this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w;\n this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w;\n\n return this;\n },\n\n /**\n * Transform this Vector with the given Matrix.\n *\n * @method Phaser.Math.Vector3#transformMat3\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n transformMat3: function (mat)\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var m = mat.val;\n\n this.x = x * m[0] + y * m[3] + z * m[6];\n this.y = x * m[1] + y * m[4] + z * m[7];\n this.z = x * m[2] + y * m[5] + z * m[8];\n\n return this;\n },\n\n /**\n * Transform this Vector with the given Matrix4.\n *\n * @method Phaser.Math.Vector3#transformMat4\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n transformMat4: function (mat)\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var m = mat.val;\n\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12];\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13];\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14];\n\n return this;\n },\n\n /**\n * Transforms the coordinates of this Vector3 with the given Matrix4.\n *\n * @method Phaser.Math.Vector3#transformCoordinates\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n transformCoordinates: function (mat)\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var m = mat.val;\n\n var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12];\n var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13];\n var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14];\n var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15];\n\n this.x = tx / tw;\n this.y = ty / tw;\n this.z = tz / tw;\n\n return this;\n },\n\n /**\n * Transform this Vector with the given Quaternion.\n *\n * @method Phaser.Math.Vector3#transformQuat\n * @since 3.0.0\n *\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n transformQuat: function (q)\n {\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var qx = q.x;\n var qy = q.y;\n var qz = q.z;\n var qw = q.w;\n\n // calculate quat * vec\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n return this;\n },\n\n /**\n * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection,\n * e.g. unprojecting a 2D point into 3D space.\n *\n * @method Phaser.Math.Vector3#project\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n project: function (mat)\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var m = mat.val;\n\n var a00 = m[0];\n var a01 = m[1];\n var a02 = m[2];\n var a03 = m[3];\n var a10 = m[4];\n var a11 = m[5];\n var a12 = m[6];\n var a13 = m[7];\n var a20 = m[8];\n var a21 = m[9];\n var a22 = m[10];\n var a23 = m[11];\n var a30 = m[12];\n var a31 = m[13];\n var a32 = m[14];\n var a33 = m[15];\n\n var lw = 1 / (x * a03 + y * a13 + z * a23 + a33);\n\n this.x = (x * a00 + y * a10 + z * a20 + a30) * lw;\n this.y = (x * a01 + y * a11 + z * a21 + a31) * lw;\n this.z = (x * a02 + y * a12 + z * a22 + a32) * lw;\n\n return this;\n },\n\n /**\n * Multiplies this Vector3 by the given view and projection matrices.\n *\n * @method Phaser.Math.Vector3#projectViewMatrix\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix.\n * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n projectViewMatrix: function (viewMatrix, projectionMatrix)\n {\n return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix);\n },\n\n /**\n * Multiplies this Vector3 by the given inversed projection matrix and world matrix.\n *\n * @method Phaser.Math.Vector3#unprojectViewMatrix\n * @since 3.50.0\n *\n * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix.\n * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n unprojectViewMatrix: function (projectionMatrix, worldMatrix)\n {\n return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix);\n },\n\n /**\n * Unproject this point from 2D space to 3D space.\n * The point should have its x and y properties set to\n * 2D screen space, and the z either at 0 (near plane)\n * or 1 (far plane). The provided matrix is assumed to already\n * be combined, i.e. projection * view * model.\n *\n * After this operation, this vector's (x, y, z) components will\n * represent the unprojected 3D coordinate.\n *\n * @method Phaser.Math.Vector3#unproject\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels.\n * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix.\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n unproject: function (viewport, invProjectionView)\n {\n var viewX = viewport.x;\n var viewY = viewport.y;\n var viewWidth = viewport.z;\n var viewHeight = viewport.w;\n\n var x = this.x - viewX;\n var y = (viewHeight - this.y - 1) - viewY;\n var z = this.z;\n\n this.x = (2 * x) / viewWidth - 1;\n this.y = (2 * y) / viewHeight - 1;\n this.z = 2 * z - 1;\n\n return this.project(invProjectionView);\n },\n\n /**\n * Make this Vector the zero vector (0, 0, 0).\n *\n * @method Phaser.Math.Vector3#reset\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector3} This Vector3.\n */\n reset: function ()\n {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n\n return this;\n }\n\n});\n\n/**\n * A static zero Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.ZERO\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.ZERO = new Vector3();\n\n/**\n * A static right Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.RIGHT\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.RIGHT = new Vector3(1, 0, 0);\n\n/**\n * A static left Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.LEFT\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.LEFT = new Vector3(-1, 0, 0);\n\n/**\n * A static up Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.UP\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.UP = new Vector3(0, -1, 0);\n\n/**\n * A static down Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.DOWN\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.DOWN = new Vector3(0, 1, 0);\n\n/**\n * A static forward Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.FORWARD\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.FORWARD = new Vector3(0, 0, 1);\n\n/**\n * A static back Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.BACK\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.BACK = new Vector3(0, 0, -1);\n\n/**\n * A static one Vector3 for use by reference.\n *\n * This constant is meant for comparison operations and should not be modified directly.\n *\n * @constant\n * @name Phaser.Math.Vector3.ONE\n * @type {Phaser.Math.Vector3}\n * @since 3.16.0\n */\nVector3.ONE = new Vector3(1, 1, 1);\n\nmodule.exports = Vector3;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji\n// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl\n\nvar Class = require('../utils/Class');\n\n/**\n * @classdesc\n * A representation of a vector in 4D space.\n *\n * A four-component vector.\n *\n * @class Vector4\n * @memberof Phaser.Math\n * @constructor\n * @since 3.0.0\n *\n * @param {number} [x] - The x component.\n * @param {number} [y] - The y component.\n * @param {number} [z] - The z component.\n * @param {number} [w] - The w component.\n */\nvar Vector4 = new Class({\n\n initialize:\n\n function Vector4 (x, y, z, w)\n {\n /**\n * The x component of this Vector.\n *\n * @name Phaser.Math.Vector4#x\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.x = 0;\n\n /**\n * The y component of this Vector.\n *\n * @name Phaser.Math.Vector4#y\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.y = 0;\n\n /**\n * The z component of this Vector.\n *\n * @name Phaser.Math.Vector4#z\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.z = 0;\n\n /**\n * The w component of this Vector.\n *\n * @name Phaser.Math.Vector4#w\n * @type {number}\n * @default 0\n * @since 3.0.0\n */\n this.w = 0;\n\n if (typeof x === 'object')\n {\n this.x = x.x || 0;\n this.y = x.y || 0;\n this.z = x.z || 0;\n this.w = x.w || 0;\n }\n else\n {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n this.w = w || 0;\n }\n },\n\n /**\n * Make a clone of this Vector4.\n *\n * @method Phaser.Math.Vector4#clone\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector4} A clone of this Vector4.\n */\n clone: function ()\n {\n return new Vector4(this.x, this.y, this.z, this.w);\n },\n\n /**\n * Copy the components of a given Vector into this Vector.\n *\n * @method Phaser.Math.Vector4#copy\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector4} src - The Vector to copy the components from.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n copy: function (src)\n {\n this.x = src.x;\n this.y = src.y;\n this.z = src.z || 0;\n this.w = src.w || 0;\n\n return this;\n },\n\n /**\n * Check whether this Vector is equal to a given Vector.\n *\n * Performs a strict quality check against each Vector's components.\n *\n * @method Phaser.Math.Vector4#equals\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector4} v - The vector to check equality with.\n *\n * @return {boolean} A boolean indicating whether the two Vectors are equal or not.\n */\n equals: function (v)\n {\n return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z) && (this.w === v.w));\n },\n\n /**\n * Set the `x`, `y`, `z` and `w` components of the this Vector to the given `x`, `y`, `z` and `w` values.\n *\n * @method Phaser.Math.Vector4#set\n * @since 3.0.0\n *\n * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y, z and w components.\n * @param {number} y - The y value to set for this Vector.\n * @param {number} z - The z value to set for this Vector.\n * @param {number} w - The z value to set for this Vector.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n set: function (x, y, z, w)\n {\n if (typeof x === 'object')\n {\n this.x = x.x || 0;\n this.y = x.y || 0;\n this.z = x.z || 0;\n this.w = x.w || 0;\n }\n else\n {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n this.w = w || 0;\n }\n\n return this;\n },\n\n /**\n * Add a given Vector to this Vector. Addition is component-wise.\n *\n * @method Phaser.Math.Vector4#add\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to add to this Vector.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n add: function (v)\n {\n this.x += v.x;\n this.y += v.y;\n this.z += v.z || 0;\n this.w += v.w || 0;\n\n return this;\n },\n\n /**\n * Subtract the given Vector from this Vector. Subtraction is component-wise.\n *\n * @method Phaser.Math.Vector4#subtract\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to subtract from this Vector.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n subtract: function (v)\n {\n this.x -= v.x;\n this.y -= v.y;\n this.z -= v.z || 0;\n this.w -= v.w || 0;\n\n return this;\n },\n\n /**\n * Scale this Vector by the given value.\n *\n * @method Phaser.Math.Vector4#scale\n * @since 3.0.0\n *\n * @param {number} scale - The value to scale this Vector by.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n scale: function (scale)\n {\n this.x *= scale;\n this.y *= scale;\n this.z *= scale;\n this.w *= scale;\n\n return this;\n },\n\n /**\n * Calculate the length (or magnitude) of this Vector.\n *\n * @method Phaser.Math.Vector4#length\n * @since 3.0.0\n *\n * @return {number} The length of this Vector.\n */\n length: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var w = this.w;\n\n return Math.sqrt(x * x + y * y + z * z + w * w);\n },\n\n /**\n * Calculate the length of this Vector squared.\n *\n * @method Phaser.Math.Vector4#lengthSq\n * @since 3.0.0\n *\n * @return {number} The length of this Vector, squared.\n */\n lengthSq: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var w = this.w;\n\n return x * x + y * y + z * z + w * w;\n },\n\n /**\n * Normalize this Vector.\n *\n * Makes the vector a unit length vector (magnitude of 1) in the same direction.\n *\n * @method Phaser.Math.Vector4#normalize\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n normalize: function ()\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var w = this.w;\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0)\n {\n len = 1 / Math.sqrt(len);\n\n this.x = x * len;\n this.y = y * len;\n this.z = z * len;\n this.w = w * len;\n }\n\n return this;\n },\n\n /**\n * Calculate the dot product of this Vector and the given Vector.\n *\n * @method Phaser.Math.Vector4#dot\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector4} v - The Vector4 to dot product with this Vector4.\n *\n * @return {number} The dot product of this Vector and the given Vector.\n */\n dot: function (v)\n {\n return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n },\n\n /**\n * Linearly interpolate between this Vector and the given Vector.\n *\n * Interpolates this Vector towards the given Vector.\n *\n * @method Phaser.Math.Vector4#lerp\n * @since 3.0.0\n *\n * @param {Phaser.Math.Vector4} v - The Vector4 to interpolate towards.\n * @param {number} [t=0] - The interpolation percentage, between 0 and 1.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n lerp: function (v, t)\n {\n if (t === undefined) { t = 0; }\n\n var ax = this.x;\n var ay = this.y;\n var az = this.z;\n var aw = this.w;\n\n this.x = ax + t * (v.x - ax);\n this.y = ay + t * (v.y - ay);\n this.z = az + t * (v.z - az);\n this.w = aw + t * (v.w - aw);\n\n return this;\n },\n\n /**\n * Perform a component-wise multiplication between this Vector and the given Vector.\n *\n * Multiplies this Vector by the given Vector.\n *\n * @method Phaser.Math.Vector4#multiply\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to multiply this Vector by.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n multiply: function (v)\n {\n this.x *= v.x;\n this.y *= v.y;\n this.z *= v.z || 1;\n this.w *= v.w || 1;\n\n return this;\n },\n\n /**\n * Perform a component-wise division between this Vector and the given Vector.\n *\n * Divides this Vector by the given Vector.\n *\n * @method Phaser.Math.Vector4#divide\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to divide this Vector by.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n divide: function (v)\n {\n this.x /= v.x;\n this.y /= v.y;\n this.z /= v.z || 1;\n this.w /= v.w || 1;\n\n return this;\n },\n\n /**\n * Calculate the distance between this Vector and the given Vector.\n *\n * @method Phaser.Math.Vector4#distance\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\n *\n * @return {number} The distance from this Vector to the given Vector.\n */\n distance: function (v)\n {\n var dx = v.x - this.x;\n var dy = v.y - this.y;\n var dz = v.z - this.z || 0;\n var dw = v.w - this.w || 0;\n\n return Math.sqrt(dx * dx + dy * dy + dz * dz + dw * dw);\n },\n\n /**\n * Calculate the distance between this Vector and the given Vector, squared.\n *\n * @method Phaser.Math.Vector4#distanceSq\n * @since 3.0.0\n *\n * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to calculate the distance to.\n *\n * @return {number} The distance from this Vector to the given Vector, squared.\n */\n distanceSq: function (v)\n {\n var dx = v.x - this.x;\n var dy = v.y - this.y;\n var dz = v.z - this.z || 0;\n var dw = v.w - this.w || 0;\n\n return dx * dx + dy * dy + dz * dz + dw * dw;\n },\n\n /**\n * Negate the `x`, `y`, `z` and `w` components of this Vector.\n *\n * @method Phaser.Math.Vector4#negate\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n negate: function ()\n {\n this.x = -this.x;\n this.y = -this.y;\n this.z = -this.z;\n this.w = -this.w;\n\n return this;\n },\n\n /**\n * Transform this Vector with the given Matrix.\n *\n * @method Phaser.Math.Vector4#transformMat4\n * @since 3.0.0\n *\n * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector4 with.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n transformMat4: function (mat)\n {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var w = this.w;\n var m = mat.val;\n\n this.x = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n this.y = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n this.z = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n this.w = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n\n return this;\n },\n\n /**\n * Transform this Vector with the given Quaternion.\n *\n * @method Phaser.Math.Vector4#transformQuat\n * @since 3.0.0\n *\n * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with.\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n transformQuat: function (q)\n {\n // TODO: is this really the same as Vector3?\n // Also, what about this: http://molecularmusings.wordpress.com/2013/05/24/a-faster-quaternion-vector-multiplication/\n // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var qx = q.x;\n var qy = q.y;\n var qz = q.z;\n var qw = q.w;\n\n // calculate quat * vec\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z;\n\n // calculate result * inverse quat\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n return this;\n },\n\n /**\n * Make this Vector the zero vector (0, 0, 0, 0).\n *\n * @method Phaser.Math.Vector4#reset\n * @since 3.0.0\n *\n * @return {Phaser.Math.Vector4} This Vector4.\n */\n reset: function ()\n {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n this.w = 0;\n\n return this;\n }\n\n});\n\n// TODO: Check if these are required internally, if not, remove.\nVector4.prototype.sub = Vector4.prototype.subtract;\nVector4.prototype.mul = Vector4.prototype.multiply;\nVector4.prototype.div = Vector4.prototype.divide;\nVector4.prototype.dist = Vector4.prototype.distance;\nVector4.prototype.distSq = Vector4.prototype.distanceSq;\nVector4.prototype.len = Vector4.prototype.length;\nVector4.prototype.lenSq = Vector4.prototype.lengthSq;\n\nmodule.exports = Vector4;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Checks if the two values are within the given `tolerance` of each other.\n *\n * @function Phaser.Math.Within\n * @since 3.0.0\n *\n * @param {number} a - The first value to use in the calculation.\n * @param {number} b - The second value to use in the calculation.\n * @param {number} tolerance - The tolerance. Anything equal to or less than this value is considered as being within range.\n *\n * @return {boolean} Returns `true` if `a` is less than or equal to the tolerance of `b`.\n */\nvar Within = function (a, b, tolerance)\n{\n return (Math.abs(a - b) <= tolerance);\n};\n\nmodule.exports = Within;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Wrap the given `value` between `min` and `max.\n *\n * @function Phaser.Math.Wrap\n * @since 3.0.0\n *\n * @param {number} value - The value to wrap.\n * @param {number} min - The minimum value.\n * @param {number} max - The maximum value.\n *\n * @return {number} The wrapped value.\n */\nvar Wrap = function (value, min, max)\n{\n var range = max - min;\n\n return (min + ((((value - min) % range) + range) % range));\n};\n\nmodule.exports = Wrap;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\n *\n * @function Phaser.Math.Angle.Between\n * @since 3.0.0\n *\n * @param {number} x1 - The x coordinate of the first point.\n * @param {number} y1 - The y coordinate of the first point.\n * @param {number} x2 - The x coordinate of the second point.\n * @param {number} y2 - The y coordinate of the second point.\n *\n * @return {number} The angle in radians.\n */\nvar Between = function (x1, y1, x2, y2)\n{\n return Math.atan2(y2 - y1, x2 - x1);\n};\n\nmodule.exports = Between;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\n *\n * Calculates the angle of the vector from the first point to the second point.\n *\n * @function Phaser.Math.Angle.BetweenPoints\n * @since 3.0.0\n *\n * @param {Phaser.Types.Math.Vector2Like} point1 - The first point.\n * @param {Phaser.Types.Math.Vector2Like} point2 - The second point.\n *\n * @return {number} The angle in radians.\n */\nvar BetweenPoints = function (point1, point2)\n{\n return Math.atan2(point2.y - point1.y, point2.x - point1.x);\n};\n\nmodule.exports = BetweenPoints;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Find the angle of a segment from (point1.x, point1.y) -> (point2.x, point2.y).\n *\n * The difference between this method and {@link Phaser.Math.Angle.BetweenPoints} is that this assumes the y coordinate\n * travels down the screen.\n *\n * @function Phaser.Math.Angle.BetweenPointsY\n * @since 3.0.0\n *\n * @param {Phaser.Types.Math.Vector2Like} point1 - The first point.\n * @param {Phaser.Types.Math.Vector2Like} point2 - The second point.\n *\n * @return {number} The angle in radians.\n */\nvar BetweenPointsY = function (point1, point2)\n{\n return Math.atan2(point2.x - point1.x, point2.y - point1.y);\n};\n\nmodule.exports = BetweenPointsY;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Find the angle of a segment from (x1, y1) -> (x2, y2).\n *\n * The difference between this method and {@link Phaser.Math.Angle.Between} is that this assumes the y coordinate\n * travels down the screen.\n *\n * @function Phaser.Math.Angle.BetweenY\n * @since 3.0.0\n *\n * @param {number} x1 - The x coordinate of the first point.\n * @param {number} y1 - The y coordinate of the first point.\n * @param {number} x2 - The x coordinate of the second point.\n * @param {number} y2 - The y coordinate of the second point.\n *\n * @return {number} The angle in radians.\n */\nvar BetweenY = function (x1, y1, x2, y2)\n{\n return Math.atan2(x2 - x1, y2 - y1);\n};\n\nmodule.exports = BetweenY;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar CONST = require('../const');\n\n/**\n * Takes an angle in Phasers default clockwise format and converts it so that\n * 0 is North, 90 is West, 180 is South and 270 is East,\n * therefore running counter-clockwise instead of clockwise.\n * \n * You can pass in the angle from a Game Object using:\n * \n * ```javascript\n * var converted = CounterClockwise(gameobject.rotation);\n * ```\n * \n * All values for this function are in radians.\n *\n * @function Phaser.Math.Angle.CounterClockwise\n * @since 3.16.0\n *\n * @param {number} angle - The angle to convert, in radians.\n *\n * @return {number} The converted angle, in radians.\n */\nvar CounterClockwise = function (angle)\n{\n if (angle > Math.PI)\n {\n angle -= CONST.PI2;\n }\n\n return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2);\n};\n\nmodule.exports = CounterClockwise;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Normalize an angle to the [0, 2pi] range.\n *\n * @function Phaser.Math.Angle.Normalize\n * @since 3.0.0\n *\n * @param {number} angle - The angle to normalize, in radians.\n *\n * @return {number} The normalized angle, in radians.\n */\nvar Normalize = function (angle)\n{\n angle = angle % (2 * Math.PI);\n\n if (angle >= 0)\n {\n return angle;\n }\n else\n {\n return angle + 2 * Math.PI;\n }\n};\n\nmodule.exports = Normalize;\n","/**\n * @author Richard Davey \n * @author @samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar FloatBetween = require('../FloatBetween');\n\n/**\n * Returns a random angle in the range [-pi, pi].\n *\n * @function Phaser.Math.Angle.Random\n * @since 3.23.0\n *\n * @return {number} The angle, in radians.\n */\nvar Random = function ()\n{\n return FloatBetween(-Math.PI, Math.PI);\n};\n\nmodule.exports = Random;\n","/**\n * @author Richard Davey \n * @author @samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar FloatBetween = require('../FloatBetween');\n\n/**\n * Returns a random angle in the range [-180, 180].\n *\n * @function Phaser.Math.Angle.RandomDegrees\n * @since 3.23.0\n *\n * @return {number} The angle, in degrees.\n */\nvar RandomDegrees = function ()\n{\n return FloatBetween(-180, 180);\n};\n\nmodule.exports = RandomDegrees;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Normalize = require('./Normalize');\n\n/**\n * Reverse the given angle.\n *\n * @function Phaser.Math.Angle.Reverse\n * @since 3.0.0\n *\n * @param {number} angle - The angle to reverse, in radians.\n *\n * @return {number} The reversed angle, in radians.\n */\nvar Reverse = function (angle)\n{\n return Normalize(angle + Math.PI);\n};\n\nmodule.exports = Reverse;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar MATH_CONST = require('../const');\n\n/**\n * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call.\n *\n * @function Phaser.Math.Angle.RotateTo\n * @since 3.0.0\n *\n * @param {number} currentAngle - The current angle, in radians.\n * @param {number} targetAngle - The target angle to rotate to, in radians.\n * @param {number} [lerp=0.05] - The lerp value to add to the current angle.\n *\n * @return {number} The adjusted angle.\n */\nvar RotateTo = function (currentAngle, targetAngle, lerp)\n{\n if (lerp === undefined) { lerp = 0.05; }\n\n if (currentAngle === targetAngle)\n {\n return currentAngle;\n }\n\n if (Math.abs(targetAngle - currentAngle) <= lerp || Math.abs(targetAngle - currentAngle) >= (MATH_CONST.PI2 - lerp))\n {\n currentAngle = targetAngle;\n }\n else\n {\n if (Math.abs(targetAngle - currentAngle) > Math.PI)\n {\n if (targetAngle < currentAngle)\n {\n targetAngle += MATH_CONST.PI2;\n }\n else\n {\n targetAngle -= MATH_CONST.PI2;\n }\n }\n\n if (targetAngle > currentAngle)\n {\n currentAngle += lerp;\n }\n else if (targetAngle < currentAngle)\n {\n currentAngle -= lerp;\n }\n }\n\n return currentAngle;\n};\n\nmodule.exports = RotateTo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Gets the shortest angle between `angle1` and `angle2`.\n *\n * Both angles must be in the range -180 to 180, which is the same clamped\n * range that `sprite.angle` uses, so you can pass in two sprite angles to\n * this method and get the shortest angle back between the two of them.\n *\n * The angle returned will be in the same range. If the returned angle is\n * greater than 0 then it's a counter-clockwise rotation, if < 0 then it's\n * a clockwise rotation.\n *\n * TODO: Wrap the angles in this function?\n *\n * @function Phaser.Math.Angle.ShortestBetween\n * @since 3.0.0\n *\n * @param {number} angle1 - The first angle in the range -180 to 180.\n * @param {number} angle2 - The second angle in the range -180 to 180.\n *\n * @return {number} The shortest angle, in degrees. If greater than zero it's a counter-clockwise rotation.\n */\nvar ShortestBetween = function (angle1, angle2)\n{\n var difference = angle2 - angle1;\n\n if (difference === 0)\n {\n return 0;\n }\n\n var times = Math.floor((difference - (-180)) / 360);\n\n return difference - (times * 360);\n\n};\n\nmodule.exports = ShortestBetween;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar MathWrap = require('../Wrap');\n\n/**\n * Wrap an angle.\n *\n * Wraps the angle to a value in the range of -PI to PI.\n *\n * @function Phaser.Math.Angle.Wrap\n * @since 3.0.0\n *\n * @param {number} angle - The angle to wrap, in radians.\n *\n * @return {number} The wrapped angle, in radians.\n */\nvar Wrap = function (angle)\n{\n return MathWrap(angle, -Math.PI, Math.PI);\n};\n\nmodule.exports = Wrap;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Wrap = require('../Wrap');\n\n/**\n * Wrap an angle in degrees.\n *\n * Wraps the angle to a value in the range of -180 to 180.\n *\n * @function Phaser.Math.Angle.WrapDegrees\n * @since 3.0.0\n *\n * @param {number} angle - The angle to wrap, in degrees.\n *\n * @return {number} The wrapped angle, in degrees.\n */\nvar WrapDegrees = function (angle)\n{\n return Wrap(angle, -180, 180);\n};\n\nmodule.exports = WrapDegrees;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Angle\n */\n\nmodule.exports = {\n\n Between: require('./Between'),\n BetweenPoints: require('./BetweenPoints'),\n BetweenPointsY: require('./BetweenPointsY'),\n BetweenY: require('./BetweenY'),\n CounterClockwise: require('./CounterClockwise'),\n Normalize: require('./Normalize'),\n Random: require('./Random'),\n RandomDegrees: require('./RandomDegrees'),\n Reverse: require('./Reverse'),\n RotateTo: require('./RotateTo'),\n ShortestBetween: require('./ShortestBetween'),\n Wrap: require('./Wrap'),\n WrapDegrees: require('./WrapDegrees')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar MATH_CONST = {\n\n /**\n * The value of PI * 2.\n * \n * @name Phaser.Math.PI2\n * @type {number}\n * @since 3.0.0\n */\n PI2: Math.PI * 2,\n\n /**\n * The value of PI * 0.5.\n * \n * @name Phaser.Math.TAU\n * @type {number}\n * @since 3.0.0\n */\n TAU: Math.PI * 0.5,\n\n /**\n * An epsilon value (1.0e-6)\n * \n * @name Phaser.Math.EPSILON\n * @type {number}\n * @since 3.0.0\n */\n EPSILON: 1.0e-6,\n\n /**\n * For converting degrees to radians (PI / 180)\n * \n * @name Phaser.Math.DEG_TO_RAD\n * @type {number}\n * @since 3.0.0\n */\n DEG_TO_RAD: Math.PI / 180,\n\n /**\n * For converting radians to degrees (180 / PI)\n * \n * @name Phaser.Math.RAD_TO_DEG\n * @type {number}\n * @since 3.0.0\n */\n RAD_TO_DEG: 180 / Math.PI,\n\n /**\n * An instance of the Random Number Generator.\n * This is not set until the Game boots.\n * \n * @name Phaser.Math.RND\n * @type {Phaser.Math.RandomDataGenerator}\n * @since 3.0.0\n */\n RND: null,\n\n /**\n * The minimum safe integer this browser supports.\n * We use a const for backward compatibility with Internet Explorer.\n * \n * @name Phaser.Math.MIN_SAFE_INTEGER\n * @type {number}\n * @since 3.21.0\n */\n MIN_SAFE_INTEGER: Number.MIN_SAFE_INTEGER || -9007199254740991,\n\n /**\n * The maximum safe integer this browser supports.\n * We use a const for backward compatibility with Internet Explorer.\n * \n * @name Phaser.Math.MAX_SAFE_INTEGER\n * @type {number}\n * @since 3.21.0\n */\n MAX_SAFE_INTEGER: Number.MAX_SAFE_INTEGER || 9007199254740991\n\n};\n\nmodule.exports = MATH_CONST;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the distance between two sets of coordinates (points).\n *\n * @function Phaser.Math.Distance.Between\n * @since 3.0.0\n *\n * @param {number} x1 - The x coordinate of the first point.\n * @param {number} y1 - The y coordinate of the first point.\n * @param {number} x2 - The x coordinate of the second point.\n * @param {number} y2 - The y coordinate of the second point.\n *\n * @return {number} The distance between each point.\n */\nvar DistanceBetween = function (x1, y1, x2, y2)\n{\n var dx = x1 - x2;\n var dy = y1 - y2;\n\n return Math.sqrt(dx * dx + dy * dy);\n};\n\nmodule.exports = DistanceBetween;\n","/**\n * @author samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the distance between two points.\n *\n * @function Phaser.Math.Distance.BetweenPoints\n * @since 3.22.0\n *\n * @param {Phaser.Types.Math.Vector2Like} a - The first point.\n * @param {Phaser.Types.Math.Vector2Like} b - The second point.\n *\n * @return {number} The distance between the points.\n */\nvar DistanceBetweenPoints = function (a, b)\n{\n var dx = a.x - b.x;\n var dy = a.y - b.y;\n\n return Math.sqrt(dx * dx + dy * dy);\n};\n\nmodule.exports = DistanceBetweenPoints;\n","/**\n * @author samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the squared distance between two points.\n *\n * @function Phaser.Math.Distance.BetweenPointsSquared\n * @since 3.22.0\n *\n * @param {Phaser.Types.Math.Vector2Like} a - The first point.\n * @param {Phaser.Types.Math.Vector2Like} b - The second point.\n *\n * @return {number} The squared distance between the points.\n */\nvar DistanceBetweenPointsSquared = function (a, b)\n{\n var dx = a.x - b.x;\n var dy = a.y - b.y;\n\n return dx * dx + dy * dy;\n};\n\nmodule.exports = DistanceBetweenPointsSquared;\n","/**\n * @author samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the Chebyshev distance between two sets of coordinates (points).\n *\n * Chebyshev distance (or chessboard distance) is the maximum of the horizontal and vertical distances.\n * It's the effective distance when movement can be horizontal, vertical, or diagonal.\n *\n * @function Phaser.Math.Distance.Chebyshev\n * @since 3.22.0\n *\n * @param {number} x1 - The x coordinate of the first point.\n * @param {number} y1 - The y coordinate of the first point.\n * @param {number} x2 - The x coordinate of the second point.\n * @param {number} y2 - The y coordinate of the second point.\n *\n * @return {number} The distance between each point.\n */\nvar ChebyshevDistance = function (x1, y1, x2, y2)\n{\n return Math.max(Math.abs(x1 - x2), Math.abs(y1 - y2));\n};\n\nmodule.exports = ChebyshevDistance;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the distance between two sets of coordinates (points) to the power of `pow`.\n *\n * @function Phaser.Math.Distance.Power\n * @since 3.0.0\n *\n * @param {number} x1 - The x coordinate of the first point.\n * @param {number} y1 - The y coordinate of the first point.\n * @param {number} x2 - The x coordinate of the second point.\n * @param {number} y2 - The y coordinate of the second point.\n * @param {number} pow - The exponent.\n *\n * @return {number} The distance between each point.\n */\nvar DistancePower = function (x1, y1, x2, y2, pow)\n{\n if (pow === undefined) { pow = 2; }\n\n return Math.sqrt(Math.pow(x2 - x1, pow) + Math.pow(y2 - y1, pow));\n};\n\nmodule.exports = DistancePower;\n","/**\n * @author samme\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the snake distance between two sets of coordinates (points).\n *\n * Snake distance (rectilinear distance, Manhattan distance) is the sum of the horizontal and vertical distances.\n * It's the effective distance when movement is allowed only horizontally or vertically (but not both).\n *\n * @function Phaser.Math.Distance.Snake\n * @since 3.22.0\n *\n * @param {number} x1 - The x coordinate of the first point.\n * @param {number} y1 - The y coordinate of the first point.\n * @param {number} x2 - The x coordinate of the second point.\n * @param {number} y2 - The y coordinate of the second point.\n *\n * @return {number} The distance between each point.\n */\nvar SnakeDistance = function (x1, y1, x2, y2)\n{\n return Math.abs(x1 - x2) + Math.abs(y1 - y2);\n};\n\nmodule.exports = SnakeDistance;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the distance between two sets of coordinates (points), squared.\n *\n * @function Phaser.Math.Distance.Squared\n * @since 3.0.0\n *\n * @param {number} x1 - The x coordinate of the first point.\n * @param {number} y1 - The y coordinate of the first point.\n * @param {number} x2 - The x coordinate of the second point.\n * @param {number} y2 - The y coordinate of the second point.\n *\n * @return {number} The distance between each point, squared.\n */\nvar DistanceSquared = function (x1, y1, x2, y2)\n{\n var dx = x1 - x2;\n var dy = y1 - y2;\n\n return dx * dx + dy * dy;\n};\n\nmodule.exports = DistanceSquared;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Distance\n */\n\nmodule.exports = {\n\n Between: require('./DistanceBetween'),\n BetweenPoints: require('./DistanceBetweenPoints'),\n BetweenPointsSquared: require('./DistanceBetweenPointsSquared'),\n Chebyshev: require('./DistanceChebyshev'),\n Power: require('./DistancePower'),\n Snake: require('./DistanceSnake'),\n Squared: require('./DistanceSquared')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Back ease-in.\n *\n * @function Phaser.Math.Easing.Back.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n * @param {number} [overshoot=1.70158] - The overshoot amount.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v, overshoot)\n{\n if (overshoot === undefined) { overshoot = 1.70158; }\n\n return v * v * ((overshoot + 1) * v - overshoot);\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Back ease-in/out.\n *\n * @function Phaser.Math.Easing.Back.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n * @param {number} [overshoot=1.70158] - The overshoot amount.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v, overshoot)\n{\n if (overshoot === undefined) { overshoot = 1.70158; }\n\n var s = overshoot * 1.525;\n\n if ((v *= 2) < 1)\n {\n return 0.5 * (v * v * ((s + 1) * v - s));\n }\n else\n {\n return 0.5 * ((v -= 2) * v * ((s + 1) * v + s) + 2);\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Back ease-out.\n *\n * @function Phaser.Math.Easing.Back.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n * @param {number} [overshoot=1.70158] - The overshoot amount.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v, overshoot)\n{\n if (overshoot === undefined) { overshoot = 1.70158; }\n\n return --v * v * ((overshoot + 1) * v + overshoot) + 1;\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Back\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Bounce ease-in.\n *\n * @function Phaser.Math.Easing.Bounce.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n v = 1 - v;\n\n if (v < 1 / 2.75)\n {\n return 1 - (7.5625 * v * v);\n }\n else if (v < 2 / 2.75)\n {\n return 1 - (7.5625 * (v -= 1.5 / 2.75) * v + 0.75);\n }\n else if (v < 2.5 / 2.75)\n {\n return 1 - (7.5625 * (v -= 2.25 / 2.75) * v + 0.9375);\n }\n else\n {\n return 1 - (7.5625 * (v -= 2.625 / 2.75) * v + 0.984375);\n }\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Bounce ease-in/out.\n *\n * @function Phaser.Math.Easing.Bounce.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n var reverse = false;\n\n if (v < 0.5)\n {\n v = 1 - (v * 2);\n reverse = true;\n }\n else\n {\n v = (v * 2) - 1;\n }\n\n if (v < 1 / 2.75)\n {\n v = 7.5625 * v * v;\n }\n else if (v < 2 / 2.75)\n {\n v = 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\n }\n else if (v < 2.5 / 2.75)\n {\n v = 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\n }\n else\n {\n v = 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\n }\n\n if (reverse)\n {\n return (1 - v) * 0.5;\n }\n else\n {\n return v * 0.5 + 0.5;\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Bounce ease-out.\n *\n * @function Phaser.Math.Easing.Bounce.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n if (v < 1 / 2.75)\n {\n return 7.5625 * v * v;\n }\n else if (v < 2 / 2.75)\n {\n return 7.5625 * (v -= 1.5 / 2.75) * v + 0.75;\n }\n else if (v < 2.5 / 2.75)\n {\n return 7.5625 * (v -= 2.25 / 2.75) * v + 0.9375;\n }\n else\n {\n return 7.5625 * (v -= 2.625 / 2.75) * v + 0.984375;\n }\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Bounce\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Circular ease-in.\n *\n * @function Phaser.Math.Easing.Circular.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n return 1 - Math.sqrt(1 - v * v);\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Circular ease-in/out.\n *\n * @function Phaser.Math.Easing.Circular.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n if ((v *= 2) < 1)\n {\n return -0.5 * (Math.sqrt(1 - v * v) - 1);\n }\n else\n {\n return 0.5 * (Math.sqrt(1 - (v -= 2) * v) + 1);\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Circular ease-out.\n *\n * @function Phaser.Math.Easing.Circular.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n return Math.sqrt(1 - (--v * v));\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Circular\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Cubic ease-in.\n *\n * @function Phaser.Math.Easing.Cubic.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n return v * v * v;\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Cubic ease-in/out.\n *\n * @function Phaser.Math.Easing.Cubic.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n if ((v *= 2) < 1)\n {\n return 0.5 * v * v * v;\n }\n else\n {\n return 0.5 * ((v -= 2) * v * v + 2);\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Cubic ease-out.\n *\n * @function Phaser.Math.Easing.Cubic.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n return --v * v * v + 1;\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Cubic\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Elastic ease-in.\n *\n * @function Phaser.Math.Easing.Elastic.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v, amplitude, period)\n{\n if (amplitude === undefined) { amplitude = 0.1; }\n if (period === undefined) { period = 0.1; }\n\n if (v === 0)\n {\n return 0;\n }\n else if (v === 1)\n {\n return 1;\n }\n else\n {\n var s = period / 4;\n\n if (amplitude < 1)\n {\n amplitude = 1;\n }\n else\n {\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\n }\n\n return -(amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\n }\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Elastic ease-in/out.\n *\n * @function Phaser.Math.Easing.Elastic.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v, amplitude, period)\n{\n if (amplitude === undefined) { amplitude = 0.1; }\n if (period === undefined) { period = 0.1; }\n\n if (v === 0)\n {\n return 0;\n }\n else if (v === 1)\n {\n return 1;\n }\n else\n {\n var s = period / 4;\n\n if (amplitude < 1)\n {\n amplitude = 1;\n }\n else\n {\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\n }\n\n if ((v *= 2) < 1)\n {\n return -0.5 * (amplitude * Math.pow(2, 10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period));\n }\n else\n {\n return amplitude * Math.pow(2, -10 * (v -= 1)) * Math.sin((v - s) * (2 * Math.PI) / period) * 0.5 + 1;\n }\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Elastic ease-out.\n *\n * @function Phaser.Math.Easing.Elastic.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n * @param {number} [amplitude=0.1] - The amplitude of the elastic ease.\n * @param {number} [period=0.1] - Sets how tight the sine-wave is, where smaller values are tighter waves, which result in more cycles.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v, amplitude, period)\n{\n if (amplitude === undefined) { amplitude = 0.1; }\n if (period === undefined) { period = 0.1; }\n\n if (v === 0)\n {\n return 0;\n }\n else if (v === 1)\n {\n return 1;\n }\n else\n {\n var s = period / 4;\n\n if (amplitude < 1)\n {\n amplitude = 1;\n }\n else\n {\n s = period * Math.asin(1 / amplitude) / (2 * Math.PI);\n }\n\n return (amplitude * Math.pow(2, -10 * v) * Math.sin((v - s) * (2 * Math.PI) / period) + 1);\n }\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Elastic\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Exponential ease-in.\n *\n * @function Phaser.Math.Easing.Expo.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n return Math.pow(2, 10 * (v - 1)) - 0.001;\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Exponential ease-in/out.\n *\n * @function Phaser.Math.Easing.Expo.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n if ((v *= 2) < 1)\n {\n return 0.5 * Math.pow(2, 10 * (v - 1));\n }\n else\n {\n return 0.5 * (2 - Math.pow(2, -10 * (v - 1)));\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Exponential ease-out.\n *\n * @function Phaser.Math.Easing.Expo.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n return 1 - Math.pow(2, -10 * v);\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Expo\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing\n */\n\nmodule.exports = {\n\n Back: require('./back'),\n Bounce: require('./bounce'),\n Circular: require('./circular'),\n Cubic: require('./cubic'),\n Elastic: require('./elastic'),\n Expo: require('./expo'),\n Linear: require('./linear'),\n Quadratic: require('./quadratic'),\n Quartic: require('./quartic'),\n Quintic: require('./quintic'),\n Sine: require('./sine'),\n Stepped: require('./stepped')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Linear easing (no variation).\n *\n * @function Phaser.Math.Easing.Linear\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Linear = function (v)\n{\n return v;\n};\n\nmodule.exports = Linear;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nmodule.exports = require('./Linear');\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quadratic ease-in.\n *\n * @function Phaser.Math.Easing.Quadratic.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n return v * v;\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quadratic ease-in/out.\n *\n * @function Phaser.Math.Easing.Quadratic.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n if ((v *= 2) < 1)\n {\n return 0.5 * v * v;\n }\n else\n {\n return -0.5 * (--v * (v - 2) - 1);\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quadratic ease-out.\n *\n * @function Phaser.Math.Easing.Quadratic.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n return v * (2 - v);\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Quadratic\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quartic ease-in.\n *\n * @function Phaser.Math.Easing.Quartic.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n return v * v * v * v;\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quartic ease-in/out.\n *\n * @function Phaser.Math.Easing.Quartic.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n if ((v *= 2) < 1)\n {\n return 0.5 * v * v * v * v;\n }\n else\n {\n return -0.5 * ((v -= 2) * v * v * v - 2);\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quartic ease-out.\n *\n * @function Phaser.Math.Easing.Quartic.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n return 1 - (--v * v * v * v);\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Quartic\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quintic ease-in.\n *\n * @function Phaser.Math.Easing.Quintic.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n return v * v * v * v * v;\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quintic ease-in/out.\n *\n * @function Phaser.Math.Easing.Quintic.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n if ((v *= 2) < 1)\n {\n return 0.5 * v * v * v * v * v;\n }\n else\n {\n return 0.5 * ((v -= 2) * v * v * v * v + 2);\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Quintic ease-out.\n *\n * @function Phaser.Math.Easing.Quintic.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n return --v * v * v * v * v + 1;\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Quintic\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Sinusoidal ease-in.\n *\n * @function Phaser.Math.Easing.Sine.In\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar In = function (v)\n{\n if (v === 0)\n {\n return 0;\n }\n else if (v === 1)\n {\n return 1;\n }\n else\n {\n return 1 - Math.cos(v * Math.PI / 2);\n }\n};\n\nmodule.exports = In;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Sinusoidal ease-in/out.\n *\n * @function Phaser.Math.Easing.Sine.InOut\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar InOut = function (v)\n{\n if (v === 0)\n {\n return 0;\n }\n else if (v === 1)\n {\n return 1;\n }\n else\n {\n return 0.5 * (1 - Math.cos(Math.PI * v));\n }\n};\n\nmodule.exports = InOut;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Sinusoidal ease-out.\n *\n * @function Phaser.Math.Easing.Sine.Out\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n *\n * @return {number} The tweened value.\n */\nvar Out = function (v)\n{\n if (v === 0)\n {\n return 0;\n }\n else if (v === 1)\n {\n return 1;\n }\n else\n {\n return Math.sin(v * Math.PI / 2);\n }\n};\n\nmodule.exports = Out;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Sine\n */\n\nmodule.exports = {\n\n In: require('./In'),\n Out: require('./Out'),\n InOut: require('./InOut')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Stepped easing.\n *\n * @function Phaser.Math.Easing.Stepped\n * @since 3.0.0\n *\n * @param {number} v - The value to be tweened.\n * @param {number} [steps=1] - The number of steps in the ease.\n *\n * @return {number} The tweened value.\n */\nvar Stepped = function (v, steps)\n{\n if (steps === undefined) { steps = 1; }\n\n if (v <= 0)\n {\n return 0;\n }\n else if (v >= 1)\n {\n return 1;\n }\n else\n {\n return (((steps * v) | 0) + 1) * (1 / steps);\n }\n};\n\nmodule.exports = Stepped;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Easing.Stepped\n */\n\nmodule.exports = require('./Stepped');\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the fuzzy ceiling of the given value.\n *\n * @function Phaser.Math.Fuzzy.Ceil\n * @since 3.0.0\n *\n * @param {number} value - The value.\n * @param {number} [epsilon=0.0001] - The epsilon.\n *\n * @return {number} The fuzzy ceiling of the value.\n */\nvar Ceil = function (value, epsilon)\n{\n if (epsilon === undefined) { epsilon = 0.0001; }\n\n return Math.ceil(value - epsilon);\n};\n\nmodule.exports = Ceil;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Check whether the given values are fuzzily equal.\n *\n * Two numbers are fuzzily equal if their difference is less than `epsilon`.\n *\n * @function Phaser.Math.Fuzzy.Equal\n * @since 3.0.0\n *\n * @param {number} a - The first value.\n * @param {number} b - The second value.\n * @param {number} [epsilon=0.0001] - The epsilon.\n *\n * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`.\n */\nvar Equal = function (a, b, epsilon)\n{\n if (epsilon === undefined) { epsilon = 0.0001; }\n\n return Math.abs(a - b) < epsilon;\n};\n\nmodule.exports = Equal;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Calculate the fuzzy floor of the given value.\n *\n * @function Phaser.Math.Fuzzy.Floor\n * @since 3.0.0\n *\n * @param {number} value - The value.\n * @param {number} [epsilon=0.0001] - The epsilon.\n *\n * @return {number} The floor of the value.\n */\nvar Floor = function (value, epsilon)\n{\n if (epsilon === undefined) { epsilon = 0.0001; }\n\n return Math.floor(value + epsilon);\n};\n\nmodule.exports = Floor;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Check whether `a` is fuzzily greater than `b`.\n *\n * `a` is fuzzily greater than `b` if it is more than `b - epsilon`.\n *\n * @function Phaser.Math.Fuzzy.GreaterThan\n * @since 3.0.0\n *\n * @param {number} a - The first value.\n * @param {number} b - The second value.\n * @param {number} [epsilon=0.0001] - The epsilon.\n *\n * @return {boolean} `true` if `a` is fuzzily greater than than `b`, otherwise `false`.\n */\nvar GreaterThan = function (a, b, epsilon)\n{\n if (epsilon === undefined) { epsilon = 0.0001; }\n\n return a > b - epsilon;\n};\n\nmodule.exports = GreaterThan;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Check whether `a` is fuzzily less than `b`.\n *\n * `a` is fuzzily less than `b` if it is less than `b + epsilon`.\n *\n * @function Phaser.Math.Fuzzy.LessThan\n * @since 3.0.0\n *\n * @param {number} a - The first value.\n * @param {number} b - The second value.\n * @param {number} [epsilon=0.0001] - The epsilon.\n *\n * @return {boolean} `true` if `a` is fuzzily less than `b`, otherwise `false`.\n */\nvar LessThan = function (a, b, epsilon)\n{\n if (epsilon === undefined) { epsilon = 0.0001; }\n\n return a < b + epsilon;\n};\n\nmodule.exports = LessThan;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Fuzzy\n */\n\nmodule.exports = {\n\n Ceil: require('./Ceil'),\n Equal: require('./Equal'),\n Floor: require('./Floor'),\n GreaterThan: require('./GreaterThan'),\n LessThan: require('./LessThan')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar CONST = require('./const');\nvar Extend = require('../utils/object/Extend');\n\n/**\n * @namespace Phaser.Math\n */\n\nvar PhaserMath = {\n\n // Collections of functions\n Angle: require('./angle/'),\n Distance: require('./distance/'),\n Easing: require('./easing/'),\n Fuzzy: require('./fuzzy/'),\n Interpolation: require('./interpolation/'),\n Pow2: require('./pow2/'),\n Snap: require('./snap/'),\n\n // Expose the RNG Class\n RandomDataGenerator: require('./random-data-generator/RandomDataGenerator'),\n\n // Single functions\n Average: require('./Average'),\n Bernstein: require('./Bernstein'),\n Between: require('./Between'),\n CatmullRom: require('./CatmullRom'),\n CeilTo: require('./CeilTo'),\n Clamp: require('./Clamp'),\n DegToRad: require('./DegToRad'),\n Difference: require('./Difference'),\n Euler: require('./Euler'),\n Factorial: require('./Factorial'),\n FloatBetween: require('./FloatBetween'),\n FloorTo: require('./FloorTo'),\n FromPercent: require('./FromPercent'),\n GetSpeed: require('./GetSpeed'),\n IsEven: require('./IsEven'),\n IsEvenStrict: require('./IsEvenStrict'),\n Linear: require('./Linear'),\n MaxAdd: require('./MaxAdd'),\n MinSub: require('./MinSub'),\n Percent: require('./Percent'),\n RadToDeg: require('./RadToDeg'),\n RandomXY: require('./RandomXY'),\n RandomXYZ: require('./RandomXYZ'),\n RandomXYZW: require('./RandomXYZW'),\n Rotate: require('./Rotate'),\n RotateAround: require('./RotateAround'),\n RotateAroundDistance: require('./RotateAroundDistance'),\n RotateTo: require('./RotateTo'),\n RoundAwayFromZero: require('./RoundAwayFromZero'),\n RoundTo: require('./RoundTo'),\n SinCosTableGenerator: require('./SinCosTableGenerator'),\n SmootherStep: require('./SmootherStep'),\n SmoothStep: require('./SmoothStep'),\n ToXY: require('./ToXY'),\n TransformXY: require('./TransformXY'),\n Within: require('./Within'),\n Wrap: require('./Wrap'),\n\n // Vector classes\n Vector2: require('./Vector2'),\n Vector3: require('./Vector3'),\n Vector4: require('./Vector4'),\n Matrix3: require('./Matrix3'),\n Matrix4: require('./Matrix4'),\n Quaternion: require('./Quaternion'),\n RotateVec3: require('./RotateVec3')\n\n};\n\n// Merge in the consts\n\nPhaserMath = Extend(false, PhaserMath, CONST);\n\n// Export it\n\nmodule.exports = PhaserMath;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Bernstein = require('../Bernstein');\n\n/**\n * A bezier interpolation method.\n *\n * @function Phaser.Math.Interpolation.Bezier\n * @since 3.0.0\n *\n * @param {number[]} v - The input array of values to interpolate between.\n * @param {number} k - The percentage of interpolation, between 0 and 1.\n *\n * @return {number} The interpolated value.\n */\nvar BezierInterpolation = function (v, k)\n{\n var b = 0;\n var n = v.length - 1;\n\n for (var i = 0; i <= n; i++)\n {\n b += Math.pow(1 - k, n - i) * Math.pow(k, i) * v[i] * Bernstein(n, i);\n }\n\n return b;\n};\n\nmodule.exports = BezierInterpolation;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar CatmullRom = require('../CatmullRom');\n\n/**\n * A Catmull-Rom interpolation method.\n *\n * @function Phaser.Math.Interpolation.CatmullRom\n * @since 3.0.0\n *\n * @param {number[]} v - The input array of values to interpolate between.\n * @param {number} k - The percentage of interpolation, between 0 and 1.\n *\n * @return {number} The interpolated value.\n */\nvar CatmullRomInterpolation = function (v, k)\n{\n var m = v.length - 1;\n var f = m * k;\n var i = Math.floor(f);\n\n if (v[0] === v[m])\n {\n if (k < 0)\n {\n i = Math.floor(f = m * (1 + k));\n }\n\n return CatmullRom(f - i, v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m]);\n }\n else\n {\n if (k < 0)\n {\n return v[0] - (CatmullRom(-f, v[0], v[0], v[1], v[1]) - v[0]);\n }\n\n if (k > 1)\n {\n return v[m] - (CatmullRom(f - m, v[m], v[m], v[m - 1], v[m - 1]) - v[m]);\n }\n\n return CatmullRom(f - i, v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2]);\n }\n};\n\nmodule.exports = CatmullRomInterpolation;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @ignore\n */\nfunction P0 (t, p)\n{\n var k = 1 - t;\n\n return k * k * k * p;\n}\n\n/**\n * @ignore\n */\nfunction P1 (t, p)\n{\n var k = 1 - t;\n\n return 3 * k * k * t * p;\n}\n\n/**\n * @ignore\n */\nfunction P2 (t, p)\n{\n return 3 * (1 - t) * t * t * p;\n}\n\n/**\n * @ignore\n */\nfunction P3 (t, p)\n{\n return t * t * t * p;\n}\n\n/**\n * A cubic bezier interpolation method.\n *\n * https://medium.com/@adrian_cooney/bezier-interpolation-13b68563313a\n *\n * @function Phaser.Math.Interpolation.CubicBezier\n * @since 3.0.0\n *\n * @param {number} t - The percentage of interpolation, between 0 and 1.\n * @param {number} p0 - The start point.\n * @param {number} p1 - The first control point.\n * @param {number} p2 - The second control point.\n * @param {number} p3 - The end point.\n *\n * @return {number} The interpolated value.\n */\nvar CubicBezierInterpolation = function (t, p0, p1, p2, p3)\n{\n return P0(t, p0) + P1(t, p1) + P2(t, p2) + P3(t, p3);\n};\n\nmodule.exports = CubicBezierInterpolation;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Linear = require('../Linear');\n\n/**\n * A linear interpolation method.\n *\n * @function Phaser.Math.Interpolation.Linear\n * @since 3.0.0\n * @see {@link https://en.wikipedia.org/wiki/Linear_interpolation}\n *\n * @param {number[]} v - The input array of values to interpolate between.\n * @param {!number} k - The percentage of interpolation, between 0 and 1.\n *\n * @return {!number} The interpolated value.\n */\nvar LinearInterpolation = function (v, k)\n{\n var m = v.length - 1;\n var f = m * k;\n var i = Math.floor(f);\n\n if (k < 0)\n {\n return Linear(v[0], v[1], f);\n }\n else if (k > 1)\n {\n return Linear(v[m], v[m - 1], m - f);\n }\n else\n {\n return Linear(v[i], v[(i + 1 > m) ? m : i + 1], f - i);\n }\n};\n\nmodule.exports = LinearInterpolation;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @ignore\n */\nfunction P0 (t, p)\n{\n var k = 1 - t;\n\n return k * k * p;\n}\n\n/**\n * @ignore\n */\nfunction P1 (t, p)\n{\n return 2 * (1 - t) * t * p;\n}\n\n/**\n * @ignore\n */\nfunction P2 (t, p)\n{\n return t * t * p;\n}\n\n// https://github.com/mrdoob/three.js/blob/master/src/extras/core/Interpolations.js\n\n/**\n * A quadratic bezier interpolation method.\n *\n * @function Phaser.Math.Interpolation.QuadraticBezier\n * @since 3.2.0\n *\n * @param {number} t - The percentage of interpolation, between 0 and 1.\n * @param {number} p0 - The start point.\n * @param {number} p1 - The control point.\n * @param {number} p2 - The end point.\n *\n * @return {number} The interpolated value.\n */\nvar QuadraticBezierInterpolation = function (t, p0, p1, p2)\n{\n return P0(t, p0) + P1(t, p1) + P2(t, p2);\n};\n\nmodule.exports = QuadraticBezierInterpolation;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SmoothStep = require('../SmoothStep');\n\n/**\n * A Smooth Step interpolation method.\n *\n * @function Phaser.Math.Interpolation.SmoothStep\n * @since 3.9.0\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep}\n *\n * @param {number} t - The percentage of interpolation, between 0 and 1.\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\n *\n * @return {number} The interpolated value.\n */\nvar SmoothStepInterpolation = function (t, min, max)\n{\n return min + (max - min) * SmoothStep(t, 0, 1);\n};\n\nmodule.exports = SmoothStepInterpolation;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SmootherStep = require('../SmootherStep');\n\n/**\n * A Smoother Step interpolation method.\n *\n * @function Phaser.Math.Interpolation.SmootherStep\n * @since 3.9.0\n * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations}\n *\n * @param {number} t - The percentage of interpolation, between 0 and 1.\n * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'.\n * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'.\n *\n * @return {number} The interpolated value.\n */\nvar SmootherStepInterpolation = function (t, min, max)\n{\n return min + (max - min) * SmootherStep(t, 0, 1);\n};\n\nmodule.exports = SmootherStepInterpolation;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Interpolation\n */\n\nmodule.exports = {\n\n Bezier: require('./BezierInterpolation'),\n CatmullRom: require('./CatmullRomInterpolation'),\n CubicBezier: require('./CubicBezierInterpolation'),\n Linear: require('./LinearInterpolation'),\n QuadraticBezier: require('./QuadraticBezierInterpolation'),\n SmoothStep: require('./SmoothStepInterpolation'),\n SmootherStep: require('./SmootherStepInterpolation')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Returns the nearest power of 2 to the given `value`.\n *\n * @function Phaser.Math.Pow2.GetNext\n * @since 3.0.0\n *\n * @param {number} value - The value.\n *\n * @return {number} The nearest power of 2 to `value`.\n */\nvar GetPowerOfTwo = function (value)\n{\n var index = Math.log(value) / 0.6931471805599453;\n\n return (1 << Math.ceil(index));\n};\n\nmodule.exports = GetPowerOfTwo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Checks if the given `width` and `height` are a power of two.\n * Useful for checking texture dimensions.\n *\n * @function Phaser.Math.Pow2.IsSize\n * @since 3.0.0\n *\n * @param {number} width - The width.\n * @param {number} height - The height.\n *\n * @return {boolean} `true` if `width` and `height` are a power of two, otherwise `false`.\n */\nvar IsSizePowerOfTwo = function (width, height)\n{\n return (width > 0 && (width & (width - 1)) === 0 && height > 0 && (height & (height - 1)) === 0);\n};\n\nmodule.exports = IsSizePowerOfTwo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Tests the value and returns `true` if it is a power of two.\n *\n * @function Phaser.Math.Pow2.IsValue\n * @since 3.0.0\n *\n * @param {number} value - The value to check if it's a power of two.\n *\n * @return {boolean} Returns `true` if `value` is a power of two, otherwise `false`.\n */\nvar IsValuePowerOfTwo = function (value)\n{\n return (value > 0 && (value & (value - 1)) === 0);\n};\n\nmodule.exports = IsValuePowerOfTwo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Pow2\n */\n\nmodule.exports = {\n\n GetNext: require('./GetPowerOfTwo'),\n IsSize: require('./IsSizePowerOfTwo'),\n IsValue: require('./IsValuePowerOfTwo')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Class = require('../../utils/Class');\n\n/**\n * @classdesc\n * A seeded Random Data Generator.\n * \n * Access via `Phaser.Math.RND` which is an instance of this class pre-defined\n * by Phaser. Or, create your own instance to use as you require.\n * \n * The `Math.RND` generator is seeded by the Game Config property value `seed`.\n * If no such config property exists, a random number is used.\n * \n * If you create your own instance of this class you should provide a seed for it.\n * If no seed is given it will use a 'random' one based on Date.now.\n *\n * @class RandomDataGenerator\n * @memberof Phaser.Math\n * @constructor\n * @since 3.0.0\n *\n * @param {(string|string[])} [seeds] - The seeds to use for the random number generator.\n */\nvar RandomDataGenerator = new Class({\n\n initialize:\n\n function RandomDataGenerator (seeds)\n {\n if (seeds === undefined) { seeds = [ (Date.now() * Math.random()).toString() ]; }\n\n /**\n * Internal var.\n *\n * @name Phaser.Math.RandomDataGenerator#c\n * @type {number}\n * @default 1\n * @private\n * @since 3.0.0\n */\n this.c = 1;\n\n /**\n * Internal var.\n *\n * @name Phaser.Math.RandomDataGenerator#s0\n * @type {number}\n * @default 0\n * @private\n * @since 3.0.0\n */\n this.s0 = 0;\n\n /**\n * Internal var.\n *\n * @name Phaser.Math.RandomDataGenerator#s1\n * @type {number}\n * @default 0\n * @private\n * @since 3.0.0\n */\n this.s1 = 0;\n\n /**\n * Internal var.\n *\n * @name Phaser.Math.RandomDataGenerator#s2\n * @type {number}\n * @default 0\n * @private\n * @since 3.0.0\n */\n this.s2 = 0;\n\n /**\n * Internal var.\n *\n * @name Phaser.Math.RandomDataGenerator#n\n * @type {number}\n * @default 0\n * @private\n * @since 3.2.0\n */\n this.n = 0;\n\n /**\n * Signs to choose from.\n *\n * @name Phaser.Math.RandomDataGenerator#signs\n * @type {number[]}\n * @since 3.0.0\n */\n this.signs = [ -1, 1 ];\n\n if (seeds)\n {\n this.init(seeds);\n }\n },\n\n /**\n * Private random helper.\n *\n * @method Phaser.Math.RandomDataGenerator#rnd\n * @since 3.0.0\n * @private\n *\n * @return {number} A random number.\n */\n rnd: function ()\n {\n var t = 2091639 * this.s0 + this.c * 2.3283064365386963e-10; // 2^-32\n\n this.c = t | 0;\n this.s0 = this.s1;\n this.s1 = this.s2;\n this.s2 = t - this.c;\n\n return this.s2;\n },\n\n /**\n * Internal method that creates a seed hash.\n *\n * @method Phaser.Math.RandomDataGenerator#hash\n * @since 3.0.0\n * @private\n *\n * @param {string} data - The value to hash.\n *\n * @return {number} The hashed value.\n */\n hash: function (data)\n {\n var h;\n var n = this.n;\n\n data = data.toString();\n\n for (var i = 0; i < data.length; i++)\n {\n n += data.charCodeAt(i);\n h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000;// 2^32\n }\n\n this.n = n;\n\n return (n >>> 0) * 2.3283064365386963e-10;// 2^-32\n },\n\n /**\n * Initialize the state of the random data generator.\n *\n * @method Phaser.Math.RandomDataGenerator#init\n * @since 3.0.0\n *\n * @param {(string|string[])} seeds - The seeds to initialize the random data generator with.\n */\n init: function (seeds)\n {\n if (typeof seeds === 'string')\n {\n this.state(seeds);\n }\n else\n {\n this.sow(seeds);\n }\n },\n\n /**\n * Reset the seed of the random data generator.\n *\n * _Note_: the seed array is only processed up to the first `undefined` (or `null`) value, should such be present.\n *\n * @method Phaser.Math.RandomDataGenerator#sow\n * @since 3.0.0\n *\n * @param {string[]} seeds - The array of seeds: the `toString()` of each value is used.\n */\n sow: function (seeds)\n {\n // Always reset to default seed\n this.n = 0xefc8249d;\n this.s0 = this.hash(' ');\n this.s1 = this.hash(' ');\n this.s2 = this.hash(' ');\n this.c = 1;\n\n if (!seeds)\n {\n return;\n }\n\n // Apply any seeds\n for (var i = 0; i < seeds.length && (seeds[i] != null); i++)\n {\n var seed = seeds[i];\n\n this.s0 -= this.hash(seed);\n this.s0 += ~~(this.s0 < 0);\n this.s1 -= this.hash(seed);\n this.s1 += ~~(this.s1 < 0);\n this.s2 -= this.hash(seed);\n this.s2 += ~~(this.s2 < 0);\n }\n },\n\n /**\n * Returns a random integer between 0 and 2^32.\n *\n * @method Phaser.Math.RandomDataGenerator#integer\n * @since 3.0.0\n *\n * @return {number} A random integer between 0 and 2^32.\n */\n integer: function ()\n {\n // 2^32\n return this.rnd() * 0x100000000;\n },\n\n /**\n * Returns a random real number between 0 and 1.\n *\n * @method Phaser.Math.RandomDataGenerator#frac\n * @since 3.0.0\n *\n * @return {number} A random real number between 0 and 1.\n */\n frac: function ()\n {\n // 2^-53\n return this.rnd() + (this.rnd() * 0x200000 | 0) * 1.1102230246251565e-16;\n },\n\n /**\n * Returns a random real number between 0 and 2^32.\n *\n * @method Phaser.Math.RandomDataGenerator#real\n * @since 3.0.0\n *\n * @return {number} A random real number between 0 and 2^32.\n */\n real: function ()\n {\n return this.integer() + this.frac();\n },\n\n /**\n * Returns a random integer between and including min and max.\n *\n * @method Phaser.Math.RandomDataGenerator#integerInRange\n * @since 3.0.0\n *\n * @param {number} min - The minimum value in the range.\n * @param {number} max - The maximum value in the range.\n *\n * @return {number} A random number between min and max.\n */\n integerInRange: function (min, max)\n {\n return Math.floor(this.realInRange(0, max - min + 1) + min);\n },\n\n /**\n * Returns a random integer between and including min and max.\n * This method is an alias for RandomDataGenerator.integerInRange.\n *\n * @method Phaser.Math.RandomDataGenerator#between\n * @since 3.0.0\n *\n * @param {number} min - The minimum value in the range.\n * @param {number} max - The maximum value in the range.\n *\n * @return {number} A random number between min and max.\n */\n between: function (min, max)\n {\n return Math.floor(this.realInRange(0, max - min + 1) + min);\n },\n\n /**\n * Returns a random real number between min and max.\n *\n * @method Phaser.Math.RandomDataGenerator#realInRange\n * @since 3.0.0\n *\n * @param {number} min - The minimum value in the range.\n * @param {number} max - The maximum value in the range.\n *\n * @return {number} A random number between min and max.\n */\n realInRange: function (min, max)\n {\n return this.frac() * (max - min) + min;\n },\n\n /**\n * Returns a random real number between -1 and 1.\n *\n * @method Phaser.Math.RandomDataGenerator#normal\n * @since 3.0.0\n *\n * @return {number} A random real number between -1 and 1.\n */\n normal: function ()\n {\n return 1 - (2 * this.frac());\n },\n\n /**\n * Returns a valid RFC4122 version4 ID hex string from https://gist.github.com/1308368\n *\n * @method Phaser.Math.RandomDataGenerator#uuid\n * @since 3.0.0\n *\n * @return {string} A valid RFC4122 version4 ID hex string\n */\n uuid: function ()\n {\n var a = '';\n var b = '';\n\n for (b = a = ''; a++ < 36; b += ~a % 5 | a * 3 & 4 ? (a ^ 15 ? 8 ^ this.frac() * (a ^ 20 ? 16 : 4) : 4).toString(16) : '-')\n {\n // eslint-disable-next-line no-empty\n }\n\n return b;\n },\n\n /**\n * Returns a random element from within the given array.\n *\n * @method Phaser.Math.RandomDataGenerator#pick\n * @since 3.0.0\n * \n * @generic T\n * @genericUse {T[]} - [array]\n * @genericUse {T} - [$return]\n *\n * @param {T[]} array - The array to pick a random element from.\n *\n * @return {T} A random member of the array.\n */\n pick: function (array)\n {\n return array[this.integerInRange(0, array.length - 1)];\n },\n\n /**\n * Returns a sign to be used with multiplication operator.\n *\n * @method Phaser.Math.RandomDataGenerator#sign\n * @since 3.0.0\n *\n * @return {number} -1 or +1.\n */\n sign: function ()\n {\n return this.pick(this.signs);\n },\n\n /**\n * Returns a random element from within the given array, favoring the earlier entries.\n *\n * @method Phaser.Math.RandomDataGenerator#weightedPick\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[]} - [array]\n * @genericUse {T} - [$return]\n *\n * @param {T[]} array - The array to pick a random element from.\n *\n * @return {T} A random member of the array.\n */\n weightedPick: function (array)\n {\n return array[~~(Math.pow(this.frac(), 2) * (array.length - 1) + 0.5)];\n },\n\n /**\n * Returns a random timestamp between min and max, or between the beginning of 2000 and the end of 2020 if min and max aren't specified.\n *\n * @method Phaser.Math.RandomDataGenerator#timestamp\n * @since 3.0.0\n *\n * @param {number} min - The minimum value in the range.\n * @param {number} max - The maximum value in the range.\n *\n * @return {number} A random timestamp between min and max.\n */\n timestamp: function (min, max)\n {\n return this.realInRange(min || 946684800000, max || 1577862000000);\n },\n\n /**\n * Returns a random angle between -180 and 180.\n *\n * @method Phaser.Math.RandomDataGenerator#angle\n * @since 3.0.0\n *\n * @return {number} A random number between -180 and 180.\n */\n angle: function ()\n {\n return this.integerInRange(-180, 180);\n },\n\n /**\n * Returns a random rotation in radians, between -3.141 and 3.141\n *\n * @method Phaser.Math.RandomDataGenerator#rotation\n * @since 3.0.0\n *\n * @return {number} A random number between -3.141 and 3.141\n */\n rotation: function ()\n {\n return this.realInRange(-3.1415926, 3.1415926);\n },\n\n /**\n * Gets or Sets the state of the generator. This allows you to retain the values\n * that the generator is using between games, i.e. in a game save file.\n *\n * To seed this generator with a previously saved state you can pass it as the\n * `seed` value in your game config, or call this method directly after Phaser has booted.\n *\n * Call this method with no parameters to return the current state.\n *\n * If providing a state it should match the same format that this method\n * returns, which is a string with a header `!rnd` followed by the `c`,\n * `s0`, `s1` and `s2` values respectively, each comma-delimited.\n *\n * @method Phaser.Math.RandomDataGenerator#state\n * @since 3.0.0\n *\n * @param {string} [state] - Generator state to be set.\n *\n * @return {string} The current state of the generator.\n */\n state: function (state)\n {\n if (typeof state === 'string' && state.match(/^!rnd/))\n {\n state = state.split(',');\n\n this.c = parseFloat(state[1]);\n this.s0 = parseFloat(state[2]);\n this.s1 = parseFloat(state[3]);\n this.s2 = parseFloat(state[4]);\n }\n\n return [ '!rnd', this.c, this.s0, this.s1, this.s2 ].join(',');\n },\n\n /**\n * Shuffles the given array, using the current seed.\n *\n * @method Phaser.Math.RandomDataGenerator#shuffle\n * @since 3.7.0\n *\n * @generic T\n * @genericUse {T[]} - [array,$return]\n *\n * @param {T[]} [array] - The array to be shuffled.\n *\n * @return {T[]} The shuffled array.\n */\n shuffle: function (array)\n {\n var len = array.length - 1;\n\n for (var i = len; i > 0; i--)\n {\n var randomIndex = Math.floor(this.frac() * (i + 1));\n var itemAtIndex = array[randomIndex];\n\n array[randomIndex] = array[i];\n array[i] = itemAtIndex;\n }\n\n return array;\n }\n\n});\n\nmodule.exports = RandomDataGenerator;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Snap a value to nearest grid slice, using ceil.\n *\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `15`.\n * As will `14` snap to `15`... but `16` will snap to `20`.\n *\n * @function Phaser.Math.Snap.Ceil\n * @since 3.0.0\n *\n * @param {number} value - The value to snap.\n * @param {number} gap - The interval gap of the grid.\n * @param {number} [start=0] - Optional starting offset for gap.\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\n *\n * @return {number} The snapped value.\n */\nvar SnapCeil = function (value, gap, start, divide)\n{\n if (start === undefined) { start = 0; }\n\n if (gap === 0)\n {\n return value;\n }\n\n value -= start;\n value = gap * Math.ceil(value / gap);\n\n return (divide) ? (start + value) / gap : start + value;\n};\n\nmodule.exports = SnapCeil;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Snap a value to nearest grid slice, using floor.\n *\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10`.\n * As will `14` snap to `10`... but `16` will snap to `15`.\n *\n * @function Phaser.Math.Snap.Floor\n * @since 3.0.0\n *\n * @param {number} value - The value to snap.\n * @param {number} gap - The interval gap of the grid.\n * @param {number} [start=0] - Optional starting offset for gap.\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\n *\n * @return {number} The snapped value.\n */\nvar SnapFloor = function (value, gap, start, divide)\n{\n if (start === undefined) { start = 0; }\n\n if (gap === 0)\n {\n return value;\n }\n\n value -= start;\n value = gap * Math.floor(value / gap);\n\n return (divide) ? (start + value) / gap : start + value;\n};\n\nmodule.exports = SnapFloor;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Snap a value to nearest grid slice, using rounding.\n *\n * Example: if you have an interval gap of `5` and a position of `12`... you will snap to `10` whereas `14` will snap to `15`.\n *\n * @function Phaser.Math.Snap.To\n * @since 3.0.0\n *\n * @param {number} value - The value to snap.\n * @param {number} gap - The interval gap of the grid.\n * @param {number} [start=0] - Optional starting offset for gap.\n * @param {boolean} [divide=false] - If `true` it will divide the snapped value by the gap before returning.\n *\n * @return {number} The snapped value.\n */\nvar SnapTo = function (value, gap, start, divide)\n{\n if (start === undefined) { start = 0; }\n\n if (gap === 0)\n {\n return value;\n }\n\n value -= start;\n value = gap * Math.round(value / gap);\n\n return (divide) ? (start + value) / gap : start + value;\n};\n\nmodule.exports = SnapTo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Math.Snap\n */\n\nmodule.exports = {\n\n Ceil: require('./SnapCeil'),\n Floor: require('./SnapFloor'),\n To: require('./SnapTo')\n\n};\n","/**\n* @author Richard Davey \n* @copyright 2020 Photon Storm Ltd.\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\n*/\n\nvar Class = require('../utils/Class');\n\n/**\n * @classdesc\n * A Global Plugin is installed just once into the Game owned Plugin Manager.\n * It can listen for Game events and respond to them.\n *\n * @class BasePlugin\n * @memberof Phaser.Plugins\n * @constructor\n * @since 3.8.0\n *\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\n */\nvar BasePlugin = new Class({\n\n initialize:\n\n function BasePlugin (pluginManager)\n {\n /**\n * A handy reference to the Plugin Manager that is responsible for this plugin.\n * Can be used as a route to gain access to game systems and events.\n *\n * @name Phaser.Plugins.BasePlugin#pluginManager\n * @type {Phaser.Plugins.PluginManager}\n * @protected\n * @since 3.8.0\n */\n this.pluginManager = pluginManager;\n\n /**\n * A reference to the Game instance this plugin is running under.\n *\n * @name Phaser.Plugins.BasePlugin#game\n * @type {Phaser.Game}\n * @protected\n * @since 3.8.0\n */\n this.game = pluginManager.game;\n },\n\n /**\n * The PluginManager calls this method on a Global Plugin when the plugin is first instantiated.\n * It will never be called again on this instance.\n * In here you can set-up whatever you need for this plugin to run.\n * If a plugin is set to automatically start then `BasePlugin.start` will be called immediately after this.\n * On a Scene Plugin, this method is never called. Use {@link Phaser.Plugins.ScenePlugin#boot} instead.\n *\n * @method Phaser.Plugins.BasePlugin#init\n * @since 3.8.0\n *\n * @param {?any} [data] - A value specified by the user, if any, from the `data` property of the plugin's configuration object (if started at game boot) or passed in the PluginManager's `install` method (if started manually).\n */\n init: function ()\n {\n },\n\n /**\n * The PluginManager calls this method on a Global Plugin when the plugin is started.\n * If a plugin is stopped, and then started again, this will get called again.\n * Typically called immediately after `BasePlugin.init`.\n * On a Scene Plugin, this method is never called.\n *\n * @method Phaser.Plugins.BasePlugin#start\n * @since 3.8.0\n */\n start: function ()\n {\n // Here are the game-level events you can listen to.\n // At the very least you should offer a destroy handler for when the game closes down.\n\n // var eventEmitter = this.game.events;\n\n // eventEmitter.once('destroy', this.gameDestroy, this);\n // eventEmitter.on('pause', this.gamePause, this);\n // eventEmitter.on('resume', this.gameResume, this);\n // eventEmitter.on('resize', this.gameResize, this);\n // eventEmitter.on('prestep', this.gamePreStep, this);\n // eventEmitter.on('step', this.gameStep, this);\n // eventEmitter.on('poststep', this.gamePostStep, this);\n // eventEmitter.on('prerender', this.gamePreRender, this);\n // eventEmitter.on('postrender', this.gamePostRender, this);\n },\n\n /**\n * The PluginManager calls this method on a Global Plugin when the plugin is stopped.\n * The game code has requested that your plugin stop doing whatever it does.\n * It is now considered as 'inactive' by the PluginManager.\n * Handle that process here (i.e. stop listening for events, etc)\n * If the plugin is started again then `BasePlugin.start` will be called again.\n * On a Scene Plugin, this method is never called.\n *\n * @method Phaser.Plugins.BasePlugin#stop\n * @since 3.8.0\n */\n stop: function ()\n {\n },\n\n /**\n * Game instance has been destroyed.\n * You must release everything in here, all references, all objects, free it all up.\n *\n * @method Phaser.Plugins.BasePlugin#destroy\n * @since 3.8.0\n */\n destroy: function ()\n {\n this.pluginManager = null;\n this.game = null;\n this.scene = null;\n this.systems = null;\n }\n\n});\n\nmodule.exports = BasePlugin;\n","/**\n* @author Richard Davey \n* @copyright 2020 Photon Storm Ltd.\n* @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License}\n*/\n\nvar BasePlugin = require('./BasePlugin');\nvar Class = require('../utils/Class');\nvar SceneEvents = require('../scene/events');\n\n/**\n * @classdesc\n * A Scene Level Plugin is installed into every Scene and belongs to that Scene.\n * It can listen for Scene events and respond to them.\n * It can map itself to a Scene property, or into the Scene Systems, or both.\n *\n * @class ScenePlugin\n * @memberof Phaser.Plugins\n * @extends Phaser.Plugins.BasePlugin\n * @constructor\n * @since 3.8.0\n *\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Plugin Manager.\n */\nvar ScenePlugin = new Class({\n\n Extends: BasePlugin,\n\n initialize:\n\n function ScenePlugin (scene, pluginManager)\n {\n BasePlugin.call(this, pluginManager);\n\n /**\n * A reference to the Scene that has installed this plugin.\n * Only set if it's a Scene Plugin, otherwise `null`.\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\n * You can use it during the `boot` method.\n *\n * @name Phaser.Plugins.ScenePlugin#scene\n * @type {?Phaser.Scene}\n * @protected\n * @since 3.8.0\n */\n this.scene = scene;\n\n /**\n * A reference to the Scene Systems of the Scene that has installed this plugin.\n * Only set if it's a Scene Plugin, otherwise `null`.\n * This property is only set when the plugin is instantiated and added to the Scene, not before.\n * You can use it during the `boot` method.\n *\n * @name Phaser.Plugins.ScenePlugin#systems\n * @type {?Phaser.Scenes.Systems}\n * @protected\n * @since 3.8.0\n */\n this.systems = scene.sys;\n\n scene.sys.events.once(SceneEvents.BOOT, this.boot, this);\n },\n\n /**\n * This method is called when the Scene boots. It is only ever called once.\n *\n * By this point the plugin properties `scene` and `systems` will have already been set.\n *\n * In here you can listen for {@link Phaser.Scenes.Events Scene events} and set-up whatever you need for this plugin to run.\n * Here are the Scene events you can listen to:\n *\n * - start\n * - ready\n * - preupdate\n * - update\n * - postupdate\n * - resize\n * - pause\n * - resume\n * - sleep\n * - wake\n * - transitioninit\n * - transitionstart\n * - transitioncomplete\n * - transitionout\n * - shutdown\n * - destroy\n *\n * At the very least you should offer a destroy handler for when the Scene closes down, i.e:\n *\n * ```javascript\n * var eventEmitter = this.systems.events;\n * eventEmitter.once('destroy', this.sceneDestroy, this);\n * ```\n *\n * @method Phaser.Plugins.ScenePlugin#boot\n * @since 3.8.0\n */\n boot: function ()\n {\n },\n\n /**\n * Game instance has been destroyed.\n * \n * You must release everything in here, all references, all objects, free it all up.\n *\n * @method Phaser.Plugins.ScenePlugin#destroy\n * @since 3.8.0\n */\n destroy: function ()\n {\n this.pluginManager = null;\n this.game = null;\n this.scene = null;\n this.systems = null;\n }\n\n});\n\nmodule.exports = ScenePlugin;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Phaser Blend Modes.\n * \n * @namespace Phaser.BlendModes\n * @since 3.0.0\n */\n\nmodule.exports = {\n\n /**\n * Skips the Blend Mode check in the renderer.\n * \n * @name Phaser.BlendModes.SKIP_CHECK\n * @type {number}\n * @const\n * @since 3.0.0\n */\n SKIP_CHECK: -1,\n\n /**\n * Normal blend mode. For Canvas and WebGL.\n * This is the default setting and draws new shapes on top of the existing canvas content.\n * \n * @name Phaser.BlendModes.NORMAL\n * @type {number}\n * @const\n * @since 3.0.0\n */\n NORMAL: 0,\n\n /**\n * Add blend mode. For Canvas and WebGL.\n * Where both shapes overlap the color is determined by adding color values.\n * \n * @name Phaser.BlendModes.ADD\n * @type {number}\n * @const\n * @since 3.0.0\n */\n ADD: 1,\n\n /**\n * Multiply blend mode. For Canvas and WebGL.\n * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result.\n * \n * @name Phaser.BlendModes.MULTIPLY\n * @type {number}\n * @const\n * @since 3.0.0\n */\n MULTIPLY: 2,\n\n /**\n * Screen blend mode. For Canvas and WebGL.\n * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply)\n * \n * @name Phaser.BlendModes.SCREEN\n * @type {number}\n * @const\n * @since 3.0.0\n */\n SCREEN: 3,\n\n /**\n * Overlay blend mode. For Canvas only.\n * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter.\n * \n * @name Phaser.BlendModes.OVERLAY\n * @type {number}\n * @const\n * @since 3.0.0\n */\n OVERLAY: 4,\n\n /**\n * Darken blend mode. For Canvas only.\n * Retains the darkest pixels of both layers.\n * \n * @name Phaser.BlendModes.DARKEN\n * @type {number}\n * @const\n * @since 3.0.0\n */\n DARKEN: 5,\n\n /**\n * Lighten blend mode. For Canvas only.\n * Retains the lightest pixels of both layers.\n * \n * @name Phaser.BlendModes.LIGHTEN\n * @type {number}\n * @const\n * @since 3.0.0\n */\n LIGHTEN: 6,\n\n /**\n * Color Dodge blend mode. For Canvas only.\n * Divides the bottom layer by the inverted top layer.\n * \n * @name Phaser.BlendModes.COLOR_DODGE\n * @type {number}\n * @const\n * @since 3.0.0\n */\n COLOR_DODGE: 7,\n\n /**\n * Color Burn blend mode. For Canvas only.\n * Divides the inverted bottom layer by the top layer, and then inverts the result.\n * \n * @name Phaser.BlendModes.COLOR_BURN\n * @type {number}\n * @const\n * @since 3.0.0\n */\n COLOR_BURN: 8,\n\n /**\n * Hard Light blend mode. For Canvas only.\n * A combination of multiply and screen like overlay, but with top and bottom layer swapped.\n * \n * @name Phaser.BlendModes.HARD_LIGHT\n * @type {number}\n * @const\n * @since 3.0.0\n */\n HARD_LIGHT: 9,\n\n /**\n * Soft Light blend mode. For Canvas only.\n * A softer version of hard-light. Pure black or white does not result in pure black or white.\n * \n * @name Phaser.BlendModes.SOFT_LIGHT\n * @type {number}\n * @const\n * @since 3.0.0\n */\n SOFT_LIGHT: 10,\n\n /**\n * Difference blend mode. For Canvas only.\n * Subtracts the bottom layer from the top layer or the other way round to always get a positive value.\n * \n * @name Phaser.BlendModes.DIFFERENCE\n * @type {number}\n * @const\n * @since 3.0.0\n */\n DIFFERENCE: 11,\n\n /**\n * Exclusion blend mode. For Canvas only.\n * Like difference, but with lower contrast.\n * \n * @name Phaser.BlendModes.EXCLUSION\n * @type {number}\n * @const\n * @since 3.0.0\n */\n EXCLUSION: 12,\n\n /**\n * Hue blend mode. For Canvas only.\n * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer.\n * \n * @name Phaser.BlendModes.HUE\n * @type {number}\n * @const\n * @since 3.0.0\n */\n HUE: 13,\n\n /**\n * Saturation blend mode. For Canvas only.\n * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer.\n * \n * @name Phaser.BlendModes.SATURATION\n * @type {number}\n * @const\n * @since 3.0.0\n */\n SATURATION: 14,\n\n /**\n * Color blend mode. For Canvas only.\n * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer.\n * \n * @name Phaser.BlendModes.COLOR\n * @type {number}\n * @const\n * @since 3.0.0\n */\n COLOR: 15,\n\n /**\n * Luminosity blend mode. For Canvas only.\n * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer.\n * \n * @name Phaser.BlendModes.LUMINOSITY\n * @type {number}\n * @const\n * @since 3.0.0\n */\n LUMINOSITY: 16,\n\n /**\n * Alpha erase blend mode. For Canvas and WebGL.\n * \n * @name Phaser.BlendModes.ERASE\n * @type {number}\n * @const\n * @since 3.0.0\n */\n ERASE: 17,\n\n /**\n * Source-in blend mode. For Canvas only.\n * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent.\n * \n * @name Phaser.BlendModes.SOURCE_IN\n * @type {number}\n * @const\n * @since 3.0.0\n */\n SOURCE_IN: 18,\n\n /**\n * Source-out blend mode. For Canvas only.\n * The new shape is drawn where it doesn't overlap the existing canvas content.\n * \n * @name Phaser.BlendModes.SOURCE_OUT\n * @type {number}\n * @const\n * @since 3.0.0\n */\n SOURCE_OUT: 19,\n\n /**\n * Source-out blend mode. For Canvas only.\n * The new shape is only drawn where it overlaps the existing canvas content.\n * \n * @name Phaser.BlendModes.SOURCE_ATOP\n * @type {number}\n * @const\n * @since 3.0.0\n */\n SOURCE_ATOP: 20,\n\n /**\n * Destination-over blend mode. For Canvas only.\n * New shapes are drawn behind the existing canvas content.\n * \n * @name Phaser.BlendModes.DESTINATION_OVER\n * @type {number}\n * @const\n * @since 3.0.0\n */\n DESTINATION_OVER: 21,\n\n /**\n * Destination-in blend mode. For Canvas only.\n * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent.\n * \n * @name Phaser.BlendModes.DESTINATION_IN\n * @type {number}\n * @const\n * @since 3.0.0\n */\n DESTINATION_IN: 22,\n\n /**\n * Destination-out blend mode. For Canvas only.\n * The existing content is kept where it doesn't overlap the new shape.\n * \n * @name Phaser.BlendModes.DESTINATION_OUT\n * @type {number}\n * @const\n * @since 3.0.0\n */\n DESTINATION_OUT: 23,\n\n /**\n * Destination-out blend mode. For Canvas only.\n * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content.\n * \n * @name Phaser.BlendModes.DESTINATION_ATOP\n * @type {number}\n * @const\n * @since 3.0.0\n */\n DESTINATION_ATOP: 24,\n\n /**\n * Lighten blend mode. For Canvas only.\n * Where both shapes overlap the color is determined by adding color values.\n * \n * @name Phaser.BlendModes.LIGHTER\n * @type {number}\n * @const\n * @since 3.0.0\n */\n LIGHTER: 25,\n\n /**\n * Copy blend mode. For Canvas only.\n * Only the new shape is shown.\n * \n * @name Phaser.BlendModes.COPY\n * @type {number}\n * @const\n * @since 3.0.0\n */\n COPY: 26,\n\n /**\n * Xor blend mode. For Canvas only.\n * Shapes are made transparent where both overlap and drawn normal everywhere else.\n * \n * @name Phaser.BlendModes.XOR\n * @type {number}\n * @const\n * @since 3.0.0\n */\n XOR: 27\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Post-Render Event.\n *\n * This event is dispatched by the Renderer when all rendering, for all cameras in all Scenes,\n * has completed, but before any pending snap shots have been taken.\n *\n * @event Phaser.Renderer.Events#POST_RENDER\n * @since 3.50.0\n */\nmodule.exports = 'postrender';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Pre-Render Event.\n *\n * This event is dispatched by the Phaser Renderer. This happens right at the start of the render\n * process, after the context has been cleared, the scissors enabled (WebGL only) and everything has been\n * reset ready for the render.\n *\n * @event Phaser.Renderer.Events#PRE_RENDER\n * @since 3.50.0\n */\nmodule.exports = 'prerender';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Render Event.\n *\n * This event is dispatched by the Phaser Renderer for every camera in every Scene.\n *\n * It is dispatched before any of the children in the Scene have been rendered.\n *\n * @event Phaser.Renderer.Events#RENDER\n * @since 3.50.0\n *\n * @param {Phaser.Scene} scene - The Scene being rendered.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered.\n */\nmodule.exports = 'render';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Renderer Resize Event.\n *\n * This event is dispatched by the Phaser Renderer when it is resized, usually as a result\n * of the Scale Manager resizing.\n *\n * @event Phaser.Renderer.Events#RESIZE\n * @since 3.50.0\n *\n * @param {number} width - The new width of the renderer.\n * @param {number} height - The new height of the renderer.\n */\nmodule.exports = 'resize';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Renderer.Events\n */\n\nmodule.exports = {\n\n POST_RENDER: require('./POST_RENDER_EVENT'),\n PRE_RENDER: require('./PRE_RENDER_EVENT'),\n RENDER: require('./RENDER_EVENT'),\n RESIZE: require('./RESIZE_EVENT')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar PIPELINE_CONST = {\n\n /**\n * The Bitmap Mask Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n BITMAPMASK_PIPELINE: 'BitmapMaskPipeline',\n\n /**\n * The Light 2D Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n LIGHT_PIPELINE: 'Light2D',\n\n /**\n * The Point Light Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.POINTLIGHT_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n POINTLIGHT_PIPELINE: 'PointLightPipeline',\n\n /**\n * The Single Texture Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n SINGLE_PIPELINE: 'SinglePipeline',\n\n /**\n * The Multi Texture Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n MULTI_PIPELINE: 'MultiPipeline',\n\n /**\n * The Rope Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n ROPE_PIPELINE: 'RopePipeline',\n\n /**\n * The Graphics and Shapes Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.GRAPHICS_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n GRAPHICS_PIPELINE: 'GraphicsPipeline',\n\n /**\n * The Post FX Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.POSTFX_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n POSTFX_PIPELINE: 'PostFXPipeline',\n\n /**\n * The Utility Pipeline.\n *\n * @name Phaser.Renderer.WebGL.Pipelines.UTILITY_PIPELINE\n * @type {string}\n * @const\n * @since 3.50.0\n */\n UTILITY_PIPELINE: 'UtilityPipeline'\n};\n\nmodule.exports = PIPELINE_CONST;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scale Manager Resize Event.\n *\n * This event is dispatched whenever the Scale Manager detects a resize event from the browser.\n * It sends three parameters to the callback, each of them being Size components. You can read\n * the `width`, `height`, `aspectRatio` and other properties of these components to help with\n * scaling your own game content.\n *\n * @event Phaser.Scale.Events#RESIZE\n * @since 3.16.1\n *\n * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas.\n * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size.\n * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode.\n * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width.\n * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height.\n */\nmodule.exports = 'resize';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Added to Scene Event.\n *\n * This event is dispatched when a Game Object is added to a Scene.\n *\n * Listen for it from a Scene using `this.scene.events.on('addedtoscene', listener)`.\n *\n * @event Phaser.Scenes.Events#ADDED_TO_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the Scene.\n * @param {Phaser.Scene} scene - The Scene to which the Game Object was added.\n */\nmodule.exports = 'addedtoscene';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Boot Event.\n * \n * This event is dispatched by a Scene during the Scene Systems boot process. Primarily used by Scene Plugins.\n * \n * Listen to it from a Scene using `this.scene.events.on('boot', listener)`.\n * \n * @event Phaser.Scenes.Events#BOOT\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n */\nmodule.exports = 'boot';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Create Event.\n * \n * This event is dispatched by a Scene after it has been created by the Scene Manager.\n * \n * If a Scene has a `create` method then this event is emitted _after_ that has run.\n * \n * If there is a transition, this event will be fired after the `TRANSITION_START` event.\n * \n * Listen to it from a Scene using `this.scene.events.on('create', listener)`.\n * \n * @event Phaser.Scenes.Events#CREATE\n * @since 3.17.0\n * \n * @param {Phaser.Scene} scene - A reference to the Scene that emitted this event.\n */\nmodule.exports = 'create';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Destroy Event.\n * \n * This event is dispatched by a Scene during the Scene Systems destroy process.\n * \n * Listen to it from a Scene using `this.scene.events.on('destroy', listener)`.\n * \n * You should destroy any resources that may be in use by your Scene in this event handler.\n * \n * @event Phaser.Scenes.Events#DESTROY\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n */\nmodule.exports = 'destroy';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Pause Event.\n * \n * This event is dispatched by a Scene when it is paused, either directly via the `pause` method, or as an\n * action from another Scene.\n * \n * Listen to it from a Scene using `this.scene.events.on('pause', listener)`.\n * \n * @event Phaser.Scenes.Events#PAUSE\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {any} [data] - An optional data object that was passed to this Scene when it was paused.\n */\nmodule.exports = 'pause';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Post Update Event.\n * \n * This event is dispatched by a Scene during the main game loop step.\n * \n * The event flow for a single step of a Scene is as follows:\n * \n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\n * 3. The `Scene.update` method is called, if it exists\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\n * \n * Listen to it from a Scene using `this.scene.events.on('postupdate', listener)`.\n * \n * A Scene will only run its step if it is active.\n * \n * @event Phaser.Scenes.Events#POST_UPDATE\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\n */\nmodule.exports = 'postupdate';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Pre Update Event.\n * \n * This event is dispatched by a Scene during the main game loop step.\n * \n * The event flow for a single step of a Scene is as follows:\n * \n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\n * 3. The `Scene.update` method is called, if it exists\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\n * \n * Listen to it from a Scene using `this.scene.events.on('preupdate', listener)`.\n * \n * A Scene will only run its step if it is active.\n * \n * @event Phaser.Scenes.Events#PRE_UPDATE\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\n */\nmodule.exports = 'preupdate';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Ready Event.\n * \n * This event is dispatched by a Scene during the Scene Systems start process.\n * By this point in the process the Scene is now fully active and rendering.\n * This event is meant for your game code to use, as all plugins have responded to the earlier 'start' event.\n * \n * Listen to it from a Scene using `this.scene.events.on('ready', listener)`.\n * \n * @event Phaser.Scenes.Events#READY\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {any} [data] - An optional data object that was passed to this Scene when it was started.\n */\nmodule.exports = 'ready';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Game Object Removed from Scene Event.\n *\n * This event is dispatched when a Game Object is removed from a Scene.\n *\n * Listen for it from a Scene using `this.scene.events.on('removedfromscene', listener)`.\n *\n * @event Phaser.Scenes.Events#REMOVED_FROM_SCENE\n * @since 3.50.0\n *\n * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the Scene.\n * @param {Phaser.Scene} scene - The Scene from which the Game Object was removed.\n */\nmodule.exports = 'removedfromscene';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Render Event.\n * \n * This event is dispatched by a Scene during the main game loop step.\n * \n * The event flow for a single step of a Scene is as follows:\n * \n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\n * 3. The `Scene.update` method is called, if it exists\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\n * \n * Listen to it from a Scene using `this.scene.events.on('render', listener)`.\n * \n * A Scene will only render if it is visible and active.\n * By the time this event is dispatched, the Scene will have already been rendered.\n * \n * @event Phaser.Scenes.Events#RENDER\n * @since 3.0.0\n * \n * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The renderer that rendered the Scene.\n */\nmodule.exports = 'render';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Resume Event.\n * \n * This event is dispatched by a Scene when it is resumed from a paused state, either directly via the `resume` method,\n * or as an action from another Scene.\n * \n * Listen to it from a Scene using `this.scene.events.on('resume', listener)`.\n * \n * @event Phaser.Scenes.Events#RESUME\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {any} [data] - An optional data object that was passed to this Scene when it was resumed.\n */\nmodule.exports = 'resume';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Shutdown Event.\n * \n * This event is dispatched by a Scene during the Scene Systems shutdown process.\n * \n * Listen to it from a Scene using `this.scene.events.on('shutdown', listener)`.\n * \n * You should free-up any resources that may be in use by your Scene in this event handler, on the understanding\n * that the Scene may, at any time, become active again. A shutdown Scene is not 'destroyed', it's simply not\n * currently active. Use the [DESTROY]{@linkcode Phaser.Scenes.Events#event:DESTROY} event to completely clear resources.\n * \n * @event Phaser.Scenes.Events#SHUTDOWN\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {any} [data] - An optional data object that was passed to this Scene when it was shutdown.\n */\nmodule.exports = 'shutdown';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Sleep Event.\n * \n * This event is dispatched by a Scene when it is sent to sleep, either directly via the `sleep` method,\n * or as an action from another Scene.\n * \n * Listen to it from a Scene using `this.scene.events.on('sleep', listener)`.\n * \n * @event Phaser.Scenes.Events#SLEEP\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {any} [data] - An optional data object that was passed to this Scene when it was sent to sleep.\n */\nmodule.exports = 'sleep';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Start Event.\n * \n * This event is dispatched by a Scene during the Scene Systems start process. Primarily used by Scene Plugins.\n * \n * Listen to it from a Scene using `this.scene.events.on('start', listener)`.\n * \n * @event Phaser.Scenes.Events#START\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n */\nmodule.exports = 'start';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Transition Complete Event.\n * \n * This event is dispatched by the Target Scene of a transition.\n * \n * It happens when the transition process has completed. This occurs when the duration timer equals or exceeds the duration\n * of the transition.\n * \n * Listen to it from a Scene using `this.scene.events.on('transitioncomplete', listener)`.\n * \n * The Scene Transition event flow is as follows:\n * \n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\n * \n * @event Phaser.Scenes.Events#TRANSITION_COMPLETE\n * @since 3.5.0\n * \n * @param {Phaser.Scene} scene -The Scene on which the transitioned completed.\n */\nmodule.exports = 'transitioncomplete';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Transition Init Event.\n * \n * This event is dispatched by the Target Scene of a transition.\n * \n * It happens immediately after the `Scene.init` method is called. If the Scene does not have an `init` method,\n * this event is not dispatched.\n * \n * Listen to it from a Scene using `this.scene.events.on('transitioninit', listener)`.\n * \n * The Scene Transition event flow is as follows:\n * \n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\n * \n * @event Phaser.Scenes.Events#TRANSITION_INIT\n * @since 3.5.0\n * \n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\n * @param {number} duration - The duration of the transition in ms.\n */\nmodule.exports = 'transitioninit';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Transition Out Event.\n * \n * This event is dispatched by a Scene when it initiates a transition to another Scene.\n * \n * Listen to it from a Scene using `this.scene.events.on('transitionout', listener)`.\n * \n * The Scene Transition event flow is as follows:\n * \n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\n * \n * @event Phaser.Scenes.Events#TRANSITION_OUT\n * @since 3.5.0\n * \n * @param {Phaser.Scene} target - A reference to the Scene that is being transitioned to.\n * @param {number} duration - The duration of the transition in ms.\n */\nmodule.exports = 'transitionout';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Transition Start Event.\n * \n * This event is dispatched by the Target Scene of a transition, only if that Scene was not asleep.\n * \n * It happens immediately after the `Scene.create` method is called. If the Scene does not have a `create` method,\n * this event is dispatched anyway.\n * \n * If the Target Scene was sleeping then the [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} event is\n * dispatched instead of this event.\n * \n * Listen to it from a Scene using `this.scene.events.on('transitionstart', listener)`.\n * \n * The Scene Transition event flow is as follows:\n * \n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\n * \n * @event Phaser.Scenes.Events#TRANSITION_START\n * @since 3.5.0\n * \n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\n * @param {number} duration - The duration of the transition in ms.\n */\nmodule.exports = 'transitionstart';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Transition Wake Event.\n * \n * This event is dispatched by the Target Scene of a transition, only if that Scene was asleep before\n * the transition began. If the Scene was not asleep the [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} event is dispatched instead.\n * \n * Listen to it from a Scene using `this.scene.events.on('transitionwake', listener)`.\n * \n * The Scene Transition event flow is as follows:\n * \n * 1. [TRANSITION_OUT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_OUT} - the Scene that started the transition will emit this event.\n * 2. [TRANSITION_INIT]{@linkcode Phaser.Scenes.Events#event:TRANSITION_INIT} - the Target Scene will emit this event if it has an `init` method.\n * 3. [TRANSITION_START]{@linkcode Phaser.Scenes.Events#event:TRANSITION_START} - the Target Scene will emit this event after its `create` method is called, OR ...\n * 4. [TRANSITION_WAKE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_WAKE} - the Target Scene will emit this event if it was asleep and has been woken-up to be transitioned to.\n * 5. [TRANSITION_COMPLETE]{@linkcode Phaser.Scenes.Events#event:TRANSITION_COMPLETE} - the Target Scene will emit this event when the transition finishes.\n * \n * @event Phaser.Scenes.Events#TRANSITION_WAKE\n * @since 3.5.0\n * \n * @param {Phaser.Scene} from - A reference to the Scene that is being transitioned from.\n * @param {number} duration - The duration of the transition in ms.\n */\nmodule.exports = 'transitionwake';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Update Event.\n * \n * This event is dispatched by a Scene during the main game loop step.\n * \n * The event flow for a single step of a Scene is as follows:\n * \n * 1. [PRE_UPDATE]{@linkcode Phaser.Scenes.Events#event:PRE_UPDATE}\n * 2. [UPDATE]{@linkcode Phaser.Scenes.Events#event:UPDATE}\n * 3. The `Scene.update` method is called, if it exists\n * 4. [POST_UPDATE]{@linkcode Phaser.Scenes.Events#event:POST_UPDATE}\n * 5. [RENDER]{@linkcode Phaser.Scenes.Events#event:RENDER}\n * \n * Listen to it from a Scene using `this.scene.events.on('update', listener)`.\n * \n * A Scene will only run its step if it is active.\n * \n * @event Phaser.Scenes.Events#UPDATE\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.\n * @param {number} delta - The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate.\n */\nmodule.exports = 'update';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Scene Systems Wake Event.\n * \n * This event is dispatched by a Scene when it is woken from sleep, either directly via the `wake` method,\n * or as an action from another Scene.\n * \n * Listen to it from a Scene using `this.scene.events.on('wake', listener)`.\n * \n * @event Phaser.Scenes.Events#WAKE\n * @since 3.0.0\n * \n * @param {Phaser.Scenes.Systems} sys - A reference to the Scene Systems class of the Scene that emitted this event.\n * @param {any} [data] - An optional data object that was passed to this Scene when it was woken up.\n */\nmodule.exports = 'wake';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Scenes.Events\n */\n\nmodule.exports = {\n\n ADDED_TO_SCENE: require('./ADDED_TO_SCENE_EVENT'),\n BOOT: require('./BOOT_EVENT'),\n CREATE: require('./CREATE_EVENT'),\n DESTROY: require('./DESTROY_EVENT'),\n PAUSE: require('./PAUSE_EVENT'),\n POST_UPDATE: require('./POST_UPDATE_EVENT'),\n PRE_UPDATE: require('./PRE_UPDATE_EVENT'),\n READY: require('./READY_EVENT'),\n REMOVED_FROM_SCENE: require('./REMOVED_FROM_SCENE_EVENT'),\n RENDER: require('./RENDER_EVENT'),\n RESUME: require('./RESUME_EVENT'),\n SHUTDOWN: require('./SHUTDOWN_EVENT'),\n SLEEP: require('./SLEEP_EVENT'),\n START: require('./START_EVENT'),\n TRANSITION_COMPLETE: require('./TRANSITION_COMPLETE_EVENT'),\n TRANSITION_INIT: require('./TRANSITION_INIT_EVENT'),\n TRANSITION_OUT: require('./TRANSITION_OUT_EVENT'),\n TRANSITION_START: require('./TRANSITION_START_EVENT'),\n TRANSITION_WAKE: require('./TRANSITION_WAKE_EVENT'),\n UPDATE: require('./UPDATE_EVENT'),\n WAKE: require('./WAKE_EVENT')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Retrieves the value of the given key from an object.\n *\n * @function Phaser.Tweens.Builders.GetBoolean\n * @since 3.0.0\n *\n * @param {object} source - The object to retrieve the value from.\n * @param {string} key - The key to look for in the `source` object.\n * @param {*} defaultValue - The default value to return if the `key` doesn't exist or if no `source` object is provided.\n *\n * @return {*} The retrieved value.\n */\nvar GetBoolean = function (source, key, defaultValue)\n{\n if (!source)\n {\n return defaultValue;\n }\n else if (source.hasOwnProperty(key))\n {\n return source[key];\n }\n else\n {\n return defaultValue;\n }\n};\n\nmodule.exports = GetBoolean;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar TWEEN_CONST = {\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.CREATED\n * @type {number}\n * @since 3.0.0\n */\n CREATED: 0,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.INIT\n * @type {number}\n * @since 3.0.0\n */\n INIT: 1,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.DELAY\n * @type {number}\n * @since 3.0.0\n */\n DELAY: 2,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.OFFSET_DELAY\n * @type {number}\n * @since 3.0.0\n */\n OFFSET_DELAY: 3,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.PENDING_RENDER\n * @type {number}\n * @since 3.0.0\n */\n PENDING_RENDER: 4,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.PLAYING_FORWARD\n * @type {number}\n * @since 3.0.0\n */\n PLAYING_FORWARD: 5,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.PLAYING_BACKWARD\n * @type {number}\n * @since 3.0.0\n */\n PLAYING_BACKWARD: 6,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.HOLD_DELAY\n * @type {number}\n * @since 3.0.0\n */\n HOLD_DELAY: 7,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.REPEAT_DELAY\n * @type {number}\n * @since 3.0.0\n */\n REPEAT_DELAY: 8,\n\n /**\n * TweenData state.\n * \n * @name Phaser.Tweens.COMPLETE\n * @type {number}\n * @since 3.0.0\n */\n COMPLETE: 9,\n\n // Tween specific (starts from 20 to cleanly allow extra TweenData consts in the future)\n\n /**\n * Tween state.\n * \n * @name Phaser.Tweens.PENDING_ADD\n * @type {number}\n * @since 3.0.0\n */\n PENDING_ADD: 20,\n\n /**\n * Tween state.\n * \n * @name Phaser.Tweens.PAUSED\n * @type {number}\n * @since 3.0.0\n */\n PAUSED: 21,\n\n /**\n * Tween state.\n * \n * @name Phaser.Tweens.LOOP_DELAY\n * @type {number}\n * @since 3.0.0\n */\n LOOP_DELAY: 22,\n\n /**\n * Tween state.\n * \n * @name Phaser.Tweens.ACTIVE\n * @type {number}\n * @since 3.0.0\n */\n ACTIVE: 23,\n\n /**\n * Tween state.\n * \n * @name Phaser.Tweens.COMPLETE_DELAY\n * @type {number}\n * @since 3.0.0\n */\n COMPLETE_DELAY: 24,\n\n /**\n * Tween state.\n * \n * @name Phaser.Tweens.PENDING_REMOVE\n * @type {number}\n * @since 3.0.0\n */\n PENDING_REMOVE: 25,\n\n /**\n * Tween state.\n * \n * @name Phaser.Tweens.REMOVED\n * @type {number}\n * @since 3.0.0\n */\n REMOVED: 26\n\n};\n\nmodule.exports = TWEEN_CONST;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// Taken from klasse by mattdesl https://github.com/mattdesl/klasse\n\nfunction hasGetterOrSetter (def)\n{\n return (!!def.get && typeof def.get === 'function') || (!!def.set && typeof def.set === 'function');\n}\n\nfunction getProperty (definition, k, isClassDescriptor)\n{\n // This may be a lightweight object, OR it might be a property that was defined previously.\n\n // For simple class descriptors we can just assume its NOT previously defined.\n var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);\n\n if (!isClassDescriptor && def.value && typeof def.value === 'object')\n {\n def = def.value;\n }\n\n // This might be a regular property, or it may be a getter/setter the user defined in a class.\n if (def && hasGetterOrSetter(def))\n {\n if (typeof def.enumerable === 'undefined')\n {\n def.enumerable = true;\n }\n\n if (typeof def.configurable === 'undefined')\n {\n def.configurable = true;\n }\n\n return def;\n }\n else\n {\n return false;\n }\n}\n\nfunction hasNonConfigurable (obj, k)\n{\n var prop = Object.getOwnPropertyDescriptor(obj, k);\n\n if (!prop)\n {\n return false;\n }\n\n if (prop.value && typeof prop.value === 'object')\n {\n prop = prop.value;\n }\n\n if (prop.configurable === false)\n {\n return true;\n }\n\n return false;\n}\n\n/**\n * Extends the given `myClass` object's prototype with the properties of `definition`.\n *\n * @function extend\n * @ignore\n * @param {Object} ctor The constructor object to mix into.\n * @param {Object} definition A dictionary of functions for the class.\n * @param {boolean} isClassDescriptor Is the definition a class descriptor?\n * @param {Object} [extend] The parent constructor object.\n */\nfunction extend (ctor, definition, isClassDescriptor, extend)\n{\n for (var k in definition)\n {\n if (!definition.hasOwnProperty(k))\n {\n continue;\n }\n\n var def = getProperty(definition, k, isClassDescriptor);\n\n if (def !== false)\n {\n // If Extends is used, we will check its prototype to see if the final variable exists.\n\n var parent = extend || ctor;\n\n if (hasNonConfigurable(parent.prototype, k))\n {\n // Just skip the final property\n if (Class.ignoreFinals)\n {\n continue;\n }\n\n // We cannot re-define a property that is configurable=false.\n // So we will consider them final and throw an error. This is by\n // default so it is clear to the developer what is happening.\n // You can set ignoreFinals to true if you need to extend a class\n // which has configurable=false; it will simply not re-define final properties.\n throw new Error('cannot override final property \\'' + k + '\\', set Class.ignoreFinals = true to skip');\n }\n\n Object.defineProperty(ctor.prototype, k, def);\n }\n else\n {\n ctor.prototype[k] = definition[k];\n }\n }\n}\n\n/**\n * Applies the given `mixins` to the prototype of `myClass`.\n *\n * @function mixin\n * @ignore\n * @param {Object} myClass The constructor object to mix into.\n * @param {Object|Array} mixins The mixins to apply to the constructor.\n */\nfunction mixin (myClass, mixins)\n{\n if (!mixins)\n {\n return;\n }\n\n if (!Array.isArray(mixins))\n {\n mixins = [ mixins ];\n }\n\n for (var i = 0; i < mixins.length; i++)\n {\n extend(myClass, mixins[i].prototype || mixins[i]);\n }\n}\n\n/**\n * Creates a new class with the given descriptor.\n * The constructor, defined by the name `initialize`,\n * is an optional function. If unspecified, an anonymous\n * function will be used which calls the parent class (if\n * one exists).\n *\n * You can also use `Extends` and `Mixins` to provide subclassing\n * and inheritance.\n *\n * @class Phaser.Class\n * @constructor\n * @param {Object} definition a dictionary of functions for the class\n * @example\n *\n * var MyClass = new Phaser.Class({\n *\n * initialize: function() {\n * this.foo = 2.0;\n * },\n *\n * bar: function() {\n * return this.foo + 5;\n * }\n * });\n */\nfunction Class (definition)\n{\n if (!definition)\n {\n definition = {};\n }\n\n // The variable name here dictates what we see in Chrome debugger\n var initialize;\n var Extends;\n\n if (definition.initialize)\n {\n if (typeof definition.initialize !== 'function')\n {\n throw new Error('initialize must be a function');\n }\n\n initialize = definition.initialize;\n\n // Usually we should avoid 'delete' in V8 at all costs.\n // However, its unlikely to make any performance difference\n // here since we only call this on class creation (i.e. not object creation).\n delete definition.initialize;\n }\n else if (definition.Extends)\n {\n var base = definition.Extends;\n\n initialize = function ()\n {\n base.apply(this, arguments);\n };\n }\n else\n {\n initialize = function () {};\n }\n\n if (definition.Extends)\n {\n initialize.prototype = Object.create(definition.Extends.prototype);\n initialize.prototype.constructor = initialize;\n\n // For getOwnPropertyDescriptor to work, we need to act directly on the Extends (or Mixin)\n\n Extends = definition.Extends;\n\n delete definition.Extends;\n }\n else\n {\n initialize.prototype.constructor = initialize;\n }\n\n // Grab the mixins, if they are specified...\n var mixins = null;\n\n if (definition.Mixins)\n {\n mixins = definition.Mixins;\n delete definition.Mixins;\n }\n\n // First, mixin if we can.\n mixin(initialize, mixins);\n\n // Now we grab the actual definition which defines the overrides.\n extend(initialize, definition, true, Extends);\n\n return initialize;\n}\n\nClass.extend = extend;\nClass.mixin = mixin;\nClass.ignoreFinals = false;\n\nmodule.exports = Class;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * A NOOP (No Operation) callback function.\n *\n * Used internally by Phaser when it's more expensive to determine if a callback exists\n * than it is to just invoke an empty function.\n *\n * @function Phaser.Utils.NOOP\n * @since 3.0.0\n */\nvar NOOP = function ()\n{\n // NOOP\n};\n\nmodule.exports = NOOP;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Adds the given item, or array of items, to the array.\n *\n * Each item must be unique within the array.\n *\n * The array is modified in-place and returned.\n *\n * You can optionally specify a limit to the maximum size of the array. If the quantity of items being\n * added will take the array length over this limit, it will stop adding once the limit is reached.\n *\n * You can optionally specify a callback to be invoked for each item successfully added to the array.\n *\n * @function Phaser.Utils.Array.Add\n * @since 3.4.0\n *\n * @param {array} array - The array to be added to.\n * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array.\n * @param {number} [limit] - Optional limit which caps the size of the array.\n * @param {function} [callback] - A callback to be invoked for each item successfully added to the array.\n * @param {object} [context] - The context in which the callback is invoked.\n *\n * @return {array} The input array.\n */\nvar Add = function (array, item, limit, callback, context)\n{\n if (context === undefined) { context = array; }\n\n if (limit > 0)\n {\n var remaining = limit - array.length;\n\n // There's nothing more we can do here, the array is full\n if (remaining <= 0)\n {\n return null;\n }\n }\n\n // Fast path to avoid array mutation and iteration\n if (!Array.isArray(item))\n {\n if (array.indexOf(item) === -1)\n {\n array.push(item);\n\n if (callback)\n {\n callback.call(context, item);\n }\n\n return item;\n }\n else\n {\n return null;\n }\n }\n\n // If we got this far, we have an array of items to insert\n\n // Ensure all the items are unique\n var itemLength = item.length - 1;\n\n while (itemLength >= 0)\n {\n if (array.indexOf(item[itemLength]) !== -1)\n {\n // Already exists in array, so remove it\n item.splice(itemLength, 1);\n }\n\n itemLength--;\n }\n\n // Anything left?\n itemLength = item.length;\n\n if (itemLength === 0)\n {\n return null;\n }\n\n if (limit > 0 && itemLength > remaining)\n {\n item.splice(remaining);\n\n itemLength = remaining;\n }\n\n for (var i = 0; i < itemLength; i++)\n {\n var entry = item[i];\n\n array.push(entry);\n\n if (callback)\n {\n callback.call(context, entry);\n }\n }\n\n return item;\n};\n\nmodule.exports = Add;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Adds the given item, or array of items, to the array starting at the index specified.\n * \n * Each item must be unique within the array.\n * \n * Existing elements in the array are shifted up.\n * \n * The array is modified in-place and returned.\n * \n * You can optionally specify a limit to the maximum size of the array. If the quantity of items being\n * added will take the array length over this limit, it will stop adding once the limit is reached.\n * \n * You can optionally specify a callback to be invoked for each item successfully added to the array.\n *\n * @function Phaser.Utils.Array.AddAt\n * @since 3.4.0\n *\n * @param {array} array - The array to be added to.\n * @param {any|any[]} item - The item, or array of items, to add to the array.\n * @param {number} [index=0] - The index in the array where the item will be inserted.\n * @param {number} [limit] - Optional limit which caps the size of the array.\n * @param {function} [callback] - A callback to be invoked for each item successfully added to the array.\n * @param {object} [context] - The context in which the callback is invoked.\n *\n * @return {array} The input array.\n */\nvar AddAt = function (array, item, index, limit, callback, context)\n{\n if (index === undefined) { index = 0; }\n if (context === undefined) { context = array; }\n\n if (limit > 0)\n {\n var remaining = limit - array.length;\n\n // There's nothing more we can do here, the array is full\n if (remaining <= 0)\n {\n return null;\n }\n }\n\n // Fast path to avoid array mutation and iteration\n if (!Array.isArray(item))\n {\n if (array.indexOf(item) === -1)\n {\n array.splice(index, 0, item);\n\n if (callback)\n {\n callback.call(context, item);\n }\n\n return item;\n }\n else\n {\n return null;\n }\n }\n\n // If we got this far, we have an array of items to insert\n\n // Ensure all the items are unique\n var itemLength = item.length - 1;\n\n while (itemLength >= 0)\n {\n if (array.indexOf(item[itemLength]) !== -1)\n {\n // Already exists in array, so remove it\n item.pop();\n }\n\n itemLength--;\n }\n\n // Anything left?\n itemLength = item.length;\n\n if (itemLength === 0)\n {\n return null;\n }\n\n // Truncate to the limit\n if (limit > 0 && itemLength > remaining)\n {\n item.splice(remaining);\n\n itemLength = remaining;\n }\n\n for (var i = itemLength - 1; i >= 0; i--)\n {\n var entry = item[i];\n\n array.splice(index, 0, entry);\n\n if (callback)\n {\n callback.call(context, entry);\n }\n }\n\n return item;\n};\n\nmodule.exports = AddAt;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Moves the given element to the top of the array.\n * The array is modified in-place.\n *\n * @function Phaser.Utils.Array.BringToTop\n * @since 3.4.0\n *\n * @param {array} array - The array.\n * @param {*} item - The element to move.\n *\n * @return {*} The element that was moved.\n */\nvar BringToTop = function (array, item)\n{\n var currentIndex = array.indexOf(item);\n\n if (currentIndex !== -1 && currentIndex < array.length)\n {\n array.splice(currentIndex, 1);\n array.push(item);\n }\n\n return item;\n};\n\nmodule.exports = BringToTop;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SafeRange = require('./SafeRange');\n\n/**\n * Returns the total number of elements in the array which have a property matching the given value.\n *\n * @function Phaser.Utils.Array.CountAllMatching\n * @since 3.4.0\n *\n * @param {array} array - The array to search.\n * @param {string} property - The property to test on each array element.\n * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check.\n * @param {number} [startIndex] - An optional start index to search from.\n * @param {number} [endIndex] - An optional end index to search to.\n *\n * @return {number} The total number of elements with properties matching the given value.\n */\nvar CountAllMatching = function (array, property, value, startIndex, endIndex)\n{\n if (startIndex === undefined) { startIndex = 0; }\n if (endIndex === undefined) { endIndex = array.length; }\n\n var total = 0;\n\n if (SafeRange(array, startIndex, endIndex))\n {\n for (var i = startIndex; i < endIndex; i++)\n {\n var child = array[i];\n\n if (child[property] === value)\n {\n total++;\n }\n }\n }\n\n return total;\n};\n\nmodule.exports = CountAllMatching;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Passes each element in the array to the given callback.\n *\n * @function Phaser.Utils.Array.Each\n * @since 3.4.0\n *\n * @param {array} array - The array to search.\n * @param {function} callback - A callback to be invoked for each item in the array.\n * @param {object} context - The context in which the callback is invoked.\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the current array item.\n *\n * @return {array} The input array.\n */\nvar Each = function (array, callback, context)\n{\n var i;\n var args = [ null ];\n\n for (i = 3; i < arguments.length; i++)\n {\n args.push(arguments[i]);\n }\n\n for (i = 0; i < array.length; i++)\n {\n args[0] = array[i];\n\n callback.apply(context, args);\n }\n\n return array;\n};\n\nmodule.exports = Each;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SafeRange = require('./SafeRange');\n\n/**\n * Passes each element in the array, between the start and end indexes, to the given callback.\n *\n * @function Phaser.Utils.Array.EachInRange\n * @since 3.4.0\n *\n * @param {array} array - The array to search.\n * @param {function} callback - A callback to be invoked for each item in the array.\n * @param {object} context - The context in which the callback is invoked.\n * @param {number} startIndex - The start index to search from.\n * @param {number} endIndex - The end index to search to.\n * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.\n *\n * @return {array} The input array.\n */\nvar EachInRange = function (array, callback, context, startIndex, endIndex)\n{\n if (startIndex === undefined) { startIndex = 0; }\n if (endIndex === undefined) { endIndex = array.length; }\n\n if (SafeRange(array, startIndex, endIndex))\n {\n var i;\n var args = [ null ];\n\n for (i = 5; i < arguments.length; i++)\n {\n args.push(arguments[i]);\n }\n\n for (i = startIndex; i < endIndex; i++)\n {\n args[0] = array[i];\n\n callback.apply(context, args);\n }\n }\n\n return array;\n};\n\nmodule.exports = EachInRange;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Searches a pre-sorted array for the closet value to the given number.\n *\n * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name,\n * and will check for the closest value of those to the given number.\n *\n * @function Phaser.Utils.Array.FindClosestInSorted\n * @since 3.0.0\n *\n * @param {number} value - The value to search for in the array.\n * @param {array} array - The array to search, which must be sorted.\n * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value.\n *\n * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value.\n */\nvar FindClosestInSorted = function (value, array, key)\n{\n if (!array.length)\n {\n return NaN;\n }\n else if (array.length === 1)\n {\n return array[0];\n }\n\n var i = 1;\n var low;\n var high;\n\n if (key)\n {\n if (value < array[0][key])\n {\n return array[0];\n }\n\n while (array[i][key] < value)\n {\n i++;\n }\n }\n else\n {\n while (array[i] < value)\n {\n i++;\n }\n }\n\n if (i > array.length)\n {\n i = array.length;\n }\n\n if (key)\n {\n low = array[i - 1][key];\n high = array[i][key];\n\n return ((high - value) <= (value - low)) ? array[i] : array[i - 1];\n }\n else\n {\n low = array[i - 1];\n high = array[i];\n\n return ((high - value) <= (value - low)) ? high : low;\n }\n};\n\nmodule.exports = FindClosestInSorted;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SafeRange = require('./SafeRange');\n\n/**\n * Returns all elements in the array.\n *\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\n *\n * For example: `getAll('visible', true)` would return only elements that have their visible property set.\n *\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\n * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only\n * the first 50 elements.\n *\n * @function Phaser.Utils.Array.GetAll\n * @since 3.4.0\n *\n * @param {array} array - The array to search.\n * @param {string} [property] - The property to test on each array element.\n * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check.\n * @param {number} [startIndex] - An optional start index to search from.\n * @param {number} [endIndex] - An optional end index to search to.\n *\n * @return {array} All matching elements from the array.\n */\nvar GetAll = function (array, property, value, startIndex, endIndex)\n{\n if (startIndex === undefined) { startIndex = 0; }\n if (endIndex === undefined) { endIndex = array.length; }\n\n var output = [];\n\n if (SafeRange(array, startIndex, endIndex))\n {\n for (var i = startIndex; i < endIndex; i++)\n {\n var child = array[i];\n\n if (!property ||\n (property && value === undefined && child.hasOwnProperty(property)) ||\n (property && value !== undefined && child[property] === value))\n {\n output.push(child);\n }\n }\n }\n\n return output;\n};\n\nmodule.exports = GetAll;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SafeRange = require('./SafeRange');\n\n/**\n * Returns the first element in the array.\n *\n * You can optionally specify a matching criteria using the `property` and `value` arguments.\n *\n * For example: `getAll('visible', true)` would return the first element that had its `visible` property set.\n *\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\n * and you set `startIndex` to 0 and `endIndex` to 50, it would search only the first 50 elements.\n *\n * @function Phaser.Utils.Array.GetFirst\n * @since 3.4.0\n *\n * @param {array} array - The array to search.\n * @param {string} [property] - The property to test on each array element.\n * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check.\n * @param {number} [startIndex=0] - An optional start index to search from.\n * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included)\n *\n * @return {object} The first matching element from the array, or `null` if no element could be found in the range given.\n */\nvar GetFirst = function (array, property, value, startIndex, endIndex)\n{\n if (startIndex === undefined) { startIndex = 0; }\n if (endIndex === undefined) { endIndex = array.length; }\n\n if (SafeRange(array, startIndex, endIndex))\n {\n for (var i = startIndex; i < endIndex; i++)\n {\n var child = array[i];\n\n if (!property ||\n (property && value === undefined && child.hasOwnProperty(property)) ||\n (property && value !== undefined && child[property] === value))\n {\n return child;\n }\n }\n }\n\n return null;\n};\n\nmodule.exports = GetFirst;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Returns a Random element from the array.\n *\n * @function Phaser.Utils.Array.GetRandom\n * @since 3.0.0\n *\n * @param {array} array - The array to select the random entry from.\n * @param {number} [startIndex=0] - An optional start index.\n * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from.\n *\n * @return {*} A random element from the array, or `null` if no element could be found in the range given.\n */\nvar GetRandom = function (array, startIndex, length)\n{\n if (startIndex === undefined) { startIndex = 0; }\n if (length === undefined) { length = array.length; }\n\n var randomIndex = startIndex + Math.floor(Math.random() * length);\n\n return (array[randomIndex] === undefined) ? null : array[randomIndex];\n};\n\nmodule.exports = GetRandom;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Moves the given array element down one place in the array.\n * The array is modified in-place.\n *\n * @function Phaser.Utils.Array.MoveDown\n * @since 3.4.0\n *\n * @param {array} array - The input array.\n * @param {*} item - The element to move down the array.\n *\n * @return {array} The input array.\n */\nvar MoveDown = function (array, item)\n{\n var currentIndex = array.indexOf(item);\n\n if (currentIndex > 0)\n {\n var item2 = array[currentIndex - 1];\n\n var index2 = array.indexOf(item2);\n\n array[currentIndex] = item2;\n array[index2] = item;\n }\n\n return array;\n};\n\nmodule.exports = MoveDown;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Moves an element in an array to a new position within the same array.\n * The array is modified in-place.\n *\n * @function Phaser.Utils.Array.MoveTo\n * @since 3.4.0\n *\n * @param {array} array - The array.\n * @param {*} item - The element to move.\n * @param {number} index - The new index that the element will be moved to.\n *\n * @return {*} The element that was moved.\n */\nvar MoveTo = function (array, item, index)\n{\n var currentIndex = array.indexOf(item);\n\n if (currentIndex === -1 || index < 0 || index >= array.length)\n {\n throw new Error('Supplied index out of bounds');\n }\n\n if (currentIndex !== index)\n {\n // Remove\n array.splice(currentIndex, 1);\n\n // Add in new location\n array.splice(index, 0, item);\n }\n\n return item;\n};\n\nmodule.exports = MoveTo;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Moves the given array element up one place in the array.\n * The array is modified in-place.\n *\n * @function Phaser.Utils.Array.MoveUp\n * @since 3.4.0\n *\n * @param {array} array - The input array.\n * @param {*} item - The element to move up the array.\n *\n * @return {array} The input array.\n */\nvar MoveUp = function (array, item)\n{\n var currentIndex = array.indexOf(item);\n\n if (currentIndex !== -1 && currentIndex < array.length - 1)\n {\n // The element one above `item` in the array\n var item2 = array[currentIndex + 1];\n var index2 = array.indexOf(item2);\n\n array[currentIndex] = item2;\n array[index2] = item;\n }\n\n return array;\n};\n\nmodule.exports = MoveUp;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Create an array representing the range of numbers (usually integers), between, and inclusive of,\n * the given `start` and `end` arguments. For example:\n *\n * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]`\n * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]`\n * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]`\n *\n * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`.\n *\n * You can optionally provide a prefix and / or suffix string. If given the array will contain\n * strings, not integers. For example:\n *\n * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = [\"Level 1\", \"Level 2\", \"Level 3\", \"Level 4\"]`\n * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = [\"HD-5.png\", \"HD-6.png\", \"HD-7.png\"]`\n *\n * @function Phaser.Utils.Array.NumberArray\n * @since 3.0.0\n *\n * @param {number} start - The minimum value the array starts with.\n * @param {number} end - The maximum value the array contains.\n * @param {string} [prefix] - Optional prefix to place before the number. If provided the array will contain strings, not integers.\n * @param {string} [suffix] - Optional suffix to place after the number. If provided the array will contain strings, not integers.\n *\n * @return {(number[]|string[])} The array of number values, or strings if a prefix or suffix was provided.\n */\nvar NumberArray = function (start, end, prefix, suffix)\n{\n var result = [];\n\n var i;\n var asString = false;\n\n if (prefix || suffix)\n {\n asString = true;\n\n if (!prefix)\n {\n prefix = '';\n }\n\n if (!suffix)\n {\n suffix = '';\n }\n }\n\n if (end < start)\n {\n for (i = start; i >= end; i--)\n {\n if (asString)\n {\n result.push(prefix + i.toString() + suffix);\n }\n else\n {\n result.push(i);\n }\n }\n }\n else\n {\n for (i = start; i <= end; i++)\n {\n if (asString)\n {\n result.push(prefix + i.toString() + suffix);\n }\n else\n {\n result.push(i);\n }\n }\n }\n\n return result;\n};\n\nmodule.exports = NumberArray;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar RoundAwayFromZero = require('../../math/RoundAwayFromZero');\n\n/**\n * Create an array of numbers (positive and/or negative) progressing from `start`\n * up to but not including `end` by advancing by `step`.\n *\n * If `start` is less than `end` a zero-length range is created unless a negative `step` is specified.\n *\n * Certain values for `start` and `end` (eg. NaN/undefined/null) are currently coerced to 0;\n * for forward compatibility make sure to pass in actual numbers.\n * \n * @example\n * NumberArrayStep(4);\n * // => [0, 1, 2, 3]\n *\n * NumberArrayStep(1, 5);\n * // => [1, 2, 3, 4]\n *\n * NumberArrayStep(0, 20, 5);\n * // => [0, 5, 10, 15]\n *\n * NumberArrayStep(0, -4, -1);\n * // => [0, -1, -2, -3]\n *\n * NumberArrayStep(1, 4, 0);\n * // => [1, 1, 1]\n *\n * NumberArrayStep(0);\n * // => []\n *\n * @function Phaser.Utils.Array.NumberArrayStep\n * @since 3.0.0\n *\n * @param {number} [start=0] - The start of the range.\n * @param {number} [end=null] - The end of the range.\n * @param {number} [step=1] - The value to increment or decrement by.\n *\n * @return {number[]} The array of number values.\n */\nvar NumberArrayStep = function (start, end, step)\n{\n if (start === undefined) { start = 0; }\n if (end === undefined) { end = null; }\n if (step === undefined) { step = 1; }\n\n if (end === null)\n {\n end = start;\n start = 0;\n }\n\n var result = [];\n\n var total = Math.max(RoundAwayFromZero((end - start) / (step || 1)), 0);\n\n for (var i = 0; i < total; i++)\n {\n result.push(start);\n start += step;\n }\n\n return result;\n};\n\nmodule.exports = NumberArrayStep;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @ignore\n */\nfunction swap (arr, i, j)\n{\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\n/**\n * @ignore\n */\nfunction defaultCompare (a, b)\n{\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * A [Floyd-Rivest](https://en.wikipedia.org/wiki/Floyd%E2%80%93Rivest_algorithm) quick selection algorithm.\n *\n * Rearranges the array items so that all items in the [left, k] range are smaller than all items in [k, right];\n * The k-th element will have the (k - left + 1)th smallest value in [left, right].\n *\n * The array is modified in-place.\n *\n * Based on code by [Vladimir Agafonkin](https://www.npmjs.com/~mourner)\n *\n * @function Phaser.Utils.Array.QuickSelect\n * @since 3.0.0\n *\n * @param {array} arr - The array to sort.\n * @param {number} k - The k-th element index.\n * @param {number} [left=0] - The index of the left part of the range.\n * @param {number} [right] - The index of the right part of the range.\n * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1.\n */\nvar QuickSelect = function (arr, k, left, right, compare)\n{\n if (left === undefined) { left = 0; }\n if (right === undefined) { right = arr.length - 1; }\n if (compare === undefined) { compare = defaultCompare; }\n\n while (right > left)\n {\n if (right - left > 600)\n {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n\n QuickSelect(arr, k, newLeft, newRight, compare);\n }\n\n var t = arr[k];\n var i = left;\n var j = right;\n\n swap(arr, left, k);\n\n if (compare(arr[right], t) > 0)\n {\n swap(arr, left, right);\n }\n\n while (i < j)\n {\n swap(arr, i, j);\n\n i++;\n j--;\n\n while (compare(arr[i], t) < 0)\n {\n i++;\n }\n\n while (compare(arr[j], t) > 0)\n {\n j--;\n }\n }\n\n if (compare(arr[left], t) === 0)\n {\n swap(arr, left, j);\n }\n else\n {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k)\n {\n left = j + 1;\n }\n\n if (k <= j)\n {\n right = j - 1;\n }\n }\n};\n\nmodule.exports = QuickSelect;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar GetValue = require('../object/GetValue');\nvar Shuffle = require('./Shuffle');\n\nvar BuildChunk = function (a, b, qty)\n{\n var out = [];\n\n for (var aIndex = 0; aIndex < a.length; aIndex++)\n {\n for (var bIndex = 0; bIndex < b.length; bIndex++)\n {\n for (var i = 0; i < qty; i++)\n {\n out.push({ a: a[aIndex], b: b[bIndex] });\n }\n }\n }\n\n return out;\n};\n\n/**\n * Creates an array populated with a range of values, based on the given arguments and configuration object.\n *\n * Range ([a,b,c], [1,2,3]) =\n * a1, a2, a3, b1, b2, b3, c1, c2, c3\n * \n * Range ([a,b], [1,2,3], qty = 3) =\n * a1, a1, a1, a2, a2, a2, a3, a3, a3, b1, b1, b1, b2, b2, b2, b3, b3, b3\n * \n * Range ([a,b,c], [1,2,3], repeat x1) =\n * a1, a2, a3, b1, b2, b3, c1, c2, c3, a1, a2, a3, b1, b2, b3, c1, c2, c3\n * \n * Range ([a,b], [1,2], repeat -1 = endless, max = 14) =\n * Maybe if max is set then repeat goes to -1 automatically?\n * a1, a2, b1, b2, a1, a2, b1, b2, a1, a2, b1, b2, a1, a2 (capped at 14 elements)\n * \n * Range ([a], [1,2,3,4,5], random = true) =\n * a4, a1, a5, a2, a3\n * \n * Range ([a, b], [1,2,3], random = true) =\n * b3, a2, a1, b1, a3, b2\n * \n * Range ([a, b, c], [1,2,3], randomB = true) =\n * a3, a1, a2, b2, b3, b1, c1, c3, c2\n * \n * Range ([a], [1,2,3,4,5], yoyo = true) =\n * a1, a2, a3, a4, a5, a5, a4, a3, a2, a1\n * \n * Range ([a, b], [1,2,3], yoyo = true) =\n * a1, a2, a3, b1, b2, b3, b3, b2, b1, a3, a2, a1\n *\n * @function Phaser.Utils.Array.Range\n * @since 3.0.0\n *\n * @param {array} a - The first array of range elements.\n * @param {array} b - The second array of range elements.\n * @param {object} [options] - A range configuration object. Can contain: repeat, random, randomB, yoyo, max, qty.\n *\n * @return {array} An array of arranged elements.\n */\nvar Range = function (a, b, options)\n{\n var max = GetValue(options, 'max', 0);\n var qty = GetValue(options, 'qty', 1);\n var random = GetValue(options, 'random', false);\n var randomB = GetValue(options, 'randomB', false);\n var repeat = GetValue(options, 'repeat', 0);\n var yoyo = GetValue(options, 'yoyo', false);\n\n var out = [];\n\n if (randomB)\n {\n Shuffle(b);\n }\n\n // Endless repeat, so limit by max\n if (repeat === -1)\n {\n if (max === 0)\n {\n repeat = 0;\n }\n else\n {\n // Work out how many repeats we need\n var total = (a.length * b.length) * qty;\n\n if (yoyo)\n {\n total *= 2;\n }\n\n repeat = Math.ceil(max / total);\n }\n }\n\n for (var i = 0; i <= repeat; i++)\n {\n var chunk = BuildChunk(a, b, qty);\n\n if (random)\n {\n Shuffle(chunk);\n }\n\n out = out.concat(chunk);\n\n if (yoyo)\n {\n chunk.reverse();\n\n out = out.concat(chunk);\n }\n }\n\n if (max)\n {\n out.splice(max);\n }\n\n return out;\n};\n\nmodule.exports = Range;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SpliceOne = require('./SpliceOne');\n\n/**\n * Removes the given item, or array of items, from the array.\n *\n * The array is modified in-place.\n *\n * You can optionally specify a callback to be invoked for each item successfully removed from the array.\n *\n * @function Phaser.Utils.Array.Remove\n * @since 3.4.0\n *\n * @param {array} array - The array to be modified.\n * @param {*|Array.<*>} item - The item, or array of items, to be removed from the array.\n * @param {function} [callback] - A callback to be invoked for each item successfully removed from the array.\n * @param {object} [context] - The context in which the callback is invoked.\n *\n * @return {*|Array.<*>} The item, or array of items, that were successfully removed from the array.\n */\nvar Remove = function (array, item, callback, context)\n{\n if (context === undefined) { context = array; }\n\n var index;\n\n // Fast path to avoid array mutation and iteration\n if (!Array.isArray(item))\n {\n index = array.indexOf(item);\n\n if (index !== -1)\n {\n SpliceOne(array, index);\n\n if (callback)\n {\n callback.call(context, item);\n }\n\n return item;\n }\n else\n {\n return null;\n }\n }\n\n // If we got this far, we have an array of items to remove\n\n var itemLength = item.length - 1;\n var removed = [];\n\n while (itemLength >= 0)\n {\n var entry = item[itemLength];\n\n index = array.indexOf(entry);\n\n if (index !== -1)\n {\n SpliceOne(array, index);\n\n removed.push(entry);\n\n if (callback)\n {\n callback.call(context, entry);\n }\n }\n\n itemLength--;\n }\n\n return removed;\n};\n\nmodule.exports = Remove;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SpliceOne = require('./SpliceOne');\n\n/**\n * Removes the item from the given position in the array.\n * \n * The array is modified in-place.\n * \n * You can optionally specify a callback to be invoked for the item if it is successfully removed from the array.\n *\n * @function Phaser.Utils.Array.RemoveAt\n * @since 3.4.0\n *\n * @param {array} array - The array to be modified.\n * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error.\n * @param {function} [callback] - A callback to be invoked for the item removed from the array.\n * @param {object} [context] - The context in which the callback is invoked.\n *\n * @return {*} The item that was removed.\n */\nvar RemoveAt = function (array, index, callback, context)\n{\n if (context === undefined) { context = array; }\n\n if (index < 0 || index > array.length - 1)\n {\n throw new Error('Index out of bounds');\n }\n\n var item = SpliceOne(array, index);\n\n if (callback)\n {\n callback.call(context, item);\n }\n\n return item;\n};\n\nmodule.exports = RemoveAt;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SafeRange = require('./SafeRange');\n\n/**\n * Removes the item within the given range in the array.\n * \n * The array is modified in-place.\n * \n * You can optionally specify a callback to be invoked for the item/s successfully removed from the array.\n *\n * @function Phaser.Utils.Array.RemoveBetween\n * @since 3.4.0\n *\n * @param {array} array - The array to be modified.\n * @param {number} startIndex - The start index to remove from.\n * @param {number} endIndex - The end index to remove to.\n * @param {function} [callback] - A callback to be invoked for the item removed from the array.\n * @param {object} [context] - The context in which the callback is invoked.\n *\n * @return {Array.<*>} An array of items that were removed.\n */\nvar RemoveBetween = function (array, startIndex, endIndex, callback, context)\n{\n if (startIndex === undefined) { startIndex = 0; }\n if (endIndex === undefined) { endIndex = array.length; }\n if (context === undefined) { context = array; }\n\n if (SafeRange(array, startIndex, endIndex))\n {\n var size = endIndex - startIndex;\n\n var removed = array.splice(startIndex, size);\n\n if (callback)\n {\n for (var i = 0; i < removed.length; i++)\n {\n var entry = removed[i];\n\n callback.call(context, entry);\n }\n }\n\n return removed;\n }\n else\n {\n return [];\n }\n};\n\nmodule.exports = RemoveBetween;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SpliceOne = require('./SpliceOne');\n\n/**\n * Removes a random object from the given array and returns it.\n * Will return null if there are no array items that fall within the specified range or if there is no item for the randomly chosen index.\n *\n * @function Phaser.Utils.Array.RemoveRandomElement\n * @since 3.0.0\n *\n * @param {array} array - The array to removed a random element from.\n * @param {number} [start=0] - The array index to start the search from.\n * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from.\n *\n * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range.\n */\nvar RemoveRandomElement = function (array, start, length)\n{\n if (start === undefined) { start = 0; }\n if (length === undefined) { length = array.length; }\n\n var randomIndex = start + Math.floor(Math.random() * length);\n\n return SpliceOne(array, randomIndex);\n};\n\nmodule.exports = RemoveRandomElement;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Replaces an element of the array with the new element.\n * The new element cannot already be a member of the array.\n * The array is modified in-place.\n *\n * @function Phaser.Utils.Array.Replace\n * @since 3.4.0\n *\n * @param {array} array - The array to search within.\n * @param {*} oldChild - The element in the array that will be replaced.\n * @param {*} newChild - The element to be inserted into the array at the position of `oldChild`.\n *\n * @return {boolean} Returns true if the oldChild was successfully replaced, otherwise returns false.\n */\nvar Replace = function (array, oldChild, newChild)\n{\n var index1 = array.indexOf(oldChild);\n var index2 = array.indexOf(newChild);\n\n if (index1 !== -1 && index2 === -1)\n {\n array[index1] = newChild;\n\n return true;\n }\n else\n {\n return false;\n }\n};\n\nmodule.exports = Replace;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Moves the element at the start of the array to the end, shifting all items in the process.\n * The \"rotation\" happens to the left.\n *\n * @function Phaser.Utils.Array.RotateLeft\n * @since 3.0.0\n *\n * @param {array} array - The array to shift to the left. This array is modified in place.\n * @param {number} [total=1] - The number of times to shift the array.\n *\n * @return {*} The most recently shifted element.\n */\nvar RotateLeft = function (array, total)\n{\n if (total === undefined) { total = 1; }\n\n var element = null;\n\n for (var i = 0; i < total; i++)\n {\n element = array.shift();\n array.push(element);\n }\n\n return element;\n};\n\nmodule.exports = RotateLeft;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Moves the element at the end of the array to the start, shifting all items in the process.\n * The \"rotation\" happens to the right.\n *\n * @function Phaser.Utils.Array.RotateRight\n * @since 3.0.0\n *\n * @param {array} array - The array to shift to the right. This array is modified in place.\n * @param {number} [total=1] - The number of times to shift the array.\n *\n * @return {*} The most recently shifted element.\n */\nvar RotateRight = function (array, total)\n{\n if (total === undefined) { total = 1; }\n\n var element = null;\n\n for (var i = 0; i < total; i++)\n {\n element = array.pop();\n array.unshift(element);\n }\n\n return element;\n};\n\nmodule.exports = RotateRight;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Tests if the start and end indexes are a safe range for the given array.\n * \n * @function Phaser.Utils.Array.SafeRange\n * @since 3.4.0\n *\n * @param {array} array - The array to check.\n * @param {number} startIndex - The start index.\n * @param {number} endIndex - The end index.\n * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds.\n *\n * @return {boolean} True if the range is safe, otherwise false.\n */\nvar SafeRange = function (array, startIndex, endIndex, throwError)\n{\n var len = array.length;\n\n if (startIndex < 0 ||\n startIndex > len ||\n startIndex >= endIndex ||\n endIndex > len ||\n startIndex + endIndex > len)\n {\n if (throwError)\n {\n throw new Error('Range Error: Values outside acceptable range');\n }\n\n return false;\n }\n else\n {\n return true;\n }\n};\n\nmodule.exports = SafeRange;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Moves the given element to the bottom of the array.\n * The array is modified in-place.\n *\n * @function Phaser.Utils.Array.SendToBack\n * @since 3.4.0\n *\n * @param {array} array - The array.\n * @param {*} item - The element to move.\n *\n * @return {*} The element that was moved.\n */\nvar SendToBack = function (array, item)\n{\n var currentIndex = array.indexOf(item);\n\n if (currentIndex !== -1 && currentIndex > 0)\n {\n array.splice(currentIndex, 1);\n array.unshift(item);\n }\n\n return item;\n};\n\nmodule.exports = SendToBack;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar SafeRange = require('./SafeRange');\n\n/**\n * Scans the array for elements with the given property. If found, the property is set to the `value`.\n *\n * For example: `SetAll('visible', true)` would set all elements that have a `visible` property to `false`.\n *\n * Optionally you can specify a start and end index. For example if the array had 100 elements,\n * and you set `startIndex` to 0 and `endIndex` to 50, it would update only the first 50 elements.\n *\n * @function Phaser.Utils.Array.SetAll\n * @since 3.4.0\n *\n * @param {array} array - The array to search.\n * @param {string} property - The property to test for on each array element.\n * @param {*} value - The value to set the property to.\n * @param {number} [startIndex] - An optional start index to search from.\n * @param {number} [endIndex] - An optional end index to search to.\n *\n * @return {array} The input array.\n */\nvar SetAll = function (array, property, value, startIndex, endIndex)\n{\n if (startIndex === undefined) { startIndex = 0; }\n if (endIndex === undefined) { endIndex = array.length; }\n\n if (SafeRange(array, startIndex, endIndex))\n {\n for (var i = startIndex; i < endIndex; i++)\n {\n var entry = array[i];\n\n if (entry.hasOwnProperty(property))\n {\n entry[property] = value;\n }\n }\n }\n\n return array;\n};\n\nmodule.exports = SetAll;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Shuffles the contents of the given array using the Fisher-Yates implementation.\n *\n * The original array is modified directly and returned.\n *\n * @function Phaser.Utils.Array.Shuffle\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[]} - [array,$return]\n *\n * @param {T[]} array - The array to shuffle. This array is modified in place.\n *\n * @return {T[]} The shuffled array.\n */\nvar Shuffle = function (array)\n{\n for (var i = array.length - 1; i > 0; i--)\n {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n\n return array;\n};\n\nmodule.exports = Shuffle;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Takes the given array and runs a numeric sort on it, ignoring any non-digits that\n * may be in the entries.\n *\n * You should only run this on arrays containing strings.\n *\n * @function Phaser.Utils.Array.SortByDigits\n * @since 3.50.0\n *\n * @param {string[]} array - The input array of strings.\n *\n * @return {string[]} The sorted input array.\n */\nvar SortByDigits = function (array)\n{\n var re = /\\D/g;\n\n array.sort(function (a, b)\n {\n return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10));\n });\n\n return array;\n};\n\nmodule.exports = SortByDigits;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Removes a single item from an array and returns it without creating gc, like the native splice does.\n * Based on code by Mike Reinstein.\n *\n * @function Phaser.Utils.Array.SpliceOne\n * @since 3.0.0\n *\n * @param {array} array - The array to splice from.\n * @param {number} index - The index of the item which should be spliced.\n *\n * @return {*} The item which was spliced (removed).\n */\nvar SpliceOne = function (array, index)\n{\n if (index >= array.length)\n {\n return;\n }\n\n var len = array.length - 1;\n\n var item = array[index];\n\n for (var i = index; i < len; i++)\n {\n array[i] = array[i + 1];\n }\n\n array.length = len;\n\n return item;\n};\n\nmodule.exports = SpliceOne;\n","/**\n * @author Richard Davey \n * @author Angry Bytes (and contributors)\n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The comparator function.\n *\n * @ignore\n *\n * @param {*} a - The first item to test.\n * @param {*} b - The second itemt to test.\n *\n * @return {boolean} True if they localCompare, otherwise false.\n */\nfunction Compare (a, b)\n{\n return String(a).localeCompare(b);\n}\n\n/**\n * Process the array contents.\n *\n * @ignore\n *\n * @param {array} array - The array to process.\n * @param {function} compare - The comparison function.\n *\n * @return {array} - The processed array.\n */\nfunction Process (array, compare)\n{\n // Short-circuit when there's nothing to sort.\n var len = array.length;\n\n if (len <= 1)\n {\n return array;\n }\n\n // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc.\n // Chunks are the size of the left or right hand in merge sort.\n // Stop when the left-hand covers all of the array.\n var buffer = new Array(len);\n\n for (var chk = 1; chk < len; chk *= 2)\n {\n RunPass(array, compare, chk, buffer);\n\n var tmp = array;\n\n array = buffer;\n\n buffer = tmp;\n }\n\n return array;\n}\n\n/**\n * Run a single pass with the given chunk size.\n *\n * @ignore\n *\n * @param {array} arr - The array to run the pass on.\n * @param {function} comp - The comparison function.\n * @param {number} chk - The number of iterations.\n * @param {array} result - The array to store the result in.\n */\nfunction RunPass (arr, comp, chk, result)\n{\n var len = arr.length;\n var i = 0;\n\n // Step size / double chunk size.\n var dbl = chk * 2;\n\n // Bounds of the left and right chunks.\n var l, r, e;\n\n // Iterators over the left and right chunk.\n var li, ri;\n\n // Iterate over pairs of chunks.\n for (l = 0; l < len; l += dbl)\n {\n r = l + chk;\n e = r + chk;\n\n if (r > len)\n {\n r = len;\n }\n\n if (e > len)\n {\n e = len;\n }\n\n // Iterate both chunks in parallel.\n li = l;\n ri = r;\n\n while (true)\n {\n // Compare the chunks.\n if (li < r && ri < e)\n {\n // This works for a regular `sort()` compatible comparator,\n // but also for a simple comparator like: `a > b`\n if (comp(arr[li], arr[ri]) <= 0)\n {\n result[i++] = arr[li++];\n }\n else\n {\n result[i++] = arr[ri++];\n }\n }\n else if (li < r)\n {\n // Nothing to compare, just flush what's left.\n result[i++] = arr[li++];\n }\n else if (ri < e)\n {\n result[i++] = arr[ri++];\n }\n else\n {\n // Both iterators are at the chunk ends.\n break;\n }\n }\n }\n}\n\n/**\n * An in-place stable array sort, because `Array#sort()` is not guaranteed stable.\n *\n * This is an implementation of merge sort, without recursion.\n *\n * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable\n *\n * @function Phaser.Utils.Array.StableSort\n * @since 3.0.0\n *\n * @param {array} array - The input array to be sorted.\n * @param {function} [compare] - The comparison function.\n *\n * @return {array} The sorted result.\n */\nvar StableSort = function (array, compare)\n{\n if (compare === undefined) { compare = Compare; }\n\n var result = Process(array, compare);\n\n // This simply copies back if the result isn't in the original array, which happens on an odd number of passes.\n if (result !== array)\n {\n RunPass(result, null, array.length, array);\n }\n\n return array;\n};\n\nmodule.exports = StableSort;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Swaps the position of two elements in the given array.\n * The elements must exist in the same array.\n * The array is modified in-place.\n *\n * @function Phaser.Utils.Array.Swap\n * @since 3.4.0\n *\n * @param {array} array - The input array.\n * @param {*} item1 - The first element to swap.\n * @param {*} item2 - The second element to swap.\n *\n * @return {array} The input array.\n */\nvar Swap = function (array, item1, item2)\n{\n if (item1 === item2)\n {\n return;\n }\n\n var index1 = array.indexOf(item1);\n var index2 = array.indexOf(item2);\n\n if (index1 < 0 || index2 < 0)\n {\n throw new Error('Supplied items must be elements of the same array');\n }\n\n array[index1] = item2;\n array[index2] = item1;\n\n return array;\n};\n\nmodule.exports = Swap;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Utils.Array\n */\n\nmodule.exports = {\n\n Matrix: require('./matrix'),\n\n Add: require('./Add'),\n AddAt: require('./AddAt'),\n BringToTop: require('./BringToTop'),\n CountAllMatching: require('./CountAllMatching'),\n Each: require('./Each'),\n EachInRange: require('./EachInRange'),\n FindClosestInSorted: require('./FindClosestInSorted'),\n GetAll: require('./GetAll'),\n GetFirst: require('./GetFirst'),\n GetRandom: require('./GetRandom'),\n MoveDown: require('./MoveDown'),\n MoveTo: require('./MoveTo'),\n MoveUp: require('./MoveUp'),\n NumberArray: require('./NumberArray'),\n NumberArrayStep: require('./NumberArrayStep'),\n QuickSelect: require('./QuickSelect'),\n Range: require('./Range'),\n Remove: require('./Remove'),\n RemoveAt: require('./RemoveAt'),\n RemoveBetween: require('./RemoveBetween'),\n RemoveRandomElement: require('./RemoveRandomElement'),\n Replace: require('./Replace'),\n RotateLeft: require('./RotateLeft'),\n RotateRight: require('./RotateRight'),\n SafeRange: require('./SafeRange'),\n SendToBack: require('./SendToBack'),\n SetAll: require('./SetAll'),\n Shuffle: require('./Shuffle'),\n SortByDigits: require('./SortByDigits'),\n SpliceOne: require('./SpliceOne'),\n StableSort: require('./StableSort'),\n Swap: require('./Swap')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Checks if an array can be used as a matrix.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.CheckMatrix\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix]\n *\n * @param {T[][]} [matrix] - The array to check.\n *\n * @return {boolean} `true` if the given `matrix` array is a valid matrix.\n */\nvar CheckMatrix = function (matrix)\n{\n if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0]))\n {\n return false;\n }\n\n // How long is the first row?\n var size = matrix[0].length;\n\n // Validate the rest of the rows are the same length\n for (var i = 1; i < matrix.length; i++)\n {\n if (matrix[i].length !== size)\n {\n return false;\n }\n }\n\n return true;\n};\n\nmodule.exports = CheckMatrix;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar Pad = require('../../string/Pad');\nvar CheckMatrix = require('./CheckMatrix');\n\n/**\n * Generates a string (which you can pass to console.log) from the given Array Matrix.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.MatrixToString\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix]\n *\n * @param {T[][]} [matrix] - A 2-dimensional array.\n *\n * @return {string} A string representing the matrix.\n */\nvar MatrixToString = function (matrix)\n{\n var str = '';\n\n if (!CheckMatrix(matrix))\n {\n return str;\n }\n\n for (var r = 0; r < matrix.length; r++)\n {\n for (var c = 0; c < matrix[r].length; c++)\n {\n var cell = matrix[r][c].toString();\n\n if (cell !== 'undefined')\n {\n str += Pad(cell, 2);\n }\n else\n {\n str += '?';\n }\n\n if (c < matrix[r].length - 1)\n {\n str += ' |';\n }\n }\n\n if (r < matrix.length - 1)\n {\n str += '\\n';\n\n for (var i = 0; i < matrix[r].length; i++)\n {\n str += '---';\n\n if (i < matrix[r].length - 1)\n {\n str += '+';\n }\n }\n\n str += '\\n';\n }\n\n }\n\n return str;\n};\n\nmodule.exports = MatrixToString;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Reverses the columns in the given Array Matrix.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.ReverseColumns\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix,$return]\n *\n * @param {T[][]} [matrix] - The array matrix to reverse the columns for.\n *\n * @return {T[][]} The column reversed matrix.\n */\nvar ReverseColumns = function (matrix)\n{\n return matrix.reverse();\n};\n\nmodule.exports = ReverseColumns;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Reverses the rows in the given Array Matrix.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.ReverseRows\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix,$return]\n *\n * @param {T[][]} [matrix] - The array matrix to reverse the rows for.\n *\n * @return {T[][]} The column reversed matrix.\n */\nvar ReverseRows = function (matrix)\n{\n for (var i = 0; i < matrix.length; i++)\n {\n matrix[i].reverse();\n }\n\n return matrix;\n};\n\nmodule.exports = ReverseRows;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar RotateMatrix = require('./RotateMatrix');\n\n/**\n * Rotates the array matrix 180 degrees.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.Rotate180\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix,$return]\n *\n * @param {T[][]} [matrix] - The array to rotate.\n *\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\n */\nvar Rotate180 = function (matrix)\n{\n return RotateMatrix(matrix, 180);\n};\n\nmodule.exports = Rotate180;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar RotateMatrix = require('./RotateMatrix');\n\n/**\n * Rotates the array matrix to the left (or 90 degrees)\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.RotateLeft\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix,$return]\n *\n * @param {T[][]} [matrix] - The array to rotate.\n *\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\n */\nvar RotateLeft = function (matrix)\n{\n return RotateMatrix(matrix, 90);\n};\n\nmodule.exports = RotateLeft;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar CheckMatrix = require('./CheckMatrix');\nvar TransposeMatrix = require('./TransposeMatrix');\n\n/**\n * Rotates the array matrix based on the given rotation value.\n *\n * The value can be given in degrees: 90, -90, 270, -270 or 180,\n * or a string command: `rotateLeft`, `rotateRight` or `rotate180`.\n *\n * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.RotateMatrix\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix,$return]\n *\n * @param {T[][]} [matrix] - The array to rotate.\n * @param {(number|string)} [direction=90] - The amount to rotate the matrix by.\n *\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\n */\nvar RotateMatrix = function (matrix, direction)\n{\n if (direction === undefined) { direction = 90; }\n\n if (!CheckMatrix(matrix))\n {\n return null;\n }\n\n if (typeof direction !== 'string')\n {\n direction = ((direction % 360) + 360) % 360;\n }\n\n if (direction === 90 || direction === -270 || direction === 'rotateLeft')\n {\n matrix = TransposeMatrix(matrix);\n matrix.reverse();\n }\n else if (direction === -90 || direction === 270 || direction === 'rotateRight')\n {\n matrix.reverse();\n matrix = TransposeMatrix(matrix);\n }\n else if (Math.abs(direction) === 180 || direction === 'rotate180')\n {\n for (var i = 0; i < matrix.length; i++)\n {\n matrix[i].reverse();\n }\n\n matrix.reverse();\n }\n\n return matrix;\n};\n\nmodule.exports = RotateMatrix;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar RotateMatrix = require('./RotateMatrix');\n\n/**\n * Rotates the array matrix to the left (or -90 degrees)\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.RotateRight\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix,$return]\n *\n * @param {T[][]} [matrix] - The array to rotate.\n *\n * @return {T[][]} The rotated matrix array. The source matrix should be discard for the returned matrix.\n */\nvar RotateRight = function (matrix)\n{\n return RotateMatrix(matrix, -90);\n};\n\nmodule.exports = RotateRight;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar RotateLeft = require('../RotateLeft');\nvar RotateRight = require('../RotateRight');\n\n/**\n * Translates the given Array Matrix by shifting each column and row the\n * amount specified.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.Translate\n * @since 3.50.0\n *\n * @generic T\n * @genericUse {T[][]} - [matrix,$return]\n *\n * @param {T[][]} [matrix] - The array matrix to translate.\n * @param {number} [x=0] - The amount to horizontally translate the matrix by.\n * @param {number} [y=0] - The amount to vertically translate the matrix by.\n *\n * @return {T[][]} The translated matrix.\n */\nvar TranslateMatrix = function (matrix, x, y)\n{\n if (x === undefined) { x = 0; }\n if (y === undefined) { y = 0; }\n\n // Vertical translation\n\n if (y !== 0)\n {\n if (y < 0)\n {\n // Shift Up\n RotateLeft(matrix, Math.abs(y));\n }\n else\n {\n // Shift Down\n RotateRight(matrix, y);\n }\n }\n\n // Horizontal translation\n\n if (x !== 0)\n {\n for (var i = 0; i < matrix.length; i++)\n {\n var row = matrix[i];\n\n if (x < 0)\n {\n RotateLeft(row, Math.abs(x));\n }\n else\n {\n RotateRight(row, x);\n }\n }\n }\n\n return matrix;\n};\n\nmodule.exports = TranslateMatrix;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Transposes the elements of the given matrix (array of arrays).\n *\n * The transpose of a matrix is a new matrix whose rows are the columns of the original.\n *\n * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows)\n * have the same length. There must be at least two rows. This is an example matrix:\n *\n * ```\n * [\n * [ 1, 1, 1, 1, 1, 1 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 2, 0, 1, 2, 0, 4 ],\n * [ 2, 0, 3, 4, 0, 4 ],\n * [ 2, 0, 0, 0, 0, 4 ],\n * [ 3, 3, 3, 3, 3, 3 ]\n * ]\n * ```\n *\n * @function Phaser.Utils.Array.Matrix.TransposeMatrix\n * @since 3.0.0\n *\n * @generic T\n * @genericUse {T[][]} - [array,$return]\n *\n * @param {T[][]} [array] - The array matrix to transpose.\n *\n * @return {T[][]} A new array matrix which is a transposed version of the given array.\n */\nvar TransposeMatrix = function (array)\n{\n var sourceRowCount = array.length;\n var sourceColCount = array[0].length;\n\n var result = new Array(sourceColCount);\n\n for (var i = 0; i < sourceColCount; i++)\n {\n result[i] = new Array(sourceRowCount);\n\n for (var j = sourceRowCount - 1; j > -1; j--)\n {\n result[i][j] = array[j][i];\n }\n }\n\n return result;\n};\n\nmodule.exports = TransposeMatrix;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace Phaser.Utils.Array.Matrix\n */\n\nmodule.exports = {\n\n CheckMatrix: require('./CheckMatrix'),\n MatrixToString: require('./MatrixToString'),\n ReverseColumns: require('./ReverseColumns'),\n ReverseRows: require('./ReverseRows'),\n Rotate180: require('./Rotate180'),\n RotateLeft: require('./RotateLeft'),\n RotateMatrix: require('./RotateMatrix'),\n RotateRight: require('./RotateRight'),\n Translate: require('./TranslateMatrix'),\n TransposeMatrix: require('./TransposeMatrix')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Deep Copy the given object or array.\n *\n * @function Phaser.Utils.Objects.DeepCopy\n * @since 3.50.0\n *\n * @param {object} obj - The object to deep copy.\n *\n * @return {object} A deep copy of the original object.\n */\nvar DeepCopy = function (inObject)\n{\n var outObject;\n var value;\n var key;\n\n if (typeof inObject !== 'object' || inObject === null)\n {\n // inObject is not an object\n return inObject;\n }\n\n // Create an array or object to hold the values\n outObject = Array.isArray(inObject) ? [] : {};\n\n for (key in inObject)\n {\n value = inObject[key];\n\n // Recursively (deep) copy for nested objects, including arrays\n outObject[key] = DeepCopy(value);\n }\n\n return outObject;\n};\n\nmodule.exports = DeepCopy;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar IsPlainObject = require('./IsPlainObject');\n\n// @param {boolean} deep - Perform a deep copy?\n// @param {object} target - The target object to copy to.\n// @return {object} The extended object.\n\n/**\n * This is a slightly modified version of http://api.jquery.com/jQuery.extend/\n *\n * @function Phaser.Utils.Objects.Extend\n * @since 3.0.0\n *\n * @param {...*} [args] - The objects that will be mixed.\n *\n * @return {object} The extended object.\n */\nvar Extend = function ()\n{\n var options, name, src, copy, copyIsArray, clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false;\n\n // Handle a deep copy situation\n if (typeof target === 'boolean')\n {\n deep = target;\n target = arguments[1] || {};\n\n // skip the boolean and the target\n i = 2;\n }\n\n // extend Phaser if only one argument is passed\n if (length === i)\n {\n target = this;\n --i;\n }\n\n for (; i < length; i++)\n {\n // Only deal with non-null/undefined values\n if ((options = arguments[i]) != null)\n {\n // Extend the base object\n for (name in options)\n {\n src = target[name];\n copy = options[name];\n\n // Prevent never-ending loop\n if (target === copy)\n {\n continue;\n }\n\n // Recurse if we're merging plain objects or arrays\n if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy))))\n {\n if (copyIsArray)\n {\n copyIsArray = false;\n clone = src && Array.isArray(src) ? src : [];\n }\n else\n {\n clone = src && IsPlainObject(src) ? src : {};\n }\n\n // Never move original objects, clone them\n target[name] = Extend(deep, clone, copy);\n\n // Don't bring in undefined values\n }\n else if (copy !== undefined)\n {\n target[name] = copy;\n }\n }\n }\n }\n\n // Return the modified object\n return target;\n};\n\nmodule.exports = Extend;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar MATH = require('../../math');\nvar GetValue = require('./GetValue');\n\n/**\n * Retrieves a value from an object. Allows for more advanced selection options, including:\n *\n * Allowed types:\n * \n * Implicit\n * {\n * x: 4\n * }\n *\n * From function\n * {\n * x: function ()\n * }\n *\n * Randomly pick one element from the array\n * {\n * x: [a, b, c, d, e, f]\n * }\n *\n * Random integer between min and max:\n * {\n * x: { randInt: [min, max] }\n * }\n *\n * Random float between min and max:\n * {\n * x: { randFloat: [min, max] }\n * }\n * \n *\n * @function Phaser.Utils.Objects.GetAdvancedValue\n * @since 3.0.0\n *\n * @param {object} source - The object to retrieve the value from.\n * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object.\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\n *\n * @return {*} The value of the requested key.\n */\nvar GetAdvancedValue = function (source, key, defaultValue)\n{\n var value = GetValue(source, key, null);\n\n if (value === null)\n {\n return defaultValue;\n }\n else if (Array.isArray(value))\n {\n return MATH.RND.pick(value);\n }\n else if (typeof value === 'object')\n {\n if (value.hasOwnProperty('randInt'))\n {\n return MATH.RND.integerInRange(value.randInt[0], value.randInt[1]);\n }\n else if (value.hasOwnProperty('randFloat'))\n {\n return MATH.RND.realInRange(value.randFloat[0], value.randFloat[1]);\n }\n }\n else if (typeof value === 'function')\n {\n return value(key);\n }\n\n return value;\n};\n\nmodule.exports = GetAdvancedValue;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Finds the key within the top level of the {@link source} object, or returns {@link defaultValue}\n *\n * @function Phaser.Utils.Objects.GetFastValue\n * @since 3.0.0\n *\n * @param {object} source - The object to search\n * @param {string} key - The key for the property on source. Must exist at the top level of the source object (no periods)\n * @param {*} [defaultValue] - The default value to use if the key does not exist.\n *\n * @return {*} The value if found; otherwise, defaultValue (null if none provided)\n */\nvar GetFastValue = function (source, key, defaultValue)\n{\n var t = typeof(source);\n\n if (!source || t === 'number' || t === 'string')\n {\n return defaultValue;\n }\n else if (source.hasOwnProperty(key) && source[key] !== undefined)\n {\n return source[key];\n }\n else\n {\n return defaultValue;\n }\n};\n\nmodule.exports = GetFastValue;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n// Source object\n// The key as a string, or an array of keys, i.e. 'banner', or 'banner.hideBanner'\n// The default value to use if the key doesn't exist\n\n/**\n * Retrieves a value from an object.\n *\n * @function Phaser.Utils.Objects.GetValue\n * @since 3.0.0\n *\n * @param {object} source - The object to retrieve the value from.\n * @param {string} key - The name of the property to retrieve from the object. If a property is nested, the names of its preceding properties should be separated by a dot (`.`) - `banner.hideBanner` would return the value of the `hideBanner` property from the object stored in the `banner` property of the `source` object.\n * @param {*} defaultValue - The value to return if the `key` isn't found in the `source` object.\n *\n * @return {*} The value of the requested key.\n */\nvar GetValue = function (source, key, defaultValue)\n{\n if (!source || typeof source === 'number')\n {\n return defaultValue;\n }\n else if (source.hasOwnProperty(key))\n {\n return source[key];\n }\n else if (key.indexOf('.') !== -1)\n {\n var keys = key.split('.');\n var parent = source;\n var value = defaultValue;\n\n // Use for loop here so we can break early\n for (var i = 0; i < keys.length; i++)\n {\n if (parent.hasOwnProperty(keys[i]))\n {\n // Yes it has a key property, let's carry on down\n value = parent[keys[i]];\n\n parent = parent[keys[i]];\n }\n else\n {\n // Can't go any further, so reset to default\n value = defaultValue;\n break;\n }\n }\n\n return value;\n }\n else\n {\n return defaultValue;\n }\n};\n\nmodule.exports = GetValue;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * This is a slightly modified version of jQuery.isPlainObject.\n * A plain object is an object whose internal class property is [object Object].\n *\n * @function Phaser.Utils.Objects.IsPlainObject\n * @since 3.0.0\n *\n * @param {object} obj - The object to inspect.\n *\n * @return {boolean} `true` if the object is plain, otherwise `false`.\n */\nvar IsPlainObject = function (obj)\n{\n // Not plain objects:\n // - Any object or value whose internal [[Class]] property is not \"[object Object]\"\n // - DOM nodes\n // - window\n if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window)\n {\n return false;\n }\n\n // Support: Firefox <20\n // The try/catch suppresses exceptions thrown when attempting to access\n // the \"constructor\" property of certain host objects, ie. |window.location|\n // https://bugzilla.mozilla.org/show_bug.cgi?id=814622\n try\n {\n if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf'))\n {\n return false;\n }\n }\n catch (e)\n {\n return false;\n }\n\n // If the function hasn't returned already, we're confident that\n // |obj| is a plain object, created by {} or constructed with new Object\n return true;\n};\n\nmodule.exports = IsPlainObject;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Takes the given string and pads it out, to the length required, using the character\n * specified. For example if you need a string to be 6 characters long, you can call:\n *\n * `pad('bob', 6, '-', 2)`\n *\n * This would return: `bob---` as it has padded it out to 6 characters, using the `-` on the right.\n *\n * You can also use it to pad numbers (they are always returned as strings):\n * \n * `pad(512, 6, '0', 1)`\n *\n * Would return: `000512` with the string padded to the left.\n *\n * If you don't specify a direction it'll pad to both sides:\n * \n * `pad('c64', 7, '*')`\n *\n * Would return: `**c64**`\n *\n * @function Phaser.Utils.String.Pad\n * @since 3.0.0\n *\n * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers.\n * @param {number} [len=0] - The number of characters to be added.\n * @param {string} [pad=\" \"] - The string to pad it out with (defaults to a space).\n * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both).\n * \n * @return {string} The padded string.\n */\nvar Pad = function (str, len, pad, dir)\n{\n if (len === undefined) { len = 0; }\n if (pad === undefined) { pad = ' '; }\n if (dir === undefined) { dir = 3; }\n\n str = str.toString();\n\n var padlen = 0;\n\n if (len + 1 >= str.length)\n {\n switch (dir)\n {\n case 1:\n str = new Array(len + 1 - str.length).join(pad) + str;\n break;\n\n case 3:\n var right = Math.ceil((padlen = len - str.length) / 2);\n var left = padlen - right;\n str = new Array(left + 1).join(pad) + str + new Array(right + 1).join(pad);\n break;\n\n default:\n str = str + new Array(len + 1 - str.length).join(pad);\n break;\n }\n }\n\n return str;\n};\n\nmodule.exports = Pad;\n","/**\n * @author Richard Davey \n * @copyright 2018 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar Class = require('../../../src/utils/Class');\nvar GetFastValue = require('../../../src/utils/object/GetFastValue');\nvar ImageFile = require('../../../src/loader/filetypes/ImageFile.js');\nvar IsPlainObject = require('../../../src/utils/object/IsPlainObject');\nvar JSONFile = require('../../../src/loader/filetypes/JSONFile.js');\nvar MultiFile = require('../../../src/loader/MultiFile.js');\nvar TextFile = require('../../../src/loader/filetypes/TextFile.js');\n\n/**\n * @typedef {object} Phaser.Loader.FileTypes.SpineFileConfig\n *\n * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager.\n * @property {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\".\n * @property {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\n * @property {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not?\n * @property {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\n * @property {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\n */\n\n/**\n * @classdesc\n * A Spine File suitable for loading by the Loader.\n *\n * These are created when you use the Phaser.Loader.LoaderPlugin#spine method and are not typically created directly.\n *\n * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#spine.\n *\n * @class SpineFile\n * @extends Phaser.Loader.MultiFile\n * @memberof Phaser.Loader.FileTypes\n * @constructor\n *\n * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file.\n * @param {(string|Phaser.Loader.FileTypes.SpineFileConfig)} key - The key to use for this file, or a file configuration object.\n * @param {string|string[]} [jsonURL] - The absolute or relative URL to load the JSON file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\".\n * @param {string} [atlasURL] - The absolute or relative URL to load the texture atlas data file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was \"alien\" then the URL will be \"alien.txt\".\n * @param {boolean} [preMultipliedAlpha=false] - Do the textures contain pre-multiplied alpha or not?\n * @param {XHRSettingsObject} [jsonXhrSettings] - An XHR Settings configuration object for the json file. Used in replacement of the Loaders default XHR Settings.\n * @param {XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas data file. Used in replacement of the Loaders default XHR Settings.\n */\nvar SpineFile = new Class({\n\n Extends: MultiFile,\n\n initialize:\n\n function SpineFile (loader, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\n {\n var i;\n var json;\n var atlas;\n var files = [];\n var cache = loader.cacheManager.custom.spine;\n\n // atlas can be an array of atlas files, not just a single one\n\n if (IsPlainObject(key))\n {\n var config = key;\n\n key = GetFastValue(config, 'key');\n\n json = new JSONFile(loader, {\n key: key,\n url: GetFastValue(config, 'jsonURL'),\n extension: GetFastValue(config, 'jsonExtension', 'json'),\n xhrSettings: GetFastValue(config, 'jsonXhrSettings')\n });\n\n atlasURL = GetFastValue(config, 'atlasURL');\n preMultipliedAlpha = GetFastValue(config, 'preMultipliedAlpha');\n\n if (!Array.isArray(atlasURL))\n {\n atlasURL = [ atlasURL ];\n }\n\n for (i = 0; i < atlasURL.length; i++)\n {\n atlas = new TextFile(loader, {\n key: key + '!' + i,\n url: atlasURL[i],\n extension: GetFastValue(config, 'atlasExtension', 'atlas'),\n xhrSettings: GetFastValue(config, 'atlasXhrSettings')\n });\n\n atlas.cache = cache;\n\n files.push(atlas);\n }\n }\n else\n {\n json = new JSONFile(loader, key, jsonURL, jsonXhrSettings);\n\n if (!Array.isArray(atlasURL))\n {\n atlasURL = [ atlasURL ];\n }\n\n for (i = 0; i < atlasURL.length; i++)\n {\n atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings);\n atlas.cache = cache;\n\n files.push(atlas);\n }\n }\n\n files.unshift(json);\n\n MultiFile.call(this, loader, 'spine', key, files);\n\n this.config.preMultipliedAlpha = preMultipliedAlpha;\n },\n\n /**\n * Called by each File when it finishes loading.\n *\n * @method Phaser.Loader.FileTypes.SpineFile#onFileComplete\n * @since 3.19.0\n *\n * @param {Phaser.Loader.File} file - The File that has completed processing.\n */\n onFileComplete: function (file)\n {\n var index = this.files.indexOf(file);\n\n if (index !== -1)\n {\n this.pending--;\n\n if (file.type === 'text')\n {\n // Inspect the data for the files to now load\n var content = file.data.split('\\n');\n\n // Extract the textures\n var textures = [];\n\n for (var t = 0; t < content.length; t++)\n {\n var line = content[t];\n\n if (line.trim() === '' && t < content.length - 1)\n {\n line = content[t + 1];\n\n textures.push(line);\n }\n }\n\n var config = this.config;\n var loader = this.loader;\n\n var currentBaseURL = loader.baseURL;\n var currentPath = loader.path;\n var currentPrefix = loader.prefix;\n\n var baseURL = GetFastValue(config, 'baseURL', this.baseURL);\n var path = GetFastValue(config, 'path', file.src.match(/^.*\\//))[0];\n var prefix = GetFastValue(config, 'prefix', this.prefix);\n var textureXhrSettings = GetFastValue(config, 'textureXhrSettings');\n\n loader.setBaseURL(baseURL);\n loader.setPath(path);\n loader.setPrefix(prefix);\n\n for (var i = 0; i < textures.length; i++)\n {\n var textureURL = textures[i];\n\n var key = this.prefix + textureURL;\n\n var image = new ImageFile(loader, key, textureURL, textureXhrSettings);\n\n if (!loader.keyExists(image))\n {\n this.addToMultiFile(image);\n\n loader.addFile(image);\n }\n }\n\n // Reset the loader settings\n loader.setBaseURL(currentBaseURL);\n loader.setPath(currentPath);\n loader.setPrefix(currentPrefix);\n }\n }\n },\n\n /**\n * Adds this file to its target cache upon successful loading and processing.\n *\n * @method Phaser.Loader.FileTypes.SpineFile#addToCache\n * @since 3.19.0\n */\n addToCache: function ()\n {\n if (this.isReadyToProcess())\n {\n var fileJSON = this.files[0];\n\n fileJSON.addToCache();\n\n var atlasCache;\n var atlasKey = '';\n var combinedAtlasData = '';\n var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false;\n var textureManager = this.loader.textureManager;\n\n for (var i = 1; i < this.files.length; i++)\n {\n var file = this.files[i];\n\n if (file.type === 'text')\n {\n atlasKey = file.key.replace(/![\\d]$/, '');\n\n atlasCache = file.cache;\n\n combinedAtlasData = combinedAtlasData.concat(file.data);\n }\n else\n {\n var src = file.key.trim();\n var pos = src.indexOf('!');\n var key = src.substr(pos + 1);\n\n if (!textureManager.exists(key))\n {\n textureManager.addImage(key, file.data);\n }\n }\n\n file.pendingDestroy();\n }\n\n atlasCache.add(atlasKey, { preMultipliedAlpha: preMultipliedAlpha, data: combinedAtlasData, prefix: this.prefix });\n\n this.complete = true;\n }\n }\n\n});\n\nmodule.exports = SpineFile;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar BuildGameObject = require('../../../src/gameobjects/BuildGameObject');\nvar Class = require('../../../src/utils/Class');\nvar GetValue = require('../../../src/utils/object/GetValue');\nvar ResizeEvent = require('../../../src/scale/events/RESIZE_EVENT');\nvar ScenePlugin = require('../../../src/plugins/ScenePlugin');\nvar Spine = require('Spine');\nvar SpineFile = require('./SpineFile');\nvar SpineGameObject = require('./gameobject/SpineGameObject');\nvar SpineContainer = require('./container/SpineContainer');\nvar NOOP = require('../../../src/utils/NOOP');\n\n// Plugin specific instance of the Spine Scene Renderer\nvar sceneRenderer;\n\n/**\n * @classdesc\n * The Spine Plugin is a Scene based plugin that handles the creation and rendering of Spine Game Objects.\n *\n * Find more details about Spine itself at http://esotericsoftware.com/.\n *\n * All rendering and object creation is handled via the official Spine Runtimes. This version of the plugin\n * uses the Spine 3.8.95 runtimes. Please note that due to the way the Spine runtimes use semver, you will\n * get breaking changes in point-releases. Therefore, files created in a different version of Spine may not\n * work as a result, without you first updating the runtimes and rebuilding the plugin.\n *\n * Esoteric themselves recommend that you freeze your Spine editor version against the runtime versions.\n * You can find more information about this here: http://esotericsoftware.com/spine-settings#Version\n *\n * Please note that you require a Spine license in order to use Spine Runtimes in your games.\n *\n * You can install this plugin into your Phaser game by either importing it, if you're using ES6:\n *\n * ```javascript\n * import * as SpinePlugin from './SpinePlugin.js';\n * ```\n *\n * and then adding it to your Phaser Game configuration:\n *\n * ```javascript\n * plugins: {\n * scene: [\n * { key: 'SpinePlugin', plugin: window.SpinePlugin, mapping: 'spine' }\n * ]\n * }\n * ```\n *\n * If you're using ES5 then you can load the Spine Plugin in a Scene files payload, _within_ your\n * Game Configuration object, like this:\n *\n * ```javascript\n * scene: {\n * preload: preload,\n * create: create,\n * pack: {\n * files: [\n * { type: 'scenePlugin', key: 'SpinePlugin', url: 'plugins/SpinePlugin.js', sceneKey: 'spine' }\n * ]\n * }\n * }\n * ```\n *\n * Loading it like this allows you to then use commands such as `this.load.spine` from within the\n * same Scene. Alternatively, you can use the method `this.load.plugin` to load the plugin via the normal\n * Phaser Loader. However, doing so will not add it to the current Scene. It will be available from any\n * subsequent Scenes.\n *\n * Assuming a default environment you access it from within a Scene by using the `this.spine` reference.\n *\n * When this plugin is installed into a Scene it will add a Loader File Type, allowing you to load\n * Spine files directly, i.e.:\n *\n * ```javascript\n * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true);\n * ```\n *\n * It also installs two Game Object Factory methods, allowing you to create Spine Game Objects\n * and Spine Containers:\n *\n * ```javascript\n * const man = this.add.spine(512, 650, 'stretchyman');\n *\n * const container = this.add.spineContainer();\n *\n * container.add(man);\n * ```\n *\n * The first argument is the key which you used when importing the Spine data. There are lots of\n * things you can specify, such as the animation name, skeleton, slot attachments and more. Please\n * see the respective documentation and examples for further details.\n *\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary.\n * The associated atlas files are scanned for any texture files present in them, which are then loaded.\n * If you have exported your Spine data with preMultipliedAlpha set, then you should enable this in the\n * load arguments, or you may see black outlines around skeleton textures.\n *\n * The Spine plugin is local to the Scene in which it is installed. This means a change to something,\n * such as the Skeleton Debug Renderer, in this Scene, will not impact the renderer in any other Scene.\n * The only exception to this is with the caches this plugin creates. Spine atlas and texture data are\n * stored in their own caches, which are global, meaning they're accessible from any Scene in your\n * game, regardless if the Scene loaded the Spine data or not.\n *\n * When destroying a Phaser Game instance, if you need to re-create it again on the same page without\n * reloading, you must remember to remove the Spine Plugin as part of your tear-down process:\n *\n * ```javascript\n * this.plugins.removeScenePlugin('SpinePlugin');\n * ```\n *\n * For details about the Spine Runtime API see http://esotericsoftware.com/spine-api-reference\n *\n * @class SpinePlugin\n * @extends Phaser.Plugins.ScenePlugin\n * @constructor\n * @since 3.19.0\n *\n * @param {Phaser.Scene} scene - A reference to the Scene that has installed this plugin.\n * @param {Phaser.Plugins.PluginManager} pluginManager - A reference to the Phaser Plugin Manager.\n */\nvar SpinePlugin = new Class({\n\n Extends: ScenePlugin,\n\n initialize:\n\n function SpinePlugin (scene, pluginManager)\n {\n ScenePlugin.call(this, scene, pluginManager);\n\n var game = pluginManager.game;\n\n /**\n * A read-only flag that indicates if the game is running under WebGL or Canvas.\n *\n * @name SpinePlugin#isWebGL\n * @type {boolean}\n * @readonly\n * @since 3.19.0\n */\n this.isWebGL = (game.config.renderType === 2);\n\n /**\n * A custom cache that stores the Spine atlas data.\n *\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\n * no matter which Scene you are in.\n *\n * @name SpinePlugin#cache\n * @type {Phaser.Cache.BaseCache}\n * @since 3.19.0\n */\n this.cache = game.cache.addCustom('spine');\n\n /**\n * A custom cache that stores the Spine Textures.\n *\n * This cache is global across your game, allowing you to access Spine data loaded from other Scenes,\n * no matter which Scene you are in.\n *\n * @name SpinePlugin#spineTextures\n * @type {Phaser.Cache.BaseCache}\n * @since 3.19.0\n */\n this.spineTextures = game.cache.addCustom('spineTextures');\n\n /**\n * A reference to the global JSON Cache.\n *\n * @name SpinePlugin#json\n * @type {Phaser.Cache.BaseCache}\n * @since 3.19.0\n */\n this.json = game.cache.json;\n\n /**\n * A reference to the global Texture Manager.\n *\n * @name SpinePlugin#textures\n * @type {Phaser.Textures.TextureManager}\n * @since 3.19.0\n */\n this.textures = game.textures;\n\n /**\n * A flag that sets if the Skeleton Renderers will render debug information over the top\n * of the skeleton or not.\n *\n * @name SpinePlugin#drawDebug\n * @type {boolean}\n * @since 3.19.0\n */\n this.drawDebug = false;\n\n /**\n * The underlying WebGL context of the Phaser renderer.\n *\n * Only set if running in WebGL mode.\n *\n * @name SpinePlugin#gl\n * @type {WebGLRenderingContext}\n * @since 3.19.0\n */\n this.gl;\n\n /**\n * A reference to either the Canvas or WebGL Renderer that this Game is using.\n *\n * @name SpinePlugin#renderer\n * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)}\n * @since 3.19.0\n */\n this.renderer;\n\n /**\n * An instance of the Spine WebGL Scene Renderer.\n *\n * There is only one instance of the Scene Renderer shared across the whole plugin.\n *\n * Only set if running in WebGL mode.\n *\n * @name SpinePlugin#sceneRenderer\n * @type {spine.webgl.SceneRenderer}\n * @since 3.19.0\n */\n this.sceneRenderer;\n\n /**\n * An instance of the Spine Skeleton Renderer.\n *\n * @name SpinePlugin#skeletonRenderer\n * @type {(spine.canvas.SkeletonRenderer|spine.webgl.SkeletonRenderer)}\n * @since 3.19.0\n */\n this.skeletonRenderer;\n\n /**\n * An instance of the Spine Skeleton Debug Renderer.\n *\n * Only set if running in WebGL mode.\n *\n * @name SpinePlugin#skeletonDebugRenderer\n * @type {spine.webgl.skeletonDebugRenderer}\n * @since 3.19.0\n */\n this.skeletonDebugRenderer;\n\n /**\n * A reference to the Spine runtime.\n * This is the runtime created by Esoteric Software.\n *\n * @name SpinePlugin#plugin\n * @type {spine}\n * @since 3.19.0\n */\n this.plugin = Spine;\n\n /**\n * An internal vector3 used by the screen to world method.\n *\n * @name SpinePlugin#temp1\n * @private\n * @type {spine.webgl.Vector3}\n * @since 3.19.0\n */\n this.temp1;\n\n /**\n * An internal vector3 used by the screen to world method.\n *\n * @name SpinePlugin#temp2\n * @private\n * @type {spine.webgl.Vector3}\n * @since 3.19.0\n */\n this.temp2;\n\n if (this.isWebGL)\n {\n this.runtime = Spine.webgl;\n\n this.renderer = game.renderer;\n this.gl = game.renderer.gl;\n\n this.getAtlas = this.getAtlasWebGL;\n }\n else\n {\n this.runtime = Spine.canvas;\n\n this.renderer = game.renderer;\n\n this.getAtlas = this.getAtlasCanvas;\n }\n\n // Headless mode?\n if (!this.renderer)\n {\n this.renderer = {\n width: game.scale.width,\n height: game.scale.height,\n preRender: NOOP,\n postRender: NOOP,\n render: NOOP,\n destroy: NOOP\n };\n }\n\n var _this = this;\n\n var add = function (x, y, key, animationName, loop)\n {\n var spineGO = new SpineGameObject(this.scene, _this, x, y, key, animationName, loop);\n\n this.displayList.add(spineGO);\n this.updateList.add(spineGO);\n\n return spineGO;\n };\n\n var make = function (config, addToScene)\n {\n if (config === undefined) { config = {}; }\n\n var key = GetValue(config, 'key', null);\n var animationName = GetValue(config, 'animationName', null);\n var loop = GetValue(config, 'loop', false);\n\n var spineGO = new SpineGameObject(this.scene, _this, 0, 0, key, animationName, loop);\n\n if (addToScene !== undefined)\n {\n config.add = addToScene;\n }\n\n BuildGameObject(this.scene, spineGO, config);\n\n // Spine specific\n var skinName = GetValue(config, 'skinName', false);\n\n if (skinName)\n {\n spineGO.setSkinByName(skinName);\n }\n\n var slotName = GetValue(config, 'slotName', false);\n var attachmentName = GetValue(config, 'attachmentName', null);\n\n if (slotName)\n {\n spineGO.setAttachment(slotName, attachmentName);\n }\n\n return spineGO.refresh();\n };\n\n var addContainer = function (x, y, children)\n {\n var spineGO = new SpineContainer(this.scene, _this, x, y, children);\n\n this.displayList.add(spineGO);\n\n return spineGO;\n };\n\n var makeContainer = function (config, addToScene)\n {\n if (config === undefined) { config = {}; }\n\n var x = GetValue(config, 'x', 0);\n var y = GetValue(config, 'y', 0);\n var children = GetValue(config, 'children', null);\n\n var container = new SpineContainer(this.scene, _this, x, y, children);\n\n if (addToScene !== undefined)\n {\n config.add = addToScene;\n }\n\n BuildGameObject(this.scene, container, config);\n\n return container;\n };\n\n pluginManager.registerFileType('spine', this.spineFileCallback, scene);\n pluginManager.registerGameObject('spine', add, make);\n pluginManager.registerGameObject('spineContainer', addContainer, makeContainer);\n },\n\n /**\n * Internal boot handler.\n *\n * @method SpinePlugin#boot\n * @private\n * @since 3.19.0\n */\n boot: function ()\n {\n if (this.isWebGL)\n {\n this.bootWebGL();\n this.onResize();\n this.game.scale.on(ResizeEvent, this.onResize, this);\n }\n else\n {\n this.bootCanvas();\n }\n\n var eventEmitter = this.systems.events;\n\n eventEmitter.once('shutdown', this.shutdown, this);\n eventEmitter.once('destroy', this.destroy, this);\n\n this.game.events.once('destroy', this.gameDestroy, this);\n },\n\n /**\n * Internal boot handler for the Canvas Renderer.\n *\n * @method SpinePlugin#bootCanvas\n * @private\n * @since 3.19.0\n */\n bootCanvas: function ()\n {\n this.skeletonRenderer = new Spine.canvas.SkeletonRenderer(this.scene.sys.context);\n },\n\n /**\n * Internal boot handler for the WebGL Renderer.\n *\n * @method SpinePlugin#bootWebGL\n * @private\n * @since 3.19.0\n */\n bootWebGL: function ()\n {\n // Monkeypatch the Spine setBlendMode functions, or batching is destroyed!\n\n var setBlendMode = function (srcBlend, dstBlend)\n {\n if (srcBlend !== this.srcBlend || dstBlend !== this.dstBlend)\n {\n var gl = this.context.gl;\n\n this.srcBlend = srcBlend;\n this.dstBlend = dstBlend;\n\n if (this.isDrawing)\n {\n this.flush();\n gl.blendFunc(this.srcBlend, this.dstBlend);\n }\n }\n };\n\n if (!sceneRenderer)\n {\n sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true);\n sceneRenderer.batcher.setBlendMode = setBlendMode;\n sceneRenderer.shapes.setBlendMode = setBlendMode;\n }\n\n // All share the same instance\n this.sceneRenderer = sceneRenderer;\n this.skeletonRenderer = sceneRenderer.skeletonRenderer;\n this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer;\n\n this.temp1 = new Spine.webgl.Vector3(0, 0, 0);\n this.temp2 = new Spine.webgl.Vector3(0, 0, 0);\n },\n\n /**\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\n * then returns it. You do not normally need to invoke this method directly.\n *\n * @method SpinePlugin#getAtlasCanvas\n * @since 3.19.0\n *\n * @param {string} key - The key of the Spine Atlas to create.\n *\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\n */\n getAtlasCanvas: function (key)\n {\n var atlasEntry = this.cache.get(key);\n\n if (!atlasEntry)\n {\n console.warn('No atlas data for: ' + key);\n return;\n }\n\n var atlas;\n var spineTextures = this.spineTextures;\n\n if (spineTextures.has(key))\n {\n atlas = spineTextures.get(key);\n }\n else\n {\n var textures = this.textures;\n\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\n {\n return new Spine.canvas.CanvasTexture(textures.get(atlasEntry.prefix + path).getSourceImage());\n });\n }\n\n return atlas;\n },\n\n /**\n * Gets a loaded Spine Atlas from the cache and creates a new Spine Texture Atlas,\n * then returns it. You do not normally need to invoke this method directly.\n *\n * @method SpinePlugin#getAtlasWebGL\n * @since 3.19.0\n *\n * @param {string} key - The key of the Spine Atlas to create.\n *\n * @return {spine.TextureAtlas} The Spine Texture Atlas, or undefined if the given key wasn't found.\n */\n getAtlasWebGL: function (key)\n {\n var atlasEntry = this.cache.get(key);\n\n if (!atlasEntry)\n {\n console.warn('No atlas data for: ' + key);\n return;\n }\n\n var atlas;\n var spineTextures = this.spineTextures;\n\n if (spineTextures.has(key))\n {\n atlas = spineTextures.get(key);\n }\n else\n {\n var textures = this.textures;\n\n var gl = this.sceneRenderer.context.gl;\n\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\n atlas = new Spine.TextureAtlas(atlasEntry.data, function (path)\n {\n return new Spine.webgl.GLTexture(gl, textures.get(atlasEntry.prefix + path).getSourceImage(), false);\n });\n }\n\n return atlas;\n },\n\n /**\n * Adds a Spine Skeleton and Atlas file, or array of files, to the current load queue.\n *\n * You can call this method from within your Scene's `preload`, along with any other files you wish to load:\n *\n * ```javascript\n * function preload ()\n * {\n * this.load.spine('spineBoy', 'boy.json', 'boy.atlas', true);\n * }\n * ```\n *\n * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts,\n * or if it's already running, when the next free load slot becomes available. This happens automatically if you\n * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued\n * it means you cannot use the file immediately after calling this method, but must wait for the file to complete.\n * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the\n * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been\n * loaded.\n *\n * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring\n * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details.\n *\n * Phaser expects the Spine data to be exported from the Spine application in a JSON format, not binary. The associated\n * atlas files are scanned for any texture files present in them, which are then loaded. If you have exported\n * your Spine data with preMultipliedAlpha set, then you should enable this in the arguments, or you may see black\n * outlines around skeleton textures.\n *\n * The key must be a unique String. It is used to add the file to the global Spine cache upon a successful load.\n * The key should be unique both in terms of files being loaded and files already present in the Spine cache.\n * Loading a file using a key that is already taken will result in a warning.\n *\n * Instead of passing arguments you can pass a configuration object, such as:\n *\n * ```javascript\n * this.load.spine({\n * key: 'mainmenu',\n * jsonURL: 'boy.json',\n * atlasURL: 'boy.atlas',\n * preMultipliedAlpha: true\n * });\n * ```\n *\n * If you need to load multiple Spine atlas files, provide them as an array:\n *\n * ```javascript\n * function preload ()\n * {\n * this.load.spine('demos', 'demos.json', [ 'atlas1.atlas', 'atlas2.atlas' ], true);\n * }\n * ```\n *\n * See the documentation for `Phaser.Types.Loader.FileTypes.SpineFileConfig` for more details.\n *\n * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files\n * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and\n * this is what you would use to retrieve the data from the Spine plugin.\n *\n * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it.\n *\n * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is \"alien\"\n * and no URL is given then the Loader will set the URL to be \"alien.json\". It will always add `.json` as the extension, although\n * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL.\n *\n * Note: The ability to load this type of file will only be available if the Spine Plugin has been built or loaded into Phaser.\n *\n * @method Phaser.Loader.LoaderPlugin#spine\n * @fires Phaser.Loader.LoaderPlugin#ADD\n * @since 3.19.0\n *\n * @param {(string|Phaser.Types.Loader.FileTypes.JSONFileConfig|Phaser.Types.Loader.FileTypes.JSONFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them.\n * @param {string} jsonURL - The absolute or relative URL to load the Spine json file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was \"alien\" then the URL will be \"alien.json\".\n * @param {string|string[]} atlasURL - The absolute or relative URL to load the Spine atlas file from. If undefined or `null` it will be set to `.atlas`, i.e. if `key` was \"alien\" then the URL will be \"alien.atlas\".\n * @param {boolean} [preMultipliedAlpha=false] - Do the texture files include pre-multiplied alpha or not?\n * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the Spine json file. Used in replacement of the Loaders default XHR Settings.\n * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the Spine atlas file. Used in replacement of the Loaders default XHR Settings.\n *\n * @return {Phaser.Loader.LoaderPlugin} The Loader instance.\n */\n spineFileCallback: function (key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings)\n {\n var multifile;\n\n if (Array.isArray(key))\n {\n for (var i = 0; i < key.length; i++)\n {\n multifile = new SpineFile(this, key[i]);\n\n this.addFile(multifile.files);\n }\n }\n else\n {\n multifile = new SpineFile(this, key, jsonURL, atlasURL, preMultipliedAlpha, jsonXhrSettings, atlasXhrSettings);\n\n this.addFile(multifile.files);\n }\n\n return this;\n },\n\n /**\n * Converts the given x and y screen coordinates into the world space of the given Skeleton.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#worldToLocal\n * @since 3.19.0\n *\n * @param {number} x - The screen space x coordinate to convert.\n * @param {number} y - The screen space y coordinate to convert.\n * @param {spine.Skeleton} skeleton - The Spine Skeleton to convert into.\n * @param {spine.Bone} [bone] - Optional bone of the Skeleton to convert into.\n *\n * @return {spine.Vector2} A Vector2 containing the translated point.\n */\n worldToLocal: function (x, y, skeleton, bone)\n {\n var temp1 = this.temp1;\n var temp2 = this.temp2;\n var camera = this.sceneRenderer.camera;\n\n temp1.set(x + skeleton.x, y - skeleton.y, 0);\n\n var width = camera.viewportWidth;\n var height = camera.viewportHeight;\n\n camera.screenToWorld(temp1, width, height);\n\n if (bone && bone.parent !== null)\n {\n bone.parent.worldToLocal(temp2.set(temp1.x - skeleton.x, temp1.y - skeleton.y, 0));\n\n return new Spine.Vector2(temp2.x, temp2.y);\n }\n else if (bone)\n {\n return new Spine.Vector2(temp1.x - skeleton.x, temp1.y - skeleton.y);\n }\n else\n {\n return new Spine.Vector2(temp1.x, temp1.y);\n }\n },\n\n /**\n * Returns a Spine Vector2 based on the given x and y values.\n *\n * @method SpinePlugin#getVector2\n * @since 3.19.0\n *\n * @param {number} x - The Vector x value.\n * @param {number} y - The Vector y value.\n *\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\n */\n getVector2: function (x, y)\n {\n return new Spine.Vector2(x, y);\n },\n\n /**\n * Returns a Spine Vector2 based on the given x, y and z values.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#getVector3\n * @since 3.19.0\n *\n * @param {number} x - The Vector x value.\n * @param {number} y - The Vector y value.\n * @param {number} z - The Vector z value.\n *\n * @return {spine.Vector2} A Spine Vector2 based on the given values.\n */\n getVector3: function (x, y, z)\n {\n return new Spine.webgl.Vector3(x, y, z);\n },\n\n /**\n * Sets `drawBones` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugBones\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugBones: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawBones = value;\n\n return this;\n },\n\n /**\n * Sets `drawRegionAttachments` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugRegionAttachments\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugRegionAttachments: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawRegionAttachments = value;\n\n return this;\n },\n\n /**\n * Sets `drawBoundingBoxes` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugBoundingBoxes\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugBoundingBoxes: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawBoundingBoxes = value;\n\n return this;\n },\n\n /**\n * Sets `drawMeshHull` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugMeshHull\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugMeshHull: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawMeshHull = value;\n\n return this;\n },\n\n /**\n * Sets `drawMeshTriangles` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugMeshTriangles\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugMeshTriangles: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawMeshTriangles = value;\n\n return this;\n },\n\n /**\n * Sets `drawPaths` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugPaths\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugPaths: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawPaths = value;\n\n return this;\n },\n\n /**\n * Sets `drawSkeletonXY` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugSkeletonXY\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugSkeletonXY: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawSkeletonXY = value;\n\n return this;\n },\n\n /**\n * Sets `drawClipping` in the Spine Skeleton Debug Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setDebugClipping\n * @since 3.19.0\n *\n * @param {boolean} [value=true] - The value to set in the debug property.\n *\n * @return {this} This Spine Plugin.\n */\n setDebugClipping: function (value)\n {\n if (value === undefined) { value = true; }\n\n this.skeletonDebugRenderer.drawClipping = value;\n\n return this;\n },\n\n /**\n * Sets the given vertex effect on the Spine Skeleton Renderer.\n *\n * Only works in WebGL.\n *\n * @method SpinePlugin#setEffect\n * @since 3.19.0\n *\n * @param {spine.VertexEffect} [effect] - The vertex effect to set on the Skeleton Renderer.\n *\n * @return {this} This Spine Plugin.\n */\n setEffect: function (effect)\n {\n this.sceneRenderer.skeletonRenderer.vertexEffect = effect;\n\n return this;\n },\n\n /**\n * Creates a Spine Skeleton based on the given key and optional Skeleton JSON data.\n *\n * The Skeleton data should have already been loaded before calling this method.\n *\n * @method SpinePlugin#createSkeleton\n * @since 3.19.0\n *\n * @param {string} key - The key of the Spine skeleton data, as loaded by the plugin. If the Spine JSON contains multiple skeletons, reference them with a period, i.e. `set.spineBoy`.\n * @param {object} [skeletonJSON] - Optional Skeleton JSON data to use, instead of getting it from the cache.\n *\n * @return {(any|null)} This Spine Skeleton data object, or `null` if the key was invalid.\n */\n createSkeleton: function (key, skeletonJSON)\n {\n var atlasKey = key;\n var jsonKey = key;\n var split = (key.indexOf('.') !== -1);\n\n if (split)\n {\n var parts = key.split('.');\n\n atlasKey = parts.shift();\n jsonKey = parts.join('.');\n }\n\n var atlasData = this.cache.get(atlasKey);\n var atlas = this.getAtlas(atlasKey);\n\n if (!atlas)\n {\n return null;\n }\n\n if (!this.spineTextures.has(atlasKey))\n {\n this.spineTextures.add(atlasKey, atlas);\n }\n\n var preMultipliedAlpha = atlasData.preMultipliedAlpha;\n\n var atlasLoader = new Spine.AtlasAttachmentLoader(atlas);\n\n var skeletonJson = new Spine.SkeletonJson(atlasLoader);\n\n var data;\n\n if (skeletonJSON)\n {\n data = skeletonJSON;\n }\n else\n {\n var json = this.json.get(atlasKey);\n\n data = (split) ? GetValue(json, jsonKey) : json;\n }\n\n if (data)\n {\n var skeletonData = skeletonJson.readSkeletonData(data);\n\n var skeleton = new Spine.Skeleton(skeletonData);\n\n return { skeletonData: skeletonData, skeleton: skeleton, preMultipliedAlpha: preMultipliedAlpha };\n }\n else\n {\n return null;\n }\n },\n\n /**\n * Creates a new Animation State and Animation State Data for the given skeleton.\n *\n * The returned object contains two properties: `state` and `stateData` respectively.\n *\n * @method SpinePlugin#createAnimationState\n * @since 3.19.0\n *\n * @param {spine.Skeleton} skeleton - The Skeleton to create the Animation State for.\n *\n * @return {any} An object containing the Animation State and Animation State Data instances.\n */\n createAnimationState: function (skeleton)\n {\n var stateData = new Spine.AnimationStateData(skeleton.data);\n\n var state = new Spine.AnimationState(stateData);\n\n return { stateData: stateData, state: state };\n },\n\n /**\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n *\n * The returned object contains two properties: `offset` and `size`:\n *\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\n * `size` - The width and height of the AABB.\n *\n * @method SpinePlugin#getBounds\n * @since 3.19.0\n *\n * @param {spine.Skeleton} skeleton - The Skeleton to get the bounds from.\n *\n * @return {any} The bounds object.\n */\n getBounds: function (skeleton)\n {\n var offset = new Spine.Vector2();\n var size = new Spine.Vector2();\n\n skeleton.getBounds(offset, size, []);\n\n return { offset: offset, size: size };\n },\n\n /**\n * Internal handler for when the renderer resizes.\n *\n * Only called if running in WebGL.\n *\n * @method SpinePlugin#onResize\n * @since 3.19.0\n */\n onResize: function ()\n {\n var renderer = this.renderer;\n var sceneRenderer = this.sceneRenderer;\n\n var viewportWidth = renderer.width;\n var viewportHeight = renderer.height;\n\n sceneRenderer.camera.position.x = viewportWidth / 2;\n sceneRenderer.camera.position.y = viewportHeight / 2;\n\n sceneRenderer.camera.setViewport(viewportWidth, viewportHeight);\n },\n\n /**\n * The Scene that owns this plugin is shutting down.\n *\n * We need to kill and reset all internal properties as well as stop listening to Scene events.\n *\n * @method SpinePlugin#shutdown\n * @private\n * @since 3.19.0\n */\n shutdown: function ()\n {\n var eventEmitter = this.systems.events;\n\n eventEmitter.off('shutdown', this.shutdown, this);\n\n if (this.isWebGL)\n {\n this.game.scale.off(ResizeEvent, this.onResize, this);\n }\n },\n\n /**\n * The Scene that owns this plugin is being destroyed.\n *\n * We need to shutdown and then kill off all external references.\n *\n * @method SpinePlugin#destroy\n * @private\n * @since 3.19.0\n */\n destroy: function ()\n {\n this.shutdown();\n\n this.game = null;\n this.scene = null;\n this.systems = null;\n\n this.cache = null;\n this.spineTextures = null;\n this.json = null;\n this.textures = null;\n this.skeletonRenderer = null;\n this.gl = null;\n },\n\n /**\n * The Game that owns this plugin is being destroyed.\n *\n * Dispose of the Scene Renderer and remove the Game Objects.\n *\n * @method SpinePlugin#gameDestroy\n * @private\n * @since 3.50.0\n */\n gameDestroy: function ()\n {\n this.destroy();\n\n if (sceneRenderer)\n {\n sceneRenderer.dispose();\n }\n\n this.sceneRenderer = null;\n this.pluginManager = null;\n\n this.pluginManager.removeGameObject('spine', true, true);\n this.pluginManager.removeGameObject('spineContainer', true, true);\n }\n\n});\n\nSpinePlugin.SpineGameObject = SpineGameObject;\nSpinePlugin.SpineContainer = SpineContainer;\n\n/**\n * Creates a new Spine Game Object and adds it to the Scene.\n *\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\n * do not have a Phaser origin.\n *\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\n * that.\n *\n * ```javascript\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\n * ```\n *\n * The key is optional. If not passed here, you need to call `SpineGameObject.setSkeleton()` to use it.\n *\n * The animation name is also optional and can be set later via `SpineGameObject.setAnimation`.\n *\n * Should you wish for more control over the object creation, such as setting a slot attachment or skin\n * name, then use `SpinePlugin.make` instead.\n *\n * @method SpinePlugin#add\n * @since 3.19.0\n *\n * @param {number} x - The horizontal position of this Game Object in the world.\n * @param {number} y - The vertical position of this Game Object in the world.\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\n *\n * @return {SpineGameObject} The Game Object that was created.\n */\n\n/**\n * Creates a new Spine Game Object from the given configuration file and optionally adds it to the Scene.\n *\n * The x and y coordinate given is used to set the placement of the root Spine bone, which can vary from\n * skeleton to skeleton. All rotation and scaling happens from the root bone placement. Spine Game Objects\n * do not have a Phaser origin.\n *\n * If the Spine JSON file exported multiple Skeletons within it, then you can specify them by using a period\n * character in the key. For example, if you loaded a Spine JSON using the key `monsters` and it contains\n * multiple Skeletons, including one called `goblin` then you would use the key `monsters.goblin` to reference\n * that.\n *\n * ```javascript\n * let jelly = this.make.spine({\n * x: 500, y: 500, key: 'jelly',\n * scale: 1.5,\n * skinName: 'square_Green',\n * animationName: 'jelly-idle', loop: true,\n * slotName: 'hat', attachmentName: 'images/La_14'\n * });\n * ```\n *\n * @method SpinePlugin#make\n * @since 3.19.0\n *\n * @param {any} config - The configuration object this Game Object will use to create itself.\n * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object.\n *\n * @return {SpineGameObject} The Game Object that was created.\n */\n\nmodule.exports = SpinePlugin;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar Class = require('../../../../src/utils/Class');\nvar Container = require('../../../../src/gameobjects/container/Container');\nvar SpineContainerRender = require('./SpineContainerRender');\n\n/**\n * @classdesc\n * A Spine Container is a special kind of Container created specifically for Spine Game Objects.\n *\n * You have all of the same features of a standard Container, but the rendering functions are optimized specifically\n * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container.\n * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors.\n *\n * To create one in a Scene, use the factory methods:\n *\n * ```javascript\n * this.add.spinecontainer();\n * ```\n *\n * or\n *\n * ```javascript\n * this.make.spinecontainer();\n * ```\n *\n * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the\n * container children. You can, however, mask children of Spine Containers if they are embedded within other\n * Spine Containers. In short, if you need masking, don't mix and match the types.\n *\n * See the Container documentation for further details about what Containers can do.\n *\n * @class SpineContainer\n * @extends Phaser.GameObjects.Container\n * @constructor\n * @since 3.50.0\n *\n * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to.\n * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin.\n * @param {number} x - The horizontal position of this Game Object in the world.\n * @param {number} y - The vertical position of this Game Object in the world.\n * @param {SpineGameObject[]} [children] - An optional array of Spine Game Objects to add to this Container.\n */\nvar SpineContainer = new Class({\n\n Extends: Container,\n\n Mixins: [\n SpineContainerRender\n ],\n\n initialize:\n\n function SpineContainer (scene, plugin, x, y, children)\n {\n Container.call(this, scene, x, y, children);\n\n // Same as SpineGameObject, to prevent the renderer from mis-typing it when batching\n this.type = 'Spine';\n\n /**\n * A reference to the Spine Plugin.\n *\n * @name SpineContainer#plugin\n * @type {SpinePlugin}\n * @since 3.50.0\n */\n this.plugin = plugin;\n },\n\n /**\n * Internal destroy handler, called as part of the destroy process.\n *\n * @method SpineContainer#preDestroy\n * @protected\n * @since 3.50.0\n */\n preDestroy: function ()\n {\n this.removeAll(!!this.exclusive);\n\n this.localTransform.destroy();\n this.tempTransformMatrix.destroy();\n\n this.list = [];\n this._displayList = null;\n this.plugin = null;\n }\n\n});\n\nmodule.exports = SpineContainer;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Renders this Game Object with the Canvas Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method Phaser.GameObjects.Container#renderCanvas\n * @since 3.4.0\n * @private\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar SpineContainerCanvasRenderer = function (renderer, container, camera, parentMatrix)\n{\n var children = container.list;\n\n if (children.length === 0)\n {\n return;\n }\n\n var transformMatrix = container.localTransform;\n\n if (parentMatrix)\n {\n transformMatrix.loadIdentity();\n transformMatrix.multiply(parentMatrix);\n transformMatrix.translate(container.x, container.y);\n transformMatrix.rotate(container.rotation);\n transformMatrix.scale(container.scaleX, container.scaleY);\n }\n else\n {\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\n }\n\n var containerHasBlendMode = (container.blendMode !== -1);\n\n if (!containerHasBlendMode)\n {\n // If Container is SKIP_TEST then set blend mode to be Normal\n renderer.setBlendMode(0);\n }\n\n var alpha = container._alpha;\n var scrollFactorX = container.scrollFactorX;\n var scrollFactorY = container.scrollFactorY;\n\n if (container.mask)\n {\n container.mask.preRenderCanvas(renderer, null, camera);\n }\n\n for (var i = 0; i < children.length; i++)\n {\n var child = children[i];\n\n if (!child.willRender(camera))\n {\n continue;\n }\n\n var childAlpha = child.alpha;\n var childScrollFactorX = child.scrollFactorX;\n var childScrollFactorY = child.scrollFactorY;\n\n if (!containerHasBlendMode && child.blendMode !== renderer.currentBlendMode)\n {\n // If Container doesn't have its own blend mode, then a child can have one\n renderer.setBlendMode(child.blendMode);\n }\n\n // Set parent values\n child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY);\n child.setAlpha(childAlpha * alpha);\n\n // Render\n child.renderCanvas(renderer, child, camera, transformMatrix);\n\n // Restore original values\n child.setAlpha(childAlpha);\n child.setScrollFactor(childScrollFactorX, childScrollFactorY);\n }\n\n if (container.mask)\n {\n container.mask.postRenderCanvas(renderer);\n }\n};\n\nmodule.exports = SpineContainerCanvasRenderer;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\nvar renderWebGL = require('../../../../src/utils/NOOP');\nvar renderCanvas = require('../../../../src/utils/NOOP');\n\nif (typeof WEBGL_RENDERER)\n{\n renderWebGL = require('./SpineContainerWebGLRenderer');\n}\n\nif (typeof CANVAS_RENDERER)\n{\n renderCanvas = require('./SpineContainerCanvasRenderer');\n}\n\nmodule.exports = {\n\n renderWebGL: renderWebGL,\n renderCanvas: renderCanvas\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * Renders this Game Object with the WebGL Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method SpineContainerWebGLRenderer#renderWebGL\n * @since 3.50.0\n * @private\n *\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\n * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix)\n{\n var plugin = container.plugin;\n var sceneRenderer = plugin.sceneRenderer;\n var children = container.list;\n\n if (children.length === 0)\n {\n if (sceneRenderer.batcher.isDrawing && renderer.finalType)\n {\n sceneRenderer.end();\n\n renderer.pipelines.rebind();\n }\n\n return;\n }\n\n var transformMatrix = container.localTransform;\n\n if (parentMatrix)\n {\n transformMatrix.loadIdentity();\n transformMatrix.multiply(parentMatrix);\n transformMatrix.translate(container.x, container.y);\n transformMatrix.rotate(container.rotation);\n transformMatrix.scale(container.scaleX, container.scaleY);\n }\n else\n {\n transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY);\n }\n\n if (renderer.newType)\n {\n // flush + clear if this is a new type\n renderer.pipelines.clear();\n\n sceneRenderer.begin();\n }\n\n var rendererNextType = renderer.nextTypeMatch;\n\n // Force these to avoid batch flushing during SpineGameObject.renderWebGL\n renderer.nextTypeMatch = true;\n renderer.newType = false;\n\n for (var i = 0; i < children.length; i++)\n {\n var child = children[i];\n\n if (child.willRender(camera))\n {\n var mask = child.mask;\n\n if (mask)\n {\n sceneRenderer.end();\n\n renderer.pipelines.rebind();\n\n mask.preRenderWebGL(renderer, child, camera);\n\n renderer.pipelines.clear();\n\n sceneRenderer.begin();\n }\n\n child.renderWebGL(renderer, child, camera, transformMatrix, container);\n\n if (mask)\n {\n sceneRenderer.end();\n\n renderer.pipelines.rebind();\n\n mask.postRenderWebGL(renderer, camera);\n\n renderer.pipelines.clear();\n\n sceneRenderer.begin();\n }\n }\n }\n\n renderer.nextTypeMatch = rendererNextType;\n\n if (!rendererNextType)\n {\n // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch\n sceneRenderer.end();\n\n // And rebind the previous pipeline\n renderer.pipelines.rebind();\n }\n};\n\nmodule.exports = SpineContainerWebGLRenderer;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Complete Event.\n *\n * @event SpinePluginEvents#COMPLETE\n * @since 3.19.0\n */\nmodule.exports = 'complete';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Dispose Event.\n *\n * @event SpinePluginEvents#DISPOSE\n * @since 3.19.0\n */\nmodule.exports = 'dispose';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The End Event.\n *\n * @event SpinePluginEvents#END\n * @since 3.19.0\n */\nmodule.exports = 'end';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Custom Event Event.\n *\n * @event SpinePluginEvents#EVENT\n * @since 3.19.0\n */\nmodule.exports = 'event';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Interrupted Event.\n *\n * @event SpinePluginEvents#INTERRUPTED\n * @since 3.19.0\n */\nmodule.exports = 'interrupted';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * The Start Event.\n *\n * @event SpinePluginEvents#START\n * @since 3.19.0\n */\nmodule.exports = 'start';\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://opensource.org/licenses/MIT|MIT License}\n */\n\n/**\n * @namespace SpinePluginEvents\n */\n\nmodule.exports = {\n\n COMPLETE: require('./COMPLETE_EVENT'),\n DISPOSE: require('./DISPOSE_EVENT'),\n END: require('./END_EVENT'),\n EVENT: require('./EVENT_EVENT'),\n INTERRUPTED: require('./INTERRUPTED_EVENT'),\n START: require('./START_EVENT')\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar AngleBetween = require('../../../../src/math/angle/Between');\nvar Clamp = require('../../../../src/math/Clamp');\nvar Class = require('../../../../src/utils/Class');\nvar ComponentsComputedSize = require('../../../../src/gameobjects/components/ComputedSize');\nvar ComponentsDepth = require('../../../../src/gameobjects/components/Depth');\nvar ComponentsFlip = require('../../../../src/gameobjects/components/Flip');\nvar ComponentsScrollFactor = require('../../../../src/gameobjects/components/ScrollFactor');\nvar ComponentsTransform = require('../../../../src/gameobjects/components/Transform');\nvar ComponentsVisible = require('../../../../src/gameobjects/components/Visible');\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\nvar DegToRad = require('../../../../src/math/DegToRad');\nvar GameObject = require('../../../../src/gameobjects/GameObject');\nvar RadToDeg = require('../../../../src/math/RadToDeg');\nvar SpineEvents = require('../events/');\nvar SpineGameObjectRender = require('./SpineGameObjectRender');\n\n/**\n * @classdesc\n * A Spine Game Object is a Phaser level object that can be added to your Phaser Scenes. It encapsulates\n * a Spine Skeleton with Spine Animation Data and Animation State, with helper methods to allow you to\n * easily change the skin, slot attachment, bone positions and more.\n *\n * Spine Game Objects can be created via the Game Object Factory, Game Object Creator, or directly.\n * You can only create them if the Spine plugin has been loaded into Phaser.\n *\n * The quickest way is the Game Object Factory:\n *\n * ```javascript\n * let jelly = this.add.spine(512, 550, 'jelly', 'jelly-think', true);\n * ```\n *\n * Here we are creating a new Spine Game Object positioned at 512 x 550. It's using the `jelly`\n * Spine data, which has previously been loaded into your Scene. The `jelly-think` argument is\n * an optional animation to start playing on the skeleton. The final argument `true` sets the\n * animation to loop. Look at the documentation for further details on each of these options.\n *\n * For more control, you can use the Game Object Creator, passing in a Spine Game Object\n * Configuration object:\n *\n * ```javascript\n * let jelly = this.make.spine({\n * x: 512, y: 550, key: 'jelly',\n * scale: 1.5,\n * skinName: 'square_Green',\n * animationName: 'jelly-think', loop: true,\n * slotName: 'hat', attachmentName: 'images/La_14'\n * });\n * ```\n *\n * Here, you've got the ability to specify extra details, such as the slot name, attachments or\n * overall scale.\n *\n * If you wish to instantiate a Spine Game Object directly you can do so, but in order for it to\n * update and render, it must be added to the display and update lists of your Scene:\n *\n * ```javascript\n * let jelly = new SpineGameObject(this, this.spine, 512, 550, 'jelly', 'jelly-think', true);\n * this.sys.displayList.add(jelly);\n * this.sys.updateList.add(jelly);\n * ```\n *\n * It's possible to enable Spine Game Objects for input, but you should be aware that it will use\n * the bounds of the skeletons current pose to create the hit area from. Sometimes this is ok, but\n * often not. Make use of the `InputPlugin.enableDebug` method to view the input shape being created.\n * If it's not suitable, provide your own shape to the `setInteractive` method.\n *\n * Due to the way Spine handles scaling, it's not recommended to enable a Spine Game Object for\n * physics directly. Instead, you should look at creating a proxy body and syncing the Spine Game\n * Object position with it. See the examples for further details.\n *\n * If your Spine Game Object has black outlines around the different parts of the texture when it\n * renders then you have exported the files from Spine with pre-multiplied alpha enabled, but have\n * forgotten to set that flag when loading the Spine data. Please see the loader docs for more details.\n *\n * @class SpineGameObject\n * @constructor\n * @since 3.19.0\n *\n * @param {Phaser.Scene} scene - A reference to the Scene that this Game Object belongs to.\n * @param {SpinePlugin} pluginManager - A reference to the Phaser Spine Plugin.\n * @param {number} x - The horizontal position of this Game Object in the world.\n * @param {number} y - The vertical position of this Game Object in the world.\n * @param {string} [key] - The key of the Spine Skeleton this Game Object will use, as stored in the Spine Plugin.\n * @param {string} [animationName] - The name of the animation to set on this Skeleton.\n * @param {boolean} [loop=false] - Should the animation playback be looped or not?\n */\nvar SpineGameObject = new Class({\n\n Extends: GameObject,\n\n Mixins: [\n ComponentsComputedSize,\n ComponentsDepth,\n ComponentsFlip,\n ComponentsScrollFactor,\n ComponentsTransform,\n ComponentsVisible,\n SpineGameObjectRender\n ],\n\n initialize:\n\n function SpineGameObject (scene, plugin, x, y, key, animationName, loop)\n {\n GameObject.call(this, scene, 'Spine');\n\n /**\n * A reference to the Spine Plugin.\n *\n * @name SpineGameObject#plugin\n * @type {SpinePlugin}\n * @since 3.19.0\n */\n this.plugin = plugin;\n\n /**\n * The Spine Skeleton this Game Object is using.\n *\n * @name SpineGameObject#skeleton\n * @type {spine.Skeleton}\n * @since 3.19.0\n */\n this.skeleton = null;\n\n /**\n * The Spine Skeleton Data associated with the Skeleton this Game Object is using.\n *\n * @name SpineGameObject#skeletonData\n * @type {spine.SkeletonData}\n * @since 3.19.0\n */\n this.skeletonData = null;\n\n /**\n * The Spine Animation State this Game Object is using.\n *\n * @name SpineGameObject#state\n * @type {spine.AnimationState}\n * @since 3.19.0\n */\n this.state = null;\n\n /**\n * The Spine Animation State Data associated with the Animation State this Game Object is using.\n *\n * @name SpineGameObject#stateData\n * @type {spine.AnimationStateData}\n * @since 3.19.0\n */\n this.stateData = null;\n\n /**\n * A reference to the root bone of the Skeleton.\n *\n * @name SpineGameObject#root\n * @type {spine.Bone}\n * @since 3.19.0\n */\n this.root = null;\n\n /**\n * This object holds the calculated bounds of the current\n * pose, as set when a new Skeleton is applied.\n *\n * @name SpineGameObject#bounds\n * @type {any}\n * @since 3.19.0\n */\n this.bounds = null;\n\n /**\n * A Game Object level flag that allows you to enable debug drawing\n * to the Skeleton Debug Renderer by toggling it.\n *\n * @name SpineGameObject#drawDebug\n * @type {boolean}\n * @since 3.19.0\n */\n this.drawDebug = false;\n\n /**\n * The factor to scale the Animation update time by.\n *\n * @name SpineGameObject#timeScale\n * @type {number}\n * @since 3.19.0\n */\n this.timeScale = 1;\n\n /**\n * The calculated Display Origin of this Game Object.\n *\n * @name SpineGameObject#displayOriginX\n * @type {number}\n * @since 3.19.0\n */\n this.displayOriginX = 0;\n\n /**\n * The calculated Display Origin of this Game Object.\n *\n * @name SpineGameObject#displayOriginY\n * @type {number}\n * @since 3.19.0\n */\n this.displayOriginY = 0;\n\n /**\n * A flag that stores if the texture associated with the current\n * Skin being used by this Game Object, has its alpha pre-multiplied\n * into it, or not.\n *\n * @name SpineGameObject#preMultipliedAlpha\n * @type {boolean}\n * @since 3.19.0\n */\n this.preMultipliedAlpha = false;\n\n /**\n * A default Blend Mode. You cannot change the blend mode of a\n * Spine Game Object.\n *\n * @name SpineGameObject#blendMode\n * @type {number}\n * @readonly\n * @since 3.19.0\n */\n this.blendMode = -1;\n\n this.setPosition(x, y);\n\n if (key)\n {\n this.setSkeleton(key, animationName, loop);\n }\n },\n\n /**\n * Returns `true` if this Spine Game Object both has a skeleton and\n * also passes the render tests for the given Camera.\n *\n * @method SpineGameObject#willRender\n * @since 3.19.0\n *\n * @return {boolean} `true` if this Game Object should be rendered, otherwise `false`.\n */\n willRender: function (camera)\n {\n if (!this.skeleton)\n {\n return false;\n }\n\n var GameObjectRenderMask = 15;\n\n return !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));\n },\n\n /**\n * Set the Alpha level for the whole Skeleton of this Game Object.\n *\n * The alpha controls the opacity of the Game Object as it renders.\n *\n * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque.\n *\n * @method SpineGameObject#setAlpha\n * @since 3.19.0\n *\n * @param {number} [value=1] - The alpha value used for the whole Skeleton.\n *\n * @return {this} This Game Object instance.\n */\n setAlpha: function (value, slotName)\n {\n if (value === undefined) { value = 1; }\n\n if (slotName)\n {\n var slot = this.findSlot(slotName);\n\n if (slot)\n {\n slot.color.a = Clamp(value, 0, 1);\n }\n }\n else\n {\n this.alpha = value;\n }\n\n return this;\n },\n\n /**\n * The alpha value of the Skeleton.\n *\n * A value between 0 and 1.\n *\n * This is a global value, impacting the entire Skeleton, not just a region of it.\n *\n * @name SpineGameObject#alpha\n * @type {number}\n * @since 3.19.0\n */\n alpha: {\n\n get: function ()\n {\n return this.skeleton.color.a;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n if (this.skeleton)\n {\n this.skeleton.color.a = v;\n }\n\n if (v === 0)\n {\n this.renderFlags &= ~2;\n }\n else\n {\n this.renderFlags |= 2;\n }\n }\n\n },\n\n /**\n * The amount of red used when rendering the Skeleton.\n *\n * A value between 0 and 1.\n *\n * This is a global value, impacting the entire Skeleton, not just a region of it.\n *\n * @name SpineGameObject#red\n * @type {number}\n * @since 3.19.0\n */\n red: {\n\n get: function ()\n {\n return this.skeleton.color.r;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n if (this.skeleton)\n {\n this.skeleton.color.r = v;\n }\n }\n\n },\n\n /**\n * The amount of green used when rendering the Skeleton.\n *\n * A value between 0 and 1.\n *\n * This is a global value, impacting the entire Skeleton, not just a region of it.\n *\n * @name SpineGameObject#green\n * @type {number}\n * @since 3.19.0\n */\n green: {\n\n get: function ()\n {\n return this.skeleton.color.g;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n if (this.skeleton)\n {\n this.skeleton.color.g = v;\n }\n }\n\n },\n\n /**\n * The amount of blue used when rendering the Skeleton.\n *\n * A value between 0 and 1.\n *\n * This is a global value, impacting the entire Skeleton, not just a region of it.\n *\n * @name SpineGameObject#blue\n * @type {number}\n * @since 3.19.0\n */\n blue: {\n\n get: function ()\n {\n return this.skeleton.color.b;\n },\n\n set: function (value)\n {\n var v = Clamp(value, 0, 1);\n\n if (this.skeleton)\n {\n this.skeleton.color.b = v;\n }\n }\n\n },\n\n /**\n * Sets the color on the given attachment slot. Or, if no slot is given, on the whole skeleton.\n *\n * @method SpineGameObject#setColor\n * @since 3.19.0\n *\n * @param {integer} [color=0xffffff] - The color being applied to the Skeleton or named Slot. Set to white to disable any previously set color.\n * @param {string} [slotName] - The name of the slot to set the color on. If not give, will be set on the whole skeleton.\n *\n * @return {this} This Game Object instance.\n */\n setColor: function (color, slotName)\n {\n if (color === undefined) { color = 0xffffff; }\n\n var red = (color >> 16 & 0xFF) / 255;\n var green = (color >> 8 & 0xFF) / 255;\n var blue = (color & 0xFF) / 255;\n var alpha = (color > 16777215) ? (color >>> 24) / 255 : null;\n\n var target = this.skeleton;\n\n if (slotName)\n {\n var slot = this.findSlot(slotName);\n\n if (slot)\n {\n target = slot;\n }\n }\n\n target.color.r = red;\n target.color.g = green;\n target.color.b = blue;\n\n if (alpha !== null)\n {\n target.color.a = alpha;\n }\n\n return this;\n },\n\n /**\n * Sets this Game Object to use the given Skeleton based on the Atlas Data Key and a provided JSON object\n * that contains the Skeleton data.\n *\n * @method SpineGameObject#setSkeletonFromJSON\n * @since 3.19.0\n *\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\n *\n * @return {this} This Game Object.\n */\n setSkeletonFromJSON: function (atlasDataKey, skeletonJSON, animationName, loop)\n {\n return this.setSkeleton(atlasDataKey, skeletonJSON, animationName, loop);\n },\n\n /**\n * Sets this Game Object to use the given Skeleton based on its cache key.\n *\n * Typically, once set, the Skeleton doesn't change. Instead, you change the skin,\n * or slot attachment, or any other property to adjust it.\n *\n * @method SpineGameObject#setSkeleton\n * @since 3.19.0\n *\n * @param {string} atlasDataKey - The key of the Spine data to use for this Skeleton.\n * @param {object} skeletonJSON - The JSON data for the Skeleton.\n * @param {string} [animationName] - Optional name of the animation to set on the Skeleton.\n * @param {boolean} [loop=false] - Should the animation, if set, loop or not?\n *\n * @return {this} This Game Object.\n */\n setSkeleton: function (atlasDataKey, animationName, loop, skeletonJSON)\n {\n if (this.state)\n {\n this.state.clearListeners();\n this.state.clearListenerNotifications();\n }\n\n var data = this.plugin.createSkeleton(atlasDataKey, skeletonJSON);\n\n this.skeletonData = data.skeletonData;\n\n this.preMultipliedAlpha = data.preMultipliedAlpha;\n\n var skeleton = data.skeleton;\n\n skeleton.setSkin();\n skeleton.setToSetupPose();\n\n this.skeleton = skeleton;\n\n // AnimationState\n data = this.plugin.createAnimationState(skeleton);\n\n if (this.state)\n {\n this.state.clearListeners();\n this.state.clearListenerNotifications();\n }\n\n this.state = data.state;\n this.stateData = data.stateData;\n\n this.state.addListener({\n event: this.onEvent.bind(this),\n complete: this.onComplete.bind(this),\n start: this.onStart.bind(this),\n end: this.onEnd.bind(this),\n dispose: this.onDispose.bind(this),\n interrupted: this.onInterrupted.bind(this)\n });\n\n if (animationName)\n {\n this.setAnimation(0, animationName, loop);\n }\n\n this.root = this.getRootBone();\n\n if (this.root)\n {\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\n }\n\n this.state.apply(skeleton);\n\n skeleton.updateCache();\n\n return this.updateSize();\n },\n\n /**\n * Internal event handler that emits the Spine onComplete event via this Game Object.\n *\n * @method SpineGameObject#onComplete\n * @fires SpinePluginEvents#COMPLETE\n * @private\n * @since 3.19.0\n *\n * @param {any} entry - The event data from Spine.\n */\n onComplete: function (entry)\n {\n this.emit(SpineEvents.COMPLETE, entry);\n },\n\n /**\n * Internal event handler that emits the Spine onDispose event via this Game Object.\n *\n * @method SpineGameObject#onDispose\n * @fires SpinePluginEvents#DISPOSE\n * @private\n * @since 3.19.0\n *\n * @param {any} entry - The event data from Spine.\n */\n onDispose: function (entry)\n {\n this.emit(SpineEvents.DISPOSE, entry);\n },\n\n /**\n * Internal event handler that emits the Spine onEnd event via this Game Object.\n *\n * @method SpineGameObject#onEnd\n * @fires SpinePluginEvents#END\n * @private\n * @since 3.19.0\n *\n * @param {any} entry - The event data from Spine.\n */\n onEnd: function (entry)\n {\n this.emit(SpineEvents.END, entry);\n },\n\n /**\n * Internal event handler that emits the Spine Event event via this Game Object.\n *\n * @method SpineGameObject#onEvent\n * @fires SpinePluginEvents#EVENT\n * @private\n * @since 3.19.0\n *\n * @param {any} entry - The event data from Spine.\n * @param {spine.Event} event - The Spine event.\n */\n onEvent: function (entry, event)\n {\n this.emit(SpineEvents.EVENT, entry, event);\n },\n\n /**\n * Internal event handler that emits the Spine onInterrupted event via this Game Object.\n *\n * @method SpineGameObject#onInterrupted\n * @fires SpinePluginEvents#INTERRUPTED\n * @private\n * @since 3.19.0\n *\n * @param {any} entry - The event data from Spine.\n */\n onInterrupted: function (entry)\n {\n this.emit(SpineEvents.INTERRUPTED, entry);\n },\n\n /**\n * Internal event handler that emits the Spine onStart event via this Game Object.\n *\n * @method SpineGameObject#onStart\n * @fires SpinePluginEvents#START\n * @private\n * @since 3.19.0\n *\n * @param {any} entry - The event data from Spine.\n */\n onStart: function (entry)\n {\n this.emit(SpineEvents.START, entry);\n },\n\n /**\n * Refreshes the data about the current Skeleton.\n *\n * This will reset the rotation, position and size of the Skeleton to match this Game Object.\n *\n * Call this method if you need to access the Skeleton data directly, and it may have changed\n * recently.\n *\n * @method SpineGameObject#refresh\n * @since 3.19.0\n *\n * @return {this} This Game Object.\n */\n refresh: function ()\n {\n if (this.root)\n {\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\n this.root.rotation = RadToDeg(CounterClockwise(this.rotation)) + 90;\n }\n\n this.updateSize();\n\n this.skeleton.updateCache();\n\n return this;\n },\n\n /**\n * Sets the size of this Game Object.\n *\n * If no arguments are given it uses the current skeleton data dimensions.\n *\n * You can use this method to set a fixed size of this Game Object, such as for input detection,\n * when the skeleton data doesn't match what is required in-game.\n *\n * @method SpineGameObject#setSize\n * @since 3.19.0\n *\n * @param {number} [width] - The width of the Skeleton. If not given it defaults to the Skeleton Data width.\n * @param {number} [height] - The height of the Skeleton. If not given it defaults to the Skeleton Data height.\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\n *\n * @return {this} This Game Object.\n */\n setSize: function (width, height, offsetX, offsetY)\n {\n var skeleton = this.skeleton;\n\n if (width === undefined) { width = skeleton.data.width; }\n if (height === undefined) { height = skeleton.data.height; }\n if (offsetX === undefined) { offsetX = 0; }\n if (offsetY === undefined) { offsetY = 0; }\n\n this.width = width;\n this.height = height;\n\n this.displayOriginX = skeleton.x - offsetX;\n this.displayOriginY = skeleton.y - offsetY;\n\n return this;\n },\n\n /**\n * Sets the offset of this Game Object from the Skeleton position.\n *\n * You can use this method to adjust how the position of this Game Object relates to the Skeleton it is using.\n *\n * @method SpineGameObject#setOffset\n * @since 3.19.0\n *\n * @param {number} [offsetX=0] - The horizontal offset of the Skeleton from its x and y coordinate.\n * @param {number} [offsetY=0] - The vertical offset of the Skeleton from its x and y coordinate.\n *\n * @return {this} This Game Object.\n */\n setOffset: function (offsetX, offsetY)\n {\n var skeleton = this.skeleton;\n\n if (offsetX === undefined) { offsetX = 0; }\n if (offsetY === undefined) { offsetY = 0; }\n\n this.displayOriginX = skeleton.x - offsetX;\n this.displayOriginY = skeleton.y - offsetY;\n\n return this;\n },\n\n /**\n * Internal method that syncs all of the Game Object position and scale data to the Skeleton.\n * It then syncs the skeleton bounds back to this Game Object.\n *\n * This method is called automatically as needed internally, however, it's also exposed should\n * you require overriding the size settings.\n *\n * @method SpineGameObject#updateSize\n * @since 3.19.0\n *\n * @return {this} This Game Object.\n */\n updateSize: function ()\n {\n var skeleton = this.skeleton;\n var renderer = this.plugin.renderer;\n\n var height = renderer.height;\n\n var oldScaleX = this.scaleX;\n var oldScaleY = this.scaleY;\n\n skeleton.x = this.x;\n skeleton.y = height - this.y;\n skeleton.scaleX = 1;\n skeleton.scaleY = 1;\n\n skeleton.updateWorldTransform();\n\n var bounds = this.getBounds();\n\n this.width = bounds.size.x;\n this.height = bounds.size.y;\n\n this.displayOriginX = this.x - bounds.offset.x;\n this.displayOriginY = this.y - (height - (this.height + bounds.offset.y));\n\n skeleton.scaleX = oldScaleX;\n skeleton.scaleY = oldScaleY;\n\n skeleton.updateWorldTransform();\n\n return this;\n },\n\n /**\n * The horizontal scale of this Game Object, as applied to the Skeleton it is using.\n *\n * @name SpineGameObject#scaleX\n * @type {number}\n * @default 1\n * @since 3.19.0\n */\n scaleX: {\n\n get: function ()\n {\n return this._scaleX;\n },\n\n set: function (value)\n {\n this._scaleX = value;\n\n this.refresh();\n }\n\n },\n\n /**\n * The vertical scale of this Game Object, as applied to the Skeleton it is using.\n *\n * @name SpineGameObject#scaleY\n * @type {number}\n * @default 1\n * @since 3.19.0\n */\n scaleY: {\n\n get: function ()\n {\n return this._scaleY;\n },\n\n set: function (value)\n {\n this._scaleY = value;\n\n this.refresh();\n }\n\n },\n\n /**\n * Returns an array containing the names of all the bones in the Skeleton Data.\n *\n * @method SpineGameObject#getBoneList\n * @since 3.19.0\n *\n * @return {string[]} An array containing the names of all the bones in the Skeleton Data.\n */\n getBoneList: function ()\n {\n var output = [];\n\n var skeletonData = this.skeletonData;\n\n if (skeletonData)\n {\n for (var i = 0; i < skeletonData.bones.length; i++)\n {\n output.push(skeletonData.bones[i].name);\n }\n }\n\n return output;\n },\n\n /**\n * Returns an array containing the names of all the skins in the Skeleton Data.\n *\n * @method SpineGameObject#getSkinList\n * @since 3.19.0\n *\n * @return {string[]} An array containing the names of all the skins in the Skeleton Data.\n */\n getSkinList: function ()\n {\n var output = [];\n\n var skeletonData = this.skeletonData;\n\n if (skeletonData)\n {\n for (var i = 0; i < skeletonData.skins.length; i++)\n {\n output.push(skeletonData.skins[i].name);\n }\n }\n\n return output;\n },\n\n /**\n * Returns an array containing the names of all the slots in the Skeleton.\n *\n * @method SpineGameObject#getSlotList\n * @since 3.19.0\n *\n * @return {string[]} An array containing the names of all the slots in the Skeleton.\n */\n getSlotList: function ()\n {\n var output = [];\n\n var skeleton = this.skeleton;\n\n for (var i = 0; i < skeleton.slots.length; i++)\n {\n output.push(skeleton.slots[i].data.name);\n }\n\n return output;\n },\n\n /**\n * Returns an array containing the names of all the animations in the Skeleton Data.\n *\n * @method SpineGameObject#getAnimationList\n * @since 3.19.0\n *\n * @return {string[]} An array containing the names of all the animations in the Skeleton Data.\n */\n getAnimationList: function ()\n {\n var output = [];\n\n var skeletonData = this.skeletonData;\n\n if (skeletonData)\n {\n for (var i = 0; i < skeletonData.animations.length; i++)\n {\n output.push(skeletonData.animations[i].name);\n }\n }\n\n return output;\n },\n\n /**\n * Returns the current animation being played on the given track, if any.\n *\n * @method SpineGameObject#getCurrentAnimation\n * @since 3.19.0\n *\n * @param {integer} [trackIndex=0] - The track to return the current animation on.\n *\n * @return {?spine.Animation} The current Animation on the given track, or `undefined` if there is no current animation.\n */\n getCurrentAnimation: function (trackIndex)\n {\n if (trackIndex === undefined) { trackIndex = 0; }\n\n var current = this.state.getCurrent(trackIndex);\n\n if (current)\n {\n return current.animation;\n }\n },\n\n /**\n * Sets the current animation for a track, discarding any queued animations.\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\n *\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\n *\n * @method SpineGameObject#play\n * @fires SpinePluginEvents#START\n * @since 3.19.0\n *\n * @param {string} animationName - The string-based key of the animation to play.\n * @param {boolean} [loop=false] - Should the animation be looped when played?\n * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call.\n *\n * @return {this} This Game Object. If you need the TrackEntry, see `setAnimation` instead.\n */\n play: function (animationName, loop, ignoreIfPlaying)\n {\n this.setAnimation(0, animationName, loop, ignoreIfPlaying);\n\n return this;\n },\n\n /**\n * Sets the current animation for a track, discarding any queued animations.\n * If the formerly current track entry was never applied to a skeleton, it is replaced (not mixed from).\n *\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\n *\n * @method SpineGameObject#setAnimation\n * @fires SpinePluginEvents#START\n * @since 3.19.0\n *\n * @param {integer} trackIndex - The track index to play the animation on.\n * @param {string} animationName - The string-based key of the animation to play.\n * @param {boolean} [loop=false] - Should the animation be looped when played?\n * @param {boolean} [ignoreIfPlaying=false] - If the animation specified by the track index is already playing then ignore this call.\n *\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\n */\n setAnimation: function (trackIndex, animationName, loop, ignoreIfPlaying)\n {\n if (loop === undefined) { loop = false; }\n if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; }\n\n if (ignoreIfPlaying && this.state)\n {\n var currentTrack = this.state.getCurrent(trackIndex);\n\n if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete())\n {\n return;\n }\n }\n\n if (this.findAnimation(animationName))\n {\n return this.state.setAnimation(trackIndex, animationName, loop);\n }\n },\n\n /**\n * Adds an animation to be played after the current or last queued animation for a track.\n * If the track is empty, it is equivalent to calling setAnimation.\n *\n * Animations are referenced by a unique string-based key, as defined in the Spine software.\n *\n * The delay is a float. If > 0, sets delay. If <= 0, the delay set is the duration of the previous\n * track entry minus any mix duration (from the AnimationStateData) plus the specified delay\n * (ie the mix ends at (delay = 0) or before (delay < 0) the previous track entry duration).\n * If the previous entry is looping, its next loop completion is used instead of its duration.\n *\n * @method SpineGameObject#addAnimation\n * @since 3.19.0\n *\n * @param {integer} trackIndex - The track index to add the animation to.\n * @param {string} animationName - The string-based key of the animation to add.\n * @param {boolean} [loop=false] - Should the animation be looped when played?\n * @param {integer} [delay=0] - A delay, in ms, before which this animation will start when played.\n *\n * @return {spine.TrackEntry} A track entry to allow further customization of animation playback.\n */\n addAnimation: function (trackIndex, animationName, loop, delay)\n {\n if (loop === undefined) { loop = false; }\n if (delay === undefined) { delay = 0; }\n\n return this.state.addAnimation(trackIndex, animationName, loop, delay);\n },\n\n /**\n * Sets an empty animation for a track, discarding any queued animations, and sets the track\n * entry's mixDuration. An empty animation has no timelines and serves as a placeholder for mixing in or out.\n *\n * Mixing out is done by setting an empty animation with a mix duration using either setEmptyAnimation,\n * setEmptyAnimations, or addEmptyAnimation. Mixing to an empty animation causes the previous animation to be\n * applied less and less over the mix duration. Properties keyed in the previous animation transition to\n * the value from lower tracks or to the setup pose value if no lower tracks key the property.\n * A mix duration of 0 still mixes out over one frame.\n *\n * Mixing in is done by first setting an empty animation, then adding an animation using addAnimation\n * and on the returned track entry, set the mixDuration. Mixing from an empty animation causes the new\n * animation to be applied more and more over the mix duration. Properties keyed in the new animation\n * transition from the value from lower tracks or from the setup pose value if no lower tracks key the\n * property to the value keyed in the new animation.\n *\n * @method SpineGameObject#setEmptyAnimation\n * @since 3.19.0\n *\n * @param {integer} trackIndex - The track index to add the animation to.\n * @param {integer} [mixDuration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\n *\n * @return {spine.TrackEntry} The returned Track Entry.\n */\n setEmptyAnimation: function (trackIndex, mixDuration)\n {\n return this.state.setEmptyAnimation(trackIndex, mixDuration);\n },\n\n /**\n * Removes all animations from the track, leaving skeletons in their current pose.\n *\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\n * rather than leaving them in their current pose.\n *\n * @method SpineGameObject#clearTrack\n * @since 3.19.0\n *\n * @param {integer} trackIndex - The track index to add the animation to.\n *\n * @return {this} This Game Object.\n */\n clearTrack: function (trackIndex)\n {\n this.state.clearTrack(trackIndex);\n\n return this;\n },\n\n /**\n * Removes all animations from all tracks, leaving skeletons in their current pose.\n *\n * It may be desired to use setEmptyAnimation to mix the skeletons back to the setup pose,\n * rather than leaving them in their current pose.\n *\n * @method SpineGameObject#clearTracks\n * @since 3.19.0\n *\n * @return {this} This Game Object.\n */\n clearTracks: function ()\n {\n this.state.clearTracks();\n\n return this;\n },\n\n /**\n * Sets the skin used to look up attachments before looking in the defaultSkin.\n *\n * Attachments from the new skin are attached if the corresponding attachment from the\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\n * attached from the new skin.\n *\n * After changing the skin, the visible attachments can be reset to those attached in the\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\n * or show attachments from the new skin.\n *\n * @method SpineGameObject#setSkinByName\n * @since 3.19.0\n *\n * @param {string} skinName - The name of the skin to set.\n *\n * @return {this} This Game Object.\n */\n setSkinByName: function (skinName)\n {\n var skeleton = this.skeleton;\n\n skeleton.setSkinByName(skinName);\n\n skeleton.setSlotsToSetupPose();\n\n this.state.apply(skeleton);\n\n return this;\n },\n\n /**\n * Sets the skin used to look up attachments before looking in the defaultSkin.\n *\n * Attachments from the new skin are attached if the corresponding attachment from the\n * old skin was attached. If there was no old skin, each slot's setup mode attachment is\n * attached from the new skin.\n *\n * After changing the skin, the visible attachments can be reset to those attached in the\n * setup pose by calling setSlotsToSetupPose. Also, often apply is called before the next time\n * the skeleton is rendered to allow any attachment keys in the current animation(s) to hide\n * or show attachments from the new skin.\n *\n * @method SpineGameObject#setSkin\n * @since 3.19.0\n *\n * @param {?spine.Skin} newSkin - The Skin to set. May be `null`.\n *\n * @return {this} This Game Object.\n */\n setSkin: function (newSkin)\n {\n var skeleton = this.skeleton;\n\n skeleton.setSkin(newSkin);\n\n skeleton.setSlotsToSetupPose();\n\n this.state.apply(skeleton);\n\n return this;\n },\n\n /**\n * Sets the mix duration when changing from the specified animation to the other.\n *\n * @method SpineGameObject#setMix\n * @since 3.19.0\n *\n * @param {string} fromName - The animation to mix from.\n * @param {string} toName - The animation to mix to.\n * @param {number} [duration] - Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData getMix based on the animation before this animation (if any).\n *\n * @return {this} This Game Object.\n */\n setMix: function (fromName, toName, duration)\n {\n this.stateData.setMix(fromName, toName, duration);\n\n return this;\n },\n\n /**\n * Finds an attachment by looking in the skin and defaultSkin using the slot\n * index and attachment name. First the skin is checked and if the attachment was not found,\n * the default skin is checked.\n *\n * @method SpineGameObject#getAttachment\n * @since 3.19.0\n *\n * @param {integer} slotIndex - The slot index to search.\n * @param {string} attachmentName - The attachment name to look for.\n *\n * @return {?spine.Attachment} The Attachment, if found. May be null.\n */\n getAttachment: function (slotIndex, attachmentName)\n {\n return this.skeleton.getAttachment(slotIndex, attachmentName);\n },\n\n /**\n * Finds an attachment by looking in the skin and defaultSkin using the slot name and attachment name.\n *\n * @method SpineGameObject#getAttachmentByName\n * @since 3.19.0\n *\n * @param {string} slotName - The slot name to search.\n * @param {string} attachmentName - The attachment name to look for.\n *\n * @return {?spine.Attachment} The Attachment, if found. May be null.\n */\n getAttachmentByName: function (slotName, attachmentName)\n {\n return this.skeleton.getAttachmentByName(slotName, attachmentName);\n },\n\n /**\n * A convenience method to set an attachment by finding the slot with findSlot,\n * finding the attachment with getAttachment, then setting the slot's attachment.\n *\n * @method SpineGameObject#setAttachment\n * @since 3.19.0\n *\n * @param {string} slotName - The slot name to add the attachment to.\n * @param {string} attachmentName - The attachment name to add.\n *\n * @return {this} This Game Object.\n */\n setAttachment: function (slotName, attachmentName)\n {\n if (Array.isArray(slotName) && Array.isArray(attachmentName) && slotName.length === attachmentName.length)\n {\n for (var i = 0; i < slotName.length; i++)\n {\n this.skeleton.setAttachment(slotName[i], attachmentName[i]);\n }\n }\n else\n {\n this.skeleton.setAttachment(slotName, attachmentName);\n }\n\n return this;\n },\n\n /**\n * Sets the bones, constraints, slots, and draw order to their setup pose values.\n *\n * @method SpineGameObject#setToSetupPose\n * @since 3.19.0\n *\n * @return {this} This Game Object.\n */\n setToSetupPose: function ()\n {\n this.skeleton.setToSetupPose();\n\n return this;\n },\n\n /**\n * Sets the slots and draw order to their setup pose values.\n *\n * @method SpineGameObject#setSlotsToSetupPose\n * @since 3.19.0\n *\n * @return {this} This Game Object.\n */\n setSlotsToSetupPose: function ()\n {\n this.skeleton.setSlotsToSetupPose();\n\n return this;\n },\n\n /**\n * Sets the bones and constraints to their setup pose values.\n *\n * @method SpineGameObject#setBonesToSetupPose\n * @since 3.19.0\n *\n * @return {this} This Game Object.\n */\n setBonesToSetupPose: function ()\n {\n this.skeleton.setBonesToSetupPose();\n\n return this;\n },\n\n /**\n * Gets the root bone, or null.\n *\n * @method SpineGameObject#getRootBone\n * @since 3.19.0\n *\n * @return {spine.Bone} The root bone, or null.\n */\n getRootBone: function ()\n {\n return this.skeleton.getRootBone();\n },\n\n /**\n * Takes a Bone object and a position in world space and rotates the Bone so it is angled\n * towards the given position. You can set an optional angle offset, should the bone be\n * designed at a specific angle already. You can also set a minimum and maximum range for the angle.\n *\n * @method SpineGameObject#angleBoneToXY\n * @since 3.19.0\n *\n * @param {spine.Bone} bone - The bone to rotate towards the world position.\n * @param {number} worldX - The world x coordinate to rotate the bone towards.\n * @param {number} worldY - The world y coordinate to rotate the bone towards.\n * @param {number} [offset=0] - An offset to add to the rotation angle.\n * @param {number} [minAngle=0] - The minimum range of the rotation angle.\n * @param {number} [maxAngle=360] - The maximum range of the rotation angle.\n *\n * @return {this} This Game Object.\n */\n angleBoneToXY: function (bone, worldX, worldY, offset, minAngle, maxAngle)\n {\n if (offset === undefined) { offset = 0; }\n if (minAngle === undefined) { minAngle = 0; }\n if (maxAngle === undefined) { maxAngle = 360; }\n\n var renderer = this.plugin.renderer;\n var height = renderer.height;\n\n var angle = CounterClockwise(AngleBetween(bone.worldX, height - bone.worldY, worldX, worldY) + DegToRad(offset));\n\n bone.rotation = Clamp(RadToDeg(angle), minAngle, maxAngle);\n\n return this;\n },\n\n /**\n * Finds a bone by comparing each bone's name. It is more efficient to cache the results\n * of this method than to call it multiple times.\n *\n * @method SpineGameObject#findBone\n * @since 3.19.0\n *\n * @param {string} boneName - The name of the bone to find.\n *\n * @return {spine.Bone} The bone, or null.\n */\n findBone: function (boneName)\n {\n return this.skeleton.findBone(boneName);\n },\n\n /**\n * Finds the index of a bone by comparing each bone's name. It is more efficient to cache the results\n * of this method than to call it multiple times.\n *\n * @method SpineGameObject#findBoneIndex\n * @since 3.19.0\n *\n * @param {string} boneName - The name of the bone to find.\n *\n * @return {integer} The bone index. Or -1 if the bone was not found.\n */\n findBoneIndex: function (boneName)\n {\n return this.skeleton.findBoneIndex(boneName);\n },\n\n /**\n * Finds a slot by comparing each slot's name. It is more efficient to cache the results\n * of this method than to call it multiple times.\n *\n * @method SpineGameObject#findSlot\n * @since 3.19.0\n *\n * @param {string} slotName - The name of the slot to find.\n *\n * @return {spine.Slot} The Slot. May be null.\n */\n findSlot: function (slotName)\n {\n return this.skeleton.findSlot(slotName);\n },\n\n /**\n * Finds the index of a slot by comparing each slot's name. It is more efficient to cache the results\n * of this method than to call it multiple times.\n *\n * @method SpineGameObject#findSlotIndex\n * @since 3.19.0\n *\n * @param {string} slotName - The name of the slot to find.\n *\n * @return {integer} The slot index. Or -1 if the Slot was not found.\n */\n findSlotIndex: function (slotName)\n {\n return this.skeleton.findSlotIndex(slotName);\n },\n\n /**\n * Finds a skin by comparing each skin's name. It is more efficient to cache the results of\n * this method than to call it multiple times.\n *\n * @method SpineGameObject#findSkin\n * @since 3.19.0\n *\n * @param {string} skinName - The name of the skin to find.\n *\n * @return {spine.Skin} The Skin. May be null.\n */\n findSkin: function (skinName)\n {\n return this.skeletonData.findSkin(skinName);\n },\n\n /**\n * Finds an event by comparing each events's name. It is more efficient to cache the results\n * of this method than to call it multiple times.\n *\n * @method SpineGameObject#findEvent\n * @since 3.19.0\n *\n * @param {string} eventDataName - The name of the event to find.\n *\n * @return {spine.EventData} The Event Data. May be null.\n */\n findEvent: function (eventDataName)\n {\n return this.skeletonData.findEvent(eventDataName);\n },\n\n /**\n * Finds an animation by comparing each animation's name. It is more efficient to cache the results\n * of this method than to call it multiple times.\n *\n * @method SpineGameObject#findAnimation\n * @since 3.19.0\n *\n * @param {string} animationName - The name of the animation to find.\n *\n * @return {spine.Animation} The Animation. May be null.\n */\n findAnimation: function (animationName)\n {\n return this.skeletonData.findAnimation(animationName);\n },\n\n /**\n * Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results\n * of this method than to call it multiple times.\n *\n * @method SpineGameObject#findIkConstraint\n * @since 3.19.0\n *\n * @param {string} constraintName - The name of the constraint to find.\n *\n * @return {spine.IkConstraintData} The IK constraint. May be null.\n */\n findIkConstraint: function (constraintName)\n {\n return this.skeletonData.findIkConstraint(constraintName);\n },\n\n /**\n * Finds an transform constraint by comparing each transform constraint's name.\n * It is more efficient to cache the results of this method than to call it multiple times.\n *\n * @method SpineGameObject#findTransformConstraint\n * @since 3.19.0\n *\n * @param {string} constraintName - The name of the constraint to find.\n *\n * @return {spine.TransformConstraintData} The transform constraint. May be null.\n */\n findTransformConstraint: function (constraintName)\n {\n return this.skeletonData.findTransformConstraint(constraintName);\n },\n\n /**\n * Finds a path constraint by comparing each path constraint's name.\n * It is more efficient to cache the results of this method than to call it multiple times.\n *\n * @method SpineGameObject#findPathConstraint\n * @since 3.19.0\n *\n * @param {string} constraintName - The name of the constraint to find.\n *\n * @return {spine.PathConstraintData} The path constraint. May be null.\n */\n findPathConstraint: function (constraintName)\n {\n return this.skeletonData.findPathConstraint(constraintName);\n },\n\n /**\n * Finds the index of a path constraint by comparing each path constraint's name.\n * It is more efficient to cache the results of this method than to call it multiple times.\n *\n * @method SpineGameObject#findPathConstraintIndex\n * @since 3.19.0\n *\n * @param {string} constraintName - The name of the constraint to find.\n *\n * @return {integer} The constraint index. Or -1 if the constraint was not found.\n */\n findPathConstraintIndex: function (constraintName)\n {\n return this.skeletonData.findPathConstraintIndex(constraintName);\n },\n\n /**\n * Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n *\n * The returned object contains two properties: `offset` and `size`:\n *\n * `offset` - The distance from the skeleton origin to the bottom left corner of the AABB.\n * `size` - The width and height of the AABB.\n *\n * @method SpineGameObject#getBounds\n * @since 3.19.0\n *\n * @return {any} The bounds object.\n */\n getBounds: function ()\n {\n return this.plugin.getBounds(this.skeleton);\n },\n\n /**\n * Internal update handler.\n *\n * @method SpineGameObject#preUpdate\n * @protected\n * @since 3.19.0\n *\n * @param {number} time - The current timestamp.\n * @param {number} delta - The delta time, in ms, elapsed since the last frame.\n */\n preUpdate: function (time, delta)\n {\n var skeleton = this.skeleton;\n\n this.state.update((delta / 1000) * this.timeScale);\n\n this.state.apply(skeleton);\n },\n\n /**\n * Internal destroy handler, called as part of the destroy process.\n *\n * @method SpineGameObject#preDestroy\n * @protected\n * @since 3.19.0\n */\n preDestroy: function ()\n {\n if (this.state)\n {\n this.state.clearListeners();\n this.state.clearListenerNotifications();\n }\n\n this.plugin = null;\n\n this.skeleton = null;\n this.skeletonData = null;\n\n this.state = null;\n this.stateData = null;\n }\n\n});\n\nmodule.exports = SpineGameObject;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\nvar RadToDeg = require('../../../../src/math/RadToDeg');\nvar Wrap = require('../../../../src/math/Wrap');\n\n/**\n * Renders this Game Object with the Canvas Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method SpineGameObject#renderCanvas\n * @since 3.19.0\n * @private\n *\n * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer.\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar SpineGameObjectCanvasRenderer = function (renderer, src, camera, parentMatrix)\n{\n var context = renderer.currentContext;\n\n var plugin = src.plugin;\n var skeleton = src.skeleton;\n var skeletonRenderer = plugin.skeletonRenderer;\n\n var camMatrix = renderer._tempMatrix1;\n var spriteMatrix = renderer._tempMatrix2;\n var calcMatrix = renderer._tempMatrix3;\n\n spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY));\n\n camMatrix.copyFrom(camera.matrix);\n\n if (parentMatrix)\n {\n // Multiply the camera by the parent matrix\n camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY);\n\n // Undo the camera scroll\n spriteMatrix.e = src.x;\n spriteMatrix.f = src.y;\n\n // Multiply by the Sprite matrix, store result in calcMatrix\n camMatrix.multiply(spriteMatrix, calcMatrix);\n }\n else\n {\n spriteMatrix.e -= camera.scrollX * src.scrollFactorX;\n spriteMatrix.f -= camera.scrollY * src.scrollFactorY;\n\n // Multiply by the Sprite matrix, store result in calcMatrix\n camMatrix.multiply(spriteMatrix, calcMatrix);\n }\n\n skeleton.x = calcMatrix.tx;\n skeleton.y = calcMatrix.ty;\n\n skeleton.scaleX = calcMatrix.scaleX;\n\n // Inverse or we get upside-down skeletons\n skeleton.scaleY = calcMatrix.scaleY * -1;\n\n if (src.scaleX < 0)\n {\n skeleton.scaleX *= -1;\n\n src.root.rotation = RadToDeg(calcMatrix.rotationNormalized);\n }\n else\n {\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\n }\n\n if (src.scaleY < 0)\n {\n skeleton.scaleY *= -1;\n\n if (src.scaleX < 0)\n {\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\n }\n else\n {\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\n }\n }\n\n if (camera.renderToTexture)\n {\n skeleton.y = calcMatrix.ty;\n skeleton.scaleY *= -1;\n }\n\n skeleton.updateWorldTransform();\n\n skeletonRenderer.ctx = context;\n skeletonRenderer.debugRendering = (plugin.drawDebug || src.drawDebug);\n\n context.save();\n\n skeletonRenderer.draw(skeleton);\n\n context.restore();\n};\n\nmodule.exports = SpineGameObjectCanvasRenderer;\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar renderWebGL = require('../../../../src/utils/NOOP');\nvar renderCanvas = require('../../../../src/utils/NOOP');\n\nif (typeof WEBGL_RENDERER)\n{\n renderWebGL = require('./SpineGameObjectWebGLRenderer');\n}\n\nif (typeof CANVAS_RENDERER)\n{\n renderCanvas = require('./SpineGameObjectCanvasRenderer');\n}\n\nmodule.exports = {\n\n renderWebGL: renderWebGL,\n renderCanvas: renderCanvas\n\n};\n","/**\n * @author Richard Davey \n * @copyright 2020 Photon Storm Ltd.\n * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n */\n\nvar Clamp = require('../../../../src/math/Clamp');\nvar CounterClockwise = require('../../../../src/math/angle/CounterClockwise');\nvar GetCalcMatrix = require('../../../../src/gameobjects/GetCalcMatrix');\nvar RadToDeg = require('../../../../src/math/RadToDeg');\nvar Wrap = require('../../../../src/math/Wrap');\n\n/**\n * Renders this Game Object with the WebGL Renderer to the given Camera.\n * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera.\n * This method should not be called directly. It is a utility function of the Render module.\n *\n * @method SpineGameObject#renderWebGL\n * @since 3.19.0\n * @private\n *\n * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer.\n * @param {SpineGameObject} src - The Game Object being rendered in this call.\n * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.\n * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested\n */\nvar SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container)\n{\n var plugin = src.plugin;\n var skeleton = src.skeleton;\n var sceneRenderer = plugin.sceneRenderer;\n\n if (renderer.newType)\n {\n // flush + clear previous pipeline if this is a new type\n renderer.pipelines.clear();\n\n sceneRenderer.begin();\n }\n\n var scrollFactorX = src.scrollFactorX;\n var scrollFactorY = src.scrollFactorY;\n var alpha = skeleton.color.a;\n\n if (container)\n {\n src.scrollFactorX = container.scrollFactorX;\n src.scrollFactorY = container.scrollFactorY;\n\n skeleton.color.a = Clamp(alpha * container.alpha, 0, 1);\n }\n\n var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc;\n\n var viewportHeight = renderer.height;\n\n skeleton.x = calcMatrix.tx;\n skeleton.y = viewportHeight - calcMatrix.ty;\n\n skeleton.scaleX = calcMatrix.scaleX;\n skeleton.scaleY = calcMatrix.scaleY;\n\n if (src.scaleX < 0)\n {\n skeleton.scaleX *= -1;\n\n // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled\n src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360);\n }\n else\n {\n // +90 degrees to account for the difference in Spine vs. Phaser rotation\n src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360);\n }\n\n if (src.scaleY < 0)\n {\n skeleton.scaleY *= -1;\n\n if (src.scaleX < 0)\n {\n src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2);\n }\n else\n {\n src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2);\n }\n }\n\n if (camera.renderToTexture || renderer.currentFramebuffer !== null)\n {\n skeleton.y = calcMatrix.ty;\n skeleton.scaleY *= -1;\n }\n\n skeleton.updateWorldTransform();\n\n // Draw the current skeleton\n sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha);\n\n if (container)\n {\n src.scrollFactorX = scrollFactorX;\n src.scrollFactorY = scrollFactorY;\n skeleton.color.a = alpha;\n }\n\n if (plugin.drawDebug || src.drawDebug)\n {\n // Because if we don't, the bones render positions are completely wrong (*sigh*)\n var oldX = skeleton.x;\n var oldY = skeleton.y;\n\n skeleton.x = 0;\n skeleton.y = 0;\n\n sceneRenderer.drawSkeletonDebug(skeleton, src.preMultipliedAlpha);\n\n skeleton.x = oldX;\n skeleton.y = oldY;\n }\n\n if (!renderer.nextTypeMatch)\n {\n // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch\n sceneRenderer.end();\n\n // And rebind the previous pipeline\n renderer.pipelines.rebind();\n }\n};\n\nmodule.exports = SpineGameObjectWebGLRenderer;\n","/*** IMPORTS FROM imports-loader ***/\n\n(function() {\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar spine;\n(function (spine) {\n var Animation = (function () {\n function Animation(name, timelines, duration) {\n if (name == null)\n throw new Error(\"name cannot be null.\");\n if (timelines == null)\n throw new Error(\"timelines cannot be null.\");\n this.name = name;\n this.timelines = timelines;\n this.timelineIds = [];\n for (var i = 0; i < timelines.length; i++)\n this.timelineIds[timelines[i].getPropertyId()] = true;\n this.duration = duration;\n }\n Animation.prototype.hasTimeline = function (id) {\n return this.timelineIds[id] == true;\n };\n Animation.prototype.apply = function (skeleton, lastTime, time, loop, events, alpha, blend, direction) {\n if (skeleton == null)\n throw new Error(\"skeleton cannot be null.\");\n if (loop && this.duration != 0) {\n time %= this.duration;\n if (lastTime > 0)\n lastTime %= this.duration;\n }\n var timelines = this.timelines;\n for (var i = 0, n = timelines.length; i < n; i++)\n timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\n };\n Animation.binarySearch = function (values, target, step) {\n if (step === void 0) { step = 1; }\n var low = 0;\n var high = values.length / step - 2;\n if (high == 0)\n return step;\n var current = high >>> 1;\n while (true) {\n if (values[(current + 1) * step] <= target)\n low = current + 1;\n else\n high = current;\n if (low == high)\n return (low + 1) * step;\n current = (low + high) >>> 1;\n }\n };\n Animation.linearSearch = function (values, target, step) {\n for (var i = 0, last = values.length - step; i <= last; i += step)\n if (values[i] > target)\n return i;\n return -1;\n };\n return Animation;\n }());\n spine.Animation = Animation;\n var MixBlend;\n (function (MixBlend) {\n MixBlend[MixBlend[\"setup\"] = 0] = \"setup\";\n MixBlend[MixBlend[\"first\"] = 1] = \"first\";\n MixBlend[MixBlend[\"replace\"] = 2] = \"replace\";\n MixBlend[MixBlend[\"add\"] = 3] = \"add\";\n })(MixBlend = spine.MixBlend || (spine.MixBlend = {}));\n var MixDirection;\n (function (MixDirection) {\n MixDirection[MixDirection[\"mixIn\"] = 0] = \"mixIn\";\n MixDirection[MixDirection[\"mixOut\"] = 1] = \"mixOut\";\n })(MixDirection = spine.MixDirection || (spine.MixDirection = {}));\n var TimelineType;\n (function (TimelineType) {\n TimelineType[TimelineType[\"rotate\"] = 0] = \"rotate\";\n TimelineType[TimelineType[\"translate\"] = 1] = \"translate\";\n TimelineType[TimelineType[\"scale\"] = 2] = \"scale\";\n TimelineType[TimelineType[\"shear\"] = 3] = \"shear\";\n TimelineType[TimelineType[\"attachment\"] = 4] = \"attachment\";\n TimelineType[TimelineType[\"color\"] = 5] = \"color\";\n TimelineType[TimelineType[\"deform\"] = 6] = \"deform\";\n TimelineType[TimelineType[\"event\"] = 7] = \"event\";\n TimelineType[TimelineType[\"drawOrder\"] = 8] = \"drawOrder\";\n TimelineType[TimelineType[\"ikConstraint\"] = 9] = \"ikConstraint\";\n TimelineType[TimelineType[\"transformConstraint\"] = 10] = \"transformConstraint\";\n TimelineType[TimelineType[\"pathConstraintPosition\"] = 11] = \"pathConstraintPosition\";\n TimelineType[TimelineType[\"pathConstraintSpacing\"] = 12] = \"pathConstraintSpacing\";\n TimelineType[TimelineType[\"pathConstraintMix\"] = 13] = \"pathConstraintMix\";\n TimelineType[TimelineType[\"twoColor\"] = 14] = \"twoColor\";\n })(TimelineType = spine.TimelineType || (spine.TimelineType = {}));\n var CurveTimeline = (function () {\n function CurveTimeline(frameCount) {\n if (frameCount <= 0)\n throw new Error(\"frameCount must be > 0: \" + frameCount);\n this.curves = spine.Utils.newFloatArray((frameCount - 1) * CurveTimeline.BEZIER_SIZE);\n }\n CurveTimeline.prototype.getFrameCount = function () {\n return this.curves.length / CurveTimeline.BEZIER_SIZE + 1;\n };\n CurveTimeline.prototype.setLinear = function (frameIndex) {\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.LINEAR;\n };\n CurveTimeline.prototype.setStepped = function (frameIndex) {\n this.curves[frameIndex * CurveTimeline.BEZIER_SIZE] = CurveTimeline.STEPPED;\n };\n CurveTimeline.prototype.getCurveType = function (frameIndex) {\n var index = frameIndex * CurveTimeline.BEZIER_SIZE;\n if (index == this.curves.length)\n return CurveTimeline.LINEAR;\n var type = this.curves[index];\n if (type == CurveTimeline.LINEAR)\n return CurveTimeline.LINEAR;\n if (type == CurveTimeline.STEPPED)\n return CurveTimeline.STEPPED;\n return CurveTimeline.BEZIER;\n };\n CurveTimeline.prototype.setCurve = function (frameIndex, cx1, cy1, cx2, cy2) {\n var tmpx = (-cx1 * 2 + cx2) * 0.03, tmpy = (-cy1 * 2 + cy2) * 0.03;\n var dddfx = ((cx1 - cx2) * 3 + 1) * 0.006, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006;\n var ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy;\n var dfx = cx1 * 0.3 + tmpx + dddfx * 0.16666667, dfy = cy1 * 0.3 + tmpy + dddfy * 0.16666667;\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\n var curves = this.curves;\n curves[i++] = CurveTimeline.BEZIER;\n var x = dfx, y = dfy;\n for (var n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\n curves[i] = x;\n curves[i + 1] = y;\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n x += dfx;\n y += dfy;\n }\n };\n CurveTimeline.prototype.getCurvePercent = function (frameIndex, percent) {\n percent = spine.MathUtils.clamp(percent, 0, 1);\n var curves = this.curves;\n var i = frameIndex * CurveTimeline.BEZIER_SIZE;\n var type = curves[i];\n if (type == CurveTimeline.LINEAR)\n return percent;\n if (type == CurveTimeline.STEPPED)\n return 0;\n i++;\n var x = 0;\n for (var start = i, n = i + CurveTimeline.BEZIER_SIZE - 1; i < n; i += 2) {\n x = curves[i];\n if (x >= percent) {\n var prevX = void 0, prevY = void 0;\n if (i == start) {\n prevX = 0;\n prevY = 0;\n }\n else {\n prevX = curves[i - 2];\n prevY = curves[i - 1];\n }\n return prevY + (curves[i + 1] - prevY) * (percent - prevX) / (x - prevX);\n }\n }\n var y = curves[i - 1];\n return y + (1 - y) * (percent - x) / (1 - x);\n };\n CurveTimeline.LINEAR = 0;\n CurveTimeline.STEPPED = 1;\n CurveTimeline.BEZIER = 2;\n CurveTimeline.BEZIER_SIZE = 10 * 2 - 1;\n return CurveTimeline;\n }());\n spine.CurveTimeline = CurveTimeline;\n var RotateTimeline = (function (_super) {\n __extends(RotateTimeline, _super);\n function RotateTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount << 1);\n return _this;\n }\n RotateTimeline.prototype.getPropertyId = function () {\n return (TimelineType.rotate << 24) + this.boneIndex;\n };\n RotateTimeline.prototype.setFrame = function (frameIndex, time, degrees) {\n frameIndex <<= 1;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + RotateTimeline.ROTATION] = degrees;\n };\n RotateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\n var frames = this.frames;\n var bone = skeleton.bones[this.boneIndex];\n if (!bone.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n bone.rotation = bone.data.rotation;\n return;\n case MixBlend.first:\n var r_1 = bone.data.rotation - bone.rotation;\n bone.rotation += (r_1 - (16384 - ((16384.499999999996 - r_1 / 360) | 0)) * 360) * alpha;\n }\n return;\n }\n if (time >= frames[frames.length - RotateTimeline.ENTRIES]) {\n var r_2 = frames[frames.length + RotateTimeline.PREV_ROTATION];\n switch (blend) {\n case MixBlend.setup:\n bone.rotation = bone.data.rotation + r_2 * alpha;\n break;\n case MixBlend.first:\n case MixBlend.replace:\n r_2 += bone.data.rotation - bone.rotation;\n r_2 -= (16384 - ((16384.499999999996 - r_2 / 360) | 0)) * 360;\n case MixBlend.add:\n bone.rotation += r_2 * alpha;\n }\n return;\n }\n var frame = Animation.binarySearch(frames, time, RotateTimeline.ENTRIES);\n var prevRotation = frames[frame + RotateTimeline.PREV_ROTATION];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + RotateTimeline.PREV_TIME] - frameTime));\n var r = frames[frame + RotateTimeline.ROTATION] - prevRotation;\n r = prevRotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * percent;\n switch (blend) {\n case MixBlend.setup:\n bone.rotation = bone.data.rotation + (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\n break;\n case MixBlend.first:\n case MixBlend.replace:\n r += bone.data.rotation - bone.rotation;\n case MixBlend.add:\n bone.rotation += (r - (16384 - ((16384.499999999996 - r / 360) | 0)) * 360) * alpha;\n }\n };\n RotateTimeline.ENTRIES = 2;\n RotateTimeline.PREV_TIME = -2;\n RotateTimeline.PREV_ROTATION = -1;\n RotateTimeline.ROTATION = 1;\n return RotateTimeline;\n }(CurveTimeline));\n spine.RotateTimeline = RotateTimeline;\n var TranslateTimeline = (function (_super) {\n __extends(TranslateTimeline, _super);\n function TranslateTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount * TranslateTimeline.ENTRIES);\n return _this;\n }\n TranslateTimeline.prototype.getPropertyId = function () {\n return (TimelineType.translate << 24) + this.boneIndex;\n };\n TranslateTimeline.prototype.setFrame = function (frameIndex, time, x, y) {\n frameIndex *= TranslateTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TranslateTimeline.X] = x;\n this.frames[frameIndex + TranslateTimeline.Y] = y;\n };\n TranslateTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\n var frames = this.frames;\n var bone = skeleton.bones[this.boneIndex];\n if (!bone.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n bone.x = bone.data.x;\n bone.y = bone.data.y;\n return;\n case MixBlend.first:\n bone.x += (bone.data.x - bone.x) * alpha;\n bone.y += (bone.data.y - bone.y) * alpha;\n }\n return;\n }\n var x = 0, y = 0;\n if (time >= frames[frames.length - TranslateTimeline.ENTRIES]) {\n x = frames[frames.length + TranslateTimeline.PREV_X];\n y = frames[frames.length + TranslateTimeline.PREV_Y];\n }\n else {\n var frame = Animation.binarySearch(frames, time, TranslateTimeline.ENTRIES);\n x = frames[frame + TranslateTimeline.PREV_X];\n y = frames[frame + TranslateTimeline.PREV_Y];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / TranslateTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TranslateTimeline.PREV_TIME] - frameTime));\n x += (frames[frame + TranslateTimeline.X] - x) * percent;\n y += (frames[frame + TranslateTimeline.Y] - y) * percent;\n }\n switch (blend) {\n case MixBlend.setup:\n bone.x = bone.data.x + x * alpha;\n bone.y = bone.data.y + y * alpha;\n break;\n case MixBlend.first:\n case MixBlend.replace:\n bone.x += (bone.data.x + x - bone.x) * alpha;\n bone.y += (bone.data.y + y - bone.y) * alpha;\n break;\n case MixBlend.add:\n bone.x += x * alpha;\n bone.y += y * alpha;\n }\n };\n TranslateTimeline.ENTRIES = 3;\n TranslateTimeline.PREV_TIME = -3;\n TranslateTimeline.PREV_X = -2;\n TranslateTimeline.PREV_Y = -1;\n TranslateTimeline.X = 1;\n TranslateTimeline.Y = 2;\n return TranslateTimeline;\n }(CurveTimeline));\n spine.TranslateTimeline = TranslateTimeline;\n var ScaleTimeline = (function (_super) {\n __extends(ScaleTimeline, _super);\n function ScaleTimeline(frameCount) {\n return _super.call(this, frameCount) || this;\n }\n ScaleTimeline.prototype.getPropertyId = function () {\n return (TimelineType.scale << 24) + this.boneIndex;\n };\n ScaleTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\n var frames = this.frames;\n var bone = skeleton.bones[this.boneIndex];\n if (!bone.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n bone.scaleX = bone.data.scaleX;\n bone.scaleY = bone.data.scaleY;\n return;\n case MixBlend.first:\n bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\n bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\n }\n return;\n }\n var x = 0, y = 0;\n if (time >= frames[frames.length - ScaleTimeline.ENTRIES]) {\n x = frames[frames.length + ScaleTimeline.PREV_X] * bone.data.scaleX;\n y = frames[frames.length + ScaleTimeline.PREV_Y] * bone.data.scaleY;\n }\n else {\n var frame = Animation.binarySearch(frames, time, ScaleTimeline.ENTRIES);\n x = frames[frame + ScaleTimeline.PREV_X];\n y = frames[frame + ScaleTimeline.PREV_Y];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / ScaleTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ScaleTimeline.PREV_TIME] - frameTime));\n x = (x + (frames[frame + ScaleTimeline.X] - x) * percent) * bone.data.scaleX;\n y = (y + (frames[frame + ScaleTimeline.Y] - y) * percent) * bone.data.scaleY;\n }\n if (alpha == 1) {\n if (blend == MixBlend.add) {\n bone.scaleX += x - bone.data.scaleX;\n bone.scaleY += y - bone.data.scaleY;\n }\n else {\n bone.scaleX = x;\n bone.scaleY = y;\n }\n }\n else {\n var bx = 0, by = 0;\n if (direction == MixDirection.mixOut) {\n switch (blend) {\n case MixBlend.setup:\n bx = bone.data.scaleX;\n by = bone.data.scaleY;\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\n break;\n case MixBlend.first:\n case MixBlend.replace:\n bx = bone.scaleX;\n by = bone.scaleY;\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bx) * alpha;\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - by) * alpha;\n break;\n case MixBlend.add:\n bx = bone.scaleX;\n by = bone.scaleY;\n bone.scaleX = bx + (Math.abs(x) * spine.MathUtils.signum(bx) - bone.data.scaleX) * alpha;\n bone.scaleY = by + (Math.abs(y) * spine.MathUtils.signum(by) - bone.data.scaleY) * alpha;\n }\n }\n else {\n switch (blend) {\n case MixBlend.setup:\n bx = Math.abs(bone.data.scaleX) * spine.MathUtils.signum(x);\n by = Math.abs(bone.data.scaleY) * spine.MathUtils.signum(y);\n bone.scaleX = bx + (x - bx) * alpha;\n bone.scaleY = by + (y - by) * alpha;\n break;\n case MixBlend.first:\n case MixBlend.replace:\n bx = Math.abs(bone.scaleX) * spine.MathUtils.signum(x);\n by = Math.abs(bone.scaleY) * spine.MathUtils.signum(y);\n bone.scaleX = bx + (x - bx) * alpha;\n bone.scaleY = by + (y - by) * alpha;\n break;\n case MixBlend.add:\n bx = spine.MathUtils.signum(x);\n by = spine.MathUtils.signum(y);\n bone.scaleX = Math.abs(bone.scaleX) * bx + (x - Math.abs(bone.data.scaleX) * bx) * alpha;\n bone.scaleY = Math.abs(bone.scaleY) * by + (y - Math.abs(bone.data.scaleY) * by) * alpha;\n }\n }\n }\n };\n return ScaleTimeline;\n }(TranslateTimeline));\n spine.ScaleTimeline = ScaleTimeline;\n var ShearTimeline = (function (_super) {\n __extends(ShearTimeline, _super);\n function ShearTimeline(frameCount) {\n return _super.call(this, frameCount) || this;\n }\n ShearTimeline.prototype.getPropertyId = function () {\n return (TimelineType.shear << 24) + this.boneIndex;\n };\n ShearTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\n var frames = this.frames;\n var bone = skeleton.bones[this.boneIndex];\n if (!bone.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n bone.shearX = bone.data.shearX;\n bone.shearY = bone.data.shearY;\n return;\n case MixBlend.first:\n bone.shearX += (bone.data.shearX - bone.shearX) * alpha;\n bone.shearY += (bone.data.shearY - bone.shearY) * alpha;\n }\n return;\n }\n var x = 0, y = 0;\n if (time >= frames[frames.length - ShearTimeline.ENTRIES]) {\n x = frames[frames.length + ShearTimeline.PREV_X];\n y = frames[frames.length + ShearTimeline.PREV_Y];\n }\n else {\n var frame = Animation.binarySearch(frames, time, ShearTimeline.ENTRIES);\n x = frames[frame + ShearTimeline.PREV_X];\n y = frames[frame + ShearTimeline.PREV_Y];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / ShearTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ShearTimeline.PREV_TIME] - frameTime));\n x = x + (frames[frame + ShearTimeline.X] - x) * percent;\n y = y + (frames[frame + ShearTimeline.Y] - y) * percent;\n }\n switch (blend) {\n case MixBlend.setup:\n bone.shearX = bone.data.shearX + x * alpha;\n bone.shearY = bone.data.shearY + y * alpha;\n break;\n case MixBlend.first:\n case MixBlend.replace:\n bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\n bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\n break;\n case MixBlend.add:\n bone.shearX += x * alpha;\n bone.shearY += y * alpha;\n }\n };\n return ShearTimeline;\n }(TranslateTimeline));\n spine.ShearTimeline = ShearTimeline;\n var ColorTimeline = (function (_super) {\n __extends(ColorTimeline, _super);\n function ColorTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount * ColorTimeline.ENTRIES);\n return _this;\n }\n ColorTimeline.prototype.getPropertyId = function () {\n return (TimelineType.color << 24) + this.slotIndex;\n };\n ColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a) {\n frameIndex *= ColorTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + ColorTimeline.R] = r;\n this.frames[frameIndex + ColorTimeline.G] = g;\n this.frames[frameIndex + ColorTimeline.B] = b;\n this.frames[frameIndex + ColorTimeline.A] = a;\n };\n ColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\n var slot = skeleton.slots[this.slotIndex];\n if (!slot.bone.active)\n return;\n var frames = this.frames;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n slot.color.setFromColor(slot.data.color);\n return;\n case MixBlend.first:\n var color = slot.color, setup = slot.data.color;\n color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, (setup.a - color.a) * alpha);\n }\n return;\n }\n var r = 0, g = 0, b = 0, a = 0;\n if (time >= frames[frames.length - ColorTimeline.ENTRIES]) {\n var i = frames.length;\n r = frames[i + ColorTimeline.PREV_R];\n g = frames[i + ColorTimeline.PREV_G];\n b = frames[i + ColorTimeline.PREV_B];\n a = frames[i + ColorTimeline.PREV_A];\n }\n else {\n var frame = Animation.binarySearch(frames, time, ColorTimeline.ENTRIES);\n r = frames[frame + ColorTimeline.PREV_R];\n g = frames[frame + ColorTimeline.PREV_G];\n b = frames[frame + ColorTimeline.PREV_B];\n a = frames[frame + ColorTimeline.PREV_A];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / ColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + ColorTimeline.PREV_TIME] - frameTime));\n r += (frames[frame + ColorTimeline.R] - r) * percent;\n g += (frames[frame + ColorTimeline.G] - g) * percent;\n b += (frames[frame + ColorTimeline.B] - b) * percent;\n a += (frames[frame + ColorTimeline.A] - a) * percent;\n }\n if (alpha == 1)\n slot.color.set(r, g, b, a);\n else {\n var color = slot.color;\n if (blend == MixBlend.setup)\n color.setFromColor(slot.data.color);\n color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\n }\n };\n ColorTimeline.ENTRIES = 5;\n ColorTimeline.PREV_TIME = -5;\n ColorTimeline.PREV_R = -4;\n ColorTimeline.PREV_G = -3;\n ColorTimeline.PREV_B = -2;\n ColorTimeline.PREV_A = -1;\n ColorTimeline.R = 1;\n ColorTimeline.G = 2;\n ColorTimeline.B = 3;\n ColorTimeline.A = 4;\n return ColorTimeline;\n }(CurveTimeline));\n spine.ColorTimeline = ColorTimeline;\n var TwoColorTimeline = (function (_super) {\n __extends(TwoColorTimeline, _super);\n function TwoColorTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount * TwoColorTimeline.ENTRIES);\n return _this;\n }\n TwoColorTimeline.prototype.getPropertyId = function () {\n return (TimelineType.twoColor << 24) + this.slotIndex;\n };\n TwoColorTimeline.prototype.setFrame = function (frameIndex, time, r, g, b, a, r2, g2, b2) {\n frameIndex *= TwoColorTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TwoColorTimeline.R] = r;\n this.frames[frameIndex + TwoColorTimeline.G] = g;\n this.frames[frameIndex + TwoColorTimeline.B] = b;\n this.frames[frameIndex + TwoColorTimeline.A] = a;\n this.frames[frameIndex + TwoColorTimeline.R2] = r2;\n this.frames[frameIndex + TwoColorTimeline.G2] = g2;\n this.frames[frameIndex + TwoColorTimeline.B2] = b2;\n };\n TwoColorTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\n var slot = skeleton.slots[this.slotIndex];\n if (!slot.bone.active)\n return;\n var frames = this.frames;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n slot.color.setFromColor(slot.data.color);\n slot.darkColor.setFromColor(slot.data.darkColor);\n return;\n case MixBlend.first:\n var light = slot.color, dark = slot.darkColor, setupLight = slot.data.color, setupDark = slot.data.darkColor;\n light.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha, (setupLight.a - light.a) * alpha);\n dark.add((setupDark.r - dark.r) * alpha, (setupDark.g - dark.g) * alpha, (setupDark.b - dark.b) * alpha, 0);\n }\n return;\n }\n var r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n if (time >= frames[frames.length - TwoColorTimeline.ENTRIES]) {\n var i = frames.length;\n r = frames[i + TwoColorTimeline.PREV_R];\n g = frames[i + TwoColorTimeline.PREV_G];\n b = frames[i + TwoColorTimeline.PREV_B];\n a = frames[i + TwoColorTimeline.PREV_A];\n r2 = frames[i + TwoColorTimeline.PREV_R2];\n g2 = frames[i + TwoColorTimeline.PREV_G2];\n b2 = frames[i + TwoColorTimeline.PREV_B2];\n }\n else {\n var frame = Animation.binarySearch(frames, time, TwoColorTimeline.ENTRIES);\n r = frames[frame + TwoColorTimeline.PREV_R];\n g = frames[frame + TwoColorTimeline.PREV_G];\n b = frames[frame + TwoColorTimeline.PREV_B];\n a = frames[frame + TwoColorTimeline.PREV_A];\n r2 = frames[frame + TwoColorTimeline.PREV_R2];\n g2 = frames[frame + TwoColorTimeline.PREV_G2];\n b2 = frames[frame + TwoColorTimeline.PREV_B2];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / TwoColorTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TwoColorTimeline.PREV_TIME] - frameTime));\n r += (frames[frame + TwoColorTimeline.R] - r) * percent;\n g += (frames[frame + TwoColorTimeline.G] - g) * percent;\n b += (frames[frame + TwoColorTimeline.B] - b) * percent;\n a += (frames[frame + TwoColorTimeline.A] - a) * percent;\n r2 += (frames[frame + TwoColorTimeline.R2] - r2) * percent;\n g2 += (frames[frame + TwoColorTimeline.G2] - g2) * percent;\n b2 += (frames[frame + TwoColorTimeline.B2] - b2) * percent;\n }\n if (alpha == 1) {\n slot.color.set(r, g, b, a);\n slot.darkColor.set(r2, g2, b2, 1);\n }\n else {\n var light = slot.color, dark = slot.darkColor;\n if (blend == MixBlend.setup) {\n light.setFromColor(slot.data.color);\n dark.setFromColor(slot.data.darkColor);\n }\n light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\n dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0);\n }\n };\n TwoColorTimeline.ENTRIES = 8;\n TwoColorTimeline.PREV_TIME = -8;\n TwoColorTimeline.PREV_R = -7;\n TwoColorTimeline.PREV_G = -6;\n TwoColorTimeline.PREV_B = -5;\n TwoColorTimeline.PREV_A = -4;\n TwoColorTimeline.PREV_R2 = -3;\n TwoColorTimeline.PREV_G2 = -2;\n TwoColorTimeline.PREV_B2 = -1;\n TwoColorTimeline.R = 1;\n TwoColorTimeline.G = 2;\n TwoColorTimeline.B = 3;\n TwoColorTimeline.A = 4;\n TwoColorTimeline.R2 = 5;\n TwoColorTimeline.G2 = 6;\n TwoColorTimeline.B2 = 7;\n return TwoColorTimeline;\n }(CurveTimeline));\n spine.TwoColorTimeline = TwoColorTimeline;\n var AttachmentTimeline = (function () {\n function AttachmentTimeline(frameCount) {\n this.frames = spine.Utils.newFloatArray(frameCount);\n this.attachmentNames = new Array(frameCount);\n }\n AttachmentTimeline.prototype.getPropertyId = function () {\n return (TimelineType.attachment << 24) + this.slotIndex;\n };\n AttachmentTimeline.prototype.getFrameCount = function () {\n return this.frames.length;\n };\n AttachmentTimeline.prototype.setFrame = function (frameIndex, time, attachmentName) {\n this.frames[frameIndex] = time;\n this.attachmentNames[frameIndex] = attachmentName;\n };\n AttachmentTimeline.prototype.apply = function (skeleton, lastTime, time, events, alpha, blend, direction) {\n var slot = skeleton.slots[this.slotIndex];\n if (!slot.bone.active)\n return;\n if (direction == MixDirection.mixOut) {\n if (blend == MixBlend.setup)\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\n return;\n }\n var frames = this.frames;\n if (time < frames[0]) {\n if (blend == MixBlend.setup || blend == MixBlend.first)\n this.setAttachment(skeleton, slot, slot.data.attachmentName);\n return;\n }\n var frameIndex = 0;\n if (time >= frames[frames.length - 1])\n frameIndex = frames.length - 1;\n else\n frameIndex = Animation.binarySearch(frames, time, 1) - 1;\n var attachmentName = this.attachmentNames[frameIndex];\n skeleton.slots[this.slotIndex]\n .setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\n };\n AttachmentTimeline.prototype.setAttachment = function (skeleton, slot, attachmentName) {\n slot.attachment = attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName);\n };\n return AttachmentTimeline;\n }());\n spine.AttachmentTimeline = AttachmentTimeline;\n var zeros = null;\n var DeformTimeline = (function (_super) {\n __extends(DeformTimeline, _super);\n function DeformTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount);\n _this.frameVertices = new Array(frameCount);\n if (zeros == null)\n zeros = spine.Utils.newFloatArray(64);\n return _this;\n }\n DeformTimeline.prototype.getPropertyId = function () {\n return (TimelineType.deform << 27) + +this.attachment.id + this.slotIndex;\n };\n DeformTimeline.prototype.setFrame = function (frameIndex, time, vertices) {\n this.frames[frameIndex] = time;\n this.frameVertices[frameIndex] = vertices;\n };\n DeformTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n var slot = skeleton.slots[this.slotIndex];\n if (!slot.bone.active)\n return;\n var slotAttachment = slot.getAttachment();\n if (!(slotAttachment instanceof spine.VertexAttachment) || !(slotAttachment.deformAttachment == this.attachment))\n return;\n var deformArray = slot.deform;\n if (deformArray.length == 0)\n blend = MixBlend.setup;\n var frameVertices = this.frameVertices;\n var vertexCount = frameVertices[0].length;\n var frames = this.frames;\n if (time < frames[0]) {\n var vertexAttachment = slotAttachment;\n switch (blend) {\n case MixBlend.setup:\n deformArray.length = 0;\n return;\n case MixBlend.first:\n if (alpha == 1) {\n deformArray.length = 0;\n break;\n }\n var deform_1 = spine.Utils.setArraySize(deformArray, vertexCount);\n if (vertexAttachment.bones == null) {\n var setupVertices = vertexAttachment.vertices;\n for (var i = 0; i < vertexCount; i++)\n deform_1[i] += (setupVertices[i] - deform_1[i]) * alpha;\n }\n else {\n alpha = 1 - alpha;\n for (var i = 0; i < vertexCount; i++)\n deform_1[i] *= alpha;\n }\n }\n return;\n }\n var deform = spine.Utils.setArraySize(deformArray, vertexCount);\n if (time >= frames[frames.length - 1]) {\n var lastVertices = frameVertices[frames.length - 1];\n if (alpha == 1) {\n if (blend == MixBlend.add) {\n var vertexAttachment = slotAttachment;\n if (vertexAttachment.bones == null) {\n var setupVertices = vertexAttachment.vertices;\n for (var i_1 = 0; i_1 < vertexCount; i_1++) {\n deform[i_1] += lastVertices[i_1] - setupVertices[i_1];\n }\n }\n else {\n for (var i_2 = 0; i_2 < vertexCount; i_2++)\n deform[i_2] += lastVertices[i_2];\n }\n }\n else {\n spine.Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\n }\n }\n else {\n switch (blend) {\n case MixBlend.setup: {\n var vertexAttachment_1 = slotAttachment;\n if (vertexAttachment_1.bones == null) {\n var setupVertices = vertexAttachment_1.vertices;\n for (var i_3 = 0; i_3 < vertexCount; i_3++) {\n var setup = setupVertices[i_3];\n deform[i_3] = setup + (lastVertices[i_3] - setup) * alpha;\n }\n }\n else {\n for (var i_4 = 0; i_4 < vertexCount; i_4++)\n deform[i_4] = lastVertices[i_4] * alpha;\n }\n break;\n }\n case MixBlend.first:\n case MixBlend.replace:\n for (var i_5 = 0; i_5 < vertexCount; i_5++)\n deform[i_5] += (lastVertices[i_5] - deform[i_5]) * alpha;\n break;\n case MixBlend.add:\n var vertexAttachment = slotAttachment;\n if (vertexAttachment.bones == null) {\n var setupVertices = vertexAttachment.vertices;\n for (var i_6 = 0; i_6 < vertexCount; i_6++) {\n deform[i_6] += (lastVertices[i_6] - setupVertices[i_6]) * alpha;\n }\n }\n else {\n for (var i_7 = 0; i_7 < vertexCount; i_7++)\n deform[i_7] += lastVertices[i_7] * alpha;\n }\n }\n }\n return;\n }\n var frame = Animation.binarySearch(frames, time);\n var prevVertices = frameVertices[frame - 1];\n var nextVertices = frameVertices[frame];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime));\n if (alpha == 1) {\n if (blend == MixBlend.add) {\n var vertexAttachment = slotAttachment;\n if (vertexAttachment.bones == null) {\n var setupVertices = vertexAttachment.vertices;\n for (var i_8 = 0; i_8 < vertexCount; i_8++) {\n var prev = prevVertices[i_8];\n deform[i_8] += prev + (nextVertices[i_8] - prev) * percent - setupVertices[i_8];\n }\n }\n else {\n for (var i_9 = 0; i_9 < vertexCount; i_9++) {\n var prev = prevVertices[i_9];\n deform[i_9] += prev + (nextVertices[i_9] - prev) * percent;\n }\n }\n }\n else {\n for (var i_10 = 0; i_10 < vertexCount; i_10++) {\n var prev = prevVertices[i_10];\n deform[i_10] = prev + (nextVertices[i_10] - prev) * percent;\n }\n }\n }\n else {\n switch (blend) {\n case MixBlend.setup: {\n var vertexAttachment_2 = slotAttachment;\n if (vertexAttachment_2.bones == null) {\n var setupVertices = vertexAttachment_2.vertices;\n for (var i_11 = 0; i_11 < vertexCount; i_11++) {\n var prev = prevVertices[i_11], setup = setupVertices[i_11];\n deform[i_11] = setup + (prev + (nextVertices[i_11] - prev) * percent - setup) * alpha;\n }\n }\n else {\n for (var i_12 = 0; i_12 < vertexCount; i_12++) {\n var prev = prevVertices[i_12];\n deform[i_12] = (prev + (nextVertices[i_12] - prev) * percent) * alpha;\n }\n }\n break;\n }\n case MixBlend.first:\n case MixBlend.replace:\n for (var i_13 = 0; i_13 < vertexCount; i_13++) {\n var prev = prevVertices[i_13];\n deform[i_13] += (prev + (nextVertices[i_13] - prev) * percent - deform[i_13]) * alpha;\n }\n break;\n case MixBlend.add:\n var vertexAttachment = slotAttachment;\n if (vertexAttachment.bones == null) {\n var setupVertices = vertexAttachment.vertices;\n for (var i_14 = 0; i_14 < vertexCount; i_14++) {\n var prev = prevVertices[i_14];\n deform[i_14] += (prev + (nextVertices[i_14] - prev) * percent - setupVertices[i_14]) * alpha;\n }\n }\n else {\n for (var i_15 = 0; i_15 < vertexCount; i_15++) {\n var prev = prevVertices[i_15];\n deform[i_15] += (prev + (nextVertices[i_15] - prev) * percent) * alpha;\n }\n }\n }\n }\n };\n return DeformTimeline;\n }(CurveTimeline));\n spine.DeformTimeline = DeformTimeline;\n var EventTimeline = (function () {\n function EventTimeline(frameCount) {\n this.frames = spine.Utils.newFloatArray(frameCount);\n this.events = new Array(frameCount);\n }\n EventTimeline.prototype.getPropertyId = function () {\n return TimelineType.event << 24;\n };\n EventTimeline.prototype.getFrameCount = function () {\n return this.frames.length;\n };\n EventTimeline.prototype.setFrame = function (frameIndex, event) {\n this.frames[frameIndex] = event.time;\n this.events[frameIndex] = event;\n };\n EventTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n if (firedEvents == null)\n return;\n var frames = this.frames;\n var frameCount = this.frames.length;\n if (lastTime > time) {\n this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\n lastTime = -1;\n }\n else if (lastTime >= frames[frameCount - 1])\n return;\n if (time < frames[0])\n return;\n var frame = 0;\n if (lastTime < frames[0])\n frame = 0;\n else {\n frame = Animation.binarySearch(frames, lastTime);\n var frameTime = frames[frame];\n while (frame > 0) {\n if (frames[frame - 1] != frameTime)\n break;\n frame--;\n }\n }\n for (; frame < frameCount && time >= frames[frame]; frame++)\n firedEvents.push(this.events[frame]);\n };\n return EventTimeline;\n }());\n spine.EventTimeline = EventTimeline;\n var DrawOrderTimeline = (function () {\n function DrawOrderTimeline(frameCount) {\n this.frames = spine.Utils.newFloatArray(frameCount);\n this.drawOrders = new Array(frameCount);\n }\n DrawOrderTimeline.prototype.getPropertyId = function () {\n return TimelineType.drawOrder << 24;\n };\n DrawOrderTimeline.prototype.getFrameCount = function () {\n return this.frames.length;\n };\n DrawOrderTimeline.prototype.setFrame = function (frameIndex, time, drawOrder) {\n this.frames[frameIndex] = time;\n this.drawOrders[frameIndex] = drawOrder;\n };\n DrawOrderTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n var drawOrder = skeleton.drawOrder;\n var slots = skeleton.slots;\n if (direction == MixDirection.mixOut) {\n if (blend == MixBlend.setup)\n spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n return;\n }\n var frames = this.frames;\n if (time < frames[0]) {\n if (blend == MixBlend.setup || blend == MixBlend.first)\n spine.Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n return;\n }\n var frame = 0;\n if (time >= frames[frames.length - 1])\n frame = frames.length - 1;\n else\n frame = Animation.binarySearch(frames, time) - 1;\n var drawOrderToSetupIndex = this.drawOrders[frame];\n if (drawOrderToSetupIndex == null)\n spine.Utils.arrayCopy(slots, 0, drawOrder, 0, slots.length);\n else {\n for (var i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\n drawOrder[i] = slots[drawOrderToSetupIndex[i]];\n }\n };\n return DrawOrderTimeline;\n }());\n spine.DrawOrderTimeline = DrawOrderTimeline;\n var IkConstraintTimeline = (function (_super) {\n __extends(IkConstraintTimeline, _super);\n function IkConstraintTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount * IkConstraintTimeline.ENTRIES);\n return _this;\n }\n IkConstraintTimeline.prototype.getPropertyId = function () {\n return (TimelineType.ikConstraint << 24) + this.ikConstraintIndex;\n };\n IkConstraintTimeline.prototype.setFrame = function (frameIndex, time, mix, softness, bendDirection, compress, stretch) {\n frameIndex *= IkConstraintTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + IkConstraintTimeline.MIX] = mix;\n this.frames[frameIndex + IkConstraintTimeline.SOFTNESS] = softness;\n this.frames[frameIndex + IkConstraintTimeline.BEND_DIRECTION] = bendDirection;\n this.frames[frameIndex + IkConstraintTimeline.COMPRESS] = compress ? 1 : 0;\n this.frames[frameIndex + IkConstraintTimeline.STRETCH] = stretch ? 1 : 0;\n };\n IkConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n var frames = this.frames;\n var constraint = skeleton.ikConstraints[this.ikConstraintIndex];\n if (!constraint.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n constraint.mix = constraint.data.mix;\n constraint.softness = constraint.data.softness;\n constraint.bendDirection = constraint.data.bendDirection;\n constraint.compress = constraint.data.compress;\n constraint.stretch = constraint.data.stretch;\n return;\n case MixBlend.first:\n constraint.mix += (constraint.data.mix - constraint.mix) * alpha;\n constraint.softness += (constraint.data.softness - constraint.softness) * alpha;\n constraint.bendDirection = constraint.data.bendDirection;\n constraint.compress = constraint.data.compress;\n constraint.stretch = constraint.data.stretch;\n }\n return;\n }\n if (time >= frames[frames.length - IkConstraintTimeline.ENTRIES]) {\n if (blend == MixBlend.setup) {\n constraint.mix = constraint.data.mix + (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.data.mix) * alpha;\n constraint.softness = constraint.data.softness\n + (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.data.softness) * alpha;\n if (direction == MixDirection.mixOut) {\n constraint.bendDirection = constraint.data.bendDirection;\n constraint.compress = constraint.data.compress;\n constraint.stretch = constraint.data.stretch;\n }\n else {\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\n }\n }\n else {\n constraint.mix += (frames[frames.length + IkConstraintTimeline.PREV_MIX] - constraint.mix) * alpha;\n constraint.softness += (frames[frames.length + IkConstraintTimeline.PREV_SOFTNESS] - constraint.softness) * alpha;\n if (direction == MixDirection.mixIn) {\n constraint.bendDirection = frames[frames.length + IkConstraintTimeline.PREV_BEND_DIRECTION];\n constraint.compress = frames[frames.length + IkConstraintTimeline.PREV_COMPRESS] != 0;\n constraint.stretch = frames[frames.length + IkConstraintTimeline.PREV_STRETCH] != 0;\n }\n }\n return;\n }\n var frame = Animation.binarySearch(frames, time, IkConstraintTimeline.ENTRIES);\n var mix = frames[frame + IkConstraintTimeline.PREV_MIX];\n var softness = frames[frame + IkConstraintTimeline.PREV_SOFTNESS];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / IkConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + IkConstraintTimeline.PREV_TIME] - frameTime));\n if (blend == MixBlend.setup) {\n constraint.mix = constraint.data.mix + (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.data.mix) * alpha;\n constraint.softness = constraint.data.softness\n + (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.data.softness) * alpha;\n if (direction == MixDirection.mixOut) {\n constraint.bendDirection = constraint.data.bendDirection;\n constraint.compress = constraint.data.compress;\n constraint.stretch = constraint.data.stretch;\n }\n else {\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\n }\n }\n else {\n constraint.mix += (mix + (frames[frame + IkConstraintTimeline.MIX] - mix) * percent - constraint.mix) * alpha;\n constraint.softness += (softness + (frames[frame + IkConstraintTimeline.SOFTNESS] - softness) * percent - constraint.softness) * alpha;\n if (direction == MixDirection.mixIn) {\n constraint.bendDirection = frames[frame + IkConstraintTimeline.PREV_BEND_DIRECTION];\n constraint.compress = frames[frame + IkConstraintTimeline.PREV_COMPRESS] != 0;\n constraint.stretch = frames[frame + IkConstraintTimeline.PREV_STRETCH] != 0;\n }\n }\n };\n IkConstraintTimeline.ENTRIES = 6;\n IkConstraintTimeline.PREV_TIME = -6;\n IkConstraintTimeline.PREV_MIX = -5;\n IkConstraintTimeline.PREV_SOFTNESS = -4;\n IkConstraintTimeline.PREV_BEND_DIRECTION = -3;\n IkConstraintTimeline.PREV_COMPRESS = -2;\n IkConstraintTimeline.PREV_STRETCH = -1;\n IkConstraintTimeline.MIX = 1;\n IkConstraintTimeline.SOFTNESS = 2;\n IkConstraintTimeline.BEND_DIRECTION = 3;\n IkConstraintTimeline.COMPRESS = 4;\n IkConstraintTimeline.STRETCH = 5;\n return IkConstraintTimeline;\n }(CurveTimeline));\n spine.IkConstraintTimeline = IkConstraintTimeline;\n var TransformConstraintTimeline = (function (_super) {\n __extends(TransformConstraintTimeline, _super);\n function TransformConstraintTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount * TransformConstraintTimeline.ENTRIES);\n return _this;\n }\n TransformConstraintTimeline.prototype.getPropertyId = function () {\n return (TimelineType.transformConstraint << 24) + this.transformConstraintIndex;\n };\n TransformConstraintTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix, scaleMix, shearMix) {\n frameIndex *= TransformConstraintTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + TransformConstraintTimeline.ROTATE] = rotateMix;\n this.frames[frameIndex + TransformConstraintTimeline.TRANSLATE] = translateMix;\n this.frames[frameIndex + TransformConstraintTimeline.SCALE] = scaleMix;\n this.frames[frameIndex + TransformConstraintTimeline.SHEAR] = shearMix;\n };\n TransformConstraintTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n var frames = this.frames;\n var constraint = skeleton.transformConstraints[this.transformConstraintIndex];\n if (!constraint.active)\n return;\n if (time < frames[0]) {\n var data = constraint.data;\n switch (blend) {\n case MixBlend.setup:\n constraint.rotateMix = data.rotateMix;\n constraint.translateMix = data.translateMix;\n constraint.scaleMix = data.scaleMix;\n constraint.shearMix = data.shearMix;\n return;\n case MixBlend.first:\n constraint.rotateMix += (data.rotateMix - constraint.rotateMix) * alpha;\n constraint.translateMix += (data.translateMix - constraint.translateMix) * alpha;\n constraint.scaleMix += (data.scaleMix - constraint.scaleMix) * alpha;\n constraint.shearMix += (data.shearMix - constraint.shearMix) * alpha;\n }\n return;\n }\n var rotate = 0, translate = 0, scale = 0, shear = 0;\n if (time >= frames[frames.length - TransformConstraintTimeline.ENTRIES]) {\n var i = frames.length;\n rotate = frames[i + TransformConstraintTimeline.PREV_ROTATE];\n translate = frames[i + TransformConstraintTimeline.PREV_TRANSLATE];\n scale = frames[i + TransformConstraintTimeline.PREV_SCALE];\n shear = frames[i + TransformConstraintTimeline.PREV_SHEAR];\n }\n else {\n var frame = Animation.binarySearch(frames, time, TransformConstraintTimeline.ENTRIES);\n rotate = frames[frame + TransformConstraintTimeline.PREV_ROTATE];\n translate = frames[frame + TransformConstraintTimeline.PREV_TRANSLATE];\n scale = frames[frame + TransformConstraintTimeline.PREV_SCALE];\n shear = frames[frame + TransformConstraintTimeline.PREV_SHEAR];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / TransformConstraintTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + TransformConstraintTimeline.PREV_TIME] - frameTime));\n rotate += (frames[frame + TransformConstraintTimeline.ROTATE] - rotate) * percent;\n translate += (frames[frame + TransformConstraintTimeline.TRANSLATE] - translate) * percent;\n scale += (frames[frame + TransformConstraintTimeline.SCALE] - scale) * percent;\n shear += (frames[frame + TransformConstraintTimeline.SHEAR] - shear) * percent;\n }\n if (blend == MixBlend.setup) {\n var data = constraint.data;\n constraint.rotateMix = data.rotateMix + (rotate - data.rotateMix) * alpha;\n constraint.translateMix = data.translateMix + (translate - data.translateMix) * alpha;\n constraint.scaleMix = data.scaleMix + (scale - data.scaleMix) * alpha;\n constraint.shearMix = data.shearMix + (shear - data.shearMix) * alpha;\n }\n else {\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\n constraint.scaleMix += (scale - constraint.scaleMix) * alpha;\n constraint.shearMix += (shear - constraint.shearMix) * alpha;\n }\n };\n TransformConstraintTimeline.ENTRIES = 5;\n TransformConstraintTimeline.PREV_TIME = -5;\n TransformConstraintTimeline.PREV_ROTATE = -4;\n TransformConstraintTimeline.PREV_TRANSLATE = -3;\n TransformConstraintTimeline.PREV_SCALE = -2;\n TransformConstraintTimeline.PREV_SHEAR = -1;\n TransformConstraintTimeline.ROTATE = 1;\n TransformConstraintTimeline.TRANSLATE = 2;\n TransformConstraintTimeline.SCALE = 3;\n TransformConstraintTimeline.SHEAR = 4;\n return TransformConstraintTimeline;\n }(CurveTimeline));\n spine.TransformConstraintTimeline = TransformConstraintTimeline;\n var PathConstraintPositionTimeline = (function (_super) {\n __extends(PathConstraintPositionTimeline, _super);\n function PathConstraintPositionTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintPositionTimeline.ENTRIES);\n return _this;\n }\n PathConstraintPositionTimeline.prototype.getPropertyId = function () {\n return (TimelineType.pathConstraintPosition << 24) + this.pathConstraintIndex;\n };\n PathConstraintPositionTimeline.prototype.setFrame = function (frameIndex, time, value) {\n frameIndex *= PathConstraintPositionTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + PathConstraintPositionTimeline.VALUE] = value;\n };\n PathConstraintPositionTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n var frames = this.frames;\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\n if (!constraint.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n constraint.position = constraint.data.position;\n return;\n case MixBlend.first:\n constraint.position += (constraint.data.position - constraint.position) * alpha;\n }\n return;\n }\n var position = 0;\n if (time >= frames[frames.length - PathConstraintPositionTimeline.ENTRIES])\n position = frames[frames.length + PathConstraintPositionTimeline.PREV_VALUE];\n else {\n var frame = Animation.binarySearch(frames, time, PathConstraintPositionTimeline.ENTRIES);\n position = frames[frame + PathConstraintPositionTimeline.PREV_VALUE];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / PathConstraintPositionTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintPositionTimeline.PREV_TIME] - frameTime));\n position += (frames[frame + PathConstraintPositionTimeline.VALUE] - position) * percent;\n }\n if (blend == MixBlend.setup)\n constraint.position = constraint.data.position + (position - constraint.data.position) * alpha;\n else\n constraint.position += (position - constraint.position) * alpha;\n };\n PathConstraintPositionTimeline.ENTRIES = 2;\n PathConstraintPositionTimeline.PREV_TIME = -2;\n PathConstraintPositionTimeline.PREV_VALUE = -1;\n PathConstraintPositionTimeline.VALUE = 1;\n return PathConstraintPositionTimeline;\n }(CurveTimeline));\n spine.PathConstraintPositionTimeline = PathConstraintPositionTimeline;\n var PathConstraintSpacingTimeline = (function (_super) {\n __extends(PathConstraintSpacingTimeline, _super);\n function PathConstraintSpacingTimeline(frameCount) {\n return _super.call(this, frameCount) || this;\n }\n PathConstraintSpacingTimeline.prototype.getPropertyId = function () {\n return (TimelineType.pathConstraintSpacing << 24) + this.pathConstraintIndex;\n };\n PathConstraintSpacingTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n var frames = this.frames;\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\n if (!constraint.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n constraint.spacing = constraint.data.spacing;\n return;\n case MixBlend.first:\n constraint.spacing += (constraint.data.spacing - constraint.spacing) * alpha;\n }\n return;\n }\n var spacing = 0;\n if (time >= frames[frames.length - PathConstraintSpacingTimeline.ENTRIES])\n spacing = frames[frames.length + PathConstraintSpacingTimeline.PREV_VALUE];\n else {\n var frame = Animation.binarySearch(frames, time, PathConstraintSpacingTimeline.ENTRIES);\n spacing = frames[frame + PathConstraintSpacingTimeline.PREV_VALUE];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / PathConstraintSpacingTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintSpacingTimeline.PREV_TIME] - frameTime));\n spacing += (frames[frame + PathConstraintSpacingTimeline.VALUE] - spacing) * percent;\n }\n if (blend == MixBlend.setup)\n constraint.spacing = constraint.data.spacing + (spacing - constraint.data.spacing) * alpha;\n else\n constraint.spacing += (spacing - constraint.spacing) * alpha;\n };\n return PathConstraintSpacingTimeline;\n }(PathConstraintPositionTimeline));\n spine.PathConstraintSpacingTimeline = PathConstraintSpacingTimeline;\n var PathConstraintMixTimeline = (function (_super) {\n __extends(PathConstraintMixTimeline, _super);\n function PathConstraintMixTimeline(frameCount) {\n var _this = _super.call(this, frameCount) || this;\n _this.frames = spine.Utils.newFloatArray(frameCount * PathConstraintMixTimeline.ENTRIES);\n return _this;\n }\n PathConstraintMixTimeline.prototype.getPropertyId = function () {\n return (TimelineType.pathConstraintMix << 24) + this.pathConstraintIndex;\n };\n PathConstraintMixTimeline.prototype.setFrame = function (frameIndex, time, rotateMix, translateMix) {\n frameIndex *= PathConstraintMixTimeline.ENTRIES;\n this.frames[frameIndex] = time;\n this.frames[frameIndex + PathConstraintMixTimeline.ROTATE] = rotateMix;\n this.frames[frameIndex + PathConstraintMixTimeline.TRANSLATE] = translateMix;\n };\n PathConstraintMixTimeline.prototype.apply = function (skeleton, lastTime, time, firedEvents, alpha, blend, direction) {\n var frames = this.frames;\n var constraint = skeleton.pathConstraints[this.pathConstraintIndex];\n if (!constraint.active)\n return;\n if (time < frames[0]) {\n switch (blend) {\n case MixBlend.setup:\n constraint.rotateMix = constraint.data.rotateMix;\n constraint.translateMix = constraint.data.translateMix;\n return;\n case MixBlend.first:\n constraint.rotateMix += (constraint.data.rotateMix - constraint.rotateMix) * alpha;\n constraint.translateMix += (constraint.data.translateMix - constraint.translateMix) * alpha;\n }\n return;\n }\n var rotate = 0, translate = 0;\n if (time >= frames[frames.length - PathConstraintMixTimeline.ENTRIES]) {\n rotate = frames[frames.length + PathConstraintMixTimeline.PREV_ROTATE];\n translate = frames[frames.length + PathConstraintMixTimeline.PREV_TRANSLATE];\n }\n else {\n var frame = Animation.binarySearch(frames, time, PathConstraintMixTimeline.ENTRIES);\n rotate = frames[frame + PathConstraintMixTimeline.PREV_ROTATE];\n translate = frames[frame + PathConstraintMixTimeline.PREV_TRANSLATE];\n var frameTime = frames[frame];\n var percent = this.getCurvePercent(frame / PathConstraintMixTimeline.ENTRIES - 1, 1 - (time - frameTime) / (frames[frame + PathConstraintMixTimeline.PREV_TIME] - frameTime));\n rotate += (frames[frame + PathConstraintMixTimeline.ROTATE] - rotate) * percent;\n translate += (frames[frame + PathConstraintMixTimeline.TRANSLATE] - translate) * percent;\n }\n if (blend == MixBlend.setup) {\n constraint.rotateMix = constraint.data.rotateMix + (rotate - constraint.data.rotateMix) * alpha;\n constraint.translateMix = constraint.data.translateMix + (translate - constraint.data.translateMix) * alpha;\n }\n else {\n constraint.rotateMix += (rotate - constraint.rotateMix) * alpha;\n constraint.translateMix += (translate - constraint.translateMix) * alpha;\n }\n };\n PathConstraintMixTimeline.ENTRIES = 3;\n PathConstraintMixTimeline.PREV_TIME = -3;\n PathConstraintMixTimeline.PREV_ROTATE = -2;\n PathConstraintMixTimeline.PREV_TRANSLATE = -1;\n PathConstraintMixTimeline.ROTATE = 1;\n PathConstraintMixTimeline.TRANSLATE = 2;\n return PathConstraintMixTimeline;\n }(CurveTimeline));\n spine.PathConstraintMixTimeline = PathConstraintMixTimeline;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var AnimationState = (function () {\n function AnimationState(data) {\n this.tracks = new Array();\n this.timeScale = 1;\n this.unkeyedState = 0;\n this.events = new Array();\n this.listeners = new Array();\n this.queue = new EventQueue(this);\n this.propertyIDs = new spine.IntSet();\n this.animationsChanged = false;\n this.trackEntryPool = new spine.Pool(function () { return new TrackEntry(); });\n this.data = data;\n }\n AnimationState.prototype.update = function (delta) {\n delta *= this.timeScale;\n var tracks = this.tracks;\n for (var i = 0, n = tracks.length; i < n; i++) {\n var current = tracks[i];\n if (current == null)\n continue;\n current.animationLast = current.nextAnimationLast;\n current.trackLast = current.nextTrackLast;\n var currentDelta = delta * current.timeScale;\n if (current.delay > 0) {\n current.delay -= currentDelta;\n if (current.delay > 0)\n continue;\n currentDelta = -current.delay;\n current.delay = 0;\n }\n var next = current.next;\n if (next != null) {\n var nextTime = current.trackLast - next.delay;\n if (nextTime >= 0) {\n next.delay = 0;\n next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\n current.trackTime += currentDelta;\n this.setCurrent(i, next, true);\n while (next.mixingFrom != null) {\n next.mixTime += delta;\n next = next.mixingFrom;\n }\n continue;\n }\n }\n else if (current.trackLast >= current.trackEnd && current.mixingFrom == null) {\n tracks[i] = null;\n this.queue.end(current);\n this.disposeNext(current);\n continue;\n }\n if (current.mixingFrom != null && this.updateMixingFrom(current, delta)) {\n var from = current.mixingFrom;\n current.mixingFrom = null;\n if (from != null)\n from.mixingTo = null;\n while (from != null) {\n this.queue.end(from);\n from = from.mixingFrom;\n }\n }\n current.trackTime += currentDelta;\n }\n this.queue.drain();\n };\n AnimationState.prototype.updateMixingFrom = function (to, delta) {\n var from = to.mixingFrom;\n if (from == null)\n return true;\n var finished = this.updateMixingFrom(from, delta);\n from.animationLast = from.nextAnimationLast;\n from.trackLast = from.nextTrackLast;\n if (to.mixTime > 0 && to.mixTime >= to.mixDuration) {\n if (from.totalAlpha == 0 || to.mixDuration == 0) {\n to.mixingFrom = from.mixingFrom;\n if (from.mixingFrom != null)\n from.mixingFrom.mixingTo = to;\n to.interruptAlpha = from.interruptAlpha;\n this.queue.end(from);\n }\n return finished;\n }\n from.trackTime += delta * from.timeScale;\n to.mixTime += delta;\n return false;\n };\n AnimationState.prototype.apply = function (skeleton) {\n if (skeleton == null)\n throw new Error(\"skeleton cannot be null.\");\n if (this.animationsChanged)\n this._animationsChanged();\n var events = this.events;\n var tracks = this.tracks;\n var applied = false;\n for (var i_16 = 0, n_1 = tracks.length; i_16 < n_1; i_16++) {\n var current = tracks[i_16];\n if (current == null || current.delay > 0)\n continue;\n applied = true;\n var blend = i_16 == 0 ? spine.MixBlend.first : current.mixBlend;\n var mix = current.alpha;\n if (current.mixingFrom != null)\n mix *= this.applyMixingFrom(current, skeleton, blend);\n else if (current.trackTime >= current.trackEnd && current.next == null)\n mix = 0;\n var animationLast = current.animationLast, animationTime = current.getAnimationTime();\n var timelineCount = current.animation.timelines.length;\n var timelines = current.animation.timelines;\n if ((i_16 == 0 && mix == 1) || blend == spine.MixBlend.add) {\n for (var ii = 0; ii < timelineCount; ii++) {\n spine.Utils.webkit602BugfixHelper(mix, blend);\n var timeline = timelines[ii];\n if (timeline instanceof spine.AttachmentTimeline)\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, blend, true);\n else\n timeline.apply(skeleton, animationLast, animationTime, events, mix, blend, spine.MixDirection.mixIn);\n }\n }\n else {\n var timelineMode = current.timelineMode;\n var firstFrame = current.timelinesRotation.length == 0;\n if (firstFrame)\n spine.Utils.setArraySize(current.timelinesRotation, timelineCount << 1, null);\n var timelinesRotation = current.timelinesRotation;\n for (var ii = 0; ii < timelineCount; ii++) {\n var timeline_1 = timelines[ii];\n var timelineBlend = timelineMode[ii] == AnimationState.SUBSEQUENT ? blend : spine.MixBlend.setup;\n if (timeline_1 instanceof spine.RotateTimeline) {\n this.applyRotateTimeline(timeline_1, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, firstFrame);\n }\n else if (timeline_1 instanceof spine.AttachmentTimeline) {\n this.applyAttachmentTimeline(timeline_1, skeleton, animationTime, blend, true);\n }\n else {\n spine.Utils.webkit602BugfixHelper(mix, blend);\n timeline_1.apply(skeleton, animationLast, animationTime, events, mix, timelineBlend, spine.MixDirection.mixIn);\n }\n }\n }\n this.queueEvents(current, animationTime);\n events.length = 0;\n current.nextAnimationLast = animationTime;\n current.nextTrackLast = current.trackTime;\n }\n var setupState = this.unkeyedState + AnimationState.SETUP;\n var slots = skeleton.slots;\n for (var i = 0, n = skeleton.slots.length; i < n; i++) {\n var slot = slots[i];\n if (slot.attachmentState == setupState) {\n var attachmentName = slot.data.attachmentName;\n slot.attachment = (attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n }\n }\n this.unkeyedState += 2;\n this.queue.drain();\n return applied;\n };\n AnimationState.prototype.applyMixingFrom = function (to, skeleton, blend) {\n var from = to.mixingFrom;\n if (from.mixingFrom != null)\n this.applyMixingFrom(from, skeleton, blend);\n var mix = 0;\n if (to.mixDuration == 0) {\n mix = 1;\n if (blend == spine.MixBlend.first)\n blend = spine.MixBlend.setup;\n }\n else {\n mix = to.mixTime / to.mixDuration;\n if (mix > 1)\n mix = 1;\n if (blend != spine.MixBlend.first)\n blend = from.mixBlend;\n }\n var events = mix < from.eventThreshold ? this.events : null;\n var attachments = mix < from.attachmentThreshold, drawOrder = mix < from.drawOrderThreshold;\n var animationLast = from.animationLast, animationTime = from.getAnimationTime();\n var timelineCount = from.animation.timelines.length;\n var timelines = from.animation.timelines;\n var alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\n if (blend == spine.MixBlend.add) {\n for (var i = 0; i < timelineCount; i++)\n timelines[i].apply(skeleton, animationLast, animationTime, events, alphaMix, blend, spine.MixDirection.mixOut);\n }\n else {\n var timelineMode = from.timelineMode;\n var timelineHoldMix = from.timelineHoldMix;\n var firstFrame = from.timelinesRotation.length == 0;\n if (firstFrame)\n spine.Utils.setArraySize(from.timelinesRotation, timelineCount << 1, null);\n var timelinesRotation = from.timelinesRotation;\n from.totalAlpha = 0;\n for (var i = 0; i < timelineCount; i++) {\n var timeline = timelines[i];\n var direction = spine.MixDirection.mixOut;\n var timelineBlend = void 0;\n var alpha = 0;\n switch (timelineMode[i]) {\n case AnimationState.SUBSEQUENT:\n if (!drawOrder && timeline instanceof spine.DrawOrderTimeline)\n continue;\n timelineBlend = blend;\n alpha = alphaMix;\n break;\n case AnimationState.FIRST:\n timelineBlend = spine.MixBlend.setup;\n alpha = alphaMix;\n break;\n case AnimationState.HOLD_SUBSEQUENT:\n timelineBlend = blend;\n alpha = alphaHold;\n break;\n case AnimationState.HOLD_FIRST:\n timelineBlend = spine.MixBlend.setup;\n alpha = alphaHold;\n break;\n default:\n timelineBlend = spine.MixBlend.setup;\n var holdMix = timelineHoldMix[i];\n alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\n break;\n }\n from.totalAlpha += alpha;\n if (timeline instanceof spine.RotateTimeline)\n this.applyRotateTimeline(timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, firstFrame);\n else if (timeline instanceof spine.AttachmentTimeline)\n this.applyAttachmentTimeline(timeline, skeleton, animationTime, timelineBlend, attachments);\n else {\n spine.Utils.webkit602BugfixHelper(alpha, blend);\n if (drawOrder && timeline instanceof spine.DrawOrderTimeline && timelineBlend == spine.MixBlend.setup)\n direction = spine.MixDirection.mixIn;\n timeline.apply(skeleton, animationLast, animationTime, events, alpha, timelineBlend, direction);\n }\n }\n }\n if (to.mixDuration > 0)\n this.queueEvents(from, animationTime);\n this.events.length = 0;\n from.nextAnimationLast = animationTime;\n from.nextTrackLast = from.trackTime;\n return mix;\n };\n AnimationState.prototype.applyAttachmentTimeline = function (timeline, skeleton, time, blend, attachments) {\n var slot = skeleton.slots[timeline.slotIndex];\n if (!slot.bone.active)\n return;\n var frames = timeline.frames;\n if (time < frames[0]) {\n if (blend == spine.MixBlend.setup || blend == spine.MixBlend.first)\n this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\n }\n else {\n var frameIndex;\n if (time >= frames[frames.length - 1])\n frameIndex = frames.length - 1;\n else\n frameIndex = spine.Animation.binarySearch(frames, time) - 1;\n this.setAttachment(skeleton, slot, timeline.attachmentNames[frameIndex], attachments);\n }\n if (slot.attachmentState <= this.unkeyedState)\n slot.attachmentState = this.unkeyedState + AnimationState.SETUP;\n };\n AnimationState.prototype.setAttachment = function (skeleton, slot, attachmentName, attachments) {\n slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName);\n if (attachments)\n slot.attachmentState = this.unkeyedState + AnimationState.CURRENT;\n };\n AnimationState.prototype.applyRotateTimeline = function (timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) {\n if (firstFrame)\n timelinesRotation[i] = 0;\n if (alpha == 1) {\n timeline.apply(skeleton, 0, time, null, 1, blend, spine.MixDirection.mixIn);\n return;\n }\n var rotateTimeline = timeline;\n var frames = rotateTimeline.frames;\n var bone = skeleton.bones[rotateTimeline.boneIndex];\n if (!bone.active)\n return;\n var r1 = 0, r2 = 0;\n if (time < frames[0]) {\n switch (blend) {\n case spine.MixBlend.setup:\n bone.rotation = bone.data.rotation;\n default:\n return;\n case spine.MixBlend.first:\n r1 = bone.rotation;\n r2 = bone.data.rotation;\n }\n }\n else {\n r1 = blend == spine.MixBlend.setup ? bone.data.rotation : bone.rotation;\n if (time >= frames[frames.length - spine.RotateTimeline.ENTRIES])\n r2 = bone.data.rotation + frames[frames.length + spine.RotateTimeline.PREV_ROTATION];\n else {\n var frame = spine.Animation.binarySearch(frames, time, spine.RotateTimeline.ENTRIES);\n var prevRotation = frames[frame + spine.RotateTimeline.PREV_ROTATION];\n var frameTime = frames[frame];\n var percent = rotateTimeline.getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + spine.RotateTimeline.PREV_TIME] - frameTime));\n r2 = frames[frame + spine.RotateTimeline.ROTATION] - prevRotation;\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\n r2 = prevRotation + r2 * percent + bone.data.rotation;\n r2 -= (16384 - ((16384.499999999996 - r2 / 360) | 0)) * 360;\n }\n }\n var total = 0, diff = r2 - r1;\n diff -= (16384 - ((16384.499999999996 - diff / 360) | 0)) * 360;\n if (diff == 0) {\n total = timelinesRotation[i];\n }\n else {\n var lastTotal = 0, lastDiff = 0;\n if (firstFrame) {\n lastTotal = 0;\n lastDiff = diff;\n }\n else {\n lastTotal = timelinesRotation[i];\n lastDiff = timelinesRotation[i + 1];\n }\n var current = diff > 0, dir = lastTotal >= 0;\n if (spine.MathUtils.signum(lastDiff) != spine.MathUtils.signum(diff) && Math.abs(lastDiff) <= 90) {\n if (Math.abs(lastTotal) > 180)\n lastTotal += 360 * spine.MathUtils.signum(lastTotal);\n dir = current;\n }\n total = diff + lastTotal - lastTotal % 360;\n if (dir != current)\n total += 360 * spine.MathUtils.signum(lastTotal);\n timelinesRotation[i] = total;\n }\n timelinesRotation[i + 1] = diff;\n r1 += total * alpha;\n bone.rotation = r1 - (16384 - ((16384.499999999996 - r1 / 360) | 0)) * 360;\n };\n AnimationState.prototype.queueEvents = function (entry, animationTime) {\n var animationStart = entry.animationStart, animationEnd = entry.animationEnd;\n var duration = animationEnd - animationStart;\n var trackLastWrapped = entry.trackLast % duration;\n var events = this.events;\n var i = 0, n = events.length;\n for (; i < n; i++) {\n var event_1 = events[i];\n if (event_1.time < trackLastWrapped)\n break;\n if (event_1.time > animationEnd)\n continue;\n this.queue.event(entry, event_1);\n }\n var complete = false;\n if (entry.loop)\n complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;\n else\n complete = animationTime >= animationEnd && entry.animationLast < animationEnd;\n if (complete)\n this.queue.complete(entry);\n for (; i < n; i++) {\n var event_2 = events[i];\n if (event_2.time < animationStart)\n continue;\n this.queue.event(entry, events[i]);\n }\n };\n AnimationState.prototype.clearTracks = function () {\n var oldDrainDisabled = this.queue.drainDisabled;\n this.queue.drainDisabled = true;\n for (var i = 0, n = this.tracks.length; i < n; i++)\n this.clearTrack(i);\n this.tracks.length = 0;\n this.queue.drainDisabled = oldDrainDisabled;\n this.queue.drain();\n };\n AnimationState.prototype.clearTrack = function (trackIndex) {\n if (trackIndex >= this.tracks.length)\n return;\n var current = this.tracks[trackIndex];\n if (current == null)\n return;\n this.queue.end(current);\n this.disposeNext(current);\n var entry = current;\n while (true) {\n var from = entry.mixingFrom;\n if (from == null)\n break;\n this.queue.end(from);\n entry.mixingFrom = null;\n entry.mixingTo = null;\n entry = from;\n }\n this.tracks[current.trackIndex] = null;\n this.queue.drain();\n };\n AnimationState.prototype.setCurrent = function (index, current, interrupt) {\n var from = this.expandToIndex(index);\n this.tracks[index] = current;\n if (from != null) {\n if (interrupt)\n this.queue.interrupt(from);\n current.mixingFrom = from;\n from.mixingTo = current;\n current.mixTime = 0;\n if (from.mixingFrom != null && from.mixDuration > 0)\n current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\n from.timelinesRotation.length = 0;\n }\n this.queue.start(current);\n };\n AnimationState.prototype.setAnimation = function (trackIndex, animationName, loop) {\n var animation = this.data.skeletonData.findAnimation(animationName);\n if (animation == null)\n throw new Error(\"Animation not found: \" + animationName);\n return this.setAnimationWith(trackIndex, animation, loop);\n };\n AnimationState.prototype.setAnimationWith = function (trackIndex, animation, loop) {\n if (animation == null)\n throw new Error(\"animation cannot be null.\");\n var interrupt = true;\n var current = this.expandToIndex(trackIndex);\n if (current != null) {\n if (current.nextTrackLast == -1) {\n this.tracks[trackIndex] = current.mixingFrom;\n this.queue.interrupt(current);\n this.queue.end(current);\n this.disposeNext(current);\n current = current.mixingFrom;\n interrupt = false;\n }\n else\n this.disposeNext(current);\n }\n var entry = this.trackEntry(trackIndex, animation, loop, current);\n this.setCurrent(trackIndex, entry, interrupt);\n this.queue.drain();\n return entry;\n };\n AnimationState.prototype.addAnimation = function (trackIndex, animationName, loop, delay) {\n var animation = this.data.skeletonData.findAnimation(animationName);\n if (animation == null)\n throw new Error(\"Animation not found: \" + animationName);\n return this.addAnimationWith(trackIndex, animation, loop, delay);\n };\n AnimationState.prototype.addAnimationWith = function (trackIndex, animation, loop, delay) {\n if (animation == null)\n throw new Error(\"animation cannot be null.\");\n var last = this.expandToIndex(trackIndex);\n if (last != null) {\n while (last.next != null)\n last = last.next;\n }\n var entry = this.trackEntry(trackIndex, animation, loop, last);\n if (last == null) {\n this.setCurrent(trackIndex, entry, true);\n this.queue.drain();\n }\n else {\n last.next = entry;\n if (delay <= 0) {\n var duration = last.animationEnd - last.animationStart;\n if (duration != 0) {\n if (last.loop)\n delay += duration * (1 + ((last.trackTime / duration) | 0));\n else\n delay += Math.max(duration, last.trackTime);\n delay -= this.data.getMix(last.animation, animation);\n }\n else\n delay = last.trackTime;\n }\n }\n entry.delay = delay;\n return entry;\n };\n AnimationState.prototype.setEmptyAnimation = function (trackIndex, mixDuration) {\n var entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation, false);\n entry.mixDuration = mixDuration;\n entry.trackEnd = mixDuration;\n return entry;\n };\n AnimationState.prototype.addEmptyAnimation = function (trackIndex, mixDuration, delay) {\n if (delay <= 0)\n delay -= mixDuration;\n var entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation, false, delay);\n entry.mixDuration = mixDuration;\n entry.trackEnd = mixDuration;\n return entry;\n };\n AnimationState.prototype.setEmptyAnimations = function (mixDuration) {\n var oldDrainDisabled = this.queue.drainDisabled;\n this.queue.drainDisabled = true;\n for (var i = 0, n = this.tracks.length; i < n; i++) {\n var current = this.tracks[i];\n if (current != null)\n this.setEmptyAnimation(current.trackIndex, mixDuration);\n }\n this.queue.drainDisabled = oldDrainDisabled;\n this.queue.drain();\n };\n AnimationState.prototype.expandToIndex = function (index) {\n if (index < this.tracks.length)\n return this.tracks[index];\n spine.Utils.ensureArrayCapacity(this.tracks, index + 1, null);\n this.tracks.length = index + 1;\n return null;\n };\n AnimationState.prototype.trackEntry = function (trackIndex, animation, loop, last) {\n var entry = this.trackEntryPool.obtain();\n entry.trackIndex = trackIndex;\n entry.animation = animation;\n entry.loop = loop;\n entry.holdPrevious = false;\n entry.eventThreshold = 0;\n entry.attachmentThreshold = 0;\n entry.drawOrderThreshold = 0;\n entry.animationStart = 0;\n entry.animationEnd = animation.duration;\n entry.animationLast = -1;\n entry.nextAnimationLast = -1;\n entry.delay = 0;\n entry.trackTime = 0;\n entry.trackLast = -1;\n entry.nextTrackLast = -1;\n entry.trackEnd = Number.MAX_VALUE;\n entry.timeScale = 1;\n entry.alpha = 1;\n entry.interruptAlpha = 1;\n entry.mixTime = 0;\n entry.mixDuration = last == null ? 0 : this.data.getMix(last.animation, animation);\n entry.mixBlend = spine.MixBlend.replace;\n return entry;\n };\n AnimationState.prototype.disposeNext = function (entry) {\n var next = entry.next;\n while (next != null) {\n this.queue.dispose(next);\n next = next.next;\n }\n entry.next = null;\n };\n AnimationState.prototype._animationsChanged = function () {\n this.animationsChanged = false;\n this.propertyIDs.clear();\n for (var i = 0, n = this.tracks.length; i < n; i++) {\n var entry = this.tracks[i];\n if (entry == null)\n continue;\n while (entry.mixingFrom != null)\n entry = entry.mixingFrom;\n do {\n if (entry.mixingFrom == null || entry.mixBlend != spine.MixBlend.add)\n this.computeHold(entry);\n entry = entry.mixingTo;\n } while (entry != null);\n }\n };\n AnimationState.prototype.computeHold = function (entry) {\n var to = entry.mixingTo;\n var timelines = entry.animation.timelines;\n var timelinesCount = entry.animation.timelines.length;\n var timelineMode = spine.Utils.setArraySize(entry.timelineMode, timelinesCount);\n entry.timelineHoldMix.length = 0;\n var timelineDipMix = spine.Utils.setArraySize(entry.timelineHoldMix, timelinesCount);\n var propertyIDs = this.propertyIDs;\n if (to != null && to.holdPrevious) {\n for (var i = 0; i < timelinesCount; i++) {\n timelineMode[i] = propertyIDs.add(timelines[i].getPropertyId()) ? AnimationState.HOLD_FIRST : AnimationState.HOLD_SUBSEQUENT;\n }\n return;\n }\n outer: for (var i = 0; i < timelinesCount; i++) {\n var timeline = timelines[i];\n var id = timeline.getPropertyId();\n if (!propertyIDs.add(id))\n timelineMode[i] = AnimationState.SUBSEQUENT;\n else if (to == null || timeline instanceof spine.AttachmentTimeline || timeline instanceof spine.DrawOrderTimeline\n || timeline instanceof spine.EventTimeline || !to.animation.hasTimeline(id)) {\n timelineMode[i] = AnimationState.FIRST;\n }\n else {\n for (var next = to.mixingTo; next != null; next = next.mixingTo) {\n if (next.animation.hasTimeline(id))\n continue;\n if (entry.mixDuration > 0) {\n timelineMode[i] = AnimationState.HOLD_MIX;\n timelineDipMix[i] = next;\n continue outer;\n }\n break;\n }\n timelineMode[i] = AnimationState.HOLD_FIRST;\n }\n }\n };\n AnimationState.prototype.getCurrent = function (trackIndex) {\n if (trackIndex >= this.tracks.length)\n return null;\n return this.tracks[trackIndex];\n };\n AnimationState.prototype.addListener = function (listener) {\n if (listener == null)\n throw new Error(\"listener cannot be null.\");\n this.listeners.push(listener);\n };\n AnimationState.prototype.removeListener = function (listener) {\n var index = this.listeners.indexOf(listener);\n if (index >= 0)\n this.listeners.splice(index, 1);\n };\n AnimationState.prototype.clearListeners = function () {\n this.listeners.length = 0;\n };\n AnimationState.prototype.clearListenerNotifications = function () {\n this.queue.clear();\n };\n AnimationState.emptyAnimation = new spine.Animation(\"\", [], 0);\n AnimationState.SUBSEQUENT = 0;\n AnimationState.FIRST = 1;\n AnimationState.HOLD_SUBSEQUENT = 2;\n AnimationState.HOLD_FIRST = 3;\n AnimationState.HOLD_MIX = 4;\n AnimationState.SETUP = 1;\n AnimationState.CURRENT = 2;\n return AnimationState;\n }());\n spine.AnimationState = AnimationState;\n var TrackEntry = (function () {\n function TrackEntry() {\n this.mixBlend = spine.MixBlend.replace;\n this.timelineMode = new Array();\n this.timelineHoldMix = new Array();\n this.timelinesRotation = new Array();\n }\n TrackEntry.prototype.reset = function () {\n this.next = null;\n this.mixingFrom = null;\n this.mixingTo = null;\n this.animation = null;\n this.listener = null;\n this.timelineMode.length = 0;\n this.timelineHoldMix.length = 0;\n this.timelinesRotation.length = 0;\n };\n TrackEntry.prototype.getAnimationTime = function () {\n if (this.loop) {\n var duration = this.animationEnd - this.animationStart;\n if (duration == 0)\n return this.animationStart;\n return (this.trackTime % duration) + this.animationStart;\n }\n return Math.min(this.trackTime + this.animationStart, this.animationEnd);\n };\n TrackEntry.prototype.setAnimationLast = function (animationLast) {\n this.animationLast = animationLast;\n this.nextAnimationLast = animationLast;\n };\n TrackEntry.prototype.isComplete = function () {\n return this.trackTime >= this.animationEnd - this.animationStart;\n };\n TrackEntry.prototype.resetRotationDirections = function () {\n this.timelinesRotation.length = 0;\n };\n return TrackEntry;\n }());\n spine.TrackEntry = TrackEntry;\n var EventQueue = (function () {\n function EventQueue(animState) {\n this.objects = [];\n this.drainDisabled = false;\n this.animState = animState;\n }\n EventQueue.prototype.start = function (entry) {\n this.objects.push(EventType.start);\n this.objects.push(entry);\n this.animState.animationsChanged = true;\n };\n EventQueue.prototype.interrupt = function (entry) {\n this.objects.push(EventType.interrupt);\n this.objects.push(entry);\n };\n EventQueue.prototype.end = function (entry) {\n this.objects.push(EventType.end);\n this.objects.push(entry);\n this.animState.animationsChanged = true;\n };\n EventQueue.prototype.dispose = function (entry) {\n this.objects.push(EventType.dispose);\n this.objects.push(entry);\n };\n EventQueue.prototype.complete = function (entry) {\n this.objects.push(EventType.complete);\n this.objects.push(entry);\n };\n EventQueue.prototype.event = function (entry, event) {\n this.objects.push(EventType.event);\n this.objects.push(entry);\n this.objects.push(event);\n };\n EventQueue.prototype.drain = function () {\n if (this.drainDisabled)\n return;\n this.drainDisabled = true;\n var objects = this.objects;\n var listeners = this.animState.listeners;\n for (var i = 0; i < objects.length; i += 2) {\n var type = objects[i];\n var entry = objects[i + 1];\n switch (type) {\n case EventType.start:\n if (entry.listener != null && entry.listener.start)\n entry.listener.start(entry);\n for (var ii = 0; ii < listeners.length; ii++)\n if (listeners[ii].start)\n listeners[ii].start(entry);\n break;\n case EventType.interrupt:\n if (entry.listener != null && entry.listener.interrupt)\n entry.listener.interrupt(entry);\n for (var ii = 0; ii < listeners.length; ii++)\n if (listeners[ii].interrupt)\n listeners[ii].interrupt(entry);\n break;\n case EventType.end:\n if (entry.listener != null && entry.listener.end)\n entry.listener.end(entry);\n for (var ii = 0; ii < listeners.length; ii++)\n if (listeners[ii].end)\n listeners[ii].end(entry);\n case EventType.dispose:\n if (entry.listener != null && entry.listener.dispose)\n entry.listener.dispose(entry);\n for (var ii = 0; ii < listeners.length; ii++)\n if (listeners[ii].dispose)\n listeners[ii].dispose(entry);\n this.animState.trackEntryPool.free(entry);\n break;\n case EventType.complete:\n if (entry.listener != null && entry.listener.complete)\n entry.listener.complete(entry);\n for (var ii = 0; ii < listeners.length; ii++)\n if (listeners[ii].complete)\n listeners[ii].complete(entry);\n break;\n case EventType.event:\n var event_3 = objects[i++ + 2];\n if (entry.listener != null && entry.listener.event)\n entry.listener.event(entry, event_3);\n for (var ii = 0; ii < listeners.length; ii++)\n if (listeners[ii].event)\n listeners[ii].event(entry, event_3);\n break;\n }\n }\n this.clear();\n this.drainDisabled = false;\n };\n EventQueue.prototype.clear = function () {\n this.objects.length = 0;\n };\n return EventQueue;\n }());\n spine.EventQueue = EventQueue;\n var EventType;\n (function (EventType) {\n EventType[EventType[\"start\"] = 0] = \"start\";\n EventType[EventType[\"interrupt\"] = 1] = \"interrupt\";\n EventType[EventType[\"end\"] = 2] = \"end\";\n EventType[EventType[\"dispose\"] = 3] = \"dispose\";\n EventType[EventType[\"complete\"] = 4] = \"complete\";\n EventType[EventType[\"event\"] = 5] = \"event\";\n })(EventType = spine.EventType || (spine.EventType = {}));\n var AnimationStateAdapter = (function () {\n function AnimationStateAdapter() {\n }\n AnimationStateAdapter.prototype.start = function (entry) {\n };\n AnimationStateAdapter.prototype.interrupt = function (entry) {\n };\n AnimationStateAdapter.prototype.end = function (entry) {\n };\n AnimationStateAdapter.prototype.dispose = function (entry) {\n };\n AnimationStateAdapter.prototype.complete = function (entry) {\n };\n AnimationStateAdapter.prototype.event = function (entry, event) {\n };\n return AnimationStateAdapter;\n }());\n spine.AnimationStateAdapter = AnimationStateAdapter;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var AnimationStateData = (function () {\n function AnimationStateData(skeletonData) {\n this.animationToMixTime = {};\n this.defaultMix = 0;\n if (skeletonData == null)\n throw new Error(\"skeletonData cannot be null.\");\n this.skeletonData = skeletonData;\n }\n AnimationStateData.prototype.setMix = function (fromName, toName, duration) {\n var from = this.skeletonData.findAnimation(fromName);\n if (from == null)\n throw new Error(\"Animation not found: \" + fromName);\n var to = this.skeletonData.findAnimation(toName);\n if (to == null)\n throw new Error(\"Animation not found: \" + toName);\n this.setMixWith(from, to, duration);\n };\n AnimationStateData.prototype.setMixWith = function (from, to, duration) {\n if (from == null)\n throw new Error(\"from cannot be null.\");\n if (to == null)\n throw new Error(\"to cannot be null.\");\n var key = from.name + \".\" + to.name;\n this.animationToMixTime[key] = duration;\n };\n AnimationStateData.prototype.getMix = function (from, to) {\n var key = from.name + \".\" + to.name;\n var value = this.animationToMixTime[key];\n return value === undefined ? this.defaultMix : value;\n };\n return AnimationStateData;\n }());\n spine.AnimationStateData = AnimationStateData;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var AssetManager = (function () {\n function AssetManager(textureLoader, pathPrefix) {\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\n this.assets = {};\n this.errors = {};\n this.toLoad = 0;\n this.loaded = 0;\n this.rawDataUris = {};\n this.textureLoader = textureLoader;\n this.pathPrefix = pathPrefix;\n }\n AssetManager.prototype.downloadText = function (url, success, error) {\n var request = new XMLHttpRequest();\n request.overrideMimeType(\"text/html\");\n if (this.rawDataUris[url])\n url = this.rawDataUris[url];\n request.open(\"GET\", url, true);\n request.onload = function () {\n if (request.status == 200) {\n success(request.responseText);\n }\n else {\n error(request.status, request.responseText);\n }\n };\n request.onerror = function () {\n error(request.status, request.responseText);\n };\n request.send();\n };\n AssetManager.prototype.downloadBinary = function (url, success, error) {\n var request = new XMLHttpRequest();\n if (this.rawDataUris[url])\n url = this.rawDataUris[url];\n request.open(\"GET\", url, true);\n request.responseType = \"arraybuffer\";\n request.onload = function () {\n if (request.status == 200) {\n success(new Uint8Array(request.response));\n }\n else {\n error(request.status, request.responseText);\n }\n };\n request.onerror = function () {\n error(request.status, request.responseText);\n };\n request.send();\n };\n AssetManager.prototype.setRawDataURI = function (path, data) {\n this.rawDataUris[this.pathPrefix + path] = data;\n };\n AssetManager.prototype.loadBinary = function (path, success, error) {\n var _this = this;\n if (success === void 0) { success = null; }\n if (error === void 0) { error = null; }\n path = this.pathPrefix + path;\n this.toLoad++;\n this.downloadBinary(path, function (data) {\n _this.assets[path] = data;\n if (success)\n success(path, data);\n _this.toLoad--;\n _this.loaded++;\n }, function (state, responseText) {\n _this.errors[path] = \"Couldn't load binary \" + path + \": status \" + status + \", \" + responseText;\n if (error)\n error(path, \"Couldn't load binary \" + path + \": status \" + status + \", \" + responseText);\n _this.toLoad--;\n _this.loaded++;\n });\n };\n AssetManager.prototype.loadText = function (path, success, error) {\n var _this = this;\n if (success === void 0) { success = null; }\n if (error === void 0) { error = null; }\n path = this.pathPrefix + path;\n this.toLoad++;\n this.downloadText(path, function (data) {\n _this.assets[path] = data;\n if (success)\n success(path, data);\n _this.toLoad--;\n _this.loaded++;\n }, function (state, responseText) {\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText;\n if (error)\n error(path, \"Couldn't load text \" + path + \": status \" + status + \", \" + responseText);\n _this.toLoad--;\n _this.loaded++;\n });\n };\n AssetManager.prototype.loadTexture = function (path, success, error) {\n var _this = this;\n if (success === void 0) { success = null; }\n if (error === void 0) { error = null; }\n path = this.pathPrefix + path;\n var storagePath = path;\n this.toLoad++;\n var img = new Image();\n img.crossOrigin = \"anonymous\";\n img.onload = function (ev) {\n var texture = _this.textureLoader(img);\n _this.assets[storagePath] = texture;\n _this.toLoad--;\n _this.loaded++;\n if (success)\n success(path, img);\n };\n img.onerror = function (ev) {\n _this.errors[path] = \"Couldn't load image \" + path;\n _this.toLoad--;\n _this.loaded++;\n if (error)\n error(path, \"Couldn't load image \" + path);\n };\n if (this.rawDataUris[path])\n path = this.rawDataUris[path];\n img.src = path;\n };\n AssetManager.prototype.loadTextureAtlas = function (path, success, error) {\n var _this = this;\n if (success === void 0) { success = null; }\n if (error === void 0) { error = null; }\n var parent = path.lastIndexOf(\"/\") >= 0 ? path.substring(0, path.lastIndexOf(\"/\")) : \"\";\n path = this.pathPrefix + path;\n this.toLoad++;\n this.downloadText(path, function (atlasData) {\n var pagesLoaded = { count: 0 };\n var atlasPages = new Array();\n try {\n var atlas = new spine.TextureAtlas(atlasData, function (path) {\n atlasPages.push(parent == \"\" ? path : parent + \"/\" + path);\n var image = document.createElement(\"img\");\n image.width = 16;\n image.height = 16;\n return new spine.FakeTexture(image);\n });\n }\n catch (e) {\n var ex = e;\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\n if (error)\n error(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\n _this.toLoad--;\n _this.loaded++;\n return;\n }\n var _loop_1 = function (atlasPage) {\n var pageLoadError = false;\n _this.loadTexture(atlasPage, function (imagePath, image) {\n pagesLoaded.count++;\n if (pagesLoaded.count == atlasPages.length) {\n if (!pageLoadError) {\n try {\n var atlas = new spine.TextureAtlas(atlasData, function (path) {\n return _this.get(parent == \"\" ? path : parent + \"/\" + path);\n });\n _this.assets[path] = atlas;\n if (success)\n success(path, atlas);\n _this.toLoad--;\n _this.loaded++;\n }\n catch (e) {\n var ex = e;\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": \" + ex.message;\n if (error)\n error(path, \"Couldn't load texture atlas \" + path + \": \" + ex.message);\n _this.toLoad--;\n _this.loaded++;\n }\n }\n else {\n _this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\n if (error)\n error(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\n _this.toLoad--;\n _this.loaded++;\n }\n }\n }, function (imagePath, errorMessage) {\n pageLoadError = true;\n pagesLoaded.count++;\n if (pagesLoaded.count == atlasPages.length) {\n _this.errors[path] = \"Couldn't load texture atlas page \" + imagePath + \"} of atlas \" + path;\n if (error)\n error(path, \"Couldn't load texture atlas page \" + imagePath + \" of atlas \" + path);\n _this.toLoad--;\n _this.loaded++;\n }\n });\n };\n for (var _i = 0, atlasPages_1 = atlasPages; _i < atlasPages_1.length; _i++) {\n var atlasPage = atlasPages_1[_i];\n _loop_1(atlasPage);\n }\n }, function (state, responseText) {\n _this.errors[path] = \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText;\n if (error)\n error(path, \"Couldn't load texture atlas \" + path + \": status \" + status + \", \" + responseText);\n _this.toLoad--;\n _this.loaded++;\n });\n };\n AssetManager.prototype.get = function (path) {\n path = this.pathPrefix + path;\n return this.assets[path];\n };\n AssetManager.prototype.remove = function (path) {\n path = this.pathPrefix + path;\n var asset = this.assets[path];\n if (asset.dispose)\n asset.dispose();\n this.assets[path] = null;\n };\n AssetManager.prototype.removeAll = function () {\n for (var key in this.assets) {\n var asset = this.assets[key];\n if (asset.dispose)\n asset.dispose();\n }\n this.assets = {};\n };\n AssetManager.prototype.isLoadingComplete = function () {\n return this.toLoad == 0;\n };\n AssetManager.prototype.getToLoad = function () {\n return this.toLoad;\n };\n AssetManager.prototype.getLoaded = function () {\n return this.loaded;\n };\n AssetManager.prototype.dispose = function () {\n this.removeAll();\n };\n AssetManager.prototype.hasErrors = function () {\n return Object.keys(this.errors).length > 0;\n };\n AssetManager.prototype.getErrors = function () {\n return this.errors;\n };\n return AssetManager;\n }());\n spine.AssetManager = AssetManager;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var AtlasAttachmentLoader = (function () {\n function AtlasAttachmentLoader(atlas) {\n this.atlas = atlas;\n }\n AtlasAttachmentLoader.prototype.newRegionAttachment = function (skin, name, path) {\n var region = this.atlas.findRegion(path);\n if (region == null)\n throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\n region.renderObject = region;\n var attachment = new spine.RegionAttachment(name);\n attachment.setRegion(region);\n return attachment;\n };\n AtlasAttachmentLoader.prototype.newMeshAttachment = function (skin, name, path) {\n var region = this.atlas.findRegion(path);\n if (region == null)\n throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\n region.renderObject = region;\n var attachment = new spine.MeshAttachment(name);\n attachment.region = region;\n return attachment;\n };\n AtlasAttachmentLoader.prototype.newBoundingBoxAttachment = function (skin, name) {\n return new spine.BoundingBoxAttachment(name);\n };\n AtlasAttachmentLoader.prototype.newPathAttachment = function (skin, name) {\n return new spine.PathAttachment(name);\n };\n AtlasAttachmentLoader.prototype.newPointAttachment = function (skin, name) {\n return new spine.PointAttachment(name);\n };\n AtlasAttachmentLoader.prototype.newClippingAttachment = function (skin, name) {\n return new spine.ClippingAttachment(name);\n };\n return AtlasAttachmentLoader;\n }());\n spine.AtlasAttachmentLoader = AtlasAttachmentLoader;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var BlendMode;\n (function (BlendMode) {\n BlendMode[BlendMode[\"Normal\"] = 0] = \"Normal\";\n BlendMode[BlendMode[\"Additive\"] = 1] = \"Additive\";\n BlendMode[BlendMode[\"Multiply\"] = 2] = \"Multiply\";\n BlendMode[BlendMode[\"Screen\"] = 3] = \"Screen\";\n })(BlendMode = spine.BlendMode || (spine.BlendMode = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var Bone = (function () {\n function Bone(data, skeleton, parent) {\n this.children = new Array();\n this.x = 0;\n this.y = 0;\n this.rotation = 0;\n this.scaleX = 0;\n this.scaleY = 0;\n this.shearX = 0;\n this.shearY = 0;\n this.ax = 0;\n this.ay = 0;\n this.arotation = 0;\n this.ascaleX = 0;\n this.ascaleY = 0;\n this.ashearX = 0;\n this.ashearY = 0;\n this.appliedValid = false;\n this.a = 0;\n this.b = 0;\n this.c = 0;\n this.d = 0;\n this.worldY = 0;\n this.worldX = 0;\n this.sorted = false;\n this.active = false;\n if (data == null)\n throw new Error(\"data cannot be null.\");\n if (skeleton == null)\n throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.skeleton = skeleton;\n this.parent = parent;\n this.setToSetupPose();\n }\n Bone.prototype.isActive = function () {\n return this.active;\n };\n Bone.prototype.update = function () {\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n };\n Bone.prototype.updateWorldTransform = function () {\n this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n };\n Bone.prototype.updateWorldTransformWith = function (x, y, rotation, scaleX, scaleY, shearX, shearY) {\n this.ax = x;\n this.ay = y;\n this.arotation = rotation;\n this.ascaleX = scaleX;\n this.ascaleY = scaleY;\n this.ashearX = shearX;\n this.ashearY = shearY;\n this.appliedValid = true;\n var parent = this.parent;\n if (parent == null) {\n var skeleton = this.skeleton;\n var rotationY = rotation + 90 + shearY;\n var sx = skeleton.scaleX;\n var sy = skeleton.scaleY;\n this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX * sx;\n this.b = spine.MathUtils.cosDeg(rotationY) * scaleY * sx;\n this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX * sy;\n this.d = spine.MathUtils.sinDeg(rotationY) * scaleY * sy;\n this.worldX = x * sx + skeleton.x;\n this.worldY = y * sy + skeleton.y;\n return;\n }\n var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n this.worldX = pa * x + pb * y + parent.worldX;\n this.worldY = pc * x + pd * y + parent.worldY;\n switch (this.data.transformMode) {\n case spine.TransformMode.Normal: {\n var rotationY = rotation + 90 + shearY;\n var la = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\n var lb = spine.MathUtils.cosDeg(rotationY) * scaleY;\n var lc = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\n var ld = spine.MathUtils.sinDeg(rotationY) * scaleY;\n this.a = pa * la + pb * lc;\n this.b = pa * lb + pb * ld;\n this.c = pc * la + pd * lc;\n this.d = pc * lb + pd * ld;\n return;\n }\n case spine.TransformMode.OnlyTranslation: {\n var rotationY = rotation + 90 + shearY;\n this.a = spine.MathUtils.cosDeg(rotation + shearX) * scaleX;\n this.b = spine.MathUtils.cosDeg(rotationY) * scaleY;\n this.c = spine.MathUtils.sinDeg(rotation + shearX) * scaleX;\n this.d = spine.MathUtils.sinDeg(rotationY) * scaleY;\n break;\n }\n case spine.TransformMode.NoRotationOrReflection: {\n var s = pa * pa + pc * pc;\n var prx = 0;\n if (s > 0.0001) {\n s = Math.abs(pa * pd - pb * pc) / s;\n pa /= this.skeleton.scaleX;\n pc /= this.skeleton.scaleY;\n pb = pc * s;\n pd = pa * s;\n prx = Math.atan2(pc, pa) * spine.MathUtils.radDeg;\n }\n else {\n pa = 0;\n pc = 0;\n prx = 90 - Math.atan2(pd, pb) * spine.MathUtils.radDeg;\n }\n var rx = rotation + shearX - prx;\n var ry = rotation + shearY - prx + 90;\n var la = spine.MathUtils.cosDeg(rx) * scaleX;\n var lb = spine.MathUtils.cosDeg(ry) * scaleY;\n var lc = spine.MathUtils.sinDeg(rx) * scaleX;\n var ld = spine.MathUtils.sinDeg(ry) * scaleY;\n this.a = pa * la - pb * lc;\n this.b = pa * lb - pb * ld;\n this.c = pc * la + pd * lc;\n this.d = pc * lb + pd * ld;\n break;\n }\n case spine.TransformMode.NoScale:\n case spine.TransformMode.NoScaleOrReflection: {\n var cos = spine.MathUtils.cosDeg(rotation);\n var sin = spine.MathUtils.sinDeg(rotation);\n var za = (pa * cos + pb * sin) / this.skeleton.scaleX;\n var zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\n var s = Math.sqrt(za * za + zc * zc);\n if (s > 0.00001)\n s = 1 / s;\n za *= s;\n zc *= s;\n s = Math.sqrt(za * za + zc * zc);\n if (this.data.transformMode == spine.TransformMode.NoScale\n && (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0))\n s = -s;\n var r = Math.PI / 2 + Math.atan2(zc, za);\n var zb = Math.cos(r) * s;\n var zd = Math.sin(r) * s;\n var la = spine.MathUtils.cosDeg(shearX) * scaleX;\n var lb = spine.MathUtils.cosDeg(90 + shearY) * scaleY;\n var lc = spine.MathUtils.sinDeg(shearX) * scaleX;\n var ld = spine.MathUtils.sinDeg(90 + shearY) * scaleY;\n this.a = za * la + zb * lc;\n this.b = za * lb + zb * ld;\n this.c = zc * la + zd * lc;\n this.d = zc * lb + zd * ld;\n break;\n }\n }\n this.a *= this.skeleton.scaleX;\n this.b *= this.skeleton.scaleX;\n this.c *= this.skeleton.scaleY;\n this.d *= this.skeleton.scaleY;\n };\n Bone.prototype.setToSetupPose = function () {\n var data = this.data;\n this.x = data.x;\n this.y = data.y;\n this.rotation = data.rotation;\n this.scaleX = data.scaleX;\n this.scaleY = data.scaleY;\n this.shearX = data.shearX;\n this.shearY = data.shearY;\n };\n Bone.prototype.getWorldRotationX = function () {\n return Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\n };\n Bone.prototype.getWorldRotationY = function () {\n return Math.atan2(this.d, this.b) * spine.MathUtils.radDeg;\n };\n Bone.prototype.getWorldScaleX = function () {\n return Math.sqrt(this.a * this.a + this.c * this.c);\n };\n Bone.prototype.getWorldScaleY = function () {\n return Math.sqrt(this.b * this.b + this.d * this.d);\n };\n Bone.prototype.updateAppliedTransform = function () {\n this.appliedValid = true;\n var parent = this.parent;\n if (parent == null) {\n this.ax = this.worldX;\n this.ay = this.worldY;\n this.arotation = Math.atan2(this.c, this.a) * spine.MathUtils.radDeg;\n this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\n this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\n this.ashearX = 0;\n this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * spine.MathUtils.radDeg;\n return;\n }\n var pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n var pid = 1 / (pa * pd - pb * pc);\n var dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\n this.ax = (dx * pd * pid - dy * pb * pid);\n this.ay = (dy * pa * pid - dx * pc * pid);\n var ia = pid * pd;\n var id = pid * pa;\n var ib = pid * pb;\n var ic = pid * pc;\n var ra = ia * this.a - ib * this.c;\n var rb = ia * this.b - ib * this.d;\n var rc = id * this.c - ic * this.a;\n var rd = id * this.d - ic * this.b;\n this.ashearX = 0;\n this.ascaleX = Math.sqrt(ra * ra + rc * rc);\n if (this.ascaleX > 0.0001) {\n var det = ra * rd - rb * rc;\n this.ascaleY = det / this.ascaleX;\n this.ashearY = Math.atan2(ra * rb + rc * rd, det) * spine.MathUtils.radDeg;\n this.arotation = Math.atan2(rc, ra) * spine.MathUtils.radDeg;\n }\n else {\n this.ascaleX = 0;\n this.ascaleY = Math.sqrt(rb * rb + rd * rd);\n this.ashearY = 0;\n this.arotation = 90 - Math.atan2(rd, rb) * spine.MathUtils.radDeg;\n }\n };\n Bone.prototype.worldToLocal = function (world) {\n var a = this.a, b = this.b, c = this.c, d = this.d;\n var invDet = 1 / (a * d - b * c);\n var x = world.x - this.worldX, y = world.y - this.worldY;\n world.x = (x * d * invDet - y * b * invDet);\n world.y = (y * a * invDet - x * c * invDet);\n return world;\n };\n Bone.prototype.localToWorld = function (local) {\n var x = local.x, y = local.y;\n local.x = x * this.a + y * this.b + this.worldX;\n local.y = x * this.c + y * this.d + this.worldY;\n return local;\n };\n Bone.prototype.worldToLocalRotation = function (worldRotation) {\n var sin = spine.MathUtils.sinDeg(worldRotation), cos = spine.MathUtils.cosDeg(worldRotation);\n return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * spine.MathUtils.radDeg + this.rotation - this.shearX;\n };\n Bone.prototype.localToWorldRotation = function (localRotation) {\n localRotation -= this.rotation - this.shearX;\n var sin = spine.MathUtils.sinDeg(localRotation), cos = spine.MathUtils.cosDeg(localRotation);\n return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * spine.MathUtils.radDeg;\n };\n Bone.prototype.rotateWorld = function (degrees) {\n var a = this.a, b = this.b, c = this.c, d = this.d;\n var cos = spine.MathUtils.cosDeg(degrees), sin = spine.MathUtils.sinDeg(degrees);\n this.a = cos * a - sin * c;\n this.b = cos * b - sin * d;\n this.c = sin * a + cos * c;\n this.d = sin * b + cos * d;\n this.appliedValid = false;\n };\n return Bone;\n }());\n spine.Bone = Bone;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var BoneData = (function () {\n function BoneData(index, name, parent) {\n this.x = 0;\n this.y = 0;\n this.rotation = 0;\n this.scaleX = 1;\n this.scaleY = 1;\n this.shearX = 0;\n this.shearY = 0;\n this.transformMode = TransformMode.Normal;\n this.skinRequired = false;\n this.color = new spine.Color();\n if (index < 0)\n throw new Error(\"index must be >= 0.\");\n if (name == null)\n throw new Error(\"name cannot be null.\");\n this.index = index;\n this.name = name;\n this.parent = parent;\n }\n return BoneData;\n }());\n spine.BoneData = BoneData;\n var TransformMode;\n (function (TransformMode) {\n TransformMode[TransformMode[\"Normal\"] = 0] = \"Normal\";\n TransformMode[TransformMode[\"OnlyTranslation\"] = 1] = \"OnlyTranslation\";\n TransformMode[TransformMode[\"NoRotationOrReflection\"] = 2] = \"NoRotationOrReflection\";\n TransformMode[TransformMode[\"NoScale\"] = 3] = \"NoScale\";\n TransformMode[TransformMode[\"NoScaleOrReflection\"] = 4] = \"NoScaleOrReflection\";\n })(TransformMode = spine.TransformMode || (spine.TransformMode = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var ConstraintData = (function () {\n function ConstraintData(name, order, skinRequired) {\n this.name = name;\n this.order = order;\n this.skinRequired = skinRequired;\n }\n return ConstraintData;\n }());\n spine.ConstraintData = ConstraintData;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var Event = (function () {\n function Event(time, data) {\n if (data == null)\n throw new Error(\"data cannot be null.\");\n this.time = time;\n this.data = data;\n }\n return Event;\n }());\n spine.Event = Event;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var EventData = (function () {\n function EventData(name) {\n this.name = name;\n }\n return EventData;\n }());\n spine.EventData = EventData;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var IkConstraint = (function () {\n function IkConstraint(data, skeleton) {\n this.bendDirection = 0;\n this.compress = false;\n this.stretch = false;\n this.mix = 1;\n this.softness = 0;\n this.active = false;\n if (data == null)\n throw new Error(\"data cannot be null.\");\n if (skeleton == null)\n throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.mix = data.mix;\n this.softness = data.softness;\n this.bendDirection = data.bendDirection;\n this.compress = data.compress;\n this.stretch = data.stretch;\n this.bones = new Array();\n for (var i = 0; i < data.bones.length; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findBone(data.target.name);\n }\n IkConstraint.prototype.isActive = function () {\n return this.active;\n };\n IkConstraint.prototype.apply = function () {\n this.update();\n };\n IkConstraint.prototype.update = function () {\n var target = this.target;\n var bones = this.bones;\n switch (bones.length) {\n case 1:\n this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\n break;\n case 2:\n this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.softness, this.mix);\n break;\n }\n };\n IkConstraint.prototype.apply1 = function (bone, targetX, targetY, compress, stretch, uniform, alpha) {\n if (!bone.appliedValid)\n bone.updateAppliedTransform();\n var p = bone.parent;\n var pa = p.a, pb = p.b, pc = p.c, pd = p.d;\n var rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\n switch (bone.data.transformMode) {\n case spine.TransformMode.OnlyTranslation:\n tx = targetX - bone.worldX;\n ty = targetY - bone.worldY;\n break;\n case spine.TransformMode.NoRotationOrReflection:\n var s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\n var sa = pa / bone.skeleton.scaleX;\n var sc = pc / bone.skeleton.scaleY;\n pb = -sc * s * bone.skeleton.scaleX;\n pd = sa * s * bone.skeleton.scaleY;\n rotationIK += Math.atan2(sc, sa) * spine.MathUtils.radDeg;\n default:\n var x = targetX - p.worldX, y = targetY - p.worldY;\n var d = pa * pd - pb * pc;\n tx = (x * pd - y * pb) / d - bone.ax;\n ty = (y * pa - x * pc) / d - bone.ay;\n }\n rotationIK += Math.atan2(ty, tx) * spine.MathUtils.radDeg;\n if (bone.ascaleX < 0)\n rotationIK += 180;\n if (rotationIK > 180)\n rotationIK -= 360;\n else if (rotationIK < -180)\n rotationIK += 360;\n var sx = bone.ascaleX, sy = bone.ascaleY;\n if (compress || stretch) {\n switch (bone.data.transformMode) {\n case spine.TransformMode.NoScale:\n case spine.TransformMode.NoScaleOrReflection:\n tx = targetX - bone.worldX;\n ty = targetY - bone.worldY;\n }\n var b = bone.data.length * sx, dd = Math.sqrt(tx * tx + ty * ty);\n if ((compress && dd < b) || (stretch && dd > b) && b > 0.0001) {\n var s = (dd / b - 1) * alpha + 1;\n sx *= s;\n if (uniform)\n sy *= s;\n }\n }\n bone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX, bone.ashearY);\n };\n IkConstraint.prototype.apply2 = function (parent, child, targetX, targetY, bendDir, stretch, softness, alpha) {\n if (alpha == 0) {\n child.updateWorldTransform();\n return;\n }\n if (!parent.appliedValid)\n parent.updateAppliedTransform();\n if (!child.appliedValid)\n child.updateAppliedTransform();\n var px = parent.ax, py = parent.ay, psx = parent.ascaleX, sx = psx, psy = parent.ascaleY, csx = child.ascaleX;\n var os1 = 0, os2 = 0, s2 = 0;\n if (psx < 0) {\n psx = -psx;\n os1 = 180;\n s2 = -1;\n }\n else {\n os1 = 0;\n s2 = 1;\n }\n if (psy < 0) {\n psy = -psy;\n s2 = -s2;\n }\n if (csx < 0) {\n csx = -csx;\n os2 = 180;\n }\n else\n os2 = 0;\n var cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\n var u = Math.abs(psx - psy) <= 0.0001;\n if (!u) {\n cy = 0;\n cwx = a * cx + parent.worldX;\n cwy = c * cx + parent.worldY;\n }\n else {\n cy = child.ay;\n cwx = a * cx + b * cy + parent.worldX;\n cwy = c * cx + d * cy + parent.worldY;\n }\n var pp = parent.parent;\n a = pp.a;\n b = pp.b;\n c = pp.c;\n d = pp.d;\n var id = 1 / (a * d - b * c), x = cwx - pp.worldX, y = cwy - pp.worldY;\n var dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\n var l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\n if (l1 < 0.0001) {\n this.apply1(parent, targetX, targetY, false, stretch, false, alpha);\n child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n return;\n }\n x = targetX - pp.worldX;\n y = targetY - pp.worldY;\n var tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\n var dd = tx * tx + ty * ty;\n if (softness != 0) {\n softness *= psx * (csx + 1) / 2;\n var td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\n if (sd > 0) {\n var p = Math.min(1, sd / (softness * 2)) - 1;\n p = (sd - softness * (1 - p * p)) / td;\n tx -= p * tx;\n ty -= p * ty;\n dd = tx * tx + ty * ty;\n }\n }\n outer: if (u) {\n l2 *= psx;\n var cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\n if (cos < -1)\n cos = -1;\n else if (cos > 1) {\n cos = 1;\n if (stretch)\n sx *= (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\n }\n a2 = Math.acos(cos) * bendDir;\n a = l1 + l2 * cos;\n b = l2 * Math.sin(a2);\n a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\n }\n else {\n a = psx * l2;\n b = psy * l2;\n var aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\n c = bb * l1 * l1 + aa * dd - aa * bb;\n var c1 = -2 * bb * l1, c2 = bb - aa;\n d = c1 * c1 - 4 * c2 * c;\n if (d >= 0) {\n var q = Math.sqrt(d);\n if (c1 < 0)\n q = -q;\n q = -(c1 + q) / 2;\n var r0 = q / c2, r1 = c / q;\n var r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\n if (r * r <= dd) {\n y = Math.sqrt(dd - r * r) * bendDir;\n a1 = ta - Math.atan2(y, r);\n a2 = Math.atan2(y / psy, (r - l1) / psx);\n break outer;\n }\n }\n var minAngle = spine.MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\n var maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\n c = -a * l1 / (aa - bb);\n if (c >= -1 && c <= 1) {\n c = Math.acos(c);\n x = a * Math.cos(c) + l1;\n y = b * Math.sin(c);\n d = x * x + y * y;\n if (d < minDist) {\n minAngle = c;\n minDist = d;\n minX = x;\n minY = y;\n }\n if (d > maxDist) {\n maxAngle = c;\n maxDist = d;\n maxX = x;\n maxY = y;\n }\n }\n if (dd <= (minDist + maxDist) / 2) {\n a1 = ta - Math.atan2(minY * bendDir, minX);\n a2 = minAngle * bendDir;\n }\n else {\n a1 = ta - Math.atan2(maxY * bendDir, maxX);\n a2 = maxAngle * bendDir;\n }\n }\n var os = Math.atan2(cy, cx) * s2;\n var rotation = parent.arotation;\n a1 = (a1 - os) * spine.MathUtils.radDeg + os1 - rotation;\n if (a1 > 180)\n a1 -= 360;\n else if (a1 < -180)\n a1 += 360;\n parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, parent.ascaleY, 0, 0);\n rotation = child.arotation;\n a2 = ((a2 + os) * spine.MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\n if (a2 > 180)\n a2 -= 360;\n else if (a2 < -180)\n a2 += 360;\n child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n };\n return IkConstraint;\n }());\n spine.IkConstraint = IkConstraint;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var IkConstraintData = (function (_super) {\n __extends(IkConstraintData, _super);\n function IkConstraintData(name) {\n var _this = _super.call(this, name, 0, false) || this;\n _this.bones = new Array();\n _this.bendDirection = 1;\n _this.compress = false;\n _this.stretch = false;\n _this.uniform = false;\n _this.mix = 1;\n _this.softness = 0;\n return _this;\n }\n return IkConstraintData;\n }(spine.ConstraintData));\n spine.IkConstraintData = IkConstraintData;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var PathConstraint = (function () {\n function PathConstraint(data, skeleton) {\n this.position = 0;\n this.spacing = 0;\n this.rotateMix = 0;\n this.translateMix = 0;\n this.spaces = new Array();\n this.positions = new Array();\n this.world = new Array();\n this.curves = new Array();\n this.lengths = new Array();\n this.segments = new Array();\n this.active = false;\n if (data == null)\n throw new Error(\"data cannot be null.\");\n if (skeleton == null)\n throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.bones = new Array();\n for (var i = 0, n = data.bones.length; i < n; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findSlot(data.target.name);\n this.position = data.position;\n this.spacing = data.spacing;\n this.rotateMix = data.rotateMix;\n this.translateMix = data.translateMix;\n }\n PathConstraint.prototype.isActive = function () {\n return this.active;\n };\n PathConstraint.prototype.apply = function () {\n this.update();\n };\n PathConstraint.prototype.update = function () {\n var attachment = this.target.getAttachment();\n if (!(attachment instanceof spine.PathAttachment))\n return;\n var rotateMix = this.rotateMix, translateMix = this.translateMix;\n var translate = translateMix > 0, rotate = rotateMix > 0;\n if (!translate && !rotate)\n return;\n var data = this.data;\n var percentSpacing = data.spacingMode == spine.SpacingMode.Percent;\n var rotateMode = data.rotateMode;\n var tangents = rotateMode == spine.RotateMode.Tangent, scale = rotateMode == spine.RotateMode.ChainScale;\n var boneCount = this.bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\n var bones = this.bones;\n var spaces = spine.Utils.setArraySize(this.spaces, spacesCount), lengths = null;\n var spacing = this.spacing;\n if (scale || !percentSpacing) {\n if (scale)\n lengths = spine.Utils.setArraySize(this.lengths, boneCount);\n var lengthSpacing = data.spacingMode == spine.SpacingMode.Length;\n for (var i = 0, n = spacesCount - 1; i < n;) {\n var bone = bones[i];\n var setupLength = bone.data.length;\n if (setupLength < PathConstraint.epsilon) {\n if (scale)\n lengths[i] = 0;\n spaces[++i] = 0;\n }\n else if (percentSpacing) {\n if (scale) {\n var x = setupLength * bone.a, y = setupLength * bone.c;\n var length_1 = Math.sqrt(x * x + y * y);\n lengths[i] = length_1;\n }\n spaces[++i] = spacing;\n }\n else {\n var x = setupLength * bone.a, y = setupLength * bone.c;\n var length_2 = Math.sqrt(x * x + y * y);\n if (scale)\n lengths[i] = length_2;\n spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length_2 / setupLength;\n }\n }\n }\n else {\n for (var i = 1; i < spacesCount; i++)\n spaces[i] = spacing;\n }\n var positions = this.computeWorldPositions(attachment, spacesCount, tangents, data.positionMode == spine.PositionMode.Percent, percentSpacing);\n var boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\n var tip = false;\n if (offsetRotation == 0)\n tip = rotateMode == spine.RotateMode.Chain;\n else {\n tip = false;\n var p = this.target.bone;\n offsetRotation *= p.a * p.d - p.b * p.c > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\n }\n for (var i = 0, p = 3; i < boneCount; i++, p += 3) {\n var bone = bones[i];\n bone.worldX += (boneX - bone.worldX) * translateMix;\n bone.worldY += (boneY - bone.worldY) * translateMix;\n var x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\n if (scale) {\n var length_3 = lengths[i];\n if (length_3 != 0) {\n var s = (Math.sqrt(dx * dx + dy * dy) / length_3 - 1) * rotateMix + 1;\n bone.a *= s;\n bone.c *= s;\n }\n }\n boneX = x;\n boneY = y;\n if (rotate) {\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\n if (tangents)\n r = positions[p - 1];\n else if (spaces[i + 1] == 0)\n r = positions[p + 2];\n else\n r = Math.atan2(dy, dx);\n r -= Math.atan2(c, a);\n if (tip) {\n cos = Math.cos(r);\n sin = Math.sin(r);\n var length_4 = bone.data.length;\n boneX += (length_4 * (cos * a - sin * c) - dx) * rotateMix;\n boneY += (length_4 * (sin * a + cos * c) - dy) * rotateMix;\n }\n else {\n r += offsetRotation;\n }\n if (r > spine.MathUtils.PI)\n r -= spine.MathUtils.PI2;\n else if (r < -spine.MathUtils.PI)\n r += spine.MathUtils.PI2;\n r *= rotateMix;\n cos = Math.cos(r);\n sin = Math.sin(r);\n bone.a = cos * a - sin * c;\n bone.b = cos * b - sin * d;\n bone.c = sin * a + cos * c;\n bone.d = sin * b + cos * d;\n }\n bone.appliedValid = false;\n }\n };\n PathConstraint.prototype.computeWorldPositions = function (path, spacesCount, tangents, percentPosition, percentSpacing) {\n var target = this.target;\n var position = this.position;\n var spaces = this.spaces, out = spine.Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = null;\n var closed = path.closed;\n var verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\n if (!path.constantSpeed) {\n var lengths = path.lengths;\n curveCount -= closed ? 1 : 2;\n var pathLength_1 = lengths[curveCount];\n if (percentPosition)\n position *= pathLength_1;\n if (percentSpacing) {\n for (var i = 1; i < spacesCount; i++)\n spaces[i] *= pathLength_1;\n }\n world = spine.Utils.setArraySize(this.world, 8);\n for (var i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\n var space = spaces[i];\n position += space;\n var p = position;\n if (closed) {\n p %= pathLength_1;\n if (p < 0)\n p += pathLength_1;\n curve = 0;\n }\n else if (p < 0) {\n if (prevCurve != PathConstraint.BEFORE) {\n prevCurve = PathConstraint.BEFORE;\n path.computeWorldVertices(target, 2, 4, world, 0, 2);\n }\n this.addBeforePosition(p, world, 0, out, o);\n continue;\n }\n else if (p > pathLength_1) {\n if (prevCurve != PathConstraint.AFTER) {\n prevCurve = PathConstraint.AFTER;\n path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\n }\n this.addAfterPosition(p - pathLength_1, world, 0, out, o);\n continue;\n }\n for (;; curve++) {\n var length_5 = lengths[curve];\n if (p > length_5)\n continue;\n if (curve == 0)\n p /= length_5;\n else {\n var prev = lengths[curve - 1];\n p = (p - prev) / (length_5 - prev);\n }\n break;\n }\n if (curve != prevCurve) {\n prevCurve = curve;\n if (closed && curve == curveCount) {\n path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\n path.computeWorldVertices(target, 0, 4, world, 4, 2);\n }\n else\n path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\n }\n this.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o, tangents || (i > 0 && space == 0));\n }\n return out;\n }\n if (closed) {\n verticesLength += 2;\n world = spine.Utils.setArraySize(this.world, verticesLength);\n path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\n path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\n world[verticesLength - 2] = world[0];\n world[verticesLength - 1] = world[1];\n }\n else {\n curveCount--;\n verticesLength -= 4;\n world = spine.Utils.setArraySize(this.world, verticesLength);\n path.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\n }\n var curves = spine.Utils.setArraySize(this.curves, curveCount);\n var pathLength = 0;\n var x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\n var tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\n for (var i = 0, w = 2; i < curveCount; i++, w += 6) {\n cx1 = world[w];\n cy1 = world[w + 1];\n cx2 = world[w + 2];\n cy2 = world[w + 3];\n x2 = world[w + 4];\n y2 = world[w + 5];\n tmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\n tmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\n ddfx = tmpx * 2 + dddfx;\n ddfy = tmpy * 2 + dddfy;\n dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\n dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx;\n dfy += ddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n dfx += ddfx + dddfx;\n dfy += ddfy + dddfy;\n pathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n curves[i] = pathLength;\n x1 = x2;\n y1 = y2;\n }\n if (percentPosition)\n position *= pathLength;\n else\n position *= pathLength / path.lengths[curveCount - 1];\n if (percentSpacing) {\n for (var i = 1; i < spacesCount; i++)\n spaces[i] *= pathLength;\n }\n var segments = this.segments;\n var curveLength = 0;\n for (var i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\n var space = spaces[i];\n position += space;\n var p = position;\n if (closed) {\n p %= pathLength;\n if (p < 0)\n p += pathLength;\n curve = 0;\n }\n else if (p < 0) {\n this.addBeforePosition(p, world, 0, out, o);\n continue;\n }\n else if (p > pathLength) {\n this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\n continue;\n }\n for (;; curve++) {\n var length_6 = curves[curve];\n if (p > length_6)\n continue;\n if (curve == 0)\n p /= length_6;\n else {\n var prev = curves[curve - 1];\n p = (p - prev) / (length_6 - prev);\n }\n break;\n }\n if (curve != prevCurve) {\n prevCurve = curve;\n var ii = curve * 6;\n x1 = world[ii];\n y1 = world[ii + 1];\n cx1 = world[ii + 2];\n cy1 = world[ii + 3];\n cx2 = world[ii + 4];\n cy2 = world[ii + 5];\n x2 = world[ii + 6];\n y2 = world[ii + 7];\n tmpx = (x1 - cx1 * 2 + cx2) * 0.03;\n tmpy = (y1 - cy1 * 2 + cy2) * 0.03;\n dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\n dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\n ddfx = tmpx * 2 + dddfx;\n ddfy = tmpy * 2 + dddfy;\n dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\n dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\n curveLength = Math.sqrt(dfx * dfx + dfy * dfy);\n segments[0] = curveLength;\n for (ii = 1; ii < 8; ii++) {\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[ii] = curveLength;\n }\n dfx += ddfx;\n dfy += ddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[8] = curveLength;\n dfx += ddfx + dddfx;\n dfy += ddfy + dddfy;\n curveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n segments[9] = curveLength;\n segment = 0;\n }\n p *= curveLength;\n for (;; segment++) {\n var length_7 = segments[segment];\n if (p > length_7)\n continue;\n if (segment == 0)\n p /= length_7;\n else {\n var prev = segments[segment - 1];\n p = segment + (p - prev) / (length_7 - prev);\n }\n break;\n }\n this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\n }\n return out;\n };\n PathConstraint.prototype.addBeforePosition = function (p, temp, i, out, o) {\n var x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\n out[o] = x1 + p * Math.cos(r);\n out[o + 1] = y1 + p * Math.sin(r);\n out[o + 2] = r;\n };\n PathConstraint.prototype.addAfterPosition = function (p, temp, i, out, o) {\n var x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\n out[o] = x1 + p * Math.cos(r);\n out[o + 1] = y1 + p * Math.sin(r);\n out[o + 2] = r;\n };\n PathConstraint.prototype.addCurvePosition = function (p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) {\n if (p == 0 || isNaN(p)) {\n out[o] = x1;\n out[o + 1] = y1;\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n return;\n }\n var tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\n var ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\n var x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\n out[o] = x;\n out[o + 1] = y;\n if (tangents) {\n if (p < 0.001)\n out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n else\n out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\n }\n };\n PathConstraint.NONE = -1;\n PathConstraint.BEFORE = -2;\n PathConstraint.AFTER = -3;\n PathConstraint.epsilon = 0.00001;\n return PathConstraint;\n }());\n spine.PathConstraint = PathConstraint;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var PathConstraintData = (function (_super) {\n __extends(PathConstraintData, _super);\n function PathConstraintData(name) {\n var _this = _super.call(this, name, 0, false) || this;\n _this.bones = new Array();\n return _this;\n }\n return PathConstraintData;\n }(spine.ConstraintData));\n spine.PathConstraintData = PathConstraintData;\n var PositionMode;\n (function (PositionMode) {\n PositionMode[PositionMode[\"Fixed\"] = 0] = \"Fixed\";\n PositionMode[PositionMode[\"Percent\"] = 1] = \"Percent\";\n })(PositionMode = spine.PositionMode || (spine.PositionMode = {}));\n var SpacingMode;\n (function (SpacingMode) {\n SpacingMode[SpacingMode[\"Length\"] = 0] = \"Length\";\n SpacingMode[SpacingMode[\"Fixed\"] = 1] = \"Fixed\";\n SpacingMode[SpacingMode[\"Percent\"] = 2] = \"Percent\";\n })(SpacingMode = spine.SpacingMode || (spine.SpacingMode = {}));\n var RotateMode;\n (function (RotateMode) {\n RotateMode[RotateMode[\"Tangent\"] = 0] = \"Tangent\";\n RotateMode[RotateMode[\"Chain\"] = 1] = \"Chain\";\n RotateMode[RotateMode[\"ChainScale\"] = 2] = \"ChainScale\";\n })(RotateMode = spine.RotateMode || (spine.RotateMode = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var Assets = (function () {\n function Assets(clientId) {\n this.toLoad = new Array();\n this.assets = {};\n this.clientId = clientId;\n }\n Assets.prototype.loaded = function () {\n var i = 0;\n for (var v in this.assets)\n i++;\n return i;\n };\n return Assets;\n }());\n var SharedAssetManager = (function () {\n function SharedAssetManager(pathPrefix) {\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\n this.clientAssets = {};\n this.queuedAssets = {};\n this.rawAssets = {};\n this.errors = {};\n this.pathPrefix = pathPrefix;\n }\n SharedAssetManager.prototype.queueAsset = function (clientId, textureLoader, path) {\n var clientAssets = this.clientAssets[clientId];\n if (clientAssets === null || clientAssets === undefined) {\n clientAssets = new Assets(clientId);\n this.clientAssets[clientId] = clientAssets;\n }\n if (textureLoader !== null)\n clientAssets.textureLoader = textureLoader;\n clientAssets.toLoad.push(path);\n if (this.queuedAssets[path] === path) {\n return false;\n }\n else {\n this.queuedAssets[path] = path;\n return true;\n }\n };\n SharedAssetManager.prototype.loadText = function (clientId, path) {\n var _this = this;\n path = this.pathPrefix + path;\n if (!this.queueAsset(clientId, null, path))\n return;\n var request = new XMLHttpRequest();\n request.overrideMimeType(\"text/html\");\n request.onreadystatechange = function () {\n if (request.readyState == XMLHttpRequest.DONE) {\n if (request.status >= 200 && request.status < 300) {\n _this.rawAssets[path] = request.responseText;\n }\n else {\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\n }\n }\n };\n request.open(\"GET\", path, true);\n request.send();\n };\n SharedAssetManager.prototype.loadJson = function (clientId, path) {\n var _this = this;\n path = this.pathPrefix + path;\n if (!this.queueAsset(clientId, null, path))\n return;\n var request = new XMLHttpRequest();\n request.overrideMimeType(\"text/html\");\n request.onreadystatechange = function () {\n if (request.readyState == XMLHttpRequest.DONE) {\n if (request.status >= 200 && request.status < 300) {\n _this.rawAssets[path] = JSON.parse(request.responseText);\n }\n else {\n _this.errors[path] = \"Couldn't load text \" + path + \": status \" + request.status + \", \" + request.responseText;\n }\n }\n };\n request.open(\"GET\", path, true);\n request.send();\n };\n SharedAssetManager.prototype.loadTexture = function (clientId, textureLoader, path) {\n var _this = this;\n path = this.pathPrefix + path;\n if (!this.queueAsset(clientId, textureLoader, path))\n return;\n var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document);\n var isWebWorker = !isBrowser && typeof importScripts !== 'undefined';\n if (isWebWorker) {\n var options = { mode: \"cors\" };\n fetch(path, options).then(function (response) {\n if (!response.ok) {\n _this.errors[path] = \"Couldn't load image \" + path;\n }\n return response.blob();\n }).then(function (blob) {\n return createImageBitmap(blob, {\n premultiplyAlpha: 'none',\n colorSpaceConversion: 'none'\n });\n }).then(function (bitmap) {\n _this.rawAssets[path] = bitmap;\n });\n }\n else {\n var img_1 = new Image();\n img_1.crossOrigin = \"anonymous\";\n img_1.onload = function (ev) {\n _this.rawAssets[path] = img_1;\n };\n img_1.onerror = function (ev) {\n _this.errors[path] = \"Couldn't load image \" + path;\n };\n img_1.src = path;\n }\n };\n SharedAssetManager.prototype.get = function (clientId, path) {\n path = this.pathPrefix + path;\n var clientAssets = this.clientAssets[clientId];\n if (clientAssets === null || clientAssets === undefined)\n return true;\n return clientAssets.assets[path];\n };\n SharedAssetManager.prototype.updateClientAssets = function (clientAssets) {\n var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document);\n var isWebWorker = !isBrowser && typeof importScripts !== 'undefined';\n for (var i = 0; i < clientAssets.toLoad.length; i++) {\n var path = clientAssets.toLoad[i];\n var asset = clientAssets.assets[path];\n if (asset === null || asset === undefined) {\n var rawAsset = this.rawAssets[path];\n if (rawAsset === null || rawAsset === undefined)\n continue;\n if (isWebWorker) {\n if (rawAsset instanceof ImageBitmap) {\n clientAssets.assets[path] = clientAssets.textureLoader(rawAsset);\n }\n else {\n clientAssets.assets[path] = rawAsset;\n }\n }\n else {\n if (rawAsset instanceof HTMLImageElement) {\n clientAssets.assets[path] = clientAssets.textureLoader(rawAsset);\n }\n else {\n clientAssets.assets[path] = rawAsset;\n }\n }\n }\n }\n };\n SharedAssetManager.prototype.isLoadingComplete = function (clientId) {\n var clientAssets = this.clientAssets[clientId];\n if (clientAssets === null || clientAssets === undefined)\n return true;\n this.updateClientAssets(clientAssets);\n return clientAssets.toLoad.length == clientAssets.loaded();\n };\n SharedAssetManager.prototype.dispose = function () {\n };\n SharedAssetManager.prototype.hasErrors = function () {\n return Object.keys(this.errors).length > 0;\n };\n SharedAssetManager.prototype.getErrors = function () {\n return this.errors;\n };\n return SharedAssetManager;\n }());\n spine.SharedAssetManager = SharedAssetManager;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var Skeleton = (function () {\n function Skeleton(data) {\n this._updateCache = new Array();\n this.updateCacheReset = new Array();\n this.time = 0;\n this.scaleX = 1;\n this.scaleY = 1;\n this.x = 0;\n this.y = 0;\n if (data == null)\n throw new Error(\"data cannot be null.\");\n this.data = data;\n this.bones = new Array();\n for (var i = 0; i < data.bones.length; i++) {\n var boneData = data.bones[i];\n var bone = void 0;\n if (boneData.parent == null)\n bone = new spine.Bone(boneData, this, null);\n else {\n var parent_1 = this.bones[boneData.parent.index];\n bone = new spine.Bone(boneData, this, parent_1);\n parent_1.children.push(bone);\n }\n this.bones.push(bone);\n }\n this.slots = new Array();\n this.drawOrder = new Array();\n for (var i = 0; i < data.slots.length; i++) {\n var slotData = data.slots[i];\n var bone = this.bones[slotData.boneData.index];\n var slot = new spine.Slot(slotData, bone);\n this.slots.push(slot);\n this.drawOrder.push(slot);\n }\n this.ikConstraints = new Array();\n for (var i = 0; i < data.ikConstraints.length; i++) {\n var ikConstraintData = data.ikConstraints[i];\n this.ikConstraints.push(new spine.IkConstraint(ikConstraintData, this));\n }\n this.transformConstraints = new Array();\n for (var i = 0; i < data.transformConstraints.length; i++) {\n var transformConstraintData = data.transformConstraints[i];\n this.transformConstraints.push(new spine.TransformConstraint(transformConstraintData, this));\n }\n this.pathConstraints = new Array();\n for (var i = 0; i < data.pathConstraints.length; i++) {\n var pathConstraintData = data.pathConstraints[i];\n this.pathConstraints.push(new spine.PathConstraint(pathConstraintData, this));\n }\n this.color = new spine.Color(1, 1, 1, 1);\n this.updateCache();\n }\n Skeleton.prototype.updateCache = function () {\n var updateCache = this._updateCache;\n updateCache.length = 0;\n this.updateCacheReset.length = 0;\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n bone.sorted = bone.data.skinRequired;\n bone.active = !bone.sorted;\n }\n if (this.skin != null) {\n var skinBones = this.skin.bones;\n for (var i = 0, n = this.skin.bones.length; i < n; i++) {\n var bone = this.bones[skinBones[i].index];\n do {\n bone.sorted = false;\n bone.active = true;\n bone = bone.parent;\n } while (bone != null);\n }\n }\n var ikConstraints = this.ikConstraints;\n var transformConstraints = this.transformConstraints;\n var pathConstraints = this.pathConstraints;\n var ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length;\n var constraintCount = ikCount + transformCount + pathCount;\n outer: for (var i = 0; i < constraintCount; i++) {\n for (var ii = 0; ii < ikCount; ii++) {\n var constraint = ikConstraints[ii];\n if (constraint.data.order == i) {\n this.sortIkConstraint(constraint);\n continue outer;\n }\n }\n for (var ii = 0; ii < transformCount; ii++) {\n var constraint = transformConstraints[ii];\n if (constraint.data.order == i) {\n this.sortTransformConstraint(constraint);\n continue outer;\n }\n }\n for (var ii = 0; ii < pathCount; ii++) {\n var constraint = pathConstraints[ii];\n if (constraint.data.order == i) {\n this.sortPathConstraint(constraint);\n continue outer;\n }\n }\n }\n for (var i = 0, n = bones.length; i < n; i++)\n this.sortBone(bones[i]);\n };\n Skeleton.prototype.sortIkConstraint = function (constraint) {\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && spine.Utils.contains(this.skin.constraints, constraint.data, true)));\n if (!constraint.active)\n return;\n var target = constraint.target;\n this.sortBone(target);\n var constrained = constraint.bones;\n var parent = constrained[0];\n this.sortBone(parent);\n if (constrained.length > 1) {\n var child = constrained[constrained.length - 1];\n if (!(this._updateCache.indexOf(child) > -1))\n this.updateCacheReset.push(child);\n }\n this._updateCache.push(constraint);\n this.sortReset(parent.children);\n constrained[constrained.length - 1].sorted = true;\n };\n Skeleton.prototype.sortPathConstraint = function (constraint) {\n constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin != null && spine.Utils.contains(this.skin.constraints, constraint.data, true)));\n if (!constraint.active)\n return;\n var slot = constraint.target;\n var slotIndex = slot.data.index;\n var slotBone = slot.bone;\n if (this.skin != null)\n this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\n if (this.data.defaultSkin != null && this.data.defaultSkin != this.skin)\n this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\n for (var i = 0, n = this.data.skins.length; i < n; i++)\n this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\n var attachment = slot.getAttachment();\n if (attachment instanceof spine.PathAttachment)\n this.sortPathConstraintAttachmentWith(attachment, slotBone);\n var constrained = constraint.bones;\n var boneCount = constrained.length;\n for (var i = 0; i < boneCount; i++)\n this.sortBone(constrained[i]);\n this._updateCache.push(constraint);\n for (var i = 0; i < boneCount; i++)\n this.sortReset(constrained[i].children);\n for (var i = 0; i < boneCount; i++)\n constrained[i].sorted = true;\n };\n Skeleton.prototype.sortTransformConstraint = function (constraint) {\n constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin != null && spine.Utils.contains(this.skin.constraints, constraint.data, true)));\n if (!constraint.active)\n return;\n this.sortBone(constraint.target);\n var constrained = constraint.bones;\n var boneCount = constrained.length;\n if (constraint.data.local) {\n for (var i = 0; i < boneCount; i++) {\n var child = constrained[i];\n this.sortBone(child.parent);\n if (!(this._updateCache.indexOf(child) > -1))\n this.updateCacheReset.push(child);\n }\n }\n else {\n for (var i = 0; i < boneCount; i++) {\n this.sortBone(constrained[i]);\n }\n }\n this._updateCache.push(constraint);\n for (var ii = 0; ii < boneCount; ii++)\n this.sortReset(constrained[ii].children);\n for (var ii = 0; ii < boneCount; ii++)\n constrained[ii].sorted = true;\n };\n Skeleton.prototype.sortPathConstraintAttachment = function (skin, slotIndex, slotBone) {\n var attachments = skin.attachments[slotIndex];\n if (!attachments)\n return;\n for (var key in attachments) {\n this.sortPathConstraintAttachmentWith(attachments[key], slotBone);\n }\n };\n Skeleton.prototype.sortPathConstraintAttachmentWith = function (attachment, slotBone) {\n if (!(attachment instanceof spine.PathAttachment))\n return;\n var pathBones = attachment.bones;\n if (pathBones == null)\n this.sortBone(slotBone);\n else {\n var bones = this.bones;\n var i = 0;\n while (i < pathBones.length) {\n var boneCount = pathBones[i++];\n for (var n = i + boneCount; i < n; i++) {\n var boneIndex = pathBones[i];\n this.sortBone(bones[boneIndex]);\n }\n }\n }\n };\n Skeleton.prototype.sortBone = function (bone) {\n if (bone.sorted)\n return;\n var parent = bone.parent;\n if (parent != null)\n this.sortBone(parent);\n bone.sorted = true;\n this._updateCache.push(bone);\n };\n Skeleton.prototype.sortReset = function (bones) {\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n if (!bone.active)\n continue;\n if (bone.sorted)\n this.sortReset(bone.children);\n bone.sorted = false;\n }\n };\n Skeleton.prototype.updateWorldTransform = function () {\n var updateCacheReset = this.updateCacheReset;\n for (var i = 0, n = updateCacheReset.length; i < n; i++) {\n var bone = updateCacheReset[i];\n bone.ax = bone.x;\n bone.ay = bone.y;\n bone.arotation = bone.rotation;\n bone.ascaleX = bone.scaleX;\n bone.ascaleY = bone.scaleY;\n bone.ashearX = bone.shearX;\n bone.ashearY = bone.shearY;\n bone.appliedValid = true;\n }\n var updateCache = this._updateCache;\n for (var i = 0, n = updateCache.length; i < n; i++)\n updateCache[i].update();\n };\n Skeleton.prototype.setToSetupPose = function () {\n this.setBonesToSetupPose();\n this.setSlotsToSetupPose();\n };\n Skeleton.prototype.setBonesToSetupPose = function () {\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++)\n bones[i].setToSetupPose();\n var ikConstraints = this.ikConstraints;\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\n var constraint = ikConstraints[i];\n constraint.mix = constraint.data.mix;\n constraint.softness = constraint.data.softness;\n constraint.bendDirection = constraint.data.bendDirection;\n constraint.compress = constraint.data.compress;\n constraint.stretch = constraint.data.stretch;\n }\n var transformConstraints = this.transformConstraints;\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\n var constraint = transformConstraints[i];\n var data = constraint.data;\n constraint.rotateMix = data.rotateMix;\n constraint.translateMix = data.translateMix;\n constraint.scaleMix = data.scaleMix;\n constraint.shearMix = data.shearMix;\n }\n var pathConstraints = this.pathConstraints;\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\n var constraint = pathConstraints[i];\n var data = constraint.data;\n constraint.position = data.position;\n constraint.spacing = data.spacing;\n constraint.rotateMix = data.rotateMix;\n constraint.translateMix = data.translateMix;\n }\n };\n Skeleton.prototype.setSlotsToSetupPose = function () {\n var slots = this.slots;\n spine.Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\n for (var i = 0, n = slots.length; i < n; i++)\n slots[i].setToSetupPose();\n };\n Skeleton.prototype.getRootBone = function () {\n if (this.bones.length == 0)\n return null;\n return this.bones[0];\n };\n Skeleton.prototype.findBone = function (boneName) {\n if (boneName == null)\n throw new Error(\"boneName cannot be null.\");\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n if (bone.data.name == boneName)\n return bone;\n }\n return null;\n };\n Skeleton.prototype.findBoneIndex = function (boneName) {\n if (boneName == null)\n throw new Error(\"boneName cannot be null.\");\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++)\n if (bones[i].data.name == boneName)\n return i;\n return -1;\n };\n Skeleton.prototype.findSlot = function (slotName) {\n if (slotName == null)\n throw new Error(\"slotName cannot be null.\");\n var slots = this.slots;\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n if (slot.data.name == slotName)\n return slot;\n }\n return null;\n };\n Skeleton.prototype.findSlotIndex = function (slotName) {\n if (slotName == null)\n throw new Error(\"slotName cannot be null.\");\n var slots = this.slots;\n for (var i = 0, n = slots.length; i < n; i++)\n if (slots[i].data.name == slotName)\n return i;\n return -1;\n };\n Skeleton.prototype.setSkinByName = function (skinName) {\n var skin = this.data.findSkin(skinName);\n if (skin == null)\n throw new Error(\"Skin not found: \" + skinName);\n this.setSkin(skin);\n };\n Skeleton.prototype.setSkin = function (newSkin) {\n if (newSkin == this.skin)\n return;\n if (newSkin != null) {\n if (this.skin != null)\n newSkin.attachAll(this, this.skin);\n else {\n var slots = this.slots;\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n var name_1 = slot.data.attachmentName;\n if (name_1 != null) {\n var attachment = newSkin.getAttachment(i, name_1);\n if (attachment != null)\n slot.setAttachment(attachment);\n }\n }\n }\n }\n this.skin = newSkin;\n this.updateCache();\n };\n Skeleton.prototype.getAttachmentByName = function (slotName, attachmentName) {\n return this.getAttachment(this.data.findSlotIndex(slotName), attachmentName);\n };\n Skeleton.prototype.getAttachment = function (slotIndex, attachmentName) {\n if (attachmentName == null)\n throw new Error(\"attachmentName cannot be null.\");\n if (this.skin != null) {\n var attachment = this.skin.getAttachment(slotIndex, attachmentName);\n if (attachment != null)\n return attachment;\n }\n if (this.data.defaultSkin != null)\n return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\n return null;\n };\n Skeleton.prototype.setAttachment = function (slotName, attachmentName) {\n if (slotName == null)\n throw new Error(\"slotName cannot be null.\");\n var slots = this.slots;\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n if (slot.data.name == slotName) {\n var attachment = null;\n if (attachmentName != null) {\n attachment = this.getAttachment(i, attachmentName);\n if (attachment == null)\n throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\n }\n slot.setAttachment(attachment);\n return;\n }\n }\n throw new Error(\"Slot not found: \" + slotName);\n };\n Skeleton.prototype.findIkConstraint = function (constraintName) {\n if (constraintName == null)\n throw new Error(\"constraintName cannot be null.\");\n var ikConstraints = this.ikConstraints;\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\n var ikConstraint = ikConstraints[i];\n if (ikConstraint.data.name == constraintName)\n return ikConstraint;\n }\n return null;\n };\n Skeleton.prototype.findTransformConstraint = function (constraintName) {\n if (constraintName == null)\n throw new Error(\"constraintName cannot be null.\");\n var transformConstraints = this.transformConstraints;\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\n var constraint = transformConstraints[i];\n if (constraint.data.name == constraintName)\n return constraint;\n }\n return null;\n };\n Skeleton.prototype.findPathConstraint = function (constraintName) {\n if (constraintName == null)\n throw new Error(\"constraintName cannot be null.\");\n var pathConstraints = this.pathConstraints;\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\n var constraint = pathConstraints[i];\n if (constraint.data.name == constraintName)\n return constraint;\n }\n return null;\n };\n Skeleton.prototype.getBounds = function (offset, size, temp) {\n if (temp === void 0) { temp = new Array(2); }\n if (offset == null)\n throw new Error(\"offset cannot be null.\");\n if (size == null)\n throw new Error(\"size cannot be null.\");\n var drawOrder = this.drawOrder;\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n var slot = drawOrder[i];\n if (!slot.bone.active)\n continue;\n var verticesLength = 0;\n var vertices = null;\n var attachment = slot.getAttachment();\n if (attachment instanceof spine.RegionAttachment) {\n verticesLength = 8;\n vertices = spine.Utils.setArraySize(temp, verticesLength, 0);\n attachment.computeWorldVertices(slot.bone, vertices, 0, 2);\n }\n else if (attachment instanceof spine.MeshAttachment) {\n var mesh = attachment;\n verticesLength = mesh.worldVerticesLength;\n vertices = spine.Utils.setArraySize(temp, verticesLength, 0);\n mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\n }\n if (vertices != null) {\n for (var ii = 0, nn = vertices.length; ii < nn; ii += 2) {\n var x = vertices[ii], y = vertices[ii + 1];\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x);\n maxY = Math.max(maxY, y);\n }\n }\n }\n offset.set(minX, minY);\n size.set(maxX - minX, maxY - minY);\n };\n Skeleton.prototype.update = function (delta) {\n this.time += delta;\n };\n return Skeleton;\n }());\n spine.Skeleton = Skeleton;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SkeletonBinary = (function () {\n function SkeletonBinary(attachmentLoader) {\n this.scale = 1;\n this.linkedMeshes = new Array();\n this.attachmentLoader = attachmentLoader;\n }\n SkeletonBinary.prototype.readSkeletonData = function (binary) {\n var scale = this.scale;\n var skeletonData = new spine.SkeletonData();\n skeletonData.name = \"\";\n var input = new BinaryInput(binary);\n skeletonData.hash = input.readString();\n skeletonData.version = input.readString();\n if (\"3.8.75\" == skeletonData.version)\n throw new Error(\"Unsupported skeleton data, please export with a newer version of Spine.\");\n skeletonData.x = input.readFloat();\n skeletonData.y = input.readFloat();\n skeletonData.width = input.readFloat();\n skeletonData.height = input.readFloat();\n var nonessential = input.readBoolean();\n if (nonessential) {\n skeletonData.fps = input.readFloat();\n skeletonData.imagesPath = input.readString();\n skeletonData.audioPath = input.readString();\n }\n var n = 0;\n n = input.readInt(true);\n for (var i = 0; i < n; i++)\n input.strings.push(input.readString());\n n = input.readInt(true);\n for (var i = 0; i < n; i++) {\n var name_2 = input.readString();\n var parent_2 = i == 0 ? null : skeletonData.bones[input.readInt(true)];\n var data = new spine.BoneData(i, name_2, parent_2);\n data.rotation = input.readFloat();\n data.x = input.readFloat() * scale;\n data.y = input.readFloat() * scale;\n data.scaleX = input.readFloat();\n data.scaleY = input.readFloat();\n data.shearX = input.readFloat();\n data.shearY = input.readFloat();\n data.length = input.readFloat() * scale;\n data.transformMode = SkeletonBinary.TransformModeValues[input.readInt(true)];\n data.skinRequired = input.readBoolean();\n if (nonessential)\n spine.Color.rgba8888ToColor(data.color, input.readInt32());\n skeletonData.bones.push(data);\n }\n n = input.readInt(true);\n for (var i = 0; i < n; i++) {\n var slotName = input.readString();\n var boneData = skeletonData.bones[input.readInt(true)];\n var data = new spine.SlotData(i, slotName, boneData);\n spine.Color.rgba8888ToColor(data.color, input.readInt32());\n var darkColor = input.readInt32();\n if (darkColor != -1)\n spine.Color.rgb888ToColor(data.darkColor = new spine.Color(), darkColor);\n data.attachmentName = input.readStringRef();\n data.blendMode = SkeletonBinary.BlendModeValues[input.readInt(true)];\n skeletonData.slots.push(data);\n }\n n = input.readInt(true);\n for (var i = 0, nn = void 0; i < n; i++) {\n var data = new spine.IkConstraintData(input.readString());\n data.order = input.readInt(true);\n data.skinRequired = input.readBoolean();\n nn = input.readInt(true);\n for (var ii = 0; ii < nn; ii++)\n data.bones.push(skeletonData.bones[input.readInt(true)]);\n data.target = skeletonData.bones[input.readInt(true)];\n data.mix = input.readFloat();\n data.softness = input.readFloat() * scale;\n data.bendDirection = input.readByte();\n data.compress = input.readBoolean();\n data.stretch = input.readBoolean();\n data.uniform = input.readBoolean();\n skeletonData.ikConstraints.push(data);\n }\n n = input.readInt(true);\n for (var i = 0, nn = void 0; i < n; i++) {\n var data = new spine.TransformConstraintData(input.readString());\n data.order = input.readInt(true);\n data.skinRequired = input.readBoolean();\n nn = input.readInt(true);\n for (var ii = 0; ii < nn; ii++)\n data.bones.push(skeletonData.bones[input.readInt(true)]);\n data.target = skeletonData.bones[input.readInt(true)];\n data.local = input.readBoolean();\n data.relative = input.readBoolean();\n data.offsetRotation = input.readFloat();\n data.offsetX = input.readFloat() * scale;\n data.offsetY = input.readFloat() * scale;\n data.offsetScaleX = input.readFloat();\n data.offsetScaleY = input.readFloat();\n data.offsetShearY = input.readFloat();\n data.rotateMix = input.readFloat();\n data.translateMix = input.readFloat();\n data.scaleMix = input.readFloat();\n data.shearMix = input.readFloat();\n skeletonData.transformConstraints.push(data);\n }\n n = input.readInt(true);\n for (var i = 0, nn = void 0; i < n; i++) {\n var data = new spine.PathConstraintData(input.readString());\n data.order = input.readInt(true);\n data.skinRequired = input.readBoolean();\n nn = input.readInt(true);\n for (var ii = 0; ii < nn; ii++)\n data.bones.push(skeletonData.bones[input.readInt(true)]);\n data.target = skeletonData.slots[input.readInt(true)];\n data.positionMode = SkeletonBinary.PositionModeValues[input.readInt(true)];\n data.spacingMode = SkeletonBinary.SpacingModeValues[input.readInt(true)];\n data.rotateMode = SkeletonBinary.RotateModeValues[input.readInt(true)];\n data.offsetRotation = input.readFloat();\n data.position = input.readFloat();\n if (data.positionMode == spine.PositionMode.Fixed)\n data.position *= scale;\n data.spacing = input.readFloat();\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\n data.spacing *= scale;\n data.rotateMix = input.readFloat();\n data.translateMix = input.readFloat();\n skeletonData.pathConstraints.push(data);\n }\n var defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\n if (defaultSkin != null) {\n skeletonData.defaultSkin = defaultSkin;\n skeletonData.skins.push(defaultSkin);\n }\n {\n var i = skeletonData.skins.length;\n spine.Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\n for (; i < n; i++)\n skeletonData.skins[i] = this.readSkin(input, skeletonData, false, nonessential);\n }\n n = this.linkedMeshes.length;\n for (var i = 0; i < n; i++) {\n var linkedMesh = this.linkedMeshes[i];\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n if (skin == null)\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\n var parent_3 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n if (parent_3 == null)\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_3 : linkedMesh.mesh;\n linkedMesh.mesh.setParentMesh(parent_3);\n linkedMesh.mesh.updateUVs();\n }\n this.linkedMeshes.length = 0;\n n = input.readInt(true);\n for (var i = 0; i < n; i++) {\n var data = new spine.EventData(input.readStringRef());\n data.intValue = input.readInt(false);\n data.floatValue = input.readFloat();\n data.stringValue = input.readString();\n data.audioPath = input.readString();\n if (data.audioPath != null) {\n data.volume = input.readFloat();\n data.balance = input.readFloat();\n }\n skeletonData.events.push(data);\n }\n n = input.readInt(true);\n for (var i = 0; i < n; i++)\n skeletonData.animations.push(this.readAnimation(input, input.readString(), skeletonData));\n return skeletonData;\n };\n SkeletonBinary.prototype.readSkin = function (input, skeletonData, defaultSkin, nonessential) {\n var skin = null;\n var slotCount = 0;\n if (defaultSkin) {\n slotCount = input.readInt(true);\n if (slotCount == 0)\n return null;\n skin = new spine.Skin(\"default\");\n }\n else {\n skin = new spine.Skin(input.readStringRef());\n skin.bones.length = input.readInt(true);\n for (var i = 0, n = skin.bones.length; i < n; i++)\n skin.bones[i] = skeletonData.bones[input.readInt(true)];\n for (var i = 0, n = input.readInt(true); i < n; i++)\n skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\n for (var i = 0, n = input.readInt(true); i < n; i++)\n skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\n for (var i = 0, n = input.readInt(true); i < n; i++)\n skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\n slotCount = input.readInt(true);\n }\n for (var i = 0; i < slotCount; i++) {\n var slotIndex = input.readInt(true);\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n var name_3 = input.readStringRef();\n var attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name_3, nonessential);\n if (attachment != null)\n skin.setAttachment(slotIndex, name_3, attachment);\n }\n }\n return skin;\n };\n SkeletonBinary.prototype.readAttachment = function (input, skeletonData, skin, slotIndex, attachmentName, nonessential) {\n var scale = this.scale;\n var name = input.readStringRef();\n if (name == null)\n name = attachmentName;\n var typeIndex = input.readByte();\n var type = SkeletonBinary.AttachmentTypeValues[typeIndex];\n switch (type) {\n case spine.AttachmentType.Region: {\n var path = input.readStringRef();\n var rotation = input.readFloat();\n var x = input.readFloat();\n var y = input.readFloat();\n var scaleX = input.readFloat();\n var scaleY = input.readFloat();\n var width = input.readFloat();\n var height = input.readFloat();\n var color = input.readInt32();\n if (path == null)\n path = name;\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\n if (region == null)\n return null;\n region.path = path;\n region.x = x * scale;\n region.y = y * scale;\n region.scaleX = scaleX;\n region.scaleY = scaleY;\n region.rotation = rotation;\n region.width = width * scale;\n region.height = height * scale;\n spine.Color.rgba8888ToColor(region.color, color);\n region.updateOffset();\n return region;\n }\n case spine.AttachmentType.BoundingBox: {\n var vertexCount = input.readInt(true);\n var vertices = this.readVertices(input, vertexCount);\n var color = nonessential ? input.readInt32() : 0;\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n if (box == null)\n return null;\n box.worldVerticesLength = vertexCount << 1;\n box.vertices = vertices.vertices;\n box.bones = vertices.bones;\n if (nonessential)\n spine.Color.rgba8888ToColor(box.color, color);\n return box;\n }\n case spine.AttachmentType.Mesh: {\n var path = input.readStringRef();\n var color = input.readInt32();\n var vertexCount = input.readInt(true);\n var uvs = this.readFloatArray(input, vertexCount << 1, 1);\n var triangles = this.readShortArray(input);\n var vertices = this.readVertices(input, vertexCount);\n var hullLength = input.readInt(true);\n var edges = null;\n var width = 0, height = 0;\n if (nonessential) {\n edges = this.readShortArray(input);\n width = input.readFloat();\n height = input.readFloat();\n }\n if (path == null)\n path = name;\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\n if (mesh == null)\n return null;\n mesh.path = path;\n spine.Color.rgba8888ToColor(mesh.color, color);\n mesh.bones = vertices.bones;\n mesh.vertices = vertices.vertices;\n mesh.worldVerticesLength = vertexCount << 1;\n mesh.triangles = triangles;\n mesh.regionUVs = uvs;\n mesh.updateUVs();\n mesh.hullLength = hullLength << 1;\n if (nonessential) {\n mesh.edges = edges;\n mesh.width = width * scale;\n mesh.height = height * scale;\n }\n return mesh;\n }\n case spine.AttachmentType.LinkedMesh: {\n var path = input.readStringRef();\n var color = input.readInt32();\n var skinName = input.readStringRef();\n var parent_4 = input.readStringRef();\n var inheritDeform = input.readBoolean();\n var width = 0, height = 0;\n if (nonessential) {\n width = input.readFloat();\n height = input.readFloat();\n }\n if (path == null)\n path = name;\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\n if (mesh == null)\n return null;\n mesh.path = path;\n spine.Color.rgba8888ToColor(mesh.color, color);\n if (nonessential) {\n mesh.width = width * scale;\n mesh.height = height * scale;\n }\n this.linkedMeshes.push(new LinkedMesh(mesh, skinName, slotIndex, parent_4, inheritDeform));\n return mesh;\n }\n case spine.AttachmentType.Path: {\n var closed_1 = input.readBoolean();\n var constantSpeed = input.readBoolean();\n var vertexCount = input.readInt(true);\n var vertices = this.readVertices(input, vertexCount);\n var lengths = spine.Utils.newArray(vertexCount / 3, 0);\n for (var i = 0, n = lengths.length; i < n; i++)\n lengths[i] = input.readFloat() * scale;\n var color = nonessential ? input.readInt32() : 0;\n var path = this.attachmentLoader.newPathAttachment(skin, name);\n if (path == null)\n return null;\n path.closed = closed_1;\n path.constantSpeed = constantSpeed;\n path.worldVerticesLength = vertexCount << 1;\n path.vertices = vertices.vertices;\n path.bones = vertices.bones;\n path.lengths = lengths;\n if (nonessential)\n spine.Color.rgba8888ToColor(path.color, color);\n return path;\n }\n case spine.AttachmentType.Point: {\n var rotation = input.readFloat();\n var x = input.readFloat();\n var y = input.readFloat();\n var color = nonessential ? input.readInt32() : 0;\n var point = this.attachmentLoader.newPointAttachment(skin, name);\n if (point == null)\n return null;\n point.x = x * scale;\n point.y = y * scale;\n point.rotation = rotation;\n if (nonessential)\n spine.Color.rgba8888ToColor(point.color, color);\n return point;\n }\n case spine.AttachmentType.Clipping: {\n var endSlotIndex = input.readInt(true);\n var vertexCount = input.readInt(true);\n var vertices = this.readVertices(input, vertexCount);\n var color = nonessential ? input.readInt32() : 0;\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\n if (clip == null)\n return null;\n clip.endSlot = skeletonData.slots[endSlotIndex];\n clip.worldVerticesLength = vertexCount << 1;\n clip.vertices = vertices.vertices;\n clip.bones = vertices.bones;\n if (nonessential)\n spine.Color.rgba8888ToColor(clip.color, color);\n return clip;\n }\n }\n return null;\n };\n SkeletonBinary.prototype.readVertices = function (input, vertexCount) {\n var verticesLength = vertexCount << 1;\n var vertices = new Vertices();\n var scale = this.scale;\n if (!input.readBoolean()) {\n vertices.vertices = this.readFloatArray(input, verticesLength, scale);\n return vertices;\n }\n var weights = new Array();\n var bonesArray = new Array();\n for (var i = 0; i < vertexCount; i++) {\n var boneCount = input.readInt(true);\n bonesArray.push(boneCount);\n for (var ii = 0; ii < boneCount; ii++) {\n bonesArray.push(input.readInt(true));\n weights.push(input.readFloat() * scale);\n weights.push(input.readFloat() * scale);\n weights.push(input.readFloat());\n }\n }\n vertices.vertices = spine.Utils.toFloatArray(weights);\n vertices.bones = bonesArray;\n return vertices;\n };\n SkeletonBinary.prototype.readFloatArray = function (input, n, scale) {\n var array = new Array(n);\n if (scale == 1) {\n for (var i = 0; i < n; i++)\n array[i] = input.readFloat();\n }\n else {\n for (var i = 0; i < n; i++)\n array[i] = input.readFloat() * scale;\n }\n return array;\n };\n SkeletonBinary.prototype.readShortArray = function (input) {\n var n = input.readInt(true);\n var array = new Array(n);\n for (var i = 0; i < n; i++)\n array[i] = input.readShort();\n return array;\n };\n SkeletonBinary.prototype.readAnimation = function (input, name, skeletonData) {\n var timelines = new Array();\n var scale = this.scale;\n var duration = 0;\n var tempColor1 = new spine.Color();\n var tempColor2 = new spine.Color();\n for (var i = 0, n = input.readInt(true); i < n; i++) {\n var slotIndex = input.readInt(true);\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n var timelineType = input.readByte();\n var frameCount = input.readInt(true);\n switch (timelineType) {\n case SkeletonBinary.SLOT_ATTACHMENT: {\n var timeline = new spine.AttachmentTimeline(frameCount);\n timeline.slotIndex = slotIndex;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++)\n timeline.setFrame(frameIndex, input.readFloat(), input.readStringRef());\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\n break;\n }\n case SkeletonBinary.SLOT_COLOR: {\n var timeline = new spine.ColorTimeline(frameCount);\n timeline.slotIndex = slotIndex;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n var time = input.readFloat();\n spine.Color.rgba8888ToColor(tempColor1, input.readInt32());\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a);\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.ColorTimeline.ENTRIES]);\n break;\n }\n case SkeletonBinary.SLOT_TWO_COLOR: {\n var timeline = new spine.TwoColorTimeline(frameCount);\n timeline.slotIndex = slotIndex;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n var time = input.readFloat();\n spine.Color.rgba8888ToColor(tempColor1, input.readInt32());\n spine.Color.rgb888ToColor(tempColor2, input.readInt32());\n timeline.setFrame(frameIndex, time, tempColor1.r, tempColor1.g, tempColor1.b, tempColor1.a, tempColor2.r, tempColor2.g, tempColor2.b);\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.TwoColorTimeline.ENTRIES]);\n break;\n }\n }\n }\n }\n for (var i = 0, n = input.readInt(true); i < n; i++) {\n var boneIndex = input.readInt(true);\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n var timelineType = input.readByte();\n var frameCount = input.readInt(true);\n switch (timelineType) {\n case SkeletonBinary.BONE_ROTATE: {\n var timeline = new spine.RotateTimeline(frameCount);\n timeline.boneIndex = boneIndex;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat());\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.RotateTimeline.ENTRIES]);\n break;\n }\n case SkeletonBinary.BONE_TRANSLATE:\n case SkeletonBinary.BONE_SCALE:\n case SkeletonBinary.BONE_SHEAR: {\n var timeline = void 0;\n var timelineScale = 1;\n if (timelineType == SkeletonBinary.BONE_SCALE)\n timeline = new spine.ScaleTimeline(frameCount);\n else if (timelineType == SkeletonBinary.BONE_SHEAR)\n timeline = new spine.ShearTimeline(frameCount);\n else {\n timeline = new spine.TranslateTimeline(frameCount);\n timelineScale = scale;\n }\n timeline.boneIndex = boneIndex;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale, input.readFloat() * timelineScale);\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.TranslateTimeline.ENTRIES]);\n break;\n }\n }\n }\n }\n for (var i = 0, n = input.readInt(true); i < n; i++) {\n var index = input.readInt(true);\n var frameCount = input.readInt(true);\n var timeline = new spine.IkConstraintTimeline(frameCount);\n timeline.ikConstraintIndex = index;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat() * scale, input.readByte(), input.readBoolean(), input.readBoolean());\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.IkConstraintTimeline.ENTRIES]);\n }\n for (var i = 0, n = input.readInt(true); i < n; i++) {\n var index = input.readInt(true);\n var frameCount = input.readInt(true);\n var timeline = new spine.TransformConstraintTimeline(frameCount);\n timeline.transformConstraintIndex = index;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.TransformConstraintTimeline.ENTRIES]);\n }\n for (var i = 0, n = input.readInt(true); i < n; i++) {\n var index = input.readInt(true);\n var data = skeletonData.pathConstraints[index];\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n var timelineType = input.readByte();\n var frameCount = input.readInt(true);\n switch (timelineType) {\n case SkeletonBinary.PATH_POSITION:\n case SkeletonBinary.PATH_SPACING: {\n var timeline = void 0;\n var timelineScale = 1;\n if (timelineType == SkeletonBinary.PATH_SPACING) {\n timeline = new spine.PathConstraintSpacingTimeline(frameCount);\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\n timelineScale = scale;\n }\n else {\n timeline = new spine.PathConstraintPositionTimeline(frameCount);\n if (data.positionMode == spine.PositionMode.Fixed)\n timelineScale = scale;\n }\n timeline.pathConstraintIndex = index;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat() * timelineScale);\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\n break;\n }\n case SkeletonBinary.PATH_MIX: {\n var timeline = new spine.PathConstraintMixTimeline(frameCount);\n timeline.pathConstraintIndex = index;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n timeline.setFrame(frameIndex, input.readFloat(), input.readFloat(), input.readFloat());\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(frameCount - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\n break;\n }\n }\n }\n }\n for (var i = 0, n = input.readInt(true); i < n; i++) {\n var skin = skeletonData.skins[input.readInt(true)];\n for (var ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n var slotIndex = input.readInt(true);\n for (var iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\n var attachment = skin.getAttachment(slotIndex, input.readStringRef());\n var weighted = attachment.bones != null;\n var vertices = attachment.vertices;\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n var frameCount = input.readInt(true);\n var timeline = new spine.DeformTimeline(frameCount);\n timeline.slotIndex = slotIndex;\n timeline.attachment = attachment;\n for (var frameIndex = 0; frameIndex < frameCount; frameIndex++) {\n var time = input.readFloat();\n var deform = void 0;\n var end = input.readInt(true);\n if (end == 0)\n deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\n else {\n deform = spine.Utils.newFloatArray(deformLength);\n var start = input.readInt(true);\n end += start;\n if (scale == 1) {\n for (var v = start; v < end; v++)\n deform[v] = input.readFloat();\n }\n else {\n for (var v = start; v < end; v++)\n deform[v] = input.readFloat() * scale;\n }\n if (!weighted) {\n for (var v = 0, vn = deform.length; v < vn; v++)\n deform[v] += vertices[v];\n }\n }\n timeline.setFrame(frameIndex, time, deform);\n if (frameIndex < frameCount - 1)\n this.readCurve(input, frameIndex, timeline);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[frameCount - 1]);\n }\n }\n }\n var drawOrderCount = input.readInt(true);\n if (drawOrderCount > 0) {\n var timeline = new spine.DrawOrderTimeline(drawOrderCount);\n var slotCount = skeletonData.slots.length;\n for (var i = 0; i < drawOrderCount; i++) {\n var time = input.readFloat();\n var offsetCount = input.readInt(true);\n var drawOrder = spine.Utils.newArray(slotCount, 0);\n for (var ii = slotCount - 1; ii >= 0; ii--)\n drawOrder[ii] = -1;\n var unchanged = spine.Utils.newArray(slotCount - offsetCount, 0);\n var originalIndex = 0, unchangedIndex = 0;\n for (var ii = 0; ii < offsetCount; ii++) {\n var slotIndex = input.readInt(true);\n while (originalIndex != slotIndex)\n unchanged[unchangedIndex++] = originalIndex++;\n drawOrder[originalIndex + input.readInt(true)] = originalIndex++;\n }\n while (originalIndex < slotCount)\n unchanged[unchangedIndex++] = originalIndex++;\n for (var ii = slotCount - 1; ii >= 0; ii--)\n if (drawOrder[ii] == -1)\n drawOrder[ii] = unchanged[--unchangedIndex];\n timeline.setFrame(i, time, drawOrder);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[drawOrderCount - 1]);\n }\n var eventCount = input.readInt(true);\n if (eventCount > 0) {\n var timeline = new spine.EventTimeline(eventCount);\n for (var i = 0; i < eventCount; i++) {\n var time = input.readFloat();\n var eventData = skeletonData.events[input.readInt(true)];\n var event_4 = new spine.Event(time, eventData);\n event_4.intValue = input.readInt(false);\n event_4.floatValue = input.readFloat();\n event_4.stringValue = input.readBoolean() ? input.readString() : eventData.stringValue;\n if (event_4.data.audioPath != null) {\n event_4.volume = input.readFloat();\n event_4.balance = input.readFloat();\n }\n timeline.setFrame(i, event_4);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[eventCount - 1]);\n }\n return new spine.Animation(name, timelines, duration);\n };\n SkeletonBinary.prototype.readCurve = function (input, frameIndex, timeline) {\n switch (input.readByte()) {\n case SkeletonBinary.CURVE_STEPPED:\n timeline.setStepped(frameIndex);\n break;\n case SkeletonBinary.CURVE_BEZIER:\n this.setCurve(timeline, frameIndex, input.readFloat(), input.readFloat(), input.readFloat(), input.readFloat());\n break;\n }\n };\n SkeletonBinary.prototype.setCurve = function (timeline, frameIndex, cx1, cy1, cx2, cy2) {\n timeline.setCurve(frameIndex, cx1, cy1, cx2, cy2);\n };\n SkeletonBinary.AttachmentTypeValues = [0, 1, 2, 3, 4, 5, 6];\n SkeletonBinary.TransformModeValues = [spine.TransformMode.Normal, spine.TransformMode.OnlyTranslation, spine.TransformMode.NoRotationOrReflection, spine.TransformMode.NoScale, spine.TransformMode.NoScaleOrReflection];\n SkeletonBinary.PositionModeValues = [spine.PositionMode.Fixed, spine.PositionMode.Percent];\n SkeletonBinary.SpacingModeValues = [spine.SpacingMode.Length, spine.SpacingMode.Fixed, spine.SpacingMode.Percent];\n SkeletonBinary.RotateModeValues = [spine.RotateMode.Tangent, spine.RotateMode.Chain, spine.RotateMode.ChainScale];\n SkeletonBinary.BlendModeValues = [spine.BlendMode.Normal, spine.BlendMode.Additive, spine.BlendMode.Multiply, spine.BlendMode.Screen];\n SkeletonBinary.BONE_ROTATE = 0;\n SkeletonBinary.BONE_TRANSLATE = 1;\n SkeletonBinary.BONE_SCALE = 2;\n SkeletonBinary.BONE_SHEAR = 3;\n SkeletonBinary.SLOT_ATTACHMENT = 0;\n SkeletonBinary.SLOT_COLOR = 1;\n SkeletonBinary.SLOT_TWO_COLOR = 2;\n SkeletonBinary.PATH_POSITION = 0;\n SkeletonBinary.PATH_SPACING = 1;\n SkeletonBinary.PATH_MIX = 2;\n SkeletonBinary.CURVE_LINEAR = 0;\n SkeletonBinary.CURVE_STEPPED = 1;\n SkeletonBinary.CURVE_BEZIER = 2;\n return SkeletonBinary;\n }());\n spine.SkeletonBinary = SkeletonBinary;\n var BinaryInput = (function () {\n function BinaryInput(data, strings, index, buffer) {\n if (strings === void 0) { strings = new Array(); }\n if (index === void 0) { index = 0; }\n if (buffer === void 0) { buffer = new DataView(data.buffer); }\n this.strings = strings;\n this.index = index;\n this.buffer = buffer;\n }\n BinaryInput.prototype.readByte = function () {\n return this.buffer.getInt8(this.index++);\n };\n BinaryInput.prototype.readShort = function () {\n var value = this.buffer.getInt16(this.index);\n this.index += 2;\n return value;\n };\n BinaryInput.prototype.readInt32 = function () {\n var value = this.buffer.getInt32(this.index);\n this.index += 4;\n return value;\n };\n BinaryInput.prototype.readInt = function (optimizePositive) {\n var b = this.readByte();\n var result = b & 0x7F;\n if ((b & 0x80) != 0) {\n b = this.readByte();\n result |= (b & 0x7F) << 7;\n if ((b & 0x80) != 0) {\n b = this.readByte();\n result |= (b & 0x7F) << 14;\n if ((b & 0x80) != 0) {\n b = this.readByte();\n result |= (b & 0x7F) << 21;\n if ((b & 0x80) != 0) {\n b = this.readByte();\n result |= (b & 0x7F) << 28;\n }\n }\n }\n }\n return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\n };\n BinaryInput.prototype.readStringRef = function () {\n var index = this.readInt(true);\n return index == 0 ? null : this.strings[index - 1];\n };\n BinaryInput.prototype.readString = function () {\n var byteCount = this.readInt(true);\n switch (byteCount) {\n case 0:\n return null;\n case 1:\n return \"\";\n }\n byteCount--;\n var chars = \"\";\n var charCount = 0;\n for (var i = 0; i < byteCount;) {\n var b = this.readByte();\n switch (b >> 4) {\n case 12:\n case 13:\n chars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\n i += 2;\n break;\n case 14:\n chars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\n i += 3;\n break;\n default:\n chars += String.fromCharCode(b);\n i++;\n }\n }\n return chars;\n };\n BinaryInput.prototype.readFloat = function () {\n var value = this.buffer.getFloat32(this.index);\n this.index += 4;\n return value;\n };\n BinaryInput.prototype.readBoolean = function () {\n return this.readByte() != 0;\n };\n return BinaryInput;\n }());\n var LinkedMesh = (function () {\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\n this.mesh = mesh;\n this.skin = skin;\n this.slotIndex = slotIndex;\n this.parent = parent;\n this.inheritDeform = inheritDeform;\n }\n return LinkedMesh;\n }());\n var Vertices = (function () {\n function Vertices(bones, vertices) {\n if (bones === void 0) { bones = null; }\n if (vertices === void 0) { vertices = null; }\n this.bones = bones;\n this.vertices = vertices;\n }\n return Vertices;\n }());\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SkeletonBounds = (function () {\n function SkeletonBounds() {\n this.minX = 0;\n this.minY = 0;\n this.maxX = 0;\n this.maxY = 0;\n this.boundingBoxes = new Array();\n this.polygons = new Array();\n this.polygonPool = new spine.Pool(function () {\n return spine.Utils.newFloatArray(16);\n });\n }\n SkeletonBounds.prototype.update = function (skeleton, updateAabb) {\n if (skeleton == null)\n throw new Error(\"skeleton cannot be null.\");\n var boundingBoxes = this.boundingBoxes;\n var polygons = this.polygons;\n var polygonPool = this.polygonPool;\n var slots = skeleton.slots;\n var slotCount = slots.length;\n boundingBoxes.length = 0;\n polygonPool.freeAll(polygons);\n polygons.length = 0;\n for (var i = 0; i < slotCount; i++) {\n var slot = slots[i];\n if (!slot.bone.active)\n continue;\n var attachment = slot.getAttachment();\n if (attachment instanceof spine.BoundingBoxAttachment) {\n var boundingBox = attachment;\n boundingBoxes.push(boundingBox);\n var polygon = polygonPool.obtain();\n if (polygon.length != boundingBox.worldVerticesLength) {\n polygon = spine.Utils.newFloatArray(boundingBox.worldVerticesLength);\n }\n polygons.push(polygon);\n boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\n }\n }\n if (updateAabb) {\n this.aabbCompute();\n }\n else {\n this.minX = Number.POSITIVE_INFINITY;\n this.minY = Number.POSITIVE_INFINITY;\n this.maxX = Number.NEGATIVE_INFINITY;\n this.maxY = Number.NEGATIVE_INFINITY;\n }\n };\n SkeletonBounds.prototype.aabbCompute = function () {\n var minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n var polygons = this.polygons;\n for (var i = 0, n = polygons.length; i < n; i++) {\n var polygon = polygons[i];\n var vertices = polygon;\n for (var ii = 0, nn = polygon.length; ii < nn; ii += 2) {\n var x = vertices[ii];\n var y = vertices[ii + 1];\n minX = Math.min(minX, x);\n minY = Math.min(minY, y);\n maxX = Math.max(maxX, x);\n maxY = Math.max(maxY, y);\n }\n }\n this.minX = minX;\n this.minY = minY;\n this.maxX = maxX;\n this.maxY = maxY;\n };\n SkeletonBounds.prototype.aabbContainsPoint = function (x, y) {\n return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\n };\n SkeletonBounds.prototype.aabbIntersectsSegment = function (x1, y1, x2, y2) {\n var minX = this.minX;\n var minY = this.minY;\n var maxX = this.maxX;\n var maxY = this.maxY;\n if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\n return false;\n var m = (y2 - y1) / (x2 - x1);\n var y = m * (minX - x1) + y1;\n if (y > minY && y < maxY)\n return true;\n y = m * (maxX - x1) + y1;\n if (y > minY && y < maxY)\n return true;\n var x = (minY - y1) / m + x1;\n if (x > minX && x < maxX)\n return true;\n x = (maxY - y1) / m + x1;\n if (x > minX && x < maxX)\n return true;\n return false;\n };\n SkeletonBounds.prototype.aabbIntersectsSkeleton = function (bounds) {\n return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\n };\n SkeletonBounds.prototype.containsPoint = function (x, y) {\n var polygons = this.polygons;\n for (var i = 0, n = polygons.length; i < n; i++)\n if (this.containsPointPolygon(polygons[i], x, y))\n return this.boundingBoxes[i];\n return null;\n };\n SkeletonBounds.prototype.containsPointPolygon = function (polygon, x, y) {\n var vertices = polygon;\n var nn = polygon.length;\n var prevIndex = nn - 2;\n var inside = false;\n for (var ii = 0; ii < nn; ii += 2) {\n var vertexY = vertices[ii + 1];\n var prevY = vertices[prevIndex + 1];\n if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\n var vertexX = vertices[ii];\n if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x)\n inside = !inside;\n }\n prevIndex = ii;\n }\n return inside;\n };\n SkeletonBounds.prototype.intersectsSegment = function (x1, y1, x2, y2) {\n var polygons = this.polygons;\n for (var i = 0, n = polygons.length; i < n; i++)\n if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2))\n return this.boundingBoxes[i];\n return null;\n };\n SkeletonBounds.prototype.intersectsSegmentPolygon = function (polygon, x1, y1, x2, y2) {\n var vertices = polygon;\n var nn = polygon.length;\n var width12 = x1 - x2, height12 = y1 - y2;\n var det1 = x1 * y2 - y1 * x2;\n var x3 = vertices[nn - 2], y3 = vertices[nn - 1];\n for (var ii = 0; ii < nn; ii += 2) {\n var x4 = vertices[ii], y4 = vertices[ii + 1];\n var det2 = x3 * y4 - y3 * x4;\n var width34 = x3 - x4, height34 = y3 - y4;\n var det3 = width12 * height34 - height12 * width34;\n var x = (det1 * width34 - width12 * det2) / det3;\n if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\n var y = (det1 * height34 - height12 * det2) / det3;\n if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1)))\n return true;\n }\n x3 = x4;\n y3 = y4;\n }\n return false;\n };\n SkeletonBounds.prototype.getPolygon = function (boundingBox) {\n if (boundingBox == null)\n throw new Error(\"boundingBox cannot be null.\");\n var index = this.boundingBoxes.indexOf(boundingBox);\n return index == -1 ? null : this.polygons[index];\n };\n SkeletonBounds.prototype.getWidth = function () {\n return this.maxX - this.minX;\n };\n SkeletonBounds.prototype.getHeight = function () {\n return this.maxY - this.minY;\n };\n return SkeletonBounds;\n }());\n spine.SkeletonBounds = SkeletonBounds;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SkeletonClipping = (function () {\n function SkeletonClipping() {\n this.triangulator = new spine.Triangulator();\n this.clippingPolygon = new Array();\n this.clipOutput = new Array();\n this.clippedVertices = new Array();\n this.clippedTriangles = new Array();\n this.scratch = new Array();\n }\n SkeletonClipping.prototype.clipStart = function (slot, clip) {\n if (this.clipAttachment != null)\n return 0;\n this.clipAttachment = clip;\n var n = clip.worldVerticesLength;\n var vertices = spine.Utils.setArraySize(this.clippingPolygon, n);\n clip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\n var clippingPolygon = this.clippingPolygon;\n SkeletonClipping.makeClockwise(clippingPolygon);\n var clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\n for (var i = 0, n_2 = clippingPolygons.length; i < n_2; i++) {\n var polygon = clippingPolygons[i];\n SkeletonClipping.makeClockwise(polygon);\n polygon.push(polygon[0]);\n polygon.push(polygon[1]);\n }\n return clippingPolygons.length;\n };\n SkeletonClipping.prototype.clipEndWithSlot = function (slot) {\n if (this.clipAttachment != null && this.clipAttachment.endSlot == slot.data)\n this.clipEnd();\n };\n SkeletonClipping.prototype.clipEnd = function () {\n if (this.clipAttachment == null)\n return;\n this.clipAttachment = null;\n this.clippingPolygons = null;\n this.clippedVertices.length = 0;\n this.clippedTriangles.length = 0;\n this.clippingPolygon.length = 0;\n };\n SkeletonClipping.prototype.isClipping = function () {\n return this.clipAttachment != null;\n };\n SkeletonClipping.prototype.clipTriangles = function (vertices, verticesLength, triangles, trianglesLength, uvs, light, dark, twoColor) {\n var clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n var clippedTriangles = this.clippedTriangles;\n var polygons = this.clippingPolygons;\n var polygonsCount = this.clippingPolygons.length;\n var vertexSize = twoColor ? 12 : 8;\n var index = 0;\n clippedVertices.length = 0;\n clippedTriangles.length = 0;\n outer: for (var i = 0; i < trianglesLength; i += 3) {\n var vertexOffset = triangles[i] << 1;\n var x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n var u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\n vertexOffset = triangles[i + 1] << 1;\n var x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n var u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\n vertexOffset = triangles[i + 2] << 1;\n var x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n var u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\n for (var p = 0; p < polygonsCount; p++) {\n var s = clippedVertices.length;\n if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n var clipOutputLength = clipOutput.length;\n if (clipOutputLength == 0)\n continue;\n var d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n var d = 1 / (d0 * d2 + d1 * (y1 - y3));\n var clipOutputCount = clipOutputLength >> 1;\n var clipOutputItems = this.clipOutput;\n var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\n for (var ii = 0; ii < clipOutputLength; ii += 2) {\n var x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n clippedVerticesItems[s] = x;\n clippedVerticesItems[s + 1] = y;\n clippedVerticesItems[s + 2] = light.r;\n clippedVerticesItems[s + 3] = light.g;\n clippedVerticesItems[s + 4] = light.b;\n clippedVerticesItems[s + 5] = light.a;\n var c0 = x - x3, c1 = y - y3;\n var a = (d0 * c0 + d1 * c1) * d;\n var b = (d4 * c0 + d2 * c1) * d;\n var c = 1 - a - b;\n clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\n clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\n if (twoColor) {\n clippedVerticesItems[s + 8] = dark.r;\n clippedVerticesItems[s + 9] = dark.g;\n clippedVerticesItems[s + 10] = dark.b;\n clippedVerticesItems[s + 11] = dark.a;\n }\n s += vertexSize;\n }\n s = clippedTriangles.length;\n var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n clipOutputCount--;\n for (var ii = 1; ii < clipOutputCount; ii++) {\n clippedTrianglesItems[s] = index;\n clippedTrianglesItems[s + 1] = (index + ii);\n clippedTrianglesItems[s + 2] = (index + ii + 1);\n s += 3;\n }\n index += clipOutputCount + 1;\n }\n else {\n var clippedVerticesItems = spine.Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\n clippedVerticesItems[s] = x1;\n clippedVerticesItems[s + 1] = y1;\n clippedVerticesItems[s + 2] = light.r;\n clippedVerticesItems[s + 3] = light.g;\n clippedVerticesItems[s + 4] = light.b;\n clippedVerticesItems[s + 5] = light.a;\n if (!twoColor) {\n clippedVerticesItems[s + 6] = u1;\n clippedVerticesItems[s + 7] = v1;\n clippedVerticesItems[s + 8] = x2;\n clippedVerticesItems[s + 9] = y2;\n clippedVerticesItems[s + 10] = light.r;\n clippedVerticesItems[s + 11] = light.g;\n clippedVerticesItems[s + 12] = light.b;\n clippedVerticesItems[s + 13] = light.a;\n clippedVerticesItems[s + 14] = u2;\n clippedVerticesItems[s + 15] = v2;\n clippedVerticesItems[s + 16] = x3;\n clippedVerticesItems[s + 17] = y3;\n clippedVerticesItems[s + 18] = light.r;\n clippedVerticesItems[s + 19] = light.g;\n clippedVerticesItems[s + 20] = light.b;\n clippedVerticesItems[s + 21] = light.a;\n clippedVerticesItems[s + 22] = u3;\n clippedVerticesItems[s + 23] = v3;\n }\n else {\n clippedVerticesItems[s + 6] = u1;\n clippedVerticesItems[s + 7] = v1;\n clippedVerticesItems[s + 8] = dark.r;\n clippedVerticesItems[s + 9] = dark.g;\n clippedVerticesItems[s + 10] = dark.b;\n clippedVerticesItems[s + 11] = dark.a;\n clippedVerticesItems[s + 12] = x2;\n clippedVerticesItems[s + 13] = y2;\n clippedVerticesItems[s + 14] = light.r;\n clippedVerticesItems[s + 15] = light.g;\n clippedVerticesItems[s + 16] = light.b;\n clippedVerticesItems[s + 17] = light.a;\n clippedVerticesItems[s + 18] = u2;\n clippedVerticesItems[s + 19] = v2;\n clippedVerticesItems[s + 20] = dark.r;\n clippedVerticesItems[s + 21] = dark.g;\n clippedVerticesItems[s + 22] = dark.b;\n clippedVerticesItems[s + 23] = dark.a;\n clippedVerticesItems[s + 24] = x3;\n clippedVerticesItems[s + 25] = y3;\n clippedVerticesItems[s + 26] = light.r;\n clippedVerticesItems[s + 27] = light.g;\n clippedVerticesItems[s + 28] = light.b;\n clippedVerticesItems[s + 29] = light.a;\n clippedVerticesItems[s + 30] = u3;\n clippedVerticesItems[s + 31] = v3;\n clippedVerticesItems[s + 32] = dark.r;\n clippedVerticesItems[s + 33] = dark.g;\n clippedVerticesItems[s + 34] = dark.b;\n clippedVerticesItems[s + 35] = dark.a;\n }\n s = clippedTriangles.length;\n var clippedTrianglesItems = spine.Utils.setArraySize(clippedTriangles, s + 3);\n clippedTrianglesItems[s] = index;\n clippedTrianglesItems[s + 1] = (index + 1);\n clippedTrianglesItems[s + 2] = (index + 2);\n index += 3;\n continue outer;\n }\n }\n }\n };\n SkeletonClipping.prototype.clip = function (x1, y1, x2, y2, x3, y3, clippingArea, output) {\n var originalOutput = output;\n var clipped = false;\n var input = null;\n if (clippingArea.length % 4 >= 2) {\n input = output;\n output = this.scratch;\n }\n else\n input = this.scratch;\n input.length = 0;\n input.push(x1);\n input.push(y1);\n input.push(x2);\n input.push(y2);\n input.push(x3);\n input.push(y3);\n input.push(x1);\n input.push(y1);\n output.length = 0;\n var clippingVertices = clippingArea;\n var clippingVerticesLast = clippingArea.length - 4;\n for (var i = 0;; i += 2) {\n var edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\n var edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3];\n var deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2;\n var inputVertices = input;\n var inputVerticesLength = input.length - 2, outputStart = output.length;\n for (var ii = 0; ii < inputVerticesLength; ii += 2) {\n var inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\n var inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3];\n var side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0;\n if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) {\n if (side2) {\n output.push(inputX2);\n output.push(inputY2);\n continue;\n }\n var c0 = inputY2 - inputY, c2 = inputX2 - inputX;\n var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\n if (Math.abs(s) > 0.000001) {\n var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\n output.push(edgeX + (edgeX2 - edgeX) * ua);\n output.push(edgeY + (edgeY2 - edgeY) * ua);\n }\n else {\n output.push(edgeX);\n output.push(edgeY);\n }\n }\n else if (side2) {\n var c0 = inputY2 - inputY, c2 = inputX2 - inputX;\n var s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY);\n if (Math.abs(s) > 0.000001) {\n var ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s;\n output.push(edgeX + (edgeX2 - edgeX) * ua);\n output.push(edgeY + (edgeY2 - edgeY) * ua);\n }\n else {\n output.push(edgeX);\n output.push(edgeY);\n }\n output.push(inputX2);\n output.push(inputY2);\n }\n clipped = true;\n }\n if (outputStart == output.length) {\n originalOutput.length = 0;\n return true;\n }\n output.push(output[0]);\n output.push(output[1]);\n if (i == clippingVerticesLast)\n break;\n var temp = output;\n output = input;\n output.length = 0;\n input = temp;\n }\n if (originalOutput != output) {\n originalOutput.length = 0;\n for (var i = 0, n = output.length - 2; i < n; i++)\n originalOutput[i] = output[i];\n }\n else\n originalOutput.length = originalOutput.length - 2;\n return clipped;\n };\n SkeletonClipping.makeClockwise = function (polygon) {\n var vertices = polygon;\n var verticeslength = polygon.length;\n var area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\n for (var i = 0, n = verticeslength - 3; i < n; i += 2) {\n p1x = vertices[i];\n p1y = vertices[i + 1];\n p2x = vertices[i + 2];\n p2y = vertices[i + 3];\n area += p1x * p2y - p2x * p1y;\n }\n if (area < 0)\n return;\n for (var i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\n var x = vertices[i], y = vertices[i + 1];\n var other = lastX - i;\n vertices[i] = vertices[other];\n vertices[i + 1] = vertices[other + 1];\n vertices[other] = x;\n vertices[other + 1] = y;\n }\n };\n return SkeletonClipping;\n }());\n spine.SkeletonClipping = SkeletonClipping;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SkeletonData = (function () {\n function SkeletonData() {\n this.bones = new Array();\n this.slots = new Array();\n this.skins = new Array();\n this.events = new Array();\n this.animations = new Array();\n this.ikConstraints = new Array();\n this.transformConstraints = new Array();\n this.pathConstraints = new Array();\n this.fps = 0;\n }\n SkeletonData.prototype.findBone = function (boneName) {\n if (boneName == null)\n throw new Error(\"boneName cannot be null.\");\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n if (bone.name == boneName)\n return bone;\n }\n return null;\n };\n SkeletonData.prototype.findBoneIndex = function (boneName) {\n if (boneName == null)\n throw new Error(\"boneName cannot be null.\");\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++)\n if (bones[i].name == boneName)\n return i;\n return -1;\n };\n SkeletonData.prototype.findSlot = function (slotName) {\n if (slotName == null)\n throw new Error(\"slotName cannot be null.\");\n var slots = this.slots;\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n if (slot.name == slotName)\n return slot;\n }\n return null;\n };\n SkeletonData.prototype.findSlotIndex = function (slotName) {\n if (slotName == null)\n throw new Error(\"slotName cannot be null.\");\n var slots = this.slots;\n for (var i = 0, n = slots.length; i < n; i++)\n if (slots[i].name == slotName)\n return i;\n return -1;\n };\n SkeletonData.prototype.findSkin = function (skinName) {\n if (skinName == null)\n throw new Error(\"skinName cannot be null.\");\n var skins = this.skins;\n for (var i = 0, n = skins.length; i < n; i++) {\n var skin = skins[i];\n if (skin.name == skinName)\n return skin;\n }\n return null;\n };\n SkeletonData.prototype.findEvent = function (eventDataName) {\n if (eventDataName == null)\n throw new Error(\"eventDataName cannot be null.\");\n var events = this.events;\n for (var i = 0, n = events.length; i < n; i++) {\n var event_5 = events[i];\n if (event_5.name == eventDataName)\n return event_5;\n }\n return null;\n };\n SkeletonData.prototype.findAnimation = function (animationName) {\n if (animationName == null)\n throw new Error(\"animationName cannot be null.\");\n var animations = this.animations;\n for (var i = 0, n = animations.length; i < n; i++) {\n var animation = animations[i];\n if (animation.name == animationName)\n return animation;\n }\n return null;\n };\n SkeletonData.prototype.findIkConstraint = function (constraintName) {\n if (constraintName == null)\n throw new Error(\"constraintName cannot be null.\");\n var ikConstraints = this.ikConstraints;\n for (var i = 0, n = ikConstraints.length; i < n; i++) {\n var constraint = ikConstraints[i];\n if (constraint.name == constraintName)\n return constraint;\n }\n return null;\n };\n SkeletonData.prototype.findTransformConstraint = function (constraintName) {\n if (constraintName == null)\n throw new Error(\"constraintName cannot be null.\");\n var transformConstraints = this.transformConstraints;\n for (var i = 0, n = transformConstraints.length; i < n; i++) {\n var constraint = transformConstraints[i];\n if (constraint.name == constraintName)\n return constraint;\n }\n return null;\n };\n SkeletonData.prototype.findPathConstraint = function (constraintName) {\n if (constraintName == null)\n throw new Error(\"constraintName cannot be null.\");\n var pathConstraints = this.pathConstraints;\n for (var i = 0, n = pathConstraints.length; i < n; i++) {\n var constraint = pathConstraints[i];\n if (constraint.name == constraintName)\n return constraint;\n }\n return null;\n };\n SkeletonData.prototype.findPathConstraintIndex = function (pathConstraintName) {\n if (pathConstraintName == null)\n throw new Error(\"pathConstraintName cannot be null.\");\n var pathConstraints = this.pathConstraints;\n for (var i = 0, n = pathConstraints.length; i < n; i++)\n if (pathConstraints[i].name == pathConstraintName)\n return i;\n return -1;\n };\n return SkeletonData;\n }());\n spine.SkeletonData = SkeletonData;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SkeletonJson = (function () {\n function SkeletonJson(attachmentLoader) {\n this.scale = 1;\n this.linkedMeshes = new Array();\n this.attachmentLoader = attachmentLoader;\n }\n SkeletonJson.prototype.readSkeletonData = function (json) {\n var scale = this.scale;\n var skeletonData = new spine.SkeletonData();\n var root = typeof (json) === \"string\" ? JSON.parse(json) : json;\n var skeletonMap = root.skeleton;\n if (skeletonMap != null) {\n skeletonData.hash = skeletonMap.hash;\n skeletonData.version = skeletonMap.spine;\n if (\"3.8.75\" == skeletonData.version)\n throw new Error(\"Unsupported skeleton data, please export with a newer version of Spine.\");\n skeletonData.x = skeletonMap.x;\n skeletonData.y = skeletonMap.y;\n skeletonData.width = skeletonMap.width;\n skeletonData.height = skeletonMap.height;\n skeletonData.fps = skeletonMap.fps;\n skeletonData.imagesPath = skeletonMap.images;\n }\n if (root.bones) {\n for (var i = 0; i < root.bones.length; i++) {\n var boneMap = root.bones[i];\n var parent_5 = null;\n var parentName = this.getValue(boneMap, \"parent\", null);\n if (parentName != null) {\n parent_5 = skeletonData.findBone(parentName);\n if (parent_5 == null)\n throw new Error(\"Parent bone not found: \" + parentName);\n }\n var data = new spine.BoneData(skeletonData.bones.length, boneMap.name, parent_5);\n data.length = this.getValue(boneMap, \"length\", 0) * scale;\n data.x = this.getValue(boneMap, \"x\", 0) * scale;\n data.y = this.getValue(boneMap, \"y\", 0) * scale;\n data.rotation = this.getValue(boneMap, \"rotation\", 0);\n data.scaleX = this.getValue(boneMap, \"scaleX\", 1);\n data.scaleY = this.getValue(boneMap, \"scaleY\", 1);\n data.shearX = this.getValue(boneMap, \"shearX\", 0);\n data.shearY = this.getValue(boneMap, \"shearY\", 0);\n data.transformMode = SkeletonJson.transformModeFromString(this.getValue(boneMap, \"transform\", \"normal\"));\n data.skinRequired = this.getValue(boneMap, \"skin\", false);\n skeletonData.bones.push(data);\n }\n }\n if (root.slots) {\n for (var i = 0; i < root.slots.length; i++) {\n var slotMap = root.slots[i];\n var slotName = slotMap.name;\n var boneName = slotMap.bone;\n var boneData = skeletonData.findBone(boneName);\n if (boneData == null)\n throw new Error(\"Slot bone not found: \" + boneName);\n var data = new spine.SlotData(skeletonData.slots.length, slotName, boneData);\n var color = this.getValue(slotMap, \"color\", null);\n if (color != null)\n data.color.setFromString(color);\n var dark = this.getValue(slotMap, \"dark\", null);\n if (dark != null) {\n data.darkColor = new spine.Color(1, 1, 1, 1);\n data.darkColor.setFromString(dark);\n }\n data.attachmentName = this.getValue(slotMap, \"attachment\", null);\n data.blendMode = SkeletonJson.blendModeFromString(this.getValue(slotMap, \"blend\", \"normal\"));\n skeletonData.slots.push(data);\n }\n }\n if (root.ik) {\n for (var i = 0; i < root.ik.length; i++) {\n var constraintMap = root.ik[i];\n var data = new spine.IkConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\n for (var j = 0; j < constraintMap.bones.length; j++) {\n var boneName = constraintMap.bones[j];\n var bone = skeletonData.findBone(boneName);\n if (bone == null)\n throw new Error(\"IK bone not found: \" + boneName);\n data.bones.push(bone);\n }\n var targetName = constraintMap.target;\n data.target = skeletonData.findBone(targetName);\n if (data.target == null)\n throw new Error(\"IK target bone not found: \" + targetName);\n data.mix = this.getValue(constraintMap, \"mix\", 1);\n data.softness = this.getValue(constraintMap, \"softness\", 0) * scale;\n data.bendDirection = this.getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\n data.compress = this.getValue(constraintMap, \"compress\", false);\n data.stretch = this.getValue(constraintMap, \"stretch\", false);\n data.uniform = this.getValue(constraintMap, \"uniform\", false);\n skeletonData.ikConstraints.push(data);\n }\n }\n if (root.transform) {\n for (var i = 0; i < root.transform.length; i++) {\n var constraintMap = root.transform[i];\n var data = new spine.TransformConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\n for (var j = 0; j < constraintMap.bones.length; j++) {\n var boneName = constraintMap.bones[j];\n var bone = skeletonData.findBone(boneName);\n if (bone == null)\n throw new Error(\"Transform constraint bone not found: \" + boneName);\n data.bones.push(bone);\n }\n var targetName = constraintMap.target;\n data.target = skeletonData.findBone(targetName);\n if (data.target == null)\n throw new Error(\"Transform constraint target bone not found: \" + targetName);\n data.local = this.getValue(constraintMap, \"local\", false);\n data.relative = this.getValue(constraintMap, \"relative\", false);\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\n data.offsetX = this.getValue(constraintMap, \"x\", 0) * scale;\n data.offsetY = this.getValue(constraintMap, \"y\", 0) * scale;\n data.offsetScaleX = this.getValue(constraintMap, \"scaleX\", 0);\n data.offsetScaleY = this.getValue(constraintMap, \"scaleY\", 0);\n data.offsetShearY = this.getValue(constraintMap, \"shearY\", 0);\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\n data.scaleMix = this.getValue(constraintMap, \"scaleMix\", 1);\n data.shearMix = this.getValue(constraintMap, \"shearMix\", 1);\n skeletonData.transformConstraints.push(data);\n }\n }\n if (root.path) {\n for (var i = 0; i < root.path.length; i++) {\n var constraintMap = root.path[i];\n var data = new spine.PathConstraintData(constraintMap.name);\n data.order = this.getValue(constraintMap, \"order\", 0);\n data.skinRequired = this.getValue(constraintMap, \"skin\", false);\n for (var j = 0; j < constraintMap.bones.length; j++) {\n var boneName = constraintMap.bones[j];\n var bone = skeletonData.findBone(boneName);\n if (bone == null)\n throw new Error(\"Transform constraint bone not found: \" + boneName);\n data.bones.push(bone);\n }\n var targetName = constraintMap.target;\n data.target = skeletonData.findSlot(targetName);\n if (data.target == null)\n throw new Error(\"Path target slot not found: \" + targetName);\n data.positionMode = SkeletonJson.positionModeFromString(this.getValue(constraintMap, \"positionMode\", \"percent\"));\n data.spacingMode = SkeletonJson.spacingModeFromString(this.getValue(constraintMap, \"spacingMode\", \"length\"));\n data.rotateMode = SkeletonJson.rotateModeFromString(this.getValue(constraintMap, \"rotateMode\", \"tangent\"));\n data.offsetRotation = this.getValue(constraintMap, \"rotation\", 0);\n data.position = this.getValue(constraintMap, \"position\", 0);\n if (data.positionMode == spine.PositionMode.Fixed)\n data.position *= scale;\n data.spacing = this.getValue(constraintMap, \"spacing\", 0);\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\n data.spacing *= scale;\n data.rotateMix = this.getValue(constraintMap, \"rotateMix\", 1);\n data.translateMix = this.getValue(constraintMap, \"translateMix\", 1);\n skeletonData.pathConstraints.push(data);\n }\n }\n if (root.skins) {\n for (var i = 0; i < root.skins.length; i++) {\n var skinMap = root.skins[i];\n var skin = new spine.Skin(skinMap.name);\n if (skinMap.bones) {\n for (var ii = 0; ii < skinMap.bones.length; ii++) {\n var bone = skeletonData.findBone(skinMap.bones[ii]);\n if (bone == null)\n throw new Error(\"Skin bone not found: \" + skinMap.bones[i]);\n skin.bones.push(bone);\n }\n }\n if (skinMap.ik) {\n for (var ii = 0; ii < skinMap.ik.length; ii++) {\n var constraint = skeletonData.findIkConstraint(skinMap.ik[ii]);\n if (constraint == null)\n throw new Error(\"Skin IK constraint not found: \" + skinMap.ik[i]);\n skin.constraints.push(constraint);\n }\n }\n if (skinMap.transform) {\n for (var ii = 0; ii < skinMap.transform.length; ii++) {\n var constraint = skeletonData.findTransformConstraint(skinMap.transform[ii]);\n if (constraint == null)\n throw new Error(\"Skin transform constraint not found: \" + skinMap.transform[i]);\n skin.constraints.push(constraint);\n }\n }\n if (skinMap.path) {\n for (var ii = 0; ii < skinMap.path.length; ii++) {\n var constraint = skeletonData.findPathConstraint(skinMap.path[ii]);\n if (constraint == null)\n throw new Error(\"Skin path constraint not found: \" + skinMap.path[i]);\n skin.constraints.push(constraint);\n }\n }\n for (var slotName in skinMap.attachments) {\n var slot = skeletonData.findSlot(slotName);\n if (slot == null)\n throw new Error(\"Slot not found: \" + slotName);\n var slotMap = skinMap.attachments[slotName];\n for (var entryName in slotMap) {\n var attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\n if (attachment != null)\n skin.setAttachment(slot.index, entryName, attachment);\n }\n }\n skeletonData.skins.push(skin);\n if (skin.name == \"default\")\n skeletonData.defaultSkin = skin;\n }\n }\n for (var i = 0, n = this.linkedMeshes.length; i < n; i++) {\n var linkedMesh = this.linkedMeshes[i];\n var skin = linkedMesh.skin == null ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n if (skin == null)\n throw new Error(\"Skin not found: \" + linkedMesh.skin);\n var parent_6 = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n if (parent_6 == null)\n throw new Error(\"Parent mesh not found: \" + linkedMesh.parent);\n linkedMesh.mesh.deformAttachment = linkedMesh.inheritDeform ? parent_6 : linkedMesh.mesh;\n linkedMesh.mesh.setParentMesh(parent_6);\n linkedMesh.mesh.updateUVs();\n }\n this.linkedMeshes.length = 0;\n if (root.events) {\n for (var eventName in root.events) {\n var eventMap = root.events[eventName];\n var data = new spine.EventData(eventName);\n data.intValue = this.getValue(eventMap, \"int\", 0);\n data.floatValue = this.getValue(eventMap, \"float\", 0);\n data.stringValue = this.getValue(eventMap, \"string\", \"\");\n data.audioPath = this.getValue(eventMap, \"audio\", null);\n if (data.audioPath != null) {\n data.volume = this.getValue(eventMap, \"volume\", 1);\n data.balance = this.getValue(eventMap, \"balance\", 0);\n }\n skeletonData.events.push(data);\n }\n }\n if (root.animations) {\n for (var animationName in root.animations) {\n var animationMap = root.animations[animationName];\n this.readAnimation(animationMap, animationName, skeletonData);\n }\n }\n return skeletonData;\n };\n SkeletonJson.prototype.readAttachment = function (map, skin, slotIndex, name, skeletonData) {\n var scale = this.scale;\n name = this.getValue(map, \"name\", name);\n var type = this.getValue(map, \"type\", \"region\");\n switch (type) {\n case \"region\": {\n var path = this.getValue(map, \"path\", name);\n var region = this.attachmentLoader.newRegionAttachment(skin, name, path);\n if (region == null)\n return null;\n region.path = path;\n region.x = this.getValue(map, \"x\", 0) * scale;\n region.y = this.getValue(map, \"y\", 0) * scale;\n region.scaleX = this.getValue(map, \"scaleX\", 1);\n region.scaleY = this.getValue(map, \"scaleY\", 1);\n region.rotation = this.getValue(map, \"rotation\", 0);\n region.width = map.width * scale;\n region.height = map.height * scale;\n var color = this.getValue(map, \"color\", null);\n if (color != null)\n region.color.setFromString(color);\n region.updateOffset();\n return region;\n }\n case \"boundingbox\": {\n var box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n if (box == null)\n return null;\n this.readVertices(map, box, map.vertexCount << 1);\n var color = this.getValue(map, \"color\", null);\n if (color != null)\n box.color.setFromString(color);\n return box;\n }\n case \"mesh\":\n case \"linkedmesh\": {\n var path = this.getValue(map, \"path\", name);\n var mesh = this.attachmentLoader.newMeshAttachment(skin, name, path);\n if (mesh == null)\n return null;\n mesh.path = path;\n var color = this.getValue(map, \"color\", null);\n if (color != null)\n mesh.color.setFromString(color);\n mesh.width = this.getValue(map, \"width\", 0) * scale;\n mesh.height = this.getValue(map, \"height\", 0) * scale;\n var parent_7 = this.getValue(map, \"parent\", null);\n if (parent_7 != null) {\n this.linkedMeshes.push(new LinkedMesh(mesh, this.getValue(map, \"skin\", null), slotIndex, parent_7, this.getValue(map, \"deform\", true)));\n return mesh;\n }\n var uvs = map.uvs;\n this.readVertices(map, mesh, uvs.length);\n mesh.triangles = map.triangles;\n mesh.regionUVs = uvs;\n mesh.updateUVs();\n mesh.edges = this.getValue(map, \"edges\", null);\n mesh.hullLength = this.getValue(map, \"hull\", 0) * 2;\n return mesh;\n }\n case \"path\": {\n var path = this.attachmentLoader.newPathAttachment(skin, name);\n if (path == null)\n return null;\n path.closed = this.getValue(map, \"closed\", false);\n path.constantSpeed = this.getValue(map, \"constantSpeed\", true);\n var vertexCount = map.vertexCount;\n this.readVertices(map, path, vertexCount << 1);\n var lengths = spine.Utils.newArray(vertexCount / 3, 0);\n for (var i = 0; i < map.lengths.length; i++)\n lengths[i] = map.lengths[i] * scale;\n path.lengths = lengths;\n var color = this.getValue(map, \"color\", null);\n if (color != null)\n path.color.setFromString(color);\n return path;\n }\n case \"point\": {\n var point = this.attachmentLoader.newPointAttachment(skin, name);\n if (point == null)\n return null;\n point.x = this.getValue(map, \"x\", 0) * scale;\n point.y = this.getValue(map, \"y\", 0) * scale;\n point.rotation = this.getValue(map, \"rotation\", 0);\n var color = this.getValue(map, \"color\", null);\n if (color != null)\n point.color.setFromString(color);\n return point;\n }\n case \"clipping\": {\n var clip = this.attachmentLoader.newClippingAttachment(skin, name);\n if (clip == null)\n return null;\n var end = this.getValue(map, \"end\", null);\n if (end != null) {\n var slot = skeletonData.findSlot(end);\n if (slot == null)\n throw new Error(\"Clipping end slot not found: \" + end);\n clip.endSlot = slot;\n }\n var vertexCount = map.vertexCount;\n this.readVertices(map, clip, vertexCount << 1);\n var color = this.getValue(map, \"color\", null);\n if (color != null)\n clip.color.setFromString(color);\n return clip;\n }\n }\n return null;\n };\n SkeletonJson.prototype.readVertices = function (map, attachment, verticesLength) {\n var scale = this.scale;\n attachment.worldVerticesLength = verticesLength;\n var vertices = map.vertices;\n if (verticesLength == vertices.length) {\n var scaledVertices = spine.Utils.toFloatArray(vertices);\n if (scale != 1) {\n for (var i = 0, n = vertices.length; i < n; i++)\n scaledVertices[i] *= scale;\n }\n attachment.vertices = scaledVertices;\n return;\n }\n var weights = new Array();\n var bones = new Array();\n for (var i = 0, n = vertices.length; i < n;) {\n var boneCount = vertices[i++];\n bones.push(boneCount);\n for (var nn = i + boneCount * 4; i < nn; i += 4) {\n bones.push(vertices[i]);\n weights.push(vertices[i + 1] * scale);\n weights.push(vertices[i + 2] * scale);\n weights.push(vertices[i + 3]);\n }\n }\n attachment.bones = bones;\n attachment.vertices = spine.Utils.toFloatArray(weights);\n };\n SkeletonJson.prototype.readAnimation = function (map, name, skeletonData) {\n var scale = this.scale;\n var timelines = new Array();\n var duration = 0;\n if (map.slots) {\n for (var slotName in map.slots) {\n var slotMap = map.slots[slotName];\n var slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1)\n throw new Error(\"Slot not found: \" + slotName);\n for (var timelineName in slotMap) {\n var timelineMap = slotMap[timelineName];\n if (timelineName == \"attachment\") {\n var timeline = new spine.AttachmentTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n var frameIndex = 0;\n for (var i = 0; i < timelineMap.length; i++) {\n var valueMap = timelineMap[i];\n timeline.setFrame(frameIndex++, this.getValue(valueMap, \"time\", 0), valueMap.name);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n else if (timelineName == \"color\") {\n var timeline = new spine.ColorTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n var frameIndex = 0;\n for (var i = 0; i < timelineMap.length; i++) {\n var valueMap = timelineMap[i];\n var color = new spine.Color();\n color.setFromString(valueMap.color);\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), color.r, color.g, color.b, color.a);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.ColorTimeline.ENTRIES]);\n }\n else if (timelineName == \"twoColor\") {\n var timeline = new spine.TwoColorTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n var frameIndex = 0;\n for (var i = 0; i < timelineMap.length; i++) {\n var valueMap = timelineMap[i];\n var light = new spine.Color();\n var dark = new spine.Color();\n light.setFromString(valueMap.light);\n dark.setFromString(valueMap.dark);\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), light.r, light.g, light.b, light.a, dark.r, dark.g, dark.b);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TwoColorTimeline.ENTRIES]);\n }\n else\n throw new Error(\"Invalid timeline type for a slot: \" + timelineName + \" (\" + slotName + \")\");\n }\n }\n }\n if (map.bones) {\n for (var boneName in map.bones) {\n var boneMap = map.bones[boneName];\n var boneIndex = skeletonData.findBoneIndex(boneName);\n if (boneIndex == -1)\n throw new Error(\"Bone not found: \" + boneName);\n for (var timelineName in boneMap) {\n var timelineMap = boneMap[timelineName];\n if (timelineName === \"rotate\") {\n var timeline = new spine.RotateTimeline(timelineMap.length);\n timeline.boneIndex = boneIndex;\n var frameIndex = 0;\n for (var i = 0; i < timelineMap.length; i++) {\n var valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"angle\", 0));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.RotateTimeline.ENTRIES]);\n }\n else if (timelineName === \"translate\" || timelineName === \"scale\" || timelineName === \"shear\") {\n var timeline = null;\n var timelineScale = 1, defaultValue = 0;\n if (timelineName === \"scale\") {\n timeline = new spine.ScaleTimeline(timelineMap.length);\n defaultValue = 1;\n }\n else if (timelineName === \"shear\")\n timeline = new spine.ShearTimeline(timelineMap.length);\n else {\n timeline = new spine.TranslateTimeline(timelineMap.length);\n timelineScale = scale;\n }\n timeline.boneIndex = boneIndex;\n var frameIndex = 0;\n for (var i = 0; i < timelineMap.length; i++) {\n var valueMap = timelineMap[i];\n var x = this.getValue(valueMap, \"x\", defaultValue), y = this.getValue(valueMap, \"y\", defaultValue);\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), x * timelineScale, y * timelineScale);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TranslateTimeline.ENTRIES]);\n }\n else\n throw new Error(\"Invalid timeline type for a bone: \" + timelineName + \" (\" + boneName + \")\");\n }\n }\n }\n if (map.ik) {\n for (var constraintName in map.ik) {\n var constraintMap = map.ik[constraintName];\n var constraint = skeletonData.findIkConstraint(constraintName);\n var timeline = new spine.IkConstraintTimeline(constraintMap.length);\n timeline.ikConstraintIndex = skeletonData.ikConstraints.indexOf(constraint);\n var frameIndex = 0;\n for (var i = 0; i < constraintMap.length; i++) {\n var valueMap = constraintMap[i];\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"mix\", 1), this.getValue(valueMap, \"softness\", 0) * scale, this.getValue(valueMap, \"bendPositive\", true) ? 1 : -1, this.getValue(valueMap, \"compress\", false), this.getValue(valueMap, \"stretch\", false));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.IkConstraintTimeline.ENTRIES]);\n }\n }\n if (map.transform) {\n for (var constraintName in map.transform) {\n var constraintMap = map.transform[constraintName];\n var constraint = skeletonData.findTransformConstraint(constraintName);\n var timeline = new spine.TransformConstraintTimeline(constraintMap.length);\n timeline.transformConstraintIndex = skeletonData.transformConstraints.indexOf(constraint);\n var frameIndex = 0;\n for (var i = 0; i < constraintMap.length; i++) {\n var valueMap = constraintMap[i];\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1), this.getValue(valueMap, \"scaleMix\", 1), this.getValue(valueMap, \"shearMix\", 1));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.TransformConstraintTimeline.ENTRIES]);\n }\n }\n if (map.path) {\n for (var constraintName in map.path) {\n var constraintMap = map.path[constraintName];\n var index = skeletonData.findPathConstraintIndex(constraintName);\n if (index == -1)\n throw new Error(\"Path constraint not found: \" + constraintName);\n var data = skeletonData.pathConstraints[index];\n for (var timelineName in constraintMap) {\n var timelineMap = constraintMap[timelineName];\n if (timelineName === \"position\" || timelineName === \"spacing\") {\n var timeline = null;\n var timelineScale = 1;\n if (timelineName === \"spacing\") {\n timeline = new spine.PathConstraintSpacingTimeline(timelineMap.length);\n if (data.spacingMode == spine.SpacingMode.Length || data.spacingMode == spine.SpacingMode.Fixed)\n timelineScale = scale;\n }\n else {\n timeline = new spine.PathConstraintPositionTimeline(timelineMap.length);\n if (data.positionMode == spine.PositionMode.Fixed)\n timelineScale = scale;\n }\n timeline.pathConstraintIndex = index;\n var frameIndex = 0;\n for (var i = 0; i < timelineMap.length; i++) {\n var valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, timelineName, 0) * timelineScale);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintPositionTimeline.ENTRIES]);\n }\n else if (timelineName === \"mix\") {\n var timeline = new spine.PathConstraintMixTimeline(timelineMap.length);\n timeline.pathConstraintIndex = index;\n var frameIndex = 0;\n for (var i = 0; i < timelineMap.length; i++) {\n var valueMap = timelineMap[i];\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), this.getValue(valueMap, \"rotateMix\", 1), this.getValue(valueMap, \"translateMix\", 1));\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[(timeline.getFrameCount() - 1) * spine.PathConstraintMixTimeline.ENTRIES]);\n }\n }\n }\n }\n if (map.deform) {\n for (var deformName in map.deform) {\n var deformMap = map.deform[deformName];\n var skin = skeletonData.findSkin(deformName);\n if (skin == null)\n throw new Error(\"Skin not found: \" + deformName);\n for (var slotName in deformMap) {\n var slotMap = deformMap[slotName];\n var slotIndex = skeletonData.findSlotIndex(slotName);\n if (slotIndex == -1)\n throw new Error(\"Slot not found: \" + slotMap.name);\n for (var timelineName in slotMap) {\n var timelineMap = slotMap[timelineName];\n var attachment = skin.getAttachment(slotIndex, timelineName);\n if (attachment == null)\n throw new Error(\"Deform attachment not found: \" + timelineMap.name);\n var weighted = attachment.bones != null;\n var vertices = attachment.vertices;\n var deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n var timeline = new spine.DeformTimeline(timelineMap.length);\n timeline.slotIndex = slotIndex;\n timeline.attachment = attachment;\n var frameIndex = 0;\n for (var j = 0; j < timelineMap.length; j++) {\n var valueMap = timelineMap[j];\n var deform = void 0;\n var verticesValue = this.getValue(valueMap, \"vertices\", null);\n if (verticesValue == null)\n deform = weighted ? spine.Utils.newFloatArray(deformLength) : vertices;\n else {\n deform = spine.Utils.newFloatArray(deformLength);\n var start = this.getValue(valueMap, \"offset\", 0);\n spine.Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\n if (scale != 1) {\n for (var i = start, n = i + verticesValue.length; i < n; i++)\n deform[i] *= scale;\n }\n if (!weighted) {\n for (var i = 0; i < deformLength; i++)\n deform[i] += vertices[i];\n }\n }\n timeline.setFrame(frameIndex, this.getValue(valueMap, \"time\", 0), deform);\n this.readCurve(valueMap, timeline, frameIndex);\n frameIndex++;\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n }\n }\n }\n var drawOrderNode = map.drawOrder;\n if (drawOrderNode == null)\n drawOrderNode = map.draworder;\n if (drawOrderNode != null) {\n var timeline = new spine.DrawOrderTimeline(drawOrderNode.length);\n var slotCount = skeletonData.slots.length;\n var frameIndex = 0;\n for (var j = 0; j < drawOrderNode.length; j++) {\n var drawOrderMap = drawOrderNode[j];\n var drawOrder = null;\n var offsets = this.getValue(drawOrderMap, \"offsets\", null);\n if (offsets != null) {\n drawOrder = spine.Utils.newArray(slotCount, -1);\n var unchanged = spine.Utils.newArray(slotCount - offsets.length, 0);\n var originalIndex = 0, unchangedIndex = 0;\n for (var i = 0; i < offsets.length; i++) {\n var offsetMap = offsets[i];\n var slotIndex = skeletonData.findSlotIndex(offsetMap.slot);\n if (slotIndex == -1)\n throw new Error(\"Slot not found: \" + offsetMap.slot);\n while (originalIndex != slotIndex)\n unchanged[unchangedIndex++] = originalIndex++;\n drawOrder[originalIndex + offsetMap.offset] = originalIndex++;\n }\n while (originalIndex < slotCount)\n unchanged[unchangedIndex++] = originalIndex++;\n for (var i = slotCount - 1; i >= 0; i--)\n if (drawOrder[i] == -1)\n drawOrder[i] = unchanged[--unchangedIndex];\n }\n timeline.setFrame(frameIndex++, this.getValue(drawOrderMap, \"time\", 0), drawOrder);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n if (map.events) {\n var timeline = new spine.EventTimeline(map.events.length);\n var frameIndex = 0;\n for (var i = 0; i < map.events.length; i++) {\n var eventMap = map.events[i];\n var eventData = skeletonData.findEvent(eventMap.name);\n if (eventData == null)\n throw new Error(\"Event not found: \" + eventMap.name);\n var event_6 = new spine.Event(spine.Utils.toSinglePrecision(this.getValue(eventMap, \"time\", 0)), eventData);\n event_6.intValue = this.getValue(eventMap, \"int\", eventData.intValue);\n event_6.floatValue = this.getValue(eventMap, \"float\", eventData.floatValue);\n event_6.stringValue = this.getValue(eventMap, \"string\", eventData.stringValue);\n if (event_6.data.audioPath != null) {\n event_6.volume = this.getValue(eventMap, \"volume\", 1);\n event_6.balance = this.getValue(eventMap, \"balance\", 0);\n }\n timeline.setFrame(frameIndex++, event_6);\n }\n timelines.push(timeline);\n duration = Math.max(duration, timeline.frames[timeline.getFrameCount() - 1]);\n }\n if (isNaN(duration)) {\n throw new Error(\"Error while parsing animation, duration is NaN\");\n }\n skeletonData.animations.push(new spine.Animation(name, timelines, duration));\n };\n SkeletonJson.prototype.readCurve = function (map, timeline, frameIndex) {\n if (!map.hasOwnProperty(\"curve\"))\n return;\n if (map.curve == \"stepped\")\n timeline.setStepped(frameIndex);\n else {\n var curve = map.curve;\n timeline.setCurve(frameIndex, curve, this.getValue(map, \"c2\", 0), this.getValue(map, \"c3\", 1), this.getValue(map, \"c4\", 1));\n }\n };\n SkeletonJson.prototype.getValue = function (map, prop, defaultValue) {\n return map[prop] !== undefined ? map[prop] : defaultValue;\n };\n SkeletonJson.blendModeFromString = function (str) {\n str = str.toLowerCase();\n if (str == \"normal\")\n return spine.BlendMode.Normal;\n if (str == \"additive\")\n return spine.BlendMode.Additive;\n if (str == \"multiply\")\n return spine.BlendMode.Multiply;\n if (str == \"screen\")\n return spine.BlendMode.Screen;\n throw new Error(\"Unknown blend mode: \" + str);\n };\n SkeletonJson.positionModeFromString = function (str) {\n str = str.toLowerCase();\n if (str == \"fixed\")\n return spine.PositionMode.Fixed;\n if (str == \"percent\")\n return spine.PositionMode.Percent;\n throw new Error(\"Unknown position mode: \" + str);\n };\n SkeletonJson.spacingModeFromString = function (str) {\n str = str.toLowerCase();\n if (str == \"length\")\n return spine.SpacingMode.Length;\n if (str == \"fixed\")\n return spine.SpacingMode.Fixed;\n if (str == \"percent\")\n return spine.SpacingMode.Percent;\n throw new Error(\"Unknown position mode: \" + str);\n };\n SkeletonJson.rotateModeFromString = function (str) {\n str = str.toLowerCase();\n if (str == \"tangent\")\n return spine.RotateMode.Tangent;\n if (str == \"chain\")\n return spine.RotateMode.Chain;\n if (str == \"chainscale\")\n return spine.RotateMode.ChainScale;\n throw new Error(\"Unknown rotate mode: \" + str);\n };\n SkeletonJson.transformModeFromString = function (str) {\n str = str.toLowerCase();\n if (str == \"normal\")\n return spine.TransformMode.Normal;\n if (str == \"onlytranslation\")\n return spine.TransformMode.OnlyTranslation;\n if (str == \"norotationorreflection\")\n return spine.TransformMode.NoRotationOrReflection;\n if (str == \"noscale\")\n return spine.TransformMode.NoScale;\n if (str == \"noscaleorreflection\")\n return spine.TransformMode.NoScaleOrReflection;\n throw new Error(\"Unknown transform mode: \" + str);\n };\n return SkeletonJson;\n }());\n spine.SkeletonJson = SkeletonJson;\n var LinkedMesh = (function () {\n function LinkedMesh(mesh, skin, slotIndex, parent, inheritDeform) {\n this.mesh = mesh;\n this.skin = skin;\n this.slotIndex = slotIndex;\n this.parent = parent;\n this.inheritDeform = inheritDeform;\n }\n return LinkedMesh;\n }());\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SkinEntry = (function () {\n function SkinEntry(slotIndex, name, attachment) {\n this.slotIndex = slotIndex;\n this.name = name;\n this.attachment = attachment;\n }\n return SkinEntry;\n }());\n spine.SkinEntry = SkinEntry;\n var Skin = (function () {\n function Skin(name) {\n this.attachments = new Array();\n this.bones = Array();\n this.constraints = new Array();\n if (name == null)\n throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n Skin.prototype.setAttachment = function (slotIndex, name, attachment) {\n if (attachment == null)\n throw new Error(\"attachment cannot be null.\");\n var attachments = this.attachments;\n if (slotIndex >= attachments.length)\n attachments.length = slotIndex + 1;\n if (!attachments[slotIndex])\n attachments[slotIndex] = {};\n attachments[slotIndex][name] = attachment;\n };\n Skin.prototype.addSkin = function (skin) {\n for (var i = 0; i < skin.bones.length; i++) {\n var bone = skin.bones[i];\n var contained = false;\n for (var j = 0; j < this.bones.length; j++) {\n if (this.bones[j] == bone) {\n contained = true;\n break;\n }\n }\n if (!contained)\n this.bones.push(bone);\n }\n for (var i = 0; i < skin.constraints.length; i++) {\n var constraint = skin.constraints[i];\n var contained = false;\n for (var j = 0; j < this.constraints.length; j++) {\n if (this.constraints[j] == constraint) {\n contained = true;\n break;\n }\n }\n if (!contained)\n this.constraints.push(constraint);\n }\n var attachments = skin.getAttachments();\n for (var i = 0; i < attachments.length; i++) {\n var attachment = attachments[i];\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n }\n };\n Skin.prototype.copySkin = function (skin) {\n for (var i = 0; i < skin.bones.length; i++) {\n var bone = skin.bones[i];\n var contained = false;\n for (var j = 0; j < this.bones.length; j++) {\n if (this.bones[j] == bone) {\n contained = true;\n break;\n }\n }\n if (!contained)\n this.bones.push(bone);\n }\n for (var i = 0; i < skin.constraints.length; i++) {\n var constraint = skin.constraints[i];\n var contained = false;\n for (var j = 0; j < this.constraints.length; j++) {\n if (this.constraints[j] == constraint) {\n contained = true;\n break;\n }\n }\n if (!contained)\n this.constraints.push(constraint);\n }\n var attachments = skin.getAttachments();\n for (var i = 0; i < attachments.length; i++) {\n var attachment = attachments[i];\n if (attachment.attachment == null)\n continue;\n if (attachment.attachment instanceof spine.MeshAttachment) {\n attachment.attachment = attachment.attachment.newLinkedMesh();\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n }\n else {\n attachment.attachment = attachment.attachment.copy();\n this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n }\n }\n };\n Skin.prototype.getAttachment = function (slotIndex, name) {\n var dictionary = this.attachments[slotIndex];\n return dictionary ? dictionary[name] : null;\n };\n Skin.prototype.removeAttachment = function (slotIndex, name) {\n var dictionary = this.attachments[slotIndex];\n if (dictionary)\n dictionary[name] = null;\n };\n Skin.prototype.getAttachments = function () {\n var entries = new Array();\n for (var i = 0; i < this.attachments.length; i++) {\n var slotAttachments = this.attachments[i];\n if (slotAttachments) {\n for (var name_4 in slotAttachments) {\n var attachment = slotAttachments[name_4];\n if (attachment)\n entries.push(new SkinEntry(i, name_4, attachment));\n }\n }\n }\n return entries;\n };\n Skin.prototype.getAttachmentsForSlot = function (slotIndex, attachments) {\n var slotAttachments = this.attachments[slotIndex];\n if (slotAttachments) {\n for (var name_5 in slotAttachments) {\n var attachment = slotAttachments[name_5];\n if (attachment)\n attachments.push(new SkinEntry(slotIndex, name_5, attachment));\n }\n }\n };\n Skin.prototype.clear = function () {\n this.attachments.length = 0;\n this.bones.length = 0;\n this.constraints.length = 0;\n };\n Skin.prototype.attachAll = function (skeleton, oldSkin) {\n var slotIndex = 0;\n for (var i = 0; i < skeleton.slots.length; i++) {\n var slot = skeleton.slots[i];\n var slotAttachment = slot.getAttachment();\n if (slotAttachment && slotIndex < oldSkin.attachments.length) {\n var dictionary = oldSkin.attachments[slotIndex];\n for (var key in dictionary) {\n var skinAttachment = dictionary[key];\n if (slotAttachment == skinAttachment) {\n var attachment = this.getAttachment(slotIndex, key);\n if (attachment != null)\n slot.setAttachment(attachment);\n break;\n }\n }\n }\n slotIndex++;\n }\n };\n return Skin;\n }());\n spine.Skin = Skin;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var Slot = (function () {\n function Slot(data, bone) {\n this.deform = new Array();\n if (data == null)\n throw new Error(\"data cannot be null.\");\n if (bone == null)\n throw new Error(\"bone cannot be null.\");\n this.data = data;\n this.bone = bone;\n this.color = new spine.Color();\n this.darkColor = data.darkColor == null ? null : new spine.Color();\n this.setToSetupPose();\n }\n Slot.prototype.getSkeleton = function () {\n return this.bone.skeleton;\n };\n Slot.prototype.getAttachment = function () {\n return this.attachment;\n };\n Slot.prototype.setAttachment = function (attachment) {\n if (this.attachment == attachment)\n return;\n this.attachment = attachment;\n this.attachmentTime = this.bone.skeleton.time;\n this.deform.length = 0;\n };\n Slot.prototype.setAttachmentTime = function (time) {\n this.attachmentTime = this.bone.skeleton.time - time;\n };\n Slot.prototype.getAttachmentTime = function () {\n return this.bone.skeleton.time - this.attachmentTime;\n };\n Slot.prototype.setToSetupPose = function () {\n this.color.setFromColor(this.data.color);\n if (this.darkColor != null)\n this.darkColor.setFromColor(this.data.darkColor);\n if (this.data.attachmentName == null)\n this.attachment = null;\n else {\n this.attachment = null;\n this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\n }\n };\n return Slot;\n }());\n spine.Slot = Slot;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SlotData = (function () {\n function SlotData(index, name, boneData) {\n this.color = new spine.Color(1, 1, 1, 1);\n if (index < 0)\n throw new Error(\"index must be >= 0.\");\n if (name == null)\n throw new Error(\"name cannot be null.\");\n if (boneData == null)\n throw new Error(\"boneData cannot be null.\");\n this.index = index;\n this.name = name;\n this.boneData = boneData;\n }\n return SlotData;\n }());\n spine.SlotData = SlotData;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var Texture = (function () {\n function Texture(image) {\n this._image = image;\n }\n Texture.prototype.getImage = function () {\n return this._image;\n };\n Texture.filterFromString = function (text) {\n switch (text.toLowerCase()) {\n case \"nearest\": return TextureFilter.Nearest;\n case \"linear\": return TextureFilter.Linear;\n case \"mipmap\": return TextureFilter.MipMap;\n case \"mipmapnearestnearest\": return TextureFilter.MipMapNearestNearest;\n case \"mipmaplinearnearest\": return TextureFilter.MipMapLinearNearest;\n case \"mipmapnearestlinear\": return TextureFilter.MipMapNearestLinear;\n case \"mipmaplinearlinear\": return TextureFilter.MipMapLinearLinear;\n default: throw new Error(\"Unknown texture filter \" + text);\n }\n };\n Texture.wrapFromString = function (text) {\n switch (text.toLowerCase()) {\n case \"mirroredtepeat\": return TextureWrap.MirroredRepeat;\n case \"clamptoedge\": return TextureWrap.ClampToEdge;\n case \"repeat\": return TextureWrap.Repeat;\n default: throw new Error(\"Unknown texture wrap \" + text);\n }\n };\n return Texture;\n }());\n spine.Texture = Texture;\n var TextureFilter;\n (function (TextureFilter) {\n TextureFilter[TextureFilter[\"Nearest\"] = 9728] = \"Nearest\";\n TextureFilter[TextureFilter[\"Linear\"] = 9729] = \"Linear\";\n TextureFilter[TextureFilter[\"MipMap\"] = 9987] = \"MipMap\";\n TextureFilter[TextureFilter[\"MipMapNearestNearest\"] = 9984] = \"MipMapNearestNearest\";\n TextureFilter[TextureFilter[\"MipMapLinearNearest\"] = 9985] = \"MipMapLinearNearest\";\n TextureFilter[TextureFilter[\"MipMapNearestLinear\"] = 9986] = \"MipMapNearestLinear\";\n TextureFilter[TextureFilter[\"MipMapLinearLinear\"] = 9987] = \"MipMapLinearLinear\";\n })(TextureFilter = spine.TextureFilter || (spine.TextureFilter = {}));\n var TextureWrap;\n (function (TextureWrap) {\n TextureWrap[TextureWrap[\"MirroredRepeat\"] = 33648] = \"MirroredRepeat\";\n TextureWrap[TextureWrap[\"ClampToEdge\"] = 33071] = \"ClampToEdge\";\n TextureWrap[TextureWrap[\"Repeat\"] = 10497] = \"Repeat\";\n })(TextureWrap = spine.TextureWrap || (spine.TextureWrap = {}));\n var TextureRegion = (function () {\n function TextureRegion() {\n this.u = 0;\n this.v = 0;\n this.u2 = 0;\n this.v2 = 0;\n this.width = 0;\n this.height = 0;\n this.rotate = false;\n this.offsetX = 0;\n this.offsetY = 0;\n this.originalWidth = 0;\n this.originalHeight = 0;\n }\n return TextureRegion;\n }());\n spine.TextureRegion = TextureRegion;\n var FakeTexture = (function (_super) {\n __extends(FakeTexture, _super);\n function FakeTexture() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n FakeTexture.prototype.setFilters = function (minFilter, magFilter) { };\n FakeTexture.prototype.setWraps = function (uWrap, vWrap) { };\n FakeTexture.prototype.dispose = function () { };\n return FakeTexture;\n }(Texture));\n spine.FakeTexture = FakeTexture;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var TextureAtlas = (function () {\n function TextureAtlas(atlasText, textureLoader) {\n this.pages = new Array();\n this.regions = new Array();\n this.load(atlasText, textureLoader);\n }\n TextureAtlas.prototype.load = function (atlasText, textureLoader) {\n if (textureLoader == null)\n throw new Error(\"textureLoader cannot be null.\");\n var reader = new TextureAtlasReader(atlasText);\n var tuple = new Array(4);\n var page = null;\n while (true) {\n var line = reader.readLine();\n if (line == null)\n break;\n line = line.trim();\n if (line.length == 0)\n page = null;\n else if (!page) {\n page = new TextureAtlasPage();\n page.name = line;\n if (reader.readTuple(tuple) == 2) {\n page.width = parseInt(tuple[0]);\n page.height = parseInt(tuple[1]);\n reader.readTuple(tuple);\n }\n reader.readTuple(tuple);\n page.minFilter = spine.Texture.filterFromString(tuple[0]);\n page.magFilter = spine.Texture.filterFromString(tuple[1]);\n var direction = reader.readValue();\n page.uWrap = spine.TextureWrap.ClampToEdge;\n page.vWrap = spine.TextureWrap.ClampToEdge;\n if (direction == \"x\")\n page.uWrap = spine.TextureWrap.Repeat;\n else if (direction == \"y\")\n page.vWrap = spine.TextureWrap.Repeat;\n else if (direction == \"xy\")\n page.uWrap = page.vWrap = spine.TextureWrap.Repeat;\n page.texture = textureLoader(line);\n page.texture.setFilters(page.minFilter, page.magFilter);\n page.texture.setWraps(page.uWrap, page.vWrap);\n page.width = page.texture.getImage().width;\n page.height = page.texture.getImage().height;\n this.pages.push(page);\n }\n else {\n var region = new TextureAtlasRegion();\n region.name = line;\n region.page = page;\n var rotateValue = reader.readValue();\n if (rotateValue.toLocaleLowerCase() == \"true\") {\n region.degrees = 90;\n }\n else if (rotateValue.toLocaleLowerCase() == \"false\") {\n region.degrees = 0;\n }\n else {\n region.degrees = parseFloat(rotateValue);\n }\n region.rotate = region.degrees == 90;\n reader.readTuple(tuple);\n var x = parseInt(tuple[0]);\n var y = parseInt(tuple[1]);\n reader.readTuple(tuple);\n var width = parseInt(tuple[0]);\n var height = parseInt(tuple[1]);\n region.u = x / page.width;\n region.v = y / page.height;\n if (region.rotate) {\n region.u2 = (x + height) / page.width;\n region.v2 = (y + width) / page.height;\n }\n else {\n region.u2 = (x + width) / page.width;\n region.v2 = (y + height) / page.height;\n }\n region.x = x;\n region.y = y;\n region.width = Math.abs(width);\n region.height = Math.abs(height);\n if (reader.readTuple(tuple) == 4) {\n if (reader.readTuple(tuple) == 4) {\n reader.readTuple(tuple);\n }\n }\n region.originalWidth = parseInt(tuple[0]);\n region.originalHeight = parseInt(tuple[1]);\n reader.readTuple(tuple);\n region.offsetX = parseInt(tuple[0]);\n region.offsetY = parseInt(tuple[1]);\n region.index = parseInt(reader.readValue());\n region.texture = page.texture;\n this.regions.push(region);\n }\n }\n };\n TextureAtlas.prototype.findRegion = function (name) {\n for (var i = 0; i < this.regions.length; i++) {\n if (this.regions[i].name == name) {\n return this.regions[i];\n }\n }\n return null;\n };\n TextureAtlas.prototype.dispose = function () {\n for (var i = 0; i < this.pages.length; i++) {\n this.pages[i].texture.dispose();\n }\n };\n return TextureAtlas;\n }());\n spine.TextureAtlas = TextureAtlas;\n var TextureAtlasReader = (function () {\n function TextureAtlasReader(text) {\n this.index = 0;\n this.lines = text.split(/\\r\\n|\\r|\\n/);\n }\n TextureAtlasReader.prototype.readLine = function () {\n if (this.index >= this.lines.length)\n return null;\n return this.lines[this.index++];\n };\n TextureAtlasReader.prototype.readValue = function () {\n var line = this.readLine();\n var colon = line.indexOf(\":\");\n if (colon == -1)\n throw new Error(\"Invalid line: \" + line);\n return line.substring(colon + 1).trim();\n };\n TextureAtlasReader.prototype.readTuple = function (tuple) {\n var line = this.readLine();\n var colon = line.indexOf(\":\");\n if (colon == -1)\n throw new Error(\"Invalid line: \" + line);\n var i = 0, lastMatch = colon + 1;\n for (; i < 3; i++) {\n var comma = line.indexOf(\",\", lastMatch);\n if (comma == -1)\n break;\n tuple[i] = line.substr(lastMatch, comma - lastMatch).trim();\n lastMatch = comma + 1;\n }\n tuple[i] = line.substring(lastMatch).trim();\n return i + 1;\n };\n return TextureAtlasReader;\n }());\n var TextureAtlasPage = (function () {\n function TextureAtlasPage() {\n }\n return TextureAtlasPage;\n }());\n spine.TextureAtlasPage = TextureAtlasPage;\n var TextureAtlasRegion = (function (_super) {\n __extends(TextureAtlasRegion, _super);\n function TextureAtlasRegion() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return TextureAtlasRegion;\n }(spine.TextureRegion));\n spine.TextureAtlasRegion = TextureAtlasRegion;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var TransformConstraint = (function () {\n function TransformConstraint(data, skeleton) {\n this.rotateMix = 0;\n this.translateMix = 0;\n this.scaleMix = 0;\n this.shearMix = 0;\n this.temp = new spine.Vector2();\n this.active = false;\n if (data == null)\n throw new Error(\"data cannot be null.\");\n if (skeleton == null)\n throw new Error(\"skeleton cannot be null.\");\n this.data = data;\n this.rotateMix = data.rotateMix;\n this.translateMix = data.translateMix;\n this.scaleMix = data.scaleMix;\n this.shearMix = data.shearMix;\n this.bones = new Array();\n for (var i = 0; i < data.bones.length; i++)\n this.bones.push(skeleton.findBone(data.bones[i].name));\n this.target = skeleton.findBone(data.target.name);\n }\n TransformConstraint.prototype.isActive = function () {\n return this.active;\n };\n TransformConstraint.prototype.apply = function () {\n this.update();\n };\n TransformConstraint.prototype.update = function () {\n if (this.data.local) {\n if (this.data.relative)\n this.applyRelativeLocal();\n else\n this.applyAbsoluteLocal();\n }\n else {\n if (this.data.relative)\n this.applyRelativeWorld();\n else\n this.applyAbsoluteWorld();\n }\n };\n TransformConstraint.prototype.applyAbsoluteWorld = function () {\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\n var target = this.target;\n var ta = target.a, tb = target.b, tc = target.c, td = target.d;\n var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\n var offsetRotation = this.data.offsetRotation * degRadReflect;\n var offsetShearY = this.data.offsetShearY * degRadReflect;\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n var modified = false;\n if (rotateMix != 0) {\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n var r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\n if (r > spine.MathUtils.PI)\n r -= spine.MathUtils.PI2;\n else if (r < -spine.MathUtils.PI)\n r += spine.MathUtils.PI2;\n r *= rotateMix;\n var cos = Math.cos(r), sin = Math.sin(r);\n bone.a = cos * a - sin * c;\n bone.b = cos * b - sin * d;\n bone.c = sin * a + cos * c;\n bone.d = sin * b + cos * d;\n modified = true;\n }\n if (translateMix != 0) {\n var temp = this.temp;\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n bone.worldX += (temp.x - bone.worldX) * translateMix;\n bone.worldY += (temp.y - bone.worldY) * translateMix;\n modified = true;\n }\n if (scaleMix > 0) {\n var s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\n var ts = Math.sqrt(ta * ta + tc * tc);\n if (s > 0.00001)\n s = (s + (ts - s + this.data.offsetScaleX) * scaleMix) / s;\n bone.a *= s;\n bone.c *= s;\n s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\n ts = Math.sqrt(tb * tb + td * td);\n if (s > 0.00001)\n s = (s + (ts - s + this.data.offsetScaleY) * scaleMix) / s;\n bone.b *= s;\n bone.d *= s;\n modified = true;\n }\n if (shearMix > 0) {\n var b = bone.b, d = bone.d;\n var by = Math.atan2(d, b);\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\n if (r > spine.MathUtils.PI)\n r -= spine.MathUtils.PI2;\n else if (r < -spine.MathUtils.PI)\n r += spine.MathUtils.PI2;\n r = by + (r + offsetShearY) * shearMix;\n var s = Math.sqrt(b * b + d * d);\n bone.b = Math.cos(r) * s;\n bone.d = Math.sin(r) * s;\n modified = true;\n }\n if (modified)\n bone.appliedValid = false;\n }\n };\n TransformConstraint.prototype.applyRelativeWorld = function () {\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\n var target = this.target;\n var ta = target.a, tb = target.b, tc = target.c, td = target.d;\n var degRadReflect = ta * td - tb * tc > 0 ? spine.MathUtils.degRad : -spine.MathUtils.degRad;\n var offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n var modified = false;\n if (rotateMix != 0) {\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n var r = Math.atan2(tc, ta) + offsetRotation;\n if (r > spine.MathUtils.PI)\n r -= spine.MathUtils.PI2;\n else if (r < -spine.MathUtils.PI)\n r += spine.MathUtils.PI2;\n r *= rotateMix;\n var cos = Math.cos(r), sin = Math.sin(r);\n bone.a = cos * a - sin * c;\n bone.b = cos * b - sin * d;\n bone.c = sin * a + cos * c;\n bone.d = sin * b + cos * d;\n modified = true;\n }\n if (translateMix != 0) {\n var temp = this.temp;\n target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n bone.worldX += temp.x * translateMix;\n bone.worldY += temp.y * translateMix;\n modified = true;\n }\n if (scaleMix > 0) {\n var s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * scaleMix + 1;\n bone.a *= s;\n bone.c *= s;\n s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * scaleMix + 1;\n bone.b *= s;\n bone.d *= s;\n modified = true;\n }\n if (shearMix > 0) {\n var r = Math.atan2(td, tb) - Math.atan2(tc, ta);\n if (r > spine.MathUtils.PI)\n r -= spine.MathUtils.PI2;\n else if (r < -spine.MathUtils.PI)\n r += spine.MathUtils.PI2;\n var b = bone.b, d = bone.d;\n r = Math.atan2(d, b) + (r - spine.MathUtils.PI / 2 + offsetShearY) * shearMix;\n var s = Math.sqrt(b * b + d * d);\n bone.b = Math.cos(r) * s;\n bone.d = Math.sin(r) * s;\n modified = true;\n }\n if (modified)\n bone.appliedValid = false;\n }\n };\n TransformConstraint.prototype.applyAbsoluteLocal = function () {\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\n var target = this.target;\n if (!target.appliedValid)\n target.updateAppliedTransform();\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n if (!bone.appliedValid)\n bone.updateAppliedTransform();\n var rotation = bone.arotation;\n if (rotateMix != 0) {\n var r = target.arotation - rotation + this.data.offsetRotation;\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\n rotation += r * rotateMix;\n }\n var x = bone.ax, y = bone.ay;\n if (translateMix != 0) {\n x += (target.ax - x + this.data.offsetX) * translateMix;\n y += (target.ay - y + this.data.offsetY) * translateMix;\n }\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\n if (scaleMix != 0) {\n if (scaleX > 0.00001)\n scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * scaleMix) / scaleX;\n if (scaleY > 0.00001)\n scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * scaleMix) / scaleY;\n }\n var shearY = bone.ashearY;\n if (shearMix != 0) {\n var r = target.ashearY - shearY + this.data.offsetShearY;\n r -= (16384 - ((16384.499999999996 - r / 360) | 0)) * 360;\n bone.shearY += r * shearMix;\n }\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n }\n };\n TransformConstraint.prototype.applyRelativeLocal = function () {\n var rotateMix = this.rotateMix, translateMix = this.translateMix, scaleMix = this.scaleMix, shearMix = this.shearMix;\n var target = this.target;\n if (!target.appliedValid)\n target.updateAppliedTransform();\n var bones = this.bones;\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n if (!bone.appliedValid)\n bone.updateAppliedTransform();\n var rotation = bone.arotation;\n if (rotateMix != 0)\n rotation += (target.arotation + this.data.offsetRotation) * rotateMix;\n var x = bone.ax, y = bone.ay;\n if (translateMix != 0) {\n x += (target.ax + this.data.offsetX) * translateMix;\n y += (target.ay + this.data.offsetY) * translateMix;\n }\n var scaleX = bone.ascaleX, scaleY = bone.ascaleY;\n if (scaleMix != 0) {\n if (scaleX > 0.00001)\n scaleX *= ((target.ascaleX - 1 + this.data.offsetScaleX) * scaleMix) + 1;\n if (scaleY > 0.00001)\n scaleY *= ((target.ascaleY - 1 + this.data.offsetScaleY) * scaleMix) + 1;\n }\n var shearY = bone.ashearY;\n if (shearMix != 0)\n shearY += (target.ashearY + this.data.offsetShearY) * shearMix;\n bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n }\n };\n return TransformConstraint;\n }());\n spine.TransformConstraint = TransformConstraint;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var TransformConstraintData = (function (_super) {\n __extends(TransformConstraintData, _super);\n function TransformConstraintData(name) {\n var _this = _super.call(this, name, 0, false) || this;\n _this.bones = new Array();\n _this.rotateMix = 0;\n _this.translateMix = 0;\n _this.scaleMix = 0;\n _this.shearMix = 0;\n _this.offsetRotation = 0;\n _this.offsetX = 0;\n _this.offsetY = 0;\n _this.offsetScaleX = 0;\n _this.offsetScaleY = 0;\n _this.offsetShearY = 0;\n _this.relative = false;\n _this.local = false;\n return _this;\n }\n return TransformConstraintData;\n }(spine.ConstraintData));\n spine.TransformConstraintData = TransformConstraintData;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var Triangulator = (function () {\n function Triangulator() {\n this.convexPolygons = new Array();\n this.convexPolygonsIndices = new Array();\n this.indicesArray = new Array();\n this.isConcaveArray = new Array();\n this.triangles = new Array();\n this.polygonPool = new spine.Pool(function () {\n return new Array();\n });\n this.polygonIndicesPool = new spine.Pool(function () {\n return new Array();\n });\n }\n Triangulator.prototype.triangulate = function (verticesArray) {\n var vertices = verticesArray;\n var vertexCount = verticesArray.length >> 1;\n var indices = this.indicesArray;\n indices.length = 0;\n for (var i = 0; i < vertexCount; i++)\n indices[i] = i;\n var isConcave = this.isConcaveArray;\n isConcave.length = 0;\n for (var i = 0, n = vertexCount; i < n; ++i)\n isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\n var triangles = this.triangles;\n triangles.length = 0;\n while (vertexCount > 3) {\n var previous = vertexCount - 1, i = 0, next = 1;\n while (true) {\n outer: if (!isConcave[i]) {\n var p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\n var p1x = vertices[p1], p1y = vertices[p1 + 1];\n var p2x = vertices[p2], p2y = vertices[p2 + 1];\n var p3x = vertices[p3], p3y = vertices[p3 + 1];\n for (var ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\n if (!isConcave[ii])\n continue;\n var v = indices[ii] << 1;\n var vx = vertices[v], vy = vertices[v + 1];\n if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\n if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\n if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy))\n break outer;\n }\n }\n }\n break;\n }\n if (next == 0) {\n do {\n if (!isConcave[i])\n break;\n i--;\n } while (i > 0);\n break;\n }\n previous = i;\n i = next;\n next = (next + 1) % vertexCount;\n }\n triangles.push(indices[(vertexCount + i - 1) % vertexCount]);\n triangles.push(indices[i]);\n triangles.push(indices[(i + 1) % vertexCount]);\n indices.splice(i, 1);\n isConcave.splice(i, 1);\n vertexCount--;\n var previousIndex = (vertexCount + i - 1) % vertexCount;\n var nextIndex = i == vertexCount ? 0 : i;\n isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\n isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\n }\n if (vertexCount == 3) {\n triangles.push(indices[2]);\n triangles.push(indices[0]);\n triangles.push(indices[1]);\n }\n return triangles;\n };\n Triangulator.prototype.decompose = function (verticesArray, triangles) {\n var vertices = verticesArray;\n var convexPolygons = this.convexPolygons;\n this.polygonPool.freeAll(convexPolygons);\n convexPolygons.length = 0;\n var convexPolygonsIndices = this.convexPolygonsIndices;\n this.polygonIndicesPool.freeAll(convexPolygonsIndices);\n convexPolygonsIndices.length = 0;\n var polygonIndices = this.polygonIndicesPool.obtain();\n polygonIndices.length = 0;\n var polygon = this.polygonPool.obtain();\n polygon.length = 0;\n var fanBaseIndex = -1, lastWinding = 0;\n for (var i = 0, n = triangles.length; i < n; i += 3) {\n var t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\n var x1 = vertices[t1], y1 = vertices[t1 + 1];\n var x2 = vertices[t2], y2 = vertices[t2 + 1];\n var x3 = vertices[t3], y3 = vertices[t3 + 1];\n var merged = false;\n if (fanBaseIndex == t1) {\n var o = polygon.length - 4;\n var winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\n var winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\n if (winding1 == lastWinding && winding2 == lastWinding) {\n polygon.push(x3);\n polygon.push(y3);\n polygonIndices.push(t3);\n merged = true;\n }\n }\n if (!merged) {\n if (polygon.length > 0) {\n convexPolygons.push(polygon);\n convexPolygonsIndices.push(polygonIndices);\n }\n else {\n this.polygonPool.free(polygon);\n this.polygonIndicesPool.free(polygonIndices);\n }\n polygon = this.polygonPool.obtain();\n polygon.length = 0;\n polygon.push(x1);\n polygon.push(y1);\n polygon.push(x2);\n polygon.push(y2);\n polygon.push(x3);\n polygon.push(y3);\n polygonIndices = this.polygonIndicesPool.obtain();\n polygonIndices.length = 0;\n polygonIndices.push(t1);\n polygonIndices.push(t2);\n polygonIndices.push(t3);\n lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\n fanBaseIndex = t1;\n }\n }\n if (polygon.length > 0) {\n convexPolygons.push(polygon);\n convexPolygonsIndices.push(polygonIndices);\n }\n for (var i = 0, n = convexPolygons.length; i < n; i++) {\n polygonIndices = convexPolygonsIndices[i];\n if (polygonIndices.length == 0)\n continue;\n var firstIndex = polygonIndices[0];\n var lastIndex = polygonIndices[polygonIndices.length - 1];\n polygon = convexPolygons[i];\n var o = polygon.length - 4;\n var prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\n var prevX = polygon[o + 2], prevY = polygon[o + 3];\n var firstX = polygon[0], firstY = polygon[1];\n var secondX = polygon[2], secondY = polygon[3];\n var winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\n for (var ii = 0; ii < n; ii++) {\n if (ii == i)\n continue;\n var otherIndices = convexPolygonsIndices[ii];\n if (otherIndices.length != 3)\n continue;\n var otherFirstIndex = otherIndices[0];\n var otherSecondIndex = otherIndices[1];\n var otherLastIndex = otherIndices[2];\n var otherPoly = convexPolygons[ii];\n var x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\n if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex)\n continue;\n var winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\n var winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\n if (winding1 == winding && winding2 == winding) {\n otherPoly.length = 0;\n otherIndices.length = 0;\n polygon.push(x3);\n polygon.push(y3);\n polygonIndices.push(otherLastIndex);\n prevPrevX = prevX;\n prevPrevY = prevY;\n prevX = x3;\n prevY = y3;\n ii = 0;\n }\n }\n }\n for (var i = convexPolygons.length - 1; i >= 0; i--) {\n polygon = convexPolygons[i];\n if (polygon.length == 0) {\n convexPolygons.splice(i, 1);\n this.polygonPool.free(polygon);\n polygonIndices = convexPolygonsIndices[i];\n convexPolygonsIndices.splice(i, 1);\n this.polygonIndicesPool.free(polygonIndices);\n }\n }\n return convexPolygons;\n };\n Triangulator.isConcave = function (index, vertexCount, vertices, indices) {\n var previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\n var current = indices[index] << 1;\n var next = indices[(index + 1) % vertexCount] << 1;\n return !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]);\n };\n Triangulator.positiveArea = function (p1x, p1y, p2x, p2y, p3x, p3y) {\n return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\n };\n Triangulator.winding = function (p1x, p1y, p2x, p2y, p3x, p3y) {\n var px = p2x - p1x, py = p2y - p1y;\n return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\n };\n return Triangulator;\n }());\n spine.Triangulator = Triangulator;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var IntSet = (function () {\n function IntSet() {\n this.array = new Array();\n }\n IntSet.prototype.add = function (value) {\n var contains = this.contains(value);\n this.array[value | 0] = value | 0;\n return !contains;\n };\n IntSet.prototype.contains = function (value) {\n return this.array[value | 0] != undefined;\n };\n IntSet.prototype.remove = function (value) {\n this.array[value | 0] = undefined;\n };\n IntSet.prototype.clear = function () {\n this.array.length = 0;\n };\n return IntSet;\n }());\n spine.IntSet = IntSet;\n var Color = (function () {\n function Color(r, g, b, a) {\n if (r === void 0) { r = 0; }\n if (g === void 0) { g = 0; }\n if (b === void 0) { b = 0; }\n if (a === void 0) { a = 0; }\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }\n Color.prototype.set = function (r, g, b, a) {\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n this.clamp();\n return this;\n };\n Color.prototype.setFromColor = function (c) {\n this.r = c.r;\n this.g = c.g;\n this.b = c.b;\n this.a = c.a;\n return this;\n };\n Color.prototype.setFromString = function (hex) {\n hex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\n this.r = parseInt(hex.substr(0, 2), 16) / 255.0;\n this.g = parseInt(hex.substr(2, 2), 16) / 255.0;\n this.b = parseInt(hex.substr(4, 2), 16) / 255.0;\n this.a = (hex.length != 8 ? 255 : parseInt(hex.substr(6, 2), 16)) / 255.0;\n return this;\n };\n Color.prototype.add = function (r, g, b, a) {\n this.r += r;\n this.g += g;\n this.b += b;\n this.a += a;\n this.clamp();\n return this;\n };\n Color.prototype.clamp = function () {\n if (this.r < 0)\n this.r = 0;\n else if (this.r > 1)\n this.r = 1;\n if (this.g < 0)\n this.g = 0;\n else if (this.g > 1)\n this.g = 1;\n if (this.b < 0)\n this.b = 0;\n else if (this.b > 1)\n this.b = 1;\n if (this.a < 0)\n this.a = 0;\n else if (this.a > 1)\n this.a = 1;\n return this;\n };\n Color.rgba8888ToColor = function (color, value) {\n color.r = ((value & 0xff000000) >>> 24) / 255;\n color.g = ((value & 0x00ff0000) >>> 16) / 255;\n color.b = ((value & 0x0000ff00) >>> 8) / 255;\n color.a = ((value & 0x000000ff)) / 255;\n };\n Color.rgb888ToColor = function (color, value) {\n color.r = ((value & 0x00ff0000) >>> 16) / 255;\n color.g = ((value & 0x0000ff00) >>> 8) / 255;\n color.b = ((value & 0x000000ff)) / 255;\n };\n Color.WHITE = new Color(1, 1, 1, 1);\n Color.RED = new Color(1, 0, 0, 1);\n Color.GREEN = new Color(0, 1, 0, 1);\n Color.BLUE = new Color(0, 0, 1, 1);\n Color.MAGENTA = new Color(1, 0, 1, 1);\n return Color;\n }());\n spine.Color = Color;\n var MathUtils = (function () {\n function MathUtils() {\n }\n MathUtils.clamp = function (value, min, max) {\n if (value < min)\n return min;\n if (value > max)\n return max;\n return value;\n };\n MathUtils.cosDeg = function (degrees) {\n return Math.cos(degrees * MathUtils.degRad);\n };\n MathUtils.sinDeg = function (degrees) {\n return Math.sin(degrees * MathUtils.degRad);\n };\n MathUtils.signum = function (value) {\n return value > 0 ? 1 : value < 0 ? -1 : 0;\n };\n MathUtils.toInt = function (x) {\n return x > 0 ? Math.floor(x) : Math.ceil(x);\n };\n MathUtils.cbrt = function (x) {\n var y = Math.pow(Math.abs(x), 1 / 3);\n return x < 0 ? -y : y;\n };\n MathUtils.randomTriangular = function (min, max) {\n return MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\n };\n MathUtils.randomTriangularWith = function (min, max, mode) {\n var u = Math.random();\n var d = max - min;\n if (u <= (mode - min) / d)\n return min + Math.sqrt(u * d * (mode - min));\n return max - Math.sqrt((1 - u) * d * (max - mode));\n };\n MathUtils.PI = 3.1415927;\n MathUtils.PI2 = MathUtils.PI * 2;\n MathUtils.radiansToDegrees = 180 / MathUtils.PI;\n MathUtils.radDeg = MathUtils.radiansToDegrees;\n MathUtils.degreesToRadians = MathUtils.PI / 180;\n MathUtils.degRad = MathUtils.degreesToRadians;\n return MathUtils;\n }());\n spine.MathUtils = MathUtils;\n var Interpolation = (function () {\n function Interpolation() {\n }\n Interpolation.prototype.apply = function (start, end, a) {\n return start + (end - start) * this.applyInternal(a);\n };\n return Interpolation;\n }());\n spine.Interpolation = Interpolation;\n var Pow = (function (_super) {\n __extends(Pow, _super);\n function Pow(power) {\n var _this = _super.call(this) || this;\n _this.power = 2;\n _this.power = power;\n return _this;\n }\n Pow.prototype.applyInternal = function (a) {\n if (a <= 0.5)\n return Math.pow(a * 2, this.power) / 2;\n return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\n };\n return Pow;\n }(Interpolation));\n spine.Pow = Pow;\n var PowOut = (function (_super) {\n __extends(PowOut, _super);\n function PowOut(power) {\n return _super.call(this, power) || this;\n }\n PowOut.prototype.applyInternal = function (a) {\n return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\n };\n return PowOut;\n }(Pow));\n spine.PowOut = PowOut;\n var Utils = (function () {\n function Utils() {\n }\n Utils.arrayCopy = function (source, sourceStart, dest, destStart, numElements) {\n for (var i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\n dest[j] = source[i];\n }\n };\n Utils.setArraySize = function (array, size, value) {\n if (value === void 0) { value = 0; }\n var oldSize = array.length;\n if (oldSize == size)\n return array;\n array.length = size;\n if (oldSize < size) {\n for (var i = oldSize; i < size; i++)\n array[i] = value;\n }\n return array;\n };\n Utils.ensureArrayCapacity = function (array, size, value) {\n if (value === void 0) { value = 0; }\n if (array.length >= size)\n return array;\n return Utils.setArraySize(array, size, value);\n };\n Utils.newArray = function (size, defaultValue) {\n var array = new Array(size);\n for (var i = 0; i < size; i++)\n array[i] = defaultValue;\n return array;\n };\n Utils.newFloatArray = function (size) {\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\n return new Float32Array(size);\n }\n else {\n var array = new Array(size);\n for (var i = 0; i < array.length; i++)\n array[i] = 0;\n return array;\n }\n };\n Utils.newShortArray = function (size) {\n if (Utils.SUPPORTS_TYPED_ARRAYS) {\n return new Int16Array(size);\n }\n else {\n var array = new Array(size);\n for (var i = 0; i < array.length; i++)\n array[i] = 0;\n return array;\n }\n };\n Utils.toFloatArray = function (array) {\n return Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\n };\n Utils.toSinglePrecision = function (value) {\n return Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\n };\n Utils.webkit602BugfixHelper = function (alpha, blend) {\n };\n Utils.contains = function (array, element, identity) {\n if (identity === void 0) { identity = true; }\n for (var i = 0; i < array.length; i++) {\n if (array[i] == element)\n return true;\n }\n return false;\n };\n Utils.SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\n return Utils;\n }());\n spine.Utils = Utils;\n var DebugUtils = (function () {\n function DebugUtils() {\n }\n DebugUtils.logBones = function (skeleton) {\n for (var i = 0; i < skeleton.bones.length; i++) {\n var bone = skeleton.bones[i];\n console.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\n }\n };\n return DebugUtils;\n }());\n spine.DebugUtils = DebugUtils;\n var Pool = (function () {\n function Pool(instantiator) {\n this.items = new Array();\n this.instantiator = instantiator;\n }\n Pool.prototype.obtain = function () {\n return this.items.length > 0 ? this.items.pop() : this.instantiator();\n };\n Pool.prototype.free = function (item) {\n if (item.reset)\n item.reset();\n this.items.push(item);\n };\n Pool.prototype.freeAll = function (items) {\n for (var i = 0; i < items.length; i++) {\n this.free(items[i]);\n }\n };\n Pool.prototype.clear = function () {\n this.items.length = 0;\n };\n return Pool;\n }());\n spine.Pool = Pool;\n var Vector2 = (function () {\n function Vector2(x, y) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n this.x = x;\n this.y = y;\n }\n Vector2.prototype.set = function (x, y) {\n this.x = x;\n this.y = y;\n return this;\n };\n Vector2.prototype.length = function () {\n var x = this.x;\n var y = this.y;\n return Math.sqrt(x * x + y * y);\n };\n Vector2.prototype.normalize = function () {\n var len = this.length();\n if (len != 0) {\n this.x /= len;\n this.y /= len;\n }\n return this;\n };\n return Vector2;\n }());\n spine.Vector2 = Vector2;\n var TimeKeeper = (function () {\n function TimeKeeper() {\n this.maxDelta = 0.064;\n this.framesPerSecond = 0;\n this.delta = 0;\n this.totalTime = 0;\n this.lastTime = Date.now() / 1000;\n this.frameCount = 0;\n this.frameTime = 0;\n }\n TimeKeeper.prototype.update = function () {\n var now = Date.now() / 1000;\n this.delta = now - this.lastTime;\n this.frameTime += this.delta;\n this.totalTime += this.delta;\n if (this.delta > this.maxDelta)\n this.delta = this.maxDelta;\n this.lastTime = now;\n this.frameCount++;\n if (this.frameTime > 1) {\n this.framesPerSecond = this.frameCount / this.frameTime;\n this.frameTime = 0;\n this.frameCount = 0;\n }\n };\n return TimeKeeper;\n }());\n spine.TimeKeeper = TimeKeeper;\n var WindowedMean = (function () {\n function WindowedMean(windowSize) {\n if (windowSize === void 0) { windowSize = 32; }\n this.addedValues = 0;\n this.lastValue = 0;\n this.mean = 0;\n this.dirty = true;\n this.values = new Array(windowSize);\n }\n WindowedMean.prototype.hasEnoughData = function () {\n return this.addedValues >= this.values.length;\n };\n WindowedMean.prototype.addValue = function (value) {\n if (this.addedValues < this.values.length)\n this.addedValues++;\n this.values[this.lastValue++] = value;\n if (this.lastValue > this.values.length - 1)\n this.lastValue = 0;\n this.dirty = true;\n };\n WindowedMean.prototype.getMean = function () {\n if (this.hasEnoughData()) {\n if (this.dirty) {\n var mean = 0;\n for (var i = 0; i < this.values.length; i++) {\n mean += this.values[i];\n }\n this.mean = mean / this.values.length;\n this.dirty = false;\n }\n return this.mean;\n }\n else {\n return 0;\n }\n };\n return WindowedMean;\n }());\n spine.WindowedMean = WindowedMean;\n})(spine || (spine = {}));\n(function () {\n if (!Math.fround) {\n Math.fround = (function (array) {\n return function (x) {\n return array[0] = x, array[0];\n };\n })(new Float32Array(1));\n }\n})();\nvar spine;\n(function (spine) {\n var Attachment = (function () {\n function Attachment(name) {\n if (name == null)\n throw new Error(\"name cannot be null.\");\n this.name = name;\n }\n return Attachment;\n }());\n spine.Attachment = Attachment;\n var VertexAttachment = (function (_super) {\n __extends(VertexAttachment, _super);\n function VertexAttachment(name) {\n var _this = _super.call(this, name) || this;\n _this.id = (VertexAttachment.nextID++ & 65535) << 11;\n _this.worldVerticesLength = 0;\n _this.deformAttachment = _this;\n return _this;\n }\n VertexAttachment.prototype.computeWorldVertices = function (slot, start, count, worldVertices, offset, stride) {\n count = offset + (count >> 1) * stride;\n var skeleton = slot.bone.skeleton;\n var deformArray = slot.deform;\n var vertices = this.vertices;\n var bones = this.bones;\n if (bones == null) {\n if (deformArray.length > 0)\n vertices = deformArray;\n var bone = slot.bone;\n var x = bone.worldX;\n var y = bone.worldY;\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n for (var v_1 = start, w = offset; w < count; v_1 += 2, w += stride) {\n var vx = vertices[v_1], vy = vertices[v_1 + 1];\n worldVertices[w] = vx * a + vy * b + x;\n worldVertices[w + 1] = vx * c + vy * d + y;\n }\n return;\n }\n var v = 0, skip = 0;\n for (var i = 0; i < start; i += 2) {\n var n = bones[v];\n v += n + 1;\n skip += n;\n }\n var skeletonBones = skeleton.bones;\n if (deformArray.length == 0) {\n for (var w = offset, b = skip * 3; w < count; w += stride) {\n var wx = 0, wy = 0;\n var n = bones[v++];\n n += v;\n for (; v < n; v++, b += 3) {\n var bone = skeletonBones[bones[v]];\n var vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\n wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n }\n worldVertices[w] = wx;\n worldVertices[w + 1] = wy;\n }\n }\n else {\n var deform = deformArray;\n for (var w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\n var wx = 0, wy = 0;\n var n = bones[v++];\n n += v;\n for (; v < n; v++, b += 3, f += 2) {\n var bone = skeletonBones[bones[v]];\n var vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\n wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n }\n worldVertices[w] = wx;\n worldVertices[w + 1] = wy;\n }\n }\n };\n VertexAttachment.prototype.copyTo = function (attachment) {\n if (this.bones != null) {\n attachment.bones = new Array(this.bones.length);\n spine.Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\n }\n else\n attachment.bones = null;\n if (this.vertices != null) {\n attachment.vertices = spine.Utils.newFloatArray(this.vertices.length);\n spine.Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\n }\n else\n attachment.vertices = null;\n attachment.worldVerticesLength = this.worldVerticesLength;\n attachment.deformAttachment = this.deformAttachment;\n };\n VertexAttachment.nextID = 0;\n return VertexAttachment;\n }(Attachment));\n spine.VertexAttachment = VertexAttachment;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var AttachmentType;\n (function (AttachmentType) {\n AttachmentType[AttachmentType[\"Region\"] = 0] = \"Region\";\n AttachmentType[AttachmentType[\"BoundingBox\"] = 1] = \"BoundingBox\";\n AttachmentType[AttachmentType[\"Mesh\"] = 2] = \"Mesh\";\n AttachmentType[AttachmentType[\"LinkedMesh\"] = 3] = \"LinkedMesh\";\n AttachmentType[AttachmentType[\"Path\"] = 4] = \"Path\";\n AttachmentType[AttachmentType[\"Point\"] = 5] = \"Point\";\n AttachmentType[AttachmentType[\"Clipping\"] = 6] = \"Clipping\";\n })(AttachmentType = spine.AttachmentType || (spine.AttachmentType = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var BoundingBoxAttachment = (function (_super) {\n __extends(BoundingBoxAttachment, _super);\n function BoundingBoxAttachment(name) {\n var _this = _super.call(this, name) || this;\n _this.color = new spine.Color(1, 1, 1, 1);\n return _this;\n }\n BoundingBoxAttachment.prototype.copy = function () {\n var copy = new BoundingBoxAttachment(this.name);\n this.copyTo(copy);\n copy.color.setFromColor(this.color);\n return copy;\n };\n return BoundingBoxAttachment;\n }(spine.VertexAttachment));\n spine.BoundingBoxAttachment = BoundingBoxAttachment;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var ClippingAttachment = (function (_super) {\n __extends(ClippingAttachment, _super);\n function ClippingAttachment(name) {\n var _this = _super.call(this, name) || this;\n _this.color = new spine.Color(0.2275, 0.2275, 0.8078, 1);\n return _this;\n }\n ClippingAttachment.prototype.copy = function () {\n var copy = new ClippingAttachment(this.name);\n this.copyTo(copy);\n copy.endSlot = this.endSlot;\n copy.color.setFromColor(this.color);\n return copy;\n };\n return ClippingAttachment;\n }(spine.VertexAttachment));\n spine.ClippingAttachment = ClippingAttachment;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var MeshAttachment = (function (_super) {\n __extends(MeshAttachment, _super);\n function MeshAttachment(name) {\n var _this = _super.call(this, name) || this;\n _this.color = new spine.Color(1, 1, 1, 1);\n _this.tempColor = new spine.Color(0, 0, 0, 0);\n return _this;\n }\n MeshAttachment.prototype.updateUVs = function () {\n var regionUVs = this.regionUVs;\n if (this.uvs == null || this.uvs.length != regionUVs.length)\n this.uvs = spine.Utils.newFloatArray(regionUVs.length);\n var uvs = this.uvs;\n var n = this.uvs.length;\n var u = this.region.u, v = this.region.v, width = 0, height = 0;\n if (this.region instanceof spine.TextureAtlasRegion) {\n var region = this.region;\n var textureWidth = region.texture.getImage().width, textureHeight = region.texture.getImage().height;\n switch (region.degrees) {\n case 90:\n u -= (region.originalHeight - region.offsetY - region.height) / textureWidth;\n v -= (region.originalWidth - region.offsetX - region.width) / textureHeight;\n width = region.originalHeight / textureWidth;\n height = region.originalWidth / textureHeight;\n for (var i = 0; i < n; i += 2) {\n uvs[i] = u + regionUVs[i + 1] * width;\n uvs[i + 1] = v + (1 - regionUVs[i]) * height;\n }\n return;\n case 180:\n u -= (region.originalWidth - region.offsetX - region.width) / textureWidth;\n v -= region.offsetY / textureHeight;\n width = region.originalWidth / textureWidth;\n height = region.originalHeight / textureHeight;\n for (var i = 0; i < n; i += 2) {\n uvs[i] = u + (1 - regionUVs[i]) * width;\n uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;\n }\n return;\n case 270:\n u -= region.offsetY / textureWidth;\n v -= region.offsetX / textureHeight;\n width = region.originalHeight / textureWidth;\n height = region.originalWidth / textureHeight;\n for (var i = 0; i < n; i += 2) {\n uvs[i] = u + (1 - regionUVs[i + 1]) * width;\n uvs[i + 1] = v + regionUVs[i] * height;\n }\n return;\n }\n u -= region.offsetX / textureWidth;\n v -= (region.originalHeight - region.offsetY - region.height) / textureHeight;\n width = region.originalWidth / textureWidth;\n height = region.originalHeight / textureHeight;\n }\n else if (this.region == null) {\n u = v = 0;\n width = height = 1;\n }\n else {\n width = this.region.u2 - u;\n height = this.region.v2 - v;\n }\n for (var i = 0; i < n; i += 2) {\n uvs[i] = u + regionUVs[i] * width;\n uvs[i + 1] = v + regionUVs[i + 1] * height;\n }\n };\n MeshAttachment.prototype.getParentMesh = function () {\n return this.parentMesh;\n };\n MeshAttachment.prototype.setParentMesh = function (parentMesh) {\n this.parentMesh = parentMesh;\n if (parentMesh != null) {\n this.bones = parentMesh.bones;\n this.vertices = parentMesh.vertices;\n this.worldVerticesLength = parentMesh.worldVerticesLength;\n this.regionUVs = parentMesh.regionUVs;\n this.triangles = parentMesh.triangles;\n this.hullLength = parentMesh.hullLength;\n this.worldVerticesLength = parentMesh.worldVerticesLength;\n }\n };\n MeshAttachment.prototype.copy = function () {\n if (this.parentMesh != null)\n return this.newLinkedMesh();\n var copy = new MeshAttachment(this.name);\n copy.region = this.region;\n copy.path = this.path;\n copy.color.setFromColor(this.color);\n this.copyTo(copy);\n copy.regionUVs = new Array(this.regionUVs.length);\n spine.Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\n copy.uvs = new Array(this.uvs.length);\n spine.Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);\n copy.triangles = new Array(this.triangles.length);\n spine.Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\n copy.hullLength = this.hullLength;\n if (this.edges != null) {\n copy.edges = new Array(this.edges.length);\n spine.Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\n }\n copy.width = this.width;\n copy.height = this.height;\n return copy;\n };\n MeshAttachment.prototype.newLinkedMesh = function () {\n var copy = new MeshAttachment(this.name);\n copy.region = this.region;\n copy.path = this.path;\n copy.color.setFromColor(this.color);\n copy.deformAttachment = this.deformAttachment;\n copy.setParentMesh(this.parentMesh != null ? this.parentMesh : this);\n copy.updateUVs();\n return copy;\n };\n return MeshAttachment;\n }(spine.VertexAttachment));\n spine.MeshAttachment = MeshAttachment;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var PathAttachment = (function (_super) {\n __extends(PathAttachment, _super);\n function PathAttachment(name) {\n var _this = _super.call(this, name) || this;\n _this.closed = false;\n _this.constantSpeed = false;\n _this.color = new spine.Color(1, 1, 1, 1);\n return _this;\n }\n PathAttachment.prototype.copy = function () {\n var copy = new PathAttachment(this.name);\n this.copyTo(copy);\n copy.lengths = new Array(this.lengths.length);\n spine.Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\n copy.closed = closed;\n copy.constantSpeed = this.constantSpeed;\n copy.color.setFromColor(this.color);\n return copy;\n };\n return PathAttachment;\n }(spine.VertexAttachment));\n spine.PathAttachment = PathAttachment;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var PointAttachment = (function (_super) {\n __extends(PointAttachment, _super);\n function PointAttachment(name) {\n var _this = _super.call(this, name) || this;\n _this.color = new spine.Color(0.38, 0.94, 0, 1);\n return _this;\n }\n PointAttachment.prototype.computeWorldPosition = function (bone, point) {\n point.x = this.x * bone.a + this.y * bone.b + bone.worldX;\n point.y = this.x * bone.c + this.y * bone.d + bone.worldY;\n return point;\n };\n PointAttachment.prototype.computeWorldRotation = function (bone) {\n var cos = spine.MathUtils.cosDeg(this.rotation), sin = spine.MathUtils.sinDeg(this.rotation);\n var x = cos * bone.a + sin * bone.b;\n var y = cos * bone.c + sin * bone.d;\n return Math.atan2(y, x) * spine.MathUtils.radDeg;\n };\n PointAttachment.prototype.copy = function () {\n var copy = new PointAttachment(this.name);\n copy.x = this.x;\n copy.y = this.y;\n copy.rotation = this.rotation;\n copy.color.setFromColor(this.color);\n return copy;\n };\n return PointAttachment;\n }(spine.VertexAttachment));\n spine.PointAttachment = PointAttachment;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var RegionAttachment = (function (_super) {\n __extends(RegionAttachment, _super);\n function RegionAttachment(name) {\n var _this = _super.call(this, name) || this;\n _this.x = 0;\n _this.y = 0;\n _this.scaleX = 1;\n _this.scaleY = 1;\n _this.rotation = 0;\n _this.width = 0;\n _this.height = 0;\n _this.color = new spine.Color(1, 1, 1, 1);\n _this.offset = spine.Utils.newFloatArray(8);\n _this.uvs = spine.Utils.newFloatArray(8);\n _this.tempColor = new spine.Color(1, 1, 1, 1);\n return _this;\n }\n RegionAttachment.prototype.updateOffset = function () {\n var regionScaleX = this.width / this.region.originalWidth * this.scaleX;\n var regionScaleY = this.height / this.region.originalHeight * this.scaleY;\n var localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\n var localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\n var localX2 = localX + this.region.width * regionScaleX;\n var localY2 = localY + this.region.height * regionScaleY;\n var radians = this.rotation * Math.PI / 180;\n var cos = Math.cos(radians);\n var sin = Math.sin(radians);\n var localXCos = localX * cos + this.x;\n var localXSin = localX * sin;\n var localYCos = localY * cos + this.y;\n var localYSin = localY * sin;\n var localX2Cos = localX2 * cos + this.x;\n var localX2Sin = localX2 * sin;\n var localY2Cos = localY2 * cos + this.y;\n var localY2Sin = localY2 * sin;\n var offset = this.offset;\n offset[RegionAttachment.OX1] = localXCos - localYSin;\n offset[RegionAttachment.OY1] = localYCos + localXSin;\n offset[RegionAttachment.OX2] = localXCos - localY2Sin;\n offset[RegionAttachment.OY2] = localY2Cos + localXSin;\n offset[RegionAttachment.OX3] = localX2Cos - localY2Sin;\n offset[RegionAttachment.OY3] = localY2Cos + localX2Sin;\n offset[RegionAttachment.OX4] = localX2Cos - localYSin;\n offset[RegionAttachment.OY4] = localYCos + localX2Sin;\n };\n RegionAttachment.prototype.setRegion = function (region) {\n this.region = region;\n var uvs = this.uvs;\n if (region.rotate) {\n uvs[2] = region.u;\n uvs[3] = region.v2;\n uvs[4] = region.u;\n uvs[5] = region.v;\n uvs[6] = region.u2;\n uvs[7] = region.v;\n uvs[0] = region.u2;\n uvs[1] = region.v2;\n }\n else {\n uvs[0] = region.u;\n uvs[1] = region.v2;\n uvs[2] = region.u;\n uvs[3] = region.v;\n uvs[4] = region.u2;\n uvs[5] = region.v;\n uvs[6] = region.u2;\n uvs[7] = region.v2;\n }\n };\n RegionAttachment.prototype.computeWorldVertices = function (bone, worldVertices, offset, stride) {\n var vertexOffset = this.offset;\n var x = bone.worldX, y = bone.worldY;\n var a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n var offsetX = 0, offsetY = 0;\n offsetX = vertexOffset[RegionAttachment.OX1];\n offsetY = vertexOffset[RegionAttachment.OY1];\n worldVertices[offset] = offsetX * a + offsetY * b + x;\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n offset += stride;\n offsetX = vertexOffset[RegionAttachment.OX2];\n offsetY = vertexOffset[RegionAttachment.OY2];\n worldVertices[offset] = offsetX * a + offsetY * b + x;\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n offset += stride;\n offsetX = vertexOffset[RegionAttachment.OX3];\n offsetY = vertexOffset[RegionAttachment.OY3];\n worldVertices[offset] = offsetX * a + offsetY * b + x;\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n offset += stride;\n offsetX = vertexOffset[RegionAttachment.OX4];\n offsetY = vertexOffset[RegionAttachment.OY4];\n worldVertices[offset] = offsetX * a + offsetY * b + x;\n worldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n };\n RegionAttachment.prototype.copy = function () {\n var copy = new RegionAttachment(this.name);\n copy.region = this.region;\n copy.rendererObject = this.rendererObject;\n copy.path = this.path;\n copy.x = this.x;\n copy.y = this.y;\n copy.scaleX = this.scaleX;\n copy.scaleY = this.scaleY;\n copy.rotation = this.rotation;\n copy.width = this.width;\n copy.height = this.height;\n spine.Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\n spine.Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\n copy.color.setFromColor(this.color);\n return copy;\n };\n RegionAttachment.OX1 = 0;\n RegionAttachment.OY1 = 1;\n RegionAttachment.OX2 = 2;\n RegionAttachment.OY2 = 3;\n RegionAttachment.OX3 = 4;\n RegionAttachment.OY3 = 5;\n RegionAttachment.OX4 = 6;\n RegionAttachment.OY4 = 7;\n RegionAttachment.X1 = 0;\n RegionAttachment.Y1 = 1;\n RegionAttachment.C1R = 2;\n RegionAttachment.C1G = 3;\n RegionAttachment.C1B = 4;\n RegionAttachment.C1A = 5;\n RegionAttachment.U1 = 6;\n RegionAttachment.V1 = 7;\n RegionAttachment.X2 = 8;\n RegionAttachment.Y2 = 9;\n RegionAttachment.C2R = 10;\n RegionAttachment.C2G = 11;\n RegionAttachment.C2B = 12;\n RegionAttachment.C2A = 13;\n RegionAttachment.U2 = 14;\n RegionAttachment.V2 = 15;\n RegionAttachment.X3 = 16;\n RegionAttachment.Y3 = 17;\n RegionAttachment.C3R = 18;\n RegionAttachment.C3G = 19;\n RegionAttachment.C3B = 20;\n RegionAttachment.C3A = 21;\n RegionAttachment.U3 = 22;\n RegionAttachment.V3 = 23;\n RegionAttachment.X4 = 24;\n RegionAttachment.Y4 = 25;\n RegionAttachment.C4R = 26;\n RegionAttachment.C4G = 27;\n RegionAttachment.C4B = 28;\n RegionAttachment.C4A = 29;\n RegionAttachment.U4 = 30;\n RegionAttachment.V4 = 31;\n return RegionAttachment;\n }(spine.Attachment));\n spine.RegionAttachment = RegionAttachment;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var JitterEffect = (function () {\n function JitterEffect(jitterX, jitterY) {\n this.jitterX = 0;\n this.jitterY = 0;\n this.jitterX = jitterX;\n this.jitterY = jitterY;\n }\n JitterEffect.prototype.begin = function (skeleton) {\n };\n JitterEffect.prototype.transform = function (position, uv, light, dark) {\n position.x += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\n position.y += spine.MathUtils.randomTriangular(-this.jitterX, this.jitterY);\n };\n JitterEffect.prototype.end = function () {\n };\n return JitterEffect;\n }());\n spine.JitterEffect = JitterEffect;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var SwirlEffect = (function () {\n function SwirlEffect(radius) {\n this.centerX = 0;\n this.centerY = 0;\n this.radius = 0;\n this.angle = 0;\n this.worldX = 0;\n this.worldY = 0;\n this.radius = radius;\n }\n SwirlEffect.prototype.begin = function (skeleton) {\n this.worldX = skeleton.x + this.centerX;\n this.worldY = skeleton.y + this.centerY;\n };\n SwirlEffect.prototype.transform = function (position, uv, light, dark) {\n var radAngle = this.angle * spine.MathUtils.degreesToRadians;\n var x = position.x - this.worldX;\n var y = position.y - this.worldY;\n var dist = Math.sqrt(x * x + y * y);\n if (dist < this.radius) {\n var theta = SwirlEffect.interpolation.apply(0, radAngle, (this.radius - dist) / this.radius);\n var cos = Math.cos(theta);\n var sin = Math.sin(theta);\n position.x = cos * x - sin * y + this.worldX;\n position.y = sin * x + cos * y + this.worldY;\n }\n };\n SwirlEffect.prototype.end = function () {\n };\n SwirlEffect.interpolation = new spine.PowOut(2);\n return SwirlEffect;\n }());\n spine.SwirlEffect = SwirlEffect;\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var canvas;\n (function (canvas) {\n var AssetManager = (function (_super) {\n __extends(AssetManager, _super);\n function AssetManager(pathPrefix) {\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\n return _super.call(this, function (image) { return new spine.canvas.CanvasTexture(image); }, pathPrefix) || this;\n }\n return AssetManager;\n }(spine.AssetManager));\n canvas.AssetManager = AssetManager;\n })(canvas = spine.canvas || (spine.canvas = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var canvas;\n (function (canvas) {\n var CanvasTexture = (function (_super) {\n __extends(CanvasTexture, _super);\n function CanvasTexture(image) {\n return _super.call(this, image) || this;\n }\n CanvasTexture.prototype.setFilters = function (minFilter, magFilter) { };\n CanvasTexture.prototype.setWraps = function (uWrap, vWrap) { };\n CanvasTexture.prototype.dispose = function () { };\n return CanvasTexture;\n }(spine.Texture));\n canvas.CanvasTexture = CanvasTexture;\n })(canvas = spine.canvas || (spine.canvas = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var canvas;\n (function (canvas) {\n var SkeletonRenderer = (function () {\n function SkeletonRenderer(context) {\n this.triangleRendering = false;\n this.debugRendering = false;\n this.vertices = spine.Utils.newFloatArray(8 * 1024);\n this.tempColor = new spine.Color();\n this.ctx = context;\n }\n SkeletonRenderer.prototype.draw = function (skeleton) {\n if (this.triangleRendering)\n this.drawTriangles(skeleton);\n else\n this.drawImages(skeleton);\n };\n SkeletonRenderer.prototype.drawImages = function (skeleton) {\n var ctx = this.ctx;\n var drawOrder = skeleton.drawOrder;\n if (this.debugRendering)\n ctx.strokeStyle = \"green\";\n ctx.save();\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n var slot = drawOrder[i];\n if (!slot.bone.active)\n continue;\n var attachment = slot.getAttachment();\n var regionAttachment = null;\n var region = null;\n var image = null;\n if (attachment instanceof spine.RegionAttachment) {\n regionAttachment = attachment;\n region = regionAttachment.region;\n image = region.texture.getImage();\n }\n else\n continue;\n var skeleton_1 = slot.bone.skeleton;\n var skeletonColor = skeleton_1.color;\n var slotColor = slot.color;\n var regionColor = regionAttachment.color;\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\n var color = this.tempColor;\n color.set(skeletonColor.r * slotColor.r * regionColor.r, skeletonColor.g * slotColor.g * regionColor.g, skeletonColor.b * slotColor.b * regionColor.b, alpha);\n var att = attachment;\n var bone = slot.bone;\n var w = region.width;\n var h = region.height;\n ctx.save();\n ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\n ctx.translate(attachment.offset[0], attachment.offset[1]);\n ctx.rotate(attachment.rotation * Math.PI / 180);\n var atlasScale = att.width / w;\n ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\n ctx.translate(w / 2, h / 2);\n if (attachment.region.rotate) {\n var t = w;\n w = h;\n h = t;\n ctx.rotate(-Math.PI / 2);\n }\n ctx.scale(1, -1);\n ctx.translate(-w / 2, -h / 2);\n if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\n ctx.globalAlpha = color.a;\n }\n ctx.drawImage(image, region.x, region.y, w, h, 0, 0, w, h);\n if (this.debugRendering)\n ctx.strokeRect(0, 0, w, h);\n ctx.restore();\n }\n ctx.restore();\n };\n SkeletonRenderer.prototype.drawTriangles = function (skeleton) {\n var blendMode = null;\n var vertices = this.vertices;\n var triangles = null;\n var drawOrder = skeleton.drawOrder;\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n var slot = drawOrder[i];\n var attachment = slot.getAttachment();\n var texture = null;\n var region = null;\n if (attachment instanceof spine.RegionAttachment) {\n var regionAttachment = attachment;\n vertices = this.computeRegionVertices(slot, regionAttachment, false);\n triangles = SkeletonRenderer.QUAD_TRIANGLES;\n region = regionAttachment.region;\n texture = region.texture.getImage();\n }\n else if (attachment instanceof spine.MeshAttachment) {\n var mesh = attachment;\n vertices = this.computeMeshVertices(slot, mesh, false);\n triangles = mesh.triangles;\n texture = mesh.region.renderObject.texture.getImage();\n }\n else\n continue;\n if (texture != null) {\n var slotBlendMode = slot.data.blendMode;\n if (slotBlendMode != blendMode) {\n blendMode = slotBlendMode;\n }\n var skeleton_2 = slot.bone.skeleton;\n var skeletonColor = skeleton_2.color;\n var slotColor = slot.color;\n var attachmentColor = attachment.color;\n var alpha = skeletonColor.a * slotColor.a * attachmentColor.a;\n var color = this.tempColor;\n color.set(skeletonColor.r * slotColor.r * attachmentColor.r, skeletonColor.g * slotColor.g * attachmentColor.g, skeletonColor.b * slotColor.b * attachmentColor.b, alpha);\n var ctx = this.ctx;\n if (color.r != 1 || color.g != 1 || color.b != 1 || color.a != 1) {\n ctx.globalAlpha = color.a;\n }\n for (var j = 0; j < triangles.length; j += 3) {\n var t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\n var x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\n var x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\n var x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\n this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\n if (this.debugRendering) {\n ctx.strokeStyle = \"green\";\n ctx.beginPath();\n ctx.moveTo(x0, y0);\n ctx.lineTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.lineTo(x0, y0);\n ctx.stroke();\n }\n }\n }\n }\n this.ctx.globalAlpha = 1;\n };\n SkeletonRenderer.prototype.drawTriangle = function (img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) {\n var ctx = this.ctx;\n u0 *= img.width;\n v0 *= img.height;\n u1 *= img.width;\n v1 *= img.height;\n u2 *= img.width;\n v2 *= img.height;\n ctx.beginPath();\n ctx.moveTo(x0, y0);\n ctx.lineTo(x1, y1);\n ctx.lineTo(x2, y2);\n ctx.closePath();\n x1 -= x0;\n y1 -= y0;\n x2 -= x0;\n y2 -= y0;\n u1 -= u0;\n v1 -= v0;\n u2 -= u0;\n v2 -= v0;\n var det = 1 / (u1 * v2 - u2 * v1), a = (v2 * x1 - v1 * x2) * det, b = (v2 * y1 - v1 * y2) * det, c = (u1 * x2 - u2 * x1) * det, d = (u1 * y2 - u2 * y1) * det, e = x0 - a * u0 - c * v0, f = y0 - b * u0 - d * v0;\n ctx.save();\n ctx.transform(a, b, c, d, e, f);\n ctx.clip();\n ctx.drawImage(img, 0, 0);\n ctx.restore();\n };\n SkeletonRenderer.prototype.computeRegionVertices = function (slot, region, pma) {\n var skeleton = slot.bone.skeleton;\n var skeletonColor = skeleton.color;\n var slotColor = slot.color;\n var regionColor = region.color;\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\n var multiplier = pma ? alpha : 1;\n var color = this.tempColor;\n color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\n region.computeWorldVertices(slot.bone, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n var vertices = this.vertices;\n var uvs = region.uvs;\n vertices[spine.RegionAttachment.C1R] = color.r;\n vertices[spine.RegionAttachment.C1G] = color.g;\n vertices[spine.RegionAttachment.C1B] = color.b;\n vertices[spine.RegionAttachment.C1A] = color.a;\n vertices[spine.RegionAttachment.U1] = uvs[0];\n vertices[spine.RegionAttachment.V1] = uvs[1];\n vertices[spine.RegionAttachment.C2R] = color.r;\n vertices[spine.RegionAttachment.C2G] = color.g;\n vertices[spine.RegionAttachment.C2B] = color.b;\n vertices[spine.RegionAttachment.C2A] = color.a;\n vertices[spine.RegionAttachment.U2] = uvs[2];\n vertices[spine.RegionAttachment.V2] = uvs[3];\n vertices[spine.RegionAttachment.C3R] = color.r;\n vertices[spine.RegionAttachment.C3G] = color.g;\n vertices[spine.RegionAttachment.C3B] = color.b;\n vertices[spine.RegionAttachment.C3A] = color.a;\n vertices[spine.RegionAttachment.U3] = uvs[4];\n vertices[spine.RegionAttachment.V3] = uvs[5];\n vertices[spine.RegionAttachment.C4R] = color.r;\n vertices[spine.RegionAttachment.C4G] = color.g;\n vertices[spine.RegionAttachment.C4B] = color.b;\n vertices[spine.RegionAttachment.C4A] = color.a;\n vertices[spine.RegionAttachment.U4] = uvs[6];\n vertices[spine.RegionAttachment.V4] = uvs[7];\n return vertices;\n };\n SkeletonRenderer.prototype.computeMeshVertices = function (slot, mesh, pma) {\n var skeleton = slot.bone.skeleton;\n var skeletonColor = skeleton.color;\n var slotColor = slot.color;\n var regionColor = mesh.color;\n var alpha = skeletonColor.a * slotColor.a * regionColor.a;\n var multiplier = pma ? alpha : 1;\n var color = this.tempColor;\n color.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier, skeletonColor.g * slotColor.g * regionColor.g * multiplier, skeletonColor.b * slotColor.b * regionColor.b * multiplier, alpha);\n var numVertices = mesh.worldVerticesLength / 2;\n if (this.vertices.length < mesh.worldVerticesLength) {\n this.vertices = spine.Utils.newFloatArray(mesh.worldVerticesLength);\n }\n var vertices = this.vertices;\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n var uvs = mesh.uvs;\n for (var i = 0, n = numVertices, u = 0, v = 2; i < n; i++) {\n vertices[v++] = color.r;\n vertices[v++] = color.g;\n vertices[v++] = color.b;\n vertices[v++] = color.a;\n vertices[v++] = uvs[u++];\n vertices[v++] = uvs[u++];\n v += 2;\n }\n return vertices;\n };\n SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n SkeletonRenderer.VERTEX_SIZE = 2 + 2 + 4;\n return SkeletonRenderer;\n }());\n canvas.SkeletonRenderer = SkeletonRenderer;\n })(canvas = spine.canvas || (spine.canvas = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var AssetManager = (function (_super) {\n __extends(AssetManager, _super);\n function AssetManager(context, pathPrefix) {\n if (pathPrefix === void 0) { pathPrefix = \"\"; }\n return _super.call(this, function (image) {\n return new spine.webgl.GLTexture(context, image);\n }, pathPrefix) || this;\n }\n return AssetManager;\n }(spine.AssetManager));\n webgl.AssetManager = AssetManager;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var OrthoCamera = (function () {\n function OrthoCamera(viewportWidth, viewportHeight) {\n this.position = new webgl.Vector3(0, 0, 0);\n this.direction = new webgl.Vector3(0, 0, -1);\n this.up = new webgl.Vector3(0, 1, 0);\n this.near = 0;\n this.far = 100;\n this.zoom = 1;\n this.viewportWidth = 0;\n this.viewportHeight = 0;\n this.projectionView = new webgl.Matrix4();\n this.inverseProjectionView = new webgl.Matrix4();\n this.projection = new webgl.Matrix4();\n this.view = new webgl.Matrix4();\n this.tmp = new webgl.Vector3();\n this.viewportWidth = viewportWidth;\n this.viewportHeight = viewportHeight;\n this.update();\n }\n OrthoCamera.prototype.update = function () {\n var projection = this.projection;\n var view = this.view;\n var projectionView = this.projectionView;\n var inverseProjectionView = this.inverseProjectionView;\n var zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\n projection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2), zoom * (-viewportHeight / 2), zoom * (viewportHeight / 2), this.near, this.far);\n view.lookAt(this.position, this.direction, this.up);\n projectionView.set(projection.values);\n projectionView.multiply(view);\n inverseProjectionView.set(projectionView.values).invert();\n };\n OrthoCamera.prototype.screenToWorld = function (screenCoords, screenWidth, screenHeight) {\n var x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\n var tmp = this.tmp;\n tmp.x = (2 * x) / screenWidth - 1;\n tmp.y = (2 * y) / screenHeight - 1;\n tmp.z = (2 * screenCoords.z) - 1;\n tmp.project(this.inverseProjectionView);\n screenCoords.set(tmp.x, tmp.y, tmp.z);\n return screenCoords;\n };\n OrthoCamera.prototype.setViewport = function (viewportWidth, viewportHeight) {\n this.viewportWidth = viewportWidth;\n this.viewportHeight = viewportHeight;\n };\n return OrthoCamera;\n }());\n webgl.OrthoCamera = OrthoCamera;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var GLTexture = (function (_super) {\n __extends(GLTexture, _super);\n function GLTexture(context, image, useMipMaps) {\n if (useMipMaps === void 0) { useMipMaps = false; }\n var _this = _super.call(this, image) || this;\n _this.texture = null;\n _this.boundUnit = 0;\n _this.useMipMaps = false;\n _this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\n _this.useMipMaps = useMipMaps;\n _this.restore();\n _this.context.addRestorable(_this);\n return _this;\n }\n GLTexture.prototype.setFilters = function (minFilter, magFilter) {\n var gl = this.context.gl;\n this.bind();\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, GLTexture.validateMagFilter(magFilter));\n };\n GLTexture.validateMagFilter = function (magFilter) {\n switch (magFilter) {\n case spine.TextureFilter.MipMap:\n case spine.TextureFilter.MipMapLinearLinear:\n case spine.TextureFilter.MipMapLinearNearest:\n case spine.TextureFilter.MipMapNearestLinear:\n case spine.TextureFilter.MipMapNearestNearest:\n return spine.TextureFilter.Linear;\n default:\n return magFilter;\n }\n };\n GLTexture.prototype.setWraps = function (uWrap, vWrap) {\n var gl = this.context.gl;\n this.bind();\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\n };\n GLTexture.prototype.update = function (useMipMaps) {\n var gl = this.context.gl;\n if (!this.texture) {\n this.texture = this.context.gl.createTexture();\n }\n this.bind();\n if (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL)\n gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n if (useMipMaps)\n gl.generateMipmap(gl.TEXTURE_2D);\n };\n GLTexture.prototype.restore = function () {\n this.texture = null;\n this.update(this.useMipMaps);\n };\n GLTexture.prototype.bind = function (unit) {\n if (unit === void 0) { unit = 0; }\n var gl = this.context.gl;\n this.boundUnit = unit;\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, this.texture);\n };\n GLTexture.prototype.unbind = function () {\n var gl = this.context.gl;\n gl.activeTexture(gl.TEXTURE0 + this.boundUnit);\n gl.bindTexture(gl.TEXTURE_2D, null);\n };\n GLTexture.prototype.dispose = function () {\n this.context.removeRestorable(this);\n var gl = this.context.gl;\n gl.deleteTexture(this.texture);\n };\n GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;\n return GLTexture;\n }(spine.Texture));\n webgl.GLTexture = GLTexture;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n webgl.M00 = 0;\n webgl.M01 = 4;\n webgl.M02 = 8;\n webgl.M03 = 12;\n webgl.M10 = 1;\n webgl.M11 = 5;\n webgl.M12 = 9;\n webgl.M13 = 13;\n webgl.M20 = 2;\n webgl.M21 = 6;\n webgl.M22 = 10;\n webgl.M23 = 14;\n webgl.M30 = 3;\n webgl.M31 = 7;\n webgl.M32 = 11;\n webgl.M33 = 15;\n var Matrix4 = (function () {\n function Matrix4() {\n this.temp = new Float32Array(16);\n this.values = new Float32Array(16);\n var v = this.values;\n v[webgl.M00] = 1;\n v[webgl.M11] = 1;\n v[webgl.M22] = 1;\n v[webgl.M33] = 1;\n }\n Matrix4.prototype.set = function (values) {\n this.values.set(values);\n return this;\n };\n Matrix4.prototype.transpose = function () {\n var t = this.temp;\n var v = this.values;\n t[webgl.M00] = v[webgl.M00];\n t[webgl.M01] = v[webgl.M10];\n t[webgl.M02] = v[webgl.M20];\n t[webgl.M03] = v[webgl.M30];\n t[webgl.M10] = v[webgl.M01];\n t[webgl.M11] = v[webgl.M11];\n t[webgl.M12] = v[webgl.M21];\n t[webgl.M13] = v[webgl.M31];\n t[webgl.M20] = v[webgl.M02];\n t[webgl.M21] = v[webgl.M12];\n t[webgl.M22] = v[webgl.M22];\n t[webgl.M23] = v[webgl.M32];\n t[webgl.M30] = v[webgl.M03];\n t[webgl.M31] = v[webgl.M13];\n t[webgl.M32] = v[webgl.M23];\n t[webgl.M33] = v[webgl.M33];\n return this.set(t);\n };\n Matrix4.prototype.identity = function () {\n var v = this.values;\n v[webgl.M00] = 1;\n v[webgl.M01] = 0;\n v[webgl.M02] = 0;\n v[webgl.M03] = 0;\n v[webgl.M10] = 0;\n v[webgl.M11] = 1;\n v[webgl.M12] = 0;\n v[webgl.M13] = 0;\n v[webgl.M20] = 0;\n v[webgl.M21] = 0;\n v[webgl.M22] = 1;\n v[webgl.M23] = 0;\n v[webgl.M30] = 0;\n v[webgl.M31] = 0;\n v[webgl.M32] = 0;\n v[webgl.M33] = 1;\n return this;\n };\n Matrix4.prototype.invert = function () {\n var v = this.values;\n var t = this.temp;\n var l_det = v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\n + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\n - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\n - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\n + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\n + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\n - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\n - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\n if (l_det == 0)\n throw new Error(\"non-invertible matrix\");\n var inv_det = 1.0 / l_det;\n t[webgl.M00] = v[webgl.M12] * v[webgl.M23] * v[webgl.M31] - v[webgl.M13] * v[webgl.M22] * v[webgl.M31] + v[webgl.M13] * v[webgl.M21] * v[webgl.M32]\n - v[webgl.M11] * v[webgl.M23] * v[webgl.M32] - v[webgl.M12] * v[webgl.M21] * v[webgl.M33] + v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\n t[webgl.M01] = v[webgl.M03] * v[webgl.M22] * v[webgl.M31] - v[webgl.M02] * v[webgl.M23] * v[webgl.M31] - v[webgl.M03] * v[webgl.M21] * v[webgl.M32]\n + v[webgl.M01] * v[webgl.M23] * v[webgl.M32] + v[webgl.M02] * v[webgl.M21] * v[webgl.M33] - v[webgl.M01] * v[webgl.M22] * v[webgl.M33];\n t[webgl.M02] = v[webgl.M02] * v[webgl.M13] * v[webgl.M31] - v[webgl.M03] * v[webgl.M12] * v[webgl.M31] + v[webgl.M03] * v[webgl.M11] * v[webgl.M32]\n - v[webgl.M01] * v[webgl.M13] * v[webgl.M32] - v[webgl.M02] * v[webgl.M11] * v[webgl.M33] + v[webgl.M01] * v[webgl.M12] * v[webgl.M33];\n t[webgl.M03] = v[webgl.M03] * v[webgl.M12] * v[webgl.M21] - v[webgl.M02] * v[webgl.M13] * v[webgl.M21] - v[webgl.M03] * v[webgl.M11] * v[webgl.M22]\n + v[webgl.M01] * v[webgl.M13] * v[webgl.M22] + v[webgl.M02] * v[webgl.M11] * v[webgl.M23] - v[webgl.M01] * v[webgl.M12] * v[webgl.M23];\n t[webgl.M10] = v[webgl.M13] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M20] * v[webgl.M32]\n + v[webgl.M10] * v[webgl.M23] * v[webgl.M32] + v[webgl.M12] * v[webgl.M20] * v[webgl.M33] - v[webgl.M10] * v[webgl.M22] * v[webgl.M33];\n t[webgl.M11] = v[webgl.M02] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M22] * v[webgl.M30] + v[webgl.M03] * v[webgl.M20] * v[webgl.M32]\n - v[webgl.M00] * v[webgl.M23] * v[webgl.M32] - v[webgl.M02] * v[webgl.M20] * v[webgl.M33] + v[webgl.M00] * v[webgl.M22] * v[webgl.M33];\n t[webgl.M12] = v[webgl.M03] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M10] * v[webgl.M32]\n + v[webgl.M00] * v[webgl.M13] * v[webgl.M32] + v[webgl.M02] * v[webgl.M10] * v[webgl.M33] - v[webgl.M00] * v[webgl.M12] * v[webgl.M33];\n t[webgl.M13] = v[webgl.M02] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M12] * v[webgl.M20] + v[webgl.M03] * v[webgl.M10] * v[webgl.M22]\n - v[webgl.M00] * v[webgl.M13] * v[webgl.M22] - v[webgl.M02] * v[webgl.M10] * v[webgl.M23] + v[webgl.M00] * v[webgl.M12] * v[webgl.M23];\n t[webgl.M20] = v[webgl.M11] * v[webgl.M23] * v[webgl.M30] - v[webgl.M13] * v[webgl.M21] * v[webgl.M30] + v[webgl.M13] * v[webgl.M20] * v[webgl.M31]\n - v[webgl.M10] * v[webgl.M23] * v[webgl.M31] - v[webgl.M11] * v[webgl.M20] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M33];\n t[webgl.M21] = v[webgl.M03] * v[webgl.M21] * v[webgl.M30] - v[webgl.M01] * v[webgl.M23] * v[webgl.M30] - v[webgl.M03] * v[webgl.M20] * v[webgl.M31]\n + v[webgl.M00] * v[webgl.M23] * v[webgl.M31] + v[webgl.M01] * v[webgl.M20] * v[webgl.M33] - v[webgl.M00] * v[webgl.M21] * v[webgl.M33];\n t[webgl.M22] = v[webgl.M01] * v[webgl.M13] * v[webgl.M30] - v[webgl.M03] * v[webgl.M11] * v[webgl.M30] + v[webgl.M03] * v[webgl.M10] * v[webgl.M31]\n - v[webgl.M00] * v[webgl.M13] * v[webgl.M31] - v[webgl.M01] * v[webgl.M10] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M33];\n t[webgl.M23] = v[webgl.M03] * v[webgl.M11] * v[webgl.M20] - v[webgl.M01] * v[webgl.M13] * v[webgl.M20] - v[webgl.M03] * v[webgl.M10] * v[webgl.M21]\n + v[webgl.M00] * v[webgl.M13] * v[webgl.M21] + v[webgl.M01] * v[webgl.M10] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M23];\n t[webgl.M30] = v[webgl.M12] * v[webgl.M21] * v[webgl.M30] - v[webgl.M11] * v[webgl.M22] * v[webgl.M30] - v[webgl.M12] * v[webgl.M20] * v[webgl.M31]\n + v[webgl.M10] * v[webgl.M22] * v[webgl.M31] + v[webgl.M11] * v[webgl.M20] * v[webgl.M32] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32];\n t[webgl.M31] = v[webgl.M01] * v[webgl.M22] * v[webgl.M30] - v[webgl.M02] * v[webgl.M21] * v[webgl.M30] + v[webgl.M02] * v[webgl.M20] * v[webgl.M31]\n - v[webgl.M00] * v[webgl.M22] * v[webgl.M31] - v[webgl.M01] * v[webgl.M20] * v[webgl.M32] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32];\n t[webgl.M32] = v[webgl.M02] * v[webgl.M11] * v[webgl.M30] - v[webgl.M01] * v[webgl.M12] * v[webgl.M30] - v[webgl.M02] * v[webgl.M10] * v[webgl.M31]\n + v[webgl.M00] * v[webgl.M12] * v[webgl.M31] + v[webgl.M01] * v[webgl.M10] * v[webgl.M32] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32];\n t[webgl.M33] = v[webgl.M01] * v[webgl.M12] * v[webgl.M20] - v[webgl.M02] * v[webgl.M11] * v[webgl.M20] + v[webgl.M02] * v[webgl.M10] * v[webgl.M21]\n - v[webgl.M00] * v[webgl.M12] * v[webgl.M21] - v[webgl.M01] * v[webgl.M10] * v[webgl.M22] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22];\n v[webgl.M00] = t[webgl.M00] * inv_det;\n v[webgl.M01] = t[webgl.M01] * inv_det;\n v[webgl.M02] = t[webgl.M02] * inv_det;\n v[webgl.M03] = t[webgl.M03] * inv_det;\n v[webgl.M10] = t[webgl.M10] * inv_det;\n v[webgl.M11] = t[webgl.M11] * inv_det;\n v[webgl.M12] = t[webgl.M12] * inv_det;\n v[webgl.M13] = t[webgl.M13] * inv_det;\n v[webgl.M20] = t[webgl.M20] * inv_det;\n v[webgl.M21] = t[webgl.M21] * inv_det;\n v[webgl.M22] = t[webgl.M22] * inv_det;\n v[webgl.M23] = t[webgl.M23] * inv_det;\n v[webgl.M30] = t[webgl.M30] * inv_det;\n v[webgl.M31] = t[webgl.M31] * inv_det;\n v[webgl.M32] = t[webgl.M32] * inv_det;\n v[webgl.M33] = t[webgl.M33] * inv_det;\n return this;\n };\n Matrix4.prototype.determinant = function () {\n var v = this.values;\n return v[webgl.M30] * v[webgl.M21] * v[webgl.M12] * v[webgl.M03] - v[webgl.M20] * v[webgl.M31] * v[webgl.M12] * v[webgl.M03] - v[webgl.M30] * v[webgl.M11] * v[webgl.M22] * v[webgl.M03]\n + v[webgl.M10] * v[webgl.M31] * v[webgl.M22] * v[webgl.M03] + v[webgl.M20] * v[webgl.M11] * v[webgl.M32] * v[webgl.M03] - v[webgl.M10] * v[webgl.M21] * v[webgl.M32] * v[webgl.M03]\n - v[webgl.M30] * v[webgl.M21] * v[webgl.M02] * v[webgl.M13] + v[webgl.M20] * v[webgl.M31] * v[webgl.M02] * v[webgl.M13] + v[webgl.M30] * v[webgl.M01] * v[webgl.M22] * v[webgl.M13]\n - v[webgl.M00] * v[webgl.M31] * v[webgl.M22] * v[webgl.M13] - v[webgl.M20] * v[webgl.M01] * v[webgl.M32] * v[webgl.M13] + v[webgl.M00] * v[webgl.M21] * v[webgl.M32] * v[webgl.M13]\n + v[webgl.M30] * v[webgl.M11] * v[webgl.M02] * v[webgl.M23] - v[webgl.M10] * v[webgl.M31] * v[webgl.M02] * v[webgl.M23] - v[webgl.M30] * v[webgl.M01] * v[webgl.M12] * v[webgl.M23]\n + v[webgl.M00] * v[webgl.M31] * v[webgl.M12] * v[webgl.M23] + v[webgl.M10] * v[webgl.M01] * v[webgl.M32] * v[webgl.M23] - v[webgl.M00] * v[webgl.M11] * v[webgl.M32] * v[webgl.M23]\n - v[webgl.M20] * v[webgl.M11] * v[webgl.M02] * v[webgl.M33] + v[webgl.M10] * v[webgl.M21] * v[webgl.M02] * v[webgl.M33] + v[webgl.M20] * v[webgl.M01] * v[webgl.M12] * v[webgl.M33]\n - v[webgl.M00] * v[webgl.M21] * v[webgl.M12] * v[webgl.M33] - v[webgl.M10] * v[webgl.M01] * v[webgl.M22] * v[webgl.M33] + v[webgl.M00] * v[webgl.M11] * v[webgl.M22] * v[webgl.M33];\n };\n Matrix4.prototype.translate = function (x, y, z) {\n var v = this.values;\n v[webgl.M03] += x;\n v[webgl.M13] += y;\n v[webgl.M23] += z;\n return this;\n };\n Matrix4.prototype.copy = function () {\n return new Matrix4().set(this.values);\n };\n Matrix4.prototype.projection = function (near, far, fovy, aspectRatio) {\n this.identity();\n var l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\n var l_a1 = (far + near) / (near - far);\n var l_a2 = (2 * far * near) / (near - far);\n var v = this.values;\n v[webgl.M00] = l_fd / aspectRatio;\n v[webgl.M10] = 0;\n v[webgl.M20] = 0;\n v[webgl.M30] = 0;\n v[webgl.M01] = 0;\n v[webgl.M11] = l_fd;\n v[webgl.M21] = 0;\n v[webgl.M31] = 0;\n v[webgl.M02] = 0;\n v[webgl.M12] = 0;\n v[webgl.M22] = l_a1;\n v[webgl.M32] = -1;\n v[webgl.M03] = 0;\n v[webgl.M13] = 0;\n v[webgl.M23] = l_a2;\n v[webgl.M33] = 0;\n return this;\n };\n Matrix4.prototype.ortho2d = function (x, y, width, height) {\n return this.ortho(x, x + width, y, y + height, 0, 1);\n };\n Matrix4.prototype.ortho = function (left, right, bottom, top, near, far) {\n this.identity();\n var x_orth = 2 / (right - left);\n var y_orth = 2 / (top - bottom);\n var z_orth = -2 / (far - near);\n var tx = -(right + left) / (right - left);\n var ty = -(top + bottom) / (top - bottom);\n var tz = -(far + near) / (far - near);\n var v = this.values;\n v[webgl.M00] = x_orth;\n v[webgl.M10] = 0;\n v[webgl.M20] = 0;\n v[webgl.M30] = 0;\n v[webgl.M01] = 0;\n v[webgl.M11] = y_orth;\n v[webgl.M21] = 0;\n v[webgl.M31] = 0;\n v[webgl.M02] = 0;\n v[webgl.M12] = 0;\n v[webgl.M22] = z_orth;\n v[webgl.M32] = 0;\n v[webgl.M03] = tx;\n v[webgl.M13] = ty;\n v[webgl.M23] = tz;\n v[webgl.M33] = 1;\n return this;\n };\n Matrix4.prototype.multiply = function (matrix) {\n var t = this.temp;\n var v = this.values;\n var m = matrix.values;\n t[webgl.M00] = v[webgl.M00] * m[webgl.M00] + v[webgl.M01] * m[webgl.M10] + v[webgl.M02] * m[webgl.M20] + v[webgl.M03] * m[webgl.M30];\n t[webgl.M01] = v[webgl.M00] * m[webgl.M01] + v[webgl.M01] * m[webgl.M11] + v[webgl.M02] * m[webgl.M21] + v[webgl.M03] * m[webgl.M31];\n t[webgl.M02] = v[webgl.M00] * m[webgl.M02] + v[webgl.M01] * m[webgl.M12] + v[webgl.M02] * m[webgl.M22] + v[webgl.M03] * m[webgl.M32];\n t[webgl.M03] = v[webgl.M00] * m[webgl.M03] + v[webgl.M01] * m[webgl.M13] + v[webgl.M02] * m[webgl.M23] + v[webgl.M03] * m[webgl.M33];\n t[webgl.M10] = v[webgl.M10] * m[webgl.M00] + v[webgl.M11] * m[webgl.M10] + v[webgl.M12] * m[webgl.M20] + v[webgl.M13] * m[webgl.M30];\n t[webgl.M11] = v[webgl.M10] * m[webgl.M01] + v[webgl.M11] * m[webgl.M11] + v[webgl.M12] * m[webgl.M21] + v[webgl.M13] * m[webgl.M31];\n t[webgl.M12] = v[webgl.M10] * m[webgl.M02] + v[webgl.M11] * m[webgl.M12] + v[webgl.M12] * m[webgl.M22] + v[webgl.M13] * m[webgl.M32];\n t[webgl.M13] = v[webgl.M10] * m[webgl.M03] + v[webgl.M11] * m[webgl.M13] + v[webgl.M12] * m[webgl.M23] + v[webgl.M13] * m[webgl.M33];\n t[webgl.M20] = v[webgl.M20] * m[webgl.M00] + v[webgl.M21] * m[webgl.M10] + v[webgl.M22] * m[webgl.M20] + v[webgl.M23] * m[webgl.M30];\n t[webgl.M21] = v[webgl.M20] * m[webgl.M01] + v[webgl.M21] * m[webgl.M11] + v[webgl.M22] * m[webgl.M21] + v[webgl.M23] * m[webgl.M31];\n t[webgl.M22] = v[webgl.M20] * m[webgl.M02] + v[webgl.M21] * m[webgl.M12] + v[webgl.M22] * m[webgl.M22] + v[webgl.M23] * m[webgl.M32];\n t[webgl.M23] = v[webgl.M20] * m[webgl.M03] + v[webgl.M21] * m[webgl.M13] + v[webgl.M22] * m[webgl.M23] + v[webgl.M23] * m[webgl.M33];\n t[webgl.M30] = v[webgl.M30] * m[webgl.M00] + v[webgl.M31] * m[webgl.M10] + v[webgl.M32] * m[webgl.M20] + v[webgl.M33] * m[webgl.M30];\n t[webgl.M31] = v[webgl.M30] * m[webgl.M01] + v[webgl.M31] * m[webgl.M11] + v[webgl.M32] * m[webgl.M21] + v[webgl.M33] * m[webgl.M31];\n t[webgl.M32] = v[webgl.M30] * m[webgl.M02] + v[webgl.M31] * m[webgl.M12] + v[webgl.M32] * m[webgl.M22] + v[webgl.M33] * m[webgl.M32];\n t[webgl.M33] = v[webgl.M30] * m[webgl.M03] + v[webgl.M31] * m[webgl.M13] + v[webgl.M32] * m[webgl.M23] + v[webgl.M33] * m[webgl.M33];\n return this.set(this.temp);\n };\n Matrix4.prototype.multiplyLeft = function (matrix) {\n var t = this.temp;\n var v = this.values;\n var m = matrix.values;\n t[webgl.M00] = m[webgl.M00] * v[webgl.M00] + m[webgl.M01] * v[webgl.M10] + m[webgl.M02] * v[webgl.M20] + m[webgl.M03] * v[webgl.M30];\n t[webgl.M01] = m[webgl.M00] * v[webgl.M01] + m[webgl.M01] * v[webgl.M11] + m[webgl.M02] * v[webgl.M21] + m[webgl.M03] * v[webgl.M31];\n t[webgl.M02] = m[webgl.M00] * v[webgl.M02] + m[webgl.M01] * v[webgl.M12] + m[webgl.M02] * v[webgl.M22] + m[webgl.M03] * v[webgl.M32];\n t[webgl.M03] = m[webgl.M00] * v[webgl.M03] + m[webgl.M01] * v[webgl.M13] + m[webgl.M02] * v[webgl.M23] + m[webgl.M03] * v[webgl.M33];\n t[webgl.M10] = m[webgl.M10] * v[webgl.M00] + m[webgl.M11] * v[webgl.M10] + m[webgl.M12] * v[webgl.M20] + m[webgl.M13] * v[webgl.M30];\n t[webgl.M11] = m[webgl.M10] * v[webgl.M01] + m[webgl.M11] * v[webgl.M11] + m[webgl.M12] * v[webgl.M21] + m[webgl.M13] * v[webgl.M31];\n t[webgl.M12] = m[webgl.M10] * v[webgl.M02] + m[webgl.M11] * v[webgl.M12] + m[webgl.M12] * v[webgl.M22] + m[webgl.M13] * v[webgl.M32];\n t[webgl.M13] = m[webgl.M10] * v[webgl.M03] + m[webgl.M11] * v[webgl.M13] + m[webgl.M12] * v[webgl.M23] + m[webgl.M13] * v[webgl.M33];\n t[webgl.M20] = m[webgl.M20] * v[webgl.M00] + m[webgl.M21] * v[webgl.M10] + m[webgl.M22] * v[webgl.M20] + m[webgl.M23] * v[webgl.M30];\n t[webgl.M21] = m[webgl.M20] * v[webgl.M01] + m[webgl.M21] * v[webgl.M11] + m[webgl.M22] * v[webgl.M21] + m[webgl.M23] * v[webgl.M31];\n t[webgl.M22] = m[webgl.M20] * v[webgl.M02] + m[webgl.M21] * v[webgl.M12] + m[webgl.M22] * v[webgl.M22] + m[webgl.M23] * v[webgl.M32];\n t[webgl.M23] = m[webgl.M20] * v[webgl.M03] + m[webgl.M21] * v[webgl.M13] + m[webgl.M22] * v[webgl.M23] + m[webgl.M23] * v[webgl.M33];\n t[webgl.M30] = m[webgl.M30] * v[webgl.M00] + m[webgl.M31] * v[webgl.M10] + m[webgl.M32] * v[webgl.M20] + m[webgl.M33] * v[webgl.M30];\n t[webgl.M31] = m[webgl.M30] * v[webgl.M01] + m[webgl.M31] * v[webgl.M11] + m[webgl.M32] * v[webgl.M21] + m[webgl.M33] * v[webgl.M31];\n t[webgl.M32] = m[webgl.M30] * v[webgl.M02] + m[webgl.M31] * v[webgl.M12] + m[webgl.M32] * v[webgl.M22] + m[webgl.M33] * v[webgl.M32];\n t[webgl.M33] = m[webgl.M30] * v[webgl.M03] + m[webgl.M31] * v[webgl.M13] + m[webgl.M32] * v[webgl.M23] + m[webgl.M33] * v[webgl.M33];\n return this.set(this.temp);\n };\n Matrix4.prototype.lookAt = function (position, direction, up) {\n Matrix4.initTemps();\n var xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\n zAxis.setFrom(direction).normalize();\n xAxis.setFrom(direction).normalize();\n xAxis.cross(up).normalize();\n yAxis.setFrom(xAxis).cross(zAxis).normalize();\n this.identity();\n var val = this.values;\n val[webgl.M00] = xAxis.x;\n val[webgl.M01] = xAxis.y;\n val[webgl.M02] = xAxis.z;\n val[webgl.M10] = yAxis.x;\n val[webgl.M11] = yAxis.y;\n val[webgl.M12] = yAxis.z;\n val[webgl.M20] = -zAxis.x;\n val[webgl.M21] = -zAxis.y;\n val[webgl.M22] = -zAxis.z;\n Matrix4.tmpMatrix.identity();\n Matrix4.tmpMatrix.values[webgl.M03] = -position.x;\n Matrix4.tmpMatrix.values[webgl.M13] = -position.y;\n Matrix4.tmpMatrix.values[webgl.M23] = -position.z;\n this.multiply(Matrix4.tmpMatrix);\n return this;\n };\n Matrix4.initTemps = function () {\n if (Matrix4.xAxis === null)\n Matrix4.xAxis = new webgl.Vector3();\n if (Matrix4.yAxis === null)\n Matrix4.yAxis = new webgl.Vector3();\n if (Matrix4.zAxis === null)\n Matrix4.zAxis = new webgl.Vector3();\n };\n Matrix4.xAxis = null;\n Matrix4.yAxis = null;\n Matrix4.zAxis = null;\n Matrix4.tmpMatrix = new Matrix4();\n return Matrix4;\n }());\n webgl.Matrix4 = Matrix4;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var Mesh = (function () {\n function Mesh(context, attributes, maxVertices, maxIndices) {\n this.attributes = attributes;\n this.verticesLength = 0;\n this.dirtyVertices = false;\n this.indicesLength = 0;\n this.dirtyIndices = false;\n this.elementsPerVertex = 0;\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\n this.elementsPerVertex = 0;\n for (var i = 0; i < attributes.length; i++) {\n this.elementsPerVertex += attributes[i].numElements;\n }\n this.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\n this.indices = new Uint16Array(maxIndices);\n this.context.addRestorable(this);\n }\n Mesh.prototype.getAttributes = function () { return this.attributes; };\n Mesh.prototype.maxVertices = function () { return this.vertices.length / this.elementsPerVertex; };\n Mesh.prototype.numVertices = function () { return this.verticesLength / this.elementsPerVertex; };\n Mesh.prototype.setVerticesLength = function (length) {\n this.dirtyVertices = true;\n this.verticesLength = length;\n };\n Mesh.prototype.getVertices = function () { return this.vertices; };\n Mesh.prototype.maxIndices = function () { return this.indices.length; };\n Mesh.prototype.numIndices = function () { return this.indicesLength; };\n Mesh.prototype.setIndicesLength = function (length) {\n this.dirtyIndices = true;\n this.indicesLength = length;\n };\n Mesh.prototype.getIndices = function () { return this.indices; };\n ;\n Mesh.prototype.getVertexSizeInFloats = function () {\n var size = 0;\n for (var i = 0; i < this.attributes.length; i++) {\n var attribute = this.attributes[i];\n size += attribute.numElements;\n }\n return size;\n };\n Mesh.prototype.setVertices = function (vertices) {\n this.dirtyVertices = true;\n if (vertices.length > this.vertices.length)\n throw Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\n this.vertices.set(vertices, 0);\n this.verticesLength = vertices.length;\n };\n Mesh.prototype.setIndices = function (indices) {\n this.dirtyIndices = true;\n if (indices.length > this.indices.length)\n throw Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\n this.indices.set(indices, 0);\n this.indicesLength = indices.length;\n };\n Mesh.prototype.draw = function (shader, primitiveType) {\n this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\n };\n Mesh.prototype.drawWithOffset = function (shader, primitiveType, offset, count) {\n var gl = this.context.gl;\n if (this.dirtyVertices || this.dirtyIndices)\n this.update();\n this.bind(shader);\n if (this.indicesLength > 0) {\n gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\n }\n else {\n gl.drawArrays(primitiveType, offset, count);\n }\n this.unbind(shader);\n };\n Mesh.prototype.bind = function (shader) {\n var gl = this.context.gl;\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n var offset = 0;\n for (var i = 0; i < this.attributes.length; i++) {\n var attrib = this.attributes[i];\n var location_1 = shader.getAttributeLocation(attrib.name);\n gl.enableVertexAttribArray(location_1);\n gl.vertexAttribPointer(location_1, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\n offset += attrib.numElements;\n }\n if (this.indicesLength > 0)\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n };\n Mesh.prototype.unbind = function (shader) {\n var gl = this.context.gl;\n for (var i = 0; i < this.attributes.length; i++) {\n var attrib = this.attributes[i];\n var location_2 = shader.getAttributeLocation(attrib.name);\n gl.disableVertexAttribArray(location_2);\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n if (this.indicesLength > 0)\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n };\n Mesh.prototype.update = function () {\n var gl = this.context.gl;\n if (this.dirtyVertices) {\n if (!this.verticesBuffer) {\n this.verticesBuffer = gl.createBuffer();\n }\n gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\n this.dirtyVertices = false;\n }\n if (this.dirtyIndices) {\n if (!this.indicesBuffer) {\n this.indicesBuffer = gl.createBuffer();\n }\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\n this.dirtyIndices = false;\n }\n };\n Mesh.prototype.restore = function () {\n this.verticesBuffer = null;\n this.indicesBuffer = null;\n this.update();\n };\n Mesh.prototype.dispose = function () {\n this.context.removeRestorable(this);\n var gl = this.context.gl;\n gl.deleteBuffer(this.verticesBuffer);\n gl.deleteBuffer(this.indicesBuffer);\n };\n return Mesh;\n }());\n webgl.Mesh = Mesh;\n var VertexAttribute = (function () {\n function VertexAttribute(name, type, numElements) {\n this.name = name;\n this.type = type;\n this.numElements = numElements;\n }\n return VertexAttribute;\n }());\n webgl.VertexAttribute = VertexAttribute;\n var Position2Attribute = (function (_super) {\n __extends(Position2Attribute, _super);\n function Position2Attribute() {\n return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 2) || this;\n }\n return Position2Attribute;\n }(VertexAttribute));\n webgl.Position2Attribute = Position2Attribute;\n var Position3Attribute = (function (_super) {\n __extends(Position3Attribute, _super);\n function Position3Attribute() {\n return _super.call(this, webgl.Shader.POSITION, VertexAttributeType.Float, 3) || this;\n }\n return Position3Attribute;\n }(VertexAttribute));\n webgl.Position3Attribute = Position3Attribute;\n var TexCoordAttribute = (function (_super) {\n __extends(TexCoordAttribute, _super);\n function TexCoordAttribute(unit) {\n if (unit === void 0) { unit = 0; }\n return _super.call(this, webgl.Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2) || this;\n }\n return TexCoordAttribute;\n }(VertexAttribute));\n webgl.TexCoordAttribute = TexCoordAttribute;\n var ColorAttribute = (function (_super) {\n __extends(ColorAttribute, _super);\n function ColorAttribute() {\n return _super.call(this, webgl.Shader.COLOR, VertexAttributeType.Float, 4) || this;\n }\n return ColorAttribute;\n }(VertexAttribute));\n webgl.ColorAttribute = ColorAttribute;\n var Color2Attribute = (function (_super) {\n __extends(Color2Attribute, _super);\n function Color2Attribute() {\n return _super.call(this, webgl.Shader.COLOR2, VertexAttributeType.Float, 4) || this;\n }\n return Color2Attribute;\n }(VertexAttribute));\n webgl.Color2Attribute = Color2Attribute;\n var VertexAttributeType;\n (function (VertexAttributeType) {\n VertexAttributeType[VertexAttributeType[\"Float\"] = 0] = \"Float\";\n })(VertexAttributeType = webgl.VertexAttributeType || (webgl.VertexAttributeType = {}));\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var PolygonBatcher = (function () {\n function PolygonBatcher(context, twoColorTint, maxVertices) {\n if (twoColorTint === void 0) { twoColorTint = true; }\n if (maxVertices === void 0) { maxVertices = 10920; }\n this.isDrawing = false;\n this.shader = null;\n this.lastTexture = null;\n this.verticesLength = 0;\n this.indicesLength = 0;\n if (maxVertices > 10920)\n throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\n var attributes = twoColorTint ?\n [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute(), new webgl.Color2Attribute()] :\n [new webgl.Position2Attribute(), new webgl.ColorAttribute(), new webgl.TexCoordAttribute()];\n this.mesh = new webgl.Mesh(context, attributes, maxVertices, maxVertices * 3);\n this.srcBlend = this.context.gl.SRC_ALPHA;\n this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\n }\n PolygonBatcher.prototype.begin = function (shader) {\n var gl = this.context.gl;\n if (this.isDrawing)\n throw new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\n this.drawCalls = 0;\n this.shader = shader;\n this.lastTexture = null;\n this.isDrawing = true;\n gl.enable(gl.BLEND);\n gl.blendFunc(this.srcBlend, this.dstBlend);\n };\n PolygonBatcher.prototype.setBlendMode = function (srcBlend, dstBlend) {\n var gl = this.context.gl;\n this.srcBlend = srcBlend;\n this.dstBlend = dstBlend;\n if (this.isDrawing) {\n this.flush();\n gl.blendFunc(this.srcBlend, this.dstBlend);\n }\n };\n PolygonBatcher.prototype.draw = function (texture, vertices, indices) {\n if (texture != this.lastTexture) {\n this.flush();\n this.lastTexture = texture;\n }\n else if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\n this.indicesLength + indices.length > this.mesh.getIndices().length) {\n this.flush();\n }\n var indexStart = this.mesh.numVertices();\n this.mesh.getVertices().set(vertices, this.verticesLength);\n this.verticesLength += vertices.length;\n this.mesh.setVerticesLength(this.verticesLength);\n var indicesArray = this.mesh.getIndices();\n for (var i = this.indicesLength, j = 0; j < indices.length; i++, j++)\n indicesArray[i] = indices[j] + indexStart;\n this.indicesLength += indices.length;\n this.mesh.setIndicesLength(this.indicesLength);\n };\n PolygonBatcher.prototype.flush = function () {\n var gl = this.context.gl;\n if (this.verticesLength == 0)\n return;\n this.lastTexture.bind();\n this.mesh.draw(this.shader, gl.TRIANGLES);\n this.verticesLength = 0;\n this.indicesLength = 0;\n this.mesh.setVerticesLength(0);\n this.mesh.setIndicesLength(0);\n this.drawCalls++;\n };\n PolygonBatcher.prototype.end = function () {\n var gl = this.context.gl;\n if (!this.isDrawing)\n throw new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\n if (this.verticesLength > 0 || this.indicesLength > 0)\n this.flush();\n this.shader = null;\n this.lastTexture = null;\n this.isDrawing = false;\n gl.disable(gl.BLEND);\n };\n PolygonBatcher.prototype.getDrawCalls = function () { return this.drawCalls; };\n PolygonBatcher.prototype.dispose = function () {\n this.mesh.dispose();\n };\n return PolygonBatcher;\n }());\n webgl.PolygonBatcher = PolygonBatcher;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var SceneRenderer = (function () {\n function SceneRenderer(canvas, context, twoColorTint) {\n if (twoColorTint === void 0) { twoColorTint = true; }\n this.twoColorTint = false;\n this.activeRenderer = null;\n this.QUAD = [\n 0, 0, 1, 1, 1, 1, 0, 0,\n 0, 0, 1, 1, 1, 1, 0, 0,\n 0, 0, 1, 1, 1, 1, 0, 0,\n 0, 0, 1, 1, 1, 1, 0, 0,\n ];\n this.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n this.WHITE = new spine.Color(1, 1, 1, 1);\n this.canvas = canvas;\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\n this.twoColorTint = twoColorTint;\n this.camera = new webgl.OrthoCamera(canvas.width, canvas.height);\n this.batcherShader = twoColorTint ? webgl.Shader.newTwoColoredTextured(this.context) : webgl.Shader.newColoredTextured(this.context);\n this.batcher = new webgl.PolygonBatcher(this.context, twoColorTint);\n this.shapesShader = webgl.Shader.newColored(this.context);\n this.shapes = new webgl.ShapeRenderer(this.context);\n this.skeletonRenderer = new webgl.SkeletonRenderer(this.context, twoColorTint);\n this.skeletonDebugRenderer = new webgl.SkeletonDebugRenderer(this.context);\n }\n SceneRenderer.prototype.begin = function () {\n this.camera.update();\n this.enableRenderer(this.batcher);\n };\n SceneRenderer.prototype.drawSkeleton = function (skeleton, premultipliedAlpha, slotRangeStart, slotRangeEnd) {\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\n if (slotRangeStart === void 0) { slotRangeStart = -1; }\n if (slotRangeEnd === void 0) { slotRangeEnd = -1; }\n this.enableRenderer(this.batcher);\n this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\n this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd);\n };\n SceneRenderer.prototype.drawSkeletonDebug = function (skeleton, premultipliedAlpha, ignoredBones) {\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\n if (ignoredBones === void 0) { ignoredBones = null; }\n this.enableRenderer(this.shapes);\n this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\n this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\n };\n SceneRenderer.prototype.drawTexture = function (texture, x, y, width, height, color) {\n if (color === void 0) { color = null; }\n this.enableRenderer(this.batcher);\n if (color === null)\n color = this.WHITE;\n var quad = this.QUAD;\n var i = 0;\n quad[i++] = x;\n quad[i++] = y;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 0;\n quad[i++] = 1;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x + width;\n quad[i++] = y;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 1;\n quad[i++] = 1;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x + width;\n quad[i++] = y + height;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 1;\n quad[i++] = 0;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x;\n quad[i++] = y + height;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 0;\n quad[i++] = 0;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\n };\n SceneRenderer.prototype.drawTextureUV = function (texture, x, y, width, height, u, v, u2, v2, color) {\n if (color === void 0) { color = null; }\n this.enableRenderer(this.batcher);\n if (color === null)\n color = this.WHITE;\n var quad = this.QUAD;\n var i = 0;\n quad[i++] = x;\n quad[i++] = y;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = u;\n quad[i++] = v;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x + width;\n quad[i++] = y;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = u2;\n quad[i++] = v;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x + width;\n quad[i++] = y + height;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = u2;\n quad[i++] = v2;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x;\n quad[i++] = y + height;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = u;\n quad[i++] = v2;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\n };\n SceneRenderer.prototype.drawTextureRotated = function (texture, x, y, width, height, pivotX, pivotY, angle, color, premultipliedAlpha) {\n if (color === void 0) { color = null; }\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\n this.enableRenderer(this.batcher);\n if (color === null)\n color = this.WHITE;\n var quad = this.QUAD;\n var worldOriginX = x + pivotX;\n var worldOriginY = y + pivotY;\n var fx = -pivotX;\n var fy = -pivotY;\n var fx2 = width - pivotX;\n var fy2 = height - pivotY;\n var p1x = fx;\n var p1y = fy;\n var p2x = fx;\n var p2y = fy2;\n var p3x = fx2;\n var p3y = fy2;\n var p4x = fx2;\n var p4y = fy;\n var x1 = 0;\n var y1 = 0;\n var x2 = 0;\n var y2 = 0;\n var x3 = 0;\n var y3 = 0;\n var x4 = 0;\n var y4 = 0;\n if (angle != 0) {\n var cos = spine.MathUtils.cosDeg(angle);\n var sin = spine.MathUtils.sinDeg(angle);\n x1 = cos * p1x - sin * p1y;\n y1 = sin * p1x + cos * p1y;\n x4 = cos * p2x - sin * p2y;\n y4 = sin * p2x + cos * p2y;\n x3 = cos * p3x - sin * p3y;\n y3 = sin * p3x + cos * p3y;\n x2 = x3 + (x1 - x4);\n y2 = y3 + (y1 - y4);\n }\n else {\n x1 = p1x;\n y1 = p1y;\n x4 = p2x;\n y4 = p2y;\n x3 = p3x;\n y3 = p3y;\n x2 = p4x;\n y2 = p4y;\n }\n x1 += worldOriginX;\n y1 += worldOriginY;\n x2 += worldOriginX;\n y2 += worldOriginY;\n x3 += worldOriginX;\n y3 += worldOriginY;\n x4 += worldOriginX;\n y4 += worldOriginY;\n var i = 0;\n quad[i++] = x1;\n quad[i++] = y1;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 0;\n quad[i++] = 1;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x2;\n quad[i++] = y2;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 1;\n quad[i++] = 1;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x3;\n quad[i++] = y3;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 1;\n quad[i++] = 0;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x4;\n quad[i++] = y4;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = 0;\n quad[i++] = 0;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n this.batcher.draw(texture, quad, this.QUAD_TRIANGLES);\n };\n SceneRenderer.prototype.drawRegion = function (region, x, y, width, height, color, premultipliedAlpha) {\n if (color === void 0) { color = null; }\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\n this.enableRenderer(this.batcher);\n if (color === null)\n color = this.WHITE;\n var quad = this.QUAD;\n var i = 0;\n quad[i++] = x;\n quad[i++] = y;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = region.u;\n quad[i++] = region.v2;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x + width;\n quad[i++] = y;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = region.u2;\n quad[i++] = region.v2;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x + width;\n quad[i++] = y + height;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = region.u2;\n quad[i++] = region.v;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n quad[i++] = x;\n quad[i++] = y + height;\n quad[i++] = color.r;\n quad[i++] = color.g;\n quad[i++] = color.b;\n quad[i++] = color.a;\n quad[i++] = region.u;\n quad[i++] = region.v;\n if (this.twoColorTint) {\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n quad[i++] = 0;\n }\n this.batcher.draw(region.texture, quad, this.QUAD_TRIANGLES);\n };\n SceneRenderer.prototype.line = function (x, y, x2, y2, color, color2) {\n if (color === void 0) { color = null; }\n if (color2 === void 0) { color2 = null; }\n this.enableRenderer(this.shapes);\n this.shapes.line(x, y, x2, y2, color);\n };\n SceneRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\n if (color === void 0) { color = null; }\n if (color2 === void 0) { color2 = null; }\n if (color3 === void 0) { color3 = null; }\n this.enableRenderer(this.shapes);\n this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\n };\n SceneRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\n if (color === void 0) { color = null; }\n if (color2 === void 0) { color2 = null; }\n if (color3 === void 0) { color3 = null; }\n if (color4 === void 0) { color4 = null; }\n this.enableRenderer(this.shapes);\n this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\n };\n SceneRenderer.prototype.rect = function (filled, x, y, width, height, color) {\n if (color === void 0) { color = null; }\n this.enableRenderer(this.shapes);\n this.shapes.rect(filled, x, y, width, height, color);\n };\n SceneRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\n if (color === void 0) { color = null; }\n this.enableRenderer(this.shapes);\n this.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\n };\n SceneRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\n if (color === void 0) { color = null; }\n this.enableRenderer(this.shapes);\n this.shapes.polygon(polygonVertices, offset, count, color);\n };\n SceneRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\n if (color === void 0) { color = null; }\n if (segments === void 0) { segments = 0; }\n this.enableRenderer(this.shapes);\n this.shapes.circle(filled, x, y, radius, color, segments);\n };\n SceneRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\n if (color === void 0) { color = null; }\n this.enableRenderer(this.shapes);\n this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\n };\n SceneRenderer.prototype.end = function () {\n if (this.activeRenderer === this.batcher)\n this.batcher.end();\n else if (this.activeRenderer === this.shapes)\n this.shapes.end();\n this.activeRenderer = null;\n };\n SceneRenderer.prototype.resize = function (resizeMode) {\n var canvas = this.canvas;\n var w = canvas.clientWidth;\n var h = canvas.clientHeight;\n if (canvas.width != w || canvas.height != h) {\n canvas.width = w;\n canvas.height = h;\n }\n this.context.gl.viewport(0, 0, canvas.width, canvas.height);\n if (resizeMode === ResizeMode.Stretch) {\n }\n else if (resizeMode === ResizeMode.Expand) {\n this.camera.setViewport(w, h);\n }\n else if (resizeMode === ResizeMode.Fit) {\n var sourceWidth = canvas.width, sourceHeight = canvas.height;\n var targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\n var targetRatio = targetHeight / targetWidth;\n var sourceRatio = sourceHeight / sourceWidth;\n var scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\n this.camera.viewportWidth = sourceWidth * scale;\n this.camera.viewportHeight = sourceHeight * scale;\n }\n this.camera.update();\n };\n SceneRenderer.prototype.enableRenderer = function (renderer) {\n if (this.activeRenderer === renderer)\n return;\n this.end();\n if (renderer instanceof webgl.PolygonBatcher) {\n this.batcherShader.bind();\n this.batcherShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\n this.batcherShader.setUniformi(\"u_texture\", 0);\n this.batcher.begin(this.batcherShader);\n this.activeRenderer = this.batcher;\n }\n else if (renderer instanceof webgl.ShapeRenderer) {\n this.shapesShader.bind();\n this.shapesShader.setUniform4x4f(webgl.Shader.MVP_MATRIX, this.camera.projectionView.values);\n this.shapes.begin(this.shapesShader);\n this.activeRenderer = this.shapes;\n }\n else {\n this.activeRenderer = this.skeletonDebugRenderer;\n }\n };\n SceneRenderer.prototype.dispose = function () {\n this.batcher.dispose();\n this.batcherShader.dispose();\n this.shapes.dispose();\n this.shapesShader.dispose();\n this.skeletonDebugRenderer.dispose();\n };\n return SceneRenderer;\n }());\n webgl.SceneRenderer = SceneRenderer;\n var ResizeMode;\n (function (ResizeMode) {\n ResizeMode[ResizeMode[\"Stretch\"] = 0] = \"Stretch\";\n ResizeMode[ResizeMode[\"Expand\"] = 1] = \"Expand\";\n ResizeMode[ResizeMode[\"Fit\"] = 2] = \"Fit\";\n })(ResizeMode = webgl.ResizeMode || (webgl.ResizeMode = {}));\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var Shader = (function () {\n function Shader(context, vertexShader, fragmentShader) {\n this.vertexShader = vertexShader;\n this.fragmentShader = fragmentShader;\n this.vs = null;\n this.fs = null;\n this.program = null;\n this.tmp2x2 = new Float32Array(2 * 2);\n this.tmp3x3 = new Float32Array(3 * 3);\n this.tmp4x4 = new Float32Array(4 * 4);\n this.vsSource = vertexShader;\n this.fsSource = fragmentShader;\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\n this.context.addRestorable(this);\n this.compile();\n }\n Shader.prototype.getProgram = function () { return this.program; };\n Shader.prototype.getVertexShader = function () { return this.vertexShader; };\n Shader.prototype.getFragmentShader = function () { return this.fragmentShader; };\n Shader.prototype.getVertexShaderSource = function () { return this.vsSource; };\n Shader.prototype.getFragmentSource = function () { return this.fsSource; };\n Shader.prototype.compile = function () {\n var gl = this.context.gl;\n try {\n this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\n this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\n this.program = this.compileProgram(this.vs, this.fs);\n }\n catch (e) {\n this.dispose();\n throw e;\n }\n };\n Shader.prototype.compileShader = function (type, source) {\n var gl = this.context.gl;\n var shader = gl.createShader(type);\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n var error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n if (!gl.isContextLost())\n throw new Error(error);\n }\n return shader;\n };\n Shader.prototype.compileProgram = function (vs, fs) {\n var gl = this.context.gl;\n var program = gl.createProgram();\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n var error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n if (!gl.isContextLost())\n throw new Error(error);\n }\n return program;\n };\n Shader.prototype.restore = function () {\n this.compile();\n };\n Shader.prototype.bind = function () {\n this.context.gl.useProgram(this.program);\n };\n Shader.prototype.unbind = function () {\n this.context.gl.useProgram(null);\n };\n Shader.prototype.setUniformi = function (uniform, value) {\n this.context.gl.uniform1i(this.getUniformLocation(uniform), value);\n };\n Shader.prototype.setUniformf = function (uniform, value) {\n this.context.gl.uniform1f(this.getUniformLocation(uniform), value);\n };\n Shader.prototype.setUniform2f = function (uniform, value, value2) {\n this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\n };\n Shader.prototype.setUniform3f = function (uniform, value, value2, value3) {\n this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\n };\n Shader.prototype.setUniform4f = function (uniform, value, value2, value3, value4) {\n this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\n };\n Shader.prototype.setUniform2x2f = function (uniform, value) {\n var gl = this.context.gl;\n this.tmp2x2.set(value);\n gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\n };\n Shader.prototype.setUniform3x3f = function (uniform, value) {\n var gl = this.context.gl;\n this.tmp3x3.set(value);\n gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\n };\n Shader.prototype.setUniform4x4f = function (uniform, value) {\n var gl = this.context.gl;\n this.tmp4x4.set(value);\n gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\n };\n Shader.prototype.getUniformLocation = function (uniform) {\n var gl = this.context.gl;\n var location = gl.getUniformLocation(this.program, uniform);\n if (!location && !gl.isContextLost())\n throw new Error(\"Couldn't find location for uniform \" + uniform);\n return location;\n };\n Shader.prototype.getAttributeLocation = function (attribute) {\n var gl = this.context.gl;\n var location = gl.getAttribLocation(this.program, attribute);\n if (location == -1 && !gl.isContextLost())\n throw new Error(\"Couldn't find location for attribute \" + attribute);\n return location;\n };\n Shader.prototype.dispose = function () {\n this.context.removeRestorable(this);\n var gl = this.context.gl;\n if (this.vs) {\n gl.deleteShader(this.vs);\n this.vs = null;\n }\n if (this.fs) {\n gl.deleteShader(this.fs);\n this.fs = null;\n }\n if (this.program) {\n gl.deleteProgram(this.program);\n this.program = null;\n }\n };\n Shader.newColoredTextured = function (context) {\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_color;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_color = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\n var fs = \"\\n\\t\\t\\t\\t#ifdef GL_ES\\n\\t\\t\\t\\t\\t#define LOWP lowp\\n\\t\\t\\t\\t\\tprecision mediump float;\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\t#define LOWP\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tvarying LOWP vec4 v_color;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\t\\t\\t\\tuniform sampler2D u_texture;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\n return new Shader(context, vs, fs);\n };\n Shader.newTwoColoredTextured = function (context) {\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\tattribute vec2 \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_light;\\n\\t\\t\\t\\tvarying vec4 v_dark;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_light = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tv_dark = \" + Shader.COLOR2 + \";\\n\\t\\t\\t\\t\\tv_texCoords = \" + Shader.TEXCOORDS + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\n var fs = \"\\n\\t\\t\\t\\t#ifdef GL_ES\\n\\t\\t\\t\\t\\t#define LOWP lowp\\n\\t\\t\\t\\t\\tprecision mediump float;\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\t#define LOWP\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tvarying LOWP vec4 v_light;\\n\\t\\t\\t\\tvarying LOWP vec4 v_dark;\\n\\t\\t\\t\\tvarying vec2 v_texCoords;\\n\\t\\t\\t\\tuniform sampler2D u_texture;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tvec4 texColor = texture2D(u_texture, v_texCoords);\\n\\t\\t\\t\\t\\tgl_FragColor.a = texColor.a * v_light.a;\\n\\t\\t\\t\\t\\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\n return new Shader(context, vs, fs);\n };\n Shader.newColored = function (context) {\n var vs = \"\\n\\t\\t\\t\\tattribute vec4 \" + Shader.POSITION + \";\\n\\t\\t\\t\\tattribute vec4 \" + Shader.COLOR + \";\\n\\t\\t\\t\\tuniform mat4 \" + Shader.MVP_MATRIX + \";\\n\\t\\t\\t\\tvarying vec4 v_color;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tv_color = \" + Shader.COLOR + \";\\n\\t\\t\\t\\t\\tgl_Position = \" + Shader.MVP_MATRIX + \" * \" + Shader.POSITION + \";\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\n var fs = \"\\n\\t\\t\\t\\t#ifdef GL_ES\\n\\t\\t\\t\\t\\t#define LOWP lowp\\n\\t\\t\\t\\t\\tprecision mediump float;\\n\\t\\t\\t\\t#else\\n\\t\\t\\t\\t\\t#define LOWP\\n\\t\\t\\t\\t#endif\\n\\t\\t\\t\\tvarying LOWP vec4 v_color;\\n\\n\\t\\t\\t\\tvoid main () {\\n\\t\\t\\t\\t\\tgl_FragColor = v_color;\\n\\t\\t\\t\\t}\\n\\t\\t\\t\";\n return new Shader(context, vs, fs);\n };\n Shader.MVP_MATRIX = \"u_projTrans\";\n Shader.POSITION = \"a_position\";\n Shader.COLOR = \"a_color\";\n Shader.COLOR2 = \"a_color2\";\n Shader.TEXCOORDS = \"a_texCoords\";\n Shader.SAMPLER = \"u_texture\";\n return Shader;\n }());\n webgl.Shader = Shader;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var ShapeRenderer = (function () {\n function ShapeRenderer(context, maxVertices) {\n if (maxVertices === void 0) { maxVertices = 10920; }\n this.isDrawing = false;\n this.shapeType = ShapeType.Filled;\n this.color = new spine.Color(1, 1, 1, 1);\n this.vertexIndex = 0;\n this.tmp = new spine.Vector2();\n if (maxVertices > 10920)\n throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\n this.mesh = new webgl.Mesh(context, [new webgl.Position2Attribute(), new webgl.ColorAttribute()], maxVertices, 0);\n this.srcBlend = this.context.gl.SRC_ALPHA;\n this.dstBlend = this.context.gl.ONE_MINUS_SRC_ALPHA;\n }\n ShapeRenderer.prototype.begin = function (shader) {\n if (this.isDrawing)\n throw new Error(\"ShapeRenderer.begin() has already been called\");\n this.shader = shader;\n this.vertexIndex = 0;\n this.isDrawing = true;\n var gl = this.context.gl;\n gl.enable(gl.BLEND);\n gl.blendFunc(this.srcBlend, this.dstBlend);\n };\n ShapeRenderer.prototype.setBlendMode = function (srcBlend, dstBlend) {\n var gl = this.context.gl;\n this.srcBlend = srcBlend;\n this.dstBlend = dstBlend;\n if (this.isDrawing) {\n this.flush();\n gl.blendFunc(this.srcBlend, this.dstBlend);\n }\n };\n ShapeRenderer.prototype.setColor = function (color) {\n this.color.setFromColor(color);\n };\n ShapeRenderer.prototype.setColorWith = function (r, g, b, a) {\n this.color.set(r, g, b, a);\n };\n ShapeRenderer.prototype.point = function (x, y, color) {\n if (color === void 0) { color = null; }\n this.check(ShapeType.Point, 1);\n if (color === null)\n color = this.color;\n this.vertex(x, y, color);\n };\n ShapeRenderer.prototype.line = function (x, y, x2, y2, color) {\n if (color === void 0) { color = null; }\n this.check(ShapeType.Line, 2);\n var vertices = this.mesh.getVertices();\n var idx = this.vertexIndex;\n if (color === null)\n color = this.color;\n this.vertex(x, y, color);\n this.vertex(x2, y2, color);\n };\n ShapeRenderer.prototype.triangle = function (filled, x, y, x2, y2, x3, y3, color, color2, color3) {\n if (color === void 0) { color = null; }\n if (color2 === void 0) { color2 = null; }\n if (color3 === void 0) { color3 = null; }\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n var vertices = this.mesh.getVertices();\n var idx = this.vertexIndex;\n if (color === null)\n color = this.color;\n if (color2 === null)\n color2 = this.color;\n if (color3 === null)\n color3 = this.color;\n if (filled) {\n this.vertex(x, y, color);\n this.vertex(x2, y2, color2);\n this.vertex(x3, y3, color3);\n }\n else {\n this.vertex(x, y, color);\n this.vertex(x2, y2, color2);\n this.vertex(x2, y2, color);\n this.vertex(x3, y3, color2);\n this.vertex(x3, y3, color);\n this.vertex(x, y, color2);\n }\n };\n ShapeRenderer.prototype.quad = function (filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) {\n if (color === void 0) { color = null; }\n if (color2 === void 0) { color2 = null; }\n if (color3 === void 0) { color3 = null; }\n if (color4 === void 0) { color4 = null; }\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n var vertices = this.mesh.getVertices();\n var idx = this.vertexIndex;\n if (color === null)\n color = this.color;\n if (color2 === null)\n color2 = this.color;\n if (color3 === null)\n color3 = this.color;\n if (color4 === null)\n color4 = this.color;\n if (filled) {\n this.vertex(x, y, color);\n this.vertex(x2, y2, color2);\n this.vertex(x3, y3, color3);\n this.vertex(x3, y3, color3);\n this.vertex(x4, y4, color4);\n this.vertex(x, y, color);\n }\n else {\n this.vertex(x, y, color);\n this.vertex(x2, y2, color2);\n this.vertex(x2, y2, color2);\n this.vertex(x3, y3, color3);\n this.vertex(x3, y3, color3);\n this.vertex(x4, y4, color4);\n this.vertex(x4, y4, color4);\n this.vertex(x, y, color);\n }\n };\n ShapeRenderer.prototype.rect = function (filled, x, y, width, height, color) {\n if (color === void 0) { color = null; }\n this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\n };\n ShapeRenderer.prototype.rectLine = function (filled, x1, y1, x2, y2, width, color) {\n if (color === void 0) { color = null; }\n this.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\n if (color === null)\n color = this.color;\n var t = this.tmp.set(y2 - y1, x1 - x2);\n t.normalize();\n width *= 0.5;\n var tx = t.x * width;\n var ty = t.y * width;\n if (!filled) {\n this.vertex(x1 + tx, y1 + ty, color);\n this.vertex(x1 - tx, y1 - ty, color);\n this.vertex(x2 + tx, y2 + ty, color);\n this.vertex(x2 - tx, y2 - ty, color);\n this.vertex(x2 + tx, y2 + ty, color);\n this.vertex(x1 + tx, y1 + ty, color);\n this.vertex(x2 - tx, y2 - ty, color);\n this.vertex(x1 - tx, y1 - ty, color);\n }\n else {\n this.vertex(x1 + tx, y1 + ty, color);\n this.vertex(x1 - tx, y1 - ty, color);\n this.vertex(x2 + tx, y2 + ty, color);\n this.vertex(x2 - tx, y2 - ty, color);\n this.vertex(x2 + tx, y2 + ty, color);\n this.vertex(x1 - tx, y1 - ty, color);\n }\n };\n ShapeRenderer.prototype.x = function (x, y, size) {\n this.line(x - size, y - size, x + size, y + size);\n this.line(x - size, y + size, x + size, y - size);\n };\n ShapeRenderer.prototype.polygon = function (polygonVertices, offset, count, color) {\n if (color === void 0) { color = null; }\n if (count < 3)\n throw new Error(\"Polygon must contain at least 3 vertices\");\n this.check(ShapeType.Line, count * 2);\n if (color === null)\n color = this.color;\n var vertices = this.mesh.getVertices();\n var idx = this.vertexIndex;\n offset <<= 1;\n count <<= 1;\n var firstX = polygonVertices[offset];\n var firstY = polygonVertices[offset + 1];\n var last = offset + count;\n for (var i = offset, n = offset + count - 2; i < n; i += 2) {\n var x1 = polygonVertices[i];\n var y1 = polygonVertices[i + 1];\n var x2 = 0;\n var y2 = 0;\n if (i + 2 >= last) {\n x2 = firstX;\n y2 = firstY;\n }\n else {\n x2 = polygonVertices[i + 2];\n y2 = polygonVertices[i + 3];\n }\n this.vertex(x1, y1, color);\n this.vertex(x2, y2, color);\n }\n };\n ShapeRenderer.prototype.circle = function (filled, x, y, radius, color, segments) {\n if (color === void 0) { color = null; }\n if (segments === void 0) { segments = 0; }\n if (segments === 0)\n segments = Math.max(1, (6 * spine.MathUtils.cbrt(radius)) | 0);\n if (segments <= 0)\n throw new Error(\"segments must be > 0.\");\n if (color === null)\n color = this.color;\n var angle = 2 * spine.MathUtils.PI / segments;\n var cos = Math.cos(angle);\n var sin = Math.sin(angle);\n var cx = radius, cy = 0;\n if (!filled) {\n this.check(ShapeType.Line, segments * 2 + 2);\n for (var i = 0; i < segments; i++) {\n this.vertex(x + cx, y + cy, color);\n var temp_1 = cx;\n cx = cos * cx - sin * cy;\n cy = sin * temp_1 + cos * cy;\n this.vertex(x + cx, y + cy, color);\n }\n this.vertex(x + cx, y + cy, color);\n }\n else {\n this.check(ShapeType.Filled, segments * 3 + 3);\n segments--;\n for (var i = 0; i < segments; i++) {\n this.vertex(x, y, color);\n this.vertex(x + cx, y + cy, color);\n var temp_2 = cx;\n cx = cos * cx - sin * cy;\n cy = sin * temp_2 + cos * cy;\n this.vertex(x + cx, y + cy, color);\n }\n this.vertex(x, y, color);\n this.vertex(x + cx, y + cy, color);\n }\n var temp = cx;\n cx = radius;\n cy = 0;\n this.vertex(x + cx, y + cy, color);\n };\n ShapeRenderer.prototype.curve = function (x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) {\n if (color === void 0) { color = null; }\n this.check(ShapeType.Line, segments * 2 + 2);\n if (color === null)\n color = this.color;\n var subdiv_step = 1 / segments;\n var subdiv_step2 = subdiv_step * subdiv_step;\n var subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\n var pre1 = 3 * subdiv_step;\n var pre2 = 3 * subdiv_step2;\n var pre4 = 6 * subdiv_step2;\n var pre5 = 6 * subdiv_step3;\n var tmp1x = x1 - cx1 * 2 + cx2;\n var tmp1y = y1 - cy1 * 2 + cy2;\n var tmp2x = (cx1 - cx2) * 3 - x1 + x2;\n var tmp2y = (cy1 - cy2) * 3 - y1 + y2;\n var fx = x1;\n var fy = y1;\n var dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\n var dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\n var ddfx = tmp1x * pre4 + tmp2x * pre5;\n var ddfy = tmp1y * pre4 + tmp2y * pre5;\n var dddfx = tmp2x * pre5;\n var dddfy = tmp2y * pre5;\n while (segments-- > 0) {\n this.vertex(fx, fy, color);\n fx += dfx;\n fy += dfy;\n dfx += ddfx;\n dfy += ddfy;\n ddfx += dddfx;\n ddfy += dddfy;\n this.vertex(fx, fy, color);\n }\n this.vertex(fx, fy, color);\n this.vertex(x2, y2, color);\n };\n ShapeRenderer.prototype.vertex = function (x, y, color) {\n var idx = this.vertexIndex;\n var vertices = this.mesh.getVertices();\n vertices[idx++] = x;\n vertices[idx++] = y;\n vertices[idx++] = color.r;\n vertices[idx++] = color.g;\n vertices[idx++] = color.b;\n vertices[idx++] = color.a;\n this.vertexIndex = idx;\n };\n ShapeRenderer.prototype.end = function () {\n if (!this.isDrawing)\n throw new Error(\"ShapeRenderer.begin() has not been called\");\n this.flush();\n this.context.gl.disable(this.context.gl.BLEND);\n this.isDrawing = false;\n };\n ShapeRenderer.prototype.flush = function () {\n if (this.vertexIndex == 0)\n return;\n this.mesh.setVerticesLength(this.vertexIndex);\n this.mesh.draw(this.shader, this.shapeType);\n this.vertexIndex = 0;\n };\n ShapeRenderer.prototype.check = function (shapeType, numVertices) {\n if (!this.isDrawing)\n throw new Error(\"ShapeRenderer.begin() has not been called\");\n if (this.shapeType == shapeType) {\n if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices)\n this.flush();\n else\n return;\n }\n else {\n this.flush();\n this.shapeType = shapeType;\n }\n };\n ShapeRenderer.prototype.dispose = function () {\n this.mesh.dispose();\n };\n return ShapeRenderer;\n }());\n webgl.ShapeRenderer = ShapeRenderer;\n var ShapeType;\n (function (ShapeType) {\n ShapeType[ShapeType[\"Point\"] = 0] = \"Point\";\n ShapeType[ShapeType[\"Line\"] = 1] = \"Line\";\n ShapeType[ShapeType[\"Filled\"] = 4] = \"Filled\";\n })(ShapeType = webgl.ShapeType || (webgl.ShapeType = {}));\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var SkeletonDebugRenderer = (function () {\n function SkeletonDebugRenderer(context) {\n this.boneLineColor = new spine.Color(1, 0, 0, 1);\n this.boneOriginColor = new spine.Color(0, 1, 0, 1);\n this.attachmentLineColor = new spine.Color(0, 0, 1, 0.5);\n this.triangleLineColor = new spine.Color(1, 0.64, 0, 0.5);\n this.pathColor = new spine.Color().setFromString(\"FF7F00\");\n this.clipColor = new spine.Color(0.8, 0, 0, 2);\n this.aabbColor = new spine.Color(0, 1, 0, 0.5);\n this.drawBones = true;\n this.drawRegionAttachments = true;\n this.drawBoundingBoxes = true;\n this.drawMeshHull = true;\n this.drawMeshTriangles = true;\n this.drawPaths = true;\n this.drawSkeletonXY = false;\n this.drawClipping = true;\n this.premultipliedAlpha = false;\n this.scale = 1;\n this.boneWidth = 2;\n this.bounds = new spine.SkeletonBounds();\n this.temp = new Array();\n this.vertices = spine.Utils.newFloatArray(2 * 1024);\n this.context = context instanceof webgl.ManagedWebGLRenderingContext ? context : new webgl.ManagedWebGLRenderingContext(context);\n }\n SkeletonDebugRenderer.prototype.draw = function (shapes, skeleton, ignoredBones) {\n if (ignoredBones === void 0) { ignoredBones = null; }\n var skeletonX = skeleton.x;\n var skeletonY = skeleton.y;\n var gl = this.context.gl;\n var srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\n shapes.setBlendMode(srcFunc, gl.ONE_MINUS_SRC_ALPHA);\n var bones = skeleton.bones;\n if (this.drawBones) {\n shapes.setColor(this.boneLineColor);\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\n continue;\n if (bone.parent == null)\n continue;\n var x = skeletonX + bone.data.length * bone.a + bone.worldX;\n var y = skeletonY + bone.data.length * bone.c + bone.worldY;\n shapes.rectLine(true, skeletonX + bone.worldX, skeletonY + bone.worldY, x, y, this.boneWidth * this.scale);\n }\n if (this.drawSkeletonXY)\n shapes.x(skeletonX, skeletonY, 4 * this.scale);\n }\n if (this.drawRegionAttachments) {\n shapes.setColor(this.attachmentLineColor);\n var slots = skeleton.slots;\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n var attachment = slot.getAttachment();\n if (attachment instanceof spine.RegionAttachment) {\n var regionAttachment = attachment;\n var vertices = this.vertices;\n regionAttachment.computeWorldVertices(slot.bone, vertices, 0, 2);\n shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\n shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\n shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\n shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\n }\n }\n }\n if (this.drawMeshHull || this.drawMeshTriangles) {\n var slots = skeleton.slots;\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n if (!slot.bone.active)\n continue;\n var attachment = slot.getAttachment();\n if (!(attachment instanceof spine.MeshAttachment))\n continue;\n var mesh = attachment;\n var vertices = this.vertices;\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\n var triangles = mesh.triangles;\n var hullLength = mesh.hullLength;\n if (this.drawMeshTriangles) {\n shapes.setColor(this.triangleLineColor);\n for (var ii = 0, nn = triangles.length; ii < nn; ii += 3) {\n var v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\n shapes.triangle(false, vertices[v1], vertices[v1 + 1], vertices[v2], vertices[v2 + 1], vertices[v3], vertices[v3 + 1]);\n }\n }\n if (this.drawMeshHull && hullLength > 0) {\n shapes.setColor(this.attachmentLineColor);\n hullLength = (hullLength >> 1) * 2;\n var lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\n for (var ii = 0, nn = hullLength; ii < nn; ii += 2) {\n var x = vertices[ii], y = vertices[ii + 1];\n shapes.line(x, y, lastX, lastY);\n lastX = x;\n lastY = y;\n }\n }\n }\n }\n if (this.drawBoundingBoxes) {\n var bounds = this.bounds;\n bounds.update(skeleton, true);\n shapes.setColor(this.aabbColor);\n shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\n var polygons = bounds.polygons;\n var boxes = bounds.boundingBoxes;\n for (var i = 0, n = polygons.length; i < n; i++) {\n var polygon = polygons[i];\n shapes.setColor(boxes[i].color);\n shapes.polygon(polygon, 0, polygon.length);\n }\n }\n if (this.drawPaths) {\n var slots = skeleton.slots;\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n if (!slot.bone.active)\n continue;\n var attachment = slot.getAttachment();\n if (!(attachment instanceof spine.PathAttachment))\n continue;\n var path = attachment;\n var nn = path.worldVerticesLength;\n var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\n path.computeWorldVertices(slot, 0, nn, world, 0, 2);\n var color = this.pathColor;\n var x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\n if (path.closed) {\n shapes.setColor(color);\n var cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\n x2 = world[nn - 4];\n y2 = world[nn - 3];\n shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n shapes.line(x1, y1, cx1, cy1);\n shapes.line(x2, y2, cx2, cy2);\n }\n nn -= 4;\n for (var ii = 4; ii < nn; ii += 6) {\n var cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\n x2 = world[ii + 4];\n y2 = world[ii + 5];\n shapes.setColor(color);\n shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n shapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n shapes.line(x1, y1, cx1, cy1);\n shapes.line(x2, y2, cx2, cy2);\n x1 = x2;\n y1 = y2;\n }\n }\n }\n if (this.drawBones) {\n shapes.setColor(this.boneOriginColor);\n for (var i = 0, n = bones.length; i < n; i++) {\n var bone = bones[i];\n if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1)\n continue;\n shapes.circle(true, skeletonX + bone.worldX, skeletonY + bone.worldY, 3 * this.scale, SkeletonDebugRenderer.GREEN, 8);\n }\n }\n if (this.drawClipping) {\n var slots = skeleton.slots;\n shapes.setColor(this.clipColor);\n for (var i = 0, n = slots.length; i < n; i++) {\n var slot = slots[i];\n if (!slot.bone.active)\n continue;\n var attachment = slot.getAttachment();\n if (!(attachment instanceof spine.ClippingAttachment))\n continue;\n var clip = attachment;\n var nn = clip.worldVerticesLength;\n var world = this.temp = spine.Utils.setArraySize(this.temp, nn, 0);\n clip.computeWorldVertices(slot, 0, nn, world, 0, 2);\n for (var i_17 = 0, n_3 = world.length; i_17 < n_3; i_17 += 2) {\n var x = world[i_17];\n var y = world[i_17 + 1];\n var x2 = world[(i_17 + 2) % world.length];\n var y2 = world[(i_17 + 3) % world.length];\n shapes.line(x, y, x2, y2);\n }\n }\n }\n };\n SkeletonDebugRenderer.prototype.dispose = function () {\n };\n SkeletonDebugRenderer.LIGHT_GRAY = new spine.Color(192 / 255, 192 / 255, 192 / 255, 1);\n SkeletonDebugRenderer.GREEN = new spine.Color(0, 1, 0, 1);\n return SkeletonDebugRenderer;\n }());\n webgl.SkeletonDebugRenderer = SkeletonDebugRenderer;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var Renderable = (function () {\n function Renderable(vertices, numVertices, numFloats) {\n this.vertices = vertices;\n this.numVertices = numVertices;\n this.numFloats = numFloats;\n }\n return Renderable;\n }());\n ;\n var SkeletonRenderer = (function () {\n function SkeletonRenderer(context, twoColorTint) {\n if (twoColorTint === void 0) { twoColorTint = true; }\n this.premultipliedAlpha = false;\n this.vertexEffect = null;\n this.tempColor = new spine.Color();\n this.tempColor2 = new spine.Color();\n this.vertexSize = 2 + 2 + 4;\n this.twoColorTint = false;\n this.renderable = new Renderable(null, 0, 0);\n this.clipper = new spine.SkeletonClipping();\n this.temp = new spine.Vector2();\n this.temp2 = new spine.Vector2();\n this.temp3 = new spine.Color();\n this.temp4 = new spine.Color();\n this.twoColorTint = twoColorTint;\n if (twoColorTint)\n this.vertexSize += 4;\n this.vertices = spine.Utils.newFloatArray(this.vertexSize * 1024);\n }\n SkeletonRenderer.prototype.draw = function (batcher, skeleton, slotRangeStart, slotRangeEnd) {\n if (slotRangeStart === void 0) { slotRangeStart = -1; }\n if (slotRangeEnd === void 0) { slotRangeEnd = -1; }\n var clipper = this.clipper;\n var premultipliedAlpha = this.premultipliedAlpha;\n var twoColorTint = this.twoColorTint;\n var blendMode = null;\n var tempPos = this.temp;\n var tempUv = this.temp2;\n var tempLight = this.temp3;\n var tempDark = this.temp4;\n var renderable = this.renderable;\n var uvs = null;\n var triangles = null;\n var drawOrder = skeleton.drawOrder;\n var attachmentColor = null;\n var skeletonColor = skeleton.color;\n var vertexSize = twoColorTint ? 12 : 8;\n var inRange = false;\n if (slotRangeStart == -1)\n inRange = true;\n for (var i = 0, n = drawOrder.length; i < n; i++) {\n var clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\n var slot = drawOrder[i];\n if (!slot.bone.active) {\n clipper.clipEndWithSlot(slot);\n continue;\n }\n if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\n inRange = true;\n }\n if (!inRange) {\n clipper.clipEndWithSlot(slot);\n continue;\n }\n if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\n inRange = false;\n }\n var attachment = slot.getAttachment();\n var texture = null;\n if (attachment instanceof spine.RegionAttachment) {\n var region = attachment;\n renderable.vertices = this.vertices;\n renderable.numVertices = 4;\n renderable.numFloats = clippedVertexSize << 2;\n region.computeWorldVertices(slot.bone, renderable.vertices, 0, clippedVertexSize);\n triangles = SkeletonRenderer.QUAD_TRIANGLES;\n uvs = region.uvs;\n texture = region.region.renderObject.texture;\n attachmentColor = region.color;\n }\n else if (attachment instanceof spine.MeshAttachment) {\n var mesh = attachment;\n renderable.vertices = this.vertices;\n renderable.numVertices = (mesh.worldVerticesLength >> 1);\n renderable.numFloats = renderable.numVertices * clippedVertexSize;\n if (renderable.numFloats > renderable.vertices.length) {\n renderable.vertices = this.vertices = spine.Utils.newFloatArray(renderable.numFloats);\n }\n mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\n triangles = mesh.triangles;\n texture = mesh.region.renderObject.texture;\n uvs = mesh.uvs;\n attachmentColor = mesh.color;\n }\n else if (attachment instanceof spine.ClippingAttachment) {\n var clip = (attachment);\n clipper.clipStart(slot, clip);\n continue;\n }\n else {\n clipper.clipEndWithSlot(slot);\n continue;\n }\n if (texture != null) {\n var slotColor = slot.color;\n var finalColor = this.tempColor;\n finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\n finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\n finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\n finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\n if (premultipliedAlpha) {\n finalColor.r *= finalColor.a;\n finalColor.g *= finalColor.a;\n finalColor.b *= finalColor.a;\n }\n var darkColor = this.tempColor2;\n if (slot.darkColor == null)\n darkColor.set(0, 0, 0, 1.0);\n else {\n if (premultipliedAlpha) {\n darkColor.r = slot.darkColor.r * finalColor.a;\n darkColor.g = slot.darkColor.g * finalColor.a;\n darkColor.b = slot.darkColor.b * finalColor.a;\n }\n else {\n darkColor.setFromColor(slot.darkColor);\n }\n darkColor.a = premultipliedAlpha ? 1.0 : 0.0;\n }\n var slotBlendMode = slot.data.blendMode;\n if (slotBlendMode != blendMode) {\n blendMode = slotBlendMode;\n batcher.setBlendMode(webgl.WebGLBlendModeConverter.getSourceGLBlendMode(blendMode, premultipliedAlpha), webgl.WebGLBlendModeConverter.getDestGLBlendMode(blendMode));\n }\n if (clipper.isClipping()) {\n clipper.clipTriangles(renderable.vertices, renderable.numFloats, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\n var clippedVertices = new Float32Array(clipper.clippedVertices);\n var clippedTriangles = clipper.clippedTriangles;\n if (this.vertexEffect != null) {\n var vertexEffect = this.vertexEffect;\n var verts = clippedVertices;\n if (!twoColorTint) {\n for (var v = 0, n_4 = clippedVertices.length; v < n_4; v += vertexSize) {\n tempPos.x = verts[v];\n tempPos.y = verts[v + 1];\n tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\n tempUv.x = verts[v + 6];\n tempUv.y = verts[v + 7];\n tempDark.set(0, 0, 0, 0);\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\n verts[v] = tempPos.x;\n verts[v + 1] = tempPos.y;\n verts[v + 2] = tempLight.r;\n verts[v + 3] = tempLight.g;\n verts[v + 4] = tempLight.b;\n verts[v + 5] = tempLight.a;\n verts[v + 6] = tempUv.x;\n verts[v + 7] = tempUv.y;\n }\n }\n else {\n for (var v = 0, n_5 = clippedVertices.length; v < n_5; v += vertexSize) {\n tempPos.x = verts[v];\n tempPos.y = verts[v + 1];\n tempLight.set(verts[v + 2], verts[v + 3], verts[v + 4], verts[v + 5]);\n tempUv.x = verts[v + 6];\n tempUv.y = verts[v + 7];\n tempDark.set(verts[v + 8], verts[v + 9], verts[v + 10], verts[v + 11]);\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\n verts[v] = tempPos.x;\n verts[v + 1] = tempPos.y;\n verts[v + 2] = tempLight.r;\n verts[v + 3] = tempLight.g;\n verts[v + 4] = tempLight.b;\n verts[v + 5] = tempLight.a;\n verts[v + 6] = tempUv.x;\n verts[v + 7] = tempUv.y;\n verts[v + 8] = tempDark.r;\n verts[v + 9] = tempDark.g;\n verts[v + 10] = tempDark.b;\n verts[v + 11] = tempDark.a;\n }\n }\n }\n batcher.draw(texture, clippedVertices, clippedTriangles);\n }\n else {\n var verts = renderable.vertices;\n if (this.vertexEffect != null) {\n var vertexEffect = this.vertexEffect;\n if (!twoColorTint) {\n for (var v = 0, u = 0, n_6 = renderable.numFloats; v < n_6; v += vertexSize, u += 2) {\n tempPos.x = verts[v];\n tempPos.y = verts[v + 1];\n tempUv.x = uvs[u];\n tempUv.y = uvs[u + 1];\n tempLight.setFromColor(finalColor);\n tempDark.set(0, 0, 0, 0);\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\n verts[v] = tempPos.x;\n verts[v + 1] = tempPos.y;\n verts[v + 2] = tempLight.r;\n verts[v + 3] = tempLight.g;\n verts[v + 4] = tempLight.b;\n verts[v + 5] = tempLight.a;\n verts[v + 6] = tempUv.x;\n verts[v + 7] = tempUv.y;\n }\n }\n else {\n for (var v = 0, u = 0, n_7 = renderable.numFloats; v < n_7; v += vertexSize, u += 2) {\n tempPos.x = verts[v];\n tempPos.y = verts[v + 1];\n tempUv.x = uvs[u];\n tempUv.y = uvs[u + 1];\n tempLight.setFromColor(finalColor);\n tempDark.setFromColor(darkColor);\n vertexEffect.transform(tempPos, tempUv, tempLight, tempDark);\n verts[v] = tempPos.x;\n verts[v + 1] = tempPos.y;\n verts[v + 2] = tempLight.r;\n verts[v + 3] = tempLight.g;\n verts[v + 4] = tempLight.b;\n verts[v + 5] = tempLight.a;\n verts[v + 6] = tempUv.x;\n verts[v + 7] = tempUv.y;\n verts[v + 8] = tempDark.r;\n verts[v + 9] = tempDark.g;\n verts[v + 10] = tempDark.b;\n verts[v + 11] = tempDark.a;\n }\n }\n }\n else {\n if (!twoColorTint) {\n for (var v = 2, u = 0, n_8 = renderable.numFloats; v < n_8; v += vertexSize, u += 2) {\n verts[v] = finalColor.r;\n verts[v + 1] = finalColor.g;\n verts[v + 2] = finalColor.b;\n verts[v + 3] = finalColor.a;\n verts[v + 4] = uvs[u];\n verts[v + 5] = uvs[u + 1];\n }\n }\n else {\n for (var v = 2, u = 0, n_9 = renderable.numFloats; v < n_9; v += vertexSize, u += 2) {\n verts[v] = finalColor.r;\n verts[v + 1] = finalColor.g;\n verts[v + 2] = finalColor.b;\n verts[v + 3] = finalColor.a;\n verts[v + 4] = uvs[u];\n verts[v + 5] = uvs[u + 1];\n verts[v + 6] = darkColor.r;\n verts[v + 7] = darkColor.g;\n verts[v + 8] = darkColor.b;\n verts[v + 9] = darkColor.a;\n }\n }\n }\n var view = renderable.vertices.subarray(0, renderable.numFloats);\n batcher.draw(texture, view, triangles);\n }\n }\n clipper.clipEndWithSlot(slot);\n }\n clipper.clipEnd();\n };\n SkeletonRenderer.QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n return SkeletonRenderer;\n }());\n webgl.SkeletonRenderer = SkeletonRenderer;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var Vector3 = (function () {\n function Vector3(x, y, z) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (z === void 0) { z = 0; }\n this.x = 0;\n this.y = 0;\n this.z = 0;\n this.x = x;\n this.y = y;\n this.z = z;\n }\n Vector3.prototype.setFrom = function (v) {\n this.x = v.x;\n this.y = v.y;\n this.z = v.z;\n return this;\n };\n Vector3.prototype.set = function (x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n return this;\n };\n Vector3.prototype.add = function (v) {\n this.x += v.x;\n this.y += v.y;\n this.z += v.z;\n return this;\n };\n Vector3.prototype.sub = function (v) {\n this.x -= v.x;\n this.y -= v.y;\n this.z -= v.z;\n return this;\n };\n Vector3.prototype.scale = function (s) {\n this.x *= s;\n this.y *= s;\n this.z *= s;\n return this;\n };\n Vector3.prototype.normalize = function () {\n var len = this.length();\n if (len == 0)\n return this;\n len = 1 / len;\n this.x *= len;\n this.y *= len;\n this.z *= len;\n return this;\n };\n Vector3.prototype.cross = function (v) {\n return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);\n };\n Vector3.prototype.multiply = function (matrix) {\n var l_mat = matrix.values;\n return this.set(this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03], this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13], this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]);\n };\n Vector3.prototype.project = function (matrix) {\n var l_mat = matrix.values;\n var l_w = 1 / (this.x * l_mat[webgl.M30] + this.y * l_mat[webgl.M31] + this.z * l_mat[webgl.M32] + l_mat[webgl.M33]);\n return this.set((this.x * l_mat[webgl.M00] + this.y * l_mat[webgl.M01] + this.z * l_mat[webgl.M02] + l_mat[webgl.M03]) * l_w, (this.x * l_mat[webgl.M10] + this.y * l_mat[webgl.M11] + this.z * l_mat[webgl.M12] + l_mat[webgl.M13]) * l_w, (this.x * l_mat[webgl.M20] + this.y * l_mat[webgl.M21] + this.z * l_mat[webgl.M22] + l_mat[webgl.M23]) * l_w);\n };\n Vector3.prototype.dot = function (v) {\n return this.x * v.x + this.y * v.y + this.z * v.z;\n };\n Vector3.prototype.length = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n };\n Vector3.prototype.distance = function (v) {\n var a = v.x - this.x;\n var b = v.y - this.y;\n var c = v.z - this.z;\n return Math.sqrt(a * a + b * b + c * c);\n };\n return Vector3;\n }());\n webgl.Vector3 = Vector3;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\nvar spine;\n(function (spine) {\n var webgl;\n (function (webgl) {\n var ManagedWebGLRenderingContext = (function () {\n function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) {\n if (contextConfig === void 0) { contextConfig = { alpha: \"true\" }; }\n this.restorables = new Array();\n if (canvasOrContext instanceof HTMLCanvasElement || canvasOrContext instanceof EventTarget) {\n this.setupCanvas(canvasOrContext, contextConfig);\n }\n else {\n this.gl = canvasOrContext;\n this.canvas = this.gl.canvas;\n }\n }\n ManagedWebGLRenderingContext.prototype.setupCanvas = function (canvas, contextConfig) {\n var _this = this;\n this.gl = (canvas.getContext(\"webgl2\", contextConfig) || canvas.getContext(\"webgl\", contextConfig));\n this.canvas = canvas;\n canvas.addEventListener(\"webglcontextlost\", function (e) {\n var event = e;\n if (e) {\n e.preventDefault();\n }\n });\n canvas.addEventListener(\"webglcontextrestored\", function (e) {\n for (var i = 0, n = _this.restorables.length; i < n; i++) {\n _this.restorables[i].restore();\n }\n });\n };\n ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) {\n this.restorables.push(restorable);\n };\n ManagedWebGLRenderingContext.prototype.removeRestorable = function (restorable) {\n var index = this.restorables.indexOf(restorable);\n if (index > -1)\n this.restorables.splice(index, 1);\n };\n return ManagedWebGLRenderingContext;\n }());\n webgl.ManagedWebGLRenderingContext = ManagedWebGLRenderingContext;\n var WebGLBlendModeConverter = (function () {\n function WebGLBlendModeConverter() {\n }\n WebGLBlendModeConverter.getDestGLBlendMode = function (blendMode) {\n switch (blendMode) {\n case spine.BlendMode.Normal: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\n case spine.BlendMode.Additive: return WebGLBlendModeConverter.ONE;\n case spine.BlendMode.Multiply: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\n case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA;\n default: throw new Error(\"Unknown blend mode: \" + blendMode);\n }\n };\n WebGLBlendModeConverter.getSourceGLBlendMode = function (blendMode, premultipliedAlpha) {\n if (premultipliedAlpha === void 0) { premultipliedAlpha = false; }\n switch (blendMode) {\n case spine.BlendMode.Normal: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\n case spine.BlendMode.Additive: return premultipliedAlpha ? WebGLBlendModeConverter.ONE : WebGLBlendModeConverter.SRC_ALPHA;\n case spine.BlendMode.Multiply: return WebGLBlendModeConverter.DST_COLOR;\n case spine.BlendMode.Screen: return WebGLBlendModeConverter.ONE;\n default: throw new Error(\"Unknown blend mode: \" + blendMode);\n }\n };\n WebGLBlendModeConverter.ZERO = 0;\n WebGLBlendModeConverter.ONE = 1;\n WebGLBlendModeConverter.SRC_COLOR = 0x0300;\n WebGLBlendModeConverter.ONE_MINUS_SRC_COLOR = 0x0301;\n WebGLBlendModeConverter.SRC_ALPHA = 0x0302;\n WebGLBlendModeConverter.ONE_MINUS_SRC_ALPHA = 0x0303;\n WebGLBlendModeConverter.DST_ALPHA = 0x0304;\n WebGLBlendModeConverter.ONE_MINUS_DST_ALPHA = 0x0305;\n WebGLBlendModeConverter.DST_COLOR = 0x0306;\n return WebGLBlendModeConverter;\n }());\n webgl.WebGLBlendModeConverter = WebGLBlendModeConverter;\n })(webgl = spine.webgl || (spine.webgl = {}));\n})(spine || (spine = {}));\n//# sourceMappingURL=spine-both.js.map\n/*** EXPORTS FROM exports-loader ***/\nmodule.exports = spine;\n\n}.call(window));\n"],"sourceRoot":""} \ No newline at end of file diff --git a/plugins/spine/dist/SpineWebGLPlugin.js b/plugins/spine/dist/SpineWebGLPlugin.js index 9774ed4ed..bc22e7089 100644 --- a/plugins/spine/dist/SpineWebGLPlugin.js +++ b/plugins/spine/dist/SpineWebGLPlugin.js @@ -82,7 +82,7 @@ window["SpinePlugin"] = /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 62); +/******/ return __webpack_require__(__webpack_require__.s = 61); /******/ }) /************************************************************************/ /******/ ([ @@ -341,6 +341,33 @@ module.exports = Class; /***/ }), /* 1 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * A NOOP (No Operation) callback function. + * + * Used internally by Phaser when it's more expensive to determine if a callback exists + * than it is to just invoke an empty function. + * + * @function Phaser.Utils.NOOP + * @since 3.0.0 + */ +var NOOP = function () +{ + // NOOP +}; + +module.exports = NOOP; + + +/***/ }), +/* 2 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -353,7 +380,7 @@ module.exports = Class; // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = __webpack_require__(0); -var FuzzyEqual = __webpack_require__(31); +var FuzzyEqual = __webpack_require__(32); /** * @classdesc @@ -1116,7 +1143,7 @@ module.exports = Vector2; /***/ }), -/* 2 */ +/* 3 */ /***/ (function(module, exports) { /** @@ -1208,7 +1235,7 @@ module.exports = MATH_CONST; /***/ }), -/* 3 */ +/* 4 */ /***/ (function(module, exports) { /** @@ -1237,33 +1264,6 @@ var Clamp = function (value, min, max) module.exports = Clamp; -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * A NOOP (No Operation) callback function. - * - * Used internally by Phaser when it's more expensive to determine if a callback exists - * than it is to just invoke an empty function. - * - * @function Phaser.Utils.NOOP - * @since 3.0.0 - */ -var NOOP = function () -{ - // NOOP -}; - -module.exports = NOOP; - - /***/ }), /* 5 */ /***/ (function(module, exports) { @@ -1317,6 +1317,62 @@ module.exports = SafeRange; /* 6 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a slightly modified version of jQuery.isPlainObject. + * A plain object is an object whose internal class property is [object Object]. + * + * @function Phaser.Utils.Objects.IsPlainObject + * @since 3.0.0 + * + * @param {object} obj - The object to inspect. + * + * @return {boolean} `true` if the object is plain, otherwise `false`. + */ +var IsPlainObject = function (obj) +{ + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) + { + return false; + } + + // Support: Firefox <20 + // The try/catch suppresses exceptions thrown when attempting to access + // the "constructor" property of certain host objects, ie. |window.location| + // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 + try + { + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) + { + return false; + } + } + catch (e) + { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; +}; + +module.exports = IsPlainObject; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -1384,98 +1440,10 @@ var GetValue = function (source, key, defaultValue) module.exports = GetValue; -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * This is a slightly modified version of jQuery.isPlainObject. - * A plain object is an object whose internal class property is [object Object]. - * - * @function Phaser.Utils.Objects.IsPlainObject - * @since 3.0.0 - * - * @param {object} obj - The object to inspect. - * - * @return {boolean} `true` if the object is plain, otherwise `false`. - */ -var IsPlainObject = function (obj) -{ - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if (typeof(obj) !== 'object' || obj.nodeType || obj === obj.window) - { - return false; - } - - // Support: Firefox <20 - // The try/catch suppresses exceptions thrown when attempting to access - // the "constructor" property of certain host objects, ie. |window.location| - // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 - try - { - if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, 'isPrototypeOf')) - { - return false; - } - } - catch (e) - { - return false; - } - - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; -}; - -module.exports = IsPlainObject; - - /***/ }), /* 8 */ /***/ (function(module, exports) { -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Wrap the given `value` between `min` and `max. - * - * @function Phaser.Math.Wrap - * @since 3.0.0 - * - * @param {number} value - The value to wrap. - * @param {number} min - The minimum value. - * @param {number} max - The maximum value. - * - * @return {number} The wrapped value. - */ -var Wrap = function (value, min, max) -{ - var range = max - min; - - return (min + ((((value - min) % range) + range) % range)); -}; - -module.exports = Wrap; - - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -1516,7 +1484,7 @@ module.exports = GetFastValue; /***/ }), -/* 10 */ +/* 9 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1526,7 +1494,7 @@ module.exports = GetFastValue; */ var Class = __webpack_require__(0); -var GEOM_CONST = __webpack_require__(25); +var GEOM_CONST = __webpack_require__(26); /** * @classdesc @@ -1608,6 +1576,38 @@ var Point = new Class({ module.exports = Point; +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Wrap the given `value` between `min` and `max. + * + * @function Phaser.Math.Wrap + * @since 3.0.0 + * + * @param {number} value - The value to wrap. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. + * + * @return {number} The wrapped value. + */ +var Wrap = function (value, min, max) +{ + var range = max - min; + + return (min + ((((value - min) % range) + range) % range)); +}; + +module.exports = Wrap; + + /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { @@ -1618,73 +1618,1044 @@ module.exports = Point; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); /** - * Takes an angle in Phasers default clockwise format and converts it so that - * 0 is North, 90 is West, 180 is South and 270 is East, - * therefore running counter-clockwise instead of clockwise. - * - * You can pass in the angle from a Game Object using: - * - * ```javascript - * var converted = CounterClockwise(gameobject.rotation); - * ``` - * - * All values for this function are in radians. + * @classdesc + * A representation of a vector in 3D space. * - * @function Phaser.Math.Angle.CounterClockwise - * @since 3.16.0 + * A three-component vector. * - * @param {number} angle - The angle to convert, in radians. + * @class Vector3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 * - * @return {number} The converted angle, in radians. + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. */ -var CounterClockwise = function (angle) -{ - if (angle > Math.PI) +var Vector3 = new Class({ + + initialize: + + function Vector3 (x, y, z) { - angle -= CONST.PI2; + /** + * The x component of this Vector. + * + * @name Phaser.Math.Vector3#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = 0; + + /** + * The y component of this Vector. + * + * @name Phaser.Math.Vector3#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = 0; + + /** + * The z component of this Vector. + * + * @name Phaser.Math.Vector3#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.z = 0; + + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + }, + + /** + * Set this Vector to point up. + * + * Sets the y component of the vector to 1, and the others to 0. + * + * @method Phaser.Math.Vector3#up + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + up: function () + { + this.x = 0; + this.y = 1; + this.z = 0; + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + + /** + * Make a clone of this Vector3. + * + * @method Phaser.Math.Vector3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + */ + clone: function () + { + return new Vector3(this.x, this.y, this.z); + }, + + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + + /** + * Calculate the cross (vector) product of two given Vectors. + * + * @method Phaser.Math.Vector3#crossVectors + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to multiply. + * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + crossVectors: function (a, b) + { + var ax = a.x; + var ay = a.y; + var az = a.z; + var bx = b.x; + var by = b.y; + var bz = b.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Check whether this Vector is equal to a given Vector. + * + * Performs a strict equality check against each Vector's components. + * + * @method Phaser.Math.Vector3#equals + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * + * @return {boolean} True if the two vectors strictly match, otherwise false. + */ + equals: function (v) + { + return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); + }, + + /** + * Copy the components of a given Vector into this Vector. + * + * @method Phaser.Math.Vector3#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + copy: function (src) + { + this.x = src.x; + this.y = src.y; + this.z = src.z || 0; + + return this; + }, + + /** + * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * + * @method Phaser.Math.Vector3#set + * @since 3.0.0 + * + * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. + * @param {number} [y] - The y value to set for this Vector. + * @param {number} [z] - The z value to set for this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + set: function (x, y, z) + { + if (typeof x === 'object') + { + this.x = x.x || 0; + this.y = x.y || 0; + this.z = x.z || 0; + } + else + { + this.x = x || 0; + this.y = y || 0; + this.z = z || 0; + } + + return this; + }, + + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + + /** + * Add a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + add: function (v) + { + this.x += v.x; + this.y += v.y; + this.z += v.z || 0; + + return this; + }, + + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * + * @method Phaser.Math.Vector3#addScale + * @since 3.50.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. + * @param {number} scale - The amount to scale `v` by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScale: function (v, scale) + { + this.x += v.x * scale; + this.y += v.y * scale; + this.z += v.z * scale || 0; + + return this; + }, + + /** + * Subtract the given Vector from this Vector. Subtraction is component-wise. + * + * @method Phaser.Math.Vector3#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + subtract: function (v) + { + this.x -= v.x; + this.y -= v.y; + this.z -= v.z || 0; + + return this; + }, + + /** + * Perform a component-wise multiplication between this Vector and the given Vector. + * + * Multiplies this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + multiply: function (v) + { + this.x *= v.x; + this.y *= v.y; + this.z *= v.z || 1; + + return this; + }, + + /** + * Scale this Vector by the given value. + * + * @method Phaser.Math.Vector3#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + scale: function (scale) + { + if (isFinite(scale)) + { + this.x *= scale; + this.y *= scale; + this.z *= scale; + } + else + { + this.x = 0; + this.y = 0; + this.z = 0; + } + + return this; + }, + + /** + * Perform a component-wise division between this Vector and the given Vector. + * + * Divides this Vector by the given Vector. + * + * @method Phaser.Math.Vector3#divide + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + divide: function (v) + { + this.x /= v.x; + this.y /= v.y; + this.z /= v.z || 1; + + return this; + }, + + /** + * Negate the `x`, `y` and `z` components of this Vector. + * + * @method Phaser.Math.Vector3#negate + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + negate: function () + { + this.x = -this.x; + this.y = -this.y; + this.z = -this.z; + + return this; + }, + + /** + * Calculate the distance between this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#distance + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector. + */ + distance: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return Math.sqrt(dx * dx + dy * dy + dz * dz); + }, + + /** + * Calculate the distance between this Vector and the given Vector, squared. + * + * @method Phaser.Math.Vector3#distanceSq + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. + * + * @return {number} The distance from this Vector to the given Vector, squared. + */ + distanceSq: function (v) + { + var dx = v.x - this.x; + var dy = v.y - this.y; + var dz = v.z - this.z || 0; + + return dx * dx + dy * dy + dz * dz; + }, + + /** + * Calculate the length (or magnitude) of this Vector. + * + * @method Phaser.Math.Vector3#length + * @since 3.0.0 + * + * @return {number} The length of this Vector. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return Math.sqrt(x * x + y * y + z * z); + }, + + /** + * Calculate the length of this Vector squared. + * + * @method Phaser.Math.Vector3#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Vector, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + return x * x + y * y + z * z; + }, + + /** + * Normalize this Vector. + * + * Makes the vector a unit length vector (magnitude of 1) in the same direction. + * + * @method Phaser.Math.Vector3#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var len = x * x + y * y + z * z; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this.x = x * len; + this.y = y * len; + this.z = z * len; + } + + return this; + }, + + /** + * Calculate the dot product of this Vector and the given Vector. + * + * @method Phaser.Math.Vector3#dot + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * + * @return {number} The dot product of this Vector and `v`. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z; + }, + + /** + * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * + * @method Phaser.Math.Vector3#cross + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + cross: function (v) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var bx = v.x; + var by = v.y; + var bz = v.z; + + this.x = ay * bz - az * by; + this.y = az * bx - ax * bz; + this.z = ax * by - ay * bx; + + return this; + }, + + /** + * Linearly interpolate between this Vector and the given Vector. + * + * Interpolates this Vector towards the given Vector. + * + * @method Phaser.Math.Vector3#lerp + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. + * @param {number} [t=0] - The interpolation percentage, between 0 and 1. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + + this.x = ax + t * (v.x - ax); + this.y = ay + t * (v.y - ay); + this.z = az + t * (v.z - az); + + return this; + }, + + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + + /** + * Transform this Vector with the given Matrix. + * + * @method Phaser.Math.Vector3#transformMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat3: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = x * m[0] + y * m[3] + z * m[6]; + this.y = x * m[1] + y * m[4] + z * m[7]; + this.z = x * m[2] + y * m[5] + z * m[8]; + + return this; + }, + + /** + * Transform this Vector with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformMat4: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; + this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; + this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; + + return this; + }, + + /** + * Transforms the coordinates of this Vector3 with the given Matrix4. + * + * @method Phaser.Math.Vector3#transformCoordinates + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformCoordinates: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.x = tx / tw; + this.y = ty / tw; + this.z = tz / tw; + + return this; + }, + + /** + * Transform this Vector with the given Quaternion. + * + * @method Phaser.Math.Vector3#transformQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + transformQuat: function (q) + { + // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations + var x = this.x; + var y = this.y; + var z = this.z; + var qx = q.x; + var qy = q.y; + var qz = q.z; + var qw = q.w; + + // calculate quat * vec + var ix = qw * x + qy * z - qz * y; + var iy = qw * y + qz * x - qx * z; + var iz = qw * z + qx * y - qy * x; + var iw = -qx * x - qy * y - qz * z; + + // calculate result * inverse quat + this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return this; + }, + + /** + * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, + * e.g. unprojecting a 2D point into 3D space. + * + * @method Phaser.Math.Vector3#project + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + project: function (mat) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat.val; + + var a00 = m[0]; + var a01 = m[1]; + var a02 = m[2]; + var a03 = m[3]; + var a10 = m[4]; + var a11 = m[5]; + var a12 = m[6]; + var a13 = m[7]; + var a20 = m[8]; + var a21 = m[9]; + var a22 = m[10]; + var a23 = m[11]; + var a30 = m[12]; + var a31 = m[13]; + var a32 = m[14]; + var a33 = m[15]; + + var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); + + this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; + this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; + this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; + + return this; + }, + + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + + /** + * Unproject this point from 2D space to 3D space. + * The point should have its x and y properties set to + * 2D screen space, and the z either at 0 (near plane) + * or 1 (far plane). The provided matrix is assumed to already + * be combined, i.e. projection * view * model. + * + * After this operation, this vector's (x, y, z) components will + * represent the unprojected 3D coordinate. + * + * @method Phaser.Math.Vector3#unproject + * @since 3.0.0 + * + * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. + * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unproject: function (viewport, invProjectionView) + { + var viewX = viewport.x; + var viewY = viewport.y; + var viewWidth = viewport.z; + var viewHeight = viewport.w; + + var x = this.x - viewX; + var y = (viewHeight - this.y - 1) - viewY; + var z = this.z; + + this.x = (2 * x) / viewWidth - 1; + this.y = (2 * y) / viewHeight - 1; + this.z = 2 * z - 1; + + return this.project(invProjectionView); + }, + + /** + * Make this Vector the zero vector (0, 0, 0). + * + * @method Phaser.Math.Vector3#reset + * @since 3.0.0 + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + reset: function () + { + this.x = 0; + this.y = 0; + this.z = 0; + + return this; } - return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); -}; +}); -module.exports = CounterClockwise; +/** + * A static zero Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ZERO + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ZERO = new Vector3(); + +/** + * A static right Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.RIGHT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.RIGHT = new Vector3(1, 0, 0); + +/** + * A static left Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.LEFT + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.LEFT = new Vector3(-1, 0, 0); + +/** + * A static up Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.UP + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.UP = new Vector3(0, -1, 0); + +/** + * A static down Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.DOWN + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.DOWN = new Vector3(0, 1, 0); + +/** + * A static forward Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.FORWARD + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.FORWARD = new Vector3(0, 0, 1); + +/** + * A static back Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.BACK + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.BACK = new Vector3(0, 0, -1); + +/** + * A static one Vector3 for use by reference. + * + * This constant is meant for comparison operations and should not be modified directly. + * + * @constant + * @name Phaser.Math.Vector3.ONE + * @type {Phaser.Math.Vector3} + * @since 3.16.0 + */ +Vector3.ONE = new Vector3(1, 1, 1); + +module.exports = Vector3; /***/ }), /* 12 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var CONST = __webpack_require__(2); - -/** - * Convert the given angle in radians, to the equivalent angle in degrees. - * - * @function Phaser.Math.RadToDeg - * @since 3.0.0 - * - * @param {number} radians - The angle in radians to convert ot degrees. - * - * @return {integer} The given angle converted to degrees. - */ -var RadToDeg = function (radians) -{ - return radians * CONST.RAD_TO_DEG; -}; - -module.exports = RadToDeg; - - -/***/ }), -/* 13 */ /***/ (function(module, exports) { /** @@ -1836,7 +2807,7 @@ module.exports = FILE_CONST; /***/ }), -/* 14 */ +/* 13 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -1845,8 +2816,8 @@ module.exports = FILE_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CheckMatrix = __webpack_require__(23); -var TransposeMatrix = __webpack_require__(56); +var CheckMatrix = __webpack_require__(24); +var TransposeMatrix = __webpack_require__(55); /** * Rotates the array matrix based on the given rotation value. @@ -1856,6 +2827,20 @@ var TransposeMatrix = __webpack_require__(56); * * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateMatrix * @since 3.0.0 * @@ -1908,7 +2893,7 @@ module.exports = RotateMatrix; /***/ }), -/* 15 */ +/* 14 */ /***/ (function(module, exports) { /** @@ -1954,7 +2939,7 @@ module.exports = SpliceOne; /***/ }), -/* 16 */ +/* 15 */ /***/ (function(module, exports) { /** @@ -2292,6 +3277,51 @@ module.exports = { }; +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(3); + +/** + * Takes an angle in Phasers default clockwise format and converts it so that + * 0 is North, 90 is West, 180 is South and 270 is East, + * therefore running counter-clockwise instead of clockwise. + * + * You can pass in the angle from a Game Object using: + * + * ```javascript + * var converted = CounterClockwise(gameobject.rotation); + * ``` + * + * All values for this function are in radians. + * + * @function Phaser.Math.Angle.CounterClockwise + * @since 3.16.0 + * + * @param {number} angle - The angle to convert, in radians. + * + * @return {number} The converted angle, in radians. + */ +var CounterClockwise = function (angle) +{ + if (angle > Math.PI) + { + angle -= CONST.PI2; + } + + return Math.abs((((angle + CONST.TAU) % CONST.PI2) - CONST.PI2) % CONST.PI2); +}; + +module.exports = CounterClockwise; + + /***/ }), /* 17 */ /***/ (function(module, exports) { @@ -2331,7 +3361,7 @@ module.exports = FloatBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); +var CONST = __webpack_require__(3); /** * Convert the given angle from degrees, to the equivalent angle in radians. @@ -2361,810 +3391,1823 @@ module.exports = DegToRad; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - var Class = __webpack_require__(0); +var Vector3 = __webpack_require__(11); + +/** + * @ignore + */ +var EPSILON = 0.000001; /** * @classdesc - * A representation of a vector in 3D space. + * A four-dimensional matrix. * - * A three-component vector. + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl * - * @class Vector3 + * @class Matrix4 * @memberof Phaser.Math * @constructor * @since 3.0.0 * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. + * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. */ -var Vector3 = new Class({ +var Matrix4 = new Class({ initialize: - function Vector3 (x, y, z) + function Matrix4 (m) { /** - * The x component of this Vector. + * The matrix values. * - * @name Phaser.Math.Vector3#x - * @type {number} - * @default 0 + * @name Phaser.Math.Matrix4#val + * @type {Float32Array} * @since 3.0.0 */ - this.x = 0; + this.val = new Float32Array(16); - /** - * The y component of this Vector. - * - * @name Phaser.Math.Vector3#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = 0; - - /** - * The z component of this Vector. - * - * @name Phaser.Math.Vector3#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.z = 0; - - if (typeof x === 'object') + if (m) { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; + // Assume Matrix4 with val: + this.copy(m); } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; + // Default to identity + this.identity(); } }, /** - * Set this Vector to point up. + * Make a clone of this Matrix4. * - * Sets the y component of the vector to 1, and the others to 0. - * - * @method Phaser.Math.Vector3#up + * @method Phaser.Math.Matrix4#clone * @since 3.0.0 * - * @return {Phaser.Math.Vector3} This Vector3. - */ - up: function () - { - this.x = 0; - this.y = 1; - this.z = 0; - - return this; - }, - - /** - * Make a clone of this Vector3. - * - * @method Phaser.Math.Vector3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} A new Vector3 object containing this Vectors values. + * @return {Phaser.Math.Matrix4} A clone of this Matrix4. */ clone: function () { - return new Vector3(this.x, this.y, this.z); + return new Matrix4(this); }, /** - * Calculate the cross (vector) product of two given Vectors. + * This method is an alias for `Matrix4.copy`. * - * @method Phaser.Math.Vector3#crossVectors + * @method Phaser.Math.Matrix4#set * @since 3.0.0 * - * @param {Phaser.Math.Vector3} a - The first Vector to multiply. - * @param {Phaser.Math.Vector3} b - The second Vector to multiply. + * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. * - * @return {Phaser.Math.Vector3} This Vector3. + * @return {this} This Matrix4. */ - crossVectors: function (a, b) + set: function (src) { - var ax = a.x; - var ay = a.y; - var az = a.z; - var bx = b.x; - var by = b.y; - var bz = b.z; + return this.copy(src); + }, - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ + setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) + { + var out = this.val; + + out[0] = m00; + out[1] = m01; + out[2] = m02; + out[3] = m03; + out[4] = m10; + out[5] = m11; + out[6] = m12; + out[7] = m13; + out[8] = m20; + out[9] = m21; + out[10] = m22; + out[11] = m23; + out[12] = m30; + out[13] = m31; + out[14] = m32; + out[15] = m33; return this; }, /** - * Check whether this Vector is equal to a given Vector. + * Copy the values of a given Matrix into this Matrix. * - * Performs a strict equality check against each Vector's components. - * - * @method Phaser.Math.Vector3#equals + * @method Phaser.Math.Matrix4#copy * @since 3.0.0 * - * @param {Phaser.Math.Vector3} v - The Vector3 to compare against. + * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. * - * @return {boolean} True if the two vectors strictly match, otherwise false. - */ - equals: function (v) - { - return ((this.x === v.x) && (this.y === v.y) && (this.z === v.z)); - }, - - /** - * Copy the components of a given Vector into this Vector. - * - * @method Phaser.Math.Vector3#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} src - The Vector to copy the components from. - * - * @return {Phaser.Math.Vector3} This Vector3. + * @return {this} This Matrix4. */ copy: function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z || 0; + var a = src.val; + + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix4#fromArray + * @since 3.0.0 + * + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. + * + * @return {this} This Matrix4. + */ + fromArray: function (a) + { + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); + }, + + /** + * Reset this Matrix. + * + * Sets all values to `0`. + * + * @method Phaser.Math.Matrix4#zero + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix4} This Matrix4. + */ + zero: function () + { + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, + + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); + + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); + }, + + /** + * Set the `x`, `y` and `z` values of this Matrix. + * + * @method Phaser.Math.Matrix4#xyz + * @since 3.0.0 + * + * @param {number} x - The x value. + * @param {number} y - The y value. + * @param {number} z - The z value. + * + * @return {this} This Matrix4. + */ + xyz: function (x, y, z) + { + this.identity(); + + var out = this.val; + + out[12] = x; + out[13] = y; + out[14] = z; return this; }, /** - * Set the `x`, `y`, and `z` components of this Vector to the given `x`, `y`, and `z` values. + * Set the scaling values of this Matrix. * - * @method Phaser.Math.Vector3#set + * @method Phaser.Math.Matrix4#scaling * @since 3.0.0 * - * @param {(number|object)} x - The x value to set for this Vector, or an object containing x, y and z components. - * @param {number} [y] - The y value to set for this Vector. - * @param {number} [z] - The z value to set for this Vector. + * @param {number} x - The x scaling value. + * @param {number} y - The y scaling value. + * @param {number} z - The z scaling value. * - * @return {Phaser.Math.Vector3} This Vector3. + * @return {this} This Matrix4. */ - set: function (x, y, z) + scaling: function (x, y, z) { - if (typeof x === 'object') + this.zero(); + + var out = this.val; + + out[0] = x; + out[5] = y; + out[10] = z; + out[15] = 1; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix4#identity + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + identity: function () + { + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix4#transpose + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + transpose: function () + { + var a = this.val; + + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a12 = a[6]; + var a13 = a[7]; + var a23 = a[11]; + + a[1] = a[4]; + a[2] = a[8]; + a[3] = a[12]; + a[4] = a01; + a[6] = a[9]; + a[7] = a[13]; + a[8] = a02; + a[9] = a12; + a[11] = a[14]; + a[12] = a03; + a[13] = a13; + a[14] = a23; + + return this; + }, + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix4#invert + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; + return this; + } + + det = 1 / det; + + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix4#adjoint + * @since 3.0.0 + * + * @return {this} This Matrix4. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix4#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix4#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. + * + * @return {this} This Matrix4. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b = src.val; + + // Cache only the current line of the second matrix + var b0 = b[0]; + var b1 = b[1]; + var b2 = b[2]; + var b3 = b[3]; + + a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + + a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + + a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + + a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + + return this; + }, + + /** + * Multiply the values of this Matrix4 by those given in the `src` argument. + * + * @method Phaser.Math.Matrix4#multiplyLocal + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. + * + * @return {this} This Matrix4. + */ + multiplyLocal: function (src) + { + var a = this.val; + var b = src.val; + + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], + + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], + + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], + + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix4#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {this} This Matrix4. + */ + translate: function (v) + { + return this.translateXYZ(v.x, v.y, v.z); + }, + + /** + * Translate this Matrix using the given values. + * + * @method Phaser.Math.Matrix4#translateXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + translateXYZ: function (x, y, z) + { + var a = this.val; + + a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; + a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; + a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; + a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix4#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {this} This Matrix4. + */ + scale: function (v) + { + return this.scaleXYZ(v.x, v.y, v.z); + }, + + /** + * Apply a scale transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#scaleXYZ + * @since 3.16.0 + * + * @param {number} x - The x component. + * @param {number} y - The y component. + * @param {number} z - The z component. + * + * @return {this} This Matrix4. + */ + scaleXYZ: function (x, y, z) + { + var a = this.val; + + a[0] = a[0] * x; + a[1] = a[1] * x; + a[2] = a[2] * x; + a[3] = a[3] * x; + + a[4] = a[4] * y; + a[5] = a[5] * y; + a[6] = a[6] * y; + a[7] = a[7] * y; + + a[8] = a[8] * z; + a[9] = a[9] * z; + a[10] = a[10] * z; + a[11] = a[11] * z; + + return this; + }, + + /** + * Derive a rotation matrix around the given axis. + * + * @method Phaser.Math.Matrix4#makeRotationAxis + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. + * @param {number} angle - The rotation angle in radians. + * + * @return {this} This Matrix4. + */ + makeRotationAxis: function (axis, angle) + { + // Based on http://www.gamedev.net/reference/articles/article1199.asp + + var c = Math.cos(angle); + var s = Math.sin(angle); + var t = 1 - c; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var tx = t * x; + var ty = t * y; + + return this.setValues( + tx * x + c, tx * y - s * z, tx * z + s * y, 0, + tx * y + s * z, ty * y + c, ty * z - s * x, 0, + tx * z - s * y, ty * z + s * x, t * z * z + c, 0, + 0, 0, 0, 1 + ); + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix4#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. + * + * @return {this} This Matrix4. + */ + rotate: function (rad, axis) + { + var a = this.val; + var x = axis.x; + var y = axis.y; + var z = axis.z; + var len = Math.sqrt(x * x + y * y + z * z); + + if (Math.abs(len) < EPSILON) + { + return this; + } + + len = 1 / len; + x *= len; + y *= len; + z *= len; + + var s = Math.sin(rad); + var c = Math.cos(rad); + var t = 1 - c; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix + var b00 = x * x * t + c; + var b01 = y * x * t + z * s; + var b02 = z * x * t - y * s; + + var b10 = x * y * t - z * s; + var b11 = y * y * t + c; + var b12 = z * y * t + x * s; + + var b20 = x * z * t + y * s; + var b21 = y * z * t - x * s; + var b22 = z * z * t + c; + + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); + }, + + /** + * Rotate this matrix on its X axis. + * + * @method Phaser.Math.Matrix4#rotateX + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {this} This Matrix4. + */ + rotateX: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[4] = a10 * c + a20 * s; + a[5] = a11 * c + a21 * s; + a[6] = a12 * c + a22 * s; + a[7] = a13 * c + a23 * s; + a[8] = a20 * c - a10 * s; + a[9] = a21 * c - a11 * s; + a[10] = a22 * c - a12 * s; + a[11] = a23 * c - a13 * s; + + return this; + }, + + /** + * Rotate this matrix on its Y axis. + * + * @method Phaser.Math.Matrix4#rotateY + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateY: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c - a20 * s; + a[1] = a01 * c - a21 * s; + a[2] = a02 * c - a22 * s; + a[3] = a03 * c - a23 * s; + a[8] = a00 * s + a20 * c; + a[9] = a01 * s + a21 * c; + a[10] = a02 * s + a22 * c; + a[11] = a03 * s + a23 * c; + + return this; + }, + + /** + * Rotate this matrix on its Z axis. + * + * @method Phaser.Math.Matrix4#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The angle to rotate by, in radians. + * + * @return {this} This Matrix4. + */ + rotateZ: function (rad) + { + var a = this.val; + var s = Math.sin(rad); + var c = Math.cos(rad); + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + // Perform axis-specific matrix multiplication + a[0] = a00 * c + a10 * s; + a[1] = a01 * c + a11 * s; + a[2] = a02 * c + a12 * s; + a[3] = a03 * c + a13 * s; + a[4] = a10 * c - a00 * s; + a[5] = a11 * c - a01 * s; + a[6] = a12 * c - a02 * s; + a[7] = a13 * c - a03 * s; + + return this; + }, + + /** + * Set the values of this Matrix from the given rotation Quaternion and translation Vector. + * + * @method Phaser.Math.Matrix4#fromRotationTranslation + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. + * @param {Phaser.Math.Vector3} v - The Vector to set translation from. + * + * @return {this} This Matrix4. + */ + fromRotationTranslation: function (q, v) + { + // Quaternion math + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + v.x, + v.y, + v.z, + 1 + ); + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix4#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {this} This Matrix4. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, + + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, + + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, + + 0, + 0, + 0, + 1 + ); + }, + + /** + * Generate a frustum matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#frustum + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + frustum: function (left, right, bottom, top, near, far) + { + var rl = 1 / (right - left); + var tb = 1 / (top - bottom); + var nf = 1 / (near - far); + + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, + + 0, + (near * 2) * tb, + 0, + 0, + + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, + + 0, + 0, + (far * near * 2) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspective + * @since 3.0.0 + * + * @param {number} fovy - Vertical field of view in radians + * @param {number} aspect - Aspect ratio. Typically viewport width /height. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspective: function (fovy, aspect, near, far) + { + var f = 1.0 / Math.tan(fovy / 2); + var nf = 1 / (near - far); + + return this.setValues( + f / aspect, + 0, + 0, + 0, + + 0, + f, + 0, + 0, + + 0, + 0, + (far + near) * nf, + -1, + + 0, + 0, + (2 * far * near) * nf, + 0 + ); + }, + + /** + * Generate a perspective projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#perspectiveLH + * @since 3.0.0 + * + * @param {number} width - The width of the frustum. + * @param {number} height - The height of the frustum. + * @param {number} near - Near bound of the frustum. + * @param {number} far - Far bound of the frustum. + * + * @return {this} This Matrix4. + */ + perspectiveLH: function (width, height, near, far) + { + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, + + 0, + (2 * near) / height, + 0, + 0, + + 0, + 0, + -far / (near - far), + 1, + + 0, + 0, + (near * far) / (near - far), + 0 + ); + }, + + /** + * Generate an orthogonal projection matrix with the given bounds. + * + * @method Phaser.Math.Matrix4#ortho + * @since 3.0.0 + * + * @param {number} left - The left bound of the frustum. + * @param {number} right - The right bound of the frustum. + * @param {number} bottom - The bottom bound of the frustum. + * @param {number} top - The top bound of the frustum. + * @param {number} near - The near bound of the frustum. + * @param {number} far - The far bound of the frustum. + * + * @return {this} This Matrix4. + */ + ortho: function (left, right, bottom, top, near, far) + { + var lr = left - right; + var bt = bottom - top; + var nf = near - far; + + // Avoid division by zero + lr = (lr === 0) ? lr : 1 / lr; + bt = (bt === 0) ? bt : 1 / bt; + nf = (nf === 0) ? nf : 1 / nf; + + return this.setValues( + -2 * lr, + 0, + 0, + 0, + + 0, + -2 * bt, + 0, + 0, + + 0, + 0, + 2 * nf, + 0, + + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; + + return this; + }, + + /** + * Generate a look-at matrix with the given eye position, focal point, and up axis. + * + * @method Phaser.Math.Matrix4#lookAt + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer + * @param {Phaser.Math.Vector3} center - Point the viewer is looking at + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAt: function (eye, center, up) + { + var eyex = eye.x; + var eyey = eye.y; + var eyez = eye.z; + + var upx = up.x; + var upy = up.y; + var upz = up.z; + + var centerx = center.x; + var centery = center.y; + var centerz = center.z; + + if (Math.abs(eyex - centerx) < EPSILON && + Math.abs(eyey - centery) < EPSILON && + Math.abs(eyez - centerz) < EPSILON) + { + return this.identity(); + } + + var z0 = eyex - centerx; + var z1 = eyey - centery; + var z2 = eyez - centerz; + + var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); + + z0 *= len; + z1 *= len; + z2 *= len; + + var x0 = upy * z2 - upz * z1; + var x1 = upz * z0 - upx * z2; + var x2 = upx * z1 - upy * z0; + + len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); + + if (!len) + { + x0 = 0; + x1 = 0; + x2 = 0; } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; + len = 1 / len; + x0 *= len; + x1 *= len; + x2 *= len; } - return this; - }, + var y0 = z1 * x2 - z2 * x1; + var y1 = z2 * x0 - z0 * x2; + var y2 = z0 * x1 - z1 * x0; - /** - * Add a given Vector to this Vector. Addition is component-wise. - * - * @method Phaser.Math.Vector3#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to add to this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z || 0; + len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - return this; - }, - - /** - * Subtract the given Vector from this Vector. Subtraction is component-wise. - * - * @method Phaser.Math.Vector3#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to subtract from this Vector. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z || 0; - - return this; - }, - - /** - * Perform a component-wise multiplication between this Vector and the given Vector. - * - * Multiplies this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to multiply this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - multiply: function (v) - { - this.x *= v.x; - this.y *= v.y; - this.z *= v.z || 1; - - return this; - }, - - /** - * Scale this Vector by the given value. - * - * @method Phaser.Math.Vector3#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Vector by. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - scale: function (scale) - { - if (isFinite(scale)) + if (!len) { - this.x *= scale; - this.y *= scale; - this.z *= scale; + y0 = 0; + y1 = 0; + y2 = 0; } else { - this.x = 0; - this.y = 0; - this.z = 0; + len = 1 / len; + y0 *= len; + y1 *= len; + y2 *= len; } - return this; + return this.setValues( + x0, + y0, + z0, + 0, + + x1, + y1, + z1, + 0, + + x2, + y2, + z2, + 0, + + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); }, /** - * Perform a component-wise division between this Vector and the given Vector. + * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. * - * Divides this Vector by the given Vector. - * - * @method Phaser.Math.Vector3#divide + * @method Phaser.Math.Matrix4#yawPitchRoll * @since 3.0.0 * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to divide this Vector by. + * @param {number} yaw - The yaw value. + * @param {number} pitch - The pitch value. + * @param {number} roll - The roll value. * - * @return {Phaser.Math.Vector3} This Vector3. + * @return {this} This Matrix4. */ - divide: function (v) + yawPitchRoll: function (yaw, pitch, roll) { - this.x /= v.x; - this.y /= v.y; - this.z /= v.z || 1; + this.zero(); + _tempMat1.zero(); + _tempMat2.zero(); + + var m0 = this.val; + var m1 = _tempMat1.val; + var m2 = _tempMat2.val; + + // Rotate Z + var s = Math.sin(roll); + var c = Math.cos(roll); + + m0[10] = 1; + m0[15] = 1; + m0[0] = c; + m0[1] = s; + m0[4] = -s; + m0[5] = c; + + // Rotate X + s = Math.sin(pitch); + c = Math.cos(pitch); + + m1[0] = 1; + m1[15] = 1; + m1[5] = c; + m1[10] = c; + m1[9] = -s; + m1[6] = s; + + // Rotate Y + s = Math.sin(yaw); + c = Math.cos(yaw); + + m2[5] = 1; + m2[15] = 1; + m2[0] = c; + m2[2] = -s; + m2[8] = s; + m2[10] = c; + + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); return this; }, /** - * Negate the `x`, `y` and `z` components of this Vector. + * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. * - * @method Phaser.Math.Vector3#negate + * @method Phaser.Math.Matrix4#setWorldMatrix * @since 3.0.0 * - * @return {Phaser.Math.Vector3} This Vector3. + * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. + * @param {Phaser.Math.Vector3} position - The position of the world matrix. + * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. + * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. + * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. + * + * @return {this} This Matrix4. */ - negate: function () + setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; + this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - return this; - }, + _tempMat1.scaling(scale.x, scale.y, scale.z); + _tempMat2.xyz(position.x, position.y, position.z); - /** - * Calculate the distance between this Vector and the given Vector. - * - * @method Phaser.Math.Vector3#distance - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector. - */ - distance: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; + this.multiplyLocal(_tempMat1); + this.multiplyLocal(_tempMat2); - return Math.sqrt(dx * dx + dy * dy + dz * dz); - }, - - /** - * Calculate the distance between this Vector and the given Vector, squared. - * - * @method Phaser.Math.Vector3#distanceSq - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3)} v - The Vector to calculate the distance to. - * - * @return {number} The distance from this Vector to the given Vector, squared. - */ - distanceSq: function (v) - { - var dx = v.x - this.x; - var dy = v.y - this.y; - var dz = v.z - this.z || 0; - - return dx * dx + dy * dy + dz * dz; - }, - - /** - * Calculate the length (or magnitude) of this Vector. - * - * @method Phaser.Math.Vector3#length - * @since 3.0.0 - * - * @return {number} The length of this Vector. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return Math.sqrt(x * x + y * y + z * z); - }, - - /** - * Calculate the length of this Vector squared. - * - * @method Phaser.Math.Vector3#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Vector, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - return x * x + y * y + z * z; - }, - - /** - * Normalize this Vector. - * - * Makes the vector a unit length vector (magnitude of 1) in the same direction. - * - * @method Phaser.Math.Vector3#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var len = x * x + y * y + z * z; - - if (len > 0) + if (viewMatrix) { - len = 1 / Math.sqrt(len); + this.multiplyLocal(viewMatrix); + } - this.x = x * len; - this.y = y * len; - this.z = z * len; + if (projectionMatrix) + { + this.multiplyLocal(projectionMatrix); } return this; }, /** - * Calculate the dot product of this Vector and the given Vector. + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. * - * @method Phaser.Math.Vector3#dot - * @since 3.0.0 + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 * - * @param {Phaser.Math.Vector3} v - The Vector3 to dot product with this Vector3. + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. * - * @return {number} The dot product of this Vector and `v`. + * @return {Phaser.Math.Matrix4} This `out` Matrix4. */ - dot: function (v) + multiplyToMat4: function (src, out) { - return this.x * v.x + this.y * v.y + this.z * v.z; + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); }, /** - * Calculate the cross (vector) product of this Vector (which will be modified) and the given Vector. + * Takes the rotation and position vectors and builds this Matrix4 from them. * - * @method Phaser.Math.Vector3#cross - * @since 3.0.0 + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 * - * @param {Phaser.Math.Vector3} v - The Vector to cross product with. + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) * - * @return {Phaser.Math.Vector3} This Vector3. + * @return {this} This Matrix4. */ - cross: function (v) + fromRotationXYTranslation: function (rotation, position, translateFirst) { - var ax = this.x; - var ay = this.y; - var az = this.z; - var bx = v.x; - var by = v.y; - var bz = v.z; + var x = position.x; + var y = position.y; + var z = position.z; - this.x = ay * bz - az * by; - this.y = az * bx - ax * bz; - this.z = ax * by - ay * bx; + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); - return this; + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); }, /** - * Linearly interpolate between this Vector and the given Vector. + * Returns the maximum axis scale from this Matrix4. * - * Interpolates this Vector towards the given Vector. + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 * - * @method Phaser.Math.Vector3#lerp - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} v - The Vector3 to interpolate towards. - * @param {number} [t=0] - The interpolation percentage, between 0 and 1. - * - * @return {Phaser.Math.Vector3} This Vector3. + * @return {number} The maximum axis scale. */ - lerp: function (v, t) + getMaxScaleOnAxis: function () { - if (t === undefined) { t = 0; } + var m = this.val; - var ax = this.x; - var ay = this.y; - var az = this.z; + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix3 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat3: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = x * m[0] + y * m[3] + z * m[6]; - this.y = x * m[1] + y * m[4] + z * m[7]; - this.z = x * m[2] + y * m[5] + z * m[8]; - - return this; - }, - - /** - * Transform this Vector with the given Matrix. - * - * @method Phaser.Math.Vector3#transformMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformMat4: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - this.x = m[0] * x + m[4] * y + m[8] * z + m[12]; - this.y = m[1] * x + m[5] * y + m[9] * z + m[13]; - this.z = m[2] * x + m[6] * y + m[10] * z + m[14]; - - return this; - }, - - /** - * Transforms the coordinates of this Vector3 with the given Matrix4. - * - * @method Phaser.Math.Vector3#transformCoordinates - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to transform this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformCoordinates: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; - var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; - var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; - var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; - - this.x = tx / tw; - this.y = ty / tw; - this.z = tz / tw; - - return this; - }, - - /** - * Transform this Vector with the given Quaternion. - * - * @method Phaser.Math.Vector3#transformQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to transform this Vector with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - transformQuat: function (q) - { - // benchmarks: http://jsperf.com/quaternion-transform-vec3-implementations - var x = this.x; - var y = this.y; - var z = this.z; - var qx = q.x; - var qy = q.y; - var qz = q.z; - var qw = q.w; - - // calculate quat * vec - var ix = qw * x + qy * z - qz * y; - var iy = qw * y + qz * x - qx * z; - var iz = qw * z + qx * y - qy * x; - var iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return this; - }, - - /** - * Multiplies this Vector3 by the specified matrix, applying a W divide. This is useful for projection, - * e.g. unprojecting a 2D point into 3D space. - * - * @method Phaser.Math.Vector3#project - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} mat - The Matrix4 to multiply this Vector3 with. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - project: function (mat) - { - var x = this.x; - var y = this.y; - var z = this.z; - var m = mat.val; - - var a00 = m[0]; - var a01 = m[1]; - var a02 = m[2]; - var a03 = m[3]; - var a10 = m[4]; - var a11 = m[5]; - var a12 = m[6]; - var a13 = m[7]; - var a20 = m[8]; - var a21 = m[9]; - var a22 = m[10]; - var a23 = m[11]; - var a30 = m[12]; - var a31 = m[13]; - var a32 = m[14]; - var a33 = m[15]; - - var lw = 1 / (x * a03 + y * a13 + z * a23 + a33); - - this.x = (x * a00 + y * a10 + z * a20 + a30) * lw; - this.y = (x * a01 + y * a11 + z * a21 + a31) * lw; - this.z = (x * a02 + y * a12 + z * a22 + a32) * lw; - - return this; - }, - - /** - * Unproject this point from 2D space to 3D space. - * The point should have its x and y properties set to - * 2D screen space, and the z either at 0 (near plane) - * or 1 (far plane). The provided matrix is assumed to already - * be combined, i.e. projection * view * model. - * - * After this operation, this vector's (x, y, z) components will - * represent the unprojected 3D coordinate. - * - * @method Phaser.Math.Vector3#unproject - * @since 3.0.0 - * - * @param {Phaser.Math.Vector4} viewport - Screen x, y, width and height in pixels. - * @param {Phaser.Math.Matrix4} invProjectionView - Combined projection and view matrix. - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - unproject: function (viewport, invProjectionView) - { - var viewX = viewport.x; - var viewY = viewport.y; - var viewWidth = viewport.z; - var viewHeight = viewport.w; - - var x = this.x - viewX; - var y = (viewHeight - this.y - 1) - viewY; - var z = this.z; - - this.x = (2 * x) / viewWidth - 1; - this.y = (2 * y) / viewHeight - 1; - this.z = 2 * z - 1; - - return this.project(invProjectionView); - }, - - /** - * Make this Vector the zero vector (0, 0, 0). - * - * @method Phaser.Math.Vector3#reset - * @since 3.0.0 - * - * @return {Phaser.Math.Vector3} This Vector3. - */ - reset: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - - return this; + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); } }); /** - * A static zero Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ZERO - * @type {Phaser.Math.Vector3} - * @since 3.16.0 + * @ignore */ -Vector3.ZERO = new Vector3(); +var _tempMat1 = new Matrix4(); /** - * A static right Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.RIGHT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 + * @ignore */ -Vector3.RIGHT = new Vector3(1, 0, 0); +var _tempMat2 = new Matrix4(); /** - * A static left Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.LEFT - * @type {Phaser.Math.Vector3} - * @since 3.16.0 + * @ignore */ -Vector3.LEFT = new Vector3(-1, 0, 0); +var _x = new Vector3(); /** - * A static up Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.UP - * @type {Phaser.Math.Vector3} - * @since 3.16.0 + * @ignore */ -Vector3.UP = new Vector3(0, -1, 0); +var _y = new Vector3(); /** - * A static down Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.DOWN - * @type {Phaser.Math.Vector3} - * @since 3.16.0 + * @ignore */ -Vector3.DOWN = new Vector3(0, 1, 0); +var _z = new Vector3(); -/** - * A static forward Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.FORWARD - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.FORWARD = new Vector3(0, 0, 1); - -/** - * A static back Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.BACK - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.BACK = new Vector3(0, 0, -1); - -/** - * A static one Vector3 for use by reference. - * - * This constant is meant for comparison operations and should not be modified directly. - * - * @constant - * @name Phaser.Math.Vector3.ONE - * @type {Phaser.Math.Vector3} - * @since 3.16.0 - */ -Vector3.ONE = new Vector3(1, 1, 1); - -module.exports = Vector3; +module.exports = Matrix4; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = __webpack_require__(3); + +/** + * Convert the given angle in radians, to the equivalent angle in degrees. + * + * @function Phaser.Math.RadToDeg + * @since 3.0.0 + * + * @param {number} radians - The angle in radians to convert ot degrees. + * + * @return {integer} The given angle converted to degrees. + */ +var RadToDeg = function (radians) +{ + return radians * CONST.RAD_TO_DEG; +}; + +module.exports = RadToDeg; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -3172,9 +5215,9 @@ module.exports = Vector3; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); +var CONST = __webpack_require__(12); var Events = __webpack_require__(202); -var GetFastValue = __webpack_require__(9); +var GetFastValue = __webpack_require__(8); var GetURL = __webpack_require__(213); var MergeXHRSettings = __webpack_require__(44); var XHRLoader = __webpack_require__(214); @@ -3244,7 +5287,18 @@ var File = new Class({ if (!this.type || !this.key) { - throw new Error('Error calling \'Loader.' + this.type + '\' invalid key provided.'); + throw new Error('Invalid Loader.' + this.type + ' key'); + } + + var url = GetFastValue(fileConfig, 'url'); + + if (url === undefined) + { + url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); + } + else if (typeof url === 'string' && !url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)) + { + url = loader.path + url; } /** @@ -3258,16 +5312,7 @@ var File = new Class({ * @type {object|string} * @since 3.0.0 */ - this.url = GetFastValue(fileConfig, 'url'); - - if (this.url === undefined) - { - this.url = loader.path + loadKey + '.' + GetFastValue(fileConfig, 'extension', ''); - } - else if (typeof this.url === 'string' && this.url.indexOf('blob:') !== 0 && this.url.indexOf('data:') !== 0) - { - this.url = loader.path + this.url; - } + this.url = url; /** * The final URL this file will load from, including baseURL and path. @@ -3710,7 +5755,7 @@ module.exports = File; /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports) { /** @@ -3778,102 +5823,8 @@ var FileTypesManager = { module.exports = FileTypesManager; -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.GameObjects.Events - */ - -module.exports = { - - ADDED_TO_SCENE: __webpack_require__(225), - DESTROY: __webpack_require__(226), - REMOVED_FROM_SCENE: __webpack_require__(227), - VIDEO_COMPLETE: __webpack_require__(228), - VIDEO_CREATED: __webpack_require__(229), - VIDEO_ERROR: __webpack_require__(230), - VIDEO_LOOP: __webpack_require__(231), - VIDEO_PLAY: __webpack_require__(232), - VIDEO_SEEKED: __webpack_require__(233), - VIDEO_SEEKING: __webpack_require__(234), - VIDEO_STOP: __webpack_require__(235), - VIDEO_TIMEOUT: __webpack_require__(236), - VIDEO_UNLOCKED: __webpack_require__(237) - -}; - - /***/ }), /* 23 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Checks if an array can be used as a matrix. - * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: - * - * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] - * ``` - * - * @function Phaser.Utils.Array.Matrix.CheckMatrix - * @since 3.0.0 - * - * @generic T - * @genericUse {T[][]} - [matrix] - * - * @param {T[][]} [matrix] - The array to check. - * - * @return {boolean} `true` if the given `matrix` array is a valid matrix. - */ -var CheckMatrix = function (matrix) -{ - if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0])) - { - return false; - } - - // How long is the first row? - var size = matrix[0].length; - - // Validate the rest of the rows are the same length - for (var i = 1; i < matrix.length; i++) - { - if (matrix[i].length !== size) - { - return false; - } - } - - return true; -}; - -module.exports = CheckMatrix; - - -/***/ }), -/* 24 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -3883,5267 +5834,8 @@ module.exports = CheckMatrix; */ var Class = __webpack_require__(0); -var Contains = __webpack_require__(312); -var GetPoint = __webpack_require__(60); -var GetPoints = __webpack_require__(313); -var GEOM_CONST = __webpack_require__(25); -var Line = __webpack_require__(314); -var Random = __webpack_require__(319); - -/** - * @classdesc - * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) - * - * @class Rectangle - * @memberof Phaser.Geom - * @constructor - * @since 3.0.0 - * - * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. - * @param {number} [width=0] - The width of the Rectangle. - * @param {number} [height=0] - The height of the Rectangle. - */ -var Rectangle = new Class({ - - initialize: - - function Rectangle (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = 0; } - if (height === undefined) { height = 0; } - - /** - * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. - * Used for fast type comparisons. - * - * @name Phaser.Geom.Rectangle#type - * @type {integer} - * @readonly - * @since 3.19.0 - */ - this.type = GEOM_CONST.RECTANGLE; - - /** - * The X coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.x = x; - - /** - * The Y coordinate of the top left corner of the Rectangle. - * - * @name Phaser.Geom.Rectangle#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.y = y; - - /** - * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. - * - * @name Phaser.Geom.Rectangle#width - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.width = width; - - /** - * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. - * - * @name Phaser.Geom.Rectangle#height - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.height = height; - }, - - /** - * Checks if the given point is inside the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#contains - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the point to check. - * @param {number} y - The Y coordinate of the point to check. - * - * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. - */ - contains: function (x, y) - { - return Contains(this, x, y); - }, - - /** - * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. - * - * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. - * - * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. - * - * @method Phaser.Geom.Rectangle#getPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [output,$return] - * - * @param {number} position - The normalized distance into the Rectangle's perimeter to return. - * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. - * - * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. - */ - getPoint: function (position, output) - { - return GetPoint(this, position, output); - }, - - /** - * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. - * - * @method Phaser.Geom.Rectangle#getPoints - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point[]} O - [output,$return] - * - * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. - * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. - * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. - * - * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. - */ - getPoints: function (quantity, stepRate, output) - { - return GetPoints(this, quantity, stepRate, output); - }, - - /** - * Returns a random point within the Rectangle's bounds. - * - * @method Phaser.Geom.Rectangle#getRandomPoint - * @since 3.0.0 - * - * @generic {Phaser.Geom.Point} O - [point,$return] - * - * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. - * - * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. - */ - getRandomPoint: function (point) - { - return Random(this, point); - }, - - /** - * Sets the position, width, and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setTo - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} y - The Y coordinate of the top left corner of the Rectangle. - * @param {number} width - The width of the Rectangle. - * @param {number} height - The height of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setTo: function (x, y, width, height) - { - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - return this; - }, - - /** - * Resets the position, width, and height of the Rectangle to 0. - * - * @method Phaser.Geom.Rectangle#setEmpty - * @since 3.0.0 - * - * @return {this} This Rectangle object. - */ - setEmpty: function () - { - return this.setTo(0, 0, 0, 0); - }, - - /** - * Sets the position of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setPosition - * @since 3.0.0 - * - * @param {number} x - The X coordinate of the top left corner of the Rectangle. - * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. - * - * @return {this} This Rectangle object. - */ - setPosition: function (x, y) - { - if (y === undefined) { y = x; } - - this.x = x; - this.y = y; - - return this; - }, - - /** - * Sets the width and height of the Rectangle. - * - * @method Phaser.Geom.Rectangle#setSize - * @since 3.0.0 - * - * @param {number} width - The width to set the Rectangle to. - * @param {number} [height=width] - The height to set the Rectangle to. - * - * @return {this} This Rectangle object. - */ - setSize: function (width, height) - { - if (height === undefined) { height = width; } - - this.width = width; - this.height = height; - - return this; - }, - - /** - * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. - * - * @method Phaser.Geom.Rectangle#isEmpty - * @since 3.0.0 - * - * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. - */ - isEmpty: function () - { - return (this.width <= 0 || this.height <= 0); - }, - - /** - * Returns a Line object that corresponds to the top of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineA - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. - */ - getLineA: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.y, this.right, this.y); - - return line; - }, - - /** - * Returns a Line object that corresponds to the right of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineB - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. - */ - getLineB: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.y, this.right, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the bottom of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineC - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. - */ - getLineC: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.right, this.bottom, this.x, this.bottom); - - return line; - }, - - /** - * Returns a Line object that corresponds to the left of this Rectangle. - * - * @method Phaser.Geom.Rectangle#getLineD - * @since 3.0.0 - * - * @generic {Phaser.Geom.Line} O - [line,$return] - * - * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. - * - * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. - */ - getLineD: function (line) - { - if (line === undefined) { line = new Line(); } - - line.setTo(this.x, this.bottom, this.x, this.y); - - return line; - }, - - /** - * The x coordinate of the left of the Rectangle. - * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. - * - * @name Phaser.Geom.Rectangle#left - * @type {number} - * @since 3.0.0 - */ - left: { - - get: function () - { - return this.x; - }, - - set: function (value) - { - if (value >= this.right) - { - this.width = 0; - } - else - { - this.width = this.right - value; - } - - this.x = value; - } - - }, - - /** - * The sum of the x and width properties. - * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. - * - * @name Phaser.Geom.Rectangle#right - * @type {number} - * @since 3.0.0 - */ - right: { - - get: function () - { - return this.x + this.width; - }, - - set: function (value) - { - if (value <= this.x) - { - this.width = 0; - } - else - { - this.width = value - this.x; - } - } - - }, - - /** - * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. - * However it does affect the height property, whereas changing the y value does not affect the height property. - * - * @name Phaser.Geom.Rectangle#top - * @type {number} - * @since 3.0.0 - */ - top: { - - get: function () - { - return this.y; - }, - - set: function (value) - { - if (value >= this.bottom) - { - this.height = 0; - } - else - { - this.height = (this.bottom - value); - } - - this.y = value; - } - - }, - - /** - * The sum of the y and height properties. - * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. - * - * @name Phaser.Geom.Rectangle#bottom - * @type {number} - * @since 3.0.0 - */ - bottom: { - - get: function () - { - return this.y + this.height; - }, - - set: function (value) - { - if (value <= this.y) - { - this.height = 0; - } - else - { - this.height = value - this.y; - } - } - - }, - - /** - * The x coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerX - * @type {number} - * @since 3.0.0 - */ - centerX: { - - get: function () - { - return this.x + (this.width / 2); - }, - - set: function (value) - { - this.x = value - (this.width / 2); - } - - }, - - /** - * The y coordinate of the center of the Rectangle. - * - * @name Phaser.Geom.Rectangle#centerY - * @type {number} - * @since 3.0.0 - */ - centerY: { - - get: function () - { - return this.y + (this.height / 2); - }, - - set: function (value) - { - this.y = value - (this.height / 2); - } - - } - -}); - -module.exports = Rectangle; - - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var GEOM_CONST = { - - /** - * A Circle Geometry object type. - * - * @name Phaser.Geom.CIRCLE - * @type {integer} - * @since 3.19.0 - */ - CIRCLE: 0, - - /** - * An Ellipse Geometry object type. - * - * @name Phaser.Geom.ELLIPSE - * @type {integer} - * @since 3.19.0 - */ - ELLIPSE: 1, - - /** - * A Line Geometry object type. - * - * @name Phaser.Geom.LINE - * @type {integer} - * @since 3.19.0 - */ - LINE: 2, - - /** - * A Point Geometry object type. - * - * @name Phaser.Geom.POINT - * @type {integer} - * @since 3.19.0 - */ - POINT: 3, - - /** - * A Polygon Geometry object type. - * - * @name Phaser.Geom.POLYGON - * @type {integer} - * @since 3.19.0 - */ - POLYGON: 4, - - /** - * A Rectangle Geometry object type. - * - * @name Phaser.Geom.RECTANGLE - * @type {integer} - * @since 3.19.0 - */ - RECTANGLE: 5, - - /** - * A Triangle Geometry object type. - * - * @name Phaser.Geom.TRIANGLE - * @type {integer} - * @since 3.19.0 - */ - TRIANGLE: 6 - -}; - -module.exports = GEOM_CONST; - - -/***/ }), -/* 26 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var IsPlainObject = __webpack_require__(7); - -// @param {boolean} deep - Perform a deep copy? -// @param {object} target - The target object to copy to. -// @return {object} The extended object. - -/** - * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ - * - * @function Phaser.Utils.Objects.Extend - * @since 3.0.0 - * - * @param {...*} [args] - The objects that will be mixed. - * - * @return {object} The extended object. - */ -var Extend = function () -{ - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if (typeof target === 'boolean') - { - deep = target; - target = arguments[1] || {}; - - // skip the boolean and the target - i = 2; - } - - // extend Phaser if only one argument is passed - if (length === i) - { - target = this; - --i; - } - - for (; i < length; i++) - { - // Only deal with non-null/undefined values - if ((options = arguments[i]) != null) - { - // Extend the base object - for (name in options) - { - src = target[name]; - copy = options[name]; - - // Prevent never-ending loop - if (target === copy) - { - continue; - } - - // Recurse if we're merging plain objects or arrays - if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) - { - if (copyIsArray) - { - copyIsArray = false; - clone = src && Array.isArray(src) ? src : []; - } - else - { - clone = src && IsPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[name] = Extend(deep, clone, copy); - - // Don't bring in undefined values - } - else if (copy !== undefined) - { - target[name] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -module.exports = Extend; - - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Find the angle of a segment from (x1, y1) -> (x2, y2). - * - * @function Phaser.Math.Angle.Between - * @since 3.0.0 - * - * @param {number} x1 - The x coordinate of the first point. - * @param {number} y1 - The y coordinate of the first point. - * @param {number} x2 - The x coordinate of the second point. - * @param {number} y2 - The y coordinate of the second point. - * - * @return {number} The angle in radians. - */ -var Between = function (x1, y1, x2, y2) -{ - return Math.atan2(y2 - y1, x2 - x1); -}; - -module.exports = Between; - - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Normalize an angle to the [0, 2pi] range. - * - * @function Phaser.Math.Angle.Normalize - * @since 3.0.0 - * - * @param {number} angle - The angle to normalize, in radians. - * - * @return {number} The normalized angle, in radians. - */ -var Normalize = function (angle) -{ - angle = angle % (2 * Math.PI); - - if (angle >= 0) - { - return angle; - } - else - { - return angle + 2 * Math.PI; - } -}; - -module.exports = Normalize; - - -/***/ }), -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MathWrap = __webpack_require__(8); - -/** - * Wrap an angle. - * - * Wraps the angle to a value in the range of -PI to PI. - * - * @function Phaser.Math.Angle.Wrap - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in radians. - * - * @return {number} The wrapped angle, in radians. - */ -var Wrap = function (angle) -{ - return MathWrap(angle, -Math.PI, Math.PI); -}; - -module.exports = Wrap; - - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Wrap = __webpack_require__(8); - -/** - * Wrap an angle in degrees. - * - * Wraps the angle to a value in the range of -180 to 180. - * - * @function Phaser.Math.Angle.WrapDegrees - * @since 3.0.0 - * - * @param {number} angle - The angle to wrap, in degrees. - * - * @return {number} The wrapped angle, in degrees. - */ -var WrapDegrees = function (angle) -{ - return Wrap(angle, -180, 180); -}; - -module.exports = WrapDegrees; - - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Check whether the given values are fuzzily equal. - * - * Two numbers are fuzzily equal if their difference is less than `epsilon`. - * - * @function Phaser.Math.Fuzzy.Equal - * @since 3.0.0 - * - * @param {number} a - The first value. - * @param {number} b - The second value. - * @param {number} [epsilon=0.0001] - The epsilon. - * - * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. - */ -var Equal = function (a, b, epsilon) -{ - if (epsilon === undefined) { epsilon = 0.0001; } - - return Math.abs(a - b) < epsilon; -}; - -module.exports = Equal; - - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Factorial = __webpack_require__(33); - -/** - * Calculates the Bernstein basis from the three factorial coefficients. - * - * @function Phaser.Math.Bernstein - * @since 3.0.0 - * - * @param {number} n - The first value. - * @param {number} i - The second value. - * - * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) - */ -var Bernstein = function (n, i) -{ - return Factorial(n) / Factorial(i) / Factorial(n - i); -}; - -module.exports = Bernstein; - - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates the factorial of a given number for integer values greater than 0. - * - * @function Phaser.Math.Factorial - * @since 3.0.0 - * - * @param {number} value - A positive integer to calculate the factorial of. - * - * @return {number} The factorial of the given number. - */ -var Factorial = function (value) -{ - if (value === 0) - { - return 1; - } - - var res = value; - - while (--value) - { - res *= value; - } - - return res; -}; - -module.exports = Factorial; - - -/***/ }), -/* 34 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. - * - * @function Phaser.Math.CatmullRom - * @since 3.0.0 - * - * @param {number} t - The amount to interpolate by. - * @param {number} p0 - The first control point. - * @param {number} p1 - The second control point. - * @param {number} p2 - The third control point. - * @param {number} p3 - The fourth control point. - * - * @return {number} The Catmull-Rom value. - */ -var CatmullRom = function (t, p0, p1, p2, p3) -{ - var v0 = (p2 - p0) * 0.5; - var v1 = (p3 - p1) * 0.5; - var t2 = t * t; - var t3 = t * t2; - - return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; -}; - -module.exports = CatmullRom; - - -/***/ }), -/* 35 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculates a linear (interpolation) value over t. - * - * @function Phaser.Math.Linear - * @since 3.0.0 - * - * @param {number} p0 - The first point. - * @param {number} p1 - The second point. - * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. - * - * @return {number} The step t% of the way between p0 and p1. - */ -var Linear = function (p0, p1, t) -{ - return (p1 - p0) * t + p0; -}; - -module.exports = Linear; - - -/***/ }), -/* 36 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smooth interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * @function Phaser.Math.SmoothStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmoothStep = function (x, min, max) -{ - if (x <= min) - { - return 0; - } - - if (x >= max) - { - return 1; - } - - x = (x - min) / (max - min); - - return x * x * (3 - 2 * x); -}; - -module.exports = SmoothStep; - - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Calculate a smoother interpolation percentage of `x` between `min` and `max`. - * - * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, - * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, - * between 0 and 1 otherwise. - * - * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. - * - * @function Phaser.Math.SmootherStep - * @since 3.0.0 - * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} - * - * @param {number} x - The input value. - * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. - * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. - * - * @return {number} The percentage of interpolation, between 0 and 1. - */ -var SmootherStep = function (x, min, max) -{ - x = Math.max(0, Math.min(1, (x - min) / (max - min))); - - return x * x * x * (x * (x * 6 - 15) + 10); -}; - -module.exports = SmootherStep; - - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. - * - * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). - * - * @function Phaser.Math.RotateAround - * @since 3.0.0 - * - * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] - * - * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. - * @param {number} x - The horizontal coordinate to rotate around. - * @param {number} y - The vertical coordinate to rotate around. - * @param {number} angle - The angle of rotation in radians. - * - * @return {Phaser.Types.Math.Vector2Like} The given point. - */ -var RotateAround = function (point, x, y, angle) -{ - var c = Math.cos(angle); - var s = Math.sin(angle); - - var tx = point.x - x; - var ty = point.y - y; - - point.x = tx * c - ty * s + x; - point.y = tx * s + ty * c + y; - - return point; -}; - -module.exports = RotateAround; - - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. - * - * @function Phaser.Math.RoundAwayFromZero - * @since 3.0.0 - * - * @param {number} value - The number to round. - * - * @return {number} The rounded number, rounded away from zero. - */ -var RoundAwayFromZero = function (value) -{ - // "Opposite" of truncate. - return (value > 0) ? Math.ceil(value) : Math.floor(value); -}; - -module.exports = RoundAwayFromZero; - - -/***/ }), -/* 40 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Vector2 = __webpack_require__(1); - -/** - * Takes the `x` and `y` coordinates and transforms them into the same space as - * defined by the position, rotation and scale values. - * - * @function Phaser.Math.TransformXY - * @since 3.0.0 - * - * @param {number} x - The x coordinate to be transformed. - * @param {number} y - The y coordinate to be transformed. - * @param {number} positionX - Horizontal position of the transform point. - * @param {number} positionY - Vertical position of the transform point. - * @param {number} rotation - Rotation of the transform point, in radians. - * @param {number} scaleX - Horizontal scale of the transform point. - * @param {number} scaleY - Vertical scale of the transform point. - * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. - * - * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. - */ -var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) -{ - if (output === undefined) { output = new Vector2(); } - - var radianSin = Math.sin(rotation); - var radianCos = Math.cos(rotation); - - // Rotate and Scale - var a = radianCos * scaleX; - var b = radianSin * scaleX; - var c = -radianSin * scaleY; - var d = radianCos * scaleY; - - // Invert - var id = 1 / ((a * d) + (c * -b)); - - output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); - output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); - - return output; -}; - -module.exports = TransformXY; - - -/***/ }), -/* 41 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -/** - * @classdesc - * A three-dimensional matrix. - * - * Defaults to the identity matrix when instantiated. - * - * @class Matrix3 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. - */ -var Matrix3 = new Class({ - - initialize: - - function Matrix3 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix3#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(9); - - if (m) - { - // Assume Matrix3 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix3. - * - * @method Phaser.Math.Matrix3#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} A clone of this Matrix3. - */ - clone: function () - { - return new Matrix3(this); - }, - - /** - * This method is an alias for `Matrix3.copy`. - * - * @method Phaser.Math.Matrix3#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix3#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Copy the values of a given Matrix4 into this Matrix3. - * - * @method Phaser.Math.Matrix3#fromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromMat4: function (m) - { - var a = m.val; - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[4]; - out[4] = a[5]; - out[5] = a[6]; - out[6] = a[8]; - out[7] = a[9]; - out[8] = a[10]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix3#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix3#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 1; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix3#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - transpose: function () - { - var a = this.val; - var a01 = a[1]; - var a02 = a[2]; - var a12 = a[5]; - - a[1] = a[3]; - a[2] = a[6]; - a[3] = a01; - a[5] = a[7]; - a[6] = a02; - a[7] = a12; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix3#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b01 = a22 * a11 - a12 * a21; - var b11 = -a22 * a10 + a12 * a20; - var b21 = a21 * a10 - a11 * a20; - - // Calculate the determinant - var det = a00 * b01 + a01 * b11 + a02 * b21; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = b01 * det; - a[1] = (-a22 * a01 + a02 * a21) * det; - a[2] = (a12 * a01 - a02 * a11) * det; - a[3] = b11 * det; - a[4] = (a22 * a00 - a02 * a20) * det; - a[5] = (-a12 * a00 + a02 * a10) * det; - a[6] = b21 * det; - a[7] = (-a21 * a00 + a01 * a20) * det; - a[8] = (a11 * a00 - a01 * a10) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix3#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - a[0] = (a11 * a22 - a12 * a21); - a[1] = (a02 * a21 - a01 * a22); - a[2] = (a01 * a12 - a02 * a11); - a[3] = (a12 * a20 - a10 * a22); - a[4] = (a00 * a22 - a02 * a20); - a[5] = (a02 * a10 - a00 * a12); - a[6] = (a10 * a21 - a11 * a20); - a[7] = (a01 * a20 - a00 * a21); - a[8] = (a00 * a11 - a01 * a10); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix3#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix3#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - var a20 = a[6]; - var a21 = a[7]; - var a22 = a[8]; - - var b = src.val; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b10 = b[3]; - var b11 = b[4]; - var b12 = b[5]; - var b20 = b[6]; - var b21 = b[7]; - var b22 = b[8]; - - a[0] = b00 * a00 + b01 * a10 + b02 * a20; - a[1] = b00 * a01 + b01 * a11 + b02 * a21; - a[2] = b00 * a02 + b01 * a12 + b02 * a22; - - a[3] = b10 * a00 + b11 * a10 + b12 * a20; - a[4] = b10 * a01 + b11 * a11 + b12 * a21; - a[5] = b10 * a02 + b11 * a12 + b12 * a22; - - a[6] = b20 * a00 + b21 * a10 + b22 * a20; - a[7] = b20 * a01 + b21 * a11 + b22 * a21; - a[8] = b20 * a02 + b21 * a12 + b22 * a22; - - return this; - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix3#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - translate: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[6] = x * a[0] + y * a[3] + a[6]; - a[7] = x * a[1] + y * a[4] + a[7]; - a[8] = x * a[2] + y * a[5] + a[8]; - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix3#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - rotate: function (rad) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a10 = a[3]; - var a11 = a[4]; - var a12 = a[5]; - - var s = Math.sin(rad); - var c = Math.cos(rad); - - a[0] = c * a00 + s * a10; - a[1] = c * a01 + s * a11; - a[2] = c * a02 + s * a12; - - a[3] = c * a10 - s * a00; - a[4] = c * a11 - s * a01; - a[5] = c * a12 - s * a02; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x` and `y` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix3#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - scale: function (v) - { - var a = this.val; - var x = v.x; - var y = v.y; - - a[0] = x * a[0]; - a[1] = x * a[1]; - a[2] = x * a[2]; - - a[3] = y * a[3]; - a[4] = y * a[4]; - a[5] = y * a[5]; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix3#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - fromQuat: function (q) - { - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - var out = this.val; - - out[0] = 1 - (yy + zz); - out[3] = xy + wz; - out[6] = xz - wy; - - out[1] = xy - wz; - out[4] = 1 - (xx + zz); - out[7] = yz + wx; - - out[2] = xz + wy; - out[5] = yz - wx; - out[8] = 1 - (xx + yy); - - return this; - }, - - /** - * Set the values of this Matrix3 to be normalized from the given Matrix4. - * - * @method Phaser.Math.Matrix3#normalFromMat4 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. - * - * @return {Phaser.Math.Matrix3} This Matrix3. - */ - normalFromMat4: function (m) - { - var a = m.val; - var out = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - - out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - - out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - - return this; - } - -}); - -module.exports = Matrix3; - - -/***/ }), -/* 42 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); - -var EPSILON = 0.000001; - -/** - * @classdesc - * A four-dimensional matrix. - * - * @class Matrix4 - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} [m] - Optional Matrix4 to copy values from. - */ -var Matrix4 = new Class({ - - initialize: - - function Matrix4 (m) - { - /** - * The matrix values. - * - * @name Phaser.Math.Matrix4#val - * @type {Float32Array} - * @since 3.0.0 - */ - this.val = new Float32Array(16); - - if (m) - { - // Assume Matrix4 with val: - this.copy(m); - } - else - { - // Default to identity - this.identity(); - } - }, - - /** - * Make a clone of this Matrix4. - * - * @method Phaser.Math.Matrix4#clone - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} A clone of this Matrix4. - */ - clone: function () - { - return new Matrix4(this); - }, - - // TODO - Should work with basic values - - /** - * This method is an alias for `Matrix4.copy`. - * - * @method Phaser.Math.Matrix4#set - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - set: function (src) - { - return this.copy(src); - }, - - /** - * Copy the values of a given Matrix into this Matrix. - * - * @method Phaser.Math.Matrix4#copy - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - copy: function (src) - { - var out = this.val; - var a = src.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Set the values of this Matrix from the given array. - * - * @method Phaser.Math.Matrix4#fromArray - * @since 3.0.0 - * - * @param {array} a - The array to copy the values from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromArray: function (a) - { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; - }, - - /** - * Reset this Matrix. - * - * Sets all values to `0`. - * - * @method Phaser.Math.Matrix4#zero - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - zero: function () - { - var out = this.val; - - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; - - return this; - }, - - /** - * Set the `x`, `y` and `z` values of this Matrix. - * - * @method Phaser.Math.Matrix4#xyz - * @since 3.0.0 - * - * @param {number} x - The x value. - * @param {number} y - The y value. - * @param {number} z - The z value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - xyz: function (x, y, z) - { - this.identity(); - - var out = this.val; - - out[12] = x; - out[13] = y; - out[14] = z; - - return this; - }, - - /** - * Set the scaling values of this Matrix. - * - * @method Phaser.Math.Matrix4#scaling - * @since 3.0.0 - * - * @param {number} x - The x scaling value. - * @param {number} y - The y scaling value. - * @param {number} z - The z scaling value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaling: function (x, y, z) - { - this.zero(); - - var out = this.val; - - out[0] = x; - out[5] = y; - out[10] = z; - out[15] = 1; - - return this; - }, - - /** - * Reset this Matrix to an identity (default) matrix. - * - * @method Phaser.Math.Matrix4#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - identity: function () - { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Transpose this Matrix. - * - * @method Phaser.Math.Matrix4#transpose - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - transpose: function () - { - var a = this.val; - - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a12 = a[6]; - var a13 = a[7]; - var a23 = a[11]; - - a[1] = a[4]; - a[2] = a[8]; - a[3] = a[12]; - a[4] = a01; - a[6] = a[9]; - a[7] = a[13]; - a[8] = a02; - a[9] = a12; - a[11] = a[14]; - a[12] = a03; - a[13] = a13; - a[14] = a23; - - return this; - }, - - /** - * Invert this Matrix. - * - * @method Phaser.Math.Matrix4#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - invert: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - - if (!det) - { - return null; - } - - det = 1 / det; - - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; - }, - - /** - * Calculate the adjoint, or adjugate, of this Matrix. - * - * @method Phaser.Math.Matrix4#adjoint - * @since 3.0.0 - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - adjoint: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; - }, - - /** - * Calculate the determinant of this Matrix. - * - * @method Phaser.Math.Matrix4#determinant - * @since 3.0.0 - * - * @return {number} The determinant of this Matrix. - */ - determinant: function () - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = a00 * a11 - a01 * a10; - var b01 = a00 * a12 - a02 * a10; - var b02 = a00 * a13 - a03 * a10; - var b03 = a01 * a12 - a02 * a11; - var b04 = a01 * a13 - a03 * a11; - var b05 = a02 * a13 - a03 * a12; - var b06 = a20 * a31 - a21 * a30; - var b07 = a20 * a32 - a22 * a30; - var b08 = a20 * a33 - a23 * a30; - var b09 = a21 * a32 - a22 * a31; - var b10 = a21 * a33 - a23 * a31; - var b11 = a22 * a33 - a23 * a32; - - // Calculate the determinant - return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - }, - - /** - * Multiply this Matrix by the given Matrix. - * - * @method Phaser.Math.Matrix4#multiply - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiply: function (src) - { - var a = this.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b = src.val; - - // Cache only the current line of the second matrix - var b0 = b[0]; - var b1 = b[1]; - var b2 = b[2]; - var b3 = b[3]; - - a[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[4]; - b1 = b[5]; - b2 = b[6]; - b3 = b[7]; - - a[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[8]; - b1 = b[9]; - b2 = b[10]; - b3 = b[11]; - - a[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - b0 = b[12]; - b1 = b[13]; - b2 = b[14]; - b3 = b[15]; - - a[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; - a[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; - a[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; - a[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; - - return this; - }, - - /** - * Multiply the values of this Matrix4 by those given in the `src` argument. - * - * @method Phaser.Math.Matrix4#multiplyLocal - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - multiplyLocal: function (src) - { - var a = []; - var m1 = this.val; - var m2 = src.val; - - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; - - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; - - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; - - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; - - return this.fromArray(a); - }, - - /** - * Translate this Matrix using the given Vector. - * - * @method Phaser.Math.Matrix4#translate - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translate: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Translate this Matrix using the given values. - * - * @method Phaser.Math.Matrix4#translateXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - translateXYZ: function (x, y, z) - { - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. - * - * @method Phaser.Math.Matrix4#scale - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scale: function (v) - { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Apply a scale transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#scaleXYZ - * @since 3.16.0 - * - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - scaleXYZ: function (x, y, z) - { - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; - }, - - /** - * Derive a rotation matrix around the given axis. - * - * @method Phaser.Math.Matrix4#makeRotationAxis - * @since 3.0.0 - * - * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. - * @param {number} angle - The rotation angle in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - makeRotationAxis: function (axis, angle) - { - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos(angle); - var s = Math.sin(angle); - var t = 1 - c; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var tx = t * x; - var ty = t * y; - - this.fromArray([ - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * Apply a rotation transformation to this Matrix. - * - * @method Phaser.Math.Matrix4#rotate - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotate: function (rad, axis) - { - var a = this.val; - var x = axis.x; - var y = axis.y; - var z = axis.z; - var len = Math.sqrt(x * x + y * y + z * z); - - if (Math.abs(len) < EPSILON) - { - return null; - } - - len = 1 / len; - x *= len; - y *= len; - z *= len; - - var s = Math.sin(rad); - var c = Math.cos(rad); - var t = 1 - c; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Construct the elements of the rotation matrix - var b00 = x * x * t + c; - var b01 = y * x * t + z * s; - var b02 = z * x * t - y * s; - - var b10 = x * y * t - z * s; - var b11 = y * y * t + c; - var b12 = z * y * t + x * s; - - var b20 = x * z * t + y * s; - var b21 = y * z * t - x * s; - var b22 = z * z * t + c; - - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; - }, - - /** - * Rotate this matrix on its X axis. - * - * @method Phaser.Math.Matrix4#rotateX - * @since 3.0.0 - * - * @param {number} rad - The angle in radians to rotate by. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateX: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[4] = a10 * c + a20 * s; - a[5] = a11 * c + a21 * s; - a[6] = a12 * c + a22 * s; - a[7] = a13 * c + a23 * s; - a[8] = a20 * c - a10 * s; - a[9] = a21 * c - a11 * s; - a[10] = a22 * c - a12 * s; - a[11] = a23 * c - a13 * s; - - return this; - }, - - /** - * Rotate this matrix on its Y axis. - * - * @method Phaser.Math.Matrix4#rotateY - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateY: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c - a20 * s; - a[1] = a01 * c - a21 * s; - a[2] = a02 * c - a22 * s; - a[3] = a03 * c - a23 * s; - a[8] = a00 * s + a20 * c; - a[9] = a01 * s + a21 * c; - a[10] = a02 * s + a22 * c; - a[11] = a03 * s + a23 * c; - - return this; - }, - - /** - * Rotate this matrix on its Z axis. - * - * @method Phaser.Math.Matrix4#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The angle to rotate by, in radians. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - rotateZ: function (rad) - { - var a = this.val; - var s = Math.sin(rad); - var c = Math.cos(rad); - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - - // Perform axis-specific matrix multiplication - a[0] = a00 * c + a10 * s; - a[1] = a01 * c + a11 * s; - a[2] = a02 * c + a12 * s; - a[3] = a03 * c + a13 * s; - a[4] = a10 * c - a00 * s; - a[5] = a11 * c - a01 * s; - a[6] = a12 * c - a02 * s; - a[7] = a13 * c - a03 * s; - - return this; - }, - - /** - * Set the values of this Matrix from the given rotation Quaternion and translation Vector. - * - * @method Phaser.Math.Matrix4#fromRotationTranslation - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. - * @param {Phaser.Math.Vector3} v - The Vector to set translation from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromRotationTranslation: function (q, v) - { - // Quaternion math - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; - }, - - /** - * Set the values of this Matrix from the given Quaternion. - * - * @method Phaser.Math.Matrix4#fromQuat - * @since 3.0.0 - * - * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - fromQuat: function (q) - { - var out = this.val; - - var x = q.x; - var y = q.y; - var z = q.z; - var w = q.w; - - var x2 = x + x; - var y2 = y + y; - var z2 = z + z; - - var xx = x * x2; - var xy = x * y2; - var xz = x * z2; - - var yy = y * y2; - var yz = y * z2; - var zz = z * z2; - - var wx = w * x2; - var wy = w * y2; - var wz = w * z2; - - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; - - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; - - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; - - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; - }, - - /** - * Generate a frustum matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#frustum - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - frustum: function (left, right, bottom, top, near, far) - { - var out = this.val; - - var rl = 1 / (right - left); - var tb = 1 / (top - bottom); - var nf = 1 / (near - far); - - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; - - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspective - * @since 3.0.0 - * - * @param {number} fovy - Vertical field of view in radians - * @param {number} aspect - Aspect ratio. Typically viewport width /height. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspective: function (fovy, aspect, near, far) - { - var out = this.val; - var f = 1.0 / Math.tan(fovy / 2); - var nf = 1 / (near - far); - - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; - - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; - }, - - /** - * Generate a perspective projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#perspectiveLH - * @since 3.0.0 - * - * @param {number} width - The width of the frustum. - * @param {number} height - The height of the frustum. - * @param {number} near - Near bound of the frustum. - * @param {number} far - Far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - perspectiveLH: function (width, height, near, far) - { - var out = this.val; - - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; - }, - - /** - * Generate an orthogonal projection matrix with the given bounds. - * - * @method Phaser.Math.Matrix4#ortho - * @since 3.0.0 - * - * @param {number} left - The left bound of the frustum. - * @param {number} right - The right bound of the frustum. - * @param {number} bottom - The bottom bound of the frustum. - * @param {number} top - The top bound of the frustum. - * @param {number} near - The near bound of the frustum. - * @param {number} far - The far bound of the frustum. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - ortho: function (left, right, bottom, top, near, far) - { - var out = this.val; - var lr = left - right; - var bt = bottom - top; - var nf = near - far; - - // Avoid division by zero - lr = (lr === 0) ? lr : 1 / lr; - bt = (bt === 0) ? bt : 1 / bt; - nf = (nf === 0) ? nf : 1 / nf; - - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; - - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; - - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; - - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; - - return this; - }, - - /** - * Generate a look-at matrix with the given eye position, focal point, and up axis. - * - * @method Phaser.Math.Matrix4#lookAt - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} eye - Position of the viewer - * @param {Phaser.Math.Vector3} center - Point the viewer is looking at - * @param {Phaser.Math.Vector3} up - vec3 pointing up. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - lookAt: function (eye, center, up) - { - var out = this.val; - - var eyex = eye.x; - var eyey = eye.y; - var eyez = eye.z; - - var upx = up.x; - var upy = up.y; - var upz = up.z; - - var centerx = center.x; - var centery = center.y; - var centerz = center.z; - - if (Math.abs(eyex - centerx) < EPSILON && - Math.abs(eyey - centery) < EPSILON && - Math.abs(eyez - centerz) < EPSILON) - { - return this.identity(); - } - - var z0 = eyex - centerx; - var z1 = eyey - centery; - var z2 = eyez - centerz; - - var len = 1 / Math.sqrt(z0 * z0 + z1 * z1 + z2 * z2); - - z0 *= len; - z1 *= len; - z2 *= len; - - var x0 = upy * z2 - upz * z1; - var x1 = upz * z0 - upx * z2; - var x2 = upx * z1 - upy * z0; - - len = Math.sqrt(x0 * x0 + x1 * x1 + x2 * x2); - - if (!len) - { - x0 = 0; - x1 = 0; - x2 = 0; - } - else - { - len = 1 / len; - x0 *= len; - x1 *= len; - x2 *= len; - } - - var y0 = z1 * x2 - z2 * x1; - var y1 = z2 * x0 - z0 * x2; - var y2 = z0 * x1 - z1 * x0; - - len = Math.sqrt(y0 * y0 + y1 * y1 + y2 * y2); - - if (!len) - { - y0 = 0; - y1 = 0; - y2 = 0; - } - else - { - len = 1 / len; - y0 *= len; - y1 *= len; - y2 *= len; - } - - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; - - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; - - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; - - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; - }, - - /** - * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. - * - * @method Phaser.Math.Matrix4#yawPitchRoll - * @since 3.0.0 - * - * @param {number} yaw - The yaw value. - * @param {number} pitch - The pitch value. - * @param {number} roll - The roll value. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - yawPitchRoll: function (yaw, pitch, roll) - { - this.zero(); - _tempMat1.zero(); - _tempMat2.zero(); - - var m0 = this.val; - var m1 = _tempMat1.val; - var m2 = _tempMat2.val; - - // Rotate Z - var s = Math.sin(roll); - var c = Math.cos(roll); - - m0[10] = 1; - m0[15] = 1; - m0[0] = c; - m0[1] = s; - m0[4] = -s; - m0[5] = c; - - // Rotate X - s = Math.sin(pitch); - c = Math.cos(pitch); - - m1[0] = 1; - m1[15] = 1; - m1[5] = c; - m1[10] = c; - m1[9] = -s; - m1[6] = s; - - // Rotate Y - s = Math.sin(yaw); - c = Math.cos(yaw); - - m2[5] = 1; - m2[15] = 1; - m2[0] = c; - m2[2] = -s; - m2[8] = s; - m2[10] = c; - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - return this; - }, - - /** - * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. - * - * @method Phaser.Math.Matrix4#setWorldMatrix - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} rotation - The rotation of the world matrix. - * @param {Phaser.Math.Vector3} position - The position of the world matrix. - * @param {Phaser.Math.Vector3} scale - The scale of the world matrix. - * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. - * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. - * - * @return {Phaser.Math.Matrix4} This Matrix4. - */ - setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) - { - this.yawPitchRoll(rotation.y, rotation.x, rotation.z); - - _tempMat1.scaling(scale.x, scale.y, scale.z); - _tempMat2.xyz(position.x, position.y, position.z); - - this.multiplyLocal(_tempMat1); - this.multiplyLocal(_tempMat2); - - if (viewMatrix !== undefined) - { - this.multiplyLocal(viewMatrix); - } - - if (projectionMatrix !== undefined) - { - this.multiplyLocal(projectionMatrix); - } - - return this; - } - -}); - -var _tempMat1 = new Matrix4(); -var _tempMat2 = new Matrix4(); - -module.exports = Matrix4; - - -/***/ }), -/* 43 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - -var Class = __webpack_require__(0); -var Vector3 = __webpack_require__(19); -var Matrix3 = __webpack_require__(41); - -var EPSILON = 0.000001; - -// Some shared 'private' arrays -var siNext = new Int8Array([ 1, 2, 0 ]); -var tmp = new Float32Array([ 0, 0, 0 ]); - -var xUnitVec3 = new Vector3(1, 0, 0); -var yUnitVec3 = new Vector3(0, 1, 0); - -var tmpvec = new Vector3(); -var tmpMat3 = new Matrix3(); - -/** - * @classdesc - * A quaternion. - * - * @class Quaternion - * @memberof Phaser.Math - * @constructor - * @since 3.0.0 - * - * @param {number} [x] - The x component. - * @param {number} [y] - The y component. - * @param {number} [z] - The z component. - * @param {number} [w] - The w component. - */ -var Quaternion = new Class({ - - initialize: - - function Quaternion (x, y, z, w) - { - /** - * The x component of this Quaternion. - * - * @name Phaser.Math.Quaternion#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - /** - * The y component of this Quaternion. - * - * @name Phaser.Math.Quaternion#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - /** - * The z component of this Quaternion. - * - * @name Phaser.Math.Quaternion#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - /** - * The w component of this Quaternion. - * - * @name Phaser.Math.Quaternion#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - }, - - /** - * Copy the components of a given Quaternion or Vector into this Quaternion. - * - * @method Phaser.Math.Quaternion#copy - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - copy: function (src) - { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; - }, - - /** - * Set the components of this Quaternion. - * - * @method Phaser.Math.Quaternion#set - * @since 3.0.0 - * - * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. - * @param {number} [y=0] - The y component. - * @param {number} [z=0] - The z component. - * @param {number} [w=0] - The w component. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - set: function (x, y, z, w) - { - if (typeof x === 'object') - { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; - } - else - { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; - } - - return this; - }, - - /** - * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. - * - * @method Phaser.Math.Quaternion#add - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - add: function (v) - { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; - - return this; - }, - - /** - * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. - * - * @method Phaser.Math.Quaternion#subtract - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - subtract: function (v) - { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; - - return this; - }, - - /** - * Scale this Quaternion by the given value. - * - * @method Phaser.Math.Quaternion#scale - * @since 3.0.0 - * - * @param {number} scale - The value to scale this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - scale: function (scale) - { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; - - return this; - }, - - /** - * Calculate the length of this Quaternion. - * - * @method Phaser.Math.Quaternion#length - * @since 3.0.0 - * - * @return {number} The length of this Quaternion. - */ - length: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return Math.sqrt(x * x + y * y + z * z + w * w); - }, - - /** - * Calculate the length of this Quaternion squared. - * - * @method Phaser.Math.Quaternion#lengthSq - * @since 3.0.0 - * - * @return {number} The length of this Quaternion, squared. - */ - lengthSq: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - - return x * x + y * y + z * z + w * w; - }, - - /** - * Normalize this Quaternion. - * - * @method Phaser.Math.Quaternion#normalize - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - normalize: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - var w = this.w; - var len = x * x + y * y + z * z + w * w; - - if (len > 0) - { - len = 1 / Math.sqrt(len); - - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; - } - - return this; - }, - - /** - * Calculate the dot product of this Quaternion and the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#dot - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. - * - * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. - */ - dot: function (v) - { - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - }, - - /** - * Linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#lerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. - * @param {number} [t=0] - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - lerp: function (v, t) - { - if (t === undefined) { t = 0; } - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; - }, - - /** - * Rotates this Quaternion based on the two given vectors. - * - * @method Phaser.Math.Quaternion#rotationTo - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} a - The transform rotation vector. - * @param {Phaser.Math.Vector3} b - The target rotation vector. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotationTo: function (a, b) - { - var dot = a.x * b.x + a.y * b.y + a.z * b.z; - - if (dot < -0.999999) - { - if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) - { - tmpvec.copy(yUnitVec3).cross(a); - } - - tmpvec.normalize(); - - return this.setAxisAngle(tmpvec, Math.PI); - - } - else if (dot > 0.999999) - { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; - } - else - { - tmpvec.copy(a).cross(b); - - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; - - return this.normalize(); - } - }, - - /** - * Set the axes of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxes - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} view - The view axis. - * @param {Phaser.Math.Vector3} right - The right axis. - * @param {Phaser.Math.Vector3} up - The upwards axis. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxes: function (view, right, up) - { - var m = tmpMat3.val; - - m[0] = right.x; - m[3] = right.y; - m[6] = right.z; - - m[1] = up.x; - m[4] = up.y; - m[7] = up.z; - - m[2] = -view.x; - m[5] = -view.y; - m[8] = -view.z; - - return this.fromMat3(tmpMat3).normalize(); - }, - - /** - * Reset this Matrix to an identity (default) Quaternion. - * - * @method Phaser.Math.Quaternion#identity - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - identity: function () - { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; - }, - - /** - * Set the axis angle of this Quaternion. - * - * @method Phaser.Math.Quaternion#setAxisAngle - * @since 3.0.0 - * - * @param {Phaser.Math.Vector3} axis - The axis. - * @param {number} rad - The angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - setAxisAngle: function (axis, rad) - { - rad = rad * 0.5; - - var s = Math.sin(rad); - - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; - }, - - /** - * Multiply this Quaternion by the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#multiply - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - multiply: function (b) - { - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; - }, - - /** - * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. - * - * @method Phaser.Math.Quaternion#slerp - * @since 3.0.0 - * - * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. - * @param {number} t - The percentage of interpolation. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - slerp: function (b, t) - { - // benchmarks: http://jsperf.com/quaternion-slerp-implementations - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = b.x; - var by = b.y; - var bz = b.z; - var bw = b.w; - - // calc cosine - var cosom = ax * bx + ay * by + az * bz + aw * bw; - - // adjust signs (if necessary) - if (cosom < 0) - { - cosom = -cosom; - bx = - bx; - by = - by; - bz = - bz; - bw = - bw; - } - - // "from" and "to" quaternions are very close - // ... so we can do a linear interpolation - var scale0 = 1 - t; - var scale1 = t; - - // calculate coefficients - if ((1 - cosom) > EPSILON) - { - // standard case (slerp) - var omega = Math.acos(cosom); - var sinom = Math.sin(omega); - - scale0 = Math.sin((1.0 - t) * omega) / sinom; - scale1 = Math.sin(t * omega) / sinom; - } - - // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; - }, - - /** - * Invert this Quaternion. - * - * @method Phaser.Math.Quaternion#invert - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - invert: function () - { - var a0 = this.x; - var a1 = this.y; - var a2 = this.z; - var a3 = this.w; - - var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; - var invDot = (dot) ? 1 / dot : 0; - - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; - }, - - /** - * Convert this Quaternion into its conjugate. - * - * Sets the x, y and z components. - * - * @method Phaser.Math.Quaternion#conjugate - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - conjugate: function () - { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; - - return this; - }, - - /** - * Rotate this Quaternion on the X axis. - * - * @method Phaser.Math.Quaternion#rotateX - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateX: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bx = Math.sin(rad); - var bw = Math.cos(rad); - - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; - }, - - /** - * Rotate this Quaternion on the Y axis. - * - * @method Phaser.Math.Quaternion#rotateY - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateY: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var by = Math.sin(rad); - var bw = Math.cos(rad); - - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; - }, - - /** - * Rotate this Quaternion on the Z axis. - * - * @method Phaser.Math.Quaternion#rotateZ - * @since 3.0.0 - * - * @param {number} rad - The rotation angle in radians. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - rotateZ: function (rad) - { - rad *= 0.5; - - var ax = this.x; - var ay = this.y; - var az = this.z; - var aw = this.w; - - var bz = Math.sin(rad); - var bw = Math.cos(rad); - - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; - }, - - /** - * Create a unit (or rotation) Quaternion from its x, y, and z components. - * - * Sets the w component. - * - * @method Phaser.Math.Quaternion#calculateW - * @since 3.0.0 - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - calculateW: function () - { - var x = this.x; - var y = this.y; - var z = this.z; - - this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); - - return this; - }, - - /** - * Convert the given Matrix into this Quaternion. - * - * @method Phaser.Math.Quaternion#fromMat3 - * @since 3.0.0 - * - * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. - * - * @return {Phaser.Math.Quaternion} This Quaternion. - */ - fromMat3: function (mat) - { - // benchmarks: - // http://jsperf.com/typed-array-access-speed - // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion - - // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes - // article "Quaternion Calculus and Fast Animation". - var m = mat.val; - var fTrace = m[0] + m[4] + m[8]; - var fRoot; - - if (fTrace > 0) - { - // |w| > 1/2, may as well choose w > 1/2 - fRoot = Math.sqrt(fTrace + 1.0); // 2w - - this.w = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; // 1/(4w) - - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; - } - else - { - // |w| <= 1/2 - var i = 0; - - if (m[4] > m[0]) - { - i = 1; - } - - if (m[8] > m[i * 3 + i]) - { - i = 2; - } - - var j = siNext[i]; - var k = siNext[j]; - - // This isn't quite as clean without array access - fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); - tmp[i] = 0.5 * fRoot; - - fRoot = 0.5 / fRoot; - - tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; - tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; - } - - return this; - } - -}); - -module.exports = Quaternion; - - -/***/ }), -/* 44 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Extend = __webpack_require__(26); -var XHRSettings = __webpack_require__(45); - -/** - * Takes two XHRSettings Objects and creates a new XHRSettings object from them. - * - * The new object is seeded by the values given in the global settings, but any setting in - * the local object overrides the global ones. - * - * @function Phaser.Loader.MergeXHRSettings - * @since 3.0.0 - * - * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. - * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. - */ -var MergeXHRSettings = function (global, local) -{ - var output = (global === undefined) ? XHRSettings() : Extend({}, global); - - if (local) - { - for (var setting in local) - { - if (local[setting] !== undefined) - { - output[setting] = local[setting]; - } - } - } - - return output; -}; - -module.exports = MergeXHRSettings; - - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Creates an XHRSettings Object with default values. - * - * @function Phaser.Loader.XHRSettings - * @since 3.0.0 - * - * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. - * @param {boolean} [async=true] - Should the XHR request use async or not? - * @param {string} [user=''] - Optional username for the XHR request. - * @param {string} [password=''] - Optional password for the XHR request. - * @param {integer} [timeout=0] - Optional XHR timeout value. - * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. - * - * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. - */ -var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) -{ - if (responseType === undefined) { responseType = ''; } - if (async === undefined) { async = true; } - if (user === undefined) { user = ''; } - if (password === undefined) { password = ''; } - if (timeout === undefined) { timeout = 0; } - if (withCredentials === undefined) { withCredentials = false; } - - // Before sending a request, set the xhr.responseType to "text", - // "arraybuffer", "blob", or "document", depending on your data needs. - // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". - - return { - - // Ignored by the Loader, only used by File. - responseType: responseType, - - async: async, - - // credentials - user: user, - password: password, - - // timeout in ms (0 = no timeout) - timeout: timeout, - - // setRequestHeader - headers: undefined, - header: undefined, - headerValue: undefined, - requestedWith: false, - - // overrideMimeType - overrideMimeType: undefined, - - // withCredentials - withCredentials: withCredentials - - }; -}; - -module.exports = XHRSettings; - - -/***/ }), -/* 46 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for calculating and setting the size of a non-Frame based Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.ComputedSize - * @since 3.0.0 - */ - -var ComputedSize = { - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#width - * @type {number} - * @since 3.0.0 - */ - width: 0, - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - * - * @name Phaser.GameObjects.Components.ComputedSize#height - * @type {number} - * @since 3.0.0 - */ - height: 0, - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayWidth - * @type {number} - * @since 3.0.0 - */ - displayWidth: { - - get: function () - { - return this.scaleX * this.width; - }, - - set: function (value) - { - this.scaleX = value / this.width; - } - - }, - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - * - * @name Phaser.GameObjects.Components.ComputedSize#displayHeight - * @type {number} - * @since 3.0.0 - */ - displayHeight: { - - get: function () - { - return this.scaleY * this.height; - }, - - set: function (value) - { - this.scaleY = value / this.height; - } - - }, - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * - * @method Phaser.GameObjects.Components.ComputedSize#setSize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setSize: function (width, height) - { - this.width = width; - this.height = height; - - return this; - }, - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * - * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize - * @since 3.4.0 - * - * @param {number} width - The width of this Game Object. - * @param {number} height - The height of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDisplaySize: function (width, height) - { - this.displayWidth = width; - this.displayHeight = height; - - return this; - } - -}; - -module.exports = ComputedSize; - - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for setting the depth of a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Depth - * @since 3.0.0 - */ - -var Depth = { - - /** - * Private internal value. Holds the depth of the Game Object. - * - * @name Phaser.GameObjects.Components.Depth#_depth - * @type {integer} - * @private - * @default 0 - * @since 3.0.0 - */ - _depth: 0, - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @name Phaser.GameObjects.Components.Depth#depth - * @type {number} - * @since 3.0.0 - */ - depth: { - - get: function () - { - return this._depth; - }, - - set: function (value) - { - this.scene.sys.queueDepthSort(); - this._depth = value; - } - - }, - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * - * @method Phaser.GameObjects.Components.Depth#setDepth - * @since 3.0.0 - * - * @param {integer} value - The depth of this Game Object. - * - * @return {this} This Game Object instance. - */ - setDepth: function (value) - { - if (value === undefined) { value = 0; } - - this.depth = value; - - return this; - } - -}; - -module.exports = Depth; - - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for visually flipping a Game Object. - * Should be applied as a mixin and not used directly. - * - * @namespace Phaser.GameObjects.Components.Flip - * @since 3.0.0 - */ - -var Flip = { - - /** - * The horizontally flipped state of the Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipX - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipX: false, - - /** - * The vertically flipped state of the Game Object. - * - * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @name Phaser.GameObjects.Components.Flip#flipY - * @type {boolean} - * @default false - * @since 3.0.0 - */ - flipY: false, - - /** - * Toggles the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipX - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipX: function () - { - this.flipX = !this.flipX; - - return this; - }, - - /** - * Toggles the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#toggleFlipY - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - toggleFlipY: function () - { - this.flipY = !this.flipY; - - return this; - }, - - /** - * Sets the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlipX - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipX: function (value) - { - this.flipX = value; - - return this; - }, - - /** - * Sets the vertical flipped state of this Game Object. - * - * @method Phaser.GameObjects.Components.Flip#setFlipY - * @since 3.0.0 - * - * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlipY: function (value) - { - this.flipY = value; - - return this; - }, - - /** - * Sets the horizontal and vertical flipped state of this Game Object. - * - * A Game Object that is flipped will render inversed on the flipped axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * - * @method Phaser.GameObjects.Components.Flip#setFlip - * @since 3.0.0 - * - * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * - * @return {this} This Game Object instance. - */ - setFlip: function (x, y) - { - this.flipX = x; - this.flipY = y; - - return this; - }, - - /** - * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - * - * @method Phaser.GameObjects.Components.Flip#resetFlip - * @since 3.0.0 - * - * @return {this} This Game Object instance. - */ - resetFlip: function () - { - this.flipX = false; - this.flipY = false; - - return this; - } - -}; - -module.exports = Flip; - - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Provides methods used for getting and setting the Scroll Factor of a Game Object. - * - * @namespace Phaser.GameObjects.Components.ScrollFactor - * @since 3.0.0 - */ - -var ScrollFactor = { - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorX: 1, - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scrollFactorY: 1, - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * - * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor - * @since 3.0.0 - * - * @param {number} x - The horizontal scroll factor of this Game Object. - * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScrollFactor: function (x, y) - { - if (y === undefined) { y = x; } - - this.scrollFactorX = x; - this.scrollFactorY = y; - - return this; - } - -}; - -module.exports = ScrollFactor; - - -/***/ }), -/* 50 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var MATH_CONST = __webpack_require__(2); -var TransformMatrix = __webpack_require__(51); -var TransformXY = __webpack_require__(40); -var WrapAngle = __webpack_require__(29); -var WrapAngleDegrees = __webpack_require__(30); -var Vector2 = __webpack_require__(1); - -// global bitmask flag for GameObject.renderMask (used by Scale) -var _FLAG = 4; // 0100 - -/** - * Provides methods used for getting and setting the position, scale and rotation of a Game Object. - * - * @namespace Phaser.GameObjects.Components.Transform - * @since 3.0.0 - */ - -var Transform = { - - /** - * Private internal value. Holds the horizontal scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleX - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleX: 1, - - /** - * Private internal value. Holds the vertical scale value. - * - * @name Phaser.GameObjects.Components.Transform#_scaleY - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - _scaleY: 1, - - /** - * Private internal value. Holds the rotation value in radians. - * - * @name Phaser.GameObjects.Components.Transform#_rotation - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - _rotation: 0, - - /** - * The x position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#x - * @type {number} - * @default 0 - * @since 3.0.0 - */ - x: 0, - - /** - * The y position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#y - * @type {number} - * @default 0 - * @since 3.0.0 - */ - y: 0, - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - * - * @name Phaser.GameObjects.Components.Transform#z - * @type {number} - * @default 0 - * @since 3.0.0 - */ - z: 0, - - /** - * The w position of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#w - * @type {number} - * @default 0 - * @since 3.0.0 - */ - w: 0, - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - * - * @name Phaser.GameObjects.Components.Transform#scale - * @type {number} - * @default 1 - * @since 3.18.0 - */ - scale: { - - get: function () - { - return (this._scaleX + this._scaleY) / 2; - }, - - set: function (value) - { - this._scaleX = value; - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The horizontal scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleX - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleX: { - - get: function () - { - return this._scaleX; - }, - - set: function (value) - { - this._scaleX = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The vertical scale of this Game Object. - * - * @name Phaser.GameObjects.Components.Transform#scaleY - * @type {number} - * @default 1 - * @since 3.0.0 - */ - scaleY: { - - get: function () - { - return this._scaleY; - }, - - set: function (value) - { - this._scaleY = value; - - if (value === 0) - { - this.renderFlags &= ~_FLAG; - } - else - { - this.renderFlags |= _FLAG; - } - } - - }, - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - * - * @name Phaser.GameObjects.Components.Transform#angle - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - angle: { - - get: function () - { - return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); - }, - - set: function (value) - { - // value is in degrees - this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; - } - }, - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - * - * @name Phaser.GameObjects.Components.Transform#rotation - * @type {number} - * @default 1 - * @since 3.0.0 - */ - rotation: { - - get: function () - { - return this._rotation; - }, - - set: function (value) - { - // value is in radians - this._rotation = WrapAngle(value); - } - }, - - /** - * Sets the position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setPosition - * @since 3.0.0 - * - * @param {number} [x=0] - The x position of this Game Object. - * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. - * @param {number} [z=0] - The z position of this Game Object. - * @param {number} [w=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setPosition: function (x, y, z, w) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = x; } - if (z === undefined) { z = 0; } - if (w === undefined) { w = 0; } - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - }, - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * - * @method Phaser.GameObjects.Components.Transform#setRandomPosition - * @since 3.8.0 - * - * @param {number} [x=0] - The x position of the top-left of the random area. - * @param {number} [y=0] - The y position of the top-left of the random area. - * @param {number} [width] - The width of the random area. - * @param {number} [height] - The height of the random area. - * - * @return {this} This Game Object instance. - */ - setRandomPosition: function (x, y, width, height) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (width === undefined) { width = this.scene.sys.scale.width; } - if (height === undefined) { height = this.scene.sys.scale.height; } - - this.x = x + (Math.random() * width); - this.y = y + (Math.random() * height); - - return this; - }, - - /** - * Sets the rotation of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setRotation - * @since 3.0.0 - * - * @param {number} [radians=0] - The rotation of this Game Object, in radians. - * - * @return {this} This Game Object instance. - */ - setRotation: function (radians) - { - if (radians === undefined) { radians = 0; } - - this.rotation = radians; - - return this; - }, - - /** - * Sets the angle of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setAngle - * @since 3.0.0 - * - * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. - * - * @return {this} This Game Object instance. - */ - setAngle: function (degrees) - { - if (degrees === undefined) { degrees = 0; } - - this.angle = degrees; - - return this; - }, - - /** - * Sets the scale of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setScale - * @since 3.0.0 - * - * @param {number} x - The horizontal scale of this Game Object. - * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. - * - * @return {this} This Game Object instance. - */ - setScale: function (x, y) - { - if (x === undefined) { x = 1; } - if (y === undefined) { y = x; } - - this.scaleX = x; - this.scaleY = y; - - return this; - }, - - /** - * Sets the x position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setX - * @since 3.0.0 - * - * @param {number} [value=0] - The x position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setX: function (value) - { - if (value === undefined) { value = 0; } - - this.x = value; - - return this; - }, - - /** - * Sets the y position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setY - * @since 3.0.0 - * - * @param {number} [value=0] - The y position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setY: function (value) - { - if (value === undefined) { value = 0; } - - this.y = value; - - return this; - }, - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * - * @method Phaser.GameObjects.Components.Transform#setZ - * @since 3.0.0 - * - * @param {number} [value=0] - The z position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setZ: function (value) - { - if (value === undefined) { value = 0; } - - this.z = value; - - return this; - }, - - /** - * Sets the w position of this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#setW - * @since 3.0.0 - * - * @param {number} [value=0] - The w position of this Game Object. - * - * @return {this} This Game Object instance. - */ - setW: function (value) - { - if (value === undefined) { value = 0; } - - this.w = value; - - return this; - }, - - /** - * Gets the local transform matrix for this Game Object. - * - * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getLocalTransformMatrix: function (tempMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - - return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - }, - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * - * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix - * @since 3.4.0 - * - * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. - * - * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. - */ - getWorldTransformMatrix: function (tempMatrix, parentMatrix) - { - if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } - if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } - - var parent = this.parentContainer; - - if (!parent) - { - return this.getLocalTransformMatrix(tempMatrix); - } - - tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); - - while (parent) - { - parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); - - parentMatrix.multiply(tempMatrix, tempMatrix); - - parent = parent.parentContainer; - } - - return tempMatrix; - }, - - /** - * Takes the given `x` and `y` coordinates and converts them into local space for this - * Game Object, taking into account parent and local transforms, and the Display Origin. - * - * The returned Vector2 contains the translated point in its properties. - * - * A Camera needs to be provided in order to handle modified scroll factors. If no - * camera is specified, it will use the `main` camera from the Scene to which this - * Game Object belongs. - * - * @method Phaser.GameObjects.Components.Transform#getLocalPoint - * @since 3.50.0 - * - * @param {number} x - The x position to translate. - * @param {number} y - The y position to translate. - * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. - * - * @return {Phaser.Math.Vector2} The translated point. - */ - getLocalPoint: function (x, y, point, camera) - { - if (!point) { point = new Vector2(); } - if (!camera) { camera = this.scene.sys.cameras.main; } - - var csx = camera.scrollX; - var csy = camera.scrollY; - - var px = x + (csx * this.scrollFactorX) - csx; - var py = y + (csy * this.scrollFactorY) - csy; - - if (this.parentContainer) - { - this.getWorldTransformMatrix().applyInverse(px, py, point); - } - else - { - TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); - } - - // Normalize origin - if (this._originComponent) - { - point.x += this._displayOriginX; - point.y += this._displayOriginY; - } - - return point; - }, - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - * - * @method Phaser.GameObjects.Components.Transform#getParentRotation - * @since 3.18.0 - * - * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. - */ - getParentRotation: function () - { - var rotation = 0; - - var parent = this.parentContainer; - - while (parent) - { - rotation += parent.rotation; - - parent = parent.parentContainer; - } - - return rotation; - } - -}; - -module.exports = Transform; - - -/***/ }), -/* 51 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = __webpack_require__(0); -var MATH_CONST = __webpack_require__(2); -var Vector2 = __webpack_require__(1); +var MATH_CONST = __webpack_require__(3); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -10152,7 +6844,4163 @@ module.exports = TransformMatrix; /***/ }), -/* 52 */ +/* 24 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Checks if an array can be used as a matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.CheckMatrix + * @since 3.0.0 + * + * @generic T + * @genericUse {T[][]} - [matrix] + * + * @param {T[][]} [matrix] - The array to check. + * + * @return {boolean} `true` if the given `matrix` array is a valid matrix. + */ +var CheckMatrix = function (matrix) +{ + if (!Array.isArray(matrix) || matrix.length < 2 || !Array.isArray(matrix[0])) + { + return false; + } + + // How long is the first row? + var size = matrix[0].length; + + // Validate the rest of the rows are the same length + for (var i = 1; i < matrix.length; i++) + { + if (matrix[i].length !== size) + { + return false; + } + } + + return true; +}; + +module.exports = CheckMatrix; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = __webpack_require__(0); +var Contains = __webpack_require__(295); +var GetPoint = __webpack_require__(59); +var GetPoints = __webpack_require__(296); +var GEOM_CONST = __webpack_require__(26); +var Line = __webpack_require__(297); +var Random = __webpack_require__(302); + +/** + * @classdesc + * Encapsulates a 2D rectangle defined by its corner point in the top-left and its extends in x (width) and y (height) + * + * @class Rectangle + * @memberof Phaser.Geom + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=0] - The Y coordinate of the top left corner of the Rectangle. + * @param {number} [width=0] - The width of the Rectangle. + * @param {number} [height=0] - The height of the Rectangle. + */ +var Rectangle = new Class({ + + initialize: + + function Rectangle (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = 0; } + if (height === undefined) { height = 0; } + + /** + * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. + * Used for fast type comparisons. + * + * @name Phaser.Geom.Rectangle#type + * @type {integer} + * @readonly + * @since 3.19.0 + */ + this.type = GEOM_CONST.RECTANGLE; + + /** + * The X coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.x = x; + + /** + * The Y coordinate of the top left corner of the Rectangle. + * + * @name Phaser.Geom.Rectangle#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.y = y; + + /** + * The width of the Rectangle, i.e. the distance between its left side (defined by `x`) and its right side. + * + * @name Phaser.Geom.Rectangle#width + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.width = width; + + /** + * The height of the Rectangle, i.e. the distance between its top side (defined by `y`) and its bottom side. + * + * @name Phaser.Geom.Rectangle#height + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.height = height; + }, + + /** + * Checks if the given point is inside the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#contains + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the point to check. + * @param {number} y - The Y coordinate of the point to check. + * + * @return {boolean} `true` if the point is within the Rectangle's bounds, otherwise `false`. + */ + contains: function (x, y) + { + return Contains(this, x, y); + }, + + /** + * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. + * + * The `position` is a fraction between 0 and 1 which defines how far into the perimeter the point is. + * + * A value of 0 or 1 returns the point at the top left corner of the rectangle, while a value of 0.5 returns the point at the bottom right corner of the rectangle. Values between 0 and 0.5 are on the top or the right side and values between 0.5 and 1 are on the bottom or the left side. + * + * @method Phaser.Geom.Rectangle#getPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [output,$return] + * + * @param {number} position - The normalized distance into the Rectangle's perimeter to return. + * @param {(Phaser.Geom.Point|object)} [output] - An object to update with the `x` and `y` coordinates of the point. + * + * @return {(Phaser.Geom.Point|object)} The updated `output` object, or a new Point if no `output` object was given. + */ + getPoint: function (position, output) + { + return GetPoint(this, position, output); + }, + + /** + * Returns an array of points from the perimeter of the Rectangle, each spaced out based on the quantity or step required. + * + * @method Phaser.Geom.Rectangle#getPoints + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point[]} O - [output,$return] + * + * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. + * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. + * + * @return {(array|Phaser.Geom.Point[])} The modified `output` array, or a new array if none was provided. + */ + getPoints: function (quantity, stepRate, output) + { + return GetPoints(this, quantity, stepRate, output); + }, + + /** + * Returns a random point within the Rectangle's bounds. + * + * @method Phaser.Geom.Rectangle#getRandomPoint + * @since 3.0.0 + * + * @generic {Phaser.Geom.Point} O - [point,$return] + * + * @param {Phaser.Geom.Point} [point] - The object in which to store the `x` and `y` coordinates of the point. + * + * @return {Phaser.Geom.Point} The updated `point`, or a new Point if none was provided. + */ + getRandomPoint: function (point) + { + return Random(this, point); + }, + + /** + * Sets the position, width, and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setTo + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} y - The Y coordinate of the top left corner of the Rectangle. + * @param {number} width - The width of the Rectangle. + * @param {number} height - The height of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setTo: function (x, y, width, height) + { + this.x = x; + this.y = y; + this.width = width; + this.height = height; + + return this; + }, + + /** + * Resets the position, width, and height of the Rectangle to 0. + * + * @method Phaser.Geom.Rectangle#setEmpty + * @since 3.0.0 + * + * @return {this} This Rectangle object. + */ + setEmpty: function () + { + return this.setTo(0, 0, 0, 0); + }, + + /** + * Sets the position of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setPosition + * @since 3.0.0 + * + * @param {number} x - The X coordinate of the top left corner of the Rectangle. + * @param {number} [y=x] - The Y coordinate of the top left corner of the Rectangle. + * + * @return {this} This Rectangle object. + */ + setPosition: function (x, y) + { + if (y === undefined) { y = x; } + + this.x = x; + this.y = y; + + return this; + }, + + /** + * Sets the width and height of the Rectangle. + * + * @method Phaser.Geom.Rectangle#setSize + * @since 3.0.0 + * + * @param {number} width - The width to set the Rectangle to. + * @param {number} [height=width] - The height to set the Rectangle to. + * + * @return {this} This Rectangle object. + */ + setSize: function (width, height) + { + if (height === undefined) { height = width; } + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Determines if the Rectangle is empty. A Rectangle is empty if its width or height is less than or equal to 0. + * + * @method Phaser.Geom.Rectangle#isEmpty + * @since 3.0.0 + * + * @return {boolean} `true` if the Rectangle is empty. A Rectangle object is empty if its width or height is less than or equal to 0. + */ + isEmpty: function () + { + return (this.width <= 0 || this.height <= 0); + }, + + /** + * Returns a Line object that corresponds to the top of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineA + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the top of this Rectangle. + */ + getLineA: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.y, this.right, this.y); + + return line; + }, + + /** + * Returns a Line object that corresponds to the right of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineB + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the right of this Rectangle. + */ + getLineB: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.y, this.right, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the bottom of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineC + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the bottom of this Rectangle. + */ + getLineC: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.right, this.bottom, this.x, this.bottom); + + return line; + }, + + /** + * Returns a Line object that corresponds to the left of this Rectangle. + * + * @method Phaser.Geom.Rectangle#getLineD + * @since 3.0.0 + * + * @generic {Phaser.Geom.Line} O - [line,$return] + * + * @param {Phaser.Geom.Line} [line] - A Line object to set the results in. If `undefined` a new Line will be created. + * + * @return {Phaser.Geom.Line} A Line object that corresponds to the left of this Rectangle. + */ + getLineD: function (line) + { + if (line === undefined) { line = new Line(); } + + line.setTo(this.x, this.bottom, this.x, this.y); + + return line; + }, + + /** + * The x coordinate of the left of the Rectangle. + * Changing the left property of a Rectangle object has no effect on the y and height properties. However it does affect the width property, whereas changing the x value does not affect the width property. + * + * @name Phaser.Geom.Rectangle#left + * @type {number} + * @since 3.0.0 + */ + left: { + + get: function () + { + return this.x; + }, + + set: function (value) + { + if (value >= this.right) + { + this.width = 0; + } + else + { + this.width = this.right - value; + } + + this.x = value; + } + + }, + + /** + * The sum of the x and width properties. + * Changing the right property of a Rectangle object has no effect on the x, y and height properties, however it does affect the width property. + * + * @name Phaser.Geom.Rectangle#right + * @type {number} + * @since 3.0.0 + */ + right: { + + get: function () + { + return this.x + this.width; + }, + + set: function (value) + { + if (value <= this.x) + { + this.width = 0; + } + else + { + this.width = value - this.x; + } + } + + }, + + /** + * The y coordinate of the top of the Rectangle. Changing the top property of a Rectangle object has no effect on the x and width properties. + * However it does affect the height property, whereas changing the y value does not affect the height property. + * + * @name Phaser.Geom.Rectangle#top + * @type {number} + * @since 3.0.0 + */ + top: { + + get: function () + { + return this.y; + }, + + set: function (value) + { + if (value >= this.bottom) + { + this.height = 0; + } + else + { + this.height = (this.bottom - value); + } + + this.y = value; + } + + }, + + /** + * The sum of the y and height properties. + * Changing the bottom property of a Rectangle object has no effect on the x, y and width properties, but does change the height property. + * + * @name Phaser.Geom.Rectangle#bottom + * @type {number} + * @since 3.0.0 + */ + bottom: { + + get: function () + { + return this.y + this.height; + }, + + set: function (value) + { + if (value <= this.y) + { + this.height = 0; + } + else + { + this.height = value - this.y; + } + } + + }, + + /** + * The x coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerX + * @type {number} + * @since 3.0.0 + */ + centerX: { + + get: function () + { + return this.x + (this.width / 2); + }, + + set: function (value) + { + this.x = value - (this.width / 2); + } + + }, + + /** + * The y coordinate of the center of the Rectangle. + * + * @name Phaser.Geom.Rectangle#centerY + * @type {number} + * @since 3.0.0 + */ + centerY: { + + get: function () + { + return this.y + (this.height / 2); + }, + + set: function (value) + { + this.y = value - (this.height / 2); + } + + } + +}); + +module.exports = Rectangle; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GEOM_CONST = { + + /** + * A Circle Geometry object type. + * + * @name Phaser.Geom.CIRCLE + * @type {integer} + * @since 3.19.0 + */ + CIRCLE: 0, + + /** + * An Ellipse Geometry object type. + * + * @name Phaser.Geom.ELLIPSE + * @type {integer} + * @since 3.19.0 + */ + ELLIPSE: 1, + + /** + * A Line Geometry object type. + * + * @name Phaser.Geom.LINE + * @type {integer} + * @since 3.19.0 + */ + LINE: 2, + + /** + * A Point Geometry object type. + * + * @name Phaser.Geom.POINT + * @type {integer} + * @since 3.19.0 + */ + POINT: 3, + + /** + * A Polygon Geometry object type. + * + * @name Phaser.Geom.POLYGON + * @type {integer} + * @since 3.19.0 + */ + POLYGON: 4, + + /** + * A Rectangle Geometry object type. + * + * @name Phaser.Geom.RECTANGLE + * @type {integer} + * @since 3.19.0 + */ + RECTANGLE: 5, + + /** + * A Triangle Geometry object type. + * + * @name Phaser.Geom.TRIANGLE + * @type {integer} + * @since 3.19.0 + */ + TRIANGLE: 6 + +}; + +module.exports = GEOM_CONST; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var IsPlainObject = __webpack_require__(6); + +// @param {boolean} deep - Perform a deep copy? +// @param {object} target - The target object to copy to. +// @return {object} The extended object. + +/** + * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ + * + * @function Phaser.Utils.Objects.Extend + * @since 3.0.0 + * + * @param {...*} [args] - The objects that will be mixed. + * + * @return {object} The extended object. + */ +var Extend = function () +{ + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') + { + deep = target; + target = arguments[1] || {}; + + // skip the boolean and the target + i = 2; + } + + // extend Phaser if only one argument is passed + if (length === i) + { + target = this; + --i; + } + + for (; i < length; i++) + { + // Only deal with non-null/undefined values + if ((options = arguments[i]) != null) + { + // Extend the base object + for (name in options) + { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target === copy) + { + continue; + } + + // Recurse if we're merging plain objects or arrays + if (deep && copy && (IsPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) + { + if (copyIsArray) + { + copyIsArray = false; + clone = src && Array.isArray(src) ? src : []; + } + else + { + clone = src && IsPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = Extend(deep, clone, copy); + + // Don't bring in undefined values + } + else if (copy !== undefined) + { + target[name] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +module.exports = Extend; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Find the angle of a segment from (x1, y1) -> (x2, y2). + * + * @function Phaser.Math.Angle.Between + * @since 3.0.0 + * + * @param {number} x1 - The x coordinate of the first point. + * @param {number} y1 - The y coordinate of the first point. + * @param {number} x2 - The x coordinate of the second point. + * @param {number} y2 - The y coordinate of the second point. + * + * @return {number} The angle in radians. + */ +var Between = function (x1, y1, x2, y2) +{ + return Math.atan2(y2 - y1, x2 - x1); +}; + +module.exports = Between; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Normalize an angle to the [0, 2pi] range. + * + * @function Phaser.Math.Angle.Normalize + * @since 3.0.0 + * + * @param {number} angle - The angle to normalize, in radians. + * + * @return {number} The normalized angle, in radians. + */ +var Normalize = function (angle) +{ + angle = angle % (2 * Math.PI); + + if (angle >= 0) + { + return angle; + } + else + { + return angle + 2 * Math.PI; + } +}; + +module.exports = Normalize; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MathWrap = __webpack_require__(10); + +/** + * Wrap an angle. + * + * Wraps the angle to a value in the range of -PI to PI. + * + * @function Phaser.Math.Angle.Wrap + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in radians. + * + * @return {number} The wrapped angle, in radians. + */ +var Wrap = function (angle) +{ + return MathWrap(angle, -Math.PI, Math.PI); +}; + +module.exports = Wrap; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Wrap = __webpack_require__(10); + +/** + * Wrap an angle in degrees. + * + * Wraps the angle to a value in the range of -180 to 180. + * + * @function Phaser.Math.Angle.WrapDegrees + * @since 3.0.0 + * + * @param {number} angle - The angle to wrap, in degrees. + * + * @return {number} The wrapped angle, in degrees. + */ +var WrapDegrees = function (angle) +{ + return Wrap(angle, -180, 180); +}; + +module.exports = WrapDegrees; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Check whether the given values are fuzzily equal. + * + * Two numbers are fuzzily equal if their difference is less than `epsilon`. + * + * @function Phaser.Math.Fuzzy.Equal + * @since 3.0.0 + * + * @param {number} a - The first value. + * @param {number} b - The second value. + * @param {number} [epsilon=0.0001] - The epsilon. + * + * @return {boolean} `true` if the values are fuzzily equal, otherwise `false`. + */ +var Equal = function (a, b, epsilon) +{ + if (epsilon === undefined) { epsilon = 0.0001; } + + return Math.abs(a - b) < epsilon; +}; + +module.exports = Equal; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Factorial = __webpack_require__(34); + +/** + * Calculates the Bernstein basis from the three factorial coefficients. + * + * @function Phaser.Math.Bernstein + * @since 3.0.0 + * + * @param {number} n - The first value. + * @param {number} i - The second value. + * + * @return {number} The Bernstein basis of Factorial(n) / Factorial(i) / Factorial(n - i) + */ +var Bernstein = function (n, i) +{ + return Factorial(n) / Factorial(i) / Factorial(n - i); +}; + +module.exports = Bernstein; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates the factorial of a given number for integer values greater than 0. + * + * @function Phaser.Math.Factorial + * @since 3.0.0 + * + * @param {number} value - A positive integer to calculate the factorial of. + * + * @return {number} The factorial of the given number. + */ +var Factorial = function (value) +{ + if (value === 0) + { + return 1; + } + + var res = value; + + while (--value) + { + res *= value; + } + + return res; +}; + +module.exports = Factorial; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. + * + * @function Phaser.Math.CatmullRom + * @since 3.0.0 + * + * @param {number} t - The amount to interpolate by. + * @param {number} p0 - The first control point. + * @param {number} p1 - The second control point. + * @param {number} p2 - The third control point. + * @param {number} p3 - The fourth control point. + * + * @return {number} The Catmull-Rom value. + */ +var CatmullRom = function (t, p0, p1, p2, p3) +{ + var v0 = (p2 - p0) * 0.5; + var v1 = (p3 - p1) * 0.5; + var t2 = t * t; + var t3 = t * t2; + + return (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1; +}; + +module.exports = CatmullRom; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculates a linear (interpolation) value over t. + * + * @function Phaser.Math.Linear + * @since 3.0.0 + * + * @param {number} p0 - The first point. + * @param {number} p1 - The second point. + * @param {number} t - The percentage between p0 and p1 to return, represented as a number between 0 and 1. + * + * @return {number} The step t% of the way between p0 and p1. + */ +var Linear = function (p0, p1, t) +{ + return (p1 - p0) * t + p0; +}; + +module.exports = Linear; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smooth interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * @function Phaser.Math.SmoothStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmoothStep = function (x, min, max) +{ + if (x <= min) + { + return 0; + } + + if (x >= max) + { + return 1; + } + + x = (x - min) / (max - min); + + return x * x * (3 - 2 * x); +}; + +module.exports = SmoothStep; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Calculate a smoother interpolation percentage of `x` between `min` and `max`. + * + * The function receives the number `x` as an argument and returns 0 if `x` is less than or equal to the left edge, + * 1 if `x` is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, + * between 0 and 1 otherwise. + * + * Produces an even smoother interpolation than {@link Phaser.Math.SmoothStep}. + * + * @function Phaser.Math.SmootherStep + * @since 3.0.0 + * @see {@link https://en.wikipedia.org/wiki/Smoothstep#Variations} + * + * @param {number} x - The input value. + * @param {number} min - The minimum value, also known as the 'left edge', assumed smaller than the 'right edge'. + * @param {number} max - The maximum value, also known as the 'right edge', assumed greater than the 'left edge'. + * + * @return {number} The percentage of interpolation, between 0 and 1. + */ +var SmootherStep = function (x, min, max) +{ + x = Math.max(0, Math.min(1, (x - min) / (max - min))); + + return x * x * x * (x * (x * 6 - 15) + 10); +}; + +module.exports = SmootherStep; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotate a `point` around `x` and `y` to the given `angle`, at the same distance. + * + * In polar notation, this maps a point from (r, t) to (r, angle), vs. the origin (x, y). + * + * @function Phaser.Math.RotateAround + * @since 3.0.0 + * + * @generic {Phaser.Types.Math.Vector2Like} T - [point,$return] + * + * @param {(Phaser.Geom.Point|object)} point - The point to be rotated. + * @param {number} x - The horizontal coordinate to rotate around. + * @param {number} y - The vertical coordinate to rotate around. + * @param {number} angle - The angle of rotation in radians. + * + * @return {Phaser.Types.Math.Vector2Like} The given point. + */ +var RotateAround = function (point, x, y, angle) +{ + var c = Math.cos(angle); + var s = Math.sin(angle); + + var tx = point.x - x; + var ty = point.y - y; + + point.x = tx * c - ty * s + x; + point.y = tx * s + ty * c + y; + + return point; +}; + +module.exports = RotateAround; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Round a given number so it is further away from zero. That is, positive numbers are rounded up, and negative numbers are rounded down. + * + * @function Phaser.Math.RoundAwayFromZero + * @since 3.0.0 + * + * @param {number} value - The number to round. + * + * @return {number} The rounded number, rounded away from zero. + */ +var RoundAwayFromZero = function (value) +{ + // "Opposite" of truncate. + return (value > 0) ? Math.ceil(value) : Math.floor(value); +}; + +module.exports = RoundAwayFromZero; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = __webpack_require__(2); + +/** + * Takes the `x` and `y` coordinates and transforms them into the same space as + * defined by the position, rotation and scale values. + * + * @function Phaser.Math.TransformXY + * @since 3.0.0 + * + * @param {number} x - The x coordinate to be transformed. + * @param {number} y - The y coordinate to be transformed. + * @param {number} positionX - Horizontal position of the transform point. + * @param {number} positionY - Vertical position of the transform point. + * @param {number} rotation - Rotation of the transform point, in radians. + * @param {number} scaleX - Horizontal scale of the transform point. + * @param {number} scaleY - Vertical scale of the transform point. + * @param {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} [output] - The output vector, point or object for the translated coordinates. + * + * @return {(Phaser.Math.Vector2|Phaser.Geom.Point|object)} The translated point. + */ +var TransformXY = function (x, y, positionX, positionY, rotation, scaleX, scaleY, output) +{ + if (output === undefined) { output = new Vector2(); } + + var radianSin = Math.sin(rotation); + var radianCos = Math.cos(rotation); + + // Rotate and Scale + var a = radianCos * scaleX; + var b = radianSin * scaleX; + var c = -radianSin * scaleY; + var d = radianCos * scaleY; + + // Invert + var id = 1 / ((a * d) + (c * -b)); + + output.x = (d * id * x) + (-c * id * y) + (((positionY * c) - (positionX * d)) * id); + output.y = (a * id * y) + (-b * id * x) + (((-positionY * a) + (positionX * b)) * id); + + return output; +}; + +module.exports = TransformXY; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); + +/** + * @classdesc + * A three-dimensional matrix. + * + * Defaults to the identity matrix when instantiated. + * + * @class Matrix3 + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} [m] - Optional Matrix3 to copy values from. + */ +var Matrix3 = new Class({ + + initialize: + + function Matrix3 (m) + { + /** + * The matrix values. + * + * @name Phaser.Math.Matrix3#val + * @type {Float32Array} + * @since 3.0.0 + */ + this.val = new Float32Array(9); + + if (m) + { + // Assume Matrix3 with val: + this.copy(m); + } + else + { + // Default to identity + this.identity(); + } + }, + + /** + * Make a clone of this Matrix3. + * + * @method Phaser.Math.Matrix3#clone + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} A clone of this Matrix3. + */ + clone: function () + { + return new Matrix3(this); + }, + + /** + * This method is an alias for `Matrix3.copy`. + * + * @method Phaser.Math.Matrix3#set + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to set the values of this Matrix's from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + set: function (src) + { + return this.copy(src); + }, + + /** + * Copy the values of a given Matrix into this Matrix. + * + * @method Phaser.Math.Matrix3#copy + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + copy: function (src) + { + var out = this.val; + var a = src.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Copy the values of a given Matrix4 into this Matrix3. + * + * @method Phaser.Math.Matrix3#fromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromMat4: function (m) + { + var a = m.val; + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[4]; + out[4] = a[5]; + out[5] = a[6]; + out[6] = a[8]; + out[7] = a[9]; + out[8] = a[10]; + + return this; + }, + + /** + * Set the values of this Matrix from the given array. + * + * @method Phaser.Math.Matrix3#fromArray + * @since 3.0.0 + * + * @param {array} a - The array to copy the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromArray: function (a) + { + var out = this.val; + + out[0] = a[0]; + out[1] = a[1]; + out[2] = a[2]; + out[3] = a[3]; + out[4] = a[4]; + out[5] = a[5]; + out[6] = a[6]; + out[7] = a[7]; + out[8] = a[8]; + + return this; + }, + + /** + * Reset this Matrix to an identity (default) matrix. + * + * @method Phaser.Math.Matrix3#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + identity: function () + { + var out = this.val; + + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 0; + out[4] = 1; + out[5] = 0; + out[6] = 0; + out[7] = 0; + out[8] = 1; + + return this; + }, + + /** + * Transpose this Matrix. + * + * @method Phaser.Math.Matrix3#transpose + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + transpose: function () + { + var a = this.val; + var a01 = a[1]; + var a02 = a[2]; + var a12 = a[5]; + + a[1] = a[3]; + a[2] = a[6]; + a[3] = a01; + a[5] = a[7]; + a[6] = a02; + a[7] = a12; + + return this; + }, + + /** + * Invert this Matrix. + * + * @method Phaser.Math.Matrix3#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + invert: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b01 = a22 * a11 - a12 * a21; + var b11 = -a22 * a10 + a12 * a20; + var b21 = a21 * a10 - a11 * a20; + + // Calculate the determinant + var det = a00 * b01 + a01 * b11 + a02 * b21; + + if (!det) + { + return null; + } + + det = 1 / det; + + a[0] = b01 * det; + a[1] = (-a22 * a01 + a02 * a21) * det; + a[2] = (a12 * a01 - a02 * a11) * det; + a[3] = b11 * det; + a[4] = (a22 * a00 - a02 * a20) * det; + a[5] = (-a12 * a00 + a02 * a10) * det; + a[6] = b21 * det; + a[7] = (-a21 * a00 + a01 * a20) * det; + a[8] = (a11 * a00 - a01 * a10) * det; + + return this; + }, + + /** + * Calculate the adjoint, or adjugate, of this Matrix. + * + * @method Phaser.Math.Matrix3#adjoint + * @since 3.0.0 + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + adjoint: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + a[0] = (a11 * a22 - a12 * a21); + a[1] = (a02 * a21 - a01 * a22); + a[2] = (a01 * a12 - a02 * a11); + a[3] = (a12 * a20 - a10 * a22); + a[4] = (a00 * a22 - a02 * a20); + a[5] = (a02 * a10 - a00 * a12); + a[6] = (a10 * a21 - a11 * a20); + a[7] = (a01 * a20 - a00 * a21); + a[8] = (a00 * a11 - a01 * a10); + + return this; + }, + + /** + * Calculate the determinant of this Matrix. + * + * @method Phaser.Math.Matrix3#determinant + * @since 3.0.0 + * + * @return {number} The determinant of this Matrix. + */ + determinant: function () + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); + }, + + /** + * Multiply this Matrix by the given Matrix. + * + * @method Phaser.Math.Matrix3#multiply + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} src - The Matrix to multiply this Matrix by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + multiply: function (src) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + var a20 = a[6]; + var a21 = a[7]; + var a22 = a[8]; + + var b = src.val; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b10 = b[3]; + var b11 = b[4]; + var b12 = b[5]; + var b20 = b[6]; + var b21 = b[7]; + var b22 = b[8]; + + a[0] = b00 * a00 + b01 * a10 + b02 * a20; + a[1] = b00 * a01 + b01 * a11 + b02 * a21; + a[2] = b00 * a02 + b01 * a12 + b02 * a22; + + a[3] = b10 * a00 + b11 * a10 + b12 * a20; + a[4] = b10 * a01 + b11 * a11 + b12 * a21; + a[5] = b10 * a02 + b11 * a12 + b12 * a22; + + a[6] = b20 * a00 + b21 * a10 + b22 * a20; + a[7] = b20 * a01 + b21 * a11 + b22 * a21; + a[8] = b20 * a02 + b21 * a12 + b22 * a22; + + return this; + }, + + /** + * Translate this Matrix using the given Vector. + * + * @method Phaser.Math.Matrix3#translate + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + translate: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[6] = x * a[0] + y * a[3] + a[6]; + a[7] = x * a[1] + y * a[4] + a[7]; + a[8] = x * a[2] + y * a[5] + a[8]; + + return this; + }, + + /** + * Apply a rotation transformation to this Matrix. + * + * @method Phaser.Math.Matrix3#rotate + * @since 3.0.0 + * + * @param {number} rad - The angle in radians to rotate by. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + rotate: function (rad) + { + var a = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a10 = a[3]; + var a11 = a[4]; + var a12 = a[5]; + + var s = Math.sin(rad); + var c = Math.cos(rad); + + a[0] = c * a00 + s * a10; + a[1] = c * a01 + s * a11; + a[2] = c * a02 + s * a12; + + a[3] = c * a10 - s * a00; + a[4] = c * a11 - s * a01; + a[5] = c * a12 - s * a02; + + return this; + }, + + /** + * Apply a scale transformation to this Matrix. + * + * Uses the `x` and `y` components of the given Vector to scale the Matrix. + * + * @method Phaser.Math.Matrix3#scale + * @since 3.0.0 + * + * @param {(Phaser.Math.Vector2|Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + scale: function (v) + { + var a = this.val; + var x = v.x; + var y = v.y; + + a[0] = x * a[0]; + a[1] = x * a[1]; + a[2] = x * a[2]; + + a[3] = y * a[3]; + a[4] = y * a[4]; + a[5] = y * a[5]; + + return this; + }, + + /** + * Set the values of this Matrix from the given Quaternion. + * + * @method Phaser.Math.Matrix3#fromQuat + * @since 3.0.0 + * + * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + fromQuat: function (q) + { + var x = q.x; + var y = q.y; + var z = q.z; + var w = q.w; + + var x2 = x + x; + var y2 = y + y; + var z2 = z + z; + + var xx = x * x2; + var xy = x * y2; + var xz = x * z2; + + var yy = y * y2; + var yz = y * z2; + var zz = z * z2; + + var wx = w * x2; + var wy = w * y2; + var wz = w * z2; + + var out = this.val; + + out[0] = 1 - (yy + zz); + out[3] = xy + wz; + out[6] = xz - wy; + + out[1] = xy - wz; + out[4] = 1 - (xx + zz); + out[7] = yz + wx; + + out[2] = xz + wy; + out[5] = yz - wx; + out[8] = 1 - (xx + yy); + + return this; + }, + + /** + * Set the values of this Matrix3 to be normalized from the given Matrix4. + * + * @method Phaser.Math.Matrix3#normalFromMat4 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to normalize the values from. + * + * @return {Phaser.Math.Matrix3} This Matrix3. + */ + normalFromMat4: function (m) + { + var a = m.val; + var out = this.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = a00 * a11 - a01 * a10; + var b01 = a00 * a12 - a02 * a10; + var b02 = a00 * a13 - a03 * a10; + var b03 = a01 * a12 - a02 * a11; + + var b04 = a01 * a13 - a03 * a11; + var b05 = a02 * a13 - a03 * a12; + var b06 = a20 * a31 - a21 * a30; + var b07 = a20 * a32 - a22 * a30; + + var b08 = a20 * a33 - a23 * a30; + var b09 = a21 * a32 - a22 * a31; + var b10 = a21 * a33 - a23 * a31; + var b11 = a22 * a33 - a23 * a32; + + // Calculate the determinant + var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; + + if (!det) + { + return null; + } + + det = 1 / det; + + out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; + out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; + out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; + + out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; + out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; + out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; + + out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; + out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; + out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; + + return this; + } + +}); + +module.exports = Matrix3; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji +// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + +var Class = __webpack_require__(0); +var Matrix3 = __webpack_require__(42); +var NOOP = __webpack_require__(1); +var Vector3 = __webpack_require__(11); + +var EPSILON = 0.000001; + +// Some shared 'private' arrays +var siNext = new Int8Array([ 1, 2, 0 ]); +var tmp = new Float32Array([ 0, 0, 0 ]); + +var xUnitVec3 = new Vector3(1, 0, 0); +var yUnitVec3 = new Vector3(0, 1, 0); + +var tmpvec = new Vector3(); +var tmpMat3 = new Matrix3(); + +/** + * @classdesc + * A quaternion. + * + * @class Quaternion + * @memberof Phaser.Math + * @constructor + * @since 3.0.0 + * + * @param {number} [x=0] - The x component. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=1] - The w component. + */ +var Quaternion = new Class({ + + initialize: + + function Quaternion (x, y, z, w) + { + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_x + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_y + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_z + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#_w + * @type {number} + * @default 0 + * @private + * @since 3.50.0 + */ + + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); + } + }, + + /** + * Copy the components of a given Quaternion or Vector into this Quaternion. + * + * @method Phaser.Math.Quaternion#copy + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} src - The Quaternion or Vector to copy the components from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + copy: function (src) + { + return this.set(src); + }, + + /** + * Set the components of this Quaternion and optionally call the `onChangeCallback`. + * + * @method Phaser.Math.Quaternion#set + * @since 3.0.0 + * + * @param {(number|object)} [x=0] - The x component, or an object containing x, y, z, and w components. + * @param {number} [y=0] - The y component. + * @param {number} [z=0] - The z component. + * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + set: function (x, y, z, w, update) + { + if (update === undefined) { update = true; } + + if (typeof x === 'object') + { + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; + } + else + { + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); + } + + return this; + }, + + /** + * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. + * + * @method Phaser.Math.Quaternion#add + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to add to this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + add: function (v) + { + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Subtract a given Quaternion or Vector from this Quaternion. Subtraction is component-wise. + * + * @method Phaser.Math.Quaternion#subtract + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to subtract from this Quaternion. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + subtract: function (v) + { + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Scale this Quaternion by the given value. + * + * @method Phaser.Math.Quaternion#scale + * @since 3.0.0 + * + * @param {number} scale - The value to scale this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + scale: function (scale) + { + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the length of this Quaternion. + * + * @method Phaser.Math.Quaternion#length + * @since 3.0.0 + * + * @return {number} The length of this Quaternion. + */ + length: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return Math.sqrt(x * x + y * y + z * z + w * w); + }, + + /** + * Calculate the length of this Quaternion squared. + * + * @method Phaser.Math.Quaternion#lengthSq + * @since 3.0.0 + * + * @return {number} The length of this Quaternion, squared. + */ + lengthSq: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + + return x * x + y * y + z * z + w * w; + }, + + /** + * Normalize this Quaternion. + * + * @method Phaser.Math.Quaternion#normalize + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + normalize: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + var w = this.w; + var len = x * x + y * y + z * z + w * w; + + if (len > 0) + { + len = 1 / Math.sqrt(len); + + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; + } + + this.onChangeCallback(this); + + return this; + }, + + /** + * Calculate the dot product of this Quaternion and the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#dot + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to dot product with this Quaternion. + * + * @return {number} The dot product of this Quaternion and the given Quaternion or Vector. + */ + dot: function (v) + { + return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; + }, + + /** + * Linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#lerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} v - The Quaternion or Vector to interpolate towards. + * @param {number} [t=0] - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + lerp: function (v, t) + { + if (t === undefined) { t = 0; } + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); + }, + + /** + * Rotates this Quaternion based on the two given vectors. + * + * @method Phaser.Math.Quaternion#rotationTo + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} a - The transform rotation vector. + * @param {Phaser.Math.Vector3} b - The target rotation vector. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotationTo: function (a, b) + { + var dot = a.x * b.x + a.y * b.y + a.z * b.z; + + if (dot < -0.999999) + { + if (tmpvec.copy(xUnitVec3).cross(a).length() < EPSILON) + { + tmpvec.copy(yUnitVec3).cross(a); + } + + tmpvec.normalize(); + + return this.setAxisAngle(tmpvec, Math.PI); + + } + else if (dot > 0.999999) + { + return this.set(0, 0, 0, 1); + } + else + { + tmpvec.copy(a).cross(b); + + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; + + return this.normalize(); + } + }, + + /** + * Set the axes of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxes + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} view - The view axis. + * @param {Phaser.Math.Vector3} right - The right axis. + * @param {Phaser.Math.Vector3} up - The upwards axis. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxes: function (view, right, up) + { + var m = tmpMat3.val; + + m[0] = right.x; + m[3] = right.y; + m[6] = right.z; + + m[1] = up.x; + m[4] = up.y; + m[7] = up.z; + + m[2] = -view.x; + m[5] = -view.y; + m[8] = -view.z; + + return this.fromMat3(tmpMat3).normalize(); + }, + + /** + * Reset this Matrix to an identity (default) Quaternion. + * + * @method Phaser.Math.Quaternion#identity + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + identity: function () + { + return this.set(0, 0, 0, 1); + }, + + /** + * Set the axis angle of this Quaternion. + * + * @method Phaser.Math.Quaternion#setAxisAngle + * @since 3.0.0 + * + * @param {Phaser.Math.Vector3} axis - The axis. + * @param {number} rad - The angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setAxisAngle: function (axis, rad) + { + rad = rad * 0.5; + + var s = Math.sin(rad); + + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); + }, + + /** + * Multiply this Quaternion by the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#multiply + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to multiply this Quaternion by. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + multiply: function (b) + { + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); + }, + + /** + * Smoothly linearly interpolate this Quaternion towards the given Quaternion or Vector. + * + * @method Phaser.Math.Quaternion#slerp + * @since 3.0.0 + * + * @param {(Phaser.Math.Quaternion|Phaser.Math.Vector4)} b - The Quaternion or Vector to interpolate towards. + * @param {number} t - The percentage of interpolation. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + slerp: function (b, t) + { + // benchmarks: http://jsperf.com/quaternion-slerp-implementations + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = b.x; + var by = b.y; + var bz = b.z; + var bw = b.w; + + // calc cosine + var cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if (cosom < 0) + { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + var scale0 = 1 - t; + var scale1 = t; + + // calculate coefficients + if ((1 - cosom) > EPSILON) + { + // standard case (slerp) + var omega = Math.acos(cosom); + var sinom = Math.sin(omega); + + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } + + // calculate final values + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); + }, + + /** + * Invert this Quaternion. + * + * @method Phaser.Math.Quaternion#invert + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + invert: function () + { + var a0 = this.x; + var a1 = this.y; + var a2 = this.z; + var a3 = this.w; + + var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; + var invDot = (dot) ? 1 / dot : 0; + + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); + }, + + /** + * Convert this Quaternion into its conjugate. + * + * Sets the x, y and z components. + * + * @method Phaser.Math.Quaternion#conjugate + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + conjugate: function () + { + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); + + return this; + }, + + /** + * Rotate this Quaternion on the X axis. + * + * @method Phaser.Math.Quaternion#rotateX + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateX: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bx = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); + }, + + /** + * Rotate this Quaternion on the Y axis. + * + * @method Phaser.Math.Quaternion#rotateY + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateY: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var by = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); + }, + + /** + * Rotate this Quaternion on the Z axis. + * + * @method Phaser.Math.Quaternion#rotateZ + * @since 3.0.0 + * + * @param {number} rad - The rotation angle in radians. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + rotateZ: function (rad) + { + rad *= 0.5; + + var ax = this.x; + var ay = this.y; + var az = this.z; + var aw = this.w; + + var bz = Math.sin(rad); + var bw = Math.cos(rad); + + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); + }, + + /** + * Create a unit (or rotation) Quaternion from its x, y, and z components. + * + * Sets the w component. + * + * @method Phaser.Math.Quaternion#calculateW + * @since 3.0.0 + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + calculateW: function () + { + var x = this.x; + var y = this.y; + var z = this.z; + + this.w = -Math.sqrt(1.0 - x * x - y * y - z * z); + + return this; + }, + + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + + /** + * Convert the given Matrix into this Quaternion. + * + * @method Phaser.Math.Quaternion#fromMat3 + * @since 3.0.0 + * + * @param {Phaser.Math.Matrix3} mat - The Matrix to convert from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + fromMat3: function (mat) + { + // benchmarks: + // http://jsperf.com/typed-array-access-speed + // http://jsperf.com/conversion-of-3x3-matrix-to-quaternion + + // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes + // article "Quaternion Calculus and Fast Animation". + var m = mat.val; + var fTrace = m[0] + m[4] + m[8]; + var fRoot; + + if (fTrace > 0) + { + // |w| > 1/2, may as well choose w > 1/2 + fRoot = Math.sqrt(fTrace + 1.0); // 2w + + this.w = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; // 1/(4w) + + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; + } + else + { + // |w| <= 1/2 + var i = 0; + + if (m[4] > m[0]) + { + i = 1; + } + + if (m[8] > m[i * 3 + i]) + { + i = 2; + } + + var j = siNext[i]; + var k = siNext[j]; + + // This isn't quite as clean without array access + fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1); + tmp[i] = 0.5 * fRoot; + + fRoot = 0.5 / fRoot; + + tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; + tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; + + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + } + + this.onChangeCallback(this); + + return this; + } + +}); + +module.exports = Quaternion; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Extend = __webpack_require__(27); +var XHRSettings = __webpack_require__(45); + +/** + * Takes two XHRSettings Objects and creates a new XHRSettings object from them. + * + * The new object is seeded by the values given in the global settings, but any setting in + * the local object overrides the global ones. + * + * @function Phaser.Loader.MergeXHRSettings + * @since 3.0.0 + * + * @param {Phaser.Types.Loader.XHRSettingsObject} global - The global XHRSettings object. + * @param {Phaser.Types.Loader.XHRSettingsObject} local - The local XHRSettings object. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} A newly formed XHRSettings object. + */ +var MergeXHRSettings = function (global, local) +{ + var output = (global === undefined) ? XHRSettings() : Extend({}, global); + + if (local) + { + for (var setting in local) + { + if (local[setting] !== undefined) + { + output[setting] = local[setting]; + } + } + } + + return output; +}; + +module.exports = MergeXHRSettings; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Creates an XHRSettings Object with default values. + * + * @function Phaser.Loader.XHRSettings + * @since 3.0.0 + * + * @param {XMLHttpRequestResponseType} [responseType=''] - The responseType, such as 'text'. + * @param {boolean} [async=true] - Should the XHR request use async or not? + * @param {string} [user=''] - Optional username for the XHR request. + * @param {string} [password=''] - Optional password for the XHR request. + * @param {integer} [timeout=0] - Optional XHR timeout value. + * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. + * + * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. + */ +var XHRSettings = function (responseType, async, user, password, timeout, withCredentials) +{ + if (responseType === undefined) { responseType = ''; } + if (async === undefined) { async = true; } + if (user === undefined) { user = ''; } + if (password === undefined) { password = ''; } + if (timeout === undefined) { timeout = 0; } + if (withCredentials === undefined) { withCredentials = false; } + + // Before sending a request, set the xhr.responseType to "text", + // "arraybuffer", "blob", or "document", depending on your data needs. + // Note, setting xhr.responseType = '' (or omitting) will default the response to "text". + + return { + + // Ignored by the Loader, only used by File. + responseType: responseType, + + async: async, + + // credentials + user: user, + password: password, + + // timeout in ms (0 = no timeout) + timeout: timeout, + + // setRequestHeader + headers: undefined, + header: undefined, + headerValue: undefined, + requestedWith: false, + + // overrideMimeType + overrideMimeType: undefined, + + // withCredentials + withCredentials: withCredentials + + }; +}; + +module.exports = XHRSettings; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for calculating and setting the size of a non-Frame based Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.ComputedSize + * @since 3.0.0 + */ + +var ComputedSize = { + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#width + * @type {number} + * @since 3.0.0 + */ + width: 0, + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + * + * @name Phaser.GameObjects.Components.ComputedSize#height + * @type {number} + * @since 3.0.0 + */ + height: 0, + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayWidth + * @type {number} + * @since 3.0.0 + */ + displayWidth: { + + get: function () + { + return this.scaleX * this.width; + }, + + set: function (value) + { + this.scaleX = value / this.width; + } + + }, + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + * + * @name Phaser.GameObjects.Components.ComputedSize#displayHeight + * @type {number} + * @since 3.0.0 + */ + displayHeight: { + + get: function () + { + return this.scaleY * this.height; + }, + + set: function (value) + { + this.scaleY = value / this.height; + } + + }, + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * + * @method Phaser.GameObjects.Components.ComputedSize#setSize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setSize: function (width, height) + { + this.width = width; + this.height = height; + + return this; + }, + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * + * @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize + * @since 3.4.0 + * + * @param {number} width - The width of this Game Object. + * @param {number} height - The height of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDisplaySize: function (width, height) + { + this.displayWidth = width; + this.displayHeight = height; + + return this; + } + +}; + +module.exports = ComputedSize; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for setting the depth of a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Depth + * @since 3.0.0 + */ + +var Depth = { + + /** + * Private internal value. Holds the depth of the Game Object. + * + * @name Phaser.GameObjects.Components.Depth#_depth + * @type {integer} + * @private + * @default 0 + * @since 3.0.0 + */ + _depth: 0, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @name Phaser.GameObjects.Components.Depth#depth + * @type {number} + * @since 3.0.0 + */ + depth: { + + get: function () + { + return this._depth; + }, + + set: function (value) + { + this.scene.sys.queueDepthSort(); + this._depth = value; + } + + }, + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * + * @method Phaser.GameObjects.Components.Depth#setDepth + * @since 3.0.0 + * + * @param {integer} value - The depth of this Game Object. + * + * @return {this} This Game Object instance. + */ + setDepth: function (value) + { + if (value === undefined) { value = 0; } + + this.depth = value; + + return this; + } + +}; + +module.exports = Depth; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for visually flipping a Game Object. + * Should be applied as a mixin and not used directly. + * + * @namespace Phaser.GameObjects.Components.Flip + * @since 3.0.0 + */ + +var Flip = { + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipX + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipX: false, + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @name Phaser.GameObjects.Components.Flip#flipY + * @type {boolean} + * @default false + * @since 3.0.0 + */ + flipY: false, + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipX + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipX: function () + { + this.flipX = !this.flipX; + + return this; + }, + + /** + * Toggles the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#toggleFlipY + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + toggleFlipY: function () + { + this.flipY = !this.flipY; + + return this; + }, + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlipX + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipX: function (value) + { + this.flipX = value; + + return this; + }, + + /** + * Sets the vertical flipped state of this Game Object. + * + * @method Phaser.GameObjects.Components.Flip#setFlipY + * @since 3.0.0 + * + * @param {boolean} value - The flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlipY: function (value) + { + this.flipY = value; + + return this; + }, + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * + * @method Phaser.GameObjects.Components.Flip#setFlip + * @since 3.0.0 + * + * @param {boolean} x - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param {boolean} y - The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * + * @return {this} This Game Object instance. + */ + setFlip: function (x, y) + { + this.flipX = x; + this.flipY = y; + + return this; + }, + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + * + * @method Phaser.GameObjects.Components.Flip#resetFlip + * @since 3.0.0 + * + * @return {this} This Game Object instance. + */ + resetFlip: function () + { + this.flipX = false; + this.flipY = false; + + return this; + } + +}; + +module.exports = Flip; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Provides methods used for getting and setting the Scroll Factor of a Game Object. + * + * @namespace Phaser.GameObjects.Components.ScrollFactor + * @since 3.0.0 + */ + +var ScrollFactor = { + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorX: 1, + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @name Phaser.GameObjects.Components.ScrollFactor#scrollFactorY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scrollFactorY: 1, + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * + * @method Phaser.GameObjects.Components.ScrollFactor#setScrollFactor + * @since 3.0.0 + * + * @param {number} x - The horizontal scroll factor of this Game Object. + * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScrollFactor: function (x, y) + { + if (y === undefined) { y = x; } + + this.scrollFactorX = x; + this.scrollFactorY = y; + + return this; + } + +}; + +module.exports = ScrollFactor; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var MATH_CONST = __webpack_require__(3); +var TransformMatrix = __webpack_require__(23); +var TransformXY = __webpack_require__(41); +var WrapAngle = __webpack_require__(30); +var WrapAngleDegrees = __webpack_require__(31); +var Vector2 = __webpack_require__(2); + +// global bitmask flag for GameObject.renderMask (used by Scale) +var _FLAG = 4; // 0100 + +/** + * Provides methods used for getting and setting the position, scale and rotation of a Game Object. + * + * @namespace Phaser.GameObjects.Components.Transform + * @since 3.0.0 + */ + +var Transform = { + + /** + * Private internal value. Holds the horizontal scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleX + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleX: 1, + + /** + * Private internal value. Holds the vertical scale value. + * + * @name Phaser.GameObjects.Components.Transform#_scaleY + * @type {number} + * @private + * @default 1 + * @since 3.0.0 + */ + _scaleY: 1, + + /** + * Private internal value. Holds the rotation value in radians. + * + * @name Phaser.GameObjects.Components.Transform#_rotation + * @type {number} + * @private + * @default 0 + * @since 3.0.0 + */ + _rotation: 0, + + /** + * The x position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: 0, + + /** + * The y position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: 0, + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + * + * @name Phaser.GameObjects.Components.Transform#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: 0, + + /** + * The w position of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: 0, + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + * + * @name Phaser.GameObjects.Components.Transform#scale + * @type {number} + * @default 1 + * @since 3.18.0 + */ + scale: { + + get: function () + { + return (this._scaleX + this._scaleY) / 2; + }, + + set: function (value) + { + this._scaleX = value; + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The horizontal scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleX + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleX: { + + get: function () + { + return this._scaleX; + }, + + set: function (value) + { + this._scaleX = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The vertical scale of this Game Object. + * + * @name Phaser.GameObjects.Components.Transform#scaleY + * @type {number} + * @default 1 + * @since 3.0.0 + */ + scaleY: { + + get: function () + { + return this._scaleY; + }, + + set: function (value) + { + this._scaleY = value; + + if (value === 0) + { + this.renderFlags &= ~_FLAG; + } + else + { + this.renderFlags |= _FLAG; + } + } + + }, + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + * + * @name Phaser.GameObjects.Components.Transform#angle + * @type {integer} + * @default 0 + * @since 3.0.0 + */ + angle: { + + get: function () + { + return WrapAngleDegrees(this._rotation * MATH_CONST.RAD_TO_DEG); + }, + + set: function (value) + { + // value is in degrees + this.rotation = WrapAngleDegrees(value) * MATH_CONST.DEG_TO_RAD; + } + }, + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + * + * @name Phaser.GameObjects.Components.Transform#rotation + * @type {number} + * @default 1 + * @since 3.0.0 + */ + rotation: { + + get: function () + { + return this._rotation; + }, + + set: function (value) + { + // value is in radians + this._rotation = WrapAngle(value); + } + }, + + /** + * Sets the position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setPosition + * @since 3.0.0 + * + * @param {number} [x=0] - The x position of this Game Object. + * @param {number} [y=x] - The y position of this Game Object. If not set it will use the `x` value. + * @param {number} [z=0] - The z position of this Game Object. + * @param {number} [w=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setPosition: function (x, y, z, w) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = x; } + if (z === undefined) { z = 0; } + if (w === undefined) { w = 0; } + + this.x = x; + this.y = y; + this.z = z; + this.w = w; + + return this; + }, + + /** + * Copies an object's coordinates to this Game Object's position. + * + * @method Phaser.GameObjects.Components.Transform#copyPosition + * @since 3.50.0 + * + * @param {(Phaser.Types.Math.Vector2Like|Phaser.Types.Math.Vector3Like|Phaser.Types.Math.Vector4Like)} source - An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + * + * @return {this} This Game Object instance. + */ + copyPosition: function (source) + { + if (source.x !== undefined) { this.x = source.x; } + if (source.y !== undefined) { this.y = source.y; } + if (source.z !== undefined) { this.z = source.z; } + if (source.w !== undefined) { this.w = source.w; } + + return this; + }, + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * + * @method Phaser.GameObjects.Components.Transform#setRandomPosition + * @since 3.8.0 + * + * @param {number} [x=0] - The x position of the top-left of the random area. + * @param {number} [y=0] - The y position of the top-left of the random area. + * @param {number} [width] - The width of the random area. + * @param {number} [height] - The height of the random area. + * + * @return {this} This Game Object instance. + */ + setRandomPosition: function (x, y, width, height) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (width === undefined) { width = this.scene.sys.scale.width; } + if (height === undefined) { height = this.scene.sys.scale.height; } + + this.x = x + (Math.random() * width); + this.y = y + (Math.random() * height); + + return this; + }, + + /** + * Sets the rotation of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setRotation + * @since 3.0.0 + * + * @param {number} [radians=0] - The rotation of this Game Object, in radians. + * + * @return {this} This Game Object instance. + */ + setRotation: function (radians) + { + if (radians === undefined) { radians = 0; } + + this.rotation = radians; + + return this; + }, + + /** + * Sets the angle of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setAngle + * @since 3.0.0 + * + * @param {number} [degrees=0] - The rotation of this Game Object, in degrees. + * + * @return {this} This Game Object instance. + */ + setAngle: function (degrees) + { + if (degrees === undefined) { degrees = 0; } + + this.angle = degrees; + + return this; + }, + + /** + * Sets the scale of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setScale + * @since 3.0.0 + * + * @param {number} x - The horizontal scale of this Game Object. + * @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value. + * + * @return {this} This Game Object instance. + */ + setScale: function (x, y) + { + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } + + this.scaleX = x; + this.scaleY = y; + + return this; + }, + + /** + * Sets the x position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setX + * @since 3.0.0 + * + * @param {number} [value=0] - The x position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setX: function (value) + { + if (value === undefined) { value = 0; } + + this.x = value; + + return this; + }, + + /** + * Sets the y position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setY + * @since 3.0.0 + * + * @param {number} [value=0] - The y position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setY: function (value) + { + if (value === undefined) { value = 0; } + + this.y = value; + + return this; + }, + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * + * @method Phaser.GameObjects.Components.Transform#setZ + * @since 3.0.0 + * + * @param {number} [value=0] - The z position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setZ: function (value) + { + if (value === undefined) { value = 0; } + + this.z = value; + + return this; + }, + + /** + * Sets the w position of this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#setW + * @since 3.0.0 + * + * @param {number} [value=0] - The w position of this Game Object. + * + * @return {this} This Game Object instance. + */ + setW: function (value) + { + if (value === undefined) { value = 0; } + + this.w = value; + + return this; + }, + + /** + * Gets the local transform matrix for this Game Object. + * + * @method Phaser.GameObjects.Components.Transform#getLocalTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getLocalTransformMatrix: function (tempMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + + return tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + }, + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * + * @method Phaser.GameObjects.Components.Transform#getWorldTransformMatrix + * @since 3.4.0 + * + * @param {Phaser.GameObjects.Components.TransformMatrix} [tempMatrix] - The matrix to populate with the values from this Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A temporary matrix to hold parent values during the calculations. + * + * @return {Phaser.GameObjects.Components.TransformMatrix} The populated Transform Matrix. + */ + getWorldTransformMatrix: function (tempMatrix, parentMatrix) + { + if (tempMatrix === undefined) { tempMatrix = new TransformMatrix(); } + if (parentMatrix === undefined) { parentMatrix = new TransformMatrix(); } + + var parent = this.parentContainer; + + if (!parent) + { + return this.getLocalTransformMatrix(tempMatrix); + } + + tempMatrix.applyITRS(this.x, this.y, this._rotation, this._scaleX, this._scaleY); + + while (parent) + { + parentMatrix.applyITRS(parent.x, parent.y, parent._rotation, parent._scaleX, parent._scaleY); + + parentMatrix.multiply(tempMatrix, tempMatrix); + + parent = parent.parentContainer; + } + + return tempMatrix; + }, + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * + * @method Phaser.GameObjects.Components.Transform#getLocalPoint + * @since 3.50.0 + * + * @param {number} x - The x position to translate. + * @param {number} y - The y position to translate. + * @param {Phaser.Math.Vector2} [point] - A Vector2, or point-like object, to store the results in. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera which is being tested against. If not given will use the Scene default camera. + * + * @return {Phaser.Math.Vector2} The translated point. + */ + getLocalPoint: function (x, y, point, camera) + { + if (!point) { point = new Vector2(); } + if (!camera) { camera = this.scene.sys.cameras.main; } + + var csx = camera.scrollX; + var csy = camera.scrollY; + + var px = x + (csx * this.scrollFactorX) - csx; + var py = y + (csy * this.scrollFactorY) - csy; + + if (this.parentContainer) + { + this.getWorldTransformMatrix().applyInverse(px, py, point); + } + else + { + TransformXY(px, py, this.x, this.y, this.rotation, this.scaleX, this.scaleY, point); + } + + // Normalize origin + if (this._originComponent) + { + point.x += this._displayOriginX; + point.y += this._displayOriginY; + } + + return point; + }, + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + * + * @method Phaser.GameObjects.Components.Transform#getParentRotation + * @since 3.18.0 + * + * @return {number} The sum total rotation, in radians, of all parent containers of this Game Object. + */ + getParentRotation: function () + { + var rotation = 0; + + var parent = this.parentContainer; + + while (parent) + { + rotation += parent.rotation; + + parent = parent.parentContainer; + } + + return rotation; + } + +}; + +module.exports = Transform; + + +/***/ }), +/* 51 */ /***/ (function(module, exports) { /** @@ -10241,7 +11089,7 @@ module.exports = Visible; /***/ }), -/* 53 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -10251,10 +11099,10 @@ module.exports = Visible; */ var Class = __webpack_require__(0); -var ComponentsToJSON = __webpack_require__(54); +var ComponentsToJSON = __webpack_require__(53); var DataManager = __webpack_require__(219); -var EventEmitter = __webpack_require__(55); -var Events = __webpack_require__(22); +var EventEmitter = __webpack_require__(226); +var Events = __webpack_require__(54); /** * @classdesc @@ -10282,12 +11130,15 @@ var GameObject = new Class({ EventEmitter.call(this); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * * @name Phaser.GameObjects.GameObject#scene * @type {Phaser.Scene} - * @protected * @since 3.0.0 */ this.scene = scene; @@ -10979,7 +11830,7 @@ module.exports = GameObject; /***/ }), -/* 54 */ +/* 53 */ /***/ (function(module, exports) { /** @@ -11040,350 +11891,40 @@ module.exports = ToJSON; /***/ }), -/* 55 */ +/* 54 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - - -var has = Object.prototype.hasOwnProperty - , prefix = '~'; +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ /** - * Constructor to create a storage for our `EE` objects. - * An `Events` instance is a plain object whose properties are event names. - * - * @constructor - * @private + * @namespace Phaser.GameObjects.Events */ -function Events() {} -// -// We try to not inherit from `Object.prototype`. In some engines creating an -// instance in this way is faster than calling `Object.create(null)` directly. -// If `Object.create(null)` is not supported we prefix the event names with a -// character to make sure that the built-in object properties are not -// overridden or used as an attack vector. -// -if (Object.create) { - Events.prototype = Object.create(null); +module.exports = { - // - // This hack is needed because the `__proto__` property is still inherited in - // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. - // - if (!new Events().__proto__) prefix = false; -} + ADDED_TO_SCENE: __webpack_require__(227), + DESTROY: __webpack_require__(228), + REMOVED_FROM_SCENE: __webpack_require__(229), + VIDEO_COMPLETE: __webpack_require__(230), + VIDEO_CREATED: __webpack_require__(231), + VIDEO_ERROR: __webpack_require__(232), + VIDEO_LOOP: __webpack_require__(233), + VIDEO_PLAY: __webpack_require__(234), + VIDEO_SEEKED: __webpack_require__(235), + VIDEO_SEEKING: __webpack_require__(236), + VIDEO_STOP: __webpack_require__(237), + VIDEO_TIMEOUT: __webpack_require__(238), + VIDEO_UNLOCKED: __webpack_require__(239) -/** - * Representation of a single event listener. - * - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} [once=false] Specify if the listener is a one-time listener. - * @constructor - * @private - */ -function EE(fn, context, once) { - this.fn = fn; - this.context = context; - this.once = once || false; -} - -/** - * Add a listener for a given event. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} context The context to invoke the listener with. - * @param {Boolean} once Specify if the listener is a one-time listener. - * @returns {EventEmitter} - * @private - */ -function addListener(emitter, event, fn, context, once) { - if (typeof fn !== 'function') { - throw new TypeError('The listener must be a function'); - } - - var listener = new EE(fn, context || emitter, once) - , evt = prefix ? prefix + event : event; - - if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; - else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); - else emitter._events[evt] = [emitter._events[evt], listener]; - - return emitter; -} - -/** - * Clear event by name. - * - * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. - * @param {(String|Symbol)} evt The Event name. - * @private - */ -function clearEvent(emitter, evt) { - if (--emitter._eventsCount === 0) emitter._events = new Events(); - else delete emitter._events[evt]; -} - -/** - * Minimal `EventEmitter` interface that is molded against the Node.js - * `EventEmitter` interface. - * - * @constructor - * @public - */ -function EventEmitter() { - this._events = new Events(); - this._eventsCount = 0; -} - -/** - * Return an array listing the events for which the emitter has registered - * listeners. - * - * @returns {Array} - * @public - */ -EventEmitter.prototype.eventNames = function eventNames() { - var names = [] - , events - , name; - - if (this._eventsCount === 0) return names; - - for (name in (events = this._events)) { - if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); - } - - if (Object.getOwnPropertySymbols) { - return names.concat(Object.getOwnPropertySymbols(events)); - } - - return names; }; -/** - * Return the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Array} The registered listeners. - * @public - */ -EventEmitter.prototype.listeners = function listeners(event) { - var evt = prefix ? prefix + event : event - , handlers = this._events[evt]; - - if (!handlers) return []; - if (handlers.fn) return [handlers.fn]; - - for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { - ee[i] = handlers[i].fn; - } - - return ee; -}; - -/** - * Return the number of listeners listening to a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Number} The number of listeners. - * @public - */ -EventEmitter.prototype.listenerCount = function listenerCount(event) { - var evt = prefix ? prefix + event : event - , listeners = this._events[evt]; - - if (!listeners) return 0; - if (listeners.fn) return 1; - return listeners.length; -}; - -/** - * Calls each of the listeners registered for a given event. - * - * @param {(String|Symbol)} event The event name. - * @returns {Boolean} `true` if the event had listeners, else `false`. - * @public - */ -EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return false; - - var listeners = this._events[evt] - , len = arguments.length - , args - , i; - - if (listeners.fn) { - if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); - - switch (len) { - case 1: return listeners.fn.call(listeners.context), true; - case 2: return listeners.fn.call(listeners.context, a1), true; - case 3: return listeners.fn.call(listeners.context, a1, a2), true; - case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; - case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; - case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; - } - - for (i = 1, args = new Array(len -1); i < len; i++) { - args[i - 1] = arguments[i]; - } - - listeners.fn.apply(listeners.context, args); - } else { - var length = listeners.length - , j; - - for (i = 0; i < length; i++) { - if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); - - switch (len) { - case 1: listeners[i].fn.call(listeners[i].context); break; - case 2: listeners[i].fn.call(listeners[i].context, a1); break; - case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; - case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; - default: - if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { - args[j - 1] = arguments[j]; - } - - listeners[i].fn.apply(listeners[i].context, args); - } - } - } - - return true; -}; - -/** - * Add a listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.on = function on(event, fn, context) { - return addListener(this, event, fn, context, false); -}; - -/** - * Add a one-time listener for a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn The listener function. - * @param {*} [context=this] The context to invoke the listener with. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.once = function once(event, fn, context) { - return addListener(this, event, fn, context, true); -}; - -/** - * Remove the listeners of a given event. - * - * @param {(String|Symbol)} event The event name. - * @param {Function} fn Only remove the listeners that match this function. - * @param {*} context Only remove the listeners that have this context. - * @param {Boolean} once Only remove one-time listeners. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { - var evt = prefix ? prefix + event : event; - - if (!this._events[evt]) return this; - if (!fn) { - clearEvent(this, evt); - return this; - } - - var listeners = this._events[evt]; - - if (listeners.fn) { - if ( - listeners.fn === fn && - (!once || listeners.once) && - (!context || listeners.context === context) - ) { - clearEvent(this, evt); - } - } else { - for (var i = 0, events = [], length = listeners.length; i < length; i++) { - if ( - listeners[i].fn !== fn || - (once && !listeners[i].once) || - (context && listeners[i].context !== context) - ) { - events.push(listeners[i]); - } - } - - // - // Reset the array, or remove it completely if we have no more listeners. - // - if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; - else clearEvent(this, evt); - } - - return this; -}; - -/** - * Remove all listeners, or those of the specified event. - * - * @param {(String|Symbol)} [event] The event name. - * @returns {EventEmitter} `this`. - * @public - */ -EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { - var evt; - - if (event) { - evt = prefix ? prefix + event : event; - if (this._events[evt]) clearEvent(this, evt); - } else { - this._events = new Events(); - this._eventsCount = 0; - } - - return this; -}; - -// -// Alias methods names because people roll like that. -// -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -EventEmitter.prototype.addListener = EventEmitter.prototype.on; - -// -// Expose the prefix. -// -EventEmitter.prefixed = prefix; - -// -// Allow `EventEmitter` to be imported as module namespace. -// -EventEmitter.EventEmitter = EventEmitter; - -// -// Expose the module. -// -if (true) { - module.exports = EventEmitter; -} - /***/ }), -/* 56 */ +/* 55 */ /***/ (function(module, exports) { /** @@ -11397,12 +11938,26 @@ if (true) { * * The transpose of a matrix is a new matrix whose rows are the columns of the original. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.TransposeMatrix * @since 3.0.0 - * + * * @generic T * @genericUse {T[][]} - [array,$return] - * + * * @param {T[][]} [array] - The array matrix to transpose. * * @return {T[][]} A new array matrix which is a transposed version of the given array. @@ -11430,6 +11985,46 @@ var TransposeMatrix = function (array) module.exports = TransposeMatrix; +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Moves the element at the start of the array to the end, shifting all items in the process. + * The "rotation" happens to the left. + * + * @function Phaser.Utils.Array.RotateLeft + * @since 3.0.0 + * + * @param {array} array - The array to shift to the left. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. + * + * @return {*} The most recently shifted element. + */ +var RotateLeft = function (array, total) +{ + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) + { + element = array.shift(); + array.push(element); + } + + return element; +}; + +module.exports = RotateLeft; + + /***/ }), /* 57 */ /***/ (function(module, exports) { @@ -11441,77 +12036,33 @@ module.exports = TransposeMatrix; */ /** - * Searches a pre-sorted array for the closet value to the given number. + * Moves the element at the end of the array to the start, shifting all items in the process. + * The "rotation" happens to the right. * - * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, - * and will check for the closest value of those to the given number. - * - * @function Phaser.Utils.Array.FindClosestInSorted + * @function Phaser.Utils.Array.RotateRight * @since 3.0.0 * - * @param {number} value - The value to search for in the array. - * @param {array} array - The array to search, which must be sorted. - * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * @param {array} array - The array to shift to the right. This array is modified in place. + * @param {integer} [total=1] - The number of times to shift the array. * - * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + * @return {*} The most recently shifted element. */ -var FindClosestInSorted = function (value, array, key) +var RotateRight = function (array, total) { - if (!array.length) + if (total === undefined) { total = 1; } + + var element = null; + + for (var i = 0; i < total; i++) { - return NaN; - } - else if (array.length === 1) - { - return array[0]; + element = array.pop(); + array.unshift(element); } - var i = 1; - var low; - var high; - - if (key) - { - if (value < array[0][key]) - { - return array[0]; - } - - while (array[i][key] < value) - { - i++; - } - } - else - { - while (array[i] < value) - { - i++; - } - } - - if (i > array.length) - { - i = array.length; - } - - if (key) - { - low = array[i - 1][key]; - high = array[i][key]; - - return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; - } - else - { - low = array[i - 1]; - high = array[i]; - - return ((high - value) <= (value - low)) ? high : low; - } + return element; }; -module.exports = FindClosestInSorted; +module.exports = RotateRight; /***/ }), @@ -11565,46 +12116,8 @@ module.exports = Shuffle; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -/** - * @namespace Phaser.Animations.Events - */ - -module.exports = { - - ADD_ANIMATION: __webpack_require__(290), - ANIMATION_COMPLETE: __webpack_require__(291), - ANIMATION_REPEAT: __webpack_require__(292), - ANIMATION_RESTART: __webpack_require__(293), - ANIMATION_START: __webpack_require__(294), - PAUSE_ALL: __webpack_require__(295), - REMOVE_ANIMATION: __webpack_require__(296), - RESUME_ALL: __webpack_require__(297), - SPRITE_ANIMATION_COMPLETE: __webpack_require__(298), - SPRITE_ANIMATION_KEY_COMPLETE: __webpack_require__(299), - SPRITE_ANIMATION_KEY_REPEAT: __webpack_require__(300), - SPRITE_ANIMATION_KEY_RESTART: __webpack_require__(301), - SPRITE_ANIMATION_KEY_START: __webpack_require__(302), - SPRITE_ANIMATION_KEY_UPDATE: __webpack_require__(303), - SPRITE_ANIMATION_REPEAT: __webpack_require__(304), - SPRITE_ANIMATION_RESTART: __webpack_require__(305), - SPRITE_ANIMATION_START: __webpack_require__(306), - SPRITE_ANIMATION_UPDATE: __webpack_require__(307) - -}; - - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Perimeter = __webpack_require__(61); -var Point = __webpack_require__(10); +var Perimeter = __webpack_require__(60); +var Point = __webpack_require__(9); /** * Calculates the coordinates of a point at a certain `position` on the Rectangle's perimeter. @@ -11675,7 +12188,7 @@ module.exports = GetPoint; /***/ }), -/* 61 */ +/* 60 */ /***/ (function(module, exports) { /** @@ -11703,7 +12216,7 @@ module.exports = Perimeter; /***/ }), -/* 62 */ +/* 61 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -11712,16 +12225,19 @@ module.exports = Perimeter; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var BuildGameObject = __webpack_require__(63); +var BuildGameObject = __webpack_require__(62); var Class = __webpack_require__(0); -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(7); var ResizeEvent = __webpack_require__(174); var ScenePlugin = __webpack_require__(175); var Spine = __webpack_require__(199); var SpineFile = __webpack_require__(200); var SpineGameObject = __webpack_require__(218); -var SpineContainer = __webpack_require__(247); -var NOOP = __webpack_require__(4); +var SpineContainer = __webpack_require__(250); +var NOOP = __webpack_require__(1); + +// Plugin specific instance of the Spine Scene Renderer +var sceneRenderer; /** * @classdesc @@ -11784,10 +12300,15 @@ var NOOP = __webpack_require__(4); * this.load.spine('stretchyman', 'stretchyman-pro.json', [ 'stretchyman-pma.atlas' ], true); * ``` * - * It also installs a Game Object Factory method, allowing you to create Spine Game Objects: + * It also installs two Game Object Factory methods, allowing you to create Spine Game Objects + * and Spine Containers: * * ```javascript - * this.add.spine(512, 650, 'stretchyman') + * const man = this.add.spine(512, 650, 'stretchyman'); + * + * const container = this.add.spineContainer(); + * + * container.add(man); * ``` * * The first argument is the key which you used when importing the Spine data. There are lots of @@ -11919,6 +12440,8 @@ var SpinePlugin = new Class({ /** * An instance of the Spine WebGL Scene Renderer. * + * There is only one instance of the Scene Renderer shared across the whole plugin. + * * Only set if running in WebGL mode. * * @name SpinePlugin#sceneRenderer @@ -11949,7 +12472,7 @@ var SpinePlugin = new Class({ /** * A reference to the Spine runtime. - * This is the runtime created by Esoteric Software + * This is the runtime created by Esoteric Software. * * @name SpinePlugin#plugin * @type {spine} @@ -12087,7 +12610,7 @@ var SpinePlugin = new Class({ pluginManager.registerFileType('spine', this.spineFileCallback, scene); pluginManager.registerGameObject('spine', add, make); - pluginManager.registerGameObject('spinecontainer', addContainer, makeContainer); + pluginManager.registerGameObject('spineContainer', addContainer, makeContainer); }, /** @@ -12114,6 +12637,8 @@ var SpinePlugin = new Class({ eventEmitter.once('shutdown', this.shutdown, this); eventEmitter.once('destroy', this.destroy, this); + + this.game.events.once('destroy', this.gameDestroy, this); }, /** @@ -12137,8 +12662,6 @@ var SpinePlugin = new Class({ */ bootWebGL: function () { - this.sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); - // Monkeypatch the Spine setBlendMode functions, or batching is destroyed! var setBlendMode = function (srcBlend, dstBlend) @@ -12158,11 +12681,17 @@ var SpinePlugin = new Class({ } }; - this.sceneRenderer.batcher.setBlendMode = setBlendMode; - this.sceneRenderer.shapes.setBlendMode = setBlendMode; + if (!sceneRenderer) + { + sceneRenderer = new Spine.webgl.SceneRenderer(this.renderer.canvas, this.gl, true); + sceneRenderer.batcher.setBlendMode = setBlendMode; + sceneRenderer.shapes.setBlendMode = setBlendMode; + } - this.skeletonRenderer = this.sceneRenderer.skeletonRenderer; - this.skeletonDebugRenderer = this.sceneRenderer.skeletonDebugRenderer; + // All share the same instance + this.sceneRenderer = sceneRenderer; + this.skeletonRenderer = sceneRenderer.skeletonRenderer; + this.skeletonDebugRenderer = sceneRenderer.skeletonDebugRenderer; this.temp1 = new Spine.webgl.Vector3(0, 0, 0); this.temp2 = new Spine.webgl.Vector3(0, 0, 0); @@ -12760,8 +13289,7 @@ var SpinePlugin = new Class({ sceneRenderer.camera.position.x = viewportWidth / 2; sceneRenderer.camera.position.y = viewportHeight / 2; - sceneRenderer.camera.viewportWidth = viewportWidth; - sceneRenderer.camera.viewportHeight = viewportHeight; + sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); }, /** @@ -12798,14 +13326,6 @@ var SpinePlugin = new Class({ { this.shutdown(); - if (this.sceneRenderer) - { - this.sceneRenderer.dispose(); - } - - this.pluginManager.removeGameObject('spine', true, true); - - this.pluginManager = null; this.game = null; this.scene = null; this.systems = null; @@ -12814,14 +13334,39 @@ var SpinePlugin = new Class({ this.spineTextures = null; this.json = null; this.textures = null; - this.sceneRenderer = null; this.skeletonRenderer = null; this.gl = null; + }, + + /** + * The Game that owns this plugin is being destroyed. + * + * Dispose of the Scene Renderer and remove the Game Objects. + * + * @method SpinePlugin#gameDestroy + * @private + * @since 3.50.0 + */ + gameDestroy: function () + { + this.destroy(); + + if (sceneRenderer) + { + sceneRenderer.dispose(); + } + + this.sceneRenderer = null; + this.pluginManager = null; + + this.pluginManager.removeGameObject('spine', true, true); + this.pluginManager.removeGameObject('spineContainer', true, true); } }); SpinePlugin.SpineGameObject = SpineGameObject; +SpinePlugin.SpineContainer = SpineContainer; /** * Creates a new Spine Game Object and adds it to the Scene. @@ -12893,7 +13438,7 @@ module.exports = SpinePlugin; /***/ }), -/* 63 */ +/* 62 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -12902,8 +13447,8 @@ module.exports = SpinePlugin; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BlendModes = __webpack_require__(16); -var GetAdvancedValue = __webpack_require__(64); +var BlendModes = __webpack_require__(15); +var GetAdvancedValue = __webpack_require__(63); /** * Builds a Game Object using the provided configuration object. @@ -13021,7 +13566,7 @@ module.exports = BuildGameObject; /***/ }), -/* 64 */ +/* 63 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13030,8 +13575,8 @@ module.exports = BuildGameObject; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH = __webpack_require__(65); -var GetValue = __webpack_require__(6); +var MATH = __webpack_require__(64); +var GetValue = __webpack_require__(7); /** * Retrieves a value from an object. Allows for more advanced selection options, including: @@ -13108,7 +13653,7 @@ module.exports = GetAdvancedValue; /***/ }), -/* 65 */ +/* 64 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13117,8 +13662,8 @@ module.exports = GetAdvancedValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CONST = __webpack_require__(2); -var Extend = __webpack_require__(26); +var CONST = __webpack_require__(3); +var Extend = __webpack_require__(27); /** * @namespace Phaser.Math @@ -13127,61 +13672,62 @@ var Extend = __webpack_require__(26); var PhaserMath = { // Collections of functions - Angle: __webpack_require__(66), - Distance: __webpack_require__(75), - Easing: __webpack_require__(83), - Fuzzy: __webpack_require__(128), - Interpolation: __webpack_require__(133), - Pow2: __webpack_require__(141), - Snap: __webpack_require__(145), + Angle: __webpack_require__(65), + Distance: __webpack_require__(74), + Easing: __webpack_require__(82), + Fuzzy: __webpack_require__(127), + Interpolation: __webpack_require__(132), + Pow2: __webpack_require__(140), + Snap: __webpack_require__(144), // Expose the RNG Class - RandomDataGenerator: __webpack_require__(149), + RandomDataGenerator: __webpack_require__(148), // Single functions - Average: __webpack_require__(150), - Bernstein: __webpack_require__(32), - Between: __webpack_require__(151), - CatmullRom: __webpack_require__(34), - CeilTo: __webpack_require__(152), - Clamp: __webpack_require__(3), + Average: __webpack_require__(149), + Bernstein: __webpack_require__(33), + Between: __webpack_require__(150), + CatmullRom: __webpack_require__(35), + CeilTo: __webpack_require__(151), + Clamp: __webpack_require__(4), DegToRad: __webpack_require__(18), - Difference: __webpack_require__(153), - Factorial: __webpack_require__(33), + Difference: __webpack_require__(152), + Euler: __webpack_require__(153), + Factorial: __webpack_require__(34), FloatBetween: __webpack_require__(17), FloorTo: __webpack_require__(154), FromPercent: __webpack_require__(155), GetSpeed: __webpack_require__(156), IsEven: __webpack_require__(157), IsEvenStrict: __webpack_require__(158), - Linear: __webpack_require__(35), + Linear: __webpack_require__(36), MaxAdd: __webpack_require__(159), MinSub: __webpack_require__(160), Percent: __webpack_require__(161), - RadToDeg: __webpack_require__(12), + RadToDeg: __webpack_require__(20), RandomXY: __webpack_require__(162), RandomXYZ: __webpack_require__(163), RandomXYZW: __webpack_require__(164), Rotate: __webpack_require__(165), - RotateAround: __webpack_require__(38), + RotateAround: __webpack_require__(39), RotateAroundDistance: __webpack_require__(166), RotateTo: __webpack_require__(167), - RoundAwayFromZero: __webpack_require__(39), + RoundAwayFromZero: __webpack_require__(40), RoundTo: __webpack_require__(168), SinCosTableGenerator: __webpack_require__(169), - SmootherStep: __webpack_require__(37), - SmoothStep: __webpack_require__(36), + SmootherStep: __webpack_require__(38), + SmoothStep: __webpack_require__(37), ToXY: __webpack_require__(170), - TransformXY: __webpack_require__(40), + TransformXY: __webpack_require__(41), Within: __webpack_require__(171), - Wrap: __webpack_require__(8), + Wrap: __webpack_require__(10), // Vector classes - Vector2: __webpack_require__(1), - Vector3: __webpack_require__(19), + Vector2: __webpack_require__(2), + Vector3: __webpack_require__(11), Vector4: __webpack_require__(172), - Matrix3: __webpack_require__(41), - Matrix4: __webpack_require__(42), + Matrix3: __webpack_require__(42), + Matrix4: __webpack_require__(19), Quaternion: __webpack_require__(43), RotateVec3: __webpack_require__(173) @@ -13197,7 +13743,7 @@ module.exports = PhaserMath; /***/ }), -/* 66 */ +/* 65 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13212,25 +13758,25 @@ module.exports = PhaserMath; module.exports = { - Between: __webpack_require__(27), - BetweenPoints: __webpack_require__(67), - BetweenPointsY: __webpack_require__(68), - BetweenY: __webpack_require__(69), - CounterClockwise: __webpack_require__(11), - Normalize: __webpack_require__(28), - Random: __webpack_require__(70), - RandomDegrees: __webpack_require__(71), - Reverse: __webpack_require__(72), - RotateTo: __webpack_require__(73), - ShortestBetween: __webpack_require__(74), - Wrap: __webpack_require__(29), - WrapDegrees: __webpack_require__(30) + Between: __webpack_require__(28), + BetweenPoints: __webpack_require__(66), + BetweenPointsY: __webpack_require__(67), + BetweenY: __webpack_require__(68), + CounterClockwise: __webpack_require__(16), + Normalize: __webpack_require__(29), + Random: __webpack_require__(69), + RandomDegrees: __webpack_require__(70), + Reverse: __webpack_require__(71), + RotateTo: __webpack_require__(72), + ShortestBetween: __webpack_require__(73), + Wrap: __webpack_require__(30), + WrapDegrees: __webpack_require__(31) }; /***/ }), -/* 67 */ +/* 66 */ /***/ (function(module, exports) { /** @@ -13261,7 +13807,7 @@ module.exports = BetweenPoints; /***/ }), -/* 68 */ +/* 67 */ /***/ (function(module, exports) { /** @@ -13293,7 +13839,7 @@ module.exports = BetweenPointsY; /***/ }), -/* 69 */ +/* 68 */ /***/ (function(module, exports) { /** @@ -13327,7 +13873,7 @@ module.exports = BetweenY; /***/ }), -/* 70 */ +/* 69 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13356,7 +13902,7 @@ module.exports = Random; /***/ }), -/* 71 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13385,7 +13931,7 @@ module.exports = RandomDegrees; /***/ }), -/* 72 */ +/* 71 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13394,7 +13940,7 @@ module.exports = RandomDegrees; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Normalize = __webpack_require__(28); +var Normalize = __webpack_require__(29); /** * Reverse the given angle. @@ -13415,7 +13961,7 @@ module.exports = Reverse; /***/ }), -/* 73 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13424,7 +13970,7 @@ module.exports = Reverse; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var MATH_CONST = __webpack_require__(2); +var MATH_CONST = __webpack_require__(3); /** * Rotates `currentAngle` towards `targetAngle`, taking the shortest rotation distance. The `lerp` argument is the amount to rotate by in this call. @@ -13482,7 +14028,7 @@ module.exports = RotateTo; /***/ }), -/* 74 */ +/* 73 */ /***/ (function(module, exports) { /** @@ -13531,7 +14077,7 @@ module.exports = ShortestBetween; /***/ }), -/* 75 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13546,19 +14092,19 @@ module.exports = ShortestBetween; module.exports = { - Between: __webpack_require__(76), - BetweenPoints: __webpack_require__(77), - BetweenPointsSquared: __webpack_require__(78), - Chebyshev: __webpack_require__(79), - Power: __webpack_require__(80), - Snake: __webpack_require__(81), - Squared: __webpack_require__(82) + Between: __webpack_require__(75), + BetweenPoints: __webpack_require__(76), + BetweenPointsSquared: __webpack_require__(77), + Chebyshev: __webpack_require__(78), + Power: __webpack_require__(79), + Snake: __webpack_require__(80), + Squared: __webpack_require__(81) }; /***/ }), -/* 76 */ +/* 75 */ /***/ (function(module, exports) { /** @@ -13592,7 +14138,7 @@ module.exports = DistanceBetween; /***/ }), -/* 77 */ +/* 76 */ /***/ (function(module, exports) { /** @@ -13624,7 +14170,7 @@ module.exports = DistanceBetweenPoints; /***/ }), -/* 78 */ +/* 77 */ /***/ (function(module, exports) { /** @@ -13656,7 +14202,7 @@ module.exports = DistanceBetweenPointsSquared; /***/ }), -/* 79 */ +/* 78 */ /***/ (function(module, exports) { /** @@ -13690,7 +14236,7 @@ module.exports = ChebyshevDistance; /***/ }), -/* 80 */ +/* 79 */ /***/ (function(module, exports) { /** @@ -13724,7 +14270,7 @@ module.exports = DistancePower; /***/ }), -/* 81 */ +/* 80 */ /***/ (function(module, exports) { /** @@ -13758,7 +14304,7 @@ module.exports = SnakeDistance; /***/ }), -/* 82 */ +/* 81 */ /***/ (function(module, exports) { /** @@ -13792,7 +14338,7 @@ module.exports = DistanceSquared; /***/ }), -/* 83 */ +/* 82 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13807,24 +14353,24 @@ module.exports = DistanceSquared; module.exports = { - Back: __webpack_require__(84), - Bounce: __webpack_require__(88), - Circular: __webpack_require__(92), - Cubic: __webpack_require__(96), - Elastic: __webpack_require__(100), - Expo: __webpack_require__(104), - Linear: __webpack_require__(108), - Quadratic: __webpack_require__(110), - Quartic: __webpack_require__(114), - Quintic: __webpack_require__(118), - Sine: __webpack_require__(122), - Stepped: __webpack_require__(126) + Back: __webpack_require__(83), + Bounce: __webpack_require__(87), + Circular: __webpack_require__(91), + Cubic: __webpack_require__(95), + Elastic: __webpack_require__(99), + Expo: __webpack_require__(103), + Linear: __webpack_require__(107), + Quadratic: __webpack_require__(109), + Quartic: __webpack_require__(113), + Quintic: __webpack_require__(117), + Sine: __webpack_require__(121), + Stepped: __webpack_require__(125) }; /***/ }), -/* 84 */ +/* 83 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13839,15 +14385,15 @@ module.exports = { module.exports = { - In: __webpack_require__(85), - Out: __webpack_require__(86), - InOut: __webpack_require__(87) + In: __webpack_require__(84), + Out: __webpack_require__(85), + InOut: __webpack_require__(86) }; /***/ }), -/* 85 */ +/* 84 */ /***/ (function(module, exports) { /** @@ -13878,7 +14424,7 @@ module.exports = In; /***/ }), -/* 86 */ +/* 85 */ /***/ (function(module, exports) { /** @@ -13909,7 +14455,7 @@ module.exports = Out; /***/ }), -/* 87 */ +/* 86 */ /***/ (function(module, exports) { /** @@ -13949,7 +14495,7 @@ module.exports = InOut; /***/ }), -/* 88 */ +/* 87 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -13964,15 +14510,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(89), - Out: __webpack_require__(90), - InOut: __webpack_require__(91) + In: __webpack_require__(88), + Out: __webpack_require__(89), + InOut: __webpack_require__(90) }; /***/ }), -/* 89 */ +/* 88 */ /***/ (function(module, exports) { /** @@ -14017,7 +14563,7 @@ module.exports = In; /***/ }), -/* 90 */ +/* 89 */ /***/ (function(module, exports) { /** @@ -14060,7 +14606,7 @@ module.exports = Out; /***/ }), -/* 91 */ +/* 90 */ /***/ (function(module, exports) { /** @@ -14124,7 +14670,7 @@ module.exports = InOut; /***/ }), -/* 92 */ +/* 91 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14139,15 +14685,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(93), - Out: __webpack_require__(94), - InOut: __webpack_require__(95) + In: __webpack_require__(92), + Out: __webpack_require__(93), + InOut: __webpack_require__(94) }; /***/ }), -/* 93 */ +/* 92 */ /***/ (function(module, exports) { /** @@ -14175,7 +14721,7 @@ module.exports = In; /***/ }), -/* 94 */ +/* 93 */ /***/ (function(module, exports) { /** @@ -14203,7 +14749,7 @@ module.exports = Out; /***/ }), -/* 95 */ +/* 94 */ /***/ (function(module, exports) { /** @@ -14238,7 +14784,7 @@ module.exports = InOut; /***/ }), -/* 96 */ +/* 95 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14253,15 +14799,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(97), - Out: __webpack_require__(98), - InOut: __webpack_require__(99) + In: __webpack_require__(96), + Out: __webpack_require__(97), + InOut: __webpack_require__(98) }; /***/ }), -/* 97 */ +/* 96 */ /***/ (function(module, exports) { /** @@ -14289,7 +14835,7 @@ module.exports = In; /***/ }), -/* 98 */ +/* 97 */ /***/ (function(module, exports) { /** @@ -14317,7 +14863,7 @@ module.exports = Out; /***/ }), -/* 99 */ +/* 98 */ /***/ (function(module, exports) { /** @@ -14352,7 +14898,7 @@ module.exports = InOut; /***/ }), -/* 100 */ +/* 99 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14367,15 +14913,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(101), - Out: __webpack_require__(102), - InOut: __webpack_require__(103) + In: __webpack_require__(100), + Out: __webpack_require__(101), + InOut: __webpack_require__(102) }; /***/ }), -/* 101 */ +/* 100 */ /***/ (function(module, exports) { /** @@ -14430,7 +14976,7 @@ module.exports = In; /***/ }), -/* 102 */ +/* 101 */ /***/ (function(module, exports) { /** @@ -14485,7 +15031,7 @@ module.exports = Out; /***/ }), -/* 103 */ +/* 102 */ /***/ (function(module, exports) { /** @@ -14547,7 +15093,7 @@ module.exports = InOut; /***/ }), -/* 104 */ +/* 103 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14562,15 +15108,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(105), - Out: __webpack_require__(106), - InOut: __webpack_require__(107) + In: __webpack_require__(104), + Out: __webpack_require__(105), + InOut: __webpack_require__(106) }; /***/ }), -/* 105 */ +/* 104 */ /***/ (function(module, exports) { /** @@ -14598,7 +15144,7 @@ module.exports = In; /***/ }), -/* 106 */ +/* 105 */ /***/ (function(module, exports) { /** @@ -14626,7 +15172,7 @@ module.exports = Out; /***/ }), -/* 107 */ +/* 106 */ /***/ (function(module, exports) { /** @@ -14661,7 +15207,7 @@ module.exports = InOut; /***/ }), -/* 108 */ +/* 107 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14670,11 +15216,11 @@ module.exports = InOut; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -module.exports = __webpack_require__(109); +module.exports = __webpack_require__(108); /***/ }), -/* 109 */ +/* 108 */ /***/ (function(module, exports) { /** @@ -14702,7 +15248,7 @@ module.exports = Linear; /***/ }), -/* 110 */ +/* 109 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14717,15 +15263,15 @@ module.exports = Linear; module.exports = { - In: __webpack_require__(111), - Out: __webpack_require__(112), - InOut: __webpack_require__(113) + In: __webpack_require__(110), + Out: __webpack_require__(111), + InOut: __webpack_require__(112) }; /***/ }), -/* 111 */ +/* 110 */ /***/ (function(module, exports) { /** @@ -14753,7 +15299,7 @@ module.exports = In; /***/ }), -/* 112 */ +/* 111 */ /***/ (function(module, exports) { /** @@ -14781,7 +15327,7 @@ module.exports = Out; /***/ }), -/* 113 */ +/* 112 */ /***/ (function(module, exports) { /** @@ -14816,7 +15362,7 @@ module.exports = InOut; /***/ }), -/* 114 */ +/* 113 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14831,15 +15377,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(115), - Out: __webpack_require__(116), - InOut: __webpack_require__(117) + In: __webpack_require__(114), + Out: __webpack_require__(115), + InOut: __webpack_require__(116) }; /***/ }), -/* 115 */ +/* 114 */ /***/ (function(module, exports) { /** @@ -14867,7 +15413,7 @@ module.exports = In; /***/ }), -/* 116 */ +/* 115 */ /***/ (function(module, exports) { /** @@ -14895,7 +15441,7 @@ module.exports = Out; /***/ }), -/* 117 */ +/* 116 */ /***/ (function(module, exports) { /** @@ -14930,7 +15476,7 @@ module.exports = InOut; /***/ }), -/* 118 */ +/* 117 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -14945,15 +15491,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(119), - Out: __webpack_require__(120), - InOut: __webpack_require__(121) + In: __webpack_require__(118), + Out: __webpack_require__(119), + InOut: __webpack_require__(120) }; /***/ }), -/* 119 */ +/* 118 */ /***/ (function(module, exports) { /** @@ -14981,7 +15527,7 @@ module.exports = In; /***/ }), -/* 120 */ +/* 119 */ /***/ (function(module, exports) { /** @@ -15009,7 +15555,7 @@ module.exports = Out; /***/ }), -/* 121 */ +/* 120 */ /***/ (function(module, exports) { /** @@ -15044,7 +15590,7 @@ module.exports = InOut; /***/ }), -/* 122 */ +/* 121 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15059,15 +15605,15 @@ module.exports = InOut; module.exports = { - In: __webpack_require__(123), - Out: __webpack_require__(124), - InOut: __webpack_require__(125) + In: __webpack_require__(122), + Out: __webpack_require__(123), + InOut: __webpack_require__(124) }; /***/ }), -/* 123 */ +/* 122 */ /***/ (function(module, exports) { /** @@ -15106,7 +15652,7 @@ module.exports = In; /***/ }), -/* 124 */ +/* 123 */ /***/ (function(module, exports) { /** @@ -15145,7 +15691,7 @@ module.exports = Out; /***/ }), -/* 125 */ +/* 124 */ /***/ (function(module, exports) { /** @@ -15184,7 +15730,7 @@ module.exports = InOut; /***/ }), -/* 126 */ +/* 125 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15197,11 +15743,11 @@ module.exports = InOut; * @namespace Phaser.Math.Easing.Stepped */ -module.exports = __webpack_require__(127); +module.exports = __webpack_require__(126); /***/ }), -/* 127 */ +/* 126 */ /***/ (function(module, exports) { /** @@ -15243,7 +15789,7 @@ module.exports = Stepped; /***/ }), -/* 128 */ +/* 127 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15258,17 +15804,17 @@ module.exports = Stepped; module.exports = { - Ceil: __webpack_require__(129), - Equal: __webpack_require__(31), - Floor: __webpack_require__(130), - GreaterThan: __webpack_require__(131), - LessThan: __webpack_require__(132) + Ceil: __webpack_require__(128), + Equal: __webpack_require__(32), + Floor: __webpack_require__(129), + GreaterThan: __webpack_require__(130), + LessThan: __webpack_require__(131) }; /***/ }), -/* 129 */ +/* 128 */ /***/ (function(module, exports) { /** @@ -15299,7 +15845,7 @@ module.exports = Ceil; /***/ }), -/* 130 */ +/* 129 */ /***/ (function(module, exports) { /** @@ -15330,7 +15876,7 @@ module.exports = Floor; /***/ }), -/* 131 */ +/* 130 */ /***/ (function(module, exports) { /** @@ -15364,7 +15910,7 @@ module.exports = GreaterThan; /***/ }), -/* 132 */ +/* 131 */ /***/ (function(module, exports) { /** @@ -15398,7 +15944,7 @@ module.exports = LessThan; /***/ }), -/* 133 */ +/* 132 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15413,19 +15959,19 @@ module.exports = LessThan; module.exports = { - Bezier: __webpack_require__(134), - CatmullRom: __webpack_require__(135), - CubicBezier: __webpack_require__(136), - Linear: __webpack_require__(137), - QuadraticBezier: __webpack_require__(138), - SmoothStep: __webpack_require__(139), - SmootherStep: __webpack_require__(140) + Bezier: __webpack_require__(133), + CatmullRom: __webpack_require__(134), + CubicBezier: __webpack_require__(135), + Linear: __webpack_require__(136), + QuadraticBezier: __webpack_require__(137), + SmoothStep: __webpack_require__(138), + SmootherStep: __webpack_require__(139) }; /***/ }), -/* 134 */ +/* 133 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15434,7 +15980,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Bernstein = __webpack_require__(32); +var Bernstein = __webpack_require__(33); /** * A bezier interpolation method. @@ -15464,7 +16010,7 @@ module.exports = BezierInterpolation; /***/ }), -/* 135 */ +/* 134 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15473,7 +16019,7 @@ module.exports = BezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CatmullRom = __webpack_require__(34); +var CatmullRom = __webpack_require__(35); /** * A Catmull-Rom interpolation method. @@ -15521,7 +16067,7 @@ module.exports = CatmullRomInterpolation; /***/ }), -/* 136 */ +/* 135 */ /***/ (function(module, exports) { /** @@ -15591,7 +16137,7 @@ module.exports = CubicBezierInterpolation; /***/ }), -/* 137 */ +/* 136 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15600,7 +16146,7 @@ module.exports = CubicBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Linear = __webpack_require__(35); +var Linear = __webpack_require__(36); /** * A linear interpolation method. @@ -15638,7 +16184,7 @@ module.exports = LinearInterpolation; /***/ }), -/* 138 */ +/* 137 */ /***/ (function(module, exports) { /** @@ -15697,7 +16243,7 @@ module.exports = QuadraticBezierInterpolation; /***/ }), -/* 139 */ +/* 138 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15706,7 +16252,7 @@ module.exports = QuadraticBezierInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmoothStep = __webpack_require__(36); +var SmoothStep = __webpack_require__(37); /** * A Smooth Step interpolation method. @@ -15730,7 +16276,7 @@ module.exports = SmoothStepInterpolation; /***/ }), -/* 140 */ +/* 139 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15739,7 +16285,7 @@ module.exports = SmoothStepInterpolation; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SmootherStep = __webpack_require__(37); +var SmootherStep = __webpack_require__(38); /** * A Smoother Step interpolation method. @@ -15763,7 +16309,7 @@ module.exports = SmootherStepInterpolation; /***/ }), -/* 141 */ +/* 140 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15778,15 +16324,15 @@ module.exports = SmootherStepInterpolation; module.exports = { - GetNext: __webpack_require__(142), - IsSize: __webpack_require__(143), - IsValue: __webpack_require__(144) + GetNext: __webpack_require__(141), + IsSize: __webpack_require__(142), + IsValue: __webpack_require__(143) }; /***/ }), -/* 142 */ +/* 141 */ /***/ (function(module, exports) { /** @@ -15816,7 +16362,7 @@ module.exports = GetPowerOfTwo; /***/ }), -/* 143 */ +/* 142 */ /***/ (function(module, exports) { /** @@ -15846,7 +16392,7 @@ module.exports = IsSizePowerOfTwo; /***/ }), -/* 144 */ +/* 143 */ /***/ (function(module, exports) { /** @@ -15874,7 +16420,7 @@ module.exports = IsValuePowerOfTwo; /***/ }), -/* 145 */ +/* 144 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -15889,15 +16435,15 @@ module.exports = IsValuePowerOfTwo; module.exports = { - Ceil: __webpack_require__(146), - Floor: __webpack_require__(147), - To: __webpack_require__(148) + Ceil: __webpack_require__(145), + Floor: __webpack_require__(146), + To: __webpack_require__(147) }; /***/ }), -/* 146 */ +/* 145 */ /***/ (function(module, exports) { /** @@ -15941,7 +16487,7 @@ module.exports = SnapCeil; /***/ }), -/* 147 */ +/* 146 */ /***/ (function(module, exports) { /** @@ -15985,7 +16531,7 @@ module.exports = SnapFloor; /***/ }), -/* 148 */ +/* 147 */ /***/ (function(module, exports) { /** @@ -16028,7 +16574,7 @@ module.exports = SnapTo; /***/ }), -/* 149 */ +/* 148 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -16538,7 +17084,7 @@ module.exports = RandomDataGenerator; /***/ }), -/* 150 */ +/* 149 */ /***/ (function(module, exports) { /** @@ -16573,7 +17119,7 @@ module.exports = Average; /***/ }), -/* 151 */ +/* 150 */ /***/ (function(module, exports) { /** @@ -16602,7 +17148,7 @@ module.exports = Between; /***/ }), -/* 152 */ +/* 151 */ /***/ (function(module, exports) { /** @@ -16639,7 +17185,7 @@ module.exports = CeilTo; /***/ }), -/* 153 */ +/* 152 */ /***/ (function(module, exports) { /** @@ -16667,6 +17213,289 @@ var Difference = function (a, b) module.exports = Difference; +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = __webpack_require__(4); +var Class = __webpack_require__(0); +var Matrix4 = __webpack_require__(19); +var NOOP = __webpack_require__(1); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; + + /***/ }), /* 154 */ /***/ (function(module, exports) { @@ -16714,7 +17543,7 @@ module.exports = FloorTo; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(3); +var Clamp = __webpack_require__(4); /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -17294,7 +18123,7 @@ module.exports = SinCosTableGenerator; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector2 = __webpack_require__(1); +var Vector2 = __webpack_require__(2); /** * Returns a Vector2 containing the x and y position of the given index in a `width` x `height` sized grid. @@ -17927,8 +18756,8 @@ module.exports = Vector4; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Vector3 = __webpack_require__(19); -var Matrix4 = __webpack_require__(42); +var Vector3 = __webpack_require__(11); +var Matrix4 = __webpack_require__(19); var Quaternion = __webpack_require__(43); var tmpMat4 = new Matrix4(); @@ -17977,7 +18806,7 @@ module.exports = RotateVec3; /** * The Scale Manager Resize Event. - * + * * This event is dispatched whenever the Scale Manager detects a resize event from the browser. * It sends three parameters to the callback, each of them being Size components. You can read * the `width`, `height`, `aspectRatio` and other properties of these components to help with @@ -17985,11 +18814,10 @@ module.exports = RotateVec3; * * @event Phaser.Scale.Events#RESIZE * @since 3.16.1 - * + * * @param {Phaser.Structs.Size} gameSize - A reference to the Game Size component. This is the un-scaled size of your game canvas. - * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size multiplied by resolution. + * @param {Phaser.Structs.Size} baseSize - A reference to the Base Size component. This is the game size. * @param {Phaser.Structs.Size} displaySize - A reference to the Display Size component. This is the scaled canvas size, after applying zoom and scale mode. - * @param {number} resolution - The current resolution. Defaults to 1 at the moment. * @param {number} previousWidth - If the `gameSize` has changed, this value contains its previous width, otherwise it contains the current width. * @param {number} previousHeight - If the `gameSize` has changed, this value contains its previous height, otherwise it contains the current height. */ @@ -29484,9 +30312,9 @@ module.exports = spine; */ var Class = __webpack_require__(0); -var GetFastValue = __webpack_require__(9); +var GetFastValue = __webpack_require__(8); var ImageFile = __webpack_require__(201); -var IsPlainObject = __webpack_require__(7); +var IsPlainObject = __webpack_require__(6); var JSONFile = __webpack_require__(215); var MultiFile = __webpack_require__(216); var TextFile = __webpack_require__(217); @@ -29563,7 +30391,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { atlas = new TextFile(loader, { - key: key + '_' + i, + key: key + '!' + i, url: atlasURL[i], extension: GetFastValue(config, 'atlasExtension', 'atlas'), xhrSettings: GetFastValue(config, 'atlasXhrSettings') @@ -29585,7 +30413,7 @@ var SpineFile = new Class({ for (i = 0; i < atlasURL.length; i++) { - atlas = new TextFile(loader, key + '_' + i, atlasURL[i], atlasXhrSettings); + atlas = new TextFile(loader, key + '!' + i, atlasURL[i], atlasXhrSettings); atlas.cache = cache; files.push(atlas); @@ -29659,9 +30487,12 @@ var SpineFile = new Class({ var image = new ImageFile(loader, key, textureURL, textureXhrSettings); - this.addToMultiFile(image); + if (!loader.keyExists(image)) + { + this.addToMultiFile(image); - loader.addFile(image); + loader.addFile(image); + } } // Reset the loader settings @@ -29690,6 +30521,7 @@ var SpineFile = new Class({ var atlasKey = ''; var combinedAtlasData = ''; var preMultipliedAlpha = (this.config.preMultipliedAlpha) ? true : false; + var textureManager = this.loader.textureManager; for (var i = 1; i < this.files.length; i++) { @@ -29697,7 +30529,7 @@ var SpineFile = new Class({ if (file.type === 'text') { - atlasKey = file.key.replace(/_[\d]$/, ''); + atlasKey = file.key.replace(/![\d]$/, ''); atlasCache = file.cache; @@ -29706,10 +30538,13 @@ var SpineFile = new Class({ else { var src = file.key.trim(); - var pos = src.indexOf('_'); + var pos = src.indexOf('!'); var key = src.substr(pos + 1); - this.loader.textureManager.addImage(key, file.data); + if (!textureManager.exists(key)) + { + textureManager.addImage(key, file.data); + } } file.pendingDestroy(); @@ -29737,11 +30572,11 @@ module.exports = SpineFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); -var GetFastValue = __webpack_require__(9); -var IsPlainObject = __webpack_require__(7); +var CONST = __webpack_require__(12); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); +var GetFastValue = __webpack_require__(8); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -30463,12 +31298,12 @@ module.exports = XHRLoader; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); -var GetFastValue = __webpack_require__(9); -var GetValue = __webpack_require__(6); -var IsPlainObject = __webpack_require__(7); +var CONST = __webpack_require__(12); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); +var GetFastValue = __webpack_require__(8); +var GetValue = __webpack_require__(7); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -30698,7 +31533,7 @@ var Class = __webpack_require__(0); * @classdesc * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * + * * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. * * @class MultiFile @@ -30717,6 +31552,17 @@ var MultiFile = new Class({ function MultiFile (loader, type, key, files) { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + /** * A reference to the Loader that is going to load this file. * @@ -30761,7 +31607,7 @@ var MultiFile = new Class({ * @type {Phaser.Loader.File[]} * @since 3.7.0 */ - this.files = files; + this.files = finalFiles; /** * The completion status of this MultiFile. @@ -30781,7 +31627,7 @@ var MultiFile = new Class({ * @since 3.7.0 */ - this.pending = files.length; + this.pending = finalFiles.length; /** * The number of files that failed to load. @@ -30833,9 +31679,9 @@ var MultiFile = new Class({ this.prefix = loader.prefix; // Link the files - for (var i = 0; i < files.length; i++) + for (var i = 0; i < finalFiles.length; i++) { - files[i].multiFile = this; + finalFiles[i].multiFile = this; } }, @@ -30927,11 +31773,11 @@ module.exports = MultiFile; */ var Class = __webpack_require__(0); -var CONST = __webpack_require__(13); -var File = __webpack_require__(20); -var FileTypesManager = __webpack_require__(21); -var GetFastValue = __webpack_require__(9); -var IsPlainObject = __webpack_require__(7); +var CONST = __webpack_require__(12); +var File = __webpack_require__(21); +var FileTypesManager = __webpack_require__(22); +var GetFastValue = __webpack_require__(8); +var IsPlainObject = __webpack_require__(6); /** * @classdesc @@ -30960,7 +31806,9 @@ var TextFile = new Class({ function TextFile (loader, key, url, xhrSettings) { + var type = 'text'; var extension = 'txt'; + var cache = loader.cacheManager.text; if (IsPlainObject(key)) { @@ -30970,11 +31818,13 @@ var TextFile = new Class({ url = GetFastValue(config, 'url'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); } var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, + type: type, + cache: cache, extension: extension, responseType: 'text', key: key, @@ -31101,21 +31951,21 @@ module.exports = TextFile; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var AngleBetween = __webpack_require__(27); -var Clamp = __webpack_require__(3); +var AngleBetween = __webpack_require__(28); +var Clamp = __webpack_require__(4); var Class = __webpack_require__(0); var ComponentsComputedSize = __webpack_require__(46); var ComponentsDepth = __webpack_require__(47); var ComponentsFlip = __webpack_require__(48); var ComponentsScrollFactor = __webpack_require__(49); var ComponentsTransform = __webpack_require__(50); -var ComponentsVisible = __webpack_require__(52); -var CounterClockwise = __webpack_require__(11); +var ComponentsVisible = __webpack_require__(51); +var CounterClockwise = __webpack_require__(16); var DegToRad = __webpack_require__(18); -var GameObject = __webpack_require__(53); -var RadToDeg = __webpack_require__(12); -var SpineEvents = __webpack_require__(238); -var SpineGameObjectRender = __webpack_require__(245); +var GameObject = __webpack_require__(52); +var RadToDeg = __webpack_require__(20); +var SpineEvents = __webpack_require__(240); +var SpineGameObjectRender = __webpack_require__(247); /** * @classdesc @@ -31339,17 +32189,27 @@ var SpineGameObject = new Class({ }, /** - * Overrides the default Game Object method and always returns true. - * Rendering is decided in the renderer functions. + * Returns `true` if this Spine Game Object both has a skeleton and + * also passes the render tests for the given Camera. * * @method SpineGameObject#willRender * @since 3.19.0 * - * @return {boolean} Always returns `true`. + * @return {boolean} `true` if this Game Object should be rendered, otherwise `false`. */ - willRender: function () + willRender: function (camera) { - return true; + var skeleton = this.skeleton; + + if (!skeleton) + { + return false; + } + + var GameObjectRenderMask = 15; + var childAlpha = skeleton.color.a; + + return !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)) || childAlpha === 0); }, /** @@ -32086,7 +32946,7 @@ var SpineGameObject = new Class({ * @param {integer} trackIndex - The track index to play the animation on. * @param {string} animationName - The string-based key of the animation to play. * @param {boolean} [loop=false] - Should the animation be looped when played? - * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. + * @param {boolean} [ignoreIfPlaying=false] - If the animation specified by the track index is already playing then ignore this call. * * @return {spine.TrackEntry} A track entry to allow further customization of animation playback. */ @@ -32097,7 +32957,7 @@ var SpineGameObject = new Class({ if (ignoreIfPlaying && this.state) { - var currentTrack = this.state.getCurrent(0); + var currentTrack = this.state.getCurrent(trackIndex); if (currentTrack && currentTrack.animation.name === animationName && !currentTrack.isComplete()) { @@ -32134,6 +32994,9 @@ var SpineGameObject = new Class({ */ addAnimation: function (trackIndex, animationName, loop, delay) { + if (loop === undefined) { loop = false; } + if (delay === undefined) { delay = 0; } + return this.state.addAnimation(trackIndex, animationName, loop, delay); }, @@ -32768,13 +33631,13 @@ var DataManager = new Class({ * ``` * * You can also modify it directly: - * + * * ```javascript * this.data.values.gold += 1000; * ``` * * Doing so will emit a `setdata` event from the parent of this Data Manager. - * + * * Do not modify this object directly. Adding properties directly to this object will not * emit any events. Always use `DataManager.set` to create new items the first time around. * @@ -32798,7 +33661,7 @@ var DataManager = new Class({ if (!parent.hasOwnProperty('sys') && this.events) { - this.events.once('destroy', this.destroy, this); + this.events.once(Events.DESTROY, this.destroy, this); } }, @@ -32806,19 +33669,19 @@ var DataManager = new Class({ * Retrieves the value for the given key, or undefined if it doesn't exist. * * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: - * + * * ```javascript * this.data.get('gold'); * ``` * * Or access the value directly: - * + * * ```javascript * this.data.values.gold; * ``` * * You can also pass in an array of keys, in which case an array of values will be returned: - * + * * ```javascript * this.data.get([ 'gold', 'armor', 'health' ]); * ``` @@ -32903,7 +33766,7 @@ var DataManager = new Class({ /** * Sets a value for the given key. If the key doesn't already exist in the Data Manager then it is created. - * + * * ```javascript * data.set('name', 'Red Gem Stone'); * ``` @@ -32915,13 +33778,13 @@ var DataManager = new Class({ * ``` * * To get a value back again you can call `get`: - * + * * ```javascript * data.get('gold'); * ``` - * + * * Or you can access the value directly via the `values` property, where it works like any other variable: - * + * * ```javascript * data.values.gold += 50; * ``` @@ -32970,9 +33833,9 @@ var DataManager = new Class({ /** * Increase a value for the given key. If the key doesn't already exist in the Data Manager then it is increased from 0. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#inc * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -33009,9 +33872,9 @@ var DataManager = new Class({ /** * Toggle a boolean value for the given key. If the key doesn't already exist in the Data Manager then it is toggled from false. - * + * * When the value is first set, a `setdata` event is emitted. - * + * * @method Phaser.Data.DataManager#toggle * @fires Phaser.Data.Events#SET_DATA * @fires Phaser.Data.Events#CHANGE_DATA @@ -33071,7 +33934,7 @@ var DataManager = new Class({ Object.defineProperty(this.values, key, { enumerable: true, - + configurable: true, get: function () @@ -33171,9 +34034,9 @@ var DataManager = new Class({ * * If the key is found in this Data Manager it is removed from the internal lists and a * `removedata` event is emitted. - * + * * You can also pass in an array of keys, in which case all keys in the array will be removed: - * + * * ```javascript * this.data.remove([ 'gold', 'armor', 'health' ]); * ``` @@ -33265,7 +34128,7 @@ var DataManager = new Class({ /** * Determines whether the given key is set in this Data Manager. - * + * * Please note that the keys are case-sensitive and must be valid JavaScript Object property strings. * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. * @@ -33408,8 +34271,9 @@ module.exports = { CHANGE_DATA: __webpack_require__(221), CHANGE_DATA_KEY: __webpack_require__(222), - REMOVE_DATA: __webpack_require__(223), - SET_DATA: __webpack_require__(224) + DESTROY: __webpack_require__(223), + REMOVE_DATA: __webpack_require__(224), + SET_DATA: __webpack_require__(225) }; @@ -33480,6 +34344,27 @@ module.exports = 'changedata-'; /* 223 */ /***/ (function(module, exports) { +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Data Manager Destroy Event. + * + * The Data Manager will listen for the destroy event from its parent, and then close itself down. + * + * @event Phaser.Data.Events#DESTROY + * @since 3.50.0 + */ +module.exports = 'destroy'; + + +/***/ }), +/* 224 */ +/***/ (function(module, exports) { + /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. @@ -33505,7 +34390,7 @@ module.exports = 'removedata'; /***/ }), -/* 224 */ +/* 225 */ /***/ (function(module, exports) { /** @@ -33533,7 +34418,350 @@ module.exports = 'setdata'; /***/ }), -/* 225 */ +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if (true) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 227 */ /***/ (function(module, exports) { /** @@ -33559,7 +34787,7 @@ module.exports = 'addedtoscene'; /***/ }), -/* 226 */ +/* 228 */ /***/ (function(module, exports) { /** @@ -33584,7 +34812,7 @@ module.exports = 'destroy'; /***/ }), -/* 227 */ +/* 229 */ /***/ (function(module, exports) { /** @@ -33610,7 +34838,7 @@ module.exports = 'removedfromscene'; /***/ }), -/* 228 */ +/* 230 */ /***/ (function(module, exports) { /** @@ -33642,7 +34870,7 @@ module.exports = 'complete'; /***/ }), -/* 229 */ +/* 231 */ /***/ (function(module, exports) { /** @@ -33671,7 +34899,7 @@ module.exports = 'created'; /***/ }), -/* 230 */ +/* 232 */ /***/ (function(module, exports) { /** @@ -33697,7 +34925,7 @@ module.exports = 'error'; /***/ }), -/* 231 */ +/* 233 */ /***/ (function(module, exports) { /** @@ -33729,7 +34957,7 @@ module.exports = 'loop'; /***/ }), -/* 232 */ +/* 234 */ /***/ (function(module, exports) { /** @@ -33757,7 +34985,7 @@ module.exports = 'play'; /***/ }), -/* 233 */ +/* 235 */ /***/ (function(module, exports) { /** @@ -33782,7 +35010,7 @@ module.exports = 'seeked'; /***/ }), -/* 234 */ +/* 236 */ /***/ (function(module, exports) { /** @@ -33808,7 +35036,7 @@ module.exports = 'seeking'; /***/ }), -/* 235 */ +/* 237 */ /***/ (function(module, exports) { /** @@ -33834,7 +35062,7 @@ module.exports = 'stop'; /***/ }), -/* 236 */ +/* 238 */ /***/ (function(module, exports) { /** @@ -33860,7 +35088,7 @@ module.exports = 'timeout'; /***/ }), -/* 237 */ +/* 239 */ /***/ (function(module, exports) { /** @@ -33886,7 +35114,7 @@ module.exports = 'unlocked'; /***/ }), -/* 238 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -33901,18 +35129,18 @@ module.exports = 'unlocked'; module.exports = { - COMPLETE: __webpack_require__(239), - DISPOSE: __webpack_require__(240), - END: __webpack_require__(241), - EVENT: __webpack_require__(242), - INTERRUPTED: __webpack_require__(243), - START: __webpack_require__(244) + COMPLETE: __webpack_require__(241), + DISPOSE: __webpack_require__(242), + END: __webpack_require__(243), + EVENT: __webpack_require__(244), + INTERRUPTED: __webpack_require__(245), + START: __webpack_require__(246) }; /***/ }), -/* 239 */ +/* 241 */ /***/ (function(module, exports) { /** @@ -33931,7 +35159,7 @@ module.exports = 'complete'; /***/ }), -/* 240 */ +/* 242 */ /***/ (function(module, exports) { /** @@ -33950,7 +35178,7 @@ module.exports = 'dispose'; /***/ }), -/* 241 */ +/* 243 */ /***/ (function(module, exports) { /** @@ -33969,7 +35197,7 @@ module.exports = 'end'; /***/ }), -/* 242 */ +/* 244 */ /***/ (function(module, exports) { /** @@ -33988,7 +35216,7 @@ module.exports = 'event'; /***/ }), -/* 243 */ +/* 245 */ /***/ (function(module, exports) { /** @@ -34007,7 +35235,7 @@ module.exports = 'interrupted'; /***/ }), -/* 244 */ +/* 246 */ /***/ (function(module, exports) { /** @@ -34026,7 +35254,7 @@ module.exports = 'start'; /***/ }), -/* 245 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34035,12 +35263,12 @@ module.exports = 'start'; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var renderWebGL = __webpack_require__(4); -var renderCanvas = __webpack_require__(4); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(246); + renderWebGL = __webpack_require__(248); } if (false) @@ -34055,7 +35283,7 @@ module.exports = { /***/ }), -/* 246 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34064,9 +35292,11 @@ module.exports = { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -var CounterClockwise = __webpack_require__(11); -var RadToDeg = __webpack_require__(12); -var Wrap = __webpack_require__(8); +var Clamp = __webpack_require__(4); +var CounterClockwise = __webpack_require__(16); +var GetCalcMatrix = __webpack_require__(249); +var RadToDeg = __webpack_require__(20); +var Wrap = __webpack_require__(10); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -34079,74 +35309,36 @@ var Wrap = __webpack_require__(8); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {SpineGameObject} src - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix) +var SpineGameObjectWebGLRenderer = function (renderer, src, camera, parentMatrix, container) { var plugin = src.plugin; var skeleton = src.skeleton; - var childAlpha = skeleton.color.a; var sceneRenderer = plugin.sceneRenderer; - var GameObjectRenderMask = 15; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0); - - if (!skeleton || !willRender) - { - // If there is already a batch running, we need to close it - if (!renderer.nextTypeMatch) - { - // The next object in the display list is not a Spine object, so we end the batch - sceneRenderer.end(); - - if (!renderer.finalType) - { - // Reset the current type - renderer.currentType = ''; - - renderer.rebindPipeline(renderer.pipelines.MultiPipeline); - } - } - - return; - } - if (renderer.newType) { - renderer.clearPipeline(); + // flush + clear previous pipeline if this is a new type + renderer.pipelines.clear(); + + sceneRenderer.begin(); } - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + var alpha = skeleton.color.a; - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) + if (container) { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + src.scrollFactorX = container.scrollFactorX; + src.scrollFactorY = container.scrollFactorY; - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); + skeleton.color.a = Clamp(alpha * container.alpha, 0, 1); } - else - { - spriteMatrix.e -= camera.scrollX * src.scrollFactorX; - spriteMatrix.f -= camera.scrollY * src.scrollFactorY; - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; var viewportHeight = renderer.height; @@ -34160,7 +35352,8 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent { skeleton.scaleX *= -1; - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); + // -180 degrees to account for the difference in Spine vs. Phaser rotation when inversely scaled + src.root.rotation = Wrap(RadToDeg(calcMatrix.rotationNormalized) - 180, 0, 360); } else { @@ -34188,17 +35381,18 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent skeleton.scaleY *= -1; } - // Add autoUpdate option skeleton.updateWorldTransform(); - if (renderer.newType) - { - sceneRenderer.begin(); - } - // Draw the current skeleton sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); + if (container) + { + src.scrollFactorX = scrollFactorX; + src.scrollFactorY = scrollFactorY; + skeleton.color.a = alpha; + } + if (plugin.drawDebug || src.drawDebug) { // Because if we don't, the bones render positions are completely wrong (*sigh*) @@ -34216,13 +35410,11 @@ var SpineGameObjectWebGLRenderer = function (renderer, src, interpolationPercent if (!renderer.nextTypeMatch) { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch. + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch sceneRenderer.end(); - if (!renderer.finalType) - { - renderer.rebindPipeline(renderer.pipelines.MultiPipeline); - } + // And rebind the previous pipeline + renderer.pipelines.rebind(); } }; @@ -34230,7 +35422,78 @@ module.exports = SpineGameObjectWebGLRenderer; /***/ }), -/* 247 */ +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var TransformMatrix = __webpack_require__(23); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + +var result = { camera: tempMatrix1, sprite: tempMatrix2, calc: tempMatrix3 }; + +/** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * + * @function Phaser.GameObjects.GetCalcMatrix + * @memberof Phaser.GameObjects + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} src - The Game Object to calculate the transform matrix for. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera being used to render the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - The transform matrix of the parent container, if any. + * + * @return {Phaser.Types.GameObjects.GetCalcMatrixResults} The results object containing the updated transform matrices. + */ +var GetCalcMatrix = function (src, camera, parentMatrix) +{ + var camMatrix = tempMatrix1; + var spriteMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; + + spriteMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); + + camMatrix.copyFrom(camera.matrix); + + if (parentMatrix) + { + // Multiply the camera by the parent matrix + camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); + + // Undo the camera scroll + spriteMatrix.e = src.x; + spriteMatrix.f = src.y; + } + else + { + spriteMatrix.e -= camera.scrollX * src.scrollFactorX; + spriteMatrix.f -= camera.scrollY * src.scrollFactorY; + } + + // Multiply by the Sprite matrix, store result in calcMatrix + camMatrix.multiply(spriteMatrix, calcMatrix); + + return result; +}; + +module.exports = GetCalcMatrix; + + +/***/ }), +/* 250 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34240,16 +35503,16 @@ module.exports = SpineGameObjectWebGLRenderer; */ var Class = __webpack_require__(0); -var Container = __webpack_require__(248); -var SpineContainerRender = __webpack_require__(353); +var Container = __webpack_require__(251); +var SpineContainerRender = __webpack_require__(336); /** * @classdesc * A Spine Container is a special kind of Container created specifically for Spine Game Objects. * * You have all of the same features of a standard Container, but the rendering functions are optimized specifically - * for Spine Game Objects. You cannot mix and match Spine Game Objects with regular Game Objects inside of this - * type of Container, however. + * for Spine Game Objects. You must only add ever Spine Game Objects, or other Spine Containers, to this type of Container. + * Although Phaser will not prevent you from adding other types, they will not render and are likely to throw runtime errors. * * To create one in a Scene, use the factory methods: * @@ -34263,7 +35526,11 @@ var SpineContainerRender = __webpack_require__(353); * this.make.spinecontainer(); * ``` * - * See the Container documentation for further details. + * Note that you should not nest Spine Containers inside regular Containers if you wish to use masks on the + * container children. You can, however, mask children of Spine Containers if they are embedded within other + * Spine Containers. In short, if you need masking, don't mix and match the types. + * + * See the Container documentation for further details about what Containers can do. * * @class SpineContainer * @extends Phaser.GameObjects.Container @@ -34296,11 +35563,30 @@ var SpineContainer = new Class({ /** * A reference to the Spine Plugin. * - * @name SpineGameObject#plugin + * @name SpineContainer#plugin * @type {SpinePlugin} - * @since 3.19.0 + * @since 3.50.0 */ this.plugin = plugin; + }, + + /** + * Internal destroy handler, called as part of the destroy process. + * + * @method SpineContainer#preDestroy + * @protected + * @since 3.50.0 + */ + preDestroy: function () + { + this.removeAll(!!this.exclusive); + + this.localTransform.destroy(); + this.tempTransformMatrix.destroy(); + + this.list = []; + this._displayList = null; + this.plugin = null; } }); @@ -34309,7 +35595,7 @@ module.exports = SpineContainer; /***/ }), -/* 248 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -34319,17 +35605,16 @@ module.exports = SpineContainer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var ArrayUtils = __webpack_require__(249); -var BlendModes = __webpack_require__(16); +var ArrayUtils = __webpack_require__(252); +var BlendModes = __webpack_require__(15); var Class = __webpack_require__(0); -var Components = __webpack_require__(285); -var Events = __webpack_require__(22); -var GameObject = __webpack_require__(53); -var GameObjectEvents = __webpack_require__(22); -var Rectangle = __webpack_require__(24); -var Render = __webpack_require__(350); -var Union = __webpack_require__(352); -var Vector2 = __webpack_require__(1); +var Components = __webpack_require__(289); +var Events = __webpack_require__(54); +var GameObject = __webpack_require__(52); +var Rectangle = __webpack_require__(25); +var Render = __webpack_require__(333); +var Union = __webpack_require__(335); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -34359,6 +35644,9 @@ var Vector2 = __webpack_require__(1); * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. * + * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, + * or the input area will become misaligned. + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children @@ -34771,7 +36059,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene); } }, @@ -34796,7 +36084,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene); } }, @@ -34950,7 +36238,7 @@ var Container = new Class({ }; } - ArrayUtils.StableSort.inplace(this.list, handler); + ArrayUtils.StableSort(this.list, handler); return this; }, @@ -35674,7 +36962,7 @@ module.exports = Container; /***/ }), -/* 249 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35689,45 +36977,46 @@ module.exports = Container; module.exports = { - Matrix: __webpack_require__(250), + Matrix: __webpack_require__(253), - Add: __webpack_require__(258), - AddAt: __webpack_require__(259), - BringToTop: __webpack_require__(260), - CountAllMatching: __webpack_require__(261), - Each: __webpack_require__(262), - EachInRange: __webpack_require__(263), - FindClosestInSorted: __webpack_require__(57), - GetAll: __webpack_require__(264), - GetFirst: __webpack_require__(265), - GetRandom: __webpack_require__(266), - MoveDown: __webpack_require__(267), - MoveTo: __webpack_require__(268), - MoveUp: __webpack_require__(269), - NumberArray: __webpack_require__(270), - NumberArrayStep: __webpack_require__(271), - QuickSelect: __webpack_require__(272), - Range: __webpack_require__(273), - Remove: __webpack_require__(274), - RemoveAt: __webpack_require__(275), - RemoveBetween: __webpack_require__(276), - RemoveRandomElement: __webpack_require__(277), - Replace: __webpack_require__(278), - RotateLeft: __webpack_require__(279), - RotateRight: __webpack_require__(280), + Add: __webpack_require__(262), + AddAt: __webpack_require__(263), + BringToTop: __webpack_require__(264), + CountAllMatching: __webpack_require__(265), + Each: __webpack_require__(266), + EachInRange: __webpack_require__(267), + FindClosestInSorted: __webpack_require__(268), + GetAll: __webpack_require__(269), + GetFirst: __webpack_require__(270), + GetRandom: __webpack_require__(271), + MoveDown: __webpack_require__(272), + MoveTo: __webpack_require__(273), + MoveUp: __webpack_require__(274), + NumberArray: __webpack_require__(275), + NumberArrayStep: __webpack_require__(276), + QuickSelect: __webpack_require__(277), + Range: __webpack_require__(278), + Remove: __webpack_require__(279), + RemoveAt: __webpack_require__(280), + RemoveBetween: __webpack_require__(281), + RemoveRandomElement: __webpack_require__(282), + Replace: __webpack_require__(283), + RotateLeft: __webpack_require__(56), + RotateRight: __webpack_require__(57), SafeRange: __webpack_require__(5), - SendToBack: __webpack_require__(281), - SetAll: __webpack_require__(282), + SendToBack: __webpack_require__(284), + SetAll: __webpack_require__(285), Shuffle: __webpack_require__(58), - SpliceOne: __webpack_require__(15), - StableSort: __webpack_require__(283), - Swap: __webpack_require__(284) + SortByDigits: __webpack_require__(286), + SpliceOne: __webpack_require__(14), + StableSort: __webpack_require__(287), + Swap: __webpack_require__(288) }; /***/ }), -/* 250 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35742,21 +37031,22 @@ module.exports = { module.exports = { - CheckMatrix: __webpack_require__(23), - MatrixToString: __webpack_require__(251), - ReverseColumns: __webpack_require__(253), - ReverseRows: __webpack_require__(254), - Rotate180: __webpack_require__(255), - RotateLeft: __webpack_require__(256), - RotateMatrix: __webpack_require__(14), - RotateRight: __webpack_require__(257), - TransposeMatrix: __webpack_require__(56) + CheckMatrix: __webpack_require__(24), + MatrixToString: __webpack_require__(254), + ReverseColumns: __webpack_require__(256), + ReverseRows: __webpack_require__(257), + Rotate180: __webpack_require__(258), + RotateLeft: __webpack_require__(259), + RotateMatrix: __webpack_require__(13), + RotateRight: __webpack_require__(260), + Translate: __webpack_require__(261), + TransposeMatrix: __webpack_require__(55) }; /***/ }), -/* 251 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35765,12 +37055,26 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Pad = __webpack_require__(252); -var CheckMatrix = __webpack_require__(23); +var Pad = __webpack_require__(255); +var CheckMatrix = __webpack_require__(24); /** * Generates a string (which you can pass to console.log) from the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.MatrixToString * @since 3.0.0 * @@ -35837,7 +37141,7 @@ module.exports = MatrixToString; /***/ }), -/* 252 */ +/* 255 */ /***/ (function(module, exports) { /** @@ -35913,7 +37217,7 @@ module.exports = Pad; /***/ }), -/* 253 */ +/* 256 */ /***/ (function(module, exports) { /** @@ -35925,6 +37229,20 @@ module.exports = Pad; /** * Reverses the columns in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseColumns * @since 3.0.0 * @@ -35944,7 +37262,7 @@ module.exports = ReverseColumns; /***/ }), -/* 254 */ +/* 257 */ /***/ (function(module, exports) { /** @@ -35956,6 +37274,20 @@ module.exports = ReverseColumns; /** * Reverses the rows in the given Array Matrix. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.ReverseRows * @since 3.0.0 * @@ -35980,7 +37312,7 @@ module.exports = ReverseRows; /***/ }), -/* 255 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -35989,11 +37321,25 @@ module.exports = ReverseRows; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(14); +var RotateMatrix = __webpack_require__(13); /** * Rotates the array matrix 180 degrees. * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.Rotate180 * @since 3.0.0 * @@ -36013,7 +37359,7 @@ module.exports = Rotate180; /***/ }), -/* 256 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36022,11 +37368,25 @@ module.exports = Rotate180; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(14); +var RotateMatrix = __webpack_require__(13); /** * Rotates the array matrix to the left (or 90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateLeft * @since 3.0.0 * @@ -36046,7 +37406,7 @@ module.exports = RotateLeft; /***/ }), -/* 257 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36055,11 +37415,25 @@ module.exports = RotateLeft; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RotateMatrix = __webpack_require__(14); +var RotateMatrix = __webpack_require__(13); /** * Rotates the array matrix to the left (or -90 degrees) * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * * @function Phaser.Utils.Array.Matrix.RotateRight * @since 3.0.0 * @@ -36079,7 +37453,96 @@ module.exports = RotateRight; /***/ }), -/* 258 */ +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var RotateLeft = __webpack_require__(56); +var RotateRight = __webpack_require__(57); + +/** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * + * @function Phaser.Utils.Array.Matrix.Translate + * @since 3.50.0 + * + * @generic T + * @genericUse {T[][]} - [matrix,$return] + * + * @param {T[][]} [matrix] - The array matrix to translate. + * @param {number} [x=0] - The amount to horizontally translate the matrix by. + * @param {number} [y=0] - The amount to vertically translate the matrix by. + * + * @return {T[][]} The translated matrix. + */ +var TranslateMatrix = function (matrix, x, y) +{ + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + + // Vertical translation + + if (y !== 0) + { + if (y < 0) + { + // Shift Up + RotateLeft(matrix, Math.abs(y)); + } + else + { + // Shift Down + RotateRight(matrix, y); + } + } + + // Horizontal translation + + if (x !== 0) + { + for (var i = 0; i < matrix.length; i++) + { + var row = matrix[i]; + + if (x < 0) + { + RotateLeft(row, Math.abs(x)); + } + else + { + RotateRight(row, x); + } + } + } + + return matrix; +}; + +module.exports = TranslateMatrix; + + +/***/ }), +/* 262 */ /***/ (function(module, exports) { /** @@ -36196,7 +37659,7 @@ module.exports = Add; /***/ }), -/* 259 */ +/* 263 */ /***/ (function(module, exports) { /** @@ -36318,7 +37781,7 @@ module.exports = AddAt; /***/ }), -/* 260 */ +/* 264 */ /***/ (function(module, exports) { /** @@ -36356,7 +37819,7 @@ module.exports = BringToTop; /***/ }), -/* 261 */ +/* 265 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36408,7 +37871,7 @@ module.exports = CountAllMatching; /***/ }), -/* 262 */ +/* 266 */ /***/ (function(module, exports) { /** @@ -36454,7 +37917,7 @@ module.exports = Each; /***/ }), -/* 263 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36510,7 +37973,91 @@ module.exports = EachInRange; /***/ }), -/* 264 */ +/* 268 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Searches a pre-sorted array for the closet value to the given number. + * + * If the `key` argument is given it will assume the array contains objects that all have the required `key` property name, + * and will check for the closest value of those to the given number. + * + * @function Phaser.Utils.Array.FindClosestInSorted + * @since 3.0.0 + * + * @param {number} value - The value to search for in the array. + * @param {array} array - The array to search, which must be sorted. + * @param {string} [key] - An optional property key. If specified the array elements property will be checked against value. + * + * @return {(number|any)} The nearest value found in the array, or if a `key` was given, the nearest object with the matching property value. + */ +var FindClosestInSorted = function (value, array, key) +{ + if (!array.length) + { + return NaN; + } + else if (array.length === 1) + { + return array[0]; + } + + var i = 1; + var low; + var high; + + if (key) + { + if (value < array[0][key]) + { + return array[0]; + } + + while (array[i][key] < value) + { + i++; + } + } + else + { + while (array[i] < value) + { + i++; + } + } + + if (i > array.length) + { + i = array.length; + } + + if (key) + { + low = array[i - 1][key]; + high = array[i][key]; + + return ((high - value) <= (value - low)) ? array[i] : array[i - 1]; + } + else + { + low = array[i - 1]; + high = array[i]; + + return ((high - value) <= (value - low)) ? high : low; + } +}; + +module.exports = FindClosestInSorted; + + +/***/ }), +/* 269 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36572,7 +38119,7 @@ module.exports = GetAll; /***/ }), -/* 265 */ +/* 270 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36631,7 +38178,7 @@ module.exports = GetFirst; /***/ }), -/* 266 */ +/* 271 */ /***/ (function(module, exports) { /** @@ -36666,7 +38213,7 @@ module.exports = GetRandom; /***/ }), -/* 267 */ +/* 272 */ /***/ (function(module, exports) { /** @@ -36708,7 +38255,7 @@ module.exports = MoveDown; /***/ }), -/* 268 */ +/* 273 */ /***/ (function(module, exports) { /** @@ -36755,7 +38302,7 @@ module.exports = MoveTo; /***/ }), -/* 269 */ +/* 274 */ /***/ (function(module, exports) { /** @@ -36797,7 +38344,7 @@ module.exports = MoveUp; /***/ }), -/* 270 */ +/* 275 */ /***/ (function(module, exports) { /** @@ -36810,16 +38357,17 @@ module.exports = MoveUp; * Create an array representing the range of numbers (usually integers), between, and inclusive of, * the given `start` and `end` arguments. For example: * - * `var array = numberArray(2, 4); // array = [2, 3, 4]` - * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` + * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` * - * This is equivalent to `numberArrayStep(start, end, 1)`. + * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. * * You can optionally provide a prefix and / or suffix string. If given the array will contain * strings, not integers. For example: * - * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` - * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` * * @function Phaser.Utils.Array.NumberArray * @since 3.0.0 @@ -36835,22 +38383,50 @@ var NumberArray = function (start, end, prefix, suffix) { var result = []; - for (var i = start; i <= end; i++) + var i; + var asString = false; + + if (prefix || suffix) { - if (prefix || suffix) + asString = true; + + if (!prefix) { - var key = (prefix) ? prefix + i.toString() : i.toString(); - - if (suffix) - { - key = key.concat(suffix); - } - - result.push(key); + prefix = ''; } - else + + if (!suffix) { - result.push(i); + suffix = ''; + } + } + + if (end < start) + { + for (i = start; i >= end; i--) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } + } + } + else + { + for (i = start; i <= end; i++) + { + if (asString) + { + result.push(prefix + i.toString() + suffix); + } + else + { + result.push(i); + } } } @@ -36861,7 +38437,7 @@ module.exports = NumberArray; /***/ }), -/* 271 */ +/* 276 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -36870,7 +38446,7 @@ module.exports = NumberArray; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var RoundAwayFromZero = __webpack_require__(39); +var RoundAwayFromZero = __webpack_require__(40); /** * Create an array of numbers (positive and/or negative) progressing from `start` @@ -36938,7 +38514,7 @@ module.exports = NumberArrayStep; /***/ }), -/* 272 */ +/* 277 */ /***/ (function(module, exports) { /** @@ -37060,7 +38636,7 @@ module.exports = QuickSelect; /***/ }), -/* 273 */ +/* 278 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37069,7 +38645,7 @@ module.exports = QuickSelect; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetValue = __webpack_require__(6); +var GetValue = __webpack_require__(7); var Shuffle = __webpack_require__(58); var BuildChunk = function (a, b, qty) @@ -37198,7 +38774,7 @@ module.exports = Range; /***/ }), -/* 274 */ +/* 279 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37207,7 +38783,7 @@ module.exports = Range; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(15); +var SpliceOne = __webpack_require__(14); /** * Removes the given item, or array of items, from the array. @@ -37289,7 +38865,7 @@ module.exports = Remove; /***/ }), -/* 275 */ +/* 280 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37298,7 +38874,7 @@ module.exports = Remove; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(15); +var SpliceOne = __webpack_require__(14); /** * Removes the item from the given position in the array. @@ -37340,7 +38916,7 @@ module.exports = RemoveAt; /***/ }), -/* 276 */ +/* 281 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37403,7 +38979,7 @@ module.exports = RemoveBetween; /***/ }), -/* 277 */ +/* 282 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37412,7 +38988,7 @@ module.exports = RemoveBetween; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SpliceOne = __webpack_require__(15); +var SpliceOne = __webpack_require__(14); /** * Removes a random object from the given array and returns it. @@ -37441,7 +39017,7 @@ module.exports = RemoveRandomElement; /***/ }), -/* 278 */ +/* 283 */ /***/ (function(module, exports) { /** @@ -37485,87 +39061,7 @@ module.exports = Replace; /***/ }), -/* 279 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the start of the array to the end, shifting all items in the process. - * The "rotation" happens to the left. - * - * @function Phaser.Utils.Array.RotateLeft - * @since 3.0.0 - * - * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateLeft = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.shift(); - array.push(element); - } - - return element; -}; - -module.exports = RotateLeft; - - -/***/ }), -/* 280 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Moves the element at the end of the array to the start, shifting all items in the process. - * The "rotation" happens to the right. - * - * @function Phaser.Utils.Array.RotateRight - * @since 3.0.0 - * - * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. - * - * @return {*} The most recently shifted element. - */ -var RotateRight = function (array, total) -{ - if (total === undefined) { total = 1; } - - var element = null; - - for (var i = 0; i < total; i++) - { - element = array.pop(); - array.unshift(element); - } - - return element; -}; - -module.exports = RotateRight; - - -/***/ }), -/* 281 */ +/* 284 */ /***/ (function(module, exports) { /** @@ -37603,7 +39099,7 @@ module.exports = SendToBack; /***/ }), -/* 282 */ +/* 285 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37658,8 +39154,8 @@ module.exports = SetAll; /***/ }), -/* 283 */ -/***/ (function(module, exports, __webpack_require__) { +/* 286 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -37667,143 +39163,212 @@ module.exports = SetAll; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -//! stable.js 0.1.6, https://github.com/Two-Screen/stable -//! © 2017 Angry Bytes and contributors. MIT licensed. +/** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * + * @function Phaser.Utils.Array.SortByDigits + * @since 3.50.0 + * + * @param {string[]} array - The input array of strings. + * + * @return {string[]} The sorted input array. + */ +var SortByDigits = function (array) +{ + var re = /\D/g; + + array.sort(function (a, b) + { + return (parseInt(a.replace(re, ''), 10) - parseInt(b.replace(re, ''), 10)); + }); + + return array; +}; + +module.exports = SortByDigits; + + +/***/ }), +/* 287 */ +/***/ (function(module, exports) { /** - * @namespace Phaser.Utils.Array.StableSortFunctions + * @author Richard Davey + * @author Angry Bytes (and contributors) + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -(function() { - - /** - * A stable array sort, because `Array#sort()` is not guaranteed stable. - * This is an implementation of merge sort, without recursion. +/** + * The comparator function. * - * @function Phaser.Utils.Array.StableSort - * @since 3.0.0 + * @ignore * - * @param {array} arr - The input array to be sorted. - * @param {function} comp - The comparison handler. + * @param {*} a - The first item to test. + * @param {*} b - The second itemt to test. * - * @return {array} The sorted result. + * @return {boolean} True if they localCompare, otherwise false. */ -var stable = function(arr, comp) { - return exec(arr.slice(), comp); -}; +function Compare (a, b) +{ + return String(a).localeCompare(b); +} - /** - * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes. +/** + * Process the array contents. * - * @function Phaser.Utils.Array.StableSortFunctions.inplace - * @memberof Phaser.Utils.Array.StableSortFunctions - * @since 3.0.0 + * @ignore * - * @param {array} arr - The input array. - * @param {function} comp - The comparison handler. + * @param {array} array - The array to process. + * @param {function} compare - The comparison function. * - * @return {array} The sorted array. + * @return {array} - The processed array. */ -stable.inplace = function(arr, comp) { - var result = exec(arr, comp); - - // This simply copies back if the result isn't in the original array, - // which happens on an odd number of passes. - if (result !== arr) { - pass(result, null, arr.length, arr); - } - - return arr; -}; - -// Execute the sort using the input array and a second buffer as work space. -// Returns one of those two, containing the final result. -function exec(arr, comp) { - if (typeof(comp) !== 'function') { - comp = function(a, b) { - return String(a).localeCompare(b); - }; - } - +function Process (array, compare) +{ // Short-circuit when there's nothing to sort. - var len = arr.length; - if (len <= 1) { - return arr; + var len = array.length; + + if (len <= 1) + { + return array; } // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. // Chunks are the size of the left or right hand in merge sort. // Stop when the left-hand covers all of the array. var buffer = new Array(len); - for (var chk = 1; chk < len; chk *= 2) { - pass(arr, comp, chk, buffer); - var tmp = arr; - arr = buffer; + for (var chk = 1; chk < len; chk *= 2) + { + RunPass(array, compare, chk, buffer); + + var tmp = array; + + array = buffer; + buffer = tmp; } - return arr; + return array; } -// Run a single pass with the given chunk size. -var pass = function(arr, comp, chk, result) { +/** + * Run a single pass with the given chunk size. + * + * @ignore + * + * @param {array} arr - The array to run the pass on. + * @param {function} comp - The comparison function. + * @param {number} chk - The number of iterations. + * @param {array} result - The array to store the result in. + */ +function RunPass (arr, comp, chk, result) +{ var len = arr.length; var i = 0; + // Step size / double chunk size. var dbl = chk * 2; + // Bounds of the left and right chunks. var l, r, e; + // Iterators over the left and right chunk. var li, ri; // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) { + for (l = 0; l < len; l += dbl) + { r = l + chk; e = r + chk; - if (r > len) r = len; - if (e > len) e = len; + + if (r > len) + { + r = len; + } + + if (e > len) + { + e = len; + } // Iterate both chunks in parallel. li = l; ri = r; - while (true) { + + while (true) + { // Compare the chunks. - if (li < r && ri < e) { + if (li < r && ri < e) + { // This works for a regular `sort()` compatible comparator, // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) { + if (comp(arr[li], arr[ri]) <= 0) + { result[i++] = arr[li++]; } - else { + else + { result[i++] = arr[ri++]; } } - // Nothing to compare, just flush what's left. - else if (li < r) { + else if (li < r) + { + // Nothing to compare, just flush what's left. result[i++] = arr[li++]; } - else if (ri < e) { + else if (ri < e) + { result[i++] = arr[ri++]; } - // Both iterators are at the chunk ends. - else { + else + { + // Both iterators are at the chunk ends. break; } } } +} + +/** + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * + * This is an implementation of merge sort, without recursion. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * + * @function Phaser.Utils.Array.StableSort + * @since 3.0.0 + * + * @param {array} array - The input array to be sorted. + * @param {function} [compare] - The comparison function. + * + * @return {array} The sorted result. + */ +var StableSort = function (array, compare) +{ + if (compare === undefined) { compare = Compare; } + + var result = Process(array, compare); + + // This simply copies back if the result isn't in the original array, which happens on an odd number of passes. + if (result !== array) + { + RunPass(result, null, array.length, array); + } + + return array; }; -// Export using CommonJS or to the window. -if (true) { - module.exports = stable; -} -else {} +module.exports = StableSort; -})(); /***/ }), -/* 284 */ +/* 288 */ /***/ (function(module, exports) { /** @@ -37851,7 +39416,7 @@ module.exports = Swap; /***/ }), -/* 285 */ +/* 289 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37866,34 +39431,33 @@ module.exports = Swap; module.exports = { - Alpha: __webpack_require__(286), - AlphaSingle: __webpack_require__(287), - Animation: __webpack_require__(288), - BlendMode: __webpack_require__(309), + Alpha: __webpack_require__(290), + AlphaSingle: __webpack_require__(291), + BlendMode: __webpack_require__(292), ComputedSize: __webpack_require__(46), - Crop: __webpack_require__(310), + Crop: __webpack_require__(293), Depth: __webpack_require__(47), Flip: __webpack_require__(48), - GetBounds: __webpack_require__(311), - Mask: __webpack_require__(320), - Origin: __webpack_require__(340), - PathFollower: __webpack_require__(341), - Pipeline: __webpack_require__(344), + GetBounds: __webpack_require__(294), + Mask: __webpack_require__(303), + Origin: __webpack_require__(323), + PathFollower: __webpack_require__(324), + Pipeline: __webpack_require__(327), ScrollFactor: __webpack_require__(49), - Size: __webpack_require__(345), - Texture: __webpack_require__(346), - TextureCrop: __webpack_require__(347), - Tint: __webpack_require__(348), - ToJSON: __webpack_require__(54), + Size: __webpack_require__(329), + Texture: __webpack_require__(330), + TextureCrop: __webpack_require__(331), + Tint: __webpack_require__(332), + ToJSON: __webpack_require__(53), Transform: __webpack_require__(50), - TransformMatrix: __webpack_require__(51), - Visible: __webpack_require__(52) + TransformMatrix: __webpack_require__(23), + Visible: __webpack_require__(51) }; /***/ }), -/* 286 */ +/* 290 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -37902,7 +39466,7 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(3); +var Clamp = __webpack_require__(4); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -38188,7 +39752,7 @@ module.exports = Alpha; /***/ }), -/* 287 */ +/* 291 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -38197,7 +39761,7 @@ module.exports = Alpha; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Clamp = __webpack_require__(3); +var Clamp = __webpack_require__(4); // bitmask flag for GameObject.renderMask var _FLAG = 2; // 0010 @@ -38297,2665 +39861,8 @@ var AlphaSingle = { module.exports = AlphaSingle; -/***/ }), -/* 288 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BaseAnimation = __webpack_require__(289); -var Class = __webpack_require__(0); -var Events = __webpack_require__(59); - -/** - * @classdesc - * A Game Object Animation Controller. - * - * This controller lives as an instance within a Game Object, accessible as `sprite.anims`. - * - * @class Animation - * @memberof Phaser.GameObjects.Components - * @constructor - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} parent - The Game Object to which this animation controller belongs. - */ -var Animation = new Class({ - - initialize: - - function Animation (parent) - { - /** - * The Game Object to which this animation controller belongs. - * - * @name Phaser.GameObjects.Components.Animation#parent - * @type {Phaser.GameObjects.GameObject} - * @since 3.0.0 - */ - this.parent = parent; - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.GameObjects.Components.Animation#animationManager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.animationManager = parent.scene.sys.anims; - - this.animationManager.once(Events.REMOVE_ANIMATION, this.remove, this); - - /** - * Is an animation currently playing or not? - * - * @name Phaser.GameObjects.Components.Animation#isPlaying - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.isPlaying = false; - - /** - * The current Animation loaded into this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentAnim - * @type {?Phaser.Animations.Animation} - * @default null - * @since 3.0.0 - */ - this.currentAnim = null; - - /** - * The current AnimationFrame being displayed by this Animation Controller. - * - * @name Phaser.GameObjects.Components.Animation#currentFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @since 3.0.0 - */ - this.currentFrame = null; - - /** - * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnim - * @type {?string} - * @default null - * @since 3.16.0 - */ - this.nextAnim = null; - - /** - * A queue of keys of the next Animations to be loaded into this Animation Controller when the current animation completes. - * - * @name Phaser.GameObjects.Components.Animation#nextAnimsQueue - * @type {string[]} - * @since 3.24.0 - */ - this.nextAnimsQueue = []; - - /** - * Time scale factor. - * - * @name Phaser.GameObjects.Components.Animation#_timeScale - * @type {number} - * @private - * @default 1 - * @since 3.0.0 - */ - this._timeScale = 1; - - /** - * The frame rate of playback in frames per second. - * The default is 24 if the `duration` property is `null`. - * - * @name Phaser.GameObjects.Components.Animation#frameRate - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.frameRate = 0; - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.GameObjects.Components.Animation#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * ms per frame, not including frame specific modifiers that may be present in the Animation data. - * - * @name Phaser.GameObjects.Components.Animation#msPerFrame - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.msPerFrame = 0; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.GameObjects.Components.Animation#skipMissedFrames - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.skipMissedFrames = true; - - /** - * A delay before starting playback, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_delay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._delay = 0; - - /** - * Number of times to repeat the animation (-1 for infinity) - * - * @name Phaser.GameObjects.Components.Animation#_repeat - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeat = 0; - - /** - * Delay before the repeat starts, in milliseconds. - * - * @name Phaser.GameObjects.Components.Animation#_repeatDelay - * @type {number} - * @private - * @default 0 - * @since 3.0.0 - */ - this._repeatDelay = 0; - - /** - * Should the animation yoyo? (reverse back down to the start) before repeating? - * - * @name Phaser.GameObjects.Components.Animation#_yoyo - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._yoyo = false; - - /** - * Will the playhead move forwards (`true`) or in reverse (`false`). - * - * @name Phaser.GameObjects.Components.Animation#forward - * @type {boolean} - * @default true - * @since 3.0.0 - */ - this.forward = true; - - /** - * An Internal trigger that's play the animation in reverse mode ('true') or not ('false'), - * needed because forward can be changed by yoyo feature. - * - * @name Phaser.GameObjects.Components.Animation#_reverse - * @type {boolean} - * @default false - * @private - * @since 3.12.0 - */ - this._reverse = false; - - /** - * Internal time overflow accumulator. - * - * @name Phaser.GameObjects.Components.Animation#accumulator - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.accumulator = 0; - - /** - * The time point at which the next animation frame will change. - * - * @name Phaser.GameObjects.Components.Animation#nextTick - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.nextTick = 0; - - /** - * An internal counter keeping track of how many repeats are left to play. - * - * @name Phaser.GameObjects.Components.Animation#repeatCounter - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.repeatCounter = 0; - - /** - * An internal flag keeping track of pending repeats. - * - * @name Phaser.GameObjects.Components.Animation#pendingRepeat - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.pendingRepeat = false; - - /** - * Is the Animation paused? - * - * @name Phaser.GameObjects.Components.Animation#_paused - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._paused = false; - - /** - * Was the animation previously playing before being paused? - * - * @name Phaser.GameObjects.Components.Animation#_wasPlaying - * @type {boolean} - * @private - * @default false - * @since 3.0.0 - */ - this._wasPlaying = false; - - /** - * Internal property tracking if this Animation is waiting to stop. - * - * 0 = No - * 1 = Waiting for ms to pass - * 2 = Waiting for repeat - * 3 = Waiting for specific frame - * - * @name Phaser.GameObjects.Components.Animation#_pendingStop - * @type {integer} - * @private - * @since 3.4.0 - */ - this._pendingStop = 0; - - /** - * Internal property used by _pendingStop. - * - * @name Phaser.GameObjects.Components.Animation#_pendingStopValue - * @type {any} - * @private - * @since 3.4.0 - */ - this._pendingStopValue; - }, - - /** - * Sets an animation to be played immediately after the current one completes. - * - * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. - * - * An animation set to repeat forever will never enter a completed state. - * - * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). - * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. - * - * Call this method with no arguments to reset the chained animation. - * - * @method Phaser.GameObjects.Components.Animation#chain - * @since 3.16.0 - * - * @param {(string|Phaser.Animations.Animation)} [key] - The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - chain: function (key) - { - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (this.nextAnim === null) - { - this.nextAnim = key; - } - else - { - this.nextAnimsQueue.push(key); - } - - return this.parent; - }, - - /** - * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#setDelay - * @since 3.4.0 - * - * @param {integer} [value=0] - The amount of time, in milliseconds, to wait before starting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setDelay: function (value) - { - if (value === undefined) { value = 0; } - - this._delay = value; - - return this.parent; - }, - - /** - * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. - * - * @method Phaser.GameObjects.Components.Animation#getDelay - * @since 3.4.0 - * - * @return {integer} The amount of time, in milliseconds, the Animation will wait before starting playback. - */ - getDelay: function () - { - return this._delay; - }, - - /** - * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. - * - * @method Phaser.GameObjects.Components.Animation#delayedPlay - * @since 3.0.0 - * - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. - * @param {string} key - The key of the animation to play. - * @param {integer} [startFrame=0] - The frame of the animation to start from. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - delayedPlay: function (delay, key, startFrame) - { - this.play(key, true, startFrame); - - this.nextTick += delay; - - return this.parent; - }, - - /** - * Returns the key of the animation currently loaded into this component. - * - * @method Phaser.GameObjects.Components.Animation#getCurrentKey - * @since 3.0.0 - * - * @return {string} The key of the Animation loaded into this component. - */ - getCurrentKey: function () - { - if (this.currentAnim) - { - return this.currentAnim.key; - } - }, - - /** - * Internal method used to load an animation into this component. - * - * @method Phaser.GameObjects.Components.Animation#load - * @protected - * @since 3.0.0 - * - * @param {string} key - The key of the animation to load. - * @param {integer} [startFrame=0] - The start frame of the animation to load. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - load: function (key, startFrame) - { - if (startFrame === undefined) { startFrame = 0; } - - if (this.isPlaying) - { - this.stop(); - } - - // Load the new animation in - this.animationManager.load(this, key, startFrame); - - return this.parent; - }, - - /** - * Pause the current animation and set the `isPlaying` property to `false`. - * You can optionally pause it at a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#pause - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [atFrame] - An optional frame to set after pausing the animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - pause: function (atFrame) - { - if (!this._paused) - { - this._paused = true; - this._wasPlaying = this.isPlaying; - this.isPlaying = false; - } - - if (atFrame !== undefined) - { - this.updateFrame(atFrame); - } - - return this.parent; - }, - - /** - * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. - * You can optionally tell it to start playback from a specific frame. - * - * @method Phaser.GameObjects.Components.Animation#resume - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} [fromFrame] - An optional frame to set before restarting playback. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - resume: function (fromFrame) - { - if (this._paused) - { - this._paused = false; - this.isPlaying = this._wasPlaying; - } - - if (fromFrame !== undefined) - { - this.updateFrame(fromFrame); - } - - return this.parent; - }, - - /** - * `true` if the current animation is paused, otherwise `false`. - * - * @name Phaser.GameObjects.Components.Animation#isPaused - * @readonly - * @type {boolean} - * @since 3.4.0 - */ - isPaused: { - - get: function () - { - return this._paused; - } - - }, - - /** - * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. - * - * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. - * - * @method Phaser.GameObjects.Components.Animation#play - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.0.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If this animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - play: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = true; - this._reverse = false; - this._paused = false; - this._wasPlaying = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#playReverse - * @fires Phaser.GameObjects.Components.Animation#onStartEvent - * @since 3.12.0 - * - * @param {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - playReverse: function (key, ignoreIfPlaying, startFrame) - { - if (ignoreIfPlaying === undefined) { ignoreIfPlaying = false; } - if (startFrame === undefined) { startFrame = 0; } - - if (key instanceof BaseAnimation) - { - key = key.key; - } - - if (ignoreIfPlaying && this.isPlaying && this.currentAnim.key === key) - { - return this.parent; - } - - this.forward = false; - this._reverse = true; - - return this._startAnimation(key, startFrame); - }, - - /** - * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. - * - * @method Phaser.GameObjects.Components.Animation#_startAnimation - * @fires Phaser.Animations.Events#ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_START - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.12.0 - * - * @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - _startAnimation: function (key, startFrame) - { - this.load(key, startFrame); - - var anim = this.currentAnim; - var gameObject = this.parent; - - if (!anim) - { - return gameObject; - } - - // Should give us 9,007,199,254,740,991 safe repeats - this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat; - - anim.getFirstTick(this); - - this.isPlaying = true; - this.pendingRepeat = false; - - if (anim.showOnStart) - { - gameObject.visible = true; - } - - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_START, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_START + key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_START, anim, frame, gameObject); - - return gameObject; - }, - - /** - * Reverse the Animation that is already playing on the Game Object. - * - * @method Phaser.GameObjects.Components.Animation#reverse - * @since 3.12.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - reverse: function () - { - if (this.isPlaying) - { - this._reverse = !this._reverse; - - this.forward = !this.forward; - } - - return this.parent; - }, - - /** - * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. - * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different - * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. - * - * @method Phaser.GameObjects.Components.Animation#getProgress - * @since 3.4.0 - * - * @return {number} The progress of the current animation, between 0 and 1. - */ - getProgress: function () - { - var p = this.currentFrame.progress; - - if (!this.forward) - { - p = 1 - p; - } - - return p; - }, - - /** - * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. - * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. - * - * @method Phaser.GameObjects.Components.Animation#setProgress - * @since 3.4.0 - * - * @param {number} [value=0] - The progress value, between 0 and 1. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setProgress: function (value) - { - if (!this.forward) - { - value = 1 - value; - } - - this.setCurrentFrame(this.currentAnim.getFrameByProgress(value)); - - return this.parent; - }, - - /** - * Handle the removal of an animation from the Animation Manager. - * - * @method Phaser.GameObjects.Components.Animation#remove - * @since 3.0.0 - * - * @param {string} [key] - The key of the removed Animation. - * @param {Phaser.Animations.Animation} [animation] - The removed Animation. - */ - remove: function (key, animation) - { - if (animation === undefined) { animation = this.currentAnim; } - - if (this.isPlaying && animation.key === this.currentAnim.key) - { - this.stop(); - - this.setCurrentFrame(this.currentAnim.frames[0]); - } - }, - - /** - * Gets the number of times that the animation will repeat - * after its first iteration. For example, if returns 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * A value of -1 means the animation will repeat indefinitely. - * - * @method Phaser.GameObjects.Components.Animation#getRepeat - * @since 3.4.0 - * - * @return {integer} The number of times that the animation will repeat. - */ - getRepeat: function () - { - return this._repeat; - }, - - /** - * Sets the number of times that the animation should repeat - * after its first iteration. For example, if repeat is 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * To repeat indefinitely, use -1. repeat should always be an integer. - * - * @method Phaser.GameObjects.Components.Animation#setRepeat - * @since 3.4.0 - * - * @param {integer} value - The number of times that the animation should repeat. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeat: function (value) - { - this._repeat = value; - - this.repeatCounter = (value === -1) ? Number.MAX_VALUE : value; - - return this.parent; - }, - - /** - * Gets the amount of delay between repeats, if any. - * - * @method Phaser.GameObjects.Components.Animation#getRepeatDelay - * @since 3.4.0 - * - * @return {number} The delay between repeats. - */ - getRepeatDelay: function () - { - return this._repeatDelay; - }, - - /** - * Sets the amount of time in seconds between repeats. - * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, - * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds - * before doing its final repeat. - * - * @method Phaser.GameObjects.Components.Animation#setRepeatDelay - * @since 3.4.0 - * - * @param {number} value - The delay to wait between repeats, in seconds. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setRepeatDelay: function (value) - { - this._repeatDelay = value; - - return this.parent; - }, - - /** - * Restarts the current animation from its beginning, optionally including its delay value. - * - * @method Phaser.GameObjects.Components.Animation#restart - * @fires Phaser.Animations.Events#ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.0.0 - * - * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - restart: function (includeDelay) - { - if (includeDelay === undefined) { includeDelay = false; } - - var anim = this.currentAnim; - - anim.getFirstTick(this, includeDelay); - - this.forward = true; - this.isPlaying = true; - this.pendingRepeat = false; - this._paused = false; - - // Set frame - this.updateFrame(anim.frames[0]); - - var gameObject = this.parent; - var frame = this.currentFrame; - - anim.emit(Events.ANIMATION_RESTART, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_RESTART + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_RESTART, anim, frame, gameObject); - - return this.parent; - }, - - /** - * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. - * - * If no animation is set, no event will be dispatched. - * - * If there is another animation queued (via the `chain` method) then it will start playing immediately. - * - * @method Phaser.GameObjects.Components.Animation#stop - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.0.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stop: function () - { - this._pendingStop = 0; - - this.isPlaying = false; - - var gameObject = this.parent; - var anim = this.currentAnim; - var frame = this.currentFrame; - - if (anim) - { - anim.emit(Events.ANIMATION_COMPLETE, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_COMPLETE + anim.key, anim, frame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_COMPLETE, anim, frame, gameObject); - } - - if (this.nextAnim) - { - var key = this.nextAnim; - - this.nextAnim = (this.nextAnimsQueue.length > 0) ? this.nextAnimsQueue.shift() : null; - - this.play(key); - } - - return gameObject; - }, - - /** - * Stops the current animation from playing after the specified time delay, given in milliseconds. - * - * @method Phaser.GameObjects.Components.Animation#stopAfterDelay - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopAfterDelay: function (delay) - { - this._pendingStop = 1; - this._pendingStopValue = delay; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next repeats. - * - * @method Phaser.GameObjects.Components.Animation#stopOnRepeat - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnRepeat: function () - { - this._pendingStop = 2; - - return this.parent; - }, - - /** - * Stops the current animation from playing when it next sets the given frame. - * If this frame doesn't exist within the animation it will not stop it from playing. - * - * @method Phaser.GameObjects.Components.Animation#stopOnFrame - * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The frame to check before stopping this animation. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - stopOnFrame: function (frame) - { - this._pendingStop = 3; - this._pendingStopValue = frame; - - return this.parent; - }, - - /** - * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. - * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. - * - * @method Phaser.GameObjects.Components.Animation#setTimeScale - * @since 3.4.0 - * - * @param {number} [value=1] - The time scale factor, where 1 is no change, 0.5 is half speed, etc. - * - * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. - */ - setTimeScale: function (value) - { - if (value === undefined) { value = 1; } - - this._timeScale = value; - - return this.parent; - }, - - /** - * Gets the Time Scale factor. - * - * @method Phaser.GameObjects.Components.Animation#getTimeScale - * @since 3.4.0 - * - * @return {number} The Time Scale value. - */ - getTimeScale: function () - { - return this._timeScale; - }, - - /** - * Returns the total number of frames in this animation. - * - * @method Phaser.GameObjects.Components.Animation#getTotalFrames - * @since 3.4.0 - * - * @return {integer} The total number of frames in this animation. - */ - getTotalFrames: function () - { - return this.currentAnim.frames.length; - }, - - /** - * The internal update loop for the Animation Component. - * - * @method Phaser.GameObjects.Components.Animation#update - * @since 3.0.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - update: function (time, delta) - { - if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused) - { - return; - } - - this.accumulator += delta * this._timeScale; - - if (this._pendingStop === 1) - { - this._pendingStopValue -= delta; - - if (this._pendingStopValue <= 0) - { - return this.currentAnim.completeAnimation(this); - } - } - - if (this.accumulator >= this.nextTick) - { - this.currentAnim.setFrame(this); - } - }, - - /** - * Sets the given Animation Frame as being the current frame - * and applies it to the parent Game Object, adjusting its size and origin as needed. - * - * @method Phaser.GameObjects.Components.Animation#setCurrentFrame - * @since 3.4.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The Animation Frame to set as being current. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setCurrentFrame: function (animationFrame) - { - var gameObject = this.parent; - - this.currentFrame = animationFrame; - - gameObject.texture = animationFrame.frame.texture; - gameObject.frame = animationFrame.frame; - - if (gameObject.isCropped) - { - gameObject.frame.updateCropUVs(gameObject._crop, gameObject.flipX, gameObject.flipY); - } - - gameObject.setSizeToFrame(); - - if (gameObject._originComponent) - { - if (animationFrame.frame.customPivot) - { - gameObject.setOrigin(animationFrame.frame.pivotX, animationFrame.frame.pivotY); - } - else - { - gameObject.updateDisplayOrigin(); - } - } - - return gameObject; - }, - - /** - * Internal frame change handler. - * - * @method Phaser.GameObjects.Components.Animation#updateFrame - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @private - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to. - */ - updateFrame: function (animationFrame) - { - var gameObject = this.setCurrentFrame(animationFrame); - - if (this.isPlaying) - { - if (animationFrame.setAlpha) - { - gameObject.alpha = animationFrame.alpha; - } - - var anim = this.currentAnim; - - gameObject.emit(Events.SPRITE_ANIMATION_KEY_UPDATE + anim.key, anim, animationFrame, gameObject); - - gameObject.emit(Events.SPRITE_ANIMATION_UPDATE, anim, animationFrame, gameObject); - - if (this._pendingStop === 3 && this._pendingStopValue === animationFrame) - { - this.currentAnim.completeAnimation(this); - } - } - }, - - /** - * Advances the animation to the next frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in reverse, calling this method doesn't then change the direction to forwards. - * - * @method Phaser.GameObjects.Components.Animation#nextFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - nextFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.nextFrame(this); - } - - return this.parent; - }, - - /** - * Advances the animation to the previous frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in forwards, calling this method doesn't then change the direction to backwards. - * - * @method Phaser.GameObjects.Components.Animation#previousFrame - * @since 3.16.0 - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - previousFrame: function () - { - if (this.currentAnim) - { - this.currentAnim.previousFrame(this); - } - - return this.parent; - }, - - /** - * Sets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#setYoyo - * @since 3.4.0 - * - * @param {boolean} [value=false] - `true` if the animation should yoyo, `false` to not. - * - * @return {Phaser.GameObjects.GameObject} The Game Object this Animation Component belongs to. - */ - setYoyo: function (value) - { - if (value === undefined) { value = false; } - - this._yoyo = value; - - return this.parent; - }, - - /** - * Gets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * - * @method Phaser.GameObjects.Components.Animation#getYoyo - * @since 3.4.0 - * - * @return {boolean} `true` if the animation is set to yoyo, `false` if not. - */ - getYoyo: function () - { - return this._yoyo; - }, - - /** - * Destroy this Animation component. - * - * Unregisters event listeners and cleans up its references. - * - * @method Phaser.GameObjects.Components.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.animationManager.off(Events.REMOVE_ANIMATION, this.remove, this); - - this.animationManager = null; - this.parent = null; - this.nextAnimsQueue.length = 0; - - this.currentAnim = null; - this.currentFrame = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 289 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Clamp = __webpack_require__(3); -var Class = __webpack_require__(0); -var EventEmitter = __webpack_require__(55); -var Events = __webpack_require__(59); -var FindClosestInSorted = __webpack_require__(57); -var Frame = __webpack_require__(308); -var GetValue = __webpack_require__(6); - -/** - * @classdesc - * A Frame based Animation. - * - * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. - * - * The Animation Manager creates these. Game Objects don't own an instance of these directly. - * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) - * So multiple Game Objects can have playheads all pointing to this one Animation instance. - * - * @class Animation - * @memberof Phaser.Animations - * @extends Phaser.Events.EventEmitter - * @constructor - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager - * @param {string} key - The unique identifying string for this animation. - * @param {Phaser.Types.Animations.Animation} config - The Animation configuration. - */ -var Animation = new Class({ - - Extends: EventEmitter, - - initialize: - - function Animation (manager, key, config) - { - EventEmitter.call(this); - - /** - * A reference to the global Animation Manager. - * - * @name Phaser.Animations.Animation#manager - * @type {Phaser.Animations.AnimationManager} - * @since 3.0.0 - */ - this.manager = manager; - - /** - * The unique identifying string for this animation. - * - * @name Phaser.Animations.Animation#key - * @type {string} - * @since 3.0.0 - */ - this.key = key; - - /** - * A frame based animation (as opposed to a bone based animation) - * - * @name Phaser.Animations.Animation#type - * @type {string} - * @default frame - * @since 3.0.0 - */ - this.type = 'frame'; - - /** - * Extract all the frame data into the frames array. - * - * @name Phaser.Animations.Animation#frames - * @type {Phaser.Animations.AnimationFrame[]} - * @since 3.0.0 - */ - this.frames = this.getFrames( - manager.textureManager, - GetValue(config, 'frames', []), - GetValue(config, 'defaultTextureKey', null) - ); - - /** - * The frame rate of playback in frames per second (default 24 if duration is null) - * - * @name Phaser.Animations.Animation#frameRate - * @type {integer} - * @default 24 - * @since 3.0.0 - */ - this.frameRate = GetValue(config, 'frameRate', null); - - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - * - * @name Phaser.Animations.Animation#duration - * @type {integer} - * @since 3.0.0 - */ - this.duration = GetValue(config, 'duration', null); - - if (this.duration === null && this.frameRate === null) - { - // No duration or frameRate given, use default frameRate of 24fps - this.frameRate = 24; - this.duration = (this.frameRate / this.frames.length) * 1000; - } - else if (this.duration && this.frameRate === null) - { - // Duration given but no frameRate, so set the frameRate based on duration - // I.e. 12 frames in the animation, duration = 4000 ms - // So frameRate is 12 / (4000 / 1000) = 3 fps - this.frameRate = this.frames.length / (this.duration / 1000); - } - else - { - // frameRate given, derive duration from it (even if duration also specified) - // I.e. 15 frames in the animation, frameRate = 30 fps - // So duration is 15 / 30 = 0.5 * 1000 (half a second, or 500ms) - this.duration = (this.frames.length / this.frameRate) * 1000; - } - - /** - * How many ms per frame, not including frame specific modifiers. - * - * @name Phaser.Animations.Animation#msPerFrame - * @type {integer} - * @since 3.0.0 - */ - this.msPerFrame = 1000 / this.frameRate; - - /** - * Skip frames if the time lags, or always advanced anyway? - * - * @name Phaser.Animations.Animation#skipMissedFrames - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.skipMissedFrames = GetValue(config, 'skipMissedFrames', true); - - /** - * The delay in ms before the playback will begin. - * - * @name Phaser.Animations.Animation#delay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.delay = GetValue(config, 'delay', 0); - - /** - * Number of times to repeat the animation. Set to -1 to repeat forever. - * - * @name Phaser.Animations.Animation#repeat - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeat = GetValue(config, 'repeat', 0); - - /** - * The delay in ms before the a repeat play starts. - * - * @name Phaser.Animations.Animation#repeatDelay - * @type {integer} - * @default 0 - * @since 3.0.0 - */ - this.repeatDelay = GetValue(config, 'repeatDelay', 0); - - /** - * Should the animation yoyo (reverse back down to the start) before repeating? - * - * @name Phaser.Animations.Animation#yoyo - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.yoyo = GetValue(config, 'yoyo', false); - - /** - * Should the GameObject's `visible` property be set to `true` when the animation starts to play? - * - * @name Phaser.Animations.Animation#showOnStart - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.showOnStart = GetValue(config, 'showOnStart', false); - - /** - * Should the GameObject's `visible` property be set to `false` when the animation finishes? - * - * @name Phaser.Animations.Animation#hideOnComplete - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.hideOnComplete = GetValue(config, 'hideOnComplete', false); - - /** - * Global pause. All Game Objects using this Animation instance are impacted by this property. - * - * @name Phaser.Animations.Animation#paused - * @type {boolean} - * @default false - * @since 3.0.0 - */ - this.paused = false; - - this.manager.on(Events.PAUSE_ALL, this.pause, this); - this.manager.on(Events.RESUME_ALL, this.resume, this); - }, - - /** - * Add frames to the end of the animation. - * - * @method Phaser.Animations.Animation#addFrame - * @since 3.0.0 - * - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrame: function (config) - { - return this.addFrameAt(this.frames.length, config); - }, - - /** - * Add frame/s into the animation. - * - * @method Phaser.Animations.Animation#addFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index to insert the frame at within the animation. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * - * @return {this} This Animation object. - */ - addFrameAt: function (index, config) - { - var newFrames = this.getFrames(this.manager.textureManager, config); - - if (newFrames.length > 0) - { - if (index === 0) - { - this.frames = newFrames.concat(this.frames); - } - else if (index === this.frames.length) - { - this.frames = this.frames.concat(newFrames); - } - else - { - var pre = this.frames.slice(0, index); - var post = this.frames.slice(index); - - this.frames = pre.concat(newFrames, post); - } - - this.updateFrameSequence(); - } - - return this; - }, - - /** - * Check if the given frame index is valid. - * - * @method Phaser.Animations.Animation#checkFrame - * @since 3.0.0 - * - * @param {integer} index - The index to be checked. - * - * @return {boolean} `true` if the index is valid, otherwise `false`. - */ - checkFrame: function (index) - { - return (index >= 0 && index < this.frames.length); - }, - - /** - * Called internally when this Animation completes playback. - * Optionally, hides the parent Game Object, then stops playback. - * - * @method Phaser.Animations.Animation#completeAnimation - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - completeAnimation: function (component) - { - if (this.hideOnComplete) - { - component.parent.visible = false; - } - - component.stop(); - }, - - /** - * Called internally when this Animation first starts to play. - * Sets the accumulator and nextTick properties. - * - * @method Phaser.Animations.Animation#getFirstTick - * @protected - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - * @param {boolean} [includeDelay=true] - If `true` the Animation Components delay value will be added to the `nextTick` total. - */ - getFirstTick: function (component, includeDelay) - { - if (includeDelay === undefined) { includeDelay = true; } - - // When is the first update due? - component.accumulator = 0; - component.nextTick = component.msPerFrame + component.currentFrame.duration; - - if (includeDelay) - { - component.nextTick += component._delay; - } - }, - - /** - * Returns the AnimationFrame at the provided index - * - * @method Phaser.Animations.Animation#getFrameAt - * @protected - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence - */ - getFrameAt: function (index) - { - return this.frames[index]; - }, - - /** - * Creates AnimationFrame instances based on the given frame data. - * - * @method Phaser.Animations.Animation#getFrames - * @since 3.0.0 - * - * @param {Phaser.Textures.TextureManager} textureManager - A reference to the global Texture Manager. - * @param {(string|Phaser.Types.Animations.AnimationFrame[])} frames - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. - * @param {string} [defaultTextureKey] - The key to use if no key is set in the frame configuration object. - * - * @return {Phaser.Animations.AnimationFrame[]} An array of newly created AnimationFrame instances. - */ - getFrames: function (textureManager, frames, defaultTextureKey) - { - var out = []; - var prev; - var animationFrame; - var index = 1; - var i; - var textureKey; - - // if frames is a string, we'll get all the frames from the texture manager as if it's a sprite sheet - if (typeof frames === 'string') - { - textureKey = frames; - - var texture = textureManager.get(textureKey); - var frameKeys = texture.getFrameNames(); - - frames = []; - - frameKeys.forEach(function (idx, value) - { - frames.push({ key: textureKey, frame: value }); - }); - } - - if (!Array.isArray(frames) || frames.length === 0) - { - return out; - } - - for (i = 0; i < frames.length; i++) - { - var item = frames[i]; - - var key = GetValue(item, 'key', defaultTextureKey); - - if (!key) - { - continue; - } - - // Could be an integer or a string - var frame = GetValue(item, 'frame', 0); - - // The actual texture frame - var textureFrame = textureManager.getFrame(key, frame); - - animationFrame = new Frame(key, frame, index, textureFrame); - - animationFrame.duration = GetValue(item, 'duration', 0); - - animationFrame.isFirst = (!prev); - - // The previously created animationFrame - if (prev) - { - prev.nextFrame = animationFrame; - - animationFrame.prevFrame = prev; - } - - out.push(animationFrame); - - prev = animationFrame; - - index++; - } - - if (out.length > 0) - { - animationFrame.isLast = true; - - // Link them end-to-end, so they loop - animationFrame.nextFrame = out[0]; - - out[0].prevFrame = animationFrame; - - // Generate the progress data - - var slice = 1 / (out.length - 1); - - for (i = 0; i < out.length; i++) - { - out[i].progress = i * slice; - } - } - - return out; - }, - - /** - * Called internally. Sets the accumulator and nextTick values of the current Animation. - * - * @method Phaser.Animations.Animation#getNextTick - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - getNextTick: function (component) - { - // accumulator += delta * _timeScale - // after a large delta surge (perf issue for example) we need to adjust for it here - - // When is the next update due? - component.accumulator -= component.nextTick; - - component.nextTick = component.msPerFrame + component.currentFrame.duration; - }, - - /** - * Loads the Animation values into the Animation Component. - * - * @method Phaser.Animations.Animation#load - * @private - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into. - * @param {integer} startFrame - The start frame of the animation to load. - */ - load: function (component, startFrame) - { - if (startFrame >= this.frames.length) - { - startFrame = 0; - } - - if (component.currentAnim !== this) - { - component.currentAnim = this; - - component.frameRate = this.frameRate; - component.duration = this.duration; - component.msPerFrame = this.msPerFrame; - component.skipMissedFrames = this.skipMissedFrames; - - component._delay = this.delay; - component._repeat = this.repeat; - component._repeatDelay = this.repeatDelay; - component._yoyo = this.yoyo; - } - - var frame = this.frames[startFrame]; - - if (startFrame === 0 && !component.forward) - { - frame = this.getLastFrame(); - } - - component.updateFrame(frame); - }, - - /** - * Returns the frame closest to the given progress value between 0 and 1. - * - * @method Phaser.Animations.Animation#getFrameByProgress - * @since 3.4.0 - * - * @param {number} value - A value between 0 and 1. - * - * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value. - */ - getFrameByProgress: function (value) - { - value = Clamp(value, 0, 1); - - return FindClosestInSorted(value, this.frames, 'progress'); - }, - - /** - * Advance the animation frame. - * - * @method Phaser.Animations.Animation#nextFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - */ - nextFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isLast) - { - // We're at the end of the animation - - // Yoyo? (happens before repeat) - if (component._yoyo) - { - this.handleYoyoFrame(component, false); - } - else if (component.repeatCounter > 0) - { - // Repeat (happens before complete) - - if (component._reverse && component.forward) - { - component.forward = false; - } - else - { - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.nextFrame); - } - }, - - /** - * Handle the yoyo functionality in nextFrame and previousFrame methods. - * - * @method Phaser.Animations.Animation#handleYoyoFrame - * @private - * @since 3.12.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. - * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) - */ - handleYoyoFrame: function (component, isReverse) - { - if (!isReverse) { isReverse = false; } - - if (component._reverse === !isReverse && component.repeatCounter > 0) - { - if (!component._repeatDelay || component.pendingRepeat) - - { - component.forward = isReverse; - } - - this.repeatAnimation(component); - - return; - } - - if (component._reverse !== isReverse && component.repeatCounter === 0) - { - this.completeAnimation(component); - - return; - } - - component.forward = isReverse; - - var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; - - this.updateAndGetNextTick(component, frame); - }, - - /** - * Returns the animation last frame. - * - * @method Phaser.Animations.Animation#getLastFrame - * @since 3.12.0 - * - * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. - */ - getLastFrame: function () - { - return this.frames[this.frames.length - 1]; - }, - - /** - * Called internally when the Animation is playing backwards. - * Sets the previous frame, causing a yoyo, repeat, complete or update, accordingly. - * - * @method Phaser.Animations.Animation#previousFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - previousFrame: function (component) - { - var frame = component.currentFrame; - - // TODO: Add frame skip support - - if (frame.isFirst) - { - // We're at the start of the animation - - if (component._yoyo) - { - this.handleYoyoFrame(component, true); - } - else if (component.repeatCounter > 0) - { - if (component._reverse && !component.forward) - { - component.currentFrame = this.getLastFrame(); - this.repeatAnimation(component); - } - else - { - // Repeat (happens before complete) - component.forward = true; - this.repeatAnimation(component); - } - } - else - { - this.completeAnimation(component); - } - } - else - { - this.updateAndGetNextTick(component, frame.prevFrame); - } - }, - - /** - * Update Frame and Wait next tick. - * - * @method Phaser.Animations.Animation#updateAndGetNextTick - * @private - * @since 3.12.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. - */ - updateAndGetNextTick: function (component, frame) - { - component.updateFrame(frame); - - this.getNextTick(component); - }, - - /** - * Removes the given AnimationFrame from this Animation instance. - * This is a global action. Any Game Object using this Animation will be impacted by this change. - * - * @method Phaser.Animations.Animation#removeFrame - * @since 3.0.0 - * - * @param {Phaser.Animations.AnimationFrame} frame - The AnimationFrame to be removed. - * - * @return {this} This Animation object. - */ - removeFrame: function (frame) - { - var index = this.frames.indexOf(frame); - - if (index !== -1) - { - this.removeFrameAt(index); - } - - return this; - }, - - /** - * Removes a frame from the AnimationFrame array at the provided index - * and updates the animation accordingly. - * - * @method Phaser.Animations.Animation#removeFrameAt - * @since 3.0.0 - * - * @param {integer} index - The index in the AnimationFrame array - * - * @return {this} This Animation object. - */ - removeFrameAt: function (index) - { - this.frames.splice(index, 1); - - this.updateFrameSequence(); - - return this; - }, - - /** - * Called internally during playback. Forces the animation to repeat, providing there are enough counts left - * in the repeat counter. - * - * @method Phaser.Animations.Animation#repeatAnimation - * @fires Phaser.Animations.Events#ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - repeatAnimation: function (component) - { - if (component._pendingStop === 2) - { - return this.completeAnimation(component); - } - - if (component._repeatDelay > 0 && component.pendingRepeat === false) - { - component.pendingRepeat = true; - component.accumulator -= component.nextTick; - component.nextTick += component._repeatDelay; - } - else - { - component.repeatCounter--; - - component.updateFrame(component.currentFrame[(component.forward) ? 'nextFrame' : 'prevFrame']); - - if (component.isPlaying) - { - this.getNextTick(component); - - component.pendingRepeat = false; - - var frame = component.currentFrame; - var parent = component.parent; - - this.emit(Events.ANIMATION_REPEAT, this, frame); - - parent.emit(Events.SPRITE_ANIMATION_KEY_REPEAT + this.key, this, frame, component.repeatCounter, parent); - - parent.emit(Events.SPRITE_ANIMATION_REPEAT, this, frame, component.repeatCounter, parent); - } - } - }, - - /** - * Sets the texture frame the animation uses for rendering. - * - * @method Phaser.Animations.Animation#setFrame - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. - */ - setFrame: function (component) - { - // Work out which frame should be set next on the child, and set it - if (component.forward) - { - this.nextFrame(component); - } - else - { - this.previousFrame(component); - } - }, - - /** - * Converts the animation data to JSON. - * - * @method Phaser.Animations.Animation#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimation} The resulting JSONAnimation formatted object. - */ - toJSON: function () - { - var output = { - key: this.key, - type: this.type, - frames: [], - frameRate: this.frameRate, - duration: this.duration, - skipMissedFrames: this.skipMissedFrames, - delay: this.delay, - repeat: this.repeat, - repeatDelay: this.repeatDelay, - yoyo: this.yoyo, - showOnStart: this.showOnStart, - hideOnComplete: this.hideOnComplete - }; - - this.frames.forEach(function (frame) - { - output.frames.push(frame.toJSON()); - }); - - return output; - }, - - /** - * Called internally whenever frames are added to, or removed from, this Animation. - * - * @method Phaser.Animations.Animation#updateFrameSequence - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - updateFrameSequence: function () - { - var len = this.frames.length; - var slice = 1 / (len - 1); - - var frame; - - for (var i = 0; i < len; i++) - { - frame = this.frames[i]; - - frame.index = i + 1; - frame.isFirst = false; - frame.isLast = false; - frame.progress = i * slice; - - if (i === 0) - { - frame.isFirst = true; - - if (len === 1) - { - frame.isLast = true; - frame.nextFrame = frame; - frame.prevFrame = frame; - } - else - { - frame.isLast = false; - frame.prevFrame = this.frames[len - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - else if (i === len - 1 && len > 1) - { - frame.isLast = true; - frame.prevFrame = this.frames[len - 2]; - frame.nextFrame = this.frames[0]; - } - else if (len > 1) - { - frame.prevFrame = this.frames[i - 1]; - frame.nextFrame = this.frames[i + 1]; - } - } - - return this; - }, - - /** - * Pauses playback of this Animation. The paused state is set immediately. - * - * @method Phaser.Animations.Animation#pause - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - pause: function () - { - this.paused = true; - - return this; - }, - - /** - * Resumes playback of this Animation. The paused state is reset immediately. - * - * @method Phaser.Animations.Animation#resume - * @since 3.0.0 - * - * @return {this} This Animation object. - */ - resume: function () - { - this.paused = false; - - return this; - }, - - /** - * Destroys this Animation instance. It will remove all event listeners, - * remove this animation and its key from the global Animation Manager, - * and then destroy all Animation Frames in turn. - * - * @method Phaser.Animations.Animation#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAllListeners(); - - this.manager.off(Events.PAUSE_ALL, this.pause, this); - this.manager.off(Events.RESUME_ALL, this.resume, this); - - this.manager.remove(this.key); - - for (var i = 0; i < this.frames.length; i++) - { - this.frames[i].destroy(); - } - - this.frames = []; - - this.manager = null; - } - -}); - -module.exports = Animation; - - -/***/ }), -/* 290 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Add Animation Event. - * - * This event is dispatched when a new animation is added to the global Animation Manager. - * - * This can happen either as a result of an animation instance being added to the Animation Manager, - * or the Animation Manager creating a new animation directly. - * - * @event Phaser.Animations.Events#ADD_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was added to the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the newly created Animation. - */ -module.exports = 'add'; - - -/***/ }), -/* 291 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Complete Event. - * - * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. - * - * Be careful with the volume of events this could generate. If a group of Sprites all complete the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'complete'; - - /***/ }), /* 292 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Repeat Event. - * - * This event is dispatched when a currently playing animation repeats. - * - * The event is dispatched directly from the Animation object itself. Which means that listeners - * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. - * - * @event Phaser.Animations.Events#ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that repeated. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation was on when it repeated. - */ -module.exports = 'repeat'; - - -/***/ }), -/* 293 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Restart Event. - * - * This event is dispatched by an Animation instance when it restarts. - * - * Be careful with the volume of events this could generate. If a group of Sprites all restart the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that restarted playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'restart'; - - -/***/ }), -/* 294 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Animation Start Event. - * - * This event is dispatched by an Animation instance when it starts playing. - * - * Be careful with the volume of events this could generate. If a group of Sprites all play the same - * animation at the same time, this event will invoke its handler for each one of them. - * - * @event Phaser.Animations.Events#ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that started playing. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'start'; - - -/***/ }), -/* 295 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Pause All Animations Event. - * - * This event is dispatched when the global Animation Manager is told to pause. - * - * When this happens all current animations will stop updating, although it doesn't necessarily mean - * that the game has paused as well. - * - * @event Phaser.Animations.Events#PAUSE_ALL - * @since 3.0.0 - */ -module.exports = 'pauseall'; - - -/***/ }), -/* 296 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Remove Animation Event. - * - * This event is dispatched when an animation is removed from the global Animation Manager. - * - * @event Phaser.Animations.Events#REMOVE_ANIMATION - * @since 3.0.0 - * - * @param {string} key - The key of the Animation that was removed from the global Animation Manager. - * @param {Phaser.Animations.Animation} animation - An instance of the removed Animation. - */ -module.exports = 'remove'; - - -/***/ }), -/* 297 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Resume All Animations Event. - * - * This event is dispatched when the global Animation Manager resumes, having been previously paused. - * - * When this happens all current animations will continue updating again. - * - * @event Phaser.Animations.Events#RESUME_ALL - * @since 3.0.0 - */ -module.exports = 'resumeall'; - - -/***/ }), -/* 298 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Complete Event. - * - * This event is dispatched by a Sprite when an animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete'; - - -/***/ }), -/* 299 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Complete Event. - * - * This event is dispatched by a Sprite when a specific animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_COMPLETE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that completed. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation completed on. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation completed. - */ -module.exports = 'animationcomplete-'; - - -/***/ }), -/* 300 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Repeat Event. - * - * This event is dispatched by a Sprite when a specific animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat-'; - - -/***/ }), -/* 301 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Restart Event. - * - * This event is dispatched by a Sprite when a specific animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart-'; - - -/***/ }), -/* 302 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Start Event. - * - * This event is dispatched by a Sprite when a specific animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart-'; - - -/***/ }), -/* 303 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Key Update Event. - * - * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_KEY_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate-'; - - -/***/ }), -/* 304 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Repeat Event. - * - * This event is dispatched by a Sprite when an animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_REPEAT - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that is repeating on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {integer} repeatCount - The number of times the Animation has repeated so far. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation repeated playing. - */ -module.exports = 'animationrepeat'; - - -/***/ }), -/* 305 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Restart Event. - * - * This event is dispatched by a Sprite when an animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_RESTART - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was restarted on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation restarted with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation restarted playing. - */ -module.exports = 'animationrestart'; - - -/***/ }), -/* 306 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Start Event. - * - * This event is dispatched by a Sprite when an animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_START - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that was started on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame that the Animation started with. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation started playing. - */ -module.exports = 'animationstart'; - - -/***/ }), -/* 307 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * The Sprite Animation Update Event. - * - * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. - * - * @event Phaser.Animations.Events#SPRITE_ANIMATION_UPDATE - * @since 3.16.1 - * - * @param {Phaser.Animations.Animation} animation - A reference to the Animation that has updated on the Sprite. - * @param {Phaser.Animations.AnimationFrame} frame - The current Animation Frame of the Animation. - * @param {Phaser.GameObjects.Sprite} gameObject - A reference to the Game Object on which the animation updated. - */ -module.exports = 'animationupdate'; - - -/***/ }), -/* 308 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -40964,181 +39871,7 @@ module.exports = 'animationupdate'; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = __webpack_require__(0); - -/** - * @classdesc - * A single frame in an Animation sequence. - * - * An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other - * frames in the animation, and index data. It also has the ability to modify the animation timing. - * - * AnimationFrames are generated automatically by the Animation class. - * - * @class AnimationFrame - * @memberof Phaser.Animations - * @constructor - * @since 3.0.0 - * - * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. - * @param {integer} index - The index of this AnimationFrame within the Animation sequence. - * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. - */ -var AnimationFrame = new Class({ - - initialize: - - function AnimationFrame (textureKey, textureFrame, index, frame) - { - /** - * The key of the Texture this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureKey - * @type {string} - * @since 3.0.0 - */ - this.textureKey = textureKey; - - /** - * The key of the Frame within the Texture that this AnimationFrame uses. - * - * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {(string|integer)} - * @since 3.0.0 - */ - this.textureFrame = textureFrame; - - /** - * The index of this AnimationFrame within the Animation sequence. - * - * @name Phaser.Animations.AnimationFrame#index - * @type {integer} - * @since 3.0.0 - */ - this.index = index; - - /** - * A reference to the Texture Frame this AnimationFrame uses for rendering. - * - * @name Phaser.Animations.AnimationFrame#frame - * @type {Phaser.Textures.Frame} - * @since 3.0.0 - */ - this.frame = frame; - - /** - * Is this the first frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isFirst - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isFirst = false; - - /** - * Is this the last frame in an animation sequence? - * - * @name Phaser.Animations.AnimationFrame#isLast - * @type {boolean} - * @default false - * @readonly - * @since 3.0.0 - */ - this.isLast = false; - - /** - * A reference to the AnimationFrame that comes before this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#prevFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.prevFrame = null; - - /** - * A reference to the AnimationFrame that comes after this one in the animation, if any. - * - * @name Phaser.Animations.AnimationFrame#nextFrame - * @type {?Phaser.Animations.AnimationFrame} - * @default null - * @readonly - * @since 3.0.0 - */ - this.nextFrame = null; - - /** - * Additional time (in ms) that this frame should appear for during playback. - * The value is added onto the msPerFrame set by the animation. - * - * @name Phaser.Animations.AnimationFrame#duration - * @type {number} - * @default 0 - * @since 3.0.0 - */ - this.duration = 0; - - /** - * What % through the animation does this frame come? - * This value is generated when the animation is created and cached here. - * - * @name Phaser.Animations.AnimationFrame#progress - * @type {number} - * @default 0 - * @readonly - * @since 3.0.0 - */ - this.progress = 0; - }, - - /** - * Generates a JavaScript object suitable for converting to JSON. - * - * @method Phaser.Animations.AnimationFrame#toJSON - * @since 3.0.0 - * - * @return {Phaser.Types.Animations.JSONAnimationFrame} The AnimationFrame data. - */ - toJSON: function () - { - return { - key: this.textureKey, - frame: this.textureFrame, - duration: this.duration - }; - }, - - /** - * Destroys this object by removing references to external resources and callbacks. - * - * @method Phaser.Animations.AnimationFrame#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.frame = undefined; - } - -}); - -module.exports = AnimationFrame; - - -/***/ }), -/* 309 */ -/***/ (function(module, exports, __webpack_require__) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var BlendModes = __webpack_require__(16); +var BlendModes = __webpack_require__(15); /** * Provides methods used for setting the blend mode of a Game Object. @@ -41251,7 +39984,7 @@ module.exports = BlendMode; /***/ }), -/* 310 */ +/* 293 */ /***/ (function(module, exports) { /** @@ -41376,7 +40109,7 @@ module.exports = Crop; /***/ }), -/* 311 */ +/* 294 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41385,9 +40118,9 @@ module.exports = Crop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(24); -var RotateAround = __webpack_require__(38); -var Vector2 = __webpack_require__(1); +var Rectangle = __webpack_require__(25); +var RotateAround = __webpack_require__(39); +var Vector2 = __webpack_require__(2); /** * Provides methods used for obtaining the bounds of a Game Object. @@ -41735,7 +40468,7 @@ module.exports = GetBounds; /***/ }), -/* 312 */ +/* 295 */ /***/ (function(module, exports) { /** @@ -41770,7 +40503,7 @@ module.exports = Contains; /***/ }), -/* 313 */ +/* 296 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41779,8 +40512,8 @@ module.exports = Contains; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetPoint = __webpack_require__(60); -var Perimeter = __webpack_require__(61); +var GetPoint = __webpack_require__(59); +var Perimeter = __webpack_require__(60); // Return an array of points from the perimeter of the rectangle // each spaced out based on the quantity or step required @@ -41824,7 +40557,7 @@ module.exports = GetPoints; /***/ }), -/* 314 */ +/* 297 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -41834,11 +40567,11 @@ module.exports = GetPoints; */ var Class = __webpack_require__(0); -var GetPoint = __webpack_require__(315); -var GetPoints = __webpack_require__(316); -var GEOM_CONST = __webpack_require__(25); -var Random = __webpack_require__(318); -var Vector2 = __webpack_require__(1); +var GetPoint = __webpack_require__(298); +var GetPoints = __webpack_require__(299); +var GEOM_CONST = __webpack_require__(26); +var Random = __webpack_require__(301); +var Vector2 = __webpack_require__(2); /** * @classdesc @@ -42161,7 +40894,7 @@ module.exports = Line; /***/ }), -/* 315 */ +/* 298 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42170,7 +40903,7 @@ module.exports = Line; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(10); +var Point = __webpack_require__(9); /** * Get a point on a line that's a given percentage along its length. @@ -42200,7 +40933,7 @@ module.exports = GetPoint; /***/ }), -/* 316 */ +/* 299 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42209,8 +40942,8 @@ module.exports = GetPoint; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Length = __webpack_require__(317); -var Point = __webpack_require__(10); +var Length = __webpack_require__(300); +var Point = __webpack_require__(9); /** * Get a number of points along a line's length. @@ -42265,7 +40998,7 @@ module.exports = GetPoints; /***/ }), -/* 317 */ +/* 300 */ /***/ (function(module, exports) { /** @@ -42293,7 +41026,7 @@ module.exports = Length; /***/ }), -/* 318 */ +/* 301 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42302,7 +41035,7 @@ module.exports = Length; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(10); +var Point = __webpack_require__(9); /** * Returns a random point on a given Line. @@ -42333,7 +41066,7 @@ module.exports = Random; /***/ }), -/* 319 */ +/* 302 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42342,7 +41075,7 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Point = __webpack_require__(10); +var Point = __webpack_require__(9); /** * Returns a random point within a Rectangle. @@ -42371,7 +41104,7 @@ module.exports = Random; /***/ }), -/* 320 */ +/* 303 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42380,8 +41113,8 @@ module.exports = Random; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BitmapMask = __webpack_require__(321); -var GeometryMask = __webpack_require__(339); +var BitmapMask = __webpack_require__(304); +var GeometryMask = __webpack_require__(322); /** * Provides methods used for getting and setting the mask of a Game Object. @@ -42408,10 +41141,10 @@ var Mask = { * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. * * If a mask is already set on this Game Object it will be immediately replaced. - * + * * Masks are positioned in global space and are not relative to the Game Object to which they * are applied. The reason for this is that multiple Game Objects can all share the same mask. - * + * * Masks have no impact on physics or input detection. They are purely a rendering component * that allows you to limit what is visible during the render pass. * @@ -42457,6 +41190,8 @@ var Mask = { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -42467,7 +41202,7 @@ var Mask = { * * @method Phaser.GameObjects.Components.Mask#createBitmapMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.GameObject} [renderable] - A renderable Game Object that uses a texture, such as a Sprite. * * @return {Phaser.Display.Masks.BitmapMask} This Bitmap Mask that was created. @@ -42491,12 +41226,12 @@ var Mask = { * * If you do not provide a graphics object, and this Game Object is an instance * of a Graphics object, then it will use itself to create the mask. - * + * * This means you can call this method to create a Geometry Mask from any Graphics Game Object. * * @method Phaser.GameObjects.Components.Mask#createGeometryMask * @since 3.6.2 - * + * * @param {Phaser.GameObjects.Graphics} [graphics] - A Graphics Game Object. The geometry within it will be used as the mask. * * @return {Phaser.Display.Masks.GeometryMask} This Geometry Mask that was created. @@ -42518,7 +41253,7 @@ module.exports = Mask; /***/ }), -/* 321 */ +/* 304 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42528,7 +41263,7 @@ module.exports = Mask; */ var Class = __webpack_require__(0); -var GameEvents = __webpack_require__(322); +var GameEvents = __webpack_require__(305); /** * @classdesc @@ -42547,6 +41282,9 @@ var GameEvents = __webpack_require__(322); * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -42669,36 +41407,73 @@ var BitmapMask = new Class({ */ this.isStencil = false; - if (renderer && renderer.gl) + this.createMask(); + + scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + }, + + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + * + * @method Phaser.Display.Masks.BitmapMask#createMask + * @since 3.50.0 + */ + createMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl) { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function (renderer) - { - var width = renderer.width; - var height = renderer.height; - var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); - var gl = renderer.gl; - var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; - var filter = gl.LINEAR; - - this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); - this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); - this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); - - }, this); + return; } + + if (this.mainTexture) + { + this.clearMask(); + } + + var width = renderer.width; + var height = renderer.height; + var pot = ((width & (width - 1)) === 0 && (height & (height - 1)) === 0); + var gl = renderer.gl; + var wrap = pot ? gl.REPEAT : gl.CLAMP_TO_EDGE; + var filter = gl.LINEAR; + + this.mainTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.maskTexture = renderer.createTexture2D(0, filter, filter, wrap, wrap, gl.RGBA, null, width, height); + this.mainFramebuffer = renderer.createFramebuffer(width, height, this.mainTexture, true); + this.maskFramebuffer = renderer.createFramebuffer(width, height, this.maskTexture, true); + }, + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + * + * @method Phaser.Display.Masks.BitmapMask#clearMask + * @since 3.50.0 + */ + clearMask: function () + { + var renderer = this.renderer; + + if (!renderer.gl || !this.mainTexture) + { + return; + } + + renderer.deleteTexture(this.mainTexture); + renderer.deleteTexture(this.maskTexture); + renderer.deleteFramebuffer(this.mainFramebuffer); + renderer.deleteFramebuffer(this.maskFramebuffer); + + this.mainTexture = null; + this.maskTexture = null; + this.mainFramebuffer = null; + this.maskFramebuffer = null; }, /** @@ -42728,7 +41503,7 @@ var BitmapMask = new Class({ */ preRenderWebGL: function (renderer, maskedObject, camera) { - renderer.pipelines.BitmapMaskPipeline.beginMask(this, maskedObject, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.beginMask(this, maskedObject, camera); }, /** @@ -42743,7 +41518,7 @@ var BitmapMask = new Class({ */ postRenderWebGL: function (renderer, camera) { - renderer.pipelines.BitmapMaskPipeline.endMask(this, camera); + renderer.pipelines.BITMAPMASK_PIPELINE.endMask(this, camera); }, /** @@ -42776,7 +41551,7 @@ var BitmapMask = new Class({ /** * Destroys this BitmapMask and nulls any references it holds. - * + * * Note that if a Game Object is currently using this mask it will _not_ automatically detect you have destroyed it, * so be sure to call `clearMask` on any Game Object using it, before destroying it. * @@ -42785,22 +41560,9 @@ var BitmapMask = new Class({ */ destroy: function () { + this.clearMask(); + this.bitmapMask = null; - - var renderer = this.renderer; - - if (renderer && renderer.gl) - { - renderer.deleteTexture(this.mainTexture); - renderer.deleteTexture(this.maskTexture); - renderer.deleteFramebuffer(this.mainFramebuffer); - renderer.deleteFramebuffer(this.maskFramebuffer); - } - - this.mainTexture = null; - this.maskTexture = null; - this.mainFramebuffer = null; - this.maskFramebuffer = null; this.prevFramebuffer = null; this.renderer = null; } @@ -42811,7 +41573,7 @@ module.exports = BitmapMask; /***/ }), -/* 322 */ +/* 305 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -42826,28 +41588,28 @@ module.exports = BitmapMask; module.exports = { - BLUR: __webpack_require__(323), - BOOT: __webpack_require__(324), - CONTEXT_LOST: __webpack_require__(325), - CONTEXT_RESTORED: __webpack_require__(326), - DESTROY: __webpack_require__(327), - FOCUS: __webpack_require__(328), - HIDDEN: __webpack_require__(329), - PAUSE: __webpack_require__(330), - POST_RENDER: __webpack_require__(331), - POST_STEP: __webpack_require__(332), - PRE_RENDER: __webpack_require__(333), - PRE_STEP: __webpack_require__(334), - READY: __webpack_require__(335), - RESUME: __webpack_require__(336), - STEP: __webpack_require__(337), - VISIBLE: __webpack_require__(338) + BLUR: __webpack_require__(306), + BOOT: __webpack_require__(307), + CONTEXT_LOST: __webpack_require__(308), + CONTEXT_RESTORED: __webpack_require__(309), + DESTROY: __webpack_require__(310), + FOCUS: __webpack_require__(311), + HIDDEN: __webpack_require__(312), + PAUSE: __webpack_require__(313), + POST_RENDER: __webpack_require__(314), + POST_STEP: __webpack_require__(315), + PRE_RENDER: __webpack_require__(316), + PRE_STEP: __webpack_require__(317), + READY: __webpack_require__(318), + RESUME: __webpack_require__(319), + STEP: __webpack_require__(320), + VISIBLE: __webpack_require__(321) }; /***/ }), -/* 323 */ +/* 306 */ /***/ (function(module, exports) { /** @@ -42870,7 +41632,7 @@ module.exports = 'blur'; /***/ }), -/* 324 */ +/* 307 */ /***/ (function(module, exports) { /** @@ -42892,7 +41654,7 @@ module.exports = 'boot'; /***/ }), -/* 325 */ +/* 308 */ /***/ (function(module, exports) { /** @@ -42915,7 +41677,7 @@ module.exports = 'contextlost'; /***/ }), -/* 326 */ +/* 309 */ /***/ (function(module, exports) { /** @@ -42938,7 +41700,7 @@ module.exports = 'contextrestored'; /***/ }), -/* 327 */ +/* 310 */ /***/ (function(module, exports) { /** @@ -42961,7 +41723,7 @@ module.exports = 'destroy'; /***/ }), -/* 328 */ +/* 311 */ /***/ (function(module, exports) { /** @@ -42983,7 +41745,7 @@ module.exports = 'focus'; /***/ }), -/* 329 */ +/* 312 */ /***/ (function(module, exports) { /** @@ -43009,7 +41771,7 @@ module.exports = 'hidden'; /***/ }), -/* 330 */ +/* 313 */ /***/ (function(module, exports) { /** @@ -43030,7 +41792,7 @@ module.exports = 'pause'; /***/ }), -/* 331 */ +/* 314 */ /***/ (function(module, exports) { /** @@ -43056,7 +41818,7 @@ module.exports = 'postrender'; /***/ }), -/* 332 */ +/* 315 */ /***/ (function(module, exports) { /** @@ -43081,7 +41843,7 @@ module.exports = 'poststep'; /***/ }), -/* 333 */ +/* 316 */ /***/ (function(module, exports) { /** @@ -43106,7 +41868,7 @@ module.exports = 'prerender'; /***/ }), -/* 334 */ +/* 317 */ /***/ (function(module, exports) { /** @@ -43131,7 +41893,7 @@ module.exports = 'prestep'; /***/ }), -/* 335 */ +/* 318 */ /***/ (function(module, exports) { /** @@ -43153,7 +41915,7 @@ module.exports = 'ready'; /***/ }), -/* 336 */ +/* 319 */ /***/ (function(module, exports) { /** @@ -43174,7 +41936,7 @@ module.exports = 'resume'; /***/ }), -/* 337 */ +/* 320 */ /***/ (function(module, exports) { /** @@ -43199,7 +41961,7 @@ module.exports = 'step'; /***/ }), -/* 338 */ +/* 321 */ /***/ (function(module, exports) { /** @@ -43223,7 +41985,7 @@ module.exports = 'visible'; /***/ }), -/* 339 */ +/* 322 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43313,7 +42075,7 @@ var GeometryMask = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphicsGeometry - The Graphics object which will be used for the Geometry Mask. - * + * * @return {this} This Geometry Mask */ setShape: function (graphicsGeometry) @@ -43331,7 +42093,7 @@ var GeometryMask = new Class({ * @since 3.17.0 * * @param {boolean} [value=true] - Invert the alpha of this mask? - * + * * @return {this} This Geometry Mask */ setInvertAlpha: function (value) @@ -43410,7 +42172,7 @@ var GeometryMask = new Class({ } // Write stencil buffer - geometryMask.renderWebGL(renderer, geometryMask, 0, camera); + geometryMask.renderWebGL(renderer, geometryMask, camera); renderer.flush(); @@ -43454,32 +42216,32 @@ var GeometryMask = new Class({ renderer.maskCount--; + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + if (renderer.maskStack.length === 0) { // If this is the only mask in the stack, flush and disable - renderer.flush(); - - renderer.currentMask.mask = null; + current.mask = null; gl.disable(gl.STENCIL_TEST); } else { - // Force flush before disabling stencil test - renderer.flush(); - var prev = renderer.maskStack[renderer.maskStack.length - 1]; prev.mask.applyStencil(renderer, prev.camera, false); if (renderer.currentCameraMask.mask !== prev.mask) { - renderer.currentMask.mask = prev.mask; - renderer.currentMask.camera = prev.camera; + current.mask = prev.mask; + current.camera = prev.camera; } else { - renderer.currentMask.mask = null; + current.mask = null; } } }, @@ -43500,7 +42262,7 @@ var GeometryMask = new Class({ renderer.currentContext.save(); - geometryMask.renderCanvas(renderer, geometryMask, 0, camera, null, null, true); + geometryMask.renderCanvas(renderer, geometryMask, camera, null, null, true); renderer.currentContext.clip(); }, @@ -43538,7 +42300,7 @@ module.exports = GeometryMask; /***/ }), -/* 340 */ +/* 323 */ /***/ (function(module, exports) { /** @@ -43741,7 +42503,7 @@ module.exports = Origin; /***/ }), -/* 341 */ +/* 324 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -43751,10 +42513,10 @@ module.exports = Origin; */ var DegToRad = __webpack_require__(18); -var GetBoolean = __webpack_require__(342); -var GetValue = __webpack_require__(6); -var TWEEN_CONST = __webpack_require__(343); -var Vector2 = __webpack_require__(1); +var GetBoolean = __webpack_require__(325); +var GetValue = __webpack_require__(7); +var TWEEN_CONST = __webpack_require__(326); +var Vector2 = __webpack_require__(2); /** * Provides methods used for managing a Game Object following a Path. @@ -44168,7 +42930,7 @@ module.exports = PathFollower; /***/ }), -/* 342 */ +/* 325 */ /***/ (function(module, exports) { /** @@ -44209,7 +42971,7 @@ module.exports = GetBoolean; /***/ }), -/* 343 */ +/* 326 */ /***/ (function(module, exports) { /** @@ -44381,8 +43143,8 @@ module.exports = TWEEN_CONST; /***/ }), -/* 344 */ -/***/ (function(module, exports) { +/* 327 */ +/***/ (function(module, exports, __webpack_require__) { /** * @author Richard Davey @@ -44390,6 +43152,8 @@ module.exports = TWEEN_CONST; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var PIPELINE_CONST = __webpack_require__(328); + /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. * @@ -44431,19 +43195,20 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} [pipelineName=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (pipelineName) + initPipeline: function (name) { - if (pipelineName === undefined) { pipelineName = 'MultiPipeline'; } + if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.defaultPipeline = renderer.getPipeline(pipelineName); + this.defaultPipeline = pipelines.get(name); this.pipeline = this.defaultPipeline; return true; @@ -44459,17 +43224,18 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @param {string} pipelineName - The name of the pipeline to set on this Game Object. + * @param {string} name - The name of the pipeline to set on this Game Object. * * @return {this} This Game Object instance. */ - setPipeline: function (pipelineName) + setPipeline: function (name) { var renderer = this.scene.sys.game.renderer; + var pipelines = renderer.pipelines; - if (renderer && renderer.gl && renderer.hasPipeline(pipelineName)) + if (pipelines && pipelines.has(name)) { - this.pipeline = renderer.getPipeline(pipelineName); + this.pipeline = pipelines.get(name); } return this; @@ -44511,7 +43277,74 @@ module.exports = Pipeline; /***/ }), -/* 345 */ +/* 328 */ +/***/ (function(module, exports) { + +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var PIPELINE_CONST = { + + /** + * The Bitmap Mask Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.BITMAPMASK_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + BITMAPMASK_PIPELINE: 'BitmapMaskPipeline', + + /** + * The Light 2D Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.LIGHT_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + LIGHT_PIPELINE: 'Light2D', + + /** + * The Single Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.SINGLE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + SINGLE_PIPELINE: 'SinglePipeline', + + /** + * The Multi Texture Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.MULTI_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + MULTI_PIPELINE: 'MultiPipeline', + + /** + * The Rope Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.ROPE_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + ROPE_PIPELINE: 'RopePipeline' + +}; + +module.exports = PIPELINE_CONST; + + +/***/ }), +/* 329 */ /***/ (function(module, exports) { /** @@ -44698,7 +43531,7 @@ module.exports = Size; /***/ }), -/* 346 */ +/* 330 */ /***/ (function(module, exports) { /** @@ -44828,7 +43661,7 @@ module.exports = Texture; /***/ }), -/* 347 */ +/* 331 */ /***/ (function(module, exports) { /** @@ -45036,8 +43869,8 @@ module.exports = TextureCrop; /***/ }), -/* 348 */ -/***/ (function(module, exports, __webpack_require__) { +/* 332 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -45045,8 +43878,6 @@ module.exports = TextureCrop; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var GetColorFromValue = __webpack_require__(349); - /** * Provides methods used for setting the tint of a Game Object. * Should be applied as a mixin and not used directly. @@ -45059,62 +43890,58 @@ var GetColorFromValue = __webpack_require__(349); var Tint = { /** - * Private internal value. Holds the top-left tint value. + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTL + * @name Phaser.GameObjects.Components.Tint#tintTopLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTL: 16777215, + tintTopLeft: 0xffffff, /** - * Private internal value. Holds the top-right tint value. + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintTR + * @name Phaser.GameObjects.Components.Tint#tintTopRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintTR: 16777215, + tintTopRight: 0xffffff, /** - * Private internal value. Holds the bottom-left tint value. + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBL + * @name Phaser.GameObjects.Components.Tint#tintBottomLeft * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBL: 16777215, + tintBottomLeft: 0xffffff, /** - * Private internal value. Holds the bottom-right tint value. + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. * - * @name Phaser.GameObjects.Components.Tint#_tintBR + * @name Phaser.GameObjects.Components.Tint#tintBottomRight * @type {number} - * @private - * @default 16777215 + * @default 0xffffff * @since 3.0.0 */ - _tintBR: 16777215, + tintBottomRight: 0xffffff, /** - * Private internal value. Holds if the Game Object is tinted or not. + * The tint fill mode. * - * @name Phaser.GameObjects.Components.Tint#_isTinted - * @type {boolean} - * @private - * @default false - * @since 3.11.0 - */ - _isTinted: false, - - /** - * Fill or additive? + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. * * @name Phaser.GameObjects.Components.Tint#tintFill * @type {boolean} @@ -45139,8 +43966,6 @@ var Tint = { { this.setTint(0xffffff); - this._isTinted = false; - return this; }, @@ -45182,12 +44007,10 @@ var Tint = { bottomRight = topLeft; } - this._tintTL = GetColorFromValue(topLeft); - this._tintTR = GetColorFromValue(topRight); - this._tintBL = GetColorFromValue(bottomLeft); - this._tintBR = GetColorFromValue(bottomRight); - - this._isTinted = true; + this.tintTopLeft = topLeft; + this.tintTopRight = topRight; + this.tintBottomLeft = bottomLeft; + this.tintBottomRight = bottomRight; this.tintFill = false; @@ -45231,102 +44054,6 @@ var Tint = { return this; }, - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopLeft: { - - get: function () - { - return this._tintTL; - }, - - set: function (value) - { - this._tintTL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintTopRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintTopRight: { - - get: function () - { - return this._tintTR; - }, - - set: function (value) - { - this._tintTR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomLeft - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomLeft: { - - get: function () - { - return this._tintBL; - }, - - set: function (value) - { - this._tintBL = GetColorFromValue(value); - this._isTinted = true; - } - - }, - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - * - * @name Phaser.GameObjects.Components.Tint#tintBottomRight - * @type {integer} - * @webglOnly - * @since 3.0.0 - */ - tintBottomRight: { - - get: function () - { - return this._tintBR; - }, - - set: function (value) - { - this._tintBR = GetColorFromValue(value); - this._isTinted = true; - } - - }, - /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. @@ -45345,7 +44072,10 @@ var Tint = { }, /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. * * @name Phaser.GameObjects.Components.Tint#isTinted * @type {boolean} @@ -45357,7 +44087,15 @@ var Tint = { get: function () { - return this._isTinted; + var white = 0xffffff; + + return ( + this.tintFill || + this.tintTopLeft !== white || + this.tintTopRight !== white || + this.tintBottomLeft !== white || + this.tintBottomRight !== white + ); } } @@ -45368,36 +44106,7 @@ module.exports = Tint; /***/ }), -/* 349 */ -/***/ (function(module, exports) { - -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Given a hex color value, such as 0xff00ff (for purple), it will return a - * numeric representation of it (i.e. 16711935) for use in WebGL tinting. - * - * @function Phaser.Display.Color.GetColorFromValue - * @since 3.50.0 - * - * @param {number} red - The hex color value, such as 0xff0000. - * - * @return {number} The combined color value. - */ -var GetColorFromValue = function (value) -{ - return (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16); -}; - -module.exports = GetColorFromValue; - - -/***/ }), -/* 350 */ +/* 333 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45407,12 +44116,12 @@ module.exports = GetColorFromValue; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(4); -var renderCanvas = __webpack_require__(4); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(351); + renderWebGL = __webpack_require__(334); } if (false) @@ -45427,7 +44136,7 @@ module.exports = { /***/ }), -/* 351 */ +/* 334 */ /***/ (function(module, exports) { /** @@ -45448,11 +44157,10 @@ module.exports = { * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var ContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; @@ -45462,7 +44170,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent } var transformMatrix = container.localTransform; - + if (parentMatrix) { transformMatrix.loadIdentity(); @@ -45555,7 +44263,7 @@ var ContainerWebGLRenderer = function (renderer, container, interpolationPercent child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); // Render - child.renderWebGL(renderer, child, interpolationPercentage, camera, transformMatrix); + child.renderWebGL(renderer, child, camera, transformMatrix); // Restore original values @@ -45576,7 +44284,7 @@ module.exports = ContainerWebGLRenderer; /***/ }), -/* 352 */ +/* 335 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45585,7 +44293,7 @@ module.exports = ContainerWebGLRenderer; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Rectangle = __webpack_require__(24); +var Rectangle = __webpack_require__(25); /** * Creates a new Rectangle or repositions and/or resizes an existing Rectangle so that it encompasses the two given Rectangles, i.e. calculates their union. @@ -45618,7 +44326,7 @@ module.exports = Union; /***/ }), -/* 353 */ +/* 336 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -45627,12 +44335,12 @@ module.exports = Union; * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = __webpack_require__(4); -var renderCanvas = __webpack_require__(4); +var renderWebGL = __webpack_require__(1); +var renderCanvas = __webpack_require__(1); if (true) { - renderWebGL = __webpack_require__(354); + renderWebGL = __webpack_require__(337); } if (false) @@ -45647,8 +44355,8 @@ module.exports = { /***/ }), -/* 354 */ -/***/ (function(module, exports, __webpack_require__) { +/* 337 */ +/***/ (function(module, exports) { /** * @author Richard Davey @@ -45656,11 +44364,6 @@ module.exports = { * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CounterClockwise = __webpack_require__(11); -var Clamp = __webpack_require__(3); -var RadToDeg = __webpack_require__(12); -var Wrap = __webpack_require__(8); - /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -45672,11 +44375,10 @@ var Wrap = __webpack_require__(8); * * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. * @param {Phaser.GameObjects.Container} container - The Game Object being rendered in this call. - * @param {number} interpolationPercentage - Reserved for future use and custom pipelines. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var SpineContainerWebGLRenderer = function (renderer, container, interpolationPercentage, camera, parentMatrix) +var SpineContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var plugin = container.plugin; var sceneRenderer = plugin.sceneRenderer; @@ -45687,6 +44389,8 @@ var SpineContainerWebGLRenderer = function (renderer, container, interpolationPe if (sceneRenderer.batcher.isDrawing && renderer.finalType) { sceneRenderer.end(); + + renderer.pipelines.rebind(); } return; @@ -45707,110 +44411,67 @@ var SpineContainerWebGLRenderer = function (renderer, container, interpolationPe transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } - var alpha = container.alpha; - var scrollFactorX = container.scrollFactorX; - var scrollFactorY = container.scrollFactorY; - - var GameObjectRenderMask = 15; - if (renderer.newType) { + // flush + clear if this is a new type + renderer.pipelines.clear(); + sceneRenderer.begin(); } + var rendererNextType = renderer.nextTypeMatch; + + // Force these to avoid batch flushing during SpineGameObject.renderWebGL + renderer.nextTypeMatch = true; + renderer.newType = false; + for (var i = 0; i < children.length; i++) { - var src = children[i]; + var child = children[i]; - var skeleton = src.skeleton; - var childAlpha = skeleton.color.a; - - var willRender = !(GameObjectRenderMask !== src.renderFlags || (src.cameraFilter !== 0 && (src.cameraFilter & camera.id)) || childAlpha === 0); - - if (!skeleton || !willRender) + if (child.willRender(camera)) { - continue; - } + var mask = child.mask; - var camMatrix = renderer._tempMatrix1; - var spriteMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; - - spriteMatrix.applyITRS(src.x, src.y, src.rotation, Math.abs(src.scaleX), Math.abs(src.scaleY)); - - camMatrix.copyFrom(camera.matrix); - - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(transformMatrix, -camera.scrollX * scrollFactorX, -camera.scrollY * scrollFactorY); - - // Undo the camera scroll - spriteMatrix.e = src.x; - spriteMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); - - var viewportHeight = renderer.height; - - skeleton.x = calcMatrix.tx; - skeleton.y = viewportHeight - calcMatrix.ty; - - skeleton.scaleX = calcMatrix.scaleX; - skeleton.scaleY = calcMatrix.scaleY; - - if (src.scaleX < 0) - { - skeleton.scaleX *= -1; - - src.root.rotation = RadToDeg(calcMatrix.rotationNormalized); - } - else - { - // +90 degrees to account for the difference in Spine vs. Phaser rotation - src.root.rotation = Wrap(RadToDeg(CounterClockwise(calcMatrix.rotationNormalized)) + 90, 0, 360); - } - - if (src.scaleY < 0) - { - skeleton.scaleY *= -1; - - if (src.scaleX < 0) + if (mask) { - src.root.rotation -= (RadToDeg(calcMatrix.rotationNormalized) * 2); + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.preRenderWebGL(renderer, child, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); } - else + + child.renderWebGL(renderer, child, camera, transformMatrix, container); + + if (mask) { - src.root.rotation += (RadToDeg(calcMatrix.rotationNormalized) * 2); + sceneRenderer.end(); + + renderer.pipelines.rebind(); + + mask.postRenderWebGL(renderer, camera); + + renderer.pipelines.clear(); + + sceneRenderer.begin(); } } - - if (camera.renderToTexture || renderer.currentFramebuffer !== null) - { - skeleton.y = calcMatrix.ty; - skeleton.scaleY *= -1; - } - - // Add autoUpdate option - skeleton.updateWorldTransform(); - - skeleton.color.a = Clamp(childAlpha * alpha, 0, 1); - - // Draw the current skeleton - sceneRenderer.drawSkeleton(skeleton, src.preMultipliedAlpha); - - // Restore alpha - skeleton.color.a = childAlpha; } - if (!renderer.nextTypeMatch) + renderer.nextTypeMatch = rendererNextType; + + if (!rendererNextType) { - // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch. + // The next object in the display list is not a Spine Game Object or Spine Container, so we end the batch sceneRenderer.end(); - if (!renderer.finalType) - { - renderer.rebindPipeline(renderer.pipelines.MultiPipeline); - } + // And rebind the previous pipeline + renderer.pipelines.rebind(); } }; diff --git a/plugins/spine/dist/SpineWebGLPlugin.min.js b/plugins/spine/dist/SpineWebGLPlugin.min.js index 7c6780e5a..eef5ec91d 100644 --- a/plugins/spine/dist/SpineWebGLPlugin.min.js +++ b/plugins/spine/dist/SpineWebGLPlugin.min.js @@ -1 +1 @@ -window.SpinePlugin=function(i){var n={};function r(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=i,r.c=n,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=62)}([function(t,e){function s(t,e,i,n){for(var r in e)if(e.hasOwnProperty(r)){var s=(l=e,u=r,d=f=void 0,d=(c=i)?l[u]:Object.getOwnPropertyDescriptor(l,u),!c&&d.value&&"object"==typeof d.value&&(d=d.value),!(!d||!((f=d).get&&"function"==typeof f.get||f.set&&"function"==typeof f.set))&&(void 0===d.enumerable&&(d.enumerable=!0),void 0===d.configurable&&(d.configurable=!0),d));if(!1!==s){if(a=(n||t).prototype,o=r,h=void 0,(h=Object.getOwnPropertyDescriptor(a,o))&&(h.value&&"object"==typeof h.value&&(h=h.value),!1===h.configurable)){if(p.ignoreFinals)continue;throw new Error("cannot override final property '"+r+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,r,s)}else t.prototype[r]=e[r]}var a,o,h,l,u,c,f,d}function a(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;iMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(2);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){var n=i(23),r=i(56);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i=t.length)){for(var i=t.length-1,n=t[e],r=e;r=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e,i){var u=i(7),c=function(){var t,e,i,n,r,s,a=arguments[0]||{},o=1,h=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[1]||{},o=2),h===o&&(a=this,--o);os[0]&&(e=1),s[8]>s[3*e+e]&&(e=2),i=o[e],n=o[i],r=Math.sqrt(s[3*e+e]-s[3*i+i]-s[3*n+n]+1),h[e]=.5*r,r=.5/r,h[i]=(s[3*i+e]+s[3*e+i])*r,h[n]=(s[3*n+e]+s[3*e+n])*r,this.x=h[0],this.y=h[1],this.z=h[2],this.w=(s[3*n+i]-s[3*i+n])*r),this}});t.exports=f},function(t,e,i){var r=i(26),s=i(45);t.exports=function(t,e){var i=void 0===t?s():r({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=i(2),r=i(51),h=i(40),s=i(29),a=i(30),l=i(1),o={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i=i||new l;var r=(n=n||this.scene.sys.cameras.main).scrollX,s=n.scrollY,a=t+r*this.scrollFactorX-r,o=e+s*this.scrollFactorY-s;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,o,i):h(a,o,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=o},function(t,e,i){var n=i(0),s=i(2),c=i(1),r=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3];return e||i?0e.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},function(t,e){t.exports=function(t){for(var e=t.length-1;0=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}function fe(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i= 0.");if(null==e)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}function Ae(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new V.Vector2,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var i=0;i>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},r.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},r);function r(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n 0: "+t);this.curves=Y.Utils.newFloatArray((t-1)*M.BEZIER_SIZE)}Y.CurveTimeline=s;var a,o=(ae(v,a=s),v.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},v.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+v.ROTATION]=i},v.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-v.ENTRIES]){var u=o[o.length+v.PREV_ROTATION];switch(s){case X.setup:h.rotation=h.data.rotation+u*r;break;case X.first:case X.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case X.add:h.rotation+=u*r}}else{var c=z.binarySearch(o,i,v.ENTRIES),f=o[c+v.PREV_ROTATION],d=o[c],p=this.getCurvePercent((c>>1)-1,1-(i-d)/(o[c+v.PREV_TIME]-d)),m=f+((m=o[c+v.ROTATION]-f)-360*(16384-(16384.499999999996-m/360|0)))*p;switch(s){case X.setup:h.rotation=h.data.rotation+(m-360*(16384-(16384.499999999996-m/360|0)))*r;break;case X.first:case X.replace:m+=h.data.rotation-h.rotation;case X.add:h.rotation+=(m-360*(16384-(16384.499999999996-m/360|0)))*r}}},v.ENTRIES=2,v.PREV_TIME=-2,v.PREV_ROTATION=-1,v.ROTATION=1,v);function v(t){var e=a.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t<<1),e}Y.RotateTimeline=o;var h,l=(ae(p,h=s),p.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},p.prototype.setFrame=function(t,e,i,n){t*=p.ENTRIES,this.frames[t]=e,this.frames[t+p.X]=i,this.frames[t+p.Y]=n},p.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-p.ENTRIES]?(f=o[o.length+p.PREV_X],d=o[o.length+p.PREV_Y]):(f=o[(l=z.binarySearch(o,i,p.ENTRIES))+p.PREV_X],d=o[l+p.PREV_Y],u=o[l],c=this.getCurvePercent(l/p.ENTRIES-1,1-(i-u)/(o[l+p.PREV_TIME]-u)),f+=(o[l+p.X]-f)*c,d+=(o[l+p.Y]-d)*c),s){case X.setup:h.x=h.data.x+f*r,h.y=h.data.y+d*r;break;case X.first:case X.replace:h.x+=(h.data.x+f-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case X.add:h.x+=f*r,h.y+=d*r}}},p.ENTRIES=3,p.PREV_TIME=-3,p.PREV_X=-2,p.PREV_Y=-1,p.X=1,p.Y=2,p);function p(t){var e=h.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t*p.ENTRIES),e}Y.TranslateTimeline=l;var u,c=(ae(x,u=l),x.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},x.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-x.ENTRIES]?(f=o[o.length+x.PREV_X]*h.data.scaleX,o[o.length+x.PREV_Y]*h.data.scaleY):(f=o[(l=z.binarySearch(o,i,x.ENTRIES))+x.PREV_X],d=o[l+x.PREV_Y],u=o[l],c=this.getCurvePercent(l/x.ENTRIES-1,1-(i-u)/(o[l+x.PREV_TIME]-u)),f=(f+(o[l+x.X]-f)*c)*h.data.scaleX,(d+(o[l+x.Y]-d)*c)*h.data.scaleY),1==r)s==X.add?(h.scaleX+=f-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=f,h.scaleY=d);else{var p=0,m=0;if(a==g.mixOut)switch(s){case X.setup:p=h.data.scaleX,m=h.data.scaleY,h.scaleX=p+(Math.abs(f)*Y.MathUtils.signum(p)-p)*r,h.scaleY=m+(Math.abs(d)*Y.MathUtils.signum(m)-m)*r;break;case X.first:case X.replace:p=h.scaleX,m=h.scaleY,h.scaleX=p+(Math.abs(f)*Y.MathUtils.signum(p)-p)*r,h.scaleY=m+(Math.abs(d)*Y.MathUtils.signum(m)-m)*r;break;case X.add:p=h.scaleX,m=h.scaleY,h.scaleX=p+(Math.abs(f)*Y.MathUtils.signum(p)-h.data.scaleX)*r,h.scaleY=m+(Math.abs(d)*Y.MathUtils.signum(m)-h.data.scaleY)*r}else switch(s){case X.setup:p=Math.abs(h.data.scaleX)*Y.MathUtils.signum(f),m=Math.abs(h.data.scaleY)*Y.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=m+(d-m)*r;break;case X.first:case X.replace:p=Math.abs(h.scaleX)*Y.MathUtils.signum(f),m=Math.abs(h.scaleY)*Y.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=m+(d-m)*r;break;case X.add:p=Y.MathUtils.signum(f),m=Y.MathUtils.signum(d),h.scaleX=Math.abs(h.scaleX)*p+(f-Math.abs(h.data.scaleX)*p)*r,h.scaleY=Math.abs(h.scaleY)*m+(d-Math.abs(h.data.scaleY)*m)*r}}}},x);function x(t){return u.call(this,t)||this}Y.ScaleTimeline=c;var f,d=(ae(m,f=l),m.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},m.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=o[o.length-m.ENTRIES]?(f=o[o.length+m.PREV_X],d=o[o.length+m.PREV_Y]):(f=o[(l=z.binarySearch(o,i,m.ENTRIES))+m.PREV_X],d=o[l+m.PREV_Y],u=o[l],c=this.getCurvePercent(l/m.ENTRIES-1,1-(i-u)/(o[l+m.PREV_TIME]-u)),f+=(o[l+m.X]-f)*c,d+=(o[l+m.Y]-d)*c),s){case X.setup:h.shearX=h.data.shearX+f*r,h.shearY=h.data.shearY+d*r;break;case X.first:case X.replace:h.shearX+=(h.data.shearX+f-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case X.add:h.shearX+=f*r,h.shearY+=d*r}}},m);function m(t){return f.call(this,t)||this}Y.ShearTimeline=d;var y,w=(ae(T,y=s),T.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},T.prototype.setFrame=function(t,e,i,n,r,s){t*=T.ENTRIES,this.frames[t]=e,this.frames[t+T.R]=i,this.frames[t+T.G]=n,this.frames[t+T.B]=r,this.frames[t+T.A]=s},T.prototype.apply=function(t,e,i,n,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(i=h[h.length-T.ENTRIES]?(m=h[(c=h.length)+T.PREV_R],g=h[c+T.PREV_G],v=h[c+T.PREV_B],M=h[c+T.PREV_A]):(m=h[(f=z.binarySearch(h,i,T.ENTRIES))+T.PREV_R],g=h[f+T.PREV_G],v=h[f+T.PREV_B],M=h[f+T.PREV_A],d=h[f],p=this.getCurvePercent(f/T.ENTRIES-1,1-(i-d)/(h[f+T.PREV_TIME]-d)),m+=(h[f+T.R]-m)*p,g+=(h[f+T.G]-g)*p,v+=(h[f+T.B]-v)*p,M+=(h[f+T.A]-M)*p),1==r?o.color.set(m,g,v,M):(l=o.color,s==X.setup&&l.setFromColor(o.data.color),l.add((m-l.r)*r,(g-l.g)*r,(v-l.b)*r,(M-l.a)*r))}}},T.ENTRIES=5,T.PREV_TIME=-5,T.PREV_R=-4,T.PREV_G=-3,T.PREV_B=-2,T.PREV_A=-1,T.R=1,T.G=2,T.B=3,T.A=4,T);function T(t){var e=y.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t*T.ENTRIES),e}Y.ColorTimeline=w;var E,A=(ae(b,E=s),b.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},b.prototype.setFrame=function(t,e,i,n,r,s,a,o,h){t*=b.ENTRIES,this.frames[t]=e,this.frames[t+b.R]=i,this.frames[t+b.G]=n,this.frames[t+b.B]=r,this.frames[t+b.A]=s,this.frames[t+b.R2]=a,this.frames[t+b.G2]=o,this.frames[t+b.B2]=h},b.prototype.apply=function(t,e,i,n,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=this.frames;if(i=h[h.length-b.ENTRIES]?(v=h[(d=h.length)+b.PREV_R],M=h[d+b.PREV_G],x=h[d+b.PREV_B],y=h[d+b.PREV_A],w=h[d+b.PREV_R2],T=h[d+b.PREV_G2],E=h[d+b.PREV_B2]):(v=h[(p=z.binarySearch(h,i,b.ENTRIES))+b.PREV_R],M=h[p+b.PREV_G],x=h[p+b.PREV_B],y=h[p+b.PREV_A],w=h[p+b.PREV_R2],T=h[p+b.PREV_G2],E=h[p+b.PREV_B2],m=h[p],g=this.getCurvePercent(p/b.ENTRIES-1,1-(i-m)/(h[p+b.PREV_TIME]-m)),v+=(h[p+b.R]-v)*g,M+=(h[p+b.G]-M)*g,x+=(h[p+b.B]-x)*g,y+=(h[p+b.A]-y)*g,w+=(h[p+b.R2]-w)*g,T+=(h[p+b.G2]-T)*g,E+=(h[p+b.B2]-E)*g),1==r?(o.color.set(v,M,x,y),o.darkColor.set(w,T,E,1)):(l=o.color,u=o.darkColor,s==X.setup&&(l.setFromColor(o.data.color),u.setFromColor(o.data.darkColor)),l.add((v-l.r)*r,(M-l.g)*r,(x-l.b)*r,(y-l.a)*r),u.add((w-u.r)*r,(T-u.g)*r,(E-u.b)*r,0))}}},b.ENTRIES=8,b.PREV_TIME=-8,b.PREV_R=-7,b.PREV_G=-6,b.PREV_B=-5,b.PREV_A=-4,b.PREV_R2=-3,b.PREV_G2=-2,b.PREV_B2=-1,b.R=1,b.G=2,b.B=3,b.A=4,b.R2=5,b.G2=6,b.B2=7,b);function b(t){var e=E.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t*b.ENTRIES),e}Y.TwoColorTimeline=A;var R=(S.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},S.prototype.getFrameCount=function(){return this.frames.length},S.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},S.prototype.apply=function(t,e,i,n,r,s,a){var o,h,l,u=t.slots[this.slotIndex];u.bone.active&&(a!=g.mixOut?i<(o=this.frames)[0]?s!=X.setup&&s!=X.first||this.setAttachment(t,u,u.data.attachmentName):(h=0,h=i>=o[o.length-1]?o.length-1:z.binarySearch(o,i,1)-1,l=this.attachmentNames[h],t.slots[this.slotIndex].setAttachment(null==l?null:t.getAttachment(this.slotIndex,l))):s==X.setup&&this.setAttachment(t,u,u.data.attachmentName))},S.prototype.setAttachment=function(t,e,i){e.attachment=null==i?null:t.getAttachment(this.slotIndex,i)},S);function S(t){this.frames=Y.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}Y.AttachmentTimeline=R;var I,C=null,P=(ae(_,I=s),_.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},_.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},_.prototype.apply=function(t,e,i,n,r,s,a){var o=t.slots[this.slotIndex];if(o.bone.active){var h=o.getAttachment();if(h instanceof Y.VertexAttachment&&h.deformAttachment==this.attachment){var l=o.deform;0==l.length&&(s=X.setup);var u=this.frameVertices,c=u[0].length,f=this.frames;if(i=f[f.length-1]){var M=u[f.length-1];if(1==r)if(s==X.add)if(null==(d=h).bones)for(var m=d.vertices,x=0;x=o[h-1])return;if(!(i=o[l];l++)n.push(this.events[l])}}},L);function L(t){this.frames=Y.Utils.newFloatArray(t),this.events=new Array(t)}Y.EventTimeline=F;var O=(k.prototype.getPropertyId=function(){return i.drawOrder<<24},k.prototype.getFrameCount=function(){return this.frames.length},k.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},k.prototype.apply=function(t,e,i,n,r,s,a){var o=t.drawOrder,h=t.slots;if(a!=g.mixOut){var l=this.frames;if(i=l[l.length-1]?l.length-1:z.binarySearch(l,i)-1,c=this.drawOrders[u];if(null==c)Y.Utils.arrayCopy(h,0,o,0,h.length);else for(var f=0,d=c.length;f=f[f.length-V.ENTRIES]?s==X.setup?(d.mix=d.data.mix+(f[f.length+V.PREV_MIX]-d.data.mix)*r,d.softness=d.data.softness+(f[f.length+V.PREV_SOFTNESS]-d.data.softness)*r,a==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[f.length+V.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+V.PREV_COMPRESS],d.stretch=0!=f[f.length+V.PREV_STRETCH])):(d.mix+=(f[f.length+V.PREV_MIX]-d.mix)*r,d.softness+=(f[f.length+V.PREV_SOFTNESS]-d.softness)*r,a==g.mixIn&&(d.bendDirection=f[f.length+V.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+V.PREV_COMPRESS],d.stretch=0!=f[f.length+V.PREV_STRETCH])):(h=f[(o=z.binarySearch(f,i,V.ENTRIES))+V.PREV_MIX],l=f[o+V.PREV_SOFTNESS],u=f[o],c=this.getCurvePercent(o/V.ENTRIES-1,1-(i-u)/(f[o+V.PREV_TIME]-u)),s==X.setup?(d.mix=d.data.mix+(h+(f[o+V.MIX]-h)*c-d.data.mix)*r,d.softness=d.data.softness+(l+(f[o+V.SOFTNESS]-l)*c-d.data.softness)*r,a==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[o+V.PREV_BEND_DIRECTION],d.compress=0!=f[o+V.PREV_COMPRESS],d.stretch=0!=f[o+V.PREV_STRETCH])):(d.mix+=(h+(f[o+V.MIX]-h)*c-d.mix)*r,d.softness+=(l+(f[o+V.SOFTNESS]-l)*c-d.softness)*r,a==g.mixIn&&(d.bendDirection=f[o+V.PREV_BEND_DIRECTION],d.compress=0!=f[o+V.PREV_COMPRESS],d.stretch=0!=f[o+V.PREV_STRETCH])))},V.ENTRIES=6,V.PREV_TIME=-6,V.PREV_MIX=-5,V.PREV_SOFTNESS=-4,V.PREV_BEND_DIRECTION=-3,V.PREV_COMPRESS=-2,V.PREV_STRETCH=-1,V.MIX=1,V.SOFTNESS=2,V.BEND_DIRECTION=3,V.COMPRESS=4,V.STRETCH=5,V);function V(t){var e=N.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t*V.ENTRIES),e}Y.IkConstraintTimeline=D;var B,U=(ae(W,B=s),W.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},W.prototype.setFrame=function(t,e,i,n,r,s){t*=W.ENTRIES,this.frames[t]=e,this.frames[t+W.ROTATE]=i,this.frames[t+W.TRANSLATE]=n,this.frames[t+W.SCALE]=r,this.frames[t+W.SHEAR]=s},W.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(i=o[o.length-W.ENTRIES]?(p=o[(u=o.length)+W.PREV_ROTATE],m=o[u+W.PREV_TRANSLATE],g=o[u+W.PREV_SCALE],v=o[u+W.PREV_SHEAR]):(p=o[(c=z.binarySearch(o,i,W.ENTRIES))+W.PREV_ROTATE],m=o[c+W.PREV_TRANSLATE],g=o[c+W.PREV_SCALE],v=o[c+W.PREV_SHEAR],f=o[c],d=this.getCurvePercent(c/W.ENTRIES-1,1-(i-f)/(o[c+W.PREV_TIME]-f)),p+=(o[c+W.ROTATE]-p)*d,m+=(o[c+W.TRANSLATE]-m)*d,g+=(o[c+W.SCALE]-g)*d,v+=(o[c+W.SHEAR]-v)*d),s==X.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(m-l.translateMix)*r,h.scaleMix=l.scaleMix+(g-l.scaleMix)*r,h.shearMix=l.shearMix+(v-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(m-h.translateMix)*r,h.scaleMix+=(g-h.scaleMix)*r,h.shearMix+=(v-h.shearMix)*r)}},W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4,W);function W(t){var e=B.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t*W.ENTRIES),e}Y.TransformConstraintTimeline=U;var G,H=(ae(q,G=s),q.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},q.prototype.setFrame=function(t,e,i){t*=q.ENTRIES,this.frames[t]=e,this.frames[t+q.VALUE]=i},q.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=o[o.length-q.ENTRIES]?f=o[o.length+q.PREV_VALUE]:(f=o[(l=z.binarySearch(o,i,q.ENTRIES))+q.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/q.ENTRIES-1,1-(i-u)/(o[l+q.PREV_TIME]-u)),f+=(o[l+q.VALUE]-f)*c),s==X.setup?h.position=h.data.position+(f-h.data.position)*r:h.position+=(f-h.position)*r}},q.ENTRIES=2,q.PREV_TIME=-2,q.PREV_VALUE=-1,q.VALUE=1,q);function q(t){var e=G.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t*q.ENTRIES),e}Y.PathConstraintPositionTimeline=H;var j,K=(ae(Q,j=H),Q.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},Q.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=o[o.length-Q.ENTRIES]?f=o[o.length+Q.PREV_VALUE]:(f=o[(l=z.binarySearch(o,i,Q.ENTRIES))+Q.PREV_VALUE],u=o[l],c=this.getCurvePercent(l/Q.ENTRIES-1,1-(i-u)/(o[l+Q.PREV_TIME]-u)),f+=(o[l+Q.VALUE]-f)*c),s==X.setup?h.spacing=h.data.spacing+(f-h.data.spacing)*r:h.spacing+=(f-h.spacing)*r}},Q);function Q(t){return j.call(this,t)||this}Y.PathConstraintSpacingTimeline=K;var Z,J=(ae($,Z=s),$.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},$.prototype.setFrame=function(t,e,i,n){t*=$.ENTRIES,this.frames[t]=e,this.frames[t+$.ROTATE]=i,this.frames[t+$.TRANSLATE]=n},$.prototype.apply=function(t,e,i,n,r,s,a){var o=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=o[o.length-$.ENTRIES]?(f=o[o.length+$.PREV_ROTATE],d=o[o.length+$.PREV_TRANSLATE]):(f=o[(l=z.binarySearch(o,i,$.ENTRIES))+$.PREV_ROTATE],d=o[l+$.PREV_TRANSLATE],u=o[l],c=this.getCurvePercent(l/$.ENTRIES-1,1-(i-u)/(o[l+$.PREV_TIME]-u)),f+=(o[l+$.ROTATE]-f)*c,d+=(o[l+$.TRANSLATE]-d)*c),s==X.setup?(h.rotateMix=h.data.rotateMix+(f-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(f-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}},$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2,$);function $(t){var e=Z.call(this,t)||this;return e.frames=Y.Utils.newFloatArray(t*$.ENTRIES),e}Y.PathConstraintMixTimeline=J}(re=re||{}),function(R){var t=(S.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},S.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,0=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},S.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,i=this.tracks,n=!1,r=0,s=i.length;r=a.trackEnd&&null==a.next&&(h=0);var l=a.animationLast,u=a.getAnimationTime(),c=a.animation.timelines.length,f=a.animation.timelines;if(0==r&&1==h||o==R.MixBlend.add)for(var d=0;d=s[s.length-1]?s.length-1:R.Animation.binarySearch(s,i)-1,this.setAttachment(e,o,t.attachmentNames[a],r)),o.attachmentState<=this.unkeyedState&&(o.attachmentState=this.unkeyedState+S.SETUP))},S.prototype.setAttachment=function(t,e,i,n){e.attachment=null==i?null:t.getAttachment(e.data.index,i),n&&(e.attachmentState=this.unkeyedState+S.CURRENT)},S.prototype.applyRotateTimeline=function(t,e,i,n,r,s,a,o){if(o&&(s[a]=0),1!=n){var h=t,l=h.frames,u=e.bones[h.boneIndex];if(u.active){var c=0,f=0;if(i=l[l.length-R.RotateTimeline.ENTRIES]?f=u.data.rotation+l[l.length+R.RotateTimeline.PREV_ROTATION]:(p=l[(d=R.Animation.binarySearch(l,i,R.RotateTimeline.ENTRIES))+R.RotateTimeline.PREV_ROTATION],m=l[d],g=h.getCurvePercent((d>>1)-1,1-(i-m)/(l[d+R.RotateTimeline.PREV_TIME]-m)),f=l[d+R.RotateTimeline.ROTATION]-p,f=p+(f-=360*(16384-(16384.499999999996-f/360|0)))*g+u.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0)))}var v,M,x,y,w=0,T=f-c;0==(T-=360*(16384-(16384.499999999996-T/360|0)))?w=s[a]:(M=v=0,M=o?(v=0,T):(v=s[a],s[a+1]),x=0n||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:n<=e&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},S.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),((e.mixingFrom=n).mixingTo=e).mixTime=0,null!=n.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},S.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},S.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);0<=e&&this.listeners.splice(e,1)},S.prototype.clearListeners=function(){this.listeners.length=0},S.prototype.clearListenerNotifications=function(){this.queue.clear()},S.emptyAnimation=new R.Animation("",[],0),S.SUBSEQUENT=0,S.FIRST=1,S.HOLD_SUBSEQUENT=2,S.HOLD_FIRST=3,S.HOLD_MIX=4,S.SETUP=1,S.CURRENT=2,S);function S(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new R.IntSet,this.animationsChanged=!1,this.trackEntryPool=new R.Pool(function(){return new e}),this.data=t}R.AnimationState=t;var e=(i.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},i.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},i.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},i.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},i.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},i);function i(){this.mixBlend=R.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}R.TrackEntry=e;var o,n,r=(s.prototype.start=function(t){this.objects.push(o.start),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.interrupt=function(t){this.objects.push(o.interrupt),this.objects.push(t)},s.prototype.end=function(t){this.objects.push(o.end),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.dispose=function(t){this.objects.push(o.dispose),this.objects.push(t)},s.prototype.complete=function(t){this.objects.push(o.complete),this.objects.push(t)},s.prototype.event=function(t,e){this.objects.push(o.event),this.objects.push(t),this.objects.push(e)},s.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;ij.MathUtils.PI?B-=j.MathUtils.PI2:B<-j.MathUtils.PI&&(B+=j.MathUtils.PI2),B*=e,N=Math.cos(B),D=Math.sin(B),R.a=N*F-D*O,R.b=N*L-D*k,R.c=D*F+N*O,R.d=D*L+N*k),R.appliedValid=!1}}}},pe.prototype.computeWorldPositions=function(t,e,i,n,r){var s=this.target,a=this.position,o=this.spaces,h=j.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,f=c/6,d=pe.NONE;if(!t.constantSpeed){var p=t.lengths,m=p[f-=u?1:2];if(n&&(a*=m),r)for(var g=1;g>>1^-(1&i)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,i,n){void 0===e&&(e=new Array),void 0===i&&(i=0),void 0===n&&(n=new DataView(t.buffer)),this.strings=e,this.index=i,this.buffer=n}var V=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(re=re||{}),C=re=re||{},xe.prototype.update=function(t,e){if(null==t)throw new Error("skeleton cannot be null.");var i=this.boundingBoxes,n=this.polygons,r=this.polygonPool,s=t.slots,a=s.length;i.length=0,r.freeAll(n);for(var o=n.length=0;o=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},xe.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||a<=t&&a<=i||o<=e&&o<=n)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(st.minX&&this.minYt.minY},xe.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n>1,V=this.clipOutput,B=K.Utils.setArraySize(l,P+D*d),U=0;U<_;U+=2){var Y=V[U],X=V[U+1];B[P]=Y,B[P+1]=X,B[P+2]=s.r,B[P+3]=s.g,B[P+4]=s.b,B[P+5]=s.a;var z=Y-b,W=X-R,G=(F*z+L*W)*N,H=(k*z+O*W)*N,q=1-G-H;B[P+6]=x*G+E*H+S*q,B[P+7]=y*G+A*H+I*q,o&&(B[P+8]=a.r,B[P+9]=a.g,B[P+10]=a.b,B[P+11]=a.a),P+=d}P=u.length;var j=K.Utils.setArraySize(u,P+3*(D-2));for(D--,U=1;U>1;o=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},e.prototype.addSkin=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},i.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},i.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},i);function i(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var m=function(){};d.TextureAtlasPage=m;var n,g=(n=d.TextureRegion,ae(r,n),r);function r(){return null!==n&&n.apply(this,arguments)||this}d.TextureAtlasRegion=g}(re=re||{}),V=re=re||{},Ae.prototype.isActive=function(){return this.active},Ae.prototype.apply=function(){this.update()},Ae.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},Ae.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0V.MathUtils.PI?A-=V.MathUtils.PI2:A<-V.MathUtils.PI&&(A+=V.MathUtils.PI2),A*=t,v=Math.cos(A),M=Math.sin(A),R.a=v*m-M*g,R.b=v*w-M*T,R.c=M*m+v*g,R.d=M*w+v*T,S=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),R.worldX+=(x.x-R.worldX)*e,R.worldY+=(x.y-R.worldY)*e,S=!0),0V.MathUtils.PI?A-=V.MathUtils.PI2:A<-V.MathUtils.PI&&(A+=V.MathUtils.PI2),A=E+(A+c)*n,b=Math.sqrt(w*w+T*T),R.b=Math.cos(A)*b,R.d=Math.sin(A)*b,S=!0),S&&(R.appliedValid=!1)}},Ae.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,a=r.b,o=r.c,h=r.d,l=0V.MathUtils.PI?y-=V.MathUtils.PI2:y<-V.MathUtils.PI&&(y+=V.MathUtils.PI2),y*=t,v=Math.cos(y),M=Math.sin(y),A.a=v*m-M*g,A.b=v*w-M*T,A.c=M*m+v*g,A.d=M*w+v*T,b=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),A.worldX+=x.x*e,A.worldY+=x.y*e,b=!0),0V.MathUtils.PI?y-=V.MathUtils.PI2:y<-V.MathUtils.PI&&(y+=V.MathUtils.PI2),w=A.b,T=A.d,y=Math.atan2(T,w)+(y-V.MathUtils.PI/2+c)*n,E=Math.sqrt(w*w+T*T),A.b=Math.cos(y)*E,A.d=Math.sin(y)*E,b=!0),b&&(A.appliedValid=!1)}},Ae.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a>1,n=this.indicesArray,r=n.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},r.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},r.WHITE=new r(1,1,1,1),r.RED=new r(1,0,0,1),r.GREEN=new r(0,1,0,1),r.BLUE=new r(0,0,1,1),r.MAGENTA=new r(1,0,1,1),r);function r(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}t.Color=n;var s=(a.clamp=function(t,e,i){return t=e?t:g.setArraySize(t,e,i)},g.newArray=function(t,e){for(var i=new Array(t),n=0;nthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},R.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},R.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;fthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,0this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,a=0;a 0.");null===r&&(r=this.color);var a=2*zt.MathUtils.PI/s,o=Math.cos(a),h=Math.sin(a),l=n,u=0;if(t){for(this.check(Gt.Filled,3*s+3),s--,f=0;f>1))-2],w=f[p-1],m=0,g=p;m>1,f.numFloats=f.numVertices*T,f.numFloats>f.vertices.length&&(f.vertices=this.vertices=Zt.Utils.newFloatArray(f.numFloats)),S.computeWorldVertices(E,0,S.worldVerticesLength,f.vertices,0,T),p=S.triangles,b=S.region.renderObject.texture,d=S.uvs,g=S.color}if(null!=b){var I=E.color,C=this.tempColor;C.r=v.r*I.r*g.r,C.g=v.g*I.g*g.g,C.b=v.b*I.b*g.b,C.a=v.a*I.a*g.a,s&&(C.r*=C.a,C.g*=C.a,C.b*=C.a);var P=this.tempColor2;null==E.darkColor?P.set(0,0,0,1):(s?(P.r=E.darkColor.r*C.a,P.g=E.darkColor.g*C.a,P.b=E.darkColor.b*C.a):P.setFromColor(E.darkColor),P.a=s?1:0);var _=E.data.blendMode;if(_!=o&&(o=_,t.setBlendMode(Jt.WebGLBlendModeConverter.getSourceGLBlendMode(o,s),Jt.WebGLBlendModeConverter.getDestGLBlendMode(o))),r.isClipping()){r.clipTriangles(f.vertices,f.numFloats,p,p.length,d,C,P,a);var F=new Float32Array(r.clippedVertices),L=r.clippedTriangles;if(null!=this.vertexEffect){var O=this.vertexEffect,k=F;if(a)for(var N=0,D=F.length;N>16&255)/255,r=(t>>8&255)/255,s=(255&t)/255,a=16777215>>24)/255:null,o=this.skeleton;return!e||(i=this.findSlot(e))&&(o=i),o.color.r=n,o.color.g=r,o.color.b=s,null!==a&&(o.color.a=a),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=m(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=m(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(1+(r-s)).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,r=t.indexOf(e);return-1!==r&&rt.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){var l=i(5);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),l(t,e,i)){var s=i-e,a=t.splice(e,s);if(n)for(var o=0;o=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),e},updateFrame:function(t){var e,i=this.setCurrentFrame(t);this.isPlaying&&(t.setAlpha&&(i.alpha=t.alpha),e=this.currentAnim,i.emit(s.SPRITE_ANIMATION_KEY_UPDATE+e.key,e,t,i),i.emit(s.SPRITE_ANIMATION_UPDATE,e,t,i),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this))},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(s.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null}});t.exports=a},function(t,e,i){var n=i(3),r=i(0),s=i(55),a=i(59),o=i(57),m=i(308),g=i(6),h=new r({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,g(i,"frames",[]),g(i,"defaultTextureKey",null)),this.frameRate=g(i,"frameRate",null),this.duration=g(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=g(i,"skipMissedFrames",!0),this.delay=g(i,"delay",0),this.repeat=g(i,"repeat",0),this.repeatDelay=g(i,"repeatDelay",0),this.yoyo=g(i,"yoyo",!1),this.showOnStart=g(i,"showOnStart",!1),this.hideOnComplete=g(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(a.PAUSE_ALL,this.pause,this),this.manager.on(a.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i,n,r=this.getFrames(this.manager.textureManager,e);return 0=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),o(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):0=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){var a=i(60),o=i(61);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){var n=i(10);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var f=i(317),d=i(10);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0>16)+(65280&t)+((255&t)<<16)}},function(t,e,i){var n=i(4),r=i(4),n=i(351);t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n,r){var s=e.list;if(0!==s.length){var a=e.localTransform;r?(a.loadIdentity(),a.multiply(r),a.translate(e.x,e.y),a.rotate(e.rotation),a.scale(e.scaleX,e.scaleY)):a.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,u=e.scrollFactorY,c=s,f=s.length,d=0;d=t.length)){for(var i=t.length-1,n=t[e],r=e;rMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e,i){var n=i(3);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){var n=i(0),r=i(11),s=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,o,a,h,l,u,c,f,d,p,v){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=o,g[7]=a,g[8]=h,g[9]=l,g[10]=u,g[11]=c,g[12]=f,g[13]=d,g[14]=p,g[15]=v,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=h.fromQuat(i).val,r=e.x,s=e.y,o=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*o,n[9]*o,n[10]*o,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],g=t[15],m=e*o-i*s,M=e*a-n*s,x=e*h-r*s,y=i*a-n*o,w=i*h-r*o,E=n*h-r*a,T=l*p-u*d,b=l*v-c*d,A=l*g-f*d,R=u*v-c*p,S=u*g-f*p,C=c*g-f*v,I=m*C-M*S+x*R+y*A-w*b+E*T;return I?(I=1/I,this.setValues((o*C-a*S+h*R)*I,(n*S-i*C-r*R)*I,(p*E-v*w+g*y)*I,(c*w-u*E-f*y)*I,(a*A-s*C-h*b)*I,(e*C-n*A+r*b)*I,(v*x-d*E-g*M)*I,(l*E-c*x+f*M)*I,(s*S-o*A+h*T)*I,(i*A-e*S-r*T)*I,(d*w-p*x+g*m)*I,(u*x-l*w-f*m)*I,(o*b-s*R-a*T)*I,(e*R-i*b+n*T)*I,(p*M-d*y-v*m)*I,(l*y-u*M+c*m)*I)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],g=t[15];return this.setValues(o*(c*g-f*v)-u*(a*g-h*v)+p*(a*f-h*c),-(i*(c*g-f*v)-u*(n*g-r*v)+p*(n*f-r*c)),i*(a*g-h*v)-o*(n*g-r*v)+p*(n*h-r*a),-(i*(a*f-h*c)-o*(n*f-r*c)+u*(n*h-r*a)),-(s*(c*g-f*v)-l*(a*g-h*v)+d*(a*f-h*c)),e*(c*g-f*v)-l*(n*g-r*v)+d*(n*f-r*c),-(e*(a*g-h*v)-s*(n*g-r*v)+d*(n*h-r*a)),e*(a*f-h*c)-s*(n*f-r*c)+l*(n*h-r*a),s*(u*g-f*p)-l*(o*g-h*p)+d*(o*f-h*u),-(e*(u*g-f*p)-l*(i*g-r*p)+d*(i*f-r*u)),e*(o*g-h*p)-s*(i*g-r*p)+d*(i*h-r*o),-(e*(o*f-h*u)-s*(i*f-r*u)+l*(i*h-r*o)),-(s*(u*v-c*p)-l*(o*v-a*p)+d*(o*c-a*u)),e*(u*v-c*p)-l*(i*v-n*p)+d*(i*c-n*u),-(e*(o*v-a*p)-s*(i*v-n*p)+d*(i*a-n*o)),e*(o*c-a*u)-s*(i*c-n*u)+l*(i*a-n*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],g=t[15];return(e*o-i*s)*(c*g-f*v)-(e*a-n*s)*(u*g-f*p)+(e*h-r*s)*(u*v-c*p)+(i*a-n*o)*(l*g-f*d)-(i*h-r*o)*(l*v-c*d)+(n*h-r*a)*(l*p-u*d)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],v=e[13],g=e[14],m=e[15],M=t.val,x=M[0],y=M[1],w=M[2],E=M[3];return e[0]=x*i+y*o+w*u+E*p,e[1]=x*n+y*a+w*c+E*v,e[2]=x*r+y*h+w*f+E*g,e[3]=x*s+y*l+w*d+E*m,x=M[4],y=M[5],w=M[6],E=M[7],e[4]=x*i+y*o+w*u+E*p,e[5]=x*n+y*a+w*c+E*v,e[6]=x*r+y*h+w*f+E*g,e[7]=x*s+y*l+w*d+E*m,x=M[8],y=M[9],w=M[10],E=M[11],e[8]=x*i+y*o+w*u+E*p,e[9]=x*n+y*a+w*c+E*v,e[10]=x*r+y*h+w*f+E*g,e[11]=x*s+y*l+w*d+E*m,x=M[12],y=M[13],w=M[14],E=M[15],e[12]=x*i+y*o+w*u+E*p,e[13]=x*n+y*a+w*c+E*v,e[14]=x*r+y*h+w*f+E*g,e[15]=x*s+y*l+w*d+E*m,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],o=i[8],a=i[12],h=i[1],l=i[5],u=i[9],c=i[13],f=i[2],d=i[6],p=i[10],v=i[14],g=i[3],m=i[7],M=i[11],x=i[15],y=n[0],w=n[4],E=n[8],T=n[12],b=n[1],A=n[5],R=n[9],S=n[13],C=n[2],I=n[6],P=n[10],_=n[14],L=n[3],k=n[7],O=n[11],F=n[15];return this.setValues(r*y+s*b+o*C+a*L,h*y+l*b+u*C+c*L,f*y+d*b+p*C+v*L,g*y+m*b+M*C+x*L,r*w+s*A+o*I+a*k,h*w+l*A+u*I+c*k,f*w+d*A+p*I+v*k,g*w+m*A+M*I+x*k,r*E+s*R+o*P+a*O,h*E+l*R+u*P+c*O,f*E+d*R+p*P+v*O,g*E+m*R+M*P+x*O,r*T+s*S+o*_+a*F,h*T+l*S+u*_+c*F,f*T+d*S+p*_+v*F,g*T+m*S+M*_+x*F)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,h=r*s,l=r*o;return this.setValues(h*s+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*s,0,h*a-n*o,l*a+n*s,r*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,s=e.z,o=Math.sqrt(n*n+r*r+s*s);if(Math.abs(o)<1e-6)return this;n*=o=1/o,r*=o,s*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],f=i[2],d=i[3],p=i[4],v=i[5],g=i[6],m=i[7],M=i[8],x=i[9],y=i[10],w=i[11],E=i[12],T=i[13],b=i[14],A=i[15],R=n*n*l+h,S=r*n*l+s*a,C=s*n*l-r*a,I=n*r*l-s*a,P=r*r*l+h,_=s*r*l+n*a,L=n*s*l+r*a,k=r*s*l-n*a,O=s*s*l+h;return this.setValues(u*R+p*S+M*C,c*R+v*S+x*C,f*R+g*S+y*C,d*R+m*S+w*C,u*I+p*P+M*_,c*I+v*P+x*_,f*I+g*P+y*_,d*I+m*P+w*_,u*L+p*k+M*O,c*L+v*k+x*O,f*L+g*k+y*O,d*L+m*k+w*O,E,T,b,A)},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[4],s=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=r*n+h*i,e[5]=s*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-r*i,e[9]=l*n-s*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=r*n-h*i,e[1]=s*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=r*i+h*n,e[9]=s*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=r*n+h*i,e[1]=s*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-r*i,e[5]=l*n-s*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,o=i+i,a=n+n,h=r+r,l=i*o,u=i*a,c=i*h,f=n*a,d=n*h,p=r*h,v=s*o,g=s*a,m=s*h;return this.setValues(1-(f+p),u+m,c-g,0,u-m,1-(l+p),d+v,0,c+g,d-v,1-(l+f),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,o=i+i,a=n+n,h=e*s,l=e*o,u=e*a,c=i*o,f=i*a,d=n*a,p=r*s,v=r*o,g=r*a;return this.setValues(1-(c+d),l+g,u-v,0,l-g,1-(h+d),f+p,0,u+v,f-p,1-(h+c),0,0,0,0,1)},frustum:function(t,e,i,n,r,s){var o=1/(e-t),a=1/(n-i),h=1/(r-s);return this.setValues(2*r*o,0,0,0,0,2*r*a,0,0,(e+t)*o,(n+i)*a,(s+r)*h,-1,0,0,s*r*2*h,0)},perspective:function(t,e,i,n){var r=1/Math.tan(t/2),s=1/(i-n);return this.setValues(r/e,0,0,0,0,r,0,0,0,0,(n+i)*s,-1,0,0,2*n*i*s,0)},perspectiveLH:function(t,e,i,n){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-n/(i-n),1,0,0,i*n/(i-n),0)},ortho:function(t,e,i,n,r,s){var o=0===(o=t-e)?o:1/o,a=0===(a=i-n)?a:1/a,h=0===(h=r-s)?h:1/h;return this.setValues(-2*o,0,0,0,0,-2*a,0,0,0,0,2*h,0,(t+e)*o,(n+i)*a,(s+r)*h,1)},lookAtRH:function(t,e,i){var n=this.val;return u.subVectors(t,e),0===u.getLengthSquared()&&(u.z=1),u.normalize(),o.crossVectors(i,u),0===o.getLengthSquared()&&(1===Math.abs(i.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),o.crossVectors(i,u)),o.normalize(),a.crossVectors(u,o),n[0]=o.x,n[1]=o.y,n[2]=o.z,n[4]=a.x,n[5]=a.y,n[6]=a.z,n[8]=u.x,n[9]=u.y,n[10]=u.z,this},lookAt:function(t,e,i){var n=t.x,r=t.y,s=t.z,o=i.x,a=i.y,h=i.z,l=e.x,u=e.y,c=e.z;if(Math.abs(n-l)<1e-6&&Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6)return this.identity();var f=n-l,d=r-u,p=s-c,v=1/Math.sqrt(f*f+d*d+p*p),g=a*(p*=v)-h*(d*=v),m=h*(f*=v)-o*p,M=o*d-a*f;(v=Math.sqrt(g*g+m*m+M*M))?(g*=v=1/v,m*=v,M*=v):M=m=g=0;var x=d*M-p*m,y=p*g-f*M,w=f*m-d*g;return(v=Math.sqrt(x*x+y*y+w*w))?(x*=v=1/v,y*=v,w*=v):w=y=x=0,this.setValues(g,x,f,0,m,y,d,0,M,w,p,0,-(g*n+m*r+M*s),-(x*n+y*r+w*s),-(f*n+d*r+p*s),1)},yawPitchRoll:function(t,e,i){this.zero(),h.zero(),l.zero();var n=this.val,r=h.val,s=l.val,o=Math.sin(i),a=Math.cos(i);return n[10]=1,n[15]=1,n[0]=a,n[1]=o,n[4]=-o,n[5]=a,o=Math.sin(e),a=Math.cos(e),r[0]=1,r[15]=1,r[5]=a,r[10]=a,r[9]=-o,r[6]=o,o=Math.sin(t),a=Math.cos(t),s[5]=1,s[15]=1,s[0]=a,s[2]=-o,s[8]=o,s[10]=a,this.multiplyLocal(h),this.multiplyLocal(l),this},setWorldMatrix:function(t,e,i,n,r){return this.yawPitchRoll(t.y,t.x,t.z),h.scaling(i.x,i.y,i.z),l.xyz(e.x,e.y,e.z),this.multiplyLocal(h),this.multiplyLocal(l),n&&this.multiplyLocal(n),r&&this.multiplyLocal(r),this},multiplyToMat4:function(t,e){var i=this.val,n=t.val,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=i[6],c=i[7],f=i[8],d=i[9],p=i[10],v=i[11],g=i[12],m=i[13],M=i[14],x=i[15],y=n[0],w=n[1],E=n[2],T=n[3],b=n[4],A=n[5],R=n[6],S=n[7],C=n[8],I=n[9],P=n[10],_=n[11],L=n[12],k=n[13],O=n[14],F=n[15];return e.setValues(y*r+w*h+E*f+T*g,w*s+w*l+E*d+T*m,E*o+w*u+E*p+T*M,T*a+w*c+E*v+T*x,b*r+A*h+R*f+S*g,b*s+A*l+R*d+S*m,b*o+A*u+R*p+S*M,b*a+A*c+R*v+S*x,C*r+I*h+P*f+_*g,C*s+I*l+P*d+_*m,C*o+I*u+P*p+_*M,C*a+I*c+P*v+_*x,L*r+k*h+O*f+F*g,L*s+k*l+O*d+F*m,L*o+k*u+O*p+F*M,L*a+k*c+O*v+F*x)},fromRotationXYTranslation:function(t,e,i){var n=e.x,r=e.y,s=e.z,o=Math.sin(t.x),a=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),u=n,c=r,f=s,d=-o,p=0-d*h,v=0-a*h,g=d*l,m=a*l;return i||(u=l*n+h*s,c=p*n+a*r+g*s,f=v*n+o*r+m*s),this.setValues(l,p,v,0,0,a,o,0,h,g,m,0,u,c,f,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}}),h=new s,l=new s,o=new r,a=new r,u=new r;t.exports=s},function(t,e,i){var n=i(3);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){var n=i(0),r=i(12),s=i(202),o=i(8),a=i(213),h=i(44),l=i(214),u=i(45),c=new n({initialize:function(t,e){this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var n=o(e,"url");void 0===n?n=t.path+i+"."+o(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=u(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){(this.linkFile=t).linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&0===t.responseURL.indexOf("file://")&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&400<=t.status&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){var n;"function"==typeof URL?t.src=URL.createObjectURL(e):((n=new FileReader).onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e))},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e,i){var n=i(0),s=i(3),c=i(2),r=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3];return e||i?0=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e,i){var u=i(6),c=function(){var t,e,i,n,r,s,o=arguments[0]||{},a=1,h=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[1]||{},a=2),h===a&&(o=this,--a);as[0]&&(e=1),s[8]>s[3*e+e]&&(e=2),i=a[e],n=a[i],r=Math.sqrt(s[3*e+e]-s[3*i+i]-s[3*n+n]+1),h[e]=.5*r,r=.5/r,h[i]=(s[3*i+e]+s[3*e+i])*r,h[n]=(s[3*n+e]+s[3*e+n])*r,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(s[3*n+i]-s[3*i+n])*r),this.onChangeCallback(this),this}});t.exports=d},function(t,e,i){var r=i(27),s=i(45);t.exports=function(t,e){var i=void 0===t?s():r({},t);if(e)for(var n in e)void 0!==e[n]&&(i[n]=e[n]);return i}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){var n=i(3),r=i(23),h=i(41),s=i(30),o=i(31),l=i(2),a={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){0===(this._scaleX=t)?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){0===(this._scaleY=t)?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return o(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i=i||new l;var r=(n=n||this.scene.sys.cameras.main).scrollX,s=n.scrollY,o=t+r*this.scrollFactorX-r,a=e+s*this.scrollFactorY-s;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(o,a,i):h(o,a,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=a},function(t,e){var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){var n=i(0),r=i(53),s=i(219),o=i(226),a=i(54),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),(t=e).parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){var e;void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy&&(this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this),e=this.scene.sys,t||e.displayList.remove(this),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners())}});h.RENDER_MASK=15,t.exports=h},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){t.exports={ADDED_TO_SCENE:i(227),DESTROY:i(228),REMOVED_FROM_SCENE:i(229),VIDEO_COMPLETE:i(230),VIDEO_CREATED:i(231),VIDEO_ERROR:i(232),VIDEO_LOOP:i(233),VIDEO_PLAY:i(234),VIDEO_SEEKED:i(235),VIDEO_SEEKING:i(236),VIDEO_STOP:i(237),VIDEO_TIMEOUT:i(238),VIDEO_UNLOCKED:i(239)}},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(e>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return 2.3283064365386963e-10*((this.n=i)>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e= 0.");if(null==e)throw new Error("name cannot be null.");this.index=t,this.name=e,this.parent=i}function fe(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var i=0;i= 0.");if(null==e)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=t,this.name=e,this.boneData=i}function be(t,e){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new N.Vector2,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix,this.scaleMix=t.scaleMix,this.shearMix=t.shearMix,this.bones=new Array;for(var i=0;i>>1;;){if(t[(s+1)*i]<=e?n=s+1:r=s,n==r)return(n+1)*i;s=n+r>>>1}},r.linearSearch=function(t,e,i){for(var n=0,r=t.length-i;n<=r;n+=i)if(t[n]>e)return n;return-1},r);function r(t,e,i){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var n=0;n 0: "+t);this.curves=X.Utils.newFloatArray((t-1)*M.BEZIER_SIZE)}X.CurveTimeline=s;var o,a=(oe(m,o=s),m.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},m.prototype.setFrame=function(t,e,i){t<<=1,this.frames[t]=e,this.frames[t+m.ROTATION]=i},m.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-m.ENTRIES]){var u=a[a.length+m.PREV_ROTATION];switch(s){case U.setup:h.rotation=h.data.rotation+u*r;break;case U.first:case U.replace:u+=h.data.rotation-h.rotation,u-=360*(16384-(16384.499999999996-u/360|0));case U.add:h.rotation+=u*r}}else{var c=z.binarySearch(a,i,m.ENTRIES),f=a[c+m.PREV_ROTATION],d=a[c],p=this.getCurvePercent((c>>1)-1,1-(i-d)/(a[c+m.PREV_TIME]-d)),v=f+((v=a[c+m.ROTATION]-f)-360*(16384-(16384.499999999996-v/360|0)))*p;switch(s){case U.setup:h.rotation=h.data.rotation+(v-360*(16384-(16384.499999999996-v/360|0)))*r;break;case U.first:case U.replace:v+=h.data.rotation-h.rotation;case U.add:h.rotation+=(v-360*(16384-(16384.499999999996-v/360|0)))*r}}},m.ENTRIES=2,m.PREV_TIME=-2,m.PREV_ROTATION=-1,m.ROTATION=1,m);function m(t){var e=o.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t<<1),e}X.RotateTimeline=a;var h,l=(oe(p,h=s),p.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},p.prototype.setFrame=function(t,e,i,n){t*=p.ENTRIES,this.frames[t]=e,this.frames[t+p.X]=i,this.frames[t+p.Y]=n},p.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-p.ENTRIES]?(f=a[a.length+p.PREV_X],d=a[a.length+p.PREV_Y]):(f=a[(l=z.binarySearch(a,i,p.ENTRIES))+p.PREV_X],d=a[l+p.PREV_Y],u=a[l],c=this.getCurvePercent(l/p.ENTRIES-1,1-(i-u)/(a[l+p.PREV_TIME]-u)),f+=(a[l+p.X]-f)*c,d+=(a[l+p.Y]-d)*c),s){case U.setup:h.x=h.data.x+f*r,h.y=h.data.y+d*r;break;case U.first:case U.replace:h.x+=(h.data.x+f-h.x)*r,h.y+=(h.data.y+d-h.y)*r;break;case U.add:h.x+=f*r,h.y+=d*r}}},p.ENTRIES=3,p.PREV_TIME=-3,p.PREV_X=-2,p.PREV_Y=-1,p.X=1,p.Y=2,p);function p(t){var e=h.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t*p.ENTRIES),e}X.TranslateTimeline=l;var u,c=(oe(x,u=l),x.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},x.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-x.ENTRIES]?(f=a[a.length+x.PREV_X]*h.data.scaleX,a[a.length+x.PREV_Y]*h.data.scaleY):(f=a[(l=z.binarySearch(a,i,x.ENTRIES))+x.PREV_X],d=a[l+x.PREV_Y],u=a[l],c=this.getCurvePercent(l/x.ENTRIES-1,1-(i-u)/(a[l+x.PREV_TIME]-u)),f=(f+(a[l+x.X]-f)*c)*h.data.scaleX,(d+(a[l+x.Y]-d)*c)*h.data.scaleY),1==r)s==U.add?(h.scaleX+=f-h.data.scaleX,h.scaleY+=d-h.data.scaleY):(h.scaleX=f,h.scaleY=d);else{var p=0,v=0;if(o==g.mixOut)switch(s){case U.setup:p=h.data.scaleX,v=h.data.scaleY,h.scaleX=p+(Math.abs(f)*X.MathUtils.signum(p)-p)*r,h.scaleY=v+(Math.abs(d)*X.MathUtils.signum(v)-v)*r;break;case U.first:case U.replace:p=h.scaleX,v=h.scaleY,h.scaleX=p+(Math.abs(f)*X.MathUtils.signum(p)-p)*r,h.scaleY=v+(Math.abs(d)*X.MathUtils.signum(v)-v)*r;break;case U.add:p=h.scaleX,v=h.scaleY,h.scaleX=p+(Math.abs(f)*X.MathUtils.signum(p)-h.data.scaleX)*r,h.scaleY=v+(Math.abs(d)*X.MathUtils.signum(v)-h.data.scaleY)*r}else switch(s){case U.setup:p=Math.abs(h.data.scaleX)*X.MathUtils.signum(f),v=Math.abs(h.data.scaleY)*X.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=v+(d-v)*r;break;case U.first:case U.replace:p=Math.abs(h.scaleX)*X.MathUtils.signum(f),v=Math.abs(h.scaleY)*X.MathUtils.signum(d),h.scaleX=p+(f-p)*r,h.scaleY=v+(d-v)*r;break;case U.add:p=X.MathUtils.signum(f),v=X.MathUtils.signum(d),h.scaleX=Math.abs(h.scaleX)*p+(f-Math.abs(h.data.scaleX)*p)*r,h.scaleY=Math.abs(h.scaleY)*v+(d-Math.abs(h.data.scaleY)*v)*r}}}},x);function x(t){return u.call(this,t)||this}X.ScaleTimeline=c;var f,d=(oe(v,f=l),v.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},v.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.bones[this.boneIndex];if(h.active)if(i=a[a.length-v.ENTRIES]?(f=a[a.length+v.PREV_X],d=a[a.length+v.PREV_Y]):(f=a[(l=z.binarySearch(a,i,v.ENTRIES))+v.PREV_X],d=a[l+v.PREV_Y],u=a[l],c=this.getCurvePercent(l/v.ENTRIES-1,1-(i-u)/(a[l+v.PREV_TIME]-u)),f+=(a[l+v.X]-f)*c,d+=(a[l+v.Y]-d)*c),s){case U.setup:h.shearX=h.data.shearX+f*r,h.shearY=h.data.shearY+d*r;break;case U.first:case U.replace:h.shearX+=(h.data.shearX+f-h.shearX)*r,h.shearY+=(h.data.shearY+d-h.shearY)*r;break;case U.add:h.shearX+=f*r,h.shearY+=d*r}}},v);function v(t){return f.call(this,t)||this}X.ShearTimeline=d;var y,w=(oe(E,y=s),E.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},E.prototype.setFrame=function(t,e,i,n,r,s){t*=E.ENTRIES,this.frames[t]=e,this.frames[t+E.R]=i,this.frames[t+E.G]=n,this.frames[t+E.B]=r,this.frames[t+E.A]=s},E.prototype.apply=function(t,e,i,n,r,s,o){var a=t.slots[this.slotIndex];if(a.bone.active){var h=this.frames;if(i=h[h.length-E.ENTRIES]?(v=h[(c=h.length)+E.PREV_R],g=h[c+E.PREV_G],m=h[c+E.PREV_B],M=h[c+E.PREV_A]):(v=h[(f=z.binarySearch(h,i,E.ENTRIES))+E.PREV_R],g=h[f+E.PREV_G],m=h[f+E.PREV_B],M=h[f+E.PREV_A],d=h[f],p=this.getCurvePercent(f/E.ENTRIES-1,1-(i-d)/(h[f+E.PREV_TIME]-d)),v+=(h[f+E.R]-v)*p,g+=(h[f+E.G]-g)*p,m+=(h[f+E.B]-m)*p,M+=(h[f+E.A]-M)*p),1==r?a.color.set(v,g,m,M):(l=a.color,s==U.setup&&l.setFromColor(a.data.color),l.add((v-l.r)*r,(g-l.g)*r,(m-l.b)*r,(M-l.a)*r))}}},E.ENTRIES=5,E.PREV_TIME=-5,E.PREV_R=-4,E.PREV_G=-3,E.PREV_B=-2,E.PREV_A=-1,E.R=1,E.G=2,E.B=3,E.A=4,E);function E(t){var e=y.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t*E.ENTRIES),e}X.ColorTimeline=w;var T,b=(oe(A,T=s),A.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},A.prototype.setFrame=function(t,e,i,n,r,s,o,a,h){t*=A.ENTRIES,this.frames[t]=e,this.frames[t+A.R]=i,this.frames[t+A.G]=n,this.frames[t+A.B]=r,this.frames[t+A.A]=s,this.frames[t+A.R2]=o,this.frames[t+A.G2]=a,this.frames[t+A.B2]=h},A.prototype.apply=function(t,e,i,n,r,s,o){var a=t.slots[this.slotIndex];if(a.bone.active){var h=this.frames;if(i=h[h.length-A.ENTRIES]?(m=h[(d=h.length)+A.PREV_R],M=h[d+A.PREV_G],x=h[d+A.PREV_B],y=h[d+A.PREV_A],w=h[d+A.PREV_R2],E=h[d+A.PREV_G2],T=h[d+A.PREV_B2]):(m=h[(p=z.binarySearch(h,i,A.ENTRIES))+A.PREV_R],M=h[p+A.PREV_G],x=h[p+A.PREV_B],y=h[p+A.PREV_A],w=h[p+A.PREV_R2],E=h[p+A.PREV_G2],T=h[p+A.PREV_B2],v=h[p],g=this.getCurvePercent(p/A.ENTRIES-1,1-(i-v)/(h[p+A.PREV_TIME]-v)),m+=(h[p+A.R]-m)*g,M+=(h[p+A.G]-M)*g,x+=(h[p+A.B]-x)*g,y+=(h[p+A.A]-y)*g,w+=(h[p+A.R2]-w)*g,E+=(h[p+A.G2]-E)*g,T+=(h[p+A.B2]-T)*g),1==r?(a.color.set(m,M,x,y),a.darkColor.set(w,E,T,1)):(l=a.color,u=a.darkColor,s==U.setup&&(l.setFromColor(a.data.color),u.setFromColor(a.data.darkColor)),l.add((m-l.r)*r,(M-l.g)*r,(x-l.b)*r,(y-l.a)*r),u.add((w-u.r)*r,(E-u.g)*r,(T-u.b)*r,0))}}},A.ENTRIES=8,A.PREV_TIME=-8,A.PREV_R=-7,A.PREV_G=-6,A.PREV_B=-5,A.PREV_A=-4,A.PREV_R2=-3,A.PREV_G2=-2,A.PREV_B2=-1,A.R=1,A.G=2,A.B=3,A.A=4,A.R2=5,A.G2=6,A.B2=7,A);function A(t){var e=T.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t*A.ENTRIES),e}X.TwoColorTimeline=b;var R=(S.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},S.prototype.getFrameCount=function(){return this.frames.length},S.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.attachmentNames[t]=i},S.prototype.apply=function(t,e,i,n,r,s,o){var a,h,l,u=t.slots[this.slotIndex];u.bone.active&&(o!=g.mixOut?i<(a=this.frames)[0]?s!=U.setup&&s!=U.first||this.setAttachment(t,u,u.data.attachmentName):(h=0,h=i>=a[a.length-1]?a.length-1:z.binarySearch(a,i,1)-1,l=this.attachmentNames[h],t.slots[this.slotIndex].setAttachment(null==l?null:t.getAttachment(this.slotIndex,l))):s==U.setup&&this.setAttachment(t,u,u.data.attachmentName))},S.prototype.setAttachment=function(t,e,i){e.attachment=null==i?null:t.getAttachment(this.slotIndex,i)},S);function S(t){this.frames=X.Utils.newFloatArray(t),this.attachmentNames=new Array(t)}X.AttachmentTimeline=R;var C,I=null,P=(oe(_,C=s),_.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},_.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.frameVertices[t]=i},_.prototype.apply=function(t,e,i,n,r,s,o){var a=t.slots[this.slotIndex];if(a.bone.active){var h=a.getAttachment();if(h instanceof X.VertexAttachment&&h.deformAttachment==this.attachment){var l=a.deform;0==l.length&&(s=U.setup);var u=this.frameVertices,c=u[0].length,f=this.frames;if(i=f[f.length-1]){var M=u[f.length-1];if(1==r)if(s==U.add)if(null==(d=h).bones)for(var v=d.vertices,x=0;x=a[h-1])return;if(!(i=a[l];l++)n.push(this.events[l])}}},k);function k(t){this.frames=X.Utils.newFloatArray(t),this.events=new Array(t)}X.EventTimeline=L;var O=(F.prototype.getPropertyId=function(){return i.drawOrder<<24},F.prototype.getFrameCount=function(){return this.frames.length},F.prototype.setFrame=function(t,e,i){this.frames[t]=e,this.drawOrders[t]=i},F.prototype.apply=function(t,e,i,n,r,s,o){var a=t.drawOrder,h=t.slots;if(o!=g.mixOut){var l=this.frames;if(i=l[l.length-1]?l.length-1:z.binarySearch(l,i)-1,c=this.drawOrders[u];if(null==c)X.Utils.arrayCopy(h,0,a,0,h.length);else for(var f=0,d=c.length;f=f[f.length-N.ENTRIES]?s==U.setup?(d.mix=d.data.mix+(f[f.length+N.PREV_MIX]-d.data.mix)*r,d.softness=d.data.softness+(f[f.length+N.PREV_SOFTNESS]-d.data.softness)*r,o==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[f.length+N.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+N.PREV_COMPRESS],d.stretch=0!=f[f.length+N.PREV_STRETCH])):(d.mix+=(f[f.length+N.PREV_MIX]-d.mix)*r,d.softness+=(f[f.length+N.PREV_SOFTNESS]-d.softness)*r,o==g.mixIn&&(d.bendDirection=f[f.length+N.PREV_BEND_DIRECTION],d.compress=0!=f[f.length+N.PREV_COMPRESS],d.stretch=0!=f[f.length+N.PREV_STRETCH])):(h=f[(a=z.binarySearch(f,i,N.ENTRIES))+N.PREV_MIX],l=f[a+N.PREV_SOFTNESS],u=f[a],c=this.getCurvePercent(a/N.ENTRIES-1,1-(i-u)/(f[a+N.PREV_TIME]-u)),s==U.setup?(d.mix=d.data.mix+(h+(f[a+N.MIX]-h)*c-d.data.mix)*r,d.softness=d.data.softness+(l+(f[a+N.SOFTNESS]-l)*c-d.data.softness)*r,o==g.mixOut?(d.bendDirection=d.data.bendDirection,d.compress=d.data.compress,d.stretch=d.data.stretch):(d.bendDirection=f[a+N.PREV_BEND_DIRECTION],d.compress=0!=f[a+N.PREV_COMPRESS],d.stretch=0!=f[a+N.PREV_STRETCH])):(d.mix+=(h+(f[a+N.MIX]-h)*c-d.mix)*r,d.softness+=(l+(f[a+N.SOFTNESS]-l)*c-d.softness)*r,o==g.mixIn&&(d.bendDirection=f[a+N.PREV_BEND_DIRECTION],d.compress=0!=f[a+N.PREV_COMPRESS],d.stretch=0!=f[a+N.PREV_STRETCH])))},N.ENTRIES=6,N.PREV_TIME=-6,N.PREV_MIX=-5,N.PREV_SOFTNESS=-4,N.PREV_BEND_DIRECTION=-3,N.PREV_COMPRESS=-2,N.PREV_STRETCH=-1,N.MIX=1,N.SOFTNESS=2,N.BEND_DIRECTION=3,N.COMPRESS=4,N.STRETCH=5,N);function N(t){var e=V.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t*N.ENTRIES),e}X.IkConstraintTimeline=D;var B,Y=(oe(W,B=s),W.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},W.prototype.setFrame=function(t,e,i,n,r,s){t*=W.ENTRIES,this.frames[t]=e,this.frames[t+W.ROTATE]=i,this.frames[t+W.TRANSLATE]=n,this.frames[t+W.SCALE]=r,this.frames[t+W.SHEAR]=s},W.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.transformConstraints[this.transformConstraintIndex];if(h.active)if(i=a[a.length-W.ENTRIES]?(p=a[(u=a.length)+W.PREV_ROTATE],v=a[u+W.PREV_TRANSLATE],g=a[u+W.PREV_SCALE],m=a[u+W.PREV_SHEAR]):(p=a[(c=z.binarySearch(a,i,W.ENTRIES))+W.PREV_ROTATE],v=a[c+W.PREV_TRANSLATE],g=a[c+W.PREV_SCALE],m=a[c+W.PREV_SHEAR],f=a[c],d=this.getCurvePercent(c/W.ENTRIES-1,1-(i-f)/(a[c+W.PREV_TIME]-f)),p+=(a[c+W.ROTATE]-p)*d,v+=(a[c+W.TRANSLATE]-v)*d,g+=(a[c+W.SCALE]-g)*d,m+=(a[c+W.SHEAR]-m)*d),s==U.setup?(l=h.data,h.rotateMix=l.rotateMix+(p-l.rotateMix)*r,h.translateMix=l.translateMix+(v-l.translateMix)*r,h.scaleMix=l.scaleMix+(g-l.scaleMix)*r,h.shearMix=l.shearMix+(m-l.shearMix)*r):(h.rotateMix+=(p-h.rotateMix)*r,h.translateMix+=(v-h.translateMix)*r,h.scaleMix+=(g-h.scaleMix)*r,h.shearMix+=(m-h.shearMix)*r)}},W.ENTRIES=5,W.PREV_TIME=-5,W.PREV_ROTATE=-4,W.PREV_TRANSLATE=-3,W.PREV_SCALE=-2,W.PREV_SHEAR=-1,W.ROTATE=1,W.TRANSLATE=2,W.SCALE=3,W.SHEAR=4,W);function W(t){var e=B.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t*W.ENTRIES),e}X.TransformConstraintTimeline=Y;var G,q=(oe(H,G=s),H.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},H.prototype.setFrame=function(t,e,i){t*=H.ENTRIES,this.frames[t]=e,this.frames[t+H.VALUE]=i},H.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=a[a.length-H.ENTRIES]?f=a[a.length+H.PREV_VALUE]:(f=a[(l=z.binarySearch(a,i,H.ENTRIES))+H.PREV_VALUE],u=a[l],c=this.getCurvePercent(l/H.ENTRIES-1,1-(i-u)/(a[l+H.PREV_TIME]-u)),f+=(a[l+H.VALUE]-f)*c),s==U.setup?h.position=h.data.position+(f-h.data.position)*r:h.position+=(f-h.position)*r}},H.ENTRIES=2,H.PREV_TIME=-2,H.PREV_VALUE=-1,H.VALUE=1,H);function H(t){var e=G.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t*H.ENTRIES),e}X.PathConstraintPositionTimeline=q;var j,Z=(oe(K,j=q),K.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},K.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=a[a.length-K.ENTRIES]?f=a[a.length+K.PREV_VALUE]:(f=a[(l=z.binarySearch(a,i,K.ENTRIES))+K.PREV_VALUE],u=a[l],c=this.getCurvePercent(l/K.ENTRIES-1,1-(i-u)/(a[l+K.PREV_TIME]-u)),f+=(a[l+K.VALUE]-f)*c),s==U.setup?h.spacing=h.data.spacing+(f-h.data.spacing)*r:h.spacing+=(f-h.spacing)*r}},K);function K(t){return j.call(this,t)||this}X.PathConstraintSpacingTimeline=Z;var Q,J=(oe($,Q=s),$.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},$.prototype.setFrame=function(t,e,i,n){t*=$.ENTRIES,this.frames[t]=e,this.frames[t+$.ROTATE]=i,this.frames[t+$.TRANSLATE]=n},$.prototype.apply=function(t,e,i,n,r,s,o){var a=this.frames,h=t.pathConstraints[this.pathConstraintIndex];if(h.active)if(i=a[a.length-$.ENTRIES]?(f=a[a.length+$.PREV_ROTATE],d=a[a.length+$.PREV_TRANSLATE]):(f=a[(l=z.binarySearch(a,i,$.ENTRIES))+$.PREV_ROTATE],d=a[l+$.PREV_TRANSLATE],u=a[l],c=this.getCurvePercent(l/$.ENTRIES-1,1-(i-u)/(a[l+$.PREV_TIME]-u)),f+=(a[l+$.ROTATE]-f)*c,d+=(a[l+$.TRANSLATE]-d)*c),s==U.setup?(h.rotateMix=h.data.rotateMix+(f-h.data.rotateMix)*r,h.translateMix=h.data.translateMix+(d-h.data.translateMix)*r):(h.rotateMix+=(f-h.rotateMix)*r,h.translateMix+=(d-h.translateMix)*r)}},$.ENTRIES=3,$.PREV_TIME=-3,$.PREV_ROTATE=-2,$.PREV_TRANSLATE=-1,$.ROTATE=1,$.TRANSLATE=2,$);function $(t){var e=Q.call(this,t)||this;return e.frames=X.Utils.newFloatArray(t*$.ENTRIES),e}X.PathConstraintMixTimeline=J}(re=re||{}),function(R){var t=(S.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,i=0,n=e.length;i=r.trackEnd&&null==r.mixingFrom){e[i]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for((r.mixingFrom=null)!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},S.prototype.updateMixingFrom=function(t,e){var i=t.mixingFrom;if(null==i)return!0;var n=this.updateMixingFrom(i,e);return i.animationLast=i.nextAnimationLast,i.trackLast=i.nextTrackLast,0=t.mixDuration?(0!=i.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=i.mixingFrom,null!=i.mixingFrom&&(i.mixingFrom.mixingTo=t),t.interruptAlpha=i.interruptAlpha,this.queue.end(i)),n):(i.trackTime+=e*i.timeScale,t.mixTime+=e,!1)},S.prototype.apply=function(t){if(null==t)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var e=this.events,i=this.tracks,n=!1,r=0,s=i.length;r=o.trackEnd&&null==o.next&&(h=0);var l=o.animationLast,u=o.getAnimationTime(),c=o.animation.timelines.length,f=o.animation.timelines;if(0==r&&1==h||a==R.MixBlend.add)for(var d=0;d=s[s.length-1]?s.length-1:R.Animation.binarySearch(s,i)-1,this.setAttachment(e,a,t.attachmentNames[o],r)),a.attachmentState<=this.unkeyedState&&(a.attachmentState=this.unkeyedState+S.SETUP))},S.prototype.setAttachment=function(t,e,i,n){e.attachment=null==i?null:t.getAttachment(e.data.index,i),n&&(e.attachmentState=this.unkeyedState+S.CURRENT)},S.prototype.applyRotateTimeline=function(t,e,i,n,r,s,o,a){if(a&&(s[o]=0),1!=n){var h=t,l=h.frames,u=e.bones[h.boneIndex];if(u.active){var c=0,f=0;if(i=l[l.length-R.RotateTimeline.ENTRIES]?f=u.data.rotation+l[l.length+R.RotateTimeline.PREV_ROTATION]:(p=l[(d=R.Animation.binarySearch(l,i,R.RotateTimeline.ENTRIES))+R.RotateTimeline.PREV_ROTATION],v=l[d],g=h.getCurvePercent((d>>1)-1,1-(i-v)/(l[d+R.RotateTimeline.PREV_TIME]-v)),f=l[d+R.RotateTimeline.ROTATION]-p,f=p+(f-=360*(16384-(16384.499999999996-f/360|0)))*g+u.data.rotation,f-=360*(16384-(16384.499999999996-f/360|0)))}var m,M,x,y,w=0,E=f-c;0==(E-=360*(16384-(16384.499999999996-E/360|0)))?w=s[o]:(M=m=0,M=a?(m=0,E):(m=s[o],s[o+1]),x=0n||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:n<=e&&t.animationLast=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var i=e;;){var n=i.mixingFrom;if(null==n)break;this.queue.end(n),i.mixingFrom=null,i.mixingTo=null,i=n}this.tracks[e.trackIndex]=null,this.queue.drain()}}},S.prototype.setCurrent=function(t,e,i){var n=this.expandToIndex(t);this.tracks[t]=e,null!=n&&(i&&this.queue.interrupt(n),((e.mixingFrom=n).mixingTo=e).mixTime=0,null!=n.mixingFrom&&0=this.tracks.length?null:this.tracks[t]},S.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},S.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);0<=e&&this.listeners.splice(e,1)},S.prototype.clearListeners=function(){this.listeners.length=0},S.prototype.clearListenerNotifications=function(){this.queue.clear()},S.emptyAnimation=new R.Animation("",[],0),S.SUBSEQUENT=0,S.FIRST=1,S.HOLD_SUBSEQUENT=2,S.HOLD_FIRST=3,S.HOLD_MIX=4,S.SETUP=1,S.CURRENT=2,S);function S(t){this.tracks=new Array,this.timeScale=1,this.unkeyedState=0,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new R.IntSet,this.animationsChanged=!1,this.trackEntryPool=new R.Pool(function(){return new e}),this.data=t}R.AnimationState=t;var e=(i.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},i.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},i.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},i.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},i.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},i);function i(){this.mixBlend=R.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}R.TrackEntry=e;var a,n,r=(s.prototype.start=function(t){this.objects.push(a.start),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.interrupt=function(t){this.objects.push(a.interrupt),this.objects.push(t)},s.prototype.end=function(t){this.objects.push(a.end),this.objects.push(t),this.animState.animationsChanged=!0},s.prototype.dispose=function(t){this.objects.push(a.dispose),this.objects.push(t)},s.prototype.complete=function(t){this.objects.push(a.complete),this.objects.push(t)},s.prototype.event=function(t,e){this.objects.push(a.event),this.objects.push(t),this.objects.push(e)},s.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,i=0;ij.MathUtils.PI?B-=j.MathUtils.PI2:B<-j.MathUtils.PI&&(B+=j.MathUtils.PI2),B*=e,V=Math.cos(B),D=Math.sin(B),R.a=V*L-D*O,R.b=V*k-D*F,R.c=D*L+V*O,R.d=D*k+V*F),R.appliedValid=!1}}}},pe.prototype.computeWorldPositions=function(t,e,i,n,r){var s=this.target,o=this.position,a=this.spaces,h=j.Utils.setArraySize(this.positions,3*e+2),l=null,u=t.closed,c=t.worldVerticesLength,f=c/6,d=pe.NONE;if(!t.constantSpeed){var p=t.lengths,v=p[f-=u?1:2];if(n&&(o*=v),r)for(var g=1;g>>1^-(1&i)},e.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},e.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",i=0;i>4){case 12:case 13:e+=String.fromCharCode((31&n)<<6|63&this.readByte()),i+=2;break;case 14:e+=String.fromCharCode((15&n)<<12|(63&this.readByte())<<6|63&this.readByte()),i+=3;break;default:e+=String.fromCharCode(n),i++}}return e},e.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},e.prototype.readBoolean=function(){return 0!=this.readByte()},e);function e(t,e,i,n){void 0===e&&(e=new Array),void 0===i&&(i=0),void 0===n&&(n=new DataView(t.buffer)),this.strings=e,this.index=i,this.buffer=n}var N=function(t,e,i,n,r){this.mesh=t,this.skin=e,this.slotIndex=i,this.parent=n,this.inheritDeform=r},u=function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}(re=re||{}),I=re=re||{},xe.prototype.update=function(t,e){if(null==t)throw new Error("skeleton cannot be null.");var i=this.boundingBoxes,n=this.polygons,r=this.polygonPool,s=t.slots,o=s.length;i.length=0,r.freeAll(n);for(var a=n.length=0;a=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},xe.prototype.aabbIntersectsSegment=function(t,e,i,n){var r=this.minX,s=this.minY,o=this.maxX,a=this.maxY;if(t<=r&&i<=r||e<=s&&n<=s||o<=t&&o<=i||a<=e&&a<=n)return!1;var h=(n-e)/(i-t),l=h*(r-t)+e;if(st.minX&&this.minYt.minY},xe.prototype.containsPoint=function(t,e){for(var i=this.polygons,n=0,r=i.length;n>1,N=this.clipOutput,B=Z.Utils.setArraySize(l,P+D*d),Y=0;Y<_;Y+=2){var X=N[Y],U=N[Y+1];B[P]=X,B[P+1]=U,B[P+2]=s.r,B[P+3]=s.g,B[P+4]=s.b,B[P+5]=s.a;var z=X-A,W=U-R,G=(L*z+k*W)*V,q=(F*z+O*W)*V,H=1-G-q;B[P+6]=x*G+T*q+S*H,B[P+7]=y*G+b*q+C*H,a&&(B[P+8]=o.r,B[P+9]=o.g,B[P+10]=o.b,B[P+11]=o.a),P+=d}P=u.length;var j=Z.Utils.setArraySize(u,P+3*(D-2));for(D--,Y=1;Y>1;a=n.length&&(n.length=t+1),n[t]||(n[t]={}),n[t][e]=i},e.prototype.addSkin=function(t){for(var e=0;e=this.lines.length?null:this.lines[this.index++]},i.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},i.prototype.readTuple=function(t){var e=this.readLine(),i=e.indexOf(":");if(-1==i)throw new Error("Invalid line: "+e);for(var n=0,r=i+1;n<3;n++){var s=e.indexOf(",",r);if(-1==s)break;t[n]=e.substr(r,s-r).trim(),r=s+1}return t[n]=e.substring(r).trim(),n+1},i);function i(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}var v=function(){};d.TextureAtlasPage=v;var n,g=(n=d.TextureRegion,oe(r,n),r);function r(){return null!==n&&n.apply(this,arguments)||this}d.TextureAtlasRegion=g}(re=re||{}),N=re=re||{},be.prototype.isActive=function(){return this.active},be.prototype.apply=function(){this.update()},be.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},be.prototype.applyAbsoluteWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,o=r.b,a=r.c,h=r.d,l=0N.MathUtils.PI?b-=N.MathUtils.PI2:b<-N.MathUtils.PI&&(b+=N.MathUtils.PI2),b*=t,m=Math.cos(b),M=Math.sin(b),R.a=m*v-M*g,R.b=m*w-M*E,R.c=M*v+m*g,R.d=M*w+m*E,S=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),R.worldX+=(x.x-R.worldX)*e,R.worldY+=(x.y-R.worldY)*e,S=!0),0N.MathUtils.PI?b-=N.MathUtils.PI2:b<-N.MathUtils.PI&&(b+=N.MathUtils.PI2),b=T+(b+c)*n,A=Math.sqrt(w*w+E*E),R.b=Math.cos(b)*A,R.d=Math.sin(b)*A,S=!0),S&&(R.appliedValid=!1)}},be.prototype.applyRelativeWorld=function(){for(var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target,s=r.a,o=r.b,a=r.c,h=r.d,l=0N.MathUtils.PI?y-=N.MathUtils.PI2:y<-N.MathUtils.PI&&(y+=N.MathUtils.PI2),y*=t,m=Math.cos(y),M=Math.sin(y),b.a=m*v-M*g,b.b=m*w-M*E,b.c=M*v+m*g,b.d=M*w+m*E,A=!0),0!=e&&(x=this.temp,r.localToWorld(x.set(this.data.offsetX,this.data.offsetY)),b.worldX+=x.x*e,b.worldY+=x.y*e,A=!0),0N.MathUtils.PI?y-=N.MathUtils.PI2:y<-N.MathUtils.PI&&(y+=N.MathUtils.PI2),w=b.b,E=b.d,y=Math.atan2(E,w)+(y-N.MathUtils.PI/2+c)*n,T=Math.sqrt(w*w+E*E),b.b=Math.cos(y)*T,b.d=Math.sin(y)*T,A=!0),A&&(b.appliedValid=!1)}},be.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,i=this.scaleMix,n=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,o=0,a=s.length;o>1,n=this.indicesArray,r=n.length=0;r>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},r.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},r.WHITE=new r(1,1,1,1),r.RED=new r(1,0,0,1),r.GREEN=new r(0,1,0,1),r.BLUE=new r(0,0,1,1),r.MAGENTA=new r(1,0,1,1),r);function r(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.r=t,this.g=e,this.b=i,this.a=n}t.Color=n;var s=(o.clamp=function(t,e,i){return t=e?t:g.setArraySize(t,e,i)},g.newArray=function(t,e){for(var i=new Array(t),n=0;nthis.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,1=this.values.length},R.prototype.addValue=function(t){this.addedValuesthis.values.length-1&&(this.lastValue=0),this.dirty=!0},R.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e>1)*s;var o=t.bone.skeleton,a=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;fthis.vertices.length)throw Error("Mesh can't store more than "+this.maxVertices()+" vertices");this.vertices.set(t,0),this.verticesLength=t.length},e.prototype.setIndices=function(t){if(this.dirtyIndices=!0,t.length>this.indices.length)throw Error("Mesh can't store more than "+this.maxIndices()+" indices");this.indices.set(t,0),this.indicesLength=t.length},e.prototype.draw=function(t,e){this.drawWithOffset(t,e,0,0this.mesh.getVertices().length||this.indicesLength+i.length>this.mesh.getIndices().length)&&this.flush();var n=this.mesh.numVertices();this.mesh.getVertices().set(e,this.verticesLength),this.verticesLength+=e.length,this.mesh.setVerticesLength(this.verticesLength);for(var r=this.mesh.getIndices(),s=this.indicesLength,o=0;o 0.");null===r&&(r=this.color);var o=2*zt.MathUtils.PI/s,a=Math.cos(o),h=Math.sin(o),l=n,u=0;if(t){for(this.check(Gt.Filled,3*s+3),s--,f=0;f>1))-2],w=f[p-1],v=0,g=p;v>1,f.numFloats=f.numVertices*E,f.numFloats>f.vertices.length&&(f.vertices=this.vertices=Qt.Utils.newFloatArray(f.numFloats)),S.computeWorldVertices(T,0,S.worldVerticesLength,f.vertices,0,E),p=S.triangles,A=S.region.renderObject.texture,d=S.uvs,g=S.color}if(null!=A){var C=T.color,I=this.tempColor;I.r=m.r*C.r*g.r,I.g=m.g*C.g*g.g,I.b=m.b*C.b*g.b,I.a=m.a*C.a*g.a,s&&(I.r*=I.a,I.g*=I.a,I.b*=I.a);var P=this.tempColor2;null==T.darkColor?P.set(0,0,0,1):(s?(P.r=T.darkColor.r*I.a,P.g=T.darkColor.g*I.a,P.b=T.darkColor.b*I.a):P.setFromColor(T.darkColor),P.a=s?1:0);var _=T.data.blendMode;if(_!=a&&(a=_,t.setBlendMode(Jt.WebGLBlendModeConverter.getSourceGLBlendMode(a,s),Jt.WebGLBlendModeConverter.getDestGLBlendMode(a))),r.isClipping()){r.clipTriangles(f.vertices,f.numFloats,p,p.length,d,I,P,o);var L=new Float32Array(r.clippedVertices),k=r.clippedTriangles;if(null!=this.vertexEffect){var O=this.vertexEffect,F=L;if(o)for(var V=0,D=L.length;V>16&255)/255,r=(t>>8&255)/255,s=(255&t)/255,o=16777215>>24)/255:null,a=this.skeleton;return!e||(i=this.findSlot(e))&&(a=i),a.color.r=n,a.color.g=r,a.color.b=s,null!==o&&(a.color.a=o),this},setSkeletonFromJSON:function(t,e,i,n){return this.setSkeleton(t,e,i,n)},setSkeleton:function(t,e,i,n){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,n);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,i),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(g.COMPLETE,t)},onDispose:function(t){this.emit(g.DISPOSE,t)},onEnd:function(t){this.emit(g.END,t)},onEvent:function(t,e){this.emit(g.EVENT,t,e)},onInterrupted:function(t){this.emit(g.INTERRUPTED,t)},onStart:function(t){this.emit(g.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,i,n){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===i&&(i=0),void 0===n&&(n=0),this.width=t,this.height=e,this.displayOriginX=r.x-i,this.displayOriginY=r.y-n,this},setOffset:function(t,e){var i=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=i.x-t,this.displayOriginY=i.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,i=this.scaleX,n=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=i,t.scaleY=n,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var i=0;i=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(1+(r-s)).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;ee.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},function(t,e,i){var h=i(5);t.exports=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=t.length);var s=[];if(h(t,n,r))for(var o=n;o=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i,n,r=t.indexOf(e);return-1!==r&&rt.length-1)throw new Error("Index out of bounds");var r=s(t,e);return i&&i.call(n,r),r}},function(t,e,i){var l=i(5);t.exports=function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),l(t,e,i)){var s=i-e,o=t.splice(e,s);if(n)for(var a=0;a=e&&t.y<=i&&t.y+t.height>=i)}},function(t,e,i){var o=i(59),a=i(60);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e,i){var n=i(9);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e,i){var f=i(300),d=i(9);t.exports=function(t,e,i,n){void 0===n&&(n=[]),!e&&0 any, path: string): void; + loadTexture(clientId: string, textureLoader: (image: HTMLImageElement | ImageBitmap) => any, path: string): void; get(clientId: string, path: string): any; private updateClientAssets; isLoadingComplete(clientId: string): boolean; @@ -881,9 +881,9 @@ declare module spine { } declare module spine { abstract class Texture { - protected _image: HTMLImageElement; - constructor(image: HTMLImageElement); - getImage(): HTMLImageElement; + protected _image: HTMLImageElement | ImageBitmap; + constructor(image: HTMLImageElement | ImageBitmap); + getImage(): HTMLImageElement | ImageBitmap; abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; abstract dispose(): void; @@ -1400,7 +1400,7 @@ declare module spine.webgl { private boundUnit; private useMipMaps; static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean; - constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean); + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps?: boolean); setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear; setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; @@ -1738,7 +1738,8 @@ declare module spine.webgl { canvas: HTMLCanvasElement | OffscreenCanvas; gl: WebGLRenderingContext; private restorables; - constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig?: any); + constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext | EventTarget | WebGL2RenderingContext, contextConfig?: any); + private setupCanvas; addRestorable(restorable: Restorable): void; removeRestorable(restorable: Restorable): void; } diff --git a/plugins/spine/src/runtimes/spine-both.js b/plugins/spine/src/runtimes/spine-both.js index 6b111df90..d4a6d36d4 100644 --- a/plugins/spine/src/runtimes/spine-both.js +++ b/plugins/spine/src/runtimes/spine-both.js @@ -3572,15 +3572,35 @@ var spine; path = this.pathPrefix + path; if (!this.queueAsset(clientId, textureLoader, path)) return; - var img = new Image(); - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - _this.rawAssets[path] = img; - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - }; - img.src = path; + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; + if (isWebWorker) { + var options = { mode: "cors" }; + fetch(path, options).then(function (response) { + if (!response.ok) { + _this.errors[path] = "Couldn't load image " + path; + } + return response.blob(); + }).then(function (blob) { + return createImageBitmap(blob, { + premultiplyAlpha: 'none', + colorSpaceConversion: 'none' + }); + }).then(function (bitmap) { + _this.rawAssets[path] = bitmap; + }); + } + else { + var img_1 = new Image(); + img_1.crossOrigin = "anonymous"; + img_1.onload = function (ev) { + _this.rawAssets[path] = img_1; + }; + img_1.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + img_1.src = path; + } }; SharedAssetManager.prototype.get = function (clientId, path) { path = this.pathPrefix + path; @@ -3590,6 +3610,8 @@ var spine; return clientAssets.assets[path]; }; SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; for (var i = 0; i < clientAssets.toLoad.length; i++) { var path = clientAssets.toLoad[i]; var asset = clientAssets.assets[path]; @@ -3597,11 +3619,21 @@ var spine; var rawAsset = this.rawAssets[path]; if (rawAsset === null || rawAsset === undefined) continue; - if (rawAsset instanceof HTMLImageElement) { - clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + if (isWebWorker) { + if (rawAsset instanceof ImageBitmap) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } else { - clientAssets.assets[path] = rawAsset; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } } } @@ -7749,7 +7781,7 @@ var spine; return _this; } BoundingBoxAttachment.prototype.copy = function () { - var copy = new BoundingBoxAttachment(name); + var copy = new BoundingBoxAttachment(this.name); this.copyTo(copy); copy.color.setFromColor(this.color); return copy; @@ -7768,7 +7800,7 @@ var spine; return _this; } ClippingAttachment.prototype.copy = function () { - var copy = new ClippingAttachment(name); + var copy = new ClippingAttachment(this.name); this.copyTo(copy); copy.endSlot = this.endSlot; copy.color.setFromColor(this.color); @@ -7912,7 +7944,7 @@ var spine; return _this; } PathAttachment.prototype.copy = function () { - var copy = new PathAttachment(name); + var copy = new PathAttachment(this.name); this.copyTo(copy); copy.lengths = new Array(this.lengths.length); spine.Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length); @@ -7946,7 +7978,7 @@ var spine; return Math.atan2(y, x) * spine.MathUtils.radDeg; }; PointAttachment.prototype.copy = function () { - var copy = new PointAttachment(name); + var copy = new PointAttachment(this.name); copy.x = this.x; copy.y = this.y; copy.rotation = this.rotation; @@ -10706,30 +10738,32 @@ var spine; (function (webgl) { var ManagedWebGLRenderingContext = (function () { function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { - var _this = this; if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } this.restorables = new Array(); - if (canvasOrContext instanceof HTMLCanvasElement) { - var canvas_1 = canvasOrContext; - this.gl = (canvas_1.getContext("webgl2", contextConfig) || canvas_1.getContext("webgl", contextConfig)); - this.canvas = canvas_1; - canvas_1.addEventListener("webglcontextlost", function (e) { - var event = e; - if (e) { - e.preventDefault(); - } - }); - canvas_1.addEventListener("webglcontextrestored", function (e) { - for (var i = 0, n = _this.restorables.length; i < n; i++) { - _this.restorables[i].restore(); - } - }); + if (canvasOrContext instanceof HTMLCanvasElement || canvasOrContext instanceof EventTarget) { + this.setupCanvas(canvasOrContext, contextConfig); } else { this.gl = canvasOrContext; this.canvas = this.gl.canvas; } } + ManagedWebGLRenderingContext.prototype.setupCanvas = function (canvas, contextConfig) { + var _this = this; + this.gl = (canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig)); + this.canvas = canvas; + canvas.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + }; ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { this.restorables.push(restorable); }; diff --git a/plugins/spine/src/runtimes/spine-both.js.map b/plugins/spine/src/runtimes/spine-both.js.map index 144b61c6d..97bbb7b27 100644 --- a/plugins/spine/src/runtimes/spine-both.js.map +++ b/plugins/spine/src/runtimes/spine-both.js.map @@ -1 +1 @@ -{"version":3,"file":"spine-both.js","sourceRoot":"","sources":["../../spine-runtimes/spine-ts/core/src/Animation.ts","../../spine-runtimes/spine-ts/core/src/AnimationState.ts","../../spine-runtimes/spine-ts/core/src/AnimationStateData.ts","../../spine-runtimes/spine-ts/core/src/AssetManager.ts","../../spine-runtimes/spine-ts/core/src/AtlasAttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/BlendMode.ts","../../spine-runtimes/spine-ts/core/src/Bone.ts","../../spine-runtimes/spine-ts/core/src/BoneData.ts","../../spine-runtimes/spine-ts/core/src/ConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Event.ts","../../spine-runtimes/spine-ts/core/src/EventData.ts","../../spine-runtimes/spine-ts/core/src/IkConstraint.ts","../../spine-runtimes/spine-ts/core/src/IkConstraintData.ts","../../spine-runtimes/spine-ts/core/src/PathConstraint.ts","../../spine-runtimes/spine-ts/core/src/PathConstraintData.ts","../../spine-runtimes/spine-ts/core/src/SharedAssetManager.ts","../../spine-runtimes/spine-ts/core/src/Skeleton.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBinary.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBounds.ts","../../spine-runtimes/spine-ts/core/src/SkeletonClipping.ts","../../spine-runtimes/spine-ts/core/src/SkeletonData.ts","../../spine-runtimes/spine-ts/core/src/SkeletonJson.ts","../../spine-runtimes/spine-ts/core/src/Skin.ts","../../spine-runtimes/spine-ts/core/src/Slot.ts","../../spine-runtimes/spine-ts/core/src/SlotData.ts","../../spine-runtimes/spine-ts/core/src/Texture.ts","../../spine-runtimes/spine-ts/core/src/TextureAtlas.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraint.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Triangulator.ts","../../spine-runtimes/spine-ts/core/src/Updatable.ts","../../spine-runtimes/spine-ts/core/src/Utils.ts","../../spine-runtimes/spine-ts/core/src/VertexEffect.ts","../../spine-runtimes/spine-ts/core/src/polyfills.ts","../../spine-runtimes/spine-ts/core/src/attachments/Attachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentType.ts","../../spine-runtimes/spine-ts/core/src/attachments/BoundingBoxAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/ClippingAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/MeshAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PathAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PointAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/RegionAttachment.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/JitterEffect.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/SwirlEffect.ts","../../spine-runtimes/spine-ts/canvas/src/AssetManager.ts","../../spine-runtimes/spine-ts/canvas/src/CanvasTexture.ts","../../spine-runtimes/spine-ts/canvas/src/SkeletonRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/AssetManager.ts","../../spine-runtimes/spine-ts/webgl/src/Camera.ts","../../spine-runtimes/spine-ts/webgl/src/GLTexture.ts","../../spine-runtimes/spine-ts/webgl/src/Matrix4.ts","../../spine-runtimes/spine-ts/webgl/src/Mesh.ts","../../spine-runtimes/spine-ts/webgl/src/PolygonBatcher.ts","../../spine-runtimes/spine-ts/webgl/src/SceneRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Shader.ts","../../spine-runtimes/spine-ts/webgl/src/ShapeRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonDebugRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Vector3.ts","../../spine-runtimes/spine-ts/webgl/src/WebGL.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,IAAO,KAAK,CAs/CX;AAt/CD,WAAO,KAAK;IAGX;QASC,mBAAa,IAAY,EAAE,SAA0B,EAAE,QAAgB;YACtE,IAAI,IAAI,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1D,IAAI,SAAS,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;Y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,CAAA;IACF,CAAC,EAtEY,KAAK,GAAL,WAAK,KAAL,WAAK,QAsEjB;AAAD,CAAC,EAtEM,KAAK,KAAL,KAAK,QAsEX"} \ No newline at end of file +{"version":3,"file":"spine-both.js","sourceRoot":"","sources":["../../spine-runtimes/spine-ts/core/src/Animation.ts","../../spine-runtimes/spine-ts/core/src/AnimationState.ts","../../spine-runtimes/spine-ts/core/src/AnimationStateData.ts","../../spine-runtimes/spine-ts/core/src/AssetManager.ts","../../spine-runtimes/spine-ts/core/src/AtlasAttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/BlendMode.ts","../../spine-runtimes/spine-ts/core/src/Bone.ts","../../spine-runtimes/spine-ts/core/src/BoneData.ts","../../spine-runtimes/spine-ts/core/src/ConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Event.ts","../../spine-runtimes/spine-ts/core/src/EventData.ts","../../spine-runtimes/spine-ts/core/src/IkConstraint.ts","../../spine-runtimes/spine-ts/core/src/IkConstraintData.ts","../../spine-runtimes/spine-ts/core/src/PathConstraint.ts","../../spine-runtimes/spine-ts/core/src/PathConstraintData.ts","../../spine-runtimes/spine-ts/core/src/SharedAssetManager.ts","../../spine-runtimes/spine-ts/core/src/Skeleton.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBinary.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBounds.ts","../../spine-runtimes/spine-ts/core/src/SkeletonClipping.ts","../../spine-runtimes/spine-ts/core/src/SkeletonData.ts","../../spine-runtimes/spine-ts/core/src/SkeletonJson.ts","../../spine-runtimes/spine-ts/core/src/Skin.ts","../../spine-runtimes/spine-ts/core/src/Slot.ts","../../spine-runtimes/spine-ts/core/src/SlotData.ts","../../spine-runtimes/spine-ts/core/src/Texture.ts","../../spine-runtimes/spine-ts/core/src/TextureAtlas.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraint.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Triangulator.ts","../../spine-runtimes/spine-ts/core/src/Updatable.ts","../../spine-runtimes/spine-ts/core/src/Utils.ts","../../spine-runtimes/spine-ts/core/src/VertexEffect.ts","../../spine-runtimes/spine-ts/core/src/polyfills.ts","../../spine-runtimes/spine-ts/core/src/attachments/Attachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentType.ts","../../spine-runtimes/spine-ts/core/src/attachments/BoundingBoxAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/ClippingAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/MeshAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PathAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PointAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/RegionAttachment.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/JitterEffect.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/SwirlEffect.ts","../../spine-runtimes/spine-ts/canvas/src/AssetManager.ts","../../spine-runtimes/spine-ts/canvas/src/CanvasTexture.ts","../../spine-runtimes/spine-ts/canvas/src/SkeletonRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/AssetManager.ts","../../spine-runtimes/spine-ts/webgl/src/Camera.ts","../../spine-runtimes/spine-ts/webgl/src/GLTexture.ts","../../spine-runtimes/spine-ts/webgl/src/Matrix4.ts","../../spine-runtimes/spine-ts/webgl/src/Mesh.ts","../../spine-runtimes/spine-ts/webgl/src/PolygonBatcher.ts","../../spine-runtimes/spine-ts/webgl/src/SceneRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Shader.ts","../../spine-runtimes/spine-ts/webgl/src/ShapeRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonDebugRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Vector3.ts","../../spine-runtimes/spine-ts/webgl/src/WebGL.ts"],"names":[],"mapp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G,CAAC,CAAC;YACT,2BAAG,GAAG,CAAC,CAAC;YACR,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAA;YAqB1B,8BAAC;SAAA,AA9BD,IA8BC;QA9BY,6BAAuB,0BA8BnC,CAAA;IACF,CAAC,EAzEY,KAAK,GAAL,WAAK,KAAL,WAAK,QAyEjB;AAAD,CAAC,EAzEM,KAAK,KAAL,KAAK,QAyEX"} \ No newline at end of file diff --git a/plugins/spine/src/runtimes/spine-canvas.d.ts b/plugins/spine/src/runtimes/spine-canvas.d.ts index 7087776a4..c6d67bc1f 100644 --- a/plugins/spine/src/runtimes/spine-canvas.d.ts +++ b/plugins/spine/src/runtimes/spine-canvas.d.ts @@ -636,7 +636,7 @@ declare module spine { private queueAsset; loadText(clientId: string, path: string): void; loadJson(clientId: string, path: string): void; - loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void; + loadTexture(clientId: string, textureLoader: (image: HTMLImageElement | ImageBitmap) => any, path: string): void; get(clientId: string, path: string): any; private updateClientAssets; isLoadingComplete(clientId: string): boolean; @@ -881,9 +881,9 @@ declare module spine { } declare module spine { abstract class Texture { - protected _image: HTMLImageElement; - constructor(image: HTMLImageElement); - getImage(): HTMLImageElement; + protected _image: HTMLImageElement | ImageBitmap; + constructor(image: HTMLImageElement | ImageBitmap); + getImage(): HTMLImageElement | ImageBitmap; abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; abstract dispose(): void; diff --git a/plugins/spine/src/runtimes/spine-canvas.js b/plugins/spine/src/runtimes/spine-canvas.js index 857507df4..7bf499fed 100644 --- a/plugins/spine/src/runtimes/spine-canvas.js +++ b/plugins/spine/src/runtimes/spine-canvas.js @@ -3572,15 +3572,35 @@ var spine; path = this.pathPrefix + path; if (!this.queueAsset(clientId, textureLoader, path)) return; - var img = new Image(); - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - _this.rawAssets[path] = img; - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - }; - img.src = path; + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; + if (isWebWorker) { + var options = { mode: "cors" }; + fetch(path, options).then(function (response) { + if (!response.ok) { + _this.errors[path] = "Couldn't load image " + path; + } + return response.blob(); + }).then(function (blob) { + return createImageBitmap(blob, { + premultiplyAlpha: 'none', + colorSpaceConversion: 'none' + }); + }).then(function (bitmap) { + _this.rawAssets[path] = bitmap; + }); + } + else { + var img_1 = new Image(); + img_1.crossOrigin = "anonymous"; + img_1.onload = function (ev) { + _this.rawAssets[path] = img_1; + }; + img_1.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + img_1.src = path; + } }; SharedAssetManager.prototype.get = function (clientId, path) { path = this.pathPrefix + path; @@ -3590,6 +3610,8 @@ var spine; return clientAssets.assets[path]; }; SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; for (var i = 0; i < clientAssets.toLoad.length; i++) { var path = clientAssets.toLoad[i]; var asset = clientAssets.assets[path]; @@ -3597,11 +3619,21 @@ var spine; var rawAsset = this.rawAssets[path]; if (rawAsset === null || rawAsset === undefined) continue; - if (rawAsset instanceof HTMLImageElement) { - clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + if (isWebWorker) { + if (rawAsset instanceof ImageBitmap) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } else { - clientAssets.assets[path] = rawAsset; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } } } @@ -7749,7 +7781,7 @@ var spine; return _this; } BoundingBoxAttachment.prototype.copy = function () { - var copy = new BoundingBoxAttachment(name); + var copy = new BoundingBoxAttachment(this.name); this.copyTo(copy); copy.color.setFromColor(this.color); return copy; @@ -7768,7 +7800,7 @@ var spine; return _this; } ClippingAttachment.prototype.copy = function () { - var copy = new ClippingAttachment(name); + var copy = new ClippingAttachment(this.name); this.copyTo(copy); copy.endSlot = this.endSlot; copy.color.setFromColor(this.color); @@ -7912,7 +7944,7 @@ var spine; return _this; } PathAttachment.prototype.copy = function () { - var copy = new PathAttachment(name); + var copy = new PathAttachment(this.name); this.copyTo(copy); copy.lengths = new Array(this.lengths.length); spine.Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length); @@ -7946,7 +7978,7 @@ var spine; return Math.atan2(y, x) * spine.MathUtils.radDeg; }; PointAttachment.prototype.copy = function () { - var copy = new PointAttachment(name); + var copy = new PointAttachment(this.name); copy.x = this.x; copy.y = this.y; copy.rotation = this.rotation; diff --git a/plugins/spine/src/runtimes/spine-canvas.js.map b/plugins/spine/src/runtimes/spine-canvas.js.map index 0c96e775c..95a8857a9 100644 --- a/plugins/spine/src/runtimes/spine-canvas.js.map +++ b/plugins/spine/src/runtimes/spine-canvas.js.map @@ -1 +1 @@ -{"version":3,"file":"spine-canvas.js","sourceRoot":"","sources":["../../spine-runtimes/spine-ts/core/src/Animation.ts","../../spine-runtimes/spine-ts/core/src/AnimationState.ts","../../spine-runtimes/spine-ts/core/src/AnimationStateData.ts","../../spine-runtimes/spine-ts/core/src/AssetManager.ts","../../spine-runtimes/spine-ts/core/src/AtlasAttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/BlendMode.ts","../../spine-runtimes/spine-ts/core/src/Bone.ts","../../spine-runtimes/spine-ts/core/src/BoneData.ts","../../spine-runtimes/spine-ts/core/src/ConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Event.ts","../../spine-runtimes/spine-ts/core/src/EventData.ts","../../spine-runtimes/spine-ts/core/src/IkConstraint.ts","../../spine-runtimes/spine-ts/core/src/IkConstraintData.ts","../../spine-runtimes/spine-ts/core/src/PathConstraint.ts","../../spine-runtimes/spine-ts/core/src/PathConstraintData.ts","../../spine-runtimes/spine-ts/core/src/SharedAssetManager.ts","../../spine-runtimes/spine-ts/core/src/Skeleton.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBinary.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBounds.ts","../../spine-runtimes/spine-ts/core/src/SkeletonClipping.ts","../../spine-runtimes/spine-ts/core/src/SkeletonData.ts","../../spine-runtimes/spine-ts/core/src/SkeletonJson.ts","../../spine-runtimes/spine-ts/core/src/Skin.ts","../../spine-runtimes/spine-ts/core/src/Slot.ts","../../spine-runtimes/spine-ts/core/src/SlotData.ts","../../spine-runtimes/spine-ts/core/src/Texture.ts","../../spine-runtimes/spine-ts/core/src/TextureAtlas.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraint.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Triangulator.ts","../../spine-runtimes/spine-ts/core/src/Updatable.ts","../../spine-runtimes/spine-ts/core/src/Utils.ts","../../spine-runtimes/spine-ts/core/src/VertexEffect.ts","../../spine-runtimes/spine-ts/core/src/polyfills.ts","../../spine-runtimes/spine-ts/core/src/attachments/Attachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentType.ts","../../spine-runtimes/spine-ts/core/src/attachments/BoundingBoxAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/ClippingAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/MeshAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PathAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PointAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/RegionAttachment.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/JitterEffect.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/SwirlEffect.ts","../../spine-runtimes/spine-ts/canvas/src/AssetManager.ts","../../spine-runtimes/spine-ts/canvas/src/CanvasTexture.ts","../../spine-runtimes/spine-ts/canvas/src/SkeletonRenderer.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,IAAO,KAAK,CAs/CX;AAt/CD,WAAO,KAAK;IAGX;QASC,mBAAa,IAAY,EAAE,SAA0B,EAAE,QAAgB;YACtE,IAAI,IAAI,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1D,IAAI,SAAS,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;gBACxC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC;YACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC;QAED,+BAAW,GAAX,UAAa,EAAU;YACtB,OAAO,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACrC,CAAC;QAOD,yBAAK,GAAL,UAAO,QAAkB,EAAE,QAAgB,EAAE,IAAY,EAAE,IAAa,EAAE,MAAoB,EAAE,KAAa,EAAE,KAAe,EAAE,SAAuB;YACtJ,IAAI,QAAQ,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,C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AI,CAAC,GAAG,CAAC;gBACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;oBAC1D,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;oBACxB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;oBACxB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;oBACxB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;oBACxB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;oBACzB,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;oBACzB,CAAC,IAAI,CAAC,CAAC;iBACP;gBAED,OAAO,QAAQ,CAAC;YACjB,CAAC;YArSM,+BAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACpC,4BAAW,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAqShC,uBAAC;SAAA,AAvSD,IAuSC;QAvSY,uBAAgB,mBAuS5B,CAAA;IACF,CAAC,EAzSY,MAAM,GAAN,YAAM,KAAN,YAAM,QAySlB;AAAD,CAAC,EAzSM,KAAK,KAAL,KAAK,QAySX"} \ No newline at end of file +{"version":3,"file":"spine-canvas.js","sourceRoot":"","sources":["../../spine-runtimes/spine-ts/core/src/Animation.ts","../../spine-runtimes/spine-ts/core/src/AnimationState.ts","../../spine-runtimes/spine-ts/core/src/AnimationStateData.ts","../../spine-runtimes/spine-ts/core/src/AssetManager.ts","../../spine-runtimes/spine-ts/core/src/AtlasAttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/BlendMode.ts","../../spine-runtimes/spine-ts/core/src/Bone.ts","../../spine-runtimes/spine-ts/core/src/BoneData.ts","../../spine-runtimes/spine-ts/core/src/ConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Event.ts","../../spine-runtimes/spine-ts/core/src/EventData.ts","../../spine-runtimes/spine-ts/core/src/IkConstraint.ts","../../spine-runtimes/spine-ts/core/src/IkConstraintData.ts","../../spine-runtimes/spine-ts/core/src/PathConstraint.ts","../../spine-runtimes/spine-ts/core/src/PathConstraintData.ts","../../spine-runtimes/spine-ts/core/src/SharedAssetManager.ts","../../spine-runtimes/spine-ts/core/src/Skeleton.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBinary.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBounds.ts","../../spine-runtimes/spine-ts/core/src/SkeletonClipping.ts","../../spine-runtimes/spine-ts/core/src/SkeletonData.ts","../../spine-runtimes/spine-ts/core/src/SkeletonJson.ts","../../spine-runtimes/spine-ts/core/src/Skin.ts","../../spine-runtimes/spine-ts/core/src/Slot.ts","../../spine-runtimes/spine-ts/core/src/SlotData.ts","../../spine-runtimes/spine-ts/core/src/Texture.ts","../../spine-runtimes/spine-ts/core/src/TextureAtlas.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraint.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Triangulator.ts","../../spine-runtimes/spine-ts/core/src/Updatable.ts","../../spine-runtimes/spine-ts/core/src/Utils.ts","../../spine-runtimes/spine-ts/core/src/VertexEffect.ts","../../spine-runtimes/spine-ts/core/src/polyfills.ts","../../spine-runtimes/spine-ts/core/src/attachments/Attachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentType.ts","../../spine-runtimes/spine-ts/core/src/attachments/BoundingBoxAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/ClippingAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/MeshAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PathAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PointAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/RegionAttachment.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/JitterEffect.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/SwirlEffect.ts","../../spine-runtimes/spine-ts/canvas/src/AssetManager.ts","../../spine-runtimes/spine-ts/canvas/src/CanvasTexture.ts","../../spine-runtimes/spine-ts/canvas/src/SkeletonRenderer.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,IAAO,KAAK,CAs/CX;AAt/CD,WAAO,KAAK;IAGX;QASC,mBAAa,IAAY,EAAE,SAA0B,EAAE,QAAgB;YACtE,IAAI,IAAI,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1D,IAAI,SAAS,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;gBACxC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC;YACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC;QAED,+BAAW,GAAX,UAAa,EAAU;YACtB,OAAO,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACrC,CAAC;QAOD,yBAAK,GAAL,UAAO,QAAkB,EAAE,QAAgB,EAAE,IAAY,EA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,QAySlB;AAAD,CAAC,EAzSM,KAAK,KAAL,KAAK,QAySX"} \ No newline at end of file diff --git a/plugins/spine/src/runtimes/spine-webgl.d.ts b/plugins/spine/src/runtimes/spine-webgl.d.ts index b209496a9..4ed271fe8 100644 --- a/plugins/spine/src/runtimes/spine-webgl.d.ts +++ b/plugins/spine/src/runtimes/spine-webgl.d.ts @@ -636,7 +636,7 @@ declare module spine { private queueAsset; loadText(clientId: string, path: string): void; loadJson(clientId: string, path: string): void; - loadTexture(clientId: string, textureLoader: (image: HTMLImageElement) => any, path: string): void; + loadTexture(clientId: string, textureLoader: (image: HTMLImageElement | ImageBitmap) => any, path: string): void; get(clientId: string, path: string): any; private updateClientAssets; isLoadingComplete(clientId: string): boolean; @@ -881,9 +881,9 @@ declare module spine { } declare module spine { abstract class Texture { - protected _image: HTMLImageElement; - constructor(image: HTMLImageElement); - getImage(): HTMLImageElement; + protected _image: HTMLImageElement | ImageBitmap; + constructor(image: HTMLImageElement | ImageBitmap); + getImage(): HTMLImageElement | ImageBitmap; abstract setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; abstract setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; abstract dispose(): void; @@ -1369,7 +1369,7 @@ declare module spine.webgl { private boundUnit; private useMipMaps; static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL: boolean; - constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement, useMipMaps?: boolean); + constructor(context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps?: boolean); setFilters(minFilter: TextureFilter, magFilter: TextureFilter): void; static validateMagFilter(magFilter: TextureFilter): TextureFilter.Nearest | TextureFilter.Linear | TextureFilter.Linear; setWraps(uWrap: TextureWrap, vWrap: TextureWrap): void; @@ -1707,7 +1707,8 @@ declare module spine.webgl { canvas: HTMLCanvasElement | OffscreenCanvas; gl: WebGLRenderingContext; private restorables; - constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig?: any); + constructor(canvasOrContext: HTMLCanvasElement | WebGLRenderingContext | EventTarget | WebGL2RenderingContext, contextConfig?: any); + private setupCanvas; addRestorable(restorable: Restorable): void; removeRestorable(restorable: Restorable): void; } diff --git a/plugins/spine/src/runtimes/spine-webgl.js b/plugins/spine/src/runtimes/spine-webgl.js index 587d47435..4e0308882 100644 --- a/plugins/spine/src/runtimes/spine-webgl.js +++ b/plugins/spine/src/runtimes/spine-webgl.js @@ -3572,15 +3572,35 @@ var spine; path = this.pathPrefix + path; if (!this.queueAsset(clientId, textureLoader, path)) return; - var img = new Image(); - img.crossOrigin = "anonymous"; - img.onload = function (ev) { - _this.rawAssets[path] = img; - }; - img.onerror = function (ev) { - _this.errors[path] = "Couldn't load image " + path; - }; - img.src = path; + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; + if (isWebWorker) { + var options = { mode: "cors" }; + fetch(path, options).then(function (response) { + if (!response.ok) { + _this.errors[path] = "Couldn't load image " + path; + } + return response.blob(); + }).then(function (blob) { + return createImageBitmap(blob, { + premultiplyAlpha: 'none', + colorSpaceConversion: 'none' + }); + }).then(function (bitmap) { + _this.rawAssets[path] = bitmap; + }); + } + else { + var img_1 = new Image(); + img_1.crossOrigin = "anonymous"; + img_1.onload = function (ev) { + _this.rawAssets[path] = img_1; + }; + img_1.onerror = function (ev) { + _this.errors[path] = "Couldn't load image " + path; + }; + img_1.src = path; + } }; SharedAssetManager.prototype.get = function (clientId, path) { path = this.pathPrefix + path; @@ -3590,6 +3610,8 @@ var spine; return clientAssets.assets[path]; }; SharedAssetManager.prototype.updateClientAssets = function (clientAssets) { + var isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document); + var isWebWorker = !isBrowser && typeof importScripts !== 'undefined'; for (var i = 0; i < clientAssets.toLoad.length; i++) { var path = clientAssets.toLoad[i]; var asset = clientAssets.assets[path]; @@ -3597,11 +3619,21 @@ var spine; var rawAsset = this.rawAssets[path]; if (rawAsset === null || rawAsset === undefined) continue; - if (rawAsset instanceof HTMLImageElement) { - clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + if (isWebWorker) { + if (rawAsset instanceof ImageBitmap) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } else { - clientAssets.assets[path] = rawAsset; + if (rawAsset instanceof HTMLImageElement) { + clientAssets.assets[path] = clientAssets.textureLoader(rawAsset); + } + else { + clientAssets.assets[path] = rawAsset; + } } } } @@ -7749,7 +7781,7 @@ var spine; return _this; } BoundingBoxAttachment.prototype.copy = function () { - var copy = new BoundingBoxAttachment(name); + var copy = new BoundingBoxAttachment(this.name); this.copyTo(copy); copy.color.setFromColor(this.color); return copy; @@ -7768,7 +7800,7 @@ var spine; return _this; } ClippingAttachment.prototype.copy = function () { - var copy = new ClippingAttachment(name); + var copy = new ClippingAttachment(this.name); this.copyTo(copy); copy.endSlot = this.endSlot; copy.color.setFromColor(this.color); @@ -7912,7 +7944,7 @@ var spine; return _this; } PathAttachment.prototype.copy = function () { - var copy = new PathAttachment(name); + var copy = new PathAttachment(this.name); this.copyTo(copy); copy.lengths = new Array(this.lengths.length); spine.Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length); @@ -7946,7 +7978,7 @@ var spine; return Math.atan2(y, x) * spine.MathUtils.radDeg; }; PointAttachment.prototype.copy = function () { - var copy = new PointAttachment(name); + var copy = new PointAttachment(this.name); copy.x = this.x; copy.y = this.y; copy.rotation = this.rotation; @@ -10438,30 +10470,32 @@ var spine; (function (webgl) { var ManagedWebGLRenderingContext = (function () { function ManagedWebGLRenderingContext(canvasOrContext, contextConfig) { - var _this = this; if (contextConfig === void 0) { contextConfig = { alpha: "true" }; } this.restorables = new Array(); - if (canvasOrContext instanceof HTMLCanvasElement) { - var canvas = canvasOrContext; - this.gl = (canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig)); - this.canvas = canvas; - canvas.addEventListener("webglcontextlost", function (e) { - var event = e; - if (e) { - e.preventDefault(); - } - }); - canvas.addEventListener("webglcontextrestored", function (e) { - for (var i = 0, n = _this.restorables.length; i < n; i++) { - _this.restorables[i].restore(); - } - }); + if (canvasOrContext instanceof HTMLCanvasElement || canvasOrContext instanceof EventTarget) { + this.setupCanvas(canvasOrContext, contextConfig); } else { this.gl = canvasOrContext; this.canvas = this.gl.canvas; } } + ManagedWebGLRenderingContext.prototype.setupCanvas = function (canvas, contextConfig) { + var _this = this; + this.gl = (canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig)); + this.canvas = canvas; + canvas.addEventListener("webglcontextlost", function (e) { + var event = e; + if (e) { + e.preventDefault(); + } + }); + canvas.addEventListener("webglcontextrestored", function (e) { + for (var i = 0, n = _this.restorables.length; i < n; i++) { + _this.restorables[i].restore(); + } + }); + }; ManagedWebGLRenderingContext.prototype.addRestorable = function (restorable) { this.restorables.push(restorable); }; diff --git a/plugins/spine/src/runtimes/spine-webgl.js.map b/plugins/spine/src/runtimes/spine-webgl.js.map index 75abe5be3..fe9df427e 100644 --- a/plugins/spine/src/runtimes/spine-webgl.js.map +++ b/plugins/spine/src/runtimes/spine-webgl.js.map @@ -1 +1 @@ -{"version":3,"file":"spine-webgl.js","sourceRoot":"","sources":["../../spine-runtimes/spine-ts/core/src/Animation.ts","../../spine-runtimes/spine-ts/core/src/AnimationState.ts","../../spine-runtimes/spine-ts/core/src/AnimationStateData.ts","../../spine-runtimes/spine-ts/core/src/AssetManager.ts","../../spine-runtimes/spine-ts/core/src/AtlasAttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/BlendMode.ts","../../spine-runtimes/spine-ts/core/src/Bone.ts","../../spine-runtimes/spine-ts/core/src/BoneData.ts","../../spine-runtimes/spine-ts/core/src/ConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Event.ts","../../spine-runtimes/spine-ts/core/src/EventData.ts","../../spine-runtimes/spine-ts/core/src/IkConstraint.ts","../../spine-runtimes/spine-ts/core/src/IkConstraintData.ts","../../spine-runtimes/spine-ts/core/src/PathConstraint.ts","../../spine-runtimes/spine-ts/core/src/PathConstraintData.ts","../../spine-runtimes/spine-ts/core/src/SharedAssetManager.ts","../../spine-runtimes/spine-ts/core/src/Skeleton.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBinary.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBounds.ts","../../spine-runtimes/spine-ts/core/src/SkeletonClipping.ts","../../spine-runtimes/spine-ts/core/src/SkeletonData.ts","../../spine-runtimes/spine-ts/core/src/SkeletonJson.ts","../../spine-runtimes/spine-ts/core/src/Skin.ts","../../spine-runtimes/spine-ts/core/src/Slot.ts","../../spine-runtimes/spine-ts/core/src/SlotData.ts","../../spine-runtimes/spine-ts/core/src/Texture.ts","../../spine-runtimes/spine-ts/core/src/TextureAtlas.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraint.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Triangulator.ts","../../spine-runtimes/spine-ts/core/src/Updatable.ts","../../spine-runtimes/spine-ts/core/src/Utils.ts","../../spine-runtimes/spine-ts/core/src/VertexEffect.ts","../../spine-runtimes/spine-ts/core/src/polyfills.ts","../../spine-runtimes/spine-ts/core/src/attachments/Attachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentType.ts","../../spine-runtimes/spine-ts/core/src/attachments/BoundingBoxAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/ClippingAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/MeshAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PathAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PointAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/RegionAttachment.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/JitterEffect.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/SwirlEffect.ts","../../spine-runtimes/spine-ts/webgl/src/AssetManager.ts","../../spine-runtimes/spine-ts/webgl/src/Camera.ts","../../spine-runtimes/spine-ts/webgl/src/GLTexture.ts","../../spine-runtimes/spine-ts/webgl/src/Matrix4.ts","../../spine-runtimes/spine-ts/webgl/src/Mesh.ts","../../spine-runtimes/spine-ts/webgl/src/PolygonBatcher.ts","../../spine-runtimes/spine-ts/webgl/src/SceneRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Shader.ts","../../spine-runtimes/spine-ts/webgl/src/ShapeRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonDebugRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Vector3.ts","../../spine-runtimes/spine-ts/webgl/src/WebGL.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,IAAO,KAAK,CAs/CX;AAt/CD,WAAO,KAAK;IAGX;QASC,mBAAa,IAAY,EAAE,SAA0B,EAAE,QAAgB;YACtE,IAAI,IAAI,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1D,IAAI,SAAS,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;gBACxC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC;YACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC;QAED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,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,uBAAuB,CAAC,GAAG,CAAC;oBAC1D,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;iBAC7D;YACF,CAAC;YA5BM,4BAAI,GAAG,CAAC,CAAC;YACT,2BAAG,GAAG,CAAC,CAAC;YACR,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAA;YAqB1B,8BAAC;SAAA,AA9BD,IA8BC;QA9BY,6BAAuB,0BA8BnC,CAAA;IACF,CAAC,EAtEY,KAAK,GAAL,WAAK,KAAL,WAAK,QAsEjB;AAAD,CAAC,EAtEM,KAAK,KAAL,KAAK,QAsEX"} \ No newline at end of file +{"version":3,"file":"spine-webgl.js","sourceRoot":"","sources":["../../spine-runtimes/spine-ts/core/src/Animation.ts","../../spine-runtimes/spine-ts/core/src/AnimationState.ts","../../spine-runtimes/spine-ts/core/src/AnimationStateData.ts","../../spine-runtimes/spine-ts/core/src/AssetManager.ts","../../spine-runtimes/spine-ts/core/src/AtlasAttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/BlendMode.ts","../../spine-runtimes/spine-ts/core/src/Bone.ts","../../spine-runtimes/spine-ts/core/src/BoneData.ts","../../spine-runtimes/spine-ts/core/src/ConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Event.ts","../../spine-runtimes/spine-ts/core/src/EventData.ts","../../spine-runtimes/spine-ts/core/src/IkConstraint.ts","../../spine-runtimes/spine-ts/core/src/IkConstraintData.ts","../../spine-runtimes/spine-ts/core/src/PathConstraint.ts","../../spine-runtimes/spine-ts/core/src/PathConstraintData.ts","../../spine-runtimes/spine-ts/core/src/SharedAssetManager.ts","../../spine-runtimes/spine-ts/core/src/Skeleton.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBinary.ts","../../spine-runtimes/spine-ts/core/src/SkeletonBounds.ts","../../spine-runtimes/spine-ts/core/src/SkeletonClipping.ts","../../spine-runtimes/spine-ts/core/src/SkeletonData.ts","../../spine-runtimes/spine-ts/core/src/SkeletonJson.ts","../../spine-runtimes/spine-ts/core/src/Skin.ts","../../spine-runtimes/spine-ts/core/src/Slot.ts","../../spine-runtimes/spine-ts/core/src/SlotData.ts","../../spine-runtimes/spine-ts/core/src/Texture.ts","../../spine-runtimes/spine-ts/core/src/TextureAtlas.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraint.ts","../../spine-runtimes/spine-ts/core/src/TransformConstraintData.ts","../../spine-runtimes/spine-ts/core/src/Triangulator.ts","../../spine-runtimes/spine-ts/core/src/Updatable.ts","../../spine-runtimes/spine-ts/core/src/Utils.ts","../../spine-runtimes/spine-ts/core/src/VertexEffect.ts","../../spine-runtimes/spine-ts/core/src/polyfills.ts","../../spine-runtimes/spine-ts/core/src/attachments/Attachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentLoader.ts","../../spine-runtimes/spine-ts/core/src/attachments/AttachmentType.ts","../../spine-runtimes/spine-ts/core/src/attachments/BoundingBoxAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/ClippingAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/MeshAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PathAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/PointAttachment.ts","../../spine-runtimes/spine-ts/core/src/attachments/RegionAttachment.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/JitterEffect.ts","../../spine-runtimes/spine-ts/core/src/vertexeffects/SwirlEffect.ts","../../spine-runtimes/spine-ts/webgl/src/AssetManager.ts","../../spine-runtimes/spine-ts/webgl/src/Camera.ts","../../spine-runtimes/spine-ts/webgl/src/GLTexture.ts","../../spine-runtimes/spine-ts/webgl/src/Matrix4.ts","../../spine-runtimes/spine-ts/webgl/src/Mesh.ts","../../spine-runtimes/spine-ts/webgl/src/PolygonBatcher.ts","../../spine-runtimes/spine-ts/webgl/src/SceneRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Shader.ts","../../spine-runtimes/spine-ts/webgl/src/ShapeRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonDebugRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/SkeletonRenderer.ts","../../spine-runtimes/spine-ts/webgl/src/Vector3.ts","../../spine-runtimes/spine-ts/webgl/src/WebGL.ts"],"names":[],"mappings":";;;;;;;;;;;;;AA6BA,IAAO,KAAK,CAs/CX;AAt/CD,WAAO,KAAK;IAGX;QASC,mBAAa,IAAY,EAAE,SAA0B,EAAE,QAAgB;YACtE,IAAI,IAAI,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;YAC1D,IAAI,SAAS,IAAI,IAAI;gBAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAC3B,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;YACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE;gBACxC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC;YACvD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC1B,CAAC;QAED,+BAAW,GAAX,UAAa,EAAU;YACtB,OAAO,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC;QACrC,CAAC;QAOD,yBAAK,GAAL,UAAO,QAAkB,EAAE,QAAgB,EAAE,IAAY,EAAE,IAAa,EA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AS,CAAC,QAAQ,CAAC,CAAC,OAAO,uBAAuB,CAAC,SAAS,CAAC;oBAClE,KAAK,MAAA,SAAS,CAAC,MAAM,CAAC,CAAC,OAAO,uBAAuB,CAAC,GAAG,CAAC;oBAC1D,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAAC;iBAC7D;YACF,CAAC;YA5BM,4BAAI,GAAG,CAAC,CAAC;YACT,2BAAG,GAAG,CAAC,CAAC;YACR,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAC;YACnB,2CAAmB,GAAG,MAAM,CAAC;YAC7B,iCAAS,GAAG,MAAM,CAAA;YAqB1B,8BAAC;SAAA,AA9BD,IA8BC;QA9BY,6BAAuB,0BA8BnC,CAAA;IACF,CAAC,EAzEY,KAAK,GAAL,WAAK,KAAL,WAAK,QAyEjB;AAAD,CAAC,EAzEM,KAAK,KAAL,KAAK,QAyEX"} \ No newline at end of file diff --git a/plugins/spine/tsconfig.both.json b/plugins/spine/tsconfig.both.json index 57142d4a7..6eaf2fb95 100644 --- a/plugins/spine/tsconfig.both.json +++ b/plugins/spine/tsconfig.both.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "moduleResolution": "node", "module": "none", "noImplicitAny": true, "removeComments": true, @@ -20,4 +21,4 @@ "spine-runtimes/spine-ts/webgl/src/Input.ts", "spine-runtimes/spine-ts/webgl/src/LoadingScreen.ts" ] -} \ No newline at end of file +} diff --git a/plugins/spine/tsconfig.canvas.json b/plugins/spine/tsconfig.canvas.json index f73ce7912..a87de80ae 100644 --- a/plugins/spine/tsconfig.canvas.json +++ b/plugins/spine/tsconfig.canvas.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "moduleResolution": "node", "module": "none", "noImplicitAny": true, "removeComments": true, @@ -19,4 +20,4 @@ "spine-runtimes/spine-ts/build", "spine-runtimes/spine-ts/player" ] -} \ No newline at end of file +} diff --git a/plugins/spine/tsconfig.webgl.json b/plugins/spine/tsconfig.webgl.json index ff4520f71..6e66e762d 100644 --- a/plugins/spine/tsconfig.webgl.json +++ b/plugins/spine/tsconfig.webgl.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "moduleResolution": "node", "module": "none", "noImplicitAny": true, "removeComments": true, @@ -20,4 +21,4 @@ "spine-runtimes/spine-ts/webgl/src/Input.ts", "spine-runtimes/spine-ts/webgl/src/LoadingScreen.ts" ] -} \ No newline at end of file +} diff --git a/scripts/bundle-layer3d-shaders.js b/scripts/bundle-layer3d-shaders.js new file mode 100644 index 000000000..8594c30a7 --- /dev/null +++ b/scripts/bundle-layer3d-shaders.js @@ -0,0 +1,46 @@ +let fs = require('fs-extra'); + +let srcdir = './src/layer3d/shaders/chunks/glsl/'; +let destdir = './src/layer3d/shaders/chunks/'; + +let files = fs.readdirSync(srcdir); + +files.forEach(function (file) { + + let shaderSource = fs.readFileSync(srcdir + file, 'utf8'); + let shaderFilename = file.substr(0, file.lastIndexOf('.')) + '.js'; + + let outputSource = 'module.exports = [\n'; + + let lines = shaderSource.split('\n'); + + for (var i = 0; i < lines.length; i++) + { + let line = lines[i].trimRight(); + + if (i < lines.length - 1) + { + outputSource = outputSource.concat(" '" + line + "',\n"); + } + else + { + outputSource = outputSource.concat(" '" + line + "'\n"); + } + } + + outputSource = outputSource.concat('].join(\'\\n\');\n'); + + fs.writeFile(destdir + shaderFilename, outputSource, function (error) { + + if (error) + { + throw error; + } + else + { + console.log('Saved', shaderFilename); + } + + }); + +}); diff --git a/scripts/help.js b/scripts/help.js index a671d5d92..137a6f8a2 100644 --- a/scripts/help.js +++ b/scripts/help.js @@ -1,5 +1,5 @@ var v = require('vivid-cli'); - + v.log('{bgYellow}{black} __________.__ ________ '); v.log('{bgYellow}{black} \\______ \\ |__ _____ ______ ___________ \\_____ \\ '); v.log('{bgYellow}{black} | ___/ | \\\\__ \\ / ___// __ \\_ __ \\ _(__ < '); @@ -11,12 +11,21 @@ v.log('{bgYellow}{black} Available commands: v.log('{white} npm run {green}build {cyan} Build dev version of Phaser with Webpack'); v.log('{white} npm run {green}watch {cyan} Build dev & put Webpack in watch mode'); v.log('{white} npm run {green}dist {cyan} Build dist versions of Phaser'); +v.log('{white} npm run {green}dist3d {cyan} Build dist versions of Phaser 3D'); v.log('{white} npm run {green}lint {cyan} ESLint check Phaser source'); v.log('{white} npm run {green}lintfix {cyan} ESLint check and fix Phaser source'); v.log('{white} npm run {green}sloc {cyan} Get source code & comments line count'); v.log('{white} npm run {green}bundleshaders {cyan} Convert vert/frag shaders to js'); v.log('{white} npm run {green}plugin.cam3d {cyan} Build Camera3D Plugin'); v.log(''); +v.log(' {white}{bold}Spine Plugin{/bold}'); +v.log(''); +v.log('{white} npm run {green}plugin.spine.watch {cyan} Spine Plugin Watch Mode'); +v.log('{white} npm run {green}plugin.spine.dev {cyan} Build Debug Spine Plugin'); +v.log('{white} npm run {green}plugin.spine.runtimes {cyan} Build Spine Runtimes'); +v.log('{white} npm run {green}plugin.spine.dist {cyan} Build Spine Plugin'); +v.log('{white} npm run {green}plugin.spine.full.dist {cyan} Build Full Plugin'); +v.log(''); v.log(' {white}{bold}Facebook Instant Games{/bold}'); v.log(''); v.log('{white} npm run {green}buildfb {cyan} Build dev Phaser FB with Webpack'); diff --git a/scripts/tsgen/bin/Parser.js b/scripts/tsgen/bin/Parser.js index 0b80d39ec..1eb5505d9 100644 --- a/scripts/tsgen/bin/Parser.js +++ b/scripts/tsgen/bin/Parser.js @@ -36,9 +36,11 @@ class Parser { return result; } parseObjects(docs) { + console.log('------------------------------------------------------------------'); + console.log('Parse Objects'); + console.log('------------------------------------------------------------------'); for (let i = 0; i < docs.length; i++) { let doclet = docs[i]; - // TODO: Custom temporary rules switch (doclet.longname) { case 'Phaser.GameObjects.Components.Alpha': case 'Phaser.GameObjects.Components.AlphaSingle': @@ -61,7 +63,6 @@ class Parser { case 'Phaser.GameObjects.Components.ToJSON': case 'Phaser.GameObjects.Components.Transform': case 'Phaser.GameObjects.Components.Visible': - case 'Phaser.Renderer.WebGL.Pipelines.ModelViewProjection': doclet.kind = 'mixin'; break; // Because, sod you TypeScript @@ -74,6 +75,7 @@ class Parser { case 'Phaser.Scale.ScaleModes': case 'Phaser.Scale.Zoom': case 'Phaser.Textures.FilterMode': + case 'Phaser.Tilemaps.Orientation': // console.log('Forcing enum for ' + doclet.longname); doclet.kind = 'member'; doclet.isEnum = true; @@ -82,6 +84,7 @@ class Parser { if ((doclet.longname.indexOf('Phaser.Physics.Arcade.Components.') == 0 || doclet.longname.indexOf('Phaser.Physics.Impact.Components.') == 0 || doclet.longname.indexOf('Phaser.Physics.Matter.Components.') == 0) && doclet.longname.indexOf('#') == -1) { doclet.kind = 'mixin'; } + // console.log(`Name: ${doclet.longname} - Kind: ${doclet.kind}`); let obj; let container = this.objects; switch (doclet.kind) { @@ -131,12 +134,15 @@ class Parser { } } resolveObjects(docs) { + console.log('------------------------------------------------------------------'); + console.log('Resolve Objects'); + console.log('------------------------------------------------------------------'); let allTypes = new Set(); for (let doclet of docs) { - let obj = doclet.kind === 'namespace' ? this.namespaces[doclet.longname] : this.objects[doclet.longname]; + let obj = (doclet.kind === 'namespace') ? this.namespaces[doclet.longname] : this.objects[doclet.longname]; if (!obj) { - // TODO - console.log(`Warning: Didn't find object for ${doclet.longname}`); + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`Warning: Didn't find object`); continue; } if (!doclet.memberof) { @@ -145,49 +151,31 @@ class Parser { else { let isNamespaceMember = doclet.kind === 'class' || doclet.kind === 'typedef' || doclet.kind == 'namespace' || doclet.isEnum; let parent = isNamespaceMember ? this.namespaces[doclet.memberof] : (this.objects[doclet.memberof] || this.namespaces[doclet.memberof]); - //TODO: this whole section should be removed once stable if (!parent) { - console.log(`${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); - let parts = doclet.memberof.split('.'); - let newParts = [parts.pop()]; - while (parts.length > 0 && this.objects[parts.join('.')] == null) - newParts.unshift(parts.pop()); - parent = this.objects[parts.join('.')]; - if (parent == null) { - parent = dom.create.namespace(doclet.memberof); - this.namespaces[doclet.memberof] = parent; - this.topLevel.push(parent); - } - else { - while (newParts.length > 0) { - let oldParent = parent; - parent = dom.create.namespace(newParts.shift()); - parts.push(parent.name); - this.namespaces[parts.join('.')] = parent; - oldParent.members.push(parent); - parent._parent = oldParent; - } - } + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`PARENT WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); } - /////////////////////////////////////////////////////// if (parent.members) { parent.members.push(obj); } else { - console.log('Cannot find members array for:'); + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log('Could not find members array'); console.log(parent); } obj._parent = parent; - // class/interface members have methods, not functions - if ((parent.kind === 'class' || parent.kind === 'interface') - && obj.kind === 'function') + // class / interface members have methods, not functions + if ((parent.kind === 'class' || parent.kind === 'interface') && obj.kind === 'function') { obj.kind = 'method'; + } // namespace members are vars or consts, not properties if (parent.kind === 'namespace' && obj.kind === 'property') { - if (doclet.kind == 'constant') + if (doclet.kind == 'constant') { obj.kind = 'const'; - else + } + else { obj.kind = 'var'; + } } } } @@ -196,16 +184,17 @@ class Parser { for (let doclet of docs) { let obj = doclet.kind === 'namespace' ? this.namespaces[doclet.longname] : this.objects[doclet.longname]; if (!obj) { - // TODO console.log(`Didn't find type ${doclet.longname} ???`); continue; } if (!obj._parent) continue; - if (doclet.inherited) { // remove inherited members if they aren't from an interface + if (doclet.inherited) { + // remove inherited members if they aren't from an interface let from = this.objects[doclet.inherits]; - if (!from || !from._parent) + if (!from || !from._parent) { throw `'${doclet.longname}' should inherit from '${doclet.inherits}', which is not defined.`; + } if (from._parent.kind != 'interface') { obj._parent.members.splice(obj._parent.members.indexOf(obj), 1); obj._parent = null; @@ -348,7 +337,10 @@ class Parser { let optional = false; obj.jsDocComment = ''; for (let paramDoc of doclet.params) { - // TODO REMOVE TEMP FIX + if (!paramDoc.name) { + console.log(`Docs Error in '${doclet.longname}' in ${doclet.meta.filename}@${doclet.meta.lineno}`); + console.info(paramDoc); + } if (paramDoc.name.indexOf('.') != -1) { console.log(`Warning: ignoring param with '.' for '${doclet.longname}' in ${doclet.meta.filename}@${doclet.meta.lineno}`); let defaultVal = paramDoc.defaultvalue !== undefined ? ` Default ${String(paramDoc.defaultvalue)}.` : ''; @@ -358,7 +350,6 @@ class Parser { obj.jsDocComment += `\n@param ${paramDoc.name} ` + defaultVal; continue; } - /////////////////////// let param = dom.create.parameter(paramDoc.name, this.parseType(paramDoc)); parameters.push(param); if (optional && paramDoc.optional != true) { diff --git a/scripts/tsgen/bin/Parser.js.map b/scripts/tsgen/bin/Parser.js.map index bc09d1631..23402d97f 100644 --- a/scripts/tsgen/bin/Parser.js.map +++ b/scripts/tsgen/bin/Parser.js.map @@ -1 +1 @@ -{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../src/Parser.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC,MAAa,MAAM;IAMf,YAAY,IAAW;QAEnB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QAErB,qDAAqD;QACrD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAExB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,yCAAyC;QACzC,yIAAyI;QACzI,kDAAkD;QAClD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAE1B,oBAAoB;QACpB,IAAI,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IAAI,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzC,IAAI,MAAM,IAAI,IAAI,EAAE;oBAChB,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE;wBACtB,IAAI,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;4BACrC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;yBAC5D;qBACJ;iBACJ;gBACD,IAAI,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAC,kCAAkC;oBAC7C,GAAI,CAAC,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;iBAC3F;gBACD,IAAI,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAC,gCAAgC;oBACzC,GAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;iBACrF;aACJ;QACL,CAAC;IACL,CAAC;CAEJ;AA5nBD,wBA4nBC"} \ No newline at end of file diff --git a/scripts/tsgen/jsdoc-tsd.conf.json b/scripts/tsgen/jsdoc-tsd.conf.json index bdc27ac3c..2545e83be 100644 --- a/scripts/tsgen/jsdoc-tsd.conf.json +++ b/scripts/tsgen/jsdoc-tsd.conf.json @@ -12,7 +12,8 @@ "../../src/phaser-core.js", "../../src/physics/matter-js/poly-decomp/", "../../src/physics/matter-js/lib", - "../../src/polyfills" + "../../src/polyfills", + "../../src/layer3d" ], "includePattern": ".+\\.js?$", "excludePattern": "(^|\\/|\\\\)_" @@ -30,4 +31,4 @@ "lenient": true, "sourceType": "script" } -} \ No newline at end of file +} diff --git a/scripts/tsgen/src/Parser.ts b/scripts/tsgen/src/Parser.ts index b61480f3b..298812b54 100644 --- a/scripts/tsgen/src/Parser.ts +++ b/scripts/tsgen/src/Parser.ts @@ -31,7 +31,9 @@ export class Parser { // add declare module const phaserPkgModuleDOM = dom.create.module('phaser'); + phaserPkgModuleDOM.members.push(dom.create.exportEquals('Phaser')); + this.topLevel.push(phaserPkgModuleDOM); } @@ -55,11 +57,15 @@ export class Parser { } private parseObjects(docs: any[]) { + + console.log('------------------------------------------------------------------'); + console.log('Parse Objects'); + console.log('------------------------------------------------------------------'); + for (let i = 0; i < docs.length; i++) { let doclet = docs[i]; - // TODO: Custom temporary rules switch (doclet.longname) { case 'Phaser.GameObjects.Components.Alpha': @@ -83,7 +89,6 @@ export class Parser { case 'Phaser.GameObjects.Components.ToJSON': case 'Phaser.GameObjects.Components.Transform': case 'Phaser.GameObjects.Components.Visible': - case 'Phaser.Renderer.WebGL.Pipelines.ModelViewProjection': doclet.kind = 'mixin'; break; @@ -97,6 +102,7 @@ export class Parser { case 'Phaser.Scale.ScaleModes': case 'Phaser.Scale.Zoom': case 'Phaser.Textures.FilterMode': + case 'Phaser.Tilemaps.Orientation': // console.log('Forcing enum for ' + doclet.longname); doclet.kind = 'member'; doclet.isEnum = true; @@ -108,6 +114,8 @@ export class Parser { doclet.kind = 'mixin'; } + // console.log(`Name: ${doclet.longname} - Kind: ${doclet.kind}`); + let obj: dom.DeclarationBase; let container = this.objects; @@ -144,14 +152,19 @@ export class Parser { break; } - if (obj) { - if (container[doclet.longname]) { + if (obj) + { + if (container[doclet.longname]) + { console.log('Warning: ignoring duplicate doc name: ' + doclet.longname); docs.splice(i--, 1); continue; } + container[doclet.longname] = obj; - if (doclet.description) { + + if (doclet.description) + { let otherDocs = obj.jsDocComment || ''; obj.jsDocComment = doclet.description.replace(regexEndLine, '$1\n') + otherDocs; } @@ -159,89 +172,103 @@ export class Parser { } } - private resolveObjects(docs: any[]) { + private resolveObjects(docs: any[]) + { + console.log('------------------------------------------------------------------'); + console.log('Resolve Objects'); + console.log('------------------------------------------------------------------'); + let allTypes = new Set(); - for (let doclet of docs) { - let obj = doclet.kind === 'namespace' ? this.namespaces[doclet.longname] : this.objects[doclet.longname]; - if (!obj) { + for (let doclet of docs) + { + let obj = (doclet.kind === 'namespace') ? this.namespaces[doclet.longname] : this.objects[doclet.longname]; - // TODO - console.log(`Warning: Didn't find object for ${doclet.longname}`); + if (!obj) + { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`Warning: Didn't find object`); continue; } - if (!doclet.memberof) { + if (!doclet.memberof) + { this.topLevel.push(obj as dom.TopLevelDeclaration); - } else { + } + else + { let isNamespaceMember = doclet.kind === 'class' || doclet.kind === 'typedef' || doclet.kind == 'namespace' || doclet.isEnum; + let parent = isNamespaceMember ? this.namespaces[doclet.memberof] : (this.objects[doclet.memberof] || this.namespaces[doclet.memberof]); - //TODO: this whole section should be removed once stable - if (!parent) { - console.log(`${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); - let parts: string[] = doclet.memberof.split('.'); - let newParts = [parts.pop()]; - while (parts.length > 0 && this.objects[parts.join('.')] == null) newParts.unshift(parts.pop()); - parent = this.objects[parts.join('.')] as dom.NamespaceDeclaration; - if (parent == null) { - parent = dom.create.namespace(doclet.memberof); - this.namespaces[doclet.memberof] = parent; - this.topLevel.push(parent); - } else { - while (newParts.length > 0) { - let oldParent = parent; - parent = dom.create.namespace(newParts.shift()); - parts.push((parent).name); - this.namespaces[parts.join('.')] = parent; - oldParent.members.push(parent); - (parent)._parent = oldParent; - } - } + if (!parent) + { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log(`PARENT WARNING: ${doclet.longname} in ${doclet.meta.filename}@${doclet.meta.lineno} has parent '${doclet.memberof}' that is not defined.`); } - /////////////////////////////////////////////////////// - if ((parent).members) { + if ((parent).members) + { (parent).members.push(obj); - } else { - console.log('Cannot find members array for:'); + } + else + { + console.log(`${doclet.longname} - Kind: ${doclet.kind}`); + console.log('Could not find members array'); console.log(parent); } (obj)._parent = parent; - // class/interface members have methods, not functions - if (((parent as any).kind === 'class' || (parent as any).kind === 'interface') - && (obj as any).kind === 'function') + // class / interface members have methods, not functions + if (((parent as any).kind === 'class' || (parent as any).kind === 'interface') && (obj as any).kind === 'function') + { (obj as any).kind = 'method'; + } + // namespace members are vars or consts, not properties - if ((parent as any).kind === 'namespace' && (obj as any).kind === 'property') { - if (doclet.kind == 'constant') (obj as any).kind = 'const'; - else (obj as any).kind = 'var'; + if ((parent as any).kind === 'namespace' && (obj as any).kind === 'property') + { + if (doclet.kind == 'constant') + { + (obj as any).kind = 'const'; + } + else + { + (obj as any).kind = 'var'; + } } } } } - private resolveInheritance(docs: any[]) { - for (let doclet of docs) { + private resolveInheritance(docs: any[]) + { + for (let doclet of docs) + { let obj = doclet.kind === 'namespace' ? this.namespaces[doclet.longname] : this.objects[doclet.longname]; - if (!obj) { - // TODO + if (!obj) + { console.log(`Didn't find type ${doclet.longname} ???`); - continue; } + if (!(obj)._parent) continue; - if (doclet.inherited) {// remove inherited members if they aren't from an interface + if (doclet.inherited) + { + // remove inherited members if they aren't from an interface let from = this.objects[doclet.inherits]; - if (!from || !(from)._parent) - throw `'${doclet.longname}' should inherit from '${doclet.inherits}', which is not defined.`; - if ((from)._parent.kind != 'interface') { + if (!from || !(from)._parent) + { + throw `'${doclet.longname}' should inherit from '${doclet.inherits}', which is not defined.`; + } + + if ((from)._parent.kind != 'interface') + { (obj)._parent.members.splice((obj)._parent.members.indexOf(obj), 1); (obj)._parent = null; } @@ -430,18 +457,25 @@ export class Parser { for (let paramDoc of doclet.params) { - // TODO REMOVE TEMP FIX + if (!paramDoc.name) + { + console.log(`Docs Error in '${doclet.longname}' in ${doclet.meta.filename}@${doclet.meta.lineno}`); + + console.info(paramDoc); + } + if (paramDoc.name.indexOf('.') != -1) { + console.log(`Warning: ignoring param with '.' for '${doclet.longname}' in ${doclet.meta.filename}@${doclet.meta.lineno}`); let defaultVal = paramDoc.defaultvalue !== undefined ? ` Default ${String(paramDoc.defaultvalue)}.` : ''; + if (paramDoc.description) obj.jsDocComment += `\n@param ${paramDoc.name} ${paramDoc.description.replace(regexEndLine, '$1\n')}` + defaultVal; else if (defaultVal.length) obj.jsDocComment += `\n@param ${paramDoc.name} ` + defaultVal; continue; } - /////////////////////// let param = dom.create.parameter(paramDoc.name, this.parseType(paramDoc)); parameters.push(param); @@ -553,11 +587,11 @@ export class Parser { if (doclet.tags) for (let tag of doclet.tags) { if (tag.originalTitle === 'generic') { - + /** * {string} K - [key] * 1 = string | 2 = null | 3 = K | 4 = key - * + * * {string=string} K - [key] * 1 = string | 2 = string | 3 = K | 4 = key */ @@ -565,10 +599,10 @@ export class Parser { const [_, _type, _defaultType, _name, _paramsNames] = matches; const typeParam = dom.create.typeParameter( - _name, + _name, _type == null ? null : dom.create.typeParameter(_type) ); - + if(_defaultType != null) { typeParam.defaultType = dom.create.typeParameter(_defaultType); } diff --git a/scripts/tsgen/test/bin/game.js b/scripts/tsgen/test/bin/game.js index d390af097..44ddb6377 100644 --- a/scripts/tsgen/test/bin/game.js +++ b/scripts/tsgen/test/bin/game.js @@ -2,7 +2,7 @@ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { diff --git a/src/actions/AlignTo.js b/src/actions/AlignTo.js index 088679357..9d539f06f 100644 --- a/src/actions/AlignTo.js +++ b/src/actions/AlignTo.js @@ -17,7 +17,7 @@ var QuickSet = require('../display/align/to/QuickSet'); * @generic {Phaser.GameObjects.GameObject[]} G - [items,$return] * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. - * @param {integer} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. + * @param {number} position - The position to align the items with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * diff --git a/src/actions/Angle.js b/src/actions/Angle.js index 65601e693..b40fe9409 100644 --- a/src/actions/Angle.js +++ b/src/actions/Angle.js @@ -22,8 +22,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `angle` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/GetFirst.js b/src/actions/GetFirst.js index 65c632fc1..b6d123130 100644 --- a/src/actions/GetFirst.js +++ b/src/actions/GetFirst.js @@ -18,7 +18,7 @@ * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [index=0] - An optional offset to start searching from within the items array. * * @return {?(object|Phaser.GameObjects.GameObject)} The first object in the array that matches the comparison object, or `null` if no match was found. */ diff --git a/src/actions/GetLast.js b/src/actions/GetLast.js index 4de1e6e1d..d25667887 100644 --- a/src/actions/GetLast.js +++ b/src/actions/GetLast.js @@ -18,7 +18,7 @@ * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be searched by this action. * @param {object} compare - The comparison object. Each property in this object will be checked against the items of the array. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [index=0] - An optional offset to start searching from within the items array. * * @return {?(object|Phaser.GameObjects.GameObject)} The last object in the array that matches the comparison object, or `null` if no match was found. */ diff --git a/src/actions/IncAlpha.js b/src/actions/IncAlpha.js index c391f45fc..b68db3347 100644 --- a/src/actions/IncAlpha.js +++ b/src/actions/IncAlpha.js @@ -22,8 +22,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `alpha` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/IncX.js b/src/actions/IncX.js index 3ded566a8..d9da254c5 100644 --- a/src/actions/IncX.js +++ b/src/actions/IncX.js @@ -22,8 +22,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `x` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/IncXY.js b/src/actions/IncXY.js index 1174cf227..c92406a7b 100644 --- a/src/actions/IncXY.js +++ b/src/actions/IncXY.js @@ -24,8 +24,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {number} [y=x] - The amount to be added to the `y` property. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/IncY.js b/src/actions/IncY.js index 3f7af5ffe..d78b8e61c 100644 --- a/src/actions/IncY.js +++ b/src/actions/IncY.js @@ -22,8 +22,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `y` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/PlaceOnRectangle.js b/src/actions/PlaceOnRectangle.js index c70de95a2..56af27443 100644 --- a/src/actions/PlaceOnRectangle.js +++ b/src/actions/PlaceOnRectangle.js @@ -21,7 +21,7 @@ var RotateRight = require('../utils/array/RotateRight'); * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {Phaser.Geom.Rectangle} rect - The Rectangle to position the Game Objects on. - * @param {integer} [shift=1] - An optional positional offset. + * @param {number} [shift=1] - An optional positional offset. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ diff --git a/src/actions/PlayAnimation.js b/src/actions/PlayAnimation.js index f708b19f1..6e8572fa0 100644 --- a/src/actions/PlayAnimation.js +++ b/src/actions/PlayAnimation.js @@ -14,7 +14,7 @@ * * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {string} key - The name of the animation to play. - * @param {(string|integer)} [startFrame] - The starting frame of the animation with the given key. + * @param {(string|number)} [startFrame] - The starting frame of the animation with the given key. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of Game Objects that was passed to this Action. */ diff --git a/src/actions/PropertyValueInc.js b/src/actions/PropertyValueInc.js index 31de3db64..8f432cf16 100644 --- a/src/actions/PropertyValueInc.js +++ b/src/actions/PropertyValueInc.js @@ -21,8 +21,8 @@ * @param {string} key - The property to be updated. * @param {number} value - The amount to be added to the property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/PropertyValueSet.js b/src/actions/PropertyValueSet.js index f80287417..e93111297 100644 --- a/src/actions/PropertyValueSet.js +++ b/src/actions/PropertyValueSet.js @@ -21,8 +21,8 @@ * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/Rotate.js b/src/actions/Rotate.js index 0c93ae668..e8b604b48 100644 --- a/src/actions/Rotate.js +++ b/src/actions/Rotate.js @@ -22,8 +22,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `rotation` property (in radians). * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/ScaleX.js b/src/actions/ScaleX.js index 209967ed7..8893cb86f 100644 --- a/src/actions/ScaleX.js +++ b/src/actions/ScaleX.js @@ -22,8 +22,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleX` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/ScaleXY.js b/src/actions/ScaleXY.js index 0d9182a3b..25310b791 100644 --- a/src/actions/ScaleXY.js +++ b/src/actions/ScaleXY.js @@ -24,8 +24,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {number} [scaleY] - The amount to be added to the `scaleY` property. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/ScaleY.js b/src/actions/ScaleY.js index 2193165f4..c899e5c3d 100644 --- a/src/actions/ScaleY.js +++ b/src/actions/ScaleY.js @@ -22,8 +22,8 @@ var PropertyValueInc = require('./PropertyValueInc'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to be added to the `scaleY` property. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetAlpha.js b/src/actions/SetAlpha.js index 0f867e084..a2e9a1134 100644 --- a/src/actions/SetAlpha.js +++ b/src/actions/SetAlpha.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetBlendMode.js b/src/actions/SetBlendMode.js index bb4997732..a4e3bc430 100644 --- a/src/actions/SetBlendMode.js +++ b/src/actions/SetBlendMode.js @@ -21,8 +21,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetDepth.js b/src/actions/SetDepth.js index 5d2854d1e..0d47fd07b 100644 --- a/src/actions/SetDepth.js +++ b/src/actions/SetDepth.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetOrigin.js b/src/actions/SetOrigin.js index d8b4c93bc..04f1f9741 100644 --- a/src/actions/SetOrigin.js +++ b/src/actions/SetOrigin.js @@ -24,8 +24,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {number} [originY] - The amount to set the `originY` property to. If `undefined` or `null` it uses the `originX` value. * @param {number} [stepX=0] - This is added to the `originX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `originY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetRotation.js b/src/actions/SetRotation.js index d3c5b36ce..4cb6f1fbb 100644 --- a/src/actions/SetRotation.js +++ b/src/actions/SetRotation.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetScale.js b/src/actions/SetScale.js index 78daccd20..c13319988 100644 --- a/src/actions/SetScale.js +++ b/src/actions/SetScale.js @@ -24,8 +24,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {number} [scaleY] - The amount to set the `scaleY` property to. If `undefined` or `null` it uses the `scaleX` value. * @param {number} [stepX=0] - This is added to the `scaleX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scaleY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetScaleX.js b/src/actions/SetScaleX.js index ef2c40859..946dc61a5 100644 --- a/src/actions/SetScaleX.js +++ b/src/actions/SetScaleX.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetScaleY.js b/src/actions/SetScaleY.js index 296ff919a..6667f8870 100644 --- a/src/actions/SetScaleY.js +++ b/src/actions/SetScaleY.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetScrollFactor.js b/src/actions/SetScrollFactor.js index 4598e7c40..9d4fbc66c 100644 --- a/src/actions/SetScrollFactor.js +++ b/src/actions/SetScrollFactor.js @@ -24,8 +24,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {number} [scrollFactorY] - The amount to set the `scrollFactorY` property to. If `undefined` or `null` it uses the `scrollFactorX` value. * @param {number} [stepX=0] - This is added to the `scrollFactorX` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `scrollFactorY` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetScrollFactorX.js b/src/actions/SetScrollFactorX.js index e39b64dcd..338aa3339 100644 --- a/src/actions/SetScrollFactorX.js +++ b/src/actions/SetScrollFactorX.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetScrollFactorY.js b/src/actions/SetScrollFactorY.js index fe2a9fca2..c63425d85 100644 --- a/src/actions/SetScrollFactorY.js +++ b/src/actions/SetScrollFactorY.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetVisible.js b/src/actions/SetVisible.js index 9f9ad347e..07ba32e40 100644 --- a/src/actions/SetVisible.js +++ b/src/actions/SetVisible.js @@ -19,8 +19,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {boolean} value - The value to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetX.js b/src/actions/SetX.js index 3216a9393..5e7f1df8d 100644 --- a/src/actions/SetX.js +++ b/src/actions/SetX.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetXY.js b/src/actions/SetXY.js index 3bb4f964e..5eccf5626 100644 --- a/src/actions/SetXY.js +++ b/src/actions/SetXY.js @@ -24,8 +24,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {number} [y=x] - The amount to set the `y` property to. If `undefined` or `null` it uses the `x` value. * @param {number} [stepX=0] - This is added to the `x` amount, multiplied by the iteration counter. * @param {number} [stepY=0] - This is added to the `y` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/SetY.js b/src/actions/SetY.js index 9c96b97b7..a52466dac 100644 --- a/src/actions/SetY.js +++ b/src/actions/SetY.js @@ -22,8 +22,8 @@ var PropertyValueSet = require('./PropertyValueSet'); * @param {(array|Phaser.GameObjects.GameObject[])} items - The array of items to be updated by this action. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {(array|Phaser.GameObjects.GameObject[])} The array of objects that were passed to this Action. */ diff --git a/src/actions/ShiftPosition.js b/src/actions/ShiftPosition.js index 9e0c16b32..c98c47618 100644 --- a/src/actions/ShiftPosition.js +++ b/src/actions/ShiftPosition.js @@ -23,7 +23,7 @@ var Vector2 = require('../math/Vector2'); * @param {(array|Phaser.GameObjects.GameObject[])} items - An array of Game Objects. The contents of this array are updated by this Action. * @param {number} x - The x coordinate to place the first item in the array at. * @param {number} y - The y coordinate to place the first item in the array at. - * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {number} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. * @param {(Phaser.Math.Vector2|object)} [output] - An optional objec to store the final objects position in. * * @return {Phaser.Math.Vector2} The output vector. diff --git a/src/actions/typedefs/GridAlignConfig.js b/src/actions/typedefs/GridAlignConfig.js index a45a9cd5e..1522c7489 100644 --- a/src/actions/typedefs/GridAlignConfig.js +++ b/src/actions/typedefs/GridAlignConfig.js @@ -2,13 +2,13 @@ * @typedef {object} Phaser.Types.Actions.GridAlignConfig * @since 3.0.0 * - * @property {integer} [width=-1] - The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity. + * @property {number} [width=-1] - The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity. * If both this value and height are set to -1 then this value overrides it and the `height` value is ignored. - * @property {integer} [height=-1] - The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity. + * @property {number} [height=-1] - The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity. * If both this value and `width` are set to -1 then `width` overrides it and this value is ignored. - * @property {integer} [cellWidth=1] - The width of the cell, in pixels, in which the item is positioned. - * @property {integer} [cellHeight=1] - The height of the cell, in pixels, in which the item is positioned. - * @property {integer} [position=0] - The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`. + * @property {number} [cellWidth=1] - The width of the cell, in pixels, in which the item is positioned. + * @property {number} [cellHeight=1] - The height of the cell, in pixels, in which the item is positioned. + * @property {number} [position=0] - The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`. * @property {number} [x=0] - Optionally place the top-left of the final grid at this coordinate. * @property {number} [y=0] - Optionally place the top-left of the final grid at this coordinate. */ diff --git a/src/animations/Animation.js b/src/animations/Animation.js index 5927d122e..2df78a762 100644 --- a/src/animations/Animation.js +++ b/src/animations/Animation.js @@ -88,7 +88,7 @@ var Animation = new Class({ * The frame rate of playback in frames per second (default 24 if duration is null) * * @name Phaser.Animations.Animation#frameRate - * @type {integer} + * @type {number} * @default 24 * @since 3.0.0 */ @@ -100,7 +100,7 @@ var Animation = new Class({ * otherwise the `frameRate` is derived from `duration`. * * @name Phaser.Animations.Animation#duration - * @type {integer} + * @type {number} * @since 3.0.0 */ this.duration = GetValue(config, 'duration', null); @@ -109,7 +109,7 @@ var Animation = new Class({ * How many ms per frame, not including frame specific modifiers. * * @name Phaser.Animations.Animation#msPerFrame - * @type {integer} + * @type {number} * @since 3.0.0 */ this.msPerFrame; @@ -128,7 +128,7 @@ var Animation = new Class({ * The delay in ms before the playback will begin. * * @name Phaser.Animations.Animation#delay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -138,7 +138,7 @@ var Animation = new Class({ * Number of times to repeat the animation. Set to -1 to repeat forever. * * @name Phaser.Animations.Animation#repeat - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -148,7 +148,7 @@ var Animation = new Class({ * The delay in ms before the a repeat play starts. * * @name Phaser.Animations.Animation#repeatDelay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -222,7 +222,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#calculateDuration * @since 3.50.0 * - * @param {(Phaser.Animations.Animation|Phaser.GameObjects.Components.Animation)} target - The target to set the values on. + * @param {Phaser.Animations.Animation} target - The target to set the values on. * @param {number} totalFrames - The total number of frames in the animation. * @param {number} duration - The duration to calculate the frame rate from. * @param {number} frameRate - The frame ate to calculate the duration from. @@ -276,7 +276,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#addFrameAt * @since 3.0.0 * - * @param {integer} index - The index to insert the frame at within the animation. + * @param {number} index - The index to insert the frame at within the animation. * @param {(string|Phaser.Types.Animations.AnimationFrame[])} config - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. * * @return {this} This Animation object. @@ -315,7 +315,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#checkFrame * @since 3.0.0 * - * @param {integer} index - The index to be checked. + * @param {number} index - The index to be checked. * * @return {boolean} `true` if the index is valid, otherwise `false`. */ @@ -332,14 +332,14 @@ var Animation = new Class({ * @protected * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - getFirstTick: function (component) + getFirstTick: function (state) { // When is the first update due? - component.accumulator = 0; + state.accumulator = 0; - component.nextTick = component.msPerFrame + component.currentFrame.duration; + state.nextTick = state.msPerFrame + state.currentFrame.duration; }, /** @@ -349,7 +349,7 @@ var Animation = new Class({ * @protected * @since 3.0.0 * - * @param {integer} index - The index in the AnimationFrame array + * @param {number} index - The index in the AnimationFrame array * * @return {Phaser.Animations.AnimationFrame} The frame at the index provided from the animation sequence */ @@ -473,13 +473,13 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#getNextTick * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - getNextTick: function (component) + getNextTick: function (state) { - component.accumulator -= component.nextTick; + state.accumulator -= state.nextTick; - component.nextTick = component.msPerFrame + component.currentFrame.duration; + state.nextTick = state.msPerFrame + state.currentFrame.duration; }, /** @@ -505,42 +505,42 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#nextFrame * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {Phaser.Animations.AnimationState} state - The Animation State to advance. */ - nextFrame: function (component) + nextFrame: function (state) { - var frame = component.currentFrame; + var frame = state.currentFrame; if (frame.isLast) { // We're at the end of the animation // Yoyo? (happens before repeat) - if (component.yoyo) + if (state.yoyo) { - this.handleYoyoFrame(component, false); + this.handleYoyoFrame(state, false); } - else if (component.repeatCounter > 0) + else if (state.repeatCounter > 0) { // Repeat (happens before complete) - if (component.inReverse && component.forward) + if (state.inReverse && state.forward) { - component.forward = false; + state.forward = false; } else { - this.repeatAnimation(component); + this.repeatAnimation(state); } } else { - component.complete(); + state.complete(); } } else { - this.updateAndGetNextTick(component, frame.nextFrame); + this.updateAndGetNextTick(state, frame.nextFrame); } }, @@ -551,37 +551,37 @@ var Animation = new Class({ * @private * @since 3.12.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance. + * @param {Phaser.Animations.AnimationState} state - The Animation State to advance. * @param {boolean} isReverse - Is animation in reverse mode? (Default: false) */ - handleYoyoFrame: function (component, isReverse) + handleYoyoFrame: function (state, isReverse) { if (!isReverse) { isReverse = false; } - if (component.inReverse === !isReverse && component.repeatCounter > 0) + if (state.inReverse === !isReverse && state.repeatCounter > 0) { - if (component.repeatDelay === 0 || component.pendingRepeat) + if (state.repeatDelay === 0 || state.pendingRepeat) { - component.forward = isReverse; + state.forward = isReverse; } - this.repeatAnimation(component); + this.repeatAnimation(state); return; } - if (component.inReverse !== isReverse && component.repeatCounter === 0) + if (state.inReverse !== isReverse && state.repeatCounter === 0) { - component.complete(); + state.complete(); return; } - component.forward = isReverse; + state.forward = isReverse; - var frame = (isReverse) ? component.currentFrame.nextFrame : component.currentFrame.prevFrame; + var frame = (isReverse) ? state.currentFrame.nextFrame : state.currentFrame.prevFrame; - this.updateAndGetNextTick(component, frame); + this.updateAndGetNextTick(state, frame); }, /** @@ -590,7 +590,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#getLastFrame * @since 3.12.0 * - * @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame. + * @return {Phaser.Animations.AnimationFrame} The last Animation Frame. */ getLastFrame: function () { @@ -604,41 +604,41 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#previousFrame * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - previousFrame: function (component) + previousFrame: function (state) { - var frame = component.currentFrame; + var frame = state.currentFrame; if (frame.isFirst) { // We're at the start of the animation - if (component.yoyo) + if (state.yoyo) { - this.handleYoyoFrame(component, true); + this.handleYoyoFrame(state, true); } - else if (component.repeatCounter > 0) + else if (state.repeatCounter > 0) { - if (component.inReverse && !component.forward) + if (state.inReverse && !state.forward) { - this.repeatAnimation(component); + this.repeatAnimation(state); } else { // Repeat (happens before complete) - component.forward = true; + state.forward = true; - this.repeatAnimation(component); + this.repeatAnimation(state); } } else { - component.complete(); + state.complete(); } } else { - this.updateAndGetNextTick(component, frame.prevFrame); + this.updateAndGetNextTick(state, frame.prevFrame); } }, @@ -649,13 +649,14 @@ var Animation = new Class({ * @private * @since 3.12.0 * + * @param {Phaser.Animations.AnimationState} state - The Animation State. * @param {Phaser.Animations.AnimationFrame} frame - An Animation frame. */ - updateAndGetNextTick: function (component, frame) + updateAndGetNextTick: function (state, frame) { - component.setCurrentFrame(frame); + state.setCurrentFrame(frame); - this.getNextTick(component); + this.getNextTick(state); }, /** @@ -688,7 +689,7 @@ var Animation = new Class({ * @method Phaser.Animations.Animation#removeFrameAt * @since 3.0.0 * - * @param {integer} index - The index in the AnimationFrame array + * @param {number} index - The index in the AnimationFrame array * * @return {this} This Animation object. */ @@ -711,46 +712,46 @@ var Animation = new Class({ * @fires Phaser.Animations.Events#SPRITE_ANIMATION_KEY_REPEAT * @since 3.0.0 * - * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component belonging to the Game Object invoking this call. + * @param {Phaser.Animations.AnimationState} state - The Animation State belonging to the Game Object invoking this call. */ - repeatAnimation: function (component) + repeatAnimation: function (state) { - if (component._pendingStop === 2) + if (state._pendingStop === 2) { - if (component._pendingStopValue === 0) + if (state._pendingStopValue === 0) { - return component.stop(); + return state.stop(); } else { - component._pendingStopValue--; + state._pendingStopValue--; } } - if (component.repeatDelay > 0 && !component.pendingRepeat) + if (state.repeatDelay > 0 && !state.pendingRepeat) { - component.pendingRepeat = true; - component.accumulator -= component.nextTick; - component.nextTick += component.repeatDelay; + state.pendingRepeat = true; + state.accumulator -= state.nextTick; + state.nextTick += state.repeatDelay; } else { - component.repeatCounter--; + state.repeatCounter--; - if (component.forward) + if (state.forward) { - component.setCurrentFrame(component.currentFrame.nextFrame); + state.setCurrentFrame(state.currentFrame.nextFrame); } else { - component.setCurrentFrame(component.currentFrame.prevFrame); + state.setCurrentFrame(state.currentFrame.prevFrame); } - if (component.isPlaying) + if (state.isPlaying) { - this.getNextTick(component); + this.getNextTick(state); - component.handleRepeat(); + state.handleRepeat(); } } }, diff --git a/src/animations/AnimationFrame.js b/src/animations/AnimationFrame.js index 49b4dc752..1a43eeb09 100644 --- a/src/animations/AnimationFrame.js +++ b/src/animations/AnimationFrame.js @@ -21,16 +21,19 @@ var Class = require('../utils/Class'); * @since 3.0.0 * * @param {string} textureKey - The key of the Texture this AnimationFrame uses. - * @param {(string|integer)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. - * @param {integer} index - The index of this AnimationFrame within the Animation sequence. + * @param {(string|number)} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses. + * @param {number} index - The index of this AnimationFrame within the Animation sequence. * @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering. + * @param {boolean} [isKeyFrame=false] - Is this Frame a Keyframe within the Animation? */ var AnimationFrame = new Class({ initialize: - function AnimationFrame (textureKey, textureFrame, index, frame) + function AnimationFrame (textureKey, textureFrame, index, frame, isKeyFrame) { + if (isKeyFrame === undefined) { isKeyFrame = false; } + /** * The key of the Texture this AnimationFrame uses. * @@ -44,7 +47,7 @@ var AnimationFrame = new Class({ * The key of the Frame within the Texture that this AnimationFrame uses. * * @name Phaser.Animations.AnimationFrame#textureFrame - * @type {(string|integer)} + * @type {(string|number)} * @since 3.0.0 */ this.textureFrame = textureFrame; @@ -53,7 +56,7 @@ var AnimationFrame = new Class({ * The index of this AnimationFrame within the Animation sequence. * * @name Phaser.Animations.AnimationFrame#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -133,6 +136,15 @@ var AnimationFrame = new Class({ * @since 3.0.0 */ this.progress = 0; + + /** + * Is this Frame a KeyFrame within the Animation? + * + * @name Phaser.Animations.AnimationFrame#isKeyFrame + * @type {boolean} + * @since 3.50.0 + */ + this.isKeyFrame = isKeyFrame; }, /** @@ -148,7 +160,8 @@ var AnimationFrame = new Class({ return { key: this.textureKey, frame: this.textureFrame, - duration: this.duration + duration: this.duration, + keyframe: this.isKeyFrame }; }, diff --git a/src/animations/AnimationManager.js b/src/animations/AnimationManager.js index 071a0cfdb..2cc27ba36 100644 --- a/src/animations/AnimationManager.js +++ b/src/animations/AnimationManager.js @@ -93,7 +93,7 @@ var AnimationManager = new Class({ * See the {@link #setMix} method for more details. * * @name Phaser.Animations.AnimationManager#mixes - * @type {Phaser.Structs.Map.} + * @type {Phaser.Structs.Map.} * @since 3.50.0 */ this.mixes = new CustomMap(); @@ -354,17 +354,17 @@ var AnimationManager = new Class({ * * This was tested with Aseprite 1.2.25. * - * This will export a png and json file which you can load using the Atlas Loader, i.e.: + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: * * ```javascript * function preload () * { * this.load.path = 'assets/animations/aseprite/'; - * this.load.atlas('paladin', 'paladin.png', 'paladin.json'); + * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); * } * ``` * - * Once exported, you can call this method from within a Scene with the 'atlas' key: + * Once loaded, you can call this method from within a Scene with the 'atlas' key: * * ```javascript * this.anims.createFromAseprite('paladin'); @@ -683,6 +683,36 @@ var AnimationManager = new Class({ * * If you're working with a texture atlas, see the `generateFrameNames` method instead. * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * * @method Phaser.Animations.AnimationManager#generateFrameNumbers * @since 3.0.0 * diff --git a/src/animations/AnimationState.js b/src/animations/AnimationState.js index eb924759f..a37bf12ff 100644 --- a/src/animations/AnimationState.js +++ b/src/animations/AnimationState.js @@ -438,7 +438,7 @@ var AnimationState = new Class({ * 3 = Waiting for specific frame * * @name Phaser.Animations.AnimationState#_pendingStop - * @type {integer} + * @type {number} * @private * @since 3.4.0 */ @@ -680,7 +680,7 @@ var AnimationState = new Class({ * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. + * @param {number} delay - The delay, in milliseconds, to wait before starting the animation playing. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -726,7 +726,7 @@ var AnimationState = new Class({ * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * @param {number} [repeatCount=1] - How many times should the animation repeat before the next one starts? * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -1175,7 +1175,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#setRepeat * @since 3.4.0 * - * @param {integer} value - The number of times that the animation should repeat. + * @param {number} value - The number of times that the animation should repeat. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -1351,7 +1351,7 @@ var AnimationState = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.4.0 * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. + * @param {number} delay - The number of milliseconds to wait before stopping this animation. * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -1379,7 +1379,7 @@ var AnimationState = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.50.0 * - * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? + * @param {number} [repeatCount=1] - How many times should the animation repeat before stopping? * * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. */ @@ -1432,7 +1432,7 @@ var AnimationState = new Class({ * @method Phaser.Animations.AnimationState#getTotalFrames * @since 3.4.0 * - * @return {integer} The total number of frames in the current animation, or zero if no animation has been loaded. + * @return {number} The total number of frames in the current animation, or zero if no animation has been loaded. */ getTotalFrames: function () { @@ -1629,11 +1629,11 @@ var AnimationState = new Class({ * * @param {string} key - The key of the Animation to retrieve. * - * @return {Phaser.Animations.Animation} The Animation, or `undefined` if the key is invalid. + * @return {Phaser.Animations.Animation} The Animation, or `null` if the key is invalid. */ get: function (key) { - return (this.anims && this.anims.get(key)); + return (this.anims) ? this.anims.get(key) : null; }, /** @@ -1644,11 +1644,11 @@ var AnimationState = new Class({ * * @param {string} key - The key of the Animation to check. * - * @return {boolean} `true` if the Animation exists locally, or `false` if the key is available. + * @return {boolean} `true` if the Animation exists locally, or `false` if the key is available, or there are no local animations. */ exists: function (key) { - return (this.anims && this.anims.has(key)); + return (this.anims) ? this.anims.has(key) : false; }, /** @@ -1701,6 +1701,99 @@ var AnimationState = new Class({ return anim; }, + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. + * + * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. + * + * Example: + * + * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * + * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'ruby', + * repeat: -1, + * frames: this.anims.generateFrameNames('gems', { + * prefix: 'ruby_', + * end: 6, + * zeroPad: 4 + * }) + * }); + * ``` + * + * Please see the animation examples for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNames + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNames} [config] - The configuration object for the animation frame names. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNames: function (key, config) + { + return this.animationManager.generateFrameNames(key, config); + }, + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * + * @method Phaser.Animations.AnimationState#generateFrameNumbers + * @since 3.50.0 + * + * @param {string} key - The key for the texture containing the animation frames. + * @param {Phaser.Types.Animations.GenerateFrameNumbers} config - The configuration object for the animation frames. + * + * @return {Phaser.Types.Animations.AnimationFrame[]} The array of {@link Phaser.Types.Animations.AnimationFrame} objects. + */ + generateFrameNumbers: function (key, config) + { + return this.animationManager.generateFrameNumbers(key, config); + }, + /** * Removes a locally created Animation from this Sprite, based on the given key. * diff --git a/src/animations/typedefs/Animation.js b/src/animations/typedefs/Animation.js index bb38801c2..933397c73 100644 --- a/src/animations/typedefs/Animation.js +++ b/src/animations/typedefs/Animation.js @@ -6,12 +6,12 @@ * @property {string|Phaser.Types.Animations.AnimationFrame[]} [frames] - Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. * @property {boolean} [sortFrames=true] - If you provide a string for `frames` you can optionally have the frame names numerically sorted. * @property {string} [defaultTextureKey=null] - The key of the texture all frames of the animation will use. Can be overridden on a per frame basis. - * @property {integer} [frameRate] - The frame rate of playback in frames per second (default 24 if duration is null) - * @property {integer} [duration] - How long the animation should play for in milliseconds. If not given its derived from frameRate. + * @property {number} [frameRate] - The frame rate of playback in frames per second (default 24 if duration is null) + * @property {number} [duration] - How long the animation should play for in milliseconds. If not given its derived from frameRate. * @property {boolean} [skipMissedFrames=true] - Skip frames if the time lags, or always advanced anyway? - * @property {integer} [delay=0] - Delay before starting playback. Value given in milliseconds. - * @property {integer} [repeat=0] - Number of times to repeat the animation (-1 for infinity) - * @property {integer} [repeatDelay=0] - Delay before the animation repeats. Value given in milliseconds. + * @property {number} [delay=0] - Delay before starting playback. Value given in milliseconds. + * @property {number} [repeat=0] - Number of times to repeat the animation (-1 for infinity) + * @property {number} [repeatDelay=0] - Delay before the animation repeats. Value given in milliseconds. * @property {boolean} [yoyo=false] - Should the animation yoyo? (reverse back down to the start) before repeating? * @property {boolean} [showOnStart=false] - Should sprite.visible = true when the animation starts to play? * @property {boolean} [hideOnComplete=false] - Should sprite.visible = false when the animation finishes? diff --git a/src/animations/typedefs/AnimationFrame.js b/src/animations/typedefs/AnimationFrame.js index f19ccd637..d22823c9a 100644 --- a/src/animations/typedefs/AnimationFrame.js +++ b/src/animations/typedefs/AnimationFrame.js @@ -2,7 +2,7 @@ * @typedef {object} Phaser.Types.Animations.AnimationFrame * @since 3.0.0 * - * @property {string} key - The key of the texture within the Texture Manager to use for this Animation Frame. + * @property {string} [key] - The key of the texture within the Texture Manager to use for this Animation Frame. * @property {(string|number)} [frame] - The key, or index number, of the frame within the texture to use for this Animation Frame. * @property {number} [duration=0] - The duration, in ms, of this frame of the animation. * @property {boolean} [visible] - Should the parent Game Object be visible during this frame of the animation? diff --git a/src/animations/typedefs/GenerateFrameNames.js b/src/animations/typedefs/GenerateFrameNames.js index 2c9e28627..1687e0471 100644 --- a/src/animations/typedefs/GenerateFrameNames.js +++ b/src/animations/typedefs/GenerateFrameNames.js @@ -3,10 +3,10 @@ * @since 3.0.0 * * @property {string} [prefix=''] - The string to append to every resulting frame name if using a range or an array of `frames`. - * @property {integer} [start=0] - If `frames` is not provided, the number of the first frame to return. - * @property {integer} [end=0] - If `frames` is not provided, the number of the last frame to return. + * @property {number} [start=0] - If `frames` is not provided, the number of the first frame to return. + * @property {number} [end=0] - If `frames` is not provided, the number of the last frame to return. * @property {string} [suffix=''] - The string to append to every resulting frame name if using a range or an array of `frames`. - * @property {integer} [zeroPad=0] - The minimum expected lengths of each resulting frame's number. Numbers will be left-padded with zeroes until they are this long, then prepended and appended to create the resulting frame name. + * @property {number} [zeroPad=0] - The minimum expected lengths of each resulting frame's number. Numbers will be left-padded with zeroes until they are this long, then prepended and appended to create the resulting frame name. * @property {Phaser.Types.Animations.AnimationFrame[]} [outputArray=[]] - The array to append the created configuration objects to. - * @property {(boolean|integer[])} [frames=false] - If provided as an array, the range defined by `start` and `end` will be ignored and these frame numbers will be used. + * @property {(boolean|number[])} [frames=false] - If provided as an array, the range defined by `start` and `end` will be ignored and these frame numbers will be used. */ diff --git a/src/animations/typedefs/GenerateFrameNumbers.js b/src/animations/typedefs/GenerateFrameNumbers.js index 45b442742..e5d8b6a27 100644 --- a/src/animations/typedefs/GenerateFrameNumbers.js +++ b/src/animations/typedefs/GenerateFrameNumbers.js @@ -2,9 +2,9 @@ * @typedef {object} Phaser.Types.Animations.GenerateFrameNumbers * @since 3.0.0 * - * @property {integer} [start=0] - The starting frame of the animation. - * @property {integer} [end=-1] - The ending frame of the animation. - * @property {(boolean|integer)} [first=false] - A frame to put at the beginning of the animation, before `start` or `outputArray` or `frames`. + * @property {number} [start=0] - The starting frame of the animation. + * @property {number} [end=-1] - The ending frame of the animation. + * @property {(boolean|number)} [first=false] - A frame to put at the beginning of the animation, before `start` or `outputArray` or `frames`. * @property {Phaser.Types.Animations.AnimationFrame[]} [outputArray=[]] - An array to concatenate the output onto. - * @property {(boolean|integer[])} [frames=false] - A custom sequence of frames. + * @property {(boolean|number[])} [frames=false] - A custom sequence of frames. */ diff --git a/src/animations/typedefs/JSONAnimation.js b/src/animations/typedefs/JSONAnimation.js index 9ae13c7a3..1648dda53 100644 --- a/src/animations/typedefs/JSONAnimation.js +++ b/src/animations/typedefs/JSONAnimation.js @@ -5,12 +5,12 @@ * @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key) * @property {string} type - A frame based animation (as opposed to a bone based animation) * @property {Phaser.Types.Animations.JSONAnimationFrame[]} frames - An array of the AnimationFrame objects inside this Animation. - * @property {integer} frameRate - The frame rate of playback in frames per second (default 24 if duration is null) - * @property {integer} duration - How long the animation should play for in milliseconds. If not given its derived from frameRate. + * @property {number} frameRate - The frame rate of playback in frames per second (default 24 if duration is null) + * @property {number} duration - How long the animation should play for in milliseconds. If not given its derived from frameRate. * @property {boolean} skipMissedFrames - Skip frames if the time lags, or always advanced anyway? - * @property {integer} delay - Delay before starting playback. Value given in milliseconds. - * @property {integer} repeat - Number of times to repeat the animation (-1 for infinity) - * @property {integer} repeatDelay - Delay before the animation repeats. Value given in milliseconds. + * @property {number} delay - Delay before starting playback. Value given in milliseconds. + * @property {number} repeat - Number of times to repeat the animation (-1 for infinity) + * @property {number} repeatDelay - Delay before the animation repeats. Value given in milliseconds. * @property {boolean} yoyo - Should the animation yoyo? (reverse back down to the start) before repeating? * @property {boolean} showOnStart - Should sprite.visible = true when the animation starts to play? * @property {boolean} hideOnComplete - Should sprite.visible = false when the animation finishes? diff --git a/src/animations/typedefs/JSONAnimationFrame.js b/src/animations/typedefs/JSONAnimationFrame.js index 8485ea458..1513c7a00 100644 --- a/src/animations/typedefs/JSONAnimationFrame.js +++ b/src/animations/typedefs/JSONAnimationFrame.js @@ -3,6 +3,6 @@ * @since 3.0.0 * * @property {string} key - The key of the Texture this AnimationFrame uses. - * @property {(string|integer)} frame - The key of the Frame within the Texture that this AnimationFrame uses. + * @property {(string|number)} frame - The key of the Frame within the Texture that this AnimationFrame uses. * @property {number} duration - Additional time (in ms) that this frame should appear for during playback. */ diff --git a/src/animations/typedefs/PlayAnimationConfig.js b/src/animations/typedefs/PlayAnimationConfig.js index dad4d8350..9b638ab43 100644 --- a/src/animations/typedefs/PlayAnimationConfig.js +++ b/src/animations/typedefs/PlayAnimationConfig.js @@ -3,14 +3,14 @@ * @since 3.50.0 * * @property {(string|Phaser.Animations.Animation)} key - The string-based key of the animation to play, or an Animation instance. - * @property {integer} [frameRate] - The frame rate of playback in frames per second (default 24 if duration is null) - * @property {integer} [duration] - How long the animation should play for in milliseconds. If not given its derived from frameRate. - * @property {integer} [delay] - Delay before starting playback. Value given in milliseconds. - * @property {integer} [repeat] - Number of times to repeat the animation (-1 for infinity) - * @property {integer} [repeatDelay] - Delay before the animation repeats. Value given in milliseconds. + * @property {number} [frameRate] - The frame rate of playback in frames per second (default 24 if duration is null) + * @property {number} [duration] - How long the animation should play for in milliseconds. If not given its derived from frameRate. + * @property {number} [delay] - Delay before starting playback. Value given in milliseconds. + * @property {number} [repeat] - Number of times to repeat the animation (-1 for infinity) + * @property {number} [repeatDelay] - Delay before the animation repeats. Value given in milliseconds. * @property {boolean} [yoyo] - Should the animation yoyo? (reverse back down to the start) before repeating? * @property {boolean} [showOnStart] - Should sprite.visible = true when the animation starts to play? * @property {boolean} [hideOnComplete] - Should sprite.visible = false when the animation finishes? - * @property {integer} [startFrame] - The frame of the animation to start playback from. + * @property {number} [startFrame] - The frame of the animation to start playback from. * @property {number} [timeScale] - The time scale to be applied to playback of this animation. */ diff --git a/src/cameras/2d/BaseCamera.js b/src/cameras/2d/BaseCamera.js index 03daf3995..4053bd175 100644 --- a/src/cameras/2d/BaseCamera.js +++ b/src/cameras/2d/BaseCamera.js @@ -117,7 +117,7 @@ var BaseCamera = new Class({ * This value is a bitmask. * * @name Phaser.Cameras.Scene2D.BaseCamera#id - * @type {integer} + * @type {number} * @readonly * @since 3.11.0 */ @@ -199,7 +199,7 @@ var BaseCamera = new Class({ * The viewport is the area into which the camera renders. * To adjust the position the camera is looking at in the game world, see the `scrollX` value. * - * @name Phaser.Cameras.Scene2D.BaseCamera#x + * @name Phaser.Cameras.Scene2D.BaseCamera#_x * @type {number} * @private * @since 3.0.0 @@ -211,7 +211,7 @@ var BaseCamera = new Class({ * The viewport is the area into which the camera renders. * To adjust the position the camera is looking at in the game world, see the `scrollY` value. * - * @name Phaser.Cameras.Scene2D.BaseCamera#y + * @name Phaser.Cameras.Scene2D.BaseCamera#_y * @type {number} * @private * @since 3.0.0 @@ -291,7 +291,7 @@ var BaseCamera = new Class({ this._scrollY = 0; /** - * The Camera zoom value. Change this value to zoom in, or out of, a Scene. + * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. * * A value of 0.5 would zoom the Camera out, so you can now see twice as much * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel @@ -301,13 +301,32 @@ var BaseCamera = new Class({ * * Be careful to never set this value to zero. * - * @name Phaser.Cameras.Scene2D.BaseCamera#_zoom + * @name Phaser.Cameras.Scene2D.BaseCamera#_zoomX * @type {number} * @private * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ - this._zoom = 1; + this._zoomX = 1; + + /** + * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#_zoomY + * @type {number} + * @private + * @default 1 + * @since 3.50.0 + */ + this._zoomY = 1; /** * The rotation of the Camera in radians. @@ -793,13 +812,14 @@ var BaseCamera = new Class({ var c = Math.cos(this.rotation); var s = Math.sin(this.rotation); - var zoom = this.zoom; + var zoomX = this.zoomX; + var zoomY = this.zoomY; var scrollX = this.scrollX; var scrollY = this.scrollY; - var sx = x + ((scrollX * c - scrollY * s) * zoom); - var sy = y + ((scrollX * s + scrollY * c) * zoom); + var sx = x + ((scrollX * c - scrollY * s) * zoomX); + var sy = y + ((scrollX * s + scrollY * c) * zoomY); // Apply transform to point output.x = (sx * ima + sy * imc) + ime; @@ -864,7 +884,8 @@ var BaseCamera = new Class({ var halfWidth = width * 0.5; var halfHeight = height * 0.5; - var zoom = this.zoom; + var zoomX = this.zoomX; + var zoomY = this.zoomY; var matrix = this.matrix; var originX = width * this.originX; @@ -896,8 +917,8 @@ var BaseCamera = new Class({ // Basically the pixel value of what it's looking at in the middle of the cam this.midPoint.set(midX, midY); - var displayWidth = width / zoom; - var displayHeight = height / zoom; + var displayWidth = width / zoomX; + var displayHeight = height / zoomY; this.worldView.setTo( midX - (displayWidth / 2), @@ -906,7 +927,7 @@ var BaseCamera = new Class({ displayHeight ); - matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); + matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoomX, zoomY); matrix.translate(-originX, -originY); }, @@ -1067,10 +1088,10 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#setBounds * @since 3.0.0 * - * @param {integer} x - The top-left x coordinate of the bounds. - * @param {integer} y - The top-left y coordinate of the bounds. - * @param {integer} width - The width of the bounds, in pixels. - * @param {integer} height - The height of the bounds, in pixels. + * @param {number} x - The top-left x coordinate of the bounds. + * @param {number} y - The top-left y coordinate of the bounds. + * @param {number} width - The width of the bounds, in pixels. + * @param {number} height - The height of the bounds, in pixels. * @param {boolean} [centerOn=false] - If `true` the Camera will automatically be centered on the new bounds. * * @return {this} This Camera instance. @@ -1270,8 +1291,8 @@ var BaseCamera = new Class({ * @method Phaser.Cameras.Scene2D.BaseCamera#setSize * @since 3.0.0 * - * @param {integer} width - The width of the Camera viewport. - * @param {integer} [height=width] - The height of the Camera viewport. + * @param {number} width - The width of the Camera viewport. + * @param {number} [height=width] - The height of the Camera viewport. * * @return {this} This Camera instance. */ @@ -1301,8 +1322,8 @@ var BaseCamera = new Class({ * * @param {number} x - The top-left x coordinate of the Camera viewport. * @param {number} y - The top-left y coordinate of the Camera viewport. - * @param {integer} width - The width of the Camera viewport. - * @param {integer} [height=width] - The height of the Camera viewport. + * @param {number} width - The width of the Camera viewport. + * @param {number} [height=width] - The height of the Camera viewport. * * @return {this} This Camera instance. */ @@ -1326,23 +1347,33 @@ var BaseCamera = new Class({ * * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. * + * As of Phaser 3.50 you can now set the horizontal and vertical zoom values independently. + * * @method Phaser.Cameras.Scene2D.BaseCamera#setZoom * @since 3.0.0 * - * @param {number} [value=1] - The zoom value of the Camera. The minimum it can be is 0.001. + * @param {number} [x=1] - The horizontal zoom value of the Camera. The minimum it can be is 0.001. + * @param {number} [y=x] - The vertical zoom value of the Camera. The minimum it can be is 0.001. * * @return {this} This Camera instance. */ - setZoom: function (value) + setZoom: function (x, y) { - if (value === undefined) { value = 1; } + if (x === undefined) { x = 1; } + if (y === undefined) { y = x; } - if (value === 0) + if (x === 0) { - value = 0.001; + x = 0.001; } - this.zoom = value; + if (y === 0) + { + y = 0.001; + } + + this.zoomX = x; + this.zoomY = y; return this; }, @@ -1461,7 +1492,7 @@ var BaseCamera = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function () @@ -1717,12 +1748,76 @@ var BaseCamera = new Class({ get: function () { - return this._zoom; + return (this._zoomX + this._zoomY) / 2; }, set: function (value) { - this._zoom = value; + this._zoomX = value; + this._zoomY = value; + + this.dirty = true; + } + + }, + + /** + * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#zoomX + * @type {number} + * @default 1 + * @since 3.50.0 + */ + zoomX: { + + get: function () + { + return this._zoomX; + }, + + set: function (value) + { + this._zoomX = value; + this.dirty = true; + } + + }, + + /** + * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + * + * @name Phaser.Cameras.Scene2D.BaseCamera#zoomY + * @type {number} + * @default 1 + * @since 3.50.0 + */ + zoomY: { + + get: function () + { + return this._zoomY; + }, + + set: function (value) + { + this._zoomY = value; this.dirty = true; } @@ -1810,7 +1905,7 @@ var BaseCamera = new Class({ get: function () { - return this.width / this.zoom; + return this.width / this.zoomX; } }, @@ -1833,7 +1928,7 @@ var BaseCamera = new Class({ get: function () { - return this.height / this.zoom; + return this.height / this.zoomY; } } diff --git a/src/cameras/2d/Camera.js b/src/cameras/2d/Camera.js index c017c9b28..619beba86 100644 --- a/src/cameras/2d/Camera.js +++ b/src/cameras/2d/Camera.js @@ -5,12 +5,12 @@ */ var BaseCamera = require('./BaseCamera'); -var CanvasPool = require('../../display/canvas/CanvasPool'); var CenterOn = require('../../geom/rectangle/CenterOn'); var Clamp = require('../../math/Clamp'); var Class = require('../../utils/Class'); var Components = require('../../gameobjects/components'); var Effects = require('./effects'); +var Events = require('./events'); var Linear = require('../../math/Linear'); var Rectangle = require('../../geom/rectangle/Rectangle'); var Vector2 = require('../../math/Vector2'); @@ -46,6 +46,7 @@ var Vector2 = require('../../math/Vector2'); * @extends Phaser.Cameras.Scene2D.BaseCamera * @extends Phaser.GameObjects.Components.Flip * @extends Phaser.GameObjects.Components.Tint + * @extends Phaser.GameObjects.Components.Pipeline * * @param {number} x - The x position of the Camera, relative to the top-left of the game canvas. * @param {number} y - The y position of the Camera, relative to the top-left of the game canvas. @@ -58,7 +59,8 @@ var Camera = new Class({ Mixins: [ Components.Flip, - Components.Tint + Components.Tint, + Components.Pipeline ], initialize: @@ -67,6 +69,9 @@ var Camera = new Class({ { BaseCamera.call(this, x, y, width, height); + this.postPipelines = []; + this.pipelineData = {}; + /** * Does this Camera allow the Game Objects it renders to receive input events? * @@ -201,268 +206,6 @@ var Camera = new Class({ * @since 3.0.0 */ this._follow = null; - - /** - * Is this Camera rendering directly to the canvas or to a texture? - * - * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) - * - * Once enabled you can toggle it by switching this property. - * - * To properly remove a render texture you should call the `clearRenderToTexture()` method. - * - * @name Phaser.Cameras.Scene2D.Camera#renderToTexture - * @type {boolean} - * @default false - * @since 3.13.0 - */ - this.renderToTexture = false; - - /** - * If this Camera is rendering to a texture (via `setRenderToTexture`) then you - * have the option to control if it should also render to the Game canvas as well. - * - * By default, a Camera will render both to its texture and to the Game canvas. - * - * However, if you set ths property to `false` it will only render to the texture - * and skip rendering to the Game canvas. - * - * Setting this property if the Camera isn't rendering to a texture has no effect. - * - * @name Phaser.Cameras.Scene2D.Camera#renderToGame - * @type {boolean} - * @default true - * @since 3.23.0 - */ - this.renderToGame = true; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the HTML Canvas Element that the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#canvas - * @type {HTMLCanvasElement} - * @since 3.13.0 - */ - this.canvas = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the Rendering Context belonging to the Canvas element the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#context - * @type {CanvasRenderingContext2D} - * @since 3.13.0 - */ - this.context = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Texture belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#glTexture - * @type {?WebGLTexture} - * @since 3.13.0 - */ - this.glTexture = null; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Frame Buffer belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#framebuffer - * @type {?WebGLFramebuffer} - * @since 3.13.0 - */ - this.framebuffer = null; - - /** - * If this Camera has been set to render to a texture and to use a custom pipeline, - * then this holds a reference to the pipeline the Camera is drawing with. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.Cameras.Scene2D.Camera#pipeline - * @type {?Phaser.Renderer.WebGL.WebGLPipeline} - * @since 3.13.0 - */ - this.pipeline = null; - }, - - /** - * Sets the Camera to render to a texture instead of to the main canvas. - * - * The Camera will redirect all Game Objects it's asked to render to this texture. - * - * During the render sequence, the texture itself will then be rendered to the main canvas. - * - * Doing this gives you the ability to modify the texture before this happens, - * allowing for special effects such as Camera specific shaders, or post-processing - * on the texture. - * - * If running under Canvas the Camera will render to its `canvas` property. - * - * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. - * - * If you set a camera to render to a texture then it will emit 2 events during the render loop: - * - * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. - * - * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the - * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before - * it appears in-game. - * - * You should not enable this unless you plan on actually using the texture it creates - * somehow, otherwise you're just doubling the work required to render your game. - * - * If you only require the Camera to render to a texture, and not also to the Game, - * them set the `renderToGame` parameter to `false`. - * - * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. - * - * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, - * which will delete the respective textures and free-up resources. - * - * @method Phaser.Cameras.Scene2D.Camera#setRenderToTexture - * @since 3.13.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. - * @param {boolean} [renderToGame=true] - If you do not need the Camera to still render to the Game, set this parameter to `false`. - * - * @return {this} This Camera instance. - */ - setRenderToTexture: function (pipeline, renderToGame) - { - if (renderToGame === undefined) { renderToGame = true; } - - var renderer = this.scene.sys.game.renderer; - - if (renderer.gl) - { - this.glTexture = renderer.createTextureFromSource(null, this.width, this.height, 0); - this.framebuffer = renderer.createFramebuffer(this.width, this.height, this.glTexture, false); - } - else - { - this.canvas = CanvasPool.create2D(this, this.width, this.height); - this.context = this.canvas.getContext('2d'); - } - - this.renderToTexture = true; - this.renderToGame = renderToGame; - - if (pipeline) - { - this.setPipeline(pipeline); - } - - return this; - }, - - /** - * Sets the WebGL pipeline this Camera is using when rendering to a texture. - * - * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. - * - * Call this method with no arguments to clear any previously set pipeline. - * - * @method Phaser.Cameras.Scene2D.Camera#setPipeline - * @since 3.13.0 - * - * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} [pipeline] - The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline. - * - * @return {this} This Camera instance. - */ - setPipeline: function (pipeline) - { - if (typeof pipeline === 'string') - { - var renderer = this.scene.sys.game.renderer; - - if (renderer.gl && renderer.pipelines.has(pipeline)) - { - this.pipeline = renderer.pipelines.get(pipeline); - } - } - else - { - this.pipeline = pipeline; - } - - return this; - }, - - /** - * If this Camera was set to render to a texture, this will clear the resources it was using and - * redirect it to render back to the primary Canvas again. - * - * If you only wish to temporarily disable rendering to a texture then you can toggle the - * property `renderToTexture` instead. - * - * @method Phaser.Cameras.Scene2D.Camera#clearRenderToTexture - * @since 3.13.0 - * - * @return {this} This Camera instance. - */ - clearRenderToTexture: function () - { - if (!this.scene) - { - return; - } - - var renderer = this.scene.sys.game.renderer; - - if (!renderer) - { - return; - } - - if (renderer.gl) - { - if (this.framebuffer) - { - renderer.deleteFramebuffer(this.framebuffer); - } - - if (this.glTexture) - { - renderer.deleteTexture(this.glTexture); - } - - this.framebuffer = null; - this.glTexture = null; - this.pipeline = null; - } - else - { - CanvasPool.remove(this); - - this.canvas = null; - this.context = null; - } - - this.renderToTexture = false; - - return this; }, /** @@ -535,10 +278,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE * @since 3.3.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. @@ -559,10 +302,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE * @since 3.3.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param {any} [context] - The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. @@ -582,10 +325,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_IN_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -606,10 +349,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FADE_OUT_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -630,10 +373,10 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=250] - The duration of the effect in milliseconds. - * @param {integer} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=250] - The duration of the effect in milliseconds. + * @param {number} [red=255] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=255] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=255] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -654,7 +397,7 @@ var Camera = new Class({ * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE * @since 3.0.0 * - * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [duration=100] - The duration of the effect in milliseconds. * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {function} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -679,7 +422,7 @@ var Camera = new Class({ * * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -703,7 +446,7 @@ var Camera = new Class({ * * @param {number} radians - The destination angle in radians to rotate the Camera viewport to. If the angle is positive then the rotation is clockwise else anticlockwise * @param {boolean} [shortestPath=false] - If shortest path is set to true the camera will rotate in the quickest direction clockwise or anti-clockwise. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the rotation. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the rotation effect to start immediately, even if already running. * @param {CameraRotateCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -727,7 +470,7 @@ var Camera = new Class({ * @since 3.11.0 * * @param {number} zoom - The target Camera zoom value. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -774,6 +517,8 @@ var Camera = new Class({ CenterOn(deadzone, this.midPoint.x, this.midPoint.y); } + var emitFollowEvent = false; + if (follow && !this.panEffect.isRunning) { var fx = (follow.x - this.followOffset.x); @@ -804,6 +549,8 @@ var Camera = new Class({ sx = Linear(sx, fx - originX, this.lerp.x); sy = Linear(sy, fy - originY, this.lerp.y); } + + emitFollowEvent = true; } if (this.useBounds) @@ -816,6 +563,9 @@ var Camera = new Class({ { originX = Math.round(originX); originY = Math.round(originY); + + sx = Math.round(sx); + sy = Math.round(sy); } // Values are in pixels and not impacted by zooming the Camera @@ -832,17 +582,26 @@ var Camera = new Class({ var displayWidth = width / zoom; var displayHeight = height / zoom; - this.worldView.setTo( - midX - (displayWidth / 2), - midY - (displayHeight / 2), - displayWidth, - displayHeight - ); + var vwx = midX - (displayWidth / 2); + var vwy = midY - (displayHeight / 2); + + if (this.roundPixels) + { + vwx = Math.round(vwx); + vwy = Math.round(vwy); + } + + this.worldView.setTo(vwx, vwy, displayWidth, displayHeight); matrix.applyITRS(this.x + originX, this.y + originY, this.rotation, zoom, zoom); matrix.translate(-originX, -originY); this.shakeEffect.preRender(); + + if (emitFollowEvent) + { + this.emit(Events.FOLLOW_UPDATE, this, follow); + } }, /** @@ -1002,7 +761,7 @@ var Camera = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -1030,8 +789,6 @@ var Camera = new Class({ */ destroy: function () { - this.clearRenderToTexture(); - this.resetFX(); BaseCamera.prototype.destroy.call(this); diff --git a/src/cameras/2d/CameraManager.js b/src/cameras/2d/CameraManager.js index 27c6a739a..7e6d75a97 100644 --- a/src/cameras/2d/CameraManager.js +++ b/src/cameras/2d/CameraManager.js @@ -222,10 +222,10 @@ var CameraManager = new Class({ * @method Phaser.Cameras.Scene2D.CameraManager#add * @since 3.0.0 * - * @param {integer} [x=0] - The horizontal position of the Camera viewport. - * @param {integer} [y=0] - The vertical position of the Camera viewport. - * @param {integer} [width] - The width of the Camera viewport. If not given it'll be the game config size. - * @param {integer} [height] - The height of the Camera viewport. If not given it'll be the game config size. + * @param {number} [x=0] - The horizontal position of the Camera viewport. + * @param {number} [y=0] - The vertical position of the Camera viewport. + * @param {number} [width] - The width of the Camera viewport. If not given it'll be the game config size. + * @param {number} [height] - The height of the Camera viewport. If not given it'll be the game config size. * @param {boolean} [makeMain=false] - Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. * @param {string} [name=''] - The name of the Camera. * @@ -362,7 +362,7 @@ var CameraManager = new Class({ * * @param {boolean} [isVisible=false] - Set the `true` to only include visible Cameras in the total. * - * @return {integer} The total number of Cameras in this Camera Manager. + * @return {number} The total number of Cameras in this Camera Manager. */ getTotal: function (isVisible) { @@ -533,7 +533,7 @@ var CameraManager = new Class({ * @param {(Phaser.Cameras.Scene2D.Camera|Phaser.Cameras.Scene2D.Camera[])} camera - The Camera, or an array of Cameras, to be removed from this Camera Manager. * @param {boolean} [runDestroy=true] - Automatically call `Camera.destroy` on each Camera removed from this Camera Manager. * - * @return {integer} The total number of Cameras removed. + * @return {number} The total number of Cameras removed. */ remove: function (camera, runDestroy) { @@ -583,7 +583,7 @@ var CameraManager = new Class({ * @since 3.0.0 * * @param {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} renderer - The Renderer that will render the children to this camera. - * @param {Phaser.GameObjects.GameObject[]} children - An array of renderable Game Objects. + * @param {Phaser.GameObjects.DisplayList} children - The Display List for the Scene. */ render: function (renderer, children) { @@ -596,14 +596,45 @@ var CameraManager = new Class({ if (camera.visible && camera.alpha > 0) { - // Hard-coded to 1 for now - camera.preRender(1); + camera.preRender(); - renderer.render(scene, children, camera); + var visibleChildren = this.getVisibleChildren(children.getChildren(), camera); + + renderer.render(scene, visibleChildren, camera); } } }, + /** + * Takes an array of Game Objects and a Camera and returns a new array + * containing only those Game Objects that pass the `willRender` test + * against the given Camera. + * + * @method Phaser.Cameras.Scene2D.CameraManager#getVisibleChildren + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject[]} children - An array of Game Objects to be checked against the camera. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to filte the Game Objects against. + * + * @return {Phaser.GameObjects.GameObject[]} A filtered list of only Game Objects within the Scene that will render against the given Camera. + */ + getVisibleChildren: function (children, camera) + { + var visible = []; + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (child.willRender(camera)) + { + visible.push(child); + } + } + + return visible; + }, + /** * Resets this Camera Manager. * @@ -636,7 +667,7 @@ var CameraManager = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) diff --git a/src/cameras/2d/effects/Fade.js b/src/cameras/2d/effects/Fade.js index 0125853c9..1336c5a30 100644 --- a/src/cameras/2d/effects/Fade.js +++ b/src/cameras/2d/effects/Fade.js @@ -83,7 +83,7 @@ var Fade = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Fade#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -95,7 +95,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#red - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -106,7 +106,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#green - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -117,7 +117,7 @@ var Fade = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Fade#blue - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -184,10 +184,10 @@ var Fade = new Class({ * @since 3.5.0 * * @param {boolean} [direction=true] - The direction of the fade. `true` = fade out (transparent to color), `false` = fade in (color to transparent) - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. - * @param {integer} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. - * @param {integer} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. - * @param {integer} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [red=0] - The amount to fade the red channel towards. A value between 0 and 255. + * @param {number} [green=0] - The amount to fade the green channel towards. A value between 0 and 255. + * @param {number} [blue=0] - The amount to fade the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraFadeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -240,7 +240,7 @@ var Fade = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Fade#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -290,7 +290,7 @@ var Fade = new Class({ var camera = this.camera; ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; - ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + ctx.fillRect(camera.x, camera.y, camera.width, camera.height); return true; }, @@ -315,12 +315,12 @@ var Fade = new Class({ var camera = this.camera; var red = this.red / 255; - var blue = this.blue / 255; var green = this.green / 255; + var blue = this.blue / 255; pipeline.drawFillRect( - camera._cx, camera._cy, camera._cw, camera._ch, - getTintFunction(red, green, blue, 1), + camera.x, camera.y, camera.width, camera.height, + getTintFunction(blue, green, red, 1), this.alpha ); diff --git a/src/cameras/2d/effects/Flash.js b/src/cameras/2d/effects/Flash.js index 989ecc10d..2e4b61ea2 100644 --- a/src/cameras/2d/effects/Flash.js +++ b/src/cameras/2d/effects/Flash.js @@ -58,7 +58,7 @@ var Flash = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Flash#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -70,7 +70,7 @@ var Flash = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#red - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -81,7 +81,7 @@ var Flash = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#green - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -92,7 +92,7 @@ var Flash = new Class({ * A value between 0 and 255. * * @name Phaser.Cameras.Scene2D.Effects.Flash#blue - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -158,10 +158,10 @@ var Flash = new Class({ * @fires Phaser.Cameras.Scene2D.Events#FLASH_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=250] - The duration of the effect in milliseconds. - * @param {integer} [red=255] - The amount to flash the red channel towards. A value between 0 and 255. - * @param {integer} [green=255] - The amount to flash the green channel towards. A value between 0 and 255. - * @param {integer} [blue=255] - The amount to flash the blue channel towards. A value between 0 and 255. + * @param {number} [duration=250] - The duration of the effect in milliseconds. + * @param {number} [red=255] - The amount to flash the red channel towards. A value between 0 and 255. + * @param {number} [green=255] - The amount to flash the green channel towards. A value between 0 and 255. + * @param {number} [blue=255] - The amount to flash the blue channel towards. A value between 0 and 255. * @param {boolean} [force=false] - Force the effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraFlashCallback} [callback] - This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. @@ -209,7 +209,7 @@ var Flash = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Flash#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -258,7 +258,7 @@ var Flash = new Class({ var camera = this.camera; ctx.fillStyle = 'rgba(' + this.red + ',' + this.green + ',' + this.blue + ',' + this.alpha + ')'; - ctx.fillRect(camera._cx, camera._cy, camera._cw, camera._ch); + ctx.fillRect(camera.x, camera.y, camera.width, camera.height); return true; }, @@ -283,12 +283,12 @@ var Flash = new Class({ var camera = this.camera; var red = this.red / 255; - var blue = this.blue / 255; var green = this.green / 255; + var blue = this.blue / 255; pipeline.drawFillRect( - camera._cx, camera._cy, camera._cw, camera._ch, - getTintFunction(red, green, blue, 1), + camera.x, camera.y, camera.width, camera.height, + getTintFunction(blue, green, red, 1), this.alpha ); diff --git a/src/cameras/2d/effects/Pan.js b/src/cameras/2d/effects/Pan.js index 9868c4830..b767a8506 100644 --- a/src/cameras/2d/effects/Pan.js +++ b/src/cameras/2d/effects/Pan.js @@ -61,7 +61,7 @@ var Pan = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Pan#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.11.0 @@ -156,7 +156,7 @@ var Pan = new Class({ * * @param {number} x - The destination x coordinate to scroll the center of the Camera viewport to. * @param {number} y - The destination y coordinate to scroll the center of the Camera viewport to. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the pan. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the pan effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraPanCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -220,7 +220,7 @@ var Pan = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Pan#update * @since 3.11.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) diff --git a/src/cameras/2d/effects/RotateTo.js b/src/cameras/2d/effects/RotateTo.js index 3e1cd2a12..f0bb78622 100644 --- a/src/cameras/2d/effects/RotateTo.js +++ b/src/cameras/2d/effects/RotateTo.js @@ -66,7 +66,7 @@ var RotateTo = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.RotateTo#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.23.0 @@ -187,7 +187,7 @@ var RotateTo = new Class({ * * @param {number} radians - The destination angle in radians to rotate the Camera viewport to. If the angle is positive then the rotation is clockwise else anticlockwise * @param {boolean} [shortestPath=false] - If shortest path is set to true the camera will rotate in the quickest direction clockwise or anti-clockwise. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the Rotate. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the rotation effect to start immediately, even if already running. * @param {CameraRotateCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -302,7 +302,7 @@ var RotateTo = new Class({ * @method Phaser.Cameras.Scene2D.Effects.RotateTo#update * @since 3.23.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) diff --git a/src/cameras/2d/effects/Shake.js b/src/cameras/2d/effects/Shake.js index e172de008..cf59ce2ce 100644 --- a/src/cameras/2d/effects/Shake.js +++ b/src/cameras/2d/effects/Shake.js @@ -59,7 +59,7 @@ var Shake = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Shake#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.5.0 @@ -148,7 +148,7 @@ var Shake = new Class({ * @fires Phaser.Cameras.Scene2D.Events#SHAKE_COMPLETE * @since 3.5.0 * - * @param {integer} [duration=100] - The duration of the effect in milliseconds. + * @param {number} [duration=100] - The duration of the effect in milliseconds. * @param {(number|Phaser.Math.Vector2)} [intensity=0.05] - The intensity of the shake. * @param {boolean} [force=false] - Force the shake effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraShakeCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -215,7 +215,7 @@ var Shake = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Shake#update * @since 3.5.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) @@ -237,8 +237,8 @@ var Shake = new Class({ if (this._elapsed < this.duration) { var intensity = this.intensity; - var width = this.camera._cw; - var height = this.camera._ch; + var width = this.camera.width; + var height = this.camera.height; var zoom = this.camera.zoom; this._offsetX = (Math.random() * intensity.x * width * 2 - intensity.x * width) * zoom; diff --git a/src/cameras/2d/effects/Zoom.js b/src/cameras/2d/effects/Zoom.js index 6d3888f0d..6f05cbe45 100644 --- a/src/cameras/2d/effects/Zoom.js +++ b/src/cameras/2d/effects/Zoom.js @@ -56,7 +56,7 @@ var Zoom = new Class({ * The duration of the effect, in milliseconds. * * @name Phaser.Cameras.Scene2D.Effects.Zoom#duration - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.11.0 @@ -140,7 +140,7 @@ var Zoom = new Class({ * @since 3.11.0 * * @param {number} zoom - The target Camera zoom value. - * @param {integer} [duration=1000] - The duration of the effect in milliseconds. + * @param {number} [duration=1000] - The duration of the effect in milliseconds. * @param {(string|function)} [ease='Linear'] - The ease to use for the Zoom. Can be any of the Phaser Easing constants or a custom function. * @param {boolean} [force=false] - Force the zoom effect to start immediately, even if already running. * @param {Phaser.Types.Cameras.Scene2D.CameraZoomCallback} [callback] - This callback will be invoked every frame for the duration of the effect. @@ -201,7 +201,7 @@ var Zoom = new Class({ * @method Phaser.Cameras.Scene2D.Effects.Zoom#update * @since 3.11.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ update: function (time, delta) diff --git a/src/cameras/2d/events/FADE_IN_START_EVENT.js b/src/cameras/2d/events/FADE_IN_START_EVENT.js index fcf55f777..621e9fea8 100644 --- a/src/cameras/2d/events/FADE_IN_START_EVENT.js +++ b/src/cameras/2d/events/FADE_IN_START_EVENT.js @@ -16,9 +16,9 @@ * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'camerafadeinstart'; diff --git a/src/cameras/2d/events/FADE_OUT_START_EVENT.js b/src/cameras/2d/events/FADE_OUT_START_EVENT.js index 1804bf91b..cadc4386c 100644 --- a/src/cameras/2d/events/FADE_OUT_START_EVENT.js +++ b/src/cameras/2d/events/FADE_OUT_START_EVENT.js @@ -16,9 +16,9 @@ * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Fade} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'camerafadeoutstart'; diff --git a/src/cameras/2d/events/FLASH_START_EVENT.js b/src/cameras/2d/events/FLASH_START_EVENT.js index 4934b7a03..422b02073 100644 --- a/src/cameras/2d/events/FLASH_START_EVENT.js +++ b/src/cameras/2d/events/FLASH_START_EVENT.js @@ -14,9 +14,9 @@ * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Flash} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. - * @param {integer} red - The red color channel value. - * @param {integer} green - The green color channel value. - * @param {integer} blue - The blue color channel value. + * @param {number} duration - The duration of the effect. + * @param {number} red - The red color channel value. + * @param {number} green - The green color channel value. + * @param {number} blue - The blue color channel value. */ module.exports = 'cameraflashstart'; diff --git a/src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js b/src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js new file mode 100644 index 000000000..e41ec44a3 --- /dev/null +++ b/src/cameras/2d/events/FOLLOW_UPDATE_EVENT.js @@ -0,0 +1,22 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Camera Follower Update Event. + * + * This event is dispatched by a Camera instance when it is following a + * Game Object and the Camera position has been updated as a result of + * that following. + * + * Listen to it from a Camera instance using: `camera.on('followupdate', listener)`. + * + * @event Phaser.Cameras.Scene2D.Events#FOLLOW_UPDATE + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.BaseCamera} camera - The camera that emitted the event. + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the camera is following. + */ +module.exports = 'followupdate'; diff --git a/src/cameras/2d/events/PAN_START_EVENT.js b/src/cameras/2d/events/PAN_START_EVENT.js index 60b71e691..ef270397f 100644 --- a/src/cameras/2d/events/PAN_START_EVENT.js +++ b/src/cameras/2d/events/PAN_START_EVENT.js @@ -14,7 +14,7 @@ * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Pan} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} x - The destination scroll x coordinate. * @param {number} y - The destination scroll y coordinate. */ diff --git a/src/cameras/2d/events/ROTATE_START_EVENT.js b/src/cameras/2d/events/ROTATE_START_EVENT.js index 7e3ba8c17..6846b53ad 100644 --- a/src/cameras/2d/events/ROTATE_START_EVENT.js +++ b/src/cameras/2d/events/ROTATE_START_EVENT.js @@ -14,7 +14,7 @@ * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.RotateTo} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} destination - The destination value. */ module.exports = 'camerarotatestart'; diff --git a/src/cameras/2d/events/SHAKE_START_EVENT.js b/src/cameras/2d/events/SHAKE_START_EVENT.js index 08614f75f..25003058a 100644 --- a/src/cameras/2d/events/SHAKE_START_EVENT.js +++ b/src/cameras/2d/events/SHAKE_START_EVENT.js @@ -14,7 +14,7 @@ * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Shake} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} intensity - The intensity of the effect. */ module.exports = 'camerashakestart'; diff --git a/src/cameras/2d/events/ZOOM_START_EVENT.js b/src/cameras/2d/events/ZOOM_START_EVENT.js index 02cf9e0b3..c80eea7e9 100644 --- a/src/cameras/2d/events/ZOOM_START_EVENT.js +++ b/src/cameras/2d/events/ZOOM_START_EVENT.js @@ -14,7 +14,7 @@ * * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera that the effect began on. * @param {Phaser.Cameras.Scene2D.Effects.Zoom} effect - A reference to the effect instance. - * @param {integer} duration - The duration of the effect. + * @param {number} duration - The duration of the effect. * @param {number} zoom - The destination zoom value. */ module.exports = 'camerazoomstart'; diff --git a/src/cameras/2d/events/index.js b/src/cameras/2d/events/index.js index 9695e4091..e595b561f 100644 --- a/src/cameras/2d/events/index.js +++ b/src/cameras/2d/events/index.js @@ -17,6 +17,7 @@ module.exports = { FADE_OUT_START: require('./FADE_OUT_START_EVENT'), FLASH_COMPLETE: require('./FLASH_COMPLETE_EVENT'), FLASH_START: require('./FLASH_START_EVENT'), + FOLLOW_UPDATE: require('./FOLLOW_UPDATE_EVENT'), PAN_COMPLETE: require('./PAN_COMPLETE_EVENT'), PAN_START: require('./PAN_START_EVENT'), POST_RENDER: require('./POST_RENDER_EVENT'), diff --git a/src/cameras/2d/typedefs/CameraConfig.js b/src/cameras/2d/typedefs/CameraConfig.js index bff3b1147..73c97a588 100644 --- a/src/cameras/2d/typedefs/CameraConfig.js +++ b/src/cameras/2d/typedefs/CameraConfig.js @@ -3,10 +3,10 @@ * @since 3.0.0 * * @property {string} [name=''] - The name of the Camera. - * @property {integer} [x=0] - The horizontal position of the Camera viewport. - * @property {integer} [y=0] - The vertical position of the Camera viewport. - * @property {integer} [width] - The width of the Camera viewport. - * @property {integer} [height] - The height of the Camera viewport. + * @property {number} [x=0] - The horizontal position of the Camera viewport. + * @property {number} [y=0] - The vertical position of the Camera viewport. + * @property {number} [width] - The width of the Camera viewport. + * @property {number} [height] - The height of the Camera viewport. * @property {number} [zoom=1] - The default zoom level of the Camera. * @property {number} [rotation=0] - The rotation of the Camera, in radians. * @property {boolean} [roundPixels=false] - Should the Camera round pixels before rendering? diff --git a/src/const.js b/src/const.js index 4e89b5142..745e53366 100644 --- a/src/const.js +++ b/src/const.js @@ -20,7 +20,7 @@ var CONST = { * @type {string} * @since 3.0.0 */ - VERSION: '3.50.0-beta.7', + VERSION: '3.50.0-beta.13', BlendModes: require('./renderer/BlendModes'), @@ -32,7 +32,7 @@ var CONST = { * * @name Phaser.AUTO * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ AUTO: 0, @@ -43,7 +43,7 @@ var CONST = { * * @name Phaser.CANVAS * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ CANVAS: 1, @@ -55,7 +55,7 @@ var CONST = { * * @name Phaser.WEBGL * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ WEBGL: 2, @@ -67,7 +67,7 @@ var CONST = { * * @name Phaser.HEADLESS * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ HEADLESS: 3, @@ -78,7 +78,7 @@ var CONST = { * * @name Phaser.FOREVER * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ FOREVER: -1, @@ -88,7 +88,7 @@ var CONST = { * * @name Phaser.NONE * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ NONE: 4, @@ -98,7 +98,7 @@ var CONST = { * * @name Phaser.UP * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ UP: 5, @@ -108,7 +108,7 @@ var CONST = { * * @name Phaser.DOWN * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ DOWN: 6, @@ -118,7 +118,7 @@ var CONST = { * * @name Phaser.LEFT * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ LEFT: 7, @@ -128,7 +128,7 @@ var CONST = { * * @name Phaser.RIGHT * @const - * @type {integer} + * @type {number} * @since 3.0.0 */ RIGHT: 8 diff --git a/src/core/Config.js b/src/core/Config.js index 68a0ce865..ec3fc9ed2 100644 --- a/src/core/Config.js +++ b/src/core/Config.js @@ -47,17 +47,17 @@ var Config = new Class({ var defaultBannerTextColor = '#ffffff'; /** - * @const {(integer|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. + * @const {(number|string)} Phaser.Core.Config#width - The width of the underlying canvas, in pixels. */ this.width = GetValue(config, 'width', 1024); /** - * @const {(integer|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. + * @const {(number|string)} Phaser.Core.Config#height - The height of the underlying canvas, in pixels. */ this.height = GetValue(config, 'height', 768); /** - * @const {(Phaser.Scale.ZoomType|integer)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. + * @const {(Phaser.Scale.ZoomType|number)} Phaser.Core.Config#zoom - The zoom factor, as used by the Scale Manager. */ this.zoom = GetValue(config, 'zoom', 1); @@ -77,7 +77,7 @@ var Config = new Class({ this.expandParent = GetValue(config, 'expandParent', true); /** - * @const {integer} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. + * @const {number} Phaser.Core.Config#autoRound - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. */ this.autoRound = GetValue(config, 'autoRound', false); @@ -87,7 +87,7 @@ var Config = new Class({ this.autoCenter = GetValue(config, 'autoCenter', 0); /** - * @const {integer} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? + * @const {number} Phaser.Core.Config#resizeInterval - How many ms should elapse before checking if the browser size has changed? */ this.resizeInterval = GetValue(config, 'resizeInterval', 500); @@ -97,22 +97,22 @@ var Config = new Class({ this.fullscreenTarget = GetValue(config, 'fullscreenTarget', null); /** - * @const {integer} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. + * @const {number} Phaser.Core.Config#minWidth - The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. */ this.minWidth = GetValue(config, 'minWidth', 0); /** - * @const {integer} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. + * @const {number} Phaser.Core.Config#maxWidth - The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. */ this.maxWidth = GetValue(config, 'maxWidth', 0); /** - * @const {integer} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. + * @const {number} Phaser.Core.Config#minHeight - The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. */ this.minHeight = GetValue(config, 'minHeight', 0); /** - * @const {integer} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. + * @const {number} Phaser.Core.Config#maxHeight - The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. */ this.maxHeight = GetValue(config, 'maxHeight', 0); @@ -220,7 +220,7 @@ var Config = new Class({ this.inputKeyboardEventTarget = GetValue(config, 'input.keyboard.target', window); /** - * @const {?integer[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. + * @const {?number[]} Phaser.Core.Config#inputKeyboardCapture - `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. */ this.inputKeyboardCapture = GetValue(config, 'input.keyboard.capture', []); @@ -235,20 +235,25 @@ var Config = new Class({ this.inputMouseEventTarget = GetValue(config, 'input.mouse.target', null); /** - * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultDown - Should `mousedown` events be captured? I.e. have prevent default called on them. + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultDown - Should `mousedown` DOM events have `preventDefault` called on them? */ this.inputMousePreventDefaultDown = GetValue(config, 'input.mouse.preventDefaultDown', true); /** - * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultUp - Should `mouseup` events be captured? I.e. have prevent default called on them. + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultUp - Should `mouseup` DOM events have `preventDefault` called on them? */ this.inputMousePreventDefaultUp = GetValue(config, 'input.mouse.preventDefaultUp', true); /** - * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultMove - Should `mousemove` events be captured? I.e. have prevent default called on them. + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultMove - Should `mousemove` DOM events have `preventDefault` called on them? */ this.inputMousePreventDefaultMove = GetValue(config, 'input.mouse.preventDefaultMove', true); + /** + * @const {boolean} Phaser.Core.Config#inputMousePreventDefaultWheel - Should `wheel` DOM events have `preventDefault` called on them? + */ + this.inputMousePreventDefaultWheel = GetValue(config, 'input.mouse.preventDefaultWheel', true); + /** * @const {boolean} Phaser.Core.Config#inputTouch - Enable the Touch Plugin. This can be disabled in games that don't need touch input. */ @@ -265,12 +270,12 @@ var Config = new Class({ this.inputTouchCapture = GetValue(config, 'input.touch.capture', true); /** - * @const {integer} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. + * @const {number} Phaser.Core.Config#inputActivePointers - The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. */ this.inputActivePointers = GetValue(config, 'input.activePointers', 1); /** - * @const {integer} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. + * @const {number} Phaser.Core.Config#inputSmoothFactor - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. */ this.inputSmoothFactor = GetValue(config, 'input.smoothFactor', 0); @@ -327,7 +332,7 @@ var Config = new Class({ } /** - * @const {?Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class. + * @const {Phaser.Types.Core.FPSConfig} Phaser.Core.Config#fps - The Frame Rate Configuration object, as parsed by the Timestep class. */ this.fps = GetValue(config, 'fps', null); @@ -336,6 +341,11 @@ var Config = new Class({ var renderConfig = GetValue(config, 'render', config); + /** + * @const {Phaser.Types.Core.PipelineConfig} Phaser.Core.Config#pipeline - An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances. + */ + this.pipeline = GetValue(renderConfig, 'pipeline', null); + /** * @const {boolean} Phaser.Core.Config#antialias - When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. */ @@ -399,17 +409,17 @@ var Config = new Class({ this.powerPreference = GetValue(renderConfig, 'powerPreference', 'default'); /** - * @const {integer} Phaser.Core.Config#batchSize - The default WebGL Batch size. + * @const {number} Phaser.Core.Config#batchSize - The default WebGL Batch size. Represents the number of _quads_ that can be added to a single batch. */ this.batchSize = GetValue(renderConfig, 'batchSize', 4096); /** - * @const {integer} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. + * @const {number} Phaser.Core.Config#maxTextures - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. */ this.maxTextures = GetValue(renderConfig, 'maxTextures', -1); /** - * @const {integer} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + * @const {number} Phaser.Core.Config#maxLights - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ this.maxLights = GetValue(renderConfig, 'maxLights', 10); @@ -420,8 +430,9 @@ var Config = new Class({ */ this.backgroundColor = ValueToColor(bgc); - if (bgc === 0 && this.transparent) + if (this.transparent) { + this.backgroundColor = ValueToColor(0x000000); this.backgroundColor.alpha = 0; } @@ -456,7 +467,7 @@ var Config = new Class({ this.loaderPath = GetValue(config, 'loader.path', ''); /** - * @const {integer} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). + * @const {number} Phaser.Core.Config#loaderMaxParallelDownloads - Maximum parallel downloads allowed for resources (Default to 32). */ var defaultParallel = (Device.os.android) ? 6 : 32; @@ -488,7 +499,7 @@ var Config = new Class({ this.loaderPassword = GetValue(config, 'loader.password', ''); /** - * @const {integer} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms. + * @const {number} Phaser.Core.Config#loaderTimeout - Optional XHR timeout value, in ms. */ this.loaderTimeout = GetValue(config, 'loader.timeout', 0); diff --git a/src/core/TimeStep.js b/src/core/TimeStep.js index 0aa5eb709..cbccfb1c4 100644 --- a/src/core/TimeStep.js +++ b/src/core/TimeStep.js @@ -89,7 +89,7 @@ var TimeStep = new Class({ * The minimum fps rate you want the Time Step to run at. * * @name Phaser.Core.TimeStep#minFps - * @type {integer} + * @type {number} * @default 5 * @since 3.0.0 */ @@ -103,7 +103,7 @@ var TimeStep = new Class({ * is spiraling out of control. * * @name Phaser.Core.TimeStep#targetFps - * @type {integer} + * @type {number} * @default 60 * @since 3.0.0 */ @@ -135,7 +135,7 @@ var TimeStep = new Class({ * An exponential moving average of the frames per second. * * @name Phaser.Core.TimeStep#actualFps - * @type {integer} + * @type {number} * @readonly * @default 60 * @since 3.0.0 @@ -147,7 +147,7 @@ var TimeStep = new Class({ * When an fps update happens, the `framesThisSecond` value is reset. * * @name Phaser.Core.TimeStep#nextFpsUpdate - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -158,7 +158,7 @@ var TimeStep = new Class({ * The number of frames processed this second. * * @name Phaser.Core.TimeStep#framesThisSecond - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -223,7 +223,7 @@ var TimeStep = new Class({ * time has passed and is unaffected by delta smoothing. * * @name Phaser.Core.TimeStep#frame - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.0.0 @@ -257,7 +257,7 @@ var TimeStep = new Class({ * An internal counter to allow for the browser 'cooling down' after coming back into focus. * * @name Phaser.Core.TimeStep#_coolDown - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -268,7 +268,7 @@ var TimeStep = new Class({ * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. * * @name Phaser.Core.TimeStep#delta - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -278,7 +278,7 @@ var TimeStep = new Class({ * Internal index of the delta history position. * * @name Phaser.Core.TimeStep#deltaIndex - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -288,7 +288,7 @@ var TimeStep = new Class({ * Internal array holding the previous delta values, used for delta smoothing. * * @name Phaser.Core.TimeStep#deltaHistory - * @type {integer[]} + * @type {number[]} * @since 3.0.0 */ this.deltaHistory = []; @@ -299,7 +299,7 @@ var TimeStep = new Class({ * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. * * @name Phaser.Core.TimeStep#deltaSmoothingMax - * @type {integer} + * @type {number} * @default 10 * @since 3.0.0 */ @@ -312,7 +312,7 @@ var TimeStep = new Class({ * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. * * @name Phaser.Core.TimeStep#panicMax - * @type {integer} + * @type {number} * @default 120 * @since 3.0.0 */ diff --git a/src/core/typedefs/FPSConfig.js b/src/core/typedefs/FPSConfig.js index 00a1a0607..fac3ca108 100644 --- a/src/core/typedefs/FPSConfig.js +++ b/src/core/typedefs/FPSConfig.js @@ -2,10 +2,10 @@ * @typedef {object} Phaser.Types.Core.FPSConfig * @since 3.0.0 * - * @property {integer} [min=5] - The minimum acceptable rendering rate, in frames per second. - * @property {integer} [target=60] - The optimum rendering rate, in frames per second. + * @property {number} [min=5] - The minimum acceptable rendering rate, in frames per second. + * @property {number} [target=60] - The optimum rendering rate, in frames per second. This does not enforce the fps rate, it merely tells Phaser what rate is considered optimal for this game. * @property {boolean} [forceSetTimeOut=false] - Use setTimeout instead of requestAnimationFrame to run the game loop. - * @property {integer} [deltaHistory=10] - Calculate the average frame delta from this many consecutive frame intervals. - * @property {integer} [panicMax=120] - The amount of frames the time step counts before we trust the delta values again. + * @property {number} [deltaHistory=10] - Calculate the average frame delta from this many consecutive frame intervals. + * @property {number} [panicMax=120] - The amount of frames the time step counts before we trust the delta values again. * @property {boolean} [smoothStep=true] - Apply delta smoothing during the game update to help avoid spikes? */ diff --git a/src/core/typedefs/GameConfig.js b/src/core/typedefs/GameConfig.js index 1104d1049..348d69146 100644 --- a/src/core/typedefs/GameConfig.js +++ b/src/core/typedefs/GameConfig.js @@ -2,8 +2,8 @@ * @typedef {object} Phaser.Types.Core.GameConfig * @since 3.0.0 * - * @property {(integer|string)} [width=1024] - The width of the game, in game pixels. - * @property {(integer|string)} [height=768] - The height of the game, in game pixels. + * @property {(number|string)} [width=1024] - The width of the game, in game pixels. + * @property {(number|string)} [height=768] - The height of the game, in game pixels. * @property {number} [zoom=1] - Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. * @property {number} [type=CONST.AUTO] - Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. * @property {(HTMLElement|string)} [parent=undefined] - The DOM element that will contain the game canvas, or its `id`. If undefined, or if the named element doesn't exist, the game canvas is appended to the document body. If `null` no parent will be used and you are responsible for adding the canvas to the dom. @@ -32,4 +32,5 @@ * @property {Phaser.Types.Core.PluginObject|Phaser.Types.Core.PluginObjectItem[]} [plugins] - Plugins to install. * @property {Phaser.Types.Core.ScaleConfig} [scale] - The Scale Manager configuration. * @property {Phaser.Types.Core.AudioConfig} [audio] - The Audio Configuration object. + * @property {Phaser.Types.Core.PipelineConfig} [pipeline] - A WebGL Pipeline configuration object. Can also be part of the `RenderConfig`. */ diff --git a/src/core/typedefs/InputConfig.js b/src/core/typedefs/InputConfig.js index 2f67d234a..6c9ab1f0f 100644 --- a/src/core/typedefs/InputConfig.js +++ b/src/core/typedefs/InputConfig.js @@ -6,7 +6,7 @@ * @property {(boolean|Phaser.Types.Core.MouseInputConfig)} [mouse=true] - Mouse input configuration. `true` uses the default configuration and `false` disables mouse input. * @property {(boolean|Phaser.Types.Core.TouchInputConfig)} [touch=true] - Touch input configuration. `true` uses the default configuration and `false` disables touch input. * @property {(boolean|Phaser.Types.Core.GamepadInputConfig)} [gamepad=false] - Gamepad input configuration. `true` enables gamepad input. - * @property {integer} [activePointers=1] - The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. + * @property {number} [activePointers=1] - The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. * @property {number} [smoothFactor=0] - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. * @property {boolean} [windowEvents=true] - Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. */ diff --git a/src/core/typedefs/KeyboardInputConfig.js b/src/core/typedefs/KeyboardInputConfig.js index a7c0814fc..8f932250b 100644 --- a/src/core/typedefs/KeyboardInputConfig.js +++ b/src/core/typedefs/KeyboardInputConfig.js @@ -3,5 +3,5 @@ * @since 3.0.0 * * @property {*} [target=window] - Where the Keyboard Manager listens for keyboard input events. - * @property {?integer[]} [capture] - `preventDefault` will be called on every non-modified key which has a key code in this array. By default it is empty. + * @property {?number[]} [capture] - `preventDefault` will be called on every non-modified key which has a key code in this array. By default it is empty. */ diff --git a/src/core/typedefs/LoaderConfig.js b/src/core/typedefs/LoaderConfig.js index 7187cb9c2..9fee5f783 100644 --- a/src/core/typedefs/LoaderConfig.js +++ b/src/core/typedefs/LoaderConfig.js @@ -4,11 +4,11 @@ * * @property {string} [baseURL] - A URL used to resolve paths given to the loader. Example: 'http://labs.phaser.io/assets/'. * @property {string} [path] - A URL path used to resolve relative paths given to the loader. Example: 'images/sprites/'. - * @property {integer} [maxParallelDownloads=32] - The maximum number of resources the loader will start loading at once. + * @property {number} [maxParallelDownloads=32] - The maximum number of resources the loader will start loading at once. * @property {(string|undefined)} [crossOrigin=undefined] - 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. * @property {string} [responseType] - The response type of the XHR request, e.g. `blob`, `text`, etc. * @property {boolean} [async=true] - Should the XHR request use async or not? * @property {string} [user] - Optional username for all XHR requests. * @property {string} [password] - Optional password for all XHR requests. - * @property {integer} [timeout=0] - Optional XHR timeout value, in ms. + * @property {number} [timeout=0] - Optional XHR timeout value, in ms. */ diff --git a/src/core/typedefs/MouseInputConfig.js b/src/core/typedefs/MouseInputConfig.js index fc0891873..7b564398e 100644 --- a/src/core/typedefs/MouseInputConfig.js +++ b/src/core/typedefs/MouseInputConfig.js @@ -6,4 +6,5 @@ * @property {boolean} [preventDefaultDown=true] - If `true` the DOM `mousedown` event will have `preventDefault` set. * @property {boolean} [preventDefaultUp=true] - If `true` the DOM `mouseup` event will have `preventDefault` set. * @property {boolean} [preventDefaultMove=true] - If `true` the DOM `mousemove` event will have `preventDefault` set. + * @property {boolean} [preventDefaultWheel=true] - If `true` the DOM `wheel` event will have `preventDefault` set. */ diff --git a/src/core/typedefs/PipelineConfig.js b/src/core/typedefs/PipelineConfig.js new file mode 100644 index 000000000..718393472 --- /dev/null +++ b/src/core/typedefs/PipelineConfig.js @@ -0,0 +1,7 @@ +/** + * @typedef {object} Phaser.Types.Core.PipelineConfig + * @since 3.50.0 + * + * @property {string} name - The name of the pipeline. Must be unique within the Pipeline Manager. + * @property {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline class. This should be a constructable object, **not** an instance of a class. + */ diff --git a/src/core/typedefs/RenderConfig.js b/src/core/typedefs/RenderConfig.js index 677524224..1c0eb9873 100644 --- a/src/core/typedefs/RenderConfig.js +++ b/src/core/typedefs/RenderConfig.js @@ -12,8 +12,9 @@ * @property {boolean} [premultipliedAlpha=true] - In WebGL mode, the drawing buffer contains colors with pre-multiplied alpha. * @property {boolean} [failIfMajorPerformanceCaveat=false] - Let the browser abort creating a WebGL context if it judges performance would be unacceptable. * @property {string} [powerPreference='default'] - "high-performance", "low-power" or "default". A hint to the browser on how much device power the game might use. - * @property {integer} [batchSize=2000] - The default WebGL batch size. - * @property {integer} [maxLights=10] - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. - * @property {integer} [maxTextures=-1] - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. + * @property {number} [batchSize=4096] - The default WebGL batch size. Represents the number of _quads_ that can be added to a single batch. + * @property {number} [maxLights=10] - The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. + * @property {number} [maxTextures=-1] - When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. * @property {string} [mipmapFilter='LINEAR'] - The mipmap magFilter to be used when creating WebGL textures. + * @property {Phaser.Types.Core.PipelineConfig} [pipline] - The WebGL Pipeline configuration object. */ diff --git a/src/core/typedefs/ScaleConfig.js b/src/core/typedefs/ScaleConfig.js index fb3282657..19bbda1a9 100644 --- a/src/core/typedefs/ScaleConfig.js +++ b/src/core/typedefs/ScaleConfig.js @@ -2,9 +2,9 @@ * @typedef {object} Phaser.Types.Core.ScaleConfig * @since 3.16.0 * - * @property {(integer|string)} [width=1024] - The base width of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. - * @property {(integer|string)} [height=768] - The base height of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. - * @property {(Phaser.Scale.ZoomType|integer)} [zoom=1] - The zoom value of the game canvas. + * @property {(number|string)} [width=1024] - The base width of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. + * @property {(number|string)} [height=768] - The base height of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. + * @property {(Phaser.Scale.ZoomType|number)} [zoom=1] - The zoom value of the game canvas. * @property {?(HTMLElement|string)} [parent] - The DOM element that will contain the game canvas, or its `id`. If undefined, or if the named element doesn't exist, the game canvas is inserted directly into the document body. If `null` no parent will be used and you are responsible for adding the canvas to your environment. * @property {boolean} [expandParent=true] - Is the Scale Manager allowed to adjust the CSS height property of the parent and/or document body to be 100%? * @property {Phaser.Scale.ScaleModeType} [mode=Phaser.Scale.ScaleModes.NONE] - The scale mode. @@ -12,6 +12,6 @@ * @property {WidthHeight} [max] - The maximum width the canvas can be scaled up to. * @property {boolean} [autoRound=false] - Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. * @property {Phaser.Scale.CenterType} [autoCenter=Phaser.Scale.Center.NO_CENTER] - Automatically center the canvas within the parent? - * @property {integer} [resizeInterval=500] - How many ms should elapse before checking if the browser size has changed? + * @property {number} [resizeInterval=500] - How many ms should elapse before checking if the browser size has changed? * @property {?(HTMLElement|string)} [fullscreenTarget] - The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. */ diff --git a/src/core/typedefs/WidthHeight.js b/src/core/typedefs/WidthHeight.js index d058aaa08..32780602e 100644 --- a/src/core/typedefs/WidthHeight.js +++ b/src/core/typedefs/WidthHeight.js @@ -2,6 +2,6 @@ * @typedef {object} Phaser.Types.Core.WidthHeight * @since 3.16.0 * - * @property {integer} [width=0] - The width. - * @property {integer} [height=0] - The height. + * @property {number} [width=0] - The width. + * @property {number} [height=0] - The height. */ diff --git a/src/curves/CubicBezierCurve.js b/src/curves/CubicBezierCurve.js index 231200479..d7ef99f0c 100644 --- a/src/curves/CubicBezierCurve.js +++ b/src/curves/CubicBezierCurve.js @@ -149,7 +149,7 @@ var CubicBezierCurve = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The graphics object this curve should be drawn to. - * @param {integer} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. + * @param {number} [pointsTotal=32] - The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. * * @return {Phaser.GameObjects.Graphics} The graphics object this curve was drawn to. Useful for method chaining. */ diff --git a/src/curves/Curve.js b/src/curves/Curve.js index f16b51fda..5341d4c32 100644 --- a/src/curves/Curve.js +++ b/src/curves/Curve.js @@ -41,7 +41,7 @@ var Curve = new Class({ * The default number of divisions within the curve. * * @name Phaser.Curves.Curve#defaultDivisions - * @type {integer} + * @type {number} * @default 5 * @since 3.0.0 */ @@ -51,7 +51,7 @@ var Curve = new Class({ * The quantity of arc length divisions within the curve. * * @name Phaser.Curves.Curve#arcLengthDivisions - * @type {integer} + * @type {number} * @default 100 * @since 3.0.0 */ @@ -120,7 +120,7 @@ var Curve = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The Graphics instance onto which this curve will be drawn. - * @param {integer} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. + * @param {number} [pointsTotal=32] - The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. * * @return {Phaser.GameObjects.Graphics} The Graphics object to which the curve was drawn. */ @@ -142,7 +142,7 @@ var Curve = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. If falsey a new object will be created. - * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. + * @param {number} [accuracy=16] - The accuracy of the bounds calculations. * * @return {Phaser.Geom.Rectangle} A Rectangle object holding the bounds of this curve. If `out` was given it will be this object. */ @@ -173,7 +173,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getDistancePoints * @since 3.0.0 * - * @param {integer} distance - The distance, in pixels, between each point along the curve. + * @param {number} distance - The distance, in pixels, between each point along the curve. * * @return {Phaser.Geom.Point[]} An Array of Point objects. */ @@ -233,7 +233,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getLengths * @since 3.0.0 * - * @param {integer} [divisions] - The number of divisions or segments. + * @param {number} [divisions] - The number of divisions or segments. * * @return {number[]} An array of cumulative lengths. */ @@ -315,7 +315,7 @@ var Curve = new Class({ * * @generic {Phaser.Math.Vector2[]} O - [out,$return] * - * @param {integer} [divisions] - The number of divisions to make. + * @param {number} [divisions] - The number of divisions to make. * @param {number} [stepRate] - The curve distance between points, implying `divisions`. * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in. * @@ -375,7 +375,7 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getSpacedPoints * @since 3.0.0 * - * @param {integer} [divisions=this.defaultDivisions] - The number of divisions to make. + * @param {number} [divisions=this.defaultDivisions] - The number of divisions to make. * @param {number} [stepRate] - Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. * @param {(array|Phaser.Math.Vector2[])} [out] - An optional array to store the points in. * @@ -495,8 +495,8 @@ var Curve = new Class({ * @method Phaser.Curves.Curve#getTFromDistance * @since 3.0.0 * - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The distance. */ @@ -517,8 +517,8 @@ var Curve = new Class({ * @since 3.0.0 * * @param {number} u - A float between 0 and 1. - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The equidistant value. */ diff --git a/src/curves/EllipseCurve.js b/src/curves/EllipseCurve.js index c02af37ea..17a255aa3 100644 --- a/src/curves/EllipseCurve.js +++ b/src/curves/EllipseCurve.js @@ -29,10 +29,10 @@ var Vector2 = require('../math/Vector2'); * @param {number} [y=0] - The y coordinate of the ellipse. * @param {number} [xRadius=0] - The horizontal radius of ellipse. * @param {number} [yRadius=0] - The vertical radius of ellipse. - * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. - * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {number} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {number} [endAngle=360] - The end angle of the ellipse, in degrees. * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). - * @param {integer} [rotation=0] - The rotation of the ellipse, in degrees. + * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. */ var EllipseCurve = new Class({ diff --git a/src/curves/LineCurve.js b/src/curves/LineCurve.js index 3731ad65f..6bd588ce9 100644 --- a/src/curves/LineCurve.js +++ b/src/curves/LineCurve.js @@ -68,7 +68,7 @@ var LineCurve = new Class({ * The quantity of arc length divisions within the curve. * * @name Phaser.Curves.Line#arcLengthDivisions - * @type {integer} + * @type {number} * @default 1 * @since 3.0.0 */ @@ -201,8 +201,8 @@ var LineCurve = new Class({ * @since 3.0.0 * * @param {number} u - A float between 0 and 1. - * @param {integer} distance - The distance, in pixels. - * @param {integer} [divisions] - Optional amount of divisions. + * @param {number} distance - The distance, in pixels. + * @param {number} [divisions] - Optional amount of divisions. * * @return {number} The equidistant value. */ diff --git a/src/curves/QuadraticBezierCurve.js b/src/curves/QuadraticBezierCurve.js index f9274d00e..370465e7d 100644 --- a/src/curves/QuadraticBezierCurve.js +++ b/src/curves/QuadraticBezierCurve.js @@ -141,7 +141,7 @@ var QuadraticBezier = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [graphics,$return] * * @param {Phaser.GameObjects.Graphics} graphics - `Graphics` object to draw onto. - * @param {integer} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. + * @param {number} [pointsTotal=32] - Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. * * @return {Phaser.GameObjects.Graphics} `Graphics` object that was drawn to. */ diff --git a/src/curves/path/Path.js b/src/curves/path/Path.js index 68a949c96..8fa5ebe97 100644 --- a/src/curves/path/Path.js +++ b/src/curves/path/Path.js @@ -276,7 +276,7 @@ var Path = new Class({ * @generic {Phaser.GameObjects.Graphics} G - [out,$return] * * @param {Phaser.GameObjects.Graphics} graphics - The Graphics Game Object to draw to. - * @param {integer} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. + * @param {number} [pointsTotal=32] - The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. * * @return {Phaser.GameObjects.Graphics} The Graphics object which was drawn to. */ @@ -305,8 +305,8 @@ var Path = new Class({ * * @param {number} [xRadius=0] - The horizontal radius of ellipse. * @param {number} [yRadius=0] - The vertical radius of ellipse. - * @param {integer} [startAngle=0] - The start angle of the ellipse, in degrees. - * @param {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @param {number} [startAngle=0] - The start angle of the ellipse, in degrees. + * @param {number} [endAngle=360] - The end angle of the ellipse, in degrees. * @param {boolean} [clockwise=false] - Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). * @param {number} [rotation=0] - The rotation of the ellipse, in degrees. * @@ -392,7 +392,7 @@ var Path = new Class({ * @generic {Phaser.Math.Vector2} O - [out,$return] * * @param {Phaser.Geom.Rectangle} [out] - The Rectangle to store the bounds in. - * @param {integer} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. + * @param {number} [accuracy=16] - The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. * * @return {Phaser.Geom.Rectangle} The modified `out` Rectangle, or a new Rectangle if none was provided. */ @@ -574,7 +574,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#getPoints * @since 3.0.0 * - * @param {integer} [divisions=12] - The number of divisions per resolution per curve. + * @param {number} [divisions=12] - The number of divisions per resolution per curve. * * @return {Phaser.Math.Vector2[]} An array of Vector2 objects that containing the points along the Path. */ @@ -651,7 +651,7 @@ var Path = new Class({ * @method Phaser.Curves.Path#getSpacedPoints * @since 3.0.0 * - * @param {integer} [divisions=40] - The amount of points to divide this Path into. + * @param {number} [divisions=40] - The amount of points to divide this Path into. * * @return {Phaser.Math.Vector2[]} A list of the points this path was subdivided into. */ diff --git a/src/curves/typedefs/EllipseCurveConfig.js b/src/curves/typedefs/EllipseCurveConfig.js index d5e8f842c..ab50195f9 100644 --- a/src/curves/typedefs/EllipseCurveConfig.js +++ b/src/curves/typedefs/EllipseCurveConfig.js @@ -5,8 +5,8 @@ * @property {number} [y=0] - The y coordinate of the ellipse. * @property {number} [xRadius=0] - The horizontal radius of the ellipse. * @property {number} [yRadius=0] - The vertical radius of the ellipse. - * @property {integer} [startAngle=0] - The start angle of the ellipse, in degrees. - * @property {integer} [endAngle=360] - The end angle of the ellipse, in degrees. + * @property {number} [startAngle=0] - The start angle of the ellipse, in degrees. + * @property {number} [endAngle=360] - The end angle of the ellipse, in degrees. * @property {boolean} [clockwise=false] - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) - * @property {integer} [rotation=0] - The rotation of the ellipse, in degrees. + * @property {number} [rotation=0] - The rotation of the ellipse, in degrees. */ diff --git a/src/curves/typedefs/JSONEllipseCurve.js b/src/curves/typedefs/JSONEllipseCurve.js index bd5e52e42..d4bdf9110 100644 --- a/src/curves/typedefs/JSONEllipseCurve.js +++ b/src/curves/typedefs/JSONEllipseCurve.js @@ -7,8 +7,8 @@ * @property {number} y - The y coordinate of the ellipse. * @property {number} xRadius - The horizontal radius of ellipse. * @property {number} yRadius - The vertical radius of ellipse. - * @property {integer} startAngle - The start angle of the ellipse, in degrees. - * @property {integer} endAngle - The end angle of the ellipse, in degrees. + * @property {number} startAngle - The start angle of the ellipse, in degrees. + * @property {number} endAngle - The end angle of the ellipse, in degrees. * @property {boolean} clockwise - Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) - * @property {integer} rotation - The rotation of ellipse, in degrees. + * @property {number} rotation - The rotation of ellipse, in degrees. */ diff --git a/src/data/DataManager.js b/src/data/DataManager.js index 437a29356..101d70f19 100644 --- a/src/data/DataManager.js +++ b/src/data/DataManager.js @@ -674,7 +674,7 @@ var DataManager = new Class({ * Return the total number of entries in this Data Manager. * * @name Phaser.Data.DataManager#count - * @type {integer} + * @type {number} * @since 3.0.0 */ count: { diff --git a/src/device/Audio.js b/src/device/Audio.js index 2fbc77106..393e696c6 100644 --- a/src/device/Audio.js +++ b/src/device/Audio.js @@ -11,10 +11,10 @@ var Browser = require('./Browser'); * These values are read-only and populated during the boot sequence of the game. * They are then referenced by internal game systems and are available for you to access * via `this.sys.game.device.audio` from within any Scene. - * + * * @typedef {object} Phaser.Device.Audio * @since 3.0.0 - * + * * @property {boolean} audioData - Can this device play HTML Audio tags? * @property {boolean} dolby - Can this device play EC-3 Dolby Digital Plus files? * @property {boolean} m4a - Can this device can play m4a files. @@ -70,8 +70,7 @@ function init () // Mimetypes accepted: // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements - // bit.ly/iphoneoscodecs - if (audioElement.canPlayType('audio/wav; codecs="1"').replace(/^no$/, '')) + if (audioElement.canPlayType('audio/wav').replace(/^no$/, '')) { Audio.wav = true; } diff --git a/src/device/OS.js b/src/device/OS.js index 13c4dcd7b..14a465335 100644 --- a/src/device/OS.js +++ b/src/device/OS.js @@ -69,7 +69,20 @@ function init () } else if ((/Mac OS/).test(ua) && !((/like Mac OS/).test(ua))) { - OS.macOS = true; + // Because iOS 13 identifies as Mac OS: + if (navigator.maxTouchPoints && navigator.maxTouchPoints > 2) + { + OS.iOS = true; + OS.iPad = true; + + (navigator.appVersion).match(/Version\/(\d+)/); + + OS.iOSVersion = parseInt(RegExp.$1, 10); + } + else + { + OS.macOS = true; + } } else if ((/Android/).test(ua)) { diff --git a/src/display/ColorMatrix.js b/src/display/ColorMatrix.js new file mode 100644 index 000000000..221d5a2cd --- /dev/null +++ b/src/display/ColorMatrix.js @@ -0,0 +1,644 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../utils/Class'); + +/** + * @classdesc + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. + * + * Use the method `getData` to return a Float32Array containing the current color values. + * + * @class ColorMatrix + * @memberof Phaser.Display + * @constructor + * @since 3.50.0 + */ +var ColorMatrix = new Class({ + + initialize: + + function ColorMatrix () + { + /** + * Internal ColorMatrix array. + * + * @name Phaser.Display.ColorMatrix#_matrix + * @type {number[]} + * @private + * @since 3.50.0 + */ + this._matrix = [ + 1, 0, 0, 0, 0, + 0, 1, 0, 0, 0, + 0, 0, 1, 0, 0, + 0, 0, 0, 1, 0 + ]; + + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + * + * @name Phaser.Display.ColorMatrix#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = 1; + + /** + * Is the ColorMatrix array dirty? + * + * @name Phaser.Display.ColorMatrix#_dirty + * @type {boolean} + * @private + * @since 3.50.0 + */ + this._dirty = true; + + /** + * The matrix data as a Float32Array. + * + * Returned by the `getData` method. + * + * @name Phaser.Display.ColorMatrix#data + * @type {Float32Array} + * @private + * @since 3.50.0 + */ + this._data; + }, + + /** + * Sets this ColorMatrix from the given array of color values. + * + * @method Phaser.Display.ColorMatrix#set + * @since 3.50.0 + * + * @param {number[]} value - The ColorMatrix values to set. + * + * @return {this} This ColorMatrix instance. + */ + set: function (value) + { + this._matrix = value; + + this._dirty = true; + + return this; + }, + + /** + * Resets the ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#reset + * @since 3.50.0 + * + * @return {this} This ColorMatrix instance. + */ + reset: function () + { + // Long-winded, but saves on gc, which happens a lot in Post FX Shaders + // that reset the ColorMatrix every frame. + + var m = this._matrix; + + m[0] = 1; + m[1] = 0; + m[2] = 0; + m[3] = 0; + m[4] = 0; + + m[5] = 0; + m[6] = 1; + m[7] = 0; + m[8] = 0; + m[9] = 0; + + m[10] = 0; + m[11] = 0; + m[12] = 1; + m[13] = 0; + m[14] = 0; + + m[15] = 0; + m[16] = 0; + m[17] = 0; + m[18] = 1; + m[19] = 0; + + this._dirty = true; + + return this; + }, + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + * + * @method Phaser.Display.ColorMatrix#getData + * @since 3.50.0 + * + * @return {Float32Array} The ColorMatrix as a Float32Array. + */ + getData: function () + { + if (this._dirty) + { + var f32 = new Float32Array(this._matrix); + + f32[4] /= 255; + f32[9] /= 255; + f32[14] /= 255; + f32[19] /= 255; + + this._data = f32; + + this._dirty = false; + } + + return this._data; + }, + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#brightness + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brightness: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var b = value; + + return this.multiply([ + b, 0, 0, 0, 0, + 0, b, 0, 0, 0, + 0, 0, b, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * + * @method Phaser.Display.ColorMatrix#saturate + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of saturation to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + saturate: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var x = (value * 2 / 3) + 1; + var y = ((x - 1) * -0.5); + + return this.multiply([ + x, y, y, 0, 0, + y, x, y, 0, 0, + y, y, x, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Desaturates this ColorMatrix (removes color from it). + * + * @method Phaser.Display.ColorMatrix#saturation + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturate: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.saturate(-1, multiply); + }, + + /** + * Rotates the hues of this ColorMatrix by the value given. + * + * @method Phaser.Display.ColorMatrix#hue + * @since 3.50.0 + * + * @param {number} [rotation=0] - The amount of hue rotation to apply to this ColorMatrix, in degrees. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + hue: function (rotation, multiply) + { + if (rotation === undefined) { rotation = 0; } + if (multiply === undefined) { multiply = false; } + + rotation = rotation / 180 * Math.PI; + + var cos = Math.cos(rotation); + var sin = Math.sin(rotation); + var lumR = 0.213; + var lumG = 0.715; + var lumB = 0.072; + + return this.multiply([ + lumR + cos * (1 - lumR) + sin * (-lumR),lumG + cos * (-lumG) + sin * (-lumG),lumB + cos * (-lumB) + sin * (1 - lumB), 0, 0, + lumR + cos * (-lumR) + sin * (0.143),lumG + cos * (1 - lumG) + sin * (0.140),lumB + cos * (-lumB) + sin * (-0.283), 0, 0, + lumR + cos * (-lumR) + sin * (-(1 - lumR)),lumG + cos * (-lumG) + sin * (lumG),lumB + cos * (1 - lumB) + sin * (lumB), 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Sets this ColorMatrix to be grayscale. + * + * @method Phaser.Display.ColorMatrix#grayscale + * @since 3.50.0 + * + * @param {number} [value=1] - The grayscale scale (0 is black). + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + grayscale: function (value, multiply) + { + if (value === undefined) { value = 1; } + if (multiply === undefined) { multiply = false; } + + return this.saturate(-value, multiply); + }, + + /** + * Sets this ColorMatrix to be black and white. + * + * @method Phaser.Display.ColorMatrix#blackWhite + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + blackWhite: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.3, 0.6, 0.1, 0, 0, + 0.3, 0.6, 0.1, 0, 0, + 0.3, 0.6, 0.1, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Change the contrast of this ColorMatrix by the amount given. + * + * @method Phaser.Display.ColorMatrix#contrast + * @since 3.50.0 + * + * @param {number} [value=0] - The amount of contrast to apply to this ColorMatrix. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + contrast: function (value, multiply) + { + if (value === undefined) { value = 0; } + if (multiply === undefined) { multiply = false; } + + var v = value + 1; + var o = -0.5 * (v - 1); + + return this.multiply([ + v, 0, 0, 0, o, + 0, v, 0, 0, o, + 0, 0, v, 0, o, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Converts this ColorMatrix to have negative values. + * + * @method Phaser.Display.ColorMatrix#negative + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + negative: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + -1, 0, 0, 1, 0, + 0, -1, 0, 1, 0, + 0, 0, -1, 1, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Apply a desaturated luminance to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#desaturateLuminance + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + desaturateLuminance: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0.2764723, 0.9297080, 0.0938197, 0, -37.1, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a sepia tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#sepia + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + sepia: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.393, 0.7689999, 0.18899999, 0, 0, + 0.349, 0.6859999, 0.16799999, 0, 0, + 0.272, 0.5339999, 0.13099999, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a night vision tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#night + * @since 3.50.0 + * + * @param {number} [intensity=0.1] - The intensity of this effect. + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + night: function (intensity, multiply) + { + if (intensity === undefined) { intensity = 0.1; } + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + intensity * (-2.0), -intensity, 0, 0, 0, + -intensity, 0, intensity, 0, 0, + 0, intensity, intensity * 2.0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a trippy color tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#lsd + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + lsd: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 2, -0.4, 0.5, 0, 0, + -0.5, 2, -0.4, 0, 0, + -0.4, -0.5, 3, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a brown tone to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#brown + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + brown: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873, + -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127, + 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#vintagePinhole + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + vintagePinhole: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123, + 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591, + 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#kodachrome + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + kodachrome: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502, + -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203, + -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a technicolor color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#technicolor + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + technicolor: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337, + -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398, + -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Applies a polaroid color effect to this ColorMatrix. + * + * @method Phaser.Display.ColorMatrix#polaroid + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + polaroid: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 1.438, -0.062, -0.062, 0, 0, + -0.122, 1.378, -0.122, 0, 0, + -0.016, -0.016, 1.483, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Shifts the values of this ColorMatrix into BGR order. + * + * @method Phaser.Display.ColorMatrix#shiftToBGR + * @since 3.50.0 + * + * @param {boolean} [multiply=false] - Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? + * + * @return {this} This ColorMatrix instance. + */ + shiftToBGR: function (multiply) + { + if (multiply === undefined) { multiply = false; } + + return this.multiply([ + 0, 0, 1, 0, 0, + 0, 1, 0, 0, 0, + 1, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ], multiply); + }, + + /** + * Multiplies the two given matrices. + * + * @method Phaser.Display.ColorMatrix#multiply + * @since 3.50.0 + * + * @param {number[]} a - The 5x4 array to multiply with ColorMatrix._matrix. + * + * @return {this} This ColorMatrix instance. + */ + multiply: function (a, multiply) + { + // Duplicate _matrix into c + + if (!multiply) + { + this.reset(); + } + + var m = this._matrix; + var c = []; + + for (var i = 0; i < 20; i++) + { + c[i] = m[i]; + } + + // R + m[0] = (c[0] * a[0]) + (c[1] * a[5]) + (c[2] * a[10]) + (c[3] * a[15]); + m[1] = (c[0] * a[1]) + (c[1] * a[6]) + (c[2] * a[11]) + (c[3] * a[16]); + m[2] = (c[0] * a[2]) + (c[1] * a[7]) + (c[2] * a[12]) + (c[3] * a[17]); + m[3] = (c[0] * a[3]) + (c[1] * a[8]) + (c[2] * a[13]) + (c[3] * a[18]); + m[4] = (c[0] * a[4]) + (c[1] * a[9]) + (c[2] * a[14]) + (c[3] * a[19]) + c[4]; + + // G + m[5] = (c[5] * a[0]) + (c[6] * a[5]) + (c[7] * a[10]) + (c[8] * a[15]); + m[6] = (c[5] * a[1]) + (c[6] * a[6]) + (c[7] * a[11]) + (c[8] * a[16]); + m[7] = (c[5] * a[2]) + (c[6] * a[7]) + (c[7] * a[12]) + (c[8] * a[17]); + m[8] = (c[5] * a[3]) + (c[6] * a[8]) + (c[7] * a[13]) + (c[8] * a[18]); + m[9] = (c[5] * a[4]) + (c[6] * a[9]) + (c[7] * a[14]) + (c[8] * a[19]) + c[9]; + + // B + m[10] = (c[10] * a[0]) + (c[11] * a[5]) + (c[12] * a[10]) + (c[13] * a[15]); + m[11] = (c[10] * a[1]) + (c[11] * a[6]) + (c[12] * a[11]) + (c[13] * a[16]); + m[12] = (c[10] * a[2]) + (c[11] * a[7]) + (c[12] * a[12]) + (c[13] * a[17]); + m[13] = (c[10] * a[3]) + (c[11] * a[8]) + (c[12] * a[13]) + (c[13] * a[18]); + m[14] = (c[10] * a[4]) + (c[11] * a[9]) + (c[12] * a[14]) + (c[13] * a[19]) + c[14]; + + // A + m[15] = (c[15] * a[0]) + (c[16] * a[5]) + (c[17] * a[10]) + (c[18] * a[15]); + m[16] = (c[15] * a[1]) + (c[16] * a[6]) + (c[17] * a[11]) + (c[18] * a[16]); + m[17] = (c[15] * a[2]) + (c[16] * a[7]) + (c[17] * a[12]) + (c[18] * a[17]); + m[18] = (c[15] * a[3]) + (c[16] * a[8]) + (c[17] * a[13]) + (c[18] * a[18]); + m[19] = (c[15] * a[4]) + (c[16] * a[9]) + (c[17] * a[14]) + (c[18] * a[19]) + c[19]; + + this._dirty = true; + + return this; + } + +}); + +module.exports = ColorMatrix; diff --git a/src/display/align/const.js b/src/display/align/const.js index 2c25019af..abde5c12a 100644 --- a/src/display/align/const.js +++ b/src/display/align/const.js @@ -11,7 +11,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_LEFT * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_LEFT: 0, @@ -20,7 +20,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_CENTER: 1, @@ -29,7 +29,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.TOP_RIGHT * @since 3.0.0 - * @type {integer} + * @type {number} */ TOP_RIGHT: 2, @@ -38,7 +38,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_TOP * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_TOP: 3, @@ -47,7 +47,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_CENTER: 4, @@ -56,7 +56,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.LEFT_BOTTOM * @since 3.0.0 - * @type {integer} + * @type {number} */ LEFT_BOTTOM: 5, @@ -65,7 +65,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ CENTER: 6, @@ -74,7 +74,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_TOP * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_TOP: 7, @@ -83,7 +83,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_CENTER: 8, @@ -92,7 +92,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.RIGHT_BOTTOM * @since 3.0.0 - * @type {integer} + * @type {number} */ RIGHT_BOTTOM: 9, @@ -101,7 +101,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_LEFT * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_LEFT: 10, @@ -110,7 +110,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_CENTER * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_CENTER: 11, @@ -119,7 +119,7 @@ var ALIGN_CONST = { * @constant * @name Phaser.Display.Align.BOTTOM_RIGHT * @since 3.0.0 - * @type {integer} + * @type {number} */ BOTTOM_RIGHT: 12 diff --git a/src/display/align/in/QuickSet.js b/src/display/align/in/QuickSet.js index 8d65a4b41..0993619ac 100644 --- a/src/display/align/in/QuickSet.js +++ b/src/display/align/in/QuickSet.js @@ -33,7 +33,7 @@ AlignInMap[ALIGN_CONST.RIGHT_TOP] = AlignInMap[ALIGN_CONST.TOP_RIGHT]; * * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned. * @param {Phaser.GameObjects.GameObject} alignIn - The Game Object to base the alignment position on. - * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. + * @param {number} position - The position to align the Game Object with. This is an align constant, such as `ALIGN_CONST.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * diff --git a/src/display/align/to/QuickSet.js b/src/display/align/to/QuickSet.js index 5df6df89e..8278c5890 100644 --- a/src/display/align/to/QuickSet.js +++ b/src/display/align/to/QuickSet.js @@ -32,7 +32,7 @@ AlignToMap[ALIGN_CONST.TOP_RIGHT] = require('./TopRight'); * * @param {Phaser.GameObjects.GameObject} child - The Game Object that will be positioned. * @param {Phaser.GameObjects.GameObject} alignTo - The Game Object to base the alignment position on. - * @param {integer} position - The position to align the Game Object with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. + * @param {number} position - The position to align the Game Object with. This is an align constant, such as `Phaser.Display.Align.LEFT_CENTER`. * @param {number} [offsetX=0] - Optional horizontal offset from the position. * @param {number} [offsetY=0] - Optional vertical offset from the position. * diff --git a/src/display/canvas/CanvasPool.js b/src/display/canvas/CanvasPool.js index 2054c8216..7b1ecc2c7 100644 --- a/src/display/canvas/CanvasPool.js +++ b/src/display/canvas/CanvasPool.js @@ -33,9 +33,9 @@ var CanvasPool = function () * @since 3.0.0 * * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. - * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. * @param {boolean} [selfParent=false] - Use the generated Canvas element as the parent? * * @return {HTMLCanvasElement} The canvas element that was created or pulled from the pool @@ -95,8 +95,8 @@ var CanvasPool = function () * @since 3.0.0 * * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. * * @return {HTMLCanvasElement} The created canvas. */ @@ -112,8 +112,8 @@ var CanvasPool = function () * @since 3.0.0 * * @param {*} parent - The parent of the Canvas object. - * @param {integer} [width=1] - The width of the Canvas. - * @param {integer} [height=1] - The height of the Canvas. + * @param {number} [width=1] - The width of the Canvas. + * @param {number} [height=1] - The height of the Canvas. * * @return {HTMLCanvasElement} The created WebGL canvas. */ @@ -128,7 +128,7 @@ var CanvasPool = function () * @function Phaser.Display.Canvas.CanvasPool.first * @since 3.0.0 * - * @param {integer} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. + * @param {number} [canvasType=Phaser.CANVAS] - The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. * * @return {HTMLCanvasElement} The first free canvas, or `null` if a WebGL canvas was requested or if the pool doesn't have free canvases. */ @@ -185,7 +185,7 @@ var CanvasPool = function () * @function Phaser.Display.Canvas.CanvasPool.total * @since 3.0.0 * - * @return {integer} The number of used canvases. + * @return {number} The number of used canvases. */ var total = function () { @@ -208,7 +208,7 @@ var CanvasPool = function () * @function Phaser.Display.Canvas.CanvasPool.free * @since 3.0.0 * - * @return {integer} The number of free canvases. + * @return {number} The number of free canvases. */ var free = function () { diff --git a/src/display/color/Color.js b/src/display/color/Color.js index d9301e8f3..57e883cf0 100644 --- a/src/display/color/Color.js +++ b/src/display/color/Color.js @@ -23,10 +23,10 @@ var RGBToHSV = require('./RGBToHSV'); * @constructor * @since 3.0.0 * - * @param {integer} [red=0] - The red color value. A number between 0 and 255. - * @param {integer} [green=0] - The green color value. A number between 0 and 255. - * @param {integer} [blue=0] - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * @param {number} [red=0] - The red color value. A number between 0 and 255. + * @param {number} [green=0] - The green color value. A number between 0 and 255. + * @param {number} [blue=0] - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. */ var Color = new Class({ @@ -202,10 +202,10 @@ var Color = new Class({ * @method Phaser.Display.Color#setTo * @since 3.0.0 * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. * @param {boolean} [updateHSV=true] - Update the HSV values after setting the RGB values? * * @return {Phaser.Display.Color} This Color object. @@ -375,7 +375,7 @@ var Color = new Class({ * @method Phaser.Display.Color#gray * @since 3.13.0 * - * @param {integer} shade - A value between 0 and 255. + * @param {number} shade - A value between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -390,8 +390,8 @@ var Color = new Class({ * @method Phaser.Display.Color#random * @since 3.13.0 * - * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. - * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * @param {number} [min=0] - The minimum random color value. Between 0 and 255. + * @param {number} [max=255] - The maximum random color value. Between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -413,8 +413,8 @@ var Color = new Class({ * @method Phaser.Display.Color#randomGray * @since 3.13.0 * - * @param {integer} [min=0] - The minimum random color value. Between 0 and 255. - * @param {integer} [max=255] - The maximum random color value. Between 0 and 255. + * @param {number} [min=0] - The minimum random color value. Between 0 and 255. + * @param {number} [max=255] - The maximum random color value. Between 0 and 255. * * @return {Phaser.Display.Color} This Color object. */ @@ -435,7 +435,7 @@ var Color = new Class({ * @method Phaser.Display.Color#saturate * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -453,7 +453,7 @@ var Color = new Class({ * @method Phaser.Display.Color#desaturate * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -470,7 +470,7 @@ var Color = new Class({ * @method Phaser.Display.Color#lighten * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -487,7 +487,7 @@ var Color = new Class({ * @method Phaser.Display.Color#darken * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ @@ -504,7 +504,7 @@ var Color = new Class({ * @method Phaser.Display.Color#brighten * @since 3.13.0 * - * @param {integer} amount - The percentage amount to change this color by. A value between 0 and 100. + * @param {number} amount - The percentage amount to change this color by. A value between 0 and 100. * * @return {Phaser.Display.Color} This Color object. */ diff --git a/src/display/color/ColorSpectrum.js b/src/display/color/ColorSpectrum.js new file mode 100644 index 000000000..483d47bc7 --- /dev/null +++ b/src/display/color/ColorSpectrum.js @@ -0,0 +1,91 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetColor = require('./GetColor'); + +/** + * Return an array of Colors in a Color Spectrum. + * + * The spectrum colors flow in the order: red, yellow, green, blue. + * + * By default this function will return an array with 1024 elements in. + * + * However, you can reduce this to a smaller quantity if needed, by specitying the `limit` parameter. + * + * @function Phaser.Display.Color.ColorSpectrum + * @since 3.50.0 + * + * @param {number} [limit=1024] - How many colors should be returned? The maximum is 1024 but you can set a smaller quantity if required. + * + * @return {Phaser.Types.Display.ColorObject[]} An array containing `limit` parameter number of elements, where each contains a Color Object. + */ +var ColorSpectrum = function (limit) +{ + if (limit === undefined) { limit = 1024; } + + var colors = []; + + var range = 255; + + var i; + var r = 255; + var g = 0; + var b = 0; + + // Red to Yellow + for (i = 0; i <= range; i++) + { + colors.push({ r: r, g: i, b: b, color: GetColor(r, i, b) }); + } + + g = 255; + + // Yellow to Green + for (i = range; i >= 0; i--) + { + colors.push({ r: i, g: g, b: b, color: GetColor(i, g, b) }); + } + + r = 0; + + // Green to Blue + for (i = 0; i <= range; i++, g--) + { + colors.push({ r: r, g: g, b: i, color: GetColor(r, g, i) }); + } + + g = 0; + b = 255; + + // Blue to Red + for (i = 0; i <= range; i++, b--, r++) + { + colors.push({ r: r, g: g, b: b, color: GetColor(r, g, b) }); + } + + if (limit === 1024) + { + return colors; + } + else + { + var out = []; + + var t = 0; + var inc = 1024 / limit; + + for (i = 0; i < limit; i++) + { + out.push(colors[Math.floor(t)]); + + t += inc; + } + + return out; + } +}; + +module.exports = ColorSpectrum; diff --git a/src/display/color/ComponentToHex.js b/src/display/color/ComponentToHex.js index 7081c9c7f..97073c832 100644 --- a/src/display/color/ComponentToHex.js +++ b/src/display/color/ComponentToHex.js @@ -10,7 +10,7 @@ * @function Phaser.Display.Color.ComponentToHex * @since 3.0.0 * - * @param {integer} color - The color channel to get the hex value for, must be a value between 0 and 255. + * @param {number} color - The color channel to get the hex value for, must be a value between 0 and 255. * * @return {string} A string of length 2 characters, i.e. 255 = ff, 100 = 64. */ diff --git a/src/display/color/GetColor.js b/src/display/color/GetColor.js index e4ec84048..4029d6e93 100644 --- a/src/display/color/GetColor.js +++ b/src/display/color/GetColor.js @@ -10,9 +10,9 @@ * @function Phaser.Display.Color.GetColor * @since 3.0.0 * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. * * @return {number} The combined color value. */ diff --git a/src/display/color/GetColor32.js b/src/display/color/GetColor32.js index a7a9db0a2..9329e658f 100644 --- a/src/display/color/GetColor32.js +++ b/src/display/color/GetColor32.js @@ -10,10 +10,10 @@ * @function Phaser.Display.Color.GetColor32 * @since 3.0.0 * - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} alpha - The alpha color value. A number between 0 and 255. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} alpha - The alpha color value. A number between 0 and 255. * * @return {number} The combined color value. */ diff --git a/src/display/color/IntegerToColor.js b/src/display/color/IntegerToColor.js index 8a51c9fd9..6d3d0d9c7 100644 --- a/src/display/color/IntegerToColor.js +++ b/src/display/color/IntegerToColor.js @@ -13,7 +13,7 @@ var IntegerToRGB = require('./IntegerToRGB'); * @function Phaser.Display.Color.IntegerToColor * @since 3.0.0 * - * @param {integer} input - The color value to convert into a Color object. + * @param {number} input - The color value to convert into a Color object. * * @return {Phaser.Display.Color} A Color object. */ diff --git a/src/display/color/IntegerToRGB.js b/src/display/color/IntegerToRGB.js index d6943df8b..c9939cef3 100644 --- a/src/display/color/IntegerToRGB.js +++ b/src/display/color/IntegerToRGB.js @@ -12,7 +12,7 @@ * @function Phaser.Display.Color.IntegerToRGB * @since 3.0.0 * - * @param {integer} input - The color value to convert into a Color object. + * @param {number} input - The color value to convert into a Color object. * * @return {Phaser.Types.Display.ColorObject} An object with the red, green and blue values set in the r, g and b properties. */ diff --git a/src/display/color/RGBToHSV.js b/src/display/color/RGBToHSV.js index 75429fcca..800c0f07f 100644 --- a/src/display/color/RGBToHSV.js +++ b/src/display/color/RGBToHSV.js @@ -13,9 +13,9 @@ * @function Phaser.Display.Color.RGBToHSV * @since 3.0.0 * - * @param {integer} r - The red color value. A number between 0 and 255. - * @param {integer} g - The green color value. A number between 0 and 255. - * @param {integer} b - The blue color value. A number between 0 and 255. + * @param {number} r - The red color value. A number between 0 and 255. + * @param {number} g - The green color value. A number between 0 and 255. + * @param {number} b - The blue color value. A number between 0 and 255. * @param {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} [out] - An object to store the color values in. If not given an HSV Color Object will be created. * * @return {(Phaser.Types.Display.HSVColorObject|Phaser.Display.Color)} An object with the properties `h`, `s` and `v` set. diff --git a/src/display/color/RGBToString.js b/src/display/color/RGBToString.js index b1df7931b..d25de69a2 100644 --- a/src/display/color/RGBToString.js +++ b/src/display/color/RGBToString.js @@ -12,10 +12,10 @@ var ComponentToHex = require('./ComponentToHex'); * @function Phaser.Display.Color.RGBToString * @since 3.0.0 * - * @param {integer} r - The red color value. A number between 0 and 255. - * @param {integer} g - The green color value. A number between 0 and 255. - * @param {integer} b - The blue color value. A number between 0 and 255. - * @param {integer} [a=255] - The alpha value. A number between 0 and 255. + * @param {number} r - The red color value. A number between 0 and 255. + * @param {number} g - The green color value. A number between 0 and 255. + * @param {number} b - The blue color value. A number between 0 and 255. + * @param {number} [a=255] - The alpha value. A number between 0 and 255. * @param {string} [prefix=#] - The prefix of the string. Either `#` or `0x`. * * @return {string} A string-based representation of the color values. diff --git a/src/display/color/RandomRGB.js b/src/display/color/RandomRGB.js index 00c60006f..8a4b3dccb 100644 --- a/src/display/color/RandomRGB.js +++ b/src/display/color/RandomRGB.js @@ -14,8 +14,8 @@ var Color = require('./Color'); * @function Phaser.Display.Color.RandomRGB * @since 3.0.0 * - * @param {integer} [min=0] - The minimum value to set the random range from (between 0 and 255) - * @param {integer} [max=255] - The maximum value to set the random range from (between 0 and 255) + * @param {number} [min=0] - The minimum value to set the random range from (between 0 and 255) + * @param {number} [max=255] - The maximum value to set the random range from (between 0 and 255) * * @return {Phaser.Display.Color} A Color object. */ diff --git a/src/display/color/index.js b/src/display/color/index.js index b4231fe9d..9abcf48bd 100644 --- a/src/display/color/index.js +++ b/src/display/color/index.js @@ -6,6 +6,7 @@ var Color = require('./Color'); +Color.ColorSpectrum = require('./ColorSpectrum'); Color.ColorToRGBA = require('./ColorToRGBA'); Color.ComponentToHex = require('./ComponentToHex'); Color.GetColor = require('./GetColor'); diff --git a/src/display/index.js b/src/display/index.js index c1dde6dee..9fe5ad227 100644 --- a/src/display/index.js +++ b/src/display/index.js @@ -15,6 +15,7 @@ module.exports = { Bounds: require('./bounds'), Canvas: require('./canvas'), Color: require('./color'), + ColorMatrix: require('./ColorMatrix'), Masks: require('./mask'), RGB: require('./RGB') diff --git a/src/display/mask/BitmapMask.js b/src/display/mask/BitmapMask.js index 9dc554392..dfaaf4e21 100644 --- a/src/display/mask/BitmapMask.js +++ b/src/display/mask/BitmapMask.js @@ -6,6 +6,7 @@ var Class = require('../../utils/Class'); var GameEvents = require('../../core/events'); +var RenderEvents = require('../../renderer/events'); /** * @classdesc @@ -51,7 +52,7 @@ var BitmapMask = new Class({ function BitmapMask (scene, renderable) { - var renderer = scene.sys.game.renderer; + var renderer = scene.sys.renderer; /** * A reference to either the Canvas or WebGL Renderer that this Mask is using. @@ -72,7 +73,7 @@ var BitmapMask = new Class({ this.bitmapMask = renderable; /** - * The texture used for the mask's framebuffer. + * The texture used for the masks framebuffer. * * @name Phaser.Display.Masks.BitmapMask#maskTexture * @type {WebGLTexture} @@ -119,19 +120,11 @@ var BitmapMask = new Class({ */ this.maskFramebuffer = null; - /** - * The previous framebuffer set in the renderer before this one was enabled. - * - * @name Phaser.Display.Masks.BitmapMask#prevFramebuffer - * @type {WebGLFramebuffer} - * @since 3.17.0 - */ - this.prevFramebuffer = null; - /** * Whether to invert the masks alpha. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. * * @name Phaser.Display.Masks.BitmapMask#invertAlpha * @type {boolean} @@ -152,6 +145,8 @@ var BitmapMask = new Class({ this.createMask(); scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, this.createMask, this); + + renderer.on(RenderEvents.RESIZE, this.createMask, this); }, /** @@ -304,6 +299,8 @@ var BitmapMask = new Class({ { this.clearMask(); + this.renderer.off(RenderEvents.RESIZE, this.createMask, this); + this.bitmapMask = null; this.prevFramebuffer = null; this.renderer = null; diff --git a/src/display/mask/GeometryMask.js b/src/display/mask/GeometryMask.js index c9e95001d..f58e64286 100644 --- a/src/display/mask/GeometryMask.js +++ b/src/display/mask/GeometryMask.js @@ -51,6 +51,8 @@ var GeometryMask = new Class({ * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels * drawn to the Geometry Mask. * + * This is a WebGL only feature. + * * @name Phaser.Display.Masks.GeometryMask#invertAlpha * @type {boolean} * @since 3.16.0 @@ -97,8 +99,11 @@ var GeometryMask = new Class({ /** * Sets the `invertAlpha` property of this Geometry Mask. + * * Inverting the alpha essentially flips the way the mask works. * + * This is a WebGL only feature. + * * @method Phaser.Display.Masks.GeometryMask#setInvertAlpha * @since 3.17.0 * @@ -226,32 +231,32 @@ var GeometryMask = new Class({ renderer.maskCount--; + // Force flush before disabling stencil test + renderer.flush(); + + var current = renderer.currentMask; + if (renderer.maskStack.length === 0) { // If this is the only mask in the stack, flush and disable - renderer.flush(); - - renderer.currentMask.mask = null; + current.mask = null; gl.disable(gl.STENCIL_TEST); } else { - // Force flush before disabling stencil test - renderer.flush(); - var prev = renderer.maskStack[renderer.maskStack.length - 1]; prev.mask.applyStencil(renderer, prev.camera, false); if (renderer.currentCameraMask.mask !== prev.mask) { - renderer.currentMask.mask = prev.mask; - renderer.currentMask.camera = prev.camera; + current.mask = prev.mask; + current.camera = prev.camera; } else { - renderer.currentMask.mask = null; + current.mask = null; } } }, diff --git a/src/gameobjects/BuildGameObjectAnimation.js b/src/gameobjects/BuildGameObjectAnimation.js index c63bbe937..aee8b1007 100644 --- a/src/gameobjects/BuildGameObjectAnimation.js +++ b/src/gameobjects/BuildGameObjectAnimation.js @@ -35,7 +35,7 @@ var BuildGameObjectAnimation = function (sprite, config) { // { anims: { // key: string - // startFrame: [string|integer] + // startFrame: [string|number] // delay: [float] // repeat: [integer] // repeatDelay: [float] diff --git a/src/gameobjects/DisplayList.js b/src/gameobjects/DisplayList.js index 13b833f4c..bd174cc9c 100644 --- a/src/gameobjects/DisplayList.js +++ b/src/gameobjects/DisplayList.js @@ -110,6 +110,15 @@ var DisplayList = new Class({ { gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + if (gameObject.displayList) + { + gameObject.displayList.remove(gameObject); + } + + gameObject.displayList = this; + + this.queueDepthSort(); + this.events.emit(SceneEvents.ADDED_TO_SCENE, gameObject, this.scene); }, @@ -128,6 +137,10 @@ var DisplayList = new Class({ { gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.displayList = null; + + this.queueDepthSort(); + this.events.emit(SceneEvents.REMOVED_FROM_SCENE, gameObject, this.scene); }, @@ -181,7 +194,7 @@ var DisplayList = new Class({ * @param {Phaser.GameObjects.GameObject} childA - The first Game Object. * @param {Phaser.GameObjects.GameObject} childB - The second Game Object. * - * @return {integer} The difference between the depths of each Game Object. + * @return {number} The difference between the depths of each Game Object. */ sortByDepth: function (childA, childB) { diff --git a/src/gameobjects/GameObject.js b/src/gameobjects/GameObject.js index f8eaa0dba..906d112bd 100644 --- a/src/gameobjects/GameObject.js +++ b/src/gameobjects/GameObject.js @@ -49,6 +49,20 @@ var GameObject = new Class({ */ this.scene = scene; + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.GameObject#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + /** * A textual representation of this Game Object, i.e. `sprite`. * Used internally by Phaser but is available for your own custom classes to populate. @@ -70,7 +84,7 @@ var GameObject = new Class({ * If you need to store complex data about your Game Object, look at using the Data Component instead. * * @name Phaser.GameObjects.GameObject#state - * @type {(integer|string)} + * @type {(number|string)} * @since 3.16.0 */ this.state = 0; @@ -112,7 +126,7 @@ var GameObject = new Class({ * Reserved for future use by plugins and the Input Manager. * * @name Phaser.GameObjects.GameObject#tabIndex - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -136,7 +150,7 @@ var GameObject = new Class({ * If those components are not used by your custom class then you can use this bitmask as you wish. * * @name Phaser.GameObjects.GameObject#renderFlags - * @type {integer} + * @type {number} * @default 15 * @since 3.0.0 */ @@ -244,7 +258,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#setState * @since 3.16.0 * - * @param {(integer|string)} value - The state of the Game Object. + * @param {(number|string)} value - The state of the Game Object. * * @return {this} This GameObject. */ @@ -610,7 +624,7 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#getIndexList * @since 3.4.0 * - * @return {integer[]} An array of display list position indexes. + * @return {number[]} An array of display list position indexes. */ getIndexList: function () { @@ -659,13 +673,9 @@ var GameObject = new Class({ * @method Phaser.GameObjects.GameObject#destroy * @fires Phaser.GameObjects.Events#DESTROY * @since 3.0.0 - * - * @param {boolean} [fromScene=false] - Is this Game Object being destroyed as the result of a Scene shutdown? */ - destroy: function (fromScene) + destroy: function () { - if (fromScene === undefined) { fromScene = false; } - // This Game Object has already been destroyed if (!this.scene || this.ignoreDestroy) { @@ -679,16 +689,23 @@ var GameObject = new Class({ this.emit(Events.DESTROY, this); - var sys = this.scene.sys; + this.removeAllListeners(); - if (!fromScene) + if (this.postPipelines) { - sys.displayList.remove(this); + this.resetPostPipeline(true); + } + + if (this.displayList) + { + this.displayList.queueDepthSort(); + this.displayList.remove(this); } if (this.input) { - sys.input.clear(this); + this.scene.sys.input.clear(this); + this.input = undefined; } @@ -702,23 +719,16 @@ var GameObject = new Class({ if (this.body) { this.body.destroy(); - this.body = undefined; - } - // Tell the Scene to re-sort the children - if (!fromScene) - { - sys.queueDepthSort(); + this.body = undefined; } this.active = false; this.visible = false; this.scene = undefined; - + this.displayList = undefined; this.parentContainer = undefined; - - this.removeAllListeners(); } }); @@ -726,7 +736,7 @@ var GameObject = new Class({ /** * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. * - * @constant {integer} RENDER_MASK + * @constant {number} RENDER_MASK * @memberof Phaser.GameObjects.GameObject * @default */ diff --git a/src/gameobjects/GameObjectFactory.js b/src/gameobjects/GameObjectFactory.js index a42c20608..ff93090be 100644 --- a/src/gameobjects/GameObjectFactory.js +++ b/src/gameobjects/GameObjectFactory.js @@ -134,7 +134,10 @@ var GameObjectFactory = new Class({ { this.displayList.add(child); } - else if (child.preUpdate) + + // For when custom objects have overridden `preUpdate` but don't hook into the ADDED_TO_SCENE event: + // Adding to the list multiple times is safe, as it won't add duplicates into the list anyway. + if (child.preUpdate) { this.updateList.add(child); } diff --git a/src/gameobjects/UpdateList.js b/src/gameobjects/UpdateList.js index be2758be4..4890af625 100644 --- a/src/gameobjects/UpdateList.js +++ b/src/gameobjects/UpdateList.js @@ -90,7 +90,7 @@ var UpdateList = new Class({ * The total number of items awaiting processing. * * @name Phaser.GameObjects.UpdateList#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -287,7 +287,7 @@ var UpdateList = new Class({ * The number of entries in the active list. * * @name Phaser.GameObjects.UpdateList#length - * @type {integer} + * @type {number} * @readonly * @since 3.20.0 */ diff --git a/src/gameobjects/bitmaptext/BatchChar.js b/src/gameobjects/bitmaptext/BatchChar.js index cdf962974..8f3f18d6d 100644 --- a/src/gameobjects/bitmaptext/BatchChar.js +++ b/src/gameobjects/bitmaptext/BatchChar.js @@ -47,7 +47,7 @@ var BatchChar = function (pipeline, src, char, glyph, offsetX, offsetY, calcMatr var tx3 = calcMatrix.getXRound(xw, y, roundPixels); var ty3 = calcMatrix.getYRound(xw, y, roundPixels); - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, glyph.u0, glyph.v0, glyph.u1, glyph.v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + pipeline.batchQuad(src, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, glyph.u0, glyph.v0, glyph.u1, glyph.v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); }; module.exports = BatchChar; diff --git a/src/gameobjects/bitmaptext/ParseFromAtlas.js b/src/gameobjects/bitmaptext/ParseFromAtlas.js index fc7471d05..41e9384e6 100644 --- a/src/gameobjects/bitmaptext/ParseFromAtlas.js +++ b/src/gameobjects/bitmaptext/ParseFromAtlas.js @@ -20,8 +20,8 @@ var ParseXMLBitmapFont = require('./ParseXMLBitmapFont'); * @param {string} textureKey - The key of the BitmapFont's texture. * @param {string} frameKey - The key of the BitmapFont texture's frame. * @param {string} xmlKey - The key of the XML data of the font to parse. - * @param {integer} [xSpacing] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing] - The y-axis spacing to add to the line height. * * @return {boolean} Whether the parsing was successful or not. */ diff --git a/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js b/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js index 9ef280093..4cf067f01 100644 --- a/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js +++ b/src/gameobjects/bitmaptext/ParseXMLBitmapFont.js @@ -14,7 +14,7 @@ * @param {Node} node - The XML Node. * @param {string} attribute - The attribute to read. * - * @return {integer} The parsed value. + * @return {number} The parsed value. */ function getValue (node, attribute) { @@ -30,8 +30,8 @@ function getValue (node, attribute) * * @param {XMLDocument} xml - The XML Document to parse the font from. * @param {Phaser.Textures.Frame} frame - The texture frame to take into account when creating the uv data. - * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing=0] - The y-axis spacing to add to the line height. * @param {Phaser.Textures.Texture} [texture] - If provided, each glyph in the Bitmap Font will be added to this texture as a frame. * * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. diff --git a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js index 51f8985ab..d90d445f4 100644 --- a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js +++ b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapText.js @@ -48,7 +48,7 @@ var Render = require('./DynamicBitmapTextRender'); * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size of this Bitmap Text. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. */ var DynamicBitmapText = new Class({ diff --git a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js index 3c3408b1b..860d610cb 100644 --- a/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js +++ b/src/gameobjects/bitmaptext/dynamic/DynamicBitmapTextWebGLRenderer.js @@ -5,8 +5,11 @@ */ var GetCalcMatrix = require('../../GetCalcMatrix'); +var TransformMatrix = require('../../components/TransformMatrix'); var Utils = require('../../../renderer/webgl/Utils'); +var tempMatrix = new TransformMatrix(); + /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -31,14 +34,14 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatr return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var result = GetCalcMatrix(src, camera, parentMatrix); var spriteMatrix = result.sprite; var calcMatrix = result.calc; - var fontMatrix = pipeline._tempMatrix4; + var fontMatrix = tempMatrix; var crop = (src.cropWidth > 0 || src.cropHeight > 0); @@ -112,6 +115,8 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatr var displayCallback = src.displayCallback; var callbackData = src.callbackData; + renderer.pipelines.preBatch(src); + for (var i = 0; i < textLength; i++) { charCode = text.charCodeAt(i); @@ -259,7 +264,7 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatr ty3 = Math.round(ty3); } - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + pipeline.batchQuad(src, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); } if (crop) @@ -268,6 +273,8 @@ var DynamicBitmapTextWebGLRenderer = function (renderer, src, camera, parentMatr renderer.popScissor(); } + + renderer.pipelines.postBatch(src); }; module.exports = DynamicBitmapTextWebGLRenderer; diff --git a/src/gameobjects/bitmaptext/static/BitmapText.js b/src/gameobjects/bitmaptext/static/BitmapText.js index 79f34d44c..1c67acb65 100644 --- a/src/gameobjects/bitmaptext/static/BitmapText.js +++ b/src/gameobjects/bitmaptext/static/BitmapText.js @@ -60,7 +60,7 @@ var Render = require('./BitmapTextRender'); * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size of this Bitmap Text. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. */ var BitmapText = new Class({ @@ -164,7 +164,7 @@ var BitmapText = new Class({ * The alignment position is based on the longest line of text. * * @name Phaser.GameObjects.BitmapText#_align - * @type {integer} + * @type {number} * @private * @since 3.11.0 */ @@ -476,10 +476,10 @@ var BitmapText = new Class({ * @param {number} [start=0] - The starting character to begin the tint at. If negative, it counts back from the end of the text. * @param {number} [length=1] - The number of characters to tint. Remember that spaces count as a character too. Pass -1 to tint all characters from `start` onwards. * @param {boolean} [tintFill=false] - Use a fill-based tint (true), or an additive tint (false) - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the character. If not other values are given this value is applied evenly, tinting the whole character. - * @param {integer} [topRight] - The tint being applied to the top-right of the character. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the character. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the character. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the character. If not other values are given this value is applied evenly, tinting the whole character. + * @param {number} [topRight] - The tint being applied to the top-right of the character. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the character. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the character. * * @return {this} This BitmapText Object. */ @@ -585,10 +585,10 @@ var BitmapText = new Class({ * @param {(string|number)} word - The word to search for. Either a string, or an index of the word in the words array. * @param {number} [count=1] - The number of matching words to tint. Pass -1 to tint all matching words. * @param {boolean} [tintFill=false] - Use a fill-based tint (true), or an additive tint (false) - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the word. If not other values are given this value is applied evenly, tinting the whole word. - * @param {integer} [topRight] - The tint being applied to the top-right of the word. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the word. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the word. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the word. If not other values are given this value is applied evenly, tinting the whole word. + * @param {number} [topRight] - The tint being applied to the top-right of the word. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the word. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the word. * * @return {this} This BitmapText Object. */ @@ -739,7 +739,7 @@ var BitmapText = new Class({ * * @param {string} font - The key of the font to use from the Bitmap Font cache. * @param {number} [size] - The font size of this Bitmap Text. If not specified the current size will be used. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. * * @return {this} This BitmapText Object. */ @@ -817,7 +817,7 @@ var BitmapText = new Class({ * The alignment position is based on the longest line of text. * * @name Phaser.GameObjects.BitmapText#align - * @type {integer} + * @type {number} * @since 3.11.0 */ align: { @@ -1022,7 +1022,7 @@ var BitmapText = new Class({ * Left align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_LEFT - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_LEFT = 0; @@ -1031,7 +1031,7 @@ BitmapText.ALIGN_LEFT = 0; * Center align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_CENTER - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_CENTER = 1; @@ -1040,7 +1040,7 @@ BitmapText.ALIGN_CENTER = 1; * Right align the text characters in a multi-line BitmapText object. * * @name Phaser.GameObjects.BitmapText.ALIGN_RIGHT - * @type {integer} + * @type {number} * @since 3.11.0 */ BitmapText.ALIGN_RIGHT = 2; @@ -1058,8 +1058,8 @@ BitmapText.ALIGN_RIGHT = 2; * @param {string} textureKey - The key of the BitmapFont's texture. * @param {string} frameKey - The key of the BitmapFont texture's frame. * @param {string} xmlKey - The key of the XML data of the font to parse. - * @param {integer} [xSpacing] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing] - The y-axis spacing to add to the line height. * * @return {boolean} Whether the parsing was successful or not. */ @@ -1073,8 +1073,8 @@ BitmapText.ParseFromAtlas = ParseFromAtlas; * * @param {XMLDocument} xml - The XML Document to parse the font from. * @param {Phaser.Textures.Frame} frame - The texture frame to take into account when creating the uv data. - * @param {integer} [xSpacing=0] - The x-axis spacing to add between each letter. - * @param {integer} [ySpacing=0] - The y-axis spacing to add to the line height. + * @param {number} [xSpacing=0] - The x-axis spacing to add between each letter. + * @param {number} [ySpacing=0] - The y-axis spacing to add to the line height. * * @return {Phaser.Types.GameObjects.BitmapText.BitmapFontData} The parsed Bitmap Font data. */ diff --git a/src/gameobjects/bitmaptext/static/BitmapTextFactory.js b/src/gameobjects/bitmaptext/static/BitmapTextFactory.js index bcbf72455..70ffb49ca 100644 --- a/src/gameobjects/bitmaptext/static/BitmapTextFactory.js +++ b/src/gameobjects/bitmaptext/static/BitmapTextFactory.js @@ -40,7 +40,7 @@ var GameObjectFactory = require('../../GameObjectFactory'); * @param {string} font - The key of the font to use from the BitmapFont cache. * @param {(string|string[])} [text] - The string, or array of strings, to be set as the content of this Bitmap Text. * @param {number} [size] - The font size to set. - * @param {integer} [align=0] - The alignment of the text in a multi-line BitmapText object. + * @param {number} [align=0] - The alignment of the text in a multi-line BitmapText object. * * @return {Phaser.GameObjects.BitmapText} The Game Object that was created. */ diff --git a/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js b/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js index eb5350f17..1e886f545 100644 --- a/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js +++ b/src/gameobjects/bitmaptext/static/BitmapTextWebGLRenderer.js @@ -32,7 +32,7 @@ var BitmapTextWebGLRenderer = function (renderer, src, camera, parentMatrix) return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; @@ -66,6 +66,8 @@ var BitmapTextWebGLRenderer = function (renderer, src, camera, parentMatrix) var dropShadow = (dropShadowX !== 0 || dropShadowY !== 0); + renderer.pipelines.preBatch(src); + if (dropShadow) { var srcShadowColor = src._dropShadowColorGL; @@ -120,6 +122,8 @@ var BitmapTextWebGLRenderer = function (renderer, src, camera, parentMatrix) // Debug test if the characters are in the correct place when rendered: // pipeline.drawFillRect(tx0, ty0, tx2 - tx0, ty2 - ty0, 0x00ff00, 0.5); } + + renderer.pipelines.postBatch(src); }; module.exports = BitmapTextWebGLRenderer; diff --git a/src/gameobjects/bitmaptext/typedefs/JSONBitmapText.js b/src/gameobjects/bitmaptext/typedefs/JSONBitmapText.js index 18bebd44f..6875f73ff 100644 --- a/src/gameobjects/bitmaptext/typedefs/JSONBitmapText.js +++ b/src/gameobjects/bitmaptext/typedefs/JSONBitmapText.js @@ -7,5 +7,5 @@ * @property {string} text - The text that this Bitmap Text displays. * @property {number} fontSize - The size of the font. * @property {number} letterSpacing - Adds / Removes spacing between characters. - * @property {integer} align - The alignment of the text in a multi-line BitmapText object. + * @property {number} align - The alignment of the text in a multi-line BitmapText object. */ diff --git a/src/gameobjects/blitter/Blitter.js b/src/gameobjects/blitter/Blitter.js index 9ec7966a9..9bfad9e08 100644 --- a/src/gameobjects/blitter/Blitter.js +++ b/src/gameobjects/blitter/Blitter.js @@ -16,7 +16,7 @@ var List = require('../../structs/List'); * @callback CreateCallback * * @param {Phaser.GameObjects.Bob} bob - The Bob that was created by the Blitter. - * @param {integer} index - The position of the Bob within the Blitter display list. + * @param {number} index - The position of the Bob within the Blitter display list. */ /** @@ -56,7 +56,7 @@ var List = require('../../structs/List'); * @param {number} [x=0] - The x coordinate of this Game Object in world space. * @param {number} [y=0] - The y coordinate of this Game Object in world space. * @param {string} [texture='__DEFAULT'] - The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. - * @param {(string|integer)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. + * @param {(string|number)} [frame=0] - The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. */ var Blitter = new Class({ @@ -130,9 +130,9 @@ var Blitter = new Class({ * * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. * @param {boolean} [visible=true] - Should the created Bob render or not? - * @param {integer} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. + * @param {number} [index] - The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. * * @return {Phaser.GameObjects.Bob} The newly created Bob object. */ @@ -166,8 +166,8 @@ var Blitter = new Class({ * @since 3.0.0 * * @param {CreateCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob. - * @param {integer} quantity - The quantity of Bob objects to create. - * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {number} quantity - The quantity of Bob objects to create. + * @param {(string|number|Phaser.Textures.Frame|string[]|number[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. * @param {boolean} [visible=true] - Should the created Bob render or not? * * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. @@ -197,8 +197,8 @@ var Blitter = new Class({ * @method Phaser.GameObjects.Blitter#createMultiple * @since 3.0.0 * - * @param {integer} quantity - The quantity of Bob objects to create. - * @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. + * @param {number} quantity - The quantity of Bob objects to create. + * @param {(string|number|Phaser.Textures.Frame|string[]|number[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture. * @param {boolean} [visible=true] - Should the created Bob render or not? * * @return {Phaser.GameObjects.Bob[]} An array of Bob objects that were created. diff --git a/src/gameobjects/blitter/BlitterFactory.js b/src/gameobjects/blitter/BlitterFactory.js index d7f70b114..ed6702aa8 100644 --- a/src/gameobjects/blitter/BlitterFactory.js +++ b/src/gameobjects/blitter/BlitterFactory.js @@ -18,8 +18,8 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} x - The x position of the Game Object. * @param {number} y - The y position of the Game Object. * @param {string} key - The key of the Texture the Blitter object will use. - * @param {(string|integer)} [frame] - The default Frame children of the Blitter will use. - * + * @param {(string|number)} [frame] - The default Frame children of the Blitter will use. + * * @return {Phaser.GameObjects.Blitter} The Game Object that was created. */ GameObjectFactory.register('blitter', function (x, y, key, frame) @@ -28,9 +28,9 @@ GameObjectFactory.register('blitter', function (x, y, key, frame) }); // When registering a factory function 'this' refers to the GameObjectFactory context. -// +// // There are several properties available to use: -// +// // this.scene - a reference to the Scene that owns the GameObjectFactory // this.displayList - a reference to the Display List the Scene owns // this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/blitter/BlitterWebGLRenderer.js b/src/gameobjects/blitter/BlitterWebGLRenderer.js index 7bebcdb56..57ab1c2d2 100644 --- a/src/gameobjects/blitter/BlitterWebGLRenderer.js +++ b/src/gameobjects/blitter/BlitterWebGLRenderer.js @@ -4,8 +4,11 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = require('../components/TransformMatrix'); var Utils = require('../../renderer/webgl/Utils'); +var tempMatrix = new TransformMatrix(); + /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -34,9 +37,7 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix) var cameraScrollX = camera.scrollX * src.scrollFactorX; var cameraScrollY = camera.scrollY * src.scrollFactorY; - var calcMatrix = pipeline._tempMatrix1; - - calcMatrix.copyFrom(camera.matrix); + var calcMatrix = tempMatrix.copyFrom(camera.matrix); if (parentMatrix) { @@ -53,6 +54,8 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix) var alpha = camera.alpha * src.alpha; var roundPixels = camera.roundPixels; + renderer.pipelines.preBatch(src); + for (var index = 0; index < list.length; index++) { var bob = list[index]; @@ -111,11 +114,13 @@ var BlitterWebGLRenderer = function (renderer, src, camera, parentMatrix) } // TL x/y, BL x/y, BR x/y, TR x/y - if (pipeline.batchQuad(tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit)) + if (pipeline.batchQuad(src, tx0, ty0, tx0, ty1, tx1, ty1, tx1, ty0, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, frame.glTexture, textureUnit)) { prevTextureSourceIndex = -1; } } + + renderer.pipelines.postBatch(src); }; module.exports = BlitterWebGLRenderer; diff --git a/src/gameobjects/blitter/Bob.js b/src/gameobjects/blitter/Bob.js index 5c8941a05..24ef3ba84 100644 --- a/src/gameobjects/blitter/Bob.js +++ b/src/gameobjects/blitter/Bob.js @@ -31,7 +31,7 @@ var Frame = require('../../textures/Frame'); * @param {Phaser.GameObjects.Blitter} blitter - The parent Blitter object is responsible for updating this Bob. * @param {number} x - The horizontal position of this Game Object in the world, relative to the parent Blitter position. * @param {number} y - The vertical position of this Game Object in the world, relative to the parent Blitter position. - * @param {(string|integer)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. + * @param {(string|number)} frame - The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. * @param {boolean} visible - Should the Bob render visible or not to start with? */ var Bob = new Class({ @@ -150,7 +150,7 @@ var Bob = new Class({ * @method Phaser.GameObjects.Bob#setFrame * @since 3.0.0 * - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The frame to be used during rendering. * * @return {this} This Bob Game Object. */ @@ -200,7 +200,7 @@ var Bob = new Class({ * * @param {number} x - The x position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param {number} y - The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. - * @param {(string|integer|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. + * @param {(string|number|Phaser.Textures.Frame)} [frame] - The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. * * @return {this} This Bob Game Object. */ @@ -299,7 +299,7 @@ var Bob = new Class({ /** * Sets the visibility of this Bob. - * + * * An invisible Bob will skip rendering. * * @method Phaser.GameObjects.Bob#setVisible @@ -319,7 +319,7 @@ var Bob = new Class({ /** * Set the Alpha level of this Bob. The alpha controls the opacity of the Game Object as it renders. * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * + * * A Bob with alpha 0 will skip rendering. * * @method Phaser.GameObjects.Bob#setAlpha @@ -373,7 +373,7 @@ var Bob = new Class({ /** * The visible state of the Bob. - * + * * An invisible Bob will skip rendering. * * @name Phaser.GameObjects.Bob#visible @@ -397,7 +397,7 @@ var Bob = new Class({ /** * The alpha value of the Bob, between 0 and 1. - * + * * A Bob with alpha 0 will skip rendering. * * @name Phaser.GameObjects.Bob#alpha diff --git a/src/gameobjects/components/BlendMode.js b/src/gameobjects/components/BlendMode.js index f868f6bb0..01a6ac7f7 100644 --- a/src/gameobjects/components/BlendMode.js +++ b/src/gameobjects/components/BlendMode.js @@ -20,7 +20,7 @@ var BlendMode = { * Private internal value. Holds the current blend mode. * * @name Phaser.GameObjects.Components.BlendMode#_blendMode - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 diff --git a/src/gameobjects/components/Depth.js b/src/gameobjects/components/Depth.js index f2bca1eca..c59225c11 100644 --- a/src/gameobjects/components/Depth.js +++ b/src/gameobjects/components/Depth.js @@ -7,7 +7,7 @@ /** * Provides methods used for setting the depth of a Game Object. * Should be applied as a mixin and not used directly. - * + * * @namespace Phaser.GameObjects.Components.Depth * @since 3.0.0 */ @@ -16,9 +16,9 @@ var Depth = { /** * Private internal value. Holds the depth of the Game Object. - * + * * @name Phaser.GameObjects.Components.Depth#_depth - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -27,7 +27,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -35,7 +35,7 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @name Phaser.GameObjects.Components.Depth#depth * @type {number} * @since 3.0.0 @@ -49,7 +49,11 @@ var Depth = { set: function (value) { - this.scene.sys.queueDepthSort(); + if (this.displayList) + { + this.displayList.queueDepthSort(); + } + this._depth = value; } @@ -57,7 +61,7 @@ var Depth = { /** * The depth of this Game Object within the Scene. - * + * * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order * of Game Objects, without actually moving their position in the display list. * @@ -65,12 +69,12 @@ var Depth = { * value will always render in front of one with a lower value. * * Setting the depth will queue a depth sort event within the Scene. - * + * * @method Phaser.GameObjects.Components.Depth#setDepth * @since 3.0.0 * - * @param {integer} value - The depth of this Game Object. - * + * @param {number} value - The depth of this Game Object. + * * @return {this} This Game Object instance. */ setDepth: function (value) diff --git a/src/gameobjects/components/PathFollower.js b/src/gameobjects/components/PathFollower.js index 7e0af95b7..7e2e5e4ce 100644 --- a/src/gameobjects/components/PathFollower.js +++ b/src/gameobjects/components/PathFollower.js @@ -102,7 +102,7 @@ var PathFollower = { * Records the direction of the follower so it can change direction. * * @name Phaser.GameObjects.PathFollower#_prevDirection - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ diff --git a/src/gameobjects/components/Pipeline.js b/src/gameobjects/components/Pipeline.js index 4590264e0..23a307141 100644 --- a/src/gameobjects/components/Pipeline.js +++ b/src/gameobjects/components/Pipeline.js @@ -4,7 +4,9 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var DeepCopy = require('../../utils/object/DeepCopy'); var PIPELINE_CONST = require('../../renderer/webgl/pipelines/const'); +var SpliceOne = require('../../utils/array/SpliceOne'); /** * Provides methods used for setting the WebGL rendering pipeline of a Game Object. @@ -19,6 +21,8 @@ var Pipeline = { /** * The initial WebGL pipeline of this Game Object. * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + * * @name Phaser.GameObjects.Components.Pipeline#defaultPipeline * @type {Phaser.Renderer.WebGL.WebGLPipeline} * @default null @@ -38,61 +42,241 @@ var Pipeline = { */ pipeline: null, + /** + * Does this Game Object have any Post Pipelines set? + * + * @name Phaser.GameObjects.Components.Pipeline#hasPostPipeline + * @type {boolean} + * @webglOnly + * @since 3.50.0 + */ + hasPostPipeline: false, + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + * + * @name Phaser.GameObjects.Components.Pipeline#postPipeline + * @type {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]} + * @webglOnly + * @since 3.50.0 + */ + postPipelines: null, + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + * + * @name Phaser.GameObjects.Components.Pipeline#pipelineData + * @type {object} + * @webglOnly + * @since 3.50.0 + */ + pipelineData: null, + /** * Sets the initial WebGL Pipeline of this Game Object. * - * This should only be called during the instantiation of the Game Object. + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. * * @method Phaser.GameObjects.Components.Pipeline#initPipeline * @webglOnly * @since 3.0.0 * - * @param {string} [name=MultiPipeline] - The name of the pipeline to set on this Game Object. Defaults to the Multi Pipeline. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. * * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. */ - initPipeline: function (name) + initPipeline: function (pipeline) { - if (name === undefined) { name = PIPELINE_CONST.MULTI_PIPELINE; } + if (pipeline === undefined) { pipeline = PIPELINE_CONST.MULTI_PIPELINE; } - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) - { - this.defaultPipeline = pipelines.get(name); - this.pipeline = this.defaultPipeline; + this.postPipelines = []; + this.pipelineData = {}; - return true; + if (pipelines) + { + var instance = pipelines.get(pipeline); + + if (instance) + { + this.defaultPipeline = instance; + this.pipeline = instance; + + return true; + } } return false; }, /** - * Sets the active WebGL Pipeline of this Game Object. + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. * * @method Phaser.GameObjects.Components.Pipeline#setPipeline * @webglOnly * @since 3.0.0 * - * @param {string} name - The name of the pipeline to set on this Game Object. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline, or a pipeline instance to set. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. * * @return {this} This Game Object instance. */ - setPipeline: function (name) + setPipeline: function (pipeline, pipelineData, copyData) { - var renderer = this.scene.sys.game.renderer; + var renderer = this.scene.sys.renderer; var pipelines = renderer.pipelines; - if (pipelines && pipelines.has(name)) + if (pipelines) { - this.pipeline = pipelines.get(name); + var instance = pipelines.get(pipeline); + + if (instance) + { + this.pipeline = instance; + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } } return this; }, + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {(string|string[]|function|function[]|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[])} pipelines - Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param {object} [pipelineData] - Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param {boolean} [copyData=true] - Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. + * + * @return {this} This Game Object instance. + */ + setPostPipeline: function (pipelines, pipelineData, copyData) + { + var renderer = this.scene.sys.renderer; + var pipelineManager = renderer.pipelines; + + if (pipelineManager) + { + if (!Array.isArray(pipelines)) + { + pipelines = [ pipelines ]; + } + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelineManager.getPostPipeline(pipelines[i], this); + + if (instance) + { + this.postPipelines.push(instance); + } + } + + if (pipelineData) + { + this.pipelineData = (copyData) ? DeepCopy(pipelineData) : pipelineData; + } + } + + this.hasPostPipeline = (this.postPipelines.length > 0); + + return this; + }, + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * + * @method Phaser.GameObjects.Components.Pipeline#setPipelineData + * @webglOnly + * @since 3.50.0 + * + * @param {string} key - The key of the pipeline data to set, update, or delete. + * @param {any} [value] - The value to be set with the key. If `undefined` then `key` will be deleted from the object. + * + * @return {this} This Game Object instance. + */ + setPipelineData: function (key, value) + { + var data = this.pipelineData; + + if (value === undefined) + { + delete data[key]; + } + else + { + data[key] = value; + } + + return this; + }, + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * + * @method Phaser.GameObjects.Components.Pipeline#getPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The first Post Pipeline matching the name, or undefined if no match. + */ + getPostPipeline: function (pipeline) + { + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((typeof pipeline === 'string' && instance.name === pipeline) || instance instanceof pipeline) + { + return instance; + } + } + }, + /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. * @@ -100,15 +284,96 @@ var Pipeline = { * @webglOnly * @since 3.0.0 * - * @return {boolean} `true` if the pipeline was set successfully, otherwise `false`. + * @param {boolean} [resetPostPipelines=false] - Reset all of the post pipelines? + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + * + * @return {boolean} `true` if the pipeline was reset successfully, otherwise `false`. */ - resetPipeline: function () + resetPipeline: function (resetPostPipelines, resetData) { + if (resetPostPipelines === undefined) { resetPostPipelines = false; } + if (resetData === undefined) { resetData = false; } + this.pipeline = this.defaultPipeline; + if (resetPostPipelines) + { + this.postPipelines = []; + this.hasPostPipeline = false; + } + + if (resetData) + { + this.pipelineData = {}; + } + return (this.pipeline !== null); }, + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * + * @method Phaser.GameObjects.Components.Pipeline#resetPostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {boolean} [resetData=false] - Reset the `pipelineData` object to being an empty object? + */ + resetPostPipeline: function (resetData) + { + if (resetData === undefined) { resetData = false; } + + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + pipelines[i].destroy(); + } + + this.postPipelines = []; + this.hasPostPipeline = false; + + if (resetData) + { + this.pipelineData = {}; + } + }, + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * + * @method Phaser.GameObjects.Components.Pipeline#removePostPipeline + * @webglOnly + * @since 3.50.0 + * + * @param {string|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} pipeline - The string-based name of the pipeline, or a pipeline class. + * + * @return {this} This Game Object. + */ + removePostPipeline: function (pipeline) + { + var pipelines = this.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var instance = pipelines[i]; + + if ((typeof pipeline === 'string' && instance.name === pipeline) || instance instanceof pipeline) + { + instance.destroy(); + + SpliceOne(pipelines, i); + + return this; + } + } + + return this; + }, + /** * Gets the name of the WebGL Pipeline this Game Object is currently using. * diff --git a/src/gameobjects/components/Texture.js b/src/gameobjects/components/Texture.js index b0978a2fb..983f2489e 100644 --- a/src/gameobjects/components/Texture.js +++ b/src/gameobjects/components/Texture.js @@ -53,7 +53,7 @@ var Texture = { * @since 3.0.0 * * @param {(string|Phaser.Textures.Texture)} key - The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -77,7 +77,7 @@ var Texture = { * @method Phaser.GameObjects.Components.Texture#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * diff --git a/src/gameobjects/components/TextureCrop.js b/src/gameobjects/components/TextureCrop.js index ba7361786..bfc5e97da 100644 --- a/src/gameobjects/components/TextureCrop.js +++ b/src/gameobjects/components/TextureCrop.js @@ -47,24 +47,24 @@ var TextureCrop = { /** * Applies a crop to a texture based Game Object, such as a Sprite or Image. - * + * * The crop is a rectangle that limits the area of the texture frame that is visible during rendering. - * + * * Cropping a Game Object does not change its size, dimensions, physics body or hit area, it just * changes what is shown when rendered. - * + * * The crop coordinates are relative to the texture frame, not the Game Object, meaning 0 x 0 is the top-left. - * + * * Therefore, if you had a Game Object that had an 800x600 sized texture, and you wanted to show only the left * half of it, you could call `setCrop(0, 0, 400, 600)`. - * + * * It is also scaled to match the Game Object scale automatically. Therefore a crop rect of 100x50 would crop * an area of 200x100 when applied to a Game Object that had a scale factor of 2. - * + * * You can either pass in numeric values directly, or you can provide a single Rectangle object as the first argument. - * + * * Call this method with no arguments at all to reset the crop, or toggle the property `isCropped` to `false`. - * + * * You should do this if the crop rectangle becomes the same size as the frame itself, as it will allow * the renderer to skip several internal calculations. * @@ -112,7 +112,7 @@ var TextureCrop = { * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -136,7 +136,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * @param {boolean} [updateSize=true] - Should this call adjust the size of the Game Object? * @param {boolean} [updateOrigin=true] - Should this call adjust the origin of the Game Object? * @@ -189,7 +189,7 @@ var TextureCrop = { * @method Phaser.GameObjects.Components.TextureCrop#resetCropObject * @private * @since 3.12.0 - * + * * @return {object} The crop object. */ resetCropObject: function () diff --git a/src/gameobjects/components/Tint.js b/src/gameobjects/components/Tint.js index 221be869f..cdcb46ad6 100644 --- a/src/gameobjects/components/Tint.js +++ b/src/gameobjects/components/Tint.js @@ -115,10 +115,10 @@ var Tint = { * @webglOnly * @since 3.0.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If no other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -164,10 +164,10 @@ var Tint = { * @webglOnly * @since 3.11.0 * - * @param {integer} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. - * @param {integer} [topRight] - The tint being applied to the top-right of the Game Object. - * @param {integer} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. - * @param {integer} [bottomRight] - The tint being applied to the bottom-right of the Game Object. + * @param {number} [topLeft=0xffffff] - The tint being applied to the top-left of the Game Object. If not other values are given this value is applied evenly, tinting the whole Game Object. + * @param {number} [topRight] - The tint being applied to the top-right of the Game Object. + * @param {number} [bottomLeft] - The tint being applied to the bottom-left of the Game Object. + * @param {number} [bottomRight] - The tint being applied to the bottom-right of the Game Object. * * @return {this} This Game Object instance. */ @@ -185,7 +185,7 @@ var Tint = { * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. * * @name Phaser.GameObjects.Components.Tint#tint - * @type {integer} + * @type {number} * @webglOnly * @since 3.0.0 */ diff --git a/src/gameobjects/components/Transform.js b/src/gameobjects/components/Transform.js index a463341e9..a7088455d 100644 --- a/src/gameobjects/components/Transform.js +++ b/src/gameobjects/components/Transform.js @@ -206,7 +206,7 @@ var Transform = { * If you prefer to work in radians, see the `rotation` property instead. * * @name Phaser.GameObjects.Components.Transform#angle - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ diff --git a/src/gameobjects/components/TransformMatrix.js b/src/gameobjects/components/TransformMatrix.js index 92d59b837..942c502f6 100644 --- a/src/gameobjects/components/TransformMatrix.js +++ b/src/gameobjects/components/TransformMatrix.js @@ -278,13 +278,13 @@ var TransformMatrix = new Class({ if (a || b) { // var r = Math.sqrt(a * a + b * b); - + return (b > 0) ? Math.acos(a / this.scaleX) : -Math.acos(a / this.scaleX); } else if (c || d) { // var s = Math.sqrt(c * c + d * d); - + return MATH_CONST.TAU - ((d > 0) ? Math.acos(-c / this.scaleY) : -Math.acos(c / this.scaleY)); } else @@ -427,7 +427,7 @@ var TransformMatrix = new Class({ /** * Multiply this Matrix by the given Matrix. - * + * * If an `out` Matrix is given then the results will be stored in it. * If it is not given, this matrix will be updated in place instead. * Use an `out` Matrix if you do not wish to mutate this matrix. @@ -473,7 +473,7 @@ var TransformMatrix = new Class({ /** * Multiply this Matrix by the matrix given, including the offset. - * + * * The offsetX is added to the tx value: `offsetX * a + offsetY * c + tx`. * The offsetY is added to the ty value: `offsetY * b + offsetY * d + ty`. * @@ -707,7 +707,7 @@ var TransformMatrix = new Class({ /** * Copy the values in this Matrix to the array given. - * + * * Where array indexes 0, 1, 2, 3, 4 and 5 are mapped to a, b, c, d, e and f. * * @method Phaser.GameObjects.Components.TransformMatrix#copyToArray @@ -769,9 +769,9 @@ var TransformMatrix = new Class({ /** * Decompose this Matrix into its translation, scale and rotation values using QR decomposition. - * + * * The result must be applied in the following order to reproduce the current matrix: - * + * * translate -> rotate -> scale * * @method Phaser.GameObjects.Components.TransformMatrix#decomposeMatrix @@ -863,7 +863,7 @@ var TransformMatrix = new Class({ /** * Takes the `x` and `y` values and returns a new position in the `output` vector that is the inverse of * the current matrix with its transformation applied. - * + * * Can be used to translate points from world to local space. * * @method Phaser.GameObjects.Components.TransformMatrix#applyInverse @@ -902,7 +902,7 @@ var TransformMatrix = new Class({ * * @method Phaser.GameObjects.Components.TransformMatrix#getX * @since 3.12.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @@ -919,7 +919,7 @@ var TransformMatrix = new Class({ * * @method Phaser.GameObjects.Components.TransformMatrix#getY * @since 3.12.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @@ -932,12 +932,12 @@ var TransformMatrix = new Class({ /** * Returns the X component of this matrix multiplied by the given values. - * + * * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. * * @method Phaser.GameObjects.Components.TransformMatrix#getXRound * @since 3.50.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @param {boolean} [round=false] - Math.round the resulting value? @@ -958,12 +958,12 @@ var TransformMatrix = new Class({ /** * Returns the Y component of this matrix multiplied by the given values. - * + * * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. * * @method Phaser.GameObjects.Components.TransformMatrix#getYRound * @since 3.50.0 - * + * * @param {number} x - The x value. * @param {number} y - The y value. * @param {boolean} [round=false] - Math.round the resulting value? diff --git a/src/gameobjects/container/Container.js b/src/gameobjects/container/Container.js index 42f865e74..2ed0cc052 100644 --- a/src/gameobjects/container/Container.js +++ b/src/gameobjects/container/Container.js @@ -11,7 +11,6 @@ var Class = require('../../utils/Class'); var Components = require('../components'); var Events = require('../events'); var GameObject = require('../GameObject'); -var GameObjectEvents = require('../events'); var Rectangle = require('../../geom/rectangle/Rectangle'); var Render = require('./ContainerRender'); var Union = require('../../geom/rectangle/Union'); @@ -44,7 +43,7 @@ var Vector2 = require('../../math/Vector2'); * * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. - * + * * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, * or the input area will become misaligned. * @@ -71,6 +70,7 @@ var Vector2 = require('../../math/Vector2'); * @extends Phaser.GameObjects.Components.ComputedSize * @extends Phaser.GameObjects.Components.Depth * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline * @extends Phaser.GameObjects.Components.Transform * @extends Phaser.GameObjects.Components.Visible * @@ -89,6 +89,7 @@ var Container = new Class({ Components.ComputedSize, Components.Depth, Components.Mask, + Components.Pipeline, Components.Transform, Components.Visible, Render @@ -135,7 +136,7 @@ var Container = new Class({ * the maximum limit the Container can grow in size to. * * @name Phaser.GameObjects.Container#maxSize - * @type {integer} + * @type {number} * @default -1 * @since 3.4.0 */ @@ -145,7 +146,7 @@ var Container = new Class({ * The cursor position. * * @name Phaser.GameObjects.Container#position - * @type {integer} + * @type {number} * @since 3.4.0 */ this.position = 0; @@ -222,7 +223,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorX * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorX = 1; @@ -249,10 +250,12 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#scrollFactorY * @type {number} * @default 1 - * @since 3.0.0 + * @since 3.4.0 */ this.scrollFactorY = 1; + this.initPipeline(); + this.setPosition(x, y); this.clearAlpha(); @@ -272,6 +275,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#originX * @type {number} * @readonly + * @override * @since 3.4.0 */ originX: { @@ -290,6 +294,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#originY * @type {number} * @readonly + * @override * @since 3.4.0 */ originY: { @@ -308,6 +313,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#displayOriginX * @type {number} * @readonly + * @override * @since 3.4.0 */ displayOriginX: { @@ -326,6 +332,7 @@ var Container = new Class({ * @name Phaser.GameObjects.Container#displayOriginY * @type {number} * @readonly + * @override * @since 3.4.0 */ displayOriginY: { @@ -460,7 +467,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + gameObject.emit(Events.ADDED_TO_SCENE, gameObject, this.scene); } }, @@ -485,7 +492,7 @@ var Container = new Class({ // Is only on the Display List via this Container if (!this.scene.sys.displayList.exists(gameObject)) { - gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + gameObject.emit(Events.REMOVED_FROM_SCENE, gameObject, this.scene); } }, @@ -571,7 +578,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container. - * @param {integer} [index=0] - The position to insert the Game Object/s at. + * @param {number} [index=0] - The position to insert the Game Object/s at. * * @return {this} This Container instance. */ @@ -588,7 +595,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getAt * @since 3.4.0 * - * @param {integer} index - The position to get the Game Object from. + * @param {number} index - The position to get the Game Object from. * * @return {?Phaser.GameObjects.GameObject} The Game Object at the specified index, or `null` if none found. */ @@ -605,7 +612,7 @@ var Container = new Class({ * * @param {Phaser.GameObjects.GameObject} child - The Game Object to search for in this Container. * - * @return {integer} The index of the Game Object in this Container, or -1 if not found. + * @return {number} The index of the Game Object in this Container, or -1 if not found. */ getIndex: function (child) { @@ -666,8 +673,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#getRandom * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {?Phaser.GameObjects.GameObject} A random child from the Container, or `null` if the Container is empty. */ @@ -691,8 +698,8 @@ var Container = new Class({ * * @param {string} property - The property to test on each Game Object in the Container. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {?Phaser.GameObjects.GameObject} The first matching Game Object, or `null` if none was found. */ @@ -721,8 +728,8 @@ var Container = new Class({ * * @param {string} [property] - The property to test on each Game Object in the Container. * @param {any} [value] - If property is set then the `property` must strictly equal this value to be included in the results. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {Phaser.GameObjects.GameObject[]} An array of matching Game Objects from this Container. */ @@ -744,10 +751,10 @@ var Container = new Class({ * * @param {string} property - The property to check. * @param {any} value - The value to check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * - * @return {integer} The total number of Game Objects in this Container with a property matching the given value. + * @return {number} The total number of Game Objects in this Container with a property matching the given value. */ count: function (property, value, startIndex, endIndex) { @@ -785,7 +792,7 @@ var Container = new Class({ * @since 3.4.0 * * @param {Phaser.GameObjects.GameObject} child - The Game Object to move. - * @param {integer} index - The new position of the Game Object in this Container. + * @param {number} index - The new position of the Game Object in this Container. * * @return {this} This Container instance. */ @@ -839,7 +846,7 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeAt * @since 3.4.0 * - * @param {integer} index - The index of the Game Object to be removed. + * @param {number} index - The index of the Game Object to be removed. * @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container. * * @return {this} This Container instance. @@ -864,8 +871,8 @@ var Container = new Class({ * @method Phaser.GameObjects.Container#removeBetween * @since 3.4.0 * - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container. * * @return {this} This Container instance. @@ -1072,8 +1079,8 @@ var Container = new Class({ * * @param {string} property - The property that must exist on the Game Object. * @param {any} value - The value to get the property to. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=Container.length] - An optional end index to search up to (but not included) * * @return {this} This Container instance. */ @@ -1185,7 +1192,7 @@ var Container = new Class({ * them from physics bodies if not accounted for in your code. * * @method Phaser.GameObjects.Container#setScrollFactor - * @since 3.0.0 + * @since 3.4.0 * * @param {number} x - The horizontal scroll factor of this Game Object. * @param {number} [y=x] - The vertical scroll factor of this Game Object. If not set it will use the `x` value. @@ -1214,7 +1221,7 @@ var Container = new Class({ * The number of Game Objects inside this Container. * * @name Phaser.GameObjects.Container#length - * @type {integer} + * @type {number} * @readonly * @since 3.4.0 */ diff --git a/src/gameobjects/container/ContainerWebGLRenderer.js b/src/gameobjects/container/ContainerWebGLRenderer.js index 89c2aacac..e858f3950 100644 --- a/src/gameobjects/container/ContainerWebGLRenderer.js +++ b/src/gameobjects/container/ContainerWebGLRenderer.js @@ -22,8 +22,9 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix) { var children = container.list; + var childCount = children.length; - if (children.length === 0) + if (childCount === 0) { return; } @@ -43,6 +44,8 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix transformMatrix.applyITRS(container.x, container.y, container.rotation, container.scaleX, container.scaleY); } + renderer.pipelines.preBatch(container); + var containerHasBlendMode = (container.blendMode !== -1); if (!containerHasBlendMode) @@ -56,9 +59,6 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix var scrollFactorX = container.scrollFactorX; var scrollFactorY = container.scrollFactorY; - var list = children; - var childCount = children.length; - for (var i = 0; i < childCount; i++) { var child = children[i]; @@ -114,7 +114,7 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix renderer.currentType = type; } - renderer.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === renderer.currentType) : false; + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; // Set parent values child.setScrollFactor(childScrollFactorX * scrollFactorX, childScrollFactorY * scrollFactorY); @@ -137,6 +137,8 @@ var ContainerWebGLRenderer = function (renderer, container, camera, parentMatrix renderer.newType = false; } + + renderer.pipelines.postBatch(container); }; module.exports = ContainerWebGLRenderer; diff --git a/src/gameobjects/domelement/DOMElementCSSRenderer.js b/src/gameobjects/domelement/DOMElementCSSRenderer.js index 24caf8ee3..fe03cedc9 100644 --- a/src/gameobjects/domelement/DOMElementCSSRenderer.js +++ b/src/gameobjects/domelement/DOMElementCSSRenderer.js @@ -6,6 +6,11 @@ var CSSBlendModes = require('./CSSBlendModes'); var GameObject = require('../GameObject'); +var TransformMatrix = require('../components/TransformMatrix'); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -45,9 +50,9 @@ var DOMElementCSSRenderer = function (renderer, src, camera, parentMatrix) alpha *= parent.alpha; } - var camMatrix = renderer._tempMatrix1; - var srcMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var camMatrix = tempMatrix1; + var srcMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; var dx = 0; var dy = 0; diff --git a/src/gameobjects/events/VIDEO_CREATED_EVENT.js b/src/gameobjects/events/VIDEO_CREATED_EVENT.js index cf9890446..3b09272c6 100644 --- a/src/gameobjects/events/VIDEO_CREATED_EVENT.js +++ b/src/gameobjects/events/VIDEO_CREATED_EVENT.js @@ -17,7 +17,7 @@ * @since 3.20.0 * * @param {Phaser.GameObjects.Video} video - The Video Game Object which raised the event. - * @param {integer} width - The width of the video. - * @param {integer} height - The height of the video. + * @param {number} width - The width of the video. + * @param {number} height - The height of the video. */ module.exports = 'created'; diff --git a/src/gameobjects/graphics/Commands.js b/src/gameobjects/graphics/Commands.js index 494156f70..bd5c7c428 100644 --- a/src/gameobjects/graphics/Commands.js +++ b/src/gameobjects/graphics/Commands.js @@ -23,8 +23,6 @@ module.exports = { TRANSLATE: 16, SCALE: 17, ROTATE: 18, - SET_TEXTURE: 19, - CLEAR_TEXTURE: 20, GRADIENT_FILL_STYLE: 21, GRADIENT_LINE_STYLE: 22 diff --git a/src/gameobjects/graphics/Graphics.js b/src/gameobjects/graphics/Graphics.js index 59184b58d..e7f4e1d84 100644 --- a/src/gameobjects/graphics/Graphics.js +++ b/src/gameobjects/graphics/Graphics.js @@ -12,17 +12,15 @@ var ComponentsBlendMode = require('../components/BlendMode'); var ComponentsDepth = require('../components/Depth'); var ComponentsMask = require('../components/Mask'); var ComponentsPipeline = require('../components/Pipeline'); +var ComponentsScrollFactor = require('../components/ScrollFactor'); var ComponentsTransform = require('../components/Transform'); var ComponentsVisible = require('../components/Visible'); -var ComponentsScrollFactor = require('../components/ScrollFactor'); - -var TransformMatrix = require('../components/TransformMatrix'); - var Ellipse = require('../../geom/ellipse/Ellipse'); var GameObject = require('../GameObject'); var GetFastValue = require('../../utils/object/GetFastValue'); var GetValue = require('../../utils/object/GetValue'); var MATH_CONST = require('../../math/const'); +var PIPELINES_CONST = require('../../renderer/webgl/pipelines/const'); var Render = require('./GraphicsRender'); /** @@ -110,7 +108,7 @@ var Graphics = new Class({ GameObject.call(this, scene, 'Graphics'); this.setPosition(x, y); - this.initPipeline(); + this.initPipeline(PIPELINES_CONST.GRAPHICS_PIPELINE); /** * The horizontal display origin of the Graphics. @@ -202,36 +200,6 @@ var Graphics = new Class({ */ this._lineWidth = 1.0; - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.GameObjects.Graphics#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.17.0 - */ - this._tempMatrix3 = new TransformMatrix(); - this.setDefaultStyles(options); }, @@ -335,21 +303,28 @@ var Graphics = new Class({ * @webglOnly * @since 3.12.0 * - * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. - * @param {integer} topRight - The tint being applied to the top-right of the Game Object. - * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. - * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. - * @param {number} [alpha=1] - The fill alpha. + * @param {number} topLeft - The top left fill color. + * @param {number} topRight - The top right fill color. + * @param {number} bottomLeft - The bottom left fill color. + * @param {number} bottomRight - The bottom right fill color. Not used when filling triangles. + * @param {number} [alphaTopLeft=1] - The top left alpha value. If you give only this value, it's used for all corners. + * @param {number} [alphaTopRight=1] - The top right alpha value. + * @param {number} [alphaBottomLeft=1] - The bottom left alpha value. + * @param {number} [alphaBottomRight=1] - The bottom right alpha value. * * @return {this} This Game Object. */ - fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alpha) + fillGradientStyle: function (topLeft, topRight, bottomLeft, bottomRight, alphaTopLeft, alphaTopRight, alphaBottomLeft, alphaBottomRight) { - if (alpha === undefined) { alpha = 1; } + if (alphaTopLeft === undefined) { alphaTopLeft = 1; } + if (alphaTopRight === undefined) { alphaTopRight = alphaTopLeft; } + if (alphaBottomLeft === undefined) { alphaBottomLeft = alphaTopLeft; } + if (alphaBottomRight === undefined) { alphaBottomRight = alphaTopLeft; } this.commandBuffer.push( Commands.GRADIENT_FILL_STYLE, - alpha, topLeft, topRight, bottomLeft, bottomRight + alphaTopLeft, alphaTopRight, alphaBottomLeft, alphaBottomRight, + topLeft, topRight, bottomLeft, bottomRight ); return this; @@ -373,10 +348,10 @@ var Graphics = new Class({ * @since 3.12.0 * * @param {number} lineWidth - The stroke width. - * @param {integer} topLeft - The tint being applied to the top-left of the Game Object. - * @param {integer} topRight - The tint being applied to the top-right of the Game Object. - * @param {integer} bottomLeft - The tint being applied to the bottom-left of the Game Object. - * @param {integer} bottomRight - The tint being applied to the bottom-right of the Game Object. + * @param {number} topLeft - The tint being applied to the top-left of the Game Object. + * @param {number} topRight - The tint being applied to the top-right of the Game Object. + * @param {number} bottomLeft - The tint being applied to the bottom-left of the Game Object. + * @param {number} bottomRight - The tint being applied to the bottom-right of the Game Object. * @param {number} [alpha=1] - The fill alpha. * * @return {this} This Game Object. @@ -393,62 +368,6 @@ var Graphics = new Class({ return this; }, - /** - * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * Once set, all shapes will use this texture. Call this method with no arguments to clear it. - * - * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason, - * it works best with seamless / tileable textures. - * - * The mode argument controls how the textures are combined with the fill colors. The default value (0) will - * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture, - * and a value of 2 will use just the texture and no fill color at all. - * - * @method Phaser.GameObjects.Graphics#setTexture - * @since 3.12.0 - * @webglOnly - * - * @param {string} [key] - The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. - * @param {number} [mode=0] - The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only. - * - * @return {this} This Game Object. - */ - setTexture: function (key, frame, mode) - { - if (mode === undefined) { mode = 0; } - - if (key === undefined) - { - this.commandBuffer.push( - Commands.CLEAR_TEXTURE - ); - } - else - { - var textureFrame = this.scene.sys.textures.getFrame(key, frame); - - if (textureFrame) - { - if (mode === 2) - { - mode = 3; - } - - this.commandBuffer.push( - Commands.SET_TEXTURE, - textureFrame, - mode - ); - } - } - - return this; - }, - /** * Start a new shape path. * @@ -1047,7 +966,7 @@ var Graphics = new Class({ * @param {(array|Phaser.Geom.Point[])} points - The points to stroke. * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. - * @param {integer} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`. + * @param {number} [endIndex] - The index of `points` to stop drawing at. Defaults to `points.length`. * * @return {this} This Game Object. */ @@ -1094,7 +1013,7 @@ var Graphics = new Class({ * @param {(array|Phaser.Geom.Point[])} points - The points to fill. * @param {boolean} [closeShape=false] - When `true`, the shape is closed by joining the last point to the first point. * @param {boolean} [closePath=false] - When `true`, the path is closed before being stroked. - * @param {integer} [endIndex] - The index of `points` to stop at. Defaults to `points.length`. + * @param {number} [endIndex] - The index of `points` to stop at. Defaults to `points.length`. * * @return {this} This Game Object. */ @@ -1135,7 +1054,7 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to stroke. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -1158,7 +1077,7 @@ var Graphics = new Class({ * @param {number} y - The y coordinate of the center of the ellipse. * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -1180,7 +1099,7 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The ellipse to fill. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -1203,7 +1122,7 @@ var Graphics = new Class({ * @param {number} y - The y coordinate of the center of the ellipse. * @param {number} width - The width of the ellipse. * @param {number} height - The height of the ellipse. - * @param {integer} [smoothness=32] - The number of points to draw the ellipse with. + * @param {number} [smoothness=32] - The number of points to draw the ellipse with. * * @return {this} This Game Object. */ @@ -1460,8 +1379,8 @@ var Graphics = new Class({ * @since 3.0.0 * * @param {(string|HTMLCanvasElement)} key - The key to store the texture with in the Texture Manager, or a Canvas to draw to. - * @param {integer} [width] - The width of the graphics to generate. - * @param {integer} [height] - The height of the graphics to generate. + * @param {number} [width] - The width of the graphics to generate. + * @param {number} [height] - The height of the graphics to generate. * * @return {this} This Game Object. */ diff --git a/src/gameobjects/graphics/GraphicsCanvasRenderer.js b/src/gameobjects/graphics/GraphicsCanvasRenderer.js index a4cd6e0e6..e79f6b649 100644 --- a/src/gameobjects/graphics/GraphicsCanvasRenderer.js +++ b/src/gameobjects/graphics/GraphicsCanvasRenderer.js @@ -229,10 +229,6 @@ var GraphicsCanvasRenderer = function (renderer, src, camera, parentMatrix, rend case Commands.GRADIENT_LINE_STYLE: index += 6; break; - - case Commands.SET_TEXTURE: - index += 2; - break; } } diff --git a/src/gameobjects/graphics/GraphicsWebGLRenderer.js b/src/gameobjects/graphics/GraphicsWebGLRenderer.js index 0b2fa40a6..64eb1aaf4 100644 --- a/src/gameobjects/graphics/GraphicsWebGLRenderer.js +++ b/src/gameobjects/graphics/GraphicsWebGLRenderer.js @@ -5,9 +5,10 @@ */ var Commands = require('./Commands'); +var GetCalcMatrix = require('../GetCalcMatrix'); +var TransformMatrix = require('../components/TransformMatrix'); var Utils = require('../../renderer/webgl/Utils'); -// TODO: Remove the use of this var Point = function (x, y, width) { this.x = x; @@ -15,7 +16,6 @@ var Point = function (x, y, width) this.width = width; }; -// TODO: Remove the use of this var Path = function (x, y, width) { this.points = []; @@ -24,6 +24,7 @@ var Path = function (x, y, width) }; var matrixStack = []; +var tempMatrix = new TransformMatrix(); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -46,38 +47,13 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) return; } - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); - var camMatrix = src._tempMatrix1; - var graphicsMatrix = src._tempMatrix2; - var currentMatrix = src._tempMatrix3; + renderer.pipelines.preBatch(src); - currentMatrix.loadIdentity(); + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; - graphicsMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - graphicsMatrix.e = src.x; - graphicsMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(graphicsMatrix); - } - else - { - graphicsMatrix.e -= camera.scrollX * src.scrollFactorX; - graphicsMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(graphicsMatrix); - } + var currentMatrix = tempMatrix.loadIdentity(); var commands = src.commandBuffer; var alpha = camera.alpha * src.alpha; @@ -101,9 +77,6 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) var getTint = Utils.getTintAppendFloatAlpha; - // Set to a white texture, not a blank one, so Lights2D works too! - var currentTexture = renderer.whiteTexture; - for (var cmdIndex = 0; cmdIndex < commands.length; cmdIndex++) { cmd = commands[cmdIndex]; @@ -111,14 +84,15 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) switch (cmd) { case Commands.BEGIN_PATH: - + { path.length = 0; lastPath = null; pathOpen = true; break; + } case Commands.CLOSE_PATH: - + { pathOpen = false; if (lastPath && lastPath.points.length) @@ -126,36 +100,38 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) lastPath.points.push(lastPath.points[0]); } break; + } case Commands.FILL_PATH: + { for (pathIndex = 0; pathIndex < path.length; pathIndex++) { - pipeline.setTexture2D(currentTexture, src); - pipeline.batchFillPath( path[pathIndex].points, currentMatrix, - camMatrix + calcMatrix ); } break; + } case Commands.STROKE_PATH: + { for (pathIndex = 0; pathIndex < path.length; pathIndex++) { - pipeline.setTexture2D(currentTexture, src); - pipeline.batchStrokePath( path[pathIndex].points, lineWidth, pathOpen, currentMatrix, - camMatrix + calcMatrix ); } break; + } case Commands.LINE_STYLE: + { lineWidth = commands[++cmdIndex]; var strokeColor = commands[++cmdIndex]; var strokeAlpha = commands[++cmdIndex] * alpha; @@ -165,8 +141,10 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) strokeTint.BL = strokeTintColor; strokeTint.BR = strokeTintColor; break; + } case Commands.FILL_STYLE: + { var fillColor = commands[++cmdIndex]; var fillAlpha = commands[++cmdIndex] * alpha; var fillTintColor = getTint(fillColor, fillAlpha); @@ -175,16 +153,24 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) fillTint.BL = fillTintColor; fillTint.BR = fillTintColor; break; + } case Commands.GRADIENT_FILL_STYLE: - var gradientFillAlpha = commands[++cmdIndex] * alpha; - fillTint.TL = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.TR = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.BL = getTint(commands[++cmdIndex], gradientFillAlpha); - fillTint.BR = getTint(commands[++cmdIndex], gradientFillAlpha); + { + var alphaTL = commands[++cmdIndex] * alpha; + var alphaTR = commands[++cmdIndex] * alpha; + var alphaBL = commands[++cmdIndex] * alpha; + var alphaBR = commands[++cmdIndex] * alpha; + + fillTint.TL = getTint(commands[++cmdIndex], alphaTL); + fillTint.TR = getTint(commands[++cmdIndex], alphaTR); + fillTint.BL = getTint(commands[++cmdIndex], alphaBL); + fillTint.BR = getTint(commands[++cmdIndex], alphaBR); break; + } case Commands.GRADIENT_LINE_STYLE: + { lineWidth = commands[++cmdIndex]; var gradientLineAlpha = commands[++cmdIndex] * alpha; strokeTint.TL = getTint(commands[++cmdIndex], gradientLineAlpha); @@ -192,8 +178,10 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) strokeTint.BL = getTint(commands[++cmdIndex], gradientLineAlpha); strokeTint.BR = getTint(commands[++cmdIndex], gradientLineAlpha); break; + } case Commands.ARC: + { var iteration = 0; var x = commands[++cmdIndex]; var y = commands[++cmdIndex]; @@ -250,21 +238,23 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) lastPath.points.push(new Point(tx, ty, lineWidth)); break; + } case Commands.FILL_RECT: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchFillRect( commands[++cmdIndex], commands[++cmdIndex], commands[++cmdIndex], commands[++cmdIndex], currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.FILL_TRIANGLE: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchFillTriangle( commands[++cmdIndex], commands[++cmdIndex], @@ -273,12 +263,13 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) commands[++cmdIndex], commands[++cmdIndex], currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.STROKE_TRIANGLE: - pipeline.setTexture2D(currentTexture, src); + { pipeline.batchStrokeTriangle( commands[++cmdIndex], commands[++cmdIndex], @@ -288,11 +279,13 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) commands[++cmdIndex], lineWidth, currentMatrix, - camMatrix + calcMatrix ); break; + } case Commands.LINE_TO: + { if (lastPath !== null) { lastPath.points.push(new Point(commands[++cmdIndex], commands[++cmdIndex], lineWidth)); @@ -303,55 +296,52 @@ var GraphicsWebGLRenderer = function (renderer, src, camera, parentMatrix) path.push(lastPath); } break; + } case Commands.MOVE_TO: + { lastPath = new Path(commands[++cmdIndex], commands[++cmdIndex], lineWidth); path.push(lastPath); break; + } case Commands.SAVE: + { matrixStack.push(currentMatrix.copyToArray()); break; + } case Commands.RESTORE: + { currentMatrix.copyFromArray(matrixStack.pop()); break; + } case Commands.TRANSLATE: + { x = commands[++cmdIndex]; y = commands[++cmdIndex]; currentMatrix.translate(x, y); break; + } case Commands.SCALE: + { x = commands[++cmdIndex]; y = commands[++cmdIndex]; currentMatrix.scale(x, y); break; + } case Commands.ROTATE: + { currentMatrix.rotate(commands[++cmdIndex]); break; - - case Commands.SET_TEXTURE: - var frame = commands[++cmdIndex]; - var mode = commands[++cmdIndex]; - - pipeline.currentFrame = frame; - pipeline.setTexture2D(frame.glTexture, src); - pipeline.tintEffect = mode; - - currentTexture = frame.glTexture; - - break; - - case Commands.CLEAR_TEXTURE: - pipeline.currentFrame = renderer.blankTexture; - pipeline.tintEffect = 2; - currentTexture = renderer.tempTextures[0]; - break; + } } } + + renderer.pipelines.postBatch(src); }; module.exports = GraphicsWebGLRenderer; diff --git a/src/gameobjects/graphics/typedefs/Options.js b/src/gameobjects/graphics/typedefs/Options.js index 279d9b4b8..d93d250e7 100644 --- a/src/gameobjects/graphics/typedefs/Options.js +++ b/src/gameobjects/graphics/typedefs/Options.js @@ -1,5 +1,5 @@ /** - * Options for the Graphics game Object. + * Options for the Graphics Game Object. * * @typedef {object} Phaser.Types.GameObjects.Graphics.Options * @extends Phaser.Types.GameObjects.Graphics.Styles diff --git a/src/gameobjects/graphics/typedefs/RoundedRectRadius.js b/src/gameobjects/graphics/typedefs/RoundedRectRadius.js index fe1a63fe2..aaf9f9937 100644 --- a/src/gameobjects/graphics/typedefs/RoundedRectRadius.js +++ b/src/gameobjects/graphics/typedefs/RoundedRectRadius.js @@ -1,9 +1,9 @@ /** * @typedef {object} Phaser.Types.GameObjects.Graphics.RoundedRectRadius * @since 3.11.0 - * - * @property {number} [tl=20] - Top left - * @property {number} [tr=20] - Top right - * @property {number} [br=20] - Bottom right - * @property {number} [bl=20] - Bottom left + * + * @property {number} [tl=20] - Top left corner radius. + * @property {number} [tr=20] - Top right corner radius. + * @property {number} [br=20] - Bottom right corner radius. + * @property {number} [bl=20] - Bottom left corner radius. */ diff --git a/src/gameobjects/group/Group.js b/src/gameobjects/group/Group.js index 3360ecfcf..de09b8960 100644 --- a/src/gameobjects/group/Group.js +++ b/src/gameobjects/group/Group.js @@ -7,6 +7,7 @@ var Actions = require('../../actions/'); var Class = require('../../utils/Class'); var Events = require('../events'); +var EventEmitter = require('eventemitter3'); var GetAll = require('../../utils/array/GetAll'); var GetFastValue = require('../../utils/object/GetFastValue'); var GetValue = require('../../utils/object/GetValue'); @@ -25,6 +26,7 @@ var Sprite = require('../sprite/Sprite'); * * @class Group * @memberof Phaser.GameObjects + * @extends Phaser.Events.EventEmitter * @constructor * @since 3.0.0 * @param {Phaser.Scene} scene - The scene this group belongs to. @@ -36,10 +38,14 @@ var Sprite = require('../sprite/Sprite'); */ var Group = new Class({ + Extends: EventEmitter, + initialize: function Group (scene, children, config) { + EventEmitter.call(this); + // They can pass in any of the following as the first argument: // 1) A single child @@ -149,7 +155,7 @@ var Group = new Class({ * The maximum size of this group, if used as a pool. -1 is no limit. * * @name Phaser.GameObjects.Group#maxSize - * @type {integer} + * @type {number} * @since 3.0.0 * @default -1 */ @@ -171,7 +177,7 @@ var Group = new Class({ * A default texture frame to use when creating new group members. * * @name Phaser.GameObjects.Group#defaultFrame - * @type {(string|integer)} + * @type {(string|number)} * @since 3.0.0 */ this.defaultFrame = GetFastValue(config, 'defaultFrame', null); @@ -245,6 +251,21 @@ var Group = new Class({ { this.createMultiple(config); } + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); }, /** @@ -258,7 +279,7 @@ var Group = new Class({ * @param {number} [x=0] - The horizontal position of the new Game Object in the world. * @param {number} [y=0] - The vertical position of the new Game Object in the world. * @param {string} [key=defaultKey] - The texture key of the new Game Object. - * @param {(string|integer)} [frame=defaultFrame] - The texture frame of the new Game Object. + * @param {(string|number)} [frame=defaultFrame] - The texture frame of the new Game Object. * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object. * @param {boolean} [active=true] - The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object. * @@ -734,7 +755,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getLength * @since 3.0.0 * - * @return {integer} + * @return {number} */ getLength: function () { @@ -755,8 +776,8 @@ var Group = new Class({ * * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {any[]} An array of matching Group members. The array will be empty if nothing matched. */ @@ -780,7 +801,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -800,13 +821,13 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getFirstNth * @since 3.6.0 * - * @param {integer} nth - The nth matching Group member to search for. + * @param {number} nth - The nth matching Group member to search for. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -831,7 +852,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -851,13 +872,13 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getLastNth * @since 3.6.0 * - * @param {integer} nth - The nth matching Group member to search for. + * @param {number} nth - The nth matching Group member to search for. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -879,13 +900,13 @@ var Group = new Class({ * @since 3.6.0 * * @param {boolean} forwards - Search front to back or back to front? - * @param {integer} nth - Stop matching after nth successful matches. + * @param {number} nth - Stop matching after nth successful matches. * @param {boolean} [state=false] - The {@link Phaser.GameObjects.GameObject#active} value to match. * @param {boolean} [createIfNull=false] - Create a new Game Object if no matching members are found, using the following arguments. * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first matching group member, or a newly created member, or null. @@ -984,7 +1005,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {?any} The first inactive group member, or a newly created member, or null. @@ -1008,7 +1029,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {any} The first active group member, or a newly created member, or null. @@ -1033,7 +1054,7 @@ var Group = new Class({ * @param {number} [x] - The horizontal position of the Game Object in the world. * @param {number} [y] - The vertical position of the Game Object in the world. * @param {string} [key=defaultKey] - The texture key assigned to a new Game Object (if one is created). - * @param {(string|integer)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). + * @param {(string|number)} [frame=defaultFrame] - A texture frame assigned to a new Game Object (if one is created). * @param {boolean} [visible=true] - The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). * * @return {any} The first inactive group member, or a newly created member, or null. @@ -1089,7 +1110,7 @@ var Group = new Class({ * * @param {boolean} [value=true] - Count active (true) or inactive (false) group members. * - * @return {integer} The number of group members with an active state matching the `active` argument. + * @return {number} The number of group members with an active state matching the `active` argument. */ countActive: function (value) { @@ -1114,7 +1135,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getTotalUsed * @since 3.0.0 * - * @return {integer} The number of group members with an active state of true. + * @return {number} The number of group members with an active state of true. */ getTotalUsed: function () { @@ -1129,7 +1150,7 @@ var Group = new Class({ * @method Phaser.GameObjects.Group#getTotalFree * @since 3.0.0 * - * @return {integer} maxSize minus the number of active group numbers; or a large number (if maxSize is -1). + * @return {number} maxSize minus the number of active group numbers; or a large number (if maxSize is -1). */ getTotalFree: function () { @@ -1184,8 +1205,8 @@ var Group = new Class({ * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -1205,8 +1226,8 @@ var Group = new Class({ * @param {string} key - The property to be updated. * @param {number} value - The amount to set the property to. * @param {number} [step=0] - This is added to the `value` amount, multiplied by the iteration counter. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ @@ -1340,7 +1361,7 @@ var Group = new Class({ * * @param {number} x - The x coordinate to place the first item in the array at. * @param {number} y - The y coordinate to place the first item in the array at. - * @param {integer} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. + * @param {number} [direction=0] - The iteration direction. 0 = first to last and 1 = last to first. * * @return {this} This Group object. */ @@ -1646,8 +1667,8 @@ var Group = new Class({ * @since 3.21.0 * * @param {boolean} value - The value to set the property to. - * @param {integer} [index=0] - An optional offset to start searching from within the items array. - * @param {integer} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. + * @param {number} [index=0] - An optional offset to start searching from within the items array. + * @param {number} [direction=1] - The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. * * @return {this} This Group object. */ diff --git a/src/gameobjects/group/typedefs/GroupConfig.js b/src/gameobjects/group/typedefs/GroupConfig.js index 16fd1deec..9a5af2f76 100644 --- a/src/gameobjects/group/typedefs/GroupConfig.js +++ b/src/gameobjects/group/typedefs/GroupConfig.js @@ -7,7 +7,7 @@ * @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}. * @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}. * @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}. - * @property {?(string|integer)} [defaultFrame=null] - Sets {@link Phaser.GameObjects.Group#defaultFrame}. + * @property {?(string|number)} [defaultFrame=null] - Sets {@link Phaser.GameObjects.Group#defaultFrame}. * @property {?boolean} [runChildUpdate=false] - Sets {@link Phaser.GameObjects.Group#runChildUpdate}. * @property {?Phaser.Types.GameObjects.Group.GroupCallback} [createCallback=null] - Sets {@link Phaser.GameObjects.Group#createCallback}. * @property {?Phaser.Types.GameObjects.Group.GroupCallback} [removeCallback=null] - Sets {@link Phaser.GameObjects.Group#removeCallback}. diff --git a/src/gameobjects/group/typedefs/GroupCreateConfig.js b/src/gameobjects/group/typedefs/GroupCreateConfig.js index a2016bf60..6c746345b 100644 --- a/src/gameobjects/group/typedefs/GroupCreateConfig.js +++ b/src/gameobjects/group/typedefs/GroupCreateConfig.js @@ -12,16 +12,16 @@ * * @property {?Function} [classType] - The class of each new Game Object. * @property {(string|string[])} [key] - The texture key of each new Game Object. - * @property {?(string|string[]|integer|integer[])} [frame=null] - The texture frame of each new Game Object. - * @property {?integer} [quantity=false] - The number of Game Objects to create. If set, this overrides the `frameQuantity` value. Use `frameQuantity` for more advanced control. + * @property {?(string|string[]|number|number[])} [frame=null] - The texture frame of each new Game Object. + * @property {?number} [quantity=false] - The number of Game Objects to create. If set, this overrides the `frameQuantity` value. Use `frameQuantity` for more advanced control. * @property {?boolean} [visible=true] - The visible state of each new Game Object. * @property {?boolean} [active=true] - The active state of each new Game Object. - * @property {?integer} [repeat=0] - The number of times each `key` × `frame` combination will be *repeated* (after the first combination). + * @property {?number} [repeat=0] - The number of times each `key` × `frame` combination will be *repeated* (after the first combination). * @property {?boolean} [randomKey=false] - Select a `key` at random. * @property {?boolean} [randomFrame=false] - Select a `frame` at random. * @property {?boolean} [yoyo=false] - Select keys and frames by moving forward then backward through `key` and `frame`. - * @property {?integer} [frameQuantity=1] - The number of times each `frame` should be combined with one `key`. - * @property {?integer} [max=0] - The maximum number of new Game Objects to create. 0 is no maximum. + * @property {?number} [frameQuantity=1] - The number of times each `frame` should be combined with one `key`. + * @property {?number} [max=0] - The maximum number of new Game Objects to create. 0 is no maximum. * @property {?object} [setXY] * @property {?number} [setXY.x=0] - The horizontal position of each new Game Object. * @property {?number} [setXY.y=0] - The vertical position of each new Game Object. diff --git a/src/gameobjects/image/Image.js b/src/gameobjects/image/Image.js index d04977e42..5cd69dd6a 100644 --- a/src/gameobjects/image/Image.js +++ b/src/gameobjects/image/Image.js @@ -43,7 +43,7 @@ var ImageRender = require('./ImageRender'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Image = new Class({ diff --git a/src/gameobjects/image/ImageFactory.js b/src/gameobjects/image/ImageFactory.js index 28155edff..2be848392 100644 --- a/src/gameobjects/image/ImageFactory.js +++ b/src/gameobjects/image/ImageFactory.js @@ -18,7 +18,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Image} The Game Object that was created. */ diff --git a/src/gameobjects/index.js b/src/gameobjects/index.js index 76da81945..a4e66a1cb 100644 --- a/src/gameobjects/index.js +++ b/src/gameobjects/index.js @@ -18,6 +18,7 @@ var GameObjects = { UpdateList: require('./UpdateList'), Components: require('./components'), + GetCalcMatrix: require('./GetCalcMatrix'), BuildGameObject: require('./BuildGameObject'), BuildGameObjectAnimation: require('./BuildGameObjectAnimation'), @@ -32,6 +33,7 @@ var GameObjects = { Graphics: require('./graphics/Graphics.js'), Group: require('./group/Group'), Image: require('./image/Image'), + Layer: require('./layer/Layer'), Particles: require('./particles'), PathFollower: require('./pathfollower/PathFollower'), RenderTexture: require('./rendertexture/RenderTexture'), @@ -39,7 +41,7 @@ var GameObjects = { Rope: require('./rope/Rope'), Sprite: require('./sprite/Sprite'), - Text: require('./text/static/Text'), + Text: require('./text/Text'), GetTextSize: require('./text/GetTextSize'), MeasureText: require('./text/MeasureText'), TextStyle: require('./text/TextStyle'), @@ -74,13 +76,14 @@ var GameObjects = { Graphics: require('./graphics/GraphicsFactory'), Group: require('./group/GroupFactory'), Image: require('./image/ImageFactory'), + Layer: require('./layer/LayerFactory'), Particles: require('./particles/ParticleManagerFactory'), PathFollower: require('./pathfollower/PathFollowerFactory'), RenderTexture: require('./rendertexture/RenderTextureFactory'), Rope: require('./rope/RopeFactory'), Sprite: require('./sprite/SpriteFactory'), StaticBitmapText: require('./bitmaptext/static/BitmapTextFactory'), - Text: require('./text/static/TextFactory'), + Text: require('./text/TextFactory'), TileSprite: require('./tilesprite/TileSpriteFactory'), Zone: require('./zone/ZoneFactory'), Video: require('./video/VideoFactory'), @@ -106,12 +109,13 @@ var GameObjects = { Graphics: require('./graphics/GraphicsCreator'), Group: require('./group/GroupCreator'), Image: require('./image/ImageCreator'), + Layer: require('./layer/LayerCreator'), Particles: require('./particles/ParticleManagerCreator'), RenderTexture: require('./rendertexture/RenderTextureCreator'), Rope: require('./rope/RopeCreator'), Sprite: require('./sprite/SpriteCreator'), StaticBitmapText: require('./bitmaptext/static/BitmapTextCreator'), - Text: require('./text/static/TextCreator'), + Text: require('./text/TextCreator'), TileSprite: require('./tilesprite/TileSpriteCreator'), Zone: require('./zone/ZoneCreator'), Video: require('./video/VideoCreator') @@ -119,23 +123,20 @@ var GameObjects = { }; +// WebGL only Game Objects if (typeof WEBGL_RENDERER) { - // WebGL only Game Objects - GameObjects.Layer3D = require('./layer3d/Layer3D'); - GameObjects.Layer3DCamera = require('./layer3d/Layer3DCamera'); - GameObjects.Layer3DLight = require('./layer3d/Layer3DLight'); - - GameObjects.Quad = require('./quad/Quad'); GameObjects.Shader = require('./shader/Shader'); + GameObjects.Mesh = require('./mesh/Mesh'); + GameObjects.PointLight = require('./pointlight/PointLight'); - GameObjects.Factories.Layer3D = require('./layer3d/Layer3DFactory'); - GameObjects.Factories.Quad = require('./quad/QuadFactory'); GameObjects.Factories.Shader = require('./shader/ShaderFactory'); + GameObjects.Factories.Mesh = require('./mesh/MeshFactory'); + GameObjects.Factories.PointLight = require('./pointlight/PointLightFactory'); - GameObjects.Creators.Layer3D = require('./layer3d/Layer3DCreator'); - GameObjects.Creators.Quad = require('./quad/QuadCreator'); GameObjects.Creators.Shader = require('./shader/ShaderCreator'); + GameObjects.Creators.Mesh = require('./mesh/MeshCreator'); + GameObjects.Creators.PointLight = require('./pointlight/PointLightCreator'); GameObjects.Light = require('./lights/Light'); GameObjects.LightsManager = require('./lights/LightsManager'); diff --git a/src/gameobjects/layer/Layer.js b/src/gameobjects/layer/Layer.js new file mode 100644 index 000000000..d8b5f816d --- /dev/null +++ b/src/gameobjects/layer/Layer.js @@ -0,0 +1,745 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BlendModes = require('../../renderer/BlendModes'); +var Class = require('../../utils/Class'); +var Components = require('../components'); +var ComponentsToJSON = require('../components/ToJSON'); +var DataManager = require('../../data/DataManager'); +var EventEmitter = require('eventemitter3'); +var GameObjectEvents = require('../events'); +var List = require('../../structs/List'); +var Render = require('./LayerRender'); +var SceneEvents = require('../../scene/events'); +var StableSort = require('../../utils/array/StableSort'); + +/** + * @classdesc + * A Layer Game Object. + * + * A Layer is a special type of Game Object that acts as a Display List. You can add any type of Game Object + * to a Layer, just as you would to a Scene. Layers can be used to visually group together 'layers' of Game + * Objects: + * + * ```javascript + * const spaceman = this.add.sprite(150, 300, 'spaceman'); + * const bunny = this.add.sprite(400, 300, 'bunny'); + * const elephant = this.add.sprite(650, 300, 'elephant'); + * + * const layer = this.add.layer(); + * + * layer.add([ spaceman, bunny, elephant ]); + * ``` + * + * The 3 sprites in the example above will now be managed by the Layer they were added to. Therefore, + * if you then set `layer.setVisible(false)` they would all vanish from the display. + * + * You can also control the depth of the Game Objects within the Layer. For example, calling the + * `setDepth` method of a child of a Layer will allow you to adjust the depth of that child _within the + * Layer itself_, rather than the whole Scene. The Layer, too, can have its depth set as well. + * + * The Layer class also offers many different methods for manipulating the list, such as the + * methods `moveUp`, `moveDown`, `sendToBack`, `bringToTop` and so on. These allow you to change the + * display list position of the Layers children, causing it to adjust the order in which they are + * rendered. Using `setDepth` on a child allows you to override this. + * + * Layers can have Post FX Pipelines set, which allows you to easily enable a post pipeline across + * a whole range of children, which, depending on the effect, can often be far more efficient that doing so + * on a per-child basis. + * + * Layers have no position or size within the Scene. This means you cannot enable a Layer for + * physics or input, or change the position, rotation or scale of a Layer. They also have no scroll + * factor, texture, tint, origin, crop or bounds. + * + * If you need those kind of features then you should use a Container instead. Containers can be added + * to Layers, but Layers cannot be added to Containers. + * + * However, you can set the Alpha, Blend Mode, Depth, Mask and Visible state of a Layer. These settings + * will impact all children being rendered by the Layer. + * + * @class Layer + * @extends Phaser.Structs.List. + * @memberof Phaser.GameObjects + * @constructor + * @since 3.50.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Layer. + */ +var Layer = new Class({ + + Extends: List, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.Visible, + EventEmitter, + Render + ], + + initialize: + + function Layer (scene, children) + { + List.call(this, scene); + EventEmitter.call(this); + + /** + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. + * + * @name Phaser.GameObjects.Layer#scene + * @type {Phaser.Scene} + * @since 3.50.0 + */ + this.scene = scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + * + * @name Phaser.GameObjects.Layer#displayList + * @type {(Phaser.GameObjects.DisplayList|Phaser.GameObjects.Layer)} + * @default null + * @since 3.50.0 + */ + this.displayList = null; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + * + * @name Phaser.GameObjects.Layer#type + * @type {string} + * @since 3.50.0 + */ + this.type = 'Layer'; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @name Phaser.GameObjects.Layer#state + * @type {(number|string)} + * @since 3.50.0 + */ + this.state = 0; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.Layer#name + * @type {string} + * @default '' + * @since 3.50.0 + */ + this.name = ''; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + * + * @name Phaser.GameObjects.Layer#active + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.active = true; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + * + * @name Phaser.GameObjects.Layer#data + * @type {Phaser.Data.DataManager} + * @default null + * @since 3.50.0 + */ + this.data = null; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.Layer#renderFlags + * @type {number} + * @default 15 + * @since 3.50.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.Layer#cameraFilter + * @type {number} + * @default 0 + * @since 3.50.0 + */ + this.cameraFilter = 0; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + * + * @name Phaser.GameObjects.Layer#ignoreDestroy + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.ignoreDestroy = false; + + /** + * A reference to the Scene Systems. + * + * @name Phaser.GameObjects.Layer#systems + * @type {Phaser.Scenes.Systems} + * @since 3.50.0 + */ + this.systems = scene.sys; + + /** + * A reference to the Scene Event Emitter. + * + * @name Phaser.GameObjects.Layer#events + * @type {Phaser.Events.EventEmitter} + * @since 3.50.0 + */ + this.events = scene.sys.events; + + /** + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + * + * @name Phaser.GameObjects.Layer#sortChildrenFlag + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.sortChildrenFlag = false; + + // Set the List callbacks + this.addCallback = this.addChildCallback; + this.removeCallback = this.removeChildCallback; + + this.initPipeline(); + + this.clearAlpha(); + + this.setBlendMode(BlendModes.SKIP_CHECK); + + if (children) + { + this.add(children); + } + + // Tell the Scene to re-sort the children + scene.sys.queueDepthSort(); + }, + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * + * @method Phaser.GameObjects.Layer#setActive + * @since 3.50.0 + * + * @param {boolean} value - True if this Game Object should be set as active, false if not. + * + * @return {this} This GameObject. + */ + setActive: function (value) + { + this.active = value; + + return this; + }, + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * + * @method Phaser.GameObjects.Layer#setName + * @since 3.50.0 + * + * @param {string} value - The name to be given to this Game Object. + * + * @return {this} This GameObject. + */ + setName: function (value) + { + this.name = value; + + return this; + }, + + /** + * Sets the current state of this Game Object. + * + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * + * @method Phaser.GameObjects.Layer#setState + * @since 3.50.0 + * + * @param {(number|string)} value - The state of the Game Object. + * + * @return {this} This GameObject. + */ + setState: function (value) + { + this.state = value; + + return this; + }, + + /** + * Adds a Data Manager component to this Game Object. + * + * @method Phaser.GameObjects.Layer#setDataEnabled + * @since 3.50.0 + * @see Phaser.Data.DataManager + * + * @return {this} This GameObject. + */ + setDataEnabled: function () + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this; + }, + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * + * @method Phaser.GameObjects.Layer#setData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param {*} [data] - The value to set for the given key. If an object is provided as the key this argument is ignored. + * + * @return {this} This GameObject. + */ + setData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.set(key, value); + + return this; + }, + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.Layer#incData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to increase the value for. + * @param {*} [data] - The value to increase for the given key. + * + * @return {this} This GameObject. + */ + incData: function (key, value) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.inc(key, value); + + return this; + }, + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * @method Phaser.GameObjects.Layer#toggleData + * @since 3.50.0 + * + * @param {(string|object)} key - The key to toggle the value for. + * + * @return {this} This GameObject. + */ + toggleData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + this.data.toggle(key); + + return this; + }, + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * + * @method Phaser.GameObjects.Layer#getData + * @since 3.50.0 + * + * @param {(string|string[])} key - The key of the value to retrieve, or an array of keys. + * + * @return {*} The value belonging to the given key, or an array of values, the order of which will match the input array. + */ + getData: function (key) + { + if (!this.data) + { + this.data = new DataManager(this); + } + + return this.data.get(key); + }, + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.Layer#addedToScene + * @since 3.50.0 + */ + addedToScene: function () + { + }, + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + * + * @method Phaser.GameObjects.Layer#removedFromScene + * @since 3.50.0 + */ + removedFromScene: function () + { + }, + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * + * @method Phaser.GameObjects.Layer#update + * @since 3.50.0 + * + * @param {...*} [args] - args + */ + update: function () + { + }, + + /** + * Returns a JSON representation of the Game Object. + * + * @method Phaser.GameObjects.Layer#toJSON + * @since 3.50.0 + * + * @return {Phaser.Types.GameObjects.JSONGameObject} A JSON representation of the Game Object. + */ + toJSON: function () + { + return ComponentsToJSON(this); + }, + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * + * @method Phaser.GameObjects.Layer#willRender + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. + * + * @return {boolean} True if the Game Object should be rendered, otherwise false. + */ + willRender: function (camera) + { + return !(this.renderFlags !== 15 || this.list.length === 0 || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); + }, + + /** + * Internal method called from `List.addCallback`. + * + * @method Phaser.GameObjects.Layer#addChildCallback + * @private + * @fires Phaser.Scenes.Events#ADDED_TO_SCENE + * @fires Phaser.GameObjects.Events#ADDED_TO_SCENE + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was added to the list. + */ + addChildCallback: function (gameObject) + { + gameObject.emit(GameObjectEvents.ADDED_TO_SCENE, gameObject, this.scene); + + if (gameObject.displayList) + { + gameObject.displayList.remove(gameObject); + } + + gameObject.displayList = this; + + this.queueDepthSort(); + + this.events.emit(SceneEvents.ADDED_TO_SCENE, gameObject, this.scene); + }, + + /** + * Internal method called from `List.removeCallback`. + * + * @method Phaser.GameObjects.Layer#removeChildCallback + * @private + * @fires Phaser.Scenes.Events#REMOVED_FROM_SCENE + * @fires Phaser.GameObjects.Events#REMOVED_FROM_SCENE + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was removed from the list. + */ + removeChildCallback: function (gameObject) + { + gameObject.emit(GameObjectEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + + gameObject.displayList = null; + + this.queueDepthSort(); + + this.events.emit(SceneEvents.REMOVED_FROM_SCENE, gameObject, this.scene); + }, + + /** + * Force a sort of the display list on the next call to depthSort. + * + * @method Phaser.GameObjects.Layer#queueDepthSort + * @since 3.50.0 + */ + queueDepthSort: function () + { + this.sortChildrenFlag = true; + }, + + /** + * Immediately sorts the display list if the flag is set. + * + * @method Phaser.GameObjects.Layer#depthSort + * @since 3.50.0 + */ + depthSort: function () + { + if (this.sortChildrenFlag) + { + StableSort(this.list, this.sortByDepth); + + this.sortChildrenFlag = false; + } + }, + + /** + * Compare the depth of two Game Objects. + * + * @method Phaser.GameObjects.Layer#sortByDepth + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} childA - The first Game Object. + * @param {Phaser.GameObjects.GameObject} childB - The second Game Object. + * + * @return {number} The difference between the depths of each Game Object. + */ + sortByDepth: function (childA, childB) + { + return childA._depth - childB._depth; + }, + + /** + * Returns an array which contains all Game Objects within this Layer. + * + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + * + * @method Phaser.GameObjects.Layer#getChildren + * @since 3.50.0 + * + * @return {Phaser.GameObjects.GameObject[]} The group members. + */ + getChildren: function () + { + return this.list; + }, + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. + * + * @method Phaser.GameObjects.Layer#destroy + * @fires Phaser.GameObjects.Events#DESTROY + * @since 3.50.0 + */ + destroy: function () + { + // This Game Object has already been destroyed + if (!this.scene || this.ignoreDestroy) + { + return; + } + + this.removeAll(); + this.removeAllListeners(); + this.resetPostPipeline(true); + + this.emit(GameObjectEvents.DESTROY, this); + + if (this.displayList) + { + this.displayList.queueDepthSort(); + this.displayList.remove(this); + } + + if (this.data) + { + this.data.destroy(); + + this.data = undefined; + } + + this.active = false; + this.visible = false; + + this.scene = undefined; + this.displayList = undefined; + this.systems = undefined; + this.events = undefined; + } + +}); + +module.exports = Layer; diff --git a/src/gameobjects/layer/LayerCanvasRenderer.js b/src/gameobjects/layer/LayerCanvasRenderer.js new file mode 100644 index 000000000..2be6a1403 --- /dev/null +++ b/src/gameobjects/layer/LayerCanvasRenderer.js @@ -0,0 +1,80 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the Canvas Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Layer#renderCanvas + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var LayerCanvasRenderer = function (renderer, layer, camera) +{ + var children = layer.list; + + if (children.length === 0) + { + return; + } + + layer.depthSort(); + + var layerHasBlendMode = (layer.blendMode !== -1); + + if (!layerHasBlendMode) + { + // If Layer is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = layer._alpha; + + if (layer.mask) + { + layer.mask.preRenderCanvas(renderer, null, camera); + } + + for (var i = 0; i < children.length; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlpha = child.alpha; + + if (!layerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Layer doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + // Set parent values + child.setAlpha(childAlpha * alpha); + + // Render + child.renderCanvas(renderer, child, camera); + + // Restore original values + child.setAlpha(childAlpha); + } + + if (layer.mask) + { + layer.mask.postRenderCanvas(renderer); + } +}; + +module.exports = LayerCanvasRenderer; diff --git a/src/gameobjects/quad/QuadCreator.js b/src/gameobjects/layer/LayerCreator.js similarity index 52% rename from src/gameobjects/quad/QuadCreator.js rename to src/gameobjects/layer/LayerCreator.js index 462d90f07..f21af7680 100644 --- a/src/gameobjects/quad/QuadCreator.js +++ b/src/gameobjects/layer/LayerCreator.js @@ -5,40 +5,37 @@ */ var BuildGameObject = require('../BuildGameObject'); +var Layer = require('./Layer'); var GameObjectCreator = require('../GameObjectCreator'); var GetAdvancedValue = require('../../utils/object/GetAdvancedValue'); -var Quad = require('./Quad'); /** - * Creates a new Quad Game Object and returns it. + * Creates a new Layer Game Object and returns it. * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * Note: This method will only be available if the Layer Game Object has been built into Phaser. * - * @method Phaser.GameObjects.GameObjectCreator#quad - * @since 3.0.0 + * @method Phaser.GameObjects.GameObjectCreator#layer + * @since 3.50.0 * * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} config - The configuration object this Game Object will use to create itself. * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. * - * @return {Phaser.GameObjects.Quad} The Game Object that was created. + * @return {Phaser.GameObjects.Layer} The Game Object that was created. */ -GameObjectCreator.register('quad', function (config, addToScene) +GameObjectCreator.register('layer', function (config, addToScene) { if (config === undefined) { config = {}; } - var x = GetAdvancedValue(config, 'x', 0); - var y = GetAdvancedValue(config, 'y', 0); - var key = GetAdvancedValue(config, 'key', null); - var frame = GetAdvancedValue(config, 'frame', null); + var children = GetAdvancedValue(config, 'children', null); - var quad = new Quad(this.scene, x, y, key, frame); + var layer = new Layer(this.scene, children); if (addToScene !== undefined) { config.add = addToScene; } - BuildGameObject(this.scene, quad, config); + BuildGameObject(this.scene, layer, config); - return quad; + return layer; }); diff --git a/src/gameobjects/layer/LayerFactory.js b/src/gameobjects/layer/LayerFactory.js new file mode 100644 index 000000000..83f121114 --- /dev/null +++ b/src/gameobjects/layer/LayerFactory.js @@ -0,0 +1,25 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Layer = require('./Layer'); +var GameObjectFactory = require('../GameObjectFactory'); + +/** + * Creates a new Layer Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#layer + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} [children] - An optional array of Game Objects to add to this Layer. + * + * @return {Phaser.GameObjects.Layer} The Game Object that was created. + */ +GameObjectFactory.register('layer', function (children) +{ + return this.displayList.add(new Layer(this.scene, children)); +}); diff --git a/src/tilemaps/staticlayer/StaticTilemapLayerRender.js b/src/gameobjects/layer/LayerRender.js similarity index 76% rename from src/tilemaps/staticlayer/StaticTilemapLayerRender.js rename to src/gameobjects/layer/LayerRender.js index 765475025..ab9a89bfa 100644 --- a/src/tilemaps/staticlayer/StaticTilemapLayerRender.js +++ b/src/gameobjects/layer/LayerRender.js @@ -9,12 +9,12 @@ var renderCanvas = require('../../utils/NOOP'); if (typeof WEBGL_RENDERER) { - renderWebGL = require('./StaticTilemapLayerWebGLRenderer'); + renderWebGL = require('./LayerWebGLRenderer'); } if (typeof CANVAS_RENDERER) { - renderCanvas = require('./StaticTilemapLayerCanvasRenderer'); + renderCanvas = require('./LayerCanvasRenderer'); } module.exports = { diff --git a/src/gameobjects/layer/LayerWebGLRenderer.js b/src/gameobjects/layer/LayerWebGLRenderer.js new file mode 100644 index 000000000..06359cfd7 --- /dev/null +++ b/src/gameobjects/layer/LayerWebGLRenderer.js @@ -0,0 +1,117 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Layer#renderWebGL + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Layer} layer - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var LayerWebGLRenderer = function (renderer, layer, camera) +{ + var children = layer.list; + var childCount = children.length; + + if (childCount === 0) + { + return; + } + + layer.depthSort(); + + renderer.pipelines.preBatch(layer); + + var layerHasBlendMode = (layer.blendMode !== -1); + + if (!layerHasBlendMode) + { + // If Layer is SKIP_TEST then set blend mode to be Normal + renderer.setBlendMode(0); + } + + var alpha = layer.alpha; + + for (var i = 0; i < childCount; i++) + { + var child = children[i]; + + if (!child.willRender(camera)) + { + continue; + } + + var childAlphaTopLeft; + var childAlphaTopRight; + var childAlphaBottomLeft; + var childAlphaBottomRight; + + if (child.alphaTopLeft !== undefined) + { + childAlphaTopLeft = child.alphaTopLeft; + childAlphaTopRight = child.alphaTopRight; + childAlphaBottomLeft = child.alphaBottomLeft; + childAlphaBottomRight = child.alphaBottomRight; + } + else + { + var childAlpha = child.alpha; + + childAlphaTopLeft = childAlpha; + childAlphaTopRight = childAlpha; + childAlphaBottomLeft = childAlpha; + childAlphaBottomRight = childAlpha; + } + + if (!layerHasBlendMode && child.blendMode !== renderer.currentBlendMode) + { + // If Layer doesn't have its own blend mode, then a child can have one + renderer.setBlendMode(child.blendMode); + } + + var mask = child.mask; + + if (mask) + { + mask.preRenderWebGL(renderer, child, camera); + } + + var type = child.type; + + if (type !== renderer.currentType) + { + renderer.newType = true; + renderer.currentType = type; + } + + renderer.nextTypeMatch = (i < childCount - 1) ? (children[i + 1].type === renderer.currentType) : false; + + child.setAlpha(childAlphaTopLeft * alpha, childAlphaTopRight * alpha, childAlphaBottomLeft * alpha, childAlphaBottomRight * alpha); + + // Render + child.renderWebGL(renderer, child, camera); + + // Restore original values + child.setAlpha(childAlphaTopLeft, childAlphaTopRight, childAlphaBottomLeft, childAlphaBottomRight); + + if (mask) + { + mask.postRenderWebGL(renderer, camera); + } + + renderer.newType = false; + } + + renderer.pipelines.postBatch(layer); +}; + +module.exports = LayerWebGLRenderer; diff --git a/src/gameobjects/lights/Light.js b/src/gameobjects/lights/Light.js index 6683334a3..e19ec2b2f 100644 --- a/src/gameobjects/lights/Light.js +++ b/src/gameobjects/lights/Light.js @@ -4,7 +4,10 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Circle = require('../../geom/circle/Circle'); var Class = require('../../utils/Class'); +var Components = require('../components'); +var RGB = require('../../display/RGB'); var Utils = require('../../renderer/webgl/Utils'); /** @@ -18,10 +21,14 @@ var Utils = require('../../renderer/webgl/Utils'); * They can also simply be used to represent a point light for your own purposes. * * @class Light + * @extends Phaser.Geom.Circle * @memberof Phaser.GameObjects * @constructor * @since 3.0.0 * + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Visible + * * @param {number} x - The horizontal position of the light. * @param {number} y - The vertical position of the light. * @param {number} radius - The radius of the light. @@ -32,172 +39,81 @@ var Utils = require('../../renderer/webgl/Utils'); */ var Light = new Class({ + Extends: Circle, + + Mixins: [ + Components.ScrollFactor, + Components.Visible + ], + initialize: function Light (x, y, radius, r, g, b, intensity) { - /** - * The horizontal position of the light. - * - * @name Phaser.GameObjects.Light#_x - * @type {number} - * @private - * @since 3.0.0 - */ - this._x = x; + Circle.call(this, x, y, radius); /** - * The vertical position of the light. + * The color of the light. * - * @name Phaser.GameObjects.Light#_y - * @type {number} - * @private - * @since 3.0.0 + * @name Phaser.GameObjects.Light#color + * @type {Phaser.Display.RGB} + * @since 3.50.0 */ - this._y = y; - - /** - * The radius of the light. - * - * @name Phaser.GameObjects.Light#_radius - * @type {number} - * @private - * @since 3.0.0 - */ - this._radius = radius; - - /** - * The red color of the light. A value between 0 and 1. - * - * @name Phaser.GameObjects.Light#_r - * @type {number} - * @private - * @since 3.0.0 - */ - this._r = r; - - /** - * The green color of the light. A value between 0 and 1. - * - * @name Phaser.GameObjects.Light#_g - * @type {number} - * @private - * @since 3.0.0 - */ - this._g = g; - - /** - * The blue color of the light. A value between 0 and 1. - * - * @name Phaser.GameObjects.Light#_b - * @type {number} - * @private - * @since 3.0.0 - */ - this._b = b; + this.color = new RGB(r, g, b); /** * The intensity of the light. * - * @name Phaser.GameObjects.Light#_intensity + * @name Phaser.GameObjects.Light#intensity * @type {number} - * @private - * @since 3.0.0 - */ - this._intensity = intensity; - - /** - * The horizontal scroll factor of the light. - * - * @name Phaser.GameObjects.Light#_scrollFactorX - * @type {number} - * @private - * @since 3.0.0 - */ - this._scrollFactorX = 1; - - /** - * The vertical scroll factor of the light. - * - * @name Phaser.GameObjects.Light#_scrollFactorY - * @type {number} - * @private - * @since 3.0.0 - */ - this._scrollFactorY = 1; - - /** - * The dirty state of the light. A dirty light will reset all of its shader attributes. - * - * @name Phaser.GameObjects.Light#dirty - * @type {boolean} * @since 3.50.0 */ - this.dirty = true; + this.intensity = intensity; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + * + * @name Phaser.GameObjects.GameObject#renderFlags + * @type {number} + * @default 15 + * @since 3.0.0 + */ + this.renderFlags = 15; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + * + * @example + * this.cameraFilter |= camera.id + * + * @name Phaser.GameObjects.GameObject#cameraFilter + * @type {number} + * @default 0 + * @since 3.0.0 + */ + this.cameraFilter = 0; + + this.setScrollFactor(1, 1); }, /** - * Set the properties of the light. + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. * - * Sets both horizontal and vertical scroll factor to 1. Use {@link Phaser.GameObjects.Light#setScrollFactor} to set - * the scroll factor. + * @method Phaser.GameObjects.Light#willRender + * @since 3.50.0 * - * @method Phaser.GameObjects.Light#set - * @since 3.0.0 + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against this Game Object. * - * @param {number} x - The horizontal position of the light. - * @param {number} y - The vertical position of the light. - * @param {number} radius - The radius of the light. - * @param {number} r - The red color. A value between 0 and 1. - * @param {number} g - The green color. A value between 0 and 1. - * @param {number} b - The blue color. A value between 0 and 1. - * @param {number} intensity - The intensity of the light. - * - * @return {this} This Light object. + * @return {boolean} True if the Game Object should be rendered, otherwise false. */ - set: function (x, y, radius, r, g, b, intensity) + willRender: function (camera) { - this._x = x; - this._y = y; - - this._radius = radius; - - this._r = r; - this._g = g; - this._b = b; - - this._intensity = intensity; - - this._scrollFactorX = 1; - this._scrollFactorY = 1; - - this.dirty = true; - - return this; - }, - - /** - * Set the scroll factor of the light. - * - * @method Phaser.GameObjects.Light#setScrollFactor - * @since 3.0.0 - * - * @param {number} [x=1] - The horizontal scroll factor of the light. - * @param {number} [y=x] - The vertical scroll factor of the light. - * - * @return {this} This Light object. - */ - setScrollFactor: function (x, y) - { - if (x === undefined) { x = 1; } - if (y === undefined) { y = x; } - - this._scrollFactorX = x; - this._scrollFactorY = y; - - this.dirty = true; - - return this; + return !(Light.RENDER_MASK !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))); }, /** @@ -214,11 +130,7 @@ var Light = new Class({ { var color = Utils.getFloatsFromUintRGB(rgb); - this._r = color[0]; - this._g = color[1]; - this._b = color[2]; - - this.dirty = true; + this.color.set(color[0], color[1], color[2]); return this; }, @@ -235,30 +147,7 @@ var Light = new Class({ */ setIntensity: function (intensity) { - this._intensity = intensity; - - this.dirty = true; - - return this; - }, - - /** - * Set the position of the light. - * - * @method Phaser.GameObjects.Light#setPosition - * @since 3.0.0 - * - * @param {number} x - The horizontal position of the light. - * @param {number} y - The vertical position of the light. - * - * @return {this} This Light object. - */ - setPosition: function (x, y) - { - this._x = x; - this._y = y; - - this.dirty = true; + this.intensity = intensity; return this; }, @@ -275,211 +164,20 @@ var Light = new Class({ */ setRadius: function (radius) { - this._radius = radius; - - this.dirty = true; + this.radius = radius; return this; - }, - - /** - * The horizontal position of the light. - * - * @name Phaser.GameObjects.Light#x - * @type {number} - * @since 3.0.0 - */ - x: { - - get: function () - { - return this._x; - }, - - set: function (value) - { - this._x = value; - this.dirty = true; - } - - }, - - /** - * The vertical position of the light. - * - * @name Phaser.GameObjects.Light#y - * @type {number} - * @since 3.0.0 - */ - y: { - - get: function () - { - return this._y; - }, - - set: function (value) - { - this._y = value; - this.dirty = true; - } - - }, - - /** - * The radius of the light. - * - * @name Phaser.GameObjects.Light#radius - * @type {number} - * @since 3.0.0 - */ - radius: { - - get: function () - { - return this._radius; - }, - - set: function (value) - { - this._radius = value; - this.dirty = true; - } - - }, - - /** - * The red color of the light. A value between 0 and 1. - * - * @name Phaser.GameObjects.Light#r - * @type {number} - * @since 3.0.0 - */ - r: { - - get: function () - { - return this._r; - }, - - set: function (value) - { - this._r = value; - this.dirty = true; - } - - }, - - /** - * The green color of the light. A value between 0 and 1. - * - * @name Phaser.GameObjects.Light#g - * @type {number} - * @since 3.0.0 - */ - g: { - - get: function () - { - return this._g; - }, - - set: function (value) - { - this._g = value; - this.dirty = true; - } - - }, - - /** - * The blue color of the light. A value between 0 and 1. - * - * @name Phaser.GameObjects.Light#b - * @type {number} - * @since 3.0.0 - */ - b: { - - get: function () - { - return this._b; - }, - - set: function (value) - { - this._b = value; - this.dirty = true; - } - - }, - - /** - * The intensity of the light. - * - * @name Phaser.GameObjects.Light#intensity - * @type {number} - * @since 3.0.0 - */ - intensity: { - - get: function () - { - return this._intensity; - }, - - set: function (value) - { - this._intensity = value; - this.dirty = true; - } - - }, - - /** - * The horizontal scroll factor of the light. - * - * @name Phaser.GameObjects.Light#scrollFactorX - * @type {number} - * @since 3.0.0 - */ - scrollFactorX: { - - get: function () - { - return this._scrollFactorX; - }, - - set: function (value) - { - this._scrollFactorX = value; - this.dirty = true; - } - - }, - - /** - * The vertical scroll factor of the light. - * - * @name Phaser.GameObjects.Light#scrollFactorY - * @type {number} - * @since 3.0.0 - */ - scrollFactorY: { - - get: function () - { - return this._scrollFactorY; - }, - - set: function (value) - { - this._scrollFactorY = value; - this.dirty = true; - } - } }); +/** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + * + * @constant {number} RENDER_MASK + * @memberof Phaser.GameObjects.Light + * @default + */ +Light.RENDER_MASK = 15; + module.exports = Light; diff --git a/src/gameobjects/lights/LightsManager.js b/src/gameobjects/lights/LightsManager.js index e209829d1..82ac3c6af 100644 --- a/src/gameobjects/lights/LightsManager.js +++ b/src/gameobjects/lights/LightsManager.js @@ -4,8 +4,14 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CircleToRectangle = require('../../geom/intersects/CircleToRectangle'); var Class = require('../../utils/Class'); +var DistanceBetween = require('../../math/distance/DistanceBetween'); var Light = require('./Light'); +var PointLight = require('../pointlight/PointLight'); +var RGB = require('../../display/RGB'); +var SpliceOne = require('../../utils/array/SpliceOne'); +var StableSort = require('../../utils/array/StableSort'); var Utils = require('../../renderer/webgl/Utils'); /** @@ -31,18 +37,6 @@ var LightsManager = new Class({ function LightsManager () { - /** - * The pool of Lights. - * - * Used to recycle removed Lights for a more efficient use of memory. - * - * @name Phaser.GameObjects.LightsManager#lightPool - * @type {Phaser.GameObjects.Light[]} - * @default [] - * @since 3.0.0 - */ - this.lightPool = []; - /** * The Lights in the Scene. * @@ -53,26 +47,14 @@ var LightsManager = new Class({ */ this.lights = []; - /** - * Lights that have been culled from a Camera's viewport. - * - * Lights in this list will not be rendered. - * - * @name Phaser.GameObjects.LightsManager#culledLights - * @type {Phaser.GameObjects.Light[]} - * @default [] - * @since 3.0.0 - */ - this.culledLights = []; - /** * The ambient color. * * @name Phaser.GameObjects.LightsManager#ambientColor - * @type {{ r: number, g: number, b: number }} - * @since 3.0.0 + * @type {Phaser.Display.RGB} + * @since 3.50.0 */ - this.ambientColor = { r: 0.1, g: 0.1, b: 0.1 }; + this.ambientColor = new RGB(0.1, 0.1, 0.1); /** * Whether the Lights Manager is enabled. @@ -89,11 +71,26 @@ var LightsManager = new Class({ * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. * * @name Phaser.GameObjects.LightsManager#maxLights - * @type {integer} + * @type {number} * @readonly * @since 3.15.0 */ this.maxLights = -1; + + /** + * The number of lights that the LightPipeline processed in the _previous_ frame. + * + * @name Phaser.GameObjects.LightsManager#visibleLights + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.visibleLights = 0; + }, + + addPointLight: function (x, y, color, radius, intensity) + { + return this.systems.displayList.add(new PointLight(this.scene, x, y, color, radius, intensity)); }, /** @@ -108,7 +105,7 @@ var LightsManager = new Class({ { if (this.maxLights === -1) { - this.maxLights = this.scene.sys.game.renderer.config.maxLights; + this.maxLights = this.scene.sys.renderer.config.maxLights; } this.active = true; @@ -132,77 +129,59 @@ var LightsManager = new Class({ }, /** - * Cull any Lights that aren't visible to the given Camera. + * Get all lights that can be seen by the given Camera. * - * Culling Lights improves performance by ensuring that only Lights within a Camera's viewport are rendered. + * It will automatically cull lights that are outside the world view of the Camera. * - * @method Phaser.GameObjects.LightsManager#cull - * @since 3.0.0 + * If more lights are returned than supported by the pipeline, the lights are then culled + * based on the distance from the center of the camera. Only those closest are rendered. + * + * @method Phaser.GameObjects.LightsManager#getLights + * @since 3.50.0 * * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to cull Lights for. * * @return {Phaser.GameObjects.Light[]} The culled Lights. */ - cull: function (camera) + getLights: function (camera) { var lights = this.lights; - var culledLights = this.culledLights; - var length = lights.length; - var cameraCenterX = camera.x + camera.width / 2.0; - var cameraCenterY = camera.y + camera.height / 2.0; - var cameraRadius = (camera.width + camera.height) / 2.0; - var point = { x: 0, y: 0 }; - var cameraMatrix = camera.matrix; - var viewportHeight = this.systems.game.renderer.height; + var worldView = camera.worldView; - culledLights.length = 0; + var visibleLights = []; - for (var i = 0; i < length && culledLights.length < this.maxLights; i++) + for (var i = 0; i < lights.length; i++) { var light = lights[i]; - cameraMatrix.transformPoint(light.x, light.y, point); - - // We'll just use bounding spheres to test if lights should be rendered - var dx = cameraCenterX - (point.x - (camera.scrollX * light.scrollFactorX * camera.zoom)); - var dy = cameraCenterY - (viewportHeight - (point.y - (camera.scrollY * light.scrollFactorY) * camera.zoom)); - var distance = Math.sqrt(dx * dx + dy * dy); - - if (distance < light.radius + cameraRadius) + if (light.willRender(camera) && CircleToRectangle(light, worldView)) { - culledLights.push(lights[i]); + visibleLights.push({ + light: light, + distance: DistanceBetween(light.x, light.y, worldView.centerX, worldView.centerY) + }); } } - return culledLights; + if (visibleLights.length > this.maxLights) + { + // We've got too many lights, so sort by distance from camera and cull those far away + // This isn't ideal because it doesn't factor in the radius of the lights, but it'll do for now + // and is significantly better than we had before! + + StableSort(visibleLights, this.sortByDistance); + + visibleLights = visibleLights.slice(0, this.maxLights); + } + + this.visibleLights = visibleLights.length; + + return visibleLights; }, - /** - * Iterate over each Light with a callback. - * - * @method Phaser.GameObjects.LightsManager#forEachLight - * @since 3.0.0 - * - * @param {LightForEach} callback - The callback that is called with each Light. - * - * @return {Phaser.GameObjects.LightsManager} This Lights Manager object. - */ - forEachLight: function (callback) + sortByDistance: function (a, b) { - if (!callback) - { - return; - } - - var lights = this.lights; - var length = lights.length; - - for (var i = 0; i < length; i++) - { - callback(lights[i]); - } - - return this; + return (a.distance >= b.distance); }, /** @@ -219,9 +198,7 @@ var LightsManager = new Class({ { var color = Utils.getFloatsFromUintRGB(rgb); - this.ambientColor.r = color[0]; - this.ambientColor.g = color[1]; - this.ambientColor.b = color[2]; + this.ambientColor.set(color[0], color[1], color[2]); return this; }, @@ -232,11 +209,11 @@ var LightsManager = new Class({ * @method Phaser.GameObjects.LightsManager#getMaxVisibleLights * @since 3.0.0 * - * @return {integer} The maximum number of Lights allowed to appear at once. + * @return {number} The maximum number of Lights allowed to appear at once. */ getMaxVisibleLights: function () { - return 10; + return this.maxLights; }, /** @@ -245,7 +222,7 @@ var LightsManager = new Class({ * @method Phaser.GameObjects.LightsManager#getLightCount * @since 3.0.0 * - * @return {integer} The number of Lights managed by this Lights Manager. + * @return {number} The number of Lights managed by this Lights Manager. */ getLightCount: function () { @@ -270,29 +247,13 @@ var LightsManager = new Class({ { if (x === undefined) { x = 0; } if (y === undefined) { y = 0; } - if (radius === undefined) { radius = 100; } + if (radius === undefined) { radius = 128; } if (rgb === undefined) { rgb = 0xffffff; } if (intensity === undefined) { intensity = 1; } - var color = null; - var light = null; + var color = Utils.getFloatsFromUintRGB(rgb); - color = Utils.getFloatsFromUintRGB(rgb); - - light = null; - - var pool = this.lightPool; - - if (pool.length > 0) - { - light = pool.pop(); - - light.set(x, y, radius, color[0], color[1], color[2], intensity); - } - else - { - light = new Light(x, y, radius, color[0], color[1], color[2], intensity); - } + var light = new Light(x, y, radius, color[0], color[1], color[2], intensity); this.lights.push(light); @@ -315,8 +276,7 @@ var LightsManager = new Class({ if (index >= 0) { - this.lightPool.push(light); - this.lights.splice(index, 1); + SpliceOne(this.lights, index); } return this; @@ -333,13 +293,6 @@ var LightsManager = new Class({ */ shutdown: function () { - while (this.lights.length > 0) - { - this.lightPool.push(this.lights.pop()); - } - - this.ambientColor = { r: 0.1, g: 0.1, b: 0.1 }; - this.culledLights.length = 0; this.lights.length = 0; }, @@ -354,8 +307,6 @@ var LightsManager = new Class({ destroy: function () { this.shutdown(); - - this.lightPool.length = 0; } }); diff --git a/src/gameobjects/lights/LightsPlugin.js b/src/gameobjects/lights/LightsPlugin.js index 3ef48403e..66e1039db 100644 --- a/src/gameobjects/lights/LightsPlugin.js +++ b/src/gameobjects/lights/LightsPlugin.js @@ -31,6 +31,8 @@ var SceneEvents = require('../../scene/events'); * sprite.setPipeline('Light2D'); * ``` * + * Note that you cannot use this pipeline on Graphics Game Objects or Shape Game Objects. + * * @class LightsPlugin * @extends Phaser.GameObjects.LightsManager * @memberof Phaser.GameObjects diff --git a/src/gameobjects/mesh/Mesh.js b/src/gameobjects/mesh/Mesh.js new file mode 100644 index 000000000..39e126383 --- /dev/null +++ b/src/gameobjects/mesh/Mesh.js @@ -0,0 +1,1050 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../utils/Class'); +var Components = require('../components'); +var DegToRad = require('../../math/DegToRad'); +var Face = require('../../geom/mesh/Face'); +var GameObject = require('../GameObject'); +var GameObjectEvents = require('../events'); +var GenerateVerts = require('../../geom/mesh/GenerateVerts'); +var GenerateObjVerts = require('../../geom/mesh/GenerateObjVerts'); +var GetCalcMatrix = require('../GetCalcMatrix'); +var Matrix4 = require('../../math/Matrix4'); +var MeshRender = require('./MeshRender'); +var StableSort = require('../../utils/array/StableSort'); +var Vector3 = require('../../math/Vector3'); +var Vertex = require('../../geom/mesh/Vertex'); + +/** + * @classdesc + * A Mesh Game Object. + * + * The Mesh Game Object allows you to render a group of textured vertices and manipulate + * the view of those vertices, such as rotation, translation or scaling. + * + * Support for generating mesh data from grids, model data or Wavefront OBJ Files is included. + * + * Although you can use this to render 3D objects, its primary use is for displaying more complex + * Sprites, or Sprites where you need fine-grained control over the vertice positions in order to + * achieve special effects in your games. Note that rendering still takes place using Phasers + * orthographic camera. As a result, all depth and face tests are done in orthographic space. + * + * The rendering process will iterate through the faces of this Mesh and render out each face + * that is considered as being in view of the camera. No depth buffer is used, and because of this, + * you should be careful not to use model data with too many vertices, or overlapping geometry, + * or you'll probably encounter z-depth fighting. The Mesh was designed to allow for more advanced + * 2D layouts, rather than displaying 3D objects, even though it can do this to a degree. + * + * In short, if you want to remake Crysis, use a 3D engine, not a Mesh. However, if you want + * to easily add some small fun 3D elements into your game, or create some special effects involving + * vertex warping, this is the right object for you. Mesh data becomes part of the WebGL batch, + * just like standard Sprites, so doesn't introduce any additional shader overhead. Because + * the Mesh just generates vertices into the WebGL batch, like any other Sprite, you can use all of + * the common Game Object components on a Mesh too, such as a custom pipeline, mask, blend mode + * or texture. + * + * Note that the Mesh object is WebGL only and does not have a Canvas counterpart. + * + * The Mesh origin is always 0.5 x 0.5 and cannot be changed. + * + * @class Mesh + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @webglOnly + * @since 3.0.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.Size + * @extends Phaser.GameObjects.Components.Texture + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * @extends Phaser.GameObjects.Components.ScrollFactor + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} [x] - The horizontal position of this Game Object in the world. + * @param {number} [y] - The vertical position of this Game Object in the world. + * @param {string|Phaser.Textures.Texture} [texture] - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {string|number} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {number[]} [vertices] - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} [uvs] - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + */ +var Mesh = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.Mask, + Components.Pipeline, + Components.Size, + Components.Texture, + Components.Transform, + Components.Visible, + Components.ScrollFactor, + MeshRender + ], + + initialize: + + function Mesh (scene, x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (texture === undefined) { texture = '__WHITE'; } + + GameObject.call(this, scene, 'Mesh'); + + /** + * An array containing the Face instances belonging to this Mesh. + * + * A Face consists of 3 Vertex objects. + * + * This array is populated during calls such as `addVertices` or `addOBJ`. + * + * @name Phaser.GameObjects.Mesh#faces + * @type {Phaser.Geom.Mesh.Face[]} + * @since 3.50.0 + */ + this.faces = []; + + /** + * An array containing Vertex instances. One instance per vertex in this Mesh. + * + * This array is populated during calls such as `addVertex` or `addOBJ`. + * + * @name Phaser.GameObjects.Mesh#vertices + * @type {Phaser.Geom.Mesh.Vertex[]} + * @since 3.50.0 + */ + this.vertices = []; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertex colors replace the texture, but respects texture alpha. + * + * @name Phaser.GameObjects.Mesh#tintFill + * @type {boolean} + * @default false + * @since 3.50.0 + */ + this.tintFill = false; + + /** + * You can optionally choose to render the vertices of this Mesh to a Graphics instance. + * + * Achieve this by setting the `debugCallback` and the `debugGraphic` properties. + * + * You can do this in a single call via the `Mesh.setDebug` method, which will use the + * built-in debug function. You can also set it to your own callback. The callback + * will be invoked _once per render_ and sent the following parameters: + * + * `debugCallback(src, meshLength, verts)` + * + * `src` is the Mesh instance being debugged. + * `meshLength` is the number of mesh vertices in total. + * `verts` is an array of the translated vertex coordinates. + * + * To disable rendering, set this property back to `null`. + * + * Please note that high vertex count Meshes will struggle to debug properly. + * + * @name Phaser.GameObjects.Mesh#debugCallback + * @type {function} + * @since 3.50.0 + */ + this.debugCallback = null; + + /** + * The Graphics instance that the debug vertices will be drawn to, if `setDebug` has + * been called. + * + * @name Phaser.GameObjects.Mesh#debugGraphic + * @type {Phaser.GameObjects.Graphics} + * @since 3.50.0 + */ + this.debugGraphic = null; + + /** + * When rendering, skip any Face that isn't counter clockwise? + * + * Enable this to hide backward-facing Faces during rendering. + * + * Disable it to render all Faces. + * + * @name Phaser.GameObjects.Mesh#hideCCW + * @type {boolean} + * @since 3.50.0 + */ + this.hideCCW = true; + + /** + * A Vector3 containing the 3D position of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to reposition where + * the vertices are rendered within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * You can also adjust the 'view' by using the `pan` methods. + * + * @name Phaser.GameObjects.Mesh#modelPosition + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelPosition = new Vector3(); + + /** + * A Vector3 containing the 3D scale of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to scale + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * @name Phaser.GameObjects.Mesh#modelScale + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelScale = new Vector3(1, 1, 1); + + /** + * A Vector3 containing the 3D rotation of the vertices in this Mesh. + * + * The values should be given in radians, i.e. to rotate the vertices by 90 + * degrees you can use `modelRotation.x = Phaser.Math.DegToRad(90)`. + * + * Modifying the components of this property will allow you to rotate + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * @name Phaser.GameObjects.Mesh#modelRotation + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.modelRotation = new Vector3(); + + /** + * An internal cache, used to compare position, rotation, scale and face data + * each frame, to avoid math calculations in `preUpdate`. + * + * Cache structure = position xyz | rotation xyz | scale xyz | face count | view | ortho + * + * @name Phaser.GameObjects.Mesh#dirtyCache + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.dirtyCache = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; + + /** + * The transformation matrix for this Mesh. + * + * @name Phaser.GameObjects.Mesh#transformMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.transformMatrix = new Matrix4(); + + /** + * The view position for this Mesh. + * + * Use the methods`panX`, `panY` and `panZ` to adjust the view. + * + * @name Phaser.GameObjects.Mesh#viewPosition + * @type {Phaser.Math.Vector3} + * @since 3.50.0 + */ + this.viewPosition = new Vector3(); + + /** + * The view matrix for this Mesh. + * + * @name Phaser.GameObjects.Mesh#viewMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.viewMatrix = new Matrix4(); + + /** + * The projection matrix for this Mesh. + * + * Update it with the `setPerspective` or `setOrtho` methods. + * + * @name Phaser.GameObjects.Mesh#projectionMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.projectionMatrix = new Matrix4(); + + /** + * How many faces were rendered by this Mesh Game Object in the last + * draw? This is reset in the `preUpdate` method and then incremented + * each time a face is drawn. Note that in multi-camera Scenes this + * value may exceed that found in `Mesh.getFaceCount` due to + * cameras drawing the same faces more than once. + * + * @name Phaser.GameObjects.Mesh#totalRendered + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.totalRendered = 0; + + /** + * Internal cache var for the total number of faces rendered this frame. + * + * See `totalRendered` instead for the actual value. + * + * @name Phaser.GameObjects.Mesh#totalFrame + * @type {number} + * @private + * @since 3.50.0 + */ + this.totalFrame = 0; + + /** + * By default, the Mesh will check to see if its model or view transform has + * changed each frame and only recalculate the vertex positions if they have. + * + * This avoids lots of additional math in the `preUpdate` step when not required. + * + * However, if you are performing per-Face or per-Vertex manipulation on this Mesh, + * such as tweening a Face, or moving it without moving the rest of the Mesh, + * then you may need to disable the dirty cache in order for the Mesh to re-render + * correctly. You can toggle this property to do that. Please note that leaving + * this set to `true` will cause the Mesh to recalculate the position of every single + * vertex in it, every single frame. So only really do this if you know you + * need it. + * + * @name Phaser.GameObjects.Mesh#ignoreDirtyCache + * @type {boolean} + * @since 3.50.0 + */ + this.ignoreDirtyCache = false; + + var renderer = scene.sys.renderer; + + this.setPosition(x, y); + this.setTexture(texture, frame); + this.setSize(renderer.width, renderer.height); + this.initPipeline(); + + this.setPerspective(renderer.width, renderer.height, 45, 0.01, 1000); + + if (vertices) + { + this.addVertices(vertices, uvs, indicies, containsZ, normals, colors, alphas); + } + + this.on(GameObjectEvents.ADDED_TO_SCENE, this.addedToScene, this); + this.on(GameObjectEvents.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); + }, + + /** + * Translates the view position of this Mesh on the x axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panX + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panX: function (v) + { + this.viewPosition.addScale(Vector3.LEFT, v); + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Translates the view position of this Mesh on the y axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panY + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panY: function (v) + { + this.viewPosition.y += Vector3.DOWN.y * v; + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Translates the view position of this Mesh on the z axis by the given amount. + * + * @method Phaser.GameObjects.Mesh#panZ + * @since 3.50.0 + * + * @param {number} v - The amount to pan by. + */ + panZ: function (amount) + { + this.viewPosition.z += amount; + + this.dirtyCache[10] = 1; + + return this; + }, + + /** + * Builds a new perspective projection matrix from the given values. + * + * See also `setOrtho`. + * + * @method Phaser.GameObjects.Mesh#setPerspective + * @since 3.50.0 + * + * @param {number} width - The width of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param {number} height - The height of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param {number} [fov=45] - The field of view, in degrees. + * @param {number} [near=0.01] - The near value of the view. + * @param {number} [far=1000] - The far value of the view. + */ + setPerspective: function (width, height, fov, near, far) + { + if (fov === undefined) { fov = 45; } + if (near === undefined) { near = 0.01; } + if (far === undefined) { far = 1000; } + + this.projectionMatrix.perspective(DegToRad(fov), width / height, near, far); + + this.dirtyCache[10] = 1; + this.dirtyCache[11] = 0; + + return this; + }, + + /** + * Builds a new orthographic projection matrix from the given values. + * + * If using this mode you will often need to set `Mesh.hideCCW` to `false` as well. + * + * See also `setPerspective`. + * + * @method Phaser.GameObjects.Mesh#setOrtho + * @since 3.50.0 + * + * @param {number} [scaleX=1] - The default horizontal scale in relation to the Mesh / Renderer dimensions. + * @param {number} [scaleY=1] - The default vertical scale in relation to the Mesh / Renderer dimensions. + * @param {number} [near=-1000] - The near value of the view. + * @param {number} [far=1000] - The far value of the view. + */ + setOrtho: function (scaleX, scaleY, near, far) + { + if (scaleX === undefined) { scaleX = 1; } + if (scaleY === undefined) { scaleY = 1; } + if (near === undefined) { near = -1000; } + if (far === undefined) { far = 1000; } + + this.projectionMatrix.ortho(-scaleX, scaleX, -scaleY, scaleY, near, far); + + this.dirtyCache[10] = 1; + this.dirtyCache[11] = 1; + + return this; + }, + + /** + * Iterates and destroys all current Faces in this Mesh, then resets the + * `faces` and `vertices` arrays. + * + * @method Phaser.GameObjects.Mesh#clear + * @since 3.50.0 + * + * @return {this} This Mesh Game Object. + */ + clear: function () + { + this.faces.forEach(function (face) + { + face.destroy(); + }); + + this.faces = []; + this.vertices = []; + + return this; + }, + + /** + * This method will add the data from a triangulated Wavefront OBJ model file to this Mesh. + * + * The data should have been loaded via the OBJFile: + * + * ```javascript + * this.load.obj(key, url); + * ``` + * + * Then use the same `key` as the first parameter to this method. + * + * Multiple Mesh Game Objects can use the same model data without impacting on each other. + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small, or too large, to see. + * You can also offset the vertices of the model via the `x`, `y` and `z` parameters. + * + * @method Phaser.GameObjects.Mesh#addVerticesFromObj + * @since 3.50.0 + * + * @param {string} key - The key of the model data in the OBJ Cache to add to this Mesh. + * @param {number} [scale=1] - An amount to scale the model data by. Use this if the model has exported too small, or large, to see. + * @param {number} [x=0] - Translate the model x position by this amount. + * @param {number} [y=0] - Translate the model y position by this amount. + * @param {number} [z=0] - Translate the model z position by this amount. + * @param {number} [rotateX=0] - Rotate the model on the x axis by this amount, in radians. + * @param {number} [rotateY=0] - Rotate the model on the y axis by this amount, in radians. + * @param {number} [rotateZ=0] - Rotate the model on the z axis by this amount, in radians. + * @param {boolean} [zIsUp=true] - Is the z axis up (true), or is y axis up (false)? + * + * @return {this} This Mesh Game Object. + */ + addVerticesFromObj: function (key, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) + { + var data = this.scene.sys.cache.obj.get(key); + + if (data) + { + GenerateObjVerts(data, this, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp); + } + + return this; + }, + + /** + * Compare the depth of two Faces. + * + * @method Phaser.GameObjects.Mesh#sortByDepth + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Face} faceA - The first Face. + * @param {Phaser.Geom.Mesh.Face} faceB - The second Face. + * + * @return {number} The difference between the depths of each Face. + */ + sortByDepth: function (faceA, faceB) + { + return faceA.depth - faceB.depth; + }, + + /** + * Runs a depth sort across all Faces in this Mesh, comparing their averaged depth. + * + * This is called automatically if you use any of the `rotate` methods, but you can + * also invoke it to sort the Faces should you manually position them. + * + * @method Phaser.GameObjects.Mesh#depthSort + * @since 3.50.0 + * + * @return {this} This Mesh Game Object. + */ + depthSort: function () + { + StableSort(this.faces, this.sortByDepth); + + return this; + }, + + /** + * Adds a new Vertex into the vertices array of this Mesh. + * + * Just adding a vertex isn't enough to render it. You need to also + * make it part of a Face, with 3 Vertex instances per Face. + * + * @method Phaser.GameObjects.Mesh#addVertex + * @since 3.50.0 + * + * @param {number} x - The x position of the vertex. + * @param {number} y - The y position of the vertex. + * @param {number} z - The z position of the vertex. + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * @param {number} [color=0xffffff] - The color value of the vertex. + * @param {number} [alpha=1] - The alpha value of the vertex. + * + * @return {this} This Mesh Game Object. + */ + addVertex: function (x, y, z, u, v, color, alpha) + { + var vert = new Vertex(x, y, z, u, v, color, alpha); + + this.vertices.push(vert); + + return vert; + }, + + /** + * Adds a new Face into the faces array of this Mesh. + * + * A Face consists of references to 3 Vertex instances, which must be provided. + * + * @method Phaser.GameObjects.Mesh#addFace + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Vertex} vertex1 - The first vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex2 - The second vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex3 - The third vertex of the Face. + * + * @return {this} This Mesh Game Object. + */ + addFace: function (vertex1, vertex2, vertex3) + { + var face = new Face(vertex1, vertex2, vertex3); + + this.faces.push(face); + + this.dirtyCache[9] = -1; + + return face; + }, + + /** + * Adds new vertices to this Mesh by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * mesh.addVertices(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * + * @method Phaser.GameObjects.Mesh#addVertices + * @since 3.50.0 + * + * @param {number[]} vertices - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} uvs - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * + * @return {this} This Mesh Game Object. + */ + addVertices: function (vertices, uvs, indicies, containsZ, normals, colors, alphas) + { + var result = GenerateVerts(vertices, uvs, indicies, containsZ, normals, colors, alphas); + + if (result) + { + this.faces = this.faces.concat(result.faces); + this.vertices = this.vertices.concat(result.vertices); + } + + this.dirtyCache[9] = -1; + + return this; + }, + + /** + * Returns the total number of Faces in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getFaceCount + * @since 3.50.0 + * + * @return {number} The number of Faces in this Mesh Game Object. + */ + getFaceCount: function () + { + return this.faces.length; + }, + + /** + * Returns the total number of Vertices in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getVertexCount + * @since 3.50.0 + * + * @return {number} The number of Vertices in this Mesh Game Object. + */ + getVertexCount: function () + { + return this.vertices.length; + }, + + /** + * Returns the Face at the given index in this Mesh Game Object. + * + * @method Phaser.GameObjects.Mesh#getFace + * @since 3.50.0 + * + * @param {number} index - The index of the Face to get. + * + * @return {Phaser.Geom.Mesh.Face} The Face at the given index, or `undefined` if index out of range. + */ + getFace: function (index) + { + return this.faces[index]; + }, + + /** + * Return an array of Face objects from this Mesh that intersect with the given coordinates. + * + * The given position is translated through the matrix of this Mesh and the given Camera, + * before being compared against the vertices. + * + * If more than one Face intersects, they will all be returned in the array, but the array will + * be depth sorted first, so the first element will always be that closest to the camera. + * + * @method Phaser.GameObjects.Mesh#getFaceAt + * @since 3.50.0 + * + * @param {number} x - The x position to check against. + * @param {number} y - The y position to check against. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The camera to pass the coordinates through. If not give, the default Scene Camera is used. + * + * @return {Phaser.Geom.Mesh.Face[]} An array of Face objects that intersect with the given point, ordered by depth. + */ + getFaceAt: function (x, y, camera) + { + if (camera === undefined) { camera = this.scene.sys.cameras.main; } + + var calcMatrix = GetCalcMatrix(this, camera).calc; + + var faces = this.faces; + var results = []; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + if (face.contains(x, y, calcMatrix)) + { + results.push(face); + } + } + + return StableSort(results, this.sortByDepth); + }, + + /** + * This method enables rendering of the Mesh vertices to the given Graphics instance. + * + * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, + * otherwise the Graphics instance you provide to debug will fill-up with draw calls, + * eventually crashing the browser. This is not done automatically to allow you to debug + * draw multiple Mesh objects to a single Graphics instance. + * + * The Mesh class has a built-in debug rendering callback `Mesh.renderDebug`, however + * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. + * + * The callback is invoked _once per render_ and sent the following parameters: + * + * `callback(src, faces)` + * + * `src` is the Mesh instance being debugged. + * `faces` is an array of the Faces that were rendered. + * + * You can get the final drawn vertex position from a Face object like this: + * + * ```javascript + * let face = faces[i]; + * + * let x0 = face.vertex1.tx; + * let y0 = face.vertex1.ty; + * let x1 = face.vertex2.tx; + * let y1 = face.vertex2.ty; + * let x2 = face.vertex3.tx; + * let y2 = face.vertex3.ty; + * + * graphic.strokeTriangle(x0, y0, x1, y1, x2, y2); + * ``` + * + * If using your own callback you do not have to provide a Graphics instance to this method. + * + * To disable debug rendering, to either your own callback or the built-in one, call this method + * with no arguments. + * + * @method Phaser.GameObjects.Mesh#setDebug + * @since 3.50.0 + * + * @param {Phaser.GameObjects.Graphics} [graphic] - The Graphic instance to render to if using the built-in callback. + * @param {function} [callback] - The callback to invoke during debug render. Leave as undefined to use the built-in callback. + * + * @return {this} This Game Object instance. + */ + setDebug: function (graphic, callback) + { + this.debugGraphic = graphic; + + if (!graphic && !callback) + { + this.debugCallback = null; + } + else if (!callback) + { + this.debugCallback = this.renderDebug; + } + else + { + this.debugCallback = callback; + } + + return this; + }, + + /** + * Checks if the transformation data in this mesh is dirty. + * + * This is used internally by the `preUpdate` step to determine if the vertices should + * be recalculated or not. + * + * @method Phaser.GameObjects.Mesh#isDirty + * @since 3.50.0 + * + * @return {boolean} Returns `true` if the data of this mesh is dirty, otherwise `false`. + */ + isDirty: function () + { + var position = this.modelPosition; + var rotation = this.modelRotation; + var scale = this.modelScale; + var dirtyCache = this.dirtyCache; + + var px = position.x; + var py = position.y; + var pz = position.z; + + var rx = rotation.x; + var ry = rotation.y; + var rz = rotation.z; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + var faces = this.getFaceCount(); + + var pxCached = dirtyCache[0]; + var pyCached = dirtyCache[1]; + var pzCached = dirtyCache[2]; + + var rxCached = dirtyCache[3]; + var ryCached = dirtyCache[4]; + var rzCached = dirtyCache[5]; + + var sxCached = dirtyCache[6]; + var syCached = dirtyCache[7]; + var szCached = dirtyCache[8]; + + var fCached = dirtyCache[9]; + + dirtyCache[0] = px; + dirtyCache[1] = py; + dirtyCache[2] = pz; + + dirtyCache[3] = rx; + dirtyCache[4] = ry; + dirtyCache[5] = rz; + + dirtyCache[6] = sx; + dirtyCache[7] = sy; + dirtyCache[8] = sz; + + dirtyCache[9] = faces; + + return ( + pxCached !== px || pyCached !== py || pzCached !== pz || + rxCached !== rx || ryCached !== ry || rzCached !== rz || + sxCached !== sx || syCached !== sy || szCached !== sz || + fCached !== faces + ); + }, + + /** + * The Mesh update loop. The following takes place in this method: + * + * First, the `totalRendered` and `totalFrame` properties are set. + * + * If the view matrix of this Mesh isn't dirty, and the model position, rotate or scale properties are + * all clean, then the method returns at this point. + * + * Otherwise, if the viewPosition is dirty (i.e. from calling a method like `panZ`), then it will + * refresh the viewMatrix. + * + * After this, a new transformMatrix is built and it then iterates through all Faces in this + * Mesh, calling `transformCoordinatesLocal` on all of them. Internally, this updates every + * vertex, calculating its new transformed position, based on the new transform matrix. + * + * Finally, the faces are depth sorted. + * + * @method Phaser.GameObjects.Mesh#preUpdate + * @protected + * @since 3.50.0 + * + * @param {number} time - The current timestamp. + * @param {number} delta - The delta time, in ms, elapsed since the last frame. + */ + preUpdate: function () + { + this.totalRendered = this.totalFrame; + this.totalFrame = 0; + + var dirty = this.dirtyCache; + + if (!this.ignoreDirtyCache && !dirty[10] && !this.isDirty()) + { + // If neither the view or the mesh is dirty we can bail out and save lots of math + return; + } + + var width = this.width; + var height = this.height; + + var viewMatrix = this.viewMatrix; + var viewPosition = this.viewPosition; + + if (dirty[10]) + { + viewMatrix.identity(); + viewMatrix.translate(viewPosition); + viewMatrix.invert(); + + dirty[10] = 0; + } + + var transformMatrix = this.transformMatrix; + + transformMatrix.setWorldMatrix( + this.modelRotation, + this.modelPosition, + this.modelScale, + this.viewMatrix, + this.projectionMatrix + ); + + var z = viewPosition.z; + + var faces = this.faces; + + for (var i = 0; i < faces.length; i++) + { + faces[i].transformCoordinatesLocal(transformMatrix, width, height, z); + } + + this.depthSort(); + }, + + /** + * The built-in Mesh debug rendering method. + * + * See `Mesh.setDebug` for more details. + * + * @method Phaser.GameObjects.Mesh#renderDebug + * @since 3.50.0 + * + * @param {Phaser.GameObjects.Mesh} src - The Mesh object being rendered. + * @param {Phaser.Geom.Mesh.Face[]} faces - An array of Faces. + */ + renderDebug: function (src, faces) + { + var graphic = src.debugGraphic; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + var x0 = face.vertex1.tx; + var y0 = face.vertex1.ty; + var x1 = face.vertex2.tx; + var y1 = face.vertex2.ty; + var x2 = face.vertex3.tx; + var y2 = face.vertex3.ty; + + graphic.strokeTriangle(x0, y0, x1, y1, x2, y2); + } + }, + + /** + * Handles the pre-destroy step for the Mesh, which removes the Animation component and typed arrays. + * + * @method Phaser.GameObjects.Mesh#preDestroy + * @private + * @since 3.50.0 + */ + preDestroy: function () + { + this.clear(); + + this.debugCallback = null; + this.debugGraphic = null; + } + +}); + +module.exports = Mesh; diff --git a/src/gameobjects/mesh/MeshCanvasRenderer.js b/src/gameobjects/mesh/MeshCanvasRenderer.js new file mode 100644 index 000000000..e97b7eb03 --- /dev/null +++ b/src/gameobjects/mesh/MeshCanvasRenderer.js @@ -0,0 +1,22 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * This is a stub function for Mesh.Render. There is no Canvas renderer for Mesh objects. + * + * @method Phaser.GameObjects.Mesh#renderCanvas + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var MeshCanvasRenderer = function () +{ +}; + +module.exports = MeshCanvasRenderer; diff --git a/src/gameobjects/mesh/MeshCreator.js b/src/gameobjects/mesh/MeshCreator.js new file mode 100644 index 000000000..4125d4024 --- /dev/null +++ b/src/gameobjects/mesh/MeshCreator.js @@ -0,0 +1,50 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = require('../BuildGameObject'); +var GameObjectCreator = require('../GameObjectCreator'); +var GetAdvancedValue = require('../../utils/object/GetAdvancedValue'); +var GetValue = require('../../utils/object/GetValue'); +var Mesh = require('./Mesh'); + +/** + * Creates a new Mesh Game Object and returns it. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#mesh + * @since 3.0.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.Mesh} The Game Object that was created. + */ +GameObjectCreator.register('mesh', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var key = GetAdvancedValue(config, 'key', null); + var frame = GetAdvancedValue(config, 'frame', null); + var vertices = GetValue(config, 'vertices', []); + var uvs = GetValue(config, 'uvs', []); + var indicies = GetValue(config, 'indicies', []); + var containsZ = GetValue(config, 'containsZ', false); + var normals = GetValue(config, 'normals', []); + var colors = GetValue(config, 'colors', 0xffffff); + var alphas = GetValue(config, 'alphas', 1); + + var mesh = new Mesh(this.scene, 0, 0, key, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, mesh, config); + + return mesh; +}); diff --git a/src/gameobjects/mesh/MeshFactory.js b/src/gameobjects/mesh/MeshFactory.js new file mode 100644 index 000000000..7df561517 --- /dev/null +++ b/src/gameobjects/mesh/MeshFactory.js @@ -0,0 +1,39 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Mesh = require('./Mesh'); +var GameObjectFactory = require('../GameObjectFactory'); + +/** + * Creates a new Mesh Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#mesh + * @webglOnly + * @since 3.0.0 + * + * @param {number} [x] - The horizontal position of this Game Object in the world. + * @param {number} [y] - The vertical position of this Game Object in the world. + * @param {string|Phaser.Textures.Texture} [texture] - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param {string|number} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {number[]} [vertices] - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} [uvs] - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * + * @return {Phaser.GameObjects.Mesh} The Game Object that was created. + */ +if (typeof WEBGL_RENDERER) +{ + GameObjectFactory.register('mesh', function (x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas) + { + return this.displayList.add(new Mesh(this.scene, x, y, texture, frame, vertices, uvs, indicies, containsZ, normals, colors, alphas)); + }); +} diff --git a/src/tilemaps/dynamiclayer/DynamicTilemapLayerRender.js b/src/gameobjects/mesh/MeshRender.js similarity index 76% rename from src/tilemaps/dynamiclayer/DynamicTilemapLayerRender.js rename to src/gameobjects/mesh/MeshRender.js index e0b9089c3..de2a7c04c 100644 --- a/src/tilemaps/dynamiclayer/DynamicTilemapLayerRender.js +++ b/src/gameobjects/mesh/MeshRender.js @@ -9,12 +9,12 @@ var renderCanvas = require('../../utils/NOOP'); if (typeof WEBGL_RENDERER) { - renderWebGL = require('./DynamicTilemapLayerWebGLRenderer'); + renderWebGL = require('./MeshWebGLRenderer'); } if (typeof CANVAS_RENDERER) { - renderCanvas = require('./DynamicTilemapLayerCanvasRenderer'); + renderCanvas = require('./MeshCanvasRenderer'); } module.exports = { diff --git a/src/gameobjects/mesh/MeshWebGLRenderer.js b/src/gameobjects/mesh/MeshWebGLRenderer.js new file mode 100644 index 000000000..41b1cac94 --- /dev/null +++ b/src/gameobjects/mesh/MeshWebGLRenderer.js @@ -0,0 +1,104 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCalcMatrix = require('../GetCalcMatrix'); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.Mesh#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.Mesh} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var MeshWebGLRenderer = function (renderer, src, camera, parentMatrix) +{ + var faces = src.faces; + var totalFaces = faces.length; + + if (totalFaces === 0) + { + return; + } + + var pipeline = renderer.pipelines.set(src.pipeline, src); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var textureUnit = pipeline.setGameObject(src); + + var F32 = pipeline.vertexViewF32; + var U32 = pipeline.vertexViewU32; + + var vertexOffset = (pipeline.vertexCount * pipeline.currentShader.vertexComponentCount) - 1; + + var tintEffect = src.tintFill; + + var debugFaces = []; + var debugCallback = src.debugCallback; + + var a = calcMatrix.a; + var b = calcMatrix.b; + var c = calcMatrix.c; + var d = calcMatrix.d; + var e = calcMatrix.e; + var f = calcMatrix.f; + + var z = src.viewPosition.z; + + var hideCCW = src.hideCCW; + var roundPixels = camera.roundPixels; + var alpha = camera.alpha * src.alpha; + + var totalFacesRendered = 0; + + renderer.pipelines.preBatch(src); + + for (var i = 0; i < totalFaces; i++) + { + var face = faces[i]; + + // If face has alpha <= 0, or hideCCW + clockwise, or isn't in camera view, then don't draw it + if (!face.isInView(camera, hideCCW, z, alpha, a, b, c, d, e, f, roundPixels)) + { + continue; + } + + if (pipeline.shouldFlush(3)) + { + pipeline.flush(); + + vertexOffset = 0; + } + + vertexOffset = face.load(F32, U32, vertexOffset, textureUnit, tintEffect); + + totalFacesRendered++; + pipeline.vertexCount += 3; + + if (debugCallback) + { + debugFaces.push(face); + } + } + + src.totalFrame += totalFacesRendered; + + if (debugCallback) + { + debugCallback.call(src, src, debugFaces); + } + + renderer.pipelines.postBatch(src); +}; + +module.exports = MeshWebGLRenderer; diff --git a/src/gameobjects/particles/EmitterOp.js b/src/gameobjects/particles/EmitterOp.js index b68efc9dd..56a9ebb1b 100644 --- a/src/gameobjects/particles/EmitterOp.js +++ b/src/gameobjects/particles/EmitterOp.js @@ -234,6 +234,10 @@ var EmitterOp = new Class({ var t = typeof value; + // Reset them in case they're not changed below + this.onEmit = this.defaultEmit; + this.onUpdate = this.defaultUpdate; + if (t === 'number') { // Explicit static value: @@ -270,28 +274,17 @@ var EmitterOp = new Class({ this.onUpdate = value; } } - else if (t === 'object' && (this.has(value, 'random') || this.hasBoth(value, 'start', 'end') || this.hasBoth(value, 'min', 'max'))) + else if (t === 'object' && this.hasBoth(value, 'start', 'end')) { - this.start = this.has(value, 'start') ? value.start : value.min; - this.end = this.has(value, 'end') ? value.end : value.max; + this.start = value.start; + this.end = value.end; - var isRandom = (this.hasBoth(value, 'min', 'max') || !!value.random); + // x: { start: 100, end: 400, random: true } (random optional) = eases between start and end - // A random starting value (using 'min | max' instead of 'start | end' automatically implies a random value) - - // x: { start: 100, end: 400, random: true } OR { min: 100, max: 400 } OR { random: [ 100, 400 ] } + var isRandom = this.has(value, 'random'); if (isRandom) { - var rnd = value.random; - - // x: { random: [ 100, 400 ] } = the same as doing: x: { start: 100, end: 400, random: true } - if (Array.isArray(rnd)) - { - this.start = rnd[0]; - this.end = rnd[1]; - } - this.onEmit = this.randomRangedValueEmit; } @@ -323,12 +316,31 @@ var EmitterOp = new Class({ this.onEmit = this.easedValueEmit; } - // BUG: alpha, rotate, scaleX, scaleY, or tint are eased here if {min, max} is given. - // Probably this branch should exclude isRandom entirely. - this.onUpdate = this.easeValueUpdate; } } + else if (t === 'object' && this.hasBoth(value, 'min', 'max')) + { + // { min: 100, max: 400 } = pick a random number between min and max + + this.start = value.min; + this.end = value.max; + this.onEmit = this.randomRangedValueEmit; + } + else if (t === 'object' && this.has(value, 'random')) + { + // { random: [ 100, 400 ] } = pick a random number between the two elements of the array + + var rnd = value.random; + + if (Array.isArray(rnd)) + { + this.start = rnd[0]; + this.end = rnd[1]; + } + + this.onEmit = this.randomRangedValueEmit; + } else if (t === 'object' && this.hasEither(value, 'onEmit', 'onUpdate')) { // Custom onEmit and onUpdate callbacks diff --git a/src/gameobjects/particles/Particle.js b/src/gameobjects/particles/Particle.js index 0016df6e5..7927ea357 100644 --- a/src/gameobjects/particles/Particle.js +++ b/src/gameobjects/particles/Particle.js @@ -191,7 +191,7 @@ var Particle = new Class({ * The tint applied to this Particle. * * @name Phaser.GameObjects.Particles.Particle#tint - * @type {integer} + * @type {number} * @webglOnly * @since 3.0.0 */ diff --git a/src/gameobjects/particles/ParticleEmitter.js b/src/gameobjects/particles/ParticleEmitter.js index 9960abe9a..4501152b0 100644 --- a/src/gameobjects/particles/ParticleEmitter.js +++ b/src/gameobjects/particles/ParticleEmitter.js @@ -367,14 +367,14 @@ var ParticleEmitter = new Class({ this.scaleY = new EmitterOp(config, 'scaleY', 1); /** - * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored. + * Color tint applied to emitted particles. Value must not include the alpha channel. * * @name Phaser.GameObjects.Particles.ParticleEmitter#tint * @type {Phaser.GameObjects.Particles.EmitterOp} - * @default 0xffffffff + * @default 0xffffff * @since 3.0.0 */ - this.tint = new EmitterOp(config, 'tint', 0xffffffff); + this.tint = new EmitterOp(config, 'tint', 0xffffff); /** * The alpha (transparency) of emitted particles. @@ -464,7 +464,7 @@ var ParticleEmitter = new Class({ * 0 means unlimited. * * @name Phaser.GameObjects.Particles.ParticleEmitter#maxParticles - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -641,7 +641,7 @@ var ParticleEmitter = new Class({ * The blend mode of this emitter's particles. * * @name Phaser.GameObjects.Particles.ParticleEmitter#blendMode - * @type {integer} + * @type {number} * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setBlendMode */ @@ -685,7 +685,7 @@ var ParticleEmitter = new Class({ * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. * * @name Phaser.GameObjects.Particles.ParticleEmitter#currentFrame - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame @@ -707,7 +707,7 @@ var ParticleEmitter = new Class({ * The number of consecutive particles that receive a single texture frame (per frame cycle). * * @name Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity - * @type {integer} + * @type {number} * @default 1 * @since 3.0.0 * @see Phaser.GameObjects.Particles.ParticleEmitter#setFrame @@ -749,7 +749,7 @@ var ParticleEmitter = new Class({ * Counts up to {@link Phaser.GameObjects.Particles.ParticleEmitter#frameQuantity}. * * @name Phaser.GameObjects.Particles.ParticleEmitter#_frameCounter - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -1010,9 +1010,9 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#setFrame * @since 3.0.0 * - * @param {(array|string|integer|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object. + * @param {(array|string|number|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig)} frames - One or more texture frames, or a configuration object. * @param {boolean} [pickRandom=true] - Whether frames should be assigned at random from `frames`. - * @param {integer} [quantity=1] - The number of consecutive particles that will receive each frame. + * @param {number} [quantity=1] - The number of consecutive particles that will receive each frame. * * @return {this} This Particle Emitter. */ @@ -1534,7 +1534,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#reserve * @since 3.0.0 * - * @param {integer} particleCount - The number of particles to create. + * @param {number} particleCount - The number of particles to create. * * @return {this} This Particle Emitter. */ @@ -1556,7 +1556,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getAliveParticleCount * @since 3.0.0 * - * @return {integer} The number of particles with `active=true`. + * @return {number} The number of particles with `active=true`. */ getAliveParticleCount: function () { @@ -1569,7 +1569,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getDeadParticleCount * @since 3.0.0 * - * @return {integer} The number of particles with `active=false`. + * @return {number} The number of particles with `active=false`. */ getDeadParticleCount: function () { @@ -1582,7 +1582,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#getParticleCount * @since 3.0.0 * - * @return {integer} The number of particles, including both alive and dead. + * @return {number} The number of particles, including both alive and dead. */ getParticleCount: function () { @@ -1864,7 +1864,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#explode * @since 3.0.0 * - * @param {integer} count - The amount of Particles to emit. + * @param {number} count - The amount of Particles to emit. * @param {number} x - The x coordinate to emit the Particles from. * @param {number} y - The y coordinate to emit the Particles from. * @@ -1885,7 +1885,7 @@ var ParticleEmitter = new Class({ * * @param {number} [x=this.x] - The x coordinate to emit the Particles from. * @param {number} [y=this.x] - The y coordinate to emit the Particles from. - * @param {integer} [count=this.quantity] - The number of Particles to emit. + * @param {number} [count=this.quantity] - The number of Particles to emit. * * @return {Phaser.GameObjects.Particles.Particle} The most recently emitted Particle. */ @@ -1900,7 +1900,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#emitParticle * @since 3.0.0 * - * @param {integer} [count=this.quantity] - The number of Particles to emit. + * @param {number} [count=this.quantity] - The number of Particles to emit. * @param {number} [x=this.x] - The x coordinate to emit the Particles from. * @param {number} [y=this.x] - The y coordinate to emit the Particles from. * @@ -1962,7 +1962,7 @@ var ParticleEmitter = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitter#preUpdate * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) @@ -2058,7 +2058,7 @@ var ParticleEmitter = new Class({ * @param {object} a - The first particle. * @param {object} b - The second particle. * - * @return {integer} The difference of a and b's y coordinates. + * @return {number} The difference of a and b's y coordinates. */ depthSortCallback: function (a, b) { diff --git a/src/gameobjects/particles/ParticleEmitterManager.js b/src/gameobjects/particles/ParticleEmitterManager.js index 5eee3c5a6..d65fdc670 100644 --- a/src/gameobjects/particles/ParticleEmitterManager.js +++ b/src/gameobjects/particles/ParticleEmitterManager.js @@ -31,7 +31,7 @@ var Render = require('./ParticleManagerRender'); * * @param {Phaser.Scene} scene - The Scene to which this Emitter Manager belongs. * @param {string} texture - The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. + * @param {(string|number)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles. * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. */ var ParticleEmitterManager = new Class({ @@ -58,7 +58,7 @@ var ParticleEmitterManager = new Class({ * The blend mode applied to all emitters and particles. * * @name Phaser.GameObjects.Particles.ParticleEmitterManager#blendMode - * @type {integer} + * @type {number} * @default -1 * @private * @since 3.0.0 @@ -174,7 +174,7 @@ var ParticleEmitterManager = new Class({ * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Emitter Manager. */ @@ -195,7 +195,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#setFrame * @since 3.0.0 * - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Emitter Manager. */ @@ -344,7 +344,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticle * @since 3.0.0 * - * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param {number} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. * @@ -375,7 +375,7 @@ var ParticleEmitterManager = new Class({ * * @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. * @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. - * @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. + * @param {number} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. * * @return {this} This Emitter Manager. */ @@ -437,7 +437,7 @@ var ParticleEmitterManager = new Class({ * @method Phaser.GameObjects.Particles.ParticleEmitterManager#preUpdate * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) diff --git a/src/gameobjects/particles/ParticleManagerCanvasRenderer.js b/src/gameobjects/particles/ParticleManagerCanvasRenderer.js index fc30c9a69..22b0a9d5d 100644 --- a/src/gameobjects/particles/ParticleManagerCanvasRenderer.js +++ b/src/gameobjects/particles/ParticleManagerCanvasRenderer.js @@ -4,6 +4,13 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = require('../components/TransformMatrix'); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); +var tempMatrix4 = new TransformMatrix(); + /** * Renders this Game Object with the Canvas Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -28,10 +35,10 @@ var ParticleManagerCanvasRenderer = function (renderer, emitterManager, camera, return; } - var camMatrix = renderer._tempMatrix1.copyFrom(camera.matrix); - var calcMatrix = renderer._tempMatrix2; - var particleMatrix = renderer._tempMatrix3; - var managerMatrix = renderer._tempMatrix4; + var camMatrix = tempMatrix1.copyFrom(camera.matrix); + var calcMatrix = tempMatrix2; + var particleMatrix = tempMatrix3; + var managerMatrix = tempMatrix4; if (parentMatrix) { diff --git a/src/gameobjects/particles/ParticleManagerCreator.js b/src/gameobjects/particles/ParticleManagerCreator.js index b02d1a086..4c1c9f386 100644 --- a/src/gameobjects/particles/ParticleManagerCreator.js +++ b/src/gameobjects/particles/ParticleManagerCreator.js @@ -44,6 +44,10 @@ GameObjectCreator.register('particles', function (config, addToScene) { this.displayList.add(manager); } + else + { + this.updateList.add(manager); + } return manager; }); diff --git a/src/gameobjects/particles/ParticleManagerFactory.js b/src/gameobjects/particles/ParticleManagerFactory.js index 39abbaf94..ef258d479 100644 --- a/src/gameobjects/particles/ParticleManagerFactory.js +++ b/src/gameobjects/particles/ParticleManagerFactory.js @@ -16,7 +16,7 @@ var ParticleEmitterManager = require('./ParticleEmitterManager'); * @since 3.0.0 * * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number|object)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.GameObjects.Particles.ParticleEmitterConfig|Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create. * * @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created. @@ -25,11 +25,3 @@ GameObjectFactory.register('particles', function (key, frame, emitters) { return this.displayList.add(new ParticleEmitterManager(this.scene, key, frame, emitters)); }); - -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/particles/ParticleManagerWebGLRenderer.js b/src/gameobjects/particles/ParticleManagerWebGLRenderer.js index 161bf3876..d7a198e4c 100644 --- a/src/gameobjects/particles/ParticleManagerWebGLRenderer.js +++ b/src/gameobjects/particles/ParticleManagerWebGLRenderer.js @@ -4,8 +4,14 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = require('../components/TransformMatrix'); var Utils = require('../../renderer/webgl/Utils'); +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); +var tempMatrix4 = new TransformMatrix(); + /** * Renders this Game Object with the WebGL Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. @@ -30,12 +36,12 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, camera, p return; } - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(emitterManager.pipeline); - var camMatrix = pipeline._tempMatrix1.copyFrom(camera.matrix); - var calcMatrix = pipeline._tempMatrix2; - var particleMatrix = pipeline._tempMatrix3; - var managerMatrix = pipeline._tempMatrix4; + var camMatrix = tempMatrix1; + var calcMatrix = tempMatrix2; + var particleMatrix = tempMatrix3; + var managerMatrix = tempMatrix4; if (parentMatrix) { @@ -56,6 +62,8 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, camera, p var textureUnit = pipeline.setGameObject(emitterManager, emitterManager.defaultFrame); + renderer.pipelines.preBatch(emitterManager); + for (var e = 0; e < emittersLength; e++) { var emitter = emitters[e]; @@ -79,7 +87,7 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, camera, p { emitter.mask.preRenderWebGL(renderer, emitter, camera); - // pipeline.setTexture2D(texture, 0); + renderer.pipelines.set(emitterManager.pipeline); } var tintEffect = 0; @@ -115,45 +123,30 @@ var ParticleManagerWebGLRenderer = function (renderer, emitterManager, camera, p var xw = x + frame.width; var yh = y + frame.height; - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); - - if (roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); var tint = getTint(particle.tint, alpha); - pipeline.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, textureUnit); + pipeline.batchQuad(emitter, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, tintEffect, texture, textureUnit); } if (emitter.mask) { emitter.mask.postRenderWebGL(renderer, camera); - - // pipeline.setTexture2D(texture, 0); } } + + renderer.pipelines.postBatch(emitterManager); }; module.exports = ParticleManagerWebGLRenderer; diff --git a/src/gameobjects/particles/typedefs/EdgeZoneSourceCallback.js b/src/gameobjects/particles/typedefs/EdgeZoneSourceCallback.js index 5ff4ac4bf..b0eceb0ab 100644 --- a/src/gameobjects/particles/typedefs/EdgeZoneSourceCallback.js +++ b/src/gameobjects/particles/typedefs/EdgeZoneSourceCallback.js @@ -2,7 +2,7 @@ * @callback Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback * @since 3.0.0 * - * @param {integer} quantity - The number of particles to place on the source edge. If 0, `stepRate` should be used instead. + * @param {number} quantity - The number of particles to place on the source edge. If 0, `stepRate` should be used instead. * @param {number} [stepRate] - The distance between each particle. When set, `quantity` is implied and should be set to `0`. * * @return {Phaser.Geom.Point[]} - The points placed on the source edge. diff --git a/src/gameobjects/particles/typedefs/ParticleEmitterConfig.js b/src/gameobjects/particles/typedefs/ParticleEmitterConfig.js index 50cea2d3f..74c61b559 100644 --- a/src/gameobjects/particles/typedefs/ParticleEmitterConfig.js +++ b/src/gameobjects/particles/typedefs/ParticleEmitterConfig.js @@ -17,7 +17,7 @@ * @property {number} [frequency] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frequency}. * @property {number} [gravityX] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityX}. * @property {number} [gravityY] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#gravityY}. - * @property {integer} [maxParticles] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxParticles}. + * @property {number} [maxParticles] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxParticles}. * @property {string} [name] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#name}. * @property {boolean} [on] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#on}. * @property {boolean} [particleBringToTop] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#particleBringToTop}. @@ -55,5 +55,5 @@ * @property {number} [followOffset.x] - x-coordinate of the offset. * @property {number} [followOffset.y] - y-coordinate of the offset. * @property {number|number[]|string|string[]|Phaser.Textures.Frame|Phaser.Textures.Frame[]|Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig} [frame] - Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. - * @property {integer} [reserve] - Creates specified number of inactive particles and adds them to this emitter's pool. {@link Phaser.GameObjects.Particles.ParticleEmitter#reserve} + * @property {number} [reserve] - Creates specified number of inactive particles and adds them to this emitter's pool. {@link Phaser.GameObjects.Particles.ParticleEmitter#reserve} */ diff --git a/src/gameobjects/particles/typedefs/ParticleEmitterEdgeZoneConfig.js b/src/gameobjects/particles/typedefs/ParticleEmitterEdgeZoneConfig.js index 81e85be93..0126c919a 100644 --- a/src/gameobjects/particles/typedefs/ParticleEmitterEdgeZoneConfig.js +++ b/src/gameobjects/particles/typedefs/ParticleEmitterEdgeZoneConfig.js @@ -4,7 +4,7 @@ * * @property {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - A shape representing the zone. See {@link Phaser.GameObjects.Particles.Zones.EdgeZone#source}. * @property {string} type - 'edge'. - * @property {integer} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * @property {number} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * @property {number} [stepRate] - The distance between each particle. When set, `quantity` is implied and should be set to 0. * @property {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start. * @property {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other. diff --git a/src/gameobjects/particles/typedefs/ParticleEmitterFrameConfig.js b/src/gameobjects/particles/typedefs/ParticleEmitterFrameConfig.js index 19b0ff65f..030837bf4 100644 --- a/src/gameobjects/particles/typedefs/ParticleEmitterFrameConfig.js +++ b/src/gameobjects/particles/typedefs/ParticleEmitterFrameConfig.js @@ -4,5 +4,5 @@ * * @property {number|number[]|string|string[]|Phaser.Textures.Frame|Phaser.Textures.Frame[]} [frames] - One or more texture frames. * @property {boolean} [cycle] - Whether texture frames will be assigned consecutively (true) or at random (false). - * @property {integer} [quantity] - The number of consecutive particles receiving each texture frame, when `cycle` is true. + * @property {number} [quantity] - The number of consecutive particles receiving each texture frame, when `cycle` is true. */ diff --git a/src/gameobjects/particles/typedefs/RandomZoneSourceCallback.js b/src/gameobjects/particles/typedefs/RandomZoneSourceCallback.js index 123d88ef9..2dd39bce2 100644 --- a/src/gameobjects/particles/typedefs/RandomZoneSourceCallback.js +++ b/src/gameobjects/particles/typedefs/RandomZoneSourceCallback.js @@ -2,5 +2,5 @@ * @callback Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback * @since 3.0.0 * - * @param {Phaser.Math.Vector2Like} point - A point to modify. + * @param {Phaser.Types.Math.Vector2Like} point - A point to modify. */ diff --git a/src/gameobjects/particles/zones/EdgeZone.js b/src/gameobjects/particles/zones/EdgeZone.js index 43f321490..1c845efd2 100644 --- a/src/gameobjects/particles/zones/EdgeZone.js +++ b/src/gameobjects/particles/zones/EdgeZone.js @@ -16,7 +16,7 @@ var Class = require('../../../utils/Class'); * @since 3.0.0 * * @param {Phaser.Types.GameObjects.Particles.EdgeZoneSource} source - An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. - * @param {integer} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. + * @param {number} quantity - The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * @param {number} stepRate - The distance between each particle. When set, `quantity` is implied and should be set to 0. * @param {boolean} [yoyo=false] - Whether particles are placed from start to end and then end to start. * @param {boolean} [seamless=true] - Whether one endpoint will be removed if it's identical to the other. @@ -53,7 +53,7 @@ var EdgeZone = new Class({ * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. * * @name Phaser.GameObjects.Particles.Zones.EdgeZone#quantity - * @type {integer} + * @type {number} * @since 3.0.0 */ this.quantity = quantity; diff --git a/src/gameobjects/particles/zones/RandomZone.js b/src/gameobjects/particles/zones/RandomZone.js index 72fd05e4f..7e3061df0 100644 --- a/src/gameobjects/particles/zones/RandomZone.js +++ b/src/gameobjects/particles/zones/RandomZone.js @@ -9,7 +9,7 @@ var Vector2 = require('../../../math/Vector2'); /** * @classdesc - * A zone that places particles randomly within a shape's area. + * A zone that places particles randomly within a shapes area. * * @class RandomZone * @memberof Phaser.GameObjects.Particles.Zones diff --git a/src/gameobjects/pathfollower/PathFollower.js b/src/gameobjects/pathfollower/PathFollower.js index fed1e701a..6ff7f272b 100644 --- a/src/gameobjects/pathfollower/PathFollower.js +++ b/src/gameobjects/pathfollower/PathFollower.js @@ -34,7 +34,7 @@ var Sprite = require('../sprite/Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var PathFollower = new Class({ @@ -62,7 +62,7 @@ var PathFollower = new Class({ * @protected * @since 3.0.0 * - * @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. + * @param {number} time - The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param {number} delta - The delta time, in ms, elapsed since the last frame. */ preUpdate: function (time, delta) diff --git a/src/gameobjects/pathfollower/PathFollowerFactory.js b/src/gameobjects/pathfollower/PathFollowerFactory.js index fefd84c6c..ffa43c4b4 100644 --- a/src/gameobjects/pathfollower/PathFollowerFactory.js +++ b/src/gameobjects/pathfollower/PathFollowerFactory.js @@ -19,7 +19,7 @@ var PathFollower = require('./PathFollower'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.PathFollower} The Game Object that was created. */ diff --git a/src/gameobjects/pointlight/PointLight.js b/src/gameobjects/pointlight/PointLight.js new file mode 100644 index 000000000..ac8f021ff --- /dev/null +++ b/src/gameobjects/pointlight/PointLight.js @@ -0,0 +1,140 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../utils/Class'); +var Components = require('../components'); +var GameObject = require('../GameObject'); +var IntegerToRGB = require('../../display/color/IntegerToRGB'); +var PIPELINES_CONST = require('../../renderer/webgl/pipelines/const'); +var Render = require('./PointLightRender'); +var RGB = require('../../display/RGB'); + +/** + * @classdesc + * + * TODO + * + * @class PointLight + * @extends Phaser.GameObjects.GameObject + * @memberof Phaser.GameObjects + * @constructor + * @since 3.50.0 + * + * @extends Phaser.GameObjects.Components.AlphaSingle + * @extends Phaser.GameObjects.Components.BlendMode + * @extends Phaser.GameObjects.Components.Depth + * @extends Phaser.GameObjects.Components.GetBounds + * @extends Phaser.GameObjects.Components.Mask + * @extends Phaser.GameObjects.Components.Pipeline + * @extends Phaser.GameObjects.Components.ScrollFactor + * @extends Phaser.GameObjects.Components.Transform + * @extends Phaser.GameObjects.Components.Visible + * + * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param {number} x - The horizontal position of this Game Object in the world. + * @param {number} y - The vertical position of this Game Object in the world. + */ +var PointLight = new Class({ + + Extends: GameObject, + + Mixins: [ + Components.AlphaSingle, + Components.BlendMode, + Components.Depth, + Components.GetBounds, + Components.Mask, + Components.Pipeline, + Components.ScrollFactor, + Components.Transform, + Components.Visible, + Render + ], + + initialize: + + function PointLight (scene, x, y, color, radius, intensity, attenuation) + { + if (color === undefined) { color = 0xffffff; } + if (radius === undefined) { radius = 128; } + if (intensity === undefined) { intensity = 1; } + if (attenuation === undefined) { attenuation = 0.1; } + + GameObject.call(this, scene, 'PointLight'); + + this.initPipeline(PIPELINES_CONST.POINTLIGHT_PIPELINE); + + this.setPosition(x, y); + + var rgb = IntegerToRGB(color); + + this.color = new RGB(rgb.r, rgb.g, rgb.b); + + this.intensity = intensity; + this.attenuation = attenuation; + + // read only: + this.width = radius * 2; + this.height = radius * 2; + + this._radius = radius; + }, + + radius: { + + get: function () + { + return this._radius; + }, + + set: function (value) + { + this._radius = value; + this.width = value * 2; + this.height = value * 2; + } + + }, + + originX: { + + get: function () + { + return 0.5; + } + + }, + + originY: { + + get: function () + { + return 0.5; + } + + }, + + displayOriginX: { + + get: function () + { + return this._radius; + } + + }, + + displayOriginY: { + + get: function () + { + return this._radius; + } + + } + +}); + +module.exports = PointLight; diff --git a/src/gameobjects/pointlight/PointLightCreator.js b/src/gameobjects/pointlight/PointLightCreator.js new file mode 100644 index 000000000..2dd4faf30 --- /dev/null +++ b/src/gameobjects/pointlight/PointLightCreator.js @@ -0,0 +1,44 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var BuildGameObject = require('../BuildGameObject'); +var GameObjectCreator = require('../GameObjectCreator'); +var GetAdvancedValue = require('../../utils/object/GetAdvancedValue'); +var PointLight = require('./PointLight'); + +/** + * Creates a new Point Light Game Object and returns it. + * + * Note: This method will only be available if the Point Light Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectCreator#pointlight + * @since 3.50.0 + * + * @param {object} config - The configuration object this Game Object will use to create itself. + * @param {boolean} [addToScene] - Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + * + * @return {Phaser.GameObjects.PointLight} The Game Object that was created. + */ +GameObjectCreator.register('pointlight', function (config, addToScene) +{ + if (config === undefined) { config = {}; } + + var color = GetAdvancedValue(config, 'color', 0xffffff); + var radius = GetAdvancedValue(config, 'radius', 128); + var intensity = GetAdvancedValue(config, 'intensity', 1); + var attenuation = GetAdvancedValue(config, 'attenuation', 0.1); + + var layer = new PointLight(this.scene, 0, 0, color, radius, intensity, attenuation); + + if (addToScene !== undefined) + { + config.add = addToScene; + } + + BuildGameObject(this.scene, layer, config); + + return layer; +}); diff --git a/src/gameobjects/pointlight/PointLightFactory.js b/src/gameobjects/pointlight/PointLightFactory.js new file mode 100644 index 000000000..19a07d119 --- /dev/null +++ b/src/gameobjects/pointlight/PointLightFactory.js @@ -0,0 +1,24 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GameObjectFactory = require('../GameObjectFactory'); +var PointLight = require('./PointLight'); + +/** + * Creates a new Point Light Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Point Light Game Object has been built into Phaser. + * + * @method Phaser.GameObjects.GameObjectFactory#pointlight + * @since 3.50.0 + * + * + * @return {Phaser.GameObjects.PointLight} The Game Object that was created. + */ +GameObjectFactory.register('pointlight', function (x, y, color, radius, intensity, attenuation) +{ + return this.displayList.add(new PointLight(this.scene, x, y, color, radius, intensity, attenuation)); +}); diff --git a/src/gameobjects/pointlight/PointLightRender.js b/src/gameobjects/pointlight/PointLightRender.js new file mode 100644 index 000000000..af72a8edc --- /dev/null +++ b/src/gameobjects/pointlight/PointLightRender.js @@ -0,0 +1,20 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = require('../../utils/NOOP'); +var renderCanvas = require('../../utils/NOOP'); + +if (typeof WEBGL_RENDERER) +{ + renderWebGL = require('./PointLightWebGLRenderer'); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; diff --git a/src/gameobjects/pointlight/PointLightWebGLRenderer.js b/src/gameobjects/pointlight/PointLightWebGLRenderer.js new file mode 100644 index 000000000..0434b5750 --- /dev/null +++ b/src/gameobjects/pointlight/PointLightWebGLRenderer.js @@ -0,0 +1,60 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetCalcMatrix = require('../GetCalcMatrix'); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.GameObjects.PointLight#renderWebGL + * @since 3.50.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.GameObjects.PointLight} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested + */ +var PointLightWebGLRenderer = function (renderer, src, camera, parentMatrix) +{ + var pipeline = renderer.pipelines.set(src.pipeline); + + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; + + var width = src.width; + var height = src.height; + + var x = -src._radius; + var y = -src._radius; + + var xw = x + width; + var yh = y + height; + + var lightX = calcMatrix.getX(0, 0); + var lightY = calcMatrix.getY(0, 0); + + var tx0 = calcMatrix.getX(x, y); + var ty0 = calcMatrix.getY(x, y); + + var tx1 = calcMatrix.getX(x, yh); + var ty1 = calcMatrix.getY(x, yh); + + var tx2 = calcMatrix.getX(xw, yh); + var ty2 = calcMatrix.getY(xw, yh); + + var tx3 = calcMatrix.getX(xw, y); + var ty3 = calcMatrix.getY(xw, y); + + renderer.pipelines.preBatch(src); + + pipeline.batchPointLight(src, camera, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, lightX, lightY); + + renderer.pipelines.postBatch(src); +}; + +module.exports = PointLightWebGLRenderer; diff --git a/src/gameobjects/quad/Quad.js b/src/gameobjects/quad/Quad.js deleted file mode 100644 index 8ad8d29e2..000000000 --- a/src/gameobjects/quad/Quad.js +++ /dev/null @@ -1,655 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = require('../../utils/Class'); -var Layer3D = require('../layer3d/Layer3D'); - -/** - * @classdesc - * A Quad Game Object. - * - * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single - * texture spread across them. - * - * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also - * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. - * - * @class Quad - * @extends Phaser.GameObjects.Layer3D - * @memberof Phaser.GameObjects - * @constructor - * @webglOnly - * @since 3.0.0 - * - * @param {Phaser.Scene} scene - The Scene to which this Quad belongs. - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - */ -var Quad = new Class({ - - Extends: Layer3D, - - initialize: - - function Quad (scene, x, y, texture, frame) - { - // 0----3 - // |\ B| - // | \ | - // | \ | - // | A \| - // | \ - // 1----2 - - var vertices = [ - 0, 0, // tl - 0, 0, // bl - 0, 0, // br - 0, 0, // tl - 0, 0, // br - 0, 0 // tr - ]; - - var uv = [ - 0, 0, // tl - 0, 1, // bl - 1, 1, // br - 0, 0, // tl - 1, 1, // br - 1, 0 // tr - ]; - - var colors = [ - 0xffffff, // tl - 0xffffff, // bl - 0xffffff, // br - 0xffffff, // tl - 0xffffff, // br - 0xffffff // tr - ]; - - var alphas = [ - 1, // tl - 1, // bl - 1, // br - 1, // tl - 1, // br - 1 // tr - ]; - - Layer3D.call(this, scene, x, y, vertices, uv, colors, alphas, texture, frame); - - this.resetPosition(); - }, - - /** - * Sets the frame this Game Object will use to render with. - * - * The Frame has to belong to the current Texture being used. - * - * It can be either a string or an index. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * - * @method Phaser.GameObjects.Quad#setFrame - * @since 3.11.0 - * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. - * - * @return {this} This Game Object instance. - */ - setFrame: function (frame) - { - this.frame = this.texture.get(frame); - - if (!this.frame.cutWidth || !this.frame.cutHeight) - { - this.renderFlags &= ~8; - } - else - { - this.renderFlags |= 8; - } - - frame = this.frame; - - // TL - this.uv[0] = frame.u0; - this.uv[1] = frame.v0; - - // BL - this.uv[2] = frame.u0; - this.uv[3] = frame.v1; - - // BR - this.uv[4] = frame.u1; - this.uv[5] = frame.v1; - - // TL - this.uv[6] = frame.u0; - this.uv[7] = frame.v0; - - // BR - this.uv[8] = frame.u1; - this.uv[9] = frame.v1; - - // TR - this.uv[10] = frame.u1; - this.uv[11] = frame.v0; - - return this; - }, - - /** - * The top-left x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftX - * @type {number} - * @since 3.0.0 - */ - topLeftX: { - - get: function () - { - return this.x + this.vertices[0]; - }, - - set: function (value) - { - this.vertices[0] = value - this.x; - this.vertices[6] = value - this.x; - } - - }, - - /** - * The top-left y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftY - * @type {number} - * @since 3.0.0 - */ - topLeftY: { - - get: function () - { - return this.y + this.vertices[1]; - }, - - set: function (value) - { - this.vertices[1] = value - this.y; - this.vertices[7] = value - this.y; - } - - }, - - /** - * The top-right x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightX - * @type {number} - * @since 3.0.0 - */ - topRightX: { - - get: function () - { - return this.x + this.vertices[10]; - }, - - set: function (value) - { - this.vertices[10] = value - this.x; - } - - }, - - /** - * The top-right y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightY - * @type {number} - * @since 3.0.0 - */ - topRightY: { - - get: function () - { - return this.y + this.vertices[11]; - }, - - set: function (value) - { - this.vertices[11] = value - this.y; - } - - }, - - /** - * The bottom-left x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftX - * @type {number} - * @since 3.0.0 - */ - bottomLeftX: { - - get: function () - { - return this.x + this.vertices[2]; - }, - - set: function (value) - { - this.vertices[2] = value - this.x; - } - - }, - - /** - * The bottom-left y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftY - * @type {number} - * @since 3.0.0 - */ - bottomLeftY: { - - get: function () - { - return this.y + this.vertices[3]; - }, - - set: function (value) - { - this.vertices[3] = value - this.y; - } - - }, - - /** - * The bottom-right x vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightX - * @type {number} - * @since 3.0.0 - */ - bottomRightX: { - - get: function () - { - return this.x + this.vertices[4]; - }, - - set: function (value) - { - this.vertices[4] = value - this.x; - this.vertices[8] = value - this.x; - } - - }, - - /** - * The bottom-right y vertex of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightY - * @type {number} - * @since 3.0.0 - */ - bottomRightY: { - - get: function () - { - return this.y + this.vertices[5]; - }, - - set: function (value) - { - this.vertices[5] = value - this.y; - this.vertices[9] = value - this.y; - } - - }, - - /** - * The top-left alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftAlpha - * @type {number} - * @since 3.0.0 - */ - topLeftAlpha: { - - get: function () - { - return this.alphas[0]; - }, - - set: function (value) - { - this.alphas[0] = value; - this.alphas[3] = value; - } - - }, - - /** - * The top-right alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightAlpha - * @type {number} - * @since 3.0.0 - */ - topRightAlpha: { - - get: function () - { - return this.alphas[5]; - }, - - set: function (value) - { - this.alphas[5] = value; - } - - }, - - /** - * The bottom-left alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftAlpha - * @type {number} - * @since 3.0.0 - */ - bottomLeftAlpha: { - - get: function () - { - return this.alphas[1]; - }, - - set: function (value) - { - this.alphas[1] = value; - } - - }, - - /** - * The bottom-right alpha value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightAlpha - * @type {number} - * @since 3.0.0 - */ - bottomRightAlpha: { - - get: function () - { - return this.alphas[2]; - }, - - set: function (value) - { - this.alphas[2] = value; - this.alphas[4] = value; - } - - }, - - /** - * The top-left color value of this Quad. - * - * @name Phaser.GameObjects.Quad#topLeftColor - * @type {number} - * @since 3.0.0 - */ - topLeftColor: { - - get: function () - { - return this.colors[0]; - }, - - set: function (value) - { - this.colors[0] = value; - this.colors[3] = value; - } - - }, - - /** - * The top-right color value of this Quad. - * - * @name Phaser.GameObjects.Quad#topRightColor - * @type {number} - * @since 3.0.0 - */ - topRightColor: { - - get: function () - { - return this.colors[5]; - }, - - set: function (value) - { - this.colors[5] = value; - } - - }, - - /** - * The bottom-left color value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomLeftColor - * @type {number} - * @since 3.0.0 - */ - bottomLeftColor: { - - get: function () - { - return this.colors[1]; - }, - - set: function (value) - { - this.colors[1] = value; - } - - }, - - /** - * The bottom-right color value of this Quad. - * - * @name Phaser.GameObjects.Quad#bottomRightColor - * @type {number} - * @since 3.0.0 - */ - bottomRightColor: { - - get: function () - { - return this.colors[2]; - }, - - set: function (value) - { - this.colors[2] = value; - this.colors[4] = value; - } - - }, - - /** - * Sets the top-left vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setTopLeft - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setTopLeft: function (x, y) - { - this.topLeftX = x; - this.topLeftY = y; - - return this; - }, - - /** - * Sets the top-right vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setTopRight - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setTopRight: function (x, y) - { - this.topRightX = x; - this.topRightY = y; - - return this; - }, - - /** - * Sets the bottom-left vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setBottomLeft - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setBottomLeft: function (x, y) - { - this.bottomLeftX = x; - this.bottomLeftY = y; - - return this; - }, - - /** - * Sets the bottom-right vertex position of this Quad. - * - * @method Phaser.GameObjects.Quad#setBottomRight - * @since 3.0.0 - * - * @param {number} x - The horizontal coordinate of the vertex. - * @param {number} y - The vertical coordinate of the vertex. - * - * @return {this} This Game Object. - */ - setBottomRight: function (x, y) - { - this.bottomRightX = x; - this.bottomRightY = y; - - return this; - }, - - /** - * Resets the positions of the four corner vertices of this Quad. - * - * @method Phaser.GameObjects.Quad#resetPosition - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetPosition: function () - { - var x = this.x; - var y = this.y; - var halfWidth = Math.floor(this.width / 2); - var halfHeight = Math.floor(this.height / 2); - - this.setTopLeft(x - halfWidth, y - halfHeight); - this.setTopRight(x + halfWidth, y - halfHeight); - this.setBottomLeft(x - halfWidth, y + halfHeight); - this.setBottomRight(x + halfWidth, y + halfHeight); - - return this; - }, - - /** - * Resets the alpha values used by this Quad back to 1. - * - * @method Phaser.GameObjects.Quad#resetAlpha - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetAlpha: function () - { - var alphas = this.alphas; - - alphas[0] = 1; - alphas[1] = 1; - alphas[2] = 1; - alphas[3] = 1; - alphas[4] = 1; - alphas[5] = 1; - - return this; - }, - - /** - * Resets the color values used by this Quad back to 0xffffff. - * - * @method Phaser.GameObjects.Quad#resetColors - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - resetColors: function () - { - var colors = this.colors; - - colors[0] = 0xffffff; - colors[1] = 0xffffff; - colors[2] = 0xffffff; - colors[3] = 0xffffff; - colors[4] = 0xffffff; - colors[5] = 0xffffff; - - return this; - }, - - /** - * Resets the position, alpha and color values used by this Quad. - * - * @method Phaser.GameObjects.Quad#reset - * @since 3.0.0 - * - * @return {this} This Game Object. - */ - reset: function () - { - this.resetPosition(); - - this.resetAlpha(); - - return this.resetColors(); - } - -}); - -module.exports = Quad; diff --git a/src/gameobjects/quad/QuadFactory.js b/src/gameobjects/quad/QuadFactory.js deleted file mode 100644 index a1e53e167..000000000 --- a/src/gameobjects/quad/QuadFactory.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Quad = require('./Quad'); -var GameObjectFactory = require('../GameObjectFactory'); - -/** - * Creates a new Quad Game Object and adds it to the Scene. - * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. - * - * @method Phaser.GameObjects.GameObjectFactory#quad - * @webglOnly - * @since 3.0.0 - * - * @param {number} x - The horizontal position of this Game Object in the world. - * @param {number} y - The vertical position of this Game Object in the world. - * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * - * @return {Phaser.GameObjects.Quad} The Game Object that was created. - */ -if (typeof WEBGL_RENDERER) -{ - GameObjectFactory.register('quad', function (x, y, key, frame) - { - return this.displayList.add(new Quad(this.scene, x, y, key, frame)); - }); -} - -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/rendertexture/RenderTexture.js b/src/gameobjects/rendertexture/RenderTexture.js index 1287dd2a2..9184aa4c3 100644 --- a/src/gameobjects/rendertexture/RenderTexture.js +++ b/src/gameobjects/rendertexture/RenderTexture.js @@ -13,8 +13,9 @@ var CONST = require('../../const'); var Frame = require('../../textures/Frame'); var GameObject = require('../GameObject'); var NOOP = require('../../utils/NOOP'); -var ProjectOrtho = require('../../renderer/webgl/mvp/ProjectOrtho'); +var PIPELINE_CONST = require('../../renderer/webgl/pipelines/const'); var Render = require('./RenderTextureRender'); +var RenderTarget = require('../../renderer/webgl/RenderTarget'); var Utils = require('../../renderer/webgl/Utils'); var UUID = require('../../utils/string/UUID'); @@ -55,8 +56,8 @@ var UUID = require('../../utils/string/UUID'); * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. - * @param {integer} [width=32] - The width of the Render Texture. - * @param {integer} [height=32] - The height of the Render Texture. + * @param {number} [width=32] - The width of the Render Texture. + * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. */ @@ -100,7 +101,7 @@ var RenderTexture = new Class({ * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.2.0 */ - this.renderer = scene.sys.game.renderer; + this.renderer = scene.sys.renderer; /** * A reference to the Texture Manager. @@ -140,16 +141,6 @@ var RenderTexture = new Class({ */ this.canvas = null; - /** - * A reference to the GL Frame Buffer this Render Texture is drawing to. - * This is only set if Phaser is running with the WebGL Renderer. - * - * @name Phaser.GameObjects.RenderTexture#framebuffer - * @type {?WebGLFramebuffer} - * @since 3.2.0 - */ - this.framebuffer = null; - /** * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself. * @@ -254,25 +245,17 @@ var RenderTexture = new Class({ this.camera = new Camera(0, 0, width, height); /** - * A reference to the WebGL Rendering Context. + * The Render Target that belongs to this Render Texture. * - * @name Phaser.GameObjects.RenderTexture#gl - * @type {WebGLRenderingContext} - * @default null - * @since 3.0.0 - */ - this.gl = null; - - /** - * A reference to the WebGLTexture that is being rendered to in a WebGL Context. + * A Render Target encapsulates a framebuffer and texture for the WebGL Renderer. * - * @name Phaser.GameObjects.RenderTexture#glTexture - * @type {WebGLTexture} - * @default null - * @readonly - * @since 3.19.0 + * This property remains `null` under Canvas. + * + * @name Phaser.GameObjects.RenderTexture#renderTarget + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 */ - this.glTexture = null; + this.renderTarget = null; var renderer = this.renderer; @@ -282,12 +265,9 @@ var RenderTexture = new Class({ } else if (renderer.type === CONST.WEBGL) { - var gl = renderer.gl; - - this.gl = gl; - this.glTexture = this.frame.source.glTexture; this.drawGameObject = this.batchGameObjectWebGL; - this.framebuffer = renderer.createFramebuffer(width, height, this.glTexture, false); + + this.renderTarget = new RenderTarget(renderer, width, height, 1, 0, false); } else if (renderer.type === CONST.CANVAS) { @@ -304,7 +284,8 @@ var RenderTexture = new Class({ } this.setOrigin(0, 0); - this.initPipeline(); + + this.initPipeline(PIPELINE_CONST.SINGLE_PIPELINE); }, /** @@ -351,7 +332,6 @@ var RenderTexture = new Class({ if (height === undefined) { height = width; } var frame = this.frame; - var renderer = this.renderer; if (width !== this.width || height !== this.height) { @@ -365,31 +345,24 @@ var RenderTexture = new Class({ this.texture.width = width; this.texture.height = height; - if (this.gl) + var renderTarget = this.renderTarget; + + if (renderTarget) { - var gl = this.gl; + renderTarget.resize(width, height); - renderer.deleteTexture(frame.source.glTexture); - renderer.deleteFramebuffer(this.framebuffer); - - var glTexture = renderer.createTexture2D(0, gl.NEAREST, gl.NEAREST, gl.CLAMP_TO_EDGE, gl.CLAMP_TO_EDGE, gl.RGBA, null, width, height, false); - - this.framebuffer = renderer.createFramebuffer(width, height, glTexture, false); + frame.glTexture = renderTarget.texture; frame.source.isRenderTexture = true; - - frame.source.glTexture = glTexture; - - frame.glTexture = glTexture; - - this.glTexture = glTexture; + frame.source.isGLTexture = true; + frame.source.glTexture = renderTarget.texture; } + this.camera.setSize(width, height); + frame.source.width = width; frame.source.height = height; - this.camera.setSize(width, height); - frame.setSize(width, height); this.width = width; @@ -434,7 +407,7 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#setGlobalTint * @since 3.2.0 * - * @param {integer} tint - The tint value. + * @param {number} tint - The tint value. * * @return {this} This Render Texture. */ @@ -486,6 +459,10 @@ var RenderTexture = new Class({ * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame from a Render Texture. * + * If you destroy this Render Texture, any Game Object using it via the Texture Manager will + * stop rendering. Ensure you remove the texture from the Texture Manager and any Game Objects + * using it first, before destroying this Render Texture. + * * @method Phaser.GameObjects.RenderTexture#saveTexture * @since 3.12.0 * @@ -519,9 +496,7 @@ var RenderTexture = new Class({ */ fill: function (rgb, alpha, x, y, width, height) { - var gl = this.gl; var frame = this.frame; - var texture = this.texture; var camera = this.camera; var renderer = this.renderer; @@ -531,47 +506,38 @@ var RenderTexture = new Class({ if (width === undefined) { width = frame.cutWidth; } if (height === undefined) { height = frame.cutHeight; } - var r = ((rgb >> 16) | 0) & 0xff; - var g = ((rgb >> 8) | 0) & 0xff; - var b = (rgb | 0) & 0xff; + var r = (rgb >> 16 & 0xFF) / 255; + var g = (rgb >> 8 & 0xFF) / 255; + var b = (rgb & 0xFF) / 255; - camera.preRender(1, 1); + var renderTarget = this.renderTarget; - if (gl) + camera.preRender(); + + if (renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; - - renderer.resetTextures(true); - - renderer.pushScissor(cx, cy, cw, -ch); - - renderer.setFramebuffer(this.framebuffer, false); + renderTarget.bind(true); var pipeline = this.pipeline; - var tw = texture.width; - var th = texture.height; + pipeline.manager.set(pipeline); - var rw = pipeline.width; - var rh = pipeline.height; + var tw = renderTarget.width; + var th = renderTarget.height; + + var rw = renderer.width; + var rh = renderer.height; var sx = rw / tw; var sy = rh / th; pipeline.drawFillRect( - x * sx, (th - height - y) * sy, width * sx, height * sy, - Utils.getTintFromFloats(r / 255, g / 255, b / 255, 1), + x * sx, y * sy, width * sx, height * sy, + Utils.getTintFromFloats(b, g, r, 1), alpha ); - pipeline.flush(); - - renderer.setFramebuffer(null, false); - - renderer.popScissor(); + renderTarget.unbind(true); } else { @@ -602,23 +568,11 @@ var RenderTexture = new Class({ { if (this.dirty) { - var gl = this.gl; + var renderTarget = this.renderTarget; - if (gl) + if (renderTarget) { - var renderer = this.renderer; - - renderer.setFramebuffer(this.framebuffer, true); - - if (this.frame.cutWidth !== this.canvas.width || this.frame.cutHeight !== this.canvas.height) - { - gl.scissor(this.frame.cutX, this.frame.cutY, this.frame.cutWidth, this.frame.cutHeight); - } - - gl.clearColor(0, 0, 0, 0); - gl.clear(gl.COLOR_BUFFER_BIT); - - renderer.setFramebuffer(null, true); + renderTarget.clear(); } else { @@ -687,14 +641,8 @@ var RenderTexture = new Class({ { this._eraseMode = true; - var blendMode = this.renderer.currentBlendMode; - - this.renderer.setBlendMode(BlendModes.ERASE); - this.draw(entries, x, y, 1, 16777215); - this.renderer.setBlendMode(blendMode); - this._eraseMode = false; return this; @@ -754,64 +702,9 @@ var RenderTexture = new Class({ */ draw: function (entries, x, y, alpha, tint) { - if (alpha === undefined) { alpha = this.globalAlpha; } - - if (tint === undefined) - { - tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16); - } - else - { - tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16); - } - - if (!Array.isArray(entries)) - { - entries = [ entries ]; - } - - var gl = this.gl; - var camera = this.camera; - var renderer = this.renderer; - - camera.preRender(1, 1); - - if (gl) - { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; - - renderer.resetTextures(true); - - renderer.setFramebuffer(this.framebuffer, false); - - renderer.pushScissor(cx, cy, cw, ch, ch); - - var pipeline = this.pipeline; - - ProjectOrtho(pipeline, 0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); - - this.batchList(entries, x, y, alpha, tint); - - // Causes a flush + popScissor - renderer.setFramebuffer(null, true); - - renderer.resetTextures(true); - - ProjectOrtho(pipeline, 0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); - } - else - { - renderer.setContext(this.context); - - this.batchList(entries, x, y, alpha, tint); - - renderer.setContext(); - } - - this.dirty = true; + this.beginDraw(); + this.batchDraw(entries, x, y, alpha, tint); + this.endDraw(); return this; }, @@ -838,7 +731,7 @@ var RenderTexture = new Class({ * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * @param {number} [x=0] - The x position to draw the frame at. * @param {number} [y=0] - The y position to draw the frame at. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -847,6 +740,226 @@ var RenderTexture = new Class({ * @return {this} This Render Texture instance. */ drawFrame: function (key, frame, x, y, alpha, tint) + { + this.beginDraw(); + this.batchDrawFrame(key, frame, x, y, alpha, tint); + this.endDraw(); + + return this; + }, + + /** + * Use this method if you need to batch draw a large number of Game Objects to + * this Render Texture in a single go, or on a frequent basis. + * + * This method starts the beginning of a batched draw. + * + * It is faster than calling `draw`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of objects it's much safer and easier to use the `draw` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + * + * @method Phaser.GameObjects.RenderTexture#beginDraw + * @since 3.50.0 + * + * @return {this} This Render Texture instance. + */ + beginDraw: function () + { + var camera = this.camera; + var renderer = this.renderer; + var renderTarget = this.renderTarget; + + camera.preRender(); + + if (renderTarget) + { + renderer.beginCapture(); + } + else + { + renderer.setContext(this.context); + } + + return this; + }, + + /** + * Use this method if you have already called `beginDraw` and need to batch + * draw a large number of objects to this Render Texture. + * + * This method batches the drawing of the given objects to this Render Texture, + * without causing a bind or batch flush. + * + * It is faster than calling `draw`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of objects it's much safer and easier to use the `draw` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + * + * Draws the given object, or an array of objects, to this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot draw a Render Texture to itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. If you need to specify + * exactly which frame to draw then use the method `drawFrame` instead. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * The `alpha` and `tint` values are only used by Texture Frames. + * Game Objects use their own alpha and tint values when being drawn. + * + * @method Phaser.GameObjects.RenderTexture#batchDraw + * @since 3.50.0 + * + * @param {any} entries - Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param {number} [x] - The x position to draw the Frame at, or the offset applied to the object. + * @param {number} [y] - The y position to draw the Frame at, or the offset applied to the object. + * @param {number} [alpha] - The alpha value. Only used for Texture Frames and if not specified defaults to the `globalAlpha` property. Game Objects use their own current alpha value. + * @param {number} [tint] - WebGL only. The tint color value. Only used for Texture Frames and if not specified defaults to the `globalTint` property. Game Objects use their own current tint value. + * + * @return {this} This Render Texture instance. + */ + batchDraw: function (entries, x, y, alpha, tint) + { + if (alpha === undefined) { alpha = this.globalAlpha; } + + if (tint === undefined) + { + tint = (this.globalTint >> 16) + (this.globalTint & 0xff00) + ((this.globalTint & 0xff) << 16); + } + else + { + tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16); + } + + if (!Array.isArray(entries)) + { + entries = [ entries ]; + } + + this.batchList(entries, x, y, alpha, tint); + + return this; + }, + + /** + * Use this method if you have already called `beginDraw` and need to batch + * draw a large number of texture frames to this Render Texture. + * + * This method batches the drawing of the given frames to this Render Texture, + * without causing a bind or batch flush. + * + * It is faster than calling `drawFrame`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of frames it's much safer and easier to use the `drawFrame` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + * + * Draws the Texture Frame to the Render Texture at the given position. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.drawFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frame + * before it is drawn. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. + * + * @method Phaser.GameObjects.RenderTexture#batchDrawFrame + * @since 3.50.0 + * + * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. + * @param {number} [x=0] - The x position to draw the frame at. + * @param {number} [y=0] - The y position to draw the frame at. + * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. + * @param {number} [tint] - WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + * + * @return {this} This Render Texture instance. + */ + batchDrawFrame: function (key, frame, x, y, alpha, tint) { if (x === undefined) { x = 0; } if (y === undefined) { y = 0; } @@ -861,53 +974,82 @@ var RenderTexture = new Class({ tint = (tint >> 16) + (tint & 0xff00) + ((tint & 0xff) << 16); } - var gl = this.gl; - var camera = this.camera; - var renderer = this.renderer; var textureFrame = this.textureManager.getFrame(key, frame); if (textureFrame) { - camera.preRender(1, 1); - - if (gl) + if (this.renderTarget) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; - - renderer.resetTextures(true); - - renderer.setFramebuffer(this.framebuffer, false); - - renderer.pushScissor(cx, cy, cw, ch, ch); - - var pipeline = this.pipeline; - - ProjectOrtho(pipeline, 0, this.texture.width, 0, this.texture.height, -1000.0, 1000.0); - - pipeline.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, tint, alpha, camera.matrix, null); - - pipeline.flush(); - - renderer.setFramebuffer(null, false); - - renderer.popScissor(); - - ProjectOrtho(pipeline, 0, pipeline.width, pipeline.height, 0, -1000.0, 1000.0); + this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null); } else { this.batchTextureFrame(textureFrame, x + this.frame.cutX, y + this.frame.cutY, alpha, tint); } - - this.dirty = true; } return this; }, + /** + * Use this method to finish batch drawing to this Render Texture. + * + * Never call this method without first calling `beginDraw`. + * + * It is faster than calling `draw`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of objects it's much safer and easier to use the `draw` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + * + * @method Phaser.GameObjects.RenderTexture#endDraw + * @since 3.50.0 + * + * @return {this} This Render Texture instance. + */ + endDraw: function () + { + var renderer = this.renderer; + + var renderTarget = this.renderTarget; + + if (renderTarget) + { + var canvasTarget = renderer.endCapture(); + + var util = renderer.pipelines.setUtility(); + + util.blitFrame(canvasTarget, renderTarget, 1, false, false, this._eraseMode); + + renderer.resetViewport(); + } + else + { + renderer.setContext(); + } + + this.dirty = true; + + return this; + }, + /** * Internal method that handles the drawing of an array of children. * @@ -961,7 +1103,7 @@ var RenderTexture = new Class({ }, /** - * Internal method that handles the drawing a Phaser Group contents. + * Internal method that handles drawing a Phaser Group contents. * * @method Phaser.GameObjects.RenderTexture#batchGroup * @private @@ -983,7 +1125,7 @@ var RenderTexture = new Class({ { var entry = children[i]; - if (entry.willRender()) + if (entry.willRender(this.camera)) { var tx = entry.x + x; var ty = entry.y + y; @@ -1012,11 +1154,6 @@ var RenderTexture = new Class({ var prevX = gameObject.x; var prevY = gameObject.y; - if (!this._eraseMode) - { - this.renderer.setBlendMode(gameObject.blendMode); - } - gameObject.setPosition(x + this.frame.cutX, y + this.frame.cutY); gameObject.renderWebGL(this.renderer, gameObject, this.camera); @@ -1070,7 +1207,7 @@ var RenderTexture = new Class({ * @since 3.12.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * @param {number} [x=0] - The x position to offset the Game Object by. * @param {number} [y=0] - The y position to offset the Game Object by. * @param {number} [alpha] - The alpha to use. If not specified it uses the `globalAlpha` property. @@ -1106,7 +1243,9 @@ var RenderTexture = new Class({ x += this.frame.cutX; y += this.frame.cutY; - if (this.gl) + var renderTarget = this.renderTarget; + + if (renderTarget) { this.pipeline.batchTextureFrame(textureFrame, x, y, tint, alpha, this.camera.matrix, null); } @@ -1118,11 +1257,17 @@ var RenderTexture = new Class({ var matrix = this.camera.matrix; - ctx.globalAlpha = this.globalAlpha; + ctx.save(); - ctx.setTransform(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); + ctx.globalCompositeOperation = (this._eraseMode) ? 'destination-out' : 'source-over'; + + ctx.globalAlpha = alpha; + + matrix.setToContext(ctx); ctx.drawImage(source, cd.x, cd.y, cd.width, cd.height, x, y, cd.width, cd.height); + + ctx.restore(); } }, @@ -1141,10 +1286,10 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#snapshotArea * @since 3.19.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -1153,9 +1298,9 @@ var RenderTexture = new Class({ */ snapshotArea: function (x, y, width, height, callback, type, encoderOptions) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, false, x, y, width, height, type, encoderOptions); } else { @@ -1188,9 +1333,9 @@ var RenderTexture = new Class({ */ snapshot: function (callback, type, encoderOptions) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, false, 0, 0, this.width, this.height, type, encoderOptions); } else { @@ -1214,17 +1359,17 @@ var RenderTexture = new Class({ * @method Phaser.GameObjects.RenderTexture#snapshotPixel * @since 3.19.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This Render Texture instance. */ snapshotPixel: function (x, y, callback) { - if (this.gl) + if (this.renderTarget) { - this.renderer.snapshotFramebuffer(this.framebuffer, this.width, this.height, callback, true, x, y); + this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer, this.width, this.height, callback, true, x, y); } else { @@ -1247,9 +1392,9 @@ var RenderTexture = new Class({ { CanvasPool.remove(this.canvas); - if (this.gl) + if (this.renderTarget) { - this.renderer.deleteFramebuffer(this.framebuffer); + this.renderTarget.destroy(); } this.texture.destroy(); @@ -1257,9 +1402,7 @@ var RenderTexture = new Class({ this.canvas = null; this.context = null; - this.framebuffer = null; this.texture = null; - this.glTexture = null; } } diff --git a/src/gameobjects/rendertexture/RenderTextureFactory.js b/src/gameobjects/rendertexture/RenderTextureFactory.js index 5b58e80d3..8bec95b0e 100644 --- a/src/gameobjects/rendertexture/RenderTextureFactory.js +++ b/src/gameobjects/rendertexture/RenderTextureFactory.js @@ -21,8 +21,8 @@ var RenderTexture = require('./RenderTexture'); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} [width=32] - The width of the Render Texture. - * @param {integer} [height=32] - The height of the Render Texture. + * @param {number} [width=32] - The width of the Render Texture. + * @param {number} [height=32] - The height of the Render Texture. * @property {string} [key] - The texture key to make the RenderTexture from. * @property {string} [frame] - the frame to make the RenderTexture from. * diff --git a/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js b/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js index fe354aa34..814ecc257 100644 --- a/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js +++ b/src/gameobjects/rendertexture/RenderTextureWebGLRenderer.js @@ -22,17 +22,23 @@ var Utils = require('../../renderer/webgl/Utils'); */ var RenderTextureWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var frame = src.frame; - var width = frame.width; - var height = frame.height; - var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(src.pipeline, src); + var cameraAlpha = camera.alpha; - var textureUnit = pipeline.setTexture2D(frame.glTexture, src); + var renderTarget = src.renderTarget; + var width = renderTarget.width; + var height = renderTarget.height; + + var getTint = Utils.getTintAppendFloatAlpha; + + var pipeline = renderer.pipelines.set(src.pipeline); + + var textureUnit = pipeline.setTexture2D(renderTarget.texture); + + renderer.pipelines.preBatch(src); pipeline.batchTexture( src, - frame.glTexture, + renderTarget.texture, width, height, src.x, src.y, width, height, @@ -42,17 +48,21 @@ var RenderTextureWebGLRenderer = function (renderer, src, camera, parentMatrix) src.scrollFactorX, src.scrollFactorY, src.displayOriginX, src.displayOriginY, 0, 0, width, height, - getTint(src.tintTopLeft, camera.alpha * src._alphaTL), - getTint(src.tintTopRight, camera.alpha * src._alphaTR), - getTint(src.tintBottomLeft, camera.alpha * src._alphaBL), - getTint(src.tintBottomRight, camera.alpha * src._alphaBR), + getTint(src.tintTopLeft, cameraAlpha * src._alphaTL), + getTint(src.tintTopRight, cameraAlpha * src._alphaTR), + getTint(src.tintBottomLeft, cameraAlpha * src._alphaBL), + getTint(src.tintBottomRight, cameraAlpha * src._alphaBR), src.tintFill, 0, 0, camera, parentMatrix, - false, + true, textureUnit ); + + renderer.resetTextures(); + + renderer.pipelines.postBatch(src); }; module.exports = RenderTextureWebGLRenderer; diff --git a/src/gameobjects/rope/Rope.js b/src/gameobjects/rope/Rope.js index 1312f62b8..e0ddd5a47 100644 --- a/src/gameobjects/rope/Rope.js +++ b/src/gameobjects/rope/Rope.js @@ -49,8 +49,8 @@ var Vector2 = require('../../math/Vector2'); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {string} [texture] - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. If not given, `__DEFAULT` is used. - * @param {(string|integer|null)} [frame] - An optional frame from the Texture this Game Object is rendering with. - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. See `setPoints` to set this post-creation. + * @param {(string|number|null)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. See `setPoints` to set this post-creation. * @param {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? * @param {number[]} [colors] - An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. * @param {number[]} [alphas] - An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. @@ -88,7 +88,7 @@ var Rope = new Class({ * The Animation State of this Rope. * * @name Phaser.GameObjects.Rope#anims - * @type {Phaser.Animation.AnimationState} + * @type {Phaser.Animations.AnimationState} * @since 3.23.0 */ this.anims = new AnimationState(this); @@ -221,7 +221,7 @@ var Rope = new Class({ * Flipping always takes place from the middle of the texture and does not impact the scale value. * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. * - * @name Phaser.GameObjects.Rope#flipY + * @name Phaser.GameObjects.Rope#_flipY * @type {boolean} * @default false * @private @@ -333,7 +333,7 @@ var Rope = new Class({ * * @param {string} key - The string-based key of the animation to play. * @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call. - * @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index. + * @param {number} [startFrame=0] - Optionally start the animation playing from this frame index. * * @return {this} This Game Object. */ @@ -370,7 +370,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setHorizontal * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -399,7 +399,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setVertical * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided the current points length is used. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -667,7 +667,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#setPoints * @since 3.23.0 * - * @param {(integer|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. + * @param {(number|Phaser.Types.Math.Vector2Like[])} [points=2] - An array containing the vertices data for this Rope, or a number that indicates how many segments to split the texture frame into. If none is provided a simple quad is created. * @param {(number|number[])} [colors] - Either a single color value, or an array of values. * @param {(number|number[])} [alphas] - Either a single alpha value, or an array of values. * @@ -847,7 +847,7 @@ var Rope = new Class({ * @method Phaser.GameObjects.Rope#resizeArrays * @since 3.23.0 * - * @param {integer} newSize - The amount of segments to split the Rope in to. + * @param {number} newSize - The amount of segments to split the Rope in to. * * @return {this} This Game Object instance. */ @@ -1006,7 +1006,7 @@ var Rope = new Class({ * @since 3.23.0 * * @param {Phaser.GameObjects.Rope} src - The Rope object being rendered. - * @param {integer} meshLength - The number of vertices in the mesh. + * @param {number} meshLength - The number of vertices in the mesh. * @param {number[]} verts - An array of translated vertex coordinates. */ renderDebugVerts: function (src, meshLength, verts) diff --git a/src/gameobjects/rope/RopeCreator.js b/src/gameobjects/rope/RopeCreator.js index 0e6363714..263e29a71 100644 --- a/src/gameobjects/rope/RopeCreator.js +++ b/src/gameobjects/rope/RopeCreator.js @@ -43,6 +43,11 @@ GameObjectCreator.register('rope', function (config, addToScene) BuildGameObject(this.scene, rope, config); + if (!config.add) + { + this.updateList.add(rope); + } + return rope; }); diff --git a/src/gameobjects/rope/RopeFactory.js b/src/gameobjects/rope/RopeFactory.js index 9d15be0c8..0c6354bbc 100644 --- a/src/gameobjects/rope/RopeFactory.js +++ b/src/gameobjects/rope/RopeFactory.js @@ -19,7 +19,7 @@ var GameObjectFactory = require('../GameObjectFactory'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Math.Vector2Like[]} [points] - An array containing the vertices data for this Rope. If none is provided a simple quad is created. See `setPoints` to set this post-creation. * @param {boolean} [horizontal=true] - Should the vertices of this Rope be aligned horizontally (`true`), or vertically (`false`)? * @param {number[]} [colors] - An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. @@ -34,11 +34,3 @@ if (typeof WEBGL_RENDERER) return this.displayList.add(new Rope(this.scene, x, y, texture, frame, points, horizontal, colors, alphas)); }); } - -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/rope/RopeWebGLRenderer.js b/src/gameobjects/rope/RopeWebGLRenderer.js index d7432be08..b7fcf360b 100644 --- a/src/gameobjects/rope/RopeWebGLRenderer.js +++ b/src/gameobjects/rope/RopeWebGLRenderer.js @@ -41,12 +41,14 @@ var RopeWebGLRenderer = function (renderer, src, camera, parentMatrix) // Because it's a triangle strip and we don't want lots of degenerate triangles joining things up pipeline.flush(); + renderer.pipelines.preBatch(src); + var textureUnit = pipeline.setGameObject(src); var vertexViewF32 = pipeline.vertexViewF32; var vertexViewU32 = pipeline.vertexViewU32; - var vertexOffset = (pipeline.vertexCount * pipeline.vertexComponentCount) - 1; + var vertexOffset = (pipeline.vertexCount * pipeline.currentShader.vertexComponentCount) - 1; var colorIndex = 0; @@ -97,6 +99,8 @@ var RopeWebGLRenderer = function (renderer, src, camera, parentMatrix) } pipeline.vertexCount += vertexCount; + + renderer.pipelines.postBatch(src); }; module.exports = RopeWebGLRenderer; diff --git a/src/gameobjects/shader/Shader.js b/src/gameobjects/shader/Shader.js index 1e0318ddb..2947689d0 100644 --- a/src/gameobjects/shader/Shader.js +++ b/src/gameobjects/shader/Shader.js @@ -110,7 +110,7 @@ var Shader = new Class({ * This Game Object cannot have a blend mode, so skip all checks. * * @name Phaser.GameObjects.Shader#blendMode - * @type {integer} + * @type {number} * @private * @since 3.17.0 */ @@ -504,9 +504,9 @@ var Shader = new Class({ var program = renderer.createProgram(this.shader.vertexSrc, this.shader.fragmentSrc); // The default uniforms available within the vertex shader - renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); - renderer.setFloat2(program, 'uResolution', this.width, this.height); + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uViewMatrix'), false, this.viewMatrix); + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uProjectionMatrix'), false, this.projectionMatrix); + gl.uniform2f(gl.getUniformLocation(program, 'uResolution'), this.width, this.height); this.program = program; @@ -602,7 +602,12 @@ var Shader = new Class({ var program = this.program; - this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); + var gl = this.gl; + var renderer = this.renderer; + + renderer.setProgram(program); + + gl.uniformMatrix4fv(gl.getUniformLocation(program, 'uProjectionMatrix'), false, this.projectionMatrix); this._rendererWidth = right; this._rendererHeight = bottom; @@ -668,9 +673,9 @@ var Shader = new Class({ * * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. * @param {WebGLTexture} texture - A WebGLTexture reference. - * @param {integer} width - The width of the texture. - * @param {integer} height - The height of the texture. - * @param {integer} [textureIndex=0] - The texture index. + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} [textureIndex=0] - The texture index. * @param {any} [textureData] - Additional texture data. * * @return {this} This Shader instance. @@ -709,7 +714,7 @@ var Shader = new Class({ * * @param {string} uniformKey - The key of the sampler2D uniform to be updated, i.e. `iChannel0`. * @param {string} textureKey - The key of the texture, as stored in the Texture Manager. Must already be loaded. - * @param {integer} [textureIndex=0] - The texture index. + * @param {number} [textureIndex=0] - The texture index. * @param {any} [textureData] - Additional texture data. * * @return {this} This Shader instance. @@ -723,6 +728,12 @@ var Shader = new Class({ if (textureManager.exists(textureKey)) { var frame = textureManager.getFrame(textureKey); + + if (frame.glTexture && frame.glTexture.isRenderTexture) + { + return this.setSampler2DBuffer(uniformKey, frame.glTexture, frame.width, frame.height, textureIndex, textureData); + } + var uniform = this.uniforms[uniformKey]; var source = frame.source; @@ -903,7 +914,7 @@ var Shader = new Class({ var data = uniform.textureData; - if (data) + if (data && !uniform.value.isRenderTexture) { // https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D @@ -1012,7 +1023,7 @@ var Shader = new Class({ } else if (uniform.type === 'sampler2D') { - gl.activeTexture(gl['TEXTURE' + textureCount]); + gl.activeTexture(gl.TEXTURE0 + textureCount); gl.bindTexture(gl.TEXTURE_2D, value); diff --git a/src/gameobjects/shape/FillPathWebGL.js b/src/gameobjects/shape/FillPathWebGL.js index 47161624f..66841f6f6 100644 --- a/src/gameobjects/shape/FillPathWebGL.js +++ b/src/gameobjects/shape/FillPathWebGL.js @@ -49,9 +49,7 @@ var FillPathWebGL = function (pipeline, calcMatrix, src, alpha, dx, dy) var tx2 = calcMatrix.getX(x2, y2); var ty2 = calcMatrix.getY(x2, y2); - pipeline.setTexture2D(); - - pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, 0, 0, 1, 1, fillTintColor, fillTintColor, fillTintColor, pipeline.tintEffect); + pipeline.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, fillTintColor, fillTintColor, fillTintColor); } }; diff --git a/src/gameobjects/shape/Shape.js b/src/gameobjects/shape/Shape.js index d7ecf6384..ae460ba5c 100644 --- a/src/gameobjects/shape/Shape.js +++ b/src/gameobjects/shape/Shape.js @@ -8,6 +8,7 @@ var Class = require('../../utils/Class'); var Components = require('../components'); var GameObject = require('../GameObject'); var Line = require('../../geom/line/Line'); +var PIPELINES_CONST = require('../../renderer/webgl/pipelines/const'); /** * @classdesc @@ -85,7 +86,7 @@ var Shape = new Class({ * Holds the earcut polygon path index data for filled rendering. * * @name Phaser.GameObjects.Shape#pathIndexes - * @type {integer[]} + * @type {number[]} * @readonly * @since 3.13.0 */ @@ -203,7 +204,7 @@ var Shape = new Class({ */ this.height = 0; - this.initPipeline(); + this.initPipeline(PIPELINES_CONST.GRAPHICS_PIPELINE); }, /** diff --git a/src/gameobjects/shape/StrokePathWebGL.js b/src/gameobjects/shape/StrokePathWebGL.js index 7c3f5942e..f4864ba08 100644 --- a/src/gameobjects/shape/StrokePathWebGL.js +++ b/src/gameobjects/shape/StrokePathWebGL.js @@ -47,8 +47,6 @@ var StrokePathWebGL = function (pipeline, src, alpha, dx, dy) var px2 = path[i] - dx; var py2 = path[i + 1] - dy; - pipeline.setTexture2D(); - pipeline.batchLine( px1, py1, diff --git a/src/gameobjects/shape/arc/Arc.js b/src/gameobjects/shape/arc/Arc.js index ee80e43a7..4cf3b1a9d 100644 --- a/src/gameobjects/shape/arc/Arc.js +++ b/src/gameobjects/shape/arc/Arc.js @@ -40,8 +40,8 @@ var Shape = require('../Shape'); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {number} [radius=128] - The radius of the arc. - * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. - * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {number} [startAngle=0] - The start angle of the arc, in degrees. + * @param {number} [endAngle=360] - The end angle of the arc, in degrees. * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. @@ -71,7 +71,7 @@ var Arc = new Class({ * Private internal value. Holds the start angle in degrees. * * @name Phaser.GameObjects.Arc#_startAngle - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -81,7 +81,7 @@ var Arc = new Class({ * Private internal value. Holds the end angle in degrees. * * @name Phaser.GameObjects.Arc#_endAngle - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -178,7 +178,7 @@ var Arc = new Class({ * The start angle of the arc, in degrees. * * @name Phaser.GameObjects.Arc#startAngle - * @type {integer} + * @type {number} * @since 3.13.0 */ startAngle: { @@ -201,7 +201,7 @@ var Arc = new Class({ * The end angle of the arc, in degrees. * * @name Phaser.GameObjects.Arc#endAngle - * @type {integer} + * @type {number} * @since 3.13.0 */ endAngle: { @@ -290,7 +290,7 @@ var Arc = new Class({ * @method Phaser.GameObjects.Arc#setStartAngle * @since 3.13.0 * - * @param {integer} value - The value to set the starting angle to. + * @param {number} value - The value to set the starting angle to. * * @return {this} This Game Object instance. */ @@ -313,7 +313,7 @@ var Arc = new Class({ * @method Phaser.GameObjects.Arc#setEndAngle * @since 3.13.0 * - * @param {integer} value - The value to set the ending angle to. + * @param {number} value - The value to set the ending angle to. * * @return {this} This Game Object instance. */ diff --git a/src/gameobjects/shape/arc/ArcFactory.js b/src/gameobjects/shape/arc/ArcFactory.js index aa760a132..00a1158ee 100644 --- a/src/gameobjects/shape/arc/ArcFactory.js +++ b/src/gameobjects/shape/arc/ArcFactory.js @@ -30,8 +30,8 @@ var GameObjectFactory = require('../../GameObjectFactory'); * @param {number} [x=0] - The horizontal position of this Game Object in the world. * @param {number} [y=0] - The vertical position of this Game Object in the world. * @param {number} [radius=128] - The radius of the arc. - * @param {integer} [startAngle=0] - The start angle of the arc, in degrees. - * @param {integer} [endAngle=360] - The end angle of the arc, in degrees. + * @param {number} [startAngle=0] - The start angle of the arc, in degrees. + * @param {number} [endAngle=360] - The end angle of the arc, in degrees. * @param {boolean} [anticlockwise=false] - The winding order of the start and end angles. * @param {number} [fillColor] - The color the arc will be filled with, i.e. 0xff0000 for red. * @param {number} [fillAlpha] - The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. diff --git a/src/gameobjects/shape/arc/ArcWebGLRenderer.js b/src/gameobjects/shape/arc/ArcWebGLRenderer.js index 3f317ada5..534183727 100644 --- a/src/gameobjects/shape/arc/ArcWebGLRenderer.js +++ b/src/gameobjects/shape/arc/ArcWebGLRenderer.js @@ -24,17 +24,19 @@ var StrokePathWebGL = require('../StrokePathWebGL'); */ var ArcWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -44,6 +46,8 @@ var ArcWebGLRenderer = function (renderer, src, camera, parentMatrix) { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = ArcWebGLRenderer; diff --git a/src/gameobjects/shape/curve/Curve.js b/src/gameobjects/shape/curve/Curve.js index b4c7342bd..3155e4053 100644 --- a/src/gameobjects/shape/curve/Curve.js +++ b/src/gameobjects/shape/curve/Curve.js @@ -62,7 +62,7 @@ var Curve = new Class({ * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. * * @name Phaser.GameObjects.Curve#_smoothness - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -96,7 +96,7 @@ var Curve = new Class({ * Increase this value for smoother curves, at the cost of more polygons being rendered. * * @name Phaser.GameObjects.Curve#smoothness - * @type {integer} + * @type {number} * @default 32 * @since 3.13.0 */ @@ -124,7 +124,7 @@ var Curve = new Class({ * @method Phaser.GameObjects.Curve#setSmoothness * @since 3.13.0 * - * @param {integer} value - The value to set the smoothness to. + * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. */ diff --git a/src/gameobjects/shape/curve/CurveWebGLRenderer.js b/src/gameobjects/shape/curve/CurveWebGLRenderer.js index f085d7612..89a75ea8d 100644 --- a/src/gameobjects/shape/curve/CurveWebGLRenderer.js +++ b/src/gameobjects/shape/curve/CurveWebGLRenderer.js @@ -24,17 +24,19 @@ var StrokePathWebGL = require('../StrokePathWebGL'); */ var CurveWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX + src._curveBounds.x; var dy = src._displayOriginY + src._curveBounds.y; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -44,6 +46,8 @@ var CurveWebGLRenderer = function (renderer, src, camera, parentMatrix) { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = CurveWebGLRenderer; diff --git a/src/gameobjects/shape/ellipse/Ellipse.js b/src/gameobjects/shape/ellipse/Ellipse.js index 793fefdef..435dfed8e 100644 --- a/src/gameobjects/shape/ellipse/Ellipse.js +++ b/src/gameobjects/shape/ellipse/Ellipse.js @@ -66,7 +66,7 @@ var Ellipse = new Class({ * The number of points used to draw the curve. Higher values create smoother renders at the cost of more triangles being drawn. * * @name Phaser.GameObjects.Ellipse#_smoothness - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -91,7 +91,7 @@ var Ellipse = new Class({ * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. * * @name Phaser.GameObjects.Ellipse#smoothness - * @type {integer} + * @type {number} * @default 64 * @since 3.13.0 */ @@ -125,6 +125,9 @@ var Ellipse = new Class({ */ setSize: function (width, height) { + this.width = width; + this.height = height; + this.geom.setPosition(width / 2, height / 2); this.geom.setSize(width, height); return this.updateData(); @@ -138,7 +141,7 @@ var Ellipse = new Class({ * @method Phaser.GameObjects.Ellipse#setSmoothness * @since 3.13.0 * - * @param {integer} value - The value to set the smoothness to. + * @param {number} value - The value to set the smoothness to. * * @return {this} This Game Object instance. */ diff --git a/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js b/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js index cef73da39..0d6105709 100644 --- a/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js +++ b/src/gameobjects/shape/ellipse/EllipseWebGLRenderer.js @@ -24,17 +24,19 @@ var StrokePathWebGL = require('../StrokePathWebGL'); */ var EllipseWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -44,6 +46,8 @@ var EllipseWebGLRenderer = function (renderer, src, camera, parentMatrix) { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = EllipseWebGLRenderer; diff --git a/src/gameobjects/shape/grid/Grid.js b/src/gameobjects/shape/grid/Grid.js index 9571a598f..3158881df 100644 --- a/src/gameobjects/shape/grid/Grid.js +++ b/src/gameobjects/shape/grid/Grid.js @@ -152,7 +152,11 @@ var Grid = new Class({ this.setSize(width, height); this.setFillStyle(fillColor, fillAlpha); - this.setOutlineStyle(outlineFillColor, outlineFillAlpha); + + if (outlineFillColor !== undefined) + { + this.setOutlineStyle(outlineFillColor, outlineFillAlpha); + } this.updateDisplayOrigin(); }, diff --git a/src/gameobjects/shape/grid/GridWebGLRenderer.js b/src/gameobjects/shape/grid/GridWebGLRenderer.js index e566cc386..54aa57612 100644 --- a/src/gameobjects/shape/grid/GridWebGLRenderer.js +++ b/src/gameobjects/shape/grid/GridWebGLRenderer.js @@ -23,11 +23,11 @@ var Utils = require('../../../renderer/webgl/Utils'); */ var GridWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); calcMatrix.translate(-src._displayOriginX, -src._displayOriginY); @@ -63,8 +63,6 @@ var GridWebGLRenderer = function (renderer, src, camera, parentMatrix) var cw = 0; var ch = 0; - pipeline.setTexture2D(); - if (showOutline) { // To make room for the grid lines (in case alpha < 1) @@ -82,6 +80,8 @@ var GridWebGLRenderer = function (renderer, src, camera, parentMatrix) } } + renderer.pipelines.preBatch(src); + if (showCells && src.fillAlpha > 0) { fillTint = pipeline.fillTint; @@ -186,6 +186,8 @@ var GridWebGLRenderer = function (renderer, src, camera, parentMatrix) pipeline.batchLine(0, y1, width, y1, 1, 1, 1, 0, false); } } + + renderer.pipelines.postBatch(src); }; module.exports = GridWebGLRenderer; diff --git a/src/gameobjects/shape/isobox/IsoBox.js b/src/gameobjects/shape/isobox/IsoBox.js index 8e6bd80e3..ec0adb8ac 100644 --- a/src/gameobjects/shape/isobox/IsoBox.js +++ b/src/gameobjects/shape/isobox/IsoBox.js @@ -65,7 +65,7 @@ var IsoBox = new Class({ * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. * * @name Phaser.GameObjects.IsoBox#projection - * @type {integer} + * @type {number} * @default 4 * @since 3.13.0 */ @@ -143,7 +143,7 @@ var IsoBox = new Class({ * @method Phaser.GameObjects.IsoBox#setProjection * @since 3.13.0 * - * @param {integer} value - The value to set the projection to. + * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. */ diff --git a/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js b/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js index a1891f998..b5fd57195 100644 --- a/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js +++ b/src/gameobjects/shape/isobox/IsoBoxWebGLRenderer.js @@ -23,11 +23,11 @@ var Utils = require('../../../renderer/webgl/Utils'); */ var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var size = src.width; var height = src.height; @@ -56,7 +56,8 @@ var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) var x3; var y3; - pipeline.setTexture2D(); + + renderer.pipelines.preBatch(src); // Top Face @@ -76,7 +77,7 @@ var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) x3 = calcMatrix.getX(0, sizeB - height); y3 = calcMatrix.getY(0, sizeB - height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 1); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Left Face @@ -97,7 +98,7 @@ var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) x3 = calcMatrix.getX(-sizeA, -height); y3 = calcMatrix.getY(-sizeA, -height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 1); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Right Face @@ -118,8 +119,10 @@ var IsoBoxWebGLRenderer = function (renderer, src, camera, parentMatrix) x3 = calcMatrix.getX(sizeA, -height); y3 = calcMatrix.getY(sizeA, -height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 1); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } + + renderer.pipelines.postBatch(src); }; module.exports = IsoBoxWebGLRenderer; diff --git a/src/gameobjects/shape/isotriangle/IsoTriangle.js b/src/gameobjects/shape/isotriangle/IsoTriangle.js index 8df8346dd..dfac84dc1 100644 --- a/src/gameobjects/shape/isotriangle/IsoTriangle.js +++ b/src/gameobjects/shape/isotriangle/IsoTriangle.js @@ -68,7 +68,7 @@ var IsoTriangle = new Class({ * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. * * @name Phaser.GameObjects.IsoTriangle#projection - * @type {integer} + * @type {number} * @default 4 * @since 3.13.0 */ @@ -156,7 +156,7 @@ var IsoTriangle = new Class({ * @method Phaser.GameObjects.IsoTriangle#setProjection * @since 3.13.0 * - * @param {integer} value - The value to set the projection to. + * @param {number} value - The value to set the projection to. * * @return {this} This Game Object instance. */ diff --git a/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js b/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js index f475b060c..40cf34354 100644 --- a/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js +++ b/src/gameobjects/shape/isotriangle/IsoTriangleWebGLRenderer.js @@ -23,11 +23,11 @@ var Utils = require('../../../renderer/webgl/Utils'); */ var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var size = src.width; var height = src.height; @@ -44,6 +44,8 @@ var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) return; } + renderer.pipelines.preBatch(src); + var tint; var x0; @@ -55,8 +57,6 @@ var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) var x2; var y2; - pipeline.setTexture2D(); - // Top Face if (src.showTop && reversed) @@ -75,7 +75,7 @@ var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) var x3 = calcMatrix.getX(0, sizeB - height); var y3 = calcMatrix.getY(0, sizeB - height); - pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, 0, 0, 1, 1, tint, tint, tint, tint, 1); + pipeline.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint, tint, tint, tint); } // Left Face @@ -107,7 +107,7 @@ var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) y2 = calcMatrix.getY(0, sizeB - height); } - pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 1); + pipeline.batchTri(x0, y0, x1, y1, x2, y2, tint, tint, tint); } // Right Face @@ -139,8 +139,10 @@ var IsoTriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) y2 = calcMatrix.getY(0, sizeB - height); } - pipeline.batchTri(x0, y0, x1, y1, x2, y2, 0, 0, 1, 1, tint, tint, tint, 1); + pipeline.batchTri(x0, y0, x1, y1, x2, y2, tint, tint, tint); } + + renderer.pipelines.postBatch(src); }; module.exports = IsoTriangleWebGLRenderer; diff --git a/src/gameobjects/shape/line/Line.js b/src/gameobjects/shape/line/Line.js index 38296113d..9fe623ab2 100644 --- a/src/gameobjects/shape/line/Line.js +++ b/src/gameobjects/shape/line/Line.js @@ -15,13 +15,13 @@ var LineRender = require('./LineRender'); * treat it like any other Game Object in your game, such as tweening it, scaling it, or enabling * it for input or physics. It provides a quick and easy way for you to render this shape in your * game without using a texture, while still taking advantage of being fully batched in WebGL. - * + * * This shape supports only stroke colors and cannot be filled. - * + * * A Line Shape allows you to draw a line between two points in your game. You can control the * stroke color and thickness of the line. In WebGL only you can also specify a different * thickness for the start and end of the line, allowing you to render lines that taper-off. - * + * * If you need to draw multiple lines in a sequence you may wish to use the Polygon Shape instead. * * Be aware that as with all Game Objects the default origin is 0.5. If you need to draw a Line @@ -64,8 +64,8 @@ var Line = new Class({ Shape.call(this, scene, 'Line', new GeomLine(x1, y1, x2, y2)); - var width = this.geom.right - this.geom.left; - var height = this.geom.bottom - this.geom.top; + var width = Math.max(1, this.geom.right - this.geom.left); + var height = Math.max(1, this.geom.bottom - this.geom.top); /** * The width (or thickness) of the line. @@ -110,15 +110,15 @@ var Line = new Class({ /** * Sets the width of the line. - * + * * When using the WebGL renderer you can have different start and end widths. * When using the Canvas renderer only the `startWidth` value is used. The `endWidth` is ignored. - * + * * This call can be chained. * * @method Phaser.GameObjects.Line#setLineWidth * @since 3.13.0 - * + * * @param {number} startWidth - The start width of the line. * @param {number} [endWidth] - The end width of the line. Only used in WebGL. * diff --git a/src/gameobjects/shape/line/LineWebGLRenderer.js b/src/gameobjects/shape/line/LineWebGLRenderer.js index b5b350cf7..900d61b30 100644 --- a/src/gameobjects/shape/line/LineWebGLRenderer.js +++ b/src/gameobjects/shape/line/LineWebGLRenderer.js @@ -23,16 +23,18 @@ var Utils = require('../../../renderer/webgl/Utils'); */ var LineWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - pipeline._tempMatrix3.copyFrom(result.calc); + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isStroked) { var strokeTint = pipeline.strokeTint; @@ -46,8 +48,6 @@ var LineWebGLRenderer = function (renderer, src, camera, parentMatrix) var startWidth = src._startWidth; var endWidth = src._endWidth; - pipeline.setTexture2D(); - pipeline.batchLine( src.geom.x1 - dx, src.geom.y1 - dy, @@ -62,6 +62,8 @@ var LineWebGLRenderer = function (renderer, src, camera, parentMatrix) result.camera ); } + + renderer.pipelines.postBatch(src); }; module.exports = LineWebGLRenderer; diff --git a/src/gameobjects/shape/polygon/Polygon.js b/src/gameobjects/shape/polygon/Polygon.js index 971ead967..f94d1217c 100644 --- a/src/gameobjects/shape/polygon/Polygon.js +++ b/src/gameobjects/shape/polygon/Polygon.js @@ -85,7 +85,7 @@ var Polygon = new Class({ * @method Phaser.GameObjects.Polygon#smooth * @since 3.13.0 * - * @param {integer} [iterations=1] - The number of times to apply the polygon smoothing. + * @param {number} [iterations=1] - The number of times to apply the polygon smoothing. * * @return {this} This Game Object instance. */ diff --git a/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js b/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js index f4503897c..6d48fe59f 100644 --- a/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js +++ b/src/gameobjects/shape/polygon/PolygonWebGLRenderer.js @@ -24,17 +24,19 @@ var StrokePathWebGL = require('../StrokePathWebGL'); */ var PolygonWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -44,6 +46,8 @@ var PolygonWebGLRenderer = function (renderer, src, camera, parentMatrix) { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = PolygonWebGLRenderer; diff --git a/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js b/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js index 4664eed57..27fa19465 100644 --- a/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js +++ b/src/gameobjects/shape/rectangle/RectangleWebGLRenderer.js @@ -24,16 +24,18 @@ var Utils = require('../../../renderer/webgl/Utils'); */ var RectangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - pipeline._tempMatrix3.copyFrom(result.calc); + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { var fillTint = pipeline.fillTint; @@ -44,8 +46,6 @@ var RectangleWebGLRenderer = function (renderer, src, camera, parentMatrix) fillTint.BL = fillTintColor; fillTint.BR = fillTintColor; - pipeline.setTexture2D(); - pipeline.batchFillRect( -dx, -dy, @@ -58,6 +58,8 @@ var RectangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = RectangleWebGLRenderer; diff --git a/src/gameobjects/shape/star/Star.js b/src/gameobjects/shape/star/Star.js index a0bd489b6..1fb01e525 100644 --- a/src/gameobjects/shape/star/Star.js +++ b/src/gameobjects/shape/star/Star.js @@ -66,7 +66,7 @@ var Star = new Class({ * The number of points in the star. * * @name Phaser.GameObjects.Star#_points - * @type {integer} + * @type {number} * @private * @since 3.13.0 */ @@ -113,7 +113,7 @@ var Star = new Class({ * @method Phaser.GameObjects.Star#setPoints * @since 3.13.0 * - * @param {integer} value - The amount of points the Star will have. + * @param {number} value - The amount of points the Star will have. * * @return {this} This Game Object instance. */ @@ -164,7 +164,7 @@ var Star = new Class({ * The number of points that make up the Star shape. * * @name Phaser.GameObjects.Star#points - * @type {integer} + * @type {number} * @default 5 * @since 3.13.0 */ diff --git a/src/gameobjects/shape/star/StarWebGLRenderer.js b/src/gameobjects/shape/star/StarWebGLRenderer.js index e8aa708f9..1e06618d1 100644 --- a/src/gameobjects/shape/star/StarWebGLRenderer.js +++ b/src/gameobjects/shape/star/StarWebGLRenderer.js @@ -24,17 +24,19 @@ var StrokePathWebGL = require('../StrokePathWebGL'); */ var StarWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - var calcMatrix = pipeline._tempMatrix3.copyFrom(result.calc); + var calcMatrix = pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { FillPathWebGL(pipeline, calcMatrix, src, alpha, dx, dy); @@ -44,6 +46,8 @@ var StarWebGLRenderer = function (renderer, src, camera, parentMatrix) { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = StarWebGLRenderer; diff --git a/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js b/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js index 88317db16..685a71329 100644 --- a/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js +++ b/src/gameobjects/shape/triangle/TriangleWebGLRenderer.js @@ -24,16 +24,18 @@ var Utils = require('../../../renderer/webgl/Utils'); */ var TriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { - var pipeline = renderer.pipelines.set(this.pipeline); + var pipeline = renderer.pipelines.set(src.pipeline); var result = GetCalcMatrix(src, camera, parentMatrix); - pipeline._tempMatrix3.copyFrom(result.calc); + pipeline.calcMatrix.copyFrom(result.calc); var dx = src._displayOriginX; var dy = src._displayOriginY; var alpha = camera.alpha * src.alpha; + renderer.pipelines.preBatch(src); + if (src.isFilled) { var fillTint = pipeline.fillTint; @@ -51,8 +53,6 @@ var TriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) var x3 = src.geom.x3 - dx; var y3 = src.geom.y3 - dy; - pipeline.setTexture2D(); - pipeline.batchFillTriangle( x1, y1, @@ -69,6 +69,8 @@ var TriangleWebGLRenderer = function (renderer, src, camera, parentMatrix) { StrokePathWebGL(pipeline, src, alpha, dx, dy); } + + renderer.pipelines.postBatch(src); }; module.exports = TriangleWebGLRenderer; diff --git a/src/gameobjects/sprite/Sprite.js b/src/gameobjects/sprite/Sprite.js index 35b4d64c8..6b4fd994b 100644 --- a/src/gameobjects/sprite/Sprite.js +++ b/src/gameobjects/sprite/Sprite.js @@ -48,7 +48,7 @@ var SpriteRender = require('./SpriteRender'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var Sprite = new Class({ @@ -284,12 +284,12 @@ var Sprite = new Class({ * * Prior to Phaser 3.50 this method was called 'delayedPlay'. * - * @method Phaser.GameObjects.Components.Animation#playAfterDelay + * @method Phaser.GameObjects.Sprite#playAfterDelay * @fires Phaser.Animations.Events#ANIMATION_START * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} delay - The delay, in milliseconds, to wait before starting the animation playing. + * @param {number} delay - The delay, in milliseconds, to wait before starting the animation playing. * * @return {this} This Game Object. */ @@ -311,12 +311,12 @@ var Sprite = new Class({ * locally within the Sprite. If it can, it will play the local animation. If not, it will then * search the global Animation Manager and look for it there. * - * @method Phaser.GameObjects.Components.Animation#playAfterRepeat + * @method Phaser.GameObjects.Sprite#playAfterRepeat * @fires Phaser.Animations.Events#ANIMATION_START * @since 3.50.0 * * @param {(string|Phaser.Animations.Animation|Phaser.Types.Animations.PlayAnimationConfig)} key - The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. - * @param {integer} [repeatCount=1] - How many times should the animation repeat before the next one starts? + * @param {number} [repeatCount=1] - How many times should the animation repeat before the next one starts? * * @return {this} This Game Object. */ @@ -389,7 +389,7 @@ var Sprite = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.50.0 * - * @param {integer} delay - The number of milliseconds to wait before stopping this animation. + * @param {number} delay - The number of milliseconds to wait before stopping this animation. * * @return {this} This Game Object. */ @@ -412,7 +412,7 @@ var Sprite = new Class({ * @fires Phaser.Animations.Events#ANIMATION_STOP * @since 3.50.0 * - * @param {integer} [repeatCount=1] - How many times should the animation repeat before stopping? + * @param {number} [repeatCount=1] - How many times should the animation repeat before stopping? * * @return {this} This Game Object. */ diff --git a/src/gameobjects/sprite/SpriteFactory.js b/src/gameobjects/sprite/SpriteFactory.js index d925e3933..72f3e2ad2 100644 --- a/src/gameobjects/sprite/SpriteFactory.js +++ b/src/gameobjects/sprite/SpriteFactory.js @@ -18,7 +18,7 @@ var Sprite = require('./Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.Sprite} The Game Object that was created. */ diff --git a/src/gameobjects/sprite/SpriteWebGLRenderer.js b/src/gameobjects/sprite/SpriteWebGLRenderer.js index 4923a9c2b..4d6422eb6 100644 --- a/src/gameobjects/sprite/SpriteWebGLRenderer.js +++ b/src/gameobjects/sprite/SpriteWebGLRenderer.js @@ -20,7 +20,7 @@ */ var SpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) { - this.pipeline.batchSprite(src, camera, parentMatrix); + src.pipeline.batchSprite(src, camera, parentMatrix); }; module.exports = SpriteWebGLRenderer; diff --git a/src/gameobjects/text/static/Text.js b/src/gameobjects/text/Text.js similarity index 98% rename from src/gameobjects/text/static/Text.js rename to src/gameobjects/text/Text.js index fa46cd6dc..ba7e483a2 100644 --- a/src/gameobjects/text/static/Text.js +++ b/src/gameobjects/text/Text.js @@ -4,17 +4,17 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var AddToDOM = require('../../../dom/AddToDOM'); -var CanvasPool = require('../../../display/canvas/CanvasPool'); -var Class = require('../../../utils/Class'); -var Components = require('../../components'); -var GameEvents = require('../../../core/events'); -var GameObject = require('../../GameObject'); -var GetTextSize = require('../GetTextSize'); -var GetValue = require('../../../utils/object/GetValue'); -var RemoveFromDOM = require('../../../dom/RemoveFromDOM'); +var AddToDOM = require('../../dom/AddToDOM'); +var CanvasPool = require('../../display/canvas/CanvasPool'); +var Class = require('../../utils/Class'); +var Components = require('../components'); +var GameEvents = require('../../core/events'); +var GameObject = require('../GameObject'); +var GetTextSize = require('./GetTextSize'); +var GetValue = require('../../utils/object/GetValue'); +var RemoveFromDOM = require('../../dom/RemoveFromDOM'); var TextRender = require('./TextRender'); -var TextStyle = require('../TextStyle'); +var TextStyle = require('./TextStyle'); /** * @classdesc @@ -120,7 +120,7 @@ var Text = new Class({ * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} * @since 3.12.0 */ - this.renderer = scene.sys.game.renderer; + this.renderer = scene.sys.renderer; this.setPosition(x, y); this.setOrigin(0, 0); @@ -520,7 +520,12 @@ var Text = new Class({ { var word = words[j]; var wordWidth = context.measureText(word).width; - var wordWidthWithSpace = wordWidth + whiteSpaceWidth; + var wordWidthWithSpace = wordWidth; + + if (j < lastWordIndex) + { + wordWidthWithSpace += whiteSpaceWidth; + } if (wordWidthWithSpace > spaceLeft) { @@ -1083,7 +1088,7 @@ var Text = new Class({ * @method Phaser.GameObjects.Text#setMaxLines * @since 3.0.0 * - * @param {integer} [max=0] - The maximum number of lines to draw. + * @param {number} [max=0] - The maximum number of lines to draw. * * @return {this} This Text object. */ diff --git a/src/gameobjects/text/static/TextCanvasRenderer.js b/src/gameobjects/text/TextCanvasRenderer.js similarity index 100% rename from src/gameobjects/text/static/TextCanvasRenderer.js rename to src/gameobjects/text/TextCanvasRenderer.js diff --git a/src/gameobjects/text/static/TextCreator.js b/src/gameobjects/text/TextCreator.js similarity index 93% rename from src/gameobjects/text/static/TextCreator.js rename to src/gameobjects/text/TextCreator.js index ea74c431f..761efb9ef 100644 --- a/src/gameobjects/text/static/TextCreator.js +++ b/src/gameobjects/text/TextCreator.js @@ -4,9 +4,9 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BuildGameObject = require('../../BuildGameObject'); -var GameObjectCreator = require('../../GameObjectCreator'); -var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue'); +var BuildGameObject = require('../BuildGameObject'); +var GameObjectCreator = require('../GameObjectCreator'); +var GetAdvancedValue = require('../../utils/object/GetAdvancedValue'); var Text = require('./Text'); /** diff --git a/src/gameobjects/text/static/TextFactory.js b/src/gameobjects/text/TextFactory.js similarity index 97% rename from src/gameobjects/text/static/TextFactory.js rename to src/gameobjects/text/TextFactory.js index 9b71edd86..9ee74ab31 100644 --- a/src/gameobjects/text/static/TextFactory.js +++ b/src/gameobjects/text/TextFactory.js @@ -5,17 +5,17 @@ */ var Text = require('./Text'); -var GameObjectFactory = require('../../GameObjectFactory'); +var GameObjectFactory = require('../GameObjectFactory'); /** * Creates a new Text Game Object and adds it to the Scene. - * + * * A Text Game Object. - * + * * Text objects work by creating their own internal hidden Canvas and then renders text to it using * the standard Canvas `fillText` API. It then creates a texture from this canvas which is rendered * to your game during the render pass. - * + * * Because it uses the Canvas API you can take advantage of all the features this offers, such as * applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts * loaded externally, such as Google or TypeKit Web fonts. @@ -26,7 +26,7 @@ var GameObjectFactory = require('../../GameObjectFactory'); * * See {@link http://www.jordanm.co.uk/tinytype this compatibility table} for the available default fonts * across mobile browsers. - * + * * A note on performance: Every time the contents of a Text object changes, i.e. changing the text being * displayed, or the style of the text, it needs to remake the Text canvas, and if on WebGL, re-upload the * new texture to the GPU. This can be an expensive operation if used often, or with large quantities of diff --git a/src/gameobjects/text/static/TextRender.js b/src/gameobjects/text/TextRender.js similarity index 80% rename from src/gameobjects/text/static/TextRender.js rename to src/gameobjects/text/TextRender.js index a48d3935f..0c58b8370 100644 --- a/src/gameobjects/text/static/TextRender.js +++ b/src/gameobjects/text/TextRender.js @@ -4,8 +4,8 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var renderWebGL = require('../../../utils/NOOP'); -var renderCanvas = require('../../../utils/NOOP'); +var renderWebGL = require('../../utils/NOOP'); +var renderCanvas = require('../../utils/NOOP'); if (typeof WEBGL_RENDERER) { diff --git a/src/gameobjects/text/TextStyle.js b/src/gameobjects/text/TextStyle.js index c844e2347..21f7a9a3b 100644 --- a/src/gameobjects/text/TextStyle.js +++ b/src/gameobjects/text/TextStyle.js @@ -213,7 +213,7 @@ var TextStyle = new Class({ * The maximum number of lines to draw. * * @name Phaser.GameObjects.TextStyle#maxLines - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -1030,7 +1030,7 @@ var TextStyle = new Class({ * @method Phaser.GameObjects.TextStyle#setMaxLines * @since 3.0.0 * - * @param {integer} [max=0] - The maximum number of lines to draw. + * @param {number} [max=0] - The maximum number of lines to draw. * * @return {Phaser.GameObjects.Text} The parent Text object. */ diff --git a/src/gameobjects/text/static/TextWebGLRenderer.js b/src/gameobjects/text/TextWebGLRenderer.js similarity index 91% rename from src/gameobjects/text/static/TextWebGLRenderer.js rename to src/gameobjects/text/TextWebGLRenderer.js index 7bfb562b1..ab43f5aa8 100644 --- a/src/gameobjects/text/static/TextWebGLRenderer.js +++ b/src/gameobjects/text/TextWebGLRenderer.js @@ -4,7 +4,7 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Utils = require('../../../renderer/webgl/Utils'); +var Utils = require('../../renderer/webgl/Utils'); /** * Renders this Game Object with the WebGL Renderer to the given Camera. @@ -31,10 +31,12 @@ var TextWebGLRenderer = function (renderer, src, camera, parentMatrix) var width = frame.width; var height = frame.height; var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var textureUnit = pipeline.setTexture2D(frame.glTexture, src); + renderer.pipelines.preBatch(src); + pipeline.batchTexture( src, frame.glTexture, @@ -58,6 +60,8 @@ var TextWebGLRenderer = function (renderer, src, camera, parentMatrix) false, textureUnit ); + + renderer.pipelines.postBatch(src); }; module.exports = TextWebGLRenderer; diff --git a/src/gameobjects/text/typedefs/TextStyle.js b/src/gameobjects/text/typedefs/TextStyle.js index d7fc5e526..67c6a096b 100644 --- a/src/gameobjects/text/typedefs/TextStyle.js +++ b/src/gameobjects/text/typedefs/TextStyle.js @@ -15,7 +15,7 @@ * @property {Phaser.Types.GameObjects.Text.TextShadow} [shadow] - The Text shadow configuration object. * @property {Phaser.Types.GameObjects.Text.TextPadding} [padding] - A Text Padding object. * @property {string} [align='left'] - The alignment of the Text. This only impacts multi-line text. Either `left`, `right`, `center` or `justify`. - * @property {integer} [maxLines=0] - The maximum number of lines to display within the Text object. + * @property {number} [maxLines=0] - The maximum number of lines to display within the Text object. * @property {number} [fixedWidth=0] - Force the Text object to have the exact width specified in this property. Leave as zero for it to change accordingly to content. * @property {number} [fixedHeight=0] - Force the Text object to have the exact height specified in this property. Leave as zero for it to change accordingly to content. * @property {number} [resolution=0] - Sets the resolution (DPI setting) of the Text object. Leave at zero for it to use the game resolution. diff --git a/src/gameobjects/tilesprite/TileSprite.js b/src/gameobjects/tilesprite/TileSprite.js index d58fd5a90..c1f902c97 100644 --- a/src/gameobjects/tilesprite/TileSprite.js +++ b/src/gameobjects/tilesprite/TileSprite.js @@ -26,10 +26,10 @@ var _FLAG = 8; // 1000 * * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` - * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will + * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs. - * + * * An important note about Tile Sprites and NPOT textures: Internally, TileSprite textures use GL_REPEAT to provide * seamless repeating of the textures. This, combined with the way in which the textures are handled in WebGL, means * they need to be POT (power-of-two) sizes in order to wrap. If you provide a NPOT (non power-of-two) texture to a @@ -64,10 +64,10 @@ var _FLAG = 8; // 1000 * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. - * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {number} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {number} height - The height of the Game Object. If zero it will use the size of the texture frame. * @param {string} textureKey - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frameKey] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frameKey] - An optional frame from the Texture this Game Object is rendering with. */ var TileSprite = new Class({ @@ -95,7 +95,7 @@ var TileSprite = new Class({ function TileSprite (scene, x, y, width, height, textureKey, frameKey) { - var renderer = scene.sys.game.renderer; + var renderer = scene.sys.renderer; GameObject.call(this, scene, 'TileSprite'); @@ -226,7 +226,7 @@ var TileSprite = new Class({ * The next power of two value from the width of the Fill Pattern frame. * * @name Phaser.GameObjects.TileSprite#potWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.potWidth = GetPowerOfTwo(displayFrame.width); @@ -235,7 +235,7 @@ var TileSprite = new Class({ * The next power of two value from the height of the Fill Pattern frame. * * @name Phaser.GameObjects.TileSprite#potHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.potHeight = GetPowerOfTwo(displayFrame.height); @@ -295,7 +295,7 @@ var TileSprite = new Class({ * @since 3.0.0 * * @param {string} key - The key of the texture to be used, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - The name or index of the frame within the Texture. + * @param {(string|number)} [frame] - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ @@ -316,7 +316,7 @@ var TileSprite = new Class({ * @method Phaser.GameObjects.TileSprite#setFrame * @since 3.0.0 * - * @param {(string|integer)} frame - The name or index of the frame within the Texture. + * @param {(string|number)} frame - The name or index of the frame within the Texture. * * @return {this} This Game Object instance. */ diff --git a/src/gameobjects/tilesprite/TileSpriteFactory.js b/src/gameobjects/tilesprite/TileSpriteFactory.js index ae80a41f1..2d74b4f4e 100644 --- a/src/gameobjects/tilesprite/TileSpriteFactory.js +++ b/src/gameobjects/tilesprite/TileSpriteFactory.js @@ -17,10 +17,10 @@ var GameObjectFactory = require('../GameObjectFactory'); * * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. - * @param {integer} width - The width of the Game Object. If zero it will use the size of the texture frame. - * @param {integer} height - The height of the Game Object. If zero it will use the size of the texture frame. + * @param {number} width - The width of the Game Object. If zero it will use the size of the texture frame. + * @param {number} height - The height of the Game Object. If zero it will use the size of the texture frame. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.GameObjects.TileSprite} The Game Object that was created. */ diff --git a/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js b/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js index c274178f1..7e731e9fa 100644 --- a/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js +++ b/src/gameobjects/tilesprite/TileSpriteWebGLRenderer.js @@ -31,9 +31,11 @@ var TileSpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) return; } + renderer.pipelines.preBatch(src); + var getTint = Utils.getTintAppendFloatAlpha; - var pipeline = renderer.pipelines.set(this.pipeline, src); + var pipeline = renderer.pipelines.set(src.pipeline, src); var textureUnit = pipeline.setTexture2D(src.fillPattern, src); @@ -61,6 +63,8 @@ var TileSpriteWebGLRenderer = function (renderer, src, camera, parentMatrix) false, textureUnit ); + + renderer.pipelines.postBatch(src); }; module.exports = TileSpriteWebGLRenderer; diff --git a/src/gameobjects/tilesprite/typedefs/TileSpriteConfig.js b/src/gameobjects/tilesprite/typedefs/TileSpriteConfig.js index 119c2d6d4..52474d666 100644 --- a/src/gameobjects/tilesprite/typedefs/TileSpriteConfig.js +++ b/src/gameobjects/tilesprite/typedefs/TileSpriteConfig.js @@ -5,8 +5,8 @@ * * @property {number} [x=0] - The x coordinate of the Tile Sprite. * @property {number} [y=0] - The y coordinate of the Tile Sprite. - * @property {integer} [width=512] - The width of the Tile Sprite. If zero it will use the size of the texture frame. - * @property {integer} [height=512] - The height of the Tile Sprite. If zero it will use the size of the texture frame. + * @property {number} [width=512] - The width of the Tile Sprite. If zero it will use the size of the texture frame. + * @property {number} [height=512] - The height of the Tile Sprite. If zero it will use the size of the texture frame. * @property {string} [key=''] - The key of the Texture this Tile Sprite will use to render with, as stored in the Texture Manager. * @property {string} [frame=''] - An optional frame from the Texture this Tile Sprite is rendering with. */ diff --git a/src/gameobjects/typedefs/JSONGameObject.js b/src/gameobjects/typedefs/JSONGameObject.js index 702341b86..7f95988b5 100644 --- a/src/gameobjects/typedefs/JSONGameObject.js +++ b/src/gameobjects/typedefs/JSONGameObject.js @@ -17,8 +17,8 @@ * @property {number} rotation - The angle of this Game Object in radians. * @property {number} alpha - The alpha value of the Game Object. * @property {boolean} visible - The visible state of the Game Object. - * @property {integer} scaleMode - The Scale Mode being used by this Game Object. - * @property {(integer|string)} blendMode - Sets the Blend Mode being used by this Game Object. + * @property {number} scaleMode - The Scale Mode being used by this Game Object. + * @property {(number|string)} blendMode - Sets the Blend Mode being used by this Game Object. * @property {string} textureKey - The texture key of this Game Object. * @property {string} frameKey - The frame key of this Game Object. * @property {object} data - The data of this Game Object. diff --git a/src/gameobjects/video/Video.js b/src/gameobjects/video/Video.js index b1154f385..c9966d5d0 100644 --- a/src/gameobjects/video/Video.js +++ b/src/gameobjects/video/Video.js @@ -45,7 +45,7 @@ var MATH_CONST = require('../../math/const'); * * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. * The policies that control autoplaying are vast and vary between browser. - * You can, ahd should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide + * You can, and should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, * and it will often allow the video to play immediately: @@ -208,7 +208,7 @@ var Video = new Class({ * state in this manner until the `retryLimit` is reached and then abort. * * @name Phaser.GameObjects.Video#retryLimit - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retryLimit = 20; @@ -217,7 +217,7 @@ var Video = new Class({ * The current retry attempt. * * @name Phaser.GameObjects.Video#retry - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retry = 0; @@ -226,7 +226,7 @@ var Video = new Class({ * The number of ms between each retry while monitoring the ready state of a downloading video. * * @name Phaser.GameObjects.Video#retryInterval - * @type {integer} + * @type {number} * @since 3.20.0 */ this.retryInterval = 500; @@ -235,7 +235,7 @@ var Video = new Class({ * The setTimeout callback ID. * * @name Phaser.GameObjects.Video#_retryID - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -321,7 +321,7 @@ var Video = new Class({ * The in marker. * * @name Phaser.GameObjects.Video#_markerIn - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -331,7 +331,7 @@ var Video = new Class({ * The out marker. * * @name Phaser.GameObjects.Video#_markerOut - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -341,7 +341,7 @@ var Video = new Class({ * The last time the TextureSource was updated. * * @name Phaser.GameObjects.Video#_lastUpdate - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -396,6 +396,21 @@ var Video = new Class({ { sound.on(SoundEvents.GLOBAL_MUTE, this.globalMute, this); } + + this.on(Events.ADDED_TO_SCENE, this.addedToScene, this); + this.on(Events.REMOVED_FROM_SCENE, this.removedFromScene, this); + }, + + // Overrides Game Object method + addedToScene: function () + { + this.scene.sys.updateList.add(this); + }, + + // Overrides Game Object method + removedFromScene: function () + { + this.scene.sys.updateList.remove(this); }, /** @@ -427,8 +442,8 @@ var Video = new Class({ * @since 3.20.0 * * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. - * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. * * @return {this} This Video Game Object for method chaining. */ @@ -516,8 +531,8 @@ var Video = new Class({ * @param {string} key - The key of the Video this Game Object will swap to playing, as stored in the Video Cache. * @param {boolean} [autoplay=true] - Should the video start playing immediately, once the swap is complete? * @param {boolean} [loop=false] - Should the video loop automatically when it reaches the end? Please note that not all browsers support _seamless_ video looping for all encoding formats. - * @param {integer} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. - * @param {integer} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerIn] - Optional in marker time, in seconds, for playback of a sequence of the video. + * @param {number} [markerOut] - Optional out marker time, in seconds, for playback of a sequence of the video. * * @return {this} This Video Game Object for method chaining. */ @@ -595,8 +610,8 @@ var Video = new Class({ * @since 3.20.0 * * @param {string} key - A unique name to give this marker. - * @param {integer} markerIn - The time, in seconds, representing the start of this marker. - * @param {integer} markerOut - The time, in seconds, representing the end of this marker. + * @param {number} markerIn - The time, in seconds, representing the start of this marker. + * @param {number} markerOut - The time, in seconds, representing the end of this marker. * * @return {this} This Video Game Object for method chaining. */ @@ -670,8 +685,8 @@ var Video = new Class({ * @method Phaser.GameObjects.Video#snapshot * @since 3.20.0 * - * @param {integer} [width] - The width of the resulting CanvasTexture. - * @param {integer} [height] - The height of the resulting CanvasTexture. + * @param {number} [width] - The width of the resulting CanvasTexture. + * @param {number} [height] - The height of the resulting CanvasTexture. * * @return {Phaser.Textures.CanvasTexture} */ @@ -693,12 +708,12 @@ var Video = new Class({ * @method Phaser.GameObjects.Video#snapshotArea * @since 3.20.0 * - * @param {integer} [x=0] - The horizontal location of the top-left of the area to grab from. - * @param {integer} [y=0] - The vertical location of the top-left of the area to grab from. - * @param {integer} [srcWidth] - The width of area to grab from the video. If not given it will grab the full video dimensions. - * @param {integer} [srcHeight] - The height of area to grab from the video. If not given it will grab the full video dimensions. - * @param {integer} [destWidth] - The destination width of the grab, allowing you to resize it. - * @param {integer} [destHeight] - The destination height of the grab, allowing you to resize it. + * @param {number} [x=0] - The horizontal location of the top-left of the area to grab from. + * @param {number} [y=0] - The vertical location of the top-left of the area to grab from. + * @param {number} [srcWidth] - The width of area to grab from the video. If not given it will grab the full video dimensions. + * @param {number} [srcHeight] - The height of area to grab from the video. If not given it will grab the full video dimensions. + * @param {number} [destWidth] - The destination width of the grab, allowing you to resize it. + * @param {number} [destHeight] - The destination height of the grab, allowing you to resize it. * * @return {Phaser.Textures.CanvasTexture} */ @@ -843,6 +858,70 @@ var Video = new Class({ return this; }, + /** + * Loads a Video from the given MediaStream object, ready for playback with the `Video.play` method. + * + * You can control at what point the browser determines the video as being ready for playback via + * the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement + * for more details. + * + * @method Phaser.GameObjects.Video#loadMediaStream + * @since 3.50.0 + * + * @param {string} stream - The MediaStream object. + * @param {string} [loadEvent='loadeddata'] - The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`. + * @param {boolean} [noAudio=false] - Does the video have an audio track? If not you can enable auto-playing on it. + * + * @return {this} This Video Game Object for method chaining. + */ + loadMediaStream: function (stream, loadEvent, noAudio) + { + if (loadEvent === undefined) { loadEvent = 'loadeddata'; } + if (noAudio === undefined) { noAudio = false; } + + if (this.video) + { + this.stop(); + } + + if (this.videoTexture) + { + this.scene.sys.textures.remove(this._key); + } + + var video = document.createElement('video'); + + video.controls = false; + + if (noAudio) + { + video.muted = true; + video.defaultMuted = true; + + video.setAttribute('autoplay', 'autoplay'); + } + + video.setAttribute('playsinline', 'playsinline'); + video.setAttribute('preload', 'auto'); + + video.addEventListener('error', this._callbacks.error, true); + + try + { + video.srcObject = stream; + } + catch (error) + { + video.src = window.URL.createObjectURL(stream); + } + + video.load(); + + this.video = video; + + return this; + }, + /** * This internal method is called automatically if the playback Promise resolves successfully. * diff --git a/src/gameobjects/video/VideoCreator.js b/src/gameobjects/video/VideoCreator.js index a7f4528fa..237109fa1 100644 --- a/src/gameobjects/video/VideoCreator.js +++ b/src/gameobjects/video/VideoCreator.js @@ -37,6 +37,11 @@ GameObjectCreator.register('video', function (config, addToScene) BuildGameObject(this.scene, video, config); + if (!config.add) + { + this.updateList.add(video); + } + return video; }); diff --git a/src/gameobjects/video/VideoFactory.js b/src/gameobjects/video/VideoFactory.js index c208bc654..a60558860 100644 --- a/src/gameobjects/video/VideoFactory.js +++ b/src/gameobjects/video/VideoFactory.js @@ -23,18 +23,5 @@ var GameObjectFactory = require('../GameObjectFactory'); */ GameObjectFactory.register('video', function (x, y, key) { - var video = new Video(this.scene, x, y, key); - - this.displayList.add(video); - this.updateList.add(video); - - return video; + return this.displayList.add(new Video(this.scene, x, y, key)); }); - -// When registering a factory function 'this' refers to the GameObjectFactory context. -// -// There are several properties available to use: -// -// this.scene - a reference to the Scene that owns the GameObjectFactory -// this.displayList - a reference to the Display List the Scene owns -// this.updateList - a reference to the Update List the Scene owns diff --git a/src/gameobjects/video/VideoWebGLRenderer.js b/src/gameobjects/video/VideoWebGLRenderer.js index f92ba7cc9..6bab40c5c 100644 --- a/src/gameobjects/video/VideoWebGLRenderer.js +++ b/src/gameobjects/video/VideoWebGLRenderer.js @@ -22,7 +22,7 @@ var VideoWebGLRenderer = function (renderer, src, camera, parentMatrix) { if (src.videoTexture) { - this.pipeline.batchSprite(src, camera, parentMatrix); + src.pipeline.batchSprite(src, camera, parentMatrix); } }; diff --git a/src/gameobjects/zone/Zone.js b/src/gameobjects/zone/Zone.js index c476f7735..98150eb25 100644 --- a/src/gameobjects/zone/Zone.js +++ b/src/gameobjects/zone/Zone.js @@ -94,7 +94,7 @@ var Zone = new Class({ * display lists without causing a batch flush. * * @name Phaser.GameObjects.Zone#blendMode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.blendMode = BlendModes.NORMAL; diff --git a/src/geom/circle/Circle.js b/src/geom/circle/Circle.js index 5d72f9bd0..72f6aed25 100644 --- a/src/geom/circle/Circle.js +++ b/src/geom/circle/Circle.js @@ -43,7 +43,7 @@ var Circle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Circle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -135,7 +135,7 @@ var Circle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * diff --git a/src/geom/circle/GetPoints.js b/src/geom/circle/GetPoints.js index bc6372c19..294654ee7 100644 --- a/src/geom/circle/GetPoints.js +++ b/src/geom/circle/GetPoints.js @@ -17,7 +17,7 @@ var MATH_CONST = require('../../math/const'); * @since 3.0.0 * * @param {Phaser.Geom.Circle} circle - The Circle to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. * diff --git a/src/geom/const.js b/src/geom/const.js index 5988b0db2..980e26cf0 100644 --- a/src/geom/const.js +++ b/src/geom/const.js @@ -10,7 +10,7 @@ var GEOM_CONST = { * A Circle Geometry object type. * * @name Phaser.Geom.CIRCLE - * @type {integer} + * @type {number} * @since 3.19.0 */ CIRCLE: 0, @@ -19,7 +19,7 @@ var GEOM_CONST = { * An Ellipse Geometry object type. * * @name Phaser.Geom.ELLIPSE - * @type {integer} + * @type {number} * @since 3.19.0 */ ELLIPSE: 1, @@ -28,7 +28,7 @@ var GEOM_CONST = { * A Line Geometry object type. * * @name Phaser.Geom.LINE - * @type {integer} + * @type {number} * @since 3.19.0 */ LINE: 2, @@ -37,7 +37,7 @@ var GEOM_CONST = { * A Point Geometry object type. * * @name Phaser.Geom.POINT - * @type {integer} + * @type {number} * @since 3.19.0 */ POINT: 3, @@ -46,7 +46,7 @@ var GEOM_CONST = { * A Polygon Geometry object type. * * @name Phaser.Geom.POLYGON - * @type {integer} + * @type {number} * @since 3.19.0 */ POLYGON: 4, @@ -55,7 +55,7 @@ var GEOM_CONST = { * A Rectangle Geometry object type. * * @name Phaser.Geom.RECTANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ RECTANGLE: 5, @@ -64,7 +64,7 @@ var GEOM_CONST = { * A Triangle Geometry object type. * * @name Phaser.Geom.TRIANGLE - * @type {integer} + * @type {number} * @since 3.19.0 */ TRIANGLE: 6 diff --git a/src/geom/ellipse/Ellipse.js b/src/geom/ellipse/Ellipse.js index 64e8a6369..932566e91 100644 --- a/src/geom/ellipse/Ellipse.js +++ b/src/geom/ellipse/Ellipse.js @@ -45,7 +45,7 @@ var Ellipse = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Ellipse#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -137,7 +137,7 @@ var Ellipse = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * diff --git a/src/geom/ellipse/GetPoints.js b/src/geom/ellipse/GetPoints.js index c9140fbd9..67f2fd8ff 100644 --- a/src/geom/ellipse/GetPoints.js +++ b/src/geom/ellipse/GetPoints.js @@ -19,7 +19,7 @@ var MATH_CONST = require('../../math/const'); * @generic {Phaser.Geom.Point[]} O - [out,$return] * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [out] - An array to insert the points in to. If not provided a new array will be created. * diff --git a/src/geom/intersects/GetLineToLine.js b/src/geom/intersects/GetLineToLine.js index ed1822957..4ed224b81 100644 --- a/src/geom/intersects/GetLineToLine.js +++ b/src/geom/intersects/GetLineToLine.js @@ -24,23 +24,35 @@ var Vector3 = require('../../math/Vector3'); */ var GetLineToLine = function (line1, line2, out) { - var dx1 = line1.x2 - line1.x1; - var dy1 = line1.y2 - line1.y1; + var x1 = line1.x1; + var y1 = line1.y1; + var x2 = line1.x2; + var y2 = line1.y2; - var dx2 = line2.x2 - line2.x1; - var dy2 = line2.y2 - line2.y1; + var x3 = line2.x1; + var y3 = line2.y1; + var x4 = line2.x2; + var y4 = line2.y2; - var mag1 = Math.sqrt(dx1 * dx1 + dy1 * dy1); - var mag2 = Math.sqrt(dx2 * dx2 + dy2 * dy2); + var dx1 = x2 - x1; + var dy1 = y2 - y1; - // Parallel? - if (dx1 / mag1 === dx2 / mag2 && dy1 / mag1 === dy2 / mag2) + var dx2 = x4 - x3; + var dy2 = y4 - y3; + + var denom = dy2 * dx1 - dx2 * dy1; + + // Make sure there is not a division by zero - this also indicates that the lines are parallel. + // If numA and numB were both equal to zero the lines would be on top of each other (coincidental). + // This check is not done because it is not necessary for this implementation (the parallel check accounts for this). + + if (dx1 === 0 || denom === 0) { - return null; + return false; } - var T2 = (dx1 * (line2.y1 - line1.y1) + dy1 * (line1.x1 - line2.x1)) / (dx2 * dy1 - dy2 * dx1); - var T1 = (line2.x1 + dx2 * T2 - line1.x1) / dx1; + var T2 = (dx1 * (y3 - y1) + dy1 * (x1 - x3)) / (dx2 * dy1 - dy2 * dx1); + var T1 = (x3 + dx2 * T2 - x1) / dx1; // Intersects? if (T1 < 0 || T2 < 0 || T2 > 1) @@ -54,8 +66,8 @@ var GetLineToLine = function (line1, line2, out) } return out.set( - line1.x1 + dx1 * T1, - line1.y1 + dy1 * T1, + x1 + dx1 * T1, + y1 + dy1 * T1, T1 ); }; diff --git a/src/geom/intersects/TriangleToLine.js b/src/geom/intersects/TriangleToLine.js index ea15569d8..0e31d4c4d 100644 --- a/src/geom/intersects/TriangleToLine.js +++ b/src/geom/intersects/TriangleToLine.js @@ -4,12 +4,11 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Contains = require('../triangle/Contains'); var LineToLine = require('./LineToLine'); /** * Checks if a Triangle and a Line intersect. - * + * * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid". * * @function Phaser.Geom.Intersects.TriangleToLine @@ -23,7 +22,7 @@ var LineToLine = require('./LineToLine'); var TriangleToLine = function (triangle, line) { // If the Triangle contains either the start or end point of the line, it intersects - if (Contains(triangle, line.getPointA()) || Contains(triangle, line.getPointB())) + if (triangle.contains(line.x1, line.y1) || triangle.contains(line.x2, line.y2)) { return true; } diff --git a/src/geom/line/BresenhamPoints.js b/src/geom/line/BresenhamPoints.js index 5192320b0..f8df554af 100644 --- a/src/geom/line/BresenhamPoints.js +++ b/src/geom/line/BresenhamPoints.js @@ -13,7 +13,7 @@ * @since 3.0.0 * * @param {Phaser.Geom.Line} line - The line. - * @param {integer} [stepRate=1] - The optional step rate for the points on the line. + * @param {number} [stepRate=1] - The optional step rate for the points on the line. * @param {Phaser.Types.Math.Vector2Like[]} [results] - An optional array to push the resulting coordinates into. * * @return {Phaser.Types.Math.Vector2Like[]} The array of coordinates on the line. diff --git a/src/geom/line/GetEasedPoints.js b/src/geom/line/GetEasedPoints.js index f8b82d357..4b3294580 100644 --- a/src/geom/line/GetEasedPoints.js +++ b/src/geom/line/GetEasedPoints.js @@ -37,7 +37,7 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Line} line - The Line object. * @param {(string|function)} ease - The ease to use. This can be either a string from the EaseMap, or a custom function. - * @param {integer} quantity - The number of points to return. Note that if you provide a `collinearThreshold`, the resulting array may not always contain this number of points. + * @param {number} quantity - The number of points to return. Note that if you provide a `collinearThreshold`, the resulting array may not always contain this number of points. * @param {number} [collinearThreshold=0] - An optional threshold. The final array is reduced so that each point is spaced out at least this distance apart. This helps reduce clustering in noisey eases. * @param {number[]} [easeParams] - An optional array of ease parameters to go with the ease. * diff --git a/src/geom/line/GetPoints.js b/src/geom/line/GetPoints.js index 4b97fe72a..c1b1b1749 100644 --- a/src/geom/line/GetPoints.js +++ b/src/geom/line/GetPoints.js @@ -21,7 +21,7 @@ var Point = require('../point/Point'); * @generic {Phaser.Geom.Point[]} O - [out,$return] * * @param {Phaser.Geom.Line} line - The line. - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * diff --git a/src/geom/line/Line.js b/src/geom/line/Line.js index 29de4ff51..a40585888 100644 --- a/src/geom/line/Line.js +++ b/src/geom/line/Line.js @@ -41,7 +41,7 @@ var Line = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Line#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -115,8 +115,8 @@ var Line = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. - * @param {integer} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. + * @param {number} quantity - The number of points to place on the line. Set to `0` to use `stepRate` instead. + * @param {number} [stepRate] - The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param {(array|Phaser.Geom.Point[])} [output] - An optional array of Points, or point-like objects, to store the coordinates of the points on the line. * * @return {(array|Phaser.Geom.Point[])} An array of Points, or point-like objects, containing the coordinates of the points on the line. diff --git a/src/geom/mesh/Face.js b/src/geom/mesh/Face.js new file mode 100644 index 000000000..04e336de4 --- /dev/null +++ b/src/geom/mesh/Face.js @@ -0,0 +1,558 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../utils/Class'); +var Rectangle = require('../rectangle/Rectangle'); +var RectangleToRectangle = require('../intersects/RectangleToRectangle'); +var Vector2 = require('../../math/Vector2'); + +/** + * Returns the length of the line. + * + * @ignore + * @private + * + * @param {number} x1 - The x1 coordinate. + * @param {number} y1 - The y1 coordinate. + * @param {number} x2 - The x2 coordinate. + * @param {number} y2 - The y2 coordinate. + * + * @return {number} The length of the line. + */ +function GetLength (x1, y1, x2, y2) +{ + var x = x1 - x2; + var y = y1 - y2; + var magnitude = (x * x) + (y * y); + + return Math.sqrt(magnitude); +} + +/** + * @classdesc + * A Face Geometry Object. + * + * A Face is used by the Mesh Game Object. A Mesh consists of one, or more, faces that are + * used to render the Mesh Game Objects in WebGL. + * + * A Face consists of 3 Vertex instances, for the 3 corners of the face and methods to help + * you modify and test them. + * + * @class Face + * @memberof Phaser.Geom.Mesh + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Vertex} vertex1 - The first vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex2 - The second vertex of the Face. + * @param {Phaser.Geom.Mesh.Vertex} vertex3 - The third vertex of the Face. + */ +var Face = new Class({ + + initialize: + + function Face (vertex1, vertex2, vertex3) + { + /** + * The first vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex1 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex1 = vertex1; + + /** + * The second vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex2 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex2 = vertex2; + + /** + * The third vertex in this Face. + * + * @name Phaser.Geom.Mesh.Face#vertex3 + * @type {Phaser.Geom.Mesh.Vertex} + * @since 3.50.0 + */ + this.vertex3 = vertex3; + + /** + * The bounds of this Face. + * + * Be sure to call the `Face.updateBounds` method _before_ using this property. + * + * @name Phaser.Geom.Mesh.Face#bounds + * @type {Phaser.Geom.Rectangle} + * @since 3.50.0 + */ + this.bounds = new Rectangle(); + + /** + * The face inCenter. Do not access directly, instead use the `getInCenter` method. + * + * @name Phaser.Geom.Mesh.Face#_inCenter + * @type {Phaser.Math.Vector2} + * @private + * @since 3.50.0 + */ + this._inCenter = new Vector2(); + }, + + /** + * Calculates and returns the in-center position of this Face. + * + * @method Phaser.Geom.Mesh.Face#getInCenter + * @since 3.50.0 + * + * @param {boolean} [local=true] Return the in center from the un-transformed vertex positions (`true`), or transformed? (`false`) + * + * @return {Phaser.Math.Vector2} A Vector2 containing the in center position of this Face. + */ + getInCenter: function (local) + { + if (local === undefined) { local = true; } + + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var v1x; + var v1y; + + var v2x; + var v2y; + + var v3x; + var v3y; + + if (local) + { + v1x = v1.x; + v1y = v1.y; + + v2x = v2.x; + v2y = v2.y; + + v3x = v3.x; + v3y = v3.y; + } + else + { + v1x = v1.vx; + v1y = v1.vy; + + v2x = v2.vx; + v2y = v2.vy; + + v3x = v3.vx; + v3y = v3.vy; + } + + var d1 = GetLength(v3x, v3y, v2x, v2y); + var d2 = GetLength(v1x, v1y, v3x, v3y); + var d3 = GetLength(v2x, v2y, v1x, v1y); + + var p = d1 + d2 + d3; + + return this._inCenter.set( + (v1x * d1 + v2x * d2 + v3x * d3) / p, + (v1y * d1 + v2y * d2 + v3y * d3) / p + ); + }, + + /** + * Checks if the given coordinates are within this Face. + * + * You can optionally provide a transform matrix. If given, the Face vertices + * will be transformed first, before being checked against the coordinates. + * + * @method Phaser.Geom.Mesh.Face#contains + * @since 3.50.0 + * + * @param {number} x - The horizontal position to check. + * @param {number} y - The vertical position to check. + * @param {Phaser.GameObjects.Components.TransformMatrix} [calcMatrix] - Optional transform matrix to apply to the vertices before comparison. + * + * @return {boolean} `true` if the coordinates lay within this Face, otherwise `false`. + */ + contains: function (x, y, calcMatrix) + { + var vertex1 = this.vertex1; + var vertex2 = this.vertex2; + var vertex3 = this.vertex3; + + var v1x = vertex1.vx; + var v1y = vertex1.vy; + + var v2x = vertex2.vx; + var v2y = vertex2.vy; + + var v3x = vertex3.vx; + var v3y = vertex3.vy; + + if (calcMatrix) + { + var a = calcMatrix.a; + var b = calcMatrix.b; + var c = calcMatrix.c; + var d = calcMatrix.d; + var e = calcMatrix.e; + var f = calcMatrix.f; + + v1x = vertex1.vx * a + vertex1.vy * c + e; + v1y = vertex1.vx * b + vertex1.vy * d + f; + + v2x = vertex2.vx * a + vertex2.vy * c + e; + v2y = vertex2.vx * b + vertex2.vy * d + f; + + v3x = vertex3.vx * a + vertex3.vy * c + e; + v3y = vertex3.vx * b + vertex3.vy * d + f; + } + + var t0x = v3x - v1x; + var t0y = v3y - v1y; + + var t1x = v2x - v1x; + var t1y = v2y - v1y; + + var t2x = x - v1x; + var t2y = y - v1y; + + var dot00 = (t0x * t0x) + (t0y * t0y); + var dot01 = (t0x * t1x) + (t0y * t1y); + var dot02 = (t0x * t2x) + (t0y * t2y); + var dot11 = (t1x * t1x) + (t1y * t1y); + var dot12 = (t1x * t2x) + (t1y * t2y); + + // Compute barycentric coordinates + var bc = ((dot00 * dot11) - (dot01 * dot01)); + var inv = (bc === 0) ? 0 : (1 / bc); + var u = ((dot11 * dot02) - (dot01 * dot12)) * inv; + var v = ((dot00 * dot12) - (dot01 * dot02)) * inv; + + return (u >= 0 && v >= 0 && (u + v < 1)); + }, + + /** + * Checks if the vertices in this Face are orientated counter-clockwise, or not. + * + * It checks the transformed position of the vertices, not the local one. + * + * @method Phaser.Geom.Mesh.Face#isCounterClockwise + * @since 3.50.0 + * + * @param {number} z - The z-axis value to test against. Typically the `Mesh.modelPosition.z`. + * + * @return {boolean} `true` if the vertices in this Face run counter-clockwise, otherwise `false`. + */ + isCounterClockwise: function (z) + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var d = (v2.vx - v1.vx) * (v3.vy - v1.vy) - (v2.vy - v1.vy) * (v3.vx - v1.vx); + + return (z <= 0) ? d >= 0 : d < 0; + }, + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * + * @method Phaser.Geom.Mesh.Face#load + * @since 3.50.0 + * + * @param {Float32Array} F32 - A Float32 Array to insert the position, UV and unit data in to. + * @param {Uint32Array} U32 - A Uint32 Array to insert the color and alpha data in to. + * @param {number} offset - The index of the array to insert this Vertex to. + * @param {number} textureUnit - The texture unit currently in use. + * @param {number} alpha - The alpha of the parent object. + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * + * @return {number} The new vertex index array offset. + */ + load: function (F32, U32, offset, textureUnit, tintEffect) + { + offset = this.vertex1.load(F32, U32, offset, textureUnit, tintEffect); + offset = this.vertex2.load(F32, U32, offset, textureUnit, tintEffect); + offset = this.vertex3.load(F32, U32, offset, textureUnit, tintEffect); + + return offset; + }, + + /** + * Transforms all Face vertices by the given matrix, storing the results in their `vx`, `vy` and `vz` properties. + * + * @method Phaser.Geom.Mesh.Face#transformCoordinatesLocal + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} transformMatrix - The transform matrix to apply to this vertex. + * @param {number} width - The width of the parent Mesh. + * @param {number} height - The height of the parent Mesh. + * @param {number} cameraZ - The z position of the MeshCamera. + * + * @return {this} This Face instance. + */ + transformCoordinatesLocal: function (transformMatrix, width, height, cameraZ) + { + this.vertex1.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + this.vertex2.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + this.vertex3.transformCoordinatesLocal(transformMatrix, width, height, cameraZ); + + return this; + }, + + /** + * Updates the bounds of this Face, based on the translated values of the vertices. + * + * Call this method prior to accessing the `Face.bounds` property. + * + * @method Phaser.Geom.Mesh.Face#updateBounds + * @since 3.50.0 + * + * @return {this} This Face instance. + */ + updateBounds: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + var bounds = this.bounds; + + bounds.x = Math.min(v1.vx, v2.vx, v3.vx); + bounds.y = Math.min(v1.vy, v2.vy, v3.vy); + bounds.width = Math.max(v1.vx, v2.vx, v3.vx) - bounds.x; + bounds.height = Math.max(v1.vy, v2.vy, v3.vy) - bounds.y; + + return this; + }, + + /** + * Checks if this Face is within the view of the given Camera. + * + * This method is called in the `MeshWebGLRenderer` function. It performs the following tasks: + * + * First, the `Vertex.update` method is called on each of the vertices. This populates them + * with the new translated values, updating their `tx`, `ty` and `ta` properties. + * + * Then it tests to see if this face is visible due to the alpha values, if not, it returns. + * + * After this, if `hideCCW` is set, it calls `isCounterClockwise` and returns if not. + * + * Finally, it will update the `Face.bounds` based on the newly translated vertex values + * and return the results of an intersection test between the bounds and the camera world view + * rectangle. + * + * @method Phaser.Geom.Mesh.Face#isInView + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to check against. + * @param {boolean} hideCCW - Test the counter-clockwise orientation of the verts? + * @param {number} z - The Cameras z position, used in the CCW test. + * @param {number} alpha - The alpha of the parent object. + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * + * @return {boolean} `true` if this Face can be seen by the Camera. + */ + isInView: function (camera, hideCCW, z, alpha, a, b, c, d, e, f, roundPixels) + { + var v1 = this.vertex1.update(a, b, c, d, e, f, roundPixels, alpha); + var v2 = this.vertex2.update(a, b, c, d, e, f, roundPixels, alpha); + var v3 = this.vertex3.update(a, b, c, d, e, f, roundPixels, alpha); + + // Alpha check first + if (v1.ta <= 0 && v2.ta <= 0 && v3.ta <= 0) + { + return false; + } + + // CCW check + if (hideCCW && !this.isCounterClockwise(z)) + { + return false; + } + + // Bounds check + var bounds = this.bounds; + + bounds.x = Math.min(v1.tx, v2.tx, v3.tx); + bounds.y = Math.min(v1.ty, v2.ty, v3.ty); + bounds.width = Math.max(v1.tx, v2.tx, v3.tx) - bounds.x; + bounds.height = Math.max(v1.ty, v2.ty, v3.ty) - bounds.y; + + return RectangleToRectangle(bounds, camera.worldView); + }, + + /** + * Translates the vertices of this Face by the given amounts. + * + * The actual vertex positions are adjusted, not their transformed position. + * + * Therefore, this updates the vertex data directly. + * + * @method Phaser.Geom.Mesh.Face#translate + * @since 3.50.0 + * + * @param {number} x - The amount to horizontally translate by. + * @param {number} [y=0] - The amount to vertically translate by. + * + * @return {this} This Face instance. + */ + translate: function (x, y) + { + if (y === undefined) { y = 0; } + + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + v1.x += x; + v1.y += y; + + v2.x += x; + v2.y += y; + + v3.x += x; + v3.y += y; + + return this; + }, + + /** + * The x coordinate of this Face, based on the in center position of the Face. + * + * @name Phaser.Geom.Mesh.Face#x + * @type {number} + * @since 3.50.0 + */ + x: { + + get: function () + { + return this.getInCenter().x; + }, + + set: function (value) + { + var current = this.getInCenter(); + + this.translate(value - current.x, 0); + } + + }, + + /** + * The y coordinate of this Face, based on the in center position of the Face. + * + * @name Phaser.Geom.Mesh.Face#y + * @type {number} + * @since 3.50.0 + */ + y: { + + get: function () + { + return this.getInCenter().y; + }, + + set: function (value) + { + var current = this.getInCenter(); + + this.translate(0, value - current.y); + } + + }, + + /** + * Set the alpha value of this Face. + * + * Each vertex is given the same value. If you need to adjust the alpha on a per-vertex basis + * then use the `Vertex.alpha` property instead. + * + * When getting the alpha of this Face, it will return an average of the alpha + * component of all three vertices. + * + * @name Phaser.Geom.Mesh.Face#alpha + * @type {number} + * @since 3.50.0 + */ + alpha: { + + get: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + return (v1.alpha + v2.alpha + v3.alpha) / 3; + }, + + set: function (value) + { + this.vertex1.alpha = value; + this.vertex2.alpha = value; + this.vertex3.alpha = value; + } + + }, + + /** + * The depth of this Face, which is an average of the z component of all three vertices. + * + * The depth is calculated based on the transformed z value, not the local one. + * + * @name Phaser.Geom.Mesh.Face#depth + * @type {number} + * @readonly + * @since 3.50.0 + */ + depth: { + + get: function () + { + var v1 = this.vertex1; + var v2 = this.vertex2; + var v3 = this.vertex3; + + return (v1.vz + v2.vz + v3.vz) / 3; + } + + }, + + /** + * Destroys this Face and nulls the references to the vertices. + * + * @method Phaser.Geom.Mesh.Face#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.vertex1 = null; + this.vertex2 = null; + this.vertex3 = null; + } + +}); + +module.exports = Face; diff --git a/src/geom/mesh/GenerateGridVerts.js b/src/geom/mesh/GenerateGridVerts.js new file mode 100644 index 000000000..d324d0ee8 --- /dev/null +++ b/src/geom/mesh/GenerateGridVerts.js @@ -0,0 +1,236 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = require('./Face'); +var GetFastValue = require('../../utils/object/GetFastValue'); +var Matrix4 = require('../../math/Matrix4'); +var Vector3 = require('../../math/Vector3'); +var Vertex = require('./Vertex'); + +var tempPosition = new Vector3(); +var tempRotation = new Vector3(); +var tempMatrix = new Matrix4(); + +/** + * Creates a grid of vertices based on the given configuration object and optionally adds it to a Mesh. + * + * The size of the grid is given in pixels. An example configuration may be: + * + * `{ width: 256, height: 256, widthSegments: 2, heightSegments: 2, tile: true }` + * + * This will create a grid 256 x 256 pixels in size, split into 2 x 2 segments, with + * the texture tiling across the cells. + * + * You can split the grid into segments both vertically and horizontally. This will + * generate two faces per grid segment as a result. + * + * The `tile` parameter allows you to control if the tile will repeat across the grid + * segments, or be displayed in full. + * + * If adding this grid to a Mesh you can offset the grid via the `x` and `y` properties. + * + * UV coordinates are generated based on the given texture and frame in the config. For + * example, no frame is given, the UVs will be in the range 0 to 1. If a frame is given, + * such as from a texture atlas, the UVs will be generated within the range of that frame. + * + * @function Phaser.Geom.Mesh.GenerateGridVerts + * @since 3.50.0 + * + * @param {Phaser.Types.Geom.Mesh.GenerateGridConfig} config - A Grid configuration object. + * + * @return {Phaser.Types.Geom.Mesh.GenerateGridVertsResult} A Grid Result object, containing the generated vertices and indicies. + */ +var GenerateGridVerts = function (config) +{ + var mesh = GetFastValue(config, 'mesh'); + var texture = GetFastValue(config, 'texture', null); + var frame = GetFastValue(config, 'frame'); + var width = GetFastValue(config, 'width', 1); + var height = GetFastValue(config, 'height', width); + var widthSegments = GetFastValue(config, 'widthSegments', 1); + var heightSegments = GetFastValue(config, 'heightSegments', widthSegments); + var posX = GetFastValue(config, 'x', 0); + var posY = GetFastValue(config, 'y', 0); + var posZ = GetFastValue(config, 'z', 0); + var rotateX = GetFastValue(config, 'rotateX', 0); + var rotateY = GetFastValue(config, 'rotateY', 0); + var rotateZ = GetFastValue(config, 'rotateZ', 0); + var zIsUp = GetFastValue(config, 'zIsUp', true); + var isOrtho = GetFastValue(config, 'isOrtho', (mesh) ? mesh.dirtyCache[11] : false); + var colors = GetFastValue(config, 'colors', [ 0xffffff ]); + var alphas = GetFastValue(config, 'alphas', [ 1 ]); + var tile = GetFastValue(config, 'tile', false); + var flipY = GetFastValue(config, 'flipY', false); + + var widthSet = GetFastValue(config, 'width', null); + + var result = { + faces: [], + verts: [] + }; + + tempPosition.set(posX, posY, posZ); + tempRotation.set(rotateX, rotateY, rotateZ); + tempMatrix.fromRotationXYTranslation(tempRotation, tempPosition, zIsUp); + + if (!texture && mesh) + { + texture = mesh.texture; + } + else if (mesh && typeof(texture) === 'string') + { + texture = mesh.scene.sys.textures.get(texture); + } + else + { + // There's nothing more we can do without a texture + return result; + } + + var textureFrame = texture.get(frame); + + // If the Mesh is ortho and no width / height is given, we'll default to texture sizes (if set!) + if (!widthSet && isOrtho && texture && mesh) + { + width = textureFrame.width / mesh.height; + height = textureFrame.height / mesh.height; + } + + var halfWidth = width / 2; + var halfHeight = height / 2; + + var gridX = Math.floor(widthSegments); + var gridY = Math.floor(heightSegments); + + var gridX1 = gridX + 1; + var gridY1 = gridY + 1; + + var segmentWidth = width / gridX; + var segmentHeight = height / gridY; + + var uvs = []; + var vertices = []; + + var ix; + var iy; + + var frameU0 = 0; + var frameU1 = 1; + var frameV0 = 0; + var frameV1 = 1; + + if (textureFrame) + { + frameU0 = textureFrame.u0; + frameU1 = textureFrame.u1; + + if (!flipY) + { + frameV0 = textureFrame.v0; + frameV1 = textureFrame.v1; + } + else + { + frameV0 = textureFrame.v1; + frameV1 = textureFrame.v0; + } + } + + var frameU = frameU1 - frameU0; + var frameV = frameV1 - frameV0; + + for (iy = 0; iy < gridY1; iy++) + { + var y = iy * segmentHeight - halfHeight; + + for (ix = 0; ix < gridX1; ix++) + { + var x = ix * segmentWidth - halfWidth; + + vertices.push(x, -y); + + var tu = frameU0 + frameU * (ix / gridX); + var tv = frameV0 + frameV * (iy / gridY); + + uvs.push(tu, tv); + } + } + + if (!Array.isArray(colors)) + { + colors = [ colors ]; + } + + if (!Array.isArray(alphas)) + { + alphas = [ alphas ]; + } + + var alphaIndex = 0; + var colorIndex = 0; + + for (iy = 0; iy < gridY; iy++) + { + for (ix = 0; ix < gridX; ix++) + { + var a = (ix + gridX1 * iy) * 2; + var b = (ix + gridX1 * (iy + 1)) * 2; + var c = ((ix + 1) + gridX1 * (iy + 1)) * 2; + var d = ((ix + 1) + gridX1 * iy) * 2; + + var color = colors[colorIndex]; + var alpha = alphas[alphaIndex]; + + var vert1 = new Vertex(vertices[a], vertices[a + 1], 0, uvs[a], uvs[a + 1], color, alpha).transformMat4(tempMatrix); + var vert2 = new Vertex(vertices[b], vertices[b + 1], 0, uvs[b], uvs[b + 1], color, alpha).transformMat4(tempMatrix); + var vert3 = new Vertex(vertices[d], vertices[d + 1], 0, uvs[d], uvs[d + 1], color, alpha).transformMat4(tempMatrix); + var vert4 = new Vertex(vertices[b], vertices[b + 1], 0, uvs[b], uvs[b + 1], color, alpha).transformMat4(tempMatrix); + var vert5 = new Vertex(vertices[c], vertices[c + 1], 0, uvs[c], uvs[c + 1], color, alpha).transformMat4(tempMatrix); + var vert6 = new Vertex(vertices[d], vertices[d + 1], 0, uvs[d], uvs[d + 1], color, alpha).transformMat4(tempMatrix); + + if (tile) + { + vert1.setUVs(frameU0, frameV1); + vert2.setUVs(frameU0, frameV0); + vert3.setUVs(frameU1, frameV1); + vert4.setUVs(frameU0, frameV0); + vert5.setUVs(frameU1, frameV0); + vert6.setUVs(frameU1, frameV1); + } + + colorIndex++; + + if (colorIndex === colors.length) + { + colorIndex = 0; + } + + alphaIndex++; + + if (alphaIndex === alphas.length) + { + alphaIndex = 0; + } + + result.verts.push(vert1, vert2, vert3, vert4, vert5, vert6); + + result.faces.push( + new Face(vert1, vert2, vert3), + new Face(vert4, vert5, vert6) + ); + } + } + + if (mesh) + { + mesh.faces = mesh.faces.concat(result.faces); + mesh.vertices = mesh.vertices.concat(result.verts); + } + + return result; +}; + +module.exports = GenerateGridVerts; diff --git a/src/geom/mesh/GenerateObjVerts.js b/src/geom/mesh/GenerateObjVerts.js new file mode 100644 index 000000000..a61233ab3 --- /dev/null +++ b/src/geom/mesh/GenerateObjVerts.js @@ -0,0 +1,138 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = require('./Face'); +var Matrix4 = require('../../math/Matrix4'); +var Vector3 = require('../../math/Vector3'); +var Vertex = require('./Vertex'); + +var tempPosition = new Vector3(); +var tempRotation = new Vector3(); +var tempMatrix = new Matrix4(); + +/** + * This method will return an object containing Face and Vertex instances, generated + * from the parsed triangulated OBJ Model data given to this function. + * + * The obj data should have been parsed in advance via the ParseObj function: + * + * ```javascript + * var data = Phaser.Geom.Mesh.ParseObj(rawData, flipUV); + * + * var results = GenerateObjVerts(data); + * ``` + * + * Alternatively, you can parse obj files loaded via the OBJFile loader: + * + * ```javascript + * preload () + * { + * this.load.obj('alien', 'assets/3d/alien.obj); + * } + * + * var results = GenerateObjVerts(this.cache.obj.get('alien)); + * ``` + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can use the data returned by this function to populate the vertices of a Mesh Game Object. + * + * You may add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small (or large) to visualize. + * You can also offset the model via the `x`, `y` and `z` parameters. + * + * @function Phaser.Geom.Mesh.GenerateObjVerts + * @since 3.50.0 + * + * @param {Phaser.Types.Geom.Mesh.OBJData} data - The parsed OBJ model data. + * @param {Phaser.GameObjects.Mesh} [mesh] - An optional Mesh Game Object. If given, the generated Faces will be automatically added to this Mesh. Set to `null` to skip. + * @param {number} [scale=1] - An amount to scale the model data by. Use this if the model has exported too small, or large, to see. + * @param {number} [x=0] - Translate the model x position by this amount. + * @param {number} [y=0] - Translate the model y position by this amount. + * @param {number} [z=0] - Translate the model z position by this amount. + * @param {number} [rotateX=0] - Rotate the model on the x axis by this amount, in radians. + * @param {number} [rotateY=0] - Rotate the model on the y axis by this amount, in radians. + * @param {number} [rotateZ=0] - Rotate the model on the z axis by this amount, in radians. + * @param {boolean} [zIsUp=true] - Is the z axis up (true), or is y axis up (false)? + * + * @return {Phaser.Types.Geom.Mesh.GenerateVertsResult} The parsed Face and Vertex objects. + */ +var GenerateObjVerts = function (data, mesh, scale, x, y, z, rotateX, rotateY, rotateZ, zIsUp) +{ + if (scale === undefined) { scale = 1; } + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (rotateX === undefined) { rotateX = 0; } + if (rotateY === undefined) { rotateY = 0; } + if (rotateZ === undefined) { rotateZ = 0; } + if (zIsUp === undefined) { zIsUp = true; } + + var result = { + faces: [], + verts: [] + }; + + var materials = data.materials; + + tempPosition.set(x, y, z); + tempRotation.set(rotateX, rotateY, rotateZ); + tempMatrix.fromRotationXYTranslation(tempRotation, tempPosition, zIsUp); + + for (var m = 0; m < data.models.length; m++) + { + var model = data.models[m]; + + var vertices = model.vertices; + var textureCoords = model.textureCoords; + var faces = model.faces; + + for (var i = 0; i < faces.length; i++) + { + var face = faces[i]; + + var v1 = face.vertices[0]; + var v2 = face.vertices[1]; + var v3 = face.vertices[2]; + + var m1 = vertices[v1.vertexIndex]; + var m2 = vertices[v2.vertexIndex]; + var m3 = vertices[v3.vertexIndex]; + + var t1 = v1.textureCoordsIndex; + var t2 = v2.textureCoordsIndex; + var t3 = v3.textureCoordsIndex; + + var uv1 = (t1 === -1) ? { u: 0, v: 1 } : textureCoords[t1]; + var uv2 = (t2 === -1) ? { u: 0, v: 0 } : textureCoords[t2]; + var uv3 = (t3 === -1) ? { u: 1, v: 1 } : textureCoords[t3]; + + var color = 0xffffff; + + if (face.material !== '' && materials[face.material]) + { + color = materials[face.material]; + } + + var vert1 = new Vertex(m1.x * scale, m1.y * scale, m1.z * scale, uv1.u, uv1.v, color).transformMat4(tempMatrix); + var vert2 = new Vertex(m2.x * scale, m2.y * scale, m2.z * scale, uv2.u, uv2.v, color).transformMat4(tempMatrix); + var vert3 = new Vertex(m3.x * scale, m3.y * scale, m3.z * scale, uv3.u, uv3.v, color).transformMat4(tempMatrix); + + result.verts.push(vert1, vert2, vert3); + result.faces.push(new Face(vert1, vert2, vert3)); + } + } + + if (mesh) + { + mesh.faces = mesh.faces.concat(result.faces); + mesh.vertices = mesh.vertices.concat(result.verts); + } + + return result; +}; + +module.exports = GenerateObjVerts; diff --git a/src/geom/mesh/GenerateVerts.js b/src/geom/mesh/GenerateVerts.js new file mode 100644 index 000000000..006785847 --- /dev/null +++ b/src/geom/mesh/GenerateVerts.js @@ -0,0 +1,185 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Face = require('./Face'); +var Vertex = require('./Vertex'); + +/** + * Generates a set of Face and Vertex objects by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * GenerateVerts(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * + * @function Phaser.Geom.Mesh.GenerateVerts + * @since 3.50.0 + * + * @param {number[]} vertices - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param {number[]} uvs - The UVs pairs array. + * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? + * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @param {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * + * @return {Phaser.Types.Geom.Mesh.GenerateVertsResult} The parsed Face and Vertex objects. + */ +var GenerateVerts = function (vertices, uvs, indicies, containsZ, normals, colors, alphas) +{ + if (containsZ === undefined) { containsZ = false; } + if (colors === undefined) { colors = 0xffffff; } + if (alphas === undefined) { alphas = 1; } + + if (vertices.length !== uvs.length) + { + console.warn('GenerateVerts: vertices and uvs count not equal'); + return; + } + + var result = { + faces: [], + verts: [] + }; + + var i; + + var x; + var y; + var z; + + var u; + var v; + + var color; + var alpha; + + var normalX; + var normalY; + var normalZ; + + var iInc = (containsZ) ? 3 : 2; + + var isColorArray = Array.isArray(colors); + var isAlphaArray = Array.isArray(alphas); + + if (Array.isArray(indicies) && indicies.length > 0) + { + for (i = 0; i < indicies.length; i++) + { + var index1 = indicies[i]; + var index2 = indicies[i] * 2; + var index3 = indicies[i] * iInc; + + x = vertices[index3]; + y = vertices[index3 + 1]; + z = (containsZ) ? vertices[index3 + 2] : 0; + + u = uvs[index2]; + v = uvs[index2 + 1]; + + color = (isColorArray) ? colors[index1] : colors; + alpha = (isAlphaArray) ? alphas[index1] : alphas; + + normalX = 0; + normalY = 0; + normalZ = 0; + + if (normals) + { + normalX = normals[index3]; + normalY = normals[index3 + 1]; + normalZ = (containsZ) ? normals[index3 + 2] : 0; + } + + result.verts.push(new Vertex(x, y, z, u, v, color, alpha, normalX, normalY, normalZ)); + } + } + else + { + var uvIndex = 0; + var colorIndex = 0; + + for (i = 0; i < vertices.length; i += iInc) + { + x = vertices[i]; + y = vertices[i + 1]; + z = (containsZ) ? vertices[i + 2] : 0; + + u = uvs[uvIndex]; + v = uvs[uvIndex + 1]; + + color = (isColorArray) ? colors[colorIndex] : colors; + alpha = (isAlphaArray) ? alphas[colorIndex] : alphas; + + normalX = 0; + normalY = 0; + normalZ = 0; + + if (normals) + { + normalX = normals[i]; + normalY = normals[i + 1]; + normalZ = (containsZ) ? normals[i + 2] : 0; + } + + result.verts.push(new Vertex(x, y, z, u, v, color, alpha, normalX, normalY, normalZ)); + + uvIndex += 2; + colorIndex++; + } + } + + for (i = 0; i < result.verts.length; i += 3) + { + var vert1 = result.verts[i]; + var vert2 = result.verts[i + 1]; + var vert3 = result.verts[i + 2]; + + result.faces.push(new Face(vert1, vert2, vert3)); + } + + return result; +}; + +module.exports = GenerateVerts; diff --git a/src/geom/mesh/Model.js b/src/geom/mesh/Model.js deleted file mode 100644 index 9a6a25cfb..000000000 --- a/src/geom/mesh/Model.js +++ /dev/null @@ -1,918 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var AnimationState = require('../../animations/AnimationState'); -var Class = require('../../utils/Class'); -var Components = require('../../gameobjects/components'); -var Matrix4 = require('../../math/Matrix4'); -var Quaternion = require('../../math/Quaternion'); -var RGB = require('../../display/RGB'); -var Vector3 = require('../../math/Vector3'); - -/** - * @classdesc - * A 3D Model. - * - * @class Model - * @memberof Phaser.Geom.Mesh - * @constructor - * @since 3.50.0 - * - * @param {Phaser.GameObjects.Layer3D} layer - A reference to the Layer3D instance that this model belongs to. - * @param {number} verticesCount - The total number of vertices this model can contain. - * @param {string|Phaser.Textures.Texture} [texture] - The key, or instance of the Texture this model will use to render with, as stored in the Texture Manager. - * @param {string|integer} [frame] - An optional frame from the Texture this model is rendering with. Ensure your UV data also matches this frame. - * @param {number} [x=0] - The x position of the Model. - * @param {number} [y=0] - The y position of the Model. - * @param {number} [z=0] - The z position of the Model. - */ -var Model = new Class({ - - Mixins: [ - Components.AlphaSingle, - Components.Size, - Components.Texture, - Components.Visible - ], - - initialize: - - function Model (layer, verticesCount, texture, frame, x, y, z) - { - if (x === undefined) { x = 0; } - if (y === undefined) { y = 0; } - if (z === undefined) { z = 0; } - - /** - * The Layer3D instance this model belongs to. - * - * A model can only belong to a single Layer3D instance. - * - * You should consider this property as being read-only. You cannot move a - * model to another Layer3D by simply changing it. - * - * @name Phaser.Geom.Mesh.Model#layer - * @type {Phaser.GameObjects.Layer3D} - * @since 3.50.0 - */ - this.layer = layer; - - /** - * A reference to the Scene to which this the Layer3D Object which owns this model belongs. - * - * You should consider this property as being read-only. You cannot move a - * Game Object to another Scene by simply changing it. - * - * @name Phaser.Geom.Mesh.Model#scene - * @type {Phaser.Scene} - * @since 3.50.0 - */ - this.scene = layer.scene; - - /** - * The Animation State of this Model. - * - * @name Phaser.Geom.Mesh.Model#anims - * @type {Phaser.Animation.AnimationState} - * @since 3.50.0 - */ - this.anims = new AnimationState(this); - - /** - * The size of a single vertex, in bytes. - * - * The total of all 8 attributes * bytes size. - * - * @name Phaser.Geom.Mesh.Model#vertexSize - * @type {number} - * @since 3.50.0 - */ - this.vertexSize = 32; - - /** - * The total number of vertices the ArrayBuffer in this model can hold. - * - * @name Phaser.Geom.Mesh.Model#maxVertexCount - * @type {number} - * @since 3.50.0 - */ - this.maxVertexCount = verticesCount; - - /** - * The total number of vertices currently added to this model. - * - * @name Phaser.Geom.Mesh.Model#vertexCount - * @type {number} - * @since 3.50.0 - */ - this.vertexCount = 0; - - /** - * An ArrayBuffer that contains the GPU byte data for this model. - * - * The size of the buffer is set to `verticesCount * vertexSize` when - * this model is created and cannot be changed without resetting the vertices. - * - * @name Phaser.Geom.Mesh.Model#vertexData - * @type {ArrayBuffer} - * @since 3.50.0 - */ - this.vertexData; - - /** - * A Float32 View into the Array Buffer. - * - * @name Phaser.Geom.Mesh.Model#vertexViewF32 - * @type {Float32Array} - * @since 3.50.0 - */ - this.vertexViewF32; - - /** - * A Vector3 containing the position of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#position - * @type {Phaser.Math.Vector3} - * @since 3.50.0 - */ - this.position = new Vector3(x, y, z); - - /** - * A Vector3 containing the scale of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#scale - * @type {Phaser.Math.Vector3} - * @since 3.50.0 - */ - this.scale = new Vector3(1, 1, 1); - - /** - * A Quaternion containing the rotation of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#position - * @type {Phaser.Math.Quaternion} - * @since 3.50.0 - */ - this.rotation = new Quaternion(); - - /** - * An RGB object containing the ambient material color of this model. - * - * You can adjust the ambient material color by calling the methods - * on this object and changing its properties. - * - * Remember that all color values should be specified in the range - * of 0 to 1. - * - * @name Phaser.Geom.Mesh.Model#ambient - * @type {Phaser.Display.RGB} - * @since 3.50.0 - */ - this.ambient = new RGB(1, 1, 1); - - /** - * An RGB object containing the diffuse material color of this model. - * - * You can adjust the diffuse material color by calling the methods - * on this object and changing its properties. - * - * Remember that all color values should be specified in the range - * of 0 to 1. - * - * @name Phaser.Geom.Mesh.Model#diffuse - * @type {Phaser.Display.RGB} - * @since 3.50.0 - */ - this.diffuse = new RGB(1, 1, 1); - - /** - * An RGB object containing the specular material color of this model. - * - * You can adjust the specular material color by calling the methods - * on this object and changing its properties. - * - * Remember that all color values should be specified in the range - * of 0 to 1. - * - * @name Phaser.Geom.Mesh.Model#specular - * @type {Phaser.Display.RGB} - * @since 3.50.0 - */ - this.specular = new RGB(1, 1, 1); - - /** - * The material shine value of this model. - * - * Default to 0.25. Keep this value in the range 0 to 1. - * - * @name Phaser.Geom.Mesh.Model#ambient - * @type {number} - * @default 0.25 - * @since 3.50.0 - */ - this.shine = 0.25; - - /** - * A Matrix4 containing the transformed normal values for this model. - * - * You should consider this Matrix as being read-only. Its values are - * repopulated during `Model.preUpdate` as required. - * - * @name Phaser.Geom.Mesh.Model#normalMatrix - * @type {Phaser.Math.Matrix4} - * @since 3.50.0 - */ - this.normalMatrix = new Matrix4(); - - /** - * A Matrix4 containing the transform matrix for this model. - * - * You should consider this Matrix as being read-only. Its values are - * repopulated during `Model.preUpdate` as required. - * - * @name Phaser.Geom.Mesh.Model#transformMatrix - * @type {Phaser.Math.Matrix4} - * @since 3.50.0 - */ - this.transformMatrix = new Matrix4(); - - /** - * The culling mode used by this Model during rendering. - * - * Specifies whether front or back facing polygons are candidates - * for culling. The default value is `gl.BACK`. Possible values are: - * - * `gl.FRONT` (1028) - * `gl.BACK` (1029) - * `gl.FRONT_AND_BACK` (1032) - * - * @name Phaser.Geom.Mesh.Model#cullMode - * @type {GLenum} - * @since 3.50.0 - */ - this.cullMode = 1029; - - /** - * An internal cache, used to compare position, rotation, scale and verts data - * each frame, to avoid math calculates in `preUpdate`. - * - * cache structure = position | rotation | scale | verts count - * - * @name Phaser.Geom.Mesh.Model#dirtyCache - * @type {number[]} - * @private - * @since 3.50.0 - */ - this.dirtyCache = [ x, y, z, 0, 0, 0, 1, 1, 1, 1, 0 ]; - - if (!texture) - { - texture = this.scene.sys.textures.get('__WHITE'); - } - - this.setTexture(texture, frame); - - this.setSizeToFrame(); - - this.resetVertices(verticesCount); - }, - - /** - * Calls each of the listeners registered for a given event. - * - * This is a proxy for the Layer3D `emit` method. - * - * @method Phaser.Geom.Mesh.Model#emit - * @since 3.50.0 - * - * @param {(string|symbol)} event - The event name. - * @param {...*} [args] - Additional arguments that will be passed to the event handler. - * - * @return {boolean} `true` if the event had listeners, else `false`. - */ - emit: function () - { - return this.layer.emit.call(arguments); - }, - - /** - * Checks all of the current model values against the `dirtyCache` to see if the - * normal and transform matrices need updating. - * - * @method Phaser.Geom.Mesh.Model#isDirty - * @since 3.50.0 - * - * @return {boolean} Returns `true` if any of the model values are dirty, otherwise `false`. - */ - isDirty: function () - { - var position = this.position; - var rotation = this.rotation; - var scale = this.scale; - - var dirtyCache = this.dirtyCache; - - var px = position.x; - var py = position.y; - var pz = position.z; - - var rx = rotation.x; - var ry = rotation.y; - var rz = rotation.z; - var rw = rotation.w; - - var sx = scale.x; - var sy = scale.y; - var sz = scale.z; - - var vertices = this.vertexCount; - - var pxCached = dirtyCache[0]; - var pyCached = dirtyCache[1]; - var pzCached = dirtyCache[2]; - - var rxCached = dirtyCache[3]; - var ryCached = dirtyCache[4]; - var rzCached = dirtyCache[5]; - var rwCached = dirtyCache[6]; - - var sxCached = dirtyCache[7]; - var syCached = dirtyCache[8]; - var szCached = dirtyCache[9]; - - var vCached = dirtyCache[10]; - - dirtyCache[0] = px; - dirtyCache[1] = py; - dirtyCache[2] = pz; - - dirtyCache[3] = rx; - dirtyCache[4] = ry; - dirtyCache[5] = rz; - dirtyCache[6] = rw; - - dirtyCache[7] = sx; - dirtyCache[8] = sy; - dirtyCache[9] = sz; - - dirtyCache[10] = vertices; - - return ( - pxCached !== px || pyCached !== py || pzCached !== pz || - rxCached !== rx || ryCached !== ry || rzCached !== rz || rwCached !== rw || - sxCached !== sx || syCached !== sy || szCached !== sz || - vCached !== vertices - ); - }, - - /** - * Internal update handler. Advances any animations that are set on the model and, - * if the model data is dirty, recalculates the transform and normal matrices. - * - * This method is called automatically by the `Layer3D` to which this model belongs. - * - * @method Phaser.Geom.Mesh.Model#preUpdate - * @since 3.50.0 - * - * @param {number} time - The current timestamp. - * @param {number} delta - The delta time, in ms, elapsed since the last frame. - */ - preUpdate: function (time, delta) - { - this.anims.update(time, delta); - - // If the model isn't dirty we can bail out and save lots of math - if (this.isDirty()) - { - var normalMatrix = this.normalMatrix; - var transformMatrix = this.transformMatrix; - - // TODO - Merge scale into this op - transformMatrix.fromRotationTranslation(this.rotation, this.position); - transformMatrix.scale(this.scale); - - normalMatrix.copy(transformMatrix); - normalMatrix.invert(); - normalMatrix.transpose(); - } - }, - - /** - * Returns the total number of Faces _currently added_ to this model. - * - * Models in Phaser 3 must always be triangulated, so this value is the same as - * `vertexCount / 3`. - * - * @method Phaser.Geom.Mesh.Model#getFaceCount - * @since 3.50.0 - * - * @return {number} The number of Faces in this Model. - */ - getFaceCount: function () - { - return this.vertexCount / 3; - }, - - /** - * Gets the Vertex at the given offset from this models data. - * - * Be aware that the returned Vertex is untranslated, so will need transforming if you wish - * to use its coordinates in world space. - * - * @method Phaser.Geom.Mesh.Model#getVertex - * @since 3.50.0 - * - * @param {number} index - The index of the vertex to get. Cannot be negative, or exceed `Model.vertexCount`. - * - * @return {Phaser.Types.GameObjects.Vertex} A Vertex object. - */ - getVertex: function (index) - { - var vertexViewF32 = this.vertexViewF32; - - // 8 = attribute count (number of items added into the view below) - var vertexOffset = (index * 8) - 1; - - var x = vertexViewF32[++vertexOffset]; - var y = vertexViewF32[++vertexOffset]; - var z = vertexViewF32[++vertexOffset]; - var normalX = vertexViewF32[++vertexOffset]; - var normalY = vertexViewF32[++vertexOffset]; - var normalZ = vertexViewF32[++vertexOffset]; - var u = vertexViewF32[++vertexOffset]; - var v = vertexViewF32[++vertexOffset]; - - return { x: x, y: y, z: z, u: u, v: v, normalX: normalX, normalY: normalY, normalZ: normalZ, alpha: 1 }; - }, - - /** - * Returns the Face at the given index in this model. - * - * A face comprises of 3 vertices. - * - * Be aware that the Face vertices are untranslated, so will need transforming if you wish - * to use their coordinates in world space. - * - * @method Phaser.Geom.Mesh.Model#getFace - * @since 3.50.0 - * - * @param {number} index - The index of the Face to get. Make sure the index is in range. - * - * @return {Phaser.Types.GameObjects.Face} The Face at the given index. - */ - getFace: function (index) - { - var offset = index * 3; - - var v1 = this.getVertex(offset); - var v2 = this.getVertex(offset + 1); - var v3 = this.getVertex(offset + 2); - var ccw = (v2.x - v1.x) * (v3.y - v1.y) - (v2.y - v1.y) * (v3.x - v1.x) >= 0; - - return { vertex1: v1, vertex2: v2, vertex3: 3, isCounterClockwise: ccw }; - }, - - /** - * Resets the data in this model, clearing the `vertexData` ArrayBuffer and - * setting it to the new max count given. - * - * @method Phaser.Geom.Mesh.Model#resetVertices - * @since 3.50.0 - * - * @param {number} verticesCount - The total number of vertices this model can contain. - */ - resetVertices: function (verticesCount) - { - this.vertexData = new ArrayBuffer(verticesCount * this.vertexSize); - this.vertexViewF32 = new Float32Array(this.vertexData); - this.vertexCount = 0; - this.maxVertexCount = verticesCount; - - return this; - }, - - /** - * Updates all values of the vertex at the given index. - * - * Ensure that the index is in range. - * - * @method Phaser.Geom.Mesh.Model#updateVertex - * @since 3.50.0 - * - * @param {number} index - The index of the vertex to update. - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} z - The z position of the vertex. - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - * @param {number} normalX - The x normal of the vertex. - * @param {number} normalY - The y normal of the vertex. - * @param {number} normalZ - The z normal of the vertex. - */ - updateVertex: function (index, x, y, z, u, v, normalX, normalY, normalZ) - { - var vertexViewF32 = this.vertexViewF32; - - // 8 = attribute count - var vertexOffset = (index * 8) - 1; - - vertexViewF32[++vertexOffset] = x; - vertexViewF32[++vertexOffset] = y; - vertexViewF32[++vertexOffset] = z; - vertexViewF32[++vertexOffset] = normalX; - vertexViewF32[++vertexOffset] = normalY; - vertexViewF32[++vertexOffset] = normalZ; - vertexViewF32[++vertexOffset] = u; - vertexViewF32[++vertexOffset] = v; - }, - - /** - * Adds a new vertex to this model and increments the `vertexCount` by one. - * - * You cannot add more vertices to this model than the total specified when the model was created. - * If you need to clear all vertices first, call `Model.resetVertices`. - * - * @method Phaser.Geom.Mesh.Model#addVertex - * @since 3.50.0 - * - * @param {number} x - The x position of the vertex. - * @param {number} y - The y position of the vertex. - * @param {number} z - The z position of the vertex. - * @param {number} u - The UV u coordinate of the vertex. - * @param {number} v - The UV v coordinate of the vertex. - * @param {number} normalX - The x normal of the vertex. - * @param {number} normalY - The y normal of the vertex. - * @param {number} normalZ - The z normal of the vertex. - */ - addVertex: function (x, y, z, u, v, normalX, normalY, normalZ) - { - if (this.vertexCount < this.maxVertexCount) - { - this.updateVertex(this.vertexCount, x, y, z, u, v, normalX, normalY, normalZ); - - this.vertexCount++; - } - }, - - /** - * Adds vertices to this model by parsing the given arrays. - * - * This method will take vertex data in one of two formats, based on the `containsZ` parameter. - * - * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) - * - * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. - * - * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. - * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. - * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. - * - * The following example will create a 256 x 256 sized quad using an index array: - * - * ```javascript - * const vertices = [ - * -128, 128, - * 128, 128, - * -128, -128, - * 128, -128 - * ]; - * - * const uvs = [ - * 0, 1, - * 1, 1, - * 0, 0, - * 1, 0 - * ]; - * - * const indices = [ 0, 2, 1, 2, 3, 1 ]; - * - * Model.addVertices(vertices, uvs, indicies); - * ``` - * - * You cannot add more vertices to this model than the total specified when the model was created. - * If you need to clear all vertices first, call `Model.resetVertices`. - * - * @method Phaser.Geom.Mesh.Model#addVertices - * @since 3.50.0 - * - * @param {number[]} vertices - The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. - * @param {number[]} uvs - The UVs pairs array. - * @param {number[]} [normals] - Optional vertex normals array. If you don't have one, pass `null` or an empty array. - * @param {number[]} [indicies] - Optional vertex indicies array. If you don't have one, pass `null` or an empty array. - * @param {boolean} [containsZ=false] - Does the vertices data include a `z` component? - */ - addVertices: function (vertices, uvs, normals, indicies, containsZ) - { - if (containsZ === undefined) { containsZ = false; } - - if (vertices.length !== uvs.length) - { - throw new Error('Model vertices and uv count not equal'); - } - - var i; - var x; - var y; - var z; - var u; - var v; - var normalX; - var normalY; - var normalZ; - var iInc = (containsZ) ? 3 : 2; - - if (Array.isArray(indicies) && indicies.length > 0) - { - for (i = 0; i < indicies.length; i++) - { - var index = indicies[i] * iInc; - - x = vertices[index]; - y = vertices[index + 1]; - z = (containsZ) ? vertices[index + 2] : 0; - u = uvs[index]; - v = uvs[index + 1]; - normalX = 0; - normalY = 0; - normalZ = 0; - - if (normals) - { - normalX = normals[index]; - normalY = normals[index + 1]; - normalZ = (containsZ) ? normals[index + 2] : 0; - } - - this.addVertex( - x, y, z, - u, v, - normalX, normalY, normalZ - ); - } - } - else - { - for (i = 0; i < vertices.length; i += iInc) - { - x = vertices[i]; - y = vertices[i + 1]; - z = (containsZ) ? vertices[i + 2] : 0; - u = uvs[i]; - v = uvs[i + 1]; - normalX = 0; - normalY = 0; - normalZ = 0; - - if (normals) - { - normalX = normals[i]; - normalY = normals[i + 1]; - normalZ = (containsZ) ? normals[i + 2] : 0; - } - - this.addVertex( - x, y, z, - u, v, - normalX, normalY, normalZ - ); - } - } - }, - - /** - * Rotates this model along the x axis by the given amount. - * - * This method works by calling the `rotateX` method of the `rotation` quaternion of this model. - * - * @method Phaser.Geom.Mesh.Model#rotateX - * @since 3.50.0 - * - * @param {number} rad - The amount, in radians, to rotate the model by. - * - * @return {this} This model instance. - */ - rotateX: function (rad) - { - this.rotation.rotateX(rad); - - return this; - }, - - /** - * Rotates this model along the y axis by the given amount. - * - * This method works by calling the `rotateY` method of the `rotation` quaternion of this model. - * - * @method Phaser.Geom.Mesh.Model#rotateY - * @since 3.50.0 - * - * @param {number} rad - The amount, in radians, to rotate the model by. - * - * @return {this} This model instance. - */ - rotateY: function (rad) - { - this.rotation.rotateY(rad); - - return this; - }, - - /** - * Rotates this model along the z axis by the given amount. - * - * This method works by calling the `rotateZ` method of the `rotation` quaternion of this model. - * - * @method Phaser.Geom.Mesh.Model#rotateZ - * @since 3.50.0 - * - * @param {number} rad - The amount, in radians, to rotate the model by. - * - * @return {this} This model instance. - */ - rotateZ: function (rad) - { - this.rotation.rotateZ(rad); - - return this; - }, - - setPosition: function (x, y, z) - { - this.position.set(x, y, z); - - return this; - }, - - setScale: function (x, y, z) - { - this.scale.set(x, y, z); - - return this; - }, - - /** - * The x position of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#x - * @type {number} - * @since 3.50.0 - */ - x: { - - get: function () - { - return this.position.x; - }, - - set: function (value) - { - this.position.x = value; - } - - }, - - /** - * The y position of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#y - * @type {number} - * @since 3.50.0 - */ - y: { - - get: function () - { - return this.position.y; - }, - - set: function (value) - { - this.position.y = value; - } - - }, - - /** - * The z position of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#z - * @type {number} - * @since 3.50.0 - */ - z: { - - get: function () - { - return this.position.z; - }, - - set: function (value) - { - this.position.z = value; - } - - }, - - /** - * The x scale of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#scaleX - * @type {number} - * @since 3.50.0 - */ - scaleX: { - - get: function () - { - return this.scale.x; - }, - - set: function (value) - { - this.scale.x = value; - } - - }, - - /** - * The y scale of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#scaleY - * @type {number} - * @since 3.50.0 - */ - scaleY: { - - get: function () - { - return this.scale.y; - }, - - set: function (value) - { - this.scale.y = value; - } - - }, - - /** - * The z scale of this model in 3D space. - * - * @name Phaser.Geom.Mesh.Model#scaleZ - * @type {number} - * @since 3.50.0 - */ - scaleZ: { - - get: function () - { - return this.scale.z; - }, - - set: function (value) - { - this.scale.z = value; - } - - }, - - /** - * Destroys this Model instance, all of its vertex data and references. - * - * Calling this method will not remove it from any parent Layer3D, so be sure to do that first, - * prior to calling `destroy`. - * - * If a Layer3D object is destroyed, this is the method that is called on all of its models. - * - * @method Phaser.Geom.Mesh.Model#destroy - * @since 3.50.0 - */ - destroy: function () - { - this.anims.destroy(); - - this.layer = null; - this.scene = null; - this.anims = null; - - this.vertexData = null; - this.vertexViewF32 = null; - - this.position = null; - this.scale = null; - this.rotation = null; - - this.ambient = null; - this.diffuse = null; - this.specular = null; - - this.normalMatrix = null; - this.transformMatrix = null; - } - -}); - -module.exports = Model; diff --git a/src/geom/mesh/ParseObj.js b/src/geom/mesh/ParseObj.js index 975960939..9a9ca803b 100644 --- a/src/geom/mesh/ParseObj.js +++ b/src/geom/mesh/ParseObj.js @@ -224,16 +224,17 @@ function parseUseMtl (lineItems) } /** - * Parses a Wavefront OBJ File, extracting the models from it and returning them - * in an array. + * Parses a Wavefront OBJ File, extracting the models from it and returning them in an array. * - * @function Phaser.Geom.ParseObj + * The model data *must* be triangulated for a Mesh Game Object to be able to render it. + * + * @function Phaser.Geom.Mesh.ParseObj * @since 3.50.0 * * @param {string} data - The OBJ File data as a raw string. - * @param {boolean} [flipUV=true] - + * @param {boolean} [flipUV=true] - Flip the UV coordinates? * - * @return {array} An array of model data. + * @return {Phaser.Types.Geom.Mesh.OBJData} The parsed model and material data. */ var ParseObj = function (data, flipUV) { @@ -243,6 +244,7 @@ var ParseObj = function (data, flipUV) // Store results in here var result = { + materials: {}, materialLibraries: [], models: [] }; @@ -264,30 +266,37 @@ var ParseObj = function (data, flipUV) // Start A New Model parseObject(lineItems, result); break; + case 'g': // Start a new polygon group parseGroup(lineItems); break; + case 'v': // Define a vertex for the current model parseVertexCoords(lineItems, result); break; + case 'vt': // Texture Coords parseTextureCoords(lineItems, result); break; + case 'vn': // Define a vertex normal for the current model parseVertexNormal(lineItems, result); break; + case 'f': // Define a Face/Polygon parsePolygon(lineItems, result); break; + case 'mtllib': // Reference to a material library file (.mtl) parseMtlLib(lineItems, result); break; + case 'usemtl': // Sets the current material to be applied to polygons defined from this point forward parseUseMtl(lineItems); diff --git a/src/geom/mesh/ParseObjMaterial.js b/src/geom/mesh/ParseObjMaterial.js new file mode 100644 index 000000000..98f40566a --- /dev/null +++ b/src/geom/mesh/ParseObjMaterial.js @@ -0,0 +1,72 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var GetColor = require('../../display/color/GetColor'); + +/** + * Takes a Wavefront Material file and extracts the diffuse reflectivity of the named + * materials, converts them to integer color values and returns them. + * + * This is used internally by the `addOBJ` and `addModel` methods, but is exposed for + * public consumption as well. + * + * Note this only works with diffuse values, specified in the `Kd r g b` format, where + * `g` and `b` are optional, but `r` is required. It does not support spectral rfl files, + * or any other material statement (such as `Ka` or `Ks`) + * + * @method Phaser.Geom.Mesh.ParseObjMaterial + * @since 3.50.0 + * + * @param {string} mtl - The OBJ MTL file as a raw string, i.e. loaded via `this.load.text`. + * + * @return {object} The parsed material colors, where each property of the object matches the material name. + */ +var ParseObjMaterial = function (mtl) +{ + var output = {}; + + var lines = mtl.split('\n'); + + var currentMaterial = ''; + + for (var i = 0; i < lines.length; i++) + { + var line = lines[i].trim(); + + if (line.indexOf('#') === 0 || line === '') + { + continue; + } + + var lineItems = line.replace(/\s\s+/g, ' ').trim().split(' '); + + switch (lineItems[0].toLowerCase()) + { + case 'newmtl': + { + currentMaterial = lineItems[1]; + break; + } + + // The diffuse reflectivity of the current material + // Support r, [g], [b] format, where g and b are optional + case 'kd': + { + var r = Math.floor(lineItems[1] * 255); + var g = (lineItems.length >= 2) ? Math.floor(lineItems[2] * 255) : r; + var b = (lineItems.length >= 3) ? Math.floor(lineItems[3] * 255) : r; + + output[currentMaterial] = GetColor(r, g, b); + + break; + } + } + } + + return output; +}; + +module.exports = ParseObjMaterial; diff --git a/src/geom/mesh/RotateFace.js b/src/geom/mesh/RotateFace.js new file mode 100644 index 000000000..68ec677b3 --- /dev/null +++ b/src/geom/mesh/RotateFace.js @@ -0,0 +1,59 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Rotates the vertices of a Face to the given angle. + * + * The actual vertex positions are adjusted, not their transformed positions. + * + * Therefore, this updates the vertex data directly. + * + * @function Phaser.Geom.Mesh.RotateFace + * @since 3.50.0 + * + * @param {Phaser.Geom.Mesh.Face} face - The Face to rotate. + * @param {number} angle - The angle to rotate to, in radians. + * @param {number} [cx] - An optional center of rotation. If not given, the Face in-center is used. + * @param {number} [cy] - An optional center of rotation. If not given, the Face in-center is used. + */ +var RotateFace = function (face, angle, cx, cy) +{ + var x; + var y; + + // No point of rotation? Use the inCenter instead, then. + if (cx === undefined && cy === undefined) + { + var inCenter = face.getInCenter(); + + x = inCenter.x; + y = inCenter.y; + } + + var c = Math.cos(angle); + var s = Math.sin(angle); + + var v1 = face.vertex1; + var v2 = face.vertex2; + var v3 = face.vertex3; + + var tx = v1.x - x; + var ty = v1.y - y; + + v1.set(tx * c - ty * s + x, tx * s + ty * c + y); + + tx = v2.x - x; + ty = v2.y - y; + + v2.set(tx * c - ty * s + x, tx * s + ty * c + y); + + tx = v3.x - x; + ty = v3.y - y; + + v3.set(tx * c - ty * s + x, tx * s + ty * c + y); +}; + +module.exports = RotateFace; diff --git a/src/geom/mesh/Vertex.js b/src/geom/mesh/Vertex.js new file mode 100644 index 000000000..247a275c1 --- /dev/null +++ b/src/geom/mesh/Vertex.js @@ -0,0 +1,289 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../utils/Class'); +var Utils = require('../../renderer/webgl/Utils'); +var Vector3 = require('../../math/Vector3'); + +/** + * @classdesc + * A Vertex Geometry Object. + * + * This class consists of all the information required for a single vertex within a Face Geometry Object. + * + * Faces, and thus Vertex objects, are used by the Mesh Game Object in order to render objects in WebGL. + * + * @class Vertex + * @memberof Phaser.Geom.Mesh + * @constructor + * @extends Phaser.Math.Vector3 + * @since 3.50.0 + * + * @param {number} x - The x position of the vertex. + * @param {number} y - The y position of the vertex. + * @param {number} z - The z position of the vertex. + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * @param {number} [color=0xffffff] - The color value of the vertex. + * @param {number} [alpha=1] - The alpha value of the vertex. + * @param {number} [nx=0] - The x normal value of the vertex. + * @param {number} [ny=0] - The y normal value of the vertex. + * @param {number} [nz=0] - The z normal value of the vertex. + */ +var Vertex = new Class({ + + Extends: Vector3, + + initialize: + + function Vertex (x, y, z, u, v, color, alpha, nx, ny, nz) + { + if (color === undefined) { color = 0xffffff; } + if (alpha === undefined) { alpha = 1; } + if (nx === undefined) { nx = 0; } + if (ny === undefined) { ny = 0; } + if (nz === undefined) { nz = 0; } + + Vector3.call(this, x, y, z); + + /** + * The projected x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vx + * @type {number} + * @since 3.50.0 + */ + this.vx = 0; + + /** + * The projected y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vy + * @type {number} + * @since 3.50.0 + */ + this.vy = 0; + + /** + * The projected z coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#vz + * @type {number} + * @since 3.50.0 + */ + this.vz = 0; + + /** + * The projected x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#nx + * @type {number} + * @since 3.50.0 + */ + this.nx = nx; + + /** + * The projected y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ny + * @type {number} + * @since 3.50.0 + */ + this.ny = ny; + + /** + * The projected z coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#nz + * @type {number} + * @since 3.50.0 + */ + this.nz = nz; + + /** + * UV u coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#u + * @type {number} + * @since 3.50.0 + */ + this.u = u; + + /** + * UV v coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#v + * @type {number} + * @since 3.50.0 + */ + this.v = v; + + /** + * The color value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#color + * @type {number} + * @since 3.50.0 + */ + this.color = color; + + /** + * The alpha value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#alpha + * @type {number} + * @since 3.50.0 + */ + this.alpha = alpha; + + /** + * The translated x coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#tx + * @type {number} + * @since 3.50.0 + */ + this.tx = 0; + + /** + * The translated y coordinate of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ty + * @type {number} + * @since 3.50.0 + */ + this.ty = 0; + + /** + * The translated alpha value of this vertex. + * + * @name Phaser.Geom.Mesh.Vertex#ta + * @type {number} + * @since 3.50.0 + */ + this.ta = 0; + }, + + /** + * Sets the U and V properties. + * + * @method Phaser.Geom.Mesh.Vertex#setUVs + * @since 3.50.0 + * + * @param {number} u - The UV u coordinate of the vertex. + * @param {number} v - The UV v coordinate of the vertex. + * + * @return {this} This Vertex. + */ + setUVs: function (u, v) + { + this.u = u; + this.v = v; + + return this; + }, + + /** + * Transforms this vertex by the given matrix, storing the results in `vx`, `vy` and `vz`. + * + * @method Phaser.Geom.Mesh.Vertex#transformCoordinatesLocal + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} transformMatrix - The transform matrix to apply to this vertex. + * @param {number} width - The width of the parent Mesh. + * @param {number} height - The height of the parent Mesh. + * @param {number} cameraZ - The z position of the MeshCamera. + */ + transformCoordinatesLocal: function (transformMatrix, width, height, cameraZ) + { + var x = this.x; + var y = this.y; + var z = this.z; + + var m = transformMatrix.val; + + var tx = (x * m[0]) + (y * m[4]) + (z * m[8]) + m[12]; + var ty = (x * m[1]) + (y * m[5]) + (z * m[9]) + m[13]; + var tz = (x * m[2]) + (y * m[6]) + (z * m[10]) + m[14]; + var tw = (x * m[3]) + (y * m[7]) + (z * m[11]) + m[15]; + + this.vx = (tx / tw) * width; + this.vy = -(ty / tw) * height; + + if (cameraZ <= 0) + { + this.vz = (tz / tw); + } + else + { + this.vz = -(tz / tw); + } + }, + + /** + * Updates this Vertex based on the given transform. + * + * @method Phaser.Geom.Mesh.Vertex#update + * @since 3.50.0 + * + * @param {number} a - The parent transform matrix data a component. + * @param {number} b - The parent transform matrix data b component. + * @param {number} c - The parent transform matrix data c component. + * @param {number} d - The parent transform matrix data d component. + * @param {number} e - The parent transform matrix data e component. + * @param {number} f - The parent transform matrix data f component. + * @param {boolean} roundPixels - Round the vertex position or not? + * @param {number} alpha - The alpha of the parent object. + * + * @return {this} This Vertex. + */ + update: function (a, b, c, d, e, f, roundPixels, alpha) + { + var tx = this.vx * a + this.vy * c + e; + var ty = this.vx * b + this.vy * d + f; + + if (roundPixels) + { + tx = Math.round(tx); + ty = Math.round(ty); + } + + this.tx = tx; + this.ty = ty; + this.ta = this.alpha * alpha; + + return this; + }, + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * + * @method Phaser.Geom.Mesh.Vertex#load + * @since 3.50.0 + * + * @param {Float32Array} F32 - A Float32 Array to insert the position, UV and unit data in to. + * @param {Uint32Array} U32 - A Uint32 Array to insert the color and alpha data in to. + * @param {number} offset - The index of the array to insert this Vertex to. + * @param {number} textureUnit - The texture unit currently in use. + * + * @return {number} The new array offset. + */ + load: function (F32, U32, offset, textureUnit, tintEffect) + { + F32[++offset] = this.tx; + F32[++offset] = this.ty; + F32[++offset] = this.u; + F32[++offset] = this.v; + F32[++offset] = textureUnit; + F32[++offset] = tintEffect; + U32[++offset] = Utils.getTintAppendFloatAlpha(this.color, this.ta); + + return offset; + } + +}); + +module.exports = Vertex; diff --git a/src/geom/mesh/index.js b/src/geom/mesh/index.js index 606b2dff7..dcf8a097b 100644 --- a/src/geom/mesh/index.js +++ b/src/geom/mesh/index.js @@ -10,8 +10,14 @@ var Mesh = { - Model: require('./Model'), - ParseObj: require('./ParseObj') + Face: require('./Face'), + GenerateGridVerts: require('./GenerateGridVerts'), + GenerateObjVerts: require('./GenerateObjVerts'), + GenerateVerts: require('./GenerateVerts'), + ParseObj: require('./ParseObj'), + ParseObjMaterial: require('./ParseObjMaterial'), + RotateFace: require('./RotateFace'), + Vertex: require('./Vertex') }; diff --git a/src/geom/mesh/typedefs/GenerateGridConfig.js b/src/geom/mesh/typedefs/GenerateGridConfig.js new file mode 100644 index 000000000..f4ff7e15c --- /dev/null +++ b/src/geom/mesh/typedefs/GenerateGridConfig.js @@ -0,0 +1,19 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.GenerateGridConfig + * @since 3.50.0 + * + * @property {(string|Phaser.Textures.Texture)} texture - The texture to be used for this Grid. Must be a Texture instance. Can also be a string but only if the `mesh` property is set. + * @property {(string|number)} [frame] - The name or index of the frame within the Texture. + * @property {Phaser.GameObjects.Mesh} [mesh] - If specified, the vertices of the generated grid will be added to this Mesh Game Object. + * @property {number} [width=1] - The width of the grid in 3D units. If you wish to get a pixel accurate grid based on a texture, you can use an Ortho Mesh or the `isOrtho` parameter. + * @property {number} [height=width] - The height of the grid in 3D units. + * @property {number} [widthSegments=1] - The number of segments to split the grid horizontally in to. + * @property {number} [heightSegments=widthSegments] - The number of segments to split the grid vertically in to. + * @property {number} [x=0] - Offset the grid x position by this amount. + * @property {number} [y=0] - Offset the grid y position by this amount. + * @property {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @property {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + * @property {boolean} [tile=false] - Should the texture tile (repeat) across the grid segments, or display as a single texture? + * @property {boolean} [isOrtho=false] - If set and using a texture with an ortho Mesh, the `width` and `height` parameters will be calculated based on the frame size for you. + * @property {boolean} [flipY=false] - If set and using a texture, vertically flipping render result. + */ diff --git a/src/geom/mesh/typedefs/GenerateGridVertsResult.js b/src/geom/mesh/typedefs/GenerateGridVertsResult.js new file mode 100644 index 000000000..d7693c84d --- /dev/null +++ b/src/geom/mesh/typedefs/GenerateGridVertsResult.js @@ -0,0 +1,10 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.GenerateGridVertsResult + * @since 3.50.0 + * + * @property {number[]} verts - An array of vertex values in x, y pairs. + * @property {number[]} indices - An array of vertex indexes. This array will be empty if the `tile` parameter was `true`. + * @property {number[]} uvs - An array of UV values, two per vertex. + * @property {number|number[]} [colors=0xffffff] - An array of colors, one per vertex, or a single color value applied to all vertices. + * @property {number|number[]} [alphas=1] - An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + */ diff --git a/src/geom/mesh/typedefs/GenerateVertsResult.js b/src/geom/mesh/typedefs/GenerateVertsResult.js new file mode 100644 index 000000000..b58adaf33 --- /dev/null +++ b/src/geom/mesh/typedefs/GenerateVertsResult.js @@ -0,0 +1,7 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.GenerateVertsResult + * @since 3.50.0 + * + * @property {Phaser.Geom.Mesh.Face[]} faces - An array of Face objects generated from the OBJ Data. + * @property {Phaser.Geom.Mesh.Vertex[]} verts - An array of Vertex objects generated from the OBJ Data. + */ diff --git a/src/geom/mesh/typedefs/OBJData.js b/src/geom/mesh/typedefs/OBJData.js new file mode 100644 index 000000000..199035da9 --- /dev/null +++ b/src/geom/mesh/typedefs/OBJData.js @@ -0,0 +1,8 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.OBJData + * @since 3.50.0 + * + * @property {string[]} materialLibraries - An array of material library filenames found in the OBJ file. + * @property {object} materials - If the obj was loaded with an mtl file, the parsed material names are stored in this object. + * @property {Phaser.Types.Geom.Mesh.OBJModel[]} models - An array of parsed models extracted from the OBJ file. + */ diff --git a/src/geom/mesh/typedefs/OBJFace.js b/src/geom/mesh/typedefs/OBJFace.js new file mode 100644 index 000000000..74db317da --- /dev/null +++ b/src/geom/mesh/typedefs/OBJFace.js @@ -0,0 +1,8 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.OBJFace + * @since 3.50.0 + * + * @property {string} group - The name of the Group this Face is in. + * @property {string} material - The name of the material this Face uses. + * @property {Phaser.Types.Geom.Mesh.OBJFaceVertice[]} vertices - An array of vertices in this Face. + */ diff --git a/src/geom/mesh/typedefs/OBJFaceVertice.js b/src/geom/mesh/typedefs/OBJFaceVertice.js new file mode 100644 index 000000000..088ee261d --- /dev/null +++ b/src/geom/mesh/typedefs/OBJFaceVertice.js @@ -0,0 +1,8 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.OBJFaceVertice + * @since 3.50.0 + * + * @property {number} textureCoordsIndex - The index in the `textureCoords` array that this vertex uses. + * @property {number} vertexIndex - The index in the `vertices` array that this vertex uses. + * @property {number} vertexNormalIndex - The index in the `vertexNormals` array that this vertex uses. + */ diff --git a/src/geom/mesh/typedefs/OBJModel.js b/src/geom/mesh/typedefs/OBJModel.js new file mode 100644 index 000000000..080591e4c --- /dev/null +++ b/src/geom/mesh/typedefs/OBJModel.js @@ -0,0 +1,10 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.OBJModel + * @since 3.50.0 + * + * @property {Phaser.Types.Geom.Mesh.OBJFace[]} faces - An array of Faces. + * @property {string} name - The name of the model. + * @property {Phaser.Types.Geom.Mesh.UV[]} textureCoords - An array of texture coordinates. + * @property {Phaser.Types.Math.Vector3Like[]} vertexNormals - An array of vertex normals. + * @property {Phaser.Types.Math.Vector3Like[]} vertices - An array of vertices in the model. + */ diff --git a/src/geom/mesh/typedefs/UV.js b/src/geom/mesh/typedefs/UV.js new file mode 100644 index 000000000..6cea294f5 --- /dev/null +++ b/src/geom/mesh/typedefs/UV.js @@ -0,0 +1,8 @@ +/** + * @typedef {object} Phaser.Types.Geom.Mesh.UV + * @since 3.50.0 + * + * @property {number} u - The u component. + * @property {number} v - The v component. + * @property {number} w - The w component. + */ diff --git a/src/geom/mesh/typedefs/index.js b/src/geom/mesh/typedefs/index.js new file mode 100644 index 000000000..ad142cffb --- /dev/null +++ b/src/geom/mesh/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.Geom.Mesh + */ diff --git a/src/geom/point/Point.js b/src/geom/point/Point.js index 2b7635a46..2c5164b7d 100644 --- a/src/geom/point/Point.js +++ b/src/geom/point/Point.js @@ -33,7 +33,7 @@ var Point = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Point#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ diff --git a/src/geom/polygon/GetPoints.js b/src/geom/polygon/GetPoints.js index 42c3210e5..cf46fc3a7 100644 --- a/src/geom/polygon/GetPoints.js +++ b/src/geom/polygon/GetPoints.js @@ -16,7 +16,7 @@ var Perimeter = require('./Perimeter'); * @since 3.12.0 * * @param {Phaser.Geom.Polygon} polygon - The Polygon to get the points from. - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param {array} [output] - An array to insert the points in to. If not provided a new array will be created. * diff --git a/src/geom/polygon/Polygon.js b/src/geom/polygon/Polygon.js index 98178a459..c701de371 100644 --- a/src/geom/polygon/Polygon.js +++ b/src/geom/polygon/Polygon.js @@ -14,7 +14,7 @@ var GEOM_CONST = require('../const'); * A Polygon object * * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points. - * Several formats are supported to define the list of points, check the setTo method for details. + * Several formats are supported to define the list of points, check the setTo method for details. * This is a geometry object allowing you to define and inspect the shape. * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. * To render a Polygon you should look at the capabilities of the Graphics class. @@ -24,7 +24,7 @@ var GEOM_CONST = require('../const'); * @constructor * @since 3.0.0 * - * @param {Phaser.Geom.Point[]} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - List of points defining the perimeter of this Polygon. Several formats are supported: * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x y properties: `[obj1, obj2, ...]` @@ -42,7 +42,7 @@ var Polygon = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Polygon#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -105,7 +105,7 @@ var Polygon = new Class({ * @method Phaser.Geom.Polygon#setTo * @since 3.0.0 * - * @param {array} points - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. + * @param {(string|number[]|Phaser.Types.Math.Vector2Like[])} [points] - Points defining the perimeter of this polygon. Please check function description above for the different supported formats. * * @return {this} This Polygon object. */ @@ -212,7 +212,7 @@ var Polygon = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. + * @param {number} quantity - The amount of points to return. If a falsey value the quantity will be derived from the `stepRate` instead. * @param {number} [stepRate] - Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param {(array|Phaser.Geom.Point[])} [output] - An array to insert the points in to. If not provided a new array will be created. * diff --git a/src/geom/polygon/Simplify.js b/src/geom/polygon/Simplify.js index dfcc8b89e..2f6178b74 100644 --- a/src/geom/polygon/Simplify.js +++ b/src/geom/polygon/Simplify.js @@ -29,8 +29,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -'use strict'; - /** * @ignore */ diff --git a/src/geom/rectangle/GetPoints.js b/src/geom/rectangle/GetPoints.js index 9b23b6bd9..ca807aa3c 100644 --- a/src/geom/rectangle/GetPoints.js +++ b/src/geom/rectangle/GetPoints.js @@ -20,7 +20,7 @@ var Perimeter = require('./Perimeter'); * * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle object to get the points from. * @param {number} step - Step between points. Used to calculate the number of points to return when quantity is falsey. Ignored if quantity is positive. - * @param {integer} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. + * @param {number} quantity - The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. * @param {(array|Phaser.Geom.Point[])} [out] - An optional array to store the points in. * * @return {(array|Phaser.Geom.Point[])} An array of Points from the perimeter of the rectangle. diff --git a/src/geom/rectangle/MarchingAnts.js b/src/geom/rectangle/MarchingAnts.js index c0c452cea..6473eee29 100644 --- a/src/geom/rectangle/MarchingAnts.js +++ b/src/geom/rectangle/MarchingAnts.js @@ -19,7 +19,7 @@ var Point = require('../point/Point'); * * @param {Phaser.Geom.Rectangle} rect - The Rectangle to get the perimeter points from. * @param {number} [step] - The distance between each point of the perimeter. Set to `null` if you wish to use the `quantity` parameter instead. - * @param {integer} [quantity] - The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value. + * @param {number} [quantity] - The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value. * @param {(array|Phaser.Geom.Point[])} [out] - An array in which the perimeter points will be stored. If not given, a new array instance is created. * * @return {(array|Phaser.Geom.Point[])} An array containing the perimeter points from the Rectangle. diff --git a/src/geom/rectangle/PerimeterPoint.js b/src/geom/rectangle/PerimeterPoint.js index e76b79702..d03f53d64 100644 --- a/src/geom/rectangle/PerimeterPoint.js +++ b/src/geom/rectangle/PerimeterPoint.js @@ -16,7 +16,7 @@ var DegToRad = require('../../math/DegToRad'); * @generic {Phaser.Geom.Point} O - [out,$return] * * @param {Phaser.Geom.Rectangle} rectangle - The Rectangle to get the perimeter point from. - * @param {integer} angle - The angle of the point, in degrees. + * @param {number} angle - The angle of the point, in degrees. * @param {Phaser.Geom.Point} [out] - The Point object to store the position in. If not given, a new Point instance is created. * * @return {Phaser.Geom.Point} A Point object holding the coordinates of the Rectangle perimeter. diff --git a/src/geom/rectangle/Rectangle.js b/src/geom/rectangle/Rectangle.js index a15a84216..f20be8fd0 100644 --- a/src/geom/rectangle/Rectangle.js +++ b/src/geom/rectangle/Rectangle.js @@ -42,7 +42,7 @@ var Rectangle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Rectangle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -135,7 +135,7 @@ var Rectangle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. + * @param {number} quantity - The number of points to return. Set to `false` or 0 to return an arbitrary number of points (`perimeter / stepRate`) evenly spaced around the Rectangle based on the `stepRate`. * @param {number} [stepRate] - If `quantity` is 0, determines the normalized distance between each returned point. * @param {(array|Phaser.Geom.Point[])} [output] - An array to which to append the points. * diff --git a/src/geom/triangle/GetPoints.js b/src/geom/triangle/GetPoints.js index 82192a03d..5ac6ac793 100644 --- a/src/geom/triangle/GetPoints.js +++ b/src/geom/triangle/GetPoints.js @@ -16,7 +16,7 @@ var Point = require('../point/Point'); * @generic {Phaser.Geom.Point} O - [out,$return] * * @param {Phaser.Geom.Triangle} triangle - The Triangle to get the points from. - * @param {integer} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. + * @param {number} quantity - The number of evenly spaced points to return. Set to 0 to return an arbitrary number of points based on the `stepRate`. * @param {number} stepRate - If `quantity` is 0, the distance between each returned point. * @param {(array|Phaser.Geom.Point[])} [out] - An array to which the points should be appended. * diff --git a/src/geom/triangle/Triangle.js b/src/geom/triangle/Triangle.js index 70f249871..f31c6103c 100644 --- a/src/geom/triangle/Triangle.js +++ b/src/geom/triangle/Triangle.js @@ -48,7 +48,7 @@ var Triangle = new Class({ * Used for fast type comparisons. * * @name Phaser.Geom.Triangle#type - * @type {integer} + * @type {number} * @readonly * @since 3.19.0 */ @@ -157,7 +157,7 @@ var Triangle = new Class({ * * @generic {Phaser.Geom.Point[]} O - [output,$return] * - * @param {integer} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. + * @param {number} quantity - Number of points to be generated. Can be falsey when `stepRate` should be used. All points have the same distance along the triangle. * @param {number} [stepRate] - Distance between two points. Will only be used when `quantity` is falsey. * @param {(array|Phaser.Geom.Point[])} [output] - Optional Array for writing the calculated points into. Otherwise a new array will be created. * diff --git a/src/geom/typedefs/index.js b/src/geom/typedefs/index.js new file mode 100644 index 000000000..a1aa24139 --- /dev/null +++ b/src/geom/typedefs/index.js @@ -0,0 +1,9 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Types.Geom + */ diff --git a/src/input/CreatePixelPerfectHandler.js b/src/input/CreatePixelPerfectHandler.js index d975d6d36..326af8cec 100644 --- a/src/input/CreatePixelPerfectHandler.js +++ b/src/input/CreatePixelPerfectHandler.js @@ -13,7 +13,7 @@ * @since 3.10.0 * * @param {Phaser.Textures.TextureManager} textureManager - A reference to the Texture Manager. - * @param {integer} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction. + * @param {number} alphaTolerance - The alpha level that the pixel should be above to be included as a successful interaction. * * @return {function} The new Pixel Perfect Handler function. */ diff --git a/src/input/InputManager.js b/src/input/InputManager.js index 0ae87ab3b..ba6fdac25 100644 --- a/src/input/InputManager.js +++ b/src/input/InputManager.js @@ -171,7 +171,7 @@ var InputManager = new Class({ * setting the `input.activePointers` property in the Game Config. * * @name Phaser.Input.InputManager#pointersTotal - * @type {integer} + * @type {number} * @readonly * @since 3.10.0 */ @@ -478,7 +478,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#addPointer * @since 3.10.0 * - * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * @param {number} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. * * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. */ @@ -519,7 +519,7 @@ var InputManager = new Class({ * @method Phaser.Input.InputManager#updateInputPlugins * @since 3.16.0 * - * @param {integer} type - The type of event to process. + * @param {number} type - The type of event to process. * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. */ updateInputPlugins: function (type, pointers) diff --git a/src/input/InputPlugin.js b/src/input/InputPlugin.js index 92a47f339..93bd160ff 100644 --- a/src/input/InputPlugin.js +++ b/src/input/InputPlugin.js @@ -200,7 +200,7 @@ var InputPlugin = new Class({ * Set to 0 to poll constantly. Set to -1 to only poll on user movement. * * @name Phaser.Input.InputPlugin#pollRate - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -350,7 +350,7 @@ var InputPlugin = new Class({ * A array containing the dragStates, for this Scene, index by the Pointer ID. * * @name Phaser.Input.InputPlugin#_dragState - * @type {integer[]} + * @type {number[]} * @private * @since 3.16.0 */ @@ -667,7 +667,7 @@ var InputPlugin = new Class({ * @fires Phaser.Input.Events#UPDATE * @since 3.0.0 * - * @param {integer} type - The type of event to process. + * @param {number} type - The type of event to process. * @param {Phaser.Input.Pointer[]} pointers - An array of Pointers on which the event occurred. * * @return {boolean} `true` if this Scene has captured the input events from all other Scenes, otherwise `false`. @@ -957,7 +957,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer being tested. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processDownEvents: function (pointer) { @@ -1033,7 +1033,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to get the drag state for. * - * @return {integer} The drag state of the given Pointer. + * @return {number} The drag state of the given Pointer. */ getDragState: function (pointer) { @@ -1056,7 +1056,7 @@ var InputPlugin = new Class({ * @since 3.16.0 * * @param {Phaser.Input.Pointer} pointer - The Pointer to set the drag state for. - * @param {integer} state - The drag state value. An integer between 0 and 5. + * @param {number} state - The drag state value. An integer between 0 and 5. */ setDragState: function (pointer, state) { @@ -1110,7 +1110,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that DRAG_START was called on. + * @return {number} The number of items that DRAG_START was called on. */ processDragStartList: function (pointer) { @@ -1159,7 +1159,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were collected on the drag list. + * @return {number} The number of items that were collected on the drag list. */ processDragDownEvent: function (pointer) { @@ -1239,7 +1239,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were updated by this drag event. + * @return {number} The number of items that were updated by this drag event. */ processDragMoveEvent: function (pointer) { @@ -1379,7 +1379,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The Pointer to process the drag event on. * - * @return {integer} The number of items that were updated by this drag event. + * @return {number} The number of items that were updated by this drag event. */ processDragUpEvent: function (pointer) { @@ -1444,7 +1444,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processMoveEvents: function (pointer) { @@ -1512,7 +1512,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processWheelEvent: function (pointer) { @@ -1580,7 +1580,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOverEvents: function (pointer) { @@ -1660,7 +1660,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOutEvents: function (pointer) { @@ -1688,34 +1688,31 @@ var InputPlugin = new Class({ var gameObject = previouslyOver[i]; // Call onOut for everything in the previouslyOver array - for (i = 0; i < total; i++) + gameObject = previouslyOver[i]; + + if (!gameObject.input) { - gameObject = previouslyOver[i]; + continue; + } - if (!gameObject.input) - { - continue; - } + manager.resetCursor(gameObject.input); - manager.resetCursor(gameObject.input); + gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); - gameObject.emit(Events.GAMEOBJECT_POINTER_OUT, pointer, _eventContainer); + totalInteracted++; - totalInteracted++; + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; + } - if (_eventData.cancelled || !gameObject.input) - { - aborted = true; - break; - } + this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); - this.emit(Events.GAMEOBJECT_OUT, pointer, gameObject, _eventContainer); - - if (_eventData.cancelled || !gameObject.input) - { - aborted = true; - break; - } + if (_eventData.cancelled || !gameObject.input) + { + aborted = true; + break; } if (!aborted) @@ -1745,7 +1742,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processOverOutEvents: function (pointer) { @@ -1921,7 +1918,7 @@ var InputPlugin = new Class({ * * @param {Phaser.Input.Pointer} pointer - The pointer to check for events against. * - * @return {integer} The total number of objects interacted with. + * @return {number} The total number of objects interacted with. */ processUpEvents: function (pointer) { @@ -2090,7 +2087,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#makePixelPerfect * @since 3.10.0 * - * @param {integer} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction. + * @param {number} [alphaTolerance=1] - The alpha level that the pixel should be above to be included as a successful interaction. * * @return {function} A Pixel Perfect Handler for use as a hitArea shape callback. */ @@ -2660,7 +2657,7 @@ var InputPlugin = new Class({ * @param {Phaser.GameObjects.GameObject} childA - The first Game Object to compare. * @param {Phaser.GameObjects.GameObject} childB - The second Game Object to compare. * - * @return {integer} Returns either a negative or positive integer, or zero if they match. + * @return {number} Returns either a negative or positive integer, or zero if they match. */ sortHandlerGO: function (childA, childB) { @@ -2748,7 +2745,7 @@ var InputPlugin = new Class({ * @method Phaser.Input.InputPlugin#addPointer * @since 3.10.0 * - * @param {integer} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. + * @param {number} [quantity=1] The number of new Pointers to create. A maximum of 10 is allowed in total. * * @return {Phaser.Input.Pointer[]} An array containing all of the new Pointer objects that were created. */ diff --git a/src/input/Pointer.js b/src/input/Pointer.js index ec0e75040..9a1ad2049 100644 --- a/src/input/Pointer.js +++ b/src/input/Pointer.js @@ -33,7 +33,7 @@ var OS = require('../device/OS'); * @since 3.0.0 * * @param {Phaser.Input.InputManager} manager - A reference to the Input Manager. - * @param {integer} id - The internal ID of this Pointer. + * @param {number} id - The internal ID of this Pointer. */ var Pointer = new Class({ @@ -54,7 +54,7 @@ var Pointer = new Class({ * The internal ID of this Pointer. * * @name Phaser.Input.Pointer#id - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -115,7 +115,7 @@ var Pointer = new Class({ * however, it should behave as if the left button was clicked in the standard button layout. * * @name Phaser.Input.Pointer#button - * @type {integer} + * @type {number} * @readonly * @default 0 * @since 3.18.0 @@ -134,7 +134,7 @@ var Pointer = new Class({ * In this case, the values are read from right to left. * * @name Phaser.Input.Pointer#buttons - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -1171,7 +1171,7 @@ var Pointer = new Class({ * @method Phaser.Input.Pointer#getInterpolatedPosition * @since 3.11.0 * - * @param {integer} [steps=10] - The number of interpolation steps to use. + * @param {number} [steps=10] - The number of interpolation steps to use. * @param {array} [out] - An array to store the results in. If not provided a new one will be created. * * @return {array} An array of interpolated values. diff --git a/src/input/const.js b/src/input/const.js index 757b4c2a8..0aa755cae 100644 --- a/src/input/const.js +++ b/src/input/const.js @@ -10,7 +10,7 @@ var INPUT_CONST = { * The mouse pointer is being held down. * * @name Phaser.Input.MOUSE_DOWN - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_DOWN: 0, @@ -19,7 +19,7 @@ var INPUT_CONST = { * The mouse pointer is being moved. * * @name Phaser.Input.MOUSE_MOVE - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_MOVE: 1, @@ -28,7 +28,7 @@ var INPUT_CONST = { * The mouse pointer is released. * * @name Phaser.Input.MOUSE_UP - * @type {integer} + * @type {number} * @since 3.10.0 */ MOUSE_UP: 2, @@ -37,7 +37,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_START - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_START: 3, @@ -46,7 +46,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_MOVE - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_MOVE: 4, @@ -55,7 +55,7 @@ var INPUT_CONST = { * A touch pointer has been started. * * @name Phaser.Input.TOUCH_END - * @type {integer} + * @type {number} * @since 3.10.0 */ TOUCH_END: 5, @@ -64,7 +64,7 @@ var INPUT_CONST = { * The pointer lock has changed. * * @name Phaser.Input.POINTER_LOCK_CHANGE - * @type {integer} + * @type {number} * @since 3.10.0 */ POINTER_LOCK_CHANGE: 6, @@ -73,7 +73,7 @@ var INPUT_CONST = { * A touch pointer has been been cancelled by the browser. * * @name Phaser.Input.TOUCH_CANCEL - * @type {integer} + * @type {number} * @since 3.15.0 */ TOUCH_CANCEL: 7, @@ -82,7 +82,7 @@ var INPUT_CONST = { * The mouse wheel changes. * * @name Phaser.Input.MOUSE_WHEEL - * @type {integer} + * @type {number} * @since 3.18.0 */ MOUSE_WHEEL: 8 diff --git a/src/input/gamepad/Axis.js b/src/input/gamepad/Axis.js index c56db03e5..0e8ff706d 100644 --- a/src/input/gamepad/Axis.js +++ b/src/input/gamepad/Axis.js @@ -17,7 +17,7 @@ var Class = require('../../utils/Class'); * @since 3.0.0 * * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Axis belongs to. - * @param {integer} index - The index of this Axis. + * @param {number} index - The index of this Axis. */ var Axis = new Class({ @@ -47,7 +47,7 @@ var Axis = new Class({ * The index of this Axis. * * @name Phaser.Input.Gamepad.Axis#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; diff --git a/src/input/gamepad/Button.js b/src/input/gamepad/Button.js index 734a39e41..ef8dbe7c1 100644 --- a/src/input/gamepad/Button.js +++ b/src/input/gamepad/Button.js @@ -18,7 +18,7 @@ var Events = require('./events'); * @since 3.0.0 * * @param {Phaser.Input.Gamepad.Gamepad} pad - A reference to the Gamepad that this Button belongs to. - * @param {integer} index - The index of this Button. + * @param {number} index - The index of this Button. */ var Button = new Class({ @@ -48,7 +48,7 @@ var Button = new Class({ * The index of this Button. * * @name Phaser.Input.Gamepad.Button#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; diff --git a/src/input/gamepad/Gamepad.js b/src/input/gamepad/Gamepad.js index 7ca501848..3e3b3279c 100644 --- a/src/input/gamepad/Gamepad.js +++ b/src/input/gamepad/Gamepad.js @@ -331,7 +331,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getAxisTotal * @since 3.10.0 * - * @return {integer} The total number of axes this Gamepad claims to support. + * @return {number} The total number of axes this Gamepad claims to support. */ getAxisTotal: function () { @@ -346,7 +346,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getAxisValue * @since 3.10.0 * - * @param {integer} index - The index of the axes to get the value for. + * @param {number} index - The index of the axes to get the value for. * * @return {number} The value of the axis, between 0 and 1. */ @@ -378,7 +378,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getButtonTotal * @since 3.10.0 * - * @return {integer} The total number of buttons this Gamepad claims to have. + * @return {number} The total number of buttons this Gamepad claims to have. */ getButtonTotal: function () { @@ -395,7 +395,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#getButtonValue * @since 3.10.0 * - * @param {integer} index - The index of the button to get the value for. + * @param {number} index - The index of the button to get the value for. * * @return {number} The value of the button, between 0 and 1. */ @@ -411,7 +411,7 @@ var Gamepad = new Class({ * @method Phaser.Input.Gamepad.Gamepad#isButtonDown * @since 3.10.0 * - * @param {integer} index - The index of the button to get the value for. + * @param {number} index - The index of the button to get the value for. * * @return {boolean} `true` if the button is considered as being pressed down, otherwise `false`. */ diff --git a/src/input/gamepad/GamepadPlugin.js b/src/input/gamepad/GamepadPlugin.js index 8e468d966..de0266d11 100644 --- a/src/input/gamepad/GamepadPlugin.js +++ b/src/input/gamepad/GamepadPlugin.js @@ -533,7 +533,7 @@ var GamepadPlugin = new Class({ * The total number of connected game pads. * * @name Phaser.Input.Gamepad.GamepadPlugin#total - * @type {integer} + * @type {number} * @since 3.10.0 */ total: { diff --git a/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js b/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js index 47336c46d..285006089 100644 --- a/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js +++ b/src/input/gamepad/events/GAMEPAD_BUTTON_DOWN_EVENT.js @@ -19,7 +19,7 @@ * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_DOWN * @since 3.10.0 * - * @param {integer} index - The index of the button that was pressed. + * @param {number} index - The index of the button that was pressed. * @param {number} value - The value of the button at the time it was pressed. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was pressed. */ diff --git a/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js b/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js index 5db6a16bb..5504103e2 100644 --- a/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js +++ b/src/input/gamepad/events/GAMEPAD_BUTTON_UP_EVENT.js @@ -19,7 +19,7 @@ * @event Phaser.Input.Gamepad.Events#GAMEPAD_BUTTON_UP * @since 3.10.0 * - * @param {integer} index - The index of the button that was released. + * @param {number} index - The index of the button that was released. * @param {number} value - The value of the button at the time it was released. Between 0 and 1. Some Gamepads have pressure-sensitive buttons. * @param {Phaser.Input.Gamepad.Button} button - A reference to the Button which was released. */ diff --git a/src/input/gamepad/typedefs/Pad.js b/src/input/gamepad/typedefs/Pad.js index 2a0843b1a..3155e7426 100644 --- a/src/input/gamepad/typedefs/Pad.js +++ b/src/input/gamepad/typedefs/Pad.js @@ -5,5 +5,5 @@ * @since 3.10.0 * * @property {string} id - The ID of the Gamepad. - * @property {integer} index - The index of the Gamepad. + * @property {number} index - The index of the Gamepad. */ diff --git a/src/input/keyboard/KeyboardManager.js b/src/input/keyboard/KeyboardManager.js index faaa869df..46c956f90 100644 --- a/src/input/keyboard/KeyboardManager.js +++ b/src/input/keyboard/KeyboardManager.js @@ -92,7 +92,7 @@ var KeyboardManager = new Class({ * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. * * @name Phaser.Input.Keyboard.KeyboardManager#captures - * @type {integer[]} + * @type {number[]} * @since 3.16.0 */ this.captures = []; @@ -301,7 +301,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#addCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to enable capture for, preventing them reaching the browser. */ addCapture: function (keycode) { @@ -368,7 +368,7 @@ var KeyboardManager = new Class({ * @method Phaser.Input.Keyboard.KeyboardManager#removeCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to disable capture for, allowing them reaching the browser again. */ removeCapture: function (keycode) { diff --git a/src/input/keyboard/KeyboardPlugin.js b/src/input/keyboard/KeyboardPlugin.js index 14eaf9623..5d97bfd04 100644 --- a/src/input/keyboard/KeyboardPlugin.js +++ b/src/input/keyboard/KeyboardPlugin.js @@ -264,7 +264,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#addCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to enable event capture for. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to enable event capture for. * * @return {this} This KeyboardPlugin object. */ @@ -306,7 +306,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeCapture * @since 3.16.0 * - * @param {(string|integer|integer[]|any[])} keycode - The Key Codes to disable event capture for. + * @param {(string|number|number[]|any[])} keycode - The Key Codes to disable event capture for. * * @return {this} This KeyboardPlugin object. */ @@ -323,7 +323,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#getCaptures * @since 3.16.0 * - * @return {integer[]} An array of all the currently capturing key codes. + * @return {number[]} An array of all the currently capturing key codes. */ getCaptures: function () { @@ -471,7 +471,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#addKey * @since 3.10.0 * - * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [enableCapture=true] - Automatically call `preventDefault` on the native DOM browser event for the key codes being added. * @param {boolean} [emitOnRepeat=false] - Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). * @@ -535,7 +535,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#removeKey * @since 3.10.0 * - * @param {(Phaser.Input.Keyboard.Key|string|integer)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. + * @param {(Phaser.Input.Keyboard.Key|string|number)} key - Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param {boolean} [destroy=false] - Call `Key.destroy` on the removed Key object? * * @return {this} This KeyboardPlugin object. @@ -647,7 +647,7 @@ var KeyboardPlugin = new Class({ * @method Phaser.Input.Keyboard.KeyboardPlugin#createCombo * @since 3.10.0 * - * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {(string|number[]|object[])} keys - The keys that comprise this combo. * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. * * @return {Phaser.Input.Keyboard.KeyCombo} The new KeyCombo object. diff --git a/src/input/keyboard/combo/KeyCombo.js b/src/input/keyboard/combo/KeyCombo.js index 8ad1b5d61..d5027bd01 100644 --- a/src/input/keyboard/combo/KeyCombo.js +++ b/src/input/keyboard/combo/KeyCombo.js @@ -45,7 +45,7 @@ var ResetKeyCombo = require('./ResetKeyCombo'); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardPlugin} keyboardPlugin - A reference to the Keyboard Plugin. - * @param {(string|integer[]|object[])} keys - The keys that comprise this combo. + * @param {(string|number[]|object[])} keys - The keys that comprise this combo. * @param {Phaser.Types.Input.Keyboard.KeyComboConfig} [config] - A Key Combo configuration object. */ var KeyCombo = new Class({ @@ -115,7 +115,7 @@ var KeyCombo = new Class({ * The current keyCode the combo is waiting for. * * @name Phaser.Input.Keyboard.KeyCombo#current - * @type {integer} + * @type {number} * @since 3.0.0 */ this.current = this.keyCodes[0]; @@ -124,7 +124,7 @@ var KeyCombo = new Class({ * The current index of the key being waited for in the 'keys' string. * * @name Phaser.Input.Keyboard.KeyCombo#index - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -183,7 +183,7 @@ var KeyCombo = new Class({ * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. * * @name Phaser.Input.Keyboard.KeyCombo#maxKeyDelay - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ diff --git a/src/input/keyboard/keys/DownDuration.js b/src/input/keyboard/keys/DownDuration.js index 84d55ae73..cc8ea62f7 100644 --- a/src/input/keyboard/keys/DownDuration.js +++ b/src/input/keyboard/keys/DownDuration.js @@ -12,7 +12,7 @@ * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. - * @param {integer} [duration=50] - The duration, in ms, within which the key must have been pressed down. + * @param {number} [duration=50] - The duration, in ms, within which the key must have been pressed down. * * @return {boolean} `true` if the Key was pressed down within `duration` ms ago, otherwise `false`. */ diff --git a/src/input/keyboard/keys/Key.js b/src/input/keyboard/keys/Key.js index fb3435527..651eb4b00 100644 --- a/src/input/keyboard/keys/Key.js +++ b/src/input/keyboard/keys/Key.js @@ -20,7 +20,7 @@ var Events = require('../events'); * @since 3.0.0 * * @param {Phaser.Input.Keyboard.KeyboardPlugin} plugin - The Keyboard Plugin instance that owns this Key object. - * @param {integer} keyCode - The keycode of this key. + * @param {number} keyCode - The keycode of this key. */ var Key = new Class({ @@ -45,7 +45,7 @@ var Key = new Class({ * The keycode of this key. * * @name Phaser.Input.Keyboard.Key#keyCode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.keyCode = keyCode; diff --git a/src/input/keyboard/keys/KeyCodes.js b/src/input/keyboard/keys/KeyCodes.js index 1744bef66..6938eb943 100644 --- a/src/input/keyboard/keys/KeyCodes.js +++ b/src/input/keyboard/keys/KeyCodes.js @@ -18,7 +18,7 @@ var KeyCodes = { * The BACKSPACE key. * * @name Phaser.Input.Keyboard.KeyCodes.BACKSPACE - * @type {integer} + * @type {number} * @since 3.0.0 */ BACKSPACE: 8, @@ -27,7 +27,7 @@ var KeyCodes = { * The TAB key. * * @name Phaser.Input.Keyboard.KeyCodes.TAB - * @type {integer} + * @type {number} * @since 3.0.0 */ TAB: 9, @@ -36,7 +36,7 @@ var KeyCodes = { * The ENTER key. * * @name Phaser.Input.Keyboard.KeyCodes.ENTER - * @type {integer} + * @type {number} * @since 3.0.0 */ ENTER: 13, @@ -45,7 +45,7 @@ var KeyCodes = { * The SHIFT key. * * @name Phaser.Input.Keyboard.KeyCodes.SHIFT - * @type {integer} + * @type {number} * @since 3.0.0 */ SHIFT: 16, @@ -54,7 +54,7 @@ var KeyCodes = { * The CTRL key. * * @name Phaser.Input.Keyboard.KeyCodes.CTRL - * @type {integer} + * @type {number} * @since 3.0.0 */ CTRL: 17, @@ -63,7 +63,7 @@ var KeyCodes = { * The ALT key. * * @name Phaser.Input.Keyboard.KeyCodes.ALT - * @type {integer} + * @type {number} * @since 3.0.0 */ ALT: 18, @@ -72,7 +72,7 @@ var KeyCodes = { * The PAUSE key. * * @name Phaser.Input.Keyboard.KeyCodes.PAUSE - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSE: 19, @@ -81,7 +81,7 @@ var KeyCodes = { * The CAPS_LOCK key. * * @name Phaser.Input.Keyboard.KeyCodes.CAPS_LOCK - * @type {integer} + * @type {number} * @since 3.0.0 */ CAPS_LOCK: 20, @@ -90,7 +90,7 @@ var KeyCodes = { * The ESC key. * * @name Phaser.Input.Keyboard.KeyCodes.ESC - * @type {integer} + * @type {number} * @since 3.0.0 */ ESC: 27, @@ -99,7 +99,7 @@ var KeyCodes = { * The SPACE key. * * @name Phaser.Input.Keyboard.KeyCodes.SPACE - * @type {integer} + * @type {number} * @since 3.0.0 */ SPACE: 32, @@ -108,7 +108,7 @@ var KeyCodes = { * The PAGE_UP key. * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_UP - * @type {integer} + * @type {number} * @since 3.0.0 */ PAGE_UP: 33, @@ -117,7 +117,7 @@ var KeyCodes = { * The PAGE_DOWN key. * * @name Phaser.Input.Keyboard.KeyCodes.PAGE_DOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ PAGE_DOWN: 34, @@ -126,7 +126,7 @@ var KeyCodes = { * The END key. * * @name Phaser.Input.Keyboard.KeyCodes.END - * @type {integer} + * @type {number} * @since 3.0.0 */ END: 35, @@ -135,7 +135,7 @@ var KeyCodes = { * The HOME key. * * @name Phaser.Input.Keyboard.KeyCodes.HOME - * @type {integer} + * @type {number} * @since 3.0.0 */ HOME: 36, @@ -144,7 +144,7 @@ var KeyCodes = { * The LEFT key. * * @name Phaser.Input.Keyboard.KeyCodes.LEFT - * @type {integer} + * @type {number} * @since 3.0.0 */ LEFT: 37, @@ -153,7 +153,7 @@ var KeyCodes = { * The UP key. * * @name Phaser.Input.Keyboard.KeyCodes.UP - * @type {integer} + * @type {number} * @since 3.0.0 */ UP: 38, @@ -162,7 +162,7 @@ var KeyCodes = { * The RIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.RIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ RIGHT: 39, @@ -171,7 +171,7 @@ var KeyCodes = { * The DOWN key. * * @name Phaser.Input.Keyboard.KeyCodes.DOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ DOWN: 40, @@ -180,7 +180,7 @@ var KeyCodes = { * The PRINT_SCREEN key. * * @name Phaser.Input.Keyboard.KeyCodes.PRINT_SCREEN - * @type {integer} + * @type {number} * @since 3.0.0 */ PRINT_SCREEN: 42, @@ -189,7 +189,7 @@ var KeyCodes = { * The INSERT key. * * @name Phaser.Input.Keyboard.KeyCodes.INSERT - * @type {integer} + * @type {number} * @since 3.0.0 */ INSERT: 45, @@ -198,7 +198,7 @@ var KeyCodes = { * The DELETE key. * * @name Phaser.Input.Keyboard.KeyCodes.DELETE - * @type {integer} + * @type {number} * @since 3.0.0 */ DELETE: 46, @@ -207,7 +207,7 @@ var KeyCodes = { * The ZERO key. * * @name Phaser.Input.Keyboard.KeyCodes.ZERO - * @type {integer} + * @type {number} * @since 3.0.0 */ ZERO: 48, @@ -216,7 +216,7 @@ var KeyCodes = { * The ONE key. * * @name Phaser.Input.Keyboard.KeyCodes.ONE - * @type {integer} + * @type {number} * @since 3.0.0 */ ONE: 49, @@ -225,7 +225,7 @@ var KeyCodes = { * The TWO key. * * @name Phaser.Input.Keyboard.KeyCodes.TWO - * @type {integer} + * @type {number} * @since 3.0.0 */ TWO: 50, @@ -234,7 +234,7 @@ var KeyCodes = { * The THREE key. * * @name Phaser.Input.Keyboard.KeyCodes.THREE - * @type {integer} + * @type {number} * @since 3.0.0 */ THREE: 51, @@ -243,7 +243,7 @@ var KeyCodes = { * The FOUR key. * * @name Phaser.Input.Keyboard.KeyCodes.FOUR - * @type {integer} + * @type {number} * @since 3.0.0 */ FOUR: 52, @@ -252,7 +252,7 @@ var KeyCodes = { * The FIVE key. * * @name Phaser.Input.Keyboard.KeyCodes.FIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ FIVE: 53, @@ -261,7 +261,7 @@ var KeyCodes = { * The SIX key. * * @name Phaser.Input.Keyboard.KeyCodes.SIX - * @type {integer} + * @type {number} * @since 3.0.0 */ SIX: 54, @@ -270,7 +270,7 @@ var KeyCodes = { * The SEVEN key. * * @name Phaser.Input.Keyboard.KeyCodes.SEVEN - * @type {integer} + * @type {number} * @since 3.0.0 */ SEVEN: 55, @@ -279,7 +279,7 @@ var KeyCodes = { * The EIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.EIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ EIGHT: 56, @@ -288,7 +288,7 @@ var KeyCodes = { * The NINE key. * * @name Phaser.Input.Keyboard.KeyCodes.NINE - * @type {integer} + * @type {number} * @since 3.0.0 */ NINE: 57, @@ -297,7 +297,7 @@ var KeyCodes = { * The NUMPAD_ZERO key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ZERO - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_ZERO: 96, @@ -306,7 +306,7 @@ var KeyCodes = { * The NUMPAD_ONE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ONE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_ONE: 97, @@ -315,7 +315,7 @@ var KeyCodes = { * The NUMPAD_TWO key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_TWO - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_TWO: 98, @@ -324,7 +324,7 @@ var KeyCodes = { * The NUMPAD_THREE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_THREE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_THREE: 99, @@ -333,7 +333,7 @@ var KeyCodes = { * The NUMPAD_FOUR key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FOUR - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_FOUR: 100, @@ -342,7 +342,7 @@ var KeyCodes = { * The NUMPAD_FIVE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_FIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_FIVE: 101, @@ -351,7 +351,7 @@ var KeyCodes = { * The NUMPAD_SIX key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SIX - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_SIX: 102, @@ -360,7 +360,7 @@ var KeyCodes = { * The NUMPAD_SEVEN key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SEVEN - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_SEVEN: 103, @@ -369,7 +369,7 @@ var KeyCodes = { * The NUMPAD_EIGHT key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_EIGHT - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_EIGHT: 104, @@ -378,7 +378,7 @@ var KeyCodes = { * The NUMPAD_NINE key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_NINE - * @type {integer} + * @type {number} * @since 3.0.0 */ NUMPAD_NINE: 105, @@ -387,7 +387,7 @@ var KeyCodes = { * The Numpad Addition (+) key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_ADD - * @type {integer} + * @type {number} * @since 3.21.0 */ NUMPAD_ADD: 107, @@ -396,7 +396,7 @@ var KeyCodes = { * The Numpad Subtraction (-) key. * * @name Phaser.Input.Keyboard.KeyCodes.NUMPAD_SUBTRACT - * @type {integer} + * @type {number} * @since 3.21.0 */ NUMPAD_SUBTRACT: 109, @@ -405,7 +405,7 @@ var KeyCodes = { * The A key. * * @name Phaser.Input.Keyboard.KeyCodes.A - * @type {integer} + * @type {number} * @since 3.0.0 */ A: 65, @@ -414,7 +414,7 @@ var KeyCodes = { * The B key. * * @name Phaser.Input.Keyboard.KeyCodes.B - * @type {integer} + * @type {number} * @since 3.0.0 */ B: 66, @@ -423,7 +423,7 @@ var KeyCodes = { * The C key. * * @name Phaser.Input.Keyboard.KeyCodes.C - * @type {integer} + * @type {number} * @since 3.0.0 */ C: 67, @@ -432,7 +432,7 @@ var KeyCodes = { * The D key. * * @name Phaser.Input.Keyboard.KeyCodes.D - * @type {integer} + * @type {number} * @since 3.0.0 */ D: 68, @@ -441,7 +441,7 @@ var KeyCodes = { * The E key. * * @name Phaser.Input.Keyboard.KeyCodes.E - * @type {integer} + * @type {number} * @since 3.0.0 */ E: 69, @@ -450,7 +450,7 @@ var KeyCodes = { * The F key. * * @name Phaser.Input.Keyboard.KeyCodes.F - * @type {integer} + * @type {number} * @since 3.0.0 */ F: 70, @@ -459,7 +459,7 @@ var KeyCodes = { * The G key. * * @name Phaser.Input.Keyboard.KeyCodes.G - * @type {integer} + * @type {number} * @since 3.0.0 */ G: 71, @@ -468,7 +468,7 @@ var KeyCodes = { * The H key. * * @name Phaser.Input.Keyboard.KeyCodes.H - * @type {integer} + * @type {number} * @since 3.0.0 */ H: 72, @@ -477,7 +477,7 @@ var KeyCodes = { * The I key. * * @name Phaser.Input.Keyboard.KeyCodes.I - * @type {integer} + * @type {number} * @since 3.0.0 */ I: 73, @@ -486,7 +486,7 @@ var KeyCodes = { * The J key. * * @name Phaser.Input.Keyboard.KeyCodes.J - * @type {integer} + * @type {number} * @since 3.0.0 */ J: 74, @@ -495,7 +495,7 @@ var KeyCodes = { * The K key. * * @name Phaser.Input.Keyboard.KeyCodes.K - * @type {integer} + * @type {number} * @since 3.0.0 */ K: 75, @@ -504,7 +504,7 @@ var KeyCodes = { * The L key. * * @name Phaser.Input.Keyboard.KeyCodes.L - * @type {integer} + * @type {number} * @since 3.0.0 */ L: 76, @@ -513,7 +513,7 @@ var KeyCodes = { * The M key. * * @name Phaser.Input.Keyboard.KeyCodes.M - * @type {integer} + * @type {number} * @since 3.0.0 */ M: 77, @@ -522,7 +522,7 @@ var KeyCodes = { * The N key. * * @name Phaser.Input.Keyboard.KeyCodes.N - * @type {integer} + * @type {number} * @since 3.0.0 */ N: 78, @@ -531,7 +531,7 @@ var KeyCodes = { * The O key. * * @name Phaser.Input.Keyboard.KeyCodes.O - * @type {integer} + * @type {number} * @since 3.0.0 */ O: 79, @@ -540,7 +540,7 @@ var KeyCodes = { * The P key. * * @name Phaser.Input.Keyboard.KeyCodes.P - * @type {integer} + * @type {number} * @since 3.0.0 */ P: 80, @@ -549,7 +549,7 @@ var KeyCodes = { * The Q key. * * @name Phaser.Input.Keyboard.KeyCodes.Q - * @type {integer} + * @type {number} * @since 3.0.0 */ Q: 81, @@ -558,7 +558,7 @@ var KeyCodes = { * The R key. * * @name Phaser.Input.Keyboard.KeyCodes.R - * @type {integer} + * @type {number} * @since 3.0.0 */ R: 82, @@ -567,7 +567,7 @@ var KeyCodes = { * The S key. * * @name Phaser.Input.Keyboard.KeyCodes.S - * @type {integer} + * @type {number} * @since 3.0.0 */ S: 83, @@ -576,7 +576,7 @@ var KeyCodes = { * The T key. * * @name Phaser.Input.Keyboard.KeyCodes.T - * @type {integer} + * @type {number} * @since 3.0.0 */ T: 84, @@ -585,7 +585,7 @@ var KeyCodes = { * The U key. * * @name Phaser.Input.Keyboard.KeyCodes.U - * @type {integer} + * @type {number} * @since 3.0.0 */ U: 85, @@ -594,7 +594,7 @@ var KeyCodes = { * The V key. * * @name Phaser.Input.Keyboard.KeyCodes.V - * @type {integer} + * @type {number} * @since 3.0.0 */ V: 86, @@ -603,7 +603,7 @@ var KeyCodes = { * The W key. * * @name Phaser.Input.Keyboard.KeyCodes.W - * @type {integer} + * @type {number} * @since 3.0.0 */ W: 87, @@ -612,7 +612,7 @@ var KeyCodes = { * The X key. * * @name Phaser.Input.Keyboard.KeyCodes.X - * @type {integer} + * @type {number} * @since 3.0.0 */ X: 88, @@ -621,7 +621,7 @@ var KeyCodes = { * The Y key. * * @name Phaser.Input.Keyboard.KeyCodes.Y - * @type {integer} + * @type {number} * @since 3.0.0 */ Y: 89, @@ -630,7 +630,7 @@ var KeyCodes = { * The Z key. * * @name Phaser.Input.Keyboard.KeyCodes.Z - * @type {integer} + * @type {number} * @since 3.0.0 */ Z: 90, @@ -639,7 +639,7 @@ var KeyCodes = { * The F1 key. * * @name Phaser.Input.Keyboard.KeyCodes.F1 - * @type {integer} + * @type {number} * @since 3.0.0 */ F1: 112, @@ -648,7 +648,7 @@ var KeyCodes = { * The F2 key. * * @name Phaser.Input.Keyboard.KeyCodes.F2 - * @type {integer} + * @type {number} * @since 3.0.0 */ F2: 113, @@ -657,7 +657,7 @@ var KeyCodes = { * The F3 key. * * @name Phaser.Input.Keyboard.KeyCodes.F3 - * @type {integer} + * @type {number} * @since 3.0.0 */ F3: 114, @@ -666,7 +666,7 @@ var KeyCodes = { * The F4 key. * * @name Phaser.Input.Keyboard.KeyCodes.F4 - * @type {integer} + * @type {number} * @since 3.0.0 */ F4: 115, @@ -675,7 +675,7 @@ var KeyCodes = { * The F5 key. * * @name Phaser.Input.Keyboard.KeyCodes.F5 - * @type {integer} + * @type {number} * @since 3.0.0 */ F5: 116, @@ -684,7 +684,7 @@ var KeyCodes = { * The F6 key. * * @name Phaser.Input.Keyboard.KeyCodes.F6 - * @type {integer} + * @type {number} * @since 3.0.0 */ F6: 117, @@ -693,7 +693,7 @@ var KeyCodes = { * The F7 key. * * @name Phaser.Input.Keyboard.KeyCodes.F7 - * @type {integer} + * @type {number} * @since 3.0.0 */ F7: 118, @@ -702,7 +702,7 @@ var KeyCodes = { * The F8 key. * * @name Phaser.Input.Keyboard.KeyCodes.F8 - * @type {integer} + * @type {number} * @since 3.0.0 */ F8: 119, @@ -711,7 +711,7 @@ var KeyCodes = { * The F9 key. * * @name Phaser.Input.Keyboard.KeyCodes.F9 - * @type {integer} + * @type {number} * @since 3.0.0 */ F9: 120, @@ -720,7 +720,7 @@ var KeyCodes = { * The F10 key. * * @name Phaser.Input.Keyboard.KeyCodes.F10 - * @type {integer} + * @type {number} * @since 3.0.0 */ F10: 121, @@ -729,7 +729,7 @@ var KeyCodes = { * The F11 key. * * @name Phaser.Input.Keyboard.KeyCodes.F11 - * @type {integer} + * @type {number} * @since 3.0.0 */ F11: 122, @@ -738,7 +738,7 @@ var KeyCodes = { * The F12 key. * * @name Phaser.Input.Keyboard.KeyCodes.F12 - * @type {integer} + * @type {number} * @since 3.0.0 */ F12: 123, @@ -747,7 +747,7 @@ var KeyCodes = { * The SEMICOLON key. * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON - * @type {integer} + * @type {number} * @since 3.0.0 */ SEMICOLON: 186, @@ -756,7 +756,7 @@ var KeyCodes = { * The PLUS key. * * @name Phaser.Input.Keyboard.KeyCodes.PLUS - * @type {integer} + * @type {number} * @since 3.0.0 */ PLUS: 187, @@ -765,7 +765,7 @@ var KeyCodes = { * The COMMA key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA: 188, @@ -774,7 +774,7 @@ var KeyCodes = { * The MINUS key. * * @name Phaser.Input.Keyboard.KeyCodes.MINUS - * @type {integer} + * @type {number} * @since 3.0.0 */ MINUS: 189, @@ -783,7 +783,7 @@ var KeyCodes = { * The PERIOD key. * * @name Phaser.Input.Keyboard.KeyCodes.PERIOD - * @type {integer} + * @type {number} * @since 3.0.0 */ PERIOD: 190, @@ -792,7 +792,7 @@ var KeyCodes = { * The FORWARD_SLASH key. * * @name Phaser.Input.Keyboard.KeyCodes.FORWARD_SLASH - * @type {integer} + * @type {number} * @since 3.0.0 */ FORWARD_SLASH: 191, @@ -801,7 +801,7 @@ var KeyCodes = { * The BACK_SLASH key. * * @name Phaser.Input.Keyboard.KeyCodes.BACK_SLASH - * @type {integer} + * @type {number} * @since 3.0.0 */ BACK_SLASH: 220, @@ -810,7 +810,7 @@ var KeyCodes = { * The QUOTES key. * * @name Phaser.Input.Keyboard.KeyCodes.QUOTES - * @type {integer} + * @type {number} * @since 3.0.0 */ QUOTES: 222, @@ -819,7 +819,7 @@ var KeyCodes = { * The BACKTICK key. * * @name Phaser.Input.Keyboard.KeyCodes.BACKTICK - * @type {integer} + * @type {number} * @since 3.0.0 */ BACKTICK: 192, @@ -828,7 +828,7 @@ var KeyCodes = { * The OPEN_BRACKET key. * * @name Phaser.Input.Keyboard.KeyCodes.OPEN_BRACKET - * @type {integer} + * @type {number} * @since 3.0.0 */ OPEN_BRACKET: 219, @@ -837,7 +837,7 @@ var KeyCodes = { * The CLOSED_BRACKET key. * * @name Phaser.Input.Keyboard.KeyCodes.CLOSED_BRACKET - * @type {integer} + * @type {number} * @since 3.0.0 */ CLOSED_BRACKET: 221, @@ -846,7 +846,7 @@ var KeyCodes = { * The SEMICOLON_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.SEMICOLON_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ SEMICOLON_FIREFOX: 59, @@ -855,7 +855,7 @@ var KeyCodes = { * The COLON key. * * @name Phaser.Input.Keyboard.KeyCodes.COLON - * @type {integer} + * @type {number} * @since 3.0.0 */ COLON: 58, @@ -864,7 +864,7 @@ var KeyCodes = { * The COMMA_FIREFOX_WINDOWS key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX_WINDOWS - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA_FIREFOX_WINDOWS: 60, @@ -873,7 +873,7 @@ var KeyCodes = { * The COMMA_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.COMMA_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ COMMA_FIREFOX: 62, @@ -882,7 +882,7 @@ var KeyCodes = { * The BRACKET_RIGHT_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_RIGHT_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ BRACKET_RIGHT_FIREFOX: 174, @@ -891,7 +891,7 @@ var KeyCodes = { * The BRACKET_LEFT_FIREFOX key. * * @name Phaser.Input.Keyboard.KeyCodes.BRACKET_LEFT_FIREFOX - * @type {integer} + * @type {number} * @since 3.0.0 */ BRACKET_LEFT_FIREFOX: 175 diff --git a/src/input/keyboard/keys/UpDuration.js b/src/input/keyboard/keys/UpDuration.js index edb402c83..cf6c184bc 100644 --- a/src/input/keyboard/keys/UpDuration.js +++ b/src/input/keyboard/keys/UpDuration.js @@ -12,7 +12,7 @@ * @since 3.0.0 * * @param {Phaser.Input.Keyboard.Key} key - The Key object to test. - * @param {integer} [duration=50] - The duration, in ms, within which the key must have been released. + * @param {number} [duration=50] - The duration, in ms, within which the key must have been released. * * @return {boolean} `true` if the Key was released within `duration` ms ago, otherwise `false`. */ diff --git a/src/input/mouse/MouseManager.js b/src/input/mouse/MouseManager.js index cd2a3519a..0c5a71141 100644 --- a/src/input/mouse/MouseManager.js +++ b/src/input/mouse/MouseManager.js @@ -72,6 +72,16 @@ var MouseManager = new Class({ */ this.preventDefaultMove = true; + /** + * If `true` the DOM `wheel` event will have `preventDefault` set. + * + * @name Phaser.Input.Mouse.MouseManager#preventDefaultWheel + * @type {boolean} + * @default true + * @since 3.50.0 + */ + this.preventDefaultWheel = false; + /** * A boolean that controls if the Mouse Manager is enabled or not. * Can be toggled on the fly. @@ -202,6 +212,20 @@ var MouseManager = new Class({ */ this.pointerLockChange = NOOP; + /** + * Are the event listeners hooked into `window.top` or `window`? + * + * This is set during the `boot` sequence. If the browser does not have access to `window.top`, + * such as in cross-origin iframe environments, this property gets set to `false` and the events + * are hooked into `window` instead. + * + * @name Phaser.Input.Mouse.MouseManager#isTop + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.isTop = true; + inputManager.events.once(InputEvents.MANAGER_BOOT, this.boot, this); }, @@ -223,6 +247,7 @@ var MouseManager = new Class({ this.preventDefaultDown = config.inputMousePreventDefaultDown; this.preventDefaultUp = config.inputMousePreventDefaultUp; this.preventDefaultMove = config.inputMousePreventDefaultMove; + this.preventDefaultWheel = config.inputMousePreventDefaultWheel; if (!this.target) { @@ -423,6 +448,11 @@ var MouseManager = new Class({ { manager.onMouseWheel(event); } + + if (_this.preventDefaultWheel && event.target === canvas) + { + event.preventDefault(); + } }; var passive = { passive: true }; @@ -432,12 +462,30 @@ var MouseManager = new Class({ target.addEventListener('mouseup', this.onMouseUp); target.addEventListener('mouseover', this.onMouseOver, passive); target.addEventListener('mouseout', this.onMouseOut, passive); - target.addEventListener('wheel', this.onMouseWheel, passive); + + if (this.preventDefaultWheel) + { + target.addEventListener('wheel', this.onMouseWheel, { passive: false }); + } + else + { + target.addEventListener('wheel', this.onMouseWheel, passive); + } if (window && manager.game.config.inputWindowEvents) { - window.top.addEventListener('mousedown', this.onMouseDownWindow, passive); - window.top.addEventListener('mouseup', this.onMouseUpWindow, passive); + try + { + window.top.addEventListener('mousedown', this.onMouseDownWindow, passive); + window.top.addEventListener('mouseup', this.onMouseUpWindow, passive); + } + catch (exception) + { + window.addEventListener('mousedown', this.onMouseDownWindow, passive); + window.addEventListener('mouseup', this.onMouseUpWindow, passive); + + this.isTop = false; + } } if (Features.pointerLock) @@ -478,8 +526,10 @@ var MouseManager = new Class({ if (window) { - window.top.removeEventListener('mousedown', this.onMouseDownWindow); - window.top.removeEventListener('mouseup', this.onMouseUpWindow); + target = (this.isTop) ? window.top : window; + + target.removeEventListener('mousedown', this.onMouseDownWindow); + target.removeEventListener('mouseup', this.onMouseUpWindow); } if (Features.pointerLock) diff --git a/src/input/typedefs/InputConfiguration.js b/src/input/typedefs/InputConfiguration.js index 89663fe5a..46e8fa29e 100644 --- a/src/input/typedefs/InputConfiguration.js +++ b/src/input/typedefs/InputConfiguration.js @@ -9,5 +9,5 @@ * @property {boolean} [useHandCursor=false] - If `true` the Interactive Object will set the `pointer` hand cursor when a pointer is over it. This is a short-cut for setting `cursor: 'pointer'`. * @property {string} [cursor] - The CSS string to be used when the cursor is over this Interactive Object. * @property {boolean} [pixelPerfect=false] - If `true` the a pixel perfect function will be set for the hit area callback. Only works with texture based Game Objects. - * @property {integer} [alphaTolerance=1] - If `pixelPerfect` is set, this is the alpha tolerance threshold value used in the callback. + * @property {number} [alphaTolerance=1] - If `pixelPerfect` is set, this is the alpha tolerance threshold value used in the callback. */ diff --git a/src/loader/File.js b/src/loader/File.js index 34982df8a..f38680f9f 100644 --- a/src/loader/File.js +++ b/src/loader/File.js @@ -141,7 +141,7 @@ var File = new Class({ * The current state of the file. One of the FILE_CONST values. * * @name Phaser.Loader.File#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = (typeof(this.url) === 'function') ? CONST.FILE_POPULATED : CONST.FILE_PENDING; diff --git a/src/loader/LoaderPlugin.js b/src/loader/LoaderPlugin.js index 6f3fceff8..8a8f4414b 100644 --- a/src/loader/LoaderPlugin.js +++ b/src/loader/LoaderPlugin.js @@ -177,7 +177,7 @@ var LoaderPlugin = new Class({ * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. * * @name Phaser.Loader.LoaderPlugin#maxParallelDownloads - * @type {integer} + * @type {number} * @since 3.0.0 */ this.maxParallelDownloads = GetFastValue(sceneConfig, 'maxParallelDownloads', gameConfig.loaderMaxParallelDownloads); @@ -212,7 +212,7 @@ var LoaderPlugin = new Class({ * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. * * @name Phaser.Loader.LoaderPlugin#totalToLoad - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -287,7 +287,7 @@ var LoaderPlugin = new Class({ * This value is reset when you call `Loader.start`. * * @name Phaser.Loader.LoaderPlugin#totalFailed - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -298,7 +298,7 @@ var LoaderPlugin = new Class({ * This value is reset when you call `Loader.start`. * * @name Phaser.Loader.LoaderPlugin#totalComplete - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -308,7 +308,7 @@ var LoaderPlugin = new Class({ * The current state of the Loader. * * @name Phaser.Loader.LoaderPlugin#state - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -318,7 +318,7 @@ var LoaderPlugin = new Class({ * The current index being used by multi-file loaders to avoid key clashes. * * @name Phaser.Loader.LoaderPlugin#multiKeyIndex - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ diff --git a/src/loader/MultiFile.js b/src/loader/MultiFile.js index 5eb37bf3d..5797cf307 100644 --- a/src/loader/MultiFile.js +++ b/src/loader/MultiFile.js @@ -10,7 +10,7 @@ var Class = require('../utils/Class'); * @classdesc * A MultiFile is a special kind of parent that contains two, or more, Files as children and looks after * the loading and processing of them all. It is commonly extended and used as a base class for file types such as AtlasJSON or BitmapFont. - * + * * You shouldn't create an instance of a MultiFile directly, but should extend it with your own class, setting a custom type and processing methods. * * @class MultiFile @@ -29,6 +29,17 @@ var MultiFile = new Class({ function MultiFile (loader, type, key, files) { + var finalFiles = []; + + // Clean out any potential 'null' or 'undefined' file entries + files.forEach(function (file) + { + if (file) + { + finalFiles.push(file); + } + }); + /** * A reference to the Loader that is going to load this file. * @@ -60,7 +71,7 @@ var MultiFile = new Class({ * The current index being used by multi-file loaders to avoid key clashes. * * @name Phaser.Loader.MultiFile#multiKeyIndex - * @type {integer} + * @type {number} * @private * @since 3.20.0 */ @@ -73,7 +84,7 @@ var MultiFile = new Class({ * @type {Phaser.Loader.File[]} * @since 3.7.0 */ - this.files = files; + this.files = finalFiles; /** * The completion status of this MultiFile. @@ -89,17 +100,17 @@ var MultiFile = new Class({ * The number of files to load. * * @name Phaser.Loader.MultiFile#pending - * @type {integer} + * @type {number} * @since 3.7.0 */ - this.pending = files.length; + this.pending = finalFiles.length; /** * The number of files that failed to load. * * @name Phaser.Loader.MultiFile#failed - * @type {integer} + * @type {number} * @default 0 * @since 3.7.0 */ @@ -145,9 +156,9 @@ var MultiFile = new Class({ this.prefix = loader.prefix; // Link the files - for (var i = 0; i < files.length; i++) + for (var i = 0; i < finalFiles.length; i++) { - files[i].multiFile = this; + finalFiles[i].multiFile = this; } }, diff --git a/src/loader/XHRSettings.js b/src/loader/XHRSettings.js index 9bda61562..85668db11 100644 --- a/src/loader/XHRSettings.js +++ b/src/loader/XHRSettings.js @@ -14,7 +14,7 @@ * @param {boolean} [async=true] - Should the XHR request use async or not? * @param {string} [user=''] - Optional username for the XHR request. * @param {string} [password=''] - Optional password for the XHR request. - * @param {integer} [timeout=0] - Optional XHR timeout value. + * @param {number} [timeout=0] - Optional XHR timeout value. * @param {boolean} [withCredentials=false] - Optional XHR withCredentials value. * * @return {Phaser.Types.Loader.XHRSettingsObject} The XHRSettings object as used by the Loader. diff --git a/src/loader/const.js b/src/loader/const.js index 5796fab53..b4ff1d9f3 100644 --- a/src/loader/const.js +++ b/src/loader/const.js @@ -10,7 +10,7 @@ var FILE_CONST = { * The Loader is idle. * * @name Phaser.Loader.LOADER_IDLE - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_IDLE: 0, @@ -19,7 +19,7 @@ var FILE_CONST = { * The Loader is actively loading. * * @name Phaser.Loader.LOADER_LOADING - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_LOADING: 1, @@ -28,7 +28,7 @@ var FILE_CONST = { * The Loader is processing files is has loaded. * * @name Phaser.Loader.LOADER_PROCESSING - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_PROCESSING: 2, @@ -37,7 +37,7 @@ var FILE_CONST = { * The Loader has completed loading and processing. * * @name Phaser.Loader.LOADER_COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_COMPLETE: 3, @@ -46,7 +46,7 @@ var FILE_CONST = { * The Loader is shutting down. * * @name Phaser.Loader.LOADER_SHUTDOWN - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_SHUTDOWN: 4, @@ -55,7 +55,7 @@ var FILE_CONST = { * The Loader has been destroyed. * * @name Phaser.Loader.LOADER_DESTROYED - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADER_DESTROYED: 5, @@ -64,7 +64,7 @@ var FILE_CONST = { * File is in the load queue but not yet started * * @name Phaser.Loader.FILE_PENDING - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_PENDING: 10, @@ -73,7 +73,7 @@ var FILE_CONST = { * File has been started to load by the loader (onLoad called) * * @name Phaser.Loader.FILE_LOADING - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_LOADING: 11, @@ -82,7 +82,7 @@ var FILE_CONST = { * File has loaded successfully, awaiting processing * * @name Phaser.Loader.FILE_LOADED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_LOADED: 12, @@ -91,7 +91,7 @@ var FILE_CONST = { * File failed to load * * @name Phaser.Loader.FILE_FAILED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_FAILED: 13, @@ -100,7 +100,7 @@ var FILE_CONST = { * File is being processed (onProcess callback) * * @name Phaser.Loader.FILE_PROCESSING - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_PROCESSING: 14, @@ -109,7 +109,7 @@ var FILE_CONST = { * The File has errored somehow during processing. * * @name Phaser.Loader.FILE_ERRORED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_ERRORED: 16, @@ -118,7 +118,7 @@ var FILE_CONST = { * File has finished processing. * * @name Phaser.Loader.FILE_COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_COMPLETE: 17, @@ -127,7 +127,7 @@ var FILE_CONST = { * File has been destroyed * * @name Phaser.Loader.FILE_DESTROYED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_DESTROYED: 18, @@ -136,7 +136,7 @@ var FILE_CONST = { * File was populated from local data and doesn't need an HTTP request * * @name Phaser.Loader.FILE_POPULATED - * @type {integer} + * @type {number} * @since 3.0.0 */ FILE_POPULATED: 19 diff --git a/src/loader/events/COMPLETE_EVENT.js b/src/loader/events/COMPLETE_EVENT.js index 107c6cf0a..c7c401f3a 100644 --- a/src/loader/events/COMPLETE_EVENT.js +++ b/src/loader/events/COMPLETE_EVENT.js @@ -16,7 +16,7 @@ * @since 3.0.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader Plugin that dispatched this event. - * @param {integer} totalComplete - The total number of files that successfully loaded. - * @param {integer} totalFailed - The total number of files that failed to load. + * @param {number} totalComplete - The total number of files that successfully loaded. + * @param {number} totalFailed - The total number of files that failed to load. */ module.exports = 'complete'; diff --git a/src/loader/filetypes/AsepriteFile.js b/src/loader/filetypes/AsepriteFile.js new file mode 100644 index 000000000..472c80ea3 --- /dev/null +++ b/src/loader/filetypes/AsepriteFile.js @@ -0,0 +1,264 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../utils/Class'); +var FileTypesManager = require('../FileTypesManager'); +var GetFastValue = require('../../utils/object/GetFastValue'); +var ImageFile = require('./ImageFile.js'); +var IsPlainObject = require('../../utils/object/IsPlainObject'); +var JSONFile = require('./JSONFile.js'); +var MultiFile = require('../MultiFile.js'); + +/** + * @classdesc + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + * + * @class AsepriteFile + * @extends Phaser.Loader.MultiFile + * @memberof Phaser.Loader.FileTypes + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. + * @param {(string|Phaser.Types.Loader.FileTypes.AsepriteFileConfig)} key - The key to use for this file, or a file configuration object. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {object|string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ +var AsepriteFile = new Class({ + + Extends: MultiFile, + + initialize: + + function AsepriteFile (loader, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) + { + var image; + var data; + + if (IsPlainObject(key)) + { + var config = key; + + key = GetFastValue(config, 'key'); + + image = new ImageFile(loader, { + key: key, + url: GetFastValue(config, 'textureURL'), + extension: GetFastValue(config, 'textureExtension', 'png'), + normalMap: GetFastValue(config, 'normalMap'), + xhrSettings: GetFastValue(config, 'textureXhrSettings') + }); + + data = new JSONFile(loader, { + key: key, + url: GetFastValue(config, 'atlasURL'), + extension: GetFastValue(config, 'atlasExtension', 'json'), + xhrSettings: GetFastValue(config, 'atlasXhrSettings') + }); + } + else + { + image = new ImageFile(loader, key, textureURL, textureXhrSettings); + data = new JSONFile(loader, key, atlasURL, atlasXhrSettings); + } + + if (image.linkFile) + { + // Image has a normal map + MultiFile.call(this, loader, 'atlasjson', key, [ image, data, image.linkFile ]); + } + else + { + MultiFile.call(this, loader, 'atlasjson', key, [ image, data ]); + } + }, + + /** + * Adds this file to its target cache upon successful loading and processing. + * + * @method Phaser.Loader.FileTypes.AsepriteFile#addToCache + * @since 3.7.0 + */ + addToCache: function () + { + if (this.isReadyToProcess()) + { + var image = this.files[0]; + var json = this.files[1]; + var normalMap = (this.files[2]) ? this.files[2].data : null; + + this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); + + json.addToCache(); + + this.complete = true; + } + } + +}); + +/** + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * Adds a JSON based Aseprite Animation, or array of animations, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.aseprite('gladiator', 'images/Gladiator.png', 'images/Gladiator.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.aseprite({ + * key: 'gladiator', + * textureURL: 'images/Gladiator.png', + * atlasURL: 'images/Gladiator.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AsepriteFileConfig` for more details. + * + * Instead of passing a URL for the JSON data you can also pass in a well formed JSON object instead. + * + * Once loaded, you can call this method from within a Scene with the 'atlas' key: + * + * ```javascript + * this.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use in Phaser and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it in Phaser using that Tag name: + * + * ```javascript + * this.add.sprite(400, 300).play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * this.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Aseprite File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * + * @method Phaser.Loader.LoaderPlugin#aseprite + * @fires Phaser.Loader.LoaderPlugin#ADD + * @since 3.50.0 + * + * @param {(string|Phaser.Types.Loader.FileTypes.AsepriteFileConfig|Phaser.Types.Loader.FileTypes.AsepriteFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. + * @param {string|string[]} [textureURL] - The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param {object|string} [atlasURL] - The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + * + * @return {this} The Loader instance. + */ +FileTypesManager.register('aseprite', function (key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings) +{ + var multifile; + + // Supports an Object file definition in the key argument + // Or an array of objects in the key argument + // Or a single entry where all arguments have been defined + + if (Array.isArray(key)) + { + for (var i = 0; i < key.length; i++) + { + multifile = new AsepriteFile(this, key[i]); + + this.addFile(multifile.files); + } + } + else + { + multifile = new AsepriteFile(this, key, textureURL, atlasURL, textureXhrSettings, atlasXhrSettings); + + this.addFile(multifile.files); + } + + return this; +}); + +module.exports = AsepriteFile; diff --git a/src/loader/filetypes/AtlasJSONFile.js b/src/loader/filetypes/AtlasJSONFile.js index 3c840f3c6..3dec42d3e 100644 --- a/src/loader/filetypes/AtlasJSONFile.js +++ b/src/loader/filetypes/AtlasJSONFile.js @@ -100,8 +100,6 @@ var AtlasJSONFile = new Class({ this.loader.textureManager.addAtlas(image.key, image.data, json.data, normalMap); - json.addToCache(); - this.complete = true; } } diff --git a/src/loader/filetypes/AtlasXMLFile.js b/src/loader/filetypes/AtlasXMLFile.js index 1652991c0..3dfaa2262 100644 --- a/src/loader/filetypes/AtlasXMLFile.js +++ b/src/loader/filetypes/AtlasXMLFile.js @@ -98,8 +98,6 @@ var AtlasXMLFile = new Class({ this.loader.textureManager.addAtlasXML(image.key, image.data, xml.data, normalMap); - xml.addToCache(); - this.complete = true; } } diff --git a/src/loader/filetypes/BitmapFontFile.js b/src/loader/filetypes/BitmapFontFile.js index 6f7f4e013..8c9002a46 100644 --- a/src/loader/filetypes/BitmapFontFile.js +++ b/src/loader/filetypes/BitmapFontFile.js @@ -97,7 +97,6 @@ var BitmapFontFile = new Class({ var xml = this.files[1]; image.addToCache(); - xml.addToCache(); var texture = image.cache.get(image.key); diff --git a/src/loader/filetypes/GLSLFile.js b/src/loader/filetypes/GLSLFile.js index 55c0482fe..812d379b3 100644 --- a/src/loader/filetypes/GLSLFile.js +++ b/src/loader/filetypes/GLSLFile.js @@ -253,7 +253,7 @@ var GLSLFile = new Class({ * @since 3.17.0 * * @param {string[]} data - The array of shader data to process. - * @param {integer} offset - The offset to start processing from. + * @param {number} offset - The offset to start processing from. * * @return {any} The processed shader block, or null. */ diff --git a/src/loader/filetypes/HTMLTextureFile.js b/src/loader/filetypes/HTMLTextureFile.js index 9e3698988..079f4640f 100644 --- a/src/loader/filetypes/HTMLTextureFile.js +++ b/src/loader/filetypes/HTMLTextureFile.js @@ -28,8 +28,8 @@ var IsPlainObject = require('../../utils/object/IsPlainObject'); * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig)} key - The key to use for this file, or a file configuration object. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". - * @param {integer} [width] - The width of the texture the HTML will be rendered to. - * @param {integer} [height] - The height of the texture the HTML will be rendered to. + * @param {number} [width] - The width of the texture the HTML will be rendered to. + * @param {number} [height] - The height of the texture the HTML will be rendered to. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ var HTMLTextureFile = new Class({ @@ -225,8 +225,8 @@ var HTMLTextureFile = new Class({ * * @param {(string|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig|Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". - * @param {integer} [width=512] - The width of the texture the HTML will be rendered to. - * @param {integer} [height=512] - The height of the texture the HTML will be rendered to. + * @param {number} [width=512] - The width of the texture the HTML will be rendered to. + * @param {number} [height=512] - The height of the texture the HTML will be rendered to. * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. diff --git a/src/loader/filetypes/OBJFile.js b/src/loader/filetypes/OBJFile.js index abb1ffd7d..5435ab55f 100644 --- a/src/loader/filetypes/OBJFile.js +++ b/src/loader/filetypes/OBJFile.js @@ -5,12 +5,13 @@ */ var Class = require('../../utils/Class'); -var CONST = require('../const'); -var File = require('../File'); var FileTypesManager = require('../FileTypesManager'); var GetFastValue = require('../../utils/object/GetFastValue'); var IsPlainObject = require('../../utils/object/IsPlainObject'); +var MultiFile = require('../MultiFile'); var ParseObj = require('../../geom/mesh/ParseObj'); +var ParseObjMaterial = require('../../geom/mesh/ParseObjMaterial'); +var TextFile = require('./TextFile'); /** * @classdesc @@ -21,68 +22,117 @@ var ParseObj = require('../../geom/mesh/ParseObj'); * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj. * * @class OBJFile - * @extends Phaser.Loader.File + * @extends Phaser.Loader.MultiFile * @memberof Phaser.Loader.FileTypes * @constructor * @since 3.50.0 * * @param {Phaser.Loader.LoaderPlugin} loader - A reference to the Loader that is responsible for this file. * @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig)} key - The key to use for this file, or a file configuration object. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". - * @param {boolean} [flipUV=true] - Flip the UV coordinates stored in the texture locations? - * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + * @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param {string} [matURL] - The absolute or relative URL to load the material file from. If undefined or `null` it will be set to `.mat`, i.e. if `key` was "alien" then the URL will be "alien.mat". + * @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data? + * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for these files. */ var OBJFile = new Class({ - Extends: File, + Extends: MultiFile, initialize: - function OBJFile (loader, key, url, flipUV, xhrSettings) + function OBJFile (loader, key, objURL, matURL, flipUV, xhrSettings) { - var extension = 'obj'; + var obj; + var mat; + + var cache = loader.cacheManager.obj; if (IsPlainObject(key)) { var config = key; key = GetFastValue(config, 'key'); - url = GetFastValue(config, 'url'); - flipUV = GetFastValue(config, 'flipUV'); - xhrSettings = GetFastValue(config, 'xhrSettings'); - extension = GetFastValue(config, 'extension', extension); + + obj = new TextFile(loader, { + key: key, + type: 'obj', + cache: cache, + url: GetFastValue(config, 'url'), + extension: GetFastValue(config, 'extension', 'obj'), + xhrSettings: GetFastValue(config, 'xhrSettings'), + config: { + flipUV: GetFastValue(config, 'flipUV', flipUV) + } + }); + + matURL = GetFastValue(config, 'matURL'); + + if (matURL) + { + mat = new TextFile(loader, { + key: key, + type: 'mat', + cache: cache, + url: matURL, + extension: GetFastValue(config, 'matExtension', 'mat'), + xhrSettings: GetFastValue(config, 'xhrSettings') + }); + } + } + else + { + obj = new TextFile(loader, { + key: key, + url: objURL, + type: 'obj', + cache: cache, + extension: 'obj', + xhrSettings: xhrSettings, + config: { + flipUV: flipUV + } + }); + + if (matURL) + { + mat = new TextFile(loader, { + key: key, + url: matURL, + type: 'mat', + cache: cache, + extension: 'mat', + xhrSettings: xhrSettings + }); + } } - var fileConfig = { - type: 'text', - cache: loader.cacheManager.obj, - extension: extension, - responseType: 'text', - key: key, - url: url, - xhrSettings: xhrSettings, - config: { - flipUV: flipUV - } - }; - - File.call(this, loader, fileConfig); + MultiFile.call(this, loader, 'obj', key, [ obj, mat ]); }, /** - * Called automatically by Loader.nextFile. - * This method controls what extra work this File does with its loaded data. + * Adds this file to its target cache upon successful loading and processing. * - * @method Phaser.Loader.FileTypes.HTMLFile#onProcess + * @method Phaser.Loader.FileTypes.OBJFile#addToCache * @since 3.50.0 */ - onProcess: function () + addToCache: function () { - this.state = CONST.FILE_PROCESSING; + if (this.isReadyToProcess()) + { + var obj = this.files[0]; + var mat = this.files[1]; - this.data = ParseObj(this.xhrLoader.responseText, this.config.flipUV); + var objData = ParseObj(obj.data, obj.config.flipUV); - this.onProcessComplete(); + if (mat) + { + objData.materials = ParseObjMaterial(mat.data); + } + + obj.cache.add(obj.key, objData); + + this.complete = true; + } } }); @@ -101,6 +151,17 @@ var OBJFile = new Class({ * } * ``` * + * You can optionally also load a Wavefront Material file as well, by providing the 3rd parameter: + * + * ```javascript + * function preload () + * { + * this.load.obj('ufo', 'files/spaceship.obj', 'files/spaceship.mtl'); + * } + * ``` + * + * If given, the material will be parsed and stored along with the obj data in the cache. + * * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, * or if it's already running, when the next free load slot becomes available. This happens automatically if you * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued @@ -120,6 +181,7 @@ var OBJFile = new Class({ * this.load.obj({ * key: 'ufo', * url: 'files/spaceship.obj', + * matURL: 'files/spaceship.mtl', * flipUV: true * }); * ``` @@ -152,25 +214,32 @@ var OBJFile = new Class({ * @since 3.50.0 * * @param {(string|Phaser.Types.Loader.FileTypes.OBJFileConfig|Phaser.Types.Loader.FileTypes.OBJFileConfig[])} key - The key to use for this file, or a file configuration object, or array of them. - * @param {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". - * @param {boolean} [flipUVs=true] - Flip the UV coordinates stored in the texture locations? + * @param {string} [objURL] - The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param {string} [matURL] - Optional absolute or relative URL to load the obj material file from. + * @param {boolean} [flipUV] - Flip the UV coordinates stored in the model data? * @param {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. * * @return {this} The Loader instance. */ -FileTypesManager.register('obj', function (key, url, flipUVs, xhrSettings) +FileTypesManager.register('obj', function (key, objURL, matURL, flipUVs, xhrSettings) { + var multifile; + if (Array.isArray(key)) { for (var i = 0; i < key.length; i++) { + multifile = new OBJFile(this, key[i]); + // If it's an array it has to be an array of Objects, so we get everything out of the 'key' object - this.addFile(new OBJFile(this, key[i])); + this.addFile(multifile.files); } } else { - this.addFile(new OBJFile(this, key, url, flipUVs, xhrSettings)); + multifile = new OBJFile(this, key, objURL, matURL, flipUVs, xhrSettings); + + this.addFile(multifile.files); } return this; diff --git a/src/loader/filetypes/SceneFile.js b/src/loader/filetypes/SceneFile.js index deeddac7e..6c27a7369 100644 --- a/src/loader/filetypes/SceneFile.js +++ b/src/loader/filetypes/SceneFile.js @@ -52,7 +52,6 @@ var SceneFile = new Class({ var fileConfig = { type: 'text', - cache: loader.cacheManager.text, extension: extension, responseType: 'text', key: key, diff --git a/src/loader/filetypes/TextFile.js b/src/loader/filetypes/TextFile.js index 4b7ce1bbc..fa938ad83 100644 --- a/src/loader/filetypes/TextFile.js +++ b/src/loader/filetypes/TextFile.js @@ -38,7 +38,9 @@ var TextFile = new Class({ function TextFile (loader, key, url, xhrSettings) { + var type = 'text'; var extension = 'txt'; + var cache = loader.cacheManager.text; if (IsPlainObject(key)) { @@ -48,11 +50,13 @@ var TextFile = new Class({ url = GetFastValue(config, 'url'); xhrSettings = GetFastValue(config, 'xhrSettings'); extension = GetFastValue(config, 'extension', extension); + type = GetFastValue(config, 'type', type); + cache = GetFastValue(config, 'cache', cache); } var fileConfig = { - type: 'text', - cache: loader.cacheManager.text, + type: type, + cache: cache, extension: extension, responseType: 'text', key: key, diff --git a/src/loader/filetypes/UnityAtlasFile.js b/src/loader/filetypes/UnityAtlasFile.js index 0ab30c460..8b1addd27 100644 --- a/src/loader/filetypes/UnityAtlasFile.js +++ b/src/loader/filetypes/UnityAtlasFile.js @@ -98,8 +98,6 @@ var UnityAtlasFile = new Class({ this.loader.textureManager.addUnityAtlas(image.key, image.data, text.data, normalMap); - text.addToCache(); - this.complete = true; } } diff --git a/src/loader/filetypes/index.js b/src/loader/filetypes/index.js index 7d352a9ed..3fb6be06f 100644 --- a/src/loader/filetypes/index.js +++ b/src/loader/filetypes/index.js @@ -11,6 +11,7 @@ module.exports = { AnimationJSONFile: require('./AnimationJSONFile'), + AsepriteFile: require('./AsepriteFile'), AtlasJSONFile: require('./AtlasJSONFile'), AtlasXMLFile: require('./AtlasXMLFile'), AudioFile: require('./AudioFile'), diff --git a/src/loader/filetypes/typedefs/AsepriteFileConfig.js b/src/loader/filetypes/typedefs/AsepriteFileConfig.js new file mode 100644 index 000000000..ded4e6434 --- /dev/null +++ b/src/loader/filetypes/typedefs/AsepriteFileConfig.js @@ -0,0 +1,11 @@ +/** + * @typedef {object} Phaser.Types.Loader.FileTypes.AsepriteFileConfig + * + * @property {string} key - The key of the file. Must be unique within both the Loader and the Texture Manager. + * @property {string} [textureURL] - The absolute or relative URL to load the texture image file from. + * @property {string} [textureExtension='png'] - The default file extension to use for the image texture if no url is provided. + * @property {Phaser.Types.Loader.XHRSettingsObject} [textureXhrSettings] - Extra XHR Settings specifically for the texture image file. + * @property {object|string} [atlasURL] - The absolute or relative URL to load the atlas json file from. Or, a well formed JSON object to use instead. + * @property {string} [atlasExtension='json'] - The default file extension to use for the atlas json if no url is provided. + * @property {Phaser.Types.Loader.XHRSettingsObject} [atlasXhrSettings] - Extra XHR Settings specifically for the atlas json file. + */ diff --git a/src/loader/filetypes/typedefs/HTMLTextureFileConfig.js b/src/loader/filetypes/typedefs/HTMLTextureFileConfig.js index 1428926c4..1e4c7f43c 100644 --- a/src/loader/filetypes/typedefs/HTMLTextureFileConfig.js +++ b/src/loader/filetypes/typedefs/HTMLTextureFileConfig.js @@ -5,6 +5,6 @@ * @property {string} [url] - The absolute or relative URL to load the file from. * @property {string} [extension='html'] - The default file extension to use if no url is provided. * @property {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. - * @property {integer} [width=512] - The width of the texture the HTML will be rendered to. - * @property {integer} [height=512] - The height of the texture the HTML will be rendered to. + * @property {number} [width=512] - The width of the texture the HTML will be rendered to. + * @property {number} [height=512] - The height of the texture the HTML will be rendered to. */ diff --git a/src/loader/filetypes/typedefs/ImageFrameConfig.js b/src/loader/filetypes/typedefs/ImageFrameConfig.js index 4c3f0e7e5..dcc0513f0 100644 --- a/src/loader/filetypes/typedefs/ImageFrameConfig.js +++ b/src/loader/filetypes/typedefs/ImageFrameConfig.js @@ -1,10 +1,10 @@ /** * @typedef {object} Phaser.Types.Loader.FileTypes.ImageFrameConfig * - * @property {integer} frameWidth - The width of the frame in pixels. - * @property {integer} [frameHeight] - The height of the frame in pixels. Uses the `frameWidth` value if not provided. - * @property {integer} [startFrame=0] - The first frame to start parsing from. - * @property {integer} [endFrame] - The frame to stop parsing at. If not provided it will calculate the value based on the image and frame dimensions. - * @property {integer} [margin=0] - The margin in the image. This is the space around the edge of the frames. - * @property {integer} [spacing=0] - The spacing between each frame in the image. + * @property {number} frameWidth - The width of the frame in pixels. + * @property {number} [frameHeight] - The height of the frame in pixels. Uses the `frameWidth` value if not provided. + * @property {number} [startFrame=0] - The first frame to start parsing from. + * @property {number} [endFrame] - The frame to stop parsing at. If not provided it will calculate the value based on the image and frame dimensions. + * @property {number} [margin=0] - The margin in the image. This is the space around the edge of the frames. + * @property {number} [spacing=0] - The spacing between each frame in the image. */ diff --git a/src/loader/filetypes/typedefs/OBJFileConfig.js b/src/loader/filetypes/typedefs/OBJFileConfig.js new file mode 100644 index 000000000..d63b3778d --- /dev/null +++ b/src/loader/filetypes/typedefs/OBJFileConfig.js @@ -0,0 +1,11 @@ +/** + * @typedef {object} Phaser.Types.Loader.FileTypes.OBJFileConfig + * + * @property {string} key - The key of the file. Must be unique within both the Loader and the OBJ Cache. + * @property {string} [url] - The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @property {string} [extension='obj'] - The default file extension to use if no url is provided. + * @property {boolean} [flipUV] - Flip the UV coordinates stored in the model data? + * @property {string} [matURL] - An optional absolute or relative URL to the object material file from. If undefined or `null`, no material file will be loaded. + * @property {string} [matExtension='mat'] - The default material file extension to use if no url is provided. + * @property {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. + */ diff --git a/src/loader/filetypes/typedefs/SVGSizeConfig.js b/src/loader/filetypes/typedefs/SVGSizeConfig.js index 3d0473cd9..334eb4f21 100644 --- a/src/loader/filetypes/typedefs/SVGSizeConfig.js +++ b/src/loader/filetypes/typedefs/SVGSizeConfig.js @@ -1,7 +1,7 @@ /** * @typedef {object} Phaser.Types.Loader.FileTypes.SVGSizeConfig * - * @property {integer} [width] - An optional width. The SVG will be resized to this size before being rendered to a texture. - * @property {integer} [height] - An optional height. The SVG will be resized to this size before being rendered to a texture. + * @property {number} [width] - An optional width. The SVG will be resized to this size before being rendered to a texture. + * @property {number} [height] - An optional height. The SVG will be resized to this size before being rendered to a texture. * @property {number} [scale] - An optional scale. If given it overrides the width / height properties. The SVG is scaled by the scale factor before being rendered to a texture. */ diff --git a/src/loader/filetypes/typedefs/SceneFileConfig.js b/src/loader/filetypes/typedefs/SceneFileConfig.js index fa7df6e09..ca3f323ad 100644 --- a/src/loader/filetypes/typedefs/SceneFileConfig.js +++ b/src/loader/filetypes/typedefs/SceneFileConfig.js @@ -3,6 +3,6 @@ * * @property {string} key - The key of the file. Must be unique within both the Loader and the Text Cache. * @property {string} [url] - The absolute or relative URL to load the file from. - * @property {string} [extension='txt'] - The default file extension to use if no url is provided. + * @property {string} [extension='js'] - The default file extension to use if no url is provided. * @property {Phaser.Types.Loader.XHRSettingsObject} [xhrSettings] - Extra XHR Settings specifically for this file. */ diff --git a/src/loader/typedefs/XHRSettingsObject.js b/src/loader/typedefs/XHRSettingsObject.js index 7f362988d..01729d4e4 100644 --- a/src/loader/typedefs/XHRSettingsObject.js +++ b/src/loader/typedefs/XHRSettingsObject.js @@ -6,7 +6,7 @@ * @property {boolean} [async=true] - Should the XHR request use async or not? * @property {string} [user=''] - Optional username for the XHR request. * @property {string} [password=''] - Optional password for the XHR request. - * @property {integer} [timeout=0] - Optional XHR timeout value. + * @property {number} [timeout=0] - Optional XHR timeout value. * @property {(object|undefined)} [headers] - This value is used to populate the XHR `setRequestHeader` and is undefined by default. * @property {(string|undefined)} [header] - This value is used to populate the XHR `setRequestHeader` and is undefined by default. * @property {(string|undefined)} [headerValue] - This value is used to populate the XHR `setRequestHeader` and is undefined by default. diff --git a/src/math/Between.js b/src/math/Between.js index bd4101f99..d537a09a3 100644 --- a/src/math/Between.js +++ b/src/math/Between.js @@ -10,10 +10,10 @@ * @function Phaser.Math.Between * @since 3.0.0 * - * @param {integer} min - The minimum value. - * @param {integer} max - The maximum value. + * @param {number} min - The minimum value. + * @param {number} max - The maximum value. * - * @return {integer} The random integer. + * @return {number} The random integer. */ var Between = function (min, max) { diff --git a/src/math/CeilTo.js b/src/math/CeilTo.js index 675875923..a695f5d7b 100644 --- a/src/math/CeilTo.js +++ b/src/math/CeilTo.js @@ -14,7 +14,7 @@ * * @param {number} value - The value to round. * @param {number} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ diff --git a/src/math/DegToRad.js b/src/math/DegToRad.js index 5fd989c20..443699f96 100644 --- a/src/math/DegToRad.js +++ b/src/math/DegToRad.js @@ -12,7 +12,7 @@ var CONST = require('./const'); * @function Phaser.Math.DegToRad * @since 3.0.0 * - * @param {integer} degrees - The angle (in degrees) to convert to radians. + * @param {number} degrees - The angle (in degrees) to convert to radians. * * @return {number} The given angle converted to radians. */ diff --git a/src/math/Euler.js b/src/math/Euler.js new file mode 100644 index 000000000..91d225a0a --- /dev/null +++ b/src/math/Euler.js @@ -0,0 +1,277 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Clamp = require('./Clamp'); +var Class = require('../utils/Class'); +var Matrix4 = require('./Matrix4'); +var NOOP = require('../utils/NOOP'); + +var tempMatrix = new Matrix4(); + +/** + * @classdesc + * + * @class Euler + * @memberof Phaser.Math + * @constructor + * @since 3.50.0 + * + * @param {number} [x] - The x component. + * @param {number} [y] - The y component. + * @param {number} [z] - The z component. + */ +var Euler = new Class({ + + initialize: + + function Euler (x, y, z, order) + { + if (x === undefined) { x = 0; } + if (y === undefined) { y = 0; } + if (z === undefined) { z = 0; } + if (order === undefined) { order = Euler.DefaultOrder; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback = NOOP; + }, + + x: { + get: function () + { + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); + } + }, + + y: { + get: function () + { + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + order: { + get: function () + { + return this._order; + }, + + set: function (value) + { + this._order = value; + + this.onChangeCallback(this); + } + }, + + set: function (x, y, z, order) + { + if (order === undefined) { order = this._order; } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + this.onChangeCallback(this); + + return this; + }, + + copy: function (euler) + { + return this.set(euler.x, euler.y, euler.z, euler.order); + }, + + setFromQuaternion: function (quaternion, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + tempMatrix.fromQuat(quaternion); + + return this.setFromRotationMatrix(tempMatrix, order, update); + }, + + setFromRotationMatrix: function (matrix, order, update) + { + if (order === undefined) { order = this._order; } + if (update === undefined) { update = false; } + + var elements = matrix.val; + + // Upper 3x3 of matrix is un-scaled rotation matrix + var m11 = elements[0]; + var m12 = elements[4]; + var m13 = elements[8]; + var m21 = elements[1]; + var m22 = elements[5]; + var m23 = elements[9]; + var m31 = elements[2]; + var m32 = elements[6]; + var m33 = elements[10]; + + var x = 0; + var y = 0; + var z = 0; + var epsilon = 0.99999; + + switch (order) + { + case 'XYZ': + { + y = Math.asin(Clamp(m13, -1, 1)); + + if (Math.abs(m13) < epsilon) + { + x = Math.atan2(-m23, m33); + z = Math.atan2(-m12, m11); + } + else + { + x = Math.atan2(m32, m22); + } + + break; + } + + case 'YXZ': + { + x = Math.asin(-Clamp(m23, -1, 1)); + + if (Math.abs(m23) < epsilon) + { + y = Math.atan2(m13, m33); + z = Math.atan2(m21, m22); + } + else + { + y = Math.atan2(-m31, m11); + } + + break; + } + + case 'ZXY': + { + x = Math.asin(Clamp(m32, -1, 1)); + + if (Math.abs(m32) < epsilon) + { + y = Math.atan2(-m31, m33); + z = Math.atan2(-m12, m22); + } + else + { + z = Math.atan2(m21, m11); + } + + break; + } + + case 'ZYX': + { + y = Math.asin(-Clamp(m31, -1, 1)); + + if (Math.abs(m31) < epsilon) + { + x = Math.atan2(m32, m33); + z = Math.atan2(m21, m11); + } + else + { + z = Math.atan2(-m12, m22); + } + + break; + } + + case 'YZX': + { + z = Math.asin(Clamp(m21, -1, 1)); + + if (Math.abs(m21) < epsilon) + { + x = Math.atan2(-m23, m22); + y = Math.atan2(-m31, m11); + } + else + { + y = Math.atan2(m13, m33); + } + + break; + } + + case 'XZY': + { + z = Math.asin(-Clamp(m12, -1, 1)); + + if (Math.abs(m12) < epsilon) + { + x = Math.atan2(m32, m22); + y = Math.atan2(m13, m11); + } + else + { + x = Math.atan2(-m23, m33); + } + + break; + } + } + + this._x = x; + this._y = y; + this._z = z; + this._order = order; + + if (update) + { + this.onChangeCallback(this); + } + + return this; + } + +}); + +Euler.RotationOrders = [ 'XYZ', 'YXZ', 'ZXY', 'ZYX', 'YZX', 'XZY' ]; + +Euler.DefaultOrder = 'XYZ'; + +module.exports = Euler; diff --git a/src/math/FloorTo.js b/src/math/FloorTo.js index 15ad4a8a7..dcd26d2c1 100644 --- a/src/math/FloorTo.js +++ b/src/math/FloorTo.js @@ -13,8 +13,8 @@ * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ diff --git a/src/math/GetSpeed.js b/src/math/GetSpeed.js index 0c21b7e48..ad4943527 100644 --- a/src/math/GetSpeed.js +++ b/src/math/GetSpeed.js @@ -11,7 +11,7 @@ * @since 3.0.0 * * @param {number} distance - The distance. - * @param {integer} time - The time, in seconds. + * @param {number} time - The time, in seconds. * * @return {number} The speed, in distance per ms. * diff --git a/src/math/Matrix4.js b/src/math/Matrix4.js index f4a465b35..76bd5f3b6 100644 --- a/src/math/Matrix4.js +++ b/src/math/Matrix4.js @@ -4,17 +4,21 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -// Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji -// and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl - var Class = require('../utils/Class'); +var Vector3 = require('./Vector3'); +/** + * @ignore + */ var EPSILON = 0.000001; /** * @classdesc * A four-dimensional matrix. * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl + * * @class Matrix4 * @memberof Phaser.Math * @constructor @@ -62,8 +66,6 @@ var Matrix4 = new Class({ return new Matrix4(this); }, - // TODO - Should work with basic values - /** * This method is an alias for `Matrix4.copy`. * @@ -72,73 +74,38 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The Matrix to set the values of this Matrix's from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ set: function (src) { return this.copy(src); }, - // TODO - Docs - fromRotationXYTranslation: function (rotation, position, translateFirst) - { - var x = position.x; - var y = position.y; - var z = position.z; - - var sx = Math.sin(rotation.x); - var cx = Math.cos(rotation.x); - - var sy = Math.sin(rotation.y); - var cy = Math.cos(rotation.y); - - var a30 = x; - var a31 = y; - var a32 = z; - - // Rotate X - - var b21 = -sx; - - // Rotate Y - - var c01 = 0 - b21 * sy; - - var c02 = 0 - cx * sy; - - var c21 = b21 * cy; - - var c22 = cx * cy; - - // Translate - if (!translateFirst) - { - // a30 = cy * x + 0 * y + sy * z; - a30 = cy * x + sy * z; - a31 = c01 * x + cx * y + c21 * z; - a32 = c02 * x + sx * y + c22 * z; - } - - return this.setValues( - cy, - c01, - c02, - 0, - 0, - cx, - sx, - 0, - sy, - c21, - c22, - 0, - a30, - a31, - a32, - 1 - ); - }, - + /** + * Sets all values of this Matrix4. + * + * @method Phaser.Math.Matrix4#setValues + * @since 3.50.0 + * + * @param {number} m00 - The m00 value. + * @param {number} m01 - The m01 value. + * @param {number} m02 - The m02 value. + * @param {number} m03 - The m03 value. + * @param {number} m10 - The m10 value. + * @param {number} m11 - The m11 value. + * @param {number} m12 - The m12 value. + * @param {number} m13 - The m13 value. + * @param {number} m20 - The m20 value. + * @param {number} m21 - The m21 value. + * @param {number} m22 - The m22 value. + * @param {number} m23 - The m23 value. + * @param {number} m30 - The m30 value. + * @param {number} m31 - The m31 value. + * @param {number} m32 - The m32 value. + * @param {number} m33 - The m33 value. + * + * @return {this} This Matrix4 instance. + */ setValues: function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { var out = this.val; @@ -171,31 +138,13 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The Matrix to copy the values from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ copy: function (src) { - var out = this.val; var a = src.val; - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); }, /** @@ -204,32 +153,13 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#fromArray * @since 3.0.0 * - * @param {array} a - The array to copy the values from. + * @param {number[]} a - The array to copy the values from. Must have at least 16 elements. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ fromArray: function (a) { - var out = this.val; - - out[0] = a[0]; - out[1] = a[1]; - out[2] = a[2]; - out[3] = a[3]; - out[4] = a[4]; - out[5] = a[5]; - out[6] = a[6]; - out[7] = a[7]; - out[8] = a[8]; - out[9] = a[9]; - out[10] = a[10]; - out[11] = a[11]; - out[12] = a[12]; - out[13] = a[13]; - out[14] = a[14]; - out[15] = a[15]; - - return this; + return this.setValues(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); }, /** @@ -244,26 +174,52 @@ var Matrix4 = new Class({ */ zero: function () { - var out = this.val; + return this.setValues(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + }, - out[0] = 0; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 0; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 0; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 0; + /** + * Generates a transform matrix based on the given position, scale and rotation. + * + * @method Phaser.Math.Matrix4#transform + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {Phaser.Math.Vector3} scale - The scale vector. + * @param {Phaser.Math.Quaternion} rotation - The rotation quaternion. + * + * @return {this} This Matrix4. + */ + transform: function (position, scale, rotation) + { + var rotMatrix = _tempMat1.fromQuat(rotation); - return this; + var rm = rotMatrix.val; + + var sx = scale.x; + var sy = scale.y; + var sz = scale.z; + + return this.setValues( + rm[0] * sx, + rm[1] * sx, + rm[2] * sx, + 0, + + rm[4] * sy, + rm[5] * sy, + rm[6] * sy, + 0, + + rm[8] * sz, + rm[9] * sz, + rm[10] * sz, + 0, + + position.x, + position.y, + position.z, + 1 + ); }, /** @@ -276,7 +232,7 @@ var Matrix4 = new Class({ * @param {number} y - The y value. * @param {number} z - The z value. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ xyz: function (x, y, z) { @@ -301,7 +257,7 @@ var Matrix4 = new Class({ * @param {number} y - The y scaling value. * @param {number} z - The z scaling value. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ scaling: function (x, y, z) { @@ -323,30 +279,11 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#identity * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ identity: function () { - var out = this.val; - - out[0] = 1; - out[1] = 0; - out[2] = 0; - out[3] = 0; - out[4] = 0; - out[5] = 1; - out[6] = 0; - out[7] = 0; - out[8] = 0; - out[9] = 0; - out[10] = 1; - out[11] = 0; - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; + return this.setValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }, /** @@ -355,7 +292,7 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#transpose * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ transpose: function () { @@ -384,13 +321,30 @@ var Matrix4 = new Class({ return this; }, + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * + * @method Phaser.Math.Matrix4#getInverse + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to invert into this Matrix4. + * + * @return {this} This Matrix4. + */ + getInverse: function (m) + { + this.copy(m); + + return this.invert(); + }, + /** * Invert this Matrix. * * @method Phaser.Math.Matrix4#invert * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ invert: function () { @@ -431,34 +385,34 @@ var Matrix4 = new Class({ var b10 = a21 * a33 - a23 * a31; var b11 = a22 * a33 - a23 * a32; - // Calculate the determinant + // Calculate the determinant var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; if (!det) { - return null; + return this; } det = 1 / det; - a[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; - a[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; - a[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; - a[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; - a[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; - a[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; - a[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; - a[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; - a[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; - a[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; - a[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; - a[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; - a[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; - a[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; - a[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; - a[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; - - return this; + return this.setValues( + (a11 * b11 - a12 * b10 + a13 * b09) * det, + (a02 * b10 - a01 * b11 - a03 * b09) * det, + (a31 * b05 - a32 * b04 + a33 * b03) * det, + (a22 * b04 - a21 * b05 - a23 * b03) * det, + (a12 * b08 - a10 * b11 - a13 * b07) * det, + (a00 * b11 - a02 * b08 + a03 * b07) * det, + (a32 * b02 - a30 * b05 - a33 * b01) * det, + (a20 * b05 - a22 * b02 + a23 * b01) * det, + (a10 * b10 - a11 * b08 + a13 * b06) * det, + (a01 * b08 - a00 * b10 - a03 * b06) * det, + (a30 * b04 - a31 * b02 + a33 * b00) * det, + (a21 * b02 - a20 * b04 - a23 * b00) * det, + (a11 * b07 - a10 * b09 - a12 * b06) * det, + (a00 * b09 - a01 * b07 + a02 * b06) * det, + (a31 * b01 - a30 * b03 - a32 * b00) * det, + (a20 * b03 - a21 * b01 + a22 * b00) * det + ); }, /** @@ -467,7 +421,7 @@ var Matrix4 = new Class({ * @method Phaser.Math.Matrix4#adjoint * @since 3.0.0 * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ adjoint: function () { @@ -493,24 +447,24 @@ var Matrix4 = new Class({ var a32 = a[14]; var a33 = a[15]; - a[0] = (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)); - a[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); - a[2] = (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)); - a[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); - a[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); - a[5] = (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)); - a[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); - a[7] = (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)); - a[8] = (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)); - a[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); - a[10] = (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)); - a[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); - a[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); - a[13] = (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)); - a[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); - a[15] = (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)); - - return this; + return this.setValues( + (a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22)), + -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)), + (a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12)), + -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)), + -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)), + (a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22)), + -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)), + (a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12)), + (a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21)), + -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)), + (a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11)), + -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)), + -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)), + (a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21)), + -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)), + (a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11)) + ); }, /** @@ -562,69 +516,6 @@ var Matrix4 = new Class({ return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; }, - // TODO - Docs - multiplyToMat4: function (src, out) - { - var a = this.val; - var b = src.val; - - var a00 = a[0]; - var a01 = a[1]; - var a02 = a[2]; - var a03 = a[3]; - var a10 = a[4]; - var a11 = a[5]; - var a12 = a[6]; - var a13 = a[7]; - var a20 = a[8]; - var a21 = a[9]; - var a22 = a[10]; - var a23 = a[11]; - var a30 = a[12]; - var a31 = a[13]; - var a32 = a[14]; - var a33 = a[15]; - - var b00 = b[0]; - var b01 = b[1]; - var b02 = b[2]; - var b03 = b[3]; - var b10 = b[4]; - var b11 = b[5]; - var b12 = b[6]; - var b13 = b[7]; - var b20 = b[8]; - var b21 = b[9]; - var b22 = b[10]; - var b23 = b[11]; - var b30 = b[12]; - var b31 = b[13]; - var b32 = b[14]; - var b33 = b[15]; - - return out.setValues( - b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, - b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, - b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, - b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, - - b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, - b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, - b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, - b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, - - b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, - b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, - b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, - b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, - - b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, - b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, - b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, - b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 - ); - }, - /** * Multiply this Matrix by the given Matrix. * @@ -633,7 +524,7 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The Matrix to multiply this Matrix by. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ multiply: function (src) { @@ -713,35 +604,121 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Matrix4} src - The source Matrix4 that this Matrix4 is multiplied by. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ multiplyLocal: function (src) { - var a = []; - var m1 = this.val; - var m2 = src.val; + var a = this.val; + var b = src.val; - a[0] = m1[0] * m2[0] + m1[1] * m2[4] + m1[2] * m2[8] + m1[3] * m2[12]; - a[1] = m1[0] * m2[1] + m1[1] * m2[5] + m1[2] * m2[9] + m1[3] * m2[13]; - a[2] = m1[0] * m2[2] + m1[1] * m2[6] + m1[2] * m2[10] + m1[3] * m2[14]; - a[3] = m1[0] * m2[3] + m1[1] * m2[7] + m1[2] * m2[11] + m1[3] * m2[15]; + return this.setValues( + a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12], + a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13], + a[0] * b[2] + a[1] * b[6] + a[2] * b[10] + a[3] * b[14], + a[0] * b[3] + a[1] * b[7] + a[2] * b[11] + a[3] * b[15], - a[4] = m1[4] * m2[0] + m1[5] * m2[4] + m1[6] * m2[8] + m1[7] * m2[12]; - a[5] = m1[4] * m2[1] + m1[5] * m2[5] + m1[6] * m2[9] + m1[7] * m2[13]; - a[6] = m1[4] * m2[2] + m1[5] * m2[6] + m1[6] * m2[10] + m1[7] * m2[14]; - a[7] = m1[4] * m2[3] + m1[5] * m2[7] + m1[6] * m2[11] + m1[7] * m2[15]; + a[4] * b[0] + a[5] * b[4] + a[6] * b[8] + a[7] * b[12], + a[4] * b[1] + a[5] * b[5] + a[6] * b[9] + a[7] * b[13], + a[4] * b[2] + a[5] * b[6] + a[6] * b[10] + a[7] * b[14], + a[4] * b[3] + a[5] * b[7] + a[6] * b[11] + a[7] * b[15], - a[8] = m1[8] * m2[0] + m1[9] * m2[4] + m1[10] * m2[8] + m1[11] * m2[12]; - a[9] = m1[8] * m2[1] + m1[9] * m2[5] + m1[10] * m2[9] + m1[11] * m2[13]; - a[10] = m1[8] * m2[2] + m1[9] * m2[6] + m1[10] * m2[10] + m1[11] * m2[14]; - a[11] = m1[8] * m2[3] + m1[9] * m2[7] + m1[10] * m2[11] + m1[11] * m2[15]; + a[8] * b[0] + a[9] * b[4] + a[10] * b[8] + a[11] * b[12], + a[8] * b[1] + a[9] * b[5] + a[10] * b[9] + a[11] * b[13], + a[8] * b[2] + a[9] * b[6] + a[10] * b[10] + a[11] * b[14], + a[8] * b[3] + a[9] * b[7] + a[10] * b[11] + a[11] * b[15], - a[12] = m1[12] * m2[0] + m1[13] * m2[4] + m1[14] * m2[8] + m1[15] * m2[12]; - a[13] = m1[12] * m2[1] + m1[13] * m2[5] + m1[14] * m2[9] + m1[15] * m2[13]; - a[14] = m1[12] * m2[2] + m1[13] * m2[6] + m1[14] * m2[10] + m1[15] * m2[14]; - a[15] = m1[12] * m2[3] + m1[13] * m2[7] + m1[14] * m2[11] + m1[15] * m2[15]; + a[12] * b[0] + a[13] * b[4] + a[14] * b[8] + a[15] * b[12], + a[12] * b[1] + a[13] * b[5] + a[14] * b[9] + a[15] * b[13], + a[12] * b[2] + a[13] * b[6] + a[14] * b[10] + a[15] * b[14], + a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15] + ); + }, - return this.fromArray(a); + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * + * @method Phaser.Math.Matrix4#premultiply + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} m - The Matrix4 to multiply with this one. + * + * @return {this} This Matrix4. + */ + premultiply: function (m) + { + return this.multiplyMatrices(m, this); + }, + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * + * @method Phaser.Math.Matrix4#multiplyMatrices + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} a - The first Matrix4 to multiply. + * @param {Phaser.Math.Matrix4} b - The second Matrix4 to multiply. + * + * @return {this} This Matrix4. + */ + multiplyMatrices: function (a, b) + { + var am = a.val; + var bm = b.val; + + var a11 = am[0]; + var a12 = am[4]; + var a13 = am[8]; + var a14 = am[12]; + var a21 = am[1]; + var a22 = am[5]; + var a23 = am[9]; + var a24 = am[13]; + var a31 = am[2]; + var a32 = am[6]; + var a33 = am[10]; + var a34 = am[14]; + var a41 = am[3]; + var a42 = am[7]; + var a43 = am[11]; + var a44 = am[15]; + + var b11 = bm[0]; + var b12 = bm[4]; + var b13 = bm[8]; + var b14 = bm[12]; + var b21 = bm[1]; + var b22 = bm[5]; + var b23 = bm[9]; + var b24 = bm[13]; + var b31 = bm[2]; + var b32 = bm[6]; + var b33 = bm[10]; + var b34 = bm[14]; + var b41 = bm[3]; + var b42 = bm[7]; + var b43 = bm[11]; + var b44 = bm[15]; + + return this.setValues( + a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41, + a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41, + a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41, + a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41, + a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42, + a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42, + a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42, + a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42, + a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43, + a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43, + a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43, + a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43, + a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44, + a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44, + a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44, + a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44 + ); }, /** @@ -752,21 +729,11 @@ var Matrix4 = new Class({ * * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to translate this Matrix with. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ translate: function (v) { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; - a[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; - a[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; - a[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; - - return this; + return this.translateXYZ(v.x, v.y, v.z); }, /** @@ -779,7 +746,7 @@ var Matrix4 = new Class({ * @param {number} y - The y component. * @param {number} z - The z component. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ translateXYZ: function (x, y, z) { @@ -803,31 +770,11 @@ var Matrix4 = new Class({ * * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} v - The Vector to scale this Matrix with. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ scale: function (v) { - var x = v.x; - var y = v.y; - var z = v.z; - var a = this.val; - - a[0] = a[0] * x; - a[1] = a[1] * x; - a[2] = a[2] * x; - a[3] = a[3] * x; - - a[4] = a[4] * y; - a[5] = a[5] * y; - a[6] = a[6] * y; - a[7] = a[7] * y; - - a[8] = a[8] * z; - a[9] = a[9] * z; - a[10] = a[10] * z; - a[11] = a[11] * z; - - return this; + return this.scaleXYZ(v.x, v.y, v.z); }, /** @@ -840,7 +787,7 @@ var Matrix4 = new Class({ * @param {number} y - The y component. * @param {number} z - The z component. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ scaleXYZ: function (x, y, z) { @@ -873,7 +820,7 @@ var Matrix4 = new Class({ * @param {(Phaser.Math.Vector3|Phaser.Math.Vector4)} axis - The rotation axis. * @param {number} angle - The rotation angle in radians. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ makeRotationAxis: function (axis, angle) { @@ -888,14 +835,12 @@ var Matrix4 = new Class({ var tx = t * x; var ty = t * y; - this.fromArray([ + return this.setValues( tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1 - ]); - - return this; + ); }, /** @@ -907,7 +852,7 @@ var Matrix4 = new Class({ * @param {number} rad - The angle in radians to rotate by. * @param {Phaser.Math.Vector3} axis - The axis to rotate upon. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotate: function (rad, axis) { @@ -919,7 +864,7 @@ var Matrix4 = new Class({ if (Math.abs(len) < EPSILON) { - return null; + return this; } len = 1 / len; @@ -946,7 +891,12 @@ var Matrix4 = new Class({ var a22 = a[10]; var a23 = a[11]; - // Construct the elements of the rotation matrix + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + // Construct the elements of the rotation matrix var b00 = x * x * t + c; var b01 = y * x * t + z * s; var b02 = z * x * t - y * s; @@ -959,21 +909,22 @@ var Matrix4 = new Class({ var b21 = y * z * t - x * s; var b22 = z * z * t + c; - // Perform rotation-specific matrix multiplication - a[0] = a00 * b00 + a10 * b01 + a20 * b02; - a[1] = a01 * b00 + a11 * b01 + a21 * b02; - a[2] = a02 * b00 + a12 * b01 + a22 * b02; - a[3] = a03 * b00 + a13 * b01 + a23 * b02; - a[4] = a00 * b10 + a10 * b11 + a20 * b12; - a[5] = a01 * b10 + a11 * b11 + a21 * b12; - a[6] = a02 * b10 + a12 * b11 + a22 * b12; - a[7] = a03 * b10 + a13 * b11 + a23 * b12; - a[8] = a00 * b20 + a10 * b21 + a20 * b22; - a[9] = a01 * b20 + a11 * b21 + a21 * b22; - a[10] = a02 * b20 + a12 * b21 + a22 * b22; - a[11] = a03 * b20 + a13 * b21 + a23 * b22; - - return this; + // Perform rotation-specific matrix multiplication + return this.setValues( + a00 * b00 + a10 * b01 + a20 * b02, + a01 * b00 + a11 * b01 + a21 * b02, + a02 * b00 + a12 * b01 + a22 * b02, + a03 * b00 + a13 * b01 + a23 * b02, + a00 * b10 + a10 * b11 + a20 * b12, + a01 * b10 + a11 * b11 + a21 * b12, + a02 * b10 + a12 * b11 + a22 * b12, + a03 * b10 + a13 * b11 + a23 * b12, + a00 * b20 + a10 * b21 + a20 * b22, + a01 * b20 + a11 * b21 + a21 * b22, + a02 * b20 + a12 * b21 + a22 * b22, + a03 * b20 + a13 * b21 + a23 * b22, + a30, a31, a32, a33 + ); }, /** @@ -984,7 +935,7 @@ var Matrix4 = new Class({ * * @param {number} rad - The angle in radians to rotate by. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotateX: function (rad) { @@ -1002,7 +953,7 @@ var Matrix4 = new Class({ var a22 = a[10]; var a23 = a[11]; - // Perform axis-specific matrix multiplication + // Perform axis-specific matrix multiplication a[4] = a10 * c + a20 * s; a[5] = a11 * c + a21 * s; a[6] = a12 * c + a22 * s; @@ -1023,7 +974,7 @@ var Matrix4 = new Class({ * * @param {number} rad - The angle to rotate by, in radians. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotateY: function (rad) { @@ -1041,7 +992,7 @@ var Matrix4 = new Class({ var a22 = a[10]; var a23 = a[11]; - // Perform axis-specific matrix multiplication + // Perform axis-specific matrix multiplication a[0] = a00 * c - a20 * s; a[1] = a01 * c - a21 * s; a[2] = a02 * c - a22 * s; @@ -1062,7 +1013,7 @@ var Matrix4 = new Class({ * * @param {number} rad - The angle to rotate by, in radians. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ rotateZ: function (rad) { @@ -1080,7 +1031,7 @@ var Matrix4 = new Class({ var a12 = a[6]; var a13 = a[7]; - // Perform axis-specific matrix multiplication + // Perform axis-specific matrix multiplication a[0] = a00 * c + a10 * s; a[1] = a01 * c + a11 * s; a[2] = a02 * c + a12 * s; @@ -1102,13 +1053,11 @@ var Matrix4 = new Class({ * @param {Phaser.Math.Quaternion} q - The Quaternion to set rotation from. * @param {Phaser.Math.Vector3} v - The Vector to set translation from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ fromRotationTranslation: function (q, v) { - // Quaternion math - var out = this.val; - + // Quaternion math var x = q.x; var y = q.y; var z = q.z; @@ -1130,27 +1079,27 @@ var Matrix4 = new Class({ var wy = w * y2; var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, - out[12] = v.x; - out[13] = v.y; - out[14] = v.z; - out[15] = 1; - - return this; + v.x, + v.y, + v.z, + 1 + ); }, /** @@ -1161,12 +1110,10 @@ var Matrix4 = new Class({ * * @param {Phaser.Math.Quaternion} q - The Quaternion to set the values of this Matrix from. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ fromQuat: function (q) { - var out = this.val; - var x = q.x; var y = q.y; var z = q.z; @@ -1188,27 +1135,27 @@ var Matrix4 = new Class({ var wy = w * y2; var wz = w * z2; - out[0] = 1 - (yy + zz); - out[1] = xy + wz; - out[2] = xz - wy; - out[3] = 0; + return this.setValues( + 1 - (yy + zz), + xy + wz, + xz - wy, + 0, - out[4] = xy - wz; - out[5] = 1 - (xx + zz); - out[6] = yz + wx; - out[7] = 0; + xy - wz, + 1 - (xx + zz), + yz + wx, + 0, - out[8] = xz + wy; - out[9] = yz - wx; - out[10] = 1 - (xx + yy); - out[11] = 0; + xz + wy, + yz - wx, + 1 - (xx + yy), + 0, - out[12] = 0; - out[13] = 0; - out[14] = 0; - out[15] = 1; - - return this; + 0, + 0, + 0, + 1 + ); }, /** @@ -1224,37 +1171,35 @@ var Matrix4 = new Class({ * @param {number} near - The near bound of the frustum. * @param {number} far - The far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ frustum: function (left, right, bottom, top, near, far) { - var out = this.val; - var rl = 1 / (right - left); var tb = 1 / (top - bottom); var nf = 1 / (near - far); - out[0] = (near * 2) * rl; - out[1] = 0; - out[2] = 0; - out[3] = 0; + return this.setValues( + (near * 2) * rl, + 0, + 0, + 0, - out[4] = 0; - out[5] = (near * 2) * tb; - out[6] = 0; - out[7] = 0; + 0, + (near * 2) * tb, + 0, + 0, - out[8] = (right + left) * rl; - out[9] = (top + bottom) * tb; - out[10] = (far + near) * nf; - out[11] = -1; + (right + left) * rl, + (top + bottom) * tb, + (far + near) * nf, + -1, - out[12] = 0; - out[13] = 0; - out[14] = (far * near * 2) * nf; - out[15] = 0; - - return this; + 0, + 0, + (far * near * 2) * nf, + 0 + ); }, /** @@ -1268,35 +1213,34 @@ var Matrix4 = new Class({ * @param {number} near - Near bound of the frustum. * @param {number} far - Far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ perspective: function (fovy, aspect, near, far) { - var out = this.val; var f = 1.0 / Math.tan(fovy / 2); var nf = 1 / (near - far); - out[0] = f / aspect; - out[1] = 0; - out[2] = 0; - out[3] = 0; + return this.setValues( + f / aspect, + 0, + 0, + 0, - out[4] = 0; - out[5] = f; - out[6] = 0; - out[7] = 0; + 0, + f, + 0, + 0, - out[8] = 0; - out[9] = 0; - out[10] = (far + near) * nf; - out[11] = -1; + 0, + 0, + (far + near) * nf, + -1, - out[12] = 0; - out[13] = 0; - out[14] = (2 * far * near) * nf; - out[15] = 0; - - return this; + 0, + 0, + (2 * far * near) * nf, + 0 + ); }, /** @@ -1310,33 +1254,31 @@ var Matrix4 = new Class({ * @param {number} near - Near bound of the frustum. * @param {number} far - Far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ perspectiveLH: function (width, height, near, far) { - var out = this.val; + return this.setValues( + (2 * near) / width, + 0, + 0, + 0, - out[0] = (2 * near) / width; - out[1] = 0; - out[2] = 0; - out[3] = 0; + 0, + (2 * near) / height, + 0, + 0, - out[4] = 0; - out[5] = (2 * near) / height; - out[6] = 0; - out[7] = 0; + 0, + 0, + -far / (near - far), + 1, - out[8] = 0; - out[9] = 0; - out[10] = -far / (near - far); - out[11] = 1; - - out[12] = 0; - out[13] = 0; - out[14] = (near * far) / (near - far); - out[15] = 0; - - return this; + 0, + 0, + (near * far) / (near - far), + 0 + ); }, /** @@ -1352,11 +1294,10 @@ var Matrix4 = new Class({ * @param {number} near - The near bound of the frustum. * @param {number} far - The far bound of the frustum. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ ortho: function (left, right, bottom, top, near, far) { - var out = this.val; var lr = left - right; var bt = bottom - top; var nf = near - far; @@ -1366,25 +1307,85 @@ var Matrix4 = new Class({ bt = (bt === 0) ? bt : 1 / bt; nf = (nf === 0) ? nf : 1 / nf; - out[0] = -2 * lr; - out[1] = 0; - out[2] = 0; - out[3] = 0; + return this.setValues( + -2 * lr, + 0, + 0, + 0, - out[4] = 0; - out[5] = -2 * bt; - out[6] = 0; - out[7] = 0; + 0, + -2 * bt, + 0, + 0, - out[8] = 0; - out[9] = 0; - out[10] = 2 * nf; - out[11] = 0; + 0, + 0, + 2 * nf, + 0, - out[12] = (left + right) * lr; - out[13] = (top + bottom) * bt; - out[14] = (far + near) * nf; - out[15] = 1; + (left + right) * lr, + (top + bottom) * bt, + (far + near) * nf, + 1 + ); + }, + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * + * @method Phaser.Math.Matrix4#lookAtRH + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} eye - Position of the viewer. + * @param {Phaser.Math.Vector3} target - Point the viewer is looking at. + * @param {Phaser.Math.Vector3} up - vec3 pointing up. + * + * @return {this} This Matrix4. + */ + lookAtRH: function (eye, target, up) + { + var m = this.val; + + _z.subVectors(eye, target); + + if (_z.getLengthSquared() === 0) + { + // eye and target are in the same position + _z.z = 1; + } + + _z.normalize(); + _x.crossVectors(up, _z); + + if (_x.getLengthSquared() === 0) + { + // up and z are parallel + + if (Math.abs(up.z) === 1) + { + _z.x += 0.0001; + } + else + { + _z.z += 0.0001; + } + + _z.normalize(); + _x.crossVectors(up, _z); + } + + _x.normalize(); + _y.crossVectors(_z, _x); + + m[0] = _x.x; + m[1] = _x.y; + m[2] = _x.z; + m[4] = _y.x; + m[5] = _y.y; + m[6] = _y.z; + m[8] = _z.x; + m[9] = _z.y; + m[10] = _z.z; return this; }, @@ -1399,12 +1400,10 @@ var Matrix4 = new Class({ * @param {Phaser.Math.Vector3} center - Point the viewer is looking at * @param {Phaser.Math.Vector3} up - vec3 pointing up. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ lookAt: function (eye, center, up) { - var out = this.val; - var eyex = eye.x; var eyey = eye.y; var eyez = eye.z; @@ -1474,27 +1473,27 @@ var Matrix4 = new Class({ y2 *= len; } - out[0] = x0; - out[1] = y0; - out[2] = z0; - out[3] = 0; + return this.setValues( + x0, + y0, + z0, + 0, - out[4] = x1; - out[5] = y1; - out[6] = z1; - out[7] = 0; + x1, + y1, + z1, + 0, - out[8] = x2; - out[9] = y2; - out[10] = z2; - out[11] = 0; + x2, + y2, + z2, + 0, - out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); - out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); - out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); - out[15] = 1; - - return this; + -(x0 * eyex + x1 * eyey + x2 * eyez), + -(y0 * eyex + y1 * eyey + y2 * eyez), + -(z0 * eyex + z1 * eyey + z2 * eyez), + 1 + ); }, /** @@ -1507,7 +1506,7 @@ var Matrix4 = new Class({ * @param {number} pitch - The pitch value. * @param {number} roll - The roll value. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ yawPitchRoll: function (yaw, pitch, roll) { @@ -1570,7 +1569,7 @@ var Matrix4 = new Class({ * @param {Phaser.Math.Matrix4} [viewMatrix] - The view matrix. * @param {Phaser.Math.Matrix4} [projectionMatrix] - The projection matrix. * - * @return {Phaser.Math.Matrix4} This Matrix4. + * @return {this} This Matrix4. */ setWorldMatrix: function (rotation, position, scale, viewMatrix, projectionMatrix) { @@ -1582,22 +1581,207 @@ var Matrix4 = new Class({ this.multiplyLocal(_tempMat1); this.multiplyLocal(_tempMat2); - if (viewMatrix !== undefined) + if (viewMatrix) { this.multiplyLocal(viewMatrix); } - if (projectionMatrix !== undefined) + if (projectionMatrix) { this.multiplyLocal(projectionMatrix); } return this; + }, + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * + * @method Phaser.Math.Matrix4#multiplyToMat4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} src - The Matrix4 to multiply with this one. + * @param {Phaser.Math.Matrix4} out - The receiving Matrix. + * + * @return {Phaser.Math.Matrix4} This `out` Matrix4. + */ + multiplyToMat4: function (src, out) + { + var a = this.val; + var b = src.val; + + var a00 = a[0]; + var a01 = a[1]; + var a02 = a[2]; + var a03 = a[3]; + var a10 = a[4]; + var a11 = a[5]; + var a12 = a[6]; + var a13 = a[7]; + var a20 = a[8]; + var a21 = a[9]; + var a22 = a[10]; + var a23 = a[11]; + var a30 = a[12]; + var a31 = a[13]; + var a32 = a[14]; + var a33 = a[15]; + + var b00 = b[0]; + var b01 = b[1]; + var b02 = b[2]; + var b03 = b[3]; + var b10 = b[4]; + var b11 = b[5]; + var b12 = b[6]; + var b13 = b[7]; + var b20 = b[8]; + var b21 = b[9]; + var b22 = b[10]; + var b23 = b[11]; + var b30 = b[12]; + var b31 = b[13]; + var b32 = b[14]; + var b33 = b[15]; + + return out.setValues( + b00 * a00 + b01 * a10 + b02 * a20 + b03 * a30, + b01 * a01 + b01 * a11 + b02 * a21 + b03 * a31, + b02 * a02 + b01 * a12 + b02 * a22 + b03 * a32, + b03 * a03 + b01 * a13 + b02 * a23 + b03 * a33, + + b10 * a00 + b11 * a10 + b12 * a20 + b13 * a30, + b10 * a01 + b11 * a11 + b12 * a21 + b13 * a31, + b10 * a02 + b11 * a12 + b12 * a22 + b13 * a32, + b10 * a03 + b11 * a13 + b12 * a23 + b13 * a33, + + b20 * a00 + b21 * a10 + b22 * a20 + b23 * a30, + b20 * a01 + b21 * a11 + b22 * a21 + b23 * a31, + b20 * a02 + b21 * a12 + b22 * a22 + b23 * a32, + b20 * a03 + b21 * a13 + b22 * a23 + b23 * a33, + + b30 * a00 + b31 * a10 + b32 * a20 + b33 * a30, + b30 * a01 + b31 * a11 + b32 * a21 + b33 * a31, + b30 * a02 + b31 * a12 + b32 * a22 + b33 * a32, + b30 * a03 + b31 * a13 + b32 * a23 + b33 * a33 + ); + }, + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * + * @method Phaser.Math.Matrix4#fromRotationXYTranslation + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} rotation - The rotation vector. + * @param {Phaser.Math.Vector3} position - The position vector. + * @param {boolean} translateFirst - Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + * + * @return {this} This Matrix4. + */ + fromRotationXYTranslation: function (rotation, position, translateFirst) + { + var x = position.x; + var y = position.y; + var z = position.z; + + var sx = Math.sin(rotation.x); + var cx = Math.cos(rotation.x); + + var sy = Math.sin(rotation.y); + var cy = Math.cos(rotation.y); + + var a30 = x; + var a31 = y; + var a32 = z; + + // Rotate X + + var b21 = -sx; + + // Rotate Y + + var c01 = 0 - b21 * sy; + + var c02 = 0 - cx * sy; + + var c21 = b21 * cy; + + var c22 = cx * cy; + + // Translate + if (!translateFirst) + { + // a30 = cy * x + 0 * y + sy * z; + a30 = cy * x + sy * z; + a31 = c01 * x + cx * y + c21 * z; + a32 = c02 * x + sx * y + c22 * z; + } + + return this.setValues( + cy, + c01, + c02, + 0, + 0, + cx, + sx, + 0, + sy, + c21, + c22, + 0, + a30, + a31, + a32, + 1 + ); + }, + + /** + * Returns the maximum axis scale from this Matrix4. + * + * @method Phaser.Math.Matrix4#getMaxScaleOnAxis + * @since 3.50.0 + * + * @return {number} The maximum axis scale. + */ + getMaxScaleOnAxis: function () + { + var m = this.val; + + var scaleXSq = m[0] * m[0] + m[1] * m[1] + m[2] * m[2]; + var scaleYSq = m[4] * m[4] + m[5] * m[5] + m[6] * m[6]; + var scaleZSq = m[8] * m[8] + m[9] * m[9] + m[10] * m[10]; + + return Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq)); } }); +/** + * @ignore + */ var _tempMat1 = new Matrix4(); + +/** + * @ignore + */ var _tempMat2 = new Matrix4(); +/** + * @ignore + */ +var _x = new Vector3(); + +/** + * @ignore + */ +var _y = new Vector3(); + +/** + * @ignore + */ +var _z = new Vector3(); + module.exports = Matrix4; diff --git a/src/math/Quaternion.js b/src/math/Quaternion.js index e6ea20ce1..e1f35c74c 100644 --- a/src/math/Quaternion.js +++ b/src/math/Quaternion.js @@ -8,8 +8,9 @@ // and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl var Class = require('../utils/Class'); -var Vector3 = require('./Vector3'); var Matrix3 = require('./Matrix3'); +var NOOP = require('../utils/NOOP'); +var Vector3 = require('./Vector3'); var EPSILON = 0.000001; @@ -46,52 +47,141 @@ var Quaternion = new Class({ /** * The x component of this Quaternion. * - * @name Phaser.Math.Quaternion#x + * @name Phaser.Math.Quaternion#_x * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The y component of this Quaternion. * - * @name Phaser.Math.Quaternion#y + * @name Phaser.Math.Quaternion#_y * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The z component of this Quaternion. * - * @name Phaser.Math.Quaternion#z + * @name Phaser.Math.Quaternion#_z * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ /** * The w component of this Quaternion. * - * @name Phaser.Math.Quaternion#w + * @name Phaser.Math.Quaternion#_w * @type {number} * @default 0 - * @since 3.0.0 + * @private + * @since 3.50.0 */ - if (typeof x === 'object') + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + * + * @name Phaser.Math.Quaternion#onChangeCallback + * @type {function} + * @since 3.50.0 + */ + this.onChangeCallback = NOOP; + + this.set(x, y, z, w); + }, + + /** + * The x component of this Quaternion. + * + * @name Phaser.Math.Quaternion#x + * @type {number} + * @default 0 + * @since 3.0.0 + */ + x: { + get: function () { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 1; + return this._x; + }, + + set: function (value) + { + this._x = value; + + this.onChangeCallback(this); } - else + }, + + /** + * The y component of this Quaternion. + * + * @name Phaser.Math.Quaternion#y + * @type {number} + * @default 0 + * @since 3.0.0 + */ + y: { + get: function () { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 1; + return this._y; + }, + + set: function (value) + { + this._y = value; + + this.onChangeCallback(this); + } + }, + + /** + * The z component of this Quaternion. + * + * @name Phaser.Math.Quaternion#z + * @type {number} + * @default 0 + * @since 3.0.0 + */ + z: { + get: function () + { + return this._z; + }, + + set: function (value) + { + this._z = value; + + this.onChangeCallback(this); + } + }, + + /** + * The w component of this Quaternion. + * + * @name Phaser.Math.Quaternion#w + * @type {number} + * @default 0 + * @since 3.0.0 + */ + w: { + get: function () + { + return this._w; + }, + + set: function (value) + { + this._w = value; + + this.onChangeCallback(this); } }, @@ -107,16 +197,11 @@ var Quaternion = new Class({ */ copy: function (src) { - this.x = src.x; - this.y = src.y; - this.z = src.z; - this.w = src.w; - - return this; + return this.set(src); }, /** - * Set the components of this Quaternion. + * Set the components of this Quaternion and optionally call the `onChangeCallback`. * * @method Phaser.Math.Quaternion#set * @since 3.0.0 @@ -125,24 +210,32 @@ var Quaternion = new Class({ * @param {number} [y=0] - The y component. * @param {number} [z=0] - The z component. * @param {number} [w=0] - The w component. + * @param {boolean} [update=true] - Call the `onChangeCallback`? * * @return {Phaser.Math.Quaternion} This Quaternion. */ - set: function (x, y, z, w) + set: function (x, y, z, w, update) { + if (update === undefined) { update = true; } + if (typeof x === 'object') { - this.x = x.x || 0; - this.y = x.y || 0; - this.z = x.z || 0; - this.w = x.w || 0; + this._x = x.x || 0; + this._y = x.y || 0; + this._z = x.z || 0; + this._w = x.w || 0; } else { - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = w || 0; + this._x = x || 0; + this._y = y || 0; + this._z = z || 0; + this._w = w || 0; + } + + if (update) + { + this.onChangeCallback(this); } return this; @@ -160,10 +253,12 @@ var Quaternion = new Class({ */ add: function (v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; + this._x += v.x; + this._y += v.y; + this._z += v.z; + this._w += v.w; + + this.onChangeCallback(this); return this; }, @@ -180,10 +275,12 @@ var Quaternion = new Class({ */ subtract: function (v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; + this._x -= v.x; + this._y -= v.y; + this._z -= v.z; + this._w -= v.w; + + this.onChangeCallback(this); return this; }, @@ -200,10 +297,12 @@ var Quaternion = new Class({ */ scale: function (scale) { - this.x *= scale; - this.y *= scale; - this.z *= scale; - this.w *= scale; + this._x *= scale; + this._y *= scale; + this._z *= scale; + this._w *= scale; + + this.onChangeCallback(this); return this; }, @@ -264,12 +363,14 @@ var Quaternion = new Class({ { len = 1 / Math.sqrt(len); - this.x = x * len; - this.y = y * len; - this.z = z * len; - this.w = w * len; + this._x = x * len; + this._y = y * len; + this._z = z * len; + this._w = w * len; } + this.onChangeCallback(this); + return this; }, @@ -308,12 +409,12 @@ var Quaternion = new Class({ var az = this.z; var aw = this.w; - this.x = ax + t * (v.x - ax); - this.y = ay + t * (v.y - ay); - this.z = az + t * (v.z - az); - this.w = aw + t * (v.w - aw); - - return this; + return this.set( + ax + t * (v.x - ax), + ay + t * (v.y - ay), + az + t * (v.z - az), + aw + t * (v.w - aw) + ); }, /** @@ -345,21 +446,16 @@ var Quaternion = new Class({ } else if (dot > 0.999999) { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); } else { tmpvec.copy(a).cross(b); - this.x = tmpvec.x; - this.y = tmpvec.y; - this.z = tmpvec.z; - this.w = 1 + dot; + this._x = tmpvec.x; + this._y = tmpvec.y; + this._z = tmpvec.z; + this._w = 1 + dot; return this.normalize(); } @@ -406,12 +502,7 @@ var Quaternion = new Class({ */ identity: function () { - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - return this; + return this.set(0, 0, 0, 1); }, /** @@ -431,12 +522,12 @@ var Quaternion = new Class({ var s = Math.sin(rad); - this.x = s * axis.x; - this.y = s * axis.y; - this.z = s * axis.z; - this.w = Math.cos(rad); - - return this; + return this.set( + s * axis.x, + s * axis.y, + s * axis.z, + Math.cos(rad) + ); }, /** @@ -461,12 +552,12 @@ var Quaternion = new Class({ var bz = b.z; var bw = b.w; - this.x = ax * bw + aw * bx + ay * bz - az * by; - this.y = ay * bw + aw * by + az * bx - ax * bz; - this.z = az * bw + aw * bz + ax * by - ay * bx; - this.w = aw * bw - ax * bx - ay * by - az * bz; - - return this; + return this.set( + ax * bw + aw * bx + ay * bz - az * by, + ay * bw + aw * by + az * bx - ax * bz, + az * bw + aw * bz + ax * by - ay * bx, + aw * bw - ax * bx - ay * by - az * bz + ); }, /** @@ -524,12 +615,12 @@ var Quaternion = new Class({ } // calculate final values - this.x = scale0 * ax + scale1 * bx; - this.y = scale0 * ay + scale1 * by; - this.z = scale0 * az + scale1 * bz; - this.w = scale0 * aw + scale1 * bw; - - return this; + return this.set( + scale0 * ax + scale1 * bx, + scale0 * ay + scale1 * by, + scale0 * az + scale1 * bz, + scale0 * aw + scale1 * bw + ); }, /** @@ -550,14 +641,12 @@ var Quaternion = new Class({ var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = (dot) ? 1 / dot : 0; - // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 - - this.x = -a0 * invDot; - this.y = -a1 * invDot; - this.z = -a2 * invDot; - this.w = a3 * invDot; - - return this; + return this.set( + -a0 * invDot, + -a1 * invDot, + -a2 * invDot, + a3 * invDot + ); }, /** @@ -572,9 +661,11 @@ var Quaternion = new Class({ */ conjugate: function () { - this.x = -this.x; - this.y = -this.y; - this.z = -this.z; + this._x = -this.x; + this._y = -this.y; + this._z = -this.z; + + this.onChangeCallback(this); return this; }, @@ -601,12 +692,12 @@ var Quaternion = new Class({ var bx = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + aw * bx; - this.y = ay * bw + az * bx; - this.z = az * bw - ay * bx; - this.w = aw * bw - ax * bx; - - return this; + return this.set( + ax * bw + aw * bx, + ay * bw + az * bx, + az * bw - ay * bx, + aw * bw - ax * bx + ); }, /** @@ -631,12 +722,12 @@ var Quaternion = new Class({ var by = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw - az * by; - this.y = ay * bw + aw * by; - this.z = az * bw + ax * by; - this.w = aw * bw - ay * by; - - return this; + return this.set( + ax * bw - az * by, + ay * bw + aw * by, + az * bw + ax * by, + aw * bw - ay * by + ); }, /** @@ -661,12 +752,12 @@ var Quaternion = new Class({ var bz = Math.sin(rad); var bw = Math.cos(rad); - this.x = ax * bw + ay * bz; - this.y = ay * bw - ax * bz; - this.z = az * bw + aw * bz; - this.w = aw * bw - az * bz; - - return this; + return this.set( + ax * bw + ay * bz, + ay * bw - ax * bz, + az * bw + aw * bz, + aw * bw - az * bz + ); }, /** @@ -690,6 +781,190 @@ var Quaternion = new Class({ return this; }, + /** + * Set this Quaternion from the given Euler, based on Euler order. + * + * @method Phaser.Math.Quaternion#setFromEuler + * @since 3.50.0 + * + * @param {Phaser.Math.Euler} euler - The Euler to convert from. + * @param {boolean} [update=true] - Run the `onChangeCallback`? + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromEuler: function (euler, update) + { + var x = euler.x / 2; + var y = euler.y / 2; + var z = euler.z / 2; + + var c1 = Math.cos(x); + var c2 = Math.cos(y); + var c3 = Math.cos(z); + + var s1 = Math.sin(x); + var s2 = Math.sin(y); + var s3 = Math.sin(z); + + switch (euler.order) + { + case 'XYZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'YXZ': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'ZXY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'ZYX': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + + case 'YZX': + { + this.set( + s1 * c2 * c3 + c1 * s2 * s3, + c1 * s2 * c3 + s1 * c2 * s3, + c1 * c2 * s3 - s1 * s2 * c3, + c1 * c2 * c3 - s1 * s2 * s3, + update + ); + + break; + } + + case 'XZY': + { + this.set( + s1 * c2 * c3 - c1 * s2 * s3, + c1 * s2 * c3 - s1 * c2 * s3, + c1 * c2 * s3 + s1 * s2 * c3, + c1 * c2 * c3 + s1 * s2 * s3, + update + ); + + break; + } + } + + return this; + }, + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * + * @method Phaser.Math.Quaternion#setFromRotationMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to set the rotation from. + * + * @return {Phaser.Math.Quaternion} This Quaternion. + */ + setFromRotationMatrix: function (mat4) + { + var m = mat4.val; + + var m11 = m[0]; + var m12 = m[4]; + var m13 = m[8]; + var m21 = m[1]; + var m22 = m[5]; + var m23 = m[9]; + var m31 = m[2]; + var m32 = m[6]; + var m33 = m[10]; + + var trace = m11 + m22 + m33; + var s; + + if (trace > 0) + { + s = 0.5 / Math.sqrt(trace + 1.0); + + this.set( + (m32 - m23) * s, + (m13 - m31) * s, + (m21 - m12) * s, + 0.25 / s + ); + } + else if (m11 > m22 && m11 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33); + + this.set( + 0.25 * s, + (m12 + m21) / s, + (m13 + m31) / s, + (m32 - m23) / s + ); + } + else if (m22 > m33) + { + s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33); + + this.set( + (m12 + m21) / s, + 0.25 * s, + (m23 + m32) / s, + (m13 - m31) / s + ); + } + else + { + s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22); + + this.set( + (m13 + m31) / s, + (m23 + m32) / s, + 0.25 * s, + (m21 - m12) / s + ); + } + + return this; + }, + /** * Convert the given Matrix into this Quaternion. * @@ -721,9 +996,9 @@ var Quaternion = new Class({ fRoot = 0.5 / fRoot; // 1/(4w) - this.x = (m[7] - m[5]) * fRoot; - this.y = (m[2] - m[6]) * fRoot; - this.z = (m[3] - m[1]) * fRoot; + this._x = (m[7] - m[5]) * fRoot; + this._y = (m[2] - m[6]) * fRoot; + this._z = (m[3] - m[1]) * fRoot; } else { @@ -752,12 +1027,14 @@ var Quaternion = new Class({ tmp[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; tmp[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; - this.x = tmp[0]; - this.y = tmp[1]; - this.z = tmp[2]; - this.w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; + this._x = tmp[0]; + this._y = tmp[1]; + this._z = tmp[2]; + this._w = (m[k * 3 + j] - m[j * 3 + k]) * fRoot; } + this.onChangeCallback(this); + return this; } diff --git a/src/math/RadToDeg.js b/src/math/RadToDeg.js index 18674cd0b..8366badd8 100644 --- a/src/math/RadToDeg.js +++ b/src/math/RadToDeg.js @@ -14,7 +14,7 @@ var CONST = require('./const'); * * @param {number} radians - The angle in radians to convert ot degrees. * - * @return {integer} The given angle converted to degrees. + * @return {number} The given angle converted to degrees. */ var RadToDeg = function (radians) { diff --git a/src/math/RoundTo.js b/src/math/RoundTo.js index eff8f4a2f..239f0393c 100644 --- a/src/math/RoundTo.js +++ b/src/math/RoundTo.js @@ -28,8 +28,8 @@ * @since 3.0.0 * * @param {number} value - The value to round. - * @param {integer} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. - * @param {integer} [base=10] - The base to round in. Default is 10 for decimal. + * @param {number} [place=0] - The place to round to. Positive to round the units, negative to round the decimal. + * @param {number} [base=10] - The base to round in. Default is 10 for decimal. * * @return {number} The rounded value. */ diff --git a/src/math/ToXY.js b/src/math/ToXY.js index be5a67cca..c2ac5c74d 100644 --- a/src/math/ToXY.js +++ b/src/math/ToXY.js @@ -16,9 +16,9 @@ var Vector2 = require('./Vector2'); * @function Phaser.Math.ToXY * @since 3.19.0 * - * @param {integer} index - The position within the grid to get the x/y value for. - * @param {integer} width - The width of the grid. - * @param {integer} height - The height of the grid. + * @param {number} index - The position within the grid to get the x/y value for. + * @param {number} width - The width of the grid. + * @param {number} height - The height of the grid. * @param {Phaser.Math.Vector2} [out] - An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. * * @return {Phaser.Math.Vector2} A Vector2 where the x and y properties contain the given grid index. diff --git a/src/math/Vector3.js b/src/math/Vector3.js index f5ade4af9..446ef7cbd 100644 --- a/src/math/Vector3.js +++ b/src/math/Vector3.js @@ -93,6 +93,44 @@ var Vector3 = new Class({ return this; }, + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * + * @method Phaser.Math.Vector3#min + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the minimum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + min: function (v) + { + this.x = Math.min(this.x, v.x); + this.y = Math.min(this.y, v.y); + this.z = Math.min(this.z, v.z); + + return this; + }, + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * + * @method Phaser.Math.Vector3#max + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} v - The Vector3 to check the maximum values against. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + max: function (v) + { + this.x = Math.max(this.x, v.x); + this.y = Math.max(this.y, v.y); + this.z = Math.max(this.z, v.z); + + return this; + }, + /** * Make a clone of this Vector3. * @@ -106,6 +144,26 @@ var Vector3 = new Class({ return new Vector3(this.x, this.y, this.z); }, + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * + * @method Phaser.Math.Vector3#addVectors + * @since 3.50.0 + * + * @param {Phaser.Math.Vector3} a - The first Vector to add. + * @param {Phaser.Math.Vector3} b - The second Vector to add. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addVectors: function (a, b) + { + this.x = a.x + b.x; + this.y = a.y + b.y; + this.z = a.z + b.z; + + return this; + }, + /** * Calculate the cross (vector) product of two given Vectors. * @@ -199,6 +257,63 @@ var Vector3 = new Class({ return this; }, + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * + * @method Phaser.Math.Vector3#setFromMatrixPosition + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the position from. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixPosition: function (m) + { + return this.fromArray(m.val, 12); + }, + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * + * @method Phaser.Math.Vector3#setFromMatrixColumn + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to get the column from. + * @param {number} index - The column index. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + setFromMatrixColumn: function (mat4, index) + { + return this.fromArray(mat4.val, index * 4); + }, + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * + * @method Phaser.Math.Vector3#fromArray + * @since 3.50.0 + * + * @param {number[]} array - The array of values to get this Vector from. + * @param {number} [offset=0] - The offset index into the array. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + fromArray: function (array, offset) + { + if (offset === undefined) { offset = 0; } + + this.x = array[offset]; + this.y = array[offset + 1]; + this.z = array[offset + 2]; + + return this; + }, + /** * Add a given Vector to this Vector. Addition is component-wise. * @@ -218,6 +333,25 @@ var Vector3 = new Class({ return this; }, + /** + * Add the given value to each component of this Vector. + * + * @method Phaser.Math.Vector3#addScalar + * @since 3.50.0 + * + * @param {number} s - The amount to add to this Vector. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + addScalar: function (s) + { + this.x += s; + this.y += s; + this.z += s; + + return this; + }, + /** * Add and scale a given Vector to this Vector. Addition is component-wise. * @@ -514,6 +648,56 @@ var Vector3 = new Class({ return this; }, + /** + * Takes a Matrix3 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix3 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix3} mat3 - The Matrix3 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix3: function (mat3) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat3.val; + + this.x = m[0] * x + m[3] * y + m[6] * z; + this.y = m[1] * x + m[4] * y + m[7] * z; + this.z = m[2] * x + m[5] * y + m[8] * z; + + return this; + }, + + /** + * Takes a Matrix4 and applies it to this Vector3. + * + * @method Phaser.Math.Vector3#applyMatrix4 + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} mat4 - The Matrix4 to apply to this Vector3. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + applyMatrix4: function (mat4) + { + var x = this.x; + var y = this.y; + var z = this.z; + var m = mat4.val; + + var w = 1 / (m[3] * x + m[7] * y + m[11] * z + m[15]); + + this.x = (m[0] * x + m[4] * y + m[8] * z + m[12]) * w; + this.y = (m[1] * x + m[5] * y + m[9] * z + m[13]) * w; + this.z = (m[2] * x + m[6] * y + m[10] * z + m[14]) * w; + + return this; + }, + /** * Transform this Vector with the given Matrix. * @@ -539,7 +723,7 @@ var Vector3 = new Class({ }, /** - * Transform this Vector with the given Matrix. + * Transform this Vector with the given Matrix4. * * @method Phaser.Math.Vector3#transformMat4 * @since 3.0.0 @@ -670,6 +854,38 @@ var Vector3 = new Class({ return this; }, + /** + * Multiplies this Vector3 by the given view and projection matrices. + * + * @method Phaser.Math.Vector3#projectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} viewMatrix - A View Matrix. + * @param {Phaser.Math.Matrix4} projectionMatrix - A Projection Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + projectViewMatrix: function (viewMatrix, projectionMatrix) + { + return this.applyMatrix4(viewMatrix).applyMatrix4(projectionMatrix); + }, + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * + * @method Phaser.Math.Vector3#unprojectViewMatrix + * @since 3.50.0 + * + * @param {Phaser.Math.Matrix4} projectionMatrix - An inversed Projection Matrix. + * @param {Phaser.Math.Matrix4} worldMatrix - A World View Matrix. + * + * @return {Phaser.Math.Vector3} This Vector3. + */ + unprojectViewMatrix: function (projectionMatrix, worldMatrix) + { + return this.applyMatrix4(projectionMatrix).applyMatrix4(worldMatrix); + }, + /** * Unproject this point from 2D space to 3D space. * The point should have its x and y properties set to diff --git a/src/math/index.js b/src/math/index.js index 3c87cf098..a397287d5 100644 --- a/src/math/index.js +++ b/src/math/index.js @@ -34,6 +34,7 @@ var PhaserMath = { Clamp: require('./Clamp'), DegToRad: require('./DegToRad'), Difference: require('./Difference'), + Euler: require('./Euler'), Factorial: require('./Factorial'), FloatBetween: require('./FloatBetween'), FloorTo: require('./FloorTo'), diff --git a/src/math/pow2/GetPowerOfTwo.js b/src/math/pow2/GetPowerOfTwo.js index 5d581d7cc..0ca58a972 100644 --- a/src/math/pow2/GetPowerOfTwo.js +++ b/src/math/pow2/GetPowerOfTwo.js @@ -12,7 +12,7 @@ * * @param {number} value - The value. * - * @return {integer} The nearest power of 2 to `value`. + * @return {number} The nearest power of 2 to `value`. */ var GetPowerOfTwo = function (value) { diff --git a/src/phaser-core.js b/src/phaser-core.js index 45d9a006b..5d22bc574 100644 --- a/src/phaser-core.js +++ b/src/phaser-core.js @@ -42,17 +42,20 @@ var Phaser = { GameObject: require('./gameobjects/GameObject'), Graphics: require('./gameobjects/graphics/Graphics.js'), Image: require('./gameobjects/image/Image'), + Layer: require('./gameobjects/layer/Layer'), Sprite: require('./gameobjects/sprite/Sprite'), Text: require('./gameobjects/text/static/Text'), Factories: { Graphics: require('./gameobjects/graphics/GraphicsFactory'), Image: require('./gameobjects/image/ImageFactory'), + Layer: require('./gameobjects/layer/LayerFactory'), Sprite: require('./gameobjects/sprite/SpriteFactory'), Text: require('./gameobjects/text/static/TextFactory') }, Creators: { Graphics: require('./gameobjects/graphics/GraphicsCreator'), Image: require('./gameobjects/image/ImageCreator'), + Layer: require('./gameobjects/layer/LayerCreator'), Sprite: require('./gameobjects/sprite/SpriteCreator'), Text: require('./gameobjects/text/static/TextCreator') } diff --git a/src/phaser.js b/src/phaser.js index aaa05326b..33b08de2c 100644 --- a/src/phaser.js +++ b/src/phaser.js @@ -50,7 +50,7 @@ var Phaser = { }; -// Merge in the optional plugins +// Merge in the optional plugins and WebGL only features if (typeof FEATURE_SOUND) { diff --git a/src/physics/arcade/ArcadeImage.js b/src/physics/arcade/ArcadeImage.js index ec7d85cf6..d5c2a29a9 100644 --- a/src/physics/arcade/ArcadeImage.js +++ b/src/physics/arcade/ArcadeImage.js @@ -52,7 +52,7 @@ var Image = require('../../gameobjects/image/Image'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeImage = new Class({ diff --git a/src/physics/arcade/ArcadeSprite.js b/src/physics/arcade/ArcadeSprite.js index 6b9e39e4b..b6055d7d1 100644 --- a/src/physics/arcade/ArcadeSprite.js +++ b/src/physics/arcade/ArcadeSprite.js @@ -53,7 +53,7 @@ var Sprite = require('../../gameobjects/sprite/Sprite'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. */ var ArcadeSprite = new Class({ diff --git a/src/physics/arcade/Body.js b/src/physics/arcade/Body.js index d5126409d..747eb6706 100644 --- a/src/physics/arcade/Body.js +++ b/src/physics/arcade/Body.js @@ -93,7 +93,7 @@ var Body = new Class({ * The color of this Body on the debug display. * * @name Phaser.Physics.Arcade.Body#debugBodyColor - * @type {integer} + * @type {number} * @since 3.0.0 */ this.debugBodyColor = world.defaults.bodyDebugColor; @@ -335,10 +335,11 @@ var Body = new Class({ /** * When `useDamping` is false (the default), this is absolute loss of velocity due to movement, in pixels per second squared. * - * When `useDamping` is true, this is 1 minus the damping factor. + * When `useDamping` is true, this is a damping multiplier between 0 and 1. + * A value of 0 means the Body stops instantly. + * A value of 0.01 mean the Body loses 99% of its velocity per second. + * A value of 0.1 means the Body loses 90% of its velocity per second. * A value of 1 means the Body loses no velocity. - * A value of 0.95 means the Body loses 5% of its velocity per step. - * A value of 0.5 means the Body loses 50% of its velocity per step. * * The x and y components are applied separately. * @@ -486,8 +487,8 @@ var Body = new Class({ * by using damping, avoiding the axis-drift that is prone with linear deceleration. * * If you enable this property then you should use far smaller `drag` values than with linear, as - * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow - * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * they are used as a multiplier on the velocity. Values such as 0.05 will give a nice slow + * deceleration. * * @name Phaser.Physics.Arcade.Body#useDamping * @type {boolean} @@ -575,7 +576,7 @@ var Body = new Class({ * If the Body is moving on both axes, this describes motion on the vertical axis only. * * @name Phaser.Physics.Arcade.Body#facing - * @type {integer} + * @type {number} * @since 3.0.0 * * @see Phaser.Physics.Arcade.FACING_UP @@ -758,7 +759,7 @@ var Body = new Class({ * The Body's physics type (dynamic or static). * * @name Phaser.Physics.Arcade.Body#physicsType - * @type {integer} + * @type {number} * @readonly * @default Phaser.Physics.Arcade.DYNAMIC_BODY * @since 3.0.0 @@ -1231,6 +1232,7 @@ var Body = new Class({ if (wasSet) { this.blocked.none = false; + this.updateCenter(); } return wasSet; @@ -1238,6 +1240,7 @@ var Body = new Class({ /** * Sets the offset of the Body's position from its Game Object's position. + * The Body's `position` isn't changed until the next `preUpdate`. * * @method Phaser.Physics.Arcade.Body#setOffset * @since 3.0.0 @@ -1252,7 +1255,6 @@ var Body = new Class({ if (y === undefined) { y = x; } this.offset.set(x, y); - this.updateCenter(); return this; }, @@ -1265,8 +1267,8 @@ var Body = new Class({ * @method Phaser.Physics.Arcade.Body#setSize * @since 3.0.0 * - * @param {integer} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. - * @param {integer} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {number} [width] - The width of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {number} [height] - The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param {boolean} [center=true] - Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. * * @return {Phaser.Physics.Arcade.Body} This Body object. @@ -1356,14 +1358,14 @@ var Body = new Class({ }, /** - * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * Sets this Body's parent Game Object to the given coordinates and resets this Body at the new coordinates. * If the Body had any velocity or acceleration it is lost as a result of calling this. * * @method Phaser.Physics.Arcade.Body#reset * @since 3.0.0 * - * @param {number} x - The horizontal position to place the Game Object and Body. - * @param {number} y - The vertical position to place the Game Object and Body. + * @param {number} x - The horizontal position to place the Game Object. + * @param {number} y - The vertical position to place the Game Object. */ reset: function (x, y) { @@ -2071,6 +2073,31 @@ var Body = new Class({ return this; }, + /** + * If this Body is using `drag` for deceleration this property controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * + * @method Phaser.Physics.Arcade.Body#setDamping + * @since 3.50.0 + * + * @param {boolean} value - `true` to use damping, or `false` to use drag. + * + * @return {Phaser.Physics.Arcade.Body} This Body object. + */ + setDamping: function (value) + { + this.useDamping = value; + + return this; + }, + /** * Sets the Body's horizontal drag. * @@ -2316,7 +2343,79 @@ var Body = new Class({ }, /** - * The Body's horizontal position (left edge). + * This is an internal handler, called by the `ProcessX` function as part + * of the collision step. You should almost never call this directly. + * + * @method Phaser.Physics.Arcade.Body#processX + * @since 3.50.0 + * + * @param {number} x - The amount to add to the Body position. + * @param {number} [vx] - The amount to add to the Body velocity. + * @param {boolean} [left] - Set the blocked.left value? + * @param {boolean} [right] - Set the blocked.right value? + */ + processX: function (x, vx, left, right) + { + this.x += x; + + this.updateCenter(); + + if (vx !== null) + { + this.velocity.x = vx; + } + + var blocked = this.blocked; + + if (left) + { + blocked.left = true; + } + + if (right) + { + blocked.right = true; + } + }, + + /** + * This is an internal handler, called by the `ProcessY` function as part + * of the collision step. You should almost never call this directly. + * + * @method Phaser.Physics.Arcade.Body#processY + * @since 3.50.0 + * + * @param {number} y - The amount to add to the Body position. + * @param {number} [vy] - The amount to add to the Body velocity. + * @param {boolean} [up] - Set the blocked.up value? + * @param {boolean} [down] - Set the blocked.down value? + */ + processY: function (y, vy, up, down) + { + this.y += y; + + this.updateCenter(); + + if (vy !== null) + { + this.velocity.y = vy; + } + + var blocked = this.blocked; + + if (up) + { + blocked.up = true; + } + + if (down) + { + blocked.down = true; + } + }, + + /** + * The Bodys horizontal position (left edge). * * @name Phaser.Physics.Arcade.Body#x * @type {number} @@ -2337,7 +2436,7 @@ var Body = new Class({ }, /** - * The Body's vertical position (top edge). + * The Bodys vertical position (top edge). * * @name Phaser.Physics.Arcade.Body#y * @type {number} diff --git a/src/physics/arcade/Collider.js b/src/physics/arcade/Collider.js index 87cca7b84..f66d576db 100644 --- a/src/physics/arcade/Collider.js +++ b/src/physics/arcade/Collider.js @@ -115,7 +115,7 @@ var Collider = new Class({ /** * A name for the Collider. - * + * * Phaser does not use this value, it's for your own reference. * * @method Phaser.Physics.Arcade.Collider#setName diff --git a/src/physics/arcade/Factory.js b/src/physics/arcade/Factory.js index 76257e457..636cee0ed 100644 --- a/src/physics/arcade/Factory.js +++ b/src/physics/arcade/Factory.js @@ -126,7 +126,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithStaticBody} The Image object that was created. */ @@ -150,7 +150,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.ImageWithDynamicBody} The Image object that was created. */ @@ -174,7 +174,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.SpriteWithStaticBody} The Sprite object that was created. */ @@ -199,7 +199,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * * @return {Phaser.Types.Physics.Arcade.SpriteWithDynamicBody} The Sprite object that was created. */ diff --git a/src/physics/arcade/PhysicsGroup.js b/src/physics/arcade/PhysicsGroup.js index e7eadd228..f1af33efa 100644 --- a/src/physics/arcade/PhysicsGroup.js +++ b/src/physics/arcade/PhysicsGroup.js @@ -113,7 +113,7 @@ var PhysicsGroup = new Class({ * The physics type of the Group's members. * * @name Phaser.Physics.Arcade.Group#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.DYNAMIC_BODY * @since 3.0.0 */ diff --git a/src/physics/arcade/ProcessX.js b/src/physics/arcade/ProcessX.js new file mode 100644 index 000000000..b8496858e --- /dev/null +++ b/src/physics/arcade/ProcessX.js @@ -0,0 +1,411 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var body1; +var body2; +var body1Pushable; +var body2Pushable; +var body1MassImpact; +var body2MassImpact; +var body1FullImpact; +var body2FullImpact; +var body1MovingLeft; +var body1MovingRight; +var body1Stationary; +var body2MovingLeft; +var body2MovingRight; +var body2Stationary; +var body1OnLeft; +var body2OnLeft; +var overlap; + +/** + * Sets all of the local processing values and calculates the velocity exchanges. + * + * Then runs `BlockCheck` and returns the value from it. + * + * This method is called by `Phaser.Physics.Arcade.SeparateX` and should not be + * called directly. + * + * @function Phaser.Physics.Arcade.ProcessX.Set + * @ignore + * @since 3.50.0 + * + * @param {Phaser.Physics.Arcade.Body} b1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} b2 - The second Body to separate. + * @param {number} ov - The overlap value. + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var Set = function (b1, b2, ov) +{ + body1 = b1; + body2 = b2; + + var v1 = body1.velocity.x; + var v2 = body2.velocity.x; + + body1Pushable = body1.pushable; + body1MovingLeft = body1._dx < 0; + body1MovingRight = body1._dx > 0; + body1Stationary = body1._dx === 0; + body1OnLeft = Math.abs(body1.right - body2.x) <= Math.abs(body2.right - body1.x); + body1FullImpact = v2 - v1 * body1.bounce.x; + + body2Pushable = body2.pushable; + body2MovingLeft = body2._dx < 0; + body2MovingRight = body2._dx > 0; + body2Stationary = body2._dx === 0; + body2OnLeft = !body1OnLeft; + body2FullImpact = v1 - v2 * body2.bounce.x; + + // negative delta = up, positive delta = down (inc. gravity) + overlap = Math.abs(ov); + + return BlockCheck(); +}; + +/** + * Blocked Direction checks, because it doesn't matter if an object can be pushed + * or not, blocked is blocked. + * + * @function Phaser.Physics.Arcade.ProcessX.BlockCheck + * @ignore + * @since 3.50.0 + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var BlockCheck = function () +{ + // Body1 is moving right and Body2 is blocked from going right any further + if (body1MovingRight && body1OnLeft && body2.blocked.right) + { + body1.processX(-overlap, body1FullImpact, false, true); + + return 1; + } + + // Body1 is moving up and Body2 is blocked from going up any further + if (body1MovingLeft && body2OnLeft && body2.blocked.left) + { + body1.processX(overlap, body1FullImpact, true); + + return 1; + } + + // Body2 is moving right and Body1 is blocked from going right any further + if (body2MovingRight && body2OnLeft && body1.blocked.right) + { + body2.processX(-overlap, body2FullImpact, false, true); + + return 2; + } + + // Body2 is moving up and Body1 is blocked from going up any further + if (body2MovingLeft && body1OnLeft && body1.blocked.left) + { + body2.processX(overlap, body2FullImpact, true); + + return 2; + } + + return 0; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessX.Check + * @ignore + * @since 3.50.0 + * + * @return {boolean} `true` if a check passed, otherwise `false`. + */ +var Check = function () +{ + var v1 = body1.velocity.x; + var v2 = body2.velocity.x; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1MassImpact = avg + nv1 * body1.bounce.x; + body2MassImpact = avg + nv2 * body2.bounce.x; + + // Body1 hits Body2 on the right hand side + if (body1MovingLeft && body2OnLeft) + { + return Run(0); + } + + // Body2 hits Body1 on the right hand side + if (body2MovingLeft && body1OnLeft) + { + return Run(1); + } + + // Body1 hits Body2 on the left hand side + if (body1MovingRight && body1OnLeft) + { + return Run(2); + } + + // Body2 hits Body1 on the left hand side + if (body2MovingRight && body2OnLeft) + { + return Run(3); + } + + return false; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessX.Run + * @ignore + * @since 3.50.0 + * + * @param {number} side - The side to test. As passed in by the `Check` function. + * + * @return {boolean} Always returns `true`. + */ +var Run = function (side) +{ + if (body1Pushable && body2Pushable) + { + // Both pushable, or both moving at the same time, so equal rebound + overlap *= 0.5; + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body1.processX(overlap, body1MassImpact); + body2.processX(-overlap, body2MassImpact); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body1.processX(-overlap, body1MassImpact); + body2.processX(overlap, body2MassImpact); + } + } + else if (body1Pushable && !body2Pushable) + { + // Body1 pushable, Body2 not + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body1.processX(overlap, body1FullImpact, true); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body1.processX(-overlap, body1FullImpact, false, true); + } + } + else if (!body1Pushable && body2Pushable) + { + // Body2 pushable, Body1 not + + if (side === 0 || side === 3) + { + // body1MovingLeft && body2OnLeft + // body2MovingRight && body2OnLeft + body2.processX(-overlap, body2FullImpact, false, true); + } + else + { + // body2MovingLeft && body1OnLeft + // body1MovingRight && body1OnLeft + body2.processX(overlap, body2FullImpact, true); + } + } + else + { + // Neither body is pushable, so base it on movement + + var halfOverlap = overlap * 0.5; + + if (side === 0) + { + // body1MovingLeft && body2OnLeft + + if (body2Stationary) + { + body1.processX(overlap, 0, true); + body2.processX(0, null, false, true); + } + else if (body2MovingRight) + { + body1.processX(halfOverlap, 0, true); + body2.processX(-halfOverlap, 0, false, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processX(halfOverlap, body2.velocity.x, true); + body2.processX(-halfOverlap, null, false, true); + } + } + else if (side === 1) + { + // body2MovingLeft && body1OnLeft + + if (body1Stationary) + { + body1.processX(0, null, false, true); + body2.processX(overlap, 0, true); + } + else if (body1MovingRight) + { + body1.processX(-halfOverlap, 0, false, true); + body2.processX(halfOverlap, 0, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processX(-halfOverlap, null, false, true); + body2.processX(halfOverlap, body1.velocity.x, true); + } + } + else if (side === 2) + { + // body1MovingRight && body1OnLeft + + if (body2Stationary) + { + body1.processX(-overlap, 0, false, true); + body2.processX(0, null, true); + } + else if (body2MovingLeft) + { + body1.processX(-halfOverlap, 0, false, true); + body2.processX(halfOverlap, 0, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processX(-halfOverlap, body2.velocity.x, false, true); + body2.processX(halfOverlap, null, true); + } + } + else if (side === 3) + { + // body2MovingRight && body2OnLeft + + if (body1Stationary) + { + body1.processX(0, null, true); + body2.processX(-overlap, 0, false, true); + } + else if (body1MovingLeft) + { + body1.processX(halfOverlap, 0, true); + body2.processX(-halfOverlap, 0, false, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processX(halfOverlap, body2.velocity.y, true); + body2.processX(-halfOverlap, null, false, true); + } + } + } + + return true; +}; + +/** + * This function is run when Body1 is Immovable and Body2 is not. + * + * @function Phaser.Physics.Arcade.ProcessX.RunImmovableBody1 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody1 = function (blockedState) +{ + if (blockedState === 1) + { + // But Body2 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body2.velocity.x = 0; + } + else if (body1OnLeft) + { + body2.processX(overlap, body2FullImpact, true); + } + else + { + body2.processX(-overlap, body2FullImpact, false, true); + } + + // This is special case code that handles things like vertically moving platforms you can ride + if (body1.moves) + { + body2.y += (body1.y - body1.prev.y) * body1.friction.y; + body2._dy = body2.y - body2.prev.y; + } +}; + +/** + * This function is run when Body2 is Immovable and Body1 is not. + * + * @function Phaser.Physics.Arcade.ProcessX.RunImmovableBody2 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody2 = function (blockedState) +{ + if (blockedState === 2) + { + // But Body1 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body1.velocity.x = 0; + } + if (body2OnLeft) + { + body1.processX(overlap, body1FullImpact, true); + } + else + { + body1.processX(-overlap, body1FullImpact, false, true); + } + + // This is special case code that handles things like vertically moving platforms you can ride + if (body2.moves) + { + body1.y += (body2.y - body2.prev.y) * body2.friction.y; + body1._dy = body1.y - body1.prev.y; + } +}; + +/** + * @namespace Phaser.Physics.Arcade.ProcessX + * @ignore + */ + +module.exports = { + BlockCheck: BlockCheck, + Check: Check, + Set: Set, + Run: Run, + RunImmovableBody1: RunImmovableBody1, + RunImmovableBody2: RunImmovableBody2 +}; diff --git a/src/physics/arcade/ProcessY.js b/src/physics/arcade/ProcessY.js new file mode 100644 index 000000000..bcce7d878 --- /dev/null +++ b/src/physics/arcade/ProcessY.js @@ -0,0 +1,411 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var body1; +var body2; +var body1Pushable; +var body2Pushable; +var body1MassImpact; +var body2MassImpact; +var body1FullImpact; +var body2FullImpact; +var body1MovingUp; +var body1MovingDown; +var body1Stationary; +var body2MovingUp; +var body2MovingDown; +var body2Stationary; +var body1OnTop; +var body2OnTop; +var overlap; + +/** + * Sets all of the local processing values and calculates the velocity exchanges. + * + * Then runs `BlockCheck` and returns the value from it. + * + * This method is called by `Phaser.Physics.Arcade.SeparateY` and should not be + * called directly. + * + * @function Phaser.Physics.Arcade.ProcessY.Set + * @ignore + * @since 3.50.0 + * + * @param {Phaser.Physics.Arcade.Body} b1 - The first Body to separate. + * @param {Phaser.Physics.Arcade.Body} b2 - The second Body to separate. + * @param {number} ov - The overlap value. + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var Set = function (b1, b2, ov) +{ + body1 = b1; + body2 = b2; + + var v1 = body1.velocity.y; + var v2 = body2.velocity.y; + + body1Pushable = body1.pushable; + body1MovingUp = body1._dy < 0; + body1MovingDown = body1._dy > 0; + body1Stationary = body1._dy === 0; + body1OnTop = Math.abs(body1.bottom - body2.y) <= Math.abs(body2.bottom - body1.y); + body1FullImpact = v2 - v1 * body1.bounce.y; + + body2Pushable = body2.pushable; + body2MovingUp = body2._dy < 0; + body2MovingDown = body2._dy > 0; + body2Stationary = body2._dy === 0; + body2OnTop = !body1OnTop; + body2FullImpact = v1 - v2 * body2.bounce.y; + + // negative delta = up, positive delta = down (inc. gravity) + overlap = Math.abs(ov); + + return BlockCheck(); +}; + +/** + * Blocked Direction checks, because it doesn't matter if an object can be pushed + * or not, blocked is blocked. + * + * @function Phaser.Physics.Arcade.ProcessY.BlockCheck + * @ignore + * @since 3.50.0 + * + * @return {number} The BlockCheck result. 0 = not blocked. 1 = Body 1 blocked. 2 = Body 2 blocked. + */ +var BlockCheck = function () +{ + // Body1 is moving down and Body2 is blocked from going down any further + if (body1MovingDown && body1OnTop && body2.blocked.down) + { + body1.processY(-overlap, body1FullImpact, false, true); + + return 1; + } + + // Body1 is moving up and Body2 is blocked from going up any further + if (body1MovingUp && body2OnTop && body2.blocked.up) + { + body1.processY(overlap, body1FullImpact, true); + + return 1; + } + + // Body2 is moving down and Body1 is blocked from going down any further + if (body2MovingDown && body2OnTop && body1.blocked.down) + { + body2.processY(-overlap, body2FullImpact, false, true); + + return 2; + } + + // Body2 is moving up and Body1 is blocked from going up any further + if (body2MovingUp && body1OnTop && body1.blocked.up) + { + body2.processY(overlap, body2FullImpact, true); + + return 2; + } + + return 0; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessY.Check + * @ignore + * @since 3.50.0 + * + * @return {boolean} `true` if a check passed, otherwise `false`. + */ +var Check = function () +{ + var v1 = body1.velocity.y; + var v2 = body2.velocity.y; + + var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); + var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); + var avg = (nv1 + nv2) * 0.5; + + nv1 -= avg; + nv2 -= avg; + + body1MassImpact = avg + nv1 * body1.bounce.y; + body2MassImpact = avg + nv2 * body2.bounce.y; + + // Body1 hits Body2 on the bottom side + if (body1MovingUp && body2OnTop) + { + return Run(0); + } + + // Body2 hits Body1 on the bottom side + if (body2MovingUp && body1OnTop) + { + return Run(1); + } + + // Body1 hits Body2 on the top side + if (body1MovingDown && body1OnTop) + { + return Run(2); + } + + // Body2 hits Body1 on the top side + if (body2MovingDown && body2OnTop) + { + return Run(3); + } + + return false; +}; + +/** + * The main check function. Runs through one of the four possible tests and returns the results. + * + * @function Phaser.Physics.Arcade.ProcessY.Run + * @ignore + * @since 3.50.0 + * + * @param {number} side - The side to test. As passed in by the `Check` function. + * + * @return {boolean} Always returns `true`. + */ +var Run = function (side) +{ + if (body1Pushable && body2Pushable) + { + // Both pushable, or both moving at the same time, so equal rebound + overlap *= 0.5; + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body1.processY(overlap, body1MassImpact); + body2.processY(-overlap, body2MassImpact); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body1.processY(-overlap, body1MassImpact); + body2.processY(overlap, body2MassImpact); + } + } + else if (body1Pushable && !body2Pushable) + { + // Body1 pushable, Body2 not + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body1.processY(overlap, body1FullImpact, true); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body1.processY(-overlap, body1FullImpact, false, true); + } + } + else if (!body1Pushable && body2Pushable) + { + // Body2 pushable, Body1 not + + if (side === 0 || side === 3) + { + // body1MovingUp && body2OnTop + // body2MovingDown && body2OnTop + body2.processY(-overlap, body2FullImpact, false, true); + } + else + { + // body2MovingUp && body1OnTop + // body1MovingDown && body1OnTop + body2.processY(overlap, body2FullImpact, true); + } + } + else + { + // Neither body is pushable, so base it on movement + + var halfOverlap = overlap * 0.5; + + if (side === 0) + { + // body1MovingUp && body2OnTop + + if (body2Stationary) + { + body1.processY(overlap, 0, true); + body2.processY(0, null, false, true); + } + else if (body2MovingDown) + { + body1.processY(halfOverlap, 0, true); + body2.processY(-halfOverlap, 0, false, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processY(halfOverlap, body2.velocity.y, true); + body2.processY(-halfOverlap, null, false, true); + } + } + else if (side === 1) + { + // body2MovingUp && body1OnTop + + if (body1Stationary) + { + body1.processY(0, null, false, true); + body2.processY(overlap, 0, true); + } + else if (body1MovingDown) + { + body1.processY(-halfOverlap, 0, false, true); + body2.processY(halfOverlap, 0, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processY(-halfOverlap, null, false, true); + body2.processY(halfOverlap, body1.velocity.y, true); + } + } + else if (side === 2) + { + // body1MovingDown && body1OnTop + + if (body2Stationary) + { + body1.processY(-overlap, 0, false, true); + body2.processY(0, null, true); + } + else if (body2MovingUp) + { + body1.processY(-halfOverlap, 0, false, true); + body2.processY(halfOverlap, 0, true); + } + else + { + // Body2 moving same direction as Body1 + body1.processY(-halfOverlap, body2.velocity.y, false, true); + body2.processY(halfOverlap, null, true); + } + } + else if (side === 3) + { + // body2MovingDown && body2OnTop + + if (body1Stationary) + { + body1.processY(0, null, true); + body2.processY(-overlap, 0, false, true); + } + else if (body1MovingUp) + { + body1.processY(halfOverlap, 0, true); + body2.processY(-halfOverlap, 0, false, true); + } + else + { + // Body1 moving same direction as Body2 + body1.processY(halfOverlap, body2.velocity.y, true); + body2.processY(-halfOverlap, null, false, true); + } + } + } + + return true; +}; + +/** + * This function is run when Body1 is Immovable and Body2 is not. + * + * @function Phaser.Physics.Arcade.ProcessY.RunImmovableBody1 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody1 = function (blockedState) +{ + if (blockedState === 1) + { + // But Body2 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body2.velocity.y = 0; + } + else if (body1OnTop) + { + body2.processY(overlap, body2FullImpact, true); + } + else + { + body2.processY(-overlap, body2FullImpact, false, true); + } + + // This is special case code that handles things like horizontally moving platforms you can ride + if (body1.moves) + { + body2.x += (body1.x - body1.prev.x) * body1.friction.x; + body2._dx = body2.x - body2.prev.x; + } +}; + +/** + * This function is run when Body2 is Immovable and Body1 is not. + * + * @function Phaser.Physics.Arcade.ProcessY.RunImmovableBody2 + * @ignore + * @since 3.50.0 + * + * @param {number} blockedState - The block state value. + */ +var RunImmovableBody2 = function (blockedState) +{ + if (blockedState === 2) + { + // But Body1 cannot go anywhere either, so we cancel out velocity + // Separation happened in the block check + body1.velocity.y = 0; + } + else if (body2OnTop) + { + body1.processY(overlap, body1FullImpact, true); + } + else + { + body1.processY(-overlap, body1FullImpact, false, true); + } + + // This is special case code that handles things like horizontally moving platforms you can ride + if (body2.moves) + { + body1.x += (body2.x - body2.prev.x) * body2.friction.x; + body1._dx = body1.x - body1.prev.x; + } +}; + +/** + * @namespace Phaser.Physics.Arcade.ProcessY + * @ignore + */ + +module.exports = { + BlockCheck: BlockCheck, + Check: Check, + Set: Set, + Run: Run, + RunImmovableBody1: RunImmovableBody1, + RunImmovableBody2: RunImmovableBody2 +}; diff --git a/src/physics/arcade/SeparateX.js b/src/physics/arcade/SeparateX.js index 8226b907e..7c93016f3 100644 --- a/src/physics/arcade/SeparateX.js +++ b/src/physics/arcade/SeparateX.js @@ -5,6 +5,7 @@ */ var GetOverlapX = require('./GetOverlapX'); +var ProcessX = require('./ProcessX'); /** * Separates two overlapping bodies on the X-axis (horizontally). @@ -21,14 +22,12 @@ var GetOverlapX = require('./GetOverlapX'); * @param {boolean} overlapOnly - If `true`, the bodies will only have their overlap data set and no separation will take place. * @param {number} bias - A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. * - * @return {boolean} `true` if the two bodies overlap horizontally, otherwise `false`. + * @return {boolean} `true` if the two bodies overlap vertically, otherwise `false`. */ var SeparateX = function (body1, body2, overlapOnly, bias) { var overlap = GetOverlapX(body1, body2, overlapOnly, bias); - var body1Pushable = body1.pushable; - var body2Pushable = body2.pushable; var body1Immovable = body1.immovable; var body2Immovable = body2.immovable; @@ -39,89 +38,24 @@ var SeparateX = function (body1, body2, overlapOnly, bias) return (overlap !== 0) || (body1.embedded && body2.embedded); } - // Adjust their positions and velocities accordingly (if there was any overlap) - var v1 = body1.velocity.x; - var v2 = body2.velocity.x; + var blockedState = ProcessX.Set(body1, body2, overlap); if (!body1Immovable && !body2Immovable) { - if (body1Pushable === body2Pushable) + if (blockedState > 0) { - // Both equally pushable (true/false doesn't matter) - overlap *= 0.5; - - body1.x -= overlap; - body2.x += overlap; - } - else if (body1Pushable && !body2Pushable) - { - // Only body1 is pushable - body1.x -= overlap; - } - else if (body2Pushable && !body1Pushable) - { - // Only body2 is pushable - body2.x += overlap; - } - } - else if (!body1Immovable) - { - // Body2 is immovable, so 1 gets all the separation no matter what - body1.x -= overlap; - - body1.velocity.x = v2 - v1 * body1.bounce.x; - - // This is special case code that handles things like vertically moving platforms you can ride - if (body2.moves) - { - body1.y += (body2.y - body2.prev.y) * body2.friction.y; - body1._dy = body1.y - body1.prev.y; + return true; } - return true; + return ProcessX.Check(); } - else if (!body2Immovable) + else if (body1Immovable) { - // Body1 is immovable, so 2 gets all the separation no matter what - body2.x += overlap; - - body2.velocity.x = v1 - v2 * body2.bounce.x; - - // This is special case code that handles things like vertically moving platforms you can ride - if (body1.moves) - { - body2.y += (body1.y - body1.prev.y) * body1.friction.y; - body2._dy = body2.y - body2.prev.y; - } - - return true; + ProcessX.RunImmovableBody1(blockedState); } - - // Separation is over and we've 2 movable bodies, so now calculate velocity - - if (body1._dx > body2._dx && (body2.blocked.right || !body2Pushable)) + else if (body2Immovable) { - // Body1 is moving right and Body2 is blocked from going right any further, or isn't pushable - body1.velocity.x = v2 - v1 * body1.bounce.x; - } - else if (body1._dx < body2._dx && (body2.blocked.left || !body2Pushable)) - { - // Body1 is moving left and Body2 is blocked from going left any further, or isn't pushable - body1.velocity.x = v2 - v1 * body1.bounce.x; - } - else - { - // If neither body is pushable, or are both pushable, they should both rebound equally - - var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); - var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); - var avg = (nv1 + nv2) * 0.5; - - nv1 -= avg; - nv2 -= avg; - - body1.velocity.x = avg + nv1 * body1.bounce.x; - body2.velocity.x = avg + nv2 * body2.bounce.x; + ProcessX.RunImmovableBody2(blockedState); } // If we got this far then there WAS overlap, and separation is complete, so return true diff --git a/src/physics/arcade/SeparateY.js b/src/physics/arcade/SeparateY.js index 357906d6e..56f0256aa 100644 --- a/src/physics/arcade/SeparateY.js +++ b/src/physics/arcade/SeparateY.js @@ -5,6 +5,7 @@ */ var GetOverlapY = require('./GetOverlapY'); +var ProcessY = require('./ProcessY'); /** * Separates two overlapping bodies on the Y-axis (vertically). @@ -27,8 +28,6 @@ var SeparateY = function (body1, body2, overlapOnly, bias) { var overlap = GetOverlapY(body1, body2, overlapOnly, bias); - var body1Pushable = body1.pushable; - var body2Pushable = body2.pushable; var body1Immovable = body1.immovable; var body2Immovable = body2.immovable; @@ -39,268 +38,24 @@ var SeparateY = function (body1, body2, overlapOnly, bias) return (overlap !== 0) || (body1.embedded && body2.embedded); } - // Adjust their positions and velocities accordingly (if there was any overlap) - var v1 = body1.velocity.y; - var v2 = body2.velocity.y; + var blockedState = ProcessY.Set(body1, body2, overlap); if (!body1Immovable && !body2Immovable) { - // negative delta = up, positive delta = down (inc. gravity) - - overlap = Math.abs(overlap); - - var body1MovingUp = body1._dy < 0; - var body1MovingDown = body1._dy >= 0; - - var body2MovingUp = body2._dy < 0; - var body2MovingDown = body2._dy >= 0; - - var body1OnTop = Math.abs(body1.bottom - body2.y) <= Math.abs(body2.bottom - body1.y); - var body2OnTop = !body1OnTop; - - var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); - var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); - var avg = (nv1 + nv2) * 0.5; - - nv1 -= avg; - nv2 -= avg; - - // ----------------------------------------------------------------------- - // Blocked / Ground Checks - // ----------------------------------------------------------------------- - - // Body1 is moving down and Body2 is blocked from going down any further - if (body1MovingDown && body1OnTop && body2.blocked.down) + if (blockedState > 0) { - console.log('BlockY 1', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - body1.y -= overlap; - - body1.velocity.y = v2 - v1 * body1.bounce.y; - return true; } - // Body2 is moving down and Body1 is blocked from going down any further - if (body2MovingDown && body2OnTop && body1.blocked.down) - { - console.log('BlockY 2', body1.gameObject.name, 'vs', body2.gameObject.name, body2.y, overlap); - - body2.y -= overlap; - - body2.velocity.y = v1 - v2 * body2.bounce.y; - - return true; - } - - // Body1 is moving up and Body2 is blocked from going up any further - if (body1MovingUp && body2OnTop && body2.blocked.up) - { - console.log('BlockY 3', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - body1.y += overlap; - - body1.velocity.y = v2 - v1 * body1.bounce.y; - - return true; - } - - // Body2 is moving up and Body1 is blocked from going up any further - if (body2MovingUp && body1OnTop && body1.blocked.up) - { - console.log('BlockY 4', body1.gameObject.name, 'vs', body2.gameObject.name, body2.y, overlap); - - body2.y += overlap; - - body2.velocity.y = v1 - v2 * body2.bounce.y; - - return true; - } - - // ----------------------------------------------------------------------- - // Pushable Checks - // ----------------------------------------------------------------------- - - // Body1 is moving down and on top - and Body2 is pushable - if (body1MovingDown && !body1Pushable && body1OnTop && body2Pushable) - { - console.log('PushY 1', body1.gameObject.name, 'vs', body2.gameObject.name, body2.y, overlap); - - // Body 2 gets it all - body2.y += overlap; - body2.velocity.y = v1; - - // body2.velocity.y = v1 - v2 * body2.bounce.y; - - return true; - } - - // Body1 is moving down and on top - and Body2 is pushable - if (body2MovingDown && !body2Pushable && body2OnTop && body1Pushable) - { - console.log('PushY 2', body1.gameObject.name, 'vs', body2.gameObject.name, body2.y, overlap); - - // Body 1 gets it all - body1.y += overlap; - body1.velocity.y = v2; - - // body1.velocity.y = v2 - v1 * body1.bounce.y; - - return true; - } - - // Insert Up versions here ^^^ - - - - - // Body1 is moving down and on top - and Body2 is pushable - if (body1MovingDown && body1OnTop && body2Pushable) - { - if (body1Pushable) - { - console.log('PushY 3', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - // They're both pushable? They can share the separation then - overlap *= 0.5; - - body1.y -= overlap; - body2.y += overlap; - - body1.velocity.y = avg + nv1 * body1.bounce.y; - body2.velocity.y = avg + nv2 * body2.bounce.y; - } - else - { - console.log('PushY 4', body1.gameObject.name, 'vs', body2.gameObject.name, body2.y, overlap); - - // Body 2 gets it all - body2.y += overlap; - - // body2.velocity.y = v1 - v2 * body2.bounce.y; - } - - return true; - } - - // Body2 is moving down and on top - and Body1 is pushable - if (body2MovingDown && body2OnTop && body1Pushable) - { - if (body2Pushable) - { - console.log('PushY 5', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - // They're both pushable? They can share the separation then - overlap *= 0.5; - - body1.y += overlap; - body2.y -= overlap; - - body1.velocity.y = avg + nv1 * body1.bounce.y; - body2.velocity.y = avg + nv2 * body2.bounce.y; - } - else - { - console.log('PushY 6', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - // Body 1 gets it all - body1.y += overlap; - - // body1.velocity.y = v2 - v1 * body1.bounce.y; - } - - return true; - } - - // Body1 is moving up and on the bottom - and Body2 is pushable - if (body1MovingUp && body2OnTop && body2Pushable) - { - if (body1Pushable) - { - console.log('PushY 7', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - // They're both pushable? They can share the separation then - overlap *= 0.5; - - body1.y += overlap; - body2.y -= overlap; - - body1.velocity.y = avg + nv1 * body1.bounce.y; - body2.velocity.y = avg + nv2 * body2.bounce.y; - } - else - { - console.log('PushY 8', body1.gameObject.name, 'vs', body2.gameObject.name, body2.y, overlap); - - // Body 2 gets it all - body2.y -= overlap; - - body2.velocity.y = v1 - v2 * body2.bounce.y; - } - - return true; - } - - // Body2 is moving up and on the bottom - and Body1 is pushable - if (body2MovingUp && body1OnTop && body1Pushable) - { - if (body2Pushable) - { - console.log('PushY 9', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - // They're both pushable? They can share the separation then - overlap *= 0.5; - - body1.y -= overlap; - body2.y += overlap; - - body1.velocity.y = avg + nv1 * body1.bounce.y; - body2.velocity.y = avg + nv2 * body2.bounce.y; - } - else - { - console.log('PushY 10', body1.gameObject.name, 'vs', body2.gameObject.name, body1.y, overlap); - - // Body 1 gets it all - body1.y -= overlap; - - body1.velocity.y = v2 - v1 * body1.bounce.y; - } - - return true; - } - - console.log('uh oh'); - console.log('body1MovingUp', body1MovingUp, 'body2MovingUp', body2MovingUp, 'body1OnTop', body1OnTop, 'body2OnTop', body2OnTop); - + return ProcessY.Check(); } - else if (!body1Immovable) + else if (body1Immovable) { - // Body2 is immovable, so 1 gets all the separation no matter what - body1.y -= overlap; - - body1.velocity.y = v2 - v1 * body1.bounce.y; - - // This is special case code that handles things like horizontally moving platforms you can ride - if (body2.moves) - { - body1.x += (body2.x - body2.prev.x) * body2.friction.x; - body1._dx = body1.x - body1.prev.x; - } + ProcessY.RunImmovableBody1(blockedState); } - else if (!body2Immovable) + else if (body2Immovable) { - // Body1 is immovable, so 2 gets all the separation no matter what - body2.y += overlap; - - body2.velocity.y = v1 - v2 * body2.bounce.y; - - // This is special case code that handles things like horizontally moving platforms you can ride - if (body1.moves) - { - body2.x += (body1.x - body1.prev.x) * body1.friction.x; - body2._dx = body2.x - body2.prev.x; - } + ProcessY.RunImmovableBody2(blockedState); } // If we got this far then there WAS overlap, and separation is complete, so return true diff --git a/src/physics/arcade/StaticBody.js b/src/physics/arcade/StaticBody.js index 95eb8ebf9..d4121bfbd 100644 --- a/src/physics/arcade/StaticBody.js +++ b/src/physics/arcade/StaticBody.js @@ -69,7 +69,7 @@ var StaticBody = new Class({ * The color of this Static Body on the debug display. * * @name Phaser.Physics.Arcade.StaticBody#debugBodyColor - * @type {integer} + * @type {number} * @since 3.0.0 */ this.debugBodyColor = world.defaults.staticBodyDebugColor; @@ -372,7 +372,8 @@ var StaticBody = new Class({ this.checkCollision = { none: false, up: true, down: true, left: true, right: true }; /** - * Whether this StaticBody has ever collided with another body and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. * * @name Phaser.Physics.Arcade.StaticBody#touching * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -381,7 +382,9 @@ var StaticBody = new Class({ this.touching = { none: true, up: false, down: false, left: false, right: false }; /** - * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. + * The values are always false for a Static Body. * * @name Phaser.Physics.Arcade.StaticBody#wasTouching * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -390,7 +393,8 @@ var StaticBody = new Class({ this.wasTouching = { none: true, up: false, down: false, left: false, right: false }; /** - * Whether this StaticBody has ever collided with a tile or the world boundary. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. * * @name Phaser.Physics.Arcade.StaticBody#blocked * @type {Phaser.Types.Physics.Arcade.ArcadeBodyCollision} @@ -402,7 +406,7 @@ var StaticBody = new Class({ * The StaticBody's physics type (static by default). * * @name Phaser.Physics.Arcade.StaticBody#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.STATIC_BODY * @since 3.0.0 */ @@ -538,8 +542,8 @@ var StaticBody = new Class({ * @method Phaser.Physics.Arcade.StaticBody#setSize * @since 3.0.0 * - * @param {integer} [width] - The width of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. - * @param {integer} [height] - The height of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. + * @param {number} [width] - The width of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame width. + * @param {number} [height] - The height of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param {boolean} [center=true] - Place the Static Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. * * @return {Phaser.Physics.Arcade.StaticBody} This Static Body object. diff --git a/src/physics/arcade/StaticPhysicsGroup.js b/src/physics/arcade/StaticPhysicsGroup.js index 5b1658f90..f8f9989e4 100644 --- a/src/physics/arcade/StaticPhysicsGroup.js +++ b/src/physics/arcade/StaticPhysicsGroup.js @@ -94,7 +94,7 @@ var StaticPhysicsGroup = new Class({ * The scene this group belongs to. * * @name Phaser.Physics.Arcade.StaticGroup#physicsType - * @type {integer} + * @type {number} * @default Phaser.Physics.Arcade.STATIC_BODY * @since 3.0.0 */ diff --git a/src/physics/arcade/World.js b/src/physics/arcade/World.js index ec81b400e..1e261917c 100644 --- a/src/physics/arcade/World.js +++ b/src/physics/arcade/World.js @@ -18,6 +18,7 @@ var FuzzyGreaterThan = require('../../math/fuzzy/GreaterThan'); var FuzzyLessThan = require('../../math/fuzzy/LessThan'); var GetOverlapX = require('./GetOverlapX'); var GetOverlapY = require('./GetOverlapY'); +var GetTilesWithinWorldXY = require('../../tilemaps/components/GetTilesWithinWorldXY'); var GetValue = require('../../utils/object/GetValue'); var MATH_CONST = require('../../math/const'); var ProcessQueue = require('../../structs/ProcessQueue'); @@ -321,7 +322,7 @@ var World = new Class({ * to allow more items per node and less node division. * * @name Phaser.Physics.Arcade.World#maxEntries - * @type {integer} + * @type {number} * @default 16 * @since 3.0.0 */ @@ -431,7 +432,7 @@ var World = new Class({ * @since 3.0.0 * * @param {(Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]|Phaser.GameObjects.Group|Phaser.GameObjects.Group[])} object - The object, or objects, on which to create the bodies. - * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + * @param {number} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. */ enable: function (object, bodyType) { @@ -498,7 +499,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} object - The Game Object on which to create the body. - * @param {integer} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. + * @param {number} [bodyType] - The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. * * @return {Phaser.GameObjects.GameObject} The Game Object on which the body was created. */ @@ -894,7 +895,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#setFPS * @since 3.10.0 * - * @param {integer} framerate - The frame rate to advance the simulation at. + * @param {number} framerate - The frame rate to advance the simulation at. * * @return {this} This World object. */ @@ -982,7 +983,7 @@ var World = new Class({ } } - this.emit(Events.WORLD_STEP); + this.emit(Events.WORLD_STEP, fixedDelta); } // Process any additional steps this frame @@ -1041,7 +1042,7 @@ var World = new Class({ } } - this.emit(Events.WORLD_STEP); + this.emit(Events.WORLD_STEP, delta); this.stepsLastFrame++; }, @@ -1247,6 +1248,7 @@ var World = new Class({ if (useDamping) { // Damping based deceleration + dragX = Math.pow(dragX, delta); velocityX *= dragX; @@ -1286,6 +1288,8 @@ var World = new Class({ if (useDamping) { // Damping based deceleration + dragY = Math.pow(dragY, delta); + velocityY *= dragY; speed = Math.sqrt(velocityX * velocityX + velocityY * velocityY); @@ -1466,9 +1470,6 @@ var World = new Class({ */ separateCircle: function (body1, body2, overlapOnly, bias) { - body1.updateCenter(); - body2.updateCenter(); - // Set the bounding box overlap values into the bodies themselves (hence we don't use the return values here) GetOverlapX(body1, body2, false, bias); GetOverlapY(body1, body2, false, bias); @@ -1520,6 +1521,9 @@ var World = new Class({ overlap = (body1.halfWidth + body2.halfWidth) - DistanceBetween(body1.center.x, body1.center.y, body2.center.x, body2.center.y); } + body1.overlapR = overlap; + body2.overlapR = overlap; + // Can't separate two immovable bodies, or a body with its own custom separation logic if (overlapOnly || overlap === 0 || (body1.immovable && body2.immovable) || body1.customSeparateX || body2.customSeparateX) { @@ -2047,10 +2051,10 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.Group} group - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. - * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. - * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. - * @param {any} [callbackContext] - The context in which to run the callbacks. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. + * @param {ArcadePhysicsCallback} collideCallback - An optional callback function that is called if the objects collide. + * @param {ArcadePhysicsCallback} processCallback - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. + * @param {any} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Whether this is a collision or overlap check. * * @return {boolean} True if any objects overlap (with `overlapOnly`); or true if any overlapping objects were separated. @@ -2165,7 +2169,7 @@ var World = new Class({ * @since 3.0.0 * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. @@ -2187,9 +2191,6 @@ var World = new Class({ var w = body.width; var h = body.height; - // TODO: this logic should be encapsulated within the Tilemap API at some point. - // If the maps base tile size differs from the layer's tile size, we need to adjust the - // selection area by the difference between the two. var layerData = tilemapLayer.layer; if (layerData.tileWidth > layerData.baseTileWidth) @@ -2207,7 +2208,7 @@ var World = new Class({ h += yDiff; } - var mapData = tilemapLayer.getTilesWithinWorldXY(x, y, w, h); + var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer); if (mapData.length === 0) { @@ -2230,7 +2231,7 @@ var World = new Class({ * @since 3.17.0 * * @param {Phaser.GameObjects.GameObject} sprite - The first object to check for collision. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The second object to check for collision. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The second object to check for collision. * @param {ArcadePhysicsCallback} [collideCallback] - An optional callback function that is called if the objects collide. * @param {ArcadePhysicsCallback} [processCallback] - An optional callback function that lets you perform additional checks against the two objects if they collide. If this is set then `collideCallback` will only be called if this callback returns `true`. * @param {any} [callbackContext] - The context in which to run the callbacks. @@ -2254,11 +2255,13 @@ var World = new Class({ tilemapLayer = tile.tilemapLayer; - tileWorldRect.left = tilemapLayer.tileToWorldX(tile.x); - tileWorldRect.top = tilemapLayer.tileToWorldY(tile.y); + var point = tilemapLayer.tileToWorldXY(tile.x, tile.y); - // If the map's base tile size differs from the layer's tile size, only the top of the rect - // needs to be adjusted since its origin is (0, 1). + tileWorldRect.left = point.x; + tileWorldRect.top = point.y; + + // If the maps base tile size differs from the layer tile size, only the top of the rect + // needs to be adjusted since its origin is (0, 1). if (tile.baseHeight !== tile.height) { tileWorldRect.top -= (tile.height - tile.baseHeight) * tilemapLayer.scaleY; @@ -2335,7 +2338,7 @@ var World = new Class({ * @method Phaser.Physics.Arcade.World#wrap * @since 3.3.0 * - * @param {*} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. + * @param {any} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. * @param {number} [padding=0] - An amount added to each boundary edge during the operation. */ wrap: function (object, padding) diff --git a/src/physics/arcade/events/WORLD_STEP_EVENT.js b/src/physics/arcade/events/WORLD_STEP_EVENT.js index dc404d7a6..f815e8235 100644 --- a/src/physics/arcade/events/WORLD_STEP_EVENT.js +++ b/src/physics/arcade/events/WORLD_STEP_EVENT.js @@ -6,15 +6,17 @@ /** * The Arcade Physics World Step Event. - * + * * This event is dispatched by an Arcade Physics World instance whenever a physics step is run. * It is emitted _after_ the bodies and colliders have been updated. - * + * * In high framerate settings this can be multiple times per game frame. - * + * * Listen to it from a Scene using: `this.physics.world.on('worldstep', listener)`. * * @event Phaser.Physics.Arcade.Events#WORLD_STEP * @since 3.18.0 + * + * @param {number} delta - The delta time amount of this step, in seconds. */ module.exports = 'worldstep'; diff --git a/src/physics/arcade/tilemap/SeparateTile.js b/src/physics/arcade/tilemap/SeparateTile.js index e9bc03b7f..e23490597 100644 --- a/src/physics/arcade/tilemap/SeparateTile.js +++ b/src/physics/arcade/tilemap/SeparateTile.js @@ -18,7 +18,7 @@ var TileIntersectsBody = require('./TileIntersectsBody'); * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tilemaps.Tile} tile - The tile to collide against. * @param {Phaser.Geom.Rectangle} tileWorldRect - A rectangle-like object defining the dimensions of the tile. - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - The tilemapLayer to collide against. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - The tilemapLayer to collide against. * @param {number} tileBias - The tile bias value. Populated by the `World.TILE_BIAS` constant. * @param {boolean} isLayer - Is this check coming from a TilemapLayer or an array of tiles? * diff --git a/src/physics/arcade/typedefs/ArcadeColliderType.js b/src/physics/arcade/typedefs/ArcadeColliderType.js index 6185c036d..d92b5c82c 100644 --- a/src/physics/arcade/typedefs/ArcadeColliderType.js +++ b/src/physics/arcade/typedefs/ArcadeColliderType.js @@ -1,6 +1,6 @@ /** * An Arcade Physics Collider Type. * - * @typedef {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.Physics.Arcade.Sprite|Phaser.Physics.Arcade.Image|Phaser.Physics.Arcade.StaticGroup|Phaser.Physics.Arcade.Group|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer|Phaser.GameObjects.GameObject[]|Phaser.Physics.Arcade.Sprite[]|Phaser.Physics.Arcade.Image[]|Phaser.Physics.Arcade.StaticGroup[]|Phaser.Physics.Arcade.Group[]|Phaser.Tilemaps.DynamicTilemapLayer[]|Phaser.Tilemaps.StaticTilemapLayer[])} Phaser.Types.Physics.Arcade.ArcadeColliderType + * @typedef {(Phaser.GameObjects.GameObject|Phaser.GameObjects.Group|Phaser.Physics.Arcade.Sprite|Phaser.Physics.Arcade.Image|Phaser.Physics.Arcade.StaticGroup|Phaser.Physics.Arcade.Group|Phaser.Tilemaps.TilemapLayer|Phaser.GameObjects.GameObject[]|Phaser.Physics.Arcade.Sprite[]|Phaser.Physics.Arcade.Image[]|Phaser.Physics.Arcade.StaticGroup[]|Phaser.Physics.Arcade.Group[]|Phaser.Tilemaps.TilemapLayer[])} Phaser.Types.Physics.Arcade.ArcadeColliderType * @since 3.0.0 */ diff --git a/src/physics/arcade/typedefs/GameObjectWithBody.js b/src/physics/arcade/typedefs/GameObjectWithBody.js index 6876497ce..96e1a13b4 100644 --- a/src/physics/arcade/typedefs/GameObjectWithBody.js +++ b/src/physics/arcade/typedefs/GameObjectWithBody.js @@ -1,5 +1,6 @@ /** - * @typedef {Phaser.GameObjects.GameObject} Phaser.Types.Physics.Arcade.GameObjectWithBody + * @typedef {object} Phaser.Types.Physics.Arcade.GameObjectWithBody + * @extends Phaser.GameObjects.GameObject * * @property {(Phaser.Physics.Arcade.Body|Phaser.Physics.Arcade.StaticBody)} body */ diff --git a/src/physics/arcade/typedefs/GameObjectWithDynamicBody.js b/src/physics/arcade/typedefs/GameObjectWithDynamicBody.js index d035bf461..f711567f9 100644 --- a/src/physics/arcade/typedefs/GameObjectWithDynamicBody.js +++ b/src/physics/arcade/typedefs/GameObjectWithDynamicBody.js @@ -1,5 +1,6 @@ /** - * @typedef {Phaser.GameObjects.GameObject} Phaser.Types.Physics.Arcade.GameObjectWithDynamicBody + * @typedef {object} Phaser.Types.Physics.Arcade.GameObjectWithDynamicBody + * @extends Phaser.GameObjects.GameObject * * @property {Phaser.Physics.Arcade.Body} body */ diff --git a/src/physics/arcade/typedefs/GameObjectWithStaticBody.js b/src/physics/arcade/typedefs/GameObjectWithStaticBody.js index fa389fab5..4507f68d0 100644 --- a/src/physics/arcade/typedefs/GameObjectWithStaticBody.js +++ b/src/physics/arcade/typedefs/GameObjectWithStaticBody.js @@ -1,5 +1,6 @@ /** - * @typedef {Phaser.GameObjects.GameObject} Phaser.Types.Physics.Arcade.GameObjectWithStaticBody + * @typedef {object} Phaser.Types.Physics.Arcade.GameObjectWithStaticBody + * @extends Phaser.GameObjects.GameObject * * @property {Phaser.Physics.Arcade.StaticBody} body */ diff --git a/src/physics/arcade/typedefs/ImageWithDynamicBody.js b/src/physics/arcade/typedefs/ImageWithDynamicBody.js index 520c6c028..d4d6b4802 100644 --- a/src/physics/arcade/typedefs/ImageWithDynamicBody.js +++ b/src/physics/arcade/typedefs/ImageWithDynamicBody.js @@ -1,5 +1,6 @@ /** - * @typedef {Phaser.Physics.Arcade.Image} Phaser.Types.Physics.Arcade.ImageWithDynamicBody + * @typedef {object} Phaser.Types.Physics.Arcade.ImageWithDynamicBody + * @extends Phaser.Physics.Arcade.Image * * @property {Phaser.Physics.Arcade.Body} body */ diff --git a/src/physics/arcade/typedefs/ImageWithStaticBody.js b/src/physics/arcade/typedefs/ImageWithStaticBody.js index a0c9bb24e..a11440ad1 100644 --- a/src/physics/arcade/typedefs/ImageWithStaticBody.js +++ b/src/physics/arcade/typedefs/ImageWithStaticBody.js @@ -1,5 +1,6 @@ /** - * @typedef {Phaser.Physics.Arcade.Image} Phaser.Types.Physics.Arcade.ImageWithStaticBody + * @typedef {object} Phaser.Types.Physics.Arcade.ImageWithStaticBody + * @extends Phaser.Physics.Arcade.Image * * @property {Phaser.Physics.Arcade.StaticBody} body */ diff --git a/src/physics/arcade/typedefs/SpriteWithDynamicBody.js b/src/physics/arcade/typedefs/SpriteWithDynamicBody.js index 4362ee942..c7c726f16 100644 --- a/src/physics/arcade/typedefs/SpriteWithDynamicBody.js +++ b/src/physics/arcade/typedefs/SpriteWithDynamicBody.js @@ -1,5 +1,6 @@ /** - * @typedef {Phaser.Physics.Arcade.Sprite} Phaser.Types.Physics.Arcade.SpriteWithDynamicBody + * @typedef {object} Phaser.Types.Physics.Arcade.SpriteWithDynamicBody + * @extends Phaser.Physics.Arcade.Sprite * * @property {Phaser.Physics.Arcade.Body} body */ diff --git a/src/physics/arcade/typedefs/SpriteWithStaticBody.js b/src/physics/arcade/typedefs/SpriteWithStaticBody.js index 5b46d936e..aed72b882 100644 --- a/src/physics/arcade/typedefs/SpriteWithStaticBody.js +++ b/src/physics/arcade/typedefs/SpriteWithStaticBody.js @@ -1,5 +1,6 @@ /** - * @typedef {Phaser.Physics.Arcade.Sprite} Phaser.Types.Physics.Arcade.SpriteWithStaticBody + * @typedef {object} Phaser.Types.Physics.Arcade.SpriteWithStaticBody + * @extends Phaser.Physics.Arcade.Sprite * * @property {Phaser.Physics.Arcade.StaticBody} body */ diff --git a/src/physics/matter-js/Factory.js b/src/physics/matter-js/Factory.js index d174dc018..48fda7a26 100644 --- a/src/physics/matter-js/Factory.js +++ b/src/physics/matter-js/Factory.js @@ -380,7 +380,7 @@ var Factory = new Class({ * @since 3.0.0 * * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} frame - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {(string|number)} frame - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {number} x - The horizontal position of this composite in the world. * @param {number} y - The vertical position of this composite in the world. * @param {number} columns - The number of columns in the grid. @@ -812,7 +812,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. * * @return {Phaser.Physics.Matter.Image} The Matter Image Game Object. @@ -868,7 +868,7 @@ var Factory = new Class({ * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {string} key - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. * * @return {Phaser.Physics.Matter.Sprite} The Matter Sprite Game Object. @@ -899,7 +899,7 @@ var Factory = new Class({ * @param {(Phaser.Types.Physics.Matter.MatterBodyConfig|MatterJS.Body)} [options] - A Matter Body configuration object, or an instance of a Matter Body. * @param {boolean} [addToWorld=true] - Add this Matter Body to the World? * - * @return {Phaser.Physics.Matter.MatterGameObject} The Game Object that had the Matter Components injected into it. + * @return {(Phaser.Physics.Matter.Image|Phaser.Physics.Matter.Sprite|Phaser.GameObjects.GameObject)} The Game Object that had the Matter Components injected into it. */ gameObject: function (gameObject, options, addToWorld) { diff --git a/src/physics/matter-js/MatterImage.js b/src/physics/matter-js/MatterImage.js index 818b1db73..5daadebc2 100644 --- a/src/physics/matter-js/MatterImage.js +++ b/src/physics/matter-js/MatterImage.js @@ -57,7 +57,7 @@ var Vector2 = require('../../math/Vector2'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. */ var MatterImage = new Class({ diff --git a/src/physics/matter-js/MatterPhysics.js b/src/physics/matter-js/MatterPhysics.js index a93444404..3a140f2a9 100644 --- a/src/physics/matter-js/MatterPhysics.js +++ b/src/physics/matter-js/MatterPhysics.js @@ -1343,7 +1343,7 @@ var MatterPhysics = new Class({ * @param {Phaser.Types.Physics.Matter.MatterBody} body - The Body to align. * @param {number} x - The horizontal position to align the body to. * @param {number} y - The vertical position to align the body to. - * @param {integer} align - One of the `Phaser.Display.Align` constants, such as `Phaser.Display.Align.TOP_LEFT`. + * @param {number} align - One of the `Phaser.Display.Align` constants, such as `Phaser.Display.Align.TOP_LEFT`. * * @return {this} This Matter Physics instance. */ diff --git a/src/physics/matter-js/MatterSprite.js b/src/physics/matter-js/MatterSprite.js index 2462c49ba..da5a1a09a 100644 --- a/src/physics/matter-js/MatterSprite.js +++ b/src/physics/matter-js/MatterSprite.js @@ -61,7 +61,7 @@ var Vector2 = require('../../math/Vector2'); * @param {number} x - The horizontal position of this Game Object in the world. * @param {number} y - The vertical position of this Game Object in the world. * @param {(string|Phaser.Textures.Texture)} texture - The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with. + * @param {(string|number)} [frame] - An optional frame from the Texture this Game Object is rendering with. * @param {Phaser.Types.Physics.Matter.MatterBodyConfig} [options] - An optional Body configuration object that is used to set initial Body properties on creation. */ var MatterSprite = new Class({ diff --git a/src/physics/matter-js/World.js b/src/physics/matter-js/World.js index 35264015c..c7a3ac7ed 100644 --- a/src/physics/matter-js/World.js +++ b/src/physics/matter-js/World.js @@ -980,8 +980,7 @@ var World = new Class({ * @method Phaser.Physics.Matter.World#convertTilemapLayer * @since 3.0.0 * - * @param {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} tilemapLayer - - * An array of tiles. + * @param {Phaser.Tilemaps.TilemapLayer} tilemapLayer - An array of tiles. * @param {object} [options] - Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody} * * @return {this} This Matter World object. diff --git a/src/plugins/DefaultPlugins.js b/src/plugins/DefaultPlugins.js index 5a1359478..a82e9d7e4 100644 --- a/src/plugins/DefaultPlugins.js +++ b/src/plugins/DefaultPlugins.js @@ -5,11 +5,11 @@ */ /** - * @typedef {object} Phaser.Plugins.DefaultPlugins - * - * @property {array} Global - These are the Global Managers that are created by the Phaser.Game instance. - * @property {array} CoreScene - These are the core plugins that are installed into every Scene.Systems instance, no matter what. - * @property {array} DefaultScene - These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + * The Default Plugins. + * + * @namespace Phaser.Plugins.DefaultPlugins + * @memberof Phaser.Plugins + * @since 3.0.0 */ var DefaultPlugins = { @@ -31,7 +31,8 @@ var DefaultPlugins = { 'registry', 'scale', 'sound', - 'textures' + 'textures', + 'renderer' ], diff --git a/src/plugins/PluginManager.js b/src/plugins/PluginManager.js index 80b911f0f..fe54beeb5 100644 --- a/src/plugins/PluginManager.js +++ b/src/plugins/PluginManager.js @@ -473,7 +473,7 @@ var PluginManager = new Class({ * * @param {string} key - The unique plugin key. * - * @return {integer} The index of the plugin within the plugins array. + * @return {number} The index of the plugin within the plugins array. */ getIndex: function (key) { diff --git a/src/renderer/BlendModes.js b/src/renderer/BlendModes.js index 7aa4ae668..e4a70329f 100644 --- a/src/renderer/BlendModes.js +++ b/src/renderer/BlendModes.js @@ -17,7 +17,7 @@ module.exports = { * Skips the Blend Mode check in the renderer. * * @name Phaser.BlendModes.SKIP_CHECK - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -28,7 +28,7 @@ module.exports = { * This is the default setting and draws new shapes on top of the existing canvas content. * * @name Phaser.BlendModes.NORMAL - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -39,7 +39,7 @@ module.exports = { * Where both shapes overlap the color is determined by adding color values. * * @name Phaser.BlendModes.ADD - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -50,7 +50,7 @@ module.exports = { * The pixels are of the top layer are multiplied with the corresponding pixel of the bottom layer. A darker picture is the result. * * @name Phaser.BlendModes.MULTIPLY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -61,7 +61,7 @@ module.exports = { * The pixels are inverted, multiplied, and inverted again. A lighter picture is the result (opposite of multiply) * * @name Phaser.BlendModes.SCREEN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -72,7 +72,7 @@ module.exports = { * A combination of multiply and screen. Dark parts on the base layer become darker, and light parts become lighter. * * @name Phaser.BlendModes.OVERLAY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -83,7 +83,7 @@ module.exports = { * Retains the darkest pixels of both layers. * * @name Phaser.BlendModes.DARKEN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -94,7 +94,7 @@ module.exports = { * Retains the lightest pixels of both layers. * * @name Phaser.BlendModes.LIGHTEN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -105,7 +105,7 @@ module.exports = { * Divides the bottom layer by the inverted top layer. * * @name Phaser.BlendModes.COLOR_DODGE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -116,7 +116,7 @@ module.exports = { * Divides the inverted bottom layer by the top layer, and then inverts the result. * * @name Phaser.BlendModes.COLOR_BURN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -127,7 +127,7 @@ module.exports = { * A combination of multiply and screen like overlay, but with top and bottom layer swapped. * * @name Phaser.BlendModes.HARD_LIGHT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -138,7 +138,7 @@ module.exports = { * A softer version of hard-light. Pure black or white does not result in pure black or white. * * @name Phaser.BlendModes.SOFT_LIGHT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -149,7 +149,7 @@ module.exports = { * Subtracts the bottom layer from the top layer or the other way round to always get a positive value. * * @name Phaser.BlendModes.DIFFERENCE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -160,7 +160,7 @@ module.exports = { * Like difference, but with lower contrast. * * @name Phaser.BlendModes.EXCLUSION - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -171,7 +171,7 @@ module.exports = { * Preserves the luma and chroma of the bottom layer, while adopting the hue of the top layer. * * @name Phaser.BlendModes.HUE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -182,7 +182,7 @@ module.exports = { * Preserves the luma and hue of the bottom layer, while adopting the chroma of the top layer. * * @name Phaser.BlendModes.SATURATION - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -193,7 +193,7 @@ module.exports = { * Preserves the luma of the bottom layer, while adopting the hue and chroma of the top layer. * * @name Phaser.BlendModes.COLOR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -204,7 +204,7 @@ module.exports = { * Preserves the hue and chroma of the bottom layer, while adopting the luma of the top layer. * * @name Phaser.BlendModes.LUMINOSITY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -214,7 +214,7 @@ module.exports = { * Alpha erase blend mode. For Canvas and WebGL. * * @name Phaser.BlendModes.ERASE - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -225,7 +225,7 @@ module.exports = { * The new shape is drawn only where both the new shape and the destination canvas overlap. Everything else is made transparent. * * @name Phaser.BlendModes.SOURCE_IN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -236,7 +236,7 @@ module.exports = { * The new shape is drawn where it doesn't overlap the existing canvas content. * * @name Phaser.BlendModes.SOURCE_OUT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -247,7 +247,7 @@ module.exports = { * The new shape is only drawn where it overlaps the existing canvas content. * * @name Phaser.BlendModes.SOURCE_ATOP - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -258,7 +258,7 @@ module.exports = { * New shapes are drawn behind the existing canvas content. * * @name Phaser.BlendModes.DESTINATION_OVER - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -269,7 +269,7 @@ module.exports = { * The existing canvas content is kept where both the new shape and existing canvas content overlap. Everything else is made transparent. * * @name Phaser.BlendModes.DESTINATION_IN - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -280,7 +280,7 @@ module.exports = { * The existing content is kept where it doesn't overlap the new shape. * * @name Phaser.BlendModes.DESTINATION_OUT - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -291,7 +291,7 @@ module.exports = { * The existing canvas is only kept where it overlaps the new shape. The new shape is drawn behind the canvas content. * * @name Phaser.BlendModes.DESTINATION_ATOP - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -302,7 +302,7 @@ module.exports = { * Where both shapes overlap the color is determined by adding color values. * * @name Phaser.BlendModes.LIGHTER - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -313,7 +313,7 @@ module.exports = { * Only the new shape is shown. * * @name Phaser.BlendModes.COPY - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -324,7 +324,7 @@ module.exports = { * Shapes are made transparent where both overlap and drawn normal everywhere else. * * @name Phaser.BlendModes.XOR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ diff --git a/src/renderer/ScaleModes.js b/src/renderer/ScaleModes.js index 92d1a3af6..829757aca 100644 --- a/src/renderer/ScaleModes.js +++ b/src/renderer/ScaleModes.js @@ -17,7 +17,7 @@ var ScaleModes = { * Default Scale Mode (Linear). * * @name Phaser.ScaleModes.DEFAULT - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -27,7 +27,7 @@ var ScaleModes = { * Linear Scale Mode. * * @name Phaser.ScaleModes.LINEAR - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -37,7 +37,7 @@ var ScaleModes = { * Nearest Scale Mode. * * @name Phaser.ScaleModes.NEAREST - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ diff --git a/src/renderer/canvas/CanvasRenderer.js b/src/renderer/canvas/CanvasRenderer.js index f3ad5fc12..43565d83c 100644 --- a/src/renderer/canvas/CanvasRenderer.js +++ b/src/renderer/canvas/CanvasRenderer.js @@ -5,19 +5,26 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var CanvasSnapshot = require('../snapshot/CanvasSnapshot'); var CameraEvents = require('../../cameras/2d/events'); +var CanvasSnapshot = require('../snapshot/CanvasSnapshot'); var Class = require('../../utils/Class'); var CONST = require('../../const'); +var EventEmitter = require('eventemitter3'); +var Events = require('../events'); var GetBlendModes = require('./utils/GetBlendModes'); var ScaleEvents = require('../../scale/events'); +var TextureEvents = require('../../textures/events'); var TransformMatrix = require('../../gameobjects/components/TransformMatrix'); /** * @classdesc - * The Canvas Renderer is responsible for managing 2D canvas rendering contexts, including the one used by the Game's canvas. It tracks the internal state of a given context and can renderer textured Game Objects to it, taking into account alpha, blending, and scaling. + * The Canvas Renderer is responsible for managing 2D canvas rendering contexts, + * including the one used by the Games canvas. It tracks the internal state of a + * given context and can renderer textured Game Objects to it, taking into + * account alpha, blending, and scaling. * * @class CanvasRenderer + * @extends Phaser.Events.EventEmitter * @memberof Phaser.Renderer.Canvas * @constructor * @since 3.0.0 @@ -26,10 +33,30 @@ var TransformMatrix = require('../../gameobjects/components/TransformMatrix'); */ var CanvasRenderer = new Class({ + Extends: EventEmitter, + initialize: function CanvasRenderer (game) { + EventEmitter.call(this); + + var gameConfig = game.config; + + /** + * The local configuration settings of the CanvasRenderer. + * + * @name Phaser.Renderer.Canvas.CanvasRenderer#config + * @type {object} + * @since 3.0.0 + */ + this.config = { + clearBeforeRender: gameConfig.clearBeforeRender, + backgroundColor: gameConfig.backgroundColor, + antialias: gameConfig.antialias, + roundPixels: gameConfig.roundPixels + }; + /** * The Phaser Game instance that owns this renderer. * @@ -43,7 +70,7 @@ var CanvasRenderer = new Class({ * A constant which allows the renderer to be easily identified as a Canvas Renderer. * * @name Phaser.Renderer.Canvas.CanvasRenderer#type - * @type {integer} + * @type {number} * @since 3.0.0 */ this.type = CONST.CANVAS; @@ -62,7 +89,7 @@ var CanvasRenderer = new Class({ * The width of the canvas being rendered to. * * @name Phaser.Renderer.Canvas.CanvasRenderer#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = 0; @@ -71,25 +98,11 @@ var CanvasRenderer = new Class({ * The height of the canvas being rendered to. * * @name Phaser.Renderer.Canvas.CanvasRenderer#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = 0; - /** - * The local configuration settings of the CanvasRenderer. - * - * @name Phaser.Renderer.Canvas.CanvasRenderer#config - * @type {object} - * @since 3.0.0 - */ - this.config = { - clearBeforeRender: game.config.clearBeforeRender, - backgroundColor: game.config.backgroundColor, - antialias: game.config.antialias, - roundPixels: game.config.roundPixels - }; - /** * The canvas element which the Game uses. * @@ -111,7 +124,7 @@ var CanvasRenderer = new Class({ * @type {CanvasRenderingContext2D} * @since 3.0.0 */ - this.gameContext = (this.game.config.context) ? this.game.config.context : this.gameCanvas.getContext('2d', contextOptions); + this.gameContext = (gameConfig.context) ? gameConfig.context : this.gameCanvas.getContext('2d', contextOptions); /** * The canvas context currently used by the CanvasRenderer for all rendering operations. @@ -168,7 +181,7 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix1 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix1 = new TransformMatrix(); @@ -178,7 +191,7 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix2 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix2 = new TransformMatrix(); @@ -188,19 +201,18 @@ var CanvasRenderer = new Class({ * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix3 * @private * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @since 3.11.0 */ this._tempMatrix3 = new TransformMatrix(); /** - * A temporary Transform Matrix, re-used internally during batching. + * Has this renderer fully booted yet? * - * @name Phaser.Renderer.Canvas.CanvasRenderer#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 + * @name Phaser.Renderer.Canvas.CanvasRenderer#isBooted + * @type {boolean} + * @since 3.50.0 */ - this._tempMatrix4 = new TransformMatrix(); + this.isBooted = false; this.init(); }, @@ -213,9 +225,28 @@ var CanvasRenderer = new Class({ */ init: function () { - this.game.scale.on(ScaleEvents.RESIZE, this.onResize, this); + this.game.textures.once(TextureEvents.READY, this.boot, this); + }, - var baseSize = this.game.scale.baseSize; + /** + * Internal boot handler. + * + * @method Phaser.Renderer.Canvas.CanvasRenderer#boot + * @private + * @since 3.50.0 + */ + boot: function () + { + var game = this.game; + + var baseSize = game.scale.baseSize; + + this.width = baseSize.width; + this.height = baseSize.height; + + this.isBooted = true; + + game.scale.on(ScaleEvents.RESIZE, this.onResize, this); this.resize(baseSize.width, baseSize.height); }, @@ -242,6 +273,7 @@ var CanvasRenderer = new Class({ * Resize the main game canvas. * * @method Phaser.Renderer.Canvas.CanvasRenderer#resize + * @fires Phaser.Renderer.Events#RESIZE * @since 3.0.0 * * @param {number} [width] - The new width of the renderer. @@ -251,6 +283,8 @@ var CanvasRenderer = new Class({ { this.width = width; this.height = height; + + this.emit(Events.RESIZE, width, height); }, /** @@ -319,6 +353,7 @@ var CanvasRenderer = new Class({ * Called at the start of the render loop. * * @method Phaser.Renderer.Canvas.CanvasRenderer#preRender + * @fires Phaser.Renderer.Events#PRE_RENDER * @since 3.0.0 */ preRender: function () @@ -347,27 +382,38 @@ var CanvasRenderer = new Class({ ctx.save(); this.drawCount = 0; + + this.emit(Events.PRE_RENDER); }, /** - * Renders the Scene to the given Camera. + * The core render step for a Scene Camera. + * + * Iterates through the given array of Game Objects and renders them with the given Camera. + * + * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked + * by the Scene Systems.render method. + * + * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * * @method Phaser.Renderer.Canvas.CanvasRenderer#render + * @fires Phaser.Renderer.Events#RENDER * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.GameObjects.DisplayList} children - The Game Objects within the Scene to be rendered. + * @param {Phaser.GameObjects.GameObject[]} children - An array of filtered Game Objects that can be rendered by the given Camera. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ render: function (scene, children, camera) { - var list = children.list; - var childCount = list.length; + var childCount = children.length; - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + this.emit(Events.RENDER, scene, camera); + + var cx = camera.x; + var cy = camera.y; + var cw = camera.width; + var ch = camera.height; var ctx = (camera.renderToTexture) ? camera.context : scene.sys.context; @@ -400,7 +446,7 @@ var CanvasRenderer = new Class({ ctx.globalCompositeOperation = 'source-over'; - this.drawCount += list.length; + this.drawCount += childCount; if (camera.renderToTexture) { @@ -411,12 +457,7 @@ var CanvasRenderer = new Class({ for (var i = 0; i < childCount; i++) { - var child = list[i]; - - if (!child.willRender(camera)) - { - continue; - } + var child = children[i]; if (child.mask) { @@ -465,6 +506,7 @@ var CanvasRenderer = new Class({ * The post-render step happens after all Cameras in all Scenes have been rendered. * * @method Phaser.Renderer.Canvas.CanvasRenderer#postRender + * @fires Phaser.Renderer.Events#POST_RENDER * @since 3.0.0 */ postRender: function () @@ -473,6 +515,8 @@ var CanvasRenderer = new Class({ ctx.restore(); + this.emit(Events.POST_RENDER); + var state = this.snapshotState; if (state.callback) @@ -497,10 +541,10 @@ var CanvasRenderer = new Class({ * @param {HTMLCanvasElement} canvas - The canvas to grab from. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? - * @param {integer} [x=0] - The x coordinate to grab from. - * @param {integer} [y=0] - The y coordinate to grab from. - * @param {integer} [width=canvas.width] - The width of the area to grab. - * @param {integer} [height=canvas.height] - The height of the area to grab. + * @param {number} [x=0] - The x coordinate to grab from. + * @param {number} [y=0] - The y coordinate to grab from. + * @param {number} [width=canvas.width] - The width of the area to grab. + * @param {number} [height=canvas.height] - The height of the area to grab. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. * @@ -562,10 +606,10 @@ var CanvasRenderer = new Class({ * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotArea * @since 3.16.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -603,8 +647,8 @@ var CanvasRenderer = new Class({ * @method Phaser.Renderer.Canvas.CanvasRenderer#snapshotPixel * @since 3.16.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This WebGL Renderer. @@ -643,7 +687,6 @@ var CanvasRenderer = new Class({ var camMatrix = this._tempMatrix1; var spriteMatrix = this._tempMatrix2; - var calcMatrix = this._tempMatrix3; var cd = frame.canvasData; @@ -747,12 +790,12 @@ var CanvasRenderer = new Class({ spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; } - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(spriteMatrix, calcMatrix); + // Multiply by the Sprite matrix + camMatrix.multiply(spriteMatrix); ctx.save(); - calcMatrix.setToContext(ctx); + camMatrix.setToContext(ctx); ctx.globalCompositeOperation = this.blendModes[sprite.blendMode]; @@ -783,10 +826,11 @@ var CanvasRenderer = new Class({ */ destroy: function () { - this.gameCanvas = null; - this.gameContext = null; + this.removeAllListeners(); this.game = null; + this.gameCanvas = null; + this.gameContext = null; } }); diff --git a/src/renderer/canvas/utils/SetTransform.js b/src/renderer/canvas/utils/SetTransform.js index 4849b0fa7..c48d39d4e 100644 --- a/src/renderer/canvas/utils/SetTransform.js +++ b/src/renderer/canvas/utils/SetTransform.js @@ -4,10 +4,12 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var GetCalcMatrix = require('../../../gameobjects/GetCalcMatrix'); + /** * Takes a reference to the Canvas Renderer, a Canvas Rendering Context, a Game Object, a Camera and a parent matrix * and then performs the following steps: - * + * * 1. Checks the alpha of the source combined with the Camera alpha. If 0 or less it aborts. * 2. Takes the Camera and Game Object matrix and multiplies them, combined with the parent matrix if given. * 3. Sets the blend mode of the context to be that used by the Game Object. @@ -15,7 +17,7 @@ * 5. Saves the context state. * 6. Sets the final matrix values into the context via setTransform. * 7. If Renderer.antialias, or the frame.source.scaleMode is set, then imageSmoothingEnabled is set. - * + * * This function is only meant to be used internally. Most of the Canvas Renderer classes use it. * * @function Phaser.Renderer.Canvas.SetTransform @@ -26,7 +28,7 @@ * @param {Phaser.GameObjects.GameObject} src - The Game Object being rendered. Can be any type that extends the base class. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} [parentMatrix] - A parent transform matrix to apply to the Game Object before rendering. - * + * * @return {boolean} `true` if the Game Object context was set, otherwise `false`. */ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) @@ -39,30 +41,7 @@ var SetTransform = function (renderer, ctx, src, camera, parentMatrix) return false; } - var camMatrix = renderer._tempMatrix1.copyFromArray(camera.matrix.matrix); - var gameObjectMatrix = renderer._tempMatrix2.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - var calcMatrix = renderer._tempMatrix3; - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - gameObjectMatrix.e = src.x; - gameObjectMatrix.f = src.y; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } - else - { - gameObjectMatrix.e -= camera.scrollX * src.scrollFactorX; - gameObjectMatrix.f -= camera.scrollY * src.scrollFactorY; - - // Multiply by the Sprite matrix, store result in calcMatrix - camMatrix.multiply(gameObjectMatrix, calcMatrix); - } + var calcMatrix = GetCalcMatrix(src, camera, parentMatrix).calc; // Blend Mode ctx.globalCompositeOperation = renderer.blendModes[src.blendMode]; diff --git a/src/renderer/events/POST_RENDER_EVENT.js b/src/renderer/events/POST_RENDER_EVENT.js new file mode 100644 index 000000000..218175116 --- /dev/null +++ b/src/renderer/events/POST_RENDER_EVENT.js @@ -0,0 +1,16 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Post-Render Event. + * + * This event is dispatched by the Renderer when all rendering, for all cameras in all Scenes, + * has completed, but before any pending snap shots have been taken. + * + * @event Phaser.Renderer.Events#POST_RENDER + * @since 3.50.0 + */ +module.exports = 'postrender'; diff --git a/src/renderer/events/PRE_RENDER_EVENT.js b/src/renderer/events/PRE_RENDER_EVENT.js new file mode 100644 index 000000000..a3794408f --- /dev/null +++ b/src/renderer/events/PRE_RENDER_EVENT.js @@ -0,0 +1,17 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Pre-Render Event. + * + * This event is dispatched by the Phaser Renderer. This happens right at the start of the render + * process, after the context has been cleared, the scissors enabled (WebGL only) and everything has been + * reset ready for the render. + * + * @event Phaser.Renderer.Events#PRE_RENDER + * @since 3.50.0 + */ +module.exports = 'prerender'; diff --git a/src/renderer/events/RENDER_EVENT.js b/src/renderer/events/RENDER_EVENT.js new file mode 100644 index 000000000..ce34a004a --- /dev/null +++ b/src/renderer/events/RENDER_EVENT.js @@ -0,0 +1,20 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Render Event. + * + * This event is dispatched by the Phaser Renderer for every camera in every Scene. + * + * It is dispatched before any of the children in the Scene have been rendered. + * + * @event Phaser.Renderer.Events#RENDER + * @since 3.50.0 + * + * @param {Phaser.Scene} scene - The Scene being rendered. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered. + */ +module.exports = 'render'; diff --git a/src/renderer/events/RESIZE_EVENT.js b/src/renderer/events/RESIZE_EVENT.js new file mode 100644 index 000000000..afa09528b --- /dev/null +++ b/src/renderer/events/RESIZE_EVENT.js @@ -0,0 +1,19 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The Renderer Resize Event. + * + * This event is dispatched by the Phaser Renderer when it is resized, usually as a result + * of the Scale Manager resizing. + * + * @event Phaser.Renderer.Events#RESIZE + * @since 3.50.0 + * + * @param {number} width - The new width of the renderer. + * @param {number} height - The new height of the renderer. + */ +module.exports = 'resize'; diff --git a/src/renderer/events/index.js b/src/renderer/events/index.js new file mode 100644 index 000000000..85bf7728f --- /dev/null +++ b/src/renderer/events/index.js @@ -0,0 +1,18 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.Events + */ + +module.exports = { + + POST_RENDER: require('./POST_RENDER_EVENT'), + PRE_RENDER: require('./PRE_RENDER_EVENT'), + RENDER: require('./RENDER_EVENT'), + RESIZE: require('./RESIZE_EVENT') + +}; diff --git a/src/renderer/index.js b/src/renderer/index.js index 51347ea77..d715c2890 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -15,6 +15,7 @@ module.exports = { Canvas: require('./canvas'), + Events: require('./events'), Snapshot: require('./snapshot'), WebGL: require('./webgl') diff --git a/src/renderer/snapshot/typedefs/SnapshotState.js b/src/renderer/snapshot/typedefs/SnapshotState.js index c4b7dde92..89d118e01 100644 --- a/src/renderer/snapshot/typedefs/SnapshotState.js +++ b/src/renderer/snapshot/typedefs/SnapshotState.js @@ -5,12 +5,12 @@ * @property {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The function to call after the snapshot is taken. * @property {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @property {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. - * @property {integer} [x=0] - The x coordinate to start the snapshot from. - * @property {integer} [y=0] - The y coordinate to start the snapshot from. - * @property {integer} [width] - The width of the snapshot. - * @property {integer} [height] - The height of the snapshot. + * @property {number} [x=0] - The x coordinate to start the snapshot from. + * @property {number} [y=0] - The y coordinate to start the snapshot from. + * @property {number} [width] - The width of the snapshot. + * @property {number} [height] - The height of the snapshot. * @property {boolean} [getPixel=false] - Is this a snapshot to get a single pixel, or an area? * @property {boolean} [isFramebuffer=false] - Is this snapshot grabbing from a frame buffer or a canvas? - * @property {integer} [bufferWidth] - The width of the frame buffer, if a frame buffer grab. - * @property {integer} [bufferHeight] - The height of the frame buffer, if a frame buffer grab. + * @property {number} [bufferWidth] - The width of the frame buffer, if a frame buffer grab. + * @property {number} [bufferHeight] - The height of the frame buffer, if a frame buffer grab. */ diff --git a/src/renderer/webgl/PipelineManager.js b/src/renderer/webgl/PipelineManager.js index 8eb49424a..8f6b92ccc 100644 --- a/src/renderer/webgl/PipelineManager.js +++ b/src/renderer/webgl/PipelineManager.js @@ -5,16 +5,18 @@ */ var Class = require('../../utils/Class'); -var CustomMap = require('../../structs/Map'); var CONST = require('./pipelines/const'); +var CustomMap = require('../../structs/Map'); // Default Phaser 3 Pipelines var BitmapMaskPipeline = require('./pipelines/BitmapMaskPipeline'); +var GraphicsPipeline = require('./pipelines/GraphicsPipeline'); var LightPipeline = require('./pipelines/LightPipeline'); -var MeshPipeline = require('./pipelines/MeshPipeline'); var MultiPipeline = require('./pipelines/MultiPipeline'); +var PointLightPipeline = require('./pipelines/PointLightPipeline'); var RopePipeline = require('./pipelines/RopePipeline'); var SinglePipeline = require('./pipelines/SinglePipeline'); +var UtilityPipeline = require('./pipelines/UtilityPipeline'); /** * @classdesc @@ -24,14 +26,13 @@ var SinglePipeline = require('./pipelines/SinglePipeline'); * The `WebGLRenderer` owns a single instance of the Pipeline Manager, which you can access * via the `WebGLRenderer.pipelines` property. * - * By default, there are 6 pipelines installed into the Pipeline Manager when Phaser boots: + * By default, there are 5 pipelines installed into the Pipeline Manager when Phaser boots: * * 1. The Multi Pipeline. Responsible for all multi-texture rendering, i.e. Sprites, Shapes. * 2. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. * 3. The Rope Pipeline. Responsible for rendering the Rope Game Object. - * 4. The Mesh Pipeline. Responsible for rendering the Layer3D Game Object. - * 5. The Light Pipeline. Responsible for rendering the Light Game Object. - * 6. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. + * 4. The Light Pipeline. Responsible for rendering the Light Game Object. + * 5. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. * * You can add your own custom pipeline via the `PipelineManager.add` method. Pipelines are * identified by unique string-based keys. @@ -67,6 +68,35 @@ var PipelineManager = new Class({ */ this.renderer = renderer; + /** + * This map stores all pipeline classes available in this manager. + * + * The Utility Class must always come first. + * + * @name Phaser.Renderer.WebGL.PipelineManager#classes + * @type {Phaser.Structs.Map.} + * @since 3.50.0 + */ + this.classes = new CustomMap([ + [ CONST.UTILITY_PIPELINE, UtilityPipeline ], + [ CONST.MULTI_PIPELINE, MultiPipeline ], + [ CONST.BITMAPMASK_PIPELINE, BitmapMaskPipeline ], + [ CONST.SINGLE_PIPELINE, SinglePipeline ], + [ CONST.ROPE_PIPELINE, RopePipeline ], + [ CONST.LIGHT_PIPELINE, LightPipeline ], + [ CONST.POINTLIGHT_PIPELINE, PointLightPipeline ], + [ CONST.GRAPHICS_PIPELINE, GraphicsPipeline ] + ]); + + /** + * This map stores all Post FX Pipeline classes available in this manager. + * + * @name Phaser.Renderer.WebGL.PipelineManager#postPipelineClasses + * @type {Phaser.Structs.Map.} + * @since 3.50.0 + */ + this.postPipelineClasses = new CustomMap(); + /** * This map stores all pipeline instances in this manager. * @@ -125,6 +155,80 @@ var PipelineManager = new Class({ * @since 3.50.0 */ this.BITMAPMASK_PIPELINE = null; + + /** + * A constant-style reference to the Utility Pipeline Instance. + * + * @name Phaser.Renderer.WebGL.PipelineManager#UTILITY_PIPELINE + * @type {Phaser.Renderer.WebGL.Pipelines.UtilityPipeline} + * @default null + * @since 3.50.0 + */ + this.UTILITY_PIPELINE = null; + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.PipelineManager#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame2; }, /** @@ -137,20 +241,61 @@ var PipelineManager = new Class({ * * @method Phaser.Renderer.WebGL.PipelineManager#boot * @since 3.50.0 + * + * @param {Phaser.Types.Core.PipelineConfig} [pipelineConfig] - The pipeline configuration object as set in the Game Config. */ - boot: function () + boot: function (pipelineConfig) { + // Install each of the default pipelines + + var instance; + var pipelineName; + + var _this = this; var game = this.game; - this.MULTI_PIPELINE = this.add(CONST.MULTI_PIPELINE, new MultiPipeline({ game: game })); - this.BITMAPMASK_PIPELINE = this.add(CONST.BITMAPMASK_PIPELINE, new BitmapMaskPipeline({ game: game })); + this.classes.each(function (pipelineName, pipeline) + { + instance = _this.add(pipelineName, new pipeline({ game: game })); - this.add(CONST.SINGLE_PIPELINE, new SinglePipeline({ game: game })); - this.add(CONST.ROPE_PIPELINE, new RopePipeline({ game: game })); - this.add(CONST.LIGHT_PIPELINE, new LightPipeline({ game: game })); - this.add(CONST.MESH_PIPELINE, new MeshPipeline({ game: game })); + if (pipelineName === CONST.UTILITY_PIPELINE) + { + _this.UTILITY_PIPELINE = instance; - this.set(this.MULTI_PIPELINE); + // FBO references + _this.fullFrame1 = instance.fullFrame1; + _this.fullFrame2 = instance.fullFrame2; + _this.halfFrame1 = instance.halfFrame1; + _this.halfFrame2 = instance.halfFrame2; + } + }); + + // Our const-like references + this.MULTI_PIPELINE = this.get(CONST.MULTI_PIPELINE); + this.BITMAPMASK_PIPELINE = this.get(CONST.BITMAPMASK_PIPELINE); + + // And now the ones in the config, if any + + if (pipelineConfig) + { + for (pipelineName in pipelineConfig) + { + var pipelineClass = pipelineConfig[pipelineName]; + + instance = new pipelineClass(game); + + if (instance.isPostFX) + { + this.postPipelineClasses.set(pipelineName, pipelineClass); + } + else if (!this.has(pipelineName)) + { + this.classes.set(pipelineName, pipelineClass); + + this.add(pipelineName, instance); + } + } + } }, /** @@ -158,13 +303,23 @@ var PipelineManager = new Class({ * * The name of the instance must be unique within this manager. * - * Make sure to pass an instance to this method, not a base class. For example: + * Make sure to pass an instance to this method, not a base class. + * + * For example, you should pass it like this: * * ```javascript - * this.add('yourName', new MultiPipeline());` + * this.add('yourName', new CustomPipeline());` * ``` * - * @method Phaser.Renderer.WebGL.PipelineManager#addPipeline + * and **not** like this: + * + * ```javascript + * this.add('yourName', CustomPipeline);` + * ``` + * + * To add a **Post Pipeline**, see `addPostPipeline` instead. + * + * @method Phaser.Renderer.WebGL.PipelineManager#add * @since 3.50.0 * * @param {string} name - A unique string-based key for the pipeline within the manager. @@ -174,11 +329,21 @@ var PipelineManager = new Class({ */ add: function (name, pipeline) { + if (pipeline.isPostFX) + { + console.warn(name + ' is a Post Pipeline. Use `addPostPipeline` instead'); + + return; + } + var pipelines = this.pipelines; var renderer = this.renderer; if (!pipelines.has(name)) { + pipeline.name = name; + pipeline.manager = this; + pipelines.set(name, pipeline); } else @@ -186,94 +351,52 @@ var PipelineManager = new Class({ console.warn('Pipeline exists: ' + name); } - pipeline.name = name; - if (!pipeline.hasBooted) { pipeline.boot(); } - pipeline.resize(renderer.width, renderer.height); + if (renderer.width !== 0 && renderer.height !== 0) + { + pipeline.resize(renderer.width, renderer.height); + } return pipeline; }, /** - * Resizes handler. + * Adds a Post Pipeline to this Pipeline Manager. * - * This is called automatically by the `WebGLRenderer` when the game resizes. + * Make sure to pass a base class to this method, not an instance. * - * @method Phaser.Renderer.WebGL.PipelineManager#resize + * For example, you should pass it like this: + * + * ```javascript + * this.addPostPipeline('yourName', CustomPipeline);` + * ``` + * + * and **not** like this: + * + * ```javascript + * this.addPostPipeline('yourName', new CustomPipeline());` + * ``` + * + * To add a regular pipeline, see the `add` method instead. + * + * @method Phaser.Renderer.WebGL.PipelineManager#addPostPipeline * @since 3.50.0 * - * @param {number} [width] - The new width of the renderer. - * @param {number} [height] - The new height of the renderer. + * @param {string} name - A unique string-based key for the pipeline within the manager. + * @param {function} pipeline - A pipeline class which must extend `PostFXPipeline`. + * + * @return {this} This Pipeline Manager. */ - resize: function (width, height) + addPostPipeline: function (name, pipeline) { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) + if (!this.postPipelineClasses.has(name)) { - pipelineInstance.resize(width, height); - }); - }, - - /** - * Calls the `onPreRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.preRender` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#preRender - * @since 3.50.0 - */ - preRender: function () - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onPreRender(); - }); - }, - - /** - * Calls the `onRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.render` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#render - * @since 3.50.0 - * - * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. - */ - render: function (scene, camera) - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onRender(scene, camera); - }); - }, - - /** - * Calls the `onPostRender` method on each pipeline in this manager. - * - * This is called automatically by the `WebGLRenderer.postRender` method. - * - * @method Phaser.Renderer.WebGL.PipelineManager#postRender - * @since 3.50.0 - */ - postRender: function () - { - var pipelines = this.pipelines; - - pipelines.each(function (pipelineName, pipelineInstance) - { - pipelineInstance.onPostRender(); - }); + this.postPipelineClasses.set(name, pipeline); + } }, /** @@ -291,39 +414,109 @@ var PipelineManager = new Class({ }, /** - * Checks if a pipeline is present in the Pipeline Manager. + * Checks if a pipeline is present in this Pipeline Manager. * * @method Phaser.Renderer.WebGL.PipelineManager#has * @since 3.50.0 * - * @param {string} name - The name of the pipeline to check for. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance to look-up. * * @return {boolean} `true` if the given pipeline is loaded, otherwise `false`. */ - has: function (name) + has: function (pipeline) { - return this.pipelines.has(name); + var pipelines = this.pipelines; + + if (typeof pipeline === 'string') + { + return pipelines.has(pipeline); + } + else if (pipelines.contains(pipeline)) + { + return true; + } + + return false; }, /** - * Returns the pipeline instance based on the given name. + * Returns the pipeline instance based on the given name, or instance. * - * If no instance exists in this manager, it returns `undefined` instead. + * If no instance, or matching name, exists in this manager, it returns `undefined`. * * @method Phaser.Renderer.WebGL.PipelineManager#get * @since 3.50.0 * - * @param {string} name - The name of the pipeline to get. + * @param {(string|Phaser.Renderer.WebGL.WebGLPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance to look-up. * * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline instance, or `undefined` if not found. */ - get: function (name) + get: function (pipeline) { - return this.pipelines.get(name); + var pipelines = this.pipelines; + + if (typeof pipeline === 'string') + { + return pipelines.get(pipeline); + } + else if (pipelines.contains(pipeline)) + { + return pipeline; + } }, /** - * Removes a pipeline based on the given name. + * Returns a _new instance_ of the post pipeline based on the given name, or class. + * + * If no instance, or matching name, exists in this manager, it returns `undefined`. + * + * @method Phaser.Renderer.WebGL.PipelineManager#getPostPipeline + * @since 3.50.0 + * + * @param {(string|function|Phaser.Renderer.WebGL.Pipelines.PostFXPipeline)} pipeline - Either the string-based name of the pipeline to get, or a pipeline instance, or class to look-up. + * @param {Phaser.GameObjects.GameObject} [gameObject] - If this post pipeline is being installed into a Game Object or Camera, this is a reference to it. + * + * @return {Phaser.Renderer.WebGL.Pipelines.PostFXPipeline} The pipeline instance, or `undefined` if not found. + */ + getPostPipeline: function (pipeline, gameObject) + { + var pipelineClasses = this.postPipelineClasses; + + var instance; + + if (typeof pipeline === 'string') + { + instance = pipelineClasses.get(pipeline); + } + else if (typeof pipeline === 'function') + { + // A class + if (pipelineClasses.contains(pipeline)) + { + instance = pipeline; + } + } + else if (typeof pipeline === 'object') + { + // Instance + instance = pipelineClasses.get(pipeline.name); + } + + if (instance) + { + var newPipeline = new instance(this.game); + + if (gameObject) + { + newPipeline.gameObject = gameObject; + } + + return newPipeline; + } + }, + + /** + * Removes a pipeline instance based on the given name. * * If no pipeline matches the name, this method does nothing. * @@ -334,10 +527,25 @@ var PipelineManager = new Class({ * @since 3.50.0 * * @param {string} name - The name of the pipeline to be removed. + * @param {boolean} [removeClass=true] - Remove the pipeline class as well as the instance? + * @param {boolean} [removePostPipelineClass=true] - Remove the post pipeline class as well as the instance? */ - remove: function (name) + remove: function (name, removeClass, removePostPipelineClass) { + if (removeClass === undefined) { removeClass = true; } + if (removePostPipelineClass === undefined) { removePostPipelineClass = true; } + this.pipelines.delete(name); + + if (removeClass) + { + this.classes.delete(name); + } + + if (removePostPipelineClass) + { + this.postPipelineClasses.delete(name); + } }, /** @@ -345,33 +553,39 @@ var PipelineManager = new Class({ * * This method accepts a pipeline instance as its parameter, not the name. * - * If the pipeline isn't already the current one, it will also call `resetTextures` on - * the `WebGLRenderer`. After this, `WebGLPipeline.bind` and then `onBind` are called. + * If the pipeline isn't already the current one it will call `WebGLPipeline.bind` and then `onBind`. + * + * You cannot set Post FX Pipelines using this method. To use a Post FX Pipeline, you should + * apply it to either a Camera, Container or other supporting Game Object. * * @method Phaser.Renderer.WebGL.PipelineManager#set * @since 3.50.0 * * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline instance to be set as current. * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. * - * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was set. + * @return {Phaser.Renderer.WebGL.WebGLPipeline} The pipeline that was set, or undefined if it couldn't be set. */ - set: function (pipeline, gameObject) + set: function (pipeline, gameObject, currentShader) { - var renderer = this.renderer; - var current = this.current; - - if ( - current !== pipeline || - current.vertexBuffer !== renderer.currentVertexBuffer || - current.program !== renderer.currentProgram - ) + if (pipeline.isPostFX) { - renderer.resetTextures(); + return; + } + + if (!this.isCurrent(pipeline, currentShader)) + { + this.flush(); + + if (this.current) + { + this.current.unbind(); + } this.current = pipeline; - pipeline.bind(); + pipeline.bind(currentShader); } pipeline.onBind(gameObject); @@ -379,6 +593,323 @@ var PipelineManager = new Class({ return pipeline; }, + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. It causes a batch + * flush, then calls the `preBatch` method on the post-fx pipelines belonging to the + * Game Object. + * + * @method Phaser.Renderer.WebGL.PipelineManager#preBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object about to be batched. + */ + preBatch: function (gameObject) + { + if (gameObject.hasPostPipeline) + { + this.flush(); + + var pipelines = gameObject.postPipelines; + + // Iterate in reverse because we need them stacked in the order they're in the array + for (var i = pipelines.length - 1; i >= 0; i--) + { + var pipeline = pipelines[i]; + + if (pipeline.active) + { + pipeline.preBatch(gameObject); + } + } + } + }, + + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. It causes a batch + * flush, then calls the `postBatch` method on the post-fx pipelines belonging to the + * Game Object. + * + * @method Phaser.Renderer.WebGL.PipelineManager#postBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object that was just added to the batch. + */ + postBatch: function (gameObject) + { + if (gameObject.hasPostPipeline) + { + this.flush(); + + var pipelines = gameObject.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.active) + { + pipeline.postBatch(gameObject); + } + } + } + }, + + /** + * Called at the start of the `WebGLRenderer.preRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `preBatch` method on the post-fx pipelines belonging to the Camera. + * + * @method Phaser.Renderer.WebGL.PipelineManager#preBatchCamera + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera about to be rendered. + */ + preBatchCamera: function (camera) + { + if (camera.hasPostPipeline) + { + this.flush(); + + var pipelines = camera.postPipelines; + + // Iterate in reverse because we need them stacked in the order they're in the array + for (var i = pipelines.length - 1; i >= 0; i--) + { + var pipeline = pipelines[i]; + + if (pipeline.active) + { + pipeline.preBatch(camera); + } + } + } + }, + + /** + * Called at the end of the `WebGLRenderer.postRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `postBatch` method on the post-fx pipelines belonging to the Camera. + * + * @method Phaser.Renderer.WebGL.PipelineManager#postBatchCamera + * @since 3.50.0 + * + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that was just rendered. + */ + postBatchCamera: function (camera) + { + if (camera.hasPostPipeline) + { + this.flush(); + + var pipelines = camera.postPipelines; + + for (var i = 0; i < pipelines.length; i++) + { + var pipeline = pipelines[i]; + + if (pipeline.active) + { + pipeline.postBatch(camera); + } + } + } + }, + + /** + * Checks to see if the given pipeline is already the active pipeline, both within this + * Pipeline Manager and also has the same shader set in the Renderer. + * + * @method Phaser.Renderer.WebGL.PipelineManager#isCurrent + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline instance to be checked. + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {boolean} `true` if the given pipeline is already the current pipeline, otherwise `false`. + */ + isCurrent: function (pipeline, currentShader) + { + var renderer = this.renderer; + var current = this.current; + + if (current && !currentShader) + { + currentShader = current.currentShader; + } + + return !(current !== pipeline || currentShader.program !== renderer.currentProgram); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * The copy itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.copyShader); + + pipeline.copyFrame(source, target, brightness, clear, clearAlpha); + + return this; + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.PipelineManager#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.copyShader); + + pipeline.copyToGame(source); + + return this; + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * The copy itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Display.ColorMatrix} [colorMatrix] - The Color Matrix to use when performing the draw. + * + * @return {this} This Pipeline Manager instance. + */ + drawFrame: function (source, target, clearAlpha, colorMatrix) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader); + + pipeline.drawFrame(source, target, clearAlpha, colorMatrix); + + return this; + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + blendFrames: function (source1, source2, target, strength, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.linearShader); + + pipeline.blendFrames(source1, source2, target, strength, clearAlpha); + + return this; + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * + * @return {this} This Pipeline Manager instance. + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + var pipeline = this.setUtility(this.UTILITY_PIPELINE.addShader); + + pipeline.blendFrames(source1, source2, target, strength, clearAlpha); + + return this; + }, + + /** + * Clears the given Render Target. + * + * @method Phaser.Renderer.WebGL.PipelineManager#clearFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to clear. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + clearFrame: function (target, clearAlpha) + { + this.UTILITY_PIPELINE.clearFrame(target, clearAlpha); + + return this; + }, + + /** + * Returns `true` if the current pipeline is forced to use texture unit zero. + * + * @method Phaser.Renderer.WebGL.PipelineManager#forceZero + * @since 3.50.0 + * + * @return {boolean} `true` if the current pipeline is forced to use texture unit zero. + */ + forceZero: function () + { + return (this.current && this.current.forceZero); + }, + /** * Sets the Multi Pipeline to be the currently bound pipeline. * @@ -394,6 +925,21 @@ var PipelineManager = new Class({ return this.set(this.MULTI_PIPELINE); }, + /** + * Sets the Utility Pipeline to be the currently bound pipeline. + * + * @method Phaser.Renderer.WebGL.PipelineManager#setUtility + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. + * + * @return {Phaser.Renderer.WebGL.Pipelines.UtilityPipeline} The Utility Pipeline instance. + */ + setUtility: function (currentShader) + { + return this.UTILITY_PIPELINE.bind(currentShader); + }, + /** * Use this to reset the gl context to the state that Phaser requires to continue rendering. * @@ -421,11 +967,6 @@ var PipelineManager = new Class({ pipeline = this.previous; } - if (!pipeline) - { - return; - } - var renderer = this.renderer; var gl = renderer.gl; @@ -446,17 +987,17 @@ var PipelineManager = new Class({ gl.viewport(0, 0, renderer.width, renderer.height); renderer.currentProgram = null; - renderer.currentVertexBuffer = null; - renderer.currentIndexBuffer = null; renderer.setBlendMode(0, true); + if (pipeline) + { + this.current = pipeline; + + pipeline.rebind(); + } + renderer.resetTextures(); - - this.current = pipeline; - - pipeline.bind(true); - pipeline.onBind(); }, /** @@ -477,12 +1018,18 @@ var PipelineManager = new Class({ this.flush(); - this.previous = this.current; - this.current = null; + if (this.current) + { + this.current.unbind(); + this.previous = this.current; + this.current = null; + } + else + { + this.previous = null; + } renderer.currentProgram = null; - renderer.currentVertexBuffer = null; - renderer.currentIndexBuffer = null; renderer.setBlendMode(0, true); }, @@ -497,10 +1044,14 @@ var PipelineManager = new Class({ { this.flush(); + this.classes.clear(); + this.postPipelineClasses.clear(); this.pipelines.clear(); this.renderer = null; this.game = null; + this.classes = null; + this.postPipelineClasses = null; this.pipelines = null; this.current = null; this.previous = null; diff --git a/src/renderer/webgl/RenderTarget.js b/src/renderer/webgl/RenderTarget.js new file mode 100644 index 000000000..22ed74983 --- /dev/null +++ b/src/renderer/webgl/RenderTarget.js @@ -0,0 +1,348 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../utils/Class'); +var Events = require('../events'); + +/** + * @classdesc + * A Render Target encapsulates a WebGL framebuffer and the WebGL Texture that displays it. + * + * Instances of this class are typically created by, and belong to WebGL Pipelines, however + * other Game Objects and classes can take advantage of Render Targets as well. + * + * @class RenderTarget + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the WebGLRenderer. + * @param {number} width - The width of this Render Target. + * @param {number} height - The height of this Render Target. + * @param {number} [scale=1] - A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. + * @param {number} [minFilter=0] - The minFilter mode of the texture when created. 0 is `LINEAR`, 1 is `NEAREST`. + * @param {boolean} [autoClear=true] - Automatically clear this framebuffer when bound? + * @param {boolean} [autoResize=false] - Automatically resize this Render Target if the WebGL Renderer resizes? + */ +var RenderTarget = new Class({ + + initialize: + + function RenderTarget (renderer, width, height, scale, minFilter, autoClear, autoResize) + { + if (scale === undefined) { scale = 1; } + if (minFilter === undefined) { minFilter = 0; } + if (autoClear === undefined) { autoClear = true; } + if (autoResize === undefined) { autoResize = false; } + + /** + * A reference to the WebGLRenderer instance. + * + * @name Phaser.Renderer.WebGL.RenderTarget#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.50.0 + */ + this.renderer = renderer; + + /** + * The WebGLFramebuffer of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#framebuffer + * @type {WebGLFramebuffer} + * @since 3.50.0 + */ + this.framebuffer = null; + + /** + * The WebGLTexture of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#texture + * @type {WebGLTexture} + * @since 3.50.0 + */ + this.texture = null; + + /** + * The width of the texture. + * + * @name Phaser.Renderer.WebGL.RenderTarget#width + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.width = 0; + + /** + * The height of the texture. + * + * @name Phaser.Renderer.WebGL.RenderTarget#height + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.height = 0; + + /** + * A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. + * + * A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc. + * + * @name Phaser.Renderer.WebGL.RenderTarget#scale + * @type {number} + * @since 3.50.0 + */ + this.scale = scale; + + /** + * The minFilter mode of the texture. 0 is `LINEAR`, 1 is `NEAREST`. + * + * @name Phaser.Renderer.WebGL.RenderTarget#minFilter + * @type {number} + * @since 3.50.0 + */ + this.minFilter = minFilter; + + /** + * Controls if this Render Target is automatically cleared (via `gl.COLOR_BUFFER_BIT`) + * during the `RenderTarget.bind` method. + * + * If you need more control over how, or if, the target is cleared, you can disable + * this via the config on creation, or even toggle it directly at runtime. + * + * @name Phaser.Renderer.WebGL.RenderTarget#autoClear + * @type {boolean} + * @since 3.50.0 + */ + this.autoClear = autoClear; + + /** + * Does this Render Target automatically resize when the WebGL Renderer does? + * + * Modify this property via the `setAutoResize` method. + * + * @name Phaser.Renderer.WebGL.RenderTarget#autoResize + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.autoResize = false; + + this.resize(width, height); + + if (autoResize) + { + this.setAutoResize(true); + } + }, + + /** + * Sets if this Render Target should automatically resize when the WebGL Renderer + * emits a resize event. + * + * @method Phaser.Renderer.WebGL.RenderTarget#setAutoResize + * @since 3.50.0 + * + * @param {boolean} autoResize - Automatically resize this Render Target when the WebGL Renderer resizes? + * + * @return {this} This RenderTarget instance. + */ + setAutoResize: function (autoResize) + { + if (autoResize && !this.autoResize) + { + this.renderer.on(Events.RESIZE, this.resize, this); + + this.autoResize = true; + } + else if (!autoResize && this.autoResize) + { + this.renderer.off(Events.RESIZE, this.resize, this); + + this.autoResize = false; + } + + return this; + }, + + /** + * Resizes this Render Target. + * + * Deletes both the frame buffer and texture, if they exist and then re-creates + * them using the new sizes. + * + * This method is called automatically by the pipeline during its resize handler. + * + * @method Phaser.Renderer.WebGL.RenderTarget#resize + * @since 3.50.0 + * + * @param {number} width - The new width of this Render Target. + * @param {number} height - The new height of this Render Target. + * + * @return {this} This RenderTarget instance. + */ + resize: function (width, height) + { + var renderer = this.renderer; + + renderer.deleteFramebuffer(this.framebuffer); + + renderer.deleteTexture(this.texture); + + width *= this.scale; + height *= this.scale; + + this.texture = renderer.createTextureFromSource(null, width, height, this.minFilter); + this.framebuffer = renderer.createFramebuffer(width, height, this.texture, false); + + this.width = width; + this.height = height; + + return this; + }, + + /** + * Pushes this Render Target as the current frame buffer of the renderer. + * + * If `autoClear` is set, then clears the texture. + * + * If `adjustViewport` is `true` then it will flush the renderer and then adjust the GL viewport. + * + * @method Phaser.Renderer.WebGL.RenderTarget#bind + * @since 3.50.0 + * + * @param {boolean} [adjustViewport=false] - Adjust the GL viewport by calling `RenderTarget.adjustViewport` ? + */ + bind: function (adjustViewport) + { + if (adjustViewport === undefined) { adjustViewport = false; } + + if (adjustViewport) + { + this.renderer.flush(); + } + + this.renderer.pushFramebuffer(this.framebuffer, false, false, false); + + if (this.autoClear) + { + var gl = this.renderer.gl; + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + if (adjustViewport) + { + this.adjustViewport(); + } + }, + + /** + * Adjusts the GL viewport to match the WebGL Renderer width and height, + * with a y offset of `RenderTarget.height` - `WebGLRenderer.height`. + * + * @method Phaser.Renderer.WebGL.RenderTarget#adjustViewport + * @since 3.50.0 + */ + adjustViewport: function () + { + var renderer = this.renderer; + + var textureWidth = this.width; + var textureHeight = this.height; + + renderer.gl.viewport(0, 0, textureWidth, textureHeight); + renderer.gl.disable(renderer.gl.SCISSOR_TEST); + }, + + /** + * Clears this Render Target. + * + * @method Phaser.Renderer.WebGL.RenderTarget#clear + * @since 3.50.0 + */ + clear: function () + { + this.renderer.pushFramebuffer(this.framebuffer); + + var gl = this.renderer.gl; + + gl.clearColor(0, 0, 0, 0); + + gl.clear(gl.COLOR_BUFFER_BIT); + + this.renderer.popFramebuffer(); + }, + + /** + * Unbinds this Render Target and optionally flushes the WebGL Renderer first. + * + * @name Phaser.Renderer.WebGL.RenderTarget#unbind + * @since 3.50.0 + * + * @param {boolean} [flush=false] - Flush the WebGL Renderer before unbinding? + * + * @return {WebGLFramebuffer} The Framebuffer that was set, or `null` if there aren't any more in the stack. + */ + unbind: function (flush) + { + if (flush === undefined) { flush = false; } + + var renderer = this.renderer; + + if (flush) + { + renderer.flush(); + + renderer.gl.enable(renderer.gl.SCISSOR_TEST); + + var scissor = renderer.currentScissor; + + if (scissor) + { + var x = scissor[0]; + var y = scissor[1]; + var width = scissor[2]; + var height = scissor[3]; + + renderer.gl.scissor(x, (renderer.drawingBufferHeight - y - height), width, height); + } + } + + return renderer.popFramebuffer(); + }, + + /** + * Removes all external references from this class and deletes the + * WebGL framebuffer and texture instances. + * + * Does not remove this Render Target from the parent pipeline. + * + * @name Phaser.Renderer.WebGL.RenderTarget#destroy + * @since 3.50.0 + */ + destroy: function () + { + var renderer = this.renderer; + + renderer.deleteFramebuffer(this.framebuffer); + renderer.deleteTexture(this.texture); + + renderer.off(Events.RESIZE, this.resize, this); + + this.renderer = null; + this.framebuffer = null; + this.texture = null; + } + +}); + +module.exports = RenderTarget; diff --git a/src/renderer/webgl/Utils.js b/src/renderer/webgl/Utils.js index c6576e545..e9d7ccfd7 100644 --- a/src/renderer/webgl/Utils.js +++ b/src/renderer/webgl/Utils.js @@ -123,38 +123,6 @@ module.exports = { return [ ur / 255, ug / 255, ub / 255 ]; }, - /** - * Counts how many attributes of 32 bits a vertex has - * - * @function Phaser.Renderer.WebGL.Utils.getComponentCount - * @since 3.0.0 - * - * @param {array} attributes - Array of attributes - * @param {WebGLRenderingContext} glContext - WebGLContext used for check types - * - * @return {number} Count of 32 bit attributes in vertex - */ - getComponentCount: function (attributes, glContext) - { - var count = 0; - - for (var index = 0; index < attributes.length; ++index) - { - var element = attributes[index]; - - if (element.type === glContext.FLOAT) - { - count += element.size; - } - else - { - count += 1; - } - } - - return count; - }, - /** * Check to see how many texture units the GPU supports, based on the given config value. * Then tests this against the maximum number of iterations GLSL can support. @@ -221,6 +189,11 @@ module.exports = { */ parseFragmentShaderMaxTextures: function (fragmentShaderSource, maxTextures) { + if (!fragmentShaderSource) + { + return ''; + } + var src = ''; for (var i = 0; i < maxTextures; i++) diff --git a/src/renderer/webgl/WebGLPipeline.js b/src/renderer/webgl/WebGLPipeline.js index 1e6c53e6a..98f0a1934 100644 --- a/src/renderer/webgl/WebGLPipeline.js +++ b/src/renderer/webgl/WebGLPipeline.js @@ -1,21 +1,26 @@ /** * @author Richard Davey - * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Class = require('../../utils/Class'); +var DeepCopy = require('../../utils/object/DeepCopy'); +var EventEmitter = require('eventemitter3'); +var Events = require('./pipelines/events'); var GetFastValue = require('../../utils/object/GetFastValue'); +var Matrix4 = require('../../math/Matrix4'); +var RendererEvents = require('../events'); +var RenderTarget = require('./RenderTarget'); var Utils = require('./Utils'); +var WebGLShader = require('./WebGLShader'); /** * @classdesc - * * The `WebGLPipeline` is a base class used by all of the core Phaser pipelines. * * It describes the way elements will be rendered in WebGL. Internally, it handles - * compiling the shaders, creating vertex buffers, assigning primitive topolgy and + * compiling the shaders, creating vertex buffers, assigning primitive topology and * binding vertex attributes, all based on the given configuration data. * * The pipeline is configured by passing in a `WebGLPipelineConfig` object. Please @@ -23,9 +28,20 @@ var Utils = require('./Utils'); * available to you. * * Usually, you would not extend from this class directly, but would instead extend - * from one of the core pipelines, such as the Multi Pipeline or Rope Pipeline. + * from one of the core pipelines, such as the Multi Pipeline. + * + * The pipeline flow per render-step is as follows: + * + * 1) onPreRender - called once at the start of the render step + * 2) onRender - call for each Scene Camera that needs to render (so can be multiple times per render step) + * 3) Internal flow: + * 3a) bind (only called if a Game Object is using this pipeline and it's not currently active) + * 3b) onBind (called for every Game Object that uses this pipeline) + * 3c) flush (can be called by a Game Object, internal method or from outside by changing pipeline) + * 4) onPostRender - called once at the end of the render step * * @class WebGLPipeline + * @extends Phaser.Events.EventEmitter * @memberof Phaser.Renderer.WebGL * @constructor * @since 3.0.0 @@ -34,16 +50,20 @@ var Utils = require('./Utils'); */ var WebGLPipeline = new Class({ + Extends: EventEmitter, + initialize: function WebGLPipeline (config) { + EventEmitter.call(this); + var game = config.game; var renderer = game.renderer; var gl = renderer.gl; /** - * Name of the pipeline. Used for identification. + * Name of the pipeline. Used for identification and setting from Game Objects. * * @name Phaser.Renderer.WebGL.WebGLPipeline#name * @type {string} @@ -69,6 +89,18 @@ var WebGLPipeline = new Class({ */ this.renderer = renderer; + /** + * A reference to the WebGL Pipeline Manager. + * + * This is initially undefined and only set when this pipeline is added + * to the manager. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#manager + * @type {?Phaser.Renderer.WebGL.PipelineManager} + * @since 3.50.0 + */ + this.manager; + /** * The WebGL context this WebGL Pipeline uses. * @@ -116,93 +148,46 @@ var WebGLPipeline = new Class({ this.vertexCount = 0; /** - * The total number of vertices that the pipeline batch can hold before it will flush. - * This defaults to `batchSize * 6`, where `batchSize` is defined in the Renderer Config. + * The total number of vertices that this pipeline batch can hold before it will flush. + * + * This defaults to `renderer batchSize * 6`, where `batchSize` is defined in the Renderer Game Config. * * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexCapacity - * @type {integer} + * @type {number} * @since 3.0.0 */ - this.vertexCapacity = GetFastValue(config, 'vertexCapacity', renderer.config.batchSize * 6); - - /** - * The size, in bytes, of a single vertex. - * - * This is derived by adding together all of the vertex attributes. - * - * For example, the Multi Pipeline has the following attributes: - * - * inPosition - (size 2 x gl.FLOAT) = 8 - * inTexCoord - (size 2 x gl.FLOAT) = 8 - * inTexId - (size 1 x gl.FLOAT) = 4 - * inTintEffect - (size 1 x gl.FLOAT) = 4 - * inTint - (size 4 x gl.UNSIGNED_BYTE) = 4 - * - * The total is 8 + 8 + 4 + 4 + 4 = 28, which is the default for this property. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexSize - * @type {integer} - * @since 3.0.0 - */ - this.vertexSize = GetFastValue(config, 'vertexSize', 28); + this.vertexCapacity = 0; /** * Raw byte buffer of vertices. * + * Either set via the config object `vertices` property, or generates a new Array Buffer of + * size `vertexCapacity * vertexSize`. + * * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexData * @type {ArrayBuffer} + * @readonly * @since 3.0.0 */ - this.vertexData = GetFastValue(config, 'vertices', new ArrayBuffer(this.vertexCapacity * this.vertexSize)); + this.vertexData; /** * The WebGLBuffer that holds the vertex data. - * Created from the `vertices` config ArrayBuffer that was passed in, or set by default, by the pipeline. + * + * Created from the `vertexData` ArrayBuffer. If `vertices` are set in the config, a `STATIC_DRAW` buffer + * is created. If not, a `DYNAMIC_DRAW` buffer is created. * * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexBuffer * @type {WebGLBuffer} + * @readonly * @since 3.0.0 */ - if (GetFastValue(config, 'vertices', null)) - { - this.vertexBuffer = this.renderer.createVertexBuffer(this.vertexData, this.gl.STREAM_DRAW); - } - else - { - this.vertexBuffer = this.renderer.createVertexBuffer(this.vertexData.byteLength, this.gl.STREAM_DRAW); - } - - /** - * The handle to a WebGL program. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#program - * @type {WebGLProgram} - * @since 3.0.0 - */ - this.program = this.renderer.createProgram(config.vertShader, config.fragShader); - - /** - * Array of objects that describe the vertex attributes. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#attributes - * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig} - * @since 3.0.0 - */ - this.attributes = config.attributes; - - /** - * Array of objects that describe the shader uniforms. - * This is populated with their locations when the shader is created. - * - * @name Phaser.Renderer.WebGL.WebGLPipeline#uniforms - * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineUniformsConfig} - * @since 3.50.0 - */ - this.uniforms = {}; + this.vertexBuffer; /** * The primitive topology which the pipeline will use to submit draw calls. - * Defaults to GL_TRIANGLES if not otherwise set. + * + * Defaults to GL_TRIANGLES if not otherwise set in the config. * * @name Phaser.Renderer.WebGL.WebGLPipeline#topology * @type {GLenum} @@ -211,48 +196,49 @@ var WebGLPipeline = new Class({ this.topology = GetFastValue(config, 'topology', gl.TRIANGLES); /** - * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources to the GPU. + * Uint8 view to the `vertexData` ArrayBuffer. Used for uploading vertex buffer resources to the GPU. * * @name Phaser.Renderer.WebGL.WebGLPipeline#bytes * @type {Uint8Array} * @since 3.0.0 */ - this.bytes = new Uint8Array(this.vertexData); + this.bytes; /** - * This will store the amount of components of 32 bit length. + * Float32 view of the array buffer containing the pipeline's vertices. * - * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexComponentCount - * @type {integer} + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexViewF32 + * @type {Float32Array} * @since 3.0.0 */ - this.vertexComponentCount = Utils.getComponentCount(this.attributes, gl); + this.vertexViewF32; /** - * Indicates if the current pipeline is flushing the contents to the GPU. - * When the variable is set the flush function will be locked. + * Uint32 view of the array buffer containing the pipeline's vertices. * - * @name Phaser.Renderer.WebGL.WebGLPipeline#flushLocked - * @type {boolean} - * @since 3.1.0 + * @name Phaser.Renderer.WebGL.WebGLPipeline#vertexViewU32 + * @type {Uint32Array} + * @since 3.0.0 */ - this.flushLocked = false; + this.vertexViewU32; /** - * Indicates if the current pipeline is active or not for this frame only. - * Reset in the onRender method. + * Indicates if the current pipeline is active, or not. + * + * Toggle this property to enable or disable a pipeline from rendering anything. * * @name Phaser.Renderer.WebGL.WebGLPipeline#active * @type {boolean} * @since 3.10.0 */ - this.active = false; + this.active = true; /** * Holds the most recently assigned texture unit. + * * Treat this value as read-only. * - * @name Phaser.Renderer.WebGL.Pipelines.WebGLPipeline#currentUnit + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentUnit * @type {number} * @since 3.50.0 */ @@ -260,16 +246,20 @@ var WebGLPipeline = new Class({ /** * Some pipelines require the forced use of texture zero (like the light pipeline). - * This boolean should be set when that is the case. + * + * This property should be set when that is the case. * * @name Phaser.Renderer.WebGL.WebGLPipeline#forceZero * @type {boolean} * @since 3.50.0 */ - this.forceZero = false; + this.forceZero = GetFastValue(config, 'forceZero', false); /** - * Indicates if the current pipeline has booted or not. + * Indicates if this pipeline has booted or not. + * + * A pipeline boots only when the Game instance itself, and all associated systems, is + * fully ready. * * @name Phaser.Renderer.WebGL.WebGLPipeline#hasBooted * @type {boolean} @@ -278,32 +268,373 @@ var WebGLPipeline = new Class({ */ this.hasBooted = false; - if (config.uniforms) - { - this.setUniformLocations(config.uniforms); - } + /** + * Indicates if this is a Post FX Pipeline, or not. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#isPostFX + * @type {boolean} + * @readonly + * @since 3.50.0 + */ + this.isPostFX = false; + + /** + * An array of RenderTarget instances that belong to this pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#renderTargets + * @type {Phaser.Renderer.WebGL.RenderTarget[]} + * @since 3.50.0 + */ + this.renderTargets = []; + + /** + * A reference to the currently bound Render Target instance from the `WebGLPipeline.renderTargets` array. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentRenderTarget + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.currentRenderTarget; + + /** + * An array of all the WebGLShader instances that belong to this pipeline. + * + * Shaders manage their own attributes and uniforms, but share the same vertex data buffer, + * which belongs to this pipeline. + * + * Shaders are set in a call to the `setShadersFromConfig` method, which happens automatically, + * but can also be called at any point in your game. See the method documentation for details. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#shaders + * @type {Phaser.Renderer.WebGL.WebGLShader[]} + * @since 3.50.0 + */ + this.shaders = []; + + /** + * A reference to the currently bound WebGLShader instance from the `WebGLPipeline.shaders` array. + * + * For lots of pipelines, this is the only shader, so it is a quick way to reference it without + * an array look-up. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#currentShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.currentShader; + + /** + * The Projection matrix, used by shaders as 'uProjectionMatrix' uniform. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#projectionMatrix + * @type {Phaser.Math.Matrix4} + * @since 3.50.0 + */ + this.projectionMatrix; + + /** + * The configuration object that was used to create this pipeline. + * + * Treat this object as 'read only', because changing it post-creation will not + * impact this pipeline in any way. However, it is used internally for cloning + * and post-boot set-up. + * + * @name Phaser.Renderer.WebGL.WebGLPipeline#config + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} + * @since 3.50.0 + */ + this.config = config; }, /** * Called when the Game has fully booted and the Renderer has finished setting up. * - * By this stage all Game level systems are now in place and you can perform any final - * tasks that the pipeline may need that relied on game systems such as the Texture Manager. + * By this stage all Game level systems are now in place. You can perform any final tasks that the + * pipeline may need, that relies on game systems such as the Texture Manager being ready. * * @method Phaser.Renderer.WebGL.WebGLPipeline#boot + * @fires Phaser.Renderer.WebGL.Pipelines.Events#BOOT * @since 3.11.0 */ boot: function () { + var i; + var gl = this.gl; + var config = this.config; var renderer = this.renderer; - renderer.setProgram(this.program); - renderer.setVertexBuffer(this.vertexBuffer); + if (!this.isPostFX) + { + this.projectionMatrix = new Matrix4().identity(); + } - this.setAttribPointers(true); + // Create the Render Targets + + var renderTargets = this.renderTargets; + + var targets = GetFastValue(config, 'renderTarget', false); + + // If boolean, set to number = 1 + if (typeof(targets) === 'boolean' && targets) + { + targets = 1; + } + + var width = renderer.width; + var height = renderer.height; + + if (typeof(targets) === 'number') + { + // Create this many default RTs + for (i = 0; i < targets; i++) + { + renderTargets.push(new RenderTarget(renderer, width, height, 1, 0, true)); + } + } + else if (Array.isArray(targets)) + { + for (i = 0; i < targets.length; i++) + { + var scale = GetFastValue(targets[i], 'scale', 1); + var minFilter = GetFastValue(targets[i], 'minFilter', 0); + var autoClear = GetFastValue(targets[i], 'autoClear', 1); + + renderTargets.push(new RenderTarget(renderer, width, height, scale, minFilter, autoClear)); + } + } + + if (renderTargets.length) + { + // Default to the first one in the array + this.currentRenderTarget = renderTargets[0]; + } + + // Create the Shaders + + this.setShadersFromConfig(config); + + // Which shader has the largest vertex size? + var shaders = this.shaders; + var vertexSize = 0; + + for (i = 0; i < shaders.length; i++) + { + if (shaders[i].vertexSize > vertexSize) + { + vertexSize = shaders[i].vertexSize; + } + } + + var batchSize = GetFastValue(config, 'batchSize', renderer.config.batchSize); + + // * 6 because there are 6 vertices in a quad and 'batchSize' represents the quantity of quads in the batch + + this.vertexCapacity = batchSize * 6; + + var data = new ArrayBuffer(this.vertexCapacity * vertexSize); + + this.vertexData = data; + this.bytes = new Uint8Array(data); + this.vertexViewF32 = new Float32Array(data); + this.vertexViewU32 = new Uint32Array(data); + + var configVerts = GetFastValue(config, 'vertices', null); + + if (configVerts) + { + this.vertexViewF32.set(configVerts); + + this.vertexBuffer = renderer.createVertexBuffer(data, gl.STATIC_DRAW); + } + else + { + this.vertexBuffer = renderer.createVertexBuffer(data.byteLength, gl.DYNAMIC_DRAW); + } + + // Set-up shaders + + this.setVertexBuffer(); + + for (i = shaders.length - 1; i >= 0; i--) + { + shaders[i].rebind(); + } this.hasBooted = true; + renderer.on(RendererEvents.RESIZE, this.resize, this); + renderer.on(RendererEvents.PRE_RENDER, this.onPreRender, this); + renderer.on(RendererEvents.RENDER, this.onRender, this); + renderer.on(RendererEvents.POST_RENDER, this.onPostRender, this); + + this.emit(Events.BOOT, this); + + this.onBoot(); + }, + + /** + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBoot + * @since 3.50.0 + */ + onBoot: function () + { + }, + + /** + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. It's also called if the renderer + * changes size. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onResize + * @since 3.50.0 + * + * @param {number} width - The new width of this WebGL Pipeline. + * @param {number} height - The new height of this WebGL Pipeline. + */ + onResize: function () + { + }, + + /** + * Sets the currently active shader within this pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setShader + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLShader} shader - The shader to set as being current. + * @param {boolean} [setAttributes=false] - Should the vertex attribute pointers be set? + * + * @return {this} This WebGLPipeline instance. + */ + setShader: function (shader, setAttributes) + { + var renderer = this.renderer; + + if (shader !== this.currentShader || renderer.currentProgram !== this.currentShader.program) + { + this.flush(); + + renderer.resetTextures(); + + var wasBound = this.setVertexBuffer(); + + if (wasBound && !setAttributes) + { + setAttributes = true; + } + + shader.bind(setAttributes, false); + + this.currentShader = shader; + } + + return this; + }, + + /** + * Searches all shaders in this pipeline for one matching the given name, then returns it. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#getShaderByName + * @since 3.50.0 + * + * @param {string} name - The index of the shader to set. + * + * @return {Phaser.Renderer.WebGL.WebGLShader} The WebGLShader instance, if found. + */ + getShaderByName: function (name) + { + var shaders = this.shaders; + + for (var i = 0; i < shaders.length; i++) + { + if (shaders[i].name === name) + { + return shaders[i]; + } + } + }, + + /** + * Destroys all shaders currently set in the `WebGLPipeline.shaders` array and then parses the given + * `config` object, extracting the shaders from it, creating `WebGLShader` instances and finally + * setting them into the `shaders` array of this pipeline. + * + * This is a destructive process. Be very careful when you call it, should you need to. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setShadersFromConfig + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration object for this WebGL Pipeline. + * + * @return {this} This WebGLPipeline instance. + */ + setShadersFromConfig: function (config) + { + var i; + var shaders = this.shaders; + var renderer = this.renderer; + + for (i = 0; i < shaders.length; i++) + { + shaders[i].destroy(); + } + + var vName = 'vertShader'; + var fName = 'fragShader'; + var aName = 'attributes'; + + var defaultVertShader = GetFastValue(config, vName, null); + var defaultFragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(config, fName, null), renderer.maxTextures); + var defaultAttribs = GetFastValue(config, aName, null); + + var configShaders = GetFastValue(config, 'shaders', []); + + var len = configShaders.length; + + if (len === 0) + { + if (defaultVertShader && defaultFragShader) + { + this.shaders = [ new WebGLShader(this, 'default', defaultVertShader, defaultFragShader, DeepCopy(defaultAttribs)) ]; + } + } + else + { + var newShaders = []; + + for (i = 0; i < len; i++) + { + var shaderEntry = configShaders[i]; + + var name = GetFastValue(shaderEntry, 'name', 'default'); + + var vertShader = GetFastValue(shaderEntry, vName, defaultVertShader); + var fragShader = Utils.parseFragmentShaderMaxTextures(GetFastValue(shaderEntry, fName, defaultFragShader), renderer.maxTextures); + var attributes = GetFastValue(shaderEntry, aName, defaultAttribs); + + if (vertShader && fragShader) + { + newShaders.push(new WebGLShader(this, name, vertShader, fragShader, DeepCopy(attributes))); + } + } + + this.shaders = newShaders; + } + + if (this.shaders.length === 0) + { + console.warn('Pipeline: ' + this.name + ' - Invalid shader config'); + } + else + { + this.currentShader = this.shaders[0]; + } + return this; }, @@ -311,7 +642,7 @@ var WebGLPipeline = new Class({ * Custom pipelines can use this method in order to perform any required pre-batch tasks * for the given Game Object. It must return the texture unit the Game Object was assigned. * - * @method Phaser.Renderer.WebGL.Pipelines.WebGLPipeline#setGameObject + * @method Phaser.Renderer.WebGL.WebGLPipeline#setGameObject * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. @@ -328,37 +659,6 @@ var WebGLPipeline = new Class({ return this.currentUnit; }, - /** - * Adds a description of vertex attribute to the pipeline - * - * @method Phaser.Renderer.WebGL.WebGLPipeline#addAttribute - * @since 3.2.0 - * - * @param {string} name - Name of the vertex attribute - * @param {integer} size - Vertex component size - * @param {integer} type - Type of the attribute - * @param {boolean} normalized - Is the value normalized to a range - * @param {integer} offset - Byte offset to the beginning of the first element in the vertex - * - * @return {this} This WebGLPipeline instance. - */ - addAttribute: function (name, size, type, normalized, offset) - { - this.attributes.push({ - name: name, - size: size, - type: this.renderer.glFormats[type], - normalized: normalized, - offset: offset, - enabled: false, - location: -1 - }); - - this.vertexComponentCount = Utils.getComponentCount(this.attributes, this.gl); - - return this; - }, - /** * Check if the current batch of vertices is full. * @@ -369,7 +669,7 @@ var WebGLPipeline = new Class({ * @method Phaser.Renderer.WebGL.WebGLPipeline#shouldFlush * @since 3.0.0 * - * @param {integer} [amount=0] - Will the batch need to flush if this many vertices are added to it? + * @param {number} [amount=0] - Will the batch need to flush if this many vertices are added to it? * * @return {boolean} `true` if the current batch should be flushed, otherwise `false`. */ @@ -377,13 +677,16 @@ var WebGLPipeline = new Class({ { if (amount === undefined) { amount = 0; } - return (this.vertexCount + amount >= this.vertexCapacity); + return (this.vertexCount + amount > this.vertexCapacity); }, /** - * Resizes the properties used to describe the viewport + * Resizes the properties used to describe the viewport. + * + * This method is called automatically by the renderer during its resize handler. * * @method Phaser.Renderer.WebGL.WebGLPipeline#resize + * @fires Phaser.Renderer.WebGL.Pipelines.Events#RESIZE * @since 3.0.0 * * @param {number} width - The new width of this WebGL Pipeline. @@ -393,269 +696,818 @@ var WebGLPipeline = new Class({ */ resize: function (width, height) { + if (width !== this.width || height !== this.height) + { + this.flush(); + } + this.width = width; this.height = height; + var targets = this.renderTargets; + + for (var i = 0; i < targets.length; i++) + { + targets[i].resize(width, height); + } + + this.setProjectionMatrix(width, height, false); + + this.emit(Events.RESIZE, width, height, this); + + this.onResize(width, height); + return this; }, /** - * Binds the pipeline resources, including the program, vertex buffer and attribute pointers. + * Adjusts this pipelines ortho Projection Matrix to use the given diemsions + * and reets the `uProjectionMatrix` uniform on all bound shaders. + * + * This method is called automatically by the renderer during its resize handler. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setProjectionMatrix + * @since 3.50.0 + * + * @param {number} width - The new width of this WebGL Pipeline. + * @param {number} height - The new height of this WebGL Pipeline. + * + * @return {this} This WebGLPipeline instance. + */ + setProjectionMatrix: function (width, height) + { + var projectionMatrix = this.projectionMatrix; + + // Because Post FX Pipelines don't have them + if (projectionMatrix) + { + projectionMatrix.ortho(0, width, height, 0, -1000, 1000); + } + + var shaders = this.shaders; + + var name = 'uProjectionMatrix'; + + for (var i = 0; i < shaders.length; i++) + { + var shader = shaders[i]; + + if (shader.hasUniform(name)) + { + shader.resetUniform(name); + + shader.setMatrix4fv(name, false, projectionMatrix.val, shader); + } + } + + return this; + }, + + /** + * This method is called every time the Pipeline Manager makes this pipeline the currently active one. + * + * It binds the resources and shader needed for this pipeline, including setting the vertex buffer + * and attribute pointers. * * @method Phaser.Renderer.WebGL.WebGLPipeline#bind + * @fires Phaser.Renderer.WebGL.Pipelines.Events#BIND * @since 3.0.0 * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to set as being current. * * @return {this} This WebGLPipeline instance. */ - bind: function (reset) + bind: function (currentShader) { - if (reset === undefined) { reset = false; } + if (currentShader === undefined) { currentShader = this.currentShader; } - var vertexBuffer = this.vertexBuffer; - var program = this.program; - var renderer = this.renderer; + var wasBound = this.setVertexBuffer(); - renderer.setProgram(program); - renderer.setVertexBuffer(vertexBuffer); + currentShader.bind(wasBound); - this.setAttribPointers(reset); + this.currentShader = currentShader; + + this.emit(Events.BIND, this, currentShader); + + this.onActive(currentShader); return this; }, /** - * Sets up the `WebGLPipeline.uniforms` object, populating it with the names - * and locations of the shader uniforms. + * This method is called every time the Pipeline Manager rebinds this pipeline. * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setUniformLocations - * @since 3.50.0 + * It resets all shaders this pipeline uses, setting their attributes again. * - * @param {string[]} uniformNames - An array of the uniform names to get the locations for. + * @method Phaser.Renderer.WebGL.WebGLPipeline#rebind + * @fires Phaser.Renderer.WebGL.Pipelines.Events#REBIND + * @since 3.0.0 * * @return {this} This WebGLPipeline instance. */ - setUniformLocations: function (uniformNames) + rebind: function () + { + var wasBound = this.setVertexBuffer(); + + var shaders = this.shaders; + + // Loop in reverse, so the first shader in the array is left as being bound + for (var i = shaders.length - 1; i >= 0; i--) + { + this.currentShader = shaders[i].bind(wasBound); + } + + this.emit(Events.REBIND, this.currentShader); + + this.onActive(this.currentShader); + + this.onRebind(); + + return this; + }, + + /** + * Binds the vertex buffer to be the active ARRAY_BUFFER on the WebGL context. + * + * It first checks to see if it's already set as the active buffer and only + * binds itself if not. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setVertexBuffer + * @since 3.50.0 + * + * @return {boolean} `true` if the vertex buffer was bound, or `false` if it was already bound. + */ + setVertexBuffer: function () { var gl = this.gl; - var program = this.program; - var uniforms = this.uniforms; + var buffer = this.vertexBuffer; - for (var i = 0; i < uniformNames.length; i++) + if (gl.getParameter(gl.ARRAY_BUFFER_BINDING) !== buffer) { - var name = uniformNames[i]; + gl.bindBuffer(gl.ARRAY_BUFFER, buffer); - var location = gl.getUniformLocation(program, name); + return true; + } - if (location !== null) + return false; + }, + + /** + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. When this is called, the + * renderer has just performed a flush. It will bind the current render target, if any are set + * and finally call the `onPreBatch` hook. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#preBatch + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Cameras.Scene2D.Camera)} [gameObject] - The Game Object or Camera that invoked this pipeline, if any. + * + * @return {this} This WebGLPipeline instance. + */ + preBatch: function (gameObject) + { + if (this.currentRenderTarget) + { + this.currentRenderTarget.bind(); + } + + this.onPreBatch(gameObject); + + return this; + }, + + /** + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. When this is called, the + * renderer has just performed a flush. + * + * It calls the `onDraw` hook followed by the `onPostBatch` hook, which can be used to perform + * additional Post FX Pipeline processing. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#postBatch + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|Phaser.Cameras.Scene2D.Camera)} [gameObject] - The Game Object or Camera that invoked this pipeline, if any. + * + * @return {this} This WebGLPipeline instance. + */ + postBatch: function (gameObject) + { + this.onDraw(this.currentRenderTarget); + + this.onPostBatch(gameObject); + + return this; + }, + + /** + * This method is only used by Post FX Pipelines and those that extend from them. + * + * This method is called every time the `postBatch` method is called and is passed a + * reference to the current render target. + * + * At the very least a Post FX Pipeline should call `this.bindAndDraw(renderTarget)`, + * however, you can do as much additional processing as you like in this method if + * you override it from within your own pipelines. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onDraw + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} renderTarget - The Render Target. + */ + onDraw: function () + { + }, + + /** + * This method is called every time the Pipeline Manager deactivates this pipeline, swapping from + * it to another one. This happens after a call to `flush` and before the new pipeline is bound. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#unbind + * @since 3.50.0 + */ + unbind: function () + { + if (this.currentRenderTarget) + { + this.currentRenderTarget.unbind(); + } + }, + + /** + * Uploads the vertex data and emits a draw call for the current batch of vertices. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#flush + * @fires Phaser.Renderer.WebGL.Pipelines.Events#BEFORE_FLUSH + * @fires Phaser.Renderer.WebGL.Pipelines.Events#AFTER_FLUSH + * @since 3.0.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + * + * @return {this} This WebGLPipeline instance. + */ + flush: function (isPostFlush) + { + if (isPostFlush === undefined) { isPostFlush = false; } + + if (this.vertexCount > 0) + { + this.emit(Events.BEFORE_FLUSH, this, isPostFlush); + + this.onBeforeFlush(isPostFlush); + + var gl = this.gl; + var vertexCount = this.vertexCount; + var vertexSize = this.currentShader.vertexSize; + + if (this.active) { - uniforms[name] = location; + this.setVertexBuffer(); + + if (vertexCount === this.vertexCapacity) + { + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW); + } + else + { + gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); + } + + gl.drawArrays(this.topology, 0, vertexCount); } + + this.vertexCount = 0; + + this.emit(Events.AFTER_FLUSH, this, isPostFlush); + + this.onAfterFlush(isPostFlush); } return this; }, /** - * Sets the vertex attribute pointers. - * This should only be called after the vertex buffer has been bound. + * By default this is an empty method hook that you can override and use in your own custom pipelines. * - * @method Phaser.Renderer.WebGL.WebGLPipeline#setAttribPointers + * This method is called every time the Pipeline Manager makes this the active pipeline. It is called + * at the end of the `WebGLPipeline.bind` method, after the current shader has been set. The current + * shader is passed to this hook. + * + * For example, if a display list has 3 Sprites in it that all use the same pipeline, this hook will + * only be called for the first one, as the 2nd and 3rd Sprites do not cause the pipeline to be changed. + * + * If you need to listen for that event instead, use the `onBind` hook. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onActive * @since 3.50.0 * - * @param {boolean} [reset=false] - Reset the vertex attribute locations? - * - * @return {this} This WebGLPipeline instance. + * @param {Phaser.Renderer.WebGL.WebGLShader} currentShader - The shader that was set as current. */ - setAttribPointers: function (reset) + onActive: function () { - if (reset === undefined) { reset = false; } - - var gl = this.gl; - var attributes = this.attributes; - var vertexSize = this.vertexSize; - var program = this.program; - - for (var i = 0; i < attributes.length; i++) - { - var element = attributes[i]; - - if (reset) - { - var location = gl.getAttribLocation(program, element.name); - - if (location >= 0) - { - gl.enableVertexAttribArray(location); - gl.vertexAttribPointer(location, element.size, element.type, element.normalized, vertexSize, element.offset); - element.enabled = true; - element.location = location; - } - else if (location !== -1) - { - gl.disableVertexAttribArray(location); - } - } - else if (element.enabled) - { - gl.vertexAttribPointer(element.location, element.size, element.type, element.normalized, vertexSize, element.offset); - } - else if (!element.enabled && element.location > -1) - { - gl.disableVertexAttribArray(element.location); - element.location = -1; - } - } }, /** - * This method is called every time a Game Object asks the Pipeline Manager to use this pipeline. + * By default this is an empty method hook that you can override and use in your own custom pipelines. * - * Unlike the `bind` method, which is only called once per frame, this is called for every object - * that requests it, allowing you to perform per-object GL set-up. + * This method is called every time a **Game Object** asks the Pipeline Manager to use this pipeline, + * even if the pipeline is already active. + * + * Unlike the `onActive` method, which is only called when the Pipeline Manager makes this pipeline + * active, this hook is called for every Game Object that requests use of this pipeline, allowing you to + * perform per-object set-up, such as loading shader uniform data. * * @method Phaser.Renderer.WebGL.WebGLPipeline#onBind - * @since 3.0.0 + * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. - * - * @return {this} This WebGLPipeline instance. */ onBind: function () { - // This is for updating uniform data it's called on each bind attempt. - return this; }, /** - * Called before each frame is rendered, but after the canvas has been cleared. + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called when the Pipeline Manager needs to rebind this pipeline. This happens after a + * pipeline has been cleared, usually when passing control over to a 3rd party WebGL library, like Spine, + * and then returing to Phaser again. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onRebind + * @since 3.50.0 + */ + onRebind: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time the `batchQuad` or `batchTri` methods are called. If this was + * as a result of a Game Object, then the Game Object reference is passed to this hook too. + * + * This hook is called _after_ the quad (or tri) has been added to the batch, so you can safely + * call 'flush' from within this. + * + * Note that Game Objects may call `batchQuad` or `batchTri` multiple times for a single draw, + * for example the Graphics Game Object. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately before a **Game Object** is about to add itself to the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onPreBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after a **Game Object** has been added to the batch. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostBatch + * @since 3.50.0 + * + * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. + */ + onPostBatch: function () + { + }, + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, right before anything has been rendered, but after the canvas + * has been cleared. If this pipeline has a render target, it will also have been cleared by this point. * * @method Phaser.Renderer.WebGL.WebGLPipeline#onPreRender - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. + * @since 3.50.0 */ onPreRender: function () { - // called once every frame - return this; }, /** - * Called before a Scene's Camera is rendered. + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called _once per frame_, by every Camera in a Scene that wants to render. + * + * It is called at the start of the rendering process, before anything has been drawn to the Camera. * * @method Phaser.Renderer.WebGL.WebGLPipeline#onRender - * @since 3.0.0 + * @since 3.50.0 * * @param {Phaser.Scene} scene - The Scene being rendered. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. - * - * @return {this} This WebGLPipeline instance. */ onRender: function () { - // called for each camera - return this; }, /** - * Called after each frame has been completely rendered and snapshots have been taken. + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called _once per frame_, after all rendering has happened and snapshots have been taken. + * + * It is called at the very end of the rendering process, once all Cameras, for all Scenes, have + * been rendered. * * @method Phaser.Renderer.WebGL.WebGLPipeline#onPostRender - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. + * @since 3.50.0 */ onPostRender: function () { - // called once every frame - return this; }, /** - * Uploads the vertex data and emits a draw call - * for the current batch of vertices. + * By default this is an empty method hook that you can override and use in your own custom pipelines. * - * @method Phaser.Renderer.WebGL.WebGLPipeline#flush - * @since 3.0.0 + * This method is called every time this pipeline is asked to flush its batch. * - * @return {this} This WebGLPipeline instance. + * It is called immediately before the `gl.bufferData` and `gl.drawArrays` calls are made, so you can + * perform any final pre-render modifications. To apply changes post-render, see `onAfterFlush`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onBeforeFlush + * @since 3.50.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? */ - flush: function () + onBeforeFlush: function () { - if (this.flushLocked) { return this; } + }, - this.flushLocked = true; + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after this pipeline has finished flushing its batch. + * + * It is called after the `gl.drawArrays` call. + * + * You can perform additional post-render effects, but be careful not to call `flush` + * on this pipeline from within this method, or you'll cause an infinite loop. + * + * To apply changes pre-render, see `onBeforeFlush`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#onAfterFlush + * @since 3.50.0 + * + * @param {boolean} [isPostFlush=false] - Was this flush invoked as part of a post-process, or not? + */ + onAfterFlush: function () + { + }, - var gl = this.gl; - var vertexCount = this.vertexCount; - var topology = this.topology; - var vertexSize = this.vertexSize; + /** + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchVert + * @since 3.50.0 + * + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} u - UV u value. + * @param {number} v - UV v value. + * @param {number} unit - Texture unit to which the texture needs to be bound. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, u, v, unit, tintEffect, tint) + { + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; - if (vertexCount === 0) + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewF32[++vertexOffset] = u; + vertexViewF32[++vertexOffset] = v; + vertexViewF32[++vertexOffset] = unit; + vertexViewF32[++vertexOffset] = tintEffect; + vertexViewU32[++vertexOffset] = tint; + + this.vertexCount++; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchQuad + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|null)} gameObject - The Game Object, if any, drawing this quad. + * @param {number} x0 - The top-left x position. + * @param {number} y0 - The top-left y position. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {number} tintBR - The bottom-right tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {number} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchQuad: function (gameObject, x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) + { + if (unit === undefined) { unit = this.currentUnit; } + + var hasFlushed = false; + + if (this.shouldFlush(6)) { - this.flushLocked = false; - return; + this.flush(); + + hasFlushed = true; + + unit = this.setTexture2D(texture); } - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); - gl.drawArrays(topology, 0, vertexCount); + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x1, y1, u0, v1, unit, tintEffect, tintBL); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBR); + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBR); + this.batchVert(x3, y3, u1, v0, unit, tintEffect, tintTR); - this.vertexCount = 0; - this.flushLocked = false; + this.onBatch(gameObject); + + return hasFlushed; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#batchTri + * @since 3.50.0 + * + * @param {(Phaser.GameObjects.GameObject|null)} gameObject - The Game Object, if any, drawing this quad. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} u0 - UV u0 value. + * @param {number} v0 - UV v0 value. + * @param {number} u1 - UV u1 value. + * @param {number} v1 - UV v1 value. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {number} [unit=0] - Texture unit to which the texture needs to be bound. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchTri: function (gameObject, x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) + { + if (unit === undefined) { unit = this.currentUnit; } + + var hasFlushed = false; + + if (this.shouldFlush(3)) + { + this.flush(); + + hasFlushed = true; + + unit = this.setTexture2D(texture); + } + + this.batchVert(x0, y0, u0, v0, unit, tintEffect, tintTL); + this.batchVert(x1, y1, u0, v1, unit, tintEffect, tintTR); + this.batchVert(x2, y2, u1, v1, unit, tintEffect, tintBL); + + this.onBatch(gameObject); + + return hasFlushed; + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * + * The dimensions are run through `Math.floor` before the quad is generated. + * + * Rectangle has no transform values and isn't transformed into the local space. + * + * Used for directly batching untransformed rectangles, such as Camera background colors. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#drawFillRect + * @since 3.50.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {number} color - Color of the rectangle to draw. + * @param {number} alpha - Alpha value of the rectangle to draw. + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param {boolean} [flipUV=true] - Flip the vertical UV coordinates of the texture before rendering? + */ + drawFillRect: function (x, y, width, height, color, alpha, texture, flipUV) + { + if (texture === undefined) { texture = this.renderer.whiteTexture.glTexture; } + if (flipUV === undefined) { flipUV = true; } + + x = Math.floor(x); + y = Math.floor(y); + + var xw = Math.floor(x + width); + var yh = Math.floor(y + height); + + var unit = this.setTexture2D(texture); + + var tint = Utils.getTintAppendFloatAlphaAndSwap(color, alpha); + + var u0 = 0; + var v0 = 0; + var u1 = 1; + var v1 = 1; + + if (flipUV) + { + v0 = 1; + v1 = 0; + } + + this.batchQuad(null, x, y, x, yh, xw, yh, xw, y, u0, v0, u1, v1, tint, tint, tint, tint, 0, texture, unit); + }, + + /** + * Sets the texture to be bound to the next available texture unit and returns + * the unit id. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setTexture2D + * @since 3.50.0 + * + * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses `whiteTexture`. + * + * @return {number} The assigned texture unit. + */ + setTexture2D: function (texture) + { + if (texture === undefined) { texture = this.renderer.whiteTexture.glTexture; } + + this.currentUnit = this.renderer.setTexture2D(texture); + + return this.currentUnit; + }, + + /** + * Activates the given WebGL Texture and binds it to the requested texture slot. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#bindTexture + * @since 3.50.0 + * + * @param {WebGLTexture} [target] - The WebGLTexture to activate and bind. + * @param {number} [unit=0] - The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. + * + * @return {this} This WebGL Pipeline instance. + */ + bindTexture: function (texture, unit) + { + if (unit === undefined) { unit = 0; } + + var gl = this.gl; + + gl.activeTexture(gl.TEXTURE0 + unit); + + gl.bindTexture(gl.TEXTURE_2D, texture); return this; }, /** - * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context. + * Activates the given Render Target texture and binds it to the + * requested WebGL texture slot. * - * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy - * @since 3.0.0 + * @method Phaser.Renderer.WebGL.WebGLPipeline#bindRenderTarget + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The Render Target to activate and bind. + * @param {number} [unit=0] - The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. + * + * @return {this} This WebGL Pipeline instance. + */ + bindRenderTarget: function (target, unit) + { + return this.bindTexture(target.texture, unit); + }, + + /** + * Sets the current duration into a 1f uniform value based on the given name. + * + * This can be used for mapping time uniform values, such as `iTime`. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#setTime + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. * * @return {this} This WebGLPipeline instance. */ - destroy: function () + setTime: function (uniform) { - var gl = this.gl; - - gl.deleteProgram(this.program); - gl.deleteBuffer(this.vertexBuffer); - - delete this.program; - delete this.vertexBuffer; - delete this.gl; + this.set1f(uniform, this.game.loop.getDuration()); return this; }, /** - * Sets a 1f uniform value based on the given name on this pipeline. + * Sets a 1f uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set1f * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number} x - The new value of the `float` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set1f: function (name, x) + set1f: function (name, x, shader) { - this.gl.uniform1f(this.uniforms[name], x); + if (shader === undefined) { shader = this.currentShader; } + + shader.set1f(name, x); return this; }, /** - * Sets a 2f uniform value based on the given name on this pipeline. + * Sets a 2f uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set2f * @since 3.50.0 @@ -663,21 +1515,27 @@ var WebGLPipeline = new Class({ * @param {string} name - The name of the uniform to set. * @param {number} x - The new X component of the `vec2` uniform. * @param {number} y - The new Y component of the `vec2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set2f: function (name, x, y) + set2f: function (name, x, y, shader) { - this.gl.uniform2f(this.uniforms[name], x, y); + if (shader === undefined) { shader = this.currentShader; } + + shader.set2f(name, x, y); return this; }, /** - * Sets a 3f uniform value based on the given name on this pipeline. + * Sets a 3f uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set3f * @since 3.50.0 @@ -686,21 +1544,27 @@ var WebGLPipeline = new Class({ * @param {number} x - The new X component of the `vec3` uniform. * @param {number} y - The new Y component of the `vec3` uniform. * @param {number} z - The new Z component of the `vec3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set3f: function (name, x, y, z) + set3f: function (name, x, y, z, shader) { - this.gl.uniform3f(this.uniforms[name], x, y, z); + if (shader === undefined) { shader = this.currentShader; } + + shader.set3f(name, x, y, z); return this; }, /** - * Sets a 4f uniform value based on the given name on this pipeline. + * Sets a 4f uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set4f * @since 3.50.0 @@ -710,279 +1574,357 @@ var WebGLPipeline = new Class({ * @param {number} y - Y component of the uniform * @param {number} z - Z component of the uniform * @param {number} w - W component of the uniform + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set4f: function (name, x, y, z, w) + set4f: function (name, x, y, z, w, shader) { - this.gl.uniform4f(this.uniforms[name], x, y, z, w); + if (shader === undefined) { shader = this.currentShader; } + + shader.set4f(name, x, y, z, w); return this; }, /** - * Sets a 1fv uniform value based on the given name on this pipeline. + * Sets a 1fv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set1fv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set1fv: function (name, arr) + set1fv: function (name, arr, shader) { - this.gl.uniform1fv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set1fv(name, arr); return this; }, /** - * Sets a 2fv uniform value based on the given name on this pipeline. + * Sets a 2fv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set2fv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set2fv: function (name, arr) + set2fv: function (name, arr, shader) { - this.gl.uniform2fv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set2fv(name, arr); return this; }, /** - * Sets a 3fv uniform value based on the given name on this pipeline. + * Sets a 3fv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set3fv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set3fv: function (name, arr) + set3fv: function (name, arr, shader) { - this.gl.uniform3fv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set3fv(name, arr); return this; }, /** - * Sets a 4fv uniform value based on the given name on this pipeline. + * Sets a 4fv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set4fv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set4fv: function (name, arr) + set4fv: function (name, arr, shader) { - this.gl.uniform4fv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set4fv(name, arr); return this; }, /** - * Sets a 1iv uniform value based on the given name on this pipeline. + * Sets a 1iv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set1iv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set1iv: function (name, arr) + set1iv: function (name, arr, shader) { - this.gl.uniform1iv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set1iv(name, arr); return this; }, /** - * Sets a 2iv uniform value based on the given name on this pipeline. + * Sets a 2iv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set2iv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set2iv: function (name, arr) + set2iv: function (name, arr, shader) { - this.gl.uniform2iv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set2iv(name, arr); return this; }, /** - * Sets a 3iv uniform value based on the given name on this pipeline. + * Sets a 3iv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set3iv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set3iv: function (name, arr) + set3iv: function (name, arr, shader) { - this.gl.uniform3iv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set3iv(name, arr); return this; }, /** - * Sets a 4iv uniform value based on the given name on this pipeline. + * Sets a 4iv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set4iv * @since 3.50.0 * * @param {string} name - The name of the uniform to set. * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set4iv: function (name, arr) + set4iv: function (name, arr, shader) { - this.gl.uniform4iv(this.uniforms[name], arr); + if (shader === undefined) { shader = this.currentShader; } + + shader.set4iv(name, arr); return this; }, /** - * Sets a 1i uniform value based on the given name on this pipeline. + * Sets a 1i uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set1i * @since 3.50.0 * * @param {string} name - The name of the uniform to set. - * @param {integer} x - The new value of the `int` uniform. + * @param {number} x - The new value of the `int` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set1i: function (name, x) + set1i: function (name, x, shader) { - this.gl.uniform1i(this.uniforms[name], x); + if (shader === undefined) { shader = this.currentShader; } + + shader.set1i(name, x); return this; }, /** - * Sets a 2i uniform value based on the given name on this pipeline. + * Sets a 2i uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set2i * @since 3.50.0 * * @param {string} name - The name of the uniform to set. - * @param {integer} x - The new X component of the `ivec2` uniform. - * @param {integer} y - The new Y component of the `ivec2` uniform. + * @param {number} x - The new X component of the `ivec2` uniform. + * @param {number} y - The new Y component of the `ivec2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set2i: function (name, x, y) + set2i: function (name, x, y, shader) { - this.gl.uniform2i(this.uniforms[name], x, y); + if (shader === undefined) { shader = this.currentShader; } + + shader.set2i(name, x, y); return this; }, /** - * Sets a 3i uniform value based on the given name on this pipeline. + * Sets a 3i uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set3i * @since 3.50.0 * * @param {string} name - The name of the uniform to set. - * @param {integer} x - The new X component of the `ivec3` uniform. - * @param {integer} y - The new Y component of the `ivec3` uniform. - * @param {integer} z - The new Z component of the `ivec3` uniform. + * @param {number} x - The new X component of the `ivec3` uniform. + * @param {number} y - The new Y component of the `ivec3` uniform. + * @param {number} z - The new Z component of the `ivec3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set3i: function (name, x, y, z) + set3i: function (name, x, y, z, shader) { - this.gl.uniform3i(this.uniforms[name], x, y, z); + if (shader === undefined) { shader = this.currentShader; } + + shader.set3i(name, x, y, z); return this; }, /** - * Sets a 4i uniform value based on the given name on this pipeline. + * Sets a 4i uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#set4i * @since 3.50.0 * * @param {string} name - The name of the uniform to set. - * @param {integer} x - X component of the uniform - * @param {integer} y - Y component of the uniform - * @param {integer} z - Z component of the uniform - * @param {integer} w - W component of the uniform + * @param {number} x - X component of the uniform. + * @param {number} y - Y component of the uniform. + * @param {number} z - Z component of the uniform. + * @param {number} w - W component of the uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - set4i: function (name, x, y, z, w) + set4i: function (name, x, y, z, w, shader) { - this.gl.uniform4i(this.uniforms[name], x, y, z, w); + if (shader === undefined) { shader = this.currentShader; } + + shader.set4i(name, x, y, z, w); return this; }, /** - * Sets a matrix 2fv uniform value based on the given name on this pipeline. + * Sets a matrix 2fv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix2fv * @since 3.50.0 @@ -990,21 +1932,27 @@ var WebGLPipeline = new Class({ * @param {string} name - The name of the uniform to set. * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. * @param {number[]|Float32Array} matrix - The new values for the `mat2` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - setMatrix2fv: function (name, transpose, matrix) + setMatrix2fv: function (name, transpose, matrix, shader) { - this.gl.uniformMatrix2fv(this.uniforms[name], transpose, matrix); + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix2fv(name, transpose, matrix); return this; }, /** - * Sets a matrix 3fv uniform value based on the given name on this pipeline. + * Sets a matrix 3fv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix3fv * @since 3.50.0 @@ -1012,21 +1960,27 @@ var WebGLPipeline = new Class({ * @param {string} name - The name of the uniform to set. * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. * @param {Float32Array} matrix - The new values for the `mat3` uniform. + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - setMatrix3fv: function (name, transpose, matrix) + setMatrix3fv: function (name, transpose, matrix, shader) { - this.gl.uniformMatrix3fv(this.uniforms[name], transpose, matrix); + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix3fv(name, transpose, matrix); return this; }, /** - * Sets a matrix 4fv uniform value based on the given name on this pipeline. + * Sets a matrix 4fv uniform value based on the given name on the currently set shader. * - * The pipeline shader must be currently active. You can safely call this method from - * pipeline methods such as `bind`, `onBind` and batch related calls. + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. * * @method Phaser.Renderer.WebGL.WebGLPipeline#setMatrix4fv * @since 3.50.0 @@ -1034,12 +1988,73 @@ var WebGLPipeline = new Class({ * @param {string} name - The name of the uniform to set. * @param {boolean} transpose - Should the matrix be transpose * @param {Float32Array} matrix - Matrix data + * @param {Phaser.Renderer.WebGL.WebGLShader} [shader] - The shader to set the value on. If not given, the `currentShader` is used. * * @return {this} This WebGLPipeline instance. */ - setMatrix4fv: function (name, transpose, matrix) + setMatrix4fv: function (name, transpose, matrix, shader) { - this.gl.uniformMatrix4fv(this.uniforms[name], transpose, matrix); + if (shader === undefined) { shader = this.currentShader; } + + shader.setMatrix4fv(name, transpose, matrix); + + return this; + }, + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + * + * @method Phaser.Renderer.WebGL.WebGLPipeline#destroy + * @fires Phaser.Renderer.WebGL.Pipelines.Events#DESTROY + * @since 3.0.0 + * + * @return {this} This WebGLPipeline instance. + */ + destroy: function () + { + this.emit(Events.DESTROY, this); + + var i; + + var shaders = this.shaders; + + for (i = 0; i < shaders.length; i++) + { + shaders[i].destroy(); + } + + var targets = this.renderTargets; + + for (i = 0; i < targets.length; i++) + { + targets[i].destroy(); + } + + this.gl.deleteBuffer(this.vertexBuffer); + + var renderer = this.renderer; + + renderer.off(RendererEvents.RESIZE, this.resize, this); + renderer.off(RendererEvents.PRE_RENDER, this.onPreRender, this); + renderer.off(RendererEvents.RENDER, this.onRender, this); + renderer.off(RendererEvents.POST_RENDER, this.onPostRender, this); + + this.removeAllListeners(); + + this.game = null; + this.renderer = null; + this.manager = null; + this.gl = null; + this.view = null; + this.shaders = null; + this.renderTargets = null; + this.bytes = null; + this.vertexViewF32 = null; + this.vertexViewU32 = null; + this.vertexData = null; + this.vertexBuffer = null; + this.currentShader = null; + this.currentRenderTarget = null; return this; } diff --git a/src/renderer/webgl/WebGLRenderer.js b/src/renderer/webgl/WebGLRenderer.js index fd9b5bc5e..97b929841 100644 --- a/src/renderer/webgl/WebGLRenderer.js +++ b/src/renderer/webgl/WebGLRenderer.js @@ -5,20 +5,19 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var BaseCamera = require('../../cameras/2d/BaseCamera'); +var ArrayRemove = require('../../utils/array/Remove'); var CameraEvents = require('../../cameras/2d/events'); var Class = require('../../utils/Class'); var CONST = require('../../const'); +var EventEmitter = require('eventemitter3'); +var Events = require('../events'); var GameEvents = require('../../core/events'); var IsSizePowerOfTwo = require('../../math/pow2/IsSizePowerOfTwo'); var NOOP = require('../../utils/NOOP'); -var PIPELINE_CONST = require('./pipelines/const'); var PipelineManager = require('./PipelineManager'); -var ProjectOrtho = require('./mvp/ProjectOrtho'); +var RenderTarget = require('./RenderTarget'); var ScaleEvents = require('../../scale/events'); -var SpliceOne = require('../../utils/array/SpliceOne'); var TextureEvents = require('../../textures/events'); -var TransformMatrix = require('../../gameobjects/components/TransformMatrix'); var Utils = require('./Utils'); var WebGLSnapshot = require('../snapshot/WebGLSnapshot'); @@ -39,6 +38,7 @@ var WebGLSnapshot = require('../snapshot/WebGLSnapshot'); * WebGLRenderer and/or WebGLPipeline. * * @class WebGLRenderer + * @extends Phaser.Events.EventEmitter * @memberof Phaser.Renderer.WebGL * @constructor * @since 3.0.0 @@ -47,10 +47,14 @@ var WebGLSnapshot = require('../snapshot/WebGLSnapshot'); */ var WebGLRenderer = new Class({ + Extends: EventEmitter, + initialize: function WebGLRenderer (game) { + EventEmitter.call(this); + var gameConfig = game.config; var contextCreationConfig = { @@ -97,7 +101,7 @@ var WebGLRenderer = new Class({ * A constant which allows the renderer to be easily identified as a WebGL Renderer. * * @name Phaser.Renderer.WebGL.WebGLRenderer#type - * @type {integer} + * @type {number} * @since 3.0.0 */ this.type = CONST.WEBGL; @@ -124,7 +128,7 @@ var WebGLRenderer = new Class({ * This is populated in the onResize event handler. * * @name Phaser.Renderer.WebGL.WebGLRenderer#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = 0; @@ -134,7 +138,7 @@ var WebGLRenderer = new Class({ * This is populated in the onResize event handler. * * @name Phaser.Renderer.WebGL.WebGLRenderer#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = 0; @@ -160,16 +164,6 @@ var WebGLRenderer = new Class({ */ this.blendModes = []; - /** - * Keeps track of any WebGLTexture created with the current WebGLRenderingContext. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#nativeTextures - * @type {array} - * @default [] - * @since 3.0.0 - */ - this.nativeTextures = []; - /** * This property is set to `true` if the WebGL context of the renderer is lost. * @@ -203,13 +197,11 @@ var WebGLRenderer = new Class({ bufferHeight: 0 }; - // Internal Renderer State (Textures, Framebuffers, Pipelines, Buffers, etc) - /** * Cached value for the last texture unit that was used. * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentActiveTexture - * @type {integer} + * @type {number} * @since 3.1.0 */ this.currentActiveTexture = 0; @@ -219,7 +211,7 @@ var WebGLRenderer = new Class({ * This value is constantly updated and should be treated as read-only by your code. * * @name Phaser.Renderer.WebGL.WebGLRenderer#startActiveTexture - * @type {integer} + * @type {number} * @since 3.50.0 */ this.startActiveTexture = 0; @@ -229,7 +221,7 @@ var WebGLRenderer = new Class({ * This is set via the Game Config `maxTextures` property and should never be changed after boot. * * @name Phaser.Renderer.WebGL.WebGLRenderer#maxTextures - * @type {integer} + * @type {number} * @since 3.50.0 */ this.maxTextures = 0; @@ -275,7 +267,7 @@ var WebGLRenderer = new Class({ this.normalTexture; /** - * Current framebuffer in use. + * The currently bound framebuffer in use. * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentFramebuffer * @type {WebGLFramebuffer} @@ -284,6 +276,15 @@ var WebGLRenderer = new Class({ */ this.currentFramebuffer = null; + /** + * A stack into which the frame buffer objects are pushed and popped. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#fboStack + * @type {WebGLFramebuffer[]} + * @since 3.50.0 + */ + this.fboStack = []; + /** * Current WebGLProgram in use. * @@ -294,31 +295,11 @@ var WebGLRenderer = new Class({ */ this.currentProgram = null; - /** - * Current WebGLBuffer (Vertex buffer) in use - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#currentVertexBuffer - * @type {WebGLBuffer} - * @default null - * @since 3.0.0 - */ - this.currentVertexBuffer = null; - - /** - * Current WebGLBuffer (Index buffer) in use - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#currentIndexBuffer - * @type {WebGLBuffer} - * @default null - * @since 3.0.0 - */ - this.currentIndexBuffer = null; - /** * Current blend mode in use * * @name Phaser.Renderer.WebGL.WebGLRenderer#currentBlendMode - * @type {integer} + * @type {number} * @since 3.0.0 */ this.currentBlendMode = Infinity; @@ -382,17 +363,40 @@ var WebGLRenderer = new Class({ this.gl = null; /** - * Array of strings that indicate which WebGL extensions are supported by the browser + * Array of strings that indicate which WebGL extensions are supported by the browser. + * This is populated in the `boot` method. * * @name Phaser.Renderer.WebGL.WebGLRenderer#supportedExtensions - * @type {object} + * @type {string[]} * @default null * @since 3.0.0 */ this.supportedExtensions = null; /** - * Extensions loaded into the current context + * If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold + * a reference to the glExtension for it. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#instancedArraysExtension + * @type {ANGLE_instanced_arrays} + * @default null + * @since 3.50.0 + */ + this.instancedArraysExtension = null; + + /** + * If the browser supports the `OES_vertex_array_object` extension, this property will hold + * a reference to the glExtension for it. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#vaoExtension + * @type {OES_vertex_array_object} + * @default null + * @since 3.50.0 + */ + this.vaoExtension = null; + + /** + * The WebGL Extensions loaded into the current context. * * @name Phaser.Renderer.WebGL.WebGLRenderer#extensions * @type {object} @@ -402,7 +406,7 @@ var WebGLRenderer = new Class({ this.extensions = {}; /** - * Stores the current WebGL component formats for further use + * Stores the current WebGL component formats for further use. * * @name Phaser.Renderer.WebGL.WebGLRenderer#glFormats * @type {array} @@ -415,7 +419,7 @@ var WebGLRenderer = new Class({ * Stores the supported WebGL texture compression formats. * * @name Phaser.Renderer.WebGL.WebGLRenderer#compression - * @type {array} + * @type {object} * @since 3.8.0 */ this.compression = { @@ -456,60 +460,11 @@ var WebGLRenderer = new Class({ */ this.whiteTexture = null; - /** - * A default Camera used in calls when no other camera has been provided. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#defaultCamera - * @type {Phaser.Cameras.Scene2D.BaseCamera} - * @since 3.12.0 - */ - this.defaultCamera = new BaseCamera(0, 0, 0, 0); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix1 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix1 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix2 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix2 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix3 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix3 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.WebGLRenderer#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.12.0 - */ - this._tempMatrix4 = new TransformMatrix(); - /** * The total number of masks currently stacked. * * @name Phaser.Renderer.WebGL.WebGLRenderer#maskCount - * @type {integer} + * @type {number} * @since 3.17.0 */ this.maskCount = 0; @@ -635,6 +590,26 @@ var WebGLRenderer = new Class({ */ this.defaultScissor = [ 0, 0, 0, 0 ]; + /** + * Has this renderer fully booted yet? + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#isBooted + * @type {boolean} + * @since 3.50.0 + */ + this.isBooted = false; + + /** + * A Render Target you can use to capture the current state of the Renderer. + * + * A Render Target encapsulates a framebuffer and texture for the WebGL Renderer. + * + * @name Phaser.Renderer.WebGL.WebGLRenderer#renderTarget + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.renderTarget = null; + this.init(this.config); }, @@ -752,7 +727,7 @@ var WebGLRenderer = new Class({ }; - // Load supported extensions + // Load supported extensions var exts = gl.getSupportedExtensions(); if (!config.maxTextures || config.maxTextures === -1) @@ -760,6 +735,11 @@ var WebGLRenderer = new Class({ config.maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS); } + if (!config.maxTextureSize) + { + config.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE); + } + var extString = 'WEBGL_compressed_texture_'; var wkExtString = 'WEBKIT_' + extString; @@ -769,6 +749,14 @@ var WebGLRenderer = new Class({ this.supportedExtensions = exts; + var angleString = 'ANGLE_instanced_arrays'; + + this.instancedArraysExtension = (exts.indexOf(angleString) > -1) ? gl.getExtension(angleString) : null; + + var vaoString = 'OES_vertex_array_object'; + + this.vaoExtension = (exts.indexOf(vaoString) > -1) ? gl.getExtension(vaoString) : null; + // Setup initial WebGL state gl.disable(gl.DEPTH_TEST); gl.disable(gl.CULL_FACE); @@ -809,7 +797,7 @@ var WebGLRenderer = new Class({ gl.bindTexture(gl.TEXTURE_2D, tempTexture); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 255, 255, 255, 255 ])); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 0, 0, 255, 255 ])); tempTextures[index] = tempTexture; @@ -842,16 +830,26 @@ var WebGLRenderer = new Class({ boot: function () { var game = this.game; + var pipelineManager = this.pipelines; - this.pipelines.boot(); + var baseSize = game.scale.baseSize; - var multi = this.pipelines.get(PIPELINE_CONST.MULTI_PIPELINE); + this.width = baseSize.width; + this.height = baseSize.height; + + this.isBooted = true; + + this.renderTarget = new RenderTarget(this, this.width, this.height, 1, 0, true, true); + + // Set-up pipelines + + pipelineManager.boot(game.config.pipeline); + + // Set-up default textures, fbo and scissor this.blankTexture = game.textures.getFrame('__DEFAULT'); this.whiteTexture = game.textures.getFrame('__WHITE'); - multi.currentFrame = this.whiteTexture; - var gl = this.gl; gl.bindFramebuffer(gl.FRAMEBUFFER, null); @@ -860,8 +858,6 @@ var WebGLRenderer = new Class({ game.scale.on(ScaleEvents.RESIZE, this.onResize, this); - var baseSize = game.scale.baseSize; - this.resize(baseSize.width, baseSize.height); }, @@ -883,10 +879,41 @@ var WebGLRenderer = new Class({ } }, + /** + * Binds the WebGL Renderers Render Target, so all drawn content is now redirected to it. + * + * Make sure to call `endCapture`. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#beginCapture + * @since 3.50.0 + */ + beginCapture: function () + { + this.renderTarget.bind(true); + + this.resetTextures(true); + }, + + /** + * Unbinds the WebGL Renderers Render Target and returns it, stopping any further content being drawn to it. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#endCapture + * @since 3.50.0 + * + * @return {Phaser.Renderer.WebGL.RenderTarget} A reference to the WebGL Renderer Render Target. + */ + endCapture: function () + { + this.renderTarget.unbind(true); + + return this.renderTarget; + }, + /** * Resizes the drawing buffer to match that required by the Scale Manager. * * @method Phaser.Renderer.WebGL.WebGLRenderer#resize + * @fires Phaser.Renderer.Events#RESIZE * @since 3.0.0 * * @param {number} [width] - The new width of the renderer. @@ -903,17 +930,15 @@ var WebGLRenderer = new Class({ gl.viewport(0, 0, width, height); - this.pipelines.resize(width, height); - this.drawingBufferHeight = gl.drawingBufferHeight; gl.scissor(0, (gl.drawingBufferHeight - height), width, height); - this.defaultCamera.setSize(width, height); - this.defaultScissor[2] = width; this.defaultScissor[3] = height; + this.emit(Events.RESIZE, width, height); + return this; }, @@ -971,13 +996,13 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#pushScissor * @since 3.0.0 * - * @param {integer} x - The x position of the scissor. - * @param {integer} y - The y position of the scissor. - * @param {integer} width - The width of the scissor. - * @param {integer} height - The height of the scissor. - * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + * @param {number} x - The x position of the scissor. + * @param {number} y - The y position of the scissor. + * @param {number} width - The width of the scissor. + * @param {number} height - The height of the scissor. + * @param {number} [drawingBufferHeight] - Optional drawingBufferHeight override value. * - * @return {integer[]} An array containing the scissor values. + * @return {number[]} An array containing the scissor values. */ pushScissor: function (x, y, width, height, drawingBufferHeight) { @@ -1002,11 +1027,11 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setScissor * @since 3.0.0 * - * @param {integer} x - The x position of the scissor. - * @param {integer} y - The y position of the scissor. - * @param {integer} width - The width of the scissor. - * @param {integer} height - The height of the scissor. - * @param {integer} [drawingBufferHeight] - Optional drawingBufferHeight override value. + * @param {number} x - The x position of the scissor. + * @param {number} y - The y position of the scissor. + * @param {number} width - The width of the scissor. + * @param {number} height - The height of the scissor. + * @param {number} [drawingBufferHeight] - Optional drawingBufferHeight override value. */ setScissor: function (x, y, width, height, drawingBufferHeight) { @@ -1037,6 +1062,34 @@ var WebGLRenderer = new Class({ } }, + /** + * Resets the gl scissor state to be whatever the current scissor is, if there is one, without + * modifying the scissor stack. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#resetScissor + * @since 3.50.0 + */ + resetScissor: function () + { + var gl = this.gl; + + var current = this.currentScissor; + + if (current) + { + var x = current[0]; + var y = current[1]; + var width = current[2]; + var height = current[3]; + + if (width > 0 && height > 0) + { + gl.enable(gl.SCISSOR_TEST); + gl.scissor(x, (this.drawingBufferHeight - y - height), width, height); + } + } + }, + /** * Pops the last scissor state and sets it. * @@ -1077,6 +1130,19 @@ var WebGLRenderer = new Class({ return ((mask && mask.isStencil) || (camMask && camMask.isStencil)); }, + /** + * Resets the gl viewport to the current renderer dimensions. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#resetViewport + * @since 3.50.0 + */ + resetViewport: function () + { + var gl = this.gl; + + gl.viewport(0, 0, this.width, this.height); + }, + /** * Sets the blend mode to the value given. * @@ -1086,7 +1152,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setBlendMode * @since 3.0.0 * - * @param {integer} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value. + * @param {number} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value. * @param {boolean} [force=false] - Force the blend mode to be set, regardless of the currently set blend mode. * * @return {boolean} `true` if the blend mode was changed as a result of this call, forcing a flush, otherwise `false`. @@ -1133,7 +1199,7 @@ var WebGLRenderer = new Class({ * @param {GLenum[]} func - An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. * @param {GLenum} equation - The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. * - * @return {integer} The index of the new blend mode, used for referencing it in the future. + * @return {number} The index of the new blend mode, used for referencing it in the future. */ addBlendMode: function (func, equation) { @@ -1148,7 +1214,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#updateBlendMode * @since 3.0.0 * - * @param {integer} index - The index of the custom blend mode. + * @param {number} index - The index of the custom blend mode. * @param {function} func - The function to use for the blend mode. * @param {function} equation - The equation to use for the blend mode. * @@ -1176,7 +1242,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#removeBlendMode * @since 3.0.0 * - * @param {integer} index - The index of the custom blend mode to be removed. + * @param {number} index - The index of the custom blend mode to be removed. * * @return {this} This WebGLRenderer instance. */ @@ -1216,7 +1282,7 @@ var WebGLRenderer = new Class({ */ setTextureSource: function (textureSource) { - if (this.pipelines.current.forceZero) + if (this.pipelines.forceZero()) { this.setTextureZero(textureSource.glTexture, true); @@ -1409,16 +1475,22 @@ var WebGLRenderer = new Class({ var gl = this.gl; var temp = this.tempTextures; - var total = (all) ? temp.length : 2; - - for (var i = 0; i < total; i++) - { - gl.activeTexture(gl.TEXTURE0 + i); - gl.bindTexture(gl.TEXTURE_2D, temp[i]); - } - if (all) { + for (var i = 0; i < temp.length; i++) + { + gl.activeTexture(gl.TEXTURE0 + i); + gl.bindTexture(gl.TEXTURE_2D, temp[i]); + } + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(gl.TEXTURE_2D, temp[1]); + } + else + { + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, temp[0]); + gl.activeTexture(gl.TEXTURE1); gl.bindTexture(gl.TEXTURE_2D, temp[1]); } @@ -1446,7 +1518,7 @@ var WebGLRenderer = new Class({ */ setTexture2D: function (texture) { - if (this.pipelines.current.forceZero) + if (this.pipelines.forceZero()) { this.setTextureZero(texture, true); @@ -1493,137 +1565,189 @@ var WebGLRenderer = new Class({ }, /** - * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. + * Pushes a new framebuffer onto the FBO stack and makes it the currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Call `popFramebuffer` to remove it again. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#pushFramebuffer + * @since 3.50.0 + * + * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. + * @param {boolean} [updateScissor=false] - Set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? + * + * @return {this} This WebGLRenderer instance. + */ + pushFramebuffer: function (framebuffer, updateScissor, resetTextures, setViewport) + { + if (framebuffer === this.currentFramebuffer) + { + return this; + } + + this.fboStack.push(framebuffer); + + return this.setFramebuffer(framebuffer, updateScissor, resetTextures, setViewport); + }, + + /** + * Sets the given framebuffer as the active and currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Typically, you should call `pushFramebuffer` instead of this method. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setFramebuffer * @since 3.0.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound. * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? * * @return {this} This WebGLRenderer instance. */ - setFramebuffer: function (framebuffer, updateScissor) + setFramebuffer: function (framebuffer, updateScissor, resetTextures, setViewport) { if (updateScissor === undefined) { updateScissor = false; } + if (resetTextures === undefined) { resetTextures = false; } + if (setViewport === undefined) { setViewport = true; } + + if (framebuffer === this.currentFramebuffer) + { + return this; + } var gl = this.gl; var width = this.width; var height = this.height; - if (framebuffer !== this.currentFramebuffer) + if (framebuffer && framebuffer.renderTexture && setViewport) { - if (framebuffer && framebuffer.renderTexture) + width = framebuffer.renderTexture.width; + height = framebuffer.renderTexture.height; + } + else + { + this.flush(); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + + if (setViewport) + { + gl.viewport(0, 0, width, height); + } + + if (updateScissor) + { + if (framebuffer) { - width = framebuffer.renderTexture.width; - height = framebuffer.renderTexture.height; + this.drawingBufferHeight = height; + + this.pushScissor(0, 0, width, height); } else { - this.flush(); + this.drawingBufferHeight = this.height; + + this.popScissor(); } + } - gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer); + this.currentFramebuffer = framebuffer; - gl.viewport(0, 0, width, height); - - if (updateScissor) - { - if (framebuffer) - { - this.drawingBufferHeight = height; - - this.pushScissor(0, 0, width, height); - } - else - { - this.drawingBufferHeight = this.height; - - this.popScissor(); - } - } - - this.currentFramebuffer = framebuffer; + if (resetTextures) + { + this.resetTextures(); } return this; }, /** - * Binds a program. If there was another program already bound it will force a pipeline flush. + * Pops the previous framebuffer from the fbo stack and sets it. + * + * @method Phaser.Renderer.WebGL.WebGLRenderer#popFramebuffer + * @since 3.50.0 + * + * @param {boolean} [updateScissor=false] - If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. + * @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound? + * @param {boolean} [setViewport=true] - Should the WebGL viewport be set? + * + * @return {WebGLFramebuffer} The Framebuffer that was set, or `null` if there aren't any more in the stack. + */ + popFramebuffer: function (updateScissor, resetTextures, setViewport) + { + if (updateScissor === undefined) { updateScissor = false; } + if (resetTextures === undefined) { resetTextures = false; } + if (setViewport === undefined) { setViewport = true; } + + var fboStack = this.fboStack; + + // Remove the current fbo + fboStack.pop(); + + // Reset the previous framebuffer + var framebuffer = fboStack[fboStack.length - 1]; + + if (!framebuffer) + { + framebuffer = null; + } + + this.setFramebuffer(framebuffer, updateScissor, resetTextures, setViewport); + + return framebuffer; + }, + + /** + * Binds a shader program. + * + * If there was a different program already bound it will force a pipeline flush first. + * + * If the same program given to this method is already set as the current program, no change + * will take place and this method will return `false`. * * @method Phaser.Renderer.WebGL.WebGLRenderer#setProgram * @since 3.0.0 * * @param {WebGLProgram} program - The program that needs to be bound. * - * @return {this} This WebGLRenderer instance. + * @return {boolean} `true` if the given program was bound, otherwise `false`. */ setProgram: function (program) { - var gl = this.gl; - if (program !== this.currentProgram) { this.flush(); - gl.useProgram(program); + this.gl.useProgram(program); this.currentProgram = program; + + return true; } - return this; + return false; }, /** - * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. + * Rebinds whatever program `WebGLRenderer.currentProgram` is set as, without + * changing anything, or flushing. * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setVertexBuffer - * @since 3.0.0 - * - * @param {WebGLBuffer} vertexBuffer - The buffer that needs to be bound. + * @method Phaser.Renderer.WebGL.WebGLRenderer#resetProgram + * @since 3.50.0 * * @return {this} This WebGLRenderer instance. */ - setVertexBuffer: function (vertexBuffer) + resetProgram: function () { - var gl = this.gl; - - if (vertexBuffer !== this.currentVertexBuffer) - { - this.flush(); - - gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); - - this.currentVertexBuffer = vertexBuffer; - } - - return this; - }, - - /** - * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setIndexBuffer - * @since 3.0.0 - * - * @param {WebGLBuffer} indexBuffer - The buffer the needs to be bound. - * - * @return {this} This WebGLRenderer instance. - */ - setIndexBuffer: function (indexBuffer) - { - var gl = this.gl; - - if (indexBuffer !== this.currentIndexBuffer) - { - this.flush(); - - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); - - this.currentIndexBuffer = indexBuffer; - } + this.gl.useProgram(this.currentProgram); return this; }, @@ -1635,9 +1759,9 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {object} source - The source of the texture. - * @param {integer} width - The width of the texture. - * @param {integer} height - The height of the texture. - * @param {integer} scaleMode - The scale mode to be used by the texture. + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} scaleMode - The scale mode to be used by the texture. * * @return {?WebGLTexture} The WebGL Texture that was created, or `null` if it couldn't be created. */ @@ -1683,15 +1807,15 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#createTexture2D * @since 3.0.0 * - * @param {integer} mipLevel - Mip level of the texture. - * @param {integer} minFilter - Filtering of the texture. - * @param {integer} magFilter - Filtering of the texture. - * @param {integer} wrapT - Wrapping mode of the texture. - * @param {integer} wrapS - Wrapping mode of the texture. - * @param {integer} format - Which format does the texture use. + * @param {number} mipLevel - Mip level of the texture. + * @param {number} minFilter - Filtering of the texture. + * @param {number} magFilter - Filtering of the texture. + * @param {number} wrapT - Wrapping mode of the texture. + * @param {number} wrapS - Wrapping mode of the texture. + * @param {number} format - Which format does the texture use. * @param {?object} pixels - pixel data. - * @param {integer} width - Width of the texture in pixels. - * @param {integer} height - Height of the texture in pixels. + * @param {number} width - Width of the texture in pixels. + * @param {number} height - Height of the texture in pixels. * @param {boolean} [pma=true] - Does the texture have premultiplied alpha? * @param {boolean} [forceSize=false] - If `true` it will use the width and height passed to this method, regardless of the pixels dimension. * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. @@ -1753,21 +1877,19 @@ var WebGLRenderer = new Class({ texture.glIndex = 0; texture.glIndexCounter = -1; - this.nativeTextures.push(texture); - return texture; }, /** - * Wrapper for creating WebGLFramebuffer. + * Creates a WebGL Framebuffer object and optionally binds a depth stencil render buffer. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createFramebuffer * @since 3.0.0 * - * @param {integer} width - Width in pixels of the framebuffer - * @param {integer} height - Height in pixels of the framebuffer - * @param {WebGLTexture} renderTexture - The color texture to where the color pixels are written - * @param {boolean} addDepthStencilBuffer - Indicates if the current framebuffer support depth and stencil buffers + * @param {number} width - If `addDepthStencilBuffer` is true, this controls the width of the depth stencil. + * @param {number} height - If `addDepthStencilBuffer` is true, this controls the height of the depth stencil. + * @param {WebGLTexture} renderTexture - The color texture where the color pixels are written. + * @param {boolean} [addDepthStencilBuffer=false] - Create a Renderbuffer for the depth stencil? * * @return {WebGLFramebuffer} Raw WebGLFramebuffer */ @@ -1782,6 +1904,7 @@ var WebGLRenderer = new Class({ if (addDepthStencilBuffer) { var depthStencilBuffer = gl.createRenderbuffer(); + gl.bindRenderbuffer(gl.RENDERBUFFER, depthStencilBuffer); gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height); gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, depthStencilBuffer); @@ -1803,28 +1926,30 @@ var WebGLRenderer = new Class({ 36061: 'Framebuffer Unsupported' }; - throw new Error('Framebuffer incomplete. Framebuffer status: ' + errors[complete]); + throw new Error('Framebuffer status: ' + errors[complete]); } framebuffer.renderTexture = renderTexture; this.setFramebuffer(null); - this.resetTextures(true); + this.resetTextures(); return framebuffer; }, /** - * Wrapper for creating a WebGLProgram + * Creates a WebGLProgram instance based on the given vertex and fragment shader source. + * + * Then compiles, attaches and links the program before returning it. * * @method Phaser.Renderer.WebGL.WebGLRenderer#createProgram * @since 3.0.0 * - * @param {string} vertexShader - Source to the vertex shader - * @param {string} fragmentShader - Source to the fragment shader + * @param {string} vertexShader - The vertex shader source code as a single string. + * @param {string} fragmentShader - The fragment shader source code as a single string. * - * @return {WebGLProgram} Raw WebGLProgram + * @return {WebGLProgram} The linked WebGLProgram created from the given shader source. */ createProgram: function (vertexShader, fragmentShader) { @@ -1857,6 +1982,8 @@ var WebGLRenderer = new Class({ throw new Error('Link Program failed:\n' + gl.getProgramInfoLog(program)); } + gl.useProgram(program); + return program; }, @@ -1867,7 +1994,7 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {ArrayBuffer} initialDataOrSize - It's either ArrayBuffer or an integer indicating the size of the vbo - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW + * @param {number} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW * * @return {WebGLBuffer} Raw vertex buffer */ @@ -1876,11 +2003,9 @@ var WebGLRenderer = new Class({ var gl = this.gl; var vertexBuffer = gl.createBuffer(); - this.setVertexBuffer(vertexBuffer); - + gl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer); gl.bufferData(gl.ARRAY_BUFFER, initialDataOrSize, bufferUsage); - - this.setVertexBuffer(null); + gl.bindBuffer(gl.ARRAY_BUFFER, null); return vertexBuffer; }, @@ -1892,7 +2017,7 @@ var WebGLRenderer = new Class({ * @since 3.0.0 * * @param {ArrayBuffer} initialDataOrSize - Either ArrayBuffer or an integer indicating the size of the vbo. - * @param {integer} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. + * @param {number} bufferUsage - How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. * * @return {WebGLBuffer} Raw index buffer */ @@ -1901,37 +2026,36 @@ var WebGLRenderer = new Class({ var gl = this.gl; var indexBuffer = gl.createBuffer(); - this.setIndexBuffer(indexBuffer); - + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer); gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, initialDataOrSize, bufferUsage); - - this.setIndexBuffer(null); + gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); return indexBuffer; }, /** - * Removes the given texture from the nativeTextures array and then deletes it from the GPU. + * Calls `GL.deleteTexture` on the given WebGLTexture and also optionally + * resets the currently defined textures. * * @method Phaser.Renderer.WebGL.WebGLRenderer#deleteTexture * @since 3.0.0 * * @param {WebGLTexture} texture - The WebGL Texture to be deleted. + * @param {boolean} [reset=false] - Call the `resetTextures` method after deleting this texture? * * @return {this} This WebGLRenderer instance. */ - deleteTexture: function (texture) + deleteTexture: function (texture, reset) { - var index = this.nativeTextures.indexOf(texture); - - if (index !== -1) + if (texture) { - SpliceOne(this.nativeTextures, index); + this.gl.deleteTexture(texture); } - this.gl.deleteTexture(texture); - - this.resetTextures(); + if (reset) + { + this.resetTextures(); + } return this; }, @@ -1948,7 +2072,17 @@ var WebGLRenderer = new Class({ */ deleteFramebuffer: function (framebuffer) { - this.gl.deleteFramebuffer(framebuffer); + if (framebuffer) + { + this.gl.deleteFramebuffer(framebuffer); + + ArrayRemove(this.fboStack, framebuffer); + + if (this.currentFramebuffer === framebuffer) + { + this.currentFramebuffer = null; + } + } return this; }, @@ -1965,7 +2099,10 @@ var WebGLRenderer = new Class({ */ deleteProgram: function (program) { - this.gl.deleteProgram(program); + if (program) + { + this.gl.deleteProgram(program); + } return this; }, @@ -1998,70 +2135,36 @@ var WebGLRenderer = new Class({ */ preRenderCamera: function (camera) { - var cx = camera._cx; - var cy = camera._cy; - var cw = camera._cw; - var ch = camera._ch; + var cx = camera.x; + var cy = camera.y; + var cw = camera.width; + var ch = camera.height; var color = camera.backgroundColor; - var MultiPipeline = this.pipelines.MULTI_PIPELINE; + camera.emit(CameraEvents.PRE_RENDER, camera); - if (camera.renderToTexture) + this.pipelines.preBatchCamera(camera); + + this.pushScissor(cx, cy, cw, ch); + + if (camera.mask) { - this.flush(); + this.currentCameraMask.mask = camera.mask; + this.currentCameraMask.camera = camera._maskCamera; - this.pushScissor(cx, cy, cw, -ch); - - this.setFramebuffer(camera.framebuffer); - - var gl = this.gl; - - gl.clearColor(0, 0, 0, 0); - - gl.clear(gl.COLOR_BUFFER_BIT); - - ProjectOrtho(MultiPipeline, cx, cw + cx, cy, ch + cy, -1000, 1000); - - if (camera.mask) - { - this.currentCameraMask.mask = camera.mask; - this.currentCameraMask.camera = camera._maskCamera; - - camera.mask.preRenderWebGL(this, camera, camera._maskCamera); - } - - if (color.alphaGL > 0) - { - MultiPipeline.drawFillRect( - cx, cy, cw + cx, ch + cy, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } - - camera.emit(CameraEvents.PRE_RENDER, camera); + camera.mask.preRenderWebGL(this, camera, camera._maskCamera); } - else + + if (color.alphaGL > 0) { - this.pushScissor(cx, cy, cw, ch); + var pipeline = this.pipelines.setMulti(); - if (camera.mask) - { - this.currentCameraMask.mask = camera.mask; - this.currentCameraMask.camera = camera._maskCamera; - - camera.mask.preRenderWebGL(this, camera, camera._maskCamera); - } - - if (color.alphaGL > 0) - { - MultiPipeline.drawFillRect( - cx, cy, cw , ch, - Utils.getTintFromFloats(color.redGL, color.greenGL, color.blueGL, 1), - color.alphaGL - ); - } + pipeline.drawFillRect( + cx, cy, cw, ch, + Utils.getTintFromFloats(color.blueGL, color.greenGL, color.redGL, 1), + color.alphaGL + ); } }, @@ -2092,7 +2195,8 @@ var WebGLRenderer = new Class({ /** * Controls the post-render operations for the given camera. - * Renders the foreground camera effects like flash and fading. It resets the current scissor state. + * + * Renders the foreground camera effects like flash and fading, then resets the current scissor state. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRenderCamera * @since 3.0.0 @@ -2101,70 +2205,35 @@ var WebGLRenderer = new Class({ */ postRenderCamera: function (camera) { - var multiPipeline = this.pipelines.setMulti(); + if (camera.flashEffect.isRunning || camera.fadeEffect.isRunning) + { + var pipeline = this.pipelines.setMulti(); - camera.flashEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats); - camera.fadeEffect.postRenderWebGL(multiPipeline, Utils.getTintFromFloats); + camera.flashEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats); + camera.fadeEffect.postRenderWebGL(pipeline, Utils.getTintFromFloats); + } camera.dirty = false; this.popScissor(); - if (camera.renderToTexture) - { - multiPipeline.flush(); - - this.setFramebuffer(null); - - camera.emit(CameraEvents.POST_RENDER, camera); - - if (camera.renderToGame) - { - ProjectOrtho(multiPipeline, 0, multiPipeline.width, multiPipeline.height, 0, -1000.0, 1000.0); - - var getTint = Utils.getTintAppendFloatAlpha; - - var pipeline = (camera.pipeline) ? camera.pipeline : multiPipeline; - - pipeline.batchTexture( - camera, - camera.glTexture, - camera.width, camera.height, - camera.x, camera.y, - camera.width, camera.height, - 1, 1, - 0, - camera.flipX, !camera.flipY, - 1, 1, - 0, 0, - 0, 0, camera.width, camera.height, - getTint(camera.tintTopLeft, camera._alphaTL), - getTint(camera.tintTopRight, camera._alphaTR), - getTint(camera.tintBottomLeft, camera._alphaBL), - getTint(camera.tintBottomRight, camera._alphaBR), - camera.tintFill, - 0, 0, - this.defaultCamera, - null - ); - } - - // Force clear the current texture so that items next in the batch (like Graphics) don't try and use it - this.setBlankTexture(true); - } - if (camera.mask) { this.currentCameraMask.mask = null; camera.mask.postRenderWebGL(this, camera._maskCamera); } + + this.pipelines.postBatchCamera(camera); + + camera.emit(CameraEvents.POST_RENDER, camera); }, /** * Clears the current vertex buffer and updates pipelines. * * @method Phaser.Renderer.WebGL.WebGLRenderer#preRender + * @fires Phaser.Renderer.Events#PRE_RENDER * @since 3.0.0 */ preRender: function () @@ -2187,8 +2256,6 @@ var WebGLRenderer = new Class({ gl.enable(gl.SCISSOR_TEST); - this.pipelines.preRender(); - this.currentScissor = this.defaultScissor; this.scissorStack.length = 0; @@ -2205,13 +2272,13 @@ var WebGLRenderer = new Class({ this.textureFlush = 0; - this.pipelines.setMulti(); + this.emit(Events.PRE_RENDER); }, /** * The core render step for a Scene Camera. * - * Iterates through the given Game Object's array and renders them with the given Camera. + * Iterates through the given array of Game Objects and renders them with the given Camera. * * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked * by the Scene Systems.render method. @@ -2219,20 +2286,20 @@ var WebGLRenderer = new Class({ * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * * @method Phaser.Renderer.WebGL.WebGLRenderer#render + * @fires Phaser.Renderer.Events#RENDER * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene to render. - * @param {Phaser.GameObjects.GameObject} children - The Game Object's within the Scene to be rendered. + * @param {Phaser.GameObjects.GameObject[]} children - An array of filtered Game Objects that can be rendered by the given Camera. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera to render with. */ render: function (scene, children, camera) { if (this.contextLost) { return; } - var list = children.list; - var childCount = list.length; + var childCount = children.length; - this.pipelines.render(scene, camera); + this.emit(Events.RENDER, scene, camera); // Apply scissor for cam region + render background color, if not transparent this.preRenderCamera(camera); @@ -2257,17 +2324,7 @@ var WebGLRenderer = new Class({ { this.finalType = (i === childCount - 1); - var child = list[i]; - - if (!child.willRender(camera)) - { - continue; - } - - if (child.blendMode !== this.currentBlendMode) - { - this.setBlendMode(child.blendMode); - } + var child = children[i]; var mask = child.mask; @@ -2284,6 +2341,11 @@ var WebGLRenderer = new Class({ mask.preRenderWebGL(this, child, camera); } + if (child.blendMode !== this.currentBlendMode) + { + this.setBlendMode(child.blendMode); + } + var type = child.type; if (type !== this.currentType) @@ -2292,7 +2354,14 @@ var WebGLRenderer = new Class({ this.currentType = type; } - this.nextTypeMatch = (i < childCount - 1) ? (list[i + 1].type === this.currentType) : false; + if (!this.finalType) + { + this.nextTypeMatch = (children[i + 1].type === this.currentType); + } + else + { + this.nextTypeMatch = false; + } child.renderWebGL(this, child, camera); @@ -2317,6 +2386,7 @@ var WebGLRenderer = new Class({ * The post-render step happens after all Cameras in all Scenes have been rendered. * * @method Phaser.Renderer.WebGL.WebGLRenderer#postRender + * @fires Phaser.Renderer.Events#POST_RENDER * @since 3.0.0 */ postRender: function () @@ -2325,7 +2395,7 @@ var WebGLRenderer = new Class({ this.flush(); - // Unbind custom framebuffer here + this.emit(Events.POST_RENDER); var state = this.snapshotState; @@ -2336,8 +2406,6 @@ var WebGLRenderer = new Class({ state.callback = null; } - this.pipelines.postRender(); - if (this.textureFlush > 0) { this.startActiveTexture++; @@ -2388,10 +2456,10 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotArea * @since 3.16.0 * - * @param {integer} x - The x coordinate to grab from. - * @param {integer} y - The y coordinate to grab from. - * @param {integer} width - The width of the area to grab. - * @param {integer} height - The height of the area to grab. + * @param {number} x - The x coordinate to grab from. + * @param {number} y - The y coordinate to grab from. + * @param {number} width - The width of the area to grab. + * @param {number} height - The height of the area to grab. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. @@ -2429,8 +2497,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#snapshotPixel * @since 3.16.0 * - * @param {integer} x - The x coordinate of the pixel to get. - * @param {integer} y - The y coordinate of the pixel to get. + * @param {number} x - The x coordinate of the pixel to get. + * @param {number} y - The y coordinate of the pixel to get. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot pixel data is extracted. * * @return {this} This WebGL Renderer. @@ -2458,14 +2526,14 @@ var WebGLRenderer = new Class({ * @since 3.19.0 * * @param {WebGLFramebuffer} framebuffer - The framebuffer to grab from. - * @param {integer} bufferWidth - The width of the framebuffer. - * @param {integer} bufferHeight - The height of the framebuffer. + * @param {number} bufferWidth - The width of the framebuffer. + * @param {number} bufferHeight - The height of the framebuffer. * @param {Phaser.Types.Renderer.Snapshot.SnapshotCallback} callback - The Function to invoke after the snapshot image is created. * @param {boolean} [getPixel=false] - Grab a single pixel as a Color object, or an area as an Image object? - * @param {integer} [x=0] - The x coordinate to grab from. - * @param {integer} [y=0] - The y coordinate to grab from. - * @param {integer} [width=bufferWidth] - The width of the area to grab. - * @param {integer} [height=bufferHeight] - The height of the area to grab. + * @param {number} [x=0] - The x coordinate to grab from. + * @param {number} [y=0] - The y coordinate to grab from. + * @param {number} [width=bufferWidth] - The width of the area to grab. + * @param {number} [height=bufferHeight] - The height of the area to grab. * @param {string} [type='image/png'] - The format of the image to create, usually `image/png` or `image/jpeg`. * @param {number} [encoderOptions=0.92] - The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. * @@ -2710,8 +2778,8 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#setTextureFilter * @since 3.0.0 * - * @param {integer} texture - The texture to set the filter for. - * @param {integer} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. + * @param {number} texture - The texture to set the filter for. + * @param {number} filter - The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. * * @return {this} This WebGL Renderer instance. */ @@ -2737,403 +2805,6 @@ var WebGLRenderer = new Class({ return this; }, - /** - * Sets a 1f uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 1f value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat1: function (program, name, x) - { - this.setProgram(program); - - this.gl.uniform1f(this.gl.getUniformLocation(program, name), x); - - return this; - }, - - /** - * Sets the 2f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 2f x value to set on the named uniform. - * @param {number} y - The 2f y value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat2: function (program, name, x, y) - { - this.setProgram(program); - - this.gl.uniform2f(this.gl.getUniformLocation(program, name), x, y); - - return this; - }, - - /** - * Sets the 3f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 3f x value to set on the named uniform. - * @param {number} y - The 3f y value to set on the named uniform. - * @param {number} z - The 3f z value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat3: function (program, name, x, y, z) - { - this.setProgram(program); - - this.gl.uniform3f(this.gl.getUniformLocation(program, name), x, y, z); - - return this; - }, - - /** - * Sets the 4f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {number} x - The 4f x value to set on the named uniform. - * @param {number} y - The 4f y value to set on the named uniform. - * @param {number} z - The 4f z value to set on the named uniform. - * @param {number} w - The 4f w value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat4: function (program, name, x, y, z, w) - { - this.setProgram(program); - - this.gl.uniform4f(this.gl.getUniformLocation(program, name), x, y, z, w); - - return this; - }, - - /** - * Sets the value of a 1fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat1v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat1v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform1fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat2v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat2v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform2fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat3v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - setFloat3v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform3fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets the value of a 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setFloat4v - * @since 3.13.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Float32Array} arr - The new value to be used for the uniform variable. - * - * @return {this} This WebGL Renderer instance. - */ - - setFloat4v: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform4fv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets a 1iv uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1iv - * @since 3.50.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {Int32List} arr - The 1iv value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt1iv: function (program, name, arr) - { - this.setProgram(program); - - this.gl.uniform1iv(this.gl.getUniformLocation(program, name), arr); - - return this; - }, - - /** - * Sets a 1i uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt1 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 1i value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt1: function (program, name, x) - { - this.setProgram(program); - - this.gl.uniform1i(this.gl.getUniformLocation(program, name), x); - - return this; - }, - - /** - * Sets the 2i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 2i x value to set on the named uniform. - * @param {integer} y - The 2i y value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt2: function (program, name, x, y) - { - this.setProgram(program); - - this.gl.uniform2i(this.gl.getUniformLocation(program, name), x, y); - - return this; - }, - - /** - * Sets the 3i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 3i x value to set on the named uniform. - * @param {integer} y - The 3i y value to set on the named uniform. - * @param {integer} z - The 3i z value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt3: function (program, name, x, y, z) - { - this.setProgram(program); - - this.gl.uniform3i(this.gl.getUniformLocation(program, name), x, y, z); - - return this; - }, - - /** - * Sets the 4i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setInt4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {integer} x - The 4i x value to set on the named uniform. - * @param {integer} y - The 4i y value to set on the named uniform. - * @param {integer} z - The 4i z value to set on the named uniform. - * @param {integer} w - The 4i w value to set on the named uniform. - * - * @return {this} This WebGL Renderer instance. - */ - setInt4: function (program, name, x, y, z, w) - { - this.setProgram(program); - - this.gl.uniform4i(this.gl.getUniformLocation(program, name), x, y, z, w); - - return this; - }, - - /** - * Sets the value of a matrix 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix2 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 4 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix2: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix2fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Sets the value of a matrix 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix3 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 9 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix3: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix3fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Sets the value of a matrix 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#setMatrix4 - * @since 3.0.0 - * - * @param {WebGLProgram} program - The target WebGLProgram from which the uniform location will be looked-up. - * @param {string} name - The name of the uniform to look-up and modify. - * @param {boolean} transpose - The value indicating whether to transpose the matrix. Must be false. - * @param {Float32Array} matrix - A Float32Array or sequence of 16 float values. - * - * @return {this} This WebGL Renderer instance. - */ - setMatrix4: function (program, name, transpose, matrix) - { - this.setProgram(program); - - this.gl.uniformMatrix4fv(this.gl.getUniformLocation(program, name), transpose, matrix); - - return this; - }, - - /** - * Returns the maximum number of texture units that can be used in a fragment shader. - * - * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextures - * @since 3.8.0 - * - * @return {integer} The maximum number of textures WebGL supports. - */ - getMaxTextures: function () - { - return this.config.maxTextures; - }, - /** * Returns the largest texture size (either width or height) that can be created. * Note that VRAM may not allow a texture of any given size, it just expresses @@ -3142,7 +2813,7 @@ var WebGLRenderer = new Class({ * @method Phaser.Renderer.WebGL.WebGLRenderer#getMaxTextureSize * @since 3.8.0 * - * @return {integer} The maximum supported texture size. + * @return {number} The maximum supported texture size. */ getMaxTextureSize: function () { @@ -3157,46 +2828,33 @@ var WebGLRenderer = new Class({ */ destroy: function () { - // Clear-up anything that should be cleared :) + this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); + this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - var i; var gl = this.gl; var temp = this.tempTextures; - var native = this.nativeTextures; - for (i = 0; i < temp.length; i++) + for (var i = 0; i < temp.length; i++) { gl.deleteTexture(temp[i]); } - for (i = 0; i < native.length; i++) - { - gl.deleteTexture(native[i]); - } - - this.textureIndexes = []; - this.nativeTextures = []; - this.pipelines.destroy(); - this.defaultCamera.destroy(); + this.removeAllListeners(); + this.fboStack = []; + this.maskStack = []; + this.extensions = {}; + this.textureIndexes = []; + + this.gl = null; + this.game = null; + this.canvas = null; + this.contextLost = true; this.currentMask = null; this.currentCameraMask = null; - - this.canvas.removeEventListener('webglcontextlost', this.contextLostHandler, false); - this.canvas.removeEventListener('webglcontextrestored', this.contextRestoredHandler, false); - - this.game = null; - this.gl = null; - this.canvas = null; - - this.maskStack = []; - - this.contextLost = true; - - this.extensions = {}; } }); diff --git a/src/renderer/webgl/WebGLShader.js b/src/renderer/webgl/WebGLShader.js new file mode 100644 index 000000000..534e14cd0 --- /dev/null +++ b/src/renderer/webgl/WebGLShader.js @@ -0,0 +1,1085 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../utils/Class'); +var GetFastValue = require('../../utils/object/GetFastValue'); +var WEBGL_CONST = require('./const'); + +/** + * @classdesc + * TODO + * + * @class WebGLShader + * @memberof Phaser.Renderer.WebGL + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The WebGLPipeline to which this Shader belongs. + * @param {string} name - The name of this Shader. + * @param {string} vertexShader - The vertex shader source code as a single string. + * @param {string} fragmentShader - The fragment shader source code as a single string. + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]} attributes - An array of attributes. + */ +var WebGLShader = new Class({ + + initialize: + + function WebGLShader (pipeline, name, vertexShader, fragmentShader, attributes) + { + /** + * A reference to the WebGLPipeline that owns this Shader. + * + * A Shader class can only belong to a single pipeline. + * + * @name Phaser.Renderer.WebGL.WebGLShader#pipeline + * @type {Phaser.Renderer.WebGL.WebGLPipeline} + * @since 3.50.0 + */ + this.pipeline = pipeline; + + /** + * The name of this shader. + * + * @name Phaser.Renderer.WebGL.WebGLShader#name + * @type {string} + * @since 3.50.0 + */ + this.name = name; + + /** + * A reference to the WebGLRenderer instance. + * + * @name Phaser.Renderer.WebGL.WebGLShader#renderer + * @type {Phaser.Renderer.WebGL.WebGLRenderer} + * @since 3.50.0 + */ + this.renderer = pipeline.renderer; + + /** + * A reference to the WebGL Rendering Context the WebGL Renderer is using. + * + * @name Phaser.Renderer.WebGL.WebGLShader#gl + * @type {WebGLRenderingContext} + * @since 3.50.0 + */ + this.gl = this.renderer.gl; + + /** + * The WebGLProgram created from the vertex and fragment shaders. + * + * @name Phaser.Renderer.WebGL.WebGLShader#program + * @type {WebGLProgram} + * @since 3.50.0 + */ + this.program = this.renderer.createProgram(vertexShader, fragmentShader); + + /** + * Array of objects that describe the vertex attributes. + * + * @name Phaser.Renderer.WebGL.WebGLShader#attributes + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineAttribute[]} + * @since 3.50.0 + */ + this.attributes; + + /** + * The amount of vertex attribute components of 32 bit length. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertexComponentCount + * @type {number} + * @since 3.50.0 + */ + this.vertexComponentCount = 0; + + /** + * The size, in bytes, of a single vertex. + * + * This is derived by adding together all of the vertex attributes. + * + * For example, the Multi Pipeline has the following attributes: + * + * inPosition - (size 2 x gl.FLOAT) = 8 + * inTexCoord - (size 2 x gl.FLOAT) = 8 + * inTexId - (size 1 x gl.FLOAT) = 4 + * inTintEffect - (size 1 x gl.FLOAT) = 4 + * inTint - (size 4 x gl.UNSIGNED_BYTE) = 4 + * + * The total, in this case, is 8 + 8 + 4 + 4 + 4 = 28. + * + * This is calculated automatically during the `createAttributes` method. + * + * @name Phaser.Renderer.WebGL.WebGLShader#vertexSize + * @type {number} + * @readonly + * @since 3.50.0 + */ + this.vertexSize = 0; + + /** + * The active uniforms that this shader has. + * + * This is an object that maps the uniform names to their WebGL location and cached values. + * + * It is populated automatically via the `createUniforms` method. + * + * @name Phaser.Renderer.WebGL.WebGLShader#uniforms + * @type {Phaser.Types.Renderer.WebGL.WebGLPipelineUniformsConfig} + * @since 3.50.0 + */ + this.uniforms = {}; + + this.createAttributes(attributes); + this.createUniforms(); + }, + + /** + * Takes the vertex attributes config and parses it, creating the resulting array that is stored + * in this shaders `attributes` property, calculating the offset, normalization and location + * in the process. + * + * Calling this method resets `WebGLShader.attributes`, `WebGLShader.vertexSize` and + * `WebGLShader.vertexComponentCount`. + * + * It is called automatically when this class is created, but can be called manually if required. + * + * @method Phaser.Renderer.WebGL.WebGLShader#createAttributes + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]} attributes - An array of attributes configs. + */ + createAttributes: function (attributes) + { + var count = 0; + var offset = 0; + var result = []; + + this.vertexComponentCount = 0; + + for (var i = 0; i < attributes.length; i++) + { + var element = attributes[i]; + + var name = element.name; + var size = GetFastValue(element, 'size', 1); // i.e. 1 for a float, 2 for a vec2, 4 for a vec4, etc + var glType = GetFastValue(element, 'type', WEBGL_CONST.FLOAT); + var type = glType.enum; // The GLenum + var typeSize = glType.size; // The size in bytes of the type + + var normalized = (element.normalized) ? true : false; + + result.push({ + name: name, + size: size, + type: type, + normalized: normalized, + offset: offset, + enabled: false, + location: -1 + }); + + if (typeSize === 4) + { + count += size; + } + else + { + count++; + } + + offset += size * typeSize; + } + + this.vertexSize = offset; + this.vertexComponentCount = count; + this.attributes = result; + }, + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * This method is called every time the parent pipeline is made the current active pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLShader#bind + * @since 3.50.0 + * + * @param {boolean} [setAttributes=false] - Should the vertex attribute pointers be set? + * @param {boolean} [flush=false] - Flush the pipeline before binding this shader? + * + * @return {this} This WebGLShader instance. + */ + bind: function (setAttributes, flush) + { + if (setAttributes === undefined) { setAttributes = false; } + if (flush === undefined) { flush = false; } + + if (flush) + { + this.pipeline.flush(); + } + + this.renderer.setProgram(this.program); + + if (setAttributes) + { + this.setAttribPointers(); + } + + return this; + }, + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * Then resets all of the attribute pointers. + * + * @method Phaser.Renderer.WebGL.WebGLShader#rebind + * @since 3.50.0 + * + * @return {this} This WebGLShader instance. + */ + rebind: function () + { + this.renderer.setProgram(this.program); + + this.setAttribPointers(true); + + return this; + }, + + /** + * Sets the vertex attribute pointers. + * + * This should only be called after the vertex buffer has been bound. + * + * It is called automatically during the `bind` method. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setAttribPointers + * @since 3.50.0 + * + * @param {boolean} [reset=false] - Reset the vertex attribute locations? + * + * @return {this} This WebGLShader instance. + */ + setAttribPointers: function (reset) + { + if (reset === undefined) { reset = false; } + + var gl = this.gl; + var vertexSize = this.vertexSize; + var attributes = this.attributes; + var program = this.program; + + for (var i = 0; i < attributes.length; i++) + { + var element = attributes[i]; + + var size = element.size; + var type = element.type; + var offset = element.offset; + var enabled = element.enabled; + var location = element.location; + var normalized = (element.normalized) ? true : false; + + if (reset) + { + var attribLocation = gl.getAttribLocation(program, element.name); + + if (attribLocation >= 0) + { + gl.enableVertexAttribArray(attribLocation); + + gl.vertexAttribPointer(attribLocation, size, type, normalized, vertexSize, offset); + + element.enabled = true; + element.location = attribLocation; + } + else if (attribLocation !== -1) + { + gl.disableVertexAttribArray(attribLocation); + } + } + else if (enabled) + { + gl.vertexAttribPointer(location, size, type, normalized, vertexSize, offset); + } + else if (!enabled && location > -1) + { + gl.disableVertexAttribArray(location); + + element.location = -1; + } + } + + return this; + }, + + /** + * Sets up the `WebGLShader.uniforms` object, populating it with the names + * and locations of the shader uniforms this shader requires. + * + * It works by first calling `gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS)` to + * find out how many active uniforms this shader has. It then iterates through them, + * calling `gl.getActiveUniform` to get the WebGL Active Info from each one. Finally, + * the name and location are stored in the local array. + * + * This method is called automatically when this class is created. + * + * @method Phaser.Renderer.WebGL.WebGLShader#createUniforms + * @since 3.50.0 + * + * @return {this} This WebGLShader instance. + */ + createUniforms: function () + { + var gl = this.gl; + var program = this.program; + var uniforms = this.uniforms; + + var i; + var name; + var location; + + // Look-up all active uniforms + + var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS); + + for (i = 0; i < totalUniforms; i++) + { + var info = gl.getActiveUniform(program, i); + + if (info) + { + name = info.name; + + location = gl.getUniformLocation(program, name); + + if (location !== null) + { + uniforms[name] = + { + name: name, + location: location, + value1: null, + value2: null, + value3: null, + value4: null + }; + } + + // If the uniform name contains [] for an array struct, + // we'll add an entry for the non-struct name as well. + // Such as uMainSampler[12] = uMainSampler + + var struct = name.indexOf('['); + + if (struct > 0) + { + name = name.substr(0, struct); + + if (!uniforms.hasOwnProperty(name)) + { + location = gl.getUniformLocation(program, name); + + if (location !== null) + { + uniforms[name] = + { + name: name, + location: location, + value1: null, + value2: null, + value3: null, + value4: null + }; + } + } + } + } + } + + return this; + }, + + /** + * Checks to see if the given uniform name exists and is active in this shader. + * + * @method Phaser.Renderer.WebGL.WebGLShader#hasUniform + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to check for. + * + * @return {boolean} `true` if the uniform exists, otherwise `false`. + */ + hasUniform: function (name) + { + return this.uniforms.hasOwnProperty(name); + }, + + /** + * Resets the cached values of the given uniform. + * + * @method Phaser.Renderer.WebGL.WebGLShader#resetUniform + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to reset. + * + * @return {this} This WebGLShader instance. + */ + resetUniform: function (name) + { + var uniform = this.uniforms[name]; + + if (uniform) + { + uniform.value1 = null; + uniform.value2 = null; + uniform.value3 = null; + uniform.value4 = null; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform1 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform1: function (setter, name, value1) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1) + { + uniform.value1 = value1; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform2 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform2: function (setter, name, value1, value2) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2) + { + uniform.value1 = value1; + uniform.value2 = value2; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform3 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value3 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform3: function (setter, name, value1, value2, value3) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2 || uniform.value3 !== value3) + { + uniform.value1 = value1; + uniform.value2 = value2; + uniform.value3 = value3; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2, value3); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setUniform4 + * @since 3.50.0 + * + * @param {function} setter - The GL function to call. + * @param {string} name - The name of the uniform to set. + * @param {(boolean|number|number[]|Float32Array)} value1 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value2 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value3 - The new value of the uniform. + * @param {(boolean|number|number[]|Float32Array)} value4 - The new value of the uniform. + * + * @return {this} This WebGLShader instance. + */ + setUniform4: function (setter, name, value1, value2, value3, value4) + { + var uniform = this.uniforms[name]; + + if (!uniform) + { + return this; + } + + if (uniform.value1 !== value1 || uniform.value2 !== value2 || uniform.value3 !== value3 || uniform.value4 !== value4) + { + uniform.value1 = value1; + uniform.value2 = value2; + uniform.value3 = value3; + uniform.value4 = value4; + + this.renderer.setProgram(this.program); + + setter.call(this.gl, uniform.location, value1, value2, value3, value4); + + this.pipeline.currentShader = this; + } + + return this; + }, + + /** + * Sets a 1f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `float` uniform. + * + * @return {this} This WebGLShader instance. + */ + set1f: function (name, x) + { + return this.setUniform1(this.gl.uniform1f, name, x); + }, + + /** + * Sets a 2f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec2` uniform. + * @param {number} y - The new Y component of the `vec2` uniform. + * + * @return {this} This WebGLShader instance. + */ + set2f: function (name, x, y) + { + return this.setUniform2(this.gl.uniform2f, name, x, y); + }, + + /** + * Sets a 3f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `vec3` uniform. + * @param {number} y - The new Y component of the `vec3` uniform. + * @param {number} z - The new Z component of the `vec3` uniform. + * + * @return {this} This WebGLShader instance. + */ + set3f: function (name, x, y, z) + { + return this.setUniform3(this.gl.uniform3f, name, x, y, z); + }, + + /** + * Sets a 4f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4f + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * + * @return {this} This WebGLShader instance. + */ + set4f: function (name, x, y, z, w) + { + return this.setUniform4(this.gl.uniform4f, name, x, y, z, w); + }, + + /** + * Sets a 1fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set1fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform1fv, name, arr); + }, + + /** + * Sets a 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set2fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform2fv, name, arr); + }, + + /** + * Sets a 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set3fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform3fv, name, arr); + }, + + /** + * Sets a 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set4fv: function (name, arr) + { + return this.setUniform1(this.gl.uniform4fv, name, arr); + }, + + /** + * Sets a 1iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set1iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform1iv, name, arr); + }, + + /** + * Sets a 2iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set2iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform2iv, name, arr); + }, + + /** + * Sets a 3iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set3iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform3iv, name, arr); + }, + + /** + * Sets a 4iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4iv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number[]|Float32Array} arr - The new value to be used for the uniform variable. + * + * @return {this} This WebGLShader instance. + */ + set4iv: function (name, arr) + { + return this.setUniform1(this.gl.uniform4iv, name, arr); + }, + + /** + * Sets a 1i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set1i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new value of the `int` uniform. + * + * @return {this} This WebGLShader instance. + */ + set1i: function (name, x) + { + return this.setUniform1(this.gl.uniform1i, name, x); + }, + + /** + * Sets a 2i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set2i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec2` uniform. + * @param {number} y - The new Y component of the `ivec2` uniform. + * + * @return {this} This WebGLShader instance. + */ + set2i: function (name, x, y) + { + return this.setUniform2(this.gl.uniform2i, name, x, y); + }, + + /** + * Sets a 3i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set3i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - The new X component of the `ivec3` uniform. + * @param {number} y - The new Y component of the `ivec3` uniform. + * @param {number} z - The new Z component of the `ivec3` uniform. + * + * @return {this} This WebGLShader instance. + */ + set3i: function (name, x, y, z) + { + return this.setUniform3(this.gl.uniform3i, name, x, y, z); + }, + + /** + * Sets a 4i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#set4i + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {number} x - X component of the uniform + * @param {number} y - Y component of the uniform + * @param {number} z - Z component of the uniform + * @param {number} w - W component of the uniform + * + * @return {this} This WebGLShader instance. + */ + set4i: function (name, x, y, z, w) + { + return this.setUniform4(this.gl.uniform4i, name, x, y, z, w); + }, + + /** + * Sets a matrix 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix2fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {number[]|Float32Array} matrix - The new values for the `mat2` uniform. + * + * @return {this} This WebGLShader instance. + */ + setMatrix2fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix2fv, name, transpose, matrix); + }, + + /** + * Sets a matrix 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix3fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Whether to transpose the matrix. Should be `false`. + * @param {Float32Array} matrix - The new values for the `mat3` uniform. + * + * @return {this} This WebGLShader instance. + */ + setMatrix3fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix3fv, name, transpose, matrix); + }, + + /** + * Sets a matrix 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * + * @method Phaser.Renderer.WebGL.WebGLShader#setMatrix4fv + * @since 3.50.0 + * + * @param {string} name - The name of the uniform to set. + * @param {boolean} transpose - Should the matrix be transpose + * @param {Float32Array} matrix - Matrix data + * + * @return {this} This WebGLShader instance. + */ + setMatrix4fv: function (name, transpose, matrix) + { + return this.setUniform2(this.gl.uniformMatrix4fv, name, transpose, matrix); + }, + + /** + * Removes all external references from this class and deletes the WebGL program from the WebGL context. + * + * Does not remove this shader from the parent pipeline. + * + * @method Phaser.Renderer.WebGL.WebGLShader#destroy + * @since 3.50.0 + */ + destroy: function () + { + this.gl.deleteProgram(this.program); + + this.pipeline = null; + this.renderer = null; + this.gl = null; + this.program = null; + this.attributes = null; + this.uniforms = null; + } + +}); + +module.exports = WebGLShader; diff --git a/src/renderer/webgl/const.js b/src/renderer/webgl/const.js new file mode 100644 index 000000000..c0fb80724 --- /dev/null +++ b/src/renderer/webgl/const.js @@ -0,0 +1,74 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var WEBGL_CONST = { + + /** + * 8-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.BYTE + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + BYTE: { enum: 0x1400, size: 1 }, + + /** + * 8-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_BYTE + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_BYTE: { enum: 0x1401, size: 1 }, + + /** + * 16-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.SHORT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + SHORT: { enum: 0x1402, size: 2 }, + + /** + * 16-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_SHORT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_SHORT: { enum: 0x1403, size: 2 }, + + /** + * 32-bit twos complement signed integer. + * + * @name Phaser.Renderer.WebGL.INT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + INT: { enum: 0x1404, size: 4 }, + + /** + * 32-bit twos complement unsigned integer. + * + * @name Phaser.Renderer.WebGL.UNSIGNED_INT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + UNSIGNED_INT: { enum: 0x1405, size: 4 }, + + /** + * 32-bit IEEE floating point number. + * + * @name Phaser.Renderer.WebGL.FLOAT + * @type {Phaser.Types.Renderer.WebGL.WebGLConst} + * @since 3.50.0 + */ + FLOAT: { enum: 0x1406, size: 4 } + +}; + +module.exports = WEBGL_CONST; diff --git a/src/renderer/webgl/index.js b/src/renderer/webgl/index.js index dfb8f18f1..46f8a989a 100644 --- a/src/renderer/webgl/index.js +++ b/src/renderer/webgl/index.js @@ -4,17 +4,29 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var WEBGL_CONST = require('./const'); +var Extend = require('../../utils/object/Extend'); + /** * @namespace Phaser.Renderer.WebGL */ -module.exports = { +var WebGL = { PipelineManager: require('./PipelineManager'), Pipelines: require('./pipelines'), - MVP: require('./mvp'), + RenderTarget: require('./RenderTarget'), Utils: require('./Utils'), WebGLPipeline: require('./WebGLPipeline'), - WebGLRenderer: require('./WebGLRenderer') + WebGLRenderer: require('./WebGLRenderer'), + WebGLShader: require('./WebGLShader') }; + +// Merge in the consts + +WebGL = Extend(false, WebGL, WEBGL_CONST); + +// Export it + +module.exports = WebGL; diff --git a/src/renderer/webgl/mvp/Identity.js b/src/renderer/webgl/mvp/Identity.js deleted file mode 100644 index e879f53b3..000000000 --- a/src/renderer/webgl/mvp/Identity.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SetIdentity = require('./SetIdentity'); - -/** - * Loads an identity matrix into the model matrix. - * - * @method Phaser.Renderer.WebGL.MVP.Identity - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Identity = function (model) -{ - SetIdentity(model.modelMatrix); - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Identity; diff --git a/src/renderer/webgl/mvp/ProjectIdentity.js b/src/renderer/webgl/mvp/ProjectIdentity.js deleted file mode 100644 index 4bcb50959..000000000 --- a/src/renderer/webgl/mvp/ProjectIdentity.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SetIdentity = require('./SetIdentity'); - -/** - * Loads an identity matrix into the projection matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ProjectIdentity - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ProjectIdentity = function (model) -{ - SetIdentity(model.projectionMatrix); - - model.projectionMatrixDirty = true; - - return model; -}; - -module.exports = ProjectIdentity; diff --git a/src/renderer/webgl/mvp/ProjectOrtho.js b/src/renderer/webgl/mvp/ProjectOrtho.js deleted file mode 100644 index c49220fda..000000000 --- a/src/renderer/webgl/mvp/ProjectOrtho.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Translates the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.ProjectOrtho - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} left - The left value. - * @param {number} right - The right value. - * @param {number} bottom - The bottom value. - * @param {number} top - The top value. - * @param {number} near - The near value. - * @param {number} far - The far value. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ProjectOrtho = function (model, left, right, bottom, top, near, far) -{ - var projectionMatrix = model.projectionMatrix; - var leftRight = 1 / (left - right); - var bottomTop = 1 / (bottom - top); - var nearFar = 1 / (near - far); - - projectionMatrix[0] = -2 * leftRight; - projectionMatrix[1] = 0; - projectionMatrix[2] = 0; - projectionMatrix[3] = 0; - projectionMatrix[4] = 0; - projectionMatrix[5] = -2 * bottomTop; - projectionMatrix[6] = 0; - projectionMatrix[7] = 0; - projectionMatrix[8] = 0; - projectionMatrix[9] = 0; - projectionMatrix[10] = 2 * nearFar; - projectionMatrix[11] = 0; - projectionMatrix[12] = (left + right) * leftRight; - projectionMatrix[13] = (top + bottom) * bottomTop; - projectionMatrix[14] = (far + near) * nearFar; - projectionMatrix[15] = 1; - - model.projectionMatrixDirty = true; - - return model; -}; - -module.exports = ProjectOrtho; diff --git a/src/renderer/webgl/mvp/ProjectPerspective.js b/src/renderer/webgl/mvp/ProjectPerspective.js deleted file mode 100644 index 357843054..000000000 --- a/src/renderer/webgl/mvp/ProjectPerspective.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Sets up a perspective projection matrix into the projection matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ProjectPerspective - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} fovY - The fov value. - * @param {number} aspectRatio - The aspectRatio value. - * @param {number} near - The near value. - * @param {number} far - The far value. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ProjectPerspective = function (model, fovY, aspectRatio, near, far) -{ - var projectionMatrix = model.projectionMatrix; - var fov = 1 / Math.tan(fovY / 2); - var nearFar = 1 / (near - far); - - projectionMatrix[0] = fov / aspectRatio; - projectionMatrix[1] = 0; - projectionMatrix[2] = 0; - projectionMatrix[3] = 0; - projectionMatrix[4] = 0; - projectionMatrix[5] = fov; - projectionMatrix[6] = 0; - projectionMatrix[7] = 0; - projectionMatrix[8] = 0; - projectionMatrix[9] = 0; - projectionMatrix[10] = (far + near) * nearFar; - projectionMatrix[11] = -1; - projectionMatrix[12] = 0; - projectionMatrix[13] = 0; - projectionMatrix[14] = (2 * far * near) * nearFar; - projectionMatrix[15] = 0; - - model.projectionMatrixDirty = true; - - return model; -}; - -module.exports = ProjectPerspective; diff --git a/src/renderer/webgl/mvp/RotateX.js b/src/renderer/webgl/mvp/RotateX.js deleted file mode 100644 index 76e6242d3..000000000 --- a/src/renderer/webgl/mvp/RotateX.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotates the model matrix around the X axis. - * - * @method Phaser.Renderer.WebGL.MVP.RotateX - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} radians - The amount to rotate by. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var RotateX = function (model, radians) -{ - var modelMatrix = model.modelMatrix; - - var s = Math.sin(radians); - var c = Math.cos(radians); - - var a10 = modelMatrix[4]; - var a11 = modelMatrix[5]; - var a12 = modelMatrix[6]; - var a13 = modelMatrix[7]; - var a20 = modelMatrix[8]; - var a21 = modelMatrix[9]; - var a22 = modelMatrix[10]; - var a23 = modelMatrix[11]; - - modelMatrix[4] = a10 * c + a20 * s; - modelMatrix[5] = a11 * c + a21 * s; - modelMatrix[6] = a12 * c + a22 * s; - modelMatrix[7] = a13 * c + a23 * s; - modelMatrix[8] = a20 * c - a10 * s; - modelMatrix[9] = a21 * c - a11 * s; - modelMatrix[10] = a22 * c - a12 * s; - modelMatrix[11] = a23 * c - a13 * s; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = RotateX; diff --git a/src/renderer/webgl/mvp/RotateY.js b/src/renderer/webgl/mvp/RotateY.js deleted file mode 100644 index 31c36910e..000000000 --- a/src/renderer/webgl/mvp/RotateY.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotates the model matrix around the Y axis. - * - * @method Phaser.Renderer.WebGL.MVP.RotateY - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} radians - The amount to rotate by. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var RotateY = function (model, radians) -{ - var modelMatrix = model.modelMatrix; - - var s = Math.sin(radians); - var c = Math.cos(radians); - - var a00 = modelMatrix[0]; - var a01 = modelMatrix[1]; - var a02 = modelMatrix[2]; - var a03 = modelMatrix[3]; - var a20 = modelMatrix[8]; - var a21 = modelMatrix[9]; - var a22 = modelMatrix[10]; - var a23 = modelMatrix[11]; - - modelMatrix[0] = a00 * c - a20 * s; - modelMatrix[1] = a01 * c - a21 * s; - modelMatrix[2] = a02 * c - a22 * s; - modelMatrix[3] = a03 * c - a23 * s; - modelMatrix[8] = a00 * s + a20 * c; - modelMatrix[9] = a01 * s + a21 * c; - modelMatrix[10] = a02 * s + a22 * c; - modelMatrix[11] = a03 * s + a23 * c; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = RotateY; diff --git a/src/renderer/webgl/mvp/RotateZ.js b/src/renderer/webgl/mvp/RotateZ.js deleted file mode 100644 index 45c4bd550..000000000 --- a/src/renderer/webgl/mvp/RotateZ.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotates the model matrix around the Z axis. - * - * @method Phaser.Renderer.WebGL.MVP.RotateZ - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} radians - The amount to rotate by. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var RotateZ = function (model, radians) -{ - var modelMatrix = model.modelMatrix; - - var s = Math.sin(radians); - var c = Math.cos(radians); - - var a00 = modelMatrix[0]; - var a01 = modelMatrix[1]; - var a02 = modelMatrix[2]; - var a03 = modelMatrix[3]; - var a10 = modelMatrix[4]; - var a11 = modelMatrix[5]; - var a12 = modelMatrix[6]; - var a13 = modelMatrix[7]; - - modelMatrix[0] = a00 * c + a10 * s; - modelMatrix[1] = a01 * c + a11 * s; - modelMatrix[2] = a02 * c + a12 * s; - modelMatrix[3] = a03 * c + a13 * s; - modelMatrix[4] = a10 * c - a00 * s; - modelMatrix[5] = a11 * c - a01 * s; - modelMatrix[6] = a12 * c - a02 * s; - modelMatrix[7] = a13 * c - a03 * s; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = RotateZ; diff --git a/src/renderer/webgl/mvp/Scale.js b/src/renderer/webgl/mvp/Scale.js deleted file mode 100644 index acc02af0d..000000000 --- a/src/renderer/webgl/mvp/Scale.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Scales the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.Scale - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Scale = function (model, x, y, z) -{ - var modelMatrix = model.modelMatrix; - - modelMatrix[0] = modelMatrix[0] * x; - modelMatrix[1] = modelMatrix[1] * x; - modelMatrix[2] = modelMatrix[2] * x; - modelMatrix[3] = modelMatrix[3] * x; - modelMatrix[4] = modelMatrix[4] * y; - modelMatrix[5] = modelMatrix[5] * y; - modelMatrix[6] = modelMatrix[6] * y; - modelMatrix[7] = modelMatrix[7] * y; - modelMatrix[8] = modelMatrix[8] * z; - modelMatrix[9] = modelMatrix[9] * z; - modelMatrix[10] = modelMatrix[10] * z; - modelMatrix[11] = modelMatrix[11] * z; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Scale; diff --git a/src/renderer/webgl/mvp/SetIdentity.js b/src/renderer/webgl/mvp/SetIdentity.js deleted file mode 100644 index 8f220e8d9..000000000 --- a/src/renderer/webgl/mvp/SetIdentity.js +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Loads an identity matrix into the model matrix. - * - * @method Phaser.Renderer.WebGL.MVP.SetIdentity - * @since 3.50.0 - * - * @param {Float32Array} array - The array to set to be an identity matrix. - */ -var SetIdentity = function (array) -{ - array[0] = 1; - array[1] = 0; - array[2] = 0; - array[3] = 0; - array[4] = 0; - array[5] = 1; - array[6] = 0; - array[7] = 0; - array[8] = 0; - array[9] = 0; - array[10] = 1; - array[11] = 0; - array[12] = 0; - array[13] = 0; - array[14] = 0; - array[15] = 1; -}; - -module.exports = SetIdentity; diff --git a/src/renderer/webgl/mvp/Translate.js b/src/renderer/webgl/mvp/Translate.js deleted file mode 100644 index 99e07a8a8..000000000 --- a/src/renderer/webgl/mvp/Translate.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Translates the model matrix by the given values. - * - * @method Phaser.Renderer.WebGL.MVP.Translate - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var Translate = function (model, x, y, z) -{ - var modelMatrix = model.modelMatrix; - - modelMatrix[12] = modelMatrix[0] * x + modelMatrix[4] * y + modelMatrix[8] * z + modelMatrix[12]; - modelMatrix[13] = modelMatrix[1] * x + modelMatrix[5] * y + modelMatrix[9] * z + modelMatrix[13]; - modelMatrix[14] = modelMatrix[2] * x + modelMatrix[6] * y + modelMatrix[10] * z + modelMatrix[14]; - modelMatrix[15] = modelMatrix[3] * x + modelMatrix[7] * y + modelMatrix[11] * z + modelMatrix[15]; - - model.modelMatrixDirty = true; - - return model; -}; - -module.exports = Translate; diff --git a/src/renderer/webgl/mvp/ViewIdentity.js b/src/renderer/webgl/mvp/ViewIdentity.js deleted file mode 100644 index 31aa30755..000000000 --- a/src/renderer/webgl/mvp/ViewIdentity.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var SetIdentity = require('./SetIdentity'); - -/** - * Loads an identity matrix into the view matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ViewIdentity - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewIdentity = function (model) -{ - SetIdentity(model.viewMatrix); -}; - -module.exports = ViewIdentity; diff --git a/src/renderer/webgl/mvp/ViewLoad.js b/src/renderer/webgl/mvp/ViewLoad.js deleted file mode 100644 index 8eb4896f9..000000000 --- a/src/renderer/webgl/mvp/ViewLoad.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Copies a 4x4 matrix into the view matrix - * - * @method Phaser.Renderer.WebGL.MVP.ViewLoad - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {Float32Array} matrix - A Float32Array containing the Matrix2d to copy into the MVP view matrix. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewLoad = function (model, matrix) -{ - var vm = model.viewMatrix; - - vm[0] = matrix[0]; - vm[1] = matrix[1]; - vm[2] = matrix[2]; - vm[3] = matrix[3]; - vm[4] = matrix[4]; - vm[5] = matrix[5]; - vm[6] = matrix[6]; - vm[7] = matrix[7]; - vm[8] = matrix[8]; - vm[9] = matrix[9]; - vm[10] = matrix[10]; - vm[11] = matrix[11]; - vm[12] = matrix[12]; - vm[13] = matrix[13]; - vm[14] = matrix[14]; - vm[15] = matrix[15]; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewLoad; diff --git a/src/renderer/webgl/mvp/ViewLoad2D.js b/src/renderer/webgl/mvp/ViewLoad2D.js deleted file mode 100644 index 51caaac24..000000000 --- a/src/renderer/webgl/mvp/ViewLoad2D.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ViewLoad2D - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {Float32Array} matrix2D - The Matrix2D. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewLoad2D = function (model, matrix2D) -{ - var vm = model.viewMatrix; - - vm[0] = matrix2D[0]; - vm[1] = matrix2D[1]; - vm[2] = 0; - vm[3] = 0; - vm[4] = matrix2D[2]; - vm[5] = matrix2D[3]; - vm[6] = 0; - vm[7] = 0; - vm[8] = matrix2D[4]; - vm[9] = matrix2D[5]; - vm[10] = 1; - vm[11] = 0; - vm[12] = 0; - vm[13] = 0; - vm[14] = 0; - vm[15] = 1; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewLoad2D; diff --git a/src/renderer/webgl/mvp/ViewRotateX.js b/src/renderer/webgl/mvp/ViewRotateX.js deleted file mode 100644 index 4b21a7bd7..000000000 --- a/src/renderer/webgl/mvp/ViewRotateX.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotates the view matrix around the X axis. - * - * @method Phaser.Renderer.WebGL.MVP.ViewRotateX - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} radians - The amnount to rotate by. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewRotateX = function (model, radians) -{ - var viewMatrix = model.viewMatrix; - - var s = Math.sin(radians); - var c = Math.cos(radians); - - var a10 = viewMatrix[4]; - var a11 = viewMatrix[5]; - var a12 = viewMatrix[6]; - var a13 = viewMatrix[7]; - var a20 = viewMatrix[8]; - var a21 = viewMatrix[9]; - var a22 = viewMatrix[10]; - var a23 = viewMatrix[11]; - - viewMatrix[4] = a10 * c + a20 * s; - viewMatrix[5] = a11 * c + a21 * s; - viewMatrix[6] = a12 * c + a22 * s; - viewMatrix[7] = a13 * c + a23 * s; - viewMatrix[8] = a20 * c - a10 * s; - viewMatrix[9] = a21 * c - a11 * s; - viewMatrix[10] = a22 * c - a12 * s; - viewMatrix[11] = a23 * c - a13 * s; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewRotateX; diff --git a/src/renderer/webgl/mvp/ViewRotateY.js b/src/renderer/webgl/mvp/ViewRotateY.js deleted file mode 100644 index 90977bb28..000000000 --- a/src/renderer/webgl/mvp/ViewRotateY.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotates the view matrix around the Y axis. - * - * @method Phaser.Renderer.WebGL.MVP.ViewRotateY - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} radians - The amnount to rotate by. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewRotateY = function (model, radians) -{ - var viewMatrix = model.viewMatrix; - - var s = Math.sin(radians); - var c = Math.cos(radians); - - var a00 = viewMatrix[0]; - var a01 = viewMatrix[1]; - var a02 = viewMatrix[2]; - var a03 = viewMatrix[3]; - var a20 = viewMatrix[8]; - var a21 = viewMatrix[9]; - var a22 = viewMatrix[10]; - var a23 = viewMatrix[11]; - - viewMatrix[0] = a00 * c - a20 * s; - viewMatrix[1] = a01 * c - a21 * s; - viewMatrix[2] = a02 * c - a22 * s; - viewMatrix[3] = a03 * c - a23 * s; - viewMatrix[8] = a00 * s + a20 * c; - viewMatrix[9] = a01 * s + a21 * c; - viewMatrix[10] = a02 * s + a22 * c; - viewMatrix[11] = a03 * s + a23 * c; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewRotateY; diff --git a/src/renderer/webgl/mvp/ViewRotateZ.js b/src/renderer/webgl/mvp/ViewRotateZ.js deleted file mode 100644 index c1e91ccf5..000000000 --- a/src/renderer/webgl/mvp/ViewRotateZ.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Rotates the view matrix around the Z axis. - * - * @method Phaser.Renderer.WebGL.MVP.ViewRotateZ - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} radians - The amnount to rotate by. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewRotateZ = function (model, radians) -{ - var viewMatrix = model.viewMatrix; - - var s = Math.sin(radians); - var c = Math.cos(radians); - - var a00 = viewMatrix[0]; - var a01 = viewMatrix[1]; - var a02 = viewMatrix[2]; - var a03 = viewMatrix[3]; - var a10 = viewMatrix[4]; - var a11 = viewMatrix[5]; - var a12 = viewMatrix[6]; - var a13 = viewMatrix[7]; - - viewMatrix[0] = a00 * c + a10 * s; - viewMatrix[1] = a01 * c + a11 * s; - viewMatrix[2] = a02 * c + a12 * s; - viewMatrix[3] = a03 * c + a13 * s; - viewMatrix[4] = a10 * c - a00 * s; - viewMatrix[5] = a11 * c - a01 * s; - viewMatrix[6] = a12 * c - a02 * s; - viewMatrix[7] = a13 * c - a03 * s; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewRotateZ; diff --git a/src/renderer/webgl/mvp/ViewScale.js b/src/renderer/webgl/mvp/ViewScale.js deleted file mode 100644 index 2d5078322..000000000 --- a/src/renderer/webgl/mvp/ViewScale.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Scales the view matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ViewScale - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewScale = function (model, x, y, z) -{ - var viewMatrix = model.viewMatrix; - - viewMatrix[0] = viewMatrix[0] * x; - viewMatrix[1] = viewMatrix[1] * x; - viewMatrix[2] = viewMatrix[2] * x; - viewMatrix[3] = viewMatrix[3] * x; - viewMatrix[4] = viewMatrix[4] * y; - viewMatrix[5] = viewMatrix[5] * y; - viewMatrix[6] = viewMatrix[6] * y; - viewMatrix[7] = viewMatrix[7] * y; - viewMatrix[8] = viewMatrix[8] * z; - viewMatrix[9] = viewMatrix[9] * z; - viewMatrix[10] = viewMatrix[10] * z; - viewMatrix[11] = viewMatrix[11] * z; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewScale; diff --git a/src/renderer/webgl/mvp/ViewTranslate.js b/src/renderer/webgl/mvp/ViewTranslate.js deleted file mode 100644 index 409569107..000000000 --- a/src/renderer/webgl/mvp/ViewTranslate.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Translates the view matrix. - * - * @method Phaser.Renderer.WebGL.MVP.ViewTranslate - * @since 3.50.0 - * - * @param {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} model - The Model View Projection object. - * @param {number} x - The x component. - * @param {number} y - The y component. - * @param {number} z - The z component. - * - * @return {Phaser.Renderer.WebGL.Pipelines.ModelViewProjection} The Model View Projection object. - */ -var ViewTranslate = function (model, x, y, z) -{ - var viewMatrix = model.viewMatrix; - - viewMatrix[12] = viewMatrix[0] * x + viewMatrix[4] * y + viewMatrix[8] * z + viewMatrix[12]; - viewMatrix[13] = viewMatrix[1] * x + viewMatrix[5] * y + viewMatrix[9] * z + viewMatrix[13]; - viewMatrix[14] = viewMatrix[2] * x + viewMatrix[6] * y + viewMatrix[10] * z + viewMatrix[14]; - viewMatrix[15] = viewMatrix[3] * x + viewMatrix[7] * y + viewMatrix[11] * z + viewMatrix[15]; - - model.viewMatrixDirty = true; - - return model; -}; - -module.exports = ViewTranslate; diff --git a/src/renderer/webgl/mvp/index.js b/src/renderer/webgl/mvp/index.js deleted file mode 100644 index 99557293a..000000000 --- a/src/renderer/webgl/mvp/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * @namespace Phaser.Renderer.WebGL.MVP - */ - -module.exports = { - - Identity: require('./Identity'), - ProjectIdentity: require('./ProjectIdentity'), - ProjectOrtho: require('./ProjectOrtho'), - ProjectPerspective: require('./ProjectPerspective'), - RotateX: require('./RotateX'), - RotateY: require('./RotateY'), - RotateZ: require('./RotateZ'), - Scale: require('./Scale'), - SetIdentity: require('./SetIdentity'), - Translate: require('./Translate'), - ViewIdentity: require('./ViewIdentity'), - ViewLoad: require('./ViewLoad'), - ViewLoad2D: require('./ViewLoad2D'), - ViewRotateX: require('./ViewRotateX'), - ViewRotateY: require('./ViewRotateY'), - ViewRotateZ: require('./ViewRotateZ'), - ViewScale: require('./ViewScale'), - ViewTranslate: require('./ViewTranslate') - -}; diff --git a/src/renderer/webgl/pipelines/BitmapMaskPipeline.js b/src/renderer/webgl/pipelines/BitmapMaskPipeline.js index 5cf475263..c00561f83 100644 --- a/src/renderer/webgl/pipelines/BitmapMaskPipeline.js +++ b/src/renderer/webgl/pipelines/BitmapMaskPipeline.js @@ -9,6 +9,7 @@ var Class = require('../../../utils/Class'); var GetFastValue = require('../../../utils/object/GetFastValue'); var ShaderSourceFS = require('../shaders/BitmapMask-frag.js'); var ShaderSourceVS = require('../shaders/BitmapMask-vert.js'); +var WEBGL_CONST = require('../const'); var WebGLPipeline = require('../WebGLPipeline'); /** @@ -50,53 +51,32 @@ var BitmapMaskPipeline = new Class({ { config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS), config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS), - config.vertexSize = GetFastValue(config, 'vertexSize', 8), - config.vertexCapacity = GetFastValue(config, 'vertexCapacity', 3), - config.vertices = GetFastValue(config, 'vertices', new Float32Array([ -1, 1, -1, -7, 7, 1 ]).buffer), + config.batchSize = GetFastValue(config, 'batchSize', 1), + config.vertices = GetFastValue(config, 'vertices', [ -1, 1, -1, -7, 7, 1 ]), config.attributes = GetFastValue(config, 'attributes', [ { name: 'inPosition', size: 2, - type: config.game.renderer.gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 + type: WEBGL_CONST.FLOAT } ]); - config.uniforms = GetFastValue(config, 'uniforms', [ - 'uResolution', - 'uMainSampler', - 'uMaskSampler', - 'uInvertMaskAlpha' - ]); WebGLPipeline.call(this, config); }, - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) + boot: function () { - if (reset === undefined) { reset = false; } + WebGLPipeline.prototype.boot.call(this); - WebGLPipeline.prototype.bind.call(this, reset); - - this.set2f('uResolution', this.width, this.height); this.set1i('uMainSampler', 0); this.set1i('uMaskSampler', 1); + }, - return this; + resize: function (width, height) + { + WebGLPipeline.prototype.resize.call(this, width, height); + + this.set2f('uResolution', width, height); }, /** @@ -112,19 +92,16 @@ var BitmapMaskPipeline = new Class({ */ beginMask: function (mask, maskedObject, camera) { - var renderer = this.renderer; var gl = this.gl; // The renderable Game Object that is being used for the bitmap mask - var bitmapMask = mask.bitmapMask; - - if (bitmapMask && gl) + if (mask.bitmapMask && gl) { + var renderer = this.renderer; + renderer.flush(); - mask.prevFramebuffer = renderer.currentFramebuffer; - - renderer.setFramebuffer(mask.mainFramebuffer); + renderer.pushFramebuffer(mask.mainFramebuffer); gl.disable(gl.STENCIL_TEST); gl.clearColor(0, 0, 0, 0); @@ -159,11 +136,13 @@ var BitmapMaskPipeline = new Class({ if (bitmapMask && gl) { + // mask.mainFramebuffer should now contain all the Game Objects we want masked renderer.flush(); - // First we draw the mask to the mask fb - renderer.setFramebuffer(mask.maskFramebuffer); + // Swap to the mask framebuffer (push, in case the bitmapMask GO has a post-pipeline) + renderer.pushFramebuffer(mask.maskFramebuffer); + // Clear it and draw the Game Object that is acting as a mask to it gl.clearColor(0, 0, 0, 0); gl.clear(gl.COLOR_BUFFER_BIT); @@ -173,7 +152,9 @@ var BitmapMaskPipeline = new Class({ renderer.flush(); - renderer.setFramebuffer(mask.prevFramebuffer); + // Clear the mask framebuffer + main framebuffer + renderer.popFramebuffer(); + renderer.popFramebuffer(); // Is there a stencil further up the stack? var prev = renderer.getCurrentStencilMask(); @@ -189,7 +170,7 @@ var BitmapMaskPipeline = new Class({ renderer.currentMask.mask = null; } - // Bind bitmap mask pipeline and draw + // Bind this pipeline and draw renderer.pipelines.set(this); gl.activeTexture(gl.TEXTURE1); @@ -202,6 +183,8 @@ var BitmapMaskPipeline = new Class({ // Finally, draw a triangle filling the whole screen gl.drawArrays(this.topology, 0, 3); + + renderer.resetTextures(); } } diff --git a/src/renderer/webgl/pipelines/GraphicsPipeline.js b/src/renderer/webgl/pipelines/GraphicsPipeline.js new file mode 100644 index 000000000..c968689d9 --- /dev/null +++ b/src/renderer/webgl/pipelines/GraphicsPipeline.js @@ -0,0 +1,677 @@ +/** + * @author Richard Davey + * @author Felipe Alfonso <@bitnenfer> + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../../utils/Class'); +var Earcut = require('../../../geom/polygon/Earcut'); +var GetFastValue = require('../../../utils/object/GetFastValue'); +var ShaderSourceFS = require('../shaders/Graphics-frag.js'); +var ShaderSourceVS = require('../shaders/Graphics-vert.js'); +var TransformMatrix = require('../../../gameobjects/components/TransformMatrix'); +var WEBGL_CONST = require('../const'); +var WebGLPipeline = require('../WebGLPipeline'); + +/** + * @classdesc + * The Graphics Pipeline is the rendering pipeline used by Phaser in WebGL when drawing + * primitive geometry objects, such as the Graphics Game Object, or the Shape Game Objects + * such as Arc, Line, Rectangle and Star. It handles the preperation and batching of related vertices. + * + * Prior to Phaser v3.50 the functions of this pipeline were merged with the `TextureTintPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Graphics.frag`. + * The vertex shader it uses can be found in `shaders/src/Graphics.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2) + * `inColor` (vec4, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * + * @class GraphicsPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var GraphicsPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function GraphicsPipeline (config) + { + config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); + config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2 + }, + { + name: 'inColor', + size: 4, + type: WEBGL_CONST.UNSIGNED_BYTE, + normalized: true + } + ]); + + WebGLPipeline.call(this, config); + + /** + * A temporary Transform Matrix, re-used internally during batching by the + * Shape Game Objects. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#calcMatrix + * @type {Phaser.GameObjects.Components.TransformMatrix} + * @since 3.50.0 + */ + this.calcMatrix = new TransformMatrix(); + + /** + * Used internally to draw stroked triangles. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#tempTriangle + * @type {array} + * @private + * @since 3.50.0 + */ + this.tempTriangle = [ + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 }, + { x: 0, y: 0, width: 0 } + ]; + + /** + * Cached stroke tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#strokeTint + * @type {object} + * @private + * @since 3.50.0 + */ + this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Cached fill tint. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#fillTint + * @type {object} + * @private + * @since 3.50.0 + */ + this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; + + /** + * Internal texture frame reference. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#currentFrame + * @type {Phaser.Textures.Frame} + * @private + * @since 3.50.0 + */ + this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#firstQuad + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.firstQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Internal path quad cache. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#prevQuad + * @type {number[]} + * @private + * @since 3.50.0 + */ + this.prevQuad = [ 0, 0, 0, 0, 0 ]; + + /** + * Used internally for triangulating a polygon. + * + * @name Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#polygonCache + * @type {array} + * @private + * @since 3.50.0 + */ + this.polygonCache = []; + }, + + /** + * Pushes a filled rectangle into the vertex batch. + * + * Rectangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillRect + * @since 3.50.0 + * + * @param {number} x - Horizontal top left coordinate of the rectangle. + * @param {number} y - Vertical top left coordinate of the rectangle. + * @param {number} width - Width of the rectangle. + * @param {number} height - Height of the rectangle. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var xw = x + width; + var yh = y + height; + + var x0 = calcMatrix.getX(x, y); + var y0 = calcMatrix.getY(x, y); + + var x1 = calcMatrix.getX(x, yh); + var y1 = calcMatrix.getY(x, yh); + + var x2 = calcMatrix.getX(xw, yh); + var y2 = calcMatrix.getY(xw, yh); + + var x3 = calcMatrix.getX(xw, y); + var y3 = calcMatrix.getY(xw, y); + + var tint = this.fillTint; + + this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, tint.TL, tint.TR, tint.BL, tint.BR); + }, + + /** + * Pushes a filled triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillTriangle + * @since 3.50.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + var tint = this.fillTint; + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tint.TL, tint.TR, tint.BL); + }, + + /** + * Pushes a stroked triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokeTriangle + * @since 3.50.0 + * + * @param {number} x0 - Point 0 x coordinate. + * @param {number} y0 - Point 0 y coordinate. + * @param {number} x1 - Point 1 x coordinate. + * @param {number} y1 - Point 1 y coordinate. + * @param {number} x2 - Point 2 x coordinate. + * @param {number} y2 - Point 2 y coordinate. + * @param {number} lineWidth - The width of the line in pixels. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) + { + var tempTriangle = this.tempTriangle; + + tempTriangle[0].x = x0; + tempTriangle[0].y = y0; + tempTriangle[0].width = lineWidth; + + tempTriangle[1].x = x1; + tempTriangle[1].y = y1; + tempTriangle[1].width = lineWidth; + + tempTriangle[2].x = x2; + tempTriangle[2].y = y2; + tempTriangle[2].width = lineWidth; + + tempTriangle[3].x = x0; + tempTriangle[3].y = y0; + tempTriangle[3].width = lineWidth; + + this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchFillPath + * @since 3.50.0 + * + * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchFillPath: function (path, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var length = path.length; + var polygonCache = this.polygonCache; + var polygonIndexArray; + var point; + + var tintTL = this.fillTint.TL; + var tintTR = this.fillTint.TR; + var tintBL = this.fillTint.BL; + + for (var pathIndex = 0; pathIndex < length; ++pathIndex) + { + point = path[pathIndex]; + polygonCache.push(point.x, point.y); + } + + polygonIndexArray = Earcut(polygonCache); + length = polygonIndexArray.length; + + for (var index = 0; index < length; index += 3) + { + var p0 = polygonIndexArray[index + 0] * 2; + var p1 = polygonIndexArray[index + 1] * 2; + var p2 = polygonIndexArray[index + 2] * 2; + + var x0 = polygonCache[p0 + 0]; + var y0 = polygonCache[p0 + 1]; + var x1 = polygonCache[p1 + 0]; + var y1 = polygonCache[p1 + 1]; + var x2 = polygonCache[p2 + 0]; + var y2 = polygonCache[p2 + 1]; + + var tx0 = calcMatrix.getX(x0, y0); + var ty0 = calcMatrix.getY(x0, y0); + + var tx1 = calcMatrix.getX(x1, y1); + var ty1 = calcMatrix.getY(x1, y1); + + var tx2 = calcMatrix.getX(x2, y2); + var ty2 = calcMatrix.getY(x2, y2); + + this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, tintTL, tintTR, tintBL); + } + + polygonCache.length = 0; + }, + + /** + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchStrokePath + * @since 3.50.0 + * + * @param {Phaser.Types.Math.Vector2Like[]} path - Collection of points that represent the path. + * @param {number} lineWidth - The width of the line segments in pixels. + * @param {boolean} pathOpen - Indicates if the path should be closed or left open. + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + // Reset the closePath booleans + this.prevQuad[4] = 0; + this.firstQuad[4] = 0; + + var pathLength = path.length - 1; + + for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) + { + var point0 = path[pathIndex]; + var point1 = path[pathIndex + 1]; + + this.batchLine( + point0.x, + point0.y, + point1.x, + point1.y, + point0.width / 2, + point1.width / 2, + lineWidth, + pathIndex, + !pathOpen && (pathIndex === pathLength - 1), + currentMatrix, + parentMatrix + ); + } + }, + + /** + * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchLine + * @since 3.50.0 + * + * @param {number} ax - x coordinate of the start of the line. + * @param {number} ay - y coordinate of the start of the line. + * @param {number} bx - x coordinate of the end of the line. + * @param {number} by - y coordinate of the end of the line. + * @param {number} aLineWidth - Width of the start of the line. + * @param {number} bLineWidth - Width of the end of the line. + * @param {number} index - If this line is part of a multi-line draw, the index of the line in the draw. + * @param {boolean} closePath - Does this line close a multi-line path? + * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. + * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. + */ + batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) + { + this.renderer.pipelines.set(this); + + var calcMatrix = this.calcMatrix; + + // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix + if (parentMatrix) + { + parentMatrix.multiply(currentMatrix, calcMatrix); + } + + var dx = bx - ax; + var dy = by - ay; + + var len = Math.sqrt(dx * dx + dy * dy); + var al0 = aLineWidth * (by - ay) / len; + var al1 = aLineWidth * (ax - bx) / len; + var bl0 = bLineWidth * (by - ay) / len; + var bl1 = bLineWidth * (ax - bx) / len; + + var lx0 = bx - bl0; + var ly0 = by - bl1; + var lx1 = ax - al0; + var ly1 = ay - al1; + var lx2 = bx + bl0; + var ly2 = by + bl1; + var lx3 = ax + al0; + var ly3 = ay + al1; + + // tx0 = bottom right + var brX = calcMatrix.getX(lx0, ly0); + var brY = calcMatrix.getY(lx0, ly0); + + // tx1 = bottom left + var blX = calcMatrix.getX(lx1, ly1); + var blY = calcMatrix.getY(lx1, ly1); + + // tx2 = top right + var trX = calcMatrix.getX(lx2, ly2); + var trY = calcMatrix.getY(lx2, ly2); + + // tx3 = top left + var tlX = calcMatrix.getX(lx3, ly3); + var tlY = calcMatrix.getY(lx3, ly3); + + var tint = this.strokeTint; + + var tintTL = tint.TL; + var tintTR = tint.TR; + var tintBL = tint.BL; + var tintBR = tint.BR; + + // TL, BL, BR, TR + this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, tintTL, tintTR, tintBL, tintBR); + + if (lineWidth <= 2) + { + // No point doing a linejoin if the line isn't thick enough + return; + } + + var prev = this.prevQuad; + var first = this.firstQuad; + + if (index > 0 && prev[4]) + { + this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], tintTL, tintTR, tintBL, tintBR); + } + else + { + first[0] = tlX; + first[1] = tlY; + first[2] = blX; + first[3] = blY; + first[4] = 1; + } + + if (closePath && first[4]) + { + // Add a join for the final path segment + this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], tintTL, tintTR, tintBL, tintBR); + } + else + { + // Store it + + prev[0] = brX; + prev[1] = brY; + prev[2] = trX; + prev[3] = trY; + prev[4] = 1; + } + }, + + /** + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchVert + * @since 3.50.0 + * + * @param {number} x - The vertex x position. + * @param {number} y - The vertex y position. + * @param {number} tint - The tint color value. + */ + batchVert: function (x, y, tint) + { + var vertexViewF32 = this.vertexViewF32; + var vertexViewU32 = this.vertexViewU32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewU32[++vertexOffset] = tint; + + this.vertexCount++; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchQuad + * @override + * @since 3.50.0 + * + * @param {number} x0 - The top-left x position. + * @param {number} y0 - The top-left y position. + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * @param {number} tintBR - The bottom-right tint color value. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, tintTL, tintTR, tintBL, tintBR) + { + var hasFlushed = false; + + if (this.shouldFlush(6)) + { + this.flush(); + + hasFlushed = true; + } + + this.batchVert(x0, y0, tintTL); + this.batchVert(x1, y1, tintBL); + this.batchVert(x2, y2, tintBR); + this.batchVert(x0, y0, tintTL); + this.batchVert(x2, y2, tintBR); + this.batchVert(x3, y3, tintTR); + + return hasFlushed; + }, + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#batchTri + * @override + * @since 3.50.0 + * + * @param {number} x1 - The bottom-left x position. + * @param {number} y1 - The bottom-left y position. + * @param {number} x2 - The bottom-right x position. + * @param {number} y2 - The bottom-right y position. + * @param {number} x3 - The top-right x position. + * @param {number} y3 - The top-right y position. + * @param {number} tintTL - The top-left tint color value. + * @param {number} tintTR - The top-right tint color value. + * @param {number} tintBL - The bottom-left tint color value. + * + * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. + */ + batchTri: function (x0, y0, x1, y1, x2, y2, tintTL, tintTR, tintBL) + { + var hasFlushed = false; + + if (this.shouldFlush(3)) + { + this.flush(); + + hasFlushed = true; + } + + this.batchVert(x0, y0, tintTL); + this.batchVert(x1, y1, tintTR); + this.batchVert(x2, y2, tintBL); + + return hasFlushed; + }, + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + * + * @method Phaser.Renderer.WebGL.Pipelines.GraphicsPipeline#destroy + * @since 3.50.0 + * + * @return {this} This WebGLPipeline instance. + */ + destroy: function () + { + WebGLPipeline.prototype.destroy.call(this); + + this.polygonCache = null; + + return this; + } + +}); + +module.exports = GraphicsPipeline; diff --git a/src/renderer/webgl/pipelines/LightPipeline.js b/src/renderer/webgl/pipelines/LightPipeline.js index 4de2661a8..10070dfdd 100644 --- a/src/renderer/webgl/pipelines/LightPipeline.js +++ b/src/renderer/webgl/pipelines/LightPipeline.js @@ -7,15 +7,16 @@ var Class = require('../../../utils/Class'); var GetFastValue = require('../../../utils/object/GetFastValue'); -var ShaderSourceFS = require('../shaders/Light-frag.js'); +var LightShaderSourceFS = require('../shaders/Light-frag.js'); var MultiPipeline = require('./MultiPipeline'); +var Vec2 = require('../../../math/Vector2'); var WebGLPipeline = require('../WebGLPipeline'); var LIGHT_COUNT = 10; +var tempVec2 = new Vec2(); /** * @classdesc - * * The Light Pipeline is an extension of the Multi Pipeline and uses a custom shader * designed to handle forward diffused rendering of 2D lights in a Scene. * @@ -71,9 +72,19 @@ var LightPipeline = new Class({ { LIGHT_COUNT = config.game.renderer.config.maxLights; - var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); + var fragShader = GetFastValue(config, 'fragShader', LightShaderSourceFS); - config.fragShader = fragmentShaderSource.replace('%LIGHT_COUNT%', LIGHT_COUNT.toString()); + var shaders = []; + + for (var i = 1; i <= LIGHT_COUNT; i++) + { + shaders.push({ + name: 'lights' + i, + fragShader: fragShader.replace('%LIGHT_COUNT%', i.toString()) + }); + } + + config.shaders = shaders; MultiPipeline.call(this, config); @@ -100,17 +111,6 @@ var LightPipeline = new Class({ * @since 3.50.0 */ this.defaultNormalMap; - - /** - * Stores the previous number of lights rendered. - * - * @name Phaser.Renderer.WebGL.Pipelines.LightPipeline#lightCount - * @type {number} - * @since 3.50.0 - */ - this.lightCount = 0; - - this.forceZero = true; }, /** @@ -119,7 +119,7 @@ var LightPipeline = new Class({ * By this stage all Game level systems are now in place and you can perform any final * tasks that the pipeline may need that relied on game systems such as the Texture Manager. * - * @method Phaser.Renderer.WebGL.LightPipeline#boot + * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#boot * @since 3.11.0 */ boot: function () @@ -138,118 +138,71 @@ var LightPipeline = new Class({ this.defaultNormalMap = { glTexture: tempTexture }; - return this; - }, - - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - var renderer = this.renderer; - var program = this.program; - - renderer.setInt1(program, 'uMainSampler', 0); - renderer.setInt1(program, 'uNormSampler', 1); - renderer.setFloat2(program, 'uResolution', this.width, this.height); - - return this; + // Set the lights shaders + for (var i = 0; i < this.shaders.length; i++) + { + this['lightShader' + (i + 1)] = this.shaders[i]; + } }, /** * This function sets all the needed resources for each camera pass. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#onRender + * @ignore * @since 3.0.0 * * @param {Phaser.Scene} scene - The Scene being rendered. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Scene Camera being rendered with. - * - * @return {this} This WebGLPipeline instance. */ onRender: function (scene, camera) { - this.active = false; - var lightManager = scene.sys.lights; - if (!lightManager || lightManager.lights.length <= 0 || !lightManager.active) + if (!lightManager || !lightManager.active) { - // Passthru - return this; + return; } - var lights = lightManager.cull(camera); - var lightCount = Math.min(lights.length, LIGHT_COUNT); + var lights = lightManager.getLights(camera); + var lightsCount = lights.length; - if (lightCount === 0) + if (lightsCount === 0) { - return this; + return; } - this.active = true; + // Ok, we're good to go ... + + this.setShader(this['lightShader' + lightsCount], true); - var renderer = this.renderer; - var program = this.program; - var cameraMatrix = camera.matrix; - var point = {x: 0, y: 0}; - var height = renderer.height; var i; + var renderer = this.renderer; + var height = renderer.height; + var cameraMatrix = camera.matrix; - if (lightCount !== this.lightCount) + this.set1i('uMainSampler', 0); + this.set1i('uNormSampler', 1); + this.set2f('uResolution', this.width / 2, this.height / 2); + this.set4f('uCamera', camera.x, camera.y, camera.rotation, camera.zoom); + this.set3f('uAmbientLightColor', lightManager.ambientColor.r, lightManager.ambientColor.g, lightManager.ambientColor.b); + + for (i = 0; i < lightsCount; i++) { - for (i = 0; i < LIGHT_COUNT; i++) - { - // Reset lights - renderer.setFloat1(program, 'uLights[' + i + '].radius', 0); - } + var light = lights[i].light; + var color = light.color; - this.lightCount = lightCount; - } - - if (camera.dirty) - { - renderer.setFloat4(program, 'uCamera', camera.x, camera.y, camera.rotation, camera.zoom); - } - - // TODO - Only if dirty! and cache the location - renderer.setFloat3(program, 'uAmbientLightColor', lightManager.ambientColor.r, lightManager.ambientColor.g, lightManager.ambientColor.b); - - for (i = 0; i < lightCount; i++) - { - var light = lights[i]; var lightName = 'uLights[' + i + '].'; - cameraMatrix.transformPoint(light.x, light.y, point); + cameraMatrix.transformPoint(light.x, light.y, tempVec2); - // TODO - Cache the uniform locations!!! - renderer.setFloat2(program, lightName + 'position', point.x - (camera.scrollX * light.scrollFactorX * camera.zoom), height - (point.y - (camera.scrollY * light.scrollFactorY) * camera.zoom)); - - if (light.dirty) - { - renderer.setFloat3(program, lightName + 'color', light.r, light.g, light.b); - renderer.setFloat1(program, lightName + 'intensity', light.intensity); - renderer.setFloat1(program, lightName + 'radius', light.radius); - light.dirty = false; - } + this.set2f(lightName + 'position', tempVec2.x - (camera.scrollX * light.scrollFactorX * camera.zoom), height - (tempVec2.y - (camera.scrollY * light.scrollFactorY) * camera.zoom)); + this.set3f(lightName + 'color', color.r, color.g, color.b); + this.set1f(lightName + 'intensity', light.intensity); + this.set1f(lightName + 'radius', light.radius); } this.currentNormalMapRotation = null; - - return this; }, /** @@ -288,7 +241,7 @@ var LightPipeline = new Class({ inverseRotationMatrix[1] = inverseRotationMatrix[3] = 0; } - this.renderer.setMatrix3(this.program, 'uInverseRotationMatrix', false, inverseRotationMatrix); + this.setMatrix3fv('uInverseRotationMatrix', false, inverseRotationMatrix); this.currentNormalMapRotation = rotation; } @@ -298,6 +251,7 @@ var LightPipeline = new Class({ * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#setTexture2D + * @ignore * @since 3.50.0 * * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. @@ -311,7 +265,7 @@ var LightPipeline = new Class({ var normalTexture = this.getNormalMap(gameObject); - if (renderer.isNewNormalMap()) + if (renderer.isNewNormalMap(texture, normalTexture)) { this.flush(); @@ -333,6 +287,7 @@ var LightPipeline = new Class({ * for the given Game Object. It must return the texture unit the Game Object was assigned. * * @method Phaser.Renderer.WebGL.Pipelines.LightPipeline#setGameObject + * @ignore * @since 3.50.0 * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object being rendered or added to the batch. diff --git a/src/renderer/webgl/pipelines/MultiPipeline.js b/src/renderer/webgl/pipelines/MultiPipeline.js index beaa6347b..69aea0a08 100644 --- a/src/renderer/webgl/pipelines/MultiPipeline.js +++ b/src/renderer/webgl/pipelines/MultiPipeline.js @@ -6,14 +6,12 @@ */ var Class = require('../../../utils/Class'); -var Earcut = require('../../../geom/polygon/Earcut'); var GetFastValue = require('../../../utils/object/GetFastValue'); -var ModelViewProjection = require('./components/ModelViewProjection'); -var ProjectOrtho = require('../mvp/ProjectOrtho'); var ShaderSourceFS = require('../shaders/Multi-frag.js'); var ShaderSourceVS = require('../shaders/Multi-vert.js'); var TransformMatrix = require('../../../gameobjects/components/TransformMatrix'); var Utils = require('../Utils'); +var WEBGL_CONST = require('../const'); var WebGLPipeline = require('../WebGLPipeline'); /** @@ -44,8 +42,6 @@ var WebGLPipeline = require('../WebGLPipeline'); * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uViewMatrix` (mat4) - * `uModelMatrix` (mat4) * `uMainSampler` (sampler2D array) * * If you wish to create a custom pipeline extending from this one, you can use two string @@ -72,91 +68,41 @@ var MultiPipeline = new Class({ Extends: WebGLPipeline, - Mixins: [ - ModelViewProjection - ], - initialize: function MultiPipeline (config) { var renderer = config.game.renderer; - var gl = renderer.gl; var fragmentShaderSource = GetFastValue(config, 'fragShader', ShaderSourceFS); - // Vertex Size = attribute size added together (2 + 2 + 1 + 1 + 4) inc maxTextures - config.fragShader = Utils.parseFragmentShaderMaxTextures(fragmentShaderSource, renderer.maxTextures); config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); config.attributes = GetFastValue(config, 'attributes', [ { name: 'inPosition', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 + size: 2 }, { name: 'inTexCoord', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 8, - enabled: false, - location: -1 + size: 2 }, { - name: 'inTexId', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 16, - enabled: false, - location: -1 + name: 'inTexId' }, { - name: 'inTintEffect', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 20, - enabled: false, - location: -1 + name: 'inTintEffect' }, { name: 'inTint', size: 4, - type: gl.UNSIGNED_BYTE, - normalized: true, - offset: 24, - enabled: false, - location: -1 + type: WEBGL_CONST.UNSIGNED_BYTE, + normalized: true } ]); WebGLPipeline.call(this, config); - /** - * Float32 view of the array buffer containing the pipeline's vertices. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#vertexViewF32 - * @type {Float32Array} - * @since 3.0.0 - */ - this.vertexViewF32 = new Float32Array(this.vertexData); - - /** - * Uint32 view of the array buffer containing the pipeline's vertices. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#vertexViewU32 - * @type {Uint32Array} - * @since 3.0.0 - */ - this.vertexViewU32 = new Uint32Array(this.vertexData); - /** * A temporary Transform Matrix, re-used internally during batching. * @@ -186,108 +132,6 @@ var MultiPipeline = new Class({ * @since 3.11.0 */ this._tempMatrix3 = new TransformMatrix(); - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#_tempMatrix4 - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.11.0 - */ - this._tempMatrix4 = new TransformMatrix(); - - /** - * Used internally to draw stroked triangles. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tempTriangle - * @type {array} - * @private - * @since 3.12.0 - */ - this.tempTriangle = [ - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 }, - { x: 0, y: 0, width: 0 } - ]; - - /** - * The tint effect to be applied by the shader in the next geometry draw: - * - * 0 = texture multiplied by color - * 1 = solid color + texture alpha - * 2 = solid color, no texture - * 3 = solid texture, no color - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#tintEffect - * @type {number} - * @private - * @since 3.12.0 - */ - this.tintEffect = 2; - - /** - * Cached stroke tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#strokeTint - * @type {object} - * @private - * @since 3.12.0 - */ - this.strokeTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Cached fill tint. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#fillTint - * @type {object} - * @private - * @since 3.12.0 - */ - this.fillTint = { TL: 0, TR: 0, BL: 0, BR: 0 }; - - /** - * Internal texture frame reference. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#currentFrame - * @type {Phaser.Textures.Frame} - * @private - * @since 3.12.0 - */ - this.currentFrame = { u0: 0, v0: 0, u1: 1, v1: 1 }; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#firstQuad - * @type {array} - * @private - * @since 3.12.0 - */ - this.firstQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Internal path quad cache. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#prevQuad - * @type {array} - * @private - * @since 3.12.0 - */ - this.prevQuad = [ 0, 0, 0, 0, 0 ]; - - /** - * Used internally for triangulating a polygon. - * - * @name Phaser.Renderer.WebGL.Pipelines.MultiPipeline#polygonCache - * @type {array} - * @private - * @since 3.12.0 - */ - this.polygonCache = []; - - this.mvpInit(); }, /** @@ -298,108 +142,13 @@ var MultiPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#bind * @since 3.50.0 * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * * @return {this} This WebGLPipeline instance. */ - bind: function (reset) + boot: function () { - if (reset === undefined) { reset = false; } + WebGLPipeline.prototype.boot.call(this); - WebGLPipeline.prototype.bind.call(this, reset); - - this.renderer.setInt1iv(this.program, 'uMainSampler', this.renderer.textureIndexes); - - return this; - }, - - /** - * Called every time a Game Object needs to use this pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#onBind - * @since 3.0.0 - * - * @param {Phaser.GameObjects.GameObject} [gameObject] - The Game Object that invoked this pipeline, if any. - * - * @return {this} This WebGLPipeline instance. - */ - onBind: function () - { - this.mvpUpdate(); - - return this; - }, - - /** - * Resizes this pipeline and updates the projection. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#resize - * @since 3.0.0 - * - * @param {number} width - The new width. - * @param {number} height - The new height. - * - * @return {this} This WebGLPipeline instance. - */ - resize: function (width, height) - { - WebGLPipeline.prototype.resize.call(this, width, height); - - ProjectOrtho(this, 0, this.width, this.height, 0, -1000, 1000); - - return this; - }, - - /** - * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#setTexture2D - * @since 3.1.0 - * - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. - * - * @return {number} The assigned texture unit. - */ - setTexture2D: function (texture) - { - if (texture === undefined) { texture = this.renderer.whiteTexture.glTexture; } - - this.currentUnit = this.renderer.setTexture2D(texture); - - return this.currentUnit; - }, - - /** - * Uploads the vertex data and emits a draw call for the current batch of vertices. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#flush - * @since 3.0.0 - * - * @return {this} This WebGLPipeline instance. - */ - flush: function () - { - var gl = this.gl; - var vertexCount = this.vertexCount; - var vertexSize = this.vertexSize; - - if (vertexCount > 0) - { - if (vertexCount === this.vertexCapacity) - { - gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.DYNAMIC_DRAW); - } - else - { - gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.bytes.subarray(0, vertexCount * vertexSize)); - } - - gl.drawArrays(this.topology, 0, vertexCount); - - this.vertexCount = 0; - } - - return this; + this.currentShader.set1iv('uMainSampler', this.renderer.textureIndexes); }, /** @@ -408,20 +157,19 @@ var MultiPipeline = new Class({ * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchSprite * @since 3.0.0 * - * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} sprite - The texture based Game Object to add to the batch. + * @param {(Phaser.GameObjects.Image|Phaser.GameObjects.Sprite)} gameObject - The texture based Game Object to add to the batch. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use for the rendering transform. * @param {Phaser.GameObjects.Components.TransformMatrix} [parentTransformMatrix] - The transform matrix of the parent container, if set. */ - batchSprite: function (sprite, camera, parentTransformMatrix) + batchSprite: function (gameObject, camera, parentTransformMatrix) { - // Will cause a flush if this isn't the current pipeline, vertexbuffer or program - this.renderer.pipelines.set(this); + this.manager.set(this, gameObject); var camMatrix = this._tempMatrix1; var spriteMatrix = this._tempMatrix2; var calcMatrix = this._tempMatrix3; - var frame = sprite.frame; + var frame = gameObject.frame; var texture = frame.glTexture; var u0 = frame.u0; @@ -434,19 +182,19 @@ var MultiPipeline = new Class({ var frameHeight = frame.cutHeight; var customPivot = frame.customPivot; - var displayOriginX = sprite.displayOriginX; - var displayOriginY = sprite.displayOriginY; + var displayOriginX = gameObject.displayOriginX; + var displayOriginY = gameObject.displayOriginY; var x = -displayOriginX + frameX; var y = -displayOriginY + frameY; - if (sprite.isCropped) + if (gameObject.isCropped) { - var crop = sprite._crop; + var crop = gameObject._crop; - if (crop.flipX !== sprite.flipX || crop.flipY !== sprite.flipY) + if (crop.flipX !== gameObject.flipX || crop.flipY !== gameObject.flipY) { - frame.updateCropUVs(crop, sprite.flipX, sprite.flipY); + frame.updateCropUVs(crop, gameObject.flipX, gameObject.flipY); } u0 = crop.u0; @@ -467,7 +215,7 @@ var MultiPipeline = new Class({ var flipX = 1; var flipY = 1; - if (sprite.flipX) + if (gameObject.flipX) { if (!customPivot) { @@ -478,7 +226,8 @@ var MultiPipeline = new Class({ } // Auto-invert the flipY if this is coming from a GLTexture - if (sprite.flipY || (frame.source.isGLTexture && !texture.flipY)) + + if (gameObject.flipY || (frame.source.isGLTexture && !texture.flipY)) { if (!customPivot) { @@ -488,23 +237,23 @@ var MultiPipeline = new Class({ flipY = -1; } - spriteMatrix.applyITRS(sprite.x, sprite.y, sprite.rotation, sprite.scaleX * flipX, sprite.scaleY * flipY); + spriteMatrix.applyITRS(gameObject.x, gameObject.y, gameObject.rotation, gameObject.scaleX * flipX, gameObject.scaleY * flipY); camMatrix.copyFrom(camera.matrix); if (parentTransformMatrix) { // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * sprite.scrollFactorX, -camera.scrollY * sprite.scrollFactorY); + camMatrix.multiplyWithOffset(parentTransformMatrix, -camera.scrollX * gameObject.scrollFactorX, -camera.scrollY * gameObject.scrollFactorY); // Undo the camera scroll - spriteMatrix.e = sprite.x; - spriteMatrix.f = sprite.y; + spriteMatrix.e = gameObject.x; + spriteMatrix.f = gameObject.y; } else { - spriteMatrix.e -= camera.scrollX * sprite.scrollFactorX; - spriteMatrix.f -= camera.scrollY * sprite.scrollFactorY; + spriteMatrix.e -= camera.scrollX * gameObject.scrollFactorX; + spriteMatrix.f -= camera.scrollY * gameObject.scrollFactorY; } // Multiply by the Sprite matrix, store result in calcMatrix @@ -513,252 +262,40 @@ var MultiPipeline = new Class({ var xw = x + frameWidth; var yh = y + frameHeight; - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); + var roundPixels = camera.roundPixels; - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); - var tintTL = Utils.getTintAppendFloatAlpha(sprite.tintTopLeft, camera.alpha * sprite._alphaTL); - var tintTR = Utils.getTintAppendFloatAlpha(sprite.tintTopRight, camera.alpha * sprite._alphaTR); - var tintBL = Utils.getTintAppendFloatAlpha(sprite.tintBottomLeft, camera.alpha * sprite._alphaBL); - var tintBR = Utils.getTintAppendFloatAlpha(sprite.tintBottomRight, camera.alpha * sprite._alphaBR); + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); + var getTint = Utils.getTintAppendFloatAlpha; + var cameraAlpha = camera.alpha; - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - // So batchQuad never assigns a unit to the glTexture, but to the textureSource instead - if (this.shouldFlush(6)) - { - this.flush(); - } - - var unit = this.setGameObject(sprite); - - var tintEffect = sprite.tintFill; - - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit); - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchQuad - * @since 3.12.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; + var tintTL = getTint(gameObject.tintTopLeft, cameraAlpha * gameObject._alphaTL); + var tintTR = getTint(gameObject.tintTopRight, cameraAlpha * gameObject._alphaTR); + var tintBL = getTint(gameObject.tintBottomLeft, cameraAlpha * gameObject._alphaBL); + var tintBR = getTint(gameObject.tintBottomRight, cameraAlpha * gameObject._alphaBR); if (this.shouldFlush(6)) { this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); } - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; + var unit = this.setGameObject(gameObject, frame); - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; + this.manager.preBatch(gameObject); - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; + this.batchQuad(gameObject, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, gameObject.tintFill, texture, unit); - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - this.vertexCount += 6; - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchTri - * @since 3.12.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - Texture unit to which the texture needs to be bound. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.shouldFlush(3)) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - tintEffect = 1; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = unit; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - this.vertexCount += 3; - - return hasFlushed; + this.manager.postBatch(gameObject); }, /** @@ -769,8 +306,8 @@ var MultiPipeline = new Class({ * * @param {Phaser.GameObjects.GameObject} gameObject - Source GameObject. * @param {WebGLTexture} texture - Raw WebGLTexture associated with the quad. - * @param {integer} textureWidth - Real texture width. - * @param {integer} textureHeight - Real texture height. + * @param {number} textureWidth - Real texture width. + * @param {number} textureHeight - Real texture height. * @param {number} srcX - X coordinate of the quad. * @param {number} srcY - Y coordinate of the quad. * @param {number} srcWidth - Width of the quad. @@ -788,10 +325,10 @@ var MultiPipeline = new Class({ * @param {number} frameY - Y coordinate of the texture frame. * @param {number} frameWidth - Width of the texture frame. * @param {number} frameHeight - Height of the texture frame. - * @param {integer} tintTL - Tint for top left. - * @param {integer} tintTR - Tint for top right. - * @param {integer} tintBL - Tint for bottom left. - * @param {integer} tintBR - Tint for bottom right. + * @param {number} tintTL - Tint for top left. + * @param {number} tintTR - Tint for top right. + * @param {number} tintBL - Tint for bottom left. + * @param {number} tintBR - Tint for bottom right. * @param {number} tintEffect - The tint effect. * @param {number} uOffset - Horizontal offset on texture coordinate. * @param {number} vOffset - Vertical offset on texture coordinate. @@ -819,9 +356,7 @@ var MultiPipeline = new Class({ skipFlip, textureUnit) { - var renderer = this.renderer; - - renderer.pipelines.set(this, gameObject); + this.manager.set(this, gameObject); var camMatrix = this._tempMatrix1; var spriteMatrix = this._tempMatrix2; @@ -842,11 +377,14 @@ var MultiPipeline = new Class({ { var crop = gameObject._crop; - width = crop.width; - height = crop.height; + var cropWidth = crop.width; + var cropHeight = crop.height; - srcWidth = crop.width; - srcHeight = crop.height; + width = cropWidth; + height = cropHeight; + + srcWidth = cropWidth; + srcHeight = cropHeight; frameX = crop.x; frameY = crop.y; @@ -856,18 +394,18 @@ var MultiPipeline = new Class({ if (flipX) { - ox = (frameWidth - crop.x - crop.width); + ox = (frameWidth - crop.x - cropWidth); } - if (flipY && !texture.isRenderTexture) + if (flipY) { - oy = (frameHeight - crop.y - crop.height); + oy = (frameHeight - crop.y - cropHeight); } u0 = (ox / textureWidth) + uOffset; v0 = (oy / textureHeight) + vOffset; - u1 = (ox + crop.width) / textureWidth + uOffset; - v1 = (oy + crop.height) / textureHeight + vOffset; + u1 = (ox + cropWidth) / textureWidth + uOffset; + v1 = (oy + cropHeight) / textureHeight + vOffset; x = -displayOriginX + frameX; y = -displayOriginY + frameY; @@ -913,39 +451,36 @@ var MultiPipeline = new Class({ // Multiply by the Sprite matrix, store result in calcMatrix camMatrix.multiply(spriteMatrix, calcMatrix); - var tx0 = calcMatrix.getX(x, y); - var ty0 = calcMatrix.getY(x, y); + var roundPixels = camera.roundPixels; - var tx1 = calcMatrix.getX(x, yh); - var ty1 = calcMatrix.getY(x, yh); + var tx0 = calcMatrix.getXRound(x, y, roundPixels); + var ty0 = calcMatrix.getYRound(x, y, roundPixels); - var tx2 = calcMatrix.getX(xw, yh); - var ty2 = calcMatrix.getY(xw, yh); + var tx1 = calcMatrix.getXRound(x, yh, roundPixels); + var ty1 = calcMatrix.getYRound(x, yh, roundPixels); - var tx3 = calcMatrix.getX(xw, y); - var ty3 = calcMatrix.getY(xw, y); + var tx2 = calcMatrix.getXRound(xw, yh, roundPixels); + var ty2 = calcMatrix.getYRound(xw, yh, roundPixels); - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } + var tx3 = calcMatrix.getXRound(xw, y, roundPixels); + var ty3 = calcMatrix.getYRound(xw, y, roundPixels); if (textureUnit === undefined) { textureUnit = this.renderer.setTexture2D(texture); } - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + if (gameObject) + { + this.manager.preBatch(gameObject); + } + + this.batchQuad(gameObject, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, textureUnit); + + if (gameObject) + { + this.manager.postBatch(gameObject); + } }, /** @@ -970,7 +505,7 @@ var MultiPipeline = new Class({ parentTransformMatrix ) { - this.renderer.pipelines.set(this); + this.manager.set(this); var spriteMatrix = this._tempMatrix1.copyFrom(transformMatrix); var calcMatrix = this._tempMatrix2; @@ -999,436 +534,11 @@ var MultiPipeline = new Class({ var tx3 = calcMatrix.getX(xw, y); var ty3 = calcMatrix.getY(xw, y); - // this.setTexture2D(frame.glTexture, 0); var unit = this.renderer.setTextureSource(frame.source); tint = Utils.getTintAppendFloatAlpha(tint, alpha); - this.batchQuad(tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, unit); - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * - * The dimensions are run through `Math.floor` before the quad is generated. - * - * Rectangle has no transform values and isn't transformed into the local space. - * - * Used for directly batching untransformed rectangles, such as Camera background colors. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#drawFillRect - * @since 3.12.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {number} color - Color of the rectangle to draw. - * @param {number} alpha - Alpha value of the rectangle to draw. - */ - drawFillRect: function (x, y, width, height, color, alpha) - { - x = Math.floor(x); - y = Math.floor(y); - - var xw = Math.floor(x + width); - var yh = Math.floor(y + height); - - var white = this.renderer.whiteTexture.glTexture; - - var unit = this.renderer.setTexture2D(white); - - var tint = Utils.getTintAppendFloatAlpha(color, alpha); - - this.batchQuad(x, y, x, yh, xw, yh, xw, y, 0, 0, 1, 1, tint, tint, tint, tint, 1, white, unit); - }, - - /** - * Pushes a filled rectangle into the vertex batch. - * Rectangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillRect - * @since 3.12.0 - * - * @param {number} x - Horizontal top left coordinate of the rectangle. - * @param {number} y - Vertical top left coordinate of the rectangle. - * @param {number} width - Width of the rectangle. - * @param {number} height - Height of the rectangle. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillRect: function (x, y, width, height, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var xw = x + width; - var yh = y + height; - - var x0 = calcMatrix.getX(x, y); - var y0 = calcMatrix.getY(x, y); - - var x1 = calcMatrix.getX(x, yh); - var y1 = calcMatrix.getY(x, yh); - - var x2 = calcMatrix.getX(xw, yh); - var y2 = calcMatrix.getY(xw, yh); - - var x3 = calcMatrix.getX(xw, y); - var y3 = calcMatrix.getY(xw, y); - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - var tint = this.fillTint; - - this.batchQuad(x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tint.TL, tint.TR, tint.BL, tint.BR, this.tintEffect); - }, - - /** - * Pushes a filled triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillTriangle - * @since 3.12.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillTriangle: function (x0, y0, x1, y1, x2, y2, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, this.fillTint.TL, this.fillTint.TR, this.fillTint.BL, this.tintEffect); - }, - - /** - * Pushes a stroked triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchStrokeTriangle - * @since 3.12.0 - * - * @param {number} x0 - Point 0 x coordinate. - * @param {number} y0 - Point 0 y coordinate. - * @param {number} x1 - Point 1 x coordinate. - * @param {number} y1 - Point 1 y coordinate. - * @param {number} x2 - Point 2 x coordinate. - * @param {number} y2 - Point 2 y coordinate. - * @param {number} lineWidth - The width of the line in pixels. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokeTriangle: function (x0, y0, x1, y1, x2, y2, lineWidth, currentMatrix, parentMatrix) - { - var tempTriangle = this.tempTriangle; - - tempTriangle[0].x = x0; - tempTriangle[0].y = y0; - tempTriangle[0].width = lineWidth; - - tempTriangle[1].x = x1; - tempTriangle[1].y = y1; - tempTriangle[1].width = lineWidth; - - tempTriangle[2].x = x2; - tempTriangle[2].y = y2; - tempTriangle[2].width = lineWidth; - - tempTriangle[3].x = x0; - tempTriangle[3].y = y0; - tempTriangle[3].width = lineWidth; - - this.batchStrokePath(tempTriangle, lineWidth, false, currentMatrix, parentMatrix); - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchFillPath - * @since 3.12.0 - * - * @param {array} path - Collection of points that represent the path. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchFillPath: function (path, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var length = path.length; - var polygonCache = this.polygonCache; - var polygonIndexArray; - var point; - - var tintTL = this.fillTint.TL; - var tintTR = this.fillTint.TR; - var tintBL = this.fillTint.BL; - var tintEffect = this.tintEffect; - - for (var pathIndex = 0; pathIndex < length; ++pathIndex) - { - point = path[pathIndex]; - polygonCache.push(point.x, point.y); - } - - polygonIndexArray = Earcut(polygonCache); - length = polygonIndexArray.length; - - var frame = this.currentFrame; - - for (var index = 0; index < length; index += 3) - { - var p0 = polygonIndexArray[index + 0] * 2; - var p1 = polygonIndexArray[index + 1] * 2; - var p2 = polygonIndexArray[index + 2] * 2; - - var x0 = polygonCache[p0 + 0]; - var y0 = polygonCache[p0 + 1]; - var x1 = polygonCache[p1 + 0]; - var y1 = polygonCache[p1 + 1]; - var x2 = polygonCache[p2 + 0]; - var y2 = polygonCache[p2 + 1]; - - var tx0 = calcMatrix.getX(x0, y0); - var ty0 = calcMatrix.getY(x0, y0); - - var tx1 = calcMatrix.getX(x1, y1); - var ty1 = calcMatrix.getY(x1, y1); - - var tx2 = calcMatrix.getX(x2, y2); - var ty2 = calcMatrix.getY(x2, y2); - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - this.batchTri(tx0, ty0, tx1, ty1, tx2, ty2, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect); - } - - polygonCache.length = 0; - }, - - /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchStrokePath - * @since 3.12.0 - * - * @param {array} path - Collection of points that represent the path. - * @param {number} lineWidth - The width of the line segments in pixels. - * @param {boolean} pathOpen - Indicates if the path should be closed or left open. - * @param {Phaser.GameObjects.Components.TransformMatrix} currentMatrix - The current transform. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - The parent transform. - */ - batchStrokePath: function (path, lineWidth, pathOpen, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - // Reset the closePath booleans - this.prevQuad[4] = 0; - this.firstQuad[4] = 0; - - var pathLength = path.length - 1; - - for (var pathIndex = 0; pathIndex < pathLength; pathIndex++) - { - var point0 = path[pathIndex]; - var point1 = path[pathIndex + 1]; - - this.batchLine( - point0.x, - point0.y, - point1.x, - point1.y, - point0.width / 2, - point1.width / 2, - lineWidth, - pathIndex, - !pathOpen && (pathIndex === pathLength - 1), - currentMatrix, - parentMatrix - ); - } - }, - - /** - * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. - * Assumes a texture has already been set, prior to calling this function. - * - * @method Phaser.Renderer.WebGL.Pipelines.MultiPipeline#batchLine - * @since 3.12.0 - * - * @param {number} ax - X coordinate to the start of the line - * @param {number} ay - Y coordinate to the start of the line - * @param {number} bx - X coordinate to the end of the line - * @param {number} by - Y coordinate to the end of the line - * @param {number} aLineWidth - Width of the start of the line - * @param {number} bLineWidth - Width of the end of the line - * @param {Float32Array} currentMatrix - Parent matrix, generally used by containers - */ - batchLine: function (ax, ay, bx, by, aLineWidth, bLineWidth, lineWidth, index, closePath, currentMatrix, parentMatrix) - { - this.renderer.pipelines.set(this); - - var calcMatrix = this._tempMatrix3; - - // Multiply and store result in calcMatrix, only if the parentMatrix is set, otherwise we'll use whatever values are already in the calcMatrix - if (parentMatrix) - { - parentMatrix.multiply(currentMatrix, calcMatrix); - } - - var dx = bx - ax; - var dy = by - ay; - - var len = Math.sqrt(dx * dx + dy * dy); - var al0 = aLineWidth * (by - ay) / len; - var al1 = aLineWidth * (ax - bx) / len; - var bl0 = bLineWidth * (by - ay) / len; - var bl1 = bLineWidth * (ax - bx) / len; - - var lx0 = bx - bl0; - var ly0 = by - bl1; - var lx1 = ax - al0; - var ly1 = ay - al1; - var lx2 = bx + bl0; - var ly2 = by + bl1; - var lx3 = ax + al0; - var ly3 = ay + al1; - - // tx0 = bottom right - var brX = calcMatrix.getX(lx0, ly0); - var brY = calcMatrix.getY(lx0, ly0); - - // tx1 = bottom left - var blX = calcMatrix.getX(lx1, ly1); - var blY = calcMatrix.getY(lx1, ly1); - - // tx2 = top right - var trX = calcMatrix.getX(lx2, ly2); - var trY = calcMatrix.getY(lx2, ly2); - - // tx3 = top left - var tlX = calcMatrix.getX(lx3, ly3); - var tlY = calcMatrix.getY(lx3, ly3); - - var tint = this.strokeTint; - var tintEffect = this.tintEffect; - - var tintTL = tint.TL; - var tintTR = tint.TR; - var tintBL = tint.BL; - var tintBR = tint.BR; - - var frame = this.currentFrame; - - var u0 = frame.u0; - var v0 = frame.v0; - var u1 = frame.u1; - var v1 = frame.v1; - - // TL, BL, BR, TR - this.batchQuad(tlX, tlY, blX, blY, brX, brY, trX, trY, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - - if (lineWidth <= 2) - { - // No point doing a linejoin if the line isn't thick enough - return; - } - - var prev = this.prevQuad; - var first = this.firstQuad; - - if (index > 0 && prev[4]) - { - this.batchQuad(tlX, tlY, blX, blY, prev[0], prev[1], prev[2], prev[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - } - else - { - first[0] = tlX; - first[1] = tlY; - first[2] = blX; - first[3] = blY; - first[4] = 1; - } - - if (closePath && first[4]) - { - // Add a join for the final path segment - this.batchQuad(brX, brY, trX, trY, first[0], first[1], first[2], first[3], u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect); - } - else - { - // Store it - - prev[0] = brX; - prev[1] = brY; - prev[2] = trX; - prev[3] = trY; - prev[4] = 1; - } + this.batchQuad(null, tx0, ty0, tx1, ty1, tx2, ty2, tx3, ty3, frame.u0, frame.v0, frame.u1, frame.v1, tint, tint, tint, tint, 0, frame.glTexture, unit); } }); diff --git a/src/renderer/webgl/pipelines/PointLightPipeline.js b/src/renderer/webgl/pipelines/PointLightPipeline.js new file mode 100644 index 000000000..8e6807b0f --- /dev/null +++ b/src/renderer/webgl/pipelines/PointLightPipeline.js @@ -0,0 +1,105 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../../utils/Class'); +var GetFastValue = require('../../../utils/object/GetFastValue'); +var PointLightShaderSourceFS = require('../shaders/PointLight-frag.js'); +var PointLightShaderSourceVS = require('../shaders/PointLight-vert.js'); +var WebGLPipeline = require('../WebGLPipeline'); + +var PointLightPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function PointLightPipeline (config) + { + config.vertShader = GetFastValue(config, 'vertShader', PointLightShaderSourceVS); + config.fragShader = GetFastValue(config, 'fragShader', PointLightShaderSourceFS); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2 + }, + { + name: 'inLightPosition', + size: 2 + }, + { + name: 'inLightRadius' + }, + { + name: 'inLightFalloff' + }, + { + name: 'inLightAttenuation' + }, + { + name: 'inLightColor', + size: 4 + } + ]); + + WebGLPipeline.call(this, config); + }, + + onRender: function (scene, camera) + { + this.set2f('uResolution', this.width, this.height); + this.set1f('uCameraZoom', camera.zoom); + }, + + batchPointLight: function (light, camera, x0, y0, x1, y1, x2, y2, x3, y3, lightX, lightY) + { + var color = light.color; + var intensity = light.intensity; + var radius = light.radius; + var falloff = light.falloff; + var attenuation = light.attenuation; + + var r = color.r * intensity; + var g = color.g * intensity; + var b = color.b * intensity; + var a = camera.alpha * light.alpha; + + if (this.shouldFlush(6)) + { + this.flush(); + } + + this.batchLightVert(x0, y0, lightX, lightY, radius, falloff, attenuation, r, g, b, a); + this.batchLightVert(x1, y1, lightX, lightY, radius, falloff, attenuation, r, g, b, a); + this.batchLightVert(x2, y2, lightX, lightY, radius, falloff, attenuation, r, g, b, a); + this.batchLightVert(x0, y0, lightX, lightY, radius, falloff, attenuation, r, g, b, a); + this.batchLightVert(x2, y2, lightX, lightY, radius, falloff, attenuation, r, g, b, a); + this.batchLightVert(x3, y3, lightX, lightY, radius, falloff, attenuation, r, g, b, a); + }, + + batchLightVert: function (x, y, lightX, lightY, radius, falloff, attenuation, r, g, b, a) + { + var vertexViewF32 = this.vertexViewF32; + + var vertexOffset = (this.vertexCount * this.currentShader.vertexComponentCount) - 1; + + vertexViewF32[++vertexOffset] = x; + vertexViewF32[++vertexOffset] = y; + vertexViewF32[++vertexOffset] = lightX; + vertexViewF32[++vertexOffset] = lightY; + vertexViewF32[++vertexOffset] = radius; + vertexViewF32[++vertexOffset] = falloff; + vertexViewF32[++vertexOffset] = attenuation; + vertexViewF32[++vertexOffset] = r; + vertexViewF32[++vertexOffset] = g; + vertexViewF32[++vertexOffset] = b; + vertexViewF32[++vertexOffset] = a; + + this.vertexCount++; + } + +}); + +module.exports = PointLightPipeline; diff --git a/src/renderer/webgl/pipelines/PostFXPipeline.js b/src/renderer/webgl/pipelines/PostFXPipeline.js new file mode 100644 index 000000000..5419f3d2b --- /dev/null +++ b/src/renderer/webgl/pipelines/PostFXPipeline.js @@ -0,0 +1,417 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Class = require('../../../utils/Class'); +var ColorMatrix = require('../../../display/ColorMatrix'); +var GetFastValue = require('../../../utils/object/GetFastValue'); +var ShaderSourceFS = require('../shaders/PostFX-frag.js'); +var ShaderSourceVS = require('../shaders/Quad-vert.js'); +var WebGLPipeline = require('../WebGLPipeline'); + +/** + * @classdesc + * TODO + * + * The fragment shader it uses can be found in `shaders/src/PostFX.frag`. + * The vertex shader it uses can be found in `shaders/src/PostFX.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * The default shader uniforms for this pipeline are: + * + * `uMainSampler` (sampler2D) + * + * @class PostFXPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var PostFXPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function PostFXPipeline (config) + { + config.renderTarget = GetFastValue(config, 'renderTarget', 1); + config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS); + config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS); + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2 + }, + { + name: 'inTexCoord', + size: 2 + } + ]); + config.batchSize = 1; + + /** + * Vertices array layout: + * + * -1, 1 B----C 1, 1 + * 0, 1 | /| 1, 1 + * | / | + * | / | + * |/ | + * -1, -1 A----D 1, -1 + * 0, 0 1, 0 + * + * A = -1, -1 (pos) and 0, 0 (uv) + * B = -1, 1 (pos) and 0, 1 (uv) + * C = 1, 1 (pos) and 1, 1 (uv) + * D = 1, -1 (pos) and 1, 0 (uv) + * + * First tri: A, B, C + * Second tri: A, C, D + * + * Array index: + * + * 0 = Tri 1 - Vert A - x pos + * 1 = Tri 1 - Vert A - y pos + * 2 = Tri 1 - Vert A - uv u + * 3 = Tri 1 - Vert A - uv v + * + * 4 = Tri 1 - Vert B - x pos + * 5 = Tri 1 - Vert B - y pos + * 6 = Tri 1 - Vert B - uv u + * 7 = Tri 1 - Vert B - uv v + * + * 8 = Tri 1 - Vert C - x pos + * 9 = Tri 1 - Vert C - y pos + * 10 = Tri 1 - Vert C - uv u + * 11 = Tri 1 - Vert C - uv v + * + * 12 = Tri 2 - Vert A - x pos + * 13 = Tri 2 - Vert A - y pos + * 14 = Tri 2 - Vert A - uv u + * 15 = Tri 2 - Vert A - uv v + * + * 16 = Tri 2 - Vert C - x pos + * 17 = Tri 2 - Vert C - y pos + * 18 = Tri 2 - Vert C - uv u + * 19 = Tri 2 - Vert C - uv v + * + * 20 = Tri 2 - Vert D - x pos + * 21 = Tri 2 - Vert D - y pos + * 22 = Tri 2 - Vert D - uv u + * 23 = Tri 2 - Vert D - uv v + */ + config.vertices = [ + -1, -1, 0, 0, + -1, 1, 0, 1, + 1, 1, 1, 1, + -1, -1, 0, 0, + 1, 1, 1, 1, + 1, -1, 1, 0 + ]; + + WebGLPipeline.call(this, config); + + this.isPostFX = true; + + /** + * If this post-pipeline belongs to a Game Object or Camera, this contains a reference to it. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#gameObject + * @type {Phaser.GameObjects.GameObject} + * @since 3.50.0 + */ + this.gameObject; + + /** + * A Color Matrix instance belonging to this pipeline. + * + * Used during calls to the `drawFrame` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#colorMatrix + * @type {Phaser.Display.ColorMatrix} + * @since 3.50.0 + */ + this.colorMatrix = new ColorMatrix(); + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @default null + * @since 3.50.0 + */ + this.halfFrame2; + + if (this.renderer.isBooted) + { + this.manager = this.renderer.pipelines; + + this.boot(); + } + }, + + boot: function () + { + WebGLPipeline.prototype.boot.call(this); + + var utility = this.manager.UTILITY_PIPELINE; + + this.fullFrame1 = utility.fullFrame1; + this.fullFrame2 = utility.fullFrame2; + this.halfFrame1 = utility.halfFrame1; + this.halfFrame2 = utility.halfFrame2; + + this.set1i('uMainSampler', 0); + }, + + onDraw: function (renderTarget) + { + this.bindAndDraw(renderTarget); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + this.manager.copyFrame(source, target, brightness, clear, clearAlpha); + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + this.manager.copyToGame(source); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + drawFrame: function (source, target, clearAlpha) + { + this.manager.drawFrame(source, target, clearAlpha, this.colorMatrix); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + blendFrames: function (source1, source2, target, strength, clearAlpha) + { + this.manager.blendFrames(source1, source2, target, strength, clearAlpha); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + this.manager.blendFramesAdditive(source1, source2, target, strength, clearAlpha); + }, + + /** + * Binds this pipeline and draws the `source` Render Target to the `target` Render Target. + * + * If no `target` is specified, it will pop the framebuffer from the Renderers FBO stack + * and use that instead, which should be done when you need to draw the final results of + * this pipeline to the game canvas. + * + * You can optionally set the shader to be used for the draw here, if this is a multi-shader + * pipeline. By default `currentShader` will be used. If you need to set a shader but not + * a target, just pass `null` as the `target` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.PostFXPipeline#bindAndDraw + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The Render Target to draw to. If not set, it will pop the fbo from the stack. + * @param {boolean} [clear=true] - Clear the target before copying? Only used if `target` parameter is set. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Renderer.WebGL.WebGLShader} [currentShader] - The shader to use during the draw. + */ + bindAndDraw: function (source, target, clear, clearAlpha, currentShader) + { + if (clear === undefined) { clear = true; } + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + var renderer = this.renderer; + + this.bind(currentShader); + + this.set1i('uMainSampler', 0); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + + if (clear) + { + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + } + } + else + { + renderer.popFramebuffer(false, false, false); + + if (!renderer.currentFramebuffer) + { + gl.viewport(0, 0, renderer.width, renderer.height); + } + } + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + if (!target) + { + renderer.resetTextures(); + } + else + { + gl.bindTexture(gl.TEXTURE_2D, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + } + } + +}); + +module.exports = PostFXPipeline; diff --git a/src/renderer/webgl/pipelines/RopePipeline.js b/src/renderer/webgl/pipelines/RopePipeline.js index 33c441218..f82dc9bd0 100644 --- a/src/renderer/webgl/pipelines/RopePipeline.js +++ b/src/renderer/webgl/pipelines/RopePipeline.js @@ -5,7 +5,7 @@ */ var Class = require('../../../utils/Class'); -var ModelViewProjection = require('./components/ModelViewProjection'); +var GetFastValue = require('../../../utils/object/GetFastValue'); var MultiPipeline = require('./MultiPipeline'); /** @@ -49,15 +49,13 @@ var RopePipeline = new Class({ Extends: MultiPipeline, - Mixins: [ - ModelViewProjection - ], - initialize: function RopePipeline (config) { - config.topology = config.game.renderer.gl.TRIANGLE_STRIP; + // GLenum 5 = TRIANGLE_STRIP + config.topology = 5; + config.batchSize = GetFastValue(config, 'batchSize', 256); MultiPipeline.call(this, config); } diff --git a/src/renderer/webgl/pipelines/SinglePipeline.js b/src/renderer/webgl/pipelines/SinglePipeline.js index 9d45bf086..9cc8f3140 100644 --- a/src/renderer/webgl/pipelines/SinglePipeline.js +++ b/src/renderer/webgl/pipelines/SinglePipeline.js @@ -6,7 +6,6 @@ var Class = require('../../../utils/Class'); var GetFastValue = require('../../../utils/object/GetFastValue'); -var ModelViewProjection = require('./components/ModelViewProjection'); var MultiPipeline = require('./MultiPipeline'); var ShaderSourceFS = require('../shaders/Single-frag.js'); var ShaderSourceVS = require('../shaders/Single-vert.js'); @@ -14,9 +13,8 @@ var WebGLPipeline = require('../WebGLPipeline'); /** * @classdesc - * * The Single Pipeline is a special version of the Multi Pipeline that only ever - * uses one single texture, bound to texture unit zero. Although not as efficient as the + * uses one texture, bound to texture unit zero. Although not as efficient as the * Multi Pipeline, it provides an easier way to create custom pipelines that only require * a single bound texture. * @@ -29,14 +27,13 @@ var WebGLPipeline = require('../WebGLPipeline'); * * `inPosition` (vec2, offset 0) * `inTexCoord` (vec2, offset 8) - * `inTintEffect` (float, offset 16) - * `inTint` (vec4, offset 20, normalized) + * `inTexId` (float, offset 16) - this value is always zero in the Single Pipeline + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) * * The default shader uniforms for this pipeline are: * * `uProjectionMatrix` (mat4) - * `uViewMatrix` (mat4) - * `uModelMatrix` (mat4) * `uMainSampler` (sampler2D) * * @class SinglePipeline @@ -51,274 +48,22 @@ var SinglePipeline = new Class({ Extends: MultiPipeline, - Mixins: [ - ModelViewProjection - ], - initialize: function SinglePipeline (config) { - var gl = config.game.renderer.gl; - config.fragShader = GetFastValue(config, 'fragShader', ShaderSourceFS), config.vertShader = GetFastValue(config, 'vertShader', ShaderSourceVS), - config.vertexSize = GetFastValue(config, 'vertexSize', 24), - config.attributes = GetFastValue(config, 'attributes', [ - { - name: 'inPosition', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 0, - enabled: false, - location: -1 - }, - { - name: 'inTexCoord', - size: 2, - type: gl.FLOAT, - normalized: false, - offset: 8, - enabled: false, - location: -1 - }, - { - name: 'inTintEffect', - size: 1, - type: gl.FLOAT, - normalized: false, - offset: 16, - enabled: false, - location: -1 - }, - { - name: 'inTint', - size: 4, - type: gl.UNSIGNED_BYTE, - normalized: true, - offset: 20, - enabled: false, - location: -1 - } - ]); + config.forceZero = true; MultiPipeline.call(this, config); - - this.forceZero = true; }, - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#batchQuad - * @since 3.50.0 - * - * @param {number} x0 - The top-left x position. - * @param {number} y0 - The top-left y position. - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {number} tintBR - The bottom-right tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - This parameter isn't used by this pipeline, but is retained for TTP support. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchQuad: function (x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit) + boot: function () { - if (unit === undefined) { unit = this.currentUnit; } + WebGLPipeline.prototype.boot.call(this); - var hasFlushed = false; - - if (this.shouldFlush(6)) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x0; - vertexViewF32[++vertexOffset] = y0; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - this.vertexCount += 6; - - return hasFlushed; - }, - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#batchTri - * @since 3.50.0 - * - * @param {number} x1 - The bottom-left x position. - * @param {number} y1 - The bottom-left y position. - * @param {number} x2 - The bottom-right x position. - * @param {number} y2 - The bottom-right y position. - * @param {number} x3 - The top-right x position. - * @param {number} y3 - The top-right y position. - * @param {number} u0 - UV u0 value. - * @param {number} v0 - UV v0 value. - * @param {number} u1 - UV u1 value. - * @param {number} v1 - UV v1 value. - * @param {number} tintTL - The top-left tint color value. - * @param {number} tintTR - The top-right tint color value. - * @param {number} tintBL - The bottom-left tint color value. - * @param {(number|boolean)} tintEffect - The tint effect for the shader to use. - * @param {WebGLTexture} [texture] - WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param {integer} [unit=0] - This parameter isn't used by this pipeline, but is retained for TTP support. - * - * @return {boolean} `true` if this method caused the batch to flush, otherwise `false`. - */ - batchTri: function (x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintEffect, texture, unit) - { - if (unit === undefined) { unit = this.currentUnit; } - - var hasFlushed = false; - - if (this.shouldFlush(3)) - { - this.flush(); - - hasFlushed = true; - - unit = this.setTexture2D(texture); - } - - var vertexViewF32 = this.vertexViewF32; - var vertexViewU32 = this.vertexViewU32; - - var vertexOffset = (this.vertexCount * this.vertexComponentCount) - 1; - - vertexViewF32[++vertexOffset] = x1; - vertexViewF32[++vertexOffset] = y1; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v0; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTL; - - vertexViewF32[++vertexOffset] = x2; - vertexViewF32[++vertexOffset] = y2; - vertexViewF32[++vertexOffset] = u0; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintTR; - - vertexViewF32[++vertexOffset] = x3; - vertexViewF32[++vertexOffset] = y3; - vertexViewF32[++vertexOffset] = u1; - vertexViewF32[++vertexOffset] = v1; - vertexViewF32[++vertexOffset] = tintEffect; - vertexViewU32[++vertexOffset] = tintBL; - - this.vertexCount += 3; - - return hasFlushed; - }, - - /** - * Called every time the pipeline is bound by the renderer. - * Sets the shader program, vertex buffer and other resources. - * Should only be called when changing pipeline. - * - * @method Phaser.Renderer.WebGL.Pipelines.SinglePipeline#bind - * @since 3.50.0 - * - * @param {boolean} [reset=false] - Should the pipeline be fully re-bound after a renderer pipeline clear? - * - * @return {this} This WebGLPipeline instance. - */ - bind: function (reset) - { - if (reset === undefined) { reset = false; } - - WebGLPipeline.prototype.bind.call(this, reset); - - return this; + this.set1i('uMainSampler', 0); } }); diff --git a/src/renderer/webgl/pipelines/UtilityPipeline.js b/src/renderer/webgl/pipelines/UtilityPipeline.js new file mode 100644 index 000000000..2c870cf91 --- /dev/null +++ b/src/renderer/webgl/pipelines/UtilityPipeline.js @@ -0,0 +1,840 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var AddBlendFS = require('../shaders/AddBlend-frag.js'); +var BlendModes = require('../../BlendModes'); +var Class = require('../../../utils/Class'); +var ColorMatrix = require('../../../display/ColorMatrix'); +var ColorMatrixFS = require('../shaders/ColorMatrix-frag.js'); +var CopyFS = require('../shaders/Copy-frag.js'); +var GetFastValue = require('../../../utils/object/GetFastValue'); +var LinearBlendFS = require('../shaders/LinearBlend-frag.js'); +var QuadVS = require('../shaders/Quad-vert.js'); +var WebGLPipeline = require('../WebGLPipeline'); + +/** + * @classdesc + * The Utility Pipeline is a special-use pipeline that belongs to the Pipeline Manager. + * + * It provides 4 shaders and handy associated methods: + * + * 1) Copy Shader. A fast texture to texture copy shader with optional brightness setting. + * 2) Additive Blend Mode Shader. Blends two textures using an additive blend mode. + * 3) Linear Blend Mode Shader. Blends two textures using a linear blend mode. + * 4) Color Matrix Copy Shader. Draws a texture to a target using a Color Matrix. + * + * You typically do not extend or access this pipeline directly, but instead go + * via the following methods in the Pipeline Manager: + * + * `copyFrame` + * `copyFrameRect` + * `drawFrame` + * `blendFrames` + * `blendFramesAdditive` + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * This pipeline has a hard-coded batch size of 1 and a hard coded set of vertices. + * + * @class UtilityPipeline + * @extends Phaser.Renderer.WebGL.WebGLPipeline + * @memberof Phaser.Renderer.WebGL.Pipelines + * @constructor + * @since 3.50.0 + * + * @param {Phaser.Types.Renderer.WebGL.WebGLPipelineConfig} config - The configuration options for this pipeline. + */ +var UtilityPipeline = new Class({ + + Extends: WebGLPipeline, + + initialize: + + function UtilityPipeline (config) + { + config.renderTarget = GetFastValue(config, 'renderTarget', [ + { + scale: 1 + }, + { + scale: 1 + }, + { + scale: 0.5 + }, + { + scale: 0.5 + } + ]); + + config.vertShader = GetFastValue(config, 'vertShader', QuadVS); + + config.shaders = GetFastValue(config, 'shaders', [ + { + name: 'Copy', + fragShader: CopyFS + }, + { + name: 'AddBlend', + fragShader: AddBlendFS + }, + { + name: 'LinearBlend', + fragShader: LinearBlendFS + }, + { + name: 'ColorMatrix', + fragShader: ColorMatrixFS + } + ]); + + config.attributes = GetFastValue(config, 'attributes', [ + { + name: 'inPosition', + size: 2 + }, + { + name: 'inTexCoord', + size: 2 + } + ]); + + /** + * Vertices array layout: + * + * -1, 1 B----C 1, 1 + * 0, 1 | /| 1, 1 + * | / | + * | / | + * |/ | + * -1, -1 A----D 1, -1 + * 0, 0 1, 0 + * + * A = -1, -1 (pos) and 0, 0 (uv) + * B = -1, 1 (pos) and 0, 1 (uv) + * C = 1, 1 (pos) and 1, 1 (uv) + * D = 1, -1 (pos) and 1, 0 (uv) + * + * First tri: A, B, C + * Second tri: A, C, D + * + * Array index: + * + * 0 = Tri 1 - Vert A - x pos + * 1 = Tri 1 - Vert A - y pos + * 2 = Tri 1 - Vert A - uv u + * 3 = Tri 1 - Vert A - uv v + * + * 4 = Tri 1 - Vert B - x pos + * 5 = Tri 1 - Vert B - y pos + * 6 = Tri 1 - Vert B - uv u + * 7 = Tri 1 - Vert B - uv v + * + * 8 = Tri 1 - Vert C - x pos + * 9 = Tri 1 - Vert C - y pos + * 10 = Tri 1 - Vert C - uv u + * 11 = Tri 1 - Vert C - uv v + * + * 12 = Tri 2 - Vert A - x pos + * 13 = Tri 2 - Vert A - y pos + * 14 = Tri 2 - Vert A - uv u + * 15 = Tri 2 - Vert A - uv v + * + * 16 = Tri 2 - Vert C - x pos + * 17 = Tri 2 - Vert C - y pos + * 18 = Tri 2 - Vert C - uv u + * 19 = Tri 2 - Vert C - uv v + * + * 20 = Tri 2 - Vert D - x pos + * 21 = Tri 2 - Vert D - y pos + * 22 = Tri 2 - Vert D - uv u + * 23 = Tri 2 - Vert D - uv v + */ + config.vertices = [ + -1, -1, 0, 0, + -1, 1, 0, 1, + 1, 1, 1, 1, + -1, -1, 0, 0, + 1, 1, 1, 1, + 1, -1, 1, 0 + ]; + + config.batchSize = 1; + + WebGLPipeline.call(this, config); + + /** + * A default Color Matrix, used by the Color Matrix Shader when one + * isn't provided. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#colorMatrix + * @type {Phaser.Display.ColorMatrix} + * @since 3.50.0 + */ + this.colorMatrix = new ColorMatrix(); + + /** + * A reference to the Copy Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @default null + * @since 3.50.0 + */ + this.copyShader; + + /** + * A reference to the Additive Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#addShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.addShader; + + /** + * A reference to the Linear Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#linearShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.linearShader; + + /** + * A reference to the Color Matrix Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#colorMatrixShader + * @type {Phaser.Renderer.WebGL.WebGLShader} + * @since 3.50.0 + */ + this.colorMatrixShader; + + /** + * A reference to the Full Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#fullFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.fullFrame1; + + /** + * A reference to the Full Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#fullFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.fullFrame2; + + /** + * A reference to the Half Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#halfFrame1 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.halfFrame1; + + /** + * A reference to the Half Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + * + * @name Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#halfFrame2 + * @type {Phaser.Renderer.WebGL.RenderTarget} + * @since 3.50.0 + */ + this.halfFrame2; + }, + + boot: function () + { + WebGLPipeline.prototype.boot.call(this); + + var shaders = this.shaders; + var targets = this.renderTargets; + + this.copyShader = shaders[0]; + this.addShader = shaders[1]; + this.linearShader = shaders[2]; + this.colorMatrixShader = shaders[3]; + + this.fullFrame1 = targets[0]; + this.fullFrame2 = targets[1]; + this.halfFrame1 = targets[2]; + this.halfFrame2 = targets[3]; + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + copyFrame: function (source, target, brightness, clear, clearAlpha) + { + if (brightness === undefined) { brightness = 1; } + if (clear === undefined) { clear = true; } + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.copyShader); + this.set1f('uBrightness', brightness, this.copyShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + } + else + { + gl.viewport(0, 0, source.width, source.height); + } + + if (clear) + { + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * The difference with this copy is that no resizing takes place. If the `source` + * Render Target is larger than the `target` then only a portion the same size as + * the `target` dimensions is copied across. + * + * You can optionally set the brightness factor of the copy. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#blitFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The target Render Target. + * @param {number} [brightness=1] - The brightness value applied to the frame copy. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {boolean} [eraseMode=false] - Erase source from target using ERASE Blend Mode? + */ + blitFrame: function (source, target, brightness, clear, clearAlpha, eraseMode) + { + if (brightness === undefined) { brightness = 1; } + if (clear === undefined) { clear = true; } + if (clearAlpha === undefined) { clearAlpha = true; } + if (eraseMode === undefined) { eraseMode = false; } + + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.copyShader); + this.set1f('uBrightness', brightness, this.copyShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + if (source.height >= target.height) + { + gl.viewport(0, 0, source.width, source.height); + + this.setVerticesFromTarget(source, target); + } + else + { + var diff = target.height - source.height; + + gl.viewport(0, diff, source.width, source.height); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + + if (clear) + { + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + if (eraseMode) + { + var blendMode = this.renderer.currentBlendMode; + + this.renderer.setBlendMode(BlendModes.ERASE); + } + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + if (eraseMode) + { + this.renderer.setBlendMode(blendMode); + } + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + + this.resetUVs(); + }, + + /** + * Binds the `source` Render Target and then copies a section of it to the `target` Render Target. + * + * This method is extremely fast because it uses `gl.copyTexSubImage2D` and doesn't + * require the use of any shaders. Remember the coordinates are given in standard WebGL format, + * where x and y specify the lower-left corner of the section, not the top-left. Also, the + * copy entirely replaces the contents of the target texture, no 'merging' or 'blending' takes + * place. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyFrameRect + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The target Render Target. + * @param {number} x - The x coordinate of the lower left corner where to start copying. + * @param {number} y - The y coordinate of the lower left corner where to start copying. + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {boolean} [clear=true] - Clear the target before copying? + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + copyFrameRect: function (source, target, x, y, width, height, clear, clearAlpha) + { + if (clear === undefined) { clear = true; } + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + + gl.bindFramebuffer(gl.FRAMEBUFFER, source.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, source.texture, 0); + + if (clear) + { + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + } + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, target.texture); + + gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0, 0, x, y, width, height); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#copyToGame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The Render Target to draw from. + */ + copyToGame: function (source) + { + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.copyShader); + this.set1f('uBrightness', 1, this.copyShader); + + this.renderer.popFramebuffer(); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + this.renderer.resetTextures(); + }, + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#drawFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Display.ColorMatrix} [colorMatrix] - The Color Matrix to use when performing the draw. + */ + drawFrame: function (source, target, clearAlpha, colorMatrix) + { + if (clearAlpha === undefined) { clearAlpha = true; } + if (colorMatrix === undefined) { colorMatrix = this.colorMatrix; } + + var gl = this.gl; + + this.set1i('uMainSampler', 0, this.colorMatrixShader); + this.set1fv('uColorMatrix', colorMatrix.getData(), this.colorMatrixShader); + this.set1f('uAlpha', colorMatrix.alpha, this.colorMatrixShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source.texture); + + if (target) + { + gl.viewport(0, 0, target.width, target.height); + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + } + else + { + gl.viewport(0, 0, source.width, source.height); + } + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#blendFrames + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + * @param {Phaser.Renderer.WebGL.WebGLShader} [blendShader] - The shader to use during the blend copy. + */ + blendFrames: function (source1, source2, target, strength, clearAlpha, blendShader) + { + if (strength === undefined) { strength = 1; } + if (clearAlpha === undefined) { clearAlpha = true; } + if (blendShader === undefined) { blendShader = this.linearShader; } + + var gl = this.gl; + + this.set1i('uMainSampler1', 0, blendShader); + this.set1i('uMainSampler2', 1, blendShader); + this.set1f('uStrength', strength, blendShader); + + gl.activeTexture(gl.TEXTURE0); + gl.bindTexture(gl.TEXTURE_2D, source1.texture); + + gl.activeTexture(gl.TEXTURE1); + gl.bindTexture(gl.TEXTURE_2D, source2.texture); + + if (target) + { + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, target.texture, 0); + gl.viewport(0, 0, target.width, target.height); + } + else + { + gl.viewport(0, 0, source1.width, source1.height); + } + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + gl.bufferData(gl.ARRAY_BUFFER, this.vertexData, gl.STATIC_DRAW); + gl.drawArrays(gl.TRIANGLES, 0, 6); + + gl.bindFramebuffer(gl.FRAMEBUFFER, null); + gl.bindTexture(gl.TEXTURE_2D, null); + }, + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#blendFramesAdditive + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source1 - The first source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} source2 - The second source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} [target] - The target Render Target. + * @param {number} [strength=1] - The strength of the blend. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + blendFramesAdditive: function (source1, source2, target, strength, clearAlpha) + { + this.blendFrames(source1, source2, target, strength, clearAlpha, this.addShader); + }, + + /** + * Clears the given Render Target. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#clearFrame + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The Render Target to clear. + * @param {boolean} [clearAlpha=true] - Clear the alpha channel when running `gl.clear` on the target? + */ + clearFrame: function (target, clearAlpha) + { + if (clearAlpha === undefined) { clearAlpha = true; } + + var gl = this.gl; + + gl.viewport(0, 0, target.width, target.height); + + gl.bindFramebuffer(gl.FRAMEBUFFER, target.framebuffer); + + if (clearAlpha) + { + gl.clearColor(0, 0, 0, 0); + } + else + { + gl.clearColor(0, 0, 0, 1); + } + + gl.clear(gl.COLOR_BUFFER_BIT); + + var fbo = this.renderer.currentFramebuffer; + + gl.bindFramebuffer(gl.FRAMEBUFFER, fbo); + }, + + /** + * Set the UV values for the 6 vertices that make up the quad used by the shaders + * in the Utility Pipeline. + * + * Be sure to call `resetVertices` once you have finished manipulating the UV coordinates. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#resetVertices + * @since 3.50.0 + * + * @param {number} uA - The u value of vertex A. + * @param {number} vA - The v value of vertex A. + * @param {number} uB - The u value of vertex B. + * @param {number} vB - The v value of vertex B. + * @param {number} uC - The u value of vertex C. + * @param {number} vC - The v value of vertex C. + * @param {number} uD - The u value of vertex D. + * @param {number} vD - The v value of vertex D. + */ + setUVs: function (uA, vA, uB, vB, uC, vC, uD, vD) + { + var vertexViewF32 = this.vertexViewF32; + + vertexViewF32[2] = uA; + vertexViewF32[3] = vA; + vertexViewF32[6] = uB; + vertexViewF32[7] = vB; + vertexViewF32[10] = uC; + vertexViewF32[11] = vC; + vertexViewF32[14] = uA; + vertexViewF32[15] = vA; + vertexViewF32[18] = uC; + vertexViewF32[19] = vC; + vertexViewF32[22] = uD; + vertexViewF32[23] = vD; + }, + + /** + * Sets the vertices of the quad used by the shaders in the Utility Pipeline + * so that they correctly adjust the texture coordinates for a blit frame effect. + * + * Be sure to call `resetVertices` once you have finished manipulating the UV coordinates. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#setVerticesFromTarget + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.RenderTarget} source - The source Render Target. + * @param {Phaser.Renderer.WebGL.RenderTarget} target - The target Render Target. + */ + setVerticesFromTarget: function (source, target) + { + var diff = (target.height / source.height); + + if (diff > 0.5) + { + diff = 0.5 - (diff - 0.5); + } + else + { + diff = 0.5 + (0.5 - diff); + } + + this.setUVs(0, diff, 0, 1 + diff, 1, 1 + diff, 1, diff); + }, + + /** + * Horizontally flips the UV coordinates of the quad used by the shaders in this + * Utility Pipeline. + * + * Be sure to call `resetVertices` once you have finished manipulating the UV coordinates. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#flipX + * @since 3.50.0 + */ + flipX: function () + { + this.setUVs(1, 0, 1, 1, 0, 1, 0, 0); + }, + + /** + * Vertically flips the UV coordinates of the quad used by the shaders in this + * Utility Pipeline. + * + * Be sure to call `resetVertices` once you have finished manipulating the UV coordinates. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#flipY + * @since 3.50.0 + */ + flipY: function () + { + this.setUVs(0, 1, 0, 0, 1, 0, 1, 1); + }, + + /** + * Resets the quad vertices to their default values. + * + * The quad is used by all shaders of the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#resetVertices + * @since 3.50.0 + */ + resetVertices: function () + { + this.vertexViewF32.set([ -1, -1, 0, 0, -1, 1, 0, 1, 1, 1, 1, 1, -1, -1, 0, 0, 1, 1, 1, 1, 1, -1, 1, 0 ]); + }, + + /** + * Resets the quad vertice UV values to their default settings. + * + * The quad is used by all shaders of the Utility Pipeline. + * + * @method Phaser.Renderer.WebGL.Pipelines.UtilityPipeline#resetUVs + * @since 3.50.0 + */ + resetUVs: function () + { + this.setUVs(0, 0, 0, 1, 1, 1, 1, 0); + } + +}); + +module.exports = UtilityPipeline; diff --git a/src/renderer/webgl/pipelines/components/ModelViewProjection.js b/src/renderer/webgl/pipelines/components/ModelViewProjection.js deleted file mode 100644 index 1196fce0f..000000000 --- a/src/renderer/webgl/pipelines/components/ModelViewProjection.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Implements a model view projection matrices. - * Pipelines can implement this for doing 2D and 3D rendering. - * - * @namespace Phaser.Renderer.WebGL.Pipelines.ModelViewProjection - * @since 3.0.0 - */ -var ModelViewProjection = { - - /** - * Dirty flag for checking if model matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - modelMatrixDirty: false, - - /** - * Dirty flag for checking if view matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - viewMatrixDirty: false, - - /** - * Dirty flag for checking if projection matrix needs to be updated on GPU. - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrixDirty - * @type {boolean} - * @since 3.0.0 - */ - projectionMatrixDirty: false, - - /** - * Model matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#modelMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - modelMatrix: null, - - /** - * View matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#viewMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - viewMatrix: null, - - /** - * Projection matrix - * - * @name Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#projectionMatrix - * @type {?Float32Array} - * @since 3.0.0 - */ - projectionMatrix: null, - - /** - * Initializes MVP matrices with an identity matrix - * - * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpInit - * @since 3.0.0 - */ - mvpInit: function () - { - this.modelMatrixDirty = true; - this.viewMatrixDirty = true; - this.projectionMatrixDirty = true; - - this.modelMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - this.viewMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - this.projectionMatrix = new Float32Array([ - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - ]); - - return this; - }, - - /** - * If dirty flags are set then the matrices are uploaded to the GPU. - * - * @method Phaser.Renderer.WebGL.Pipelines.ModelViewProjection#mvpUpdate - * @since 3.0.0 - */ - mvpUpdate: function () - { - var program = this.program; - - if (this.modelMatrixDirty) - { - this.renderer.setMatrix4(program, 'uModelMatrix', false, this.modelMatrix); - this.modelMatrixDirty = false; - } - - if (this.viewMatrixDirty) - { - this.renderer.setMatrix4(program, 'uViewMatrix', false, this.viewMatrix); - this.viewMatrixDirty = false; - } - - if (this.projectionMatrixDirty) - { - this.renderer.setMatrix4(program, 'uProjectionMatrix', false, this.projectionMatrix); - this.projectionMatrixDirty = false; - } - - return this; - } -}; - -module.exports = ModelViewProjection; diff --git a/src/renderer/webgl/pipelines/const.js b/src/renderer/webgl/pipelines/const.js index ae0a20c56..058759350 100644 --- a/src/renderer/webgl/pipelines/const.js +++ b/src/renderer/webgl/pipelines/const.js @@ -26,6 +26,16 @@ var PIPELINE_CONST = { */ LIGHT_PIPELINE: 'Light2D', + /** + * The Point Light Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.POINTLIGHT_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + POINTLIGHT_PIPELINE: 'PointLightPipeline', + /** * The Single Texture Pipeline. * @@ -57,15 +67,34 @@ var PIPELINE_CONST = { ROPE_PIPELINE: 'RopePipeline', /** - * The Mesh Pipeline. + * The Graphics and Shapes Pipeline. * - * @name Phaser.Renderer.WebGL.Pipelines.MESH_PIPELINE + * @name Phaser.Renderer.WebGL.Pipelines.GRAPHICS_PIPELINE * @type {string} * @const * @since 3.50.0 */ - MESH_PIPELINE: 'MeshPipeline' + GRAPHICS_PIPELINE: 'GraphicsPipeline', + /** + * The Post FX Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.POSTFX_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + POSTFX_PIPELINE: 'PostFXPipeline', + + /** + * The Utility Pipeline. + * + * @name Phaser.Renderer.WebGL.Pipelines.UTILITY_PIPELINE + * @type {string} + * @const + * @since 3.50.0 + */ + UTILITY_PIPELINE: 'UtilityPipeline' }; module.exports = PIPELINE_CONST; diff --git a/src/renderer/webgl/pipelines/events/AFTER_FLUSH_EVENT.js b/src/renderer/webgl/pipelines/events/AFTER_FLUSH_EVENT.js new file mode 100644 index 000000000..f8683d06c --- /dev/null +++ b/src/renderer/webgl/pipelines/events/AFTER_FLUSH_EVENT.js @@ -0,0 +1,19 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The WebGLPipeline After Flush Event. + * + * This event is dispatched by a WebGLPipeline right after it has issued a drawArrays command + * and cleared its vertex count. + * + * @event Phaser.Renderer.WebGL.Pipelines.Events#AFTER_FLUSH + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that has flushed. + * @param {boolean} isPostFlush - Was this flush invoked as part of a post-process, or not? + */ +module.exports = 'pipelineafterflush'; diff --git a/src/renderer/webgl/pipelines/events/BEFORE_FLUSH_EVENT.js b/src/renderer/webgl/pipelines/events/BEFORE_FLUSH_EVENT.js new file mode 100644 index 000000000..7ed01f01a --- /dev/null +++ b/src/renderer/webgl/pipelines/events/BEFORE_FLUSH_EVENT.js @@ -0,0 +1,19 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The WebGLPipeline Before Flush Event. + * + * This event is dispatched by a WebGLPipeline right before it is about to + * flush and issue a bufferData and drawArrays command. + * + * @event Phaser.Renderer.WebGL.Pipelines.Events#BEFORE_FLUSH + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that is about to flush. + * @param {boolean} isPostFlush - Was this flush invoked as part of a post-process, or not? + */ +module.exports = 'pipelinebeforeflush'; diff --git a/src/renderer/webgl/pipelines/events/BIND_EVENT.js b/src/renderer/webgl/pipelines/events/BIND_EVENT.js new file mode 100644 index 000000000..d240f51ae --- /dev/null +++ b/src/renderer/webgl/pipelines/events/BIND_EVENT.js @@ -0,0 +1,18 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The WebGLPipeline Bind Event. + * + * This event is dispatched by a WebGLPipeline when it is bound by the Pipeline Manager. + * + * @event Phaser.Renderer.WebGL.Pipelines.Events#BIND + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that was bound. + * @param {Phaser.Renderer.WebGL.WebGLShader} currentShader - The shader that was set as being current. + */ +module.exports = 'pipelinebind'; diff --git a/src/renderer/webgl/pipelines/events/BOOT_EVENT.js b/src/renderer/webgl/pipelines/events/BOOT_EVENT.js new file mode 100644 index 000000000..693b1915b --- /dev/null +++ b/src/renderer/webgl/pipelines/events/BOOT_EVENT.js @@ -0,0 +1,17 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The WebGLPipeline Boot Event. + * + * This event is dispatched by a WebGLPipeline when it has completed its `boot` phase. + * + * @event Phaser.Renderer.WebGL.Pipelines.Events#BOOT + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that booted. + */ +module.exports = 'pipelineboot'; diff --git a/src/renderer/webgl/pipelines/events/DESTROY_EVENT.js b/src/renderer/webgl/pipelines/events/DESTROY_EVENT.js new file mode 100644 index 000000000..437c72fbc --- /dev/null +++ b/src/renderer/webgl/pipelines/events/DESTROY_EVENT.js @@ -0,0 +1,17 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The WebGLPipeline Destroy Event. + * + * This event is dispatched by a WebGLPipeline when it is starting its destroy process. + * + * @event Phaser.Renderer.WebGL.Pipelines.Events#DESTROY + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that has flushed. + */ +module.exports = 'pipelinedestroy'; diff --git a/src/renderer/webgl/pipelines/events/REBIND_EVENT.js b/src/renderer/webgl/pipelines/events/REBIND_EVENT.js new file mode 100644 index 000000000..de54a847d --- /dev/null +++ b/src/renderer/webgl/pipelines/events/REBIND_EVENT.js @@ -0,0 +1,18 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The WebGLPipeline ReBind Event. + * + * This event is dispatched by a WebGLPipeline when it is re-bound by the Pipeline Manager. + * + * @event Phaser.Renderer.WebGL.Pipelines.Events#REBIND + * @since 3.50.0 + * + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that was rebound. + * @param {Phaser.Renderer.WebGL.WebGLShader} currentShader - The shader that was set as being current. + */ +module.exports = 'pipelinerebind'; diff --git a/src/renderer/webgl/pipelines/events/RESIZE_EVENT.js b/src/renderer/webgl/pipelines/events/RESIZE_EVENT.js new file mode 100644 index 000000000..2261ea9a1 --- /dev/null +++ b/src/renderer/webgl/pipelines/events/RESIZE_EVENT.js @@ -0,0 +1,20 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * The WebGLPipeline Resize Event. + * + * This event is dispatched by a WebGLPipeline when it is resized, usually as a result + * of the Renderer resizing. + * + * @event Phaser.Renderer.WebGL.Pipelines.Events#RESIZE + * @since 3.50.0 + * + * @param {number} width - The new width of the pipeline. + * @param {number} height - The new height of the pipeline. + * @param {Phaser.Renderer.WebGL.WebGLPipeline} pipeline - The pipeline that was resized. + */ +module.exports = 'pipelineresize'; diff --git a/src/renderer/webgl/pipelines/events/index.js b/src/renderer/webgl/pipelines/events/index.js new file mode 100644 index 000000000..48431ec05 --- /dev/null +++ b/src/renderer/webgl/pipelines/events/index.js @@ -0,0 +1,21 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * @namespace Phaser.Renderer.WebGL.Pipelines.Events + */ + +module.exports = { + + AFTER_FLUSH: require('./AFTER_FLUSH_EVENT'), + BEFORE_FLUSH: require('./BEFORE_FLUSH_EVENT'), + BIND: require('./BIND_EVENT'), + BOOT: require('./BOOT_EVENT'), + DESTROY: require('./DESTROY_EVENT'), + REBIND: require('./REBIND_EVENT'), + RESIZE: require('./RESIZE_EVENT') + +}; diff --git a/src/renderer/webgl/pipelines/index.js b/src/renderer/webgl/pipelines/index.js index 60dd4b404..05b618bd8 100644 --- a/src/renderer/webgl/pipelines/index.js +++ b/src/renderer/webgl/pipelines/index.js @@ -14,12 +14,15 @@ var Extend = require('../../../utils/object/Extend'); var Pipelines = { BitmapMaskPipeline: require('./BitmapMaskPipeline'), + Events: require('./events'), + GraphicsPipeline: require('./GraphicsPipeline'), LightPipeline: require('./LightPipeline'), - MeshPipeline: require('./MeshPipeline'), - ModelViewProjection: require('./components/ModelViewProjection'), MultiPipeline: require('./MultiPipeline'), + PointLightPipeline: require('./PointLightPipeline'), + PostFXPipeline: require('./PostFXPipeline'), RopePipeline: require('./RopePipeline'), - SinglePipeline: require('./SinglePipeline') + SinglePipeline: require('./SinglePipeline'), + UtilityPipeline: require('./UtilityPipeline') }; diff --git a/src/renderer/webgl/shaders/AddBlend-frag.js b/src/renderer/webgl/shaders/AddBlend-frag.js new file mode 100644 index 000000000..8bf85d568 --- /dev/null +++ b/src/renderer/webgl/shaders/AddBlend-frag.js @@ -0,0 +1,20 @@ +module.exports = [ + '#define SHADER_NAME PHASER_ADD_BLEND_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler1;', + 'uniform sampler2D uMainSampler2;', + 'uniform float uStrength;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 frame1 = texture2D(uMainSampler1, outTexCoord);', + ' vec4 frame2 = texture2D(uMainSampler2, outTexCoord);', + '', + ' gl_FragColor = frame1 + frame2 * uStrength;', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/BitmapMask-frag.js b/src/renderer/webgl/shaders/BitmapMask-frag.js index c7442f96a..b9134a6a9 100644 --- a/src/renderer/webgl/shaders/BitmapMask-frag.js +++ b/src/renderer/webgl/shaders/BitmapMask-frag.js @@ -8,7 +8,7 @@ module.exports = [ 'uniform sampler2D uMaskSampler;', 'uniform bool uInvertMaskAlpha;', '', - 'void main()', + 'void main ()', '{', ' vec2 uv = gl_FragCoord.xy / uResolution;', ' vec4 mainColor = texture2D(uMainSampler, uv);', diff --git a/src/renderer/webgl/shaders/BitmapMask-vert.js b/src/renderer/webgl/shaders/BitmapMask-vert.js index b06e4db56..b73361965 100644 --- a/src/renderer/webgl/shaders/BitmapMask-vert.js +++ b/src/renderer/webgl/shaders/BitmapMask-vert.js @@ -5,7 +5,7 @@ module.exports = [ '', 'attribute vec2 inPosition;', '', - 'void main()', + 'void main ()', '{', ' gl_Position = vec4(inPosition, 0.0, 1.0);', '}', diff --git a/src/renderer/webgl/shaders/ColorMatrix-frag.js b/src/renderer/webgl/shaders/ColorMatrix-frag.js new file mode 100644 index 000000000..271939f7c --- /dev/null +++ b/src/renderer/webgl/shaders/ColorMatrix-frag.js @@ -0,0 +1,42 @@ +module.exports = [ + '#define SHADER_NAME PHASER_COLORMATRIX_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + 'uniform float uColorMatrix[20];', + 'uniform float uAlpha;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 c = texture2D(uMainSampler, outTexCoord);', + '', + ' if (uAlpha == 0.0)', + ' {', + ' gl_FragColor = c;', + '', + ' return;', + ' }', + '', + ' if (c.a > 0.0)', + ' {', + ' c.rgb /= c.a;', + ' }', + '', + ' vec4 result;', + '', + ' result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];', + ' result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];', + ' result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];', + ' result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];', + '', + ' vec3 rgb = mix(c.rgb, result.rgb, uAlpha);', + '', + ' rgb *= result.a;', + '', + ' gl_FragColor = vec4(rgb, result.a);', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/Copy-frag.js b/src/renderer/webgl/shaders/Copy-frag.js new file mode 100644 index 000000000..1ce13dd94 --- /dev/null +++ b/src/renderer/webgl/shaders/Copy-frag.js @@ -0,0 +1,16 @@ +module.exports = [ + '#define SHADER_NAME PHASER_COPY_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + 'uniform float uBrightness;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/Graphics-frag.js b/src/renderer/webgl/shaders/Graphics-frag.js new file mode 100644 index 000000000..f9b6c422d --- /dev/null +++ b/src/renderer/webgl/shaders/Graphics-frag.js @@ -0,0 +1,13 @@ +module.exports = [ + '#define SHADER_NAME PHASER_GRAPHICS_FS', + '', + 'precision mediump float;', + '', + 'varying vec4 outColor;', + '', + 'void main ()', + '{', + ' gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/Graphics-vert.js b/src/renderer/webgl/shaders/Graphics-vert.js new file mode 100644 index 000000000..092aa4a0a --- /dev/null +++ b/src/renderer/webgl/shaders/Graphics-vert.js @@ -0,0 +1,20 @@ +module.exports = [ + '#define SHADER_NAME PHASER_GRAPHICS_VS', + '', + 'precision mediump float;', + '', + 'uniform mat4 uProjectionMatrix;', + '', + 'attribute vec2 inPosition;', + 'attribute vec4 inColor;', + '', + 'varying vec4 outColor;', + '', + 'void main ()', + '{', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', + '', + ' outColor = inColor;', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/LinearBlend-frag.js b/src/renderer/webgl/shaders/LinearBlend-frag.js new file mode 100644 index 000000000..ee8d28d07 --- /dev/null +++ b/src/renderer/webgl/shaders/LinearBlend-frag.js @@ -0,0 +1,20 @@ +module.exports = [ + '#define SHADER_NAME PHASER_LINEAR_BLEND_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler1;', + 'uniform sampler2D uMainSampler2;', + 'uniform float uStrength;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' vec4 frame1 = texture2D(uMainSampler1, outTexCoord);', + ' vec4 frame2 = texture2D(uMainSampler2, outTexCoord);', + '', + ' gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/Multi-frag.js b/src/renderer/webgl/shaders/Multi-frag.js index 4c55cad71..2a3d63ebe 100644 --- a/src/renderer/webgl/shaders/Multi-frag.js +++ b/src/renderer/webgl/shaders/Multi-frag.js @@ -10,7 +10,7 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'void main()', + 'void main ()', '{', ' vec4 texture;', '', @@ -26,6 +26,11 @@ module.exports = [ ' // Solid color + texture alpha', ' color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);', ' }', + ' else if (outTintEffect == 2.0)', + ' {', + ' // Solid color, no texture', + ' color = texel;', + ' }', '', ' gl_FragColor = color;', '}', diff --git a/src/renderer/webgl/shaders/Multi-vert.js b/src/renderer/webgl/shaders/Multi-vert.js index afab5479e..fda290ea2 100644 --- a/src/renderer/webgl/shaders/Multi-vert.js +++ b/src/renderer/webgl/shaders/Multi-vert.js @@ -4,8 +4,6 @@ module.exports = [ 'precision mediump float;', '', 'uniform mat4 uProjectionMatrix;', - 'uniform mat4 uViewMatrix;', - 'uniform mat4 uModelMatrix;', '', 'attribute vec2 inPosition;', 'attribute vec2 inTexCoord;', @@ -20,13 +18,12 @@ module.exports = [ '', 'void main ()', '{', - ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', '', ' outTexCoord = inTexCoord;', ' outTexId = inTexId;', ' outTint = inTint;', ' outTintEffect = inTintEffect;', '}', - '', '' ].join('\n'); diff --git a/src/renderer/webgl/shaders/PointLight-frag.js b/src/renderer/webgl/shaders/PointLight-frag.js new file mode 100644 index 000000000..55ed6d993 --- /dev/null +++ b/src/renderer/webgl/shaders/PointLight-frag.js @@ -0,0 +1,29 @@ +module.exports = [ + '#define SHADER_NAME PHASER_POINTLIGHT_FS', + '', + 'precision mediump float;', + '', + 'uniform vec2 uResolution;', + 'uniform float uCameraZoom;', + '', + 'varying vec4 lightPosition;', + 'varying vec4 lightColor;', + 'varying float lightRadius;', + 'varying float lightAttenuation;', + '', + 'void main ()', + '{', + ' vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);', + '', + ' float distToSurf = length(center - gl_FragCoord.xy);', + '', + ' float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);', + '', + ' float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);', + '', + ' vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;', + '', + ' gl_FragColor = vec4(color.rgb * lightColor.a, color.a);', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/PointLight-vert.js b/src/renderer/webgl/shaders/PointLight-vert.js new file mode 100644 index 000000000..10eee4149 --- /dev/null +++ b/src/renderer/webgl/shaders/PointLight-vert.js @@ -0,0 +1,29 @@ +module.exports = [ + '#define SHADER_NAME PHASER_POINTLIGHT_VS', + '', + 'precision mediump float;', + '', + 'uniform mat4 uProjectionMatrix;', + '', + 'attribute vec2 inPosition;', + 'attribute vec2 inLightPosition;', + 'attribute vec4 inLightColor;', + 'attribute float inLightRadius;', + 'attribute float inLightAttenuation;', + '', + 'varying vec4 lightPosition;', + 'varying vec4 lightColor;', + 'varying float lightRadius;', + 'varying float lightAttenuation;', + '', + 'void main ()', + '{', + ' lightColor = inLightColor;', + ' lightRadius = inLightRadius;', + ' lightAttenuation = inLightAttenuation;', + ' lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);', + '', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/PostFX-frag.js b/src/renderer/webgl/shaders/PostFX-frag.js new file mode 100644 index 000000000..d04824f3d --- /dev/null +++ b/src/renderer/webgl/shaders/PostFX-frag.js @@ -0,0 +1,15 @@ +module.exports = [ + '#define SHADER_NAME PHASER_POSTFX_FS', + '', + 'precision mediump float;', + '', + 'uniform sampler2D uMainSampler;', + '', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' gl_FragColor = texture2D(uMainSampler, outTexCoord);', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/Quad-vert.js b/src/renderer/webgl/shaders/Quad-vert.js new file mode 100644 index 000000000..fecb43411 --- /dev/null +++ b/src/renderer/webgl/shaders/Quad-vert.js @@ -0,0 +1,20 @@ +module.exports = [ + '#define SHADER_NAME PHASER_QUAD_VS', + '', + 'precision mediump float;', + '', + 'attribute vec2 inPosition;', + 'attribute vec2 inTexCoord;', + '', + 'varying vec2 outFragCoord;', + 'varying vec2 outTexCoord;', + '', + 'void main ()', + '{', + ' outFragCoord = inPosition.xy * 0.5 + 0.5;', + ' outTexCoord = inTexCoord;', + '', + ' gl_Position = vec4(inPosition, 0, 1);', + '}', + '' +].join('\n'); diff --git a/src/renderer/webgl/shaders/Single-frag.js b/src/renderer/webgl/shaders/Single-frag.js index faa350fa2..f976866a0 100644 --- a/src/renderer/webgl/shaders/Single-frag.js +++ b/src/renderer/webgl/shaders/Single-frag.js @@ -9,7 +9,7 @@ module.exports = [ 'varying float outTintEffect;', 'varying vec4 outTint;', '', - 'void main()', + 'void main ()', '{', ' vec4 texture = texture2D(uMainSampler, outTexCoord);', ' vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);', @@ -22,6 +22,11 @@ module.exports = [ ' // Solid color + texture alpha', ' color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);', ' }', + ' else if (outTintEffect == 2.0)', + ' {', + ' // Solid color, no texture', + ' color = texel;', + ' }', '', ' gl_FragColor = color;', '}', diff --git a/src/renderer/webgl/shaders/Single-vert.js b/src/renderer/webgl/shaders/Single-vert.js index c376be1a1..bdc684c8f 100644 --- a/src/renderer/webgl/shaders/Single-vert.js +++ b/src/renderer/webgl/shaders/Single-vert.js @@ -4,11 +4,10 @@ module.exports = [ 'precision mediump float;', '', 'uniform mat4 uProjectionMatrix;', - 'uniform mat4 uViewMatrix;', - 'uniform mat4 uModelMatrix;', '', 'attribute vec2 inPosition;', 'attribute vec2 inTexCoord;', + 'attribute float inTexId;', 'attribute float inTintEffect;', 'attribute vec4 inTint;', '', @@ -18,7 +17,7 @@ module.exports = [ '', 'void main ()', '{', - ' gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);', + ' gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);', '', ' outTexCoord = inTexCoord;', ' outTint = inTint;', diff --git a/src/renderer/webgl/shaders/src/AddBlend.frag b/src/renderer/webgl/shaders/src/AddBlend.frag new file mode 100644 index 000000000..f0e58b78a --- /dev/null +++ b/src/renderer/webgl/shaders/src/AddBlend.frag @@ -0,0 +1,17 @@ +#define SHADER_NAME PHASER_ADD_BLEND_FS + +precision mediump float; + +uniform sampler2D uMainSampler1; +uniform sampler2D uMainSampler2; +uniform float uStrength; + +varying vec2 outTexCoord; + +void main () +{ + vec4 frame1 = texture2D(uMainSampler1, outTexCoord); + vec4 frame2 = texture2D(uMainSampler2, outTexCoord); + + gl_FragColor = frame1 + frame2 * uStrength; +} diff --git a/src/renderer/webgl/shaders/src/BitmapMask.frag b/src/renderer/webgl/shaders/src/BitmapMask.frag index 9cadc1074..ba4017f83 100644 --- a/src/renderer/webgl/shaders/src/BitmapMask.frag +++ b/src/renderer/webgl/shaders/src/BitmapMask.frag @@ -7,7 +7,7 @@ uniform sampler2D uMainSampler; uniform sampler2D uMaskSampler; uniform bool uInvertMaskAlpha; -void main() +void main () { vec2 uv = gl_FragCoord.xy / uResolution; vec4 mainColor = texture2D(uMainSampler, uv); @@ -22,6 +22,6 @@ void main() { alpha *= (1.0 - maskColor.a); } - + gl_FragColor = vec4(mainColor.rgb * alpha, alpha); } diff --git a/src/renderer/webgl/shaders/src/BitmapMask.vert b/src/renderer/webgl/shaders/src/BitmapMask.vert index d89ca95a0..e0168c21d 100644 --- a/src/renderer/webgl/shaders/src/BitmapMask.vert +++ b/src/renderer/webgl/shaders/src/BitmapMask.vert @@ -4,7 +4,7 @@ precision mediump float; attribute vec2 inPosition; -void main() +void main () { gl_Position = vec4(inPosition, 0.0, 1.0); } diff --git a/src/renderer/webgl/shaders/src/ColorMatrix.frag b/src/renderer/webgl/shaders/src/ColorMatrix.frag new file mode 100644 index 000000000..afffd48b6 --- /dev/null +++ b/src/renderer/webgl/shaders/src/ColorMatrix.frag @@ -0,0 +1,39 @@ +#define SHADER_NAME PHASER_COLORMATRIX_FS + +precision mediump float; + +uniform sampler2D uMainSampler; +uniform float uColorMatrix[20]; +uniform float uAlpha; + +varying vec2 outTexCoord; + +void main () +{ + vec4 c = texture2D(uMainSampler, outTexCoord); + + if (uAlpha == 0.0) + { + gl_FragColor = c; + + return; + } + + if (c.a > 0.0) + { + c.rgb /= c.a; + } + + vec4 result; + + result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4]; + result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9]; + result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14]; + result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19]; + + vec3 rgb = mix(c.rgb, result.rgb, uAlpha); + + rgb *= result.a; + + gl_FragColor = vec4(rgb, result.a); +} diff --git a/src/renderer/webgl/shaders/src/Copy.frag b/src/renderer/webgl/shaders/src/Copy.frag new file mode 100644 index 000000000..1ec3e7142 --- /dev/null +++ b/src/renderer/webgl/shaders/src/Copy.frag @@ -0,0 +1,13 @@ +#define SHADER_NAME PHASER_COPY_FS + +precision mediump float; + +uniform sampler2D uMainSampler; +uniform float uBrightness; + +varying vec2 outTexCoord; + +void main () +{ + gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness; +} diff --git a/src/renderer/webgl/shaders/src/Graphics.frag b/src/renderer/webgl/shaders/src/Graphics.frag new file mode 100644 index 000000000..cb93e3000 --- /dev/null +++ b/src/renderer/webgl/shaders/src/Graphics.frag @@ -0,0 +1,10 @@ +#define SHADER_NAME PHASER_GRAPHICS_FS + +precision mediump float; + +varying vec4 outColor; + +void main () +{ + gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a); +} diff --git a/src/renderer/webgl/shaders/src/Graphics.vert b/src/renderer/webgl/shaders/src/Graphics.vert new file mode 100644 index 000000000..b6b8b9407 --- /dev/null +++ b/src/renderer/webgl/shaders/src/Graphics.vert @@ -0,0 +1,17 @@ +#define SHADER_NAME PHASER_GRAPHICS_VS + +precision mediump float; + +uniform mat4 uProjectionMatrix; + +attribute vec2 inPosition; +attribute vec4 inColor; + +varying vec4 outColor; + +void main () +{ + gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0); + + outColor = inColor; +} diff --git a/src/renderer/webgl/shaders/src/LinearBlend.frag b/src/renderer/webgl/shaders/src/LinearBlend.frag new file mode 100644 index 000000000..6d7743422 --- /dev/null +++ b/src/renderer/webgl/shaders/src/LinearBlend.frag @@ -0,0 +1,17 @@ +#define SHADER_NAME PHASER_LINEAR_BLEND_FS + +precision mediump float; + +uniform sampler2D uMainSampler1; +uniform sampler2D uMainSampler2; +uniform float uStrength; + +varying vec2 outTexCoord; + +void main () +{ + vec4 frame1 = texture2D(uMainSampler1, outTexCoord); + vec4 frame2 = texture2D(uMainSampler2, outTexCoord); + + gl_FragColor = mix(frame1, frame2 * uStrength, 0.5); +} diff --git a/src/renderer/webgl/shaders/src/Multi.frag b/src/renderer/webgl/shaders/src/Multi.frag index d95e03480..870886e0a 100644 --- a/src/renderer/webgl/shaders/src/Multi.frag +++ b/src/renderer/webgl/shaders/src/Multi.frag @@ -9,7 +9,7 @@ varying float outTexId; varying float outTintEffect; varying vec4 outTint; -void main() +void main () { vec4 texture; @@ -25,6 +25,11 @@ void main() // Solid color + texture alpha color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a); } + else if (outTintEffect == 2.0) + { + // Solid color, no texture + color = texel; + } gl_FragColor = color; } diff --git a/src/renderer/webgl/shaders/src/Multi.vert b/src/renderer/webgl/shaders/src/Multi.vert index 88f94b8e2..ca63f367c 100644 --- a/src/renderer/webgl/shaders/src/Multi.vert +++ b/src/renderer/webgl/shaders/src/Multi.vert @@ -3,8 +3,6 @@ precision mediump float; uniform mat4 uProjectionMatrix; -uniform mat4 uViewMatrix; -uniform mat4 uModelMatrix; attribute vec2 inPosition; attribute vec2 inTexCoord; @@ -19,11 +17,10 @@ varying vec4 outTint; void main () { - gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0); + gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0); outTexCoord = inTexCoord; outTexId = inTexId; outTint = inTint; outTintEffect = inTintEffect; } - diff --git a/src/renderer/webgl/shaders/src/PointLight.frag b/src/renderer/webgl/shaders/src/PointLight.frag new file mode 100644 index 000000000..39bd3f82f --- /dev/null +++ b/src/renderer/webgl/shaders/src/PointLight.frag @@ -0,0 +1,26 @@ +#define SHADER_NAME PHASER_POINTLIGHT_FS + +precision mediump float; + +uniform vec2 uResolution; +uniform float uCameraZoom; + +varying vec4 lightPosition; +varying vec4 lightColor; +varying float lightRadius; +varying float lightAttenuation; + +void main () +{ + vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5); + + float distToSurf = length(center - gl_FragCoord.xy); + + float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom); + + float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation); + + vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor; + + gl_FragColor = vec4(color.rgb * lightColor.a, color.a); +} diff --git a/src/renderer/webgl/shaders/src/PointLight.vert b/src/renderer/webgl/shaders/src/PointLight.vert new file mode 100644 index 000000000..d75818cbc --- /dev/null +++ b/src/renderer/webgl/shaders/src/PointLight.vert @@ -0,0 +1,26 @@ +#define SHADER_NAME PHASER_POINTLIGHT_VS + +precision mediump float; + +uniform mat4 uProjectionMatrix; + +attribute vec2 inPosition; +attribute vec2 inLightPosition; +attribute vec4 inLightColor; +attribute float inLightRadius; +attribute float inLightAttenuation; + +varying vec4 lightPosition; +varying vec4 lightColor; +varying float lightRadius; +varying float lightAttenuation; + +void main () +{ + lightColor = inLightColor; + lightRadius = inLightRadius; + lightAttenuation = inLightAttenuation; + lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0); + + gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0); +} diff --git a/src/renderer/webgl/shaders/src/PostFX.frag b/src/renderer/webgl/shaders/src/PostFX.frag new file mode 100644 index 000000000..6fcda0cc5 --- /dev/null +++ b/src/renderer/webgl/shaders/src/PostFX.frag @@ -0,0 +1,12 @@ +#define SHADER_NAME PHASER_POSTFX_FS + +precision mediump float; + +uniform sampler2D uMainSampler; + +varying vec2 outTexCoord; + +void main () +{ + gl_FragColor = texture2D(uMainSampler, outTexCoord); +} diff --git a/src/renderer/webgl/shaders/src/Quad.vert b/src/renderer/webgl/shaders/src/Quad.vert new file mode 100644 index 000000000..6d2252507 --- /dev/null +++ b/src/renderer/webgl/shaders/src/Quad.vert @@ -0,0 +1,17 @@ +#define SHADER_NAME PHASER_QUAD_VS + +precision mediump float; + +attribute vec2 inPosition; +attribute vec2 inTexCoord; + +varying vec2 outFragCoord; +varying vec2 outTexCoord; + +void main () +{ + outFragCoord = inPosition.xy * 0.5 + 0.5; + outTexCoord = inTexCoord; + + gl_Position = vec4(inPosition, 0, 1); +} diff --git a/src/renderer/webgl/shaders/src/Single.frag b/src/renderer/webgl/shaders/src/Single.frag index 8ba4f284b..9c5e2a74f 100644 --- a/src/renderer/webgl/shaders/src/Single.frag +++ b/src/renderer/webgl/shaders/src/Single.frag @@ -8,7 +8,7 @@ varying vec2 outTexCoord; varying float outTintEffect; varying vec4 outTint; -void main() +void main () { vec4 texture = texture2D(uMainSampler, outTexCoord); vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a); @@ -21,6 +21,11 @@ void main() // Solid color + texture alpha color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a); } + else if (outTintEffect == 2.0) + { + // Solid color, no texture + color = texel; + } gl_FragColor = color; } diff --git a/src/renderer/webgl/shaders/src/Single.vert b/src/renderer/webgl/shaders/src/Single.vert index f26c1d05b..2a215263e 100644 --- a/src/renderer/webgl/shaders/src/Single.vert +++ b/src/renderer/webgl/shaders/src/Single.vert @@ -3,11 +3,10 @@ precision mediump float; uniform mat4 uProjectionMatrix; -uniform mat4 uViewMatrix; -uniform mat4 uModelMatrix; attribute vec2 inPosition; attribute vec2 inTexCoord; +attribute float inTexId; attribute float inTintEffect; attribute vec4 inTint; @@ -17,7 +16,7 @@ varying vec4 outTint; void main () { - gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0); + gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0); outTexCoord = inTexCoord; outTint = inTint; diff --git a/src/renderer/webgl/typedefs/RenderTargetConfig.js b/src/renderer/webgl/typedefs/RenderTargetConfig.js new file mode 100644 index 000000000..27a99be3a --- /dev/null +++ b/src/renderer/webgl/typedefs/RenderTargetConfig.js @@ -0,0 +1,8 @@ +/** + * @typedef {object} Phaser.Types.Renderer.WebGL.RenderTargetConfig + * @since 3.50.0 + * + * @property {number} [scale=1] - A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc. + * @property {number} [minFilter=0] -The minFilter mode of the texture. 0 is `LINEAR`, 1 is `NEAREST`. + * @property {boolean} [autoClear=true] - Controls if this Render Target is automatically cleared (via `gl.COLOR_BUFFER_BIT`) during the bind. + */ diff --git a/src/renderer/webgl/typedefs/WebGLConst.js b/src/renderer/webgl/typedefs/WebGLConst.js new file mode 100644 index 000000000..c6c371bbd --- /dev/null +++ b/src/renderer/webgl/typedefs/WebGLConst.js @@ -0,0 +1,7 @@ +/** + * @typedef {object} Phaser.Types.Renderer.WebGL.WebGLConst + * @since 3.50.0 + * + * @property {GLenum} enum - The data type of the attribute, i.e. `gl.BYTE`, `gl.SHORT`, `gl.UNSIGNED_BYTE`, `gl.FLOAT`, etc. + * @property {number} size - The size, in bytes, of the data type. + */ diff --git a/src/renderer/webgl/typedefs/WebGLPipelineAttribute.js b/src/renderer/webgl/typedefs/WebGLPipelineAttribute.js new file mode 100644 index 000000000..1c6dce782 --- /dev/null +++ b/src/renderer/webgl/typedefs/WebGLPipelineAttribute.js @@ -0,0 +1,12 @@ +/** + * @typedef {object} Phaser.Types.Renderer.WebGL.WebGLPipelineAttribute + * @since 3.50.0 + * + * @property {string} name - The name of the attribute as defined in the vertex shader. + * @property {number} size - The number of components in the attribute, i.e. 1 for a float, 2 for a vec2, 3 for a vec3, etc. + * @property {GLenum} type - The data type of the attribute. Either `gl.BYTE`, `gl.SHORT`, `gl.UNSIGNED_BYTE`, `gl.UNSIGNED_SHORT` or `gl.FLOAT`. + * @property {number} offset - The offset, in bytes, of this attribute data in the vertex array. Equivalent to `offsetof(vertex, attrib)` in C. + * @property {boolean} normalized - Should the attribute data be normalized? + * @property {boolean} enabled - You should set this to `false` by default. The pipeline will enable it on boot. + * @property {number} location - You should set this to `-1` by default. The pipeline will set it on boot. + */ diff --git a/src/renderer/webgl/typedefs/WebGLPipelineAttributesConfig.js b/src/renderer/webgl/typedefs/WebGLPipelineAttributesConfig.js index 7ba215298..c2aac86bd 100644 --- a/src/renderer/webgl/typedefs/WebGLPipelineAttributesConfig.js +++ b/src/renderer/webgl/typedefs/WebGLPipelineAttributesConfig.js @@ -4,9 +4,6 @@ * * @property {string} name - The name of the attribute as defined in the vertex shader. * @property {number} size - The number of components in the attribute, i.e. 1 for a float, 2 for a vec2, 3 for a vec3, etc. - * @property {GLenum} type - The data type of the attribute. Either `gl.BYTE`, `gl.SHORT`, `gl.UNSIGNED_BYTE`, `gl.UNSIGNED_SHORT` or `gl.FLOAT`. - * @property {number} offset - The offset, in bytes, of this attribute data in the vertex array. Equivalent to `offsetof(vertex, attrib)` in C. - * @property {boolean} normalized - Should the attribute data be normalized? - * @property {boolean} enabled - You should set this to `false` by default. The pipeline will enable it on boot. - * @property {number} location - You should set this to `-1` by default. The pipeline will set it on boot. + * @property {Phaser.Types.Renderer.WebGL.WebGLConst} type - The data type of the attribute, one of the `WEBGL_CONST` values, i.e. `WEBGL_CONST.FLOAT`, `WEBGL_CONST.UNSIGNED_BYTE`, etc. + * @property {boolean} [normalized=false] - Should the attribute data be normalized? */ diff --git a/src/renderer/webgl/typedefs/WebGLPipelineConfig.js b/src/renderer/webgl/typedefs/WebGLPipelineConfig.js index 3d4cdaefb..dd09dea4e 100644 --- a/src/renderer/webgl/typedefs/WebGLPipelineConfig.js +++ b/src/renderer/webgl/typedefs/WebGLPipelineConfig.js @@ -5,11 +5,13 @@ * @property {Phaser.Game} game - The Phaser.Game instance that owns this pipeline. * @property {string} [name] - The name of the pipeline. * @property {GLenum} [topology=gl.TRIANGLES] - How the primitives are rendered. The default value is GL_TRIANGLES. Here is the full list of rendering primitives: (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). - * @property {string} [vertShader] - The source code, as a string, for the vertex shader. - * @property {string} [fragShader] - The source code, as a string, for the fragment shader. Can include `%count%` and `%forloop%` declarations for multi-texture support. - * @property {number} [vertexCapacity] - The number of vertices to hold in the batch. Defaults to `RenderConfig.batchSize` * 6. + * @property {string} [vertShader] - The source code, as a string, for the vertex shader. If you need to assign multiple shaders, see the `shaders` property. + * @property {string} [fragShader] - The source code, as a string, for the fragment shader. Can include `%count%` and `%forloop%` declarations for multi-texture support. If you need to assign multiple shaders, see the `shaders` property. + * @property {number} [batchSize] - The number of quads to hold in the batch. Defaults to `RenderConfig.batchSize`. This amount * 6 gives the vertex capacity. * @property {number} [vertexSize] - The size, in bytes, of a single entry in the vertex buffer. Defaults to Float32Array.BYTES_PER_ELEMENT * 6 + Uint8Array.BYTES_PER_ELEMENT * 4. - * @property {ArrayBuffer} [vertices] - An optional Array Buffer full of pre-calculated vertices data. - * @property {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig} [attributes] - An array of shader attribute data. - * @property {string[]} [uniforms] - An array of shader uniform names that will be looked-up to get the locations for. + * @property {(number[]|TypedArray)} [vertices] - An optional Array or Typed Array of pre-calculated vertices data that is copied into the vertex data. + * @property {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig} [attributes] - An array of shader attribute data. All shaders bound to this pipeline must use the same attributes. + * @property {Phaser.Types.Renderer.WebGL.WebGLPipelineShaderConfig[]} [shaders] - An array of shaders, all of which are created for this one pipeline. Uses the `vertShader`, `fragShader`, `attributes` and `uniforms` properties of this object as defaults. + * @property {boolean} [forceZero=false] - Force the shader to use just a single sampler2d? Set for anything that extends the Single Pipeline. + * @property {(boolean|number|Phaser.Types.Renderer.WebGL.RenderTargetConfig[])} [renderTarget] - Create Render Targets for this pipeline. Can be a number, which determines the quantity, a boolean (sets quantity to 1), or an array of Render Target configuration objects. */ diff --git a/src/renderer/webgl/typedefs/WebGLPipelineShaderConfig.js b/src/renderer/webgl/typedefs/WebGLPipelineShaderConfig.js new file mode 100644 index 000000000..05af710f6 --- /dev/null +++ b/src/renderer/webgl/typedefs/WebGLPipelineShaderConfig.js @@ -0,0 +1,9 @@ +/** + * @typedef {object} Phaser.Types.Renderer.WebGL.WebGLPipelineShaderConfig + * @since 3.50.0 + * + * @property {string} [name] - The name of the shader. Doesn't have to be unique, but makes shader look-up easier if it is. + * @property {string} [vertShader] - The source code, as a string, for the vertex shader. If not given, uses the `Phaser.Types.Renderer.WebGL.WebGLPipelineConfig.vertShader` property instead. + * @property {string} [fragShader] - The source code, as a string, for the fragment shader. Can include `%count%` and `%forloop%` declarations for multi-texture support. If not given, uses the `Phaser.Types.Renderer.WebGL.WebGLPipelineConfig.fragShader` property instead. + * @property {Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig} [attributes] - An array of shader attribute data. All shaders bound to this pipeline must use the same attributes. + */ diff --git a/src/renderer/webgl/typedefs/WebGLPipelineUniformsConfig.js b/src/renderer/webgl/typedefs/WebGLPipelineUniformsConfig.js index 7aae68b3b..010eed930 100644 --- a/src/renderer/webgl/typedefs/WebGLPipelineUniformsConfig.js +++ b/src/renderer/webgl/typedefs/WebGLPipelineUniformsConfig.js @@ -4,4 +4,8 @@ * * @property {string} name - The name of the uniform as defined in the shaders. * @property {WebGLUniformLocation} location - The pipeline will set it when the program is linked. + * @property {any} value1 - The cached value1. + * @property {any} value2 - The cached value2. + * @property {any} value3 - The cached value3. + * @property {any} value4 - The cached value4. */ diff --git a/src/scale/ScaleManager.js b/src/scale/ScaleManager.js index ca619b141..37243b73f 100644 --- a/src/scale/ScaleManager.js +++ b/src/scale/ScaleManager.js @@ -354,7 +354,7 @@ var ScaleManager = new Class({ * checked here. * * @name Phaser.Scale.ScaleManager#resizeInterval - * @type {integer} + * @type {number} * @since 3.16.0 */ this.resizeInterval = 500; @@ -363,7 +363,7 @@ var ScaleManager = new Class({ * Internal size interval tracker. * * @name Phaser.Scale.ScaleManager#_lastCheck - * @type {integer} + * @type {number} * @private * @since 3.16.0 */ @@ -848,7 +848,7 @@ var ScaleManager = new Class({ * @fires Phaser.Scale.Events#RESIZE * @since 3.16.0 * - * @param {integer} value - The new zoom value of the game. + * @param {number} value - The new zoom value of the game. * * @return {this} The Scale Manager instance. */ @@ -1048,7 +1048,7 @@ var ScaleManager = new Class({ * @method Phaser.Scale.ScaleManager#getMaxZoom * @since 3.16.0 * - * @return {integer} The maximum possible zoom factor. At a minimum this value is always at least 1. + * @return {number} The maximum possible zoom factor. At a minimum this value is always at least 1. */ getMaxZoom: function () { @@ -1164,7 +1164,7 @@ var ScaleManager = new Class({ * * If the browser does not support this, a `FULLSCREEN_UNSUPPORTED` event will be emitted. * - * This method _must_ be called from a user-input gesture, such as `pointerup`. You cannot launch + * This method _must_ be called from a `pointerup` user-input gesture (**not** `pointerdown`). You cannot launch * games fullscreen without this, as most browsers block it. Games within an iframe will also be blocked * from fullscreen unless the iframe has the `allowfullscreen` attribute. * diff --git a/src/scale/const/CENTER_CONST.js b/src/scale/const/CENTER_CONST.js index 46f89c540..d94f65ac5 100644 --- a/src/scale/const/CENTER_CONST.js +++ b/src/scale/const/CENTER_CONST.js @@ -29,7 +29,7 @@ module.exports = { * You can still center it yourself via CSS. * * @name Phaser.Scale.Center.NO_CENTER - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -43,7 +43,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_BOTH - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -57,7 +57,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_HORIZONTALLY - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -71,7 +71,7 @@ module.exports = { * game canvas, and does not factor in any other CSS styles you may have applied. * * @name Phaser.Scale.Center.CENTER_VERTICALLY - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ diff --git a/src/scale/const/SCALE_MODE_CONST.js b/src/scale/const/SCALE_MODE_CONST.js index 1924f110e..1e4cb9418 100644 --- a/src/scale/const/SCALE_MODE_CONST.js +++ b/src/scale/const/SCALE_MODE_CONST.js @@ -30,7 +30,7 @@ module.exports = { * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. * * @name Phaser.Scale.ScaleModes.NONE - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -40,7 +40,7 @@ module.exports = { * The height is automatically adjusted based on the width. * * @name Phaser.Scale.ScaleModes.WIDTH_CONTROLS_HEIGHT - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -50,7 +50,7 @@ module.exports = { * The width is automatically adjusted based on the height. * * @name Phaser.Scale.ScaleModes.HEIGHT_CONTROLS_WIDTH - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -62,7 +62,7 @@ module.exports = { * inside the area which is not covered. * * @name Phaser.Scale.ScaleModes.FIT - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -73,7 +73,7 @@ module.exports = { * area while keeping the aspect ratio. This may extend further out than the target size. * * @name Phaser.Scale.ScaleModes.ENVELOP - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -83,7 +83,7 @@ module.exports = { * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. * * @name Phaser.Scale.ScaleModes.RESIZE - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ diff --git a/src/scale/const/ZOOM_CONST.js b/src/scale/const/ZOOM_CONST.js index c2e57b064..4dffa7b82 100644 --- a/src/scale/const/ZOOM_CONST.js +++ b/src/scale/const/ZOOM_CONST.js @@ -28,7 +28,7 @@ module.exports = { * The game canvas will not be zoomed by Phaser. * * @name Phaser.Scale.Zoom.NO_ZOOM - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -38,7 +38,7 @@ module.exports = { * The game canvas will be 2x zoomed by Phaser. * * @name Phaser.Scale.Zoom.ZOOM_2X - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -48,7 +48,7 @@ module.exports = { * The game canvas will be 4x zoomed by Phaser. * * @name Phaser.Scale.Zoom.ZOOM_4X - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ @@ -59,7 +59,7 @@ module.exports = { * fit into the parent, or browser window if no parent is set. * * @name Phaser.Scale.Zoom.MAX_ZOOM - * @type {integer} + * @type {number} * @const * @since 3.16.0 */ diff --git a/src/scene/Scene.js b/src/scene/Scene.js index 6818d3956..8d1418119 100644 --- a/src/scene/Scene.js +++ b/src/scene/Scene.js @@ -269,6 +269,15 @@ var Scene = new Class({ * @since 3.0.0 */ this.plugins; + + /** + * A reference to the renderer instance Phaser is using, either Canvas or WebGL. + * + * @name Phaser.Scene#renderer + * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} + * @since 3.50.0 + */ + this.renderer; }, /** diff --git a/src/scene/SceneManager.js b/src/scene/SceneManager.js index 5bcc74d51..7eb24dbca 100644 --- a/src/scene/SceneManager.js +++ b/src/scene/SceneManager.js @@ -20,7 +20,7 @@ var Systems = require('./Systems'); * * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the * Scenes in a Game instance. - * +ó * * * @class SceneManager * @memberof Phaser.Scenes @@ -1156,33 +1156,39 @@ var SceneManager = new Class({ if (scene) { + var sys = scene.sys; + // If the Scene is already running (perhaps they called start from a launched sub-Scene?) // then we close it down before starting it again. - if (scene.sys.isActive() || scene.sys.isPaused()) + if (sys.isActive() || sys.isPaused()) { - scene.sys.shutdown(); + sys.shutdown(); - scene.sys.start(data); + sys.sceneUpdate = NOOP; + + sys.start(data); } else { - scene.sys.start(data); + sys.sceneUpdate = NOOP; + + sys.start(data); var loader; - if (scene.sys.load) + if (sys.load) { - loader = scene.sys.load; + loader = sys.load; } // Files payload? - if (loader && scene.sys.settings.hasOwnProperty('pack')) + if (loader && sys.settings.hasOwnProperty('pack')) { loader.reset(); - if (loader.addPack({ payload: scene.sys.settings.pack })) + if (loader.addPack({ payload: sys.settings.pack })) { - scene.sys.settings.status = CONST.LOADING; + sys.settings.status = CONST.LOADING; loader.once(LoaderEvents.COMPLETE, this.payloadComplete, this); @@ -1261,7 +1267,7 @@ var SceneManager = new Class({ * @method Phaser.Scenes.SceneManager#getAt * @since 3.0.0 * - * @param {integer} index - The index of the Scene to retrieve. + * @param {number} index - The index of the Scene to retrieve. * * @return {(Phaser.Scene|undefined)} The Scene. */ @@ -1278,7 +1284,7 @@ var SceneManager = new Class({ * * @param {(string|Phaser.Scene)} key - The key of the Scene. * - * @return {integer} The index of the Scene. + * @return {number} The index of the Scene. */ getIndex: function (key) { diff --git a/src/scene/ScenePlugin.js b/src/scene/ScenePlugin.js index 30d2fe4b1..57b96118c 100644 --- a/src/scene/ScenePlugin.js +++ b/src/scene/ScenePlugin.js @@ -86,7 +86,7 @@ var ScenePlugin = new Class({ * Transition elapsed timer. * * @name Phaser.Scenes.ScenePlugin#_elapsed - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -106,7 +106,7 @@ var ScenePlugin = new Class({ * Transition duration. * * @name Phaser.Scenes.ScenePlugin#_duration - * @type {integer} + * @type {number} * @private * @since 3.5.0 */ @@ -951,7 +951,7 @@ var ScenePlugin = new Class({ * * @param {(string|Phaser.Scene)} [key] - The Scene to get the index of. * - * @return {integer} The index of the Scene. + * @return {number} The index of the Scene. */ getIndex: function (key) { diff --git a/src/scene/const.js b/src/scene/const.js index d461d476e..265e776bc 100644 --- a/src/scene/const.js +++ b/src/scene/const.js @@ -17,7 +17,7 @@ var CONST = { * * @name Phaser.Scenes.PENDING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING: 0, @@ -27,7 +27,7 @@ var CONST = { * * @name Phaser.Scenes.INIT * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ INIT: 1, @@ -37,7 +37,7 @@ var CONST = { * * @name Phaser.Scenes.START * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ START: 2, @@ -47,7 +47,7 @@ var CONST = { * * @name Phaser.Scenes.LOADING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ LOADING: 3, @@ -57,7 +57,7 @@ var CONST = { * * @name Phaser.Scenes.CREATING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ CREATING: 4, @@ -67,7 +67,7 @@ var CONST = { * * @name Phaser.Scenes.RUNNING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ RUNNING: 5, @@ -77,7 +77,7 @@ var CONST = { * * @name Phaser.Scenes.PAUSED * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSED: 6, @@ -87,7 +87,7 @@ var CONST = { * * @name Phaser.Scenes.SLEEPING * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ SLEEPING: 7, @@ -97,7 +97,7 @@ var CONST = { * * @name Phaser.Scenes.SHUTDOWN * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ SHUTDOWN: 8, @@ -107,7 +107,7 @@ var CONST = { * * @name Phaser.Scenes.DESTROYED * @readonly - * @type {integer} + * @type {number} * @since 3.0.0 */ DESTROYED: 9 diff --git a/src/scene/typedefs/SceneTransitionConfig.js b/src/scene/typedefs/SceneTransitionConfig.js index 7dc6a6c28..0d9ca816a 100644 --- a/src/scene/typedefs/SceneTransitionConfig.js +++ b/src/scene/typedefs/SceneTransitionConfig.js @@ -3,7 +3,7 @@ * @since 3.5.0 * * @property {string} target - The Scene key to transition to. - * @property {integer} [duration=1000] - The duration, in ms, for the transition to last. + * @property {number} [duration=1000] - The duration, in ms, for the transition to last. * @property {boolean} [sleep=false] - Will the Scene responsible for the transition be sent to sleep on completion (`true`), or stopped? (`false`) * @property {boolean} [remove=false] - Will the Scene responsible for the transition be removed from the Scene Manager after the transition completes? * @property {boolean} [allowInput=false] - Will the Scenes Input system be able to process events while it is transitioning in or out? diff --git a/src/scene/typedefs/SettingsObject.js b/src/scene/typedefs/SettingsObject.js index cd074bb8b..18a20f757 100644 --- a/src/scene/typedefs/SettingsObject.js +++ b/src/scene/typedefs/SettingsObject.js @@ -9,7 +9,7 @@ * @property {boolean} isBooted - Has the Scene finished booting? * @property {boolean} isTransition - Is the Scene in a state of transition? * @property {?Phaser.Scene} transitionFrom - The Scene this Scene is transitioning from, if set. - * @property {integer} transitionDuration - The duration of the transition, if set. + * @property {number} transitionDuration - The duration of the transition, if set. * @property {boolean} transitionAllowInput - Is this Scene allowed to receive input during transitions? * @property {object} data - a data bundle passed to this Scene from the Scene Manager. * @property {(false|Phaser.Types.Loader.FileTypes.PackFileSection)} pack - Files to be loaded before the Scene begins. diff --git a/src/structs/List.js b/src/structs/List.js index b7bc7ddfe..4d3840945 100644 --- a/src/structs/List.js +++ b/src/structs/List.js @@ -62,7 +62,7 @@ var List = new Class({ * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. * * @name Phaser.Structs.List#position - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -130,7 +130,7 @@ var List = new Class({ * @genericUse {T} - [child,$return] * * @param {*} child - The item, or array of items, to add to the list. - * @param {integer} [index=0] - The index in the list at which the element(s) will be inserted. + * @param {number} [index=0] - The index in the list at which the element(s) will be inserted. * @param {boolean} [skipCallback=false] - Skip calling the List.addCallback if this child is added successfully. * * @return {*} The List's underlying array. @@ -155,7 +155,7 @@ var List = new Class({ * * @genericUse {T} - [$return] * - * @param {integer} index - The index of the item. + * @param {number} index - The index of the item. * * @return {*} The retrieved item, or `undefined` if it's outside the List's bounds. */ @@ -174,7 +174,7 @@ var List = new Class({ * * @param {*} child - The item to locate. * - * @return {integer} The index of the item within the List, or -1 if it's not in the List. + * @return {number} The index of the item within the List, or -1 if it's not in the List. */ getIndex: function (child) { @@ -243,8 +243,8 @@ var List = new Class({ * * @genericUse {T | null} - [$return] * - * @param {integer} [startIndex=0] - Offset from the front of the group (lowest child). - * @param {integer} [length=(to top)] - Restriction on the number of values you want to randomly select from. + * @param {number} [startIndex=0] - Offset from the front of the group (lowest child). + * @param {number} [length=(to top)] - Restriction on the number of values you want to randomly select from. * * @return {?*} A random child of this Group. */ @@ -296,8 +296,8 @@ var List = new Class({ * * @param {string} [property] - An optional property to test against the value argument. * @param {*} [value] - If property is set then Child.property must strictly equal this value to be included in the results. - * @param {integer} [startIndex] - The first child index to start the search from. - * @param {integer} [endIndex] - The last child index to search up until. + * @param {number} [startIndex] - The first child index to start the search from. + * @param {number} [endIndex] - The last child index to search up until. * * @return {Array.<*>} All items of the List which match the given criterion, if any. */ @@ -317,7 +317,7 @@ var List = new Class({ * @param {string} property - The property to test on each item. * @param {*} value - The value to test the property against. * - * @return {integer} The total number of matching elements. + * @return {number} The total number of matching elements. */ count: function (property, value) { @@ -349,7 +349,7 @@ var List = new Class({ * @genericUse {T} - [child,$return] * * @param {*} child - The item to move. - * @param {integer} index - Moves an item in the List to a new position. + * @param {number} index - Moves an item in the List to a new position. * * @return {*} The item that was moved. */ @@ -391,7 +391,7 @@ var List = new Class({ * * @genericUse {T} - [$return] * - * @param {integer} index - The position to remove the item from. + * @param {number} index - The position to remove the item from. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * * @return {*} The item that was removed. @@ -416,8 +416,8 @@ var List = new Class({ * * @genericUse {T[]} - [$return] * - * @param {integer} [startIndex=0] - The index to start removing from. - * @param {integer} [endIndex] - The position to stop removing at. The item at this position won't be removed. + * @param {number} [startIndex=0] - The index to start removing from. + * @param {number} [endIndex] - The position to stop removing at. The item at this position won't be removed. * @param {boolean} [skipCallback=false] - Skip calling the List.removeCallback. * * @return {Array.<*>} An array of the items which were removed. @@ -609,8 +609,8 @@ var List = new Class({ * * @param {string} property - The name of the property to set. * @param {*} value - The value to set the property to. - * @param {integer} [startIndex] - The first child index to start the search from. - * @param {integer} [endIndex] - The last child index to search up until. + * @param {number} [startIndex] - The first child index to start the search from. + * @param {number} [endIndex] - The last child index to search up until. */ setAll: function (property, value, startIndex, endIndex) { @@ -680,7 +680,7 @@ var List = new Class({ * The number of items inside the List. * * @name Phaser.Structs.List#length - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ diff --git a/src/structs/Map.js b/src/structs/Map.js index 28ab15b22..3589fbe9c 100644 --- a/src/structs/Map.js +++ b/src/structs/Map.js @@ -18,7 +18,7 @@ var Class = require('../utils/Class'); /** * @classdesc * The keys of a Map can be arbitrary values. - * + * * ```javascript * var map = new Map([ * [ 1, 'one' ], @@ -272,7 +272,9 @@ var Map = new Class({ }, /** - * Passes all entries in this Map to the given callback. + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. * * @method Phaser.Structs.Map#each * @since 3.0.0 diff --git a/src/structs/ProcessQueue.js b/src/structs/ProcessQueue.js index 80f50e9a0..0a14d14aa 100644 --- a/src/structs/ProcessQueue.js +++ b/src/structs/ProcessQueue.js @@ -82,7 +82,7 @@ var ProcessQueue = new Class({ * The total number of items awaiting processing. * * @name Phaser.Structs.ProcessQueue#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -264,7 +264,7 @@ var ProcessQueue = new Class({ * The number of entries in the active list. * * @name Phaser.Structs.ProcessQueue#length - * @type {integer} + * @type {number} * @readonly * @since 3.20.0 */ diff --git a/src/structs/Set.js b/src/structs/Set.js index b2911a8cb..39d7b1b12 100644 --- a/src/structs/Set.js +++ b/src/structs/Set.js @@ -414,7 +414,7 @@ var Set = new Class({ * Increasing the size larger than the current size has no effect. * * @name Phaser.Structs.Set#size - * @type {integer} + * @type {number} * @since 3.0.0 */ size: { diff --git a/src/structs/Size.js b/src/structs/Size.js index 97c895d5f..e5b8c276e 100644 --- a/src/structs/Size.js +++ b/src/structs/Size.js @@ -24,7 +24,7 @@ var Vector2 = require('../math/Vector2'); * * @param {number} [width=0] - The width of the Size component. * @param {number} [height=width] - The height of the Size component. If not given, it will use the `width`. - * @param {integer} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode. + * @param {number} [aspectMode=0] - The aspect mode of the Size component. Defaults to 0, no mode. * @param {any} [parent=null] - The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible. */ var Size = new Class({ @@ -73,7 +73,7 @@ var Size = new Class({ * This property is read-only. To change it use the `setAspectMode` method. * * @name Phaser.Structs.Size#aspectMode - * @type {integer} + * @type {number} * @readonly * @since 3.16.0 */ @@ -171,7 +171,7 @@ var Size = new Class({ * @method Phaser.Structs.Size#setAspectMode * @since 3.16.0 * - * @param {integer} [value=0] - The aspect mode value. + * @param {number} [value=0] - The aspect mode value. * * @return {this} This Size component instance. */ @@ -724,7 +724,7 @@ var Size = new Class({ * * @name Phaser.Structs.Size.NONE * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.NONE = 0; @@ -734,7 +734,7 @@ Size.NONE = 0; * * @name Phaser.Structs.Size.WIDTH_CONTROLS_HEIGHT * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.WIDTH_CONTROLS_HEIGHT = 1; @@ -744,7 +744,7 @@ Size.WIDTH_CONTROLS_HEIGHT = 1; * * @name Phaser.Structs.Size.HEIGHT_CONTROLS_WIDTH * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.HEIGHT_CONTROLS_WIDTH = 2; @@ -754,7 +754,7 @@ Size.HEIGHT_CONTROLS_WIDTH = 2; * * @name Phaser.Structs.Size.FIT * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.FIT = 3; @@ -764,7 +764,7 @@ Size.FIT = 3; * * @name Phaser.Structs.Size.ENVELOP * @constant - * @type {integer} + * @type {number} * @since 3.16.0 */ Size.ENVELOP = 4; diff --git a/src/textures/CanvasTexture.js b/src/textures/CanvasTexture.js index 32cededf5..c2b6166a3 100644 --- a/src/textures/CanvasTexture.js +++ b/src/textures/CanvasTexture.js @@ -23,10 +23,10 @@ var Texture = require('./Texture'); * you should call `CanvasTexture.refresh()` once you are finished with your changes to the canvas. Try and keep * this to a minimum, especially on large canvas sizes, or you may inadvertently thrash the GPU by constantly uploading * texture data to it. This restriction does not apply if using the Canvas Renderer. - * + * * It starts with only one frame that covers the whole of the canvas. You can add further frames, that specify * sections of the canvas using the `add` method. - * + * * Should you need to resize the canvas use the `setSize` method so that it accurately updates all of the underlying * texture data as well. Forgetting to do this (i.e. by changing the canvas size directly from your code) could cause * graphical errors. @@ -40,8 +40,8 @@ var Texture = require('./Texture'); * @param {Phaser.Textures.TextureManager} manager - A reference to the Texture Manager this Texture belongs to. * @param {string} key - The unique string-based key of this Texture. * @param {HTMLCanvasElement} source - The canvas element that is used as the base of this texture. - * @param {integer} width - The width of the canvas. - * @param {integer} height - The height of the canvas. + * @param {number} width - The width of the canvas. + * @param {number} height - The height of the canvas. */ var CanvasTexture = new Class({ @@ -91,7 +91,7 @@ var CanvasTexture = new Class({ * * @name Phaser.Textures.CanvasTexture#width * @readonly - * @type {integer} + * @type {number} * @since 3.7.0 */ this.width = width; @@ -102,7 +102,7 @@ var CanvasTexture = new Class({ * * @name Phaser.Textures.CanvasTexture#height * @readonly - * @type {integer} + * @type {number} * @since 3.7.0 */ this.height = height; @@ -216,11 +216,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#draw * @since 3.13.0 - * - * @param {integer} x - The x coordinate to draw the source at. - * @param {integer} y - The y coordinate to draw the source at. + * + * @param {number} x - The x coordinate to draw the source at. + * @param {number} y - The y coordinate to draw the source at. * @param {(HTMLImageElement|HTMLCanvasElement)} source - The element to draw to this canvas. - * + * * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. */ draw: function (x, y, source) @@ -236,12 +236,12 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#drawFrame * @since 3.16.0 - * + * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. - * @param {integer} [x=0] - The x coordinate to draw the source at. - * @param {integer} [y=0] - The y coordinate to draw the source at. - * + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {number} [x=0] - The x coordinate to draw the source at. + * @param {number} [y=0] - The y coordinate to draw the source at. + * * @return {Phaser.Textures.CanvasTexture} This CanvasTexture. */ drawFrame: function (key, frame, x, y) @@ -284,14 +284,14 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#setPixel * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} red - The red color value. A number between 0 and 255. - * @param {integer} green - The green color value. A number between 0 and 255. - * @param {integer} blue - The blue color value. A number between 0 and 255. - * @param {integer} [alpha=255] - The alpha value. A number between 0 and 255. - * + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} red - The red color value. A number between 0 and 255. + * @param {number} green - The green color value. A number between 0 and 255. + * @param {number} blue - The blue color value. A number between 0 and 255. + * @param {number} [alpha=255] - The alpha value. A number between 0 and 255. + * * @return {this} This CanvasTexture. */ setPixel: function (x, y, red, green, blue, alpha) @@ -323,15 +323,15 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#putData * @since 3.16.0 - * + * * @param {ImageData} imageData - The ImageData to put at the given location. - * @param {integer} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. - * @param {integer} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. - * @param {integer} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. - * + * @param {number} x - The x coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate to put the imageData. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [dirtyX=0] - Horizontal position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {number} [dirtyY=0] - Vertical position (x coordinate) of the top-left corner from which the image data will be extracted. + * @param {number} [dirtyWidth] - Width of the rectangle to be painted. Defaults to the width of the image data. + * @param {number} [dirtyHeight] - Height of the rectangle to be painted. Defaults to the height of the image data. + * * @return {this} This CanvasTexture. */ putData: function (imageData, x, y, dirtyX, dirtyY, dirtyWidth, dirtyHeight) @@ -352,12 +352,12 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#getData * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. - * @param {integer} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. - * + * + * @param {number} x - The x coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the top-left of the area to get the ImageData from. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} width - The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. + * @param {number} height - The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. + * * @return {ImageData} The ImageData extracted from this CanvasTexture. */ getData: function (x, y, width, height) @@ -374,17 +374,17 @@ var CanvasTexture = new Class({ /** * Get the color of a specific pixel from this texture and store it in a Color object. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * * @method Phaser.Textures.CanvasTexture#getPixel * @since 3.13.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. * @param {Phaser.Display.Color} [out] - A Color object to store the pixel values in. If not provided a new Color object will be created. - * + * * @return {Phaser.Display.Color} An object with the red, green, blue and alpha values set in the r, g, b and a properties. */ getPixel: function (x, y, out) @@ -416,18 +416,18 @@ var CanvasTexture = new Class({ * * If the requested region extends outside the bounds of this CanvasTexture, * the region is truncated to fit. - * + * * If you have drawn anything to this CanvasTexture since it was created you must call `CanvasTexture.update` to refresh the array buffer, * otherwise this may return out of date color values, or worse - throw a run-time error as it tries to access an array element that doesn't exist. * * @method Phaser.Textures.CanvasTexture#getPixels * @since 3.16.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. - * @param {integer} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. - * + * + * @param {number} [x=0] - The x coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [y=0] - The y coordinate of the top-left of the region. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} [width] - The width of the region to get. Must be an integer. Defaults to the canvas width if not given. + * @param {number} [height] - The height of the region to get. Must be an integer. If not given will be set to the `width`. + * * @return {Phaser.Types.Textures.PixelConfig[][]} A 2d array of Pixel objects. */ getPixels: function (x, y, width, height) @@ -476,11 +476,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#getIndex * @since 3.16.0 - * - * @param {integer} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * @param {integer} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. - * - * @return {integer} + * + * @param {number} x - The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * @param {number} y - The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. + * + * @return {number} */ getIndex: function (x, y) { @@ -546,11 +546,11 @@ var CanvasTexture = new Class({ * * @method Phaser.Textures.CanvasTexture#clear * @since 3.7.0 - * - * @param {integer} [x=0] - The x coordinate of the top-left of the region to clear. - * @param {integer} [y=0] - The y coordinate of the top-left of the region to clear. - * @param {integer} [width] - The width of the region. - * @param {integer} [height] - The height of the region. + * + * @param {number} [x=0] - The x coordinate of the top-left of the region to clear. + * @param {number} [y=0] - The y coordinate of the top-left of the region to clear. + * @param {number} [width] - The width of the region. + * @param {number} [height] - The height of the region. * * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. */ @@ -572,8 +572,8 @@ var CanvasTexture = new Class({ * @method Phaser.Textures.CanvasTexture#setSize * @since 3.7.0 * - * @param {integer} width - The new width of the Canvas. - * @param {integer} [height] - The new height of the Canvas. If not given it will use the width as the height. + * @param {number} width - The new width of the Canvas. + * @param {number} [height] - The new height of the Canvas. If not given it will use the width as the height. * * @return {Phaser.Textures.CanvasTexture} The Canvas Texture. */ diff --git a/src/textures/Frame.js b/src/textures/Frame.js index 61b7e3d0d..9340b4411 100644 --- a/src/textures/Frame.js +++ b/src/textures/Frame.js @@ -18,8 +18,8 @@ var Extend = require('../utils/object/Extend'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture this Frame is a part of. - * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. * @param {number} width - The width of this Frame. @@ -63,7 +63,7 @@ var Frame = new Class({ * The index of the TextureSource in the Texture sources array. * * @name Phaser.Textures.Frame#sourceIndex - * @type {integer} + * @type {number} * @since 3.0.0 */ this.sourceIndex = sourceIndex; @@ -82,7 +82,7 @@ var Frame = new Class({ * X position within the source image to cut from. * * @name Phaser.Textures.Frame#cutX - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutX; @@ -91,7 +91,7 @@ var Frame = new Class({ * Y position within the source image to cut from. * * @name Phaser.Textures.Frame#cutY - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutY; @@ -100,7 +100,7 @@ var Frame = new Class({ * The width of the area in the source image to cut. * * @name Phaser.Textures.Frame#cutWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutWidth; @@ -109,7 +109,7 @@ var Frame = new Class({ * The height of the area in the source image to cut. * * @name Phaser.Textures.Frame#cutHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.cutHeight; @@ -118,7 +118,7 @@ var Frame = new Class({ * The X rendering offset of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#x - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -128,7 +128,7 @@ var Frame = new Class({ * The Y rendering offset of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#y - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -138,7 +138,7 @@ var Frame = new Class({ * The rendering width of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width; @@ -147,7 +147,7 @@ var Frame = new Class({ * The rendering height of this Frame, taking trim into account. * * @name Phaser.Textures.Frame#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height; @@ -157,7 +157,7 @@ var Frame = new Class({ * Precalculated for the renderer. * * @name Phaser.Textures.Frame#halfWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.halfWidth; @@ -167,7 +167,7 @@ var Frame = new Class({ * Precalculated for the renderer. * * @name Phaser.Textures.Frame#halfHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.halfHeight; @@ -176,7 +176,7 @@ var Frame = new Class({ * The x center of this frame, floored. * * @name Phaser.Textures.Frame#centerX - * @type {integer} + * @type {number} * @since 3.0.0 */ this.centerX; @@ -185,7 +185,7 @@ var Frame = new Class({ * The y center of this frame, floored. * * @name Phaser.Textures.Frame#centerY - * @type {integer} + * @type {number} * @since 3.0.0 */ this.centerY; @@ -241,7 +241,7 @@ var Frame = new Class({ * 1 = Round * * @name Phaser.Textures.Frame#autoRound - * @type {integer} + * @type {number} * @default -1 * @since 3.0.0 */ @@ -347,10 +347,10 @@ var Frame = new Class({ * @method Phaser.Textures.Frame#setSize * @since 3.7.0 * - * @param {integer} width - The width of the frame before being trimmed. - * @param {integer} height - The height of the frame before being trimmed. - * @param {integer} [x=0] - The x coordinate of the top-left of this Frame. - * @param {integer} [y=0] - The y coordinate of the top-left of this Frame. + * @param {number} width - The width of the frame before being trimmed. + * @param {number} height - The height of the frame before being trimmed. + * @param {number} [x=0] - The x coordinate of the top-left of this Frame. + * @param {number} [y=0] - The y coordinate of the top-left of this Frame. * * @return {Phaser.Textures.Frame} This Frame object. */ diff --git a/src/textures/Texture.js b/src/textures/Texture.js index f74626152..1659e2373 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -16,7 +16,7 @@ var TEXTURE_MISSING_ERROR = 'Texture.frame missing: '; * The Frames represent the different areas of the Texture. For example a texture atlas * may have many Frames, one for each element within the atlas. Where-as a single image would have * just one frame, that encompasses the whole image. - * + * * Every Texture, no matter where it comes from, always has at least 1 frame called the `__BASE` frame. * This frame represents the entirety of the source image. * @@ -115,12 +115,12 @@ var Texture = new Class({ /** * The total number of Frames in this Texture, including the `__BASE` frame. - * + * * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. * * @name Phaser.Textures.Texture#frameTotal - * @type {integer} + * @type {number} * @default 0 * @since 3.0.0 */ @@ -137,14 +137,14 @@ var Texture = new Class({ * Adds a new Frame to this Texture. * * A Frame is a rectangular region of a TextureSource with a unique index or string-based key. - * + * * The name given must be unique within this Texture. If it already exists, this method will return `null`. * * @method Phaser.Textures.Texture#add * @since 3.0.0 * - * @param {(integer|string)} name - The name of this Frame. The name is unique within the Texture. - * @param {integer} sourceIndex - The index of the TextureSource that this Frame is a part of. + * @param {(number|string)} name - The name of this Frame. The name is unique within the Texture. + * @param {number} sourceIndex - The index of the TextureSource that this Frame is a part of. * @param {number} x - The x coordinate of the top-left of this Frame. * @param {number} y - The y coordinate of the top-left of this Frame. * @param {number} width - The width of this Frame. @@ -179,7 +179,7 @@ var Texture = new Class({ /** * Removes the given Frame from this Texture. The Frame is destroyed immediately. - * + * * Any Game Objects using this Frame should stop using it _before_ you remove it, * as it does not happen automatically. * @@ -231,7 +231,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#get * @since 3.0.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {Phaser.Textures.Frame} The Texture Frame. */ @@ -266,7 +266,7 @@ var Texture = new Class({ * * @param {Phaser.Textures.TextureSource} source - The TextureSource to check. * - * @return {integer} The index of the TextureSource within this Texture, or -1 if not in this Texture. + * @return {number} The index of the TextureSource within this Texture, or -1 if not in this Texture. */ getTextureSourceIndex: function (source) { @@ -287,7 +287,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getFramesFromTextureSource * @since 3.0.0 * - * @param {integer} sourceIndex - The index of the TextureSource to get the Frames from. + * @param {number} sourceIndex - The index of the TextureSource to get the Frames from. * @param {boolean} [includeBase=false] - Include the `__BASE` Frame in the output array? * * @return {Phaser.Textures.Frame[]} An array of Texture Frames. @@ -356,7 +356,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getSourceImage * @since 3.0.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {(HTMLImageElement|HTMLCanvasElement|Phaser.GameObjects.RenderTexture)} The DOM Image, Canvas Element or Render Texture. */ @@ -390,7 +390,7 @@ var Texture = new Class({ * @method Phaser.Textures.Texture#getDataSourceImage * @since 3.7.0 * - * @param {(string|integer)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. + * @param {(string|number)} [name] - The string-based name, or integer based index, of the Frame to get from this Texture. * * @return {(HTMLImageElement|HTMLCanvasElement)} The DOM Image or Canvas Element. */ @@ -435,7 +435,7 @@ var Texture = new Class({ { data = [ data ]; } - + for (var i = 0; i < data.length; i++) { var source = this.source[i]; diff --git a/src/textures/TextureManager.js b/src/textures/TextureManager.js index c676be456..d04649609 100644 --- a/src/textures/TextureManager.js +++ b/src/textures/TextureManager.js @@ -104,7 +104,7 @@ var TextureManager = new Class({ * An counting value used for emitting 'ready' event after all of managers in game is loaded. * * @name Phaser.Textures.TextureManager#_pending - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 @@ -247,6 +247,10 @@ var TextureManager = new Class({ /** * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. * + * It works by creating an `Image` DOM object, then setting the `src` attribute to + * the given base64 encoded data. As a result, the process is asynchronous by its nature, + * so be sure to listen for the events this method dispatches before using the texture. + * * @method Phaser.Textures.TextureManager#addBase64 * @fires Phaser.Textures.Events#ADD * @fires Phaser.Textures.Events#ERROR @@ -301,7 +305,7 @@ var TextureManager = new Class({ * @since 3.12.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. * @param {string} [type='image/png'] - A DOMString indicating the image format. The default format type is image/png. * @param {number} [encoderOptions=0.92] - A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp. If this argument is anything else, the default value for image quality is used. The default value is 0.92. Other arguments are ignored. * @@ -386,6 +390,9 @@ var TextureManager = new Class({ * * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. * + * If the `width` and `height` arguments are omitted, but the WebGL Texture was created by Phaser's WebGL Renderer + * and has `glTexture.width` and `glTexture.height` properties, these values will be used instead. + * * This is a WebGL only feature. * * @method Phaser.Textures.TextureManager#addGLTexture @@ -394,8 +401,8 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {WebGLTexture} glTexture - The source Render Texture. - * @param {number} width - The new width of the Texture. - * @param {number} height - The new height of the Texture. + * @param {number} [width] - The new width of the Texture. Read from `glTexture.width` if omitted. + * @param {number} [height] - The new height of the Texture. Read from `glTexture.height` if omitted. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -405,6 +412,9 @@ var TextureManager = new Class({ if (this.checkKey(key)) { + if (width === undefined) { width = glTexture.width; } + if (height === undefined) { height = glTexture.height; } + texture = this.create(key, glTexture, width, height); texture.add('__BASE', 0, 0, 0, width, height); @@ -515,8 +525,8 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {integer} [width=256] - The width of the Canvas element. - * @param {integer} [height=256] - The height of the Canvas element. + * @param {number} [width=256] - The width of the Canvas element. + * @param {number} [height=256] - The height of the Canvas element. * * @return {?Phaser.Textures.CanvasTexture} The Canvas Texture that was created, or `null` if the key is already in use. */ @@ -866,8 +876,8 @@ var TextureManager = new Class({ * * @param {string} key - The unique string-based key of the Texture. * @param {HTMLImageElement} source - The source Image element. - * @param {integer} width - The width of the Texture. - * @param {integer} height - The height of the Texture. + * @param {number} width - The width of the Texture. + * @param {number} height - The height of the Texture. * * @return {?Phaser.Textures.Texture} The Texture that was created, or `null` if the key is already in use. */ @@ -941,7 +951,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} frame - The string or index of the Frame to be cloned. + * @param {(string|number)} frame - The string or index of the Frame to be cloned. * * @return {Phaser.Textures.Frame} A Clone of the given Frame. */ @@ -960,7 +970,7 @@ var TextureManager = new Class({ * @since 3.0.0 * * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. + * @param {(string|number)} [frame] - The string-based name, or integer based index, of the Frame to get from the Texture. * * @return {Phaser.Textures.Frame} A Texture Frame object. */ @@ -1004,10 +1014,10 @@ var TextureManager = new Class({ * @method Phaser.Textures.TextureManager#getPixel * @since 3.0.0 * - * @param {integer} x - The x coordinate of the pixel within the Texture. - * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {number} x - The x coordinate of the pixel within the Texture. + * @param {number} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * * @return {?Phaser.Display.Color} A Color object populated with the color values of the requested pixel, * or `null` if the coordinates were out of bounds. @@ -1051,12 +1061,12 @@ var TextureManager = new Class({ * @method Phaser.Textures.TextureManager#getPixelAlpha * @since 3.10.0 * - * @param {integer} x - The x coordinate of the pixel within the Texture. - * @param {integer} y - The y coordinate of the pixel within the Texture. + * @param {number} x - The x coordinate of the pixel within the Texture. + * @param {number} y - The y coordinate of the pixel within the Texture. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * - * @return {integer} A value between 0 and 255, or `null` if the coordinates were out of bounds. + * @return {number} A value between 0 and 255, or `null` if the coordinates were out of bounds. */ getPixelAlpha: function (x, y, key, frame) { @@ -1098,7 +1108,7 @@ var TextureManager = new Class({ * * @param {Phaser.GameObjects.GameObject} gameObject - The Game Object the texture would be set on. * @param {string} key - The unique string-based key of the Texture. - * @param {(string|integer)} [frame] - The string or index of the Frame. + * @param {(string|number)} [frame] - The string or index of the Frame. * * @return {Phaser.GameObjects.GameObject} The Game Object the texture was set on. */ diff --git a/src/textures/TextureSource.js b/src/textures/TextureSource.js index 29995e0cf..ce2c04f80 100644 --- a/src/textures/TextureSource.js +++ b/src/textures/TextureSource.js @@ -24,8 +24,8 @@ var ScaleModes = require('../renderer/ScaleModes'); * * @param {Phaser.Textures.Texture} texture - The Texture this TextureSource belongs to. * @param {(HTMLImageElement|HTMLCanvasElement|HTMLVideoElement|Phaser.GameObjects.RenderTexture|WebGLTexture)} source - The source image data. - * @param {integer} [width] - Optional width of the source image. If not given it's derived from the source itself. - * @param {integer} [height] - Optional height of the source image. If not given it's derived from the source itself. + * @param {number} [width] - Optional width of the source image. If not given it's derived from the source itself. + * @param {number} [height] - Optional height of the source image. If not given it's derived from the source itself. * @param {boolean} [flipY=false] - Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. */ var TextureSource = new Class({ @@ -82,7 +82,7 @@ var TextureSource = new Class({ * Currently un-used. * * @name Phaser.Textures.TextureSource#compressionAlgorithm - * @type {integer} + * @type {number} * @default null * @since 3.0.0 */ @@ -103,7 +103,7 @@ var TextureSource = new Class({ * the `naturalWidth` and then `width` properties of the source image. * * @name Phaser.Textures.TextureSource#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = width || source.naturalWidth || source.videoWidth || source.width || 0; @@ -113,7 +113,7 @@ var TextureSource = new Class({ * the `naturalHeight` and then `height` properties of the source image. * * @name Phaser.Textures.TextureSource#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = height || source.naturalHeight || source.videoHeight || source.height || 0; @@ -339,7 +339,7 @@ var TextureSource = new Class({ { if (this.glTexture) { - this.renderer.deleteTexture(this.glTexture); + this.renderer.deleteTexture(this.glTexture, false); } if (this.isCanvas) diff --git a/src/textures/const.js b/src/textures/const.js index 1b7e56873..bd4ad8df8 100644 --- a/src/textures/const.js +++ b/src/textures/const.js @@ -17,7 +17,7 @@ var CONST = { * Linear filter type. * * @name Phaser.Textures.FilterMode.LINEAR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -27,7 +27,7 @@ var CONST = { * Nearest neighbor filter type. * * @name Phaser.Textures.FilterMode.NEAREST - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ diff --git a/src/textures/index.js b/src/textures/index.js index 0c3e1c92a..c47642178 100644 --- a/src/textures/index.js +++ b/src/textures/index.js @@ -15,7 +15,7 @@ var FilterMode = require('./const'); * Linear filter type. * * @name Phaser.Textures.LINEAR - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ @@ -24,7 +24,7 @@ var FilterMode = require('./const'); * Nearest Neighbor filter type. * * @name Phaser.Textures.NEAREST - * @type {integer} + * @type {number} * @const * @since 3.0.0 */ diff --git a/src/textures/parsers/AtlasXML.js b/src/textures/parsers/AtlasXML.js index 18a1b3aae..b26bda775 100644 --- a/src/textures/parsers/AtlasXML.js +++ b/src/textures/parsers/AtlasXML.js @@ -13,7 +13,7 @@ * @since 3.7.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {*} xml - The XML data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. diff --git a/src/textures/parsers/Canvas.js b/src/textures/parsers/Canvas.js index 479e20a4d..6490e79e8 100644 --- a/src/textures/parsers/Canvas.js +++ b/src/textures/parsers/Canvas.js @@ -13,7 +13,7 @@ * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. */ diff --git a/src/textures/parsers/Image.js b/src/textures/parsers/Image.js index 16d497dbd..1ef5db7ea 100644 --- a/src/textures/parsers/Image.js +++ b/src/textures/parsers/Image.js @@ -13,7 +13,7 @@ * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. */ diff --git a/src/textures/parsers/JSONArray.js b/src/textures/parsers/JSONArray.js index 97a4b951f..55d57d7c9 100644 --- a/src/textures/parsers/JSONArray.js +++ b/src/textures/parsers/JSONArray.js @@ -16,7 +16,7 @@ var Clone = require('../../utils/object/Clone'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} json - The JSON data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. diff --git a/src/textures/parsers/JSONHash.js b/src/textures/parsers/JSONHash.js index 32c9d44bc..b54933e10 100644 --- a/src/textures/parsers/JSONHash.js +++ b/src/textures/parsers/JSONHash.js @@ -16,7 +16,7 @@ var Clone = require('../../utils/object/Clone'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} json - The JSON data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. diff --git a/src/textures/parsers/SpriteSheet.js b/src/textures/parsers/SpriteSheet.js index 5f70fdcec..464e15c42 100644 --- a/src/textures/parsers/SpriteSheet.js +++ b/src/textures/parsers/SpriteSheet.js @@ -18,11 +18,11 @@ var GetFastValue = require('../../utils/object/GetFastValue'); * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. - * @param {integer} x - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. - * @param {integer} y - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. - * @param {integer} width - The width of the source image. - * @param {integer} height - The height of the source image. + * @param {number} sourceIndex - The index of the TextureSource. + * @param {number} x - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. + * @param {number} y - The top-left coordinate of the Sprite Sheet. Defaults to zero. Used when extracting sheets from atlases. + * @param {number} width - The width of the source image. + * @param {number} height - The height of the source image. * @param {object} config - An object describing how to parse the Sprite Sheet. * @param {number} config.frameWidth - Width in pixels of a single frame in the sprite sheet. * @param {number} [config.frameHeight] - Height in pixels of a single frame in the sprite sheet. Defaults to frameWidth if not provided. diff --git a/src/textures/parsers/UnityYAML.js b/src/textures/parsers/UnityYAML.js index fdbb4ed80..68c9d1cc4 100644 --- a/src/textures/parsers/UnityYAML.js +++ b/src/textures/parsers/UnityYAML.js @@ -45,7 +45,7 @@ var addFrame = function (texture, sourceIndex, name, frame) * @since 3.0.0 * * @param {Phaser.Textures.Texture} texture - The Texture to add the Frames to. - * @param {integer} sourceIndex - The index of the TextureSource. + * @param {number} sourceIndex - The index of the TextureSource. * @param {object} yaml - The YAML data. * * @return {Phaser.Textures.Texture} The Texture modified by this parser. diff --git a/src/textures/typedefs/PixelConfig.js b/src/textures/typedefs/PixelConfig.js index c59835d07..15594a6d6 100644 --- a/src/textures/typedefs/PixelConfig.js +++ b/src/textures/typedefs/PixelConfig.js @@ -4,8 +4,8 @@ * @typedef {object} Phaser.Types.Textures.PixelConfig * @since 3.16.0 * - * @property {integer} x - The x-coordinate of the pixel. - * @property {integer} y - The y-coordinate of the pixel. - * @property {integer} color - The color of the pixel, not including the alpha channel. + * @property {number} x - The x-coordinate of the pixel. + * @property {number} y - The y-coordinate of the pixel. + * @property {number} color - The color of the pixel, not including the alpha channel. * @property {number} alpha - The alpha of the pixel, between 0 and 1. */ diff --git a/src/textures/typedefs/SpriteSheetConfig.js b/src/textures/typedefs/SpriteSheetConfig.js index f9b50dee7..2e8647d69 100644 --- a/src/textures/typedefs/SpriteSheetConfig.js +++ b/src/textures/typedefs/SpriteSheetConfig.js @@ -2,10 +2,10 @@ * @typedef {object} Phaser.Types.Textures.SpriteSheetConfig * @since 3.0.0 * - * @property {integer} frameWidth - The fixed width of each frame. - * @property {integer} [frameHeight] - The fixed height of each frame. If not set it will use the frameWidth as the height. - * @property {integer} [startFrame=0] - Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. - * @property {integer} [endFrame=-1] - The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". - * @property {integer} [margin=0] - If the frames have been drawn with a margin, specify the amount here. - * @property {integer} [spacing=0] - If the frames have been drawn with spacing between them, specify the amount here. + * @property {number} frameWidth - The fixed width of each frame. + * @property {number} [frameHeight] - The fixed height of each frame. If not set it will use the frameWidth as the height. + * @property {number} [startFrame=0] - Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. + * @property {number} [endFrame=-1] - The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". + * @property {number} [margin=0] - If the frames have been drawn with a margin, specify the amount here. + * @property {number} [spacing=0] - If the frames have been drawn with spacing between them, specify the amount here. */ diff --git a/src/textures/typedefs/SpriteSheetFromAtlasConfig.js b/src/textures/typedefs/SpriteSheetFromAtlasConfig.js index 6116e59d7..eedaab5dd 100644 --- a/src/textures/typedefs/SpriteSheetFromAtlasConfig.js +++ b/src/textures/typedefs/SpriteSheetFromAtlasConfig.js @@ -4,10 +4,10 @@ * * @property {string} atlas - The key of the Texture Atlas in which this Sprite Sheet can be found. * @property {string} frame - The key of the Texture Atlas Frame in which this Sprite Sheet can be found. - * @property {integer} frameWidth - The fixed width of each frame. - * @property {integer} [frameHeight] - The fixed height of each frame. If not set it will use the frameWidth as the height. - * @property {integer} [startFrame=0] - Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. - * @property {integer} [endFrame=-1] - The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". - * @property {integer} [margin=0] - If the frames have been drawn with a margin, specify the amount here. - * @property {integer} [spacing=0] - If the frames have been drawn with spacing between them, specify the amount here. + * @property {number} frameWidth - The fixed width of each frame. + * @property {number} [frameHeight] - The fixed height of each frame. If not set it will use the frameWidth as the height. + * @property {number} [startFrame=0] - Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. + * @property {number} [endFrame=-1] - The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". + * @property {number} [margin=0] - If the frames have been drawn with a margin, specify the amount here. + * @property {number} [spacing=0] - If the frames have been drawn with spacing between them, specify the amount here. */ diff --git a/src/tilemaps/ImageCollection.js b/src/tilemaps/ImageCollection.js index aceb1ccde..36d885a6b 100644 --- a/src/tilemaps/ImageCollection.js +++ b/src/tilemaps/ImageCollection.js @@ -18,11 +18,11 @@ var Class = require('../utils/Class'); * @since 3.0.0 * * @param {string} name - The name of the image collection in the map data. - * @param {integer} firstgid - The first image index this image collection contains. - * @param {integer} [width=32] - Width of widest image (in pixels). - * @param {integer} [height=32] - Height of tallest image (in pixels). - * @param {integer} [margin=0] - The margin around all images in the collection (in pixels). - * @param {integer} [spacing=0] - The spacing between each image in the collection (in pixels). + * @param {number} firstgid - The first image index this image collection contains. + * @param {number} [width=32] - Width of widest image (in pixels). + * @param {number} [height=32] - Height of tallest image (in pixels). + * @param {number} [margin=0] - The margin around all images in the collection (in pixels). + * @param {number} [spacing=0] - The spacing between each image in the collection (in pixels). * @param {object} [properties={}] - Custom Image Collection properties. */ var ImageCollection = new Class({ @@ -50,7 +50,7 @@ var ImageCollection = new Class({ * This is the starting index of the first image index this Image Collection contains. * * @name Phaser.Tilemaps.ImageCollection#firstgid - * @type {integer} + * @type {number} * @since 3.0.0 */ this.firstgid = firstgid | 0; @@ -59,7 +59,7 @@ var ImageCollection = new Class({ * The width of the widest image (in pixels). * * @name Phaser.Tilemaps.ImageCollection#imageWidth - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -69,7 +69,7 @@ var ImageCollection = new Class({ * The height of the tallest image (in pixels). * * @name Phaser.Tilemaps.ImageCollection#imageHeight - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -80,7 +80,7 @@ var ImageCollection = new Class({ * Use `setSpacing` to change. * * @name Phaser.Tilemaps.ImageCollection#imageMarge - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -91,7 +91,7 @@ var ImageCollection = new Class({ * Use `setSpacing` to change. * * @name Phaser.Tilemaps.ImageCollection#imageSpacing - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -120,7 +120,7 @@ var ImageCollection = new Class({ * The total number of images in the image collection. * * @name Phaser.Tilemaps.ImageCollection#total - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -133,7 +133,7 @@ var ImageCollection = new Class({ * @method Phaser.Tilemaps.ImageCollection#containsImageIndex * @since 3.0.0 * - * @param {integer} imageIndex - The image index to search for. + * @param {number} imageIndex - The image index to search for. * * @return {boolean} True if this Image Collection contains the given index. */ @@ -148,7 +148,7 @@ var ImageCollection = new Class({ * @method Phaser.Tilemaps.ImageCollection#addImage * @since 3.0.0 * - * @param {integer} gid - The gid of the image in the Image Collection. + * @param {number} gid - The gid of the image in the Image Collection. * @param {string} image - The the key of the image in the Image Collection and in the cache. * * @return {Phaser.Tilemaps.ImageCollection} This ImageCollection object. diff --git a/src/tilemaps/ParseToTilemap.js b/src/tilemaps/ParseToTilemap.js index 851d13295..fc9f233e9 100644 --- a/src/tilemaps/ParseToTilemap.js +++ b/src/tilemaps/ParseToTilemap.js @@ -17,14 +17,14 @@ var Tilemap = require('./Tilemap'); * * @function Phaser.Tilemaps.ParseToTilemap * @since 3.0.0 - * + * * @param {Phaser.Scene} scene - The Scene to which this Tilemap belongs. * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param {integer} [tileWidth=32] - The width of a tile in pixels. - * @param {integer} [tileHeight=32] - The height of a tile in pixels. - * @param {integer} [width=10] - The width of the map in tiles. - * @param {integer} [height=10] - The height of the map in tiles. - * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * @param {number} [tileWidth=32] - The width of a tile in pixels. + * @param {number} [tileHeight=32] - The height of a tile in pixels. + * @param {number} [width=10] - The width of the map in tiles. + * @param {number} [height=10] - The height of the map in tiles. + * @param {number[][]} [data] - Instead of loading from the cache, you can also load directly from * a 2D array of tile indexes. * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty @@ -32,7 +32,7 @@ var Tilemap = require('./Tilemap'); * the tile data doesn't need to change then setting this value to `true` will help with memory * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. - * + * * @return {Phaser.Tilemaps.Tilemap} */ var ParseToTilemap = function (scene, key, tileWidth, tileHeight, width, height, data, insertNull) diff --git a/src/tilemaps/Tile.js b/src/tilemaps/Tile.js index e2238285e..6f3babce3 100644 --- a/src/tilemaps/Tile.js +++ b/src/tilemaps/Tile.js @@ -4,6 +4,7 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var CONST = require('./const/ORIENTATION_CONST'); var Class = require('../utils/Class'); var Components = require('../gameobjects/components'); var Rectangle = require('../geom/rectangle'); @@ -24,15 +25,15 @@ var Rectangle = require('../geom/rectangle'); * @extends Phaser.GameObjects.Components.Visible * * @param {Phaser.Tilemaps.LayerData} layer - The LayerData object in the Tilemap that this tile belongs to. - * @param {integer} index - The unique index of this tile within the map. - * @param {integer} x - The x coordinate of this tile in tile coordinates. - * @param {integer} y - The y coordinate of this tile in tile coordinates. - * @param {integer} width - Width of the tile in pixels. - * @param {integer} height - Height of the tile in pixels. - * @param {integer} baseWidth - The base width a tile in the map (in pixels). Tiled maps support + * @param {number} index - The unique index of this tile within the map. + * @param {number} x - The x coordinate of this tile in tile coordinates. + * @param {number} y - The y coordinate of this tile in tile coordinates. + * @param {number} width - Width of the tile in pixels. + * @param {number} height - Height of the tile in pixels. + * @param {number} baseWidth - The base width a tile in the map (in pixels). Tiled maps support * multiple tileset sizes within one map, but they are still placed at intervals of the base * tile width. - * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps + * @param {number} baseHeight - The base height of the tile in pixels (in pixels). Tiled maps * support multiple tileset sizes within one map, but they are still placed at intervals of the * base tile height. */ @@ -62,7 +63,7 @@ var Tile = new Class({ * represents a blank tile. * * @name Phaser.Tilemaps.Tile#index - * @type {integer} + * @type {number} * @since 3.0.0 */ this.index = index; @@ -71,7 +72,7 @@ var Tile = new Class({ * The x map coordinate of this tile in tile units. * * @name Phaser.Tilemaps.Tile#x - * @type {integer} + * @type {number} * @since 3.0.0 */ this.x = x; @@ -80,7 +81,7 @@ var Tile = new Class({ * The y map coordinate of this tile in tile units. * * @name Phaser.Tilemaps.Tile#y - * @type {integer} + * @type {number} * @since 3.0.0 */ this.y = y; @@ -89,7 +90,7 @@ var Tile = new Class({ * The width of the tile in pixels. * * @name Phaser.Tilemaps.Tile#width - * @type {integer} + * @type {number} * @since 3.0.0 */ this.width = width; @@ -98,27 +99,49 @@ var Tile = new Class({ * The height of the tile in pixels. * * @name Phaser.Tilemaps.Tile#height - * @type {integer} + * @type {number} * @since 3.0.0 */ this.height = height; /** - * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes + * The right of the tile in pixels. + * + * Set in the `updatePixelXY` method. + * + * @name Phaser.Tilemaps.Tile#right + * @type {number} + * @since 3.50.0 + */ + this.right; + + /** + * The bottom of the tile in pixels. + * + * Set in the `updatePixelXY` method. + * + * @name Phaser.Tilemaps.Tile#bottom + * @type {number} + * @since 3.50.0 + */ + this.bottom; + + /** + * The maps base width of a tile in pixels. Tiled maps support multiple tileset sizes * within one map, but they are still placed at intervals of the base tile size. * * @name Phaser.Tilemaps.Tile#baseWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.baseWidth = (baseWidth !== undefined) ? baseWidth : width; /** - * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes + * The maps base height of a tile in pixels. Tiled maps support multiple tileset sizes * within one map, but they are still placed at intervals of the base tile size. * * @name Phaser.Tilemaps.Tile#baseHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.baseHeight = (baseHeight !== undefined) ? baseHeight : height; @@ -202,7 +225,7 @@ var Tile = new Class({ this.collideDown = false; /** - * Whether the tile's left edge is interesting for collisions. + * Whether the tiles left edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceLeft * @type {boolean} @@ -211,7 +234,7 @@ var Tile = new Class({ this.faceLeft = false; /** - * Whether the tile's right edge is interesting for collisions. + * Whether the tiles right edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceRight * @type {boolean} @@ -220,7 +243,7 @@ var Tile = new Class({ this.faceRight = false; /** - * Whether the tile's top edge is interesting for collisions. + * Whether the tiles top edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceTop * @type {boolean} @@ -229,7 +252,7 @@ var Tile = new Class({ this.faceTop = false; /** - * Whether the tile's bottom edge is interesting for collisions. + * Whether the tiles bottom edge is interesting for collisions. * * @name Phaser.Tilemaps.Tile#faceBottom * @type {boolean} @@ -244,7 +267,7 @@ var Tile = new Class({ * @type {function} * @since 3.0.0 */ - this.collisionCallback = null; + this.collisionCallback = undefined; /** * The context in which the collision callback will be called. @@ -302,7 +325,7 @@ var Tile = new Class({ * * @param {Phaser.Tilemaps.Tile} tile - The tile to copy from. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ copy: function (tile) { @@ -331,7 +354,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#getCollisionGroup * @since 3.0.0 * - * @return {?object} tileset + * @return {?object} The collision group for this Tile, as defined in the Tileset, or `null` if no group was defined. */ getCollisionGroup: function () { @@ -347,7 +370,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#getTileData * @since 3.0.0 * - * @return {?object} tileset + * @return {?object} The tile data for this Tile, as defined in the Tileset, or `null` if no data was defined. */ getTileData: function () { @@ -363,7 +386,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The left (x) value of this tile. */ getLeft: function (camera) { @@ -381,7 +404,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The right (x) value of this tile. */ getRight: function (camera) { @@ -399,7 +422,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The top (y) value of this tile. */ getTop: function (camera) { @@ -422,11 +445,12 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The bottom (y) value of this tile. */ getBottom: function (camera) { var tilemapLayer = this.tilemapLayer; + return tilemapLayer ? this.getTop(camera) + this.height * tilemapLayer.scaleY : this.getTop(camera) + this.height; @@ -443,7 +467,7 @@ var Tile = new Class({ * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * @param {Phaser.Geom.Rectangle} [output] - Optional Rectangle object to store the results in. * - * @return {(Phaser.Geom.Rectangle|object)} + * @return {(Phaser.Geom.Rectangle|object)} The bounds of this Tile. */ getBounds: function (camera, output) { @@ -466,7 +490,7 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The center x position of this Tile. */ getCenterX: function (camera) { @@ -482,26 +506,13 @@ var Tile = new Class({ * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use to perform the check. * - * @return {number} + * @return {number} The center y position of this Tile. */ getCenterY: function (camera) { return (this.getTop(camera) + this.getBottom(camera)) / 2; }, - /** - * Clean up memory. - * - * @method Phaser.Tilemaps.Tile#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.collisionCallback = undefined; - this.collisionCallbackContext = undefined; - this.properties = undefined; - }, - /** * Check for intersection with this tile. This does not factor in camera scroll, layer scale or * layer position. @@ -514,7 +525,7 @@ var Tile = new Class({ * @param {number} right - The right point. * @param {number} bottom - The bottom point. * - * @return {boolean} + * @return {boolean} `true` if the Tile intersects with the given dimensions, otherwise `false`. */ intersects: function (x, y, right, bottom) { @@ -537,9 +548,19 @@ var Tile = new Class({ */ isInteresting: function (collides, faces) { - if (collides && faces) { return (this.canCollide || this.hasInterestingFace); } - else if (collides) { return this.collides; } - else if (faces) { return this.hasInterestingFace; } + if (collides && faces) + { + return (this.canCollide || this.hasInterestingFace); + } + else if (collides) + { + return this.collides; + } + else if (faces) + { + return this.hasInterestingFace; + } + return false; }, @@ -551,7 +572,7 @@ var Tile = new Class({ * * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ resetCollision: function (recalculateFaces) { @@ -586,7 +607,7 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#resetFaces * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ resetFaces: function () { @@ -608,10 +629,9 @@ var Tile = new Class({ * @param {boolean} [right] - Indicating collide with any object on the right. * @param {boolean} [up] - Indicating collide with any object on the top. * @param {boolean} [down] - Indicating collide with any object on the bottom. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces - * for this tile and its neighbors. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate interesting faces for this tile and its neighbors. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setCollision: function (left, right, up, down, recalculateFaces) { @@ -653,7 +673,7 @@ var Tile = new Class({ * @param {function} callback - Callback function. * @param {object} context - Callback will be called within this context. * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setCollisionCallback: function (callback, context) { @@ -677,12 +697,12 @@ var Tile = new Class({ * @method Phaser.Tilemaps.Tile#setSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tile in pixels. - * @param {integer} tileHeight - The height of the tile in pixels. - * @param {integer} baseWidth - The base width a tile in the map (in pixels). - * @param {integer} baseHeight - The base height of the tile in pixels (in pixels). + * @param {number} tileWidth - The width of the tile in pixels. + * @param {number} tileHeight - The height of the tile in pixels. + * @param {number} baseWidth - The base width a tile in the map (in pixels). + * @param {number} baseHeight - The base height of the tile in pixels (in pixels). * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ setSize: function (tileWidth, tileHeight, baseWidth, baseHeight) { @@ -697,26 +717,67 @@ var Tile = new Class({ }, /** - * Used internally. Updates the tile's world XY position based on the current tile size. + * Used internally. Updates the tiles world XY position based on the current tile size. * * @method Phaser.Tilemaps.Tile#updatePixelXY * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tile} This Tile object. + * @return {this} This Tile object instance. */ updatePixelXY: function () { - // Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the - // bottom left, while the Phaser renderer assumes the origin is the top left. The y - // coordinate needs to be adjusted by the difference. - this.pixelX = this.x * this.baseWidth; - this.pixelY = this.y * this.baseHeight; + var orientation = this.layer.orientation; - // this.pixelY = this.y * this.baseHeight - (this.height - this.baseHeight); + if (orientation === CONST.ORTHOGONAL) + { + // In orthogonal mode, Tiled places tiles on a grid of baseWidth x baseHeight. The origin for a tile is the + // bottom left, while the Phaser renderer assumes the origin is the top left. The y + // coordinate needs to be adjusted by the difference. + + this.pixelX = this.x * this.baseWidth; + this.pixelY = this.y * this.baseHeight; + } + else if (orientation === CONST.ISOMETRIC) + { + // Reminder: For the tilemap to be centered we have to move the image to the right with the camera! + // This is crucial for wordtotile, tiletoworld to work. + + this.pixelX = (this.x - this.y) * this.baseWidth * 0.5; + this.pixelY = (this.x + this.y) * this.baseHeight * 0.5; + } + else if (orientation === CONST.STAGGERED) + { + this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2); + this.pixelY = this.y * (this.baseHeight / 2); + } + else if (orientation === CONST.HEXAGONAL) + { + var len = this.layer.hexSideLength; + var rowHeight = ((this.baseHeight - len) / 2 + len); + + this.pixelX = this.x * this.baseWidth + this.y % 2 * (this.baseWidth / 2); + this.pixelY = this.y * rowHeight; + } + + this.right = this.pixelX + this.baseWidth; + this.bottom = this.pixelY + this.baseHeight; return this; }, + /** + * Clean up memory. + * + * @method Phaser.Tilemaps.Tile#destroy + * @since 3.0.0 + */ + destroy: function () + { + this.collisionCallback = undefined; + this.collisionCallbackContext = undefined; + this.properties = undefined; + }, + /** * True if this tile can collide on any of its faces or has a collision callback set. * @@ -726,10 +787,12 @@ var Tile = new Class({ * @since 3.0.0 */ canCollide: { + get: function () { - return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); + return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || (this.collisionCallback !== undefined)); } + }, /** @@ -741,10 +804,12 @@ var Tile = new Class({ * @since 3.0.0 */ collides: { + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); } + }, /** @@ -756,16 +821,18 @@ var Tile = new Class({ * @since 3.0.0 */ hasInterestingFace: { + get: function () { return (this.faceTop || this.faceBottom || this.faceLeft || this.faceRight); } + }, /** * The tileset that contains this Tile. This is null if accessed from a LayerData instance - * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has - * an index that doesn't correspond to any of the map's tilesets. + * before the tile is placed in a TilemapLayer, or if the tile has an index that doesn't correspond + * to any of the maps tilesets. * * @name Phaser.Tilemaps.Tile#tileset * @type {?Phaser.Tilemaps.Tileset} @@ -795,24 +862,25 @@ var Tile = new Class({ /** * The tilemap layer that contains this Tile. This will only return null if accessed from a - * LayerData instance before the tile is placed within a StaticTilemapLayer or - * DynamicTilemapLayer. + * LayerData instance before the tile is placed within a TilemapLayer. * * @name Phaser.Tilemaps.Tile#tilemapLayer - * @type {?Phaser.Tilemaps.StaticTilemapLayer|Phaser.Tilemaps.DynamicTilemapLayer} + * @type {?Phaser.Tilemaps.TilemapLayer} * @readonly * @since 3.0.0 */ tilemapLayer: { + get: function () { return this.layer.tilemapLayer; } + }, /** * The tilemap that contains this Tile. This will only return null if accessed from a LayerData - * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer. + * instance before the tile is placed within a TilemapLayer. * * @name Phaser.Tilemaps.Tile#tilemap * @type {?Phaser.Tilemaps.Tilemap} @@ -820,11 +888,14 @@ var Tile = new Class({ * @since 3.0.0 */ tilemap: { + get: function () { var tilemapLayer = this.tilemapLayer; + return tilemapLayer ? tilemapLayer.tilemap : null; } + } }); diff --git a/src/tilemaps/Tilemap.js b/src/tilemaps/Tilemap.js index 34eee297e..89510f316 100644 --- a/src/tilemaps/Tilemap.js +++ b/src/tilemaps/Tilemap.js @@ -6,15 +6,15 @@ var Class = require('../utils/Class'); var DegToRad = require('../math/DegToRad'); -var DynamicTilemapLayer = require('./dynamiclayer/DynamicTilemapLayer'); -var Extend = require('../utils/object/Extend'); var Formats = require('./Formats'); +var GetFastValue = require('../utils/object/GetFastValue'); var LayerData = require('./mapdata/LayerData'); var Rotate = require('../math/Rotate'); var SpliceOne = require('../utils/array/SpliceOne'); -var StaticTilemapLayer = require('./staticlayer/StaticTilemapLayer'); +var Sprite = require('../gameobjects/sprite/Sprite'); var Tile = require('./Tile'); var TilemapComponents = require('./components'); +var TilemapLayer = require('./TilemapLayer'); var Tileset = require('./Tileset'); /** @@ -41,25 +41,39 @@ var Tileset = require('./Tileset'); * @classdesc * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or - * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display - * objects that actually render tiles. + * more tilemap layers, which are the display objects that actually render the tiles. * - * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free + * The Tilemap data can be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free * software package specifically for creating tile maps, and is available from: * http://www.mapeditor.org * - * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only - * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer. + * As of Phaser 3.50.0 the Tilemap API now supports the following types of map: + * + * 1) Orthogonal + * 2) Isometric + * 3) Hexagonal + * 4) Staggered + * + * Prior to this release, only orthogonal maps were supported. + * + * Another large change in 3.50 was the consolidation of Tilemap Layers. Previously, you created + * either a Static or Dynamic Tilemap Layer. However, as of 3.50 the features of both have been + * merged and the API simplified, so now there is just the single `TilemapLayer` class. + * + * A Tilemap has handy methods for getting and manipulating the tiles within a layer, allowing + * you to build or modify the tilemap data at runtime. * * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a - * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides - * it. + * TilemapLayer may have its own unique tile size that overrides this. * * As of Phaser 3.21.0, if your tilemap includes layer groups (a feature of Tiled 1.2.0+) these - * will be traversed and the following properties will affect children: - * - opacity (blended with parent) and visibility (parent overrides child) + * will be traversed and the following properties will impact children: + * + * - Opacity (blended with parent) and visibility (parent overrides child) * - Vertical and horizontal offset + * * The grouping hierarchy is not preserved and all layers will be flattened into a single array. + * * Group layers are parsed during Tilemap construction but are discarded after parsing so dynamic * layers will NOT continue to be affected by a parent. * @@ -94,7 +108,7 @@ var Tilemap = new Class({ * width. * * @name Phaser.Tilemaps.Tilemap#tileWidth - * @type {integer} + * @type {number} * @since 3.0.0 */ this.tileWidth = mapData.tileWidth; @@ -104,7 +118,7 @@ var Tilemap = new Class({ * tile height. * * @name Phaser.Tilemaps.Tilemap#tileHeight - * @type {integer} + * @type {number} * @since 3.0.0 */ this.tileHeight = mapData.tileHeight; @@ -200,6 +214,7 @@ var Tilemap = new Class({ this.heightInPixels = mapData.heightInPixels; /** + * A collection of Images, as parsed from Tiled map data. * * @name Phaser.Tilemaps.Tilemap#imageCollections * @type {Phaser.Tilemaps.ImageCollection[]} @@ -247,10 +262,70 @@ var Tilemap = new Class({ * The index of the currently selected LayerData object. * * @name Phaser.Tilemaps.Tilemap#currentLayerIndex - * @type {integer} + * @type {number} * @since 3.0.0 */ this.currentLayerIndex = 0; + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.Tilemap#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = mapData.hexSideLength; + + var orientation = this.orientation; + + /** + * Functions used to handle world to tile, and tile to world, conversion. + * Cached here for internal use by public methods such as `worldToTileXY`, etc. + * + * @name Phaser.Tilemaps.Tilemap#_convert + * @private + * @type {object} + * @since 3.50.0 + */ + this._convert = { + WorldToTileXY: TilemapComponents.GetWorldToTileXYFunction(orientation), + WorldToTileX: TilemapComponents.GetWorldToTileXFunction(orientation), + WorldToTileY: TilemapComponents.GetWorldToTileYFunction(orientation), + TileToWorldXY: TilemapComponents.GetTileToWorldXYFunction(orientation), + TileToWorldX: TilemapComponents.GetTileToWorldXFunction(orientation), + TileToWorldY: TilemapComponents.GetTileToWorldYFunction(orientation) + }; + }, + + /** + * @ignore + */ + createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) + { + console.warn('createBlankDynamicLayer is deprecated. Use createBlankLayer'); + + return this.createBlankLayer(name, tileset, x, y, width, height, tileWidth, tileHeight); + }, + + /** + * @ignore + */ + createDynamicLayer: function (layerID, tileset, x, y) + { + console.warn('createDynamicLayer is deprecated. Use createLayer'); + + return this.createLayer(layerID, tileset, x, y); + }, + + /** + * @ignore + */ + createStaticLayer: function (layerID, tileset, x, y) + { + console.warn('createStaticLayer is deprecated. Use createLayer'); + + return this.createLayer(layerID, tileset, x, y); }, /** @@ -271,14 +346,14 @@ var Tilemap = new Class({ * * You can provide either an integer (0 to 3), or the string version of the order. * - * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically + * Calling this method _after_ creating Tilemap Layers will **not** automatically * update them to use the new render order. If you call this method after creating layers, use their * own `setRenderOrder` methods to change them as needed. * * @method Phaser.Tilemaps.Tilemap#setRenderOrder * @since 3.12.0 * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @param {(number|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. * * @return {this} This Tilemap object. */ @@ -310,17 +385,17 @@ var Tilemap = new Class({ * @param {string} tilesetName - The name of the tileset as specified in the map data. * @param {string} [key] - The key of the Phaser.Cache image used for this tileset. If * `undefined` or `null` it will look for an image with a key matching the tilesetName parameter. - * @param {integer} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not + * @param {number} [tileWidth] - The width of the tile (in pixels) in the Tileset Image. If not * given it will default to the map's tileWidth value, or the tileWidth specified in the Tiled * JSON file. - * @param {integer} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If + * @param {number} [tileHeight] - The height of the tiles (in pixels) in the Tileset Image. If * not given it will default to the map's tileHeight value, or the tileHeight specified in the * Tiled JSON file. - * @param {integer} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not + * @param {number} [tileMargin] - The margin around the tiles in the sheet (in pixels). If not * specified, it will default to 0 or the value specified in the Tiled JSON file. - * @param {integer} [tileSpacing] - The spacing between each the tile in the sheet (in pixels). + * @param {number} [tileSpacing] - The spacing between each the tile in the sheet (in pixels). * If not specified, it will default to 0 or the value specified in the Tiled JSON file. - * @param {integer} [gid=0] - If adding multiple tilesets to a blank map, specify the starting + * @param {number} [gid=0] - If adding multiple tilesets to a blank map, specify the starting * GID this set will use here. * * @return {?Phaser.Tilemaps.Tileset} Returns the Tileset object that was created or updated, or null if it @@ -373,51 +448,6 @@ var Tilemap = new Class({ return tileset; }, - /** - * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If - * no layer specified, the map's current layer is used. This is useful if you want to manipulate - * a map at the start of a scene, but then make it non-manipulable and optimize it for speed. - * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value - * returned from this method if you want to manipulate the new StaticTilemapLayer. - * - * @method Phaser.Tilemaps.Tilemap#convertLayerToStatic - * @since 3.0.0 - * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer)} [layer] - The name of the layer from Tiled, the - * index of the layer in the map, or a DynamicTilemapLayer. - * - * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer that was created, or null if it - * failed. - */ - convertLayerToStatic: function (layer) - { - layer = this.getLayer(layer); - - if (layer === null) { return null; } - - var dynamicLayer = layer.tilemapLayer; - - if (!dynamicLayer || !(dynamicLayer instanceof DynamicTilemapLayer)) - { - return null; - } - - var staticLayer = new StaticTilemapLayer( - dynamicLayer.scene, - dynamicLayer.tilemap, - dynamicLayer.layerIndex, - dynamicLayer.tileset, - dynamicLayer.x, - dynamicLayer.y - ); - - this.scene.sys.displayList.add(staticLayer); - - dynamicLayer.destroy(); - - return staticLayer; - }, - /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile * coordinates) within the layer. This copies all tile properties & recalculates collision @@ -428,14 +458,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#copy * @since 3.0.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -443,8 +473,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'copy')) { return this; } - if (layer !== null) { TilemapComponents.Copy( @@ -463,23 +491,25 @@ var Tilemap = new Class({ }, /** - * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. + * Creates a new and empty Tilemap Layer. The currently selected layer in the map is set to this new layer. * - * @method Phaser.Tilemaps.Tilemap#createBlankDynamicLayer + * Prior to v3.50.0 this method was called `createBlankDynamicLayer`. + * + * @method Phaser.Tilemaps.Tilemap#createBlankLayer * @since 3.0.0 * * @param {string} name - The name of this layer. Must be unique within the map. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - * @param {integer} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. - * @param {integer} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. - * @param {integer} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. - * @param {integer} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. + * @param {number} [width] - The width of the layer in tiles. If not specified, it will default to the map's width. + * @param {number} [height] - The height of the layer in tiles. If not specified, it will default to the map's height. + * @param {number} [tileWidth] - The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. + * @param {number} [tileHeight] - The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. * - * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer that was created, or `null` if it failed. + * @return {?Phaser.Tilemaps.TilemapLayer} Returns the new layer that was created, or `null` if it failed. */ - createBlankDynamicLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) + createBlankLayer: function (name, tileset, x, y, width, height, tileWidth, tileHeight) { if (x === undefined) { x = 0; } if (y === undefined) { y = 0; } @@ -501,7 +531,8 @@ var Tilemap = new Class({ tileWidth: tileWidth, tileHeight: tileHeight, width: width, - height: height + height: height, + orientation: this.orientation }); var row; @@ -522,37 +553,36 @@ var Tilemap = new Class({ this.currentLayerIndex = this.layers.length - 1; - var dynamicLayer = new DynamicTilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); + var layer = new TilemapLayer(this.scene, this, this.currentLayerIndex, tileset, x, y); - dynamicLayer.setRenderOrder(this.renderOrder); + layer.setRenderOrder(this.renderOrder); - this.scene.sys.displayList.add(dynamicLayer); + this.scene.sys.displayList.add(layer); - return dynamicLayer; + return layer; }, /** - * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given + * Creates a new Tilemap Layer that renders the LayerData associated with the given * `layerID`. The currently selected layer in the map is set to this new layer. * * The `layerID` is important. If you've created your map in Tiled then you can get this by * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and * look at the layers[].name value. Either way it must match. * - * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more - * information. + * Prior to v3.50.0 this method was called `createDynamicLayer`. * - * @method Phaser.Tilemaps.Tilemap#createDynamicLayer + * @method Phaser.Tilemaps.Tilemap#createLayer * @since 3.0.0 * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. + * @param {(number|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. * - * @return {?Phaser.Tilemaps.DynamicTilemapLayer} Returns the new layer was created, or null if it failed. + * @return {?Phaser.Tilemaps.TilemapLayer} Returns the new layer was created, or null if it failed. */ - createDynamicLayer: function (layerID, tileset, x, y) + createLayer: function (layerID, tileset, x, y) { var index = this.getLayerIndex(layerID); @@ -591,7 +621,7 @@ var Tilemap = new Class({ y = layerData.y; } - var layer = new DynamicTilemapLayer(this.scene, this, index, tileset, x, y); + var layer = new TilemapLayer(this.scene, this, index, tileset, x, y); layer.setRenderOrder(this.renderOrder); @@ -601,87 +631,188 @@ var Tilemap = new Class({ }, /** - * Creates a Sprite for every object matching the given gid in the map data. All properties from - * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy - * way to configure Sprite properties from within the map editor. For example giving an object a - * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created. + * This method will iterate through all of the objects defined in a Tiled Object Layer and then + * convert the matching results into Phaser Game Objects (by default, Sprites) * - * Custom object properties not sharing names with the Sprite's own properties are copied to the - * Sprite's {@link Phaser.GameObjects.Sprite#data data store}. + * Objects are matched on one of 3 criteria: The Object ID, the Object GID or the Object Name. + * + * Within Tiled, Object IDs are unique per Object. Object GIDs, however, are shared by all objects + * using the same image. Finally, Object Names are strings and the same name can be used on multiple + * Objects in Tiled, they do not have to be unique. + * + * You set the configuration parameter accordingly, based on which type of criteria you wish + * to match against. For example, to convert all items on an Object Layer with a `gid` of 26: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26 + * }); + * ``` + * + * Or, to convert objects with the name 'bonus': + * + * ```javascript + * createFromObjects(layerName, { + * name: 'bonus' + * }); + * ``` + * + * Or, to convert an object with a specific id: + * + * ```javascript + * createFromObjects(layerName, { + * id: 9 + * }); + * ``` + * + * You should only specify either `id`, `gid`, `name`, or none of them. Do not add more than + * one criteria to your config. If you do not specify any criteria, then _all_ objects in the + * Object Layer will be converted. + * + * By default this method will convert objects into `Sprite` instances, but you can override + * this by providing your own class type: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26, + * classType: Coin + * }); + * ``` + * + * This will convert all Objects with a gid of 26 into your custom `Coin` class. You can pass + * any class type here, but it _must_ extend `Phaser.GameObjects.GameObject` as its base class. + * Your class will always be passed 1 parameter: `scene`, which is a reference to either the Scene + * specified in the config object or, if not given, the Scene to which this Tilemap belongs. + * + * All properties from object are copied into the Game Object, so you can use this as an easy + * way to configure properties from within the map editor. For example giving an object a + * property of `alpha: 0.5` in Tiled will be reflected in the Game Object that is created. + * + * Custom object properties that do not exist as a Game Object property are set in the + * Game Objects {@link Phaser.GameObjects.GameObject#data data store}. + * + * You can use set a `container` property in the config. If given, the class will be added to + * the Container instance instead of the Scene. + * + * Finally, you can provide an array of config objects, to convert multiple types of object in + * a single call: + * + * ```javascript + * createFromObjects(layerName, [ + * { + * gid: 26, + * classType: Coin + * }, + * { + * id: 9, + * classType: BossMonster + * }, + * { + * name: 'lava', + * classType: LavaTile + * } + * ]); + * ``` + * + * The signature of this method changed significantly in v3.50.0. Prior to this, it did not take config objects. * * @method Phaser.Tilemaps.Tilemap#createFromObjects * @since 3.0.0 * - * @param {string} name - The name of the object layer (from Tiled) to create Sprites from. - * @param {(integer|string)} id - Either the id (object), gid (tile object) or name (object or - * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects - * with the same graphic. The same name can be used on multiple objects. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param {Phaser.Scene} [scene=the scene the map is within] - The Scene to create the Sprites within. + * @param {string} objectLayerName - The name of the Tiled object layer to create the Game Objects from. + * @param {Phaser.Types.Tilemaps.CreateFromObjectLayerConfig|Phaser.Types.Tilemaps.CreateFromObjectLayerConfig[]} config - A CreateFromObjects configuration object, or an array of them. * - * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. + * @return {Phaser.GameObjects.GameObject[]} An array containing the Game Objects that were created. Empty if invalid object layer, or no matching id/gid/name was found. */ - createFromObjects: function (name, id, spriteConfig, scene) + createFromObjects: function (objectLayerName, config) { - if (spriteConfig === undefined) { spriteConfig = {}; } - if (scene === undefined) { scene = this.scene; } + var results = []; - var objectLayer = this.getObjectLayer(name); + var objectLayer = this.getObjectLayer(objectLayerName); if (!objectLayer) { - console.warn('Cannot create from object. Invalid objectgroup name given: ' + name); + console.warn('createFromObjects: Invalid objectLayerName given: ' + objectLayerName); - if (typeof layerID === 'string') - { - console.warn('Valid objectgroup names:\n\t' + this.getObjectLayerNames().join(',\n\t')); - } + return results; + } - return null; + if (!Array.isArray(config)) + { + config = [ config ]; } var objects = objectLayer.objects; - var sprites = []; - for (var i = 0; i < objects.length; i++) + for (var c = 0; c < config.length; c++) { - var found = false; - var obj = objects[i]; + var singleConfig = config[c]; - if (obj.gid !== undefined && typeof id === 'number' && obj.gid === id || - obj.id !== undefined && typeof id === 'number' && obj.id === id || - obj.name !== undefined && typeof id === 'string' && obj.name === id) + var id = GetFastValue(singleConfig, 'id', null); + var gid = GetFastValue(singleConfig, 'gid', null); + var name = GetFastValue(singleConfig, 'name', null); + + var obj; + var toConvert = []; + + // Sweep to get all the objects we want to convert in this pass + for (var s = 0; s < objects.length; s++) { - found = true; + obj = objects[s]; + + if ( + (id === null && gid === null && name === null) || + (id !== null && obj.id === id) || + (gid !== null && obj.gid === gid) || + (name !== null && obj.name === name) + ) + { + toConvert.push(obj); + } } - if (found) + // Now let's convert them ... + + var classType = GetFastValue(singleConfig, 'classType', Sprite); + var scene = GetFastValue(singleConfig, 'scene', this.scene); + var container = GetFastValue(singleConfig, 'container', null); + var texture = GetFastValue(singleConfig, 'key', null); + var frame = GetFastValue(singleConfig, 'frame', null); + + for (var i = 0; i < toConvert.length; i++) { - var config = Extend({}, spriteConfig, obj.properties); + obj = toConvert[i]; - config.x = obj.x; - config.y = obj.y; + var sprite = new classType(scene); - var sprite = scene.make.sprite(config); + sprite.setName(obj.name); + sprite.setPosition(obj.x, obj.y); + sprite.setTexture(texture, frame); - sprite.name = obj.name; + if (obj.width) + { + sprite.displayWidth = obj.width; + } - if (obj.width) { sprite.displayWidth = obj.width; } - if (obj.height) { sprite.displayHeight = obj.height; } + if (obj.height) + { + sprite.displayHeight = obj.height; + } - // Origin is (0, 1) in Tiled, so find the offset that matches the Sprite's origin. - // Do not offset objects with zero dimensions (e.g. points). + // Origin is (0, 1) in Tiled, so find the offset that matches the Sprites origin. + // Do not offset objects with zero dimensions (e.g. points). var offset = { x: sprite.originX * obj.width, y: (sprite.originY - 1) * obj.height }; - // If the object is rotated, then the origin offset also needs to be rotated. + // If the object is rotated, then the origin offset also needs to be rotated. if (obj.rotation) { var angle = DegToRad(obj.rotation); + Rotate(offset, angle); + sprite.rotation = angle; } @@ -693,23 +824,38 @@ var Tilemap = new Class({ sprite.setFlip(obj.flippedHorizontal, obj.flippedVertical); } - if (!obj.visible) { sprite.visible = false; } - - for (var key in obj.properties) + if (!obj.visible) { - if (sprite.hasOwnProperty(key)) - { - continue; - } - - sprite.setData(key, obj.properties[key]); + sprite.visible = false; } - sprites.push(sprite); + // Set properties the class may have, or setData those it doesn't + for (var key in obj.properties) + { + if (sprite[key] !== undefined) + { + sprite[key] = obj.properties[key]; + } + else + { + sprite.setData(key, obj.properties[key]); + } + } + + if (container) + { + container.add(sprite); + } + else + { + scene.add.existing(sprite); + } + + results.push(sprite); } } - return sprites; + return results; }, /** @@ -721,14 +867,14 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#createFromTiles * @since 3.0.0 * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * @param {(number|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(number|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Scene} [scene] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.GameObjects.Sprite[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -741,80 +887,6 @@ var Tilemap = new Class({ return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, layer); }, - /** - * Creates a new StaticTilemapLayer that renders the LayerData associated with the given - * `layerID`. The currently selected layer in the map is set to this new layer. - * - * The `layerID` is important. If you've created your map in Tiled then you can get this by - * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and - * look at the layers[].name value. Either way it must match. - * - * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for - * more information. - * - * @method Phaser.Tilemaps.Tilemap#createStaticLayer - * @since 3.0.0 - * - * @param {(integer|string)} layerID - The layer array index value, or if a string is given, the layer name from Tiled. - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param {number} [x=0] - The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. - * @param {number} [y=0] - The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. - * - * @return {?Phaser.Tilemaps.StaticTilemapLayer} Returns the new layer was created, or null if it failed. - */ - createStaticLayer: function (layerID, tileset, x, y) - { - var index = this.getLayerIndex(layerID); - - if (index === null) - { - console.warn('Invalid Tilemap Layer ID: ' + layerID); - if (typeof layerID === 'string') - { - console.warn('Valid tilelayer names:\n\t' + this.getTileLayerNames().join(',\n\t')); - } - return null; - } - - var layerData = this.layers[index]; - - // Check for an associated static or dynamic tilemap layer - if (layerData.tilemapLayer) - { - console.warn('Tilemap Layer ID already exists:' + layerID); - return null; - } - - this.currentLayerIndex = index; - - // Default the x/y position to match Tiled layer offset, if it exists. - if (x === undefined && this.layers[index].x) { x = this.layers[index].x; } - if (y === undefined && this.layers[index].y) { y = this.layers[index].y; } - - var layer = new StaticTilemapLayer(this.scene, this, index, tileset, x, y); - - layer.setRenderOrder(this.renderOrder); - - this.scene.sys.displayList.add(layer); - - return layer; - }, - - /** - * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any - * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData. - * - * @method Phaser.Tilemaps.Tilemap#destroy - * @since 3.0.0 - */ - destroy: function () - { - this.removeAllLayers(); - this.tilesets.length = 0; - this.objects.length = 0; - this.scene = undefined; - }, - /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the * specified index. Tiles will be set to collide if the given index is a colliding index. @@ -826,24 +898,24 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#fill * @since 3.0.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ fill: function (index, tileX, tileY, width, height, recalculateFaces, layer) { + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } - if (this._isStaticCall(layer, 'fill')) { return this; } - TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, layer); return this; @@ -894,12 +966,12 @@ var Tilemap = new Class({ * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -923,10 +995,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#findByIndex * @since 3.0.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. + * @param {number} index - The tile index value to search for. + * @param {number} [skip=0] - The number of times to skip a matching tile before returning. * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -982,12 +1054,12 @@ var Tilemap = new Class({ * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tile} Returns a Tiles, or null if the layer given was invalid. */ @@ -1011,12 +1083,12 @@ var Tilemap = new Class({ * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The Tile layer to run the search on. If not provided will use the current layer. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -1039,7 +1111,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the image to get. * - * @return {integer} The index of the image in this tilemap, or null if not found. + * @return {number} The index of the image in this tilemap, or null if not found. */ getImageIndex: function (name) { @@ -1093,15 +1165,12 @@ var Tilemap = new Class({ }, /** - * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid - * `layer` is given. + * Gets the LayerData from `this.layers` that is associated with the given `layer`, or null if the layer is invalid. * * @method Phaser.Tilemaps.Tilemap#getLayer * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the maps current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or Tilemap Layer. If not given will default to the maps current layer index. * * @return {Phaser.Tilemaps.LayerData} The corresponding LayerData within this.layers. */ @@ -1113,15 +1182,14 @@ var Tilemap = new Class({ }, /** - * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer - * is found with that name. + * Gets the ObjectLayer from `this.objects` that has the given `name`, or null if no ObjectLayer is found with that name. * * @method Phaser.Tilemaps.Tilemap#getObjectLayer * @since 3.0.0 * * @param {string} [name] - The name of the object layer from Tiled. * - * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding ObjectLayer within this.objects or null. + * @return {?Phaser.Tilemaps.ObjectLayer} The corresponding `ObjectLayer` within `this.objects`, or null. */ getObjectLayer: function (name) { @@ -1158,11 +1226,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#getLayerIndex * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a Tilemap Layer. If not given will default to the map's current layer index. * - * @return {integer} The LayerData index within this.layers. + * @return {number} The LayerData index within this.layers. */ getLayerIndex: function (layer) { @@ -1178,7 +1244,7 @@ var Tilemap = new Class({ { return layer; } - else if (layer instanceof StaticTilemapLayer || layer instanceof DynamicTilemapLayer) + else if (layer instanceof TilemapLayer) { return layer.layerIndex; } @@ -1197,7 +1263,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the layer to get. * - * @return {integer} The LayerData index within this.layers. + * @return {number} The LayerData index within this.layers. */ getLayerIndexByName: function (name) { @@ -1206,15 +1272,16 @@ var Tilemap = new Class({ /** * Gets a tile at the given tile coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -1229,16 +1296,17 @@ var Tilemap = new Class({ /** * Gets a tile at the given world coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [nonNull] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ @@ -1274,17 +1342,18 @@ var Tilemap = new Class({ /** * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -1300,15 +1369,16 @@ var Tilemap = new Class({ /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, * Line, Rectangle or Triangle. The shape should be in world coordinates. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithinShape * @since 3.0.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -1323,7 +1393,8 @@ var Tilemap = new Class({ /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#getTilesWithinWorldXY * @since 3.0.0 @@ -1333,8 +1404,8 @@ var Tilemap = new Class({ * @param {number} width - The width of the area. * @param {number} height - The height of the area. * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile[]} Returns an array of Tiles, or null if the layer given was invalid. */ @@ -1373,7 +1444,7 @@ var Tilemap = new Class({ * * @param {string} name - The name of the Tileset to get. * - * @return {integer} The Tileset index within this.tilesets. + * @return {number} The Tileset index within this.tilesets. */ getTilesetIndex: function (name) { @@ -1384,14 +1455,14 @@ var Tilemap = new Class({ * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#hasTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -1408,15 +1479,15 @@ var Tilemap = new Class({ * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#hasTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ @@ -1455,26 +1526,24 @@ var Tilemap = new Class({ * location. If you pass in an index, only the index at the specified location will be changed. * Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. - * - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTileAt * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid or the coordinates were out of bounds. */ putTileAt: function (tile, tileX, tileY, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTileAt')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -1487,26 +1556,25 @@ var Tilemap = new Class({ * specified location. If you pass in an index, only the index at the specified location will be * changed. Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. This - * cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTileAtWorldXY * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTileAtWorldXY')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -1520,25 +1588,24 @@ var Tilemap = new Class({ * index at the specified location will be changed. Collision information will be recalculated * within the region tiles were changed. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#putTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'putTilesAt')) { return this; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -1554,18 +1621,17 @@ var Tilemap = new Class({ * indexes found within the region (excluding -1) will be used for randomly assigning new tile * indexes. This method only modifies tile indexes and does not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -1573,8 +1639,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'randomize')) { return this; } - if (layer === null) { return null; } TilemapComponents.Randomize(tileX, tileY, width, height, indexes, layer); @@ -1587,14 +1651,14 @@ var Tilemap = new Class({ * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#calculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -1614,16 +1678,16 @@ var Tilemap = new Class({ * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#calculateFacesWithin * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -1641,12 +1705,12 @@ var Tilemap = new Class({ /** * Removes the given TilemapLayer from this Tilemap without destroying it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeLayer * @since 3.17.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be removed. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to be removed. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -1657,6 +1721,7 @@ var Tilemap = new Class({ if (index !== null) { SpliceOne(this.layers, index); + for (var i = index; i < this.layers.length; i++) { if (this.layers[i].tilemapLayer) @@ -1681,12 +1746,12 @@ var Tilemap = new Class({ /** * Destroys the given TilemapLayer and removes it from this Tilemap. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#destroyLayer * @since 3.17.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to be destroyed. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to be destroyed. * * @return {?Phaser.Tilemaps.Tilemap} Returns this, or null if the layer given was invalid. */ @@ -1716,19 +1781,17 @@ var Tilemap = new Class({ }, /** - * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or - * DynamicTilemapLayers. + * Removes all Tilemap Layers from this Tilemap and calls `destroy` on each of them. * * @method Phaser.Tilemaps.Tilemap#removeAllLayers * @since 3.0.0 * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ removeAllLayers: function () { var layers = this.layers; - // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData for (var i = 0; i < layers.length; i++) { if (layers[i].tilemapLayer) @@ -1748,13 +1811,11 @@ var Tilemap = new Class({ * Removes the given Tile, or an array of Tiles, from the layer to which they belong, * and optionally recalculates the collision information. * - * This cannot be applied to Tiles that belong to Static Tilemap Layers. - * * @method Phaser.Tilemaps.Tilemap#removeTile * @since 3.17.0 * * @param {(Phaser.Tilemaps.Tile|Phaser.Tilemaps.Tile[])} tiles - The Tile to remove, or an array of Tiles. - * @param {integer} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. + * @param {number} [replaceIndex=-1] - After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * * @return {Phaser.Tilemaps.Tile[]} Returns an array of Tiles that were removed. @@ -1787,28 +1848,27 @@ var Tilemap = new Class({ }, /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given tile coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull] - If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces] - If `true` (the default), the faces data will be recalculated. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns the Tile that was removed, or null if the layer given was invalid. */ removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces, layer) { - layer = this.getLayer(layer); + if (replaceWithNull === undefined) { replaceWithNull = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'removeTileAt')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -1816,29 +1876,28 @@ var Tilemap = new Class({ }, /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given world coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#removeTileAtWorldXY * @since 3.0.0 * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [replaceWithNull] - If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces] - If `true` (the default), the faces data will be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tile} Returns a Tile, or null if the layer given was invalid. */ removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) { - layer = this.getLayer(layer); + if (replaceWithNull === undefined) { replaceWithNull = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } - if (this._isStaticCall(layer, 'removeTileAtWorldXY')) { return null; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -1846,19 +1905,19 @@ var Tilemap = new Class({ }, /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * Draws a debug representation of the layer to the given Graphics object. This is helpful when you want to * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation * wherever you want on the screen. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#renderDebug * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -1884,15 +1943,14 @@ var Tilemap = new Class({ * @since 3.17.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. * - * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. + * @return {this} This Tilemap instance. */ renderDebugFull: function (graphics, styleConfig) { var layers = this.layers; - // Destroy any StaticTilemapLayers or DynamicTilemapLayers that are stored in LayerData for (var i = 0; i < layers.length; i++) { TilemapComponents.RenderDebug(graphics, styleConfig, layers[i]); @@ -1906,19 +1964,18 @@ var Tilemap = new Class({ * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does * not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#replaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -1926,8 +1983,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'replaceByIndex')) { return this; } - if (layer === null) { return null; } TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, layer); @@ -1940,21 +1995,25 @@ var Tilemap = new Class({ * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if * collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollision * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollision: function (indexes, collides, recalculateFaces, layer, updateLayer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (updateLayer === undefined) { updateLayer = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -1970,21 +2029,24 @@ var Tilemap = new Class({ * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be * enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionBetween * @since 3.0.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionBetween: function (start, stop, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -2003,20 +2065,23 @@ var Tilemap = new Class({ * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a * "types" property that matches any of those values, its collision flag will be updated. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionByProperty * @since 3.0.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionByProperty: function (properties, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -2031,20 +2096,23 @@ var Tilemap = new Class({ * the given array. The `collides` parameter controls if collision will be enabled (true) or * disabled (false). Tile indexes not currently in the layer are not affected. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionByExclusion * @since 3.0.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionByExclusion: function (indexes, collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -2055,24 +2123,27 @@ var Tilemap = new Class({ }, /** - * Sets collision on the tiles within a layer by checking each tile's collision group data + * Sets collision on the tiles within a layer by checking each tiles collision group data * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * a tiles collision group, the tiles colliding information will be set. The `collides` parameter * controls if collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [collides] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces] - Whether or not to recalculate the tile faces after the update. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ setCollisionFromCollisionGroup: function (collides, recalculateFaces, layer) { + if (collides === undefined) { collides = true; } + if (recalculateFaces === undefined) { recalculateFaces = true; } + layer = this.getLayer(layer); if (layer === null) { return null; } @@ -2086,17 +2157,17 @@ var Tilemap = new Class({ * Sets a global collision callback for the given tile index within the layer. This will affect all * tiles on this layer that have the same index. If a callback is already set for the tile index it * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. + * at a specific location on the map then see `setTileLocationCallback`. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|number[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. All values should be integers. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -2116,18 +2187,18 @@ var Tilemap = new Class({ * If a callback is already set for the tile index it will be replaced. Set the callback to null to * remove it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#setTileLocationCallback * @since 3.0.0 * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} [callbackContext] - The context under which the callback is called. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -2148,11 +2219,9 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setLayer * @since 3.0.0 * - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setLayer: function (layer) { @@ -2173,10 +2242,10 @@ var Tilemap = new Class({ * @method Phaser.Tilemaps.Tilemap#setBaseTileSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tiles the map uses for calculations. - * @param {integer} tileHeight - The height of the tiles the map uses for calculations. + * @param {number} tileWidth - The width of the tiles the map uses for calculations. + * @param {number} tileHeight - The height of the tiles the map uses for calculations. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setBaseTileSize: function (tileWidth, tileHeight) { @@ -2185,7 +2254,7 @@ var Tilemap = new Class({ this.widthInPixels = this.width * tileWidth; this.heightInPixels = this.height * tileHeight; - // Update the base tile size on all layers & tiles + // Update the base tile size on all layers & tiles for (var i = 0; i < this.layers.length; i++) { this.layers[i].baseTileWidth = tileWidth; @@ -2213,20 +2282,18 @@ var Tilemap = new Class({ }, /** - * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's + * Sets the tile size for a specific `layer`. Note: this does not necessarily match the maps * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any * tiles the layer has. * * @method Phaser.Tilemaps.Tilemap#setLayerTileSize * @since 3.0.0 * - * @param {integer} tileWidth - The width of the tiles (in pixels) in the layer. - * @param {integer} tileHeight - The height of the tiles (in pixels) in the layer. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param {number} tileWidth - The width of the tiles (in pixels) in the layer. + * @param {number} tileHeight - The height of the tiles (in pixels) in the layer. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. * - * @return {Phaser.Tilemaps.Tilemap} This Tilemap object. + * @return {this} This Tilemap object. */ setLayerTileSize: function (tileWidth, tileHeight, layer) { @@ -2263,17 +2330,16 @@ var Tilemap = new Class({ * appear to have changed! This method only modifies tile indexes and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -2281,8 +2347,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'shuffle')) { return this; } - if (layer === null) { return null; } TilemapComponents.Shuffle(tileX, tileY, width, height, layer); @@ -2295,19 +2359,18 @@ var Tilemap = new Class({ * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#swapByIndex * @since 3.0.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ @@ -2315,8 +2378,6 @@ var Tilemap = new Class({ { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'swapByIndex')) { return this; } - if (layer === null) { return null; } TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, layer); @@ -2328,14 +2389,14 @@ var Tilemap = new Class({ * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldX * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -2345,22 +2406,21 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.TileToWorldX(tileX, camera, layer); + return this._convert.TileToWorldX(tileX, camera, layer); }, /** * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldY * @since 3.0.0 * - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer - * to use. If not given the current layer is used. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -2370,7 +2430,7 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.TileToWorldY(tileX, camera, layer); + return this._convert.TileToWorldY(tileX, camera, layer); }, /** @@ -2378,26 +2438,26 @@ var Tilemap = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#tileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + * @return {?Phaser.Math.Vector2} Returns a Vector2, or null if the layer given was invalid. */ - tileToWorldXY: function (tileX, tileY, point, camera, layer) + tileToWorldXY: function (tileX, tileY, vec2, camera, layer) { layer = this.getLayer(layer); if (layer === null) { return null; } - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, layer); + return this._convert.TileToWorldXY(tileX, tileY, vec2, camera, layer); }, /** @@ -2412,32 +2472,27 @@ var Tilemap = new Class({ * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 * ] * - * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * The probability of any index being picked is (the indexs weight) / (sum of all weights). This * method only modifies tile indexes and does not change collision information. * - * If no layer specified, the map's current layer is used. This - * cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#weightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. */ - weightedRandomize: function (tileX, tileY, width, height, weightedIndexes, layer) + weightedRandomize: function (weightedIndexes, tileX, tileY, width, height, layer) { layer = this.getLayer(layer); - if (this._isStaticCall(layer, 'weightedRandomize')) { return this; } - if (layer === null) { return null; } TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, layer); @@ -2449,16 +2504,15 @@ var Tilemap = new Class({ * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileX * @since 3.0.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer - * to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -2468,22 +2522,22 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, layer); + return this._convert.WorldToTileX(worldX, snapToFloor, camera, layer); }, /** * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileY * @since 3.0.0 * * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * * @return {?number} Returns a number, or null if the layer given was invalid. */ @@ -2493,7 +2547,7 @@ var Tilemap = new Class({ if (layer === null) { return null; } - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, layer); + return this._convert.WorldToTileY(worldY, snapToFloor, camera, layer); }, /** @@ -2501,49 +2555,44 @@ var Tilemap = new Class({ * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * * @method Phaser.Tilemaps.Tilemap#worldToTileXY * @since 3.0.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * @param {(string|integer|Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [vec2] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * @param {(string|number|Phaser.Tilemaps.TilemapLayer)} [layer] - The tile layer to use. If not given the current layer is used. * - * @return {?Phaser.Math.Vector2} Returns a point, or null if the layer given was invalid. + * @return {?Phaser.Math.Vector2} Returns a vec2, or null if the layer given was invalid. */ - worldToTileXY: function (worldX, worldY, snapToFloor, point, camera, layer) + worldToTileXY: function (worldX, worldY, snapToFloor, vec2, camera, layer) { layer = this.getLayer(layer); if (layer === null) { return null; } - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, layer); + return this._convert.WorldToTileXY(worldX, worldY, snapToFloor, vec2, camera, layer); }, /** - * Used internally to check if a layer is static and prints out a warning. + * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any + * TilemapLayers that have been created. * - * @method Phaser.Tilemaps.Tilemap#_isStaticCall - * @private + * @method Phaser.Tilemaps.Tilemap#destroy * @since 3.0.0 - * - * @return {boolean} */ - _isStaticCall: function (layer, functionName) + destroy: function () { - if (layer.tilemapLayer instanceof StaticTilemapLayer) - { - console.warn(functionName + ': You cannot change the tiles in a static tilemap layer'); - return true; - } - else - { - return false; - } + this.removeAllLayers(); + + this.tilesets.length = 0; + this.objects.length = 0; + + this.scene = null; } }); diff --git a/src/tilemaps/TilemapFactory.js b/src/tilemaps/TilemapFactory.js index e61148b2c..3768ef49f 100644 --- a/src/tilemaps/TilemapFactory.js +++ b/src/tilemaps/TilemapFactory.js @@ -17,15 +17,15 @@ var ParseToTilemap = require('./ParseToTilemap'); * @since 3.0.0 * * @param {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. - * @param {integer} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the + * @param {number} [tileWidth=32] - The width of a tile in pixels. Pass in `null` to leave as the * default. - * @param {integer} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the + * @param {number} [tileHeight=32] - The height of a tile in pixels. Pass in `null` to leave as the * default. - * @param {integer} [width=10] - The width of the map in tiles. Pass in `null` to leave as the + * @param {number} [width=10] - The width of the map in tiles. Pass in `null` to leave as the * default. - * @param {integer} [height=10] - The height of the map in tiles. Pass in `null` to leave as the + * @param {number} [height=10] - The height of the map in tiles. Pass in `null` to leave as the * default. - * @param {integer[][]} [data] - Instead of loading from the cache, you can also load directly from + * @param {number[][]} [data] - Instead of loading from the cache, you can also load directly from * a 2D array of tile indexes. Pass in `null` for no data. * @param {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, in the * map data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty diff --git a/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js b/src/tilemaps/TilemapLayer.js similarity index 62% rename from src/tilemaps/dynamiclayer/DynamicTilemapLayer.js rename to src/tilemaps/TilemapLayer.js index 2a4227153..f9b61fb66 100644 --- a/src/tilemaps/dynamiclayer/DynamicTilemapLayer.js +++ b/src/tilemaps/TilemapLayer.js @@ -4,28 +4,22 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Class = require('../../utils/Class'); -var Components = require('../../gameobjects/components'); -var DynamicTilemapLayerRender = require('./DynamicTilemapLayerRender'); -var GameObject = require('../../gameobjects/GameObject'); -var TilemapComponents = require('../components'); +var Class = require('../utils/Class'); +var Components = require('../gameobjects/components'); +var GameObject = require('../gameobjects/GameObject'); +var TilemapComponents = require('./components'); +var TilemapLayerRender = require('./TilemapLayerRender'); /** * @classdesc - * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * A Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination * with one, or more, Tilesets. * - * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a - * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the - * tiles in a DynamicTilemapLayer. - * - * Use this over a Static Tilemap Layer when you need those features. - * - * @class DynamicTilemapLayer + * @class TilemapLayer * @extends Phaser.GameObjects.GameObject * @memberof Phaser.Tilemaps * @constructor - * @since 3.0.0 + * @since 3.50.0 * * @extends Phaser.GameObjects.Components.Alpha * @extends Phaser.GameObjects.Components.BlendMode @@ -41,12 +35,12 @@ var TilemapComponents = require('../components'); * * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. - * @param {integer} layerIndex - The index of the LayerData associated with this layer. + * @param {number} layerIndex - The index of the LayerData associated with this layer. * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param {number} [x=0] - The world x position where the top left of this layer will be placed. * @param {number} [y=0] - The world y position where the top left of this layer will be placed. */ -var DynamicTilemapLayer = new Class({ +var TilemapLayer = new Class({ Extends: GameObject, @@ -62,40 +56,40 @@ var DynamicTilemapLayer = new Class({ Components.Transform, Components.Visible, Components.ScrollFactor, - DynamicTilemapLayerRender + TilemapLayerRender ], initialize: - function DynamicTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) + function TilemapLayer (scene, tilemap, layerIndex, tileset, x, y) { - GameObject.call(this, scene, 'DynamicTilemapLayer'); + GameObject.call(this, scene, 'TilemapLayer'); /** * Used internally by physics system to perform fast type checks. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#isTilemap + * @name Phaser.Tilemaps.TilemapLayer#isTilemap * @type {boolean} * @readonly - * @since 3.0.0 + * @since 3.50.0 */ this.isTilemap = true; /** * The Tilemap that this layer is a part of. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilemap + * @name Phaser.Tilemaps.TilemapLayer#tilemap * @type {Phaser.Tilemaps.Tilemap} - * @since 3.0.0 + * @since 3.50.0 */ this.tilemap = tilemap; /** * The index of the LayerData associated with this layer. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#layerIndex - * @type {integer} - * @since 3.0.0 + * @name Phaser.Tilemaps.TilemapLayer#layerIndex + * @type {number} + * @since 3.50.0 */ this.layerIndex = layerIndex; @@ -103,9 +97,9 @@ var DynamicTilemapLayer = new Class({ * The LayerData associated with this layer. LayerData can only be associated with one * tilemap layer. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#layer + * @name Phaser.Tilemaps.TilemapLayer#layer * @type {Phaser.Tilemaps.LayerData} - * @since 3.0.0 + * @since 3.50.0 */ this.layer = tilemap.layers[layerIndex]; @@ -113,68 +107,66 @@ var DynamicTilemapLayer = new Class({ this.layer.tilemapLayer = this; /** - * The Tileset/s associated with this layer. + * An array of `Tileset` objects associated with this layer. * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tileset + * @name Phaser.Tilemaps.TilemapLayer#tileset * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.0.0 + * @since 3.50.0 */ this.tileset = []; - /** - * Used internally with the canvas render. This holds the tiles that are visible within the - * camera. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#culledTiles - * @type {array} - * @since 3.0.0 - */ - this.culledTiles = []; - - /** - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - * - * @name Phaser.Tilemaps.DynamicTilemapLayer#skipCull - * @type {boolean} - * @since 3.11.0 - */ - this.skipCull = false; - /** * The total number of tiles drawn by the renderer in the last frame. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesDrawn - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#tilesDrawn + * @type {number} * @readonly - * @since 3.11.0 + * @since 3.50.0 */ this.tilesDrawn = 0; /** * The total number of tiles in this layer. Updated every frame. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#tilesTotal - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#tilesTotal + * @type {number} * @readonly - * @since 3.11.0 + * @since 3.50.0 */ this.tilesTotal = this.layer.width * this.layer.height; + /** + * Used internally during rendering. This holds the tiles that are visible within the Camera. + * + * @name Phaser.Tilemaps.TilemapLayer#culledTiles + * @type {Phaser.Tilemaps.Tile[]} + * @since 3.50.0 + */ + this.culledTiles = []; + + /** + * You can control if the camera should cull tiles on this layer before rendering them or not. + * + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + * + * @name Phaser.Tilemaps.TilemapLayer#skipCull + * @type {boolean} + * @since 3.50.0 + */ + this.skipCull = false; + /** * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. * * See the method `setCullPadding` for more details. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingX - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#cullPaddingX + * @type {number} * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ this.cullPaddingX = 1; @@ -183,31 +175,39 @@ var DynamicTilemapLayer = new Class({ * * See the method `setCullPadding` for more details. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullPaddingY - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#cullPaddingY + * @type {number} * @default 1 - * @since 3.11.0 + * @since 3.50.0 */ this.cullPaddingY = 1; /** * The callback that is invoked when the tiles are culled. * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. + * It will call a different function based on the map orientation: * - * It will be sent 3 arguments: + * Orthogonal (the default) is `TilemapComponents.CullTiles` + * Isometric is `TilemapComponents.IsometricCullTiles` + * Hexagonal is `TilemapComponents.HexagonalCullTiles` + * Staggered is `TilemapComponents.StaggeredCullTiles` + * + * However, you can override this to call any function you like. + * + * It will be sent 4 arguments: * * 1. The Phaser.Tilemaps.LayerData object for this Layer * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * 4. The Render Order constant. * * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#cullCallback + * @name Phaser.Tilemaps.TilemapLayer#cullCallback * @type {function} - * @since 3.11.0 + * @since 3.50.0 */ - this.cullCallback = TilemapComponents.CullTiles; + this.cullCallback = TilemapComponents.GetCullTilesFunction(this.layer.orientation); /** * The rendering (draw) order of the tiles in this layer. @@ -224,20 +224,20 @@ var DynamicTilemapLayer = new Class({ * * This can be changed via the `setRenderOrder` method. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#_renderOrder - * @type {integer} + * @name Phaser.Tilemaps.TilemapLayer#_renderOrder + * @type {number} * @default 0 * @private - * @since 3.12.0 + * @since 3.50.0 */ this._renderOrder = 0; /** * An array holding the mapping between the tile indexes and the tileset they belong to. * - * @name Phaser.Tilemaps.DynamicTilemapLayer#gidMap + * @name Phaser.Tilemaps.TilemapLayer#gidMap * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.14.0 + * @since 3.50.0 */ this.gidMap = []; @@ -253,9 +253,9 @@ var DynamicTilemapLayer = new Class({ /** * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTilesets + * @method Phaser.Tilemaps.TilemapLayer#setTilesets * @private - * @since 3.14.0 + * @since 3.50.0 * * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. */ @@ -314,10 +314,10 @@ var DynamicTilemapLayer = new Class({ * * You can provide either an integer (0 to 3), or the string version of the order. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setRenderOrder - * @since 3.12.0 + * @method Phaser.Tilemaps.TilemapLayer#setRenderOrder + * @since 3.50.0 * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + * @param {(number|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. * * @return {this} This Tilemap Layer object. */ @@ -343,13 +343,13 @@ var DynamicTilemapLayer = new Class({ * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesAt - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#calculateFacesAt + * @since 3.50.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ calculateFacesAt: function (tileX, tileY) { @@ -363,15 +363,15 @@ var DynamicTilemapLayer = new Class({ * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#calculateFacesWithin - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#calculateFacesWithin + * @since 3.50.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ calculateFacesWithin: function (tileX, tileY, width, height) { @@ -386,17 +386,17 @@ var DynamicTilemapLayer = new Class({ * created. This is useful if you want to lay down special tiles in a level that are converted to * Sprites, but want to replace the tile itself with a floor tile or similar once converted. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#createFromTiles - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#createFromTiles + * @since 3.50.0 * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted + * @param {(number|array)} indexes - The tile index, or array of indexes, to create Sprites from. + * @param {(number|array)} replacements - The tile index, or array of indexes, to change a converted * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. + * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} [spriteConfig] - The config object to pass into the Sprite creator (i.e. * scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * @param {Phaser.Scene} [scene] - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when determining the world XY * * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. */ @@ -407,14 +407,14 @@ var DynamicTilemapLayer = new Class({ /** * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. + * This is used internally during rendering. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#cull - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#cull + * @since 3.50.0 * * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects to render. */ cull: function (camera) { @@ -426,18 +426,18 @@ var DynamicTilemapLayer = new Class({ * coordinates) within the layer. This copies all tile properties & recalculates collision * information in the destination region. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#copy - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#copy + * @since 3.50.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. + * @return {this} This Tilemap Layer object. */ copy: function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces) { @@ -447,10 +447,828 @@ var DynamicTilemapLayer = new Class({ }, /** - * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData. + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#destroy - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#fill + * @since 3.50.0 + * + * @param {number} index - The tile index to fill the area with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {this} This Tilemap Layer object. + */ + fill: function (index, tileX, tileY, width, height, recalculateFaces) + { + TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, this.layer); + + return this; + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * + * @method Phaser.Tilemaps.TilemapLayer#filterTiles + * @since 3.50.0 + * + * @param {function} callback - The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param {object} [context] - The context under which the callback should be run. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ + filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * + * @method Phaser.Tilemaps.TilemapLayer#findByIndex + * @since 3.50.0 + * + * @param {number} index - The tile index value to search for. + * @param {number} [skip=0] - The number of times to skip a matching tile before returning. + * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. + * + * @return {Phaser.Tilemaps.Tile} The first matching Tile object. + */ + findByIndex: function (findIndex, skip, reverse) + { + return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer); + }, + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * + * @method Phaser.Tilemaps.TilemapLayer#findTile + * @since 3.50.0 + * + * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context under which the callback should be run. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {?Phaser.Tilemaps.Tile} The first Tile found at the given location. + */ + findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * + * @method Phaser.Tilemaps.TilemapLayer#forEachTile + * @since 3.50.0 + * + * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param {object} [context] - The context, or scope, under which the callback should be run. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {this} This Tilemap Layer object. + */ + forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) + { + TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); + + return this; + }, + + /** + * Gets a tile at the given tile coordinates from the given layer. + * + * @method Phaser.Tilemaps.TilemapLayer#getTileAt + * @since 3.50.0 + * + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * + * @return {Phaser.Tilemaps.Tile} The Tile at the given coordinates or null if no tile was found or the coordinates were invalid. + */ + getTileAt: function (tileX, tileY, nonNull) + { + return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer); + }, + + /** + * Gets a tile at the given world coordinates from the given layer. + * + * @method Phaser.Tilemaps.TilemapLayer#getTileAtWorldXY + * @since 3.50.0 + * + * @param {number} worldX - X position to get the tile from (given in pixels) + * @param {number} worldY - Y position to get the tile from (given in pixels) + * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. + */ + getTileAtWorldXY: function (worldX, worldY, nonNull, camera) + { + return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer); + }, + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithin + * @since 3.50.0 + * + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the area. + */ + getTilesWithin: function (tileX, tileY, width, height, filteringOptions) + { + return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer); + }, + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithinShape + * @since 3.50.0 + * + * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the shape. + */ + getTilesWithinShape: function (shape, filteringOptions, camera) + { + return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer); + }, + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * + * @method Phaser.Tilemaps.TilemapLayer#getTilesWithinWorldXY + * @since 3.50.0 + * + * @param {number} worldX - The world x coordinate for the top-left of the area. + * @param {number} worldY - The world y coordinate for the top-left of the area. + * @param {number} width - The width of the area. + * @param {number} height - The height of the area. + * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects found within the area. + */ + getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) + { + return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer); + }, + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @method Phaser.Tilemaps.TilemapLayer#hasTileAt + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. + */ + hasTileAt: function (tileX, tileY) + { + return TilemapComponents.HasTileAt(tileX, tileY, this.layer); + }, + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * + * @method Phaser.Tilemaps.TilemapLayer#hasTileAtWorldXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when factoring in which tiles to return. + * + * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. + */ + hasTileAtWorldXY: function (worldX, worldY, camera) + { + return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer); + }, + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * + * @method Phaser.Tilemaps.TilemapLayer#putTileAt + * @since 3.50.0 + * + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.Tile} The Tile object that was inserted at the given coordinates. + */ + putTileAt: function (tile, tileX, tileY, recalculateFaces) + { + return TilemapComponents.PutTileAt(tile, tileX, tileY, recalculateFaces, this.layer); + }, + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * + * @method Phaser.Tilemaps.TilemapLayer#putTileAtWorldXY + * @since 3.50.0 + * + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [recalculateFaces] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile} The Tile object that was inserted at the given coordinates. + */ + putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera) + { + return TilemapComponents.PutTileAtWorldXY(tile, worldX, worldY, recalculateFaces, camera, this.layer); + }, + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * + * @method Phaser.Tilemaps.TilemapLayer#putTilesAt + * @since 3.50.0 + * + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {this} This Tilemap Layer object. + */ + putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces) + { + TilemapComponents.PutTilesAt(tilesArray, tileX, tileY, recalculateFaces, this.layer); + + return this; + }, + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * + * @method Phaser.Tilemaps.TilemapLayer#randomize + * @since 3.50.0 + * + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} [indexes] - An array of indexes to randomly draw from during randomization. + * + * @return {this} This Tilemap Layer object. + */ + randomize: function (tileX, tileY, width, height, indexes) + { + TilemapComponents.Randomize(tileX, tileY, width, height, indexes, this.layer); + + return this; + }, + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layers + * collision information. + * + * @method Phaser.Tilemaps.TilemapLayer#removeTileAt + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * + * @return {Phaser.Tilemaps.Tile} A Tile object. + */ + removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces) + { + return TilemapComponents.RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, this.layer); + }, + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layers + * collision information. + * + * @method Phaser.Tilemaps.TilemapLayer#removeTileAtWorldXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate, in pixels. + * @param {number} worldY - The y coordinate, in pixels. + * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Tilemaps.Tile} The Tile object that was removed from the given location. + */ + removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera) + { + return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, this.layer); + }, + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * + * @method Phaser.Tilemaps.TilemapLayer#renderDebug + * @since 3.50.0 + * + * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. + * @param {Phaser.Types.Tilemaps.StyleConfig} [styleConfig] - An object specifying the colors to use for the debug drawing. + * + * @return {this} This Tilemap Layer object. + */ + renderDebug: function (graphics, styleConfig) + { + TilemapComponents.RenderDebug(graphics, styleConfig, this.layer); + + return this; + }, + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * + * @method Phaser.Tilemaps.TilemapLayer#replaceByIndex + * @since 3.50.0 + * + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * + * @return {this} This Tilemap Layer object. + */ + replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height) + { + TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * + * @method Phaser.Tilemaps.TilemapLayer#setSkipCull + * @since 3.50.0 + * + * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. + * + * @return {this} This Tilemap Layer object. + */ + setSkipCull: function (value) + { + if (value === undefined) { value = true; } + + this.skipCull = value; + + return this; + }, + + /** + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * + * @method Phaser.Tilemaps.TilemapLayer#setCullPadding + * @since 3.50.0 + * + * @param {number} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. + * @param {number} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. + * + * @return {this} This Tilemap Layer object. + */ + setCullPadding: function (paddingX, paddingY) + { + if (paddingX === undefined) { paddingX = 1; } + if (paddingY === undefined) { paddingY = 1; } + + this.cullPaddingX = paddingX; + this.cullPaddingY = paddingY; + + return this; + }, + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.TilemapLayer#setCollision + * @since 3.50.0 + * + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. + * + * @return {this} This Tilemap Layer object. + */ + setCollision: function (indexes, collides, recalculateFaces, updateLayer) + { + TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer, updateLayer); + + return this; + }, + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.TilemapLayer#setCollisionBetween + * @since 3.50.0 + * + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {this} This Tilemap Layer object. + */ + setCollisionBetween: function (start, stop, collides, recalculateFaces) + { + TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * + * @method Phaser.Tilemaps.TilemapLayer#setCollisionByProperty + * @since 3.50.0 + * + * @param {object} properties - An object with tile properties and corresponding values that should be checked. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {this} This Tilemap Layer object. + */ + setCollisionByProperty: function (properties, collides, recalculateFaces) + { + TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). Tile indexes not currently in the layer are not affected. + * + * @method Phaser.Tilemaps.TilemapLayer#setCollisionByExclusion + * @since 3.50.0 + * + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {this} This Tilemap Layer object. + */ + setCollisionByExclusion: function (indexes, collides, recalculateFaces) + { + TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * + * @method Phaser.Tilemaps.TilemapLayer#setCollisionFromCollisionGroup + * @since 3.50.0 + * + * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. + * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * + * @return {this} This Tilemap Layer object. + */ + setCollisionFromCollisionGroup: function (collides, recalculateFaces) + { + TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer); + + return this; + }, + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * + * @method Phaser.Tilemaps.TilemapLayer#setTileIndexCallback + * @since 3.50.0 + * + * @param {(number|number[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {function} callback - The callback that will be invoked when the tile is collided with. + * @param {object} callbackContext - The context under which the callback is called. + * + * @return {this} This Tilemap Layer object. + */ + setTileIndexCallback: function (indexes, callback, callbackContext) + { + TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer); + + return this; + }, + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * + * @method Phaser.Tilemaps.TilemapLayer#setTileLocationCallback + * @since 3.50.0 + * + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * @param {function} [callback] - The callback that will be invoked when the tile is collided with. + * @param {object} [callbackContext] - The context, or scope, under which the callback is invoked. + * + * @return {this} This Tilemap Layer object. + */ + setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) + { + TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer); + + return this; + }, + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * + * @method Phaser.Tilemaps.TilemapLayer#shuffle + * @since 3.50.0 + * + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * + * @return {this} This Tilemap Layer object. + */ + shuffle: function (tileX, tileY, width, height) + { + TilemapComponents.Shuffle(tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * + * @method Phaser.Tilemaps.TilemapLayer#swapByIndex + * @since 3.50.0 + * + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * + * @return {this} This Tilemap Layer object. + */ + swapByIndex: function (indexA, indexB, tileX, tileY, width, height) + { + TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, this.layer); + + return this; + }, + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldX + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} The Tile X coordinate converted to pixels. + */ + tileToWorldX: function (tileX, camera) + { + return this.tilemap.tileToWorldX(tileX, camera, this); + }, + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldY + * @since 3.50.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} The Tile Y coordinate converted to pixels. + */ + tileToWorldY: function (tileY, camera) + { + return this.tilemap.tileToWorldY(tileY, camera, this); + }, + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @method Phaser.Tilemaps.TilemapLayer#tileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Math.Vector2} A Vector2 containing the world coordinates of the Tile. + */ + tileToWorldXY: function (tileX, tileY, point, camera) + { + return this.tilemap.tileToWorldXY(tileX, tileY, point, camera, this); + }, + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being choose is (the index's weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * + * @method Phaser.Tilemaps.TilemapLayer#weightedRandomize + * @since 3.50.0 + * + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param {number} [tileX] - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [tileY] - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} [width] - How many tiles wide from the `tileX` index the area will be. + * @param {number} [height] - How many tiles tall from the `tileY` index the area will be. + * + * @return {this} This Tilemap Layer object. + */ + weightedRandomize: function (tileX, tileY, width, height, weightedIndexes) + { + TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, this.layer); + + return this; + }, + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.TilemapLayer#worldToTileX + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} The tile X coordinate based on the world value. + */ + worldToTileX: function (worldX, snapToFloor, camera) + { + return this.tilemap.worldToTileX(worldX, snapToFloor, camera, this); + }, + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @method Phaser.Tilemaps.TilemapLayer#worldToTileY + * @since 3.50.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {number} The tile Y coordinate based on the world value. + */ + worldToTileY: function (worldY, snapToFloor, camera) + { + return this.tilemap.worldToTileY(worldY, snapToFloor, camera, this); + }, + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @method Phaser.Tilemaps.TilemapLayer#worldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} [snapToFloor] - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to use when calculating the tile index from the world values. + * + * @return {Phaser.Math.Vector2} A Vector2 containing the tile coordinates of the world values. + */ + worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) + { + return this.tilemap.worldToTileXY(worldX, worldY, snapToFloor, point, camera, this); + }, + + /** + * Destroys this TilemapLayer and removes its link to the associated LayerData. + * + * @method Phaser.Tilemaps.TilemapLayer#destroy + * @since 3.50.0 * * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? */ @@ -484,832 +1302,8 @@ var DynamicTilemapLayer = new Class({ this.tileset = []; GameObject.prototype.destroy.call(this); - }, - - /** - * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the - * specified index. Tiles will be set to collide if the given index is a colliding index. - * Collision information in the region will be recalculated. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#fill - * @since 3.0.0 - * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - fill: function (index, tileX, tileY, width, height, recalculateFaces) - { - TilemapComponents.Fill(index, tileX, tileY, width, height, recalculateFaces, this.layer); - - return this; - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns - * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#filterTiles - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. The callback should return true for tiles that pass the - * filter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * Searches the entire map layer for the first tile matching the given index, then returns that Tile - * object. If no match is found, it returns null. The search starts from the top-left tile and - * continues horizontally until it hits the end of the row, then it drops down to the next column. - * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to - * the top-left. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#findByIndex - * @since 3.0.0 - * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - findByIndex: function (findIndex, skip, reverse) - { - return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer); - }, - - /** - * Find the first tile in the given rectangular area (in tile coordinates) of the layer that - * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns - * true. Similar to Array.prototype.find in vanilla JS. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#findTile - * @since 3.0.0 - * - * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {?Phaser.Tilemaps.Tile} - */ - findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * callback. Similar to Array.prototype.forEach in vanilla JS. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#forEachTile - * @since 3.0.0 - * - * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to search. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - - return this; - }, - - /** - * Gets a tile at the given tile coordinates from the given layer. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAt - * @since 3.0.0 - * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. - */ - getTileAt: function (tileX, tileY, nonNull) - { - return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer); - }, - - /** - * Gets a tile at the given world coordinates from the given layer. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - X position to get the tile from (given in pixels) - * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. - */ - getTileAtWorldXY: function (worldX, worldY, nonNull, camera) - { - return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithin - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithin: function (tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, - * Line, Rectangle or Triangle. The shape should be in world coordinates. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinShape - * @since 3.0.0 - * - * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinShape: function (shape, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#getTilesWithinWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The world x coordinate for the top-left of the area. - * @param {number} worldY - The world y coordinate for the top-left of the area. - * @param {number} width - The width of the area. - * @param {number} height - The height of the area. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAt - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * - * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. - */ - hasTileAt: function (tileX, tileY) - { - return TilemapComponents.HasTileAt(tileX, tileY, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#hasTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The x coordinate, in pixels. - * @param {number} worldY - The y coordinate, in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * - * @return {boolean} `true` if a tile was found at the given location, otherwise `false`. - */ - hasTileAtWorldXY: function (worldX, worldY, camera) - { - return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer); - }, - - /** - * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index - * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified - * location. If you pass in an index, only the index at the specified location will be changed. - * Collision information will be recalculated at the specified location. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAt - * @since 3.0.0 - * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - putTileAt: function (tile, tileX, tileY, recalculateFaces) - { - return TilemapComponents.PutTileAt(tile, tileX, tileY, recalculateFaces, this.layer); - }, - - /** - * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either - * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the - * specified location. If you pass in an index, only the index at the specified location will be - * changed. Collision information will be recalculated at the specified location. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTileAtWorldXY - * @since 3.0.0 - * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {number} worldX - The x coordinate, in pixels. - * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - putTileAtWorldXY: function (tile, worldX, worldY, recalculateFaces, camera) - { - return TilemapComponents.PutTileAtWorldXY(tile, worldX, worldY, recalculateFaces, camera, this.layer); - }, - - /** - * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified - * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, - * all attributes will be copied over to the specified location. If you pass in an index, only the - * index at the specified location will be changed. Collision information will be recalculated - * within the region tiles were changed. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#putTilesAt - * @since 3.0.0 - * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - putTilesAt: function (tilesArray, tileX, tileY, recalculateFaces) - { - TilemapComponents.PutTilesAt(tilesArray, tileX, tileY, recalculateFaces, this.layer); - - return this; - }, - - /** - * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the - * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then - * those will be used for randomly assigning new tile indexes. If an array is not provided, the - * indexes found within the region (excluding -1) will be used for randomly assigning new tile - * indexes. This method only modifies tile indexes and does not change collision information. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#randomize - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - randomize: function (tileX, tileY, width, height, indexes) - { - TilemapComponents.Randomize(tileX, tileY, width, height, indexes, this.layer); - - return this; - }, - - /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's - * collision information. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAt - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - removeTileAt: function (tileX, tileY, replaceWithNull, recalculateFaces) - { - return TilemapComponents.RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, this.layer); - }, - - /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's - * collision information. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#removeTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The x coordinate, in pixels. - * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - removeTileAtWorldXY: function (worldX, worldY, replaceWithNull, recalculateFaces, camera) - { - return TilemapComponents.RemoveTileAtWorldXY(worldX, worldY, replaceWithNull, recalculateFaces, camera, this.layer); - }, - - /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to - * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles - * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation - * wherever you want on the screen. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderDebug - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - renderDebug: function (graphics, styleConfig) - { - TilemapComponents.RenderDebug(graphics, styleConfig, this.layer); - - return this; - }, - - /** - * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching - * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does - * not change collision information. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#replaceByIndex - * @since 3.0.0 - * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - replaceByIndex: function (findIndex, newIndex, tileX, tileY, width, height) - { - TilemapComponents.ReplaceByIndex(findIndex, newIndex, tileX, tileY, width, height, this.layer); - - return this; - }, - - /** - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setSkipCull - * @since 3.11.0 - * - * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. - * - * @return {this} This Tilemap Layer object. - */ - setSkipCull: function (value) - { - if (value === undefined) { value = true; } - - this.skipCull = value; - - return this; - }, - - /** - * When a Camera culls the tiles in this layer it does so using its view into the world, building up a - * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size - * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so - * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px - * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCullPadding - * @since 3.11.0 - * - * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. - * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. - * - * @return {this} This Tilemap Layer object. - */ - setCullPadding: function (paddingX, paddingY) - { - if (paddingX === undefined) { paddingX = 1; } - if (paddingY === undefined) { paddingY = 1; } - - this.cullPaddingX = paddingX; - this.cullPaddingY = paddingY; - - return this; - }, - - /** - * Sets collision on the given tile or tiles within a layer by index. You can pass in either a - * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if - * collision will be enabled (true) or disabled (false). - * - * If no layer specified, the map's current layer is used. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollision - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. - * - * @return {?Phaser.Tilemaps.Tilemap} Return this Tilemap object, or null if the layer given was invalid. - */ - setCollision: function (indexes, collides, recalculateFaces, updateLayer) - { - TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer, updateLayer); - - return this; - }, - - /** - * Sets collision on a range of tiles in a layer whose index is between the specified `start` and - * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set - * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be - * enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionBetween - * @since 3.0.0 - * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - setCollisionBetween: function (start, stop, collides, recalculateFaces) - { - TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property - * that matches the given properties object, its collision flag will be set. The `collides` - * parameter controls if collision will be enabled (true) or disabled (false). Passing in - * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that - * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can - * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a - * "types" property that matches any of those values, its collision flag will be updated. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByProperty - * @since 3.0.0 - * - * @param {object} properties - An object with tile properties and corresponding values that should be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - setCollisionByProperty: function (properties, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on all tiles in the given layer, except for tiles that have an index specified in - * the given array. The `collides` parameter controls if collision will be enabled (true) or - * disabled (false). Tile indexes not currently in the layer are not affected. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionByExclusion - * @since 3.0.0 - * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - setCollisionByExclusion: function (indexes, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking each tiles collision group data - * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tiles collision group, the tile's colliding information will be set. The `collides` parameter - * controls if collision will be enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setCollisionFromCollisionGroup - * @since 3.0.0 - * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - setCollisionFromCollisionGroup: function (collides, recalculateFaces) - { - TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets a global collision callback for the given tile index within the layer. This will affect all - * tiles on this layer that have the same index. If a callback is already set for the tile index it - * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileIndexCallback - * @since 3.0.0 - * - * @param {(integer|integer[])} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. - * @param {function} callback - The callback that will be invoked when the tile is collided with. - * @param {object} callbackContext - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - setTileIndexCallback: function (indexes, callback, callbackContext) - { - TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. - * If a callback is already set for the tile index it will be replaced. Set the callback to null to - * remove it. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#setTileLocationCallback - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {function} [callback] - The callback that will be invoked when the tile is collided with. - * @param {object} [callbackContext] - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) - { - TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given - * layer. It will only randomize the tiles in that area, so if they're all the same nothing will - * appear to have changed! This method only modifies tile indexes and does not change collision - * information. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#shuffle - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - shuffle: function (tileX, tileY, width, height) - { - TilemapComponents.Shuffle(tileX, tileY, width, height, this.layer); - - return this; - }, - - /** - * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching - * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision - * information. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#swapByIndex - * @since 3.0.0 - * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - swapByIndex: function (indexA, indexB, tileX, tileY, width, height) - { - TilemapComponents.SwapByIndex(indexA, indexB, tileX, tileY, width, height, this.layer); - - return this; - }, - - /** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldX - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {number} - */ - tileToWorldX: function (tileX, camera) - { - return TilemapComponents.TileToWorldX(tileX, camera, this.layer); - }, - - /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldY - * @since 3.0.0 - * - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {number} - */ - tileToWorldY: function (tileY, camera) - { - return TilemapComponents.TileToWorldY(tileY, camera, this.layer); - }, - - /** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#tileToWorldXY - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Math.Vector2} - */ - tileToWorldXY: function (tileX, tileY, point, camera) - { - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); - }, - - /** - * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the - * specified layer. Each tile will receive a new index. New indexes are drawn from the given - * weightedIndexes array. An example weighted array: - * - * [ - * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 - * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 - * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 - * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 - * ] - * - * The probability of any index being choose is (the index's weight) / (sum of all weights). This - * method only modifies tile indexes and does not change collision information. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#weightedRandomize - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * - * @return {Phaser.Tilemaps.DynamicTilemapLayer} This Tilemap Layer object. - */ - weightedRandomize: function (tileX, tileY, width, height, weightedIndexes) - { - TilemapComponents.WeightedRandomize(tileX, tileY, width, height, weightedIndexes, this.layer); - - return this; - }, - - /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileX - * @since 3.0.0 - * - * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {number} - */ - worldToTileX: function (worldX, snapToFloor, camera) - { - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileY - * @since 3.0.0 - * - * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {number} - */ - worldToTileY: function (worldY, snapToFloor, camera) - { - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#worldToTileXY - * @since 3.0.0 - * - * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Math.Vector2} - */ - worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) - { - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); } }); -module.exports = DynamicTilemapLayer; +module.exports = TilemapLayer; diff --git a/src/tilemaps/dynamiclayer/DynamicTilemapLayerCanvasRenderer.js b/src/tilemaps/TilemapLayerCanvasRenderer.js similarity index 61% rename from src/tilemaps/dynamiclayer/DynamicTilemapLayerCanvasRenderer.js rename to src/tilemaps/TilemapLayerCanvasRenderer.js index fb78d987d..a202765da 100644 --- a/src/tilemaps/dynamiclayer/DynamicTilemapLayerCanvasRenderer.js +++ b/src/tilemaps/TilemapLayerCanvasRenderer.js @@ -4,35 +4,41 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var TransformMatrix = require('../gameobjects/components/TransformMatrix'); + +var tempMatrix1 = new TransformMatrix(); +var tempMatrix2 = new TransformMatrix(); +var tempMatrix3 = new TransformMatrix(); + /** * Renders this Game Object with the Canvas Renderer to the given Camera. * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. * This method should not be called directly. It is a utility function of the Render module. * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderCanvas - * @since 3.0.0 + * @method Phaser.Tilemaps.TilemapLayer#renderCanvas + * @since 3.50.0 * @private * * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. + * @param {Phaser.Tilemaps.TilemapLayer} src - The Game Object being rendered in this call. * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested */ -var DynamicTilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) +var TilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) { - src.cull(camera); + var renderTiles = src.cull(camera); - var renderTiles = src.culledTiles; var tileCount = renderTiles.length; + var alpha = camera.alpha * src.alpha; - if (tileCount === 0) + if (tileCount === 0 || alpha <= 0) { return; } - var camMatrix = renderer._tempMatrix1; - var layerMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; + var camMatrix = tempMatrix1; + var layerMatrix = tempMatrix2; + var calcMatrix = tempMatrix3; layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); @@ -65,8 +71,6 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, camera, parentM layerMatrix.copyToContext(ctx); } - var alpha = camera.alpha * src.alpha; - if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1) { ctx.imageSmoothingEnabled = false; @@ -84,42 +88,45 @@ var DynamicTilemapLayerCanvasRenderer = function (renderer, src, camera, parentM } var image = tileset.image.getSourceImage(); + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - if (tileTexCoords) + if (tileTexCoords === null) { - var halfWidth = tile.width / 2; - var halfHeight = tile.height / 2; - - ctx.save(); - - ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); - - if (tile.rotation !== 0) - { - ctx.rotate(tile.rotation); - } - - if (tile.flipX || tile.flipY) - { - ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); - } - - ctx.globalAlpha = alpha * tile.alpha; - - ctx.drawImage( - image, - tileTexCoords.x, tileTexCoords.y, - tile.width, tile.height, - -halfWidth, -halfHeight, - tile.width, tile.height - ); - - ctx.restore(); + continue; } + + var halfWidth = tileset.tileWidth / 2; + var halfHeight = tileset.tileHeight / 2; + + ctx.save(); + + ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); + + if (tile.rotation !== 0) + { + ctx.rotate(tile.rotation); + } + + if (tile.flipX || tile.flipY) + { + ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); + } + + ctx.globalAlpha = alpha * tile.alpha; + + ctx.drawImage( + image, + tileTexCoords.x, tileTexCoords.y, + tileset.tileWidth , tileset.Height, + -halfWidth, -halfHeight, + tileset.tileWidth , tileset.tileHeight + ); + + ctx.restore(); } ctx.restore(); }; -module.exports = DynamicTilemapLayerCanvasRenderer; +module.exports = TilemapLayerCanvasRenderer; diff --git a/src/tilemaps/TilemapLayerRender.js b/src/tilemaps/TilemapLayerRender.js new file mode 100644 index 000000000..0a01b3d02 --- /dev/null +++ b/src/tilemaps/TilemapLayerRender.js @@ -0,0 +1,25 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var renderWebGL = require('../utils/NOOP'); +var renderCanvas = require('../utils/NOOP'); + +if (typeof WEBGL_RENDERER) +{ + renderWebGL = require('./TilemapLayerWebGLRenderer'); +} + +if (typeof CANVAS_RENDERER) +{ + renderCanvas = require('./TilemapLayerCanvasRenderer'); +} + +module.exports = { + + renderWebGL: renderWebGL, + renderCanvas: renderCanvas + +}; diff --git a/src/tilemaps/TilemapLayerWebGLRenderer.js b/src/tilemaps/TilemapLayerWebGLRenderer.js new file mode 100644 index 000000000..566508acf --- /dev/null +++ b/src/tilemaps/TilemapLayerWebGLRenderer.js @@ -0,0 +1,107 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Utils = require('../renderer/webgl/Utils'); + +/** + * Renders this Game Object with the WebGL Renderer to the given Camera. + * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. + * This method should not be called directly. It is a utility function of the Render module. + * + * @method Phaser.Tilemaps.TilemapLayer#renderWebGL + * @since 3.0.0 + * @private + * + * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. + * @param {Phaser.Tilemaps.TilemapLayer} src - The Game Object being rendered in this call. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. + */ +var TilemapLayerWebGLRenderer = function (renderer, src, camera) +{ + var renderTiles = src.cull(camera); + + var tileCount = renderTiles.length; + var alpha = camera.alpha * src.alpha; + + if (tileCount === 0 || alpha <= 0) + { + return; + } + + var gidMap = src.gidMap; + var pipeline = renderer.pipelines.set(src.pipeline, src); + + var getTint = Utils.getTintAppendFloatAlpha; + + var scrollFactorX = src.scrollFactorX; + var scrollFactorY = src.scrollFactorY; + + var x = src.x; + var y = src.y; + + var sx = src.scaleX; + var sy = src.scaleY; + + renderer.pipelines.preBatch(src); + + for (var i = 0; i < tileCount; i++) + { + var tile = renderTiles[i]; + + var tileset = gidMap[tile.index]; + + if (!tileset) + { + continue; + } + + var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); + + if (tileTexCoords === null) + { + continue; + } + + var texture = tileset.glTexture; + + var textureUnit = pipeline.setTexture2D(texture, src); + + var frameWidth = tileset.tileWidth; + var frameHeight = tileset.tileHeight; + + var frameX = tileTexCoords.x; + var frameY = tileTexCoords.y; + + var tw = tileset.tileWidth * 0.5; + var th = tileset.tileHeight * 0.5; + + var tint = getTint(tile.tint, alpha * tile.alpha); + + pipeline.batchTexture( + src, + texture, + texture.width, texture.height, + x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy), + tile.width, tile.height, + sx, sy, + tile.rotation, + tile.flipX, tile.flipY, + scrollFactorX, scrollFactorY, + tw, th, + frameX, frameY, frameWidth, frameHeight, + tint, tint, tint, tint, false, + 0, 0, + camera, + null, + true, + textureUnit + ); + } + + renderer.pipelines.postBatch(src); +}; + +module.exports = TilemapLayerWebGLRenderer; diff --git a/src/tilemaps/Tileset.js b/src/tilemaps/Tileset.js index 260720b33..3fbfb884c 100644 --- a/src/tilemaps/Tileset.js +++ b/src/tilemaps/Tileset.js @@ -17,11 +17,11 @@ var Class = require('../utils/Class'); * @since 3.0.0 * * @param {string} name - The name of the tileset in the map data. - * @param {integer} firstgid - The first tile index this tileset contains. - * @param {integer} [tileWidth=32] - Width of each tile (in pixels). - * @param {integer} [tileHeight=32] - Height of each tile (in pixels). - * @param {integer} [tileMargin=0] - The margin around all tiles in the sheet (in pixels). - * @param {integer} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels). + * @param {number} firstgid - The first tile index this tileset contains. + * @param {number} [tileWidth=32] - Width of each tile (in pixels). + * @param {number} [tileHeight=32] - Height of each tile (in pixels). + * @param {number} [tileMargin=0] - The margin around all tiles in the sheet (in pixels). + * @param {number} [tileSpacing=0] - The spacing between each tile in the sheet (in pixels). * @param {object} [tileProperties={}] - Custom properties defined per tile in the Tileset. * These typically are custom properties created in Tiled when editing a tileset. * @param {object} [tileData={}] - Data stored per tile. These typically are created in Tiled @@ -53,7 +53,7 @@ var Tileset = new Class({ * The starting index of the first tile index this Tileset contains. * * @name Phaser.Tilemaps.Tileset#firstgid - * @type {integer} + * @type {number} * @since 3.0.0 */ this.firstgid = firstgid; @@ -62,7 +62,7 @@ var Tileset = new Class({ * The width of each tile (in pixels). Use setTileSize to change. * * @name Phaser.Tilemaps.Tileset#tileWidth - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -72,7 +72,7 @@ var Tileset = new Class({ * The height of each tile (in pixels). Use setTileSize to change. * * @name Phaser.Tilemaps.Tileset#tileHeight - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -82,7 +82,7 @@ var Tileset = new Class({ * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change. * * @name Phaser.Tilemaps.Tileset#tileMargin - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -92,7 +92,7 @@ var Tileset = new Class({ * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change. * * @name Phaser.Tilemaps.Tileset#tileSpacing - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -142,7 +142,7 @@ var Tileset = new Class({ * The number of tile rows in the the tileset. * * @name Phaser.Tilemaps.Tileset#rows - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -152,7 +152,7 @@ var Tileset = new Class({ * The number of tile columns in the tileset. * * @name Phaser.Tilemaps.Tileset#columns - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -162,7 +162,7 @@ var Tileset = new Class({ * The total number of tiles in the tileset. * * @name Phaser.Tilemaps.Tileset#total - * @type {integer} + * @type {number} * @readonly * @since 3.0.0 */ @@ -187,7 +187,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileProperties * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?(object|undefined)} */ @@ -206,7 +206,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileData * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object|undefined} */ @@ -224,7 +224,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileCollisionGroup * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object} */ @@ -241,7 +241,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#containsTileIndex * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {boolean} */ @@ -260,7 +260,7 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#getTileTextureCoordinates * @since 3.0.0 * - * @param {integer} tileIndex - The unique id of the tile across all tilesets in the map. + * @param {number} tileIndex - The unique id of the tile across all tilesets in the map. * * @return {?object} Object in the form { x, y } representing the top-left UV coordinate * within the Tileset image. @@ -299,8 +299,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#setTileSize * @since 3.0.0 * - * @param {integer} [tileWidth] - The width of a tile in pixels. - * @param {integer} [tileHeight] - The height of a tile in pixels. + * @param {number} [tileWidth] - The width of a tile in pixels. + * @param {number} [tileHeight] - The height of a tile in pixels. * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -323,8 +323,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#setSpacing * @since 3.0.0 * - * @param {integer} [margin] - The margin around the tiles in the sheet (in pixels). - * @param {integer} [spacing] - The spacing between the tiles in the sheet (in pixels). + * @param {number} [margin] - The margin around the tiles in the sheet (in pixels). + * @param {number} [spacing] - The spacing between the tiles in the sheet (in pixels). * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ @@ -347,8 +347,8 @@ var Tileset = new Class({ * @method Phaser.Tilemaps.Tileset#updateTileData * @since 3.0.0 * - * @param {integer} imageWidth - The (expected) width of the image to slice. - * @param {integer} imageHeight - The (expected) height of the image to slice. + * @param {number} imageWidth - The (expected) width of the image to slice. + * @param {number} imageHeight - The (expected) height of the image to slice. * * @return {Phaser.Tilemaps.Tileset} This Tileset object. */ diff --git a/src/tilemaps/components/CalculateFacesAt.js b/src/tilemaps/components/CalculateFacesAt.js index 0df3e5ff8..b201651cf 100644 --- a/src/tilemaps/components/CalculateFacesAt.js +++ b/src/tilemaps/components/CalculateFacesAt.js @@ -14,8 +14,8 @@ var GetTileAt = require('./GetTileAt'); * @function Phaser.Tilemaps.Components.CalculateFacesAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesAt = function (tileX, tileY, layer) diff --git a/src/tilemaps/components/CalculateFacesWithin.js b/src/tilemaps/components/CalculateFacesWithin.js index f3a4af456..4258252fa 100644 --- a/src/tilemaps/components/CalculateFacesWithin.js +++ b/src/tilemaps/components/CalculateFacesWithin.js @@ -15,10 +15,10 @@ var GetTilesWithin = require('./GetTilesWithin'); * @function Phaser.Tilemaps.Components.CalculateFacesWithin * @since 3.0.0 * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var CalculateFacesWithin = function (tileX, tileY, width, height, layer) diff --git a/src/tilemaps/components/CheckIsoBounds.js b/src/tilemaps/components/CheckIsoBounds.js new file mode 100644 index 000000000..cf3eec2c9 --- /dev/null +++ b/src/tilemaps/components/CheckIsoBounds.js @@ -0,0 +1,40 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = require('../../math/Vector2'); + +var point = new Vector2(); + +/** + * Checks if the given tile coordinate is within the isometric layer bounds, or not. + * + * @function Phaser.Tilemaps.Components.CheckIsoBounds + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to check against. + * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. + * + * @return {boolean} Returns `true` if the coordinates are within the iso bounds. + */ +var CheckIsoBounds = function (tileX, tileY, layer, camera) +{ + var tilemapLayer = layer.tilemapLayer; + + var cullPaddingX = tilemapLayer.cullPaddingX; + var cullPaddingY = tilemapLayer.cullPaddingY; + + var pos = tilemapLayer.tilemap.tileToWorldXY(tileX, tileY, point, camera, tilemapLayer); + + // we always subtract 1/2 of the tile's height/width to make the culling distance start from the center of the tiles. + return pos.x > camera.worldView.x + tilemapLayer.scaleX * layer.tileWidth * (-cullPaddingX - 0.5) + && pos.x < camera.worldView.right + tilemapLayer.scaleX * layer.tileWidth * (cullPaddingX - 0.5) + && pos.y > camera.worldView.y + tilemapLayer.scaleY * layer.tileHeight * (-cullPaddingY - 1.0) + && pos.y < camera.worldView.bottom + tilemapLayer.scaleY * layer.tileHeight * (cullPaddingY - 0.5); +}; + +module.exports = CheckIsoBounds; diff --git a/src/tilemaps/components/Copy.js b/src/tilemaps/components/Copy.js index 5fc3993c3..16e7e1ac4 100644 --- a/src/tilemaps/components/Copy.js +++ b/src/tilemaps/components/Copy.js @@ -15,20 +15,21 @@ var CalculateFacesWithin = require('./CalculateFacesWithin'); * @function Phaser.Tilemaps.Components.Copy * @since 3.0.0 * - * @param {integer} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. - * @param {integer} width - The width of the area to copy, in tiles, not pixels. - * @param {integer} height - The height of the area to copy, in tiles, not pixels. - * @param {integer} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. - * @param {integer} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {number} srcTileX - The x coordinate of the area to copy from, in tiles, not pixels. + * @param {number} srcTileY - The y coordinate of the area to copy from, in tiles, not pixels. + * @param {number} width - The width of the area to copy, in tiles, not pixels. + * @param {number} height - The height of the area to copy, in tiles, not pixels. + * @param {number} destTileX - The x coordinate of the area to copy to, in tiles, not pixels. + * @param {number} destTileY - The y coordinate of the area to copy to, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Copy = function (srcTileX, srcTileY, width, height, destTileX, destTileY, recalculateFaces, layer) { + if (recalculateFaces === undefined) { recalculateFaces = true; } + if (srcTileX < 0) { srcTileX = 0; } if (srcTileY < 0) { srcTileY = 0; } - if (recalculateFaces === undefined) { recalculateFaces = true; } var srcTiles = GetTilesWithin(srcTileX, srcTileY, width, height, null, layer); diff --git a/src/tilemaps/components/CreateFromTiles.js b/src/tilemaps/components/CreateFromTiles.js index 0d7fbacb7..f86831206 100644 --- a/src/tilemaps/components/CreateFromTiles.js +++ b/src/tilemaps/components/CreateFromTiles.js @@ -4,8 +4,6 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var TileToWorldX = require('./TileToWorldX'); -var TileToWorldY = require('./TileToWorldY'); var GetTilesWithin = require('./GetTilesWithin'); var ReplaceByIndex = require('./ReplaceByIndex'); @@ -21,15 +19,15 @@ var ReplaceByIndex = require('./ReplaceByIndex'); * @param {(number|number[])} indexes - The tile index, or array of indexes, to create Sprites from. * @param {(number|number[])} replacements - The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY + * @param {Phaser.Scene} scene - The Scene to create the Sprites within. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when determining the world XY * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. */ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, camera, layer) { - if (spriteConfig === undefined) { spriteConfig = {}; } + if (!spriteConfig) { spriteConfig = {}; } if (!Array.isArray(indexes)) { @@ -38,8 +36,8 @@ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, came var tilemapLayer = layer.tilemapLayer; - if (scene === undefined) { scene = tilemapLayer.scene; } - if (camera === undefined) { camera = scene.cameras.main; } + if (!scene) { scene = tilemapLayer.scene; } + if (!camera) { camera = scene.cameras.main; } var tiles = GetTilesWithin(0, 0, layer.width, layer.height, null, layer); var sprites = []; @@ -51,8 +49,10 @@ var CreateFromTiles = function (indexes, replacements, spriteConfig, scene, came if (indexes.indexOf(tile.index) !== -1) { - spriteConfig.x = TileToWorldX(tile.x, camera, layer); - spriteConfig.y = TileToWorldY(tile.y, camera, layer); + var point = tilemapLayer.tileToWorldXY(tile.x, tile.y, undefined, camera,layer); + + spriteConfig.x = point.x; + spriteConfig.y = point.y; sprites.push(scene.make.sprite(spriteConfig)); } diff --git a/src/tilemaps/components/CullBounds.js b/src/tilemaps/components/CullBounds.js new file mode 100644 index 000000000..9817bc99f --- /dev/null +++ b/src/tilemaps/components/CullBounds.js @@ -0,0 +1,50 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Rectangle = require('../../geom/rectangle/Rectangle'); +var SnapCeil = require('../../math/snap/SnapCeil'); +var SnapFloor = require('../../math/snap/SnapFloor'); + +var bounds = new Rectangle(); + +/** + * Returns the bounds in the given orthogonal layer that are within the cameras viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.CullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {Phaser.Geom.Rectangle} A rectangle containing the culled bounds. If you wish to retain this object, clone it, as it's recycled internally. + */ +var CullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY; + + return bounds.setTo( + boundsLeft, + boundsTop, + (boundsRight - boundsLeft), + (boundsBottom - boundsTop) + ); +}; + +module.exports = CullBounds; diff --git a/src/tilemaps/components/CullTiles.js b/src/tilemaps/components/CullTiles.js index 15a1645ba..74ff84a73 100644 --- a/src/tilemaps/components/CullTiles.js +++ b/src/tilemaps/components/CullTiles.js @@ -4,18 +4,19 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var SnapFloor = require('../../math/snap/SnapFloor'); -var SnapCeil = require('../../math/snap/SnapCeil'); +var CullBounds = require('./CullBounds'); +var RunCull = require('./RunCull'); /** - * Returns the tiles in the given layer that are within the camera's viewport. This is used internally. + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. * * @function Phaser.Tilemaps.Components.CullTiles - * @since 3.0.0 + * @since 3.50.0 * * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. * * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. */ @@ -26,123 +27,21 @@ var CullTiles = function (layer, camera, outputArray, renderOrder) outputArray.length = 0; - var tilemap = layer.tilemapLayer.tilemap; var tilemapLayer = layer.tilemapLayer; - var mapData = layer.data; - var mapWidth = layer.width; - var mapHeight = layer.height; + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + var bounds = CullBounds(layer, camera); - // We need to use the tile sizes defined for the map as a whole, not the layer, - // in order to calculate the bounds correctly. As different sized tiles may be - // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. - var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); - var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); - - var drawLeft = 0; - var drawRight = mapWidth; - var drawTop = 0; - var drawBottom = mapHeight; - - if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + if (tilemapLayer.skipCull || tilemapLayer.scrollFactorX !== 1 || tilemapLayer.scrollFactorY !== 1) { - // Camera world view bounds, snapped for scaled tile size - // Cull Padding values are given in tiles, not pixels - - var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; - var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; - var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH, 0, true) - tilemapLayer.cullPaddingY; - var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH, 0, true) + tilemapLayer.cullPaddingY; - - drawLeft = Math.max(0, boundsLeft); - drawRight = Math.min(mapWidth, boundsRight); - drawTop = Math.max(0, boundsTop); - drawBottom = Math.min(mapHeight, boundsBottom); + bounds.left = 0; + bounds.right = layer.width; + bounds.top = 0; + bounds.bottom = layer.height; } - var x; - var y; - var tile; - - if (renderOrder === 0) - { - // right-down - - for (y = drawTop; y < drawBottom; y++) - { - for (x = drawLeft; mapData[y] && x < drawRight; x++) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 1) - { - // left-down - - for (y = drawTop; y < drawBottom; y++) - { - for (x = drawRight; mapData[y] && x >= drawLeft; x--) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 2) - { - // right-up - - for (y = drawBottom; y >= drawTop; y--) - { - for (x = drawLeft; mapData[y] && x < drawRight; x++) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - else if (renderOrder === 3) - { - // left-up - - for (y = drawBottom; y >= drawTop; y--) - { - for (x = drawRight; mapData[y] && x >= drawLeft; x--) - { - tile = mapData[y][x]; - - if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) - { - continue; - } - - outputArray.push(tile); - } - } - } - - tilemapLayer.tilesDrawn = outputArray.length; - tilemapLayer.tilesTotal = mapWidth * mapHeight; + RunCull(layer, bounds, renderOrder, outputArray); return outputArray; }; diff --git a/src/tilemaps/components/Fill.js b/src/tilemaps/components/Fill.js index 5598a593e..146e3aaeb 100644 --- a/src/tilemaps/components/Fill.js +++ b/src/tilemaps/components/Fill.js @@ -16,11 +16,11 @@ var SetTileCollision = require('./SetTileCollision'); * @function Phaser.Tilemaps.Components.Fill * @since 3.0.0 * - * @param {integer} index - The tile index to fill the area with. - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. + * @param {number} index - The tile index to fill the area with. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The tile layer to use. If not given the current layer is used. */ diff --git a/src/tilemaps/components/FilterTiles.js b/src/tilemaps/components/FilterTiles.js index 85d141303..c1fc53397 100644 --- a/src/tilemaps/components/FilterTiles.js +++ b/src/tilemaps/components/FilterTiles.js @@ -17,15 +17,12 @@ var GetTilesWithin = require('./GetTilesWithin'); * @param {function} callback - The callback. Each tile in the given area will be passed to this * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} The filtered array of Tiles. diff --git a/src/tilemaps/components/FindByIndex.js b/src/tilemaps/components/FindByIndex.js index 07c5d24f0..75338449d 100644 --- a/src/tilemaps/components/FindByIndex.js +++ b/src/tilemaps/components/FindByIndex.js @@ -14,10 +14,9 @@ * @function Phaser.Tilemaps.Components.FindByIndex * @since 3.0.0 * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. + * @param {number} index - The tile index value to search for. + * @param {number} skip - The number of times to skip a matching tile before returning. + * @param {boolean} reverse - If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} The first (or n skipped) tile with the matching index. diff --git a/src/tilemaps/components/FindTile.js b/src/tilemaps/components/FindTile.js index 8899f6954..167a48670 100644 --- a/src/tilemaps/components/FindTile.js +++ b/src/tilemaps/components/FindTile.js @@ -10,7 +10,7 @@ var GetTilesWithin = require('./GetTilesWithin'); * @callback FindTileCallback * * @param {Phaser.Tilemaps.Tile} value - The Tile. - * @param {integer} index - The index of the tile. + * @param {number} index - The index of the tile. * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. * * @return {boolean} Return `true` if the callback should run, otherwise `false`. @@ -25,15 +25,12 @@ var GetTilesWithin = require('./GetTilesWithin'); * @since 3.0.0 * * @param {FindTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?Phaser.Tilemaps.Tile} A Tile that matches the search, or null if no Tile found @@ -41,6 +38,7 @@ var GetTilesWithin = require('./GetTilesWithin'); var FindTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) { var tiles = GetTilesWithin(tileX, tileY, width, height, filteringOptions, layer); + return tiles.find(callback, context) || null; }; diff --git a/src/tilemaps/components/ForEachTile.js b/src/tilemaps/components/ForEachTile.js index 49d38910d..925b81745 100644 --- a/src/tilemaps/components/ForEachTile.js +++ b/src/tilemaps/components/ForEachTile.js @@ -10,7 +10,7 @@ var GetTilesWithin = require('./GetTilesWithin'); * @callback EachTileCallback * * @param {Phaser.Tilemaps.Tile} value - The Tile. - * @param {integer} index - The index of the tile. + * @param {number} index - The index of the tile. * @param {Phaser.Tilemaps.Tile[]} array - An array of Tile objects. */ @@ -22,15 +22,12 @@ var GetTilesWithin = require('./GetTilesWithin'); * @since 3.0.0 * * @param {EachTileCallback} callback - The callback. Each tile in the given area will be passed to this callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. + * @param {object} context - The context under which the callback should be run. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ForEachTile = function (callback, context, tileX, tileY, width, height, filteringOptions, layer) diff --git a/src/tilemaps/components/GetCullTilesFunction.js b/src/tilemaps/components/GetCullTilesFunction.js new file mode 100644 index 000000000..d3653ef01 --- /dev/null +++ b/src/tilemaps/components/GetCullTilesFunction.js @@ -0,0 +1,48 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); +var CullTiles = require('./CullTiles'); +var HexagonalCullTiles = require('./HexagonalCullTiles'); +var IsometricCullTiles = require('./IsometricCullTiles'); +var NOOP = require('../../utils/NOOP'); +var StaggeredCullTiles = require('./StaggeredCullTiles'); + +/** + * Gets the correct function to use to cull tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetCullTilesFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to cull tiles for the given map type. + */ +var GetCullTilesFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return CullTiles; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalCullTiles; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredCullTiles; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricCullTiles; + } + else + { + return NOOP; + } +}; + +module.exports = GetCullTilesFunction; diff --git a/src/tilemaps/components/GetTileAt.js b/src/tilemaps/components/GetTileAt.js index 4929580a2..74b10e0ae 100644 --- a/src/tilemaps/components/GetTileAt.js +++ b/src/tilemaps/components/GetTileAt.js @@ -12,13 +12,12 @@ var IsInLayerBounds = require('./IsInLayerBounds'); * @function Phaser.Tilemaps.Components.GetTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {boolean} nonNull - If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ var GetTileAt = function (tileX, tileY, nonNull, layer) { @@ -27,7 +26,8 @@ var GetTileAt = function (tileX, tileY, nonNull, layer) if (IsInLayerBounds(tileX, tileY, layer)) { var tile = layer.data[tileY][tileX] || null; - if (tile === null) + + if (!tile) { return null; } diff --git a/src/tilemaps/components/GetTileAtWorldXY.js b/src/tilemaps/components/GetTileAtWorldXY.js index a24c1ee43..d2929e4ee 100644 --- a/src/tilemaps/components/GetTileAtWorldXY.js +++ b/src/tilemaps/components/GetTileAtWorldXY.js @@ -5,8 +5,9 @@ */ var GetTileAt = require('./GetTileAt'); -var WorldToTileX = require('./WorldToTileX'); -var WorldToTileY = require('./WorldToTileY'); +var Vector2 = require('../../math/Vector2'); + +var point = new Vector2(); /** * Gets a tile at the given world coordinates from the given layer. @@ -16,19 +17,17 @@ var WorldToTileY = require('./WorldToTileY'); * * @param {number} worldX - X position to get the tile from (given in pixels) * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} nonNull - If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. + * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. */ var GetTileAtWorldXY = function (worldX, worldY, nonNull, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera); - return GetTileAt(tileX, tileY, nonNull, layer); + return GetTileAt(point.x, point.y, nonNull, layer); }; module.exports = GetTileAtWorldXY; diff --git a/src/tilemaps/components/GetTileToWorldXFunction.js b/src/tilemaps/components/GetTileToWorldXFunction.js new file mode 100644 index 000000000..8c9a8b574 --- /dev/null +++ b/src/tilemaps/components/GetTileToWorldXFunction.js @@ -0,0 +1,33 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); +var NOOP = require('../../utils/NOOP'); +var TileToWorldX = require('./TileToWorldX'); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetTileToWorldXFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetTileToWorldXFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldX; + } + else + { + return NOOP; + } +}; + +module.exports = GetTileToWorldXFunction; diff --git a/src/tilemaps/components/GetTileToWorldXYFunction.js b/src/tilemaps/components/GetTileToWorldXYFunction.js new file mode 100644 index 000000000..6aafd8d63 --- /dev/null +++ b/src/tilemaps/components/GetTileToWorldXYFunction.js @@ -0,0 +1,48 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); +var HexagonalTileToWorldXY = require('./HexagonalTileToWorldXY'); +var IsometricTileToWorldXY = require('./IsometricTileToWorldXY'); +var NOOP = require('../../utils/NOOP'); +var StaggeredTileToWorldXY = require('./StaggeredTileToWorldXY'); +var TileToWorldXY = require('./TileToWorldXY'); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetTileToWorldXYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetTileToWorldXYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldXY; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricTileToWorldXY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalTileToWorldXY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredTileToWorldXY; + } + else + { + return NOOP; + } +}; + +module.exports = GetTileToWorldXYFunction; diff --git a/src/tilemaps/components/GetTileToWorldYFunction.js b/src/tilemaps/components/GetTileToWorldYFunction.js new file mode 100644 index 000000000..ae0661fae --- /dev/null +++ b/src/tilemaps/components/GetTileToWorldYFunction.js @@ -0,0 +1,43 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); +var HexagonalTileToWorldY = require('./HexagonalTileToWorldY'); +var NOOP = require('../../utils/NOOP'); +var StaggeredTileToWorldY = require('./StaggeredTileToWorldY'); +var TileToWorldY = require('./TileToWorldY'); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetTileToWorldYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetTileToWorldYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return TileToWorldY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalTileToWorldY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredTileToWorldY; + } + else + { + return NOOP; + } +}; + +module.exports = GetTileToWorldYFunction; diff --git a/src/tilemaps/components/GetTilesWithin.js b/src/tilemaps/components/GetTilesWithin.js index c8cec51fa..3d765e339 100644 --- a/src/tilemaps/components/GetTilesWithin.js +++ b/src/tilemaps/components/GetTilesWithin.js @@ -12,11 +12,11 @@ var GetFastValue = require('../../utils/object/GetFastValue'); * @function Phaser.Tilemaps.Components.GetTilesWithin * @since 3.0.0 * - * @param {integer} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.GetTilesWithinFilteringOptions} GetTilesWithinFilteringOptions - Optional filters to apply when getting the tiles. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -27,6 +27,7 @@ var GetTilesWithin = function (tileX, tileY, width, height, filteringOptions, la if (tileY === undefined) { tileY = 0; } if (width === undefined) { width = layer.width; } if (height === undefined) { height = layer.height; } + if (!filteringOptions) { filteringOptions = {}; } var isNotEmpty = GetFastValue(filteringOptions, 'isNotEmpty', false); var isColliding = GetFastValue(filteringOptions, 'isColliding', false); diff --git a/src/tilemaps/components/GetTilesWithinShape.js b/src/tilemaps/components/GetTilesWithinShape.js index e1beab18d..0678cb72b 100644 --- a/src/tilemaps/components/GetTilesWithinShape.js +++ b/src/tilemaps/components/GetTilesWithinShape.js @@ -8,18 +8,16 @@ var Geom = require('../../geom/'); var GetTilesWithin = require('./GetTilesWithin'); var Intersects = require('../../geom/intersects/'); var NOOP = require('../../utils/NOOP'); -var TileToWorldX = require('./TileToWorldX'); -var TileToWorldY = require('./TileToWorldY'); -var WorldToTileX = require('./WorldToTileX'); -var WorldToTileY = require('./WorldToTileY'); +var Vector2 = require('../../math/Vector2'); var TriangleToRectangle = function (triangle, rect) { return Intersects.RectangleToTriangle(rect, triangle); }; -// Note: Could possibly be optimized by copying the shape and shifting it into tilemapLayer -// coordinates instead of shifting the tiles. +var point = new Vector2(); +var pointStart = new Vector2(); +var pointEnd = new Vector2(); /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, @@ -29,11 +27,8 @@ var TriangleToRectangle = function (triangle, rect) * @since 3.0.0 * * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. @@ -45,45 +40,40 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) // intersectTest is a function with parameters: shape, rect var intersectTest = NOOP; - switch (typeof(shape)) + if (shape instanceof Geom.Circle) { - case Geom.Circle: - { - intersectTest = Intersects.CircleToRectangle; - break; - } - - case Geom.Rectangle: - { - intersectTest = Intersects.RectangleToRectangle; - break; - } - - case Geom.Triangle: - { - intersectTest = TriangleToRectangle; - break; - } - - case Geom.Line: - { - intersectTest = Intersects.LineToRectangle; - break; - } + intersectTest = Intersects.CircleToRectangle; + } + else if (shape instanceof Geom.Rectangle) + { + intersectTest = Intersects.RectangleToRectangle; + } + else if (shape instanceof Geom.Triangle) + { + intersectTest = TriangleToRectangle; + } + else if (shape instanceof Geom.Line) + { + intersectTest = Intersects.LineToRectangle; } // Top left corner of the shapes's bounding box, rounded down to include partial tiles - var xStart = WorldToTileX(shape.left, true, camera, layer); - var yStart = WorldToTileY(shape.top, true, camera, layer); + layer.tilemapLayer.worldToTileXY(shape.left, shape.top, true, pointStart, camera); + + var xStart = pointStart.x; + var yStart = pointStart.y; // Bottom right corner of the shapes's bounding box, rounded up to include partial tiles - var xEnd = Math.ceil(WorldToTileX(shape.right, false, camera, layer)); - var yEnd = Math.ceil(WorldToTileY(shape.bottom, false, camera, layer)); + layer.tilemapLayer.worldToTileXY(shape.right, shape.bottom, true, pointEnd, camera); + + var xEnd = Math.ceil(pointEnd.x); + var yEnd = Math.ceil(pointEnd.y); // Tiles within bounding rectangle of shape. Bounds are forced to be at least 1 x 1 tile in size // to grab tiles for shapes that don't have a height or width (e.g. a horizontal line). var width = Math.max(xEnd - xStart, 1); var height = Math.max(yEnd - yStart, 1); + var tiles = GetTilesWithin(xStart, yStart, width, height, filteringOptions, layer); var tileWidth = layer.tileWidth; @@ -102,8 +92,10 @@ var GetTilesWithinShape = function (shape, filteringOptions, camera, layer) { var tile = tiles[i]; - tileRect.x = TileToWorldX(tile.x, camera, layer); - tileRect.y = TileToWorldY(tile.y, camera, layer); + layer.tilemapLayer.tileToWorldXY(tile.x, tile.y, point, camera); + + tileRect.x = point.x; + tileRect.y = point.y; if (intersectTest(shape, tileRect)) { diff --git a/src/tilemaps/components/GetTilesWithinWorldXY.js b/src/tilemaps/components/GetTilesWithinWorldXY.js index 50815fda3..2e52f5cf4 100644 --- a/src/tilemaps/components/GetTilesWithinWorldXY.js +++ b/src/tilemaps/components/GetTilesWithinWorldXY.js @@ -5,8 +5,10 @@ */ var GetTilesWithin = require('./GetTilesWithin'); -var WorldToTileX = require('./WorldToTileX'); -var WorldToTileY = require('./WorldToTileY'); +var Vector2 = require('../../math/Vector2'); + +var pointStart = new Vector2(); +var pointEnd = new Vector2(); /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -18,24 +20,27 @@ var WorldToTileY = require('./WorldToTileY'); * @param {number} worldY - The world y coordinate for the top-left of the area. * @param {number} width - The width of the area. * @param {number} height - The height of the area. - * @param {object} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {boolean} [filteringOptions.isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @param {boolean} [filteringOptions.isColliding=false] - If true, only return tiles that collide on at least one side. - * @param {boolean} [filteringOptions.hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Types.Tilemaps.FilteringOptions} filteringOptions - Optional filters to apply when getting the tiles. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile[]} Array of Tile objects. */ var GetTilesWithinWorldXY = function (worldX, worldY, width, height, filteringOptions, camera, layer) { - // Top left corner of the rect, rounded down to include partial tiles - var xStart = WorldToTileX(worldX, true, camera, layer); - var yStart = WorldToTileY(worldY, true, camera, layer); + var worldToTileXY = layer.tilemapLayer.tilemap._convert.WorldToTileXY; - // Bottom right corner of the rect, rounded up to include partial tiles - var xEnd = Math.ceil(WorldToTileX(worldX + width, false, camera, layer)); - var yEnd = Math.ceil(WorldToTileY(worldY + height, false, camera, layer)); + // Top left corner of the rect, rounded down to include partial tiles + worldToTileXY(worldX, worldY, true, pointStart, camera, layer); + + var xStart = pointStart.x; + var yStart = pointStart.y; + + // Bottom right corner of the rect, rounded up to include partial tiles + worldToTileXY(worldX + width, worldY + height, false, pointEnd, camera, layer); + + var xEnd = Math.ceil(pointEnd.x); + var yEnd = Math.ceil(pointEnd.y); return GetTilesWithin(xStart, yStart, xEnd - xStart, yEnd - yStart, filteringOptions, layer); }; diff --git a/src/tilemaps/components/GetWorldToTileXFunction.js b/src/tilemaps/components/GetWorldToTileXFunction.js new file mode 100644 index 000000000..07377a7f4 --- /dev/null +++ b/src/tilemaps/components/GetWorldToTileXFunction.js @@ -0,0 +1,33 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); +var NOOP = require('../../utils/NOOP'); +var WorldToTileX = require('./WorldToTileX'); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileXFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileXFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileX; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileXFunction; diff --git a/src/tilemaps/components/GetWorldToTileXYFunction.js b/src/tilemaps/components/GetWorldToTileXYFunction.js new file mode 100644 index 000000000..b1d2243c9 --- /dev/null +++ b/src/tilemaps/components/GetWorldToTileXYFunction.js @@ -0,0 +1,48 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); +var HexagonalWorldToTileXY = require('./HexagonalWorldToTileXY'); +var IsometricWorldToTileXY = require('./IsometricWorldToTileXY'); +var NOOP = require('../../utils/NOOP'); +var StaggeredWorldToTileXY = require('./StaggeredWorldToTileXY'); +var WorldToTileXY = require('./WorldToTileXY'); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileXYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileXYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileXY; + } + else if (orientation === CONST.ISOMETRIC) + { + return IsometricWorldToTileXY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalWorldToTileXY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredWorldToTileXY; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileXYFunction; diff --git a/src/tilemaps/components/GetWorldToTileYFunction.js b/src/tilemaps/components/GetWorldToTileYFunction.js new file mode 100644 index 000000000..dfc343536 --- /dev/null +++ b/src/tilemaps/components/GetWorldToTileYFunction.js @@ -0,0 +1,43 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); +var HexagonalWorldToTileY = require('./HexagonalWorldToTileY'); +var NOOP = require('../../utils/NOOP'); +var StaggeredWorldToTileY = require('./StaggeredWorldToTileY'); +var WorldToTileY = require('./WorldToTileY'); + +/** + * Gets the correct function to use to translate tiles, based on the map orientation. + * + * @function Phaser.Tilemaps.Components.GetWorldToTileYFunction + * @since 3.50.0 + * + * @param {number} orientation - The Tilemap orientation constant. + * + * @return {function} The function to use to translate tiles for the given map type. + */ +var GetWorldToTileYFunction = function (orientation) +{ + if (orientation === CONST.ORTHOGONAL) + { + return WorldToTileY; + } + else if (orientation === CONST.HEXAGONAL) + { + return HexagonalWorldToTileY; + } + else if (orientation === CONST.STAGGERED) + { + return StaggeredWorldToTileY; + } + else + { + return NOOP; + } +}; + +module.exports = GetWorldToTileYFunction; diff --git a/src/tilemaps/components/HasTileAt.js b/src/tilemaps/components/HasTileAt.js index 567e1e9b2..5d9d6e0f9 100644 --- a/src/tilemaps/components/HasTileAt.js +++ b/src/tilemaps/components/HasTileAt.js @@ -13,8 +13,8 @@ var IsInLayerBounds = require('./IsInLayerBounds'); * @function Phaser.Tilemaps.Components.HasTileAt * @since 3.0.0 * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). + * @param {number} tileX - X position to get the tile from (given in tile units, not pixels). + * @param {number} tileY - Y position to get the tile from (given in tile units, not pixels). * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. diff --git a/src/tilemaps/components/HasTileAtWorldXY.js b/src/tilemaps/components/HasTileAtWorldXY.js index b52cfe6dc..9a179ad9f 100644 --- a/src/tilemaps/components/HasTileAtWorldXY.js +++ b/src/tilemaps/components/HasTileAtWorldXY.js @@ -5,8 +5,9 @@ */ var HasTileAt = require('./HasTileAt'); -var WorldToTileX = require('./WorldToTileX'); -var WorldToTileY = require('./WorldToTileY'); +var Vector2 = require('../../math/Vector2'); + +var point = new Vector2(); /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns @@ -17,15 +18,17 @@ var WorldToTileY = require('./WorldToTileY'); * * @param {number} worldX - The X coordinate of the world position. * @param {number} worldY - The Y coordinate of the world position. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when factoring in which tiles to return. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {?boolean} Returns a boolean, or null if the layer given was invalid. */ var HasTileAtWorldXY = function (worldX, worldY, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera); + + var tileX = point.x; + var tileY = point.y; return HasTileAt(tileX, tileY, layer); }; diff --git a/src/tilemaps/components/HexagonalCullBounds.js b/src/tilemaps/components/HexagonalCullBounds.js new file mode 100644 index 000000000..64d827fb9 --- /dev/null +++ b/src/tilemaps/components/HexagonalCullBounds.js @@ -0,0 +1,50 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SnapCeil = require('../../math/snap/SnapCeil'); +var SnapFloor = require('../../math/snap/SnapFloor'); + +/** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.HexagonalCullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {object} An object containing the `left`, `right`, `top` and `bottom` bounds. + */ +var HexagonalCullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var len = layer.hexSideLength; + var rowH = ((tileH - len) / 2 + len); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, rowH, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, rowH, 0, true) + tilemapLayer.cullPaddingY; + + return { + left: boundsLeft, + right: boundsRight, + top: boundsTop, + bottom: boundsBottom + }; +}; + +module.exports = HexagonalCullBounds; diff --git a/src/tilemaps/components/HexagonalCullTiles.js b/src/tilemaps/components/HexagonalCullTiles.js new file mode 100644 index 000000000..12eeb5e7a --- /dev/null +++ b/src/tilemaps/components/HexagonalCullTiles.js @@ -0,0 +1,45 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = require('./HexagonalCullBounds'); +var RunCull = require('./RunCull'); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.HexagonalCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var HexagonalCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + { + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + + var bounds = CullBounds(layer, camera); + + RunCull(layer, bounds, renderOrder, outputArray); + } + + return outputArray; +}; + +module.exports = HexagonalCullTiles; diff --git a/src/tilemaps/components/HexagonalTileToWorldXY.js b/src/tilemaps/components/HexagonalTileToWorldXY.js new file mode 100644 index 000000000..8090d1cbe --- /dev/null +++ b/src/tilemaps/components/HexagonalTileToWorldXY.js @@ -0,0 +1,59 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = require('../../math/Vector2'); + +/** + * Converts from hexagonal tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.HexagonalTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var HexagonalTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = layer.hexSideLength; + var rowHeight = ((tileHeight - len) / 2 + len); + + // similar to staggered, because Tiled uses the oddr representation. + var x = layerWorldX + tileX * tileWidth + tileY % 2 * (tileWidth / 2); + var y = layerWorldY + tileY * rowHeight; + + return point.set(x, y); +}; + +module.exports = HexagonalTileToWorldXY; diff --git a/src/tilemaps/components/HexagonalTileToWorldY.js b/src/tilemaps/components/HexagonalTileToWorldY.js new file mode 100644 index 000000000..20501da3a --- /dev/null +++ b/src/tilemaps/components/HexagonalTileToWorldY.js @@ -0,0 +1,42 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from hexagonal tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.HexagonalTileToWorldY + * @since 3.50.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var HexagonalTileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = tilemapLayer.tilemap.hexSideLength; + + var rowHeight = ((tileHeight - len) / 2 + len); + + return layerWorldY + tileY * rowHeight; +}; + +module.exports = HexagonalTileToWorldY; diff --git a/src/tilemaps/components/HexagonalWorldToTileXY.js b/src/tilemaps/components/HexagonalWorldToTileXY.js new file mode 100644 index 000000000..5024eef3f --- /dev/null +++ b/src/tilemaps/components/HexagonalWorldToTileXY.js @@ -0,0 +1,63 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = require('../../math/Vector2'); + +/** + * Converts from world XY coordinates (pixels) to hexagonal tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.HexagonalWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinates down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var HexagonalWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + var len = layer.hexSideLength; + var rowHeight = ((tileHeight - len) / 2 + len); + + // similar to staggered, because Tiled uses the oddr representation. + var y = (snapToFloor) ? Math.floor((worldY / rowHeight)) : (worldY / rowHeight); + var x = (snapToFloor) ? Math.floor((worldX - (y % 2) * 0.5 * tileWidth) / tileWidth) : (worldX - (y % 2) * 0.5 * tileWidth) / tileWidth; + + return point.set(x, y); +}; + +module.exports = HexagonalWorldToTileXY; diff --git a/src/tilemaps/components/HexagonalWorldToTileY.js b/src/tilemaps/components/HexagonalWorldToTileY.js new file mode 100644 index 000000000..0f084551d --- /dev/null +++ b/src/tilemaps/components/HexagonalWorldToTileY.js @@ -0,0 +1,45 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to hexagonal tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.HexagonalWorldToTileY + * @since 3.50.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var HexagonalWorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var len = layer.hexSideLength; + + var rowHeight = ((tileHeight - len) / 2 + len); + + return (snapToFloor) ? Math.floor(worldY / rowHeight) : worldY / rowHeight; +}; + +module.exports = HexagonalWorldToTileY; diff --git a/src/tilemaps/components/IsInLayerBounds.js b/src/tilemaps/components/IsInLayerBounds.js index 8b78e9d14..5c631411c 100644 --- a/src/tilemaps/components/IsInLayerBounds.js +++ b/src/tilemaps/components/IsInLayerBounds.js @@ -10,8 +10,8 @@ * @function Phaser.Tilemaps.Components.IsInLayerBounds * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {boolean} `true` if the tile coordinates are within the bounds of the layer, otherwise `false`. diff --git a/src/tilemaps/components/IsometricCullTiles.js b/src/tilemaps/components/IsometricCullTiles.js new file mode 100644 index 000000000..f8d67f469 --- /dev/null +++ b/src/tilemaps/components/IsometricCullTiles.js @@ -0,0 +1,142 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CheckIsoBounds = require('./CheckIsoBounds'); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.IsometricCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var IsometricCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + + var drawLeft = 0; + var drawRight = mapWidth; + var drawTop = 0; + var drawBottom = mapHeight; + + if (!tilemapLayer.skipCull) + { + var x; + var y; + var tile; + + if (renderOrder === 0) + { + // right-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + if (CheckIsoBounds(x, y, layer, camera)) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + } + } + + tilemapLayer.tilesDrawn = outputArray.length; + tilemapLayer.tilesTotal = mapWidth * mapHeight; + + return outputArray; +}; + +module.exports = IsometricCullTiles; diff --git a/src/tilemaps/components/IsometricTileToWorldXY.js b/src/tilemaps/components/IsometricTileToWorldXY.js new file mode 100644 index 000000000..6f04743c0 --- /dev/null +++ b/src/tilemaps/components/IsometricTileToWorldXY.js @@ -0,0 +1,55 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = require('../../math/Vector2'); + +/** + * Converts from isometric tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.IsometricTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var IsometricTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var x = layerWorldX + (tileX - tileY) * (tileWidth / 2); + var y = layerWorldY + (tileX + tileY) * (tileHeight / 2); + + return point.set(x, y); +}; + +module.exports = IsometricTileToWorldXY; diff --git a/src/tilemaps/components/IsometricWorldToTileXY.js b/src/tilemaps/components/IsometricWorldToTileXY.js new file mode 100644 index 000000000..fa3757424 --- /dev/null +++ b/src/tilemaps/components/IsometricWorldToTileXY.js @@ -0,0 +1,61 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = require('../../math/Vector2'); + +/** + * Converts from world XY coordinates (pixels) to isometric tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.IsometricWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var IsometricWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + worldX -= tileWidth / 2; + + var x = (snapToFloor) ? Math.floor((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2) : ((worldX / (tileWidth / 2) + worldY / (tileHeight / 2)) / 2); + var y = (snapToFloor) ? Math.floor((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2) : ((worldY / (tileHeight / 2) - worldX / (tileWidth / 2)) / 2); + + return point.set(x, y); +}; + +module.exports = IsometricWorldToTileXY; diff --git a/src/tilemaps/components/PutTileAt.js b/src/tilemaps/components/PutTileAt.js index d9b632c45..29028990e 100644 --- a/src/tilemaps/components/PutTileAt.js +++ b/src/tilemaps/components/PutTileAt.js @@ -18,19 +18,23 @@ var SetTileCollision = require('./SetTileCollision'); * @function Phaser.Tilemaps.Components.PutTileAt * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) { - if (!IsInLayerBounds(tileX, tileY, layer)) { return null; } if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!IsInLayerBounds(tileX, tileY, layer)) + { + return null; + } + var oldTile = layer.data[tileY][tileX]; var oldTileCollides = oldTile && oldTile.collides; @@ -38,7 +42,7 @@ var PutTileAt = function (tile, tileX, tileY, recalculateFaces, layer) { if (layer.data[tileY][tileX] === null) { - layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, tile.width, tile.height); + layer.data[tileY][tileX] = new Tile(layer, tile.index, tileX, tileY, layer.tileWidth, layer.tileHeight); } layer.data[tileY][tileX].copy(tile); diff --git a/src/tilemaps/components/PutTileAtWorldXY.js b/src/tilemaps/components/PutTileAtWorldXY.js index 97d627b1d..e7aa561fd 100644 --- a/src/tilemaps/components/PutTileAtWorldXY.js +++ b/src/tilemaps/components/PutTileAtWorldXY.js @@ -5,8 +5,9 @@ */ var PutTileAt = require('./PutTileAt'); -var WorldToTileX = require('./WorldToTileX'); -var WorldToTileY = require('./WorldToTileY'); +var Vector2 = require('../../math/Vector2'); + +var point = new Vector2(); /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -17,21 +18,20 @@ var WorldToTileY = require('./WorldToTileY'); * @function Phaser.Tilemaps.Components.PutTileAtWorldXY * @since 3.0.0 * - * @param {(integer|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. + * @param {(number|Phaser.Tilemaps.Tile)} tile - The index of this tile to set or a Tile object. * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was created or added to this map. */ var PutTileAtWorldXY = function (tile, worldX, worldY, recalculateFaces, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera, layer); - return PutTileAt(tile, tileX, tileY, recalculateFaces, layer); + return PutTileAt(tile, point.x, point.y, recalculateFaces, layer); }; module.exports = PutTileAtWorldXY; diff --git a/src/tilemaps/components/PutTilesAt.js b/src/tilemaps/components/PutTilesAt.js index 779ef736b..012592c6d 100644 --- a/src/tilemaps/components/PutTilesAt.js +++ b/src/tilemaps/components/PutTilesAt.js @@ -17,17 +17,21 @@ var PutTileAt = require('./PutTileAt'); * @function Phaser.Tilemaps.Components.PutTilesAt * @since 3.0.0 * - * @param {(integer[]|integer[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {(number[]|number[][]|Phaser.Tilemaps.Tile[]|Phaser.Tilemaps.Tile[][])} tile - A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var PutTilesAt = function (tilesArray, tileX, tileY, recalculateFaces, layer) { - if (!Array.isArray(tilesArray)) { return null; } if (recalculateFaces === undefined) { recalculateFaces = true; } + if (!Array.isArray(tilesArray)) + { + return null; + } + // Force the input array to be a 2D array if (!Array.isArray(tilesArray[0])) { diff --git a/src/tilemaps/components/Randomize.js b/src/tilemaps/components/Randomize.js index dca996bfa..2afbe5c4e 100644 --- a/src/tilemaps/components/Randomize.js +++ b/src/tilemaps/components/Randomize.js @@ -17,20 +17,20 @@ var GetRandom = require('../../utils/array/GetRandom'); * @function Phaser.Tilemaps.Components.Randomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {integer[]} [indexes] - An array of indexes to randomly draw from during randomization. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {number[]} indexes - An array of indexes to randomly draw from during randomization. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Randomize = function (tileX, tileY, width, height, indexes, layer) { var i; - var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); + var tiles = GetTilesWithin(tileX, tileY, width, height, {}, layer); // If no indices are given, then find all the unique indexes within the specified region - if (indexes === undefined) + if (!indexes) { indexes = []; diff --git a/src/tilemaps/components/RemoveTileAt.js b/src/tilemaps/components/RemoveTileAt.js index 93d15bf12..be19384ea 100644 --- a/src/tilemaps/components/RemoveTileAt.js +++ b/src/tilemaps/components/RemoveTileAt.js @@ -15,17 +15,17 @@ var CalculateFacesAt = require('./CalculateFacesAt'); * @function Phaser.Tilemaps.Components.RemoveTileAt * @since 3.0.0 * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. + * @param {number} tileX - The x coordinate. + * @param {number} tileY - The y coordinate. + * @param {boolean} replaceWithNull - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, layer) { - if (replaceWithNull === undefined) { replaceWithNull = false; } + if (replaceWithNull === undefined) { replaceWithNull = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } if (!IsInLayerBounds(tileX, tileY, layer)) @@ -41,7 +41,7 @@ var RemoveTileAt = function (tileX, tileY, replaceWithNull, recalculateFaces, la } else { - layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, tile.width, tile.height); + layer.data[tileY][tileX] = (replaceWithNull) ? null : new Tile(layer, -1, tileX, tileY, layer.tileWidth, layer.tileHeight); } // Recalculate faces only if the removed tile was a colliding tile diff --git a/src/tilemaps/components/RemoveTileAtWorldXY.js b/src/tilemaps/components/RemoveTileAtWorldXY.js index 5e7319ccc..90764ce83 100644 --- a/src/tilemaps/components/RemoveTileAtWorldXY.js +++ b/src/tilemaps/components/RemoveTileAtWorldXY.js @@ -5,8 +5,9 @@ */ var RemoveTileAt = require('./RemoveTileAt'); -var WorldToTileX = require('./WorldToTileX'); -var WorldToTileY = require('./WorldToTileY'); +var Vector2 = require('../../math/Vector2'); + +var point = new Vector2(); /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's @@ -17,19 +18,18 @@ var WorldToTileY = require('./WorldToTileY'); * * @param {number} worldX - The x coordinate, in pixels. * @param {number} worldY - The y coordinate, in pixels. - * @param {boolean} [replaceWithNull=true] - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. - * @param {boolean} [recalculateFaces=true] - `true` if the faces data should be recalculated. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} replaceWithNull - If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param {boolean} recalculateFaces - `true` if the faces data should be recalculated. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Tilemaps.Tile} The Tile object that was removed. */ var RemoveTileAtWorldXY = function (worldX, worldY, replaceWithNull, recalculateFaces, camera, layer) { - var tileX = WorldToTileX(worldX, true, camera, layer); - var tileY = WorldToTileY(worldY, true, camera, layer); + layer.tilemapLayer.worldToTileXY(worldX, worldY, true, point, camera, layer); - return RemoveTileAt(tileX, tileY, replaceWithNull, recalculateFaces, layer); + return RemoveTileAt(point.x, point.y, replaceWithNull, recalculateFaces, layer); }; module.exports = RemoveTileAtWorldXY; diff --git a/src/tilemaps/components/RenderDebug.js b/src/tilemaps/components/RenderDebug.js index 778d44fa8..041f9319e 100644 --- a/src/tilemaps/components/RenderDebug.js +++ b/src/tilemaps/components/RenderDebug.js @@ -21,13 +21,7 @@ var defaultFaceColor = new Color(40, 39, 37, 150); * @since 3.0.0 * * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {object} styleConfig - An object specifying the colors to use for the debug drawing. - * @param {?Phaser.Display.Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at - * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. - * @param {?Phaser.Display.Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled - * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. - * @param {?Phaser.Display.Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting - * tile faces. If set to null, interesting tile faces will not be drawn. + * @param {Phaser.Types.Tilemaps.DebugStyleOptions} styleConfig - An object specifying the colors to use for the debug drawing. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var RenderDebug = function (graphics, styleConfig, layer) diff --git a/src/tilemaps/components/ReplaceByIndex.js b/src/tilemaps/components/ReplaceByIndex.js index fc5e4b0b5..e70c8944f 100644 --- a/src/tilemaps/components/ReplaceByIndex.js +++ b/src/tilemaps/components/ReplaceByIndex.js @@ -14,12 +14,12 @@ var GetTilesWithin = require('./GetTilesWithin'); * @function Phaser.Tilemaps.Components.ReplaceByIndex * @since 3.0.0 * - * @param {integer} findIndex - The index of the tile to search for. - * @param {integer} newIndex - The index of the tile to replace it with. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} findIndex - The index of the tile to search for. + * @param {number} newIndex - The index of the tile to replace it with. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var ReplaceByIndex = function (findIndex, newIndex, tileX, tileY, width, height, layer) diff --git a/src/tilemaps/components/RunCull.js b/src/tilemaps/components/RunCull.js new file mode 100644 index 000000000..5a20e862b --- /dev/null +++ b/src/tilemaps/components/RunCull.js @@ -0,0 +1,120 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.RunCull + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {object} bounds - An object containing the `left`, `right`, `top` and `bottom` bounds. + * @param {number} renderOrder - The rendering order constant. + * @param {array} outputArray - The array to store the Tile objects within. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var RunCull = function (layer, bounds, renderOrder, outputArray) +{ + var mapData = layer.data; + var mapWidth = layer.width; + var mapHeight = layer.height; + + var tilemapLayer = layer.tilemapLayer; + + var drawLeft = Math.max(0, bounds.left); + var drawRight = Math.min(mapWidth, bounds.right); + var drawTop = Math.max(0, bounds.top); + var drawBottom = Math.min(mapHeight, bounds.bottom); + + var x; + var y; + var tile; + + if (renderOrder === 0) + { + // right-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 1) + { + // left-down + + for (y = drawTop; y < drawBottom; y++) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 2) + { + // right-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawLeft; mapData[y] && x < drawRight; x++) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + else if (renderOrder === 3) + { + // left-up + + for (y = drawBottom; y >= drawTop; y--) + { + for (x = drawRight; mapData[y] && x >= drawLeft; x--) + { + tile = mapData[y][x]; + + if (!tile || tile.index === -1 || !tile.visible || tile.alpha === 0) + { + continue; + } + + outputArray.push(tile); + } + } + } + + tilemapLayer.tilesDrawn = outputArray.length; + tilemapLayer.tilesTotal = mapWidth * mapHeight; + + return outputArray; +}; + +module.exports = RunCull; diff --git a/src/tilemaps/components/SetCollision.js b/src/tilemaps/components/SetCollision.js index a6f5bb97b..c23689a26 100644 --- a/src/tilemaps/components/SetCollision.js +++ b/src/tilemaps/components/SetCollision.js @@ -16,20 +16,23 @@ var SetLayerCollisionIndex = require('./SetLayerCollisionIndex'); * @function Phaser.Tilemaps.Components.SetCollision * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {boolean} updateLayer - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. */ var SetCollision = function (indexes, collides, recalculateFaces, layer, updateLayer) { if (collides === undefined) { collides = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } - if (!Array.isArray(indexes)) { indexes = [ indexes ]; } if (updateLayer === undefined) { updateLayer = true; } + if (!Array.isArray(indexes)) + { + indexes = [ indexes ]; + } + // Update the array of colliding indexes for (var i = 0; i < indexes.length; i++) { diff --git a/src/tilemaps/components/SetCollisionBetween.js b/src/tilemaps/components/SetCollisionBetween.js index 96fc82544..c94afb9eb 100644 --- a/src/tilemaps/components/SetCollisionBetween.js +++ b/src/tilemaps/components/SetCollisionBetween.js @@ -17,13 +17,12 @@ var SetLayerCollisionIndex = require('./SetLayerCollisionIndex'); * @function Phaser.Tilemaps.Components.SetCollisionBetween * @since 3.0.0 * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {number} start - The first index of the tile to be set for collision. + * @param {number} stop - The last index of the tile to be set for collision. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. + * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. */ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, layer, updateLayer) { @@ -31,15 +30,18 @@ var SetCollisionBetween = function (start, stop, collides, recalculateFaces, lay if (recalculateFaces === undefined) { recalculateFaces = true; } if (updateLayer === undefined) { updateLayer = true; } - if (start > stop) { return; } + if (start > stop) + { + return; + } - // Update the array of colliding indexes + // Update the array of colliding indexes for (var index = start; index <= stop; index++) { SetLayerCollisionIndex(index, collides, layer); } - // Update the tiles + // Update the tiles if (updateLayer) { for (var ty = 0; ty < layer.height; ty++) diff --git a/src/tilemaps/components/SetCollisionByExclusion.js b/src/tilemaps/components/SetCollisionByExclusion.js index 0d9e60d84..6ead5cbc8 100644 --- a/src/tilemaps/components/SetCollisionByExclusion.js +++ b/src/tilemaps/components/SetCollisionByExclusion.js @@ -16,16 +16,20 @@ var SetLayerCollisionIndex = require('./SetLayerCollisionIndex'); * @function Phaser.Tilemaps.Components.SetCollisionByExclusion * @since 3.0.0 * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {number[]} indexes - An array of the tile indexes to not be counted for collision. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, layer) { if (collides === undefined) { collides = true; } if (recalculateFaces === undefined) { recalculateFaces = true; } - if (!Array.isArray(indexes)) { indexes = [ indexes ]; } + + if (!Array.isArray(indexes)) + { + indexes = [ indexes ]; + } // Note: this only updates layer.collideIndexes for tile indexes found currently in the layer for (var ty = 0; ty < layer.height; ty++) @@ -33,6 +37,7 @@ var SetCollisionByExclusion = function (indexes, collides, recalculateFaces, lay for (var tx = 0; tx < layer.width; tx++) { var tile = layer.data[ty][tx]; + if (tile && indexes.indexOf(tile.index) === -1) { SetTileCollision(tile, collides); diff --git a/src/tilemaps/components/SetCollisionByProperty.js b/src/tilemaps/components/SetCollisionByProperty.js index 123eb6340..964aaf060 100644 --- a/src/tilemaps/components/SetCollisionByProperty.js +++ b/src/tilemaps/components/SetCollisionByProperty.js @@ -21,8 +21,8 @@ var HasValue = require('../../utils/object/HasValue'); * @since 3.0.0 * * @param {object} properties - An object with tile properties and corresponding values that should be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionByProperty = function (properties, collides, recalculateFaces, layer) @@ -43,6 +43,7 @@ var SetCollisionByProperty = function (properties, collides, recalculateFaces, l if (!HasValue(tile.properties, property)) { continue; } var values = properties[property]; + if (!Array.isArray(values)) { values = [ values ]; diff --git a/src/tilemaps/components/SetCollisionFromCollisionGroup.js b/src/tilemaps/components/SetCollisionFromCollisionGroup.js index 5dc8708d8..323298c24 100644 --- a/src/tilemaps/components/SetCollisionFromCollisionGroup.js +++ b/src/tilemaps/components/SetCollisionFromCollisionGroup.js @@ -16,8 +16,8 @@ var CalculateFacesWithin = require('./CalculateFacesWithin'); * @function Phaser.Tilemaps.Components.SetCollisionFromCollisionGroup * @since 3.0.0 * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the update. + * @param {boolean} collides - If true it will enable collision. If false it will clear collision. + * @param {boolean} recalculateFaces - Whether or not to recalculate the tile faces after the update. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetCollisionFromCollisionGroup = function (collides, recalculateFaces, layer) diff --git a/src/tilemaps/components/SetLayerCollisionIndex.js b/src/tilemaps/components/SetLayerCollisionIndex.js index 67b0d3879..8f19d0cf4 100644 --- a/src/tilemaps/components/SetLayerCollisionIndex.js +++ b/src/tilemaps/components/SetLayerCollisionIndex.js @@ -11,8 +11,8 @@ * @function Phaser.Tilemaps.Components.SetLayerCollisionIndex * @since 3.0.0 * - * @param {integer} tileIndex - The tile index to set the collision boolean for. - * @param {boolean} [collides=true] - Should the tile index collide or not? + * @param {number} tileIndex - The tile index to set the collision boolean for. + * @param {boolean} collides - Should the tile index collide or not? * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SetLayerCollisionIndex = function (tileIndex, collides, layer) diff --git a/src/tilemaps/components/SetTileIndexCallback.js b/src/tilemaps/components/SetTileIndexCallback.js index 69b5a1073..2ca76f1c6 100644 --- a/src/tilemaps/components/SetTileIndexCallback.js +++ b/src/tilemaps/components/SetTileIndexCallback.js @@ -13,7 +13,7 @@ * @function Phaser.Tilemaps.Components.SetTileIndexCallback * @since 3.0.0 * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param {(number|array)} indexes - Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. diff --git a/src/tilemaps/components/SetTileLocationCallback.js b/src/tilemaps/components/SetTileLocationCallback.js index c005f3e68..3ece628c7 100644 --- a/src/tilemaps/components/SetTileLocationCallback.js +++ b/src/tilemaps/components/SetTileLocationCallback.js @@ -14,10 +14,10 @@ var GetTilesWithin = require('./GetTilesWithin'); * @function Phaser.Tilemaps.Components.SetTileLocationCallback * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {function} callback - The callback that will be invoked when the tile is collided with. * @param {object} callbackContext - The context under which the callback is called. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. diff --git a/src/tilemaps/components/Shuffle.js b/src/tilemaps/components/Shuffle.js index 1d0ba2efc..4e8356143 100644 --- a/src/tilemaps/components/Shuffle.js +++ b/src/tilemaps/components/Shuffle.js @@ -16,10 +16,10 @@ var ShuffleArray = require('../../utils/array/Shuffle'); * @function Phaser.Tilemaps.Components.Shuffle * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var Shuffle = function (tileX, tileY, width, height, layer) diff --git a/src/tilemaps/components/StaggeredCullBounds.js b/src/tilemaps/components/StaggeredCullBounds.js new file mode 100644 index 000000000..c3010cd6d --- /dev/null +++ b/src/tilemaps/components/StaggeredCullBounds.js @@ -0,0 +1,47 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var SnapCeil = require('../../math/snap/SnapCeil'); +var SnapFloor = require('../../math/snap/SnapFloor'); + +/** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * + * @function Phaser.Tilemaps.Components.StaggeredCullBounds + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * + * @return {object} An object containing the `left`, `right`, `top` and `bottom` bounds. + */ +var StaggeredCullBounds = function (layer, camera) +{ + var tilemap = layer.tilemapLayer.tilemap; + var tilemapLayer = layer.tilemapLayer; + + // We need to use the tile sizes defined for the map as a whole, not the layer, + // in order to calculate the bounds correctly. As different sized tiles may be + // placed on the grid and we cannot trust layer.baseTileWidth to give us the true size. + var tileW = Math.floor(tilemap.tileWidth * tilemapLayer.scaleX); + var tileH = Math.floor(tilemap.tileHeight * tilemapLayer.scaleY); + + var boundsLeft = SnapFloor(camera.worldView.x - tilemapLayer.x, tileW, 0, true) - tilemapLayer.cullPaddingX; + var boundsRight = SnapCeil(camera.worldView.right - tilemapLayer.x, tileW, 0, true) + tilemapLayer.cullPaddingX; + + var boundsTop = SnapFloor(camera.worldView.y - tilemapLayer.y, tileH / 2, 0, true) - tilemapLayer.cullPaddingY; + var boundsBottom = SnapCeil(camera.worldView.bottom - tilemapLayer.y, tileH / 2, 0, true) + tilemapLayer.cullPaddingY; + + return { + left: boundsLeft, + right: boundsRight, + top: boundsTop, + bottom: boundsBottom + }; +}; + +module.exports = StaggeredCullBounds; diff --git a/src/tilemaps/components/StaggeredCullTiles.js b/src/tilemaps/components/StaggeredCullTiles.js new file mode 100644 index 000000000..50f32b5d7 --- /dev/null +++ b/src/tilemaps/components/StaggeredCullTiles.js @@ -0,0 +1,45 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CullBounds = require('./StaggeredCullBounds'); +var RunCull = require('./RunCull'); + +/** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * + * @function Phaser.Tilemaps.Components.StaggeredCullTiles + * @since 3.50.0 + * + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to run the cull check against. + * @param {array} [outputArray] - An optional array to store the Tile objects within. + * @param {number} [renderOrder=0] - The rendering order constant. + * + * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. + */ +var StaggeredCullTiles = function (layer, camera, outputArray, renderOrder) +{ + if (outputArray === undefined) { outputArray = []; } + if (renderOrder === undefined) { renderOrder = 0; } + + outputArray.length = 0; + + var tilemapLayer = layer.tilemapLayer; + + if (!tilemapLayer.skipCull && tilemapLayer.scrollFactorX === 1 && tilemapLayer.scrollFactorY === 1) + { + // Camera world view bounds, snapped for scaled tile size + // Cull Padding values are given in tiles, not pixels + + var bounds = CullBounds(layer, camera); + + RunCull(layer, bounds, renderOrder, outputArray); + } + + return outputArray; +}; + +module.exports = StaggeredCullTiles; diff --git a/src/tilemaps/components/StaggeredTileToWorldXY.js b/src/tilemaps/components/StaggeredTileToWorldXY.js new file mode 100644 index 000000000..ab50524f8 --- /dev/null +++ b/src/tilemaps/components/StaggeredTileToWorldXY.js @@ -0,0 +1,55 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = require('../../math/Vector2'); + +/** + * Converts from staggered tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.StaggeredTileToWorldXY + * @since 3.50.0 + * + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in world coordinates. + */ +var StaggeredTileToWorldXY = function (tileX, tileY, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + var layerWorldX = 0; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); + + tileWidth *= tilemapLayer.scaleX; + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + var x = layerWorldX + tileX * tileWidth + tileY % 2 * (tileWidth / 2); + var y = layerWorldY + tileY * (tileHeight / 2); + + return point.set(x, y); +}; + +module.exports = StaggeredTileToWorldXY; diff --git a/src/tilemaps/components/StaggeredTileToWorldY.js b/src/tilemaps/components/StaggeredTileToWorldY.js new file mode 100644 index 000000000..fcd4cb96f --- /dev/null +++ b/src/tilemaps/components/StaggeredTileToWorldY.js @@ -0,0 +1,38 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from staggered tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.StaggeredTileToWorldY + * @since 3.50.0 + * + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in world coordinates. + */ +var StaggeredTileToWorldY = function (tileY, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + var layerWorldY = 0; + + if (tilemapLayer) + { + if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + + layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return layerWorldY + tileY * (tileHeight / 2); +}; + +module.exports = StaggeredTileToWorldY; diff --git a/src/tilemaps/components/StaggeredWorldToTileXY.js b/src/tilemaps/components/StaggeredWorldToTileXY.js new file mode 100644 index 000000000..8b9b607f2 --- /dev/null +++ b/src/tilemaps/components/StaggeredWorldToTileXY.js @@ -0,0 +1,59 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var Vector2 = require('../../math/Vector2'); + +/** + * Converts from world XY coordinates (pixels) to staggered tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * @function Phaser.Tilemaps.Components.StaggeredWorldToTileXY + * @since 3.50.0 + * + * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {Phaser.Math.Vector2} The XY location in tile units. + */ +var StaggeredWorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) +{ + if (!point) { point = new Vector2(); } + + var tileWidth = layer.baseTileWidth; + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's horizontal scroll + + worldX = worldX - (tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX)); + + tileWidth *= tilemapLayer.scaleX; + } + + var y = (snapToFloor) ? Math.floor((worldY / (tileHeight / 2))) : (worldY / (tileHeight / 2)); + var x = (snapToFloor) ? Math.floor((worldX + (y % 2) * 0.5 * tileWidth) / tileWidth) : (worldX + (y % 2) * 0.5 * tileWidth) / tileWidth; + + return point.set(x, y); +}; + +module.exports = StaggeredWorldToTileXY; diff --git a/src/tilemaps/components/StaggeredWorldToTileY.js b/src/tilemaps/components/StaggeredWorldToTileY.js new file mode 100644 index 000000000..37e14d21f --- /dev/null +++ b/src/tilemaps/components/StaggeredWorldToTileY.js @@ -0,0 +1,41 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Converts from world Y coordinates (pixels) to staggered tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * @function Phaser.Tilemaps.Components.StaggeredWorldToTileY + * @since 3.50.0 + * + * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. + * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. + * + * @return {number} The Y location in tile units. + */ +var StaggeredWorldToTileY = function (worldY, snapToFloor, camera, layer) +{ + var tileHeight = layer.baseTileHeight; + var tilemapLayer = layer.tilemapLayer; + + if (tilemapLayer) + { + if (!camera) { camera = tilemapLayer.scene.cameras.main; } + + // Find the world position relative to the static or dynamic layer's top left origin, + // factoring in the camera's vertical scroll + + worldY = worldY - (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); + + tileHeight *= tilemapLayer.scaleY; + } + + return (snapToFloor) ? Math.floor(worldY / (tileHeight / 2)) : worldY / (tileHeight / 2); +}; + +module.exports = StaggeredWorldToTileY; diff --git a/src/tilemaps/components/SwapByIndex.js b/src/tilemaps/components/SwapByIndex.js index f0d9f5891..7d5cc65f2 100644 --- a/src/tilemaps/components/SwapByIndex.js +++ b/src/tilemaps/components/SwapByIndex.js @@ -14,12 +14,12 @@ var GetTilesWithin = require('./GetTilesWithin'); * @function Phaser.Tilemaps.Components.SwapByIndex * @since 3.0.0 * - * @param {integer} tileA - First tile index. - * @param {integer} tileB - Second tile index. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. + * @param {number} tileA - First tile index. + * @param {number} tileB - Second tile index. + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var SwapByIndex = function (indexA, indexB, tileX, tileY, width, height, layer) diff --git a/src/tilemaps/components/TileToWorldX.js b/src/tilemaps/components/TileToWorldX.js index 11e184f8d..3713d74b5 100644 --- a/src/tilemaps/components/TileToWorldX.js +++ b/src/tilemaps/components/TileToWorldX.js @@ -11,8 +11,8 @@ * @function Phaser.Tilemaps.Components.TileToWorldX * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} @@ -25,7 +25,7 @@ var TileToWorldX = function (tileX, camera, layer) if (tilemapLayer) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + if (!camera) { camera = tilemapLayer.scene.cameras.main; } layerWorldX = tilemapLayer.x + camera.scrollX * (1 - tilemapLayer.scrollFactorX); diff --git a/src/tilemaps/components/TileToWorldXY.js b/src/tilemaps/components/TileToWorldXY.js index 567914d59..233f2c7f3 100644 --- a/src/tilemaps/components/TileToWorldXY.js +++ b/src/tilemaps/components/TileToWorldXY.js @@ -16,17 +16,17 @@ var Vector2 = require('../../math/Vector2'); * @function Phaser.Tilemaps.Components.TileToWorldXY * @since 3.0.0 * - * @param {integer} tileX - The x coordinate, in tiles, not pixels. - * @param {integer} tileY - The y coordinate, in tiles, not pixels. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {number} tileX - The x coordinate, in tiles, not pixels. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in world coordinates. */ var TileToWorldXY = function (tileX, tileY, point, camera, layer) { - if (point === undefined) { point = new Vector2(0, 0); } + if (!point) { point = new Vector2(0, 0); } point.x = TileToWorldX(tileX, camera, layer); point.y = TileToWorldY(tileY, camera, layer); diff --git a/src/tilemaps/components/TileToWorldY.js b/src/tilemaps/components/TileToWorldY.js index f749ca0c2..c28a815d1 100644 --- a/src/tilemaps/components/TileToWorldY.js +++ b/src/tilemaps/components/TileToWorldY.js @@ -11,11 +11,11 @@ * @function Phaser.Tilemaps.Components.TileToWorldY * @since 3.0.0 * - * @param {integer} tileY - The x coordinate, in tiles, not pixels. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {number} tileY - The y coordinate, in tiles, not pixels. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * - * @return {number} + * @return {number} The Y location in world coordinates. */ var TileToWorldY = function (tileY, camera, layer) { @@ -25,7 +25,7 @@ var TileToWorldY = function (tileY, camera, layer) if (tilemapLayer) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + if (!camera) { camera = tilemapLayer.scene.cameras.main; } layerWorldY = (tilemapLayer.y + camera.scrollY * (1 - tilemapLayer.scrollFactorY)); diff --git a/src/tilemaps/components/WeightedRandomize.js b/src/tilemaps/components/WeightedRandomize.js index 27b2ea71a..e2e49db4d 100644 --- a/src/tilemaps/components/WeightedRandomize.js +++ b/src/tilemaps/components/WeightedRandomize.js @@ -24,23 +24,24 @@ var GetTilesWithin = require('./GetTilesWithin'); * @function Phaser.Tilemaps.Components.WeightedRandomize * @since 3.0.0 * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {object[]} [weightedIndexes] - An array of objects to randomly draw from during + * @param {number} tileX - The left most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} tileY - The top most tile index (in tile coordinates) to use as the origin of the area. + * @param {number} width - How many tiles wide from the `tileX` index the area will be. + * @param {number} height - How many tiles tall from the `tileY` index the area will be. + * @param {object[]} weightedIndexes - An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. */ var WeightedRandomize = function (tileX, tileY, width, height, weightedIndexes, layer) { - if (weightedIndexes === undefined) { return; } + if (!weightedIndexes) { return; } var i; var tiles = GetTilesWithin(tileX, tileY, width, height, null, layer); var weightTotal = 0; + for (i = 0; i < weightedIndexes.length; i++) { weightTotal += weightedIndexes[i].weight; diff --git a/src/tilemaps/components/WorldToTileX.js b/src/tilemaps/components/WorldToTileX.js index 8b6d8089c..4423e17de 100644 --- a/src/tilemaps/components/WorldToTileX.js +++ b/src/tilemaps/components/WorldToTileX.js @@ -12,8 +12,8 @@ * @since 3.0.0 * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {?Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} The X location in tile units. @@ -27,7 +27,7 @@ var WorldToTileX = function (worldX, snapToFloor, camera, layer) if (tilemapLayer) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + if (!camera) { camera = tilemapLayer.scene.cameras.main; } // Find the world position relative to the static or dynamic layer's top left origin, // factoring in the camera's horizontal scroll @@ -36,9 +36,7 @@ var WorldToTileX = function (worldX, snapToFloor, camera, layer) tileWidth *= tilemapLayer.scaleX; } - return snapToFloor - ? Math.floor(worldX / tileWidth) - : worldX / tileWidth; + return (snapToFloor) ? Math.floor(worldX / tileWidth) : worldX / tileWidth; }; module.exports = WorldToTileX; diff --git a/src/tilemaps/components/WorldToTileXY.js b/src/tilemaps/components/WorldToTileXY.js index b442990a0..95b802bf1 100644 --- a/src/tilemaps/components/WorldToTileXY.js +++ b/src/tilemaps/components/WorldToTileXY.js @@ -18,16 +18,17 @@ var Vector2 = require('../../math/Vector2'); * * @param {number} worldX - The x coordinate to be converted, in pixels, not tiles. * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {Phaser.Math.Vector2} point - A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {Phaser.Math.Vector2} The XY location in tile units. */ var WorldToTileXY = function (worldX, worldY, snapToFloor, point, camera, layer) { - if (point === undefined) { point = new Vector2(0, 0); } + if (snapToFloor === undefined) { snapToFloor = true; } + if (!point) { point = new Vector2(0, 0); } point.x = WorldToTileX(worldX, snapToFloor, camera, layer); point.y = WorldToTileY(worldY, snapToFloor, camera, layer); diff --git a/src/tilemaps/components/WorldToTileY.js b/src/tilemaps/components/WorldToTileY.js index 873130c28..c302ca163 100644 --- a/src/tilemaps/components/WorldToTileY.js +++ b/src/tilemaps/components/WorldToTileY.js @@ -12,8 +12,8 @@ * @since 3.0.0 * * @param {number} worldY - The y coordinate to be converted, in pixels, not tiles. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. + * @param {boolean} snapToFloor - Whether or not to round the tile coordinate down to the nearest integer. + * @param {?Phaser.Cameras.Scene2D.Camera} camera - The Camera to use when calculating the tile index from the world values. * @param {Phaser.Tilemaps.LayerData} layer - The Tilemap Layer to act upon. * * @return {number} The Y location in tile units. @@ -27,7 +27,7 @@ var WorldToTileY = function (worldY, snapToFloor, camera, layer) if (tilemapLayer) { - if (camera === undefined) { camera = tilemapLayer.scene.cameras.main; } + if (!camera) { camera = tilemapLayer.scene.cameras.main; } // Find the world position relative to the static or dynamic layer's top left origin, // factoring in the camera's vertical scroll @@ -36,9 +36,7 @@ var WorldToTileY = function (worldY, snapToFloor, camera, layer) tileHeight *= tilemapLayer.scaleY; } - return snapToFloor - ? Math.floor(worldY / tileHeight) - : worldY / tileHeight; + return (snapToFloor) ? Math.floor(worldY / tileHeight) : worldY / tileHeight; }; module.exports = WorldToTileY; diff --git a/src/tilemaps/components/index.js b/src/tilemaps/components/index.js index d77fc7580..33c3bab20 100644 --- a/src/tilemaps/components/index.js +++ b/src/tilemaps/components/index.js @@ -12,22 +12,40 @@ module.exports = { CalculateFacesAt: require('./CalculateFacesAt'), CalculateFacesWithin: require('./CalculateFacesWithin'), + CheckIsoBounds: require('./CheckIsoBounds'), Copy: require('./Copy'), CreateFromTiles: require('./CreateFromTiles'), + CullBounds: require('./CullBounds'), CullTiles: require('./CullTiles'), Fill: require('./Fill'), FilterTiles: require('./FilterTiles'), FindByIndex: require('./FindByIndex'), FindTile: require('./FindTile'), ForEachTile: require('./ForEachTile'), + GetCullTilesFunction: require('./GetCullTilesFunction'), GetTileAt: require('./GetTileAt'), GetTileAtWorldXY: require('./GetTileAtWorldXY'), GetTilesWithin: require('./GetTilesWithin'), GetTilesWithinShape: require('./GetTilesWithinShape'), GetTilesWithinWorldXY: require('./GetTilesWithinWorldXY'), + GetTileToWorldXFunction: require('./GetTileToWorldXFunction'), + GetTileToWorldXYFunction: require('./GetTileToWorldXYFunction'), + GetTileToWorldYFunction: require('./GetTileToWorldYFunction'), + GetWorldToTileXFunction: require('./GetWorldToTileXFunction'), + GetWorldToTileXYFunction: require('./GetWorldToTileXYFunction'), + GetWorldToTileYFunction: require('./GetWorldToTileYFunction'), HasTileAt: require('./HasTileAt'), HasTileAtWorldXY: require('./HasTileAtWorldXY'), + HexagonalCullBounds: require('./HexagonalCullBounds'), + HexagonalCullTiles: require('./HexagonalCullTiles'), + HexagonalTileToWorldXY: require('./HexagonalTileToWorldXY'), + HexagonalTileToWorldY: require('./HexagonalTileToWorldY'), + HexagonalWorldToTileXY: require('./HexagonalWorldToTileXY'), + HexagonalWorldToTileY: require('./HexagonalWorldToTileY'), IsInLayerBounds: require('./IsInLayerBounds'), + IsometricCullTiles: require('./IsometricCullTiles'), + IsometricTileToWorldXY: require('./IsometricTileToWorldXY'), + IsometricWorldToTileXY: require('./IsometricWorldToTileXY'), PutTileAt: require('./PutTileAt'), PutTileAtWorldXY: require('./PutTileAtWorldXY'), PutTilesAt: require('./PutTilesAt'), @@ -36,6 +54,7 @@ module.exports = { RemoveTileAtWorldXY: require('./RemoveTileAtWorldXY'), RenderDebug: require('./RenderDebug'), ReplaceByIndex: require('./ReplaceByIndex'), + RunCull: require('./RunCull'), SetCollision: require('./SetCollision'), SetCollisionBetween: require('./SetCollisionBetween'), SetCollisionByExclusion: require('./SetCollisionByExclusion'), @@ -46,6 +65,12 @@ module.exports = { SetTileIndexCallback: require('./SetTileIndexCallback'), SetTileLocationCallback: require('./SetTileLocationCallback'), Shuffle: require('./Shuffle'), + StaggeredCullBounds: require('./StaggeredCullBounds'), + StaggeredCullTiles: require('./StaggeredCullTiles'), + StaggeredTileToWorldXY: require('./StaggeredTileToWorldXY'), + StaggeredTileToWorldY: require('./StaggeredTileToWorldY'), + StaggeredWorldToTileXY: require('./StaggeredWorldToTileXY'), + StaggeredWorldToTileY: require('./StaggeredWorldToTileY'), SwapByIndex: require('./SwapByIndex'), TileToWorldX: require('./TileToWorldX'), TileToWorldXY: require('./TileToWorldXY'), diff --git a/src/tilemaps/const/ORIENTATION_CONST.js b/src/tilemaps/const/ORIENTATION_CONST.js new file mode 100644 index 000000000..376e652a8 --- /dev/null +++ b/src/tilemaps/const/ORIENTATION_CONST.js @@ -0,0 +1,67 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Phaser Tilemap constants for orientation. + * + * @namespace Phaser.Tilemaps.Orientation + * @memberof Phaser.Tilemaps + * @since 3.50.0 + */ + +/** + * Phaser Tilemap constants for orientation. + * + * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. + * + * @typedef {Phaser.Tilemaps.Orientation} Phaser.Tilemaps.OrientationType + * @memberof Phaser.Tilemaps + * @since 3.50.0 + */ + +module.exports = { + + /** + * Orthogonal Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.ORTHOGONAL + * @type {number} + * @const + * @since 3.50.0 + */ + ORTHOGONAL: 0, + + /** + * Isometric Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.ISOMETRIC + * @type {number} + * @const + * @since 3.50.0 + */ + ISOMETRIC: 1, + + /** + * Staggered Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.STAGGERED + * @type {number} + * @const + * @since 3.50.0 + */ + STAGGERED: 2, + + /** + * Hexagonal Tilemap orientation constant. + * + * @name Phaser.Tilemaps.Orientation.HEXAGONAL + * @type {number} + * @const + * @since 3.50.0 + */ + HEXAGONAL: 3 + +}; diff --git a/src/tilemaps/const/index.js b/src/tilemaps/const/index.js new file mode 100644 index 000000000..b67fcef07 --- /dev/null +++ b/src/tilemaps/const/index.js @@ -0,0 +1,13 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = { + + ORIENTATION: require('./ORIENTATION_CONST') + +}; + +module.exports = CONST; diff --git a/src/tilemaps/dynamiclayer/DynamicTilemapLayerWebGLRenderer.js b/src/tilemaps/dynamiclayer/DynamicTilemapLayerWebGLRenderer.js deleted file mode 100644 index a42ceb85c..000000000 --- a/src/tilemaps/dynamiclayer/DynamicTilemapLayerWebGLRenderer.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Utils = require('../../renderer/webgl/Utils'); - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.Tilemaps.DynamicTilemapLayer#renderWebGL - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.Tilemaps.DynamicTilemapLayer} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - */ -var DynamicTilemapLayerWebGLRenderer = function (renderer, src, camera) -{ - src.cull(camera); - - var renderTiles = src.culledTiles; - var tileCount = renderTiles.length; - var alpha = camera.alpha * src.alpha; - - if (tileCount === 0 || alpha <= 0) - { - return; - } - - var gidMap = src.gidMap; - var pipeline = renderer.pipelines.set(src.pipeline); - - var getTint = Utils.getTintAppendFloatAlpha; - - var scrollFactorX = src.scrollFactorX; - var scrollFactorY = src.scrollFactorY; - - var x = src.x; - var y = src.y; - - var sx = src.scaleX; - var sy = src.scaleY; - - var tilesets = src.tileset; - - // Loop through each tileset in this layer, drawing just the tiles that are in that set each time - // Doing it this way around allows us to batch tiles using the same tileset - for (var c = 0; c < tilesets.length; c++) - { - var currentSet = tilesets[c]; - var texture = currentSet.glTexture; - var textureUnit = pipeline.setTexture2D(texture, src); - - for (var i = 0; i < tileCount; i++) - { - var tile = renderTiles[i]; - - var tileset = gidMap[tile.index]; - - if (tileset !== currentSet) - { - // Skip tiles that aren't in this set - continue; - } - - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - - if (tileTexCoords === null) - { - continue; - } - - var frameWidth = tile.width; - var frameHeight = tile.height; - - var frameX = tileTexCoords.x; - var frameY = tileTexCoords.y; - - var tw = tile.width * 0.5; - var th = tile.height * 0.5; - - var tint = getTint(tile.tint, alpha * tile.alpha); - - pipeline.batchTexture( - src, - texture, - texture.width, texture.height, - x + ((tw + tile.pixelX) * sx), y + ((th + tile.pixelY) * sy), - tile.width, tile.height, - sx, sy, - tile.rotation, - tile.flipX, tile.flipY, - scrollFactorX, scrollFactorY, - tw, th, - frameX, frameY, frameWidth, frameHeight, - tint, tint, tint, tint, false, - 0, 0, - camera, - null, - true, - textureUnit - ); - } - } -}; - -module.exports = DynamicTilemapLayerWebGLRenderer; diff --git a/src/tilemaps/index.js b/src/tilemaps/index.js index 5f9b119c1..a691513b9 100644 --- a/src/tilemaps/index.js +++ b/src/tilemaps/index.js @@ -4,11 +4,19 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ +var Extend = require('../utils/object/Extend'); +var CONST = require('./const'); + /** * @namespace Phaser.Tilemaps + * + * @borrows Phaser.Tilemaps.Orientation.ORTHOGONAL as ORTHOGONAL + * @borrows Phaser.Tilemaps.Orientation.ISOMETRIC as ISOMETRIC + * @borrows Phaser.Tilemaps.Orientation.STAGGERED as STAGGERED + * @borrows Phaser.Tilemaps.Orientation.HEXAGONAL as HEXAGONAL */ -module.exports = { +var Tilemaps = { Components: require('./components'), Parsers: require('./parsers'), @@ -21,12 +29,15 @@ module.exports = { TilemapCreator: require('./TilemapCreator'), TilemapFactory: require('./TilemapFactory'), Tileset: require('./Tileset'), + TilemapLayer: require('./TilemapLayer'), + Orientation: require('./const/ORIENTATION_CONST'), LayerData: require('./mapdata/LayerData'), MapData: require('./mapdata/MapData'), - ObjectLayer: require('./mapdata/ObjectLayer'), - - DynamicTilemapLayer: require('./dynamiclayer/DynamicTilemapLayer'), - StaticTilemapLayer: require('./staticlayer/StaticTilemapLayer') + ObjectLayer: require('./mapdata/ObjectLayer') }; + +Tilemaps = Extend(false, Tilemaps, CONST.ORIENTATION); + +module.exports = Tilemaps; diff --git a/src/tilemaps/mapdata/LayerData.js b/src/tilemaps/mapdata/LayerData.js index 70236673d..b925e07a6 100644 --- a/src/tilemaps/mapdata/LayerData.js +++ b/src/tilemaps/mapdata/LayerData.js @@ -5,12 +5,13 @@ */ var Class = require('../../utils/Class'); +var CONST = require('../const/ORIENTATION_CONST'); var GetFastValue = require('../../utils/object/GetFastValue'); /** * @classdesc * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, - * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference + * etc. into this format. Tilemap and TilemapLayer objects have a reference * to this data and use it to look up and perform operations on tiles. * * @class LayerData @@ -109,6 +110,15 @@ var LayerData = new Class({ */ this.baseTileHeight = GetFastValue(config, 'baseTileHeight', this.tileHeight); + /** + * The layers orientation, necessary to be able to determine a tiles pixelX and pixelY as well as the layers width and height. + * + * @name Phaser.Tilemaps.LayerData#orientation + * @type {Phaser.Tilemaps.OrientationType} + * @since 3.50.0 + */ + this.orientation = GetFastValue(config, 'orientation', CONST.ORTHOGONAL); + /** * The width in pixels of the entire layer. * @@ -203,10 +213,20 @@ var LayerData = new Class({ * A reference to the Tilemap layer that owns this data. * * @name Phaser.Tilemaps.LayerData#tilemapLayer - * @type {(Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer)} + * @type {Phaser.Tilemaps.TilemapLayer} * @since 3.0.0 */ this.tilemapLayer = GetFastValue(config, 'tilemapLayer', null); + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.LayerData#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = GetFastValue(config, 'hexSideLength', 0); } }); diff --git a/src/tilemaps/mapdata/MapData.js b/src/tilemaps/mapdata/MapData.js index dc94758f4..1a19fda94 100644 --- a/src/tilemaps/mapdata/MapData.js +++ b/src/tilemaps/mapdata/MapData.js @@ -5,6 +5,7 @@ */ var Class = require('../../utils/Class'); +var CONST = require('../const/ORIENTATION_CONST'); var GetFastValue = require('../../utils/object/GetFastValue'); /** @@ -30,7 +31,7 @@ var MapData = new Class({ /** * The key in the Phaser cache that corresponds to the loaded tilemap data. - * + * * @name Phaser.Tilemaps.MapData#name * @type {string} * @since 3.0.0 @@ -39,7 +40,7 @@ var MapData = new Class({ /** * The width of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#width * @type {number} * @since 3.0.0 @@ -48,7 +49,7 @@ var MapData = new Class({ /** * The height of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#height * @type {number} * @since 3.0.0 @@ -66,7 +67,7 @@ var MapData = new Class({ /** * The width of the tiles. - * + * * @name Phaser.Tilemaps.MapData#tileWidth * @type {number} * @since 3.0.0 @@ -75,7 +76,7 @@ var MapData = new Class({ /** * The height of the tiles. - * + * * @name Phaser.Tilemaps.MapData#tileHeight * @type {number} * @since 3.0.0 @@ -84,7 +85,7 @@ var MapData = new Class({ /** * The width in pixels of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#widthInPixels * @type {number} * @since 3.0.0 @@ -93,7 +94,7 @@ var MapData = new Class({ /** * The height in pixels of the entire tilemap. - * + * * @name Phaser.Tilemaps.MapData#heightInPixels * @type {number} * @since 3.0.0 @@ -102,30 +103,30 @@ var MapData = new Class({ /** * The format of the map data. - * + * * @name Phaser.Tilemaps.MapData#format - * @type {integer} + * @type {number} * @since 3.0.0 */ this.format = GetFastValue(config, 'format', null); /** * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. - * + * * @name Phaser.Tilemaps.MapData#orientation - * @type {string} - * @since 3.0.0 + * @type {Phaser.Tilemaps.OrientationType} + * @since 3.50.0 */ - this.orientation = GetFastValue(config, 'orientation', 'orthogonal'); + this.orientation = GetFastValue(config, 'orientation', CONST.ORTHOGONAL); /** * Determines the draw order of tilemap. Default is right-down - * + * * 0, or 'right-down' * 1, or 'left-down' * 2, or 'right-up' * 3, or 'left-up' - * + * * @name Phaser.Tilemaps.MapData#renderOrder * @type {string} * @since 3.12.0 @@ -134,7 +135,7 @@ var MapData = new Class({ /** * The version of the map data (as specified in Tiled). - * + * * @name Phaser.Tilemaps.MapData#version * @type {string} * @since 3.0.0 @@ -143,7 +144,7 @@ var MapData = new Class({ /** * Map specific properties (can be specified in Tiled) - * + * * @name Phaser.Tilemaps.MapData#properties * @type {object} * @since 3.0.0 @@ -152,7 +153,7 @@ var MapData = new Class({ /** * An array with all the layers configured to the MapData. - * + * * @name Phaser.Tilemaps.MapData#layers * @type {(Phaser.Tilemaps.LayerData[]|Phaser.Tilemaps.ObjectLayer)} * @since 3.0.0 @@ -161,7 +162,7 @@ var MapData = new Class({ /** * An array of Tiled Image Layers. - * + * * @name Phaser.Tilemaps.MapData#images * @type {array} * @since 3.0.0 @@ -170,7 +171,7 @@ var MapData = new Class({ /** * An object of Tiled Object Layers. - * + * * @name Phaser.Tilemaps.MapData#objects * @type {object} * @since 3.0.0 @@ -179,7 +180,7 @@ var MapData = new Class({ /** * An object of collision data. Must be created as physics object or will return undefined. - * + * * @name Phaser.Tilemaps.MapData#collision * @type {object} * @since 3.0.0 @@ -188,7 +189,7 @@ var MapData = new Class({ /** * An array of Tilesets. - * + * * @name Phaser.Tilemaps.MapData#tilesets * @type {Phaser.Tilemaps.Tileset[]} * @since 3.0.0 @@ -197,7 +198,7 @@ var MapData = new Class({ /** * The collection of images the map uses(specified in Tiled) - * + * * @name Phaser.Tilemaps.MapData#imageCollections * @type {array} * @since 3.0.0 @@ -206,12 +207,22 @@ var MapData = new Class({ /** * An array of tile instances. - * + * * @name Phaser.Tilemaps.MapData#tiles * @type {array} * @since 3.0.0 */ this.tiles = GetFastValue(config, 'tiles', []); + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + * + * @name Phaser.Tilemaps.MapData#hexSideLength + * @type {number} + * @since 3.50.0 + */ + this.hexSideLength = GetFastValue(config, 'hexSideLength', 0); } }); diff --git a/src/tilemaps/parsers/FromOrientationString.js b/src/tilemaps/parsers/FromOrientationString.js new file mode 100644 index 000000000..54348da23 --- /dev/null +++ b/src/tilemaps/parsers/FromOrientationString.js @@ -0,0 +1,41 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +var CONST = require('../const/ORIENTATION_CONST'); + +/** + * Get the Tilemap orientation from the given string. + * + * @function Phaser.Tilemaps.Parsers.FromOrientationString + * @since 3.50.0 + * + * @param {string} [orientation] - The orientation type as a string. + * + * @return {Phaser.Tilemaps.OrientationType} The Tilemap Orientation type. + */ +var FromOrientationString = function (orientation) +{ + orientation = orientation.toLowerCase(); + + if (orientation === 'isometric') + { + return CONST.ISOMETRIC; + } + else if (orientation === 'staggered') + { + return CONST.STAGGERED; + } + else if (orientation === 'hexagonal') + { + return CONST.HEXAGONAL; + } + else + { + return CONST.ORTHOGONAL; + } +}; + +module.exports = FromOrientationString; diff --git a/src/tilemaps/parsers/Parse.js b/src/tilemaps/parsers/Parse.js index b40ae6b3a..285ba6a24 100644 --- a/src/tilemaps/parsers/Parse.js +++ b/src/tilemaps/parsers/Parse.js @@ -20,11 +20,11 @@ var ParseWeltmeister = require('./impact/ParseWeltmeister'); * @since 3.0.0 * * @param {string} name - The name of the tilemap, used to set the name on the MapData. - * @param {integer} mapFormat - See ../Formats.js. - * @param {(integer[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. - * @param {integer} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but + * @param {number} mapFormat - See ../Formats.js. + * @param {(number[][]|string|object)} data - 2D array, CSV string or Tiled JSON object. + * @param {number} tileWidth - The width of a tile in pixels. Required for 2D array and CSV, but * ignored for Tiled JSON. - * @param {integer} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but + * @param {number} tileHeight - The height of a tile in pixels. Required for 2D array and CSV, but * ignored for Tiled JSON. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty diff --git a/src/tilemaps/parsers/Parse2DArray.js b/src/tilemaps/parsers/Parse2DArray.js index 77a1cf1a3..813c92c87 100644 --- a/src/tilemaps/parsers/Parse2DArray.js +++ b/src/tilemaps/parsers/Parse2DArray.js @@ -16,9 +16,9 @@ var Tile = require('../Tile'); * @since 3.0.0 * * @param {string} name - The name of the tilemap, used to set the name on the MapData. - * @param {integer[][]} data - 2D array, CSV string or Tiled JSON object. - * @param {integer} tileWidth - The width of a tile in pixels. - * @param {integer} tileHeight - The height of a tile in pixels. + * @param {number[][]} data - 2D array, CSV string or Tiled JSON object. + * @param {number} tileWidth - The width of a tile in pixels. + * @param {number} tileHeight - The height of a tile in pixels. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty * location will get a Tile object with an index of -1. If you've a large sparsely populated map and @@ -34,7 +34,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull) tileWidth: tileWidth, tileHeight: tileHeight }); - + var mapData = new MapData({ name: name, tileWidth: tileWidth, diff --git a/src/tilemaps/parsers/ParseCSV.js b/src/tilemaps/parsers/ParseCSV.js index 8fafd5c1b..6c445688f 100644 --- a/src/tilemaps/parsers/ParseCSV.js +++ b/src/tilemaps/parsers/ParseCSV.js @@ -15,8 +15,8 @@ var Parse2DArray = require('./Parse2DArray'); * * @param {string} name - The name of the tilemap, used to set the name on the MapData. * @param {string} data - CSV string of tile indexes. - * @param {integer} tileWidth - The width of a tile in pixels. - * @param {integer} tileHeight - The height of a tile in pixels. + * @param {number} tileWidth - The width of a tile in pixels. + * @param {number} tileHeight - The height of a tile in pixels. * @param {boolean} insertNull - Controls how empty tiles, tiles with an index of -1, in the map * data are handled. If `true`, empty locations will get a value of `null`. If `false`, empty * location will get a Tile object with an index of -1. If you've a large sparsely populated map and diff --git a/src/tilemaps/parsers/index.js b/src/tilemaps/parsers/index.js index 08fd4064b..c2f39aa48 100644 --- a/src/tilemaps/parsers/index.js +++ b/src/tilemaps/parsers/index.js @@ -10,6 +10,7 @@ module.exports = { + FromOrientationString: require('./FromOrientationString'), Parse: require('./Parse'), Parse2DArray: require('./Parse2DArray'), ParseCSV: require('./ParseCSV'), diff --git a/src/tilemaps/parsers/tiled/ParseJSONTiled.js b/src/tilemaps/parsers/tiled/ParseJSONTiled.js index 702652bc7..f8c062430 100644 --- a/src/tilemaps/parsers/tiled/ParseJSONTiled.js +++ b/src/tilemaps/parsers/tiled/ParseJSONTiled.js @@ -4,14 +4,16 @@ * @license {@link https://opensource.org/licenses/MIT|MIT License} */ -var Formats = require('../../Formats'); -var MapData = require('../../mapdata/MapData'); -var ParseTileLayers = require('./ParseTileLayers'); -var ParseImageLayers = require('./ParseImageLayers'); -var ParseTilesets = require('./ParseTilesets'); -var ParseObjectLayers = require('./ParseObjectLayers'); -var BuildTilesetIndex = require('./BuildTilesetIndex'); var AssignTileProperties = require('./AssignTileProperties'); +var BuildTilesetIndex = require('./BuildTilesetIndex'); +var CONST = require('../../const/ORIENTATION_CONST'); +var Formats = require('../../Formats'); +var FromOrientationString = require('../FromOrientationString'); +var MapData = require('../../mapdata/MapData'); +var ParseImageLayers = require('./ParseImageLayers'); +var ParseObjectLayers = require('./ParseObjectLayers'); +var ParseTileLayers = require('./ParseTileLayers'); +var ParseTilesets = require('./ParseTilesets'); /** * Parses a Tiled JSON object into a new MapData object. @@ -32,12 +34,6 @@ var AssignTileProperties = require('./AssignTileProperties'); */ var ParseJSONTiled = function (name, json, insertNull) { - if (json.orientation !== 'orthogonal') - { - console.warn('Only orthogonal map types are supported in this version of Phaser'); - return null; - } - // Map data will consist of: layers, objects, images, tilesets, sizes var mapData = new MapData({ width: json.width, @@ -45,7 +41,7 @@ var ParseJSONTiled = function (name, json, insertNull) name: name, tileWidth: json.tilewidth, tileHeight: json.tileheight, - orientation: json.orientation, + orientation: FromOrientationString(json.orientation), format: Formats.TILED_JSON, version: json.version, properties: json.properties, @@ -53,10 +49,16 @@ var ParseJSONTiled = function (name, json, insertNull) infinite: json.infinite }); + if (mapData.orientation === CONST.HEXAGONAL) + { + mapData.hexSideLength = json.hexsidelength; + } + mapData.layers = ParseTileLayers(json, insertNull); mapData.images = ParseImageLayers(json); var sets = ParseTilesets(json); + mapData.tilesets = sets.tilesets; mapData.imageCollections = sets.imageCollections; diff --git a/src/tilemaps/parsers/tiled/ParseTileLayers.js b/src/tilemaps/parsers/tiled/ParseTileLayers.js index 196c683c4..27773b473 100644 --- a/src/tilemaps/parsers/tiled/ParseTileLayers.js +++ b/src/tilemaps/parsers/tiled/ParseTileLayers.js @@ -5,11 +5,13 @@ */ var Base64Decode = require('./Base64Decode'); +var CONST = require('../../const/ORIENTATION_CONST'); +var CreateGroupLayer = require('./CreateGroupLayer'); +var FromOrientationString = require('../FromOrientationString'); var GetFastValue = require('../../../utils/object/GetFastValue'); var LayerData = require('../../mapdata/LayerData'); var ParseGID = require('./ParseGID'); var Tile = require('../../Tile'); -var CreateGroupLayer = require('./CreateGroupLayer'); /** * Parses all tilemap layers in a Tiled JSON object into new LayerData objects. @@ -117,6 +119,7 @@ var ParseTileLayers = function (json, insertNull) { var layerOffsetX = (GetFastValue(curl, 'startx', 0) + curl.x); var layerOffsetY = (GetFastValue(curl, 'starty', 0) + curl.y); + layerData = new LayerData({ name: (curGroupState.name + curl.name), x: (curGroupState.x + GetFastValue(curl, 'offsetx', 0) + layerOffsetX * json.tilewidth), @@ -127,9 +130,15 @@ var ParseTileLayers = function (json, insertNull) tileHeight: json.tileheight, alpha: (curGroupState.opacity * curl.opacity), visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', []) + properties: GetFastValue(curl, 'properties', []), + orientation: FromOrientationString(json.orientation) }); + if (layerData.orientation === CONST.HEXAGONAL) + { + layerData.hexSideLength = json.hexsidelength; + } + for (var c = 0; c < curl.height; c++) { output.push([ null ]); @@ -159,8 +168,7 @@ var ParseTileLayers = function (json, insertNull) // index, x, y, width, height if (gidInfo.gid > 0) { - tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth, - json.tileheight); + tile = new Tile(layerData, gidInfo.gid, newOffsetX, newOffsetY, json.tilewidth, json.tileheight); // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal // propeties into flipX, flipY and rotation @@ -200,9 +208,14 @@ var ParseTileLayers = function (json, insertNull) tileHeight: json.tileheight, alpha: (curGroupState.opacity * curl.opacity), visible: (curGroupState.visible && curl.visible), - properties: GetFastValue(curl, 'properties', []) + properties: GetFastValue(curl, 'properties', []), + orientation: FromOrientationString(json.orientation) }); + if (layerData.orientation === CONST.HEXAGONAL) + { + layerData.hexSideLength = json.hexsidelength; + } var row = []; // Loop through the data field in the JSON. @@ -213,8 +226,7 @@ var ParseTileLayers = function (json, insertNull) // index, x, y, width, height if (gidInfo.gid > 0) { - tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth, - json.tileheight); + tile = new Tile(layerData, gidInfo.gid, x, output.length, json.tilewidth, json.tileheight); // Turning Tiled's FlippedHorizontal, FlippedVertical and FlippedAntiDiagonal // propeties into flipX, flipY and rotation diff --git a/src/tilemaps/parsers/tiled/ParseTilesets.js b/src/tilemaps/parsers/tiled/ParseTilesets.js index dc350e56e..aab72cad0 100644 --- a/src/tilemaps/parsers/tiled/ParseTilesets.js +++ b/src/tilemaps/parsers/tiled/ParseTilesets.js @@ -32,7 +32,7 @@ var ParseTilesets = function (json) if (set.source) { - console.warn('Phaser can\'t load external tilesets. Use the Embed Tileset button and then export the map again.'); + console.warn('External tilesets unsupported. Use Embed Tileset and re-export'); } else if (set.image) { @@ -71,9 +71,10 @@ var ParseTilesets = function (json) if (tile.objectgroup.objects) { - var parsedObjects2 = tile.objectgroup.objects.map( - function (obj) { return ParseObject(obj); } - ); + var parsedObjects2 = tile.objectgroup.objects.map(function (obj) + { + return ParseObject(obj); + }); tiles[tile.id].objectgroup.objects = parsedObjects2; } @@ -116,11 +117,14 @@ var ParseTilesets = function (json) for (stringID in newSet.tileData) { var objectGroup = newSet.tileData[stringID].objectgroup; + if (objectGroup && objectGroup.objects) { - var parsedObjects1 = objectGroup.objects.map( - function (obj) { return ParseObject(obj); } - ); + var parsedObjects1 = objectGroup.objects.map(function (obj) + { + return ParseObject(obj); + }); + newSet.tileData[stringID].objectgroup.objects = parsedObjects1; } } @@ -135,16 +139,24 @@ var ParseTilesets = function (json) } else { - var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth, - set.tileheight, set.margin, set.spacing, set.properties); + var newCollection = new ImageCollection(set.name, set.firstgid, set.tilewidth, set.tileheight, set.margin, set.spacing, set.properties); - for (stringID in set.tiles) + var maxId = 0; + + for (t = 0; t < set.tiles.length; t++) { - var image = set.tiles[stringID].image; - var gid = set.firstgid + parseInt(stringID, 10); + tile = set.tiles[t]; + + var image = tile.image; + var tileId = parseInt(tile.id, 10); + var gid = set.firstgid + tileId; newCollection.addImage(gid, image); + + maxId = Math.max(tileId, maxId); } + newCollection.maxId = maxId; + imageCollections.push(newCollection); } diff --git a/src/tilemaps/staticlayer/StaticTilemapLayer.js b/src/tilemaps/staticlayer/StaticTilemapLayer.js deleted file mode 100644 index c9654a4f4..000000000 --- a/src/tilemaps/staticlayer/StaticTilemapLayer.js +++ /dev/null @@ -1,1514 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Class = require('../../utils/Class'); -var Components = require('../../gameobjects/components'); -var GameEvents = require('../../core/events'); -var GameObject = require('../../gameobjects/GameObject'); -var ModelViewProjection = require('../../renderer/webgl/pipelines/components/ModelViewProjection'); -var StaticTilemapLayerRender = require('./StaticTilemapLayerRender'); -var TilemapComponents = require('../components'); -var TransformMatrix = require('../../gameobjects/components/TransformMatrix'); -var Utils = require('../../renderer/webgl/Utils'); - -/** - * @classdesc - * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination - * with one, or more, Tilesets. - * - * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile - * effects like tint or alpha, or change the tiles or tilesets the layer uses. - * - * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. - * - * @class StaticTilemapLayer - * @extends Phaser.GameObjects.GameObject - * @memberof Phaser.Tilemaps - * @constructor - * @since 3.0.0 - * - * @extends Phaser.GameObjects.Components.Alpha - * @extends Phaser.GameObjects.Components.BlendMode - * @extends Phaser.GameObjects.Components.ComputedSize - * @extends Phaser.GameObjects.Components.Depth - * @extends Phaser.GameObjects.Components.Flip - * @extends Phaser.GameObjects.Components.GetBounds - * @extends Phaser.GameObjects.Components.Origin - * @extends Phaser.GameObjects.Components.Pipeline - * @extends Phaser.GameObjects.Components.Transform - * @extends Phaser.GameObjects.Components.Visible - * @extends Phaser.GameObjects.Components.ScrollFactor - * @extends Phaser.Renderer.WebGL.Pipelines.ModelViewProjection - * - * @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. - * @param {Phaser.Tilemaps.Tilemap} tilemap - The Tilemap this layer is a part of. - * @param {integer} layerIndex - The index of the LayerData associated with this layer. - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param {number} [x=0] - The world x position where the top left of this layer will be placed. - * @param {number} [y=0] - The world y position where the top left of this layer will be placed. - */ -var StaticTilemapLayer = new Class({ - - Extends: GameObject, - - Mixins: [ - Components.Alpha, - Components.BlendMode, - Components.ComputedSize, - Components.Depth, - Components.Flip, - Components.GetBounds, - Components.Origin, - Components.Pipeline, - Components.Transform, - Components.Visible, - Components.ScrollFactor, - StaticTilemapLayerRender, - ModelViewProjection - ], - - initialize: - - function StaticTilemapLayer (scene, tilemap, layerIndex, tileset, x, y) - { - GameObject.call(this, scene, 'StaticTilemapLayer'); - - /** - * Used internally by physics system to perform fast type checks. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#isTilemap - * @type {boolean} - * @readonly - * @since 3.0.0 - */ - this.isTilemap = true; - - /** - * The Tilemap that this layer is a part of. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilemap - * @type {Phaser.Tilemaps.Tilemap} - * @since 3.0.0 - */ - this.tilemap = tilemap; - - /** - * The index of the LayerData associated with this layer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#layerIndex - * @type {integer} - * @since 3.0.0 - */ - this.layerIndex = layerIndex; - - /** - * The LayerData associated with this layer. LayerData can only be associated with one - * tilemap layer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#layer - * @type {Phaser.Tilemaps.LayerData} - * @since 3.0.0 - */ - this.layer = tilemap.layers[layerIndex]; - - // Link the LayerData with this static tilemap layer - this.layer.tilemapLayer = this; - - /** - * The Tileset/s associated with this layer. - * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tileset - * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.0.0 - */ - this.tileset = []; - - /** - * Used internally by the Canvas renderer. - * This holds the tiles that are visible within the camera in the last frame. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#culledTiles - * @type {array} - * @since 3.0.0 - */ - this.culledTiles = []; - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#skipCull - * @type {boolean} - * @since 3.12.0 - */ - this.skipCull = false; - - /** - * Canvas only. - * - * The total number of tiles drawn by the renderer in the last frame. - * - * This only works when rending with Canvas. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilesDrawn - * @type {integer} - * @readonly - * @since 3.12.0 - */ - this.tilesDrawn = 0; - - /** - * Canvas only. - * - * The total number of tiles in this layer. Updated every frame. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#tilesTotal - * @type {integer} - * @readonly - * @since 3.12.0 - */ - this.tilesTotal = this.layer.width * this.layer.height; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. - * - * See the method `setCullPadding` for more details. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingX - * @type {integer} - * @default 1 - * @since 3.12.0 - */ - this.cullPaddingX = 1; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. - * - * See the method `setCullPadding` for more details. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullPaddingY - * @type {integer} - * @default 1 - * @since 3.12.0 - */ - this.cullPaddingY = 1; - - /** - * Canvas only. - * - * The callback that is invoked when the tiles are culled. - * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. - * - * It will be sent 3 arguments: - * - * 1. The Phaser.Tilemaps.LayerData object for this Layer - * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. - * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. - * - * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#cullCallback - * @type {function} - * @since 3.12.0 - */ - this.cullCallback = TilemapComponents.CullTiles; - - /** - * A reference to the renderer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#renderer - * @type {(Phaser.Renderer.Canvas.CanvasRenderer|Phaser.Renderer.WebGL.WebGLRenderer)} - * @private - * @since 3.0.0 - */ - this.renderer = scene.sys.game.renderer; - - /** - * An array of vertex buffer objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexBuffer - * @type {WebGLBuffer[]} - * @private - * @since 3.0.0 - */ - this.vertexBuffer = []; - - /** - * An array of ArrayBuffer objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#bufferData - * @type {ArrayBuffer[]} - * @private - * @since 3.0.0 - */ - this.bufferData = []; - - /** - * An array of Float32 Array objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewF32 - * @type {Float32Array[]} - * @private - * @since 3.0.0 - */ - this.vertexViewF32 = []; - - /** - * An array of Uint32 Array objects, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single instance. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexViewU32 - * @type {Uint32Array[]} - * @private - * @since 3.0.0 - */ - this.vertexViewU32 = []; - - /** - * An array of booleans, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single boolean. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#dirty - * @type {boolean[]} - * @private - * @since 3.0.0 - */ - this.dirty = []; - - /** - * An array of integers, used by the WebGL renderer. - * - * As of Phaser 3.14 this property is now an array, where each element maps to a Tileset instance. Previously it was a single integer. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#vertexCount - * @type {integer[]} - * @private - * @since 3.0.0 - */ - this.vertexCount = []; - - /** - * The rendering (draw) order of the tiles in this layer. - * - * The default is 0 which is 'right-down', meaning it will draw the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * This can be changed via the `setRenderOrder` method. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#_renderOrder - * @type {integer} - * @default 0 - * @private - * @since 3.12.0 - */ - this._renderOrder = 0; - - /** - * A temporary Transform Matrix, re-used internally during batching. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#_tempMatrix - * @private - * @type {Phaser.GameObjects.Components.TransformMatrix} - * @since 3.14.0 - */ - this._tempMatrix = new TransformMatrix(); - - /** - * An array holding the mapping between the tile indexes and the tileset they belong to. - * - * @name Phaser.Tilemaps.StaticTilemapLayer#gidMap - * @type {Phaser.Tilemaps.Tileset[]} - * @since 3.14.0 - */ - this.gidMap = []; - - this.setTilesets(tileset); - this.setAlpha(this.layer.alpha); - this.setPosition(x, y); - this.setOrigin(); - this.setSize(tilemap.tileWidth * this.layer.width, tilemap.tileHeight * this.layer.height); - - this.updateVBOData(); - - this.initPipeline(); - - this.mvpInit(); - - scene.sys.game.events.on(GameEvents.CONTEXT_RESTORED, function () - { - this.updateVBOData(); - }, this); - }, - - /** - * Populates the internal `tileset` array with the Tileset references this Layer requires for rendering. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTilesets - * @private - * @since 3.14.0 - * - * @param {(string|string[]|Phaser.Tilemaps.Tileset|Phaser.Tilemaps.Tileset[])} tileset - The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - */ - setTilesets: function (tilesets) - { - var gidMap = []; - var setList = []; - var map = this.tilemap; - - if (!Array.isArray(tilesets)) - { - tilesets = [ tilesets ]; - } - - for (var i = 0; i < tilesets.length; i++) - { - var tileset = tilesets[i]; - - if (typeof tileset === 'string') - { - tileset = map.getTileset(tileset); - } - - if (tileset) - { - setList.push(tileset); - - var s = tileset.firstgid; - - for (var t = 0; t < tileset.total; t++) - { - gidMap[s + t] = tileset; - } - } - } - - this.gidMap = gidMap; - this.tileset = setList; - }, - - /** - * Prepares the VBO data arrays for population by the `upload` method. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#updateVBOData - * @private - * @since 3.14.0 - * - * @return {this} This Tilemap Layer object. - */ - updateVBOData: function () - { - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - this.vertexCount[i] = 0; - this.vertexBuffer[i] = null; - this.bufferData[i] = null; - this.vertexViewF32[i] = null; - this.vertexViewU32[i] = null; - } - - return this; - }, - - /** - * If the given tileset is dirty, or hasn't been rendered before, this will create a new - * ArrayBuffer object and iterate through all of the tiles, generating batch data for - * each one, storing the final results into a STATIC vertex buffer. - * - * If the tileset isn't dirty, this method simply returns after setting the vertex buffer - * and buffering the data. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#upload - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera to render to. - * @param {integer} tilesetIndex - The tileset index. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - upload: function (camera, tilesetIndex) - { - var pipeline = this.pipeline; - - var renderer = this.renderer; - - var gl = renderer.gl; - - var vertexBuffer = this.vertexBuffer[tilesetIndex]; - var bufferData = this.bufferData[tilesetIndex]; - - if (!this.dirty[tilesetIndex] && vertexBuffer) - { - renderer.setVertexBuffer(vertexBuffer); - - pipeline.setAttribPointers(); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData); - - return this; - } - - var layer = this.layer; - var tileset = this.tileset[tilesetIndex]; - var mapWidth = layer.width; - var mapHeight = layer.height; - var width = tileset.image.source[0].width; - var height = tileset.image.source[0].height; - var mapData = layer.data; - var tile; - var row; - var col; - var renderOrder = this._renderOrder; - var minTileIndex = tileset.firstgid; - var maxTileIndex = tileset.firstgid + tileset.total; - var vOffset = -1; - var bufferSize = (mapWidth * mapHeight) * pipeline.vertexSize * 6; - - this.vertexCount[tilesetIndex] = 0; - - if (bufferData === null) - { - bufferData = new ArrayBuffer(bufferSize); - - this.bufferData[tilesetIndex] = bufferData; - - this.vertexViewF32[tilesetIndex] = new Float32Array(bufferData); - this.vertexViewU32[tilesetIndex] = new Uint32Array(bufferData); - } - - if (renderOrder === 0) - { - // right-down - - for (row = 0; row < mapHeight; row++) - { - for (col = 0; col < mapWidth; col++) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 1) - { - // left-down - - for (row = 0; row < mapHeight; row++) - { - for (col = mapWidth - 1; col >= 0; col--) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 2) - { - // right-up - - for (row = mapHeight - 1; row >= 0; row--) - { - for (col = 0; col < mapWidth; col++) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - else if (renderOrder === 3) - { - // left-up - - for (row = mapHeight - 1; row >= 0; row--) - { - for (col = mapWidth - 1; col >= 0; col--) - { - tile = mapData[row][col]; - - if (!tile || tile.index < minTileIndex || tile.index > maxTileIndex || !tile.visible) - { - continue; - } - - vOffset = this.batchTile(vOffset, tile, tileset, width, height, camera, tilesetIndex); - } - } - } - - this.dirty[tilesetIndex] = false; - - if (vertexBuffer === null) - { - vertexBuffer = renderer.createVertexBuffer(bufferData, gl.STATIC_DRAW); - - this.vertexBuffer[tilesetIndex] = vertexBuffer; - } - - renderer.setVertexBuffer(vertexBuffer); - - pipeline.setAttribPointers(); - - gl.bufferSubData(gl.ARRAY_BUFFER, 0, bufferData); - - return this; - }, - - /** - * Add a single tile into the batch. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#batchTile - * @private - * @since 3.12.0 - * - * @param {integer} vOffset - The vertex offset. - * @param {any} tile - The tile being rendered. - * @param {any} tileset - The tileset being used for rendering. - * @param {integer} width - The width of the tileset image in pixels. - * @param {integer} height - The height of the tileset image in pixels. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The camera the layer is being rendered with. - * @param {integer} tilesetIndex - The tileset index. - * - * @return {integer} The new vOffset value. - */ - batchTile: function (vOffset, tile, tileset, width, height, camera, tilesetIndex) - { - var texCoords = tileset.getTileTextureCoordinates(tile.index); - - if (!texCoords) - { - return vOffset; - } - - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - - var halfTileWidth = tileWidth / 2; - var halfTileHeight = tileHeight / 2; - - var u0 = texCoords.x / width; - var v0 = texCoords.y / height; - var u1 = (texCoords.x + tileWidth) / width; - var v1 = (texCoords.y + tileHeight) / height; - - var matrix = this._tempMatrix; - - var x = -halfTileWidth; - var y = -halfTileHeight; - - if (tile.flipX) - { - tileWidth *= -1; - x += tileset.tileWidth; - } - - if (tile.flipY) - { - tileHeight *= -1; - y += tileset.tileHeight; - } - - var xw = x + tileWidth; - var yh = y + tileHeight; - - matrix.applyITRS(halfTileWidth + tile.pixelX, halfTileHeight + tile.pixelY, tile.rotation, 1, 1); - - var tint = Utils.getTintAppendFloatAlpha(0xffffff, camera.alpha * this.alpha * tile.alpha); - - var tx0 = matrix.getX(x, y); - var ty0 = matrix.getY(x, y); - - var tx1 = matrix.getX(x, yh); - var ty1 = matrix.getY(x, yh); - - var tx2 = matrix.getX(xw, yh); - var ty2 = matrix.getY(xw, yh); - - var tx3 = matrix.getX(xw, y); - var ty3 = matrix.getY(xw, y); - - if (camera.roundPixels) - { - tx0 = Math.round(tx0); - ty0 = Math.round(ty0); - - tx1 = Math.round(tx1); - ty1 = Math.round(ty1); - - tx2 = Math.round(tx2); - ty2 = Math.round(ty2); - - tx3 = Math.round(tx3); - ty3 = Math.round(ty3); - } - - var vertexViewF32 = this.vertexViewF32[tilesetIndex]; - var vertexViewU32 = this.vertexViewU32[tilesetIndex]; - - vertexViewF32[++vOffset] = tx0; - vertexViewF32[++vOffset] = ty0; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx1; - vertexViewF32[++vOffset] = ty1; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx2; - vertexViewF32[++vOffset] = ty2; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx0; - vertexViewF32[++vOffset] = ty0; - vertexViewF32[++vOffset] = u0; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx2; - vertexViewF32[++vOffset] = ty2; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v1; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - vertexViewF32[++vOffset] = tx3; - vertexViewF32[++vOffset] = ty3; - vertexViewF32[++vOffset] = u1; - vertexViewF32[++vOffset] = v0; - vertexViewF32[++vOffset] = 0; - vertexViewF32[++vOffset] = 0; - vertexViewU32[++vOffset] = tint; - - this.vertexCount[tilesetIndex] += 6; - - return vOffset; - }, - - /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setRenderOrder - * @since 3.12.0 - * - * @param {(integer|string)} renderOrder - The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. - * - * @return {this} This Tilemap Layer object. - */ - setRenderOrder: function (renderOrder) - { - var orders = [ 'right-down', 'left-down', 'right-up', 'left-up' ]; - - if (typeof renderOrder === 'string') - { - renderOrder = orders.indexOf(renderOrder); - } - - if (renderOrder >= 0 && renderOrder < 4) - { - this._renderOrder = renderOrder; - - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - } - } - - return this; - }, - - /** - * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting - * faces are used internally for optimizing collisions against tiles. This method is mostly used - * internally to optimize recalculating faces when only one tile has been changed. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesAt - * @since 3.0.0 - * - * @param {integer} tileX - The x coordinate. - * @param {integer} tileY - The y coordinate. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - calculateFacesAt: function (tileX, tileY) - { - TilemapComponents.CalculateFacesAt(tileX, tileY, this.layer); - - return this; - }, - - /** - * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the - * layer. Interesting faces are used internally for optimizing collisions against tiles. This method - * is mostly used internally. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#calculateFacesWithin - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The top most tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - calculateFacesWithin: function (tileX, tileY, width, height) - { - TilemapComponents.CalculateFacesWithin(tileX, tileY, width, height, this.layer); - - return this; - }, - - /** - * Creates a Sprite for every object matching the given tile indexes in the layer. You can - * optionally specify if each tile will be replaced with a new tile after the Sprite has been - * created. This is useful if you want to lay down special tiles in a level that are converted to - * Sprites, but want to replace the tile itself with a floor tile or similar once converted. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#createFromTiles - * @since 3.0.0 - * - * @param {(integer|array)} indexes - The tile index, or array of indexes, to create Sprites from. - * @param {(integer|array)} replacements - The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param {Phaser.Types.GameObjects.Sprite.SpriteConfig} spriteConfig - The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param {Phaser.Scene} [scene=scene the map is within] - The Scene to create the Sprites within. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when determining the world XY - * - * @return {Phaser.GameObjects.Sprite[]} An array of the Sprites that were created. - */ - createFromTiles: function (indexes, replacements, spriteConfig, scene, camera) - { - return TilemapComponents.CreateFromTiles(indexes, replacements, spriteConfig, scene, camera, this.layer); - }, - - /** - * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#cull - * @since 3.0.0 - * - * @param {Phaser.Cameras.Scene2D.Camera} [camera] - The Camera to run the cull check against. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - cull: function (camera) - { - return this.cullCallback(this.layer, camera, this.culledTiles); - }, - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setSkipCull - * @since 3.12.0 - * - * @param {boolean} [value=true] - Set to `true` to stop culling tiles. Set to `false` to enable culling again. - * - * @return {this} This Tilemap Layer object. - */ - setSkipCull: function (value) - { - if (value === undefined) { value = true; } - - this.skipCull = value; - - return this; - }, - - /** - * Canvas only. - * - * When a Camera culls the tiles in this layer it does so using its view into the world, building up a - * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size - * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so - * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px - * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCullPadding - * @since 3.12.0 - * - * @param {integer} [paddingX=1] - The amount of extra horizontal tiles to add to the cull check padding. - * @param {integer} [paddingY=1] - The amount of extra vertical tiles to add to the cull check padding. - * - * @return {this} This Tilemap Layer object. - */ - setCullPadding: function (paddingX, paddingY) - { - if (paddingX === undefined) { paddingX = 1; } - if (paddingY === undefined) { paddingY = 1; } - - this.cullPaddingX = paddingX; - this.cullPaddingY = paddingY; - - return this; - }, - - /** - * Searches the entire map layer for the first tile matching the given index, then returns that Tile - * object. If no match is found, it returns null. The search starts from the top-left tile and - * continues horizontally until it hits the end of the row, then it drops down to the next column. - * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to - * the top-left. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#findByIndex - * @since 3.0.0 - * - * @param {integer} index - The tile index value to search for. - * @param {integer} [skip=0] - The number of times to skip a matching tile before returning. - * @param {boolean} [reverse=false] - If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. - * - * @return {Phaser.Tilemaps.Tile} A Tile object. - */ - findByIndex: function (findIndex, skip, reverse) - { - return TilemapComponents.FindByIndex(findIndex, skip, reverse, this.layer); - }, - - /** - * Find the first tile in the given rectangular area (in tile coordinates) of the layer that - * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns - * true. Similar to Array.prototype.find in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#findTile - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The left most tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {?Phaser.Tilemaps.Tile} - */ - findTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FindTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns - * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#filterTiles - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. The callback should return true for tiles that pass the - * filter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - filterTiles: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.FilterTiles(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * callback. Similar to Array.prototype.forEach in vanilla JS. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#forEachTile - * @since 3.0.0 - * - * @param {function} callback - The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param {object} [context] - The context under which the callback should be run. - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - forEachTile: function (callback, context, tileX, tileY, width, height, filteringOptions) - { - TilemapComponents.ForEachTile(callback, context, tileX, tileY, width, height, filteringOptions, this.layer); - - return this; - }, - - /** - * Gets a tile at the given tile coordinates from the given layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAt - * @since 3.0.0 - * - * @param {integer} tileX - X position to get the tile from (given in tile units, not pixels). - * @param {integer} tileY - Y position to get the tile from (given in tile units, not pixels). - * @param {boolean} [nonNull=false] - If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates were invalid. - */ - getTileAt: function (tileX, tileY, nonNull) - { - return TilemapComponents.GetTileAt(tileX, tileY, nonNull, this.layer); - }, - - /** - * Gets a tile at the given world coordinates from the given layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - X position to get the tile from (given in pixels) - * @param {number} worldY - Y position to get the tile from (given in pixels) - * @param {boolean} [nonNull=false] - If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile} The tile at the given coordinates or null if no tile was found or the coordinates - * were invalid. - */ - getTileAtWorldXY: function (worldX, worldY, nonNull, camera) - { - return TilemapComponents.GetTileAtWorldXY(worldX, worldY, nonNull, camera, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithin - * @since 3.0.0 - * - * @param {integer} [tileX=0] - The leftmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [tileY=0] - The topmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} [width=max width based on tileX] - How many tiles wide from the `tileX` index the area will be. - * @param {integer} [height=max height based on tileY] - How many tiles tall from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithin: function (tileX, tileY, width, height, filteringOptions) - { - return TilemapComponents.GetTilesWithin(tileX, tileY, width, height, filteringOptions, this.layer); - }, - - /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {number} worldY - The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param {number} width - How many tiles wide from the `tileX` index the area will be. - * @param {number} height - How many tiles high from the `tileY` index the area will be. - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when factoring in which tiles to return. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinWorldXY: function (worldX, worldY, width, height, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinWorldXY(worldX, worldY, width, height, filteringOptions, camera, this.layer); - }, - - /** - * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, - * Line, Rectangle or Triangle. The shape should be in world coordinates. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#getTilesWithinShape - * @since 3.0.0 - * - * @param {(Phaser.Geom.Circle|Phaser.Geom.Line|Phaser.Geom.Rectangle|Phaser.Geom.Triangle)} shape - A shape in world (pixel) coordinates - * @param {Phaser.Types.Tilemaps.FilteringOptions} [filteringOptions] - Optional filters to apply when getting the tiles. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Tilemaps.Tile[]} An array of Tile objects. - */ - getTilesWithinShape: function (shape, filteringOptions, camera) - { - return TilemapComponents.GetTilesWithinShape(shape, filteringOptions, camera, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAt - * @since 3.0.0 - * - * @param {integer} tileX - X position to get the tile from in tile coordinates. - * @param {integer} tileY - Y position to get the tile from in tile coordinates. - * - * @return {boolean} - */ - hasTileAt: function (tileX, tileY) - { - return TilemapComponents.HasTileAt(tileX, tileY, this.layer); - }, - - /** - * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#hasTileAtWorldXY - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate of the world position. - * @param {number} worldY - The Y coordinate of the world position. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {boolean} - */ - hasTileAtWorldXY: function (worldX, worldY, camera) - { - return TilemapComponents.HasTileAtWorldXY(worldX, worldY, camera, this.layer); - }, - - /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to - * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles - * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation - * wherever you want on the screen. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderDebug - * @since 3.0.0 - * - * @param {Phaser.GameObjects.Graphics} graphics - The target Graphics object to draw upon. - * @param {Phaser.Types.Tilemaps.StyleConfig} styleConfig - An object specifying the colors to use for the debug drawing. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - renderDebug: function (graphics, styleConfig) - { - TilemapComponents.RenderDebug(graphics, styleConfig, this.layer); - - return this; - }, - - /** - * Sets collision on the given tile or tiles within a layer by index. You can pass in either a - * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if - * collision will be enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollision - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * @param {boolean} [updateLayer=true] - If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollision: function (indexes, collides, recalculateFaces, updateLayer) - { - TilemapComponents.SetCollision(indexes, collides, recalculateFaces, this.layer, updateLayer); - - return this; - }, - - /** - * Sets collision on a range of tiles in a layer whose index is between the specified `start` and - * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set - * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be - * enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionBetween - * @since 3.0.0 - * - * @param {integer} start - The first index of the tile to be set for collision. - * @param {integer} stop - The last index of the tile to be set for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionBetween: function (start, stop, collides, recalculateFaces) - { - TilemapComponents.SetCollisionBetween(start, stop, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property - * that matches the given properties object, its collision flag will be set. The `collides` - * parameter controls if collision will be enabled (true) or disabled (false). Passing in - * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that - * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can - * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a - * "types" property that matches any of those values, its collision flag will be updated. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByProperty - * @since 3.0.0 - * - * @param {object} properties - An object with tile properties and corresponding values that should - * be checked. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionByProperty: function (properties, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByProperty(properties, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets collision on all tiles in the given layer, except for tiles that have an index specified in - * the given array. The `collides` parameter controls if collision will be enabled (true) or - * disabled (false). Tile indexes not currently in the layer are not affected. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionByExclusion - * @since 3.0.0 - * - * @param {integer[]} indexes - An array of the tile indexes to not be counted for collision. - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionByExclusion: function (indexes, collides, recalculateFaces) - { - TilemapComponents.SetCollisionByExclusion(indexes, collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets a global collision callback for the given tile index within the layer. This will affect all - * tiles on this layer that have the same index. If a callback is already set for the tile index it - * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTileIndexCallback - * @since 3.0.0 - * - * @param {(integer|array)} indexes - Either a single tile index, or an array of tile indexes to have a - * collision callback set for. - * @param {function} callback - The callback that will be invoked when the tile is collided with. - * @param {object} callbackContext - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setTileIndexCallback: function (indexes, callback, callbackContext) - { - TilemapComponents.SetTileIndexCallback(indexes, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Sets collision on the tiles within a layer by checking each tiles collision group data - * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tiles collision group, the tile's colliding information will be set. The `collides` parameter - * controls if collision will be enabled (true) or disabled (false). - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setCollisionFromCollisionGroup - * @since 3.0.0 - * - * @param {boolean} [collides=true] - If true it will enable collision. If false it will clear - * collision. - * @param {boolean} [recalculateFaces=true] - Whether or not to recalculate the tile faces after the - * update. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setCollisionFromCollisionGroup: function (collides, recalculateFaces) - { - TilemapComponents.SetCollisionFromCollisionGroup(collides, recalculateFaces, this.layer); - - return this; - }, - - /** - * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. - * If a callback is already set for the tile index it will be replaced. Set the callback to null to - * remove it. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#setTileLocationCallback - * @since 3.0.0 - * - * @param {integer} tileX - The leftmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} tileY - The topmost tile index (in tile coordinates) to use as the origin of the area. - * @param {integer} width - How many tiles wide from the `tileX` index the area will be. - * @param {integer} height - How many tiles tall from the `tileY` index the area will be. - * @param {function} callback - The callback that will be invoked when the tile is collided with. - * @param {object} [callbackContext] - The context under which the callback is called. - * - * @return {Phaser.Tilemaps.StaticTilemapLayer} This Tilemap Layer object. - */ - setTileLocationCallback: function (tileX, tileY, width, height, callback, callbackContext) - { - TilemapComponents.SetTileLocationCallback(tileX, tileY, width, height, callback, callbackContext, this.layer); - - return this; - }, - - /** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldX - * @since 3.0.0 - * - * @param {integer} tileX - The X coordinate, in tile coordinates. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {number} - */ - tileToWorldX: function (tileX, camera) - { - return TilemapComponents.TileToWorldX(tileX, camera, this.layer); - }, - - /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldY - * @since 3.0.0 - * - * @param {integer} tileY - The Y coordinate, in tile coordinates. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {number} - */ - tileToWorldY: function (tileY, camera) - { - return TilemapComponents.TileToWorldY(tileY, camera, this.layer); - }, - - /** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#tileToWorldXY - * @since 3.0.0 - * - * @param {integer} tileX - The X coordinate, in tile coordinates. - * @param {integer} tileY - The Y coordinate, in tile coordinates. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the world values from the tile index. - * - * @return {Phaser.Math.Vector2} - */ - tileToWorldXY: function (tileX, tileY, point, camera) - { - return TilemapComponents.TileToWorldXY(tileX, tileY, point, camera, this.layer); - }, - - /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileX - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values.] - * - * @return {number} - */ - worldToTileX: function (worldX, snapToFloor, camera) - { - return TilemapComponents.WorldToTileX(worldX, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileY - * @since 3.0.0 - * - * @param {number} worldY - The Y coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {number} - */ - worldToTileY: function (worldY, snapToFloor, camera) - { - return TilemapComponents.WorldToTileY(worldY, snapToFloor, camera, this.layer); - }, - - /** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#worldToTileXY - * @since 3.0.0 - * - * @param {number} worldX - The X coordinate, in world pixels. - * @param {number} worldY - The Y coordinate, in world pixels. - * @param {boolean} [snapToFloor=true] - Whether or not to round the tile coordinate down to the - * nearest integer. - * @param {Phaser.Math.Vector2} [point] - A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param {Phaser.Cameras.Scene2D.Camera} [camera=main camera] - The Camera to use when calculating the tile index from the world values. - * - * @return {Phaser.Math.Vector2} - */ - worldToTileXY: function (worldX, worldY, snapToFloor, point, camera) - { - return TilemapComponents.WorldToTileXY(worldX, worldY, snapToFloor, point, camera, this.layer); - }, - - /** - * Destroys this StaticTilemapLayer and removes its link to the associated LayerData. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#destroy - * @since 3.0.0 - * - * @param {boolean} [removeFromTilemap=true] - Remove this layer from the parent Tilemap? - */ - destroy: function (removeFromTilemap) - { - if (removeFromTilemap === undefined) { removeFromTilemap = true; } - - if (!this.tilemap) - { - // Abort, we've already been destroyed - return; - } - - // Uninstall this layer only if it is still installed on the LayerData object - if (this.layer.tilemapLayer === this) - { - this.layer.tilemapLayer = undefined; - } - - if (removeFromTilemap) - { - this.tilemap.removeLayer(this); - } - - this.tilemap = undefined; - this.layer = undefined; - this.culledTiles.length = 0; - this.cullCallback = null; - - for (var i = 0; i < this.tileset.length; i++) - { - this.dirty[i] = true; - this.vertexCount[i] = 0; - this.vertexBuffer[i] = null; - this.bufferData[i] = null; - this.vertexViewF32[i] = null; - this.vertexViewU32[i] = null; - } - - this.gidMap = []; - this.tileset = []; - - GameObject.prototype.destroy.call(this); - } - -}); - -module.exports = StaticTilemapLayer; diff --git a/src/tilemaps/staticlayer/StaticTilemapLayerCanvasRenderer.js b/src/tilemaps/staticlayer/StaticTilemapLayerCanvasRenderer.js deleted file mode 100644 index a33068847..000000000 --- a/src/tilemaps/staticlayer/StaticTilemapLayerCanvasRenderer.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -/** - * Renders this Game Object with the Canvas Renderer to the given Camera. - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderCanvas - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.Canvas.CanvasRenderer} renderer - A reference to the current active Canvas renderer. - * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - * @param {Phaser.GameObjects.Components.TransformMatrix} parentMatrix - This transform matrix is defined if the game object is nested - */ -var StaticTilemapLayerCanvasRenderer = function (renderer, src, camera, parentMatrix) -{ - src.cull(camera); - - var renderTiles = src.culledTiles; - var tileCount = renderTiles.length; - - if (tileCount === 0) - { - return; - } - - var camMatrix = renderer._tempMatrix1; - var layerMatrix = renderer._tempMatrix2; - var calcMatrix = renderer._tempMatrix3; - - layerMatrix.applyITRS(src.x, src.y, src.rotation, src.scaleX, src.scaleY); - - camMatrix.copyFrom(camera.matrix); - - var ctx = renderer.currentContext; - var gidMap = src.gidMap; - - ctx.save(); - - if (parentMatrix) - { - // Multiply the camera by the parent matrix - camMatrix.multiplyWithOffset(parentMatrix, -camera.scrollX * src.scrollFactorX, -camera.scrollY * src.scrollFactorY); - - // Undo the camera scroll - layerMatrix.e = src.x; - layerMatrix.f = src.y; - - camMatrix.multiply(layerMatrix, calcMatrix); - - calcMatrix.copyToContext(ctx); - } - else - { - // Undo the camera scroll - layerMatrix.e -= camera.scrollX * src.scrollFactorX; - layerMatrix.f -= camera.scrollY * src.scrollFactorY; - - layerMatrix.copyToContext(ctx); - } - - var alpha = camera.alpha * src.alpha; - - if (!renderer.antialias || src.scaleX > 1 || src.scaleY > 1) - { - ctx.imageSmoothingEnabled = false; - } - - for (var i = 0; i < tileCount; i++) - { - var tile = renderTiles[i]; - - var tileset = gidMap[tile.index]; - - if (!tileset) - { - continue; - } - - var image = tileset.image.getSourceImage(); - var tileTexCoords = tileset.getTileTextureCoordinates(tile.index); - - if (tileTexCoords) - { - var tileWidth = tileset.tileWidth; - var tileHeight = tileset.tileHeight; - var halfWidth = tileWidth / 2; - var halfHeight = tileHeight / 2; - - ctx.save(); - - ctx.translate(tile.pixelX + halfWidth, tile.pixelY + halfHeight); - - if (tile.rotation !== 0) - { - ctx.rotate(tile.rotation); - } - - if (tile.flipX || tile.flipY) - { - ctx.scale((tile.flipX) ? -1 : 1, (tile.flipY) ? -1 : 1); - } - - ctx.globalAlpha = alpha * tile.alpha; - - ctx.drawImage( - image, - tileTexCoords.x, tileTexCoords.y, - tileWidth, tileHeight, - -halfWidth, -halfHeight, - tileWidth, tileHeight - ); - - ctx.restore(); - } - } - - ctx.restore(); -}; - -module.exports = StaticTilemapLayerCanvasRenderer; diff --git a/src/tilemaps/staticlayer/StaticTilemapLayerWebGLRenderer.js b/src/tilemaps/staticlayer/StaticTilemapLayerWebGLRenderer.js deleted file mode 100644 index 64e9b5164..000000000 --- a/src/tilemaps/staticlayer/StaticTilemapLayerWebGLRenderer.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @author Richard Davey - * @copyright 2020 Photon Storm Ltd. - * @license {@link https://opensource.org/licenses/MIT|MIT License} - */ - -var Identity = require('../../renderer/webgl/mvp/Identity'); -var Scale = require('../../renderer/webgl/mvp/Scale'); -var Translate = require('../../renderer/webgl/mvp/Translate'); -var ViewLoad2D = require('../../renderer/webgl/mvp/ViewLoad2D'); - -/** - * Renders this Game Object with the WebGL Renderer to the given Camera. - * - * The object will not render if any of its renderFlags are set or it is being actively filtered out by the Camera. - * This method should not be called directly. It is a utility function of the Render module. - * - * A Static Tilemap Layer renders immediately and does not use any batching. - * - * @method Phaser.Tilemaps.StaticTilemapLayer#renderWebGL - * @since 3.0.0 - * @private - * - * @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - A reference to the current active WebGL renderer. - * @param {Phaser.Tilemaps.StaticTilemapLayer} src - The Game Object being rendered in this call. - * @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object. - */ -var StaticTilemapLayerWebGLRenderer = function (renderer, src, camera) -{ - var gl = renderer.gl; - var pipeline = src.pipeline; - - renderer.flush(); - - // Restore when we're done - var pipelineVertexBuffer = pipeline.vertexBuffer; - - Identity(src); - Translate(src, src.x - (camera.scrollX * src.scrollFactorX), src.y - (camera.scrollY * src.scrollFactorY), 0); - Scale(src, src.scaleX, src.scaleY, 1); - ViewLoad2D(src, camera.matrix.matrix); - - renderer.pipelines.set(pipeline); - - // The above alters the uniforms, so make sure we call it _after_ setting the MVP stuff above - renderer.setMatrix4(pipeline.program, 'uModelMatrix', false, src.modelMatrix); - renderer.setMatrix4(pipeline.program, 'uViewMatrix', false, src.viewMatrix); - renderer.setMatrix4(pipeline.program, 'uProjectionMatrix', false, pipeline.projectionMatrix); - - for (var i = 0; i < src.tileset.length; i++) - { - var tileset = src.tileset[i]; - var vertexCount = src.vertexCount[i]; - - src.upload(camera, i); - - if (vertexCount > 0) - { - if (pipeline.forceZero) - { - // Light Pipeline, or similar - pipeline.setGameObject(src, tileset); - } - else - { - renderer.setTextureZero(tileset.glTexture); - } - - gl.drawArrays(gl.TRIANGLES, 0, vertexCount); - } - } - - renderer.resetTextures(); - - // Restore the pipeline buffer - pipeline.vertexBuffer = pipelineVertexBuffer; - - renderer.currentVertexBuffer = pipelineVertexBuffer; - - pipeline.setAttribPointers(); - - // Reset the uniforms - renderer.setMatrix4(pipeline.program, 'uModelMatrix', false, pipeline.modelMatrix); - renderer.setMatrix4(pipeline.program, 'uViewMatrix', false, pipeline.viewMatrix); - renderer.setMatrix4(pipeline.program, 'uProjectionMatrix', false, pipeline.projectionMatrix); -}; - -module.exports = StaticTilemapLayerWebGLRenderer; diff --git a/src/tilemaps/typedefs/CreateFromObjectLayerConfig.js b/src/tilemaps/typedefs/CreateFromObjectLayerConfig.js new file mode 100644 index 000000000..d2e2be125 --- /dev/null +++ b/src/tilemaps/typedefs/CreateFromObjectLayerConfig.js @@ -0,0 +1,13 @@ +/** + * @typedef {object} Phaser.Types.Tilemaps.CreateFromObjectLayerConfig + * @since 3.50.0 + * + * @property {number} [id] - A unique Object ID to convert. + * @property {number} [gid] - An Object GID to convert. + * @property {string} [name] - An Object Name to convert. + * @property {Phaser.GameObjects.GameObject} [classType=Phaser.GameObjects.Sprite] - A custom class type to convert the objects in to. + * @property {Phaser.Scene} [scene] - A Scene reference, passed to the Game Objects constructors. + * @property {Phaser.GameObjects.Container} [container] - Optional Container to which the Game Objects are added. + * @property {(string|Phaser.Textures.Texture)} [key] - Optional key of a Texture to be used, as stored in the Texture Manager, or a Texture instance. + * @property {(string|number)} [frame] - Optional name or index of the frame within the Texture. + */ diff --git a/src/tilemaps/typedefs/DebugStyleOptions.js b/src/tilemaps/typedefs/DebugStyleOptions.js new file mode 100644 index 000000000..e11f91924 --- /dev/null +++ b/src/tilemaps/typedefs/DebugStyleOptions.js @@ -0,0 +1,11 @@ +/** + * @typedef {object} Phaser.Types.Tilemaps.DebugStyleOptions + * @since 3.0.0 + * + * @property {?Phaser.Display.Color} [styleConfig.tileColor=blue] - Color to use for drawing a filled rectangle at + * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + * @property {?Phaser.Display.Color} [styleConfig.collidingTileColor=orange] - Color to use for drawing a filled + * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + * @property {?Phaser.Display.Color} [styleConfig.faceColor=grey] - Color to use for drawing a line at interesting + * tile faces. If set to null, interesting tile faces will not be drawn. + */ diff --git a/src/tilemaps/typedefs/GetTilesWithinFilteringOptions.js b/src/tilemaps/typedefs/GetTilesWithinFilteringOptions.js deleted file mode 100644 index a5f9ed9c7..000000000 --- a/src/tilemaps/typedefs/GetTilesWithinFilteringOptions.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @typedef {object} Phaser.Types.Tilemaps.GetTilesWithinFilteringOptions - * @since 3.0.0 - * - * @property {boolean} [isNotEmpty=false] - If true, only return tiles that don't have -1 for an index. - * @property {boolean} [isColliding=false] - If true, only return tiles that collide on at least one side. - * @property {boolean} [hasInterestingFace=false] - If true, only return tiles that have at least one interesting face. - */ diff --git a/src/tilemaps/typedefs/LayerDataConfig.js b/src/tilemaps/typedefs/LayerDataConfig.js index e3315890b..8e2ee613f 100644 --- a/src/tilemaps/typedefs/LayerDataConfig.js +++ b/src/tilemaps/typedefs/LayerDataConfig.js @@ -1,7 +1,7 @@ /** * @typedef {object} Phaser.Types.Tilemaps.LayerDataConfig * @since 3.0.0 - * + * * @property {string} [name] - The name of the layer, if specified in Tiled. * @property {number} [x=0] - The x offset of where to draw from the top left. * @property {number} [y=0] - The y offset of where to draw from the top left. @@ -21,5 +21,5 @@ * @property {array} [callbacks] - An array of callbacks. * @property {array} [bodies] - An array of physics bodies. * @property {array} [data] - An array of the tile data indexes. - * @property {Phaser.Tilemaps.DynamicTilemapLayer|Phaser.Tilemaps.StaticTilemapLayer} [tilemapLayer] - A reference to the Tilemap layer that owns this data. + * @property {Phaser.Tilemaps.TilemapLayer} [tilemapLayer] - A reference to the Tilemap layer that owns this data. */ diff --git a/src/tilemaps/typedefs/MapDataConfig.js b/src/tilemaps/typedefs/MapDataConfig.js index 1ccb8fe04..0d7a1b99b 100644 --- a/src/tilemaps/typedefs/MapDataConfig.js +++ b/src/tilemaps/typedefs/MapDataConfig.js @@ -9,7 +9,7 @@ * @property {number} [tileHeight=0] - The height of the tiles. * @property {number} [widthInPixels] - The width in pixels of the entire tilemap. * @property {number} [heightInPixels] - The height in pixels of the entire tilemap. - * @property {integer} [format] - The format of the Tilemap, as defined in Tiled. + * @property {number} [format] - The format of the Tilemap, as defined in Tiled. * @property {string} [orientation] - The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. * @property {string} [renderOrder] - Determines the draw order of tilemap. Default is right-down. * @property {number} [version] - The version of Tiled the map uses. diff --git a/src/tilemaps/typedefs/TiledObject.js b/src/tilemaps/typedefs/TiledObject.js index dd84526cd..ef50a2480 100644 --- a/src/tilemaps/typedefs/TiledObject.js +++ b/src/tilemaps/typedefs/TiledObject.js @@ -2,7 +2,7 @@ * @typedef {object} Phaser.Types.Tilemaps.TiledObject * @since 3.0.0 * - * @property {integer} id - The unique object ID. + * @property {number} id - The unique object ID. * @property {string} name - The name this object was assigned in Tiled. * @property {string} type - The type, as assigned in Tiled. * @property {boolean} [visible] - The visible state of this object. @@ -12,7 +12,7 @@ * @property {number} [height] - The height of this object, in pixels. * @property {number} [rotation] - The rotation of the object in clockwise degrees. * @property {any} [properties] - Custom properties object. - * @property {integer} [gid] - Only set if of type 'tile'. + * @property {number} [gid] - Only set if of type 'tile'. * @property {boolean} [flippedHorizontal] - Only set if a tile object. The horizontal flip value. * @property {boolean} [flippedVertical] - Only set if a tile object. The vertical flip value. * @property {boolean} [flippedAntiDiagonal] - Only set if a tile object. The diagonal flip value. diff --git a/src/tilemaps/typedefs/TilemapConfig.js b/src/tilemaps/typedefs/TilemapConfig.js index 3a024d4fa..206fc37be 100644 --- a/src/tilemaps/typedefs/TilemapConfig.js +++ b/src/tilemaps/typedefs/TilemapConfig.js @@ -3,11 +3,11 @@ * @since 3.0.0 * * @property {string} [key] - The key in the Phaser cache that corresponds to the loaded tilemap data. - * @property {integer[][]} [data] - Instead of loading from the cache, you can also load directly from a 2D array of tile indexes. - * @property {integer} [tileWidth=32] - The width of a tile in pixels. - * @property {integer} [tileHeight=32] - The height of a tile in pixels. - * @property {integer} [width=10] - The width of the map in tiles. - * @property {integer} [height=10] - The height of the map in tiles. + * @property {number[][]} [data] - Instead of loading from the cache, you can also load directly from a 2D array of tile indexes. + * @property {number} [tileWidth=32] - The width of a tile in pixels. + * @property {number} [tileHeight=32] - The height of a tile in pixels. + * @property {number} [width=10] - The width of the map in tiles. + * @property {number} [height=10] - The height of the map in tiles. * @property {boolean} [insertNull=false] - Controls how empty tiles, tiles with an index of -1, * in the map data are handled. If `true`, empty locations will get a value of `null`. If `false`, * empty location will get a Tile object with an index of -1. If you've a large sparsely populated diff --git a/src/time/TimerEvent.js b/src/time/TimerEvent.js index 5e47d649b..51f5f47c0 100644 --- a/src/time/TimerEvent.js +++ b/src/time/TimerEvent.js @@ -268,6 +268,58 @@ var TimerEvent = new Class({ return this.elapsed * 0.001; }, + /** + * Returns the time interval until the next iteration of the Timer Event. + * + * @method Phaser.Time.TimerEvent#getRemaining + * @since 3.50.0 + * + * @return {number} The time interval in milliseconds. + */ + getRemaining: function () + { + return this.delay - this.elapsed; + }, + + /** + * Returns the time interval until the next iteration of the Timer Event in seconds. + * + * @method Phaser.Time.TimerEvent#getRemainingSeconds + * @since 3.50.0 + * + * @return {number} The time interval in seconds. + */ + getRemainingSeconds: function () + { + return this.getRemaining() * 0.001; + }, + + /** + * Returns the time interval until the last iteration of the Timer Event. + * + * @method Phaser.Time.TimerEvent#getOverallRemaining + * @since 3.50.0 + * + * @return {number} The time interval in milliseconds. + */ + getOverallRemaining: function () + { + return this.delay * (1 + this.repeatCount) - this.elapsed; + }, + + /** + * Returns the time interval until the last iteration of the Timer Event in seconds. + * + * @method Phaser.Time.TimerEvent#getOverallRemainingSeconds + * @since 3.50.0 + * + * @return {number} The time interval in seconds. + */ + getOverallRemainingSeconds: function () + { + return this.getOverallRemaining() * 0.001; + }, + /** * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. * diff --git a/src/tweens/Timeline.js b/src/tweens/Timeline.js index 977849a49..40a299af6 100644 --- a/src/tweens/Timeline.js +++ b/src/tweens/Timeline.js @@ -150,7 +150,7 @@ var Timeline = new Class({ * The current state of the Timeline. * * @name Phaser.Tweens.Timeline#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = TWEEN_CONST.PENDING_ADD; @@ -159,7 +159,7 @@ var Timeline = new Class({ * The state of the Timeline when it was paused (used by Resume) * * @name Phaser.Tweens.Timeline#_pausedState - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ diff --git a/src/tweens/TweenManager.js b/src/tweens/TweenManager.js index 61da46421..2c6fcb26f 100644 --- a/src/tweens/TweenManager.js +++ b/src/tweens/TweenManager.js @@ -105,7 +105,7 @@ var TweenManager = new Class({ * The number of Tweens and Timelines which need to be processed by the Tween Manager at the start of the frame. * * @name Phaser.Tweens.TweenManager#_toProcess - * @type {integer} + * @type {number} * @private * @default 0 * @since 3.0.0 diff --git a/src/tweens/tween/Tween.js b/src/tweens/tween/Tween.js index fee57d4c0..7faa51a84 100644 --- a/src/tweens/tween/Tween.js +++ b/src/tweens/tween/Tween.js @@ -70,7 +70,7 @@ var Tween = new Class({ * The cached length of the data array. * * @name Phaser.Tweens.Tween#totalData - * @type {integer} + * @type {number} * @since 3.0.0 */ this.totalData = data.length; @@ -88,7 +88,7 @@ var Tween = new Class({ * Cached target total (not necessarily the same as the data total) * * @name Phaser.Tweens.Tween#totalTargets - * @type {integer} + * @type {number} * @since 3.0.0 */ this.totalTargets = targets.length; @@ -223,7 +223,7 @@ var Tween = new Class({ * The current state of the tween * * @name Phaser.Tweens.Tween#state - * @type {integer} + * @type {number} * @since 3.0.0 */ this.state = TWEEN_CONST.PENDING_ADD; @@ -232,7 +232,7 @@ var Tween = new Class({ * The state of the tween when it was paused (used by Resume) * * @name Phaser.Tweens.Tween#_pausedState - * @type {integer} + * @type {number} * @private * @since 3.0.0 */ @@ -352,7 +352,7 @@ var Tween = new Class({ * @method Phaser.Tweens.Tween#getValue * @since 3.0.0 * - * @param {integer} [index=0] - The Tween Data to return the value from. + * @param {number} [index=0] - The Tween Data to return the value from. * * @return {number} The value of the requested Tween Data. */ @@ -1284,7 +1284,7 @@ var Tween = new Class({ * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. * - * @return {integer} The state of this Tween. + * @return {number} The state of this Tween. */ setStateFromEnd: function (tween, tweenData, diff) { @@ -1370,7 +1370,7 @@ var Tween = new Class({ * @param {Phaser.Types.Tweens.TweenDataConfig} tweenData - The TweenData property to update. * @param {number} diff - Any extra time that needs to be accounted for in the elapsed and progress values. * - * @return {integer} The state of this Tween. + * @return {number} The state of this Tween. */ setStateFromStart: function (tween, tweenData, diff) { diff --git a/src/tweens/tween/TweenData.js b/src/tweens/tween/TweenData.js index eeda85af7..ba993217f 100644 --- a/src/tweens/tween/TweenData.js +++ b/src/tweens/tween/TweenData.js @@ -15,7 +15,7 @@ * @since 3.0.0 * * @param {any} target - The target to tween. - * @param {integer} index - The target index within the Tween targets array. + * @param {number} index - The target index within the Tween targets array. * @param {string} key - The property of the target to tween. * @param {function} getEnd - What the property will be at the END of the Tween. * @param {function} getStart - What the property will be at the START of the Tween. diff --git a/src/tweens/tween/const.js b/src/tweens/tween/const.js index abdbfd750..c08334dca 100644 --- a/src/tweens/tween/const.js +++ b/src/tweens/tween/const.js @@ -10,7 +10,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.CREATED - * @type {integer} + * @type {number} * @since 3.0.0 */ CREATED: 0, @@ -19,7 +19,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.INIT - * @type {integer} + * @type {number} * @since 3.0.0 */ INIT: 1, @@ -28,7 +28,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ DELAY: 2, @@ -37,7 +37,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.OFFSET_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ OFFSET_DELAY: 3, @@ -46,7 +46,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PENDING_RENDER - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_RENDER: 4, @@ -55,7 +55,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_FORWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_FORWARD: 5, @@ -64,7 +64,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.PLAYING_BACKWARD - * @type {integer} + * @type {number} * @since 3.0.0 */ PLAYING_BACKWARD: 6, @@ -73,7 +73,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.HOLD_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ HOLD_DELAY: 7, @@ -82,7 +82,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.REPEAT_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ REPEAT_DELAY: 8, @@ -91,7 +91,7 @@ var TWEEN_CONST = { * TweenData state. * * @name Phaser.Tweens.COMPLETE - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE: 9, @@ -102,7 +102,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_ADD - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_ADD: 20, @@ -111,7 +111,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PAUSED - * @type {integer} + * @type {number} * @since 3.0.0 */ PAUSED: 21, @@ -120,7 +120,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.LOOP_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ LOOP_DELAY: 22, @@ -129,7 +129,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.ACTIVE - * @type {integer} + * @type {number} * @since 3.0.0 */ ACTIVE: 23, @@ -138,7 +138,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.COMPLETE_DELAY - * @type {integer} + * @type {number} * @since 3.0.0 */ COMPLETE_DELAY: 24, @@ -147,7 +147,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.PENDING_REMOVE - * @type {integer} + * @type {number} * @since 3.0.0 */ PENDING_REMOVE: 25, @@ -156,7 +156,7 @@ var TWEEN_CONST = { * Tween state. * * @name Phaser.Tweens.REMOVED - * @type {integer} + * @type {number} * @since 3.0.0 */ REMOVED: 26 diff --git a/src/tweens/typedefs/GetActiveCallback.js b/src/tweens/typedefs/GetActiveCallback.js index bd98c2247..a670642a4 100644 --- a/src/tweens/typedefs/GetActiveCallback.js +++ b/src/tweens/typedefs/GetActiveCallback.js @@ -5,8 +5,8 @@ * @param {any} target - The tween target. * @param {string} key - The target property. * @param {number} value - The current value of the target property. - * @param {integer} targetIndex - The index of the target within the Tween. - * @param {integer} totalTargets - The total number of targets in this Tween. + * @param {number} targetIndex - The index of the target within the Tween. + * @param {number} totalTargets - The total number of targets in this Tween. * @param {Phaser.Tweens.Tween} tween - The Tween that invoked this callback. * * @return {number} - The new value. diff --git a/src/tweens/typedefs/GetEndCallback.js b/src/tweens/typedefs/GetEndCallback.js index 633c0f90b..ec5f5050a 100644 --- a/src/tweens/typedefs/GetEndCallback.js +++ b/src/tweens/typedefs/GetEndCallback.js @@ -5,8 +5,8 @@ * @param {any} target - The tween target. * @param {string} key - The target property. * @param {number} value - The current value of the target property. - * @param {integer} targetIndex - The index of the target within the Tween. - * @param {integer} totalTargets - The total number of targets in this Tween. + * @param {number} targetIndex - The index of the target within the Tween. + * @param {number} totalTargets - The total number of targets in this Tween. * @param {Phaser.Tweens.Tween} tween - The Tween that invoked this callback. * * @return {number} - The new value. diff --git a/src/tweens/typedefs/GetStartCallback.js b/src/tweens/typedefs/GetStartCallback.js index 21735db27..43e578fb3 100644 --- a/src/tweens/typedefs/GetStartCallback.js +++ b/src/tweens/typedefs/GetStartCallback.js @@ -5,8 +5,8 @@ * @param {any} target - The tween target. * @param {string} key - The target property. * @param {number} value - The current value of the target property. - * @param {integer} targetIndex - The index of the target within the Tween. - * @param {integer} totalTargets - The total number of targets in this Tween. + * @param {number} targetIndex - The index of the target within the Tween. + * @param {number} totalTargets - The total number of targets in this Tween. * @param {Phaser.Tweens.Tween} tween - The Tween that invoked this callback. * * @return {number} - The new value. diff --git a/src/tweens/typedefs/StaggerConfig.js b/src/tweens/typedefs/StaggerConfig.js index a15cd28df..9c553f23b 100644 --- a/src/tweens/typedefs/StaggerConfig.js +++ b/src/tweens/typedefs/StaggerConfig.js @@ -4,8 +4,8 @@ * * @property {number} [start=0] - The value to start the stagger from. Can be used as a way to offset the stagger while still using a range for the value. * @property {(string|function)} [ease='Linear'] - An ease to apply across the staggered values. Can either be a string, such as 'sine.inout', or a function. - * @property {(string|integer)} [from=0] - The index to start the stagger from. Can be the strings `first`, `last` or `center`, or an integer representing the stagger position. - * @property {integer[]} [grid] - Set the stagger to run across a grid by providing an array where element 0 is the width of the grid and element 1 is the height. Combine with the 'from' property to control direction. + * @property {(string|number)} [from=0] - The index to start the stagger from. Can be the strings `first`, `last` or `center`, or an integer representing the stagger position. + * @property {number[]} [grid] - Set the stagger to run across a grid by providing an array where element 0 is the width of the grid and element 1 is the height. Combine with the 'from' property to control direction. * * @example * { diff --git a/src/tweens/typedefs/TimelineBuilderConfig.js b/src/tweens/typedefs/TimelineBuilderConfig.js index 7da5efb50..71f16b540 100644 --- a/src/tweens/typedefs/TimelineBuilderConfig.js +++ b/src/tweens/typedefs/TimelineBuilderConfig.js @@ -10,7 +10,7 @@ * @property {array} [easeParams] - Optional easing parameters. Each individual Tween configuration can override this value. * @property {(string|function)} [ease='Power0'] - The easing equation to use for each tween. Each individual Tween configuration can override this value. * @property {number} [hold=0] - The number of milliseconds to hold each tween before yoyo'ing. Each individual Tween configuration can override this value. - * @property {integer} [repeat=0] - The number of times to repeat each tween. Each individual Tween configuration can override this value. + * @property {number} [repeat=0] - The number of times to repeat each tween. Each individual Tween configuration can override this value. * @property {number} [repeatDelay=0] - The number of milliseconds to pause before each tween will repeat. Each individual Tween configuration can override this value. * @property {boolean} [yoyo=false] - Should each tween complete, then reverse the values incrementally to get back to the starting tween values? The reverse tweening will also take `duration` milliseconds to complete. Each individual Tween configuration can override this value. * @property {boolean} [flipX=false] - Horizontally flip the target of the Tween when it completes (before it yoyos, if set to do so). Only works for targets that support the `flipX` property. Each individual Tween configuration can override this value. diff --git a/src/tweens/typedefs/TweenDataConfig.js b/src/tweens/typedefs/TweenDataConfig.js index 7470ea1e0..c002c1227 100644 --- a/src/tweens/typedefs/TweenDataConfig.js +++ b/src/tweens/typedefs/TweenDataConfig.js @@ -3,7 +3,7 @@ * @since 3.0.0 * * @property {any} target - The target to tween. - * @property {integer} index - The target index within the Tween targets array. + * @property {number} index - The target index within the Tween targets array. * @property {string} key - The property of the target being tweened. * @property {?Phaser.Types.Tweens.GetActiveCallback} getActiveValue - If not null, is invoked _immediately_ as soon as the TweenData is running, and is set on the target property. * @property {Phaser.Types.Tweens.GetEndCallback} getEndValue - The returned value sets what the property will be at the END of the Tween. @@ -14,13 +14,13 @@ * @property {number} [delay=0] - Time in ms/frames before tween will start. * @property {boolean} [yoyo=false] - Cause the tween to return back to its start value after hold has expired. * @property {number} [hold=0] - Time in ms/frames the tween will pause before running the yoyo or starting a repeat. - * @property {integer} [repeat=0] - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. + * @property {number} [repeat=0] - Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. * @property {number} [repeatDelay=0] - Time in ms/frames before the repeat will start. * @property {boolean} [flipX=false] - Automatically call toggleFlipX when the TweenData yoyos or repeats * @property {boolean} [flipY=false] - Automatically call toggleFlipY when the TweenData yoyos or repeats * @property {number} [progress=0] - Between 0 and 1 showing completion of this TweenData. * @property {number} [elapsed=0] - Delta counter - * @property {integer} [repeatCounter=0] - How many repeats are left to run? + * @property {number} [repeatCounter=0] - How many repeats are left to run? * @property {number} [start=0] - The property value at the start of the ease. * @property {number} [current=0] - The current propety value. * @property {number} [previous=0] - The previous property value. @@ -28,5 +28,5 @@ * @property {number} [t1=0] - Time duration 1. * @property {number} [t2=0] - Time duration 2. * @property {Phaser.Types.Tweens.TweenDataGenConfig} [gen] - LoadValue generation functions. - * @property {integer} [state=0] - TWEEN_CONST.CREATED + * @property {number} [state=0] - TWEEN_CONST.CREATED */ diff --git a/src/utils/Class.js b/src/utils/Class.js index b1d6eec83..d34bccce2 100644 --- a/src/utils/Class.js +++ b/src/utils/Class.js @@ -70,6 +70,7 @@ function hasNonConfigurable (obj, k) * Extends the given `myClass` object's prototype with the properties of `definition`. * * @function extend + * @ignore * @param {Object} ctor The constructor object to mix into. * @param {Object} definition A dictionary of functions for the class. * @param {boolean} isClassDescriptor Is the definition a class descriptor? @@ -121,6 +122,7 @@ function extend (ctor, definition, isClassDescriptor, extend) * Applies the given `mixins` to the prototype of `myClass`. * * @function mixin + * @ignore * @param {Object} myClass The constructor object to mix into. * @param {Object|Array} mixins The mixins to apply to the constructor. */ diff --git a/src/utils/array/Add.js b/src/utils/array/Add.js index 8ad2ca732..375160018 100644 --- a/src/utils/array/Add.js +++ b/src/utils/array/Add.js @@ -21,7 +21,7 @@ * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. Each item must be unique within the array. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * diff --git a/src/utils/array/AddAt.js b/src/utils/array/AddAt.js index ff48f0237..2d020e442 100644 --- a/src/utils/array/AddAt.js +++ b/src/utils/array/AddAt.js @@ -23,8 +23,8 @@ * * @param {array} array - The array to be added to. * @param {any|any[]} item - The item, or array of items, to add to the array. - * @param {integer} [index=0] - The index in the array where the item will be inserted. - * @param {integer} [limit] - Optional limit which caps the size of the array. + * @param {number} [index=0] - The index in the array where the item will be inserted. + * @param {number} [limit] - Optional limit which caps the size of the array. * @param {function} [callback] - A callback to be invoked for each item successfully added to the array. * @param {object} [context] - The context in which the callback is invoked. * diff --git a/src/utils/array/CountAllMatching.js b/src/utils/array/CountAllMatching.js index a5bac87cd..61ba5a46b 100644 --- a/src/utils/array/CountAllMatching.js +++ b/src/utils/array/CountAllMatching.js @@ -15,10 +15,10 @@ var SafeRange = require('./SafeRange'); * @param {array} array - The array to search. * @param {string} property - The property to test on each array element. * @param {*} value - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * - * @return {integer} The total number of elements with properties matching the given value. + * @return {number} The total number of elements with properties matching the given value. */ var CountAllMatching = function (array, property, value, startIndex, endIndex) { diff --git a/src/utils/array/EachInRange.js b/src/utils/array/EachInRange.js index 404a2ea61..eaefbf73f 100644 --- a/src/utils/array/EachInRange.js +++ b/src/utils/array/EachInRange.js @@ -15,8 +15,8 @@ var SafeRange = require('./SafeRange'); * @param {array} array - The array to search. * @param {function} callback - A callback to be invoked for each item in the array. * @param {object} context - The context in which the callback is invoked. - * @param {integer} startIndex - The start index to search from. - * @param {integer} endIndex - The end index to search to. + * @param {number} startIndex - The start index to search from. + * @param {number} endIndex - The end index to search to. * @param {...*} [args] - Additional arguments that will be passed to the callback, after the child. * * @return {array} The input array. diff --git a/src/utils/array/GetAll.js b/src/utils/array/GetAll.js index f765c91f6..d89649aba 100644 --- a/src/utils/array/GetAll.js +++ b/src/utils/array/GetAll.js @@ -23,8 +23,8 @@ var SafeRange = require('./SafeRange'); * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} All matching elements from the array. */ diff --git a/src/utils/array/GetFirst.js b/src/utils/array/GetFirst.js index 902bcf65b..278b8784d 100644 --- a/src/utils/array/GetFirst.js +++ b/src/utils/array/GetFirst.js @@ -22,8 +22,8 @@ var SafeRange = require('./SafeRange'); * @param {array} array - The array to search. * @param {string} [property] - The property to test on each array element. * @param {*} [value] - The value to test the property against. Must pass a strict (`===`) comparison check. - * @param {integer} [startIndex=0] - An optional start index to search from. - * @param {integer} [endIndex=array.length] - An optional end index to search up to (but not included) + * @param {number} [startIndex=0] - An optional start index to search from. + * @param {number} [endIndex=array.length] - An optional end index to search up to (but not included) * * @return {object} The first matching element from the array, or `null` if no element could be found in the range given. */ diff --git a/src/utils/array/GetRandom.js b/src/utils/array/GetRandom.js index 9c1564e75..fbd1718f7 100644 --- a/src/utils/array/GetRandom.js +++ b/src/utils/array/GetRandom.js @@ -11,8 +11,8 @@ * @since 3.0.0 * * @param {array} array - The array to select the random entry from. - * @param {integer} [startIndex=0] - An optional start index. - * @param {integer} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. + * @param {number} [startIndex=0] - An optional start index. + * @param {number} [length=array.length] - An optional length, the total number of elements (from the startIndex) to choose from. * * @return {*} A random element from the array, or `null` if no element could be found in the range given. */ diff --git a/src/utils/array/MoveTo.js b/src/utils/array/MoveTo.js index 885e2927d..4d926c99c 100644 --- a/src/utils/array/MoveTo.js +++ b/src/utils/array/MoveTo.js @@ -13,7 +13,7 @@ * * @param {array} array - The array. * @param {*} item - The element to move. - * @param {integer} index - The new index that the element will be moved to. + * @param {number} index - The new index that the element will be moved to. * * @return {*} The element that was moved. */ diff --git a/src/utils/array/QuickSelect.js b/src/utils/array/QuickSelect.js index 1cd5e50cd..083758cef 100644 --- a/src/utils/array/QuickSelect.js +++ b/src/utils/array/QuickSelect.js @@ -36,9 +36,9 @@ function defaultCompare (a, b) * @since 3.0.0 * * @param {array} arr - The array to sort. - * @param {integer} k - The k-th element index. - * @param {integer} [left=0] - The index of the left part of the range. - * @param {integer} [right] - The index of the right part of the range. + * @param {number} k - The k-th element index. + * @param {number} [left=0] - The index of the left part of the range. + * @param {number} [right] - The index of the right part of the range. * @param {function} [compare] - An optional comparison function. Is passed two elements and should return 0, 1 or -1. */ var QuickSelect = function (arr, k, left, right, compare) diff --git a/src/utils/array/Remove.js b/src/utils/array/Remove.js index edaab09c6..024f8a5b7 100644 --- a/src/utils/array/Remove.js +++ b/src/utils/array/Remove.js @@ -8,9 +8,9 @@ var SpliceOne = require('./SpliceOne'); /** * Removes the given item, or array of items, from the array. - * + * * The array is modified in-place. - * + * * You can optionally specify a callback to be invoked for each item successfully removed from the array. * * @function Phaser.Utils.Array.Remove @@ -54,6 +54,7 @@ var Remove = function (array, item, callback, context) // If we got this far, we have an array of items to remove var itemLength = item.length - 1; + var removed = []; while (itemLength >= 0) { @@ -65,21 +66,18 @@ var Remove = function (array, item, callback, context) { SpliceOne(array, index); + removed.push(entry); + if (callback) { callback.call(context, entry); } } - else - { - // Item wasn't found in the array, so remove it from our return results - item.pop(); - } itemLength--; } - return item; + return removed; }; module.exports = Remove; diff --git a/src/utils/array/RemoveAt.js b/src/utils/array/RemoveAt.js index 83dca5c63..1f0174e8f 100644 --- a/src/utils/array/RemoveAt.js +++ b/src/utils/array/RemoveAt.js @@ -17,7 +17,7 @@ var SpliceOne = require('./SpliceOne'); * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} index - The array index to remove the item from. The index must be in bounds or it will throw an error. + * @param {number} index - The array index to remove the item from. The index must be in bounds or it will throw an error. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * diff --git a/src/utils/array/RemoveBetween.js b/src/utils/array/RemoveBetween.js index 5ef45c2eb..39fa8526b 100644 --- a/src/utils/array/RemoveBetween.js +++ b/src/utils/array/RemoveBetween.js @@ -17,8 +17,8 @@ var SafeRange = require('./SafeRange'); * @since 3.4.0 * * @param {array} array - The array to be modified. - * @param {integer} startIndex - The start index to remove from. - * @param {integer} endIndex - The end index to remove to. + * @param {number} startIndex - The start index to remove from. + * @param {number} endIndex - The end index to remove to. * @param {function} [callback] - A callback to be invoked for the item removed from the array. * @param {object} [context] - The context in which the callback is invoked. * diff --git a/src/utils/array/RemoveRandomElement.js b/src/utils/array/RemoveRandomElement.js index 113243f52..d70c098a1 100644 --- a/src/utils/array/RemoveRandomElement.js +++ b/src/utils/array/RemoveRandomElement.js @@ -14,8 +14,8 @@ var SpliceOne = require('./SpliceOne'); * @since 3.0.0 * * @param {array} array - The array to removed a random element from. - * @param {integer} [start=0] - The array index to start the search from. - * @param {integer} [length=array.length] - Optional restriction on the number of elements to randomly select from. + * @param {number} [start=0] - The array index to start the search from. + * @param {number} [length=array.length] - Optional restriction on the number of elements to randomly select from. * * @return {object} The random element that was removed, or `null` if there were no array elements that fell within the given range. */ diff --git a/src/utils/array/RotateLeft.js b/src/utils/array/RotateLeft.js index 9e706c4c7..04ae48a5b 100644 --- a/src/utils/array/RotateLeft.js +++ b/src/utils/array/RotateLeft.js @@ -12,7 +12,7 @@ * @since 3.0.0 * * @param {array} array - The array to shift to the left. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. + * @param {number} [total=1] - The number of times to shift the array. * * @return {*} The most recently shifted element. */ diff --git a/src/utils/array/RotateRight.js b/src/utils/array/RotateRight.js index 783495688..bcd185cc6 100644 --- a/src/utils/array/RotateRight.js +++ b/src/utils/array/RotateRight.js @@ -12,7 +12,7 @@ * @since 3.0.0 * * @param {array} array - The array to shift to the right. This array is modified in place. - * @param {integer} [total=1] - The number of times to shift the array. + * @param {number} [total=1] - The number of times to shift the array. * * @return {*} The most recently shifted element. */ diff --git a/src/utils/array/SafeRange.js b/src/utils/array/SafeRange.js index 6a7400305..22e5535f3 100644 --- a/src/utils/array/SafeRange.js +++ b/src/utils/array/SafeRange.js @@ -11,8 +11,8 @@ * @since 3.4.0 * * @param {array} array - The array to check. - * @param {integer} startIndex - The start index. - * @param {integer} endIndex - The end index. + * @param {number} startIndex - The start index. + * @param {number} endIndex - The end index. * @param {boolean} [throwError=true] - Throw an error if the range is out of bounds. * * @return {boolean} True if the range is safe, otherwise false. diff --git a/src/utils/array/SetAll.js b/src/utils/array/SetAll.js index db1e3b4f1..d2dfe4950 100644 --- a/src/utils/array/SetAll.js +++ b/src/utils/array/SetAll.js @@ -20,8 +20,8 @@ var SafeRange = require('./SafeRange'); * @param {array} array - The array to search. * @param {string} property - The property to test for on each array element. * @param {*} value - The value to set the property to. - * @param {integer} [startIndex] - An optional start index to search from. - * @param {integer} [endIndex] - An optional end index to search to. + * @param {number} [startIndex] - An optional start index to search from. + * @param {number} [endIndex] - An optional end index to search to. * * @return {array} The input array. */ diff --git a/src/utils/array/SpliceOne.js b/src/utils/array/SpliceOne.js index 4ac0175d2..0bc7d4328 100644 --- a/src/utils/array/SpliceOne.js +++ b/src/utils/array/SpliceOne.js @@ -12,7 +12,7 @@ * @since 3.0.0 * * @param {array} array - The array to splice from. - * @param {integer} index - The index of the item which should be spliced. + * @param {number} index - The index of the item which should be spliced. * * @return {*} The item which was spliced (removed). */ diff --git a/src/utils/object/Clone.js b/src/utils/object/Clone.js index f82b161a4..7fa44b2a5 100644 --- a/src/utils/object/Clone.js +++ b/src/utils/object/Clone.js @@ -10,9 +10,9 @@ * @function Phaser.Utils.Objects.Clone * @since 3.0.0 * - * @param {object} obj - the object from which to clone + * @param {object} obj - The object to clone. * - * @return {object} a new object with the same properties as the input obj + * @return {object} A new object with the same properties as the input object. */ var Clone = function (obj) { diff --git a/src/utils/object/DeepCopy.js b/src/utils/object/DeepCopy.js new file mode 100644 index 000000000..87ace7b70 --- /dev/null +++ b/src/utils/object/DeepCopy.js @@ -0,0 +1,43 @@ +/** + * @author Richard Davey + * @copyright 2020 Photon Storm Ltd. + * @license {@link https://opensource.org/licenses/MIT|MIT License} + */ + +/** + * Deep Copy the given object or array. + * + * @function Phaser.Utils.Objects.DeepCopy + * @since 3.50.0 + * + * @param {object} obj - The object to deep copy. + * + * @return {object} A deep copy of the original object. + */ +var DeepCopy = function (inObject) +{ + var outObject; + var value; + var key; + + if (typeof inObject !== 'object' || inObject === null) + { + // inObject is not an object + return inObject; + } + + // Create an array or object to hold the values + outObject = Array.isArray(inObject) ? [] : {}; + + for (key in inObject) + { + value = inObject[key]; + + // Recursively (deep) copy for nested objects, including arrays + outObject[key] = DeepCopy(value); + } + + return outObject; +}; + +module.exports = DeepCopy; diff --git a/src/utils/object/index.js b/src/utils/object/index.js index 2e27dadbe..0a230d2f7 100644 --- a/src/utils/object/index.js +++ b/src/utils/object/index.js @@ -11,6 +11,7 @@ module.exports = { Clone: require('./Clone'), + DeepCopy: require('./DeepCopy'), Extend: require('./Extend'), GetAdvancedValue: require('./GetAdvancedValue'), GetFastValue: require('./GetFastValue'), diff --git a/src/utils/string/Pad.js b/src/utils/string/Pad.js index 49addbccc..90fe97b1f 100644 --- a/src/utils/string/Pad.js +++ b/src/utils/string/Pad.js @@ -28,9 +28,9 @@ * @since 3.0.0 * * @param {string|number|object} str - The target string. `toString()` will be called on the string, which means you can also pass in common data types like numbers. - * @param {integer} [len=0] - The number of characters to be added. + * @param {number} [len=0] - The number of characters to be added. * @param {string} [pad=" "] - The string to pad it out with (defaults to a space). - * @param {integer} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). + * @param {number} [dir=3] - The direction dir = 1 (left), 2 (right), 3 (both). * * @return {string} The padded string. */ diff --git a/types/phaser.d.ts b/types/phaser.d.ts index d8422900f..6ba70b199 100644 --- a/types/phaser.d.ts +++ b/types/phaser.d.ts @@ -6,7 +6,7 @@ declare type DataEachCallback = (parent: any, key: string, value: any, ...args: declare type ContentLoadedCallback = ()=>void; -declare type CreateCallback = (bob: Phaser.GameObjects.Bob, index: integer)=>void; +declare type CreateCallback = (bob: Phaser.GameObjects.Bob, index: number)=>void; declare type EachContainerCallback = (item: any, ...args: any[])=>void; @@ -30,7 +30,7 @@ declare namespace Phaser { * @param offsetX Optional horizontal offset from the position. Default 0. * @param offsetY Optional vertical offset from the position. Default 0. */ - function AlignTo(items: G, position: integer, offsetX?: number, offsetY?: number): G; + function AlignTo(items: G, position: number, offsetX?: number, offsetY?: number): G; /** * Takes an array of Game Objects, or any objects that have a public `angle` property, @@ -45,7 +45,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function Angle(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function Angle(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of objects and passes each of them to the given callback. @@ -65,7 +65,7 @@ declare namespace Phaser { * @param compare The comparison object. Each property in this object will be checked against the items of the array. * @param index An optional offset to start searching from within the items array. Default 0. */ - function GetFirst(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; + function GetFirst(items: G, compare: object, index?: number): object | Phaser.GameObjects.GameObject; /** * Takes an array of objects and returns the last element in the array that has properties which match @@ -77,7 +77,7 @@ declare namespace Phaser { * @param compare The comparison object. Each property in this object will be checked against the items of the array. * @param index An optional offset to start searching from within the items array. Default 0. */ - function GetLast(items: G, compare: object, index?: integer): object | Phaser.GameObjects.GameObject; + function GetLast(items: G, compare: object, index?: number): object | Phaser.GameObjects.GameObject; /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, @@ -100,7 +100,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function IncAlpha(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function IncAlpha(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have a public `x` property, @@ -115,7 +115,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function IncX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function IncX(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have public `x` and `y` properties, @@ -132,7 +132,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function IncXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + function IncXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have a public `y` property, @@ -147,7 +147,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function IncY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function IncY(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects and positions them on evenly spaced points around the perimeter of a Circle. @@ -187,7 +187,7 @@ declare namespace Phaser { * @param rect The Rectangle to position the Game Objects on. * @param shift An optional positional offset. Default 1. */ - function PlaceOnRectangle(items: G, rect: Phaser.Geom.Rectangle, shift?: integer): G; + function PlaceOnRectangle(items: G, rect: Phaser.Geom.Rectangle, shift?: number): G; /** * Takes an array of Game Objects and positions them on evenly spaced points around the edges of a Triangle. @@ -205,7 +205,7 @@ declare namespace Phaser { * @param key The name of the animation to play. * @param startFrame The starting frame of the animation with the given key. */ - function PlayAnimation(items: G, key: string, startFrame?: string | integer): G; + function PlayAnimation(items: G, key: string, startFrame?: string | number): G; /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, @@ -221,7 +221,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function PropertyValueInc(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; + function PropertyValueInc(items: G, key: string, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have a public property as defined in `key`, @@ -237,7 +237,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function PropertyValueSet(items: G, key: string, value: number, step?: number, index?: integer, direction?: integer): G; + function PropertyValueSet(items: G, key: string, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects and positions them at random locations within the Circle. @@ -295,7 +295,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function Rotate(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function Rotate(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Rotates each item around the given point by the given angle. @@ -327,7 +327,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function ScaleX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function ScaleX(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have public `scaleX` and `scaleY` properties, @@ -344,7 +344,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function ScaleXY(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + function ScaleXY(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have a public `scaleY` property, @@ -359,7 +359,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function ScaleY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function ScaleY(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `alpha` @@ -374,7 +374,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetAlpha(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetAlpha(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `blendMode` @@ -388,7 +388,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetBlendMode(items: G, value: number, index?: integer, direction?: integer): G; + function SetBlendMode(items: G, value: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `depth` @@ -403,7 +403,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetDepth(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetDepth(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Passes all provided Game Objects to the Input Manager to enable them for input with identical areas and callbacks. @@ -428,7 +428,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetOrigin(items: G, originX: number, originY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + function SetOrigin(items: G, originX: number, originY?: number, stepX?: number, stepY?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `rotation` @@ -443,7 +443,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetRotation(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetRotation(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public properties `scaleX` and `scaleY` @@ -460,7 +460,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetScale(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + function SetScale(items: G, scaleX: number, scaleY?: number, stepX?: number, stepY?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `scaleX` @@ -475,7 +475,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetScaleX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetScaleX(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `scaleY` @@ -490,7 +490,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetScaleY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetScaleY(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public properties `scrollFactorX` and `scrollFactorY` @@ -507,7 +507,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetScrollFactor(items: G, scrollFactorX: number, scrollFactorY?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + function SetScrollFactor(items: G, scrollFactorX: number, scrollFactorY?: number, stepX?: number, stepY?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorX` @@ -522,7 +522,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetScrollFactorX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetScrollFactorX(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `scrollFactorY` @@ -537,7 +537,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetScrollFactorY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetScrollFactorY(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public method setTint() and then updates it to the given value(s). You can specify tint color per corner or provide only one color value for `topLeft` parameter, in which case whole item will be tinted with that color. @@ -559,7 +559,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetVisible(items: G, value: boolean, index?: integer, direction?: integer): G; + function SetVisible(items: G, value: boolean, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `x` @@ -574,7 +574,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetX(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetX(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public properties `x` and `y` @@ -591,7 +591,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: integer, direction?: integer): G; + function SetXY(items: G, x: number, y?: number, stepX?: number, stepY?: number, index?: number, direction?: number): G; /** * Takes an array of Game Objects, or any objects that have the public property `y` @@ -606,7 +606,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - function SetY(items: G, value: number, step?: number, index?: integer, direction?: integer): G; + function SetY(items: G, value: number, step?: number, index?: number, direction?: number): G; /** * Iterate through the items array changing the position of each element to be that of the element that came before @@ -621,7 +621,7 @@ declare namespace Phaser { * @param direction The iteration direction. 0 = first to last and 1 = last to first. Default 0. * @param output An optional objec to store the final objects position in. */ - function ShiftPosition(items: G, x: number, y: number, direction?: integer, output?: O): O; + function ShiftPosition(items: G, x: number, y: number, direction?: number, output?: O): O; /** * Shuffles the array in place. The shuffled array is both modified and returned. @@ -693,13 +693,18 @@ declare namespace Phaser { /** * A Frame based Animation. * - * This consists of a key, some default values (like the frame rate) and a bunch of Frame objects. + * Animations in Phaser consist of a sequence of `AnimationFrame` objects, which are managed by + * this class, along with properties that impact playback, such as the animations frame rate + * or delay. * - * The Animation Manager creates these. Game Objects don't own an instance of these directly. - * Game Objects have the Animation Component, which are like playheads to global Animations (these objects) - * So multiple Game Objects can have playheads all pointing to this one Animation instance. + * This class contains all of the properties and methods needed to handle playback of the animation + * directly to an `AnimationState` instance, which is owned by a Sprite, or similar Game Object. + * + * You don't typically create an instance of this class directly, but instead go via + * either the `AnimationManager` or the `AnimationState` and use their `create` methods, + * depending on if you need a global animation, or local to a specific Sprite. */ - class Animation extends Phaser.Events.EventEmitter { + class Animation { /** * * @param manager A reference to the global Animation Manager @@ -731,19 +736,19 @@ declare namespace Phaser { /** * The frame rate of playback in frames per second (default 24 if duration is null) */ - frameRate: integer; + frameRate: number; /** * How long the animation should play for, in milliseconds. * If the `frameRate` property has been set then it overrides this value, * otherwise the `frameRate` is derived from `duration`. */ - duration: integer; + duration: number; /** * How many ms per frame, not including frame specific modifiers. */ - msPerFrame: integer; + msPerFrame: number; /** * Skip frames if the time lags, or always advanced anyway? @@ -753,17 +758,17 @@ declare namespace Phaser { /** * The delay in ms before the playback will begin. */ - delay: integer; + delay: number; /** * Number of times to repeat the animation. Set to -1 to repeat forever. */ - repeat: integer; + repeat: number; /** * The delay in ms before the a repeat play starts. */ - repeatDelay: integer; + repeatDelay: number; /** * Should the animation yoyo (reverse back down to the start) before repeating? @@ -785,6 +790,20 @@ declare namespace Phaser { */ paused: boolean; + /** + * Gets the total number of frames in this animation. + */ + getTotalFrames(): number; + + /** + * Calculates the duration, frame rate and msPerFrame values. + * @param target The target to set the values on. + * @param totalFrames The total number of frames in the animation. + * @param duration The duration to calculate the frame rate from. + * @param frameRate The frame ate to calculate the duration from. + */ + calculateDuration(target: Phaser.Animations.Animation, totalFrames: number, duration: number, frameRate: number): void; + /** * Add frames to the end of the animation. * @param config Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. @@ -796,34 +815,26 @@ declare namespace Phaser { * @param index The index to insert the frame at within the animation. * @param config Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. */ - addFrameAt(index: integer, config: string | Phaser.Types.Animations.AnimationFrame[]): this; + addFrameAt(index: number, config: string | Phaser.Types.Animations.AnimationFrame[]): this; /** * Check if the given frame index is valid. * @param index The index to be checked. */ - checkFrame(index: integer): boolean; - - /** - * Called internally when this Animation completes playback. - * Optionally, hides the parent Game Object, then stops playback. - * @param component The Animation Component belonging to the Game Object invoking this call. - */ - protected completeAnimation(component: Phaser.GameObjects.Components.Animation): void; + checkFrame(index: number): boolean; /** * Called internally when this Animation first starts to play. * Sets the accumulator and nextTick properties. - * @param component The Animation Component belonging to the Game Object invoking this call. - * @param includeDelay If `true` the Animation Components delay value will be added to the `nextTick` total. Default true. + * @param state The Animation State belonging to the Game Object invoking this call. */ - protected getFirstTick(component: Phaser.GameObjects.Components.Animation, includeDelay?: boolean): void; + protected getFirstTick(state: Phaser.Animations.AnimationState): void; /** * Returns the AnimationFrame at the provided index * @param index The index in the AnimationFrame array */ - protected getFrameAt(index: integer): Phaser.Animations.AnimationFrame; + protected getFrameAt(index: number): Phaser.Animations.AnimationFrame; /** * Creates AnimationFrame instances based on the given frame data. @@ -835,9 +846,9 @@ declare namespace Phaser { /** * Called internally. Sets the accumulator and nextTick values of the current Animation. - * @param component The Animation Component belonging to the Game Object invoking this call. + * @param state The Animation State belonging to the Game Object invoking this call. */ - getNextTick(component: Phaser.GameObjects.Components.Animation): void; + getNextTick(state: Phaser.Animations.AnimationState): void; /** * Returns the frame closest to the given progress value between 0 and 1. @@ -847,9 +858,9 @@ declare namespace Phaser { /** * Advance the animation frame. - * @param component The Animation Component to advance. + * @param state The Animation State to advance. */ - nextFrame(component: Phaser.GameObjects.Components.Animation): void; + nextFrame(state: Phaser.Animations.AnimationState): void; /** * Returns the animation last frame. @@ -859,9 +870,9 @@ declare namespace Phaser { /** * Called internally when the Animation is playing backwards. * Sets the previous frame, causing a yoyo, repeat, complete or update, accordingly. - * @param component The Animation Component belonging to the Game Object invoking this call. + * @param state The Animation State belonging to the Game Object invoking this call. */ - previousFrame(component: Phaser.GameObjects.Components.Animation): void; + previousFrame(state: Phaser.Animations.AnimationState): void; /** * Removes the given AnimationFrame from this Animation instance. @@ -875,20 +886,14 @@ declare namespace Phaser { * and updates the animation accordingly. * @param index The index in the AnimationFrame array */ - removeFrameAt(index: integer): this; + removeFrameAt(index: number): this; /** * Called internally during playback. Forces the animation to repeat, providing there are enough counts left * in the repeat counter. - * @param component The Animation Component belonging to the Game Object invoking this call. + * @param state The Animation State belonging to the Game Object invoking this call. */ - repeatAnimation(component: Phaser.GameObjects.Components.Animation): void; - - /** - * Sets the texture frame the animation uses for rendering. - * @param component The Animation Component belonging to the Game Object invoking this call. - */ - setFrame(component: Phaser.GameObjects.Components.Animation): void; + repeatAnimation(state: Phaser.Animations.AnimationState): void; /** * Converts the animation data to JSON. @@ -934,8 +939,9 @@ declare namespace Phaser { * @param textureFrame The key of the Frame within the Texture that this AnimationFrame uses. * @param index The index of this AnimationFrame within the Animation sequence. * @param frame A reference to the Texture Frame this AnimationFrame uses for rendering. + * @param isKeyFrame Is this Frame a Keyframe within the Animation? Default false. */ - constructor(textureKey: string, textureFrame: string | integer, index: integer, frame: Phaser.Textures.Frame); + constructor(textureKey: string, textureFrame: string | number, index: number, frame: Phaser.Textures.Frame, isKeyFrame?: boolean); /** * The key of the Texture this AnimationFrame uses. @@ -945,12 +951,12 @@ declare namespace Phaser { /** * The key of the Frame within the Texture that this AnimationFrame uses. */ - textureFrame: string | integer; + textureFrame: string | number; /** * The index of this AnimationFrame within the Animation sequence. */ - index: integer; + index: number; /** * A reference to the Texture Frame this AnimationFrame uses for rendering. @@ -989,6 +995,11 @@ declare namespace Phaser { */ readonly progress: number; + /** + * Is this Frame a KeyFrame within the Animation? + */ + isKeyFrame: boolean; + /** * Generates a JavaScript object suitable for converting to JSON. */ @@ -1041,6 +1052,13 @@ declare namespace Phaser { */ protected anims: Phaser.Structs.Map; + /** + * A list of animation mix times. + * + * See the {@link #setMix} method for more details. + */ + mixes: Phaser.Structs.Map; + /** * Whether the Animation Manager is paused along with all of its Animations. */ @@ -1056,6 +1074,58 @@ declare namespace Phaser { */ boot(): void; + /** + * Adds a mix between two animations. + * + * Mixing allows you to specify a unique delay between a pairing of animations. + * + * When playing Animation A on a Game Object, if you then play Animation B, and a + * mix exists, it will wait for the specified delay to be over before playing Animation B. + * + * This allows you to customise smoothing between different types of animation, such + * as blending between an idle and a walk state, or a running and a firing state. + * + * Note that mixing is only applied if you use the `Sprite.play` method. If you opt to use + * `playAfterRepeat` or `playAfterDelay` instead, those will take pririty and the mix + * delay will not be used. + * + * To update an existing mix, just call this method with the new delay. + * + * To remove a mix pairing, see the `removeMix` method. + * @param animA The string-based key, or instance of, Animation A. + * @param animB The string-based key, or instance of, Animation B. + * @param delay The delay, in milliseconds, to wait when transitioning from Animation A to B. + */ + addMix(animA: string | Phaser.Animations.Animation, animB: string | Phaser.Animations.Animation, delay: number): this; + + /** + * Removes a mix between two animations. + * + * Mixing allows you to specify a unique delay between a pairing of animations. + * + * Calling this method lets you remove those pairings. You can either remove + * it between `animA` and `animB`, or if you do not provide the `animB` parameter, + * it will remove all `animA` mixes. + * + * If you wish to update an existing mix instead, call the `addMix` method with the + * new delay. + * @param animA The string-based key, or instance of, Animation A. + * @param animB The string-based key, or instance of, Animation B. If not given, all mixes for Animation A will be removed. + */ + removeMix(animA: string | Phaser.Animations.Animation, animB?: string | Phaser.Animations.Animation): this; + + /** + * Returns the mix delay between two animations. + * + * If no mix has been set-up, this method will return zero. + * + * If you wish to create, or update, a new mix, call the `addMix` method. + * If you wish to remove a mix, call the `removeMix` method. + * @param animA The string-based key, or instance of, Animation A. + * @param animB The string-based key, or instance of, Animation B. + */ + getMix(animA: string | Phaser.Animations.Animation, animB: string | Phaser.Animations.Animation): number; + /** * Adds an existing Animation to the Animation Manager. * @param key The key under which the Animation should be added. The Animation will be updated with it. Must be unique. @@ -1071,6 +1141,78 @@ declare namespace Phaser { */ exists(key: string): boolean; + /** + * Create one, or more animations from a loaded Aseprite JSON file. + * + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * ```javascript + * function preload () + * { + * this.load.path = 'assets/animations/aseprite/'; + * this.load.aseprite('paladin', 'paladin.png', 'paladin.json'); + * } + * ``` + * + * Once loaded, you can call this method from within a Scene with the 'atlas' key: + * + * ```javascript + * this.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use in Phaser and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it in Phaser using that Tag name: + * + * ```javascript + * this.add.sprite(400, 300).play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * this.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * @param key The key of the loaded Aseprite atlas. It must have been loaded prior to calling this method. + * @param tags An array of Tag names. If provided, only animations found in this array will be created. + */ + createFromAseprite(key: string, tags?: string[]): Phaser.Animations.Animation[]; + /** * Creates a new Animation and adds it to the Animation Manager. * @@ -1134,6 +1276,36 @@ declare namespace Phaser { * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. * * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. * @param key The key for the texture containing the animation frames. * @param config The configuration object for the animation frames. */ @@ -1145,14 +1317,6 @@ declare namespace Phaser { */ get(key: string): Phaser.Animations.Animation; - /** - * Load an Animation into a Game Object's Animation Component. - * @param child The Game Object to load the animation into. - * @param key The key of the animation to load. - * @param startFrame The name of a start frame to set on the loaded animation. - */ - load(child: Phaser.GameObjects.GameObject, key: string, startFrame?: string | integer): Phaser.GameObjects.GameObject; - /** * Pause all animations. */ @@ -1160,10 +1324,43 @@ declare namespace Phaser { /** * Play an animation on the given Game Objects that have an Animation Component. - * @param key The key of the animation to play on the Game Object. - * @param child The Game Objects to play the animation on. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param children An array of Game Objects to play the animation on. They must have an Animation Component. */ - play(key: string, child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): this; + play(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, children: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): this; + + /** + * Takes an array of Game Objects that have an Animation Component and then + * starts the given animation playing on them. The start time of each Game Object + * is offset, incrementally, by the `stagger` amount. + * + * For example, if you pass an array with 4 children and a stagger time of 1000, + * the delays will be: + * + * child 1: 1000ms delay + * child 2: 2000ms delay + * child 3: 3000ms delay + * child 4: 4000ms delay + * + * If you set the `staggerFirst` parameter to `false` they would be: + * + * child 1: 0ms delay + * child 2: 1000ms delay + * child 3: 2000ms delay + * child 4: 3000ms delay + * + * You can also set `stagger` to be a negative value. If it was -1000, the above would be: + * + * child 1: 3000ms delay + * child 2: 2000ms delay + * child 3: 1000ms delay + * child 4: 0ms delay + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param children An array of Game Objects to play the animation on. They must have an Animation Component. + * @param stagger The amount of time, in milliseconds, to offset each play time by. If a negative value is given, it's applied to the children in reverse order. + * @param staggerFirst Should the first child be staggered as well? Default true. + */ + staggerPlay(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, children: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], stagger: number, staggerFirst?: boolean): G; /** * Removes an Animation from this Animation Manager, based on the given key. @@ -1179,16 +1376,6 @@ declare namespace Phaser { */ resumeAll(): this; - /** - * Takes an array of Game Objects that have an Animation Component and then - * starts the given animation playing on them, each one offset by the - * `stagger` amount given to this method. - * @param key The key of the animation to play on the Game Objects. - * @param children An array of Game Objects to play the animation on. They must have an Animation Component. - * @param stagger The amount of time, in milliseconds, to offset each play time by. Default 0. - */ - staggerPlay(key: string, children: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], stagger?: number): G; - /** * Returns the Animation data as JavaScript object based on the given key. * Or, if not key is defined, it will return the data of all animations as array of objects. @@ -1204,6 +1391,746 @@ declare namespace Phaser { } + /** + * The Animation State Component. + * + * This component provides features to apply animations to Game Objects. It is responsible for + * loading, queuing animations for later playback, mixing between animations and setting + * the current animation frame to the Game Object that owns this component. + * + * This component lives as an instance within any Game Object that has it defined, such as Sprites. + * + * You can access its properties and methods via the `anims` property, i.e. `Sprite.anims`. + * + * As well as playing animations stored in the global Animation Manager, this component + * can also create animations that are stored locally within it. See the `create` method + * for more details. + * + * Prior to Phaser 3.50 this component was called just `Animation` and lived in the + * `Phaser.GameObjects.Components` namespace. It was renamed to `AnimationState` + * in 3.50 to help better identify its true purpose when browsing the documentation. + */ + class AnimationState { + /** + * + * @param parent The Game Object to which this animation component belongs. + */ + constructor(parent: Phaser.GameObjects.GameObject); + + /** + * The Game Object to which this animation component belongs. + * + * You can typically access this component from the Game Object + * via the `this.anims` property. + */ + parent: Phaser.GameObjects.GameObject; + + /** + * A reference to the global Animation Manager. + */ + animationManager: Phaser.Animations.AnimationManager; + + /** + * A reference to the Texture Manager. + */ + protected textureManager: Phaser.Textures.TextureManager; + + /** + * The Animations stored locally in this Animation component. + * + * Do not modify the contents of this Map directly, instead use the + * `add`, `create` and `remove` methods of this class instead. + */ + protected anims: Phaser.Structs.Map; + + /** + * Is an animation currently playing or not? + */ + isPlaying: boolean; + + /** + * Has the current animation started playing, or is it waiting for a delay to expire? + */ + hasStarted: boolean; + + /** + * The current Animation loaded into this Animation component. + * + * Will by `null` if no animation is yet loaded. + */ + currentAnim: Phaser.Animations.Animation; + + /** + * The current AnimationFrame being displayed by this Animation component. + * + * Will by `null` if no animation is yet loaded. + */ + currentFrame: Phaser.Animations.AnimationFrame; + + /** + * The key, instance, or config of the next Animation to be loaded into this Animation component + * when the current animation completes. + * + * Will by `null` if no animation has been queued. + */ + nextAnim: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig; + + /** + * A queue of Animations to be loaded into this Animation component when the current animation completes. + * + * Populate this queue via the `chain` method. + */ + nextAnimsQueue: any[]; + + /** + * The Time Scale factor. + * + * You can adjust this value to modify the passage of time for the animation that is currently + * playing. For example, setting it to 2 will make the animation play twice as fast. Or setting + * it to 0.5 will slow the animation down. + * + * You can change this value at run-time, or set it via the `PlayAnimationConfig`. + * + * Prior to Phaser 3.50 this property was private and called `_timeScale`. + */ + timeScale: number; + + /** + * The frame rate of playback, of the current animation, in frames per second. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the frame rate, provide a new value in the `PlayAnimationConfig` object. + */ + frameRate: number; + + /** + * The duration of the current animation, in milliseconds. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the duration, provide a new value in the `PlayAnimationConfig` object. + */ + duration: number; + + /** + * The number of milliseconds per frame, not including frame specific modifiers that may be present in the + * Animation data. + * + * This value is calculated when a new animation is loaded into this component and should + * be treated as read-only. Changing it will not alter playback speed. + */ + msPerFrame: number; + + /** + * Skip frames if the time lags, or always advanced anyway? + */ + skipMissedFrames: boolean; + + /** + * The delay before starting playback of the current animation, in milliseconds. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the delay, provide a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_delay`. + */ + delay: number; + + /** + * The number of times to repeat playback of the current animation. + * + * If -1, it means the animation will repeat forever. + * + * This value is set when a new animation is loaded into this component and should + * be treated as read-only, as changing it once playback has started will not alter + * the animation. To change the number of repeats, provide a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_repeat`. + */ + repeat: number; + + /** + * The number of milliseconds to wait before starting the repeat playback of the current animation. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time. + * + * You can change the repeat delay by providing a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_repeatDelay`. + */ + repeatDelay: number; + + /** + * Should the current animation yoyo? An animation that yoyos will play in reverse, from the end + * to the start, before then repeating or completing. An animation that does not yoyo will just + * play from the start to the end. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time. + * + * You can change the yoyo by providing a new value in the `PlayAnimationConfig` object. + * + * Prior to Phaser 3.50 this property was private and called `_yoyo`. + */ + yoyo: boolean; + + /** + * Should the GameObject's `visible` property be set to `true` when the animation starts to play? + * + * This will happen _after_ any delay that may have been set. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time, assuming the animation is currently delayed. + */ + showOnStart: boolean; + + /** + * Should the GameObject's `visible` property be set to `false` when the animation completes? + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time, assuming the animation is still actively playing. + */ + hideOnComplete: boolean; + + /** + * Is the playhead moving forwards (`true`) or in reverse (`false`) ? + */ + forward: boolean; + + /** + * An internal trigger that tells the component if it should plays the animation + * in reverse mode ('true') or not ('false'). This is used because `forward` can + * be changed by the `yoyo` feature. + * + * Prior to Phaser 3.50 this property was private and called `_reverse`. + */ + inReverse: boolean; + + /** + * Internal time overflow accumulator. + * + * This has the `delta` time added to it as part of the `update` step. + */ + accumulator: number; + + /** + * The time point at which the next animation frame will change. + * + * This value is compared against the `accumulator` as part of the `update` step. + */ + nextTick: number; + + /** + * A counter keeping track of how much delay time, in milliseconds, is left before playback begins. + * + * This is set via the `playAfterDelay` method, although it can be modified at run-time + * if required, as long as the animation has not already started playing. + */ + delayCounter: number; + + /** + * A counter that keeps track of how many repeats are left to run. + * + * This value is set when a new animation is loaded into this component, but can also be modified + * at run-time. + */ + repeatCounter: number; + + /** + * An internal flag keeping track of pending repeats. + */ + pendingRepeat: boolean; + + /** + * Sets an animation, or an array of animations, to be played in the future, after the current one completes or stops. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, + * or have one of the `stop` methods called. + * + * An animation set to repeat forever will never enter a completed state unless stopped. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` event). + * + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. + * + * Call this method with no arguments to reset all currently chained animations. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + */ + chain(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig | string[] | Phaser.Animations.Animation[] | Phaser.Types.Animations.PlayAnimationConfig[]): Phaser.GameObjects.GameObject; + + /** + * Returns the key of the animation currently loaded into this component. + * + * Prior to Phaser 3.50 this method was called `getCurrentKey`. + */ + getName(): string; + + /** + * Returns the key of the animation frame currently displayed by this component. + */ + getFrameName(): string; + + /** + * Internal method used to load an animation into this component. + * @param key The string-based key of the animation to play, or a `PlayAnimationConfig` object. + */ + protected load(key: string | Phaser.Types.Animations.PlayAnimationConfig): Phaser.GameObjects.GameObject; + + /** + * Pause the current animation and set the `isPlaying` property to `false`. + * You can optionally pause it at a specific frame. + * @param atFrame An optional frame to set after pausing the animation. + */ + pause(atFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + + /** + * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. + * You can optionally tell it to start playback from a specific frame. + * @param fromFrame An optional frame to set before restarting playback. + */ + resume(fromFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + + /** + * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * + * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. + * + * If an animation is already running and a new animation is given to this method, it will wait for + * the given delay before starting the new animation. + * + * If no animation is currently running, the given one begins after the delay. + * + * Prior to Phaser 3.50 this method was called 'delayedPlay' and the parameters were in the reverse order. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param delay The delay, in milliseconds, to wait before starting the animation playing. + */ + playAfterDelay(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, delay: number): Phaser.GameObjects.GameObject; + + /** + * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback + * of the given animation. + * + * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an + * idle animation to a walking animation, by making them blend smoothly into each other. + * + * If no animation is currently running, the given one will start immediately. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param repeatCount How many times should the animation repeat before the next one starts? Default 1. + */ + playAfterRepeat(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, repeatCount?: number): Phaser.GameObjects.GameObject; + + /** + * Start playing the given animation on this Sprite. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).play('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param ignoreIfPlaying If this animation is already playing then ignore this call. Default false. + */ + play(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, ignoreIfPlaying?: boolean): Phaser.GameObjects.GameObject; + + /** + * Start playing the given animation on this Sprite, in reverse. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).playReverse('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. + */ + playReverse(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, ignoreIfPlaying?: boolean): Phaser.GameObjects.GameObject; + + /** + * Load the animation based on the key and set-up all of the internal values + * needed for playback to start. If there is no delay, it will also fire the start events. + * @param key The string-based key of the animation to play, or a `PlayAnimationConfig` object. + */ + startAnimation(key: string | Phaser.Types.Animations.PlayAnimationConfig): Phaser.GameObjects.GameObject; + + /** + * Reverse the Animation that is already playing on the Game Object. + */ + reverse(): Phaser.GameObjects.GameObject; + + /** + * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. + * + * The value is based on the current frame and how far that is in the animation, it is not based on + * the duration of the animation. + */ + getProgress(): number; + + /** + * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. + * + * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. + * + * The value is based on the current frame and how far that is in the animation, it is not based on + * the duration of the animation. + * @param value The progress value, between 0 and 1. Default 0. + */ + setProgress(value?: number): Phaser.GameObjects.GameObject; + + /** + * Sets the number of times that the animation should repeat after its first play through. + * For example, if repeat is 1, the animation will play a total of twice: the initial play plus 1 repeat. + * + * To repeat indefinitely, use -1. + * The value should always be an integer. + * + * Calling this method only works if the animation is already running. Otherwise, any + * value specified here will be overwritten when the next animation loads in. To avoid this, + * use the `repeat` property of the `PlayAnimationConfig` object instead. + * @param value The number of times that the animation should repeat. + */ + setRepeat(value: number): Phaser.GameObjects.GameObject; + + /** + * Handle the removal of an animation from the Animation Manager. + * @param key The key of the removed Animation. + * @param animation The removed Animation. + */ + globalRemove(key?: string, animation?: Phaser.Animations.Animation): void; + + /** + * Restarts the current animation from its beginning. + * + * You can optionally reset the delay and repeat counters as well. + * + * Calling this will fire the `ANIMATION_RESTART` event immediately. + * + * If you `includeDelay` then it will also fire the `ANIMATION_START` event once + * the delay has expired, otherwise, playback will just begin immediately. + * @param includeDelay Whether to include the delay value of the animation when restarting. Default false. + * @param resetRepeats Whether to reset the repeat counter or not? Default false. + */ + restart(includeDelay?: boolean, resetRepeats?: boolean): Phaser.GameObjects.GameObject; + + /** + * The current animation has completed. This dispatches the `ANIMATION_COMPLETE` event. + * + * This method is called by the Animation instance and should not usually be invoked directly. + * + * If no animation is loaded, no events will be dispatched. + * + * If another animation has been queued for playback, it will be started after the events fire. + */ + complete(): Phaser.GameObjects.GameObject; + + /** + * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing. + */ + stop(): Phaser.GameObjects.GameObject; + + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * @param delay The number of milliseconds to wait before stopping this animation. + */ + stopAfterDelay(delay: number): Phaser.GameObjects.GameObject; + + /** + * Stops the current animation from playing when it next repeats. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * + * Prior to Phaser 3.50 this method was called `stopOnRepeat` and had no parameters. + * @param repeatCount How many times should the animation repeat before stopping? Default 1. + */ + stopAfterRepeat(repeatCount?: number): Phaser.GameObjects.GameObject; + + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * @param frame The frame to check before stopping this animation. + */ + stopOnFrame(frame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + + /** + * Returns the total number of frames in this animation, or returns zero if no + * animation has been loaded. + */ + getTotalFrames(): number; + + /** + * The internal update loop for the AnimationState Component. + * + * This is called automatically by the `Sprite.preUpdate` method. + * @param time The current timestamp. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + update(time: number, delta: number): void; + + /** + * Sets the given Animation Frame as being the current frame + * and applies it to the parent Game Object, adjusting size and origin as needed. + * @param animationFrame The animation frame to change to. + */ + setCurrentFrame(animationFrame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; + + /** + * Advances the animation to the next frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in reverse, calling this method doesn't then change the direction to forwards. + */ + nextFrame(): Phaser.GameObjects.GameObject; + + /** + * Advances the animation to the previous frame, regardless of the time or animation state. + * If the animation is set to repeat, or yoyo, this will still take effect. + * + * Calling this does not change the direction of the animation. I.e. if it was currently + * playing in forwards, calling this method doesn't then change the direction to backwards. + */ + previousFrame(): Phaser.GameObjects.GameObject; + + /** + * Get an Animation instance that has been created locally on this Sprite. + * + * See the `create` method for more details. + * @param key The key of the Animation to retrieve. + */ + get(key: string): Phaser.Animations.Animation; + + /** + * Checks to see if the given key is already used locally within the animations stored on this Sprite. + * @param key The key of the Animation to check. + */ + exists(key: string): boolean; + + /** + * Creates a new Animation that is local specifically to this Sprite. + * + * When a Sprite owns an animation, it is kept out of the global Animation Manager, which means + * you're free to use keys that may be already defined there. Unless you specifically need a Sprite + * to have a unique animation, you should favor using global animations instead, as they allow for + * the same animation to be used across multiple Sprites, saving on memory. However, if this Sprite + * is the only one to use this animation, it's sensible to create it here. + * + * If an invalid key is given this method will return `false`. + * + * If you pass the key of an animation that already exists locally, that animation will be returned. + * + * A brand new animation is only created if the key is valid and not already in use by this Sprite. + * + * If you wish to re-use an existing key, call the `remove` method first, then this method. + * @param config The configuration settings for the Animation. + */ + create(config: Phaser.Types.Animations.Animation): Phaser.Animations.Animation | false; + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with string based frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNames}. + * + * It's a helper method, designed to make it easier for you to extract all of the frame names from texture atlases. + * If you're working with a sprite sheet, see the `generateFrameNumbers` method instead. + * + * Example: + * + * If you have a texture atlases loaded called `gems` and it contains 6 frames called `ruby_0001`, `ruby_0002`, and so on, + * then you can call this method using: `this.anims.generateFrameNames('gems', { prefix: 'ruby_', end: 6, zeroPad: 4 })`. + * + * The `end` value tells it to look for 6 frames, incrementally numbered, all starting with the prefix `ruby_`. The `zeroPad` + * value tells it how many zeroes pad out the numbers. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'ruby', + * repeat: -1, + * frames: this.anims.generateFrameNames('gems', { + * prefix: 'ruby_', + * end: 6, + * zeroPad: 4 + * }) + * }); + * ``` + * + * Please see the animation examples for further details. + * @param key The key for the texture containing the animation frames. + * @param config The configuration object for the animation frame names. + */ + generateFrameNames(key: string, config?: Phaser.Types.Animations.GenerateFrameNames): Phaser.Types.Animations.AnimationFrame[]; + + /** + * Generate an array of {@link Phaser.Types.Animations.AnimationFrame} objects from a texture key and configuration object. + * + * Generates objects with numbered frame names, as configured by the given {@link Phaser.Types.Animations.GenerateFrameNumbers}. + * + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * It's a helper method, designed to make it easier for you to extract frames from sprite sheets. + * If you're working with a texture atlas, see the `generateFrameNames` method instead. + * + * Example: + * + * If you have a sprite sheet loaded called `explosion` and it contains 12 frames, then you can call this method using: + * `this.anims.generateFrameNumbers('explosion', { start: 0, end: 12 })`. + * + * The `end` value tells it to stop after 12 frames. To create an animation using this method, you can do: + * + * ```javascript + * this.anims.create({ + * key: 'boom', + * frames: this.anims.generateFrameNames('explosion', { + * start: 0, + * end: 12 + * }) + * }); + * ``` + * + * Note that `start` is optional and you don't need to include it if the animation starts from frame 0. + * + * To specify an animation in reverse, swap the `start` and `end` values. + * + * If the frames are not sequential, you may pass an array of frame numbers instead, for example: + * + * `this.anims.generateFrameNumbers('explosion', { frames: [ 0, 1, 2, 1, 2, 3, 4, 0, 1, 2 ] })` + * + * Please see the animation examples and `GenerateFrameNumbers` config docs for further details. + * @param key The key for the texture containing the animation frames. + * @param config The configuration object for the animation frames. + */ + generateFrameNumbers(key: string, config: Phaser.Types.Animations.GenerateFrameNumbers): Phaser.Types.Animations.AnimationFrame[]; + + /** + * Removes a locally created Animation from this Sprite, based on the given key. + * + * Once an Animation has been removed, this Sprite cannot play it again without re-creating it. + * @param key The key of the animation to remove. + */ + remove(key: string): Phaser.Animations.Animation; + + /** + * Destroy this Animation component. + * + * Unregisters event listeners and cleans up its references. + */ + destroy(): void; + + /** + * `true` if the current animation is paused, otherwise `false`. + */ + readonly isPaused: boolean; + + } + namespace Events { /** * The Add Animation Event. @@ -1218,43 +2145,180 @@ declare namespace Phaser { /** * The Animation Complete Event. * - * This event is dispatched by an Animation instance when it completes, i.e. finishes playing or is manually stopped. + * This event is dispatched by a Sprite when an animation playing on it completes playback. + * This happens when the animation gets to the end of its sequence, factoring in any delays + * or repeats it may have to process. * - * Be careful with the volume of events this could generate. If a group of Sprites all complete the same - * animation at the same time, this event will invoke its handler for each one of them. + * An animation that is set to loop, or repeat forever, will never fire this event, because + * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` + * event instead, as this is emitted when the animation is stopped directly. + * + * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_COMPLETE: any; + /** + * The Animation Complete Dynamic Key Event. + * + * This event is dispatched by a Sprite when an animation playing on it completes playback. + * This happens when the animation gets to the end of its sequence, factoring in any delays + * or repeats it may have to process. + * + * An animation that is set to loop, or repeat forever, will never fire this event, because + * it never actually completes. If you need to handle this, listen for the `ANIMATION_STOP` + * event instead, as this is emitted when the animation is stopped directly. + * + * The difference between this and the `ANIMATION_COMPLETE` event is that this one has a + * dynamic event name that contains the name of the animation within it. For example, + * if you had an animation called `explode` you could listen for the completion of that + * specific animation by using: `sprite.on('animationcomplete-explode', listener)`. Or, if you + * wish to use types: `sprite.on(Phaser.Animations.Events.ANIMATION_COMPLETE_KEY + 'explode', listener)`. + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + */ + const ANIMATION_COMPLETE_KEY: any; + /** * The Animation Repeat Event. * - * This event is dispatched when a currently playing animation repeats. + * This event is dispatched by a Sprite when an animation repeats playing on it. + * This happens if the animation was created, or played, with a `repeat` value specified. * - * The event is dispatched directly from the Animation object itself. Which means that listeners - * bound to this event will be invoked every time the Animation repeats, for every Game Object that may have it. + * An animation will repeat when it reaches the end of its sequence. + * + * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_REPEAT: any; /** * The Animation Restart Event. * - * This event is dispatched by an Animation instance when it restarts. + * This event is dispatched by a Sprite when an animation restarts playing on it. + * This only happens when the `Sprite.anims.restart` method is called. * - * Be careful with the volume of events this could generate. If a group of Sprites all restart the same - * animation at the same time, this event will invoke its handler for each one of them. + * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_RESTART: any; /** * The Animation Start Event. * - * This event is dispatched by an Animation instance when it starts playing. + * This event is dispatched by a Sprite when an animation starts playing on it. + * This happens when the animation is played, factoring in any delay that may have been specified. + * This event happens after the delay has expired and prior to the first update event. * - * Be careful with the volume of events this could generate. If a group of Sprites all play the same - * animation at the same time, this event will invoke its handler for each one of them. + * Listen for it on the Sprite using `sprite.on('animationstart', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. */ const ANIMATION_START: any; + /** + * The Animation Stop Event. + * + * This event is dispatched by a Sprite when an animation is stopped on it. An animation + * will only be stopeed if a method such as `Sprite.stop` or `Sprite.anims.stopAfterDelay` + * is called. It can also be emitted if a new animation is started before the current one completes. + * + * Listen for it on the Sprite using `sprite.on('animationstop', listener)` + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + */ + const ANIMATION_STOP: any; + + /** + * The Animation Update Event. + * + * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame. + * An animation will change frame based on the frme rate and other factors like `timeScale` and `delay`. It can also change + * frame when stopped or restarted. + * + * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` + * + * If an animation is playing faster than the game frame-rate can handle, it's entirely possible for it to emit several + * update events in a single game frame, so please be aware of this in your code. The **final** event received that frame + * is the one that is rendered to the game. + * + * The animation event flow is as follows: + * + * 1. `ANIMATION_START` + * 2. `ANIMATION_UPDATE` (repeated for however many frames the animation has) + * 3. `ANIMATION_REPEAT` (only if the animation is set to repeat, it then emits more update events after this) + * 4. `ANIMATION_COMPLETE` (only if there is a finite, or zero, repeat count) + * 5. `ANIMATION_COMPLETE_KEY` (only if there is a finite, or zero, repeat count) + * + * If the animation is stopped directly, the `ANIMATION_STOP` event is dispatched instead of `ANIMATION_COMPLETE`. + * + * If the animation is restarted while it is already playing, `ANIMATION_RESTART` is emitted. + */ + const ANIMATION_UPDATE: any; + /** * The Pause All Animations Event. * @@ -1281,113 +2345,6 @@ declare namespace Phaser { */ const RESUME_ALL: any; - /** - * The Sprite Animation Complete Event. - * - * This event is dispatched by a Sprite when an animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_COMPLETE` event. - */ - const SPRITE_ANIMATION_COMPLETE: any; - - /** - * The Sprite Animation Key Complete Event. - * - * This event is dispatched by a Sprite when a specific animation finishes playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationcomplete-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationcomplete-explode`. - */ - const SPRITE_ANIMATION_KEY_COMPLETE: any; - - /** - * The Sprite Animation Key Repeat Event. - * - * This event is dispatched by a Sprite when a specific animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrepeat-explode`. - */ - const SPRITE_ANIMATION_KEY_REPEAT: any; - - /** - * The Sprite Animation Key Restart Event. - * - * This event is dispatched by a Sprite when a specific animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationrestart-explode`. - */ - const SPRITE_ANIMATION_KEY_RESTART: any; - - /** - * The Sprite Animation Key Start Event. - * - * This event is dispatched by a Sprite when a specific animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationstart-explode`. - */ - const SPRITE_ANIMATION_KEY_START: any; - - /** - * The Sprite Animation Key Update Event. - * - * This event is dispatched by a Sprite when a specific animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate-key', listener)` where `key` is the key of - * the animation. For example, if you had an animation with the key 'explode' you should listen for `animationupdate-explode`. - */ - const SPRITE_ANIMATION_KEY_UPDATE: any; - - /** - * The Sprite Animation Repeat Event. - * - * This event is dispatched by a Sprite when an animation repeats playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrepeat', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_REPEAT` event. - */ - const SPRITE_ANIMATION_REPEAT: any; - - /** - * The Sprite Animation Restart Event. - * - * This event is dispatched by a Sprite when an animation restarts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationrestart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_RESTART` event. - */ - const SPRITE_ANIMATION_RESTART: any; - - /** - * The Sprite Animation Start Event. - * - * This event is dispatched by a Sprite when an animation starts playing on it. - * - * Listen for it on the Sprite using `sprite.on('animationstart', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_START` event. - */ - const SPRITE_ANIMATION_START: any; - - /** - * The Sprite Animation Update Event. - * - * This event is dispatched by a Sprite when an animation playing on it updates. This happens when the animation changes frame, - * based on the animation frame rate and other factors like `timeScale` and `delay`. - * - * Listen for it on the Sprite using `sprite.on('animationupdate', listener)` - * - * This same event is dispatched for all animations. To listen for a specific animation, use the `SPRITE_ANIMATION_KEY_UPDATE` event. - */ - const SPRITE_ANIMATION_UPDATE: any; - } } @@ -1647,20 +2604,13 @@ declare namespace Phaser { * The Camera ID. Assigned by the Camera Manager and used to handle camera exclusion. * This value is a bitmask. */ - readonly id: integer; + readonly id: number; /** * The name of the Camera. This is left empty for your own use. */ name: string; - /** - * This property is un-used in v3.16. - * - * The resolution of the Game, used in most Camera calculations. - */ - readonly resolution: number; - /** * Should this camera round its pixel values to integers? */ @@ -1848,9 +2798,8 @@ declare namespace Phaser { /** * Internal preRender step. - * @param resolution The game resolution, as set in the Scale Manager. */ - protected preRender(resolution: number): void; + protected preRender(): void; /** * Takes an x value and checks it's within the range of the Camera bounds, adjusting if required. @@ -1914,7 +2863,7 @@ declare namespace Phaser { * @param height The height of the bounds, in pixels. * @param centerOn If `true` the Camera will automatically be centered on the new bounds. Default false. */ - setBounds(x: integer, y: integer, width: integer, height: integer, centerOn?: boolean): this; + setBounds(x: number, y: number, width: number, height: number, centerOn?: boolean): this; /** * Returns a rectangle containing the bounds of the Camera. @@ -1960,8 +2909,6 @@ declare namespace Phaser { /** * Sets the Scene the Camera is bound to. - * - * Also populates the `resolution` property and updates the internal size values. * @param scene The Scene the camera is bound to. */ setScene(scene: Phaser.Scene): this; @@ -1986,7 +2933,7 @@ declare namespace Phaser { * @param width The width of the Camera viewport. * @param height The height of the Camera viewport. Default width. */ - setSize(width: integer, height?: integer): this; + setSize(width: number, height?: number): this; /** * This method sets the position and size of the Camera viewport in a single call. @@ -2003,7 +2950,7 @@ declare namespace Phaser { * @param width The width of the Camera viewport. * @param height The height of the Camera viewport. Default width. */ - setViewport(x: number, y: number, width: integer, height?: integer): this; + setViewport(x: number, y: number, width: number, height?: number): this; /** * Set the zoom value of the Camera. @@ -2014,9 +2961,12 @@ declare namespace Phaser { * A value of 1 means 'no zoom' and is the default. * * Changing the zoom does not impact the Camera viewport in any way, it is only applied during rendering. - * @param value The zoom value of the Camera. The minimum it can be is 0.001. Default 1. + * + * As of Phaser 3.50 you can now set the horizontal and vertical zoom values independently. + * @param x The horizontal zoom value of the Camera. The minimum it can be is 0.001. Default 1. + * @param y The vertical zoom value of the Camera. The minimum it can be is 0.001. Default x. */ - setZoom(value?: number): this; + setZoom(x?: number, y?: number): this; /** * Sets the mask to be applied to this Camera during rendering. @@ -2060,7 +3010,7 @@ declare namespace Phaser { * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - protected update(time: integer, delta: number): void; + protected update(time: number, delta: number): void; /** * Destroys this Camera instance and its internal properties and references. @@ -2140,6 +3090,32 @@ declare namespace Phaser { */ zoom: number; + /** + * The Camera horizontal zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + */ + zoomX: number; + + /** + * The Camera vertical zoom value. Change this value to zoom in, or out of, a Scene. + * + * A value of 0.5 would zoom the Camera out, so you can now see twice as much + * of the Scene as before. A value of 2 would zoom the Camera in, so every pixel + * now takes up 2 pixels when rendered. + * + * Set to 1 to return to the default zoom level. + * + * Be careful to never set this value to zero. + */ + zoomY: number; + /** * The horizontal position of the center of the Camera's viewport, relative to the left of the game canvas. */ @@ -2227,7 +3203,7 @@ declare namespace Phaser { * * A Camera also has built-in special effects including Fade, Flash and Camera Shake. */ - class Camera extends Phaser.Cameras.Scene2D.BaseCamera implements Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Tint { + class Camera extends Phaser.Cameras.Scene2D.BaseCamera implements Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Pipeline { /** * * @param x The x position of the Camera, relative to the top-left of the game canvas. @@ -2320,137 +3296,6 @@ declare namespace Phaser { */ deadzone: Phaser.Geom.Rectangle; - /** - * Is this Camera rendering directly to the canvas or to a texture? - * - * Enable rendering to texture with the method `setRenderToTexture` (just enabling this boolean won't be enough) - * - * Once enabled you can toggle it by switching this property. - * - * To properly remove a render texture you should call the `clearRenderToTexture()` method. - */ - renderToTexture: boolean; - - /** - * If this Camera is rendering to a texture (via `setRenderToTexture`) then you - * have the option to control if it should also render to the Game canvas as well. - * - * By default, a Camera will render both to its texture and to the Game canvas. - * - * However, if you set ths property to `false` it will only render to the texture - * and skip rendering to the Game canvas. - * - * Setting this property if the Camera isn't rendering to a texture has no effect. - */ - renderToGame: boolean; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the HTML Canvas Element that the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - */ - canvas: HTMLCanvasElement; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the Rendering Context belonging to the Canvas element the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only populated if Phaser is running with the Canvas Renderer. - */ - context: CanvasRenderingContext2D; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Texture belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - */ - glTexture: WebGLTexture; - - /** - * If this Camera has been set to render to a texture then this holds a reference - * to the GL Frame Buffer belonging the Camera is drawing to. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - */ - framebuffer: WebGLFramebuffer; - - /** - * If this Camera has been set to render to a texture and to use a custom pipeline, - * then this holds a reference to the pipeline the Camera is drawing with. - * - * Enable texture rendering using the method `setRenderToTexture`. - * - * This is only set if Phaser is running with the WebGL Renderer. - */ - pipeline: any; - - /** - * Sets the Camera to render to a texture instead of to the main canvas. - * - * The Camera will redirect all Game Objects it's asked to render to this texture. - * - * During the render sequence, the texture itself will then be rendered to the main canvas. - * - * Doing this gives you the ability to modify the texture before this happens, - * allowing for special effects such as Camera specific shaders, or post-processing - * on the texture. - * - * If running under Canvas the Camera will render to its `canvas` property. - * - * If running under WebGL the Camera will create a frame buffer, which is stored in its `framebuffer` and `glTexture` properties. - * - * If you set a camera to render to a texture then it will emit 2 events during the render loop: - * - * First, it will emit the event `prerender`. This happens right before any Game Object's are drawn to the Camera texture. - * - * Then, it will emit the event `postrender`. This happens after all Game Object's have been drawn, but right before the - * Camera texture is rendered to the main game canvas. It's the final point at which you can manipulate the texture before - * it appears in-game. - * - * You should not enable this unless you plan on actually using the texture it creates - * somehow, otherwise you're just doubling the work required to render your game. - * - * If you only require the Camera to render to a texture, and not also to the Game, - * them set the `renderToGame` parameter to `false`. - * - * To temporarily disable rendering to a texture, toggle the `renderToTexture` boolean. - * - * If you no longer require the Camera to render to a texture, call the `clearRenderToTexture` method, - * which will delete the respective textures and free-up resources. - * @param pipeline An optional WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. - * @param renderToGame If you do not need the Camera to still render to the Game, set this parameter to `false`. Default true. - */ - setRenderToTexture(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline, renderToGame?: boolean): this; - - /** - * Sets the WebGL pipeline this Camera is using when rendering to a texture. - * - * You can pass either the string-based name of the pipeline, or a reference to the pipeline itself. - * - * Call this method with no arguments to clear any previously set pipeline. - * @param pipeline The WebGL Pipeline to render with, can be either a string which is the name of the pipeline, or a pipeline reference. Or if left empty it will clear the pipeline. - */ - setPipeline(pipeline?: string | Phaser.Renderer.WebGL.WebGLPipeline): this; - - /** - * If this Camera was set to render to a texture, this will clear the resources it was using and - * redirect it to render back to the primary Canvas again. - * - * If you only wish to temporarily disable rendering to a texture then you can toggle the - * property `renderToTexture` instead. - */ - clearRenderToTexture(): this; - /** * Sets the Camera dead zone. * @@ -2481,7 +3326,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - fadeIn(duration?: integer, red?: integer, green?: integer, blue?: integer, callback?: Function, context?: any): this; + fadeIn(duration?: number, red?: number, green?: number, blue?: number, callback?: Function, context?: any): this; /** * Fades the Camera out to the given color over the duration specified. @@ -2494,7 +3339,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - fadeOut(duration?: integer, red?: integer, green?: integer, blue?: integer, callback?: Function, context?: any): this; + fadeOut(duration?: number, red?: number, green?: number, blue?: number, callback?: Function, context?: any): this; /** * Fades the Camera from the given color to transparent over the duration specified. @@ -2507,7 +3352,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - fadeFrom(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): this; + fadeFrom(duration?: number, red?: number, green?: number, blue?: number, force?: boolean, callback?: Function, context?: any): this; /** * Fades the Camera from transparent to the given color over the duration specified. @@ -2520,7 +3365,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - fade(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): this; + fade(duration?: number, red?: number, green?: number, blue?: number, force?: boolean, callback?: Function, context?: any): this; /** * Flashes the Camera by setting it to the given color immediately and then fading it away again quickly over the duration specified. @@ -2533,7 +3378,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - flash(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Function, context?: any): this; + flash(duration?: number, red?: number, green?: number, blue?: number, force?: boolean, callback?: Function, context?: any): this; /** * Shakes the Camera by the given intensity over the duration specified. @@ -2544,7 +3389,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - shake(duration?: integer, intensity?: number | Phaser.Math.Vector2, force?: boolean, callback?: Function, context?: any): this; + shake(duration?: number, intensity?: number | Phaser.Math.Vector2, force?: boolean, callback?: Function, context?: any): this; /** * This effect will scroll the Camera so that the center of its viewport finishes at the given destination, @@ -2559,7 +3404,7 @@ declare namespace Phaser { * the current camera scroll x coordinate and the current camera scroll y coordinate. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - pan(x: number, y: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): this; + pan(x: number, y: number, duration?: number, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): this; /** * This effect will rotate the Camera so that the viewport finishes at the given angle in radians, @@ -2574,7 +3419,7 @@ declare namespace Phaser { * the current camera rotation angle in radians. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - rotateTo(radians: number, shortestPath?: boolean, duration?: integer, ease?: string | Function, force?: boolean, callback?: CameraRotateCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + rotateTo(radians: number, shortestPath?: boolean, duration?: number, ease?: string | Function, force?: boolean, callback?: CameraRotateCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * This effect will zoom the Camera to the given scale, over the duration and with the ease specified. @@ -2587,13 +3432,12 @@ declare namespace Phaser { * the current camera scroll x coordinate and the current camera scroll y coordinate. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - zoomTo(zoom: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): this; + zoomTo(zoom: number, duration?: number, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): this; /** * Internal preRender step. - * @param resolution The game resolution, as set in the Scale Manager. */ - protected preRender(resolution: number): void; + protected preRender(): void; /** * Sets the linear interpolation value to use when following a target. @@ -2655,7 +3499,7 @@ declare namespace Phaser { * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - protected update(time: integer, delta: number): void; + protected update(time: number, delta: number): void; /** * Destroys this Camera instance. You rarely need to call this directly. @@ -2761,7 +3605,38 @@ declare namespace Phaser { resetFlip(): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -2793,7 +3668,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -2816,43 +3691,143 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Does this Game Object have any Post Pipelines set? + */ + hasPostPipeline: boolean; + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + */ + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + } /** @@ -2878,7 +3853,7 @@ declare namespace Phaser { * viewport, and changing the viewport has no impact on the scrolling. * * By default a Camera will render all Game Objects it can see. You can change this using the `ignore` method, - * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique + * allowing you to filter Game Objects out on a per-Camera basis. The Camera Manager can manage up to 31 unique * 'Game Object ignore capable' Cameras. Any Cameras beyond 31 that you create will all be given a Camera ID of * zero, meaning that they cannot be used for Game Object exclusion. This means if you need your Camera to ignore * Game Objects, make sure it's one of the first 31 created. @@ -2962,7 +3937,7 @@ declare namespace Phaser { * @param makeMain Set this Camera as being the 'main' camera. This just makes the property `main` a reference to it. Default false. * @param name The name of the Camera. Default ''. */ - add(x?: integer, y?: integer, width?: integer, height?: integer, makeMain?: boolean, name?: string): Phaser.Cameras.Scene2D.Camera; + add(x?: number, y?: number, width?: number, height?: number, makeMain?: boolean, name?: string): Phaser.Cameras.Scene2D.Camera; /** * Adds an existing Camera into the Camera Manager. @@ -2987,7 +3962,7 @@ declare namespace Phaser { * If the optional `isVisible` argument is set it will only count Cameras that are currently visible. * @param isVisible Set the `true` to only include visible Cameras in the total. Default false. */ - getTotal(isVisible?: boolean): integer; + getTotal(isVisible?: boolean): number; /** * Populates this Camera Manager based on the given configuration object, or an array of config objects. @@ -3026,7 +4001,7 @@ declare namespace Phaser { * @param camera The Camera, or an array of Cameras, to be removed from this Camera Manager. * @param runDestroy Automatically call `Camera.destroy` on each Camera removed from this Camera Manager. Default true. */ - remove(camera: Phaser.Cameras.Scene2D.Camera | Phaser.Cameras.Scene2D.Camera[], runDestroy?: boolean): integer; + remove(camera: Phaser.Cameras.Scene2D.Camera | Phaser.Cameras.Scene2D.Camera[], runDestroy?: boolean): number; /** * The internal render method. This is called automatically by the Scene and should not be invoked directly. @@ -3034,10 +4009,18 @@ declare namespace Phaser { * It will iterate through all local cameras and render them in turn, as long as they're visible and have * an alpha level > 0. * @param renderer The Renderer that will render the children to this camera. - * @param children An array of renderable Game Objects. - * @param interpolation Interpolation value. Reserved for future use. + * @param children The Display List for the Scene. */ - protected render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, children: Phaser.GameObjects.GameObject[], interpolation: number): void; + protected render(renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer, children: Phaser.GameObjects.DisplayList): void; + + /** + * Takes an array of Game Objects and a Camera and returns a new array + * containing only those Game Objects that pass the `willRender` test + * against the given Camera. + * @param children An array of Game Objects to be checked against the camera. + * @param camera The camera to filte the Game Objects against. + */ + getVisibleChildren(children: Phaser.GameObjects.GameObject[], camera: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.GameObject[]; /** * Resets this Camera Manager. @@ -3052,12 +4035,12 @@ declare namespace Phaser { * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - protected update(time: integer, delta: number): void; + protected update(time: number, delta: number): void; /** * The event handler that manages the `resize` event dispatched by the Scale Manager. * @param gameSize The default Game Size object. This is the un-modified game dimensions. - * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. + * @param baseSize The base Size object. The game dimensions. The canvas width / height values match this. */ onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size): void; @@ -3116,7 +4099,7 @@ declare namespace Phaser { /** * The duration of the effect, in milliseconds. */ - readonly duration: integer; + readonly duration: number; /** * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. @@ -3135,14 +4118,14 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - start(direction?: boolean, duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFadeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + start(direction?: boolean, duration?: number, red?: number, green?: number, blue?: number, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFadeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * The main update loop for this effect. Called automatically by the Camera. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - update(time: integer, delta: number): void; + update(time: number, delta: number): void; /** * Called internally by the Canvas Renderer. @@ -3152,10 +4135,10 @@ declare namespace Phaser { /** * Called internally by the WebGL Renderer. - * @param pipeline The WebGL Pipeline to render to. + * @param pipeline The WebGL Pipeline to render to. Must provide the `drawFillRect` method. * @param getTintFunction A function that will return the gl safe tint colors. */ - postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline, getTintFunction: Function): boolean; + postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.MultiPipeline, getTintFunction: Function): boolean; /** * Called internally when the effect completes. @@ -3206,7 +4189,7 @@ declare namespace Phaser { /** * The duration of the effect, in milliseconds. */ - readonly duration: integer; + readonly duration: number; /** * If this effect is running this holds the current percentage of the progress, a value between 0 and 1. @@ -3216,22 +4199,22 @@ declare namespace Phaser { /** * Flashes the Camera to or from the given color over the duration specified. * @param duration The duration of the effect in milliseconds. Default 250. - * @param red The amount to fade the red channel towards. A value between 0 and 255. Default 255. - * @param green The amount to fade the green channel towards. A value between 0 and 255. Default 255. - * @param blue The amount to fade the blue channel towards. A value between 0 and 255. Default 255. + * @param red The amount to flash the red channel towards. A value between 0 and 255. Default 255. + * @param green The amount to flash the green channel towards. A value between 0 and 255. Default 255. + * @param blue The amount to flash the blue channel towards. A value between 0 and 255. Default 255. * @param force Force the effect to start immediately, even if already running. Default false. * @param callback This callback will be invoked every frame for the duration of the effect. * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - start(duration?: integer, red?: integer, green?: integer, blue?: integer, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFlashCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + start(duration?: number, red?: number, green?: number, blue?: number, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraFlashCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * The main update loop for this effect. Called automatically by the Camera. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - update(time: integer, delta: number): void; + update(time: number, delta: number): void; /** * Called internally by the Canvas Renderer. @@ -3241,10 +4224,10 @@ declare namespace Phaser { /** * Called internally by the WebGL Renderer. - * @param pipeline The WebGL Pipeline to render to. + * @param pipeline The WebGL Pipeline to render to. Must provide the `drawFillRect` method. * @param getTintFunction A function that will return the gl safe tint colors. */ - postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline, getTintFunction: Function): boolean; + postRenderWebGL(pipeline: Phaser.Renderer.WebGL.Pipelines.MultiPipeline, getTintFunction: Function): boolean; /** * Called internally when the effect completes. @@ -3296,7 +4279,7 @@ declare namespace Phaser { /** * The duration of the effect, in milliseconds. */ - readonly duration: integer; + readonly duration: number; /** * The starting scroll coordinates to pan the camera from. @@ -3336,14 +4319,14 @@ declare namespace Phaser { * the current camera scroll x coordinate and the current camera scroll y coordinate. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - start(x: number, y: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + start(x: number, y: number, duration?: number, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraPanCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * The main update loop for this effect. Called automatically by the Camera. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - update(time: integer, delta: number): void; + update(time: number, delta: number): void; /** * Called internally when the effect completes. @@ -3401,7 +4384,7 @@ declare namespace Phaser { /** * The duration of the effect, in milliseconds. */ - readonly duration: integer; + readonly duration: number; /** * The starting angle to rotate the camera from. @@ -3451,14 +4434,14 @@ declare namespace Phaser { * the current camera scroll x coordinate and the current camera scroll y coordinate. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - start(radians: number, shortestPath?: boolean, duration?: integer, ease?: string | Function, force?: boolean, callback?: CameraRotateCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + start(radians: number, shortestPath?: boolean, duration?: number, ease?: string | Function, force?: boolean, callback?: CameraRotateCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * The main update loop for this effect. Called automatically by the Camera. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - update(time: integer, delta: number): void; + update(time: number, delta: number): void; /** * Called internally when the effect completes. @@ -3509,7 +4492,7 @@ declare namespace Phaser { /** * The duration of the effect, in milliseconds. */ - readonly duration: integer; + readonly duration: number; /** * The intensity of the effect. Use small float values. The default when the effect starts is 0.05. @@ -3532,7 +4515,7 @@ declare namespace Phaser { * It is sent two arguments: A reference to the camera and a progress amount between 0 and 1 indicating how complete the effect is. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - start(duration?: integer, intensity?: number | Phaser.Math.Vector2, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraShakeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + start(duration?: number, intensity?: number | Phaser.Math.Vector2, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraShakeCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * The pre-render step for this effect. Called automatically by the Camera. @@ -3544,7 +4527,7 @@ declare namespace Phaser { * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - update(time: integer, delta: number): void; + update(time: number, delta: number): void; /** * Called internally when the effect completes. @@ -3592,7 +4575,7 @@ declare namespace Phaser { /** * The duration of the effect, in milliseconds. */ - readonly duration: integer; + readonly duration: number; /** * The starting zoom value; @@ -3625,14 +4608,14 @@ declare namespace Phaser { * and the current camera zoom value. * @param context The context in which the callback is invoked. Defaults to the Scene to which the Camera belongs. */ - start(zoom: number, duration?: integer, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraZoomCallback, context?: any): Phaser.Cameras.Scene2D.Camera; + start(zoom: number, duration?: number, ease?: string | Function, force?: boolean, callback?: Phaser.Types.Cameras.Scene2D.CameraZoomCallback, context?: any): Phaser.Cameras.Scene2D.Camera; /** * The main update loop for this effect. Called automatically by the Camera. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - update(time: integer, delta: number): void; + update(time: number, delta: number): void; /** * Called internally when the effect completes. @@ -3712,6 +4695,17 @@ declare namespace Phaser { */ const FLASH_START: any; + /** + * The Camera Follower Update Event. + * + * This event is dispatched by a Camera instance when it is following a + * Game Object and the Camera position has been updated as a result of + * that following. + * + * Listen to it from a Camera instance using: `camera.on('followupdate', listener)`. + */ + const FOLLOW_UPDATE: any; + /** * The Camera Pan Complete Event. * @@ -4051,55 +5045,61 @@ declare namespace Phaser { const VERSION: string; /** - * AUTO Detect Renderer. + * This setting will auto-detect if the browser is capable of suppporting WebGL. + * If it is, it will use the WebGL Renderer. If not, it will fall back to the Canvas Renderer. */ - const AUTO: integer; + const AUTO: number; /** - * Canvas Renderer. + * Forces Phaser to only use the Canvas Renderer, regardless if the browser supports + * WebGL or not. */ - const CANVAS: integer; + const CANVAS: number; /** - * WebGL Renderer. + * Forces Phaser to use the WebGL Renderer. If the browser does not support it, there is + * no fallback to Canvas with this setting, so you should trap it and display a suitable + * message to the user. */ - const WEBGL: integer; + const WEBGL: number; /** - * Headless Renderer. + * A Headless Renderer doesn't create either a Canvas or WebGL Renderer. However, it still + * absolutely relies on the DOM being present and available. This mode is meant for unit testing, + * not for running Phaser on the server, which is something you really shouldn't do. */ - const HEADLESS: integer; + const HEADLESS: number; /** * In Phaser the value -1 means 'forever' in lots of cases, this const allows you to use it instead * to help you remember what the value is doing in your code. */ - const FOREVER: integer; + const FOREVER: number; /** * Direction constant. */ - const NONE: integer; + const NONE: number; /** * Direction constant. */ - const UP: integer; + const UP: number; /** * Direction constant. */ - const DOWN: integer; + const DOWN: number; /** * Direction constant. */ - const LEFT: integer; + const LEFT: number; /** * Direction constant. */ - const RIGHT: integer; + const RIGHT: number; /** * The Phaser.Game instance is the main controller for the entire Phaser game. It is responsible @@ -4370,22 +5370,17 @@ declare namespace Phaser { /** * The width of the underlying canvas, in pixels. */ - readonly width: integer | string; + readonly width: number | string; /** * The height of the underlying canvas, in pixels. */ - readonly height: integer | string; + readonly height: number | string; /** * The zoom factor, as used by the Scale Manager. */ - readonly zoom: Phaser.Scale.ZoomType | integer; - - /** - * The canvas device pixel resolution. Currently un-used. - */ - readonly resolution: number; + readonly zoom: Phaser.Scale.ZoomType | number; /** * A parent DOM element into which the canvas created by the renderer will be injected. @@ -4405,7 +5400,7 @@ declare namespace Phaser { /** * Automatically round the display and style sizes of the canvas. This can help with performance in lower-powered devices. */ - readonly autoRound: integer; + readonly autoRound: number; /** * Automatically center the canvas within the parent? @@ -4415,7 +5410,7 @@ declare namespace Phaser { /** * How many ms should elapse before checking if the browser size has changed? */ - readonly resizeInterval: integer; + readonly resizeInterval: number; /** * The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. @@ -4425,22 +5420,22 @@ declare namespace Phaser { /** * The minimum width, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - readonly minWidth: integer; + readonly minWidth: number; /** * The maximum width, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - readonly maxWidth: integer; + readonly maxWidth: number; /** * The minimum height, in pixels, the canvas will scale down to. A value of zero means no minimum. */ - readonly minHeight: integer; + readonly minHeight: number; /** * The maximum height, in pixels, the canvas will scale up to. A value of zero means no maximum. */ - readonly maxHeight: integer; + readonly maxHeight: number; /** * Force Phaser to use a specific renderer. Can be `CONST.CANVAS`, `CONST.WEBGL`, `CONST.HEADLESS` or `CONST.AUTO` (default) @@ -4520,7 +5515,7 @@ declare namespace Phaser { /** * `preventDefault` will be called on every non-modified key which has a key code in this array. By default, it is empty. */ - readonly inputKeyboardCapture: integer[]; + readonly inputKeyboardCapture: number[]; /** * Enable the Mouse Plugin. This can be disabled in games that don't need mouse input. @@ -4533,9 +5528,24 @@ declare namespace Phaser { readonly inputMouseEventTarget: any; /** - * Should mouse events be captured? I.e. have prevent default called on them. + * Should `mousedown` DOM events have `preventDefault` called on them? */ - readonly inputMouseCapture: boolean; + readonly inputMousePreventDefaultDown: boolean; + + /** + * Should `mouseup` DOM events have `preventDefault` called on them? + */ + readonly inputMousePreventDefaultUp: boolean; + + /** + * Should `mousemove` DOM events have `preventDefault` called on them? + */ + readonly inputMousePreventDefaultMove: boolean; + + /** + * Should `wheel` DOM events have `preventDefault` called on them? + */ + readonly inputMousePreventDefaultWheel: boolean; /** * Enable the Touch Plugin. This can be disabled in games that don't need touch input. @@ -4555,12 +5565,12 @@ declare namespace Phaser { /** * The number of Pointer objects created by default. In a mouse-only, or non-multi touch game, you can leave this as 1. */ - readonly inputActivePointers: integer; + readonly inputActivePointers: number; /** * The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. */ - readonly inputSmoothFactor: integer; + readonly inputSmoothFactor: number; /** * Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire. @@ -4612,6 +5622,11 @@ declare namespace Phaser { */ readonly fps: Phaser.Types.Core.FPSConfig; + /** + * An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances. + */ + readonly pipeline: Phaser.Types.Core.PipelineConfig; + /** * When set to `true`, WebGL uses linear interpolation to draw scaled or rotated textures, giving a smooth appearance. When set to `false`, WebGL uses nearest-neighbor interpolation, giving a crisper appearance. `false` also disables antialiasing of the game canvas itself, if the browser supports it, when the game canvas is scaled. */ @@ -4668,14 +5683,19 @@ declare namespace Phaser { readonly powerPreference: string; /** - * The default WebGL Batch size. + * The default WebGL Batch size. Represents the number of _quads_ that can be added to a single batch. */ - readonly batchSize: integer; + readonly batchSize: number; + + /** + * When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. + */ + readonly maxTextures: number; /** * The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ - readonly maxLights: integer; + readonly maxLights: number; /** * The background color of the game canvas. The default is black. This value is ignored if `transparent` is set to `true`. @@ -4715,7 +5735,7 @@ declare namespace Phaser { /** * Maximum parallel downloads allowed for resources (Default to 32). */ - readonly loaderMaxParallelDownloads: integer; + readonly loaderMaxParallelDownloads: number; /** * 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. @@ -4745,7 +5765,7 @@ declare namespace Phaser { /** * Optional XHR timeout value, in ms. */ - readonly loaderTimeout: integer; + readonly loaderTimeout: number; /** * Optional XHR withCredentials value. @@ -4777,6 +5797,11 @@ declare namespace Phaser { */ readonly missingImage: string; + /** + * A base64 encoded PNG that will be used as the default texture when a texture is assigned that is white or not loaded. + */ + readonly whiteImage: string; + } /** @@ -4984,7 +6009,7 @@ declare namespace Phaser { /** * The minimum fps rate you want the Time Step to run at. */ - minFps: integer; + minFps: number; /** * The target fps rate for the Time Step to run at. @@ -4993,23 +6018,23 @@ declare namespace Phaser { * the control of Phaser. Instead, it allows you to determine performance issues and if the Time Step * is spiraling out of control. */ - targetFps: integer; + targetFps: number; /** * An exponential moving average of the frames per second. */ - readonly actualFps: integer; + readonly actualFps: number; /** * The time at which the next fps rate update will take place. * When an fps update happens, the `framesThisSecond` value is reset. */ - readonly nextFpsUpdate: integer; + readonly nextFpsUpdate: number; /** * The number of frames processed this second. */ - readonly framesThisSecond: integer; + readonly framesThisSecond: number; /** * A callback to be invoked each time the Time Step steps. @@ -5042,7 +6067,7 @@ declare namespace Phaser { * The current frame the game is on. This counter is incremented once every game step, regardless of how much * time has passed and is unaffected by delta smoothing. */ - readonly frame: integer; + readonly frame: number; /** * Is the browser currently considered in focus by the Page Visibility API? @@ -5053,24 +6078,24 @@ declare namespace Phaser { /** * The delta time, in ms, since the last game step. This is a clamped and smoothed average value. */ - delta: integer; + delta: number; /** * Internal index of the delta history position. */ - deltaIndex: integer; + deltaIndex: number; /** * Internal array holding the previous delta values, used for delta smoothing. */ - deltaHistory: integer[]; + deltaHistory: number[]; /** * The maximum number of delta values that are retained in order to calculate a smoothed moving average. * * This can be changed in the Game Config via the `fps.deltaHistory` property. The default is 10. */ - deltaSmoothingMax: integer; + deltaSmoothingMax: number; /** * The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually @@ -5078,7 +6103,7 @@ declare namespace Phaser { * * This can be changed in the Game Config via the `fps.panicMax` property. The default is 120. */ - panicMax: integer; + panicMax: number; /** * The actual elapsed time in ms between one update and the next. @@ -5319,7 +6344,7 @@ declare namespace Phaser { * @param graphics The graphics object this curve should be drawn to. * @param pointsTotal The number of intermediary points that make up this curve. A higher number of points will result in a smoother curve. Default 32. */ - draw(graphics: G, pointsTotal?: integer): G; + draw(graphics: G, pointsTotal?: number): G; /** * Returns a JSON object that describes this curve. @@ -5354,12 +6379,12 @@ declare namespace Phaser { /** * The default number of divisions within the curve. */ - defaultDivisions: integer; + defaultDivisions: number; /** * The quantity of arc length divisions within the curve. */ - arcLengthDivisions: integer; + arcLengthDivisions: number; /** * An array of cached arc length values. @@ -5384,7 +6409,7 @@ declare namespace Phaser { * @param graphics The Graphics instance onto which this curve will be drawn. * @param pointsTotal The resolution of the curve. The higher the value the smoother it will render, at the cost of rendering performance. Default 32. */ - draw(graphics: G, pointsTotal?: integer): G; + draw(graphics: G, pointsTotal?: number): G; /** * Returns a Rectangle where the position and dimensions match the bounds of this Curve. @@ -5394,14 +6419,14 @@ declare namespace Phaser { * @param out The Rectangle to store the bounds in. If falsey a new object will be created. * @param accuracy The accuracy of the bounds calculations. Default 16. */ - getBounds(out?: Phaser.Geom.Rectangle, accuracy?: integer): Phaser.Geom.Rectangle; + getBounds(out?: Phaser.Geom.Rectangle, accuracy?: number): Phaser.Geom.Rectangle; /** * Returns an array of points, spaced out X distance pixels apart. * The smaller the distance, the larger the array will be. * @param distance The distance, in pixels, between each point along the curve. */ - getDistancePoints(distance: integer): Phaser.Geom.Point[]; + getDistancePoints(distance: number): Phaser.Geom.Point[]; /** * Get a point at the end of the curve. @@ -5426,7 +6451,7 @@ declare namespace Phaser { * - [divisions] All segments * @param divisions The number of divisions or segments. */ - getLengths(divisions?: integer): number[]; + getLengths(divisions?: number): number[]; /** * Get a point at a relative position on the curve, by arc length. @@ -5451,7 +6476,7 @@ declare namespace Phaser { * @param stepRate The curve distance between points, implying `divisions`. * @param out An optional array to store the points in. */ - getPoints(divisions?: integer, stepRate?: number, out?: O): O; + getPoints(divisions?: number, stepRate?: number, out?: O): O; /** * Get a random point from the curve. @@ -5467,7 +6492,7 @@ declare namespace Phaser { * @param stepRate Step between points. Used to calculate the number of points to return when divisions is falsy. Ignored if divisions is positive. * @param out An optional array to store the points in. */ - getSpacedPoints(divisions?: integer, stepRate?: number, out?: any[] | Phaser.Math.Vector2[]): Phaser.Math.Vector2[]; + getSpacedPoints(divisions?: number, stepRate?: number, out?: any[] | Phaser.Math.Vector2[]): Phaser.Math.Vector2[]; /** * Get a point at the start of the curve. @@ -5497,7 +6522,7 @@ declare namespace Phaser { * @param distance The distance, in pixels. * @param divisions Optional amount of divisions. */ - getTFromDistance(distance: integer, divisions?: integer): number; + getTFromDistance(distance: number, divisions?: number): number; /** * Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant. @@ -5505,7 +6530,7 @@ declare namespace Phaser { * @param distance The distance, in pixels. * @param divisions Optional amount of divisions. */ - getUtoTmapping(u: number, distance: integer, divisions?: integer): number; + getUtoTmapping(u: number, distance: number, divisions?: number): number; /** * Calculate and cache the arc lengths. @@ -5531,7 +6556,7 @@ declare namespace Phaser { * @param clockwise Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). Default false. * @param rotation The rotation of the ellipse, in degrees. Default 0. */ - constructor(x?: number | Phaser.Types.Curves.EllipseCurveConfig, y?: number, xRadius?: number, yRadius?: number, startAngle?: integer, endAngle?: integer, clockwise?: boolean, rotation?: integer); + constructor(x?: number | Phaser.Types.Curves.EllipseCurveConfig, y?: number, xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number); /** * The center point of the ellipse. Used for calculating rotation. @@ -5687,7 +6712,7 @@ declare namespace Phaser { /** * The quantity of arc length divisions within the curve. */ - arcLengthDivisions: integer; + arcLengthDivisions: number; /** * Returns a Rectangle where the position and dimensions match the bounds of this Curve. @@ -5732,7 +6757,7 @@ declare namespace Phaser { * @param distance The distance, in pixels. * @param divisions Optional amount of divisions. */ - getUtoTmapping(u: number, distance: integer, divisions?: integer): number; + getUtoTmapping(u: number, distance: number, divisions?: number): number; /** * Draws this curve on the given Graphics object. @@ -5757,13 +6782,14 @@ declare namespace Phaser { } /** - * A MoveTo Curve is a very simple curve consisting of only a single point. Its intended use is to move the ending point in a Path. + * A MoveTo Curve is a very simple curve consisting of only a single point. + * Its intended use is to move the ending point in a Path. */ class MoveTo { /** * - * @param x `x` pixel coordinate. - * @param y `y` pixel coordinate. + * @param x `x` pixel coordinate. Default 0. + * @param y `y` pixel coordinate. Default 0. */ constructor(x?: number, y?: number); @@ -5903,7 +6929,7 @@ declare namespace Phaser { * @param graphics The Graphics Game Object to draw to. * @param pointsTotal The number of points to draw for each Curve. Higher numbers result in a smoother curve but require more processing. Default 32. */ - draw(graphics: Phaser.GameObjects.Graphics, pointsTotal?: integer): G; + draw(graphics: Phaser.GameObjects.Graphics, pointsTotal?: number): G; /** * Creates an ellipse curve positioned at the previous end point, using the given parameters. @@ -5914,7 +6940,7 @@ declare namespace Phaser { * @param clockwise Whether the ellipse angles are given as clockwise (`true`) or counter-clockwise (`false`). Default false. * @param rotation The rotation of the ellipse, in degrees. Default 0. */ - ellipseTo(xRadius?: number, yRadius?: number, startAngle?: integer, endAngle?: integer, clockwise?: boolean, rotation?: number): this; + ellipseTo(xRadius?: number, yRadius?: number, startAngle?: number, endAngle?: number, clockwise?: boolean, rotation?: number): this; /** * Creates a Path from a Path Configuration object. @@ -5929,7 +6955,7 @@ declare namespace Phaser { * @param out The Rectangle to store the bounds in. * @param accuracy The accuracy of the bounds calculations. Higher values are more accurate at the cost of calculation speed. Default 16. */ - getBounds(out?: O, accuracy?: integer): O; + getBounds(out?: O, accuracy?: number): O; /** * Returns an array containing the length of the Path at the end of each Curve. @@ -5964,7 +6990,7 @@ declare namespace Phaser { * Get a sequence of points on the path. * @param divisions The number of divisions per resolution per curve. Default 12. */ - getPoints(divisions?: integer): Phaser.Math.Vector2[]; + getPoints(divisions?: number): Phaser.Math.Vector2[]; /** * Returns a randomly chosen point anywhere on the path. This follows the same rules as `getPoint` in that it may return a point on any Curve inside this path. @@ -5980,7 +7006,7 @@ declare namespace Phaser { * The resulting points are equally spaced with respect to the points' position on the path, but not necessarily equally spaced spatially. * @param divisions The amount of points to divide this Path into. Default 40. */ - getSpacedPoints(divisions?: integer): Phaser.Math.Vector2[]; + getSpacedPoints(divisions?: number): Phaser.Math.Vector2[]; /** * Returns the starting point of the Path. @@ -6088,7 +7114,7 @@ declare namespace Phaser { * @param graphics `Graphics` object to draw onto. * @param pointsTotal Number of points to be used for drawing the curve. Higher numbers result in smoother curve but require more processing. Default 32. */ - draw(graphics: G, pointsTotal?: integer): G; + draw(graphics: G, pointsTotal?: number): G; /** * Converts the curve into a JSON compatible object. @@ -6382,7 +7408,7 @@ declare namespace Phaser { /** * Return the total number of entries in this Data Manager. */ - count: integer; + count: number; } @@ -6442,6 +7468,13 @@ declare namespace Phaser { */ const CHANGE_DATA_KEY: any; + /** + * The Data Manager Destroy Event. + * + * The Data Manager will listen for the destroy event from its parent, and then close itself down. + */ + const DESTROY: any; + /** * The Remove Data Event. * @@ -6867,67 +7900,67 @@ declare namespace Phaser { /** * A constant representing a top-left alignment or position. */ - const TOP_LEFT: integer; + const TOP_LEFT: number; /** * A constant representing a top-center alignment or position. */ - const TOP_CENTER: integer; + const TOP_CENTER: number; /** * A constant representing a top-right alignment or position. */ - const TOP_RIGHT: integer; + const TOP_RIGHT: number; /** * A constant representing a left-top alignment or position. */ - const LEFT_TOP: integer; + const LEFT_TOP: number; /** * A constant representing a left-center alignment or position. */ - const LEFT_CENTER: integer; + const LEFT_CENTER: number; /** * A constant representing a left-bottom alignment or position. */ - const LEFT_BOTTOM: integer; + const LEFT_BOTTOM: number; /** * A constant representing a center alignment or position. */ - const CENTER: integer; + const CENTER: number; /** * A constant representing a right-top alignment or position. */ - const RIGHT_TOP: integer; + const RIGHT_TOP: number; /** * A constant representing a right-center alignment or position. */ - const RIGHT_CENTER: integer; + const RIGHT_CENTER: number; /** * A constant representing a right-bottom alignment or position. */ - const RIGHT_BOTTOM: integer; + const RIGHT_BOTTOM: number; /** * A constant representing a bottom-left alignment or position. */ - const BOTTOM_LEFT: integer; + const BOTTOM_LEFT: number; /** * A constant representing a bottom-center alignment or position. */ - const BOTTOM_CENTER: integer; + const BOTTOM_CENTER: number; /** * A constant representing a bottom-right alignment or position. */ - const BOTTOM_RIGHT: integer; + const BOTTOM_RIGHT: number; namespace In { /** @@ -6984,7 +8017,7 @@ declare namespace Phaser { * @param offsetX Optional horizontal offset from the position. Default 0. * @param offsetY Optional vertical offset from the position. Default 0. */ - function QuickSet(child: G, alignIn: Phaser.GameObjects.GameObject, position: integer, offsetX?: number, offsetY?: number): G; + function QuickSet(child: G, alignIn: Phaser.GameObjects.GameObject, position: number, offsetX?: number, offsetY?: number): G; /** * Takes given Game Object and aligns it so that it is positioned in the right center of the other. @@ -7088,7 +8121,7 @@ declare namespace Phaser { * @param offsetX Optional horizontal offset from the position. Default 0. * @param offsetY Optional vertical offset from the position. Default 0. */ - function QuickSet(child: G, alignTo: Phaser.GameObjects.GameObject, position: integer, offsetX?: number, offsetY?: number): G; + function QuickSet(child: G, alignTo: Phaser.GameObjects.GameObject, position: number, offsetX?: number, offsetY?: number): G; /** * Takes given Game Object and aligns it so that it is positioned next to the right bottom position of the other. @@ -7293,7 +8326,7 @@ declare namespace Phaser { * @param canvasType The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. Default Phaser.CANVAS. * @param selfParent Use the generated Canvas element as the parent? Default false. */ - function create(parent: any, width?: integer, height?: integer, canvasType?: integer, selfParent?: boolean): HTMLCanvasElement; + function create(parent: any, width?: number, height?: number, canvasType?: number, selfParent?: boolean): HTMLCanvasElement; /** * Creates a new Canvas DOM element, or pulls one from the pool if free. @@ -7301,7 +8334,7 @@ declare namespace Phaser { * @param width The width of the Canvas. Default 1. * @param height The height of the Canvas. Default 1. */ - function create2D(parent: any, width?: integer, height?: integer): HTMLCanvasElement; + function create2D(parent: any, width?: number, height?: number): HTMLCanvasElement; /** * Creates a new Canvas DOM element, or pulls one from the pool if free. @@ -7309,13 +8342,13 @@ declare namespace Phaser { * @param width The width of the Canvas. Default 1. * @param height The height of the Canvas. Default 1. */ - function createWebGL(parent: any, width?: integer, height?: integer): HTMLCanvasElement; + function createWebGL(parent: any, width?: number, height?: number): HTMLCanvasElement; /** * Gets the first free canvas index from the pool. * @param canvasType The type of the Canvas. Either `Phaser.CANVAS` or `Phaser.WEBGL`. Default Phaser.CANVAS. */ - function first(canvasType?: integer): HTMLCanvasElement; + function first(canvasType?: number): HTMLCanvasElement; /** * Looks up a canvas based on its parent, and if found puts it back in the pool, freeing it up for re-use. @@ -7327,12 +8360,12 @@ declare namespace Phaser { /** * Gets the total number of used canvas elements in the pool. */ - function total(): integer; + function total(): number; /** * Gets the total number of free canvas elements in the pool. */ - function free(): integer; + function free(): number; /** * Disable context smoothing on any new Canvas element created. @@ -7448,7 +8481,7 @@ declare namespace Phaser { * @param blue The blue color value. A number between 0 and 255. Default 0. * @param alpha The alpha value. A number between 0 and 255. Default 255. */ - constructor(red?: integer, green?: integer, blue?: integer, alpha?: integer); + constructor(red?: number, green?: number, blue?: number, alpha?: number); /** * An array containing the calculated color values for WebGL use. @@ -7468,7 +8501,7 @@ declare namespace Phaser { * @param alpha The alpha value. A number between 0 and 255. Default 255. * @param updateHSV Update the HSV values after setting the RGB values? Default true. */ - setTo(red: integer, green: integer, blue: integer, alpha?: integer, updateHSV?: boolean): Phaser.Display.Color; + setTo(red: number, green: number, blue: number, alpha?: number, updateHSV?: boolean): Phaser.Display.Color; /** * Sets the red, green, blue and alpha GL values of this Color component. @@ -7502,53 +8535,53 @@ declare namespace Phaser { * Sets this Color object to be grayscaled based on the shade value given. * @param shade A value between 0 and 255. */ - gray(shade: integer): Phaser.Display.Color; + gray(shade: number): Phaser.Display.Color; /** * Sets this Color object to be a random color between the `min` and `max` values given. * @param min The minimum random color value. Between 0 and 255. Default 0. * @param max The maximum random color value. Between 0 and 255. Default 255. */ - random(min?: integer, max?: integer): Phaser.Display.Color; + random(min?: number, max?: number): Phaser.Display.Color; /** * Sets this Color object to be a random grayscale color between the `min` and `max` values given. * @param min The minimum random color value. Between 0 and 255. Default 0. * @param max The maximum random color value. Between 0 and 255. Default 255. */ - randomGray(min?: integer, max?: integer): Phaser.Display.Color; + randomGray(min?: number, max?: number): Phaser.Display.Color; /** * Increase the saturation of this Color by the percentage amount given. * The saturation is the amount of the base color in the hue. * @param amount The percentage amount to change this color by. A value between 0 and 100. */ - saturate(amount: integer): Phaser.Display.Color; + saturate(amount: number): Phaser.Display.Color; /** * Decrease the saturation of this Color by the percentage amount given. * The saturation is the amount of the base color in the hue. * @param amount The percentage amount to change this color by. A value between 0 and 100. */ - desaturate(amount: integer): Phaser.Display.Color; + desaturate(amount: number): Phaser.Display.Color; /** * Increase the lightness of this Color by the percentage amount given. * @param amount The percentage amount to change this color by. A value between 0 and 100. */ - lighten(amount: integer): Phaser.Display.Color; + lighten(amount: number): Phaser.Display.Color; /** * Decrease the lightness of this Color by the percentage amount given. * @param amount The percentage amount to change this color by. A value between 0 and 100. */ - darken(amount: integer): Phaser.Display.Color; + darken(amount: number): Phaser.Display.Color; /** * Brighten this Color by the percentage amount given. * @param amount The percentage amount to change this color by. A value between 0 and 100. */ - brighten(amount: integer): Phaser.Display.Color; + brighten(amount: number): Phaser.Display.Color; /** * The color of this Color component, not including the alpha channel. @@ -7623,6 +8656,18 @@ declare namespace Phaser { */ v: number; + /** + * Return an array of Colors in a Color Spectrum. + * + * The spectrum colors flow in the order: red, yellow, green, blue. + * + * By default this function will return an array with 1024 elements in. + * + * However, you can reduce this to a smaller quantity if needed, by specitying the `limit` parameter. + * @param limit How many colors should be returned? The maximum is 1024 but you can set a smaller quantity if required. Default 1024. + */ + static ColorSpectrum(limit?: number): Phaser.Types.Display.ColorObject[]; + /** * Converts the given color value into an Object containing r,g,b and a properties. * @param color A color value, optionally including the alpha value. @@ -7633,7 +8678,7 @@ declare namespace Phaser { * Returns a string containing a hex representation of the given color component. * @param color The color channel to get the hex value for, must be a value between 0 and 255. */ - static ComponentToHex(color: integer): string; + static ComponentToHex(color: number): string; /** * Given 3 separate color values this will return an integer representation of it. @@ -7641,7 +8686,7 @@ declare namespace Phaser { * @param green The green color value. A number between 0 and 255. * @param blue The blue color value. A number between 0 and 255. */ - static GetColor(red: integer, green: integer, blue: integer): number; + static GetColor(red: number, green: number, blue: number): number; /** * Given an alpha and 3 color values this will return an integer representation of it. @@ -7650,7 +8695,7 @@ declare namespace Phaser { * @param blue The blue color value. A number between 0 and 255. * @param alpha The alpha color value. A number between 0 and 255. */ - static GetColor32(red: integer, green: integer, blue: integer, alpha: integer): number; + static GetColor32(red: number, green: number, blue: number, alpha: number): number; /** * Converts a hex string into a Phaser Color object. @@ -7678,10 +8723,11 @@ declare namespace Phaser { static HSVColorWheel(s?: number, v?: number): Phaser.Types.Display.ColorObject[]; /** - * Converts an HSV (hue, saturation and value) color value to RGB. - * Conversion formula from http://en.wikipedia.org/wiki/HSL_color_space. + * Converts a HSV (hue, saturation and value) color set to RGB. + * + * Conversion formula from https://en.wikipedia.org/wiki/HSL_and_HSV + * * Assumes HSV values are contained in the set [0, 1]. - * Based on code by Michael Jackson (https://github.com/mjijackson) * @param h The hue, in the range 0 - 1. This is the base color. * @param s The saturation, in the range 0 - 1. This controls how much of the hue will be in the final color, where 1 is fully saturated and 0 will give you white. * @param v The value, in the range 0 - 1. This controls how dark the color is. Where 1 is as bright as possible and 0 is black. @@ -7699,7 +8745,7 @@ declare namespace Phaser { * Converts the given color value into an instance of a Color object. * @param input The color value to convert into a Color object. */ - static IntegerToColor(input: integer): Phaser.Display.Color; + static IntegerToColor(input: number): Phaser.Display.Color; /** * Return the component parts of a color as an Object with the properties alpha, red, green, blue. @@ -7707,7 +8753,7 @@ declare namespace Phaser { * Alpha will only be set if it exists in the given color (0xAARRGGBB) * @param input The color value to convert into a Color object. */ - static IntegerToRGB(input: integer): Phaser.Types.Display.ColorObject; + static IntegerToRGB(input: number): Phaser.Types.Display.ColorObject; /** * Converts an object containing `r`, `g`, `b` and `a` properties into a Color class instance. @@ -7721,7 +8767,7 @@ declare namespace Phaser { * @param min The minimum value to set the random range from (between 0 and 255) Default 0. * @param max The maximum value to set the random range from (between 0 and 255) Default 255. */ - static RandomRGB(min?: integer, max?: integer): Phaser.Display.Color; + static RandomRGB(min?: number, max?: number): Phaser.Display.Color; /** * Converts a CSS 'web' string into a Phaser Color object. @@ -7741,7 +8787,7 @@ declare namespace Phaser { * @param b The blue color value. A number between 0 and 255. * @param out An object to store the color values in. If not given an HSV Color Object will be created. */ - static RGBToHSV(r: integer, g: integer, b: integer, out?: Phaser.Types.Display.HSVColorObject | Phaser.Display.Color): Phaser.Types.Display.HSVColorObject | Phaser.Display.Color; + static RGBToHSV(r: number, g: number, b: number, out?: Phaser.Types.Display.HSVColorObject | Phaser.Display.Color): Phaser.Types.Display.HSVColorObject | Phaser.Display.Color; /** * Converts the color values into an HTML compatible color string, prefixed with either `#` or `0x`. @@ -7751,7 +8797,7 @@ declare namespace Phaser { * @param a The alpha value. A number between 0 and 255. Default 255. * @param prefix The prefix of the string. Either `#` or `0x`. Default #. */ - static RGBToString(r: integer, g: integer, b: integer, a?: integer, prefix?: string): string; + static RGBToString(r: number, g: number, b: number, a?: number, prefix?: string): string; /** * Converts the given source color value into an instance of a Color class. @@ -7762,6 +8808,160 @@ declare namespace Phaser { } + /** + * The ColorMatrix class creates a 5x4 matrix that can be used in shaders and graphics + * operations. It provides methods required to modify the color values, such as adjusting + * the brightness, setting a sepia tone, hue rotation and more. + * + * Use the method `getData` to return a Float32Array containing the current color values. + */ + class ColorMatrix { + /** + * The value that determines how much of the original color is used + * when mixing the colors. A value between 0 (all original) and 1 (all final) + */ + alpha: number; + + /** + * Sets this ColorMatrix from the given array of color values. + * @param value The ColorMatrix values to set. + */ + set(value: number[]): this; + + /** + * Resets the ColorMatrix. + */ + reset(): this; + + /** + * Gets the ColorMatrix as a Float32Array. + * + * Can be used directly as a 1fv shader uniform value. + */ + getData(): Float32Array; + + /** + * Changes the brightness of this ColorMatrix by the given amount. + * @param value The amount of brightness to apply to this ColorMatrix. Between 0 (black) and 1. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + brightness(value?: number, multiply?: boolean): this; + + /** + * Changes the saturation of this ColorMatrix by the given amount. + * @param value The amount of saturation to apply to this ColorMatrix. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + saturate(value?: number, multiply?: boolean): this; + + /** + * Desaturates this ColorMatrix (removes color from it). + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + saturation(multiply?: boolean): this; + + /** + * Rotates the hues of this ColorMatrix by the value given. + * @param rotation The amount of hue rotation to apply to this ColorMatrix, in degrees. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + hue(rotation?: number, multiply?: boolean): this; + + /** + * Sets this ColorMatrix to be grayscale. + * @param value The grayscale scale (0 is black). Default 1. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + grayscale(value?: number, multiply?: boolean): this; + + /** + * Sets this ColorMatrix to be black and white. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + blackWhite(multiply?: boolean): this; + + /** + * Change the contrast of this ColorMatrix by the amount given. + * @param value The amount of contrast to apply to this ColorMatrix. Default 0. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + contrast(value?: number, multiply?: boolean): this; + + /** + * Converts this ColorMatrix to have negative values. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + negative(multiply?: boolean): this; + + /** + * Apply a desaturated luminance to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + desaturateLuminance(multiply?: boolean): this; + + /** + * Applies a sepia tone to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + sepia(multiply?: boolean): this; + + /** + * Applies a night vision tone to this ColorMatrix. + * @param intensity The intensity of this effect. Default 0.1. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + night(intensity?: number, multiply?: boolean): this; + + /** + * Applies a trippy color tone to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + lsd(multiply?: boolean): this; + + /** + * Applies a brown tone to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + brown(multiply?: boolean): this; + + /** + * Applies a vintage pinhole color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + vintagePinhole(multiply?: boolean): this; + + /** + * Applies a kodachrome color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + kodachrome(multiply?: boolean): this; + + /** + * Applies a technicolor color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + technicolor(multiply?: boolean): this; + + /** + * Applies a polaroid color effect to this ColorMatrix. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + polaroid(multiply?: boolean): this; + + /** + * Shifts the values of this ColorMatrix into BGR order. + * @param multiply Multiply the resulting ColorMatrix (`true`), or set it (`false`) ? Default false. + */ + shiftToBGR(multiply?: boolean): this; + + /** + * Multiplies the two given matrices. + * @param a The 5x4 array to multiply with ColorMatrix._matrix. + */ + multiply(a: number[]): this; + + } + namespace Masks { /** * A Bitmap Mask combines the alpha (opacity) of a masked pixel with the alpha of another pixel. @@ -7779,6 +8979,9 @@ declare namespace Phaser { * A pixel with an alpha of 1 in the masked Game Object will receive the same alpha as the * corresponding pixel in the mask. * + * Note: You cannot combine Bitmap Masks and Blend Modes on the same Game Object. You can, however, + * combine Geometry Masks and Blend Modes together. + * * The Bitmap Mask's location matches the location of its Game Object, not the location of the * masked objects. Moving or transforming the underlying Game Object will change the mask * (and affect the visibility of any masked objects), whereas moving or transforming a masked object @@ -7808,7 +9011,7 @@ declare namespace Phaser { bitmapMask: Phaser.GameObjects.GameObject; /** - * The texture used for the mask's framebuffer. + * The texture used for the masks framebuffer. */ maskTexture: WebGLTexture; @@ -7832,15 +9035,11 @@ declare namespace Phaser { */ maskFramebuffer: WebGLFramebuffer; - /** - * The previous framebuffer set in the renderer before this one was enabled. - */ - prevFramebuffer: WebGLFramebuffer; - /** * Whether to invert the masks alpha. * - * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. + * If `true`, the alpha of the masking pixel will be inverted before it's multiplied with the masked pixel. + * Essentially, this means that a masked area will be visible only if the corresponding area in the mask is invisible. */ invertAlpha: boolean; @@ -7849,6 +9048,21 @@ declare namespace Phaser { */ readonly isStencil: boolean; + /** + * Creates the WebGL Texture2D objects and Framebuffers required for this + * mask. If this mask has already been created, then `clearMask` is called first. + */ + createMask(): void; + + /** + * Deletes the `mainTexture` and `maskTexture` WebGL Textures and deletes + * the `mainFramebuffer` and `maskFramebuffer` too, nulling all references. + * + * This is called when this mask is destroyed, or if you try to creat a new + * mask from this object when one is already set. + */ + clearMask(): void; + /** * Sets a new masking Game Object for the Bitmap Mask. * @param renderable A renderable Game Object that uses a texture, such as a Sprite. @@ -7930,6 +9144,8 @@ declare namespace Phaser { /** * Similar to the BitmapMasks invertAlpha setting this to true will then hide all pixels * drawn to the Geometry Mask. + * + * This is a WebGL only feature. */ invertAlpha: boolean; @@ -7946,7 +9162,10 @@ declare namespace Phaser { /** * Sets the `invertAlpha` property of this Geometry Mask. + * * Inverting the alpha essentially flips the way the mask works. + * + * This is a WebGL only feature. * @param value Invert the alpha of this mask? Default true. */ setInvertAlpha(value?: boolean): this; @@ -7999,6 +9218,87 @@ declare namespace Phaser { } + /** + * The RGB class holds a single color value and allows for easy modification and reading of it, + * with optional on-change callback notification and a dirty flag. + */ + class RGB { + /** + * + * @param red The red color value. A number between 0 and 1. Default 0. + * @param green The green color value. A number between 0 and 1. Default 0. + * @param blue The blue color value. A number between 0 and 1. Default 0. + */ + constructor(red?: number, green?: number, blue?: number); + + /** + * This callback will be invoked each time one of the RGB color values change. + * + * The callback is sent the new color values as the parameters. + */ + onChangeCallback: Function; + + /** + * Is this color dirty? + */ + dirty: boolean; + + /** + * Sets the red, green and blue values of this RGB object, flags it as being + * dirty and then invokes the `onChangeCallback`, if set. + * @param red The red color value. A number between 0 and 1. Default 0. + * @param green The green color value. A number between 0 and 1. Default 0. + * @param blue The blue color value. A number between 0 and 1. Default 0. + */ + set(red?: number, green?: number, blue?: number): this; + + /** + * Compares the given rgb parameters with those in this object and returns + * a boolean `true` value if they are equal, otherwise it returns `false`. + * @param red The red value to compare with this object. + * @param green The green value to compare with this object. + * @param blue The blue value to compare with this object. + */ + equals(red: number, green: number, blue: number): boolean; + + /** + * Internal on change handler. Sets this object as being dirty and + * then invokes the `onChangeCallback`, if set, passing in the + * new RGB values. + */ + onChange(): void; + + /** + * The red color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + */ + r: number; + + /** + * The green color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + */ + g: number; + + /** + * The blue color value. Between 0 and 1. + * + * Changing this property will flag this RGB object as being dirty + * and invoke the `onChangeCallback` , if set. + */ + b: number; + + /** + * Nulls any external references this object contains. + */ + destroy(): void; + + } + /** * A BaseShader is a small resource class that contains the data required for a WebGL Shader to be created. * @@ -8267,12 +9567,6 @@ declare namespace Phaser { } - /** - * Phaser Blend Modes to CSS Blend Modes Map. - */ - enum CSSBlendModes { - } - namespace GameObjects { /** * BitmapText objects work by taking a texture file and an XML or JSON file that describes the font structure. @@ -8294,12 +9588,12 @@ declare namespace Phaser { * * To create a BitmapText data files you need a 3rd party app such as: * - * BMFont (Windows, free): http://www.angelcode.com/products/bmfont/ - * Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner - * Littera (Web-based, free): http://kvazars.com/littera/ + * BMFont (Windows, free): {@link http://www.angelcode.com/products/bmfont/|http://www.angelcode.com/products/bmfont/} + * Glyph Designer (OS X, commercial): {@link http://www.71squared.com/en/glyphdesigner|http://www.71squared.com/en/glyphdesigner} + * Littera (Web-based, free): {@link http://kvazars.com/littera/|http://kvazars.com/littera/} * * For most use cases it is recommended to use XML. If you wish to use JSON, the formatting should be equal to the result of - * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: http://codebeautify.org/xmltojson + * converting a valid XML file through the popular X2JS library. An online tool for conversion can be found here: {@link http://codebeautify.org/xmltojson|http://codebeautify.org/xmltojson} */ class DynamicBitmapText extends Phaser.GameObjects.BitmapText { /** @@ -8312,7 +9606,7 @@ declare namespace Phaser { * @param size The font size of this Bitmap Text. * @param align The alignment of the text in a multi-line BitmapText object. Default 0. */ - constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer); + constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: number); /** * The horizontal scroll position of the Bitmap Text. @@ -8503,7 +9797,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The Mask this Game Object is using during render. @@ -8537,6 +9831,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -8616,6 +9912,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -8625,22 +9923,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -8723,7 +10107,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -8738,10 +10122,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -8773,7 +10188,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -8796,40 +10211,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -8883,7 +10277,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -8904,6 +10298,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -8978,6 +10378,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -9100,7 +10516,7 @@ declare namespace Phaser { * @param size The font size of this Bitmap Text. * @param align The alignment of the text in a multi-line BitmapText object. Default 0. */ - constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer); + constructor(scene: Phaser.Scene, x: number, y: number, font: string, text?: string | string[], size?: number, align?: number); /** * The key of the Bitmap Font used by this Bitmap Text. @@ -9119,6 +10535,34 @@ declare namespace Phaser { */ wordWrapCharCode: number; + /** + * The horizontal offset of the drop shadow. + * + * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. + */ + dropShadowX: number; + + /** + * The vertical offset of the drop shadow. + * + * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. + */ + dropShadowY: number; + + /** + * The color of the drop shadow. + * + * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. + */ + dropShadowColor: number; + + /** + * The alpha value of the drop shadow. + * + * You can set this directly, or use `Phaser.GameObjects.BitmapText#setDropShadow`. + */ + dropShadowAlpha: number; + /** * Set the lines of text in this BitmapText to be left-aligned. * This only has any effect if this BitmapText contains more than one line of text. @@ -9159,6 +10603,95 @@ declare namespace Phaser { */ setText(value: string | string[]): this; + /** + * Sets a drop shadow effect on this Bitmap Text. + * + * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. + * + * You can set the vertical and horizontal offset of the shadow, as well as the color and alpha. + * + * Once a shadow has been enabled you can modify the `dropShadowX` and `dropShadowY` properties of this + * Bitmap Text directly to adjust the position of the shadow in real-time. + * + * If you wish to clear the shadow, call this method with no parameters specified. + * @param x The horizontal offset of the drop shadow. Default 0. + * @param y The vertical offset of the drop shadow. Default 0. + * @param color The color of the drop shadow, given as a hex value, i.e. `0x000000` for black. Default 0xffffff. + * @param alpha The alpha of the drop shadow, given as a float between 0 and 1. This is combined with the Bitmap Text alpha as well. Default 0.5. + */ + setDropShadow(x?: number, y?: number, color?: number, alpha?: number): this; + + /** + * Sets a tint on a range of characters in this Bitmap Text, starting from the `start` parameter index + * and running for `length` quantity of characters. + * + * The `start` parameter can be negative. In this case, it starts at the end of the text and counts + * backwards `start` places. + * + * You can also pass in -1 as the `length` and it will tint all characters from `start` + * up until the end of the string. + * Remember that spaces and punctuation count as characters. + * + * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. + * + * The tint works by taking the pixel color values from the Bitmap Text texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole character will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the character range. + * + * To swap this from being an additive tint to a fill based tint, set the `tintFill` parameter to `true`. + * + * To modify the tint color once set, call this method again with new color values. + * + * Using `setWordTint` can override tints set by this function, and vice versa. + * + * To remove a tint call this method with just the `start`, and optionally, the `length` parameters defined. + * @param start The starting character to begin the tint at. If negative, it counts back from the end of the text. Default 0. + * @param length The number of characters to tint. Remember that spaces count as a character too. Pass -1 to tint all characters from `start` onwards. Default 1. + * @param tintFill Use a fill-based tint (true), or an additive tint (false) Default false. + * @param topLeft The tint being applied to the top-left of the character. If not other values are given this value is applied evenly, tinting the whole character. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the character. + * @param bottomLeft The tint being applied to the bottom-left of the character. + * @param bottomRight The tint being applied to the bottom-right of the character. + */ + setCharacterTint(start?: number, length?: number, tintFill?: boolean, topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * Sets a tint on a matching word within this Bitmap Text. + * + * The `word` parameter can be either a string or a number. + * + * If a string, it will run a string comparison against the text contents, and if matching, + * it will tint the whole word. + * + * If a number, if till that word, based on its offset within the text contents. + * + * The `count` parameter controls how many words are replaced. Pass in -1 to replace them all. + * + * This parameter is ignored if you pass a number as the `word` to be searched for. + * + * This is a WebGL only feature and only works with Static Bitmap Text, not Dynamic. + * + * The tint works by taking the pixel color values from the Bitmap Text texture, and then + * multiplying it by the color value of the tint. You can provide either one color value, + * in which case the whole character will be tinted in that color. Or you can provide a color + * per corner. The colors are blended together across the extent of the character range. + * + * To swap this from being an additive tint to a fill based tint, set the `tintFill` parameter to `true`. + * + * To modify the tint color once set, call this method again with new color values. + * + * Using `setCharacterTint` can override tints set by this function, and vice versa. + * @param word The word to search for. Either a string, or an index of the word in the words array. + * @param count The number of matching words to tint. Pass -1 to tint all matching words. Default 1. + * @param tintFill Use a fill-based tint (true), or an additive tint (false) Default false. + * @param topLeft The tint being applied to the top-left of the word. If not other values are given this value is applied evenly, tinting the whole word. Default 0xffffff. + * @param topRight The tint being applied to the top-right of the word. + * @param bottomLeft The tint being applied to the bottom-left of the word. + * @param bottomRight The tint being applied to the bottom-right of the word. + */ + setWordTint(word: string | number, count?: number, tintFill?: boolean, topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + /** * Calculate the bounds of this Bitmap Text. * @@ -9170,10 +10703,30 @@ declare namespace Phaser { * Global size takes into account the Game Object's scale, world position and display origin. * * Also in the object is data regarding the length of each line, should this be a multi-line BitmapText. - * @param round Whether to round the results to the nearest integer. + * @param round Whether to round the results up to the nearest integer. Default false. */ getTextBounds(round?: boolean): Phaser.Types.GameObjects.BitmapText.BitmapTextSize; + /** + * Gets the character located at the given x/y coordinate within this Bitmap Text. + * + * The coordinates you pass in are translated into the local space of the + * Bitmap Text, however, it is up to you to first translate the input coordinates to world space. + * + * If you wish to use this in combination with an input event, be sure + * to pass in `Pointer.worldX` and `worldY` so they are in world space. + * + * In some cases, based on kerning, characters can overlap. When this happens, + * the first character in the word is returned. + * + * Note that this does not work for DynamicBitmapText if you have changed the + * character positions during render. It will only scan characters in their un-translated state. + * @param x The x position to check. + * @param y The y position to check. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getCharacterAt(x: number, y: number, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Types.GameObjects.BitmapText.BitmapTextCharacter; + /** * Updates the Display Origin cached values internally stored on this Game Object. * You don't usually call this directly, but it is exposed for edge-cases where you may. @@ -9189,7 +10742,7 @@ declare namespace Phaser { * @param size The font size of this Bitmap Text. If not specified the current size will be used. * @param align The alignment of the text in a multi-line BitmapText object. If not specified the current alignment will be used. Default 0. */ - setFont(font: string, size?: number, align?: integer): this; + setFont(font: string, size?: number, align?: number): this; /** * Sets the maximum display width of this BitmapText in pixels. @@ -9221,7 +10774,7 @@ declare namespace Phaser { * * The alignment position is based on the longest line of text. */ - align: integer; + align: number; /** * The text that this Bitmap Text object displays. @@ -9273,20 +10826,25 @@ declare namespace Phaser { */ toJSON(): Phaser.Types.GameObjects.BitmapText.JSONBitmapText; + /** + * Internal destroy handler, called as part of the destroy process. + */ + protected preDestroy(): void; + /** * Left align the text characters in a multi-line BitmapText object. */ - static ALIGN_LEFT: integer; + static ALIGN_LEFT: number; /** * Center align the text characters in a multi-line BitmapText object. */ - static ALIGN_CENTER: integer; + static ALIGN_CENTER: number; /** * Right align the text characters in a multi-line BitmapText object. */ - static ALIGN_RIGHT: integer; + static ALIGN_RIGHT: number; /** * Parse an XML Bitmap Font from an Atlas. @@ -9300,16 +10858,16 @@ declare namespace Phaser { * @param xSpacing The x-axis spacing to add between each letter. * @param ySpacing The y-axis spacing to add to the line height. */ - static ParseFromAtlas(scene: Phaser.Scene, fontName: string, textureKey: string, frameKey: string, xmlKey: string, xSpacing?: integer, ySpacing?: integer): boolean; + static ParseFromAtlas(scene: Phaser.Scene, fontName: string, textureKey: string, frameKey: string, xmlKey: string, xSpacing?: number, ySpacing?: number): boolean; /** * Parse an XML font to Bitmap Font data for the Bitmap Font cache. * @param xml The XML Document to parse the font from. + * @param frame The texture frame to take into account when creating the uv data. * @param xSpacing The x-axis spacing to add between each letter. Default 0. * @param ySpacing The y-axis spacing to add to the line height. Default 0. - * @param frame The texture frame to take into account while parsing. */ - static ParseXMLBitmapFont(xml: XMLDocument, xSpacing?: integer, ySpacing?: integer, frame?: Phaser.Textures.Frame): Phaser.Types.GameObjects.BitmapText.BitmapFontData; + static ParseXMLBitmapFont(xml: XMLDocument, frame: Phaser.Textures.Frame, xSpacing?: number, ySpacing?: number): Phaser.Types.GameObjects.BitmapText.BitmapFontData; /** * Clears all alpha values associated with this Game Object. @@ -9434,7 +10992,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The Mask this Game Object is using during render. @@ -9468,6 +11026,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -9547,6 +11107,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -9556,22 +11118,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -9654,7 +11302,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -9669,10 +11317,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -9704,7 +11383,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -9727,40 +11406,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -9814,7 +11472,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -9835,6 +11493,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -9909,6 +11573,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -9957,7 +11637,7 @@ declare namespace Phaser { * @param texture The key of the texture this Game Object will use for rendering. The Texture must already exist in the Texture Manager. Default '__DEFAULT'. * @param frame The Frame of the Texture that this Game Object will use. Only set if the Texture has multiple frames, such as a Texture Atlas or Sprite Sheet. Default 0. */ - constructor(scene: Phaser.Scene, x?: number, y?: number, texture?: string, frame?: string | integer); + constructor(scene: Phaser.Scene, x?: number, y?: number, texture?: string, frame?: string | number); /** * The children of this Blitter. @@ -9982,7 +11662,7 @@ declare namespace Phaser { * @param visible Should the created Bob render or not? Default true. * @param index The position in the Blitters Display List to add the new Bob at. Defaults to the top of the list. */ - create(x: number, y: number, frame?: string | integer | Phaser.Textures.Frame, visible?: boolean, index?: integer): Phaser.GameObjects.Bob; + create(x: number, y: number, frame?: string | number | Phaser.Textures.Frame, visible?: boolean, index?: number): Phaser.GameObjects.Bob; /** * Creates multiple Bob objects within this Blitter and then passes each of them to the specified callback. @@ -9991,7 +11671,7 @@ declare namespace Phaser { * @param frame The Frame the Bobs will use. It must be part of the Blitter Texture. * @param visible Should the created Bob render or not? Default true. */ - createFromCallback(callback: CreateCallback, quantity: integer, frame?: string | integer | Phaser.Textures.Frame | string[] | integer[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; + createFromCallback(callback: CreateCallback, quantity: number, frame?: string | number | Phaser.Textures.Frame | string[] | number[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; /** * Creates multiple Bobs in one call. @@ -10004,7 +11684,7 @@ declare namespace Phaser { * @param frame The Frame the Bobs will use. It must be part of the Blitter Texture. * @param visible Should the created Bob render or not? Default true. */ - createMultiple(quantity: integer, frame?: string | integer | Phaser.Textures.Frame | string[] | integer[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; + createMultiple(quantity: number, frame?: string | number | Phaser.Textures.Frame | string[] | number[] | Phaser.Textures.Frame[], visible?: boolean): Phaser.GameObjects.Bob[]; /** * Checks if the given child can render or not, by checking its `visible` and `alpha` values. @@ -10151,7 +11831,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The Mask this Game Object is using during render. @@ -10185,6 +11865,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -10212,6 +11894,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -10221,22 +11905,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -10393,7 +12163,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -10408,7 +12178,7 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** * The x position of this Game Object. @@ -10460,7 +12230,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -10481,6 +12251,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -10555,6 +12331,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -10603,7 +12395,7 @@ declare namespace Phaser { * @param frame The Frame this Bob will render with, as defined in the Texture the parent Blitter is using. * @param visible Should the Bob render visible or not to start with? */ - constructor(blitter: Phaser.GameObjects.Blitter, x: number, y: number, frame: string | integer, visible: boolean); + constructor(blitter: Phaser.GameObjects.Blitter, x: number, y: number, frame: string | number, visible: boolean); /** * The Blitter object that this Bob belongs to. @@ -10656,7 +12448,7 @@ declare namespace Phaser { * If no value is given it will use the default frame of the Blitter parent. * @param frame The frame to be used during rendering. */ - setFrame(frame?: string | integer | Phaser.Textures.Frame): this; + setFrame(frame?: string | number | Phaser.Textures.Frame): this; /** * Resets the horizontal and vertical flipped state of this Bob back to their default un-flipped state. @@ -10673,7 +12465,7 @@ declare namespace Phaser { * @param y The y position of the Bob. Bob coordinate are relative to the position of the Blitter object. * @param frame The Frame the Bob will use. It _must_ be part of the Texture the parent Blitter object is using. */ - reset(x: number, y: number, frame?: string | integer | Phaser.Textures.Frame): this; + reset(x: number, y: number, frame?: string | number | Phaser.Textures.Frame): this; /** * Changes the position of this Bob to the values given. @@ -10838,290 +12630,6 @@ declare namespace Phaser { alpha: number; } - interface Animation { - /** - * The Game Object to which this animation controller belongs. - */ - parent: Phaser.GameObjects.GameObject; - /** - * A reference to the global Animation Manager. - */ - animationManager: Phaser.Animations.AnimationManager; - /** - * Is an animation currently playing or not? - */ - isPlaying: boolean; - /** - * The current Animation loaded into this Animation Controller. - */ - currentAnim: Phaser.Animations.Animation; - /** - * The current AnimationFrame being displayed by this Animation Controller. - */ - currentFrame: Phaser.Animations.AnimationFrame; - /** - * The key of the next Animation to be loaded into this Animation Controller when the current animation completes. - */ - nextAnim: string; - /** - * A queue of keys of the next Animations to be loaded into this Animation Controller when the current animation completes. - */ - nextAnimsQueue: string[]; - /** - * The frame rate of playback in frames per second. - * The default is 24 if the `duration` property is `null`. - */ - frameRate: number; - /** - * How long the animation should play for, in milliseconds. - * If the `frameRate` property has been set then it overrides this value, - * otherwise the `frameRate` is derived from `duration`. - */ - duration: number; - /** - * ms per frame, not including frame specific modifiers that may be present in the Animation data. - */ - msPerFrame: number; - /** - * Skip frames if the time lags, or always advanced anyway? - */ - skipMissedFrames: boolean; - /** - * Will the playhead move forwards (`true`) or in reverse (`false`). - */ - forward: boolean; - /** - * Internal time overflow accumulator. - */ - accumulator: number; - /** - * The time point at which the next animation frame will change. - */ - nextTick: number; - /** - * An internal counter keeping track of how many repeats are left to play. - */ - repeatCounter: number; - /** - * An internal flag keeping track of pending repeats. - */ - pendingRepeat: boolean; - /** - * Sets an animation to be played immediately after the current one completes. - * - * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, or have the `stop` method called directly on it. - * - * An animation set to repeat forever will never enter a completed state. - * - * You can chain a new animation at any point, including before the current one starts playing, during it, or when it ends (via its `animationcomplete` callback). - * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained animations without impacting the global animation they're playing. - * - * Call this method with no arguments to reset the chained animation. - * @param key The string-based key of the animation to play next, as defined previously in the Animation Manager. Or an Animation instance. - */ - chain(key?: string | Phaser.Animations.Animation): Phaser.GameObjects.GameObject; - /** - * Sets the amount of time, in milliseconds, that the animation will be delayed before starting playback. - * @param value The amount of time, in milliseconds, to wait before starting playback. Default 0. - */ - setDelay(value?: integer): Phaser.GameObjects.GameObject; - /** - * Gets the amount of time, in milliseconds that the animation will be delayed before starting playback. - */ - getDelay(): integer; - /** - * Waits for the specified delay, in milliseconds, then starts playback of the requested animation. - * @param delay The delay, in milliseconds, to wait before starting the animation playing. - * @param key The key of the animation to play. - * @param startFrame The frame of the animation to start from. Default 0. - */ - delayedPlay(delay: integer, key: string, startFrame?: integer): Phaser.GameObjects.GameObject; - /** - * Returns the key of the animation currently loaded into this component. - */ - getCurrentKey(): string; - /** - * Internal method used to load an animation into this component. - * @param key The key of the animation to load. - * @param startFrame The start frame of the animation to load. Default 0. - */ - load(key: string, startFrame?: integer): Phaser.GameObjects.GameObject; - /** - * Pause the current animation and set the `isPlaying` property to `false`. - * You can optionally pause it at a specific frame. - * @param atFrame An optional frame to set after pausing the animation. - */ - pause(atFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; - /** - * Resumes playback of a paused animation and sets the `isPlaying` property to `true`. - * You can optionally tell it to start playback from a specific frame. - * @param fromFrame An optional frame to set before restarting playback. - */ - resume(fromFrame?: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; - /** - * `true` if the current animation is paused, otherwise `false`. - */ - readonly isPaused: boolean; - /** - * Plays an Animation on a Game Object that has the Animation component, such as a Sprite. - * - * Animations are stored in the global Animation Manager and are referenced by a unique string-based key. - * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param ignoreIfPlaying If this animation is already playing then ignore this call. Default false. - * @param startFrame Optionally start the animation playing from this frame index. Default 0. - */ - play(key: string | Phaser.Animations.Animation, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.GameObject; - /** - * Plays an Animation (in reverse mode) on the Game Object that owns this Animation Component. - * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. Or an Animation instance. - * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. - * @param startFrame Optionally start the animation playing from this frame index. Default 0. - */ - playReverse(key: string | Phaser.Animations.Animation, ignoreIfPlaying?: boolean, startFrame?: integer): Phaser.GameObjects.GameObject; - /** - * Load an Animation and fires 'onStartEvent' event, extracted from 'play' method. - * @param key The string-based key of the animation to play, as defined previously in the Animation Manager. - * @param startFrame Optionally start the animation playing from this frame index. Default 0. - */ - _startAnimation(key: string, startFrame?: integer): Phaser.GameObjects.GameObject; - /** - * Reverse the Animation that is already playing on the Game Object. - */ - reverse(): Phaser.GameObjects.GameObject; - /** - * Returns a value between 0 and 1 indicating how far this animation is through, ignoring repeats and yoyos. - * If the animation has a non-zero repeat defined, `getProgress` and `getTotalProgress` will be different - * because `getProgress` doesn't include any repeats or repeat delays, whereas `getTotalProgress` does. - */ - getProgress(): number; - /** - * Takes a value between 0 and 1 and uses it to set how far this animation is through playback. - * Does not factor in repeats or yoyos, but does handle playing forwards or backwards. - * @param value The progress value, between 0 and 1. Default 0. - */ - setProgress(value?: number): Phaser.GameObjects.GameObject; - /** - * Handle the removal of an animation from the Animation Manager. - * @param key The key of the removed Animation. - * @param animation The removed Animation. - */ - remove(key?: string, animation?: Phaser.Animations.Animation): void; - /** - * Gets the number of times that the animation will repeat - * after its first iteration. For example, if returns 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * A value of -1 means the animation will repeat indefinitely. - */ - getRepeat(): integer; - /** - * Sets the number of times that the animation should repeat - * after its first iteration. For example, if repeat is 1, the animation will - * play a total of twice (the initial play plus 1 repeat). - * To repeat indefinitely, use -1. repeat should always be an integer. - * @param value The number of times that the animation should repeat. - */ - setRepeat(value: integer): Phaser.GameObjects.GameObject; - /** - * Gets the amount of delay between repeats, if any. - */ - getRepeatDelay(): number; - /** - * Sets the amount of time in seconds between repeats. - * For example, if `repeat` is 2 and `repeatDelay` is 10, the animation will play initially, - * then wait for 10 seconds before repeating, then play again, then wait another 10 seconds - * before doing its final repeat. - * @param value The delay to wait between repeats, in seconds. - */ - setRepeatDelay(value: number): Phaser.GameObjects.GameObject; - /** - * Restarts the current animation from its beginning, optionally including its delay value. - * @param includeDelay Whether to include the delay value of the animation when restarting. Default false. - */ - restart(includeDelay?: boolean): Phaser.GameObjects.GameObject; - /** - * Immediately stops the current animation from playing and dispatches the `animationcomplete` event. - * - * If no animation is set, no event will be dispatched. - * - * If there is another animation queued (via the `chain` method) then it will start playing immediately. - */ - stop(): Phaser.GameObjects.GameObject; - /** - * Stops the current animation from playing after the specified time delay, given in milliseconds. - * @param delay The number of milliseconds to wait before stopping this animation. - */ - stopAfterDelay(delay: integer): Phaser.GameObjects.GameObject; - /** - * Stops the current animation from playing when it next repeats. - */ - stopOnRepeat(): Phaser.GameObjects.GameObject; - /** - * Stops the current animation from playing when it next sets the given frame. - * If this frame doesn't exist within the animation it will not stop it from playing. - * @param frame The frame to check before stopping this animation. - */ - stopOnFrame(frame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; - /** - * Sets the Time Scale factor, allowing you to make the animation go go faster or slower than default. - * Where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. - * @param value The time scale factor, where 1 is no change, 0.5 is half speed, etc. Default 1. - */ - setTimeScale(value?: number): Phaser.GameObjects.GameObject; - /** - * Gets the Time Scale factor. - */ - getTimeScale(): number; - /** - * Returns the total number of frames in this animation. - */ - getTotalFrames(): integer; - /** - * The internal update loop for the Animation Component. - * @param time The current timestamp. - * @param delta The delta time, in ms, elapsed since the last frame. - */ - update(time: number, delta: number): void; - /** - * Sets the given Animation Frame as being the current frame - * and applies it to the parent Game Object, adjusting its size and origin as needed. - * @param animationFrame The Animation Frame to set as being current. - */ - setCurrentFrame(animationFrame: Phaser.Animations.AnimationFrame): Phaser.GameObjects.GameObject; - /** - * Advances the animation to the next frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in reverse, calling this method doesn't then change the direction to forwards. - */ - nextFrame(): Phaser.GameObjects.GameObject; - /** - * Advances the animation to the previous frame, regardless of the time or animation state. - * If the animation is set to repeat, or yoyo, this will still take effect. - * - * Calling this does not change the direction of the animation. I.e. if it was currently - * playing in forwards, calling this method doesn't then change the direction to backwards. - */ - previousFrame(): Phaser.GameObjects.GameObject; - /** - * Sets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - * @param value `true` if the animation should yoyo, `false` to not. Default false. - */ - setYoyo(value?: boolean): Phaser.GameObjects.GameObject; - /** - * Gets if the current Animation will yoyo when it reaches the end. - * A yoyo'ing animation will play through consecutively, and then reverse-play back to the start again. - */ - getYoyo(): boolean; - /** - * Destroy this Animation component. - * - * Unregisters event listeners and cleans up its references. - */ - destroy(): void; - } - /** * Provides methods used for setting the blend mode of a Game Object. * Should be applied as a mixin and not used directly. @@ -11312,7 +12820,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; } /** @@ -11486,6 +12994,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -11640,6 +13150,8 @@ declare namespace Phaser { interface Pipeline { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** @@ -11647,20 +13159,98 @@ declare namespace Phaser { */ pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. */ @@ -11821,7 +13411,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. * @@ -11835,7 +13425,7 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; } /** @@ -11891,7 +13481,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. * @@ -11905,7 +13495,7 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; } /** @@ -11914,7 +13504,34 @@ declare namespace Phaser { */ interface Tint { /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; /** @@ -11944,7 +13561,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. * @@ -11966,34 +13583,17 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; } @@ -12053,7 +13653,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. * @@ -12071,6 +13671,11 @@ declare namespace Phaser { * @param w The w position of this Game Object. Default 0. */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -12135,6 +13740,21 @@ declare namespace Phaser { * @param parentMatrix A temporary matrix to hold parent values during the calculations. */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -12400,6 +14020,26 @@ declare namespace Phaser { */ getY(x: number, y: number): number; + /** + * Returns the X component of this matrix multiplied by the given values. + * + * This is the same as `x * a + y * c + e`, optionally passing via `Math.round`. + * @param x The x value. + * @param y The y value. + * @param round Math.round the resulting value? Default false. + */ + getXRound(x: number, y: number, round?: boolean): number; + + /** + * Returns the Y component of this matrix multiplied by the given values. + * + * This is the same as `x * b + y * d + f`, optionally passing via `Math.round`. + * @param x The x value. + * @param y The y value. + * @param round Math.round the resulting value? Default false. + */ + getYRound(x: number, y: number, round?: boolean): number; + /** * Returns a string that can be used in a CSS Transform call as a `matrix` property. */ @@ -12461,6 +14101,9 @@ declare namespace Phaser { * Containers can be enabled for input. Because they do not have a texture you need to provide a shape for them * to use as their hit area. Container children can also be enabled for input, independent of the Container. * + * If input enabling a _child_ you should not set both the `origin` and a **negative** scale factor on the child, + * or the input area will become misaligned. + * * Containers can be given a physics body for either Arcade Physics, Impact Physics or Matter Physics. However, * if Container _children_ are enabled for physics you may get unexpected results, such as offset bodies, * if the Container itself, or any of its ancestors, is positioned anywhere other than at 0 x 0. Container children @@ -12473,7 +14116,7 @@ declare namespace Phaser { * flexible manner as those not within them. In short, don't use them for the sake of it. You pay a small cost * every time you create one, try to structure your game around avoiding that where possible. */ - class Container extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + class Container extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. @@ -12508,12 +14151,12 @@ declare namespace Phaser { * will constrict the addition of new Game Objects into the Container, capping off * the maximum limit the Container can grow in size to. */ - maxSize: integer; + maxSize: number; /** * The cursor position. */ - position: integer; + position: number; /** * Internal Transform Matrix used for local space conversion. @@ -12652,19 +14295,19 @@ declare namespace Phaser { * @param child The Game Object, or array of Game Objects, to add to the Container. * @param index The position to insert the Game Object/s at. Default 0. */ - addAt(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], index?: integer): this; + addAt(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], index?: number): this; /** * Returns the Game Object at the given position in this Container. * @param index The position to get the Game Object from. */ - getAt(index: integer): Phaser.GameObjects.GameObject; + getAt(index: number): Phaser.GameObjects.GameObject; /** * Returns the index of the given Game Object in this Container. * @param child The Game Object to search for in this Container. */ - getIndex(child: Phaser.GameObjects.GameObject): integer; + getIndex(child: Phaser.GameObjects.GameObject): number; /** * Sort the contents of this Container so the items are in order based on the given property. @@ -12686,7 +14329,7 @@ declare namespace Phaser { * @param startIndex An optional start index. Default 0. * @param length An optional length, the total number of elements (from the startIndex) to choose from. */ - getRandom(startIndex?: integer, length?: integer): Phaser.GameObjects.GameObject; + getRandom(startIndex?: number, length?: number): Phaser.GameObjects.GameObject; /** * Gets the first Game Object in this Container. @@ -12702,7 +14345,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. Default 0. * @param endIndex An optional end index to search up to (but not included) Default Container.length. */ - getFirst(property: string, value: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.GameObject; + getFirst(property: string, value: any, startIndex?: number, endIndex?: number): Phaser.GameObjects.GameObject; /** * Returns all Game Objects in this Container. @@ -12723,7 +14366,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. Default 0. * @param endIndex An optional end index to search up to (but not included) Default Container.length. */ - getAll(property?: string, value?: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.GameObject[]; + getAll(property?: string, value?: any, startIndex?: number, endIndex?: number): Phaser.GameObjects.GameObject[]; /** * Returns the total number of Game Objects in this Container that have a property @@ -12737,7 +14380,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. Default 0. * @param endIndex An optional end index to search up to (but not included) Default Container.length. */ - count(property: string, value: any, startIndex?: integer, endIndex?: integer): integer; + count(property: string, value: any, startIndex?: number, endIndex?: number): number; /** * Swaps the position of two Game Objects in this Container. @@ -12757,7 +14400,7 @@ declare namespace Phaser { * @param child The Game Object to move. * @param index The new position of the Game Object in this Container. */ - moveTo(child: Phaser.GameObjects.GameObject, index: integer): this; + moveTo(child: Phaser.GameObjects.GameObject, index: number): this; /** * Removes the given Game Object, or array of Game Objects, from this Container. @@ -12777,7 +14420,7 @@ declare namespace Phaser { * @param index The index of the Game Object to be removed. * @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false. */ - removeAt(index: integer, destroyChild?: boolean): this; + removeAt(index: number, destroyChild?: boolean): this; /** * Removes the Game Objects between the given positions in this Container. @@ -12787,7 +14430,7 @@ declare namespace Phaser { * @param endIndex An optional end index to search up to (but not included) Default Container.length. * @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false. */ - removeBetween(startIndex?: integer, endIndex?: integer, destroyChild?: boolean): this; + removeBetween(startIndex?: number, endIndex?: number, destroyChild?: boolean): this; /** * Removes all Game Objects from this Container. @@ -12861,7 +14504,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. Default 0. * @param endIndex An optional end index to search up to (but not included) Default Container.length. */ - setAll(property: string, value: any, startIndex?: integer, endIndex?: integer): this; + setAll(property: string, value: any, startIndex?: number, endIndex?: number): this; /** * Passes all Game Objects in this Container to the given callback. @@ -12913,7 +14556,7 @@ declare namespace Phaser { /** * The number of Game Objects inside this Container. */ - readonly length: integer; + readonly length: number; /** * Returns the first Game Object within the Container, or `null` if it is empty. @@ -13101,7 +14744,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The Mask this Game Object is using during render. @@ -13135,6 +14778,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -13160,6 +14805,127 @@ declare namespace Phaser { */ createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Does this Game Object have any Post Pipelines set? + */ + hasPostPipeline: boolean; + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + */ + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + /** * The x position of this Game Object. */ @@ -13210,7 +14976,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -13231,6 +14997,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -13305,6 +15077,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -13358,6 +15146,11 @@ declare namespace Phaser { */ systems: Phaser.Scenes.Systems; + /** + * The Scene's Event Emitter. + */ + events: Phaser.Events.EventEmitter; + /** * Force a sort of the display list on the next call to depthSort. */ @@ -13373,7 +15166,7 @@ declare namespace Phaser { * @param childA The first Game Object. * @param childB The second Game Object. */ - sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): integer; + sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): number; /** * Returns an array which contains all objects currently on the Display List. @@ -13399,6 +15192,9 @@ declare namespace Phaser { * of the game canvas. This div is sized to match the canvas, and if the canvas size changes, as a result of * settings within the Scale Manager, the dom container is resized accordingly. * + * If you have not already done so, you have to provide a `parent` in the Game Configuration, or the DOM + * Container will fail to be created. + * * You can create a DOM Element by either passing in DOMStrings, or by passing in a reference to an existing * Element that you wish to be placed under the control of Phaser. For example: * @@ -13908,7 +15704,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontal origin of this Game Object. @@ -14077,7 +15873,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -14098,6 +15894,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -14172,6 +15974,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -14197,6 +16015,15 @@ declare namespace Phaser { } namespace Events { + /** + * The Game Object Added to Scene Event. + * + * This event is dispatched when a Game Object is added to a Scene. + * + * Listen for it on a Game Object instance using `GameObject.on('addedtoscene', listener)`. + */ + const ADDED_TO_SCENE: any; + /** * The Game Object Destroy Event. * @@ -14206,6 +16033,15 @@ declare namespace Phaser { */ const DESTROY: any; + /** + * The Game Object Removed from Scene Event. + * + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it on a Game Object instance using `GameObject.on('removedfromscene', listener)`. + */ + const REMOVED_FROM_SCENE: any; + /** * The Video Game Object Complete Event. * @@ -14332,7 +16168,7 @@ declare namespace Phaser { * * The WebGL context is then left is a 'clean' state, ready for you to bind your own shaders, * or draw to it, whatever you wish to do. Once you've finished, you should free-up any - * of your resources. The Extern will then rebind the Phaser pipeline and carry on + * of your resources. The Extern will then rebind the Phaser pipeline and carry on * rendering the display list. * * Although this object has lots of properties such as Alpha, Blend Mode and Tint, none of @@ -14468,7 +16304,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -14742,7 +16578,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -14757,10 +16593,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -14792,7 +16659,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -14815,40 +16682,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -14902,7 +16748,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -14923,6 +16769,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -14997,6 +16849,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -15035,10 +16903,23 @@ declare namespace Phaser { constructor(scene: Phaser.Scene, type: string); /** - * The Scene to which this Game Object belongs. + * A reference to the Scene to which this Game Object belongs. + * * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. */ - protected scene: Phaser.Scene; + scene: Phaser.Scene; + + /** + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + */ + displayList: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer; /** * A textual representation of this Game Object, i.e. `sprite`. @@ -15056,7 +16937,7 @@ declare namespace Phaser { * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. * If you need to store complex data about your Game Object, look at using the Data Component instead. */ - state: integer | string; + state: number | string; /** * The parent Container of this Game Object, if it has one. @@ -15080,7 +16961,7 @@ declare namespace Phaser { * The Tab Index of the Game Object. * Reserved for future use by plugins and the Input Manager. */ - tabIndex: integer; + tabIndex: number; /** * A Data Manager. @@ -15094,7 +16975,7 @@ declare namespace Phaser { * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. * If those components are not used by your custom class then you can use this bitmask as you wish. */ - renderFlags: integer; + renderFlags: number; /** * A bitmask that controls if this Game Object is drawn by a Camera or not. @@ -15147,7 +17028,7 @@ declare namespace Phaser { * If you need to store complex data about your Game Object, look at using the Data Component instead. * @param value The state of the Game Object. */ - setState(value: integer | string): this; + setState(value: number | string): this; /** * Adds a Data Manager component to this Game Object. @@ -15262,11 +17143,11 @@ declare namespace Phaser { * shape for it to use. * * You can also provide an Input Configuration Object as the only argument to this method. - * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. - * @param callback A callback to be invoked when the Game Object is interacted with. If you provide a shape you must also provide a callback. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not given it will try to create a Rectangle based on the texture frame. + * @param callback The callback that determines if the pointer is within the Hit Area shape or not. If you provide a shape you must also provide a callback. * @param dropZone Should this Game Object be treated as a drop zone target? Default false. */ - setInteractive(shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; + setInteractive(hitArea?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; /** * If this Game Object has previously been enabled for input, this will disable it. @@ -15301,6 +17182,26 @@ declare namespace Phaser { */ removeInteractive(): this; + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + */ + addedToScene(): void; + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + */ + removedFromScene(): void; + /** * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. * @param args args @@ -15327,7 +17228,7 @@ declare namespace Phaser { * Used internally by the InputPlugin but also useful if you wish to find out the display depth of * this Game Object and all of its ancestors. */ - getIndexList(): integer[]; + getIndexList(): number[]; /** * Destroys this Game Object removing it from the Display List and Update List and @@ -15341,14 +17242,13 @@ declare namespace Phaser { * * If you just want to temporarily disable an object then look at using the * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. - * @param fromScene Is this Game Object being destroyed as the result of a Scene shutdown? Default false. */ - destroy(fromScene?: boolean): void; + destroy(): void; /** * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. */ - static readonly RENDER_MASK: integer; + static readonly RENDER_MASK: number; } @@ -15413,6 +17313,11 @@ declare namespace Phaser { */ protected systems: Phaser.Scenes.Systems; + /** + * A reference to the Scene Event Emitter. + */ + protected events: Phaser.Events.EventEmitter; + /** * A reference to the Scene Display List. */ @@ -15449,6 +17354,15 @@ declare namespace Phaser { */ image(config: object, addToScene?: boolean): Phaser.GameObjects.Image; + /** + * Creates a new Layer Game Object and returns it. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * @param config The configuration object this Game Object will use to create itself. + * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. + */ + layer(config: object, addToScene?: boolean): Phaser.GameObjects.Layer; + /** * Creates a new Mesh Game Object and returns it. * @@ -15468,13 +17382,13 @@ declare namespace Phaser { particles(config: object, addToScene?: boolean): Phaser.GameObjects.Particles.ParticleEmitterManager; /** - * Creates a new Quad Game Object and returns it. + * Creates a new Point Light Game Object and returns it. * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. + * Note: This method will only be available if the Point Light Game Object has been built into Phaser. * @param config The configuration object this Game Object will use to create itself. * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. */ - quad(config: object, addToScene?: boolean): Phaser.GameObjects.Quad; + pointlight(config: object, addToScene?: boolean): Phaser.GameObjects.PointLight; /** * Creates a new Render Texture Game Object and returns it. @@ -15519,7 +17433,7 @@ declare namespace Phaser { * @param config The configuration object this Game Object will use to create itself. * @param addToScene Add this Game Object to the Scene after creating it? If set this argument overrides the `add` property in the config object. */ - text(config: object, addToScene?: boolean): Phaser.GameObjects.Text; + text(config: Phaser.Types.GameObjects.Text.TextConfig, addToScene?: boolean): Phaser.GameObjects.Text; /** * Creates a new TileSprite Game Object and returns it. @@ -15656,7 +17570,7 @@ declare namespace Phaser { * @param size The font size to set. * @param align The alignment of the text in a multi-line BitmapText object. Default 0. */ - bitmapText(x: number, y: number, font: string, text?: string | string[], size?: number, align?: integer): Phaser.GameObjects.BitmapText; + bitmapText(x: number, y: number, font: string, text?: string | string[], size?: number, align?: number): Phaser.GameObjects.BitmapText; /** * Creates a new Blitter Game Object and adds it to the Scene. @@ -15667,7 +17581,7 @@ declare namespace Phaser { * @param key The key of the Texture the Blitter object will use. * @param frame The default Frame children of the Blitter will use. */ - blitter(x: number, y: number, key: string, frame?: string | integer): Phaser.GameObjects.Blitter; + blitter(x: number, y: number, key: string, frame?: string | number): Phaser.GameObjects.Blitter; /** * Creates a new Container Game Object and adds it to the Scene. @@ -15758,6 +17672,11 @@ declare namespace Phaser { */ protected systems: Phaser.Scenes.Systems; + /** + * A reference to the Scene Event Emitter. + */ + protected events: Phaser.Events.EventEmitter; + /** * A reference to the Scene Display List. */ @@ -15775,7 +17694,7 @@ declare namespace Phaser { * If it has a `preUpdate` method, it will be added to the Update List. * @param child The child to be added to this Scene. */ - existing(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.Group): Phaser.GameObjects.GameObject; + existing(child: G): G; /** * Static method called directly by the Game Object factory functions. @@ -15821,7 +17740,15 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - image(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.GameObjects.Image; + image(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Image; + + /** + * Creates a new Layer Game Object and adds it to the Scene. + * + * Note: This method will only be available if the Layer Game Object has been built into Phaser. + * @param children An optional array of Game Objects to add to this Layer. + */ + layer(children?: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Layer; /** * Creates a new Mesh Game Object and adds it to the Scene. @@ -15829,14 +17756,17 @@ declare namespace Phaser { * Note: This method will only be available if the Mesh Game Object and WebGL support have been built into Phaser. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. - * @param vertices An array containing the vertices data for this Mesh. - * @param uv An array containing the uv data for this Mesh. - * @param colors An array containing the color data for this Mesh. - * @param alphas An array containing the alpha data for this Mesh. * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param vertices The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param uvs The UVs pairs array. + * @param indicies Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param containsZ Does the vertices data include a `z` component? Default false. + * @param normals Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param colors An array of colors, one per vertex, or a single color value applied to all vertices. Default 0xffffff. + * @param alphas An array of alpha values, one per vertex, or a single alpha value applied to all vertices. Default 1. */ - mesh(x: number, y: number, vertices: number[], uv: number[], colors: number[], alphas: number[], texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.GameObjects.Mesh; + mesh(x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number, vertices?: number[], uvs?: number[], indicies?: number[], containsZ?: boolean, normals?: number[], colors?: number | number[], alphas?: number | number[]): Phaser.GameObjects.Mesh; /** * Creates a new Particle Emitter Manager Game Object and adds it to the Scene. @@ -15846,7 +17776,7 @@ declare namespace Phaser { * @param frame An optional frame from the Texture this Game Object is rendering with. * @param emitters Configuration settings for one or more emitters to create. */ - particles(texture: string | Phaser.Textures.Texture, frame?: string | integer | object, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]): Phaser.GameObjects.Particles.ParticleEmitterManager; + particles(texture: string | Phaser.Textures.Texture, frame?: string | number | object, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]): Phaser.GameObjects.Particles.ParticleEmitterManager; /** * Creates a new PathFollower Game Object and adds it to the Scene. @@ -15858,18 +17788,14 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - follower(path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.GameObjects.PathFollower; + follower(path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.PathFollower; /** - * Creates a new Quad Game Object and adds it to the Scene. + * Creates a new Point Light Game Object and adds it to the Scene. * - * Note: This method will only be available if the Quad Game Object and WebGL support have been built into Phaser. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. + * Note: This method will only be available if the Point Light Game Object has been built into Phaser. */ - quad(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.GameObjects.Quad; + pointlight(): Phaser.GameObjects.PointLight; /** * Creates a new Render Texture Game Object and adds it to the Scene. @@ -15884,7 +17810,7 @@ declare namespace Phaser { * @param width The width of the Render Texture. Default 32. * @param height The height of the Render Texture. Default 32. */ - renderTexture(x: number, y: number, width?: integer, height?: integer): Phaser.GameObjects.RenderTexture; + renderTexture(x: number, y: number, width?: number, height?: number): Phaser.GameObjects.RenderTexture; /** * Creates a new Rope Game Object and adds it to the Scene. @@ -15899,7 +17825,7 @@ declare namespace Phaser { * @param colors An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. * @param alphas An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. */ - rope(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer, points?: Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]): Phaser.GameObjects.Rope; + rope(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number, points?: Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]): Phaser.GameObjects.Rope; /** * Creates a new Shader Game Object and adds it to the Scene. @@ -15940,7 +17866,7 @@ declare namespace Phaser { * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. */ - arc(x?: number, y?: number, radius?: number, startAngle?: integer, endAngle?: integer, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; + arc(x?: number, y?: number, radius?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number): Phaser.GameObjects.Arc; /** * Creates a new Circle Shape Game Object and adds it to the Scene. @@ -16248,7 +18174,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - sprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.GameObjects.Sprite; + sprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.Sprite; /** * Creates a new Text Game Object and adds it to the Scene. @@ -16282,7 +18208,7 @@ declare namespace Phaser { * @param text The text this Text object will display. * @param style The Text style configuration object. */ - text(x: number, y: number, text: string | string[], style?: object): Phaser.GameObjects.Text; + text(x: number, y: number, text: string | string[], style?: Phaser.Types.GameObjects.Text.TextStyle): Phaser.GameObjects.Text; /** * Creates a new TileSprite Game Object and adds it to the Scene. @@ -16295,7 +18221,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - tileSprite(x: number, y: number, width: integer, height: integer, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.GameObjects.TileSprite; + tileSprite(x: number, y: number, width: number, height: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.GameObjects.TileSprite; /** * Creates a new Video Game Object and adds it to the Scene. @@ -16341,7 +18267,7 @@ declare namespace Phaser { * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. Default false. */ - tilemap(key?: string, tileWidth?: integer, tileHeight?: integer, width?: integer, height?: integer, data?: integer[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; + tilemap(key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number, data?: number[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; /** * Creates a new Tween object. @@ -16353,6 +18279,20 @@ declare namespace Phaser { } + /** + * Calculates the Transform Matrix of the given Game Object and Camera, factoring in + * the parent matrix if provided. + * + * Note that the object this results contains _references_ to the Transform Matrices, + * not new instances of them. Therefore, you should use their values immediately, or + * copy them to your own matrix, as they will be replaced as soon as another Game + * Object is rendered. + * @param src The Game Object to calculate the transform matrix for. + * @param camera The camera being used to render the Game Object. + * @param parentMatrix The transform matrix of the parent container, if any. + */ + function GetCalcMatrix(src: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.Types.GameObjects.GetCalcMatrixResults; + /** * A Graphics object is a way to draw primitive shapes to your game. Primitives include forms of geometry, such as * Rectangles, Circles, and Polygons. They also include lines, arcs and curves. When you initially create a Graphics @@ -16476,13 +18416,16 @@ declare namespace Phaser { * Note that for objects such as arcs or ellipses, or anything which is made out of triangles, each triangle used * will be filled with a gradient on its own. There is no ability to gradient fill a shape or path as a single * entity at this time. - * @param topLeft The tint being applied to the top-left of the Game Object. - * @param topRight The tint being applied to the top-right of the Game Object. - * @param bottomLeft The tint being applied to the bottom-left of the Game Object. - * @param bottomRight The tint being applied to the bottom-right of the Game Object. - * @param alpha The fill alpha. Default 1. + * @param topLeft The top left fill color. + * @param topRight The top right fill color. + * @param bottomLeft The bottom left fill color. + * @param bottomRight The bottom right fill color. Not used when filling triangles. + * @param alphaTopLeft The top left alpha value. If you give only this value, it's used for all corners. Default 1. + * @param alphaTopRight The top right alpha value. Default 1. + * @param alphaBottomLeft The bottom left alpha value. Default 1. + * @param alphaBottomRight The bottom right alpha value. Default 1. */ - fillGradientStyle(topLeft: integer, topRight: integer, bottomLeft: integer, bottomRight: integer, alpha?: number): this; + fillGradientStyle(topLeft: number, topRight: number, bottomLeft: number, bottomRight: number, alphaTopLeft?: number, alphaTopRight?: number, alphaBottomLeft?: number, alphaBottomRight?: number): this; /** * Sets a gradient line style. This is a WebGL only feature. @@ -16503,26 +18446,7 @@ declare namespace Phaser { * @param bottomRight The tint being applied to the bottom-right of the Game Object. * @param alpha The fill alpha. Default 1. */ - lineGradientStyle(lineWidth: number, topLeft: integer, topRight: integer, bottomLeft: integer, bottomRight: integer, alpha?: number): this; - - /** - * Sets the texture frame this Graphics Object will use when drawing all shapes defined after calling this. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * - * Once set, all shapes will use this texture. Call this method with no arguments to clear it. - * - * The textures are not tiled. They are stretched to the dimensions of the shapes being rendered. For this reason, - * it works best with seamless / tileable textures. - * - * The mode argument controls how the textures are combined with the fill colors. The default value (0) will - * multiply the texture by the fill color. A value of 1 will use just the fill color, but the alpha data from the texture, - * and a value of 2 will use just the texture and no fill color at all. - * @param key The key of the texture to be used, as stored in the Texture Manager. Leave blank to clear a previously set texture. - * @param frame The name or index of the frame within the Texture. - * @param mode The texture tint mode. 0 is multiply, 1 is alpha only and 2 is texture only. Default 0. - */ - setTexture(key?: string, frame?: string | integer, mode?: number): this; + lineGradientStyle(lineWidth: number, topLeft: number, topRight: number, bottomLeft: number, bottomRight: number, alpha?: number): this; /** * Start a new shape path. @@ -16733,7 +18657,7 @@ declare namespace Phaser { * @param closePath When `true`, the path is closed before being stroked. Default false. * @param endIndex The index of `points` to stop drawing at. Defaults to `points.length`. */ - strokePoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: integer): this; + strokePoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: number): this; /** * Fill the shape represented by the given array of points. @@ -16746,14 +18670,14 @@ declare namespace Phaser { * @param closePath When `true`, the path is closed before being stroked. Default false. * @param endIndex The index of `points` to stop at. Defaults to `points.length`. */ - fillPoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: integer): this; + fillPoints(points: any[] | Phaser.Geom.Point[], closeShape?: boolean, closePath?: boolean, endIndex?: number): this; /** * Stroke the given ellipse. * @param ellipse The ellipse to stroke. * @param smoothness The number of points to draw the ellipse with. Default 32. */ - strokeEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: integer): this; + strokeEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: number): this; /** * Stroke an ellipse with the given position and size. @@ -16763,14 +18687,14 @@ declare namespace Phaser { * @param height The height of the ellipse. * @param smoothness The number of points to draw the ellipse with. Default 32. */ - strokeEllipse(x: number, y: number, width: number, height: number, smoothness?: integer): this; + strokeEllipse(x: number, y: number, width: number, height: number, smoothness?: number): this; /** * Fill the given ellipse. * @param ellipse The ellipse to fill. * @param smoothness The number of points to draw the ellipse with. Default 32. */ - fillEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: integer): this; + fillEllipseShape(ellipse: Phaser.Geom.Ellipse, smoothness?: number): this; /** * Fill an ellipse with the given position and size. @@ -16780,7 +18704,7 @@ declare namespace Phaser { * @param height The height of the ellipse. * @param smoothness The number of points to draw the ellipse with. Default 32. */ - fillEllipse(x: number, y: number, width: number, height: number, smoothness?: integer): this; + fillEllipse(x: number, y: number, width: number, height: number, smoothness?: number): this; /** * Draw an arc. @@ -16892,11 +18816,15 @@ declare namespace Phaser { * * If `key` is a Canvas it will draw the texture to that canvas context. Note that it will NOT * automatically upload it to the GPU in WebGL mode. + * + * Please understand that the texture is created via the Canvas API of the browser, therefore some + * Graphics features, such as `fillGradientStyle`, will not appear on the resulting texture, + * as they're unsupported by the Canvas API. * @param key The key to store the texture with in the Texture Manager, or a Canvas to draw to. * @param width The width of the graphics to generate. * @param height The height of the graphics to generate. */ - generateTexture(key: string | HTMLCanvasElement, width?: integer, height?: integer): this; + generateTexture(key: string | HTMLCanvasElement, width?: number, height?: number): this; /** * Internal destroy handler, called as part of the destroy process. @@ -17001,7 +18929,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The Mask this Game Object is using during render. @@ -17035,6 +18963,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -17062,6 +18992,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -17071,22 +19003,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -17143,7 +19161,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -17164,6 +19182,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -17238,6 +19262,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -17328,7 +19368,7 @@ declare namespace Phaser { * * Groups themselves aren't displayable, and can't be positioned, rotated, scaled, or hidden. */ - class Group { + class Group extends Phaser.Events.EventEmitter { /** * * @param scene The scene this group belongs to. @@ -17377,7 +19417,7 @@ declare namespace Phaser { /** * The maximum size of this group, if used as a pool. -1 is no limit. */ - maxSize: integer; + maxSize: number; /** * A default texture key to use when creating new group members. @@ -17390,7 +19430,7 @@ declare namespace Phaser { /** * A default texture frame to use when creating new group members. */ - defaultFrame: string | integer; + defaultFrame: string | number; /** * Whether to call the update method of any members. @@ -17423,7 +19463,7 @@ declare namespace Phaser { * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of the new Game Object. Default true. * @param active The {@link Phaser.GameObjects.GameObject#active} state of the new Game Object. Default true. */ - create(x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean, active?: boolean): any; + create(x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean, active?: boolean): any; /** * Creates several Game Objects and adds them to this group. @@ -17499,7 +19539,22 @@ declare namespace Phaser { /** * The number of members of the group. */ - getLength(): integer; + getLength(): number; + + /** + * Returns all children in this Group that match the given criteria based on the `property` and `value` arguments. + * + * For example: `getAll('visible', true)` would return only children that have their `visible` property set. + * + * Optionally, you can specify a start and end index. For example if the Group has 100 elements, + * and you set `startIndex` to 0 and `endIndex` to 50, it would return matches from only + * the first 50. + * @param property The property to test on each array element. + * @param value The value to test the property against. Must pass a strict (`===`) comparison check. + * @param startIndex An optional start index to search from. + * @param endIndex An optional end index to search to. + */ + getMatching(property?: string, value?: any, startIndex?: number, endIndex?: number): any[]; /** * Scans the Group, from top to bottom, for the first member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, @@ -17515,7 +19570,7 @@ declare namespace Phaser { * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. */ - getFirst(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + getFirst(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean): any; /** * Scans the Group, from top to bottom, for the nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, @@ -17532,7 +19587,7 @@ declare namespace Phaser { * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. */ - getFirstNth(nth: integer, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + getFirstNth(nth: number, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean): any; /** * Scans the Group for the last member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, @@ -17548,7 +19603,7 @@ declare namespace Phaser { * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. */ - getLast(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + getLast(state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean): any; /** * Scans the Group for the last nth member that has an {@link Phaser.GameObjects.GameObject#active} state matching the argument, @@ -17565,7 +19620,7 @@ declare namespace Phaser { * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. */ - getLastNth(nth: integer, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + getLastNth(nth: number, state?: boolean, createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean): any; /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, @@ -17580,7 +19635,7 @@ declare namespace Phaser { * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. */ - get(x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + get(x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean): any; /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `true`, @@ -17595,7 +19650,7 @@ declare namespace Phaser { * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. */ - getFirstAlive(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + getFirstAlive(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean): any; /** * Scans the group for the first member that has an {@link Phaser.GameObjects.GameObject#active} state set to `false`, @@ -17611,7 +19666,7 @@ declare namespace Phaser { * @param frame A texture frame assigned to a new Game Object (if one is created). Default defaultFrame. * @param visible The {@link Phaser.GameObjects.Components.Visible#visible} state of a new Game Object (if one is created). Default true. */ - getFirstDead(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | integer, visible?: boolean): any; + getFirstDead(createIfNull?: boolean, x?: number, y?: number, key?: string, frame?: string | number, visible?: boolean): any; /** * {@link Phaser.GameObjects.Components.Animation#play Plays} an animation for all members of this group. @@ -17629,19 +19684,19 @@ declare namespace Phaser { * Counts the number of active (or inactive) group members. * @param value Count active (true) or inactive (false) group members. Default true. */ - countActive(value?: boolean): integer; + countActive(value?: boolean): number; /** * Counts the number of in-use (active) group members. */ - getTotalUsed(): integer; + getTotalUsed(): number; /** * The difference of {@link Phaser.GameObjects.Group#maxSize} and the number of active group members. * * This represents the number of group members that could be created or reactivated before reaching the size limit. */ - getTotalFree(): integer; + getTotalFree(): number; /** * Sets the `active` property of this Group. @@ -17665,7 +19720,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - propertyValueSet(key: string, value: number, step?: number, index?: integer, direction?: integer): this; + propertyValueSet(key: string, value: number, step?: number, index?: number, direction?: number): this; /** * Adds the given value to the property as defined in `key` of each group member. @@ -17675,7 +19730,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - propertyValueInc(key: string, value: number, step?: number, index?: integer, direction?: integer): this; + propertyValueInc(key: string, value: number, step?: number, index?: number, direction?: number): this; /** * Sets the x of each group member. @@ -17732,7 +19787,7 @@ declare namespace Phaser { * @param y The y coordinate to place the first item in the array at. * @param direction The iteration direction. 0 = first to last and 1 = last to first. Default 0. */ - shiftPosition(x: number, y: number, direction?: integer): this; + shiftPosition(x: number, y: number, direction?: number): this; /** * Sets the angle of each group member. @@ -17854,7 +19909,7 @@ declare namespace Phaser { * @param index An optional offset to start searching from within the items array. Default 0. * @param direction The direction to iterate through the array. 1 is from beginning to end, -1 from end to beginning. Default 1. */ - setVisible(value: boolean, index?: integer, direction?: integer): this; + setVisible(value: boolean, index?: number, direction?: number): this; /** * Toggles (flips) the visible state of each member of this group. @@ -17888,7 +19943,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer); + constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number); /** * Clears all alpha values associated with this Game Object. @@ -18013,7 +20068,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -18189,6 +20244,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -18274,6 +20331,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -18283,22 +20342,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -18491,7 +20636,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -18506,10 +20651,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -18541,7 +20717,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -18564,40 +20740,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -18651,7 +20806,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -18672,6 +20827,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -18746,6 +20907,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -18771,335 +20948,373 @@ declare namespace Phaser { } /** - * A 2D point light. + * A Layer Game Object. * - * These are typically created by a {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`. - * - * Any Game Objects using the Light2D pipeline will then be affected by these Lights. - * - * They can also simply be used to represent a point light for your own purposes. - */ - class Light { - /** - * - * @param x The horizontal position of the light. - * @param y The vertical position of the light. - * @param radius The radius of the light. - * @param r The red color of the light. A value between 0 and 1. - * @param g The green color of the light. A value between 0 and 1. - * @param b The blue color of the light. A value between 0 and 1. - * @param intensity The intensity of the light. - */ - constructor(x: number, y: number, radius: number, r: number, g: number, b: number, intensity: number); - - /** - * The horizontal position of the light. - */ - x: number; - - /** - * The vertical position of the light. - */ - y: number; - - /** - * The radius of the light. - */ - radius: number; - - /** - * The red color of the light. A value between 0 and 1. - */ - r: number; - - /** - * The green color of the light. A value between 0 and 1. - */ - g: number; - - /** - * The blue color of the light. A value between 0 and 1. - */ - b: number; - - /** - * The intensity of the light. - */ - intensity: number; - - /** - * The horizontal scroll factor of the light. - */ - scrollFactorX: number; - - /** - * The vertical scroll factor of the light. - */ - scrollFactorY: number; - - /** - * Set the properties of the light. - * - * Sets both horizontal and vertical scroll factor to 1. Use {@link Phaser.GameObjects.Light#setScrollFactor} to set - * the scroll factor. - * @param x The horizontal position of the light. - * @param y The vertical position of the light. - * @param radius The radius of the light. - * @param r The red color. A value between 0 and 1. - * @param g The green color. A value between 0 and 1. - * @param b The blue color. A value between 0 and 1. - * @param intensity The intensity of the light. - */ - set(x: number, y: number, radius: number, r: number, g: number, b: number, intensity: number): this; - - /** - * Set the scroll factor of the light. - * @param x The horizontal scroll factor of the light. - * @param y The vertical scroll factor of the light. - */ - setScrollFactor(x: number, y: number): this; - - /** - * Set the color of the light from a single integer RGB value. - * @param rgb The integer RGB color of the light. - */ - setColor(rgb: number): this; - - /** - * Set the intensity of the light. - * @param intensity The intensity of the light. - */ - setIntensity(intensity: number): this; - - /** - * Set the position of the light. - * @param x The horizontal position of the light. - * @param y The vertical position of the light. - */ - setPosition(x: number, y: number): this; - - /** - * Set the radius of the light. - * @param radius The radius of the light. - */ - setRadius(radius: number): this; - - } - - /** - * Manages Lights for a Scene. - * - * Affects the rendering of Game Objects using the `Light2D` pipeline. - */ - class LightsManager { - /** - * The pool of Lights. - * - * Used to recycle removed Lights for a more efficient use of memory. - */ - lightPool: Phaser.GameObjects.Light[]; - - /** - * The Lights in the Scene. - */ - lights: Phaser.GameObjects.Light[]; - - /** - * Lights that have been culled from a Camera's viewport. - * - * Lights in this list will not be rendered. - */ - culledLights: Phaser.GameObjects.Light[]; - - /** - * The ambient color. - */ - ambientColor: Object; - - /** - * Whether the Lights Manager is enabled. - */ - active: boolean; - - /** - * The maximum number of lights that a single Camera and the lights shader can process. - * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. - */ - readonly maxLights: integer; - - /** - * Enable the Lights Manager. - */ - enable(): Phaser.GameObjects.LightsManager; - - /** - * Disable the Lights Manager. - */ - disable(): Phaser.GameObjects.LightsManager; - - /** - * Cull any Lights that aren't visible to the given Camera. - * - * Culling Lights improves performance by ensuring that only Lights within a Camera's viewport are rendered. - * @param camera The Camera to cull Lights for. - */ - cull(camera: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Light[]; - - /** - * Iterate over each Light with a callback. - * @param callback The callback that is called with each Light. - */ - forEachLight(callback: LightForEach): Phaser.GameObjects.LightsManager; - - /** - * Set the ambient light color. - * @param rgb The integer RGB color of the ambient light. - */ - setAmbientColor(rgb: number): Phaser.GameObjects.LightsManager; - - /** - * Returns the maximum number of Lights allowed to appear at once. - */ - getMaxVisibleLights(): integer; - - /** - * Get the number of Lights managed by this Lights Manager. - */ - getLightCount(): integer; - - /** - * Add a Light. - * @param x The horizontal position of the Light. Default 0. - * @param y The vertical position of the Light. Default 0. - * @param radius The radius of the Light. Default 100. - * @param rgb The integer RGB color of the light. Default 0xffffff. - * @param intensity The intensity of the Light. Default 1. - */ - addLight(x?: number, y?: number, radius?: number, rgb?: number, intensity?: number): Phaser.GameObjects.Light; - - /** - * Remove a Light. - * @param light The Light to remove. - */ - removeLight(light: Phaser.GameObjects.Light): Phaser.GameObjects.LightsManager; - - /** - * Shut down the Lights Manager. - * - * Recycles all active Lights into the Light pool, resets ambient light color and clears the lists of Lights and - * culled Lights. - */ - shutdown(): void; - - /** - * Destroy the Lights Manager. - * - * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}. - */ - destroy(): void; - - } - - /** - * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for the Light2D pipeline. - * - * Available from within a Scene via `this.lights`. - * - * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method: + * A Layer is a special type of Game Object that acts as a Display List. You can add any type of Game Object + * to a Layer, just as you would to a Scene. Layers can be used to visually group together 'layers' of Game + * Objects: * * ```javascript - * // Enable the Lights Manager because it is disabled by default - * this.lights.enable(); + * const spaceman = this.add.sprite(150, 300, 'spaceman'); + * const bunny = this.add.sprite(400, 300, 'bunny'); + * const elephant = this.add.sprite(650, 300, 'elephant'); * - * // Create a Light at [400, 300] with a radius of 200 - * this.lights.addLight(400, 300, 200); + * const layer = this.add.layer(); + * + * layer.add([ spaceman, bunny, elephant ]); * ``` * - * For Game Objects to be affected by the Lights when rendered, you will need to set them to use the `Light2D` pipeline like so: + * The 3 sprites in the example above will now be managed by the Layer they were added to. Therefore, + * if you then set `layer.setVisible(false)` they would all vanish from the display. * - * ```javascript - * sprite.setPipeline('Light2D'); - * ``` + * You can also control the depth of the Game Objects within the Layer. For example, calling the + * `setDepth` method of a child of a Layer will allow you to adjust the depth of that child _within the + * Layer itself_, rather than the whole Scene. The Layer, too, can have its depth set as well. + * + * The Layer class also offers many different methods for manipulating the list, such as the + * methods `moveUp`, `moveDown`, `sendToBack`, `bringToTop` and so on. These allow you to change the + * display list position of the Layers children, causing it to adjust the order in which they are + * rendered. Using `setDepth` on a child allows you to override this. + * + * Layers can have Post FX Pipelines set, which allows you to easily enable a post pipeline across + * a whole range of children, which, depending on the effect, can often be far more efficient that doing so + * on a per-child basis. + * + * Layers have no position or size within the Scene. This means you cannot enable a Layer for + * physics or input, or change the position, rotation or scale of a Layer. They also have no scroll + * factor, texture, tint, origin, crop or bounds. + * + * If you need those kind of features then you should use a Container instead. Containers can be added + * to Layers, but Layers cannot be added to Containers. + * + * However, you can set the Alpha, Blend Mode, Depth, Mask and Visible state of a Layer. These settings + * will impact all children being rendered by the Layer. */ - class LightsPlugin extends Phaser.GameObjects.LightsManager { + class Layer extends Phaser.Structs.List implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Visible { /** * - * @param scene The Scene that this Lights Plugin belongs to. + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param children An optional array of Game Objects to add to this Layer. */ - constructor(scene: Phaser.Scene); + constructor(scene: Phaser.Scene, children?: Phaser.GameObjects.GameObject[]); /** - * A reference to the Scene that this Lights Plugin belongs to. + * A reference to the Scene to which this Game Object belongs. + * + * Game Objects can only belong to one Scene. + * + * You should consider this property as being read-only. You cannot move a + * Game Object to another Scene by simply changing it. */ scene: Phaser.Scene; /** - * A reference to the Scene's systems. + * Holds a reference to the Display List that contains this Game Object. + * + * This is set automatically when this Game Object is added to a Scene or Layer. + * + * You should treat this property as being read-only. + */ + displayList: Phaser.GameObjects.DisplayList | Phaser.GameObjects.Layer; + + /** + * A textual representation of this Game Object, i.e. `sprite`. + * Used internally by Phaser but is available for your own custom classes to populate. + */ + type: string; + + /** + * The current state of this Game Object. + * + * Phaser itself will never modify this value, although plugins may do so. + * + * Use this property to track the state of a Game Object during its lifetime. For example, it could change from + * a state of 'moving', to 'attacking', to 'dead'. The state value should be an integer (ideally mapped to a constant + * in your game code), or a string. These are recommended to keep it light and simple, with fast comparisons. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + */ + state: number | string; + + /** + * The name of this Game Object. + * Empty by default and never populated by Phaser, this is left for developers to use. + */ + name: string; + + /** + * The active state of this Game Object. + * A Game Object with an active state of `true` is processed by the Scenes UpdateList, if added to it. + * An active object is one which is having its logic and internal systems updated. + */ + active: boolean; + + /** + * A Data Manager. + * It allows you to store, query and get key/value paired information specific to this Game Object. + * `null` by default. Automatically created if you use `getData` or `setData` or `setDataEnabled`. + */ + data: Phaser.Data.DataManager; + + /** + * The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not. + * The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively. + * If those components are not used by your custom class then you can use this bitmask as you wish. + */ + renderFlags: number; + + /** + * A bitmask that controls if this Game Object is drawn by a Camera or not. + * Not usually set directly, instead call `Camera.ignore`, however you can + * set this property directly using the Camera.id property: + */ + cameraFilter: number; + + /** + * This Game Object will ignore all calls made to its destroy method if this flag is set to `true`. + * This includes calls that may come from a Group, Container or the Scene itself. + * While it allows you to persist a Game Object across Scenes, please understand you are entirely + * responsible for managing references to and from this Game Object. + */ + ignoreDestroy: boolean; + + /** + * A reference to the Scene Systems. */ systems: Phaser.Scenes.Systems; /** - * Boot the Lights Plugin. + * A reference to the Scene Event Emitter. */ - boot(): void; + events: Phaser.Events.EventEmitter; /** - * Destroy the Lights Plugin. + * The flag the determines whether Game Objects should be sorted when `depthSort()` is called. + */ + sortChildrenFlag: boolean; + + /** + * Sets the `active` property of this Game Object and returns this Game Object for further chaining. + * A Game Object with its `active` property set to `true` will be updated by the Scenes UpdateList. + * @param value True if this Game Object should be set as active, false if not. + */ + setActive(value: boolean): this; + + /** + * Sets the `name` property of this Game Object and returns this Game Object for further chaining. + * The `name` property is not populated by Phaser and is presented for your own use. + * @param value The name to be given to this Game Object. + */ + setName(value: string): this; + + /** + * Sets the current state of this Game Object. * - * Cleans up all references. + * Phaser itself will never modify the State of a Game Object, although plugins may do so. + * + * For example, a Game Object could change from a state of 'moving', to 'attacking', to 'dead'. + * The state value should typically be an integer (ideally mapped to a constant + * in your game code), but could also be a string. It is recommended to keep it light and simple. + * If you need to store complex data about your Game Object, look at using the Data Component instead. + * @param value The state of the Game Object. + */ + setState(value: number | string): this; + + /** + * Adds a Data Manager component to this Game Object. + */ + setDataEnabled(): this; + + /** + * Allows you to store a key value pair within this Game Objects Data Manager. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * ```javascript + * sprite.setData('name', 'Red Gem Stone'); + * ``` + * + * You can also pass in an object of key value pairs as the first argument: + * + * ```javascript + * sprite.setData({ name: 'Red Gem Stone', level: 2, owner: 'Link', gold: 50 }); + * ``` + * + * To get a value back again you can call `getData`: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or you can access the value directly via the `values` property, where it works like any other variable: + * + * ```javascript + * sprite.data.values.gold += 50; + * ``` + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * + * If the key already exists, a `changedata` event is emitted instead, along an event named after the key. + * For example, if you updated an existing key called `PlayerLives` then it would emit the event `changedata-PlayerLives`. + * These events will be emitted regardless if you use this method to set the value, or the direct `values` setter. + * + * Please note that the data keys are case-sensitive and must be valid JavaScript Object property strings. + * This means the keys `gold` and `Gold` are treated as two unique values within the Data Manager. + * @param key The key to set the value for. Or an object of key value pairs. If an object the `data` argument is ignored. + * @param data The value to set for the given key. If an object is provided as the key this argument is ignored. + */ + setData(key: string | object, data?: any): this; + + /** + * Increase a value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is increased from 0. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * @param key The key to increase the value for. + * @param data The value to increase for the given key. + */ + incData(key: string | object, data?: any): this; + + /** + * Toggle a boolean value for the given key within this Game Objects Data Manager. If the key doesn't already exist in the Data Manager then it is toggled from false. + * + * If the Game Object has not been enabled for data (via `setDataEnabled`) then it will be enabled + * before setting the value. + * + * If the key doesn't already exist in the Data Manager then it is created. + * + * When the value is first set, a `setdata` event is emitted from this Game Object. + * @param key The key to toggle the value for. + */ + toggleData(key: string | object): this; + + /** + * Retrieves the value for the given key in this Game Objects Data Manager, or undefined if it doesn't exist. + * + * You can also access values via the `values` object. For example, if you had a key called `gold` you can do either: + * + * ```javascript + * sprite.getData('gold'); + * ``` + * + * Or access the value directly: + * + * ```javascript + * sprite.data.values.gold; + * ``` + * + * You can also pass in an array of keys, in which case an array of values will be returned: + * + * ```javascript + * sprite.getData([ 'gold', 'armor', 'health' ]); + * ``` + * + * This approach is useful for destructuring arrays in ES6. + * @param key The key of the value to retrieve, or an array of keys. + */ + getData(key: string | string[]): any; + + /** + * This callback is invoked when this Game Object is added to a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to add themselves into the Update List. + * + * You can also listen for the `ADDED_TO_SCENE` event from this Game Object. + */ + addedToScene(): void; + + /** + * This callback is invoked when this Game Object is removed from a Scene. + * + * Can be overriden by custom Game Objects, but be aware of some Game Objects that + * will use this, such as Sprites, to removed themselves from the Update List. + * + * You can also listen for the `REMOVED_FROM_SCENE` event from this Game Object. + */ + removedFromScene(): void; + + /** + * To be overridden by custom GameObjects. Allows base objects to be used in a Pool. + * @param args args + */ + update(...args: any[]): void; + + /** + * Returns a JSON representation of the Game Object. + */ + toJSON(): Phaser.Types.GameObjects.JSONGameObject; + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * @param camera The Camera to check against this Game Object. + */ + willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Force a sort of the display list on the next call to depthSort. + */ + queueDepthSort(): void; + + /** + * Immediately sorts the display list if the flag is set. + */ + depthSort(): void; + + /** + * Compare the depth of two Game Objects. + * @param childA The first Game Object. + * @param childB The second Game Object. + */ + sortByDepth(childA: Phaser.GameObjects.GameObject, childB: Phaser.GameObjects.GameObject): number; + + /** + * Returns an array which contains all Game Objects within this Layer. + * + * This is a reference to the main list array, not a copy of it, so be careful not to modify it. + */ + getChildren(): Phaser.GameObjects.GameObject[]; + + /** + * Destroys this Game Object removing it from the Display List and Update List and + * severing all ties to parent resources. + * + * Use this to remove a Game Object from your game if you don't ever plan to use it again. + * As long as no reference to it exists within your own code it should become free for + * garbage collection by the browser. + * + * If you just want to temporarily disable an object then look at using the + * Game Object Pool instead of destroying it, as destroyed objects cannot be resurrected. */ destroy(): void; - } - - /** - * A Mesh Game Object. - */ - class Mesh extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { /** + * Clears all alpha values associated with this Game Object. * - * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. - * @param x The horizontal position of this Game Object in the world. - * @param y The vertical position of this Game Object in the world. - * @param vertices An array containing the vertices data for this Mesh. - * @param uv An array containing the uv data for this Mesh. - * @param colors An array containing the color data for this Mesh. - * @param alphas An array containing the alpha data for this Mesh. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. + * Immediately sets the alpha levels back to 1 (fully opaque). */ - constructor(scene: Phaser.Scene, x: number, y: number, vertices: number[], uv: number[], colors: number[], alphas: number[], texture: string | Phaser.Textures.Texture, frame?: string | integer); + clearAlpha(): this; /** - * An array containing the vertices data for this Mesh. + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * @param value The alpha value applied across the whole Game Object. Default 1. */ - vertices: Float32Array; + setAlpha(value?: number): this; /** - * An array containing the uv data for this Mesh. + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. */ - uv: Float32Array; - - /** - * An array containing the color data for this Mesh. - */ - colors: Uint32Array; - - /** - * An array containing the alpha data for this Mesh. - */ - alphas: Float32Array; - - /** - * Fill or additive mode used when blending the color values? - */ - tintFill: boolean; - - /** - * This method is left intentionally empty and does not do anything. - * It is retained to allow a Mesh or Quad to be added to a Container. - */ - setAlpha(): void; + alpha: number; /** * Sets the Blend Mode being used by this Game Object. @@ -19173,7 +21388,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The Mask this Game Object is using during render. @@ -19207,6 +21422,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -19234,6 +21451,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -19243,22 +21462,1173 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * A 2D point light. + * + * These are typically created by a {@link Phaser.GameObjects.LightsManager}, available from within a scene via `this.lights`. + * + * Any Game Objects using the Light2D pipeline will then be affected by these Lights as long as they have a normal map. + * + * They can also simply be used to represent a point light for your own purposes. + */ + class Light extends Phaser.Geom.Circle implements Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Visible { + /** + * + * @param x The horizontal position of the light. + * @param y The vertical position of the light. + * @param radius The radius of the light. + * @param r The red color of the light. A value between 0 and 1. + * @param g The green color of the light. A value between 0 and 1. + * @param b The blue color of the light. A value between 0 and 1. + * @param intensity The intensity of the light. + */ + constructor(x: number, y: number, radius: number, r: number, g: number, b: number, intensity: number); + + /** + * The color of the light. + */ + color: Phaser.Display.RGB; + + /** + * The intensity of the light. + */ + intensity: number; + + /** + * Compares the renderMask with the renderFlags to see if this Game Object will render or not. + * Also checks the Game Object against the given Cameras exclusion list. + * @param camera The Camera to check against this Game Object. + */ + willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Set the color of the light from a single integer RGB value. + * @param rgb The integer RGB color of the light. + */ + setColor(rgb: number): this; + + /** + * Set the intensity of the light. + * @param intensity The intensity of the light. + */ + setIntensity(intensity: number): this; + + /** + * Set the radius of the light. + * @param radius The radius of the light. + */ + setRadius(radius: number): this; + + /** + * The bitmask that `GameObject.renderFlags` is compared against to determine if the Game Object will render or not. + */ + static readonly RENDER_MASK: number; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; + + } + + /** + * Manages Lights for a Scene. + * + * Affects the rendering of Game Objects using the `Light2D` pipeline. + */ + class LightsManager { + /** + * The Lights in the Scene. + */ + lights: Phaser.GameObjects.Light[]; + + /** + * The ambient color. + */ + ambientColor: Phaser.Display.RGB; + + /** + * Whether the Lights Manager is enabled. + */ + active: boolean; + + /** + * The maximum number of lights that a single Camera and the lights shader can process. + * Change this via the `maxLights` property in your game config, as it cannot be changed at runtime. + */ + readonly maxLights: number; + + /** + * The number of lights that the LightPipeline processed in the _previous_ frame. + */ + readonly visibleLights: number; + + /** + * Enable the Lights Manager. + */ + enable(): Phaser.GameObjects.LightsManager; + + /** + * Disable the Lights Manager. + */ + disable(): Phaser.GameObjects.LightsManager; + + /** + * Get all lights that can be seen by the given Camera. + * + * It will automatically cull lights that are outside the world view of the Camera. + * + * If more lights are returned than supported by the pipeline, the lights are then culled + * based on the distance from the center of the camera. Only those closest are rendered. + * @param camera The Camera to cull Lights for. + */ + getLights(camera: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Light[]; + + /** + * Set the ambient light color. + * @param rgb The integer RGB color of the ambient light. + */ + setAmbientColor(rgb: number): Phaser.GameObjects.LightsManager; + + /** + * Returns the maximum number of Lights allowed to appear at once. + */ + getMaxVisibleLights(): number; + + /** + * Get the number of Lights managed by this Lights Manager. + */ + getLightCount(): number; + + /** + * Add a Light. + * @param x The horizontal position of the Light. Default 0. + * @param y The vertical position of the Light. Default 0. + * @param radius The radius of the Light. Default 100. + * @param rgb The integer RGB color of the light. Default 0xffffff. + * @param intensity The intensity of the Light. Default 1. + */ + addLight(x?: number, y?: number, radius?: number, rgb?: number, intensity?: number): Phaser.GameObjects.Light; + + /** + * Remove a Light. + * @param light The Light to remove. + */ + removeLight(light: Phaser.GameObjects.Light): Phaser.GameObjects.LightsManager; + + /** + * Shut down the Lights Manager. + * + * Recycles all active Lights into the Light pool, resets ambient light color and clears the lists of Lights and + * culled Lights. + */ + shutdown(): void; + + /** + * Destroy the Lights Manager. + * + * Cleans up all references by calling {@link Phaser.GameObjects.LightsManager#shutdown}. + */ + destroy(): void; + + } + + /** + * A Scene plugin that provides a {@link Phaser.GameObjects.LightsManager} for the Light2D pipeline. + * + * Available from within a Scene via `this.lights`. + * + * Add Lights using the {@link Phaser.GameObjects.LightsManager#addLight} method: + * + * ```javascript + * // Enable the Lights Manager because it is disabled by default + * this.lights.enable(); + * + * // Create a Light at [400, 300] with a radius of 200 + * this.lights.addLight(400, 300, 200); + * ``` + * + * For Game Objects to be affected by the Lights when rendered, you will need to set them to use the `Light2D` pipeline like so: + * + * ```javascript + * sprite.setPipeline('Light2D'); + * ``` + * + * Note that you cannot use this pipeline on Graphics Game Objects or Shape Game Objects. + */ + class LightsPlugin extends Phaser.GameObjects.LightsManager { + /** + * + * @param scene The Scene that this Lights Plugin belongs to. + */ + constructor(scene: Phaser.Scene); + + /** + * A reference to the Scene that this Lights Plugin belongs to. + */ + scene: Phaser.Scene; + + /** + * A reference to the Scene's systems. + */ + systems: Phaser.Scenes.Systems; + + /** + * Boot the Lights Plugin. + */ + boot(): void; + + /** + * Destroy the Lights Plugin. + * + * Cleans up all references. + */ + destroy(): void; + + } + + /** + * A Mesh Game Object. + * + * The Mesh Game Object allows you to render a group of textured vertices and manipulate + * the view of those vertices, such as rotation, translation or scaling. + * + * Support for generating mesh data from grids, model data or Wavefront OBJ Files is included. + * + * Although you can use this to render 3D objects, its primary use is for displaying more complex + * Sprites, or Sprites where you need fine-grained control over the vertice positions in order to + * achieve special effects in your games. Note that rendering still takes place using Phasers + * orthographic camera. As a result, all depth and face tests are done in orthographic space. + * + * The rendering process will iterate through the faces of this Mesh and render out each face + * that is considered as being in view of the camera. No depth buffer is used, and because of this, + * you should be careful not to use model data with too many vertices, or overlapping geometry, + * or you'll probably encounter z-depth fighting. The Mesh was designed to allow for more advanced + * 2D layouts, rather than displaying 3D objects, even though it can do this to a degree. + * + * In short, if you want to remake Crysis, use a 3D engine, not a Mesh. However, if you want + * to easily add some small fun 3D elements into your game, or create some special effects involving + * vertex warping, this is the right object for you. Mesh data becomes part of the WebGL batch, + * just like standard Sprites, so doesn't introduce any additional shader overhead. Because + * the Mesh just generates vertices into the WebGL batch, like any other Sprite, you can use all of + * the common Game Object components on a Mesh too, such as a custom pipeline, mask, blend mode + * or texture. + * + * Note that the Mesh object is WebGL only and does not have a Canvas counterpart. + * + * The Mesh origin is always 0.5 x 0.5 and cannot be changed. + */ + class Mesh extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { + /** + * + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. + * @param x The horizontal position of this Game Object in the world. + * @param y The vertical position of this Game Object in the world. + * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. + * @param frame An optional frame from the Texture this Game Object is rendering with. + * @param vertices The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param uvs The UVs pairs array. + * @param indicies Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param containsZ Does the vertices data include a `z` component? Default false. + * @param normals Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param colors An array of colors, one per vertex, or a single color value applied to all vertices. Default 0xffffff. + * @param alphas An array of alpha values, one per vertex, or a single alpha value applied to all vertices. Default 1. + */ + constructor(scene: Phaser.Scene, x?: number, y?: number, texture?: string | Phaser.Textures.Texture, frame?: string | number, vertices?: number[], uvs?: number[], indicies?: number[], containsZ?: boolean, normals?: number[], colors?: number | number[], alphas?: number | number[]); + + /** + * An array containing the Face instances belonging to this Mesh. + * + * A Face consists of 3 Vertex objects. + * + * This array is populated during calls such as `addVertices` or `addOBJ`. + */ + faces: Phaser.Geom.Mesh.Face[]; + + /** + * An array containing Vertex instances. One instance per vertex in this Mesh. + * + * This array is populated during calls such as `addVertex` or `addOBJ`. + */ + vertices: Phaser.Geom.Mesh.Vertex[]; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertex colors replace the texture, but respects texture alpha. + */ + tintFill: boolean; + + /** + * You can optionally choose to render the vertices of this Mesh to a Graphics instance. + * + * Achieve this by setting the `debugCallback` and the `debugGraphic` properties. + * + * You can do this in a single call via the `Mesh.setDebug` method, which will use the + * built-in debug function. You can also set it to your own callback. The callback + * will be invoked _once per render_ and sent the following parameters: + * + * `debugCallback(src, meshLength, verts)` + * + * `src` is the Mesh instance being debugged. + * `meshLength` is the number of mesh vertices in total. + * `verts` is an array of the translated vertex coordinates. + * + * To disable rendering, set this property back to `null`. + * + * Please note that high vertex count Meshes will struggle to debug properly. + */ + debugCallback: Function; + + /** + * The Graphics instance that the debug vertices will be drawn to, if `setDebug` has + * been called. + */ + debugGraphic: Phaser.GameObjects.Graphics; + + /** + * When rendering, skip any Face that isn't counter clockwise? + * + * Enable this to hide backward-facing Faces during rendering. + * + * Disable it to render all Faces. + */ + hideCCW: boolean; + + /** + * A Vector3 containing the 3D position of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to reposition where + * the vertices are rendered within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + * + * You can also adjust the 'view' by using the `pan` methods. + */ + modelPosition: Phaser.Math.Vector3; + + /** + * A Vector3 containing the 3D scale of the vertices in this Mesh. + * + * Modifying the components of this property will allow you to scale + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + */ + modelScale: Phaser.Math.Vector3; + + /** + * A Vector3 containing the 3D rotation of the vertices in this Mesh. + * + * The values should be given in radians, i.e. to rotate the vertices by 90 + * degrees you can use `modelRotation.x = Phaser.Math.DegToRad(90)`. + * + * Modifying the components of this property will allow you to rotate + * the vertices within the Mesh. This happens in the `preUpdate` phase, + * where each vertex is transformed using the view and projection matrices. + * + * Changing this property will impact all vertices being rendered by this Mesh. + */ + modelRotation: Phaser.Math.Vector3; + + /** + * The transformation matrix for this Mesh. + */ + transformMatrix: Phaser.Math.Matrix4; + + /** + * The view position for this Mesh. + * + * Use the methods`panX`, `panY` and `panZ` to adjust the view. + */ + viewPosition: Phaser.Math.Vector3; + + /** + * The view matrix for this Mesh. + */ + viewMatrix: Phaser.Math.Matrix4; + + /** + * The projection matrix for this Mesh. + * + * Update it with the `setPerspective` or `setOrtho` methods. + */ + projectionMatrix: Phaser.Math.Matrix4; + + /** + * How many faces were rendered by this Mesh Game Object in the last + * draw? This is reset in the `preUpdate` method and then incremented + * each time a face is drawn. Note that in multi-camera Scenes this + * value may exceed that found in `Mesh.getFaceCount` due to + * cameras drawing the same faces more than once. + */ + readonly totalRendered: number; + + /** + * By default, the Mesh will check to see if its model or view transform has + * changed each frame and only recalculate the vertex positions if they have. + * + * This avoids lots of additional math in the `preUpdate` step when not required. + * + * However, if you are performing per-Face or per-Vertex manipulation on this Mesh, + * such as tweening a Face, or moving it without moving the rest of the Mesh, + * then you may need to disable the dirty cache in order for the Mesh to re-render + * correctly. You can toggle this property to do that. Please note that leaving + * this set to `true` will cause the Mesh to recalculate the position of every single + * vertex in it, every single frame. So only really do this if you know you + * need it. + */ + ignoreDirtyCache: boolean; + + /** + * Translates the view position of this Mesh on the x axis by the given amount. + * @param v The amount to pan by. + */ + panX(v: number): void; + + /** + * Translates the view position of this Mesh on the y axis by the given amount. + * @param v The amount to pan by. + */ + panY(v: number): void; + + /** + * Translates the view position of this Mesh on the z axis by the given amount. + * @param v The amount to pan by. + */ + panZ(v: number): void; + + /** + * Builds a new perspective projection matrix from the given values. + * + * See also `setOrtho`. + * @param width The width of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param height The height of the projection matrix. Typically the same as the Mesh and/or Renderer. + * @param fov The field of view, in degrees. Default 45. + * @param near The near value of the view. Default 0.01. + * @param far The far value of the view. Default 1000. + */ + setPerspective(width: number, height: number, fov?: number, near?: number, far?: number): void; + + /** + * Builds a new orthographic projection matrix from the given values. + * + * If using this mode you will often need to set `Mesh.hideCCW` to `false` as well. + * + * See also `setPerspective`. + * @param scaleX The default horizontal scale in relation to the Mesh / Renderer dimensions. Default 1. + * @param scaleY The default vertical scale in relation to the Mesh / Renderer dimensions. Default 1. + * @param near The near value of the view. Default -1000. + * @param far The far value of the view. Default 1000. + */ + setOrtho(scaleX?: number, scaleY?: number, near?: number, far?: number): void; + + /** + * Iterates and destroys all current Faces in this Mesh, then resets the + * `faces` and `vertices` arrays. + */ + clear(): this; + + /** + * This method will add the data from a triangulated Wavefront OBJ model file to this Mesh. + * + * The data should have been loaded via the OBJFile: + * + * ```javascript + * this.load.obj(key, url); + * ``` + * + * Then use the same `key` as the first parameter to this method. + * + * Multiple Mesh Game Objects can use the same model data without impacting on each other. + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small, or too large, to see. + * You can also offset the vertices of the model via the `x`, `y` and `z` parameters. + * @param key The key of the model data in the OBJ Cache to add to this Mesh. + * @param scale An amount to scale the model data by. Use this if the model has exported too small, or large, to see. Default 1. + * @param x Translate the model x position by this amount. Default 0. + * @param y Translate the model y position by this amount. Default 0. + * @param z Translate the model z position by this amount. Default 0. + * @param rotateX Rotate the model on the x axis by this amount, in radians. Default 0. + * @param rotateY Rotate the model on the y axis by this amount, in radians. Default 0. + * @param rotateZ Rotate the model on the z axis by this amount, in radians. Default 0. + * @param zIsUp Is the z axis up (true), or is y axis up (false)? Default true. + */ + addVerticesFromObj(key: string, scale?: number, x?: number, y?: number, z?: number, rotateX?: number, rotateY?: number, rotateZ?: number, zIsUp?: boolean): this; + + /** + * Compare the depth of two Faces. + * @param faceA The first Face. + * @param faceB The second Face. + */ + sortByDepth(faceA: Phaser.Geom.Mesh.Face, faceB: Phaser.Geom.Mesh.Face): number; + + /** + * Runs a depth sort across all Faces in this Mesh, comparing their averaged depth. + * + * This is called automatically if you use any of the `rotate` methods, but you can + * also invoke it to sort the Faces should you manually position them. + */ + depthSort(): this; + + /** + * Adds a new Vertex into the vertices array of this Mesh. + * + * Just adding a vertex isn't enough to render it. You need to also + * make it part of a Face, with 3 Vertex instances per Face. + * @param x The x position of the vertex. + * @param y The y position of the vertex. + * @param z The z position of the vertex. + * @param u The UV u coordinate of the vertex. + * @param v The UV v coordinate of the vertex. + * @param color The color value of the vertex. Default 0xffffff. + * @param alpha The alpha value of the vertex. Default 1. + */ + addVertex(x: number, y: number, z: number, u: number, v: number, color?: number, alpha?: number): this; + + /** + * Adds a new Face into the faces array of this Mesh. + * + * A Face consists of references to 3 Vertex instances, which must be provided. + * @param vertex1 The first vertex of the Face. + * @param vertex2 The second vertex of the Face. + * @param vertex3 The third vertex of the Face. + */ + addFace(vertex1: Phaser.Geom.Mesh.Vertex, vertex2: Phaser.Geom.Mesh.Vertex, vertex3: Phaser.Geom.Mesh.Vertex): this; + + /** + * Adds new vertices to this Mesh by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * mesh.addVertices(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * @param vertices The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param uvs The UVs pairs array. + * @param indicies Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param containsZ Does the vertices data include a `z` component? Default false. + * @param normals Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param colors An array of colors, one per vertex, or a single color value applied to all vertices. Default 0xffffff. + * @param alphas An array of alpha values, one per vertex, or a single alpha value applied to all vertices. Default 1. + */ + addVertices(vertices: number[], uvs: number[], indicies?: number[], containsZ?: boolean, normals?: number[], colors?: number | number[], alphas?: number | number[]): this; + + /** + * Returns the total number of Faces in this Mesh Game Object. + */ + getFaceCount(): number; + + /** + * Returns the total number of Vertices in this Mesh Game Object. + */ + getVertexCount(): number; + + /** + * Returns the Face at the given index in this Mesh Game Object. + * @param index The index of the Face to get. + */ + getFace(index: number): Phaser.Geom.Mesh.Face; + + /** + * Return an array of Face objects from this Mesh that intersect with the given coordinates. + * + * The given position is translated through the matrix of this Mesh and the given Camera, + * before being compared against the vertices. + * + * If more than one Face intersects, they will all be returned in the array, but the array will + * be depth sorted first, so the first element will always be that closest to the camera. + * @param x The x position to check against. + * @param y The y position to check against. + * @param camera The camera to pass the coordinates through. If not give, the default Scene Camera is used. + */ + getFaceAt(x: number, y: number, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Geom.Mesh.Face[]; + + /** + * This method enables rendering of the Mesh vertices to the given Graphics instance. + * + * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, + * otherwise the Graphics instance you provide to debug will fill-up with draw calls, + * eventually crashing the browser. This is not done automatically to allow you to debug + * draw multiple Mesh objects to a single Graphics instance. + * + * The Mesh class has a built-in debug rendering callback `Mesh.renderDebug`, however + * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. + * + * The callback is invoked _once per render_ and sent the following parameters: + * + * `callback(src, faces)` + * + * `src` is the Mesh instance being debugged. + * `faces` is an array of the Faces that were rendered. + * + * You can get the final drawn vertex position from a Face object like this: + * + * ```javascript + * let face = faces[i]; + * + * let x0 = face.vertex1.tx; + * let y0 = face.vertex1.ty; + * let x1 = face.vertex2.tx; + * let y1 = face.vertex2.ty; + * let x2 = face.vertex3.tx; + * let y2 = face.vertex3.ty; + * + * graphic.strokeTriangle(x0, y0, x1, y1, x2, y2); + * ``` + * + * If using your own callback you do not have to provide a Graphics instance to this method. + * + * To disable debug rendering, to either your own callback or the built-in one, call this method + * with no arguments. + * @param graphic The Graphic instance to render to if using the built-in callback. + * @param callback The callback to invoke during debug render. Leave as undefined to use the built-in callback. + */ + setDebug(graphic?: Phaser.GameObjects.Graphics, callback?: Function): this; + + /** + * Checks if the transformation data in this mesh is dirty. + * + * This is used internally by the `preUpdate` step to determine if the vertices should + * be recalculated or not. + */ + isDirty(): boolean; + + /** + * The Mesh update loop. The following takes place in this method: + * + * First, the `totalRendered` and `totalFrame` properties are set. + * + * If the view matrix of this Mesh isn't dirty, and the model position, rotate or scale properties are + * all clean, then the method returns at this point. + * + * Otherwise, if the viewPosition is dirty (i.e. from calling a method like `panZ`), then it will + * refresh the viewMatrix. + * + * After this, a new transformMatrix is built and it then iterates through all Faces in this + * Mesh, calling `transformCoordinatesLocal` on all of them. Internally, this updates every + * vertex, calculating its new transformed position, based on the new transform matrix. + * + * Finally, the faces are depth sorted. + * @param time The current timestamp. + * @param delta The delta time, in ms, elapsed since the last frame. + */ + protected preUpdate(time: number, delta: number): void; + + /** + * The built-in Mesh debug rendering method. + * + * See `Mesh.setDebug` for more details. + * @param src The Mesh object being rendered. + * @param faces An array of Faces. + */ + renderDebug(src: Phaser.GameObjects.Mesh, faces: Phaser.Geom.Mesh.Face[]): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * @param value The alpha value applied across the whole Game Object. Default 1. + */ + setAlpha(value?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: number): this; + + /** + * The Mask this Game Object is using during render. + */ + mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask; + + /** + * Sets the mask that this Game Object will use to render with. + * + * The mask must have been previously created and can be either a GeometryMask or a BitmapMask. + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * If a mask is already set on this Game Object it will be immediately replaced. + * + * Masks are positioned in global space and are not relative to the Game Object to which they + * are applied. The reason for this is that multiple Game Objects can all share the same mask. + * + * Masks have no impact on physics or input detection. They are purely a rendering component + * that allows you to limit what is visible during the render pass. + * @param mask The mask this Game Object will use when rendering. + */ + setMask(mask: Phaser.Display.Masks.BitmapMask | Phaser.Display.Masks.GeometryMask): this; + + /** + * Clears the mask that this Game Object was using. + * @param destroyMask Destroy the mask before clearing it? Default false. + */ + clearMask(destroyMask?: boolean): this; + + /** + * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, + * including this one. + * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * + * To create the mask you need to pass in a reference to a renderable Game Object. + * A renderable Game Object is one that uses a texture to render with, such as an + * Image, Sprite, Render Texture or BitmapText. + * + * If you do not provide a renderable object, and this Game Object has a texture, + * it will use itself as the object. This means you can call this method to create + * a Bitmap Mask from any renderable Game Object. + * @param renderable A renderable Game Object that uses a texture, such as a Sprite. + */ + createBitmapMask(renderable?: Phaser.GameObjects.GameObject): Phaser.Display.Masks.BitmapMask; + + /** + * Creates and returns a Geometry Mask. This mask can be used by any Game Object, + * including this one. + * + * To create the mask you need to pass in a reference to a Graphics Game Object. + * + * If you do not provide a graphics object, and this Game Object is an instance + * of a Graphics object, then it will use itself to create the mask. + * + * This means you can call this method to create a Geometry Mask from any Graphics Game Object. + * @param graphics A Graphics Game Object. The geometry within it will be used as the mask. + */ + createGeometryMask(graphics?: Phaser.GameObjects.Graphics): Phaser.Display.Masks.GeometryMask; + + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Does this Game Object have any Post Pipelines set? + */ + hasPostPipeline: boolean; + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + */ + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -19356,7 +22726,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -19371,7 +22741,7 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** * The x position of this Game Object. @@ -19423,7 +22793,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -19444,6 +22814,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -19518,6 +22894,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -19946,7 +23338,7 @@ declare namespace Phaser { /** * The tint applied to this Particle. */ - tint: integer; + tint: number; /** * The lifespan of this Particle in ms. @@ -20166,7 +23558,7 @@ declare namespace Phaser { scaleY: Phaser.GameObjects.Particles.EmitterOp; /** - * Color tint applied to emitted particles. Any alpha component (0xAA000000) is ignored. + * Color tint applied to emitted particles. Value must not include the alpha channel. */ tint: Phaser.GameObjects.Particles.EmitterOp; @@ -20214,7 +23606,7 @@ declare namespace Phaser { * Set to hard limit the amount of particle objects this emitter is allowed to create. * 0 means unlimited. */ - maxParticles: integer; + maxParticles: number; /** * How many particles are emitted each time particles are emitted (one explosion or one flow cycle). @@ -20304,7 +23696,7 @@ declare namespace Phaser { /** * The blend mode of this emitter's particles. */ - blendMode: integer; + blendMode: number; /** * A Game Object whose position is used as the particle origin. @@ -20325,7 +23717,7 @@ declare namespace Phaser { /** * The current texture frame, as an index of {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. */ - currentFrame: integer; + currentFrame: number; /** * Whether texture {@link Phaser.GameObjects.Particles.ParticleEmitter#frames} are selected at random. @@ -20335,7 +23727,7 @@ declare namespace Phaser { /** * The number of consecutive particles that receive a single texture frame (per frame cycle). */ - frameQuantity: integer; + frameQuantity: number; /** * Merges configuration settings into the emitter's current settings. @@ -20374,7 +23766,7 @@ declare namespace Phaser { * @param pickRandom Whether frames should be assigned at random from `frames`. Default true. * @param quantity The number of consecutive particles that will receive each frame. Default 1. */ - setFrame(frames: any[] | string | integer | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig, pickRandom?: boolean, quantity?: integer): this; + setFrame(frames: any[] | string | number | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig, pickRandom?: boolean, quantity?: number): this; /** * Turns {@link Phaser.GameObjects.Particles.ParticleEmitter#radial} particle movement on or off. @@ -20523,22 +23915,22 @@ declare namespace Phaser { * Creates inactive particles and adds them to this emitter's pool. * @param particleCount The number of particles to create. */ - reserve(particleCount: integer): this; + reserve(particleCount: number): this; /** * Gets the number of active (in-use) particles in this emitter. */ - getAliveParticleCount(): integer; + getAliveParticleCount(): number; /** * Gets the number of inactive (available) particles in this emitter. */ - getDeadParticleCount(): integer; + getDeadParticleCount(): number; /** * Gets the total number of particles in this emitter. */ - getParticleCount(): integer; + getParticleCount(): number; /** * Whether this emitter is at its limit (if set). @@ -20628,7 +24020,7 @@ declare namespace Phaser { * @param x The x coordinate to emit the Particles from. * @param y The y coordinate to emit the Particles from. */ - explode(count: integer, x: number, y: number): Phaser.GameObjects.Particles.Particle; + explode(count: number, x: number, y: number): Phaser.GameObjects.Particles.Particle; /** * Emits particles at a given position (or the emitter's current position). @@ -20636,7 +24028,7 @@ declare namespace Phaser { * @param y The y coordinate to emit the Particles from. Default this.x. * @param count The number of Particles to emit. Default this.quantity. */ - emitParticleAt(x?: number, y?: number, count?: integer): Phaser.GameObjects.Particles.Particle; + emitParticleAt(x?: number, y?: number, count?: number): Phaser.GameObjects.Particles.Particle; /** * Emits particles at a given position (or the emitter's current position). @@ -20644,21 +24036,21 @@ declare namespace Phaser { * @param x The x coordinate to emit the Particles from. Default this.x. * @param y The y coordinate to emit the Particles from. Default this.x. */ - emitParticle(count?: integer, x?: number, y?: number): Phaser.GameObjects.Particles.Particle; + emitParticle(count?: number, x?: number, y?: number): Phaser.GameObjects.Particles.Particle; /** * Updates this emitter and its particles. * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - preUpdate(time: integer, delta: number): void; + preUpdate(time: number, delta: number): void; /** * Calculates the difference of two particles, for sorting them by depth. * @param a The first particle. * @param b The second particle. */ - depthSortCallback(a: object, b: object): integer; + depthSortCallback(a: object, b: object): number; /** * Sets the Blend Mode being used by this Game Object. @@ -20716,6 +24108,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -20821,7 +24215,7 @@ declare namespace Phaser { * @param frame An optional frame from the Texture this Emitter Manager will use to render particles. * @param emitters Configuration settings for one or more emitters to create. */ - constructor(scene: Phaser.Scene, texture: string, frame?: string | integer, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]); + constructor(scene: Phaser.Scene, texture: string, frame?: string | number, emitters?: Phaser.Types.GameObjects.Particles.ParticleEmitterConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterConfig[]); /** * The time scale applied to all emitters and particles, affecting flow rate, lifespan, and movement. @@ -20862,7 +24256,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Emitter Manager will use to render with. @@ -20872,7 +24266,7 @@ declare namespace Phaser { * It can be either a string or an index. * @param frame The name or index of the frame within the Texture. */ - setFrame(frame?: string | integer): this; + setFrame(frame?: string | number): this; /** * Assigns texture frames to an emitter. @@ -20916,7 +24310,7 @@ declare namespace Phaser { * @param x The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location. * @param y The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. */ - emitParticle(count?: integer, x?: number, y?: number): this; + emitParticle(count?: number, x?: number, y?: number): this; /** * Emits particles from each active emitter. @@ -20924,7 +24318,7 @@ declare namespace Phaser { * @param y The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location. * @param count The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}. */ - emitParticleAt(x?: number, y?: number, count?: integer): this; + emitParticleAt(x?: number, y?: number, count?: number): this; /** * Pauses this Emitter Manager. @@ -20950,7 +24344,7 @@ declare namespace Phaser { * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - preUpdate(time: integer, delta: number): void; + preUpdate(time: number, delta: number): void; /** * The depth of this Game Object within the Scene. @@ -20977,7 +24371,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The Mask this Game Object is using during render. @@ -21011,6 +24405,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -21038,6 +24434,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -21047,22 +24445,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -21119,7 +24603,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -21140,6 +24624,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -21214,6 +24704,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -21287,7 +24793,7 @@ declare namespace Phaser { * @param yoyo Whether particles are placed from start to end and then end to start. Default false. * @param seamless Whether one endpoint will be removed if it's identical to the other. Default true. */ - constructor(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource, quantity: integer, stepRate: number, yoyo?: boolean, seamless?: boolean); + constructor(source: Phaser.Types.GameObjects.Particles.EdgeZoneSource, quantity: number, stepRate: number, yoyo?: boolean, seamless?: boolean); /** * An object instance with a `getPoints(quantity, stepRate)` method returning an array of points. @@ -21302,7 +24808,7 @@ declare namespace Phaser { /** * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. */ - quantity: integer; + quantity: number; /** * The distance between each particle. When set, `quantity` is implied and should be set to 0. @@ -21347,7 +24853,7 @@ declare namespace Phaser { } /** - * A zone that places particles randomly within a shape's area. + * A zone that places particles randomly within a shapes area. */ class RandomZone { /** @@ -21395,7 +24901,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - constructor(scene: Phaser.Scene, path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer); + constructor(scene: Phaser.Scene, path: Phaser.Curves.Path, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number); /** * If the PathFollower is rotating to match the Path (@see Phaser.GameObjects.PathFollower#rotateToPath) @@ -21437,7 +24943,7 @@ declare namespace Phaser { * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - protected preUpdate(time: integer, delta: number): void; + protected preUpdate(time: number, delta: number): void; /** * Clears all alpha values associated with this Game Object. @@ -21562,7 +25068,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -21738,6 +25244,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -21823,6 +25331,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -21832,22 +25342,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -22040,7 +25636,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -22055,10 +25651,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -22090,7 +25717,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -22113,40 +25740,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -22200,7 +25806,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -22221,6 +25827,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -22295,6 +25907,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -22387,165 +26015,37 @@ declare namespace Phaser { } /** - * A Quad Game Object. - * - * A Quad is a Mesh Game Object pre-configured with two triangles arranged into a rectangle, with a single - * texture spread across them. - * - * You can manipulate the corner points of the quad via the getters and setters such as `topLeftX`, and also - * change their alpha and color values. The quad itself can be moved by adjusting the `x` and `y` properties. + * TODO */ - class Quad extends Phaser.GameObjects.Mesh { + class PointLight extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** * - * @param scene The Scene to which this Quad belongs. + * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. * @param x The horizontal position of this Game Object in the world. * @param y The vertical position of this Game Object in the world. - * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. - * @param frame An optional frame from the Texture this Game Object is rendering with. */ - constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer); + constructor(scene: Phaser.Scene, x: number, y: number); /** - * Sets the frame this Game Object will use to render with. + * Clears all alpha values associated with this Game Object. * - * The Frame has to belong to the current Texture being used. + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * @param value The alpha value applied across the whole Game Object. Default 1. + */ + setAlpha(value?: number): this; + + /** + * The alpha value of the Game Object. * - * It can be either a string or an index. - * - * Calling `setFrame` will modify the `width` and `height` properties of your Game Object. - * It will also change the `origin` if the Frame has a custom pivot point, as exported from packages like Texture Packer. - * @param frame The name or index of the frame within the Texture. + * This is a global value, impacting the entire Game Object, not just a region of it. */ - setFrame(frame: string | integer): this; - - /** - * The top-left x vertex of this Quad. - */ - topLeftX: number; - - /** - * The top-left y vertex of this Quad. - */ - topLeftY: number; - - /** - * The top-right x vertex of this Quad. - */ - topRightX: number; - - /** - * The top-right y vertex of this Quad. - */ - topRightY: number; - - /** - * The bottom-left x vertex of this Quad. - */ - bottomLeftX: number; - - /** - * The bottom-left y vertex of this Quad. - */ - bottomLeftY: number; - - /** - * The bottom-right x vertex of this Quad. - */ - bottomRightX: number; - - /** - * The bottom-right y vertex of this Quad. - */ - bottomRightY: number; - - /** - * The top-left alpha value of this Quad. - */ - topLeftAlpha: number; - - /** - * The top-right alpha value of this Quad. - */ - topRightAlpha: number; - - /** - * The bottom-left alpha value of this Quad. - */ - bottomLeftAlpha: number; - - /** - * The bottom-right alpha value of this Quad. - */ - bottomRightAlpha: number; - - /** - * The top-left color value of this Quad. - */ - topLeftColor: number; - - /** - * The top-right color value of this Quad. - */ - topRightColor: number; - - /** - * The bottom-left color value of this Quad. - */ - bottomLeftColor: number; - - /** - * The bottom-right color value of this Quad. - */ - bottomRightColor: number; - - /** - * Sets the top-left vertex position of this Quad. - * @param x The horizontal coordinate of the vertex. - * @param y The vertical coordinate of the vertex. - */ - setTopLeft(x: number, y: number): this; - - /** - * Sets the top-right vertex position of this Quad. - * @param x The horizontal coordinate of the vertex. - * @param y The vertical coordinate of the vertex. - */ - setTopRight(x: number, y: number): this; - - /** - * Sets the bottom-left vertex position of this Quad. - * @param x The horizontal coordinate of the vertex. - * @param y The vertical coordinate of the vertex. - */ - setBottomLeft(x: number, y: number): this; - - /** - * Sets the bottom-right vertex position of this Quad. - * @param x The horizontal coordinate of the vertex. - * @param y The vertical coordinate of the vertex. - */ - setBottomRight(x: number, y: number): this; - - /** - * Resets the positions of the four corner vertices of this Quad. - */ - resetPosition(): this; - - /** - * Resets the alpha values used by this Quad back to 1. - */ - resetAlpha(): this; - - /** - * Resets the color values used by this Quad back to 0xffffff. - */ - resetColors(): this; - - /** - * Resets the position, alpha and color values used by this Quad. - */ - reset(): this; + alpha: number; /** * Sets the Blend Mode being used by this Game Object. @@ -22619,7 +26119,85 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; /** * The Mask this Game Object is using during render. @@ -22653,6 +26231,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -22680,6 +26260,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -22689,22 +26271,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -22712,97 +26380,63 @@ declare namespace Phaser { getPipelineName(): string; /** - * The native (un-scaled) width of this Game Object. + * The horizontal scroll factor of this Game Object. * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. */ - width: number; + scrollFactorX: number; /** - * The native (un-scaled) height of this Game Object. + * The vertical scroll factor of this Game Object. * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. */ - height: number; + scrollFactorY: number; /** - * The displayed width of this Game Object. + * Sets the scroll factor of this Game Object. * - * This value takes into account the scale factor. + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. * - * Setting this value will adjust the Game Object's scale property. + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the size of this Game Object to be that of the given Frame. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param frame The frame to base the size of this Game Object on. - */ - setSizeToFrame(frame: Phaser.Textures.Frame): this; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - - /** - * The Texture this Game Object is using to render with. - */ - texture: Phaser.Textures.Texture | Phaser.Textures.CanvasTexture; - - /** - * The Texture Frame this Game Object is using to render with. - */ - frame: Phaser.Textures.Frame; - - /** - * Sets the texture and frame this Game Object will use to render with. - * - * Textures are referenced by their string-based keys, as stored in the Texture Manager. - * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. - * @param frame The name or index of the frame within the Texture. - */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setScrollFactor(x: number, y?: number): this; /** * The x position of this Game Object. @@ -22854,7 +26488,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -22875,6 +26509,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -22949,6 +26589,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -22971,65 +26627,6 @@ declare namespace Phaser { */ setVisible(value: boolean): this; - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorX: number; - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorY: number; - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * @param x The horizontal scroll factor of this Game Object. - * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. - */ - setScrollFactor(x: number, y?: number): this; - } /** @@ -23053,7 +26650,7 @@ declare namespace Phaser { * @param width The width of the Render Texture. Default 32. * @param height The height of the Render Texture. Default 32. */ - constructor(scene: Phaser.Scene, x?: number, y?: number, width?: integer, height?: integer); + constructor(scene: Phaser.Scene, x?: number, y?: number, width?: number, height?: number); /** * A reference to either the Canvas or WebGL Renderer that the Game instance is using. @@ -23080,12 +26677,6 @@ declare namespace Phaser { */ canvas: HTMLCanvasElement; - /** - * A reference to the GL Frame Buffer this Render Texture is drawing to. - * This is only set if Phaser is running with the WebGL Renderer. - */ - framebuffer: WebGLFramebuffer; - /** * Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself. */ @@ -23114,14 +26705,13 @@ declare namespace Phaser { camera: Phaser.Cameras.Scene2D.BaseCamera; /** - * A reference to the WebGL Rendering Context. + * The Render Target that belongs to this Render Texture. + * + * A Render Target encapsulates a framebuffer and texture for the WebGL Renderer. + * + * This property remains `null` under Canvas. */ - gl: WebGLRenderingContext; - - /** - * A reference to the WebGLTexture that is being rendered to in a WebGL Context. - */ - readonly glTexture: WebGLTexture; + renderTarget: Phaser.Renderer.WebGL.RenderTarget; /** * Sets the size of this Game Object. @@ -23137,8 +26727,10 @@ declare namespace Phaser { * texture will not change. * * If Render Texture was not created from specific frame, the following will happen: + * * In WebGL it will destroy and then re-create the frame buffer being used by the Render Texture. * In Canvas it will resize the underlying canvas element. + * * Both approaches will erase everything currently drawn to the Render Texture. * * If the dimensions given are the same as those already being used, calling this method will do nothing. @@ -23151,7 +26743,7 @@ declare namespace Phaser { * Set the tint to use when rendering this Render Texture. * @param tint The tint value. */ - setGlobalTint(tint: integer): this; + setGlobalTint(tint: number): this; /** * Set the alpha to use when rendering this Render Texture. @@ -23182,6 +26774,10 @@ declare namespace Phaser { * By default it will create a single base texture. You can add frames to the texture * by using the `Texture.add` method. After doing this, you can then allow Game Objects * to use a specific frame from a Render Texture. + * + * If you destroy this Render Texture, any Game Object using it via the Texture Manager will + * stop rendering. Ensure you remove the texture from the Texture Manager and any Game Objects + * using it first, before destroying this Render Texture. * @param key The unique key to store the texture as within the global Texture Manager. */ saveTexture(key: string): Phaser.Textures.Texture; @@ -23317,7 +26913,194 @@ declare namespace Phaser { * @param alpha The alpha to use. If not specified it uses the `globalAlpha` property. * @param tint WebGL only. The tint color to use. If not specified it uses the `globalTint` property. */ - drawFrame(key: string, frame?: string | integer, x?: number, y?: number, alpha?: number, tint?: number): this; + drawFrame(key: string, frame?: string | number, x?: number, y?: number, alpha?: number, tint?: number): this; + + /** + * Use this method if you need to batch draw a large number of Game Objects to + * this Render Texture in a single go, or on a frequent basis. + * + * This method starts the beginning of a batched draw. + * + * It is faster than calling `draw`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of objects it's much safer and easier to use the `draw` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + */ + beginDraw(): this; + + /** + * Use this method if you have already called `beginDraw` and need to batch + * draw a large number of objects to this Render Texture. + * + * This method batches the drawing of the given objects to this Render Texture, + * without causing a bind or batch flush. + * + * It is faster than calling `draw`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of objects it's much safer and easier to use the `draw` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + * + * Draws the given object, or an array of objects, to this Render Texture. + * + * It can accept any of the following: + * + * * Any renderable Game Object, such as a Sprite, Text, Graphics or TileSprite. + * * Dynamic and Static Tilemap Layers. + * * A Group. The contents of which will be iterated and drawn in turn. + * * A Container. The contents of which will be iterated fully, and drawn in turn. + * * A Scene's Display List. Pass in `Scene.children` to draw the whole list. + * * Another Render Texture. + * * A Texture Frame instance. + * * A string. This is used to look-up a texture from the Texture Manager. + * + * Note: You cannot draw a Render Texture to itself. + * + * If passing in a Group or Container it will only draw children that return `true` + * when their `willRender()` method is called. I.e. a Container with 10 children, + * 5 of which have `visible=false` will only draw the 5 visible ones. + * + * If passing in an array of Game Objects it will draw them all, regardless if + * they pass a `willRender` check or not. + * + * You can pass in a string in which case it will look for a texture in the Texture + * Manager matching that string, and draw the base frame. If you need to specify + * exactly which frame to draw then use the method `drawFrame` instead. + * + * You can pass in the `x` and `y` coordinates to draw the objects at. The use of + * the coordinates differ based on what objects are being drawn. If the object is + * a Group, Container or Display List, the coordinates are _added_ to the positions + * of the children. For all other types of object, the coordinates are exact. + * + * The `alpha` and `tint` values are only used by Texture Frames. + * Game Objects use their own alpha and tint values when being drawn. + * @param entries Any renderable Game Object, or Group, Container, Display List, other Render Texture, Texture Frame or an array of any of these. + * @param x The x position to draw the Frame at, or the offset applied to the object. + * @param y The y position to draw the Frame at, or the offset applied to the object. + * @param alpha The alpha value. Only used for Texture Frames and if not specified defaults to the `globalAlpha` property. Game Objects use their own current alpha value. + * @param tint WebGL only. The tint color value. Only used for Texture Frames and if not specified defaults to the `globalTint` property. Game Objects use their own current tint value. + */ + batchDraw(entries: any, x?: number, y?: number, alpha?: number, tint?: number): this; + + /** + * Use this method if you have already called `beginDraw` and need to batch + * draw a large number of texture frames to this Render Texture. + * + * This method batches the drawing of the given frames to this Render Texture, + * without causing a bind or batch flush. + * + * It is faster than calling `drawFrame`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of frames it's much safer and easier to use the `drawFrame` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + * + * Draws the Texture Frame to the Render Texture at the given position. + * + * Textures are referenced by their string-based keys, as stored in the Texture Manager. + * + * ```javascript + * var rt = this.add.renderTexture(0, 0, 800, 600); + * rt.drawFrame(key, frame); + * ``` + * + * You can optionally provide a position, alpha and tint value to apply to the frame + * before it is drawn. + * + * Calling this method will cause a batch flush, so if you've got a stack of things to draw + * in a tight loop, try using the `draw` method instead. + * + * If you need to draw a Sprite to this Render Texture, use the `draw` method instead. + * @param key The key of the texture to be used, as stored in the Texture Manager. + * @param frame The name or index of the frame within the Texture. + * @param x The x position to draw the frame at. Default 0. + * @param y The y position to draw the frame at. Default 0. + * @param alpha The alpha to use. If not specified it uses the `globalAlpha` property. + * @param tint WebGL only. The tint color to use. If not specified it uses the `globalTint` property. + */ + batchDrawFrame(key: string, frame?: string | number, x?: number, y?: number, alpha?: number, tint?: number): this; + + /** + * Use this method to finish batch drawing to this Render Texture. + * + * Never call this method without first calling `beginDraw`. + * + * It is faster than calling `draw`, but you must be very careful to manage the + * flow of code and remember to call `endDraw()`. If you don't need to draw large + * numbers of objects it's much safer and easier to use the `draw` method instead. + * + * The flow should be: + * + * ```javascript + * // Call once: + * RenderTexture.beginDraw(); + * + * // repeat n times: + * RenderTexture.batchDraw(); + * // or + * RenderTexture.batchDrawFrame(); + * + * // Call once: + * RenderTexture.endDraw(); + * ``` + * + * Do not call any methods other than `batchDraw`, `batchDrawFrame`, or `endDraw` once you + * have started a batch. Also, be very careful not to destroy this Render Texture while the + * batch is still open, or call `beginDraw` again. + */ + endDraw(): this; /** * Takes a snapshot of the given area of this Render Texture. @@ -23338,7 +27121,7 @@ declare namespace Phaser { * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. */ - snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + snapshotArea(x: number, y: number, width: number, height: number, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; /** * Takes a snapshot of the whole of this Render Texture. @@ -23371,7 +27154,7 @@ declare namespace Phaser { * @param y The y coordinate of the pixel to get. * @param callback The Function to invoke after the snapshot pixel data is extracted. */ - snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + snapshotPixel(x: number, y: number, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; /** * Internal destroy handler, called as part of the destroy process. @@ -23582,7 +27365,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -23758,6 +27541,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -23843,6 +27628,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -23852,22 +27639,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -23934,7 +27807,38 @@ declare namespace Phaser { setScrollFactor(x: number, y?: number): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -23966,7 +27870,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -23989,40 +27893,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -24076,7 +27959,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -24097,6 +27980,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -24171,6 +28060,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -24220,12 +28125,12 @@ declare namespace Phaser { * @param colors An optional array containing the color data for this Rope. You should provide one color value per pair of vertices. * @param alphas An optional array containing the alpha data for this Rope. You should provide one alpha value per pair of vertices. */ - constructor(scene: Phaser.Scene, x?: number, y?: number, texture?: string, frame?: string | integer | null, points?: integer | Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]); + constructor(scene: Phaser.Scene, x?: number, y?: number, texture?: string, frame?: string | number | null, points?: number | Phaser.Types.Math.Vector2Like[], horizontal?: boolean, colors?: number[], alphas?: number[]); /** - * The Animation Controller of this Rope. + * The Animation State of this Rope. */ - anims: Phaser.GameObjects.Components.Animation; + anims: Phaser.Animations.AnimationState; /** * An array containing the points data for this Rope. @@ -24281,11 +28186,10 @@ declare namespace Phaser { /** * The tint fill mode. * - * 0 = An additive tint (the default), where vertices colors are blended with the texture. - * 1 = A fill tint, where the vertices colors replace the texture, but respects texture alpha. - * 2 = A complete tint, where the vertices colors replace the texture, including alpha, entirely. + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ - tintFill: integer; + tintFill: boolean; /** * If the Rope is marked as `dirty` it will automatically recalculate its vertices @@ -24339,7 +28243,7 @@ declare namespace Phaser { * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. * @param startFrame Optionally start the animation playing from this frame index. Default 0. */ - play(key: string, ignoreIfPlaying?: boolean, startFrame?: integer): this; + play(key: string, ignoreIfPlaying?: boolean, startFrame?: number): this; /** * Flags this Rope as being dirty. A dirty rope will recalculate all of its vertices data @@ -24357,7 +28261,7 @@ declare namespace Phaser { * @param colors Either a single color value, or an array of values. * @param alphas Either a single alpha value, or an array of values. */ - setHorizontal(points?: integer | Phaser.Types.Math.Vector2Like[], colors?: number | number[], alphas?: number | number[]): this; + setHorizontal(points?: number | Phaser.Types.Math.Vector2Like[], colors?: number | number[], alphas?: number | number[]): this; /** * Sets the alignment of the points in this Rope to be vertical, in a column format. @@ -24368,24 +28272,22 @@ declare namespace Phaser { * @param colors Either a single color value, or an array of values. * @param alphas Either a single alpha value, or an array of values. */ - setVertical(points?: integer | Phaser.Types.Math.Vector2Like[], colors?: number | number[], alphas?: number | number[]): this; + setVertical(points?: number | Phaser.Types.Math.Vector2Like[], colors?: number | number[], alphas?: number | number[]): this; /** * Sets the tint fill mode. * - * Mode 0 is an additive tint, the default, which blends the vertices colors with the texture. + * Mode 0 (`false`) is an additive tint, the default, which blends the vertices colors with the texture. * This mode respects the texture alpha. * - * Mode 1 is a fill tint. Unlike an additive tint, a fill-tint literally replaces the pixel colors + * Mode 1 (`true`) is a fill tint. Unlike an additive tint, a fill-tint literally replaces the pixel colors * from the texture with those in the tint. You can use this for effects such as making a player flash 'white' * if hit by something. This mode respects the texture alpha. * - * Mode 2 is a complete tint. The texture colors and alpha are replaced entirely by the vertices colors. - * * See the `setColors` method for details of how to color each of the vertices. - * @param value Set to 0 for an Additive tint, 1 for a fill tint with alpha, or 2 for a fill tint without alpha. Default 0. + * @param value Set to `false` for an Additive tint or `true` fill tint with alpha. Default false. */ - setTintFill(value?: integer): this; + setTintFill(value?: boolean): this; /** * Set the alpha values used by the Rope during rendering. @@ -24464,7 +28366,7 @@ declare namespace Phaser { * @param colors Either a single color value, or an array of values. * @param alphas Either a single alpha value, or an array of values. */ - setPoints(points?: integer | Phaser.Types.Math.Vector2Like[], colors?: number | number[], alphas?: number | number[]): this; + setPoints(points?: number | Phaser.Types.Math.Vector2Like[], colors?: number | number[], alphas?: number | number[]): this; /** * Updates all of the UVs based on the Rope.points and `flipX` and `flipY` settings. @@ -24476,7 +28378,7 @@ declare namespace Phaser { * given Rope segment total. * @param newSize The amount of segments to split the Rope in to. */ - resizeArrays(newSize: integer): this; + resizeArrays(newSize: number): this; /** * Updates the vertices based on the Rope points. @@ -24490,9 +28392,10 @@ declare namespace Phaser { /** * This method enables rendering of the Rope vertices to the given Graphics instance. * - * If you enable this feature, you must call `Graphics.clear()` in your Scene `update`, - * otherwise the Graphics instance will fill-in with draw calls. This is not done automatically - * to allow for you to debug render multiple Rope objects to a single Graphics instance. + * If you enable this feature, you **must** call `Graphics.clear()` in your Scene `update`, + * otherwise the Graphics instance you provide to debug will fill-up with draw calls, + * eventually crashing the browser. This is not done automatically to allow you to debug + * draw multiple Rope objects to a single Graphics instance. * * The Rope class has a built-in debug rendering callback `Rope.renderDebugVerts`, however * you can also provide your own callback to be used instead. Do this by setting the `callback` parameter. @@ -24522,7 +28425,7 @@ declare namespace Phaser { * @param meshLength The number of vertices in the mesh. * @param verts An array of translated vertex coordinates. */ - renderDebugVerts(src: Phaser.GameObjects.Rope, meshLength: integer, verts: number[]): void; + renderDebugVerts(src: Phaser.GameObjects.Rope, meshLength: number, verts: number[]): void; /** * The horizontally flipped state of the Game Object. @@ -24635,7 +28538,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Toggles the horizontal flipped state of this Game Object. @@ -24715,6 +28618,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -24742,6 +28647,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -24751,22 +28658,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -24864,7 +28857,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager, or a Texture instance. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string | Phaser.Textures.Texture, frame?: string | integer): this; + setTexture(key: string | Phaser.Textures.Texture, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -24879,7 +28872,7 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** * The x position of this Game Object. @@ -24931,7 +28924,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -24952,6 +28945,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -25026,6 +29025,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -25125,7 +29140,7 @@ declare namespace Phaser { * { * this.load.glsl('fire', 'shaders/fire.glsl.js'); * } - * + * * function create () * { * this.add.shader('fire', 400, 300, 512, 512); @@ -25361,7 +29376,7 @@ declare namespace Phaser { * @param textureIndex The texture index. Default 0. * @param textureData Additional texture data. */ - setSampler2DBuffer(uniformKey: string, texture: WebGLTexture, width: integer, height: integer, textureIndex?: integer, textureData?: any): this; + setSampler2DBuffer(uniformKey: string, texture: WebGLTexture, width: number, height: number, textureIndex?: number, textureData?: any): this; /** * Sets a sampler2D uniform on this shader. @@ -25375,7 +29390,7 @@ declare namespace Phaser { * @param textureIndex The texture index. Default 0. * @param textureData Additional texture data. */ - setSampler2D(uniformKey: string, textureKey: string, textureIndex?: integer, textureData?: any): this; + setSampler2D(uniformKey: string, textureKey: string, textureIndex?: number, textureData?: any): this; /** * Sets a property of a uniform already present on this shader. @@ -25551,7 +29566,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -25663,6 +29678,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -25855,7 +29872,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -25876,6 +29893,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -25950,6 +29973,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -26004,7 +30043,7 @@ declare namespace Phaser { * @param fillColor The color the arc will be filled with, i.e. 0xff0000 for red. * @param fillAlpha The alpha the arc will be filled with. You can also set the alpha of the overall Shape using its `alpha` property. */ - constructor(scene: Phaser.Scene, x?: number, y?: number, radius?: number, startAngle?: integer, endAngle?: integer, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number); + constructor(scene: Phaser.Scene, x?: number, y?: number, radius?: number, startAngle?: number, endAngle?: number, anticlockwise?: boolean, fillColor?: number, fillAlpha?: number); /** * The number of iterations used when drawing the arc. @@ -26021,12 +30060,12 @@ declare namespace Phaser { /** * The start angle of the arc, in degrees. */ - startAngle: integer; + startAngle: number; /** * The end angle of the arc, in degrees. */ - endAngle: integer; + endAngle: number; /** * The winding order of the start and end angles. @@ -26054,14 +30093,14 @@ declare namespace Phaser { * This call can be chained. * @param value The value to set the starting angle to. */ - setStartAngle(value: integer): this; + setStartAngle(value: number): this; /** * Sets the ending angle of the arc, in degrees. * This call can be chained. * @param value The value to set the ending angle to. */ - setEndAngle(value: integer): this; + setEndAngle(value: number): this; /** * Clears all alpha values associated with this Game Object. @@ -26131,66 +30170,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -26216,7 +30195,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -26328,6 +30307,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -26413,6 +30394,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -26422,22 +30405,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -26553,7 +30622,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -26574,6 +30643,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -26648,6 +30723,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -26704,7 +30795,7 @@ declare namespace Phaser { * The smoothness of the curve. The number of points used when rendering it. * Increase this value for smoother curves, at the cost of more polygons being rendered. */ - smoothness: integer; + smoothness: number; /** * Sets the smoothness of the curve. The number of points used when rendering it. @@ -26712,7 +30803,7 @@ declare namespace Phaser { * This call can be chained. * @param value The value to set the smoothness to. */ - setSmoothness(value: integer): this; + setSmoothness(value: number): this; /** * Clears all alpha values associated with this Game Object. @@ -26782,66 +30873,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -26867,7 +30898,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -26979,6 +31010,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -27064,6 +31097,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -27073,22 +31108,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -27204,7 +31325,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -27225,6 +31346,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -27299,6 +31426,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -27357,7 +31500,7 @@ declare namespace Phaser { * The smoothness of the ellipse. The number of points used when rendering it. * Increase this value for a smoother ellipse, at the cost of more polygons being rendered. */ - smoothness: integer; + smoothness: number; /** * Sets the size of the ellipse by changing the underlying geometry data, rather than scaling the object. @@ -27373,7 +31516,7 @@ declare namespace Phaser { * This call can be chained. * @param value The value to set the smoothness to. */ - setSmoothness(value: integer): this; + setSmoothness(value: number): this; /** * Clears all alpha values associated with this Game Object. @@ -27443,51 +31586,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -27513,7 +31611,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -27625,6 +31723,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -27710,6 +31810,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -27719,22 +31821,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -27850,7 +32038,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -27871,6 +32059,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -27945,6 +32139,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -28053,7 +32263,7 @@ declare namespace Phaser { /** * Sets the fill color and alpha level the grid cells will use when rendering. * - * If this method is called with no values then the grid cells will not be rendered, + * If this method is called with no values then the grid cells will not be rendered, * however the grid lines and alternating cells may still be. * * Also see the `setOutlineStyle` and `setAltFillStyle` methods. @@ -28159,66 +32369,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -28244,7 +32394,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -28356,6 +32506,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -28441,6 +32593,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -28450,22 +32604,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -28581,7 +32821,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -28602,6 +32842,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -28676,6 +32922,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -28732,7 +32994,7 @@ declare namespace Phaser { /** * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. */ - projection: integer; + projection: number; /** * The color used to fill in the top of the iso box. @@ -28769,7 +33031,7 @@ declare namespace Phaser { * This call can be chained. * @param value The value to set the projection to. */ - setProjection(value: integer): this; + setProjection(value: number): this; /** * Sets which faces of the iso box will be rendered. @@ -28857,66 +33119,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -28942,7 +33144,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -29054,6 +33256,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -29139,6 +33343,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -29148,22 +33354,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -29279,7 +33571,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -29300,6 +33592,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -29374,6 +33672,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -29432,7 +33746,7 @@ declare namespace Phaser { /** * The projection level of the iso box. Change this to change the 'angle' at which you are looking at the box. */ - projection: integer; + projection: number; /** * The color used to fill in the top of the iso triangle. This is only used if the triangle is reversed. @@ -29474,7 +33788,7 @@ declare namespace Phaser { * This call can be chained. * @param value The value to set the projection to. */ - setProjection(value: integer): this; + setProjection(value: number): this; /** * Sets if the iso triangle will be rendered upside down or not. @@ -29569,66 +33883,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -29654,7 +33908,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -29766,6 +34020,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -29851,6 +34107,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -29860,22 +34118,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -29991,7 +34335,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -30012,6 +34356,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -30086,6 +34436,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -30237,66 +34603,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -30322,7 +34628,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -30434,6 +34740,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -30519,6 +34827,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -30528,22 +34838,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -30659,7 +35055,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -30680,6 +35076,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -30754,6 +35156,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -30816,7 +35234,7 @@ declare namespace Phaser { * This call can be chained. * @param iterations The number of times to apply the polygon smoothing. Default 1. */ - smooth(iterations?: integer): this; + smooth(iterations?: number): this; /** * Clears all alpha values associated with this Game Object. @@ -30886,66 +35304,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -30971,7 +35329,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -31083,6 +35441,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -31168,6 +35528,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -31177,22 +35539,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -31308,7 +35756,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -31329,6 +35777,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -31403,6 +35857,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -31450,6 +35920,21 @@ declare namespace Phaser { */ constructor(scene: Phaser.Scene, x: number, y: number, width?: number, height?: number, fillColor?: number, fillAlpha?: number); + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + /** * Clears all alpha values associated with this Game Object. * @@ -31518,66 +36003,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -31603,7 +36028,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -31715,6 +36140,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -31800,6 +36227,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -31809,22 +36238,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -31940,7 +36455,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -31961,6 +36476,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -32035,6 +36556,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -32063,7 +36600,7 @@ declare namespace Phaser { * The Shape Game Object is a base class for the various different shapes, such as the Arc, Star or Polygon. * You cannot add a Shape directly to your Scene, it is meant as a base for your own custom Shape classes. */ - class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + class Shape extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.AlphaSingle, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Mask, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. @@ -32086,7 +36623,7 @@ declare namespace Phaser { /** * Holds the earcut polygon path index data for filled rendering. */ - readonly pathIndexes: integer[]; + readonly pathIndexes: number[]; /** * The fill color used by this Shape. @@ -32131,6 +36668,24 @@ declare namespace Phaser { */ closePath: boolean; + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + /** * Sets the fill color and alpha for this Shape. * @@ -32172,6 +36727,24 @@ declare namespace Phaser { */ protected preDestroy(): void; + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + /** * Clears all alpha values associated with this Game Object. * @@ -32240,66 +36813,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -32325,7 +36838,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -32437,6 +36950,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -32522,6 +37037,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -32531,22 +37048,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -32662,7 +37265,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -32683,6 +37286,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -32757,6 +37366,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -32816,7 +37441,7 @@ declare namespace Phaser { * This call can be chained. * @param value The amount of points the Star will have. */ - setPoints(value: integer): this; + setPoints(value: number): this; /** * Sets the inner radius of the Star shape. @@ -32835,7 +37460,7 @@ declare namespace Phaser { /** * The number of points that make up the Star shape. */ - points: integer; + points: number; /** * The inner radius of the Star shape. @@ -32915,66 +37540,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -33000,7 +37565,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -33112,6 +37677,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -33197,6 +37764,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -33206,22 +37775,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -33337,7 +37992,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -33358,6 +38013,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -33432,6 +38093,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -33564,66 +38241,6 @@ declare namespace Phaser { */ setBlendMode(value: string | Phaser.BlendModes): this; - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - /** * The depth of this Game Object within the Scene. * @@ -33649,7 +38266,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -33761,6 +38378,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -33846,6 +38465,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -33855,22 +38476,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -33986,7 +38693,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -34007,6 +38714,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -34081,6 +38794,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -34125,12 +38854,16 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer); + constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number); /** - * The Animation Controller of this Sprite. + * The Animation State component of this Sprite. + * + * This component provides features to apply animations to this Sprite. + * It is responsible for playing, loading, queuing animations for later playback, + * mixing between animations and setting the current animation frame to this Sprite. */ - anims: Phaser.GameObjects.Components.Animation; + anims: Phaser.Animations.AnimationState; /** * Update this Sprite's animations. @@ -34140,12 +38873,223 @@ declare namespace Phaser { protected preUpdate(time: number, delta: number): void; /** - * Start playing the given animation. - * @param key The string-based key of the animation to play. + * Start playing the given animation on this Sprite. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).play('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).play({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. - * @param startFrame Optionally start the animation playing from this frame index. Default 0. */ - play(key: string, ignoreIfPlaying?: boolean, startFrame?: integer): this; + play(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, ignoreIfPlaying?: boolean): this; + + /** + * Start playing the given animation on this Sprite, in reverse. + * + * Animations in Phaser can either belong to the global Animation Manager, or specifically to this Sprite. + * + * The benefit of a global animation is that multiple Sprites can all play the same animation, without + * having to duplicate the data. You can just create it once and then play it on any Sprite. + * + * The following code shows how to create a global repeating animation. The animation will be created + * from all of the frames within the sprite sheet that was loaded with the key 'muybridge': + * + * ```javascript + * var config = { + * key: 'run', + * frames: 'muybridge', + * frameRate: 15, + * repeat: -1 + * }; + * + * // This code should be run from within a Scene: + * this.anims.create(config); + * ``` + * + * However, if you wish to create an animation that is unique to this Sprite, and this Sprite alone, + * you can call the `Animation.create` method instead. It accepts the exact same parameters as when + * creating a global animation, however the resulting data is kept locally in this Sprite. + * + * With the animation created, either globally or locally, you can now play it on this Sprite: + * + * ```javascript + * this.add.sprite(x, y).playReverse('run'); + * ``` + * + * Alternatively, if you wish to run it at a different frame rate, for example, you can pass a config + * object instead: + * + * ```javascript + * this.add.sprite(x, y).playReverse({ key: 'run', frameRate: 24 }); + * ``` + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * If you need a Sprite to be able to play both local and global animations, make sure they don't + * have conflicting keys. + * + * See the documentation for the `PlayAnimationConfig` config object for more details about this. + * + * Also, see the documentation in the Animation Manager for further details on creating animations. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param ignoreIfPlaying If an animation is already playing then ignore this call. Default false. + */ + playReverse(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, ignoreIfPlaying?: boolean): this; + + /** + * Waits for the specified delay, in milliseconds, then starts playback of the given animation. + * + * If the animation _also_ has a delay value set in its config, it will be **added** to the delay given here. + * + * If an animation is already running and a new animation is given to this method, it will wait for + * the given delay before starting the new animation. + * + * If no animation is currently running, the given one begins after the delay. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * + * Prior to Phaser 3.50 this method was called 'delayedPlay'. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param delay The delay, in milliseconds, to wait before starting the animation playing. + */ + playAfterDelay(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, delay: number): this; + + /** + * Waits for the current animation to complete the `repeatCount` number of repeat cycles, then starts playback + * of the given animation. + * + * You can use this to ensure there are no harsh jumps between two sets of animations, i.e. going from an + * idle animation to a walking animation, by making them blend smoothly into each other. + * + * If no animation is currently running, the given one will start immediately. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object. + * @param repeatCount How many times should the animation repeat before the next one starts? Default 1. + */ + playAfterRepeat(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig, repeatCount?: number): this; + + /** + * Sets an animation, or an array of animations, to be played immediately after the current one completes or stops. + * + * The current animation must enter a 'completed' state for this to happen, i.e. finish all of its repeats, delays, etc, + * or have the `stop` method called directly on it. + * + * An animation set to repeat forever will never enter a completed state. + * + * You can chain a new animation at any point, including before the current one starts playing, during it, + * or when it ends (via its `animationcomplete` event). + * + * Chained animations are specific to a Game Object, meaning different Game Objects can have different chained + * animations without impacting the animation they're playing. + * + * Call this method with no arguments to reset all currently chained animations. + * + * When playing an animation on a Sprite it will first check to see if it can find a matching key + * locally within the Sprite. If it can, it will play the local animation. If not, it will then + * search the global Animation Manager and look for it there. + * @param key The string-based key of the animation to play, or an Animation instance, or a `PlayAnimationConfig` object, or an array of them. + */ + chain(key: string | Phaser.Animations.Animation | Phaser.Types.Animations.PlayAnimationConfig | string[] | Phaser.Animations.Animation[] | Phaser.Types.Animations.PlayAnimationConfig[]): this; + + /** + * Immediately stops the current animation from playing and dispatches the `ANIMATION_STOP` events. + * + * If no animation is playing, no event will be dispatched. + * + * If there is another animation queued (via the `chain` method) then it will start playing immediately. + */ + stop(): this; + + /** + * Stops the current animation from playing after the specified time delay, given in milliseconds. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * @param delay The number of milliseconds to wait before stopping this animation. + */ + stopAfterDelay(delay: number): this; + + /** + * Stops the current animation from playing after the given number of repeats. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * @param repeatCount How many times should the animation repeat before stopping? Default 1. + */ + stopAfterRepeat(repeatCount?: number): this; + + /** + * Stops the current animation from playing when it next sets the given frame. + * If this frame doesn't exist within the animation it will not stop it from playing. + * + * It then dispatches the `ANIMATION_STOP` event. + * + * If no animation is running, no events will be dispatched. + * + * If there is another animation in the queue (set via the `chain` method) then it will start playing, + * when the current one stops. + * @param frame The frame to check before stopping this animation. + */ + stopOnFrame(frame: Phaser.Animations.AnimationFrame): this; /** * Build a JSON representation of this Sprite. @@ -34275,7 +39219,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -34451,6 +39395,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -34536,6 +39482,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -34545,22 +39493,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -34753,7 +39787,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -34768,10 +39802,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -34803,7 +39868,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -34826,40 +39891,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -34913,7 +39957,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -34934,6 +39978,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -35008,6 +40058,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -35032,6 +40098,20 @@ declare namespace Phaser { } + /** + * Returns an object containing dimensions of the Text object. + * @param text The Text object to calculate the size from. + * @param size The Text metrics to use when calculating the size. + * @param lines The lines of text to calculate the size from. + */ + function GetTextSize(text: Phaser.GameObjects.Text, size: Phaser.Types.GameObjects.Text.TextMetrics, lines: string[]): Phaser.Types.GameObjects.Text.GetTextSizeObject; + + /** + * Calculates the ascent, descent and fontSize of a given font style. + * @param textStyle The TextStyle object to measure. + */ + function MeasureText(textStyle: Phaser.GameObjects.TextStyle): Phaser.Types.GameObjects.Text.TextMetrics; + /** * A Text Game Object. * @@ -35079,20 +40159,6 @@ declare namespace Phaser { */ constructor(scene: Phaser.Scene, x: number, y: number, text: string | string[], style: Phaser.Types.GameObjects.Text.TextStyle); - /** - * Returns an object containing dimensions of the Text object. - * @param text The Text object to calculate the size from. - * @param size The Text metrics to use when calculating the size. - * @param lines The lines of text to calculate the size from. - */ - static GetTextSize(text: Phaser.GameObjects.Text, size: Phaser.Types.GameObjects.Text.TextMetrics, lines: any[]): object; - - /** - * Calculates the ascent, descent and fontSize of a given font style. - * @param textStyle The TextStyle object to measure. - */ - static MeasureText(textStyle: Phaser.GameObjects.TextStyle): Phaser.Types.GameObjects.Text.TextMetrics; - /** * The renderer in use by this Text object. */ @@ -35131,7 +40197,7 @@ declare namespace Phaser { * Specify a padding value which is added to the line width and height when calculating the Text size. * Allows you to add extra spacing if the browser is unable to accurately determine the true font dimensions. */ - padding: Object; + padding: Phaser.Types.GameObjects.Text.TextPadding; /** * The width of this Text object. @@ -35412,13 +40478,13 @@ declare namespace Phaser { * @param right The right padding value. * @param bottom The bottom padding value. */ - setPadding(left: number | Phaser.Types.GameObjects.Text.TextPadding, top: number, right: number, bottom: number): this; + setPadding(left: number | Phaser.Types.GameObjects.Text.TextPadding, top?: number, right?: number, bottom?: number): this; /** * Set the maximum number of lines to draw. * @param max The maximum number of lines to draw. Default 0. */ - setMaxLines(max?: integer): this; + setMaxLines(max?: number): this; /** * Update the displayed text. @@ -35656,7 +40722,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -35832,6 +40898,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -35917,6 +40985,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -35926,22 +40996,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -36008,7 +41164,38 @@ declare namespace Phaser { setScrollFactor(x: number, y?: number): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -36040,7 +41227,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -36063,40 +41250,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -36150,7 +41316,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -36171,6 +41337,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -36245,6 +41417,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -36362,7 +41550,7 @@ declare namespace Phaser { /** * The maximum number of lines to draw. */ - maxLines: integer; + maxLines: number; /** * The fixed width of the text. @@ -36635,7 +41823,7 @@ declare namespace Phaser { * Set the maximum number of lines to draw. * @param max The maximum number of lines to draw. Default 0. */ - setMaxLines(max?: integer): Phaser.GameObjects.Text; + setMaxLines(max?: number): Phaser.GameObjects.Text; /** * Get the current text metrics. @@ -36662,7 +41850,7 @@ declare namespace Phaser { * * You shouldn't ever create a TileSprite any larger than your actual canvas size. If you want to create a large repeating background * that scrolls across the whole map of your game, then you create a TileSprite that fits the canvas size and then use the `tilePosition` - * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will + * property to scroll the texture as the player moves. If you create a TileSprite that is thousands of pixels in size then it will * consume huge amounts of memory and cause performance issues. Remember: use `tilePosition` to scroll your texture and `tileScale` to * adjust the scale of the texture - don't resize the sprite itself or make it larger than it needs. * @@ -36687,7 +41875,7 @@ declare namespace Phaser { * @param textureKey The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frameKey An optional frame from the Texture this Game Object is rendering with. */ - constructor(scene: Phaser.Scene, x: number, y: number, width: integer, height: integer, textureKey: string, frameKey?: string | integer); + constructor(scene: Phaser.Scene, x: number, y: number, width: number, height: number, textureKey: string, frameKey?: string | number); /** * Whether the Tile Sprite has changed in some way, requiring an re-render of its tile texture. @@ -36726,12 +41914,12 @@ declare namespace Phaser { /** * The next power of two value from the width of the Fill Pattern frame. */ - potWidth: integer; + potWidth: number; /** * The next power of two value from the height of the Fill Pattern frame. */ - potHeight: integer; + potHeight: number; /** * The Canvas that the TileSprites texture is rendered to. @@ -36757,7 +41945,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -36767,7 +41955,7 @@ declare namespace Phaser { * It can be either a string or an index. * @param frame The name or index of the frame within the Texture. */ - setFrame(frame: string | integer): this; + setFrame(frame: string | number): this; /** * Sets {@link Phaser.GameObjects.TileSprite#tilePositionX} and {@link Phaser.GameObjects.TileSprite#tilePositionY}. @@ -37027,7 +42215,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -37203,6 +42391,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -37288,6 +42478,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -37297,22 +42489,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -37379,7 +42657,38 @@ declare namespace Phaser { setScrollFactor(x: number, y?: number): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -37411,7 +42720,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -37434,40 +42743,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -37521,7 +42809,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -37542,6 +42830,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -37616,6 +42910,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -37717,7 +43027,7 @@ declare namespace Phaser { * * Videos can only autoplay if the browser has been unlocked with an interaction, or satisfies the MEI settings. * The policies that control autoplaying are vast and vary between browser. - * You can, ahd should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide + * You can, and should, read more about it here: https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide * * If your video doesn't contain any audio, then set the `noAudio` parameter to `true` when the video is _loaded_, * and it will often allow the video to play immediately: @@ -37797,17 +43107,17 @@ declare namespace Phaser { * The `setTimeout` happens once every `Video.retryInterval` ms. It will carry on monitoring the video * state in this manner until the `retryLimit` is reached and then abort. */ - retryLimit: integer; + retryLimit: number; /** * The current retry attempt. */ - retry: integer; + retry: number; /** * The number of ms between each retry while monitoring the ready state of a downloading video. */ - retryInterval: integer; + retryInterval: number; /** * An object containing in and out markers for sequence playback. @@ -37848,7 +43158,7 @@ declare namespace Phaser { * @param markerIn Optional in marker time, in seconds, for playback of a sequence of the video. * @param markerOut Optional out marker time, in seconds, for playback of a sequence of the video. */ - play(loop?: boolean, markerIn?: integer, markerOut?: integer): this; + play(loop?: boolean, markerIn?: number, markerOut?: number): this; /** * This method allows you to change the source of the current video element. It works by first stopping the @@ -37864,7 +43174,7 @@ declare namespace Phaser { * @param markerIn Optional in marker time, in seconds, for playback of a sequence of the video. * @param markerOut Optional out marker time, in seconds, for playback of a sequence of the video. */ - changeSource(key: string, autoplay?: boolean, loop?: boolean, markerIn?: integer, markerOut?: integer): this; + changeSource(key: string, autoplay?: boolean, loop?: boolean, markerIn?: number, markerOut?: number): this; /** * Adds a sequence marker to this video. @@ -37881,7 +43191,7 @@ declare namespace Phaser { * @param markerIn The time, in seconds, representing the start of this marker. * @param markerOut The time, in seconds, representing the end of this marker. */ - addMarker(key: string, markerIn: integer, markerOut: integer): this; + addMarker(key: string, markerIn: number, markerOut: number): this; /** * Plays a pre-defined sequence in this video. @@ -37915,7 +43225,7 @@ declare namespace Phaser { * @param width The width of the resulting CanvasTexture. * @param height The height of the resulting CanvasTexture. */ - snapshot(width?: integer, height?: integer): Phaser.Textures.CanvasTexture; + snapshot(width?: number, height?: number): Phaser.Textures.CanvasTexture; /** * Takes a snapshot of the specified area of the current frame of the video and renders it to a CanvasTexture object, @@ -37930,7 +43240,7 @@ declare namespace Phaser { * @param destWidth The destination width of the grab, allowing you to resize it. * @param destHeight The destination height of the grab, allowing you to resize it. */ - snapshotArea(x?: integer, y?: integer, srcWidth?: integer, srcHeight?: integer, destWidth?: integer, destHeight?: integer): Phaser.Textures.CanvasTexture; + snapshotArea(x?: number, y?: number, srcWidth?: number, srcHeight?: number, destWidth?: number, destHeight?: number): Phaser.Textures.CanvasTexture; /** * Stores a copy of this Videos `snapshotTexture` in the Texture Manager using the given key. @@ -37974,6 +43284,18 @@ declare namespace Phaser { */ loadURL(url: string, loadEvent?: string, noAudio?: boolean): this; + /** + * Loads a Video from the given MediaStream object, ready for playback with the `Video.play` method. + * + * You can control at what point the browser determines the video as being ready for playback via + * the `loadEvent` parameter. See https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement + * for more details. + * @param stream The MediaStream object. + * @param loadEvent The load event to listen for. Either `loadeddata`, `canplay` or `canplaythrough`. Default 'loadeddata'. + * @param noAudio Does the video have an audio track? If not you can enable auto-playing on it. Default false. + */ + loadMediaStream(stream: string, loadEvent?: string, noAudio?: boolean): this; + /** * Called when the video emits a `playing` event during load. * @@ -38319,7 +43641,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -38486,6 +43808,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -38571,6 +43895,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -38580,22 +43906,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -38788,7 +44200,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -38803,10 +44215,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -38838,7 +44281,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -38861,40 +44304,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -38948,7 +44370,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -38969,6 +44391,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -39043,6 +44471,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -39105,7 +44549,7 @@ declare namespace Phaser { * Although a Zone never renders, it still has a blend mode to allow it to fit seamlessly into * display lists without causing a batch flush. */ - blendMode: integer; + blendMode: number; /** * The displayed width of this Game Object. @@ -39152,10 +44596,10 @@ declare namespace Phaser { /** * Allows you to define your own Geometry shape to be used as a Drop Zone. - * @param shape A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. - * @param callback A function that will return `true` if the given x/y coords it is sent are within the shape. + * @param hitArea A Geometry shape instance, such as Phaser.Geom.Ellipse, or your own custom shape. + * @param hitAreaCallback A function that will return `true` if the given x/y coords it is sent are within the shape. */ - setDropZone(shape: object, callback: Phaser.Types.Input.HitAreaCallback): this; + setDropZone(hitArea: object, hitAreaCallback: Phaser.Types.Input.HitAreaCallback): this; /** * The depth of this Game Object within the Scene. @@ -39182,7 +44626,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * Gets the center coordinate of this Game Object, regardless of origin. @@ -39370,7 +44814,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -39391,6 +44835,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -39465,6 +44915,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -39577,7 +45043,7 @@ declare namespace Phaser { * The geometry constant type of this object: `GEOM_CONST.CIRCLE`. * Used for fast type comparisons. */ - readonly type: integer; + readonly type: number; /** * The x position of the center of the circle. @@ -39612,7 +45078,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param output An array to insert the points in to. If not provided a new array will be created. */ - getPoints(quantity: integer, stepRate?: number, output?: O): O; + getPoints(quantity: number, stepRate?: number, output?: O): O; /** * Returns a uniformly distributed random point from anywhere within the Circle. @@ -39759,7 +45225,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the circumference of the circle and dividing it by the stepRate. * @param output An array to insert the points in to. If not provided a new array will be created. */ - static GetPoints(circle: Phaser.Geom.Circle, quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + static GetPoints(circle: Phaser.Geom.Circle, quantity: number, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; /** * Offsets the Circle by the values given. @@ -39788,37 +45254,37 @@ declare namespace Phaser { /** * A Circle Geometry object type. */ - var CIRCLE: integer; + var CIRCLE: number; /** * An Ellipse Geometry object type. */ - var ELLIPSE: integer; + var ELLIPSE: number; /** * A Line Geometry object type. */ - var LINE: integer; + var LINE: number; /** * A Point Geometry object type. */ - var POINT: integer; + var POINT: number; /** * A Polygon Geometry object type. */ - var POLYGON: integer; + var POLYGON: number; /** * A Rectangle Geometry object type. */ - var RECTANGLE: integer; + var RECTANGLE: number; /** * A Triangle Geometry object type. */ - var TRIANGLE: integer; + var TRIANGLE: number; /** * An Ellipse object. @@ -39897,7 +45363,7 @@ declare namespace Phaser { * The geometry constant type of this object: `GEOM_CONST.ELLIPSE`. * Used for fast type comparisons. */ - readonly type: integer; + readonly type: number; /** * The x position of the center of the ellipse. @@ -39942,7 +45408,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param output An array to insert the points in to. If not provided a new array will be created. */ - getPoints(quantity: integer, stepRate?: number, output?: O): O; + getPoints(quantity: number, stepRate?: number, output?: O): O; /** * Returns a uniformly distributed random point from anywhere within the given Ellipse. @@ -40048,7 +45514,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the circumference of the ellipse and dividing it by the stepRate. * @param out An array to insert the points in to. If not provided a new array will be created. */ - static GetPoints(ellipse: Phaser.Geom.Ellipse, quantity: integer, stepRate?: number, out?: O): O; + static GetPoints(ellipse: Phaser.Geom.Ellipse, quantity: number, stepRate?: number, out?: O): O; /** * Offsets the Ellipse by the values given. @@ -40115,6 +45581,50 @@ declare namespace Phaser { */ function GetLineToCircle(line: Phaser.Geom.Line, circle: Phaser.Geom.Circle, out?: any[]): any[]; + /** + * Checks for intersection between the two line segments and returns the intersection point as a Vector3, + * or `null` if the lines are parallel, or do not intersect. + * + * The `z` property of the Vector3 contains the intersection distance, which can be used to find + * the closest intersecting point from a group of line segments. + * @param line1 The first line segment to check. + * @param line2 The second line segment to check. + * @param out A Vector3 to store the intersection results in. + */ + function GetLineToLine(line1: Phaser.Geom.Line, line2: Phaser.Geom.Line, out?: Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Checks for the closest point of intersection between a line segment and an array of points, where each pair + * of points are converted to line segments for the intersection tests. + * + * If no intersection is found, this function returns `null`. + * + * If intersection was found, a Vector3 is returned with the following properties: + * + * The `x` and `y` components contain the point of the intersection. + * The `z` component contains the closest distance. + * @param line The line segment to check. + * @param points An array of points to check. + * @param out A Vector3 to store the intersection results in. + */ + function GetLineToPoints(line: Phaser.Geom.Line, points: Phaser.Math.Vector2[] | Phaser.Geom.Point[], out?: Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Checks for the closest point of intersection between a line segment and an array of polygons. + * + * If no intersection is found, this function returns `null`. + * + * If intersection was found, a Vector4 is returned with the following properties: + * + * The `x` and `y` components contain the point of the intersection. + * The `z` component contains the closest distance. + * The `w` component contains the index of the polygon, in the given array, that triggered the intersection. + * @param line The line segment to check. + * @param polygons A single polygon, or array of polygons, to check. + * @param out A Vector4 to store the intersection results in. + */ + function GetLineToPolygon(line: Phaser.Geom.Line, polygons: Phaser.Geom.Polygon | Phaser.Geom.Polygon[], out?: Phaser.Math.Vector4): Phaser.Math.Vector4; + /** * Checks for intersection between the Line and a Rectangle shape, * and returns the intersection points as a Point object array. @@ -40124,6 +45634,24 @@ declare namespace Phaser { */ function GetLineToRectangle(line: Phaser.Geom.Line, rect: Phaser.Geom.Rectangle | object, out?: any[]): any[]; + /** + * Projects rays out from the given point to each line segment of the polygons. + * + * If the rays intersect with the polygons, the points of intersection are returned in an array. + * + * If no intersections are found, the returned array will be empty. + * + * Each Vector4 intersection result has the following properties: + * + * The `x` and `y` components contain the point of the intersection. + * The `z` component contains the angle of intersection. + * The `w` component contains the index of the polygon, in the given array, that triggered the intersection. + * @param x The x coordinate to project the rays from. + * @param y The y coordinate to project the rays from. + * @param polygons A single polygon, or array of polygons, to check against the rays. + */ + function GetRaysFromPointToPolygon(x: number, y: number, polygons: Phaser.Geom.Polygon | Phaser.Geom.Polygon[]): Phaser.Math.Vector4[]; + /** * Checks if two Rectangle shapes intersect and returns the area of this intersection as Rectangle object. * @@ -40320,7 +45848,7 @@ declare namespace Phaser { * @param stepRate The optional step rate for the points on the line. Default 1. * @param results An optional array to push the resulting coordinates into. */ - static BresenhamPoints(line: Phaser.Geom.Line, stepRate?: integer, results?: Phaser.Types.Math.Vector2Like[]): Phaser.Types.Math.Vector2Like[]; + static BresenhamPoints(line: Phaser.Geom.Line, stepRate?: number, results?: Phaser.Types.Math.Vector2Like[]): Phaser.Types.Math.Vector2Like[]; /** * Center a line on the given coordinates. @@ -40392,7 +45920,7 @@ declare namespace Phaser { * @param collinearThreshold An optional threshold. The final array is reduced so that each point is spaced out at least this distance apart. This helps reduce clustering in noisey eases. Default 0. * @param easeParams An optional array of ease parameters to go with the ease. */ - static GetEasedPoints(line: Phaser.Geom.Line, ease: string | Function, quantity: integer, collinearThreshold?: number, easeParams?: number[]): O; + static GetEasedPoints(line: Phaser.Geom.Line, ease: string | Function, quantity: number, collinearThreshold?: number, easeParams?: number[]): O; /** * Get the midpoint of the given line. @@ -40438,7 +45966,7 @@ declare namespace Phaser { * @param stepRate The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param out An optional array of Points, or point-like objects, to store the coordinates of the points on the line. */ - static GetPoints(line: Phaser.Geom.Line, quantity: integer, stepRate?: number, out?: O): O; + static GetPoints(line: Phaser.Geom.Line, quantity: number, stepRate?: number, out?: O): O; /** * Get the shortest distance from a Line to the given Point. @@ -40463,7 +45991,7 @@ declare namespace Phaser { * The geometry constant type of this object: `GEOM_CONST.LINE`. * Used for fast type comparisons. */ - readonly type: integer; + readonly type: number; /** * The x coordinate of the lines starting point. @@ -40503,7 +46031,7 @@ declare namespace Phaser { * @param stepRate The distance between each point on the line. When set, `quantity` is implied and should be set to `0`. * @param output An optional array of Points, or point-like objects, to store the coordinates of the points on the line. */ - getPoints(quantity: integer, stepRate?: integer, output?: O): O; + getPoints(quantity: number, stepRate?: number, output?: O): O; /** * Get a random Point on the Line. @@ -40649,6 +46177,468 @@ declare namespace Phaser { } + namespace Mesh { + /** + * A Face Geometry Object. + * + * A Face is used by the Mesh Game Object. A Mesh consists of one, or more, faces that are + * used to render the Mesh Game Objects in WebGL. + * + * A Face consists of 3 Vertex instances, for the 3 corners of the face and methods to help + * you modify and test them. + */ + class Face { + /** + * + * @param vertex1 The first vertex of the Face. + * @param vertex2 The second vertex of the Face. + * @param vertex3 The third vertex of the Face. + */ + constructor(vertex1: Phaser.Geom.Mesh.Vertex, vertex2: Phaser.Geom.Mesh.Vertex, vertex3: Phaser.Geom.Mesh.Vertex); + + /** + * The first vertex in this Face. + */ + vertex1: Phaser.Geom.Mesh.Vertex; + + /** + * The second vertex in this Face. + */ + vertex2: Phaser.Geom.Mesh.Vertex; + + /** + * The third vertex in this Face. + */ + vertex3: Phaser.Geom.Mesh.Vertex; + + /** + * The bounds of this Face. + * + * Be sure to call the `Face.updateBounds` method _before_ using this property. + */ + bounds: Phaser.Geom.Rectangle; + + /** + * Calculates and returns the in-center position of this Face. + * @param local Return the in center from the un-transformed vertex positions (`true`), or transformed? (`false`) Default true. + */ + getInCenter(local?: boolean): Phaser.Math.Vector2; + + /** + * Checks if the given coordinates are within this Face. + * + * You can optionally provide a transform matrix. If given, the Face vertices + * will be transformed first, before being checked against the coordinates. + * @param x The horizontal position to check. + * @param y The vertical position to check. + * @param calcMatrix Optional transform matrix to apply to the vertices before comparison. + */ + contains(x: number, y: number, calcMatrix?: Phaser.GameObjects.Components.TransformMatrix): boolean; + + /** + * Checks if the vertices in this Face are orientated counter-clockwise, or not. + * + * It checks the transformed position of the vertices, not the local one. + * @param z The z-axis value to test against. Typically the `Mesh.modelPosition.z`. + */ + isCounterClockwise(z: number): boolean; + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * @param F32 A Float32 Array to insert the position, UV and unit data in to. + * @param U32 A Uint32 Array to insert the color and alpha data in to. + * @param offset The index of the array to insert this Vertex to. + * @param textureUnit The texture unit currently in use. + * @param alpha The alpha of the parent object. + * @param a The parent transform matrix data a component. + * @param b The parent transform matrix data b component. + * @param c The parent transform matrix data c component. + * @param d The parent transform matrix data d component. + * @param e The parent transform matrix data e component. + * @param f The parent transform matrix data f component. + * @param roundPixels Round the vertex position or not? + */ + load(F32: Float32Array, U32: Uint32Array, offset: number, textureUnit: number, alpha: number, a: number, b: number, c: number, d: number, e: number, f: number, roundPixels: boolean): number; + + /** + * Transforms all Face vertices by the given matrix, storing the results in their `vx`, `vy` and `vz` properties. + * @param transformMatrix The transform matrix to apply to this vertex. + * @param width The width of the parent Mesh. + * @param height The height of the parent Mesh. + * @param cameraZ The z position of the MeshCamera. + */ + transformCoordinatesLocal(transformMatrix: Phaser.Math.Matrix4, width: number, height: number, cameraZ: number): this; + + /** + * Updates the bounds of this Face, based on the translated values of the vertices. + * + * Call this method prior to accessing the `Face.bounds` property. + */ + updateBounds(): this; + + /** + * Checks if this Face is within the view of the given Camera. + * + * This method is called in the `MeshWebGLRenderer` function. It performs the following tasks: + * + * First, the `Vertex.update` method is called on each of the vertices. This populates them + * with the new translated values, updating their `tx`, `ty` and `ta` properties. + * + * Then it tests to see if this face is visible due to the alpha values, if not, it returns. + * + * After this, if `hideCCW` is set, it calls `isCounterClockwise` and returns if not. + * + * Finally, it will update the `Face.bounds` based on the newly translated vertex values + * and return the results of an intersection test between the bounds and the camera world view + * rectangle. + * @param camera The Camera to check against. + * @param hideCCW Test the counter-clockwise orientation of the verts? + * @param z The Cameras z position, used in the CCW test. + * @param alpha The alpha of the parent object. + * @param a The parent transform matrix data a component. + * @param b The parent transform matrix data b component. + * @param c The parent transform matrix data c component. + * @param d The parent transform matrix data d component. + * @param e The parent transform matrix data e component. + * @param f The parent transform matrix data f component. + * @param roundPixels Round the vertex position or not? + */ + isInView(camera: Phaser.Cameras.Scene2D.Camera, hideCCW: boolean, z: number, alpha: number, a: number, b: number, c: number, d: number, e: number, f: number, roundPixels: boolean): boolean; + + /** + * Translates the vertices of this Face by the given amounts. + * + * The actual vertex positions are adjusted, not their transformed position. + * + * Therefore, this updates the vertex data directly. + * @param x The amount to horizontally translate by. + * @param y The amount to vertically translate by. Default 0. + */ + translate(x: number, y?: number): this; + + /** + * The x coordinate of this Face, based on the in center position of the Face. + */ + x: number; + + /** + * The y coordinate of this Face, based on the in center position of the Face. + */ + y: number; + + /** + * Set the alpha value of this Face. + * + * Each vertex is given the same value. If you need to adjust the alpha on a per-vertex basis + * then use the `Vertex.alpha` property instead. + * + * When getting the alpha of this Face, it will return an average of the alpha + * component of all three vertices. + */ + alpha: number; + + /** + * The depth of this Face, which is an average of the z component of all three vertices. + * + * The depth is calculated based on the transformed z value, not the local one. + */ + readonly depth: number; + + /** + * Destroys this Face and nulls the references to the vertices. + */ + destroy(): void; + + } + + /** + * Creates a grid of vertices based on the given configuration object and optionally adds it to a Mesh. + * + * The size of the grid is given in pixels. An example configuration may be: + * + * `{ width: 256, height: 256, widthSegments: 2, heightSegments: 2, tile: true }` + * + * This will create a grid 256 x 256 pixels in size, split into 2 x 2 segments, with + * the texture tiling across the cells. + * + * You can split the grid into segments both vertically and horizontally. This will + * generate two faces per grid segment as a result. + * + * The `tile` parameter allows you to control if the tile will repeat across the grid + * segments, or be displayed in full. + * + * If adding this grid to a Mesh you can offset the grid via the `x` and `y` properties. + * + * UV coordinates are generated based on the given texture and frame in the config. For + * example, no frame is given, the UVs will be in the range 0 to 1. If a frame is given, + * such as from a texture atlas, the UVs will be generated within the range of that frame. + * @param config A Grid configuration object. + */ + function GeneraterGridVerts(config: Phaser.Types.Geom.Mesh.GenerateGridConfig): Phaser.Types.Geom.Mesh.GenerateGridVertsResult; + + /** + * This method will return an object containing Face and Vertex instances, generated + * from the parsed triangulated OBJ Model data given to this function. + * + * The obj data should have been parsed in advance via the ParseObj function: + * + * ```javascript + * var data = Phaser.Geom.Mesh.ParseObj(rawData, flipUV); + * + * var results = GenerateObjVerts(data); + * ``` + * + * Alternatively, you can parse obj files loaded via the OBJFile loader: + * + * ```javascript + * preload () + * { + * this.load.obj('alien', 'assets/3d/alien.obj); + * } + * + * var results = GenerateObjVerts(this.cache.obj.get('alien)); + * ``` + * + * Make sure your 3D package has triangulated the model data prior to exporting it. + * + * You can use the data returned by this function to populate the vertices of a Mesh Game Object. + * + * You may add multiple models to a single Mesh, although they will act as one when + * moved or rotated. You can scale the model data, should it be too small (or large) to visualize. + * You can also offset the model via the `x`, `y` and `z` parameters. + * @param data The parsed OBJ model data. + * @param mesh An optional Mesh Game Object. If given, the generated Faces will be automatically added to this Mesh. Set to `null` to skip. + * @param scale An amount to scale the model data by. Use this if the model has exported too small, or large, to see. Default 1. + * @param x Translate the model x position by this amount. Default 0. + * @param y Translate the model y position by this amount. Default 0. + * @param z Translate the model z position by this amount. Default 0. + * @param rotateX Rotate the model on the x axis by this amount, in radians. Default 0. + * @param rotateY Rotate the model on the y axis by this amount, in radians. Default 0. + * @param rotateZ Rotate the model on the z axis by this amount, in radians. Default 0. + * @param zIsUp Is the z axis up (true), or is y axis up (false)? Default true. + */ + function GenerateObjVerts(data: Phaser.Types.Geom.Mesh.OBJData, mesh?: Phaser.GameObjects.Mesh, scale?: number, x?: number, y?: number, z?: number, rotateX?: number, rotateY?: number, rotateZ?: number, zIsUp?: boolean): Phaser.Types.Geom.Mesh.GenerateVertsResult; + + /** + * Generates a set of Face and Vertex objects by parsing the given data. + * + * This method will take vertex data in one of two formats, based on the `containsZ` parameter. + * + * If your vertex data are `x`, `y` pairs, then `containsZ` should be `false` (this is the default) + * + * If your vertex data is groups of `x`, `y` and `z` values, then the `containsZ` parameter must be true. + * + * The `uvs` parameter is a numeric array consisting of `u` and `v` pairs. + * + * The `normals` parameter is a numeric array consisting of `x`, `y` vertex normal values and, if `containsZ` is true, `z` values as well. + * + * The `indicies` parameter is an optional array that, if given, is an indexed list of vertices to be added. + * + * The `colors` parameter is an optional array, or single value, that if given sets the color of each vertex created. + * + * The `alphas` parameter is an optional array, or single value, that if given sets the alpha of each vertex created. + * + * When providing indexed data it is assumed that _all_ of the arrays are indexed, not just the vertices. + * + * The following example will create a 256 x 256 sized quad using an index array: + * + * ```javascript + * const vertices = [ + * -128, 128, + * 128, 128, + * -128, -128, + * 128, -128 + * ]; + * + * const uvs = [ + * 0, 1, + * 1, 1, + * 0, 0, + * 1, 0 + * ]; + * + * const indices = [ 0, 2, 1, 2, 3, 1 ]; + * + * GenerateVerts(vertices, uvs, indicies); + * ``` + * + * If the data is not indexed, it's assumed that the arrays all contain sequential data. + * @param vertices The vertices array. Either `xy` pairs, or `xyz` if the `containsZ` parameter is `true`. + * @param uvs The UVs pairs array. + * @param indicies Optional vertex indicies array. If you don't have one, pass `null` or an empty array. + * @param containsZ Does the vertices data include a `z` component? Default false. + * @param normals Optional vertex normals array. If you don't have one, pass `null` or an empty array. + * @param colors An array of colors, one per vertex, or a single color value applied to all vertices. Default 0xffffff. + * @param alphas An array of alpha values, one per vertex, or a single alpha value applied to all vertices. Default 1. + */ + function GenerateVerts(vertices: number[], uvs: number[], indicies?: number[], containsZ?: boolean, normals?: number[], colors?: number | number[], alphas?: number | number[]): Phaser.Types.Geom.Mesh.GenerateVertsResult; + + /** + * Parses a Wavefront OBJ File, extracting the models from it and returning them in an array. + * + * The model data *must* be triangulated for a Mesh Game Object to be able to render it. + * @param data The OBJ File data as a raw string. + * @param flipUV Flip the UV coordinates? Default true. + */ + function ParseObj(data: string, flipUV?: boolean): Phaser.Types.Geom.Mesh.OBJData; + + /** + * Takes a Wavefront Material file and extracts the diffuse reflectivity of the named + * materials, converts them to integer color values and returns them. + * + * This is used internally by the `addOBJ` and `addModel` methods, but is exposed for + * public consumption as well. + * + * Note this only works with diffuse values, specified in the `Kd r g b` format, where + * `g` and `b` are optional, but `r` is required. It does not support spectral rfl files, + * or any other material statement (such as `Ka` or `Ks`) + * @param mtl The OBJ MTL file as a raw string, i.e. loaded via `this.load.text`. + */ + function ParseObjMaterial(mtl: string): object; + + /** + * Rotates the vertices of a Face to the given angle. + * + * The actual vertex positions are adjusted, not their transformed positions. + * + * Therefore, this updates the vertex data directly. + * @param face The Face to rotate. + * @param angle The angle to rotate to, in radians. + * @param cx An optional center of rotation. If not given, the Face in-center is used. + * @param cy An optional center of rotation. If not given, the Face in-center is used. + */ + function RotateFace(face: Phaser.Geom.Mesh.Face, angle: number, cx?: number, cy?: number): void; + + /** + * A Vertex Geometry Object. + * + * This class consists of all the information required for a single vertex within a Face Geometry Object. + * + * Faces, and thus Vertex objects, are used by the Mesh Game Object in order to render objects in WebGL. + */ + class Vertex extends Phaser.Math.Vector3 { + /** + * + * @param x The x position of the vertex. + * @param y The y position of the vertex. + * @param z The z position of the vertex. + * @param u The UV u coordinate of the vertex. + * @param v The UV v coordinate of the vertex. + * @param color The color value of the vertex. Default 0xffffff. + * @param alpha The alpha value of the vertex. Default 1. + * @param nx The x normal value of the vertex. Default 0. + * @param ny The y normal value of the vertex. Default 0. + * @param nz The z normal value of the vertex. Default 0. + */ + constructor(x: number, y: number, z: number, u: number, v: number, color?: number, alpha?: number, nx?: number, ny?: number, nz?: number); + + /** + * The projected x coordinate of this vertex. + */ + vx: number; + + /** + * The projected y coordinate of this vertex. + */ + vy: number; + + /** + * The projected z coordinate of this vertex. + */ + vz: number; + + /** + * The projected x coordinate of this vertex. + */ + nx: number; + + /** + * The projected y coordinate of this vertex. + */ + ny: number; + + /** + * The projected z coordinate of this vertex. + */ + nz: number; + + /** + * UV u coordinate of this vertex. + */ + u: number; + + /** + * UV v coordinate of this vertex. + */ + v: number; + + /** + * The color value of this vertex. + */ + color: number; + + /** + * The alpha value of this vertex. + */ + alpha: number; + + /** + * The translated x coordinate of this vertex. + */ + tx: number; + + /** + * The translated y coordinate of this vertex. + */ + ty: number; + + /** + * The translated alpha value of this vertex. + */ + ta: number; + + /** + * Sets the U and V properties. + * @param u The UV u coordinate of the vertex. + * @param v The UV v coordinate of the vertex. + */ + setUVs(u: number, v: number): this; + + /** + * Transforms this vertex by the given matrix, storing the results in `vx`, `vy` and `vz`. + * @param transformMatrix The transform matrix to apply to this vertex. + * @param width The width of the parent Mesh. + * @param height The height of the parent Mesh. + * @param cameraZ The z position of the MeshCamera. + */ + transformCoordinatesLocal(transformMatrix: Phaser.Math.Matrix4, width: number, height: number, cameraZ: number): void; + + /** + * Updates this Vertex based on the given transform. + * @param a The parent transform matrix data a component. + * @param b The parent transform matrix data b component. + * @param c The parent transform matrix data c component. + * @param d The parent transform matrix data d component. + * @param e The parent transform matrix data e component. + * @param f The parent transform matrix data f component. + * @param roundPixels Round the vertex position or not? + * @param alpha The alpha of the parent object. + */ + update(a: number, b: number, c: number, d: number, e: number, f: number, roundPixels: boolean, alpha: number): this; + + /** + * Loads the data from this Vertex into the given Typed Arrays. + * @param F32 A Float32 Array to insert the position, UV and unit data in to. + * @param U32 A Uint32 Array to insert the color and alpha data in to. + * @param offset The index of the array to insert this Vertex to. + * @param textureUnit The texture unit currently in use. + */ + load(F32: Float32Array, U32: Uint32Array, offset: number, textureUnit: number): number; + + } + + } + /** * Defines a Point in 2D space, with an x and y component. */ @@ -40745,7 +46735,7 @@ declare namespace Phaser { * The geometry constant type of this object: `GEOM_CONST.POINT`. * Used for fast type comparisons. */ - readonly type: integer; + readonly type: number; /** * The x coordinate of this Point. @@ -40795,7 +46785,7 @@ declare namespace Phaser { * A Polygon object * * The polygon is a closed shape consists of a series of connected straight lines defined by list of ordered points. - * Several formats are supported to define the list of points, check the setTo method for details. + * Several formats are supported to define the list of points, check the setTo method for details. * This is a geometry object allowing you to define and inspect the shape. * It is not a Game Object, in that you cannot add it to the display list, and it has no texture. * To render a Polygon you should look at the capabilities of the Graphics class. @@ -40803,14 +46793,14 @@ declare namespace Phaser { class Polygon { /** * - * @param points List of points defining the perimeter of this Polygon. Several formats are supported: + * @param points List of points defining the perimeter of this Polygon. Several formats are supported: * - A string containing paired x y values separated by a single space: `'40 0 40 20 100 20 100 80 40 80 40 100 0 50'` * - An array of Point objects: `[new Phaser.Point(x1, y1), ...]` * - An array of objects with public x y properties: `[obj1, obj2, ...]` * - An array of paired numbers that represent point coordinates: `[x1,y1, x2,y2, ...]` * - An array of arrays with two elements representing x/y coordinates: `[[x1, y1], [x2, y2], ...]` */ - constructor(points?: Phaser.Geom.Point[]); + constructor(points?: string | number[] | Phaser.Types.Math.Vector2Like[]); /** * Create a new polygon which is a copy of the specified polygon @@ -40833,6 +46823,54 @@ declare namespace Phaser { */ static ContainsPoint(polygon: Phaser.Geom.Polygon, point: Phaser.Geom.Point): boolean; + /** + * This module implements a modified ear slicing algorithm, optimized by z-order curve hashing and extended to + * handle holes, twisted polygons, degeneracies and self-intersections in a way that doesn't guarantee correctness + * of triangulation, but attempts to always produce acceptable results for practical data. + * + * Example: + * + * ```javascript + * const triangles = Phaser.Geom.Polygon.Earcut([10,0, 0,50, 60,60, 70,10]); // returns [1,0,3, 3,2,1] + * ``` + * + * Each group of three vertex indices in the resulting array forms a triangle. + * + * ```javascript + * // triangulating a polygon with a hole + * earcut([0,0, 100,0, 100,100, 0,100, 20,20, 80,20, 80,80, 20,80], [4]); + * // [3,0,4, 5,4,0, 3,4,7, 5,0,1, 2,3,7, 6,5,1, 2,7,6, 6,1,2] + * + * // triangulating a polygon with 3d coords + * earcut([10,0,1, 0,50,2, 60,60,3, 70,10,4], null, 3); + * // [1,0,3, 3,2,1] + * ``` + * + * If you pass a single vertex as a hole, Earcut treats it as a Steiner point. + * + * If your input is a multi-dimensional array (e.g. GeoJSON Polygon), you can convert it to the format + * expected by Earcut with `Phaser.Geom.Polygon.Earcut.flatten`: + * + * ```javascript + * var data = earcut.flatten(geojson.geometry.coordinates); + * var triangles = earcut(data.vertices, data.holes, data.dimensions); + * ``` + * + * After getting a triangulation, you can verify its correctness with `Phaser.Geom.Polygon.Earcut.deviation`: + * + * ```javascript + * var deviation = earcut.deviation(vertices, holes, dimensions, triangles); + * ``` + * Returns the relative difference between the total area of triangles and the area of the input polygon. + * 0 means the triangulation is fully correct. + * + * For more information see https://github.com/mapbox/earcut + * @param data A flat array of vertex coordinate, like [x0,y0, x1,y1, x2,y2, ...] + * @param holeIndices An array of hole indices if any (e.g. [5, 8] for a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11). + * @param dimensions The number of coordinates per vertex in the input array (2 by default). Default 2. + */ + static Earcut(data: number[], holeIndices?: number[], dimensions?: number): number[]; + /** * Calculates the bounding AABB rectangle of a polygon. * @param polygon The polygon that should be calculated. @@ -40857,7 +46895,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param output An array to insert the points in to. If not provided a new array will be created. */ - static GetPoints(polygon: Phaser.Geom.Polygon, quantity: integer, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; + static GetPoints(polygon: Phaser.Geom.Polygon, quantity: number, stepRate?: number, output?: any[]): Phaser.Geom.Point[]; /** * Returns the perimeter of the given Polygon. @@ -40869,7 +46907,7 @@ declare namespace Phaser { * The geometry constant type of this object: `GEOM_CONST.POLYGON`. * Used for fast type comparisons. */ - readonly type: integer; + readonly type: number; /** * The area of this Polygon. @@ -40902,7 +46940,7 @@ declare namespace Phaser { * `setTo` may also be called without any arguments to remove all points. * @param points Points defining the perimeter of this polygon. Please check function description above for the different supported formats. */ - setTo(points: any[]): this; + setTo(points?: string | number[] | Phaser.Types.Math.Vector2Like[]): this; /** * Calculates the area of the Polygon. This is available in the property Polygon.area @@ -40916,7 +46954,7 @@ declare namespace Phaser { * @param stepRate Sets the quantity by getting the perimeter of the Polygon and dividing it by the stepRate. * @param output An array to insert the points in to. If not provided a new array will be created. */ - getPoints(quantity: integer, stepRate?: number, output?: O): O; + getPoints(quantity: number, stepRate?: number, output?: O): O; /** * Reverses the order of the points of a Polygon. @@ -40924,12 +46962,31 @@ declare namespace Phaser { */ static Reverse(polygon: O): O; + /** + * Takes a Polygon object and simplifies the points by running them through a combination of + * Douglas-Peucker and Radial Distance algorithms. Simplification dramatically reduces the number of + * points in a polygon while retaining its shape, giving a huge performance boost when processing + * it and also reducing visual noise. + * @param polygon The polygon to be simplified. The polygon will be modified in-place and returned. + * @param tolerance Affects the amount of simplification (in the same metric as the point coordinates). Default 1. + * @param highestQuality Excludes distance-based preprocessing step which leads to highest quality simplification but runs ~10-20 times slower. Default false. + */ + static Simplify(polygon: O, tolerance?: number, highestQuality?: boolean): O; + /** * Takes a Polygon object and applies Chaikin's smoothing algorithm on its points. * @param polygon The polygon to be smoothed. The polygon will be modified in-place and returned. */ static Smooth(polygon: O): O; + /** + * Tranlates the points of the given Polygon. + * @param polygon The Polygon to modify. + * @param x The amount to horizontally translate the points by. + * @param y The amount to vertically translate the points by. + */ + static Translate(polygon: O, x: number, y: number): O; + } /** @@ -41104,7 +47161,7 @@ declare namespace Phaser { * @param quantity The number of evenly spaced points from the rectangles perimeter to return. If falsey, step param will be used to calculate the number of points. * @param out An optional array to store the points in. */ - static GetPoints(rectangle: Phaser.Geom.Rectangle, step: number, quantity: integer, out?: O): O; + static GetPoints(rectangle: Phaser.Geom.Rectangle, step: number, quantity: number, out?: O): O; /** * Returns the size of the Rectangle, expressed as a Point object. @@ -41142,7 +47199,7 @@ declare namespace Phaser { * @param quantity The total number of points to return. The step is then calculated based on the length of the Rectangle, divided by this value. * @param out An array in which the perimeter points will be stored. If not given, a new array instance is created. */ - static MarchingAnts(rect: Phaser.Geom.Rectangle, step?: number, quantity?: integer, out?: O): O; + static MarchingAnts(rect: Phaser.Geom.Rectangle, step?: number, quantity?: number, out?: O): O; /** * Merges a Rectangle with a list of points by repositioning and/or resizing it such that all points are located on or within its bounds. @@ -41201,7 +47258,7 @@ declare namespace Phaser { * @param angle The angle of the point, in degrees. * @param out The Point object to store the position in. If not given, a new Point instance is created. */ - static PerimeterPoint(rectangle: Phaser.Geom.Rectangle, angle: integer, out?: O): O; + static PerimeterPoint(rectangle: Phaser.Geom.Rectangle, angle: number, out?: O): O; /** * Returns a random point within a Rectangle. @@ -41223,7 +47280,7 @@ declare namespace Phaser { * The geometry constant type of this object: `GEOM_CONST.RECTANGLE`. * Used for fast type comparisons. */ - readonly type: integer; + readonly type: number; /** * The X coordinate of the top left corner of the Rectangle. @@ -41269,7 +47326,7 @@ declare namespace Phaser { * @param stepRate If `quantity` is 0, determines the normalized distance between each returned point. * @param output An array to which to append the points. */ - getPoints(quantity: integer, stepRate?: number, output?: O): O; + getPoints(quantity: number, stepRate?: number, output?: O): O; /** * Returns a random point within the Rectangle's bounds. @@ -41548,7 +47605,7 @@ declare namespace Phaser { * @param stepRate If `quantity` is 0, the distance between each returned point. * @param out An array to which the points should be appended. */ - static GetPoints(triangle: Phaser.Geom.Triangle, quantity: integer, stepRate: number, out?: O): O; + static GetPoints(triangle: Phaser.Geom.Triangle, quantity: number, stepRate: number, out?: O): O; /** * Calculates the position of the incenter of a Triangle object. This is the point where its three angle bisectors meet and it's also the center of the incircle, which is the circle inscribed in the triangle. @@ -41607,7 +47664,7 @@ declare namespace Phaser { * The geometry constant type of this object: `GEOM_CONST.TRIANGLE`. * Used for fast type comparisons. */ - readonly type: integer; + readonly type: number; /** * `x` coordinate of the first point. @@ -41659,7 +47716,7 @@ declare namespace Phaser { * @param stepRate Distance between two points. Will only be used when `quantity` is falsey. * @param output Optional Array for writing the calculated points into. Otherwise a new array will be created. */ - getPoints(quantity: integer, stepRate?: number, output?: O): O; + getPoints(quantity: number, stepRate?: number, output?: O): O; /** * Returns a random point along the triangle. @@ -41724,47 +47781,47 @@ declare namespace Phaser { /** * The mouse pointer is being held down. */ - var MOUSE_DOWN: integer; + var MOUSE_DOWN: number; /** * The mouse pointer is being moved. */ - var MOUSE_MOVE: integer; + var MOUSE_MOVE: number; /** * The mouse pointer is released. */ - var MOUSE_UP: integer; + var MOUSE_UP: number; /** * A touch pointer has been started. */ - var TOUCH_START: integer; + var TOUCH_START: number; /** * A touch pointer has been started. */ - var TOUCH_MOVE: integer; + var TOUCH_MOVE: number; /** * A touch pointer has been started. */ - var TOUCH_END: integer; + var TOUCH_END: number; /** * The pointer lock has changed. */ - var POINTER_LOCK_CHANGE: integer; + var POINTER_LOCK_CHANGE: number; /** * A touch pointer has been been cancelled by the browser. */ - var TOUCH_CANCEL: integer; + var TOUCH_CANCEL: number; /** * The mouse wheel changes. */ - var MOUSE_WHEEL: integer; + var MOUSE_WHEEL: number; /** * Creates a new Interactive Object. @@ -41785,7 +47842,7 @@ declare namespace Phaser { * @param textureManager A reference to the Texture Manager. * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. */ - function CreatePixelPerfectHandler(textureManager: Phaser.Textures.TextureManager, alphaTolerance: integer): Function; + function CreatePixelPerfectHandler(textureManager: Phaser.Textures.TextureManager, alphaTolerance: number): Function; namespace Events { /** @@ -42496,7 +48553,7 @@ declare namespace Phaser { * @param pad A reference to the Gamepad that this Axis belongs to. * @param index The index of this Axis. */ - constructor(pad: Phaser.Input.Gamepad.Gamepad, index: integer); + constructor(pad: Phaser.Input.Gamepad.Gamepad, index: number); /** * A reference to the Gamepad that this Axis belongs to. @@ -42511,7 +48568,7 @@ declare namespace Phaser { /** * The index of this Axis. */ - index: integer; + index: number; /** * The raw axis value, between -1 and 1 with 0 being dead center. @@ -42546,7 +48603,7 @@ declare namespace Phaser { * @param pad A reference to the Gamepad that this Button belongs to. * @param index The index of this Button. */ - constructor(pad: Phaser.Input.Gamepad.Gamepad, index: integer); + constructor(pad: Phaser.Input.Gamepad.Gamepad, index: number); /** * A reference to the Gamepad that this Button belongs to. @@ -42561,7 +48618,7 @@ declare namespace Phaser { /** * The index of this Button. */ - index: integer; + index: number; /** * Between 0 and 1. @@ -42761,7 +48818,7 @@ declare namespace Phaser { /** * Gets the total number of axis this Gamepad claims to support. */ - getAxisTotal(): integer; + getAxisTotal(): number; /** * Gets the value of an axis based on the given index. @@ -42769,7 +48826,7 @@ declare namespace Phaser { * The return value will be a float between 0 and 1. * @param index The index of the axes to get the value for. */ - getAxisValue(index: integer): number; + getAxisValue(index: number): number; /** * Sets the threshold value of all axis on this Gamepad. @@ -42781,7 +48838,7 @@ declare namespace Phaser { /** * Gets the total number of buttons this Gamepad claims to have. */ - getButtonTotal(): integer; + getButtonTotal(): number; /** * Gets the value of a button based on the given index. @@ -42791,14 +48848,14 @@ declare namespace Phaser { * for a pressure-sensitive digital button, such as the shoulder buttons on a Dual Shock. * @param index The index of the button to get the value for. */ - getButtonValue(index: integer): number; + getButtonValue(index: number): number; /** * Returns if the button is pressed down or not. * The index must be valid within the range of buttons supported by this Gamepad. * @param index The index of the button to get the value for. */ - isButtonDown(index: integer): boolean; + isButtonDown(index: number): boolean; /** * Destroys this Gamepad instance, its buttons and axes, and releases external references it holds. @@ -42940,6 +48997,9 @@ declare namespace Phaser { * to the gamepads you can poll its buttons and axis sticks. See the properties and methods available on * the `Gamepad` class for more details. * + * As of September 2020 Chrome, and likely other browsers, will soon start to require that games requesting + * access to the Gamepad API are running under SSL. They will actively block API access if they are not. + * * For more information about Gamepad support in browsers see the following resources: * * https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API @@ -43010,7 +49070,7 @@ declare namespace Phaser { /** * The total number of connected game pads. */ - total: integer; + total: number; /** * A reference to the first connected Gamepad. @@ -43148,7 +49208,7 @@ declare namespace Phaser { * You can change this by either calling `addPointer` at run-time, or by * setting the `input.activePointers` property in the Game Config. */ - readonly pointersTotal: integer; + readonly pointersTotal: number; /** * The mouse has its own unique Pointer object, which you can reference directly if making a _desktop specific game_. @@ -43222,7 +49282,7 @@ declare namespace Phaser { * via this method. * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. */ - addPointer(quantity?: integer): Phaser.Input.Pointer[]; + addPointer(quantity?: number): Phaser.Input.Pointer[]; /** * Internal method that gets a list of all the active Input Plugins in the game @@ -43231,7 +49291,7 @@ declare namespace Phaser { * @param type The type of event to process. * @param pointers An array of Pointers on which the event occurred. */ - updateInputPlugins(type: integer, pointers: Phaser.Input.Pointer[]): void; + updateInputPlugins(type: number, pointers: Phaser.Input.Pointer[]): void; /** * Performs a hit test using the given Pointer and camera, against an array of interactive Game Objects. @@ -43319,6 +49379,13 @@ declare namespace Phaser { * capture settings and more. * * Please also see the Input examples and tutorials for further information. + * + * **Incorrect input coordinates with Angular** + * + * If you are using Phaser within Angular, and use nglf or the router, to make the component in which the Phaser game resides + * change state (i.e. appear or disappear) then you'll need to notify the Scale Manager about this, as Angular will mess with + * the DOM in a way in which Phaser can't detect directly. Call `this.scale.updateBounds()` as part of your game init in order + * to refresh the canvas DOM bounds values, which Phaser uses for input point position calculations. */ class InputPlugin extends Phaser.Events.EventEmitter { /** @@ -43400,7 +49467,7 @@ declare namespace Phaser { * * Set to 0 to poll constantly. Set to -1 to only poll on user movement. */ - pollRate: integer; + pollRate: number; /** * The distance, in pixels, a pointer has to move while being held down, before it thinks it is being dragged. @@ -43465,11 +49532,11 @@ declare namespace Phaser { * * You can also provide an Input Configuration Object as the only argument to this method. * @param gameObject The Game Object to be enabled for input. - * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. - * @param callback The 'contains' function to invoke to check if the pointer is within the hit area. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param hitAreaCallback The 'contains' function to invoke to check if the pointer is within the hit area. * @param dropZone Is this Game Object a drop zone or not? Default false. */ - enable(gameObject: Phaser.GameObjects.GameObject, shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; + enable(gameObject: Phaser.GameObjects.GameObject, hitArea?: Phaser.Types.Input.InputConfiguration | any, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this; /** * Takes the given Pointer and performs a hit test against it, to see which interactive Game Objects @@ -43494,7 +49561,7 @@ declare namespace Phaser { * 5 = Pointer actively dragging but has been released, notify draglist * @param pointer The Pointer to get the drag state for. */ - getDragState(pointer: Phaser.Input.Pointer): integer; + getDragState(pointer: Phaser.Input.Pointer): number; /** * Sets the drag state of the given Pointer for this Input Plugin. @@ -43510,7 +49577,7 @@ declare namespace Phaser { * @param pointer The Pointer to set the drag state for. * @param state The drag state value. An integer between 0 and 5. */ - setDragState(pointer: Phaser.Input.Pointer, state: integer): void; + setDragState(pointer: Phaser.Input.Pointer, state: number): void; /** * Sets the draggable state of the given array of Game Objects. @@ -43550,7 +49617,7 @@ declare namespace Phaser { * Render Textures, Text, Tilemaps, Containers or Particles. * @param alphaTolerance The alpha level that the pixel should be above to be included as a successful interaction. Default 1. */ - makePixelPerfect(alphaTolerance?: integer): Function; + makePixelPerfect(alphaTolerance?: number): Function; /** * Sets the hit area for the given array of Game Objects. @@ -43565,10 +49632,10 @@ declare namespace Phaser { * those values fall within the area of the shape or not. All of the Phaser geometry objects provide this, * such as `Phaser.Geom.Rectangle.Contains`. * @param gameObjects An array of Game Objects to set the hit area on. - * @param shape Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. - * @param callback The 'contains' function to invoke to check if the pointer is within the hit area. + * @param hitArea Either an input configuration object, or a geometric shape that defines the hit area for the Game Object. If not specified a Rectangle will be used. + * @param hitAreaCallback The 'contains' function to invoke to check if the pointer is within the hit area. */ - setHitArea(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], shape?: Phaser.Types.Input.InputConfiguration | any, callback?: Phaser.Types.Input.HitAreaCallback): this; + setHitArea(gameObjects: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], hitArea?: Phaser.Types.Input.InputConfiguration | any, hitAreaCallback?: Phaser.Types.Input.HitAreaCallback): this; /** * Sets the hit area for an array of Game Objects to be a `Phaser.Geom.Circle` shape, using @@ -43735,7 +49802,7 @@ declare namespace Phaser { * via this method. * @param quantity The number of new Pointers to create. A maximum of 10 is allowed in total. Default 1. */ - addPointer(quantity?: integer): Phaser.Input.Pointer[]; + addPointer(quantity?: number): Phaser.Input.Pointer[]; /** * Tells the Input system to set a custom cursor. @@ -43875,7 +49942,7 @@ declare namespace Phaser { * Returns the input plugin object from the cache based on the given key. * @param key The key of the input plugin to get. */ - function getCore(key: string): Phaser.Types.Input.InputPluginContainer; + function getPlugin(key: string): Phaser.Types.Input.InputPluginContainer; /** * Installs all of the registered Input Plugins into the given target. @@ -43926,7 +49993,7 @@ declare namespace Phaser { * @param keys The keys that comprise this combo. * @param config A Key Combo configuration object. */ - constructor(keyboardPlugin: Phaser.Input.Keyboard.KeyboardPlugin, keys: string | integer[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig); + constructor(keyboardPlugin: Phaser.Input.Keyboard.KeyboardPlugin, keys: string | number[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig); /** * A reference to the Keyboard Manager @@ -43946,12 +50013,12 @@ declare namespace Phaser { /** * The current keyCode the combo is waiting for. */ - current: integer; + current: number; /** * The current index of the key being waited for in the 'keys' string. */ - index: integer; + index: number; /** * The length of this combo (in keycodes) @@ -43981,7 +50048,7 @@ declare namespace Phaser { /** * The max delay in ms between each key press. Above this the combo is reset. 0 means disabled. */ - maxKeyDelay: integer; + maxKeyDelay: number; /** * If previously matched and they press the first key of the combo again, will it reset? @@ -44186,7 +50253,7 @@ declare namespace Phaser { * This array can be populated via the Game Config by setting the `input.keyboard.capture` array, or you * can call the `addCapture` method. See also `removeCapture` and `clearCaptures`. */ - captures: integer[]; + captures: number[]; /** * A boolean that controls if the Keyboard Manager is enabled or not. @@ -44261,7 +50328,7 @@ declare namespace Phaser { * If there are active captures after calling this method, the `preventDefault` property is set to `true`. * @param keycode The Key Codes to enable capture for, preventing them reaching the browser. */ - addCapture(keycode: string | integer | integer[] | any[]): void; + addCapture(keycode: string | number | number[] | any[]): void; /** * Removes an existing key capture. @@ -44294,7 +50361,7 @@ declare namespace Phaser { * If there are no captures left after calling this method, the `preventDefault` property is set to `false`. * @param keycode The Key Codes to disable capture for, allowing them reaching the browser again. */ - removeCapture(keycode: string | integer | integer[] | any[]): void; + removeCapture(keycode: string | number | number[] | any[]): void; /** * Removes all keyboard captures and sets the `preventDefault` property to `false`. @@ -44430,7 +50497,7 @@ declare namespace Phaser { * You can also provide an array mixing both strings and key code integers. * @param keycode The Key Codes to enable event capture for. */ - addCapture(keycode: string | integer | integer[] | any[]): this; + addCapture(keycode: string | number | number[] | any[]): this; /** * Removes an existing key capture. @@ -44461,12 +50528,12 @@ declare namespace Phaser { * You can also provide an array mixing both strings and key code integers. * @param keycode The Key Codes to disable event capture for. */ - removeCapture(keycode: string | integer | integer[] | any[]): this; + removeCapture(keycode: string | number | number[] | any[]): this; /** * Returns an array that contains all of the keyboard captures currently enabled. */ - getCaptures(): integer[]; + getCaptures(): number[]; /** * Allows Phaser to prevent any key captures you may have defined from bubbling up the browser. @@ -44528,7 +50595,7 @@ declare namespace Phaser { * @param enableCapture Automatically call `preventDefault` on the native DOM browser event for the key codes being added. Default true. * @param emitOnRepeat Controls if the Key will continuously emit a 'down' event while being held down (true), or emit the event just once (false, the default). Default false. */ - addKey(key: Phaser.Input.Keyboard.Key | string | integer, enableCapture?: boolean, emitOnRepeat?: boolean): Phaser.Input.Keyboard.Key; + addKey(key: Phaser.Input.Keyboard.Key | string | number, enableCapture?: boolean, emitOnRepeat?: boolean): Phaser.Input.Keyboard.Key; /** * Removes a Key object from this Keyboard Plugin. @@ -44537,7 +50604,7 @@ declare namespace Phaser { * @param key Either a Key object, a string, such as `A` or `SPACE`, or a key code value. * @param destroy Call `Key.destroy` on the removed Key object? Default false. */ - removeKey(key: Phaser.Input.Keyboard.Key | string | integer, destroy?: boolean): this; + removeKey(key: Phaser.Input.Keyboard.Key | string | number, destroy?: boolean): this; /** * Removes all Key objects created by _this_ Keyboard Plugin. @@ -44576,7 +50643,7 @@ declare namespace Phaser { * @param keys The keys that comprise this combo. * @param config A Key Combo configuration object. */ - createCombo(keys: string | integer[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig): Phaser.Input.Keyboard.KeyCombo; + createCombo(keys: string | number[] | object[], config?: Phaser.Types.Input.Keyboard.KeyComboConfig): Phaser.Input.Keyboard.KeyCombo; /** * Checks if the given Key object is currently being held down. @@ -44610,7 +50677,7 @@ declare namespace Phaser { * @param key The Key object to test. * @param duration The duration, in ms, within which the key must have been pressed down. Default 50. */ - function DownDuration(key: Phaser.Input.Keyboard.Key, duration?: integer): boolean; + function DownDuration(key: Phaser.Input.Keyboard.Key, duration?: number): boolean; /** * The justDown value allows you to test if this Key has just been pressed down or not. @@ -44644,7 +50711,7 @@ declare namespace Phaser { * @param plugin The Keyboard Plugin instance that owns this Key object. * @param keyCode The keycode of this key. */ - constructor(plugin: Phaser.Input.Keyboard.KeyboardPlugin, keyCode: integer); + constructor(plugin: Phaser.Input.Keyboard.KeyboardPlugin, keyCode: number); /** * The Keyboard Plugin instance that owns this Key object. @@ -44654,7 +50721,7 @@ declare namespace Phaser { /** * The keycode of this key. */ - keyCode: integer; + keyCode: number; /** * The original DOM event. @@ -44782,492 +50849,492 @@ declare namespace Phaser { /** * The BACKSPACE key. */ - var BACKSPACE: integer; + var BACKSPACE: number; /** * The TAB key. */ - var TAB: integer; + var TAB: number; /** * The ENTER key. */ - var ENTER: integer; + var ENTER: number; /** * The SHIFT key. */ - var SHIFT: integer; + var SHIFT: number; /** * The CTRL key. */ - var CTRL: integer; + var CTRL: number; /** * The ALT key. */ - var ALT: integer; + var ALT: number; /** * The PAUSE key. */ - var PAUSE: integer; + var PAUSE: number; /** * The CAPS_LOCK key. */ - var CAPS_LOCK: integer; + var CAPS_LOCK: number; /** * The ESC key. */ - var ESC: integer; + var ESC: number; /** * The SPACE key. */ - var SPACE: integer; + var SPACE: number; /** * The PAGE_UP key. */ - var PAGE_UP: integer; + var PAGE_UP: number; /** * The PAGE_DOWN key. */ - var PAGE_DOWN: integer; + var PAGE_DOWN: number; /** * The END key. */ - var END: integer; + var END: number; /** * The HOME key. */ - var HOME: integer; + var HOME: number; /** * The LEFT key. */ - var LEFT: integer; + var LEFT: number; /** * The UP key. */ - var UP: integer; + var UP: number; /** * The RIGHT key. */ - var RIGHT: integer; + var RIGHT: number; /** * The DOWN key. */ - var DOWN: integer; + var DOWN: number; /** * The PRINT_SCREEN key. */ - var PRINT_SCREEN: integer; + var PRINT_SCREEN: number; /** * The INSERT key. */ - var INSERT: integer; + var INSERT: number; /** * The DELETE key. */ - var DELETE: integer; + var DELETE: number; /** * The ZERO key. */ - var ZERO: integer; + var ZERO: number; /** * The ONE key. */ - var ONE: integer; + var ONE: number; /** * The TWO key. */ - var TWO: integer; + var TWO: number; /** * The THREE key. */ - var THREE: integer; + var THREE: number; /** * The FOUR key. */ - var FOUR: integer; + var FOUR: number; /** * The FIVE key. */ - var FIVE: integer; + var FIVE: number; /** * The SIX key. */ - var SIX: integer; + var SIX: number; /** * The SEVEN key. */ - var SEVEN: integer; + var SEVEN: number; /** * The EIGHT key. */ - var EIGHT: integer; + var EIGHT: number; /** * The NINE key. */ - var NINE: integer; + var NINE: number; /** * The NUMPAD_ZERO key. */ - var NUMPAD_ZERO: integer; + var NUMPAD_ZERO: number; /** * The NUMPAD_ONE key. */ - var NUMPAD_ONE: integer; + var NUMPAD_ONE: number; /** * The NUMPAD_TWO key. */ - var NUMPAD_TWO: integer; + var NUMPAD_TWO: number; /** * The NUMPAD_THREE key. */ - var NUMPAD_THREE: integer; + var NUMPAD_THREE: number; /** * The NUMPAD_FOUR key. */ - var NUMPAD_FOUR: integer; + var NUMPAD_FOUR: number; /** * The NUMPAD_FIVE key. */ - var NUMPAD_FIVE: integer; + var NUMPAD_FIVE: number; /** * The NUMPAD_SIX key. */ - var NUMPAD_SIX: integer; + var NUMPAD_SIX: number; /** * The NUMPAD_SEVEN key. */ - var NUMPAD_SEVEN: integer; + var NUMPAD_SEVEN: number; /** * The NUMPAD_EIGHT key. */ - var NUMPAD_EIGHT: integer; + var NUMPAD_EIGHT: number; /** * The NUMPAD_NINE key. */ - var NUMPAD_NINE: integer; + var NUMPAD_NINE: number; /** * The Numpad Addition (+) key. */ - var NUMPAD_ADD: integer; + var NUMPAD_ADD: number; /** * The Numpad Subtraction (-) key. */ - var NUMPAD_SUBTRACT: integer; + var NUMPAD_SUBTRACT: number; /** * The A key. */ - var A: integer; + var A: number; /** * The B key. */ - var B: integer; + var B: number; /** * The C key. */ - var C: integer; + var C: number; /** * The D key. */ - var D: integer; + var D: number; /** * The E key. */ - var E: integer; + var E: number; /** * The F key. */ - var F: integer; + var F: number; /** * The G key. */ - var G: integer; + var G: number; /** * The H key. */ - var H: integer; + var H: number; /** * The I key. */ - var I: integer; + var I: number; /** * The J key. */ - var J: integer; + var J: number; /** * The K key. */ - var K: integer; + var K: number; /** * The L key. */ - var L: integer; + var L: number; /** * The M key. */ - var M: integer; + var M: number; /** * The N key. */ - var N: integer; + var N: number; /** * The O key. */ - var O: integer; + var O: number; /** * The P key. */ - var P: integer; + var P: number; /** * The Q key. */ - var Q: integer; + var Q: number; /** * The R key. */ - var R: integer; + var R: number; /** * The S key. */ - var S: integer; + var S: number; /** * The T key. */ - var T: integer; + var T: number; /** * The U key. */ - var U: integer; + var U: number; /** * The V key. */ - var V: integer; + var V: number; /** * The W key. */ - var W: integer; + var W: number; /** * The X key. */ - var X: integer; + var X: number; /** * The Y key. */ - var Y: integer; + var Y: number; /** * The Z key. */ - var Z: integer; + var Z: number; /** * The F1 key. */ - var F1: integer; + var F1: number; /** * The F2 key. */ - var F2: integer; + var F2: number; /** * The F3 key. */ - var F3: integer; + var F3: number; /** * The F4 key. */ - var F4: integer; + var F4: number; /** * The F5 key. */ - var F5: integer; + var F5: number; /** * The F6 key. */ - var F6: integer; + var F6: number; /** * The F7 key. */ - var F7: integer; + var F7: number; /** * The F8 key. */ - var F8: integer; + var F8: number; /** * The F9 key. */ - var F9: integer; + var F9: number; /** * The F10 key. */ - var F10: integer; + var F10: number; /** * The F11 key. */ - var F11: integer; + var F11: number; /** * The F12 key. */ - var F12: integer; + var F12: number; /** * The SEMICOLON key. */ - var SEMICOLON: integer; + var SEMICOLON: number; /** * The PLUS key. */ - var PLUS: integer; + var PLUS: number; /** * The COMMA key. */ - var COMMA: integer; + var COMMA: number; /** * The MINUS key. */ - var MINUS: integer; + var MINUS: number; /** * The PERIOD key. */ - var PERIOD: integer; + var PERIOD: number; /** * The FORWARD_SLASH key. */ - var FORWARD_SLASH: integer; + var FORWARD_SLASH: number; /** * The BACK_SLASH key. */ - var BACK_SLASH: integer; + var BACK_SLASH: number; /** * The QUOTES key. */ - var QUOTES: integer; + var QUOTES: number; /** * The BACKTICK key. */ - var BACKTICK: integer; + var BACKTICK: number; /** * The OPEN_BRACKET key. */ - var OPEN_BRACKET: integer; + var OPEN_BRACKET: number; /** * The CLOSED_BRACKET key. */ - var CLOSED_BRACKET: integer; + var CLOSED_BRACKET: number; /** * The SEMICOLON_FIREFOX key. */ - var SEMICOLON_FIREFOX: integer; + var SEMICOLON_FIREFOX: number; /** * The COLON key. */ - var COLON: integer; + var COLON: number; /** * The COMMA_FIREFOX_WINDOWS key. */ - var COMMA_FIREFOX_WINDOWS: integer; + var COMMA_FIREFOX_WINDOWS: number; /** * The COMMA_FIREFOX key. */ - var COMMA_FIREFOX: integer; + var COMMA_FIREFOX: number; /** * The BRACKET_RIGHT_FIREFOX key. */ - var BRACKET_RIGHT_FIREFOX: integer; + var BRACKET_RIGHT_FIREFOX: number; /** * The BRACKET_LEFT_FIREFOX key. */ - var BRACKET_LEFT_FIREFOX: integer; + var BRACKET_LEFT_FIREFOX: number; } @@ -45277,7 +51344,7 @@ declare namespace Phaser { * @param key The Key object to test. * @param duration The duration, in ms, within which the key must have been released. Default 50. */ - function UpDuration(key: Phaser.Input.Keyboard.Key, duration?: integer): boolean; + function UpDuration(key: Phaser.Input.Keyboard.Key, duration?: number): boolean; } @@ -45302,9 +51369,24 @@ declare namespace Phaser { manager: Phaser.Input.InputManager; /** - * If true the DOM mouse events will have event.preventDefault applied to them, if false they will propagate fully. + * If `true` the DOM `mousedown` event will have `preventDefault` set. */ - capture: boolean; + preventDefaultDown: boolean; + + /** + * If `true` the DOM `mouseup` event will have `preventDefault` set. + */ + preventDefaultUp: boolean; + + /** + * If `true` the DOM `mousemove` event will have `preventDefault` set. + */ + preventDefaultMove: boolean; + + /** + * If `true` the DOM `wheel` event will have `preventDefault` set. + */ + preventDefaultWheel: boolean; /** * A boolean that controls if the Mouse Manager is enabled or not. @@ -45386,6 +51468,15 @@ declare namespace Phaser { */ pointerLockChange: Function; + /** + * Are the event listeners hooked into `window.top` or `window`? + * + * This is set during the `boot` sequence. If the browser does not have access to `window.top`, + * such as in cross-origin iframe environments, this property gets set to `false` and the events + * are hooked into `window` instead. + */ + readonly isTop: boolean; + /** * Attempts to disable the context menu from appearing if you right-click on the browser. * @@ -45407,6 +51498,12 @@ declare namespace Phaser { * * It is important to note that pointer lock can only be enabled after an 'engagement gesture', * see: https://w3c.github.io/pointerlock/#dfn-engagement-gesture. + * + * Note for Firefox: There is a bug in certain Firefox releases that cause native DOM events like + * `mousemove` to fire continuously when in pointer lock mode. You can get around this by setting + * `this.preventDefaultMove` to `false` in this class. You may also need to do the same for + * `preventDefaultDown` and/or `preventDefaultUp`. Please test combinations of these if you encounter + * the error. */ requestPointerLock(): void; @@ -45458,7 +51555,7 @@ declare namespace Phaser { * @param manager A reference to the Input Manager. * @param id The internal ID of this Pointer. */ - constructor(manager: Phaser.Input.InputManager, id: integer); + constructor(manager: Phaser.Input.InputManager, id: number); /** * A reference to the Input Manager. @@ -45468,7 +51565,7 @@ declare namespace Phaser { /** * The internal ID of this Pointer. */ - readonly id: integer; + readonly id: number; /** * The most recent native DOM Event this Pointer has processed. @@ -45505,7 +51602,7 @@ declare namespace Phaser { * is zero, it may not have been caused by the button that is physically left–most on the pointing device; * however, it should behave as if the left button was clicked in the standard button layout. */ - readonly button: integer; + readonly button: number; /** * 0: No button or un-initialized @@ -45518,7 +51615,7 @@ declare namespace Phaser { * For a mouse configured for left-handed use, the button actions are reversed. * In this case, the values are read from right to left. */ - buttons: integer; + buttons: number; /** * The position of the Pointer in screen space. @@ -45625,7 +51722,7 @@ declare namespace Phaser { downY: number; /** - * Time when Button 1 (left button), or Touch, was pressed, used for dragging objects. + * The Event timestamp when the first button, or Touch input, was pressed. Used for dragging objects. */ downTime: number; @@ -45640,7 +51737,7 @@ declare namespace Phaser { upY: number; /** - * Time when Button 1 (left button), or Touch, was released, used for dragging objects. + * The Event timestamp when the final button, or Touch input, was released. Used for dragging objects. */ upTime: number; @@ -45828,7 +51925,7 @@ declare namespace Phaser { * duration since the button was pressed down. * * If no button is held down, it will return the last recorded duration, based on the time - * the Pointer button was released. + * the last button on the Pointer was released. */ getDuration(): number; @@ -45870,7 +51967,7 @@ declare namespace Phaser { * @param steps The number of interpolation steps to use. Default 10. * @param out An array to store the results in. If not provided a new one will be created. */ - getInterpolatedPosition(steps?: integer, out?: any[]): any[]; + getInterpolatedPosition(steps?: number, out?: any[]): any[]; /** * Destroys this Pointer instance and resets its external references. @@ -46030,77 +52127,77 @@ declare namespace Phaser { /** * The Loader is idle. */ - var LOADER_IDLE: integer; + var LOADER_IDLE: number; /** * The Loader is actively loading. */ - var LOADER_LOADING: integer; + var LOADER_LOADING: number; /** * The Loader is processing files is has loaded. */ - var LOADER_PROCESSING: integer; + var LOADER_PROCESSING: number; /** * The Loader has completed loading and processing. */ - var LOADER_COMPLETE: integer; + var LOADER_COMPLETE: number; /** * The Loader is shutting down. */ - var LOADER_SHUTDOWN: integer; + var LOADER_SHUTDOWN: number; /** * The Loader has been destroyed. */ - var LOADER_DESTROYED: integer; + var LOADER_DESTROYED: number; /** * File is in the load queue but not yet started */ - var FILE_PENDING: integer; + var FILE_PENDING: number; /** * File has been started to load by the loader (onLoad called) */ - var FILE_LOADING: integer; + var FILE_LOADING: number; /** * File has loaded successfully, awaiting processing */ - var FILE_LOADED: integer; + var FILE_LOADED: number; /** * File failed to load */ - var FILE_FAILED: integer; + var FILE_FAILED: number; /** * File is being processed (onProcess callback) */ - var FILE_PROCESSING: integer; + var FILE_PROCESSING: number; /** * The File has errored somehow during processing. */ - var FILE_ERRORED: integer; + var FILE_ERRORED: number; /** * File has finished processing. */ - var FILE_COMPLETE: integer; + var FILE_COMPLETE: number; /** * File has been destroyed */ - var FILE_DESTROYED: integer; + var FILE_DESTROYED: number; /** * File was populated from local data and doesn't need an HTTP request */ - var FILE_POPULATED: integer; + var FILE_POPULATED: number; namespace Events { /** @@ -46295,7 +52392,7 @@ declare namespace Phaser { /** * The current state of the file. One of the FILE_CONST values. */ - state: integer; + state: number; /** * The total size of this file. @@ -46474,6 +52571,34 @@ declare namespace Phaser { } + /** + * A single JSON based Texture Atlas File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#atlas method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#atlas. + * + * https://www.codeandweb.com/texturepacker/tutorials/how-to-create-sprite-sheets-for-phaser3?source=photonstorm + */ + class AsepriteFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.AsepriteFileConfig, textureURL?: string | string[], atlasURL?: object | string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + /** * A single JSON based Texture Atlas File suitable for loading by the Loader. * @@ -46766,7 +52891,7 @@ declare namespace Phaser { * * @param loader A reference to the Loader that is responsible for this file. * @param key The key to use for this file, or a file configuration object. - * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.txt`, i.e. if `key` was "alien" then the URL will be "alien.html". + * @param url The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.html`, i.e. if `key` was "alien" then the URL will be "alien.html". * @param xhrSettings Extra XHR Settings specifically for this file. */ constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLFileConfig, url?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); @@ -46796,7 +52921,7 @@ declare namespace Phaser { * @param height The height of the texture the HTML will be rendered to. * @param xhrSettings Extra XHR Settings specifically for this file. */ - constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig, url?: string, width?: integer, height?: integer, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig, url?: string, width?: number, height?: number, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); /** * Called automatically by Loader.nextFile. @@ -46925,6 +53050,32 @@ declare namespace Phaser { } + /** + * A single Wavefront OBJ File suitable for loading by the Loader. + * + * These are created when you use the Phaser.Loader.LoaderPlugin#obj method and are not typically created directly. + * + * For documentation about what all the arguments and configuration options mean please see Phaser.Loader.LoaderPlugin#obj. + */ + class OBJFile extends Phaser.Loader.MultiFile { + /** + * + * @param loader A reference to the Loader that is responsible for this file. + * @param key The key to use for this file, or a file configuration object. + * @param objURL The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param matURL The absolute or relative URL to load the material file from. If undefined or `null` it will be set to `.mat`, i.e. if `key` was "alien" then the URL will be "alien.mat". + * @param flipUV Flip the UV coordinates stored in the model data? + * @param xhrSettings Extra XHR Settings specifically for these files. + */ + constructor(loader: Phaser.Loader.LoaderPlugin, key: string | Phaser.Types.Loader.FileTypes.OBJFileConfig, objURL?: string, matURL?: string, flipUV?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject); + + /** + * Adds this file to its target cache upon successful loading and processing. + */ + addToCache(): void; + + } + /** * A single JSON Pack File suitable for loading by the Loader. * @@ -47464,6 +53615,127 @@ declare namespace Phaser { */ animation(key: string | Phaser.Types.Loader.FileTypes.JSONFileConfig | Phaser.Types.Loader.FileTypes.JSONFileConfig[], url?: string, dataKey?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** + * Aseprite is a powerful animated sprite editor and pixel art tool. + * + * You can find more details at https://www.aseprite.org/ + * + * Adds a JSON based Aseprite Animation, or array of animations, to the current load queue. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.aseprite('gladiator', 'images/Gladiator.png', 'images/Gladiator.json'); + * } + * ``` + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * If you call this from outside of `preload` then you are responsible for starting the Loader afterwards and monitoring + * its events to know when it's safe to use the asset. Please see the Phaser.Loader.LoaderPlugin class for more details. + * + * To export a compatible JSON file in Aseprite, please do the following: + * + * 1. Go to "File - Export Sprite Sheet" + * + * 2. On the **Layout** tab: + * 2a. Set the "Sheet type" to "Packed" + * 2b. Set the "Constraints" to "None" + * 2c. Check the "Merge Duplicates" checkbox + * + * 3. On the **Sprite** tab: + * 3a. Set "Layers" to "Visible layers" + * 3b. Set "Frames" to "All frames", unless you only wish to export a sub-set of tags + * + * 4. On the **Borders** tab: + * 4a. Check the "Trim Sprite" and "Trim Cells" options + * 4b. Ensure "Border Padding", "Spacing" and "Inner Padding" are all > 0 (1 is usually enough) + * + * 5. On the **Output** tab: + * 5a. Check "Output File", give your image a name and make sure you choose "png files" as the file type + * 5b. Check "JSON Data" and give your json file a name + * 5c. The JSON Data type can be either a Hash or Array, Phaser doesn't mind. + * 5d. Make sure "Tags" is checked in the Meta options + * 5e. In the "Item Filename" input box, make sure it says just "{frame}" and nothing more. + * + * 6. Click export + * + * This was tested with Aseprite 1.2.25. + * + * This will export a png and json file which you can load using the Aseprite Loader, i.e.: + * + * Phaser can load all common image types: png, jpg, gif and any other format the browser can natively handle. + * + * The key must be a unique String. It is used to add the file to the global Texture Manager upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the Texture Manager. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the Texture Manager first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.aseprite({ + * key: 'gladiator', + * textureURL: 'images/Gladiator.png', + * atlasURL: 'images/Gladiator.json' + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.AsepriteFileConfig` for more details. + * + * Instead of passing a URL for the JSON data you can also pass in a well formed JSON object instead. + * + * Once loaded, you can call this method from within a Scene with the 'atlas' key: + * + * ```javascript + * this.anims.createFromAseprite('paladin'); + * ``` + * + * Any animations defined in the JSON will now be available to use in Phaser and you play them + * via their Tag name. For example, if you have an animation called 'War Cry' on your Aseprite timeline, + * you can play it in Phaser using that Tag name: + * + * ```javascript + * this.add.sprite(400, 300).play('War Cry'); + * ``` + * + * When calling this method you can optionally provide an array of tag names, and only those animations + * will be created. For example: + * + * ```javascript + * this.anims.createFromAseprite('paladin', [ 'step', 'War Cry', 'Magnum Break' ]); + * ``` + * + * This will only create the 3 animations defined. Note that the tag names are case-sensitive. + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `MENU.` and the key was `Background` the final key will be `MENU.Background` and + * this is what you would use to retrieve the image from the Texture Manager. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "alien" + * and no URL is given then the Loader will set the URL to be "alien.png". It will always add `.png` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the Aseprite File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param textureURL The absolute or relative URL to load the texture image file from. If undefined or `null` it will be set to `.png`, i.e. if `key` was "alien" then the URL will be "alien.png". + * @param atlasURL The absolute or relative URL to load the texture atlas json data file from. If undefined or `null` it will be set to `.json`, i.e. if `key` was "alien" then the URL will be "alien.json". Or, a well formed JSON object. + * @param textureXhrSettings An XHR Settings configuration object for the atlas image file. Used in replacement of the Loaders default XHR Settings. + * @param atlasXhrSettings An XHR Settings configuration object for the atlas json file. Used in replacement of the Loaders default XHR Settings. + */ + aseprite(key: string | Phaser.Types.Loader.FileTypes.AsepriteFileConfig | Phaser.Types.Loader.FileTypes.AsepriteFileConfig[], textureURL?: string | string[], atlasURL?: object | string, textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject, atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** * Adds a JSON based Texture Atlas, or array of atlases, to the current load queue. * @@ -48218,7 +54490,7 @@ declare namespace Phaser { * @param height The height of the texture the HTML will be rendered to. Default 512. * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. */ - htmlTexture(key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[], url?: string, width?: integer, height?: integer, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + htmlTexture(key: string | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig | Phaser.Types.Loader.FileTypes.HTMLTextureFileConfig[], url?: string, width?: number, height?: number, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; /** * Adds an Image, or array of Images, to the current load queue. @@ -48535,6 +54807,85 @@ declare namespace Phaser { */ scripts(key: string | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig | Phaser.Types.Loader.FileTypes.MultiScriptFileConfig[], url?: string[], extension?: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** + * Adds a Wavefront OBJ file, or array of OBJ files, to the current load queue. + * + * Note: You should ensure your 3D package has triangulated the OBJ file prior to export. + * + * You can call this method from within your Scene's `preload`, along with any other files you wish to load: + * + * ```javascript + * function preload () + * { + * this.load.obj('ufo', 'files/spaceship.obj'); + * } + * ``` + * + * You can optionally also load a Wavefront Material file as well, by providing the 3rd parameter: + * + * ```javascript + * function preload () + * { + * this.load.obj('ufo', 'files/spaceship.obj', 'files/spaceship.mtl'); + * } + * ``` + * + * If given, the material will be parsed and stored along with the obj data in the cache. + * + * The file is **not** loaded right away. It is added to a queue ready to be loaded either when the loader starts, + * or if it's already running, when the next free load slot becomes available. This happens automatically if you + * are calling this from within the Scene's `preload` method, or a related callback. Because the file is queued + * it means you cannot use the file immediately after calling this method, but must wait for the file to complete. + * The typical flow for a Phaser Scene is that you load assets in the Scene's `preload` method and then when the + * Scene's `create` method is called you are guaranteed that all of those assets are ready for use and have been + * loaded. + * + * The key must be a unique String. It is used to add the file to the global OBJ Cache upon a successful load. + * The key should be unique both in terms of files being loaded and files already present in the OBJ Cache. + * Loading a file using a key that is already taken will result in a warning. If you wish to replace an existing file + * then remove it from the OBJ Cache first, before loading a new one. + * + * Instead of passing arguments you can pass a configuration object, such as: + * + * ```javascript + * this.load.obj({ + * key: 'ufo', + * url: 'files/spaceship.obj', + * matURL: 'files/spaceship.mtl', + * flipUV: true + * }); + * ``` + * + * See the documentation for `Phaser.Types.Loader.FileTypes.OBJFileConfig` for more details. + * + * Once the file has finished loading you can access it from its Cache using its key: + * + * ```javascript + * this.load.obj('ufo', 'files/spaceship.obj'); + * // and later in your game ... + * var data = this.cache.obj.get('ufo'); + * ``` + * + * If you have specified a prefix in the loader, via `Loader.setPrefix` then this value will be prepended to this files + * key. For example, if the prefix was `LEVEL1.` and the key was `Story` the final key will be `LEVEL1.Story` and + * this is what you would use to retrieve the obj from the OBJ Cache. + * + * The URL can be relative or absolute. If the URL is relative the `Loader.baseURL` and `Loader.path` values will be prepended to it. + * + * If the URL isn't specified the Loader will take the key and create a filename from that. For example if the key is "story" + * and no URL is given then the Loader will set the URL to be "story.obj". It will always add `.obj` as the extension, although + * this can be overridden if using an object instead of method arguments. If you do not desire this action then provide a URL. + * + * Note: The ability to load this type of file will only be available if the OBJ File type has been built into Phaser. + * It is available in the default build but can be excluded from custom builds. + * @param key The key to use for this file, or a file configuration object, or array of them. + * @param objURL The absolute or relative URL to load the obj file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + * @param matURL Optional absolute or relative URL to load the obj material file from. + * @param flipUV Flip the UV coordinates stored in the model data? + * @param xhrSettings An XHR Settings configuration object. Used in replacement of the Loaders default XHR Settings. + */ + obj(key: string | Phaser.Types.Loader.FileTypes.OBJFileConfig | Phaser.Types.Loader.FileTypes.OBJFileConfig[], objURL?: string, matURL?: string, flipUV?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): this; + /** * Adds a JSON File Pack, or array of packs, to the current load queue. * @@ -49652,7 +56003,7 @@ declare namespace Phaser { * * The default is 32 but you can change this in your Game Config, or by changing this property before the Loader starts. */ - maxParallelDownloads: integer; + maxParallelDownloads: number; /** * xhr specific global settings (can be overridden on a per-file basis) @@ -49668,7 +56019,7 @@ declare namespace Phaser { * The total number of files to load. It may not always be accurate because you may add to the Loader during the process * of loading, especially if you load a Pack File. Therefore this value can change, but in most cases remains static. */ - totalToLoad: integer; + totalToLoad: number; /** * The progress of the current load queue, as a float value between 0 and 1. @@ -49710,18 +56061,18 @@ declare namespace Phaser { * The total number of files that failed to load during the most recent load. * This value is reset when you call `Loader.start`. */ - totalFailed: integer; + totalFailed: number; /** * The total number of files that successfully loaded during the most recent load. * This value is reset when you call `Loader.start`. */ - totalComplete: integer; + totalComplete: number; /** * The current state of the Loader. */ - readonly state: integer; + readonly state: number; /** * If you want to append a URL before the path of any asset you can set this here. @@ -49968,12 +56319,12 @@ declare namespace Phaser { /** * The number of files to load. */ - pending: integer; + pending: number; /** * The number of files that failed to load. */ - failed: integer; + failed: number; /** * A storage container for transient data that the loading files need. @@ -50041,7 +56392,7 @@ declare namespace Phaser { * @param timeout Optional XHR timeout value. Default 0. * @param withCredentials Optional XHR withCredentials value. Default false. */ - function XHRSettings(responseType?: XMLHttpRequestResponseType, async?: boolean, user?: string, password?: string, timeout?: integer, withCredentials?: boolean): Phaser.Types.Loader.XHRSettingsObject; + function XHRSettings(responseType?: XMLHttpRequestResponseType, async?: boolean, user?: string, password?: string, timeout?: number, withCredentials?: boolean): Phaser.Types.Loader.XHRSettingsObject; } @@ -50186,7 +56537,7 @@ declare namespace Phaser { * @param min The minimum value. * @param max The maximum value. */ - function Between(min: integer, max: integer): integer; + function Between(min: number, max: number): number; /** * Calculates a Catmull-Rom value from the given points, based on an alpha of 0.5. @@ -50206,7 +56557,7 @@ declare namespace Phaser { * @param place The place to round to. Default 0. * @param base The base to round in. Default is 10 for decimal. Default 10. */ - function CeilTo(value: number, place?: number, base?: integer): number; + function CeilTo(value: number, place?: number, base?: number): number; /** * Force a value within the boundaries by clamping it to the range `min`, `max`. @@ -50263,7 +56614,7 @@ declare namespace Phaser { * Convert the given angle from degrees, to the equivalent angle in radians. * @param degrees The angle (in degrees) to convert to radians. */ - function DegToRad(degrees: integer): number; + function DegToRad(degrees: number): number; /** * Calculates the positive difference of two given numbers. @@ -50579,6 +56930,17 @@ declare namespace Phaser { } + class Euler { + /** + * + * @param x The x component. + * @param y The y component. + * @param z The z component. + */ + constructor(x?: number, y?: number, z?: number); + + } + /** * Calculates the factorial of a given number for integer values greater than 0. * @param value A positive integer to calculate the factorial of. @@ -50600,7 +56962,7 @@ declare namespace Phaser { * @param place The place to round to. Default 0. * @param base The base to round in. Default is 10 for decimal. Default 10. */ - function FloorTo(value: number, place?: integer, base?: integer): number; + function FloorTo(value: number, place?: number, base?: number): number; /** * Return a value based on the range between `min` and `max` and the percentage given. @@ -50662,7 +57024,7 @@ declare namespace Phaser { * @param distance The distance. * @param time The time, in seconds. */ - function GetSpeed(distance: number, time: integer): number; + function GetSpeed(distance: number, time: number): number; namespace Interpolation { /** @@ -50858,6 +57220,9 @@ declare namespace Phaser { /** * A four-dimensional matrix. + * + * Adapted from [gl-matrix](https://github.com/toji/gl-matrix) by toji + * and [vecmath](https://github.com/mattdesl/vecmath) by mattdesl */ class Matrix4 { /** @@ -50880,19 +57245,40 @@ declare namespace Phaser { * This method is an alias for `Matrix4.copy`. * @param src The Matrix to set the values of this Matrix's from. */ - set(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + set(src: Phaser.Math.Matrix4): this; + + /** + * Sets all values of this Matrix4. + * @param m00 The m00 value. + * @param m01 The m01 value. + * @param m02 The m02 value. + * @param m03 The m03 value. + * @param m10 The m10 value. + * @param m11 The m11 value. + * @param m12 The m12 value. + * @param m13 The m13 value. + * @param m20 The m20 value. + * @param m21 The m21 value. + * @param m22 The m22 value. + * @param m23 The m23 value. + * @param m30 The m30 value. + * @param m31 The m31 value. + * @param m32 The m32 value. + * @param m33 The m33 value. + */ + setValues(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number): this; /** * Copy the values of a given Matrix into this Matrix. * @param src The Matrix to copy the values from. */ - copy(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + copy(src: Phaser.Math.Matrix4): this; /** * Set the values of this Matrix from the given array. - * @param a The array to copy the values from. + * @param a The array to copy the values from. Must have at least 16 elements. */ - fromArray(a: any[]): Phaser.Math.Matrix4; + fromArray(a: number[]): this; /** * Reset this Matrix. @@ -50901,13 +57287,21 @@ declare namespace Phaser { */ zero(): Phaser.Math.Matrix4; + /** + * Generates a transform matrix based on the given position, scale and rotation. + * @param position The position vector. + * @param scale The scale vector. + * @param rotation The rotation quaternion. + */ + transform(position: Phaser.Math.Vector3, scale: Phaser.Math.Vector3, rotation: Phaser.Math.Quaternion): this; + /** * Set the `x`, `y` and `z` values of this Matrix. * @param x The x value. * @param y The y value. * @param z The z value. */ - xyz(x: number, y: number, z: number): Phaser.Math.Matrix4; + xyz(x: number, y: number, z: number): this; /** * Set the scaling values of this Matrix. @@ -50915,27 +57309,33 @@ declare namespace Phaser { * @param y The y scaling value. * @param z The z scaling value. */ - scaling(x: number, y: number, z: number): Phaser.Math.Matrix4; + scaling(x: number, y: number, z: number): this; /** * Reset this Matrix to an identity (default) matrix. */ - identity(): Phaser.Math.Matrix4; + identity(): this; /** * Transpose this Matrix. */ - transpose(): Phaser.Math.Matrix4; + transpose(): this; + + /** + * Copies the given Matrix4 into this Matrix and then inverses it. + * @param m The Matrix4 to invert into this Matrix4. + */ + getInverse(m: Phaser.Math.Matrix4): this; /** * Invert this Matrix. */ - invert(): Phaser.Math.Matrix4; + invert(): this; /** * Calculate the adjoint, or adjugate, of this Matrix. */ - adjoint(): Phaser.Math.Matrix4; + adjoint(): this; /** * Calculate the determinant of this Matrix. @@ -50946,19 +57346,34 @@ declare namespace Phaser { * Multiply this Matrix by the given Matrix. * @param src The Matrix to multiply this Matrix by. */ - multiply(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + multiply(src: Phaser.Math.Matrix4): this; /** * Multiply the values of this Matrix4 by those given in the `src` argument. * @param src The source Matrix4 that this Matrix4 is multiplied by. */ - multiplyLocal(src: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + multiplyLocal(src: Phaser.Math.Matrix4): this; + + /** + * Multiplies the given Matrix4 object with this Matrix. + * + * This is the same as calling `multiplyMatrices(m, this)`. + * @param m The Matrix4 to multiply with this one. + */ + premultiply(m: Phaser.Math.Matrix4): this; + + /** + * Multiplies the two given Matrix4 objects and stores the results in this Matrix. + * @param a The first Matrix4 to multiply. + * @param b The second Matrix4 to multiply. + */ + multiplyMatrices(a: Phaser.Math.Matrix4, b: Phaser.Math.Matrix4): this; /** * Translate this Matrix using the given Vector. * @param v The Vector to translate this Matrix with. */ - translate(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix4; + translate(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): this; /** * Translate this Matrix using the given values. @@ -50966,7 +57381,7 @@ declare namespace Phaser { * @param y The y component. * @param z The z component. */ - translateXYZ(x: number, y: number, z: number): Phaser.Math.Matrix4; + translateXYZ(x: number, y: number, z: number): this; /** * Apply a scale transformation to this Matrix. @@ -50974,7 +57389,7 @@ declare namespace Phaser { * Uses the `x`, `y` and `z` components of the given Vector to scale the Matrix. * @param v The Vector to scale this Matrix with. */ - scale(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): Phaser.Math.Matrix4; + scale(v: Phaser.Math.Vector3 | Phaser.Math.Vector4): this; /** * Apply a scale transformation to this Matrix. @@ -50982,52 +57397,52 @@ declare namespace Phaser { * @param y The y component. * @param z The z component. */ - scaleXYZ(x: number, y: number, z: number): Phaser.Math.Matrix4; + scaleXYZ(x: number, y: number, z: number): this; /** * Derive a rotation matrix around the given axis. * @param axis The rotation axis. * @param angle The rotation angle in radians. */ - makeRotationAxis(axis: Phaser.Math.Vector3 | Phaser.Math.Vector4, angle: number): Phaser.Math.Matrix4; + makeRotationAxis(axis: Phaser.Math.Vector3 | Phaser.Math.Vector4, angle: number): this; /** * Apply a rotation transformation to this Matrix. * @param rad The angle in radians to rotate by. * @param axis The axis to rotate upon. */ - rotate(rad: number, axis: Phaser.Math.Vector3): Phaser.Math.Matrix4; + rotate(rad: number, axis: Phaser.Math.Vector3): this; /** * Rotate this matrix on its X axis. * @param rad The angle in radians to rotate by. */ - rotateX(rad: number): Phaser.Math.Matrix4; + rotateX(rad: number): this; /** * Rotate this matrix on its Y axis. * @param rad The angle to rotate by, in radians. */ - rotateY(rad: number): Phaser.Math.Matrix4; + rotateY(rad: number): this; /** * Rotate this matrix on its Z axis. * @param rad The angle to rotate by, in radians. */ - rotateZ(rad: number): Phaser.Math.Matrix4; + rotateZ(rad: number): this; /** * Set the values of this Matrix from the given rotation Quaternion and translation Vector. * @param q The Quaternion to set rotation from. * @param v The Vector to set translation from. */ - fromRotationTranslation(q: Phaser.Math.Quaternion, v: Phaser.Math.Vector3): Phaser.Math.Matrix4; + fromRotationTranslation(q: Phaser.Math.Quaternion, v: Phaser.Math.Vector3): this; /** * Set the values of this Matrix from the given Quaternion. * @param q The Quaternion to set the values of this Matrix from. */ - fromQuat(q: Phaser.Math.Quaternion): Phaser.Math.Matrix4; + fromQuat(q: Phaser.Math.Quaternion): this; /** * Generate a frustum matrix with the given bounds. @@ -51038,7 +57453,7 @@ declare namespace Phaser { * @param near The near bound of the frustum. * @param far The far bound of the frustum. */ - frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): Phaser.Math.Matrix4; + frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): this; /** * Generate a perspective projection matrix with the given bounds. @@ -51047,7 +57462,7 @@ declare namespace Phaser { * @param near Near bound of the frustum. * @param far Far bound of the frustum. */ - perspective(fovy: number, aspect: number, near: number, far: number): Phaser.Math.Matrix4; + perspective(fovy: number, aspect: number, near: number, far: number): this; /** * Generate a perspective projection matrix with the given bounds. @@ -51056,7 +57471,7 @@ declare namespace Phaser { * @param near Near bound of the frustum. * @param far Far bound of the frustum. */ - perspectiveLH(width: number, height: number, near: number, far: number): Phaser.Math.Matrix4; + perspectiveLH(width: number, height: number, near: number, far: number): this; /** * Generate an orthogonal projection matrix with the given bounds. @@ -51067,7 +57482,15 @@ declare namespace Phaser { * @param near The near bound of the frustum. * @param far The far bound of the frustum. */ - ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Phaser.Math.Matrix4; + ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): this; + + /** + * Generate a right-handed look-at matrix with the given eye position, target and up axis. + * @param eye Position of the viewer. + * @param target Point the viewer is looking at. + * @param up vec3 pointing up. + */ + lookAtRH(eye: Phaser.Math.Vector3, target: Phaser.Math.Vector3, up: Phaser.Math.Vector3): this; /** * Generate a look-at matrix with the given eye position, focal point, and up axis. @@ -51075,7 +57498,7 @@ declare namespace Phaser { * @param center Point the viewer is looking at * @param up vec3 pointing up. */ - lookAt(eye: Phaser.Math.Vector3, center: Phaser.Math.Vector3, up: Phaser.Math.Vector3): Phaser.Math.Matrix4; + lookAt(eye: Phaser.Math.Vector3, center: Phaser.Math.Vector3, up: Phaser.Math.Vector3): this; /** * Set the values of this matrix from the given `yaw`, `pitch` and `roll` values. @@ -51083,7 +57506,7 @@ declare namespace Phaser { * @param pitch The pitch value. * @param roll The roll value. */ - yawPitchRoll(yaw: number, pitch: number, roll: number): Phaser.Math.Matrix4; + yawPitchRoll(yaw: number, pitch: number, roll: number): this; /** * Generate a world matrix from the given rotation, position, scale, view matrix and projection matrix. @@ -51093,7 +57516,27 @@ declare namespace Phaser { * @param viewMatrix The view matrix. * @param projectionMatrix The projection matrix. */ - setWorldMatrix(rotation: Phaser.Math.Vector3, position: Phaser.Math.Vector3, scale: Phaser.Math.Vector3, viewMatrix?: Phaser.Math.Matrix4, projectionMatrix?: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + setWorldMatrix(rotation: Phaser.Math.Vector3, position: Phaser.Math.Vector3, scale: Phaser.Math.Vector3, viewMatrix?: Phaser.Math.Matrix4, projectionMatrix?: Phaser.Math.Matrix4): this; + + /** + * Multiplies this Matrix4 by the given `src` Matrix4 and stores the results in the `out` Matrix4. + * @param src The Matrix4 to multiply with this one. + * @param out The receiving Matrix. + */ + multiplyToMat4(src: Phaser.Math.Matrix4, out: Phaser.Math.Matrix4): Phaser.Math.Matrix4; + + /** + * Takes the rotation and position vectors and builds this Matrix4 from them. + * @param rotation The rotation vector. + * @param position The position vector. + * @param translateFirst Should the operation translate then rotate (`true`), or rotate then translate? (`false`) + */ + fromRotationXYTranslation(rotation: Phaser.Math.Vector3, position: Phaser.Math.Vector3, translateFirst: boolean): this; + + /** + * Returns the maximum axis scale from this Matrix4. + */ + getMaxScaleOnAxis(): number; } @@ -51130,7 +57573,7 @@ declare namespace Phaser { * Returns the nearest power of 2 to the given `value`. * @param value The value. */ - function GetNext(value: number): integer; + function GetNext(value: number): number; /** * Checks if the given `width` and `height` are a power of two. @@ -51154,13 +57597,19 @@ declare namespace Phaser { class Quaternion { /** * - * @param x The x component. - * @param y The y component. - * @param z The z component. - * @param w The w component. + * @param x The x component. Default 0. + * @param y The y component. Default 0. + * @param z The z component. Default 0. + * @param w The w component. Default 1. */ constructor(x?: number, y?: number, z?: number, w?: number); + /** + * This callback is invoked, if set, each time a value in this quaternion is changed. + * The callback is passed one argument, a reference to this quaternion. + */ + onChangeCallback: Function; + /** * The x component of this Quaternion. */ @@ -51188,13 +57637,14 @@ declare namespace Phaser { copy(src: Phaser.Math.Quaternion | Phaser.Math.Vector4): Phaser.Math.Quaternion; /** - * Set the components of this Quaternion. + * Set the components of this Quaternion and optionally call the `onChangeCallback`. * @param x The x component, or an object containing x, y, z, and w components. Default 0. * @param y The y component. Default 0. * @param z The z component. Default 0. * @param w The w component. Default 0. + * @param update Call the `onChangeCallback`? Default true. */ - set(x?: number | object, y?: number, z?: number, w?: number): Phaser.Math.Quaternion; + set(x?: number | object, y?: number, z?: number, w?: number, update?: boolean): Phaser.Math.Quaternion; /** * Add a given Quaternion or Vector to this Quaternion. Addition is component-wise. @@ -51319,6 +57769,19 @@ declare namespace Phaser { */ calculateW(): Phaser.Math.Quaternion; + /** + * Set this Quaternion from the given Euler, based on Euler order. + * @param euler The Euler to convert from. + * @param update Run the `onChangeCallback`? Default true. + */ + setFromEuler(euler: Phaser.Math.Euler, update?: boolean): Phaser.Math.Quaternion; + + /** + * Sets the rotation of this Quaternion from the given Matrix4. + * @param mat4 The Matrix4 to set the rotation from. + */ + setFromRotationMatrix(mat4: Phaser.Math.Matrix4): Phaser.Math.Quaternion; + /** * Convert the given Matrix into this Quaternion. * @param mat The Matrix to convert from. @@ -51331,7 +57794,7 @@ declare namespace Phaser { * Convert the given angle in radians, to the equivalent angle in degrees. * @param radians The angle in radians to convert ot degrees. */ - function RadToDeg(radians: number): integer; + function RadToDeg(radians: number): number; /** * A seeded Random Data Generator. @@ -51581,7 +58044,7 @@ declare namespace Phaser { * @param place The place to round to. Positive to round the units, negative to round the decimal. Default 0. * @param base The base to round in. Default is 10 for decimal. Default 10. */ - function RoundTo(value: number, place?: integer, base?: integer): number; + function RoundTo(value: number, place?: number, base?: number): number; /** * Generate a series of sine and cosine values. @@ -51667,7 +58130,7 @@ declare namespace Phaser { * @param height The height of the grid. * @param out An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created. */ - function ToXY(index: integer, width: integer, height: integer, out?: Phaser.Math.Vector2): Phaser.Math.Vector2; + function ToXY(index: number, width: number, height: number, out?: Phaser.Math.Vector2): Phaser.Math.Vector2; /** * Takes the `x` and `y` coordinates and transforms them into the same space as @@ -51995,11 +58458,30 @@ declare namespace Phaser { */ up(): Phaser.Math.Vector3; + /** + * Sets the components of this Vector to be the `Math.min` result from the given vector. + * @param v The Vector3 to check the minimum values against. + */ + min(v: Phaser.Math.Vector3): Phaser.Math.Vector3; + + /** + * Sets the components of this Vector to be the `Math.max` result from the given vector. + * @param v The Vector3 to check the maximum values against. + */ + max(v: Phaser.Math.Vector3): Phaser.Math.Vector3; + /** * Make a clone of this Vector3. */ clone(): Phaser.Math.Vector3; + /** + * Adds the two given Vector3s and sets the results into this Vector3. + * @param a The first Vector to add. + * @param b The second Vector to add. + */ + addVectors(a: Phaser.Math.Vector3, b: Phaser.Math.Vector3): Phaser.Math.Vector3; + /** * Calculate the cross (vector) product of two given Vectors. * @param a The first Vector to multiply. @@ -52029,12 +58511,49 @@ declare namespace Phaser { */ set(x: number | object, y?: number, z?: number): Phaser.Math.Vector3; + /** + * Sets the components of this Vector3 from the position of the given Matrix4. + * @param mat4 The Matrix4 to get the position from. + */ + setFromMatrixPosition(mat4: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Sets the components of this Vector3 from the Matrix4 column specified. + * @param mat4 The Matrix4 to get the column from. + * @param index The column index. + */ + setFromMatrixColumn(mat4: Phaser.Math.Matrix4, index: number): Phaser.Math.Vector3; + + /** + * Sets the components of this Vector3 from the given array, based on the offset. + * + * Vector3.x = array[offset] + * Vector3.y = array[offset + 1] + * Vector3.z = array[offset + 2] + * @param array The array of values to get this Vector from. + * @param offset The offset index into the array. Default 0. + */ + fromArray(array: number[], offset?: number): Phaser.Math.Vector3; + /** * Add a given Vector to this Vector. Addition is component-wise. * @param v The Vector to add to this Vector. */ add(v: Phaser.Math.Vector2 | Phaser.Math.Vector3): Phaser.Math.Vector3; + /** + * Add the given value to each component of this Vector. + * @param s The amount to add to this Vector. + */ + addScalar(s: number): Phaser.Math.Vector3; + + /** + * Add and scale a given Vector to this Vector. Addition is component-wise. + * @param v The Vector to add to this Vector. + * @param scale The amount to scale `v` by. + */ + addScale(v: Phaser.Math.Vector2 | Phaser.Math.Vector3, scale: number): Phaser.Math.Vector3; + /** * Subtract the given Vector from this Vector. Subtraction is component-wise. * @param v The Vector to subtract from this Vector. @@ -52118,6 +58637,18 @@ declare namespace Phaser { */ lerp(v: Phaser.Math.Vector3, t?: number): Phaser.Math.Vector3; + /** + * Takes a Matrix3 and applies it to this Vector3. + * @param mat3 The Matrix3 to apply to this Vector3. + */ + applyMatrix3(mat3: Phaser.Math.Matrix3): Phaser.Math.Vector3; + + /** + * Takes a Matrix4 and applies it to this Vector3. + * @param mat4 The Matrix4 to apply to this Vector3. + */ + applyMatrix4(mat4: Phaser.Math.Matrix4): Phaser.Math.Vector3; + /** * Transform this Vector with the given Matrix. * @param mat The Matrix3 to transform this Vector3 with. @@ -52125,7 +58656,7 @@ declare namespace Phaser { transformMat3(mat: Phaser.Math.Matrix3): Phaser.Math.Vector3; /** - * Transform this Vector with the given Matrix. + * Transform this Vector with the given Matrix4. * @param mat The Matrix4 to transform this Vector3 with. */ transformMat4(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; @@ -52149,6 +58680,20 @@ declare namespace Phaser { */ project(mat: Phaser.Math.Matrix4): Phaser.Math.Vector3; + /** + * Multiplies this Vector3 by the given view and projection matrices. + * @param viewMatrix A View Matrix. + * @param projectionMatrix A Projection Matrix. + */ + projectViewMatrix(viewMatrix: Phaser.Math.Matrix4, projectionMatrix: Phaser.Math.Matrix4): Phaser.Math.Vector3; + + /** + * Multiplies this Vector3 by the given inversed projection matrix and world matrix. + * @param projectionMatrix An inversed Projection Matrix. + * @param worldMatrix A World View Matrix. + */ + unprojectViewMatrix(projectionMatrix: Phaser.Math.Matrix4, worldMatrix: Phaser.Math.Matrix4): Phaser.Math.Vector3; + /** * Unproject this point from 2D space to 3D space. * The point should have its x and y properties set to @@ -52421,24 +58966,24 @@ declare namespace Phaser { * The width of the grid in items (not pixels). -1 means lay all items out horizontally, regardless of quantity. * If both this value and height are set to -1 then this value overrides it and the `height` value is ignored. */ - width?: integer; + width?: number; /** * The height of the grid in items (not pixels). -1 means lay all items out vertically, regardless of quantity. * If both this value and `width` are set to -1 then `width` overrides it and this value is ignored. */ - height?: integer; + height?: number; /** * The width of the cell, in pixels, in which the item is positioned. */ - cellWidth?: integer; + cellWidth?: number; /** * The height of the cell, in pixels, in which the item is positioned. */ - cellHeight?: integer; + cellHeight?: number; /** * The alignment position. One of the Phaser.Display.Align consts such as `TOP_LEFT` or `RIGHT_CENTER`. */ - position?: integer; + position?: number; /** * Optionally place the top-left of the final grid at this coordinate. */ @@ -52458,9 +59003,13 @@ declare namespace Phaser { */ key?: string; /** - * An object containing data used to generate the frames for the animation + * Either a string, in which case it will use all frames from a texture with the matching key, or an array of Animation Frame configuration objects. */ - frames?: Phaser.Types.Animations.AnimationFrame[]; + frames?: string | Phaser.Types.Animations.AnimationFrame[]; + /** + * If you provide a string for `frames` you can optionally have the frame names numerically sorted. + */ + sortFrames?: boolean; /** * The key of the texture all frames of the animation will use. Can be overridden on a per frame basis. */ @@ -52468,11 +59017,11 @@ declare namespace Phaser { /** * The frame rate of playback in frames per second (default 24 if duration is null) */ - frameRate?: integer; + frameRate?: number; /** * How long the animation should play for in milliseconds. If not given its derived from frameRate. */ - duration?: integer; + duration?: number; /** * Skip frames if the time lags, or always advanced anyway? */ @@ -52480,15 +59029,15 @@ declare namespace Phaser { /** * Delay before starting playback. Value given in milliseconds. */ - delay?: integer; + delay?: number; /** * Number of times to repeat the animation (-1 for infinity) */ - repeat?: integer; + repeat?: number; /** * Delay before the animation repeats. Value given in milliseconds. */ - repeatDelay?: integer; + repeatDelay?: number; /** * Should the animation yoyo? (reverse back down to the start) before repeating? */ @@ -52505,13 +59054,13 @@ declare namespace Phaser { type AnimationFrame = { /** - * The key that the animation will be associated with. i.e. sprite.animations.play(key) + * The key of the texture within the Texture Manager to use for this Animation Frame. */ - key: string; + key?: string; /** - * The key, or index number, of the frame within the animation. + * The key, or index number, of the frame within the texture to use for this Animation Frame. */ - frame: string | number; + frame?: string | number; /** * The duration, in ms, of this frame of the animation. */ @@ -52530,11 +59079,11 @@ declare namespace Phaser { /** * If `frames` is not provided, the number of the first frame to return. */ - start?: integer; + start?: number; /** * If `frames` is not provided, the number of the last frame to return. */ - end?: integer; + end?: number; /** * The string to append to every resulting frame name if using a range or an array of `frames`. */ @@ -52542,7 +59091,7 @@ declare namespace Phaser { /** * The minimum expected lengths of each resulting frame's number. Numbers will be left-padded with zeroes until they are this long, then prepended and appended to create the resulting frame name. */ - zeroPad?: integer; + zeroPad?: number; /** * The array to append the created configuration objects to. */ @@ -52550,22 +59099,22 @@ declare namespace Phaser { /** * If provided as an array, the range defined by `start` and `end` will be ignored and these frame numbers will be used. */ - frames?: boolean | integer[]; + frames?: boolean | number[]; }; type GenerateFrameNumbers = { /** * The starting frame of the animation. */ - start?: integer; + start?: number; /** * The ending frame of the animation. */ - end?: integer; + end?: number; /** * A frame to put at the beginning of the animation, before `start` or `outputArray` or `frames`. */ - first?: boolean | integer; + first?: boolean | number; /** * An array to concatenate the output onto. */ @@ -52573,7 +59122,7 @@ declare namespace Phaser { /** * A custom sequence of frames. */ - frames?: boolean | integer[]; + frames?: boolean | number[]; }; type JSONAnimation = { @@ -52592,11 +59141,11 @@ declare namespace Phaser { /** * The frame rate of playback in frames per second (default 24 if duration is null) */ - frameRate: integer; + frameRate: number; /** * How long the animation should play for in milliseconds. If not given its derived from frameRate. */ - duration: integer; + duration: number; /** * Skip frames if the time lags, or always advanced anyway? */ @@ -52604,15 +59153,15 @@ declare namespace Phaser { /** * Delay before starting playback. Value given in milliseconds. */ - delay: integer; + delay: number; /** * Number of times to repeat the animation (-1 for infinity) */ - repeat: integer; + repeat: number; /** * Delay before the animation repeats. Value given in milliseconds. */ - repeatDelay: integer; + repeatDelay: number; /** * Should the animation yoyo? (reverse back down to the start) before repeating? */ @@ -52635,7 +59184,7 @@ declare namespace Phaser { /** * The key of the Frame within the Texture that this AnimationFrame uses. */ - frame: string | integer; + frame: string | number; /** * Additional time (in ms) that this frame should appear for during playback. */ @@ -52653,6 +59202,53 @@ declare namespace Phaser { globalTimeScale: number; }; + type PlayAnimationConfig = { + /** + * The string-based key of the animation to play, or an Animation instance. + */ + key: string | Phaser.Animations.Animation; + /** + * The frame rate of playback in frames per second (default 24 if duration is null) + */ + frameRate?: number; + /** + * How long the animation should play for in milliseconds. If not given its derived from frameRate. + */ + duration?: number; + /** + * Delay before starting playback. Value given in milliseconds. + */ + delay?: number; + /** + * Number of times to repeat the animation (-1 for infinity) + */ + repeat?: number; + /** + * Delay before the animation repeats. Value given in milliseconds. + */ + repeatDelay?: number; + /** + * Should the animation yoyo? (reverse back down to the start) before repeating? + */ + yoyo?: boolean; + /** + * Should sprite.visible = true when the animation starts to play? + */ + showOnStart?: boolean; + /** + * Should sprite.visible = false when the animation finishes? + */ + hideOnComplete?: boolean; + /** + * The frame of the animation to start playback from. + */ + startFrame?: number; + /** + * The time scale to be applied to playback of this animation. + */ + timeScale?: number; + }; + } namespace Cameras { @@ -52665,19 +59261,19 @@ declare namespace Phaser { /** * The horizontal position of the Camera viewport. */ - x?: integer; + x?: number; /** * The vertical position of the Camera viewport. */ - y?: integer; + y?: number; /** * The width of the Camera viewport. */ - width?: integer; + width?: number; /** * The height of the Camera viewport. */ - height?: integer; + height?: number; /** * The default zoom level of the Camera. */ @@ -52959,11 +59555,11 @@ declare namespace Phaser { /** * The minimum acceptable rendering rate, in frames per second. */ - min?: integer; + min?: number; /** - * The optimum rendering rate, in frames per second. + * The optimum rendering rate, in frames per second. This does not enforce the fps rate, it merely tells Phaser what rate is considered optimal for this game. */ - target?: integer; + target?: number; /** * Use setTimeout instead of requestAnimationFrame to run the game loop. */ @@ -52971,11 +59567,11 @@ declare namespace Phaser { /** * Calculate the average frame delta from this many consecutive frame intervals. */ - deltaHistory?: integer; + deltaHistory?: number; /** * The amount of frames the time step counts before we trust the delta values again. */ - panicMax?: integer; + panicMax?: number; /** * Apply delta smoothing during the game update to help avoid spikes? */ @@ -52986,19 +59582,15 @@ declare namespace Phaser { /** * The width of the game, in game pixels. */ - width?: integer | string; + width?: number | string; /** * The height of the game, in game pixels. */ - height?: integer | string; + height?: number | string; /** * Simple scale applied to the game canvas. 2 is double size, 0.5 is half size, etc. */ zoom?: number; - /** - * The size of each game pixel, in canvas pixels. Values larger than 1 are "high" resolution. - */ - resolution?: number; /** * Which renderer to use. Phaser.AUTO, Phaser.CANVAS, Phaser.HEADLESS, or Phaser.WEBGL. AUTO picks WEBGL if available, otherwise CANVAS. */ @@ -53107,6 +59699,10 @@ declare namespace Phaser { * The Audio Configuration object. */ audio?: Phaser.Types.Core.AudioConfig; + /** + * A WebGL Pipeline configuration object. Can also be part of the `RenderConfig`. + */ + pipeline?: Phaser.Types.Core.PipelineConfig; }; type GamepadInputConfig = { @@ -53118,13 +59714,17 @@ declare namespace Phaser { type ImagesConfig = { /** - * URL to use for the 'default' texture. + * A base64 encoded image file to use as the 'default' texture. */ default?: string; /** - * URL to use for the 'missing' texture. + * A base64 encoded image file to use as the 'missing' texture. */ missing?: string; + /** + * A base64 encoded image file to use as the 'white' texture. + */ + white?: string; }; type InputConfig = { @@ -53147,7 +59747,7 @@ declare namespace Phaser { /** * The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}. */ - activePointers?: integer; + activePointers?: number; /** * The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}. */ @@ -53166,7 +59766,7 @@ declare namespace Phaser { /** * `preventDefault` will be called on every non-modified key which has a key code in this array. By default it is empty. */ - capture?: integer[]; + capture?: number[]; }; type LoaderConfig = { @@ -53181,7 +59781,7 @@ declare namespace Phaser { /** * The maximum number of resources the loader will start loading at once. */ - maxParallelDownloads?: integer; + maxParallelDownloads?: number; /** * 'anonymous', 'use-credentials', or `undefined`. If you're not making cross-origin requests, leave this as `undefined`. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes}. */ @@ -53205,7 +59805,7 @@ declare namespace Phaser { /** * Optional XHR timeout value, in ms. */ - timeout?: integer; + timeout?: number; }; type MouseInputConfig = { @@ -53214,9 +59814,21 @@ declare namespace Phaser { */ target?: any; /** - * Whether mouse input events have `preventDefault` called on them. + * If `true` the DOM `mousedown` event will have `preventDefault` set. */ - capture?: boolean; + preventDefaultDown?: boolean; + /** + * If `true` the DOM `mouseup` event will have `preventDefault` set. + */ + preventDefaultUp?: boolean; + /** + * If `true` the DOM `mousemove` event will have `preventDefault` set. + */ + preventDefaultMove?: boolean; + /** + * If `true` the DOM `wheel` event will have `preventDefault` set. + */ + preventDefaultWheel?: boolean; }; /** @@ -53239,6 +59851,17 @@ declare namespace Phaser { matter?: Phaser.Types.Physics.Matter.MatterWorldConfig; }; + type PipelineConfig = { + /** + * The name of the pipeline. Must be unique within the Pipeline Manager. + */ + name: string; + /** + * The pipeline class. This should be a constructable object, **not** an instance of a class. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + }; + type PluginObject = { /** * Global plugins to install. @@ -53331,36 +59954,40 @@ declare namespace Phaser { */ powerPreference?: string; /** - * The default WebGL batch size. + * The default WebGL batch size. Represents the number of _quads_ that can be added to a single batch. */ - batchSize?: integer; + batchSize?: number; /** * The maximum number of lights allowed to be visible within range of a single Camera in the LightManager. */ - maxLights?: integer; + maxLights?: number; + /** + * When in WebGL mode, this sets the maximum number of GPU Textures to use. The default, -1, will use all available units. The WebGL1 spec says all browsers should provide a minimum of 8. + */ + maxTextures?: number; /** * The mipmap magFilter to be used when creating WebGL textures. */ mipmapFilter?: string; + /** + * The WebGL Pipeline configuration object. + */ + pipline?: Phaser.Types.Core.PipelineConfig; }; type ScaleConfig = { /** * The base width of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. */ - width?: integer | string; + width?: number | string; /** * The base height of your game. Can be an integer or a string: '100%'. If a string it will only work if you have set a parent element that has a size. */ - height?: integer | string; + height?: number | string; /** * The zoom value of the game canvas. */ - zoom?: Phaser.Scale.ZoomType | integer; - /** - * The rendering resolution of the canvas. This is reserved for future use and is currently ignored. - */ - resolution?: number; + zoom?: Phaser.Scale.ZoomType | number; /** * The DOM element that will contain the game canvas, or its `id`. If undefined, or if the named element doesn't exist, the game canvas is inserted directly into the document body. If `null` no parent will be used and you are responsible for adding the canvas to your environment. */ @@ -53392,7 +60019,7 @@ declare namespace Phaser { /** * How many ms should elapse before checking if the browser size has changed? */ - resizeInterval?: integer; + resizeInterval?: number; /** * The DOM element that will be sent into full screen mode, or its `id`. If undefined Phaser will create its own div and insert the canvas into it when entering fullscreen mode. */ @@ -53416,11 +60043,11 @@ declare namespace Phaser { /** * The width. */ - width?: integer; + width?: number; /** * The height. */ - height?: integer; + height?: number; }; } @@ -53557,11 +60184,11 @@ declare namespace Phaser { /** * The start angle of the ellipse, in degrees. */ - startAngle?: integer; + startAngle?: number; /** * The end angle of the ellipse, in degrees. */ - endAngle?: integer; + endAngle?: number; /** * Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) */ @@ -53569,7 +60196,7 @@ declare namespace Phaser { /** * The rotation of the ellipse, in degrees. */ - rotation?: integer; + rotation?: number; }; type JSONCurve = { @@ -53607,11 +60234,11 @@ declare namespace Phaser { /** * The start angle of the ellipse, in degrees. */ - startAngle: integer; + startAngle: number; /** * The end angle of the ellipse, in degrees. */ - endAngle: integer; + endAngle: number; /** * Sets if the the ellipse rotation is clockwise (true) or anti-clockwise (false) */ @@ -53619,7 +60246,7 @@ declare namespace Phaser { /** * The rotation of ellipse, in degrees. */ - rotation: integer; + rotation: number; }; type JSONPath = { @@ -53709,6 +60336,8 @@ declare namespace Phaser { * The font data for an individual character of a Bitmap Font. * * Describes the character's position, size, offset and kerning. + * + * As of version 3.50 it also includes the WebGL texture uv data. */ type BitmapFontCharacterData = { /** @@ -53743,6 +60372,22 @@ declare namespace Phaser { * The y offset of the character. */ yOffset: number; + /** + * WebGL texture u0. + */ + u0: number; + /** + * WebGL texture v0. + */ + v0: number; + /** + * WebGL texture u1. + */ + u1: number; + /** + * WebGL texture v1. + */ + v1: number; /** * Extra data for the character. */ @@ -53779,6 +60424,63 @@ declare namespace Phaser { chars: {[key: number]: Phaser.Types.GameObjects.BitmapText.BitmapFontCharacterData}; }; + /** + * A single entry from the `BitmapTextSize` characters array. + * + * The position and dimensions take the font size into account, + * but are not translated into the local space of the Game Object itself. + */ + type BitmapTextCharacter = { + /** + * The index of this character within the BitmapText text string. + */ + i: number; + /** + * The character. + */ + char: string; + /** + * The character code of the character. + */ + code: number; + /** + * The x position of the character in the BitmapText. + */ + x: number; + /** + * The y position of the character in the BitmapText. + */ + y: number; + /** + * The width of the character. + */ + w: number; + /** + * The height of the character. + */ + h: number; + /** + * The top of the line this character is on. + */ + t: number; + /** + * The right-most point of this character, including xAdvance. + */ + r: number; + /** + * The bottom of the line this character is on. + */ + b: number; + /** + * The line number the character appears on. + */ + line: number; + /** + * Reference to the glyph object this character is using. + */ + glyph: Phaser.Types.GameObjects.BitmapText.BitmapFontCharacterData; + }; + type BitmapTextConfig = Phaser.Types.GameObjects.GameObjectConfig & { /** * The key of the font to use from the BitmapFont cache. @@ -53794,6 +60496,28 @@ declare namespace Phaser { size?: number | false; }; + /** + * Details about the line data in the `BitmapTextSize` object. + */ + type BitmapTextLines = { + /** + * The width of the shortest line of text. + */ + shortest: number; + /** + * The width of the longest line of text. + */ + longest: number; + /** + * The height of a line of text. + */ + height: number; + /** + * An array where each entry contains the length of that line of text. + */ + lengths: number[]; + }; + type BitmapTextSize = { /** * The position and size of the BitmapText, taking into account the position and scale of the Game Object. @@ -53803,6 +60527,64 @@ declare namespace Phaser { * The position and size of the BitmapText, taking just the font size into account. */ local: Phaser.Types.GameObjects.BitmapText.LocalBitmapTextSize; + /** + * Data about the lines of text within the BitmapText. + */ + lines: Phaser.Types.GameObjects.BitmapText.BitmapTextLines; + /** + * An array containing per-character data. Only populated if `includeChars` is `true` in the `getTextBounds` call. + */ + characters: Phaser.Types.GameObjects.BitmapText.BitmapTextCharacter[]; + /** + * An array containing the word data from the BitmapText. + */ + words: Phaser.Types.GameObjects.BitmapText.BitmapTextWord[]; + /** + * The scale of the BitmapText font being rendered vs. font size in the text data. + */ + scale: number; + /** + * The scale X value of the BitmapText. + */ + scaleX: number; + /** + * The scale Y value of the BitmapText. + */ + scaleY: number; + /** + * The wrapped text, if wrapping enabled and required. + */ + wrappedText: string; + }; + + /** + * Details about a single world entry in the `BitmapTextSize` object words array. + */ + type BitmapTextWord = { + /** + * The x position of the word in the BitmapText. + */ + x: number; + /** + * The y position of the word in the BitmapText. + */ + y: number; + /** + * The width of the word. + */ + w: number; + /** + * The height of the word. + */ + h: number; + /** + * The index of the word within the line. + */ + i: number; + /** + * The word. + */ + word: string; }; type DisplayCallbackConfig = { @@ -53888,7 +60670,7 @@ declare namespace Phaser { /** * The alignment of the text in a multi-line BitmapText object. */ - align: integer; + align: number; }; /** @@ -54011,7 +60793,7 @@ declare namespace Phaser { }; /** - * Options for the Graphics game Object. + * Options for the Graphics Game Object. */ type Options = Phaser.Types.GameObjects.Graphics.Styles & { /** @@ -54026,19 +60808,19 @@ declare namespace Phaser { type RoundedRectRadius = { /** - * Top left + * Top left corner radius. */ tl?: number; /** - * Top right + * Top right corner radius. */ tr?: number; /** - * Bottom right + * Bottom right corner radius. */ br?: number; /** - * Bottom left + * Bottom left corner radius. */ bl?: number; }; @@ -54086,7 +60868,7 @@ declare namespace Phaser { /** * Sets {@link Phaser.GameObjects.Group#defaultFrame}. */ - defaultFrame?: string | integer; + defaultFrame?: string | number; /** * Sets {@link Phaser.GameObjects.Group#runChildUpdate}. */ @@ -54126,11 +60908,11 @@ declare namespace Phaser { /** * The texture frame of each new Game Object. */ - frame?: string | string[] | integer | integer[]; + frame?: string | string[] | number | number[]; /** * The number of Game Objects to create. If set, this overrides the `frameQuantity` value. Use `frameQuantity` for more advanced control. */ - quantity?: integer; + quantity?: number; /** * The visible state of each new Game Object. */ @@ -54142,7 +60924,7 @@ declare namespace Phaser { /** * The number of times each `key` × `frame` combination will be *repeated* (after the first combination). */ - repeat?: integer; + repeat?: number; /** * Select a `key` at random. */ @@ -54158,11 +60940,11 @@ declare namespace Phaser { /** * The number of times each `frame` should be combined with one `key`. */ - frameQuantity?: integer; + frameQuantity?: number; /** * The maximum number of new Game Objects to create. 0 is no maximum. */ - max?: integer; + max?: number; setXY?: object; /** * The horizontal position of each new Game Object. @@ -54206,6 +60988,23 @@ declare namespace Phaser { * Increment each Game object's vertical scale from the previous by this amount, starting from `setScale.y`. */ "setScale.stepY"?: number; + setOrigin?: object; + /** + * The horizontal origin of each new Game Object. + */ + "setOrigin.x"?: number; + /** + * The vertical origin of each new Game Object. + */ + "setOrigin.y"?: number; + /** + * Increment each Game Object's horizontal origin from the previous by this amount, starting from `setOrigin.x`. + */ + "setOrigin.stepX"?: number; + /** + * Increment each Game object's vertical origin from the previous by this amount, starting from `setOrigin.y`. + */ + "setOrigin.stepY"?: number; setAlpha?: object; /** * The alpha value of each new Game Object. @@ -54273,7 +61072,7 @@ declare namespace Phaser { getPoints: Phaser.Types.GameObjects.Particles.EdgeZoneSourceCallback; }; - type EdgeZoneSourceCallback = (quantity: integer, stepRate?: number)=>void; + type EdgeZoneSourceCallback = (quantity: number, stepRate?: number)=>void; type EmitterOpCustomEmitConfig = { /** @@ -54306,9 +61105,13 @@ declare namespace Phaser { */ end: number; /** - * The name of the easing function. + * The ease to find. This can be either a string from the EaseMap, or a custom function. */ - ease?: string; + ease?: string | Function; + /** + * An optional array of ease parameters to go with the ease. + */ + easeParams?: number[]; }; /** @@ -54514,7 +61317,7 @@ declare namespace Phaser { /** * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#maxParticles}. */ - maxParticles?: integer; + maxParticles?: number; /** * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#name}. */ @@ -54638,7 +61441,11 @@ declare namespace Phaser { /** * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setEmitZone}. */ - emitZone?: object; + emitZone?: Phaser.Types.GameObjects.Particles.ParticleEmitterEdgeZoneConfig | Phaser.Types.GameObjects.Particles.ParticleEmitterRandomZoneConfig; + /** + * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setDeathZone}. + */ + deathZone?: Phaser.Types.GameObjects.Particles.ParticleEmitterDeathZoneConfig; /** * As {@link Phaser.GameObjects.Particles.ParticleEmitter#setBounds}. */ @@ -54659,6 +61466,10 @@ declare namespace Phaser { * Sets {@link Phaser.GameObjects.Particles.ParticleEmitter#frames}. */ frame?: number | number[] | string | string[] | Phaser.Textures.Frame | Phaser.Textures.Frame[] | Phaser.Types.GameObjects.Particles.ParticleEmitterFrameConfig; + /** + * Creates specified number of inactive particles and adds them to this emitter's pool. {@link Phaser.GameObjects.Particles.ParticleEmitter#reserve} + */ + reserve?: number; }; type ParticleEmitterDeathZoneConfig = { @@ -54684,7 +61495,7 @@ declare namespace Phaser { /** * The number of particles to place on the source edge. Set to 0 to use `stepRate` instead. */ - quantity: integer; + quantity: number; /** * The distance between each particle. When set, `quantity` is implied and should be set to 0. */ @@ -54711,7 +61522,7 @@ declare namespace Phaser { /** * The number of consecutive particles receiving each texture frame, when `cycle` is true. */ - quantity?: integer; + quantity?: number; }; type ParticleEmitterRandomZoneConfig = { @@ -54732,7 +61543,7 @@ declare namespace Phaser { getRandomPoint: Phaser.Types.GameObjects.Particles.RandomZoneSourceCallback; }; - type RandomZoneSourceCallback = (point: Phaser.Math.Vector2)=>void; + type RandomZoneSourceCallback = (point: Phaser.Types.Math.Vector2Like)=>void; } @@ -54818,6 +61629,51 @@ declare namespace Phaser { } namespace Text { + /** + * Results object from a call to GetTextSize. + */ + type GetTextSizeObject = { + /** + * The width of the longest line in the Text object. + */ + width: number; + /** + * The height of the Text object. + */ + height: number; + /** + * The number of lines in the Text object. + */ + lines: number; + /** + * An array of the lines for each line in the Text object. + */ + lineWidths: number[]; + /** + * The line spacing of the Text object. + */ + lineSpacing: number; + /** + * The height of a line factoring in font and stroke. + */ + lineHeight: number; + }; + + type TextConfig = Phaser.Types.GameObjects.GameObjectConfig & { + /** + * The text this Text object will display. + */ + text?: string | string[]; + /** + * The Text style configuration object. + */ + style?: Phaser.Types.GameObjects.Text.TextStyle; + /** + * A Text Padding object. + */ + padding?: Phaser.Types.GameObjects.Text.TextPadding; + }; + /** * Font metrics for a Text Style object. */ @@ -54912,6 +61768,10 @@ declare namespace Phaser { * Any addition font styles, such as 'strong'. */ fontStyle?: string; + /** + * The font family or font settings to set. Overrides the other font settings. + */ + font?: string; /** * A solid fill color that is rendered behind the Text object. Given as a CSS string color such as `#ff0`. */ @@ -54943,7 +61803,7 @@ declare namespace Phaser { /** * The maximum number of lines to display within the Text object. */ - maxLines?: integer; + maxLines?: number; /** * Force the Text object to have the exact width specified in this property. Leave as zero for it to change accordingly to content. */ @@ -55019,11 +61879,11 @@ declare namespace Phaser { /** * The width of the Tile Sprite. If zero it will use the size of the texture frame. */ - width?: integer; + width?: number; /** * The height of the Tile Sprite. If zero it will use the size of the texture frame. */ - height?: integer; + height?: number; /** * The key of the Texture this Tile Sprite will use to render with, as stored in the Texture Manager. */ @@ -55036,6 +61896,25 @@ declare namespace Phaser { } + type Face = { + /** + * The first face vertex. + */ + vertex1: Phaser.Types.GameObjects.Vertex; + /** + * The second face vertex. + */ + vertex2: Phaser.Types.GameObjects.Vertex; + /** + * The third face vertex. + */ + vertex3: Phaser.Types.GameObjects.Vertex; + /** + * Are the vertices counter-clockwise? + */ + isCounterClockwise: boolean; + }; + type GameObjectConfig = { /** * The x position of the Game Object. @@ -55099,6 +61978,21 @@ declare namespace Phaser { add?: boolean; }; + type GetCalcMatrixResults = { + /** + * The calculated Camera matrix. + */ + camera: Phaser.GameObjects.Components.TransformMatrix; + /** + * The calculated Sprite (Game Object) matrix. + */ + sprite: Phaser.GameObjects.Components.TransformMatrix; + /** + * The calculated results matrix, factoring all others in. + */ + calc: Phaser.GameObjects.Components.TransformMatrix; + }; + type JSONGameObject = { /** * The name of this Game Object. @@ -55163,11 +62057,11 @@ declare namespace Phaser { /** * The Scale Mode being used by this Game Object. */ - scaleMode: integer; + scaleMode: number; /** * Sets the Blend Mode being used by this Game Object. */ - blendMode: integer | string; + blendMode: number | string; /** * The texture key of this Game Object. */ @@ -55182,6 +62076,227 @@ declare namespace Phaser { data: object; }; + type Vertex = { + /** + * The x coordinate of the vertex. + */ + x: number; + /** + * The y coordinate of the vertex. + */ + y: number; + /** + * The z coordinate of the vertex. + */ + z: number; + /** + * The x normal of the vertex. + */ + normalX: number; + /** + * The y normal of the vertex. + */ + normalY: number; + /** + * The z normal of the vertex. + */ + normalZ: number; + /** + * UV u texture coordinate of the vertex. + */ + u: number; + /** + * UV v texture coordinate of the vertex. + */ + v: number; + /** + * The alpha value of the vertex. + */ + alpha: number; + }; + + } + + namespace Geom { + namespace Mesh { + type GenerateGridConfig = { + /** + * The texture to be used for this Grid. Must be a Texture instance. Can also be a string but only if the `mesh` property is set. + */ + texture: string | Phaser.Textures.Texture; + /** + * The name or index of the frame within the Texture. + */ + frame?: string | number; + /** + * If specified, the vertices of the generated grid will be added to this Mesh Game Object. + */ + mesh?: Phaser.GameObjects.Mesh; + /** + * The width of the grid in 3D units. If you wish to get a pixel accurate grid based on a texture, you can use an Ortho Mesh or the `isOrtho` parameter. + */ + width?: number; + /** + * The height of the grid in 3D units. + */ + height?: number; + /** + * The number of segments to split the grid horizontally in to. + */ + widthSegments?: number; + /** + * The number of segments to split the grid vertically in to. + */ + heightSegments?: number; + /** + * Offset the grid x position by this amount. + */ + x?: number; + /** + * Offset the grid y position by this amount. + */ + y?: number; + /** + * An array of colors, one per vertex, or a single color value applied to all vertices. + */ + colors?: number | number[]; + /** + * An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + */ + alphas?: number | number[]; + /** + * Should the texture tile (repeat) across the grid segments, or display as a single texture? + */ + tile?: boolean; + /** + * If set and using a texture with an ortho Mesh, the `width` and `height` parameters will be calculated based on the frame size for you. + */ + isOrtho?: boolean; + /** + * If set and using a texture, vertically flipping render result. + */ + flipY?: boolean; + }; + + type GenerateGridVertsResult = { + /** + * An array of vertex values in x, y pairs. + */ + verts: number[]; + /** + * An array of vertex indexes. This array will be empty if the `tile` parameter was `true`. + */ + indices: number[]; + /** + * An array of UV values, two per vertex. + */ + uvs: number[]; + /** + * An array of colors, one per vertex, or a single color value applied to all vertices. + */ + colors?: number | number[]; + /** + * An array of alpha values, one per vertex, or a single alpha value applied to all vertices. + */ + alphas?: number | number[]; + }; + + type GenerateVertsResult = { + /** + * An array of Face objects generated from the OBJ Data. + */ + faces: Phaser.Geom.Mesh.Face[]; + /** + * An array of Vertex objects generated from the OBJ Data. + */ + verts: Phaser.Geom.Mesh.Vertex[]; + }; + + type OBJData = { + /** + * An array of material library filenames found in the OBJ file. + */ + materialLibraries: string[]; + /** + * If the obj was loaded with an mtl file, the parsed material names are stored in this object. + */ + materials: object; + /** + * An array of parsed models extracted from the OBJ file. + */ + models: Phaser.Types.Geom.Mesh.OBJModel[]; + }; + + type OBJFace = { + /** + * The name of the Group this Face is in. + */ + group: string; + /** + * The name of the material this Face uses. + */ + material: string; + /** + * An array of vertices in this Face. + */ + vertices: Phaser.Types.Geom.Mesh.OBJFaceVertice[]; + }; + + type OBJFaceVertice = { + /** + * The index in the `textureCoords` array that this vertex uses. + */ + textureCoordsIndex: number; + /** + * The index in the `vertices` array that this vertex uses. + */ + vertexIndex: number; + /** + * The index in the `vertexNormals` array that this vertex uses. + */ + vertexNormalIndex: number; + }; + + type OBJModel = { + /** + * An array of Faces. + */ + faces: Phaser.Types.Geom.Mesh.OBJFace[]; + /** + * The name of the model. + */ + name: string; + /** + * An array of texture coordinates. + */ + textureCoords: Phaser.Types.Geom.Mesh.UV[]; + /** + * An array of vertex normals. + */ + vertexNormals: Phaser.Types.Math.Vector3Like[]; + /** + * An array of vertices in the model. + */ + vertices: Phaser.Types.Math.Vector3Like[]; + }; + + type UV = { + /** + * The u component. + */ + u: number; + /** + * The v component. + */ + v: number; + /** + * The w component. + */ + w: number; + }; + + } + } namespace Input { @@ -55197,7 +62312,7 @@ declare namespace Phaser { /** * The index of the Gamepad. */ - index: integer; + index: number; }; } @@ -55207,27 +62322,27 @@ declare namespace Phaser { /** * A Key object mapping to the UP arrow key. */ - up?: Phaser.Input.Keyboard.Key; + up: Phaser.Input.Keyboard.Key; /** * A Key object mapping to the DOWN arrow key. */ - down?: Phaser.Input.Keyboard.Key; + down: Phaser.Input.Keyboard.Key; /** * A Key object mapping to the LEFT arrow key. */ - left?: Phaser.Input.Keyboard.Key; + left: Phaser.Input.Keyboard.Key; /** * A Key object mapping to the RIGHT arrow key. */ - right?: Phaser.Input.Keyboard.Key; + right: Phaser.Input.Keyboard.Key; /** * A Key object mapping to the SPACE BAR key. */ - space?: Phaser.Input.Keyboard.Key; + space: Phaser.Input.Keyboard.Key; /** * A Key object mapping to the SHIFT key. */ - shift?: Phaser.Input.Keyboard.Key; + shift: Phaser.Input.Keyboard.Key; }; type KeyboardKeydownCallback = (event: KeyboardEvent)=>void; @@ -55279,7 +62394,7 @@ declare namespace Phaser { /** * The callback that determines if the pointer is within the Hit Area shape or not. */ - hitAreaCallback?: Function; + hitAreaCallback?: Phaser.Types.Input.HitAreaCallback; /** * If `true` the Interactive Object will be set to be draggable and emit drag events. */ @@ -55303,7 +62418,7 @@ declare namespace Phaser { /** * If `pixelPerfect` is set, this is the alpha tolerance threshold value used in the callback. */ - alphaTolerance?: integer; + alphaTolerance?: number; }; type InputPluginContainer = { @@ -55412,6 +62527,37 @@ declare namespace Phaser { namespace Loader { namespace FileTypes { + type AsepriteFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the Texture Manager. + */ + key: string; + /** + * The absolute or relative URL to load the texture image file from. + */ + textureURL?: string; + /** + * The default file extension to use for the image texture if no url is provided. + */ + textureExtension?: string; + /** + * Extra XHR Settings specifically for the texture image file. + */ + textureXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + /** + * The absolute or relative URL to load the atlas json file from. Or, a well formed JSON object to use instead. + */ + atlasURL?: object | string; + /** + * The default file extension to use for the atlas json if no url is provided. + */ + atlasExtension?: string; + /** + * Extra XHR Settings specifically for the atlas json file. + */ + atlasXhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + type AtlasJSONFileConfig = { /** * The key of the file. Must be unique within both the Loader and the Texture Manager. @@ -55488,17 +62634,17 @@ declare namespace Phaser { */ key: string; /** - * The absolute or relative URL to load the file from. + * The absolute or relative URLs to load the audio files from. */ - urlConfig?: string; + url?: string | string[]; /** * Extra XHR Settings specifically for this file. */ xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; /** - * The AudioContext this file will use to process itself. + * The optional AudioContext this file will use to process itself. */ - audioContext?: AudioContext; + context?: AudioContext; }; type AudioSpriteFileConfig = { @@ -55667,11 +62813,11 @@ declare namespace Phaser { /** * The width of the texture the HTML will be rendered to. */ - width?: integer; + width?: number; /** * The height of the texture the HTML will be rendered to. */ - height?: integer; + height?: number; }; type ImageFileConfig = { @@ -55705,27 +62851,27 @@ declare namespace Phaser { /** * The width of the frame in pixels. */ - frameWidth: integer; + frameWidth: number; /** * The height of the frame in pixels. Uses the `frameWidth` value if not provided. */ - frameHeight?: integer; + frameHeight?: number; /** * The first frame to start parsing from. */ - startFrame?: integer; + startFrame?: number; /** * The frame to stop parsing at. If not provided it will calculate the value based on the image and frame dimensions. */ - endFrame?: integer; + endFrame?: number; /** * The margin in the image. This is the space around the edge of the frames. */ - margin?: integer; + margin?: number; /** * The spacing between each frame in the image. */ - spacing?: integer; + spacing?: number; }; type JSONFileConfig = { @@ -55805,6 +62951,37 @@ declare namespace Phaser { xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; }; + type OBJFileConfig = { + /** + * The key of the file. Must be unique within both the Loader and the OBJ Cache. + */ + key: string; + /** + * The absolute or relative URL to load this file from. If undefined or `null` it will be set to `.obj`, i.e. if `key` was "alien" then the URL will be "alien.obj". + */ + url?: string; + /** + * The default file extension to use if no url is provided. + */ + extension?: string; + /** + * Flip the UV coordinates stored in the model data? + */ + flipUV?: boolean; + /** + * An optional absolute or relative URL to the object material file from. If undefined or `null`, no material file will be loaded. + */ + matURL?: string; + /** + * The default material file extension to use if no url is provided. + */ + matExtension?: string; + /** + * Extra XHR Settings specifically for this file. + */ + xhrSettings?: Phaser.Types.Loader.XHRSettingsObject; + }; + type PackFileConfig = { /** * The key of the file. Must be unique within both the Loader and the JSON Cache. @@ -55997,11 +63174,11 @@ declare namespace Phaser { /** * An optional width. The SVG will be resized to this size before being rendered to a texture. */ - width?: integer; + width?: number; /** * An optional height. The SVG will be resized to this size before being rendered to a texture. */ - height?: integer; + height?: number; /** * An optional scale. If given it overrides the width / height properties. The SVG is scaled by the scale factor before being rendered to a texture. */ @@ -56125,9 +63302,9 @@ declare namespace Phaser { */ key: string | Phaser.Types.Loader.FileTypes.VideoFileConfig; /** - * The absolute or relative URL to load this file from in a config object. + * The absolute or relative URLs to load the video files from. */ - urlConfig?: any; + url?: string | string[]; /** * The load event to listen for when _not_ loading as a blob. Either 'loadeddata', 'canplay' or 'canplaythrough'. */ @@ -56222,7 +63399,7 @@ declare namespace Phaser { /** * Optional XHR timeout value. */ - timeout?: integer; + timeout?: number; /** * This value is used to populate the XHR `setRequestHeader` and is undefined by default. */ @@ -56278,6 +63455,40 @@ declare namespace Phaser { y?: number; }; + type Vector3Like = { + /** + * The x component. + */ + x?: number; + /** + * The y component. + */ + y?: number; + /** + * The z component. + */ + z?: number; + }; + + type Vector4Like = { + /** + * The x component. + */ + x?: number; + /** + * The y component. + */ + y?: number; + /** + * The z component. + */ + z?: number; + /** + * The w component. + */ + w?: number; + }; + } namespace Physics { @@ -56327,13 +63538,17 @@ declare namespace Phaser { /** * An Arcade Physics Collider Type. */ - type ArcadeColliderType = Phaser.GameObjects.GameObject | Phaser.GameObjects.Group | Phaser.Physics.Arcade.Sprite | Phaser.Physics.Arcade.Image | Phaser.Physics.Arcade.StaticGroup | Phaser.Physics.Arcade.Group | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer | Phaser.GameObjects.GameObject[] | Phaser.Physics.Arcade.Sprite[] | Phaser.Physics.Arcade.Image[] | Phaser.Physics.Arcade.StaticGroup[] | Phaser.Physics.Arcade.Group[] | Phaser.Tilemaps.DynamicTilemapLayer[] | Phaser.Tilemaps.StaticTilemapLayer[]; + type ArcadeColliderType = Phaser.GameObjects.GameObject | Phaser.GameObjects.Group | Phaser.Physics.Arcade.Sprite | Phaser.Physics.Arcade.Image | Phaser.Physics.Arcade.StaticGroup | Phaser.Physics.Arcade.Group | Phaser.Tilemaps.TilemapLayer | Phaser.GameObjects.GameObject[] | Phaser.Physics.Arcade.Sprite[] | Phaser.Physics.Arcade.Image[] | Phaser.Physics.Arcade.StaticGroup[] | Phaser.Physics.Arcade.Group[] | Phaser.Tilemaps.TilemapLayer[]; type ArcadeWorldConfig = { /** * Sets {@link Phaser.Physics.Arcade.World#fps}. */ fps?: number; + /** + * Sets {@link Phaser.Physics.Arcade.World#fixedStep}. + */ + fixedStep?: boolean; /** * Sets {@link Phaser.Physics.Arcade.World#timeScale}. */ @@ -56414,6 +63629,10 @@ declare namespace Phaser { * Sets {@link Phaser.Physics.Arcade.World#useTree}. */ useTree?: boolean; + /** + * If enabled, you need to call `World.update` yourself. + */ + customUpdate?: boolean; }; type ArcadeWorldDefaults = { @@ -56481,15 +63700,25 @@ declare namespace Phaser { right: boolean; }; - type GameObjectWithBody = Phaser.GameObjects.GameObject; + type GameObjectWithBody = Phaser.GameObjects.GameObject & { + body: Phaser.Physics.Arcade.Body | Phaser.Physics.Arcade.StaticBody; + }; - type GameObjectWithDynamicBody = Phaser.GameObjects.GameObject; + type GameObjectWithDynamicBody = Phaser.GameObjects.GameObject & { + body: Phaser.Physics.Arcade.Body; + }; - type GameObjectWithStaticBody = Phaser.GameObjects.GameObject; + type GameObjectWithStaticBody = Phaser.GameObjects.GameObject & { + body: Phaser.Physics.Arcade.StaticBody; + }; - type ImageWithDynamicBody = Phaser.Physics.Arcade.Image; + type ImageWithDynamicBody = Phaser.Physics.Arcade.Image & { + body: Phaser.Physics.Arcade.Body; + }; - type ImageWithStaticBody = Phaser.Physics.Arcade.Image; + type ImageWithStaticBody = Phaser.Physics.Arcade.Image & { + body: Phaser.Physics.Arcade.StaticBody; + }; type PhysicsGroupConfig = Phaser.Types.GameObjects.Group.GroupConfig & { /** @@ -56556,6 +63785,14 @@ declare namespace Phaser { * Sets {@link Phaser.Physics.Arcade.Body#friction friction.y}. */ frictionY?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#maxVelocity maxVelocity.x}. + */ + maxVelocityX?: number; + /** + * Sets {@link Phaser.Physics.Arcade.Body#maxVelocity maxVelocity.y}. + */ + maxVelocityY?: number; /** * Sets {@link Phaser.Physics.Arcade.Body#velocity velocity.x}. */ @@ -56681,9 +63918,13 @@ declare namespace Phaser { setImmovable: boolean; }; - type SpriteWithDynamicBody = Phaser.Physics.Arcade.Sprite; + type SpriteWithDynamicBody = Phaser.Physics.Arcade.Sprite & { + body: Phaser.Physics.Arcade.Body; + }; - type SpriteWithStaticBody = Phaser.Physics.Arcade.Sprite; + type SpriteWithStaticBody = Phaser.Physics.Arcade.Sprite & { + body: Phaser.Physics.Arcade.StaticBody; + }; } @@ -57654,19 +64895,19 @@ declare namespace Phaser { /** * The x coordinate to start the snapshot from. */ - x?: integer; + x?: number; /** * The y coordinate to start the snapshot from. */ - y?: integer; + y?: number; /** * The width of the snapshot. */ - width?: integer; + width?: number; /** * The height of the snapshot. */ - height?: integer; + height?: number; /** * Is this a snapshot to get a single pixel, or an area? */ @@ -57678,11 +64919,187 @@ declare namespace Phaser { /** * The width of the frame buffer, if a frame buffer grab. */ - bufferWidth?: integer; + bufferWidth?: number; /** * The height of the frame buffer, if a frame buffer grab. */ - bufferHeight?: integer; + bufferHeight?: number; + }; + + } + + namespace WebGL { + type RenderTargetConfig = { + /** + * A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc. + */ + scale?: number; + /** + * The minFilter mode of the texture. 0 is `LINEAR`, 1 is `NEAREST`. + */ + minFilter?: number; + /** + * Controls if this Render Target is automatically cleared (via `gl.COLOR_BUFFER_BIT`) during the bind. + */ + autoClear?: boolean; + }; + + type WebGLConst = { + /** + * The data type of the attribute, i.e. `gl.BYTE`, `gl.SHORT`, `gl.UNSIGNED_BYTE`, `gl.FLOAT`, etc. + */ + enum: GLenum; + /** + * The size, in bytes, of the data type. + */ + size: number; + }; + + type WebGLPipelineAttribute = { + /** + * The name of the attribute as defined in the vertex shader. + */ + name: string; + /** + * The number of components in the attribute, i.e. 1 for a float, 2 for a vec2, 3 for a vec3, etc. + */ + size: number; + /** + * The data type of the attribute. Either `gl.BYTE`, `gl.SHORT`, `gl.UNSIGNED_BYTE`, `gl.UNSIGNED_SHORT` or `gl.FLOAT`. + */ + type: GLenum; + /** + * The offset, in bytes, of this attribute data in the vertex array. Equivalent to `offsetof(vertex, attrib)` in C. + */ + offset: number; + /** + * Should the attribute data be normalized? + */ + normalized: boolean; + /** + * You should set this to `false` by default. The pipeline will enable it on boot. + */ + enabled: boolean; + /** + * You should set this to `-1` by default. The pipeline will set it on boot. + */ + location: number; + }; + + type WebGLPipelineAttributesConfig = { + /** + * The name of the attribute as defined in the vertex shader. + */ + name: string; + /** + * The number of components in the attribute, i.e. 1 for a float, 2 for a vec2, 3 for a vec3, etc. + */ + size: number; + /** + * The data type of the attribute, one of the `WEBGL_CONST` values, i.e. `WEBGL_CONST.FLOAT`, `WEBGL_CONST.UNSIGNED_BYTE`, etc. + */ + type: Phaser.Types.Renderer.WebGL.WebGLConst; + /** + * Should the attribute data be normalized? + */ + normalized?: boolean; + }; + + type WebGLPipelineConfig = { + /** + * The Phaser.Game instance that owns this pipeline. + */ + game: Phaser.Game; + /** + * The name of the pipeline. + */ + name?: string; + /** + * How the primitives are rendered. The default value is GL_TRIANGLES. Here is the full list of rendering primitives: (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). + */ + topology?: GLenum; + /** + * The source code, as a string, for the vertex shader. If you need to assign multiple shaders, see the `shaders` property. + */ + vertShader?: string; + /** + * The source code, as a string, for the fragment shader. Can include `%count%` and `%forloop%` declarations for multi-texture support. If you need to assign multiple shaders, see the `shaders` property. + */ + fragShader?: string; + /** + * The number of quads to hold in the batch. Defaults to `RenderConfig.batchSize`. This amount * 6 gives the vertex capacity. + */ + batchSize?: number; + /** + * The size, in bytes, of a single entry in the vertex buffer. Defaults to Float32Array.BYTES_PER_ELEMENT * 6 + Uint8Array.BYTES_PER_ELEMENT * 4. + */ + vertexSize?: number; + /** + * An optional Array Buffer full of pre-calculated vertices data. + */ + vertices?: ArrayBuffer; + /** + * An array of shader attribute data. All shaders bound to this pipeline must use the same attributes. + */ + attributes?: Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig; + /** + * An array of shaders, all of which are created for this one pipeline. Uses the `vertShader`, `fragShader`, `attributes` and `uniforms` properties of this object as defaults. + */ + shaders?: Phaser.Types.Renderer.WebGL.WebGLPipelineShaderConfig[]; + /** + * Force the shader to use just a single sampler2d? Set for anything that extends the Single Pipeline. + */ + forceZero?: boolean; + /** + * Create Render Targets for this pipeline. Can be a number, which determines the quantity, a boolean (sets quantity to 1), or an array of Render Target configuration objects. + */ + renderTarget?: boolean | number | Phaser.Types.Renderer.WebGL.RenderTargetConfig[]; + }; + + type WebGLPipelineShaderConfig = { + /** + * The name of the shader. Doesn't have to be unique, but makes shader look-up easier if it is. + */ + name?: string; + /** + * The source code, as a string, for the vertex shader. If not given, uses the `Phaser.Types.Renderer.WebGL.WebGLPipelineConfig.vertShader` property instead. + */ + vertShader?: string; + /** + * The source code, as a string, for the fragment shader. Can include `%count%` and `%forloop%` declarations for multi-texture support. If not given, uses the `Phaser.Types.Renderer.WebGL.WebGLPipelineConfig.fragShader` property instead. + */ + fragShader?: string; + /** + * An array of shader attribute data. All shaders bound to this pipeline must use the same attributes. + */ + attributes?: Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig; + }; + + type WebGLPipelineUniformsConfig = { + /** + * The name of the uniform as defined in the shaders. + */ + name: string; + /** + * The pipeline will set it when the program is linked. + */ + location: WebGLUniformLocation; + /** + * The cached value1. + */ + value1: any; + /** + * The cached value2. + */ + value2: any; + /** + * The cached value3. + */ + value3: any; + /** + * The cached value4. + */ + value4: any; }; } @@ -57745,7 +65162,7 @@ declare namespace Phaser { /** * The duration, in ms, for the transition to last. */ - duration?: integer; + duration?: number; /** * Will the Scene responsible for the transition be sent to sleep on completion (`true`), or stopped? (`false`) */ @@ -57855,7 +65272,7 @@ declare namespace Phaser { /** * The duration of the transition, if set. */ - transitionDuration: integer; + transitionDuration: number; /** * Is this Scene allowed to receive input during transitions? */ @@ -57988,15 +65405,15 @@ declare namespace Phaser { /** * The x-coordinate of the pixel. */ - x: integer; + x: number; /** * The y-coordinate of the pixel. */ - y: integer; + y: number; /** * The color of the pixel, not including the alpha channel. */ - color: integer; + color: number; /** * The alpha of the pixel, between 0 and 1. */ @@ -58007,27 +65424,27 @@ declare namespace Phaser { /** * The fixed width of each frame. */ - frameWidth: integer; + frameWidth: number; /** * The fixed height of each frame. If not set it will use the frameWidth as the height. */ - frameHeight?: integer; + frameHeight?: number; /** * Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. */ - startFrame?: integer; + startFrame?: number; /** * The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". */ - endFrame?: integer; + endFrame?: number; /** * If the frames have been drawn with a margin, specify the amount here. */ - margin?: integer; + margin?: number; /** * If the frames have been drawn with spacing between them, specify the amount here. */ - spacing?: integer; + spacing?: number; }; type SpriteSheetFromAtlasConfig = { @@ -58042,48 +65459,86 @@ declare namespace Phaser { /** * The fixed width of each frame. */ - frameWidth: integer; + frameWidth: number; /** * The fixed height of each frame. If not set it will use the frameWidth as the height. */ - frameHeight?: integer; + frameHeight?: number; /** * Skip a number of frames. Useful when there are multiple sprite sheets in one Texture. */ - startFrame?: integer; + startFrame?: number; /** * The total number of frames to extract from the Sprite Sheet. The default value of -1 means "extract all frames". */ - endFrame?: integer; + endFrame?: number; /** * If the frames have been drawn with a margin, specify the amount here. */ - margin?: integer; + margin?: number; /** * If the frames have been drawn with spacing between them, specify the amount here. */ - spacing?: integer; + spacing?: number; }; } namespace Tilemaps { - type FilteringOptions = { + type CreateFromObjectLayerConfig = { /** - * If true, only return tiles that don't have -1 for an index. + * A unique Object ID to convert. */ - isNotEmpty?: boolean; + id?: number; /** - * If true, only return tiles that collide on at least one side. + * An Object GID to convert. */ - isColliding?: boolean; + gid?: number; /** - * If true, only return tiles that have at least one interesting face. + * An Object Name to convert. */ - hasInterestingFace?: boolean; + name?: string; + /** + * A custom class type to convert the objects in to. + */ + classType?: Phaser.GameObjects.GameObject; + /** + * A Scene reference, passed to the Game Objects constructors. + */ + scene?: Phaser.Scene; + /** + * Optional Container to which the Game Objects are added. + */ + container?: Phaser.GameObjects.Container; + /** + * Optional key of a Texture to be used, as stored in the Texture Manager, or a Texture instance. + */ + key?: string | Phaser.Textures.Texture; + /** + * Optional name or index of the frame within the Texture. + */ + frame?: string | number; }; - type GetTilesWithinFilteringOptions = { + type DebugStyleOptions = { + /** + * Color to use for drawing a filled rectangle at + * non-colliding tile locations. If set to null, non-colliding tiles will not be drawn. + */ + "styleConfig.tileColor"?: Phaser.Display.Color; + /** + * Color to use for drawing a filled + * rectangle at colliding tile locations. If set to null, colliding tiles will not be drawn. + */ + "styleConfig.collidingTileColor"?: Phaser.Display.Color; + /** + * Color to use for drawing a line at interesting + * tile faces. If set to null, interesting tile faces will not be drawn. + */ + "styleConfig.faceColor"?: Phaser.Display.Color; + }; + + type FilteringOptions = { /** * If true, only return tiles that don't have -1 for an index. */ @@ -58205,7 +65660,7 @@ declare namespace Phaser { /** * A reference to the Tilemap layer that owns this data. */ - tilemapLayer?: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer; + tilemapLayer?: Phaser.Tilemaps.TilemapLayer; }; type MapDataConfig = { @@ -58240,7 +65695,7 @@ declare namespace Phaser { /** * The format of the Tilemap, as defined in Tiled. */ - format?: integer; + format?: number; /** * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. */ @@ -58337,7 +65792,7 @@ declare namespace Phaser { /** * The unique object ID. */ - id: integer; + id: number; /** * The name this object was assigned in Tiled. */ @@ -58377,7 +65832,7 @@ declare namespace Phaser { /** * Only set if of type 'tile'. */ - gid?: integer; + gid?: number; /** * Only set if a tile object. The horizontal flip value. */ @@ -58424,23 +65879,23 @@ declare namespace Phaser { /** * Instead of loading from the cache, you can also load directly from a 2D array of tile indexes. */ - data?: integer[][]; + data?: number[][]; /** * The width of a tile in pixels. */ - tileWidth?: integer; + tileWidth?: number; /** * The height of a tile in pixels. */ - tileHeight?: integer; + tileHeight?: number; /** * The width of the map in tiles. */ - width?: integer; + width?: number; /** * The height of the map in tiles. */ - height?: integer; + height?: number; /** * Controls how empty tiles, tiles with an index of -1, * in the map data are handled. If `true`, empty locations will get a value of `null`. If `false`, @@ -58549,11 +66004,11 @@ declare namespace Phaser { */ type Event = string; - type GetActiveCallback = (target: any, key: string, value: number, targetIndex: integer, totalTargets: integer, tween: Phaser.Tweens.Tween)=>void; + type GetActiveCallback = (target: any, key: string, value: number, targetIndex: number, totalTargets: number, tween: Phaser.Tweens.Tween)=>void; - type GetEndCallback = (target: any, key: string, value: number, targetIndex: integer, totalTargets: integer, tween: Phaser.Tweens.Tween)=>void; + type GetEndCallback = (target: any, key: string, value: number, targetIndex: number, totalTargets: number, tween: Phaser.Tweens.Tween)=>void; - type GetStartCallback = (target: any, key: string, value: number, targetIndex: integer, totalTargets: integer, tween: Phaser.Tweens.Tween)=>void; + type GetStartCallback = (target: any, key: string, value: number, targetIndex: number, totalTargets: number, tween: Phaser.Tweens.Tween)=>void; type NumberTweenBuilderConfig = { /** @@ -58722,11 +66177,11 @@ declare namespace Phaser { /** * The index to start the stagger from. Can be the strings `first`, `last` or `center`, or an integer representing the stagger position. */ - from?: string | integer; + from?: string | number; /** * Set the stagger to run across a grid by providing an array where element 0 is the width of the grid and element 1 is the height. Combine with the 'from' property to control direction. */ - grid?: integer[]; + grid?: number[]; }; type TimelineBuilderConfig = { @@ -58765,7 +66220,7 @@ declare namespace Phaser { /** * The number of times to repeat each tween. Each individual Tween configuration can override this value. */ - repeat?: integer; + repeat?: number; /** * The number of milliseconds to pause before each tween will repeat. Each individual Tween configuration can override this value. */ @@ -59061,7 +66516,7 @@ declare namespace Phaser { /** * The target index within the Tween targets array. */ - index: integer; + index: number; /** * The property of the target being tweened. */ @@ -59105,7 +66560,7 @@ declare namespace Phaser { /** * Number of times to repeat the tween. The tween will always run once regardless, so a repeat value of '1' will play the tween twice. */ - repeat?: integer; + repeat?: number; /** * Time in ms/frames before the repeat will start. */ @@ -59129,7 +66584,7 @@ declare namespace Phaser { /** * How many repeats are left to run? */ - repeatCounter?: integer; + repeatCounter?: number; /** * The property value at the start of the ease. */ @@ -59161,7 +66616,7 @@ declare namespace Phaser { /** * TWEEN_CONST.CREATED */ - state?: integer; + state?: number; }; type TweenDataGenConfig = { @@ -59270,7 +66725,7 @@ declare namespace Phaser { * * The main difference between an Arcade Image and an Arcade Sprite is that you cannot animate an Arcade Image. */ - class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + class Image extends Phaser.GameObjects.Image implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. @@ -59279,7 +66734,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer); + constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number); /** * This Game Object's Physics Body. @@ -59409,7 +66864,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -59585,6 +67040,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -59670,6 +67127,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -59679,22 +67138,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -59887,7 +67432,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -59902,10 +67447,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -59937,7 +67513,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -59960,40 +67536,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -60047,7 +67602,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -60068,6 +67623,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -60142,6 +67703,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -60408,8 +67985,12 @@ declare namespace Phaser { setGravityY(y: number): this; /** - * Sets Whether this Body can be moved by collisions with another Body. - * @param value Sets if this body can be moved by collisions with another Body. Default true. + * Sets if this Body can be separated during collisions with other bodies. + * + * When a body is immovable it means it won't move at all, not even to separate it from collision + * overlap. If you just wish to prevent a body from being knocked around by other bodies, see + * the `setPushable` method instead. + * @param value Sets if this body will be separated during collisions with other bodies. Default true. */ setImmovable(value?: boolean): this; @@ -60419,6 +68000,18 @@ declare namespace Phaser { */ setMass(value: number): this; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * @param value Sets if this body can be pushed by collisions with another Body. Default true. + */ + setPushable(value?: boolean): this; + /** * Sets the body offset. This allows you to adjust the difference between the center of the body * and the x and y coordinates of the parent Game Object. @@ -60506,7 +68099,7 @@ declare namespace Phaser { /** * A configuration object. Union of the `physics.arcade.*` properties of the GameConfig and SceneConfig objects. */ - config: object; + config: Phaser.Types.Physics.Arcade.ArcadeWorldConfig; /** * The physics simulation. @@ -60518,10 +68111,30 @@ declare namespace Phaser { */ add: Phaser.Physics.Arcade.Factory; + /** + * Causes `World.update` to be automatically called each time the Scene + * emits and `UPDATE` event. This is the default setting, so only needs + * calling if you have specifically disabled it. + */ + enableUpdate(): void; + + /** + * Causes `World.update` to **not** be automatically called each time the Scene + * emits and `UPDATE` event. + * + * If you wish to run the World update at your own rate, or from your own + * component, then you should call this method to disable the built-in link, + * and then call `World.update(delta, time)` accordingly. + * + * Note that `World.postUpdate` is always automatically called when the Scene + * emits a `POST_UPDATE` event, regardless of this setting. + */ + disableUpdate(): void; + /** * Creates the physics configuration for the current Scene. */ - getConfig(): object; + getConfig(): Phaser.Types.Physics.Arcade.ArcadeWorldConfig; /** * Tests if Game Objects overlap. See {@link Phaser.Physics.Arcade.World#overlap} @@ -60775,7 +68388,7 @@ declare namespace Phaser { * The main difference between an Arcade Sprite and an Arcade Image is that you cannot animate an Arcade Image. * If you do not require animation then you can safely use Arcade Images instead of Arcade Sprites. */ - class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + class Sprite extends Phaser.GameObjects.Sprite implements Phaser.Physics.Arcade.Components.Acceleration, Phaser.Physics.Arcade.Components.Angular, Phaser.Physics.Arcade.Components.Bounce, Phaser.Physics.Arcade.Components.Debug, Phaser.Physics.Arcade.Components.Drag, Phaser.Physics.Arcade.Components.Enable, Phaser.Physics.Arcade.Components.Friction, Phaser.Physics.Arcade.Components.Gravity, Phaser.Physics.Arcade.Components.Immovable, Phaser.Physics.Arcade.Components.Mass, Phaser.Physics.Arcade.Components.Pushable, Phaser.Physics.Arcade.Components.Size, Phaser.Physics.Arcade.Components.Velocity, Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Size, Phaser.GameObjects.Components.Texture, Phaser.GameObjects.Components.Tint, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { /** * * @param scene The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. @@ -60784,7 +68397,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer); + constructor(scene: Phaser.Scene, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number); /** * This Game Object's Physics Body. @@ -60914,7 +68527,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -61090,6 +68703,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -61175,6 +68790,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -61184,22 +68801,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -61392,7 +69095,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -61407,10 +69110,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -61442,7 +69176,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -61465,40 +69199,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -61552,7 +69265,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -61573,6 +69286,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -61647,6 +69366,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -61913,8 +69648,12 @@ declare namespace Phaser { setGravityY(y: number): this; /** - * Sets Whether this Body can be moved by collisions with another Body. - * @param value Sets if this body can be moved by collisions with another Body. Default true. + * Sets if this Body can be separated during collisions with other bodies. + * + * When a body is immovable it means it won't move at all, not even to separate it from collision + * overlap. If you just wish to prevent a body from being knocked around by other bodies, see + * the `setPushable` method instead. + * @param value Sets if this body will be separated during collisions with other bodies. Default true. */ setImmovable(value?: boolean): this; @@ -61924,6 +69663,18 @@ declare namespace Phaser { */ setMass(value: number): this; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * @param value Sets if this body can be pushed by collisions with another Body. Default true. + */ + setPushable(value?: boolean): this; + /** * Sets the body offset. This allows you to adjust the difference between the center of the body * and the x and y coordinates of the parent Game Object. @@ -62021,7 +69772,7 @@ declare namespace Phaser { /** * The color of this Body on the debug display. */ - debugBodyColor: integer; + debugBodyColor: number; /** * Whether this Body is updated by the physics simulation. @@ -62148,10 +69899,11 @@ declare namespace Phaser { /** * When `useDamping` is false (the default), this is absolute loss of velocity due to movement, in pixels per second squared. * - * When `useDamping` is true, this is 1 minus the damping factor. + * When `useDamping` is true, this is a damping multiplier between 0 and 1. + * A value of 0 means the Body stops instantly. + * A value of 0.01 mean the Body loses 99% of its velocity per second. + * A value of 0.1 means the Body loses 90% of its velocity per second. * A value of 1 means the Body loses no velocity. - * A value of 0.95 means the Body loses 5% of its velocity per step. - * A value of 0.5 means the Body loses 50% of its velocity per step. * * The x and y components are applied separately. * @@ -62237,8 +69989,8 @@ declare namespace Phaser { * by using damping, avoiding the axis-drift that is prone with linear deceleration. * * If you enable this property then you should use far smaller `drag` values than with linear, as - * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow - * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * they are used as a multiplier on the velocity. Values such as 0.05 will give a nice slow + * deceleration. */ useDamping: boolean; @@ -62285,13 +70037,26 @@ declare namespace Phaser { * This is a numeric constant value (FACING_UP, FACING_DOWN, FACING_LEFT, FACING_RIGHT). * If the Body is moving on both axes, this describes motion on the vertical axis only. */ - facing: integer; + facing: number; /** * Whether this Body can be moved by collisions with another Body. */ immovable: boolean; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * By default, Dynamic Bodies are always pushable. + */ + pushable: boolean; + /** * Whether the Body's position and rotation are affected by its velocity, acceleration, drag, and gravity. */ @@ -62365,7 +70130,7 @@ declare namespace Phaser { /** * The Body's physics type (dynamic or static). */ - readonly physicsType: integer; + readonly physicsType: number; /** * Updates the Body's `transform`, `width`, `height`, and `center` from its Game Object. @@ -62393,8 +70158,9 @@ declare namespace Phaser { * Prepares the Body for a physics step by resetting the `wasTouching`, `touching` and `blocked` states. * * This method is only called if the physics world is going to run a step this frame. + * @param clear Set the `wasTouching` values to their defaults. Default false. */ - resetFlags(): void; + resetFlags(clear?: boolean): void; /** * Syncs the position body position with the parent Game Object. @@ -62436,6 +70202,7 @@ declare namespace Phaser { /** * Sets the offset of the Body's position from its Game Object's position. + * The Body's `position` isn't changed until the next `preUpdate`. * @param x The horizontal offset, in source pixels. * @param y The vertical offset, in source pixels. Default x. */ @@ -62449,7 +70216,7 @@ declare namespace Phaser { * @param height The height of the Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param center Modify the Body's `offset`, placing the Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. Default true. */ - setSize(width?: integer, height?: integer, center?: boolean): Phaser.Physics.Arcade.Body; + setSize(width?: number, height?: number, center?: boolean): Phaser.Physics.Arcade.Body; /** * Sizes and positions this Body, as a circle. @@ -62460,10 +70227,10 @@ declare namespace Phaser { setCircle(radius: number, offsetX?: number, offsetY?: number): Phaser.Physics.Arcade.Body; /** - * Resets this Body to the given coordinates. Also positions its parent Game Object to the same coordinates. + * Sets this Body's parent Game Object to the given coordinates and resets this Body at the new coordinates. * If the Body had any velocity or acceleration it is lost as a result of calling this. - * @param x The horizontal position to place the Game Object and Body. - * @param y The vertical position to place the Game Object and Body. + * @param x The horizontal position to place the Game Object. + * @param y The vertical position to place the Game Object. */ reset(x: number, y: number): void; @@ -62578,12 +70345,13 @@ declare namespace Phaser { /** * Sets whether this Body collides with the world boundary. * - * Optionally also sets the World Bounce values. If the `Body.worldBounce` is null, it's set to a new Phaser.Math.Vector2 first. - * @param value `true` if this body should collide with the world bounds, otherwise `false`. Default true. - * @param bounceX If given this will be replace the `worldBounce.x` value. - * @param bounceY If given this will be replace the `worldBounce.y` value. + * Optionally also sets the World Bounce and `onWorldBounds` values. + * @param value `true` if the Body should collide with the world bounds, otherwise `false`. Default true. + * @param bounceX If given this replaces the Body's `worldBounce.x` value. + * @param bounceY If given this replaces the Body's `worldBounce.y` value. + * @param onWorldBounds If given this replaces the Body's `onWorldBounds` value. */ - setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number): Phaser.Physics.Arcade.Body; + setCollideWorldBounds(value?: boolean, bounceX?: number, bounceY?: number, onWorldBounds?: boolean): Phaser.Physics.Arcade.Body; /** * Sets the Body's velocity. @@ -62611,6 +70379,18 @@ declare namespace Phaser { */ setMaxVelocity(x: number, y?: number): Phaser.Physics.Arcade.Body; + /** + * Sets the Body's maximum horizontal velocity. + * @param value The maximum horizontal velocity, in pixels per second. + */ + setMaxVelocityX(value: number): Phaser.Physics.Arcade.Body; + + /** + * Sets the Body's maximum vertical velocity. + * @param value The maximum vertical velocity, in pixels per second. + */ + setMaxVelocityY(value: number): Phaser.Physics.Arcade.Body; + /** * Sets the maximum speed the Body can move. * @param value The maximum speed value, in pixels per second. Set to a negative value to disable. @@ -62680,6 +70460,20 @@ declare namespace Phaser { */ setDrag(x: number, y: number): Phaser.Physics.Arcade.Body; + /** + * If this Body is using `drag` for deceleration this property controls how the drag is applied. + * If set to `true` drag will use a damping effect rather than a linear approach. If you are + * creating a game where the Body moves freely at any angle (i.e. like the way the ship moves in + * the game Asteroids) then you will get a far smoother and more visually correct deceleration + * by using damping, avoiding the axis-drift that is prone with linear deceleration. + * + * If you enable this property then you should use far smaller `drag` values than with linear, as + * they are used as a multiplier on the velocity. Values such as 0.95 will give a nice slow + * deceleration, where-as smaller values, such as 0.5 will stop an object almost immediately. + * @param value `true` to use damping, or `false` to use drag. + */ + setDamping(value: boolean): Phaser.Physics.Arcade.Body; + /** * Sets the Body's horizontal drag. * @param value The drag, in pixels per second squared. @@ -62767,12 +70561,32 @@ declare namespace Phaser { setEnable(value?: boolean): Phaser.Physics.Arcade.Body; /** - * The Body's horizontal position (left edge). + * This is an internal handler, called by the `ProcessX` function as part + * of the collision step. You should almost never call this directly. + * @param x The amount to add to the Body position. + * @param vx The amount to add to the Body velocity. + * @param left Set the blocked.left value? + * @param right Set the blocked.right value? + */ + processX(x: number, vx?: number, left?: boolean, right?: boolean): void; + + /** + * This is an internal handler, called by the `ProcessY` function as part + * of the collision step. You should almost never call this directly. + * @param y The amount to add to the Body position. + * @param vy The amount to add to the Body velocity. + * @param up Set the blocked.up value? + * @param down Set the blocked.down value? + */ + processY(y: number, vy?: number, up?: boolean, down?: boolean): void; + + /** + * The Bodys horizontal position (left edge). */ x: number; /** - * The Body's vertical position (top edge). + * The Bodys vertical position (top edge). */ y: number; @@ -63152,8 +70966,12 @@ declare namespace Phaser { */ interface Immovable { /** - * Sets Whether this Body can be moved by collisions with another Body. - * @param value Sets if this body can be moved by collisions with another Body. Default true. + * Sets if this Body can be separated during collisions with other bodies. + * + * When a body is immovable it means it won't move at all, not even to separate it from collision + * overlap. If you just wish to prevent a body from being knocked around by other bodies, see + * the `setPushable` method instead. + * @param value Sets if this body will be separated during collisions with other bodies. Default true. */ setImmovable(value?: boolean): this; } @@ -63195,6 +71013,23 @@ declare namespace Phaser { interface OverlapRect { } + /** + * Provides methods used for setting the pushable property of an Arcade Physics Body. + */ + interface Pushable { + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * @param value Sets if this body can be pushed by collisions with another Body. Default true. + */ + setPushable(value?: boolean): this; + } + /** * Provides methods for setting the size of an Arcade Physics Game Object. * Should be applied as a mixin and not used directly. @@ -63465,7 +71300,7 @@ declare namespace Phaser { * @param gameObject A Game Object. * @param isStatic Create a Static body (true) or Dynamic body (false). Default false. */ - existing(gameObject: Phaser.GameObjects.GameObject, isStatic?: boolean): Phaser.Types.Physics.Arcade.GameObjectWithBody; + existing(gameObject: G, isStatic?: boolean): G; /** * Creates a new Arcade Image object with a Static body. @@ -63474,7 +71309,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - staticImage(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.Types.Physics.Arcade.ImageWithStaticBody; + staticImage(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.Types.Physics.Arcade.ImageWithStaticBody; /** * Creates a new Arcade Image object with a Dynamic body. @@ -63483,7 +71318,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - image(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.Types.Physics.Arcade.ImageWithDynamicBody; + image(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.Types.Physics.Arcade.ImageWithDynamicBody; /** * Creates a new Arcade Sprite object with a Static body. @@ -63492,7 +71327,7 @@ declare namespace Phaser { * @param texture The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - staticSprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer): Phaser.Types.Physics.Arcade.SpriteWithStaticBody; + staticSprite(x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number): Phaser.Types.Physics.Arcade.SpriteWithStaticBody; /** * Creates a new Arcade Sprite object with a Dynamic body. @@ -63501,7 +71336,7 @@ declare namespace Phaser { * @param key The key of the Texture this Game Object will use to render with, as stored in the Texture Manager. * @param frame An optional frame from the Texture this Game Object is rendering with. */ - sprite(x: number, y: number, key: string, frame?: string | integer): Phaser.Types.Physics.Arcade.SpriteWithDynamicBody; + sprite(x: number, y: number, key: string, frame?: string | number): Phaser.Types.Physics.Arcade.SpriteWithDynamicBody; /** * Creates a Static Physics Group object. @@ -63549,9 +71384,19 @@ declare namespace Phaser { /** * An Arcade Physics Group object. * - * All Game Objects created by or added to this Group will automatically be given dynamic Arcade Physics bodies, if they have no body. + * The primary use of a Physics Group is a way to collect together physics enable objects + * that share the same intrinsic structure into a single pool. They can they be easily + * compared against other Groups, or Game Objects. * - * Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}. + * All Game Objects created by, or added to this Group will automatically be given **dynamic** + * Arcade Physics bodies (if they have no body already) and the bodies will receive the + * Groups {@link Phaser.Physics.Arcade.Group#defaults default values}. + * + * You should not pass objects into this Group that should not receive a body. For example, + * do not add basic Geometry or Tilemap Layers into a Group, as they will not behave in the + * way you may expect. Groups should all ideally have objects of the same type in them. + * + * If you wish to create a Group filled with Static Bodies, please see {@link Phaser.Physics.Arcade.StaticGroup}. */ class Group extends Phaser.GameObjects.Group { /** @@ -63578,10 +71423,12 @@ declare namespace Phaser { /** * The physics type of the Group's members. */ - physicsType: integer; + physicsType: number; /** * Default physics properties applied to Game Objects added to the Group or created by the Group. Derived from the `config` argument. + * + * You can remove the default values by setting this property to `{}`. */ defaults: Phaser.Types.Physics.Arcade.PhysicsGroupDefaults; @@ -63689,7 +71536,7 @@ declare namespace Phaser { /** * The color of this Static Body on the debug display. */ - debugBodyColor: integer; + debugBodyColor: number; /** * Whether this Static Body is updated by the physics simulation. @@ -63795,6 +71642,19 @@ declare namespace Phaser { */ immovable: boolean; + /** + * Sets if this Body can be pushed by another Body. + * + * A body that cannot be pushed will reflect back all of the velocity it is given to the + * colliding body. If that body is also not pushable, then the separation will be split + * between them evenly. + * + * If you want your body to never move or seperate at all, see the `setImmovable` method. + * + * By default, Static Bodies are not pushable. + */ + pushable: boolean; + /** * A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider. */ @@ -63837,24 +71697,28 @@ declare namespace Phaser { checkCollision: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; /** - * Whether this StaticBody has ever collided with another body and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. */ touching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; /** - * Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. + * The values are always false for a Static Body. */ wasTouching: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; /** - * Whether this StaticBody has ever collided with a tile or the world boundary. + * This property is kept for compatibility with Dynamic Bodies. + * Avoid using it. */ blocked: Phaser.Types.Physics.Arcade.ArcadeBodyCollision; /** * The StaticBody's physics type (static by default). */ - physicsType: integer; + physicsType: number; /** * Changes the Game Object this Body is bound to. @@ -63885,7 +71749,7 @@ declare namespace Phaser { * @param height The height of the Static Body in pixels. Cannot be zero. If not given, and the parent Game Object has a frame, it will use the frame height. * @param center Place the Static Body's center on its Game Object's center. Only works if the Game Object has the `getCenter` method. Default true. */ - setSize(width?: integer, height?: integer, center?: boolean): Phaser.Physics.Arcade.StaticBody; + setSize(width?: number, height?: number, center?: boolean): Phaser.Physics.Arcade.StaticBody; /** * Sets this Static Body to have a circular body and sets its size and position. @@ -64034,7 +71898,7 @@ declare namespace Phaser { /** * The scene this group belongs to. */ - physicsType: integer; + physicsType: number; /** * A textual representation of this Game Object. @@ -64100,7 +71964,7 @@ declare namespace Phaser { * @param tileBias The tile bias value. Populated by the `World.TILE_BIAS` constant. * @param isLayer Is this check coming from a TilemapLayer or an array of tiles? */ - function SeparateTile(i: number, body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileWorldRect: Phaser.Geom.Rectangle, tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, tileBias: number, isLayer: boolean): boolean; + function SeparateTile(i: number, body: Phaser.Physics.Arcade.Body, tile: Phaser.Tilemaps.Tile, tileWorldRect: Phaser.Geom.Rectangle, tilemapLayer: Phaser.Tilemaps.TilemapLayer, tileBias: number, isLayer: boolean): boolean; /** * Check the body against the given tile on the X axis. @@ -64265,7 +72129,7 @@ declare namespace Phaser { * your world then you may find search performance improves by increasing this value, * to allow more items per node and less node division. */ - maxEntries: integer; + maxEntries: number; /** * Should this Arcade Physics World use an RTree for Dynamic bodies? @@ -64326,7 +72190,7 @@ declare namespace Phaser { * @param object The object, or objects, on which to create the bodies. * @param bodyType The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. */ - enable(object: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], bodyType?: integer): void; + enable(object: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[] | Phaser.GameObjects.Group | Phaser.GameObjects.Group[], bodyType?: number): void; /** * Creates an Arcade Physics Body on a single Game Object. @@ -64352,7 +72216,7 @@ declare namespace Phaser { * @param object The Game Object on which to create the body. * @param bodyType The type of Body to create. Either `DYNAMIC_BODY` or `STATIC_BODY`. */ - enableBody(object: Phaser.GameObjects.GameObject, bodyType?: integer): Phaser.GameObjects.GameObject; + enableBody(object: Phaser.GameObjects.GameObject, bodyType?: number): Phaser.GameObjects.GameObject; /** * Adds an existing Arcade Physics Body or StaticBody to the simulation. @@ -64514,7 +72378,7 @@ declare namespace Phaser { * You can optionally advance the simulation directly yourself by calling the `step` method. * @param framerate The frame rate to advance the simulation at. */ - setFPS(framerate: integer): this; + setFPS(framerate: number): this; /** * Advances the simulation based on the elapsed time and fps rate. @@ -64523,7 +72387,7 @@ declare namespace Phaser { * @param time The current timestamp as generated by the Request Animation Frame or SetTimeout. * @param delta The delta time, in ms, elapsed since the last frame. */ - protected update(time: number, delta: number): void; + update(time: number, delta: number): void; /** * Advances the simulation by a time increment. @@ -64682,7 +72546,7 @@ declare namespace Phaser { * @param callbackContext The context in which to run the callbacks. * @param overlapOnly Whether this is a collision or overlap check. */ - collideSpriteVsTilemapLayer(sprite: Phaser.GameObjects.GameObject, tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any, overlapOnly?: boolean): boolean; + collideSpriteVsTilemapLayer(sprite: Phaser.GameObjects.GameObject, tilemapLayer: Phaser.Tilemaps.TilemapLayer, collideCallback?: ArcadePhysicsCallback, processCallback?: ArcadePhysicsCallback, callbackContext?: any, overlapOnly?: boolean): boolean; /** * Wrap an object's coordinates (or several objects' coordinates) within {@link Phaser.Physics.Arcade.World#bounds}. @@ -65799,7 +73663,7 @@ declare namespace Phaser { * @param rowGap The distance between each row. Default 0. * @param options An optional Body configuration object that is used to set initial Body properties on creation. */ - imageStack(key: string, frame: string | integer, x: number, y: number, columns: number, rows: number, columnGap?: number, rowGap?: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): MatterJS.CompositeType; + imageStack(key: string, frame: string | number, x: number, y: number, columns: number, rows: number, columnGap?: number, rowGap?: number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): MatterJS.CompositeType; /** * Create a new composite containing bodies created in the callback in a grid arrangement. @@ -66015,7 +73879,7 @@ declare namespace Phaser { * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param options An optional Body configuration object that is used to set initial Body properties on creation. */ - image(x: number, y: number, key: string, frame?: string | integer, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.Physics.Matter.Image; + image(x: number, y: number, key: string, frame?: string | number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.Physics.Matter.Image; /** * Creates a wrapper around a Tile that provides access to a corresponding Matter body. A tile can only @@ -66049,7 +73913,7 @@ declare namespace Phaser { * @param frame An optional frame from the Texture this Game Object is rendering with. Set to `null` to skip this value. * @param options An optional Body configuration object that is used to set initial Body properties on creation. */ - sprite(x: number, y: number, key: string, frame?: string | integer, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.Physics.Matter.Sprite; + sprite(x: number, y: number, key: string, frame?: string | number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig): Phaser.Physics.Matter.Sprite; /** * Takes an existing Game Object and injects all of the Matter Components into it. @@ -66063,7 +73927,7 @@ declare namespace Phaser { * @param options A Matter Body configuration object, or an instance of a Matter Body. * @param addToWorld Add this Matter Body to the World? Default true. */ - gameObject(gameObject: Phaser.GameObjects.GameObject, options?: Phaser.Types.Physics.Matter.MatterBodyConfig | MatterJS.Body, addToWorld?: boolean): Phaser.GameObjects.GameObject; + gameObject(gameObject: Phaser.GameObjects.GameObject, options?: Phaser.Types.Physics.Matter.MatterBodyConfig | MatterJS.Body, addToWorld?: boolean): Phaser.Physics.Matter.Image | Phaser.Physics.Matter.Sprite | Phaser.GameObjects.GameObject; /** * Destroys this Factory. @@ -66103,7 +73967,7 @@ declare namespace Phaser { * @param frame An optional frame from the Texture this Game Object is rendering with. * @param options An optional Body configuration object that is used to set initial Body properties on creation. */ - constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer, options?: Phaser.Types.Physics.Matter.MatterBodyConfig); + constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig); /** * A reference to the Matter.World instance that this body belongs to. @@ -66233,7 +74097,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -66409,6 +74273,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -66494,6 +74360,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -66503,22 +74371,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -66711,7 +74665,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -66726,10 +74680,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -66761,7 +74746,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -66784,40 +74769,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -66871,7 +74835,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -66892,6 +74856,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -66966,6 +74936,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -67891,7 +75877,7 @@ declare namespace Phaser { * @param y The vertical position to align the body to. * @param align One of the `Phaser.Display.Align` constants, such as `Phaser.Display.Align.TOP_LEFT`. */ - alignBody(body: Phaser.Types.Physics.Matter.MatterBody, x: number, y: number, align: integer): this; + alignBody(body: Phaser.Types.Physics.Matter.MatterBody, x: number, y: number, align: number): this; } @@ -67916,7 +75902,7 @@ declare namespace Phaser { * @param frame An optional frame from the Texture this Game Object is rendering with. * @param options An optional Body configuration object that is used to set initial Body properties on creation. */ - constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | integer, options?: Phaser.Types.Physics.Matter.MatterBodyConfig); + constructor(world: Phaser.Physics.Matter.World, x: number, y: number, texture: string | Phaser.Textures.Texture, frame?: string | number, options?: Phaser.Types.Physics.Matter.MatterBodyConfig); /** * A reference to the Matter.World instance that this body belongs to. @@ -68046,7 +76032,7 @@ declare namespace Phaser { * Setting the depth will queue a depth sort event within the Scene. * @param value The depth of this Game Object. */ - setDepth(value: integer): this; + setDepth(value: number): this; /** * The horizontally flipped state of the Game Object. @@ -68222,6 +76208,8 @@ declare namespace Phaser { * Creates and returns a Bitmap Mask. This mask can be used by any Game Object, * including this one. * + * Note: Bitmap Masks only work on WebGL. Geometry Masks work on both WebGL and Canvas. + * * To create the mask you need to pass in a reference to a renderable Game Object. * A renderable Game Object is one that uses a texture to render with, such as an * Image, Sprite, Render Texture or BitmapText. @@ -68307,6 +76295,8 @@ declare namespace Phaser { /** * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. */ defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; @@ -68316,22 +76306,108 @@ declare namespace Phaser { pipeline: Phaser.Renderer.WebGL.WebGLPipeline; /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. + * Does this Game Object have any Post Pipelines set? */ - initPipeline(pipelineName?: string): boolean; + hasPostPipeline: boolean; /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. */ - setPipeline(pipelineName: string): this; + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; /** * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. */ - resetPipeline(): boolean; + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; /** * Gets the name of the WebGL Pipeline this Game Object is currently using. @@ -68524,7 +76600,7 @@ declare namespace Phaser { * @param key The key of the texture to be used, as stored in the Texture Manager. * @param frame The name or index of the frame within the Texture. */ - setTexture(key: string, frame?: string | integer): this; + setTexture(key: string, frame?: string | number): this; /** * Sets the frame this Game Object will use to render with. @@ -68539,10 +76615,41 @@ declare namespace Phaser { * @param updateSize Should this call adjust the size of the Game Object? Default true. * @param updateOrigin Should this call adjust the origin of the Game Object? Default true. */ - setFrame(frame: string | integer, updateSize?: boolean, updateOrigin?: boolean): this; + setFrame(frame: string | number, updateSize?: boolean, updateOrigin?: boolean): this; /** - * Fill or additive? + * The tint value being applied to the top-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopLeft: number; + + /** + * The tint value being applied to the top-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintTopRight: number; + + /** + * The tint value being applied to the bottom-left vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomLeft: number; + + /** + * The tint value being applied to the bottom-right vertice of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + * The value should be set as a hex number, i.e. 0xff0000 for red, or 0xff00ff for purple. + */ + tintBottomRight: number; + + /** + * The tint fill mode. + * + * `false` = An additive tint (the default), where vertices colors are blended with the texture. + * `true` = A fill tint, where the vertices colors replace the texture, but respects texture alpha. */ tintFill: boolean; @@ -68574,7 +76681,7 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTint(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; + setTint(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * Sets a fill-based tint on this Game Object. @@ -68597,40 +76704,19 @@ declare namespace Phaser { * @param bottomLeft The tint being applied to the bottom-left of the Game Object. * @param bottomRight The tint being applied to the bottom-right of the Game Object. */ - setTintFill(topLeft?: integer, topRight?: integer, bottomLeft?: integer, bottomRight?: integer): this; - - /** - * The tint value being applied to the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopLeft: integer; - - /** - * The tint value being applied to the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintTopRight: integer; - - /** - * The tint value being applied to the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomLeft: integer; - - /** - * The tint value being applied to the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - tintBottomRight: integer; + setTintFill(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; /** * The tint value being applied to the whole of the Game Object. * This property is a setter-only. Use the properties `tintTopLeft` etc to read the current tint value. */ - tint: integer; + tint: number; /** - * Does this Game Object have a tint applied to it or not? + * Does this Game Object have a tint applied? + * + * It checks to see if the 4 tint properties are set to the value 0xffffff + * and that the `tintFill` property is `false`. This indicates that a Game Object isn't tinted. */ readonly isTinted: boolean; @@ -68684,7 +76770,7 @@ declare namespace Phaser { * * If you prefer to work in radians, see the `rotation` property instead. */ - angle: integer; + angle: number; /** * The angle of this Game Object in radians. @@ -68705,6 +76791,12 @@ declare namespace Phaser { */ setPosition(x?: number, y?: number, z?: number, w?: number): this; + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + /** * Sets the position of this Game Object to be a random position within the confines of * the given area. @@ -68779,6 +76871,22 @@ declare namespace Phaser { */ getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + /** * Gets the sum total rotation of all of this Game Objects parent Containers. * @@ -69860,7 +77968,7 @@ declare namespace Phaser { * @param tilemapLayer An array of tiles. * @param options Options to be passed to the MatterTileBody constructor. {@see Phaser.Physics.Matter.TileBody} */ - convertTilemapLayer(tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, options?: object): this; + convertTilemapLayer(tilemapLayer: Phaser.Tilemaps.TilemapLayer, options?: object): this; /** * Adds `MatterTileBody` instances for the given tiles. This adds bodies regardless of whether the @@ -70191,47 +78299,38 @@ declare namespace Phaser { } - type DefaultPlugins = { + /** + * The Default Plugins. + */ + namespace DefaultPlugins { /** * These are the Global Managers that are created by the Phaser.Game instance. + * They are referenced from Scene.Systems so that plugins can use them. */ - Global: any[]; + var Global: any[]; + /** * These are the core plugins that are installed into every Scene.Systems instance, no matter what. + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are created in the order in which they appear in this array and EventEmitter is always first. */ - CoreScene: any[]; + var CoreScene: any[]; + /** * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. + * + * You can elect not to have these plugins by either creating a DefaultPlugins object as part + * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array + * and building your own bundle. + * + * They are optionally exposed in the Scene as well (see the InjectionMap for details) + * + * They are always created in the order in which they appear in the array. */ - DefaultScene: any[]; - }; + var DefaultScene: any[]; - /** - * These are the Global Managers that are created by the Phaser.Game instance. - * They are referenced from Scene.Systems so that plugins can use them. - */ - var Global: any[]; - - /** - * These are the core plugins that are installed into every Scene.Systems instance, no matter what. - * They are optionally exposed in the Scene as well (see the InjectionMap for details) - * - * They are created in the order in which they appear in this array and EventEmitter is always first. - */ - var CoreScene: any[]; - - /** - * These plugins are created in Scene.Systems in addition to the CoreScenePlugins. - * - * You can elect not to have these plugins by either creating a DefaultPlugins object as part - * of the Game Config, by creating a Plugins object as part of a Scene Config, or by modifying this array - * and building your own bundle. - * - * They are optionally exposed in the Scene as well (see the InjectionMap for details) - * - * They are always created in the order in which they appear in the array. - */ - var DefaultScene: any[]; + } namespace PluginCache { /** @@ -70449,7 +78548,7 @@ declare namespace Phaser { * Gets an index of a global plugin based on the given key. * @param key The unique plugin key. */ - protected getIndex(key: string): integer; + protected getIndex(key: string): number; /** * Gets a global plugin based on the given key. @@ -70850,7 +78949,7 @@ declare namespace Phaser { /** * A constant which allows the renderer to be easily identified as a Canvas Renderer. */ - type: integer; + type: number; /** * The total number of Game Objects which were rendered in a frame. @@ -70860,12 +78959,12 @@ declare namespace Phaser { /** * The width of the canvas being rendered to. */ - width: integer; + width: number; /** * The height of the canvas being rendered to. */ - height: integer; + height: number; /** * The local configuration settings of the CanvasRenderer. @@ -70915,10 +79014,8 @@ declare namespace Phaser { * The event handler that manages the `resize` event dispatched by the Scale Manager. * @param gameSize The default Game Size object. This is the un-modified game dimensions. * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. - * @param displaySize The display Size object. The size of the canvas style width / height attributes. - * @param resolution The Scale Manager resolution setting. */ - onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size, displaySize: Phaser.Structs.Size, resolution?: number): void; + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size): void; /** * Resize the main game canvas. @@ -70956,13 +79053,19 @@ declare namespace Phaser { preRender(): void; /** - * Renders the Scene to the given Camera. + * The core render step for a Scene Camera. + * + * Iterates through the given array of Game Objects and renders them with the given Camera. + * + * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked + * by the Scene Systems.render method. + * + * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * @param scene The Scene to render. - * @param children The Game Objects within the Scene to be rendered. - * @param interpolationPercentage The interpolation percentage to apply. Currently unused. + * @param children An array of filtered Game Objects that can be rendered by the given Camera. * @param camera The Scene Camera to render with. */ - render(scene: Phaser.Scene, children: Phaser.GameObjects.DisplayList, interpolationPercentage: number, camera: Phaser.Cameras.Scene2D.Camera): void; + render(scene: Phaser.Scene, children: Phaser.GameObjects.GameObject[], camera: Phaser.Cameras.Scene2D.Camera): void; /** * Restores the game context's global settings and takes a snapshot if one is scheduled. @@ -70988,7 +79091,7 @@ declare namespace Phaser { * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. */ - snapshotCanvas(canvas: HTMLCanvasElement, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, getPixel?: boolean, x?: integer, y?: integer, width?: integer, height?: integer, type?: string, encoderOptions?: number): this; + snapshotCanvas(canvas: HTMLCanvasElement, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, getPixel?: boolean, x?: number, y?: number, width?: number, height?: number, type?: string, encoderOptions?: number): this; /** * Schedules a snapshot of the entire game viewport to be taken after the current frame is rendered. @@ -71024,7 +79127,7 @@ declare namespace Phaser { * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. */ - snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + snapshotArea(x: number, y: number, width: number, height: number, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; /** * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. @@ -71041,7 +79144,7 @@ declare namespace Phaser { * @param y The y coordinate of the pixel to get. * @param callback The Function to invoke after the snapshot pixel data is extracted. */ - snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + snapshotPixel(x: number, y: number, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; /** * Takes a Sprite Game Object, or any object that extends it, and draws it to the current context. @@ -71113,56 +79216,529 @@ declare namespace Phaser { } namespace WebGL { + /** + * 8-bit twos complement signed integer. + */ + var BYTE: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 8-bit twos complement unsigned integer. + */ + var UNSIGNED_BYTE: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 16-bit twos complement signed integer. + */ + var SHORT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 16-bit twos complement unsigned integer. + */ + var UNSIGNED_SHORT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 32-bit twos complement signed integer. + */ + var INT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 32-bit twos complement unsigned integer. + */ + var UNSIGNED_INT: Phaser.Types.Renderer.WebGL.WebGLConst; + + /** + * 32-bit IEEE floating point number. + */ + var FLOAT: Phaser.Types.Renderer.WebGL.WebGLConst; + + namespace Events { + /** + * The Post-Render Event. + * + * This event is dispatched by the WebGL Renderer when all rendering, for all cameras in all Scenes, + * has completed. + */ + const POST_RENDER: any; + + /** + * The Pre-Render Event. + * + * This event is dispatched by the WebGL Renderer. This happens right at the start of the render + * process, after the context has been cleared, the scissors enabled and everything has been + * reset ready for the render. + */ + const PRE_RENDER: any; + + /** + * The Render Event. + * + * This event is dispatched by the WebGL Renderer for every camera in every Scene. + * + * It is dispatched before any of the children in the Scene have been rendered. + */ + const RENDER: any; + + /** + * The Renderer Resize Event. + * + * This event is dispatched by the WebGL Renderer when it is resized, usually as a result + * of the Scale Manager resizing. + */ + const RESIZE: any; + + } + + /** + * The Pipeline Manager is responsible for the creation, activation, running and destruction + * of WebGL Pipelines in Phaser 3. + * + * The `WebGLRenderer` owns a single instance of the Pipeline Manager, which you can access + * via the `WebGLRenderer.pipelines` property. + * + * By default, there are 5 pipelines installed into the Pipeline Manager when Phaser boots: + * + * 1. The Multi Pipeline. Responsible for all multi-texture rendering, i.e. Sprites, Shapes. + * 2. The Single Pipeline. Responsible for rendering Game Objects that explicitly require one bound texture. + * 3. The Rope Pipeline. Responsible for rendering the Rope Game Object. + * 4. The Light Pipeline. Responsible for rendering the Light Game Object. + * 5. The Bitmap Mask Pipeline. Responsible for Bitmap Mask rendering. + * + * You can add your own custom pipeline via the `PipelineManager.add` method. Pipelines are + * identified by unique string-based keys. + */ + class PipelineManager { + /** + * + * @param renderer A reference to the WebGL Renderer that owns this Pipeline Manager. + */ + constructor(renderer: Phaser.Renderer.WebGL.WebGLRenderer); + + /** + * A reference to the Game instance. + */ + game: Phaser.Game; + + /** + * A reference to the WebGL Renderer instance. + */ + renderer: Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * This map stores all pipeline classes available in this manager. + * + * The Utility Class must always come first. + */ + classes: Phaser.Structs.Map; + + /** + * This map stores all Post FX Pipeline classes available in this manager. + */ + postPipelineClasses: Phaser.Structs.Map; + + /** + * This map stores all pipeline instances in this manager. + * + * This is populated with the default pipelines in the `boot` method. + */ + pipelines: Phaser.Structs.Map; + + /** + * Current pipeline in use by the WebGLRenderer. + */ + current: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The previous WebGLPipeline that was in use. + * + * This is set when `clearPipeline` is called and restored in `rebindPipeline` if none is given. + */ + previous: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * A constant-style reference to the Multi Pipeline Instance. + * + * This is the default Phaser 3 pipeline and is used by the WebGL Renderer to manage + * camera effects and more. This property is set during the `boot` method. + */ + MULTI_PIPELINE: Phaser.Renderer.WebGL.Pipelines.MultiPipeline; + + /** + * A constant-style reference to the Bitmap Mask Pipeline Instance. + * + * This is the default Phaser 3 mask pipeline and is used Game Objects using + * a Bitmap Mask. This property is set during the `boot` method. + */ + BITMAPMASK_PIPELINE: Phaser.Renderer.WebGL.Pipelines.BitmapMaskPipeline; + + /** + * A constant-style reference to the Utility Pipeline Instance. + */ + UTILITY_PIPELINE: Phaser.Renderer.WebGL.Pipelines.UtilityPipeline; + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * Internal boot handler, called by the WebGLRenderer durings its boot process. + * + * Adds all of the default pipelines, based on the game config, and then calls + * the `boot` method on each one of them. + * + * Finally, the default pipeline is set. + * @param pipelineConfig The pipeline configuration object as set in the Game Config. + */ + boot(pipelineConfig?: Phaser.Types.Core.PipelineConfig): void; + + /** + * Adds a pipeline instance to this Pipeline Manager. + * + * The name of the instance must be unique within this manager. + * + * Make sure to pass an instance to this method, not a base class. + * + * For example, you should pass it like this: + * + * ```javascript + * this.add('yourName', new CustomPipeline());` + * ``` + * + * and **not** like this: + * + * ```javascript + * this.add('yourName', CustomPipeline);` + * ``` + * + * To add a **Post Pipeline**, see `addPostPipeline` instead. + * @param name A unique string-based key for the pipeline within the manager. + * @param pipeline A pipeline _instance_ which must extend `WebGLPipeline`. + */ + add(name: string, pipeline: Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Adds a Post Pipeline to this Pipeline Manager. + * + * Make sure to pass a base class to this method, not an instance. + * + * For example, you should pass it like this: + * + * ```javascript + * this.addPostPipeline('yourName', CustomPipeline);` + * ``` + * + * and **not** like this: + * + * ```javascript + * this.addPostPipeline('yourName', new CustomPipeline());` + * ``` + * + * To add a regular pipeline, see the `add` method instead. + * @param name A unique string-based key for the pipeline within the manager. + * @param pipeline A pipeline class which must extend `PostFXPipeline`. + */ + addPostPipeline(name: string, pipeline: Function): this; + + /** + * Flushes the current pipeline, if one is bound. + */ + flush(): void; + + /** + * Checks if a pipeline is present in this Pipeline Manager. + * @param pipeline Either the string-based name of the pipeline to get, or a pipeline instance to look-up. + */ + has(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Returns the pipeline instance based on the given name, or instance. + * + * If no instance, or matching name, exists in this manager, it returns `undefined`. + * @param pipeline Either the string-based name of the pipeline to get, or a pipeline instance to look-up. + */ + get(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Returns a _new instance_ of the post pipeline based on the given name, or class. + * + * If no instance, or matching name, exists in this manager, it returns `undefined`. + * @param pipeline Either the string-based name of the pipeline to get, or a pipeline instance, or class to look-up. + * @param gameObject If this post pipeline is being installed into a Game Object or Camera, this is a reference to it. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline, gameObject?: Phaser.GameObjects.GameObject): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; + + /** + * Removes a pipeline instance based on the given name. + * + * If no pipeline matches the name, this method does nothing. + * + * Note that the pipeline will not be flushed or destroyed, it's simply removed from + * this manager. + * @param name The name of the pipeline to be removed. + * @param removeClass Remove the pipeline class as well as the instance? Default true. + * @param removePostPipelineClass Remove the post pipeline class as well as the instance? Default true. + */ + remove(name: string, removeClass?: boolean, removePostPipelineClass?: boolean): void; + + /** + * Sets the current pipeline to be used by the `WebGLRenderer`. + * + * This method accepts a pipeline instance as its parameter, not the name. + * + * If the pipeline isn't already the current one it will call `WebGLPipeline.bind` and then `onBind`. + * + * You cannot set Post FX Pipelines using this method. To use a Post FX Pipeline, you should + * apply it to either a Camera, Container or other supporting Game Object. + * @param pipeline The pipeline instance to be set as current. + * @param gameObject The Game Object that invoked this pipeline, if any. + * @param currentShader The shader to set as being current. + */ + set(pipeline: Phaser.Renderer.WebGL.WebGLPipeline, gameObject?: Phaser.GameObjects.GameObject, currentShader?: Phaser.Renderer.WebGL.WebGLShader): Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. It causes a batch + * flush, then calls the `preBatch` method on the post-fx pipelines belonging to the + * Game Object. + * @param gameObject The Game Object about to be batched. + */ + preBatch(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * This method is called by the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. It causes a batch + * flush, then calls the `postBatch` method on the post-fx pipelines belonging to the + * Game Object. + * @param gameObject The Game Object that was just added to the batch. + */ + postBatch(gameObject: Phaser.GameObjects.GameObject): void; + + /** + * Called at the start of the `WebGLRenderer.preRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `preBatch` method on the post-fx pipelines belonging to the Camera. + * @param camera The Camera about to be rendered. + */ + preBatchCamera(camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Called at the end of the `WebGLRenderer.postRenderCamera` method. + * + * If the Camera has post pipelines set, it will flush the batch and then call the + * `postBatch` method on the post-fx pipelines belonging to the Camera. + * @param camera The Camera that was just rendered. + */ + postBatchCamera(camera: Phaser.Cameras.Scene2D.Camera): void; + + /** + * Checks to see if the given pipeline is already the active pipeline, both within this + * Pipeline Manager, and also has the same vertex buffer and shader set within the Renderer. + * @param pipeline The pipeline instance to be checked. + * @param currentShader The shader to set as being current. + */ + isCurrent(pipeline: Phaser.Renderer.WebGL.WebGLPipeline, currentShader?: Phaser.Renderer.WebGL.WebGLShader): boolean; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * + * The copy itself is handled by the Utility Pipeline. + * @param source The source Render Target. + * @param target The target Render Target. + * @param brightness The brightness value applied to the frame copy. Default 1. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + copyFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean): this; + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * @param source The Render Target to draw from. + */ + copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * + * The copy itself is handled by the Utility Pipeline. + * @param source The source Render Target. + * @param target The target Render Target. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param colorMatrix The Color Matrix to use when performing the draw. + */ + drawFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean, colorMatrix?: Phaser.Display.ColorMatrix): this; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): this; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * + * The draw itself is handled by the Utility Pipeline. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): this; + + /** + * Clears the given Render Target. + * @param target The Render Target to clear. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + clearFrame(target: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; + + /** + * Returns `true` if the current pipeline is forced to use texture unit zero. + */ + forceZero(): boolean; + + /** + * Sets the Multi Pipeline to be the currently bound pipeline. + * + * This is the default Phaser 3 rendering pipeline. + */ + setMulti(): Phaser.Renderer.WebGL.Pipelines.MultiPipeline; + + /** + * Sets the Utility Pipeline to be the currently bound pipeline. + * @param currentShader The shader to set as being current. + */ + setUtility(currentShader?: Phaser.Renderer.WebGL.WebGLShader): Phaser.Renderer.WebGL.Pipelines.UtilityPipeline; + + /** + * Use this to reset the gl context to the state that Phaser requires to continue rendering. + * + * Calling this will: + * + * * Disable `DEPTH_TEST`, `CULL_FACE` and `STENCIL_TEST`. + * * Clear the depth buffer and stencil buffers. + * * Reset the viewport size. + * * Reset the blend mode. + * * Bind a blank texture as the active texture on texture unit zero. + * * Rebinds the given pipeline instance. + * + * You should call this if you have previously called `clear`, and then wish to return + * rendering control to Phaser again. + * @param pipeline The pipeline instance to be rebound. If not given, the previous pipeline will be bound. + */ + rebind(pipeline?: Phaser.Renderer.WebGL.WebGLPipeline): void; + + /** + * Flushes the current pipeline being used and then clears it, along with the + * the current shader program and vertex buffer from the `WebGLRenderer`. + * + * Then resets the blend mode to NORMAL. + * + * Call this before jumping to your own gl context handler, and then call `rebind` when + * you wish to return control to Phaser again. + */ + clear(): void; + + /** + * Destroy the Pipeline Manager, cleaning up all related resources and references. + */ + destroy(): void; + + } + namespace Pipelines { /** - * BitmapMaskPipeline handles all bitmap masking rendering in WebGL. It works by using - * sampling two texture on the fragment shader and using the fragment's alpha to clip the region. - * The config properties are: - * - game: Current game instance. - * - renderer: Current WebGL renderer. - * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. - * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). - * - vertShader: Source for vertex shader as a string. - * - fragShader: Source for fragment shader as a string. - * - vertexCapacity: The amount of vertices that shall be allocated - * - vertexSize: The size of a single vertex in bytes. + * The Bitmap Mask Pipeline handles all of the bitmap mask rendering in WebGL for applying + * alpha masks to Game Objects. It works by sampling two texture on the fragment shader and + * using the fragments alpha to clip the region. + * + * The fragment shader it uses can be found in `shaders/src/BitmapMask.frag`. + * The vertex shader it uses can be found in `shaders/src/BitmapMask.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * + * The default shader uniforms for this pipeline are: + * + * `uResolution` (vec2) + * `uMainSampler` (sampler2D) + * `uMaskSampler` (sampler2D) + * `uInvertMaskAlpha` (bool) */ class BitmapMaskPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { /** * - * @param config Used for overriding shader an pipeline properties if extending this pipeline. + * @param config The configuration options for this pipeline. */ - constructor(config: object); - - /** - * Float32 view of the array buffer containing the pipeline's vertices. - */ - vertexViewF32: Float32Array; - - /** - * Size of the batch. - */ - maxQuads: number; - - /** - * Dirty flag to check if resolution properties need to be updated on the - * masking shader. - */ - resolutionDirty: boolean; - - /** - * Called every time the pipeline needs to be used. - * It binds all necessary resources. - */ - onBind(): this; - - /** - * Resizes this pipeline and updates the projection. - * @param width The new width. - * @param height The new height. - * @param resolution The resolution. - */ - resize(width: number, height: number, resolution: number): this; + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); /** * Binds necessary resources and renders the mask to a separated framebuffer. @@ -71174,8 +79750,8 @@ declare namespace Phaser { beginMask(mask: Phaser.GameObjects.GameObject, maskedObject: Phaser.GameObjects.GameObject, camera: Phaser.Cameras.Scene2D.Camera): void; /** - * The masked game objects framebuffer is unbound and its texture - * is bound together with the mask texture and the mask shader and + * The masked game objects framebuffer is unbound and its texture + * is bound together with the mask texture and the mask shader and * a draw call with a single quad is processed. Here is where the * masking effect is applied. * @param mask GameObject used as a mask. @@ -71185,201 +79761,250 @@ declare namespace Phaser { } /** - * Implements a model view projection matrices. - * Pipelines can implement this for doing 2D and 3D rendering. + * The Bitmap Mask Pipeline. */ - interface ModelViewProjection { + const BITMAPMASK_PIPELINE: string; + + /** + * The Light 2D Pipeline. + */ + const LIGHT_PIPELINE: string; + + /** + * The Point Light Pipeline. + */ + const POINTLIGHT_PIPELINE: string; + + /** + * The Single Texture Pipeline. + */ + const SINGLE_PIPELINE: string; + + /** + * The Multi Texture Pipeline. + */ + const MULTI_PIPELINE: string; + + /** + * The Rope Pipeline. + */ + const ROPE_PIPELINE: string; + + /** + * The Graphics and Shapes Pipeline. + */ + const GRAPHICS_PIPELINE: string; + + /** + * The Post FX Pipeline. + */ + const POSTFX_PIPELINE: string; + + /** + * The Utility Pipeline. + */ + const UTILITY_PIPELINE: string; + + /** + * The Graphics Pipeline is the rendering pipeline used by Phaser in WebGL when drawing + * primitive geometry objects, such as the Graphics Game Object, or the Shape Game Objects + * such as Arc, Line, Rectangle and Star. It handles the preperation and batching of related vertices. + * + * Prior to Phaser v3.50 the functions of this pipeline were merged with the `TextureTintPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Graphics.frag`. + * The vertex shader it uses can be found in `shaders/src/Graphics.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2) + * `inColor` (vec4, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + */ + class GraphicsPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { /** - * Dirty flag for checking if model matrix needs to be updated on GPU. + * + * @param config The configuration options for this pipeline. */ - modelMatrixDirty: boolean; + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + /** - * Dirty flag for checking if view matrix needs to be updated on GPU. + * A temporary Transform Matrix, re-used internally during batching by the + * Shape Game Objects. */ - viewMatrixDirty: boolean; + calcMatrix: Phaser.GameObjects.Components.TransformMatrix; + /** - * Dirty flag for checking if projection matrix needs to be updated on GPU. + * Pushes a filled rectangle into the vertex batch. + * + * Rectangle factors in the given transform matrices before adding to the batch. + * @param x Horizontal top left coordinate of the rectangle. + * @param y Vertical top left coordinate of the rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. */ - projectionMatrixDirty: boolean; + batchFillRect(x: number, y: number, width: number, height: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + /** - * Model matrix + * Pushes a filled triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. */ - modelMatrix: Float32Array; + batchFillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + /** - * View matrix + * Pushes a stroked triangle into the vertex batch. + * + * Triangle factors in the given transform matrices before adding to the batch. + * + * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. + * @param x0 Point 0 x coordinate. + * @param y0 Point 0 y coordinate. + * @param x1 Point 1 x coordinate. + * @param y1 Point 1 y coordinate. + * @param x2 Point 2 x coordinate. + * @param y2 Point 2 y coordinate. + * @param lineWidth The width of the line in pixels. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. */ - viewMatrix: Float32Array; + batchStrokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, lineWidth: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + /** - * Projection matrix + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and then passing it through Earcut, which + * creates a list of polygons. Each polygon is then added to the batch. + * + * The path is always automatically closed because it's filled. + * @param path Collection of points that represent the path. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. */ - projectionMatrix: Float32Array; + batchFillPath(path: Phaser.Types.Math.Vector2Like[], currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + /** - * Initializes MVP matrices with an identity matrix + * Adds the given path to the vertex batch for rendering. + * + * It works by taking the array of path data and calling `batchLine` for each section + * of the path. + * + * The path is optionally closed at the end. + * @param path Collection of points that represent the path. + * @param lineWidth The width of the line segments in pixels. + * @param pathOpen Indicates if the path should be closed or left open. + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. */ - mvpInit(): void; + batchStrokePath(path: Phaser.Types.Math.Vector2Like[], lineWidth: number, pathOpen: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + /** - * If dirty flags are set then the matrices are uploaded to the GPU. + * Creates a line out of 4 quads and adds it to the vertex batch based on the given line values. + * @param ax x coordinate of the start of the line. + * @param ay y coordinate of the start of the line. + * @param bx x coordinate of the end of the line. + * @param by y coordinate of the end of the line. + * @param aLineWidth Width of the start of the line. + * @param bLineWidth Width of the end of the line. + * @param index If this line is part of a multi-line draw, the index of the line in the draw. + * @param closePath Does this line close a multi-line path? + * @param currentMatrix The current transform. + * @param parentMatrix The parent transform. */ - mvpUpdate(): void; + batchLine(ax: number, ay: number, bx: number, by: number, aLineWidth: number, bLineWidth: number, index: number, closePath: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + /** - * Loads an identity matrix to the model matrix + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * @param x The vertex x position. + * @param y The vertex y position. + * @param tint The tint color value. */ - modelIdentity(): void; + batchVert(x: number, y: number, tint: number): void; + /** - * Scale model matrix - * @param x The x component. - * @param y The y component. - * @param z The z component. + * Destroys all shader instances, removes all object references and nulls all external references. */ - modelScale(x: number, y: number, z: number): this; - /** - * Translate model matrix - * @param x The x component. - * @param y The y component. - * @param z The z component. - */ - modelTranslate(x: number, y: number, z: number): this; - /** - * Rotates the model matrix in the X axis. - * @param radians The amount to rotate by. - */ - modelRotateX(radians: number): this; - /** - * Rotates the model matrix in the Y axis. - * @param radians The amount to rotate by. - */ - modelRotateY(radians: number): this; - /** - * Rotates the model matrix in the Z axis. - * @param radians The amount to rotate by. - */ - modelRotateZ(radians: number): this; - /** - * Loads identity matrix into the view matrix - */ - viewIdentity(): this; - /** - * Scales view matrix - * @param x The x component. - * @param y The y component. - * @param z The z component. - */ - viewScale(x: number, y: number, z: number): this; - /** - * Translates view matrix - * @param x The x component. - * @param y The y component. - * @param z The z component. - */ - viewTranslate(x: number, y: number, z: number): this; - /** - * Rotates view matrix in the X axis. - * @param radians The amount to rotate by. - */ - viewRotateX(radians: number): this; - /** - * Rotates view matrix in the Y axis. - * @param radians The amount to rotate by. - */ - viewRotateY(radians: number): this; - /** - * Rotates view matrix in the Z axis. - * @param radians The amount to rotate by. - */ - viewRotateZ(radians: number): this; - /** - * Loads a 2D view matrix (3x2 matrix) into a 4x4 view matrix - * @param matrix2D The Matrix2D. - */ - viewLoad2D(matrix2D: Float32Array): this; - /** - * Copies a 4x4 matrix into the view matrix - * @param matrix The Matrix2D. - */ - viewLoad(matrix: Float32Array): this; - /** - * Loads identity matrix into the projection matrix. - */ - projIdentity(): this; - /** - * Sets up an orthographic projection matrix - * @param left The left value. - * @param right The right value. - * @param bottom The bottom value. - * @param top The top value. - * @param near The near value. - * @param far The far value. - */ - projOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): this; - /** - * Sets up a perspective projection matrix - * @param fovY The fov value. - * @param aspectRatio The aspectRatio value. - * @param near The near value. - * @param far The far value. - */ - projPersp(fovY: number, aspectRatio: number, near: number, far: number): this; + destroy(): this; + } /** - * ForwardDiffuseLightPipeline implements a forward rendering approach for 2D lights. - * This pipeline extends TextureTintPipeline so it implements all it's rendering functions - * and batching system. + * The Light Pipeline is an extension of the Multi Pipeline and uses a custom shader + * designed to handle forward diffused rendering of 2D lights in a Scene. + * + * The shader works in tandem with Light Game Objects, and optionally texture normal maps, + * to provide an ambient illumination effect. + * + * If you wish to provide your own shader, you can use the `%LIGHT_COUNT%` declaration in the source, + * and it will be automatically replaced at run-time with the total number of configured lights. + * + * The maximum number of lights can be set in the Render Config `maxLights` property and defaults to 10. + * + * Prior to Phaser v3.50 this pipeline was called the `ForwardDiffuseLightPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Light.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uViewMatrix` (mat4) + * `uModelMatrix` (mat4) + * `uMainSampler` (sampler2D) + * `uNormSampler` (sampler2D) + * `uCamera` (vec4) + * `uResolution` (vec2) + * `uAmbientLightColor` (vec3) + * `uInverseRotationMatrix` (mat3) + * `uLights` (Light struct) */ - class ForwardDiffuseLightPipeline extends Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline { + class LightPipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { /** * - * @param config The configuration of the pipeline, same as the {@link Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline}. The fragment shader will be replaced with the lighting shader. + * @param config The configuration options for this pipeline. */ - constructor(config: object); + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); /** - * This function sets all the needed resources for each camera pass. - * @param scene The Scene being rendered. - * @param camera The Scene Camera being rendered with. + * Stores a default normal map, which is an object with a `glTexture` property that + * maps to a 1x1 texture of the color #7f7fff created in the `boot` method. */ - onRender(scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera): this; + defaultNormalMap: object; /** - * Generic function for batching a textured quad - * @param gameObject Source GameObject - * @param texture Raw WebGLTexture associated with the quad - * @param textureWidth Real texture width - * @param textureHeight Real texture height - * @param srcX X coordinate of the quad - * @param srcY Y coordinate of the quad - * @param srcWidth Width of the quad - * @param srcHeight Height of the quad - * @param scaleX X component of scale - * @param scaleY Y component of scale - * @param rotation Rotation of the quad - * @param flipX Indicates if the quad is horizontally flipped - * @param flipY Indicates if the quad is vertically flipped - * @param scrollFactorX By which factor is the quad affected by the camera horizontal scroll - * @param scrollFactorY By which factor is the quad effected by the camera vertical scroll - * @param displayOriginX Horizontal origin in pixels - * @param displayOriginY Vertical origin in pixels - * @param frameX X coordinate of the texture frame - * @param frameY Y coordinate of the texture frame - * @param frameWidth Width of the texture frame - * @param frameHeight Height of the texture frame - * @param tintTL Tint for top left - * @param tintTR Tint for top right - * @param tintBL Tint for bottom left - * @param tintBR Tint for bottom right - * @param tintEffect The tint effect (0 for additive, 1 for replacement) - * @param uOffset Horizontal offset on texture coordinate - * @param vOffset Vertical offset on texture coordinate - * @param camera Current used camera - * @param parentTransformMatrix Parent container + * Called when the Game has fully booted and the Renderer has finished setting up. + * + * By this stage all Game level systems are now in place and you can perform any final + * tasks that the pipeline may need that relied on game systems such as the Texture Manager. */ - batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: integer, textureHeight: integer, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: integer, tintTR: integer, tintBL: integer, tintBR: integer, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Sets the Game Objects normal map as the active texture. - * @param gameObject The Game Object to update. - */ - setNormalMap(gameObject: Phaser.GameObjects.GameObject): void; + boot(): void; /** * Rotates the normal map vectors inversely by the given angle. @@ -71389,176 +80014,75 @@ declare namespace Phaser { setNormalMapRotation(rotation: number): void; /** - * Takes a Sprite Game Object, or any object that extends it, which has a normal texture and adds it to the batch. - * @param sprite The texture-based Game Object to add to the batch. - * @param camera The Camera to use for the rendering transform. - * @param parentTransformMatrix The transform matrix of the parent container, if set. + * Returns the normal map WebGLTexture from the given Game Object. + * If the Game Object doesn't have one, it returns the default normal map from this pipeline instead. + * @param gameObject The Game Object to get the normal map from. */ - batchSprite(sprite: Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + getNormalMap(gameObject?: Phaser.GameObjects.GameObject): WebGLTexture; } /** - * TextureTintPipeline implements the rendering infrastructure - * for displaying textured objects - * The config properties are: - * - game: Current game instance. - * - renderer: Current WebGL renderer. - * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. - * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). - * - vertShader: Source for vertex shader as a string. - * - fragShader: Source for fragment shader as a string. - * - vertexCapacity: The amount of vertices that shall be allocated - * - vertexSize: The size of a single vertex in bytes. + * The Multi Pipeline is the core 2D texture rendering pipeline used by Phaser in WebGL. + * Virtually all Game Objects use this pipeline by default, including Sprites, Graphics + * and Tilemaps. It handles the batching of quads and tris, as well as methods for + * drawing and batching geometry data. + * + * Prior to Phaser v3.50 this pipeline was called the `TextureTintPipeline`. + * + * In previous versions of Phaser only one single texture unit was supported at any one time. + * The Multi Pipeline is an evolution of the old Texture Tint Pipeline, updated to support + * multi-textures for increased performance. + * + * The fragment shader it uses can be found in `shaders/src/Multi.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uMainSampler` (sampler2D array) + * + * If you wish to create a custom pipeline extending from this one, you can use two string + * declarations in your fragment shader source: `%count%` and `%forloop%`, where `count` is + * used to set the number of `sampler2Ds` available, and `forloop` is a block of GLSL code + * that will get the currently bound texture unit. + * + * This pipeline will automatically inject that code for you, should those values exist + * in your shader source. If you wish to handle this yourself, you can also use the + * function `Utils.parseFragmentShaderMaxTextures`. + * + * If you wish to create a pipeline that works from a single texture, or that doesn't have + * internal texture iteration, please see the `SinglePipeline` instead. */ - class TextureTintPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + class MultiPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { /** * - * @param config The configuration options for this Texture Tint Pipeline, as described above. + * @param config The configuration options for this pipeline. */ - constructor(config: object); + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); /** - * Float32 view of the array buffer containing the pipeline's vertices. + * Called every time the pipeline is bound by the renderer. + * Sets the shader program, vertex buffer and other resources. + * Should only be called when changing pipeline. */ - vertexViewF32: Float32Array; - - /** - * Uint32 view of the array buffer containing the pipeline's vertices. - */ - vertexViewU32: Uint32Array; - - /** - * Size of the batch. - */ - maxQuads: integer; - - /** - * Collection of batch information - */ - batches: any[]; - - /** - * Called every time the pipeline needs to be used. - * It binds all necessary resources. - */ - onBind(): this; - - /** - * Resizes this pipeline and updates the projection. - * @param width The new width. - * @param height The new height. - * @param resolution The resolution. - */ - resize(width: number, height: number, resolution: number): this; - - /** - * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. - * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. - * @param unit Texture unit to which the texture needs to be bound. Default 0. - */ - setTexture2D(texture?: WebGLTexture, unit?: integer): Phaser.Renderer.WebGL.Pipelines.TextureTintPipeline; - - /** - * Checks if the current batch has the same texture and texture unit, or if we need to create a new batch. - * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. - * @param unit Texture unit to which the texture needs to be bound. - */ - requireTextureBatch(texture: WebGLTexture, unit: integer): boolean; - - /** - * Creates a new batch object and pushes it to a batch array. - * The batch object contains information relevant to the current - * vertex batch like the offset in the vertex buffer, vertex count and - * the textures used by that batch. - * @param texture Optional WebGLTexture that will be assigned to the created batch. - * @param unit Texture unit to which the texture needs to be bound. - */ - pushBatch(texture: WebGLTexture, unit: integer): void; - - /** - * Uploads the vertex data and emits a draw call for the current batch of vertices. - */ - flush(): this; + bind(): this; /** * Takes a Sprite Game Object, or any object that extends it, and adds it to the batch. - * @param sprite The texture based Game Object to add to the batch. + * @param gameObject The texture based Game Object to add to the batch. * @param camera The Camera to use for the rendering transform. * @param parentTransformMatrix The transform matrix of the parent container, if set. */ - batchSprite(sprite: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 6 vertices in the following arrangement: - * - * ``` - * 0----3 - * |\ B| - * | \ | - * | \ | - * | A \| - * | \ - * 1----2 - * ``` - * - * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 - * @param x0 The top-left x position. - * @param y0 The top-left y position. - * @param x1 The bottom-left x position. - * @param y1 The bottom-left y position. - * @param x2 The bottom-right x position. - * @param y2 The bottom-right y position. - * @param x3 The top-right x position. - * @param y3 The top-right y position. - * @param u0 UV u0 value. - * @param v0 UV v0 value. - * @param u1 UV u1 value. - * @param v1 UV v1 value. - * @param tintTL The top-left tint color value. - * @param tintTR The top-right tint color value. - * @param tintBL The bottom-left tint color value. - * @param tintBR The bottom-right tint color value. - * @param tintEffect The tint effect for the shader to use. - * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param unit Texture unit to which the texture needs to be bound. Default 0. - */ - batchQuad(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: integer): boolean; - - /** - * Adds the vertices data into the batch and flushes if full. - * - * Assumes 3 vertices in the following arrangement: - * - * ``` - * 0 - * |\ - * | \ - * | \ - * | \ - * | \ - * 1-----2 - * ``` - * @param x1 The bottom-left x position. - * @param y1 The bottom-left y position. - * @param x2 The bottom-right x position. - * @param y2 The bottom-right y position. - * @param x3 The top-right x position. - * @param y3 The top-right y position. - * @param u0 UV u0 value. - * @param v0 UV v0 value. - * @param u1 UV u1 value. - * @param v1 UV v1 value. - * @param tintTL The top-left tint color value. - * @param tintTR The top-right tint color value. - * @param tintBL The bottom-left tint color value. - * @param tintEffect The tint effect for the shader to use. - * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. - * @param unit Texture unit to which the texture needs to be bound. Default 0. - */ - batchTri(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: integer): boolean; + batchSprite(gameObject: Phaser.GameObjects.Image | Phaser.GameObjects.Sprite, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; /** * Generic function for batching a textured quad using argument values instead of a Game Object. @@ -71593,8 +80117,9 @@ declare namespace Phaser { * @param camera Current used camera. * @param parentTransformMatrix Parent container. * @param skipFlip Skip the renderTexture check. Default false. + * @param textureUnit Use the currently bound texture unit? */ - batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: integer, textureHeight: integer, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: integer, tintTR: integer, tintBL: integer, tintBR: integer, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean): void; + batchTexture(gameObject: Phaser.GameObjects.GameObject, texture: WebGLTexture, textureWidth: number, textureHeight: number, srcX: number, srcY: number, srcWidth: number, srcHeight: number, scaleX: number, scaleY: number, rotation: number, flipX: boolean, flipY: boolean, scrollFactorX: number, scrollFactorY: number, displayOriginX: number, displayOriginY: number, frameX: number, frameY: number, frameWidth: number, frameHeight: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number, uOffset: number, vOffset: number, camera: Phaser.Cameras.Scene2D.Camera, parentTransformMatrix: Phaser.GameObjects.Components.TransformMatrix, skipFlip?: boolean, textureUnit?: number): void; /** * Adds a Texture Frame into the batch for rendering. @@ -71608,186 +80133,561 @@ declare namespace Phaser { */ batchTextureFrame(frame: Phaser.Textures.Frame, x: number, y: number, tint: number, alpha: number, transformMatrix: Phaser.GameObjects.Components.TransformMatrix, parentTransformMatrix?: Phaser.GameObjects.Components.TransformMatrix): void; - /** - * Pushes a filled rectangle into the vertex batch. - * Rectangle has no transform values and isn't transformed into the local space. - * Used for directly batching untransformed rectangles, such as Camera background colors. - * @param x Horizontal top left coordinate of the rectangle. - * @param y Vertical top left coordinate of the rectangle. - * @param width Width of the rectangle. - * @param height Height of the rectangle. - * @param color Color of the rectangle to draw. - * @param alpha Alpha value of the rectangle to draw. - */ - drawFillRect(x: number, y: number, width: number, height: number, color: number, alpha: number): void; + } + /** + * TODO + * + * The fragment shader it uses can be found in `shaders/src/PostFX.frag`. + * The vertex shader it uses can be found in `shaders/src/PostFX.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * The default shader uniforms for this pipeline are: + * + * `uMainSampler` (sampler2D) + */ + class PostFXPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { /** - * Pushes a filled rectangle into the vertex batch. - * Rectangle factors in the given transform matrices before adding to the batch. - * @param x Horizontal top left coordinate of the rectangle. - * @param y Vertical top left coordinate of the rectangle. - * @param width Width of the rectangle. - * @param height Height of the rectangle. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchFillRect(x: number, y: number, width: number, height: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Pushes a filled triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * @param x0 Point 0 x coordinate. - * @param y0 Point 0 y coordinate. - * @param x1 Point 1 x coordinate. - * @param y1 Point 1 y coordinate. - * @param x2 Point 2 x coordinate. - * @param y2 Point 2 y coordinate. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchFillTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Pushes a stroked triangle into the vertex batch. - * Triangle factors in the given transform matrices before adding to the batch. - * The triangle is created from 3 lines and drawn using the `batchStrokePath` method. - * @param x0 Point 0 x coordinate. - * @param y0 Point 0 y coordinate. - * @param x1 Point 1 x coordinate. - * @param y1 Point 1 y coordinate. - * @param x2 Point 2 x coordinate. - * @param y2 Point 2 y coordinate. - * @param lineWidth The width of the line in pixels. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. - */ - batchStrokeTriangle(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, lineWidth: number, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - - /** - * Adds the given path to the vertex batch for rendering. * - * It works by taking the array of path data and then passing it through Earcut, which - * creates a list of polygons. Each polygon is then added to the batch. - * - * The path is always automatically closed because it's filled. - * @param path Collection of points that represent the path. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. + * @param config The configuration options for this pipeline. */ - batchFillPath(path: any[], currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); /** - * Adds the given path to the vertex batch for rendering. - * - * It works by taking the array of path data and calling `batchLine` for each section - * of the path. - * - * The path is optionally closed at the end. - * @param path Collection of points that represent the path. - * @param lineWidth The width of the line segments in pixels. - * @param pathOpen Indicates if the path should be closed or left open. - * @param currentMatrix The current transform. - * @param parentMatrix The parent transform. + * If this post-pipeline belongs to a Game Object or Camera, this contains a reference to it. */ - batchStrokePath(path: any[], lineWidth: number, pathOpen: boolean, currentMatrix: Phaser.GameObjects.Components.TransformMatrix, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; + gameObject: Phaser.GameObjects.GameObject; /** - * Creates a quad and adds it to the vertex batch based on the given line values. - * @param ax X coordinate to the start of the line - * @param ay Y coordinate to the start of the line - * @param bx X coordinate to the end of the line - * @param by Y coordinate to the end of the line - * @param aLineWidth Width of the start of the line - * @param bLineWidth Width of the end of the line - * @param currentMatrix Parent matrix, generally used by containers + * A Color Matrix instance belonging to this pipeline. + * + * Used during calls to the `drawFrame` method. */ - batchLine(ax: number, ay: number, bx: number, by: number, aLineWidth: number, bLineWidth: number, currentMatrix: Float32Array): void; + colorMatrix: Phaser.Display.ColorMatrix; + + /** + * A reference to the Full Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Full Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 1 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 2 Render Target that belongs to the + * Utility Pipeline. This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param brightness The brightness value applied to the frame copy. Default 1. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + copyFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean): void; + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * @param source The Render Target to draw from. + */ + copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + drawFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * Binds this pipeline and draws the `source` Render Target to the `target` Render Target. + * + * If no `target` is specified, it will pop the framebuffer from the Renderers FBO stack + * and use that instead, which should be done when you need to draw the final results of + * this pipeline to the game canvas. + * + * You can optionally set the shader to be used for the draw here, if this is a multi-shader + * pipeline. By default `currentShader` will be used. If you need to set a shader but not + * a target, just pass `null` as the `target` parameter. + * @param source The Render Target to draw from. + * @param target The Render Target to draw to. If not set, it will pop the fbo from the stack. + * @param clear Clear the target before copying? Only used if `target` parameter is set. Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param currentShader The shader to use during the draw. + */ + bindAndDraw(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clear?: boolean, clearAlpha?: boolean, currentShader?: Phaser.Renderer.WebGL.WebGLShader): void; } /** - * TextureTintStripPipeline implements the rendering infrastructure - * for displaying textured objects - * The config properties are: - * - game: Current game instance. - * - renderer: Current WebGL renderer. - * - vertShader: Source for vertex shader as a string. - * - fragShader: Source for fragment shader as a string. - * - vertexCapacity: The amount of vertices that shall be allocated - * - vertexSize: The size of a single vertex in bytes. + * The Rope Pipeline is a variation of the Multi Pipeline that uses a `TRIANGLE_STRIP` for + * its topology, instead of TRIANGLES. This is primarily used by the Rope Game Object, + * or anything that extends it. + * + * Prior to Phaser v3.50 this pipeline was called the `TextureTintStripPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Multi.frag`. + * The vertex shader it uses can be found in `shaders/src/Multi.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uViewMatrix` (mat4) + * `uModelMatrix` (mat4) + * `uMainSampler` (sampler2D array) + * + * The pipeline is structurally identical to the Multi Pipeline and should be treated as such. */ - class TextureTintStripPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + class RopePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { /** * - * @param config The configuration options for this Texture Tint Pipeline, as described above. + * @param config The configuration options for this pipeline. */ - constructor(config: object); - - /** - * Float32 view of the array buffer containing the pipeline's vertices. - */ - vertexViewF32: Float32Array; - - /** - * Uint32 view of the array buffer containing the pipeline's vertices. - */ - vertexViewU32: Uint32Array; - - /** - * Size of the batch. - */ - maxQuads: integer; - - /** - * Collection of batch information - */ - batches: any[]; - - /** - * Called every time the pipeline needs to be used. - * It binds all necessary resources. - */ - onBind(): this; - - /** - * Resizes this pipeline and updates the projection. - * @param width The new width. - * @param height The new height. - * @param resolution The resolution. - */ - resize(width: number, height: number, resolution: number): this; - - /** - * Assigns a texture to the current batch. If a different texture is already set it creates a new batch object. - * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. - * @param unit Texture unit to which the texture needs to be bound. Default 0. - */ - setTexture2D(texture?: WebGLTexture, unit?: integer): Phaser.Renderer.WebGL.Pipelines.TextureTintStripPipeline; - - /** - * Checks if the current batch has the same texture and texture unit, or if we need to create a new batch. - * @param texture WebGLTexture that will be assigned to the current batch. If not given uses blankTexture. - * @param unit Texture unit to which the texture needs to be bound. - */ - requireTextureBatch(texture: WebGLTexture, unit: integer): boolean; - - /** - * Creates a new batch object and pushes it to a batch array. - * The batch object contains information relevant to the current - * vertex batch like the offset in the vertex buffer, vertex count and - * the textures used by that batch. - * @param texture Optional WebGLTexture that will be assigned to the created batch. - * @param unit Texture unit to which the texture needs to be bound. - */ - pushBatch(texture: WebGLTexture, unit: integer): void; - - /** - * Uploads the vertex data and emits a draw call for the current batch of vertices. - */ - flush(): this; + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); } + /** + * The Single Pipeline is a special version of the Multi Pipeline that only ever + * uses one texture, bound to texture unit zero. Although not as efficient as the + * Multi Pipeline, it provides an easier way to create custom pipelines that only require + * a single bound texture. + * + * Prior to Phaser v3.50 this pipeline didn't exist, but could be compared to the old `TextureTintPipeline`. + * + * The fragment shader it uses can be found in `shaders/src/Single.frag`. + * The vertex shader it uses can be found in `shaders/src/Single.vert`. + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * `inTexId` (float, offset 16) - this value is always zero in the Single Pipeline + * `inTintEffect` (float, offset 20) + * `inTint` (vec4, offset 24, normalized) + * + * The default shader uniforms for this pipeline are: + * + * `uProjectionMatrix` (mat4) + * `uMainSampler` (sampler2D) + */ + class SinglePipeline extends Phaser.Renderer.WebGL.Pipelines.MultiPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + } + + /** + * The Utility Pipeline is a special-use pipeline that belongs to the Pipeline Manager. + * + * It provides 4 shaders and handy associated methods: + * + * 1) Copy Shader. A fast texture to texture copy shader with optional brightness setting. + * 2) Additive Blend Mode Shader. Blends two textures using an additive blend mode. + * 3) Linear Blend Mode Shader. Blends two textures using a linear blend mode. + * 4) Color Matrix Copy Shader. Draws a texture to a target using a Color Matrix. + * + * You typically do not extend or access this pipeline directly, but instead go + * via the following methods in the Pipeline Manager: + * + * `copyFrame` + * `drawFrame` + * `blendFrames` + * `blendFramesAdditive` + * + * The default shader attributes for this pipeline are: + * + * `inPosition` (vec2, offset 0) + * `inTexCoord` (vec2, offset 8) + * + * This pipeline has a hard-coded batch size of 1 and a hard coded set of vertices. + */ + class UtilityPipeline extends Phaser.Renderer.WebGL.WebGLPipeline { + /** + * + * @param config The configuration options for this pipeline. + */ + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); + + /** + * A default Color Matrix, used by the Color Matrix Shader when one + * isn't provided. + */ + colorMatrix: Phaser.Display.ColorMatrix; + + /** + * A reference to the Copy Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + copyShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Additive Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + addShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Linear Blend Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + linearShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Color Matrix Shader belonging to this Utility Pipeline. + * + * This property is set during the `boot` method. + */ + colorMatrixShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * A reference to the Full Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Full Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is the full size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + fullFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 1 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame1: Phaser.Renderer.WebGL.RenderTarget; + + /** + * A reference to the Half Frame 2 Render Target. + * + * This property is set during the `boot` method. + * + * This Render Target is half the size of the renderer. + * + * You can use this directly in Post FX Pipelines for multi-target effects. + * However, be aware that these targets are shared between all post fx pipelines. + */ + halfFrame2: Phaser.Renderer.WebGL.RenderTarget; + + /** + * Copy the `source` Render Target to the `target` Render Target. + * + * You can optionally set the brightness factor of the copy. + * + * The difference between this method and `drawFrame` is that this method + * uses a faster copy shader, where only the brightness can be modified. + * If you need color level manipulation, see `drawFrame` instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param brightness The brightness value applied to the frame copy. Default 1. + * @param clear Clear the target before copying? Default true. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + copyFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, brightness?: number, clear?: boolean, clearAlpha?: boolean): void; + + /** + * Pops the framebuffer from the renderers FBO stack and sets that as the active target, + * then draws the `source` Render Target to it. It then resets the renderer textures. + * + * This should be done when you need to draw the _final_ results of a pipeline to the game + * canvas, or the next framebuffer in line on the FBO stack. You should only call this once + * in the `onDraw` handler and it should be the final thing called. Be careful not to call + * this if you need to actually use the pipeline shader, instead of the copy shader. In + * those cases, use the `bindAndDraw` method. + * @param source The Render Target to draw from. + */ + copyToGame(source: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * Copy the `source` Render Target to the `target` Render Target, using the + * given Color Matrix. + * + * The difference between this method and `copyFrame` is that this method + * uses a color matrix shader, where you have full control over the luminance + * values used during the copy. If you don't need this, you can use the faster + * `copyFrame` method instead. + * @param source The source Render Target. + * @param target The target Render Target. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param colorMatrix The Color Matrix to use when performing the draw. + */ + drawFrame(source: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean, colorMatrix?: Phaser.Display.ColorMatrix): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using a linear blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + * @param blendShader The shader to use during the blend copy. + */ + blendFrames(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean, blendShader?: Phaser.Renderer.WebGL.WebGLShader): void; + + /** + * Draws the `source1` and `source2` Render Targets to the `target` Render Target + * using an additive blend effect, which is controlled by the `strength` parameter. + * @param source1 The first source Render Target. + * @param source2 The second source Render Target. + * @param target The target Render Target. + * @param strength The strength of the blend. Default 1. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + blendFramesAdditive(source1: Phaser.Renderer.WebGL.RenderTarget, source2: Phaser.Renderer.WebGL.RenderTarget, target?: Phaser.Renderer.WebGL.RenderTarget, strength?: number, clearAlpha?: boolean): void; + + /** + * Clears the given Render Target. + * @param target The Render Target to clear. + * @param clearAlpha Clear the alpha channel when running `gl.clear` on the target? Default true. + */ + clearFrame(target: Phaser.Renderer.WebGL.RenderTarget, clearAlpha?: boolean): void; + + } + + } + + /** + * A Render Target encapsulates a WebGL framebuffer and the WebGL Texture that displays it. + * + * Instances of this class are typically created by, and belong to WebGL Pipelines, however + * other Game Objects and classes can take advantage of Render Targets as well. + */ + class RenderTarget { + /** + * + * @param renderer A reference to the WebGLRenderer. + * @param width The width of this Render Target. + * @param height The height of this Render Target. + * @param scale A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. Default 1. + * @param minFilter The minFilter mode of the texture when created. 0 is `LINEAR`, 1 is `NEAREST`. Default 0. + * @param autoClear Automatically clear this framebuffer when bound? Default true. + * @param autoResize Automatically resize this Render Target if the WebGL Renderer resizes? Default false. + */ + constructor(renderer: Phaser.Renderer.WebGL.WebGLRenderer, width: number, height: number, scale?: number, minFilter?: number, autoClear?: boolean, autoResize?: boolean); + + /** + * A reference to the WebGLRenderer instance. + */ + renderer: Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * The WebGLFramebuffer of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + */ + framebuffer: WebGLFramebuffer; + + /** + * The WebGLTexture of this Render Target. + * + * This is created in the `RenderTarget.resize` method. + */ + texture: WebGLTexture; + + /** + * The width of the texture. + */ + readonly width: number; + + /** + * The height of the texture. + */ + readonly height: number; + + /** + * A value between 0 and 1. Controls the size of this Render Target in relation to the Renderer. + * + * A value of 1 matches it. 0.5 makes the Render Target half the size of the renderer, etc. + */ + scale: number; + + /** + * The minFilter mode of the texture. 0 is `LINEAR`, 1 is `NEAREST`. + */ + minFilter: number; + + /** + * Controls if this Render Target is automatically cleared (via `gl.COLOR_BUFFER_BIT`) + * during the `RenderTarget.bind` method. + * + * If you need more control over how, or if, the target is cleared, you can disable + * this via the config on creation, or even toggle it directly at runtime. + */ + autoClear: boolean; + + /** + * Does this Render Target automatically resize when the WebGL Renderer does? + * + * Modify this property via the `setAutoResize` method. + */ + readonly autoResize: boolean; + + /** + * Sets if this Render Target should automatically resize when the WebGL Renderer + * emits a resize event. + * @param autoResize Automatically resize this Render Target when the WebGL Renderer resizes? + */ + setAutoResize(autoResize: boolean): this; + + /** + * Resizes this Render Target. + * + * Deletes both the frame buffer and texture, if they exist and then re-creates + * them using the new sizes. + * + * This method is called automatically by the pipeline during its resize handler. + * @param width The new width of this Render Target. + * @param height The new height of this Render Target. + */ + resize(width: number, height: number): this; + + /** + * Pushes this Render Target as the current frame buffer of the renderer. + * + * If `autoClear` is set, then clears the texture. + * + * If `adjustViewport` is `true` then it will flush the renderer and then adjust the GL viewport. + * @param adjustViewport Adjust the GL viewport by calling `RenderTarget.adjustViewport` ? Default false. + */ + bind(adjustViewport?: boolean): void; + + /** + * Adjusts the GL viewport to match the WebGL Renderer width and height, + * with a y offset of `RenderTarget.height` - `WebGLRenderer.height`. + */ + adjustViewport(): void; + + /** + * Clears this Render Target. + */ + clear(): void; + + /** + * Unbinds this Render Target and optionally flushes the WebGL Renderer first. + */ + unbind: any; + + /** + * Removes all external references from this class and deletes the + * WebGL framebuffer and texture instances. + * + * Does not remove this Render Target from the parent pipeline. + */ + destroy: any; + } namespace Utils { @@ -71810,7 +80710,7 @@ declare namespace Phaser { /** * Packs a Uint24, representing RGB components, with a Float32, representing - * the alpha component, with a range between 0.0 and 1.0 and return a + * the alpha component, with a range between 0.0 and 1.0 and return a * swizzled Uint32 * @param rgb Uint24 representing RGB components * @param a Float32 representing Alpha component @@ -71824,81 +80724,76 @@ declare namespace Phaser { function getFloatsFromUintRGB(rgb: number): any[]; /** - * Counts how many attributes of 32 bits a vertex has - * @param attributes Array of attributes - * @param glContext WebGLContext used for check types + * Check to see how many texture units the GPU supports, based on the given config value. + * Then tests this against the maximum number of iterations GLSL can support. + * @param gl The WebGLContext used to create the shaders. + * @param maxTextures The Game Config maxTextures value. */ - function getComponentCount(attributes: any[], glContext: WebGLRenderingContext): number; + function checkShaderMax(gl: WebGLRenderingContext, maxTextures: number): number; + + /** + * Checks the given Fragment Shader Source for `%count%` and `%forloop%` declarations and + * replaces those with GLSL code for setting `texture = texture2D(uMainSampler[i], outTexCoord)`. + * @param fragmentShaderSource The Fragment Shader source code to operate on. + * @param maxTextures The number of maxTextures value. + */ + function parseFragmentShaderMaxTextures(fragmentShaderSource: string, maxTextures: number): string; } /** - * WebGLPipeline is a class that describes the way elements will be renderered - * in WebGL, specially focused on batching vertices (batching is not provided). - * Pipelines are mostly used for describing 2D rendering passes but it's - * flexible enough to be used for any type of rendering including 3D. - * Internally WebGLPipeline will handle things like compiling shaders, - * creating vertex buffers, assigning primitive topology and binding - * vertex attributes. + * The `WebGLPipeline` is a base class used by all of the core Phaser pipelines. * - * The config properties are: - * - game: Current game instance. - * - renderer: Current WebGL renderer. - * - gl: Current WebGL context. - * - topology: This indicates how the primitives are rendered. The default value is GL_TRIANGLES. - * Here is the full list of rendering primitives (https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants). - * - vertShader: Source for vertex shader as a string. - * - fragShader: Source for fragment shader as a string. - * - vertexCapacity: The amount of vertices that shall be allocated - * - vertexSize: The size of a single vertex in bytes. - * - vertices: An optional buffer of vertices - * - attributes: An array describing the vertex attributes + * It describes the way elements will be rendered in WebGL. Internally, it handles + * compiling the shaders, creating vertex buffers, assigning primitive topology and + * binding vertex attributes, all based on the given configuration data. * - * The vertex attributes properties are: - * - name : String - Name of the attribute in the vertex shader - * - size : integer - How many components describe the attribute. For ex: vec3 = size of 3, float = size of 1 - * - type : GLenum - WebGL type (gl.BYTE, gl.SHORT, gl.UNSIGNED_BYTE, gl.UNSIGNED_SHORT, gl.FLOAT) - * - normalized : boolean - Is the attribute normalized - * - offset : integer - The offset in bytes to the current attribute in the vertex. Equivalent to offsetof(vertex, attrib) in C - * Here you can find more information of how to describe an attribute: - * - https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/vertexAttribPointer + * The pipeline is configured by passing in a `WebGLPipelineConfig` object. Please + * see the documentation for this type to fully understand the configuration options + * available to you. + * + * Usually, you would not extend from this class directly, but would instead extend + * from one of the core pipelines, such as the Multi Pipeline. + * + * The pipeline flow per render-step is as follows: + * + * 1) onPreRender - called once at the start of the render step + * 2) onRender - call for each Scene Camera that needs to render (so can be multiple times per render step) + * 3) Internal flow: + * 3a) bind (only called if a Game Object is using this pipeline and it's not currently active) + * 3b) onBind (called for every Game Object that uses this pipeline) + * 3c) flush (can be called by a Game Object, internal method or from outside by changing pipeline) + * 4) onPostRender - called once at the end of the render step */ class WebGLPipeline { /** * - * @param config The configuration object for this WebGL Pipeline, as described above. + * @param config The configuration object for this WebGL Pipeline. */ - constructor(config: object); + constructor(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig); /** - * Name of the Pipeline. Used for identifying + * Name of the pipeline. Used for identification and setting from Game Objects. */ name: string; /** - * The Game which owns this WebGL Pipeline. + * The Phaser Game instance to which this pipeline is bound. */ game: Phaser.Game; /** - * The canvas which this WebGL Pipeline renders to. + * The WebGL Renderer instance to which this pipeline is bound. */ - view: HTMLCanvasElement; + renderer: Phaser.Renderer.WebGL.WebGLRenderer; /** - * Used to store the current game resolution + * A reference to the WebGL Pipeline Manager. + * + * This is initially undefined and only set when this pipeline is added + * to the manager. */ - resolution: number; - - /** - * Width of the current viewport - */ - width: number; - - /** - * Height of the current viewport - */ - height: number; + manager: Phaser.Renderer.WebGL.PipelineManager; /** * The WebGL context this WebGL Pipeline uses. @@ -71906,263 +80801,828 @@ declare namespace Phaser { gl: WebGLRenderingContext; /** - * How many vertices have been fed to the current pipeline. + * The canvas which this WebGL Pipeline renders to. + */ + view: HTMLCanvasElement; + + /** + * Width of the current viewport. + */ + width: number; + + /** + * Height of the current viewport. + */ + height: number; + + /** + * The current number of vertices that have been added to the pipeline batch. */ vertexCount: number; /** - * The limit of vertices that the pipeline can hold + * The total number of vertices that this pipeline batch can hold before it will flush. + * + * This defaults to `renderer batchSize * 7`, where `batchSize` is defined in the Renderer Config. */ - vertexCapacity: integer; - - /** - * The WebGL Renderer which owns this WebGL Pipeline. - */ - renderer: Phaser.Renderer.WebGL.WebGLRenderer; + vertexCapacity: number; /** * Raw byte buffer of vertices. + * + * Either set via the config object, or generates a new Array Buffer of size `vertexCapacity * vertexSize`. */ - vertexData: ArrayBuffer; + readonly vertexData: ArrayBuffer; /** - * The handle to a WebGL vertex buffer object. + * The WebGLBuffer that holds the vertex data. + * + * Created from the `vertices` config ArrayBuffer that was passed in, or set by default, by the pipeline. */ - vertexBuffer: WebGLBuffer; + readonly vertexBuffer: WebGLBuffer; /** - * The handle to a WebGL program + * The primitive topology which the pipeline will use to submit draw calls. + * + * Defaults to GL_TRIANGLES if not otherwise set in the config. */ - program: WebGLProgram; + topology: GLenum; /** - * Array of objects that describe the vertex attributes - */ - attributes: object; - - /** - * The size in bytes of the vertex - */ - vertexSize: integer; - - /** - * The primitive topology which the pipeline will use to submit draw calls - */ - topology: integer; - - /** - * Uint8 view to the vertex raw buffer. Used for uploading vertex buffer resources - * to the GPU. + * Uint8 view to the `vertexData` ArrayBuffer. Used for uploading vertex buffer resources to the GPU. */ bytes: Uint8Array; /** - * This will store the amount of components of 32 bit length + * Float32 view of the array buffer containing the pipeline's vertices. */ - vertexComponentCount: integer; + vertexViewF32: Float32Array; /** - * Indicates if the current pipeline is flushing the contents to the GPU. - * When the variable is set the flush function will be locked. + * Uint32 view of the array buffer containing the pipeline's vertices. */ - flushLocked: boolean; + vertexViewU32: Uint32Array; /** - * Indicates if the current pipeline is active or not for this frame only. - * Reset in the onRender method. + * Indicates if the current pipeline is active, or not. + * + * Toggle this property to enable or disable a pipeline from rendering anything. */ active: boolean; + /** + * Holds the most recently assigned texture unit. + * Treat this value as read-only. + */ + currentUnit: number; + + /** + * Some pipelines require the forced use of texture zero (like the light pipeline). + * + * This property should be set when that is the case. + */ + forceZero: boolean; + + /** + * Indicates if this pipeline has booted or not. + * + * A pipeline boots only when the Game instance itself, and all associated systems, is + * fully ready. + */ + readonly hasBooted: boolean; + + /** + * Indicates if this is a Post FX Pipeline, or not. + */ + readonly isPostFX: boolean; + + /** + * An array of RenderTarget instances that belong to this pipeline. + */ + renderTargets: Phaser.Renderer.WebGL.RenderTarget[]; + + /** + * A reference to the currently bound Render Target instance from the `WebGLPipeline.renderTargets` array. + */ + currentRenderTarget: Phaser.Renderer.WebGL.RenderTarget; + + /** + * An array of all the WebGLShader instances that belong to this pipeline. + * + * Shaders manage their own attributes and uniforms, but share the same vertex data buffer, + * which belongs to this pipeline. + * + * Shaders are set in a call to the `setShadersFromConfig` method, which happens automatically, + * but can also be called at any point in your game. See the method documentation for details. + */ + shaders: Phaser.Renderer.WebGL.WebGLShader[]; + + /** + * A reference to the currently bound WebGLShader instance from the `WebGLPipeline.shaders` array. + * + * For lots of pipelines, this is the only shader, so it is a quick way to reference it without + * an array look-up. + */ + currentShader: Phaser.Renderer.WebGL.WebGLShader; + + /** + * The Projection matrix, used by shaders as 'uProjectionMatrix' uniform. + */ + projectionMatrix: Phaser.Math.Matrix4; + + /** + * The configuration object that was used to create this pipeline. + * + * Treat this object as 'read only', because changing it post-creation will not + * impact this pipeline in any way. However, it is used internally for cloning + * and post-boot set-up. + */ + config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig; + /** * Called when the Game has fully booted and the Renderer has finished setting up. * - * By this stage all Game level systems are now in place and you can perform any final - * tasks that the pipeline may need that relied on game systems such as the Texture Manager. + * By this stage all Game level systems are now in place. You can perform any final tasks that the + * pipeline may need, that relies on game systems such as the Texture Manager being ready. */ boot(): void; /** - * Adds a description of vertex attribute to the pipeline - * @param name Name of the vertex attribute - * @param size Vertex component size - * @param type Type of the attribute - * @param normalized Is the value normalized to a range - * @param offset Byte offset to the beginning of the first element in the vertex + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. */ - addAttribute(name: string, size: integer, type: integer, normalized: boolean, offset: integer): this; + onBoot(): void; + + /** + * This method is called once when this pipeline has finished being set-up + * at the end of the boot process. By the time this method is called, all + * of the shaders are ready and configured. It's also called if the renderer + * changes size. + * @param width The new width of this WebGL Pipeline. + * @param height The new height of this WebGL Pipeline. + */ + onResize(width: number, height: number): void; + + /** + * Sets the currently active shader within this pipeline. + * @param shader The shader to set as being current. + * @param setAttributes Should the vertex attribute pointers be set? Default false. + */ + setShader(shader: Phaser.Renderer.WebGL.WebGLShader, setAttributes?: boolean): this; + + /** + * Searches all shaders in this pipeline for one matching the given name, then returns it. + * @param name The index of the shader to set. + */ + getShaderByName(name: string): Phaser.Renderer.WebGL.WebGLShader; + + /** + * Destroys all shaders currently set in the `WebGLPipeline.shaders` array and then parses the given + * `config` object, extracting the shaders from it, creating `WebGLShader` instances and finally + * setting them into the `shaders` array of this pipeline. + * + * This is a destructive process. Be very careful when you call it, should you need to. + * @param config The configuration object for this WebGL Pipeline. + */ + setShadersFromConfig(config: Phaser.Types.Renderer.WebGL.WebGLPipelineConfig): this; + + /** + * Custom pipelines can use this method in order to perform any required pre-batch tasks + * for the given Game Object. It must return the texture unit the Game Object was assigned. + * @param gameObject The Game Object being rendered or added to the batch. + * @param frame Optional frame to use. Can override that of the Game Object. + */ + setGameObject(gameObject: Phaser.GameObjects.GameObject, frame?: Phaser.Textures.Frame): number; /** * Check if the current batch of vertices is full. + * + * You can optionally provide an `amount` parameter. If given, it will check if the batch + * needs to flush _if_ the `amount` is added to it. This allows you to test if you should + * flush before populating the batch. + * @param amount Will the batch need to flush if this many vertices are added to it? Default 0. */ - shouldFlush(): boolean; + shouldFlush(amount?: number): boolean; /** - * Resizes the properties used to describe the viewport + * Resizes the properties used to describe the viewport. + * + * This method is called automatically by the renderer during its resize handler. * @param width The new width of this WebGL Pipeline. * @param height The new height of this WebGL Pipeline. - * @param resolution The resolution this WebGL Pipeline should be resized to. */ - resize(width: number, height: number, resolution: number): this; + resize(width: number, height: number): this; /** - * Binds the pipeline resources, including programs, vertex buffers and binds attributes - */ - bind(): this; - - /** - * Set whenever this WebGL Pipeline is bound to a WebGL Renderer. + * This method is called every time the Pipeline Manager makes this pipeline the currently active one. * - * This method is called every time the WebGL Pipeline is attempted to be bound, even if it already is the current pipeline. + * It binds the resources and shader needed for this pipeline, including setting the vertex buffer + * and attribute pointers. + * @param currentShader The shader to set as being current. */ - onBind(): this; + bind(currentShader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Called before each frame is rendered, but after the canvas has been cleared. + * This method is called every time the Pipeline Manager rebinds this pipeline. + * + * It resets all shaders this pipeline uses, setting their attributes again. */ - onPreRender(): this; + rebind(): this; /** - * Called before a Scene's Camera is rendered. + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right before a quad + * belonging to a Game Object is about to be added to the batch. When this is called, the + * renderer has just performed a flush. It will bind the current render target, if any are set + * and finally call the `onPreBatch` hook. + * @param gameObject The Game Object or Camera that invoked this pipeline, if any. + */ + preBatch(gameObject?: Phaser.GameObjects.GameObject | Phaser.Cameras.Scene2D.Camera): this; + + /** + * This method is called as a result of the `WebGLPipeline.batchQuad` method, right after a quad + * belonging to a Game Object has been added to the batch. When this is called, the + * renderer has just performed a flush. + * + * It calls the `onDraw` hook followed by the `onPostBatch` hook, which can be used to perform + * additional Post FX Pipeline processing. + * @param gameObject The Game Object or Camera that invoked this pipeline, if any. + */ + postBatch(gameObject?: Phaser.GameObjects.GameObject | Phaser.Cameras.Scene2D.Camera): this; + + /** + * This method is only used by Post FX Pipelines and those that extend from them. + * + * This method is called every time the `postBatch` method is called and is passed a + * reference to the current render target. + * + * At the very least a Post FX Pipeline should call `this.bindAndDraw(renderTarget)`, + * however, you can do as much additional processing as you like in this method if + * you override it from within your own pipelines. + * @param renderTarget The Render Target. + */ + onDraw(renderTarget: Phaser.Renderer.WebGL.RenderTarget): void; + + /** + * This method is called every time the Pipeline Manager deactivates this pipeline, swapping from + * it to another one. This happens after a call to `flush` and before the new pipeline is bound. + */ + unbind(): void; + + /** + * Uploads the vertex data and emits a draw call for the current batch of vertices. + * @param isPostFlush Was this flush invoked as part of a post-process, or not? Default false. + */ + flush(isPostFlush?: boolean): this; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time the Pipeline Manager makes this the active pipeline. It is called + * at the end of the `WebGLPipeline.bind` method, after the current shader has been set. The current + * shader is passed to this hook. + * + * For example, if a display list has 3 Sprites in it that all use the same pipeline, this hook will + * only be called for the first one, as the 2nd and 3rd Sprites do not cause the pipeline to be changed. + * + * If you need to listen for that event instead, use the `onBind` hook. + * @param currentShader The shader that was set as current. + */ + onActive(currentShader: Phaser.Renderer.WebGL.WebGLShader): void; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time a **Game Object** asks the Pipeline Manager to use this pipeline, + * even if the pipeline is already active. + * + * Unlike the `onActive` method, which is only called when the Pipeline Manager makes this pipeline + * active, this hook is called for every Game Object that requests use of this pipeline, allowing you to + * perform per-object set-up, such as loading shader uniform data. + * @param gameObject The Game Object that invoked this pipeline, if any. + */ + onBind(gameObject?: Phaser.GameObjects.GameObject): void; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called when the Pipeline Manager needs to rebind this pipeline. This happens after a + * pipeline has been cleared, usually when passing control over to a 3rd party WebGL library, like Spine, + * and then returing to Phaser again. + */ + onRebind(): void; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time the `batchQuad` or `batchTri` methods are called. If this was + * as a result of a Game Object, then the Game Object reference is passed to this hook too. + * + * This hook is called _after_ the quad (or tri) has been added to the batch, so you can safely + * call 'flush' from within this. + * + * Note that Game Objects may call `batchQuad` or `batchTri` multiple times for a single draw, + * for example the Graphics Game Object. + * @param gameObject The Game Object that invoked this pipeline, if any. + */ + onBatch(gameObject?: Phaser.GameObjects.GameObject): void; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately before a **Game Object** is about to add itself to the batch. + * @param gameObject The Game Object that invoked this pipeline, if any. + */ + onPreBatch(gameObject?: Phaser.GameObjects.GameObject): void; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after a **Game Object** has been added to the batch. + * @param gameObject The Game Object that invoked this pipeline, if any. + */ + onPostBatch(gameObject?: Phaser.GameObjects.GameObject): void; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called once per frame, right before anything has been rendered, but after the canvas + * has been cleared. If this pipeline has a render target, it will also have been cleared by this point. + */ + onPreRender(): void; + + /** + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called _once per frame_, by every Camera in a Scene that wants to render. + * + * It is called at the start of the rendering process, before anything has been drawn to the Camera. * @param scene The Scene being rendered. * @param camera The Scene Camera being rendered with. */ - onRender(scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera): this; + onRender(scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera): void; /** - * Called after each frame has been completely rendered and snapshots have been taken. + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called _once per frame_, after all rendering has happened and snapshots have been taken. + * + * It is called at the very end of the rendering process, once all Cameras, for all Scenes, have + * been rendered. */ - onPostRender(): this; + onPostRender(): void; /** - * Uploads the vertex data and emits a draw call - * for the current batch of vertices. + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called every time this pipeline is asked to flush its batch. + * + * It is called immediately before the `gl.bufferData` and `gl.drawArray` calls are made, so you can + * perform any final pre-render modifications. To apply changes post-render, see `onAfterFlush`. + * @param isPostFlush Was this flush invoked as part of a post-process, or not? Default false. */ - flush(): this; + onBeforeFlush(isPostFlush?: boolean): void; /** - * Removes all object references in this WebGL Pipeline and removes its program from the WebGL context. + * By default this is an empty method hook that you can override and use in your own custom pipelines. + * + * This method is called immediately after this pipeline has finished flushing its batch. + * + * It is called after the `gl.drawArrays` call. + * + * You can perform additional post-render effects, but be careful not to call `flush` + * on this pipeline from within this method, or you'll cause an infinite loop. + * + * To apply changes pre-render, see `onBeforeFlush`. + * @param isPostFlush Was this flush invoked as part of a post-process, or not? Default false. */ - destroy(): this; + onAfterFlush(isPostFlush?: boolean): void; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Adds a single vertex to the current vertex buffer and increments the + * `vertexCount` property by 1. + * + * This method is called directly by `batchTri` and `batchQuad`. + * + * It does not perform any batch limit checking itself, so if you need to call + * this method directly, do so in the same way that `batchQuad` does, for example. + * @param x The vertex x position. + * @param y The vertex y position. + * @param u UV u value. + * @param v UV v value. + * @param unit Texture unit to which the texture needs to be bound. + * @param tintEffect The tint effect for the shader to use. + * @param tint The tint color value. + */ + batchVert(x: number, y: number, u: number, v: number, unit: number, tintEffect: number | boolean, tint: number): void; + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 6 vertices in the following arrangement: + * + * ``` + * 0----3 + * |\ B| + * | \ | + * | \ | + * | A \| + * | \ + * 1----2 + * ``` + * + * Where tx0/ty0 = 0, tx1/ty1 = 1, tx2/ty2 = 2 and tx3/ty3 = 3 + * @param gameObject The Game Object, if any, drawing this quad. + * @param x0 The top-left x position. + * @param y0 The top-left y position. + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + * @param tintTL The top-left tint color value. + * @param tintTR The top-right tint color value. + * @param tintBL The bottom-left tint color value. + * @param tintBR The bottom-right tint color value. + * @param tintEffect The tint effect for the shader to use. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + batchQuad(gameObject: Phaser.GameObjects.GameObject | null, x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintBR: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: number): boolean; + + /** + * Adds the vertices data into the batch and flushes if full. + * + * Assumes 3 vertices in the following arrangement: + * + * ``` + * 0 + * |\ + * | \ + * | \ + * | \ + * | \ + * 1-----2 + * ``` + * @param gameObject The Game Object, if any, drawing this quad. + * @param x1 The bottom-left x position. + * @param y1 The bottom-left y position. + * @param x2 The bottom-right x position. + * @param y2 The bottom-right y position. + * @param x3 The top-right x position. + * @param y3 The top-right y position. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + * @param tintTL The top-left tint color value. + * @param tintTR The top-right tint color value. + * @param tintBL The bottom-left tint color value. + * @param tintEffect The tint effect for the shader to use. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param unit Texture unit to which the texture needs to be bound. Default 0. + */ + batchTri(gameObject: Phaser.GameObjects.GameObject | null, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, u0: number, v0: number, u1: number, v1: number, tintTL: number, tintTR: number, tintBL: number, tintEffect: number | boolean, texture?: WebGLTexture, unit?: number): boolean; + + /** + * Pushes a filled rectangle into the vertex batch. + * + * The dimensions are run through `Math.floor` before the quad is generated. + * + * Rectangle has no transform values and isn't transformed into the local space. + * + * Used for directly batching untransformed rectangles, such as Camera background colors. + * @param x Horizontal top left coordinate of the rectangle. + * @param y Vertical top left coordinate of the rectangle. + * @param width Width of the rectangle. + * @param height Height of the rectangle. + * @param color Color of the rectangle to draw. + * @param alpha Alpha value of the rectangle to draw. + * @param texture WebGLTexture that will be assigned to the current batch if a flush occurs. + * @param flipUV Flip the vertical UV coordinates of the texture before rendering? Default true. + */ + drawFillRect(x: number, y: number, width: number, height: number, color: number, alpha: number, texture?: WebGLTexture, flipUV?: boolean): void; + + /** + * Sets the texture to be bound to the next available texture unit and returns + * the unit id. + * @param texture WebGLTexture that will be assigned to the current batch. If not given uses `whiteTexture`. + */ + setTexture2D(texture?: WebGLTexture): number; + + /** + * Activates the given WebGL Texture and binds it to the requested texture slot. + * @param target The WebGLTexture to activate and bind. + * @param unit The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. Default 0. + */ + bindTexture(target?: WebGLTexture, unit?: number): this; + + /** + * Activates the given Render Target texture and binds it to the + * requested WebGL texture slot. + * @param target The Render Target to activate and bind. + * @param unit The WebGL texture ID to activate. Defaults to `gl.TEXTURE0`. Default 0. + */ + bindRenderTarget(target?: Phaser.Renderer.WebGL.RenderTarget, unit?: number): this; + + /** + * Sets the current duration into a 1f uniform value based on the given name. + * + * This can be used for mapping time uniform values, such as `iTime`. + * @param name The name of the uniform to set. + */ + setTime(name: string): this; + + /** + * Sets a 1f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param x The new value of the `float` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat1(name: string, x: number): this; + set1f(name: string, x: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 2f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param x The new X component of the `vec2` uniform. * @param y The new Y component of the `vec2` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat2(name: string, x: number, y: number): this; + set2f(name: string, x: number, y: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 3f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param x The new X component of the `vec3` uniform. * @param y The new Y component of the `vec3` uniform. * @param z The new Z component of the `vec3` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat3(name: string, x: number, y: number, z: number): this; + set3f(name: string, x: number, y: number, z: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 4f uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param x X component of the uniform * @param y Y component of the uniform * @param z Z component of the uniform * @param w W component of the uniform + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat4(name: string, x: number, y: number, z: number, w: number): this; + set4f(name: string, x: number, y: number, z: number, w: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 1fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat1v(name: string, arr: Float32Array): this; + set1fv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 2fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat2v(name: string, arr: Float32Array): this; + set2fv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 3fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat3v(name: string, arr: Float32Array): this; + set3fv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 4fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setFloat4v(name: string, arr: Float32Array): this; + set4fv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 1iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. + */ + set1iv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; + + /** + * Sets a 2iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. + */ + set2iv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; + + /** + * Sets a 3iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. + */ + set3iv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; + + /** + * Sets a 4iv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. + */ + set4iv(name: string, arr: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; + + /** + * Sets a 1i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param x The new value of the `int` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setInt1(name: string, x: integer): this; + set1i(name: string, x: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 2i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param x The new X component of the `ivec2` uniform. * @param y The new Y component of the `ivec2` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setInt2(name: string, x: integer, y: integer): this; + set2i(name: string, x: number, y: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a 3i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param x The new X component of the `ivec3` uniform. * @param y The new Y component of the `ivec3` uniform. * @param z The new Z component of the `ivec3` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setInt3(name: string, x: integer, y: integer, z: integer): this; + set3i(name: string, x: number, y: number, z: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. - * @param x X component of the uniform - * @param y Y component of the uniform - * @param z Z component of the uniform - * @param w W component of the uniform + * Sets a 4i uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. + * @param x X component of the uniform. + * @param y Y component of the uniform. + * @param z Z component of the uniform. + * @param w W component of the uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setInt4(name: string, x: integer, y: integer, z: integer, w: integer): this; + set4i(name: string, x: number, y: number, z: number, w: number, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a matrix 2fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param transpose Whether to transpose the matrix. Should be `false`. * @param matrix The new values for the `mat2` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setMatrix2(name: string, transpose: boolean, matrix: Float32Array): this; + setMatrix2fv(name: string, transpose: boolean, matrix: number[] | Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a matrix 3fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param transpose Whether to transpose the matrix. Should be `false`. * @param matrix The new values for the `mat3` uniform. + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setMatrix3(name: string, transpose: boolean, matrix: Float32Array): this; + setMatrix3fv(name: string, transpose: boolean, matrix: Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; /** - * Set a uniform value of the current pipeline program. - * @param name The name of the uniform to look-up and modify. + * Sets a matrix 4fv uniform value based on the given name on the currently set shader. + * + * The current shader is bound, before the uniform is set, making it active within the + * WebGLRenderer. This means you can safely call this method from a location such as + * a Scene `create` or `update` method. However, when working within a Shader file + * directly, use the `WebGLShader` method equivalent instead, to avoid the program + * being set. + * @param name The name of the uniform to set. * @param transpose Should the matrix be transpose * @param matrix Matrix data + * @param shader The shader to set the value on. If not given, the `currentShader` is used. */ - setMatrix4(name: string, transpose: boolean, matrix: Float32Array): this; + setMatrix4fv(name: string, transpose: boolean, matrix: Float32Array, shader?: Phaser.Renderer.WebGL.WebGLShader): this; + + /** + * Destroys all shader instances, removes all object references and nulls all external references. + */ + destroy(): this; } @@ -72175,7 +81635,7 @@ declare namespace Phaser { * unexpected behavior. It's recommended that WebGL interaction is done through * WebGLRenderer and/or WebGLPipeline. */ - class WebGLRenderer { + class WebGLRenderer extends Phaser.Events.EventEmitter { /** * * @param game The Game instance which owns this WebGL Renderer. @@ -72195,19 +81655,32 @@ declare namespace Phaser { /** * A constant which allows the renderer to be easily identified as a WebGL Renderer. */ - type: integer; + type: number; + + /** + * An instance of the Pipeline Manager class, that handles all WebGL Pipelines. + * + * Use this to manage all of your interactions with pipelines, such as adding, getting, + * setting and rendering them. + * + * The Pipeline Manager class is created in the `init` method and then populated + * with pipelines during the `boot` method. + * + * Prior to Phaser v3.50.0 this was just a plain JavaScript object, not a class. + */ + pipelines: Phaser.Renderer.WebGL.PipelineManager; /** * The width of the canvas being rendered to. * This is populated in the onResize event handler. */ - width: integer; + width: number; /** * The height of the canvas being rendered to. * This is populated in the onResize event handler. */ - height: integer; + height: number; /** * The canvas which this WebGL Renderer draws to. @@ -72221,21 +81694,11 @@ declare namespace Phaser { */ blendModes: any[]; - /** - * Keeps track of any WebGLTexture created with the current WebGLRenderingContext - */ - nativeTextures: any[]; - /** * This property is set to `true` if the WebGL context of the renderer is lost. */ contextLost: boolean; - /** - * This object will store all pipelines created through addPipeline - */ - pipelines: object; - /** * Details about the currently scheduled snapshot. * @@ -72244,27 +81707,58 @@ declare namespace Phaser { snapshotState: Phaser.Types.Renderer.Snapshot.SnapshotState; /** - * Cached value for the last texture unit that was used + * Cached value for the last texture unit that was used. */ - currentActiveTextureUnit: integer; + currentActiveTexture: number; /** - * An array of the last texture handles that were bound to the WebGLRenderingContext + * Contains the current starting active texture unit. + * This value is constantly updated and should be treated as read-only by your code. */ - currentTextures: any[]; + startActiveTexture: number; /** - * Current framebuffer in use + * The maximum number of textures the GPU can handle. The minimum under the WebGL1 spec is 8. + * This is set via the Game Config `maxTextures` property and should never be changed after boot. + */ + maxTextures: number; + + /** + * An array of the available WebGL texture units, used to populate the uSampler uniforms. + * + * This array is populated during the init phase and should never be changed after boot. + */ + textureIndexes: any[]; + + /** + * An array of default temporary WebGL Textures. + * + * This array is populated during the init phase and should never be changed after boot. + */ + tempTextures: any[]; + + /** + * The currently bound texture at texture unit zero, if any. + */ + textureZero: WebGLTexture; + + /** + * The currently bound normal map texture at texture unit one, if any. + */ + normalTexture: WebGLTexture; + + /** + * The currently bound framebuffer in use. */ currentFramebuffer: WebGLFramebuffer; /** - * Current WebGLPipeline in use + * A stack into which the frame buffer objects are pushed and popped. */ - currentPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + fboStack: WebGLFramebuffer[]; /** - * Current WebGLProgram in use + * Current WebGLProgram in use. */ currentProgram: WebGLProgram; @@ -72281,7 +81775,7 @@ declare namespace Phaser { /** * Current blend mode in use */ - currentBlendMode: integer; + currentBlendMode: number; /** * Indicates if the the scissor state is enabled in WebGLRenderingContext @@ -72316,24 +81810,37 @@ declare namespace Phaser { gl: WebGLRenderingContext; /** - * Array of strings that indicate which WebGL extensions are supported by the browser + * Array of strings that indicate which WebGL extensions are supported by the browser. + * This is populated in the `boot` method. */ - supportedExtensions: object; + supportedExtensions: string[]; /** - * Extensions loaded into the current context + * If the browser supports the `ANGLE_instanced_arrays` extension, this property will hold + * a reference to the glExtension for it. + */ + instancedArraysExtension: ANGLE_instanced_arrays; + + /** + * If the browser supports the `OES_vertex_array_object` extension, this property will hold + * a reference to the glExtension for it. + */ + vaoExtension: OES_vertex_array_object; + + /** + * The WebGL Extensions loaded into the current context. */ extensions: object; /** - * Stores the current WebGL component formats for further use + * Stores the current WebGL component formats for further use. */ glFormats: any[]; /** * Stores the supported WebGL texture compression formats. */ - compression: any[]; + compression: object; /** * Cached drawing buffer height to reduce gl calls. @@ -72346,6 +81853,12 @@ declare namespace Phaser { */ readonly blankTexture: WebGLTexture; + /** + * A pure white 4x4 texture, as used by the Graphics system where needed. + * This is set in the `boot` method. + */ + readonly whiteTexture: WebGLTexture; + /** * A default Camera used in calls when no other camera has been provided. */ @@ -72354,7 +81867,7 @@ declare namespace Phaser { /** * The total number of masks currently stacked. */ - maskCount: integer; + maskCount: number; /** * The mask stack. @@ -72395,6 +81908,11 @@ declare namespace Phaser { */ nextTypeMatch: boolean; + /** + * Is the Game Object being currently rendered the final one in the list? + */ + finalType: boolean; + /** * The mipmap magFilter to be used when creating textures. * @@ -72417,6 +81935,16 @@ declare namespace Phaser { */ mipmapFilter: GLenum; + /** + * The number of times the renderer had to flush this frame, due to running out of texture units. + */ + textureFlush: number; + + /** + * Has this renderer fully booted yet? + */ + isBooted: boolean; + /** * Creates a new WebGLRenderingContext and initializes all internal state. * @param config The configuration object for the renderer. @@ -72426,19 +81954,16 @@ declare namespace Phaser { /** * The event handler that manages the `resize` event dispatched by the Scale Manager. * @param gameSize The default Game Size object. This is the un-modified game dimensions. - * @param baseSize The base Size object. The game dimensions multiplied by the resolution. The canvas width / height values match this. - * @param displaySize The display Size object. The size of the canvas style width / height attributes. - * @param resolution The Scale Manager resolution setting. + * @param baseSize The base Size object. The game dimensions. The canvas width / height values match this. */ - onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size, displaySize: Phaser.Structs.Size, resolution?: number): void; + onResize(gameSize: Phaser.Structs.Size, baseSize: Phaser.Structs.Size): void; /** * Resizes the drawing buffer to match that required by the Scale Manager. * @param width The new width of the renderer. * @param height The new height of the renderer. - * @param resolution The new resolution of the renderer. */ - resize(width?: number, height?: number, resolution?: number): this; + resize(width?: number, height?: number): this; /** * Checks if a WebGL extension is supported @@ -72457,31 +81982,6 @@ declare namespace Phaser { */ flush(): void; - /** - * Checks if a pipeline is present in the current WebGLRenderer - * @param pipelineName The name of the pipeline. - */ - hasPipeline(pipelineName: string): boolean; - - /** - * Returns the pipeline by name if the pipeline exists - * @param pipelineName The name of the pipeline. - */ - getPipeline(pipelineName: string): Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * Removes a pipeline by name. - * @param pipelineName The name of the pipeline to be removed. - */ - removePipeline(pipelineName: string): this; - - /** - * Adds a pipeline instance into the collection of pipelines - * @param pipelineName A unique string-based key for the pipeline. - * @param pipelineInstance A pipeline instance which must extend WebGLPipeline. - */ - addPipeline(pipelineName: string, pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline): Phaser.Renderer.WebGL.WebGLPipeline; - /** * Pushes a new scissor state. This is used to set nested scissor states. * @param x The x position of the scissor. @@ -72490,7 +81990,7 @@ declare namespace Phaser { * @param height The height of the scissor. * @param drawingBufferHeight Optional drawingBufferHeight override value. */ - pushScissor(x: integer, y: integer, width: integer, height: integer, drawingBufferHeight?: integer): integer[]; + pushScissor(x: number, y: number, width: number, height: number, drawingBufferHeight?: number): number[]; /** * Sets the current scissor state. @@ -72500,50 +82000,18 @@ declare namespace Phaser { * @param height The height of the scissor. * @param drawingBufferHeight Optional drawingBufferHeight override value. */ - setScissor(x: integer, y: integer, width: integer, height: integer, drawingBufferHeight?: integer): void; + setScissor(x: number, y: number, width: number, height: number, drawingBufferHeight?: number): void; /** * Pops the last scissor state and sets it. */ popScissor(): void; - /** - * Binds a WebGLPipeline and sets it as the current pipeline to be used. - * @param pipelineInstance The pipeline instance to be activated. - * @param gameObject The Game Object that invoked this pipeline, if any. - */ - setPipeline(pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline, gameObject?: Phaser.GameObjects.GameObject): Phaser.Renderer.WebGL.WebGLPipeline; - /** * Is there an active stencil mask? */ hasActiveStencilMask(): boolean; - /** - * Use this to reset the gl context to the state that Phaser requires to continue rendering. - * Calling this will: - * - * * Disable `DEPTH_TEST`, `CULL_FACE` and `STENCIL_TEST`. - * * Clear the depth buffer and stencil buffers. - * * Reset the viewport size. - * * Reset the blend mode. - * * Bind a blank texture as the active texture on texture unit zero. - * * Rebinds the given pipeline instance. - * - * You should call this having previously called `clearPipeline` and then wishing to return - * control to Phaser again. - * @param pipelineInstance The pipeline instance to be activated. - */ - rebindPipeline(pipelineInstance: Phaser.Renderer.WebGL.WebGLPipeline): void; - - /** - * Flushes the current WebGLPipeline being used and then clears it, along with the - * the current shader program and vertex buffer. Then resets the blend mode to NORMAL. - * Call this before jumping to your own gl context handler, and then call `rebindPipeline` when - * you wish to return control to Phaser again. - */ - clearPipeline(): void; - /** * Sets the blend mode to the value given. * @@ -72552,7 +82020,7 @@ declare namespace Phaser { * @param blendModeId The blend mode to be set. Can be a `BlendModes` const or an integer value. * @param force Force the blend mode to be set, regardless of the currently set blend mode. Default false. */ - setBlendMode(blendModeId: integer, force?: boolean): boolean; + setBlendMode(blendModeId: number, force?: boolean): boolean; /** * Creates a new custom blend mode for the renderer. @@ -72561,7 +82029,7 @@ declare namespace Phaser { * @param func An array containing the WebGL functions to use for the source and the destination blending factors, respectively. See the possible constants for {@link WebGLRenderingContext#blendFunc()}. * @param equation The equation to use for combining the RGB and alpha components of a new pixel with a rendered one. See the possible constants for {@link WebGLRenderingContext#blendEquation()}. */ - addBlendMode(func: GLenum[], equation: GLenum): integer; + addBlendMode(func: GLenum[], equation: GLenum): number; /** * Updates the function bound to a given custom blend mode. @@ -72569,45 +82037,142 @@ declare namespace Phaser { * @param func The function to use for the blend mode. * @param equation The equation to use for the blend mode. */ - updateBlendMode(index: integer, func: Function, equation: Function): this; + updateBlendMode(index: number, func: Function, equation: Function): this; /** * Removes a custom blend mode from the renderer. * Any Game Objects still using this blend mode will error, so be sure to clear them first. * @param index The index of the custom blend mode to be removed. */ - removeBlendMode(index: integer): this; + removeBlendMode(index: number): this; + + /** + * Activates the Texture Source and assigns it the next available texture unit. + * If none are available, it will flush the current pipeline first. + * @param textureSource The Texture Source to be assigned the texture unit. + */ + setTextureSource(textureSource: Phaser.Textures.TextureSource): number; + + /** + * Checks to see if the given diffuse and normal map textures are already bound, or not. + * @param texture The WebGL diffuse texture. + * @param normalMap The WebGL normal map texture. + */ + isNewNormalMap(texture: WebGLTexture, normalMap: WebGLTexture): boolean; + + /** + * Binds a texture directly to texture unit zero then activates it. + * If the texture is already at unit zero, it skips the bind. + * Make sure to call `clearTextureZero` after using this method. + * @param texture The WebGL texture that needs to be bound. + * @param flush Flush the pipeline if the texture is different? Default false. + */ + setTextureZero(texture: WebGLTexture, flush?: boolean): void; + + /** + * Clears the texture that was directly bound to texture unit zero. + */ + clearTextureZero(): void; + + /** + * Binds a texture directly to texture unit one then activates it. + * If the texture is already at unit one, it skips the bind. + * Make sure to call `clearNormalMap` after using this method. + * @param texture The WebGL texture that needs to be bound. + */ + setNormalMap(texture: WebGLTexture): void; + + /** + * Clears the texture that was directly bound to texture unit one and + * increases the start active texture counter. + */ + clearNormalMap(): void; + + /** + * Activates each texture, in turn, then binds them all to `null`. + * @param all Reset all textures, or just the first two? Default false. + */ + unbindTextures(all?: boolean): void; + + /** + * Flushes the current pipeline, then resets the first two textures + * back to the default temporary textures, resets the start active + * counter and sets texture unit 1 as being active. + * @param all Reset all textures, or just the first two? Default false. + */ + resetTextures(all?: boolean): void; /** * Binds a texture at a texture unit. If a texture is already * bound to that unit it will force a flush on the current pipeline. * @param texture The WebGL texture that needs to be bound. - * @param textureUnit The texture unit to which the texture will be bound. - * @param flush Will the current pipeline be flushed if this is a new texture, or not? Default true. */ - setTexture2D(texture: WebGLTexture, textureUnit: integer, flush?: boolean): this; + setTexture2D(texture: WebGLTexture): number; /** - * Binds a framebuffer. If there was another framebuffer already bound it will force a pipeline flush. + * Pushes a new framebuffer onto the FBO stack and makes it the currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Call `popFramebuffer` to remove it again. + * @param framebuffer The framebuffer that needs to be bound. + * @param updateScissor Set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. Default false. + * @param resetTextures Should the WebGL Textures be reset after the new framebuffer is bound? Default false. + * @param setViewport Should the WebGL viewport be set? Default true. + */ + pushFramebuffer(framebuffer: WebGLFramebuffer, updateScissor?: boolean, resetTextures?: boolean, setViewport?: boolean): this; + + /** + * Sets the given framebuffer as the active and currently bound framebuffer. + * + * If there was another framebuffer already bound it will force a pipeline flush. + * + * Typically, you should call `pushFramebuffer` instead of this method. * @param framebuffer The framebuffer that needs to be bound. * @param updateScissor If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. Default false. + * @param resetTextures Should the WebGL Textures be reset after the new framebuffer is bound? Default false. + * @param setViewport Should the WebGL viewport be set? Default true. */ - setFramebuffer(framebuffer: WebGLFramebuffer, updateScissor?: boolean): this; + setFramebuffer(framebuffer: WebGLFramebuffer, updateScissor?: boolean, resetTextures?: boolean, setViewport?: boolean): this; /** - * Binds a program. If there was another program already bound it will force a pipeline flush. + * Pops the previous framebuffer from the fbo stack and sets it. + * @param updateScissor If a framebuffer is given, set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack. Default false. + * @param resetTextures Should the WebGL Textures be reset after the new framebuffer is bound? Default false. + * @param setViewport Should the WebGL viewport be set? Default true. + */ + popFramebuffer(updateScissor?: boolean, resetTextures?: boolean, setViewport?: boolean): WebGLFramebuffer; + + /** + * Binds a shader program. + * + * If there was a different program already bound it will force a pipeline flush first. + * + * If the same program given to this method is already set as the current program, no change + * will take place and this method will return `false`. * @param program The program that needs to be bound. */ - setProgram(program: WebGLProgram): this; + setProgram(program: WebGLProgram): boolean; /** - * Bounds a vertex buffer. If there is a vertex buffer already bound it'll force a pipeline flush. + * Rebinds whatever program `WebGLRenderer.currentProgram` is set as, without + * changing anything, or flushing. + */ + resetProgram(): this; + + /** + * Binds a vertex buffer. + * + * If there was a different vertex buffer already bound it will force a pipeline flush first. + * + * If the same buffer given to this method is already set as the current buffer, no change + * will take place and this method will return `false`. * @param vertexBuffer The buffer that needs to be bound. */ - setVertexBuffer(vertexBuffer: WebGLBuffer): this; + setVertexBuffer(vertexBuffer: WebGLBuffer): boolean; /** - * Bounds a index buffer. If there is a index buffer already bound it'll force a pipeline flush. + * Binds an index buffer. If there is an index buffer already bound it'll force a pipeline flush. * @param indexBuffer The buffer the needs to be bound. */ setIndexBuffer(indexBuffer: WebGLBuffer): this; @@ -72619,7 +82184,7 @@ declare namespace Phaser { * @param height The height of the texture. * @param scaleMode The scale mode to be used by the texture. */ - createTextureFromSource(source: object, width: integer, height: integer, scaleMode: integer): WebGLTexture; + createTextureFromSource(source: object, width: number, height: number, scaleMode: number): WebGLTexture; /** * A wrapper for creating a WebGLTexture. If no pixel data is passed it will create an empty texture. @@ -72636,21 +82201,23 @@ declare namespace Phaser { * @param forceSize If `true` it will use the width and height passed to this method, regardless of the pixels dimension. Default false. * @param flipY Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. Default false. */ - createTexture2D(mipLevel: integer, minFilter: integer, magFilter: integer, wrapT: integer, wrapS: integer, format: integer, pixels: object, width: integer, height: integer, pma?: boolean, forceSize?: boolean, flipY?: boolean): WebGLTexture; + createTexture2D(mipLevel: number, minFilter: number, magFilter: number, wrapT: number, wrapS: number, format: number, pixels: object, width: number, height: number, pma?: boolean, forceSize?: boolean, flipY?: boolean): WebGLTexture; /** - * Wrapper for creating WebGLFramebuffer. - * @param width Width in pixels of the framebuffer - * @param height Height in pixels of the framebuffer - * @param renderTexture The color texture to where the color pixels are written - * @param addDepthStencilBuffer Indicates if the current framebuffer support depth and stencil buffers + * Creates a WebGL Framebuffer object and optionally binds a depth stencil render buffer. + * @param width If `addDepthStencilBuffer` is true, this controls the width of the depth stencil. + * @param height If `addDepthStencilBuffer` is true, this controls the height of the depth stencil. + * @param renderTexture The color texture where the color pixels are written. + * @param addDepthStencilBuffer Create a Renderbuffer for the depth stencil? Default false. */ - createFramebuffer(width: integer, height: integer, renderTexture: WebGLTexture, addDepthStencilBuffer: boolean): WebGLFramebuffer; + createFramebuffer(width: number, height: number, renderTexture: WebGLTexture, addDepthStencilBuffer?: boolean): WebGLFramebuffer; /** - * Wrapper for creating a WebGLProgram - * @param vertexShader Source to the vertex shader - * @param fragmentShader Source to the fragment shader + * Creates a WebGLProgram instance based on the given vertex and fragment shader source. + * + * Then compiles, attaches and links the program before returning it. + * @param vertexShader The vertex shader source code as a single string. + * @param fragmentShader The fragment shader source code as a single string. */ createProgram(vertexShader: string, fragmentShader: string): WebGLProgram; @@ -72659,20 +82226,22 @@ declare namespace Phaser { * @param initialDataOrSize It's either ArrayBuffer or an integer indicating the size of the vbo * @param bufferUsage How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW */ - createVertexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: integer): WebGLBuffer; + createVertexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: number): WebGLBuffer; /** * Wrapper for creating a vertex buffer. * @param initialDataOrSize Either ArrayBuffer or an integer indicating the size of the vbo. * @param bufferUsage How the buffer is used. gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW. */ - createIndexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: integer): WebGLBuffer; + createIndexBuffer(initialDataOrSize: ArrayBuffer, bufferUsage: number): WebGLBuffer; /** - * Removes the given texture from the nativeTextures array and then deletes it from the GPU. + * Calls `GL.deleteTexture` on the given WebGLTexture and also optionally + * resets the currently defined textures. * @param texture The WebGL Texture to be deleted. + * @param reset Call the `resetTextures` method after deleting this texture? Default false. */ - deleteTexture(texture: WebGLTexture): this; + deleteTexture(texture: WebGLTexture, reset?: boolean): this; /** * Deletes a WebGLFramebuffer from the GL instance. @@ -72701,7 +82270,8 @@ declare namespace Phaser { /** * Controls the post-render operations for the given camera. - * Renders the foreground camera effects like flash and fading. It resets the current scissor state. + * + * Renders the foreground camera effects like flash and fading, then resets the current scissor state. * @param camera The Camera to post-render. */ postRenderCamera(camera: Phaser.Cameras.Scene2D.Camera): void; @@ -72714,18 +82284,17 @@ declare namespace Phaser { /** * The core render step for a Scene Camera. * - * Iterates through the given Game Object's array and renders them with the given Camera. + * Iterates through the given array of Game Objects and renders them with the given Camera. * * This is called by the `CameraManager.render` method. The Camera Manager instance belongs to a Scene, and is invoked * by the Scene Systems.render method. * * This method is not called if `Camera.visible` is `false`, or `Camera.alpha` is zero. * @param scene The Scene to render. - * @param children The Game Object's within the Scene to be rendered. - * @param interpolationPercentage The interpolation percentage to apply. Currently un-used. + * @param children An array of filtered Game Objects that can be rendered by the given Camera. * @param camera The Scene Camera to render with. */ - render(scene: Phaser.Scene, children: Phaser.GameObjects.GameObject, interpolationPercentage: number, camera: Phaser.Cameras.Scene2D.Camera): void; + render(scene: Phaser.Scene, children: Phaser.GameObjects.GameObject[], camera: Phaser.Cameras.Scene2D.Camera): void; /** * The post-render step happens after all Cameras in all Scenes have been rendered. @@ -72770,7 +82339,7 @@ declare namespace Phaser { * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. */ - snapshotArea(x: integer, y: integer, width: integer, height: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; + snapshotArea(x: number, y: number, width: number, height: number, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, type?: string, encoderOptions?: number): this; /** * Schedules a snapshot of the given pixel from the game viewport to be taken after the current frame is rendered. @@ -72787,7 +82356,7 @@ declare namespace Phaser { * @param y The y coordinate of the pixel to get. * @param callback The Function to invoke after the snapshot pixel data is extracted. */ - snapshotPixel(x: integer, y: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; + snapshotPixel(x: number, y: number, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback): this; /** * Takes a snapshot of the given area of the given frame buffer. @@ -72810,7 +82379,7 @@ declare namespace Phaser { * @param type The format of the image to create, usually `image/png` or `image/jpeg`. Default 'image/png'. * @param encoderOptions The image quality, between 0 and 1. Used for image formats with lossy compression, such as `image/jpeg`. Default 0.92. */ - snapshotFramebuffer(framebuffer: WebGLFramebuffer, bufferWidth: integer, bufferHeight: integer, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, getPixel?: boolean, x?: integer, y?: integer, width?: integer, height?: integer, type?: string, encoderOptions?: number): this; + snapshotFramebuffer(framebuffer: WebGLFramebuffer, bufferWidth: number, bufferHeight: number, callback: Phaser.Types.Renderer.Snapshot.SnapshotCallback, getPixel?: boolean, x?: number, y?: number, width?: number, height?: number, type?: string, encoderOptions?: number): this; /** * Creates a new WebGL Texture based on the given Canvas Element. @@ -72860,184 +82429,14 @@ declare namespace Phaser { * @param texture The texture to set the filter for. * @param filter The filter to set. 0 for linear filtering, 1 for nearest neighbor (blocky) filtering. */ - setTextureFilter(texture: integer, filter: integer): this; - - /** - * Sets a 1f uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 1f value to set on the named uniform. - */ - setFloat1(program: WebGLProgram, name: string, x: number): this; - - /** - * Sets the 2f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 2f x value to set on the named uniform. - * @param y The 2f y value to set on the named uniform. - */ - setFloat2(program: WebGLProgram, name: string, x: number, y: number): this; - - /** - * Sets the 3f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 3f x value to set on the named uniform. - * @param y The 3f y value to set on the named uniform. - * @param z The 3f z value to set on the named uniform. - */ - setFloat3(program: WebGLProgram, name: string, x: number, y: number, z: number): this; - - /** - * Sets the 4f uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 4f x value to set on the named uniform. - * @param y The 4f y value to set on the named uniform. - * @param z The 4f z value to set on the named uniform. - * @param w The 4f w value to set on the named uniform. - */ - setFloat4(program: WebGLProgram, name: string, x: number, y: number, z: number, w: number): this; - - /** - * Sets the value of a 1fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param arr The new value to be used for the uniform variable. - */ - setFloat1v(program: WebGLProgram, name: string, arr: Float32Array): this; - - /** - * Sets the value of a 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param arr The new value to be used for the uniform variable. - */ - setFloat2v(program: WebGLProgram, name: string, arr: Float32Array): this; - - /** - * Sets the value of a 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param arr The new value to be used for the uniform variable. - */ - setFloat3v(program: WebGLProgram, name: string, arr: Float32Array): this; - - /** - * Sets the value of a 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param arr The new value to be used for the uniform variable. - */ - setFloat4v(program: WebGLProgram, name: string, arr: Float32Array): this; - - /** - * Sets a 1i uniform value on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 1i value to set on the named uniform. - */ - setInt1(program: WebGLProgram, name: string, x: integer): this; - - /** - * Sets the 2i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 2i x value to set on the named uniform. - * @param y The 2i y value to set on the named uniform. - */ - setInt2(program: WebGLProgram, name: string, x: integer, y: integer): this; - - /** - * Sets the 3i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 3i x value to set on the named uniform. - * @param y The 3i y value to set on the named uniform. - * @param z The 3i z value to set on the named uniform. - */ - setInt3(program: WebGLProgram, name: string, x: integer, y: integer, z: integer): this; - - /** - * Sets the 4i uniform values on the given shader. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param x The 4i x value to set on the named uniform. - * @param y The 4i y value to set on the named uniform. - * @param z The 4i z value to set on the named uniform. - * @param w The 4i w value to set on the named uniform. - */ - setInt4(program: WebGLProgram, name: string, x: integer, y: integer, z: integer, w: integer): this; - - /** - * Sets the value of a matrix 2fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param transpose The value indicating whether to transpose the matrix. Must be false. - * @param matrix A Float32Array or sequence of 4 float values. - */ - setMatrix2(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; - - /** - * Sets the value of a matrix 3fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param transpose The value indicating whether to transpose the matrix. Must be false. - * @param matrix A Float32Array or sequence of 9 float values. - */ - setMatrix3(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; - - /** - * Sets the value of a matrix 4fv uniform variable in the given WebGLProgram. - * - * If the shader is not currently active, it is made active first. - * @param program The target WebGLProgram from which the uniform location will be looked-up. - * @param name The name of the uniform to look-up and modify. - * @param transpose The value indicating whether to transpose the matrix. Must be false. - * @param matrix A Float32Array or sequence of 16 float values. - */ - setMatrix4(program: WebGLProgram, name: string, transpose: boolean, matrix: Float32Array): this; - - /** - * Returns the maximum number of texture units that can be used in a fragment shader. - */ - getMaxTextures(): integer; + setTextureFilter(texture: number, filter: number): this; /** * Returns the largest texture size (either width or height) that can be created. * Note that VRAM may not allow a texture of any given size, it just expresses * hardware / driver support for a given size. */ - getMaxTextureSize(): integer; + getMaxTextureSize(): number; /** * Destroy this WebGLRenderer, cleaning up all related resources such as pipelines, native textures, etc. @@ -73046,6 +82445,490 @@ declare namespace Phaser { } + /** + * TODO + */ + class WebGLShader { + /** + * + * @param pipeline The WebGLPipeline to which this Shader belongs. + * @param name The name of this Shader. + * @param vertexShader The vertex shader source code as a single string. + * @param fragmentShader The fragment shader source code as a single string. + * @param attributes An array of attributes. + */ + constructor(pipeline: Phaser.Renderer.WebGL.WebGLPipeline, name: string, vertexShader: string, fragmentShader: string, attributes: Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]); + + /** + * A reference to the WebGLPipeline that owns this Shader. + * + * A Shader class can only belong to a single pipeline. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The name of this shader. + */ + name: string; + + /** + * A reference to the WebGLRenderer instance. + */ + renderer: Phaser.Renderer.WebGL.WebGLRenderer; + + /** + * A reference to the WebGL Rendering Context the WebGL Renderer is using. + */ + gl: WebGLRenderingContext; + + /** + * The WebGLProgram created from the vertex and fragment shaders. + */ + program: WebGLProgram; + + /** + * Array of objects that describe the vertex attributes. + */ + attributes: Phaser.Types.Renderer.WebGL.WebGLPipelineAttribute[]; + + /** + * The amount of vertex attribute components of 32 bit length. + */ + vertexComponentCount: number; + + /** + * The size, in bytes, of a single vertex. + * + * This is derived by adding together all of the vertex attributes. + * + * For example, the Multi Pipeline has the following attributes: + * + * inPosition - (size 2 x gl.FLOAT) = 8 + * inTexCoord - (size 2 x gl.FLOAT) = 8 + * inTexId - (size 1 x gl.FLOAT) = 4 + * inTintEffect - (size 1 x gl.FLOAT) = 4 + * inTint - (size 4 x gl.UNSIGNED_BYTE) = 4 + * + * The total, in this case, is 8 + 8 + 4 + 4 + 4 = 28. + * + * This is calculated automatically during the `createAttributes` method. + */ + readonly vertexSize: number; + + /** + * The active uniforms that this shader has. + * + * This is an object that maps the uniform names to their WebGL location and cached values. + * + * It is populated automatically via the `createUniforms` method. + */ + uniforms: Phaser.Types.Renderer.WebGL.WebGLPipelineUniformsConfig; + + /** + * Takes the vertex attributes config and parses it, creating the resulting array that is stored + * in this shaders `attributes` property, calculating the offset, normalization and location + * in the process. + * + * Calling this method resets `WebGLShader.attributes`, `WebGLShader.vertexSize` and + * `WebGLShader.vertexComponentCount`. + * + * It is called automatically when this class is created, but can be called manually if required. + * @param attributes An array of attributes configs. + */ + createAttributes(attributes: Phaser.Types.Renderer.WebGL.WebGLPipelineAttributesConfig[]): void; + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * This method is called every time the parent pipeline is made the current active pipeline. + * @param setAttributes Should the vertex attribute pointers be set? Default false. + * @param flush Flush the pipeline before binding this shader? Default false. + */ + bind(setAttributes?: boolean, flush?: boolean): this; + + /** + * Sets the program this shader uses as being the active shader in the WebGL Renderer. + * + * Then resets all of the attribute pointers. + */ + rebind(): this; + + /** + * Sets the vertex attribute pointers. + * + * This should only be called after the vertex buffer has been bound. + * + * It is called automatically during the `bind` method. + * @param reset Reset the vertex attribute locations? Default false. + */ + setAttribPointers(reset?: boolean): this; + + /** + * Sets up the `WebGLShader.uniforms` object, populating it with the names + * and locations of the shader uniforms this shader requires. + * + * It works by first calling `gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS)` to + * find out how many active uniforms this shader has. It then iterates through them, + * calling `gl.getActiveUniform` to get the WebGL Active Info from each one. Finally, + * the name and location are stored in the local array. + * + * This method is called automatically when this class is created. + */ + createUniforms(): this; + + /** + * Checks to see if the given uniform name exists and is active in this shader. + * @param name The name of the uniform to check for. + */ + hasUniform(name: string): boolean; + + /** + * Resets the cached values of the given uniform. + * @param name The name of the uniform to reset. + */ + resetUniform(name: string): this; + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param setter The GL function to call. + * @param name The name of the uniform to set. + * @param value1 The new value of the uniform. + */ + setUniform1(setter: Function, name: string, value1: boolean | number | number[] | Float32Array): this; + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param setter The GL function to call. + * @param name The name of the uniform to set. + * @param value1 The new value of the uniform. + * @param value2 The new value of the uniform. + */ + setUniform2(setter: Function, name: string, value1: boolean | number | number[] | Float32Array, value2: boolean | number | number[] | Float32Array): this; + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param setter The GL function to call. + * @param name The name of the uniform to set. + * @param value1 The new value of the uniform. + * @param value2 The new value of the uniform. + * @param value3 The new value of the uniform. + */ + setUniform3(setter: Function, name: string, value1: boolean | number | number[] | Float32Array, value2: boolean | number | number[] | Float32Array, value3: boolean | number | number[] | Float32Array): this; + + /** + * Sets the given uniform value/s based on the name and GL function. + * + * This method is called internally by other methods such as `set1f` and `set3iv`. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param setter The GL function to call. + * @param name The name of the uniform to set. + * @param value1 The new value of the uniform. + * @param value2 The new value of the uniform. + * @param value3 The new value of the uniform. + * @param value4 The new value of the uniform. + */ + setUniform4(setter: Function, name: string, value1: boolean | number | number[] | Float32Array, value2: boolean | number | number[] | Float32Array, value3: boolean | number | number[] | Float32Array, value4: boolean | number | number[] | Float32Array): this; + + /** + * Sets a 1f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x The new value of the `float` uniform. + */ + set1f(name: string, x: number): this; + + /** + * Sets a 2f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x The new X component of the `vec2` uniform. + * @param y The new Y component of the `vec2` uniform. + */ + set2f(name: string, x: number, y: number): this; + + /** + * Sets a 3f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x The new X component of the `vec3` uniform. + * @param y The new Y component of the `vec3` uniform. + * @param z The new Z component of the `vec3` uniform. + */ + set3f(name: string, x: number, y: number, z: number): this; + + /** + * Sets a 4f uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x X component of the uniform + * @param y Y component of the uniform + * @param z Z component of the uniform + * @param w W component of the uniform + */ + set4f(name: string, x: number, y: number, z: number, w: number): this; + + /** + * Sets a 1fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set1fv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set2fv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set3fv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set4fv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 1iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set1iv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 2iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set2iv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 3iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set3iv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 4iv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param arr The new value to be used for the uniform variable. + */ + set4iv(name: string, arr: number[] | Float32Array): this; + + /** + * Sets a 1i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x The new value of the `int` uniform. + */ + set1i(name: string, x: number): this; + + /** + * Sets a 2i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x The new X component of the `ivec2` uniform. + * @param y The new Y component of the `ivec2` uniform. + */ + set2i(name: string, x: number, y: number): this; + + /** + * Sets a 3i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x The new X component of the `ivec3` uniform. + * @param y The new Y component of the `ivec3` uniform. + * @param z The new Z component of the `ivec3` uniform. + */ + set3i(name: string, x: number, y: number, z: number): this; + + /** + * Sets a 4i uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param x X component of the uniform + * @param y Y component of the uniform + * @param z Z component of the uniform + * @param w W component of the uniform + */ + set4i(name: string, x: number, y: number, z: number, w: number): this; + + /** + * Sets a matrix 2fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param transpose Whether to transpose the matrix. Should be `false`. + * @param matrix The new values for the `mat2` uniform. + */ + setMatrix2fv(name: string, transpose: boolean, matrix: number[] | Float32Array): this; + + /** + * Sets a matrix 3fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param transpose Whether to transpose the matrix. Should be `false`. + * @param matrix The new values for the `mat3` uniform. + */ + setMatrix3fv(name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Sets a matrix 4fv uniform value based on the given name on this shader. + * + * The uniform is only set if the value/s given are different to those previously set. + * + * This method works by first setting this shader as being the current shader within the + * WebGL Renderer, if it isn't already. It also sets this shader as being the current + * one within the pipeline it belongs to. + * @param name The name of the uniform to set. + * @param transpose Should the matrix be transpose + * @param matrix Matrix data + */ + setMatrix4fv(name: string, transpose: boolean, matrix: Float32Array): this; + + /** + * Removes all external references from this class and deletes the WebGL program from the WebGL context. + * + * Does not remove this shader from the parent pipeline. + */ + destroy(): void; + + } + } } @@ -73228,6 +83111,8 @@ declare namespace Phaser { /** * The Scale Manager Orientation Change Event. + * + * This event is dispatched whenever the Scale Manager detects an orientation change event from the browser. */ const ORIENTATION_CHANGE: any; @@ -73388,7 +83273,7 @@ declare namespace Phaser { /** * The Base Size component. * - * The modified game size, which is the gameSize * resolution, used to set the canvas width and height + * The modified game size, which is the auto-rounded gameSize, used to set the canvas width and height * (but not the CSS style) */ baseSize: Phaser.Structs.Size; @@ -73405,13 +83290,6 @@ declare namespace Phaser { */ scaleMode: Phaser.Scale.ScaleModeType; - /** - * The canvas resolution. - * - * This is hard-coded to a value of 1 in the 3.16 release of Phaser and will be enabled at a later date. - */ - resolution: number; - /** * The game zoom factor. * @@ -73485,7 +83363,7 @@ declare namespace Phaser { * more traditional 'size check' based on a time interval. You can control how often it is * checked here. */ - resizeInterval: integer; + resizeInterval: number; /** * Called _before_ the canvas object is created and added to the DOM. @@ -73573,7 +83451,7 @@ declare namespace Phaser { * Sets the zoom value of the Scale Manager. * @param value The new zoom value of the game. */ - setZoom(value: integer): this; + setZoom(value: number): this; /** * Sets the zoom to be the maximum possible based on the _current_ parent size. @@ -73609,7 +83487,7 @@ declare namespace Phaser { * parent and game sizes. If the parent has no dimensions (i.e. an unstyled div), * or is smaller than the un-zoomed game, then this will return a value of 1 (no zoom) */ - getMaxZoom(): integer; + getMaxZoom(): number; /** * Calculates and updates the canvas CSS style in order to center it within the @@ -73707,7 +83585,7 @@ declare namespace Phaser { /** * Triggered when a fullscreenchange event is dispatched by the DOM. */ - onFullScreenChange(): void; + protected onFullScreenChange(): void; /** * Triggered when a fullscreenerror event is dispatched by the DOM. @@ -73784,7 +83662,7 @@ declare namespace Phaser { * The game canvas is not centered within the parent by Phaser. * You can still center it yourself via CSS. */ - const NO_CENTER: integer; + const NO_CENTER: number; /** * The game canvas is centered both horizontally and vertically within the parent. @@ -73793,7 +83671,7 @@ declare namespace Phaser { * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. */ - const CENTER_BOTH: integer; + const CENTER_BOTH: number; /** * The game canvas is centered horizontally within the parent. @@ -73802,7 +83680,7 @@ declare namespace Phaser { * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. */ - const CENTER_HORIZONTALLY: integer; + const CENTER_HORIZONTALLY: number; /** * The game canvas is centered both vertically within the parent. @@ -73811,7 +83689,7 @@ declare namespace Phaser { * Centering is achieved by setting the margin left and top properties of the * game canvas, and does not factor in any other CSS styles you may have applied. */ - const CENTER_VERTICALLY: integer; + const CENTER_VERTICALLY: number; /** * A landscape orientation. @@ -73828,56 +83706,56 @@ declare namespace Phaser { * again from that point on. If you change the canvas size, either via CSS, or directly via code, then you need * to call the Scale Managers `resize` method to give the new dimensions, or input events will stop working. */ - const NONE: integer; + const NONE: number; /** * The height is automatically adjusted based on the width. */ - const WIDTH_CONTROLS_HEIGHT: integer; + const WIDTH_CONTROLS_HEIGHT: number; /** * The width is automatically adjusted based on the height. */ - const HEIGHT_CONTROLS_WIDTH: integer; + const HEIGHT_CONTROLS_WIDTH: number; /** * The width and height are automatically adjusted to fit inside the given target area, * while keeping the aspect ratio. Depending on the aspect ratio there may be some space * inside the area which is not covered. */ - const FIT: integer; + const FIT: number; /** * The width and height are automatically adjusted to make the size cover the entire target * area while keeping the aspect ratio. This may extend further out than the target size. */ - const ENVELOP: integer; + const ENVELOP: number; /** * The Canvas is resized to fit all available _parent_ space, regardless of aspect ratio. */ - const RESIZE: integer; + const RESIZE: number; /** * The game canvas will not be zoomed by Phaser. */ - const NO_ZOOM: integer; + const NO_ZOOM: number; /** * The game canvas will be 2x zoomed by Phaser. */ - const ZOOM_2X: integer; + const ZOOM_2X: number; /** * The game canvas will be 4x zoomed by Phaser. */ - const ZOOM_4X: integer; + const ZOOM_4X: number; /** * Calculate the zoom value based on the maximum multiplied game size that will * fit into the parent, or browser window if no parent is set. */ - const MAX_ZOOM: integer; + const MAX_ZOOM: number; } @@ -73885,54 +83763,63 @@ declare namespace Phaser { /** * Scene state. */ - var PENDING: integer; + var PENDING: number; /** * Scene state. */ - var INIT: integer; + var INIT: number; /** * Scene state. */ - var START: integer; + var START: number; /** * Scene state. */ - var LOADING: integer; + var LOADING: number; /** * Scene state. */ - var CREATING: integer; + var CREATING: number; /** * Scene state. */ - var RUNNING: integer; + var RUNNING: number; /** * Scene state. */ - var PAUSED: integer; + var PAUSED: number; /** * Scene state. */ - var SLEEPING: integer; + var SLEEPING: number; /** * Scene state. */ - var SHUTDOWN: integer; + var SHUTDOWN: number; /** * Scene state. */ - var DESTROYED: integer; + var DESTROYED: number; namespace Events { + /** + * The Game Object Added to Scene Event. + * + * This event is dispatched when a Game Object is added to a Scene. + * + * Listen for it from a Scene using `this.scene.events.on('addedtoscene', listener)`. + */ + const ADDED_TO_SCENE: any; + /** * The Scene Systems Boot Event. * @@ -74025,6 +83912,15 @@ declare namespace Phaser { */ const READY: any; + /** + * The Game Object Removed from Scene Event. + * + * This event is dispatched when a Game Object is removed from a Scene. + * + * Listen for it from a Scene using `this.scene.events.on('removedfromscene', listener)`. + */ + const REMOVED_FROM_SCENE: any; + /** * The Scene Systems Render Event. * @@ -74233,6 +84129,7 @@ declare namespace Phaser { * * The Scene Manager is a Game level system, responsible for creating, processing and updating all of the * Scenes in a Game instance. + * ó * */ class SceneManager { /** @@ -74429,13 +84326,13 @@ declare namespace Phaser { * Retrieves a Scene by numeric index. * @param index The index of the Scene to retrieve. */ - getAt(index: integer): Phaser.Scene | undefined; + getAt(index: number): Phaser.Scene | undefined; /** * Retrieves the numeric index of a Scene. * @param key The key of the Scene. */ - getIndex(key: string | Phaser.Scene): integer; + getIndex(key: string | Phaser.Scene): number; /** * Brings a Scene to the top of the Scenes list. @@ -74795,7 +84692,7 @@ declare namespace Phaser { * Retrieves the numeric index of a Scene in the Scenes list. * @param key The Scene to get the index of. */ - getIndex(key?: string | Phaser.Scene): integer; + getIndex(key?: string | Phaser.Scene): number; } @@ -75283,6 +85180,11 @@ declare namespace Phaser { */ plugins: Phaser.Plugins.PluginManager; + /** + * A reference to the renderer instance Phaser is using, either Canvas or WebGL. + */ + renderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; + /** * Should be overridden by your own Scenes. * This method is called once per game step while the scene is running. @@ -76547,7 +86449,7 @@ declare namespace Phaser { * * This is used internally when iterating through the list with the {@link #first}, {@link #last}, {@link #get}, and {@link #previous} properties. */ - position: integer; + position: number; /** * A callback that is invoked every time a child is added to this list. @@ -76577,19 +86479,19 @@ declare namespace Phaser { * @param index The index in the list at which the element(s) will be inserted. Default 0. * @param skipCallback Skip calling the List.addCallback if this child is added successfully. Default false. */ - addAt(child: T, index?: integer, skipCallback?: boolean): T; + addAt(child: T, index?: number, skipCallback?: boolean): T; /** * Retrieves the item at a given position inside the List. * @param index The index of the item. */ - getAt(index: integer): T; + getAt(index: number): T; /** * Locates an item within the List and returns its index. * @param child The item to locate. */ - getIndex(child: T): integer; + getIndex(child: T): number; /** * Sort the contents of this List so the items are in order based on the given property. @@ -76612,7 +86514,7 @@ declare namespace Phaser { * @param startIndex Offset from the front of the group (lowest child). Default 0. * @param length Restriction on the number of values you want to randomly select from. Default (to top). */ - getRandom(startIndex?: integer, length?: integer): T | null; + getRandom(startIndex?: number, length?: number): T | null; /** * Returns the first element in a given part of the List which matches a specific criterion. @@ -76642,14 +86544,14 @@ declare namespace Phaser { * @param startIndex The first child index to start the search from. * @param endIndex The last child index to search up until. */ - getAll(property?: string, value?: T, startIndex?: integer, endIndex?: integer): T[]; + getAll(property?: string, value?: T, startIndex?: number, endIndex?: number): T[]; /** * Returns the total number of items in the List which have a property matching the given value. * @param property The property to test on each item. * @param value The value to test the property against. */ - count(property: string, value: T): integer; + count(property: string, value: T): number; /** * Swaps the positions of two items in the list. @@ -76663,7 +86565,7 @@ declare namespace Phaser { * @param child The item to move. * @param index Moves an item in the List to a new position. */ - moveTo(child: T, index: integer): T; + moveTo(child: T, index: number): T; /** * Removes one or many items from the List. @@ -76677,7 +86579,7 @@ declare namespace Phaser { * @param index The position to remove the item from. * @param skipCallback Skip calling the List.removeCallback. Default false. */ - removeAt(index: integer, skipCallback?: boolean): T; + removeAt(index: number, skipCallback?: boolean): T; /** * Removes the items within the given range in the List. @@ -76685,7 +86587,7 @@ declare namespace Phaser { * @param endIndex The position to stop removing at. The item at this position won't be removed. * @param skipCallback Skip calling the List.removeCallback. Default false. */ - removeBetween(startIndex?: integer, endIndex?: integer, skipCallback?: boolean): T[]; + removeBetween(startIndex?: number, endIndex?: number, skipCallback?: boolean): T[]; /** * Removes all the items. @@ -76747,7 +86649,7 @@ declare namespace Phaser { * @param startIndex The first child index to start the search from. * @param endIndex The last child index to search up until. */ - setAll(property: string, value: T, startIndex?: integer, endIndex?: integer): void; + setAll(property: string, value: T, startIndex?: number, endIndex?: number): void; /** * Passes all children to the given callback. @@ -76770,7 +86672,7 @@ declare namespace Phaser { /** * The number of items inside the List. */ - readonly length: integer; + readonly length: number; /** * The first item in the List or `null` for an empty List. @@ -76878,7 +86780,9 @@ declare namespace Phaser { dump(): void; /** - * Passes all entries in this Map to the given callback. + * Iterates through all entries in this Map, passing each one to the given callback. + * + * If the callback returns `false`, the iteration will break. * @param callback The callback which will receive the keys and entries held in this Map. */ each(callback: EachMapCallback): Phaser.Structs.Map; @@ -76912,6 +86816,11 @@ declare namespace Phaser { * time, rather than at the time of the request from the API. */ class ProcessQueue extends Phaser.Events.EventEmitter { + /** + * If `true` only unique objects will be allowed in the queue. + */ + checkQueue: boolean; + /** * Adds a new item to the Process Queue. * @@ -76954,7 +86863,7 @@ declare namespace Phaser { /** * The number of entries in the active list. */ - readonly length: integer; + readonly length: number; /** * Immediately destroys this process queue, clearing all of its internal arrays and resetting the process totals. @@ -77080,7 +86989,7 @@ declare namespace Phaser { * Changing the size will truncate the Set if the given value is smaller than the current size. * Increasing the size larger than the current size has no effect. */ - size: integer; + size: number; } @@ -77099,13 +87008,13 @@ declare namespace Phaser { * @param aspectMode The aspect mode of the Size component. Defaults to 0, no mode. Default 0. * @param parent The parent of this Size component. Can be any object with public `width` and `height` properties. Dimensions are clamped to keep them within the parent bounds where possible. Default null. */ - constructor(width?: number, height?: number, aspectMode?: integer, parent?: any); + constructor(width?: number, height?: number, aspectMode?: number, parent?: any); /** * The aspect mode this Size component will use when calculating its dimensions. * This property is read-only. To change it use the `setAspectMode` method. */ - readonly aspectMode: integer; + readonly aspectMode: number; /** * The proportional relationship between the width and height. @@ -77166,7 +87075,7 @@ declare namespace Phaser { * Calling this method automatically recalculates the `width` and the `height`, if required. * @param value The aspect mode value. Default 0. */ - setAspectMode(value?: integer): this; + setAspectMode(value?: number): this; /** * By setting a Snap To value when this Size component is modified its dimensions will automatically @@ -77388,27 +87297,27 @@ declare namespace Phaser { /** * Do not make the size fit the aspect ratio. Change the ratio when the size changes. */ - static readonly NONE: integer; + static readonly NONE: number; /** * The height is automatically adjusted based on the width. */ - static readonly WIDTH_CONTROLS_HEIGHT: integer; + static readonly WIDTH_CONTROLS_HEIGHT: number; /** * The width is automatically adjusted based on the height. */ - static readonly HEIGHT_CONTROLS_WIDTH: integer; + static readonly HEIGHT_CONTROLS_WIDTH: number; /** * The width and height are automatically adjusted to fit inside the given target area, while keeping the aspect ratio. Depending on the aspect ratio there may be some space inside the area which is not covered. */ - static readonly FIT: integer; + static readonly FIT: number; /** * The width and height are automatically adjusted to make the size cover the entire target area while keeping the aspect ratio. This may extend further out than the target size. */ - static readonly ENVELOP: integer; + static readonly ENVELOP: number; } @@ -77443,7 +87352,7 @@ declare namespace Phaser { * @param width The width of the canvas. * @param height The height of the canvas. */ - constructor(manager: Phaser.Textures.TextureManager, key: string, source: HTMLCanvasElement, width: integer, height: integer); + constructor(manager: Phaser.Textures.TextureManager, key: string, source: HTMLCanvasElement, width: number, height: number); /** * The source Canvas Element. @@ -77459,13 +87368,13 @@ declare namespace Phaser { * The width of the Canvas. * This property is read-only, if you wish to change it use the `setSize` method. */ - readonly width: integer; + readonly width: number; /** * The height of the Canvas. * This property is read-only, if you wish to change it use the `setSize` method. */ - readonly height: integer; + readonly height: number; /** * The context image data. @@ -77505,7 +87414,7 @@ declare namespace Phaser { * @param y The y coordinate to draw the source at. * @param source The element to draw to this canvas. */ - draw(x: integer, y: integer, source: HTMLImageElement | HTMLCanvasElement): Phaser.Textures.CanvasTexture; + draw(x: number, y: number, source: HTMLImageElement | HTMLCanvasElement): Phaser.Textures.CanvasTexture; /** * Draws the given texture frame to this CanvasTexture, then updates the internal @@ -77515,7 +87424,7 @@ declare namespace Phaser { * @param x The x coordinate to draw the source at. Default 0. * @param y The y coordinate to draw the source at. Default 0. */ - drawFrame(key: string, frame?: string | integer, x?: integer, y?: integer): Phaser.Textures.CanvasTexture; + drawFrame(key: string, frame?: string | number, x?: number, y?: number): Phaser.Textures.CanvasTexture; /** * Sets a pixel in the CanvasTexture to the given color and alpha values. @@ -77528,7 +87437,7 @@ declare namespace Phaser { * @param blue The blue color value. A number between 0 and 255. * @param alpha The alpha value. A number between 0 and 255. Default 255. */ - setPixel(x: integer, y: integer, red: integer, green: integer, blue: integer, alpha?: integer): this; + setPixel(x: number, y: number, red: number, green: number, blue: number, alpha?: number): this; /** * Puts the ImageData into the context of this CanvasTexture at the given coordinates. @@ -77540,7 +87449,7 @@ declare namespace Phaser { * @param dirtyWidth Width of the rectangle to be painted. Defaults to the width of the image data. * @param dirtyHeight Height of the rectangle to be painted. Defaults to the height of the image data. */ - putData(imageData: ImageData, x: integer, y: integer, dirtyX?: integer, dirtyY?: integer, dirtyWidth?: integer, dirtyHeight?: integer): this; + putData(imageData: ImageData, x: number, y: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): this; /** * Gets an ImageData region from this CanvasTexture from the position and size specified. @@ -77550,7 +87459,7 @@ declare namespace Phaser { * @param width The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left. * @param height The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up. */ - getData(x: integer, y: integer, width: integer, height: integer): ImageData; + getData(x: number, y: number, width: number, height: number): ImageData; /** * Get the color of a specific pixel from this texture and store it in a Color object. @@ -77561,7 +87470,7 @@ declare namespace Phaser { * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. * @param out A Color object to store the pixel values in. If not provided a new Color object will be created. */ - getPixel(x: integer, y: integer, out?: Phaser.Display.Color): Phaser.Display.Color; + getPixel(x: number, y: number, out?: Phaser.Display.Color): Phaser.Display.Color; /** * Returns an array containing all of the pixels in the given region. @@ -77576,7 +87485,7 @@ declare namespace Phaser { * @param width The width of the region to get. Must be an integer. Defaults to the canvas width if not given. * @param height The height of the region to get. Must be an integer. If not given will be set to the `width`. */ - getPixels(x?: integer, y?: integer, width?: integer, height?: integer): Phaser.Types.Textures.PixelConfig[][]; + getPixels(x?: number, y?: number, width?: number, height?: number): Phaser.Types.Textures.PixelConfig[][]; /** * Returns the Image Data index for the given pixel in this CanvasTexture. @@ -77588,7 +87497,7 @@ declare namespace Phaser { * @param x The x coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. * @param y The y coordinate of the pixel to get. Must lay within the dimensions of this CanvasTexture and be an integer. */ - getIndex(x: integer, y: integer): integer; + getIndex(x: number, y: number): number; /** * This should be called manually if you are running under WebGL. @@ -77615,14 +87524,14 @@ declare namespace Phaser { * @param width The width of the region. * @param height The height of the region. */ - clear(x?: integer, y?: integer, width?: integer, height?: integer): Phaser.Textures.CanvasTexture; + clear(x?: number, y?: number, width?: number, height?: number): Phaser.Textures.CanvasTexture; /** * Changes the size of this Canvas Texture. * @param width The new width of the Canvas. * @param height The new height of the Canvas. If not given it will use the width as the height. */ - setSize(width: integer, height?: integer): Phaser.Textures.CanvasTexture; + setSize(width: number, height?: number): Phaser.Textures.CanvasTexture; /** * Destroys this Texture and releases references to its sources and frames. @@ -77714,7 +87623,7 @@ declare namespace Phaser { * @param width The width of this Frame. * @param height The height of this Frame. */ - constructor(texture: Phaser.Textures.Texture, name: integer | string, sourceIndex: integer, x: number, y: number, width: number, height: number); + constructor(texture: Phaser.Textures.Texture, name: number | string, sourceIndex: number, x: number, y: number, width: number, height: number); /** * The Texture this Frame is a part of. @@ -77735,7 +87644,7 @@ declare namespace Phaser { /** * The index of the TextureSource in the Texture sources array. */ - sourceIndex: integer; + sourceIndex: number; /** * A reference to the Texture Source WebGL Texture that this Frame is using. @@ -77745,64 +87654,64 @@ declare namespace Phaser { /** * X position within the source image to cut from. */ - cutX: integer; + cutX: number; /** * Y position within the source image to cut from. */ - cutY: integer; + cutY: number; /** * The width of the area in the source image to cut. */ - cutWidth: integer; + cutWidth: number; /** * The height of the area in the source image to cut. */ - cutHeight: integer; + cutHeight: number; /** * The X rendering offset of this Frame, taking trim into account. */ - x: integer; + x: number; /** * The Y rendering offset of this Frame, taking trim into account. */ - y: integer; + y: number; /** * The rendering width of this Frame, taking trim into account. */ - width: integer; + width: number; /** * The rendering height of this Frame, taking trim into account. */ - height: integer; + height: number; /** * Half the width, floored. * Precalculated for the renderer. */ - halfWidth: integer; + halfWidth: number; /** * Half the height, floored. * Precalculated for the renderer. */ - halfHeight: integer; + halfHeight: number; /** * The x center of this frame, floored. */ - centerX: integer; + centerX: number; /** * The y center of this frame, floored. */ - centerY: integer; + centerY: number; /** * The horizontal pivot point of this Frame. @@ -77834,7 +87743,7 @@ declare namespace Phaser { * 0 = No rounding * 1 = Round */ - autoRound: integer; + autoRound: number; /** * Any Frame specific custom data can be stored here. @@ -77871,7 +87780,7 @@ declare namespace Phaser { * @param x The x coordinate of the top-left of this Frame. Default 0. * @param y The y coordinate of the top-left of this Frame. Default 0. */ - setSize(width: integer, height: integer, x?: integer, y?: integer): Phaser.Textures.Frame; + setSize(width: number, height: number, x?: number, y?: number): Phaser.Textures.Frame; /** * If the frame was trimmed when added to the Texture Atlas, this records the trim and source data. @@ -77909,6 +87818,20 @@ declare namespace Phaser { */ updateCropUVs(crop: object, flipX: boolean, flipY: boolean): object; + /** + * Directly sets the canvas and WebGL UV data for this frame. + * + * Use this if you need to override the values that are generated automatically + * when the Frame is created. + * @param width Width of this frame for the Canvas data. + * @param height Height of this frame for the Canvas data. + * @param u0 UV u0 value. + * @param v0 UV v0 value. + * @param u1 UV u1 value. + * @param v1 UV v1 value. + */ + setUVs(width: number, height: number, u0: number, v0: number, u1: number, v1: number): Phaser.Textures.Frame; + /** * Updates the internal WebGL UV cache and the drawImage cache. */ @@ -77961,12 +87884,12 @@ declare namespace Phaser { /** * Linear filter type. */ - const LINEAR: integer; + const LINEAR: number; /** * Nearest Neighbor filter type. */ - const NEAREST: integer; + const NEAREST: number; namespace Parsers { } @@ -78040,7 +87963,7 @@ declare namespace Phaser { * A Texture will always contain at least 1 frame because every Texture contains a `__BASE` frame by default, * in addition to any extra frames that have been added to it, such as when parsing a Sprite Sheet or Texture Atlas. */ - frameTotal: integer; + frameTotal: number; /** * Adds a new Frame to this Texture. @@ -78055,7 +87978,7 @@ declare namespace Phaser { * @param width The width of this Frame. * @param height The height of this Frame. */ - add(name: integer | string, sourceIndex: integer, x: number, y: number, width: number, height: number): Phaser.Textures.Frame; + add(name: number | string, sourceIndex: number, x: number, y: number, width: number, height: number): Phaser.Textures.Frame; /** * Removes the given Frame from this Texture. The Frame is destroyed immediately. @@ -78080,7 +88003,7 @@ declare namespace Phaser { * Passing no value for the name returns the base texture. * @param name The string-based name, or integer based index, of the Frame to get from this Texture. */ - get(name?: string | integer): Phaser.Textures.Frame; + get(name?: string | number): Phaser.Textures.Frame; /** * Takes the given TextureSource and returns the index of it within this Texture. @@ -78089,14 +88012,14 @@ declare namespace Phaser { * method will always return zero or -1. * @param source The TextureSource to check. */ - getTextureSourceIndex(source: Phaser.Textures.TextureSource): integer; + getTextureSourceIndex(source: Phaser.Textures.TextureSource): number; /** * Returns an array of all the Frames in the given TextureSource. * @param sourceIndex The index of the TextureSource to get the Frames from. * @param includeBase Include the `__BASE` Frame in the output array? Default false. */ - getFramesFromTextureSource(sourceIndex: integer, includeBase?: boolean): Phaser.Textures.Frame[]; + getFramesFromTextureSource(sourceIndex: number, includeBase?: boolean): Phaser.Textures.Frame[]; /** * Returns an array with all of the names of the Frames in this Texture. @@ -78113,7 +88036,7 @@ declare namespace Phaser { * This will return the actual DOM Image or Canvas element. * @param name The string-based name, or integer based index, of the Frame to get from this Texture. */ - getSourceImage(name?: string | integer): HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture; + getSourceImage(name?: string | number): HTMLImageElement | HTMLCanvasElement | Phaser.GameObjects.RenderTexture; /** * Given a Frame name, return the data source image it uses to render with. @@ -78122,7 +88045,7 @@ declare namespace Phaser { * This will return the actual DOM Image. * @param name The string-based name, or integer based index, of the Frame to get from this Texture. */ - getDataSourceImage(name?: string | integer): HTMLImageElement | HTMLCanvasElement; + getDataSourceImage(name?: string | number): HTMLImageElement | HTMLCanvasElement; /** * Adds a data source image to this Texture. @@ -78210,6 +88133,10 @@ declare namespace Phaser { /** * Adds a new Texture to the Texture Manager created from the given Base64 encoded data. + * + * It works by creating an `Image` DOM object, then setting the `src` attribute to + * the given base64 encoded data. As a result, the process is asynchronous by its nature, + * so be sure to listen for the events this method dispatches before using the texture. * @param key The unique string-based key of the Texture. * @param data The Base64 encoded data. */ @@ -78228,7 +88155,7 @@ declare namespace Phaser { * @param type A DOMString indicating the image format. The default format type is image/png. Default 'image/png'. * @param encoderOptions A Number between 0 and 1 indicating the image quality to use for image formats that use lossy compression such as image/jpeg and image/webp. If this argument is anything else, the default value for image quality is used. The default value is 0.92. Other arguments are ignored. Default 0.92. */ - getBase64(key: string, frame?: string | integer, type?: string, encoderOptions?: number): string; + getBase64(key: string, frame?: string | number, type?: string, encoderOptions?: number): string; /** * Adds a new Texture to the Texture Manager created from the given Image element. @@ -78243,13 +88170,16 @@ declare namespace Phaser { * * This allows you to then use the Texture as a normal texture for texture based Game Objects like Sprites. * + * If the `width` and `height` arguments are omitted, but the WebGL Texture was created by Phaser's WebGL Renderer + * and has `glTexture.width` and `glTexture.height` properties, these values will be used instead. + * * This is a WebGL only feature. * @param key The unique string-based key of the Texture. * @param glTexture The source Render Texture. - * @param width The new width of the Texture. - * @param height The new height of the Texture. + * @param width The new width of the Texture. Read from `glTexture.width` if omitted. + * @param height The new height of the Texture. Read from `glTexture.height` if omitted. */ - addGLTexture(key: string, glTexture: WebGLTexture, width: number, height: number): Phaser.Textures.Texture; + addGLTexture(key: string, glTexture: WebGLTexture, width?: number, height?: number): Phaser.Textures.Texture; /** * Adds a Render Texture to the Texture Manager using the given key. @@ -78307,7 +88237,7 @@ declare namespace Phaser { * @param width The width of the Canvas element. Default 256. * @param height The height of the Canvas element. Default 256. */ - createCanvas(key: string, width?: integer, height?: integer): Phaser.Textures.CanvasTexture; + createCanvas(key: string, width?: number, height?: number): Phaser.Textures.CanvasTexture; /** * Creates a new Canvas Texture object from an existing Canvas element @@ -78398,7 +88328,7 @@ declare namespace Phaser { * @param width The width of the Texture. * @param height The height of the Texture. */ - create(key: string, source: HTMLImageElement, width: integer, height: integer): Phaser.Textures.Texture; + create(key: string, source: HTMLImageElement, width: number, height: number): Phaser.Textures.Texture; /** * Checks the given key to see if a Texture using it exists within this Texture Manager. @@ -78423,14 +88353,14 @@ declare namespace Phaser { * @param key The unique string-based key of the Texture. * @param frame The string or index of the Frame to be cloned. */ - cloneFrame(key: string, frame: string | integer): Phaser.Textures.Frame; + cloneFrame(key: string, frame: string | number): Phaser.Textures.Frame; /** * Takes a Texture key and Frame name and returns a reference to that Frame, if found. * @param key The unique string-based key of the Texture. * @param frame The string-based name, or integer based index, of the Frame to get from the Texture. */ - getFrame(key: string, frame?: string | integer): Phaser.Textures.Frame; + getFrame(key: string, frame?: string | number): Phaser.Textures.Frame; /** * Returns an array with all of the keys of all Textures in this Texture Manager. @@ -78447,7 +88377,7 @@ declare namespace Phaser { * @param key The unique string-based key of the Texture. * @param frame The string or index of the Frame. */ - getPixel(x: integer, y: integer, key: string, frame?: string | integer): Phaser.Display.Color; + getPixel(x: number, y: number, key: string, frame?: string | number): Phaser.Display.Color; /** * Given a Texture and an `x` and `y` coordinate this method will return a value between 0 and 255 @@ -78458,7 +88388,7 @@ declare namespace Phaser { * @param key The unique string-based key of the Texture. * @param frame The string or index of the Frame. */ - getPixelAlpha(x: integer, y: integer, key: string, frame?: string | integer): integer; + getPixelAlpha(x: number, y: number, key: string, frame?: string | number): number; /** * Sets the given Game Objects `texture` and `frame` properties so that it uses @@ -78467,7 +88397,7 @@ declare namespace Phaser { * @param key The unique string-based key of the Texture. * @param frame The string or index of the Frame. */ - setTexture(gameObject: Phaser.GameObjects.GameObject, key: string, frame?: string | integer): Phaser.GameObjects.GameObject; + setTexture(gameObject: Phaser.GameObjects.GameObject, key: string, frame?: string | number): Phaser.GameObjects.GameObject; /** * Changes the key being used by a Texture to the new key provided. @@ -78512,7 +88442,7 @@ declare namespace Phaser { * @param height Optional height of the source image. If not given it's derived from the source itself. * @param flipY Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. Default false. */ - constructor(texture: Phaser.Textures.Texture, source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Phaser.GameObjects.RenderTexture | WebGLTexture, width?: integer, height?: integer, flipY?: boolean); + constructor(texture: Phaser.Textures.Texture, source: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | Phaser.GameObjects.RenderTexture | WebGLTexture, width?: number, height?: number, flipY?: boolean); /** * The Texture this TextureSource belongs to. @@ -78541,7 +88471,7 @@ declare namespace Phaser { /** * Currently un-used. */ - compressionAlgorithm: integer; + compressionAlgorithm: number; /** * The resolution of the source image. @@ -78552,13 +88482,13 @@ declare namespace Phaser { * The width of the source image. If not specified in the constructor it will check * the `naturalWidth` and then `width` properties of the source image. */ - width: integer; + width: number; /** * The height of the source image. If not specified in the constructor it will check * the `naturalHeight` and then `height` properties of the source image. */ - height: integer; + height: number; /** * The Scale Mode the image will use when rendering. @@ -78597,6 +88527,18 @@ declare namespace Phaser { */ glTexture: WebGLTexture; + /** + * The current texture unit index as assigned by the WebGL Renderer. + * Un-used in canvas. Should be treated as read-only. + */ + glIndex: number; + + /** + * The counter value when this texture was last assigned an index by the WebGL Renderer. + * Un-used in canvas. Should be treated as read-only. + */ + glIndexCounter: number; + /** * Sets the `UNPACK_FLIP_Y_WEBGL` flag the WebGL Texture uses during upload. */ @@ -78641,180 +88583,36 @@ declare namespace Phaser { namespace Tilemaps { namespace Components { - } - - /** - * A Dynamic Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination - * with one, or more, Tilesets. - * - * A Dynamic Tilemap Layer trades some speed for being able to apply powerful effects. Unlike a - * Static Tilemap Layer, you can apply per-tile effects like tint or alpha, and you can change the - * tiles in a DynamicTilemapLayer. - * - * Use this over a Static Tilemap Layer when you need those features. - */ - class DynamicTilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { - /** - * - * @param scene The Scene to which this Game Object belongs. - * @param tilemap The Tilemap this layer is a part of. - * @param layerIndex The index of the LayerData associated with this layer. - * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param x The world x position where the top left of this layer will be placed. Default 0. - * @param y The world y position where the top left of this layer will be placed. Default 0. - */ - constructor(scene: Phaser.Scene, tilemap: Phaser.Tilemaps.Tilemap, layerIndex: integer, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number); - - /** - * Used internally by physics system to perform fast type checks. - */ - readonly isTilemap: boolean; - - /** - * The Tilemap that this layer is a part of. - */ - tilemap: Phaser.Tilemaps.Tilemap; - - /** - * The index of the LayerData associated with this layer. - */ - layerIndex: integer; - - /** - * The LayerData associated with this layer. LayerData can only be associated with one - * tilemap layer. - */ - layer: Phaser.Tilemaps.LayerData; - - /** - * The Tileset/s associated with this layer. - * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - */ - tileset: Phaser.Tilemaps.Tileset[]; - - /** - * Used internally with the canvas render. This holds the tiles that are visible within the - * camera. - */ - culledTiles: any[]; - - /** - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - */ - skipCull: boolean; - - /** - * The total number of tiles drawn by the renderer in the last frame. - */ - readonly tilesDrawn: integer; - - /** - * The total number of tiles in this layer. Updated every frame. - */ - readonly tilesTotal: integer; - - /** - * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. - * - * See the method `setCullPadding` for more details. - */ - cullPaddingX: integer; - - /** - * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. - * - * See the method `setCullPadding` for more details. - */ - cullPaddingY: integer; - - /** - * The callback that is invoked when the tiles are culled. - * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. - * - * It will be sent 3 arguments: - * - * 1. The Phaser.Tilemaps.LayerData object for this Layer - * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. - * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. - * - * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. - */ - cullCallback: Function; - - /** - * An array holding the mapping between the tile indexes and the tileset they belong to. - */ - gidMap: Phaser.Tilemaps.Tileset[]; - - /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. - * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. - */ - setRenderOrder(renderOrder: integer | string): this; - /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * @param tileX The x coordinate. * @param tileY The y coordinate. + * @param layer The Tilemap Layer to act upon. */ - calculateFacesAt(tileX: integer, tileY: integer): Phaser.Tilemaps.DynamicTilemapLayer; + function CalculateFacesAt(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): void; /** * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. */ - calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + function CalculateFacesWithin(tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; /** - * Creates a Sprite for every object matching the given tile indexes in the layer. You can - * optionally specify if each tile will be replaced with a new tile after the Sprite has been - * created. This is useful if you want to lay down special tiles in a level that are converted to - * Sprites, but want to replace the tile itself with a floor tile or similar once converted. - * @param indexes The tile index, or array of indexes, to create Sprites from. - * @param replacements The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param spriteConfig The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param scene The Scene to create the Sprites within. Default scene the map is within. - * @param camera The Camera to use when determining the world XY Default main camera. - */ - createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Sprite[]; - - /** - * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. + * Checks if the given tile coordinate is within the isometric layer bounds, or not. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The Tilemap Layer to check against. * @param camera The Camera to run the cull check against. */ - cull(camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + function CheckIsoBounds(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData, camera?: Phaser.Cameras.Scene2D.Camera): boolean; /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile @@ -78826,28 +88624,55 @@ declare namespace Phaser { * @param height The height of the area to copy, in tiles, not pixels. * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. */ - copy(srcTileX: integer, srcTileY: integer, width: integer, height: integer, destTileX: integer, destTileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + function Copy(srcTileX: number, srcTileY: number, width: number, height: number, destTileX: number, destTileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; /** - * Destroys this DynamicTilemapLayer and removes its link to the associated LayerData. - * @param removeFromTilemap Remove this layer from the parent Tilemap? Default true. + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. scene.make.sprite). + * @param scene The Scene to create the Sprites within. + * @param camera The Camera to use when determining the world XY + * @param layer The Tilemap Layer to act upon. */ - destroy(removeFromTilemap?: boolean): void; + function CreateFromTiles(indexes: number | number[], replacements: number | number[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene: Phaser.Scene, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.GameObjects.Sprite[]; + + /** + * Returns the bounds in the given orthogonal layer that are within the cameras viewport. + * This is used internally by the cull tiles function. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + */ + function CullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): Phaser.Geom.Rectangle; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function CullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the * specified index. Tiles will be set to collide if the given index is a colliding index. * Collision information in the region will be recalculated. * @param index The tile index to fill the area with. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The tile layer to use. If not given the current layer is used. */ - fill(index: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + function Fill(index: number, tileX: number, tileY: number, width: number, height: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -78857,13 +88682,14 @@ declare namespace Phaser { * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. */ - filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + function FilterTiles(callback: Function, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; /** * Searches the entire map layer for the first tile matching the given index, then returns that Tile @@ -78872,11 +88698,11 @@ declare namespace Phaser { * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to * the top-left. * @param index The tile index value to search for. - * @param skip The number of times to skip a matching tile before returning. Default 0. - * @param reverse If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. Default false. + * @param skip The number of times to skip a matching tile before returning. + * @param reverse If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. + * @param layer The Tilemap Layer to act upon. */ - findByIndex(index: integer, skip?: integer, reverse?: boolean): Phaser.Tilemaps.Tile; + function FindByIndex(index: number, skip: number, reverse: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Find the first tile in the given rectangular area (in tile coordinates) of the layer that @@ -78884,62 +88710,74 @@ declare namespace Phaser { * true. Similar to Array.prototype.find in vanilla JS. * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. */ - findTile(callback: FindTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile; + function FindTile(callback: FindTileCallback, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given * callback. Similar to Array.prototype.forEach in vanilla JS. * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. */ - forEachTile(callback: EachTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.DynamicTilemapLayer; + function ForEachTile(callback: EachTileCallback, context: object, tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Gets the correct function to use to cull tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetCullTilesFunction(orientation: number): Function; /** * Gets a tile at the given tile coordinates from the given layer. * @param tileX X position to get the tile from (given in tile units, not pixels). * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. + * @param layer The Tilemap Layer to act upon. */ - getTileAt(tileX: integer, tileY: integer, nonNull?: boolean): Phaser.Tilemaps.Tile; + function GetTileAt(tileX: number, tileY: number, nonNull: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Gets a tile at the given world coordinates from the given layer. * @param worldX X position to get the tile from (given in pixels) * @param worldY Y position to get the tile from (given in pixels) - * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + function GetTileAtWorldXY(worldX: number, worldY: number, nonNull: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. + * @param layer The Tilemap Layer to act upon. */ - getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + function GetTilesWithin(tileX: number, tileY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, * Line, Rectangle or Triangle. The shape should be in world coordinates. * @param shape A shape in world (pixel) coordinates * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + function GetTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. @@ -78948,26 +88786,168 @@ declare namespace Phaser { * @param width The width of the area. * @param height The height of the area. * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param camera The Camera to use when factoring in which tiles to return. + * @param layer The Tilemap Layer to act upon. */ - getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + function GetTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions: Phaser.Types.Tilemaps.FilteringOptions, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile[]; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetTileToWorldXFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetTileToWorldXYFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetTileToWorldYFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetWorldToTileXFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetWorldToTileXYFunction(orientation: number): Function; + + /** + * Gets the correct function to use to translate tiles, based on the map orientation. + * @param orientation The Tilemap orientation constant. + */ + function GetWorldToTileYFunction(orientation: number): Function; /** * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param layer The Tilemap Layer to act upon. */ - hasTileAt(tileX: integer, tileY: integer): boolean; + function HasTileAt(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): boolean; /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. - * @param worldX The x coordinate, in pixels. - * @param worldY The y coordinate, in pixels. - * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param worldX The X coordinate of the world position. + * @param worldY The Y coordinate of the world position. + * @param camera The Camera to use when factoring in which tiles to return. + * @param layer The Tilemap Layer to act upon. */ - hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera): boolean; + function HasTileAtWorldXY(worldX: number, worldY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): boolean; + + /** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + */ + function HexagonalCullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): object; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function HexagonalCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; + + /** + * Converts from hexagonal tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from hexagonal tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalTileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Converts from world XY coordinates (pixels) to hexagonal tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinates down to the nearest integer. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from world Y coordinates (pixels) to hexagonal tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function HexagonalWorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Checks if the given tile coordinates are within the bounds of the layer. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param layer The Tilemap Layer to act upon. + */ + function IsInLayerBounds(tileX: number, tileY: number, layer: Phaser.Tilemaps.LayerData): boolean; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function IsometricCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; + + /** + * Converts from isometric tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function IsometricTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from world XY coordinates (pixels) to isometric tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function IsometricWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; /** * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index @@ -78977,9 +88957,10 @@ declare namespace Phaser { * @param tile The index of this tile to set or a Tile object. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. */ - putTileAt(tile: integer | Phaser.Tilemaps.Tile, tileX: integer, tileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + function PutTileAt(tile: number | Phaser.Tilemaps.Tile, tileX: number, tileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -78989,10 +88970,11 @@ declare namespace Phaser { * @param tile The index of this tile to set or a Tile object. * @param worldX The x coordinate, in pixels. * @param worldY The y coordinate, in pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - putTileAtWorldXY(tile: integer | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + function PutTileAtWorldXY(tile: number | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified @@ -79003,9 +88985,10 @@ declare namespace Phaser { * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. */ - putTilesAt(tile: integer[] | integer[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: integer, tileY: integer, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + function PutTilesAt(tile: number[] | number[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: number, tileY: number, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -79013,34 +88996,37 @@ declare namespace Phaser { * those will be used for randomly assigning new tile indexes. If an array is not provided, the * indexes found within the region (excluding -1) will be used for randomly assigning new tile * indexes. This method only modifies tile indexes and does not change collision information. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param indexes An array of indexes to randomly draw from during randomization. + * @param layer The Tilemap Layer to act upon. */ - randomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, indexes?: integer[]): Phaser.Tilemaps.DynamicTilemapLayer; + function Randomize(tileX: number, tileY: number, width: number, height: number, indexes: number[], layer: Phaser.Tilemaps.LayerData): void; /** * Removes the tile at the given tile coordinates in the specified layer and updates the layer's * collision information. - * @param tileX The x coordinate, in tiles, not pixels. - * @param tileY The y coordinate, in tiles, not pixels. - * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param layer The Tilemap Layer to act upon. */ - removeTileAt(tileX: integer, tileY: integer, replaceWithNull?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + function RemoveTileAt(tileX: number, tileY: number, replaceWithNull: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Removes the tile at the given world coordinates in the specified layer and updates the layer's * collision information. * @param worldX The x coordinate, in pixels. * @param worldY The y coordinate, in pixels. - * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + function RemoveTileAtWorldXY(worldX: number, worldY: number, replaceWithNull: boolean, recalculateFaces: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Tilemaps.Tile; /** * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to @@ -79049,8 +89035,9 @@ declare namespace Phaser { * wherever you want on the screen. * @param graphics The target Graphics object to draw upon. * @param styleConfig An object specifying the colors to use for the debug drawing. + * @param layer The Tilemap Layer to act upon. */ - renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig): Phaser.Tilemaps.DynamicTilemapLayer; + function RenderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.DebugStyleOptions, layer: Phaser.Tilemaps.LayerData): void; /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -79058,46 +89045,34 @@ declare namespace Phaser { * not change collision information. * @param findIndex The index of the tile to search for. * @param newIndex The index of the tile to replace it with. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. */ - replaceByIndex(findIndex: integer, newIndex: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + function ReplaceByIndex(findIndex: number, newIndex: number, tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; /** - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this. - * @param value Set to `true` to stop culling tiles. Set to `false` to enable culling again. Default true. + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param bounds An object containing the `left`, `right`, `top` and `bottom` bounds. + * @param renderOrder The rendering order constant. + * @param outputArray The array to store the Tile objects within. */ - setSkipCull(value?: boolean): this; - - /** - * When a Camera culls the tiles in this layer it does so using its view into the world, building up a - * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size - * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so - * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px - * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) - * @param paddingX The amount of extra horizontal tiles to add to the cull check padding. Default 1. - * @param paddingY The amount of extra vertical tiles to add to the cull check padding. Default 1. - */ - setCullPadding(paddingX?: integer, paddingY?: integer): this; + function RunCull(layer: Phaser.Tilemaps.LayerData, bounds: object, renderOrder: number, outputArray: any[]): Phaser.Tilemaps.Tile[]; /** * Sets collision on the given tile or tiles within a layer by index. You can pass in either a * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if * collision will be enabled (true) or disabled (false). - * - * If no layer specified, the map's current layer is used. * @param indexes Either a single tile index, or an array of tile indexes. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. - * @param updateLayer If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. */ - setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean, updateLayer?: boolean): Phaser.Tilemaps.Tilemap; + function SetCollision(indexes: number | any[], collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData, updateLayer?: boolean): void; /** * Sets collision on a range of tiles in a layer whose index is between the specified `start` and @@ -79106,10 +89081,23 @@ declare namespace Phaser { * enabled (true) or disabled (false). * @param start The first index of the tile to be set for collision. * @param stop The last index of the tile to be set for collision. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. */ - setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + function SetCollisionBetween(start: number, stop: number, collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData, updateLayer?: boolean): void; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). Tile indexes not currently in the layer are not affected. + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. + */ + function SetCollisionByExclusion(indexes: number[], collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; /** * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property @@ -79120,30 +89108,39 @@ declare namespace Phaser { * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a * "types" property that matches any of those values, its collision flag will be updated. * @param properties An object with tile properties and corresponding values that should be checked. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. */ - setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + function SetCollisionByProperty(properties: object, collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; /** - * Sets collision on all tiles in the given layer, except for tiles that have an index specified in - * the given array. The `collides` parameter controls if collision will be enabled (true) or - * disabled (false). Tile indexes not currently in the layer are not affected. - * @param indexes An array of the tile indexes to not be counted for collision. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. - */ - setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; - - /** - * Sets collision on the tiles within a layer by checking each tiles collision group data + * Sets collision on the tiles within a layer by checking each tile's collision group data * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * a tile's collision group, the tile's colliding information will be set. The `collides` parameter * controls if collision will be enabled (true) or disabled (false). - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. + * @param layer The Tilemap Layer to act upon. */ - setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.DynamicTilemapLayer; + function SetCollisionFromCollisionGroup(collides: boolean, recalculateFaces: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Internally used method to keep track of the tile indexes that collide within a layer. This + * updates LayerData.collideIndexes to either contain or not contain the given `tileIndex`. + * @param tileIndex The tile index to set the collision boolean for. + * @param collides Should the tile index collide or not? + * @param layer The Tilemap Layer to act upon. + */ + function SetLayerCollisionIndex(tileIndex: number, collides: boolean, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Internally used method to set the colliding state of a tile. This does not recalculate + * interesting faces. + * @param tile The Tile to set the collision on. + * @param collides Should the tile index collide or not? Default true. + */ + function SetTileCollision(tile: Phaser.Tilemaps.Tile, collides?: boolean): void; /** * Sets a global collision callback for the given tile index within the layer. This will affect all @@ -79153,33 +89150,97 @@ declare namespace Phaser { * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. * @param callback The callback that will be invoked when the tile is collided with. * @param callbackContext The context under which the callback is called. + * @param layer The Tilemap Layer to act upon. */ - setTileIndexCallback(indexes: integer | integer[], callback: Function, callbackContext: object): Phaser.Tilemaps.DynamicTilemapLayer; + function SetTileIndexCallback(indexes: number | any[], callback: Function, callbackContext: object, layer: Phaser.Tilemaps.LayerData): void; /** * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. * If a callback is already set for the tile index it will be replaced. Set the callback to null to * remove it. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param callback The callback that will be invoked when the tile is collided with. * @param callbackContext The context under which the callback is called. + * @param layer The Tilemap Layer to act upon. */ - setTileLocationCallback(tileX?: integer, tileY?: integer, width?: integer, height?: integer, callback?: Function, callbackContext?: object): Phaser.Tilemaps.DynamicTilemapLayer; + function SetTileLocationCallback(tileX: number, tileY: number, width: number, height: number, callback: Function, callbackContext: object, layer: Phaser.Tilemaps.LayerData): void; /** * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given * layer. It will only randomize the tiles in that area, so if they're all the same nothing will * appear to have changed! This method only modifies tile indexes and does not change collision * information. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. */ - shuffle(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + function Shuffle(tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; + + /** + * Returns the bounds in the given layer that are within the camera's viewport. + * This is used internally by the cull tiles function. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + */ + function StaggeredCullBounds(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera): object; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. This is used internally. + * @param layer The Tilemap Layer to act upon. + * @param camera The Camera to run the cull check against. + * @param outputArray An optional array to store the Tile objects within. + * @param renderOrder The rendering order constant. Default 0. + */ + function StaggeredCullTiles(layer: Phaser.Tilemaps.LayerData, camera: Phaser.Cameras.Scene2D.Camera, outputArray?: any[], renderOrder?: number): Phaser.Tilemaps.Tile[]; + + /** + * Converts from staggered tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredTileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from staggered tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredTileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; + + /** + * Converts from world XY coordinates (pixels) to staggered tile XY coordinates (tile units), factoring in the + * layer's position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredWorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from world Y coordinates (pixels) to staggered tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function StaggeredWorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching @@ -79187,39 +89248,43 @@ declare namespace Phaser { * information. * @param tileA First tile index. * @param tileB Second tile index. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The Tilemap Layer to act upon. */ - swapByIndex(tileA: integer, tileB: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + function SwapByIndex(tileA: number, tileB: number, tileX: number, tileY: number, width: number, height: number, layer: Phaser.Tilemaps.LayerData): void; /** * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layers position, scale and scroll. + * layer's position, scale and scroll. * @param tileX The x coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; - - /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layers position, scale and scroll. - * @param tileY The y coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - */ - tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; + function TileToWorldX(tileX: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; /** * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given + * layer's position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + function TileToWorldXY(tileX: number, tileY: number, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layer's position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. + */ + function TileToWorldY(tileY: number, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -79235,692 +89300,86 @@ declare namespace Phaser { * * The probability of any index being choose is (the index's weight) / (sum of all weights). This * method only modifies tile indexes and does not change collision information. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param weightedIndexes An array of objects to randomly draw from during * randomization. They should be in the form: { index: 0, weight: 4 } or * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param layer The Tilemap Layer to act upon. */ - weightedRandomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, weightedIndexes?: object[]): Phaser.Tilemaps.DynamicTilemapLayer; + function WeightedRandomize(tileX: number, tileY: number, width: number, height: number, weightedIndexes: object[], layer: Phaser.Tilemaps.LayerData): void; /** * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layers position, scale and scroll. + * layer's position, scale and scroll. * @param worldX The x coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; - - /** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - */ - worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; + function WorldToTileX(worldX: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; /** * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given + * layer's position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * @param worldX The x coordinate to be converted, in pixels, not tiles. * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + function WorldToTileXY(worldX: number, worldY: number, snapToFloor: boolean, point: Phaser.Math.Vector2, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): Phaser.Math.Vector2; /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layer's position, scale and scroll. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The Tilemap Layer to act upon. */ - clearAlpha(): this; - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * If your game is running under WebGL you can optionally specify four different alpha values, each of which - * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. - * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. - * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. - * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. - * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. - */ - setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - */ - alpha: number; - - /** - * The alpha value starting from the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaTopLeft: number; - - /** - * The alpha value starting from the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaTopRight: number; - - /** - * The alpha value starting from the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaBottomLeft: number; - - /** - * The alpha value starting from the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaBottomRight: number; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency of which blend modes - * are used. - */ - blendMode: Phaser.BlendModes | string; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency in which blend modes - * are used. - * @param value The BlendMode value. Either a string or a CONST. - */ - setBlendMode(value: string | Phaser.BlendModes): this; - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. - */ - setDepth(value: integer): this; - - /** - * The horizontally flipped state of the Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - */ - flipX: boolean; - - /** - * The vertically flipped state of the Game Object. - * - * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - */ - flipY: boolean; - - /** - * Toggles the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - */ - toggleFlipX(): this; - - /** - * Toggles the vertical flipped state of this Game Object. - */ - toggleFlipY(): this; - - /** - * Sets the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * @param value The flipped state. `false` for no flip, or `true` to be flipped. - */ - setFlipX(value: boolean): this; - - /** - * Sets the vertical flipped state of this Game Object. - * @param value The flipped state. `false` for no flip, or `true` to be flipped. - */ - setFlipY(value: boolean): this; - - /** - * Sets the horizontal and vertical flipped state of this Game Object. - * - * A Game Object that is flipped will render inversed on the flipped axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. - */ - setFlip(x: boolean, y: boolean): this; - - /** - * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - */ - resetFlip(): this; - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - */ - getCenter(output?: O): O; - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getLeftCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getRightCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the bounds of this Game Object, regardless of origin. - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * @param output An object to store the values in. If not provided a new Rectangle will be created. - */ - getBounds(output?: O): O; - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - */ - originX: number; - - /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. - */ - originY: number; - - /** - * The horizontal display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginX: number; - - /** - * The vertical display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginY: number; - - /** - * Sets the origin of this Game Object. - * - * The values are given in the range 0 to 1. - * @param x The horizontal origin value. Default 0.5. - * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. - */ - setOrigin(x?: number, y?: number): this; - - /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. - */ - setOriginFromFrame(): this; - - /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. - * @param x The horizontal display origin value. Default 0. - * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. - */ - setDisplayOrigin(x?: number, y?: number): this; - - /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may. - */ - updateDisplayOrigin(): this; - - /** - * The initial WebGL pipeline of this Game Object. - */ - defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * The current WebGL pipeline of this Game Object. - */ - pipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. - */ - initPipeline(pipelineName?: string): boolean; - - /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. - */ - setPipeline(pipelineName: string): this; - - /** - * Resets the WebGL Pipeline of this Game Object back to the default it was created with. - */ - resetPipeline(): boolean; - - /** - * Gets the name of the WebGL Pipeline this Game Object is currently using. - */ - getPipelineName(): string; - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorX: number; - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorY: number; - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * @param x The horizontal scroll factor of this Game Object. - * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. - */ - setScrollFactor(x: number, y?: number): this; - - /** - * The x position of this Game Object. - */ - x: number; - - /** - * The y position of this Game Object. - */ - y: number; - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - */ - z: number; - - /** - * The w position of this Game Object. - */ - w: number; - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - */ - scale: number; - - /** - * The horizontal scale of this Game Object. - */ - scaleX: number; - - /** - * The vertical scale of this Game Object. - */ - scaleY: number; - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - */ - angle: integer; - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - */ - rotation: number; - - /** - * Sets the position of this Game Object. - * @param x The x position of this Game Object. Default 0. - * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. - * @param z The z position of this Game Object. Default 0. - * @param w The w position of this Game Object. Default 0. - */ - setPosition(x?: number, y?: number, z?: number, w?: number): this; - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * @param x The x position of the top-left of the random area. Default 0. - * @param y The y position of the top-left of the random area. Default 0. - * @param width The width of the random area. - * @param height The height of the random area. - */ - setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; - - /** - * Sets the rotation of this Game Object. - * @param radians The rotation of this Game Object, in radians. Default 0. - */ - setRotation(radians?: number): this; - - /** - * Sets the angle of this Game Object. - * @param degrees The rotation of this Game Object, in degrees. Default 0. - */ - setAngle(degrees?: number): this; - - /** - * Sets the scale of this Game Object. - * @param x The horizontal scale of this Game Object. - * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. - */ - setScale(x: number, y?: number): this; - - /** - * Sets the x position of this Game Object. - * @param value The x position of this Game Object. Default 0. - */ - setX(value?: number): this; - - /** - * Sets the y position of this Game Object. - * @param value The y position of this Game Object. Default 0. - */ - setY(value?: number): this; - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * @param value The z position of this Game Object. Default 0. - */ - setZ(value?: number): this; - - /** - * Sets the w position of this Game Object. - * @param value The w position of this Game Object. Default 0. - */ - setW(value?: number): this; - - /** - * Gets the local transform matrix for this Game Object. - * @param tempMatrix The matrix to populate with the values from this Game Object. - */ - getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * @param tempMatrix The matrix to populate with the values from this Game Object. - * @param parentMatrix A temporary matrix to hold parent values during the calculations. - */ - getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - */ - getParentRotation(): number; - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - */ - setVisible(value: boolean): this; + function WorldToTileY(worldY: number, snapToFloor: boolean, camera: Phaser.Cameras.Scene2D.Camera, layer: Phaser.Tilemaps.LayerData): number; } + /** + * Phaser Tilemap constants for orientation. + */ + enum Orientation { + /** + * Get the Tilemap orientation from the given string. + * @param orientation The orientation type as a string. + */ + FromOrientationString, + /** + * Orthogonal Tilemap orientation constant. + */ + ORTHOGONAL, + /** + * Isometric Tilemap orientation constant. + */ + ISOMETRIC, + /** + * Staggered Tilemap orientation constant. + */ + STAGGERED, + /** + * Hexagonal Tilemap orientation constant. + */ + HEXAGONAL, + } + + /** + * Phaser Tilemap constants for orientation. + * + * To find out what each mode does please see [Phaser.Tilemaps.Orientation]{@link Phaser.Tilemaps.Orientation}. + */ + type OrientationType = Phaser.Tilemaps.Orientation; + namespace Formats { /** * CSV Map Type @@ -79960,7 +89419,7 @@ declare namespace Phaser { * @param spacing The spacing between each image in the collection (in pixels). Default 0. * @param properties Custom Image Collection properties. Default {}. */ - constructor(name: string, firstgid: integer, width?: integer, height?: integer, margin?: integer, spacing?: integer, properties?: object); + constructor(name: string, firstgid: number, width?: number, height?: number, margin?: number, spacing?: number, properties?: object); /** * The name of the Image Collection. @@ -79971,29 +89430,29 @@ declare namespace Phaser { * The Tiled firstgid value. * This is the starting index of the first image index this Image Collection contains. */ - firstgid: integer; + firstgid: number; /** * The width of the widest image (in pixels). */ - readonly imageWidth: integer; + readonly imageWidth: number; /** * The height of the tallest image (in pixels). */ - readonly imageHeight: integer; + readonly imageHeight: number; /** * The margin around the images in the collection (in pixels). * Use `setSpacing` to change. */ - readonly imageMarge: integer; + readonly imageMarge: number; /** * The spacing between each image in the collection (in pixels). * Use `setSpacing` to change. */ - readonly imageSpacing: integer; + readonly imageSpacing: number; /** * Image Collection-specific properties that are typically defined in the Tiled editor. @@ -80008,26 +89467,26 @@ declare namespace Phaser { /** * The total number of images in the image collection. */ - readonly total: integer; + readonly total: number; /** * Returns true if and only if this image collection contains the given image index. * @param imageIndex The image index to search for. */ - containsImageIndex(imageIndex: integer): boolean; + containsImageIndex(imageIndex: number): boolean; /** * Add an image to this Image Collection. * @param gid The gid of the image in the Image Collection. * @param image The the key of the image in the Image Collection and in the cache. */ - addImage(gid: integer, image: string): Phaser.Tilemaps.ImageCollection; + addImage(gid: number, image: string): Phaser.Tilemaps.ImageCollection; } /** * A class for representing data about about a layer in a map. Maps are parsed from CSV, Tiled, - * etc. into this format. Tilemap, StaticTilemapLayer and DynamicTilemapLayer have a reference + * etc. into this format. Tilemap and TilemapLayer objects have a reference * to this data and use it to look up and perform operations on tiles. */ class LayerData { @@ -80082,6 +89541,11 @@ declare namespace Phaser { */ baseTileHeight: number; + /** + * The layers orientation, necessary to be able to determine a tiles pixelX and pixelY as well as the layers width and height. + */ + orientation: Phaser.Tilemaps.OrientationType; + /** * The width in pixels of the entire layer. */ @@ -80135,7 +89599,13 @@ declare namespace Phaser { /** * A reference to the Tilemap layer that owns this data. */ - tilemapLayer: Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer; + tilemapLayer: Phaser.Tilemaps.TilemapLayer; + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + */ + hexSideLength: number; } @@ -80194,12 +89664,12 @@ declare namespace Phaser { /** * The format of the map data. */ - format: integer; + format: number; /** * The orientation of the map data (i.e. orthogonal, isometric, hexagonal), default 'orthogonal'. */ - orientation: string; + orientation: Phaser.Tilemaps.OrientationType; /** * Determines the draw order of tilemap. Default is right-down @@ -80256,6 +89726,12 @@ declare namespace Phaser { */ tiles: any[]; + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + */ + hexSideLength: number; + } /** @@ -80376,7 +89852,7 @@ declare namespace Phaser { * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. */ - function Parse(name: string, mapFormat: integer, data: integer[][] | string | object, tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + function Parse(name: string, mapFormat: number, data: number[][] | string | object, tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; /** * Parses a 2D array of tile indexes into a new MapData object with a single layer. @@ -80391,7 +89867,7 @@ declare namespace Phaser { * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. */ - function Parse2DArray(name: string, data: integer[][], tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + function Parse2DArray(name: string, data: number[][], tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; /** * Parses a CSV string of tile indexes into a new MapData object with a single layer. @@ -80406,7 +89882,7 @@ declare namespace Phaser { * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. */ - function ParseCSV(name: string, data: string, tileWidth: integer, tileHeight: integer, insertNull: boolean): Phaser.Tilemaps.MapData; + function ParseCSV(name: string, data: string, tileWidth: number, tileHeight: number, insertNull: boolean): Phaser.Tilemaps.MapData; namespace Tiled { /** @@ -80513,1164 +89989,7 @@ declare namespace Phaser { * consumption. However if your map is small or you need to update the tiles dynamically, then leave * the default value set. Default false. */ - function ParseToTilemap(scene: Phaser.Scene, key?: string, tileWidth?: integer, tileHeight?: integer, width?: integer, height?: integer, data?: integer[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; - - /** - * A Static Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination - * with one, or more, Tilesets. - * - * A Static Tilemap Layer is optimized for rendering speed over flexibility. You cannot apply per-tile - * effects like tint or alpha, or change the tiles or tilesets the layer uses. - * - * Use a Static Tilemap Layer instead of a Dynamic Tilemap Layer when you don't need tile manipulation features. - */ - class StaticTilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible, Phaser.GameObjects.Components.ScrollFactor { - /** - * - * @param scene The Scene to which this Game Object belongs. - * @param tilemap The Tilemap this layer is a part of. - * @param layerIndex The index of the LayerData associated with this layer. - * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param x The world x position where the top left of this layer will be placed. Default 0. - * @param y The world y position where the top left of this layer will be placed. Default 0. - */ - constructor(scene: Phaser.Scene, tilemap: Phaser.Tilemaps.Tilemap, layerIndex: integer, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number); - - /** - * Used internally by physics system to perform fast type checks. - */ - readonly isTilemap: boolean; - - /** - * The Tilemap that this layer is a part of. - */ - tilemap: Phaser.Tilemaps.Tilemap; - - /** - * The index of the LayerData associated with this layer. - */ - layerIndex: integer; - - /** - * The LayerData associated with this layer. LayerData can only be associated with one - * tilemap layer. - */ - layer: Phaser.Tilemaps.LayerData; - - /** - * The Tileset/s associated with this layer. - * - * As of Phaser 3.14 this property is now an array of Tileset objects, previously it was a single reference. - */ - tileset: Phaser.Tilemaps.Tileset[]; - - /** - * Used internally by the Canvas renderer. - * This holds the tiles that are visible within the camera in the last frame. - */ - culledTiles: any[]; - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this, and toggling this flag allows - * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. - */ - skipCull: boolean; - - /** - * Canvas only. - * - * The total number of tiles drawn by the renderer in the last frame. - * - * This only works when rending with Canvas. - */ - readonly tilesDrawn: integer; - - /** - * Canvas only. - * - * The total number of tiles in this layer. Updated every frame. - */ - readonly tilesTotal: integer; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. - * - * See the method `setCullPadding` for more details. - */ - cullPaddingX: integer; - - /** - * Canvas only. - * - * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. - * - * See the method `setCullPadding` for more details. - */ - cullPaddingY: integer; - - /** - * Canvas only. - * - * The callback that is invoked when the tiles are culled. - * - * By default it will call `TilemapComponents.CullTiles` but you can override this to call any function you like. - * - * It will be sent 3 arguments: - * - * 1. The Phaser.Tilemaps.LayerData object for this Layer - * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. - * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. - * - * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. - */ - cullCallback: Function; - - /** - * An array holding the mapping between the tile indexes and the tileset they belong to. - */ - gidMap: Phaser.Tilemaps.Tileset[]; - - /** - * Upload the tile data to a VBO. - * @param camera The camera to render to. - * @param tilesetIndex The tileset index. - */ - upload(camera: Phaser.Cameras.Scene2D.Camera, tilesetIndex: integer): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets the rendering (draw) order of the tiles in this layer. - * - * The default is 'right-down', meaning it will order the tiles starting from the top-left, - * drawing to the right and then moving down to the next row. - * - * The draw orders are: - * - * 0 = right-down - * 1 = left-down - * 2 = right-up - * 3 = left-up - * - * Setting the render order does not change the tiles or how they are stored in the layer, - * it purely impacts the order in which they are rendered. - * - * You can provide either an integer (0 to 3), or the string version of the order. - * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. - */ - setRenderOrder(renderOrder: integer | string): this; - - /** - * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting - * faces are used internally for optimizing collisions against tiles. This method is mostly used - * internally to optimize recalculating faces when only one tile has been changed. - * @param tileX The x coordinate. - * @param tileY The y coordinate. - */ - calculateFacesAt(tileX: integer, tileY: integer): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the - * layer. Interesting faces are used internally for optimizing collisions against tiles. This method - * is mostly used internally. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. - */ - calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Creates a Sprite for every object matching the given tile indexes in the layer. You can - * optionally specify if each tile will be replaced with a new tile after the Sprite has been - * created. This is useful if you want to lay down special tiles in a level that are converted to - * Sprites, but want to replace the tile itself with a floor tile or similar once converted. - * @param indexes The tile index, or array of indexes, to create Sprites from. - * @param replacements The tile index, or array of indexes, to change a converted - * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a - * one-to-one mapping with the indexes array. - * @param spriteConfig The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param scene The Scene to create the Sprites within. Default scene the map is within. - * @param camera The Camera to use when determining the world XY Default main camera. - */ - createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Sprite[]; - - /** - * Returns the tiles in the given layer that are within the cameras viewport. - * This is used internally. - * @param camera The Camera to run the cull check against. - */ - cull(camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; - - /** - * Canvas only. - * - * You can control if the Cameras should cull tiles before rendering them or not. - * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. - * - * However, there are some instances when you may wish to disable this. - * @param value Set to `true` to stop culling tiles. Set to `false` to enable culling again. Default true. - */ - setSkipCull(value?: boolean): this; - - /** - * Canvas only. - * - * When a Camera culls the tiles in this layer it does so using its view into the world, building up a - * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size - * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so - * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px - * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) - * @param paddingX The amount of extra horizontal tiles to add to the cull check padding. Default 1. - * @param paddingY The amount of extra vertical tiles to add to the cull check padding. Default 1. - */ - setCullPadding(paddingX?: integer, paddingY?: integer): this; - - /** - * Searches the entire map layer for the first tile matching the given index, then returns that Tile - * object. If no match is found, it returns null. The search starts from the top-left tile and - * continues horizontally until it hits the end of the row, then it drops down to the next column. - * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to - * the top-left. - * @param index The tile index value to search for. - * @param skip The number of times to skip a matching tile before returning. Default 0. - * @param reverse If true it will scan the layer in reverse, starting at the - * bottom-right. Otherwise it scans from the top-left. Default false. - */ - findByIndex(index: integer, skip?: integer, reverse?: boolean): Phaser.Tilemaps.Tile; - - /** - * Find the first tile in the given rectangular area (in tile coordinates) of the layer that - * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns - * true. Similar to Array.prototype.find in vanilla JS. - * @param callback The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. - * @param filteringOptions Optional filters to apply when getting the tiles. - */ - findTile(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile; - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns - * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. - * @param callback The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. The callback should return true for tiles that pass the - * filter. - * @param context The context under which the callback should be run. - * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. - * @param filteringOptions Optional filters to apply when getting the tiles. - */ - filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; - - /** - * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given - * callback. Similar to Array.prototype.forEach in vanilla JS. - * @param callback The callback. Each tile in the given area will be passed to this - * callback as the first and only parameter. - * @param context The context under which the callback should be run. - * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. - * @param filteringOptions Optional filters to apply when getting the tiles. - */ - forEachTile(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Gets a tile at the given tile coordinates from the given layer. - * @param tileX X position to get the tile from (given in tile units, not pixels). - * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param nonNull If true getTile won't return null for empty tiles, but a Tile - * object with an index of -1. Default false. - */ - getTileAt(tileX: integer, tileY: integer, nonNull?: boolean): Phaser.Tilemaps.Tile; - - /** - * Gets a tile at the given world coordinates from the given layer. - * @param worldX X position to get the tile from (given in pixels) - * @param worldY Y position to get the tile from (given in pixels) - * @param nonNull If true, function won't return null for empty tiles, but a Tile - * object with an index of -1. Default false. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - */ - getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; - - /** - * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. - * @param filteringOptions Optional filters to apply when getting the tiles. - */ - getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; - - /** - * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * @param worldX The leftmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param worldY The topmost tile index (in tile coordinates) to use as the origin of the area to filter. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles high from the `tileY` index the area will be. - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when factoring in which tiles to return. Default main camera. - */ - getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; - - /** - * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, - * Line, Rectangle or Triangle. The shape should be in world coordinates. - * @param shape A shape in world (pixel) coordinates - * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - */ - getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; - - /** - * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * @param tileX X position to get the tile from in tile coordinates. - * @param tileY Y position to get the tile from in tile coordinates. - */ - hasTileAt(tileX: integer, tileY: integer): boolean; - - /** - * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns - * false if there is no tile or if the tile at that location has an index of -1. - * @param worldX The X coordinate of the world position. - * @param worldY The Y coordinate of the world position. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - */ - hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera): boolean; - - /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to - * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles - * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation - * wherever you want on the screen. - * @param graphics The target Graphics object to draw upon. - * @param styleConfig An object specifying the colors to use for the debug drawing. - */ - renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets collision on the given tile or tiles within a layer by index. You can pass in either a - * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if - * collision will be enabled (true) or disabled (false). - * @param indexes Either a single tile index, or an array of tile indexes. - * @param collides If true it will enable collision. If false it will clear - * collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the - * update. Default true. - * @param updateLayer If true, updates the current tiles on the layer. Set to - * false if no tiles have been placed for significant performance boost. Default true. - */ - setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean, updateLayer?: boolean): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets collision on a range of tiles in a layer whose index is between the specified `start` and - * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set - * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be - * enabled (true) or disabled (false). - * @param start The first index of the tile to be set for collision. - * @param stop The last index of the tile to be set for collision. - * @param collides If true it will enable collision. If false it will clear - * collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the - * update. Default true. - */ - setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property - * that matches the given properties object, its collision flag will be set. The `collides` - * parameter controls if collision will be enabled (true) or disabled (false). Passing in - * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that - * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can - * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a - * "types" property that matches any of those values, its collision flag will be updated. - * @param properties An object with tile properties and corresponding values that should - * be checked. - * @param collides If true it will enable collision. If false it will clear - * collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the - * update. Default true. - */ - setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets collision on all tiles in the given layer, except for tiles that have an index specified in - * the given array. The `collides` parameter controls if collision will be enabled (true) or - * disabled (false). Tile indexes not currently in the layer are not affected. - * @param indexes An array of the tile indexes to not be counted for collision. - * @param collides If true it will enable collision. If false it will clear - * collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the - * update. Default true. - */ - setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets a global collision callback for the given tile index within the layer. This will affect all - * tiles on this layer that have the same index. If a callback is already set for the tile index it - * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. - * @param indexes Either a single tile index, or an array of tile indexes to have a - * collision callback set for. - * @param callback The callback that will be invoked when the tile is collided with. - * @param callbackContext The context under which the callback is called. - */ - setTileIndexCallback(indexes: integer | any[], callback: Function, callbackContext: object): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets collision on the tiles within a layer by checking each tiles collision group data - * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tiles collision group, the tile's colliding information will be set. The `collides` parameter - * controls if collision will be enabled (true) or disabled (false). - * @param collides If true it will enable collision. If false it will clear - * collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the - * update. Default true. - */ - setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. - * If a callback is already set for the tile index it will be replaced. Set the callback to null to - * remove it. - * @param tileX The leftmost tile index (in tile coordinates) to use as the origin of the area. - * @param tileY The topmost tile index (in tile coordinates) to use as the origin of the area. - * @param width How many tiles wide from the `tileX` index the area will be. - * @param height How many tiles tall from the `tileY` index the area will be. - * @param callback The callback that will be invoked when the tile is collided with. - * @param callbackContext The context under which the callback is called. - */ - setTileLocationCallback(tileX: integer, tileY: integer, width: integer, height: integer, callback: Function, callbackContext?: object): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the - * layers position, scale and scroll. - * @param tileX The X coordinate, in tile coordinates. - * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. - */ - tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; - - /** - * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the - * layers position, scale and scroll. - * @param tileY The Y coordinate, in tile coordinates. - * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. - */ - tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera): number; - - /** - * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param tileX The X coordinate, in tile coordinates. - * @param tileY The Y coordinate, in tile coordinates. - * @param point A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param camera The Camera to use when calculating the world values from the tile index. Default main camera. - */ - tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; - - /** - * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the - * layers position, scale and scroll. - * @param worldX The X coordinate, in world pixels. - * @param snapToFloor Whether or not to round the tile coordinate down to the - * nearest integer. Default true. - * @param camera The Camera to use when calculating the tile index from the world values.] Default main camera. - */ - worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; - - /** - * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the - * layers position, scale and scroll. - * @param worldY The Y coordinate, in world pixels. - * @param snapToFloor Whether or not to round the tile coordinate down to the - * nearest integer. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - */ - worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; - - /** - * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the - * layers position, scale and scroll. This will return a new Vector2 object or update the given - * `point` object. - * @param worldX The X coordinate, in world pixels. - * @param worldY The Y coordinate, in world pixels. - * @param snapToFloor Whether or not to round the tile coordinate down to the - * nearest integer. Default true. - * @param point A Vector2 to store the coordinates in. If not given, a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - */ - worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; - - /** - * Destroys this StaticTilemapLayer and removes its link to the associated LayerData. - * @param removeFromTilemap Remove this layer from the parent Tilemap? Default true. - */ - destroy(removeFromTilemap?: boolean): void; - - /** - * Clears all alpha values associated with this Game Object. - * - * Immediately sets the alpha levels back to 1 (fully opaque). - */ - clearAlpha(): this; - - /** - * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. - * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. - * - * If your game is running under WebGL you can optionally specify four different alpha values, each of which - * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. - * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. - * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. - * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. - * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. - */ - setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; - - /** - * The alpha value of the Game Object. - * - * This is a global value, impacting the entire Game Object, not just a region of it. - */ - alpha: number; - - /** - * The alpha value starting from the top-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaTopLeft: number; - - /** - * The alpha value starting from the top-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaTopRight: number; - - /** - * The alpha value starting from the bottom-left of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaBottomLeft: number; - - /** - * The alpha value starting from the bottom-right of the Game Object. - * This value is interpolated from the corner to the center of the Game Object. - */ - alphaBottomRight: number; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency of which blend modes - * are used. - */ - blendMode: Phaser.BlendModes | string; - - /** - * Sets the Blend Mode being used by this Game Object. - * - * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) - * - * Under WebGL only the following Blend Modes are available: - * - * * ADD - * * MULTIPLY - * * SCREEN - * * ERASE (only works when rendering to a framebuffer, like a Render Texture) - * - * Canvas has more available depending on browser support. - * - * You can also create your own custom Blend Modes in WebGL. - * - * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending - * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these - * reasons try to be careful about the construction of your Scene and the frequency in which blend modes - * are used. - * @param value The BlendMode value. Either a string or a CONST. - */ - setBlendMode(value: string | Phaser.BlendModes): this; - - /** - * The native (un-scaled) width of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayWidth` property. - */ - width: number; - - /** - * The native (un-scaled) height of this Game Object. - * - * Changing this value will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or use - * the `displayHeight` property. - */ - height: number; - - /** - * The displayed width of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayWidth: number; - - /** - * The displayed height of this Game Object. - * - * This value takes into account the scale factor. - * - * Setting this value will adjust the Game Object's scale property. - */ - displayHeight: number; - - /** - * Sets the internal size of this Game Object, as used for frame or physics body creation. - * - * This will not change the size that the Game Object is rendered in-game. - * For that you need to either set the scale of the Game Object (`setScale`) or call the - * `setDisplaySize` method, which is the same thing as changing the scale but allows you - * to do so by giving pixel values. - * - * If you have enabled this Game Object for input, changing the size will _not_ change the - * size of the hit area. To do this you should adjust the `input.hitArea` object directly. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setSize(width: number, height: number): this; - - /** - * Sets the display size of this Game Object. - * - * Calling this will adjust the scale. - * @param width The width of this Game Object. - * @param height The height of this Game Object. - */ - setDisplaySize(width: number, height: number): this; - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - */ - depth: number; - - /** - * The depth of this Game Object within the Scene. - * - * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order - * of Game Objects, without actually moving their position in the display list. - * - * The default depth is zero. A Game Object with a higher depth - * value will always render in front of one with a lower value. - * - * Setting the depth will queue a depth sort event within the Scene. - * @param value The depth of this Game Object. - */ - setDepth(value: integer): this; - - /** - * The horizontally flipped state of the Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - */ - flipX: boolean; - - /** - * The vertically flipped state of the Game Object. - * - * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - */ - flipY: boolean; - - /** - * Toggles the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - */ - toggleFlipX(): this; - - /** - * Toggles the vertical flipped state of this Game Object. - */ - toggleFlipY(): this; - - /** - * Sets the horizontal flipped state of this Game Object. - * - * A Game Object that is flipped horizontally will render inversed on the horizontal axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * @param value The flipped state. `false` for no flip, or `true` to be flipped. - */ - setFlipX(value: boolean): this; - - /** - * Sets the vertical flipped state of this Game Object. - * @param value The flipped state. `false` for no flip, or `true` to be flipped. - */ - setFlipY(value: boolean): this; - - /** - * Sets the horizontal and vertical flipped state of this Game Object. - * - * A Game Object that is flipped will render inversed on the flipped axis. - * Flipping always takes place from the middle of the texture and does not impact the scale value. - * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. - * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. - * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. - */ - setFlip(x: boolean, y: boolean): this; - - /** - * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. - */ - resetFlip(): this; - - /** - * Gets the center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - */ - getCenter(output?: O): O; - - /** - * Gets the top-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the top-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getTopRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the left-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getLeftCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the right-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getRightCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomLeft(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-center coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomCenter(output?: O, includeParent?: boolean): O; - - /** - * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. - * The returned point is calculated in local space and does not factor in any parent containers - * @param output An object to store the values in. If not provided a new Vector2 will be created. - * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. - */ - getBottomRight(output?: O, includeParent?: boolean): O; - - /** - * Gets the bounds of this Game Object, regardless of origin. - * The values are stored and returned in a Rectangle, or Rectangle-like, object. - * @param output An object to store the values in. If not provided a new Rectangle will be created. - */ - getBounds(output?: O): O; - - /** - * The horizontal origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the left of the Game Object. - */ - originX: number; - - /** - * The vertical origin of this Game Object. - * The origin maps the relationship between the size and position of the Game Object. - * The default value is 0.5, meaning all Game Objects are positioned based on their center. - * Setting the value to 0 means the position now relates to the top of the Game Object. - */ - originY: number; - - /** - * The horizontal display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginX: number; - - /** - * The vertical display origin of this Game Object. - * The origin is a normalized value between 0 and 1. - * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. - */ - displayOriginY: number; - - /** - * Sets the origin of this Game Object. - * - * The values are given in the range 0 to 1. - * @param x The horizontal origin value. Default 0.5. - * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. - */ - setOrigin(x?: number, y?: number): this; - - /** - * Sets the origin of this Game Object based on the Pivot values in its Frame. - */ - setOriginFromFrame(): this; - - /** - * Sets the display origin of this Game Object. - * The difference between this and setting the origin is that you can use pixel values for setting the display origin. - * @param x The horizontal display origin value. Default 0. - * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. - */ - setDisplayOrigin(x?: number, y?: number): this; - - /** - * Updates the Display Origin cached values internally stored on this Game Object. - * You don't usually call this directly, but it is exposed for edge-cases where you may. - */ - updateDisplayOrigin(): this; - - /** - * The initial WebGL pipeline of this Game Object. - */ - defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * The current WebGL pipeline of this Game Object. - */ - pipeline: Phaser.Renderer.WebGL.WebGLPipeline; - - /** - * Sets the initial WebGL Pipeline of this Game Object. - * This should only be called during the instantiation of the Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. Defaults to the Texture Tint Pipeline. Default TextureTintPipeline. - */ - initPipeline(pipelineName?: string): boolean; - - /** - * Sets the active WebGL Pipeline of this Game Object. - * @param pipelineName The name of the pipeline to set on this Game Object. - */ - setPipeline(pipelineName: string): this; - - /** - * Resets the WebGL Pipeline of this Game Object back to the default it was created with. - */ - resetPipeline(): boolean; - - /** - * Gets the name of the WebGL Pipeline this Game Object is currently using. - */ - getPipelineName(): string; - - /** - * The x position of this Game Object. - */ - x: number; - - /** - * The y position of this Game Object. - */ - y: number; - - /** - * The z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#depth} instead. - */ - z: number; - - /** - * The w position of this Game Object. - */ - w: number; - - /** - * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object - * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. - * - * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this - * isn't the case, use the `scaleX` or `scaleY` properties instead. - */ - scale: number; - - /** - * The horizontal scale of this Game Object. - */ - scaleX: number; - - /** - * The vertical scale of this Game Object. - */ - scaleY: number; - - /** - * The angle of this Game Object as expressed in degrees. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left - * and -90 is up. - * - * If you prefer to work in radians, see the `rotation` property instead. - */ - angle: integer; - - /** - * The angle of this Game Object in radians. - * - * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left - * and -PI/2 is up. - * - * If you prefer to work in degrees, see the `angle` property instead. - */ - rotation: number; - - /** - * Sets the position of this Game Object. - * @param x The x position of this Game Object. Default 0. - * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. - * @param z The z position of this Game Object. Default 0. - * @param w The w position of this Game Object. Default 0. - */ - setPosition(x?: number, y?: number, z?: number, w?: number): this; - - /** - * Sets the position of this Game Object to be a random position within the confines of - * the given area. - * - * If no area is specified a random position between 0 x 0 and the game width x height is used instead. - * - * The position does not factor in the size of this Game Object, meaning that only the origin is - * guaranteed to be within the area. - * @param x The x position of the top-left of the random area. Default 0. - * @param y The y position of the top-left of the random area. Default 0. - * @param width The width of the random area. - * @param height The height of the random area. - */ - setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; - - /** - * Sets the rotation of this Game Object. - * @param radians The rotation of this Game Object, in radians. Default 0. - */ - setRotation(radians?: number): this; - - /** - * Sets the angle of this Game Object. - * @param degrees The rotation of this Game Object, in degrees. Default 0. - */ - setAngle(degrees?: number): this; - - /** - * Sets the scale of this Game Object. - * @param x The horizontal scale of this Game Object. - * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. - */ - setScale(x: number, y?: number): this; - - /** - * Sets the x position of this Game Object. - * @param value The x position of this Game Object. Default 0. - */ - setX(value?: number): this; - - /** - * Sets the y position of this Game Object. - * @param value The y position of this Game Object. Default 0. - */ - setY(value?: number): this; - - /** - * Sets the z position of this Game Object. - * - * Note: The z position does not control the rendering order of 2D Game Objects. Use - * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. - * @param value The z position of this Game Object. Default 0. - */ - setZ(value?: number): this; - - /** - * Sets the w position of this Game Object. - * @param value The w position of this Game Object. Default 0. - */ - setW(value?: number): this; - - /** - * Gets the local transform matrix for this Game Object. - * @param tempMatrix The matrix to populate with the values from this Game Object. - */ - getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Gets the world transform matrix for this Game Object, factoring in any parent Containers. - * @param tempMatrix The matrix to populate with the values from this Game Object. - * @param parentMatrix A temporary matrix to hold parent values during the calculations. - */ - getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; - - /** - * Gets the sum total rotation of all of this Game Objects parent Containers. - * - * The returned value is in radians and will be zero if this Game Object has no parent container. - */ - getParentRotation(): number; - - /** - * The visible state of the Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - */ - visible: boolean; - - /** - * Sets the visibility of this Game Object. - * - * An invisible Game Object will skip rendering, but will still process update logic. - * @param value The visible state of the Game Object. - */ - setVisible(value: boolean): this; - - /** - * The horizontal scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorX: number; - - /** - * The vertical scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - */ - scrollFactorY: number; - - /** - * Sets the scroll factor of this Game Object. - * - * The scroll factor controls the influence of the movement of a Camera upon this Game Object. - * - * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. - * It does not change the Game Objects actual position values. - * - * A value of 1 means it will move exactly in sync with a camera. - * A value of 0 means it will not move at all, even if the camera moves. - * Other values control the degree to which the camera movement is mapped to this Game Object. - * - * Please be aware that scroll factor values other than 1 are not taken in to consideration when - * calculating physics collisions. Bodies always collide based on their world position, but changing - * the scroll factor is a visual adjustment to where the textures are rendered, which can offset - * them from physics bodies if not accounted for in your code. - * @param x The horizontal scroll factor of this Game Object. - * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. - */ - setScrollFactor(x: number, y?: number): this; - - } + function ParseToTilemap(scene: Phaser.Scene, key?: string, tileWidth?: number, tileHeight?: number, width?: number, height?: number, data?: number[][], insertNull?: boolean): Phaser.Tilemaps.Tilemap; /** * A Tile is a representation of a single tile within the Tilemap. This is a lightweight data @@ -81693,7 +90012,7 @@ declare namespace Phaser { * support multiple tileset sizes within one map, but they are still placed at intervals of the * base tile height. */ - constructor(layer: Phaser.Tilemaps.LayerData, index: integer, x: integer, y: integer, width: integer, height: integer, baseWidth: integer, baseHeight: integer); + constructor(layer: Phaser.Tilemaps.LayerData, index: number, x: number, y: number, width: number, height: number, baseWidth: number, baseHeight: number); /** * The LayerData in the Tilemap data that this tile belongs to. @@ -81704,39 +90023,53 @@ declare namespace Phaser { * The index of this tile within the map data corresponding to the tileset, or -1 if this * represents a blank tile. */ - index: integer; + index: number; /** * The x map coordinate of this tile in tile units. */ - x: integer; + x: number; /** * The y map coordinate of this tile in tile units. */ - y: integer; + y: number; /** * The width of the tile in pixels. */ - width: integer; + width: number; /** * The height of the tile in pixels. */ - height: integer; + height: number; /** - * The map's base width of a tile in pixels. Tiled maps support multiple tileset sizes - * within one map, but they are still placed at intervals of the base tile size. + * The right of the tile in pixels. + * + * Set in the `updatePixelXY` method. */ - baseWidth: integer; + right: number; /** - * The map's base height of a tile in pixels. Tiled maps support multiple tileset sizes + * The bottom of the tile in pixels. + * + * Set in the `updatePixelXY` method. + */ + bottom: number; + + /** + * The maps base width of a tile in pixels. Tiled maps support multiple tileset sizes * within one map, but they are still placed at intervals of the base tile size. */ - baseHeight: integer; + baseWidth: number; + + /** + * The maps base height of a tile in pixels. Tiled maps support multiple tileset sizes + * within one map, but they are still placed at intervals of the base tile size. + */ + baseHeight: number; /** * The x coordinate of the top left of this tile in pixels. This is relative to the top left @@ -81783,22 +90116,22 @@ declare namespace Phaser { collideDown: boolean; /** - * Whether the tile's left edge is interesting for collisions. + * Whether the tiles left edge is interesting for collisions. */ faceLeft: boolean; /** - * Whether the tile's right edge is interesting for collisions. + * Whether the tiles right edge is interesting for collisions. */ faceRight: boolean; /** - * Whether the tile's top edge is interesting for collisions. + * Whether the tiles top edge is interesting for collisions. */ faceTop: boolean; /** - * Whether the tile's bottom edge is interesting for collisions. + * Whether the tiles bottom edge is interesting for collisions. */ faceBottom: boolean; @@ -81836,7 +90169,7 @@ declare namespace Phaser { * except for position and interesting faces. * @param tile The tile to copy from. */ - copy(tile: Phaser.Tilemaps.Tile): Phaser.Tilemaps.Tile; + copy(tile: Phaser.Tilemaps.Tile): this; /** * The collision group for this Tile, defined within the Tileset. This returns a reference to @@ -81903,11 +90236,6 @@ declare namespace Phaser { */ getCenterY(camera?: Phaser.Cameras.Scene2D.Camera): number; - /** - * Clean up memory. - */ - destroy(): void; - /** * Check for intersection with this tile. This does not factor in camera scroll, layer scale or * layer position. @@ -81929,12 +90257,12 @@ declare namespace Phaser { * Reset collision status flags. * @param recalculateFaces Whether or not to recalculate interesting faces for this tile and its neighbors. Default true. */ - resetCollision(recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + resetCollision(recalculateFaces?: boolean): this; /** * Reset faces. */ - resetFaces(): Phaser.Tilemaps.Tile; + resetFaces(): this; /** * Sets the collision flags for each side of this tile and updates the interesting faces list. @@ -81942,10 +90270,9 @@ declare namespace Phaser { * @param right Indicating collide with any object on the right. * @param up Indicating collide with any object on the top. * @param down Indicating collide with any object on the bottom. - * @param recalculateFaces Whether or not to recalculate interesting faces - * for this tile and its neighbors. Default true. + * @param recalculateFaces Whether or not to recalculate interesting faces for this tile and its neighbors. Default true. */ - setCollision(left: boolean, right?: boolean, up?: boolean, down?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + setCollision(left: boolean, right?: boolean, up?: boolean, down?: boolean, recalculateFaces?: boolean): this; /** * Set a callback to be called when this tile is hit by an object. The callback must true for @@ -81953,7 +90280,7 @@ declare namespace Phaser { * @param callback Callback function. * @param context Callback will be called within this context. */ - setCollisionCallback(callback: Function, context: object): Phaser.Tilemaps.Tile; + setCollisionCallback(callback: Function, context: object): this; /** * Sets the size of the tile and updates its pixelX and pixelY. @@ -81962,12 +90289,17 @@ declare namespace Phaser { * @param baseWidth The base width a tile in the map (in pixels). * @param baseHeight The base height of the tile in pixels (in pixels). */ - setSize(tileWidth: integer, tileHeight: integer, baseWidth: integer, baseHeight: integer): Phaser.Tilemaps.Tile; + setSize(tileWidth: number, tileHeight: number, baseWidth: number, baseHeight: number): this; /** - * Used internally. Updates the tile's world XY position based on the current tile size. + * Used internally. Updates the tiles world XY position based on the current tile size. */ - updatePixelXY(): Phaser.Tilemaps.Tile; + updatePixelXY(): this; + + /** + * Clean up memory. + */ + destroy(): void; /** * True if this tile can collide on any of its faces or has a collision callback set. @@ -81986,21 +90318,20 @@ declare namespace Phaser { /** * The tileset that contains this Tile. This is null if accessed from a LayerData instance - * before the tile is placed in a StaticTilemapLayer or DynamicTilemapLayer, or if the tile has - * an index that doesn't correspond to any of the map's tilesets. + * before the tile is placed in a TilemapLayer, or if the tile has an index that doesn't correspond + * to any of the maps tilesets. */ readonly tileset: Phaser.Tilemaps.Tileset; /** * The tilemap layer that contains this Tile. This will only return null if accessed from a - * LayerData instance before the tile is placed within a StaticTilemapLayer or - * DynamicTilemapLayer. + * LayerData instance before the tile is placed within a TilemapLayer. */ - readonly tilemapLayer: Phaser.Tilemaps.StaticTilemapLayer | Phaser.Tilemaps.DynamicTilemapLayer; + readonly tilemapLayer: Phaser.Tilemaps.TilemapLayer; /** * The tilemap that contains this Tile. This will only return null if accessed from a LayerData - * instance before the tile is placed within a StaticTilemapLayer or DynamicTilemapLayer. + * instance before the tile is placed within a TilemapLayer. */ readonly tilemap: Phaser.Tilemaps.Tilemap; @@ -82139,25 +90470,39 @@ declare namespace Phaser { /** * A Tilemap is a container for Tilemap data. This isn't a display object, rather, it holds data * about the map and allows you to add tilesets and tilemap layers to it. A map can have one or - * more tilemap layers (StaticTilemapLayer or DynamicTilemapLayer), which are the display - * objects that actually render tiles. + * more tilemap layers, which are the display objects that actually render the tiles. * - * The Tilemap data be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free + * The Tilemap data can be parsed from a Tiled JSON file, a CSV file or a 2D array. Tiled is a free * software package specifically for creating tile maps, and is available from: * http://www.mapeditor.org * - * A Tilemap has handy methods for getting & manipulating the tiles within a layer. You can only - * use the methods that change tiles (e.g. removeTileAt) on a DynamicTilemapLayer. + * As of Phaser 3.50.0 the Tilemap API now supports the following types of map: + * + * 1) Orthogonal + * 2) Isometric + * 3) Hexagonal + * 4) Staggered + * + * Prior to this release, only orthogonal maps were supported. + * + * Another large change in 3.50 was the consolidation of Tilemap Layers. Previously, you created + * either a Static or Dynamic Tilemap Layer. However, as of 3.50 the features of both have been + * merged and the API simplified, so now there is just the single `TilemapLayer` class. + * + * A Tilemap has handy methods for getting and manipulating the tiles within a layer, allowing + * you to build or modify the tilemap data at runtime. * * Note that all Tilemaps use a base tile size to calculate dimensions from, but that a - * StaticTilemapLayer or DynamicTilemapLayer may have its own unique tile size that overrides - * it. + * TilemapLayer may have its own unique tile size that overrides this. * * As of Phaser 3.21.0, if your tilemap includes layer groups (a feature of Tiled 1.2.0+) these - * will be traversed and the following properties will affect children: - * - opacity (blended with parent) and visibility (parent overrides child) + * will be traversed and the following properties will impact children: + * + * - Opacity (blended with parent) and visibility (parent overrides child) * - Vertical and horizontal offset + * * The grouping hierarchy is not preserved and all layers will be flattened into a single array. + * * Group layers are parsed during Tilemap construction but are discarded after parsing so dynamic * layers will NOT continue to be affected by a parent. * @@ -82180,13 +90525,13 @@ declare namespace Phaser { * The base width of a tile in pixels. Note that individual layers may have a different tile * width. */ - tileWidth: integer; + tileWidth: number; /** * The base height of a tile in pixels. Note that individual layers may have a different * tile height. */ - tileHeight: integer; + tileHeight: number; /** * The width of the map (in tiles). @@ -82242,6 +90587,9 @@ declare namespace Phaser { */ heightInPixels: number; + /** + * A collection of Images, as parsed from Tiled map data. + */ imageCollections: Phaser.Tilemaps.ImageCollection[]; /** @@ -82267,7 +90615,13 @@ declare namespace Phaser { /** * The index of the currently selected LayerData object. */ - currentLayerIndex: integer; + currentLayerIndex: number; + + /** + * The length of the horizontal sides of the hexagon. + * Only used for hexagonal orientation Tilemaps. + */ + hexSideLength: number; /** * Sets the rendering (draw) order of the tiles in this map. @@ -82287,12 +90641,12 @@ declare namespace Phaser { * * You can provide either an integer (0 to 3), or the string version of the order. * - * Calling this method _after_ creating Static or Dynamic Tilemap Layers will **not** automatically + * Calling this method _after_ creating Tilemap Layers will **not** automatically * update them to use the new render order. If you call this method after creating layers, use their * own `setRenderOrder` methods to change them as needed. * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. */ - setRenderOrder(renderOrder: integer | string): this; + setRenderOrder(renderOrder: number | string): this; /** * Adds an image to the map to be used as a tileset. A single map may use multiple tilesets. @@ -82314,18 +90668,7 @@ declare namespace Phaser { * @param gid If adding multiple tilesets to a blank map, specify the starting * GID this set will use here. Default 0. */ - addTilesetImage(tilesetName: string, key?: string, tileWidth?: integer, tileHeight?: integer, tileMargin?: integer, tileSpacing?: integer, gid?: integer): Phaser.Tilemaps.Tileset; - - /** - * Turns the DynamicTilemapLayer associated with the given layer into a StaticTilemapLayer. If - * no layer specified, the map's current layer is used. This is useful if you want to manipulate - * a map at the start of a scene, but then make it non-manipulable and optimize it for speed. - * Note: the DynamicTilemapLayer passed in is destroyed, so make sure to store the value - * returned from this method if you want to manipulate the new StaticTilemapLayer. - * @param layer The name of the layer from Tiled, the - * index of the layer in the map, or a DynamicTilemapLayer. - */ - convertLayerToStatic(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer): Phaser.Tilemaps.StaticTilemapLayer; + addTilesetImage(tilesetName: string, key?: string, tileWidth?: number, tileHeight?: number, tileMargin?: number, tileSpacing?: number, gid?: number): Phaser.Tilemaps.Tileset; /** * Copies the tiles in the source rectangular area to a new destination (all specified in tile @@ -82342,10 +90685,12 @@ declare namespace Phaser { * @param recalculateFaces `true` if the faces data should be recalculated. Default true. * @param layer The tile layer to use. If not given the current layer is used. */ - copy(srcTileX: integer, srcTileY: integer, width: integer, height: integer, destTileX: integer, destTileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + copy(srcTileX: number, srcTileY: number, width: number, height: number, destTileX: number, destTileY: number, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** - * Creates a new and empty DynamicTilemapLayer. The currently selected layer in the map is set to this new layer. + * Creates a new and empty Tilemap Layer. The currently selected layer in the map is set to this new layer. + * + * Prior to v3.50.0 this method was called `createBlankDynamicLayer`. * @param name The name of this layer. Must be unique within the map. * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param x The world x position where the top left of this layer will be placed. Default 0. @@ -82355,42 +90700,113 @@ declare namespace Phaser { * @param tileWidth The width of the tiles the layer uses for calculations. If not specified, it will default to the map's tileWidth. * @param tileHeight The height of the tiles the layer uses for calculations. If not specified, it will default to the map's tileHeight. */ - createBlankDynamicLayer(name: string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number, width?: integer, height?: integer, tileWidth?: integer, tileHeight?: integer): Phaser.Tilemaps.DynamicTilemapLayer; + createBlankLayer(name: string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number, width?: number, height?: number, tileWidth?: number, tileHeight?: number): Phaser.Tilemaps.TilemapLayer; /** - * Creates a new DynamicTilemapLayer that renders the LayerData associated with the given + * Creates a new Tilemap Layer that renders the LayerData associated with the given * `layerID`. The currently selected layer in the map is set to this new layer. * * The `layerID` is important. If you've created your map in Tiled then you can get this by * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and * look at the layers[].name value. Either way it must match. * - * Unlike a static layer, a dynamic layer can be modified. See DynamicTilemapLayer for more - * information. + * Prior to v3.50.0 this method was called `createDynamicLayer`. * @param layerID The layer array index value, or if a string is given, the layer name from Tiled. * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. * @param x The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. * @param y The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. */ - createDynamicLayer(layerID: integer | string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number): Phaser.Tilemaps.DynamicTilemapLayer; + createLayer(layerID: number | string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number): Phaser.Tilemaps.TilemapLayer; /** - * Creates a Sprite for every object matching the given gid in the map data. All properties from - * the map data objectgroup are copied into the `spriteConfig`, so you can use this as an easy - * way to configure Sprite properties from within the map editor. For example giving an object a - * property of alpha: 0.5 in the map editor will duplicate that when the Sprite is created. + * This method will iterate through all of the objects defined in a Tiled Object Layer and then + * convert the matching results into Phaser Game Objects (by default, Sprites) * - * Custom object properties not sharing names with the Sprite's own properties are copied to the - * Sprite's {@link Phaser.GameObjects.Sprite#data data store}. - * @param name The name of the object layer (from Tiled) to create Sprites from. - * @param id Either the id (object), gid (tile object) or name (object or - * tile object) from Tiled. Ids are unique in Tiled, but a gid is shared by all tile objects - * with the same graphic. The same name can be used on multiple objects. - * @param spriteConfig The config object to pass into the Sprite creator (i.e. - * scene.make.sprite). - * @param scene The Scene to create the Sprites within. Default the scene the map is within. + * Objects are matched on one of 3 criteria: The Object ID, the Object GID or the Object Name. + * + * Within Tiled, Object IDs are unique per Object. Object GIDs, however, are shared by all objects + * using the same image. Finally, Object Names are strings and the same name can be used on multiple + * Objects in Tiled, they do not have to be unique. + * + * You set the configuration parameter accordingly, based on which type of criteria you wish + * to match against. For example, to convert all items on an Object Layer with a `gid` of 26: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26 + * }); + * ``` + * + * Or, to convert objects with the name 'bonus': + * + * ```javascript + * createFromObjects(layerName, { + * name: 'bonus' + * }); + * ``` + * + * Or, to convert an object with a specific id: + * + * ```javascript + * createFromObjects(layerName, { + * id: 9 + * }); + * ``` + * + * You should only specify either `id`, `gid`, `name`, or none of them. Do not add more than + * one criteria to your config. If you do not specify any criteria, then _all_ objects in the + * Object Layer will be converted. + * + * By default this method will convert objects into `Sprite` instances, but you can override + * this by providing your own class type: + * + * ```javascript + * createFromObjects(layerName, { + * gid: 26, + * classType: Coin + * }); + * ``` + * + * This will convert all Objects with a gid of 26 into your custom `Coin` class. You can pass + * any class type here, but it _must_ extend `Phaser.GameObjects.GameObject` as its base class. + * Your class will always be passed 1 parameter: `scene`, which is a reference to either the Scene + * specified in the config object or, if not given, the Scene to which this Tilemap belongs. + * + * All properties from object are copied into the Game Object, so you can use this as an easy + * way to configure properties from within the map editor. For example giving an object a + * property of `alpha: 0.5` in Tiled will be reflected in the Game Object that is created. + * + * Custom object properties that do not exist as a Game Object property are set in the + * Game Objects {@link Phaser.GameObjects.GameObject#data data store}. + * + * You can use set a `container` property in the config. If given, the class will be added to + * the Container instance instead of the Scene. + * + * Finally, you can provide an array of config objects, to convert multiple types of object in + * a single call: + * + * ```javascript + * createFromObjects(layerName, [ + * { + * gid: 26, + * classType: Coin + * }, + * { + * id: 9, + * classType: BossMonster + * }, + * { + * name: 'lava', + * classType: LavaTile + * } + * ]); + * ``` + * + * The signature of this method changed significantly in v3.50.0. Prior to this, it did not take config objects. + * @param objectLayerName The name of the Tiled object layer to create the Game Objects from. + * @param config A CreateFromObjects configuration object, or an array of them. */ - createFromObjects(name: string, id: integer | string, spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene): Phaser.GameObjects.Sprite[]; + createFromObjects(objectLayerName: string, config: Phaser.Types.Tilemaps.CreateFromObjectLayerConfig | Phaser.Types.Tilemaps.CreateFromObjectLayerConfig[]): Phaser.GameObjects.GameObject[]; /** * Creates a Sprite for every object matching the given tile indexes in the layer. You can @@ -82402,34 +90818,11 @@ declare namespace Phaser { * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a * one-to-one mapping with the indexes array. * @param spriteConfig The config object to pass into the Sprite creator (i.e. scene.make.sprite). - * @param scene The Scene to create the Sprites within. Default scene the map is within. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param scene The Scene to create the Sprites within. + * @param camera The Camera to use when calculating the tile index from the world values. * @param layer The tile layer to use. If not given the current layer is used. */ - createFromTiles(indexes: integer | any[], replacements: integer | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.GameObjects.Sprite[]; - - /** - * Creates a new StaticTilemapLayer that renders the LayerData associated with the given - * `layerID`. The currently selected layer in the map is set to this new layer. - * - * The `layerID` is important. If you've created your map in Tiled then you can get this by - * looking in Tiled and looking at the layer name. Or you can open the JSON file it exports and - * look at the layers[].name value. Either way it must match. - * - * It's important to remember that a static layer cannot be modified. See StaticTilemapLayer for - * more information. - * @param layerID The layer array index value, or if a string is given, the layer name from Tiled. - * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. - * @param x The x position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. - * @param y The y position to place the layer in the world. If not specified, it will default to the layer offset from Tiled or 0. Default 0. - */ - createStaticLayer(layerID: integer | string, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number): Phaser.Tilemaps.StaticTilemapLayer; - - /** - * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any - * StaticTilemapLayers or DynamicTilemapLayers that have been linked to LayerData. - */ - destroy(): void; + createFromTiles(indexes: number | any[], replacements: number | any[], spriteConfig: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.GameObjects.Sprite[]; /** * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the @@ -82439,14 +90832,14 @@ declare namespace Phaser { * If no layer specified, the map's current layer is used. * This cannot be applied to StaticTilemapLayers. * @param index The tile index to fill the area with. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param recalculateFaces `true` if the faces data should be recalculated. Default true. * @param layer The tile layer to use. If not given the current layer is used. */ - fill(index: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + fill(index: number, tileX?: number, tileY?: number, width?: number, height?: number, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * For each object in the given object layer, run the given filter callback function. Any @@ -82456,7 +90849,7 @@ declare namespace Phaser { * @param callback The callback. Each object in the given area will be passed to this callback as the first and only parameter. * @param context The context under which the callback should be run. */ - filterObjects(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFilterCallback, context?: object): Phaser.GameObjects.GameObject[]; + filterObjects(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFilterCallback, context?: object): Phaser.Types.Tilemaps.TiledObject[]; /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -82467,14 +90860,14 @@ declare namespace Phaser { * callback as the first and only parameter. The callback should return true for tiles that pass the * filter. * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. * @param layer The tile layer to use. If not given the current layer is used. */ - filterTiles(callback: Function, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + filterTiles(callback: Function, context?: object, tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile[]; /** * Searches the entire map layer for the first tile matching the given index, then returns that Tile @@ -82488,7 +90881,7 @@ declare namespace Phaser { * @param reverse If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. Default false. * @param layer The tile layer to use. If not given the current layer is used. */ - findByIndex(index: integer, skip?: integer, reverse?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + findByIndex(index: number, skip?: number, reverse?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** * Find the first object in the given object layer that satisfies the provided testing function. @@ -82498,7 +90891,7 @@ declare namespace Phaser { * @param callback The callback. Each object in the given area will be passed to this callback as the first and only parameter. * @param context The context under which the callback should be run. */ - findObject(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFindCallback, context?: object): Phaser.GameObjects.GameObject; + findObject(objectLayer: Phaser.Tilemaps.ObjectLayer | string, callback: TilemapFindCallback, context?: object): Phaser.Types.Tilemaps.TiledObject; /** * Find the first tile in the given rectangular area (in tile coordinates) of the layer that @@ -82507,14 +90900,14 @@ declare namespace Phaser { * If no layer specified, the maps current layer is used. * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. * @param layer The Tile layer to run the search on. If not provided will use the current layer. */ - findTile(callback: FindTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + findTile(callback: FindTileCallback, context?: object, tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given @@ -82523,20 +90916,20 @@ declare namespace Phaser { * If no layer specified, the map's current layer is used. * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. * @param context The context under which the callback should be run. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. * @param layer The Tile layer to run the search on. If not provided will use the current layer. */ - forEachTile(callback: EachTileCallback, context?: object, tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + forEachTile(callback: EachTileCallback, context?: object, tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Gets the image layer index based on its name. * @param name The name of the image to get. */ - getImageIndex(name: string): integer; + getImageIndex(name: string): number; /** * Return a list of all valid imagelayer names loaded in this Tilemap. @@ -82552,17 +90945,13 @@ declare namespace Phaser { getIndex(location: any[], name: string): number; /** - * Gets the LayerData from this.layers that is associated with `layer`, or null if an invalid - * `layer` is given. - * @param layer The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the maps current layer index. + * Gets the LayerData from `this.layers` that is associated with the given `layer`, or null if the layer is invalid. + * @param layer The name of the layer from Tiled, the index of the layer in the map or Tilemap Layer. If not given will default to the maps current layer index. */ - getLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.LayerData; + getLayer(layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.LayerData; /** - * Gets the ObjectLayer from this.objects that has the given `name`, or null if no ObjectLayer - * is found with that name. + * Gets the ObjectLayer from `this.objects` that has the given `name`, or null if no ObjectLayer is found with that name. * @param name The name of the object layer from Tiled. */ getObjectLayer(name?: string): Phaser.Tilemaps.ObjectLayer; @@ -82575,39 +90964,39 @@ declare namespace Phaser { /** * Gets the LayerData index of the given `layer` within this.layers, or null if an invalid * `layer` is given. - * @param layer The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param layer The name of the layer from Tiled, the index of the layer in the map or a Tilemap Layer. If not given will default to the map's current layer index. */ - getLayerIndex(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): integer; + getLayerIndex(layer?: string | number | Phaser.Tilemaps.TilemapLayer): number; /** * Gets the index of the LayerData within this.layers that has the given `name`, or null if an * invalid `name` is given. * @param name The name of the layer to get. */ - getLayerIndexByName(name: string): integer; + getLayerIndexByName(name: string): number; /** * Gets a tile at the given tile coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * @param tileX X position to get the tile from (given in tile units, not pixels). * @param tileY Y position to get the tile from (given in tile units, not pixels). - * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. * @param layer The tile layer to use. If not given the current layer is used. */ - getTileAt(tileX: integer, tileY: integer, nonNull?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + getTileAt(tileX: number, tileY: number, nonNull?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** * Gets a tile at the given world coordinates from the given layer. - * If no layer specified, the map's current layer is used. + * + * If no layer is specified, the maps current layer is used. * @param worldX X position to get the tile from (given in pixels) * @param worldY Y position to get the tile from (given in pixels) - * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. + * @param camera The Camera to use when calculating the tile index from the world values. * @param layer The tile layer to use. If not given the current layer is used. */ - getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** * Return a list of all valid tilelayer names loaded in this Tilemap. @@ -82616,39 +91005,42 @@ declare namespace Phaser { /** * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. - * If no layer specified, the maps current layer is used. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * + * If no layer is specified, the maps current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param filteringOptions Optional filters to apply when getting the tiles. * @param layer The tile layer to use. If not given the current layer is used. */ - getTilesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + getTilesWithin(tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile[]; /** * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, * Line, Rectangle or Triangle. The shape should be in world coordinates. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * @param shape A shape in world (pixel) coordinates * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param camera The Camera to use when factoring in which tiles to return. * @param layer The tile layer to use. If not given the current layer is used. */ - getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile[]; /** * Gets the tiles in the given rectangular area (in world coordinates) of the layer. - * If no layer specified, the maps current layer is used. + * + * If no layer is specified, the maps current layer is used. * @param worldX The world x coordinate for the top-left of the area. * @param worldY The world y coordinate for the top-left of the area. * @param width The width of the area. * @param height The height of the area. * @param filteringOptions Optional filters to apply when getting the tiles. - * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param camera The Camera to use when factoring in which tiles to return. * @param layer The tile layer to use. If not given the current layer is used. */ - getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile[]; + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile[]; /** * Gets the Tileset that has the given `name`, or null if an invalid `name` is given. @@ -82661,30 +91053,30 @@ declare namespace Phaser { * invalid `name` is given. * @param name The name of the Tileset to get. */ - getTilesetIndex(name: string): integer; + getTilesetIndex(name: string): number; /** * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. * @param layer The tile layer to use. If not given the current layer is used. */ - hasTileAt(tileX: integer, tileY: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): boolean; + hasTileAt(tileX: number, tileY: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): boolean; /** * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns * false if there is no tile or if the tile at that location has an index of -1. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * @param worldX The x coordinate, in pixels. * @param worldY The y coordinate, in pixels. - * @param camera The Camera to use when factoring in which tiles to return. Default main camera. + * @param camera The Camera to use when factoring in which tiles to return. * @param layer The tile layer to use. If not given the current layer is used. */ - hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): boolean; + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): boolean; /** * The LayerData object that is currently selected in the map. You can set this property using @@ -82698,16 +91090,14 @@ declare namespace Phaser { * location. If you pass in an index, only the index at the specified location will be changed. * Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. - * - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * @param tile The index of this tile to set or a Tile object. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. * @param layer The tile layer to use. If not given the current layer is used. */ - putTileAt(tile: integer | Phaser.Tilemaps.Tile, tileX: integer, tileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + putTileAt(tile: number | Phaser.Tilemaps.Tile, tileX: number, tileY: number, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either @@ -82715,16 +91105,15 @@ declare namespace Phaser { * specified location. If you pass in an index, only the index at the specified location will be * changed. Collision information will be recalculated at the specified location. * - * If no layer specified, the maps current layer is used. This - * cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * @param tile The index of this tile to set or a Tile object. * @param worldX The x coordinate, in pixels. * @param worldY The y coordinate, in pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param camera The Camera to use when calculating the tile index from the world values. * @param layer The tile layer to use. If not given the current layer is used. */ - putTileAtWorldXY(tile: integer | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + putTileAtWorldXY(tile: number | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified @@ -82733,15 +91122,14 @@ declare namespace Phaser { * index at the specified location will be changed. Collision information will be recalculated * within the region tiles were changed. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. * @param layer The tile layer to use. If not given the current layer is used. */ - putTilesAt(tile: integer[] | integer[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: integer, tileY: integer, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + putTilesAt(tile: number[] | number[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: number, tileY: number, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -82750,117 +91138,109 @@ declare namespace Phaser { * indexes found within the region (excluding -1) will be used for randomly assigning new tile * indexes. This method only modifies tile indexes and does not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * If no layer is specified, the maps current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param indexes An array of indexes to randomly draw from during randomization. * @param layer The tile layer to use. If not given the current layer is used. */ - randomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, indexes?: integer[], layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + randomize(tileX?: number, tileY?: number, width?: number, height?: number, indexes?: number[], layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting * faces are used internally for optimizing collisions against tiles. This method is mostly used * internally to optimize recalculating faces when only one tile has been changed. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. * @param layer The tile layer to use. If not given the current layer is used. */ - calculateFacesAt(tileX: integer, tileY: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + calculateFacesAt(tileX: number, tileY: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the * layer. Interesting faces are used internally for optimizing collisions against tiles. This method * is mostly used internally. * - * If no layer specified, the map's current layer is used. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * If no layer is specified, the maps current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param layer The tile layer to use. If not given the current layer is used. */ - calculateFacesWithin(tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + calculateFacesWithin(tileX?: number, tileY?: number, width?: number, height?: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Removes the given TilemapLayer from this Tilemap without destroying it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param layer The tile layer to be removed. */ - removeLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + removeLayer(layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Destroys the given TilemapLayer and removes it from this Tilemap. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param layer The tile layer to be destroyed. */ - destroyLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + destroyLayer(layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** - * Removes all layers from this Tilemap and destroys any associated StaticTilemapLayers or - * DynamicTilemapLayers. + * Removes all Tilemap Layers from this Tilemap and calls `destroy` on each of them. */ - removeAllLayers(): Phaser.Tilemaps.Tilemap; + removeAllLayers(): this; /** * Removes the given Tile, or an array of Tiles, from the layer to which they belong, * and optionally recalculates the collision information. - * - * This cannot be applied to Tiles that belong to Static Tilemap Layers. * @param tiles The Tile to remove, or an array of Tiles. * @param replaceIndex After removing the Tile, insert a brand new Tile into its location with the given index. Leave as -1 to just remove the tile. Default -1. * @param recalculateFaces `true` if the faces data should be recalculated. Default true. */ - removeTile(tiles: Phaser.Tilemaps.Tile | Phaser.Tilemaps.Tile[], replaceIndex?: integer, recalculateFaces?: boolean): Phaser.Tilemaps.Tile[]; + removeTile(tiles: Phaser.Tilemaps.Tile | Phaser.Tilemaps.Tile[], replaceIndex?: number, recalculateFaces?: boolean): Phaser.Tilemaps.Tile[]; /** - * Removes the tile at the given tile coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given tile coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. - * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param replaceWithNull If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param recalculateFaces If `true` (the default), the faces data will be recalculated. * @param layer The tile layer to use. If not given the current layer is used. */ - removeTileAt(tileX: integer, tileY: integer, replaceWithNull?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + removeTileAt(tileX: number, tileY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** - * Removes the tile at the given world coordinates in the specified layer and updates the layer's - * collision information. + * Removes the tile at the given world coordinates in the specified layer and updates the layers collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * @param worldX The x coordinate, in pixels. * @param worldY The y coordinate, in pixels. - * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. - * @param recalculateFaces `true` if the faces data should be recalculated. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param replaceWithNull If `true` (the default), this will replace the tile at the specified location with null instead of a Tile with an index of -1. + * @param recalculateFaces If `true` (the default), the faces data will be recalculated. + * @param camera The Camera to use when calculating the tile index from the world values. * @param layer The tile layer to use. If not given the current layer is used. */ - removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tile; + removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tile; /** - * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * Draws a debug representation of the layer to the given Graphics object. This is helpful when you want to * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation * wherever you want on the screen. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * @param graphics The target Graphics object to draw upon. * @param styleConfig An object specifying the colors to use for the debug drawing. * @param layer The tile layer to use. If not given the current layer is used. */ - renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig?: Phaser.Types.Tilemaps.StyleConfig, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Draws a debug representation of all layers within this Tilemap to the given Graphics object. @@ -82871,38 +91251,37 @@ declare namespace Phaser { * @param graphics The target Graphics object to draw upon. * @param styleConfig An object specifying the colors to use for the debug drawing. */ - renderDebugFull(graphics: Phaser.GameObjects.Graphics, styleConfig: Phaser.Types.Tilemaps.StyleConfig): Phaser.Tilemaps.Tilemap; + renderDebugFull(graphics: Phaser.GameObjects.Graphics, styleConfig?: Phaser.Types.Tilemaps.StyleConfig): this; /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does * not change collision information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * @param findIndex The index of the tile to search for. * @param newIndex The index of the tile to replace it with. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param layer The tile layer to use. If not given the current layer is used. */ - replaceByIndex(findIndex: integer, newIndex: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + replaceByIndex(findIndex: number, newIndex: number, tileX?: number, tileY?: number, width?: number, height?: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Sets collision on the given tile or tiles within a layer by index. You can pass in either a * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if * collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param indexes Either a single tile index, or an array of tile indexes. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. * @param layer The tile layer to use. If not given the current layer is used. * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. */ - setCollision(indexes: integer | any[], collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer, updateLayer?: boolean): Phaser.Tilemaps.Tilemap; + setCollision(indexes: number | any[], collides?: boolean, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer, updateLayer?: boolean): Phaser.Tilemaps.Tilemap; /** * Sets collision on a range of tiles in a layer whose index is between the specified `start` and @@ -82910,14 +91289,14 @@ declare namespace Phaser { * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be * enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param start The first index of the tile to be set for collision. * @param stop The last index of the tile to be set for collision. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. * @param layer The tile layer to use. If not given the current layer is used. */ - setCollisionBetween(start: integer, stop: integer, collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setCollisionBetween(start: number, stop: number, collides?: boolean, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property @@ -82928,60 +91307,60 @@ declare namespace Phaser { * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a * "types" property that matches any of those values, its collision flag will be updated. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param properties An object with tile properties and corresponding values that should be checked. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. * @param layer The tile layer to use. If not given the current layer is used. */ - setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Sets collision on all tiles in the given layer, except for tiles that have an index specified in * the given array. The `collides` parameter controls if collision will be enabled (true) or * disabled (false). Tile indexes not currently in the layer are not affected. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param indexes An array of the tile indexes to not be counted for collision. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. * @param layer The tile layer to use. If not given the current layer is used. */ - setCollisionByExclusion(indexes: integer[], collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setCollisionByExclusion(indexes: number[], collides?: boolean, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** - * Sets collision on the tiles within a layer by checking each tile's collision group data + * Sets collision on the tiles within a layer by checking each tiles collision group data * (typically defined in Tiled within the tileset collision editor). If any objects are found within - * a tile's collision group, the tile's colliding information will be set. The `collides` parameter + * a tiles collision group, the tiles colliding information will be set. The `collides` parameter * controls if collision will be enabled (true) or disabled (false). * - * If no layer specified, the map's current layer is used. - * @param collides If true it will enable collision. If false it will clear collision. Default true. - * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * If no layer is specified, the maps current layer is used. + * @param collides If true it will enable collision. If false it will clear collision. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. * @param layer The tile layer to use. If not given the current layer is used. */ - setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Sets a global collision callback for the given tile index within the layer. This will affect all * tiles on this layer that have the same index. If a callback is already set for the tile index it * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile - * at a specific location on the map then see setTileLocationCallback. + * at a specific location on the map then see `setTileLocationCallback`. * - * If no layer specified, the map's current layer is used. - * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. + * If no layer is specified, the maps current layer is used. + * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. All values should be integers. * @param callback The callback that will be invoked when the tile is collided with. * @param callbackContext The context under which the callback is called. * @param layer The tile layer to use. If not given the current layer is used. */ - setTileIndexCallback(indexes: integer | any[], callback: Function, callbackContext: object, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setTileIndexCallback(indexes: number | number[], callback: Function, callbackContext: object, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. * If a callback is already set for the tile index it will be replaced. Set the callback to null to * remove it. * - * If no layer specified, the map's current layer is used. + * If no layer is specified, the maps current layer is used. * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. * @param width How many tiles wide from the `tileX` index the area will be. @@ -82990,15 +91369,13 @@ declare namespace Phaser { * @param callbackContext The context under which the callback is called. * @param layer The tile layer to use. If not given the current layer is used. */ - setTileLocationCallback(tileX: integer, tileY: integer, width: integer, height: integer, callback: Function, callbackContext?: object, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setTileLocationCallback(tileX: number, tileY: number, width: number, height: number, callback: Function, callbackContext?: object, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Sets the current layer to the LayerData associated with `layer`. - * @param layer The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param layer The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. */ - setLayer(layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setLayer(layer?: string | number | Phaser.Tilemaps.TilemapLayer): this; /** * Sets the base tile size for the map. Note: this does not necessarily match the tileWidth and @@ -83006,19 +91383,17 @@ declare namespace Phaser { * @param tileWidth The width of the tiles the map uses for calculations. * @param tileHeight The height of the tiles the map uses for calculations. */ - setBaseTileSize(tileWidth: integer, tileHeight: integer): Phaser.Tilemaps.Tilemap; + setBaseTileSize(tileWidth: number, tileHeight: number): this; /** - * Sets the tile size for a specific `layer`. Note: this does not necessarily match the map's + * Sets the tile size for a specific `layer`. Note: this does not necessarily match the maps * tileWidth and tileHeight for all layers. This will set the tile size for the layer and any * tiles the layer has. * @param tileWidth The width of the tiles (in pixels) in the layer. * @param tileHeight The height of the tiles (in pixels) in the layer. - * @param layer The name of the - * layer from Tiled, the index of the layer in the map, a DynamicTilemapLayer or a - * StaticTilemapLayer. If not given will default to the map's current layer index. + * @param layer The name of the layer from Tiled, the index of the layer in the map or a TilemapLayer. If not given will default to the maps current layer index. */ - setLayerTileSize(tileWidth: integer, tileHeight: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + setLayerTileSize(tileWidth: number, tileHeight: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): this; /** * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given @@ -83026,69 +91401,707 @@ declare namespace Phaser { * appear to have changed! This method only modifies tile indexes and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * If no layer is specified, the maps current layer is used. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param layer The tile layer to use. If not given the current layer is used. */ - shuffle(tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + shuffle(tileX?: number, tileY?: number, width?: number, height?: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision * information. * - * If no layer specified, the maps current layer is used. - * This cannot be applied to StaticTilemapLayers. + * If no layer is specified, the maps current layer is used. * @param tileA First tile index. * @param tileB Second tile index. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. * @param layer The tile layer to use. If not given the current layer is used. */ - swapByIndex(tileA: integer, tileB: integer, tileX?: integer, tileY?: integer, width?: integer, height?: integer, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + swapByIndex(tileA: number, tileB: number, tileX?: number, tileY?: number, width?: number, height?: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; /** * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * @param tileX The x coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. + * @param camera The Camera to use when calculating the tile index from the world values. * @param layer The tile layer to use. If not given the current layer is used. */ - tileToWorldX(tileX: integer, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + tileToWorldX(tileX: number, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): number; /** * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the * layers position, scale and scroll. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. * @param tileY The y coordinate, in tiles, not pixels. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - * @param layer The tile layer - * to use. If not given the current layer is used. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The tile layer to use. If not given the current layer is used. */ - tileToWorldY(tileY: integer, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + tileToWorldY(tileY: number, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): number; /** * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. * - * If no layer specified, the maps current layer is used. + * If no layer is specified, the maps current layer is used. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param vec2 A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The tile layer to use. If not given the current layer is used. + */ + tileToWorldXY(tileX: number, tileY: number, vec2?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Math.Vector2; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. New indexes are drawn from the given + * weightedIndexes array. An example weighted array: + * + * [ + * { index: 6, weight: 4 }, // Probability of index 6 is 4 / 8 + * { index: 7, weight: 2 }, // Probability of index 7 would be 2 / 8 + * { index: 8, weight: 1.5 }, // Probability of index 8 would be 1.5 / 8 + * { index: 26, weight: 0.5 } // Probability of index 27 would be 0.5 / 8 + * ] + * + * The probability of any index being picked is (the indexs weight) / (sum of all weights). This + * method only modifies tile indexes and does not change collision information. + * + * If no layer is specified, the maps current layer is used. + * @param weightedIndexes An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param layer The tile layer to use. If not given the current layer is used. + */ + weightedRandomize(weightedIndexes: object[], tileX?: number, tileY?: number, width?: number, height?: number, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Tilemaps.Tilemap; + + /** + * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer is specified, the maps current layer is used. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The tile layer to use. If not given the current layer is used. + */ + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): number; + + /** + * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the + * layers position, scale and scroll. + * + * If no layer is specified, the maps current layer is used. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The tile layer to use. If not given the current layer is used. + */ + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): number; + + /** + * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. + * + * If no layer is specified, the maps current layer is used. + * @param worldX The x coordinate to be converted, in pixels, not tiles. + * @param worldY The y coordinate to be converted, in pixels, not tiles. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param vec2 A Vector2 to store the coordinates in. If not given a new Vector2 is created. + * @param camera The Camera to use when calculating the tile index from the world values. + * @param layer The tile layer to use. If not given the current layer is used. + */ + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, vec2?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | number | Phaser.Tilemaps.TilemapLayer): Phaser.Math.Vector2; + + /** + * Removes all layer data from this Tilemap and nulls the scene reference. This will destroy any + * TilemapLayers that have been created. + */ + destroy(): void; + + } + + /** + * A Tilemap Layer is a Game Object that renders LayerData from a Tilemap when used in combination + * with one, or more, Tilesets. + */ + class TilemapLayer extends Phaser.GameObjects.GameObject implements Phaser.GameObjects.Components.Alpha, Phaser.GameObjects.Components.BlendMode, Phaser.GameObjects.Components.ComputedSize, Phaser.GameObjects.Components.Depth, Phaser.GameObjects.Components.Flip, Phaser.GameObjects.Components.GetBounds, Phaser.GameObjects.Components.Origin, Phaser.GameObjects.Components.Pipeline, Phaser.GameObjects.Components.ScrollFactor, Phaser.GameObjects.Components.Transform, Phaser.GameObjects.Components.Visible { + /** + * + * @param scene The Scene to which this Game Object belongs. + * @param tilemap The Tilemap this layer is a part of. + * @param layerIndex The index of the LayerData associated with this layer. + * @param tileset The tileset, or an array of tilesets, used to render this layer. Can be a string or a Tileset object. + * @param x The world x position where the top left of this layer will be placed. Default 0. + * @param y The world y position where the top left of this layer will be placed. Default 0. + */ + constructor(scene: Phaser.Scene, tilemap: Phaser.Tilemaps.Tilemap, layerIndex: number, tileset: string | string[] | Phaser.Tilemaps.Tileset | Phaser.Tilemaps.Tileset[], x?: number, y?: number); + + /** + * Used internally by physics system to perform fast type checks. + */ + readonly isTilemap: boolean; + + /** + * The Tilemap that this layer is a part of. + */ + tilemap: Phaser.Tilemaps.Tilemap; + + /** + * The index of the LayerData associated with this layer. + */ + layerIndex: number; + + /** + * The LayerData associated with this layer. LayerData can only be associated with one + * tilemap layer. + */ + layer: Phaser.Tilemaps.LayerData; + + /** + * An array of `Tileset` objects associated with this layer. + */ + tileset: Phaser.Tilemaps.Tileset[]; + + /** + * The total number of tiles drawn by the renderer in the last frame. + */ + readonly tilesDrawn: number; + + /** + * The total number of tiles in this layer. Updated every frame. + */ + readonly tilesTotal: number; + + /** + * Used internally during rendering. This holds the tiles that are visible within the Camera. + */ + culledTiles: Phaser.Tilemaps.Tile[]; + + /** + * You can control if the camera should cull tiles on this layer before rendering them or not. + * + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this, and toggling this flag allows + * you to do so. Also see `setSkipCull` for a chainable method that does the same thing. + */ + skipCull: boolean; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its horizontal size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingX: number; + + /** + * The amount of extra tiles to add into the cull rectangle when calculating its vertical size. + * + * See the method `setCullPadding` for more details. + */ + cullPaddingY: number; + + /** + * The callback that is invoked when the tiles are culled. + * + * It will call a different function based on the map orientation: + * + * Orthogonal (the default) is `TilemapComponents.CullTiles` + * Isometric is `TilemapComponents.IsometricCullTiles` + * Hexagonal is `TilemapComponents.HexagonalCullTiles` + * Staggered is `TilemapComponents.StaggeredCullTiles` + * + * However, you can override this to call any function you like. + * + * It will be sent 4 arguments: + * + * 1. The Phaser.Tilemaps.LayerData object for this Layer + * 2. The Camera that is culling the layer. You can check its `dirty` property to see if it has changed since the last cull. + * 3. A reference to the `culledTiles` array, which should be used to store the tiles you want rendered. + * 4. The Render Order constant. + * + * See the `TilemapComponents.CullTiles` source code for details on implementing your own culling system. + */ + cullCallback: Function; + + /** + * An array holding the mapping between the tile indexes and the tileset they belong to. + */ + gidMap: Phaser.Tilemaps.Tileset[]; + + /** + * Sets the rendering (draw) order of the tiles in this layer. + * + * The default is 'right-down', meaning it will order the tiles starting from the top-left, + * drawing to the right and then moving down to the next row. + * + * The draw orders are: + * + * 0 = right-down + * 1 = left-down + * 2 = right-up + * 3 = left-up + * + * Setting the render order does not change the tiles or how they are stored in the layer, + * it purely impacts the order in which they are rendered. + * + * You can provide either an integer (0 to 3), or the string version of the order. + * @param renderOrder The render (draw) order value. Either an integer between 0 and 3, or a string: 'right-down', 'left-down', 'right-up' or 'left-up'. + */ + setRenderOrder(renderOrder: number | string): this; + + /** + * Calculates interesting faces at the given tile coordinates of the specified layer. Interesting + * faces are used internally for optimizing collisions against tiles. This method is mostly used + * internally to optimize recalculating faces when only one tile has been changed. + * @param tileX The x coordinate. + * @param tileY The y coordinate. + */ + calculateFacesAt(tileX: number, tileY: number): this; + + /** + * Calculates interesting faces within the rectangular area specified (in tile coordinates) of the + * layer. Interesting faces are used internally for optimizing collisions against tiles. This method + * is mostly used internally. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + */ + calculateFacesWithin(tileX?: number, tileY?: number, width?: number, height?: number): this; + + /** + * Creates a Sprite for every object matching the given tile indexes in the layer. You can + * optionally specify if each tile will be replaced with a new tile after the Sprite has been + * created. This is useful if you want to lay down special tiles in a level that are converted to + * Sprites, but want to replace the tile itself with a floor tile or similar once converted. + * @param indexes The tile index, or array of indexes, to create Sprites from. + * @param replacements The tile index, or array of indexes, to change a converted + * tile to. Set to `null` to leave the tiles unchanged. If an array is given, it is assumed to be a + * one-to-one mapping with the indexes array. + * @param spriteConfig The config object to pass into the Sprite creator (i.e. + * scene.make.sprite). + * @param scene The Scene to create the Sprites within. + * @param camera The Camera to use when determining the world XY + */ + createFromTiles(indexes: number | any[], replacements: number | any[], spriteConfig?: Phaser.Types.GameObjects.Sprite.SpriteConfig, scene?: Phaser.Scene, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.GameObjects.Sprite[]; + + /** + * Returns the tiles in the given layer that are within the cameras viewport. + * This is used internally during rendering. + * @param camera The Camera to run the cull check against. + */ + cull(camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Copies the tiles in the source rectangular area to a new destination (all specified in tile + * coordinates) within the layer. This copies all tile properties & recalculates collision + * information in the destination region. + * @param srcTileX The x coordinate of the area to copy from, in tiles, not pixels. + * @param srcTileY The y coordinate of the area to copy from, in tiles, not pixels. + * @param width The width of the area to copy, in tiles, not pixels. + * @param height The height of the area to copy, in tiles, not pixels. + * @param destTileX The x coordinate of the area to copy to, in tiles, not pixels. + * @param destTileY The y coordinate of the area to copy to, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + copy(srcTileX: number, srcTileY: number, width: number, height: number, destTileX: number, destTileY: number, recalculateFaces?: boolean): this; + + /** + * Sets the tiles in the given rectangular area (in tile coordinates) of the layer with the + * specified index. Tiles will be set to collide if the given index is a colliding index. + * Collision information in the region will be recalculated. + * @param index The tile index to fill the area with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + fill(index: number, tileX?: number, tileY?: number, width?: number, height?: number, recalculateFaces?: boolean): this; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * filter callback function. Any tiles that pass the filter test (i.e. where the callback returns + * true) will returned as a new array. Similar to Array.prototype.Filter in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this + * callback as the first and only parameter. The callback should return true for tiles that pass the + * filter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to filter. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + filterTiles(callback: Function, context?: object, tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Searches the entire map layer for the first tile matching the given index, then returns that Tile + * object. If no match is found, it returns null. The search starts from the top-left tile and + * continues horizontally until it hits the end of the row, then it drops down to the next column. + * If the reverse boolean is true, it scans starting from the bottom-right corner traveling up to + * the top-left. + * @param index The tile index value to search for. + * @param skip The number of times to skip a matching tile before returning. Default 0. + * @param reverse If true it will scan the layer in reverse, starting at the bottom-right. Otherwise it scans from the top-left. Default false. + */ + findByIndex(index: number, skip?: number, reverse?: boolean): Phaser.Tilemaps.Tile; + + /** + * Find the first tile in the given rectangular area (in tile coordinates) of the layer that + * satisfies the provided testing function. I.e. finds the first tile for which `callback` returns + * true. Similar to Array.prototype.find in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + findTile(callback: FindTileCallback, context?: object, tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile; + + /** + * For each tile in the given rectangular area (in tile coordinates) of the layer, run the given + * callback. Similar to Array.prototype.forEach in vanilla JS. + * @param callback The callback. Each tile in the given area will be passed to this callback as the first and only parameter. + * @param context The context, or scope, under which the callback should be run. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area to search. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area to search. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + forEachTile(callback: EachTileCallback, context?: object, tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): this; + + /** + * Gets a tile at the given tile coordinates from the given layer. + * @param tileX X position to get the tile from (given in tile units, not pixels). + * @param tileY Y position to get the tile from (given in tile units, not pixels). + * @param nonNull If true getTile won't return null for empty tiles, but a Tile object with an index of -1. Default false. + */ + getTileAt(tileX: number, tileY: number, nonNull?: boolean): Phaser.Tilemaps.Tile; + + /** + * Gets a tile at the given world coordinates from the given layer. + * @param worldX X position to get the tile from (given in pixels) + * @param worldY Y position to get the tile from (given in pixels) + * @param nonNull If true, function won't return null for empty tiles, but a Tile object with an index of -1. Default false. + * @param camera The Camera to use when calculating the tile index from the world values. + */ + getTileAtWorldXY(worldX: number, worldY: number, nonNull?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Gets the tiles in the given rectangular area (in tile coordinates) of the layer. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param filteringOptions Optional filters to apply when getting the tiles. + */ + getTilesWithin(tileX?: number, tileY?: number, width?: number, height?: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles that overlap with the given shape in the given layer. The shape must be a Circle, + * Line, Rectangle or Triangle. The shape should be in world coordinates. + * @param shape A shape in world (pixel) coordinates + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. + */ + getTilesWithinShape(shape: Phaser.Geom.Circle | Phaser.Geom.Line | Phaser.Geom.Rectangle | Phaser.Geom.Triangle, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Gets the tiles in the given rectangular area (in world coordinates) of the layer. + * @param worldX The world x coordinate for the top-left of the area. + * @param worldY The world y coordinate for the top-left of the area. + * @param width The width of the area. + * @param height The height of the area. + * @param filteringOptions Optional filters to apply when getting the tiles. + * @param camera The Camera to use when factoring in which tiles to return. + */ + getTilesWithinWorldXY(worldX: number, worldY: number, width: number, height: number, filteringOptions?: Phaser.Types.Tilemaps.FilteringOptions, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile[]; + + /** + * Checks if there is a tile at the given location (in tile coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + */ + hasTileAt(tileX: number, tileY: number): boolean; + + /** + * Checks if there is a tile at the given location (in world coordinates) in the given layer. Returns + * false if there is no tile or if the tile at that location has an index of -1. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param camera The Camera to use when factoring in which tiles to return. + */ + hasTileAtWorldXY(worldX: number, worldY: number, camera?: Phaser.Cameras.Scene2D.Camera): boolean; + + /** + * Puts a tile at the given tile coordinates in the specified layer. You can pass in either an index + * or a Tile object. If you pass in a Tile, all attributes will be copied over to the specified + * location. If you pass in an index, only the index at the specified location will be changed. + * Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + putTileAt(tile: number | Phaser.Tilemaps.Tile, tileX: number, tileY: number, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Puts a tile at the given world coordinates (pixels) in the specified layer. You can pass in either + * an index or a Tile object. If you pass in a Tile, all attributes will be copied over to the + * specified location. If you pass in an index, only the index at the specified location will be + * changed. Collision information will be recalculated at the specified location. + * @param tile The index of this tile to set or a Tile object. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. + * @param camera The Camera to use when calculating the tile index from the world values. + */ + putTileAtWorldXY(tile: number | Phaser.Tilemaps.Tile, worldX: number, worldY: number, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Puts an array of tiles or a 2D array of tiles at the given tile coordinates in the specified + * layer. The array can be composed of either tile indexes or Tile objects. If you pass in a Tile, + * all attributes will be copied over to the specified location. If you pass in an index, only the + * index at the specified location will be changed. Collision information will be recalculated + * within the region tiles were changed. + * @param tile A row (array) or grid (2D array) of Tiles or tile indexes to place. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + putTilesAt(tile: number[] | number[][] | Phaser.Tilemaps.Tile[] | Phaser.Tilemaps.Tile[][], tileX: number, tileY: number, recalculateFaces?: boolean): this; + + /** + * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the + * specified layer. Each tile will receive a new index. If an array of indexes is passed in, then + * those will be used for randomly assigning new tile indexes. If an array is not provided, the + * indexes found within the region (excluding -1) will be used for randomly assigning new tile + * indexes. This method only modifies tile indexes and does not change collision information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param indexes An array of indexes to randomly draw from during randomization. + */ + randomize(tileX?: number, tileY?: number, width?: number, height?: number, indexes?: number[]): this; + + /** + * Removes the tile at the given tile coordinates in the specified layer and updates the layers + * collision information. + * @param tileX The x coordinate, in tiles, not pixels. + * @param tileY The y coordinate, in tiles, not pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + */ + removeTileAt(tileX: number, tileY: number, replaceWithNull?: boolean, recalculateFaces?: boolean): Phaser.Tilemaps.Tile; + + /** + * Removes the tile at the given world coordinates in the specified layer and updates the layers + * collision information. + * @param worldX The x coordinate, in pixels. + * @param worldY The y coordinate, in pixels. + * @param replaceWithNull If true, this will replace the tile at the specified location with null instead of a Tile with an index of -1. Default true. + * @param recalculateFaces `true` if the faces data should be recalculated. Default true. + * @param camera The Camera to use when calculating the tile index from the world values. + */ + removeTileAtWorldXY(worldX: number, worldY: number, replaceWithNull?: boolean, recalculateFaces?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Tilemaps.Tile; + + /** + * Draws a debug representation of the layer to the given Graphics. This is helpful when you want to + * get a quick idea of which of your tiles are colliding and which have interesting faces. The tiles + * are drawn starting at (0, 0) in the Graphics, allowing you to place the debug representation + * wherever you want on the screen. + * @param graphics The target Graphics object to draw upon. + * @param styleConfig An object specifying the colors to use for the debug drawing. + */ + renderDebug(graphics: Phaser.GameObjects.Graphics, styleConfig?: Phaser.Types.Tilemaps.StyleConfig): this; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `findIndex` and updates their index to match `newIndex`. This only modifies the index and does + * not change collision information. + * @param findIndex The index of the tile to search for. + * @param newIndex The index of the tile to replace it with. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + */ + replaceByIndex(findIndex: number, newIndex: number, tileX?: number, tileY?: number, width?: number, height?: number): this; + + /** + * You can control if the Cameras should cull tiles before rendering them or not. + * + * By default the camera will try to cull the tiles in this layer, to avoid over-drawing to the renderer. + * + * However, there are some instances when you may wish to disable this. + * @param value Set to `true` to stop culling tiles. Set to `false` to enable culling again. Default true. + */ + setSkipCull(value?: boolean): this; + + /** + * When a Camera culls the tiles in this layer it does so using its view into the world, building up a + * rectangle inside which the tiles must exist or they will be culled. Sometimes you may need to expand the size + * of this 'cull rectangle', especially if you plan on rotating the Camera viewing the layer. Do so + * by providing the padding values. The values given are in tiles, not pixels. So if the tile width was 32px + * and you set `paddingX` to be 4, it would add 32px x 4 to the cull rectangle (adjusted for scale) + * @param paddingX The amount of extra horizontal tiles to add to the cull check padding. Default 1. + * @param paddingY The amount of extra vertical tiles to add to the cull check padding. Default 1. + */ + setCullPadding(paddingX?: number, paddingY?: number): this; + + /** + * Sets collision on the given tile or tiles within a layer by index. You can pass in either a + * single numeric index or an array of indexes: [2, 3, 15, 20]. The `collides` parameter controls if + * collision will be enabled (true) or disabled (false). + * @param indexes Either a single tile index, or an array of tile indexes. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + * @param updateLayer If true, updates the current tiles on the layer. Set to false if no tiles have been placed for significant performance boost. Default true. + */ + setCollision(indexes: number | any[], collides?: boolean, recalculateFaces?: boolean, updateLayer?: boolean): this; + + /** + * Sets collision on a range of tiles in a layer whose index is between the specified `start` and + * `stop` (inclusive). Calling this with a start value of 10 and a stop value of 14 would set + * collision for tiles 10, 11, 12, 13 and 14. The `collides` parameter controls if collision will be + * enabled (true) or disabled (false). + * @param start The first index of the tile to be set for collision. + * @param stop The last index of the tile to be set for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionBetween(start: number, stop: number, collides?: boolean, recalculateFaces?: boolean): this; + + /** + * Sets collision on the tiles within a layer by checking tile properties. If a tile has a property + * that matches the given properties object, its collision flag will be set. The `collides` + * parameter controls if collision will be enabled (true) or disabled (false). Passing in + * `{ collides: true }` would update the collision flag on any tiles with a "collides" property that + * has a value of true. Any tile that doesn't have "collides" set to true will be ignored. You can + * also use an array of values, e.g. `{ types: ["stone", "lava", "sand" ] }`. If a tile has a + * "types" property that matches any of those values, its collision flag will be updated. + * @param properties An object with tile properties and corresponding values that should be checked. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionByProperty(properties: object, collides?: boolean, recalculateFaces?: boolean): this; + + /** + * Sets collision on all tiles in the given layer, except for tiles that have an index specified in + * the given array. The `collides` parameter controls if collision will be enabled (true) or + * disabled (false). Tile indexes not currently in the layer are not affected. + * @param indexes An array of the tile indexes to not be counted for collision. + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionByExclusion(indexes: number[], collides?: boolean, recalculateFaces?: boolean): this; + + /** + * Sets collision on the tiles within a layer by checking each tiles collision group data + * (typically defined in Tiled within the tileset collision editor). If any objects are found within + * a tiles collision group, the tile's colliding information will be set. The `collides` parameter + * controls if collision will be enabled (true) or disabled (false). + * @param collides If true it will enable collision. If false it will clear collision. Default true. + * @param recalculateFaces Whether or not to recalculate the tile faces after the update. Default true. + */ + setCollisionFromCollisionGroup(collides?: boolean, recalculateFaces?: boolean): this; + + /** + * Sets a global collision callback for the given tile index within the layer. This will affect all + * tiles on this layer that have the same index. If a callback is already set for the tile index it + * will be replaced. Set the callback to null to remove it. If you want to set a callback for a tile + * at a specific location on the map then see setTileLocationCallback. + * @param indexes Either a single tile index, or an array of tile indexes to have a collision callback set for. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context under which the callback is called. + */ + setTileIndexCallback(indexes: number | number[], callback: Function, callbackContext: object): this; + + /** + * Sets a collision callback for the given rectangular area (in tile coordinates) within the layer. + * If a callback is already set for the tile index it will be replaced. Set the callback to null to + * remove it. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + * @param callback The callback that will be invoked when the tile is collided with. + * @param callbackContext The context, or scope, under which the callback is invoked. + */ + setTileLocationCallback(tileX?: number, tileY?: number, width?: number, height?: number, callback?: Function, callbackContext?: object): this; + + /** + * Shuffles the tiles in a rectangular region (specified in tile coordinates) within the given + * layer. It will only randomize the tiles in that area, so if they're all the same nothing will + * appear to have changed! This method only modifies tile indexes and does not change collision + * information. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + */ + shuffle(tileX?: number, tileY?: number, width?: number, height?: number): this; + + /** + * Scans the given rectangular area (given in tile coordinates) for tiles with an index matching + * `indexA` and swaps then with `indexB`. This only modifies the index and does not change collision + * information. + * @param tileA First tile index. + * @param tileB Second tile index. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. + */ + swapByIndex(tileA: number, tileB: number, tileX?: number, tileY?: number, width?: number, height?: number): this; + + /** + * Converts from tile X coordinates (tile units) to world X coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileX The x coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + */ + tileToWorldX(tileX: number, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile Y coordinates (tile units) to world Y coordinates (pixels), factoring in the + * layers position, scale and scroll. + * @param tileY The y coordinate, in tiles, not pixels. + * @param camera The Camera to use when calculating the tile index from the world values. + */ + tileToWorldY(tileY: number, camera?: Phaser.Cameras.Scene2D.Camera): number; + + /** + * Converts from tile XY coordinates (tile units) to world XY coordinates (pixels), factoring in the + * layers position, scale and scroll. This will return a new Vector2 object or update the given + * `point` object. * @param tileX The x coordinate, in tiles, not pixels. * @param tileY The y coordinate, in tiles, not pixels. * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - * @param layer The tile layer to use. If not given the current layer is used. + * @param camera The Camera to use when calculating the tile index from the world values. */ - tileToWorldXY(tileX: integer, tileY: integer, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Math.Vector2; + tileToWorldXY(tileX: number, tileY: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; /** * Randomizes the indexes of a rectangular region of tiles (in tile coordinates) within the @@ -83104,59 +92117,803 @@ declare namespace Phaser { * * The probability of any index being choose is (the index's weight) / (sum of all weights). This * method only modifies tile indexes and does not change collision information. - * - * If no layer specified, the map's current layer is used. This - * cannot be applied to StaticTilemapLayers. - * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. Default 0. - * @param width How many tiles wide from the `tileX` index the area will be. Default max width based on tileX. - * @param height How many tiles tall from the `tileY` index the area will be. Default max height based on tileY. - * @param weightedIndexes An array of objects to randomly draw from during - * randomization. They should be in the form: { index: 0, weight: 4 } or - * { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. - * @param layer The tile layer to use. If not given the current layer is used. + * @param weightedIndexes An array of objects to randomly draw from during randomization. They should be in the form: { index: 0, weight: 4 } or { index: [0, 1], weight: 4 } if you wish to draw from multiple tile indexes. + * @param tileX The left most tile index (in tile coordinates) to use as the origin of the area. + * @param tileY The top most tile index (in tile coordinates) to use as the origin of the area. + * @param width How many tiles wide from the `tileX` index the area will be. + * @param height How many tiles tall from the `tileY` index the area will be. */ - weightedRandomize(tileX?: integer, tileY?: integer, width?: integer, height?: integer, weightedIndexes?: object[], layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Tilemaps.Tilemap; + weightedRandomize(weightedIndexes: object[], tileX?: number, tileY?: number, width?: number, height?: number): this; /** * Converts from world X coordinates (pixels) to tile X coordinates (tile units), factoring in the * layers position, scale and scroll. - * - * If no layer specified, the maps current layer is used. * @param worldX The x coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - * @param layer The tile layer - * to use. If not given the current layer is used. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. */ - worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + worldToTileX(worldX: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; /** * Converts from world Y coordinates (pixels) to tile Y coordinates (tile units), factoring in the * layers position, scale and scroll. - * - * If no layer specified, the maps current layer is used. * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - * @param layer The tile layer to use. If not given the current layer is used. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. + * @param camera The Camera to use when calculating the tile index from the world values. */ - worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): number; + worldToTileY(worldY: number, snapToFloor?: boolean, camera?: Phaser.Cameras.Scene2D.Camera): number; /** * Converts from world XY coordinates (pixels) to tile XY coordinates (tile units), factoring in the * layers position, scale and scroll. This will return a new Vector2 object or update the given * `point` object. - * - * If no layer specified, the maps current layer is used. * @param worldX The x coordinate to be converted, in pixels, not tiles. * @param worldY The y coordinate to be converted, in pixels, not tiles. - * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. Default true. + * @param snapToFloor Whether or not to round the tile coordinate down to the nearest integer. * @param point A Vector2 to store the coordinates in. If not given a new Vector2 is created. - * @param camera The Camera to use when calculating the tile index from the world values. Default main camera. - * @param layer The tile layer to use. If not given the current layer is used. + * @param camera The Camera to use when calculating the tile index from the world values. */ - worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera, layer?: string | integer | Phaser.Tilemaps.DynamicTilemapLayer | Phaser.Tilemaps.StaticTilemapLayer): Phaser.Math.Vector2; + worldToTileXY(worldX: number, worldY: number, snapToFloor?: boolean, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Destroys this TilemapLayer and removes its link to the associated LayerData. + * @param removeFromTilemap Remove this layer from the parent Tilemap? Default true. + */ + destroy(removeFromTilemap?: boolean): void; + + /** + * Clears all alpha values associated with this Game Object. + * + * Immediately sets the alpha levels back to 1 (fully opaque). + */ + clearAlpha(): this; + + /** + * Set the Alpha level of this Game Object. The alpha controls the opacity of the Game Object as it renders. + * Alpha values are provided as a float between 0, fully transparent, and 1, fully opaque. + * + * If your game is running under WebGL you can optionally specify four different alpha values, each of which + * correspond to the four corners of the Game Object. Under Canvas only the `topLeft` value given is used. + * @param topLeft The alpha value used for the top-left of the Game Object. If this is the only value given it's applied across the whole Game Object. Default 1. + * @param topRight The alpha value used for the top-right of the Game Object. WebGL only. + * @param bottomLeft The alpha value used for the bottom-left of the Game Object. WebGL only. + * @param bottomRight The alpha value used for the bottom-right of the Game Object. WebGL only. + */ + setAlpha(topLeft?: number, topRight?: number, bottomLeft?: number, bottomRight?: number): this; + + /** + * The alpha value of the Game Object. + * + * This is a global value, impacting the entire Game Object, not just a region of it. + */ + alpha: number; + + /** + * The alpha value starting from the top-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopLeft: number; + + /** + * The alpha value starting from the top-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaTopRight: number; + + /** + * The alpha value starting from the bottom-left of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomLeft: number; + + /** + * The alpha value starting from the bottom-right of the Game Object. + * This value is interpolated from the corner to the center of the Game Object. + */ + alphaBottomRight: number; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency of which blend modes + * are used. + */ + blendMode: Phaser.BlendModes | string; + + /** + * Sets the Blend Mode being used by this Game Object. + * + * This can be a const, such as `Phaser.BlendModes.SCREEN`, or an integer, such as 4 (for Overlay) + * + * Under WebGL only the following Blend Modes are available: + * + * * ADD + * * MULTIPLY + * * SCREEN + * * ERASE (only works when rendering to a framebuffer, like a Render Texture) + * + * Canvas has more available depending on browser support. + * + * You can also create your own custom Blend Modes in WebGL. + * + * Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending + * on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these + * reasons try to be careful about the construction of your Scene and the frequency in which blend modes + * are used. + * @param value The BlendMode value. Either a string or a CONST. + */ + setBlendMode(value: string | Phaser.BlendModes): this; + + /** + * The native (un-scaled) width of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayWidth` property. + */ + width: number; + + /** + * The native (un-scaled) height of this Game Object. + * + * Changing this value will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or use + * the `displayHeight` property. + */ + height: number; + + /** + * The displayed width of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayWidth: number; + + /** + * The displayed height of this Game Object. + * + * This value takes into account the scale factor. + * + * Setting this value will adjust the Game Object's scale property. + */ + displayHeight: number; + + /** + * Sets the internal size of this Game Object, as used for frame or physics body creation. + * + * This will not change the size that the Game Object is rendered in-game. + * For that you need to either set the scale of the Game Object (`setScale`) or call the + * `setDisplaySize` method, which is the same thing as changing the scale but allows you + * to do so by giving pixel values. + * + * If you have enabled this Game Object for input, changing the size will _not_ change the + * size of the hit area. To do this you should adjust the `input.hitArea` object directly. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setSize(width: number, height: number): this; + + /** + * Sets the display size of this Game Object. + * + * Calling this will adjust the scale. + * @param width The width of this Game Object. + * @param height The height of this Game Object. + */ + setDisplaySize(width: number, height: number): this; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + */ + depth: number; + + /** + * The depth of this Game Object within the Scene. + * + * The depth is also known as the 'z-index' in some environments, and allows you to change the rendering order + * of Game Objects, without actually moving their position in the display list. + * + * The default depth is zero. A Game Object with a higher depth + * value will always render in front of one with a lower value. + * + * Setting the depth will queue a depth sort event within the Scene. + * @param value The depth of this Game Object. + */ + setDepth(value: number): this; + + /** + * The horizontally flipped state of the Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipX: boolean; + + /** + * The vertically flipped state of the Game Object. + * + * A Game Object that is flipped vertically will render inversed on the vertical axis (i.e. upside down) + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + flipY: boolean; + + /** + * Toggles the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + */ + toggleFlipX(): this; + + /** + * Toggles the vertical flipped state of this Game Object. + */ + toggleFlipY(): this; + + /** + * Sets the horizontal flipped state of this Game Object. + * + * A Game Object that is flipped horizontally will render inversed on the horizontal axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipX(value: boolean): this; + + /** + * Sets the vertical flipped state of this Game Object. + * @param value The flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlipY(value: boolean): this; + + /** + * Sets the horizontal and vertical flipped state of this Game Object. + * + * A Game Object that is flipped will render inversed on the flipped axis. + * Flipping always takes place from the middle of the texture and does not impact the scale value. + * If this Game Object has a physics body, it will not change the body. This is a rendering toggle only. + * @param x The horizontal flipped state. `false` for no flip, or `true` to be flipped. + * @param y The horizontal flipped state. `false` for no flip, or `true` to be flipped. + */ + setFlip(x: boolean, y: boolean): this; + + /** + * Resets the horizontal and vertical flipped state of this Game Object back to their default un-flipped state. + */ + resetFlip(): this; + + /** + * Gets the center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + */ + getCenter(output?: O): O; + + /** + * Gets the top-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the top-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getTopRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the left-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getLeftCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the right-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getRightCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-left corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomLeft(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-center coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomCenter(output?: O, includeParent?: boolean): O; + + /** + * Gets the bottom-right corner coordinate of this Game Object, regardless of origin. + * The returned point is calculated in local space and does not factor in any parent containers + * @param output An object to store the values in. If not provided a new Vector2 will be created. + * @param includeParent If this Game Object has a parent Container, include it (and all other ancestors) in the resulting vector? Default false. + */ + getBottomRight(output?: O, includeParent?: boolean): O; + + /** + * Gets the bounds of this Game Object, regardless of origin. + * The values are stored and returned in a Rectangle, or Rectangle-like, object. + * @param output An object to store the values in. If not provided a new Rectangle will be created. + */ + getBounds(output?: O): O; + + /** + * The horizontal origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the left of the Game Object. + */ + originX: number; + + /** + * The vertical origin of this Game Object. + * The origin maps the relationship between the size and position of the Game Object. + * The default value is 0.5, meaning all Game Objects are positioned based on their center. + * Setting the value to 0 means the position now relates to the top of the Game Object. + */ + originY: number; + + /** + * The horizontal display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginX: number; + + /** + * The vertical display origin of this Game Object. + * The origin is a normalized value between 0 and 1. + * The displayOrigin is a pixel value, based on the size of the Game Object combined with the origin. + */ + displayOriginY: number; + + /** + * Sets the origin of this Game Object. + * + * The values are given in the range 0 to 1. + * @param x The horizontal origin value. Default 0.5. + * @param y The vertical origin value. If not defined it will be set to the value of `x`. Default x. + */ + setOrigin(x?: number, y?: number): this; + + /** + * Sets the origin of this Game Object based on the Pivot values in its Frame. + */ + setOriginFromFrame(): this; + + /** + * Sets the display origin of this Game Object. + * The difference between this and setting the origin is that you can use pixel values for setting the display origin. + * @param x The horizontal display origin value. Default 0. + * @param y The vertical display origin value. If not defined it will be set to the value of `x`. Default x. + */ + setDisplayOrigin(x?: number, y?: number): this; + + /** + * Updates the Display Origin cached values internally stored on this Game Object. + * You don't usually call this directly, but it is exposed for edge-cases where you may. + */ + updateDisplayOrigin(): this; + + /** + * The initial WebGL pipeline of this Game Object. + * + * If you call `resetPipeline` on this Game Object, the pipeline is reset to this default. + */ + defaultPipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * The current WebGL pipeline of this Game Object. + */ + pipeline: Phaser.Renderer.WebGL.WebGLPipeline; + + /** + * Does this Game Object have any Post Pipelines set? + */ + hasPostPipeline: boolean; + + /** + * The WebGL Post FX Pipelines this Game Object uses for post-render effects. + * + * The pipelines are processed in the order in which they appear in this array. + * + * If you modify this array directly, be sure to set the + * `hasPostPipeline` property accordingly. + */ + postPipeline: Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[]; + + /** + * An object to store pipeline specific data in, to be read by the pipelines this Game Object uses. + */ + pipelineData: object; + + /** + * Sets the initial WebGL Pipeline of this Game Object. + * + * This should only be called during the instantiation of the Game Object. After that, use `setPipeline`. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + */ + initPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline): boolean; + + /** + * Sets the main WebGL Pipeline of this Game Object. + * + * Also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the same pipeline data object. + * @param pipeline Either the string-based name of the pipeline, or a pipeline instance to set. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPipeline(pipeline: string | Phaser.Renderer.WebGL.WebGLPipeline, pipelineData?: object, copyData?: boolean): this; + + /** + * Sets one, or more, Post Pipelines on this Game Object. + * + * Post Pipelines are invoked after this Game Object has rendered to its target and + * are commonly used for post-fx. + * + * The post pipelines are appended to the `postPipelines` array belonging to this + * Game Object. When the renderer processes this Game Object, it iterates through the post + * pipelines in the order in which they appear in the array. If you are stacking together + * multiple effects, be aware that the order is important. + * + * If you call this method multiple times, the new pipelines will be appended to any existing + * post pipelines already set. Use the `resetPostPipeline` method to clear them first, if required. + * + * You can optionally also sets the `pipelineData` property, if the parameter is given. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param pipelines Either the string-based name of the pipeline, or a pipeline instance, or class, or an array of them. + * @param pipelineData Optional pipeline data object that is _deep copied_ into the `pipelineData` property of this Game Object. + * @param copyData Should the pipeline data object be _deep copied_ into the `pipelineData` property of this Game Object? If `false` it will be set by reference instead. Default true. + */ + setPostPipeline(pipelines: string | string[] | Function | Function[] | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline[], pipelineData?: object, copyData?: boolean): this; + + /** + * Adds an entry to the `pipelineData` object belonging to this Game Object. + * + * If the 'key' already exists, its value is updated. If it doesn't exist, it is created. + * + * If `value` is undefined, and `key` exists, `key` is removed from the data object. + * + * Both the pipeline and post pipelines share the pipeline data object together. + * @param key The key of the pipeline data to set, update, or delete. + * @param value The value to be set with the key. If `undefined` then `key` will be deleted from the object. + */ + setPipelineData(key: string, value?: any): this; + + /** + * Gets a Post Pipeline instance from this Game Object, based on the given name, and returns it. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + getPostPipeline(pipeline: string | Function | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): Phaser.Renderer.WebGL.Pipelines.PostFXPipeline; + + /** + * Resets the WebGL Pipeline of this Game Object back to the default it was created with. + * @param resetPostPipelines Reset all of the post pipelines? Default false. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPipeline(resetPostPipelines?: boolean, resetData?: boolean): boolean; + + /** + * Resets the WebGL Post Pipelines of this Game Object. It does this by calling + * the `destroy` method on each post pipeline and then clearing the local array. + * @param resetData Reset the `pipelineData` object to being an empty object? Default false. + */ + resetPostPipeline(resetData?: boolean): void; + + /** + * Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it. + * + * If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead. + * @param pipeline The string-based name of the pipeline, or a pipeline class. + */ + removePostPipeline(pipeline: string | Phaser.Renderer.WebGL.Pipelines.PostFXPipeline): this; + + /** + * Gets the name of the WebGL Pipeline this Game Object is currently using. + */ + getPipelineName(): string; + + /** + * The horizontal scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorX: number; + + /** + * The vertical scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + */ + scrollFactorY: number; + + /** + * Sets the scroll factor of this Game Object. + * + * The scroll factor controls the influence of the movement of a Camera upon this Game Object. + * + * When a camera scrolls it will change the location at which this Game Object is rendered on-screen. + * It does not change the Game Objects actual position values. + * + * A value of 1 means it will move exactly in sync with a camera. + * A value of 0 means it will not move at all, even if the camera moves. + * Other values control the degree to which the camera movement is mapped to this Game Object. + * + * Please be aware that scroll factor values other than 1 are not taken in to consideration when + * calculating physics collisions. Bodies always collide based on their world position, but changing + * the scroll factor is a visual adjustment to where the textures are rendered, which can offset + * them from physics bodies if not accounted for in your code. + * @param x The horizontal scroll factor of this Game Object. + * @param y The vertical scroll factor of this Game Object. If not set it will use the `x` value. Default x. + */ + setScrollFactor(x: number, y?: number): this; + + /** + * The x position of this Game Object. + */ + x: number; + + /** + * The y position of this Game Object. + */ + y: number; + + /** + * The z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#depth} instead. + */ + z: number; + + /** + * The w position of this Game Object. + */ + w: number; + + /** + * This is a special setter that allows you to set both the horizontal and vertical scale of this Game Object + * to the same value, at the same time. When reading this value the result returned is `(scaleX + scaleY) / 2`. + * + * Use of this property implies you wish the horizontal and vertical scales to be equal to each other. If this + * isn't the case, use the `scaleX` or `scaleY` properties instead. + */ + scale: number; + + /** + * The horizontal scale of this Game Object. + */ + scaleX: number; + + /** + * The vertical scale of this Game Object. + */ + scaleY: number; + + /** + * The angle of this Game Object as expressed in degrees. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left + * and -90 is up. + * + * If you prefer to work in radians, see the `rotation` property instead. + */ + angle: number; + + /** + * The angle of this Game Object in radians. + * + * Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left + * and -PI/2 is up. + * + * If you prefer to work in degrees, see the `angle` property instead. + */ + rotation: number; + + /** + * Sets the position of this Game Object. + * @param x The x position of this Game Object. Default 0. + * @param y The y position of this Game Object. If not set it will use the `x` value. Default x. + * @param z The z position of this Game Object. Default 0. + * @param w The w position of this Game Object. Default 0. + */ + setPosition(x?: number, y?: number, z?: number, w?: number): this; + + /** + * Copies an object's coordinates to this Game Object's position. + * @param source An object with numeric 'x', 'y', 'z', or 'w' properties. Undefined values are not copied. + */ + copyPosition(source: Phaser.Types.Math.Vector2Like | Phaser.Types.Math.Vector3Like | Phaser.Types.Math.Vector4Like): this; + + /** + * Sets the position of this Game Object to be a random position within the confines of + * the given area. + * + * If no area is specified a random position between 0 x 0 and the game width x height is used instead. + * + * The position does not factor in the size of this Game Object, meaning that only the origin is + * guaranteed to be within the area. + * @param x The x position of the top-left of the random area. Default 0. + * @param y The y position of the top-left of the random area. Default 0. + * @param width The width of the random area. + * @param height The height of the random area. + */ + setRandomPosition(x?: number, y?: number, width?: number, height?: number): this; + + /** + * Sets the rotation of this Game Object. + * @param radians The rotation of this Game Object, in radians. Default 0. + */ + setRotation(radians?: number): this; + + /** + * Sets the angle of this Game Object. + * @param degrees The rotation of this Game Object, in degrees. Default 0. + */ + setAngle(degrees?: number): this; + + /** + * Sets the scale of this Game Object. + * @param x The horizontal scale of this Game Object. + * @param y The vertical scale of this Game Object. If not set it will use the `x` value. Default x. + */ + setScale(x: number, y?: number): this; + + /** + * Sets the x position of this Game Object. + * @param value The x position of this Game Object. Default 0. + */ + setX(value?: number): this; + + /** + * Sets the y position of this Game Object. + * @param value The y position of this Game Object. Default 0. + */ + setY(value?: number): this; + + /** + * Sets the z position of this Game Object. + * + * Note: The z position does not control the rendering order of 2D Game Objects. Use + * {@link Phaser.GameObjects.Components.Depth#setDepth} instead. + * @param value The z position of this Game Object. Default 0. + */ + setZ(value?: number): this; + + /** + * Sets the w position of this Game Object. + * @param value The w position of this Game Object. Default 0. + */ + setW(value?: number): this; + + /** + * Gets the local transform matrix for this Game Object. + * @param tempMatrix The matrix to populate with the values from this Game Object. + */ + getLocalTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Gets the world transform matrix for this Game Object, factoring in any parent Containers. + * @param tempMatrix The matrix to populate with the values from this Game Object. + * @param parentMatrix A temporary matrix to hold parent values during the calculations. + */ + getWorldTransformMatrix(tempMatrix?: Phaser.GameObjects.Components.TransformMatrix, parentMatrix?: Phaser.GameObjects.Components.TransformMatrix): Phaser.GameObjects.Components.TransformMatrix; + + /** + * Takes the given `x` and `y` coordinates and converts them into local space for this + * Game Object, taking into account parent and local transforms, and the Display Origin. + * + * The returned Vector2 contains the translated point in its properties. + * + * A Camera needs to be provided in order to handle modified scroll factors. If no + * camera is specified, it will use the `main` camera from the Scene to which this + * Game Object belongs. + * @param x The x position to translate. + * @param y The y position to translate. + * @param point A Vector2, or point-like object, to store the results in. + * @param camera The Camera which is being tested against. If not given will use the Scene default camera. + */ + getLocalPoint(x: number, y: number, point?: Phaser.Math.Vector2, camera?: Phaser.Cameras.Scene2D.Camera): Phaser.Math.Vector2; + + /** + * Gets the sum total rotation of all of this Game Objects parent Containers. + * + * The returned value is in radians and will be zero if this Game Object has no parent container. + */ + getParentRotation(): number; + + /** + * The visible state of the Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + */ + visible: boolean; + + /** + * Sets the visibility of this Game Object. + * + * An invisible Game Object will skip rendering, but will still process update logic. + * @param value The visible state of the Game Object. + */ + setVisible(value: boolean): this; } @@ -83178,7 +92935,7 @@ declare namespace Phaser { * @param tileData Data stored per tile. These typically are created in Tiled * when editing a tileset, e.g. from Tiled's tile collision editor or terrain editor. Default {}. */ - constructor(name: string, firstgid: integer, tileWidth?: integer, tileHeight?: integer, tileMargin?: integer, tileSpacing?: integer, tileProperties?: object, tileData?: object); + constructor(name: string, firstgid: number, tileWidth?: number, tileHeight?: number, tileMargin?: number, tileSpacing?: number, tileProperties?: object, tileData?: object); /** * The name of the Tileset. @@ -83188,27 +92945,27 @@ declare namespace Phaser { /** * The starting index of the first tile index this Tileset contains. */ - firstgid: integer; + firstgid: number; /** * The width of each tile (in pixels). Use setTileSize to change. */ - readonly tileWidth: integer; + readonly tileWidth: number; /** * The height of each tile (in pixels). Use setTileSize to change. */ - readonly tileHeight: integer; + readonly tileHeight: number; /** * The margin around the tiles in the sheet (in pixels). Use `setSpacing` to change. */ - readonly tileMargin: integer; + readonly tileMargin: number; /** * The spacing between each the tile in the sheet (in pixels). Use `setSpacing` to change. */ - readonly tileSpacing: integer; + readonly tileSpacing: number; /** * Tileset-specific properties per tile that are typically defined in the Tiled editor in the @@ -83235,17 +92992,17 @@ declare namespace Phaser { /** * The number of tile rows in the the tileset. */ - readonly rows: integer; + readonly rows: number; /** * The number of tile columns in the tileset. */ - readonly columns: integer; + readonly columns: number; /** * The total number of tiles in the tileset. */ - readonly total: integer; + readonly total: number; /** * The look-up table to specific tile image texture coordinates (UV in pixels). Each element @@ -83258,7 +93015,7 @@ declare namespace Phaser { * contained in this Tileset. This is typically defined in Tiled under the Tileset editor. * @param tileIndex The unique id of the tile across all tilesets in the map. */ - getTileProperties(tileIndex: integer): object | undefined; + getTileProperties(tileIndex: number): object | undefined; /** * Get a tile's data that is stored in the Tileset. Returns null if tile index is not contained @@ -83266,27 +93023,27 @@ declare namespace Phaser { * info and terrain mapping. * @param tileIndex The unique id of the tile across all tilesets in the map. */ - getTileData(tileIndex: integer): object | undefined; + getTileData(tileIndex: number): object | undefined; /** * Get a tile's collision group that is stored in the Tileset. Returns null if tile index is not * contained in this Tileset. This is typically defined within Tiled's tileset collision editor. * @param tileIndex The unique id of the tile across all tilesets in the map. */ - getTileCollisionGroup(tileIndex: integer): object; + getTileCollisionGroup(tileIndex: number): object; /** * Returns true if and only if this Tileset contains the given tile index. * @param tileIndex The unique id of the tile across all tilesets in the map. */ - containsTileIndex(tileIndex: integer): boolean; + containsTileIndex(tileIndex: number): boolean; /** * Returns the texture coordinates (UV in pixels) in the Tileset image for the given tile index. * Returns null if tile index is not contained in this Tileset. * @param tileIndex The unique id of the tile across all tilesets in the map. */ - getTileTextureCoordinates(tileIndex: integer): object; + getTileTextureCoordinates(tileIndex: number): object; /** * Sets the image associated with this Tileset and updates the tile data (rows, columns, etc.). @@ -83299,24 +93056,44 @@ declare namespace Phaser { * @param tileWidth The width of a tile in pixels. * @param tileHeight The height of a tile in pixels. */ - setTileSize(tileWidth?: integer, tileHeight?: integer): Phaser.Tilemaps.Tileset; + setTileSize(tileWidth?: number, tileHeight?: number): Phaser.Tilemaps.Tileset; /** * Sets the tile margin & spacing and updates the tile data (rows, columns, etc.). * @param margin The margin around the tiles in the sheet (in pixels). * @param spacing The spacing between the tiles in the sheet (in pixels). */ - setSpacing(margin?: integer, spacing?: integer): Phaser.Tilemaps.Tileset; + setSpacing(margin?: number, spacing?: number): Phaser.Tilemaps.Tileset; /** * Updates tile texture coordinates and tileset data. * @param imageWidth The (expected) width of the image to slice. * @param imageHeight The (expected) height of the image to slice. */ - updateTileData(imageWidth: integer, imageHeight: integer): Phaser.Tilemaps.Tileset; + updateTileData(imageWidth: number, imageHeight: number): Phaser.Tilemaps.Tileset; } + /** + * Orthogonal Tilemap orientation constant. + */ + const ORTHOGONAL: number; + + /** + * Isometric Tilemap orientation constant. + */ + const ISOMETRIC: number; + + /** + * Staggered Tilemap orientation constant. + */ + const STAGGERED: number; + + /** + * Hexagonal Tilemap orientation constant. + */ + const HEXAGONAL: number; + } namespace Time { @@ -83363,9 +93140,14 @@ declare namespace Phaser { /** * Creates a Timer Event and adds it to the Clock at the start of the frame. - * @param config The configuration for the Timer Event. + * + * You can also pass in an existing Timer Event, which will be reset and added to this Clock. + * + * Note that if the Timer Event is being used by _another_ Clock (in another Scene) it will still + * be updated by that Clock as well, so be careful when using this feature. + * @param config The configuration for the Timer Event, or an existing Timer Event object. */ - addEvent(config: Phaser.Types.Time.TimerEventConfig): Phaser.Time.TimerEvent; + addEvent(config: Phaser.Time.TimerEvent | Phaser.Types.Time.TimerEventConfig): Phaser.Time.TimerEvent; /** * Creates a Timer Event and adds it to the Clock at the start of the frame. @@ -83381,12 +93163,21 @@ declare namespace Phaser { /** * Clears and recreates the array of pending Timer Events. */ - clearPendingEvents(): Phaser.Time.Clock; + clearPendingEvents(): this; + + /** + * Removes the given Timer Event, or an array of Timer Events, from this Clock. + * + * The events are removed from all internal lists (active, pending and removal), + * freeing the event up to be re-used. + * @param events The Timer Event, or an array of Timer Events, to remove from this Clock. + */ + removeEvent(events: Phaser.Time.TimerEvent | Phaser.Time.TimerEvent[]): this; /** * Schedules all active Timer Events for removal at the start of the frame. */ - removeAllEvents(): Phaser.Time.Clock; + removeAllEvents(): this; /** * Updates the arrays of active and pending Timer Events. Called at the start of the frame. @@ -83513,6 +93304,26 @@ declare namespace Phaser { */ getElapsedSeconds(): number; + /** + * Returns the time interval until the next iteration of the Timer Event. + */ + getRemaining(): number; + + /** + * Returns the time interval until the next iteration of the Timer Event in seconds. + */ + getRemainingSeconds(): number; + + /** + * Returns the time interval until the last iteration of the Timer Event. + */ + getOverallRemaining(): number; + + /** + * Returns the time interval until the last iteration of the Timer Event in seconds. + */ + getOverallRemainingSeconds(): number; + /** * Forces the Timer Event to immediately expire, thus scheduling its removal in the next frame. * @param dispatchCallback If `true`, the function of the Timer Event will be called before its removal. Default false. @@ -84063,7 +93874,7 @@ declare namespace Phaser { /** * The current state of the Timeline. */ - state: integer; + state: number; /** * Does the Timeline start off paused? (if so it needs to be started with Timeline.play) @@ -84276,87 +94087,87 @@ declare namespace Phaser { /** * TweenData state. */ - var CREATED: integer; + var CREATED: number; /** * TweenData state. */ - var INIT: integer; + var INIT: number; /** * TweenData state. */ - var DELAY: integer; + var DELAY: number; /** * TweenData state. */ - var OFFSET_DELAY: integer; + var OFFSET_DELAY: number; /** * TweenData state. */ - var PENDING_RENDER: integer; + var PENDING_RENDER: number; /** * TweenData state. */ - var PLAYING_FORWARD: integer; + var PLAYING_FORWARD: number; /** * TweenData state. */ - var PLAYING_BACKWARD: integer; + var PLAYING_BACKWARD: number; /** * TweenData state. */ - var HOLD_DELAY: integer; + var HOLD_DELAY: number; /** * TweenData state. */ - var REPEAT_DELAY: integer; + var REPEAT_DELAY: number; /** * TweenData state. */ - var COMPLETE: integer; + var COMPLETE: number; /** * Tween state. */ - var PENDING_ADD: integer; + var PENDING_ADD: number; /** * Tween state. */ - var PAUSED: integer; + var PAUSED: number; /** * Tween state. */ - var LOOP_DELAY: integer; + var LOOP_DELAY: number; /** * Tween state. */ - var ACTIVE: integer; + var ACTIVE: number; /** * Tween state. */ - var COMPLETE_DELAY: integer; + var COMPLETE_DELAY: number; /** * Tween state. */ - var PENDING_REMOVE: integer; + var PENDING_REMOVE: number; /** * Tween state. */ - var REMOVED: integer; + var REMOVED: number; /** * A Tween is able to manipulate the properties of one or more objects to any given value, based @@ -84391,7 +94202,7 @@ declare namespace Phaser { /** * The cached length of the data array. */ - totalData: integer; + totalData: number; /** * An array of references to the target/s this Tween is operating on. @@ -84401,7 +94212,7 @@ declare namespace Phaser { /** * Cached target total (not necessarily the same as the data total) */ - totalTargets: integer; + totalTargets: number; /** * If `true` then duration, delay, etc values are all frame totals. @@ -84472,7 +94283,7 @@ declare namespace Phaser { /** * The current state of the tween */ - state: integer; + state: number; /** * Does the Tween start off paused? (if so it needs to be started with Tween.play) @@ -84533,7 +94344,7 @@ declare namespace Phaser { * Returns the current value of the specified Tween Data. * @param index The Tween Data to return the value from. Default 0. */ - getValue(index?: integer): number; + getValue(index?: number): number; /** * Set the scale the time applied to this Tween. A value of 1 runs in real-time. A value of 0.5 runs 50% slower, and so on. @@ -84634,7 +94445,8 @@ declare namespace Phaser { /** * Seeks to a specific point in the Tween. * - * **Note:** You cannot seek a Tween that repeats or loops forever, or that has an unusually long total duration. + * **Note:** Be careful when seeking a Tween that repeats or loops forever, + * or that has an unusually long total duration, as it's possible to hang the browser. * * The given position is a value between 0 and 1 which represents how far through the Tween to seek to. * A value of 0.5 would seek to half-way through the Tween, where-as a value of zero would seek to the start. @@ -84725,7 +94537,7 @@ declare namespace Phaser { * @param tweenData The TweenData property to update. * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. */ - setStateFromEnd(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): integer; + setStateFromEnd(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): number; /** * Internal method used as part of the playback process that sets a tween to play from the start. @@ -84733,7 +94545,7 @@ declare namespace Phaser { * @param tweenData The TweenData property to update. * @param diff Any extra time that needs to be accounted for in the elapsed and progress values. */ - setStateFromStart(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): integer; + setStateFromStart(tween: Phaser.Tweens.Tween, tweenData: Phaser.Types.Tweens.TweenDataConfig, diff: number): number; /** * Internal method that advances the TweenData based on the time value given. @@ -84767,7 +94579,7 @@ declare namespace Phaser { * @param flipX Should toggleFlipX be called when yoyo or repeat happens? * @param flipY Should toggleFlipY be called when yoyo or repeat happens? */ - function TweenData(target: any, index: integer, key: string, getEnd: Function, getStart: Function, getActive: Function, ease: Function, delay: number, duration: number, yoyo: boolean, hold: number, repeat: number, repeatDelay: number, flipX: boolean, flipY: boolean): Phaser.Types.Tweens.TweenDataConfig; + function TweenData(target: any, index: number, key: string, getEnd: Function, getStart: Function, getActive: Function, ease: Function, delay: number, duration: number, yoyo: boolean, hold: number, repeat: number, repeatDelay: number, flipX: boolean, flipY: boolean): Phaser.Types.Tweens.TweenDataConfig; /** * The Tween Manager is a default Scene Plugin which controls and updates Tweens and Timelines. @@ -84915,9 +94727,15 @@ declare namespace Phaser { /** * Returns an array of all Tweens or Timelines in the Tween Manager which affect the given target or array of targets. + * + * Only the currently active tweens are tested. A tween that has completed and is + * awaiting removal will not be included in the results. + * + * If you wish to also search pending tweens, use the `includePending` flag. * @param target The target to look for. Provide an array to look for multiple targets. + * @param includePending Also check for pending tweens, not just active ones? Default false. */ - getTweensOf(target: object | any[]): Phaser.Tweens.Tween[]; + getTweensOf(target: object | any[], includePending?: boolean): Phaser.Tweens.Tween[]; /** * Checks if the given object is being affected by a playing Tween. @@ -84989,7 +94807,7 @@ declare namespace Phaser { * @param callback A callback to be invoked for each item successfully added to the array. * @param context The context in which the callback is invoked. */ - function Add(array: any[], item: any | any[], limit?: integer, callback?: Function, context?: object): any[]; + function Add(array: any[], item: any | any[], limit?: number, callback?: Function, context?: object): any[]; /** * Adds the given item, or array of items, to the array starting at the index specified. @@ -85011,7 +94829,7 @@ declare namespace Phaser { * @param callback A callback to be invoked for each item successfully added to the array. * @param context The context in which the callback is invoked. */ - function AddAt(array: any[], item: any | any[], index?: integer, limit?: integer, callback?: Function, context?: object): any[]; + function AddAt(array: any[], item: any | any[], index?: number, limit?: number, callback?: Function, context?: object): any[]; /** * Moves the given element to the top of the array. @@ -85029,7 +94847,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. * @param endIndex An optional end index to search to. */ - function CountAllMatching(array: any[], property: string, value: any, startIndex?: integer, endIndex?: integer): integer; + function CountAllMatching(array: any[], property: string, value: any, startIndex?: number, endIndex?: number): number; /** * Passes each element in the array to the given callback. @@ -85049,7 +94867,7 @@ declare namespace Phaser { * @param endIndex The end index to search to. * @param args Additional arguments that will be passed to the callback, after the child. */ - function EachInRange(array: any[], callback: Function, context: object, startIndex: integer, endIndex: integer, ...args: any[]): any[]; + function EachInRange(array: any[], callback: Function, context: object, startIndex: number, endIndex: number, ...args: any[]): any[]; /** * Searches a pre-sorted array for the closet value to the given number. @@ -85078,7 +94896,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. * @param endIndex An optional end index to search to. */ - function GetAll(array: any[], property?: string, value?: any, startIndex?: integer, endIndex?: integer): any[]; + function GetAll(array: any[], property?: string, value?: any, startIndex?: number, endIndex?: number): any[]; /** * Returns the first element in the array. @@ -85095,7 +94913,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. Default 0. * @param endIndex An optional end index to search up to (but not included) Default array.length. */ - function GetFirst(array: any[], property?: string, value?: any, startIndex?: integer, endIndex?: integer): object; + function GetFirst(array: any[], property?: string, value?: any, startIndex?: number, endIndex?: number): object; /** * Returns a Random element from the array. @@ -85103,23 +94921,24 @@ declare namespace Phaser { * @param startIndex An optional start index. Default 0. * @param length An optional length, the total number of elements (from the startIndex) to choose from. Default array.length. */ - function GetRandom(array: any[], startIndex?: integer, length?: integer): any; + function GetRandom(array: any[], startIndex?: number, length?: number): any; namespace Matrix { /** * Checks if an array can be used as a matrix. * - * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) have the same length. There must be at least two rows: + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: * * ``` - * [ - * [ 1, 1, 1, 1, 1, 1 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 2, 0, 1, 2, 0, 4 ], - * [ 2, 0, 3, 4, 0, 4 ], - * [ 2, 0, 0, 0, 0, 4 ], - * [ 3, 3, 3, 3, 3, 3 ] - * ] + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] * ``` * @param matrix The array to check. */ @@ -85127,30 +94946,100 @@ declare namespace Phaser { /** * Generates a string (which you can pass to console.log) from the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param matrix A 2-dimensional array. */ function MatrixToString(matrix?: T[][]): string; /** * Reverses the columns in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param matrix The array matrix to reverse the columns for. */ function ReverseColumns(matrix?: T[][]): T[][]; /** * Reverses the rows in the given Array Matrix. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param matrix The array matrix to reverse the rows for. */ function ReverseRows(matrix?: T[][]): T[][]; /** * Rotates the array matrix 180 degrees. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param matrix The array to rotate. */ function Rotate180(matrix?: T[][]): T[][]; /** * Rotates the array matrix to the left (or 90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param matrix The array to rotate. */ function RotateLeft(matrix?: T[][]): T[][]; @@ -85162,6 +95051,20 @@ declare namespace Phaser { * or a string command: `rotateLeft`, `rotateRight` or `rotate180`. * * Based on the routine from {@link http://jsfiddle.net/MrPolywhirl/NH42z/}. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param matrix The array to rotate. * @param direction The amount to rotate the matrix by. Default 90. */ @@ -85169,14 +95072,65 @@ declare namespace Phaser { /** * Rotates the array matrix to the left (or -90 degrees) + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param matrix The array to rotate. */ function RotateRight(matrix?: T[][]): T[][]; + /** + * Translates the given Array Matrix by shifting each column and row the + * amount specified. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` + * @param matrix The array matrix to translate. + * @param x The amount to horizontally translate the matrix by. Default 0. + * @param y The amount to vertically translate the matrix by. Default 0. + */ + function Translate(matrix?: T[][], x?: number, y?: number): T[][]; + /** * Transposes the elements of the given matrix (array of arrays). * * The transpose of a matrix is a new matrix whose rows are the columns of the original. + * + * A matrix is a two-dimensional array (array of arrays), where all sub-arrays (rows) + * have the same length. There must be at least two rows. This is an example matrix: + * + * ``` + * [ + * [ 1, 1, 1, 1, 1, 1 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 2, 0, 1, 2, 0, 4 ], + * [ 2, 0, 3, 4, 0, 4 ], + * [ 2, 0, 0, 0, 0, 4 ], + * [ 3, 3, 3, 3, 3, 3 ] + * ] + * ``` * @param array The array matrix to transpose. */ function TransposeMatrix(array?: T[][]): T[][]; @@ -85198,7 +95152,7 @@ declare namespace Phaser { * @param item The element to move. * @param index The new index that the element will be moved to. */ - function MoveTo(array: any[], item: any, index: integer): any; + function MoveTo(array: any[], item: any, index: number): any; /** * Moves the given array element up one place in the array. @@ -85212,16 +95166,17 @@ declare namespace Phaser { * Create an array representing the range of numbers (usually integers), between, and inclusive of, * the given `start` and `end` arguments. For example: * - * `var array = numberArray(2, 4); // array = [2, 3, 4]` - * `var array = numberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(2, 4); // array = [2, 3, 4]` + * `var array = Phaser.Utils.Array.NumberArray(0, 9); // array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]` + * `var array = Phaser.Utils.Array.NumberArray(8, 2); // array = [8, 7, 6, 5, 4, 3, 2]` * - * This is equivalent to `numberArrayStep(start, end, 1)`. + * This is equivalent to `Phaser.Utils.Array.NumberArrayStep(start, end, 1)`. * * You can optionally provide a prefix and / or suffix string. If given the array will contain * strings, not integers. For example: * - * `var array = numberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` - * `var array = numberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` + * `var array = Phaser.Utils.Array.NumberArray(1, 4, 'Level '); // array = ["Level 1", "Level 2", "Level 3", "Level 4"]` + * `var array = Phaser.Utils.Array.NumberArray(5, 7, 'HD-', '.png'); // array = ["HD-5.png", "HD-6.png", "HD-7.png"]` * @param start The minimum value the array starts with. * @param end The maximum value the array contains. * @param prefix Optional prefix to place before the number. If provided the array will contain strings, not integers. @@ -85258,7 +95213,7 @@ declare namespace Phaser { * @param right The index of the right part of the range. * @param compare An optional comparison function. Is passed two elements and should return 0, 1 or -1. */ - function QuickSelect(arr: any[], k: integer, left?: integer, right?: integer, compare?: Function): void; + function QuickSelect(arr: any[], k: number, left?: number, right?: number, compare?: Function): void; /** * Creates an array populated with a range of values, based on the given arguments and configuration object. @@ -85320,7 +95275,7 @@ declare namespace Phaser { * @param callback A callback to be invoked for the item removed from the array. * @param context The context in which the callback is invoked. */ - function RemoveAt(array: any[], index: integer, callback?: Function, context?: object): any; + function RemoveAt(array: any[], index: number, callback?: Function, context?: object): any; /** * Removes the item within the given range in the array. @@ -85334,7 +95289,7 @@ declare namespace Phaser { * @param callback A callback to be invoked for the item removed from the array. * @param context The context in which the callback is invoked. */ - function RemoveBetween(array: any[], startIndex: integer, endIndex: integer, callback?: Function, context?: object): any[]; + function RemoveBetween(array: any[], startIndex: number, endIndex: number, callback?: Function, context?: object): any[]; /** * Removes a random object from the given array and returns it. @@ -85343,7 +95298,7 @@ declare namespace Phaser { * @param start The array index to start the search from. Default 0. * @param length Optional restriction on the number of elements to randomly select from. Default array.length. */ - function RemoveRandomElement(array: any[], start?: integer, length?: integer): object; + function RemoveRandomElement(array: any[], start?: number, length?: number): object; /** * Replaces an element of the array with the new element. @@ -85361,7 +95316,7 @@ declare namespace Phaser { * @param array The array to shift to the left. This array is modified in place. * @param total The number of times to shift the array. Default 1. */ - function RotateLeft(array: any[], total?: integer): any; + function RotateLeft(array: any[], total?: number): any; /** * Moves the element at the end of the array to the start, shifting all items in the process. @@ -85369,7 +95324,7 @@ declare namespace Phaser { * @param array The array to shift to the right. This array is modified in place. * @param total The number of times to shift the array. Default 1. */ - function RotateRight(array: any[], total?: integer): any; + function RotateRight(array: any[], total?: number): any; /** * Tests if the start and end indexes are a safe range for the given array. @@ -85378,7 +95333,7 @@ declare namespace Phaser { * @param endIndex The end index. * @param throwError Throw an error if the range is out of bounds. Default true. */ - function SafeRange(array: any[], startIndex: integer, endIndex: integer, throwError?: boolean): boolean; + function SafeRange(array: any[], startIndex: number, endIndex: number, throwError?: boolean): boolean; /** * Moves the given element to the bottom of the array. @@ -85401,7 +95356,7 @@ declare namespace Phaser { * @param startIndex An optional start index to search from. * @param endIndex An optional end index to search to. */ - function SetAll(array: any[], property: string, value: any, startIndex?: integer, endIndex?: integer): any[]; + function SetAll(array: any[], property: string, value: any, startIndex?: number, endIndex?: number): any[]; /** * Shuffles the contents of the given array using the Fisher-Yates implementation. @@ -85411,31 +95366,33 @@ declare namespace Phaser { */ function Shuffle(array: T[]): T[]; + /** + * Takes the given array and runs a numeric sort on it, ignoring any non-digits that + * may be in the entries. + * + * You should only run this on arrays containing strings. + * @param array The input array of strings. + */ + function SortByDigits(array: string[]): string[]; + /** * Removes a single item from an array and returns it without creating gc, like the native splice does. * Based on code by Mike Reinstein. * @param array The array to splice from. * @param index The index of the item which should be spliced. */ - function SpliceOne(array: any[], index: integer): any; - - namespace StableSortFunctions { - /** - * Sort the input array and simply copy it back if the result isn't in the original array, which happens on an odd number of passes. - * @param arr The input array. - * @param comp The comparison handler. - */ - function inplace(arr: any[], comp: Function): any[]; - - } + function SpliceOne(array: any[], index: number): any; /** - * A stable array sort, because `Array#sort()` is not guaranteed stable. + * An in-place stable array sort, because `Array#sort()` is not guaranteed stable. + * * This is an implementation of merge sort, without recursion. - * @param arr The input array to be sorted. - * @param comp The comparison handler. + * + * Function based on the Two-Screen/stable sort 0.1.8 from https://github.com/Two-Screen/stable + * @param array The input array to be sorted. + * @param compare The comparison function. */ - function StableSort(arr: any[], comp: Function): any[]; + function StableSort(array: any[], compare?: Function): any[]; /** * Swaps the position of two elements in the given array. @@ -85480,10 +95437,16 @@ declare namespace Phaser { namespace Objects { /** * Shallow Object Clone. Will not clone nested objects. - * @param obj the object from which to clone + * @param obj The object to clone. */ function Clone(obj: object): object; + /** + * Deep Copy the given object or array. + * @param obj The object to deep copy. + */ + function DeepCopy(obj: object): object; + /** * This is a slightly modified version of http://api.jquery.com/jQuery.extend/ * @param args The objects that will be mixed. @@ -85669,7 +95632,14 @@ declare namespace Phaser { * @param pad The string to pad it out with (defaults to a space). Default " ". * @param dir The direction dir = 1 (left), 2 (right), 3 (both). Default 3. */ - function Pad(str: string | number | object, len?: integer, pad?: string, dir?: integer): string; + function Pad(str: string | number | object, len?: number, pad?: string, dir?: number): string; + + /** + * Takes a string and removes the character at the given index. + * @param string The string to be worked on. + * @param index The index of the character to be removed. + */ + function RemoveAt(string: string, index: number): string; /** * Takes the given string and reverses it, returning the reversed string. @@ -86601,30 +96571,14 @@ declare type EachSetCallback = (entry: E, index: number)=>void; declare type EachTextureCallback = (texture: Phaser.Textures.Texture, ...args: any[])=>void; -declare type FindTileCallback = (value: Phaser.Tilemaps.Tile, index: integer, array: Phaser.Tilemaps.Tile[])=>void; +declare type FindTileCallback = (value: Phaser.Tilemaps.Tile, index: number, array: Phaser.Tilemaps.Tile[])=>void; -declare type EachTileCallback = (value: Phaser.Tilemaps.Tile, index: integer, array: Phaser.Tilemaps.Tile[])=>void; +declare type EachTileCallback = (value: Phaser.Tilemaps.Tile, index: number, array: Phaser.Tilemaps.Tile[])=>void; declare type TilemapFilterCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>void; declare type TilemapFindCallback = (value: Phaser.GameObjects.GameObject, index: number, array: Phaser.GameObjects.GameObject[])=>void; -/** - * Extends the given `myClass` object's prototype with the properties of `definition`. - * @param ctor The constructor object to mix into. - * @param definition A dictionary of functions for the class. - * @param isClassDescriptor Is the definition a class descriptor? - * @param extend The parent constructor object. - */ -declare function extend(ctor: Object, definition: Object, isClassDescriptor: boolean, extend?: Object): void; - -/** - * Applies the given `mixins` to the prototype of `myClass`. - * @param myClass The constructor object to mix into. - * @param mixins The mixins to apply to the constructor. - */ -declare function mixin(myClass: Object, mixins: Object | Object[]): void; - /** * Phaser.Class */